From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 00:46:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A1044891; Sun, 23 Feb 2014 00:46:07 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88B6A1DD1; Sun, 23 Feb 2014 00:46:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1N0k7hx036169; Sun, 23 Feb 2014 00:46:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1N0k5ui036156; Sun, 23 Feb 2014 00:46:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402230046.s1N0k5ui036156@svn.freebsd.org> From: John Baldwin Date: Sun, 23 Feb 2014 00:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262350 - in stable/10: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/amd64/vmm/io usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 00:46:07 -0000 Author: jhb Date: Sun Feb 23 00:46:05 2014 New Revision: 262350 URL: http://svnweb.freebsd.org/changeset/base/262350 Log: MFC 258859,259081,259085,259205,259213,259275,259482,259537,259702,259779: Several changes to the local APIC support in bhyve: - Rename 'vm_interrupt_hostcpu()' to 'vcpu_notify_event()'. - If a vcpu disables its local apic and then executes a 'HLT' then spin down the vcpu and destroy its thread context. Also modify the 'HLT' processing to ignore pending interrupts in the IRR if interrupts have been disabled by the guest. The interrupt cannot be injected into the guest in any case so resuming it is futile. - Use callout(9) to drive the vlapic timer instead of clocking it on each VM exit. - When the guest is bringing up the APs in the x2APIC mode a write to the ICR register will now trigger a return to userspace with an exitcode of VM_EXITCODE_SPINUP_AP. - Change the vlapic timer lock to be a spinlock because the vlapic can be accessed from within a critical section (vm run loop) when guest is using x2apic mode. - Fix the vlapic version register. - Add a command to bhyvectl to inject an NMI on a specific vcpu. - Add an API to deliver message signalled interrupts to vcpus. This allows callers to treat the MSI 'addr' and 'data' fields as opaque and also lets bhyve implement multiple destination modes: physical, flat and clustered. - Rename the ambiguously named 'vm_setup_msi()' and 'vm_setup_msix()' to 'vm_setup_pptdev_msi()' and 'vm_setup_pptdev_msix()' respectively. - Consolidate the virtual apic initialization in a single function: vlapic_reset() - Add a generic routine to trigger an LVT interrupt that supports both fixed and NMI delivery modes. - Add an ioctl and bhyvectl command to trigger local interrupts inside a guest. In particular, a global NMI similar to that raised by SERR# or PERR# can be simulated by asserting LINT1 on all vCPUs. - Extend the LVT table in the vCPU local APIC to support CMCI. - Flesh out the local APIC error reporting a bit to cache errors and report them via ESR when ESR is written to. Add support for asserting the error LVT when an error occurs. Raise illegal vector errors when attempting to signal an invalid vector for an interrupt or when sending an IPI. - Export table entries in the MADT and MP Table advertising the stock x86 config of LINT0 set to ExtInt and LINT1 wired to NMI. Modified: stable/10/lib/libvmmapi/vmmapi.c stable/10/lib/libvmmapi/vmmapi.h stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/include/vmm_dev.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/io/ppt.c stable/10/sys/amd64/vmm/io/ppt.h stable/10/sys/amd64/vmm/io/vhpet.c stable/10/sys/amd64/vmm/io/vioapic.c stable/10/sys/amd64/vmm/io/vlapic.c stable/10/sys/amd64/vmm/io/vlapic.h stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_dev.c stable/10/sys/amd64/vmm/vmm_lapic.c stable/10/sys/amd64/vmm/vmm_lapic.h stable/10/sys/amd64/vmm/vmm_msr.c stable/10/sys/amd64/vmm/vmm_msr.h stable/10/usr.sbin/bhyve/acpi.c stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/mptbl.c stable/10/usr.sbin/bhyve/pci_emul.c stable/10/usr.sbin/bhyve/pci_emul.h stable/10/usr.sbin/bhyve/pci_passthru.c stable/10/usr.sbin/bhyvectl/bhyvectl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.c Sat Feb 22 23:34:39 2014 (r262349) +++ stable/10/lib/libvmmapi/vmmapi.c Sun Feb 23 00:46:05 2014 (r262350) @@ -397,6 +397,30 @@ vm_lapic_irq(struct vmctx *ctx, int vcpu } int +vm_lapic_local_irq(struct vmctx *ctx, int vcpu, int vector) +{ + struct vm_lapic_irq vmirq; + + bzero(&vmirq, sizeof(vmirq)); + vmirq.cpuid = vcpu; + vmirq.vector = vector; + + return (ioctl(ctx->fd, VM_LAPIC_LOCAL_IRQ, &vmirq)); +} + +int +vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg) +{ + struct vm_lapic_msi vmmsi; + + bzero(&vmmsi, sizeof(vmmsi)); + vmmsi.addr = addr; + vmmsi.msg = msg; + + return (ioctl(ctx->fd, VM_LAPIC_MSI, &vmmsi)); +} + +int vm_ioapic_assert_irq(struct vmctx *ctx, int irq) { struct vm_ioapic_irq ioapic_irq; @@ -551,8 +575,8 @@ vm_map_pptdev_mmio(struct vmctx *ctx, in } int -vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int destcpu, int vector, int numvec) +vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, + uint64_t addr, uint64_t msg, int numvec) { struct vm_pptdev_msi pptmsi; @@ -561,16 +585,16 @@ vm_setup_msi(struct vmctx *ctx, int vcpu pptmsi.bus = bus; pptmsi.slot = slot; pptmsi.func = func; - pptmsi.destcpu = destcpu; - pptmsi.vector = vector; + pptmsi.msg = msg; + pptmsi.addr = addr; pptmsi.numvec = numvec; return (ioctl(ctx->fd, VM_PPTDEV_MSI, &pptmsi)); } int -vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr) +vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control) { struct vm_pptdev_msix pptmsix; Modified: stable/10/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.h Sat Feb 22 23:34:39 2014 (r262349) +++ stable/10/lib/libvmmapi/vmmapi.h Sun Feb 23 00:46:05 2014 (r262350) @@ -67,6 +67,8 @@ int vm_inject_event(struct vmctx *ctx, i int vm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type, int vector, int error_code); int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector); +int vm_lapic_local_irq(struct vmctx *ctx, int vcpu, int vector); +int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg); int vm_ioapic_assert_irq(struct vmctx *ctx, int irq); int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); @@ -81,10 +83,11 @@ int vm_assign_pptdev(struct vmctx *ctx, int vm_unassign_pptdev(struct vmctx *ctx, int bus, int slot, int func); int vm_map_pptdev_mmio(struct vmctx *ctx, int bus, int slot, int func, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); -int vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int dest, int vector, int numvec); -int vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr); +int vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot, + int func, uint64_t addr, uint64_t msg, int numvec); +int vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, + int func, int idx, uint64_t addr, uint64_t msg, + uint32_t vector_control); /* * Return a pointer to the statistics buffer. Note that this is not MT-safe. Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Sat Feb 22 23:34:39 2014 (r262349) +++ stable/10/sys/amd64/include/vmm.h Sun Feb 23 00:46:05 2014 (r262350) @@ -158,7 +158,7 @@ vcpu_is_running(struct vm *vm, int vcpu, } void *vcpu_stats(struct vm *vm, int vcpu); -void vm_interrupt_hostcpu(struct vm *vm, int vcpu); +void vcpu_notify_event(struct vm *vm, int vcpuid); struct vmspace *vm_get_vmspace(struct vm *vm); int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); @@ -266,6 +266,7 @@ enum vm_exitcode { VM_EXITCODE_PAGING, VM_EXITCODE_INST_EMUL, VM_EXITCODE_SPINUP_AP, + VM_EXITCODE_SPINDOWN_CPU, VM_EXITCODE_MAX }; @@ -310,6 +311,9 @@ struct vm_exit { int vcpu; uint64_t rip; } spinup_ap; + struct { + uint64_t rflags; + } hlt; } u; }; Modified: stable/10/sys/amd64/include/vmm_dev.h ============================================================================== --- stable/10/sys/amd64/include/vmm_dev.h Sat Feb 22 23:34:39 2014 (r262349) +++ stable/10/sys/amd64/include/vmm_dev.h Sun Feb 23 00:46:05 2014 (r262350) @@ -66,6 +66,11 @@ struct vm_event { int error_code_valid; }; +struct vm_lapic_msi { + uint64_t msg; + uint64_t addr; +}; + struct vm_lapic_irq { int cpuid; int vector; @@ -103,8 +108,8 @@ struct vm_pptdev_msi { int slot; int func; int numvec; /* 0 means disabled */ - int vector; - int destcpu; + uint64_t msg; + uint64_t addr; }; struct vm_pptdev_msix { @@ -113,7 +118,7 @@ struct vm_pptdev_msix { int slot; int func; int idx; - uint32_t msg; + uint64_t msg; uint32_t vector_control; uint64_t addr; }; @@ -175,6 +180,8 @@ enum { IOCNUM_IOAPIC_ASSERT_IRQ = 33, IOCNUM_IOAPIC_DEASSERT_IRQ = 34, IOCNUM_IOAPIC_PULSE_IRQ = 35, + IOCNUM_LAPIC_MSI = 36, + IOCNUM_LAPIC_LOCAL_IRQ = 37, /* PCI pass-thru */ IOCNUM_BIND_PPTDEV = 40, @@ -211,6 +218,10 @@ enum { _IOW('v', IOCNUM_INJECT_EVENT, struct vm_event) #define VM_LAPIC_IRQ \ _IOW('v', IOCNUM_LAPIC_IRQ, struct vm_lapic_irq) +#define VM_LAPIC_LOCAL_IRQ \ + _IOW('v', IOCNUM_LAPIC_LOCAL_IRQ, struct vm_lapic_irq) +#define VM_LAPIC_MSI \ + _IOW('v', IOCNUM_LAPIC_MSI, struct vm_lapic_msi) #define VM_IOAPIC_ASSERT_IRQ \ _IOW('v', IOCNUM_IOAPIC_ASSERT_IRQ, struct vm_ioapic_irq) #define VM_IOAPIC_DEASSERT_IRQ \ Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Sat Feb 22 23:34:39 2014 (r262349) +++ stable/10/sys/amd64/vmm/intel/vmx.c Sun Feb 23 00:46:05 2014 (r262350) @@ -1359,7 +1359,8 @@ vmx_exit_process(struct vmx *vmx, int vc struct vmcs *vmcs; struct vmxctx *vmxctx; uint32_t eax, ecx, edx, idtvec_info, idtvec_err, reason; - uint64_t qual, gpa; + uint64_t qual, gpa, rflags; + bool retu; handled = 0; vmcs = &vmx->vmcs[vcpu]; @@ -1405,31 +1406,46 @@ vmx_exit_process(struct vmx *vmx, int vc break; case EXIT_REASON_RDMSR: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_RDMSR, 1); + retu = false; ecx = vmxctx->guest_rcx; - error = emulate_rdmsr(vmx->vm, vcpu, ecx); + error = emulate_rdmsr(vmx->vm, vcpu, ecx, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_RDMSR; vmexit->u.msr.code = ecx; - } else + } else if (!retu) { handled = 1; + } else { + /* Return to userspace with a valid exitcode */ + KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS, + ("emulate_wrmsr retu with bogus exitcode")); + } break; case EXIT_REASON_WRMSR: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_WRMSR, 1); + retu = false; eax = vmxctx->guest_rax; ecx = vmxctx->guest_rcx; edx = vmxctx->guest_rdx; error = emulate_wrmsr(vmx->vm, vcpu, ecx, - (uint64_t)edx << 32 | eax); + (uint64_t)edx << 32 | eax, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_WRMSR; vmexit->u.msr.code = ecx; vmexit->u.msr.wval = (uint64_t)edx << 32 | eax; - } else + } else if (!retu) { handled = 1; + } else { + /* Return to userspace with a valid exitcode */ + KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS, + ("emulate_wrmsr retu with bogus exitcode")); + } break; case EXIT_REASON_HLT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1); + if ((error = vmread(VMCS_GUEST_RFLAGS, &rflags)) != 0) + panic("vmx_exit_process: vmread(rflags) %d", error); vmexit->exitcode = VM_EXITCODE_HLT; + vmexit->u.hlt.rflags = rflags; break; case EXIT_REASON_MTF: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_MTRAP, 1); @@ -1584,7 +1600,6 @@ vmx_run(void *arg, int vcpu, register_t panic("vmx_run: error %d setting up pcpu defaults", error); do { - lapic_timer_tick(vmx->vm, vcpu); vmx_inject_interrupts(vmx, vcpu); vmx_run_trace(vmx, vcpu); rc = vmx_setjmp(vmxctx); Modified: stable/10/sys/amd64/vmm/io/ppt.c ============================================================================== --- stable/10/sys/amd64/vmm/io/ppt.c Sat Feb 22 23:34:39 2014 (r262349) +++ stable/10/sys/amd64/vmm/io/ppt.c Sun Feb 23 00:46:05 2014 (r262350) @@ -72,8 +72,8 @@ MALLOC_DEFINE(M_PPTMSIX, "pptmsix", "Pas struct pptintr_arg { /* pptintr(pptintr_arg) */ struct pptdev *pptdev; - int vec; - int vcpu; + uint64_t addr; + uint64_t msg_data; }; static struct pptdev { @@ -412,16 +412,14 @@ ppt_map_mmio(struct vm *vm, int bus, int static int pptintr(void *arg) { - int vec; struct pptdev *ppt; struct pptintr_arg *pptarg; pptarg = arg; ppt = pptarg->pptdev; - vec = pptarg->vec; if (ppt->vm != NULL) - lapic_intr_edge(ppt->vm, pptarg->vcpu, vec); + lapic_intr_msi(ppt->vm, pptarg->addr, pptarg->msg_data); else { /* * XXX @@ -441,15 +439,13 @@ pptintr(void *arg) int ppt_setup_msi(struct vm *vm, int vcpu, int bus, int slot, int func, - int destcpu, int vector, int numvec) + uint64_t addr, uint64_t msg, int numvec) { int i, rid, flags; int msi_count, startrid, error, tmp; struct pptdev *ppt; - if ((destcpu >= VM_MAXCPU || destcpu < 0) || - (vector < 0 || vector > 255) || - (numvec < 0 || numvec > MAX_MSIMSGS)) + if (numvec < 0 || numvec > MAX_MSIMSGS) return (EINVAL); ppt = ppt_find(bus, slot, func); @@ -513,8 +509,8 @@ ppt_setup_msi(struct vm *vm, int vcpu, i break; ppt->msi.arg[i].pptdev = ppt; - ppt->msi.arg[i].vec = vector + i; - ppt->msi.arg[i].vcpu = destcpu; + ppt->msi.arg[i].addr = addr; + ppt->msi.arg[i].msg_data = msg + i; error = bus_setup_intr(ppt->dev, ppt->msi.res[i], INTR_TYPE_NET | INTR_MPSAFE, @@ -534,7 +530,7 @@ ppt_setup_msi(struct vm *vm, int vcpu, i int ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr) + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control) { struct pptdev *ppt; struct pci_devinfo *dinfo; @@ -605,8 +601,8 @@ ppt_setup_msix(struct vm *vm, int vcpu, return (ENXIO); ppt->msix.arg[idx].pptdev = ppt; - ppt->msix.arg[idx].vec = msg & 0xFF; - ppt->msix.arg[idx].vcpu = (addr >> 12) & 0xFF; + ppt->msix.arg[idx].addr = addr; + ppt->msix.arg[idx].msg_data = msg; /* Setup the MSI-X interrupt */ error = bus_setup_intr(ppt->dev, ppt->msix.res[idx], Modified: stable/10/sys/amd64/vmm/io/ppt.h ============================================================================== --- stable/10/sys/amd64/vmm/io/ppt.h Sat Feb 22 23:34:39 2014 (r262349) +++ stable/10/sys/amd64/vmm/io/ppt.h Sun Feb 23 00:46:05 2014 (r262350) @@ -33,9 +33,9 @@ int ppt_unassign_all(struct vm *vm); int ppt_map_mmio(struct vm *vm, int bus, int slot, int func, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); int ppt_setup_msi(struct vm *vm, int vcpu, int bus, int slot, int func, - int destcpu, int vector, int numvec); + uint64_t addr, uint64_t msg, int numvec); int ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr); + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); int ppt_num_devices(struct vm *vm); boolean_t ppt_is_mmio(struct vm *vm, vm_paddr_t gpa); Modified: stable/10/sys/amd64/vmm/io/vhpet.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vhpet.c Sat Feb 22 23:34:39 2014 (r262349) +++ stable/10/sys/amd64/vmm/io/vhpet.c Sun Feb 23 00:46:05 2014 (r262350) @@ -240,8 +240,7 @@ vhpet_timer_edge_trig(struct vhpet *vhpe static void vhpet_timer_interrupt(struct vhpet *vhpet, int n) { - int apicid, vector, vcpuid, pin; - cpuset_t dmask; + int pin; /* If interrupts are not enabled for this timer then just return. */ if (!vhpet_timer_interrupt_enabled(vhpet, n)) @@ -256,26 +255,8 @@ vhpet_timer_interrupt(struct vhpet *vhpe } if (vhpet_timer_msi_enabled(vhpet, n)) { - /* - * XXX should have an API 'vlapic_deliver_msi(vm, addr, data)' - * - assuming physical delivery mode - * - no need to interpret contents of 'msireg' here - */ - vector = vhpet->timer[n].msireg & 0xff; - apicid = (vhpet->timer[n].msireg >> (32 + 12)) & 0xff; - if (apicid != 0xff) { - /* unicast */ - vcpuid = vm_apicid2vcpuid(vhpet->vm, apicid); - lapic_intr_edge(vhpet->vm, vcpuid, vector); - } else { - /* broadcast */ - dmask = vm_active_cpus(vhpet->vm); - while ((vcpuid = CPU_FFS(&dmask)) != 0) { - vcpuid--; - CPU_CLR(vcpuid, &dmask); - lapic_intr_edge(vhpet->vm, vcpuid, vector); - } - } + lapic_intr_msi(vhpet->vm, vhpet->timer[n].msireg >> 32, + vhpet->timer[n].msireg & 0xffffffff); return; } Modified: stable/10/sys/amd64/vmm/io/vioapic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vioapic.c Sat Feb 22 23:34:39 2014 (r262349) +++ stable/10/sys/amd64/vmm/io/vioapic.c Sun Feb 23 00:46:05 2014 (r262350) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "vmm_ktr.h" #include "vmm_lapic.h" +#include "vlapic.h" #include "vioapic.h" #define IOREGSEL 0x00 @@ -91,25 +92,14 @@ pinstate_str(bool asserted) else return ("deasserted"); } - -static const char * -trigger_str(bool level) -{ - - if (level) - return ("level"); - else - return ("edge"); -} #endif static void vioapic_send_intr(struct vioapic *vioapic, int pin) { - int vector, apicid, vcpuid; - uint32_t low, high; - cpuset_t dmask; - bool level; + int vector, delmode; + uint32_t low, high, dest; + bool level, phys; KASSERT(pin >= 0 && pin < REDIR_ENTRIES, ("vioapic_set_pinstate: invalid pin number %d", pin)); @@ -120,52 +110,20 @@ vioapic_send_intr(struct vioapic *vioapi low = vioapic->rtbl[pin].reg; high = vioapic->rtbl[pin].reg >> 32; - /* - * XXX We only deal with: - * - physical destination - * - fixed delivery mode - */ - if ((low & IOART_DESTMOD) != IOART_DESTPHY) { - VIOAPIC_CTR2(vioapic, "ioapic pin%d: unsupported dest mode " - "0x%08x", pin, low); - return; - } - - if ((low & IOART_DELMOD) != IOART_DELFIXED) { - VIOAPIC_CTR2(vioapic, "ioapic pin%d: unsupported delivery mode " - "0x%08x", pin, low); - return; - } - if ((low & IOART_INTMASK) == IOART_INTMSET) { VIOAPIC_CTR1(vioapic, "ioapic pin%d: masked", pin); return; } + phys = ((low & IOART_DESTMOD) == IOART_DESTPHY); + delmode = low & IOART_DELMOD; level = low & IOART_TRGRLVL ? true : false; if (level) vioapic->rtbl[pin].reg |= IOART_REM_IRR; vector = low & IOART_INTVEC; - apicid = high >> APIC_ID_SHIFT; - if (apicid != 0xff) { - /* unicast */ - vcpuid = vm_apicid2vcpuid(vioapic->vm, apicid); - VIOAPIC_CTR4(vioapic, "ioapic pin%d: %s triggered intr " - "vector %d on vcpuid %d", pin, trigger_str(level), - vector, vcpuid); - lapic_set_intr(vioapic->vm, vcpuid, vector, level); - } else { - /* broadcast */ - VIOAPIC_CTR3(vioapic, "ioapic pin%d: %s triggered intr " - "vector %d on all vcpus", pin, trigger_str(level), vector); - dmask = vm_active_cpus(vioapic->vm); - while ((vcpuid = CPU_FFS(&dmask)) != 0) { - vcpuid--; - CPU_CLR(vcpuid, &dmask); - lapic_set_intr(vioapic->vm, vcpuid, vector, level); - } - } + dest = high >> APIC_ID_SHIFT; + vlapic_deliver_intr(vioapic->vm, level, dest, phys, delmode, vector); } static void Modified: stable/10/sys/amd64/vmm/io/vlapic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vlapic.c Sat Feb 22 23:34:39 2014 (r262349) +++ stable/10/sys/amd64/vmm/io/vlapic.c Sun Feb 23 00:46:05 2014 (r262350) @@ -30,8 +30,10 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include #include @@ -53,6 +55,9 @@ __FBSDID("$FreeBSD$"); #define VLAPIC_CTR1(vlapic, format, p1) \ VCPU_CTR1((vlapic)->vm, (vlapic)->vcpuid, format, p1) +#define VLAPIC_CTR2(vlapic, format, p1, p2) \ + VCPU_CTR2((vlapic)->vm, (vlapic)->vcpuid, format, p1, p2) + #define VLAPIC_CTR_IRR(vlapic, msg) \ do { \ uint32_t *irrptr = &(vlapic)->apic.irr0; \ @@ -86,7 +91,7 @@ static MALLOC_DEFINE(M_VLAPIC, "vlapic", #define PRIO(x) ((x) >> 4) #define VLAPIC_VERSION (16) -#define VLAPIC_MAXLVT_ENTRIES (5) +#define VLAPIC_MAXLVT_ENTRIES (APIC_LVT_CMCI) #define x2apic(vlapic) (((vlapic)->msr_apicbase & APICBASE_X2APIC) ? 1 : 0) @@ -100,12 +105,16 @@ struct vlapic { struct vm *vm; int vcpuid; - struct LAPIC apic; + struct LAPIC apic; - int esr_update; + uint32_t esr_pending; + int esr_firing; - int divisor; - int ccr_ticks; + struct callout callout; /* vlapic timer */ + struct bintime timer_fire_bt; /* callout expiry time */ + struct bintime timer_freq_bt; /* timer frequency */ + struct bintime timer_period_bt; /* timer period */ + struct mtx timer_mtx; /* * The 'isrvec_stk' is a stack of vectors injected by the local apic. @@ -120,8 +129,101 @@ struct vlapic { enum boot_state boot_state; }; +/* + * The 'vlapic->timer_mtx' is used to provide mutual exclusion between the + * vlapic_callout_handler() and vcpu accesses to the following registers: + * - initial count register aka icr_timer + * - current count register aka ccr_timer + * - divide config register aka dcr_timer + * - timer LVT register + * + * Note that the vlapic_callout_handler() does not write to any of these + * registers so they can be safely read from the vcpu context without locking. + */ +#define VLAPIC_TIMER_LOCK(vlapic) mtx_lock_spin(&((vlapic)->timer_mtx)) +#define VLAPIC_TIMER_UNLOCK(vlapic) mtx_unlock_spin(&((vlapic)->timer_mtx)) +#define VLAPIC_TIMER_LOCKED(vlapic) mtx_owned(&((vlapic)->timer_mtx)) + #define VLAPIC_BUS_FREQ tsc_freq +static __inline uint32_t +vlapic_get_id(struct vlapic *vlapic) +{ + + if (x2apic(vlapic)) + return (vlapic->vcpuid); + else + return (vlapic->vcpuid << 24); +} + +static __inline uint32_t +vlapic_get_ldr(struct vlapic *vlapic) +{ + struct LAPIC *lapic; + int apicid; + uint32_t ldr; + + lapic = &vlapic->apic; + if (x2apic(vlapic)) { + apicid = vlapic_get_id(vlapic); + ldr = 1 << (apicid & 0xf); + ldr |= (apicid & 0xffff0) << 12; + return (ldr); + } else + return (lapic->ldr); +} + +static __inline uint32_t +vlapic_get_dfr(struct vlapic *vlapic) +{ + struct LAPIC *lapic; + + lapic = &vlapic->apic; + if (x2apic(vlapic)) + return (0); + else + return (lapic->dfr); +} + +static void +vlapic_set_dfr(struct vlapic *vlapic, uint32_t data) +{ + uint32_t dfr; + struct LAPIC *lapic; + + if (x2apic(vlapic)) { + VM_CTR1(vlapic->vm, "write to DFR in x2apic mode: %#x", data); + return; + } + + lapic = &vlapic->apic; + dfr = (lapic->dfr & APIC_DFR_RESERVED) | (data & APIC_DFR_MODEL_MASK); + if ((dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_FLAT) + VLAPIC_CTR0(vlapic, "vlapic DFR in Flat Model"); + else if ((dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_CLUSTER) + VLAPIC_CTR0(vlapic, "vlapic DFR in Cluster Model"); + else + VLAPIC_CTR1(vlapic, "vlapic DFR in Unknown Model %#x", dfr); + + lapic->dfr = dfr; +} + +static void +vlapic_set_ldr(struct vlapic *vlapic, uint32_t data) +{ + struct LAPIC *lapic; + + /* LDR is read-only in x2apic mode */ + if (x2apic(vlapic)) { + VLAPIC_CTR1(vlapic, "write to LDR in x2apic mode: %#x", data); + return; + } + + lapic = &vlapic->apic; + lapic->ldr = data & ~APIC_LDR_RESERVED; + VLAPIC_CTR1(vlapic, "vlapic LDR set to %#x", lapic->ldr); +} + static int vlapic_timer_divisor(uint32_t dcr) { @@ -167,48 +269,92 @@ vlapic_dump_lvt(uint32_t offset, uint32_ } #endif -static uint64_t +static uint32_t vlapic_get_ccr(struct vlapic *vlapic) { - struct LAPIC *lapic = &vlapic->apic; - return lapic->ccr_timer; + struct bintime bt_now, bt_rem; + struct LAPIC *lapic; + uint32_t ccr; + + ccr = 0; + lapic = &vlapic->apic; + + VLAPIC_TIMER_LOCK(vlapic); + if (callout_active(&vlapic->callout)) { + /* + * If the timer is scheduled to expire in the future then + * compute the value of 'ccr' based on the remaining time. + */ + binuptime(&bt_now); + if (bintime_cmp(&vlapic->timer_fire_bt, &bt_now, >)) { + bt_rem = vlapic->timer_fire_bt; + bintime_sub(&bt_rem, &bt_now); + ccr += bt_rem.sec * BT2FREQ(&vlapic->timer_freq_bt); + ccr += bt_rem.frac / vlapic->timer_freq_bt.frac; + } + } + KASSERT(ccr <= lapic->icr_timer, ("vlapic_get_ccr: invalid ccr %#x, " + "icr_timer is %#x", ccr, lapic->icr_timer)); + VLAPIC_CTR2(vlapic, "vlapic ccr_timer = %#x, icr_timer = %#x", + ccr, lapic->icr_timer); + VLAPIC_TIMER_UNLOCK(vlapic); + return (ccr); } static void -vlapic_update_errors(struct vlapic *vlapic) +vlapic_set_dcr(struct vlapic *vlapic, uint32_t dcr) { - struct LAPIC *lapic = &vlapic->apic; - lapic->esr = 0; // XXX + struct LAPIC *lapic; + int divisor; + + lapic = &vlapic->apic; + VLAPIC_TIMER_LOCK(vlapic); + + lapic->dcr_timer = dcr; + divisor = vlapic_timer_divisor(dcr); + VLAPIC_CTR2(vlapic, "vlapic dcr_timer=%#x, divisor=%d", dcr, divisor); + + /* + * Update the timer frequency and the timer period. + * + * XXX changes to the frequency divider will not take effect until + * the timer is reloaded. + */ + FREQ2BT(VLAPIC_BUS_FREQ / divisor, &vlapic->timer_freq_bt); + vlapic->timer_period_bt = vlapic->timer_freq_bt; + bintime_mul(&vlapic->timer_period_bt, lapic->icr_timer); + + VLAPIC_TIMER_UNLOCK(vlapic); } static void -vlapic_init_ipi(struct vlapic *vlapic) +vlapic_update_errors(struct vlapic *vlapic) { struct LAPIC *lapic = &vlapic->apic; - lapic->version = VLAPIC_VERSION; - lapic->version |= (VLAPIC_MAXLVT_ENTRIES < MAXLVTSHIFT); - lapic->dfr = 0xffffffff; - lapic->svr = APIC_SVR_VECTOR; - vlapic_mask_lvts(&lapic->lvt_timer, VLAPIC_MAXLVT_ENTRIES+1); + lapic->esr = vlapic->esr_pending; + vlapic->esr_pending = 0; } -static int +static void vlapic_reset(struct vlapic *vlapic) { - struct LAPIC *lapic = &vlapic->apic; + struct LAPIC *lapic; + + lapic = &vlapic->apic; + bzero(lapic, sizeof(struct LAPIC)); - memset(lapic, 0, sizeof(*lapic)); - lapic->apr = vlapic->vcpuid; - vlapic_init_ipi(vlapic); - vlapic->divisor = vlapic_timer_divisor(lapic->dcr_timer); + lapic->version = VLAPIC_VERSION; + lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT); + lapic->dfr = 0xffffffff; + lapic->svr = APIC_SVR_VECTOR; + vlapic_mask_lvts(&lapic->lvt_timer, 6); + vlapic_mask_lvts(&lapic->lvt_cmci, 1); + vlapic_set_dcr(vlapic, 0); if (vlapic->vcpuid == 0) vlapic->boot_state = BS_RUNNING; /* BSP */ else vlapic->boot_state = BS_INIT; /* AP */ - - return 0; - } void @@ -221,6 +367,17 @@ vlapic_set_intr_ready(struct vlapic *vla if (vector < 0 || vector >= 256) panic("vlapic_set_intr_ready: invalid vector %d\n", vector); + if (!(lapic->svr & APIC_SVR_ENABLE)) { + VLAPIC_CTR1(vlapic, "vlapic is software disabled, ignoring " + "interrupt %d", vector); + return; + } + + if (vector < 16) { + vlapic_set_error(vlapic, APIC_ESR_RECEIVE_ILLEGAL_VECTOR); + return; + } + idx = (vector / 32) * 4; mask = 1 << (vector % 32); @@ -241,39 +398,93 @@ vlapic_set_intr_ready(struct vlapic *vla VLAPIC_CTR_IRR(vlapic, "vlapic_set_intr_ready"); } +static __inline uint32_t * +vlapic_get_lvtptr(struct vlapic *vlapic, uint32_t offset) +{ + struct LAPIC *lapic = &vlapic->apic; + int i; + + switch (offset) { + case APIC_OFFSET_CMCI_LVT: + return (&lapic->lvt_cmci); + case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: + i = (offset - APIC_OFFSET_TIMER_LVT) >> 2; + return ((&lapic->lvt_timer) + i);; + default: + panic("vlapic_get_lvt: invalid LVT\n"); + } +} + +static __inline uint32_t +vlapic_get_lvt(struct vlapic *vlapic, uint32_t offset) +{ + + return (*vlapic_get_lvtptr(vlapic, offset)); +} + static void -vlapic_start_timer(struct vlapic *vlapic, uint32_t elapsed) +vlapic_set_lvt(struct vlapic *vlapic, uint32_t offset, uint32_t val) { - uint32_t icr_timer; + uint32_t *lvtptr, mask; + struct LAPIC *lapic; + + lapic = &vlapic->apic; + lvtptr = vlapic_get_lvtptr(vlapic, offset); - icr_timer = vlapic->apic.icr_timer; + if (offset == APIC_OFFSET_TIMER_LVT) + VLAPIC_TIMER_LOCK(vlapic); - vlapic->ccr_ticks = ticks; - if (elapsed < icr_timer) - vlapic->apic.ccr_timer = icr_timer - elapsed; - else { - /* - * This can happen when the guest is trying to run its local - * apic timer higher that the setting of 'hz' in the host. - * - * We deal with this by running the guest local apic timer - * at the rate of the host's 'hz' setting. - */ - vlapic->apic.ccr_timer = 0; + if (!(lapic->svr & APIC_SVR_ENABLE)) + val |= APIC_LVT_M; + mask = APIC_LVT_M | APIC_LVT_DS | APIC_LVT_VECTOR; + switch (offset) { + case APIC_OFFSET_TIMER_LVT: + mask |= APIC_LVTT_TM; + break; + case APIC_OFFSET_ERROR_LVT: + break; + case APIC_OFFSET_LINT0_LVT: + case APIC_OFFSET_LINT1_LVT: + mask |= APIC_LVT_TM | APIC_LVT_RIRR | APIC_LVT_IIPP; + /* FALLTHROUGH */ + default: + mask |= APIC_LVT_DM; + break; } + *lvtptr = val & mask; + + if (offset == APIC_OFFSET_TIMER_LVT) + VLAPIC_TIMER_UNLOCK(vlapic); } -static __inline uint32_t * -vlapic_get_lvt(struct vlapic *vlapic, uint32_t offset) +static int +vlapic_fire_lvt(struct vlapic *vlapic, uint32_t lvt) { - struct LAPIC *lapic = &vlapic->apic; - int i; + uint32_t vec, mode; - if (offset < APIC_OFFSET_TIMER_LVT || offset > APIC_OFFSET_ERROR_LVT) { - panic("vlapic_get_lvt: invalid LVT\n"); + if (lvt & APIC_LVT_M) + return (0); + + vec = lvt & APIC_LVT_VECTOR; + mode = lvt & APIC_LVT_DM; + + switch (mode) { + case APIC_LVT_DM_FIXED: + if (vec < 16) { + vlapic_set_error(vlapic, APIC_ESR_SEND_ILLEGAL_VECTOR); + return (0); + } + vlapic_set_intr_ready(vlapic, vec, false); + vcpu_notify_event(vlapic->vm, vlapic->vcpuid); + break; + case APIC_LVT_DM_NMI: + vm_inject_nmi(vlapic->vm, vlapic->vcpuid); + break; + default: + // Other modes ignored + return (0); } - i = (offset - APIC_OFFSET_TIMER_LVT) >> 2; - return ((&lapic->lvt_timer) + i);; + return (1); } #if 1 @@ -398,44 +609,314 @@ vlapic_process_eoi(struct vlapic *vlapic } static __inline int -vlapic_get_lvt_field(uint32_t *lvt, uint32_t mask) +vlapic_get_lvt_field(uint32_t lvt, uint32_t mask) { - return (*lvt & mask); + + return (lvt & mask); } static __inline int vlapic_periodic_timer(struct vlapic *vlapic) { - uint32_t *lvt; + uint32_t lvt; lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); return (vlapic_get_lvt_field(lvt, APIC_LVTT_TM_PERIODIC)); } +static VMM_STAT(VLAPIC_INTR_ERROR, "error interrupts generated by vlapic"); + +void +vlapic_set_error(struct vlapic *vlapic, uint32_t mask) +{ + uint32_t lvt; + + vlapic->esr_pending |= mask; + if (vlapic->esr_firing) + return; + vlapic->esr_firing = 1; + + // The error LVT always uses the fixed delivery mode. + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_ERROR_LVT); + if (vlapic_fire_lvt(vlapic, lvt | APIC_LVT_DM_FIXED)) { + vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_ERROR, 1); + } + vlapic->esr_firing = 0; +} + static VMM_STAT(VLAPIC_INTR_TIMER, "timer interrupts generated by vlapic"); static void vlapic_fire_timer(struct vlapic *vlapic) { - int vector; - uint32_t *lvt; + uint32_t lvt; + + KASSERT(VLAPIC_TIMER_LOCKED(vlapic), ("vlapic_fire_timer not locked")); + // The timer LVT always uses the fixed delivery mode. lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); - - if (!vlapic_get_lvt_field(lvt, APIC_LVTT_M)) { + if (vlapic_fire_lvt(vlapic, lvt | APIC_LVT_DM_FIXED)) { vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_TIMER, 1); - vector = vlapic_get_lvt_field(lvt,APIC_LVTT_VECTOR); - vlapic_set_intr_ready(vlapic, vector, false); + } +} + +static VMM_STAT(VLAPIC_INTR_CMC, + "corrected machine check interrupts generated by vlapic"); + +void +vlapic_fire_cmci(struct vlapic *vlapic) +{ + uint32_t lvt; + + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_CMCI_LVT); + if (vlapic_fire_lvt(vlapic, lvt)) { + vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_CMC, 1); + } +} + +static VMM_STAT_ARRAY(LVTS_TRIGGERRED, VLAPIC_MAXLVT_ENTRIES, + "lvts triggered"); + +int +vlapic_trigger_lvt(struct vlapic *vlapic, int vector) +{ + uint32_t lvt; + + switch (vector) { + case APIC_LVT_LINT0: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_LINT0_LVT); + break; + case APIC_LVT_LINT1: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_LINT1_LVT); + break; + case APIC_LVT_TIMER: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); + lvt |= APIC_LVT_DM_FIXED; + break; + case APIC_LVT_ERROR: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_ERROR_LVT); + lvt |= APIC_LVT_DM_FIXED; + break; + case APIC_LVT_PMC: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_PERF_LVT); + break; + case APIC_LVT_THERMAL: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_THERM_LVT); + break; + case APIC_LVT_CMCI: + lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_CMCI_LVT); + break; + default: + return (EINVAL); + } + if (vlapic_fire_lvt(vlapic, lvt)) { + vmm_stat_array_incr(vlapic->vm, vlapic->vcpuid, + LVTS_TRIGGERRED, vector, 1); + } + return (0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 01:34:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 36696530; Sun, 23 Feb 2014 01:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06CC01285; Sun, 23 Feb 2014 01:34: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 s1N1YfQ9056172; Sun, 23 Feb 2014 01:34:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1N1YfDp056165; Sun, 23 Feb 2014 01:34:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402230134.s1N1YfDp056165@svn.freebsd.org> From: John Baldwin Date: Sun, 23 Feb 2014 01:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262352 - stable/10/sys/amd64/vmm/intel X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 01:34:42 -0000 Author: jhb Date: Sun Feb 23 01:34:40 2014 New Revision: 262352 URL: http://svnweb.freebsd.org/changeset/base/262352 Log: MFC 259542: Use vmcs_read() and vmcs_write() in preference to vmread() and vmwrite() respectively. The vmcs_xxx() functions provide inline error checking of all accesses to the VMCS. Modified: stable/10/sys/amd64/vmm/intel/vmcs.c stable/10/sys/amd64/vmm/intel/vmcs.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/intel/vmx_genassym.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.c Sun Feb 23 01:27:22 2014 (r262351) +++ stable/10/sys/amd64/vmm/intel/vmcs.c Sun Feb 23 01:34:40 2014 (r262352) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include "vmm_host.h" -#include "vmcs.h" #include "vmx_cpufunc.h" +#include "vmcs.h" #include "ept.h" #include "vmx.h" @@ -454,19 +454,6 @@ done: return (error); } -uint64_t -vmcs_read(uint32_t encoding) -{ - int error; - uint64_t val; - - error = vmread(encoding, &val); - if (error != 0) - panic("vmcs_read(%u) error %d", encoding, error); - - return (val); -} - #ifdef DDB extern int vmxon_enabled[]; Modified: stable/10/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.h Sun Feb 23 01:27:22 2014 (r262351) +++ stable/10/sys/amd64/vmm/intel/vmcs.h Sun Feb 23 01:34:40 2014 (r262352) @@ -58,7 +58,26 @@ int vmcs_getdesc(struct vmcs *vmcs, int struct seg_desc *desc); int vmcs_setdesc(struct vmcs *vmcs, int ident, struct seg_desc *desc); -uint64_t vmcs_read(uint32_t encoding); + +static __inline uint64_t +vmcs_read(uint32_t encoding) +{ + int error; + uint64_t val; + + error = vmread(encoding, &val); + KASSERT(error == 0, ("vmcs_read(%u) error %d", encoding, error)); + return (val); +} + +static __inline void +vmcs_write(uint32_t encoding, uint64_t val) +{ + int error; + + error = vmwrite(encoding, val); + KASSERT(error == 0, ("vmcs_write(%u) error %d", encoding, error)); +} #define vmexit_instruction_length() vmcs_read(VMCS_EXIT_INSTRUCTION_LENGTH) #define vmcs_guest_rip() vmcs_read(VMCS_GUEST_RIP) Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Sun Feb 23 01:27:22 2014 (r262351) +++ stable/10/sys/amd64/vmm/intel/vmx.c Sun Feb 23 01:34:40 2014 (r262352) @@ -324,9 +324,8 @@ vmx_setjmp_trace(struct vmx *vmx, int vc VCPU_CTR2((vmx)->vm, (vcpu), "setjmp return code %s(%d)", vmx_setjmp_rc2str(rc), rc); - host_rsp = host_rip = ~0; - vmread(VMCS_HOST_RIP, &host_rip); - vmread(VMCS_HOST_RSP, &host_rsp); + host_rip = vmcs_read(VMCS_HOST_RIP); + host_rsp = vmcs_read(VMCS_HOST_RSP); VCPU_CTR2((vmx)->vm, (vcpu), "vmcs host_rip 0x%016lx, host_rsp %#lx", host_rip, host_rsp); @@ -917,10 +916,10 @@ vmx_astpending_trace(struct vmx *vmx, in #endif } -static int +static void vmx_set_pcpu_defaults(struct vmx *vmx, int vcpu) { - int error, lastcpu; + int lastcpu; struct vmxstate *vmxstate; struct invvpid_desc invvpid_desc = { 0 }; @@ -928,24 +927,14 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i lastcpu = vmxstate->lastcpu; vmxstate->lastcpu = curcpu; - if (lastcpu == curcpu) { - error = 0; - goto done; - } + if (lastcpu == curcpu) + return; vmm_stat_incr(vmx->vm, vcpu, VCPU_MIGRATIONS, 1); - error = vmwrite(VMCS_HOST_TR_BASE, vmm_get_host_trbase()); - if (error != 0) - goto done; - - error = vmwrite(VMCS_HOST_GDTR_BASE, vmm_get_host_gdtrbase()); - if (error != 0) - goto done; - - error = vmwrite(VMCS_HOST_GS_BASE, vmm_get_host_gsbase()); - if (error != 0) - goto done; + vmcs_write(VMCS_HOST_TR_BASE, vmm_get_host_trbase()); + vmcs_write(VMCS_HOST_GDTR_BASE, vmm_get_host_gdtrbase()); + vmcs_write(VMCS_HOST_GS_BASE, vmm_get_host_gsbase()); /* * If we are using VPIDs then invalidate all mappings tagged with 'vpid' @@ -966,18 +955,6 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i invvpid_desc.vpid = vmxstate->vpid; invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc); } -done: - return (error); -} - -static void -vm_exit_update_rip(struct vm_exit *vmexit) -{ - int error; - - error = vmwrite(VMCS_GUEST_RIP, vmexit->rip + vmexit->inst_length); - if (error) - panic("vmx_run: error %d writing to VMCS_GUEST_RIP", error); } /* @@ -988,66 +965,45 @@ CTASSERT((PROCBASED_CTLS_ONE_SETTING & P static void __inline vmx_set_int_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls |= PROCBASED_INT_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_set_int_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static void __inline vmx_clear_int_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls &= ~PROCBASED_INT_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_clear_int_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static void __inline vmx_set_nmi_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls |= PROCBASED_NMI_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_set_nmi_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static void __inline vmx_clear_nmi_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls &= ~PROCBASED_NMI_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_clear_nmi_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static int vmx_inject_nmi(struct vmx *vmx, int vcpu) { - int error; uint64_t info, interruptibility; /* Bail out if no NMI requested */ if (!vm_nmi_pending(vmx->vm, vcpu)) return (0); - error = vmread(VMCS_GUEST_INTERRUPTIBILITY, &interruptibility); - if (error) { - panic("vmx_inject_nmi: vmread(interruptibility) %d", - error); - } + interruptibility = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); if (interruptibility & nmi_blocking_bits) goto nmiblocked; @@ -1057,10 +1013,7 @@ vmx_inject_nmi(struct vmx *vmx, int vcpu */ info = VMCS_INTERRUPTION_INFO_NMI | VMCS_INTERRUPTION_INFO_VALID; info |= IDT_NMI; - - error = vmwrite(VMCS_ENTRY_INTR_INFO, info); - if (error) - panic("vmx_inject_nmi: vmwrite(intrinfo) %d", error); + vmcs_write(VMCS_ENTRY_INTR_INFO, info); VCPU_CTR0(vmx->vm, vcpu, "Injecting vNMI"); @@ -1082,7 +1035,7 @@ nmiblocked: static void vmx_inject_interrupts(struct vmx *vmx, int vcpu) { - int error, vector; + int vector; uint64_t info, rflags, interruptibility; const int HWINTR_BLOCKED = VMCS_INTERRUPTIBILITY_STI_BLOCKING | @@ -1095,9 +1048,7 @@ vmx_inject_interrupts(struct vmx *vmx, i * VM entry but the actual entry into guest mode was aborted * because of a pending AST. */ - error = vmread(VMCS_ENTRY_INTR_INFO, &info); - if (error) - panic("vmx_inject_interrupts: vmread(intrinfo) %d", error); + info = vmcs_read(VMCS_ENTRY_INTR_INFO); if (info & VMCS_INTERRUPTION_INFO_VALID) return; @@ -1116,27 +1067,18 @@ vmx_inject_interrupts(struct vmx *vmx, i panic("vmx_inject_interrupts: invalid vector %d\n", vector); /* Check RFLAGS.IF and the interruptibility state of the guest */ - error = vmread(VMCS_GUEST_RFLAGS, &rflags); - if (error) - panic("vmx_inject_interrupts: vmread(rflags) %d", error); - + rflags = vmcs_read(VMCS_GUEST_RFLAGS); if ((rflags & PSL_I) == 0) goto cantinject; - error = vmread(VMCS_GUEST_INTERRUPTIBILITY, &interruptibility); - if (error) { - panic("vmx_inject_interrupts: vmread(interruptibility) %d", - error); - } + interruptibility = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); if (interruptibility & HWINTR_BLOCKED) goto cantinject; /* Inject the interrupt */ info = VMCS_INTERRUPTION_INFO_HW_INTR | VMCS_INTERRUPTION_INFO_VALID; info |= vector; - error = vmwrite(VMCS_ENTRY_INTR_INFO, info); - if (error) - panic("vmx_inject_interrupts: vmwrite(intrinfo) %d", error); + vmcs_write(VMCS_ENTRY_INTR_INFO, info); /* Update the Local APIC ISR */ lapic_intr_accepted(vmx->vm, vcpu, vector); @@ -1158,7 +1100,7 @@ cantinject: static int vmx_emulate_cr_access(struct vmx *vmx, int vcpu, uint64_t exitqual) { - int error, cr, vmcs_guest_cr, vmcs_shadow_cr; + int cr, vmcs_guest_cr, vmcs_shadow_cr; uint64_t crval, regval, ones_mask, zeros_mask; const struct vmxctx *vmxctx; @@ -1173,7 +1115,7 @@ vmx_emulate_cr_access(struct vmx *vmx, i vmxctx = &vmx->ctx[vcpu]; /* - * We must use vmwrite() directly here because vmcs_setreg() will + * We must use vmcs_write() directly here because vmcs_setreg() will * call vmclear(vmcs) as a side-effect which we certainly don't want. */ switch ((exitqual >> 8) & 0xf) { @@ -1190,11 +1132,7 @@ vmx_emulate_cr_access(struct vmx *vmx, i regval = vmxctx->guest_rbx; break; case 4: - error = vmread(VMCS_GUEST_RSP, ®val); - if (error) { - panic("vmx_emulate_cr_access: " - "error %d reading guest rsp", error); - } + regval = vmcs_read(VMCS_GUEST_RSP); break; case 5: regval = vmxctx->guest_rbp; @@ -1242,20 +1180,11 @@ vmx_emulate_cr_access(struct vmx *vmx, i vmcs_guest_cr = VMCS_GUEST_CR4; vmcs_shadow_cr = VMCS_CR4_SHADOW; } - - error = vmwrite(vmcs_shadow_cr, regval); - if (error) { - panic("vmx_emulate_cr_access: error %d writing cr%d shadow", - error, cr); - } + vmcs_write(vmcs_shadow_cr, regval); crval = regval | ones_mask; crval &= ~zeros_mask; - error = vmwrite(vmcs_guest_cr, crval); - if (error) { - panic("vmx_emulate_cr_access: error %d writing cr%d", - error, cr); - } + vmcs_write(vmcs_guest_cr, crval); if (cr == 0 && regval & CR0_PG) { uint64_t efer, entry_ctls; @@ -1265,29 +1194,13 @@ vmx_emulate_cr_access(struct vmx *vmx, i * the "IA-32e mode guest" bit in VM-entry control must be * equal. */ - error = vmread(VMCS_GUEST_IA32_EFER, &efer); - if (error) { - panic("vmx_emulate_cr_access: error %d efer read", - error); - } + efer = vmcs_read(VMCS_GUEST_IA32_EFER); if (efer & EFER_LME) { efer |= EFER_LMA; - error = vmwrite(VMCS_GUEST_IA32_EFER, efer); - if (error) { - panic("vmx_emulate_cr_access: error %d" - " efer write", error); - } - error = vmread(VMCS_ENTRY_CTLS, &entry_ctls); - if (error) { - panic("vmx_emulate_cr_access: error %d" - " entry ctls read", error); - } + vmcs_write(VMCS_GUEST_IA32_EFER, efer); + entry_ctls = vmcs_read(VMCS_ENTRY_CTLS); entry_ctls |= VM_ENTRY_GUEST_LMA; - error = vmwrite(VMCS_ENTRY_CTLS, entry_ctls); - if (error) { - panic("vmx_emulate_cr_access: error %d" - " entry ctls write", error); - } + vmcs_write(VMCS_ENTRY_CTLS, entry_ctls); } } @@ -1359,7 +1272,7 @@ vmx_exit_process(struct vmx *vmx, int vc struct vmcs *vmcs; struct vmxctx *vmxctx; uint32_t eax, ecx, edx, idtvec_info, idtvec_err, reason; - uint64_t qual, gpa, rflags; + uint64_t qual, gpa; bool retu; handled = 0; @@ -1388,12 +1301,13 @@ vmx_exit_process(struct vmx *vmx, int vc idtvec_info = vmcs_idt_vectoring_info(); if (idtvec_info & VMCS_IDT_VEC_VALID) { idtvec_info &= ~(1 << 12); /* clear undefined bit */ - vmwrite(VMCS_ENTRY_INTR_INFO, idtvec_info); + vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { idtvec_err = vmcs_idt_vectoring_err(); - vmwrite(VMCS_ENTRY_EXCEPTION_ERROR, idtvec_err); + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, + idtvec_err); } - vmwrite(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); + vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); } default: break; @@ -1442,10 +1356,8 @@ vmx_exit_process(struct vmx *vmx, int vc break; case EXIT_REASON_HLT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1); - if ((error = vmread(VMCS_GUEST_RFLAGS, &rflags)) != 0) - panic("vmx_exit_process: vmread(rflags) %d", error); vmexit->exitcode = VM_EXITCODE_HLT; - vmexit->u.hlt.rflags = rflags; + vmexit->u.hlt.rflags = vmcs_read(VMCS_GUEST_RFLAGS); break; case EXIT_REASON_MTF: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_MTRAP, 1); @@ -1533,9 +1445,9 @@ vmx_exit_process(struct vmx *vmx, int vc * the one we just processed. Therefore we update the * guest rip in the VMCS and in 'vmexit'. */ - vm_exit_update_rip(vmexit); vmexit->rip += vmexit->inst_length; vmexit->inst_length = 0; + vmcs_write(VMCS_GUEST_RIP, vmexit->rip); } else { if (vmexit->exitcode == VM_EXITCODE_BOGUS) { /* @@ -1557,7 +1469,7 @@ vmx_exit_process(struct vmx *vmx, int vc static int vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap) { - int error, vie, rc, handled, astpending; + int vie, rc, handled, astpending; uint32_t exit_reason; struct vmx *vmx; struct vmxctx *vmxctx; @@ -1590,14 +1502,9 @@ vmx_run(void *arg, int vcpu, register_t * If the life of a virtual machine was spent entirely in the context * of a single process we could do this once in vmcs_set_defaults(). */ - if ((error = vmwrite(VMCS_HOST_CR3, rcr3())) != 0) - panic("vmx_run: error %d writing to VMCS_HOST_CR3", error); - - if ((error = vmwrite(VMCS_GUEST_RIP, rip)) != 0) - panic("vmx_run: error %d writing to VMCS_GUEST_RIP", error); - - if ((error = vmx_set_pcpu_defaults(vmx, vcpu)) != 0) - panic("vmx_run: error %d setting up pcpu defaults", error); + vmcs_write(VMCS_HOST_CR3, rcr3()); + vmcs_write(VMCS_GUEST_RIP, rip); + vmx_set_pcpu_defaults(vmx, vcpu); do { vmx_inject_interrupts(vmx, vcpu); Modified: stable/10/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_genassym.c Sun Feb 23 01:27:22 2014 (r262351) +++ stable/10/sys/amd64/vmm/intel/vmx_genassym.c Sun Feb 23 01:34:40 2014 (r262352) @@ -39,8 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include "vmx.h" #include "vmx_cpufunc.h" +#include "vmx.h" ASSYM(VMXCTX_TMPSTKTOP, offsetof(struct vmxctx, tmpstktop)); ASSYM(VMXCTX_GUEST_RDI, offsetof(struct vmxctx, guest_rdi)); From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 09:44:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 38E7283F; Sun, 23 Feb 2014 09:44: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2324B1AD3; Sun, 23 Feb 2014 09:44:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1N9iUwn051627; Sun, 23 Feb 2014 09:44:31 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1N9iUqN051626; Sun, 23 Feb 2014 09:44:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402230944.s1N9iUqN051626@svn.freebsd.org> From: Christian Brueffer Date: Sun, 23 Feb 2014 09:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262358 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 09:44:31 -0000 Author: brueffer Date: Sun Feb 23 09:44:30 2014 New Revision: 262358 URL: http://svnweb.freebsd.org/changeset/base/262358 Log: MFC: r262243 Fix a cross-reference. Modified: stable/10/share/man/man7/hier.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/hier.7 ============================================================================== --- stable/10/share/man/man7/hier.7 Sun Feb 23 08:22:31 2014 (r262357) +++ stable/10/share/man/man7/hier.7 Sun Feb 23 09:44:30 2014 (r262358) @@ -703,7 +703,9 @@ source code for files in The .Fx test suite. -See tests(7) for more details. +See +.Xr tests 7 +for more details. .El .It Pa /var/ multi-purpose log, temporary, transient, and spool files From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 13:11:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9EADB14E; Sun, 23 Feb 2014 13:11:33 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F4F71B73; Sun, 23 Feb 2014 13:11:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NDBX0l037661; Sun, 23 Feb 2014 13:11:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NDBXv2037660; Sun, 23 Feb 2014 13:11:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402231311.s1NDBXv2037660@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 23 Feb 2014 13:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262360 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 13:11:33 -0000 Author: hselasky Date: Sun Feb 23 13:11:33 2014 New Revision: 262360 URL: http://svnweb.freebsd.org/changeset/base/262360 Log: MFC r261795: Issue doorbell twice before finally freeing the DMA descriptors. This should fix DMA descriptor caching issues seen with the EHCI controller found in Google Chromebook C720 during removal and insertion of USB devices. Modified: stable/10/sys/dev/usb/controller/ehci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/10/sys/dev/usb/controller/ehci.c Sun Feb 23 13:08:18 2014 (r262359) +++ stable/10/sys/dev/usb/controller/ehci.c Sun Feb 23 13:11:33 2014 (r262360) @@ -2261,10 +2261,26 @@ ehci_device_bulk_enter(struct usb_xfer * } static void +ehci_doorbell_async(struct ehci_softc *sc) +{ + uint32_t temp; + + /* + * XXX Performance quirk: Some Host Controllers have a too low + * interrupt rate. Issue an IAAD to stimulate the Host + * Controller after queueing the BULK transfer. + * + * XXX Force the host controller to refresh any QH caches. + */ + temp = EOREAD4(sc, EHCI_USBCMD); + if (!(temp & EHCI_CMD_IAAD)) + EOWRITE4(sc, EHCI_USBCMD, temp | EHCI_CMD_IAAD); +} + +static void ehci_device_bulk_start(struct usb_xfer *xfer) { ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); - uint32_t temp; /* setup TD's and QH */ ehci_setup_standard_chain(xfer, &sc->sc_async_p_last); @@ -2279,13 +2295,7 @@ ehci_device_bulk_start(struct usb_xfer * if (sc->sc_flags & EHCI_SCFLG_IAADBUG) return; - /* XXX Performance quirk: Some Host Controllers have a too low - * interrupt rate. Issue an IAAD to stimulate the Host - * Controller after queueing the BULK transfer. - */ - temp = EOREAD4(sc, EHCI_USBCMD); - if (!(temp & EHCI_CMD_IAAD)) - EOWRITE4(sc, EHCI_USBCMD, temp | EHCI_CMD_IAAD); + ehci_doorbell_async(sc); } struct usb_pipe_methods ehci_device_bulk_methods = @@ -3902,6 +3912,41 @@ ehci_set_hw_power(struct usb_bus *bus) return; } +static void +ehci_start_dma_delay_second(struct usb_xfer *xfer) +{ + struct ehci_softc *sc = EHCI_BUS2SC(xfer->xroot->bus); + + DPRINTF("\n"); + + /* trigger doorbell */ + ehci_doorbell_async(sc); + + /* give the doorbell 4ms */ + usbd_transfer_timeout_ms(xfer, + (void (*)(void *))&usb_dma_delay_done_cb, 4); +} + +/* + * Ring the doorbell twice before freeing any DMA descriptors. Some host + * controllers apparently cache the QH descriptors and need a message + * that the cache needs to be discarded. + */ +static void +ehci_start_dma_delay(struct usb_xfer *xfer) +{ + struct ehci_softc *sc = EHCI_BUS2SC(xfer->xroot->bus); + + DPRINTF("\n"); + + /* trigger doorbell */ + ehci_doorbell_async(sc); + + /* give the doorbell 4ms */ + usbd_transfer_timeout_ms(xfer, + (void (*)(void *))&ehci_start_dma_delay_second, 4); +} + struct usb_bus_methods ehci_bus_methods = { .endpoint_init = ehci_ep_init, @@ -3914,4 +3959,5 @@ struct usb_bus_methods ehci_bus_methods .set_hw_power_sleep = ehci_set_hw_power_sleep, .roothub_exec = ehci_roothub_exec, .xfer_poll = ehci_do_poll, + .start_dma_delay = ehci_start_dma_delay, }; From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 13:22:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4BC4E540; Sun, 23 Feb 2014 13:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 29D4D1C10; Sun, 23 Feb 2014 13:22: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 s1NDM6lr041975; Sun, 23 Feb 2014 13:22:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NDM4Fr041967; Sun, 23 Feb 2014 13:22:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402231322.s1NDM4Fr041967@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 23 Feb 2014 13:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262363 - in stable/10/sys: conf dev/usb dev/usb/net modules/usb modules/usb/urndis X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 13:22:06 -0000 Author: hselasky Date: Sun Feb 23 13:22:04 2014 New Revision: 262363 URL: http://svnweb.freebsd.org/changeset/base/262363 Log: MFC r261541, r261543 and r261544: Import USB RNDIS driver to FreeBSD from OpenBSD. Useful for so-called USB tethering. - Imported code from OpenBSD - Adapted code to FreeBSD - Removed some unused functions - Fixed some buffer encoding and decoding issues - Optimised data transport path a bit, by sending multiple packets at a time - Increased receive buffer to 16K Added: stable/10/sys/dev/usb/net/if_urndis.c - copied, changed from r261541, head/sys/dev/usb/net/if_urndis.c stable/10/sys/dev/usb/net/if_urndisreg.h - copied, changed from r261541, head/sys/dev/usb/net/if_urndisreg.h stable/10/sys/modules/usb/urndis/ - copied from r261541, head/sys/modules/usb/urndis/ Modified: stable/10/sys/conf/NOTES stable/10/sys/conf/files stable/10/sys/dev/usb/usb.h stable/10/sys/modules/usb/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Sun Feb 23 13:20:08 2014 (r262362) +++ stable/10/sys/conf/NOTES Sun Feb 23 13:22:04 2014 (r262363) @@ -2742,6 +2742,8 @@ device upgt # Ralink Technology RT2500USB wireless driver device ural # +# RNDIS USB ethernet driver +device urndis # Realtek RTL8187B/L wireless driver device urtw # Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sun Feb 23 13:20:08 2014 (r262362) +++ stable/10/sys/conf/files Sun Feb 23 13:22:04 2014 (r262363) @@ -2359,9 +2359,11 @@ dev/usb/net/if_rue.c optional rue dev/usb/net/if_smsc.c optional smsc dev/usb/net/if_udav.c optional udav dev/usb/net/if_usie.c optional usie +dev/usb/net/if_urndis.c optional urndis dev/usb/net/ruephy.c optional rue dev/usb/net/usb_ethernet.c optional aue | axe | axge | cdce | cue | kue | \ - mos | rue | smsc | udav | ipheth + mos | rue | smsc | udav | ipheth | \ + urndis dev/usb/net/uhso.c optional uhso # # USB WLAN drivers Copied and modified: stable/10/sys/dev/usb/net/if_urndis.c (from r261541, head/sys/dev/usb/net/if_urndis.c) ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Thu Feb 6 08:47:14 2014 (r261541, copy source) +++ stable/10/sys/dev/usb/net/if_urndis.c Sun Feb 23 13:22:04 2014 (r262363) @@ -170,8 +170,11 @@ static const struct usb_ether_methods ur }; static const STRUCT_USB_HOST_ID urndis_host_devs[] = { +#if 0 + /* XXX this entry has a conflict an entry the umodem driver XXX */ {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), USB_IFACE_PROTOCOL(0xff)}, +#endif {USB_IFACE_CLASS(UICLASS_WIRELESS), USB_IFACE_SUBCLASS(UISUBCLASS_RF), USB_IFACE_PROTOCOL(UIPROTO_RNDIS)}, {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(UISUBCLASS_SYNC), @@ -838,7 +841,7 @@ urndis_bulk_read_callback(struct usb_xfe DPRINTF("invalid dataoffset %u larger than %u\n", msg.rm_dataoffset + msg.rm_datalen + (uint32_t)__offsetof(struct urndis_packet_msg, - rm_dataoffset)); + rm_dataoffset), actlen); goto tr_setup; } else if (msg.rm_datalen < (uint32_t)sizeof(struct ether_header)) { ifp->if_ierrors++; Copied and modified: stable/10/sys/dev/usb/net/if_urndisreg.h (from r261541, head/sys/dev/usb/net/if_urndisreg.h) ============================================================================== --- head/sys/dev/usb/net/if_urndisreg.h Thu Feb 6 08:47:14 2014 (r261541, copy source) +++ stable/10/sys/dev/usb/net/if_urndisreg.h Sun Feb 23 13:22:04 2014 (r262363) @@ -53,7 +53,7 @@ struct urndis_softc { #define URNDIS_LOCK(sc) mtx_lock(&(sc)->sc_mtx) #define URNDIS_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) -#define URNDIS_LOCK_ASSERT(sc, what) mtx_assert(&(sc)->sc_mtx, (x)) +#define URNDIS_LOCK_ASSERT(sc, what) mtx_assert(&(sc)->sc_mtx, (what)) #define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L #define RNDIS_STATUS_FAILURE 0xC0000001L Modified: stable/10/sys/dev/usb/usb.h ============================================================================== --- stable/10/sys/dev/usb/usb.h Sun Feb 23 13:20:08 2014 (r262362) +++ stable/10/sys/dev/usb/usb.h Sun Feb 23 13:22:04 2014 (r262363) @@ -499,8 +499,11 @@ typedef struct usb_interface_assoc_descr #define UICLASS_WIRELESS 0xe0 #define UISUBCLASS_RF 0x01 #define UIPROTO_BLUETOOTH 0x01 +#define UIPROTO_RNDIS 0x03 #define UICLASS_IAD 0xEF /* Interface Association Descriptor */ +#define UISUBCLASS_SYNC 0x01 +#define UIPROTO_ACTIVESYNC 0x01 #define UICLASS_APPL_SPEC 0xfe #define UISUBCLASS_FIRMWARE_DOWNLOAD 1 Modified: stable/10/sys/modules/usb/Makefile ============================================================================== --- stable/10/sys/modules/usb/Makefile Sun Feb 23 13:20:08 2014 (r262362) +++ stable/10/sys/modules/usb/Makefile Sun Feb 23 13:22:04 2014 (r262363) @@ -39,6 +39,7 @@ SUBDIR += atp uhid ukbd ums udbp ufm uep SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umcs umodem umoscom uplcom uslcom uvisor uvscom SUBDIR += uether aue axe axge cdce cue ${_kue} mos rue smsc udav uhso ipheth +SUBDIR += urndis SUBDIR += usfs umass urio SUBDIR += quirk template SUBDIR += ${_g_audio} ${_g_keyboard} ${_g_modem} ${_g_mouse} From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 13:25:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC6066A2; Sun, 23 Feb 2014 13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A52151C2A; Sun, 23 Feb 2014 13:25:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NDPhTi042379; Sun, 23 Feb 2014 13:25:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NDPhtd042378; Sun, 23 Feb 2014 13:25:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402231325.s1NDPhtd042378@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 23 Feb 2014 13:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262364 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 13:25:43 -0000 Author: hselasky Date: Sun Feb 23 13:25:43 2014 New Revision: 262364 URL: http://svnweb.freebsd.org/changeset/base/262364 Log: MFC r261981: Add new PCI ID for hardware which needs port routing for USB 3.0. PR: usb/186811 Modified: stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Sun Feb 23 13:22:04 2014 (r262363) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Sun Feb 23 13:25:43 2014 (r262364) @@ -102,6 +102,7 @@ xhci_pci_match(device_t self) case 0x10421b21: return ("ASMedia ASM1042 USB 3.0 controller"); + case 0x9c318086: case 0x1e318086: return ("Intel Panther Point USB 3.0 controller"); case 0x8c318086: @@ -237,6 +238,7 @@ xhci_pci_attach(device_t self) /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ switch (pci_get_devid(self)) { + case 0x9c318086: /* Panther Point */ case 0x1e318086: /* Panther Point */ case 0x8c318086: /* Lynx Point */ sc->sc_port_route = &xhci_pci_port_route; From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 13:33:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 31A4DDA2; Sun, 23 Feb 2014 13:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3D001CE6; Sun, 23 Feb 2014 13: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 s1NDXLZb046267; Sun, 23 Feb 2014 13:33:21 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NDXLWL046266; Sun, 23 Feb 2014 13:33:21 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402231333.s1NDXLWL046266@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 23 Feb 2014 13:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262369 - stable/10/sys/dev/usb/input X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 13:33:22 -0000 Author: hselasky Date: Sun Feb 23 13:33:21 2014 New Revision: 262369 URL: http://svnweb.freebsd.org/changeset/base/262369 Log: MFC r261827: - Remove not needed definitions from driver. - Get USB input report length from HID descriptor. - Use 1 finger TAP for devices which has no integrated button. - Move data buffer to softc instead of allocating it. Modified: stable/10/sys/dev/usb/input/wsp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/input/wsp.c ============================================================================== --- stable/10/sys/dev/usb/input/wsp.c Sun Feb 23 13:31:39 2014 (r262368) +++ stable/10/sys/dev/usb/input/wsp.c Sun Feb 23 13:33:21 2014 (r262369) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #define WSP_DRIVER_NAME "wsp" +#define WSP_BUFFER_MAX 1024 #define WSP_CLAMP(x,low,high) do { \ if ((x) < (low)) \ @@ -124,12 +125,12 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_ho #define WSP_IFACE_INDEX 1 /* - * Some tables, structures, definitions and initialisation values for - * the touchpad protocol has been copied from Linux's + * Some tables, structures, definitions and constant values for the + * touchpad protocol has been copied from Linux's * "drivers/input/mouse/bcm5974.c" which has the following copyright * holders under GPLv2. All device specific code in this driver has * been written from scratch. The decoding algorithm is based on - * output from usbdump. + * output from FreeBSD's usbdump. * * Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se) * Copyright (C) 2008 Scott Shawcroft (scott.shawcroft@gmail.com) @@ -205,20 +206,10 @@ struct tp_finger { #define MAX_FINGERS 16 #define SIZEOF_FINGER sizeof(struct tp_finger) #define SIZEOF_ALL_FINGERS (MAX_FINGERS * SIZEOF_FINGER) -#define MAX_FINGER_ORIENTATION 16384 -/* logical signal quality */ -#define SN_PRESSURE 45 /* pressure signal-to-noise ratio */ -#define SN_WIDTH 25 /* width signal-to-noise ratio */ -#define SN_COORD 250 /* coordinate signal-to-noise ratio */ -#define SN_ORIENT 10 /* orientation signal-to-noise ratio */ - -/* device-specific parameters */ -struct wsp_param { - int snratio; /* signal-to-noise ratio */ - int min; /* device minimum reading */ - int max; /* device maximum reading */ -}; +#if (WSP_BUFFER_MAX < ((MAX_FINGERS * 14 * 2) + FINGER_TYPE3)) +#error "WSP_BUFFER_MAX is too small" +#endif enum { WSP_FLAG_WELLSPRING1, @@ -239,282 +230,70 @@ enum { /* device-specific configuration */ struct wsp_dev_params { uint8_t caps; /* device capability bitmask */ - uint16_t bt_datalen; /* data length of the button interface */ uint8_t tp_type; /* type of trackpad interface */ uint8_t tp_offset; /* offset to trackpad finger data */ - uint16_t tp_datalen; /* data length of the trackpad - * interface */ - struct wsp_param p; /* finger pressure limits */ - struct wsp_param w; /* finger width limits */ - struct wsp_param x; /* horizontal limits */ - struct wsp_param y; /* vertical limits */ - struct wsp_param o; /* orientation limits */ }; static const struct wsp_dev_params wsp_dev_params[WSP_FLAG_MAX] = { [WSP_FLAG_WELLSPRING1] = { .caps = 0, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE1, .tp_offset = FINGER_TYPE1, - .tp_datalen = FINGER_TYPE1 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 256 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4824, 5342 - }, - .y = { - SN_COORD, -172, 5820 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING2] = { .caps = 0, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE1, .tp_offset = FINGER_TYPE1, - .tp_datalen = FINGER_TYPE1 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 256 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4824, 4824 - }, - .y = { - SN_COORD, -172, 4290 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING3] = { .caps = HAS_INTEGRATED_BUTTON, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE2, .tp_offset = FINGER_TYPE2, - .tp_datalen = FINGER_TYPE2 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 300 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4460, 5166 - }, - .y = { - SN_COORD, -75, 6700 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING4] = { .caps = HAS_INTEGRATED_BUTTON, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE2, .tp_offset = FINGER_TYPE2, - .tp_datalen = FINGER_TYPE2 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 300 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4620, 5140 - }, - .y = { - SN_COORD, -150, 6600 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING4A] = { .caps = HAS_INTEGRATED_BUTTON, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE2, .tp_offset = FINGER_TYPE2, - .tp_datalen = FINGER_TYPE2 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 300 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4616, 5112 - }, - .y = { - SN_COORD, -142, 5234 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING5] = { .caps = HAS_INTEGRATED_BUTTON, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE2, .tp_offset = FINGER_TYPE2, - .tp_datalen = FINGER_TYPE2 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 300 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4415, 5050 - }, - .y = { - SN_COORD, -55, 6680 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING6] = { .caps = HAS_INTEGRATED_BUTTON, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE2, .tp_offset = FINGER_TYPE2, - .tp_datalen = FINGER_TYPE2 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 300 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4620, 5140 - }, - .y = { - SN_COORD, -150, 6600 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING5A] = { .caps = HAS_INTEGRATED_BUTTON, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE2, .tp_offset = FINGER_TYPE2, - .tp_datalen = FINGER_TYPE2 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 300 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4750, 5280 - }, - .y = { - SN_COORD, -150, 6730 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING6A] = { .caps = HAS_INTEGRATED_BUTTON, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE2, .tp_offset = FINGER_TYPE2, - .tp_datalen = FINGER_TYPE2 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 300 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4620, 5140 - }, - .y = { - SN_COORD, -150, 6600 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING7] = { .caps = HAS_INTEGRATED_BUTTON, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE2, .tp_offset = FINGER_TYPE2, - .tp_datalen = FINGER_TYPE2 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 300 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4750, 5280 - }, - .y = { - SN_COORD, -150, 6730 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING7A] = { .caps = HAS_INTEGRATED_BUTTON, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE2, .tp_offset = FINGER_TYPE2, - .tp_datalen = FINGER_TYPE2 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 300 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4750, 5280 - }, - .y = { - SN_COORD, -150, 6730 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, [WSP_FLAG_WELLSPRING8] = { .caps = HAS_INTEGRATED_BUTTON, - .bt_datalen = sizeof(struct bt_data), .tp_type = TYPE3, .tp_offset = FINGER_TYPE3, - .tp_datalen = FINGER_TYPE3 + SIZEOF_ALL_FINGERS, - .p = { - SN_PRESSURE, 0, 300 - }, - .w = { - SN_WIDTH, 0, 2048 - }, - .x = { - SN_COORD, -4620, 5140 - }, - .y = { - SN_COORD, -150, 6600 - }, - .o = { - SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION - }, }, }; @@ -606,8 +385,6 @@ struct wsp_softc { u_int sc_state; #define WSP_ENABLED 0x01 - struct bt_data *bt_data; /* button transferred data */ - uint8_t *tp_data; /* trackpad transferred data */ struct tp_finger *index[MAX_FINGERS]; /* finger index data */ int16_t pos_x[MAX_FINGERS]; /* position array */ int16_t pos_y[MAX_FINGERS]; /* position array */ @@ -624,7 +401,7 @@ struct wsp_softc { int dz_count; #define WSP_DZ_MAX_COUNT 32 int dt_sum; /* T-axis cumulative movement */ - + int tp_datalen; uint8_t o_ntouch; /* old touch finger status */ uint8_t finger; /* 0 or 1 *, check which finger moving */ uint16_t intr_count; @@ -638,6 +415,7 @@ struct wsp_softc { #define WSP_SCR_NONE 0 #define WSP_SCR_VER 1 #define WSP_SCR_HOR 2 + uint8_t tp_data[WSP_BUFFER_MAX] __aligned(4); /* trackpad transferred data */ }; typedef enum interface_mode { @@ -677,7 +455,7 @@ static device_attach_t wsp_attach; static device_detach_t wsp_detach; static usb_callback_t wsp_intr_callback; -static struct usb_config wsp_config[WSP_N_TRANSFER] = { +static const struct usb_config wsp_config[WSP_N_TRANSFER] = { [WSP_INTR_DT] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, @@ -686,7 +464,7 @@ static struct usb_config wsp_config[WSP_ .pipe_bof = 0, .short_xfer_ok = 1, }, - .bufsize = 0, /* use wMaxPacketSize */ + .bufsize = WSP_BUFFER_MAX, .callback = &wsp_intr_callback, }, }; @@ -724,19 +502,6 @@ wsp_set_device_mode(struct wsp_softc *sc static int wsp_enable(struct wsp_softc *sc) { - const struct wsp_dev_params *params = sc->sc_params; - - if (params == NULL || params->tp_datalen == 0) { - DPRINTF("params uninitialized!\n"); - return (ENXIO); - } - /* Allocate the dynamic buffers */ - sc->tp_data = malloc(params->tp_datalen, M_USB, M_WAITOK | M_ZERO); - if (sc->tp_data == NULL) { - DPRINTF("Cannot allocate memory\n"); - return (ENXIO); - } - /* reset status */ memset(&sc->sc_status, 0, sizeof(sc->sc_status)); sc->sc_state |= WSP_ENABLED; @@ -748,9 +513,6 @@ wsp_enable(struct wsp_softc *sc) static void wsp_disable(struct wsp_softc *sc) { - free(sc->tp_data, M_USB); - sc->tp_data = NULL; - sc->sc_state &= ~WSP_ENABLED; DPRINTFN(WSP_LLEVEL_INFO, "disabled wsp\n"); } @@ -779,9 +541,29 @@ wsp_attach(device_t dev) struct wsp_softc *sc = device_get_softc(dev); struct usb_attach_arg *uaa = device_get_ivars(dev); usb_error_t err; + void *d_ptr = NULL; + uint16_t d_len; DPRINTFN(WSP_LLEVEL_INFO, "sc=%p\n", sc); + /* Get HID descriptor */ + err = usbd_req_get_hid_desc(uaa->device, NULL, &d_ptr, + &d_len, M_TEMP, uaa->info.bIfaceIndex); + + if (err == USB_ERR_NORMAL_COMPLETION) { + /* Get HID report descriptor length */ + sc->tp_datalen = hid_report_size(d_ptr, d_len, hid_input, NULL); + free(d_ptr, M_TEMP); + + if (sc->tp_datalen <= 0 || sc->tp_datalen > WSP_BUFFER_MAX) { + DPRINTF("Invalid datalength or too big " + "datalength: %d\n", sc->tp_datalen); + return (ENXIO); + } + } else { + return (ENXIO); + } + sc->sc_usb_device = uaa->device; /* @@ -816,13 +598,9 @@ wsp_attach(device_t dev) /* get device specific configuration */ sc->sc_params = wsp_dev_params + USB_GET_DRIVER_INFO(uaa); - /* set to 0 to use wMaxPacketSize is not enough */ - wsp_config[0].bufsize = sc->sc_params->tp_datalen; - err = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, sc->sc_xfer, wsp_config, WSP_N_TRANSFER, sc, &sc->sc_mutex); - if (err) { DPRINTF("error=%s\n", usbd_errstr(err)); goto detach; @@ -903,19 +681,16 @@ wsp_intr_callback(struct usb_xfer *xfer, switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - if (len > (int)params->tp_datalen) { - DPRINTFN(WSP_LLEVEL_ERROR, - "truncating large packet from %u to %u bytes\n", - len, params->tp_datalen); - len = params->tp_datalen; - } else { - /* make sure we don't process old data */ - memset(sc->tp_data + len, 0, params->tp_datalen - len); - } + /* copy out received data */ pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, sc->tp_data, len); + if (len < sc->tp_datalen) { + /* make sure we don't process old data */ + memset(sc->tp_data + len, 0, sc->tp_datalen - len); + } + h = (struct tp_header *)(sc->tp_data); if (params->tp_type == TYPE2) { @@ -956,7 +731,7 @@ wsp_intr_callback(struct usb_xfer *xfer, f[i].touch_major, f[i].touch_minor, f[i].multi); sc->pos_x[i] = f[i].abs_x; - sc->pos_y[i] = params->y.min + params->y.max - f[i].abs_y; + sc->pos_y[i] = -f[i].abs_y; sc->index[i] = &f[i]; } @@ -1009,12 +784,12 @@ wsp_intr_callback(struct usb_xfer *xfer, * button-up). */ switch (sc->ntaps) { -#if 0 case 1: - wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON1DOWN); - DPRINTFN(WSP_LLEVEL_INFO, "LEFT CLICK!\n"); + if (!(params->caps & HAS_INTEGRATED_BUTTON)) { + wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON1DOWN); + DPRINTFN(WSP_LLEVEL_INFO, "LEFT CLICK!\n"); + } break; -#endif case 2: if (sc->distance < MAX_DISTANCE) wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON3DOWN); @@ -1180,7 +955,7 @@ tr_setup: if (usb_fifo_put_bytes_max( sc->sc_fifo.fp[USB_FIFO_RX]) != 0) { usbd_xfer_set_frame_len(xfer, 0, - sc->sc_params->tp_datalen); + sc->tp_datalen); usbd_transfer_submit(xfer); } break; @@ -1193,8 +968,6 @@ tr_setup: } break; } - - return; } static void From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 13:36:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 47BE0EF7; Sun, 23 Feb 2014 13:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2EA181CFE; Sun, 23 Feb 2014 13:36: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 s1NDaM0s046632; Sun, 23 Feb 2014 13:36:22 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NDaL7H046630; Sun, 23 Feb 2014 13:36:21 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402231336.s1NDaL7H046630@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 23 Feb 2014 13:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262370 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 13:36:22 -0000 Author: hselasky Date: Sun Feb 23 13:36:21 2014 New Revision: 262370 URL: http://svnweb.freebsd.org/changeset/base/262370 Log: MFC r261872: Fix minor logical error in the XHCI driver. Set correct SETUP packet direction value. Modified: stable/10/sys/dev/usb/controller/xhci.c stable/10/sys/dev/usb/controller/xhci.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.c Sun Feb 23 13:33:21 2014 (r262369) +++ stable/10/sys/dev/usb/controller/xhci.c Sun Feb 23 13:36:21 2014 (r262370) @@ -1759,7 +1759,8 @@ restart: /* check wLength */ if (td->td_trb[0].qwTrb0 & htole64(XHCI_TRB_0_WLENGTH_MASK)) { - if (td->td_trb[0].qwTrb0 & htole64(1)) + if (td->td_trb[0].qwTrb0 & + htole64(XHCI_TRB_0_DIR_IN_MASK)) dword |= XHCI_TRB_3_TRT_IN; else dword |= XHCI_TRB_3_TRT_OUT; Modified: stable/10/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.h Sun Feb 23 13:33:21 2014 (r262369) +++ stable/10/sys/dev/usb/controller/xhci.h Sun Feb 23 13:36:21 2014 (r262370) @@ -192,6 +192,7 @@ struct xhci_stream_ctx { struct xhci_trb { volatile uint64_t qwTrb0; +#define XHCI_TRB_0_DIR_IN_MASK (0x80ULL << 0) #define XHCI_TRB_0_WLENGTH_MASK (0xFFFFULL << 48) volatile uint32_t dwTrb2; #define XHCI_TRB_2_ERROR_GET(x) (((x) >> 24) & 0xFF) From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 20:04:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7BADB7D2; Sun, 23 Feb 2014 20:04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A11710BC; Sun, 23 Feb 2014 20:04: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 s1NK4UbY005192; Sun, 23 Feb 2014 20:04:30 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NK4TJU005189; Sun, 23 Feb 2014 20:04:29 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402232004.s1NK4TJU005189@svn.freebsd.org> From: Bryan Drewery Date: Sun, 23 Feb 2014 20:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262384 - in stable/10: etc/defaults etc/rc.d share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 20:04:30 -0000 Author: bdrewery Date: Sun Feb 23 20:04:29 2014 New Revision: 262384 URL: http://svnweb.freebsd.org/changeset/base/262384 Log: MFC r261931,r261932: Allow overriding rctl.conf(5) file location for /etc/rc.d/rctl Approved by: bapt (mentor, implicit) Modified: stable/10/etc/defaults/rc.conf stable/10/etc/rc.d/rctl stable/10/share/man/man5/rc.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Sun Feb 23 19:18:04 2014 (r262383) +++ stable/10/etc/defaults/rc.conf Sun Feb 23 20:04:29 2014 (r262384) @@ -663,6 +663,10 @@ newsyslog_flags="-CN" # Newsyslog flags mixer_enable="YES" # Run the sound mixer. opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off +# rctl(8) requires kernel options RACCT and RCTL +rctl_enable="NO" # Load rctl(8) rules on boot +rctl_rules="/etc/rctl.conf" # rctl(8) ruleset. See rctl.conf(5). + ############################################################## ### Jail Configuration (see rc.conf(5) manual page) ########## ############################################################## Modified: stable/10/etc/rc.d/rctl ============================================================================== --- stable/10/etc/rc.d/rctl Sun Feb 23 19:18:04 2014 (r262383) +++ stable/10/etc/rc.d/rctl Sun Feb 23 20:04:29 2014 (r262384) @@ -15,7 +15,7 @@ stop_cmd="rctl_stop" rctl_start() { - if [ -f /etc/rctl.conf ]; then + if [ -f ${rctl_rules} ]; then while read var comments do case ${var} in @@ -25,7 +25,7 @@ rctl_start() rctl -a "${var}" ;; esac - done < /etc/rctl.conf + done < ${rctl_rules} fi } Modified: stable/10/share/man/man5/rc.conf.5 ============================================================================== --- stable/10/share/man/man5/rc.conf.5 Sun Feb 23 19:18:04 2014 (r262383) +++ stable/10/share/man/man5/rc.conf.5 Sun Feb 23 20:04:29 2014 (r262384) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2013 +.Dd February 15, 2014 .Dt RC.CONF 5 .Os .Sh NAME @@ -4416,6 +4416,26 @@ interface if desired. Defines the total number of seconds to wait for link to become usable, polled at a 1-second interval. The default is 30. +.It Va rctl_enable +.Pq Vt bool +Set to +.Dq Li YES +to load +.Xr rctl 8 +rules from the defined ruleset. +The kernel must be built with +.Cd "options RACCT" +and +.Cd "options RCTL" . +.It Va rctl_rules +.Pq Vt str +Set to +.Pa /etc/rctl.conf +by default. +This variables contains the +.Xr rctl.conf 5 +ruleset to load for +.Xr rctl 8 . .El .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 20:07:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0D801922; Sun, 23 Feb 2014 20:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE88010D3; Sun, 23 Feb 2014 20:07: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 s1NK7Ukj005657; Sun, 23 Feb 2014 20:07:30 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NK7Um2005656; Sun, 23 Feb 2014 20:07:30 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402232007.s1NK7Um2005656@svn.freebsd.org> From: Bryan Drewery Date: Sun, 23 Feb 2014 20:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262385 - stable/10/usr.bin/rctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 20:07:31 -0000 Author: bdrewery Date: Sun Feb 23 20:07:30 2014 New Revision: 262385 URL: http://svnweb.freebsd.org/changeset/base/262385 Log: MFC r261934: Rework rctl(8) manpage Approved by: bapt (mentor, implicit) Modified: stable/10/usr.bin/rctl/rctl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/rctl/rctl.8 ============================================================================== --- stable/10/usr.bin/rctl/rctl.8 Sun Feb 23 20:04:29 2014 (r262384) +++ stable/10/usr.bin/rctl/rctl.8 Sun Feb 23 20:07:30 2014 (r262385) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 3, 2012 +.Dd February 14, 2014 .Dt RCTL 8 .Os .Sh NAME @@ -40,17 +40,24 @@ .Fl a .Op Ar rule .Nm +.Fl l .Op Fl h .Op Fl n -.Fl l .Op Ar filter .Nm .Fl r .Op Ar filter .Nm -.Op Fl h .Fl u +.Op Fl h .Op Ar filter +.Pp +.Nm +requires the kernel to be compiled with: +.Bd -ragged -offset indent +.Cd "options RACCT" +.Cd "options RCTL" +.Ed .Sh DESCRIPTION When called without options, the .Nm @@ -77,8 +84,15 @@ Remove rules matching .Ar filter from the RCTL database. .It Fl u Ar filter -Display resource usage for a subject (process, user, login class -or jail) matching the +Display resource usage for a subject +.Po +.Sy process , +.Sy user , +.Sy loginclass +or +.Sy jail +.Pc +matching the .Ar filter . .It Fl h "Human-readable" output. @@ -87,24 +101,49 @@ Gigabyte, Terabyte and Petabyte. .It Fl n Display user IDs numerically rather than converting them to a user name. .El +.Pp +Modifying rules affects all currently running and future processes matching +the rule. .Sh RULE SYNTAX Syntax for a rule is subject:subject-id:resource:action=amount/per. .Pp -Subject defines the kind of entity the rule applies to. -It can be either process, user, login class, or jail. -.Pp -Subject ID identifies the subject. -It can be a process ID, user name, numerical user ID, login class name, +.Bl -tag -width "subject-id" -compact -offset indent +.It subject +defines the kind of entity the rule applies to. +It can be either +.Sy process , +.Sy user , +.Sy loginclass , +or +.Sy jail . +.It subject-id +identifies the +.Em subject . +It can be a process ID, user name, numerical user ID, login class name from +.Xr login.conf 5 , or jail name. -.Pp -Resource identifies the resource the rule controls. -.Pp -Action defines what will happen when a process exceeds the allowed amount. -.Pp -Amount defines how much of the resource a process can use before -the defined action triggers. -.Pp -The per field defines what entity the amount gets accounted for. +.It resource +identifies the resource the rule controls. +See the +.Sx RESOURCES +section below for details. +.It action +defines what will happen when a process exceeds the allowed +.Em amount . +See the +.Sx ACTIONS +section below for details. +.It amount +defines how much of the resource a process can use before +the defined +.Em action +triggers. +Resources which limit bytes may use prefixes from +.Xr expand_number 3 . +.It per +defines what entity the +.Em amount +gets accounted for. For example, rule "loginclass:users:vmem:deny=100M/process" means that each process of any user belonging to login class "users" may allocate up to 100MB of virtual memory. @@ -114,58 +153,86 @@ by all the processes of that user will n Rule "loginclass:users:vmem:deny=100M/loginclass" would mean that the sum of virtual memory allocated by all processes of all users belonging to that login class will not exceed 100MB. +.El .Pp -Valid rule has all those fields specified, except for the per, which defaults -to the value of subject. -.Pp -A filter is a rule for which one of more fields other than per is left empty. +A valid rule has all those fields specified, except for +.Em per , +which defaults +to the value of +.Em subject . +.Pp +A filter is a rule for which one of more fields other than +.Em per +is left empty. For example, a filter that matches every rule could be written as ":::=/", or, in short, ":". A filter that matches all the login classes would be "loginclass:". -A filter that matches all defined rules for maxproc resource would be +A filter that matches all defined rules for +.Sy maxproc +resource would be "::maxproc". +.Sh SUBJECTS +.Bl -column -offset 3n "pseudoterminals" ".Sy username or numerical User ID" +.It Em subject Ta Em subject-id +.It Sy process Ta numerical Process ID +.It Sy user Ta user name or numerical User ID +.It Sy loginclass Ta login class from +.Xr login.conf 5 +.It Sy jail Ta jail name +.El .Sh RESOURCES .Bl -column -offset 3n "pseudoterminals" -.It cputime Ta "CPU time, in seconds" -.It datasize Ta "data size, in bytes" -.It stacksize Ta "stack size, in bytes" -.It coredumpsize Ta "core dump size, in bytes" -.It memoryuse Ta "resident set size, in bytes" -.It memorylocked Ta "locked memory, in bytes" -.It maxproc Ta "number of processes" -.It openfiles Ta "file descriptor table size" -.It vmemoryuse Ta "address space limit, in bytes" -.It pseudoterminals Ta "number of PTYs" -.It swapuse Ta "swap usage, in bytes" -.It nthr Ta "number of threads" -.It msgqqueued Ta "number of queued SysV messages" -.It msgqsize Ta "SysV message queue size, in bytes" -.It nmsgq Ta "number of SysV message queues" -.It nsem Ta "number of SysV semaphores" -.It nsemop Ta "number of SysV semaphores modified in a single semop(2) call" -.It nshm Ta "number of SysV shared memory segments" -.It shmsize Ta "SysV shared memory size, in bytes" -.It wallclock Ta "wallclock time, in seconds" -.It pcpu Ta "%CPU, in percents of a single CPU core" +.It Em resource +.It Sy cputime Ta "CPU time, in seconds" +.It Sy datasize Ta "data size, in bytes" +.It Sy stacksize Ta "stack size, in bytes" +.It Sy coredumpsize Ta "core dump size, in bytes" +.It Sy memoryuse Ta "resident set size, in bytes" +.It Sy memorylocked Ta "locked memory, in bytes" +.It Sy maxproc Ta "number of processes" +.It Sy openfiles Ta "file descriptor table size" +.It Sy vmemoryuse Ta "address space limit, in bytes" +.It Sy pseudoterminals Ta "number of PTYs" +.It Sy swapuse Ta "swap usage, in bytes" +.It Sy nthr Ta "number of threads" +.It Sy msgqqueued Ta "number of queued SysV messages" +.It Sy msgqsize Ta "SysV message queue size, in bytes" +.It Sy nmsgq Ta "number of SysV message queues" +.It Sy nsem Ta "number of SysV semaphores" +.It Sy nsemop Ta "number of SysV semaphores modified in a single semop(2) call" +.It Sy nshm Ta "number of SysV shared memory segments" +.It Sy shmsize Ta "SysV shared memory size, in bytes" +.It Sy wallclock Ta "wallclock time, in seconds" +.It Sy pcpu Ta "%CPU, in percents of a single CPU core" .El .Sh ACTIONS .Bl -column -offset 3n "pseudoterminals" -.It deny Ta "deny the allocation; not supported for cpu and wallclock" -.It log Ta "log a warning to the console" -.It devctl Ta "send notification to" +.It Em action +.It Sy deny Ta deny the allocation; not supported for +.Sy cpu +and +.Sy wallclock +.It Sy log Ta "log a warning to the console" +.It Sy devctl Ta "send notification to" .Xr devd 8 -.It "sig* e.g. sigterm; send a signal to the offending process" -.El -.Pp +using +.Sy system += "RCTL", +.Sy subsystem += "rule", +.Sy type += "matched" +.It sig* e.g. +.Sy sigterm ; +send a signal to the offending process. See .Xr signal 3 -for a list of supported signals. +for a list of supported signals +.El .Pp Not all actions are supported for all resources. -Attempt to add rule with action not supported by a given resource will result -in error. -.Pp -Note that limiting RSS may kill the machine due to thrashing. +Attempting to add a rule with an action not supported by a given resource will +result in error. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -180,6 +247,15 @@ Display resource usage information for j .Pp Display all the rules applicable to process with PID 512: .Dl Nm Fl l Ar process:512 +.Pp +Display all rules: +.Dl Nm +.Pp +Display all rules matching user "joe": +.Dl Nm Ar user:joe +.Pp +Display all rules matching login classes: +.Dl Nm Ar loginclass: .Sh SEE ALSO .Xr rctl.conf 5 .Sh HISTORY @@ -193,3 +269,7 @@ The .Nm command was written by .An Edward Tomasz Napierala Aq trasz@FreeBSD.org . +.Sh BUGS +Limiting +.Sy memoryuse +may kill the machine due to thrashing. From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 20:13:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E6776C4A; Sun, 23 Feb 2014 20:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D0E3E1169; Sun, 23 Feb 2014 20:13: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 s1NKD1Tl009375; Sun, 23 Feb 2014 20:13:01 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NKD1ps009372; Sun, 23 Feb 2014 20:13:01 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402232013.s1NKD1ps009372@svn.freebsd.org> From: Christian Brueffer Date: Sun, 23 Feb 2014 20:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262386 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 20:13:02 -0000 Author: brueffer Date: Sun Feb 23 20:13:01 2014 New Revision: 262386 URL: http://svnweb.freebsd.org/changeset/base/262386 Log: MFC: r261549 Add a manpage for the urndis driver. Obtained from: OpenBSD Added: stable/10/share/man/man4/urndis.4 - copied unchanged from r261549, head/share/man/man4/urndis.4 Modified: stable/10/share/man/man4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Sun Feb 23 20:07:30 2014 (r262385) +++ stable/10/share/man/man4/Makefile Sun Feb 23 20:13:01 2014 (r262386) @@ -524,6 +524,7 @@ MAN= aac.4 \ uplcom.4 \ ural.4 \ urio.4 \ + urndis.4 \ ${_urtw.4} \ urtwn.4 \ usb.4 \ @@ -711,6 +712,7 @@ MLINKS+=uath.4 if_uath.4 MLINKS+=udav.4 if_udav.4 MLINKS+=upgt.4 if_upgt.4 MLINKS+=ural.4 if_ural.4 +MLINKS+=urndis.4 if_urndis.4 MLINKS+=${_urtw.4} ${_if_urtw.4} MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 Copied: stable/10/share/man/man4/urndis.4 (from r261549, head/share/man/man4/urndis.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/urndis.4 Sun Feb 23 20:13:01 2014 (r262386, copy of r261549, head/share/man/man4/urndis.4) @@ -0,0 +1,97 @@ +.\" Copyright (c) 2010 Michael Knudsen +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" - Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" - 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 COPYRIGHT HOLDERS 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 +.\" COPYRIGHT HOLDERS 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. +.\" +.\" $OpenBSD: urndis.4,v 1.15 2013/07/16 16:05:49 schwarze Exp $ +.\" +.\" $FreeBSD$ +.\" +.Dd February 6, 2014 +.Dt URNDIS 4 +.Os +.Sh NAME +.Nm urndis +.Nd USB Remote NDIS Ethernet device +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ehci" +.Cd "device uhci" +.Cd "device ohci" +.Cd "device xhci" +.Cd "device usb" +.Cd "device urndis" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_urndis_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides Ethernet access over Remote NDIS (RNDIS), +allowing mobile devices such as phones and tablets to provide network access. +It is often referred to as USB tethering, +and in most cases must be explicitly enabled on the device. +.Pp +.Nm +should work with any USB RNDIS devices, +such as those commonly found on Android devices. +It does not support different media types or options. +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh SEE ALSO +.Xr arp 4 , +.Xr netintro 4 , +.Xr usb 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Ox 4.7 . +The first +.Fx +release to include it was +.Fx 10.1 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Jonathan Armani Aq Mt armani@openbsd.org , +.An Michael Knudsen Aq Mt mk@openbsd.org , +and +.An Fabien Romano Aq Mt fabien@openbsd.org . +It was ported to +.Fx +by +.An Hans Petter Selasky Aq Mt hps@FreeBSD.org . From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 21:03:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6F526D80; Sun, 23 Feb 2014 21:03: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 570C315BC; Sun, 23 Feb 2014 21:03:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NL3V4V029784; Sun, 23 Feb 2014 21:03:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NL3VTk029783; Sun, 23 Feb 2014 21:03:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201402232103.s1NL3VTk029783@svn.freebsd.org> From: Marius Strobl Date: Sun, 23 Feb 2014 21:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262389 - stable/10/sys/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 21:03:31 -0000 Author: marius Date: Sun Feb 23 21:03:30 2014 New Revision: 262389 URL: http://svnweb.freebsd.org/changeset/base/262389 Log: MFC: r261529 Try to make the style used here consistent. Modified: stable/10/sys/pci/if_rlreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/pci/if_rlreg.h ============================================================================== --- stable/10/sys/pci/if_rlreg.h Sun Feb 23 20:16:51 2014 (r262388) +++ stable/10/sys/pci/if_rlreg.h Sun Feb 23 21:03:30 2014 (r262389) @@ -163,7 +163,6 @@ #define RL_LOOPTEST_ON_CPLUS 0x00060000 /* Known revision codes. */ - #define RL_HWREV_8169 0x00000000 #define RL_HWREV_8169S 0x00800000 #define RL_HWREV_8110S 0x04000000 @@ -329,8 +328,8 @@ #define RL_RXSTAT_INDIV 0x00004000 #define RL_RXSTAT_MULTI 0x00008000 #define RL_RXSTAT_LENMASK 0xFFFF0000 +#define RL_RXSTAT_UNFINISHED 0x0000FFF0 /* DMA still in progress */ -#define RL_RXSTAT_UNFINISHED 0xFFF0 /* DMA still in progress */ /* * Command register. */ @@ -361,6 +360,7 @@ #define RL_PARA7C 0x7C #define RL_PARA7C_DEF 0xcb38de43 #define RL_PARA7C_RETUNE 0xfb38de03 + /* * EEPROM control register */ @@ -473,11 +473,9 @@ */ /* RL_DUMPSTATS_LO register */ - #define RL_DUMPSTATS_START 0x00000008 /* Transmit start register */ - #define RL_TXSTART_SWI 0x01 /* generate TX interrupt */ #define RL_TXSTART_START 0x40 /* start normal queue transmit */ #define RL_TXSTART_HPRIO_START 0x80 /* start hi prio queue transmit */ @@ -496,7 +494,6 @@ #define RL_BUSWIDTH_64BITS 0x08 /* C+ mode command register */ - #define RL_CPLUSCMD_TXENB 0x0001 /* enable C+ transmit mode */ #define RL_CPLUSCMD_RXENB 0x0002 /* enable C+ receive mode */ #define RL_CPLUSCMD_PCI_MRW 0x0008 /* enable PCI multi-read/write */ @@ -514,7 +511,6 @@ #define RL_CPLUSCMD_BIST_ENB 0x8000 /* 8168C/CP */ /* C+ early transmit threshold */ - #define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ /* Timer interrupt register */ @@ -528,7 +524,6 @@ /* * Gigabit PHY access register (8169 only) */ - #define RL_PHYAR_PHYDATA 0x0000FFFF #define RL_PHYAR_PHYREG 0x001F0000 #define RL_PHYAR_BUSY 0x80000000 @@ -559,7 +554,6 @@ * For reception, there's just one large buffer where the chip stores * all received packets. */ - #define RL_RX_BUF_SZ RL_RXBUF_64 #define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13)) #define RL_TX_LIST_CNT 4 @@ -642,11 +636,10 @@ struct rl_hwrev { /* * RX/TX descriptor definition. When large send mode is enabled, the - * lower 11 bits of the TX rl_cmd word are used to hold the MSS, and + * lower 11 bits of the TX rl_cmdstat word are used to hold the MSS, and * the checksum offload bits are disabled. The structure layout is * the same for RX and TX descriptors */ - struct rl_desc { uint32_t rl_cmdstat; uint32_t rl_vlanctl; @@ -679,7 +672,6 @@ struct rl_desc { * Error bits are valid only on the last descriptor of a frame * (i.e. RL_TDESC_CMD_EOF == 1) */ - #define RL_TDESC_STAT_COLCNT 0x000F0000 /* collision count */ #define RL_TDESC_STAT_EXCESSCOL 0x00100000 /* excessive collisions */ #define RL_TDESC_STAT_LINKFAIL 0x00200000 /* link faulure */ @@ -691,7 +683,6 @@ struct rl_desc { /* * RX descriptor cmd/vlan definitions */ - #define RL_RDESC_CMD_EOR 0x40000000 #define RL_RDESC_CMD_OWN 0x80000000 #define RL_RDESC_CMD_BUFLEN 0x00001FFF From owner-svn-src-stable-10@FreeBSD.ORG Sun Feb 23 21:08:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BBAC2189; Sun, 23 Feb 2014 21:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 97A2415DC; Sun, 23 Feb 2014 21:08: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 s1NL8g2d030665; Sun, 23 Feb 2014 21:08:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NL8gKv030663; Sun, 23 Feb 2014 21:08:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201402232108.s1NL8gKv030663@svn.freebsd.org> From: Marius Strobl Date: Sun, 23 Feb 2014 21:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262391 - in stable/10/sys: dev/re pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 21:08:42 -0000 Author: marius Date: Sun Feb 23 21:08:41 2014 New Revision: 262391 URL: http://svnweb.freebsd.org/changeset/base/262391 Log: MFC: r261531 - Implement the RX EARLYOFF and RXDV GATED bits as done by RealTek's Linux driver as iof version 8.037.00 for RTL8168{E-VL,EP,F,G,GU} and RTL8411B. This makes reception of packets work with the RTL8168G (HW rev. 0x4c000000) in my Shuttle DS47. - Consistently use RL_MSI_MESSAGES. In joint forces with: yongari Modified: stable/10/sys/dev/re/if_re.c stable/10/sys/pci/if_rlreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/re/if_re.c ============================================================================== --- stable/10/sys/dev/re/if_re.c Sun Feb 23 21:03:32 2014 (r262390) +++ stable/10/sys/dev/re/if_re.c Sun Feb 23 21:08:41 2014 (r262391) @@ -655,6 +655,10 @@ re_set_rxmode(struct rl_softc *sc) ifp = sc->rl_ifp; rxfilt = RL_RXCFG_CONFIG | RL_RXCFG_RX_INDIV | RL_RXCFG_RX_BROAD; + if ((sc->rl_flags & RL_FLAG_EARLYOFF) != 0) + rxfilt |= RL_RXCFG_EARLYOFF; + else if ((sc->rl_flags & RL_FLAG_EARLYOFFV2) != 0) + rxfilt |= RL_RXCFG_EARLYOFFV2; if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { if (ifp->if_flags & IFF_PROMISC) @@ -1264,7 +1268,7 @@ re_attach(device_t dev) msic = 0; /* Prefer MSI-X to MSI. */ if (msixc > 0) { - msixc = 1; + msixc = RL_MSI_MESSAGES; rid = PCIR_BAR(4); sc->rl_res_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -1274,7 +1278,7 @@ re_attach(device_t dev) } if (sc->rl_res_pba != NULL && pci_alloc_msix(dev, &msixc) == 0) { - if (msixc == 1) { + if (msixc == RL_MSI_MESSAGES) { device_printf(dev, "Using %d MSI-X message\n", msixc); sc->rl_flags |= RL_FLAG_MSIX; @@ -1291,7 +1295,7 @@ re_attach(device_t dev) } /* Prefer MSI to INTx. */ if (msixc == 0 && msic > 0) { - msic = 1; + msic = RL_MSI_MESSAGES; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { device_printf(dev, "Using %d MSI message\n", @@ -1462,16 +1466,24 @@ re_attach(device_t dev) RL_FLAG_WOL_MANLINK; break; case RL_HWREV_8168E_VL: - case RL_HWREV_8168EP: case RL_HWREV_8168F: - case RL_HWREV_8168G: + sc->rl_flags |= RL_FLAG_EARLYOFF; + /* FALLTHROUGH */ case RL_HWREV_8411: - case RL_HWREV_8411B: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | RL_FLAG_CMDSTOP_WAIT_TXQ | RL_FLAG_WOL_MANLINK; break; + case RL_HWREV_8168EP: + case RL_HWREV_8168G: + case RL_HWREV_8411B: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | + RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | + RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | + RL_FLAG_CMDSTOP_WAIT_TXQ | RL_FLAG_WOL_MANLINK | + RL_FLAG_EARLYOFFV2 | RL_FLAG_RXDV_GATED; + break; case RL_HWREV_8168GU: if (pci_get_device(dev) == RT_DEVICEID_8101E) { /* RTL8106EUS */ @@ -1481,7 +1493,8 @@ re_attach(device_t dev) sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | - RL_FLAG_AUTOPAD | RL_FLAG_CMDSTOP_WAIT_TXQ; + RL_FLAG_AUTOPAD | RL_FLAG_CMDSTOP_WAIT_TXQ | + RL_FLAG_EARLYOFFV2 | RL_FLAG_RXDV_GATED; break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SBL: @@ -3169,6 +3182,10 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXLIST_ADDR_LO, RL_ADDR_LO(sc->rl_ldata.rl_tx_list_addr)); + if ((sc->rl_flags & RL_FLAG_RXDV_GATED) != 0) + CSR_WRITE_4(sc, RL_MISC, CSR_READ_4(sc, RL_MISC) & + ~0x00080000); + /* * Enable transmit and receive. */ Modified: stable/10/sys/pci/if_rlreg.h ============================================================================== --- stable/10/sys/pci/if_rlreg.h Sun Feb 23 21:03:32 2014 (r262390) +++ stable/10/sys/pci/if_rlreg.h Sun Feb 23 21:08:41 2014 (r262391) @@ -145,6 +145,7 @@ #define RL_PMCH 0x006F /* 8 bits */ #define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ #define RL_INTRMOD 0x00E2 /* 16 bits */ +#define RL_MISC 0x00F0 /* * TX config register bits @@ -286,8 +287,10 @@ #define RL_RXCFG_RX_RUNT 0x00000010 #define RL_RXCFG_RX_ERRPKT 0x00000020 #define RL_RXCFG_WRAP 0x00000080 +#define RL_RXCFG_EARLYOFFV2 0x00000800 #define RL_RXCFG_MAXDMA 0x00000700 #define RL_RXCFG_BUFSZ 0x00001800 +#define RL_RXCFG_EARLYOFF 0x00003800 #define RL_RXCFG_FIFOTHRESH 0x0000E000 #define RL_RXCFG_EARLYTHRESH 0x07000000 @@ -926,6 +929,9 @@ struct rl_softc { #define RL_FLAG_WAIT_TXPOLL 0x00004000 #define RL_FLAG_CMDSTOP_WAIT_TXQ 0x00008000 #define RL_FLAG_WOL_MANLINK 0x00010000 +#define RL_FLAG_EARLYOFF 0x00020000 +#define RL_FLAG_EARLYOFFV2 0x00040000 +#define RL_FLAG_RXDV_GATED 0x00080000 #define RL_FLAG_PCIE 0x40000000 #define RL_FLAG_LINK 0x80000000 }; From owner-svn-src-stable-10@FreeBSD.ORG Mon Feb 24 08:18:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5EECC6D; Mon, 24 Feb 2014 08:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F73015E0; Mon, 24 Feb 2014 08:18: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 s1O8ICi5001351; Mon, 24 Feb 2014 08:18:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O8IBop001345; Mon, 24 Feb 2014 08:18:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402240818.s1O8IBop001345@svn.freebsd.org> From: Christian Brueffer Date: Mon, 24 Feb 2014 08:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262434 - in stable/10/libexec: fingerd rbootd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 08:18:12 -0000 Author: brueffer Date: Mon Feb 24 08:18:11 2014 New Revision: 262434 URL: http://svnweb.freebsd.org/changeset/base/262434 Log: MFC: r262135 Add $FreeBSD$. Modified: stable/10/libexec/fingerd/pathnames.h stable/10/libexec/rbootd/pathnames.h stable/10/libexec/rbootd/rmp.h stable/10/libexec/rbootd/rmp_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/fingerd/pathnames.h ============================================================================== --- stable/10/libexec/fingerd/pathnames.h Mon Feb 24 05:55:00 2014 (r262433) +++ stable/10/libexec/fingerd/pathnames.h Mon Feb 24 08:18:11 2014 (r262434) @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)pathnames.h 8.1 (Berkeley) 6/4/93 + * + * $FreeBSD$ */ #define _PATH_FINGER "/usr/bin/finger" Modified: stable/10/libexec/rbootd/pathnames.h ============================================================================== --- stable/10/libexec/rbootd/pathnames.h Mon Feb 24 05:55:00 2014 (r262433) +++ stable/10/libexec/rbootd/pathnames.h Mon Feb 24 08:18:11 2014 (r262434) @@ -42,6 +42,8 @@ * * From: Utah Hdr: pathnames.h 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS + * + * $FreeBSD$ */ #define _PATH_BPF "/dev/bpf%d" Modified: stable/10/libexec/rbootd/rmp.h ============================================================================== --- stable/10/libexec/rbootd/rmp.h Mon Feb 24 05:55:00 2014 (r262433) +++ stable/10/libexec/rbootd/rmp.h Mon Feb 24 08:18:11 2014 (r262434) @@ -42,6 +42,8 @@ * * From: Utah Hdr: rmp.h 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS + * + * $FreeBSD$ */ /* Modified: stable/10/libexec/rbootd/rmp_var.h ============================================================================== --- stable/10/libexec/rbootd/rmp_var.h Mon Feb 24 05:55:00 2014 (r262433) +++ stable/10/libexec/rbootd/rmp_var.h Mon Feb 24 08:18:11 2014 (r262434) @@ -42,6 +42,8 @@ * * from: Utah Hdr: rmp_var.h 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS + * + * $FreeBSD$ */ /* From owner-svn-src-stable-10@FreeBSD.ORG Mon Feb 24 08:22:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A527E1DE; Mon, 24 Feb 2014 08:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D4E6165D; Mon, 24 Feb 2014 08:22: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 s1O8M1DN004675; Mon, 24 Feb 2014 08:22:01 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O8Ln0K004543; Mon, 24 Feb 2014 08:21:49 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402240821.s1O8Ln0K004543@svn.freebsd.org> From: Christian Brueffer Date: Mon, 24 Feb 2014 08:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262435 - in stable/10/libexec: bootpd comsat fingerd ftpd getty mknetid rbootd revnetgroup rlogind rpc.rstatd rpc.rusersd rpc.rwalld rshd rtld-elf talkd tftpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 08:22:01 -0000 Author: brueffer Date: Mon Feb 24 08:21:49 2014 New Revision: 262435 URL: http://svnweb.freebsd.org/changeset/base/262435 Log: MFC: r262136 Remove the 3rd clause ("advertising clause") of the BSD license as permitted by the University of Berkeley on July 22, 1999. Reviewed by: imp Modified: stable/10/libexec/bootpd/rtmsg.c stable/10/libexec/comsat/comsat.8 stable/10/libexec/comsat/comsat.c stable/10/libexec/fingerd/fingerd.8 stable/10/libexec/fingerd/fingerd.c stable/10/libexec/fingerd/pathnames.h stable/10/libexec/ftpd/extern.h stable/10/libexec/ftpd/ftpcmd.y stable/10/libexec/ftpd/ftpd.8 stable/10/libexec/ftpd/ftpd.c stable/10/libexec/ftpd/logwtmp.c stable/10/libexec/ftpd/pathnames.h stable/10/libexec/ftpd/popen.c stable/10/libexec/getty/extern.h stable/10/libexec/getty/getty.8 stable/10/libexec/getty/gettytab.5 stable/10/libexec/getty/gettytab.h stable/10/libexec/getty/init.c stable/10/libexec/getty/main.c stable/10/libexec/getty/pathnames.h stable/10/libexec/getty/subr.c stable/10/libexec/getty/ttys.5 stable/10/libexec/mknetid/parse_group.c stable/10/libexec/rbootd/bpf.c stable/10/libexec/rbootd/conf.c stable/10/libexec/rbootd/defs.h stable/10/libexec/rbootd/parseconf.c stable/10/libexec/rbootd/pathnames.h stable/10/libexec/rbootd/rbootd.8 stable/10/libexec/rbootd/rbootd.c stable/10/libexec/rbootd/rmp.h stable/10/libexec/rbootd/rmp_var.h stable/10/libexec/rbootd/rmpproto.c stable/10/libexec/rbootd/utils.c stable/10/libexec/revnetgroup/parse_netgroup.c stable/10/libexec/rlogind/rlogind.8 stable/10/libexec/rlogind/rlogind.c stable/10/libexec/rpc.rstatd/rpc.rstatd.8 stable/10/libexec/rpc.rstatd/rstatd.c stable/10/libexec/rpc.rusersd/extern.h stable/10/libexec/rpc.rusersd/rpc.rusersd.8 stable/10/libexec/rpc.rusersd/rusers_proc.c stable/10/libexec/rpc.rusersd/rusersd.c stable/10/libexec/rpc.rwalld/rpc.rwalld.8 stable/10/libexec/rshd/rshd.8 stable/10/libexec/rshd/rshd.c stable/10/libexec/rtld-elf/malloc.c stable/10/libexec/talkd/announce.c stable/10/libexec/talkd/print.c stable/10/libexec/talkd/process.c stable/10/libexec/talkd/table.c stable/10/libexec/talkd/talkd.8 stable/10/libexec/talkd/talkd.c stable/10/libexec/tftpd/tftpd.8 stable/10/libexec/tftpd/tftpd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/bootpd/rtmsg.c ============================================================================== --- stable/10/libexec/bootpd/rtmsg.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/bootpd/rtmsg.c Mon Feb 24 08:21:49 2014 (r262435) @@ -16,11 +16,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/comsat/comsat.8 ============================================================================== --- stable/10/libexec/comsat/comsat.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/comsat/comsat.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -9,11 +9,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/comsat/comsat.c ============================================================================== --- stable/10/libexec/comsat/comsat.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/comsat/comsat.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/fingerd/fingerd.8 ============================================================================== --- stable/10/libexec/fingerd/fingerd.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/fingerd/fingerd.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -9,11 +9,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/fingerd/fingerd.c ============================================================================== --- stable/10/libexec/fingerd/fingerd.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/fingerd/fingerd.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/fingerd/pathnames.h ============================================================================== --- stable/10/libexec/fingerd/pathnames.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/fingerd/pathnames.h Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/ftpd/extern.h ============================================================================== --- stable/10/libexec/ftpd/extern.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/ftpd/extern.h Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/ftpd/ftpcmd.y ============================================================================== --- stable/10/libexec/ftpd/ftpcmd.y Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/ftpd/ftpcmd.y Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/ftpd/ftpd.8 ============================================================================== --- stable/10/libexec/ftpd/ftpd.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/ftpd/ftpd.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -9,11 +9,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/ftpd/ftpd.c ============================================================================== --- stable/10/libexec/ftpd/ftpd.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/ftpd/ftpd.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/ftpd/logwtmp.c ============================================================================== --- stable/10/libexec/ftpd/logwtmp.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/ftpd/logwtmp.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/ftpd/pathnames.h ============================================================================== --- stable/10/libexec/ftpd/pathnames.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/ftpd/pathnames.h Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/ftpd/popen.c ============================================================================== --- stable/10/libexec/ftpd/popen.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/ftpd/popen.c Mon Feb 24 08:21:49 2014 (r262435) @@ -13,11 +13,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/getty/extern.h ============================================================================== --- stable/10/libexec/getty/extern.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/getty/extern.h Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/getty/getty.8 ============================================================================== --- stable/10/libexec/getty/getty.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/getty/getty.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -9,11 +9,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/getty/gettytab.5 ============================================================================== --- stable/10/libexec/getty/gettytab.5 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/getty/gettytab.5 Mon Feb 24 08:21:49 2014 (r262435) @@ -9,11 +9,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/getty/gettytab.h ============================================================================== --- stable/10/libexec/getty/gettytab.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/getty/gettytab.h Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/getty/init.c ============================================================================== --- stable/10/libexec/getty/init.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/getty/init.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/getty/main.c ============================================================================== --- stable/10/libexec/getty/main.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/getty/main.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/getty/pathnames.h ============================================================================== --- stable/10/libexec/getty/pathnames.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/getty/pathnames.h Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/getty/subr.c ============================================================================== --- stable/10/libexec/getty/subr.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/getty/subr.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/getty/ttys.5 ============================================================================== --- stable/10/libexec/getty/ttys.5 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/getty/ttys.5 Mon Feb 24 08:21:49 2014 (r262435) @@ -9,11 +9,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/mknetid/parse_group.c ============================================================================== --- stable/10/libexec/mknetid/parse_group.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/mknetid/parse_group.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rbootd/bpf.c ============================================================================== --- stable/10/libexec/rbootd/bpf.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/bpf.c Mon Feb 24 08:21:49 2014 (r262435) @@ -18,11 +18,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rbootd/conf.c ============================================================================== --- stable/10/libexec/rbootd/conf.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/conf.c Mon Feb 24 08:21:49 2014 (r262435) @@ -18,11 +18,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rbootd/defs.h ============================================================================== --- stable/10/libexec/rbootd/defs.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/defs.h Mon Feb 24 08:21:49 2014 (r262435) @@ -18,11 +18,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rbootd/parseconf.c ============================================================================== --- stable/10/libexec/rbootd/parseconf.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/parseconf.c Mon Feb 24 08:21:49 2014 (r262435) @@ -18,11 +18,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rbootd/pathnames.h ============================================================================== --- stable/10/libexec/rbootd/pathnames.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/pathnames.h Mon Feb 24 08:21:49 2014 (r262435) @@ -18,11 +18,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rbootd/rbootd.8 ============================================================================== --- stable/10/libexec/rbootd/rbootd.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/rbootd.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -17,11 +17,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/rbootd/rbootd.c ============================================================================== --- stable/10/libexec/rbootd/rbootd.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/rbootd.c Mon Feb 24 08:21:49 2014 (r262435) @@ -18,11 +18,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rbootd/rmp.h ============================================================================== --- stable/10/libexec/rbootd/rmp.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/rmp.h Mon Feb 24 08:21:49 2014 (r262435) @@ -18,11 +18,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rbootd/rmp_var.h ============================================================================== --- stable/10/libexec/rbootd/rmp_var.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/rmp_var.h Mon Feb 24 08:21:49 2014 (r262435) @@ -18,11 +18,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rbootd/rmpproto.c ============================================================================== --- stable/10/libexec/rbootd/rmpproto.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/rmpproto.c Mon Feb 24 08:21:49 2014 (r262435) @@ -18,11 +18,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rbootd/utils.c ============================================================================== --- stable/10/libexec/rbootd/utils.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rbootd/utils.c Mon Feb 24 08:21:49 2014 (r262435) @@ -18,11 +18,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/revnetgroup/parse_netgroup.c ============================================================================== --- stable/10/libexec/revnetgroup/parse_netgroup.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/revnetgroup/parse_netgroup.c Mon Feb 24 08:21:49 2014 (r262435) @@ -13,11 +13,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rlogind/rlogind.8 ============================================================================== --- stable/10/libexec/rlogind/rlogind.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rlogind/rlogind.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -9,11 +9,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/rlogind/rlogind.c ============================================================================== --- stable/10/libexec/rlogind/rlogind.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rlogind/rlogind.c Mon Feb 24 08:21:49 2014 (r262435) @@ -17,11 +17,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rpc.rstatd/rpc.rstatd.8 ============================================================================== --- stable/10/libexec/rpc.rstatd/rpc.rstatd.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rpc.rstatd/rpc.rstatd.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -11,11 +11,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/rpc.rstatd/rstatd.c ============================================================================== --- stable/10/libexec/rpc.rstatd/rstatd.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rpc.rstatd/rstatd.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rpc.rusersd/extern.h ============================================================================== --- stable/10/libexec/rpc.rusersd/extern.h Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rpc.rusersd/extern.h Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rpc.rusersd/rpc.rusersd.8 ============================================================================== --- stable/10/libexec/rpc.rusersd/rpc.rusersd.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rpc.rusersd/rpc.rusersd.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -11,11 +11,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/rpc.rusersd/rusers_proc.c ============================================================================== --- stable/10/libexec/rpc.rusersd/rusers_proc.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rpc.rusersd/rusers_proc.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rpc.rusersd/rusersd.c ============================================================================== --- stable/10/libexec/rpc.rusersd/rusersd.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rpc.rusersd/rusersd.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rpc.rwalld/rpc.rwalld.8 ============================================================================== --- stable/10/libexec/rpc.rwalld/rpc.rwalld.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rpc.rwalld/rpc.rwalld.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -11,11 +11,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/rshd/rshd.8 ============================================================================== --- stable/10/libexec/rshd/rshd.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rshd/rshd.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -9,11 +9,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/rshd/rshd.c ============================================================================== --- stable/10/libexec/rshd/rshd.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rshd/rshd.c Mon Feb 24 08:21:49 2014 (r262435) @@ -17,11 +17,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/rtld-elf/malloc.c ============================================================================== --- stable/10/libexec/rtld-elf/malloc.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/rtld-elf/malloc.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/talkd/announce.c ============================================================================== --- stable/10/libexec/talkd/announce.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/talkd/announce.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/talkd/print.c ============================================================================== --- stable/10/libexec/talkd/print.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/talkd/print.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/talkd/process.c ============================================================================== --- stable/10/libexec/talkd/process.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/talkd/process.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/talkd/table.c ============================================================================== --- stable/10/libexec/talkd/table.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/talkd/table.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/talkd/talkd.8 ============================================================================== --- stable/10/libexec/talkd/talkd.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/talkd/talkd.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -9,11 +9,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/talkd/talkd.c ============================================================================== --- stable/10/libexec/talkd/talkd.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/talkd/talkd.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/libexec/tftpd/tftpd.8 ============================================================================== --- stable/10/libexec/tftpd/tftpd.8 Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/tftpd/tftpd.8 Mon Feb 24 08:21:49 2014 (r262435) @@ -9,11 +9,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 by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: stable/10/libexec/tftpd/tftpd.c ============================================================================== --- stable/10/libexec/tftpd/tftpd.c Mon Feb 24 08:18:11 2014 (r262434) +++ stable/10/libexec/tftpd/tftpd.c Mon Feb 24 08:21:49 2014 (r262435) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-stable-10@FreeBSD.ORG Mon Feb 24 08:50:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 44140CC5; Mon, 24 Feb 2014 08:50:07 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B2F4188A; Mon, 24 Feb 2014 08:50:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O8o7h8013465; Mon, 24 Feb 2014 08:50:07 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O8o7th013464; Mon, 24 Feb 2014 08:50:07 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201402240850.s1O8o7th013464@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 24 Feb 2014 08:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262436 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 08:50:07 -0000 Author: rodrigc Date: Mon Feb 24 08:50:06 2014 New Revision: 262436 URL: http://svnweb.freebsd.org/changeset/base/262436 Log: MFC r262142: In ue_attach_post_task(), initialize curvnet to vnet0 before calling if_attach(). Before this patch, curvnet was NULL. When the VIMAGE kernel option is enabled, this eliminates kernel panics when USB ethernet devices are plugged in. PR: 183835 Submitted by: Hiroo Oono Modified: stable/10/sys/dev/usb/net/usb_ethernet.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- stable/10/sys/dev/usb/net/usb_ethernet.c Mon Feb 24 08:21:49 2014 (r262435) +++ stable/10/sys/dev/usb/net/usb_ethernet.c Mon Feb 24 08:50:06 2014 (r262436) @@ -207,6 +207,7 @@ ue_attach_post_task(struct usb_proc_msg sysctl_ctx_init(&ue->ue_sysctl_ctx); error = 0; + CURVNET_SET_QUIET(vnet0); ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(ue->ue_dev, "could not allocate ifnet\n"); @@ -253,6 +254,8 @@ ue_attach_post_task(struct usb_proc_msg if (ifp->if_capabilities & IFCAP_VLAN_MTU) ifp->if_hdrlen = sizeof(struct ether_vlan_header); + CURVNET_RESTORE(); + snprintf(num, sizeof(num), "%u", ue->ue_unit); ue->ue_sysctl_oid = SYSCTL_ADD_NODE(&ue->ue_sysctl_ctx, &SYSCTL_NODE_CHILDREN(_net, ue), @@ -266,6 +269,7 @@ ue_attach_post_task(struct usb_proc_msg return; fail: + CURVNET_RESTORE(); free_unr(ueunit, ue->ue_unit); if (ue->ue_ifp != NULL) { if_free(ue->ue_ifp); From owner-svn-src-stable-10@FreeBSD.ORG Mon Feb 24 17:01:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0A0839E4; Mon, 24 Feb 2014 17:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9A871D04; Mon, 24 Feb 2014 17:01: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 s1OH1R6S018298; Mon, 24 Feb 2014 17:01:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OH1RfC018297; Mon, 24 Feb 2014 17:01:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402241701.s1OH1RfC018297@svn.freebsd.org> From: Eitan Adler Date: Mon, 24 Feb 2014 17:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262449 - stable/10/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 17:01:28 -0000 Author: eadler Date: Mon Feb 24 17:01:27 2014 New Revision: 262449 URL: http://svnweb.freebsd.org/changeset/base/262449 Log: MFC r261774 by feld: Add caveat to zpool manpage indicating that we do not automatically activate hot spares. This should be MFC'd to all STABLE branches. Upon the availability of zfsd, the zpool manpage on relevant branches should be updated to remove this caveat and document hot spare's reliance on zfsd. Requested by: feld Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Feb 24 17:01:06 2014 (r262448) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Feb 24 17:01:27 2014 (r262449) @@ -1946,3 +1946,9 @@ The .Xr mdoc 7 implementation of this manual page was initially written by .An Martin Matuska Aq mm@FreeBSD.org . +.Sh CAVEATS +The +.Cm spare +feature requires a utility to detect zpool degradation and initiate +disk replacement within the zpool. FreeBSD does not provide such a +utility at this time. From owner-svn-src-stable-10@FreeBSD.ORG Mon Feb 24 19:36:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C90AD44C; Mon, 24 Feb 2014 19:36:33 +0000 (UTC) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F96F1D7D; Mon, 24 Feb 2014 19:36:31 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.7/8.14.7) with ESMTP id s1OJaNCR066766; Mon, 24 Feb 2014 13:36:24 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id s1OJaNZ9066765; Mon, 24 Feb 2014 13:36:23 -0600 (CST) (envelope-from brooks) Date: Mon, 24 Feb 2014 13:36:23 -0600 From: Brooks Davis To: Xin LI Subject: Re: svn commit: r262318 - stable/10/sys/geom/eli Message-ID: <20140224193623.GC18404@lor.one-eyed-alien.net> References: <201402220030.s1M0UX3T044248@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bCsyhTFzCvuiizWE" Content-Disposition: inline In-Reply-To: <201402220030.s1M0UX3T044248@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 19:36:33 -0000 --bCsyhTFzCvuiizWE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 22, 2014 at 12:30:33AM +0000, Xin LI wrote: > Author: delphij > Date: Sat Feb 22 00:30:33 2014 > New Revision: 262318 > URL: http://svnweb.freebsd.org/changeset/base/262318 >=20 > Log: > MFC r261618: > =20 > In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, > k_ipad. > =20 > Note that the two consumers in geli(4) are not affected by this > issue because the way the code is constructed and as such, we > believe there is no security impact with or without this change > with geli(4)'s usage. > =20 > Reported by: Serge van den Boom > Reviewed by: pjd >=20 > Modified: > stable/10/sys/geom/eli/g_eli_crypto.c > Directory Properties: > stable/10/ (props changed) >=20 > Modified: stable/10/sys/geom/eli/g_eli_crypto.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 > --- stable/10/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:16:27 2014 (r2623= 17) > +++ stable/10/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:30:33 2014 (r2623= 18) > @@ -265,6 +265,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * > /* Perform inner SHA512. */ > SHA512_Init(&ctx->shactx); > SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); > + bzero(k_ipad, sizeof(k_ipad)); > } > =20 > void >=20 Unless k_ipad is declared volatile there is some risk an overly smart compiler will optimize this bzero() away. It might make sense for us to use a non-standard function for such zeroing operations. -- Brooks --bCsyhTFzCvuiizWE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iKYEARECAGYFAlMLnzZfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDY1NUQ1MTlDMjZBNzgyRTcyNTI5OUJGMDVE OEU4QkU5RjIzODFBRDQACgkQXY6L6fI4GtTTCQCfSiGFo7KrTv6YvPl6QfqIg5ut JeAAoMPUQ2xbAIIsGS/YHNtjF7kWQ6AV =SNZA -----END PGP SIGNATURE----- --bCsyhTFzCvuiizWE-- From owner-svn-src-stable-10@FreeBSD.ORG Mon Feb 24 20:29:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E22F1308; Mon, 24 Feb 2014 20:29: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BEB8F136A; Mon, 24 Feb 2014 20:29: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 s1OKTexH099458; Mon, 24 Feb 2014 20:29:40 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OKTe9r099457; Mon, 24 Feb 2014 20:29:40 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402242029.s1OKTe9r099457@svn.freebsd.org> From: Dimitry Andric Date: Mon, 24 Feb 2014 20:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262457 - in stable: 10/sys/dev/usb/controller 9/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 20:29:41 -0000 Author: dim Date: Mon Feb 24 20:29:39 2014 New Revision: 262457 URL: http://svnweb.freebsd.org/changeset/base/262457 Log: MFC r262125: In sys/dev/usb/controller/uss820dci.c, similar to r261977, fix a warning about uss820dci_odevd being unused, by adding it to the part that handles getting descriptors. Reported by: loos Reviewed by: hselasky Modified: stable/10/sys/dev/usb/controller/uss820dci.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/usb/controller/uss820dci.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/dev/usb/controller/uss820dci.c ============================================================================== --- stable/10/sys/dev/usb/controller/uss820dci.c Mon Feb 24 19:32:15 2014 (r262456) +++ stable/10/sys/dev/usb/controller/uss820dci.c Mon Feb 24 20:29:39 2014 (r262457) @@ -2005,6 +2005,13 @@ tr_handle_get_descriptor: len = sizeof(uss820dci_devd); ptr = (const void *)&uss820dci_devd; goto tr_valid; + case UDESC_DEVICE_QUALIFIER: + if (value & 0xff) { + goto tr_stalled; + } + len = sizeof(uss820dci_odevd); + ptr = (const void *)&uss820dci_odevd; + goto tr_valid; case UDESC_CONFIG: if (value & 0xff) { goto tr_stalled; From owner-svn-src-stable-10@FreeBSD.ORG Mon Feb 24 21:03:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C3962F44; Mon, 24 Feb 2014 21:03: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC7ED16E1; Mon, 24 Feb 2014 21:03: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 s1OL3c1A015254; Mon, 24 Feb 2014 21:03:38 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OL3ck5015253; Mon, 24 Feb 2014 21:03:38 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201402242103.s1OL3ck5015253@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 24 Feb 2014 21:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262458 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 21:03:38 -0000 Author: mjg Date: Mon Feb 24 21:03:38 2014 New Revision: 262458 URL: http://svnweb.freebsd.org/changeset/base/262458 Log: MFC r262309: Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading to use-after-free. fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but kern_proc_{o,}filedesc_out only checked for hold count. Modified: stable/10/sys/kern/kern_descrip.c Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Mon Feb 24 20:29:39 2014 (r262457) +++ stable/10/sys/kern/kern_descrip.c Mon Feb 24 21:03:38 2014 (r262458) @@ -3052,7 +3052,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE if (fdp->fd_jdir != NULL) export_vnode_for_osysctl(fdp->fd_jdir, KF_FD_TYPE_JAIL, kif, fdp, req); - for (i = 0; i < fdp->fd_nfiles; i++) { + for (i = 0; fdp->fd_refcnt > 0 && i < fdp->fd_nfiles; i++) { if ((fp = fdp->fd_ofiles[i].fde_file) == NULL) continue; bzero(kif, sizeof(*kif)); @@ -3422,7 +3422,7 @@ kern_proc_filedesc_out(struct proc *p, export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, FREAD, -1, -1, NULL, efbuf); } - for (i = 0; i < fdp->fd_nfiles; i++) { + for (i = 0; fdp->fd_refcnt > 0 && i < fdp->fd_nfiles; i++) { if ((fp = fdp->fd_ofiles[i].fde_file) == NULL) continue; data = NULL; From owner-svn-src-stable-10@FreeBSD.ORG Mon Feb 24 21:22:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E2F8D41C; Mon, 24 Feb 2014 21:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B55551865; Mon, 24 Feb 2014 21:22: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 s1OLMjsB023687; Mon, 24 Feb 2014 21:22:45 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OLMj32023685; Mon, 24 Feb 2014 21:22:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402242122.s1OLMj32023685@svn.freebsd.org> From: Dimitry Andric Date: Mon, 24 Feb 2014 21:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262459 - in stable: 10/share/mk 9/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 21:22:46 -0000 Author: dim Date: Mon Feb 24 21:22:44 2014 New Revision: 262459 URL: http://svnweb.freebsd.org/changeset/base/262459 Log: MFC r262310: Move the part in bsd.own.mk that sets -Wno-c++11-extensions for clang to bsd.sys.mk, where it really belongs. This also causes the flag to get added when clang is *not* the default system compiler, but is still used, e.g. by setting WITH_CLANG_IS_CC manually. Modified: stable/10/share/mk/bsd.own.mk stable/10/share/mk/bsd.sys.mk Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/mk/bsd.sys.mk (contents, props changed) Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Mon Feb 24 21:03:38 2014 (r262458) +++ stable/10/share/mk/bsd.own.mk Mon Feb 24 21:22:44 2014 (r262459) @@ -418,15 +418,6 @@ __DEFAULT_YES_OPTIONS+=GCC .else __DEFAULT_NO_OPTIONS+=GCC GNUCXX .endif -# The libc++ headers use c++11 extensions. These are normally silenced because -# they are treated as system headers, but we explicitly disable that warning -# suppression when building the base system to catch bugs in our headers. -# Eventually we'll want to start building the base system C++ code as C++11, -# but not yet. -_COMPVERSION!= ${CC} --version -.if ${_COMPVERSION:Mclang} -CXXFLAGS+= -Wno-c++11-extensions -.endif .else # If clang is not cc, then build gcc by default __DEFAULT_NO_OPTIONS+=CLANG_IS_CC Modified: stable/10/share/mk/bsd.sys.mk ============================================================================== --- stable/10/share/mk/bsd.sys.mk Mon Feb 24 21:03:38 2014 (r262458) +++ stable/10/share/mk/bsd.sys.mk Mon Feb 24 21:22:44 2014 (r262459) @@ -120,6 +120,12 @@ CLANG_NO_IAS= -no-integrated-as CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ -mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret CFLAGS+= -Qunused-arguments +# The libc++ headers use c++11 extensions. These are normally silenced because +# they are treated as system headers, but we explicitly disable that warning +# suppression when building the base system to catch bugs in our headers. +# Eventually we'll want to start building the base system C++ code as C++11, +# but not yet. +CXXFLAGS+= -Wno-c++11-extensions CFLAGS+= ${CFLAGS.clang} CXXFLAGS+= ${CXXFLAGS.clang} .else # !CLANG From owner-svn-src-stable-10@FreeBSD.ORG Tue Feb 25 06:19:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4C1DF73F; Tue, 25 Feb 2014 06:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C6041A87; Tue, 25 Feb 2014 03:49:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P3ngp8081894; Tue, 25 Feb 2014 03:49:42 GMT (envelope-from daichi@svn.freebsd.org) Received: (from daichi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P3nggF081892; Tue, 25 Feb 2014 03:49:42 GMT (envelope-from daichi@svn.freebsd.org) Message-Id: <201402250349.s1P3nggF081892@svn.freebsd.org> From: Daichi GOTO Date: Tue, 25 Feb 2014 03:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262468 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 06:19:05 -0000 Author: daichi (ports committer) Date: Tue Feb 25 03:49:42 2014 New Revision: 262468 URL: http://svnweb.freebsd.org/changeset/base/262468 Log: MFC r262467: sh: Add -h option to SYNOPSIS Reviewed by: jilles Modified: stable/10/bin/sh/sh.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/sh.1 ============================================================================== --- stable/10/bin/sh/sh.1 Tue Feb 25 03:05:43 2014 (r262467) +++ stable/10/bin/sh/sh.1 Tue Feb 25 03:49:42 2014 (r262468) @@ -40,14 +40,14 @@ .Nd command interpreter (shell) .Sh SYNOPSIS .Nm -.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+abCEefhIimnPpTuVvx .Op Fl /+o Ar longname .Oo .Ar script .Op Ar arg ... .Oc .Nm -.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+abCEefhIimnPpTuVvx .Op Fl /+o Ar longname .Fl c Ar string .Oo @@ -55,7 +55,7 @@ .Op Ar arg ... .Oc .Nm -.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+abCEefhIimnPpTuVvx .Op Fl /+o Ar longname .Fl s .Op Ar arg ... From owner-svn-src-stable-10@FreeBSD.ORG Tue Feb 25 07:55:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 ECAD8F1F; Tue, 25 Feb 2014 07:55: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D6BEE1835; Tue, 25 Feb 2014 07:55: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 s1P7t3Cs083362; Tue, 25 Feb 2014 07:55:03 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P7t3Js083361; Tue, 25 Feb 2014 07:55:03 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402250755.s1P7t3Js083361@svn.freebsd.org> From: Christian Brueffer Date: Tue, 25 Feb 2014 07:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262474 - stable/10/usr.sbin/powerd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 07:55:04 -0000 Author: brueffer Date: Tue Feb 25 07:55:03 2014 New Revision: 262474 URL: http://svnweb.freebsd.org/changeset/base/262474 Log: MFC: r261773 In acline_init(), initialize ac_line to SRC_UNKNOWN. Previously this could lead to the -n option effectively being ignored (in case ac_line happened to be 0 aka SRC_AC), or other undefined behaviour. PR: 169779 Submitted by: Alex Gonzalez Reviewed by: jhb Modified: stable/10/usr.sbin/powerd/powerd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/powerd/powerd.c ============================================================================== --- stable/10/usr.sbin/powerd/powerd.c Tue Feb 25 07:40:37 2014 (r262473) +++ stable/10/usr.sbin/powerd/powerd.c Tue Feb 25 07:55:03 2014 (r262474) @@ -279,6 +279,7 @@ static void acline_init(void) { acline_mib_len = 4; + acline_status = SRC_UNKNOWN; if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) { acline_mode = ac_sysctl; From owner-svn-src-stable-10@FreeBSD.ORG Wed Feb 26 06:25:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 071342D4; Wed, 26 Feb 2014 06:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E62B410D0; Wed, 26 Feb 2014 06:25: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 s1Q6PaFB047111; Wed, 26 Feb 2014 06:25:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q6Patq047110; Wed, 26 Feb 2014 06:25:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201402260625.s1Q6Patq047110@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 26 Feb 2014 06:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262524 - stable/10/sys/dev/msk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 06:25:37 -0000 Author: yongari Date: Wed Feb 26 06:25:36 2014 New Revision: 262524 URL: http://svnweb.freebsd.org/changeset/base/262524 Log: MFC r261577: Revert r234666. Clearing TWSI IRQ seems to cause watchdog timeout on old Yukon II controllers. Modified: stable/10/sys/dev/msk/if_msk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/msk/if_msk.c ============================================================================== --- stable/10/sys/dev/msk/if_msk.c Wed Feb 26 04:49:09 2014 (r262523) +++ stable/10/sys/dev/msk/if_msk.c Wed Feb 26 06:25:36 2014 (r262524) @@ -3749,9 +3749,6 @@ msk_intr(void *xsc) if ((status & Y2_IS_STAT_BMU) != 0 && domore == 0) CSR_WRITE_4(sc, STAT_CTRL, SC_STAT_CLR_IRQ); - /* Clear TWSI IRQ. */ - if ((status & Y2_IS_TWSI_RDY) != 0) - CSR_WRITE_4(sc, B2_I2C_IRQ, 1); /* Reenable interrupts. */ CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); From owner-svn-src-stable-10@FreeBSD.ORG Thu Feb 27 01:01:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CA09FD90; Thu, 27 Feb 2014 01:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B53CF1131; Thu, 27 Feb 2014 01:01: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 s1R112w4006860; Thu, 27 Feb 2014 01:01:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R112Ar006858; Thu, 27 Feb 2014 01:01:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402270101.s1R112Ar006858@svn.freebsd.org> From: Eitan Adler Date: Thu, 27 Feb 2014 01:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262541 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 01:01:02 -0000 Author: eadler Date: Thu Feb 27 01:01:02 2014 New Revision: 262541 URL: http://svnweb.freebsd.org/changeset/base/262541 Log: MFC r262451: hier(7): Add /usr/lib/private Modified: stable/10/share/man/man7/hier.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/hier.7 ============================================================================== --- stable/10/share/man/man7/hier.7 Thu Feb 27 00:52:34 2014 (r262540) +++ stable/10/share/man/man7/hier.7 Thu Feb 27 01:01:02 2014 (r262541) @@ -383,6 +383,9 @@ a.out backward compatibility libraries DTrace library scripts .It Pa engines/ OpenSSL (Cryptography/SSL toolkit) dynamically loadable engines +.It Pa private/ +Private system libraries not for use by third-party programs. +ABI and API stability are not guaranteed. .El .Pp .It Pa libdata/ From owner-svn-src-stable-10@FreeBSD.ORG Thu Feb 27 02:36:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0164B6B; Thu, 27 Feb 2014 02:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E153018FC; Thu, 27 Feb 2014 02:36: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 s1R2a9Bp047043; Thu, 27 Feb 2014 02:36:09 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R2a9kN047042; Thu, 27 Feb 2014 02:36:09 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201402270236.s1R2a9kN047042@svn.freebsd.org> From: David Xu Date: Thu, 27 Feb 2014 02:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262544 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 02:36:10 -0000 Author: davidxu Date: Thu Feb 27 02:36:09 2014 New Revision: 262544 URL: http://svnweb.freebsd.org/changeset/base/262544 Log: MFC r262277: malloc_aligned() may not leave enough space for pointer to allocated memory, saving the pointer will overwrite bytes belongs to another memory block unexpectly, to fix the problem, use (allocated address + sizeof(void *)) as initial value, and slip to next aligned address, so maximum extra bytes is sizeof(void *) + align - 1. Tested by: Andre Albsmeier < mail at ma17 dot ata dot myota dot orgndre > MFC r262334: Increase alignment to size of pointer if the alignment is too small. Some modules do not align data at least to size of pointer, they uses a smaller alignment, but our pointer should be aligned to its native boundary, otherwise on some platforms, hardware alignment checking will cause bus error. Modified: stable/10/libexec/rtld-elf/xmalloc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/xmalloc.c ============================================================================== --- stable/10/libexec/rtld-elf/xmalloc.c Thu Feb 27 01:24:47 2014 (r262543) +++ stable/10/libexec/rtld-elf/xmalloc.c Thu Feb 27 02:36:09 2014 (r262544) @@ -72,14 +72,12 @@ void * malloc_aligned(size_t size, size_t align) { void *mem, *res; - uintptr_t x; - size_t asize, r; - r = round(sizeof(void *), align); - asize = round(size, align) + r; - mem = xmalloc(asize); - x = (uintptr_t)mem; - res = (void *)round(x, align); + if (align < sizeof(void *)) + align = sizeof(void *); + + mem = xmalloc(size + sizeof(void *) + align - 1); + res = (void *)round((uintptr_t)mem + sizeof(void *), align); *(void **)((uintptr_t)res - sizeof(void *)) = mem; return (res); } From owner-svn-src-stable-10@FreeBSD.ORG Thu Feb 27 13:08:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D79FC85D; Thu, 27 Feb 2014 13:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2830160D; Thu, 27 Feb 2014 13:08:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RD8hRY055026; Thu, 27 Feb 2014 13:08:43 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RD8hen055025; Thu, 27 Feb 2014 13:08:43 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201402271308.s1RD8hen055025@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 27 Feb 2014 13:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262556 - stable/10/sbin/ifconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 13:08:43 -0000 Author: des Date: Thu Feb 27 13:08:43 2014 New Revision: 262556 URL: http://svnweb.freebsd.org/changeset/base/262556 Log: MFH (r256768): don't report an error for no-op add / remove Modified: stable/10/sbin/ifconfig/ifgroup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifgroup.c ============================================================================== --- stable/10/sbin/ifconfig/ifgroup.c Thu Feb 27 13:05:56 2014 (r262555) +++ stable/10/sbin/ifconfig/ifgroup.c Thu Feb 27 13:08:43 2014 (r262556) @@ -57,7 +57,7 @@ setifgroup(const char *group_name, int d if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ) errx(1, "setifgroup: group name too long"); - if (ioctl(s, SIOCAIFGROUP, (caddr_t)&ifgr) == -1) + if (ioctl(s, SIOCAIFGROUP, (caddr_t)&ifgr) == -1 && errno != EEXIST) err(1," SIOCAIFGROUP"); } @@ -75,7 +75,7 @@ unsetifgroup(const char *group_name, int if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ) errx(1, "unsetifgroup: group name too long"); - if (ioctl(s, SIOCDIFGROUP, (caddr_t)&ifgr) == -1) + if (ioctl(s, SIOCDIFGROUP, (caddr_t)&ifgr) == -1 && errno != ENOENT) err(1, "SIOCDIFGROUP"); } From owner-svn-src-stable-10@FreeBSD.ORG Thu Feb 27 13:19:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F1097C20; Thu, 27 Feb 2014 13:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBB7716EC; Thu, 27 Feb 2014 13:19: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 s1RDJHsX059569; Thu, 27 Feb 2014 13:19:17 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RDJH3L059567; Thu, 27 Feb 2014 13:19:17 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201402271319.s1RDJH3L059567@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 27 Feb 2014 13:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262557 - in stable/10/etc: . rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 13:19:18 -0000 Author: des Date: Thu Feb 27 13:19:17 2014 New Revision: 262557 URL: http://svnweb.freebsd.org/changeset/base/262557 Log: MFH (r256875): start rtsold if necessary MFH (r256878): add a reload command Modified: stable/10/etc/netstart stable/10/etc/rc.d/rtadvd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/netstart ============================================================================== --- stable/10/etc/netstart Thu Feb 27 13:08:43 2014 (r262556) +++ stable/10/etc/netstart Thu Feb 27 13:19:17 2014 (r262557) @@ -59,6 +59,7 @@ _start=quietstart /etc/rc.d/route6d ${_start} /etc/rc.d/mrouted ${_start} /etc/rc.d/routed ${_start} +/etc/rc.d/rtsold ${_start} /etc/rc.d/nisdomain ${_start} exit 0 Modified: stable/10/etc/rc.d/rtadvd ============================================================================== --- stable/10/etc/rc.d/rtadvd Thu Feb 27 13:08:43 2014 (r262556) +++ stable/10/etc/rc.d/rtadvd Thu Feb 27 13:19:17 2014 (r262557) @@ -14,6 +14,8 @@ name="rtadvd" rcvar="rtadvd_enable" command="/usr/sbin/${name}" +extra_commands="reload" +reload_cmd="rtadvd_reload" start_precmd="rtadvd_precmd" rtadvd_precmd() @@ -62,5 +64,9 @@ rtadvd_precmd() return 0 } +rtadvd_reload() { + /usr/sbin/rtadvctl reload +} + load_rc_config $name run_rc_command "$1" From owner-svn-src-stable-10@FreeBSD.ORG Thu Feb 27 13:25:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B3725149; Thu, 27 Feb 2014 13:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8385117B1; Thu, 27 Feb 2014 13:25: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 s1RDPRDb063559; Thu, 27 Feb 2014 13:25:27 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RDPRfX063557; Thu, 27 Feb 2014 13:25:27 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201402271325.s1RDPRfX063557@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 27 Feb 2014 13:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262558 - stable/10/usr.bin/fetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 13:25:27 -0000 Author: des Date: Thu Feb 27 13:25:26 2014 New Revision: 262558 URL: http://svnweb.freebsd.org/changeset/base/262558 Log: MFH (r261233): fix whitespace and bump copyright MFH (r261234): increase buffer size Modified: stable/10/usr.bin/fetch/fetch.1 stable/10/usr.bin/fetch/fetch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/fetch/fetch.1 ============================================================================== --- stable/10/usr.bin/fetch/fetch.1 Thu Feb 27 13:19:17 2014 (r262557) +++ stable/10/usr.bin/fetch/fetch.1 Thu Feb 27 13:25:26 2014 (r262558) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2013 Dag-Erling Smørgrav +.\" Copyright (c) 2000-2014 Dag-Erling Smørgrav .\" Copyright (c) 2013 Michael Gmelin .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2013 +.Dd January 28, 2014 .Dt FETCH 1 .Os .Sh NAME @@ -118,7 +118,7 @@ Automatically retry the transfer upon so Allow SSL version 2 when negotiating the connection. .It Fl B Ar bytes , Fl -buffer-size= Ns Ar bytes Specify the read buffer size in bytes. -The default is 4096 bytes. +The default is 16,384 bytes. Attempts to set a buffer size lower than this will be silently ignored. The number of reads actually performed is reported at verbosity level Modified: stable/10/usr.bin/fetch/fetch.c ============================================================================== --- stable/10/usr.bin/fetch/fetch.c Thu Feb 27 13:19:17 2014 (r262557) +++ stable/10/usr.bin/fetch/fetch.c Thu Feb 27 13:25:26 2014 (r262558) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2011 Dag-Erling Smørgrav + * Copyright (c) 2000-2014 Dag-Erling Smørgrav * Copyright (c) 2013 Michael Gmelin * All rights reserved. * @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include -#define MINBUFSIZE 4096 +#define MINBUFSIZE 16384 #define TIMEOUT 120 /* Option flags */ @@ -109,7 +109,7 @@ enum options OPTION_SSL_CLIENT_KEY_FILE, OPTION_SSL_CRL_FILE, OPTION_SSL_NO_SSL3, - OPTION_SSL_NO_TLS1, + OPTION_SSL_NO_TLS1, OPTION_SSL_NO_VERIFY_HOSTNAME, OPTION_SSL_NO_VERIFY_PEER }; @@ -147,7 +147,7 @@ static struct option longopts[] = { "passive-portrange-default", no_argument, NULL, 'T' }, { "verbose", no_argument, NULL, 'v' }, { "retry-delay", required_argument, NULL, 'w' }, - + /* options without a single character equivalent */ { "bind-address", required_argument, NULL, OPTION_BIND_ADDRESS }, { "no-passive", no_argument, NULL, OPTION_NO_FTP_PASSIVE_MODE }, @@ -716,6 +716,7 @@ fetch(char *URL, const char *path) sigalrm = siginfo = sigint = 0; /* suck in the data */ + setvbuf(f, NULL, _IOFBF, B_size); signal(SIGINFO, sig_handler); while (!sigint) { if (us.size != -1 && us.size - count < B_size && From owner-svn-src-stable-10@FreeBSD.ORG Thu Feb 27 13:27:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C1445408; Thu, 27 Feb 2014 13:27: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC15917CE; Thu, 27 Feb 2014 13:27: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 s1RDR5Qf063878; Thu, 27 Feb 2014 13:27:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RDR5Vo063875; Thu, 27 Feb 2014 13:27:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201402271327.s1RDR5Vo063875@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 27 Feb 2014 13:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262560 - stable/10/lib/libfetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 13:27:05 -0000 Author: des Date: Thu Feb 27 13:27:04 2014 New Revision: 262560 URL: http://svnweb.freebsd.org/changeset/base/262560 Log: MFH (r260904): fix format string MFH (r261230, r261263): fix buffering issues MFH (r261284): bump copyright Modified: stable/10/lib/libfetch/common.c stable/10/lib/libfetch/common.h stable/10/lib/libfetch/http.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/common.c ============================================================================== --- stable/10/lib/libfetch/common.c Thu Feb 27 13:26:41 2014 (r262559) +++ stable/10/lib/libfetch/common.c Thu Feb 27 13:27:04 2014 (r262560) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2011 Dag-Erling Smørgrav + * Copyright (c) 1998-2014 Dag-Erling Smørgrav * Copyright (c) 2013 Michael Gmelin * All rights reserved. * @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -641,7 +642,7 @@ fetch_ssl_verify_hname(X509 *cert, const struct addrinfo *ip; STACK_OF(GENERAL_NAME) *altnames; X509_NAME *subject; - int ret; + int ret; ret = 0; ip = fetch_ssl_get_numeric_addrinfo(host, strlen(host)); @@ -679,7 +680,7 @@ fetch_ssl_setup_transport_layer(SSL_CTX if (getenv("SSL_NO_TLS1") != NULL) ssl_ctx_options |= SSL_OP_NO_TLSv1; if (verbose) - fetch_info("SSL options: %x", ssl_ctx_options); + fetch_info("SSL options: %lx", ssl_ctx_options); SSL_CTX_set_options(ctx, ssl_ctx_options); } @@ -913,33 +914,6 @@ fetch_ssl_read(SSL *ssl, char *buf, size } #endif -/* - * Cache some data that was read from a socket but cannot be immediately - * returned because of an interrupted system call. - */ -static int -fetch_cache_data(conn_t *conn, char *src, size_t nbytes) -{ - char *tmp; - - if (conn->cache.size < nbytes) { - tmp = realloc(conn->cache.buf, nbytes); - if (tmp == NULL) { - fetch_syserr(); - return (-1); - } - conn->cache.buf = tmp; - conn->cache.size = nbytes; - } - - memcpy(conn->cache.buf, src, nbytes); - conn->cache.len = nbytes; - conn->cache.pos = 0; - - return (0); -} - - static ssize_t fetch_socket_read(int sd, char *buf, size_t len) { @@ -962,46 +936,31 @@ ssize_t fetch_read(conn_t *conn, char *buf, size_t len) { struct timeval now, timeout, delta; - fd_set readfds; - ssize_t rlen, total; - char *start; + struct pollfd pfd; + ssize_t rlen; + int deltams; if (fetchTimeout > 0) { gettimeofday(&timeout, NULL); timeout.tv_sec += fetchTimeout; } - total = 0; - start = buf; - - if (conn->cache.len > 0) { - /* - * The last invocation of fetch_read was interrupted by a - * signal after some data had been read from the socket. Copy - * the cached data into the supplied buffer before trying to - * read from the socket again. - */ - total = (conn->cache.len < len) ? conn->cache.len : len; - memcpy(buf, conn->cache.buf, total); - - conn->cache.len -= total; - conn->cache.pos += total; - len -= total; - buf += total; - } + deltams = INFTIM; + memset(&pfd, 0, sizeof pfd); + pfd.fd = conn->sd; + pfd.events = POLLIN | POLLERR; - while (len > 0) { + for (;;) { /* * The socket is non-blocking. Instead of the canonical - * select() -> read(), we do the following: + * poll() -> read(), we do the following: * * 1) call read() or SSL_read(). - * 2) if an error occurred, return -1. - * 3) if we received data but we still expect more, - * update our counters and loop. + * 2) if we received some data, return it. + * 3) if an error occurred, return -1. * 4) if read() or SSL_read() signaled EOF, return. * 5) if we did not receive any data but we're not at EOF, - * call select(). + * call poll(). * * In the SSL case, this is necessary because if we * receive a close notification, we have to call @@ -1017,46 +976,34 @@ fetch_read(conn_t *conn, char *buf, size else #endif rlen = fetch_socket_read(conn->sd, buf, len); - if (rlen == 0) { + if (rlen >= 0) { break; - } else if (rlen > 0) { - len -= rlen; - buf += rlen; - total += rlen; - continue; } else if (rlen == FETCH_READ_ERROR) { - if (errno == EINTR) - fetch_cache_data(conn, start, total); + fetch_syserr(); return (-1); } // assert(rlen == FETCH_READ_WAIT); - FD_ZERO(&readfds); - while (!FD_ISSET(conn->sd, &readfds)) { - FD_SET(conn->sd, &readfds); - if (fetchTimeout > 0) { - gettimeofday(&now, NULL); - if (!timercmp(&timeout, &now, >)) { - errno = ETIMEDOUT; - fetch_syserr(); - return (-1); - } - timersub(&timeout, &now, &delta); - } - errno = 0; - if (select(conn->sd + 1, &readfds, NULL, NULL, - fetchTimeout > 0 ? &delta : NULL) < 0) { - if (errno == EINTR) { - if (fetchRestartCalls) - continue; - /* Save anything that was read. */ - fetch_cache_data(conn, start, total); - } + if (fetchTimeout > 0) { + gettimeofday(&now, NULL); + if (!timercmp(&timeout, &now, >)) { + errno = ETIMEDOUT; fetch_syserr(); return (-1); } + timersub(&timeout, &now, &delta); + deltams = delta.tv_sec * 1000 + + delta.tv_usec / 1000;; + } + errno = 0; + pfd.revents = 0; + if (poll(&pfd, 1, deltams) < 0) { + if (errno == EINTR && fetchRestartCalls) + continue; + fetch_syserr(); + return (-1); } } - return (total); + return (rlen); } @@ -1130,35 +1077,33 @@ ssize_t fetch_writev(conn_t *conn, struct iovec *iov, int iovcnt) { struct timeval now, timeout, delta; - fd_set writefds; + struct pollfd pfd; ssize_t wlen, total; - int r; + int deltams; + memset(&pfd, 0, sizeof pfd); if (fetchTimeout) { - FD_ZERO(&writefds); + pfd.fd = conn->sd; + pfd.events = POLLOUT | POLLERR; gettimeofday(&timeout, NULL); timeout.tv_sec += fetchTimeout; } total = 0; while (iovcnt > 0) { - while (fetchTimeout && !FD_ISSET(conn->sd, &writefds)) { - FD_SET(conn->sd, &writefds); + while (fetchTimeout && pfd.revents == 0) { gettimeofday(&now, NULL); - delta.tv_sec = timeout.tv_sec - now.tv_sec; - delta.tv_usec = timeout.tv_usec - now.tv_usec; - if (delta.tv_usec < 0) { - delta.tv_usec += 1000000; - delta.tv_sec--; - } - if (delta.tv_sec < 0) { + if (!timercmp(&timeout, &now, >)) { errno = ETIMEDOUT; fetch_syserr(); return (-1); } + timersub(&timeout, &now, &delta); + deltams = delta.tv_sec * 1000 + + delta.tv_usec / 1000; errno = 0; - r = select(conn->sd + 1, NULL, &writefds, NULL, &delta); - if (r == -1) { + pfd.revents = 0; + if (poll(&pfd, 1, deltams) < 0) { if (errno == EINTR && fetchRestartCalls) continue; return (-1); @@ -1250,7 +1195,6 @@ fetch_close(conn_t *conn) } #endif ret = close(conn->sd); - free(conn->cache.buf); free(conn->buf); free(conn); return (ret); Modified: stable/10/lib/libfetch/common.h ============================================================================== --- stable/10/lib/libfetch/common.h Thu Feb 27 13:26:41 2014 (r262559) +++ stable/10/lib/libfetch/common.h Thu Feb 27 13:27:04 2014 (r262560) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2011 Dag-Erling Smørgrav + * Copyright (c) 1998-2014 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,13 +52,6 @@ struct fetchconn { size_t bufsize; /* buffer size */ size_t buflen; /* length of buffer contents */ int err; /* last protocol reply code */ - struct { /* data cached after an interrupted - read */ - char *buf; - size_t size; - size_t pos; - size_t len; - } cache; #ifdef WITH_SSL SSL *ssl; /* SSL handle */ SSL_CTX *ssl_ctx; /* SSL context */ Modified: stable/10/lib/libfetch/http.c ============================================================================== --- stable/10/lib/libfetch/http.c Thu Feb 27 13:26:41 2014 (r262559) +++ stable/10/lib/libfetch/http.c Thu Feb 27 13:27:04 2014 (r262560) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2013 Dag-Erling Smørgrav + * Copyright (c) 2000-2014 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -204,10 +204,11 @@ http_growbuf(struct httpio *io, size_t l /* * Fill the input buffer, do chunk decoding on the fly */ -static int +static ssize_t http_fillbuf(struct httpio *io, size_t len) { ssize_t nbytes; + char ch; if (io->error) return (-1); @@ -229,7 +230,7 @@ http_fillbuf(struct httpio *io, size_t l if (io->chunksize == 0) { switch (http_new_chunk(io)) { case -1: - io->error = 1; + io->error = EPROTO; return (-1); case 0: io->eof = 1; @@ -249,10 +250,8 @@ http_fillbuf(struct httpio *io, size_t l io->chunksize -= io->buflen; if (io->chunksize == 0) { - char endl[2]; - - if (fetch_read(io->conn, endl, 2) != 2 || - endl[0] != '\r' || endl[1] != '\n') + if (fetch_read(io->conn, &ch, 1) != 1 || ch != '\r' || + fetch_read(io->conn, &ch, 1) != 1 || ch != '\n') return (-1); } @@ -268,31 +267,30 @@ static int http_readfn(void *v, char *buf, int len) { struct httpio *io = (struct httpio *)v; - int l, pos; + int rlen; if (io->error) return (-1); if (io->eof) return (0); - for (pos = 0; len > 0; pos += l, len -= l) { - /* empty buffer */ - if (!io->buf || io->bufpos == io->buflen) - if (http_fillbuf(io, len) < 1) - break; - l = io->buflen - io->bufpos; - if (len < l) - l = len; - memcpy(buf + pos, io->buf + io->bufpos, l); - io->bufpos += l; + /* empty buffer */ + if (!io->buf || io->bufpos == io->buflen) { + if ((rlen = http_fillbuf(io, len)) < 0) { + if ((errno = io->error) == EINTR) + io->error = 0; + return (-1); + } else if (rlen == 0) { + return (0); + } } - if (!pos && io->error) { - if (io->error == EINTR) - io->error = 0; - return (-1); - } - return (pos); + rlen = io->buflen - io->bufpos; + if (len < rlen) + rlen = len; + memcpy(buf, io->buf + io->bufpos, rlen); + io->bufpos += rlen; + return (rlen); } /* From owner-svn-src-stable-10@FreeBSD.ORG Thu Feb 27 16:05:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 097EEAD4; Thu, 27 Feb 2014 16:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE1A01591; Thu, 27 Feb 2014 16:05: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 s1RG5qQD038758; Thu, 27 Feb 2014 16:05:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RG5qZD038756; Thu, 27 Feb 2014 16:05:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201402271605.s1RG5qZD038756@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 27 Feb 2014 16:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262563 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 16:05:53 -0000 Author: pfg Date: Thu Feb 27 16:05:52 2014 New Revision: 262563 URL: http://svnweb.freebsd.org/changeset/base/262563 Log: MFC r262346: ext2fs: fully enable ext4 read-only support. The ext4 developers tend to tag Ext4-specific flags as "incompatible" even when such features are not relevant for read-only support. This is a consequence of the process though which this filesystem is implemented without design and the fact that some new features are not extensible to ext2/3. Organize the features according to what we support and sort them so that we can now read-only mount filesystems with some features that may be found in newly formatted ext4 fs. Submitted by: Zheng Liu Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c stable/10/sys/fs/ext2fs/ext2fs.h Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vfsops.c Thu Feb 27 13:31:54 2014 (r262562) +++ stable/10/sys/fs/ext2fs/ext2_vfsops.c Thu Feb 27 16:05:52 2014 (r262563) @@ -290,7 +290,8 @@ ext2_check_sb_compat(struct ext2fs *es, return (1); } if (es->e2fs_rev > E2FS_REV0) { - if (es->e2fs_features_incompat & ~EXT2F_INCOMPAT_SUPP) { + if (es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP | + EXT4F_RO_INCOMPAT_SUPP)) { printf( "WARNING: mount of %s denied due to unsupported optional features\n", devtoname(dev)); Modified: stable/10/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2fs.h Thu Feb 27 13:31:54 2014 (r262562) +++ stable/10/sys/fs/ext2fs/ext2fs.h Thu Feb 27 16:05:52 2014 (r262563) @@ -200,19 +200,26 @@ struct csum { * We support the following REV1 features: * - EXT2F_ROCOMPAT_SPARSESUPER * - EXT2F_ROCOMPAT_LARGEFILE + * - EXT2F_ROCOMPAT_EXTRA_ISIZE * - EXT2F_INCOMPAT_FTYPE * - * We partially (read-only) support the following EXT4 features: + * We partially support (read-only) the following EXT4 features: * - EXT2F_ROCOMPAT_HUGE_FILE - * - EXT2F_ROCOMPAT_EXTRA_ISIZE * - EXT2F_INCOMPAT_EXTENTS + * + * We do not support these EXT4 features but they are irrelevant + * for read-only support: + * - EXT2F_INCOMPAT_FLEX_BG + * - EXT2F_INCOMPAT_META_BG */ -#define EXT2F_COMPAT_SUPP 0x0000 +#define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX #define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ EXT2F_ROCOMPAT_LARGEFILE | \ EXT2F_ROCOMPAT_EXTRA_ISIZE) -#define EXT2F_INCOMPAT_SUPP (EXT2F_INCOMPAT_FTYPE | \ - EXT2F_INCOMPAT_EXTENTS) +#define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE +#define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ + EXT2F_INCOMPAT_FLEX_BG | \ + EXT2F_INCOMPAT_META_BG ) /* Assume that user mode programs are passing in an ext2fs superblock, not * a kernel struct super_block. This will allow us to call the feature-test From owner-svn-src-stable-10@FreeBSD.ORG Thu Feb 27 17:29:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D8CC4435; Thu, 27 Feb 2014 17:29: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF9F01FC8; Thu, 27 Feb 2014 17:29: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 s1RHT296075260; Thu, 27 Feb 2014 17:29:02 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RHT2rx075258; Thu, 27 Feb 2014 17:29:02 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201402271729.s1RHT2rx075258@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 27 Feb 2014 17:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-comp... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 17:29:02 -0000 Author: des Date: Thu Feb 27 17:29:02 2014 New Revision: 262566 URL: http://svnweb.freebsd.org/changeset/base/262566 Log: MFH (r261320): upgrade openssh to 6.5p1 MFH (r261340): enable sandboxing by default Added: stable/10/crypto/openssh/PROTOCOL.chacha20poly1305 - copied unchanged from r261320, head/crypto/openssh/PROTOCOL.chacha20poly1305 stable/10/crypto/openssh/PROTOCOL.key - copied unchanged from r261320, head/crypto/openssh/PROTOCOL.key stable/10/crypto/openssh/blocks.c - copied unchanged from r261320, head/crypto/openssh/blocks.c stable/10/crypto/openssh/chacha.c - copied unchanged from r261320, head/crypto/openssh/chacha.c stable/10/crypto/openssh/chacha.h - copied unchanged from r261320, head/crypto/openssh/chacha.h stable/10/crypto/openssh/cipher-chachapoly.c - copied unchanged from r261320, head/crypto/openssh/cipher-chachapoly.c stable/10/crypto/openssh/cipher-chachapoly.h - copied unchanged from r261320, head/crypto/openssh/cipher-chachapoly.h stable/10/crypto/openssh/crypto_api.h - copied unchanged from r261320, head/crypto/openssh/crypto_api.h stable/10/crypto/openssh/digest.c - copied unchanged from r261320, head/crypto/openssh/digest.c stable/10/crypto/openssh/digest.h - copied unchanged from r261320, head/crypto/openssh/digest.h stable/10/crypto/openssh/ed25519.c - copied unchanged from r261320, head/crypto/openssh/ed25519.c stable/10/crypto/openssh/fe25519.c - copied unchanged from r261320, head/crypto/openssh/fe25519.c stable/10/crypto/openssh/fe25519.h - copied unchanged from r261320, head/crypto/openssh/fe25519.h stable/10/crypto/openssh/ge25519.c - copied unchanged from r261320, head/crypto/openssh/ge25519.c stable/10/crypto/openssh/ge25519.h - copied unchanged from r261320, head/crypto/openssh/ge25519.h stable/10/crypto/openssh/ge25519_base.data - copied unchanged from r261320, head/crypto/openssh/ge25519_base.data stable/10/crypto/openssh/hash.c - copied unchanged from r261320, head/crypto/openssh/hash.c stable/10/crypto/openssh/kexc25519.c - copied unchanged from r261320, head/crypto/openssh/kexc25519.c stable/10/crypto/openssh/kexc25519c.c - copied unchanged from r261320, head/crypto/openssh/kexc25519c.c stable/10/crypto/openssh/kexc25519s.c - copied unchanged from r261320, head/crypto/openssh/kexc25519s.c stable/10/crypto/openssh/openbsd-compat/arc4random.c - copied unchanged from r261320, head/crypto/openssh/openbsd-compat/arc4random.c stable/10/crypto/openssh/openbsd-compat/bcrypt_pbkdf.c - copied unchanged from r261320, head/crypto/openssh/openbsd-compat/bcrypt_pbkdf.c stable/10/crypto/openssh/openbsd-compat/blf.h - copied unchanged from r261320, head/crypto/openssh/openbsd-compat/blf.h stable/10/crypto/openssh/openbsd-compat/blowfish.c - copied unchanged from r261320, head/crypto/openssh/openbsd-compat/blowfish.c stable/10/crypto/openssh/openbsd-compat/chacha_private.h - copied unchanged from r261320, head/crypto/openssh/openbsd-compat/chacha_private.h stable/10/crypto/openssh/poly1305.c - copied unchanged from r261320, head/crypto/openssh/poly1305.c stable/10/crypto/openssh/poly1305.h - copied unchanged from r261320, head/crypto/openssh/poly1305.h stable/10/crypto/openssh/regress/setuid-allowed.c - copied unchanged from r261320, head/crypto/openssh/regress/setuid-allowed.c stable/10/crypto/openssh/regress/sftp-perm.sh - copied unchanged from r261320, head/crypto/openssh/regress/sftp-perm.sh stable/10/crypto/openssh/sandbox-capsicum.c - copied unchanged from r261320, head/crypto/openssh/sandbox-capsicum.c stable/10/crypto/openssh/sc25519.c - copied unchanged from r261320, head/crypto/openssh/sc25519.c stable/10/crypto/openssh/sc25519.h - copied unchanged from r261320, head/crypto/openssh/sc25519.h stable/10/crypto/openssh/smult_curve25519_ref.c - copied unchanged from r261320, head/crypto/openssh/smult_curve25519_ref.c stable/10/crypto/openssh/ssh-ed25519.c - copied unchanged from r261320, head/crypto/openssh/ssh-ed25519.c stable/10/crypto/openssh/verify.c - copied unchanged from r261320, head/crypto/openssh/verify.c Deleted: stable/10/crypto/openssh/openbsd-compat/bsd-arc4random.c Modified: stable/10/crypto/openssh/ChangeLog stable/10/crypto/openssh/Makefile.in stable/10/crypto/openssh/PROTOCOL stable/10/crypto/openssh/README stable/10/crypto/openssh/aclocal.m4 stable/10/crypto/openssh/addrmatch.c stable/10/crypto/openssh/atomicio.c stable/10/crypto/openssh/auth-krb5.c stable/10/crypto/openssh/auth-options.c stable/10/crypto/openssh/auth-pam.c stable/10/crypto/openssh/auth2-hostbased.c stable/10/crypto/openssh/auth2-pubkey.c stable/10/crypto/openssh/authfd.c stable/10/crypto/openssh/authfile.c stable/10/crypto/openssh/authfile.h stable/10/crypto/openssh/bufaux.c stable/10/crypto/openssh/bufbn.c stable/10/crypto/openssh/buffer.c stable/10/crypto/openssh/buffer.h stable/10/crypto/openssh/canohost.c stable/10/crypto/openssh/channels.c stable/10/crypto/openssh/cipher.c stable/10/crypto/openssh/cipher.h stable/10/crypto/openssh/clientloop.c stable/10/crypto/openssh/compat.c stable/10/crypto/openssh/compat.h stable/10/crypto/openssh/config.h stable/10/crypto/openssh/config.h.in stable/10/crypto/openssh/configure stable/10/crypto/openssh/configure.ac stable/10/crypto/openssh/contrib/caldera/openssh.spec stable/10/crypto/openssh/contrib/cygwin/ssh-host-config stable/10/crypto/openssh/contrib/redhat/openssh.spec stable/10/crypto/openssh/contrib/suse/openssh.spec stable/10/crypto/openssh/defines.h stable/10/crypto/openssh/dh.c stable/10/crypto/openssh/dh.h stable/10/crypto/openssh/gss-serv-krb5.c stable/10/crypto/openssh/hostfile.c stable/10/crypto/openssh/kex.c stable/10/crypto/openssh/kex.h stable/10/crypto/openssh/kexdh.c stable/10/crypto/openssh/kexdhc.c stable/10/crypto/openssh/kexdhs.c stable/10/crypto/openssh/kexecdh.c stable/10/crypto/openssh/kexecdhc.c stable/10/crypto/openssh/kexecdhs.c stable/10/crypto/openssh/kexgex.c stable/10/crypto/openssh/kexgexc.c stable/10/crypto/openssh/kexgexs.c stable/10/crypto/openssh/key.c stable/10/crypto/openssh/key.h stable/10/crypto/openssh/loginrec.c stable/10/crypto/openssh/mac.c stable/10/crypto/openssh/mac.h stable/10/crypto/openssh/match.c stable/10/crypto/openssh/misc.c stable/10/crypto/openssh/misc.h stable/10/crypto/openssh/moduli.c stable/10/crypto/openssh/monitor.c stable/10/crypto/openssh/monitor_mm.c stable/10/crypto/openssh/monitor_mm.h stable/10/crypto/openssh/myproposal.h stable/10/crypto/openssh/openbsd-compat/Makefile.in stable/10/crypto/openssh/openbsd-compat/bsd-cygwin_util.h stable/10/crypto/openssh/openbsd-compat/bsd-misc.c stable/10/crypto/openssh/openbsd-compat/bsd-poll.c stable/10/crypto/openssh/openbsd-compat/bsd-setres_id.c stable/10/crypto/openssh/openbsd-compat/bsd-snprintf.c stable/10/crypto/openssh/openbsd-compat/bsd-statvfs.c stable/10/crypto/openssh/openbsd-compat/bsd-statvfs.h stable/10/crypto/openssh/openbsd-compat/openbsd-compat.h stable/10/crypto/openssh/openbsd-compat/openssl-compat.c stable/10/crypto/openssh/openbsd-compat/openssl-compat.h stable/10/crypto/openssh/openbsd-compat/setproctitle.c stable/10/crypto/openssh/packet.c stable/10/crypto/openssh/pathnames.h stable/10/crypto/openssh/pkcs11.h stable/10/crypto/openssh/platform.c stable/10/crypto/openssh/platform.h stable/10/crypto/openssh/progressmeter.c stable/10/crypto/openssh/readconf.c stable/10/crypto/openssh/readconf.h stable/10/crypto/openssh/regress/Makefile stable/10/crypto/openssh/regress/agent-ptrace.sh stable/10/crypto/openssh/regress/agent.sh stable/10/crypto/openssh/regress/cert-hostkey.sh stable/10/crypto/openssh/regress/cert-userkey.sh stable/10/crypto/openssh/regress/cipher-speed.sh stable/10/crypto/openssh/regress/forward-control.sh stable/10/crypto/openssh/regress/integrity.sh stable/10/crypto/openssh/regress/kextype.sh stable/10/crypto/openssh/regress/keytype.sh stable/10/crypto/openssh/regress/krl.sh stable/10/crypto/openssh/regress/modpipe.c stable/10/crypto/openssh/regress/rekey.sh stable/10/crypto/openssh/regress/scp-ssh-wrapper.sh stable/10/crypto/openssh/regress/scp.sh stable/10/crypto/openssh/regress/test-exec.sh stable/10/crypto/openssh/regress/try-ciphers.sh stable/10/crypto/openssh/roaming_client.c stable/10/crypto/openssh/roaming_common.c stable/10/crypto/openssh/sandbox-darwin.c stable/10/crypto/openssh/sandbox-null.c stable/10/crypto/openssh/sandbox-rlimit.c stable/10/crypto/openssh/sandbox-seccomp-filter.c stable/10/crypto/openssh/sandbox-systrace.c stable/10/crypto/openssh/schnorr.c stable/10/crypto/openssh/schnorr.h stable/10/crypto/openssh/scp.0 stable/10/crypto/openssh/scp.1 stable/10/crypto/openssh/scp.c stable/10/crypto/openssh/servconf.c stable/10/crypto/openssh/servconf.h stable/10/crypto/openssh/serverloop.c stable/10/crypto/openssh/session.c stable/10/crypto/openssh/session.h stable/10/crypto/openssh/sftp-client.c stable/10/crypto/openssh/sftp-client.h stable/10/crypto/openssh/sftp-common.c stable/10/crypto/openssh/sftp-glob.c stable/10/crypto/openssh/sftp-server.0 stable/10/crypto/openssh/sftp-server.8 stable/10/crypto/openssh/sftp-server.c stable/10/crypto/openssh/sftp.0 stable/10/crypto/openssh/sftp.1 stable/10/crypto/openssh/sftp.c stable/10/crypto/openssh/ssh-add.0 stable/10/crypto/openssh/ssh-add.1 stable/10/crypto/openssh/ssh-add.c stable/10/crypto/openssh/ssh-agent.0 stable/10/crypto/openssh/ssh-agent.1 stable/10/crypto/openssh/ssh-agent.c stable/10/crypto/openssh/ssh-dss.c stable/10/crypto/openssh/ssh-ecdsa.c stable/10/crypto/openssh/ssh-keygen.0 stable/10/crypto/openssh/ssh-keygen.1 stable/10/crypto/openssh/ssh-keygen.c stable/10/crypto/openssh/ssh-keyscan.0 stable/10/crypto/openssh/ssh-keyscan.1 stable/10/crypto/openssh/ssh-keyscan.c stable/10/crypto/openssh/ssh-keysign.0 stable/10/crypto/openssh/ssh-keysign.8 stable/10/crypto/openssh/ssh-keysign.c stable/10/crypto/openssh/ssh-pkcs11-helper.c stable/10/crypto/openssh/ssh-pkcs11.c stable/10/crypto/openssh/ssh-rsa.c stable/10/crypto/openssh/ssh-sandbox.h stable/10/crypto/openssh/ssh.0 stable/10/crypto/openssh/ssh.1 stable/10/crypto/openssh/ssh.c stable/10/crypto/openssh/ssh_config stable/10/crypto/openssh/ssh_config.0 stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/ssh_namespace.h stable/10/crypto/openssh/sshconnect.c stable/10/crypto/openssh/sshconnect.h stable/10/crypto/openssh/sshconnect1.c stable/10/crypto/openssh/sshconnect2.c stable/10/crypto/openssh/sshd.0 stable/10/crypto/openssh/sshd.8 stable/10/crypto/openssh/sshd.c stable/10/crypto/openssh/sshd_config stable/10/crypto/openssh/sshd_config.0 stable/10/crypto/openssh/sshd_config.5 stable/10/crypto/openssh/uidswap.c stable/10/crypto/openssh/version.h stable/10/crypto/openssh/xmalloc.c stable/10/etc/rc.d/sshd stable/10/secure/lib/libssh/Makefile stable/10/secure/usr.sbin/sshd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/crypto/openssh/ChangeLog ============================================================================== --- stable/10/crypto/openssh/ChangeLog Thu Feb 27 16:54:43 2014 (r262565) +++ stable/10/crypto/openssh/ChangeLog Thu Feb 27 17:29:02 2014 (r262566) @@ -1,25 +1,1042 @@ -20131108 +20140130 + - (djm) [configure.ac] Only check for width-specified integer types + in headers that actually exist. patch from Tom G. Christensen; + ok dtucker@ + - (djm) [configure.ac atomicio.c] Kludge around NetBSD offering + different symbols for 'read' when various compiler flags are + in use, causing atomicio.c comparisons against it to break and + read/write operations to hang; ok dtucker + - (djm) Release openssh-6.5p1 + +20140129 + - (djm) [configure.ac] Fix broken shell test '==' vs '='; patch from + Tom G. Christensen + +20140128 + - (djm) [configure.ac] Search for inet_ntop in libnsl and libresovl; + ok dtucker + - (djm) [sshd.c] Use kill(0, ...) instead of killpg(0, ...); the + latter being specified to have undefined behaviour in SUSv3; + ok dtucker + - (tim) [regress/agent.sh regress/agent-ptrace.sh] Assign $? to a variable + when used as an error message inside an if statement so we display the + correct into. agent.sh patch from Petr Lautrbach. + +20140127 + - (dtucker) [Makefile.in] Remove trailing backslash which some make + implementations (eg older Solaris) do not cope with. + +20140126 + - OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2014/01/25 10:12:50 + [cipher.c cipher.h kex.c kex.h kexgexc.c] + Add a special case for the DH group size for 3des-cbc, which has an + effective strength much lower than the key size. This causes problems + with some cryptlib implementations, which don't support group sizes larger + than 4k but also don't use the largest group size it does support as + specified in the RFC. Based on a patch from Petr Lautrbach at Redhat, + reduced by me with input from Markus. ok djm@ markus@ + - markus@cvs.openbsd.org 2014/01/25 20:35:37 + [kex.c] + dh_need needs to be set to max(seclen, blocksize, ivlen, mac_len) + ok dtucker@, noted by mancha + - (djm) [configure.ac sandbox-capsicum.c sandbox-rlimit.c] Disable + RLIMIT_NOFILE pseudo-sandbox on FreeBSD. In some configurations, + libc will attempt to open additional file descriptors for crypto + offload and crash if they cannot be opened. + - (djm) [configure.ac] correct AC_DEFINE for previous. + +20140125 + - (djm) [configure.ac] Fix detection of capsicum sandbox on FreeBSD + - (djm) [configure.ac] Do not attempt to use capsicum sandbox unless + sys/capability.h exists and cap_rights_limit is in libc. Fixes + build on FreeBSD9x which provides the header but not the libc + support. + - (djm) [configure.ac] autoconf sets finds to 'yes' not '1', so test + against the correct thing. + +20140124 + - (djm) [Makefile.in regress/scp-ssh-wrapper.sh regress/scp.sh] Make + the scp regress test actually test the built scp rather than the one + in $PATH. ok dtucker@ + +20140123 + - (tim) [session.c] Improve error reporting on set_id(). + - (dtucker) [configure.ac] NetBSD's (and FreeBSD's) strnvis is gratuitously + incompatible with OpenBSD's despite post-dating it by more than a decade. + Declare it as broken, and document FreeBSD's as the same. ok djm@ + +20140122 + - (djm) [openbsd-compat/setproctitle.c] Don't fail to compile if a + platform that is expected to use the reuse-argv style setproctitle + hack surprises us by providing a setproctitle in libc; ok dtucker + - (djm) [configure.ac] Unless specifically requested, only attempt + to build Position Independent Executables on gcc >= 4.x; ok dtucker + - (djm) [configure.ac aclocal.m4] More tests to detect fallout from + platform hardening options: include some long long int arithmatic + to detect missing support functions for -ftrapv in libgcc and + equivalents, actually test linking when -ftrapv is supplied and + set either both -pie/-fPIE or neither. feedback and ok dtucker@ + +20140121 + - (dtucker) [configure.ac] Make PIE a configure-time option which defaults + to on platforms where it's known to be reliably detected and off elsewhere. + Works around platforms such as FreeBSD 9.1 where it does not interop with + -ftrapv (it seems to work but fails when trying to link ssh). ok djm@ + - (dtucker) [aclocal.m4] Differentiate between compile-time and link-time + tests in the configure output. ok djm. + - (tim) [platform.c session.c] Fix bug affecting SVR5 platforms introduced + with sftp chroot support. Move set_id call after chroot. + - (djm) [aclocal.m4] Flesh out the code run in the OSSH_CHECK_CFLAG_COMPILE + and OSSH_CHECK_LDFLAG_LINK tests to give them a better chance of + detecting toolchain-related problems; ok dtucker + +20140120 + - (dtucker) [gss-serv-krb5.c] Fall back to krb5_cc_gen_new if the Kerberos + implementation does not have krb5_cc_new_unique, similar to what we do + in auth-krb5.c. + - (djm) [regress/cert-hostkey.sh] Fix regress failure on platforms that + skip one or more key types (e.g. RHEL/CentOS 6.5); ok dtucker@ + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/01/20 00:08:48 + [digest.c] + memleak; found by Loganaden Velvindron @ AfriNIC; ok markus@ + +20140119 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2014/01/17 06:23:24 + [sftp-server.c] + fix log message statvfs. ok djm + - dtucker@cvs.openbsd.org 2014/01/18 09:36:26 + [session.c] + explicitly define USE_PIPES to 1 to prevent redefinition warnings in + portable on platforms that use pipes for everything. From vinschen at + redhat. + - dtucker@cvs.openbsd.org 2014/01/19 04:17:29 + [canohost.c addrmatch.c] + Cast socklen_t when comparing to size_t and use socklen_t to iterate over + the ip options, both to prevent signed/unsigned comparison warnings. + Patch from vinschen at redhat via portable openssh, begrudging ok deraadt. + - djm@cvs.openbsd.org 2014/01/19 04:48:08 + [ssh_config.5] + fix inverted meaning of 'no' and 'yes' for CanonicalizeFallbackLocal + - dtucker@cvs.openbsd.org 2014/01/19 11:21:51 + [addrmatch.c] + Cast the sizeof to socklen_t so it'll work even if the supplied len is + negative. Suggested by and ok djm, ok deraadt. + +20140118 + - (dtucker) [uidswap.c] Prevent unused variable warnings on Cygwin. Patch + from vinschen at redhat.com + - (dtucker) [openbsd-compat/bsd-cygwin_util.h] Add missing function + declarations that stopped being included when we stopped including + from openbsd-compat/bsd-cygwin_util.h. Patch from vinschen at + redhat.com. + - (dtucker) [configure.ac] On Cygwin the getopt variables (like optargs, + optind) are defined in getopt.h already. Unfortunately they are defined as + "declspec(dllimport)" for historical reasons, because the GNU linker didn't + allow auto-import on PE/COFF targets way back when. The problem is the + dllexport attributes collide with the definitions in the various source + files in OpenSSH, which obviousy define the variables without + declspec(dllimport). The least intrusive way to get rid of these warnings + is to disable warnings for GCC compiler attributes when building on Cygwin. + Patch from vinschen at redhat.com. + - (dtucker) [sandbox-capsicum.c] Correct some error messages and make the + return value check for cap_enter() consistent with the other uses in + FreeBSD. From by Loganaden Velvindron @ AfriNIC via bz#2140. + +20140117 + - (dtucker) [aclocal.m4 configure.ac] Add some additional compiler/toolchain + hardening flags including -fstack-protector-strong. These default to on + if the toolchain supports them, but there is a configure-time knob + (--without-hardening) to disable them if necessary. ok djm@ + - (djm) [sftp-client.c] signed/unsigned comparison fix + - (dtucker) [loginrec.c] Cast to the types specfied in the format + specification to prevent warnings. + - (dtucker) [crypto_api.h] Wrap stdlib.h include inside #ifdef HAVE_STDINT_H. + - (dtucker) [poly1305.c] Wrap stdlib.h include inside #ifdef HAVE_STDINT_H. + - (dtucker) [blocks.c fe25519.c ge25519.c hash.c sc25519.c verify.c] Include + includes.h to pull in all of the compatibility stuff. + - (dtucker) [openbsd-compat/bcrypt_pbkdf.c] Wrap stdlib.h include inside + #ifdef HAVE_STDINT_H. + - (dtucker) [defines.h] Add typedefs for uintXX_t types for platforms that + don't have them. + - (dtucker) [configure.ac] Split AC_CHECK_FUNCS for OpenSSL functions into + separate lines and alphabetize for easier diffing of changes. + - (dtucker) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/01/17 00:21:06 + [sftp-client.c] + signed/unsigned comparison warning fix; from portable (Id sync only) + - dtucker@cvs.openbsd.org 2014/01/17 05:26:41 + [digest.c] + remove unused includes. ok djm@ + - (djm) [Makefile.in configure.ac sandbox-capsicum.c sandbox-darwin.c] + [sandbox-null.c sandbox-rlimit.c sandbox-seccomp-filter.c] + [sandbox-systrace.c ssh-sandbox.h sshd.c] Support preauth sandboxing + using the Capsicum API introduced in FreeBSD 10. Patch by Dag-Erling + Smorgrav, updated by Loganaden Velvindron @ AfriNIC; ok dtucker@ + - (dtucker) [configure.ac digest.c openbsd-compat/openssl-compat.c + openbsd-compat/openssl-compat.h] Add compatibility layer for older + openssl versions. ok djm@ + - (dtucker) Fix typo in #ifndef. + - (dtucker) [configure.ac openbsd-compat/bsd-statvfs.c + openbsd-compat/bsd-statvfs.h] Implement enough of statvfs on top of statfs + to be useful (and for the regression tests to pass) on platforms that + have statfs and fstatfs. ok djm@ + - (dtucker) [openbsd-compat/bsd-statvfs.h] Only start including headers if we + need them to cut down on the name collisions. + - (dtucker) [configure.ac] Also look in inttypes.h for uintXX_t types. + - (dtucker) [configure.ac] Have --without-hardening not turn off + stack-protector since that has a separate flag that's been around a while. + - (dtucker) [readconf.c] Wrap paths.h inside an ifdef. Allows building on + Solaris. + - (dtucker) [defines.h] Move our definitions of uintXX_t types down to after + they're defined if we have to define them ourselves. Fixes builds on old + AIX. + +20140118 - (djm) OpenBSD CVS Sync - - markus@cvs.openbsd.org 2013/11/06 16:52:11 - [monitor_wrap.c] - fix rekeying for AES-GCM modes; ok deraadt + - djm@cvs.openbsd.org 2014/01/16 07:31:09 + [sftp-client.c] + needless and incorrect cast to size_t can break resumption of + large download; patch from tobias@ + - djm@cvs.openbsd.org 2014/01/16 07:32:00 + [version.h] + openssh-6.5 + - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank RPM spec version numbers. + - (djm) [README] update release notes URL. + +20140112 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/01/10 05:59:19 + [sshd_config] + the /etc/ssh/ssh_host_ed25519_key is loaded by default too + - djm@cvs.openbsd.org 2014/01/12 08:13:13 + [bufaux.c buffer.h kex.c kex.h kexc25519.c kexc25519c.c kexc25519s.c] + [kexdhc.c kexdhs.c kexecdhc.c kexecdhs.c kexgexc.c kexgexs.c] + avoid use of OpenSSL BIGNUM type and functions for KEX with + Curve25519 by adding a buffer_put_bignum2_from_string() that stores + a string using the bignum encoding rules. Will make it easier to + build a reduced-feature OpenSSH without OpenSSL in the future; + ok markus@ + +20140110 + - (djm) OpenBSD CVS Sync + - tedu@cvs.openbsd.org 2014/01/04 17:50:55 + [mac.c monitor_mm.c monitor_mm.h xmalloc.c] + use standard types and formats for size_t like variables. ok dtucker + - guenther@cvs.openbsd.org 2014/01/09 03:26:00 + [sftp-common.c] + When formating the time for "ls -l"-style output, show dates in the future + with the year, and rearrange a comparison to avoid a potentional signed + arithmetic overflow that would give the wrong result. + ok djm@ + - djm@cvs.openbsd.org 2014/01/09 23:20:00 + [digest.c digest.h hostfile.c kex.c kex.h kexc25519.c kexc25519c.c] + [kexc25519s.c kexdh.c kexecdh.c kexecdhc.c kexecdhs.c kexgex.c kexgexc.c] + [kexgexs.c key.c key.h roaming_client.c roaming_common.c schnorr.c] + [schnorr.h ssh-dss.c ssh-ecdsa.c ssh-rsa.c sshconnect2.c] + Introduce digest API and use it to perform all hashing operations + rather than calling OpenSSL EVP_Digest* directly. Will make it easier + to build a reduced-feature OpenSSH without OpenSSL in future; + feedback, ok markus@ + - djm@cvs.openbsd.org 2014/01/09 23:26:48 + [sshconnect.c sshd.c] + ban clients/servers that suffer from SSH_BUG_DERIVEKEY, they are ancient, + deranged and might make some attacks on KEX easier; ok markus@ + +20140108 + - (djm) [regress/.cvsignore] Ignore regress test droppings; ok dtucker@ + +20131231 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/12/30 23:52:28 + [auth2-hostbased.c auth2-pubkey.c compat.c compat.h ssh-rsa.c] + [sshconnect.c sshconnect2.c sshd.c] + refuse RSA keys from old proprietary clients/servers that use the + obsolete RSA+MD5 signature scheme. it will still be possible to connect + with these clients/servers but only DSA keys will be accepted, and we'll + deprecate them entirely in a future release. ok markus@ + +20131229 + - (djm) [loginrec.c] Check for username truncation when looking up lastlog + entries + - (djm) [regress/Makefile] Add some generated files for cleaning + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/12/19 00:10:30 + [ssh-add.c] + skip requesting smartcard PIN when removing keys from agent; bz#2187 + patch from jay AT slushpupie.com; ok dtucker + - dtucker@cvs.openbsd.org 2013/12/19 00:19:12 + [serverloop.c] + Cast client_alive_interval to u_int64_t before assinging to + max_time_milliseconds to avoid potential integer overflow in the timeout. + bz#2170, patch from Loganaden Velvindron, ok djm@ + - djm@cvs.openbsd.org 2013/12/19 00:27:57 + [auth-options.c] + simplify freeing of source-address certificate restriction + - djm@cvs.openbsd.org 2013/12/19 01:04:36 + [channels.c] + bz#2147: fix multiple remote forwardings with dynamically assigned + listen ports. In the s->c message to open the channel we were sending + zero (the magic number to request a dynamic port) instead of the actual + listen port. The client therefore had no way of discriminating between + them. + + Diagnosis and fix by ronf AT timeheart.net + - djm@cvs.openbsd.org 2013/12/19 01:19:41 + [ssh-agent.c] + bz#2186: don't crash (NULL deref) when deleting PKCS#11 keys from an agent + that has a mix of normal and PKCS#11 keys; fix from jay AT slushpupie.com; + ok dtucker + - djm@cvs.openbsd.org 2013/12/19 22:57:13 + [poly1305.c poly1305.h] + use full name for author, with his permission + - tedu@cvs.openbsd.org 2013/12/21 07:10:47 + [ssh-keygen.1] + small typo + - djm@cvs.openbsd.org 2013/12/27 22:30:17 + [ssh-dss.c ssh-ecdsa.c ssh-rsa.c] + make the original RSA and DSA signing/verification code look more like + the ECDSA/Ed25519 ones: use key_type_plain() when checking the key type + rather than tediously listing all variants, use __func__ for debug/ + error messages + - djm@cvs.openbsd.org 2013/12/27 22:37:18 + [ssh-rsa.c] + correct comment + - djm@cvs.openbsd.org 2013/12/29 02:28:10 + [key.c] + allow ed25519 keys to appear as certificate authorities + - djm@cvs.openbsd.org 2013/12/29 02:37:04 + [key.c] + correct comment for key_to_certified() + - djm@cvs.openbsd.org 2013/12/29 02:49:52 + [key.c] + correct comment for key_drop_cert() + - djm@cvs.openbsd.org 2013/12/29 04:20:04 + [key.c] + to make sure we don't omit any key types as valid CA keys again, + factor the valid key type check into a key_type_is_valid_ca() + function + - djm@cvs.openbsd.org 2013/12/29 04:29:25 + [authfd.c] + allow deletion of ed25519 keys from the agent + - djm@cvs.openbsd.org 2013/12/29 04:35:50 + [authfile.c] + don't refuse to load Ed25519 certificates + - djm@cvs.openbsd.org 2013/12/29 05:42:16 + [ssh.c] + don't forget to load Ed25519 certs too + - djm@cvs.openbsd.org 2013/12/29 05:57:02 + [sshconnect.c] + when showing other hostkeys, don't forget Ed25519 keys + +20131221 + - (dtucker) [regress/keytype.sh] Actually test ecdsa key types. + +20131219 + - (dtucker) [configure.ac] bz#2178: Don't try to use BSM on Solaris versions + greater than 11 either rather than just 11. Patch from Tomas Kuthan. + - (dtucker) [auth-pam.c] bz#2163: check return value from pam_get_item(). + Patch from Loganaden Velvindron. + +20131218 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/12/07 08:08:26 + [ssh-keygen.1] + document -a and -o wrt new key format + - naddy@cvs.openbsd.org 2013/12/07 11:58:46 + [ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh-keysign.8 ssh.1] + [ssh_config.5 sshd.8 sshd_config.5] + add missing mentions of ed25519; ok djm@ + - dtucker@cvs.openbsd.org 2013/12/08 09:53:27 + [sshd_config.5] + Use a literal for the default value of KEXAlgorithms. ok deraadt jmc + - markus@cvs.openbsd.org 2013/12/09 11:03:45 + [blocks.c ed25519.c fe25519.c fe25519.h ge25519.c ge25519.h] + [ge25519_base.data hash.c sc25519.c sc25519.h verify.c] + Add Authors for the public domain ed25519/nacl code. + see also http://nacl.cr.yp.to/features.html + All of the NaCl software is in the public domain. + and http://ed25519.cr.yp.to/software.html + The Ed25519 software is in the public domain. + - markus@cvs.openbsd.org 2013/12/09 11:08:17 + [crypto_api.h] + remove unused defines + - pascal@cvs.openbsd.org 2013/12/15 18:17:26 + [ssh-add.c] + Make ssh-add also add .ssh/id_ed25519; fixes lie in manual page. + ok markus@ + - djm@cvs.openbsd.org 2013/12/15 21:42:35 + [cipher-chachapoly.c] + add some comments and constify a constant + - markus@cvs.openbsd.org 2013/12/17 10:36:38 + [crypto_api.h] + I've assempled the header file by cut&pasting from generated headers + and the source files. + +20131208 + - (djm) [openbsd-compat/bsd-setres_id.c] Missing header; from Corinna + Vinschen + - (djm) [Makefile.in regress/Makefile regress/agent-ptrace.sh] + [regress/setuid-allowed.c] Check that ssh-agent is not on a no-setuid + filesystem before running agent-ptrace.sh; ok dtucker + +20131207 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/12/05 22:59:45 + [sftp-client.c] + fix memory leak in error path in do_readdir(); pointed out by + Loganaden Velvindron @ AfriNIC in bz#2163 + - djm@cvs.openbsd.org 2013/12/06 03:40:51 + [ssh-keygen.c] + remove duplicated character ('g') in getopt() string; + document the (few) remaining option characters so we don't have to + rummage next time. + - markus@cvs.openbsd.org 2013/12/06 13:30:08 + [authfd.c key.c key.h ssh-agent.c] + move private key (de)serialization to key.c; ok djm + - markus@cvs.openbsd.org 2013/12/06 13:34:54 + [authfile.c authfile.h cipher.c cipher.h key.c packet.c ssh-agent.c] + [ssh-keygen.c PROTOCOL.key] new private key format, bcrypt as KDF by + default; details in PROTOCOL.key; feedback and lots help from djm; + ok djm@ + - markus@cvs.openbsd.org 2013/12/06 13:39:49 + [authfd.c authfile.c key.c key.h myproposal.h pathnames.h readconf.c] + [servconf.c ssh-agent.c ssh-keygen.c ssh-keyscan.1 ssh-keyscan.c] + [ssh-keysign.c ssh.c ssh_config.5 sshd.8 sshd.c verify.c ssh-ed25519.c] + [sc25519.h sc25519.c hash.c ge25519_base.data ge25519.h ge25519.c] + [fe25519.h fe25519.c ed25519.c crypto_api.h blocks.c] + support ed25519 keys (hostkeys and user identities) using the public + domain ed25519 reference code from SUPERCOP, see + http://ed25519.cr.yp.to/software.html + feedback, help & ok djm@ + - jmc@cvs.openbsd.org 2013/12/06 15:29:07 + [sshd.8] + missing comma; + - djm@cvs.openbsd.org 2013/12/07 00:19:15 + [key.c] + set k->cert = NULL after freeing it + - markus@cvs.openbsd.org 2013/12/06 13:52:46 + [regress/Makefile regress/agent.sh regress/cert-hostkey.sh] + [regress/cert-userkey.sh regress/keytype.sh] + test ed25519 support; from djm@ + - (djm) [blocks.c ed25519.c fe25519.c fe25519.h ge25519.c ge25519.h] + [ge25519_base.data hash.c sc25519.c sc25519.h verify.c] Fix RCS idents + - (djm) [Makefile.in] Add ed25519 sources + - (djm) [authfile.c] Conditionalise inclusion of util.h + - (djm) [configure.ac openbsd-compat/Makefile.in openbsd-compat/bcrypt_pbkdf.c] + [openbsd-compat/blf.h openbsd-compat/blowfish.c] + [openbsd-compat/openbsd-compat.h] Start at supporting bcrypt_pbkdf in + portable. + - (djm) [ed25519.c ssh-ed25519.c openbsd-compat/Makefile.in] + [openbsd-compat/bcrypt_pbkdf.c] Make ed25519/new key format compile on + Linux + - (djm) [regress/cert-hostkey.sh] Fix merge botch + - (djm) [Makefile.in] PATHSUBS and keygen bits for Ed25519; from + Loganaden Velvindron @ AfriNIC in bz#2179 + +20131205 + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2013/11/21 08:05:09 + [ssh_config.5 sshd_config.5] + no need for .Pp before displays; + - deraadt@cvs.openbsd.org 2013/11/25 18:04:21 + [ssh.1 ssh.c] + improve -Q usage and such. One usage change is that the option is now + case-sensitive + ok dtucker markus djm + - jmc@cvs.openbsd.org 2013/11/26 12:14:54 + [ssh.1 ssh.c] + - put -Q in the right place + - Ar was a poor choice for the arguments to -Q. i've chosen an + admittedly equally poor Cm, at least consistent with the rest + of the docs. also no need for multiple instances + - zap a now redundant Nm + - usage() sync + - deraadt@cvs.openbsd.org 2013/11/26 19:15:09 + [pkcs11.h] + cleanup 1 << 31 idioms. Resurrection of this issue pointed out by + Eitan Adler ok markus for ssh, implies same change in kerberosV + - djm@cvs.openbsd.org 2013/12/01 23:19:05 + [PROTOCOL] + mention curve25519-sha256@libssh.org key exchange algorithm + - djm@cvs.openbsd.org 2013/12/02 02:50:27 + [PROTOCOL.chacha20poly1305] + typo; from Jon Cave + - djm@cvs.openbsd.org 2013/12/02 02:56:17 + [ssh-pkcs11-helper.c] + use-after-free; bz#2175 patch from Loganaden Velvindron @ AfriNIC + - djm@cvs.openbsd.org 2013/12/02 03:09:22 + [key.c] + make key_to_blob() return a NULL blob on failure; part of + bz#2175 from Loganaden Velvindron @ AfriNIC + - djm@cvs.openbsd.org 2013/12/02 03:13:14 + [cipher.c] + correct bzero of chacha20+poly1305 key context. bz#2177 from + Loganaden Velvindron @ AfriNIC + + Also make it a memset for consistency with the rest of cipher.c + - djm@cvs.openbsd.org 2013/12/04 04:20:01 + [sftp-client.c] + bz#2171: don't leak local_fd on error; from Loganaden Velvindron @ + AfriNIC + - djm@cvs.openbsd.org 2013/12/05 01:16:41 + [servconf.c servconf.h] + bz#2161 - fix AuthorizedKeysCommand inside a Match block and + rearrange things so the same error is harder to make next time; + with and ok dtucker@ + - (dtucker) [configure.ac] bz#2173: use pkg-config --libs to include correct + -L location for libedit. Patch from Serge van den Boom. + +20131121 + - (djm) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2013/11/08 11:15:19 + [bufaux.c bufbn.c buffer.c sftp-client.c sftp-common.c sftp-glob.c] + [uidswap.c] Include stdlib.h for free() as per the man page. + - markus@cvs.openbsd.org 2013/11/13 13:48:20 + [ssh-pkcs11.c] + add missing braces found by pedro + - djm@cvs.openbsd.org 2013/11/20 02:19:01 + [sshd.c] + delay closure of in/out fds until after "Bad protocol version + identification..." message, as get_remote_ipaddr/get_remote_port + require them open. + - deraadt@cvs.openbsd.org 2013/11/20 20:53:10 + [scp.c] + unsigned casts for ctype macros where neccessary + ok guenther millert markus + - deraadt@cvs.openbsd.org 2013/11/20 20:54:10 + [canohost.c clientloop.c match.c readconf.c sftp.c] + unsigned casts for ctype macros where neccessary + ok guenther millert markus + - djm@cvs.openbsd.org 2013/11/21 00:45:44 + [Makefile.in PROTOCOL PROTOCOL.chacha20poly1305 authfile.c chacha.c] + [chacha.h cipher-chachapoly.c cipher-chachapoly.h cipher.c cipher.h] + [dh.c myproposal.h packet.c poly1305.c poly1305.h servconf.c ssh.1] + [ssh.c ssh_config.5 sshd_config.5] Add a new protocol 2 transport + cipher "chacha20-poly1305@openssh.com" that combines Daniel + Bernstein's ChaCha20 stream cipher and Poly1305 MAC to build an + authenticated encryption mode. + + Inspired by and similar to Adam Langley's proposal for TLS: + http://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-03 + but differs in layout used for the MAC calculation and the use of a + second ChaCha20 instance to separately encrypt packet lengths. + Details are in the PROTOCOL.chacha20poly1305 file. + + Feedback markus@, naddy@; manpage bits Loganden Velvindron @ AfriNIC + ok markus@ naddy@ + - naddy@cvs.openbsd.org 2013/11/18 05:09:32 + [regress/forward-control.sh] + bump timeout to 10 seconds to allow slow machines (e.g. Alpha PC164) + to successfully run this; ok djm@ + - djm@cvs.openbsd.org 2013/11/21 03:15:46 + [regress/krl.sh] + add some reminders for additional tests that I'd like to implement + - djm@cvs.openbsd.org 2013/11/21 03:16:47 + [regress/modpipe.c] + use unsigned long long instead of u_int64_t here to avoid warnings + on some systems portable OpenSSH is built on. + - djm@cvs.openbsd.org 2013/11/21 03:18:51 + [regress/cipher-speed.sh regress/integrity.sh regress/rekey.sh] + [regress/try-ciphers.sh] + use new "ssh -Q cipher-auth" query to obtain lists of authenticated + encryption ciphers instead of specifying them manually; ensures that + the new chacha20poly1305@openssh.com mode is tested; + + ok markus@ and naddy@ as part of the diff to add + chacha20poly1305@openssh.com + +20131110 + - (dtucker) [regress/keytype.sh] Populate ECDSA key types to be tested by + querying the ones that are compiled in. + +20131109 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2013/11/09 05:41:34 + [regress/test-exec.sh regress/rekey.sh] + Use smaller test data files to speed up tests. Grow test datafiles + where necessary for a specific test. + - (dtucker) [configure.ac kex.c key.c myproposal.h] Test for the presence of + NID_X9_62_prime256v1, NID_secp384r1 and NID_secp521r1 and test that the + latter actually works before using it. Fedora (at least) has NID_secp521r1 + that doesn't work (see https://bugzilla.redhat.com/show_bug.cgi?id=1021897). + - (dtucker) [configure.ac] Fix brackets in NID_secp521r1 test. + - (dtucker) [configure.ac] Add missing "test". + - (dtucker) [key.c] Check for the correct defines for NID_secp521r1. + +20131108 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2013/11/08 01:06:14 + [regress/rekey.sh] + Rekey less frequently during tests to speed them up + - (djm) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2013/11/07 11:58:27 + [cipher.c cipher.h kex.c kex.h mac.c mac.h servconf.c ssh.c] + Output the effective values of Ciphers, MACs and KexAlgorithms when + the default has not been overridden. ok markus@ - djm@cvs.openbsd.org 2013/11/08 00:39:15 [auth-options.c auth2-chall.c authfd.c channels.c cipher-3des1.c] [clientloop.c gss-genr.c monitor_mm.c packet.c schnorr.c umac.c] [sftp-client.c sftp-glob.c] use calloc for all structure allocations; from markus@ - - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] - [contrib/suse/openssh.spec] update version numbers - djm@cvs.openbsd.org 2013/11/08 01:38:11 [version.h] openssh-6.4 - - (djm) Release 6.4p1 + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Update version numbers following release. + - (dtucker) [openbsd-compat/openbsd-compat.h] Add null implementation of + arc4random_stir for platforms that have arc4random but don't have + arc4random_stir (right now this is only OpenBSD -current). + - (dtucker) [kex.c] Only enable CURVE25519_SHA256 if we actually have + EVP_sha256. + - (dtucker) [myproposal.h] Conditionally enable CURVE25519_SHA256. + - (dtucker) [openbsd-compat/bsd-poll.c] Add headers to prevent compile + warnings. + - (dtucker) [Makefile.in configure.ac] Set MALLOC_OPTIONS per platform + and pass in TEST_ENV. use stderr to get polluted + and the stderr-data test to fail. + - (dtucker) [contrib/cygwin/ssh-host-config] Simplify host key generation: + rather than testing and generating each key, call ssh-keygen -A. + Patch from vinschen at redhat.com. + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2013/11/09 05:41:34 + [regress/test-exec.sh regress/rekey.sh] + Use smaller test data files to speed up tests. Grow test datafiles + where necessary for a specific test. + +20131107 + - (djm) [ssh-pkcs11.c] Bring back "non-constant initialiser" fix (rev 1.5) + that got lost in recent merge. + - (djm) [Makefile.in monitor.c] Missed chunks of curve25519 KEX diff + - (djm) [regress/modpipe.c regress/rekey.sh] Never intended to commit these + - (djm) [configure.ac defines.h] Skip arc4random_stir() calls on platforms + that lack it but have arc4random_uniform() + - (djm) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2013/11/04 11:51:16 + [monitor.c] + fix rekeying for KEX_C25519_SHA256; noted by dtucker@ + RCSID sync only; I thought this was a merge botch and fixed it already + - markus@cvs.openbsd.org 2013/11/06 16:52:11 + [monitor_wrap.c] + fix rekeying for AES-GCM modes; ok deraadt + - djm@cvs.openbsd.org 2013/11/06 23:05:59 + [ssh-pkcs11.c] + from portable: s/true/true_val/ to avoid name collisions on dump platforms + RCSID sync only + - (dtucker) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/10/09 23:44:14 + [regress/Makefile] (ID sync only) + regression test for sftp request white/blacklisting and readonly mode. + - markus@cvs.openbsd.org 2013/11/02 22:39:53 + [regress/kextype.sh] + add curve25519-sha256@libssh.org + - dtucker@cvs.openbsd.org 2013/11/04 12:27:42 + [regress/rekey.sh] + Test rekeying with all KexAlgorithms. + - dtucker@cvs.openbsd.org 2013/11/07 00:12:05 + [regress/rekey.sh] + Test rekeying for every Cipher, MAC and KEX, plus test every KEX with + the GCM ciphers. + - dtucker@cvs.openbsd.org 2013/11/07 01:12:51 + [regress/rekey.sh] + Factor out the data transfer rekey tests + - dtucker@cvs.openbsd.org 2013/11/07 02:48:38 + [regress/integrity.sh regress/cipher-speed.sh regress/try-ciphers.sh] + Use ssh -Q instead of hardcoding lists of ciphers or MACs. + - dtucker@cvs.openbsd.org 2013/11/07 03:55:41 + [regress/kextype.sh] + Use ssh -Q to get kex types instead of a static list. + - dtucker@cvs.openbsd.org 2013/11/07 04:26:56 + [regress/kextype.sh] + trailing space + - (dtucker) [Makefile.in configure.ac] Remove TEST_SSH_SHA256 environment + variable. It's no longer used now that we get the supported MACs from + ssh -Q. -20130913 - - (djm) [channels.c] Fix unaligned access on sparc machines in SOCKS5 code; - ok dtucker@ - - (djm) [channels.c] sigh, typo s/buffet_/buffer_/ - - (djm) Release 6.3p1 +20131104 + - (djm) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2013/11/02 20:03:54 + [ssh-pkcs11.c] + support pkcs#11 tokes that only provide x509 zerts instead of raw pubkeys; + fixes bz#1908; based on patch from Laurent Barbe; ok djm + - markus@cvs.openbsd.org 2013/11/02 21:59:15 + [kex.c kex.h myproposal.h ssh-keyscan.c sshconnect2.c sshd.c] + use curve25519 for default key exchange (curve25519-sha256@libssh.org); + initial patch from Aris Adamantiadis; ok djm@ + - markus@cvs.openbsd.org 2013/11/02 22:10:15 + [kexdhs.c kexecdhs.c] + no need to include monitor_wrap.h + - markus@cvs.openbsd.org 2013/11/02 22:24:24 + [kexdhs.c kexecdhs.c] + no need to include ssh-gss.h + - markus@cvs.openbsd.org 2013/11/02 22:34:01 + [auth-options.c] + no need to include monitor_wrap.h and ssh-gss.h + - markus@cvs.openbsd.org 2013/11/02 22:39:19 + [ssh_config.5 sshd_config.5] + the default kex is now curve25519-sha256@libssh.org + - djm@cvs.openbsd.org 2013/11/03 10:37:19 + [roaming_common.c] + fix a couple of function definitions foo() -> foo(void) + (-Wold-style-definition) + - (djm) [kexc25519.c kexc25519c.c kexc25519s.c] Import missed files from + KEX/curve25519 change + +20131103 + - (dtucker) [openbsd-compat/bsd-misc.c] Include time.h for nanosleep. + From OpenSMTPD where it prevents "implicit declaration" warnings (it's + a no-op in OpenSSH). From chl at openbsd. + - (dtucker) [openbsd-compat/setproctitle.c] Handle error case form the 2nd + vsnprintf. From eric at openbsd via chl@. + - (dtucker) [configure.ac defines.h] Add typedefs for intmax_t and uintmax_t + for platforms that don't have them. + +20131030 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/10/29 09:42:11 + [key.c key.h] + fix potential stack exhaustion caused by nested certificates; + report by Mateusz Kocielski; ok dtucker@ markus@ + - djm@cvs.openbsd.org 2013/10/29 09:48:02 + [servconf.c servconf.h session.c sshd_config sshd_config.5] + shd_config PermitTTY to disallow TTY allocation, mirroring the + longstanding no-pty authorized_keys option; + bz#2070, patch from Teran McKinney; ok markus@ + - jmc@cvs.openbsd.org 2013/10/29 18:49:32 + [sshd_config.5] + pty(4), not pty(7); + +20131026 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/10/25 23:04:51 + [ssh.c] + fix crash when using ProxyCommand caused by previous commit - was calling + freeaddrinfo(NULL); spotted by sthen@ and Tim Ruehsen, patch by sthen@ + +20131025 + - (djm) [ssh-keygen.c ssh-keysign.c sshconnect1.c sshd.c] Remove + unnecessary arc4random_stir() calls. The only ones left are to ensure + that the PRNG gets a different state after fork() for platforms that + have broken the API. + +20131024 + - (djm) [auth-krb5.c] bz#2032 - use local username in krb5_kuserok check + rather than full client name which may be of form user@REALM; + patch from Miguel Sanders; ok dtucker@ + - (djm) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2013/10/23 05:40:58 + [servconf.c] + fix comment + - djm@cvs.openbsd.org 2013/10/23 23:35:32 + [sshd.c] + include local address and port in "Connection from ..." message (only + shown at loglevel>=verbose) + - dtucker@cvs.openbsd.org 2013/10/24 00:49:49 + [moduli.c] + Periodically print progress and, if possible, expected time to completion + when screening moduli for DH groups. ok deraadt djm + - dtucker@cvs.openbsd.org 2013/10/24 00:51:48 + [readconf.c servconf.c ssh_config.5 sshd_config.5] + Disallow empty Match statements and add "Match all" which matches + everything. ok djm, man page help jmc@ + - djm@cvs.openbsd.org 2013/10/24 08:19:36 + [ssh.c] + fix bug introduced in hostname canonicalisation commit: don't try to + resolve hostnames when a ProxyCommand is set unless the user has forced + canonicalisation; spotted by Iain Morgan + - (tim) [regress/sftp-perm.sh] We need a shell that understands "! somecmd" + +20131023 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/10/20 04:39:28 + [ssh_config.5] + document % expansions performed by "Match command ..." + - djm@cvs.openbsd.org 2013/10/20 06:19:28 + [readconf.c ssh_config.5] + rename "command" subclause of the recently-added "Match" keyword to + "exec"; it's shorter, clearer in intent and we might want to add the + ability to match against the command being executed at the remote end in + the future. + - djm@cvs.openbsd.org 2013/10/20 09:51:26 + [scp.1 sftp.1] + add canonicalisation options to -o lists + - jmc@cvs.openbsd.org 2013/10/20 18:00:13 + [ssh_config.5] + tweak the "exec" description, as worded by djm; + - djm@cvs.openbsd.org 2013/10/23 03:03:07 + [readconf.c] + Hostname may have %h sequences that should be expanded prior to Match + evaluation; spotted by Iain Morgan + - djm@cvs.openbsd.org 2013/10/23 03:05:19 + [readconf.c ssh.c] + comment + - djm@cvs.openbsd.org 2013/10/23 04:16:22 + [ssh-keygen.c] + Make code match documentation: relative-specified certificate expiry time + should be relative to current time and not the validity start time. + Reported by Petr Lautrbach; ok deraadt@ + +20131018 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/10/09 23:44:14 + [regress/Makefile regress/sftp-perm.sh] + regression test for sftp request white/blacklisting and readonly mode. + - jmc@cvs.openbsd.org 2013/10/17 07:35:48 + [sftp.1 sftp.c] + tweak previous; + - djm@cvs.openbsd.org 2013/10/17 22:08:04 + [sshd.c] + include remote port in bad banner message; bz#2162 + +20131017 + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2013/10/15 14:10:25 + [ssh.1 ssh_config.5] + tweak previous; + - djm@cvs.openbsd.org 2013/10/16 02:31:47 + [readconf.c readconf.h roaming_client.c ssh.1 ssh.c ssh_config.5] + [sshconnect.c sshconnect.h] + Implement client-side hostname canonicalisation to allow an explicit + search path of domain suffixes to use to convert unqualified host names + to fully-qualified ones for host key matching. + This is particularly useful for host certificates, which would otherwise + need to list unqualified names alongside fully-qualified ones (and this + causes a number of problems). + "looks fine" markus@ + - jmc@cvs.openbsd.org 2013/10/16 06:42:25 + [ssh_config.5] + tweak previous; + - djm@cvs.openbsd.org 2013/10/16 22:49:39 + [readconf.c readconf.h ssh.1 ssh.c ssh_config.5] + s/canonicalise/canonicalize/ for consistency with existing spelling, + e.g. authorized_keys; pointed out by naddy@ + - djm@cvs.openbsd.org 2013/10/16 22:58:01 + [ssh.c ssh_config.5] + one I missed in previous: s/isation/ization/ + - djm@cvs.openbsd.org 2013/10/17 00:30:13 + [PROTOCOL sftp-client.c sftp-client.h sftp-server.c sftp.1 sftp.c] + fsync@openssh.com protocol extension for sftp-server + client support to allow calling fsync() faster successful transfer + patch mostly by imorgan AT nas.nasa.gov; bz#1798 + "fine" markus@ "grumble OK" deraadt@ "doesn't sound bad to me" millert@ + - djm@cvs.openbsd.org 2013/10/17 00:46:49 + [ssh.c] + rearrange check to reduce diff against -portable + (Id sync only) + +20131015 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/10/09 23:42:17 + [sftp-server.8 sftp-server.c] + Add ability to whitelist and/or blacklist sftp protocol requests by name. + Refactor dispatch loop and consolidate read-only mode checks. + Make global variables static, since sftp-server is linked into sshd(8). + ok dtucker@ + - djm@cvs.openbsd.org 2013/10/10 00:53:25 + [sftp-server.c] + add -Q, -P and -p to usage() before jmc@ catches me + - djm@cvs.openbsd.org 2013/10/10 01:43:03 + [sshd.c] + bz#2139: fix re-exec fallback by ensuring that startup_pipe is correctly + updated; ok dtucker@ + - djm@cvs.openbsd.org 2013/10/11 02:45:36 + [sftp-client.c] + rename flag arguments to be more clear and consistent. + reorder some internal function arguments to make adding additional flags + easier. + no functional change + - djm@cvs.openbsd.org 2013/10/11 02:52:23 + [sftp-client.c] + missed one arg reorder + - djm@cvs.openbsd.org 2013/10/11 02:53:45 + [sftp-client.h] + obsolete comment + - jmc@cvs.openbsd.org 2013/10/14 14:18:56 + [sftp-server.8 sftp-server.c] + tweak previous; + ok djm + - djm@cvs.openbsd.org 2013/10/14 21:20:52 + [session.c session.h] + Add logging of session starts in a useful format; ok markus@ feedback and + ok dtucker@ + - djm@cvs.openbsd.org 2013/10/14 22:22:05 + [readconf.c readconf.h ssh-keysign.c ssh.c ssh_config.5] + add a "Match" keyword to ssh_config that allows matching on hostname, + user and result of arbitrary commands. "nice work" markus@ + - djm@cvs.openbsd.org 2013/10/14 23:28:23 + [canohost.c misc.c misc.h readconf.c sftp-server.c ssh.c] + refactor client config code a little: + add multistate option partsing to readconf.c, similar to servconf.c's + existing code. + move checking of options that accept "none" as an argument to readconf.c + add a lowercase() function and use it instead of explicit tolower() in + loops + part of a larger diff that was ok markus@ + - djm@cvs.openbsd.org 2013/10/14 23:31:01 + [ssh.c] + whitespace at EOL; pointed out by markus@ + - [ssh.c] g/c unused variable. + +20131010 + - (dtucker) OpenBSD CVS Sync + - sthen@cvs.openbsd.org 2013/09/16 11:35:43 + [ssh_config] + Remove gssapi config parts from ssh_config, as was already done for + sshd_config. Req by/ok ajacoutot@ + ID SYNC ONLY for portable; kerberos/gssapi is still pretty popular + - djm@cvs.openbsd.org 2013/09/19 00:24:52 + [progressmeter.c] + store the initial file offset so the progress meter doesn't freak out + when resuming sftp transfers. bz#2137; patch from Iain Morgan; ok dtucker@` + - djm@cvs.openbsd.org 2013/09/19 00:49:12 + [sftp-client.c] + fix swapped pflag and printflag in sftp upload_dir; from Iain Morgan + - djm@cvs.openbsd.org 2013/09/19 01:24:46 + [channels.c] + bz#1297 - tell the client (via packet_send_debug) when their preferred + listen address has been overridden by the server's GatewayPorts; + ok dtucker@ + - djm@cvs.openbsd.org 2013/09/19 01:26:29 + [sshconnect.c] + bz#1211: make BindAddress work with UsePrivilegedPort=yes; patch from + swp AT swp.pp.ru; ok dtucker@ + - dtucker@cvs.openbsd.org 2013/10/08 11:42:13 + [dh.c dh.h] + Increase the size of the Diffie-Hellman groups requested for a each + symmetric key size. New values from NIST Special Publication 800-57 with + the upper limit specified by RFC4419. Pointed out by Peter Backes, ok + djm@. + +20131009 + - (djm) [openbsd-compat/arc4random.c openbsd-compat/chacha_private.h] Pull + in OpenBSD implementation of arc4random, shortly to replace the existing + bsd-arc4random.c + - (djm) [openbsd-compat/Makefile.in openbsd-compat/arc4random.c] + [openbsd-compat/bsd-arc4random.c] Replace old RC4-based arc4random + implementation with recent OpenBSD's ChaCha-based PRNG. ok dtucker@, + tested tim@ + +20130922 + - (dtucker) [platform.c platform.h sshd.c] bz#2156: restore Linux oom_adj + setting when handling SIGHUP to maintain behaviour over retart. Patch + from Matthew Ife. + +20130918 + - (dtucker) [sshd_config] Trailing whitespace; from jstjohn at purdue edu. + +20130914 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/08/22 19:02:21 + [sshd.c] + Stir PRNG after post-accept fork. The child gets a different PRNG state + anyway via rexec and explicit privsep reseeds, but it's good to be sure. + ok markus@ + - mikeb@cvs.openbsd.org 2013/08/28 12:34:27 + [ssh-keygen.c] + improve batch processing a bit by making use of the quite flag a bit + more often and exit with a non zero code if asked to find a hostname + in a known_hosts file and it wasn't there; + originally from reyk@, ok djm + - djm@cvs.openbsd.org 2013/08/31 00:13:54 + [sftp.c] + make ^w match ksh behaviour (delete previous word instead of entire line) + - deraadt@cvs.openbsd.org 2013/09/02 22:00:34 + [ssh-keygen.c sshconnect1.c sshd.c] + All the instances of arc4random_stir() are bogus, since arc4random() + does this itself, inside itself, and has for a very long time.. Actually, + this was probably reducing the entropy available. + ok djm + ID SYNC ONLY for portable; we don't trust other arc4random implementations + to do this right. + - sthen@cvs.openbsd.org 2013/09/07 13:53:11 + [sshd_config] + Remove commented-out kerberos/gssapi config options from sample config, + kerberos support is currently not enabled in ssh in OpenBSD. Discussed with + various people; ok deraadt@ + ID SYNC ONLY for portable; kerberos/gssapi is still pretty popular + - djm@cvs.openbsd.org 2013/09/12 01:41:12 + [clientloop.c] + fix connection crash when sending break (~B) on ControlPersist'd session; + ok dtucker@ + - djm@cvs.openbsd.org 2013/09/13 06:54:34 + [channels.c] + avoid unaligned access in code that reused a buffer to send a + struct in_addr in a reply; simpler just use use buffer_put_int(); + from portable; spotted by and ok dtucker@ + +20130828 + - (djm) [openbsd-compat/bsd-snprintf.c] teach our local snprintf code the + 'j' (intmax_t/uintmax_t) and 'z' (size_t/ssize_t) conversions in case we + start to use them in the future. + - (djm) [openbsd-compat/bsd-snprintf.c] #ifdef noytet for intmax_t bits + until we have configure support. + +20130821 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/08/06 23:03:49 + [sftp.c] + fix some whitespace at EOL + make list of commands an enum rather than a long list of defines + add -a to usage() + - djm@cvs.openbsd.org 2013/08/06 23:05:01 + [sftp.1] *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu Feb 27 17:32:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8C60F6D3; Thu, 27 Feb 2014 17:32: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 789E5109F; Thu, 27 Feb 2014 17:32: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 s1RHW014078818; Thu, 27 Feb 2014 17:32:00 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RHW0b5078817; Thu, 27 Feb 2014 17:32:00 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201402271732.s1RHW0b5078817@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 27 Feb 2014 17:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262567 - stable/10/usr.sbin/pwd_mkdb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 17:32:00 -0000 Author: des Date: Thu Feb 27 17:31:59 2014 New Revision: 262567 URL: http://svnweb.freebsd.org/changeset/base/262567 Log: MFH (r261511, r261542): add an example to the man page Modified: stable/10/usr.sbin/pwd_mkdb/pwd_mkdb.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pwd_mkdb/pwd_mkdb.8 ============================================================================== --- stable/10/usr.sbin/pwd_mkdb/pwd_mkdb.8 Thu Feb 27 17:29:02 2014 (r262566) +++ stable/10/usr.sbin/pwd_mkdb/pwd_mkdb.8 Thu Feb 27 17:31:59 2014 (r262567) @@ -28,7 +28,7 @@ .\" @(#)pwd_mkdb.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 28, 2005 +.Dd February 5, 2014 .Dt PWD_MKDB 8 .Os .Sh NAME @@ -143,6 +143,12 @@ The current password file. .It Pa /etc/passwd A Version 7 format password file. .El +.Sh EXAMPLES +Regenerate the password database after manually editing or replacing +the password file: +.Bd -literal -offset -indent +/usr/sbin/pwd_mkdb -p /etc/master.passwd +.Ed .Sh COMPATIBILITY Previous versions of the system had a program similar to .Nm , From owner-svn-src-stable-10@FreeBSD.ORG Thu Feb 27 22:34:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1D6B9720; Thu, 27 Feb 2014 22:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 095701D6F; Thu, 27 Feb 2014 22:34: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 s1RMY9m6016918; Thu, 27 Feb 2014 22:34:09 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RMY9u5016917; Thu, 27 Feb 2014 22:34:09 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201402272234.s1RMY9u5016917@svn.freebsd.org> From: Hiren Panchasara Date: Thu, 27 Feb 2014 22:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262578 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 22:34:10 -0000 Author: hiren Date: Thu Feb 27 22:34:09 2014 New Revision: 262578 URL: http://svnweb.freebsd.org/changeset/base/262578 Log: MFC r257472 Rate limit (to once per minute) "Listen queue overflow" message in sonewconn(). Modified: stable/10/sys/kern/uipc_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_socket.c ============================================================================== --- stable/10/sys/kern/uipc_socket.c Thu Feb 27 21:50:46 2014 (r262577) +++ stable/10/sys/kern/uipc_socket.c Thu Feb 27 22:34:09 2014 (r262578) @@ -486,6 +486,10 @@ SYSCTL_INT(_regression, OID_AUTO, sonewc struct socket * sonewconn(struct socket *head, int connstatus) { + static struct timeval lastover; + static struct timeval overinterval = { 60, 0 }; + static int overcount; + struct socket *so; int over; @@ -497,9 +501,17 @@ sonewconn(struct socket *head, int conns #else if (over) { #endif - log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: " - "%i already in queue awaiting acceptance\n", - __func__, head->so_pcb, head->so_qlen); + overcount++; + + if (ratecheck(&lastover, &overinterval)) { + log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: " + "%i already in queue awaiting acceptance " + "(%d occurrences)\n", + __func__, head->so_pcb, head->so_qlen, overcount); + + overcount = 0; + } + return (NULL); } VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p", From owner-svn-src-stable-10@FreeBSD.ORG Fri Feb 28 00:39:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 57F0A965; Fri, 28 Feb 2014 00:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 28DD418D4; Fri, 28 Feb 2014 00:39: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 s1S0daG1074368; Fri, 28 Feb 2014 00:39:36 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S0dZ0p074365; Fri, 28 Feb 2014 00:39:35 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402280039.s1S0dZ0p074365@svn.freebsd.org> From: Christian Brueffer Date: Fri, 28 Feb 2014 00:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262586 - in stable/10/sys: arm/broadcom/bcm2835 dev/nand powerpc/ofw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 00:39:36 -0000 Author: brueffer Date: Fri Feb 28 00:39:35 2014 New Revision: 262586 URL: http://svnweb.freebsd.org/changeset/base/262586 Log: MFC: r261884 Correct the order of arguments to mtx_init(). PR: 186701 Submitted by: Takanori Sawada Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c stable/10/sys/dev/nand/nandbus.c stable/10/sys/powerpc/ofw/ofw_real.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Fri Feb 28 00:26:57 2014 (r262585) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Fri Feb 28 00:39:35 2014 (r262586) @@ -167,7 +167,7 @@ bcm_mbox_attach(device_t dev) return (ENXIO); } - mtx_init(&sc->lock, "vcio mbox", MTX_DEF, 0); + mtx_init(&sc->lock, "vcio mbox", NULL, MTX_DEF); for (i = 0; i < BCM2835_MBOX_CHANS; i++) { sc->valid[0] = 0; sc->msg[0] = 0; Modified: stable/10/sys/dev/nand/nandbus.c ============================================================================== --- stable/10/sys/dev/nand/nandbus.c Fri Feb 28 00:26:57 2014 (r262585) +++ stable/10/sys/dev/nand/nandbus.c Fri Feb 28 00:39:35 2014 (r262586) @@ -174,7 +174,7 @@ nandbus_attach(device_t dev) nfc = device_get_parent(dev); nfc_sc = device_get_softc(nfc); - mtx_init(&sc->nandbus_mtx, "nandbus lock", MTX_DEF, 0); + mtx_init(&sc->nandbus_mtx, "nandbus lock", NULL, MTX_DEF); cv_init(&sc->nandbus_cv, "nandbus cv"); /* Check each possible CS for existing nand devices */ Modified: stable/10/sys/powerpc/ofw/ofw_real.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_real.c Fri Feb 28 00:26:57 2014 (r262585) +++ stable/10/sys/powerpc/ofw/ofw_real.c Fri Feb 28 00:39:35 2014 (r262586) @@ -300,7 +300,7 @@ ofw_real_init(ofw_t ofw, void *openfirm) { openfirmware = (int (*)(void *))openfirm; - mtx_init(&of_bounce_mtx, "OF Bounce Page", MTX_DEF, 0); + mtx_init(&of_bounce_mtx, "OF Bounce Page", NULL, MTX_DEF); of_bounce_virt = NULL; return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Feb 28 00:43:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0FE37C06; Fri, 28 Feb 2014 00:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EEF131955; Fri, 28 Feb 2014 00:43: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 s1S0hROi077890; Fri, 28 Feb 2014 00:43:27 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S0hRoJ077889; Fri, 28 Feb 2014 00:43:27 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402280043.s1S0hRoJ077889@svn.freebsd.org> From: Christian Brueffer Date: Fri, 28 Feb 2014 00:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262588 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 00:43:28 -0000 Author: brueffer Date: Fri Feb 28 00:43:27 2014 New Revision: 262588 URL: http://svnweb.freebsd.org/changeset/base/262588 Log: MFC: r262296 Match the correct variable to the variable description. PR: 121173 Submitted by: Thomas Mueller Modified: stable/10/lib/libc/sys/mq_getattr.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/mq_getattr.2 ============================================================================== --- stable/10/lib/libc/sys/mq_getattr.2 Fri Feb 28 00:41:55 2014 (r262587) +++ stable/10/lib/libc/sys/mq_getattr.2 Fri Feb 28 00:43:27 2014 (r262588) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2005 +.Dd February 21, 2014 .Dt MQ_GETATTR 2 .Os .Sh NAME @@ -83,8 +83,8 @@ structure referenced by the .Fa mqstat argument will be set to the current state of the message queue: -.Bl -tag -width ".Va mq_flags" -.It Va mq_flags +.Bl -tag -width ".Va mq_curmsgs" +.It Va mq_curmsgs The number of messages currently on the queue. .El .Sh RETURN VALUES From owner-svn-src-stable-10@FreeBSD.ORG Fri Feb 28 16:08:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CCA17F69; Fri, 28 Feb 2014 16:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D18F1A8D; Fri, 28 Feb 2014 16:08: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 s1SG8W0F060853; Fri, 28 Feb 2014 16:08:32 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SG8Wji060851; Fri, 28 Feb 2014 16:08:32 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201402281608.s1SG8Wji060851@svn.freebsd.org> From: Kevin Lo Date: Fri, 28 Feb 2014 16:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262604 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 16:08:32 -0000 Author: kevlo Date: Fri Feb 28 16:08:31 2014 New Revision: 262604 URL: http://svnweb.freebsd.org/changeset/base/262604 Log: MFC r262465: Add a flag to run's device list which uses a standard scsi eject. The flag indicates that the mcu doesn't need to load firmware. Tested by: Alex Deiter , myself Tested on: ASUS USB-N66 Modified: stable/10/sys/dev/usb/wlan/if_run.c stable/10/sys/dev/usb/wlan/if_runvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_run.c Fri Feb 28 15:55:35 2014 (r262603) +++ stable/10/sys/dev/usb/wlan/if_run.c Fri Feb 28 16:08:31 2014 (r262604) @@ -99,7 +99,8 @@ SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, static const STRUCT_USB_HOST_ID run_devs[] = { #define RUN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } #define RUN_DEV_EJECT(v,p) \ - { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, 0) } + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, RUN_EJECT) } +#define RUN_EJECT 1 RUN_DEV(ABOCOM, RT2770), RUN_DEV(ABOCOM, RT2870), RUN_DEV(ABOCOM, RT3070), @@ -314,7 +315,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(ZINWELL, RT3072_2), RUN_DEV(ZYXEL, RT2870_1), RUN_DEV(ZYXEL, RT2870_2), - RUN_DEV(ZYXEL, NWD2705), + RUN_DEV_EJECT(ZYXEL, NWD2705), RUN_DEV_EJECT(RALINK, RT_STOR), #undef RUN_DEV_EJECT #undef RUN_DEV @@ -706,6 +707,8 @@ run_attach(device_t self) device_set_usb_desc(self); sc->sc_udev = uaa->device; sc->sc_dev = self; + if (USB_GET_DRIVER_INFO(uaa) != RUN_EJECT) + sc->sc_flags |= RUN_FLAG_FWLOAD_NEEDED; mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK, MTX_DEF); @@ -1150,7 +1153,7 @@ run_load_microcode(struct run_softc *sc) } /* write microcode image */ - if (sc->mac_ver != 0x3593) { + if (sc->sc_flags & RUN_FLAG_FWLOAD_NEEDED) { run_write_region_1(sc, RT2870_FW_BASE, base, 4096); run_write(sc, RT2860_H2M_MAILBOX_CID, 0xffffffff); run_write(sc, RT2860_H2M_MAILBOX_STATUS, 0xffffffff); Modified: stable/10/sys/dev/usb/wlan/if_runvar.h ============================================================================== --- stable/10/sys/dev/usb/wlan/if_runvar.h Fri Feb 28 15:55:35 2014 (r262603) +++ stable/10/sys/dev/usb/wlan/if_runvar.h Fri Feb 28 16:08:31 2014 (r262604) @@ -154,6 +154,11 @@ struct run_softc { device_t sc_dev; struct usb_device *sc_udev; struct ifnet *sc_ifp; + int sc_need_fwload; + + int sc_flags; +#define RUN_FLAG_FWLOAD_NEEDED 0x01 + uint16_t wcid_stats[RT2870_WCID_MAX + 1][3]; #define RUN_TXCNT 0 #define RUN_SUCCESS 1 From owner-svn-src-stable-10@FreeBSD.ORG Fri Feb 28 20:22:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 ABB05257; Fri, 28 Feb 2014 20:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9734D1435; Fri, 28 Feb 2014 20:22: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 s1SKMnTa067758; Fri, 28 Feb 2014 20:22:49 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SKMnsa067757; Fri, 28 Feb 2014 20:22:49 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402282022.s1SKMnsa067757@svn.freebsd.org> From: Dimitry Andric Date: Fri, 28 Feb 2014 20:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262620 - in stable: 10/sys/sparc64/sparc64 9/sys/sparc64/sparc64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 20:22:49 -0000 Author: dim Date: Fri Feb 28 20:22:48 2014 New Revision: 262620 URL: http://svnweb.freebsd.org/changeset/base/262620 Log: MFC r262471: In sys/sparc64/sparc64/spitfire.c, prevent signed shift overflow by casting to the appropriate type. (Note this fix cannot be done in sys/sparc64/sparc64/spitfire.c, since that file is also included by assembly source files.) Reviewed by: marius Modified: stable/10/sys/sparc64/sparc64/spitfire.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/sparc64/sparc64/spitfire.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/sparc64/sparc64/spitfire.c ============================================================================== --- stable/10/sys/sparc64/sparc64/spitfire.c Fri Feb 28 19:51:47 2014 (r262619) +++ stable/10/sys/sparc64/sparc64/spitfire.c Fri Feb 28 20:22:48 2014 (r262620) @@ -130,7 +130,7 @@ spitfire_icache_page_inval(vm_paddr_t pa : "=r" (tag) : "r" (addr), "n" (ASI_ICACHE_TAG)); if (((tag >> IC_VALID_SHIFT) & IC_VALID_MASK) == 0) continue; - tag &= IC_TAG_MASK << IC_TAG_SHIFT; + tag &= (u_long)IC_TAG_MASK << IC_TAG_SHIFT; if (tag == target) { PMAP_STATS_INC(spitfire_icache_npage_inval_match); stxa_sync(addr, ASI_ICACHE_TAG, tag); From owner-svn-src-stable-10@FreeBSD.ORG Fri Feb 28 20:30:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C52E866A; Fri, 28 Feb 2014 20:30:00 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7FA0B1493; Fri, 28 Feb 2014 20:30:00 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::83f:465:d505:2ec0] (unknown [IPv6:2001:7b8:3a7:0:83f:465:d505:2ec0]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 79D375C45; Fri, 28 Feb 2014 21:29:56 +0100 (CET) From: Dimitry Andric Content-Type: multipart/signed; boundary="Apple-Mail=_0ECEE81A-7255-40FE-9F9E-71F23AFE3ECD"; protocol="application/pgp-signature"; micalg=pgp-sha1 Message-Id: Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r262620 - in stable: 10/sys/sparc64/sparc64 9/sys/sparc64/sparc64 Date: Fri, 28 Feb 2014 21:29:35 +0100 References: <201402282022.s1SKMnsa067757@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org In-Reply-To: <201402282022.s1SKMnsa067757@svn.freebsd.org> X-Mailer: Apple Mail (2.1874) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 20:30:00 -0000 --Apple-Mail=_0ECEE81A-7255-40FE-9F9E-71F23AFE3ECD Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 28 Feb 2014, at 21:22, Dimitry Andric wrote: > Author: dim > Date: Fri Feb 28 20:22:48 2014 > New Revision: 262620 > URL: http://svnweb.freebsd.org/changeset/base/262620 > > Log: > MFC r262471: > > In sys/sparc64/sparc64/spitfire.c, prevent signed shift overflow by > casting to the appropriate type. (Note this fix cannot be done in > sys/sparc64/sparc64/spitfire.c, since that file is also included by > assembly source files.) The second line should actually refer to sys/sparc64/include/cache.h. I pasted the wrong filename, sorry about that! -Dimitry --Apple-Mail=_0ECEE81A-7255-40FE-9F9E-71F23AFE3ECD 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----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlMQ8cAACgkQsF6jCi4glqMg/gCgqAUvRVmZk6ZIMyCjjNpSQyuk JYsAoJqRIs/vy85tjjvQhg6g82LoQOmf =TKC9 -----END PGP SIGNATURE----- --Apple-Mail=_0ECEE81A-7255-40FE-9F9E-71F23AFE3ECD-- From owner-svn-src-stable-10@FreeBSD.ORG Fri Feb 28 20:31:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C1624832; Fri, 28 Feb 2014 20:31:08 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ADF2F14BB; Fri, 28 Feb 2014 20:31:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SKV85b070948; Fri, 28 Feb 2014 20:31:08 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SKV8f1070947; Fri, 28 Feb 2014 20:31:08 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402282031.s1SKV8f1070947@svn.freebsd.org> From: Dimitry Andric Date: Fri, 28 Feb 2014 20:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262621 - in stable: 10/sys/sparc64/pci 9/sys/sparc64/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 20:31:08 -0000 Author: dim Date: Fri Feb 28 20:31:07 2014 New Revision: 262621 URL: http://svnweb.freebsd.org/changeset/base/262621 Log: MFC r262472: Make sure a for loop in fire_alloc_msix() terminates, by making the loop counter signed. Reviewed by: marius Modified: stable/10/sys/sparc64/pci/fire.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/sparc64/pci/fire.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/sparc64/pci/fire.c ============================================================================== --- stable/10/sys/sparc64/pci/fire.c Fri Feb 28 20:22:48 2014 (r262620) +++ stable/10/sys/sparc64/pci/fire.c Fri Feb 28 20:31:07 2014 (r262621) @@ -1691,7 +1691,7 @@ static int fire_alloc_msix(device_t dev, device_t child, int *irq) { struct fire_softc *sc; - u_int i, msiq; + int i, msiq; sc = device_get_softc(dev); if ((sc->sc_flags & FIRE_MSIX) == 0) From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 03:09:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E101C19D; Sat, 1 Mar 2014 03:09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF75317BD; Sat, 1 Mar 2014 03:09: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 s2139IoE030977; Sat, 1 Mar 2014 03:09:18 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2139Gck030962; Sat, 1 Mar 2014 03:09:16 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201403010309.s2139Gck030962@svn.freebsd.org> From: Brooks Davis Date: Sat, 1 Mar 2014 03:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262643 - in stable/10: gnu/usr.bin/dialog lib/ncurses share/mk usr.bin/systat usr.bin/vi usr.sbin/bsdinstall/distextract usr.sbin/bsdinstall/distfetch usr.sbin/bsdinstall/partedit usr.... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 03:09:19 -0000 Author: brooks Date: Sat Mar 1 03:09:16 2014 New Revision: 262643 URL: http://svnweb.freebsd.org/changeset/base/262643 Log: MFC r261296: Merge from CheriBSD: commit c1acf022c533c5ae27e0cd556977eafe3f5959eb Author: Brooks Davis Date: Fri Jan 17 21:46:44 2014 +0000 Add an option WITHOUT_NCURSESW to suppress building and linking to libncursesw. While wide character support it useful we'd like to only need one ncurses library on embedded systems. Sponsored by: DARPA, AFRL Modified: stable/10/gnu/usr.bin/dialog/Makefile stable/10/lib/ncurses/Makefile stable/10/share/mk/bsd.own.mk stable/10/usr.bin/systat/Makefile stable/10/usr.bin/systat/main.c stable/10/usr.bin/vi/Makefile stable/10/usr.sbin/bsdinstall/distextract/Makefile stable/10/usr.sbin/bsdinstall/distfetch/Makefile stable/10/usr.sbin/bsdinstall/partedit/Makefile stable/10/usr.sbin/tzsetup/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/gnu/usr.bin/dialog/Makefile ============================================================================== --- stable/10/gnu/usr.bin/dialog/Makefile Sat Mar 1 02:57:22 2014 (r262642) +++ stable/10/gnu/usr.bin/dialog/Makefile Sat Mar 1 03:09:16 2014 (r262643) @@ -3,11 +3,21 @@ DIALOG= ${.CURDIR}/../../../contrib/dialog PROG= dialog -DPADD= ${LIBDIALOG} ${LIBNCURSESW} ${LIBM} -LDADD= -ldialog -lncursesw -lm +DPADD= ${LIBDIALOG} ${LIBM} +LDADD= -ldialog -lm CFLAGS+= -I${.CURDIR} -I${DIALOG} .PATH: ${DIALOG} WARNS?= 6 +.include + +.if ${MK_NCURSESW} == "no" +DPADD+= ${LIBNCURSES} +LDADD+= -lncurses +.else +DPADD+= ${LIBNCURSESW} +LDADD+= -lncursesw +.endif + .include Modified: stable/10/lib/ncurses/Makefile ============================================================================== --- stable/10/lib/ncurses/Makefile Sat Mar 1 02:57:22 2014 (r262642) +++ stable/10/lib/ncurses/Makefile Sat Mar 1 03:09:16 2014 (r262643) @@ -1,6 +1,11 @@ # $FreeBSD$ -SUBDIR= ncurses form menu panel \ - ncursesw formw menuw panelw +.include + +SUBDIR= ncurses form menu panel + +.if ${MK_NCURSESW} != "no" +SUBDIR+= ncursesw formw menuw panelw +.endif .include Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Sat Mar 1 02:57:22 2014 (r262642) +++ stable/10/share/mk/bsd.own.mk Sat Mar 1 03:09:16 2014 (r262643) @@ -313,6 +313,7 @@ __DEFAULT_YES_OPTIONS = \ MAILWRAPPER \ MAKE \ MAN \ + NCURSESW \ NDIS \ NETCAT \ NETGRAPH \ Modified: stable/10/usr.bin/systat/Makefile ============================================================================== --- stable/10/usr.bin/systat/Makefile Sat Mar 1 02:57:22 2014 (r262642) +++ stable/10/usr.bin/systat/Makefile Sat Mar 1 03:09:16 2014 (r262643) @@ -16,7 +16,16 @@ CFLAGS+= -DINET6 WARNS?= 0 -DPADD= ${LIBNCURSESW} ${LIBM} ${LIBDEVSTAT} ${LIBKVM} -LDADD= -lncursesw -lm -ldevstat -lkvm +DPADD= ${LIBM} ${LIBDEVSTAT} ${LIBKVM} +LDADD= -lm -ldevstat -lkvm + +.if ${MK_NCURSESW} == "no" +DPADD+= ${LIBNCURSES} +LDADD+= -lncurses +.else +CFLAGS+= -DUSE_WIDECHAR +DPADD+= ${LIBNCURSESW} +LDADD+= -lncursesw +.endif .include Modified: stable/10/usr.bin/systat/main.c ============================================================================== --- stable/10/usr.bin/systat/main.c Sat Mar 1 02:57:22 2014 (r262642) +++ stable/10/usr.bin/systat/main.c Sat Mar 1 03:09:16 2014 (r262643) @@ -84,7 +84,11 @@ main(int argc, char **argv) size_t size; double t; +#ifdef USE_WIDECHAR (void) setlocale(LC_ALL, ""); +#else + (void) setlocale(LC_TIME, ""); +#endif argc--, argv++; while (argc > 0) { Modified: stable/10/usr.bin/vi/Makefile ============================================================================== --- stable/10/usr.bin/vi/Makefile Sat Mar 1 02:57:22 2014 (r262642) +++ stable/10/usr.bin/vi/Makefile Sat Mar 1 03:09:16 2014 (r262643) @@ -36,7 +36,7 @@ CFLAGS+=-I${.CURDIR} -I${SRCDIR} -I${SRC DPADD= ${LIBUTIL} LDADD= -lutil -.if defined(RESCUE) || defined(RELEASE_CRUNCH) +.if defined(RESCUE) || defined(RELEASE_CRUNCH) || ${MK_NCURSESW} == "no" DPADD+= ${LIBNCURSES} LDADD+= -lncurses .else Modified: stable/10/usr.sbin/bsdinstall/distextract/Makefile ============================================================================== --- stable/10/usr.sbin/bsdinstall/distextract/Makefile Sat Mar 1 02:57:22 2014 (r262642) +++ stable/10/usr.sbin/bsdinstall/distextract/Makefile Sat Mar 1 03:09:16 2014 (r262643) @@ -2,10 +2,20 @@ BINDIR= /usr/libexec/bsdinstall PROG= distextract -DPADD= ${LIBARCHIVE} ${LIBNCURSESW} ${LIBDIALOG} ${LIBM} -LDADD= -larchive -lncursesw -ldialog -lm +DPADD= ${LIBARCHIVE} ${LIBDIALOG} ${LIBM} +LDADD= -larchive -ldialog -lm WARNS?= 6 NO_MAN= true +.include + +.if ${MK_NCURSESW} == "no" +DPADD+= ${LIBNCURSES} +LDADD+= -lncurses +.else +DPADD+= ${LIBNCURSESW} +LDADD+= -lncursesw +.endif + .include Modified: stable/10/usr.sbin/bsdinstall/distfetch/Makefile ============================================================================== --- stable/10/usr.sbin/bsdinstall/distfetch/Makefile Sat Mar 1 02:57:22 2014 (r262642) +++ stable/10/usr.sbin/bsdinstall/distfetch/Makefile Sat Mar 1 03:09:16 2014 (r262643) @@ -2,10 +2,20 @@ BINDIR= /usr/libexec/bsdinstall PROG= distfetch -DPADD= ${LIBFETCH} ${LIBNCURSESW} ${LIBDIALOG} ${LIBM} -LDADD= -lfetch -lncursesw -ldialog -lm +DPADD= ${LIBFETCH} ${LIBDIALOG} ${LIBM} +LDADD= -lfetch -ldialog -lm WARNS?= 6 NO_MAN= true +.include + +.if ${MK_NCURSESW} == "no" +DPADD+= ${LIBNCURSES} +LDADD+= -lncurses +.else +DPADD+= ${LIBNCURSESW} +LDADD+= -lncursesw +.endif + .include Modified: stable/10/usr.sbin/bsdinstall/partedit/Makefile ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/Makefile Sat Mar 1 02:57:22 2014 (r262642) +++ stable/10/usr.sbin/bsdinstall/partedit/Makefile Sat Mar 1 03:09:16 2014 (r262643) @@ -5,8 +5,8 @@ PROG= partedit LINKS= ${BINDIR}/partedit ${BINDIR}/autopart \ ${BINDIR}/partedit ${BINDIR}/scriptedpart SYMLINKS= ${BINDIR}/partedit /usr/sbin/sade -DPADD= ${LIBGEOM} ${LIBNCURSESW} ${LIBUTIL} ${LIBDIALOG} ${LIBM} -LDADD= -lgeom -lncursesw -lutil -ldialog -lm +DPADD= ${LIBGEOM} ${LIBUTIL} ${LIBDIALOG} ${LIBM} +LDADD= -lgeom -lutil -ldialog -lm PARTEDIT_ARCH= ${MACHINE} .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" @@ -22,4 +22,14 @@ SRCS= diskeditor.c partedit.c gpart_ops. WARNS?= 3 MAN= sade.8 +.include + +.if ${MK_NCURSESW} == "no" +DPADD+= ${LIBNCURSES} +LDADD+= -lncurses +.else +DPADD+= ${LIBNCURSESW} +LDADD+= -lncursesw +.endif + .include Modified: stable/10/usr.sbin/tzsetup/Makefile ============================================================================== --- stable/10/usr.sbin/tzsetup/Makefile Sat Mar 1 02:57:22 2014 (r262642) +++ stable/10/usr.sbin/tzsetup/Makefile Sat Mar 1 03:09:16 2014 (r262643) @@ -7,7 +7,17 @@ CFLAGS+= -I${.CURDIR}/../../contrib/dial WARNS?= 3 -DPADD= ${LIBDIALOG} ${LIBNCURSESW} ${LIBM} -LDADD= -ldialog -lncursesw -lm +DPADD= ${LIBDIALOG} ${LIBM} +LDADD= -ldialog -lm + +.include + +.if ${MK_NCURSESW} == "no" +DPADD+= ${LIBNCURSES} +LDADD+= -lncurses +.else +DPADD+= ${LIBNCURSESW} +LDADD+= -lncursesw +.endif .include From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 03:11:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C3EA64AF; Sat, 1 Mar 2014 03:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AFB901854; Sat, 1 Mar 2014 03:11: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 s213BQHX033440; Sat, 1 Mar 2014 03:11:26 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s213BQQF033439; Sat, 1 Mar 2014 03:11:26 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201403010311.s213BQQF033439@svn.freebsd.org> From: Brooks Davis Date: Sat, 1 Mar 2014 03:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262644 - stable/10/tools/build/options X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 03:11:26 -0000 Author: brooks Date: Sat Mar 1 03:11:26 2014 New Revision: 262644 URL: http://svnweb.freebsd.org/changeset/base/262644 Log: MFC r261300: Add a missing options file. Sponsored by: DARPA, AFRL Added: stable/10/tools/build/options/WITHOUT_NCURSESW - copied unchanged from r261300, head/tools/build/options/WITHOUT_NCURSESW Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/tools/build/options/WITHOUT_NCURSESW (from r261300, head/tools/build/options/WITHOUT_NCURSESW) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_NCURSESW Sat Mar 1 03:11:26 2014 (r262644, copy of r261300, head/tools/build/options/WITHOUT_NCURSESW) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build or depend on the +.Nm libncursesw +library. From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 03:39:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7EF4EEBC; Sat, 1 Mar 2014 03:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6741D1A38; Sat, 1 Mar 2014 03:39: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 s213dv4U042968; Sat, 1 Mar 2014 03:39:57 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s213dum7042965; Sat, 1 Mar 2014 03:39:56 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201403010339.s213dum7042965@svn.freebsd.org> From: Brooks Davis Date: Sat, 1 Mar 2014 03:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262648 - in stable/10/usr.sbin: mtree nmtree X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 03:39:57 -0000 Author: brooks Date: Sat Mar 1 03:39:56 2014 New Revision: 262648 URL: http://svnweb.freebsd.org/changeset/base/262648 Log: MFC: 261298 Merge from CheriBSD: commit 70b8f0c127db6b80411789d237b403cc64a93573 Author: Brooks Davis Date: Mon Jan 27 22:53:57 2014 +0000 Move mtree.5 to usr.sbin/nmtree. Remove note that mtree 2.0 format files aren't supported. Sponsored by: DARPA, AFRL Added: stable/10/usr.sbin/nmtree/mtree.5 - copied unchanged from r261298, head/usr.sbin/nmtree/mtree.5 Deleted: stable/10/usr.sbin/mtree/mtree.5 Modified: stable/10/usr.sbin/mtree/Makefile stable/10/usr.sbin/nmtree/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mtree/Makefile ============================================================================== --- stable/10/usr.sbin/mtree/Makefile Sat Mar 1 03:36:46 2014 (r262647) +++ stable/10/usr.sbin/mtree/Makefile Sat Mar 1 03:39:56 2014 (r262648) @@ -6,7 +6,7 @@ .PATH: ${.CURDIR}/../../usr.bin/cksum PROG= fmtree -MAN= fmtree.8 mtree.5 +MAN= fmtree.8 SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c verify.c SRCS+= specspec.c Modified: stable/10/usr.sbin/nmtree/Makefile ============================================================================== --- stable/10/usr.sbin/nmtree/Makefile Sat Mar 1 03:36:46 2014 (r262647) +++ stable/10/usr.sbin/nmtree/Makefile Sat Mar 1 03:39:56 2014 (r262648) @@ -4,8 +4,8 @@ .PATH: ${.CURDIR}/../../contrib/mtree -PROG= nmtree -MAN= nmtree.8 +PROG= mtree +MAN= mtree.5 mtree.8 SRCS= compare.c crc.c create.c excludes.c getid.c misc.c mtree.c \ only.c spec.c specspec.c verify.c LDADD+= -lmd -lutil Copied: stable/10/usr.sbin/nmtree/mtree.5 (from r261298, head/usr.sbin/nmtree/mtree.5) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/nmtree/mtree.5 Sat Mar 1 03:39:56 2014 (r262648, copy of r261298, head/usr.sbin/nmtree/mtree.5) @@ -0,0 +1,264 @@ +.\" Copyright (c) 1989, 1990, 1993 +.\" The Regents of the University of California. 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. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From: @(#)mtree.8 8.2 (Berkeley) 12/11/93 +.\" $FreeBSD$ +.\" +.Dd December 31, 2007 +.Dt MTREE 5 +.Os +.Sh NAME +.Nm mtree +.Nd format of mtree dir hierarchy files +.Sh DESCRIPTION +The +.Nm +format is a textual format that describes a collection of filesystem objects. +Such files are typically used to create or verify directory hierarchies. +.Ss General Format +An +.Nm +file consists of a series of lines, each providing information +about a single filesystem object. +Leading whitespace is always ignored. +.Pp +When encoding file or pathnames, any backslash character or +character outside of the 95 printable ASCII characters must be +encoded as a backslash followed by three +octal digits. +When reading mtree files, any appearance of a backslash +followed by three octal digits should be converted into the +corresponding character. +.Pp +Each line is interpreted independently as one of the following types: +.Bl -tag -width Cm +.It Signature +The first line of any mtree file must begin with +.Dq #mtree . +If a file contains any full path entries, the first line should +begin with +.Dq #mtree v2.0 , +otherwise, the first line should begin with +.Dq #mtree v1.0 . +.It Blank +Blank lines are ignored. +.It Comment +Lines beginning with +.Cm # +are ignored. +.It Special +Lines beginning with +.Cm / +are special commands that influence +the interpretation of later lines. +.It Relative +If the first whitespace-delimited word has no +.Cm / +characters, +it is the name of a file in the current directory. +Any relative entry that describes a directory changes the +current directory. +.It dot-dot +As a special case, a relative entry with the filename +.Pa .. +changes the current directory to the parent directory. +Options on dot-dot entries are always ignored. +.It Full +If the first whitespace-delimited word has a +.Cm / +character after +the first character, it is the pathname of a file relative to the +starting directory. +There can be multiple full entries describing the same file. +.El +.Pp +Some tools that process +.Nm +files may require that multiple lines describing the same file +occur consecutively. +It is not permitted for the same file to be mentioned using +both a relative and a full file specification. +.Ss Special commands +Two special commands are currently defined: +.Bl -tag -width Cm +.It Cm /set +This command defines default values for one or more keywords. +It is followed on the same line by one or more whitespace-separated +keyword definitions. +These definitions apply to all following files that do not specify +a value for that keyword. +.It Cm /unset +This command removes any default value set by a previous +.Cm /set +command. +It is followed on the same line by one or more keywords +separated by whitespace. +.El +.Ss Keywords +After the filename, a full or relative entry consists of zero +or more whitespace-separated keyword definitions. +Each such definitions consists of a key from the following +list immediately followed by an '=' sign +and a value. +Software programs reading mtree files should warn about +unrecognized keywords. +.Pp +Currently supported keywords are as follows: +.Bl -tag -width Cm +.It Cm cksum +The checksum of the file using the default algorithm specified by +the +.Xr cksum 1 +utility. +.It Cm contents +The full pathname of a file whose contents should be +compared to the contents of this file. +.It Cm flags +The file flags as a symbolic name. +See +.Xr chflags 1 +for information on these names. +If no flags are to be set the string +.Dq none +may be used to override the current default. +.It Cm ignore +Ignore any file hierarchy below this file. +.It Cm gid +The file group as a numeric value. +.It Cm gname +The file group as a symbolic name. +.It Cm md5 +The MD5 message digest of the file. +.It Cm md5digest +A synonym for +.Cm md5 . +.It Cm sha1 +The +.Tn FIPS +160-1 +.Pq Dq Tn SHA-1 +message digest of the file. +.It Cm sha1digest +A synonym for +.Cm sha1 . +.It Cm sha256 +The +.Tn FIPS +180-2 +.Pq Dq Tn SHA-256 +message digest of the file. +.It Cm sha256digest +A synonym for +.Cm sha256 . +.It Cm ripemd160digest +The +.Tn RIPEMD160 +message digest of the file. +.It Cm rmd160 +A synonym for +.Cm ripemd160digest . +.It Cm rmd160digest +A synonym for +.Cm ripemd160digest . +.It Cm mode +The current file's permissions as a numeric (octal) or symbolic +value. +.It Cm nlink +The number of hard links the file is expected to have. +.It Cm nochange +Make sure this file or directory exists but otherwise ignore all attributes. +.It Cm uid +The file owner as a numeric value. +.It Cm uname +The file owner as a symbolic name. +.It Cm size +The size, in bytes, of the file. +.It Cm link +The file the symbolic link is expected to reference. +.It Cm time +The last modification time of the file, in seconds and nanoseconds. +The value should include a period character and exactly nine digits +after the period. +.It Cm type +The type of the file; may be set to any one of the following: +.Pp +.Bl -tag -width Cm -compact +.It Cm block +block special device +.It Cm char +character special device +.It Cm dir +directory +.It Cm fifo +fifo +.It Cm file +regular file +.It Cm link +symbolic link +.It Cm socket +socket +.El +.El +.Sh SEE ALSO +.Xr cksum 1 , +.Xr find 1 , +.Xr mtree 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Bx 4.3 Reno . +The +.Tn MD5 +digest capability was added in +.Fx 2.1 , +in response to the widespread use of programs which can spoof +.Xr cksum 1 . +The +.Tn SHA-1 +and +.Tn RIPEMD160 +digests were added in +.Fx 4.0 , +as new attacks have demonstrated weaknesses in +.Tn MD5 . +The +.Tn SHA-256 +digest was added in +.Fx 6.0 . +Support for file flags was added in +.Fx 4.0 , +and mostly comes from +.Nx . +The +.Dq full +entry format was added by +.Nx . +.Sh BUGS +The requirement for a +.Dq #mtree +signature line is new and not yet widely implemented. From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 04:16:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 82021BF8; Sat, 1 Mar 2014 04:16:58 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B22111C5; Sat, 1 Mar 2014 04:16:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s214GwAb058600; Sat, 1 Mar 2014 04:16:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s214GsTq058579; Sat, 1 Mar 2014 04:16:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403010416.s214GsTq058579@svn.freebsd.org> From: Warner Losh Date: Sat, 1 Mar 2014 04:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262649 - in stable/10/sys: arm/s3c2xx0 arm/sa11x0 arm/xilinx dev/uart mips/adm5120 mips/atheros mips/cavium mips/rt305x X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 04:16:58 -0000 Author: imp Date: Sat Mar 1 04:16:54 2014 New Revision: 262649 URL: http://svnweb.freebsd.org/changeset/base/262649 Log: MFC: r260889, r260890, r260911: r260911 | imp | 2014-01-20 10:45:36 -0700 (Mon, 20 Jan 2014) | 5 lines Don't lock in the generic grab just to lock again in the specific grabs. r260890 | imp | 2014-01-19 12:39:13 -0700 (Sun, 19 Jan 2014) | 11 lines Introduce grab and ungrab upcalls. When the kernel desires to grab the console, it calls the grab functions. These functions should turn off the RX interrupts, and any others that interfere. This makes mountroot prompt work again. If there's more generalized need other than prompting, many of these routines should be expanded to do those new things. Reviewed by: bde (with reservations) Modified: stable/10/sys/arm/s3c2xx0/uart_dev_s3c2410.c stable/10/sys/arm/sa11x0/uart_dev_sa1110.c stable/10/sys/arm/xilinx/uart_dev_cdnc.c stable/10/sys/dev/uart/uart_core.c stable/10/sys/dev/uart/uart_cpu.h stable/10/sys/dev/uart/uart_dev_imx.c stable/10/sys/dev/uart/uart_dev_lpc.c stable/10/sys/dev/uart/uart_dev_ns8250.c stable/10/sys/dev/uart/uart_dev_ns8250.h stable/10/sys/dev/uart/uart_dev_pl011.c stable/10/sys/dev/uart/uart_dev_quicc.c stable/10/sys/dev/uart/uart_dev_sab82532.c stable/10/sys/dev/uart/uart_dev_z8530.c stable/10/sys/dev/uart/uart_if.m stable/10/sys/mips/adm5120/uart_dev_adm5120.c stable/10/sys/mips/atheros/uart_dev_ar933x.c stable/10/sys/mips/cavium/uart_dev_oct16550.c stable/10/sys/mips/rt305x/uart_dev_rt305x.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/s3c2xx0/uart_dev_s3c2410.c ============================================================================== --- stable/10/sys/arm/s3c2xx0/uart_dev_s3c2410.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/arm/s3c2xx0/uart_dev_s3c2410.c Sat Mar 1 04:16:54 2014 (r262649) @@ -203,7 +203,6 @@ s3c2410_getc(struct uart_bas *bas, struc return sscom_getc(bas->bst, bas->bsh); } - static int s3c2410_bus_probe(struct uart_softc *sc); static int s3c2410_bus_attach(struct uart_softc *sc); static int s3c2410_bus_flush(struct uart_softc *, int); @@ -214,6 +213,8 @@ static int s3c2410_bus_param(struct uart static int s3c2410_bus_receive(struct uart_softc *); static int s3c2410_bus_setsig(struct uart_softc *, int); static int s3c2410_bus_transmit(struct uart_softc *); +static void s3c2410_bus_grab(struct uart_softc *); +static void s3c2410_bus_ungrab(struct uart_softc *); static kobj_method_t s3c2410_methods[] = { KOBJMETHOD(uart_probe, s3c2410_bus_probe), @@ -226,6 +227,8 @@ static kobj_method_t s3c2410_methods[] = KOBJMETHOD(uart_receive, s3c2410_bus_receive), KOBJMETHOD(uart_setsig, s3c2410_bus_setsig), KOBJMETHOD(uart_transmit, s3c2410_bus_transmit), + KOBJMETHOD(uart_grab, s3c2410_bus_grab), + KOBJMETHOD(uart_ungrab, s3c2410_bus_ungrab), {0, 0 } }; @@ -373,6 +376,25 @@ s3c2410_bus_ioctl(struct uart_softc *sc, return (EINVAL); } + +static void +s3c2410_bus_grab(struct uart_softc *sc) +{ + uintptr_t irq; + + irq = rman_get_start(sc->sc_ires); + arm_mask_irq(get_sub_irq(irq, RX_OFF)); +} + +static void +s3c2410_bus_ungrab(struct uart_softc *sc) +{ + uintptr_t irq; + + irq = rman_get_start(sc->sc_ires); + arm_unmask_irq(get_sub_irq(irq, RX_OFF)); +} + struct uart_class uart_s3c2410_class = { "s3c2410 class", s3c2410_methods, Modified: stable/10/sys/arm/sa11x0/uart_dev_sa1110.c ============================================================================== --- stable/10/sys/arm/sa11x0/uart_dev_sa1110.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/arm/sa11x0/uart_dev_sa1110.c Sat Mar 1 04:16:54 2014 (r262649) @@ -137,6 +137,8 @@ static int sa1110_bus_param(struct uart_ static int sa1110_bus_receive(struct uart_softc *); static int sa1110_bus_setsig(struct uart_softc *, int); static int sa1110_bus_transmit(struct uart_softc *); +static void sa1110_bus_grab(struct uart_softc *); +static void sa1110_bus_ungrab(struct uart_softc *); static kobj_method_t sa1110_methods[] = { KOBJMETHOD(uart_probe, sa1110_bus_probe), @@ -149,6 +151,8 @@ static kobj_method_t sa1110_methods[] = KOBJMETHOD(uart_receive, sa1110_bus_receive), KOBJMETHOD(uart_setsig, sa1110_bus_setsig), KOBJMETHOD(uart_transmit, sa1110_bus_transmit), + KOBJMETHOD(uart_grab, sa1110_bus_grab), + KOBJMETHOD(uart_ungrab, sa1110_bus_ungrab), {0, 0 } }; @@ -164,10 +168,10 @@ sa1110_bus_probe(struct uart_softc *sc) static int sa1110_bus_attach(struct uart_softc *sc) { - bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); + bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); - sc->sc_hwiflow = 0; - uart_setreg(&sc->sc_bas, SACOM_CR3, CR3_RXE | CR3_TXE | CR3_RIE | CR3_TIE); + sc->sc_hwiflow = 0; + uart_setreg(&sc->sc_bas, SACOM_CR3, CR3_RXE | CR3_TXE | CR3_RIE | CR3_TIE); return (0); } static int @@ -273,6 +277,26 @@ sa1110_bus_ioctl(struct uart_softc *sc, return (EINVAL); } +static void +sa1110_bus_grab(struct uart_softc *sc) +{ + + /* Turn off Rx interrupts */ + uart_lock(sc->sc_hwmtx); + uart_setreg(&sc->sc_bas, SACOM_CR3, CR3_TXE | CR3_TIE); + uart_unlock(sc->sc_hwmtx); +} + +static void +sa1110_bus_ungrab(struct uart_softc *sc) +{ + + /* Turn on Rx interrupts */ + uart_lock(sc->sc_hwmtx); + uart_setreg(&sc->sc_bas, SACOM_CR3, CR3_RXE | CR3_TXE | CR3_RIE | CR3_TIE); + uart_unlock(sc->sc_hwmtx); +} + struct uart_class uart_sa1110_class = { "sa1110", sa1110_methods, Modified: stable/10/sys/arm/xilinx/uart_dev_cdnc.c ============================================================================== --- stable/10/sys/arm/xilinx/uart_dev_cdnc.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/arm/xilinx/uart_dev_cdnc.c Sat Mar 1 04:16:54 2014 (r262649) @@ -398,6 +398,8 @@ static int cdnc_uart_bus_param(struct ua static int cdnc_uart_bus_receive(struct uart_softc *); static int cdnc_uart_bus_setsig(struct uart_softc *, int); static int cdnc_uart_bus_transmit(struct uart_softc *); +static void cdnc_uart_bus_grab(struct uart_softc *); +static void cdnc_uart_bus_ungrab(struct uart_softc *); static kobj_method_t cdnc_uart_bus_methods[] = { KOBJMETHOD(uart_probe, cdnc_uart_bus_probe), @@ -410,6 +412,8 @@ static kobj_method_t cdnc_uart_bus_metho KOBJMETHOD(uart_receive, cdnc_uart_bus_receive), KOBJMETHOD(uart_setsig, cdnc_uart_bus_setsig), KOBJMETHOD(uart_transmit, cdnc_uart_bus_transmit), + KOBJMETHOD(uart_grab, cdnc_uart_bus_grab), + KOBJMETHOD(uart_ungrab, cdnc_uart_bus_ungrab), KOBJMETHOD_END }; @@ -675,6 +679,27 @@ cdnc_uart_bus_ioctl(struct uart_softc *s return (error); } +static void +cdnc_uart_bus_grab(struct uart_softc *sc) +{ + + /* Enable interrupts. */ + WR4(&sc->sc_bas, CDNC_UART_IEN_REG, + CDNC_UART_INT_TXOVR | CDNC_UART_INT_RXOVR | + CDNC_UART_INT_DMSI); +} + +static void +cdnc_uart_bus_ungrab(struct uart_softc *sc) +{ + + /* Enable interrupts. */ + WR4(&sc->sc_bas, CDNC_UART_IEN_REG, + CDNC_UART_INT_RXTRIG | CDNC_UART_INT_RXTMOUT | + CDNC_UART_INT_TXOVR | CDNC_UART_INT_RXOVR | + CDNC_UART_INT_DMSI); +} + struct uart_class uart_cdnc_class = { "cdnc_uart", cdnc_uart_bus_methods, Modified: stable/10/sys/dev/uart/uart_core.c ============================================================================== --- stable/10/sys/dev/uart/uart_core.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_core.c Sat Mar 1 04:16:54 2014 (r262649) @@ -412,6 +412,13 @@ uart_bus_attach(device_t dev) sc = sc0; /* + * Now that we know the softc for this device, connect the back + * pointer from the sysdev for this device, if any + */ + if (sc->sc_sysdev != NULL) + sc->sc_sysdev->sc = sc; + + /* * Protect ourselves against interrupts while we're not completely * finished attaching and initializing. We don't expect interrupts * until after UART_ATTACH() though. @@ -617,3 +624,19 @@ uart_bus_resume(device_t dev) sc = device_get_softc(dev); return (UART_ATTACH(sc)); } + +void +uart_grab(struct uart_devinfo *di) +{ + + if (di->sc) + UART_GRAB(di->sc); +} + +void +uart_ungrab(struct uart_devinfo *di) +{ + + if (di->sc) + UART_UNGRAB(di->sc); +} Modified: stable/10/sys/dev/uart/uart_cpu.h ============================================================================== --- stable/10/sys/dev/uart/uart_cpu.h Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_cpu.h Sat Mar 1 04:16:54 2014 (r262649) @@ -33,6 +33,8 @@ #include #include +struct uart_softc; + /* * Low-level operations for use by console and/or debug port support. */ @@ -43,8 +45,6 @@ struct uart_ops { void (*putc)(struct uart_bas *, int); int (*rxready)(struct uart_bas *); int (*getc)(struct uart_bas *, struct mtx *); - void (*grab)(struct uart_bas *); - void (*ungrab)(struct uart_bas *); }; extern bus_space_tag_t uart_bus_space_io; @@ -53,7 +53,6 @@ extern bus_space_tag_t uart_bus_space_me /* * Console and debug port device info. */ -struct uart_softc; struct uart_devinfo { SLIST_ENTRY(uart_devinfo) next; struct uart_ops *ops; @@ -70,6 +69,7 @@ struct uart_devinfo { int (*detach)(struct uart_softc*); void *cookie; /* Type dependent use. */ struct mtx *hwmtx; + struct uart_softc *sc; /* valid only from start of attach */ }; int uart_cpu_eqres(struct uart_bas *, struct uart_bas *); @@ -137,27 +137,6 @@ uart_putc(struct uart_devinfo *di, int c uart_unlock(di->hwmtx); } -static __inline void -uart_grab(struct uart_devinfo *di) -{ - - uart_lock(di->hwmtx); - if (di->ops->grab) - di->ops->grab(&di->bas); - uart_unlock(di->hwmtx); -} - -static __inline void -uart_ungrab(struct uart_devinfo *di) -{ - - uart_lock(di->hwmtx); - if (di->ops->ungrab) - di->ops->ungrab(&di->bas); - uart_unlock(di->hwmtx); -} - - static __inline int uart_rxready(struct uart_devinfo *di) { @@ -190,4 +169,7 @@ uart_getc(struct uart_devinfo *di) return (di->ops->getc(&di->bas, di->hwmtx)); } +void uart_grab(struct uart_devinfo *di); +void uart_ungrab(struct uart_devinfo *di); + #endif /* _DEV_UART_CPU_H_ */ Modified: stable/10/sys/dev/uart/uart_dev_imx.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_imx.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_dev_imx.c Sat Mar 1 04:16:54 2014 (r262649) @@ -140,6 +140,8 @@ static int imx_uart_bus_probe(struct uar static int imx_uart_bus_receive(struct uart_softc *); static int imx_uart_bus_setsig(struct uart_softc *, int); static int imx_uart_bus_transmit(struct uart_softc *); +static void imx_uart_bus_grab(struct uart_softc *); +static void imx_uart_bus_ungrab(struct uart_softc *); static kobj_method_t imx_uart_methods[] = { KOBJMETHOD(uart_attach, imx_uart_bus_attach), @@ -153,6 +155,8 @@ static kobj_method_t imx_uart_methods[] KOBJMETHOD(uart_receive, imx_uart_bus_receive), KOBJMETHOD(uart_setsig, imx_uart_bus_setsig), KOBJMETHOD(uart_transmit, imx_uart_bus_transmit), + KOBJMETHOD(uart_grab, imx_uart_bus_grab), + KOBJMETHOD(uart_ungrab, imx_uart_bus_ungrab), { 0, 0 } }; @@ -189,12 +193,7 @@ imx_uart_bus_attach(struct uart_softc *s (void)imx_uart_bus_getsig(sc); - /* XXX workaround to have working console on manut prompt */ - if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE){ - DIS(bas, UCR4, DREN); - } else { - ENA(bas, UCR4, DREN); - } + ENA(bas, UCR4, DREN); DIS(bas, UCR1, RRDYEN); DIS(bas, UCR1, IDEN); DIS(bas, UCR3, RXDSEN); @@ -402,13 +401,6 @@ static int imx_uart_bus_setsig(struct uart_softc *sc, int sig) { - /* TODO: implement (?) */ - - /* XXX workaround to have working console on mount prompt */ - /* Enable RX interrupt */ - if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) - if (!IS(&sc->sc_bas, UCR4, DREN)) - ENA(&sc->sc_bas, UCR4, DREN); return (0); } @@ -434,3 +426,25 @@ imx_uart_bus_transmit(struct uart_softc return (0); } + +static void +imx_uart_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + DIS(bas, UCR4, DREN); + uart_unlock(sc->sc_hwmtx); +} + +static void +imx_uart_bus_ungrab(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + ENA(bas, UCR4, DREN); + uart_unlock(sc->sc_hwmtx); +} Modified: stable/10/sys/dev/uart/uart_dev_lpc.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_lpc.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_dev_lpc.c Sat Mar 1 04:16:54 2014 (r262649) @@ -400,6 +400,8 @@ static int lpc_ns8250_bus_probe(struct u static int lpc_ns8250_bus_receive(struct uart_softc *); static int lpc_ns8250_bus_setsig(struct uart_softc *, int); static int lpc_ns8250_bus_transmit(struct uart_softc *); +static void lpc_ns8250_bus_grab(struct uart_softc *); +static void lpc_ns8250_bus_ungrab(struct uart_softc *); static kobj_method_t lpc_ns8250_methods[] = { KOBJMETHOD(uart_attach, lpc_ns8250_bus_attach), @@ -413,6 +415,8 @@ static kobj_method_t lpc_ns8250_methods[ KOBJMETHOD(uart_receive, lpc_ns8250_bus_receive), KOBJMETHOD(uart_setsig, lpc_ns8250_bus_setsig), KOBJMETHOD(uart_transmit, lpc_ns8250_bus_transmit), + KOBJMETHOD(uart_grab, lpc_ns8250_bus_grab), + KOBJMETHOD(uart_ungrab, lpc_ns8250_bus_ungrab), { 0, 0 } }; @@ -889,3 +893,34 @@ lpc_ns8250_bus_transmit(struct uart_soft uart_unlock(sc->sc_hwmtx); return (0); } + +void +lpc_ns8250_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + + /* + * turn off all interrupts to enter polling mode. Leave the + * saved mask alone. We'll restore whatever it was in ungrab. + * All pending interupt signals are reset when IER is set to 0. + */ + uart_lock(sc->sc_hwmtx); + uart_setreg(bas, REG_IER, 0); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} + +void +lpc_ns8250_bus_ungrab(struct uart_softc *sc) +{ + struct lpc_ns8250_softc *lpc_ns8250 = (struct lpc_ns8250_softc*)sc; + struct uart_bas *bas = &sc->sc_bas; + + /* + * Restore previous interrupt mask + */ + uart_lock(sc->sc_hwmtx); + uart_setreg(bas, REG_IER, lpc_ns8250->ier); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} Modified: stable/10/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_ns8250.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_dev_ns8250.c Sat Mar 1 04:16:54 2014 (r262649) @@ -365,6 +365,8 @@ static kobj_method_t ns8250_methods[] = KOBJMETHOD(uart_receive, ns8250_bus_receive), KOBJMETHOD(uart_setsig, ns8250_bus_setsig), KOBJMETHOD(uart_transmit, ns8250_bus_transmit), + KOBJMETHOD(uart_grab, ns8250_bus_grab), + KOBJMETHOD(uart_ungrab, ns8250_bus_ungrab), { 0, 0 } }; @@ -898,3 +900,34 @@ ns8250_bus_transmit(struct uart_softc *s uart_sched_softih(sc, SER_INT_TXIDLE); return (0); } + +void +ns8250_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + + /* + * turn off all interrupts to enter polling mode. Leave the + * saved mask alone. We'll restore whatever it was in ungrab. + * All pending interupt signals are reset when IER is set to 0. + */ + uart_lock(sc->sc_hwmtx); + uart_setreg(bas, REG_IER, 0); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} + +void +ns8250_bus_ungrab(struct uart_softc *sc) +{ + struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc; + struct uart_bas *bas = &sc->sc_bas; + + /* + * Restore previous interrupt mask + */ + uart_lock(sc->sc_hwmtx); + uart_setreg(bas, REG_IER, ns8250->ier); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} Modified: stable/10/sys/dev/uart/uart_dev_ns8250.h ============================================================================== --- stable/10/sys/dev/uart/uart_dev_ns8250.h Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_dev_ns8250.h Sat Mar 1 04:16:54 2014 (r262649) @@ -56,5 +56,7 @@ int ns8250_bus_probe(struct uart_softc * int ns8250_bus_receive(struct uart_softc *); int ns8250_bus_setsig(struct uart_softc *, int); int ns8250_bus_transmit(struct uart_softc *); +void ns8250_bus_grab(struct uart_softc *); +void ns8250_bus_ungrab(struct uart_softc *); #endif /* _DEV_UART_DEV_NS8250_H_ */ Modified: stable/10/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_pl011.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_dev_pl011.c Sat Mar 1 04:16:54 2014 (r262649) @@ -242,6 +242,8 @@ static int uart_pl011_bus_probe(struct u static int uart_pl011_bus_receive(struct uart_softc *); static int uart_pl011_bus_setsig(struct uart_softc *, int); static int uart_pl011_bus_transmit(struct uart_softc *); +static void uart_pl011_bus_grab(struct uart_softc *); +static void uart_pl011_bus_ungrab(struct uart_softc *); static kobj_method_t uart_pl011_methods[] = { KOBJMETHOD(uart_attach, uart_pl011_bus_attach), @@ -255,6 +257,9 @@ static kobj_method_t uart_pl011_methods[ KOBJMETHOD(uart_receive, uart_pl011_bus_receive), KOBJMETHOD(uart_setsig, uart_pl011_bus_setsig), KOBJMETHOD(uart_transmit, uart_pl011_bus_transmit), + KOBJMETHOD(uart_grab, uart_pl011_bus_grab), + KOBJMETHOD(uart_ungrab, uart_pl011_bus_ungrab), + { 0, 0 } }; @@ -441,3 +446,27 @@ uart_pl011_bus_transmit(struct uart_soft return (0); } + +static void +uart_pl011_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + __uart_setreg(bas, UART_IMSC, /* Switch to RX polling while grabbed */ + ~UART_RXREADY & __uart_getreg(bas, UART_IMSC)); + uart_unlock(sc->sc_hwmtx); +} + +static void +uart_pl011_bus_ungrab(struct uart_softc *sc) +{ + struct uart_bas *bas; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + __uart_setreg(bas, UART_IMSC, /* Switch to RX interrupts while not grabbed */ + UART_RXREADY | __uart_getreg(bas, UART_IMSC)); + uart_unlock(sc->sc_hwmtx); +} Modified: stable/10/sys/dev/uart/uart_dev_quicc.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_quicc.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_dev_quicc.c Sat Mar 1 04:16:54 2014 (r262649) @@ -245,6 +245,8 @@ static int quicc_bus_probe(struct uart_s static int quicc_bus_receive(struct uart_softc *); static int quicc_bus_setsig(struct uart_softc *, int); static int quicc_bus_transmit(struct uart_softc *); +static void quicc_bus_grab(struct uart_softc *); +static void quicc_bus_ungrab(struct uart_softc *); static kobj_method_t quicc_methods[] = { KOBJMETHOD(uart_attach, quicc_bus_attach), @@ -258,6 +260,8 @@ static kobj_method_t quicc_methods[] = { KOBJMETHOD(uart_receive, quicc_bus_receive), KOBJMETHOD(uart_setsig, quicc_bus_setsig), KOBJMETHOD(uart_transmit, quicc_bus_transmit), + KOBJMETHOD(uart_grab, quicc_bus_grab), + KOBJMETHOD(uart_ungrab, quicc_bus_ungrab), { 0, 0 } }; @@ -485,3 +489,34 @@ quicc_bus_transmit(struct uart_softc *sc uart_unlock(sc->sc_hwmtx); return (0); } + +static void +quicc_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas; + uint16_t st, rb; + + /* Disable interrupts on the receive buffer. */ + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + rb = quicc_read2(bas, QUICC_PRAM_SCC_RBASE(bas->chan - 1)); + st = quicc_read2(bas, rb); + quicc_write2(bas, rb, st & ~0x9000); + uart_unlock(sc->sc_hwmtx); +} + +static void +quicc_bus_ungrab(struct uart_softc *sc) +{ + struct uart_bas *bas; + uint16_t st, rb; + + /* Enable interrupts on the receive buffer. */ + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + rb = quicc_read2(bas, QUICC_PRAM_SCC_RBASE(bas->chan - 1)); + st = quicc_read2(bas, rb); + quicc_write2(bas, rb, st | 0x9000); + uart_unlock(sc->sc_hwmtx); +} + Modified: stable/10/sys/dev/uart/uart_dev_sab82532.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_sab82532.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_dev_sab82532.c Sat Mar 1 04:16:54 2014 (r262649) @@ -365,6 +365,8 @@ static int sab82532_bus_probe(struct uar static int sab82532_bus_receive(struct uart_softc *); static int sab82532_bus_setsig(struct uart_softc *, int); static int sab82532_bus_transmit(struct uart_softc *); +static void sab82532_bus_grab(struct uart_softc *); +static void sab82532_bus_ungrab(struct uart_softc *); static kobj_method_t sab82532_methods[] = { KOBJMETHOD(uart_attach, sab82532_bus_attach), @@ -378,6 +380,8 @@ static kobj_method_t sab82532_methods[] KOBJMETHOD(uart_receive, sab82532_bus_receive), KOBJMETHOD(uart_setsig, sab82532_bus_setsig), KOBJMETHOD(uart_transmit, sab82532_bus_transmit), + KOBJMETHOD(uart_grab, sab82532_bus_grab), + KOBJMETHOD(uart_ungrab, sab82532_bus_ungrab), { 0, 0 } }; @@ -724,3 +728,32 @@ sab82532_bus_transmit(struct uart_softc uart_unlock(sc->sc_hwmtx); return (0); } + +static void +sab82532_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas; + uint8_t imr0; + + bas = &sc->sc_bas; + imr0 = SAB_IMR0_TIME|SAB_IMR0_CDSC|SAB_IMR0_RFO; /* No TCD or RPF */ + uart_lock(sc->sc_hwmtx); + uart_setreg(bas, SAB_IMR0, 0xff & ~imr0); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} + +static void +sab82532_bus_ungrab(struct uart_softc *sc) +{ + struct uart_bas *bas; + uint8_t imr0; + + bas = &sc->sc_bas; + imr0 = SAB_IMR0_TCD|SAB_IMR0_TIME|SAB_IMR0_CDSC|SAB_IMR0_RFO| + SAB_IMR0_RPF; + uart_lock(sc->sc_hwmtx); + uart_setreg(bas, SAB_IMR0, 0xff & ~imr0); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} Modified: stable/10/sys/dev/uart/uart_dev_z8530.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_z8530.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_dev_z8530.c Sat Mar 1 04:16:54 2014 (r262649) @@ -281,6 +281,8 @@ static int z8530_bus_probe(struct uart_s static int z8530_bus_receive(struct uart_softc *); static int z8530_bus_setsig(struct uart_softc *, int); static int z8530_bus_transmit(struct uart_softc *); +static void z8530_bus_grab(struct uart_softc *); +static void z8530_bus_ungrab(struct uart_softc *); static kobj_method_t z8530_methods[] = { KOBJMETHOD(uart_attach, z8530_bus_attach), @@ -294,6 +296,8 @@ static kobj_method_t z8530_methods[] = { KOBJMETHOD(uart_receive, z8530_bus_receive), KOBJMETHOD(uart_setsig, z8530_bus_setsig), KOBJMETHOD(uart_transmit, z8530_bus_transmit), + KOBJMETHOD(uart_grab, z8530_bus_grab), + KOBJMETHOD(uart_ungrab, z8530_bus_ungrab), { 0, 0 } }; @@ -621,3 +625,27 @@ z8530_bus_transmit(struct uart_softc *sc uart_unlock(sc->sc_hwmtx); return (0); } + +static void +z8530_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + uart_setmreg(bas, WR_IDT, IDT_XIE | IDT_TIE); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} + +static void +z8530_bus_ungrab(struct uart_softc *sc) +{ + struct uart_bas *bas; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + uart_setmreg(bas, WR_IDT, IDT_XIE | IDT_TIE | IDT_RIA); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} Modified: stable/10/sys/dev/uart/uart_if.m ============================================================================== --- stable/10/sys/dev/uart/uart_if.m Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/dev/uart/uart_if.m Sat Mar 1 04:16:54 2014 (r262649) @@ -141,3 +141,19 @@ METHOD int setsig { METHOD int transmit { struct uart_softc *this; }; + +# grab() - Up call from the console to the upper layers of the driver when +# the kernel asks to grab the console. This is valid only for console +# drivers. This method is responsible for transitioning the hardware +# from an interrupt driven state to a polled state that works with the +# low-level console interface defined for this device. The kernel +# currently only calls this when it wants to grab input from the +# console. Output can still happen asyncrhonously to these calls. +METHOD void grab { + struct uart_softc *this; +}; + +# ungrab() - Undoes the effects of grab(). +METHOD void ungrab { + struct uart_softc *this; +}; Modified: stable/10/sys/mips/adm5120/uart_dev_adm5120.c ============================================================================== --- stable/10/sys/mips/adm5120/uart_dev_adm5120.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/mips/adm5120/uart_dev_adm5120.c Sat Mar 1 04:16:54 2014 (r262649) @@ -149,6 +149,8 @@ static int adm5120_uart_bus_probe(struct static int adm5120_uart_bus_receive(struct uart_softc *); static int adm5120_uart_bus_setsig(struct uart_softc *, int); static int adm5120_uart_bus_transmit(struct uart_softc *); +static void adm5120_uart_bus_grab(struct uart_softc *); +static void adm5120_uart_bus_ungrab(struct uart_softc *); static kobj_method_t adm5120_uart_methods[] = { KOBJMETHOD(uart_attach, adm5120_uart_bus_attach), @@ -162,6 +164,8 @@ static kobj_method_t adm5120_uart_method KOBJMETHOD(uart_receive, adm5120_uart_bus_receive), KOBJMETHOD(uart_setsig, adm5120_uart_bus_setsig), KOBJMETHOD(uart_transmit, adm5120_uart_bus_transmit), + KOBJMETHOD(uart_grab, adm5120_uart_bus_grab), + KOBJMETHOD(uart_ungrab, adm5120_uart_bus_ungrab), { 0, 0 } }; @@ -450,3 +454,26 @@ adm5120_uart_bus_transmit(struct uart_so uart_unlock(sc->sc_hwmtx); return (0); } + +static void +adm5120_uart_bus_grab(struct uart_softc *sc) +{ + + /* Enable interrupts - no RX_INT or RX_TIMEOUT */ + uart_lock(sc->sc_hwmtx); + uart_setreg(&sc->sc_bas, UART_CR_REG, + UART_CR_PORT_EN | UART_CR_MODEM_STATUS_INT_EN); + uart_unlock(sc->sc_hwmtx); +} + +static void +adm5120_uart_bus_ungrab(struct uart_softc *sc) +{ + + /* Enable interrupts */ + uart_lock(sc->sc_hwmtx); + uart_setreg(&sc->sc_bas, UART_CR_REG, + UART_CR_PORT_EN|UART_CR_RX_INT_EN|UART_CR_RX_TIMEOUT_INT_EN| + UART_CR_MODEM_STATUS_INT_EN); + uart_unlock(sc->sc_hwmtx); +} Modified: stable/10/sys/mips/atheros/uart_dev_ar933x.c ============================================================================== --- stable/10/sys/mips/atheros/uart_dev_ar933x.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/mips/atheros/uart_dev_ar933x.c Sat Mar 1 04:16:54 2014 (r262649) @@ -325,6 +325,8 @@ static int ar933x_bus_probe(struct uart_ static int ar933x_bus_receive(struct uart_softc *); static int ar933x_bus_setsig(struct uart_softc *, int); static int ar933x_bus_transmit(struct uart_softc *); +static void ar933x_bus_grab(struct uart_softc *); +static void ar933x_bus_ungrab(struct uart_softc *); static kobj_method_t ar933x_methods[] = { KOBJMETHOD(uart_attach, ar933x_bus_attach), @@ -338,6 +340,8 @@ static kobj_method_t ar933x_methods[] = KOBJMETHOD(uart_receive, ar933x_bus_receive), KOBJMETHOD(uart_setsig, ar933x_bus_setsig), KOBJMETHOD(uart_transmit, ar933x_bus_transmit), + KOBJMETHOD(uart_grab, ar933x_bus_grab), + KOBJMETHOD(uart_ungrab, ar933x_bus_ungrab), { 0, 0 } }; @@ -752,3 +756,31 @@ ar933x_bus_transmit(struct uart_softc *s return (0); } + +static void +ar933x_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + uint32_t reg; + + /* Disable the host interrupt now */ + uart_lock(sc->sc_hwmtx); + reg = ar933x_getreg(bas, AR933X_UART_CS_REG); + reg &= ~AR933X_UART_CS_HOST_INT_EN; + ar933x_setreg(bas, AR933X_UART_CS_REG, reg); + uart_unlock(sc->sc_hwmtx); +} + +static void +ar933x_bus_ungrab(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + uint32_t reg; + + /* Enable the host interrupt now */ + uart_lock(sc->sc_hwmtx); + reg = ar933x_getreg(bas, AR933X_UART_CS_REG); + reg |= AR933X_UART_CS_HOST_INT_EN; + ar933x_setreg(bas, AR933X_UART_CS_REG, reg); + uart_unlock(sc->sc_hwmtx); +} Modified: stable/10/sys/mips/cavium/uart_dev_oct16550.c ============================================================================== --- stable/10/sys/mips/cavium/uart_dev_oct16550.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/mips/cavium/uart_dev_oct16550.c Sat Mar 1 04:16:54 2014 (r262649) @@ -398,6 +398,8 @@ static int oct16550_bus_probe(struct uar static int oct16550_bus_receive(struct uart_softc *); static int oct16550_bus_setsig(struct uart_softc *, int); static int oct16550_bus_transmit(struct uart_softc *); +static void oct16550_bus_grab(struct uart_softc *); +static void oct16550_bus_ungrab(struct uart_softc *); static kobj_method_t oct16550_methods[] = { KOBJMETHOD(uart_attach, oct16550_bus_attach), @@ -411,6 +413,8 @@ static kobj_method_t oct16550_methods[] KOBJMETHOD(uart_receive, oct16550_bus_receive), KOBJMETHOD(uart_setsig, oct16550_bus_setsig), KOBJMETHOD(uart_transmit, oct16550_bus_transmit), + KOBJMETHOD(uart_grab, oct16550_bus_grab), + KOBJMETHOD(uart_ungrab, oct16550_bus_ungrab), { 0, 0 } }; @@ -810,3 +814,34 @@ oct16550_bus_transmit (struct uart_softc uart_unlock(sc->sc_hwmtx); return (0); } + +static void +oct16550_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + + /* + * turn off all interrupts to enter polling mode. Leave the + * saved mask alone. We'll restore whatever it was in ungrab. + * All pending interupt signals are reset when IER is set to 0. + */ + uart_lock(sc->sc_hwmtx); + uart_setreg(bas, REG_IER, 0); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} + +static void +oct16550_bus_ungrab(struct uart_softc *sc) +{ + struct oct16550_softc *oct16550 = (struct oct16550_softc*)sc; + struct uart_bas *bas = &sc->sc_bas; + + /* + * Restore previous interrupt mask + */ + uart_lock(sc->sc_hwmtx); + uart_setreg(bas, REG_IER, oct16550->ier); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} Modified: stable/10/sys/mips/rt305x/uart_dev_rt305x.c ============================================================================== --- stable/10/sys/mips/rt305x/uart_dev_rt305x.c Sat Mar 1 03:39:56 2014 (r262648) +++ stable/10/sys/mips/rt305x/uart_dev_rt305x.c Sat Mar 1 04:16:54 2014 (r262649) @@ -195,6 +195,8 @@ static int rt305x_uart_bus_probe(struct static int rt305x_uart_bus_receive(struct uart_softc *); static int rt305x_uart_bus_setsig(struct uart_softc *, int); static int rt305x_uart_bus_transmit(struct uart_softc *); +static void rt305x_uart_bus_grab(struct uart_softc *); +static void rt305x_uart_bus_ungrab(struct uart_softc *); static kobj_method_t rt305x_uart_methods[] = { KOBJMETHOD(uart_attach, rt305x_uart_bus_attach), @@ -208,6 +210,8 @@ static kobj_method_t rt305x_uart_methods KOBJMETHOD(uart_receive, rt305x_uart_bus_receive), KOBJMETHOD(uart_setsig, rt305x_uart_bus_setsig), KOBJMETHOD(uart_transmit, rt305x_uart_bus_transmit), + KOBJMETHOD(uart_grab, rt305x_uart_bus_grab), + KOBJMETHOD(uart_ungrab, rt305x_uart_bus_ungrab), { 0, 0 } }; @@ -278,7 +282,7 @@ rt305x_uart_bus_attach(struct uart_softc uart_setreg(bas, UART_FCR_REG, uart_getreg(bas, UART_FCR_REG) | UART_FCR_FIFOEN | UART_FCR_TXTGR_1 | UART_FCR_RXTGR_1); - uart_barrier(bas); + uart_barrier(bas); /* Enable interrupts */ uart_setreg(bas, UART_IER_REG, UART_IER_EDSSI | UART_IER_ELSI | UART_IER_ERBFI); @@ -505,3 +509,28 @@ rt305x_uart_bus_transmit(struct uart_sof uart_unlock(sc->sc_hwmtx); return (0); } + +static void +rt305x_uart_bus_grab(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + + /* disable interrupts -- XXX not sure which one is RX, so kill them all */ + uart_lock(sc->sc_hwmtx); + uart_setreg(bas, UART_IER_REG, 0); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} + +static void +rt305x_uart_bus_ungrab(struct uart_softc *sc) +{ + struct uart_bas *bas = &sc->sc_bas; + + /* Enable interrupts */ + uart_lock(sc->sc_hwmtx); + uart_setreg(bas, UART_IER_REG, + UART_IER_EDSSI | UART_IER_ELSI | UART_IER_ERBFI); + uart_barrier(bas); + uart_unlock(sc->sc_hwmtx); +} From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 04:25:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E1895EBD; Sat, 1 Mar 2014 04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B255012D6; Sat, 1 Mar 2014 04: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 s214PrtE062672; Sat, 1 Mar 2014 04:25:53 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s214PqeL062668; Sat, 1 Mar 2014 04:25:52 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201403010425.s214PqeL062668@svn.freebsd.org> From: Brooks Davis Date: Sat, 1 Mar 2014 04:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262650 - in stable/10: share/mk tools/build/mk tools/build/options usr.sbin X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 04:25:54 -0000 Author: brooks Date: Sat Mar 1 04:25:52 2014 New Revision: 262650 URL: http://svnweb.freebsd.org/changeset/base/262650 Log: MFC r261299: Merge from CheriBSD: commit 2d581e8caf79d7a0f5a24590eccd06da90cccb74 Author: Brooks Davis Date: Mon Jan 27 22:57:51 2014 +0000 Add WITHOUT_FMTREE to disable building fmtree. Sponsored by: DARPA, AFRL Added: stable/10/tools/build/options/WITHOUT_FMTREE - copied unchanged from r261299, head/tools/build/options/WITHOUT_FMTREE Modified: stable/10/share/mk/bsd.own.mk stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.sbin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Sat Mar 1 04:16:54 2014 (r262649) +++ stable/10/share/mk/bsd.own.mk Sat Mar 1 04:25:52 2014 (r262650) @@ -274,6 +274,7 @@ __DEFAULT_YES_OPTIONS = \ ED_CRYPTO \ EXAMPLES \ FLOPPY \ + FMTREE \ FORMAT_EXTENSIONS \ FORTH \ FP_LIBC \ Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Mar 1 04:16:54 2014 (r262649) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Mar 1 04:25:52 2014 (r262650) @@ -630,6 +630,11 @@ OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/libexec/cc1plus .endif +.if ${MK_FMTREE} == no +OLD_FILES+=usr/sbin/fmtree +OLD_FILES+=usr/share/man/man8/fmtree.8.gz +.endif + .if ${MK_GNUCXX} == no OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/include/c++/4.2/algorithm Copied: stable/10/tools/build/options/WITHOUT_FMTREE (from r261299, head/tools/build/options/WITHOUT_FMTREE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_FMTREE Sat Mar 1 04:25:52 2014 (r262650, copy of r261299, head/tools/build/options/WITHOUT_FMTREE) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build and install +.Pa /usr/sbin/fmtree . Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Sat Mar 1 04:16:54 2014 (r262649) +++ stable/10/usr.sbin/Makefile Sat Mar 1 04:25:52 2014 (r262650) @@ -48,7 +48,7 @@ SUBDIR= adduser \ mountd \ mptutil \ mtest \ - mtree \ + ${_mtree} \ newsyslog \ nfscbd \ nfsd \ @@ -142,6 +142,10 @@ SUBDIR+= fdread SUBDIR+= fdwrite .endif +.if ${MK_FMTREE} != "no" +SUBDIR+= mtree +.endif + .if ${MK_FREEBSD_UPDATE} != "no" SUBDIR+= freebsd-update .endif From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 04:44:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E3034289; Sat, 1 Mar 2014 04:44:33 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB51F147C; Sat, 1 Mar 2014 04:44:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s214iXUe070327; Sat, 1 Mar 2014 04:44:33 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s214iXkZ070326; Sat, 1 Mar 2014 04:44:33 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201403010444.s214iXkZ070326@svn.freebsd.org> From: Brooks Davis Date: Sat, 1 Mar 2014 04:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262651 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 04:44:34 -0000 Author: brooks Date: Sat Mar 1 04:44:33 2014 New Revision: 262651 URL: http://svnweb.freebsd.org/changeset/base/262651 Log: MFC r261301 (notional merge): Regenerate for WITHOUT_FMTREE and WITHOUT_NCURSESW Large churn in comments due to regeneration with makeman script. Sponsored by: DARPA, AFRL Modified: stable/10/share/man/man5/src.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Sat Mar 1 04:25:52 2014 (r262650) +++ stable/10/share/man/man5/src.conf.5 Sat Mar 1 04:44:33 2014 (r262651) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: stable/10/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des +.\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd January 27, 2014 +.Dd March 1, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -78,54 +78,54 @@ The following list provides a name and s that can be used for source builds. .Bl -tag -width indent .It Va WITHOUT_ACCT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed +.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed Set to not build process accounting tools such as .Xr accton 8 and .Xr sa 8 . .It Va WITHOUT_ACPI -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru Set to not build .Xr acpiconf 8 , .Xr acpidump 8 and related programs. .It Va WITHOUT_AMD -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam Set to not build .Xr amd 8 , and related programs. .It Va WITHOUT_APM -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam Set to not build .Xr apm 8 , .Xr apmd 8 and related programs. .It Va WITHOUT_ARM_EABI -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ARM_EABI 253396 2013-07-16 19:15:19Z andrew +.\" from FreeBSD: head/tools/build/options/WITHOUT_ARM_EABI 253396 2013-07-16 19:15:19Z andrew Set the ARM ABI to OABI. .It Va WITHOUT_ASSERT_DEBUG -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru Set to compile programs and libraries without the .Xr assert 3 checks. .It Va WITHOUT_AT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam Set to not build .Xr at 1 and related utilities. .It Va WITHOUT_ATM -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru Set to not build programs and libraries related to ATM networking. .It Va WITHOUT_AUDIT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru Set to not build audit support into system programs. .It Va WITHOUT_AUTHPF -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru Set to not build .Xr authpf 8 . .It Va WITHOUT_BINUTILS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BINUTILS 255974 2013-10-01 17:40:56Z emaste +.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 255974 2013-10-01 17:40:56Z emaste Set to not install binutils (as, c++-filt, gconv, ld, nm, objcopy, objdump, readelf, size and strip). .Bf -symbolic @@ -133,10 +133,10 @@ The option does not generally work for b toolchain is enabled. .Ef .It Va WITHOUT_BLUETOOTH -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. .It Va WITHOUT_BMAKE -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BMAKE 250839 2013-05-21 00:41:49Z delphij +.\" from FreeBSD: head/tools/build/options/WITHOUT_BMAKE 250839 2013-05-21 00:41:49Z delphij Set to not build and install the portable BSD make (bmake) as .Xr make 1 instead of the traditional FreeBSD make. @@ -145,22 +145,22 @@ It allows developers to switch to bmake kinks or issues. This option will be removed in due time. .It Va WITHOUT_BOOT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru Set to not build the boot blocks and loader. .It Va WITHOUT_BSD_CPIO -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb +.\" from FreeBSD: head/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . .It Va WITH_BSD_GREP -.\" from FreeBSD: stable/10/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien +.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien Install BSD-licensed grep as '[ef]grep' instead of GNU grep. .It Va WITHOUT_BSNMP -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam Set to not build or install .Xr bsnmpd 1 and related libraries and data files. .It Va WITHOUT_BZIP2 -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BZIP2 174550 2007-12-12 16:43:17Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_BZIP2 174550 2007-12-12 16:43:17Z ru Set to not build contributed bzip2 software as a part of the base system. .Bf -symbolic The option has no effect yet. @@ -172,17 +172,17 @@ When set, it also enforces the following .Va WITHOUT_BZIP2_SUPPORT .El .It Va WITHOUT_BZIP2_SUPPORT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BZIP2_SUPPORT 166255 2007-01-26 10:19:08Z delphij +.\" from FreeBSD: head/tools/build/options/WITHOUT_BZIP2_SUPPORT 166255 2007-01-26 10:19:08Z delphij Set to build some programs without optional bzip2 support. .It Va WITHOUT_CALENDAR -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CALENDAR 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_CALENDAR 156932 2006-03-21 07:50:50Z ru Set to not build .Xr calendar 1 . .It Va WITHOUT_CAPSICUM -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 21:57:58Z rwatson +.\" from FreeBSD: head/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 21:57:58Z rwatson Set to not build Capsicum support into system programs. .It Va WITHOUT_CDDL -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb +.\" from FreeBSD: head/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb Set to not build code licensed under Sun's CDDL. When set, it also enforces the following options: .Pp @@ -193,7 +193,7 @@ When set, it also enforces the following .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CLANG 208971 2010-06-10 06:20:26Z ed +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208971 2010-06-10 06:20:26Z ed Set to not build the Clang C/C++ compiler. .Pp It is a default setting on @@ -207,30 +207,30 @@ When set, it also enforces the following .Va WITHOUT_CLANG_FULL .El .It Va WITH_CLANG -.\" from FreeBSD: stable/10/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru +.\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru Set to build the Clang C/C++ compiler. .Pp It is a default setting on amd64/amd64, arm/arm, arm/armv6, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITH_CLANG_EXTRAS -.\" from FreeBSD: stable/10/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim +.\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim Set to build additional clang and llvm tools, such as bugpoint. .It Va WITHOUT_CLANG_FULL -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CLANG_FULL 246259 2013-02-02 22:28:29Z dim +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp It is a default setting on arm/arm, arm/armeb, arm/armv6, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. .It Va WITH_CLANG_FULL -.\" from FreeBSD: stable/10/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim +.\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp It is a default setting on amd64/amd64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_CLANG_IS_CC -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks Set to install the GCC compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ @@ -246,7 +246,7 @@ When set, it also enforces the following .Va WITHOUT_LLDB .El .It Va WITH_CLANG_IS_CC -.\" from FreeBSD: stable/10/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb +.\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ @@ -256,15 +256,15 @@ and It is a default setting on amd64/amd64, arm/arm, arm/armv6, i386/i386 and pc98/i386. .It Va WITHOUT_CPP -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build .Xr cpp 1 . .It Va WITHOUT_CROSS_COMPILER -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CROSS_COMPILER 250659 2013-05-15 14:30:03Z brooks +.\" from FreeBSD: head/tools/build/options/WITHOUT_CROSS_COMPILER 250659 2013-05-15 14:30:03Z brooks Set to not build a cross compiler in the cross-tools stage of buildworld, buildkernel, etc. .It Va WITHOUT_CRYPT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CRYPT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_CRYPT 156932 2006-03-21 07:50:50Z ru Set to not build any crypto code. When set, it also enforces the following options: .Pp @@ -288,17 +288,17 @@ When set, the following options are also is set explicitly) .El .It Va WITH_CTF -.\" from FreeBSD: stable/10/tools/build/options/WITH_CTF 228159 2011-11-30 18:22:44Z fjoe +.\" from FreeBSD: head/tools/build/options/WITH_CTF 228159 2011-11-30 18:22:44Z fjoe Set to compile with CTF (Compact C Type Format) data. CTF data encapsulates a reduced form of debugging information similar to DWARF and the venerable stabs and is required for DTrace. .It Va WITHOUT_CTM -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam Set to not build .Xr ctm 1 and related utilities. .It Va WITHOUT_CXX -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CXX 220402 2011-04-06 20:19:07Z uqs +.\" from FreeBSD: head/tools/build/options/WITHOUT_CXX 220402 2011-04-06 20:19:07Z uqs Set to not build .Xr g++ 1 and related libraries. @@ -319,7 +319,7 @@ When set, it also enforces the following .Va WITHOUT_GROFF .El .It Va WITH_DEBUG_FILES -.\" from FreeBSD: stable/10/tools/build/options/WITH_DEBUG_FILES 251512 2013-06-07 21:40:02Z emaste +.\" from FreeBSD: head/tools/build/options/WITH_DEBUG_FILES 251512 2013-06-07 21:40:02Z emaste Set to strip debug info into a separate file for each executable binary and shared library. The debug files will be placed in a subdirectory of @@ -327,86 +327,90 @@ The debug files will be placed in a subd and are located automatically by .Xr gdb 1 . .It Va WITHOUT_DICT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. .It Va WITHOUT_DYNAMICROOT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru Set this if you do not want to link .Pa /bin and .Pa /sbin dynamically. .It Va WITHOUT_ED_CRYPTO -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ED_CRYPTO 235660 2012-05-19 20:05:27Z marcel +.\" from FreeBSD: head/tools/build/options/WITHOUT_ED_CRYPTO 235660 2012-05-19 20:05:27Z marcel Set to build .Xr ed 1 without support for encryption/decryption. .It Va WITHOUT_EXAMPLES -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru Set to avoid installing examples to .Pa /usr/share/examples/ . .It Va WITHOUT_FDT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru Set to not build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .Pp It is a default setting on amd64/amd64, i386/i386, ia64/ia64, pc98/i386 and sparc64/sparc64. .It Va WITH_FDT -.\" from FreeBSD: stable/10/tools/build/options/WITH_FDT 221730 2011-05-10 11:14:40Z ru +.\" from FreeBSD: head/tools/build/options/WITH_FDT 221730 2011-05-10 11:14:40Z ru Set to build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .Pp It is a default setting on arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_FLOPPY -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru Set to not build or install programs for operating floppy disk driver. +.It Va WITHOUT_FMTREE +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FMTREE 262650 2014-03-01 04:25:52Z brooks +Set to not build and install +.Pa /usr/sbin/fmtree . .It Va WITHOUT_FORMAT_EXTENSIONS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FORMAT_EXTENSIONS 250658 2013-05-15 13:04:10Z brooks +.\" from FreeBSD: head/tools/build/options/WITHOUT_FORMAT_EXTENSIONS 250658 2013-05-15 13:04:10Z brooks Set to not enable .Fl fformat-extensions when compiling the kernel. Also disables all format checking. .It Va WITHOUT_FORTH -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru Set to build bootloaders without Forth support. .It Va WITHOUT_FP_LIBC -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FP_LIBC 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_FP_LIBC 156932 2006-03-21 07:50:50Z ru Set to build .Nm libc without floating-point support. .It Va WITHOUT_FREEBSD_UPDATE -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FREEBSD_UPDATE 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_FREEBSD_UPDATE 183242 2008-09-21 22:02:26Z sam Set to not build .Xr freebsd-update 8 . .It Va WITHOUT_GAMES -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru Set to not build games. .It Va WITHOUT_GCC -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GCC 255326 2013-09-06 20:49:48Z zeising +.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC 255326 2013-09-06 20:49:48Z zeising Set to not build and install gcc and g++. .Pp It is a default setting on amd64/amd64, arm/arm, arm/armv6 and i386/i386. .It Va WITH_GCC -.\" from FreeBSD: stable/10/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising +.\" from FreeBSD: head/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising Set to build and install gcc and g++. .Pp It is a default setting on arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GCOV -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru Set to not build the .Xr gcov 1 tool. .It Va WITHOUT_GDB -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GDB 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_GDB 156932 2006-03-21 07:50:50Z ru Set to not build .Xr gdb 1 . .It Va WITHOUT_GNU -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru Set to not build contributed GNU software as a part of the base system. This option can be useful if the system built must not contain any code covered by the GNU Public License due to legal reasons. @@ -420,36 +424,36 @@ When set, it also enforces the following .Va WITHOUT_GNU_SUPPORT .El .It Va WITHOUT_GNUCXX -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GNUCXX 255321 2013-09-06 20:08:03Z theraven +.\" from FreeBSD: head/tools/build/options/WITHOUT_GNUCXX 255321 2013-09-06 20:08:03Z theraven Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. .Pp It is a default setting on amd64/amd64, arm/arm, arm/armv6, i386/i386 and pc98/i386. .It Va WITH_GNUCXX -.\" from FreeBSD: stable/10/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven +.\" from FreeBSD: head/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven Build the GNU C++ stack (g++, libstdc++). This is the default on platforms where gcc is the system compiler. .Pp It is a default setting on arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GNU_SUPPORT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without optional GNU support. .It Va WITHOUT_GPIB -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GPIB 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIB 156932 2006-03-21 07:50:50Z ru Set to not build GPIB bus support. .It Va WITHOUT_GPIO -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GPIO 228081 2011-11-28 17:54:34Z dim +.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIO 228081 2011-11-28 17:54:34Z dim Set to not build .Xr gpioctl 8 as part of the base system. .It Va WITH_GPL_DTC -.\" from FreeBSD: stable/10/tools/build/options/WITH_GPL_DTC 246262 2013-02-02 22:42:46Z dim +.\" from FreeBSD: head/tools/build/options/WITH_GPL_DTC 246262 2013-02-02 22:42:46Z dim Set to build the GPL'd version of the device tree compiler from elinux.org, instead of the BSD licensed one. .It Va WITHOUT_GROFF -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs +.\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs Set to not build .Xr groff 1 and @@ -457,19 +461,19 @@ and You should consider installing the textproc/groff port to not break .Xr man 1 . .It Va WITHOUT_GSSAPI -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GSSAPI 174548 2007-12-12 16:39:32Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_GSSAPI 174548 2007-12-12 16:39:32Z ru Set to not build libgssapi. .It Va WITH_HESIOD -.\" from FreeBSD: stable/10/tools/build/options/WITH_HESIOD 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITH_HESIOD 156932 2006-03-21 07:50:50Z ru Set to build Hesiod support. .It Va WITHOUT_HTML -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_HTML 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_HTML 156932 2006-03-21 07:50:50Z ru Set to not build HTML docs. .It Va WITHOUT_ICONV -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ICONV 254919 2013-08-26 17:15:56Z antoine +.\" from FreeBSD: head/tools/build/options/WITHOUT_ICONV 254919 2013-08-26 17:15:56Z antoine Set to not build iconv as part of libc. .It Va WITHOUT_INET -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz +.\" from FreeBSD: head/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz Set to not build programs and libraries related to IPv4 networking. When set, it also enforces the following options: .Pp @@ -478,7 +482,7 @@ When set, it also enforces the following .Va WITHOUT_INET_SUPPORT .El .It Va WITHOUT_INET6 -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INET6 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_INET6 156932 2006-03-21 07:50:50Z ru Set to not build programs and libraries related to IPv6 networking. When set, it also enforces the following options: @@ -488,24 +492,24 @@ When set, it also enforces the following .Va WITHOUT_INET6_SUPPORT .El .It Va WITHOUT_INET6_SUPPORT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build libraries, programs, and kernel modules without IPv6 support. .It Va WITHOUT_INET_SUPPORT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz +.\" from FreeBSD: head/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz Set to build libraries, programs, and kernel modules without IPv4 support. .It Va WITHOUT_INFO -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INFO 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_INFO 156932 2006-03-21 07:50:50Z ru Set to not make or install .Xr info 5 files. .It Va WITHOUT_INSTALLLIB -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INSTALLLIB 174497 2007-12-09 21:56:21Z dougb +.\" from FreeBSD: head/tools/build/options/WITHOUT_INSTALLLIB 174497 2007-12-09 21:56:21Z dougb Set this if you do not want to install optional libraries. For example when creating a .Xr nanobsd 8 image. .It Va WITH_INSTALL_AS_USER -.\" from FreeBSD: stable/10/tools/build/options/WITH_INSTALL_AS_USER 238021 2012-07-02 20:24:01Z marcel +.\" from FreeBSD: head/tools/build/options/WITH_INSTALL_AS_USER 238021 2012-07-02 20:24:01Z marcel Set to make install targets succeed for non-root users by installing files with owner and group attributes set to that of the user running the @@ -515,13 +519,13 @@ The user still has to set the .Va DESTDIR variable to point to a directory where the user has write permissions. .It Va WITHOUT_IPFILTER -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_IPFILTER 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_IPFILTER 156932 2006-03-21 07:50:50Z ru Set to not build IP Filter package. .It Va WITHOUT_IPFW -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_IPFW 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_IPFW 183242 2008-09-21 22:02:26Z sam Set to not build IPFW tools. .It Va WITHOUT_IPX -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_IPX 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_IPX 156932 2006-03-21 07:50:50Z ru Set to not build programs and libraries related to IPX networking. When set, it also enforces the following options: .Pp @@ -530,20 +534,20 @@ When set, it also enforces the following .Va WITHOUT_IPX_SUPPORT .El .It Va WITHOUT_IPX_SUPPORT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_IPX_SUPPORT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_IPX_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without IPX support. .It Va WITHOUT_JAIL -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_JAIL 249966 2013-04-27 04:09:09Z eadler +.\" from FreeBSD: head/tools/build/options/WITHOUT_JAIL 249966 2013-04-27 04:09:09Z eadler Set to not build tools for the support of jails; e.g., .Xr jail 8 . .It Va WITHOUT_KDUMP -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KDUMP 240690 2012-09-19 11:38:37Z zeising +.\" from FreeBSD: head/tools/build/options/WITHOUT_KDUMP 240690 2012-09-19 11:38:37Z zeising Set to not build .Xr kdump 1 and .Xr truss 1 . .It Va WITHOUT_KERBEROS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KERBEROS 174549 2007-12-12 16:42:03Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS 174549 2007-12-12 16:42:03Z ru Set this if you do not want to build Kerberos 5 (KTH Heimdal). When set, it also enforces the following options: .Pp @@ -561,7 +565,7 @@ When set, the following options are also is set explicitly) .El .It Va WITHOUT_KERBEROS_SUPPORT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KERBEROS_SUPPORT 251794 2013-06-15 20:29:07Z eadler +.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS_SUPPORT 251794 2013-06-15 20:29:07Z eadler Set to build some programs without Kerberos support, like .Xr ssh 1 , .Xr telnet 1 , @@ -569,13 +573,13 @@ Set to build some programs without Kerbe and .Xr telnetd 8 . .It Va WITHOUT_KERNEL_SYMBOLS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KERNEL_SYMBOLS 222189 2011-05-22 18:23:17Z imp +.\" from FreeBSD: head/tools/build/options/WITHOUT_KERNEL_SYMBOLS 222189 2011-05-22 18:23:17Z imp Set to not install kernel symbol files. .Bf -symbolic This option is recommended for those people who have small root partitions. .Ef .It Va WITHOUT_KVM -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KVM 174550 2007-12-12 16:43:17Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_KVM 174550 2007-12-12 16:43:17Z ru Set to not build the .Nm libkvm library as a part of the base system. @@ -589,12 +593,12 @@ When set, it also enforces the following .Va WITHOUT_KVM_SUPPORT .El .It Va WITHOUT_KVM_SUPPORT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KVM_SUPPORT 170644 2007-06-13 02:08:04Z sepotvin +.\" from FreeBSD: head/tools/build/options/WITHOUT_KVM_SUPPORT 170644 2007-06-13 02:08:04Z sepotvin Set to build some programs without optional .Nm libkvm support. .It Va WITHOUT_LDNS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LDNS 255591 2013-09-15 13:11:13Z des +.\" from FreeBSD: head/tools/build/options/WITHOUT_LDNS 255591 2013-09-15 13:11:13Z des Setting this variable will prevent the LDNS library from being built. When set, it also enforces the following options: .Pp @@ -605,27 +609,27 @@ When set, it also enforces the following .Va WITHOUT_UNBOUND .El .It Va WITHOUT_LDNS_UTILS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LDNS_UTILS 255850 2013-09-24 14:33:31Z des +.\" from FreeBSD: head/tools/build/options/WITHOUT_LDNS_UTILS 255850 2013-09-24 14:33:31Z des Setting this variable will prevent building the LDNS utilities .Xr drill 1 and .Xr host 1 . .It Va WITHOUT_LEGACY_CONSOLE -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LEGACY_CONSOLE 249966 2013-04-27 04:09:09Z eadler +.\" from FreeBSD: head/tools/build/options/WITHOUT_LEGACY_CONSOLE 249966 2013-04-27 04:09:09Z eadler Set to not build programs that support a legacy PC console; e.g., .Xr kbdcontrol 8 and .Xr vidcontrol 8 . .It Va WITHOUT_LIB32 -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LIB32 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_LIB32 156932 2006-03-21 07:50:50Z ru On amd64, set to not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. -.It Va WITH_LIBCPLUSPLUS -.\" from FreeBSD: stable/10/tools/build/options/WITH_LIBCPLUSPLUS 228082 2011-11-28 17:56:46Z dim -Set to build libcxxrt and libc++. +.It Va WITHOUT_LIBCPLUSPLUS +.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBCPLUSPLUS 246262 2013-02-02 22:42:46Z dim +Set to avoid building libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm +.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm Set to not build the .Nm libpthread providing library, @@ -637,35 +641,35 @@ When set, it also enforces the following .Va WITHOUT_LIBTHR .El .It Va WITHOUT_LIBTHR -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LIBTHR 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBTHR 156932 2006-03-21 07:50:50Z ru Set to not build the .Nm libthr (1:1 threading) library. .It Va WITH_LLDB -.\" from FreeBSD: stable/10/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste +.\" from FreeBSD: head/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste Set to build the LLDB debugger. .It Va WITHOUT_LOCALES -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru Set to not build localization files; see .Xr locale 1 . .It Va WITHOUT_LOCATE -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LOCATE 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCATE 183242 2008-09-21 22:02:26Z sam Set to not build .Xr locate 1 and related programs. .It Va WITHOUT_LPR -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LPR 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_LPR 156932 2006-03-21 07:50:50Z ru Set to not build .Xr lpr 1 and related programs. .It Va WITHOUT_LS_COLORS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LS_COLORS 235660 2012-05-19 20:05:27Z marcel +.\" from FreeBSD: head/tools/build/options/WITHOUT_LS_COLORS 235660 2012-05-19 20:05:27Z marcel Set to build .Xr ls 1 without support for colors to distinguish file types. .It Va WITHOUT_MAIL -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_MAIL 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_MAIL 183242 2008-09-21 22:02:26Z sam Set to not build any mail support (MUA or MTA). When set, it also enforces the following options: .Pp @@ -676,17 +680,17 @@ When set, it also enforces the following .Va WITHOUT_SENDMAIL .El .It Va WITHOUT_MAILWRAPPER -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_MAILWRAPPER 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_MAILWRAPPER 156932 2006-03-21 07:50:50Z ru Set to not build the .Xr mailwrapper 8 MTA selector. .It Va WITHOUT_MAKE -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_MAKE 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_MAKE 183242 2008-09-21 22:02:26Z sam Set to not install .Xr make 1 and related support files. .It Va WITHOUT_MAN -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_MAN 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN 156932 2006-03-21 07:50:50Z ru Set to not build manual pages. When set, the following options are also in effect: .Pp @@ -697,7 +701,7 @@ When set, the following options are also is set explicitly) .El .It Va WITHOUT_MAN_UTILS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim +.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim Set to not build utilities for manual pages, .Xr apropos 1 , .Xr catman 1 , @@ -707,19 +711,24 @@ Set to not build utilities for manual pa .Xr manctl 8 , and related support files. .It Va WITH_NAND -.\" from FreeBSD: stable/10/tools/build/options/WITH_NAND 235537 2012-05-17 10:11:18Z gber +.\" from FreeBSD: head/tools/build/options/WITH_NAND 235537 2012-05-17 10:11:18Z gber Set to build the NAND Flash components. +.It Va WITHOUT_NCURSESW +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NCURSESW 262644 2014-03-01 03:11:26Z brooks +Set to not build or depend on the +.Nm libncursesw +library. .It Va WITHOUT_NDIS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NDIS 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_NDIS 183242 2008-09-21 22:02:26Z sam Set to not build programs and libraries related to NDIS emulation support. .It Va WITHOUT_NETCAT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NETCAT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_NETCAT 156932 2006-03-21 07:50:50Z ru Set to not build .Xr nc 1 utility. .It Va WITHOUT_NETGRAPH -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NETGRAPH 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_NETGRAPH 183242 2008-09-21 22:02:26Z sam Set to not build applications to support .Xr netgraph 4 . When set, it also enforces the following options: @@ -733,10 +742,10 @@ When set, it also enforces the following .Va WITHOUT_NETGRAPH_SUPPORT .El .It Va WITHOUT_NETGRAPH_SUPPORT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NETGRAPH_SUPPORT 183305 2008-09-23 16:11:15Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_NETGRAPH_SUPPORT 183305 2008-09-23 16:11:15Z sam Set to build libraries, programs, and kernel modules without netgraph support. .It Va WITHOUT_NIS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NIS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_NIS 156932 2006-03-21 07:50:50Z ru Set to not build .Xr NIS 8 support and related programs. @@ -746,10 +755,10 @@ and remove .Sq nis entries. .It Va WITHOUT_NLS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NLS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_NLS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalogs. .It Va WITHOUT_NLS_CATALOGS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalog support for .Xr csh 1 . .It Va WITHOUT_NMTREE @@ -763,7 +772,7 @@ By default is installed as .Xr mtree 8 . .It Va WITHOUT_NS_CACHING -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru Set to disable name caching in the .Pa nsswitch subsystem. @@ -771,20 +780,20 @@ The generic caching daemon, .Xr nscd 8 , will not be built either if this option is set. .It Va WITHOUT_NTP -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NTP 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_NTP 183242 2008-09-21 22:02:26Z sam Set to not build .Xr ntpd 8 and related programs. .It Va WITH_OFED -.\" from FreeBSD: stable/10/tools/build/options/WITH_OFED 228081 2011-11-28 17:54:34Z dim +.\" from FreeBSD: head/tools/build/options/WITH_OFED 228081 2011-11-28 17:54:34Z dim Set to build the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack. .It Va WITHOUT_OPENSSH -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSH. .It Va WITH_OPENSSH_NONE_CIPHER -.\" from FreeBSD: stable/10/tools/build/options/WITH_OPENSSH_NONE_CIPHER 245527 2013-01-17 01:51:04Z bz +.\" from FreeBSD: head/tools/build/options/WITH_OPENSSH_NONE_CIPHER 245527 2013-01-17 01:51:04Z bz Set to include the "None" cipher support in OpenSSH and its libraries. Additional adjustments may need to be done to system configuration files, such as @@ -794,7 +803,7 @@ Please see .Pa /usr/src/crypto/openssh/README.hpn for full details. .It Va WITHOUT_OPENSSL -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSL. When set, it also enforces the following options: .Pp @@ -816,7 +825,7 @@ When set, the following options are also is set explicitly) .El .It Va WITHOUT_PAM -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PAM 174550 2007-12-12 16:43:17Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_PAM 174550 2007-12-12 16:43:17Z ru Set to not build PAM library and modules. .Bf -symbolic This option is deprecated and does nothing. @@ -828,18 +837,18 @@ When set, it also enforces the following .Va WITHOUT_PAM_SUPPORT .El .It Va WITHOUT_PAM_SUPPORT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PAM_SUPPORT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_PAM_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without PAM support, particularly .Xr ftpd 8 and .Xr ppp 8 . .It Va WITHOUT_PC_SYSINSTALL -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PC_SYSINSTALL 245606 2013-01-18 15:57:09Z eadler +.\" from FreeBSD: head/tools/build/options/WITHOUT_PC_SYSINSTALL 245606 2013-01-18 15:57:09Z eadler Set to not build .Xr pc-sysinstall 8 and related programs. .It Va WITHOUT_PF -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PF 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_PF 156932 2006-03-21 07:50:50Z ru Set to not build PF firewall package. When set, it also enforces the following options: .Pp @@ -853,35 +862,35 @@ Set to not build .Xr pkg 7 bootstrap tool. .It Va WITH_PKGTOOLS -.\" from FreeBSD: stable/10/tools/build/options/WITH_PKGTOOLS 253305 2013-07-12 23:11:17Z bapt +.\" from FreeBSD: head/tools/build/options/WITH_PKGTOOLS 253305 2013-07-12 23:11:17Z bapt Set to build .Xr pkg_add 8 and related programs. .It Va WITHOUT_PMC -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PMC 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_PMC 183242 2008-09-21 22:02:26Z sam Set to not build .Xr pmccontrol 8 and related programs. .It Va WITHOUT_PORTSNAP -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PORTSNAP 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_PORTSNAP 183242 2008-09-21 22:02:26Z sam Set to not build or install .Xr portsnap 8 and related files. .It Va WITHOUT_PPP -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PPP 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_PPP 183242 2008-09-21 22:02:26Z sam Set to not build .Xr ppp 8 and related programs. .It Va WITHOUT_PROFILE -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PROFILE 228196 2011-12-02 09:09:54Z fjoe +.\" from FreeBSD: head/tools/build/options/WITHOUT_PROFILE 228196 2011-12-02 09:09:54Z fjoe Set to avoid compiling profiled libraries. .It Va WITHOUT_QUOTAS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_QUOTAS 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_QUOTAS 183242 2008-09-21 22:02:26Z sam Set to not build .Xr quota 8 and related programs. .It Va WITHOUT_RCMDS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_RCMDS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_RCMDS 156932 2006-03-21 07:50:50Z ru Disable building of the .Bx r-commands. @@ -890,43 +899,43 @@ This includes .Xr rsh 1 , etc. .It Va WITHOUT_RCS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_RCS 256198 2013-10-09 17:07:20Z gjb +.\" from FreeBSD: head/tools/build/options/WITHOUT_RCS 256198 2013-10-09 17:07:20Z gjb Set to not build .Xr rcs 1 and related utilities. .It Va WITHOUT_RESCUE -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_RESCUE 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_RESCUE 156932 2006-03-21 07:50:50Z ru Set to not build .Xr rescue 8 . .It Va WITHOUT_ROUTED -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ROUTED 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_ROUTED 183242 2008-09-21 22:02:26Z sam Set to not build .Xr routed 8 utility. .It Va WITHOUT_SENDMAIL -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SENDMAIL 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_SENDMAIL 156932 2006-03-21 07:50:50Z ru Set to not build .Xr sendmail 8 and related programs. .It Va WITHOUT_SETUID_LOGIN -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SETUID_LOGIN 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_SETUID_LOGIN 156932 2006-03-21 07:50:50Z ru Set this to disable the installation of .Xr login 1 as a set-user-ID root program. .It Va WITHOUT_SHAREDOCS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SHAREDOCS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_SHAREDOCS 156932 2006-03-21 07:50:50Z ru Set to not build the .Bx 4.4 legacy docs. .It Va WITH_SHARED_TOOLCHAIN -.\" from FreeBSD: stable/10/tools/build/options/WITH_SHARED_TOOLCHAIN 235342 2012-05-12 16:12:36Z gjb +.\" from FreeBSD: head/tools/build/options/WITH_SHARED_TOOLCHAIN 235342 2012-05-12 16:12:36Z gjb Set to build the toolchain binaries shared. The set includes .Xr cc 1 , .Xr make 1 and necessary utilities like assembler, linker and library archive manager. .It Va WITHOUT_SOURCELESS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SOURCELESS 230972 2012-02-04 00:54:43Z rmh +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS 230972 2012-02-04 00:54:43Z rmh Set to not build kernel modules that include sourceless code (either microcode or native code for host CPU). When set, it also enforces the following options: .Pp @@ -937,51 +946,51 @@ When set, it also enforces the following .Va WITHOUT_SOURCELESS_UCODE .El .It Va WITHOUT_SOURCELESS_HOST -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SOURCELESS_HOST 230972 2012-02-04 00:54:43Z rmh +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_HOST 230972 2012-02-04 00:54:43Z rmh Set to not build kernel modules that include sourceless native code for host CPU. .It Va WITHOUT_SOURCELESS_UCODE -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SOURCELESS_UCODE 230972 2012-02-04 00:54:43Z rmh +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_UCODE 230972 2012-02-04 00:54:43Z rmh Set to not build kernel modules that include sourceless microcode. .It Va WITHOUT_SSP -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru Set to not build world with propolice stack smashing protection. .It Va WITH_SVN -.\" from FreeBSD: stable/10/tools/build/options/WITH_SVN 252561 2013-07-03 12:36:47Z zeising +.\" from FreeBSD: head/tools/build/options/WITH_SVN 252561 2013-07-03 12:36:47Z zeising Set to install .Xr svnlite 1 as .Xr svn 1 . .It Va WITHOUT_SVNLITE -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SVNLITE 252561 2013-07-03 12:36:47Z zeising +.\" from FreeBSD: head/tools/build/options/WITHOUT_SVNLITE 252561 2013-07-03 12:36:47Z zeising Set to not build .Xr svnlite 1 and related programs. .It Va WITHOUT_SYMVER -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SYMVER 169649 2007-05-17 05:03:24Z deischen +.\" from FreeBSD: head/tools/build/options/WITHOUT_SYMVER 169649 2007-05-17 05:03:24Z deischen Set to disable symbol versioning when building shared libraries. .It Va WITHOUT_SYSCONS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SYSCONS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSCONS 156932 2006-03-21 07:50:50Z ru Set to not build .Xr syscons 4 support files such as keyboard maps, fonts, and screen output maps. .It Va WITHOUT_SYSINSTALL -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SYSINSTALL 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSINSTALL 183242 2008-09-21 22:02:26Z sam Set to not build .Xr sysinstall 8 and related programs. .It Va WITHOUT_TCSH -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TCSH 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_TCSH 156932 2006-03-21 07:50:50Z ru Set to not build and install .Pa /bin/csh (which is .Xr tcsh 1 ) . .It Va WITHOUT_TELNET -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TELNET 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_TELNET 183242 2008-09-21 22:02:26Z sam Set to not build .Xr telnet 8 and related programs. .It Va WITHOUT_TEXTPROC -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TEXTPROC 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_TEXTPROC 183242 2008-09-21 22:02:26Z sam Set to not build programs used for text processing. When set, it also enforces the following options: @@ -991,7 +1000,7 @@ When set, it also enforces the following .Va WITHOUT_GROFF .El .It Va WITHOUT_TOOLCHAIN -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TOOLCHAIN 174550 2007-12-12 16:43:17Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_TOOLCHAIN 174550 2007-12-12 16:43:17Z ru Set to not install programs used for program development, compilers, debuggers etc. @@ -1015,18 +1024,18 @@ When set, it also enforces the following .Va WITHOUT_GDB .El .It Va WITHOUT_UNBOUND -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_UNBOUND 255597 2013-09-15 14:51:23Z des +.\" from FreeBSD: head/tools/build/options/WITHOUT_UNBOUND 255597 2013-09-15 14:51:23Z des Set to not build .Xr unbound 8 and related programs. .It Va WITHOUT_USB -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_USB 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_USB 156932 2006-03-21 07:50:50Z ru Set to not build USB-related programs and libraries. .It Va WITH_USB_GADGET_EXAMPLES -.\" from FreeBSD: stable/10/tools/build/options/WITH_USB_GADGET_EXAMPLES 254919 2013-08-26 17:15:56Z antoine +.\" from FreeBSD: head/tools/build/options/WITH_USB_GADGET_EXAMPLES 254919 2013-08-26 17:15:56Z antoine Set to build USB gadget kernel modules. .It Va WITHOUT_UTMPX -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_UTMPX 231530 2012-02-11 20:28:42Z ed +.\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 231530 2012-02-11 20:28:42Z ed Set to not build user accounting tools such as .Xr last 1 , .Xr users 1 , @@ -1036,7 +1045,7 @@ Set to not build user accounting tools s and .Xr utx 8 . .It Va WITHOUT_WIRELESS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_WIRELESS 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_WIRELESS 183242 2008-09-21 22:02:26Z sam Set to not build programs used for 802.11 wireless networks; especially .Xr wpa_supplicant 8 and @@ -1048,21 +1057,21 @@ When set, it also enforces the following .Va WITHOUT_WIRELESS_SUPPORT .El .It Va WITHOUT_WIRELESS_SUPPORT -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_WIRELESS_SUPPORT 183305 2008-09-23 16:11:15Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_WIRELESS_SUPPORT 183305 2008-09-23 16:11:15Z sam Set to build libraries, programs, and kernel modules without 802.11 wireless support. .It Va WITHOUT_WPA_SUPPLICANT_EAPOL -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_WPA_SUPPLICANT_EAPOL 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_WPA_SUPPLICANT_EAPOL 156932 2006-03-21 07:50:50Z ru Build .Xr wpa_supplicant 8 without support for the IEEE 802.1X protocol and without support for EAP-PEAP, EAP-TLS, EAP-LEAP, and EAP-TTLS protocols (usable only via 802.1X). .It Va WITHOUT_ZFS -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ZFS 168409 2007-04-06 02:13:30Z pjd +.\" from FreeBSD: head/tools/build/options/WITHOUT_ZFS 168409 2007-04-06 02:13:30Z pjd Set to not build ZFS file system. .It Va WITHOUT_ZONEINFO -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ZONEINFO 235342 2012-05-12 16:12:36Z gjb *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 04:49:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EDDF244E; Sat, 1 Mar 2014 04:49: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D925614A7; Sat, 1 Mar 2014 04:49: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 s214ntuM070940; Sat, 1 Mar 2014 04:49:55 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s214ntOC070939; Sat, 1 Mar 2014 04:49:55 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201403010449.s214ntOC070939@svn.freebsd.org> From: Brooks Davis Date: Sat, 1 Mar 2014 04:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262652 - stable/10/tools/tools/makeroot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 04:49:56 -0000 Author: brooks Date: Sat Mar 1 04:49:55 2014 New Revision: 262652 URL: http://svnweb.freebsd.org/changeset/base/262652 Log: MFC r261302: The -B flag is intended to take an argument. Fix a couple typos in comments. Sponsored by: DARPA, AFRL Modified: stable/10/tools/tools/makeroot/makeroot.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/makeroot/makeroot.sh ============================================================================== --- stable/10/tools/tools/makeroot/makeroot.sh Sat Mar 1 04:44:33 2014 (r262651) +++ stable/10/tools/tools/makeroot/makeroot.sh Sat Mar 1 04:49:55 2014 (r262652) @@ -65,7 +65,7 @@ atexit() } DEBUG= -# Allow duplice manifest entries when not file list is given because the +# Allow duplicate manifest entries when not file list is given because the # FreeBSD METALOG still includes it. DUPFLAG=-D EXTRAS= @@ -75,7 +75,7 @@ KEYDIR= KEYUSERS= PASSWD= -while getopts "Bde:f:g:K:k:p:s:" opt; do +while getopts "B:de:f:g:K:k:p:s:" opt; do case "$opt" in B) BFLAG="-B ${OPTARG}" ;; d) DEBUG=1 ;; @@ -174,7 +174,7 @@ else / type=/ { if ($1 != file) {print} }' >> ${manifest} fi -# For each extras file, add contents kyes relative to the directory the +# For each extras file, add contents keys relative to the directory the # manifest lives in for each file line that does not have one. Adjust # contents keys relative to ./ to be relative to the same directory. for eman in ${EXTRAS}; do From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 13:00:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2BBF7D08; Sat, 1 Mar 2014 13:00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 160AA12D1; Sat, 1 Mar 2014 13:00: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 s21D0eK4068261; Sat, 1 Mar 2014 13:00:40 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21D0eO7068258; Sat, 1 Mar 2014 13:00:40 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201403011300.s21D0eO7068258@svn.freebsd.org> From: Tijl Coosemans Date: Sat, 1 Mar 2014 13:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262654 - in stable/10/usr.sbin: mtree nmtree X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 13:00:41 -0000 Author: tijl Date: Sat Mar 1 13:00:40 2014 New Revision: 262654 URL: http://svnweb.freebsd.org/changeset/base/262654 Log: Revert r262648 to stop severe tinderbox spamming on stable@. Added: stable/10/usr.sbin/mtree/mtree.5 - copied unchanged from r262647, stable/10/usr.sbin/mtree/mtree.5 Deleted: stable/10/usr.sbin/nmtree/mtree.5 Modified: stable/10/usr.sbin/mtree/Makefile stable/10/usr.sbin/nmtree/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mtree/Makefile ============================================================================== --- stable/10/usr.sbin/mtree/Makefile Sat Mar 1 10:04:31 2014 (r262653) +++ stable/10/usr.sbin/mtree/Makefile Sat Mar 1 13:00:40 2014 (r262654) @@ -6,7 +6,7 @@ .PATH: ${.CURDIR}/../../usr.bin/cksum PROG= fmtree -MAN= fmtree.8 +MAN= fmtree.8 mtree.5 SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c verify.c SRCS+= specspec.c Copied: stable/10/usr.sbin/mtree/mtree.5 (from r262647, stable/10/usr.sbin/mtree/mtree.5) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/mtree/mtree.5 Sat Mar 1 13:00:40 2014 (r262654, copy of r262647, stable/10/usr.sbin/mtree/mtree.5) @@ -0,0 +1,271 @@ +.\" Copyright (c) 1989, 1990, 1993 +.\" The Regents of the University of California. 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. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" From: @(#)mtree.8 8.2 (Berkeley) 12/11/93 +.\" $FreeBSD$ +.\" +.Dd December 31, 2007 +.Dt MTREE 5 +.Os +.Sh NAME +.Nm mtree +.Nd format of mtree dir hierarchy files +.Sh DESCRIPTION +The +.Nm +format is a textual format that describes a collection of filesystem objects. +Such files are typically used to create or verify directory hierarchies. +.Ss General Format +An +.Nm +file consists of a series of lines, each providing information +about a single filesystem object. +Leading whitespace is always ignored. +.Pp +When encoding file or pathnames, any backslash character or +character outside of the 95 printable ASCII characters must be +encoded as a backslash followed by three +octal digits. +When reading mtree files, any appearance of a backslash +followed by three octal digits should be converted into the +corresponding character. +.Pp +Each line is interpreted independently as one of the following types: +.Bl -tag -width Cm +.It Signature +The first line of any mtree file must begin with +.Dq #mtree . +If a file contains any full path entries, the first line should +begin with +.Dq #mtree v2.0 , +otherwise, the first line should begin with +.Dq #mtree v1.0 . +.It Blank +Blank lines are ignored. +.It Comment +Lines beginning with +.Cm # +are ignored. +.It Special +Lines beginning with +.Cm / +are special commands that influence +the interpretation of later lines. +.It Relative +If the first whitespace-delimited word has no +.Cm / +characters, +it is the name of a file in the current directory. +Any relative entry that describes a directory changes the +current directory. +.It dot-dot +As a special case, a relative entry with the filename +.Pa .. +changes the current directory to the parent directory. +Options on dot-dot entries are always ignored. +.It Full +If the first whitespace-delimited word has a +.Cm / +character after +the first character, it is the pathname of a file relative to the +starting directory. +There can be multiple full entries describing the same file. +.El +.Pp +Some tools that process +.Nm +files may require that multiple lines describing the same file +occur consecutively. +It is not permitted for the same file to be mentioned using +both a relative and a full file specification. +.Ss Special commands +Two special commands are currently defined: +.Bl -tag -width Cm +.It Cm /set +This command defines default values for one or more keywords. +It is followed on the same line by one or more whitespace-separated +keyword definitions. +These definitions apply to all following files that do not specify +a value for that keyword. +.It Cm /unset +This command removes any default value set by a previous +.Cm /set +command. +It is followed on the same line by one or more keywords +separated by whitespace. +.El +.Ss Keywords +After the filename, a full or relative entry consists of zero +or more whitespace-separated keyword definitions. +Each such definitions consists of a key from the following +list immediately followed by an '=' sign +and a value. +Software programs reading mtree files should warn about +unrecognized keywords. +.Pp +Currently supported keywords are as follows: +.Bl -tag -width Cm +.It Cm cksum +The checksum of the file using the default algorithm specified by +the +.Xr cksum 1 +utility. +.It Cm contents +The full pathname of a file whose contents should be +compared to the contents of this file. +.It Cm flags +The file flags as a symbolic name. +See +.Xr chflags 1 +for information on these names. +If no flags are to be set the string +.Dq none +may be used to override the current default. +.It Cm ignore +Ignore any file hierarchy below this file. +.It Cm gid +The file group as a numeric value. +.It Cm gname +The file group as a symbolic name. +.It Cm md5 +The MD5 message digest of the file. +.It Cm md5digest +A synonym for +.Cm md5 . +.It Cm sha1 +The +.Tn FIPS +160-1 +.Pq Dq Tn SHA-1 +message digest of the file. +.It Cm sha1digest +A synonym for +.Cm sha1 . +.It Cm sha256 +The +.Tn FIPS +180-2 +.Pq Dq Tn SHA-256 +message digest of the file. +.It Cm sha256digest +A synonym for +.Cm sha256 . +.It Cm ripemd160digest +The +.Tn RIPEMD160 +message digest of the file. +.It Cm rmd160 +A synonym for +.Cm ripemd160digest . +.It Cm rmd160digest +A synonym for +.Cm ripemd160digest . +.It Cm mode +The current file's permissions as a numeric (octal) or symbolic +value. +.It Cm nlink +The number of hard links the file is expected to have. +.It Cm nochange +Make sure this file or directory exists but otherwise ignore all attributes. +.It Cm uid +The file owner as a numeric value. +.It Cm uname +The file owner as a symbolic name. +.It Cm size +The size, in bytes, of the file. +.It Cm link +The file the symbolic link is expected to reference. +.It Cm time +The last modification time of the file, in seconds and nanoseconds. +The value should include a period character and exactly nine digits +after the period. +.It Cm type +The type of the file; may be set to any one of the following: +.Pp +.Bl -tag -width Cm -compact +.It Cm block +block special device +.It Cm char +character special device +.It Cm dir +directory +.It Cm fifo +fifo +.It Cm file +regular file +.It Cm link +symbolic link +.It Cm socket +socket +.El +.El +.Sh SEE ALSO +.Xr cksum 1 , +.Xr find 1 , +.Xr mtree 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Bx 4.3 Reno . +The +.Tn MD5 +digest capability was added in +.Fx 2.1 , +in response to the widespread use of programs which can spoof +.Xr cksum 1 . +The +.Tn SHA-1 +and +.Tn RIPEMD160 +digests were added in +.Fx 4.0 , +as new attacks have demonstrated weaknesses in +.Tn MD5 . +The +.Tn SHA-256 +digest was added in +.Fx 6.0 . +Support for file flags was added in +.Fx 4.0 , +and mostly comes from +.Nx . +The +.Dq full +entry format was added by +.Nx . +.Sh BUGS +The +.Fx +implementation of mtree does not currently support +the +.Nm +2.0 +format. +The requirement for a +.Dq #mtree +signature line is new and not yet widely implemented. Modified: stable/10/usr.sbin/nmtree/Makefile ============================================================================== --- stable/10/usr.sbin/nmtree/Makefile Sat Mar 1 10:04:31 2014 (r262653) +++ stable/10/usr.sbin/nmtree/Makefile Sat Mar 1 13:00:40 2014 (r262654) @@ -4,8 +4,8 @@ .PATH: ${.CURDIR}/../../contrib/mtree -PROG= mtree -MAN= mtree.5 mtree.8 +PROG= nmtree +MAN= nmtree.8 SRCS= compare.c crc.c create.c excludes.c getid.c misc.c mtree.c \ only.c spec.c specspec.c verify.c LDADD+= -lmd -lutil From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 13:02:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7FED7E5A; Sat, 1 Mar 2014 13:02:42 +0000 (UTC) Received: from mailrelay008.isp.belgacom.be (mailrelay008.isp.belgacom.be [195.238.6.174]) by mx1.freebsd.org (Postfix) with ESMTP id 6953712EA; Sat, 1 Mar 2014 13:02:41 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmQGAAvaEVNR8Zjl/2dsb2JhbABYgwY7S8EpgRIXdIIlAQEFOhwjEAsUBAklDyoeBhOHfQEIy1kXjlUHhDgBA5g7gTOQeYMuOw Received: from 229.152-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.152.229]) by relay.skynet.be with ESMTP; 01 Mar 2014 14:02:34 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s21D2Wir003790; Sat, 1 Mar 2014 14:02:32 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sat, 1 Mar 2014 14:02:32 +0100 From: Tijl Coosemans To: Brooks Davis Subject: Re: svn commit: r262648 - in stable/10/usr.sbin: mtree nmtree Message-ID: <20140301140232.0c60d827@kalimero.tijl.coosemans.org> In-Reply-To: <201403010339.s213dum7042965@svn.freebsd.org> References: <201403010339.s213dum7042965@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 13:02:42 -0000 On Sat, 1 Mar 2014 03:39:56 +0000 (UTC) Brooks Davis wrote: > Author: brooks > Date: Sat Mar 1 03:39:56 2014 > New Revision: 262648 > URL: http://svnweb.freebsd.org/changeset/base/262648 > > Log: > MFC: 261298 > Merge from CheriBSD: > commit 70b8f0c127db6b80411789d237b403cc64a93573 > Author: Brooks Davis > Date: Mon Jan 27 22:53:57 2014 +0000 > > Move mtree.5 to usr.sbin/nmtree. > Remove note that mtree 2.0 format files aren't supported. > > Sponsored by: DARPA, AFRL This broke stable and caused a flood of tinderbox emails on stable@ so I've reverted this for now. From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 14:44:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6FE3785A; Sat, 1 Mar 2014 14:44: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58EC41DA0; Sat, 1 Mar 2014 14:44: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 s21EiuHF009947; Sat, 1 Mar 2014 14:44:56 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21Eit6U009941; Sat, 1 Mar 2014 14:44:55 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201403011444.s21Eit6U009941@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 1 Mar 2014 14:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262656 - in stable/10: contrib/groff/tmac gnu/usr.bin/groff/tmac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 14:44:56 -0000 Author: uqs Date: Sat Mar 1 14:44:55 2014 New Revision: 262656 URL: http://svnweb.freebsd.org/changeset/base/262656 Log: MFH r261319,261345,261742 mdoc changes to stable/10 Modified: stable/10/contrib/groff/tmac/doc-common stable/10/contrib/groff/tmac/doc-syms stable/10/contrib/groff/tmac/doc.tmac stable/10/contrib/groff/tmac/groff_mdoc.man stable/10/gnu/usr.bin/groff/tmac/mdoc.local Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/groff/tmac/doc-common ============================================================================== --- stable/10/contrib/groff/tmac/doc-common Sat Mar 1 13:23:52 2014 (r262655) +++ stable/10/contrib/groff/tmac/doc-common Sat Mar 1 14:44:55 2014 (r262656) @@ -37,6 +37,7 @@ . .nr %A 1 .nr %B 1 +.nr %C 1 .nr %D 1 .nr %I 1 .nr %J 1 @@ -484,7 +485,15 @@ .ds doc-operating-system-NetBSD-5.0.1 5.0.1 .ds doc-operating-system-NetBSD-5.0.2 5.0.2 .ds doc-operating-system-NetBSD-5.1 5.1 +.ds doc-operating-system-NetBSD-5.1.2 5.1.2 +.ds doc-operating-system-NetBSD-5.1.3 5.1.3 +.ds doc-operating-system-NetBSD-5.2 5.2 +.ds doc-operating-system-NetBSD-5.2.1 5.2.1 .ds doc-operating-system-NetBSD-6.0 6.0 +.ds doc-operating-system-NetBSD-6.0.1 6.0.1 +.ds doc-operating-system-NetBSD-6.0.2 6.0.2 +.ds doc-operating-system-NetBSD-6.0.3 6.0.3 +.ds doc-operating-system-NetBSD-6.1 6.1 . .ds doc-operating-system-OpenBSD-2.0 2.0 .ds doc-operating-system-OpenBSD-2.1 2.1 @@ -517,6 +526,10 @@ .ds doc-operating-system-OpenBSD-4.8 4.8 .ds doc-operating-system-OpenBSD-4.9 4.9 .ds doc-operating-system-OpenBSD-5.0 5.0 +.ds doc-operating-system-OpenBSD-5.1 5.1 +.ds doc-operating-system-OpenBSD-5.2 5.2 +.ds doc-operating-system-OpenBSD-5.3 5.3 +.ds doc-operating-system-OpenBSD-5.4 5.4 . .ds doc-operating-system-FreeBSD-1.0 1.0 .ds doc-operating-system-FreeBSD-1.1 1.1 @@ -535,6 +548,7 @@ .ds doc-operating-system-FreeBSD-2.2.6 2.2.6 .ds doc-operating-system-FreeBSD-2.2.7 2.2.7 .ds doc-operating-system-FreeBSD-2.2.8 2.2.8 +.ds doc-operating-system-FreeBSD-2.2.9 2.2.9 .ds doc-operating-system-FreeBSD-3.0 3.0 .ds doc-operating-system-FreeBSD-3.1 3.1 .ds doc-operating-system-FreeBSD-3.2 3.2 @@ -575,6 +589,7 @@ .ds doc-operating-system-FreeBSD-8.1 8.1 .ds doc-operating-system-FreeBSD-8.2 8.2 .ds doc-operating-system-FreeBSD-9.0 9.0 +.ds doc-operating-system-FreeBSD-10.0 10.0 . .ds doc-operating-system-Darwin-8.0.0 8.0.0 .ds doc-operating-system-Darwin-8.1.0 8.1.0 @@ -613,21 +628,37 @@ .ds doc-operating-system-DragonFly-1.4 1.4 .ds doc-operating-system-DragonFly-1.5 1.5 .ds doc-operating-system-DragonFly-1.6 1.6 +.ds doc-operating-system-DragonFly-1.7 1.7 .ds doc-operating-system-DragonFly-1.8 1.8 .ds doc-operating-system-DragonFly-1.8.1 1.8.1 +.ds doc-operating-system-DragonFly-1.9 1.9 .ds doc-operating-system-DragonFly-1.10 1.10 +.ds doc-operating-system-DragonFly-1.11 1.11 .ds doc-operating-system-DragonFly-1.12 1.12 .ds doc-operating-system-DragonFly-1.12.2 1.12.2 +.ds doc-operating-system-DragonFly-1.13 1.13 .ds doc-operating-system-DragonFly-2.0 2.0 +.ds doc-operating-system-DragonFly-2.1 2.1 .ds doc-operating-system-DragonFly-2.2 2.2 +.ds doc-operating-system-DragonFly-2.3 2.3 .ds doc-operating-system-DragonFly-2.4 2.4 +.ds doc-operating-system-DragonFly-2.5 2.5 .ds doc-operating-system-DragonFly-2.6 2.6 +.ds doc-operating-system-DragonFly-2.7 2.7 .ds doc-operating-system-DragonFly-2.8 2.8 .ds doc-operating-system-DragonFly-2.9 2.9 .ds doc-operating-system-DragonFly-2.9.1 2.9.1 .ds doc-operating-system-DragonFly-2.10 2.10 .ds doc-operating-system-DragonFly-2.10.1 2.10.1 .ds doc-operating-system-DragonFly-2.11 2.11 +.ds doc-operating-system-DragonFly-3.0 3.0 +.ds doc-operating-system-DragonFly-3.1 3.1 +.ds doc-operating-system-DragonFly-3.2 3.2 +.ds doc-operating-system-DragonFly-3.3 3.3 +.ds doc-operating-system-DragonFly-3.4 3.4 +.ds doc-operating-system-DragonFly-3.5 3.5 +.ds doc-operating-system-DragonFly-3.6 3.6 +.ds doc-operating-system-DragonFly-3.7 3.7 . .de Os . ds doc-command-name Modified: stable/10/contrib/groff/tmac/doc-syms ============================================================================== --- stable/10/contrib/groff/tmac/doc-syms Sat Mar 1 13:23:52 2014 (r262655) +++ stable/10/contrib/groff/tmac/doc-syms Sat Mar 1 14:44:55 2014 (r262656) @@ -812,7 +812,6 @@ .ds doc-str-Lb-librpcsec_gss RPC GSS-API Authentication Library (librpcsec_gss, \-lrpcsec_gss) .ds doc-str-Lb-librpcsvc RPC Service Library (librpcsvc, \-lrpcsvc) .ds doc-str-Lb-librt \*[Px] \*[doc-str-Lb]Real-time Library (librt, \-lrt) -.ds doc-str-Lb-libsbuf Safe String Composition Library (libsbuf, \-lsbuf) .ds doc-str-Lb-libsdp Bluetooth Service Discovery Protocol User Library (libsdp, \-lsdp) .ds doc-str-Lb-libssp Buffer Overflow Protection Library (libssp, \-lssp) .ds doc-str-Lb-libSystem System Library (libSystem, \-lSystem) Modified: stable/10/contrib/groff/tmac/doc.tmac ============================================================================== --- stable/10/contrib/groff/tmac/doc.tmac Sat Mar 1 13:23:52 2014 (r262655) +++ stable/10/contrib/groff/tmac/doc.tmac Sat Mar 1 14:44:55 2014 (r262656) @@ -3423,6 +3423,8 @@ . . nr doc-book-count-saved \n[doc-book-count] . ds doc-book-name-saved "\*[doc-book-name] +. nr doc-city-count-saved \n[doc-city-count] +. ds doc-city-name-saved "\*[doc-city-name] . nr doc-date-count-saved \n[doc-date-count] . ds doc-date-saved "\*[doc-date] . nr doc-publisher-count-saved \n[doc-publisher-count] @@ -3565,6 +3567,8 @@ . . nr doc-book-count \n[doc-book-count-saved] . ds doc-book-name "\*[doc-book-name-saved] +. nr doc-city-count \n[doc-city-count-saved] +. ds doc-city-name "\*[doc-city-name-saved] . nr doc-date-count \n[doc-date-count-saved] . ds doc-date "\*[doc-date-saved] . nr doc-publisher-count \n[doc-publisher-count-saved] @@ -5190,6 +5194,8 @@ .\" NS doc-author-nameXXX .\" NS doc-book-count .\" NS doc-book-name +.\" NS doc-city-count +.\" NS doc-city-name .\" NS doc-corporate-count .\" NS doc-corporate-name .\" NS doc-date @@ -5228,6 +5234,7 @@ . nr doc-reference-title-count 0 . nr doc-url-count 0 . nr doc-volume-count 0 +. nr doc-city-count 0 . nr doc-date-count 0 . nr doc-page-number-count 0 . nr doc-book-count 0 @@ -5243,6 +5250,7 @@ . ds doc-reference-title-name-for-book . ds doc-url-name . ds doc-volume-name +. ds doc-city-name . ds doc-date . ds doc-page-number-string . ds doc-book-name @@ -5357,6 +5365,13 @@ . doc-finish-reference \n[doc-corporate-count] . \} . +. if \n[doc-city-count] \{\ +. unformat doc-city-name +. chop doc-city-name +. nop \*[doc-city-name]\c +. doc-finish-reference \n[doc-city-count] +. \} +. . if \n[doc-date-count] \{\ . unformat doc-date . chop doc-date @@ -5528,6 +5543,60 @@ .. . . +.\" NS doc-city-count global register +.\" NS counter of city references +. +.nr doc-city-count 0 +. +. +.\" NS doc-city-name global box +.\" NS string of collected city references +. +.ds doc-city-name +. +. +.\" NS %C user macro +.\" NS [reference] city +.\" NS +.\" NS modifies: +.\" NS doc-arg-ptr +.\" NS doc-curr-font +.\" NS doc-curr-size +.\" NS doc-city-count +.\" NS doc-macro-name +.\" NS doc-reference-count +.\" NS +.\" NS local variables: +.\" NS doc-env-%C +.\" NS +.\" NS width register `%C' set in doc-common +. +.de %C +. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\ +. tm Usage: .%C city_name ... (#\n[.c]) +. return +. \} +. +. nr doc-city-count +1 +. nr doc-reference-count +1 +. +. ds doc-macro-name %C +. doc-parse-args \$@ +. +. nr doc-arg-ptr +1 +. nr doc-curr-font \n[.f] +. nr doc-curr-size \n[.ps] +. +. \" append to reference box +. boxa doc-city-name +. ev doc-env-%C +. evc 0 +. in 0 +. nf +. doc-do-references +.. +. +. .\" NS doc-date-count global register .\" NS counter of date references . Modified: stable/10/contrib/groff/tmac/groff_mdoc.man ============================================================================== --- stable/10/contrib/groff/tmac/groff_mdoc.man Sat Mar 1 13:23:52 2014 (r262655) +++ stable/10/contrib/groff/tmac/groff_mdoc.man Sat Mar 1 14:44:55 2014 (r262656) @@ -1,3 +1,4 @@ +.\" t .\" groff_mdoc.man .\" .\" A complete reference of the mdoc macro package for GNU troff. @@ -613,10 +614,10 @@ These commands identify the page and are The remaining items in the template are section headers .Pf ( Li .Sh ) ; of which -.Sx NAME , -.Sx SYNOPSIS , +.Em NAME , +.Em SYNOPSIS , and -.Sx DESCRIPTION +.Em DESCRIPTION are mandatory. The headers are discussed in .Sx "PAGE STRUCTURE DOMAIN" , @@ -723,34 +724,36 @@ Under .Tn \*[operating-system] , the following sections are defined: .Pp -.Bl -column LOCAL -offset indent -compact -.It Li 1 Ta "\*[volume-operating-system] \*[volume-ds-1]" -.It Li 2 Ta "\*[volume-operating-system] \*[volume-ds-2]" -.It Li 3 Ta "\*[volume-operating-system] \*[volume-ds-3]" -.It Li 4 Ta "\*[volume-operating-system] \*[volume-ds-4]" -.It Li 5 Ta "\*[volume-operating-system] \*[volume-ds-5]" -.It Li 6 Ta "\*[volume-operating-system] \*[volume-ds-6]" -.It Li 7 Ta "\*[volume-operating-system] \*[volume-ds-7]" -.It Li 8 Ta "\*[volume-operating-system] \*[volume-ds-8]" -.It Li 9 Ta "\*[volume-operating-system] \*[volume-ds-9]" -.El +.TS +l l l. +1 \*[volume-operating-system] \*[volume-ds-1] +2 \*[volume-operating-system] \*[volume-ds-2] +3 \*[volume-operating-system] \*[volume-ds-3] +4 \*[volume-operating-system] \*[volume-ds-4] +5 \*[volume-operating-system] \*[volume-ds-5] +6 \*[volume-operating-system] \*[volume-ds-6] +7 \*[volume-operating-system] \*[volume-ds-7] +8 \*[volume-operating-system] \*[volume-ds-8] +9 \*[volume-operating-system] \*[volume-ds-9] +.TE .Pp . A volume name may be arbitrary or one of the following: . .Pp -.Bl -column LOCAL -offset indent -compact -.It Li USD Ta "\*[volume-ds-USD]" -.It Li PS1 Ta "\*[volume-ds-PS1]" -.It Li AMD Ta "\*[volume-ds-AMD]" -.It Li SMM Ta "\*[volume-ds-SMM]" -.It Li URM Ta "\*[volume-ds-URM]" -.It Li PRM Ta "\*[volume-ds-PRM]" -.It Li KM Ta "\*[volume-ds-KM]" -.It Li IND Ta "\*[volume-ds-IND]" -.It Li LOCAL Ta "\*[volume-ds-LOCAL]" -.It Li CON Ta "\*[volume-ds-CON]" -.El +.TS +l l. +USD \*[volume-ds-USD] +PS1 \*[volume-ds-PS1] +AMD \*[volume-ds-AMD] +SMM \*[volume-ds-SMM] +URM \*[volume-ds-URM] +PRM \*[volume-ds-PRM] +KM \*[volume-ds-KM] +IND \*[volume-ds-IND] +LOCAL \*[volume-ds-LOCAL] +CON \*[volume-ds-CON] +.TE .Pp . For compatibility, @@ -1208,7 +1211,7 @@ documented, or the name of the author of The default width is 12n. .Pp In the -.Sx AUTHORS +.Em AUTHORS section, the .Ql .An command causes a line break allowing each new name to appear on its own @@ -1834,7 +1837,7 @@ then denotes the keyword to be used with macro. .Pp In the -.Sx LIBRARY +.Em LIBRARY section an .Ql .Lb command causes a line break before and after its arguments are printed. @@ -1882,7 +1885,7 @@ section. Note: A section two or three document function name is addressed with the .Ql .Nm in the -.Sx NAME +.Em NAME section, and with .Ql .Fn in the @@ -2398,20 +2401,20 @@ respectively. .if t \ . ne 10 . -.Bd -filled -offset 4n -.Bl -column "quote" "close" "open" "Angle Bracket Enclosure" "`string' or string" -.Em Quote Ta Em Open Ta Em Close Ta Em Function Ta Em Result -.No .Aq Ta .Ao Ta .Ac Ta "Angle Bracket Enclosure" Ta Ao string Ac -.No .Bq Ta .Bo Ta .Bc Ta "Bracket Enclosure" Ta Bo string Bc -.No .Brq Ta .Bro Ta .Brc Ta "Brace Enclosure" Ta Bro string Brc -.No .Dq Ta .Do Ta .Dc Ta "Double Quote" Ta Do string Dc -.No .Eq Ta .Eo Ta .Ec Ta "Enclose String (in XX)" Ta XXstringXX -.No .Pq Ta .Po Ta .Pc Ta "Parenthesis Enclosure" Ta Po string Pc -.No .Ql Ta Ta Ta "Quoted Literal" Ta So string Sc or Li string -.No .Qq Ta .Qo Ta .Qc Ta "Straight Double Quote" Ta Qo string Qc -.No .Sq Ta .So Ta .Sc Ta "Single Quote" Ta So string Sc -.El -.Ed +.TS +lb lb lb lb lb +l l l l l. +Quote Open Close Function Result +\&.Aq .Ao .Ac Angle Bracket Enclosure +\&.Bq .Bo .Bc Bracket Enclosure [string] +\&.Brq .Bro .Brc Brace Enclosure {string} +\&.Dq .Do .Dc Double Quote "string" +\&.Eq .Eo .Ec Enclose String (in XX) XXstring +\&.Pq .Po .Pc Parenthesis Enclosure (string) +\&.Ql Quoted Literal \*[Lq]string\*[Rq] or string +\&.Qq .Qo .Qc Straight Double Quote "string" +\&.Sq .So .Sc Single Quote 'string' +.TE .Pp All macros ending with .Sq q @@ -2634,7 +2637,7 @@ Reference author name; one name per invo .It Li .%B Book title. .It Li .%C -City/place (not implemented yet). +City/place. .It Li .%D Date. .It Li .%I @@ -2681,7 +2684,8 @@ Example: \&.%A "John Foo" \&.%T "Implementation Notes on foobar(1)" \&.%R "Technical Report ABC\-DE\-12\-345" -\&.%Q "Drofnats College, Nowhere" +\&.%Q "Drofnats College" +\&.%C "Nowhere" \&.%D "April 1991" \&.Re .Ed @@ -2694,7 +2698,8 @@ produces .%A "John Foo" .%T "Implementation Notes on foobar(1)" .%R "Technical Report ABC-DE-12-345" -.%Q "Drofnats College, Nowhere" +.%Q "Drofnats College" +.%C "Nowhere" .%D "April 1991" .Re .Ed @@ -2839,7 +2844,7 @@ macro is mandatory. If not specified, headers, footers and page layout defaults will not be set and things will be rather unpleasant. The -.Sx NAME +.Em NAME section consists of at least three items. The first is the .Ql .Nm @@ -2949,7 +2954,7 @@ They are listed in the order in which th .Bl -tag -width ".Li .Sh\ COMPATIBILITY" .It Li ".Sh ENVIRONMENT" The -.Sx ENVIRONMENT +.Em ENVIRONMENT section should reveal any related environment variables and clues to their behavior and/or usage. . @@ -2964,7 +2969,7 @@ section. .It Li ".Sh EXAMPLES" There are several ways to create examples. See the -.Sx EXAMPLES +.Em EXAMPLES section below for details. . .It Li ".Sh DIAGNOSTICS" @@ -3019,7 +3024,7 @@ or this should be noted here. If the command does not adhere to any standard, its history should be noted in the -.Sx HISTORY +.Em HISTORY section. . .It Li ".Sh HISTORY" @@ -4045,28 +4050,30 @@ It is neither callable nor parsed and ta . The following strings are predefined: .Pp -.Bl -column String infinity "Troff " "straight double quote" -offset indent -.It Sy String Ta Sy Nroff Ta Sy Troff Ta Sy Meaning -.It Li <= Ta <= Ta \*[<=] Ta "less equal" -.It Li >= Ta >= Ta \*[>=] Ta "greater equal" -.It Li Rq Ta '' Ta \*[Rq] Ta "right double quote" -.It Li Lq Ta `` Ta \*[Lq] Ta "left double quote" -.It Li ua Ta ^ Ta \*[ua] Ta "upwards arrow" -.It Li aa Ta \' Ta \*[aa] Ta "acute accent" -.It Li ga Ta \` Ta \*[ga] Ta "grave accent" -.It Li q Ta \&" Ta \*[q] Ta "straight double quote" -.It Li Pi Ta pi Ta \*[Pi] Ta "greek pi" -.It Li Ne Ta != Ta \*[Ne] Ta "not equal" -.It Li Le Ta <= Ta \*[Le] Ta "less equal" -.It Li Ge Ta >= Ta \*[Ge] Ta "greater equal" -.It Li Lt Ta < Ta \*[Lt] Ta "less than" -.It Li Gt Ta > Ta \*[Gt] Ta "greater than" -.It Li Pm Ta +\- Ta \*[Pm] Ta "plus minus" -.It Li If Ta infinity Ta \*[If] Ta "infinity" -.It Li Am Ta \*[Am] Ta \*[Am] Ta "ampersand" -.It Li Na Ta \*[Na] Ta \*[Na] Ta "not a number" -.It Li Ba Ta \*[Ba] Ta \*[Ba] Ta "vertical bar" -.El +.TS +lb lb lb lb +l l l l. +String Nroff Troff Meaning +<= <= \*[<=] less equal +>= >= \*[>=] greater equal +Rq '' \*[Rq] right double quote +Lq `` \*[Lq] left double quote +ua ^ \*[ua] upwards arrow +aa \' \*[aa] acute accent +ga \` \*[ga] grave accent +q \&" \*[q] straight double quote +Pi pi \*[Pi] greek pi +Ne != \*[Ne] not equal +Le <= \*[Le] less equal +Ge >= \*[Ge] greater equal +Lt < \*[Lt] less than +Gt > \*[Gt] greater than +Pm +\- \*[Pm] plus minus +If infinity \*[If] infinity +Am \*[Am] \*[Am] ampersand +Na \*[Na] \*[Na] not a number +Ba \*[Ba] \*[Ba] vertical bar +.TE .Pp The names of the columns .Sy Nroff @@ -4212,7 +4219,7 @@ Section 3f has not been added to the hea .Pp .Ql \&.Nm font should be changed in -.Sx NAME +.Em NAME section. .Pp .Ql \&.Fn Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- stable/10/gnu/usr.bin/groff/tmac/mdoc.local Sat Mar 1 13:23:52 2014 (r262655) +++ stable/10/gnu/usr.bin/groff/tmac/mdoc.local Sat Mar 1 14:44:55 2014 (r262656) @@ -34,15 +34,18 @@ .\" FreeBSD .Lb values .ds doc-str-Lb-libarchive Streaming Archive Library (libarchive, \-larchive) .ds doc-str-Lb-libbluetooth Bluetooth User Library (libbluetooth, \-lbluetooth) +.ds doc-str-Lb-libcapsicum Capsicum Library (libcapsicum, \-lcapsicum) .ds doc-str-Lb-libedit Line Editor and History Library (libedit, \-ledit) .ds doc-str-Lb-libefi EFI Runtime Services Library (libefi, \-lefi) .ds doc-str-Lb-libelf ELF Parsing Library (libelf, \-lelf) .ds doc-str-Lb-libexecinfo Backtrace Access Library (libexecinfo, \-lexecinfo) .ds doc-str-Lb-libfetch File Transfer Library (libfetch, \-lfetch) +.ds doc-str-Lb-libnv Name/value pairs library (libnv, \-lnv) .ds doc-str-Lb-libpmc Performance Monitoring Counters Interface Library (libpmc, \-lpmc) .ds doc-str-Lb-libproc Processor Monitoring and Analysis Library (libproc, \-lproc) .ds doc-str-Lb-libprocstat Process and Files Information Retrieval (libprocstat, \-lprocstat) .ds doc-str-Lb-librtld_db Run-time Linker Debugging Library (librtld_db, \-lrtld_db) +.ds doc-str-Lb-libsbuf Safe String Composition Library (libsbuf, \-lsbuf) .ds doc-str-Lb-libstdthreads C11 Threads Library (libstdthreads, \-lstdthreads) . .\" Default .Os value @@ -55,6 +58,7 @@ .ds doc-operating-system-FreeBSD-9.1 9.1 .ds doc-operating-system-FreeBSD-9.2 9.2 .ds doc-operating-system-FreeBSD-10.0 10.0 +.ds doc-operating-system-NetBSD-7.0 7.0 . .\" Definitions not (yet) in doc-syms . From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 1 21:50:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7ED47255; Sat, 1 Mar 2014 21:50: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6AB851237; Sat, 1 Mar 2014 21:50: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 s21LoO8B084786; Sat, 1 Mar 2014 21:50:24 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21LoOQX084784; Sat, 1 Mar 2014 21:50:24 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201403012150.s21LoOQX084784@svn.freebsd.org> From: Justin Hibbits Date: Sat, 1 Mar 2014 21:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262668 - stable/10/sys/dev/adb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 21:50:24 -0000 Author: jhibbits Date: Sat Mar 1 21:50:23 2014 New Revision: 262668 URL: http://svnweb.freebsd.org/changeset/base/262668 Log: MFC r261068 Properly sort the arguments to mtx_init(9). PR: misc/186020 Submitted by: alfred Modified: stable/10/sys/dev/adb/adb_kbd.c stable/10/sys/dev/adb/adb_mouse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/adb/adb_kbd.c ============================================================================== --- stable/10/sys/dev/adb/adb_kbd.c Sat Mar 1 21:22:20 2014 (r262667) +++ stable/10/sys/dev/adb/adb_kbd.c Sat Mar 1 21:50:23 2014 (r262668) @@ -304,7 +304,7 @@ adb_kbd_attach(device_t dev) /* Try stepping forward to the extended keyboard protocol */ adb_set_device_handler(dev,3); - mtx_init(&sc->sc_mutex,KBD_DRIVER_NAME,MTX_DEF,0); + mtx_init(&sc->sc_mutex, KBD_DRIVER_NAME, NULL, MTX_DEF); cv_init(&sc->sc_cv,KBD_DRIVER_NAME); callout_init(&sc->sc_repeater, 0); Modified: stable/10/sys/dev/adb/adb_mouse.c ============================================================================== --- stable/10/sys/dev/adb/adb_mouse.c Sat Mar 1 21:22:20 2014 (r262667) +++ stable/10/sys/dev/adb/adb_mouse.c Sat Mar 1 21:50:23 2014 (r262668) @@ -154,7 +154,7 @@ adb_mouse_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; - mtx_init(&sc->sc_mtx,"ams",MTX_DEF,0); + mtx_init(&sc->sc_mtx, "ams", NULL, MTX_DEF); cv_init(&sc->sc_cv,"ams"); sc->flags = 0; From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 2 01:46:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 34749675; Sun, 2 Mar 2014 01:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1FCEF1927; Sun, 2 Mar 2014 01:46: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 s221kid3080046; Sun, 2 Mar 2014 01:46:44 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s221kimV080045; Sun, 2 Mar 2014 01:46:44 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403020146.s221kimV080045@svn.freebsd.org> From: Julio Merino Date: Sun, 2 Mar 2014 01:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262674 - stable/10/sys/dev/syscons X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 01:46:45 -0000 Author: jmmv Date: Sun Mar 2 01:46:44 2014 New Revision: 262674 URL: http://svnweb.freebsd.org/changeset/base/262674 Log: Increase maximum number of columns to support 1920x1200 displays. This is a MFC of r262480 and r262502. Please note that this is changing a constant in a header file so it could affect ABIs. However, as far as I can tell, this is apparently only used in code to declare static arrays and thus it should be safe to change... PR: kern/180558 Modified: stable/10/sys/dev/syscons/syscons.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/syscons/syscons.h ============================================================================== --- stable/10/sys/dev/syscons/syscons.h Sun Mar 2 00:47:47 2014 (r262673) +++ stable/10/sys/dev/syscons/syscons.h Sun Mar 2 01:46:44 2014 (r262674) @@ -145,9 +145,9 @@ /* The following #defines are hard-coded for a maximum text resolution corresponding to a maximum framebuffer - resolution of 1600x1200 with an 8x8 font... + resolution of 1920x1200 with an 8x8 font... */ -#define COL 200 +#define COL 240 #define ROW 150 #define PCBURST 128 From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 2 00:30:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5A569881; Sun, 2 Mar 2014 00:30: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 468FB1112; Sun, 2 Mar 2014 00:30:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s220Uh4e051342; Sun, 2 Mar 2014 00:30:43 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s220UhBZ051341; Sun, 2 Mar 2014 00:30:43 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201403020030.s220UhBZ051341@svn.freebsd.org> From: Justin Hibbits Date: Sun, 2 Mar 2014 00:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262672 - stable/10/sys/dev/hwpmc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 00:30:43 -0000 Author: jhibbits Date: Sun Mar 2 00:30:42 2014 New Revision: 262672 URL: http://svnweb.freebsd.org/changeset/base/262672 Log: MFC r261173 MPC74xx should not fall through, to the error case. Modified: stable/10/sys/dev/hwpmc/hwpmc_powerpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hwpmc/hwpmc_powerpc.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_powerpc.c Sun Mar 2 00:20:00 2014 (r262671) +++ stable/10/sys/dev/hwpmc/hwpmc_powerpc.c Sun Mar 2 00:30:42 2014 (r262672) @@ -147,6 +147,7 @@ pmc_md_initialize() case MPC7455: case MPC7457: error = pmc_mpc7xxx_initialize(pmc_mdep); + break; case IBM970: case IBM970FX: case IBM970MP: From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 2 02:35:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2260527C; Sun, 2 Mar 2014 02:35: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02C171077; Sun, 2 Mar 2014 02:35: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 s222ZmUf000346; Sun, 2 Mar 2014 02:35:48 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s222ZkD6000327; Sun, 2 Mar 2014 02:35:46 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201403020235.s222ZkD6000327@svn.freebsd.org> From: Justin Hibbits Date: Sun, 2 Mar 2014 02:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262675 - in stable/10/sys: conf powerpc/aim powerpc/include powerpc/powermac powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 02:35:49 -0000 Author: jhibbits Date: Sun Mar 2 02:35:46 2014 New Revision: 262675 URL: http://svnweb.freebsd.org/changeset/base/262675 Log: MFC r261309 Unbreak non-SMP builds. This was broken by r259284. Also, reorganize the code introduced in that revision a bit. Modified: stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/aim/machdep.c stable/10/sys/powerpc/aim/mp_cpudep.c stable/10/sys/powerpc/aim/trap_subr32.S stable/10/sys/powerpc/aim/trap_subr64.S stable/10/sys/powerpc/include/cpu.h stable/10/sys/powerpc/include/platform.h stable/10/sys/powerpc/powermac/platform_powermac.c stable/10/sys/powerpc/powermac/pmu.c stable/10/sys/powerpc/powerpc/genassym.c stable/10/sys/powerpc/powerpc/mp_machdep.c stable/10/sys/powerpc/powerpc/platform.c stable/10/sys/powerpc/powerpc/platform_if.m Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/conf/files.powerpc Sun Mar 2 02:35:46 2014 (r262675) @@ -94,7 +94,7 @@ powerpc/aim/mmu_oea.c optional aim powe powerpc/aim/mmu_oea64.c optional aim powerpc/aim/moea64_if.m optional aim powerpc/aim/moea64_native.c optional aim -powerpc/aim/mp_cpudep.c optional aim smp +powerpc/aim/mp_cpudep.c optional aim powerpc/aim/nexus.c optional aim powerpc/aim/slb.c optional aim powerpc64 powerpc/aim/swtch32.S optional aim powerpc Modified: stable/10/sys/powerpc/aim/machdep.c ============================================================================== --- stable/10/sys/powerpc/aim/machdep.c Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/aim/machdep.c Sun Mar 2 02:35:46 2014 (r262675) @@ -142,6 +142,8 @@ int cacheline_size = 32; #endif int hw_direct_map = 1; +extern void *ap_pcpu; + struct pcpu __pcpu[MAXCPU]; static struct trapframe frame0; @@ -237,9 +239,7 @@ extern void *rfid_patch, *rfi_patch1, *r extern void *trapcode64; #endif -#ifdef SMP extern void *rstcode, *rstsize; -#endif extern void *trapcode, *trapsize; extern void *slbtrap, *slbtrapsize; extern void *alitrap, *alisize; @@ -493,11 +493,7 @@ powerpc_init(vm_offset_t startkernel, vm generictrap = &trapcode; #endif -#ifdef SMP bcopy(&rstcode, (void *)(EXC_RST + trap_offset), (size_t)&rstsize); -#else - bcopy(generictrap, (void *)EXC_RST, (size_t)&trapsize); -#endif #ifdef KDB bcopy(&dblow, (void *)(EXC_MCHK + trap_offset), (size_t)&dbsize); @@ -788,3 +784,172 @@ va_to_vsid(pmap_t pm, vm_offset_t va) } #endif + +/* From p3-53 of the MPC7450 RISC Microprocessor Family Reference Manual */ +void +flush_disable_caches(void) +{ + register_t msr; + register_t msscr0; + register_t cache_reg; + volatile uint32_t *memp; + uint32_t temp; + int i; + int x; + + msr = mfmsr(); + powerpc_sync(); + mtmsr(msr & ~(PSL_EE | PSL_DR)); + msscr0 = mfspr(SPR_MSSCR0); + msscr0 &= ~MSSCR0_L2PFE; + mtspr(SPR_MSSCR0, msscr0); + powerpc_sync(); + isync(); + __asm__ __volatile__("dssall; sync"); + powerpc_sync(); + isync(); + __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); + __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); + __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); + + /* Lock the L1 Data cache. */ + mtspr(SPR_LDSTCR, mfspr(SPR_LDSTCR) | 0xFF); + powerpc_sync(); + isync(); + + mtspr(SPR_LDSTCR, 0); + + /* + * Perform this in two stages: Flush the cache starting in RAM, then do it + * from ROM. + */ + memp = (volatile uint32_t *)0x00000000; + for (i = 0; i < 128 * 1024; i++) { + temp = *memp; + __asm__ __volatile__("dcbf 0,%0" :: "r"(memp)); + memp += 32/sizeof(*memp); + } + + memp = (volatile uint32_t *)0xfff00000; + x = 0xfe; + + for (; x != 0xff;) { + mtspr(SPR_LDSTCR, x); + for (i = 0; i < 128; i++) { + temp = *memp; + __asm__ __volatile__("dcbf 0,%0" :: "r"(memp)); + memp += 32/sizeof(*memp); + } + x = ((x << 1) | 1) & 0xff; + } + mtspr(SPR_LDSTCR, 0); + + cache_reg = mfspr(SPR_L2CR); + if (cache_reg & L2CR_L2E) { + cache_reg &= ~(L2CR_L2IO_7450 | L2CR_L2DO_7450); + mtspr(SPR_L2CR, cache_reg); + powerpc_sync(); + mtspr(SPR_L2CR, cache_reg | L2CR_L2HWF); + while (mfspr(SPR_L2CR) & L2CR_L2HWF) + ; /* Busy wait for cache to flush */ + powerpc_sync(); + cache_reg &= ~L2CR_L2E; + mtspr(SPR_L2CR, cache_reg); + powerpc_sync(); + mtspr(SPR_L2CR, cache_reg | L2CR_L2I); + powerpc_sync(); + while (mfspr(SPR_L2CR) & L2CR_L2I) + ; /* Busy wait for L2 cache invalidate */ + powerpc_sync(); + } + + cache_reg = mfspr(SPR_L3CR); + if (cache_reg & L3CR_L3E) { + cache_reg &= ~(L3CR_L3IO | L3CR_L3DO); + mtspr(SPR_L3CR, cache_reg); + powerpc_sync(); + mtspr(SPR_L3CR, cache_reg | L3CR_L3HWF); + while (mfspr(SPR_L3CR) & L3CR_L3HWF) + ; /* Busy wait for cache to flush */ + powerpc_sync(); + cache_reg &= ~L3CR_L3E; + mtspr(SPR_L3CR, cache_reg); + powerpc_sync(); + mtspr(SPR_L3CR, cache_reg | L3CR_L3I); + powerpc_sync(); + while (mfspr(SPR_L3CR) & L3CR_L3I) + ; /* Busy wait for L3 cache invalidate */ + powerpc_sync(); + } + + mtspr(SPR_HID0, mfspr(SPR_HID0) & ~HID0_DCE); + powerpc_sync(); + isync(); + + mtmsr(msr); +} + +void +cpu_sleep() +{ + static u_quad_t timebase = 0; + static register_t sprgs[4]; + static register_t srrs[2]; + + jmp_buf resetjb; + struct thread *fputd; + struct thread *vectd; + register_t hid0; + register_t msr; + register_t saved_msr; + + ap_pcpu = pcpup; + + PCPU_SET(restore, &resetjb); + + saved_msr = mfmsr(); + fputd = PCPU_GET(fputhread); + vectd = PCPU_GET(vecthread); + if (fputd != NULL) + save_fpu(fputd); + if (vectd != NULL) + save_vec(vectd); + if (setjmp(resetjb) == 0) { + sprgs[0] = mfspr(SPR_SPRG0); + sprgs[1] = mfspr(SPR_SPRG1); + sprgs[2] = mfspr(SPR_SPRG2); + sprgs[3] = mfspr(SPR_SPRG3); + srrs[0] = mfspr(SPR_SRR0); + srrs[1] = mfspr(SPR_SRR1); + timebase = mftb(); + powerpc_sync(); + flush_disable_caches(); + hid0 = mfspr(SPR_HID0); + hid0 = (hid0 & ~(HID0_DOZE | HID0_NAP)) | HID0_SLEEP; + powerpc_sync(); + isync(); + msr = mfmsr() | PSL_POW; + mtspr(SPR_HID0, hid0); + powerpc_sync(); + + while (1) + mtmsr(msr); + } + mttb(timebase); + PCPU_SET(curthread, curthread); + PCPU_SET(curpcb, curthread->td_pcb); + pmap_activate(curthread); + powerpc_sync(); + mtspr(SPR_SPRG0, sprgs[0]); + mtspr(SPR_SPRG1, sprgs[1]); + mtspr(SPR_SPRG2, sprgs[2]); + mtspr(SPR_SPRG3, sprgs[3]); + mtspr(SPR_SRR0, srrs[0]); + mtspr(SPR_SRR1, srrs[1]); + mtmsr(saved_msr); + if (fputd == curthread) + enable_fpu(curthread); + if (vectd == curthread) + enable_vec(curthread); + powerpc_sync(); +} Modified: stable/10/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- stable/10/sys/powerpc/aim/mp_cpudep.c Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/aim/mp_cpudep.c Sun Mar 2 02:35:46 2014 (r262675) @@ -273,6 +273,14 @@ cpudep_ap_setup() vers = mfpvr() >> 16; + /* The following is needed for restoring from sleep. */ +#ifdef __powerpc64__ + /* Writing to the time base register is hypervisor-privileged */ + if (mfmsr() & PSL_HV) + mttb(0); +#else + mttb(0); +#endif switch(vers) { case IBM970: case IBM970FX: Modified: stable/10/sys/powerpc/aim/trap_subr32.S ============================================================================== --- stable/10/sys/powerpc/aim/trap_subr32.S Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/aim/trap_subr32.S Sun Mar 2 02:35:46 2014 (r262675) @@ -292,7 +292,6 @@ CNAME(restorebridge): isync CNAME(restorebridgesize) = .-CNAME(restorebridge) -#ifdef SMP /* * Processor reset exception handler. These are typically * the first instructions the processor executes after a @@ -320,12 +319,21 @@ cpu_reset: bla CNAME(pmap_cpu_bootstrap) bla CNAME(cpudep_ap_bootstrap) mr %r1,%r3 + bla CNAME(cpudep_ap_setup) + GET_CPUINFO(%r5) + lwz %r3,(PC_RESTORE)(%r5) + cmplwi %cr0,%r3,0 + beq %cr0,2f + li %r4, 1 + b CNAME(longjmp) +2: +#ifdef SMP bla CNAME(machdep_ap_bootstrap) +#endif /* Should not be reached */ 9: b 9b -#endif /* * This code gets copied to all the trap vectors Modified: stable/10/sys/powerpc/aim/trap_subr64.S ============================================================================== --- stable/10/sys/powerpc/aim/trap_subr64.S Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/aim/trap_subr64.S Sun Mar 2 02:35:46 2014 (r262675) @@ -287,7 +287,6 @@ dtrace_invop_calltrap_addr: .text #endif -#ifdef SMP /* * Processor reset exception handler. These are typically * the first instructions the processor executes after a @@ -322,13 +321,25 @@ cpu_reset: bl CNAME(cpudep_ap_bootstrap) /* Set up PCPU and stack */ nop mr %r1,%r3 /* Use new stack */ + bl CNAME(cpudep_ap_setup) + nop + GET_CPUINFO(%r5) + ld %r3,(PC_RESTORE)(%r5) + cmpldi %cr0,%r3,0 + beq %cr0,2f + nop + li %r4,1 + b CNAME(longjmp) + nop +2: +#ifdef SMP bl CNAME(machdep_ap_bootstrap) /* And away! */ nop +#endif /* Should not be reached */ 9: b 9b -#endif /* * This code gets copied to all the trap vectors Modified: stable/10/sys/powerpc/include/cpu.h ============================================================================== --- stable/10/sys/powerpc/include/cpu.h Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/include/cpu.h Sun Mar 2 02:35:46 2014 (r262675) @@ -95,9 +95,9 @@ extern char etext[]; void cpu_halt(void); void cpu_reset(void); +void cpu_sleep(void); +void flush_disable_caches(void); void fork_trampoline(void); void swi_vm(void *); -void flush_disable_caches(void); - #endif /* _MACHINE_CPU_H_ */ Modified: stable/10/sys/powerpc/include/platform.h ============================================================================== --- stable/10/sys/powerpc/include/platform.h Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/include/platform.h Sun Mar 2 02:35:46 2014 (r262675) @@ -56,5 +56,7 @@ void platform_smp_ap_init(void); const char *installed_platform(void); void platform_probe_and_attach(void); + +void platform_sleep(void); #endif /* _MACHINE_PLATFORM_H_ */ Modified: stable/10/sys/powerpc/powermac/platform_powermac.c ============================================================================== --- stable/10/sys/powerpc/powermac/platform_powermac.c Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/powermac/platform_powermac.c Sun Mar 2 02:35:46 2014 (r262675) @@ -38,11 +38,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* For save_vec() */ #include #include +#include /* For save_fpu() */ #include #include #include +#include #include #include @@ -51,9 +54,7 @@ __FBSDID("$FreeBSD$"); #include "platform_if.h" -#ifdef SMP extern void *ap_pcpu; -#endif static int powermac_probe(platform_t); static int powermac_attach(platform_t); @@ -65,6 +66,7 @@ static int powermac_smp_next_cpu(platfor static int powermac_smp_get_bsp(platform_t, struct cpuref *cpuref); static int powermac_smp_start_cpu(platform_t, struct pcpu *cpu); static void powermac_reset(platform_t); +static void powermac_sleep(platform_t); static platform_method_t powermac_methods[] = { PLATFORMMETHOD(platform_probe, powermac_probe), @@ -78,6 +80,7 @@ static platform_method_t powermac_method PLATFORMMETHOD(platform_smp_start_cpu, powermac_smp_start_cpu), PLATFORMMETHOD(platform_reset, powermac_reset), + PLATFORMMETHOD(platform_sleep, powermac_sleep), PLATFORMMETHOD_END }; @@ -326,113 +329,17 @@ powermac_smp_start_cpu(platform_t plat, #endif } -/* From p3-53 of the MPC7450 RISC Microprocessor Family Reference Manual */ -void -flush_disable_caches(void) -{ - register_t msr; - register_t msscr0; - register_t cache_reg; - volatile uint32_t *memp; - uint32_t temp; - int i; - int x; - - msr = mfmsr(); - powerpc_sync(); - mtmsr(msr & ~(PSL_EE | PSL_DR)); - msscr0 = mfspr(SPR_MSSCR0); - msscr0 &= ~MSSCR0_L2PFE; - mtspr(SPR_MSSCR0, msscr0); - powerpc_sync(); - isync(); - __asm__ __volatile__("dssall; sync"); - powerpc_sync(); - isync(); - __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); - __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); - __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); - - /* Lock the L1 Data cache. */ - mtspr(SPR_LDSTCR, mfspr(SPR_LDSTCR) | 0xFF); - powerpc_sync(); - isync(); - - mtspr(SPR_LDSTCR, 0); - - /* - * Perform this in two stages: Flush the cache starting in RAM, then do it - * from ROM. - */ - memp = (volatile uint32_t *)0x00000000; - for (i = 0; i < 128 * 1024; i++) { - temp = *memp; - __asm__ __volatile__("dcbf 0,%0" :: "r"(memp)); - memp += 32/sizeof(*memp); - } - - memp = (volatile uint32_t *)0xfff00000; - x = 0xfe; - - for (; x != 0xff;) { - mtspr(SPR_LDSTCR, x); - for (i = 0; i < 128; i++) { - temp = *memp; - __asm__ __volatile__("dcbf 0,%0" :: "r"(memp)); - memp += 32/sizeof(*memp); - } - x = ((x << 1) | 1) & 0xff; - } - mtspr(SPR_LDSTCR, 0); - - cache_reg = mfspr(SPR_L2CR); - if (cache_reg & L2CR_L2E) { - cache_reg &= ~(L2CR_L2IO_7450 | L2CR_L2DO_7450); - mtspr(SPR_L2CR, cache_reg); - powerpc_sync(); - mtspr(SPR_L2CR, cache_reg | L2CR_L2HWF); - while (mfspr(SPR_L2CR) & L2CR_L2HWF) - ; /* Busy wait for cache to flush */ - powerpc_sync(); - cache_reg &= ~L2CR_L2E; - mtspr(SPR_L2CR, cache_reg); - powerpc_sync(); - mtspr(SPR_L2CR, cache_reg | L2CR_L2I); - powerpc_sync(); - while (mfspr(SPR_L2CR) & L2CR_L2I) - ; /* Busy wait for L2 cache invalidate */ - powerpc_sync(); - } - - cache_reg = mfspr(SPR_L3CR); - if (cache_reg & L3CR_L3E) { - cache_reg &= ~(L3CR_L3IO | L3CR_L3DO); - mtspr(SPR_L3CR, cache_reg); - powerpc_sync(); - mtspr(SPR_L3CR, cache_reg | L3CR_L3HWF); - while (mfspr(SPR_L3CR) & L3CR_L3HWF) - ; /* Busy wait for cache to flush */ - powerpc_sync(); - cache_reg &= ~L3CR_L3E; - mtspr(SPR_L3CR, cache_reg); - powerpc_sync(); - mtspr(SPR_L3CR, cache_reg | L3CR_L3I); - powerpc_sync(); - while (mfspr(SPR_L3CR) & L3CR_L3I) - ; /* Busy wait for L3 cache invalidate */ - powerpc_sync(); - } - - mtspr(SPR_HID0, mfspr(SPR_HID0) & ~HID0_DCE); - powerpc_sync(); - isync(); - - mtmsr(msr); -} - static void powermac_reset(platform_t platform) { OF_reboot(); } +void +powermac_sleep(platform_t platform) +{ + + *(unsigned long *)0x80 = 0x100; + cpu_sleep(); +} + Modified: stable/10/sys/powerpc/powermac/pmu.c ============================================================================== --- stable/10/sys/powerpc/powermac/pmu.c Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/powermac/pmu.c Sun Mar 2 02:35:46 2014 (r262675) @@ -45,17 +45,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For save_vec() */ #include #include -#include /* For save_fpu() */ #include #include #include #include #include #include -#include #include #include @@ -106,7 +103,6 @@ static int pmu_acline_state(SYSCTL_HANDL static int pmu_query_battery(struct pmu_softc *sc, int batt, struct pmu_battstate *info); static int pmu_battquery_sysctl(SYSCTL_HANDLER_ARGS); -static void pmu_sleep_int(void); /* * List of battery-related sysctls we might ask for @@ -1031,72 +1027,6 @@ pmu_settime(device_t dev, struct timespe return (0); } -static register_t sprgs[4]; -static register_t srrs[2]; -extern void *ap_pcpu; - -void pmu_sleep_int(void) -{ - static u_quad_t timebase = 0; - jmp_buf resetjb; - struct thread *fputd; - struct thread *vectd; - register_t hid0; - register_t msr; - register_t saved_msr; - - ap_pcpu = pcpup; - - PCPU_SET(restore, &resetjb); - - *(unsigned long *)0x80 = 0x100; - saved_msr = mfmsr(); - fputd = PCPU_GET(fputhread); - vectd = PCPU_GET(vecthread); - if (fputd != NULL) - save_fpu(fputd); - if (vectd != NULL) - save_vec(vectd); - if (setjmp(resetjb) == 0) { - sprgs[0] = mfspr(SPR_SPRG0); - sprgs[1] = mfspr(SPR_SPRG1); - sprgs[2] = mfspr(SPR_SPRG2); - sprgs[3] = mfspr(SPR_SPRG3); - srrs[0] = mfspr(SPR_SRR0); - srrs[1] = mfspr(SPR_SRR1); - timebase = mftb(); - powerpc_sync(); - flush_disable_caches(); - hid0 = mfspr(SPR_HID0); - hid0 = (hid0 & ~(HID0_DOZE | HID0_NAP)) | HID0_SLEEP; - powerpc_sync(); - isync(); - msr = mfmsr() | PSL_POW; - mtspr(SPR_HID0, hid0); - powerpc_sync(); - - while (1) - mtmsr(msr); - } - mttb(timebase); - PCPU_SET(curthread, curthread); - PCPU_SET(curpcb, curthread->td_pcb); - pmap_activate(curthread); - powerpc_sync(); - mtspr(SPR_SPRG0, sprgs[0]); - mtspr(SPR_SPRG1, sprgs[1]); - mtspr(SPR_SPRG2, sprgs[2]); - mtspr(SPR_SPRG3, sprgs[3]); - mtspr(SPR_SRR0, srrs[0]); - mtspr(SPR_SRR1, srrs[1]); - mtmsr(saved_msr); - if (fputd == curthread) - enable_fpu(curthread); - if (vectd == curthread) - enable_vec(curthread); - powerpc_sync(); -} - int pmu_set_speed(int low_speed) { @@ -1114,7 +1044,7 @@ pmu_set_speed(int low_speed) sleepcmd[4] = low_speed; pmu_send(sc, PMU_CPU_SPEED, 5, sleepcmd, 16, resp); unin_chip_sleep(NULL, 1); - pmu_sleep_int(); + platform_sleep(); unin_chip_wake(NULL); mtdec(1); /* Force a decrementer exception */ Modified: stable/10/sys/powerpc/powerpc/genassym.c ============================================================================== --- stable/10/sys/powerpc/powerpc/genassym.c Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/powerpc/genassym.c Sun Mar 2 02:35:46 2014 (r262675) @@ -62,6 +62,7 @@ ASSYM(PC_CURPMAP, offsetof(struct pcpu, ASSYM(PC_TEMPSAVE, offsetof(struct pcpu, pc_tempsave)); ASSYM(PC_DISISAVE, offsetof(struct pcpu, pc_disisave)); ASSYM(PC_DBSAVE, offsetof(struct pcpu, pc_dbsave)); +ASSYM(PC_RESTORE, offsetof(struct pcpu, pc_restore)); #if defined(BOOKE) ASSYM(PC_BOOKE_CRITSAVE, offsetof(struct pcpu, pc_booke_critsave)); Modified: stable/10/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/mp_machdep.c Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/powerpc/mp_machdep.c Sun Mar 2 02:35:46 2014 (r262675) @@ -72,29 +72,12 @@ int longfault(faultbuf, int); void machdep_ap_bootstrap(void) { - jmp_buf *restore; - - /* The following is needed for restoring from sleep. */ -#ifdef __powerpc64__ - /* Writing to the time base register is hypervisor-privileged */ - if (mfmsr() & PSL_HV) - mttb(0); -#else - mttb(0); -#endif - /* Set up important bits on the CPU (HID registers, etc.) */ - cpudep_ap_setup(); /* Set PIR */ PCPU_SET(pir, mfspr(SPR_PIR)); PCPU_SET(awake, 1); __asm __volatile("msync; isync"); - restore = PCPU_GET(restore); - if (restore != NULL) { - longjmp(*restore, 1); - } - while (ap_letgo == 0) ; Modified: stable/10/sys/powerpc/powerpc/platform.c ============================================================================== --- stable/10/sys/powerpc/powerpc/platform.c Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/powerpc/platform.c Sun Mar 2 02:35:46 2014 (r262675) @@ -117,6 +117,15 @@ platform_timebase_freq(struct cpuref *cp return (PLATFORM_TIMEBASE_FREQ(plat_obj, cpu)); } +/* + * Put the current CPU, as last step in suspend, to sleep + */ +void +platform_sleep() +{ + PLATFORM_SLEEP(plat_obj); +} + int platform_smp_first_cpu(struct cpuref *cpu) { Modified: stable/10/sys/powerpc/powerpc/platform_if.m ============================================================================== --- stable/10/sys/powerpc/powerpc/platform_if.m Sun Mar 2 01:46:44 2014 (r262674) +++ stable/10/sys/powerpc/powerpc/platform_if.m Sun Mar 2 02:35:46 2014 (r262675) @@ -210,3 +210,10 @@ METHOD void reset { platform_t _plat; }; +/** + * @brief Suspend the CPU + */ +METHOD void sleep { + platform_t _plat; +}; + From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 2 12:11:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4C2FD73F; Sun, 2 Mar 2014 12:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 375121B1E; Sun, 2 Mar 2014 12:11: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 s22CBuNg053947; Sun, 2 Mar 2014 12:11:56 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22CBtQC053945; Sun, 2 Mar 2014 12:11:55 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403021211.s22CBtQC053945@svn.freebsd.org> From: Christian Brueffer Date: Sun, 2 Mar 2014 12:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262686 - in stable/10/release/doc: en_US.ISO8859-1/hardware share/misc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 12:11:56 -0000 Author: brueffer Date: Sun Mar 2 12:11:55 2014 New Revision: 262686 URL: http://svnweb.freebsd.org/changeset/base/262686 Log: MFC: r262574 Add tws(4) to the hardware notes. Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml stable/10/release/doc/share/misc/dev.archlist.txt Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Sun Mar 2 08:58:21 2014 (r262685) +++ stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Sun Mar 2 12:11:55 2014 (r262686) @@ -758,6 +758,8 @@ &hwlist.twe; + &hwlist.tws; + &hwlist.vpo; [&arch.i386;] The wds(4) driver supports the WD7000 SCSI Modified: stable/10/release/doc/share/misc/dev.archlist.txt ============================================================================== --- stable/10/release/doc/share/misc/dev.archlist.txt Sun Mar 2 08:58:21 2014 (r262685) +++ stable/10/release/doc/share/misc/dev.archlist.txt Sun Mar 2 12:11:55 2014 (r262686) @@ -153,6 +153,7 @@ tl i386,pc98,amd64 trm i386,amd64 twa i386,amd64 twe i386,amd64 +tws i386,amd64 ubsa i386,pc98,amd64 ubsec i386,pc98,amd64 ubser i386,pc98,amd64 From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 2 15:53:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E297FB45; Sun, 2 Mar 2014 15:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC9371D40; Sun, 2 Mar 2014 15:53: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 s22Frdgn042457; Sun, 2 Mar 2014 15:53:39 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22FrdNA042456; Sun, 2 Mar 2014 15:53:39 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201403021553.s22FrdNA042456@svn.freebsd.org> From: Justin Hibbits Date: Sun, 2 Mar 2014 15:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262691 - stable/10/sys/powerpc/aim X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 15:53:40 -0000 Author: jhibbits Date: Sun Mar 2 15:53:39 2014 New Revision: 262691 URL: http://svnweb.freebsd.org/changeset/base/262691 Log: MFC r261258 Use a loop of dcbz, instead of calling bzero() to zero a page. This matches what is done in mmu_oea64.c. Modified: stable/10/sys/powerpc/aim/mmu_oea.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/aim/mmu_oea.c ============================================================================== --- stable/10/sys/powerpc/aim/mmu_oea.c Sun Mar 2 13:26:08 2014 (r262690) +++ stable/10/sys/powerpc/aim/mmu_oea.c Sun Mar 2 15:53:39 2014 (r262691) @@ -1084,10 +1084,10 @@ moea_copy_pages(mmu_t mmu, vm_page_t *ma void moea_zero_page(mmu_t mmu, vm_page_t m) { - vm_offset_t pa = VM_PAGE_TO_PHYS(m); - void *va = (void *)pa; + vm_offset_t off, pa = VM_PAGE_TO_PHYS(m); - bzero(va, PAGE_SIZE); + for (off = 0; off < PAGE_SIZE; off += cacheline_size) + __asm __volatile("dcbz 0,%0" :: "r"(pa + off)); } void @@ -1102,10 +1102,8 @@ moea_zero_page_area(mmu_t mmu, vm_page_t void moea_zero_page_idle(mmu_t mmu, vm_page_t m) { - vm_offset_t pa = VM_PAGE_TO_PHYS(m); - void *va = (void *)pa; - bzero(va, PAGE_SIZE); + moea_zero_page(mmu, m); } /* From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 2 16:04:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5D5BDF71; Sun, 2 Mar 2014 16:04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4843E1E2A; Sun, 2 Mar 2014 16:04: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 s22G4SrT046637; Sun, 2 Mar 2014 16:04:28 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22G4SRU046636; Sun, 2 Mar 2014 16:04:28 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403021604.s22G4SRU046636@svn.freebsd.org> From: Bryan Drewery Date: Sun, 2 Mar 2014 16:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262692 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 16:04:28 -0000 Author: bdrewery Date: Sun Mar 2 16:04:27 2014 New Revision: 262692 URL: http://svnweb.freebsd.org/changeset/base/262692 Log: MFC r262005: Remove redundant memcpy of fd_ofiles in fdgrowtable() Approved by: bapt (mentor, implicit) Modified: stable/10/sys/kern/kern_descrip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Mar 2 15:53:39 2014 (r262691) +++ stable/10/sys/kern/kern_descrip.c Sun Mar 2 16:04:27 2014 (r262692) @@ -1538,7 +1538,6 @@ fdgrowtable(struct filedesc *fdp, int nf memcpy(nmap, omap, NDSLOTS(onfiles) * sizeof(*omap)); /* update the pointers and counters */ - memcpy(ntable, otable, onfiles * sizeof(ntable[0])); fdp->fd_ofiles = ntable; fdp->fd_map = nmap; From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 2 16:25:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DAF11436; Sun, 2 Mar 2014 16:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9C9510CC; Sun, 2 Mar 2014 16:25: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 s22GPurv055002; Sun, 2 Mar 2014 16:25:56 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22GPuUI055001; Sun, 2 Mar 2014 16:25:56 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403021625.s22GPuUI055001@svn.freebsd.org> From: Bryan Drewery Date: Sun, 2 Mar 2014 16:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262693 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 16:25:57 -0000 Author: bdrewery Date: Sun Mar 2 16:25:56 2014 New Revision: 262693 URL: http://svnweb.freebsd.org/changeset/base/262693 Log: MFC r262006,r262328: r262006: Fix M_FILEDESC leak in fdgrowtable() introduced in r244510. fdgrowtable() now only reallocates fd_map when necessary. r262328: Style. Approved by: bapt (mentor, implicit) Modified: stable/10/sys/kern/kern_descrip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Mar 2 16:04:27 2014 (r262692) +++ stable/10/sys/kern/kern_descrip.c Sun Mar 2 16:25:56 2014 (r262693) @@ -1522,7 +1522,7 @@ fdgrowtable(struct filedesc *fdp, int nf return; /* - * Allocate a new table and map. We need enough space for the + * Allocate a new table. We need enough space for the * file entries themselves and the struct freetable we will use * when we decommission the table and place it on the freelist. * We place the struct freetable in the middle so we don't have @@ -1530,16 +1530,22 @@ fdgrowtable(struct filedesc *fdp, int nf */ ntable = malloc(nnfiles * sizeof(ntable[0]) + sizeof(struct freetable), M_FILEDESC, M_ZERO | M_WAITOK); - nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE, M_FILEDESC, - M_ZERO | M_WAITOK); - /* copy the old data over and point at the new tables */ memcpy(ntable, otable, onfiles * sizeof(*otable)); - memcpy(nmap, omap, NDSLOTS(onfiles) * sizeof(*omap)); - - /* update the pointers and counters */ fdp->fd_ofiles = ntable; - fdp->fd_map = nmap; + + /* + * Allocate a new map only if the old is not large enough. It will + * grow at a slower rate than the table as it can map more + * entries than the table can hold. + */ + if (NDSLOTS(nnfiles) > NDSLOTS(onfiles)) { + nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE, M_FILEDESC, + M_ZERO | M_WAITOK); + /* copy over the old data and update the pointer */ + memcpy(nmap, omap, NDSLOTS(onfiles) * sizeof(*omap)); + fdp->fd_map = nmap; + } /* * In order to have a valid pattern for fget_unlocked() @@ -1555,8 +1561,6 @@ fdgrowtable(struct filedesc *fdp, int nf * reference entries within it. Instead, place it on a freelist * which will be processed when the struct filedesc is released. * - * Do, however, free the old map. - * * Note that if onfiles == NDFILE, we're dealing with the original * static allocation contained within (struct filedesc0 *)fdp, * which must not be freed. @@ -1566,8 +1570,14 @@ fdgrowtable(struct filedesc *fdp, int nf fdp0 = (struct filedesc0 *)fdp; ft->ft_table = otable; SLIST_INSERT_HEAD(&fdp0->fd_free, ft, ft_next); - free(omap, M_FILEDESC); } + /* + * The map does not have the same possibility of threads still + * holding references to it. So always free it as long as it + * does not reference the original static allocation. + */ + if (NDSLOTS(onfiles) > NDSLOTS(NDFILE)) + free(omap, M_FILEDESC); } /* From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 2 23:09:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0D9EBE19; Sun, 2 Mar 2014 23:09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D43CC1395; Sun, 2 Mar 2014 23:09: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 s22N9aQX021307; Sun, 2 Mar 2014 23:09:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22N9arG021306; Sun, 2 Mar 2014 23:09:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403022309.s22N9arG021306@svn.freebsd.org> From: Warner Losh Date: Sun, 2 Mar 2014 23:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262698 - stable/10/sys/arm/at91 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 23:09:37 -0000 Author: imp Date: Sun Mar 2 23:09:36 2014 New Revision: 262698 URL: http://svnweb.freebsd.org/changeset/base/262698 Log: MRC: r260886 Merge only the uart_dev_at91usart.c part of this revision, since it has nothing to do with the commit log and was included by mistake there. This connects the new grab/ungrab upcalls that were revised in uart to fix mountroot>. Modified: stable/10/sys/arm/at91/uart_dev_at91usart.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- stable/10/sys/arm/at91/uart_dev_at91usart.c Sun Mar 2 22:59:34 2014 (r262697) +++ stable/10/sys/arm/at91/uart_dev_at91usart.c Sun Mar 2 23:09:36 2014 (r262698) @@ -219,20 +219,6 @@ at91_usart_param(struct uart_bas *bas, i return (0); } -static void -at91_usart_grab(struct uart_bas *bas) -{ - - WR4(bas, USART_IDR, USART_CSR_RXRDY); -} - -static void -at91_usart_ungrab(struct uart_bas *bas) -{ - - WR4(bas, USART_IER, USART_CSR_RXRDY); -} - static struct uart_ops at91_usart_ops = { .probe = at91_usart_probe, .init = at91_usart_init, @@ -240,8 +226,6 @@ static struct uart_ops at91_usart_ops = .putc = at91_usart_putc, .rxready = at91_usart_rxready, .getc = at91_usart_getc, - .grab = at91_usart_grab, - .ungrab = at91_usart_ungrab, }; static int @@ -331,6 +315,8 @@ static int at91_usart_bus_param(struct u static int at91_usart_bus_receive(struct uart_softc *); static int at91_usart_bus_setsig(struct uart_softc *, int); static int at91_usart_bus_transmit(struct uart_softc *); +static void at91_usart_bus_grab(struct uart_softc *); +static void at91_usart_bus_ungrab(struct uart_softc *); static kobj_method_t at91_usart_methods[] = { KOBJMETHOD(uart_probe, at91_usart_bus_probe), @@ -343,6 +329,8 @@ static kobj_method_t at91_usart_methods[ KOBJMETHOD(uart_receive, at91_usart_bus_receive), KOBJMETHOD(uart_setsig, at91_usart_bus_setsig), KOBJMETHOD(uart_transmit, at91_usart_bus_transmit), + KOBJMETHOD(uart_grab, at91_usart_bus_grab), + KOBJMETHOD(uart_ungrab, at91_usart_bus_ungrab), KOBJMETHOD_END }; @@ -815,6 +803,25 @@ at91_usart_bus_ioctl(struct uart_softc * return (EINVAL); } + +static void +at91_usart_bus_grab(struct uart_softc *sc) +{ + + uart_lock(sc->sc_hwmtx); + WR4(&sc->sc_bas, USART_IDR, USART_CSR_RXRDY); + uart_unlock(sc->sc_hwmtx); +} + +static void +at91_usart_bus_ungrab(struct uart_softc *sc) +{ + + uart_lock(sc->sc_hwmtx); + WR4(&sc->sc_bas, USART_IER, USART_CSR_RXRDY); + uart_unlock(sc->sc_hwmtx); +} + struct uart_class at91_usart_class = { "at91_usart", at91_usart_methods, From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 07:16:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6814187E; Mon, 3 Mar 2014 07:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4839A231; Mon, 3 Mar 2014 07:16: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 s237GgWS073835; Mon, 3 Mar 2014 07:16:42 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s237Ge5I073823; Mon, 3 Mar 2014 07:16:40 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403030716.s237Ge5I073823@svn.freebsd.org> From: Devin Teske Date: Mon, 3 Mar 2014 07:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262701 - in stable/10/sys/boot: forth i386/loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 07:16:42 -0000 Author: dteske Date: Mon Mar 3 07:16:39 2014 New Revision: 262701 URL: http://svnweb.freebsd.org/changeset/base/262701 Log: MFC r257650: Defer loading of kernel and modules if the beastie menu is enabled. Add a kernel selection menu to the beastie menu. List of kernels is taken from `kernels' in loader.conf(5) as a space (or comma) separated list of names to display (up to 9). If not set, default value is "kernel kernel.old". Does not validate that kernels exist because the next enhancement will be to allow selection of the root device. Discussed on: -current Modified: stable/10/sys/boot/forth/beastie.4th stable/10/sys/boot/forth/loader.4th stable/10/sys/boot/forth/loader.4th.8 stable/10/sys/boot/forth/loader.conf stable/10/sys/boot/forth/loader.conf.5 stable/10/sys/boot/forth/loader.rc stable/10/sys/boot/forth/menu-commands.4th stable/10/sys/boot/forth/menu.4th stable/10/sys/boot/forth/menu.rc stable/10/sys/boot/forth/menusets.4th stable/10/sys/boot/i386/loader/loader.rc Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/beastie.4th ============================================================================== --- stable/10/sys/boot/forth/beastie.4th Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/forth/beastie.4th Mon Mar 3 07:16:39 2014 (r262701) @@ -30,6 +30,8 @@ marker task-beastie.4th include /boot/delay.4th +only forth definitions also support-functions + variable logoX variable logoY @@ -275,7 +277,11 @@ variable logoY s" beastie_disable" getenv dup -1 <> if s" YES" compare-insensitive 0= if - exit + any_conf_read? if + load_kernel + load_modules + then + exit \ to autoboot (default) then else drop @@ -292,3 +298,5 @@ variable logoY delay_execute then ; + +only forth also Modified: stable/10/sys/boot/forth/loader.4th ============================================================================== --- stable/10/sys/boot/forth/loader.4th Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/forth/loader.4th Mon Mar 3 07:16:39 2014 (r262701) @@ -44,6 +44,14 @@ include /boot/color.4th only forth also support-functions also builtins definitions +: bootmsg ( -- ) + loader_color? if + ." Booting..." cr + else + ." Booting..." cr + then +; + : try-menu-unset \ menu-unset may not be present s" beastie_disable" getenv @@ -71,12 +79,6 @@ only forth also support-functions also b : boot 0= if ( interpreted ) get_arguments then - loader_color? if - ." Booting..." cr - else - ." Booting..." cr - then - \ Unload only if a path was passed dup if >r over r> swap @@ -85,25 +87,25 @@ only forth also support-functions also b else s" kernelname" getenv? if ( a kernel has been loaded ) try-menu-unset - 1 boot exit + bootmsg 1 boot exit then load_kernel_and_modules ?dup if exit then try-menu-unset - 0 1 boot exit + bootmsg 0 1 boot exit then else s" kernelname" getenv? if ( a kernel has been loaded ) try-menu-unset - 1 boot exit + bootmsg 1 boot exit then load_kernel_and_modules ?dup if exit then try-menu-unset - 0 1 boot exit + bootmsg 0 1 boot exit then load_kernel_and_modules - ?dup 0= if 0 1 boot then + ?dup 0= if bootmsg 0 1 boot then ; \ ***** boot-conf @@ -129,8 +131,8 @@ include /boot/check-password.4th \ ***** start \ \ Initializes support.4th global variables, sets loader_conf_files, -\ process conf files, and, if any one such file was succesfully -\ read to the end, load kernel and modules. +\ processes conf files, and, if any one such file was succesfully +\ read to the end, loads kernel and modules. : start ( -- ) ( throws: abort & user-defined ) s" /boot/defaults/loader.conf" initialize Modified: stable/10/sys/boot/forth/loader.4th.8 ============================================================================== --- stable/10/sys/boot/forth/loader.4th.8 Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/forth/loader.4th.8 Mon Mar 3 07:16:39 2014 (r262701) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2004 +.Dd October 17, 2013 .Dt LOADER.4TH 8 .Os .Sh NAME @@ -94,31 +94,35 @@ Reads .Pa /boot/defaults/loader.conf , all other .Xr loader.conf 5 -files specified in it, and then proceeds to boot as specified in them. -This +files specified in it, then loads the desired kernel and modules +.Pq if not already loaded . +After which you can use the +.Ic boot +or +.Ic autoboot +commmands or simply exit (provided +.Va autoboot_delay +is not set to NO) to boot the system. +.Ic start is the command used in the default .Pa /boot/loader.rc -file, and it uses the -.Ic autoboot -command (see -.Xr loader 8 ) , -so it can be stopped for further interaction with -.Xr loader 8 . +file +.Pq see Xr loader 8 . .Pp .It Ic initialize -Initialize the supporting library so commands can be used without -executing +Initialize the support library so commands can be used without executing .Ic start first. Like .Ic start , -reads +it reads .Pa /boot/defaults/loader.conf and all other .Xr loader.conf 5 -files specified in it. +files specified in it +.Pq but does not load kernel or modules . Returns a flag on the stack to indicate -if any configuration file was successfully loaded. +if any configuration files were successfully loaded. .Pp .It Ic read-conf Ar filename Reads and processes a Modified: stable/10/sys/boot/forth/loader.conf ============================================================================== --- stable/10/sys/boot/forth/loader.conf Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/forth/loader.conf Mon Mar 3 07:16:39 2014 (r262701) @@ -59,6 +59,7 @@ entropy_cache_type="/boot/entropy" # escape to the loader prompt, set to # "NO" to disable autobooting #beastie_disable="NO" # Turn the beastie boot menu on and off +#kernels="kernel kernel.old" # Kernels to display in the boot menu #loader_logo="orbbw" # Desired logo: orbbw, orb, fbsdbw, beastiebw, beastie, none #comconsole_speed="9600" # Set the current serial console speed #console="vidconsole" # A comma separated list of console(s) Modified: stable/10/sys/boot/forth/loader.conf.5 ============================================================================== --- stable/10/sys/boot/forth/loader.conf.5 Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/forth/loader.conf.5 Mon Mar 3 07:16:39 2014 (r262701) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd August 6, 2013 +.Dd October 18, 2013 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -209,6 +209,9 @@ replacing it with character (useful for embedded products and such). .It Va kernel .Pq Dq kernel +.It Va kernels +.Pq Dq kernel kernel.old +Space or comma separated list of kernels to present in the boot menu. .It Va loader_conf_files .Pq Dq Pa /boot/loader.conf /boot/loader.conf.local .It Va splash_bmp_load Modified: stable/10/sys/boot/forth/loader.rc ============================================================================== --- stable/10/sys/boot/forth/loader.rc Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/forth/loader.rc Mon Mar 3 07:16:39 2014 (r262701) @@ -5,6 +5,7 @@ include /boot/loader.4th \ Reads and processes loader.conf variables +\ NOTE: Change to `initialize' if you enable the below boot menu start \ Tests for password -- executes autoboot first if a password was defined Modified: stable/10/sys/boot/forth/menu-commands.4th ============================================================================== --- stable/10/sys/boot/forth/menu-commands.4th Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/forth/menu-commands.4th Mon Mar 3 07:16:39 2014 (r262701) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2012 Devin Teske +\ Copyright (c) 2006-2013 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -30,6 +30,8 @@ include /boot/menusets.4th variable kernel_state variable root_state +0 kernel_state ! +0 root_state ! \ \ Boot @@ -279,21 +281,21 @@ variable root_state init_cyclestate ( n k -- n ) ; -: cycle_kernel ( N -- N TRUE ) - cycle_menuitem - menu-redraw - - \ Now we're going to make the change effective - - dup cycle_stateN @ - dup kernel_state ! \ save a copy for re-initialization - 48 + \ convert to ASCII numeral +: activate_kernel ( N -- N ) + dup cycle_stateN @ ( n -- n n2 ) + dup kernel_state ! ( n n2 -- n n2 ) \ copy for re-initialization + 48 + ( n n2 -- n n2' ) \ kernel_state to ASCII num s" set kernel=${kernel_prefix}${kernel[N]}${kernel_suffix}" - 36 +c! \ replace 'N' with ASCII numeral - evaluate \ sets $kernel to full kernel-path + 36 +c! ( n n2 c-addr/u -- n c-addr/u ) \ 'N' to ASCII num + evaluate ( n c-addr/u -- n ) \ sets $kernel to full kernel-path +; - TRUE \ loop menu again +: cycle_kernel ( N -- N TRUE ) + cycle_menuitem \ cycle cycle_stateN to next value + activate_kernel \ apply current cycle_stateN + menu-redraw \ redraw menu + TRUE \ loop menu again ; \ @@ -305,21 +307,21 @@ variable root_state init_cyclestate ( n k -- n ) ; -: cycle_root ( N -- N TRUE ) - cycle_menuitem - menu-redraw - - \ Now we're going to make the change effective - - dup cycle_stateN @ - dup root_state ! \ save a copy for re-initialization - 48 + \ convert to ASCII numeral +: activate_root ( N -- N ) + dup cycle_stateN @ ( n -- n n2 ) + dup root_state ! ( n n2 -- n n2 ) \ copy for re-initialization + 48 + ( n n2 -- n n2' ) \ root_state to ASCII num s" set root=${root_prefix}${root[N]}${root_suffix}" - 30 +c! \ replace 'N' with ASCII numeral - evaluate \ sets $root to full root-path + 30 +c! ( n n2 c-addr/u -- n c-addr/u ) \ 'N' to ASCII num + evaluate ( n c-addr/u -- n ) \ sets $root to full kernel-path +; - TRUE \ loop menu again +: cycle_root ( N -- N TRUE ) + cycle_menuitem \ cycle cycle_stateN to next value + activate_root \ apply current cycle_stateN + menu-redraw \ redraw menu + TRUE \ loop menu again ; \ Modified: stable/10/sys/boot/forth/menu.4th ============================================================================== --- stable/10/sys/boot/forth/menu.4th Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/forth/menu.4th Mon Mar 3 07:16:39 2014 (r262701) @@ -70,6 +70,12 @@ variable menureboot variable menurebootadded variable menuacpi variable menuoptions +variable menukernel + +\ Parsing of kernels into menu-items +variable kernidx +variable kernlen +variable kernmenuidx \ Menu timer [count-down] variables variable menu_timeout_enabled \ timeout state (internal use only) @@ -109,14 +115,19 @@ variable cycle_state7 variable cycle_state8 \ Containers for storing the initial caption text -create init_text1 255 allot -create init_text2 255 allot -create init_text3 255 allot -create init_text4 255 allot -create init_text5 255 allot -create init_text6 255 allot -create init_text7 255 allot -create init_text8 255 allot +create init_text1 64 allot +create init_text2 64 allot +create init_text3 64 allot +create init_text4 64 allot +create init_text5 64 allot +create init_text6 64 allot +create init_text7 64 allot +create init_text8 64 allot + +\ Containers for parsing kernels into menu-items +create kerncapbuf 64 allot +create kerndefault 64 allot +create kernelsbuf 256 allot : +c! ( N C-ADDR/U K -- C-ADDR/U ) 3 pick 3 pick ( n c-addr/u k -- n c-addr/u k n c-addr ) @@ -124,45 +135,31 @@ create init_text8 255 allot rot drop ( n c-addr/u -- c-addr/u ) ; +: delim? ( C -- BOOL ) + dup 32 = ( c -- c bool ) \ [sp] space + over 9 = or ( c bool -- c bool ) \ [ht] horizontal tab + over 10 = or ( c bool -- c bool ) \ [nl] newline + over 13 = or ( c bool -- c bool ) \ [cr] carriage return + over [char] , = or ( c bool -- c bool ) \ comma + swap drop ( c bool -- bool ) \ return boolean +; + : menukeyN ( N -- ADDR ) s" menukeyN" 7 +c! evaluate ; : init_stateN ( N -- ADDR ) s" init_stateN" 10 +c! evaluate ; : toggle_stateN ( N -- ADDR ) s" toggle_stateN" 12 +c! evaluate ; : cycle_stateN ( N -- ADDR ) s" cycle_stateN" 11 +c! evaluate ; : init_textN ( N -- C-ADDR ) s" init_textN" 9 +c! evaluate ; -: str_loader_menu_frame ( -- C-ADDR/U ) s" loader_menu_frame" ; -: str_loader_menu_title ( -- C-ADDR/U ) s" loader_menu_title" ; -: str_loader_menu_title_align ( -- C-ADDR/U ) s" loader_menu_title_align" ; -: str_loader_menu_x ( -- C-ADDR/U ) s" loader_menu_x" ; -: str_loader_menu_y ( -- C-ADDR/U ) s" loader_menu_y" ; -: str_loader_menu_timeout_x ( -- C-ADDR/U ) s" loader_menu_timeout_x" ; -: str_loader_menu_timeout_y ( -- C-ADDR/U ) s" loader_menu_timeout_y" ; -: str_menu_init ( -- C-ADDR/U ) s" menu_init" ; -: str_menu_timeout_command ( -- C-ADDR/U ) s" menu_timeout_command" ; -: str_menu_reboot ( -- C-ADDR/U ) s" menu_reboot" ; -: str_menu_acpi ( -- C-ADDR/U ) s" menu_acpi" ; -: str_menu_options ( -- C-ADDR/U ) s" menu_options" ; -: str_menu_optionstext ( -- C-ADDR/U ) s" menu_optionstext" ; - -: str_menu_init[x] ( -- C-ADDR/U ) s" menu_init[x]" ; -: str_menu_command[x] ( -- C-ADDR/U ) s" menu_command[x]" ; -: str_menu_caption[x] ( -- C-ADDR/U ) s" menu_caption[x]" ; -: str_ansi_caption[x] ( -- C-ADDR/U ) s" ansi_caption[x]" ; -: str_menu_keycode[x] ( -- C-ADDR/U ) s" menu_keycode[x]" ; -: str_toggled_text[x] ( -- C-ADDR/U ) s" toggled_text[x]" ; -: str_toggled_ansi[x] ( -- C-ADDR/U ) s" toggled_ansi[x]" ; -: str_menu_caption[x][y] ( -- C-ADDR/U ) s" menu_caption[x][y]" ; -: str_ansi_caption[x][y] ( -- C-ADDR/U ) s" ansi_caption[x][y]" ; - -: menu_init[x] ( N -- C-ADDR/U ) str_menu_init[x] 10 +c! ; -: menu_command[x] ( N -- C-ADDR/U ) str_menu_command[x] 13 +c! ; -: menu_caption[x] ( N -- C-ADDR/U ) str_menu_caption[x] 13 +c! ; -: ansi_caption[x] ( N -- C-ADDR/U ) str_ansi_caption[x] 13 +c! ; -: menu_keycode[x] ( N -- C-ADDR/U ) str_menu_keycode[x] 13 +c! ; -: toggled_text[x] ( N -- C-ADDR/U ) str_toggled_text[x] 13 +c! ; -: toggled_ansi[x] ( N -- C-ADDR/U ) str_toggled_ansi[x] 13 +c! ; -: menu_caption[x][y] ( N M -- C-ADDR/U ) str_menu_caption[x][y] 16 +c! 13 +c! ; -: ansi_caption[x][y] ( N M -- C-ADDR/U ) str_ansi_caption[x][y] 16 +c! 13 +c! ; +: kernel[x] ( N -- C-ADDR/U ) s" kernel[x]" 7 +c! ; +: menu_init[x] ( N -- C-ADDR/U ) s" menu_init[x]" 10 +c! ; +: menu_command[x] ( N -- C-ADDR/U ) s" menu_command[x]" 13 +c! ; +: menu_caption[x] ( N -- C-ADDR/U ) s" menu_caption[x]" 13 +c! ; +: ansi_caption[x] ( N -- C-ADDR/U ) s" ansi_caption[x]" 13 +c! ; +: menu_keycode[x] ( N -- C-ADDR/U ) s" menu_keycode[x]" 13 +c! ; +: toggled_text[x] ( N -- C-ADDR/U ) s" toggled_text[x]" 13 +c! ; +: toggled_ansi[x] ( N -- C-ADDR/U ) s" toggled_ansi[x]" 13 +c! ; +: menu_caption[x][y] ( N M -- C-ADDR/U ) s" menu_caption[x][y]" 16 +c! 13 +c! ; +: ansi_caption[x][y] ( N M -- C-ADDR/U ) s" ansi_caption[x][y]" 16 +c! 13 +c! ; : arch-i386? ( -- BOOL ) \ Returns TRUE (-1) on i386, FALSE (0) otherwise. s" arch-i386" environment? dup if @@ -355,12 +352,9 @@ create init_text8 255 allot then ( n addr 0 n 48 -- n addr 0 c-addr/u ) getenv dup -1 = if - \ This is highly unlikely to occur, but to make - \ sure that things move along smoothly, allocate - \ a temporary NULL string - - drop ( n addr 0 -1 -- n addr 0 ) \ getenv cruft - s" " ( n addr 0 -- n addr 0 c-addr/u ) + \ Highly unlikely to occur, but to ensure things move + \ along smoothly, allocate a temporary NULL string + drop ( cruft ) s" " then then @@ -418,15 +412,15 @@ create init_text8 255 allot acpipresent? if acpienabled? if loader_color? if - str_toggled_ansi[x] + s" toggled_ansi[x]" else - str_toggled_text[x] + s" toggled_text[x]" then else loader_color? if - str_ansi_caption[x] + s" ansi_caption[x]" else - str_menu_caption[x] + s" menu_caption[x]" then then else @@ -438,17 +432,198 @@ create init_text8 255 allot then ; +\ This function parses $kernels into variables that are used by the menu to +\ display wich kernel to boot when the [overloaded] `boot' word is interpreted. +\ Used internally by menu-create, you need not (nor should you) call this +\ directly. +\ +: parse-kernels ( N -- ) \ kernidx + kernidx ! ( n -- ) \ store provided `x' value + [char] 0 kernmenuidx ! \ initialize `y' value for menu_caption[x][y] + + \ Attempt to get a list of kernels, fall back to sensible default + s" kernels" getenv dup -1 = if + drop ( cruft ) + s" kernel kernel.old" + then ( -- c-addr/u ) + + \ Check to see if the user has altered $kernel by comparing it against + \ $kernel[N] where N is kernel_state (the actively displayed kernel). + s" kernel_state" evaluate @ 48 + s" kernel[N]" 7 +c! getenv + dup -1 <> if + s" kernel" getenv dup -1 = if + drop ( cruft ) s" " + then + 2swap 2over compare 0= if + 2drop FALSE ( skip below conditional ) + else \ User has changed $kernel + TRUE ( slurp in new value ) + then + else \ We haven't yet parsed $kernels into $kernel[N] + drop ( getenv cruft ) + s" kernel" getenv dup -1 = if + drop ( cruft ) s" " + then + TRUE ( slurp in initial value ) + then ( c-addr/u -- c-addr/u c-addr/u,-1 | 0 ) + if \ slurp new value into kerndefault + kerndefault 1+ 0 2swap strcat swap 1- c! + then + + \ Clear out existing parsed-kernels + kernidx @ [char] 0 + begin + dup kernel[x] unsetenv + 2dup menu_caption[x][y] unsetenv + 2dup ansi_caption[x][y] unsetenv + 1+ dup [char] 8 > + until + 2drop + + \ Step through the string until we find the end + begin + 0 kernlen ! \ initialize length of value + + \ Skip leading whitespace and/or comma delimiters + begin + dup 0<> if + over c@ delim? ( c-addr/u -- c-addr/u bool ) + else + false ( c-addr/u -- c-addr/u bool ) + then + while + 1- swap 1+ swap ( c-addr/u -- c-addr'/u' ) + repeat + ( c-addr/u -- c-addr'/u' ) + + dup 0= if \ end of string while eating whitespace + 2drop ( c-addr/u -- ) + kernmenuidx @ [char] 0 <> if \ found at least one + exit \ all done + then + + \ No entries in $kernels; use $kernel instead + s" kernel" getenv dup -1 = if + drop ( cruft ) s" " + then ( -- c-addr/u ) + dup kernlen ! \ store entire value length as kernlen + else + \ We're still within $kernels parsing toward the end; + \ find delimiter/end to determine kernlen + 2dup ( c-addr/u -- c-addr/u c-addr/u ) + begin dup 0<> while + over c@ delim? if + drop 0 ( break ) \ found delimiter + else + kernlen @ 1+ kernlen ! \ incrememnt + 1- swap 1+ swap \ c-addr++ u-- + then + repeat + 2drop ( c-addr/u c-addr'/u' -- c-addr/u ) + + \ If this is the first entry, compare it to $kernel + \ If different, then insert $kernel beforehand + kernmenuidx @ [char] 0 = if + over kernlen @ kerndefault count compare if + kernelsbuf 0 kerndefault count strcat + s" ," strcat 2swap strcat + kerndefault count swap drop kernlen ! + then + then + then + ( c-addr/u -- c-addr'/u' ) + + \ At this point, we should have something on the stack to store + \ as the next kernel menu option; start assembling variables + + over kernlen @ ( c-addr/u -- c-addr/u c-addr/u2 ) + + \ Assign first to kernel[x] + 2dup kernmenuidx @ kernel[x] setenv + + \ Assign second to menu_caption[x][y] + kerncapbuf 0 s" [K]ernel: " strcat + 2over strcat + kernidx @ kernmenuidx @ menu_caption[x][y] + setenv + + \ Assign third to ansi_caption[x][y] + kerncapbuf 0 s" Kernel: " strcat + kernmenuidx @ [char] 0 = if + s" default/" + else + s" " + then strcat + 2over strcat + s" " strcat + kernidx @ kernmenuidx @ ansi_caption[x][y] + setenv + + 2drop ( c-addr/u c-addr/u2 -- c-addr/u ) + + kernmenuidx @ 1+ dup kernmenuidx ! [char] 8 > if + 2drop ( c-addr/u -- ) exit + then + + kernlen @ - swap kernlen @ + swap ( c-addr/u -- c-addr'/u' ) + again +; + +\ This function goes through the kernels that were discovered by the +\ parse-kernels function [above], adding " (# of #)" text to the end of each +\ caption. +\ +: tag-kernels ( -- ) + kernidx @ ( -- x ) dup 0= if exit then + [char] 0 s" (Y of Z)" ( x -- x y c-addr/u ) + kernmenuidx @ -rot 7 +c! \ Replace 'Z' with number of kernels parsed + begin + 2 pick 1+ -rot 2 +c! \ Replace 'Y' with current ASCII num + + 2over menu_caption[x][y] getenv dup -1 <> if + 2dup + 1- c@ [char] ) = if + 2drop \ Already tagged + else + kerncapbuf 0 2swap strcat + 2over strcat + 5 pick 5 pick menu_caption[x][y] setenv + then + else + drop ( getenv cruft ) + then + + 2over ansi_caption[x][y] getenv dup -1 <> if + 2dup + 1- c@ [char] ) = if + 2drop \ Already tagged + else + kerncapbuf 0 2swap strcat + 2over strcat + 5 pick 5 pick ansi_caption[x][y] setenv + then + else + drop ( getenv cruft ) + then + + rot 1+ dup [char] 8 > if + -rot 2drop TRUE ( break ) + else + -rot FALSE + then + until + 2drop ( x y -- ) +; + \ This function creates the list of menu items. This function is called by the \ menu-display function. You need not be call it directly. \ : menu-create ( -- ) \ Print the frame caption at (x,y) - str_loader_menu_title getenv dup -1 = if + s" loader_menu_title" getenv dup -1 = if drop s" Welcome to FreeBSD" then TRUE ( use default alignment ) - str_loader_menu_title_align getenv dup -1 <> if + s" loader_menu_title_align" getenv dup -1 <> if 2dup s" left" compare-insensitive 0= if ( 1 ) 2drop ( c-addr/u ) drop ( bool ) menuX @ menuY @ 1- @@ -470,7 +645,7 @@ create init_text8 255 allot \ constructed dynamically -- as this function could conceivably set \ the remaining environment variables to construct the menu entirely). \ - str_menu_init getenv dup -1 <> if + s" menu_init" getenv dup -1 <> if evaluate else drop @@ -495,7 +670,7 @@ create init_text8 255 allot \ Initialize the ACPI option status. \ 0 menuacpi ! - str_menu_acpi getenv -1 <> if + s" menu_acpi" getenv -1 <> if c@ dup 48 > over 57 < and if ( '1' <= c1 <= '8' ) menuacpi ! arch-i386? if acpipresent? if @@ -511,10 +686,51 @@ create init_text8 255 allot then \ + \ Initialize kernel captions after parsing $kernels + \ + 0 menukernel ! + s" menu_kernel" getenv -1 <> if + c@ dup 48 > over 57 < and if ( '1' <= c1 <= '8' ) + dup menukernel ! + dup parse-kernels tag-kernels + + \ Get the current cycle state (entry to use) + s" kernel_state" evaluate @ 48 + ( n -- n y ) + + \ If state is invalid, reset + dup kernmenuidx @ 1- > if + drop [char] 0 ( n y -- n 48 ) + 0 s" kernel_state" evaluate ! + over s" init_kernel" evaluate drop + then + + \ Set the current non-ANSI caption + 2dup swap dup ( n y -- n y y n n ) + s" set menu_caption[x]=$menu_caption[x][y]" + 17 +c! 34 +c! 37 +c! evaluate + ( n y y n n c-addr/u -- n y ) + + \ Set the current ANSI caption + 2dup swap dup ( n y -- n y y n n ) + s" set ansi_caption[x]=$ansi_caption[x][y]" + 17 +c! 34 +c! 37 +c! evaluate + ( n y y n n c-addr/u -- n y ) + + \ Initialize cycle state from stored value + 48 - ( n y -- n k ) + s" init_cyclestate" evaluate ( n k -- n ) + + \ Set $kernel to $kernel[y] + s" activate_kernel" evaluate ( n -- n ) + then + drop + then + + \ \ Initialize the menu_options visual separator. \ 0 menuoptions ! - str_menu_options getenv -1 <> if + s" menu_options" getenv -1 <> if c@ dup 48 > over 57 < and if ( '1' <= c1 <= '8' ) menuoptions ! else @@ -534,7 +750,7 @@ create init_text8 255 allot \ If the "Options:" separator, print it. dup menuoptions @ = if \ Optionally add a reboot option to the menu - str_menu_reboot getenv -1 <> if + s" menu_reboot" getenv -1 <> if drop s" Reboot" printmenuitem menureboot ! true menurebootadded ! @@ -544,7 +760,7 @@ create init_text8 255 allot menurow @ 2 + menurow ! menurow @ menuY @ + at-xy - str_menu_optionstext getenv dup -1 <> if + s" menu_optionstext" getenv dup -1 <> if type else drop ." Options:" @@ -603,7 +819,7 @@ create init_text8 255 allot \ Optionally add a reboot option to the menu menurebootadded @ true <> if - str_menu_reboot getenv -1 <> if + s" menu_reboot" getenv -1 <> if drop \ no need for the value s" Reboot" \ menu caption (required by printmenuitem) @@ -684,7 +900,7 @@ create init_text8 255 allot \ (user did not cancel by pressing ANY \ key) - str_menu_timeout_command getenv dup + s" menu_timeout_command" getenv dup -1 = if drop \ clean-up else @@ -758,7 +974,7 @@ create init_text8 255 allot 0 menurow ! \ Initialize the starting position for the menu \ Assign configuration values - str_loader_menu_y getenv dup -1 = if + s" loader_menu_y" getenv dup -1 = if drop \ no custom row position menu_default_y else @@ -768,7 +984,7 @@ create init_text8 255 allot then then menuY ! - str_loader_menu_x getenv dup -1 = if + s" loader_menu_x" getenv dup -1 = if drop \ no custom column position menu_default_x else @@ -781,7 +997,7 @@ create init_text8 255 allot \ Interpret a custom frame type for the menu TRUE ( draw a box? default yes, but might be altered below ) - str_loader_menu_frame getenv dup -1 = if ( 1 ) + s" loader_menu_frame" getenv dup -1 = if ( 1 ) drop \ no custom frame type else ( 1 ) 2dup s" single" compare-insensitive 0= if ( 2 ) f_single ( see frames.4th ) @@ -804,7 +1020,7 @@ create init_text8 255 allot 0 menu_timeout_enabled ! \ start with automatic timeout disabled \ check indication that automatic execution after delay is requested - str_menu_timeout_command getenv -1 <> if ( Addr C -1 -- | Addr ) + s" menu_timeout_command" getenv -1 <> if ( Addr C -1 -- | Addr ) drop ( just testing existence right now: Addr -- ) \ initialize state variables @@ -840,7 +1056,7 @@ create init_text8 255 allot menu_timeout_enabled @ 1 = if \ read custom column position (if set) - str_loader_menu_timeout_x getenv dup -1 = if + s" loader_menu_timeout_x" getenv dup -1 = if drop \ no custom column position menu_timeout_default_x \ use default setting else @@ -852,7 +1068,7 @@ create init_text8 255 allot menu_timeout_x ! ( store value on stack from above ) \ read custom row position (if set) - str_loader_menu_timeout_y getenv dup -1 = if + s" loader_menu_timeout_y" getenv dup -1 = if drop \ no custom row position menu_timeout_default_y \ use default setting else @@ -1005,12 +1221,13 @@ create init_text8 255 allot until drop \ iterator - str_menu_timeout_command unsetenv \ menu timeout command - str_menu_reboot unsetenv \ Reboot menu option flag - str_menu_acpi unsetenv \ ACPI menu option flag - str_menu_options unsetenv \ Options separator flag - str_menu_optionstext unsetenv \ separator display text - str_menu_init unsetenv \ menu initializer + s" menu_timeout_command" unsetenv \ menu timeout command + s" menu_reboot" unsetenv \ Reboot menu option flag + s" menu_acpi" unsetenv \ ACPI menu option flag + s" menu_kernel" unsetenv \ Kernel menu option flag + s" menu_options" unsetenv \ Options separator flag + s" menu_optionstext" unsetenv \ separator display text + s" menu_init" unsetenv \ menu initializer 0 menureboot ! 0 menuacpi ! Modified: stable/10/sys/boot/forth/menu.rc ============================================================================== --- stable/10/sys/boot/forth/menu.rc Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/forth/menu.rc Mon Mar 3 07:16:39 2014 (r262701) @@ -55,10 +55,14 @@ set mainmenu_reboot \ set mainmenu_options=5 -set mainmenu_caption[5]="Configure Boot [O]ptions..." -set mainmenu_command[5]="2 goto_menu" -set mainmenu_keycode[5]=111 -set mainansi_caption[5]="Configure Boot Options..." +set mainmenu_kernel=5 +set mainmenu_command[5]="cycle_kernel" +set mainmenu_keycode[5]=107 + +set mainmenu_caption[6]="Configure Boot [O]ptions..." +set mainmenu_command[6]="2 goto_menu" +set mainmenu_keycode[6]=111 +set mainansi_caption[6]="Configure Boot Options..." \ \ BOOT OPTIONS MENU Modified: stable/10/sys/boot/forth/menusets.4th ============================================================================== --- stable/10/sys/boot/forth/menusets.4th Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/forth/menusets.4th Mon Mar 3 07:16:39 2014 (r262701) @@ -366,6 +366,7 @@ create menuset_y 1 allot \ menuset1_command[x] -> menu_command[x] \ menuset1_init -> ``evaluated'' \ menuset1_init[x] -> menu_init[x] + \ menuset1_kernel -> menu_kernel \ menuset1_keycode[x] -> menu_keycode[x] \ menuset1_options -> menu_options \ menuset1_optionstext -> menu_optionstext @@ -382,6 +383,7 @@ create menuset_y 1 allot \ {name}menu_command[x] -> menu_command[x] \ {name}menu_init -> ``evaluated'' \ {name}menu_init[x] -> menu_init[x] + \ {name}menu_kernel -> menu_kernel \ {name}menu_keycode[x] -> menu_keycode[x] \ {name}menu_options -> menu_options \ {name}menu_optionstext -> menu_optionstext @@ -520,6 +522,10 @@ create menuset_y 1 allot s" set var=acpi" evaluate menuset-loadmenuvar + \ ... menu_kernel ... + s" set var=kernel" evaluate + menuset-loadmenuvar + \ ... menu_options ... s" set var=options" evaluate menuset-loadmenuvar @@ -597,6 +603,7 @@ create menuset_y 1 allot s" set var=acpi" evaluate menuset-unloadmenuvar s" set var=init" evaluate menuset-unloadmenuvar + s" set var=kernel" evaluate menuset-unloadmenuvar s" set var=options" evaluate menuset-unloadmenuvar s" set var=optionstext" evaluate menuset-unloadmenuvar s" set var=reboot" evaluate menuset-unloadmenuvar Modified: stable/10/sys/boot/i386/loader/loader.rc ============================================================================== --- stable/10/sys/boot/i386/loader/loader.rc Mon Mar 3 00:27:51 2014 (r262700) +++ stable/10/sys/boot/i386/loader/loader.rc Mon Mar 3 07:16:39 2014 (r262701) @@ -5,7 +5,7 @@ include /boot/loader.4th \ Reads and processes loader.conf variables -start +initialize \ Tests for password -- executes autoboot first if a password was defined check-password From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 07:24:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9D53AA89; Mon, 3 Mar 2014 07:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DB402F3; Mon, 3 Mar 2014 07:24: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 s237OpVv077576; Mon, 3 Mar 2014 07:24:51 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s237Oogb077573; Mon, 3 Mar 2014 07:24:50 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403030724.s237Oogb077573@svn.freebsd.org> From: Devin Teske Date: Mon, 3 Mar 2014 07:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262702 - stable/10/sys/boot/forth X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 07:24:51 -0000 Author: dteske Date: Mon Mar 3 07:24:50 2014 New Revision: 262702 URL: http://svnweb.freebsd.org/changeset/base/262702 Log: MFC r257821: Extend loader_delay as-documented in beastie.4th(8) and delay.4th(8), making it available to architectures that do not use or load the beastie menu. This is reported to save headaches on some PPC systems where unload followed by load does not produce the desired results wherein if-given the opportunity to abort the initial loading sequence, you can customize the first load. Reviewed by: nwhitehorn, kan Discussed on: -current Modified: stable/10/sys/boot/forth/beastie.4th stable/10/sys/boot/forth/loader.4th stable/10/sys/boot/forth/loader.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/beastie.4th ============================================================================== --- stable/10/sys/boot/forth/beastie.4th Mon Mar 3 07:16:39 2014 (r262701) +++ stable/10/sys/boot/forth/beastie.4th Mon Mar 3 07:24:50 2014 (r262702) @@ -28,8 +28,6 @@ marker task-beastie.4th -include /boot/delay.4th - only forth definitions also support-functions variable logoX Modified: stable/10/sys/boot/forth/loader.4th ============================================================================== --- stable/10/sys/boot/forth/loader.4th Mon Mar 3 07:16:39 2014 (r262701) +++ stable/10/sys/boot/forth/loader.4th Mon Mar 3 07:24:50 2014 (r262702) @@ -41,6 +41,7 @@ s" arch-i386" environment? [if] [if] include /boot/support.4th include /boot/color.4th +include /boot/delay.4th only forth also support-functions also builtins definitions @@ -141,8 +142,17 @@ include /boot/check-password.4th \ Will *NOT* try to load kernel and modules if no configuration file \ was succesfully loaded! any_conf_read? if - load_kernel - load_modules + s" loader_delay" getenv -1 = if + load_kernel + load_modules + else + drop + ." Loading Kernel and Modules (Ctrl-C to Abort)" cr + s" also support-functions" evaluate + s" set delay_command='load_kernel load_modules'" evaluate + s" set delay_showdots" evaluate + delay_execute + then then ; Modified: stable/10/sys/boot/forth/loader.conf ============================================================================== --- stable/10/sys/boot/forth/loader.conf Mon Mar 3 07:16:39 2014 (r262701) +++ stable/10/sys/boot/forth/loader.conf Mon Mar 3 07:24:50 2014 (r262702) @@ -53,6 +53,8 @@ entropy_cache_type="/boot/entropy" ### Loader settings ######################################## ############################################################## +#loader_delay="3" # Delay in seconds before loading anything. + # Default is unset and disabled (no delay). #autoboot_delay="10" # Delay in seconds before autobooting, # set to -1 if you don't want user to be # allowed to interrupt autoboot process and From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 07:28:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AC86ACD0; Mon, 3 Mar 2014 07:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F4BA311; Mon, 3 Mar 2014 07:28: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 s237Suaa078171; Mon, 3 Mar 2014 07:28:56 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s237Sun8078170; Mon, 3 Mar 2014 07:28:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403030728.s237Sun8078170@svn.freebsd.org> From: Devin Teske Date: Mon, 3 Mar 2014 07:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262703 - stable/10/sys/boot/forth X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 07:28:56 -0000 Author: dteske Date: Mon Mar 3 07:28:56 2014 New Revision: 262703 URL: http://svnweb.freebsd.org/changeset/base/262703 Log: MFC r258269: Refactor draw-beastie function. Discussed on: -hackers Modified: stable/10/sys/boot/forth/beastie.4th Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/beastie.4th ============================================================================== --- stable/10/sys/boot/forth/beastie.4th Mon Mar 3 07:24:50 2014 (r262702) +++ stable/10/sys/boot/forth/beastie.4th Mon Mar 3 07:28:56 2014 (r262703) @@ -202,56 +202,26 @@ variable logoY drop then - s" loader_logo" getenv dup -1 = if - logoX @ logoY @ - loader_color? if - orb-logo - else - orbbw-logo - then - drop exit - then - - 2dup s" beastie" compare-insensitive 0= if - logoX @ logoY @ beastie-logo - 2drop exit - then - 2dup s" beastiebw" compare-insensitive 0= if - logoX @ logoY @ beastiebw-logo - 2drop exit - then - 2dup s" fbsdbw" compare-insensitive 0= if - logoX @ logoY @ fbsdbw-logo - 2drop exit - then - 2dup s" orb" compare-insensitive 0= if - logoX @ logoY @ orb-logo - 2drop exit - then - 2dup s" orbbw" compare-insensitive 0= if - logoX @ logoY @ orbbw-logo - 2drop exit - then - 2dup s" tribute" compare-insensitive 0= if - logoX @ logoY @ - s" tribute-logo" sfind if - execute - else - drop orb-logo - then - 2drop exit + s" loader_logo" getenv dup -1 <> if + dup 5 + allocate if ENOMEM throw then + 0 2swap strcat s" -logo" strcat + over -rot ( a-addr/u -- a-addr a-addr/u ) + sfind ( a-addr a-addr/u -- a-addr xt bool ) + rot ( a-addr xt bool -- xt bool a-addr ) + free ( xt bool a-addr -- xt bool ior ) + if EFREE throw then + else + 0 ( cruft -- cruft bool ) \ load the default below then - 2dup s" tributebw" compare-insensitive 0= if - logoX @ logoY @ - s" tributebw-logo" sfind if - execute + 0= if + drop ( cruft -- ) + loader_color? if + ['] orb-logo else - drop orbbw-logo + ['] orbbw-logo then - 2drop exit then - - 2drop + logoX @ logoY @ rot execute ; : clear-beastie ( -- ) \ clears beastie from the screen From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 07:31:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6F38CF76; Mon, 3 Mar 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5B251391; Mon, 3 Mar 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 s237VuKt081185; Mon, 3 Mar 2014 07:31:56 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s237Vt9p081179; Mon, 3 Mar 2014 07:31:55 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403030731.s237Vt9p081179@svn.freebsd.org> From: Devin Teske Date: Mon, 3 Mar 2014 07:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262704 - in stable/10/sys/boot: forth i386/loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 07:31:56 -0000 Author: dteske Date: Mon Mar 3 07:31:55 2014 New Revision: 262704 URL: http://svnweb.freebsd.org/changeset/base/262704 Log: MFC r258270: Add a try-include word (which acts the same as "include") and use it to conditionally include (but ignore failures) /boot/loader.rc.local and /boot/menu.rc.local -- to make customizing the menu easier. Reviewed by: alfred Discussed on: -hackers Modified: stable/10/sys/boot/forth/loader.4th stable/10/sys/boot/forth/loader.4th.8 stable/10/sys/boot/forth/loader.rc stable/10/sys/boot/forth/menu.rc stable/10/sys/boot/i386/loader/loader.rc Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/loader.4th ============================================================================== --- stable/10/sys/boot/forth/loader.4th Mon Mar 3 07:28:56 2014 (r262703) +++ stable/10/sys/boot/forth/loader.4th Mon Mar 3 07:31:55 2014 (r262704) @@ -233,7 +233,16 @@ include /boot/check-password.4th s" disable-module" s" disable loading of a module" .? s" toggle-module" s" toggle loading of a module" .? s" show-module" s" show module load data" .? + s" try-include" s" try to load/interpret files" .? ; +: try-include ( -- ) \ see loader.4th(8) + ['] include ( -- xt ) \ get the execution token of `include' + catch ( xt -- exception# | 0 ) if \ failed + LF parse ( c -- s-addr/u ) 2drop \ advance >in to EOL (drop data) + \ ... prevents words unused by `include' from being interpreted + then +; immediate \ interpret immediately for access to `source' (aka tib) + only forth also Modified: stable/10/sys/boot/forth/loader.4th.8 ============================================================================== --- stable/10/sys/boot/forth/loader.4th.8 Mon Mar 3 07:28:56 2014 (r262703) +++ stable/10/sys/boot/forth/loader.4th.8 Mon Mar 3 07:31:55 2014 (r262704) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2013 +.Dd November 13, 2013 .Dt LOADER.4TH 8 .Os .Sh NAME @@ -158,6 +158,13 @@ files to specify the action after a modu Used inside .Xr loader.conf 5 files to specify the action after a module loading fails. +.It Ic try-include Ar file Op Ar +Process script files if they exist. +Each file, in turn, is completely read into memory, +and then each of its lines is passed to the command line interpreter. +If any error is returned by the interpreter, the try-include +command aborts immediately, without reading any other files, and +silently returns without error. .El .Sh FILES .Bl -tag -width /boot/loader.4th -compact Modified: stable/10/sys/boot/forth/loader.rc ============================================================================== --- stable/10/sys/boot/forth/loader.rc Mon Mar 3 07:28:56 2014 (r262703) +++ stable/10/sys/boot/forth/loader.rc Mon Mar 3 07:31:55 2014 (r262704) @@ -3,6 +3,7 @@ \ \ Includes additional commands include /boot/loader.4th +try-include /boot/loader.rc.local \ Reads and processes loader.conf variables \ NOTE: Change to `initialize' if you enable the below boot menu Modified: stable/10/sys/boot/forth/menu.rc ============================================================================== --- stable/10/sys/boot/forth/menu.rc Mon Mar 3 07:28:56 2014 (r262703) +++ stable/10/sys/boot/forth/menu.rc Mon Mar 3 07:31:55 2014 (r262704) @@ -120,6 +120,10 @@ set optionstoggled_ansi[6]="Ver \ set menu_timeout_command="boot" +\ Include optional elements defined in a local file +\ +try-include /boot/menu.rc.local + \ Display the main menu (see `menu.4th') set menuset_initial=1 menuset-loadinitial Modified: stable/10/sys/boot/i386/loader/loader.rc ============================================================================== --- stable/10/sys/boot/i386/loader/loader.rc Mon Mar 3 07:28:56 2014 (r262703) +++ stable/10/sys/boot/i386/loader/loader.rc Mon Mar 3 07:31:55 2014 (r262704) @@ -3,6 +3,7 @@ \ \ Includes additional commands include /boot/loader.4th +try-include /boot/loader.rc.local \ Reads and processes loader.conf variables initialize From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 16:01:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C456FB90; Mon, 3 Mar 2014 16:01:27 +0000 (UTC) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 07F8E8EB; Mon, 3 Mar 2014 16:01:26 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.7/8.14.7) with ESMTP id s23G1Jua078256; Mon, 3 Mar 2014 10:01:19 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id s23G1JmN078255; Mon, 3 Mar 2014 10:01:19 -0600 (CST) (envelope-from brooks) Date: Mon, 3 Mar 2014 10:01:19 -0600 From: Brooks Davis To: Tijl Coosemans Subject: Re: svn commit: r262648 - in stable/10/usr.sbin: mtree nmtree Message-ID: <20140303160119.GB17206@lor.one-eyed-alien.net> References: <201403010339.s213dum7042965@svn.freebsd.org> <20140301140232.0c60d827@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bp/iNruPH9dso1Pn" Content-Disposition: inline In-Reply-To: <20140301140232.0c60d827@kalimero.tijl.coosemans.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 16:01:27 -0000 --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 01, 2014 at 02:02:32PM +0100, Tijl Coosemans wrote: > On Sat, 1 Mar 2014 03:39:56 +0000 (UTC) Brooks Davis wrote: > > Author: brooks > > Date: Sat Mar 1 03:39:56 2014 > > New Revision: 262648 > > URL: http://svnweb.freebsd.org/changeset/base/262648 > >=20 > > Log: > > MFC: 261298 > > Merge from CheriBSD: > > commit 70b8f0c127db6b80411789d237b403cc64a93573 > > Author: Brooks Davis > > Date: Mon Jan 27 22:53:57 2014 +0000 > > =20 > > Move mtree.5 to usr.sbin/nmtree. > > Remove note that mtree 2.0 format files aren't supported. > > =20 > > Sponsored by: DARPA, AFRL >=20 > This broke stable and caused a flood of tinderbox emails on stable@ so > I've reverted this for now. >=20 Thank you and sorry about that. I was pretty certain I did a full buildworld with this change, but obviously not. :( -- Brooks --bp/iNruPH9dso1Pn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iKYEARECAGYFAlMUp09fFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDY1NUQ1MTlDMjZBNzgyRTcyNTI5OUJGMDVE OEU4QkU5RjIzODFBRDQACgkQXY6L6fI4GtRWAQCeLzjNwjQcqsvdWs4ssVpgPsyo 5ykAoL0VAF1lHoowaM8r1l9frUp2ib8w =eTua -----END PGP SIGNATURE----- --bp/iNruPH9dso1Pn-- From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 20:28:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CD937820; Mon, 3 Mar 2014 20:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA02D9AD; Mon, 3 Mar 2014 20:28: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 s23KSREj003417; Mon, 3 Mar 2014 20:28:27 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23KSRwG003416; Mon, 3 Mar 2014 20:28:27 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201403032028.s23KSRwG003416@svn.freebsd.org> From: Brooks Davis Date: Mon, 3 Mar 2014 20:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262717 - stable/10/sys/mips/mips X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 20:28:27 -0000 Author: brooks Date: Mon Mar 3 20:28:27 2014 New Revision: 262717 URL: http://svnweb.freebsd.org/changeset/base/262717 Log: MFR r261294: Remove an unneeded space in the BERI merge. Sponsored by: DARPA, AFRL Modified: stable/10/sys/mips/mips/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/mips/mips/machdep.c ============================================================================== --- stable/10/sys/mips/mips/machdep.c Mon Mar 3 18:06:25 2014 (r262716) +++ stable/10/sys/mips/mips/machdep.c Mon Mar 3 20:28:27 2014 (r262717) @@ -351,7 +351,7 @@ mips_vector_init(void) * XXXRW: Why don't we install the XTLB handler for all 64-bit * architectures? */ -#if defined(__mips_n64) || defined(CPU_RMI) || defined(CPU_NLM) || defined (CPU_BERI) +#if defined(__mips_n64) || defined(CPU_RMI) || defined(CPU_NLM) || defined(CPU_BERI) /* Fake, but sufficient, for the 32-bit with 64-bit hardware addresses */ bcopy(MipsTLBMiss, (void *)MIPS_XTLB_MISS_EXC_VEC, MipsTLBMissEnd - MipsTLBMiss); From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 21:37:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9F0912B0; Mon, 3 Mar 2014 21:37:21 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 716BE39F; Mon, 3 Mar 2014 21:37:21 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 63AC0B9B2; Mon, 3 Mar 2014 16:37:20 -0500 (EST) From: John Baldwin To: "Dag-Erling SmXXrgrav" Subject: Re: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-comp... Date: Mon, 3 Mar 2014 15:36:33 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201402271729.s1RHT2rx075258@svn.freebsd.org> In-Reply-To: <201402271729.s1RHT2rx075258@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201403031536.33679.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 03 Mar 2014 16:37:20 -0500 (EST) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 21:37:21 -0000 On Thursday, February 27, 2014 12:29:02 pm Dag-Erling SmXXrgrav wrote: > Author: des > Date: Thu Feb 27 17:29:02 2014 > New Revision: 262566 > URL: http://svnweb.freebsd.org/changeset/base/262566 > > Log: > MFH (r261320): upgrade openssh to 6.5p1 > MFH (r261340): enable sandboxing by default Mails on stable@ suggest that this latter change may be a bit of a POLA violation as if people are using a custom kernel configuration that doesn't include CAPSICUM they are now locked out of their boxes as sshd fails. It seems that this is at least worth a note in UPDATING if not adding a workaround to handle the case of a kernel without CAPSICUM. -- John Baldwin From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 21:48:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 97DAA812; Mon, 3 Mar 2014 21:48:03 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D235695; Mon, 3 Mar 2014 21:48:02 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::57d:1c3a:5caa:e272] (unknown [IPv6:2001:7b8:3a7:0:57d:1c3a:5caa:e272]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 22D1A5C45; Mon, 3 Mar 2014 22:47:54 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_CBC3B360-4D04-4FA9-BFAB-F0322AE98CD6"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-comp... From: Dimitry Andric In-Reply-To: <201403031536.33679.jhb@freebsd.org> Date: Mon, 3 Mar 2014 22:47:43 +0100 Message-Id: References: <201402271729.s1RHT2rx075258@svn.freebsd.org> <201403031536.33679.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1874) Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-10@freebsd.org, =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 21:48:03 -0000 --Apple-Mail=_CBC3B360-4D04-4FA9-BFAB-F0322AE98CD6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 03 Mar 2014, at 21:36, John Baldwin wrote: > On Thursday, February 27, 2014 12:29:02 pm Dag-Erling SmXXrgrav wrote: >> Author: des >> Date: Thu Feb 27 17:29:02 2014 >> New Revision: 262566 >> URL: http://svnweb.freebsd.org/changeset/base/262566 >>=20 >> Log: >> MFH (r261320): upgrade openssh to 6.5p1 >> MFH (r261340): enable sandboxing by default >=20 > Mails on stable@ suggest that this latter change may be a bit of a = POLA=20 > violation as if people are using a custom kernel configuration that = doesn't=20 > include CAPSICUM they are now locked out of their boxes as sshd fails. = It=20 > seems that this is at least worth a note in UPDATING if not adding a=20= > workaround to handle the case of a kernel without CAPSICUM. Wouldn't it be enough to merge r261499 ("Fix installations that use kernels without CAPABILITIES support") by pjd? -Dimitry --Apple-Mail=_CBC3B360-4D04-4FA9-BFAB-F0322AE98CD6 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----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlMU+IgACgkQsF6jCi4glqPVrgCg6T1itIrxyezif62QRLrtKAp6 LY0AoLn8fqsxtojcxU0iG+xaX+Dypdk2 =9VPL -----END PGP SIGNATURE----- --Apple-Mail=_CBC3B360-4D04-4FA9-BFAB-F0322AE98CD6-- From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 23:19:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 44F99DC4; Mon, 3 Mar 2014 23:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3194DDAD; Mon, 3 Mar 2014 23:19: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 s23NJTUX072529; Mon, 3 Mar 2014 23:19:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23NJTBN072528; Mon, 3 Mar 2014 23:19:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403032319.s23NJTBN072528@svn.freebsd.org> From: Xin LI Date: Mon, 3 Mar 2014 23:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262718 - stable/10/crypto/openssh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 23:19:29 -0000 Author: delphij Date: Mon Mar 3 23:19:28 2014 New Revision: 262718 URL: http://svnweb.freebsd.org/changeset/base/262718 Log: MFC r261499 (pjd): Fix installations that use kernels without CAPABILITIES support. Modified: stable/10/crypto/openssh/sandbox-capsicum.c Directory Properties: stable/10/ (props changed) Modified: stable/10/crypto/openssh/sandbox-capsicum.c ============================================================================== --- stable/10/crypto/openssh/sandbox-capsicum.c Mon Mar 3 20:28:27 2014 (r262717) +++ stable/10/crypto/openssh/sandbox-capsicum.c Mon Mar 3 23:19:28 2014 (r262718) @@ -94,10 +94,12 @@ ssh_sandbox_child(struct ssh_sandbox *bo fatal("can't limit stderr: %m"); cap_rights_init(&rights, CAP_READ, CAP_WRITE); - if (cap_rights_limit(box->monitor->m_recvfd, &rights) == -1) + if (cap_rights_limit(box->monitor->m_recvfd, &rights) == -1 && + errno != ENOSYS) fatal("%s: failed to limit the network socket", __func__); cap_rights_init(&rights, CAP_WRITE); - if (cap_rights_limit(box->monitor->m_log_sendfd, &rights) == -1) + if (cap_rights_limit(box->monitor->m_log_sendfd, &rights) == -1 && + errno != ENOSYS) fatal("%s: failed to limit the logging socket", __func__); if (cap_enter() < 0 && errno != ENOSYS) fatal("%s: failed to enter capability mode", __func__); From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 23:30:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C939D2B0; Mon, 3 Mar 2014 23:30: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B577CE9A; Mon, 3 Mar 2014 23:30: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 s23NUspW077100; Mon, 3 Mar 2014 23:30:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23NUsZL077099; Mon, 3 Mar 2014 23:30:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403032330.s23NUsZL077099@svn.freebsd.org> From: Xin LI Date: Mon, 3 Mar 2014 23:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262720 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 23:30:54 -0000 Author: delphij Date: Mon Mar 3 23:30:54 2014 New Revision: 262720 URL: http://svnweb.freebsd.org/changeset/base/262720 Log: (not quite, due to date difference) MFC r262719: Document the fact that OpenSSH default configuration requires Capsicum capability mode support in kernel, which have been worked around later but it's still recommended to have it enabled. Reported by: many Modified: stable/10/UPDATING Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Mon Mar 3 23:26:48 2014 (r262719) +++ stable/10/UPDATING Mon Mar 3 23:30:54 2014 (r262720) @@ -17,6 +17,16 @@ stable/10, and then rebuild without this older version of current is a bit fragile. +20140303: + OpenSSH will now ignore errors caused by kernel lacking of Capsicum + capability mode support. Please note that enabling the feature in + kernel is still highly recommended. + +20140227: + OpenSSH is now built with sandbox support, and will use sandbox as + the default privilege separation method. This requires Capsicum + capability mode support in kernel. + 20140216: The nve(4) driver for NVIDIA nForce MCP Ethernet adapters has been deprecated and will not be part of FreeBSD 11.0 and later From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 3 23:36:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5B5F28AD; Mon, 3 Mar 2014 23:36:48 +0000 (UTC) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 1840BF5B; Mon, 3 Mar 2014 23:36:47 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id CA5FB51C; Tue, 4 Mar 2014 00:36:46 +0100 (CET) Date: Tue, 4 Mar 2014 00:38:39 +0100 From: Pawel Jakub Dawidek To: Dimitry Andric Subject: Re: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-comp... Message-ID: <20140303233839.GD1659@garage.freebsd.pl> References: <201402271729.s1RHT2rx075258@svn.freebsd.org> <201403031536.33679.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S1BNGpv0yoYahz37" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: src-committers@freebsd.org, svn-src-stable-10@freebsd.org, John Baldwin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 23:36:48 -0000 --S1BNGpv0yoYahz37 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 03, 2014 at 10:47:43PM +0100, Dimitry Andric wrote: > On 03 Mar 2014, at 21:36, John Baldwin wrote: > > On Thursday, February 27, 2014 12:29:02 pm Dag-Erling SmXXrgrav wrote: > >> Author: des > >> Date: Thu Feb 27 17:29:02 2014 > >> New Revision: 262566 > >> URL: http://svnweb.freebsd.org/changeset/base/262566 > >>=20 > >> Log: > >> MFH (r261320): upgrade openssh to 6.5p1 > >> MFH (r261340): enable sandboxing by default > >=20 > > Mails on stable@ suggest that this latter change may be a bit of a POLA= =20 > > violation as if people are using a custom kernel configuration that doe= sn't=20 > > include CAPSICUM they are now locked out of their boxes as sshd fails. = It=20 > > seems that this is at least worth a note in UPDATING if not adding a=20 > > workaround to handle the case of a kernel without CAPSICUM. >=20 > Wouldn't it be enough to merge r261499 ("Fix installations that use > kernels without CAPABILITIES support") by pjd? Yes, my change should be definiately merged with OpenSSH merge. If nobody beats me to it, I should be able to merge it tomorrow. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --S1BNGpv0yoYahz37 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlMVEn8ACgkQForvXbEpPzS7fQCgnl02HPFw/0Yg8yH8o1ky52Mi 2sIAnjoF3OWfctufKZOYizkn4dBLeV4l =m5ZN -----END PGP SIGNATURE----- --S1BNGpv0yoYahz37-- From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 03:10:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9EAEB540; Tue, 4 Mar 2014 03:10: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A57F67D; Tue, 4 Mar 2014 03:10: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 s243AZtZ070753; Tue, 4 Mar 2014 03:10:35 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s243AVCi070731; Tue, 4 Mar 2014 03:10:31 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403040310.s243AVCi070731@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 4 Mar 2014 03:10:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262723 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 03:10:35 -0000 Author: pfg Date: Tue Mar 4 03:10:31 2014 New Revision: 262723 URL: http://svnweb.freebsd.org/changeset/base/262723 Log: MFC r262623, r262667: ext2fs: use of tab vs spaces. Consistently use a single tab after a #define as mentioned in style(9). Use tabs instead of space for indenting. Fix a typo: "hash_vesion". No functional change. Modified: stable/10/sys/fs/ext2fs/ext2_alloc.c stable/10/sys/fs/ext2fs/ext2_balloc.c stable/10/sys/fs/ext2fs/ext2_bmap.c stable/10/sys/fs/ext2fs/ext2_dinode.h stable/10/sys/fs/ext2fs/ext2_dir.h stable/10/sys/fs/ext2fs/ext2_extents.h stable/10/sys/fs/ext2fs/ext2_extern.h stable/10/sys/fs/ext2fs/ext2_htree.c stable/10/sys/fs/ext2fs/ext2_inode.c stable/10/sys/fs/ext2fs/ext2_inode_cnv.c stable/10/sys/fs/ext2fs/ext2_lookup.c stable/10/sys/fs/ext2fs/ext2_mount.h stable/10/sys/fs/ext2fs/ext2_vfsops.c stable/10/sys/fs/ext2fs/ext2_vnops.c stable/10/sys/fs/ext2fs/ext2fs.h stable/10/sys/fs/ext2fs/fs.h stable/10/sys/fs/ext2fs/htree.h stable/10/sys/fs/ext2fs/inode.h Modified: stable/10/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_alloc.c Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_alloc.c Tue Mar 4 03:10:31 2014 (r262723) @@ -122,7 +122,7 @@ ext2_alloc(struct inode *ip, daddr_t lbn ip->i_flag |= IN_CHANGE | IN_UPDATE; *bnp = bno; return (0); - } + } nospace: EXT2_UNLOCK(ump); ext2_fserr(fs, cred->cr_uid, "filesystem full"); @@ -397,11 +397,11 @@ ext2_valloc(struct vnode *pvp, int mode, ip->i_blocks = 0; ip->i_mode = 0; ip->i_flags = 0; - /* now we want to make sure that the block pointers are zeroed out */ - for (i = 0; i < NDADDR; i++) - ip->i_db[i] = 0; - for (i = 0; i < NIADDR; i++) - ip->i_ib[i] = 0; + /* now we want to make sure that the block pointers are zeroed out */ + for (i = 0; i < NDADDR; i++) + ip->i_db[i] = 0; + for (i = 0; i < NIADDR; i++) + ip->i_ib[i] = 0; /* * Set up a new generation number for this inode. @@ -443,7 +443,7 @@ static u_long ext2_dirpref(struct inode *pip) { struct m_ext2fs *fs; - int cg, prefcg, dirsize, cgsize; + int cg, prefcg, dirsize, cgsize; u_int avgifree, avgbfree, avgndir, curdirsize; u_int minifree, minbfree, maxndir; u_int mincg, minndir; @@ -452,7 +452,7 @@ ext2_dirpref(struct inode *pip) mtx_assert(EXT2_MTX(pip->i_ump), MA_OWNED); fs = pip->i_e2fs; - avgifree = fs->e2fs->e2fs_ficount / fs->e2fs_gcount; + avgifree = fs->e2fs->e2fs_ficount / fs->e2fs_gcount; avgbfree = fs->e2fs->e2fs_fbcount / fs->e2fs_gcount; avgndir = fs->e2fs_total_dir / fs->e2fs_gcount; @@ -473,11 +473,11 @@ ext2_dirpref(struct inode *pip) } for (cg = 0; cg < prefcg; cg++) if (fs->e2fs_gd[cg].ext2bgd_ndirs < minndir && - fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree && - fs->e2fs_gd[cg].ext2bgd_nbfree >= avgbfree) { - mincg = cg; - minndir = fs->e2fs_gd[cg].ext2bgd_ndirs; - } + fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree && + fs->e2fs_gd[cg].ext2bgd_nbfree >= avgbfree) { + mincg = cg; + minndir = fs->e2fs_gd[cg].ext2bgd_ndirs; + } return (mincg); } @@ -515,14 +515,14 @@ ext2_dirpref(struct inode *pip) for (cg = prefcg; cg < fs->e2fs_gcount; cg++) if (fs->e2fs_gd[cg].ext2bgd_ndirs < maxndir && fs->e2fs_gd[cg].ext2bgd_nifree >= minifree && - fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { + fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { if (fs->e2fs_contigdirs[cg] < maxcontigdirs) return (cg); } for (cg = 0; cg < prefcg; cg++) if (fs->e2fs_gd[cg].ext2bgd_ndirs < maxndir && fs->e2fs_gd[cg].ext2bgd_nifree >= minifree && - fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { + fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { if (fs->e2fs_contigdirs[cg] < maxcontigdirs) return (cg); } @@ -567,8 +567,8 @@ ext2_blkpref(struct inode *ip, e2fs_lbn_ /* now check whether we were provided with an array that basically tells us previous blocks to which we want to stay closeby */ - if (bap) - for (tmp = indx - 1; tmp >= 0; tmp--) + if (bap) + for (tmp = indx - 1; tmp >= 0; tmp--) if (bap[tmp]) return bap[tmp]; @@ -934,7 +934,7 @@ ext2_nodealloccg(struct inode *ip, int c panic("ext2fs_nodealloccg: map corrupted"); /* NOTREACHED */ } - } + } ipref = (loc - ibp) * NBBY + ffs(~*loc) - 1; gotit: setbit(ibp, ipref); @@ -968,33 +968,33 @@ ext2_blkfree(struct inode *ip, e4fs_dadd ump = ip->i_ump; cg = dtog(fs, bno); if ((u_int)bno >= fs->e2fs->e2fs_bcount) { - printf("bad block %lld, ino %llu\n", (long long)bno, - (unsigned long long)ip->i_number); - ext2_fserr(fs, ip->i_uid, "bad block"); - return; - } - error = bread(ip->i_devvp, - fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_b_bitmap), - (int)fs->e2fs_bsize, NOCRED, &bp); - if (error) { - brelse(bp); - return; - } - bbp = (char *)bp->b_data; - bno = dtogd(fs, bno); - if (isclr(bbp, bno)) { - printf("block = %lld, fs = %s\n", - (long long)bno, fs->e2fs_fsmnt); - panic("ext2_blkfree: freeing free block"); - } - clrbit(bbp, bno); + printf("bad block %lld, ino %llu\n", (long long)bno, + (unsigned long long)ip->i_number); + ext2_fserr(fs, ip->i_uid, "bad block"); + return; + } + error = bread(ip->i_devvp, + fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_b_bitmap), + (int)fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + return; + } + bbp = (char *)bp->b_data; + bno = dtogd(fs, bno); + if (isclr(bbp, bno)) { + printf("block = %lld, fs = %s\n", + (long long)bno, fs->e2fs_fsmnt); + panic("ext2_blkfree: freeing free block"); + } + clrbit(bbp, bno); EXT2_LOCK(ump); ext2_clusteracct(fs, bbp, cg, bno, 1); - fs->e2fs->e2fs_fbcount++; - fs->e2fs_gd[cg].ext2bgd_nbfree++; - fs->e2fs_fmod = 1; + fs->e2fs->e2fs_fbcount++; + fs->e2fs_gd[cg].ext2bgd_nbfree++; + fs->e2fs_fmod = 1; EXT2_UNLOCK(ump); - bdwrite(bp); + bdwrite(bp); } /* @@ -1100,14 +1100,14 @@ ext2_fserr(struct m_ext2fs *fs, uid_t ui int cg_has_sb(int i) { - int a3, a5, a7; + int a3, a5, a7; - if (i == 0 || i == 1) - return 1; - for (a3 = 3, a5 = 5, a7 = 7; - a3 <= i || a5 <= i || a7 <= i; - a3 *= 3, a5 *= 5, a7 *= 7) - if (i == a3 || i == a5 || i == a7) - return 1; - return 0; + if (i == 0 || i == 1) + return 1; + for (a3 = 3, a5 = 5, a7 = 7; + a3 <= i || a5 <= i || a7 <= i; + a3 *= 3, a5 *= 5, a7 *= 7) + if (i == a3 || i == a5 || i == a7) + return 1; + return 0; } Modified: stable/10/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_balloc.c Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_balloc.c Tue Mar 4 03:10:31 2014 (r262723) @@ -80,7 +80,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t * If so, increment next_alloc fields to allow ext2_blkpref * to make a good guess */ - if (lbn == ip->i_next_alloc_block + 1) { + if (lbn == ip->i_next_alloc_block + 1) { ip->i_next_alloc_block++; ip->i_next_alloc_goal++; } @@ -167,7 +167,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t EXT2_LOCK(ump); pref = ext2_blkpref(ip, lbn, indirs[0].in_off + EXT2_NDIR_BLOCKS, &ip->i_db[0], 0); - if ((error = ext2_alloc(ip, lbn, pref, fs->e2fs_bsize, cred, + if ((error = ext2_alloc(ip, lbn, pref, fs->e2fs_bsize, cred, &newb))) return (error); nb = newb; Modified: stable/10/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_bmap.c Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_bmap.c Tue Mar 4 03:10:31 2014 (r262723) @@ -250,10 +250,10 @@ ext2_bmaparray(struct vnode *vp, daddr_t bn = ap->in_off; if (runb && bn) { for (--bn; bn >= 0 && *runb < maxrun && - is_sequential(ump, + is_sequential(ump, ((e2fs_daddr_t *)bp->b_data)[bn], ((e2fs_daddr_t *)bp->b_data)[bn + 1]); - --bn, ++*runb); + --bn, ++*runb); } } } Modified: stable/10/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_dinode.h Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_dinode.h Tue Mar 4 03:10:31 2014 (r262723) @@ -27,7 +27,7 @@ */ #ifndef _FS_EXT2FS_EXT2_DINODE_H_ -#define _FS_EXT2FS_EXT2_DINODE_H_ +#define _FS_EXT2FS_EXT2_DINODE_H_ /* * Special inode numbers @@ -55,35 +55,35 @@ * EXT4_HUGE_FILE with some restrictions, imposed the lack of write * support. */ -#define EXT2_SECRM 0x00000001 /* Secure deletion */ -#define EXT2_UNRM 0x00000002 /* Undelete */ -#define EXT2_COMPR 0x00000004 /* Compress file */ -#define EXT2_SYNC 0x00000008 /* Synchronous updates */ -#define EXT2_IMMUTABLE 0x00000010 /* Immutable file */ -#define EXT2_APPEND 0x00000020 /* Writes to file may only append */ -#define EXT2_NODUMP 0x00000040 /* Do not dump file */ -#define EXT2_NOATIME 0x00000080 /* Do not update atime */ -#define EXT4_INDEX 0x00001000 /* Hash-indexed directory */ -#define EXT4_IMAGIC 0x00002000 /* AFS directory */ -#define EXT4_JOURNAL_DATA 0x00004000 /* File data should be journaled */ -#define EXT4_NOTAIL 0x00008000 /* File tail should not be merged */ -#define EXT4_DIRSYNC 0x00010000 /* Dirsync behaviour */ -#define EXT4_TOPDIR 0x00020000 /* Top of directory hierarchies*/ -#define EXT4_HUGE_FILE 0x00040000 /* Set to each huge file */ -#define EXT4_EXTENTS 0x00080000 /* Inode uses extents */ -#define EXT4_EOFBLOCKS 0x00400000 /* Blocks allocated beyond EOF */ +#define EXT2_SECRM 0x00000001 /* Secure deletion */ +#define EXT2_UNRM 0x00000002 /* Undelete */ +#define EXT2_COMPR 0x00000004 /* Compress file */ +#define EXT2_SYNC 0x00000008 /* Synchronous updates */ +#define EXT2_IMMUTABLE 0x00000010 /* Immutable file */ +#define EXT2_APPEND 0x00000020 /* Writes to file may only append */ +#define EXT2_NODUMP 0x00000040 /* Do not dump file */ +#define EXT2_NOATIME 0x00000080 /* Do not update atime */ +#define EXT4_INDEX 0x00001000 /* Hash-indexed directory */ +#define EXT4_IMAGIC 0x00002000 /* AFS directory */ +#define EXT4_JOURNAL_DATA 0x00004000 /* File data should be journaled */ +#define EXT4_NOTAIL 0x00008000 /* File tail should not be merged */ +#define EXT4_DIRSYNC 0x00010000 /* Dirsync behaviour */ +#define EXT4_TOPDIR 0x00020000 /* Top of directory hierarchies*/ +#define EXT4_HUGE_FILE 0x00040000 /* Set to each huge file */ +#define EXT4_EXTENTS 0x00080000 /* Inode uses extents */ +#define EXT4_EOFBLOCKS 0x00400000 /* Blocks allocated beyond EOF */ /* * Definitions for nanosecond timestamps. * Ext3 inode versioning, 2006-12-13. */ -#define EXT3_EPOCH_BITS 2 -#define EXT3_EPOCH_MASK ((1 << EXT3_EPOCH_BITS) - 1) -#define EXT3_NSEC_MASK (~0UL << EXT3_EPOCH_BITS) +#define EXT3_EPOCH_BITS 2 +#define EXT3_EPOCH_MASK ((1 << EXT3_EPOCH_BITS) - 1) +#define EXT3_NSEC_MASK (~0UL << EXT3_EPOCH_BITS) -#define E2DI_HAS_XTIME(ip) (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, \ +#define E2DI_HAS_XTIME(ip) (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, \ EXT2F_ROCOMPAT_EXTRA_ISIZE)) -#define E2DI_HAS_HUGE_FILE(ip) (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, \ +#define E2DI_HAS_HUGE_FILE(ip) (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, \ EXT2F_ROCOMPAT_HUGE_FILE)) /* @@ -94,7 +94,7 @@ #define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) #define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) #define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) -#define EXT2_MAXSYMLINKLEN (EXT2_N_BLOCKS * sizeof(uint32_t)) +#define EXT2_MAXSYMLINKLEN (EXT2_N_BLOCKS * sizeof(uint32_t)) /* * Structure of an inode on the disk @@ -121,16 +121,16 @@ struct ext2fs_dinode { uint16_t e2di_facl_high; /* 118: File EA bits 47:32 */ uint16_t e2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_t e2di_gid_high; /* 122: Owner GID top 16 bits */ - uint16_t e2di_chksum_lo; /* 124: Lower inode checksum */ + uint16_t e2di_chksum_lo; /* 124: Lower inode checksum */ uint16_t e2di_lx_reserved; /* 126: Unused */ uint16_t e2di_extra_isize; /* 128: Size of this inode */ uint16_t e2di_chksum_hi; /* 130: High inode checksum */ - uint32_t e2di_ctime_extra; /* 132: Extra change time */ - uint32_t e2di_mtime_extra; /* 136: Extra modification time */ - uint32_t e2di_atime_extra; /* 140: Extra access time */ - uint32_t e2di_crtime; /* 144: Creation (birth)time */ - uint32_t e2di_crtime_extra; /* 148: Extra creation (birth)time */ - uint32_t e2di_version_hi; /* 152: High bits of inode version */ + uint32_t e2di_ctime_extra; /* 132: Extra change time */ + uint32_t e2di_mtime_extra; /* 136: Extra modification time */ + uint32_t e2di_atime_extra; /* 140: Extra access time */ + uint32_t e2di_crtime; /* 144: Creation (birth)time */ + uint32_t e2di_crtime_extra; /* 148: Extra creation (birth)time */ + uint32_t e2di_version_hi; /* 152: High bits of inode version */ }; #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ Modified: stable/10/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_dir.h Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_dir.h Tue Mar 4 03:10:31 2014 (r262723) @@ -27,12 +27,12 @@ */ #ifndef _FS_EXT2FS_EXT2_DIR_H_ -#define _FS_EXT2FS_EXT2_DIR_H_ +#define _FS_EXT2FS_EXT2_DIR_H_ /* * Structure of a directory entry */ -#define EXT2FS_MAXNAMLEN 255 +#define EXT2FS_MAXNAMLEN 255 struct ext2fs_direct { uint32_t e2d_ino; /* inode number of entry */ @@ -72,31 +72,30 @@ struct ext2fs_direct_2 { /* * Maximal count of links to a file */ -#define EXT2_LINK_MAX 32000 +#define EXT2_LINK_MAX 32000 /* * Ext2 directory file types. Only the low 3 bits are used. The * other bits are reserved for now. */ -#define EXT2_FT_UNKNOWN 0 -#define EXT2_FT_REG_FILE 1 -#define EXT2_FT_DIR 2 -#define EXT2_FT_CHRDEV 3 -#define EXT2_FT_BLKDEV 4 -#define EXT2_FT_FIFO 5 -#define EXT2_FT_SOCK 6 -#define EXT2_FT_SYMLINK 7 - -#define EXT2_FT_MAX 8 +#define EXT2_FT_UNKNOWN 0 +#define EXT2_FT_REG_FILE 1 +#define EXT2_FT_DIR 2 +#define EXT2_FT_CHRDEV 3 +#define EXT2_FT_BLKDEV 4 +#define EXT2_FT_FIFO 5 +#define EXT2_FT_SOCK 6 +#define EXT2_FT_SYMLINK 7 +#define EXT2_FT_MAX 8 /* * EXT2_DIR_PAD defines the directory entries boundaries * * NOTE: It must be a multiple of 4 */ -#define EXT2_DIR_PAD 4 -#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) -#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ +#define EXT2_DIR_PAD 4 +#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) +#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ ~EXT2_DIR_ROUND) #endif /* !_FS_EXT2FS_EXT2_DIR_H_ */ Modified: stable/10/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_extents.h Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_extents.h Tue Mar 4 03:10:31 2014 (r262723) @@ -26,15 +26,15 @@ * $FreeBSD$ */ #ifndef _FS_EXT2FS_EXT2_EXTENTS_H_ -#define _FS_EXT2FS_EXT2_EXTENTS_H_ +#define _FS_EXT2FS_EXT2_EXTENTS_H_ #include -#define EXT4_EXT_MAGIC 0xf30a +#define EXT4_EXT_MAGIC 0xf30a -#define EXT4_EXT_CACHE_NO 0 -#define EXT4_EXT_CACHE_GAP 1 -#define EXT4_EXT_CACHE_IN 2 +#define EXT4_EXT_CACHE_NO 0 +#define EXT4_EXT_CACHE_GAP 1 +#define EXT4_EXT_CACHE_IN 2 /* * Ext4 file system extent on disk. Modified: stable/10/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_extern.h Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_extern.h Tue Mar 4 03:10:31 2014 (r262723) @@ -72,8 +72,8 @@ int ext2_update(struct vnode *, int); int ext2_valloc(struct vnode *, int, struct ucred *, struct vnode **); int ext2_vfree(struct vnode *, ino_t, int); int ext2_vinit(struct mount *, struct vop_vector *, struct vnode **vpp); -int ext2_lookup(struct vop_cachedlookup_args *); -int ext2_readdir(struct vop_readdir_args *); +int ext2_lookup(struct vop_cachedlookup_args *); +int ext2_readdir(struct vop_readdir_args *); void ext2_print_inode(struct inode *); int ext2_direnter(struct inode *, struct vnode *, struct componentname *); Modified: stable/10/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_htree.c Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_htree.c Tue Mar 4 03:10:31 2014 (r262723) @@ -60,7 +60,7 @@ static int ext2_htree_check_next(struct const char *name, struct ext2fs_htree_lookup_info *info); static int ext2_htree_cmp_sort_entry(const void *e1, const void *e2); static int ext2_htree_find_leaf(struct inode *ip, const char *name, - int namelen, uint32_t *hash, uint8_t *hash_verion, + int namelen, uint32_t *hash, uint8_t *hash_version, struct ext2fs_htree_lookup_info *info); static uint32_t ext2_htree_get_block(struct ext2fs_htree_entry *ep); static uint16_t ext2_htree_get_count(struct ext2fs_htree_entry *ep); Modified: stable/10/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_inode.c Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_inode.c Tue Mar 4 03:10:31 2014 (r262723) @@ -248,7 +248,7 @@ ext2_truncate(struct vnode *vp, off_t le if (error && (allerror == 0)) allerror = error; vnode_pager_setsize(ovp, length); - + /* * Indirect blocks first. */ Modified: stable/10/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Tue Mar 4 03:10:31 2014 (r262723) @@ -82,7 +82,7 @@ ext2_print_inode(struct inode *in) void ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) { - int i; + int i; ip->i_nlink = ei->e2di_nlink; /* Godmar thinks - if the link count is zero, then the inode is Modified: stable/10/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_lookup.c Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_lookup.c Tue Mar 4 03:10:31 2014 (r262723) @@ -805,7 +805,7 @@ ext2_dirbad(struct inode *ip, doff_t off mp->mnt_stat.f_mntonname, (u_long)ip->i_number,(long)offset, how); else (void)printf("%s: bad dir ino %lu at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (u_long)ip->i_number, (long)offset, how); + mp->mnt_stat.f_mntonname, (u_long)ip->i_number, (long)offset, how); } Modified: stable/10/sys/fs/ext2fs/ext2_mount.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_mount.h Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_mount.h Tue Mar 4 03:10:31 2014 (r262723) @@ -31,7 +31,7 @@ */ #ifndef _FS_EXT2FS_EXT2_MOUNT_H_ -#define _FS_EXT2FS_EXT2_MOUNT_H_ +#define _FS_EXT2FS_EXT2_MOUNT_H_ #ifdef _KERNEL @@ -59,18 +59,18 @@ struct ext2mount { struct bufobj *um_bo; }; -#define EXT2_LOCK(aa) mtx_lock(&(aa)->um_lock) -#define EXT2_UNLOCK(aa) mtx_unlock(&(aa)->um_lock) -#define EXT2_MTX(aa) (&(aa)->um_lock) +#define EXT2_LOCK(aa) mtx_lock(&(aa)->um_lock) +#define EXT2_UNLOCK(aa) mtx_unlock(&(aa)->um_lock) +#define EXT2_MTX(aa) (&(aa)->um_lock) /* Convert mount ptr to ext2fsmount ptr. */ -#define VFSTOEXT2(mp) ((struct ext2mount *)((mp)->mnt_data)) +#define VFSTOEXT2(mp) ((struct ext2mount *)((mp)->mnt_data)) /* * Macros to access file system parameters in the ufsmount structure. * Used by ufs_bmap. */ -#define MNINDIR(ump) ((ump)->um_nindir) +#define MNINDIR(ump) ((ump)->um_nindir) #define blkptrtodb(ump, b) ((b) << (ump)->um_bptrtodb) #define is_sequential(ump, a, b) ((b) == (a) + ump->um_seqinc) #endif /* _KERNEL */ Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vfsops.c Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_vfsops.c Tue Mar 4 03:10:31 2014 (r262723) @@ -674,7 +674,7 @@ ext2_mountfs(struct vnode *devvp, struct * Initialize filesystem stat information in mount struct. */ MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; MNT_IUNLOCK(mp); return (0); out: @@ -688,7 +688,7 @@ out: PICKUP_GIANT(); } if (ump) { - mtx_destroy(EXT2_MTX(ump)); + mtx_destroy(EXT2_MTX(ump)); free(ump->um_e2fs->e2fs_gd, M_EXT2MNT); free(ump->um_e2fs->e2fs_contigdirs, M_EXT2MNT); free(ump->um_e2fs->e2fs, M_EXT2MNT); @@ -723,8 +723,8 @@ ext2_unmount(struct mount *mp, int mntfl ronly = fs->e2fs_ronly; if (ronly == 0 && ext2_cgupdate(ump, MNT_WAIT) == 0) { if (fs->e2fs_wasvalid) - fs->e2fs->e2fs_state |= E2FS_ISCLEAN; - ext2_sbupdate(ump, MNT_WAIT); + fs->e2fs->e2fs_state |= E2FS_ISCLEAN; + ext2_sbupdate(ump, MNT_WAIT); } DROP_GIANT(); Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vnops.c Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2_vnops.c Tue Mar 4 03:10:31 2014 (r262723) @@ -775,10 +775,10 @@ abortit: dp = VTOI(fdvp); ip = VTOI(fvp); if (ip->i_nlink >= EXT2_LINK_MAX) { - VOP_UNLOCK(fvp, 0); - error = EMLINK; - goto abortit; - } + VOP_UNLOCK(fvp, 0); + error = EMLINK; + goto abortit; + } if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || (dp->i_flags & APPEND)) { VOP_UNLOCK(fvp, 0); @@ -942,8 +942,8 @@ abortit: * of the target directory. */ if (doingdirectory && !newparent) { - dp->i_nlink--; - dp->i_flag |= IN_CHANGE; + dp->i_nlink--; + dp->i_flag |= IN_CHANGE; } vput(tdvp); /* @@ -1623,7 +1623,6 @@ ext2_read(struct vop_read_args *ap) return (error); } - /* * Vnode op for reading. */ @@ -1723,7 +1722,7 @@ ext2_ind_read(struct vop_read_args *ap) xfersize = size; } error = uiomove((char *)bp->b_data + blkoffset, - (int)xfersize, uio); + (int)xfersize, uio); if (error) break; @@ -1960,10 +1959,10 @@ ext2_write(struct vop_write_args *ap) if (uio->uio_offset + xfersize > ip->i_size) vnode_pager_setsize(vp, uio->uio_offset + xfersize); - /* + /* * We must perform a read-before-write if the transfer size * does not cover the entire buffer. - */ + */ if (fs->e2fs_bsize > xfersize) flags |= BA_CLRBUF; else @@ -2057,9 +2056,9 @@ ext2_write(struct vop_write_args *ap) } } if (uio->uio_resid != resid) { - ip->i_flag |= IN_CHANGE | IN_UPDATE; - if (ioflag & IO_SYNC) - error = ext2_update(vp, 1); - } + ip->i_flag |= IN_CHANGE | IN_UPDATE; + if (ioflag & IO_SYNC) + error = ext2_update(vp, 1); + } return (error); } Modified: stable/10/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2fs.h Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/ext2fs.h Tue Mar 4 03:10:31 2014 (r262723) @@ -35,7 +35,7 @@ */ #ifndef _FS_EXT2FS_EXT2FS_H_ -#define _FS_EXT2FS_EXT2FS_H_ +#define _FS_EXT2FS_EXT2FS_H_ #include @@ -77,7 +77,7 @@ struct ext2fs { uint32_t e2fs_features_rocompat; /* RO-compatible feature set */ uint8_t e2fs_uuid[16]; /* 128-bit uuid for volume */ char e2fs_vname[16]; /* volume name */ - char e2fs_fsmnt[64]; /* name mounted on */ + char e2fs_fsmnt[64]; /* name mounted on */ uint32_t e2fs_algo; /* For compression */ uint8_t e2fs_prealloc; /* # of blocks for old prealloc */ uint8_t e2fs_dir_prealloc; /* # of blocks for old prealloc dirs */ @@ -103,10 +103,10 @@ struct ext2fs { uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ uint64_t e4fs_mmpblk; /* block for multi-mount protection */ uint32_t e4fs_raid_stripe_wid;/* blocks on all data disks (N * stride) */ - uint8_t e4fs_log_gpf; /* FLEX_BG group size */ + uint8_t e4fs_log_gpf; /* FLEX_BG group size */ uint8_t e4fs_char_pad2; uint16_t e4fs_pad; - uint32_t reserved2[162]; /* Padding to the end of the block */ + uint32_t reserved2[162]; /* Padding to the end of the block */ }; /* @@ -114,7 +114,7 @@ struct ext2fs { * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in * the super block for this name. */ -#define MAXMNTLEN 512 +#define MAXMNTLEN 512 /* * In-Memory Superblock @@ -123,25 +123,25 @@ struct ext2fs { struct m_ext2fs { struct ext2fs * e2fs; char e2fs_fsmnt[MAXMNTLEN];/* name mounted on */ - char e2fs_ronly; /* mounted read-only flag */ - char e2fs_fmod; /* super block modified flag */ - uint32_t e2fs_bsize; /* Block size */ - uint32_t e2fs_bshift; /* calc of logical block no */ + char e2fs_ronly; /* mounted read-only flag */ + char e2fs_fmod; /* super block modified flag */ + uint32_t e2fs_bsize; /* Block size */ + uint32_t e2fs_bshift; /* calc of logical block no */ uint32_t e2fs_bpg; /* Number of blocks per group */ - int64_t e2fs_qbmask; /* = s_blocksize -1 */ - uint32_t e2fs_fsbtodb; /* Shift to get disk block */ + int64_t e2fs_qbmask; /* = s_blocksize -1 */ + uint32_t e2fs_fsbtodb; /* Shift to get disk block */ uint32_t e2fs_ipg; /* Number of inodes per group */ uint32_t e2fs_ipb; /* Number of inodes per block */ - uint32_t e2fs_itpg; /* Number of inode table per group */ - uint32_t e2fs_fsize; /* Size of fragments per block */ + uint32_t e2fs_itpg; /* Number of inode table per group */ + uint32_t e2fs_fsize; /* Size of fragments per block */ uint32_t e2fs_fpb; /* Number of fragments per block */ uint32_t e2fs_fpg; /* Number of fragments per group */ - uint32_t e2fs_gdbcount; /* Number of group descriptors */ - uint32_t e2fs_gcount; /* Number of groups */ + uint32_t e2fs_gdbcount; /* Number of group descriptors */ + uint32_t e2fs_gcount; /* Number of groups */ uint32_t e2fs_isize; /* Size of inode */ uint32_t e2fs_total_dir; /* Total number of directories */ uint8_t *e2fs_contigdirs; /* (u) # of contig. allocated dirs */ - char e2fs_wasvalid; /* valid at mount time */ + char e2fs_wasvalid; /* valid at mount time */ off_t e2fs_maxfilesize; struct ext2_gd *e2fs_gd; /* Group Descriptors */ int32_t e2fs_contigsumsize; /* size of cluster summary array */ @@ -160,39 +160,39 @@ struct csum { /* * The second extended file system magic number */ -#define E2FS_MAGIC 0xEF53 +#define E2FS_MAGIC 0xEF53 /* * Revision levels */ -#define E2FS_REV0 0 /* The good old (original) format */ -#define E2FS_REV1 1 /* V2 format w/ dynamic inode sizes */ +#define E2FS_REV0 0 /* The good old (original) format */ +#define E2FS_REV1 1 /* V2 format w/ dynamic inode sizes */ -#define E2FS_REV0_INODE_SIZE 128 +#define E2FS_REV0_INODE_SIZE 128 /* * compatible/incompatible features */ -#define EXT2F_COMPAT_PREALLOC 0x0001 -#define EXT2F_COMPAT_HASJOURNAL 0x0004 -#define EXT2F_COMPAT_RESIZE 0x0010 -#define EXT2F_COMPAT_DIRHASHINDEX 0x0020 - -#define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 -#define EXT2F_ROCOMPAT_LARGEFILE 0x0002 -#define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 -#define EXT2F_ROCOMPAT_HUGE_FILE 0x0008 -#define EXT2F_ROCOMPAT_GDT_CSUM 0x0010 -#define EXT2F_ROCOMPAT_DIR_NLINK 0x0020 -#define EXT2F_ROCOMPAT_EXTRA_ISIZE 0x0040 - -#define EXT2F_INCOMPAT_COMP 0x0001 -#define EXT2F_INCOMPAT_FTYPE 0x0002 -#define EXT2F_INCOMPAT_META_BG 0x0010 -#define EXT2F_INCOMPAT_EXTENTS 0x0040 -#define EXT2F_INCOMPAT_64BIT 0x0080 -#define EXT2F_INCOMPAT_MMP 0x0100 -#define EXT2F_INCOMPAT_FLEX_BG 0x0200 +#define EXT2F_COMPAT_PREALLOC 0x0001 +#define EXT2F_COMPAT_HASJOURNAL 0x0004 +#define EXT2F_COMPAT_RESIZE 0x0010 +#define EXT2F_COMPAT_DIRHASHINDEX 0x0020 + +#define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 +#define EXT2F_ROCOMPAT_LARGEFILE 0x0002 +#define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 +#define EXT2F_ROCOMPAT_HUGE_FILE 0x0008 +#define EXT2F_ROCOMPAT_GDT_CSUM 0x0010 +#define EXT2F_ROCOMPAT_DIR_NLINK 0x0020 +#define EXT2F_ROCOMPAT_EXTRA_ISIZE 0x0040 + +#define EXT2F_INCOMPAT_COMP 0x0001 +#define EXT2F_INCOMPAT_FTYPE 0x0002 +#define EXT2F_INCOMPAT_META_BG 0x0010 +#define EXT2F_INCOMPAT_EXTENTS 0x0040 +#define EXT2F_INCOMPAT_64BIT 0x0080 +#define EXT2F_INCOMPAT_MMP 0x0100 +#define EXT2F_INCOMPAT_FLEX_BG 0x0200 /* * Features supported in this implementation @@ -212,28 +212,28 @@ struct csum { * - EXT2F_INCOMPAT_FLEX_BG * - EXT2F_INCOMPAT_META_BG */ -#define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX -#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ +#define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX +#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ EXT2F_ROCOMPAT_LARGEFILE | \ EXT2F_ROCOMPAT_EXTRA_ISIZE) -#define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE -#define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ +#define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE +#define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ EXT2F_INCOMPAT_FLEX_BG | \ EXT2F_INCOMPAT_META_BG ) /* Assume that user mode programs are passing in an ext2fs superblock, not * a kernel struct super_block. This will allow us to call the feature-test * macros from user land. */ -#define EXT2_SB(sb) (sb) +#define EXT2_SB(sb) (sb) /* * Feature set definitions */ -#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ +#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ ( EXT2_SB(sb)->e2fs->e2fs_features_compat & htole32(mask) ) -#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ +#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ ( EXT2_SB(sb)->e2fs->e2fs_features_rocompat & htole32(mask) ) -#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ +#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ ( EXT2_SB(sb)->e2fs->e2fs_features_incompat & htole32(mask) ) /* @@ -245,8 +245,8 @@ struct csum { /* * Filesystem miscellaneous flags */ -#define E2FS_SIGNED_HASH 0x0001 -#define E2FS_UNSIGNED_HASH 0x0002 +#define E2FS_SIGNED_HASH 0x0001 +#define E2FS_UNSIGNED_HASH 0x0002 /* ext2 file system block group descriptor */ @@ -270,30 +270,30 @@ struct ext2_gd { * helps reading these metadatas */ -#define e2fs_cgload(old, new, size) memcpy((new), (old), (size)); -#define e2fs_cgsave(old, new, size) memcpy((new), (old), (size)); +#define e2fs_cgload(old, new, size) memcpy((new), (old), (size)); +#define e2fs_cgsave(old, new, size) memcpy((new), (old), (size)); /* * Macro-instructions used to manage several block sizes */ #define EXT2_MAX_BLOCK_SIZE 4096 -#define EXT2_MIN_BLOCK_LOG_SIZE 10 -#define EXT2_BLOCK_SIZE(s) ((s)->e2fs_bsize) +#define EXT2_MIN_BLOCK_LOG_SIZE 10 +#define EXT2_BLOCK_SIZE(s) ((s)->e2fs_bsize) #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(uint32_t)) -#define EXT2_INODE_SIZE(s) (EXT2_SB(s)->e2fs_isize) +#define EXT2_INODE_SIZE(s) (EXT2_SB(s)->e2fs_isize) /* * Macro-instructions used to manage fragments */ -#define EXT2_MIN_FRAG_SIZE 1024 +#define EXT2_MIN_FRAG_SIZE 1024 #define EXT2_MAX_FRAG_SIZE 4096 -#define EXT2_MIN_FRAG_LOG_SIZE 10 -#define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->e2fs_fsize) -#define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->e2fs_fpb) +#define EXT2_MIN_FRAG_LOG_SIZE 10 +#define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->e2fs_fsize) +#define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->e2fs_fpb) /* * Macro-instructions used to manage group descriptors */ -#define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->e2fs_bpg) +#define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->e2fs_bpg) #endif /* !_FS_EXT2FS_EXT2FS_H_ */ Modified: stable/10/sys/fs/ext2fs/fs.h ============================================================================== --- stable/10/sys/fs/ext2fs/fs.h Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/fs.h Tue Mar 4 03:10:31 2014 (r262723) @@ -37,7 +37,7 @@ */ #ifndef _FS_EXT2FS_FS_H_ -#define _FS_EXT2FS_FS_H_ +#define _FS_EXT2FS_FS_H_ /* * Each disk drive contains some number of file systems. @@ -54,15 +54,15 @@ * The first boot and super blocks are given in absolute disk addresses. * The byte-offset forms are preferred, as they don't imply a sector size. */ -#define SBSIZE 1024 -#define SBLOCK 2 +#define SBSIZE 1024 +#define SBLOCK 2 /* * The path name on which the file system is mounted is maintained * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in * the super block for this name. */ -#define MAXMNTLEN 512 +#define MAXMNTLEN 512 /* * A summary of contiguous blocks of various sizes is maintained @@ -72,7 +72,7 @@ * XXX:FS_MAXCONTIG is set to 16 to conserve space. Here we set * EXT2_MAXCONTIG to 32 for better performance. */ -#define EXT2_MAXCONTIG 32 +#define EXT2_MAXCONTIG 32 /* * Grigoriy Orlov has done some extensive work to fine @@ -87,8 +87,8 @@ * 16384. */ -#define AFPDIR 64 -#define AVGDIRSIZE 1048576 +#define AFPDIR 64 +#define AVGDIRSIZE 1048576 /* * Macros for access to superblock array structures @@ -98,14 +98,14 @@ * Turn file system block numbers into disk block addresses. * This maps file system blocks to device size blocks. */ -#define fsbtodb(fs, b) ((daddr_t)(b) << (fs)->e2fs_fsbtodb) +#define fsbtodb(fs, b) ((daddr_t)(b) << (fs)->e2fs_fsbtodb) #define dbtofsb(fs, b) ((b) >> (fs)->e2fs_fsbtodb) /* get group containing inode */ -#define ino_to_cg(fs, x) (((x) - 1) / (fs->e2fs_ipg)) +#define ino_to_cg(fs, x) (((x) - 1) / (fs->e2fs_ipg)) /* get block containing inode from its number x */ -#define ino_to_fsba(fs, x) \ +#define ino_to_fsba(fs, x) \ ((fs)->e2fs_gd[ino_to_cg((fs), (x))].ext2bgd_i_tables + \ (((x) - 1) % (fs)->e2fs->e2fs_ipg) / (fs)->e2fs_ipb) @@ -126,20 +126,20 @@ * quantities by using shifts and masks in place of divisions * modulos and multiplications. */ -#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ +#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ ((loc) & (fs)->e2fs_qbmask) -#define lblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ +#define lblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ ((blk) << (fs->e2fs_bshift)) -#define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ +#define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ ((loc) >> (fs->e2fs_bshift)) /* no fragments -> logical block number equal # of frags */ -#define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ +#define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ ((loc) >> (fs->e2fs_bshift)) -#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ +#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ roundup(size, fs->e2fs_fsize) /* was (((size) + (fs)->fs_qfmask) & (fs)->fs_fmask) */ @@ -147,7 +147,7 @@ * Determining the size of a file block in the file system. * easy w/o fragments */ -#define blksize(fs, ip, lbn) ((fs)->e2fs_fsize) +#define blksize(fs, ip, lbn) ((fs)->e2fs_fsize) /* * INOPB is the number of inodes in a secondary storage block. Modified: stable/10/sys/fs/ext2fs/htree.h ============================================================================== --- stable/10/sys/fs/ext2fs/htree.h Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/htree.h Tue Mar 4 03:10:31 2014 (r262723) @@ -28,18 +28,18 @@ */ #ifndef _FS_EXT2FS_HTREE_H_ -#define _FS_EXT2FS_HTREE_H_ +#define _FS_EXT2FS_HTREE_H_ /* EXT3 HTree directory indexing */ -#define EXT2_HTREE_LEGACY 0 -#define EXT2_HTREE_HALF_MD4 1 -#define EXT2_HTREE_TEA 2 -#define EXT2_HTREE_LEGACY_UNSIGNED 3 -#define EXT2_HTREE_HALF_MD4_UNSIGNED 4 -#define EXT2_HTREE_TEA_UNSIGNED 5 +#define EXT2_HTREE_LEGACY 0 +#define EXT2_HTREE_HALF_MD4 1 +#define EXT2_HTREE_TEA 2 +#define EXT2_HTREE_LEGACY_UNSIGNED 3 +#define EXT2_HTREE_HALF_MD4_UNSIGNED 4 +#define EXT2_HTREE_TEA_UNSIGNED 5 -#define EXT2_HTREE_EOF 0x7FFFFFFF +#define EXT2_HTREE_EOF 0x7FFFFFFF struct ext2fs_fake_direct { uint32_t e2d_ino; /* inode number of entry */ Modified: stable/10/sys/fs/ext2fs/inode.h ============================================================================== --- stable/10/sys/fs/ext2fs/inode.h Tue Mar 4 02:19:39 2014 (r262722) +++ stable/10/sys/fs/ext2fs/inode.h Tue Mar 4 03:10:31 2014 (r262723) @@ -150,7 +150,7 @@ struct inode { #define IN_HASHED 0x0020 /* Inode is on hash list */ #define IN_LAZYMOD 0x0040 /* Modified, but don't write yet. */ #define IN_SPACECOUNTED 0x0080 /* Blocks to be freed in free count. */ -#define IN_LAZYACCESS 0x0100 /* Process IN_ACCESS after the +#define IN_LAZYACCESS 0x0100 /* Process IN_ACCESS after the suspension finished */ /* From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 08:40:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E2CFE64A; Tue, 4 Mar 2014 08:40:43 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 9C6EB276; Tue, 4 Mar 2014 08:40:43 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id CA1F05ABB; Tue, 4 Mar 2014 08:40:42 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 1784F827; Tue, 4 Mar 2014 09:40:47 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Pawel Jakub Dawidek Subject: Re: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-comp... References: <201402271729.s1RHT2rx075258@svn.freebsd.org> <201403031536.33679.jhb@freebsd.org> <20140303233839.GD1659@garage.freebsd.pl> Date: Tue, 04 Mar 2014 09:40:47 +0100 In-Reply-To: <20140303233839.GD1659@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Tue, 4 Mar 2014 00:38:39 +0100") Message-ID: <86vbvutkz4.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: src-committers@freebsd.org, svn-src-stable-10@freebsd.org, John Baldwin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dimitry Andric X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 08:40:44 -0000 Pawel Jakub Dawidek writes: > Dimitry Andric writes: > > Wouldn't it be enough to merge r261499 ("Fix installations that use > > kernels without CAPABILITIES support") by pjd? > Yes, my change should be definiately merged with OpenSSH merge. If > nobody beats me to it, I should be able to merge it tomorrow. Please do. I thought I had included it in the MFC since it was already in head, but I'd forgotten that it had been committed separately. BTW, IWBNI there were a cap_available() predicate or something like that which we could check up front, and short-circuit the entire Capsicum part of ssh_sandbox_child() if it failed. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 11:43:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0F84B6E0; Tue, 4 Mar 2014 11:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF60F852; Tue, 4 Mar 2014 11:43: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 s24Bh2Ke077749; Tue, 4 Mar 2014 11:43:02 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24Bh1Yi077739; Tue, 4 Mar 2014 11:43:01 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201403041143.s24Bh1Yi077739@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 4 Mar 2014 11:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262731 - in stable/10/lib: libc/iconv libiconv_modules/BIG5 libiconv_modules/HZ libiconv_modules/VIQR X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 11:43:03 -0000 Author: tijl Date: Tue Mar 4 11:43:01 2014 New Revision: 262731 URL: http://svnweb.freebsd.org/changeset/base/262731 Log: MFC r262441-262442,262447,262461-262464,262655: - Consistently pass around context information using a simple pointer. This fixes some dereferencing bugs in Chinese character set conversions. - Fix Simplified Chinese character set conversions by switching around the fields of an internal struct so it corresponds with the way variables of this type are initialised. - Fix an array index out of bounds bug in iconv VIQR (Vietnamese) module. - Silence gcc warning about unsigned comparison with 0. Also record r258316 and r258587 as merged so they no longer show up as eligible. PR: 185964 Submitted by: Manuel Mausz Modified: stable/10/lib/libc/iconv/citrus_prop.c stable/10/lib/libc/iconv/citrus_prop.h stable/10/lib/libiconv_modules/BIG5/citrus_big5.c stable/10/lib/libiconv_modules/HZ/citrus_hz.c stable/10/lib/libiconv_modules/VIQR/citrus_viqr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/iconv/citrus_prop.c ============================================================================== --- stable/10/lib/libc/iconv/citrus_prop.c Tue Mar 4 10:47:35 2014 (r262730) +++ stable/10/lib/libc/iconv/citrus_prop.c Tue Mar 4 11:43:01 2014 (r262731) @@ -339,7 +339,7 @@ name_found: static int _citrus_prop_parse_element(struct _memstream * __restrict ms, - const _citrus_prop_hint_t * __restrict hints, void ** __restrict context) + const _citrus_prop_hint_t * __restrict hints, void * __restrict context) { int ch, errnum; #define _CITRUS_PROP_HINT_NAME_LEN_MAX 255 @@ -435,8 +435,7 @@ _citrus_prop_parse_variable(const _citru if (ch == EOF || ch == '\0') break; _memstream_ungetc(&ms, ch); - errnum = _citrus_prop_parse_element( - &ms, hints, (void ** __restrict)context); + errnum = _citrus_prop_parse_element(&ms, hints, context); if (errnum != 0) return (errnum); } Modified: stable/10/lib/libc/iconv/citrus_prop.h ============================================================================== --- stable/10/lib/libc/iconv/citrus_prop.h Tue Mar 4 10:47:35 2014 (r262730) +++ stable/10/lib/libc/iconv/citrus_prop.h Tue Mar 4 11:43:01 2014 (r262731) @@ -42,7 +42,7 @@ typedef struct _citrus_prop_hint_t _citr #define _CITRUS_PROP_CB0_T(_func_, _type_) \ typedef int (*_citrus_prop_##_func_##_cb_func_t) \ - (void ** __restrict, const char *, _type_); \ + (void * __restrict, const char *, _type_); \ typedef struct { \ _citrus_prop_##_func_##_cb_func_t func; \ } _citrus_prop_##_func_##_cb_t; @@ -52,7 +52,7 @@ _CITRUS_PROP_CB0_T(str, const char *) #define _CITRUS_PROP_CB1_T(_func_, _type_) \ typedef int (*_citrus_prop_##_func_##_cb_func_t) \ - (void ** __restrict, const char *, _type_, _type_); \ + (void * __restrict, const char *, _type_, _type_); \ typedef struct { \ _citrus_prop_##_func_##_cb_func_t func; \ } _citrus_prop_##_func_##_cb_t; Modified: stable/10/lib/libiconv_modules/BIG5/citrus_big5.c ============================================================================== --- stable/10/lib/libiconv_modules/BIG5/citrus_big5.c Tue Mar 4 10:47:35 2014 (r262730) +++ stable/10/lib/libiconv_modules/BIG5/citrus_big5.c Tue Mar 4 11:43:01 2014 (r262731) @@ -172,7 +172,7 @@ _citrus_BIG5_check_excludes(_BIG5Encodin } static int -_citrus_BIG5_fill_rowcol(void ** __restrict ctx, const char * __restrict s, +_citrus_BIG5_fill_rowcol(void * __restrict ctx, const char * __restrict s, uint64_t start, uint64_t end) { _BIG5EncodingInfo *ei; @@ -191,7 +191,7 @@ _citrus_BIG5_fill_rowcol(void ** __restr static int /*ARGSUSED*/ -_citrus_BIG5_fill_excludes(void ** __restrict ctx, +_citrus_BIG5_fill_excludes(void * __restrict ctx, const char * __restrict s __unused, uint64_t start, uint64_t end) { _BIG5EncodingInfo *ei; @@ -237,7 +237,6 @@ static int _citrus_BIG5_encoding_module_init(_BIG5EncodingInfo * __restrict ei, const void * __restrict var, size_t lenvar) { - void *ctx = (void *)ei; const char *s; int err; @@ -259,9 +258,9 @@ _citrus_BIG5_encoding_module_init(_BIG5E } /* fallback Big5-1984, for backward compatibility. */ - _citrus_BIG5_fill_rowcol((void **)&ctx, "row", 0xA1, 0xFE); - _citrus_BIG5_fill_rowcol((void **)&ctx, "col", 0x40, 0x7E); - _citrus_BIG5_fill_rowcol((void **)&ctx, "col", 0xA1, 0xFE); + _citrus_BIG5_fill_rowcol(ei, "row", 0xA1, 0xFE); + _citrus_BIG5_fill_rowcol(ei, "col", 0x40, 0x7E); + _citrus_BIG5_fill_rowcol(ei, "col", 0xA1, 0xFE); return (0); } Modified: stable/10/lib/libiconv_modules/HZ/citrus_hz.c ============================================================================== --- stable/10/lib/libiconv_modules/HZ/citrus_hz.c Tue Mar 4 10:47:35 2014 (r262730) +++ stable/10/lib/libiconv_modules/HZ/citrus_hz.c Tue Mar 4 11:43:01 2014 (r262731) @@ -65,8 +65,8 @@ typedef enum { } charset_t; typedef struct { - int end; int start; + int end; int width; } range_t; @@ -505,12 +505,12 @@ _citrus_HZ_encoding_module_uninit(_HZEnc } static int -_citrus_HZ_parse_char(void **context, const char *name __unused, const char *s) +_citrus_HZ_parse_char(void *context, const char *name __unused, const char *s) { escape_t *escape; void **p; - p = (void **)*context; + p = (void **)context; escape = (escape_t *)p[0]; if (escape->ch != '\0') return (EINVAL); @@ -522,14 +522,14 @@ _citrus_HZ_parse_char(void **context, co } static int -_citrus_HZ_parse_graphic(void **context, const char *name, const char *s) +_citrus_HZ_parse_graphic(void *context, const char *name, const char *s) { _HZEncodingInfo *ei; escape_t *escape; graphic_t *graphic; void **p; - p = (void **)*context; + p = (void **)context; escape = (escape_t *)p[0]; ei = (_HZEncodingInfo *)p[1]; graphic = malloc(sizeof(*graphic)); @@ -591,13 +591,13 @@ _CITRUS_PROP_HINT_END }; static int -_citrus_HZ_parse_escape(void **context, const char *name, const char *s) +_citrus_HZ_parse_escape(void *context, const char *name, const char *s) { _HZEncodingInfo *ei; escape_t *escape; void *p[2]; - ei = (_HZEncodingInfo *)*context; + ei = (_HZEncodingInfo *)context; escape = malloc(sizeof(*escape)); if (escape == NULL) return (EINVAL); Modified: stable/10/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- stable/10/lib/libiconv_modules/VIQR/citrus_viqr.c Tue Mar 4 10:47:35 2014 (r262730) +++ stable/10/lib/libiconv_modules/VIQR/citrus_viqr.c Tue Mar 4 11:43:01 2014 (r262731) @@ -433,7 +433,6 @@ static int _citrus_VIQR_encoding_module_init(_VIQREncodingInfo * __restrict ei, const void * __restrict var __unused, size_t lenvar __unused) { - const mnemonic_def_t *p; const char *s; size_t i, n; int errnum; @@ -457,7 +456,10 @@ _citrus_VIQR_encoding_module_init(_VIQRE return (errnum); } } - for (i = 0;; ++i) { + /* a + 1 < b + 1 here to silence gcc warning about unsigned < 0. */ + for (i = 0; i + 1 < mnemonic_ext_size + 1; ++i) { + const mnemonic_def_t *p; + p = &mnemonic_ext[i]; n = strlen(p->name); if (ei->mb_cur_max < n) From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 14:01:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D160949D; Tue, 4 Mar 2014 14:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1394988; Tue, 4 Mar 2014 14:01: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 s24E1DnQ033713; Tue, 4 Mar 2014 14:01:13 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24E1C5O033709; Tue, 4 Mar 2014 14:01:12 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403041401.s24E1C5O033709@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Mar 2014 14:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262734 - in stable/10/sys: kern net netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 14:01:13 -0000 Author: glebius Date: Tue Mar 4 14:01:12 2014 New Revision: 262734 URL: http://svnweb.freebsd.org/changeset/base/262734 Log: Merge r261590, r261592 from head: Remove identical vnet sysctl handlers, and handle CTLFLAG_VNET in the sysctl_root(). Note: SYSCTL_VNET_* macros can be removed as well. All is needed to virtualize a sysctl oid is set CTLFLAG_VNET on it. But for now keep macros in place to avoid large code churn. Modified: stable/10/sys/kern/kern_sysctl.c stable/10/sys/net/vnet.c stable/10/sys/net/vnet.h stable/10/sys/netinet/in_pcb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_sysctl.c ============================================================================== --- stable/10/sys/kern/kern_sysctl.c Tue Mar 4 14:00:49 2014 (r262733) +++ stable/10/sys/kern/kern_sysctl.c Tue Mar 4 14:01:12 2014 (r262734) @@ -1491,7 +1491,10 @@ sysctl_root(SYSCTL_HANDLER_ARGS) #endif oid->oid_running++; SYSCTL_XUNLOCK(); - +#ifdef VIMAGE + if ((oid->oid_kind & CTLFLAG_VNET) && arg1 != NULL) + arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); +#endif if (!(oid->oid_kind & CTLFLAG_MPSAFE)) mtx_lock(&Giant); error = oid->oid_handler(oid, arg1, arg2, req); Modified: stable/10/sys/net/vnet.c ============================================================================== --- stable/10/sys/net/vnet.c Tue Mar 4 14:00:49 2014 (r262733) +++ stable/10/sys/net/vnet.c Tue Mar 4 14:01:12 2014 (r262734) @@ -465,47 +465,6 @@ vnet_data_copy(void *start, int size) } /* - * Variants on sysctl_handle_foo that know how to handle virtualized global - * variables: if 'arg1' is a pointer, then we transform it to the local vnet - * offset. - */ -int -vnet_sysctl_handle_int(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_int(oidp, arg1, arg2, req)); -} - -int -vnet_sysctl_handle_opaque(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_opaque(oidp, arg1, arg2, req)); -} - -int -vnet_sysctl_handle_string(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_string(oidp, arg1, arg2, req)); -} - -int -vnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS) -{ - - if (arg1 != NULL) - arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1); - return (sysctl_handle_int(oidp, arg1, arg2, req)); -} - -/* * Support for special SYSINIT handlers registered via VNET_SYSINIT() * and VNET_SYSUNINIT(). */ Modified: stable/10/sys/net/vnet.h ============================================================================== --- stable/10/sys/net/vnet.h Tue Mar 4 14:00:49 2014 (r262733) +++ stable/10/sys/net/vnet.h Tue Mar 4 14:01:12 2014 (r262734) @@ -290,15 +290,10 @@ void vnet_data_free(void *start_arg, in * arguments themselves, if required. */ #ifdef SYSCTL_OID -int vnet_sysctl_handle_int(SYSCTL_HANDLER_ARGS); -int vnet_sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); -int vnet_sysctl_handle_string(SYSCTL_HANDLER_ARGS); -int vnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS); - #define SYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ - ptr, val, vnet_sysctl_handle_int, "I", descr) + ptr, val, sysctl_handle_int, "I", descr) #define SYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler, \ fmt, descr) \ CTASSERT(((access) & CTLTYPE) != 0); \ @@ -312,16 +307,16 @@ int vnet_sysctl_handle_uint(SYSCTL_HANDL #define SYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_STRING|CTLFLAG_VNET|(access), \ - arg, len, vnet_sysctl_handle_string, "A", descr) + arg, len, sysctl_handle_string, "A", descr) #define SYSCTL_VNET_STRUCT(parent, nbr, name, access, ptr, type, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr, \ - sizeof(struct type), vnet_sysctl_handle_opaque, "S," #type, \ + sizeof(struct type), sysctl_handle_opaque, "S," #type, \ descr) #define SYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_UINT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ - ptr, val, vnet_sysctl_handle_uint, "IU", descr) + ptr, val, sysctl_handle_int, "IU", descr) #define VNET_SYSCTL_ARG(req, arg1) do { \ if (arg1 != NULL) \ arg1 = (void *)(TD_TO_VNET((req)->td)->vnet_data_base + \ Modified: stable/10/sys/netinet/in_pcb.c ============================================================================== --- stable/10/sys/netinet/in_pcb.c Tue Mar 4 14:00:49 2014 (r262733) +++ stable/10/sys/netinet/in_pcb.c Tue Mar 4 14:01:12 2014 (r262734) @@ -144,11 +144,7 @@ sysctl_net_ipport_check(SYSCTL_HANDLER_A { int error; -#ifdef VIMAGE - error = vnet_sysctl_handle_int(oidp, arg1, arg2, req); -#else error = sysctl_handle_int(oidp, arg1, arg2, req); -#endif if (error == 0) { RANGECHK(V_ipport_lowfirstauto, 1, IPPORT_RESERVED - 1); RANGECHK(V_ipport_lowlastauto, 1, IPPORT_RESERVED - 1); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 14:05:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D551B81B; Tue, 4 Mar 2014 14:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4A1A9D3; Tue, 4 Mar 2014 14:05: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 s24E5cRH034766; Tue, 4 Mar 2014 14:05:38 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24E5cmG034763; Tue, 4 Mar 2014 14:05:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403041405.s24E5cmG034763@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Mar 2014 14:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262735 - in stable/10/sys: net netinet netinet/cc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 14:05:39 -0000 Author: glebius Date: Tue Mar 4 14:05:37 2014 New Revision: 262735 URL: http://svnweb.freebsd.org/changeset/base/262735 Log: Merge r261590: Fixup for r261590 (vnet sysctl handlers cleanup) Modified: stable/10/sys/net/vnet.h stable/10/sys/netinet/cc/cc_cdg.c stable/10/sys/netinet/sctp_sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/vnet.h ============================================================================== --- stable/10/sys/net/vnet.h Tue Mar 4 14:01:12 2014 (r262734) +++ stable/10/sys/net/vnet.h Tue Mar 4 14:05:37 2014 (r262735) @@ -303,7 +303,7 @@ void vnet_data_free(void *start_arg, in descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr, len, \ - vnet_sysctl_handle_opaque, fmt, descr) + sysctl_handle_opaque, fmt, descr) #define SYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr) \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_STRING|CTLFLAG_VNET|(access), \ Modified: stable/10/sys/netinet/cc/cc_cdg.c ============================================================================== --- stable/10/sys/netinet/cc/cc_cdg.c Tue Mar 4 14:01:12 2014 (r262734) +++ stable/10/sys/netinet/cc/cc_cdg.c Tue Mar 4 14:05:37 2014 (r262735) @@ -81,11 +81,6 @@ __FBSDID("$FreeBSD$"); #define CAST_PTR_INT(X) (*((int*)(X))) -#ifndef VIMAGE -#define vnet_sysctl_handle_uint(oidp, arg1, arg2, req) \ - sysctl_handle_int(oidp, arg1, arg2, req) -#endif - /* Private delay-gradient induced congestion control signal. */ #define CC_CDG_DELAY 0x01000000 @@ -357,7 +352,7 @@ cdg_beta_handler(SYSCTL_HANDLER_ARGS) (CAST_PTR_INT(req->newptr) == 0 || CAST_PTR_INT(req->newptr) > 100)) return (EINVAL); - return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); + return (sysctl_handle_int(oidp, arg1, arg2, req)); } static int @@ -367,7 +362,7 @@ cdg_exp_backoff_scale_handler(SYSCTL_HAN if (req->newptr != NULL && CAST_PTR_INT(req->newptr) < 1) return (EINVAL); - return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); + return (sysctl_handle_int(oidp, arg1, arg2, req)); } static inline unsigned long Modified: stable/10/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/10/sys/netinet/sctp_sysctl.c Tue Mar 4 14:01:12 2014 (r262734) +++ stable/10/sys/netinet/sctp_sysctl.c Tue Mar 4 14:05:37 2014 (r262735) @@ -587,11 +587,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) { int error; -#ifdef VIMAGE - error = vnet_sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); -#else error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); -#endif if (error == 0) { RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 14:21:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BDBE1F2C; Tue, 4 Mar 2014 14:21:08 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9DCD2BAA; Tue, 4 Mar 2014 14:21:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24EL8Hh040338; Tue, 4 Mar 2014 14:21:08 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24EL8Cm040335; Tue, 4 Mar 2014 14:21:08 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403041421.s24EL8Cm040335@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Mar 2014 14:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262737 - in stable/10: share/man/man9 sys/sys sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 14:21:08 -0000 Author: glebius Date: Tue Mar 4 14:21:07 2014 New Revision: 262737 URL: http://svnweb.freebsd.org/changeset/base/262737 Log: Merge 261593 from head: Provide macros that allow easily export uma(9) zone limits and current usage via sysctl(9). Modified: stable/10/share/man/man9/zone.9 stable/10/sys/sys/sysctl.h stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/zone.9 ============================================================================== --- stable/10/share/man/man9/zone.9 Tue Mar 4 14:19:15 2014 (r262736) +++ stable/10/share/man/man9/zone.9 Tue Mar 4 14:21:07 2014 (r262737) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2013 +.Dd February 7, 2014 .Dt ZONE 9 .Os .Sh NAME @@ -71,6 +71,11 @@ .Fn uma_zone_get_cur "uma_zone_t zone" .Ft void .Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning" +.In sys/sysctl.h +.Fn SYSCTL_UMA_MAX parent nbr name access zone descr +.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr +.Fn SYSCTL_UMA_CUR parent nbr name access zone descr +.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr .Sh DESCRIPTION The zone allocator provides an efficient interface for managing dynamically-sized collections of items of similar size. @@ -307,6 +312,38 @@ Warnings can be turned off globally by s .Va vm.zone_warnings sysctl tunable to .Va 0 . +.Pp +The +.Fn SYSCTL_UMA_MAX parent nbr name access zone descr +macro declares a static +.Xr sysctl +oid that exports the effective upper limit number of items for a zone. +The +.Fa zone +argument should be a pointer to +.Vt uma_zone_t . +A read of the oid returns value obtained through +.Fn uma_zone_get_max . +A write to the oid sets new value via +.Fn uma_zone_set_max . +The +.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr +macro is provided to create this type of oid dynamically. +.Pp +The +.Fn SYSCTL_UMA_CUR parent nbr name access zone descr +macro declares a static read only +.Xr sysctl +oid that exports the approximate current occupancy of the zone. +The +.Fa zone +argument should be a pointer to +.Vt uma_zone_t . +A read of the oid returns value obtained through +.Fn uma_zone_get_cur . +The +.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name zone descr +macro is provided to create this type of oid dynamically. .Sh RETURN VALUES The .Fn uma_zalloc Modified: stable/10/sys/sys/sysctl.h ============================================================================== --- stable/10/sys/sys/sysctl.h Tue Mar 4 14:19:15 2014 (r262736) +++ stable/10/sys/sys/sysctl.h Tue Mar 4 14:21:07 2014 (r262737) @@ -186,6 +186,9 @@ int sysctl_handle_string(SYSCTL_HANDLER_ int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); int sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS); +int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS); +int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); + int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS); @@ -431,6 +434,30 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a sysctl_add_oid(ctx, parent, nbr, name, (access), \ ptr, arg, handler, fmt, __DESCR(descr)) +/* Oid to handle limits on uma(9) zone specified by pointer. */ +#define SYSCTL_UMA_MAX(parent, nbr, name, access, ptr, descr) \ + SYSCTL_ASSERT_TYPE(INT, ptr, parent, name); \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \ + ptr, 0, sysctl_handle_uma_zone_max, "I", descr) +#define SYSCTL_ADD_UMA_MAX(ctx, parent, nbr, name, access, ptr, descr)\ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | (access), \ + SYSCTL_ADD_ASSERT_TYPE(INT, ptr), 0, \ + sysctl_handle_uma_zone_max, "I", __DESCR(descr)) + +/* Oid to obtain current use of uma(9) zone specified by pointer. */ +#define SYSCTL_UMA_CUR(parent, nbr, name, access, ptr, descr) \ + SYSCTL_ASSERT_TYPE(INT, ptr, parent, name); \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + ptr, 0, sysctl_handle_uma_zone_cur, "I", descr) +#define SYSCTL_ADD_UMA_CUR(ctx, parent, nbr, name, access, ptr, descr) \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + SYSCTL_ADD_ASSERT_TYPE(INT, ptr), 0, \ + sysctl_handle_uma_zone_cur, "I", __DESCR(descr)) + /* * A macro to generate a read-only sysctl to indicate the presense of optional * kernel features. Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Tue Mar 4 14:19:15 2014 (r262736) +++ stable/10/sys/vm/uma_core.c Tue Mar 4 14:21:07 2014 (r262737) @@ -3462,6 +3462,35 @@ skip: return (error); } +int +sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS) +{ + uma_zone_t zone = *(uma_zone_t *)arg1; + int error, max, old; + + old = max = uma_zone_get_max(zone); + error = sysctl_handle_int(oidp, &max, 0, req); + if (error || !req->newptr) + return (error); + + if (max < old) + return (EINVAL); + + uma_zone_set_max(zone, max); + + return (0); +} + +int +sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS) +{ + uma_zone_t zone = *(uma_zone_t *)arg1; + int cur; + + cur = uma_zone_get_cur(zone); + return (sysctl_handle_int(oidp, &cur, 0, req)); +} + #ifdef DDB DB_SHOW_COMMAND(uma, db_show_uma) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 14:23:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E87A3135; Tue, 4 Mar 2014 14:23:58 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9ABFBD2; Tue, 4 Mar 2014 14:23:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24ENwfr042733; Tue, 4 Mar 2014 14:23:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24ENwhv042731; Tue, 4 Mar 2014 14:23:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403041423.s24ENwhv042731@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Mar 2014 14:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262738 - in stable/10: share/man/man9 sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 14:23:59 -0000 Author: glebius Date: Tue Mar 4 14:23:58 2014 New Revision: 262738 URL: http://svnweb.freebsd.org/changeset/base/262738 Log: Merge 261595: simplify the SYSCTL_COUNTER_U64() macro. Modified: stable/10/share/man/man9/counter.9 stable/10/sys/sys/sysctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/counter.9 ============================================================================== --- stable/10/share/man/man9/counter.9 Tue Mar 4 14:21:07 2014 (r262737) +++ stable/10/share/man/man9/counter.9 Tue Mar 4 14:23:58 2014 (r262738) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2013 +.Dd February 7, 2014 .Dt COUNTER 9 .Os .Sh NAME @@ -52,7 +52,7 @@ .Ft void .Fn counter_u64_zero "counter_u64_t c" .In sys/sysctl.h -.Fn SYSCTL_COUNTER_U64 parent nbr name access ptr val descr +.Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr .Fn SYSCTL_ADD_COUNTER_U64 ctx parent nbr name access ptr descr .Sh DESCRIPTION .Nm @@ -126,7 +126,7 @@ value for any moment. Clear the counter .Fa c and set it to zero. -.It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr val descr +.It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr Declare a static .Xr sysctl oid that would represent a Modified: stable/10/sys/sys/sysctl.h ============================================================================== --- stable/10/sys/sys/sysctl.h Tue Mar 4 14:21:07 2014 (r262737) +++ stable/10/sys/sys/sysctl.h Tue Mar 4 14:23:58 2014 (r262738) @@ -393,11 +393,11 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a sysctl_handle_64, "QU", __DESCR(descr)) /* Oid for a 64-bit unsigned counter(9). The pointer must be non NULL. */ -#define SYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, val, descr) \ +#define SYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, descr) \ SYSCTL_ASSERT_TYPE(UINT64, ptr, parent, name); \ SYSCTL_OID(parent, nbr, name, \ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ - ptr, val, sysctl_handle_counter_u64, "QU", descr) + ptr, 0, sysctl_handle_counter_u64, "QU", descr) #define SYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, descr)\ sysctl_add_oid(ctx, parent, nbr, name, \ From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 14:46:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 59A6A865; Tue, 4 Mar 2014 14:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 394D9E2E; Tue, 4 Mar 2014 14:46: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 s24EkWUY051053; Tue, 4 Mar 2014 14:46:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24EkVOA051044; Tue, 4 Mar 2014 14:46:31 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403041446.s24EkVOA051044@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Mar 2014 14:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262739 - in stable/10/sys: kern sys vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 14:46:32 -0000 Author: glebius Date: Tue Mar 4 14:46:30 2014 New Revision: 262739 URL: http://svnweb.freebsd.org/changeset/base/262739 Log: Merge r261722, r261723, r261724, r261725 from head: several minor improvements for UMA_ZPCPU_ZONE zones. Modified: stable/10/sys/kern/subr_counter.c stable/10/sys/kern/subr_pcpu.c stable/10/sys/sys/pcpu.h stable/10/sys/vm/uma.h stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_counter.c ============================================================================== --- stable/10/sys/kern/subr_counter.c Tue Mar 4 14:23:58 2014 (r262738) +++ stable/10/sys/kern/subr_counter.c Tue Mar 4 14:46:30 2014 (r262739) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #define IN_SUBR_COUNTER_C #include -static uma_zone_t uint64_pcpu_zone; - void counter_u64_zero(counter_u64_t c) { @@ -62,7 +60,7 @@ counter_u64_alloc(int flags) { counter_u64_t r; - r = uma_zalloc(uint64_pcpu_zone, flags); + r = uma_zalloc(pcpu_zone_64, flags); if (r != NULL) counter_u64_zero(r); @@ -73,7 +71,7 @@ void counter_u64_free(counter_u64_t c) { - uma_zfree(uint64_pcpu_zone, c); + uma_zfree(pcpu_zone_64, c); } int @@ -96,12 +94,3 @@ sysctl_handle_counter_u64(SYSCTL_HANDLER return (0); } - -static void -counter_startup(void) -{ - - uint64_pcpu_zone = uma_zcreate("uint64 pcpu", sizeof(uint64_t), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); -} -SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_ANY, counter_startup, NULL); Modified: stable/10/sys/kern/subr_pcpu.c ============================================================================== --- stable/10/sys/kern/subr_pcpu.c Tue Mar 4 14:23:58 2014 (r262738) +++ stable/10/sys/kern/subr_pcpu.c Tue Mar 4 14:46:30 2014 (r262739) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static MALLOC_DEFINE(M_PCPU, "Per-cpu", "Per-cpu resource accouting."); @@ -127,6 +128,30 @@ dpcpu_startup(void *dummy __unused) SYSINIT(dpcpu, SI_SUB_KLD, SI_ORDER_FIRST, dpcpu_startup, 0); /* + * UMA_PCPU_ZONE zones, that are available for all kernel + * consumers. Right now 64 bit zone is used for counter(9) + * and pointer zone is used by flowtable. + */ + +uma_zone_t pcpu_zone_64; +uma_zone_t pcpu_zone_ptr; + +static void +pcpu_zones_startup(void) +{ + + pcpu_zone_64 = uma_zcreate("64 pcpu", sizeof(uint64_t), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); + + if (sizeof(uint64_t) == sizeof(void *)) + pcpu_zone_ptr = pcpu_zone_64; + else + pcpu_zone_ptr = uma_zcreate("ptr pcpu", sizeof(void *), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); +} +SYSINIT(pcpu_zones, SI_SUB_KMEM, SI_ORDER_ANY, pcpu_zones_startup, NULL); + +/* * First-fit extent based allocator for allocating space in the per-cpu * region reserved for modules. This is only intended for use by the * kernel linkers to place module linker sets. Modified: stable/10/sys/sys/pcpu.h ============================================================================== --- stable/10/sys/sys/pcpu.h Tue Mar 4 14:23:58 2014 (r262738) +++ stable/10/sys/sys/pcpu.h Tue Mar 4 14:46:30 2014 (r262739) @@ -210,6 +210,13 @@ zpcpu_get(void *base) return ((char *)(base) + sizeof(struct pcpu) * curcpu); } +static inline void * +zpcpu_get_cpu(void *base, int cpu) +{ + + return ((char *)(base) + sizeof(struct pcpu) * cpu); +} + /* * Machine dependent callouts. cpu_pcpu_init() is responsible for * initializing machine dependent fields of struct pcpu, and Modified: stable/10/sys/vm/uma.h ============================================================================== --- stable/10/sys/vm/uma.h Tue Mar 4 14:23:58 2014 (r262738) +++ stable/10/sys/vm/uma.h Tue Mar 4 14:46:30 2014 (r262739) @@ -33,8 +33,8 @@ * */ -#ifndef VM_UMA_H -#define VM_UMA_H +#ifndef _VM_UMA_H_ +#define _VM_UMA_H_ #include /* For NULL */ #include /* For M_* */ @@ -636,6 +636,12 @@ int uma_zone_exhausted(uma_zone_t zone); int uma_zone_exhausted_nolock(uma_zone_t zone); /* + * Common UMA_ZONE_PCPU zones. + */ +extern uma_zone_t pcpu_zone_64; +extern uma_zone_t pcpu_zone_ptr; + +/* * Exported statistics structures to be used by user space monitoring tools. * Statistics stream consists of a uma_stream_header, followed by a series of * alternative uma_type_header and uma_type_stat structures. @@ -683,4 +689,4 @@ struct uma_percpu_stat { uint64_t _ups_reserved[5]; /* Reserved. */ }; -#endif +#endif /* _VM_UMA_H_ */ Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Tue Mar 4 14:23:58 2014 (r262738) +++ stable/10/sys/vm/uma_core.c Tue Mar 4 14:46:30 2014 (r262739) @@ -264,6 +264,7 @@ static uma_keg_t uma_kcreate(uma_zone_t uma_fini fini, int align, uint32_t flags); static int zone_import(uma_zone_t zone, void **bucket, int max, int flags); static void zone_release(uma_zone_t zone, void **bucket, int cnt); +static void uma_zero_item(void *item, uma_zone_t zone); void uma_print_zone(uma_zone_t); void uma_print_stats(void); @@ -2167,7 +2168,7 @@ zalloc_start: uma_dbg_alloc(zone, NULL, item); #endif if (flags & M_ZERO) - bzero(item, zone->uz_size); + uma_zero_item(item, zone); return (item); } @@ -2617,7 +2618,7 @@ zone_alloc_item(uma_zone_t zone, void *u uma_dbg_alloc(zone, NULL, item); #endif if (flags & M_ZERO) - bzero(item, zone->uz_size); + uma_zero_item(item, zone); return (item); @@ -3234,6 +3235,17 @@ uma_large_free(uma_slab_t slab) zone_free_item(slabzone, slab, NULL, SKIP_NONE); } +static void +uma_zero_item(void *item, uma_zone_t zone) +{ + + if (zone->uz_flags & UMA_ZONE_PCPU) { + for (int i = 0; i < mp_ncpus; i++) + bzero(zpcpu_get_cpu(item, i), zone->uz_size); + } else + bzero(item, zone->uz_size); +} + void uma_print_stats(void) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 14:49:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1ED84A88; Tue, 4 Mar 2014 14:49: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD91E46; Tue, 4 Mar 2014 14:49: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 s24En5Kj051447; Tue, 4 Mar 2014 14:49:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24En58t051444; Tue, 4 Mar 2014 14:49:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403041449.s24En58t051444@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Mar 2014 14:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262740 - stable/10/lib/libkvm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 14:49:06 -0000 Author: glebius Date: Tue Mar 4 14:49:05 2014 New Revision: 262740 URL: http://svnweb.freebsd.org/changeset/base/262740 Log: Merge r261796 from head: While it isn't too late and kvm_read_zpcpu() function isn't yet used outside libkvm(3), change its order of arguments, so that it is the same as in kvm_read(). Merge r261805 from head: Add kvm_getncpus() to obtain mp_ncpus. Modified: stable/10/lib/libkvm/kvm.h stable/10/lib/libkvm/kvm_getpcpu.3 stable/10/lib/libkvm/kvm_pcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libkvm/kvm.h ============================================================================== --- stable/10/lib/libkvm/kvm.h Tue Mar 4 14:46:30 2014 (r262739) +++ stable/10/lib/libkvm/kvm.h Tue Mar 4 14:49:05 2014 (r262740) @@ -77,6 +77,7 @@ char *kvm_geterr(kvm_t *); char *kvm_getfiles(kvm_t *, int, int, int *); int kvm_getloadavg(kvm_t *, double [], int); int kvm_getmaxcpu(kvm_t *); +int kvm_getncpus(kvm_t *); void *kvm_getpcpu(kvm_t *, int); uint64_t kvm_counter_u64_fetch(kvm_t *, u_long); struct kinfo_proc * @@ -88,7 +89,7 @@ kvm_t *kvm_open kvm_t *kvm_openfiles (const char *, const char *, const char *, int, char *); ssize_t kvm_read(kvm_t *, unsigned long, void *, size_t); -ssize_t kvm_read_zpcpu(kvm_t *, void *, u_long, size_t, int); +ssize_t kvm_read_zpcpu(kvm_t *, unsigned long, void *, size_t, int); ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t); __END_DECLS Modified: stable/10/lib/libkvm/kvm_getpcpu.3 ============================================================================== --- stable/10/lib/libkvm/kvm_getpcpu.3 Tue Mar 4 14:46:30 2014 (r262739) +++ stable/10/lib/libkvm/kvm_getpcpu.3 Tue Mar 4 14:49:05 2014 (r262740) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 11, 2013 +.Dd February 12, 2014 .Dt KVM_GETPCPU 3 .Os .Sh NAME @@ -47,10 +47,12 @@ .Fn kvm_dpcpu_setcpu "kvm_t *kd" "u_int cpu" .Ft int .Fn kvm_getmaxcpu "kvm_t *kd" +.Ft int +.Fn kvm_getncpus "kvm_t *kd" .Ft void * .Fn kvm_getpcpu "kvm_t *kd" "int cpu" .Ft ssize_t -.Fn kvm_read_zpcpu "kvm_t *kd" "void *buf" "u_long base" "size_t size" "int cpu" +.Fn kvm_read_zpcpu "kvm_t *kd" "u_long base" "void *buf" "size_t size" "int cpu" .Ft uint64_t .Fn kvm_counter_u64_fetch "kvm_t *kd" "u_long base" .Sh DESCRIPTION @@ -73,6 +75,10 @@ The function returns the maximum number of CPUs supported by the kernel. .Pp The +.Fn kvm_getncpus +function returns the current number of CPUs in the kernel. +.Pp +The .Fn kvm_getpcpu function returns a buffer holding the per-CPU data for a single CPU. This buffer is described by the Modified: stable/10/lib/libkvm/kvm_pcpu.c ============================================================================== --- stable/10/lib/libkvm/kvm_pcpu.c Tue Mar 4 14:46:30 2014 (r262739) +++ stable/10/lib/libkvm/kvm_pcpu.c Tue Mar 4 14:49:05 2014 (r262740) @@ -173,6 +173,16 @@ kvm_getmaxcpu(kvm_t *kd) return (maxcpu); } +int +kvm_getncpus(kvm_t *kd) +{ + + if (mp_ncpus == 0) + if (_kvm_pcpu_init(kd) < 0) + return (-1); + return (mp_ncpus); +} + static int _kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu, int report_error) { @@ -306,7 +316,7 @@ kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu) * Obtain a per-CPU copy for given cpu from UMA_ZONE_PCPU allocation. */ ssize_t -kvm_read_zpcpu(kvm_t *kd, void *buf, u_long base, size_t size, int cpu) +kvm_read_zpcpu(kvm_t *kd, u_long base, void *buf, size_t size, int cpu) { return (kvm_read(kd, (uintptr_t)(base + sizeof(struct pcpu) * cpu), @@ -327,7 +337,7 @@ kvm_counter_u64_fetch(kvm_t *kd, u_long r = 0; for (int i = 0; i < mp_ncpus; i++) { - if (kvm_read_zpcpu(kd, &c, base, sizeof(c), i) != sizeof(c)) + if (kvm_read_zpcpu(kd, base, &c, sizeof(c), i) != sizeof(c)) return (0); r += c; } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 15:14:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8B7B5438; Tue, 4 Mar 2014 15:14: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 75F24144; Tue, 4 Mar 2014 15:14: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 s24FEm1X063018; Tue, 4 Mar 2014 15:14:48 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24FEmr0063015; Tue, 4 Mar 2014 15:14:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403041514.s24FEmr0063015@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Mar 2014 15:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262743 - in stable/10: sys/conf sys/net sys/netinet sys/netinet6 usr.bin/netstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 15:14:48 -0000 Author: glebius Date: Tue Mar 4 15:14:47 2014 New Revision: 262743 URL: http://svnweb.freebsd.org/changeset/base/262743 Log: Merge r261582, r261601, r261610, r261613, r261627, r261640, r261641, r261823, r261825, r261859, r261875, r261883, r261911, r262027, r262028, r262029, r262030, r262162 from head. Large flowtable revamp. See commit messages for merged revisions for details. Sponsored by: Netflix Added: stable/10/usr.bin/netstat/flowtable.c - copied, changed from r261601, head/usr.bin/netstat/flowtable.c Modified: stable/10/sys/conf/options stable/10/sys/net/flowtable.c stable/10/sys/net/flowtable.h stable/10/sys/net/route.c stable/10/sys/netinet/ip_input.c stable/10/sys/netinet/ip_output.c stable/10/sys/netinet6/in6_proto.c stable/10/sys/netinet6/ip6_input.c stable/10/sys/netinet6/ip6_output.c stable/10/usr.bin/netstat/Makefile stable/10/usr.bin/netstat/main.c stable/10/usr.bin/netstat/netstat.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Tue Mar 4 15:09:57 2014 (r262742) +++ stable/10/sys/conf/options Tue Mar 4 15:14:47 2014 (r262743) @@ -438,6 +438,7 @@ TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h XBONEHACK FLOWTABLE opt_route.h +FLOWTABLE_HASH_ALL opt_route.h # # SCTP Modified: stable/10/sys/net/flowtable.c ============================================================================== --- stable/10/sys/net/flowtable.c Tue Mar 4 15:09:57 2014 (r262742) +++ stable/10/sys/net/flowtable.c Tue Mar 4 15:14:47 2014 (r262743) @@ -1,31 +1,30 @@ -/************************************************************************** - -Copyright (c) 2008-2010, BitGravity Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Neither the name of the BitGravity Corporation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -***************************************************************************/ +/*- + * Copyright (c) 2014 Gleb Smirnoff + * Copyright (c) 2008-2010, BitGravity Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Neither the name of the BitGravity Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #include "opt_route.h" #include "opt_mpath.h" @@ -36,29 +35,32 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include #include #include -#include +#include #include #include #include #include +#include #include +#include #include #include #include #include #include #include +#include #include #include #include -#include +#include #include #include @@ -70,156 +72,79 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #endif +#ifdef FLOWTABLE_HASH_ALL #include #include #include +#endif #include -struct ipv4_tuple { - uint16_t ip_sport; /* source port */ - uint16_t ip_dport; /* destination port */ - in_addr_t ip_saddr; /* source address */ - in_addr_t ip_daddr; /* destination address */ -}; - -union ipv4_flow { - struct ipv4_tuple ipf_ipt; - uint32_t ipf_key[3]; -}; +#ifdef FLOWTABLE_HASH_ALL +#define KEY_PORTS (sizeof(uint16_t) * 2) +#define KEY_ADDRS 2 +#else +#define KEY_PORTS 0 +#define KEY_ADDRS 1 +#endif -struct ipv6_tuple { - uint16_t ip_sport; /* source port */ - uint16_t ip_dport; /* destination port */ - struct in6_addr ip_saddr; /* source address */ - struct in6_addr ip_daddr; /* destination address */ -}; +#ifdef INET6 +#define KEY_ADDR_LEN sizeof(struct in6_addr) +#else +#define KEY_ADDR_LEN sizeof(struct in_addr) +#endif -union ipv6_flow { - struct ipv6_tuple ipf_ipt; - uint32_t ipf_key[9]; -}; +#define KEYLEN ((KEY_ADDR_LEN * KEY_ADDRS + KEY_PORTS) / sizeof(uint32_t)) struct flentry { - volatile uint32_t f_fhash; /* hash flowing forward */ - uint16_t f_flags; /* flow flags */ - uint8_t f_pad; - uint8_t f_proto; /* protocol */ - uint32_t f_fibnum; /* fib index */ + uint32_t f_hash; /* hash flowing forward */ + uint32_t f_key[KEYLEN]; /* address(es and ports) */ uint32_t f_uptime; /* uptime at last access */ - struct flentry *f_next; /* pointer to collision entry */ - volatile struct rtentry *f_rt; /* rtentry for flow */ - volatile struct llentry *f_lle; /* llentry for flow */ -}; - -struct flentry_v4 { - struct flentry fl_entry; - union ipv4_flow fl_flow; -}; - -struct flentry_v6 { - struct flentry fl_entry; - union ipv6_flow fl_flow; -}; - -#define fl_fhash fl_entry.fl_fhash -#define fl_flags fl_entry.fl_flags -#define fl_proto fl_entry.fl_proto -#define fl_uptime fl_entry.fl_uptime -#define fl_rt fl_entry.fl_rt -#define fl_lle fl_entry.fl_lle - -#define SECS_PER_HOUR 3600 -#define SECS_PER_DAY (24*SECS_PER_HOUR) - -#define SYN_IDLE 300 -#define UDP_IDLE 300 -#define FIN_WAIT_IDLE 600 -#define TCP_IDLE SECS_PER_DAY - - -typedef void fl_lock_t(struct flowtable *, uint32_t); -typedef void fl_rtalloc_t(struct route *, uint32_t, u_int); - -union flentryp { - struct flentry **global; - struct flentry **pcpu[MAXCPU]; + uint16_t f_fibnum; /* fib index */ +#ifdef FLOWTABLE_HASH_ALL + uint8_t f_proto; /* protocol */ + uint8_t f_flags; /* stale? */ +#define FL_STALE 1 +#endif + SLIST_ENTRY(flentry) f_next; /* pointer to collision entry */ + struct rtentry *f_rt; /* rtentry for flow */ + struct llentry *f_lle; /* llentry for flow */ }; +#undef KEYLEN -struct flowtable_stats { - uint64_t ft_collisions; - uint64_t ft_allocated; - uint64_t ft_misses; - uint64_t ft_max_depth; - uint64_t ft_free_checks; - uint64_t ft_frees; - uint64_t ft_hits; - uint64_t ft_lookups; -} __aligned(CACHE_LINE_SIZE); +SLIST_HEAD(flist, flentry); +/* Make sure we can use pcpu_zone_ptr for struct flist. */ +CTASSERT(sizeof(struct flist) == sizeof(void *)); struct flowtable { - struct flowtable_stats ft_stats[MAXCPU]; + counter_u64_t *ft_stat; int ft_size; - int ft_lock_count; - uint32_t ft_flags; - char *ft_name; - fl_lock_t *ft_lock; - fl_lock_t *ft_unlock; - fl_rtalloc_t *ft_rtalloc; /* - * XXX need to pad out - */ - struct mtx *ft_locks; - union flentryp ft_table; - bitstr_t *ft_masks[MAXCPU]; + * ft_table is a malloc(9)ed array of pointers. Pointers point to + * memory from UMA_ZONE_PCPU zone. + * ft_masks is per-cpu pointer itself. Each instance points + * to a malloc(9)ed bitset, that is private to corresponding CPU. + */ + struct flist **ft_table; + bitstr_t **ft_masks; bitstr_t *ft_tmpmask; - struct flowtable *ft_next; +}; - uint32_t ft_count __aligned(CACHE_LINE_SIZE); - uint32_t ft_udp_idle __aligned(CACHE_LINE_SIZE); - uint32_t ft_fin_wait_idle; - uint32_t ft_syn_idle; - uint32_t ft_tcp_idle; - boolean_t ft_full; -} __aligned(CACHE_LINE_SIZE); +#define FLOWSTAT_ADD(ft, name, v) \ + counter_u64_add((ft)->ft_stat[offsetof(struct flowtable_stat, name) / sizeof(uint64_t)], (v)) +#define FLOWSTAT_INC(ft, name) FLOWSTAT_ADD(ft, name, 1) static struct proc *flowcleanerproc; -static VNET_DEFINE(struct flowtable *, flow_list_head); -static VNET_DEFINE(uint32_t, flow_hashjitter); -static VNET_DEFINE(uma_zone_t, flow_ipv4_zone); -static VNET_DEFINE(uma_zone_t, flow_ipv6_zone); - -#define V_flow_list_head VNET(flow_list_head) -#define V_flow_hashjitter VNET(flow_hashjitter) -#define V_flow_ipv4_zone VNET(flow_ipv4_zone) -#define V_flow_ipv6_zone VNET(flow_ipv6_zone) - +static uint32_t flow_hashjitter; static struct cv flowclean_f_cv; static struct cv flowclean_c_cv; static struct mtx flowclean_lock; static uint32_t flowclean_cycles; -static uint32_t flowclean_freq; - -#ifdef FLOWTABLE_DEBUG -#define FLDPRINTF(ft, flags, fmt, ...) \ -do { \ - if ((ft)->ft_flags & (flags)) \ - printf((fmt), __VA_ARGS__); \ -} while (0); \ - -#else -#define FLDPRINTF(ft, flags, fmt, ...) - -#endif - /* * TODO: - * - Make flowtable stats per-cpu, aggregated at sysctl call time, - * to avoid extra cache evictions caused by incrementing a shared - * counter - * - add sysctls to resize && flush flow tables + * - add sysctls to resize && flush flow tables * - Add per flowtable sysctls for statistics and configuring timeouts * - add saturation counter to rtentry to support per-packet load-balancing * add flag to indicate round-robin flow, add list lookup from head @@ -230,396 +155,117 @@ do { \ * - support explicit connection state (currently only ad-hoc for DSR) * - idetach() cleanup for options VIMAGE builds. */ -VNET_DEFINE(int, flowtable_enable) = 1; -static VNET_DEFINE(int, flowtable_debug); -static VNET_DEFINE(int, flowtable_syn_expire) = SYN_IDLE; -static VNET_DEFINE(int, flowtable_udp_expire) = UDP_IDLE; -static VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE; -static VNET_DEFINE(int, flowtable_tcp_expire) = TCP_IDLE; -static VNET_DEFINE(int, flowtable_nmbflows); -static VNET_DEFINE(int, flowtable_ready) = 0; +#ifdef INET +static VNET_DEFINE(struct flowtable, ip4_ft); +#define V_ip4_ft VNET(ip4_ft) +#endif +#ifdef INET6 +static VNET_DEFINE(struct flowtable, ip6_ft); +#define V_ip6_ft VNET(ip6_ft) +#endif +static uma_zone_t flow_zone; + +static VNET_DEFINE(int, flowtable_enable) = 1; #define V_flowtable_enable VNET(flowtable_enable) -#define V_flowtable_debug VNET(flowtable_debug) -#define V_flowtable_syn_expire VNET(flowtable_syn_expire) -#define V_flowtable_udp_expire VNET(flowtable_udp_expire) -#define V_flowtable_fin_wait_expire VNET(flowtable_fin_wait_expire) -#define V_flowtable_tcp_expire VNET(flowtable_tcp_expire) -#define V_flowtable_nmbflows VNET(flowtable_nmbflows) -#define V_flowtable_ready VNET(flowtable_ready) -static SYSCTL_NODE(_net_inet, OID_AUTO, flowtable, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_net, OID_AUTO, flowtable, CTLFLAG_RD, NULL, "flowtable"); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, debug, CTLFLAG_RW, - &VNET_NAME(flowtable_debug), 0, "print debug info."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, enable, CTLFLAG_RW, +SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, enable, CTLFLAG_RW, &VNET_NAME(flowtable_enable), 0, "enable flowtable caching."); +SYSCTL_UMA_MAX(_net_flowtable, OID_AUTO, maxflows, CTLFLAG_RW, + &flow_zone, "Maximum number of flows allowed"); -/* - * XXX This does not end up updating timeouts at runtime - * and only reflects the value for the last table added :-/ - */ -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, - &VNET_NAME(flowtable_syn_expire), 0, - "seconds after which to remove syn allocated flow."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, - &VNET_NAME(flowtable_udp_expire), 0, - "seconds after which to remove flow allocated to UDP."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, fin_wait_expire, CTLFLAG_RW, - &VNET_NAME(flowtable_fin_wait_expire), 0, - "seconds after which to remove a flow in FIN_WAIT."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, - &VNET_NAME(flowtable_tcp_expire), 0, - "seconds after which to remove flow allocated to a TCP connection."); - - -/* - * Maximum number of flows that can be allocated of a given type. - * - * The table is allocated at boot time (for the pure caching case - * there is no reason why this could not be changed at runtime) - * and thus (currently) needs to be set with a tunable. - */ -static int -sysctl_nmbflows(SYSCTL_HANDLER_ARGS) -{ - int error, newnmbflows; - - newnmbflows = V_flowtable_nmbflows; - error = sysctl_handle_int(oidp, &newnmbflows, 0, req); - if (error == 0 && req->newptr) { - if (newnmbflows > V_flowtable_nmbflows) { - V_flowtable_nmbflows = newnmbflows; - uma_zone_set_max(V_flow_ipv4_zone, - V_flowtable_nmbflows); - uma_zone_set_max(V_flow_ipv6_zone, - V_flowtable_nmbflows); - } else - error = EINVAL; - } - return (error); -} -SYSCTL_VNET_PROC(_net_inet_flowtable, OID_AUTO, nmbflows, - CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_nmbflows, "IU", - "Maximum number of flows allowed"); - - - -#define FS_PRINT(sb, field) sbuf_printf((sb), "\t%s: %jd\n", #field, fs->ft_##field) - -static void -fs_print(struct sbuf *sb, struct flowtable_stats *fs) -{ - - FS_PRINT(sb, collisions); - FS_PRINT(sb, allocated); - FS_PRINT(sb, misses); - FS_PRINT(sb, max_depth); - FS_PRINT(sb, free_checks); - FS_PRINT(sb, frees); - FS_PRINT(sb, hits); - FS_PRINT(sb, lookups); -} - -static void -flowtable_show_stats(struct sbuf *sb, struct flowtable *ft) -{ - int i; - struct flowtable_stats fs, *pfs; - - if (ft->ft_flags & FL_PCPU) { - bzero(&fs, sizeof(fs)); - pfs = &fs; - CPU_FOREACH(i) { - pfs->ft_collisions += ft->ft_stats[i].ft_collisions; - pfs->ft_allocated += ft->ft_stats[i].ft_allocated; - pfs->ft_misses += ft->ft_stats[i].ft_misses; - pfs->ft_free_checks += ft->ft_stats[i].ft_free_checks; - pfs->ft_frees += ft->ft_stats[i].ft_frees; - pfs->ft_hits += ft->ft_stats[i].ft_hits; - pfs->ft_lookups += ft->ft_stats[i].ft_lookups; - if (ft->ft_stats[i].ft_max_depth > pfs->ft_max_depth) - pfs->ft_max_depth = ft->ft_stats[i].ft_max_depth; - } - } else { - pfs = &ft->ft_stats[0]; - } - fs_print(sb, pfs); -} - -static int -sysctl_flowtable_stats(SYSCTL_HANDLER_ARGS) -{ - struct flowtable *ft; - struct sbuf *sb; - int error; - - sb = sbuf_new(NULL, NULL, 64*1024, SBUF_FIXEDLEN); +static MALLOC_DEFINE(M_FTABLE, "flowtable", "flowtable hashes and bitstrings"); - ft = V_flow_list_head; - while (ft != NULL) { - sbuf_printf(sb, "\ntable name: %s\n", ft->ft_name); - flowtable_show_stats(sb, ft); - ft = ft->ft_next; - } - sbuf_finish(sb); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); - sbuf_delete(sb); - - return (error); -} -SYSCTL_VNET_PROC(_net_inet_flowtable, OID_AUTO, stats, CTLTYPE_STRING|CTLFLAG_RD, - NULL, 0, sysctl_flowtable_stats, "A", "flowtable statistics"); - - -#ifndef RADIX_MPATH -static void -rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum) -{ - - rtalloc_ign_fib(ro, 0, fibnum); -} -#endif - -static void -flowtable_global_lock(struct flowtable *table, uint32_t hash) -{ - int lock_index = (hash)&(table->ft_lock_count - 1); - - mtx_lock(&table->ft_locks[lock_index]); -} - -static void -flowtable_global_unlock(struct flowtable *table, uint32_t hash) -{ - int lock_index = (hash)&(table->ft_lock_count - 1); - - mtx_unlock(&table->ft_locks[lock_index]); -} - -static void -flowtable_pcpu_lock(struct flowtable *table, uint32_t hash) -{ - - critical_enter(); -} - -static void -flowtable_pcpu_unlock(struct flowtable *table, uint32_t hash) -{ - - critical_exit(); -} - -#define FL_ENTRY_INDEX(table, hash)((hash) % (table)->ft_size) -#define FL_ENTRY(table, hash) *flowtable_entry((table), (hash)) -#define FL_ENTRY_LOCK(table, hash) (table)->ft_lock((table), (hash)) -#define FL_ENTRY_UNLOCK(table, hash) (table)->ft_unlock((table), (hash)) - -#define FL_STALE (1<<8) -#define FL_OVERWRITE (1<<10) - -void -flow_invalidate(struct flentry *fle) -{ - - fle->f_flags |= FL_STALE; -} - -static __inline int -proto_to_flags(uint8_t proto) -{ - int flag; - - switch (proto) { - case IPPROTO_TCP: - flag = FL_TCP; - break; - case IPPROTO_SCTP: - flag = FL_SCTP; - break; - case IPPROTO_UDP: - flag = FL_UDP; - break; - default: - flag = 0; - break; - } - - return (flag); -} - -static __inline int -flags_to_proto(int flags) -{ - int proto, protoflags; - - protoflags = flags & (FL_TCP|FL_SCTP|FL_UDP); - switch (protoflags) { - case FL_TCP: - proto = IPPROTO_TCP; - break; - case FL_SCTP: - proto = IPPROTO_SCTP; - break; - case FL_UDP: - proto = IPPROTO_UDP; - break; - default: - proto = 0; - break; - } - return (proto); -} +static struct flentry * +flowtable_lookup_common(struct flowtable *, uint32_t *, int, uint32_t); #ifdef INET -#ifdef FLOWTABLE_DEBUG -static void -ipv4_flow_print_tuple(int flags, int proto, struct sockaddr_in *ssin, - struct sockaddr_in *dsin) -{ - char saddr[4*sizeof "123"], daddr[4*sizeof "123"]; - - if (flags & FL_HASH_ALL) { - inet_ntoa_r(ssin->sin_addr, saddr); - inet_ntoa_r(dsin->sin_addr, daddr); - printf("proto=%d %s:%d->%s:%d\n", - proto, saddr, ntohs(ssin->sin_port), daddr, - ntohs(dsin->sin_port)); - } else { - inet_ntoa_r(*(struct in_addr *) &dsin->sin_addr, daddr); - printf("proto=%d %s\n", proto, daddr); - } - -} -#endif - -static int -ipv4_mbuf_demarshal(struct flowtable *ft, struct mbuf *m, - struct sockaddr_in *ssin, struct sockaddr_in *dsin, uint16_t *flags) +static struct flentry * +flowtable_lookup_ipv4(struct mbuf *m, struct route *ro) { + struct flentry *fle; + struct sockaddr_in *sin; struct ip *ip; - uint8_t proto; + uint32_t fibnum; +#ifdef FLOWTABLE_HASH_ALL + uint32_t key[3]; int iphlen; - struct tcphdr *th; - struct udphdr *uh; - struct sctphdr *sh; uint16_t sport, dport; + uint8_t proto; +#endif - proto = sport = dport = 0; ip = mtod(m, struct ip *); - dsin->sin_family = AF_INET; - dsin->sin_len = sizeof(*dsin); - dsin->sin_addr = ip->ip_dst; - ssin->sin_family = AF_INET; - ssin->sin_len = sizeof(*ssin); - ssin->sin_addr = ip->ip_src; - proto = ip->ip_p; - if ((*flags & FL_HASH_ALL) == 0) { - FLDPRINTF(ft, FL_DEBUG_ALL, "skip port check flags=0x%x ", - *flags); - goto skipports; - } + if (ip->ip_src.s_addr == ip->ip_dst.s_addr || + (ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || + (ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) + return (NULL); - iphlen = ip->ip_hl << 2; /* XXX options? */ + fibnum = M_GETFIB(m); + +#ifdef FLOWTABLE_HASH_ALL + iphlen = ip->ip_hl << 2; + proto = ip->ip_p; switch (proto) { - case IPPROTO_TCP: - th = (struct tcphdr *)((caddr_t)ip + iphlen); + case IPPROTO_TCP: { + struct tcphdr *th; + + th = (struct tcphdr *)((char *)ip + iphlen); sport = th->th_sport; dport = th->th_dport; - if ((*flags & FL_HASH_ALL) && - (th->th_flags & (TH_RST|TH_FIN))) - *flags |= FL_STALE; - break; - case IPPROTO_UDP: - uh = (struct udphdr *)((caddr_t)ip + iphlen); + if (th->th_flags & (TH_RST|TH_FIN)) + fibnum |= (FL_STALE << 24); + break; + } + case IPPROTO_UDP: { + struct udphdr *uh; + + uh = (struct udphdr *)((char *)ip + iphlen); sport = uh->uh_sport; dport = uh->uh_dport; - break; - case IPPROTO_SCTP: - sh = (struct sctphdr *)((caddr_t)ip + iphlen); + break; + } + case IPPROTO_SCTP: { + struct sctphdr *sh; + + sh = (struct sctphdr *)((char *)ip + iphlen); sport = sh->src_port; dport = sh->dest_port; - break; + /* XXXGL: handle stale? */ + break; + } default: - FLDPRINTF(ft, FL_DEBUG_ALL, "proto=0x%x not supported\n", proto); - return (ENOTSUP); - /* no port - hence not a protocol we care about */ + sport = dport = 0; break; - } -skipports: - *flags |= proto_to_flags(proto); - ssin->sin_port = sport; - dsin->sin_port = dport; - return (0); -} - -static uint32_t -ipv4_flow_lookup_hash_internal( - struct sockaddr_in *ssin, struct sockaddr_in *dsin, - uint32_t *key, uint16_t flags) -{ - uint16_t sport, dport; - uint8_t proto; - int offset = 0; + key[0] = ip->ip_dst.s_addr; + key[1] = ip->ip_src.s_addr; + key[2] = (dport << 16) | sport; + fibnum |= proto << 16; - if ((V_flowtable_enable == 0) || (V_flowtable_ready == 0)) - return (0); - proto = flags_to_proto(flags); - sport = dport = key[2] = key[1] = key[0] = 0; - if ((ssin != NULL) && (flags & FL_HASH_ALL)) { - key[1] = ssin->sin_addr.s_addr; - sport = ssin->sin_port; - } - if (dsin != NULL) { - key[2] = dsin->sin_addr.s_addr; - dport = dsin->sin_port; - } - if (flags & FL_HASH_ALL) { - ((uint16_t *)key)[0] = sport; - ((uint16_t *)key)[1] = dport; - } else - offset = V_flow_hashjitter + proto; + fle = flowtable_lookup_common(&V_ip4_ft, key, 3 * sizeof(uint32_t), + fibnum); - return (jenkins_hash32(key, 3, offset)); -} +#else /* !FLOWTABLE_HASH_ALL */ -static struct flentry * -flowtable_lookup_mbuf4(struct flowtable *ft, struct mbuf *m) -{ - struct sockaddr_storage ssa, dsa; - uint16_t flags; - struct sockaddr_in *dsin, *ssin; - - dsin = (struct sockaddr_in *)&dsa; - ssin = (struct sockaddr_in *)&ssa; - bzero(dsin, sizeof(*dsin)); - bzero(ssin, sizeof(*ssin)); - flags = ft->ft_flags; - if (ipv4_mbuf_demarshal(ft, m, ssin, dsin, &flags) != 0) - return (NULL); + fle = flowtable_lookup_common(&V_ip4_ft, (uint32_t *)&ip->ip_dst, + sizeof(struct in_addr), fibnum); - return (flowtable_lookup(ft, &ssa, &dsa, M_GETFIB(m), flags)); -} +#endif /* FLOWTABLE_HASH_ALL */ -void -flow_to_route(struct flentry *fle, struct route *ro) -{ - uint32_t *hashkey = NULL; - struct sockaddr_in *sin; + if (fle == NULL) + return (NULL); sin = (struct sockaddr_in *)&ro->ro_dst; sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); - hashkey = ((struct flentry_v4 *)fle)->fl_flow.ipf_key; - sin->sin_addr.s_addr = hashkey[2]; - ro->ro_rt = __DEVOLATILE(struct rtentry *, fle->f_rt); - ro->ro_lle = __DEVOLATILE(struct llentry *, fle->f_lle); - ro->ro_flags |= RT_NORTREF; + sin->sin_addr = ip->ip_dst; + + return (fle); } #endif /* INET */ @@ -633,9 +279,8 @@ flow_to_route(struct flentry *fle, struc #define PULLUP_TO(_len, p, T) \ do { \ int x = (_len) + sizeof(T); \ - if ((m)->m_len < x) { \ - goto receive_failed; \ - } \ + if ((m)->m_len < x) \ + return (NULL); \ p = (mtod(m, char *) + (_len)); \ } while (0) @@ -643,26 +288,35 @@ do { \ #define SCTP(p) ((struct sctphdr *)(p)) #define UDP(p) ((struct udphdr *)(p)) -static int -ipv6_mbuf_demarshal(struct flowtable *ft, struct mbuf *m, - struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, uint16_t *flags) +static struct flentry * +flowtable_lookup_ipv6(struct mbuf *m, struct route *ro) { + struct flentry *fle; + struct sockaddr_in6 *sin6; struct ip6_hdr *ip6; - uint8_t proto; + uint32_t fibnum; +#ifdef FLOWTABLE_HASH_ALL + uint32_t key[9]; + void *ulp; int hlen; - uint16_t src_port, dst_port; + uint16_t sport, dport; u_short offset; - void *ulp; + uint8_t proto; +#else + uint32_t key[4]; +#endif - offset = hlen = src_port = dst_port = 0; - ulp = NULL; ip6 = mtod(m, struct ip6_hdr *); - hlen = sizeof(struct ip6_hdr); - proto = ip6->ip6_nxt; + if (in6_localaddr(&ip6->ip6_dst)) + return (NULL); - if ((*flags & FL_HASH_ALL) == 0) - goto skipports; + fibnum = M_GETFIB(m); +#ifdef FLOWTABLE_HASH_ALL + hlen = sizeof(struct ip6_hdr); + proto = ip6->ip6_nxt; + offset = sport = dport = 0; + ulp = NULL; while (ulp == NULL) { switch (proto) { case IPPROTO_ICMPV6: @@ -675,21 +329,21 @@ ipv6_mbuf_demarshal(struct flowtable *ft break; case IPPROTO_TCP: PULLUP_TO(hlen, ulp, struct tcphdr); - dst_port = TCP(ulp)->th_dport; - src_port = TCP(ulp)->th_sport; - if ((*flags & FL_HASH_ALL) && - (TCP(ulp)->th_flags & (TH_RST|TH_FIN))) - *flags |= FL_STALE; + dport = TCP(ulp)->th_dport; + sport = TCP(ulp)->th_sport; + if (TCP(ulp)->th_flags & (TH_RST|TH_FIN)) + fibnum |= (FL_STALE << 24); break; case IPPROTO_SCTP: PULLUP_TO(hlen, ulp, struct sctphdr); - src_port = SCTP(ulp)->src_port; - dst_port = SCTP(ulp)->dest_port; + dport = SCTP(ulp)->src_port; + sport = SCTP(ulp)->dest_port; + /* XXXGL: handle stale? */ break; case IPPROTO_UDP: PULLUP_TO(hlen, ulp, struct udphdr); - dst_port = UDP(ulp)->uh_dport; - src_port = UDP(ulp)->uh_sport; + dport = UDP(ulp)->uh_dport; + sport = UDP(ulp)->uh_sport; break; case IPPROTO_HOPOPTS: /* RFC 2460 */ PULLUP_TO(hlen, ulp, struct ip6_hbh); @@ -698,7 +352,7 @@ ipv6_mbuf_demarshal(struct flowtable *ft ulp = NULL; break; case IPPROTO_ROUTING: /* RFC 2460 */ - PULLUP_TO(hlen, ulp, struct ip6_rthdr); + PULLUP_TO(hlen, ulp, struct ip6_rthdr); hlen += (((struct ip6_rthdr *)ulp)->ip6r_len + 1) << 3; proto = ((struct ip6_rthdr *)ulp)->ip6r_nxt; ulp = NULL; @@ -729,689 +383,395 @@ ipv6_mbuf_demarshal(struct flowtable *ft } } - if (src_port == 0) { - receive_failed: - return (ENOTSUP); - } - -skipports: - dsin6->sin6_family = AF_INET6; - dsin6->sin6_len = sizeof(*dsin6); - dsin6->sin6_port = dst_port; - memcpy(&dsin6->sin6_addr, &ip6->ip6_dst, sizeof(struct in6_addr)); - - ssin6->sin6_family = AF_INET6; - ssin6->sin6_len = sizeof(*ssin6); - ssin6->sin6_port = src_port; - memcpy(&ssin6->sin6_addr, &ip6->ip6_src, sizeof(struct in6_addr)); - *flags |= proto_to_flags(proto); - - return (0); -} - -#define zero_key(key) \ -do { \ - key[0] = 0; \ - key[1] = 0; \ - key[2] = 0; \ - key[3] = 0; \ - key[4] = 0; \ - key[5] = 0; \ - key[6] = 0; \ - key[7] = 0; \ - key[8] = 0; \ -} while (0) - -static uint32_t -ipv6_flow_lookup_hash_internal( - struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, - uint32_t *key, uint16_t flags) -{ - uint16_t sport, dport; - uint8_t proto; - int offset = 0; - - if ((V_flowtable_enable == 0) || (V_flowtable_ready == 0)) - return (0); - - proto = flags_to_proto(flags); - zero_key(key); - sport = dport = 0; - if (dsin6 != NULL) { - memcpy(&key[1], &dsin6->sin6_addr, sizeof(struct in6_addr)); - dport = dsin6->sin6_port; - } - if ((ssin6 != NULL) && (flags & FL_HASH_ALL)) { - memcpy(&key[5], &ssin6->sin6_addr, sizeof(struct in6_addr)); - sport = ssin6->sin6_port; - } - if (flags & FL_HASH_ALL) { - ((uint16_t *)key)[0] = sport; - ((uint16_t *)key)[1] = dport; - } else - offset = V_flow_hashjitter + proto; - - return (jenkins_hash32(key, 9, offset)); -} + bcopy(&ip6->ip6_dst, &key[0], sizeof(struct in6_addr)); + bcopy(&ip6->ip6_src, &key[4], sizeof(struct in6_addr)); + key[8] = (dport << 16) | sport; + fibnum |= proto << 16; + + fle = flowtable_lookup_common(&V_ip6_ft, key, 9 * sizeof(uint32_t), + fibnum); +#else /* !FLOWTABLE_HASH_ALL */ + bcopy(&ip6->ip6_dst, &key[0], sizeof(struct in6_addr)); + fle = flowtable_lookup_common(&V_ip6_ft, key, sizeof(struct in6_addr), + fibnum); +#endif /* FLOWTABLE_HASH_ALL */ -static struct flentry * -flowtable_lookup_mbuf6(struct flowtable *ft, struct mbuf *m) -{ - struct sockaddr_storage ssa, dsa; - struct sockaddr_in6 *dsin6, *ssin6; - uint16_t flags; - - dsin6 = (struct sockaddr_in6 *)&dsa; - ssin6 = (struct sockaddr_in6 *)&ssa; - bzero(dsin6, sizeof(*dsin6)); - bzero(ssin6, sizeof(*ssin6)); - flags = ft->ft_flags; - - if (ipv6_mbuf_demarshal(ft, m, ssin6, dsin6, &flags) != 0) + if (fle == NULL) return (NULL); - return (flowtable_lookup(ft, &ssa, &dsa, M_GETFIB(m), flags)); -} - -void -flow_to_route_in6(struct flentry *fle, struct route_in6 *ro) -{ - uint32_t *hashkey = NULL; - struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&ro->ro_dst; - sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); - hashkey = ((struct flentry_v6 *)fle)->fl_flow.ipf_key; - memcpy(&sin6->sin6_addr, &hashkey[5], sizeof (struct in6_addr)); - ro->ro_rt = __DEVOLATILE(struct rtentry *, fle->f_rt); - ro->ro_lle = __DEVOLATILE(struct llentry *, fle->f_lle); - ro->ro_flags |= RT_NORTREF; + bcopy(&ip6->ip6_dst, &sin6->sin6_addr, sizeof(struct in6_addr)); + + return (fle); } #endif /* INET6 */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 18:38:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D59A5524; Tue, 4 Mar 2014 18:38:23 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA63D89D; Tue, 4 Mar 2014 18:38:23 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CBA00B982; Tue, 4 Mar 2014 13:38:21 -0500 (EST) From: John Baldwin To: "Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?=" Subject: Re: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-comp... Date: Tue, 4 Mar 2014 11:46:57 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201402271729.s1RHT2rx075258@svn.freebsd.org> <20140303233839.GD1659@garage.freebsd.pl> <86vbvutkz4.fsf@nine.des.no> In-Reply-To: <86vbvutkz4.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201403041146.57895.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 04 Mar 2014 13:38:21 -0500 (EST) Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-10@freebsd.org, Dimitry Andric X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 18:38:23 -0000 On Tuesday, March 04, 2014 3:40:47 am Dag-Erling Sm=C3=B8rgrav wrote: > Pawel Jakub Dawidek writes: > > Dimitry Andric writes: > > > Wouldn't it be enough to merge r261499 ("Fix installations that use > > > kernels without CAPABILITIES support") by pjd? > > Yes, my change should be definiately merged with OpenSSH merge. If > > nobody beats me to it, I should be able to merge it tomorrow. >=20 > Please do. I thought I had included it in the MFC since it was already > in head, but I'd forgotten that it had been committed separately. >=20 > BTW, IWBNI there were a cap_available() predicate or something like that > which we could check up front, and short-circuit the entire Capsicum > part of ssh_sandbox_child() if it failed. If the capsicum code adds a FEATURE(capsicum) macro in the kernel bits, you= =20 can use 'if (feature_present("capsicum"))' in userland to check. =2D-=20 John Baldwin From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 18:38:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5D03E791; Tue, 4 Mar 2014 18:38:34 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 35EF78AA; Tue, 4 Mar 2014 18:38:34 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 33BF8B987; Tue, 4 Mar 2014 13:38:33 -0500 (EST) From: John Baldwin To: Xin LI Subject: Re: svn commit: r262718 - stable/10/crypto/openssh Date: Tue, 4 Mar 2014 12:39:07 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403032319.s23NJTBN072528@svn.freebsd.org> In-Reply-To: <201403032319.s23NJTBN072528@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201403041239.07110.john@baldwin.cx> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 04 Mar 2014 13:38:33 -0500 (EST) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 18:38:34 -0000 On Monday, March 03, 2014 6:19:29 pm Xin LI wrote: > Author: delphij > Date: Mon Mar 3 23:19:28 2014 > New Revision: 262718 > URL: http://svnweb.freebsd.org/changeset/base/262718 > > Log: > MFC r261499 (pjd): > > Fix installations that use kernels without CAPABILITIES support. Thanks! -- John Baldwin From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 19:47:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 34F0D276; Tue, 4 Mar 2014 19:47:21 +0000 (UTC) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id E7B4DF1C; Tue, 4 Mar 2014 19:47:20 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id A9C4585C; Tue, 4 Mar 2014 20:47:18 +0100 (CET) Date: Tue, 4 Mar 2014 20:49:09 +0100 From: Pawel Jakub Dawidek To: John Baldwin Subject: Re: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-comp... Message-ID: <20140304194908.GA1672@garage.freebsd.pl> References: <201402271729.s1RHT2rx075258@svn.freebsd.org> <20140303233839.GD1659@garage.freebsd.pl> <86vbvutkz4.fsf@nine.des.no> <201403041146.57895.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: <201403041146.57895.jhb@freebsd.org> X-OS: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: src-committers@freebsd.org, svn-src-stable-10@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , Dimitry Andric X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 19:47:21 -0000 --9amGYk9869ThD9tj Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 04, 2014 at 11:46:57AM -0500, John Baldwin wrote: > On Tuesday, March 04, 2014 3:40:47 am Dag-Erling Sm=F8rgrav wrote: > > Pawel Jakub Dawidek writes: > > > Dimitry Andric writes: > > > > Wouldn't it be enough to merge r261499 ("Fix installations that use > > > > kernels without CAPABILITIES support") by pjd? > > > Yes, my change should be definiately merged with OpenSSH merge. If > > > nobody beats me to it, I should be able to merge it tomorrow. > >=20 > > Please do. I thought I had included it in the MFC since it was already > > in head, but I'd forgotten that it had been committed separately. Xin already did it. > > BTW, IWBNI there were a cap_available() predicate or something like that > > which we could check up front, and short-circuit the entire Capsicum > > part of ssh_sandbox_child() if it failed. >=20 > If the capsicum code adds a FEATURE(capsicum) macro in the kernel bits, y= ou=20 > can use 'if (feature_present("capsicum"))' in userland to check. It does add the following: FEATURE(security_capability_mode, "Capsicum Capability Mode"); FEATURE(security_capabilities, "Capsicum Capabilities"); --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --9amGYk9869ThD9tj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlMWLjQACgkQForvXbEpPzSeuwCfXQE1fHx1MJmmI12wY7dvSJnX U54AmgKj4YJzti5n+fF2/64Yc8f49gwv =Jd19 -----END PGP SIGNATURE----- --9amGYk9869ThD9tj-- From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 4 21:51:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A383E84E; Tue, 4 Mar 2014 21:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 900B4F4A; Tue, 4 Mar 2014 21:51: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 s24Lp9kw029393; Tue, 4 Mar 2014 21:51:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24Lp9n1029391; Tue, 4 Mar 2014 21:51:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403042151.s24Lp9n1029391@svn.freebsd.org> From: Ed Maste Date: Tue, 4 Mar 2014 21:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262753 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 21:51:09 -0000 Author: emaste Date: Tue Mar 4 21:51:09 2014 New Revision: 262753 URL: http://svnweb.freebsd.org/changeset/base/262753 Log: Disable amd64 TLB Context ID (pcid) by default for now There are a number of reports of userspace application crashes that are "solved" by setting vm.pmap.pcid_enabled=0, including Java and the x11/mate-terminal port (PR ports/184362). For now apply a band-aid of disabling pcid by default in stable/10. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/amd64/amd64/pmap.c Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Tue Mar 4 21:35:57 2014 (r262752) +++ stable/10/sys/amd64/amd64/pmap.c Tue Mar 4 21:51:09 2014 (r262753) @@ -367,7 +367,7 @@ static int pmap_flags = PMAP_PDE_SUPERPA static struct unrhdr pcid_unr; static struct mtx pcid_mtx; -int pmap_pcid_enabled = 1; +int pmap_pcid_enabled = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN, &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?"); int invpcid_works = 0; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 5 00:45:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 426E86FE; Wed, 5 Mar 2014 00:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2287B32B; Wed, 5 Mar 2014 00:45: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 s250jU53002078; Wed, 5 Mar 2014 00:45:30 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s250jT7E002070; Wed, 5 Mar 2014 00:45:29 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403050045.s250jT7E002070@svn.freebsd.org> From: Glen Barber Date: Wed, 5 Mar 2014 00:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262761 - in stable/10: release release/picobsd/build share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 00:45:30 -0000 Author: gjb Date: Wed Mar 5 00:45:28 2014 New Revision: 262761 URL: http://svnweb.freebsd.org/changeset/base/262761 Log: MFC r262499, r262505, r262507, r262509: r262499: release.sh: - Add a VCSCMD variable that defaults to 'svn checkout', and update places 'svn co' is used directly. - After sourcing a configuration file, prefix SRCBRANCH, PORTBRANCH, and DOCBRANCH with the SVNROOT. - Properly capitalize 'FreeBSD.org' in the default SVNROOT. - Update Copyright. release.conf.sample: - Add an example to use git instead of svn, by nullifying SVNROOT, and setting SRCBRANCH, DOCBRANCH, and PORTBRANCH to the URL fo a git repository. release.7: - Document VCSCMD. r262505: In release/Makefile, remove exclusion of CVS directories in the src/ and ports/ distributions. While I am thinking about it, exclude .git directories for src/ and ports/, as somewhat of a followup to r262499. r262507: Chase r262505, and remove CVS exclusion from picobsd builds. r262509: Rework how WORLD_FLAGS and KERNEL_FLAGS are set, to remove an unnecessary expr(1) call. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile stable/10/release/picobsd/build/picobsd stable/10/release/release.conf.sample stable/10/release/release.sh stable/10/share/man/man7/release.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Wed Mar 5 00:40:03 2014 (r262760) +++ stable/10/release/Makefile Wed Mar 5 00:45:28 2014 (r262761) @@ -119,13 +119,13 @@ src.txz: mkdir -p ${DISTDIR}/usr ln -fs ${WORLDDIR} ${DISTDIR}/usr/src cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude .zfs \ - --exclude CVS --exclude @ --exclude usr/src/release/dist usr/src + --exclude .git --exclude @ --exclude usr/src/release/dist usr/src ports.txz: mkdir -p ${DISTDIR}/usr ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \ - --exclude CVS --exclude .svn \ + --exclude .git --exclude .svn \ --exclude usr/ports/distfiles --exclude usr/ports/packages \ --exclude 'usr/ports/INDEX*' --exclude work usr/ports Modified: stable/10/release/picobsd/build/picobsd ============================================================================== --- stable/10/release/picobsd/build/picobsd Wed Mar 5 00:40:03 2014 (r262760) +++ stable/10/release/picobsd/build/picobsd Wed Mar 5 00:45:28 2014 (r262761) @@ -474,7 +474,7 @@ populate_floppy_fs() { # OK for FLOPPY_TREE in ${PICO_TREE}/floppy.tree ${MY_TREE}/floppy.tree \ ${MY_TREE}/floppy.tree.${SITE} ; do if [ -d ${FLOPPY_TREE} ] ; then - (cd ${FLOPPY_TREE} ; tar -cf - --exclude CVS \ + (cd ${FLOPPY_TREE} ; tar -cf - \ --exclude .svn ${excl} . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) log "Copied from ${FLOPPY_TREE}" @@ -714,7 +714,7 @@ populate_mfs_tree() { for MFS_TREE in ${PICO_TREE}/mfs_tree ${MY_TREE}/mfs_tree ; do if [ -d ${MFS_TREE} ] ; then log "Copy ${MFS_TREE} ..." - (cd ${MFS_TREE} ; tar -cf - --exclude CVS --exclude .svn . ) | \ + (cd ${MFS_TREE} ; tar -cf - --exclude .svn . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) fi done Modified: stable/10/release/release.conf.sample ============================================================================== --- stable/10/release/release.conf.sample Wed Mar 5 00:40:03 2014 (r262760) +++ stable/10/release/release.conf.sample Wed Mar 5 00:45:28 2014 (r262761) @@ -7,7 +7,7 @@ CHROOTDIR="/scratch" ## Set the svn host. -SVNROOT="svn://svn.FreeBSD.org" +SVNROOT="svn://svn.FreeBSD.org/" ## Set the src/, ports/, and doc/ branches or tags. SRCBRANCH="base/head@rHEAD" @@ -17,6 +17,13 @@ PORTBRANCH="ports/head@rHEAD" ## Run svn co --force for src checkout. #SRC_FORCE_CHECKOUT=yes +## Sample configuration for using git instead of svn. +#VCSCMD="/usr/local/bin/git clone --branch master" +#SVNROOT="" +#SRCBRANCH="https://github.com/freebsd/freebsd" +#DOCBRANCH="https://github.com/freebsd/freebsd-doc" +#PORTBRANCH="https://github.com/freebsd/freebsd-ports" + ## Set to override the default target architecture. #TARGET="amd64" #TARGET_ARCH="amd64" Modified: stable/10/release/release.sh ============================================================================== --- stable/10/release/release.sh Wed Mar 5 00:40:03 2014 (r262760) +++ stable/10/release/release.sh Wed Mar 5 00:45:28 2014 (r262761) @@ -1,9 +1,13 @@ #!/bin/sh #- +# Copyright (c) 2013, 2014 The FreeBSD Foundation # Copyright (c) 2013 Glen Barber # Copyright (c) 2011 Nathan Whitehorn # All rights reserved. # +# Portions of this software were developed by Glen Barber +# 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: @@ -38,9 +42,12 @@ export PATH # The directory within which the release will be built. CHROOTDIR="/scratch" +# The default version control system command to obtain the sources. +VCSCMD="svn checkout" + # The default svn checkout server, and svn branches for src/, doc/, # and ports/. -SVNROOT="svn://svn.freebsd.org" +SVNROOT="svn://svn.FreeBSD.org/" SRCBRANCH="base/head@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" @@ -57,11 +64,9 @@ SRC_CONF="/dev/null" # The number of make(1) jobs, defaults to the number of CPUs available for # buildworld, and half of number of CPUs available for buildkernel. -NCPU=$(sysctl -n hw.ncpu) -if [ ${NCPU} -gt 1 ]; then - WORLD_FLAGS="-j${NCPU}" - KERNEL_FLAGS="-j$(expr ${NCPU} / 2)" -fi +WORLD_FLAGS="-j$(sysctl -n hw.ncpu)" +KERNEL_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))" + MAKE_FLAGS="-s" # The name of the kernel to build, defaults to GENERIC. @@ -98,6 +103,11 @@ while getopts c: opt; do done shift $(($OPTIND - 1)) +# Prefix the branches with the SVNROOT for the full checkout URL. +SRCBRANCH="${SVNROOT}${SRCBRANCH}" +DOCBRANCH="${SVNROOT}${DOCBRANCH}" +PORTBRANCH="${SVNROOT}${PORTBRANCH}" + # If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree # is required to build the documentation set. if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then @@ -155,12 +165,12 @@ set -e # Everything must succeed mkdir -p ${CHROOTDIR}/usr -svn co ${FORCE_SRC_KEY} ${SVNROOT}/${SRCBRANCH} ${CHROOTDIR}/usr/src +${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src if [ "x${NODOC}" = "x" ]; then - svn co ${SVNROOT}/${DOCBRANCH} ${CHROOTDIR}/usr/doc + ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi if [ "x${NOPORTS}" = "x" ]; then - svn co ${SVNROOT}/${PORTBRANCH} ${CHROOTDIR}/usr/ports + ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi cd ${CHROOTDIR}/usr/src Modified: stable/10/share/man/man7/release.7 ============================================================================== --- stable/10/share/man/man7/release.7 Wed Mar 5 00:40:03 2014 (r262760) +++ stable/10/share/man/man7/release.7 Wed Mar 5 00:45:28 2014 (r262761) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2013 +.Dd February 25, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -245,6 +245,10 @@ Setting this also sets Set to a non-empty value to include the .Cm dvdrom target. +.It Va VCSCMD +The command run to obtain the source trees. +Defaults to +.Qq Cm svn checkout . .El .Sh MAKEFILE TARGETS The release makefile From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 5 03:16:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 47F1871F; Wed, 5 Mar 2014 03: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 34BDB3BA; Wed, 5 Mar 2014 03: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 s253GO7v065803; Wed, 5 Mar 2014 03:16:24 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s253GNRv065802; Wed, 5 Mar 2014 03:16:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403050316.s253GNRv065802@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 5 Mar 2014 03:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262772 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 03:16:24 -0000 Author: glebius Date: Wed Mar 5 03:16:23 2014 New Revision: 262772 URL: http://svnweb.freebsd.org/changeset/base/262772 Log: Merge r262770 from head: pacify gcc. Modified: stable/10/sys/net/flowtable.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/flowtable.c ============================================================================== --- stable/10/sys/net/flowtable.c Wed Mar 5 02:35:41 2014 (r262771) +++ stable/10/sys/net/flowtable.c Wed Mar 5 03:16:23 2014 (r262772) @@ -772,6 +772,7 @@ flowtable_free_stale(struct flowtable *f tmpsize = ft->ft_size; memcpy(tmpmask, mask, ft->ft_size/8); curbit = 0; + fleprev = NULL; /* pacify gcc */ /* * XXX Note to self, bit_ffs operates at the byte level * and thus adds gratuitous overhead From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 5 04:23:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 72B728A7; Wed, 5 Mar 2014 04:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E279C81; Wed, 5 Mar 2014 04:23: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 s254NNjI093560; Wed, 5 Mar 2014 04:23:23 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s254NJj7093536; Wed, 5 Mar 2014 04:23:19 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403050423.s254NJj7093536@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 5 Mar 2014 04:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262779 - in stable/10/sys/ufs: ffs ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 04:23:23 -0000 Author: pfg Date: Wed Mar 5 04:23:19 2014 New Revision: 262779 URL: http://svnweb.freebsd.org/changeset/base/262779 Log: MFC r262678; ufs: small formatting fixes. Cleanup some extra space. Use of tabs vs. spaces. No functional change. Reviewed by: mckusick Modified: stable/10/sys/ufs/ffs/ffs_alloc.c stable/10/sys/ufs/ffs/ffs_balloc.c stable/10/sys/ufs/ffs/ffs_extern.h stable/10/sys/ufs/ffs/ffs_snapshot.c stable/10/sys/ufs/ffs/ffs_softdep.c stable/10/sys/ufs/ffs/ffs_vfsops.c stable/10/sys/ufs/ffs/ffs_vnops.c stable/10/sys/ufs/ffs/fs.h stable/10/sys/ufs/ffs/softdep.h stable/10/sys/ufs/ufs/dir.h stable/10/sys/ufs/ufs/dirhash.h stable/10/sys/ufs/ufs/extattr.h stable/10/sys/ufs/ufs/gjournal.h stable/10/sys/ufs/ufs/inode.h stable/10/sys/ufs/ufs/quota.h stable/10/sys/ufs/ufs/ufs_extern.h stable/10/sys/ufs/ufs/ufsmount.h Modified: stable/10/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_alloc.c Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ffs/ffs_alloc.c Wed Mar 5 04:23:19 2014 (r262779) @@ -1182,14 +1182,14 @@ ffs_dirpref(pip) for (cg = prefcg; cg < fs->fs_ncg; cg++) if (fs->fs_cs(fs, cg).cs_ndir < maxndir && fs->fs_cs(fs, cg).cs_nifree >= minifree && - fs->fs_cs(fs, cg).cs_nbfree >= minbfree) { + fs->fs_cs(fs, cg).cs_nbfree >= minbfree) { if (fs->fs_contigdirs[cg] < maxcontigdirs) return ((ino_t)(fs->fs_ipg * cg)); } for (cg = 0; cg < prefcg; cg++) if (fs->fs_cs(fs, cg).cs_ndir < maxndir && fs->fs_cs(fs, cg).cs_nifree >= minifree && - fs->fs_cs(fs, cg).cs_nbfree >= minbfree) { + fs->fs_cs(fs, cg).cs_nbfree >= minbfree) { if (fs->fs_contigdirs[cg] < maxcontigdirs) return ((ino_t)(fs->fs_ipg * cg)); } Modified: stable/10/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_balloc.c Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ffs/ffs_balloc.c Wed Mar 5 04:23:19 2014 (r262779) @@ -248,7 +248,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t UFS_LOCK(ump); pref = ffs_blkpref_ufs1(ip, lbn, -indirs[0].in_off - 1, (ufs1_daddr_t *)0); - if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, + if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags, cred, &newb)) != 0) { curthread_pflags_restore(saved_inbdflush); return (error); @@ -809,7 +809,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t UFS_LOCK(ump); pref = ffs_blkpref_ufs2(ip, lbn, -indirs[0].in_off - 1, (ufs2_daddr_t *)0); - if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, + if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags, cred, &newb)) != 0) { curthread_pflags_restore(saved_inbdflush); return (error); Modified: stable/10/sys/ufs/ffs/ffs_extern.h ============================================================================== --- stable/10/sys/ufs/ffs/ffs_extern.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ffs/ffs_extern.h Wed Mar 5 04:23:19 2014 (r262779) @@ -165,10 +165,10 @@ void softdep_freework(struct workhead *) /* * Things to request flushing in softdep_request_cleanup() */ -#define FLUSH_INODES 1 -#define FLUSH_INODES_WAIT 2 -#define FLUSH_BLOCKS 3 -#define FLUSH_BLOCKS_WAIT 4 +#define FLUSH_INODES 1 +#define FLUSH_INODES_WAIT 2 +#define FLUSH_BLOCKS 3 +#define FLUSH_BLOCKS_WAIT 4 /* * Flag to ffs_syncvnode() to request flushing of data only, * but skip the ffs_update() on the inode itself. Used to avoid Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_snapshot.c Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ffs/ffs_snapshot.c Wed Mar 5 04:23:19 2014 (r262779) @@ -2642,7 +2642,7 @@ ffs_snapdata_acquire(struct vnode *devvp struct snapdata *sn; /* - * Allocate a free snapdata. This is done before acquiring the + * Allocate a free snapdata. This is done before acquiring the * devvp lock to avoid allocation while the devvp interlock is * held. */ Modified: stable/10/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_softdep.c Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ffs/ffs_softdep.c Wed Mar 5 04:23:19 2014 (r262779) @@ -119,7 +119,7 @@ softdep_mount(devvp, mp, fs, cred) return (0); } -void +void softdep_initialize() { @@ -174,7 +174,7 @@ softdep_setup_blkmapdep(bp, mp, newblkno panic("softdep_setup_blkmapdep called"); } -void +void softdep_setup_allocdirect(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp) struct inode *ip; ufs_lbn_t lbn; @@ -188,7 +188,7 @@ softdep_setup_allocdirect(ip, lbn, newbl panic("softdep_setup_allocdirect called"); } -void +void softdep_setup_allocext(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp) struct inode *ip; ufs_lbn_t lbn; @@ -267,7 +267,7 @@ softdep_freefile(pvp, ino, mode) panic("softdep_freefile called"); } -int +int softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp, isnewblk) struct buf *bp; struct inode *dp; @@ -280,7 +280,7 @@ softdep_setup_directory_add(bp, dp, diro panic("softdep_setup_directory_add called"); } -void +void softdep_change_directoryentry_offset(bp, dp, base, oldloc, newloc, entrysize) struct buf *bp; struct inode *dp; @@ -293,7 +293,7 @@ softdep_change_directoryentry_offset(bp, panic("softdep_change_directoryentry_offset called"); } -void +void softdep_setup_remove(bp, dp, ip, isrmdir) struct buf *bp; struct inode *dp; @@ -304,7 +304,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir panic("softdep_setup_remove called"); } -void +void softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir) struct buf *bp; struct inode *dp; @@ -463,7 +463,7 @@ softdep_load_inodeblock(ip) panic("softdep_load_inodeblock called"); } -void +void softdep_update_inodeblock(ip, bp, waitfor) struct inode *ip; struct buf *bp; @@ -753,7 +753,7 @@ static int sync_cgs(struct mount *, int) static int handle_written_filepage(struct pagedep *, struct buf *); static int handle_written_sbdep(struct sbdep *, struct buf *); static void initiate_write_sbdep(struct sbdep *); -static void diradd_inode_written(struct diradd *, struct inodedep *); +static void diradd_inode_written(struct diradd *, struct inodedep *); static int handle_written_indirdep(struct indirdep *, struct buf *, struct buf**); static int handle_written_inodeblock(struct inodedep *, struct buf *); @@ -3246,7 +3246,7 @@ softdep_process_journal(mp, needwk, flag cnt++; /* * Verify some free journal space. softdep_prealloc() should - * guarantee that we don't run out so this is indicative of + * guarantee that we don't run out so this is indicative of * a problem with the flow control. Try to recover * gracefully in any event. */ @@ -10488,7 +10488,7 @@ softdep_setup_inofree(mp, bp, ino, wkhd) * We can free immediately even if the jaddref * isn't attached in a background write as now * the bitmaps are reconciled. - */ + */ wk->wk_state |= COMPLETE | ATTACHED; free_jaddref(WK_JADDREF(wk)); } @@ -10662,7 +10662,7 @@ jnewblk_rollback(jnewblk, fs, cgp, blksf /* Add back in counts associated with the new frags */ blk = blkmap(fs, blksfree, bbase); ffs_fragacct(fs, blk, cgp->cg_frsum, 1); - /* If a complete block has been reassembled, account for it. */ + /* If a complete block has been reassembled, account for it. */ fragno = fragstoblks(fs, bbase); if (ffs_isblock(fs, blksfree, fragno)) { cgp->cg_cs.cs_nffree -= fs->fs_frag; @@ -10677,7 +10677,7 @@ jnewblk_rollback(jnewblk, fs, cgp, blksf return (frags); } -static void +static void initiate_write_bmsafemap(bmsafemap, bp) struct bmsafemap *bmsafemap; struct buf *bp; /* The cg block. */ Modified: stable/10/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_vfsops.c Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ffs/ffs_vfsops.c Wed Mar 5 04:23:19 2014 (r262779) @@ -1677,7 +1677,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags /* * We must promote to an exclusive lock for vnode creation. This * can happen if lookup is passed LOCKSHARED. - */ + */ if ((flags & LK_TYPE_MASK) == LK_SHARED) { flags &= ~LK_TYPE_MASK; flags |= LK_EXCLUSIVE; Modified: stable/10/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_vnops.c Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ffs/ffs_vnops.c Wed Mar 5 04:23:19 2014 (r262779) @@ -720,10 +720,10 @@ ffs_write(ap) if (uio->uio_offset + xfersize > ip->i_size) vnode_pager_setsize(vp, uio->uio_offset + xfersize); - /* + /* * We must perform a read-before-write if the transfer size * does not cover the entire buffer. - */ + */ if (fs->fs_bsize > xfersize) flags |= BA_CLRBUF; else @@ -1082,7 +1082,7 @@ ffs_extwrite(struct vnode *vp, struct ui /* * We must perform a read-before-write if the transfer size * does not cover the entire buffer. - */ + */ if (fs->fs_bsize > xfersize) flags |= BA_CLRBUF; else Modified: stable/10/sys/ufs/ffs/fs.h ============================================================================== --- stable/10/sys/ufs/ffs/fs.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ffs/fs.h Wed Mar 5 04:23:19 2014 (r262779) @@ -31,7 +31,7 @@ */ #ifndef _UFS_FFS_FS_H_ -#define _UFS_FFS_FS_H_ +#define _UFS_FFS_FS_H_ #include #include @@ -68,18 +68,18 @@ * given in byte-offset form, so they do not imply a sector size. The * SBLOCKSEARCH specifies the order in which the locations should be searched. */ -#define SBLOCK_FLOPPY 0 -#define SBLOCK_UFS1 8192 -#define SBLOCK_UFS2 65536 -#define SBLOCK_PIGGY 262144 -#define SBLOCKSIZE 8192 -#define SBLOCKSEARCH \ +#define SBLOCK_FLOPPY 0 +#define SBLOCK_UFS1 8192 +#define SBLOCK_UFS2 65536 +#define SBLOCK_PIGGY 262144 +#define SBLOCKSIZE 8192 +#define SBLOCKSEARCH \ { SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 } /* * Max number of fragments per block. This value is NOT tweakable. */ -#define MAXFRAG 8 +#define MAXFRAG 8 /* * Addresses stored in inodes are capable of addressing fragments @@ -109,20 +109,20 @@ * Note that super blocks are always of size SBLOCKSIZE, * and that both SBLOCKSIZE and MAXBSIZE must be >= MINBSIZE. */ -#define MINBSIZE 4096 +#define MINBSIZE 4096 /* * The path name on which the filesystem is mounted is maintained * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in * the super block for this name. */ -#define MAXMNTLEN 468 +#define MAXMNTLEN 468 /* * The volume name for this filesystem is maintained in fs_volname. * MAXVOLLEN defines the length of the buffer allocated. */ -#define MAXVOLLEN 32 +#define MAXVOLLEN 32 /* * There is a 128-byte region in the superblock reserved for in-core @@ -147,7 +147,7 @@ * value of fs_maxcontig. To conserve space, a maximum summary size * is set by FS_MAXCONTIG. */ -#define FS_MAXCONTIG 16 +#define FS_MAXCONTIG 16 /* * MINFREE gives the minimum acceptable percentage of filesystem @@ -161,8 +161,8 @@ * default value. With 10% free space, fragmentation is not a * problem, so we choose to optimize for time. */ -#define MINFREE 8 -#define DEFAULTOPT FS_OPTTIME +#define MINFREE 8 +#define DEFAULTOPT FS_OPTTIME /* * Grigoriy Orlov has done some extensive work to fine @@ -173,8 +173,8 @@ * filesystems, but may need to be tuned for odd cases like filesystems * being used for squid caches or news spools. */ -#define AVFILESIZ 16384 /* expected average file size */ -#define AFPDIR 64 /* expected number of files per directory */ +#define AVFILESIZ 16384 /* expected average file size */ +#define AFPDIR 64 /* expected number of files per directory */ /* * The maximum number of snapshot nodes that can be associated @@ -184,7 +184,7 @@ * maintaining too many will slow the filesystem performance, so * having this limit is a good idea. */ -#define FSMAXSNAP 20 +#define FSMAXSNAP 20 /* * Used to identify special blocks in snapshots: @@ -197,8 +197,8 @@ * identify blocks that are in use by other snapshots (which are * expunged from this snapshot). */ -#define BLK_NOCOPY ((ufs2_daddr_t)(1)) -#define BLK_SNAP ((ufs2_daddr_t)(2)) +#define BLK_NOCOPY ((ufs2_daddr_t)(1)) +#define BLK_SNAP ((ufs2_daddr_t)(2)) /* * Sysctl values for the fast filesystem. @@ -214,7 +214,7 @@ #define FFS_ADJ_NIFREE 9 /* adjust number of free inodes */ #define FFS_ADJ_NFFREE 10 /* adjust number of free frags */ #define FFS_ADJ_NUMCLUSTERS 11 /* adjust number of free clusters */ -#define FFS_SET_CWD 12 /* set current directory */ +#define FFS_SET_CWD 12 /* set current directory */ #define FFS_SET_DOTDOT 13 /* set inode number for ".." */ #define FFS_UNLINK 14 /* remove a name in the filesystem */ #define FFS_SET_INODE 15 /* update an on-disk inode */ @@ -377,14 +377,14 @@ CTASSERT(sizeof(struct fs) == 1376); #define FS_UFS2_MAGIC 0x19540119 /* UFS2 fast filesystem magic number */ #define FS_BAD_MAGIC 0x19960408 /* UFS incomplete newfs magic number */ #define FS_OKAY 0x7c269d38 /* superblock checksum */ -#define FS_42INODEFMT -1 /* 4.2BSD inode format */ -#define FS_44INODEFMT 2 /* 4.4BSD inode format */ +#define FS_42INODEFMT -1 /* 4.2BSD inode format */ +#define FS_44INODEFMT 2 /* 4.4BSD inode format */ /* * Preference for optimization. */ -#define FS_OPTTIME 0 /* minimize allocation time */ -#define FS_OPTSPACE 1 /* minimize disk fragmentation */ +#define FS_OPTTIME 0 /* minimize allocation time */ +#define FS_OPTSPACE 1 /* minimize disk fragmentation */ /* * Filesystem flags. @@ -414,16 +414,16 @@ CTASSERT(sizeof(struct fs) == 1376); * labels into extended attributes on the file system rather than maintain * a single mount label for all objects. */ -#define FS_UNCLEAN 0x0001 /* filesystem not clean at mount */ -#define FS_DOSOFTDEP 0x0002 /* filesystem using soft dependencies */ -#define FS_NEEDSFSCK 0x0004 /* filesystem needs sync fsck before mount */ +#define FS_UNCLEAN 0x0001 /* filesystem not clean at mount */ +#define FS_DOSOFTDEP 0x0002 /* filesystem using soft dependencies */ +#define FS_NEEDSFSCK 0x0004 /* filesystem needs sync fsck before mount */ #define FS_SUJ 0x0008 /* Filesystem using softupdate journal */ -#define FS_ACLS 0x0010 /* file system has POSIX.1e ACLs enabled */ -#define FS_MULTILABEL 0x0020 /* file system is MAC multi-label */ -#define FS_GJOURNAL 0x0040 /* gjournaled file system */ -#define FS_FLAGS_UPDATED 0x0080 /* flags have been moved to new location */ -#define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ -#define FS_INDEXDIRS 0x0200 /* kernel supports indexed directories */ +#define FS_ACLS 0x0010 /* file system has POSIX.1e ACLs enabled */ +#define FS_MULTILABEL 0x0020 /* file system is MAC multi-label */ +#define FS_GJOURNAL 0x0040 /* gjournaled file system */ +#define FS_FLAGS_UPDATED 0x0080 /* flags have been moved to new location */ +#define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ +#define FS_INDEXDIRS 0x0200 /* kernel supports indexed directories */ #define FS_TRIM 0x0400 /* issue BIO_DELETE for deleted blocks */ /* @@ -446,7 +446,7 @@ CTASSERT(sizeof(struct fs) == 1376); * Its size is derived from the size of the maps maintained in the * cylinder group and the (struct cg) size. */ -#define CGSIZE(fs) \ +#define CGSIZE(fs) \ /* base cg */ (sizeof(struct cg) + sizeof(int32_t) + \ /* old btotoff */ (fs)->fs_old_cpg * sizeof(int32_t) + \ /* old boff */ (fs)->fs_old_cpg * sizeof(u_int16_t) + \ @@ -459,12 +459,12 @@ CTASSERT(sizeof(struct fs) == 1376); /* * The minimal number of cylinder groups that should be created. */ -#define MINCYLGRPS 4 +#define MINCYLGRPS 4 /* * Convert cylinder group to base address of its global summary info. */ -#define fs_cs(fs, indx) fs_csp[indx] +#define fs_cs(fs, indx) fs_csp[indx] /* * Cylinder group block for a filesystem. @@ -504,14 +504,14 @@ struct cg { /* * Macros for access to cylinder group array structures */ -#define cg_chkmagic(cgp) ((cgp)->cg_magic == CG_MAGIC) -#define cg_inosused(cgp) \ +#define cg_chkmagic(cgp) ((cgp)->cg_magic == CG_MAGIC) +#define cg_inosused(cgp) \ ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_iusedoff)) -#define cg_blksfree(cgp) \ +#define cg_blksfree(cgp) \ ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_freeoff)) -#define cg_clustersfree(cgp) \ +#define cg_clustersfree(cgp) \ ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_clusteroff)) -#define cg_clustersum(cgp) \ +#define cg_clustersum(cgp) \ ((int32_t *)((uintptr_t)(cgp) + (cgp)->cg_clustersumoff)) /* @@ -532,7 +532,7 @@ struct cg { #define cgimin(fs, c) (cgstart(fs, c) + (fs)->fs_iblkno) /* inode blk */ #define cgsblock(fs, c) (cgstart(fs, c) + (fs)->fs_sblkno) /* super blk */ #define cgtod(fs, c) (cgstart(fs, c) + (fs)->fs_cblkno) /* cg block */ -#define cgstart(fs, c) \ +#define cgstart(fs, c) \ ((fs)->fs_magic == FS_UFS2_MAGIC ? cgbase(fs, c) : \ (cgbase(fs, c) + (fs)->fs_old_cgoffset * ((c) & ~((fs)->fs_old_cgmask)))) @@ -559,7 +559,7 @@ struct cg { * Extract the bits for a block from a map. * Compute the cylinder and rotational position of a cyl block addr. */ -#define blkmap(fs, map, loc) \ +#define blkmap(fs, map, loc) \ (((map)[(loc) / NBBY] >> ((loc) % NBBY)) & (0xff >> (NBBY - (fs)->fs_frag))) /* @@ -567,39 +567,39 @@ struct cg { * quantities by using shifts and masks in place of divisions * modulos and multiplications. */ -#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ +#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ ((loc) & (fs)->fs_qbmask) -#define fragoff(fs, loc) /* calculates (loc % fs->fs_fsize) */ \ +#define fragoff(fs, loc) /* calculates (loc % fs->fs_fsize) */ \ ((loc) & (fs)->fs_qfmask) -#define lfragtosize(fs, frag) /* calculates ((off_t)frag * fs->fs_fsize) */ \ +#define lfragtosize(fs, frag) /* calculates ((off_t)frag * fs->fs_fsize) */ \ (((off_t)(frag)) << (fs)->fs_fshift) -#define lblktosize(fs, blk) /* calculates ((off_t)blk * fs->fs_bsize) */ \ +#define lblktosize(fs, blk) /* calculates ((off_t)blk * fs->fs_bsize) */ \ (((off_t)(blk)) << (fs)->fs_bshift) /* Use this only when `blk' is known to be small, e.g., < NDADDR. */ -#define smalllblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ +#define smalllblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ ((blk) << (fs)->fs_bshift) -#define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ +#define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ ((loc) >> (fs)->fs_bshift) -#define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ +#define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ ((loc) >> (fs)->fs_fshift) -#define blkroundup(fs, size) /* calculates roundup(size, fs->fs_bsize) */ \ +#define blkroundup(fs, size) /* calculates roundup(size, fs->fs_bsize) */ \ (((size) + (fs)->fs_qbmask) & (fs)->fs_bmask) -#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ +#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ (((size) + (fs)->fs_qfmask) & (fs)->fs_fmask) -#define fragstoblks(fs, frags) /* calculates (frags / fs->fs_frag) */ \ +#define fragstoblks(fs, frags) /* calculates (frags / fs->fs_frag) */ \ ((frags) >> (fs)->fs_fragshift) -#define blkstofrags(fs, blks) /* calculates (blks * fs->fs_frag) */ \ +#define blkstofrags(fs, blks) /* calculates (blks * fs->fs_frag) */ \ ((blks) << (fs)->fs_fragshift) -#define fragnum(fs, fsb) /* calculates (fsb % fs->fs_frag) */ \ +#define fragnum(fs, fsb) /* calculates (fsb % fs->fs_frag) */ \ ((fsb) & ((fs)->fs_frag - 1)) -#define blknum(fs, fsb) /* calculates rounddown(fsb, fs->fs_frag) */ \ +#define blknum(fs, fsb) /* calculates rounddown(fsb, fs->fs_frag) */ \ ((fsb) &~ ((fs)->fs_frag - 1)) /* * Determine the number of available frags given a * percentage to hold in reserve. */ -#define freespace(fs, percentreserved) \ +#define freespace(fs, percentreserved) \ (blkstofrags((fs), (fs)->fs_cstotal.cs_nbfree) + \ (fs)->fs_cstotal.cs_nffree - \ (((off_t)((fs)->fs_dsize)) * (percentreserved) / 100)) @@ -607,11 +607,11 @@ struct cg { /* * Determining the size of a file block in the filesystem. */ -#define blksize(fs, ip, lbn) \ +#define blksize(fs, ip, lbn) \ (((lbn) >= NDADDR || (ip)->i_size >= smalllblktosize(fs, (lbn) + 1)) \ ? (fs)->fs_bsize \ : (fragroundup(fs, blkoff(fs, (ip)->i_size)))) -#define sblksize(fs, size, lbn) \ +#define sblksize(fs, size, lbn) \ (((lbn) >= NDADDR || (size) >= ((lbn) + 1) << (fs)->fs_bshift) \ ? (fs)->fs_bsize \ : (fragroundup(fs, blkoff(fs, (size))))) Modified: stable/10/sys/ufs/ffs/softdep.h ============================================================================== --- stable/10/sys/ufs/ffs/softdep.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ffs/softdep.h Wed Mar 5 04:23:19 2014 (r262779) @@ -203,22 +203,22 @@ struct worklist { unsigned int wk_type:8, /* type of request */ wk_state:24; /* state flags */ }; -#define WK_DATA(wk) ((void *)(wk)) -#define WK_PAGEDEP(wk) ((struct pagedep *)(wk)) -#define WK_INODEDEP(wk) ((struct inodedep *)(wk)) -#define WK_BMSAFEMAP(wk) ((struct bmsafemap *)(wk)) +#define WK_DATA(wk) ((void *)(wk)) +#define WK_PAGEDEP(wk) ((struct pagedep *)(wk)) +#define WK_INODEDEP(wk) ((struct inodedep *)(wk)) +#define WK_BMSAFEMAP(wk) ((struct bmsafemap *)(wk)) #define WK_NEWBLK(wk) ((struct newblk *)(wk)) -#define WK_ALLOCDIRECT(wk) ((struct allocdirect *)(wk)) -#define WK_INDIRDEP(wk) ((struct indirdep *)(wk)) -#define WK_ALLOCINDIR(wk) ((struct allocindir *)(wk)) -#define WK_FREEFRAG(wk) ((struct freefrag *)(wk)) -#define WK_FREEBLKS(wk) ((struct freeblks *)(wk)) -#define WK_FREEWORK(wk) ((struct freework *)(wk)) -#define WK_FREEFILE(wk) ((struct freefile *)(wk)) -#define WK_DIRADD(wk) ((struct diradd *)(wk)) -#define WK_MKDIR(wk) ((struct mkdir *)(wk)) -#define WK_DIRREM(wk) ((struct dirrem *)(wk)) -#define WK_NEWDIRBLK(wk) ((struct newdirblk *)(wk)) +#define WK_ALLOCDIRECT(wk) ((struct allocdirect *)(wk)) +#define WK_INDIRDEP(wk) ((struct indirdep *)(wk)) +#define WK_ALLOCINDIR(wk) ((struct allocindir *)(wk)) +#define WK_FREEFRAG(wk) ((struct freefrag *)(wk)) +#define WK_FREEBLKS(wk) ((struct freeblks *)(wk)) +#define WK_FREEWORK(wk) ((struct freework *)(wk)) +#define WK_FREEFILE(wk) ((struct freefile *)(wk)) +#define WK_DIRADD(wk) ((struct diradd *)(wk)) +#define WK_MKDIR(wk) ((struct mkdir *)(wk)) +#define WK_DIRREM(wk) ((struct dirrem *)(wk)) +#define WK_NEWDIRBLK(wk) ((struct newdirblk *)(wk)) #define WK_JADDREF(wk) ((struct jaddref *)(wk)) #define WK_JREMREF(wk) ((struct jremref *)(wk)) #define WK_JMVREF(wk) ((struct jmvref *)(wk)) @@ -272,8 +272,8 @@ TAILQ_HEAD(freeblklst, freeblks); * list, any removed operations are done, and the dependency structure * is freed. */ -#define DAHASHSZ 5 -#define DIRADDHASH(offset) (((offset) >> 2) % DAHASHSZ) +#define DAHASHSZ 5 +#define DIRADDHASH(offset) (((offset) >> 2) % DAHASHSZ) struct pagedep { struct worklist pd_list; /* page buffer */ # define pd_state pd_list.wk_state /* check for multiple I/O starts */ @@ -363,8 +363,8 @@ struct inodedep { struct ufs2_dinode *idu_savedino2; /* saved ufs2_dinode contents */ } id_un; }; -#define id_savedino1 id_un.idu_savedino1 -#define id_savedino2 id_un.idu_savedino2 +#define id_savedino1 id_un.idu_savedino1 +#define id_savedino2 id_un.idu_savedino2 /* * A "bmsafemap" structure maintains a list of dependency structures @@ -678,8 +678,8 @@ struct diradd { } da_un; struct workhead da_jwork; /* Journal work awaiting completion. */ }; -#define da_previous da_un.dau_previous -#define da_pagedep da_un.dau_pagedep +#define da_previous da_un.dau_previous +#define da_pagedep da_un.dau_pagedep /* * Two "mkdir" structures are needed to track the additional dependencies @@ -735,8 +735,8 @@ struct dirrem { } dm_un; struct workhead dm_jwork; /* Journal work awaiting completion. */ }; -#define dm_pagedep dm_un.dmu_pagedep -#define dm_dirinum dm_un.dmu_dirinum +#define dm_pagedep dm_un.dmu_pagedep +#define dm_dirinum dm_un.dmu_dirinum /* * A "newdirblk" structure tracks the progress of a newly allocated @@ -1057,30 +1057,30 @@ struct mount_softdeps { /* * Keep the old names from when these were in the ufsmount structure. */ -#define softdep_workitem_pending um_softdep->sd_workitem_pending -#define softdep_worklist_tail um_softdep->sd_worklist_tail -#define softdep_journal_pending um_softdep->sd_journal_pending -#define softdep_journal_tail um_softdep->sd_journal_tail -#define softdep_jblocks um_softdep->sd_jblocks -#define softdep_unlinked um_softdep->sd_unlinked -#define softdep_dirtycg um_softdep->sd_dirtycg -#define softdep_mkdirlisthd um_softdep->sd_mkdirlisthd -#define pagedep_hashtbl um_softdep->sd_pdhash -#define pagedep_hash_size um_softdep->sd_pdhashsize -#define pagedep_nextclean um_softdep->sd_pdnextclean -#define inodedep_hashtbl um_softdep->sd_idhash -#define inodedep_hash_size um_softdep->sd_idhashsize -#define inodedep_nextclean um_softdep->sd_idnextclean -#define newblk_hashtbl um_softdep->sd_newblkhash -#define newblk_hash_size um_softdep->sd_newblkhashsize -#define bmsafemap_hashtbl um_softdep->sd_bmhash -#define bmsafemap_hash_size um_softdep->sd_bmhashsize -#define indir_hashtbl um_softdep->sd_indirhash -#define indir_hash_size um_softdep->sd_indirhashsize -#define softdep_numindirdeps um_softdep->sd_numindirdeps -#define softdep_on_journal um_softdep->sd_on_journal -#define softdep_on_worklist um_softdep->sd_on_worklist -#define softdep_deps um_softdep->sd_deps -#define softdep_accdeps um_softdep->sd_accdeps -#define softdep_req um_softdep->sd_req -#define softdep_curdeps um_softdep->sd_curdeps +#define softdep_workitem_pending um_softdep->sd_workitem_pending +#define softdep_worklist_tail um_softdep->sd_worklist_tail +#define softdep_journal_pending um_softdep->sd_journal_pending +#define softdep_journal_tail um_softdep->sd_journal_tail +#define softdep_jblocks um_softdep->sd_jblocks +#define softdep_unlinked um_softdep->sd_unlinked +#define softdep_dirtycg um_softdep->sd_dirtycg +#define softdep_mkdirlisthd um_softdep->sd_mkdirlisthd +#define pagedep_hashtbl um_softdep->sd_pdhash +#define pagedep_hash_size um_softdep->sd_pdhashsize +#define pagedep_nextclean um_softdep->sd_pdnextclean +#define inodedep_hashtbl um_softdep->sd_idhash +#define inodedep_hash_size um_softdep->sd_idhashsize +#define inodedep_nextclean um_softdep->sd_idnextclean +#define newblk_hashtbl um_softdep->sd_newblkhash +#define newblk_hash_size um_softdep->sd_newblkhashsize +#define bmsafemap_hashtbl um_softdep->sd_bmhash +#define bmsafemap_hash_size um_softdep->sd_bmhashsize +#define indir_hashtbl um_softdep->sd_indirhash +#define indir_hash_size um_softdep->sd_indirhashsize +#define softdep_numindirdeps um_softdep->sd_numindirdeps +#define softdep_on_journal um_softdep->sd_on_journal +#define softdep_on_worklist um_softdep->sd_on_worklist +#define softdep_deps um_softdep->sd_deps +#define softdep_accdeps um_softdep->sd_accdeps +#define softdep_req um_softdep->sd_req +#define softdep_curdeps um_softdep->sd_curdeps Modified: stable/10/sys/ufs/ufs/dir.h ============================================================================== --- stable/10/sys/ufs/ufs/dir.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ufs/dir.h Wed Mar 5 04:23:19 2014 (r262779) @@ -44,7 +44,7 @@ * quantity to keep down the cost of doing lookup on a 32-bit machine. */ #define doff_t int32_t -#define MAXDIRSIZE (0x7fffffff) +#define MAXDIRSIZE (0x7fffffff) /* * A directory consists of some number of blocks of DIRBLKSIZ @@ -71,7 +71,7 @@ * Entries other than the first in a directory do not normally have * dp->d_ino set to 0. */ -#define DIRBLKSIZ DEV_BSIZE +#define DIRBLKSIZ DEV_BSIZE #define MAXNAMLEN 255 struct direct { @@ -113,14 +113,14 @@ struct direct { (((uintptr_t)&((struct direct *)0)->d_name + \ ((namlen)+1)*sizeof(((struct direct *)0)->d_name[0]) + 3) & ~3) #if (BYTE_ORDER == LITTLE_ENDIAN) -#define DIRSIZ(oldfmt, dp) \ +#define DIRSIZ(oldfmt, dp) \ ((oldfmt) ? DIRECTSIZ((dp)->d_type) : DIRECTSIZ((dp)->d_namlen)) #else -#define DIRSIZ(oldfmt, dp) \ +#define DIRSIZ(oldfmt, dp) \ DIRECTSIZ((dp)->d_namlen) #endif -#define OLDDIRFMT 1 -#define NEWDIRFMT 0 +#define OLDDIRFMT 1 +#define NEWDIRFMT 0 /* * Template for manipulating directories. Should use struct direct's, Modified: stable/10/sys/ufs/ufs/dirhash.h ============================================================================== --- stable/10/sys/ufs/ufs/dirhash.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ufs/dirhash.h Wed Mar 5 04:23:19 2014 (r262779) @@ -26,7 +26,7 @@ */ #ifndef _UFS_UFS_DIRHASH_H_ -#define _UFS_UFS_DIRHASH_H_ +#define _UFS_UFS_DIRHASH_H_ #include #include @@ -44,11 +44,11 @@ * We also maintain information about free space in each block * to speed up creations. */ -#define DIRHASH_EMPTY (-1) /* entry unused */ -#define DIRHASH_DEL (-2) /* deleted entry; may be part of chain */ +#define DIRHASH_EMPTY (-1) /* entry unused */ +#define DIRHASH_DEL (-2) /* deleted entry; may be part of chain */ -#define DIRALIGN 4 -#define DH_NFSTATS (DIRECTSIZ(MAXNAMLEN + 1) / DIRALIGN) +#define DIRALIGN 4 +#define DH_NFSTATS (DIRECTSIZ(MAXNAMLEN + 1) / DIRALIGN) /* max DIRALIGN words in a directory entry */ /* @@ -68,18 +68,18 @@ * case it limits the number of hash builds to 1/DH_SCOREINIT of the * number of accesses. */ -#define DH_SCOREINIT 8 /* initial dh_score when dirhash built */ -#define DH_SCOREMAX 64 /* max dh_score value */ +#define DH_SCOREINIT 8 /* initial dh_score when dirhash built */ +#define DH_SCOREMAX 64 /* max dh_score value */ /* * The main hash table has 2 levels. It is an array of pointers to * blocks of DH_NBLKOFF offsets. */ -#define DH_BLKOFFSHIFT 8 -#define DH_NBLKOFF (1 << DH_BLKOFFSHIFT) -#define DH_BLKOFFMASK (DH_NBLKOFF - 1) +#define DH_BLKOFFSHIFT 8 +#define DH_NBLKOFF (1 << DH_BLKOFFSHIFT) +#define DH_BLKOFFMASK (DH_NBLKOFF - 1) -#define DH_ENTRY(dh, slot) \ +#define DH_ENTRY(dh, slot) \ ((dh)->dh_hash[(slot) >> DH_BLKOFFSHIFT][(slot) & DH_BLKOFFMASK]) struct dirhash { Modified: stable/10/sys/ufs/ufs/extattr.h ============================================================================== --- stable/10/sys/ufs/ufs/extattr.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ufs/extattr.h Wed Mar 5 04:23:19 2014 (r262779) @@ -94,14 +94,14 @@ struct extattr { * attribute name to calculate and set the ea_length, ea_namelength, * and ea_contentpadlen fields of the extended attribute structure. */ -#define EXTATTR_NEXT(eap) \ +#define EXTATTR_NEXT(eap) \ ((struct extattr *)(((void *)(eap)) + (eap)->ea_length)) -#define EXTATTR_CONTENT(eap) (((void *)(eap)) + EXTATTR_BASE_LENGTH(eap)) -#define EXTATTR_CONTENT_SIZE(eap) \ +#define EXTATTR_CONTENT(eap) (((void *)(eap)) + EXTATTR_BASE_LENGTH(eap)) +#define EXTATTR_CONTENT_SIZE(eap) \ ((eap)->ea_length - EXTATTR_BASE_LENGTH(eap) - (eap)->ea_contentpadlen) -#define EXTATTR_BASE_LENGTH(eap) \ +#define EXTATTR_BASE_LENGTH(eap) \ ((sizeof(struct extattr) + (eap)->ea_namelength + 7) & ~7) -#define EXTATTR_SET_LENGTHS(eap, contentsize) do { \ +#define EXTATTR_SET_LENGTHS(eap, contentsize) do { \ KASSERT(((eap)->ea_name[0] != 0), \ ("Must initialize name before setting lengths")); \ (eap)->ea_namelength = strlen((eap)->ea_name); \ @@ -148,7 +148,7 @@ void ufs_extattr_vnode_inactive(struct v #else /* User-level definition of KASSERT for macros above */ -#define KASSERT(cond, str) do { \ +#define KASSERT(cond, str) do { \ if (!(cond)) { printf("panic: "); printf(str); printf("\n"); exit(1); }\ } while (0) Modified: stable/10/sys/ufs/ufs/gjournal.h ============================================================================== --- stable/10/sys/ufs/ufs/gjournal.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ufs/gjournal.h Wed Mar 5 04:23:19 2014 (r262779) @@ -27,7 +27,7 @@ */ #ifndef _UFS_UFS_GJOURNAL_H_ -#define _UFS_UFS_GJOURNAL_H_ +#define _UFS_UFS_GJOURNAL_H_ /* * GEOM journal function prototypes. Modified: stable/10/sys/ufs/ufs/inode.h ============================================================================== --- stable/10/sys/ufs/ufs/inode.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ufs/inode.h Wed Mar 5 04:23:19 2014 (r262779) @@ -129,12 +129,12 @@ struct inode { #define IN_TRUNCATED 0x0800 /* Journaled truncation pending. */ -#define i_devvp i_ump->um_devvp -#define i_umbufobj i_ump->um_bo -#define i_dirhash i_un.dirhash -#define i_snapblklist i_un.snapblklist -#define i_din1 dinode_u.din1 -#define i_din2 dinode_u.din2 +#define i_devvp i_ump->um_devvp +#define i_umbufobj i_ump->um_bo +#define i_dirhash i_un.dirhash +#define i_snapblklist i_un.snapblklist +#define i_din1 dinode_u.din1 +#define i_din2 dinode_u.din2 #ifdef _KERNEL /* @@ -154,7 +154,7 @@ struct inode { #define SHORTLINK(ip) \ (((ip)->i_ump->um_fstype == UFS1) ? \ (caddr_t)(ip)->i_din1->di_db : (caddr_t)(ip)->i_din2->di_db) -#define IS_SNAPSHOT(ip) ((ip)->i_flags & SF_SNAPSHOT) +#define IS_SNAPSHOT(ip) ((ip)->i_flags & SF_SNAPSHOT) /* * Structure used to pass around logical block paths generated by @@ -166,14 +166,14 @@ struct indir { }; /* Convert between inode pointers and vnode pointers. */ -#define VTOI(vp) ((struct inode *)(vp)->v_data) -#define ITOV(ip) ((ip)->i_vnode) +#define VTOI(vp) ((struct inode *)(vp)->v_data) +#define ITOV(ip) ((ip)->i_vnode) /* Determine if soft dependencies are being done */ -#define DOINGSOFTDEP(vp) ((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) -#define MOUNTEDSOFTDEP(mp) ((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) -#define DOINGSUJ(vp) ((vp)->v_mount->mnt_flag & MNT_SUJ) -#define MOUNTEDSUJ(mp) ((mp)->mnt_flag & MNT_SUJ) +#define DOINGSOFTDEP(vp) ((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) +#define MOUNTEDSOFTDEP(mp) ((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) +#define DOINGSUJ(vp) ((vp)->v_mount->mnt_flag & MNT_SUJ) +#define MOUNTEDSUJ(mp) ((mp)->mnt_flag & MNT_SUJ) /* This overlays the fid structure (see mount.h). */ struct ufid { Modified: stable/10/sys/ufs/ufs/quota.h ============================================================================== --- stable/10/sys/ufs/ufs/quota.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ufs/quota.h Wed Mar 5 04:23:19 2014 (r262779) @@ -62,7 +62,7 @@ /* * Definitions for the default names of the quotas files. */ -#define INITQFNAMES { \ +#define INITQFNAMES { \ "user", /* USRQUOTA */ \ "group", /* GRPQUOTA */ \ "undefined", \ @@ -75,8 +75,8 @@ * broken into a main command defined below and a subcommand that is used * to convey the type of quota that is being manipulated (see above). */ -#define SUBCMDMASK 0x00ff -#define SUBCMDSHIFT 8 +#define SUBCMDMASK 0x00ff +#define SUBCMDSHIFT 8 #define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK)) #define Q_QUOTAON 0x0100 /* enable quotas */ @@ -119,10 +119,10 @@ struct dqblk64 { int64_t dqb_itime; /* time limit for excessive files */ }; -#define dqblk dqblk64 +#define dqblk dqblk64 -#define Q_DQHDR64_MAGIC "QUOTA64" -#define Q_DQHDR64_VERSION 0x20081104 +#define Q_DQHDR64_MAGIC "QUOTA64" +#define Q_DQHDR64_VERSION 0x20081104 struct dqhdr64 { char dqh_magic[8]; /* Q_DQHDR64_MAGIC */ Modified: stable/10/sys/ufs/ufs/ufs_extern.h ============================================================================== --- stable/10/sys/ufs/ufs/ufs_extern.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ufs/ufs_extern.h Wed Mar 5 04:23:19 2014 (r262779) @@ -117,11 +117,11 @@ void softdep_revert_rmdir(struct inode * * Note: The general vfs code typically limits the sequential heuristic * count to 127. See sequential_heuristic() in kern/vfs_vnops.c */ -#define BA_CLRBUF 0x00010000 /* Clear invalid areas of buffer. */ -#define BA_METAONLY 0x00020000 /* Return indirect block buffer. */ +#define BA_CLRBUF 0x00010000 /* Clear invalid areas of buffer. */ +#define BA_METAONLY 0x00020000 /* Return indirect block buffer. */ #define BA_UNMAPPED 0x00040000 /* Do not mmap resulted buffer. */ -#define BA_SEQMASK 0x7F000000 /* Bits holding seq heuristic. */ -#define BA_SEQSHIFT 24 -#define BA_SEQMAX 0x7F +#define BA_SEQMASK 0x7F000000 /* Bits holding seq heuristic. */ +#define BA_SEQSHIFT 24 +#define BA_SEQMAX 0x7F #endif /* !_UFS_UFS_EXTERN_H_ */ Modified: stable/10/sys/ufs/ufs/ufsmount.h ============================================================================== --- stable/10/sys/ufs/ufs/ufsmount.h Wed Mar 5 04:22:07 2014 (r262778) +++ stable/10/sys/ufs/ufs/ufsmount.h Wed Mar 5 04:23:19 2014 (r262779) @@ -31,7 +31,7 @@ */ #ifndef _UFS_UFS_UFSMOUNT_H_ -#define _UFS_UFS_UFSMOUNT_H_ +#define _UFS_UFS_UFSMOUNT_H_ #include /* XXX For struct workhead. */ @@ -98,13 +98,13 @@ struct ufsmount { void (*um_snapgone)(struct inode *); }; -#define UFS_BALLOC(aa, bb, cc, dd, ee, ff) VFSTOUFS((aa)->v_mount)->um_balloc(aa, bb, cc, dd, ee, ff) -#define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) -#define UFS_TRUNCATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd) -#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) -#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) -#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) -#define UFS_IFREE(aa, bb) ((aa)->um_ifree(aa, bb)) +#define UFS_BALLOC(aa, bb, cc, dd, ee, ff) VFSTOUFS((aa)->v_mount)->um_balloc(aa, bb, cc, dd, ee, ff) +#define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) +#define UFS_TRUNCATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd) +#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) +#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) +#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) +#define UFS_IFREE(aa, bb) ((aa)->um_ifree(aa, bb)) #define UFS_RDONLY(aa) ((aa)->i_ump->um_rdonly(aa)) #define UFS_SNAPGONE(aa) ((aa)->i_ump->um_snapgone(aa)) @@ -115,25 +115,25 @@ struct ufsmount { /* * Filesystem types */ -#define UFS1 1 -#define UFS2 2 +#define UFS1 1 +#define UFS2 2 /* * Flags describing the state of quotas. */ #define QTF_OPENING 0x01 /* Q_QUOTAON in progress */ #define QTF_CLOSING 0x02 /* Q_QUOTAOFF in progress */ -#define QTF_64BIT 0x04 /* 64-bit quota file */ +#define QTF_64BIT 0x04 /* 64-bit quota file */ /* Convert mount ptr to ufsmount ptr. */ -#define VFSTOUFS(mp) ((struct ufsmount *)((mp)->mnt_data)) +#define VFSTOUFS(mp) ((struct ufsmount *)((mp)->mnt_data)) #define UFSTOVFS(ump) (ump)->um_mountp /* * Macros to access filesystem parameters in the ufsmount structure. * Used by ufs_bmap. */ -#define MNINDIR(ump) ((ump)->um_nindir) +#define MNINDIR(ump) ((ump)->um_nindir) #define blkptrtodb(ump, b) ((b) << (ump)->um_bptrtodb) #define is_sequential(ump, a, b) ((b) == (a) + ump->um_seqinc) #endif /* _KERNEL */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 5 13:25:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 544D1821; Wed, 5 Mar 2014 13:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3497F936; Wed, 5 Mar 2014 13:25: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 s25DP2CS013948; Wed, 5 Mar 2014 13:25:02 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25DP2bk013947; Wed, 5 Mar 2014 13:25:02 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403051325.s25DP2bk013947@svn.freebsd.org> From: Christian Brueffer Date: Wed, 5 Mar 2014 13:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262783 - stable/10/usr.sbin/bsnmpd/tools/bsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 13:25:02 -0000 Author: brueffer Date: Wed Mar 5 13:25:01 2014 New Revision: 262783 URL: http://svnweb.freebsd.org/changeset/base/262783 Log: MFC: r262494 Rough cleanup (new sentence -> new line, grammar, spelling, mdoc). This could use more work. PR: 187035 (in part) Submitted by: Bjorn Heidotting Modified: stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Wed Mar 5 12:02:29 2014 (r262782) +++ stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Wed Mar 5 13:25:01 2014 (r262783) @@ -106,18 +106,18 @@ management information to a Simple Netwo .Pp Depending on the options .Nm bsnmpget -constructs either a SMNP GetRequest, GetNextRequest +constructs either a SNMP GetRequest, GetNextRequest or a GetBulkRequest packet, fills in the object identifiers (OIDs) of the objects whose values will be retrieved, waits for a response and prints it if received successfully. .Pp .Nm Bsnmpwalk -queries an agent with ether SMNP GetNextRequest or GetBulkRequest packets, +queries an agent with ether SNMP GetNextRequest or GetBulkRequest packets, asking for values of OID instances that are a part of the object subtree rooted at the provided OIDs. .Pp .Nm Bsnmpset -constructs a SMNP SetRequest packet, fills in the OIDs (object identifiers), +constructs a SNMP SetRequest packet, fills in the OIDs (object identifiers), syntaxes and values of the objects whose values are to be set and waits for a response from server. .Sh OPTIONS @@ -151,7 +151,8 @@ The context to query with SNMPv3 PDUs. The context name. Default is "" (empty). .It Cm context-engine=engine-id The SNMP Engine ID of the context to query with SNMPv3 PDUs, represented as -binary octet string. By default, this is set to the Engine ID of the SNMP agent. +binary octet string. +By default, this is set to the Engine ID of the SNMP agent. .El .It Fl D Perform SNMP USM Engine Discovery, rather than sending a request for the value @@ -177,7 +178,8 @@ Specifies the initial OID that was cut b .Xr gensnmpdef 1 when producing the MIB description file. The default value is .iso(1).org(3).dod(6) which is what should have been -used for all the files installed under /usr/share/snmp/defs. +used for all the files installed under +.Pa /usr/share/snmp/defs . Use this only if you generated your own files, providing a .Fl c option to @@ -198,7 +200,8 @@ If using spaces make sure the entire opt example using quotes. .It Fl i Ar filelist List of MIB description files produced by -.Xr gensnmpdef 1 which +.Xr gensnmpdef 1 +which .Nm bsnmpget , .Nm bsnmpwalk or @@ -207,12 +210,13 @@ will search to translate numerical OIDs Multiple files can be provided either giving this option multiple times or a comma separated list of file names. If a filename begins with a letter the default directory, -/usr/share/snmp/defs, +.Pa /usr/share/snmp/defs , will be searched. .It Fl K Calculate and display the localized authentication and privacy keys -corresponding to a plain text password. The password is obtain via the -environment. Additionally, if one or more OIDs are specified, the calculated +corresponding to a plain text password. +The password is obtained via the environment. +Additionally, if one or more OIDs are specified, the calculated keys are used when processing the SNMPv3 requests. .It Fl l Ar filename The path of the posix local (unix domain) socket if local @@ -242,9 +246,9 @@ In addition to the short output verbose Privacy options to use with SNMPv3 PDUs .Bl -tag -width \& .It Cm proto=[aes|des] -The protocol to use when encypting/decrypting SNMPv3 PDU data. +The protocol to use when encrypting/decrypting SNMPv3 PDU data. .It Cm key=privkey -A binary localized privacy key to use when encypting/decrypting SNMPv3 PDU data. +A binary localized privacy key to use when encrypting/decrypting SNMPv3 PDU data. .El .Pp By default plain text SNMPv3 PDUs are sent. @@ -267,14 +271,14 @@ not respond after the first try. Default is 3. .It Fl s Ar [trans::] Ns Ar [community@] Ns Ar [server] Ns Ar [:port] Each of the server specification components is optional but at least one -has to be provided if +has to be provided if the .Ar s option is used. The server specification is constructed in the following manner: .Bl -tag -width \& .It Cm trans:: Transport type may be one of udp, stream or dgram. -If this option is not provided an udp inet/inet6 socket will be used, which +If this option is not provided an UDP inet/inet6 socket will be used, which is the most common. Stream stands for a posix local stream socket and a posix local datagram socket will be used if dgram is specified. @@ -317,11 +321,13 @@ The value of the snmpEngineTime of the S If any of the above is not specified, SNMP USM Engine Discovery is attempted. This is also the default behavior. .It Cm name=username -The USM user name to include in the SNMPv3 PDUs. By default, the user name is -obtain via the environment +The USM user name to include in the SNMPv3 PDUs. +By default, the user name is +obtained via the environment. .El .It Fl v Ar version -The SNMP protocol version to use when sending requests. SNMP versions 1, 2 and +The SNMP protocol version to use when sending requests. +SNMP versions 1, 2 and 3 are supported. If no version option is provided .Nm bsnmpget , @@ -330,7 +336,7 @@ and .Nm bsnmpset will use version 2. Note that GetBulkRequest-PDUs were introduced in SNMPv2 thus setting the -version to 1 is incompatiable with sending a GetBulk PDU. +version to 1 is incompatible with sending a GetBulk PDU. .It OID The object identifier whose value to retrieve. At least one OID should be provided for @@ -355,7 +361,7 @@ is valid as input OID: .It ifRcvAddressStatus.2.6.255.255.255.255.255.255 .It ifRcvAddressType[2,ff:ff:ff:ff:ff:ff] .It ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff] -(requires +(requires the .Fl o Ar verbose option) .El @@ -373,14 +379,14 @@ to be able to send a request. .It Cm OID OID may be input as a string, a string followed by a random number of integers (suboids) separated by dots, a sequence of integers separated by dots - that is -if +if the .Ar n -options is used - and in such case a syntax is required for every value, +option is used - and in such case a syntax is required for every value, or a string followed by square brackets (used to denote an entry's indexes) and corresponding indexes. -Any of formats used to print a single variable by -.Nm bsnmpset is -valid for inpit OID as well: +Any of the formats used to print a single variable by +.Nm bsnmpset +is valid as input OID as well: .Bl -tag -width \& .It 1.3.6.1.2.1.25.1.1.0=TimeTicks:537615486 .It sysLocation=OctetString:"@ Home" (with Fl o Ar verbose No option) @@ -389,17 +395,17 @@ valid for inpit OID as well: .It ifPhysAddress.1="00:02:b3:1d:1c:a3" .It ifRcvAddressStatus.1.6.255.255.255.255.255.255=1 .It "ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff]=Integer:1" -(with +(with the .Fl o Ar verbose option) .El .It Cm syntax -where syntax string is one of: +where the syntax string is one of: Integer, OctetString, OID, IpAddress, Counter32, Gauge, TimeTicks, Counter64. .It Cm value The value to be set - IP address in form of u.u.u.u - for example 1.3.1.6.1.2.0=IpAddress:192.168.0.1, strings require inverted-commas if they -contain any special characters or spaces, all other numeric types don't. +contain any special characters or spaces, all other numeric types do not. .El .El .Sh ENVIRONMENT @@ -417,8 +423,9 @@ Specifies a default SNMP USM privacy pro Specifies a default SNMP USM user name. .It Ev SNMPPASSWD Specifies the SNMP USM plain text password to use when calculating localized -authentication and privacy keys. If this variable exists in the environment, -SMNPv3 is the default version to use for outgoing requests. +authentication and privacy keys. +If this variable exists in the environment, +SNMPv3 is the default version to use for outgoing requests. .El .Sh SEE ALSO .Xr gensnmpdef 1 From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 5 17:23:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9283BA9D; Wed, 5 Mar 2014 17:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B07938E; Wed, 5 Mar 2014 17:23: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 s25HNUx3010515; Wed, 5 Mar 2014 17:23:30 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25HNUwX010514; Wed, 5 Mar 2014 17:23:30 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403051723.s25HNUwX010514@svn.freebsd.org> From: Glen Barber Date: Wed, 5 Mar 2014 17:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262793 - stable/10/release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 17:23:30 -0000 Author: gjb Date: Wed Mar 5 17:23:29 2014 New Revision: 262793 URL: http://svnweb.freebsd.org/changeset/base/262793 Log: MFC r262513: Update release/release.conf.sample to reflect changes in r262509. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/release.conf.sample Directory Properties: stable/10/ (props changed) Modified: stable/10/release/release.conf.sample ============================================================================== --- stable/10/release/release.conf.sample Wed Mar 5 17:17:18 2014 (r262792) +++ stable/10/release/release.conf.sample Wed Mar 5 17:23:29 2014 (r262793) @@ -40,7 +40,7 @@ PORTBRANCH="ports/head@rHEAD" ## Set to use world- and kernel-specific make(1) flags. #WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -#KERNEL_FLAGS="-j $(expr $(sysctl -n hw.ncpu) / 2)" +#KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" ## Set miscellaneous 'make release' settings. #NODOC= From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 5 19:30:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DC502EE; Wed, 5 Mar 2014 19:30: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C635C25B; Wed, 5 Mar 2014 19:30: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 s25JUeVf062846; Wed, 5 Mar 2014 19:30:40 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25JUdTX062569; Wed, 5 Mar 2014 19:30:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403051930.s25JUdTX062569@svn.freebsd.org> From: Dimitry Andric Date: Wed, 5 Mar 2014 19:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262801 - in stable: 10/contrib/libc++ 10/contrib/libc++/include 10/contrib/libc++/include/experimental 10/contrib/libc++/include/ext 10/contrib/libc++/src 10/etc/mtree 10/lib/libc++ 10... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 19:30:40 -0000 Author: dim Date: Wed Mar 5 19:30:36 2014 New Revision: 262801 URL: http://svnweb.freebsd.org/changeset/base/262801 Log: MFC r261283: Import libc++ 3.4 release. This contains a lot of bugfixes, and some preliminary support for C++1y. MFC r261604: HEAD is not buildable for the past day. Commit a 'quick fix' in order to permit buildworld to complete. Reviewed by: theraven MFC r261608: Apply a cleaner solution for the sign warnings that can occur when compiling libc++'s header with -Wsystem-headers on. This has also been submitted upstream. Reported by: asomers MFC r261801: An ABI incompatibility crept into the libc++ 3.4 import in r261283. It was caused by upstream libc++ commit r194536, which aimed to make the headers more standards-compliant, by making std::pair's copy constructor trivial. Unfortunately, this could cause certain C++ applications using shared libraries built against the previous version of libc++ to crash. Fix the ABI incompatibility by making std::pair's copy constructor non-trivial again. Please note: Any C++ applications or shared libraries built with libc++ between r261283 and this revision should be recompiled. Reported by: stefanf Added: stable/10/contrib/libc++/include/experimental/ - copied from r261283, head/contrib/libc++/include/experimental/ stable/10/contrib/libc++/include/shared_mutex - copied unchanged from r261283, head/contrib/libc++/include/shared_mutex stable/10/contrib/libc++/src/optional.cpp - copied unchanged from r261283, head/contrib/libc++/src/optional.cpp stable/10/contrib/libc++/src/shared_mutex.cpp - copied unchanged from r261283, head/contrib/libc++/src/shared_mutex.cpp Modified: stable/10/contrib/libc++/CREDITS.TXT stable/10/contrib/libc++/include/__bit_reference stable/10/contrib/libc++/include/__config stable/10/contrib/libc++/include/__debug stable/10/contrib/libc++/include/__functional_03 stable/10/contrib/libc++/include/__functional_base stable/10/contrib/libc++/include/__functional_base_03 stable/10/contrib/libc++/include/__hash_table stable/10/contrib/libc++/include/__locale stable/10/contrib/libc++/include/__mutex_base stable/10/contrib/libc++/include/__split_buffer stable/10/contrib/libc++/include/__std_stream stable/10/contrib/libc++/include/__tree stable/10/contrib/libc++/include/__tuple stable/10/contrib/libc++/include/__tuple_03 stable/10/contrib/libc++/include/__undef_min_max stable/10/contrib/libc++/include/algorithm stable/10/contrib/libc++/include/array stable/10/contrib/libc++/include/bitset stable/10/contrib/libc++/include/cctype stable/10/contrib/libc++/include/chrono stable/10/contrib/libc++/include/cmath stable/10/contrib/libc++/include/codecvt stable/10/contrib/libc++/include/complex stable/10/contrib/libc++/include/cstddef stable/10/contrib/libc++/include/cstdio stable/10/contrib/libc++/include/cstdlib stable/10/contrib/libc++/include/cstring stable/10/contrib/libc++/include/cwchar stable/10/contrib/libc++/include/deque stable/10/contrib/libc++/include/exception stable/10/contrib/libc++/include/ext/__hash stable/10/contrib/libc++/include/ext/hash_map stable/10/contrib/libc++/include/ext/hash_set stable/10/contrib/libc++/include/forward_list stable/10/contrib/libc++/include/fstream stable/10/contrib/libc++/include/functional stable/10/contrib/libc++/include/future stable/10/contrib/libc++/include/initializer_list stable/10/contrib/libc++/include/iomanip stable/10/contrib/libc++/include/ios stable/10/contrib/libc++/include/iosfwd stable/10/contrib/libc++/include/istream stable/10/contrib/libc++/include/iterator stable/10/contrib/libc++/include/limits stable/10/contrib/libc++/include/list stable/10/contrib/libc++/include/locale stable/10/contrib/libc++/include/map stable/10/contrib/libc++/include/memory stable/10/contrib/libc++/include/mutex stable/10/contrib/libc++/include/new stable/10/contrib/libc++/include/numeric stable/10/contrib/libc++/include/ostream stable/10/contrib/libc++/include/queue stable/10/contrib/libc++/include/random stable/10/contrib/libc++/include/ratio stable/10/contrib/libc++/include/regex stable/10/contrib/libc++/include/scoped_allocator stable/10/contrib/libc++/include/set stable/10/contrib/libc++/include/sstream stable/10/contrib/libc++/include/stack stable/10/contrib/libc++/include/streambuf stable/10/contrib/libc++/include/string stable/10/contrib/libc++/include/system_error stable/10/contrib/libc++/include/thread stable/10/contrib/libc++/include/tuple stable/10/contrib/libc++/include/type_traits stable/10/contrib/libc++/include/typeindex stable/10/contrib/libc++/include/unordered_map stable/10/contrib/libc++/include/unordered_set stable/10/contrib/libc++/include/utility stable/10/contrib/libc++/include/valarray stable/10/contrib/libc++/include/vector stable/10/contrib/libc++/src/algorithm.cpp stable/10/contrib/libc++/src/debug.cpp stable/10/contrib/libc++/src/exception.cpp stable/10/contrib/libc++/src/future.cpp stable/10/contrib/libc++/src/ios.cpp stable/10/contrib/libc++/src/iostream.cpp stable/10/contrib/libc++/src/locale.cpp stable/10/contrib/libc++/src/mutex.cpp stable/10/contrib/libc++/src/new.cpp stable/10/contrib/libc++/src/random.cpp stable/10/contrib/libc++/src/stdexcept.cpp stable/10/contrib/libc++/src/string.cpp stable/10/contrib/libc++/src/strstream.cpp stable/10/contrib/libc++/src/system_error.cpp stable/10/contrib/libc++/src/thread.cpp stable/10/contrib/libc++/src/typeinfo.cpp stable/10/contrib/libc++/src/valarray.cpp stable/10/etc/mtree/BSD.include.dist stable/10/lib/libc++/Makefile stable/10/sys/sys/param.h stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/9/contrib/libc++/include/experimental/ - copied from r261283, head/contrib/libc++/include/experimental/ stable/9/contrib/libc++/include/shared_mutex - copied unchanged from r261283, head/contrib/libc++/include/shared_mutex stable/9/contrib/libc++/src/optional.cpp - copied unchanged from r261283, head/contrib/libc++/src/optional.cpp stable/9/contrib/libc++/src/shared_mutex.cpp - copied unchanged from r261283, head/contrib/libc++/src/shared_mutex.cpp Modified: stable/9/contrib/libc++/CREDITS.TXT stable/9/contrib/libc++/include/__bit_reference stable/9/contrib/libc++/include/__config stable/9/contrib/libc++/include/__debug stable/9/contrib/libc++/include/__functional_03 stable/9/contrib/libc++/include/__functional_base stable/9/contrib/libc++/include/__functional_base_03 stable/9/contrib/libc++/include/__hash_table stable/9/contrib/libc++/include/__locale stable/9/contrib/libc++/include/__mutex_base stable/9/contrib/libc++/include/__split_buffer stable/9/contrib/libc++/include/__std_stream stable/9/contrib/libc++/include/__tree stable/9/contrib/libc++/include/__tuple stable/9/contrib/libc++/include/__tuple_03 stable/9/contrib/libc++/include/__undef_min_max stable/9/contrib/libc++/include/algorithm stable/9/contrib/libc++/include/array stable/9/contrib/libc++/include/bitset stable/9/contrib/libc++/include/cctype stable/9/contrib/libc++/include/chrono stable/9/contrib/libc++/include/cmath stable/9/contrib/libc++/include/codecvt stable/9/contrib/libc++/include/complex stable/9/contrib/libc++/include/cstddef stable/9/contrib/libc++/include/cstdio stable/9/contrib/libc++/include/cstdlib stable/9/contrib/libc++/include/cstring stable/9/contrib/libc++/include/cwchar stable/9/contrib/libc++/include/deque stable/9/contrib/libc++/include/exception stable/9/contrib/libc++/include/ext/__hash stable/9/contrib/libc++/include/ext/hash_map stable/9/contrib/libc++/include/ext/hash_set stable/9/contrib/libc++/include/forward_list stable/9/contrib/libc++/include/fstream stable/9/contrib/libc++/include/functional stable/9/contrib/libc++/include/future stable/9/contrib/libc++/include/initializer_list stable/9/contrib/libc++/include/iomanip stable/9/contrib/libc++/include/ios stable/9/contrib/libc++/include/iosfwd stable/9/contrib/libc++/include/istream stable/9/contrib/libc++/include/iterator stable/9/contrib/libc++/include/limits stable/9/contrib/libc++/include/list stable/9/contrib/libc++/include/locale stable/9/contrib/libc++/include/map stable/9/contrib/libc++/include/memory stable/9/contrib/libc++/include/mutex stable/9/contrib/libc++/include/new stable/9/contrib/libc++/include/numeric stable/9/contrib/libc++/include/ostream stable/9/contrib/libc++/include/queue stable/9/contrib/libc++/include/random stable/9/contrib/libc++/include/ratio stable/9/contrib/libc++/include/regex stable/9/contrib/libc++/include/scoped_allocator stable/9/contrib/libc++/include/set stable/9/contrib/libc++/include/sstream stable/9/contrib/libc++/include/stack stable/9/contrib/libc++/include/streambuf stable/9/contrib/libc++/include/string stable/9/contrib/libc++/include/system_error stable/9/contrib/libc++/include/thread stable/9/contrib/libc++/include/tuple stable/9/contrib/libc++/include/type_traits stable/9/contrib/libc++/include/typeindex stable/9/contrib/libc++/include/unordered_map stable/9/contrib/libc++/include/unordered_set stable/9/contrib/libc++/include/utility stable/9/contrib/libc++/include/valarray stable/9/contrib/libc++/include/vector stable/9/contrib/libc++/src/algorithm.cpp stable/9/contrib/libc++/src/debug.cpp stable/9/contrib/libc++/src/exception.cpp stable/9/contrib/libc++/src/future.cpp stable/9/contrib/libc++/src/ios.cpp stable/9/contrib/libc++/src/iostream.cpp stable/9/contrib/libc++/src/locale.cpp stable/9/contrib/libc++/src/mutex.cpp stable/9/contrib/libc++/src/new.cpp stable/9/contrib/libc++/src/random.cpp stable/9/contrib/libc++/src/stdexcept.cpp stable/9/contrib/libc++/src/string.cpp stable/9/contrib/libc++/src/strstream.cpp stable/9/contrib/libc++/src/system_error.cpp stable/9/contrib/libc++/src/thread.cpp stable/9/contrib/libc++/src/typeinfo.cpp stable/9/contrib/libc++/src/valarray.cpp stable/9/etc/mtree/BSD.include.dist stable/9/lib/libc++/Makefile stable/9/sys/sys/param.h stable/9/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/9/ (props changed) stable/9/contrib/libc++/ (props changed) stable/9/etc/ (props changed) stable/9/etc/mtree/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc++/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) stable/9/tools/ (props changed) stable/9/tools/build/ (props changed) Modified: stable/10/contrib/libc++/CREDITS.TXT ============================================================================== --- stable/10/contrib/libc++/CREDITS.TXT Wed Mar 5 19:28:50 2014 (r262800) +++ stable/10/contrib/libc++/CREDITS.TXT Wed Mar 5 19:30:36 2014 (r262801) @@ -31,6 +31,14 @@ D: FreeBSD and Solaris ports, libcxxrt s N: Marshall Clow E: mclow.lists@gmail.com E: marshall@idio.com +D: C++14 support, patches and bug fixes. + +N: Bill Fisher +E: william.w.fisher@gmail.com +D: Regex bug fixes. + +N: Matthew Dempsky +E: matthew@dempsky.org D: Minor patches and bug fixes. N: Google Inc. @@ -48,6 +56,10 @@ N: Argyrios Kyrtzidis E: kyrtzidis@apple.com D: Bug fixes. +N: Bruce Mitchener, Jr. +E: bruce.mitchener@gmail.com +D: Emscripten-related changes. + N: Michel Morin E: mimomorin@gmail.com D: Minor patches to is_convertible. @@ -64,6 +76,10 @@ N: Bjorn Reese E: breese@users.sourceforge.net D: Initial regex prototype +N: Nico Rieck +E: nico.rieck@gmail.com +D: Windows fixes + N: Jonathan Sauer D: Minor patches, mostly related to constexpr @@ -74,6 +90,14 @@ D: Implemented Cityhash as the string ha N: Richard Smith D: Minor patches. +N: Joerg Sonnenberger +E: joerg@NetBSD.org +D: NetBSD port. + +N: Stephan Tolksdorf +E: st@quanttec.com +D: Minor fix + N: Michael van der Westhuizen E: r1mikey at gmail dot com @@ -85,11 +109,15 @@ N: Zhang Xiongpang E: zhangxiongpang@gmail.com D: Minor patches and bug fixes. +N: Xing Xue +E: xingxue@ca.ibm.com +D: AIX port + +N: Zhihao Yuan +E: lichray@gmail.com +D: Standard compatibility fixes. + N: Jeffrey Yasskin E: jyasskin@gmail.com E: jyasskin@google.com D: Linux fixes. - -N: Bruce Mitchener, Jr. -E: bruce.mitchener@gmail.com -D: Emscripten-related changes. Modified: stable/10/contrib/libc++/include/__bit_reference ============================================================================== --- stable/10/contrib/libc++/include/__bit_reference Wed Mar 5 19:28:50 2014 (r262800) +++ stable/10/contrib/libc++/include/__bit_reference Wed Mar 5 19:30:36 2014 (r262801) @@ -40,7 +40,7 @@ class __bit_reference __storage_pointer __seg_; __storage_type __mask_; -#if defined(__clang__) +#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC) friend typename _Cp::__self; #else friend class _Cp::__self; @@ -82,7 +82,7 @@ class __bit_reference<_Cp, false> }; template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY void swap(__bit_reference<_Cp> __x, __bit_reference<_Cp> __y) _NOEXCEPT { @@ -92,7 +92,7 @@ swap(__bit_reference<_Cp> __x, __bit_ref } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY void swap(__bit_reference<_Cp> __x, __bit_reference<_Dp> __y) _NOEXCEPT { @@ -102,7 +102,7 @@ swap(__bit_reference<_Cp> __x, __bit_ref } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY void swap(__bit_reference<_Cp> __x, bool& __y) _NOEXCEPT { @@ -112,7 +112,7 @@ swap(__bit_reference<_Cp> __x, bool& __y } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY void swap(bool& __x, __bit_reference<_Cp> __y) _NOEXCEPT { @@ -130,7 +130,7 @@ class __bit_const_reference __storage_pointer __seg_; __storage_type __mask_; -#if defined(__clang__) +#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC) friend typename _Cp::__self; #else friend class _Cp::__self; @@ -173,6 +173,8 @@ __find_bool_true(__bit_iterator<_Cp, _Is __storage_type __b = *__first.__seg_ & __m; if (__b) return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + if (__n == __dn) + return _It(__first.__seg_, __first.__ctz_ + __n); __n -= __dn; ++__first.__seg_; } @@ -207,6 +209,8 @@ __find_bool_false(__bit_iterator<_Cp, _I __storage_type __b = ~*__first.__seg_ & __m; if (__b) return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + if (__n == __dn) + return _It(__first.__seg_, __first.__ctz_ + __n); __n -= __dn; ++__first.__seg_; } @@ -375,7 +379,7 @@ __fill_n_true(__bit_iterator<_Cp, false> } template -_LIBCPP_INLINE_VISIBILITY inline +inline _LIBCPP_INLINE_VISIBILITY void fill_n(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n, bool __value_) { @@ -1104,7 +1108,11 @@ private: unsigned __ctz_; public: - _LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT +#if _LIBCPP_STD_VER > 11 + : __seg_(nullptr), __ctz_(0) +#endif + {} _LIBCPP_INLINE_VISIBILITY __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT @@ -1214,7 +1222,7 @@ private: __bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT : __seg_(__s), __ctz_(__ctz) {} -#if defined(__clang__) +#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC) friend typename _Cp::__self; #else friend class _Cp::__self; Modified: stable/10/contrib/libc++/include/__config ============================================================================== --- stable/10/contrib/libc++/include/__config Wed Mar 5 19:28:50 2014 (r262800) +++ stable/10/contrib/libc++/include/__config Wed Mar 5 19:30:36 2014 (r262801) @@ -11,7 +11,7 @@ #ifndef _LIBCPP_CONFIG #define _LIBCPP_CONFIG -#ifndef _MSC_VER // explicit macro necessary because it is only defined below in this file +#if !defined(_MSC_VER) || defined(__clang__) #pragma GCC system_header #endif @@ -72,15 +72,26 @@ # define _LIBCPP_LITTLE_ENDIAN 1 # define _LIBCPP_BIG_ENDIAN 0 // Compiler intrinsics (GCC or MSVC) -# if (defined(_MSC_VER) && _MSC_VER >= 1400) \ +# if defined(__clang__) \ + || (defined(_MSC_VER) && _MSC_VER >= 1400) \ || (defined(__GNUC__) && _GNUC_VER > 403) -# define _LIBCP_HAS_IS_BASE_OF +# define _LIBCPP_HAS_IS_BASE_OF +# endif +# if defined(_MSC_VER) && !defined(__clang__) +# define _LIBCPP_MSVC // Using Microsoft Visual C++ compiler +# define _LIBCPP_TOSTRING2(x) #x +# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x) +# define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x)) +# endif +# // If mingw not explicitly detected, assume using MS C runtime only. +# ifndef __MINGW32__ +# define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library # endif #endif // _WIN32 #ifdef __linux__ # if defined(__GNUC__) && _GNUC_VER >= 403 -# define _LIBCP_HAS_IS_BASE_OF +# define _LIBCPP_HAS_IS_BASE_OF # endif #endif @@ -127,8 +138,11 @@ # define _LIBCPP_TYPE_VIS #endif +#define _LIBCPP_TYPE_VIS_ONLY +#define _LIBCPP_FUNC_VIS_ONLY + #ifndef _LIBCPP_INLINE_VISIBILITY -# ifdef _MSC_VER +# ifdef _LIBCPP_MSVC # define _LIBCPP_INLINE_VISIBILITY __forceinline # else // MinGW GCC and Clang # define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__)) @@ -140,7 +154,7 @@ #endif #ifndef _LIBCPP_ALWAYS_INLINE -# ifdef _MSC_VER +# ifdef _LIBCPP_MSVC # define _LIBCPP_ALWAYS_INLINE __forceinline # endif #endif @@ -160,13 +174,21 @@ #endif #ifndef _LIBCPP_TYPE_VIS -# if __has_attribute(type_visibility) +# if __has_attribute(__type_visibility__) # define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) # else # define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) # endif #endif +#ifndef _LIBCPP_TYPE_VIS_ONLY +# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS +#endif + +#ifndef _LIBCPP_FUNC_VIS_ONLY +# define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS +#endif + #ifndef _LIBCPP_INLINE_VISIBILITY #define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__)) #endif @@ -175,10 +197,6 @@ #define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS #endif -#ifndef _LIBCPP_CANTTHROW -#define _LIBCPP_CANTTHROW __attribute__ ((__nothrow__)) -#endif - #ifndef _LIBCPP_ALWAYS_INLINE #define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__)) #endif @@ -273,7 +291,7 @@ typedef __char32_t char32_t; #endif #if __has_feature(is_base_of) -# define _LIBCP_HAS_IS_BASE_OF +# define _LIBCPP_HAS_IS_BASE_OF #endif // Objective-C++ features (opt-in) @@ -396,13 +414,14 @@ namespace _LIBCPP_NAMESPACE { using namespace _LIBCPP_NAMESPACE __attribute__((__strong__)); } -#elif defined(_MSC_VER) +#elif defined(_LIBCPP_MSVC) #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES #define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER #define _LIBCPP_HAS_NO_CONSTEXPR #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS #define __alignof__ __alignof #define _LIBCPP_NORETURN __declspec(noreturn) #define _ALIGNAS(x) __declspec(align(x)) @@ -415,10 +434,43 @@ using namespace _LIBCPP_NAMESPACE __attr #define _LIBCPP_END_NAMESPACE_STD } #define _VSTD std +# define _LIBCPP_WEAK namespace std { } -#endif // __clang__ || __GNUC___ || _MSC_VER +#elif defined(__IBMCPP__) + +#define _ALIGNAS(x) __attribute__((__aligned__(x))) +#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) +#define _ATTRIBUTE(x) __attribute__((x)) +#define _LIBCPP_NORETURN __attribute__((noreturn)) + +#define _NOEXCEPT throw() +#define _NOEXCEPT_(x) + +#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES +#define _LIBCPP_HAS_NO_ADVANCED_SFINAE +#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS +#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#define _LIBCPP_HAS_NO_NULLPTR +#define _LIBCPP_HAS_NO_UNICODE_CHARS +#define _LIBCPP_HAS_NO_STRONG_ENUMS +#define _LIBCPP_HAS_IS_BASE_OF + +#if defined(_AIX) +#define __MULTILOCALE_API +#endif + +#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE { +#define _LIBCPP_END_NAMESPACE_STD } } +#define _VSTD std::_LIBCPP_NAMESPACE + +namespace std { + inline namespace _LIBCPP_NAMESPACE { + } +} + +#endif // __clang__ || __GNUC___ || _MSC_VER || __IBMCPP__ #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS typedef unsigned short char16_t; @@ -481,8 +533,23 @@ template struct __static_asse #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) #endif // _LIBCPP_HAS_NO_STRONG_ENUMS +#ifdef _LIBCPP_DEBUG +# if _LIBCPP_DEBUG == 0 +# define _LIBCPP_DEBUG_LEVEL 1 +# elif _LIBCPP_DEBUG == 1 +# define _LIBCPP_DEBUG_LEVEL 2 +# else +# error Supported values for _LIBCPP_DEBUG are 0 and 1 +# endif +# define _LIBCPP_EXTERN_TEMPLATE(...) +#endif + #ifndef _LIBCPP_EXTERN_TEMPLATE -#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; +#define _LIBCPP_EXTERN_TEMPLATE(...) +#endif + +#ifndef _LIBCPP_EXTERN_TEMPLATE2 +#define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__; #endif #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) || defined(__NetBSD__) @@ -500,14 +567,14 @@ template struct __static_asse #define _LIBCPP_WCTYPE_IS_MASK #endif -#ifdef _LIBCPP_DEBUG2 -# if _LIBCPP_DEBUG2 == 0 -# define _LIBCPP_DEBUG_LEVEL 1 -# elif _LIBCPP_DEBUG2 == 1 -# define _LIBCPP_DEBUG_LEVEL 2 -# else -# error Supported values for _LIBCPP_DEBUG2 are 0 and 1 -# endif +#if defined(__APPLE__) || defined(__FreeBSD__) +#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR +# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 0 +#endif +#endif + +#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR +# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1 #endif #ifndef _LIBCPP_STD_VER @@ -518,10 +585,36 @@ template struct __static_asse # endif #endif // _LIBCPP_STD_VER -#ifdef _LIBCPP_DEBUG2 -# include <__debug> +#if _LIBCPP_STD_VER > 11 +#define _LIBCPP_DEPRECATED [[deprecated]] #else -# define _LIBCPP_ASSERT(x, m) ((void)0) +#define _LIBCPP_DEPRECATED +#endif + +#if _LIBCPP_STD_VER <= 11 +#define _LIBCPP_CONSTEXPR_AFTER_CXX11 +#define _LIBCPP_EXPLICIT_AFTER_CXX11 +#define _LIBCPP_DEPRECATED_AFTER_CXX11 +#else +#define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr +#define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit +#define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]] +#endif + +// Try to find out if RTTI is disabled. +// g++ and cl.exe have RTTI on by default and define a macro when it is. +// g++ only defines the macro in 4.3.2 and onwards. +#if !defined(_LIBCPP_NO_RTTI) +# if defined(__GNUG__) && (__GNUC__ >= 4 && \ + (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2)) && !defined(__GXX_RTTI) +# define _LIBCPP_NO_RTTI +# elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI) +# define _LIBCPP_NO_RTTI +# endif +#endif + +#ifndef _LIBCPP_WEAK +# define _LIBCPP_WEAK __attribute__((__weak__)) #endif #endif // _LIBCPP_CONFIG Modified: stable/10/contrib/libc++/include/__debug ============================================================================== --- stable/10/contrib/libc++/include/__debug Wed Mar 5 19:28:50 2014 (r262800) +++ stable/10/contrib/libc++/include/__debug Wed Mar 5 19:30:36 2014 (r262801) @@ -11,6 +11,10 @@ #ifndef _LIBCPP_DEBUG_H #define _LIBCPP_DEBUG_H +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + #if _LIBCPP_DEBUG_LEVEL >= 1 # include @@ -34,8 +38,15 @@ struct _LIBCPP_TYPE_VIS __i_node __i_node* __next_; __c_node* __c_; +#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS __i_node(const __i_node&) = delete; __i_node& operator=(const __i_node&) = delete; +#else +private: + __i_node(const __i_node&); + __i_node& operator=(const __i_node&); +public: +#endif _LIBCPP_INLINE_VISIBILITY __i_node(void* __i, __i_node* __next, __c_node* __c) : __i_(__i), __next_(__next), __c_(__c) {} @@ -50,8 +61,15 @@ struct _LIBCPP_TYPE_VIS __c_node __i_node** end_; __i_node** cap_; +#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS __c_node(const __c_node&) = delete; __c_node& operator=(const __c_node&) = delete; +#else +private: + __c_node(const __c_node&); + __c_node& operator=(const __c_node&); +public: +#endif _LIBCPP_INLINE_VISIBILITY __c_node(void* __c, __c_node* __next) : __c_(__c), __next_(__next), beg_(nullptr), end_(nullptr), cap_(nullptr) {} @@ -130,8 +148,15 @@ class _LIBCPP_TYPE_VIS __libcpp_db __libcpp_db(); public: +#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS __libcpp_db(const __libcpp_db&) = delete; __libcpp_db& operator=(const __libcpp_db&) = delete; +#else +private: + __libcpp_db(const __libcpp_db&); + __libcpp_db& operator=(const __libcpp_db&); +public: +#endif ~__libcpp_db(); class __db_c_iterator; @@ -171,7 +196,7 @@ public: bool __decrementable(const void* __i) const; bool __addable(const void* __i, ptrdiff_t __n) const; bool __subscriptable(const void* __i, ptrdiff_t __n) const; - bool __comparable(const void* __i, const void* __j) const; + bool __less_than_comparable(const void* __i, const void* __j) const; private: _LIBCPP_HIDDEN __i_node* __insert_iterator(void* __i); Modified: stable/10/contrib/libc++/include/__functional_03 ============================================================================== --- stable/10/contrib/libc++/include/__functional_03 Wed Mar 5 19:28:50 2014 (r262800) +++ stable/10/contrib/libc++/include/__functional_03 Wed Mar 5 19:30:36 2014 (r262801) @@ -102,98 +102,98 @@ mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2)) template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)()> +__mem_fn<_Rp (_Tp::*)() const> mem_fn(_Rp (_Tp::* __pm)() const) { - return __mem_fn<_Rp (_Tp::*)()>(__pm); + return __mem_fn<_Rp (_Tp::*)() const>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0)> +__mem_fn<_Rp (_Tp::*)(_A0) const> mem_fn(_Rp (_Tp::* __pm)(_A0) const) { - return __mem_fn<_Rp (_Tp::*)(_A0)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0) const>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1)> +__mem_fn<_Rp (_Tp::*)(_A0, _A1) const> mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) const) { - return __mem_fn<_Rp (_Tp::*)(_A0, _A1)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1) const>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)> +__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const> mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) const) { - return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)()> +__mem_fn<_Rp (_Tp::*)() volatile> mem_fn(_Rp (_Tp::* __pm)() volatile) { - return __mem_fn<_Rp (_Tp::*)()>(__pm); + return __mem_fn<_Rp (_Tp::*)() volatile>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0)> +__mem_fn<_Rp (_Tp::*)(_A0) volatile> mem_fn(_Rp (_Tp::* __pm)(_A0) volatile) { - return __mem_fn<_Rp (_Tp::*)(_A0)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0) volatile>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1)> +__mem_fn<_Rp (_Tp::*)(_A0, _A1) volatile> mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) volatile) { - return __mem_fn<_Rp (_Tp::*)(_A0, _A1)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1) volatile>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)> +__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) volatile> mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) volatile) { - return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) volatile>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)()> +__mem_fn<_Rp (_Tp::*)() const volatile> mem_fn(_Rp (_Tp::* __pm)() const volatile) { - return __mem_fn<_Rp (_Tp::*)()>(__pm); + return __mem_fn<_Rp (_Tp::*)() const volatile>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0)> +__mem_fn<_Rp (_Tp::*)(_A0) const volatile> mem_fn(_Rp (_Tp::* __pm)(_A0) const volatile) { - return __mem_fn<_Rp (_Tp::*)(_A0)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0) const volatile>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1)> +__mem_fn<_Rp (_Tp::*)(_A0, _A1) const volatile> mem_fn(_Rp (_Tp::* __pm)(_A0, _A1) const volatile) { - return __mem_fn<_Rp (_Tp::*)(_A0, _A1)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1) const volatile>(__pm); } template inline _LIBCPP_INLINE_VISIBILITY -__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)> +__mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const volatile> mem_fn(_Rp (_Tp::* __pm)(_A0, _A1, _A2) const volatile) { - return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2)>(__pm); + return __mem_fn<_Rp (_Tp::*)(_A0, _A1, _A2) const volatile>(__pm); } // bad_function_call @@ -203,7 +203,7 @@ class _LIBCPP_EXCEPTION_ABI bad_function { }; -template class _LIBCPP_TYPE_VIS function; // undefined +template class _LIBCPP_TYPE_VIS_ONLY function; // undefined namespace __function { @@ -644,7 +644,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>: } // __function template -class _LIBCPP_TYPE_VIS function<_Rp()> +class _LIBCPP_TYPE_VIS_ONLY function<_Rp()> { typedef __function::__base<_Rp()> __base; aligned_storage<3*sizeof(void*)>::type __buf_; @@ -928,7 +928,7 @@ function<_Rp()>::target() const #endif // _LIBCPP_NO_RTTI template -class _LIBCPP_TYPE_VIS function<_Rp(_A0)> +class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0)> : public unary_function<_A0, _Rp> { typedef __function::__base<_Rp(_A0)> __base; @@ -1230,7 +1230,7 @@ function<_Rp(_A0)>::target() const #endif // _LIBCPP_NO_RTTI template -class _LIBCPP_TYPE_VIS function<_Rp(_A0, _A1)> +class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0, _A1)> : public binary_function<_A0, _A1, _Rp> { typedef __function::__base<_Rp(_A0, _A1)> __base; @@ -1532,7 +1532,7 @@ function<_Rp(_A0, _A1)>::target() const #endif // _LIBCPP_NO_RTTI template -class _LIBCPP_TYPE_VIS function<_Rp(_A0, _A1, _A2)> +class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0, _A1, _A2)> { typedef __function::__base<_Rp(_A0, _A1, _A2)> __base; aligned_storage<3*sizeof(void*)>::type __buf_; @@ -1860,11 +1860,11 @@ swap(function<_Fp>& __x, function<_Fp>& {return __x.swap(__y);} template struct __is_bind_expression : public false_type {}; -template struct _LIBCPP_TYPE_VIS is_bind_expression +template struct _LIBCPP_TYPE_VIS_ONLY is_bind_expression : public __is_bind_expression::type> {}; template struct __is_placeholder : public integral_constant {}; -template struct _LIBCPP_TYPE_VIS is_placeholder +template struct _LIBCPP_TYPE_VIS_ONLY is_placeholder : public __is_placeholder::type> {}; namespace placeholders Modified: stable/10/contrib/libc++/include/__functional_base ============================================================================== --- stable/10/contrib/libc++/include/__functional_base Wed Mar 5 19:28:50 2014 (r262800) +++ stable/10/contrib/libc++/include/__functional_base Wed Mar 5 19:30:36 2014 (r262801) @@ -15,6 +15,7 @@ #include #include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -23,21 +24,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -struct _LIBCPP_TYPE_VIS unary_function +struct _LIBCPP_TYPE_VIS_ONLY unary_function { typedef _Arg argument_type; typedef _Result result_type; }; template -struct _LIBCPP_TYPE_VIS binary_function +struct _LIBCPP_TYPE_VIS_ONLY binary_function { typedef _Arg1 first_argument_type; typedef _Arg2 second_argument_type; typedef _Result result_type; }; -template struct _LIBCPP_TYPE_VIS hash; +template struct _LIBCPP_TYPE_VIS_ONLY hash; template struct __has_result_type @@ -50,13 +51,80 @@ public: static const bool value = sizeof(__test<_Tp>(0)) == 1; }; +#if _LIBCPP_STD_VER > 11 +template +#else template -struct _LIBCPP_TYPE_VIS less : binary_function<_Tp, _Tp, bool> +#endif +struct _LIBCPP_TYPE_VIS_ONLY less : binary_function<_Tp, _Tp, bool> { - _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const _Tp& __x, const _Tp& __y) const {return __x < __y;} }; +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TYPE_VIS_ONLY less +{ + template + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + { return _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +// addressof + +template +inline _LIBCPP_INLINE_VISIBILITY +_Tp* +addressof(_Tp& __x) _NOEXCEPT +{ + return (_Tp*)&reinterpret_cast(__x); +} + +#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF) +// Objective-C++ Automatic Reference Counting uses qualified pointers +// that require special addressof() signatures. When +// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler +// itself is providing these definitions. Otherwise, we provide them. +template +inline _LIBCPP_INLINE_VISIBILITY +__strong _Tp* +addressof(__strong _Tp& __x) _NOEXCEPT +{ + return &__x; +} + +#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK +template +inline _LIBCPP_INLINE_VISIBILITY +__weak _Tp* +addressof(__weak _Tp& __x) _NOEXCEPT +{ + return &__x; +} +#endif + +template +inline _LIBCPP_INLINE_VISIBILITY +__autoreleasing _Tp* +addressof(__autoreleasing _Tp& __x) _NOEXCEPT +{ + return &__x; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +__unsafe_unretained _Tp* +addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT +{ + return &__x; +} +#endif + #ifdef _LIBCPP_HAS_NO_VARIADICS #include <__functional_base_03> @@ -352,7 +420,7 @@ struct __invoke_return }; template -class _LIBCPP_TYPE_VIS reference_wrapper +class _LIBCPP_TYPE_VIS_ONLY reference_wrapper : public __weak_result_type<_Tp> { public: @@ -363,7 +431,8 @@ private: public: // construct/copy/destroy - _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT : __f_(&__f) {} + _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT + : __f_(_VSTD::addressof(__f)) {} #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES private: reference_wrapper(type&&); public: // = delete; // do not bind to temps #endif @@ -436,6 +505,111 @@ template void cref(const _Tp #endif // _LIBCPP_HAS_NO_VARIADICS +#if _LIBCPP_STD_VER > 11 +template +struct __is_transparent +{ +private: + struct __two {char __lx; char __lxx;}; + template static __two __test(...); + template static char __test(typename _Up::is_transparent* = 0); +public: + static const bool value = sizeof(__test<_Tp1>(0)) == 1; +}; +#endif + +// allocator_arg_t + +struct _LIBCPP_TYPE_VIS_ONLY allocator_arg_t { }; + +#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY) +extern const allocator_arg_t allocator_arg; +#else +constexpr allocator_arg_t allocator_arg = allocator_arg_t(); +#endif + +// uses_allocator + +template +struct __has_allocator_type +{ +private: + struct __two {char __lx; char __lxx;}; + template static __two __test(...); + template static char __test(typename _Up::allocator_type* = 0); +public: + static const bool value = sizeof(__test<_Tp>(0)) == 1; +}; + +template ::value> +struct __uses_allocator + : public integral_constant::value> +{ +}; + +template +struct __uses_allocator<_Tp, _Alloc, false> + : public false_type +{ +}; + +template +struct _LIBCPP_TYPE_VIS_ONLY uses_allocator + : public __uses_allocator<_Tp, _Alloc> +{ +}; + +#ifndef _LIBCPP_HAS_NO_VARIADICS + +// allocator construction + +template +struct __uses_alloc_ctor_imp +{ + static const bool __ua = uses_allocator<_Tp, _Alloc>::value; + static const bool __ic = + is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; + static const int value = __ua ? 2 - __ic : 0; +}; + +template +struct __uses_alloc_ctor + : integral_constant::value> + {}; + +template +inline _LIBCPP_INLINE_VISIBILITY +void __user_alloc_construct_impl (integral_constant, _Tp *__storage, const _Allocator &, _Args &&... __args ) +{ + new (__storage) _Tp (_VSTD::forward<_Args>(__args)...); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +void __user_alloc_construct_impl (integral_constant, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) +{ + new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +void __user_alloc_construct_impl (integral_constant, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) +{ + new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +void __user_alloc_construct (_Tp *__storage, const _Allocator &__a, _Args &&... __args) +{ + __user_alloc_construct_impl( + __uses_alloc_ctor<_Tp, _Allocator>(), + __storage, __a, _VSTD::forward<_Args>(__args)... + ); +} +#endif // _LIBCPP_HAS_NO_VARIADICS + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_FUNCTIONAL_BASE Modified: stable/10/contrib/libc++/include/__functional_base_03 ============================================================================== --- stable/10/contrib/libc++/include/__functional_base_03 Wed Mar 5 19:28:50 2014 (r262800) +++ stable/10/contrib/libc++/include/__functional_base_03 Wed Mar 5 19:30:36 2014 (r262801) @@ -996,7 +996,7 @@ struct __invoke_return2 }; template -class _LIBCPP_TYPE_VIS reference_wrapper +class _LIBCPP_TYPE_VIS_ONLY reference_wrapper : public __weak_result_type<_Tp> { public: Modified: stable/10/contrib/libc++/include/__hash_table ============================================================================== --- stable/10/contrib/libc++/include/__hash_table Wed Mar 5 19:28:50 2014 (r262800) +++ stable/10/contrib/libc++/include/__hash_table Wed Mar 5 19:30:36 2014 (r262801) @@ -20,6 +20,12 @@ #include <__undef_min_max> +#ifdef _LIBCPP_DEBUG +# include <__debug> +#else +# define _LIBCPP_ASSERT(x, m) ((void)0) +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif @@ -79,14 +85,14 @@ __next_pow2(size_t __n) } template class __hash_table; -template class _LIBCPP_TYPE_VIS __hash_const_iterator; -template class _LIBCPP_TYPE_VIS __hash_map_iterator; -template class _LIBCPP_TYPE_VIS __hash_map_const_iterator; +template class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator; +template class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator; +template class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator; template - class _LIBCPP_TYPE_VIS unordered_map; + class _LIBCPP_TYPE_VIS_ONLY unordered_map; template -class _LIBCPP_TYPE_VIS __hash_iterator +class _LIBCPP_TYPE_VIS_ONLY __hash_iterator { typedef _NodePtr __node_pointer; @@ -105,16 +111,70 @@ public: #endif pointer; - _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT +#if _LIBCPP_STD_VER > 11 + : __node_(nullptr) +#endif + { +#if _LIBCPP_DEBUG_LEVEL >= 2 + __get_db()->__insert_i(this); +#endif + } + +#if _LIBCPP_DEBUG_LEVEL >= 2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 5 19:43:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1E7305F2; Wed, 5 Mar 2014 19:43:27 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2D8B3D5; Wed, 5 Mar 2014 19:43:26 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B963CB917; Wed, 5 Mar 2014 14:43:25 -0500 (EST) From: John Baldwin To: Pawel Jakub Dawidek Subject: Re: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-comp... Date: Wed, 5 Mar 2014 14:13:47 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201402271729.s1RHT2rx075258@svn.freebsd.org> <201403041146.57895.jhb@freebsd.org> <20140304194908.GA1672@garage.freebsd.pl> In-Reply-To: <20140304194908.GA1672@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201403051413.48049.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 05 Mar 2014 14:43:25 -0500 (EST) Cc: src-committers@freebsd.org, svn-src-stable-10@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dag-Erling =?iso-8859-15?q?Sm=F8rgrav?= , Dimitry Andric X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 19:43:27 -0000 On Tuesday, March 04, 2014 2:49:09 pm Pawel Jakub Dawidek wrote: > On Tue, Mar 04, 2014 at 11:46:57AM -0500, John Baldwin wrote: > > On Tuesday, March 04, 2014 3:40:47 am Dag-Erling Sm=F8rgrav wrote: > > > Pawel Jakub Dawidek writes: > > > > Dimitry Andric writes: > > > > > Wouldn't it be enough to merge r261499 ("Fix installations that u= se > > > > > kernels without CAPABILITIES support") by pjd? > > > > Yes, my change should be definiately merged with OpenSSH merge. If > > > > nobody beats me to it, I should be able to merge it tomorrow. > > >=20 > > > Please do. I thought I had included it in the MFC since it was alrea= dy > > > in head, but I'd forgotten that it had been committed separately. >=20 > Xin already did it. >=20 > > > BTW, IWBNI there were a cap_available() predicate or something like t= hat > > > which we could check up front, and short-circuit the entire Capsicum > > > part of ssh_sandbox_child() if it failed. > >=20 > > If the capsicum code adds a FEATURE(capsicum) macro in the kernel bits,= you=20 > > can use 'if (feature_present("capsicum"))' in userland to check. >=20 > It does add the following: >=20 > FEATURE(security_capability_mode, "Capsicum Capability Mode"); > FEATURE(security_capabilities, "Capsicum Capabilities"); Ah, then 'feature_present("security_capabilities")' should suffice. =2D-=20 John Baldwin From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 10:26:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 33EE03D5; Thu, 6 Mar 2014 10:26: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06034D72; Thu, 6 Mar 2014 10:26: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 s26AQPOs028854; Thu, 6 Mar 2014 10:26:25 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26AQP9A028852; Thu, 6 Mar 2014 10:26:25 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201403061026.s26AQP9A028852@svn.freebsd.org> From: Niclas Zeising Date: Thu, 6 Mar 2014 10:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262836 - in stable: 10/share/man/man5 10/usr.sbin/jail 9/share/man/man5 9/usr.sbin/jail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 10:26:26 -0000 Author: zeising (doc,ports committer) Date: Thu Mar 6 10:26:25 2014 New Revision: 262836 URL: http://svnweb.freebsd.org/changeset/base/262836 Log: MFC r261832-261834: r261832: Add cross references between rc.conf(5) and jail.conf(5). r261833: Add commas (,) to the list in the SEE ALSO section, to match most other manuals. r261834: Bump .Dd forgotten in r261832. Modified: stable/10/share/man/man5/rc.conf.5 stable/10/usr.sbin/jail/jail.conf.5 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/man/man5/rc.conf.5 stable/9/usr.sbin/jail/jail.conf.5 Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man5/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/jail/ (props changed) Modified: stable/10/share/man/man5/rc.conf.5 ============================================================================== --- stable/10/share/man/man5/rc.conf.5 Thu Mar 6 10:11:23 2014 (r262835) +++ stable/10/share/man/man5/rc.conf.5 Thu Mar 6 10:26:25 2014 (r262836) @@ -4469,6 +4469,7 @@ ruleset to load for .Xr fstab 5 , .Xr ipf 5 , .Xr ipnat 5 , +.Xr jail.conf 5 , .Xr motd 5 , .Xr newsyslog.conf 5 , .Xr pf.conf 5 , Modified: stable/10/usr.sbin/jail/jail.conf.5 ============================================================================== --- stable/10/usr.sbin/jail/jail.conf.5 Thu Mar 6 10:11:23 2014 (r262835) +++ stable/10/usr.sbin/jail/jail.conf.5 Thu Mar 6 10:26:25 2014 (r262836) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2012 +.Dd February 13, 2014 .Dt JAIL.CONF 5 .Os .Sh NAME @@ -206,8 +206,9 @@ bar { } .Ed .Sh SEE ALSO -.Xr jail_set 2 -.Xr jail 8 +.Xr jail_set 2 , +.Xr rc.conf 5 , +.Xr jail 8 , .Xr jls 8 .Sh HISTORY The From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 11:02:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D7234D25; Thu, 6 Mar 2014 11:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B7725185; Thu, 6 Mar 2014 11:02: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 s26B2Wrd046615; Thu, 6 Mar 2014 11:02:32 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26B2WHf046614; Thu, 6 Mar 2014 11:02:32 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403061102.s26B2WHf046614@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Mar 2014 11:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262838 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 11:02:32 -0000 Author: trasz Date: Thu Mar 6 11:02:32 2014 New Revision: 262838 URL: http://svnweb.freebsd.org/changeset/base/262838 Log: MFC r261711: Yacc cleanup; no functional changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/iscsictl/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/parse.y ============================================================================== --- stable/10/usr.bin/iscsictl/parse.y Thu Mar 6 10:45:53 2014 (r262837) +++ stable/10/usr.bin/iscsictl/parse.y Thu Mar 6 11:02:32 2014 (r262838) @@ -69,12 +69,12 @@ extern void yyrestart(FILE *); %% -statements: +targets: | - statements target_statement + targets target ; -target_statement: STR OPENING_BRACKET target_entries CLOSING_BRACKET +target: STR OPENING_BRACKET target_entries CLOSING_BRACKET { if (target_find(conf, $1) != NULL) errx(1, "duplicated target %s", $1); @@ -89,38 +89,38 @@ target_entries: ; target_entry: - target_name_statement + target_name | - target_address_statement + target_address | - initiator_name_statement + initiator_name | - initiator_address_statement + initiator_address | - initiator_alias_statement + initiator_alias | - user_statement + user | - secret_statement + secret | - mutual_user_statement + mutual_user | - mutual_secret_statement + mutual_secret | - auth_method_statement + auth_method | - header_digest_statement + header_digest | - data_digest_statement + data_digest | - session_type_statement + session_type | - protocol_statement + protocol | - ignored_statement + ignored ; -target_name_statement: TARGET_NAME EQUALS STR +target_name: TARGET_NAME EQUALS STR { if (target->t_name != NULL) errx(1, "duplicated TargetName at line %d", lineno + 1); @@ -128,7 +128,7 @@ target_name_statement: TARGET_NAME EQUAL } ; -target_address_statement: TARGET_ADDRESS EQUALS STR +target_address: TARGET_ADDRESS EQUALS STR { if (target->t_address != NULL) errx(1, "duplicated TargetAddress at line %d", lineno + 1); @@ -136,7 +136,7 @@ target_address_statement: TARGET_ADDRESS } ; -initiator_name_statement: INITIATOR_NAME EQUALS STR +initiator_name: INITIATOR_NAME EQUALS STR { if (target->t_initiator_name != NULL) errx(1, "duplicated InitiatorName at line %d", lineno + 1); @@ -144,7 +144,7 @@ initiator_name_statement: INITIATOR_NAME } ; -initiator_address_statement: INITIATOR_ADDRESS EQUALS STR +initiator_address: INITIATOR_ADDRESS EQUALS STR { if (target->t_initiator_address != NULL) errx(1, "duplicated InitiatorAddress at line %d", lineno + 1); @@ -152,7 +152,7 @@ initiator_address_statement: INITIATOR_A } ; -initiator_alias_statement: INITIATOR_ALIAS EQUALS STR +initiator_alias: INITIATOR_ALIAS EQUALS STR { if (target->t_initiator_alias != NULL) errx(1, "duplicated InitiatorAlias at line %d", lineno + 1); @@ -160,7 +160,7 @@ initiator_alias_statement: INITIATOR_ALI } ; -user_statement: USER EQUALS STR +user: USER EQUALS STR { if (target->t_user != NULL) errx(1, "duplicated chapIName at line %d", lineno + 1); @@ -168,7 +168,7 @@ user_statement: USER EQUALS STR } ; -secret_statement: SECRET EQUALS STR +secret: SECRET EQUALS STR { if (target->t_secret != NULL) errx(1, "duplicated chapSecret at line %d", lineno + 1); @@ -176,7 +176,7 @@ secret_statement: SECRET EQUALS STR } ; -mutual_user_statement: MUTUAL_USER EQUALS STR +mutual_user: MUTUAL_USER EQUALS STR { if (target->t_mutual_user != NULL) errx(1, "duplicated tgtChapName at line %d", lineno + 1); @@ -184,7 +184,7 @@ mutual_user_statement: MUTUAL_USER EQUAL } ; -mutual_secret_statement:MUTUAL_SECRET EQUALS STR +mutual_secret: MUTUAL_SECRET EQUALS STR { if (target->t_mutual_secret != NULL) errx(1, "duplicated tgtChapSecret at line %d", lineno + 1); @@ -192,7 +192,7 @@ mutual_secret_statement:MUTUAL_SECRET EQ } ; -auth_method_statement: AUTH_METHOD EQUALS STR +auth_method: AUTH_METHOD EQUALS STR { if (target->t_auth_method != AUTH_METHOD_UNSPECIFIED) errx(1, "duplicated AuthMethod at line %d", lineno + 1); @@ -206,7 +206,7 @@ auth_method_statement: AUTH_METHOD EQUAL } ; -header_digest_statement: HEADER_DIGEST EQUALS STR +header_digest: HEADER_DIGEST EQUALS STR { if (target->t_header_digest != DIGEST_UNSPECIFIED) errx(1, "duplicated HeaderDigest at line %d", lineno + 1); @@ -220,7 +220,7 @@ header_digest_statement: HEADER_DIGEST E } ; -data_digest_statement: DATA_DIGEST EQUALS STR +data_digest: DATA_DIGEST EQUALS STR { if (target->t_data_digest != DIGEST_UNSPECIFIED) errx(1, "duplicated DataDigest at line %d", lineno + 1); @@ -234,7 +234,7 @@ data_digest_statement: DATA_DIGEST EQUAL } ; -session_type_statement: SESSION_TYPE EQUALS STR +session_type: SESSION_TYPE EQUALS STR { if (target->t_session_type != SESSION_TYPE_UNSPECIFIED) errx(1, "duplicated SessionType at line %d", lineno + 1); @@ -248,7 +248,7 @@ session_type_statement: SESSION_TYPE EQU } ; -protocol_statement: PROTOCOL EQUALS STR +protocol: PROTOCOL EQUALS STR { if (target->t_protocol != PROTOCOL_UNSPECIFIED) errx(1, "duplicated protocol at line %d", lineno + 1); @@ -262,7 +262,7 @@ protocol_statement: PROTOCOL EQUALS STR } ; -ignored_statement: IGNORED EQUALS STR +ignored: IGNORED EQUALS STR { warnx("obsolete statement ignored at line %d", lineno + 1); } From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 11:03:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2F92CE77; Thu, 6 Mar 2014 11:03: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1BB2A195; Thu, 6 Mar 2014 11:03: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 s26B3Yoi046833; Thu, 6 Mar 2014 11:03:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26B3YSL046832; Thu, 6 Mar 2014 11:03:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403061103.s26B3YSL046832@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Mar 2014 11:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262839 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 11:03:35 -0000 Author: trasz Date: Thu Mar 6 11:03:34 2014 New Revision: 262839 URL: http://svnweb.freebsd.org/changeset/base/262839 Log: MFC r261712: Remove unused variable. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/iscsictl/iscsictl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/iscsictl.c ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.c Thu Mar 6 11:02:32 2014 (r262838) +++ stable/10/usr.bin/iscsictl/iscsictl.c Thu Mar 6 11:03:34 2014 (r262839) @@ -381,7 +381,6 @@ kernel_list(int iscsi_fd, const struct t struct iscsi_session_list isl; unsigned int i, nentries = 1; int error; - bool show_periphs; for (;;) { states = realloc(states, @@ -455,7 +454,6 @@ kernel_list(int iscsi_fd, const struct t for (i = 0; i < isl.isl_nentries; i++) { state = &states[i]; conf = &state->iss_conf; - show_periphs = false; printf("%-36s %-16s ", conf->isc_target, conf->isc_target_addr); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 11:05:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EAB2E14D; Thu, 6 Mar 2014 11:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D65BE1B6; Thu, 6 Mar 2014 11:05: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 s26B5Zvs047242; Thu, 6 Mar 2014 11:05:35 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26B5Z27047241; Thu, 6 Mar 2014 11:05:35 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403061105.s26B5Z27047241@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Mar 2014 11:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262840 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 11:05:36 -0000 Author: trasz Date: Thu Mar 6 11:05:35 2014 New Revision: 262840 URL: http://svnweb.freebsd.org/changeset/base/262840 Log: MFC r261713: Simplify. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/iscsictl/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/parse.y ============================================================================== --- stable/10/usr.bin/iscsictl/parse.y Thu Mar 6 11:03:34 2014 (r262839) +++ stable/10/usr.bin/iscsictl/parse.y Thu Mar 6 11:05:35 2014 (r262840) @@ -123,7 +123,7 @@ target_entry: target_name: TARGET_NAME EQUALS STR { if (target->t_name != NULL) - errx(1, "duplicated TargetName at line %d", lineno + 1); + errx(1, "duplicated TargetName at line %d", lineno); target->t_name = $3; } ; @@ -131,7 +131,7 @@ target_name: TARGET_NAME EQUALS STR target_address: TARGET_ADDRESS EQUALS STR { if (target->t_address != NULL) - errx(1, "duplicated TargetAddress at line %d", lineno + 1); + errx(1, "duplicated TargetAddress at line %d", lineno); target->t_address = $3; } ; @@ -139,7 +139,7 @@ target_address: TARGET_ADDRESS EQUALS ST initiator_name: INITIATOR_NAME EQUALS STR { if (target->t_initiator_name != NULL) - errx(1, "duplicated InitiatorName at line %d", lineno + 1); + errx(1, "duplicated InitiatorName at line %d", lineno); target->t_initiator_name = $3; } ; @@ -147,7 +147,7 @@ initiator_name: INITIATOR_NAME EQUALS ST initiator_address: INITIATOR_ADDRESS EQUALS STR { if (target->t_initiator_address != NULL) - errx(1, "duplicated InitiatorAddress at line %d", lineno + 1); + errx(1, "duplicated InitiatorAddress at line %d", lineno); target->t_initiator_address = $3; } ; @@ -155,7 +155,7 @@ initiator_address: INITIATOR_ADDRESS EQU initiator_alias: INITIATOR_ALIAS EQUALS STR { if (target->t_initiator_alias != NULL) - errx(1, "duplicated InitiatorAlias at line %d", lineno + 1); + errx(1, "duplicated InitiatorAlias at line %d", lineno); target->t_initiator_alias = $3; } ; @@ -163,7 +163,7 @@ initiator_alias: INITIATOR_ALIAS EQUALS user: USER EQUALS STR { if (target->t_user != NULL) - errx(1, "duplicated chapIName at line %d", lineno + 1); + errx(1, "duplicated chapIName at line %d", lineno); target->t_user = $3; } ; @@ -171,7 +171,7 @@ user: USER EQUALS STR secret: SECRET EQUALS STR { if (target->t_secret != NULL) - errx(1, "duplicated chapSecret at line %d", lineno + 1); + errx(1, "duplicated chapSecret at line %d", lineno); target->t_secret = $3; } ; @@ -179,7 +179,7 @@ secret: SECRET EQUALS STR mutual_user: MUTUAL_USER EQUALS STR { if (target->t_mutual_user != NULL) - errx(1, "duplicated tgtChapName at line %d", lineno + 1); + errx(1, "duplicated tgtChapName at line %d", lineno); target->t_mutual_user = $3; } ; @@ -187,7 +187,7 @@ mutual_user: MUTUAL_USER EQUALS STR mutual_secret: MUTUAL_SECRET EQUALS STR { if (target->t_mutual_secret != NULL) - errx(1, "duplicated tgtChapSecret at line %d", lineno + 1); + errx(1, "duplicated tgtChapSecret at line %d", lineno); target->t_mutual_secret = $3; } ; @@ -195,76 +195,76 @@ mutual_secret: MUTUAL_SECRET EQUALS STR auth_method: AUTH_METHOD EQUALS STR { if (target->t_auth_method != AUTH_METHOD_UNSPECIFIED) - errx(1, "duplicated AuthMethod at line %d", lineno + 1); + errx(1, "duplicated AuthMethod at line %d", lineno); if (strcasecmp($3, "none") == 0) target->t_auth_method = AUTH_METHOD_NONE; else if (strcasecmp($3, "chap") == 0) target->t_auth_method = AUTH_METHOD_CHAP; else errx(1, "invalid AuthMethod at line %d; " - "must be either \"none\" or \"CHAP\"", lineno + 1); + "must be either \"none\" or \"CHAP\"", lineno); } ; header_digest: HEADER_DIGEST EQUALS STR { if (target->t_header_digest != DIGEST_UNSPECIFIED) - errx(1, "duplicated HeaderDigest at line %d", lineno + 1); + errx(1, "duplicated HeaderDigest at line %d", lineno); if (strcasecmp($3, "none") == 0) target->t_header_digest = DIGEST_NONE; else if (strcasecmp($3, "CRC32C") == 0) target->t_header_digest = DIGEST_CRC32C; else errx(1, "invalid HeaderDigest at line %d; " - "must be either \"none\" or \"CRC32C\"", lineno + 1); + "must be either \"none\" or \"CRC32C\"", lineno); } ; data_digest: DATA_DIGEST EQUALS STR { if (target->t_data_digest != DIGEST_UNSPECIFIED) - errx(1, "duplicated DataDigest at line %d", lineno + 1); + errx(1, "duplicated DataDigest at line %d", lineno); if (strcasecmp($3, "none") == 0) target->t_data_digest = DIGEST_NONE; else if (strcasecmp($3, "CRC32C") == 0) target->t_data_digest = DIGEST_CRC32C; else errx(1, "invalid DataDigest at line %d; " - "must be either \"none\" or \"CRC32C\"", lineno + 1); + "must be either \"none\" or \"CRC32C\"", lineno); } ; session_type: SESSION_TYPE EQUALS STR { if (target->t_session_type != SESSION_TYPE_UNSPECIFIED) - errx(1, "duplicated SessionType at line %d", lineno + 1); + errx(1, "duplicated SessionType at line %d", lineno); if (strcasecmp($3, "normal") == 0) target->t_session_type = SESSION_TYPE_NORMAL; else if (strcasecmp($3, "discovery") == 0) target->t_session_type = SESSION_TYPE_DISCOVERY; else errx(1, "invalid SessionType at line %d; " - "must be either \"normal\" or \"discovery\"", lineno + 1); + "must be either \"normal\" or \"discovery\"", lineno); } ; protocol: PROTOCOL EQUALS STR { if (target->t_protocol != PROTOCOL_UNSPECIFIED) - errx(1, "duplicated protocol at line %d", lineno + 1); + errx(1, "duplicated protocol at line %d", lineno); if (strcasecmp($3, "iscsi") == 0) target->t_protocol = PROTOCOL_ISCSI; else if (strcasecmp($3, "iser") == 0) target->t_protocol = PROTOCOL_ISER; else errx(1, "invalid protocol at line %d; " - "must be either \"iscsi\" or \"iser\"", lineno + 1); + "must be either \"iscsi\" or \"iser\"", lineno); } ; ignored: IGNORED EQUALS STR { - warnx("obsolete statement ignored at line %d", lineno + 1); + warnx("obsolete statement ignored at line %d", lineno); } ; @@ -275,7 +275,7 @@ yyerror(const char *str) { errx(1, "error in configuration file at line %d near '%s': %s", - lineno + 1, yytext, str); + lineno, yytext, str); } static void @@ -318,7 +318,7 @@ conf_new_from_file(const char *path) if (yyin == NULL) err(1, "unable to open configuration file %s", path); check_perms(path); - lineno = 0; + lineno = 1; yyrestart(yyin); error = yyparse(); assert(error == 0); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 11:07:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 804C82DF; Thu, 6 Mar 2014 11:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C3761E0; Thu, 6 Mar 2014 11:07: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 s26B7qgD047638; Thu, 6 Mar 2014 11:07:52 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26B7q2A047636; Thu, 6 Mar 2014 11:07:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403061107.s26B7q2A047636@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Mar 2014 11:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262841 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 11:07:52 -0000 Author: trasz Date: Thu Mar 6 11:07:51 2014 New Revision: 262841 URL: http://svnweb.freebsd.org/changeset/base/262841 Log: MFC r261714: Make iscsictl(8) properly handle (optional) semicolons in iscsi.conf, instead of ignoring them and echoing them to stdout. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/iscsictl/parse.y stable/10/usr.bin/iscsictl/token.l Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/parse.y ============================================================================== --- stable/10/usr.bin/iscsictl/parse.y Thu Mar 6 11:05:35 2014 (r262840) +++ stable/10/usr.bin/iscsictl/parse.y Thu Mar 6 11:07:51 2014 (r262841) @@ -57,7 +57,7 @@ extern void yyrestart(FILE *); %token AUTH_METHOD HEADER_DIGEST DATA_DIGEST TARGET_NAME TARGET_ADDRESS %token INITIATOR_NAME INITIATOR_ADDRESS INITIATOR_ALIAS USER SECRET -%token MUTUAL_USER MUTUAL_SECRET SESSION_TYPE PROTOCOL IGNORED +%token MUTUAL_USER MUTUAL_SECRET SEMICOLON SESSION_TYPE PROTOCOL IGNORED %token EQUALS OPENING_BRACKET CLOSING_BRACKET %union @@ -86,6 +86,8 @@ target: STR OPENING_BRACKET target_entr target_entries: | target_entries target_entry + | + target_entries target_entry SEMICOLON ; target_entry: Modified: stable/10/usr.bin/iscsictl/token.l ============================================================================== --- stable/10/usr.bin/iscsictl/token.l Thu Mar 6 11:05:35 2014 (r262840) +++ stable/10/usr.bin/iscsictl/token.l Thu Mar 6 11:07:51 2014 (r262841) @@ -87,7 +87,9 @@ chapDigest { return IGNORED; } \{ { return OPENING_BRACKET; } \} { return CLOSING_BRACKET; } = { return EQUALS; } +; { return SEMICOLON; } #.*$ /* ignore comments */; \n { lineno++; } [ \t]+ /* ignore whitespace */; +. { yylval.str = strdup(yytext); return STR; } %% From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 11:09:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 469884BD; Thu, 6 Mar 2014 11:09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3281C1EE; Thu, 6 Mar 2014 11:09: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 s26B9lGE047883; Thu, 6 Mar 2014 11:09:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26B9lMW047882; Thu, 6 Mar 2014 11:09:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403061109.s26B9lMW047882@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Mar 2014 11:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262842 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 11:09:47 -0000 Author: trasz Date: Thu Mar 6 11:09:46 2014 New Revision: 262842 URL: http://svnweb.freebsd.org/changeset/base/262842 Log: MFC r262247: Make it clear that there are two ways to add a session using iscsictl(8), and some options require configuration file. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/iscsictl/iscsictl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.8 Thu Mar 6 11:07:51 2014 (r262841) +++ stable/10/usr.bin/iscsictl/iscsictl.8 Thu Mar 6 11:09:46 2014 (r262842) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 4, 2014 +.Dd February 20, 2014 .Dt ISCSICTL 8 .Os .Sh NAME @@ -98,6 +98,21 @@ CHAP login. Verbose mode. .El .Pp +Certain parameters are neccessary when adding a session. +One can specify these either via command line (using the +.Fl t , +.Fl p , +.Fl u , +and +.Fl s +options), or configuration file (using the +.Fl a +or +.Fl n +options). +Some functionality - for example mutual CHAP - is available only +via configuration file. +.Pp Since connecting to the target is performed in background, non-zero exit status does not mean that the session was successfully established. Use From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 11:10:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D0D1163D; Thu, 6 Mar 2014 11:10: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD83F262; Thu, 6 Mar 2014 11:10: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 s26BAvZ2050468; Thu, 6 Mar 2014 11:10:57 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26BAvIe050467; Thu, 6 Mar 2014 11:10:57 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403061110.s26BAvIe050467@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Mar 2014 11:10:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262843 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 11:10:57 -0000 Author: trasz Date: Thu Mar 6 11:10:57 2014 New Revision: 262843 URL: http://svnweb.freebsd.org/changeset/base/262843 Log: MFC r262525: There is no need to prevent iscsictl from adding iSER session when there is no iSER support in ctld and/or kernel; should the user make that mistake, the output from "iscsictl -L" is enough to determine what the problem is. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/iscsictl/iscsictl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/iscsictl.c ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.c Thu Mar 6 11:09:46 2014 (r262842) +++ stable/10/usr.bin/iscsictl/iscsictl.c Thu Mar 6 11:10:57 2014 (r262843) @@ -242,11 +242,6 @@ conf_verify(struct conf *conf) } if (targ->t_protocol == PROTOCOL_UNSPECIFIED) targ->t_protocol = PROTOCOL_ISCSI; -#ifndef ICL_KERNEL_PROXY - if (targ->t_protocol == PROTOCOL_ISER) - errx(1, "iSER support requires ICL_KERNEL_PROXY; " - "see iscsi(4) for details"); -#endif if (targ->t_address == NULL) errx(1, "missing TargetAddress for target \"%s\"", targ->t_nickname); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 11:13:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7D9C5875; Thu, 6 Mar 2014 11:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69B93284; Thu, 6 Mar 2014 11:13: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 s26BDRqd051398; Thu, 6 Mar 2014 11:13:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26BDRT6051397; Thu, 6 Mar 2014 11:13:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403061113.s26BDRT6051397@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Mar 2014 11:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262844 - stable/10/usr.sbin/iscsid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 11:13:27 -0000 Author: trasz Date: Thu Mar 6 11:13:26 2014 New Revision: 262844 URL: http://svnweb.freebsd.org/changeset/base/262844 Log: MFC r261715: The log_whatever() routines don't accept NULL for format strings, so mark them as __printflike instead of __printf0like. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/iscsid/iscsid.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/iscsid/iscsid.h ============================================================================== --- stable/10/usr.sbin/iscsid/iscsid.h Thu Mar 6 11:10:57 2014 (r262843) +++ stable/10/usr.sbin/iscsid/iscsid.h Thu Mar 6 11:13:26 2014 (r262844) @@ -106,12 +106,12 @@ void log_init(int level); void log_set_peer_name(const char *name); void log_set_peer_addr(const char *addr); void log_err(int, const char *, ...) - __dead2 __printf0like(2, 3); + __dead2 __printflike(2, 3); void log_errx(int, const char *, ...) - __dead2 __printf0like(2, 3); -void log_warn(const char *, ...) __printf0like(1, 2); + __dead2 __printflike(2, 3); +void log_warn(const char *, ...) __printflike(1, 2); void log_warnx(const char *, ...) __printflike(1, 2); -void log_debugx(const char *, ...) __printf0like(1, 2); +void log_debugx(const char *, ...) __printflike(1, 2); char *checked_strdup(const char *); bool timed_out(void); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 11:14:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 27DCD9C4; Thu, 6 Mar 2014 11:14: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EDC7829B; Thu, 6 Mar 2014 11:14: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 s26BEa97051568; Thu, 6 Mar 2014 11:14:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26BEa3G051564; Thu, 6 Mar 2014 11:14:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403061114.s26BEa3G051564@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Mar 2014 11:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262845 - stable/10/usr.sbin/iscsid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 11:14:37 -0000 Author: trasz Date: Thu Mar 6 11:14:36 2014 New Revision: 262845 URL: http://svnweb.freebsd.org/changeset/base/262845 Log: MFC r261747: Empty data segment during Login Phase is rather unlikely, but it's not a protocol error. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/iscsid/discovery.c stable/10/usr.sbin/iscsid/keys.c stable/10/usr.sbin/iscsid/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/iscsid/discovery.c ============================================================================== --- stable/10/usr.sbin/iscsid/discovery.c Thu Mar 6 11:13:26 2014 (r262844) +++ stable/10/usr.sbin/iscsid/discovery.c Thu Mar 6 11:14:36 2014 (r262845) @@ -62,8 +62,6 @@ text_receive(struct connection *conn) */ if ((bhstr->bhstr_flags & BHSTR_FLAGS_CONTINUE) != 0) log_errx(1, "received Text PDU with unsupported \"C\" flag"); - if (response->pdu_data_len == 0) - log_errx(1, "received Text PDU with empty data segment"); if (ntohl(bhstr->bhstr_statsn) != conn->conn_statsn + 1) { log_errx(1, "received Text PDU with wrong StatSN: " "is %d, should be %d", ntohl(bhstr->bhstr_statsn), Modified: stable/10/usr.sbin/iscsid/keys.c ============================================================================== --- stable/10/usr.sbin/iscsid/keys.c Thu Mar 6 11:13:26 2014 (r262844) +++ stable/10/usr.sbin/iscsid/keys.c Thu Mar 6 11:14:36 2014 (r262845) @@ -65,7 +65,7 @@ keys_load(struct keys *keys, const struc size_t pair_len; if (pdu->pdu_data_len == 0) - log_errx(1, "protocol error: empty data segment"); + return; if (pdu->pdu_data[pdu->pdu_data_len - 1] != '\0') log_errx(1, "protocol error: key not NULL-terminated\n"); Modified: stable/10/usr.sbin/iscsid/login.c ============================================================================== --- stable/10/usr.sbin/iscsid/login.c Thu Mar 6 11:13:26 2014 (r262844) +++ stable/10/usr.sbin/iscsid/login.c Thu Mar 6 11:14:36 2014 (r262845) @@ -189,10 +189,6 @@ login_receive(struct connection *conn, b fail(conn, errorstr); log_errx(1, "target returned error: %s", errorstr); } -#if 0 - if (response->pdu_data_len == 0) - log_errx(1, "received Login PDU with empty data segment"); -#endif if (initial == false && ntohl(bhslr->bhslr_statsn) != conn->conn_statsn + 1) { /* From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 11:15:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2426BB5B; Thu, 6 Mar 2014 11:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 10ADB2B0; Thu, 6 Mar 2014 11:15: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 s26BFs8p051786; Thu, 6 Mar 2014 11:15:54 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26BFsUP051785; Thu, 6 Mar 2014 11:15:54 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403061115.s26BFsUP051785@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Mar 2014 11:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262846 - stable/10/usr.sbin/iscsid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 11:15:55 -0000 Author: trasz Date: Thu Mar 6 11:15:54 2014 New Revision: 262846 URL: http://svnweb.freebsd.org/changeset/base/262846 Log: MFC r261748: So, it turns out SIGCHLD is discarded by default, so we have to set up a dummy handler to make it interrupt an ioctl(2) or select(2). This makes those short-lived iscsid(8) zombies disappear. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/iscsid/iscsid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/iscsid/iscsid.c ============================================================================== --- stable/10/usr.sbin/iscsid/iscsid.c Thu Mar 6 11:14:36 2014 (r262845) +++ stable/10/usr.sbin/iscsid/iscsid.c Thu Mar 6 11:15:54 2014 (r262846) @@ -394,6 +394,32 @@ set_timeout(int timeout) } static void +sigchld_handler(int dummy __unused) +{ + + /* + * The only purpose of this handler is to make SIGCHLD + * interrupt the ISCSIDWAIT ioctl(2), so we can call + * wait_for_children(). + */ +} + +static void +register_sigchld(void) +{ + struct sigaction sa; + int error; + + bzero(&sa, sizeof(sa)); + sa.sa_handler = sigchld_handler; + sigfillset(&sa.sa_mask); + error = sigaction(SIGCHLD, &sa, NULL); + if (error != 0) + log_err(1, "sigaction"); + +} + +static void handle_request(int iscsi_fd, const struct iscsi_daemon_request *request, int timeout) { struct connection *conn; @@ -522,6 +548,8 @@ main(int argc, char **argv) pidfile_write(pidfh); + register_sigchld(); + for (;;) { log_debugx("waiting for request from the kernel"); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 13:15:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 22A956C3; Thu, 6 Mar 2014 13:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E8E4811F; Thu, 6 Mar 2014 13:15: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 s26DFrYp001222; Thu, 6 Mar 2014 13:15:53 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26DFrPw001219; Thu, 6 Mar 2014 13:15:53 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403061315.s26DFrPw001219@svn.freebsd.org> From: Christian Brueffer Date: Thu, 6 Mar 2014 13:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262848 - stable/10/sys/dev/etherswitch/ip17x X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 13:15:54 -0000 Author: brueffer Date: Thu Mar 6 13:15:53 2014 New Revision: 262848 URL: http://svnweb.freebsd.org/changeset/base/262848 Log: MFC: r262571 Add missing includes and remove two unused ones. Reviewed by: loos Modified: stable/10/sys/dev/etherswitch/ip17x/ip17x.c stable/10/sys/dev/etherswitch/ip17x/ip17x_phy.c stable/10/sys/dev/etherswitch/ip17x/ip17x_vlans.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/etherswitch/ip17x/ip17x.c ============================================================================== --- stable/10/sys/dev/etherswitch/ip17x/ip17x.c Thu Mar 6 12:37:25 2014 (r262847) +++ stable/10/sys/dev/etherswitch/ip17x/ip17x.c Thu Mar 6 13:15:53 2014 (r262848) @@ -32,18 +32,21 @@ #include #include #include +#include +#include #include +#include #include #include #include #include +#include #include -#include #include -#include #include #include +#include #include #include Modified: stable/10/sys/dev/etherswitch/ip17x/ip17x_phy.c ============================================================================== --- stable/10/sys/dev/etherswitch/ip17x/ip17x_phy.c Thu Mar 6 12:37:25 2014 (r262847) +++ stable/10/sys/dev/etherswitch/ip17x/ip17x_phy.c Thu Mar 6 13:15:53 2014 (r262848) @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include Modified: stable/10/sys/dev/etherswitch/ip17x/ip17x_vlans.c ============================================================================== --- stable/10/sys/dev/etherswitch/ip17x/ip17x_vlans.c Thu Mar 6 12:37:25 2014 (r262847) +++ stable/10/sys/dev/etherswitch/ip17x/ip17x_vlans.c Thu Mar 6 13:15:53 2014 (r262848) @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 13:20:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0139F9FE; Thu, 6 Mar 2014 13:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCD9D178; Thu, 6 Mar 2014 13:20: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 s26DKgvt001905; Thu, 6 Mar 2014 13:20:42 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26DKc5L001883; Thu, 6 Mar 2014 13:20:38 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403061320.s26DKc5L001883@svn.freebsd.org> From: Julio Merino Date: Thu, 6 Mar 2014 13:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262849 - in stable/10: . contrib/atf contrib/atf/atf-c contrib/atf/atf-c++ contrib/atf/atf-c++/detail contrib/atf/atf-sh etc/mtree lib/atf lib/atf/libatf-c lib/atf/libatf-c++ lib/atf/l... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 13:20:43 -0000 Author: jmmv Date: Thu Mar 6 13:20:38 2014 New Revision: 262849 URL: http://svnweb.freebsd.org/changeset/base/262849 Log: MFC various fixes for the ATF tests. - r260505 Allow tests to provide a Kyuafile when they relied on auto-generation. - r260525 Respect the original layout of the atf-{c,c++} tests. - r260526 Fix path to the process_helpers for the libatf-c++ tests. - r260576 Generate and install pkg-config files for atf. - r260577 Add atf pkg-config files from the vendor branch. - r260584 Prevent misc_helpers from running as a test. Added: stable/10/contrib/atf/atf-c++/atf-c++.pc.in - copied unchanged from r260577, head/contrib/atf/atf-c++/atf-c++.pc.in stable/10/contrib/atf/atf-c/atf-c.pc.in - copied unchanged from r260577, head/contrib/atf/atf-c/atf-c.pc.in stable/10/contrib/atf/atf-sh/atf-sh.pc.in - copied unchanged from r260577, head/contrib/atf/atf-sh/atf-sh.pc.in stable/10/lib/atf/common.mk - copied unchanged from r260576, head/lib/atf/common.mk stable/10/lib/atf/libatf-c++/tests/Makefile.inc - copied unchanged from r260525, head/lib/atf/libatf-c++/tests/Makefile.inc stable/10/lib/atf/libatf-c++/tests/detail/ - copied from r260525, head/lib/atf/libatf-c++/tests/detail/ stable/10/lib/atf/libatf-c/tests/Makefile.inc - copied unchanged from r260525, head/lib/atf/libatf-c/tests/Makefile.inc stable/10/lib/atf/libatf-c/tests/detail/ - copied from r260525, head/lib/atf/libatf-c/tests/detail/ Modified: stable/10/UPDATING stable/10/contrib/atf/FREEBSD-Xlist stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp stable/10/etc/mtree/BSD.tests.dist stable/10/lib/atf/Makefile.inc stable/10/lib/atf/libatf-c++/Makefile stable/10/lib/atf/libatf-c++/tests/Makefile stable/10/lib/atf/libatf-c/Makefile stable/10/lib/atf/libatf-c/tests/Makefile stable/10/share/mk/bsd.test.mk stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.bin/atf/atf-sh/Makefile stable/10/usr.bin/atf/atf-sh/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/UPDATING Thu Mar 6 13:20:38 2014 (r262849) @@ -17,6 +17,14 @@ stable/10, and then rebuild without this older version of current is a bit fragile. +20140306: + If a Makefile in a tests/ directory was auto-generating a Kyuafile + instead of providing an explicit one, this would prevent such + Makefile from providing its own Kyuafile in the future during + NO_CLEAN builds. This has been fixed in the Makefiles but manual + intervention is needed to clean an objdir if you use NO_CLEAN: + # find /usr/obj -name Kyuafile | xargs rm -f + 20140303: OpenSSH will now ignore errors caused by kernel lacking of Capsicum capability mode support. Please note that enabling the feature in Modified: stable/10/contrib/atf/FREEBSD-Xlist ============================================================================== --- stable/10/contrib/atf/FREEBSD-Xlist Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/contrib/atf/FREEBSD-Xlist Thu Mar 6 13:20:38 2014 (r262849) @@ -8,7 +8,6 @@ Makefile* aclocal.m4 admin/ atf-*/atf-*.m4 -atf-*/atf-*.pc.in atf-config/ atf-report/ atf-run/ Copied: stable/10/contrib/atf/atf-c++/atf-c++.pc.in (from r260577, head/contrib/atf/atf-c++/atf-c++.pc.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/atf/atf-c++/atf-c++.pc.in Thu Mar 6 13:20:38 2014 (r262849, copy of r260577, head/contrib/atf/atf-c++/atf-c++.pc.in) @@ -0,0 +1,11 @@ +# ATF pkg-config file + +cxx=__CXX__ +includedir=__INCLUDEDIR__ +libdir=__LIBDIR__ + +Name: atf-c++ +Description: Automated Testing Framework (C++ binding) +Version: __ATF_VERSION__ +Cflags: -I${includedir} +Libs: -L${libdir} -latf-c++ -latf-c Modified: stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp ============================================================================== --- stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp Thu Mar 6 13:20:38 2014 (r262849) @@ -40,6 +40,18 @@ #include "process.hpp" #include "test_helpers.hpp" +// Path to the directory containing the libatf-c tests, used to locate the +// process_helpers program. If NULL (the default), the code will use a +// relative path. Otherwise, the provided path will be used; this is so +// that we can locate the helpers binary if the installation uses a +// different layout than the one we provide (as is the case in FreeBSD). +#if defined(ATF_C_TESTS_BASE) +static const char* atf_c_tests_base = ATF_C_TESTS_BASE; +#else +static const char* atf_c_tests_base = NULL; +#endif +#undef ATF_C_TESTS_BASE + void build_check_cxx_o_aux(const atf::fs::path& sfile, const char* failmsg, const bool expect_pass) @@ -80,12 +92,17 @@ header_check(const char *hdrname) atf::fs::path get_process_helpers_path(const atf::tests::tc& tc, bool is_detail) { - if (is_detail) - return atf::fs::path(tc.get_config_var("srcdir")) / - ".." / ".." / "atf-c" / "detail" / "process_helpers"; - else - return atf::fs::path(tc.get_config_var("srcdir")) / - ".." / "atf-c" / "detail" / "process_helpers"; + const char* helper = "detail/process_helpers"; + if (atf_c_tests_base == NULL) { + if (is_detail) + return atf::fs::path(tc.get_config_var("srcdir")) / + ".." / ".." / "atf-c" / helper; + else + return atf::fs::path(tc.get_config_var("srcdir")) / + ".." / "atf-c" / helper; + } else { + return atf::fs::path(atf_c_tests_base) / helper; + } } void Copied: stable/10/contrib/atf/atf-c/atf-c.pc.in (from r260577, head/contrib/atf/atf-c/atf-c.pc.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/atf/atf-c/atf-c.pc.in Thu Mar 6 13:20:38 2014 (r262849, copy of r260577, head/contrib/atf/atf-c/atf-c.pc.in) @@ -0,0 +1,11 @@ +# ATF pkg-config file + +cc=__CC__ +includedir=__INCLUDEDIR__ +libdir=__LIBDIR__ + +Name: atf-c +Description: Automated Testing Framework (C binding) +Version: __ATF_VERSION__ +Cflags: -I${includedir} +Libs: -L${libdir} -latf-c Copied: stable/10/contrib/atf/atf-sh/atf-sh.pc.in (from r260577, head/contrib/atf/atf-sh/atf-sh.pc.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/atf/atf-sh/atf-sh.pc.in Thu Mar 6 13:20:38 2014 (r262849, copy of r260577, head/contrib/atf/atf-sh/atf-sh.pc.in) @@ -0,0 +1,8 @@ +# ATF pkg-config file + +exec_prefix=__EXEC_PREFIX__ +interpreter=${exec_prefix}/bin/atf-sh + +Name: atf-sh +Description: Automated Testing Framework (POSIX shell binding) +Version: __ATF_VERSION__ Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/etc/mtree/BSD.tests.dist Thu Mar 6 13:20:38 2014 (r262849) @@ -23,8 +23,12 @@ lib atf libatf-c + detail + .. .. libatf-c++ + detail + .. .. test-programs .. Modified: stable/10/lib/atf/Makefile.inc ============================================================================== --- stable/10/lib/atf/Makefile.inc Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/lib/atf/Makefile.inc Thu Mar 6 13:20:38 2014 (r262849) @@ -38,6 +38,7 @@ CFLAGS+= -DATF_BUILD_CPPFLAGS='"${_CPPFL CFLAGS+= -DATF_BUILD_CXX='"${CXX}"' CFLAGS+= -DATF_BUILD_CXXFLAGS='"${_CXXFLAGS}"' CFLAGS+= -DATF_CONFDIR='"${CONFDIR}/atf"' +CFLAGS+= -DATF_C_TESTS_BASE='"${TESTSBASE}/lib/atf/libatf-c"' CFLAGS+= -DATF_INCLUDEDIR='"${INCLUDEDIR}"' CFLAGS+= -DATF_LIBDIR='"${LIBDIR}"' CFLAGS+= -DATF_LIBEXECDIR='"${LIBEXECDIR}"' Copied: stable/10/lib/atf/common.mk (from r260576, head/lib/atf/common.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/atf/common.mk Thu Mar 6 13:20:38 2014 (r262849, copy of r260576, head/lib/atf/common.mk) @@ -0,0 +1,19 @@ +# $FreeBSD$ +# +# Common Makefile code for all components of ATF. +# + +.if !defined(ATF) +.error "ATF must be defined and point to the contrib/atf directory" +.endif + +# Depend on the atf-version target to generate a file that contains the +# version number of the currently imported ATF release and that only +# changes on new imports. +atf-version: atf-version-real + @cmp -s atf-version atf-version-real \ + || cp atf-version-real atf-version +atf-version-real: .PHONY + @grep 'define VERSION' ${ATF}/bconfig.h \ + | cut -d '"' -f 2 >atf-version-real +CLEANFILES+= atf-version atf-version-real Modified: stable/10/lib/atf/libatf-c++/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c++/Makefile Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/lib/atf/libatf-c++/Makefile Thu Mar 6 13:20:38 2014 (r262849) @@ -76,8 +76,21 @@ INCSDIR_atf-c++.hpp= ${INCLUDEDIR} MAN= atf-c++-api.3 +all: atf-c++.pc +atf-c++.pc: atf-c++.pc.in atf-version + sed -e 's,__CXX__,${CXX},g' \ + -e 's,__INCLUDEDIR__,${INCLUDEDIR},g' \ + -e 's,__LIBDIR__,${LIBDIR},g' \ + -e "s,__ATF_VERSION__,$$(cat atf-version),g" \ + <${ATF}/atf-c++/atf-c++.pc.in >atf-c++.pc + +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + atf-c++.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + .if ${MK_TESTS} != "no" SUBDIR= tests .endif +.include "../common.mk" .include Modified: stable/10/lib/atf/libatf-c++/tests/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c++/tests/Makefile Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/lib/atf/libatf-c++/tests/Makefile Thu Mar 6 13:20:38 2014 (r262849) @@ -3,6 +3,7 @@ .include TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c++ +TESTS_SUBDIRS= detail ATF= ${.CURDIR:H:H:H:H}/contrib/atf .PATH: ${ATF}/atf-c++ @@ -14,7 +15,6 @@ FILESDIR= ${TESTSDIR} FILES= macros_hpp_test.cpp FILES+= unused_test.cpp -# Tests in atf-c++. .for _T in atf_c++_test \ build_test \ check_test \ @@ -28,20 +28,4 @@ SRCS.${_T}= ${_T}.cpp test_helpers.cpp ATF_TESTS_SH= pkg_config_test -# Tests in atf-c++/detail. - -.for _T in application_test \ - env_test \ - exceptions_test \ - expand_test \ - fs_test \ - parser_test \ - process_test \ - sanity_test \ - text_test \ - ui_test -ATF_TESTS_CXX+= ${_T} -SRCS.${_T}= ${_T}.cpp test_helpers.cpp -.endfor - .include Copied: stable/10/lib/atf/libatf-c++/tests/Makefile.inc (from r260525, head/lib/atf/libatf-c++/tests/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/atf/libatf-c++/tests/Makefile.inc Thu Mar 6 13:20:38 2014 (r262849, copy of r260525, head/lib/atf/libatf-c++/tests/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: stable/10/lib/atf/libatf-c/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c/Makefile Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/lib/atf/libatf-c/Makefile Thu Mar 6 13:20:38 2014 (r262849) @@ -74,8 +74,21 @@ INCSDIR_atf-c.h= ${INCLUDEDIR} MAN= atf-c-api.3 +all: atf-c.pc +atf-c.pc: atf-c.pc.in atf-version + sed -e 's,__CC__,${CC},g' \ + -e 's,__INCLUDEDIR__,${INCLUDEDIR},g' \ + -e 's,__LIBDIR__,${LIBDIR},g' \ + -e "s,__ATF_VERSION__,$$(cat atf-version),g" \ + <${ATF}/atf-c/atf-c.pc.in >atf-c.pc + +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + atf-c.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + .if ${MK_TESTS} != "no" SUBDIR= tests .endif +.include "../common.mk" .include Modified: stable/10/lib/atf/libatf-c/tests/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c/tests/Makefile Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/lib/atf/libatf-c/tests/Makefile Thu Mar 6 13:20:38 2014 (r262849) @@ -3,6 +3,7 @@ .include TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c +TESTS_SUBDIRS= detail ATF= ${.CURDIR:H:H:H:H}/contrib/atf .PATH: ${ATF}/atf-c @@ -19,8 +20,6 @@ FILESDIR= ${TESTSDIR} FILES= macros_h_test.c FILES+= unused_test.c -# Tests in atf-c. - .for _T in atf_c_test \ build_test \ check_test \ @@ -36,24 +35,4 @@ SRCS.${_T}= ${_T}.c test_helpers.c ATF_TESTS_SH= pkg_config_test -# Tests in atf-c/detail. - -.for _T in dynstr_test \ - env_test \ - fs_test \ - list_test \ - map_test \ - process_test \ - sanity_test \ - text_test \ - user_test -ATF_TESTS_C+= ${_T} -SRCS.${_T}= ${_T}.c test_helpers.c -.endfor - -PROGS+= process_helpers -SRCS.process_helpers= process_helpers.c -MAN.process_helpers= # defined -BINDIR.process_helpers= ${TESTSDIR} - .include Copied: stable/10/lib/atf/libatf-c/tests/Makefile.inc (from r260525, head/lib/atf/libatf-c/tests/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/atf/libatf-c/tests/Makefile.inc Thu Mar 6 13:20:38 2014 (r262849, copy of r260525, head/lib/atf/libatf-c/tests/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: stable/10/share/mk/bsd.test.mk ============================================================================== --- stable/10/share/mk/bsd.test.mk Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/share/mk/bsd.test.mk Thu Mar 6 13:20:38 2014 (r262849) @@ -79,14 +79,20 @@ WITHOUT_MAN=yes PROG_VARS+= BINDIR PROGS_TARGETS+= install -.if ${KYUAFILE:tl} != "no" +.if ${KYUAFILE:tl} == "yes" FILES+= Kyuafile FILESDIR_Kyuafile= ${TESTSDIR} -.if ${KYUAFILE:tl} == "auto" -CLEANFILES+= Kyuafile Kyuafile.tmp +CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp +.elif ${KYUAFILE:tl} == "auto" +FILES+= Kyuafile.auto +FILESDIR_Kyuafile.auto= ${TESTSDIR} +FILESNAME_Kyuafile.auto= Kyuafile -Kyuafile: Makefile +CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp + +.NOPATH: Kyuafile.auto +Kyuafile.auto: Makefile @{ \ echo '-- Automatically generated by bsd.test.mk.'; \ echo; \ @@ -94,16 +100,15 @@ Kyuafile: Makefile echo; \ echo 'test_suite("${TESTSUITE}")'; \ echo; \ - } >Kyuafile.tmp + } >Kyuafile.auto.tmp .for _T in ${_TESTS} @echo "${TEST_INTERFACE.${_T}}_test_program{name=\"${_T}\"}" \ - >>Kyuafile.tmp + >>Kyuafile.auto.tmp .endfor .for _T in ${TESTS_SUBDIRS:N.WAIT} - @echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.tmp + @echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.auto.tmp .endfor - @mv Kyuafile.tmp Kyuafile -.endif + @mv Kyuafile.auto.tmp Kyuafile.auto .endif KYUA?= ${KYUA_PREFIX}/bin/kyua Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Thu Mar 6 13:20:38 2014 (r262849) @@ -4102,6 +4102,26 @@ OLD_FILES+=usr/share/man/man8/telnetd.8. .if ${MK_TESTS} == yes OLD_FILES+=usr/tests/lib/atf/libatf-c/test_helpers_test OLD_FILES+=usr/tests/lib/atf/test-programs/fork_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/application_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/env_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/exceptions_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/expand_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/fs_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/parser_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/process_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/sanity_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/text_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/ui_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/dynstr_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/env_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/fs_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/list_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/map_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/process_helpers +OLD_FILES+=usr/tests/lib/atf/libatf-c/process_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/sanity_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/text_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/user_test .else # ATF libraries. OLD_FILES+=usr/bin/atf-sh Modified: stable/10/usr.bin/atf/atf-sh/Makefile ============================================================================== --- stable/10/usr.bin/atf/atf-sh/Makefile Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/usr.bin/atf/atf-sh/Makefile Thu Mar 6 13:20:38 2014 (r262849) @@ -45,8 +45,19 @@ FILESGROUPS= SUBR SUBRDIR= ${SHAREDIR}/atf SUBR= libatf-sh.subr +all: atf-sh.pc +atf-sh.pc: atf-sh.pc.in atf-version + sed -e 's,__EXEC_PREFIX__,/usr,g' \ + -e "s,__ATF_VERSION__,$$(cat atf-version),g" \ + <${ATF}/atf-sh/atf-sh.pc.in >atf-sh.pc + +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + atf-sh.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + .if ${MK_TESTS} != "no" SUBDIR+= tests .endif +.include "../../../lib/atf/common.mk" .include Modified: stable/10/usr.bin/atf/atf-sh/tests/Makefile ============================================================================== --- stable/10/usr.bin/atf/atf-sh/tests/Makefile Thu Mar 6 13:15:53 2014 (r262848) +++ stable/10/usr.bin/atf/atf-sh/tests/Makefile Thu Mar 6 13:20:38 2014 (r262849) @@ -10,9 +10,17 @@ ATF= ${.CURDIR:H:H:H:H}/contrib/atf ATF_TESTS_SH+= atf_check_test ATF_TESTS_SH+= config_test ATF_TESTS_SH+= integration_test -ATF_TESTS_SH+= misc_helpers ATF_TESTS_SH+= normalize_test ATF_TESTS_SH+= tc_test ATF_TESTS_SH+= tp_test +SCRIPTS+= misc_helpers +SCRIPTSDIR_misc_helpers=${TESTSDIR} +CLEANFILES+= misc_helpers misc_helpers.tmp +misc_helpers: misc_helpers.sh + echo '#! /usr/bin/atf-sh' >${.TARGET}.tmp + cat ${.ALLSRC} >>${.TARGET}.tmp + chmod +x ${.TARGET}.tmp + mv ${.TARGET}.tmp ${.TARGET} + .include From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 13:24:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 383DCC9C; Thu, 6 Mar 2014 13:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24F27233; Thu, 6 Mar 2014 13:24: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 s26DOqWk005297; Thu, 6 Mar 2014 13:24:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26DOq4r005296; Thu, 6 Mar 2014 13:24:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403061324.s26DOq4r005296@svn.freebsd.org> From: Alexander Motin Date: Thu, 6 Mar 2014 13:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262850 - stable/10/sys/dev/mps X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 13:24:52 -0000 Author: mav Date: Thu Mar 6 13:24:51 2014 New Revision: 262850 URL: http://svnweb.freebsd.org/changeset/base/262850 Log: MFC r262553: Pass proper pointer to bus_dmamem_free() in mps_iocfacts_free(). Passing there pointer into the middle of allocated area caused kernel panic during reinit, for example, after firmware upgrade. Modified: stable/10/sys/dev/mps/mps.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mps/mps.c ============================================================================== --- stable/10/sys/dev/mps/mps.c Thu Mar 6 13:20:38 2014 (r262849) +++ stable/10/sys/dev/mps/mps.c Thu Mar 6 13:24:51 2014 (r262850) @@ -617,8 +617,8 @@ mps_iocfacts_free(struct mps_softc *sc) if (sc->post_busaddr != 0) bus_dmamap_unload(sc->queues_dmat, sc->queues_map); - if (sc->post_queue != NULL) - bus_dmamem_free(sc->queues_dmat, sc->post_queue, + if (sc->free_queue != NULL) + bus_dmamem_free(sc->queues_dmat, sc->free_queue, sc->queues_map); if (sc->queues_dmat != NULL) bus_dma_tag_destroy(sc->queues_dmat); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 13:30:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CEA5429A; Thu, 6 Mar 2014 13:30: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA39A27A; Thu, 6 Mar 2014 13:30: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 s26DUa9M007881; Thu, 6 Mar 2014 13:30:36 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26DUaO3007879; Thu, 6 Mar 2014 13:30:36 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403061330.s26DUaO3007879@svn.freebsd.org> From: Julio Merino Date: Thu, 6 Mar 2014 13:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262852 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 13:30:37 -0000 Author: jmmv Date: Thu Mar 6 13:30:36 2014 New Revision: 262852 URL: http://svnweb.freebsd.org/changeset/base/262852 Log: MFC a couple of improvements to the test suite mk files. - r260632 Support defining test program metadata from the Makefiles. - r260633 Support perl-based TAP-compliant test programs. Modified: stable/10/share/mk/bsd.test.mk stable/10/share/mk/tap.test.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.test.mk ============================================================================== --- stable/10/share/mk/bsd.test.mk Thu Mar 6 13:25:21 2014 (r262851) +++ stable/10/share/mk/bsd.test.mk Thu Mar 6 13:30:36 2014 (r262852) @@ -41,6 +41,20 @@ TESTS_SUBDIRS?= # If 'no', no Kyuafile is installed. KYUAFILE?= auto +# Per-test program interface definition. +# +# The name provided here must match one of the interface names supported by +# Kyua as this is later encoded in the Kyuafile test program definitions. +#TEST_INTERFACE.= interface-name + +# Per-test program metadata properties as a list of key/value pairs. +# +# All the variables for a particular program are appended to the program's +# definition in the Kyuafile. This feature can be used to avoid having to +# explicitly supply a Kyuafile in the source directory, allowing the caller +# Makefile to rely on the KYUAFILE=auto behavior defined here. +#TEST_METADATA.+= key="value" + # List of variables to pass to the tests at run-time via the environment. TESTS_ENV?= @@ -102,7 +116,7 @@ Kyuafile.auto: Makefile echo; \ } >Kyuafile.auto.tmp .for _T in ${_TESTS} - @echo "${TEST_INTERFACE.${_T}}_test_program{name=\"${_T}\"}" \ + @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ >>Kyuafile.auto.tmp .endfor .for _T in ${TESTS_SUBDIRS:N.WAIT} Modified: stable/10/share/mk/tap.test.mk ============================================================================== --- stable/10/share/mk/tap.test.mk Thu Mar 6 13:25:21 2014 (r262851) +++ stable/10/share/mk/tap.test.mk Thu Mar 6 13:30:36 2014 (r262852) @@ -18,8 +18,12 @@ # manpage. TAP_TESTS_C?= TAP_TESTS_CXX?= +TAP_TESTS_PERL?= TAP_TESTS_SH?= +# Perl interpreter to use for test programs written in this language. +TAP_PERL_INTERPRETER?= /usr/local/bin/perl + .if !empty(TAP_TESTS_C) PROGS+= ${TAP_TESTS_C} _TESTS+= ${TAP_TESTS_C} @@ -42,6 +46,29 @@ TEST_INTERFACE.${_T}= tap .endfor .endif +.if !empty(TAP_TESTS_PERL) +SCRIPTS+= ${TAP_TESTS_PERL} +_TESTS+= ${TAP_TESTS_PERL} +.for _T in ${TAP_TESTS_PERL} +SCRIPTSDIR_${_T}= ${TESTSDIR} +TEST_INTERFACE.${_T}= tap +TEST_METADATA.${_T}+= required_programs="${TAP_PERL_INTERPRETER}" +CLEANFILES+= ${_T} ${_T}.tmp +# TODO(jmmv): It seems to me that this SED and SRC functionality should +# exist in bsd.prog.mk along the support for SCRIPTS. Move it there if +# this proves to be useful within the tests. +TAP_TESTS_PERL_SED_${_T}?= # empty +TAP_TESTS_PERL_SRC_${_T}?= ${_T}.pl +${_T}: ${TAP_TESTS_PERL_SRC_${_T}} + { \ + echo '#! ${TAP_PERL_INTERPRETER}'; \ + cat ${.ALLSRC} | sed ${TAP_TESTS_PERL_SED_${_T}}; \ + } >${.TARGET}.tmp + chmod +x ${.TARGET}.tmp + mv ${.TARGET}.tmp ${.TARGET} +.endfor +.endif + .if !empty(TAP_TESTS_SH) SCRIPTS+= ${TAP_TESTS_SH} _TESTS+= ${TAP_TESTS_SH} From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 13:37:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D8AD6687; Thu, 6 Mar 2014 13:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C5282373; Thu, 6 Mar 2014 13:37: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 s26DbY5V010056; Thu, 6 Mar 2014 13:37:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26DbYWZ010055; Thu, 6 Mar 2014 13:37:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403061337.s26DbYWZ010055@svn.freebsd.org> From: Alexander Motin Date: Thu, 6 Mar 2014 13:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262853 - stable/10/sys/dev/mps X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 13:37:35 -0000 Author: mav Date: Thu Mar 6 13:37:34 2014 New Revision: 262853 URL: http://svnweb.freebsd.org/changeset/base/262853 Log: MFC r262575: Restore SIM freeze/release match, broken at r253549. This fixes problem with SIM left in frozen state after reinit, for example, after firmware update. Modified: stable/10/sys/dev/mps/mps_sas.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mps/mps_sas.c ============================================================================== --- stable/10/sys/dev/mps/mps_sas.c Thu Mar 6 13:30:36 2014 (r262852) +++ stable/10/sys/dev/mps/mps_sas.c Thu Mar 6 13:37:34 2014 (r262853) @@ -180,6 +180,9 @@ mpssas_startup_increment(struct mpssas_s /* just starting, freeze the simq */ mps_dprint(sassc->sc, MPS_INIT, "%s freezing simq\n", __func__); +#if __FreeBSD_version >= 1000039 + xpt_hold_boot(); +#endif xpt_freeze_simq(sassc->sim, 1); } mps_dprint(sassc->sc, MPS_INIT, "%s refcount %u\n", __func__, @@ -200,10 +203,10 @@ mpssas_startup_decrement(struct mpssas_s mps_dprint(sassc->sc, MPS_INIT, "%s releasing simq\n", __func__); sassc->flags &= ~MPSSAS_IN_STARTUP; + xpt_release_simq(sassc->sim, 1); #if __FreeBSD_version >= 1000039 xpt_release_boot(); #else - xpt_release_simq(sassc->sim, 1); mpssas_rescan_target(sassc->sc, NULL); #endif } @@ -763,12 +766,8 @@ mps_attach_sas(struct mps_softc *sc) * Hold off boot until discovery is complete. */ sassc->flags |= MPSSAS_IN_STARTUP | MPSSAS_IN_DISCOVERY; -#if __FreeBSD_version >= 1000039 - xpt_hold_boot(); -#else - xpt_freeze_simq(sassc->sim, 1); -#endif sc->sassc->startup_refcount = 0; + mpssas_startup_increment(sassc); callout_init(&sassc->discovery_callout, 1 /*mpsafe*/); sassc->discovery_timeouts = 0; @@ -1139,7 +1138,7 @@ mpssas_handle_reinit(struct mps_softc *s mps_dprint(sc, MPS_INIT, "%s startup\n", __func__); sc->sassc->flags |= MPSSAS_IN_STARTUP; sc->sassc->flags |= MPSSAS_IN_DISCOVERY; - xpt_freeze_simq(sc->sassc->sim, 1); + mpssas_startup_increment(sc->sassc); /* notify CAM of a bus reset */ mpssas_announce_reset(sc, AC_BUS_RESET, CAM_TARGET_WILDCARD, @@ -1152,12 +1151,6 @@ mpssas_handle_reinit(struct mps_softc *s "%s startup %u tm %u after command completion\n", __func__, sc->sassc->startup_refcount, sc->sassc->tm_count); - /* - * The simq was explicitly frozen above, so set the refcount to 0. - * The simq will be explicitly released after port enable completes. - */ - sc->sassc->startup_refcount = 0; - /* zero all the target handles, since they may change after the * reset, and we have to rediscover all the targets and use the new * handles. @@ -3461,15 +3454,12 @@ mpssas_read_cap_done(struct cam_periph * int mpssas_startup(struct mps_softc *sc) { - struct mpssas_softc *sassc; /* * Send the port enable message and set the wait_for_port_enable flag. * This flag helps to keep the simq frozen until all discovery events * are processed. */ - sassc = sc->sassc; - mpssas_startup_increment(sassc); sc->wait_for_port_enable = 1; mpssas_send_portenable(sc); return (0); @@ -3554,7 +3544,6 @@ mpssas_portenable_complete(struct mps_so sc->port_enable_complete = 1; wakeup(&sc->port_enable_complete); mpssas_startup_decrement(sassc); - xpt_release_simq(sassc->sim, 1); } int From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 13:38:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D93498A9; Thu, 6 Mar 2014 13:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C6500381; Thu, 6 Mar 2014 13:38: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 s26DcNPa010198; Thu, 6 Mar 2014 13:38:23 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26DcNr6010197; Thu, 6 Mar 2014 13:38:23 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403061338.s26DcNr6010197@svn.freebsd.org> From: Julio Merino Date: Thu, 6 Mar 2014 13:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262854 - stable/10/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 13:38:23 -0000 Author: jmmv Date: Thu Mar 6 13:38:23 2014 New Revision: 262854 URL: http://svnweb.freebsd.org/changeset/base/262854 Log: Install a symlink from /usr/tests/local to /usr/local/tests. This is a MFC of r261959 and r261978. Modified: stable/10/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/Makefile ============================================================================== --- stable/10/tests/Makefile Thu Mar 6 13:37:34 2014 (r262853) +++ stable/10/tests/Makefile Thu Mar 6 13:38:23 2014 (r262854) @@ -7,4 +7,8 @@ SUBDIR= sys TESTSDIR= ${TESTSBASE} KYUAFILE= yes +afterinstall: install-tests-local +install-tests-local: .PHONY + ${INSTALL_SYMLINK} ../local/tests ${DESTDIR}${TESTSDIR}/local + .include From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 14:11:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0BA74234; Thu, 6 Mar 2014 14:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E897399A; Thu, 6 Mar 2014 14:11: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 s26EBnov026183; Thu, 6 Mar 2014 14:11:49 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26EBiT9025986; Thu, 6 Mar 2014 14:11:44 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403061411.s26EBiT9025986@svn.freebsd.org> From: Julio Merino Date: Thu, 6 Mar 2014 14:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262855 - in stable/10: contrib/atf contrib/atf/atf-c contrib/atf/atf-c++ contrib/atf/atf-c++/detail contrib/atf/atf-c/detail contrib/atf/atf-sh contrib/atf/doc lib/atf/libatf-c++ lib/a... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 14:11:50 -0000 Author: jmmv Date: Thu Mar 6 14:11:44 2014 New Revision: 262855 URL: http://svnweb.freebsd.org/changeset/base/262855 Log: Import atf-0.20. This is a MFC of r261897 and r262000 and should allow all of the atf tests to pass. Added: stable/10/contrib/atf/atf-c++/detail/version_helper.cpp - copied unchanged from r261897, head/contrib/atf/atf-c++/detail/version_helper.cpp stable/10/contrib/atf/atf-c/detail/version_helper.c - copied unchanged from r261897, head/contrib/atf/atf-c/detail/version_helper.c Deleted: stable/10/contrib/atf/atf-c++/detail/expand.cpp stable/10/contrib/atf/atf-c++/detail/expand.hpp stable/10/contrib/atf/atf-c++/detail/expand_test.cpp stable/10/contrib/atf/atf-c++/detail/parser.cpp stable/10/contrib/atf/atf-c++/detail/parser.hpp stable/10/contrib/atf/atf-c++/detail/parser_test.cpp stable/10/contrib/atf/atf-c++/detail/ui.cpp stable/10/contrib/atf/atf-c++/detail/ui.hpp stable/10/contrib/atf/atf-c++/detail/ui_test.cpp stable/10/contrib/atf/atf-c++/noncopyable.hpp Modified: stable/10/contrib/atf/FREEBSD-Xlist stable/10/contrib/atf/Kyuafile stable/10/contrib/atf/NEWS stable/10/contrib/atf/README stable/10/contrib/atf/atf-c++/check.hpp stable/10/contrib/atf/atf-c++/config.cpp stable/10/contrib/atf/atf-c++/config_test.cpp stable/10/contrib/atf/atf-c++/detail/Kyuafile stable/10/contrib/atf/atf-c++/detail/application.cpp stable/10/contrib/atf/atf-c++/detail/application.hpp stable/10/contrib/atf/atf-c++/detail/application_test.cpp stable/10/contrib/atf/atf-c++/detail/exceptions.hpp stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp stable/10/contrib/atf/atf-c++/detail/test_helpers.hpp stable/10/contrib/atf/atf-c++/macros_test.cpp stable/10/contrib/atf/atf-c++/pkg_config_test.sh stable/10/contrib/atf/atf-c++/tests.cpp stable/10/contrib/atf/atf-c++/tests.hpp stable/10/contrib/atf/atf-c++/tests_test.cpp stable/10/contrib/atf/atf-c/config.c stable/10/contrib/atf/atf-c/config_test.c stable/10/contrib/atf/atf-c/detail/test_helpers.c stable/10/contrib/atf/atf-c/detail/test_helpers.h stable/10/contrib/atf/atf-c/macros_test.c stable/10/contrib/atf/atf-c/pkg_config_test.sh stable/10/contrib/atf/atf-sh/atf-check.cpp stable/10/contrib/atf/atf-sh/atf-sh.cpp stable/10/contrib/atf/atf-sh/atf_check_test.sh stable/10/contrib/atf/atf-sh/integration_test.sh stable/10/contrib/atf/bconfig.h stable/10/contrib/atf/doc/atf-test-case.4 stable/10/lib/atf/libatf-c++/Makefile stable/10/lib/atf/libatf-c++/tests/detail/Makefile stable/10/lib/atf/libatf-c/tests/detail/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/atf/FREEBSD-Xlist ============================================================================== --- stable/10/contrib/atf/FREEBSD-Xlist Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/FREEBSD-Xlist Thu Mar 6 14:11:44 2014 (r262855) @@ -18,3 +18,4 @@ configure* doc/atf-formats.5 doc/atf.7.in m4/ +tools/ Modified: stable/10/contrib/atf/Kyuafile ============================================================================== --- stable/10/contrib/atf/Kyuafile Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/Kyuafile Thu Mar 6 14:11:44 2014 (r262855) @@ -6,13 +6,3 @@ include("atf-c/Kyuafile") include("atf-c++/Kyuafile") include("atf-sh/Kyuafile") include("test-programs/Kyuafile") - -if fs.exists("atf-config/Kyuafile") then - include("atf-config/Kyuafile") -end -if fs.exists("atf-report/Kyuafile") then - include("atf-report/Kyuafile") -end -if fs.exists("atf-run/Kyuafile") then - include("atf-run/Kyuafile") -end Modified: stable/10/contrib/atf/NEWS ============================================================================== --- stable/10/contrib/atf/NEWS Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/NEWS Thu Mar 6 14:11:44 2014 (r262855) @@ -2,6 +2,51 @@ Major changes between releases =========================================================================== +Changes in version 0.20 +*********************** + +Experimental version released on February 7th, 2014. + +This is the first release without the code for the deprecated tools. If +you require such code, please fetch a copy of the 0.19 release and extract +the 'tools' directory for your own consumption. + +* Removed the deprecated tools. This includes atf-config, atf-report, + atf-run and atf-version. + + +Changes in version 0.19 +*********************** + +Experimental version released on February 7th, 2014. + +This is the last release to bundle the code for the deprecated tools. +The next release will drop their code and will stop worrying about +backwards compatibility between the ATF libraries and what the old tools +may or may not support. + +If you still require the old tools for some reason, grab a copy of the +'tools' directory now. The code in this directory is standalone and +does not depend on any internal details of atf-c++ any longer. + +* Various fixes and improvements to support running as part of the FreeBSD + test suite. + +* Project hosting moved from Google Code (as a subproject of Kyua) to + GitHub (as a first-class project). The main reason for the change is + the suppression of binary downloads in Google Code on Jan 15th, 2014. + See https://github.com/jmmv/atf/ + +* Removed builtin help from atf-sh(1) and atf-check(1) for simplicity + reasons. In other words, their -h option is gone. + +* Moved the code of the deprecated tools into a 'tools' directory and + completely decoupled their code from the internals of atf-c++. The + reason for this is to painlessly allow a third-party to maintain a + copy of these tools after we delete them because upcoming changes to + atf-c++ would break the stale tools. + + Changes in version 0.18 *********************** Modified: stable/10/contrib/atf/README ============================================================================== --- stable/10/contrib/atf/README Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/README Thu Mar 6 14:11:44 2014 (r262855) @@ -5,21 +5,18 @@ Introductory information Introduction ************ -The Automated Testing Framework (ATF) is a collection of libraries and -utilities designed to ease unattended application testing in the hands of -developers and end users of a specific piece of software. - -As regards developers, ATF provides the necessary means to easily create -test suites composed of multiple test programs, which in turn are a -collection of test cases. It also attempts to simplify the debugging of -problems when these test cases detect an error by providing as much -information as possible about the failure. - -As regards users, it simplifies the process of running the test suites and, -in special, encourages end users to run them often: they do not need to -have source trees around nor any other development tools installed to be -able to certify that a given piece of software works on their machine as -advertised. +The Automated Testing Framework (ATF) is a collection of libraries to +implement test programs in a variety of languages. At the moment, ATF +offers C, C++ and POSIX shell bindings with which to implement tests. +These bindings all offer a similar set of functionality and any test +program written with them exposes a consistent user interface. + +ATF-based test programs rely on a separate runtime engine to execute them. +The runtime engine is in charge of isolating the test programs from the +rest of the system to ensure that their results are deterministic and that +they cannot affect the running system. The runtime engine is also +responsible for gathering the results of all tests and composing reports. +The current runtime of choice is Kyua. Other documents Modified: stable/10/contrib/atf/atf-c++/check.hpp ============================================================================== --- stable/10/contrib/atf/atf-c++/check.hpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/check.hpp Thu Mar 6 14:11:44 2014 (r262855) @@ -39,8 +39,6 @@ extern "C" { #include #include -#include - namespace atf { namespace process { @@ -60,7 +58,11 @@ namespace check { //! of executing arbitrary command and manages files containing //! its output. //! -class check_result : noncopyable { +class check_result { + // Non-copyable. + check_result(const check_result&); + check_result& operator=(const check_result&); + //! //! \brief Internal representation of a result. //! Modified: stable/10/contrib/atf/atf-c++/config.cpp ============================================================================== --- stable/10/contrib/atf/atf-c++/config.cpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/config.cpp Thu Mar 6 14:11:44 2014 (r262855) @@ -52,18 +52,14 @@ init_variables(void) { PRE(m_variables.empty()); - m_variables["atf_arch"] = atf_config_get("atf_arch"); m_variables["atf_build_cc"] = atf_config_get("atf_build_cc"); m_variables["atf_build_cflags"] = atf_config_get("atf_build_cflags"); m_variables["atf_build_cpp"] = atf_config_get("atf_build_cpp"); m_variables["atf_build_cppflags"] = atf_config_get("atf_build_cppflags"); m_variables["atf_build_cxx"] = atf_config_get("atf_build_cxx"); m_variables["atf_build_cxxflags"] = atf_config_get("atf_build_cxxflags"); - m_variables["atf_confdir"] = atf_config_get("atf_confdir"); m_variables["atf_includedir"] = atf_config_get("atf_includedir"); - m_variables["atf_libdir"] = atf_config_get("atf_libdir"); m_variables["atf_libexecdir"] = atf_config_get("atf_libexecdir"); - m_variables["atf_machine"] = atf_config_get("atf_machine"); m_variables["atf_pkgdatadir"] = atf_config_get("atf_pkgdatadir"); m_variables["atf_shell"] = atf_config_get("atf_shell"); m_variables["atf_workdir"] = atf_config_get("atf_workdir"); Modified: stable/10/contrib/atf/atf-c++/config_test.cpp ============================================================================== --- stable/10/contrib/atf/atf-c++/config_test.cpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/config_test.cpp Thu Mar 6 14:11:44 2014 (r262855) @@ -44,18 +44,14 @@ static struct varnames { const char *uc; bool can_be_empty; } all_vars[] = { - { "atf_arch", "ATF_ARCH", false }, { "atf_build_cc", "ATF_BUILD_CC", false }, { "atf_build_cflags", "ATF_BUILD_CFLAGS", true }, { "atf_build_cpp", "ATF_BUILD_CPP", false }, { "atf_build_cppflags", "ATF_BUILD_CPPFLAGS", true }, { "atf_build_cxx", "ATF_BUILD_CXX", false }, { "atf_build_cxxflags", "ATF_BUILD_CXXFLAGS", true }, - { "atf_confdir", "ATF_CONFDIR", false }, { "atf_includedir", "ATF_INCLUDEDIR", false }, - { "atf_libdir", "ATF_LIBDIR", false }, { "atf_libexecdir", "ATF_LIBEXECDIR", false }, - { "atf_machine", "ATF_MACHINE", false }, { "atf_pkgdatadir", "ATF_PKGDATADIR", false }, { "atf_shell", "ATF_SHELL", false }, { "atf_workdir", "ATF_WORKDIR", false }, Modified: stable/10/contrib/atf/atf-c++/detail/Kyuafile ============================================================================== --- stable/10/contrib/atf/atf-c++/detail/Kyuafile Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/detail/Kyuafile Thu Mar 6 14:11:44 2014 (r262855) @@ -6,9 +6,7 @@ atf_test_program{name="application_test" atf_test_program{name="auto_array_test"} atf_test_program{name="env_test"} atf_test_program{name="exceptions_test"} -atf_test_program{name="expand_test"} atf_test_program{name="fs_test"} -atf_test_program{name="parser_test"} +atf_test_program{name="process_test"} atf_test_program{name="sanity_test"} atf_test_program{name="text_test"} -atf_test_program{name="ui_test"} Modified: stable/10/contrib/atf/atf-c++/detail/application.cpp ============================================================================== --- stable/10/contrib/atf/atf-c++/detail/application.cpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/detail/application.cpp Thu Mar 6 14:11:44 2014 (r262855) @@ -47,7 +47,6 @@ extern "C" { #include "application.hpp" #include "sanity.hpp" -#include "ui.hpp" #if !defined(HAVE_VSNPRINTF_IN_STD) namespace std { @@ -106,17 +105,12 @@ impl::option::operator<(const impl::opti } impl::app::app(const std::string& description, - const std::string& manpage, - const std::string& global_manpage, - const bool use_ui) : - m_hflag(false), + const std::string& manpage) : m_argc(-1), m_argv(NULL), m_prog_name(NULL), m_description(description), - m_manpage(manpage), - m_global_manpage(global_manpage), - m_use_ui(use_ui) + m_manpage(manpage) { } @@ -133,11 +127,7 @@ impl::app::inited(void) impl::app::options_set impl::app::options(void) { - options_set opts = specific_options(); - if (m_use_ui) { - opts.insert(option('h', "", "Shows this help message")); - } - return opts; + return specific_options(); } std::string @@ -187,11 +177,6 @@ impl::app::process_options(void) ::opterr = 0; while ((ch = ::getopt(m_argc, m_argv, optstr.c_str())) != -1) { switch (ch) { - case 'h': - INV(m_use_ui); - m_hflag = true; - break; - case ':': throw usage_error("Option -%c requires an argument.", ::optopt); @@ -214,51 +199,6 @@ impl::app::process_options(void) #endif } -void -impl::app::usage(std::ostream& os) -{ - PRE(inited()); - - std::string args = specific_args(); - if (!args.empty()) - args = " " + args; - os << ui::format_text_with_tag(std::string(m_prog_name) + " [options]" + - args, "Usage: ", false) << "\n\n" - << ui::format_text(m_description) << "\n\n"; - - options_set opts = options(); - INV(!opts.empty()); - os << "Available options:\n"; - size_t coldesc = 0; - for (options_set::const_iterator iter = opts.begin(); - iter != opts.end(); iter++) { - const option& opt = (*iter); - - if (opt.m_argument.length() + 1 > coldesc) - coldesc = opt.m_argument.length() + 1; - } - for (options_set::const_iterator iter = opts.begin(); - iter != opts.end(); iter++) { - const option& opt = (*iter); - - std::string tag = std::string(" -") + opt.m_character; - if (opt.m_argument.empty()) - tag += " "; - else - tag += " " + opt.m_argument + " "; - os << ui::format_text_with_tag(opt.m_description, tag, false, - coldesc + 10) << "\n"; - } - os << "\n"; - - std::string gmp; - if (!m_global_manpage.empty()) - gmp = " and " + m_global_manpage; - os << ui::format_text("For more details please see " + m_manpage + - gmp + ".") - << "\n"; -} - int impl::app::run(int argc, char* const* argv) { @@ -290,55 +230,22 @@ impl::app::run(int argc, char* const* ar int errcode; try { - int oldargc = m_argc; - process_options(); - - if (m_hflag) { - INV(m_use_ui); - if (oldargc != 2) - throw usage_error("-h must be given alone."); - - usage(std::cout); - errcode = EXIT_SUCCESS; - } else - errcode = main(); + errcode = main(); } catch (const usage_error& e) { - if (m_use_ui) { - std::cerr << ui::format_error(m_prog_name, e.what()) << "\n" - << ui::format_info(m_prog_name, std::string("Type `") + - m_prog_name + " -h' for more details.") - << "\n"; - } else { - std::cerr << m_prog_name << ": ERROR: " << e.what() << "\n"; - std::cerr << m_prog_name << ": See " << m_manpage << " for usage " - "details.\n"; - } + std::cerr << m_prog_name << ": ERROR: " << e.what() << "\n"; + std::cerr << m_prog_name << ": See " << m_manpage << " for usage " + "details.\n"; errcode = EXIT_FAILURE; } catch (const std::runtime_error& e) { - if (m_use_ui) { - std::cerr << ui::format_error(m_prog_name, std::string(e.what())) - << "\n"; - } else { - std::cerr << m_prog_name << ": ERROR: " << e.what() << "\n"; - } + std::cerr << m_prog_name << ": ERROR: " << e.what() << "\n"; errcode = EXIT_FAILURE; } catch (const std::exception& e) { - if (m_use_ui) { - std::cerr << ui::format_error(m_prog_name, std::string("Caught " - "unexpected error: ") + e.what() + "\n" + bug) << "\n"; - } else { - std::cerr << m_prog_name << ": ERROR: Caught unexpected error: " - << e.what() << "\n"; - } + std::cerr << m_prog_name << ": ERROR: Caught unexpected error: " + << e.what() << "\n"; errcode = EXIT_FAILURE; } catch (...) { - if (m_use_ui) { - std::cerr << ui::format_error(m_prog_name, std::string("Caught " - "unknown error\n") + bug) << "\n"; - } else { - std::cerr << m_prog_name << ": ERROR: Caught unknown error\n"; - } + std::cerr << m_prog_name << ": ERROR: Caught unknown error\n"; errcode = EXIT_FAILURE; } return errcode; Modified: stable/10/contrib/atf/atf-c++/detail/application.hpp ============================================================================== --- stable/10/contrib/atf/atf-c++/detail/application.hpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/detail/application.hpp Thu Mar 6 14:11:44 2014 (r262855) @@ -74,8 +74,6 @@ public: // ------------------------------------------------------------------------ class app { - bool m_hflag; - void process_options(void); void usage(std::ostream&); @@ -90,8 +88,7 @@ protected: const char* m_argv0; const char* m_prog_name; std::string m_description; - std::string m_manpage, m_global_manpage; - const bool m_use_ui; + std::string m_manpage; options_set options(void); @@ -102,8 +99,7 @@ protected: virtual int main(void) = 0; public: - app(const std::string&, const std::string&, const std::string&, - bool = true); + app(const std::string&, const std::string&); virtual ~app(void); int run(int, char* const*); Modified: stable/10/contrib/atf/atf-c++/detail/application_test.cpp ============================================================================== --- stable/10/contrib/atf/atf-c++/detail/application_test.cpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/detail/application_test.cpp Thu Mar 6 14:11:44 2014 (r262855) @@ -37,7 +37,7 @@ extern "C" { class getopt_app : public atf::application::app { public: - getopt_app(void) : app("description", "manpage", "other") {} + getopt_app(void) : app("description", "manpage") {} int main(void) { Modified: stable/10/contrib/atf/atf-c++/detail/exceptions.hpp ============================================================================== --- stable/10/contrib/atf/atf-c++/detail/exceptions.hpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/detail/exceptions.hpp Thu Mar 6 14:11:44 2014 (r262855) @@ -39,47 +39,6 @@ struct atf_error; namespace atf { -template< class T > -class not_found_error : - public std::runtime_error -{ - T m_value; - -public: - not_found_error(const std::string& message, const T& value) throw(); - - virtual ~not_found_error(void) throw(); - - const T& get_value(void) const throw(); -}; - -template< class T > -inline -not_found_error< T >::not_found_error(const std::string& message, - const T& value) - throw() : - std::runtime_error(message), - m_value(value) -{ -} - -template< class T > -inline -not_found_error< T >::~not_found_error(void) - throw() -{ -} - -template< class T > -inline -const T& -not_found_error< T >::get_value(void) - const - throw() -{ - return m_value; -} - class system_error : public std::runtime_error { int m_sys_err; mutable std::string m_message; Modified: stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp ============================================================================== --- stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp Thu Mar 6 14:11:44 2014 (r262855) @@ -52,28 +52,24 @@ static const char* atf_c_tests_base = NU #endif #undef ATF_C_TESTS_BASE -void -build_check_cxx_o_aux(const atf::fs::path& sfile, const char* failmsg, - const bool expect_pass) +bool +build_check_cxx_o(const char* sfile) { std::vector< std::string > optargs; optargs.push_back("-I" + atf::config::get("atf_includedir")); optargs.push_back("-Wall"); optargs.push_back("-Werror"); - const bool result = atf::check::build_cxx_o( - sfile.str(), "test.o", atf::process::argv_array(optargs)); - if ((expect_pass && !result) || (!expect_pass && result)) - ATF_FAIL(failmsg); + return atf::check::build_cxx_o(sfile, "test.o", + atf::process::argv_array(optargs)); } -void -build_check_cxx_o(const atf::tests::tc& tc, const char* sfile, - const char* failmsg, const bool expect_pass) +bool +build_check_cxx_o_srcdir(const atf::tests::tc& tc, const char* sfile) { const atf::fs::path sfilepath = atf::fs::path(tc.get_config_var("srcdir")) / sfile; - build_check_cxx_o_aux(sfilepath, failmsg, expect_pass); + return build_check_cxx_o(sfilepath.c_str()); } void @@ -86,7 +82,8 @@ header_check(const char *hdrname) const std::string failmsg = std::string("Header check failed; ") + hdrname + " is not self-contained"; - build_check_cxx_o_aux(atf::fs::path("test.cpp"), failmsg.c_str(), true); + if (!build_check_cxx_o("test.cpp")) + ATF_FAIL(failmsg); } atf::fs::path @@ -104,37 +101,3 @@ get_process_helpers_path(const atf::test return atf::fs::path(atf_c_tests_base) / helper; } } - -void -test_helpers_detail::check_equal(const char* expected[], - const string_vector& actual) -{ - const char** expected_iter = expected; - string_vector::const_iterator actual_iter = actual.begin(); - - bool equals = true; - while (equals && *expected_iter != NULL && actual_iter != actual.end()) { - if (*expected_iter != *actual_iter) { - equals = false; - } else { - expected_iter++; - actual_iter++; - } - } - if (equals && ((*expected_iter == NULL && actual_iter != actual.end()) || - (*expected_iter != NULL && actual_iter == actual.end()))) - equals = false; - - if (!equals) { - std::cerr << "EXPECTED:\n"; - for (expected_iter = expected; *expected_iter != NULL; expected_iter++) - std::cerr << *expected_iter << "\n"; - - std::cerr << "ACTUAL:\n"; - for (actual_iter = actual.begin(); actual_iter != actual.end(); - actual_iter++) - std::cerr << *actual_iter << "\n"; - - ATF_FAIL("Expected results differ to actual values"); - } -} Modified: stable/10/contrib/atf/atf-c++/detail/test_helpers.hpp ============================================================================== --- stable/10/contrib/atf/atf-c++/detail/test_helpers.hpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/detail/test_helpers.hpp Thu Mar 6 14:11:44 2014 (r262855) @@ -40,9 +40,7 @@ #include "../macros.hpp" #include "../tests.hpp" -#include "parser.hpp" #include "process.hpp" -#include "text.hpp" #define HEADER_TC(name, hdrname) \ ATF_TEST_CASE(name); \ @@ -64,18 +62,8 @@ } \ ATF_TEST_CASE_BODY(name) \ { \ - build_check_cxx_o(*this, sfile, failmsg, true); \ - } - -#define BUILD_TC_FAIL(name, sfile, descr, failmsg) \ - ATF_TEST_CASE(name); \ - ATF_TEST_CASE_HEAD(name) \ - { \ - set_md_var("descr", descr); \ - } \ - ATF_TEST_CASE_BODY(name) \ - { \ - build_check_cxx_o(*this, sfile, failmsg, false); \ + if (!build_check_cxx_o_srcdir(*this, sfile)) \ + ATF_FAIL(failmsg); \ } namespace atf { @@ -85,7 +73,8 @@ class tc; } void header_check(const char*); -void build_check_cxx_o(const atf::tests::tc&, const char*, const char*, bool); +bool build_check_cxx_o(const char*); +bool build_check_cxx_o_srcdir(const atf::tests::tc&, const char*); atf::fs::path get_process_helpers_path(const atf::tests::tc&, bool); struct run_h_tc_data { @@ -120,45 +109,3 @@ run_h_tc(atf::tests::vars_map config = a const atf::process::status s = c.wait(); ATF_REQUIRE(s.exited()); } - -namespace test_helpers_detail { - -typedef std::vector< std::string > string_vector; - -template< class Reader > -std::pair< string_vector, string_vector > -do_read(const char* input) -{ - string_vector errors; - - std::istringstream is(input); - Reader reader(is); - try { - reader.read(); - } catch (const atf::parser::parse_errors& pes) { - for (std::vector< atf::parser::parse_error >::const_iterator iter = - pes.begin(); iter != pes.end(); iter++) - errors.push_back(*iter); - } catch (const atf::parser::parse_error& pe) { - ATF_FAIL("Raised a lonely parse error: " + - atf::text::to_string(pe.first) + ": " + pe.second); - } - - return std::make_pair(reader.m_calls, errors); -} - -void check_equal(const char*[], const string_vector&); - -} // namespace test_helpers_detail - -template< class Reader > -void -do_parser_test(const char* input, const char* exp_calls[], - const char* exp_errors[]) -{ - const std::pair< test_helpers_detail::string_vector, - test_helpers_detail::string_vector > - actual = test_helpers_detail::do_read< Reader >(input); - test_helpers_detail::check_equal(exp_calls, actual.first); - test_helpers_detail::check_equal(exp_errors, actual.second); -} Copied: stable/10/contrib/atf/atf-c++/detail/version_helper.cpp (from r261897, head/contrib/atf/atf-c++/detail/version_helper.cpp) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/atf/atf-c++/detail/version_helper.cpp Thu Mar 6 14:11:44 2014 (r262855, copy of r261897, head/contrib/atf/atf-c++/detail/version_helper.cpp) @@ -0,0 +1,41 @@ +// Copyright 2014 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of Google Inc. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#if defined(HAVE_CONFIG_H) +#include "bconfig.h" +#endif + +#include +#include + +int +main(void) +{ + std::cout << PACKAGE_VERSION << "\n"; + return EXIT_SUCCESS; +} Modified: stable/10/contrib/atf/atf-c++/macros_test.cpp ============================================================================== --- stable/10/contrib/atf/atf-c++/macros_test.cpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/macros_test.cpp Thu Mar 6 14:11:44 2014 (r262855) @@ -763,11 +763,30 @@ BUILD_TC(use, "macros_hpp_test.cpp", "do not cause syntax errors when used", "Build of macros_hpp_test.cpp failed; some macros in " "atf-c++/macros.hpp are broken"); -BUILD_TC_FAIL(detect_unused_tests, "unused_test.cpp", - "Tests that defining an unused test case raises a warning (and thus " - "an error)", - "Build of unused_test.cpp passed; unused test cases are not properly " - "detected"); + +ATF_TEST_CASE(detect_unused_tests); +ATF_TEST_CASE_HEAD(detect_unused_tests) +{ + set_md_var("descr", + "Tests that defining an unused test case raises a warning (and " + "thus an error)"); +} +ATF_TEST_CASE_BODY(detect_unused_tests) +{ + const char* validate_compiler = + "class test_class { public: int dummy; };\n" + "#define define_unused static test_class unused\n" + "define_unused;\n"; + + atf::utils::create_file("compiler_test.cpp", validate_compiler); + if (build_check_cxx_o("compiler_test.cpp")) + expect_fail("Compiler does not raise a warning on an unused " + "static global variable declared by a macro"); + + if (build_check_cxx_o_srcdir(*this, "unused_test.cpp")) + ATF_FAIL("Build of unused_test.cpp passed; unused test cases are " + "not properly detected"); +} // ------------------------------------------------------------------------ // Main. Modified: stable/10/contrib/atf/atf-c++/pkg_config_test.sh ============================================================================== --- stable/10/contrib/atf/atf-c++/pkg_config_test.sh Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/pkg_config_test.sh Thu Mar 6 14:11:44 2014 (r262855) @@ -43,10 +43,8 @@ require_pc() check_version() { - atf_check -s eq:0 -o save:stdout -e empty -x \ - "atf-version | head -n 1 | cut -d ' ' -f 4" - ver1=$(cat stdout) - echo "Version reported by atf-version: ${ver1}" + ver1=$($(atf_get_srcdir)/detail/version_helper) + echo "Version reported by builtin PACKAGE_VERSION: ${ver1}" atf_check -s eq:0 -o save:stdout -e empty pkg-config --modversion "${1}" ver2=$(cat stdout) @@ -59,7 +57,7 @@ atf_test_case version version_head() { atf_set "descr" "Checks that the version in atf-c++ is correct" - atf_set "require.progs" "atf-version pkg-config" + atf_set "require.progs" "pkg-config" } version_body() { Modified: stable/10/contrib/atf/atf-c++/tests.cpp ============================================================================== --- stable/10/contrib/atf/atf-c++/tests.cpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/tests.cpp Thu Mar 6 14:11:44 2014 (r262855) @@ -55,7 +55,6 @@ extern "C" { #include "atf-c/utils.h" } -#include "noncopyable.hpp" #include "tests.hpp" #include "detail/application.hpp" @@ -63,7 +62,6 @@ extern "C" { #include "detail/env.hpp" #include "detail/exceptions.hpp" #include "detail/fs.hpp" -#include "detail/parser.hpp" #include "detail/sanity.hpp" #include "detail/text.hpp" @@ -79,12 +77,7 @@ detail::atf_tp_writer::atf_tp_writer(std m_os(os), m_is_first(true) { - atf::parser::headers_map hm; - atf::parser::attrs_map ct_attrs; - ct_attrs["version"] = "1"; - hm["Content-Type"] = atf::parser::header_entry("Content-Type", - "application/X-atf-tp", ct_attrs); - atf::parser::write_headers(hm, m_os); + m_os << "Content-Type: application/X-atf-tp; version=\"1\"\n\n"; } void @@ -129,7 +122,13 @@ detail::match(const std::string& regexp, static std::map< atf_tc_t*, impl::tc* > wraps; static std::map< const atf_tc_t*, const impl::tc* > cwraps; -struct impl::tc_impl : atf::noncopyable { +struct impl::tc_impl { +private: + // Non-copyable. + tc_impl(const tc_impl&); + tc_impl& operator=(const tc_impl&); + +public: std::string m_ident; atf_tc_t m_tc; bool m_has_cleanup; @@ -435,7 +434,7 @@ const char* tp::m_description = "This is an independent atf test program."; tp::tp(void (*add_tcs)(tc_vector&)) : - app(m_description, "atf-test-program(1)", "atf(7)", false), + app(m_description, "atf-test-program(1)"), m_lflag(false), m_resfile("/dev/stdout"), m_srcdir("."), Modified: stable/10/contrib/atf/atf-c++/tests.hpp ============================================================================== --- stable/10/contrib/atf/atf-c++/tests.hpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/tests.hpp Thu Mar 6 14:11:44 2014 (r262855) @@ -38,8 +38,6 @@ extern "C" { #include } -#include - namespace atf { namespace tests { @@ -74,7 +72,11 @@ typedef std::map< std::string, std::stri struct tc_impl; -class tc : noncopyable { +class tc { + // Non-copyable. + tc(const tc&); + tc& operator=(const tc&); + std::auto_ptr< tc_impl > pimpl; protected: Modified: stable/10/contrib/atf/atf-c++/tests_test.cpp ============================================================================== --- stable/10/contrib/atf/atf-c++/tests_test.cpp Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c++/tests_test.cpp Thu Mar 6 14:11:44 2014 (r262855) @@ -40,8 +40,8 @@ extern "C" { #include "macros.hpp" -#include "detail/parser.hpp" #include "detail/test_helpers.hpp" +#include "detail/text.hpp" // ------------------------------------------------------------------------ // Tests for the "atf_tp_writer" class. Modified: stable/10/contrib/atf/atf-c/config.c ============================================================================== --- stable/10/contrib/atf/atf-c/config.c Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c/config.c Thu Mar 6 14:11:44 2014 (r262855) @@ -45,18 +45,14 @@ static struct var { const char *value; bool can_be_empty; } vars[] = { - { "atf_arch", ATF_ARCH, NULL, false, }, { "atf_build_cc", ATF_BUILD_CC, NULL, false, }, { "atf_build_cflags", ATF_BUILD_CFLAGS, NULL, true, }, { "atf_build_cpp", ATF_BUILD_CPP, NULL, false, }, { "atf_build_cppflags", ATF_BUILD_CPPFLAGS, NULL, true, }, { "atf_build_cxx", ATF_BUILD_CXX, NULL, false, }, { "atf_build_cxxflags", ATF_BUILD_CXXFLAGS, NULL, true, }, - { "atf_confdir", ATF_CONFDIR, NULL, false, }, { "atf_includedir", ATF_INCLUDEDIR, NULL, false, }, - { "atf_libdir", ATF_LIBDIR, NULL, false, }, { "atf_libexecdir", ATF_LIBEXECDIR, NULL, false, }, - { "atf_machine", ATF_MACHINE, NULL, false, }, { "atf_pkgdatadir", ATF_PKGDATADIR, NULL, false, }, { "atf_shell", ATF_SHELL, NULL, false, }, { "atf_workdir", ATF_WORKDIR, NULL, false, }, Modified: stable/10/contrib/atf/atf-c/config_test.c ============================================================================== --- stable/10/contrib/atf/atf-c/config_test.c Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c/config_test.c Thu Mar 6 14:11:44 2014 (r262855) @@ -44,18 +44,14 @@ static struct varnames { const char *uc; bool can_be_empty; } all_vars[] = { - { "atf_arch", "ATF_ARCH", false }, { "atf_build_cc", "ATF_BUILD_CC", false }, { "atf_build_cflags", "ATF_BUILD_CFLAGS", true }, { "atf_build_cpp", "ATF_BUILD_CPP", false }, { "atf_build_cppflags", "ATF_BUILD_CPPFLAGS", true }, { "atf_build_cxx", "ATF_BUILD_CXX", false }, { "atf_build_cxxflags", "ATF_BUILD_CXXFLAGS", true }, - { "atf_confdir", "ATF_CONFDIR", false }, { "atf_includedir", "ATF_INCLUDEDIR", false }, - { "atf_libdir", "ATF_LIBDIR", false }, { "atf_libexecdir", "ATF_LIBEXECDIR", false }, - { "atf_machine", "ATF_MACHINE", false }, { "atf_pkgdatadir", "ATF_PKGDATADIR", false }, { "atf_shell", "ATF_SHELL", false }, { "atf_workdir", "ATF_WORKDIR", false }, Modified: stable/10/contrib/atf/atf-c/detail/test_helpers.c ============================================================================== --- stable/10/contrib/atf/atf-c/detail/test_helpers.c Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c/detail/test_helpers.c Thu Mar 6 14:11:44 2014 (r262855) @@ -43,10 +43,8 @@ #include "process.h" #include "test_helpers.h" -static -void -build_check_c_o_aux(const char *path, const char *failmsg, - const bool expect_pass) +bool +build_check_c_o(const char *path) { bool success; atf_dynstr_t iflag; @@ -63,20 +61,19 @@ build_check_c_o_aux(const char *path, co atf_dynstr_fini(&iflag); - if ((expect_pass && !success) || (!expect_pass && success)) - atf_tc_fail("%s", failmsg); + return success; } -void -build_check_c_o(const atf_tc_t *tc, const char *sfile, const char *failmsg, - const bool expect_pass) +bool +build_check_c_o_srcdir(const atf_tc_t *tc, const char *sfile) { atf_fs_path_t path; RE(atf_fs_path_init_fmt(&path, "%s/%s", atf_tc_get_config_var(tc, "srcdir"), sfile)); - build_check_c_o_aux(atf_fs_path_cstring(&path), failmsg, expect_pass); + const bool result = build_check_c_o(atf_fs_path_cstring(&path)); atf_fs_path_fini(&path); + return result; } void @@ -93,7 +90,8 @@ header_check(const char *hdrname) snprintf(failmsg, sizeof(failmsg), "Header check failed; %s is not self-contained", hdrname); - build_check_c_o_aux("test.c", failmsg, true); + if (!build_check_c_o("test.c")) + atf_tc_fail("%s", failmsg); } void Modified: stable/10/contrib/atf/atf-c/detail/test_helpers.h ============================================================================== --- stable/10/contrib/atf/atf-c/detail/test_helpers.h Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c/detail/test_helpers.h Thu Mar 6 14:11:44 2014 (r262855) @@ -63,21 +63,12 @@ struct atf_fs_path; } \ ATF_TC_BODY(name, tc) \ { \ - build_check_c_o(tc, sfile, failmsg, true); \ + if (!build_check_c_o_srcdir(tc, sfile)) \ + atf_tc_fail("%s", failmsg); \ } -#define BUILD_TC_FAIL(name, sfile, descr, failmsg) \ - ATF_TC(name); \ - ATF_TC_HEAD(name, tc) \ - { \ - atf_tc_set_md_var(tc, "descr", descr); \ - } \ - ATF_TC_BODY(name, tc) \ - { \ - build_check_c_o(tc, sfile, failmsg, false); \ - } - -void build_check_c_o(const atf_tc_t *, const char *, const char *, const bool); +bool build_check_c_o(const char *); +bool build_check_c_o_srcdir(const atf_tc_t *, const char *); void header_check(const char *); void get_process_helpers_path(const atf_tc_t *, const bool, struct atf_fs_path *); Copied: stable/10/contrib/atf/atf-c/detail/version_helper.c (from r261897, head/contrib/atf/atf-c/detail/version_helper.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/atf/atf-c/detail/version_helper.c Thu Mar 6 14:11:44 2014 (r262855, copy of r261897, head/contrib/atf/atf-c/detail/version_helper.c) @@ -0,0 +1,43 @@ +/* + * Copyright 2014 Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if defined(HAVE_CONFIG_H) +#include "bconfig.h" +#endif + +#include +#include + +int +main(void) +{ + printf("%s\n", PACKAGE_VERSION); + return EXIT_SUCCESS; +} Modified: stable/10/contrib/atf/atf-c/macros_test.c ============================================================================== --- stable/10/contrib/atf/atf-c/macros_test.c Thu Mar 6 13:38:23 2014 (r262854) +++ stable/10/contrib/atf/atf-c/macros_test.c Thu Mar 6 14:11:44 2014 (r262855) @@ -843,11 +843,30 @@ BUILD_TC(use, "macros_h_test.c", "do not cause syntax errors when used", "Build of macros_h_test.c failed; some macros in atf-c/macros.h " *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 18:31:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E8DAD11B; Thu, 6 Mar 2014 18:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D16909CD; Thu, 6 Mar 2014 18:31: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 s26IV2Dr037391; Thu, 6 Mar 2014 18:31:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26IUvJG037341; Thu, 6 Mar 2014 18:30:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201403061830.s26IUvJG037341@svn.freebsd.org> From: John Baldwin Date: Thu, 6 Mar 2014 18:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262861 - in stable/10: sys/amd64/conf sys/conf sys/dev/drm2 sys/dev/drm2/i915 sys/dev/drm2/radeon sys/dev/fb sys/dev/syscons sys/dev/vt sys/dev/vt/font sys/dev/vt/hw/fb sys/dev/vt/hw/o... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 18:31:03 -0000 Author: jhb Date: Thu Mar 6 18:30:56 2014 New Revision: 262861 URL: http://svnweb.freebsd.org/changeset/base/262861 Log: MFC 259016,259019,259049,259071,259102,259110,259129,259130,259178,259179, 259203,259221,259261,259532,259615,259650,259651,259667,259680,259727, 259761,259772,259776,259777,259830,259882,259915,260160,260449,260450, 260688,260888,260953,261269,261547,261551,261552,261553,261585: Merge the vt(4) driver (newcons) to stable/10. Approved by: ray Added: stable/10/sys/amd64/conf/VT - copied unchanged from r260888, head/sys/amd64/conf/VT stable/10/sys/dev/fb/fb_if.m - copied unchanged from r259016, head/sys/dev/fb/fb_if.m stable/10/sys/dev/fb/fbd.c - copied, changed from r259016, head/sys/dev/fb/fbd.c stable/10/sys/dev/vt/ - copied from r259016, head/sys/dev/vt/ stable/10/sys/i386/conf/VT - copied unchanged from r260888, head/sys/i386/conf/VT stable/10/sys/kern/subr_terminal.c - copied, changed from r259016, head/sys/kern/subr_terminal.c stable/10/sys/sys/terminal.h - copied, changed from r259016, head/sys/sys/terminal.h stable/10/tools/tools/vt/ - copied from r259019, head/tools/tools/vt/ Modified: stable/10/sys/conf/files stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.arm stable/10/sys/conf/files.i386 stable/10/sys/conf/files.powerpc stable/10/sys/conf/files.sparc64 stable/10/sys/conf/kmod.mk stable/10/sys/conf/options stable/10/sys/dev/drm2/drmP.h stable/10/sys/dev/drm2/drm_fb_helper.c stable/10/sys/dev/drm2/drm_os_freebsd.h stable/10/sys/dev/drm2/i915/i915_drv.c stable/10/sys/dev/drm2/i915/intel_fb.c stable/10/sys/dev/drm2/radeon/radeon.h stable/10/sys/dev/drm2/radeon/radeon_drv.c stable/10/sys/dev/drm2/radeon/radeon_fb.c stable/10/sys/dev/drm2/radeon/radeon_pm.c stable/10/sys/dev/syscons/scterm-teken.c stable/10/sys/dev/vt/font/vt_font_default.c stable/10/sys/dev/vt/font/vt_mouse_cursor.c stable/10/sys/dev/vt/hw/fb/vt_fb.c stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c (contents, props changed) stable/10/sys/dev/vt/hw/vga/vga.c stable/10/sys/dev/vt/hw/xboxfb/xboxfb.c stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_buf.c stable/10/sys/dev/vt/vt_consolectl.c stable/10/sys/dev/vt/vt_core.c stable/10/sys/dev/vt/vt_font.c stable/10/sys/dev/vt/vt_sysmouse.c stable/10/sys/modules/drm2/drm2/Makefile stable/10/sys/modules/drm2/i915kms/Makefile stable/10/sys/modules/drm2/radeonkms/Makefile stable/10/sys/sparc64/sparc64/machdep.c stable/10/sys/sys/consio.h stable/10/sys/sys/eventhandler.h stable/10/sys/sys/fbio.h stable/10/sys/sys/tty.h stable/10/sys/teken/demo/teken_demo.c stable/10/sys/teken/teken.c stable/10/sys/teken/teken.h stable/10/sys/teken/teken_subr.h stable/10/tools/tools/vt/fontcvt/fontcvt.c stable/10/tools/tools/vt/mkkfont/mkkfont.c stable/10/tools/tools/vt/setfont/setfont.c Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/amd64/conf/VT (from r260888, head/sys/amd64/conf/VT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/conf/VT Thu Mar 6 18:30:56 2014 (r262861, copy of r260888, head/sys/amd64/conf/VT) @@ -0,0 +1,14 @@ +# VT -- kernel config using the vt(9) system console instead of legacy syscons +# +# For more information see https://wiki.freebsd.org/Newcons +# +# $FreeBSD$ + +include GENERIC +ident VT + +nodevice sc +nodevice vga + +device vt +device vt_vga Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/conf/files Thu Mar 6 18:30:56 2014 (r262861) @@ -87,7 +87,7 @@ pccarddevs.h standard \ compile-with "${AWK} -f $S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \ no-obj no-implicit-rule before-depend \ clean "pccarddevs.h" -teken_state.h optional sc \ +teken_state.h optional sc | vt \ dependency "$S/teken/gensequences $S/teken/sequences" \ compile-with "${AWK} -f $S/teken/gensequences $S/teken/sequences > teken_state.h" \ no-obj no-implicit-rule before-depend \ @@ -1400,7 +1400,9 @@ dev/ex/if_ex_isa.c optional ex isa dev/ex/if_ex_pccard.c optional ex pccard dev/exca/exca.c optional cbb dev/fatm/if_fatm.c optional fatm pci -dev/fb/splash.c optional splash +dev/fb/fbd.c optional fbd | vt +dev/fb/fb_if.m standard +dev/fb/splash.c optional sc splash dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_ic_if.m optional fdt dev/fdt/fdt_pci.c optional fdt pci @@ -2500,6 +2502,17 @@ dev/vge/if_vge.c optional vge dev/vkbd/vkbd.c optional vkbd dev/vr/if_vr.c optional vr pci +dev/vt/colors/vt_termcolors.c optional vt +dev/vt/font/vt_font_default.c optional vt +dev/vt/font/vt_mouse_cursor.c optional vt +dev/vt/hw/fb/vt_fb.c optional vt +dev/vt/hw/vga/vga.c optional vt vt_vga +dev/vt/logo/logo_freebsd.c optional vt splash +dev/vt/vt_buf.c optional vt +dev/vt/vt_consolectl.c optional vt +dev/vt/vt_core.c optional vt +dev/vt/vt_font.c optional vt +dev/vt/vt_sysmouse.c optional vt dev/vte/if_vte.c optional vte pci dev/vx/if_vx.c optional vx dev/vx/if_vx_eisa.c optional vx eisa @@ -2936,6 +2949,7 @@ kern/subr_sleepqueue.c standard kern/subr_smp.c standard kern/subr_stack.c optional ddb | stack | ktr kern/subr_taskqueue.c standard +kern/subr_terminal.c optional vt kern/subr_trap.c standard kern/subr_turnstile.c standard kern/subr_uio.c standard @@ -3842,7 +3856,7 @@ security/mac_portacl/mac_portacl.c optio security/mac_seeotheruids/mac_seeotheruids.c optional mac_seeotheruids security/mac_stub/mac_stub.c optional mac_stub security/mac_test/mac_test.c optional mac_test -teken/teken.c optional sc +teken/teken.c optional sc | vt ufs/ffs/ffs_alloc.c optional ffs ufs/ffs/ffs_balloc.c optional ffs ufs/ffs/ffs_inode.c optional ffs Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/conf/files.amd64 Thu Mar 6 18:30:56 2014 (r262861) @@ -241,7 +241,7 @@ dev/hyperv/vmbus/hv_connection.c optio dev/hyperv/vmbus/hv_hv.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv -dev/kbd/kbd.c optional atkbd | sc | ukbd +dev/kbd/kbd.c optional atkbd | sc | ukbd | vt dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev dev/nfe/if_nfe.c optional nfe pci Modified: stable/10/sys/conf/files.arm ============================================================================== --- stable/10/sys/conf/files.arm Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/conf/files.arm Thu Mar 6 18:30:56 2014 (r262861) @@ -62,7 +62,7 @@ crypto/blowfish/bf_enc.c optional crypto crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/fb/fb.c optional sc dev/hwpmc/hwpmc_arm.c optional hwpmc -dev/kbd/kbd.c optional sc +dev/kbd/kbd.c optional sc | vt dev/syscons/scgfbrndr.c optional sc dev/syscons/scterm-teken.c optional sc dev/syscons/scvtb.c optional sc Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/conf/files.i386 Thu Mar 6 18:30:56 2014 (r262861) @@ -249,7 +249,7 @@ dev/ipmi/ipmi_smbios.c optional ipmi dev/ipmi/ipmi_ssif.c optional ipmi smbus dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux -dev/kbd/kbd.c optional atkbd | sc | ukbd +dev/kbd/kbd.c optional atkbd | sc | ukbd | vt dev/le/if_le_isa.c optional le isa dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev @@ -293,6 +293,7 @@ dev/viawd/viawd.c optional viawd dev/vmware/vmxnet3/if_vmx.c optional vmx dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard +dev/vt/hw/xboxfb/xboxfb.c optional vt_xboxfb dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/conf/files.powerpc Thu Mar 6 18:30:56 2014 (r262861) @@ -35,7 +35,7 @@ dev/iicbus/ad7417.c optional ad7417 pow dev/iicbus/ds1631.c optional ds1631 powermac dev/iicbus/ds1775.c optional ds1775 powermac dev/iicbus/max6690.c optional max6690 powermac -dev/kbd/kbd.c optional sc +dev/kbd/kbd.c optional sc | vt dev/nand/nfc_fsl.c optional nand mpc85xx # ofw can be either aim or fdt: fdt case handled in files. aim only powerpc specific. dev/ofw/openfirm.c optional aim @@ -65,6 +65,7 @@ dev/tsec/if_tsec_fdt.c optional tsec fd dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_cpu_powerpc.c optional uart aim dev/usb/controller/ehci_fsl.c optional ehci mpc85xx +dev/vt/hw/ofwfb/ofwfb.c optional vt aim kern/kern_clocksource.c standard kern/subr_dummy_vdso_tc.c standard kern/syscalls.c optional ktr Modified: stable/10/sys/conf/files.sparc64 ============================================================================== --- stable/10/sys/conf/files.sparc64 Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/conf/files.sparc64 Thu Mar 6 18:30:56 2014 (r262861) @@ -39,7 +39,7 @@ dev/fb/fb.c optional sc dev/fb/gallant12x22.c optional sc dev/fb/machfb.c optional machfb sc dev/hwpmc/hwpmc_sparc64.c optional hwpmc -dev/kbd/kbd.c optional atkbd | sc | ukbd +dev/kbd/kbd.c optional atkbd | sc | ukbd | vt dev/le/if_le_lebuffer.c optional le sbus dev/le/if_le_ledma.c optional le sbus dev/le/lebuffer_sbus.c optional le sbus @@ -59,7 +59,8 @@ dev/syscons/scgfbrndr.c optional sc dev/syscons/scterm-teken.c optional sc dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_sparc64.c optional uart -dev/uart/uart_kbd_sun.c optional uart sc +dev/uart/uart_kbd_sun.c optional uart sc | vt +dev/vt/hw/ofwfb/ofwfb.c optional vt kern/kern_clocksource.c standard kern/subr_dummy_vdso_tc.c standard kern/syscalls.c optional ktr Modified: stable/10/sys/conf/kmod.mk ============================================================================== --- stable/10/sys/conf/kmod.mk Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/conf/kmod.mk Thu Mar 6 18:30:56 2014 (r262861) @@ -340,7 +340,7 @@ CFLAGS+= ${CONF_CFLAGS} MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \ dev/agp/agp_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \ - dev/gpio/gpio_if.m dev/gpio/gpiobus_if.m \ + dev/fb/fb_if.m dev/gpio/gpio_if.m dev/gpio/gpiobus_if.m \ dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \ dev/mmc/mmcbr_if.m dev/mmc/mmcbus_if.m \ dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \ Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/conf/options Thu Mar 6 18:30:56 2014 (r262861) @@ -732,8 +732,10 @@ SAFE_DEBUG opt_safe.h SAFE_NO_RNG opt_safe.h SAFE_RNDTEST opt_safe.h -# syscons options +# syscons/vt options MAXCONS opt_syscons.h +VT_FB_DEFAULT_WIDTH opt_syscons.h +VT_FB_DEFAULT_HEIGHT opt_syscons.h SC_ALT_MOUSE_IMAGE opt_syscons.h SC_CUT_SPACES2TABS opt_syscons.h SC_CUT_SEPCHARS opt_syscons.h @@ -756,6 +758,9 @@ SC_NORM_REV_ATTR opt_syscons.h SC_PIXEL_MODE opt_syscons.h SC_RENDER_DEBUG opt_syscons.h SC_TWOBUTTON_MOUSE opt_syscons.h +DEV_SC opt_syscons.h +DEV_VT opt_syscons.h + # teken terminal emulator options TEKEN_CONS25 opt_teken.h Modified: stable/10/sys/dev/drm2/drmP.h ============================================================================== --- stable/10/sys/dev/drm2/drmP.h Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/dev/drm2/drmP.h Thu Mar 6 18:30:56 2014 (r262861) @@ -113,6 +113,7 @@ struct drm_device; #include "opt_compat.h" #include "opt_drm.h" +#include "opt_syscons.h" #ifdef DRM_DEBUG #undef DRM_DEBUG #define DRM_DEBUG_DEFAULT_ON 1 Modified: stable/10/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- stable/10/sys/dev/drm2/drm_fb_helper.c Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/dev/drm2/drm_fb_helper.c Thu Mar 6 18:30:56 2014 (r262861) @@ -36,6 +36,41 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(__FreeBSD__) +struct vt_kms_softc { + struct drm_fb_helper *fb_helper; + struct task fb_mode_task; +}; + +static fb_enter_t vt_kms_postswitch; +static void vt_restore_fbdev_mode(void *, int); + +/* Call restore out of vt(9) locks. */ +static void +vt_restore_fbdev_mode(void *arg, int pending) +{ + struct drm_fb_helper *fb_helper; + struct vt_kms_softc *sc; + + sc = (struct vt_kms_softc *)arg; + fb_helper = sc->fb_helper; + sx_xlock(&fb_helper->dev->mode_config.mutex); + drm_fb_helper_restore_fbdev_mode(fb_helper); + sx_xunlock(&fb_helper->dev->mode_config.mutex); +} + +static int +vt_kms_postswitch(void *arg) +{ + struct vt_kms_softc *sc; + + sc = (struct vt_kms_softc *)arg; + taskqueue_enqueue_fast(taskqueue_thread, &sc->fb_mode_task); + + return (0); +} +#endif + static DRM_LIST_HEAD(kernel_fb_helper_list); /* simple single crtc case helper function */ @@ -216,6 +251,10 @@ static int fb_get_options(const char *connector_name, char **option) { + /* + * TODO: store mode options pointer in ${option} for connector with + * name ${connector_name} + */ return (1); } @@ -892,11 +931,13 @@ int drm_fb_helper_single_fb_probe(struct int new_fb = 0; int crtc_count = 0; int i; -#if 0 struct fb_info *info; -#endif 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; @@ -973,8 +1014,21 @@ int drm_fb_helper_single_fb_probe(struct if (new_fb < 0) return new_fb; -#if 0 +#if defined(__FreeBSD__) + sc = malloc(sizeof(struct vt_kms_softc), DRM_MEM_KMS, + M_WAITOK | M_ZERO); + sc->fb_helper = fb_helper; + TASK_INIT(&sc->fb_mode_task, 0, vt_restore_fbdev_mode, sc); + info = fb_helper->fbdev; + + info->fb_name = device_get_nameunit(fb_helper->dev->device); + info->fb_depth = fb_helper->fb->bits_per_pixel; + info->fb_height = fb_helper->fb->height; + info->fb_width = fb_helper->fb->width; + info->fb_stride = fb_helper->fb->pitches[0]; + info->fb_priv = sc; + info->enter = &vt_kms_postswitch; #endif /* set the fb pointer */ @@ -982,7 +1036,23 @@ int drm_fb_helper_single_fb_probe(struct fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; } -#if 0 +#if defined(__FreeBSD__) + if (new_fb) { + device_t fbd; + int ret; + + kdev = fb_helper->dev->device; + fbd = device_add_child(kdev, "fbd", device_get_unit(kdev)); + if (fbd != NULL) + ret = device_probe_and_attach(fbd); + else + ret = ENODEV; +#ifdef DEV_VT + if (ret != 0) + DRM_ERROR("Failed to attach fbd device: %d\n", ret); +#endif + } +#else if (new_fb) { info->var.pixclock = 0; if (register_framebuffer(info) < 0) { @@ -1006,7 +1076,6 @@ int drm_fb_helper_single_fb_probe(struct if (new_fb) list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); #endif - return 0; } Modified: stable/10/sys/dev/drm2/drm_os_freebsd.h ============================================================================== --- stable/10/sys/dev/drm2/drm_os_freebsd.h Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/dev/drm2/drm_os_freebsd.h Thu Mar 6 18:30:56 2014 (r262861) @@ -6,6 +6,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #if _BYTE_ORDER == _BIG_ENDIAN #define __BIG_ENDIAN 4321 #else Modified: stable/10/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_drv.c Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/dev/drm2/i915/i915_drv.c Thu Mar 6 18:30:56 2014 (r262861) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "fb_if.h" + /* drv_PCI_IDs comes from drm_pciids.h, generated from drm_pciids.txt. */ static drm_pci_id_list_t i915_pciidlist[] = { i915_PCI_IDS @@ -380,6 +382,25 @@ i915_attach(device_t kdev) return (drm_attach(kdev, i915_pciidlist)); } +static struct fb_info * +i915_fb_helper_getinfo(device_t kdev) +{ + struct intel_fbdev *ifbdev; + drm_i915_private_t *dev_priv; + struct drm_device *dev; + struct fb_info *info; + + dev = device_get_softc(kdev); + dev_priv = dev->dev_private; + ifbdev = dev_priv->fbdev; + if (ifbdev == NULL) + return (NULL); + + info = ifbdev->helper.fbdev; + + return (info); +} + const struct intel_device_info * i915_get_device_id(int device) { @@ -400,6 +421,10 @@ static device_method_t i915_methods[] = DEVMETHOD(device_suspend, i915_suspend), DEVMETHOD(device_resume, i915_resume), DEVMETHOD(device_detach, drm_detach), + + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, i915_fb_helper_getinfo), + DEVMETHOD_END }; Modified: stable/10/sys/dev/drm2/i915/intel_fb.c ============================================================================== --- stable/10/sys/dev/drm2/i915/intel_fb.c Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/dev/drm2/i915/intel_fb.c Thu Mar 6 18:30:56 2014 (r262861) @@ -41,8 +41,8 @@ static int intelfb_create(struct intel_f struct drm_device *dev = ifbdev->helper.dev; #if 0 struct drm_i915_private *dev_priv = dev->dev_private; - struct fb_info *info; #endif + struct fb_info *info; struct drm_framebuffer *fb; struct drm_mode_fb_cmd2 mode_cmd; struct drm_i915_gem_object *obj; @@ -86,6 +86,16 @@ static int intelfb_create(struct intel_f } info->par = ifbdev; +#else + info = malloc(sizeof(struct fb_info), DRM_MEM_KMS, M_WAITOK | M_ZERO); + info->fb_size = size; + info->fb_bpp = sizes->surface_bpp; + info->fb_width = sizes->fb_width; + info->fb_height = sizes->fb_height; + info->fb_pbase = dev->agp->base + obj->gtt_offset; + info->fb_vbase = (vm_offset_t)pmap_mapdev_attr(info->fb_pbase, size, + PAT_WRITE_COMBINING); + #endif ret = intel_framebuffer_init(dev, &ifbdev->ifb, &mode_cmd, obj); @@ -95,8 +105,8 @@ static int intelfb_create(struct intel_f fb = &ifbdev->ifb.base; ifbdev->helper.fb = fb; -#if 0 ifbdev->helper.fbdev = info; +#if 0 strcpy(info->fix.id, "inteldrmfb"); @@ -135,9 +145,8 @@ static int intelfb_create(struct intel_f /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ #endif - - DRM_DEBUG_KMS("allocated %dx%d fb: 0x%08x, bo %p\n", - fb->width, fb->height, + DRM_DEBUG_KMS("allocated %dx%d (s %dbits) fb: 0x%08x, bo %p\n", + fb->width, fb->height, fb->depth, obj->gtt_offset, obj); DRM_UNLOCK(dev); Modified: stable/10/sys/dev/drm2/radeon/radeon.h ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon.h Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/dev/drm2/radeon/radeon.h Thu Mar 6 18:30:56 2014 (r262861) @@ -2041,6 +2041,9 @@ void radeon_pm_acpi_event_handler(struct int radeon_ttm_init(struct radeon_device *rdev); void radeon_ttm_fini(struct radeon_device *rdev); +/* radeon_fb.c */ +struct fb_info * radeon_fb_helper_getinfo(device_t kdev); + /* r600.c */ int r600_ih_ring_alloc(struct radeon_device *rdev); void r600_ih_ring_fini(struct radeon_device *rdev); Modified: stable/10/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_drv.c Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/dev/drm2/radeon/radeon_drv.c Thu Mar 6 18:30:56 2014 (r262861) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include +#include "fb_if.h" /* * KMS wrapper. @@ -495,6 +496,8 @@ radeon_resume(device_t kdev) return (-ret); } +extern struct fb_info * radeon_fb_helper_getinfo(device_t kdev); + static device_method_t radeon_methods[] = { /* Device interface */ DEVMETHOD(device_probe, radeon_probe), @@ -502,6 +505,10 @@ static device_method_t radeon_methods[] DEVMETHOD(device_suspend, radeon_suspend), DEVMETHOD(device_resume, radeon_resume), DEVMETHOD(device_detach, drm_detach), + + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, radeon_fb_helper_getinfo), + DEVMETHOD_END }; Modified: stable/10/sys/dev/drm2/radeon/radeon_fb.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_fb.c Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/dev/drm2/radeon/radeon_fb.c Thu Mar 6 18:30:56 2014 (r262861) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -46,7 +48,7 @@ struct radeon_fbdev { struct radeon_device *rdev; }; -#ifdef DUMBBELL_WIP +#if defined(__linux__) static struct fb_ops radeonfb_ops = { .owner = THIS_MODULE, .fb_check_var = drm_fb_helper_check_var, @@ -60,7 +62,7 @@ static struct fb_ops radeonfb_ops = { .fb_debug_enter = drm_fb_helper_debug_enter, .fb_debug_leave = drm_fb_helper_debug_leave, }; -#endif /* DUMBBELL_WIP */ +#endif int radeon_align_pitch(struct radeon_device *rdev, int width, int bpp, bool tiled) @@ -191,20 +193,13 @@ static int radeonfb_create(struct radeon struct drm_fb_helper_surface_size *sizes) { struct radeon_device *rdev = rfbdev->rdev; -#ifdef DUMBBELL_WIP struct fb_info *info; -#endif /* DUMBBELL_WIP */ struct drm_framebuffer *fb = NULL; struct drm_mode_fb_cmd2 mode_cmd; struct drm_gem_object *gobj = NULL; struct radeon_bo *rbo = NULL; -#ifdef DUMBBELL_WIP - device_t device = rdev->dev; -#endif /* DUMBBELL_WIP */ int ret; -#ifdef DUMBBELL_WIP unsigned long tmp; -#endif /* DUMBBELL_WIP */ mode_cmd.width = sizes->surface_width; mode_cmd.height = sizes->surface_height; @@ -224,16 +219,7 @@ static int radeonfb_create(struct radeon rbo = gem_to_radeon_bo(gobj); -#ifdef DUMBBELL_WIP - /* okay we have an object now allocate the framebuffer */ - info = framebuffer_alloc(0, device); - if (info == NULL) { - ret = -ENOMEM; - goto out_unref; - } - - info->par = rfbdev; -#endif /* DUMBBELL_WIP */ + info = malloc(sizeof(*info), DRM_MEM_KMS, M_WAITOK | M_ZERO); ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->rfb, &mode_cmd, gobj); if (ret) { @@ -245,61 +231,29 @@ static int radeonfb_create(struct radeon /* setup helper */ rfbdev->helper.fb = fb; -#ifdef DUMBBELL_WIP rfbdev->helper.fbdev = info; - memset_io(rbo->kptr, 0x0, radeon_bo_size(rbo)); - - strcpy(info->fix.id, "radeondrmfb"); - - drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); - - info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT; - info->fbops = &radeonfb_ops; + memset(rbo->kptr, 0x0, radeon_bo_size(rbo)); tmp = radeon_bo_gpu_offset(rbo) - rdev->mc.vram_start; - info->fix.smem_start = rdev->mc.aper_base + tmp; - info->fix.smem_len = radeon_bo_size(rbo); - info->screen_base = rbo->kptr; - info->screen_size = radeon_bo_size(rbo); - - drm_fb_helper_fill_var(info, &rfbdev->helper, sizes->fb_width, sizes->fb_height); - - /* setup aperture base/size for vesafb takeover */ - info->apertures = alloc_apertures(1); - if (!info->apertures) { - ret = -ENOMEM; - goto out_unref; - } - info->apertures->ranges[0].base = rdev->ddev->mode_config.fb_base; - info->apertures->ranges[0].size = rdev->mc.aper_size; + info->fb_size = radeon_bo_size(rbo); + info->fb_bpp = sizes->surface_bpp; + info->fb_width = sizes->surface_width; + info->fb_height = sizes->surface_height; + info->fb_pbase = rdev->mc.aper_base + tmp; + info->fb_vbase = (vm_offset_t)rbo->kptr; - /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ - - if (info->screen_base == NULL) { - ret = -ENOSPC; - goto out_unref; - } - - ret = fb_alloc_cmap(&info->cmap, 256, 0); - if (ret) { - ret = -ENOMEM; - goto out_unref; - } - - DRM_INFO("fb mappable at 0x%lX\n", info->fix.smem_start); + DRM_INFO("fb mappable at 0x%" PRIXPTR "\n", info->fb_pbase); DRM_INFO("vram apper at 0x%lX\n", (unsigned long)rdev->mc.aper_base); DRM_INFO("size %lu\n", (unsigned long)radeon_bo_size(rbo)); DRM_INFO("fb depth is %d\n", fb->depth); DRM_INFO(" pitch is %d\n", fb->pitches[0]); - vga_switcheroo_client_fb_set(rdev->ddev->pdev, info); -#endif /* DUMBBELL_WIP */ return 0; out_unref: if (rbo) { - + /* TODO? dumbbell@ */ } if (fb && ret) { drm_gem_object_unreference(gobj); @@ -332,21 +286,13 @@ void radeon_fb_output_poll_changed(struc static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfbdev) { -#ifdef DUMBBELL_WIP struct fb_info *info; -#endif /* DUMBBELL_WIP */ struct radeon_framebuffer *rfb = &rfbdev->rfb; -#ifdef DUMBBELL_WIP if (rfbdev->helper.fbdev) { info = rfbdev->helper.fbdev; - - unregister_framebuffer(info); - if (info->cmap.len) - fb_dealloc_cmap(&info->cmap); - framebuffer_release(info); + free(info, DRM_MEM_KMS); } -#endif /* DUMBBELL_WIP */ if (rfb->obj) { DRM_UNLOCK(dev); /* Work around lock recursion. dumbbell@ */ @@ -431,3 +377,22 @@ bool radeon_fbdev_robj_is_fb(struct rade return true; return false; } + +struct fb_info * +radeon_fb_helper_getinfo(device_t kdev) +{ + struct drm_device *dev; + struct radeon_device *rdev; + struct radeon_fbdev *rfbdev; + struct fb_info *info; + + dev = device_get_softc(kdev); + rdev = dev->dev_private; + rfbdev = rdev->mode_info.rfbdev; + if (rfbdev == NULL) + return (NULL); + + info = rfbdev->helper.fbdev; + + return (info); +} Modified: stable/10/sys/dev/drm2/radeon/radeon_pm.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_pm.c Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/dev/drm2/radeon/radeon_pm.c Thu Mar 6 18:30:56 2014 (r262861) @@ -248,7 +248,7 @@ static void radeon_pm_set_clocks(struct (rdev->pm.requested_power_state_index == rdev->pm.current_power_state_index)) return; - DRM_LOCK(rdev->ddev); + //DRM_LOCK(rdev->ddev); XXX Recursion, already locked in drm_attach/drm_load -- dumbbell@ sx_xlock(&rdev->pm.mclk_lock); sx_xlock(&rdev->ring_lock); @@ -263,7 +263,7 @@ static void radeon_pm_set_clocks(struct /* needs a GPU reset dont reset here */ sx_xunlock(&rdev->ring_lock); sx_xunlock(&rdev->pm.mclk_lock); - DRM_UNLOCK(rdev->ddev); + //DRM_UNLOCK(rdev->ddev); XXX Recursion, already locked in drm_attach/drm_load -- dumbbell@ return; } } @@ -299,7 +299,7 @@ static void radeon_pm_set_clocks(struct sx_xunlock(&rdev->ring_lock); sx_xunlock(&rdev->pm.mclk_lock); - DRM_UNLOCK(rdev->ddev); + //DRM_UNLOCK(rdev->ddev); XXX Recursion, already locked in drm_attach/drm_load -- dumbbell@ } static void radeon_pm_print_states(struct radeon_device *rdev) Copied: stable/10/sys/dev/fb/fb_if.m (from r259016, head/sys/dev/fb/fb_if.m) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/fb/fb_if.m Thu Mar 6 18:30:56 2014 (r262861, copy of r259016, head/sys/dev/fb/fb_if.m) @@ -0,0 +1,13 @@ +#include +#include + +INTERFACE fb; + +METHOD int pin_max { + device_t dev; + int *npins; +}; + +METHOD struct fb_info * getinfo { + device_t dev; +}; Copied and modified: stable/10/sys/dev/fb/fbd.c (from r259016, head/sys/dev/fb/fbd.c) ============================================================================== --- head/sys/dev/fb/fbd.c Thu Dec 5 22:38:53 2013 (r259016, copy source) +++ stable/10/sys/dev/fb/fbd.c Thu Mar 6 18:30:56 2014 (r262861) @@ -255,8 +255,12 @@ fb_probe(struct fb_info *info) info->wr4 = &vt_fb_indir_wr4; info->copy = &vt_fb_indir_copy; } else if (info->fb_vbase != 0) { - if (info->fb_pbase == 0) + if (info->fb_pbase == 0) { info->fb_flags |= FB_FLAG_NOMMAP; + } else { + if (info->fb_mmap == NULL) + info->fb_mmap = &fb_mmap; + } info->wr1 = &vt_fb_mem_wr1; info->wr2 = &vt_fb_mem_wr2; info->wr4 = &vt_fb_mem_wr4; @@ -264,6 +268,10 @@ fb_probe(struct fb_info *info) } else return (ENXIO); + if (info->fb_ioctl == NULL) + info->fb_ioctl = &fb_ioctl; + + return (0); } @@ -277,6 +285,7 @@ fb_init(struct fb_list_entry *entry, int entry->fb_si = make_dev(&fb_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "fb%d", unit); entry->fb_si->si_drv1 = info; + info->fb_cdev = entry->fb_si; return (0); } Modified: stable/10/sys/dev/syscons/scterm-teken.c ============================================================================== --- stable/10/sys/dev/syscons/scterm-teken.c Thu Mar 6 17:33:27 2014 (r262860) +++ stable/10/sys/dev/syscons/scterm-teken.c Thu Mar 6 18:30:56 2014 (r262861) @@ -553,7 +553,14 @@ scteken_putchar(void *arg, const teken_p vm_offset_t p; int cursor, attr; + /* + * No support for printing right hand sides for CJK fullwidth + * characters. Simply print a space and assume that the left + * hand side describes the entire character. + */ attr = scteken_attr(a) << 8; + if (a->ta_format & TF_CJK_RIGHT) + c = ' '; #ifdef TEKEN_UTF8 scteken_get_cp437(&c, &attr); #endif /* TEKEN_UTF8 */ Modified: stable/10/sys/dev/vt/font/vt_font_default.c ============================================================================== --- head/sys/dev/vt/font/vt_font_default.c Thu Dec 5 22:38:53 2013 (r259016) +++ stable/10/sys/dev/vt/font/vt_font_default.c Thu Mar 6 18:30:56 2014 (r262861) @@ -2194,9 +2194,12 @@ struct vt_font vt_font_default = { .vf_width = 8, .vf_height = 16, .vf_bytes = font_bytes, - .vf_normal = font_mapping_normal, - .vf_normal_length = 248, - .vf_bold = font_mapping_bold, - .vf_bold_length = 260, + .vf_map = { + font_mapping_normal, + NULL, + font_mapping_bold, + NULL, + }, + .vf_map_count = { 248, 0, 260, 0 }, .vf_refcount = 1, }; Modified: stable/10/sys/dev/vt/font/vt_mouse_cursor.c ============================================================================== --- head/sys/dev/vt/font/vt_mouse_cursor.c Thu Dec 5 22:38:53 2013 (r259016) +++ stable/10/sys/dev/vt/font/vt_mouse_cursor.c Thu Mar 6 18:30:56 2014 (r262861) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#ifndef SC_NO_CUTPASTE struct mouse_cursor vt_default_mouse_pointer = { .map = { 0x00, /* "__ " */ @@ -66,3 +67,4 @@ struct mouse_cursor vt_default_mouse_poi .w = 8, .h = 13, }; +#endif Modified: stable/10/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Thu Dec 5 22:38:53 2013 (r259016) +++ stable/10/sys/dev/vt/hw/fb/vt_fb.c Thu Mar 6 18:30:56 2014 (r262861) @@ -41,14 +41,103 @@ __FBSDID("$FreeBSD$"); #include #include +static int vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, + struct thread *td); +static int vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, + vm_paddr_t *paddr, int prot, vm_memattr_t *memattr); +void vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, + int fill, term_color_t color); +void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color); + static struct vt_driver vt_fb_driver = { .vd_init = vt_fb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_postswitch = vt_fb_postswitch, .vd_priority = VD_PRIORITY_GENERIC+10, + .vd_fb_ioctl = vt_fb_ioctl, + .vd_fb_mmap = vt_fb_mmap, }; +static int +vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, struct thread *td) +{ + struct fb_info *info; + + info = vd->vd_softc; + + if (info->fb_ioctl == NULL) + return (-1); + + return (info->fb_ioctl(info->fb_cdev, cmd, data, 0, td)); +} + +static int +vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) +{ + struct fb_info *info; + + info = vd->vd_softc; + + if (info->fb_ioctl == NULL) + return (ENXIO); + + return (info->fb_mmap(info->fb_cdev, offset, paddr, prot, memattr)); +} + +void +vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color) +{ + struct fb_info *info; + uint32_t c; + u_int o; + + info = vd->vd_softc; + c = info->fb_cmap[color]; + o = info->fb_stride * y + x * FBTYPE_GET_BYTESPP(info); + + switch (FBTYPE_GET_BYTESPP(info)) { + case 1: + info->wr1(info, o, c); + break; + case 2: + info->wr2(info, o, c); + break; + case 3: + info->wr1(info, o, (c >> 16) & 0xff); + info->wr1(info, o + 1, (c >> 8) & 0xff); + info->wr1(info, o + 2, c & 0xff); + break; + case 4: + info->wr4(info, o, c); + break; + default: + /* panic? */ + return; + } + +} + +void +vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, + term_color_t color) +{ + int x, y; + + for (y = y1; y <= y2; y++) { + if (fill || (y == y1) || (y == y2)) { + for (x = x1; x <= x2; x++) + vt_fb_setpixel(vd, x, y, color); + } else { + vt_fb_setpixel(vd, x1, y, color); + vt_fb_setpixel(vd, x2, y, color); + } + } +} + void vt_fb_blank(struct vt_device *vd, term_color_t color) { Modified: stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Thu Dec 5 22:38:53 2013 (r259016) +++ stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c Thu Mar 6 18:30:56 2014 (r262861) @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: user/ed/newcons/sys/dev/vt/hw/ofwfb/ofwfb.c 219888 2011-03-22 21:31:31Z ed $"); +__FBSDID("$FreeBSD$"); #include #include @@ -78,17 +78,19 @@ static void ofwfb_blank(struct vt_device *vd, term_color_t color) { struct ofwfb_softc *sc = vd->vd_softc; - u_int ofs; + u_int ofs, size; uint32_t c; + size = sc->sc_stride * vd->vd_height; switch (sc->sc_depth) { case 8: - for (ofs = 0; ofs < sc->sc_stride*vd->vd_height; ofs++) - *(uint8_t *)(sc->sc_addr + ofs) = color; + c = (color << 24) | (color << 16) | (color << 8) | color; + for (ofs = 0; ofs < size/4; ofs++) + *(uint32_t *)(sc->sc_addr + 4*ofs) = c; break; case 32: c = sc->sc_colormap[color]; - for (ofs = 0; ofs < sc->sc_stride*vd->vd_height; ofs++) + for (ofs = 0; ofs < size; ofs++) *(uint32_t *)(sc->sc_addr + 4*ofs) = c; break; default: Modified: stable/10/sys/dev/vt/hw/vga/vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vga.c Thu Dec 5 22:38:53 2013 (r259016) +++ stable/10/sys/dev/vt/hw/vga/vga.c Thu Mar 6 18:30:56 2014 (r262861) @@ -74,13 +74,19 @@ struct vga_softc { static vd_init_t vga_init; static vd_blank_t vga_blank; static vd_bitbltchr_t vga_bitbltchr; +static vd_drawrect_t vga_drawrect; +static vd_setpixel_t vga_setpixel; static vd_putchar_t vga_putchar; +static vd_postswitch_t vga_postswitch; static const struct vt_driver vt_vga_driver = { .vd_init = vga_init, .vd_blank = vga_blank, .vd_bitbltchr = vga_bitbltchr, + .vd_drawrect = vga_drawrect, + .vd_setpixel = vga_setpixel, .vd_putchar = vga_putchar, + .vd_postswitch = vga_postswitch, .vd_priority = VD_PRIORITY_GENERIC, }; @@ -137,6 +143,31 @@ vga_bitblt_put(struct vt_device *vd, u_l } } +static void +vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) +{ + + vga_bitblt_put(vd, (y * VT_VGA_WIDTH / 8) + (x / 8), color, + 0x80 >> (x % 8)); +} + +static void +vga_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, + term_color_t color) +{ + int x, y; + + for (y = y1; y <= y2; y++) { + if (fill || (y == y1) || (y == y2)) { + for (x = x1; x <= x2; x++) + vga_setpixel(vd, x, y, color); + } else { + vga_setpixel(vd, x1, y, color); + vga_setpixel(vd, x2, y, color); + } + } +} + static inline void vga_bitblt_draw(struct vt_device *vd, const uint8_t *src, u_long ldst, uint8_t shift, unsigned int width, unsigned int height, @@ -602,3 +633,13 @@ vga_init(struct vt_device *vd) return (CN_INTERNAL); } + +static void +vga_postswitch(struct vt_device *vd) +{ + + /* Reinit VGA mode, to restore view after app which change mode. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 20:50:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3061E3DC; Thu, 6 Mar 2014 20:50:53 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 04FDE9F5; Thu, 6 Mar 2014 20:50:53 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 06BBBB946; Thu, 6 Mar 2014 15:50:51 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r262861 - in stable/10: sys/amd64/conf sys/conf sys/dev/drm2 sys/dev/drm2/i915 sys/dev/drm2/radeon sys/dev/fb sys/dev/syscons sys/dev/vt sys/dev/vt/font sys/dev/vt/hw/fb sys/dev/vt/hw/o... Date: Thu, 6 Mar 2014 14:04:39 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403061830.s26IUvJG037341@svn.freebsd.org> In-Reply-To: <201403061830.s26IUvJG037341@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201403061404.39820.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 06 Mar 2014 15:50:51 -0500 (EST) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 20:50:53 -0000 On Thursday, March 06, 2014 1:30:57 pm John Baldwin wrote: > Author: jhb > Date: Thu Mar 6 18:30:56 2014 > New Revision: 262861 > URL: http://svnweb.freebsd.org/changeset/base/262861 > > Log: > MFC 259016,259019,259049,259071,259102,259110,259129,259130,259178,259179, > 259203,259221,259261,259532,259615,259650,259651,259667,259680,259727, > 259761,259772,259776,259777,259830,259882,259915,260160,260449,260450, > 260688,260888,260953,261269,261547,261551,261552,261553,261585: > Merge the vt(4) driver (newcons) to stable/10. > > Approved by: ray Just as in HEAD, this is not on by default but must be enabled in your kernel config. I did runtime test this over the weekend on my desktop box with an nvidia card. It suffered from the slowness described on arch@ but otherwise worked fine. -- John Baldwin From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 21:47:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 032787DC; Thu, 6 Mar 2014 21:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1FC3F0B; Thu, 6 Mar 2014 21:47: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 s26LlMwk019436; Thu, 6 Mar 2014 21:47:22 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26LlM2m019434; Thu, 6 Mar 2014 21:47:22 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403062147.s26LlM2m019434@svn.freebsd.org> From: Alan Somers Date: Thu, 6 Mar 2014 21:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262871 - stable/10/tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 21:47:23 -0000 Author: asomers Date: Thu Mar 6 21:47:22 2014 New Revision: 262871 URL: http://svnweb.freebsd.org/changeset/base/262871 Log: MFC r262133 test_eagain_*_* should've been using nonblocking sockets instead of blocking sockets. The error was not exposed as long as the kernel suffered from PR kern/185812. Now corrected, these tests pass on DragonFlyBSD 3.6.0. Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- stable/10/tests/sys/kern/unix_seqpacket_test.c Thu Mar 6 21:07:13 2014 (r262870) +++ stable/10/tests/sys/kern/unix_seqpacket_test.c Thu Mar 6 21:47:22 2014 (r262871) @@ -136,7 +136,7 @@ test_eagain(size_t sndbufsize, size_t rc ssize_t ssize, rsize; /* setup the socket pair */ - do_socketpair(sv); + do_socketpair_nonblocking(sv); /* Setup the buffers */ ATF_REQUIRE_EQ(0, setsockopt(sv[0], SOL_SOCKET, SO_SNDBUF, &sndbufsize, sizeof(sndbufsize))); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 6 22:31:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CE5338B3; Thu, 6 Mar 2014 22:31:48 +0000 (UTC) Received: from fep16.mx.upcmail.net (fep16.mx.upcmail.net [62.179.121.36]) by mx1.freebsd.org (Postfix) with ESMTP id 5C4B53CF; Thu, 6 Mar 2014 22:31:46 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep16-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20140306223145.RALG17501.viefep16-int.chello.at@edge03.upcmail.net>; Thu, 6 Mar 2014 23:31:45 +0100 Received: from [127.0.0.1] ([178.84.134.112]) by edge03.upcmail.net with edge id aNXT1n0062Rg3Ey03NXTX8; Thu, 06 Mar 2014 23:31:27 +0100 X-SourceIP: 178.84.134.112 Message-ID: <5318F73E.4040202@rainbow-runner.nl> Date: Thu, 06 Mar 2014 23:31:26 +0100 From: Koop Mast User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r262861 - in stable/10: sys/amd64/conf sys/conf sys/dev/drm2 sys/dev/drm2/i915 sys/dev/drm2/radeon sys/dev/fb sys/dev/syscons sys/dev/vt sys/dev/vt/font sys/dev/vt/hw/fb sys/dev/vt/hw/o... References: <201403061830.s26IUvJG037341@svn.freebsd.org> In-Reply-To: <201403061830.s26IUvJG037341@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 140306-1, 06-03-2014), Outbound message X-Antivirus-Status: Clean X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 22:31:48 -0000 On 6-3-2014 19:30, John Baldwin wrote: > Author: jhb > Date: Thu Mar 6 18:30:56 2014 > New Revision: 262861 > URL: http://svnweb.freebsd.org/changeset/base/262861 > > Log: > MFC 259016,259019,259049,259071,259102,259110,259129,259130,259178,259179, > 259203,259221,259261,259532,259615,259650,259651,259667,259680,259727, > 259761,259772,259776,259777,259830,259882,259915,260160,260449,260450, > 260688,260888,260953,261269,261547,261551,261552,261553,261585: > Merge the vt(4) driver (newcons) to stable/10. > > Approved by: ray > > Hi John, Thanks for the merge! Can we get a __FreeBSD_version bump also to go with this fantastic commit? Thanks. -Koop From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 7 12:20:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8FDCF99A; Fri, 7 Mar 2014 12:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 626848D6; Fri, 7 Mar 2014 12:20: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 s27CK2TD024945; Fri, 7 Mar 2014 12:20:02 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27CK2nJ024940; Fri, 7 Mar 2014 12:20:02 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403071220.s27CK2nJ024940@svn.freebsd.org> From: Christian Brueffer Date: Fri, 7 Mar 2014 12:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262887 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 12:20:02 -0000 Author: brueffer Date: Fri Mar 7 12:20:01 2014 New Revision: 262887 URL: http://svnweb.freebsd.org/changeset/base/262887 Log: MFC: r262603 mdoc cleanup. Modified: stable/10/share/man/man4/nvd.4 stable/10/share/man/man4/nvme.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/nvd.4 ============================================================================== --- stable/10/share/man/man4/nvd.4 Fri Mar 7 09:45:40 2014 (r262886) +++ stable/10/share/man/man4/nvd.4 Fri Mar 7 12:20:01 2014 (r262887) @@ -65,7 +65,7 @@ I/O commands. .Sh SEE ALSO .Xr nvme 4 , .Xr nvmecontrol 8 , -.Xr disk 9 . +.Xr disk 9 .Sh HISTORY The .Nm Modified: stable/10/share/man/man4/nvme.4 ============================================================================== --- stable/10/share/man/man4/nvme.4 Fri Mar 7 09:45:40 2014 (r262886) +++ stable/10/share/man/man4/nvme.4 Fri Mar 7 12:20:01 2014 (r262887) @@ -73,9 +73,13 @@ API for registering NVMe namespace consu API for submitting NVM commands to namespaces .It Ioctls for controller and namespace configuration and management +.Pp .Nm -creates controller devices in the format /dev/nvmeX and namespace devices in -the format /dev/nvmeXnsY. +creates controller devices in the format +.Pa /dev/nvmeX +and namespace devices in +the format +.Pa /dev/nvmeXnsY . Note that the NVM Express specification starts numbering namespaces at 1, not 0, and this driver follows that convention. .El @@ -104,7 +108,8 @@ Note that use of INTx implies disabling The following controller-level sysctls are currently implemented: .Bl -tag -width indent .It Va dev.nvme.0.int_coal_time -(R/W) Interrupt coalescing timer period in microseconds. Set to 0 to disable. +(R/W) Interrupt coalescing timer period in microseconds. +Set to 0 to disable. .It Va dev.nvme.0.int_coal_threshold (R/W) Interrupt coalescing threshold in number of command completions. Set to 0 to disable. @@ -146,7 +151,7 @@ and completion queues to the console. .Xr nvd 4 , .Xr pci 4 , .Xr nvmecontrol 8 , -.Xr disk 9 . +.Xr disk 9 .Sh HISTORY The .Nm From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 7 14:38:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 466546EE; Fri, 7 Mar 2014 14:38:04 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B3D17AD; Fri, 7 Mar 2014 14:38:04 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E8763B97A; Fri, 7 Mar 2014 09:38:02 -0500 (EST) From: John Baldwin To: Koop Mast Subject: Re: svn commit: r262861 - in stable/10: sys/amd64/conf sys/conf sys/dev/drm2 sys/dev/drm2/i915 sys/dev/drm2/radeon sys/dev/fb sys/dev/syscons sys/dev/vt sys/dev/vt/font sys/dev/vt/hw/fb sys/dev/vt/hw/o... Date: Fri, 7 Mar 2014 08:41:06 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403061830.s26IUvJG037341@svn.freebsd.org> <5318F73E.4040202@rainbow-runner.nl> In-Reply-To: <5318F73E.4040202@rainbow-runner.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201403070841.06749.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 07 Mar 2014 09:38:03 -0500 (EST) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 14:38:04 -0000 On Thursday, March 06, 2014 5:31:26 pm Koop Mast wrote: > On 6-3-2014 19:30, John Baldwin wrote: > > Author: jhb > > Date: Thu Mar 6 18:30:56 2014 > > New Revision: 262861 > > URL: http://svnweb.freebsd.org/changeset/base/262861 > > > > Log: > > MFC 259016,259019,259049,259071,259102,259110,259129,259130,259178,259179, > > 259203,259221,259261,259532,259615,259650,259651,259667,259680,259727, > > 259761,259772,259776,259777,259830,259882,259915,260160,260449,260450, > > 260688,260888,260953,261269,261547,261551,261552,261553,261585: > > Merge the vt(4) driver (newcons) to stable/10. > > > > Approved by: ray > > > > > Hi John, > > Thanks for the merge! Can we get a __FreeBSD_version bump also to go > with this fantastic commit? Ooops, certainly. -- John Baldwin From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 7 14:44:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1CFD2DE7; Fri, 7 Mar 2014 14:44: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A2BC873; Fri, 7 Mar 2014 14:44: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 s27EiDvX087519; Fri, 7 Mar 2014 14:44:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27EiDbs087518; Fri, 7 Mar 2014 14:44:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201403071444.s27EiDbs087518@svn.freebsd.org> From: John Baldwin Date: Fri, 7 Mar 2014 14:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262889 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 14:44:14 -0000 Author: jhb Date: Fri Mar 7 14:44:13 2014 New Revision: 262889 URL: http://svnweb.freebsd.org/changeset/base/262889 Log: Bump __FreeBSD_version for the MFC of vt(4). Submitted by: Koop Mast Modified: stable/10/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Fri Mar 7 12:21:51 2014 (r262888) +++ stable/10/sys/sys/param.h Fri Mar 7 14:44:13 2014 (r262889) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000703 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000704 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 7 16:43:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6F528831; Fri, 7 Mar 2014 16:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3F53F314; Fri, 7 Mar 2014 16:43: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 s27Gh9qF037412; Fri, 7 Mar 2014 16:43:09 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27Gh9Px037411; Fri, 7 Mar 2014 16:43:09 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403071643.s27Gh9Px037411@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 7 Mar 2014 16:43:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262892 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 16:43:09 -0000 Author: jilles Date: Fri Mar 7 16:43:08 2014 New Revision: 262892 URL: http://svnweb.freebsd.org/changeset/base/262892 Log: MFC r261859: fts: Fix double-free with conflicting concurrent modifications. If rare conditions such as concurrent conflicting manipulation of the filesystem occur, fts_read() frees the current FTSENT without adjusting the pointers in the FTS accordingly. A later fts_close() then frees the same FTSENT again. Modified: stable/10/lib/libc/gen/fts.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/fts.c ============================================================================== --- stable/10/lib/libc/gen/fts.c Fri Mar 7 16:14:51 2014 (r262891) +++ stable/10/lib/libc/gen/fts.c Fri Mar 7 16:43:08 2014 (r262892) @@ -406,8 +406,6 @@ fts_read(FTS *sp) /* Move to the next node on this level. */ next: tmp = p; if ((p = p->fts_link) != NULL) { - free(tmp); - /* * If reached the top, return to the original directory (or * the root of the tree), and load the paths for the next root. @@ -417,6 +415,7 @@ next: tmp = p; SET(FTS_STOP); return (NULL); } + free(tmp); fts_load(sp, p); return (sp->fts_cur = p); } @@ -426,8 +425,10 @@ next: tmp = p; * ignore. If followed, get a file descriptor so we can * get back if necessary. */ - if (p->fts_instr == FTS_SKIP) + if (p->fts_instr == FTS_SKIP) { + free(tmp); goto next; + } if (p->fts_instr == FTS_FOLLOW) { p->fts_info = fts_stat(sp, p, 1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { @@ -441,6 +442,8 @@ next: tmp = p; p->fts_instr = FTS_NOINSTR; } + free(tmp); + name: t = sp->fts_path + NAPPEND(p->fts_parent); *t++ = '/'; memmove(t, p->fts_name, p->fts_namelen + 1); @@ -449,13 +452,13 @@ name: t = sp->fts_path + NAPPEND(p->fts /* Move up to the parent node. */ p = tmp->fts_parent; - free(tmp); if (p->fts_level == FTS_ROOTPARENTLEVEL) { /* * Done; free everything up and set errno to 0 so the user * can distinguish between error and EOF. */ + free(tmp); free(p); errno = 0; return (sp->fts_cur = NULL); @@ -488,6 +491,7 @@ name: t = sp->fts_path + NAPPEND(p->fts SET(FTS_STOP); return (NULL); } + free(tmp); p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP; return (sp->fts_cur = p); } From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 8 03:54:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EC9AB4D9; Sat, 8 Mar 2014 03:54: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D7F5B2EB; Sat, 8 Mar 2014 03:54: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 s283snaL017671; Sat, 8 Mar 2014 03:54:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s283snwc017668; Sat, 8 Mar 2014 03:54:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403080354.s283snwc017668@svn.freebsd.org> From: Eitan Adler Date: Sat, 8 Mar 2014 03:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262922 - stable/10/usr.bin/ssh-copy-id X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 03:54:50 -0000 Author: eadler Date: Sat Mar 8 03:54:49 2014 New Revision: 262922 URL: http://svnweb.freebsd.org/changeset/base/262922 Log: MFC r262645,r262647: ssh-copy-id: avoid sending private keys; add -v option To help avoid confusion: when attempting to send a key file check to see if a file of the same name exists with a '.pub' suffix and send that instead. This mimics the behavior of other ssh-copy-id scripts. Add -v passthrough. ssh-copy-id: add restorecon call In certain situations when creating an authorized_key file on a Linux machine restorecon(1) may need to be called. Therefore, attempt to run it if it exists. Modified: stable/10/usr.bin/ssh-copy-id/ssh-copy-id.1 stable/10/usr.bin/ssh-copy-id/ssh-copy-id.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/ssh-copy-id/ssh-copy-id.1 ============================================================================== --- stable/10/usr.bin/ssh-copy-id/ssh-copy-id.1 Sat Mar 8 03:39:15 2014 (r262921) +++ stable/10/usr.bin/ssh-copy-id/ssh-copy-id.1 Sat Mar 8 03:54:49 2014 (r262922) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2012 +.Dd Feburary 28, 2014 .Dt SSH-COPY-ID 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd copy public keys to a remote host .Sh SYNOPSIS .Nm -.Op Fl l +.Op Fl lv .Op Fl i Ar keyfile .Op Fl o Ar option .Op Fl p Ar port @@ -48,12 +48,14 @@ file (creating the file and directory, i The following options are available: .Bl -tag -width indent .It Fl i Ar file -Copy the key contained in +Copy the public key contained in .Ar file . This option can be specified multiple times and can be combined with the .Fl l option. +If a private key is specified and a public key is found then the public key +will be used. .It Fl l Copy the keys currently held by .Xr ssh-agent 1 . @@ -67,6 +69,9 @@ This option can be specified multiple ti .It Fl p Ar port Connect to the specified port on the remote host instead of the default. +.It Fl v +Pass -v to +.Xr ssh 1 . .El .Pp The remaining arguments are a list of remote hosts to connect to, Modified: stable/10/usr.bin/ssh-copy-id/ssh-copy-id.sh ============================================================================== --- stable/10/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat Mar 8 03:39:15 2014 (r262921) +++ stable/10/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat Mar 8 03:54:49 2014 (r262922) @@ -28,7 +28,7 @@ # $FreeBSD$ usage() { - echo "usage: ssh-copy-id [-l] [-i keyfile] [-o option] [-p port] [user@]hostname" >&2 + echo "usage: ssh-copy-id [-lv] [-i keyfile] [-o option] [-p port] [user@]hostname" >&2 exit 1 } @@ -46,6 +46,9 @@ sendkey() { printf "$alg $key $comment\n" >> "$keyfile" ; \ fi ; \ done \ + if [ -x /sbin/restorecon ]; then \ + /sbin/restorecon -F "$HOME/.ssh/" "$keyfile" >/dev/null 2>&1 || true ; \ + fi '\' } @@ -64,11 +67,13 @@ options="" IFS=$nl -while getopts 'i:lo:p:' arg; do +while getopts 'i:lo:p:v' arg; do case $arg in i) hasarg="x" - if [ -r "$OPTARG" ]; then + if [ -r "${OPTARG}.pub" ]; then + keys="$(cat -- "${OPTARG}.pub")$nl$keys" + elif [ -r "$OPTARG" ]; then keys="$(cat -- "$OPTARG")$nl$keys" else echo "File $OPTARG not found" >&2 @@ -85,6 +90,9 @@ while getopts 'i:lo:p:' arg; do o) options=$options$nl-o$nl$OPTARG ;; + v) + options="$options$nl-v" + ;; *) usage ;; From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 8 12:24:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6A19836F; Sat, 8 Mar 2014 12:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 56AF1C5D; Sat, 8 Mar 2014 12:24: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 s28COmne025865; Sat, 8 Mar 2014 12:24:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s28COmjx025864; Sat, 8 Mar 2014 12:24:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403081224.s28COmjx025864@svn.freebsd.org> From: Christian Brueffer Date: Sat, 8 Mar 2014 12:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262926 - stable/10/usr.bin/hexdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 12:24:48 -0000 Author: brueffer Date: Sat Mar 8 12:24:47 2014 New Revision: 262926 URL: http://svnweb.freebsd.org/changeset/base/262926 Log: MFC: r262333 Simplify the way the end of a singly linked list is followed (for adding items), so it is more obvious that we aren't going to indirect through a NULL pointer. PR: 144723 Submitted by: Garrett Cooper Obtained from: NetBSD r1.19 Modified: stable/10/usr.bin/hexdump/parse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/hexdump/parse.c ============================================================================== --- stable/10/usr.bin/hexdump/parse.c Sat Mar 8 06:06:50 2014 (r262925) +++ stable/10/usr.bin/hexdump/parse.c Sat Mar 8 12:24:47 2014 (r262926) @@ -210,7 +210,6 @@ rewrite(FS *fs) int nconv, prec; size_t len; - nextpr = NULL; prec = 0; for (fu = fs->nextfu; fu; fu = fu->nextfu) { @@ -218,13 +217,11 @@ rewrite(FS *fs) * Break each format unit into print units; each conversion * character gets its own. */ + nextpr = &fu->nextpr; for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) { if ((pr = calloc(1, sizeof(PR))) == NULL) err(1, NULL); - if (!fu->nextpr) - fu->nextpr = pr; - else - *nextpr = pr; + *nextpr = pr; /* Skip preceding text and up to the next % sign. */ for (p1 = fmtp; *p1 && *p1 != '%'; ++p1); From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 9 04:16:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 998B817D; Sun, 9 Mar 2014 04:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86523E47; Sun, 9 Mar 2014 04:16: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 s294G0rr038507; Sun, 9 Mar 2014 04:16:00 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s294G0fg038505; Sun, 9 Mar 2014 04:16:00 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403090416.s294G0fg038505@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 9 Mar 2014 04:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262943 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 04:16:00 -0000 Author: pfg Date: Sun Mar 9 04:16:00 2014 New Revision: 262943 URL: http://svnweb.freebsd.org/changeset/base/262943 Log: MFC r262869: ext2fs: Fix a bug when sorting htree entries. This a typo introduced when bringing the original code from NetBSD. Reported by: Mike Ma Modified: stable/10/sys/fs/ext2fs/ext2_htree.c Modified: stable/10/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_htree.c Sun Mar 9 03:49:06 2014 (r262942) +++ stable/10/sys/fs/ext2fs/ext2_htree.c Sun Mar 9 04:16:00 2014 (r262943) @@ -471,7 +471,7 @@ ext2_htree_cmp_sort_entry(const void *e1 if (entry1->h_hash < entry2->h_hash) return (-1); - if (entry2->h_hash > entry2->h_hash) + if (entry1->h_hash > entry2->h_hash) return (1); return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 9 13:23:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4088EC70; Sun, 9 Mar 2014 13:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C6A9962; Sun, 9 Mar 2014 13:23: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 s29DNoSZ058859; Sun, 9 Mar 2014 13:23:50 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29DNosk058858; Sun, 9 Mar 2014 13:23:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403091323.s29DNosk058858@svn.freebsd.org> From: Robert Watson Date: Sun, 9 Mar 2014 13:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262947 - stable/10/lib/libprocstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 13:23:50 -0000 Author: rwatson Date: Sun Mar 9 13:23:49 2014 New Revision: 262947 URL: http://svnweb.freebsd.org/changeset/base/262947 Log: Merge r262690 from head to stable/10: When querying a process's umask via sysctl in libprocstat(), don't print a warning if EPERM is returned as this is an expected failure mode rather than error -- similar to current handling of ESRCH. This makes the output of 'procstat -as' vastly more palatable. Sponsored by: DARPA, AFRL Modified: stable/10/lib/libprocstat/libprocstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libprocstat/libprocstat.c ============================================================================== --- stable/10/lib/libprocstat/libprocstat.c Sun Mar 9 13:19:37 2014 (r262946) +++ stable/10/lib/libprocstat/libprocstat.c Sun Mar 9 13:23:49 2014 (r262947) @@ -2052,7 +2052,7 @@ procstat_getumask_sysctl(pid_t pid, unsi mib[3] = pid; len = sizeof(*maskp); error = sysctl(mib, 4, maskp, &len, NULL, 0); - if (error != 0 && errno != ESRCH) + if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.umask: %d", pid); return (error); } From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 9 14:49:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 31B65FA7; Sun, 9 Mar 2014 14:49:16 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 09E17A8; Sun, 9 Mar 2014 14:49:16 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id A6AAE46B0D; Sun, 9 Mar 2014 10:49:15 -0400 (EDT) Date: Sun, 9 Mar 2014 14:49:14 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin Subject: Re: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-comp... In-Reply-To: <201403031536.33679.jhb@freebsd.org> Message-ID: References: <201402271729.s1RHT2rx075258@svn.freebsd.org> <201403031536.33679.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org, Dag-Erling SmXXrgrav X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 14:49:16 -0000 On Mon, 3 Mar 2014, John Baldwin wrote: >> Log: >> MFH (r261320): upgrade openssh to 6.5p1 >> MFH (r261340): enable sandboxing by default > > Mails on stable@ suggest that this latter change may be a bit of a POLA > violation as if people are using a custom kernel configuration that doesn't > include CAPSICUM they are now locked out of their boxes as sshd fails. It > seems that this is at least worth a note in UPDATING if not adding a > workaround to handle the case of a kernel without CAPSICUM. Most userspace tools that support Capsicum will explicitly test for a kernel generating ENOSYS due to non-support and 'fail open' by not using sandboxing. That strategy becomes more complex as applications become more complex, and in the long term we'll want to move away from conditional support. In the mean time, I'd generally recommend that any code being used on 9.x support runtime detection of Capsicum -- either via feature_is_present(3) or ENOSYS back from cap_enter(). The ugly bit is whether or not to use other sandboxing techniques (e.g., chroot()) if Capsicum can't be found, since that stuff tends to be pretty messy. Robert From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 9 17:04:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B33B4BDA; Sun, 9 Mar 2014 17:04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9BC24E79; Sun, 9 Mar 2014 17:04: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 s29H4bhL055330; Sun, 9 Mar 2014 17:04:37 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29H4WZ5055299; Sun, 9 Mar 2014 17:04:32 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403091704.s29H4WZ5055299@svn.freebsd.org> From: Julio Merino Date: Sun, 9 Mar 2014 17:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262951 - in stable/10: bin bin/date bin/date/tests bin/mv bin/mv/tests bin/pax bin/pax/tests bin/sh bin/sh/tests bin/sh/tests/builtins bin/sh/tests/parameters bin/sh/tests/parser bin/t... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 17:04:37 -0000 Author: jmmv Date: Sun Mar 9 17:04:31 2014 New Revision: 262951 URL: http://svnweb.freebsd.org/changeset/base/262951 Log: Sync sh(1) in stable/10 to head. This is a MFC of all the commits listed below. My original goal of this change was to only merge the move of the tests from tools/regression/bin/ into the new layout (which include tests for sh(1) and other tools as well). However, doing so is tricky due to the ongoing work in sh(1) and, especially, the many changes to its tests since stable/10 was first branched. Merging everything is the simplest way to achieve this goal and, as a bonus point, we get various fixes and miscellaneous improvements into the branch. Per jilles' suggestion, I'm avoiding the merge of a couple of changes (r256850 and r257506) that required depending kernel changes. I'm also avoiding very recent changes that have not had a long enough time to be validated in current. This is "make tinderbox" clean. r256735 sh: Remove one syscall when waiting for a foreground job. r257399 sh: Allow trapping SIGINT/SIGQUIT after ignore because of '&'. r257504 sh: Reorder union node to reduce its size on 64-bit platforms. r257920 sh: Add a test case for would-be assignments that are not due to quoting. r257929 sh: Properly quote alias output from command -v. r258489 sh: Add tests for the SUBDIR:= ${SUBDIR:O} Modified: stable/10/bin/date/Makefile ============================================================================== --- stable/10/bin/date/Makefile Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/date/Makefile Sun Mar 9 17:04:31 2014 (r262951) @@ -1,7 +1,13 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= date SRCS= date.c netdate.c vary.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/bin/mv/Makefile ============================================================================== --- stable/10/bin/mv/Makefile Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/mv/Makefile Sun Mar 9 17:04:31 2014 (r262951) @@ -1,6 +1,12 @@ # @(#)Makefile 8.2 (Berkeley) 4/2/94 # $FreeBSD$ +.include + PROG= mv +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/bin/pax/Makefile ============================================================================== --- stable/10/bin/pax/Makefile Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/pax/Makefile Sun Mar 9 17:04:31 2014 (r262951) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + # To install on versions prior to BSD 4.4 the following may have to be # defined with CFLAGS += # @@ -30,4 +32,8 @@ SRCS= ar_io.c ar_subs.c buf_subs.c cache gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \ tables.c tar.c tty_subs.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/bin/pax/tests/Makefile ============================================================================== --- head/bin/pax/tests/Makefile Wed Dec 11 04:09:17 2013 (r259210) +++ stable/10/bin/pax/tests/Makefile Sun Mar 9 17:04:31 2014 (r262951) @@ -4,6 +4,6 @@ TESTSDIR= ${TESTSBASE}/bin/pax -TAP_TESTS_SH= legacy_test +TAP_TESTS_PERL= legacy_test .include Copied: stable/10/bin/pax/tests/legacy_test.pl (from r260634, head/bin/pax/tests/legacy_test.pl) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/bin/pax/tests/legacy_test.pl Sun Mar 9 17:04:31 2014 (r262951, copy of r260634, head/bin/pax/tests/legacy_test.pl) @@ -0,0 +1,89 @@ +# $FreeBSD$ + +use strict; +use warnings; + +use Test::More tests => 6; +use File::Path qw(rmtree mkpath); +use Cwd; + +my $n = 0; +sub create_file { + my $fn = shift; + + $n++; + (my $dir = $fn) =~ s,/[^/]+$,,; + mkpath $dir; + open my $fd, ">", $fn or die "$fn: $!"; + print $fd "file $n\n"; +} + + +ustar_pathnames: { SKIP: { + # Prove that pax breaks up ustar pathnames properly + + my $top = getcwd . "/ustar-pathnames-1"; + skip "Current path is too long", 6 if length $top > 92; + rmtree $top; + my $subdir = "x" . "x" x (92 - length $top); + my $work94 = "$top/$subdir"; + mkpath $work94; # $work is 94 characters long + + my $x49 = "x" x 49; + my $x50 = "x" x 50; + my $x60 = "x" x 60; + my $x95 = "x" x 95; + + my @paths = ( + "$work94/x099", # 99 chars + "$work94/xx100", # 100 chars + "$work94/xxx101", # 101 chars + "$work94/$x49/${x50}x199", # 199 chars + "$work94/$x49/${x50}xx200", # 200 chars + "$work94/$x49/${x50}xxx201", # 201 chars + "$work94/$x60/${x95}254", # 254 chars + "$work94/$x60/${x95}x255", # 255 chars + ); + + my @l = map { length } @paths; + + my $n = 0; + create_file $_ for @paths; + system "pax -wf ustar.ok $work94"; + ok($? == 0, "Wrote 'ustar.ok' containing files with lengths @l"); + + (my $orig = $top) =~ s,1$,2,; + rmtree $orig; + rename $top, $orig; + + system "pax -rf ustar.ok"; + ok($? == 0, "Restored 'ustar.ok' containing files with lengths @l"); + + system "diff -ru $orig $top"; + ok($? == 0, "Restored files are identical"); + + rmtree $top; + rename $orig, $top; + + # 256 chars (with components < 100 chars) should not work + push @paths, "$work94/x$x60/${x95}x256"; # 256 chars + push @l, length $paths[-1]; + create_file $paths[-1]; + system "pax -wf ustar.fail1 $work94"; + ok($?, "Failed to write 'ustar.fail1' containing files with lengths @l"); + + # Components with 100 chars shouldn't work + unlink $paths[-1]; + $paths[-1] = "$work94/${x95}xc100"; # 100 char filename + $l[-1] = length $paths[-1]; + create_file $paths[-1]; + system "pax -wf ustar.fail2 $work94"; + ok($?, "Failed to write 'ustar.fail2' with a 100 char filename"); + + unlink $paths[-1]; + $paths[-1] = "$work94/${x95}xc100/x"; # 100 char component + $l[-1] = length $paths[-1]; + create_file $paths[-1]; + system "pax -wf ustar.fail3 $work94"; + ok($?, "Failed to write 'ustar.fail3' with a 100 char component"); +}} Modified: stable/10/bin/sh/Makefile ============================================================================== --- stable/10/bin/sh/Makefile Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/Makefile Sun Mar 9 17:04:31 2014 (r262951) @@ -1,6 +1,8 @@ # @(#)Makefile 8.4 (Berkeley) 5/5/95 # $FreeBSD$ +.include + PROG= sh INSTALLFLAGS= -S SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \ @@ -59,7 +61,8 @@ syntax.c syntax.h: mksyntax token.h: mktokens sh ${.CURDIR}/mktokens -regress: - cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/bin/sh/alias.c ============================================================================== --- stable/10/bin/sh/alias.c Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/alias.c Sun Mar 9 17:04:31 2014 (r262951) @@ -68,18 +68,7 @@ setalias(const char *name, const char *v if (equal(name, ap->name)) { INTOFF; ckfree(ap->val); - /* See HACK below. */ -#ifdef notyet ap->val = savestr(val); -#else - { - size_t len = strlen(val); - ap->val = ckmalloc(len + 2); - memcpy(ap->val, val, len); - ap->val[len] = ' '; - ap->val[len+1] = '\0'; - } -#endif INTON; return; } @@ -88,34 +77,7 @@ setalias(const char *name, const char *v INTOFF; ap = ckmalloc(sizeof (struct alias)); ap->name = savestr(name); - /* - * XXX - HACK: in order that the parser will not finish reading the - * alias value off the input before processing the next alias, we - * dummy up an extra space at the end of the alias. This is a crock - * and should be re-thought. The idea (if you feel inclined to help) - * is to avoid alias recursions. The mechanism used is: when - * expanding an alias, the value of the alias is pushed back on the - * input as a string and a pointer to the alias is stored with the - * string. The alias is marked as being in use. When the input - * routine finishes reading the string, it marks the alias not - * in use. The problem is synchronization with the parser. Since - * it reads ahead, the alias is marked not in use before the - * resulting token(s) is next checked for further alias sub. The - * H A C K is that we add a little fluff after the alias value - * so that the string will not be exhausted. This is a good - * idea ------- ***NOT*** - */ -#ifdef notyet ap->val = savestr(val); -#else /* hack */ - { - size_t len = strlen(val); - ap->val = ckmalloc(len + 2); - memcpy(ap->val, val, len); - ap->val[len] = ' '; /* fluff */ - ap->val[len+1] = '\0'; - } -#endif ap->flag = 0; ap->next = *app; *app = ap; @@ -207,14 +169,8 @@ comparealiases(const void *p1, const voi static void printalias(const struct alias *a) { - char *p; - out1fmt("%s=", a->name); - /* Don't print the space added above. */ - p = a->val + strlen(a->val) - 1; - *p = '\0'; out1qstr(a->val); - *p = ' '; out1c('\n'); } Modified: stable/10/bin/sh/cd.c ============================================================================== --- stable/10/bin/sh/cd.c Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/cd.c Sun Mar 9 17:04:31 2014 (r262951) @@ -182,6 +182,7 @@ cdlogical(char *dest) struct stat statb; int first; int badstat; + size_t len; /* * Check each component of the path. If we find a symlink or @@ -189,8 +190,9 @@ cdlogical(char *dest) * next time we get the value of the current directory. */ badstat = 0; - cdcomppath = stalloc(strlen(dest) + 1); - scopy(dest, cdcomppath); + len = strlen(dest); + cdcomppath = stalloc(len + 1); + memcpy(cdcomppath, dest, len + 1); STARTSTACKSTR(p); if (*dest == '/') { STPUTC('/', p); @@ -275,6 +277,7 @@ findcwd(char *dir) { char *new; char *p; + size_t len; /* * If our argument is NULL, we don't know the current directory @@ -283,8 +286,9 @@ findcwd(char *dir) */ if (dir == NULL || curdir == NULL) return getpwd2(); - cdcomppath = stalloc(strlen(dir) + 1); - scopy(dir, cdcomppath); + len = strlen(dir); + cdcomppath = stalloc(len + 1); + memcpy(cdcomppath, dir, len + 1); STARTSTACKSTR(new); if (*dir != '/') { STPUTS(curdir, new); Modified: stable/10/bin/sh/eval.c ============================================================================== --- stable/10/bin/sh/eval.c Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/eval.c Sun Mar 9 17:04:31 2014 (r262951) @@ -750,6 +750,45 @@ isdeclarationcmd(struct narg *arg) (have_command || !isfunc("local")))); } +static void +xtracecommand(struct arglist *varlist, struct arglist *arglist) +{ + struct strlist *sp; + char sep = 0; + const char *p, *ps4; + + ps4 = expandstr(ps4val()); + out2str(ps4 != NULL ? ps4 : ps4val()); + for (sp = varlist->list ; sp ; sp = sp->next) { + if (sep != 0) + out2c(' '); + p = strchr(sp->text, '='); + if (p != NULL) { + p++; + outbin(sp->text, p - sp->text, out2); + out2qstr(p); + } else + out2qstr(sp->text); + sep = ' '; + } + for (sp = arglist->list ; sp ; sp = sp->next) { + if (sep != 0) + out2c(' '); + /* Disambiguate command looking like assignment. */ + if (sp == arglist->list && + strchr(sp->text, '=') != NULL && + strchr(sp->text, '\'') == NULL) { + out2c('\''); + out2str(sp->text); + out2c('\''); + } else + out2qstr(sp->text); + sep = ' '; + } + out2c('\n'); + flushout(&errout); +} + /* * Check if a builtin can safely be executed in the same process, * even though it should be in a subshell (command substitution). @@ -847,40 +886,8 @@ evalcommand(union node *cmd, int flags, argv -= argc; /* Print the command if xflag is set. */ - if (xflag) { - char sep = 0; - const char *p, *ps4; - ps4 = expandstr(ps4val()); - out2str(ps4 != NULL ? ps4 : ps4val()); - for (sp = varlist.list ; sp ; sp = sp->next) { - if (sep != 0) - out2c(' '); - p = strchr(sp->text, '='); - if (p != NULL) { - p++; - outbin(sp->text, p - sp->text, out2); - out2qstr(p); - } else - out2qstr(sp->text); - sep = ' '; - } - for (sp = arglist.list ; sp ; sp = sp->next) { - if (sep != 0) - out2c(' '); - /* Disambiguate command looking like assignment. */ - if (sp == arglist.list && - strchr(sp->text, '=') != NULL && - strchr(sp->text, '\'') == NULL) { - out2c('\''); - out2str(sp->text); - out2c('\''); - } else - out2qstr(sp->text); - sep = ' '; - } - out2c('\n'); - flushout(&errout); - } + if (xflag) + xtracecommand(&varlist, &arglist); /* Now locate the command. */ if (argc == 0) { Modified: stable/10/bin/sh/exec.c ============================================================================== --- stable/10/bin/sh/exec.c Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/exec.c Sun Mar 9 17:04:31 2014 (r262951) @@ -187,14 +187,15 @@ padvance(const char **path, const char * { const char *p, *start; char *q; - size_t len; + size_t len, namelen; if (*path == NULL) return NULL; start = *path; for (p = start; *p && *p != ':' && *p != '%'; p++) ; /* nothing */ - len = p - start + strlen(name) + 2; /* "2" is for '/' and '\0' */ + namelen = strlen(name); + len = p - start + namelen + 2; /* "2" is for '/' and '\0' */ STARTSTACKSTR(q); CHECKSTRSPACE(len, q); if (p != start) { @@ -202,7 +203,7 @@ padvance(const char **path, const char * q += p - start; *q++ = '/'; } - strcpy(q, name); + memcpy(q, name, namelen + 1); pathopt = NULL; if (*p == '%') { pathopt = ++p; @@ -527,6 +528,7 @@ cmdlookup(const char *name, int add) const char *p; struct tblentry *cmdp; struct tblentry **pp; + size_t len; p = name; hashval = *p << 4; @@ -541,11 +543,11 @@ cmdlookup(const char *name, int add) } if (add && cmdp == NULL) { INTOFF; - cmdp = *pp = ckmalloc(sizeof (struct tblentry) - + strlen(name) + 1); + len = strlen(name); + cmdp = *pp = ckmalloc(sizeof (struct tblentry) + len + 1); cmdp->next = NULL; cmdp->cmdtype = CMDUNKNOWN; - strcpy(cmdp->cmdname, name); + memcpy(cmdp->cmdname, name, len + 1); INTON; } lastcmdentry = pp; @@ -672,9 +674,11 @@ typecmd_impl(int argc, char **argv, int /* Then look at the aliases */ if ((ap = lookupalias(argv[i], 1)) != NULL) { - if (cmd == TYPECMD_SMALLV) - out1fmt("alias %s='%s'\n", argv[i], ap->val); - else + if (cmd == TYPECMD_SMALLV) { + out1fmt("alias %s=", argv[i]); + out1qstr(ap->val); + outcslow('\n', out1); + } else out1fmt("%s is an alias for %s\n", argv[i], ap->val); continue; Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/expand.c Sun Mar 9 17:04:31 2014 (r262951) @@ -100,6 +100,7 @@ static struct arglist exparg; /* holds static void argstr(char *, int); static char *exptilde(char *, int); +static char *expari(char *); static void expbackq(union node *, int, int); static int subevalvar(char *, char *, int, int, int, int, int); static char *evalvar(char *, int); @@ -206,7 +207,7 @@ expandarg(union node *arg, struct arglis /* * Perform parameter expansion, command substitution and arithmetic * expansion, and tilde expansion if requested via EXP_TILDE/EXP_VARTILDE. - * Processing ends at a CTLENDVAR character as well as '\0'. + * Processing ends at a CTLENDVAR or CTLENDARI character as well as '\0'. * This is used to expand word in ${var+word} etc. * If EXP_FULL, EXP_CASE or EXP_REDIR are set, keep and/or generate CTLESC * characters to allow for further processing. @@ -231,6 +232,7 @@ argstr(char *p, int flag) switch (c = *p++) { case '\0': case CTLENDVAR: + case CTLENDARI: goto breakloop; case CTLQUOTEMARK: lit_quoted = 1; @@ -261,8 +263,8 @@ argstr(char *p, int flag) expbackq(argbackq->n, c & CTLQUOTE, flag); argbackq = argbackq->next; break; - case CTLENDARI: - expari(flag); + case CTLARI: + p = expari(p); break; case ':': case '=': @@ -387,59 +389,56 @@ removerecordregions(int endoff) } /* - * Expand arithmetic expression. Backup to start of expression, - * evaluate, place result in (backed up) result, adjust string position. + * Expand arithmetic expression. + * Note that flag is not required as digits never require CTLESC characters. */ -void -expari(int flag) +static char * +expari(char *p) { - char *p, *q, *start; + char *q, *start; arith_t result; int begoff; - int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); int quoted; + int c; + int nesting; + int adj; - /* - * This routine is slightly over-complicated for - * efficiency. First we make sure there is - * enough space for the result, which may be bigger - * than the expression. Next we - * scan backwards looking for the start of arithmetic. If the - * next previous character is a CTLESC character, then we - * have to rescan starting from the beginning since CTLESC - * characters have to be processed left to right. - */ - CHECKSTRSPACE(DIGITS(result) - 2, expdest); - USTPUTC('\0', expdest); - start = stackblock(); - p = expdest - 2; - while (p >= start && *p != CTLARI) - --p; - if (p < start || *p != CTLARI) - error("missing CTLARI (shouldn't happen)"); - if (p > start && *(p - 1) == CTLESC) - for (p = start; *p != CTLARI; p++) - if (*p == CTLESC) - p++; - - if (p[1] == '"') - quoted=1; - else - quoted=0; - begoff = p - start; + quoted = *p++ == '"'; + begoff = expdest - stackblock(); + argstr(p, 0); removerecordregions(begoff); - if (quotes) - rmescapes(p+2); + STPUTC('\0', expdest); + start = stackblock() + begoff; + q = grabstackstr(expdest); - result = arith(p+2); + result = arith(start); ungrabstackstr(q, expdest); - fmtstr(p, DIGITS(result), ARITH_FORMAT_STR, result); - while (*p++) - ; - if (quoted == 0) - recordregion(begoff, p - 1 - start, 0); - result = expdest - p + 1; - STADJUST(-result, expdest); + + start = stackblock() + begoff; + adj = start - expdest; + STADJUST(adj, expdest); + + CHECKSTRSPACE((int)(DIGITS(result) + 1), expdest); + fmtstr(expdest, DIGITS(result), ARITH_FORMAT_STR, result); + adj = strlen(expdest); + STADJUST(adj, expdest); + if (!quoted) + recordregion(begoff, expdest - stackblock(), 0); + nesting = 1; + while (nesting > 0) { + c = *p++; + if (c == CTLESC) + p++; + else if (c == CTLARI) + nesting++; + else if (c == CTLENDARI) + nesting--; + else if (c == CTLVAR) + p++; /* ignore variable substitution byte */ + else if (c == '\0') + return p - 1; + } + return p; } @@ -671,10 +670,8 @@ evalvar(char *p, int flag) again: /* jump here after setting a variable with ${var=text} */ if (varflags & VSLINENO) { set = 1; - special = 0; - val = var; - p[-1] = '\0'; /* temporarily overwrite '=' to have \0 - terminated string */ + special = 1; + val = NULL; } else if (special) { set = varisset(var, varflags & VSNUL); val = NULL; @@ -703,7 +700,10 @@ again: /* jump here after setting a vari if (set && subtype != VSPLUS) { /* insert the value of the variable */ if (special) { - varvalue(var, varflags & VSQUOTE, subtype, flag); + if (varflags & VSLINENO) + STPUTBIN(var, p - var - 1, expdest); + else + varvalue(var, varflags & VSQUOTE, subtype, flag); if (subtype == VSLENGTH) { varlenb = expdest - stackblock() - startloc; varlen = varlenb; @@ -815,7 +815,6 @@ record: default: abort(); } - p[-1] = '='; /* recover overwritten '=' */ if (subtype != VSNORMAL) { /* skip to end of alternative */ int nesting = 1; @@ -1307,9 +1306,11 @@ addfname(char *name) { char *p; struct strlist *sp; + size_t len; - p = stalloc(strlen(name) + 1); - scopy(name, p); + len = strlen(name); + p = stalloc(len + 1); + memcpy(p, name, len + 1); sp = (struct strlist *)stalloc(sizeof *sp); sp->text = p; *exparg.lastp = sp; Modified: stable/10/bin/sh/expand.h ============================================================================== --- stable/10/bin/sh/expand.h Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/expand.h Sun Mar 9 17:04:31 2014 (r262951) @@ -58,6 +58,5 @@ struct arglist { union node; void expandarg(union node *, struct arglist *, int); -void expari(int); void rmescapes(char *); int casematch(union node *, const char *); Modified: stable/10/bin/sh/input.c ============================================================================== --- stable/10/bin/sh/input.c Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/input.c Sun Mar 9 17:04:31 2014 (r262951) @@ -162,20 +162,16 @@ preadfd(void) int nr; parsenextc = parsefile->buf; -#ifndef NO_HISTORY - if (el != NULL && gotwinch) { - gotwinch = 0; - el_resize(el); - } -#endif retry: #ifndef NO_HISTORY if (parsefile->fd == 0 && el) { static const char *rl_cp; static int el_len; - if (rl_cp == NULL) + if (rl_cp == NULL) { + el_resize(el); rl_cp = el_gets(el, &el_len); + } if (rl_cp == NULL) nr = el_len == 0 ? 0 : -1; else { @@ -228,10 +224,16 @@ preadbuffer(void) { char *p, *q; int more; - int something; char savec; - if (parsefile->strpush) { + while (parsefile->strpush) { + /* + * Add a space to the end of an alias to ensure that the + * alias remains in use while parsing its last word. + * This avoids alias recursions. + */ + if (parsenleft == -1 && parsefile->strpush->ap != NULL) + return ' '; popstring(); if (--parsenleft >= 0) return (*parsenextc++); @@ -252,24 +254,18 @@ again: q = p = parsefile->buf + (parsenextc - parsefile->buf); /* delete nul characters */ - something = 0; for (more = 1; more;) { switch (*p) { case '\0': p++; /* Skip nul */ goto check; - case '\t': - case ' ': - break; - case '\n': parsenleft = q - parsenextc; more = 0; /* Stop processing here */ break; default: - something = 1; break; } @@ -288,7 +284,8 @@ check: *q = '\0'; #ifndef NO_HISTORY - if (parsefile->fd == 0 && hist && something) { + if (parsefile->fd == 0 && hist && + parsenextc[strspn(parsenextc, " \t\n")] != '\0') { HistEvent he; INTOFF; history(hist, &he, whichprompt == 1 ? H_ENTER : H_ADD, @@ -370,12 +367,16 @@ popstring(void) struct strpush *sp = parsefile->strpush; INTOFF; + if (sp->ap) { + if (parsenextc != sp->ap->val && + (parsenextc[-1] == ' ' || parsenextc[-1] == '\t')) + forcealias(); + sp->ap->flag &= ~ALIASINUSE; + } parsenextc = sp->prevstring; parsenleft = sp->prevnleft; parselleft = sp->prevlleft; /*out2fmt_flush("*** calling popstring: restoring to '%s'\n", parsenextc);*/ - if (sp->ap) - sp->ap->flag &= ~ALIASINUSE; parsefile->strpush = sp->prev; if (sp != &(parsefile->basestrpush)) ckfree(sp); Modified: stable/10/bin/sh/jobs.c ============================================================================== --- stable/10/bin/sh/jobs.c Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/jobs.c Sun Mar 9 17:04:31 2014 (r262951) @@ -978,7 +978,6 @@ int waitforjob(struct job *jp, int *origstatus) { #if JOBS - pid_t mypgrp = getpgrp(); int propagate_int = jp->jobctl && jp->foreground; #endif int status; @@ -992,7 +991,7 @@ waitforjob(struct job *jp, int *origstat dotrap(); #if JOBS if (jp->jobctl) { - if (tcsetpgrp(ttyfd, mypgrp) < 0) + if (tcsetpgrp(ttyfd, rootpid) < 0) error("tcsetpgrp failed, errno=%d\n", errno); } if (jp->state == JOBSTOPPED) Modified: stable/10/bin/sh/memalloc.c ============================================================================== --- stable/10/bin/sh/memalloc.c Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/memalloc.c Sun Mar 9 17:04:31 2014 (r262951) @@ -98,9 +98,11 @@ char * savestr(const char *s) { char *p; + size_t len; - p = ckmalloc(strlen(s) + 1); - scopy(s, p); + len = strlen(s); + p = ckmalloc(len + 1); + memcpy(p, s, len + 1); return p; } Modified: stable/10/bin/sh/mystring.c ============================================================================== --- stable/10/bin/sh/mystring.c Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/mystring.c Sun Mar 9 17:04:31 2014 (r262951) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); * String functions. * * equal(s1, s2) Return true if strings are equal. - * scopy(from, to) Copy a string. * number(s) Convert a string of digits to an integer. * is_number(s) Return true if s is a string of digits. */ @@ -60,10 +59,6 @@ char nullstr[1]; /* zero length string * equal - #defined in mystring.h */ -/* - * scopy - #defined in mystring.h - */ - /* * prefix -- see if pfx is a prefix of string. Modified: stable/10/bin/sh/mystring.h ============================================================================== --- stable/10/bin/sh/mystring.h Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/mystring.h Sun Mar 9 17:04:31 2014 (r262951) @@ -40,4 +40,3 @@ int number(const char *); int is_number(const char *); #define equal(s1, s2) (strcmp(s1, s2) == 0) -#define scopy(s1, s2) ((void)strcpy(s2, s1)) Modified: stable/10/bin/sh/nodetypes ============================================================================== --- stable/10/bin/sh/nodetypes Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/nodetypes Sun Mar 9 17:04:31 2014 (r262951) @@ -118,16 +118,16 @@ NFROMTO nfile # fd<> fname NAPPEND nfile # fd>> fname NCLOBBER nfile # fd>| fname type int - next nodeptr # next redirection in list fd int # file descriptor being redirected + next nodeptr # next redirection in list fname nodeptr # file name, in a NARG node expfname temp char *expfname # actual file name NTOFD ndup # fd<&dupfd NFROMFD ndup # fd>&dupfd type int - next nodeptr # next redirection in list fd int # file descriptor being redirected + next nodeptr # next redirection in list dupfd int # file descriptor to duplicate vname nodeptr # file name if fd>&$var @@ -135,8 +135,8 @@ NFROMFD ndup # fd>&dupfd NHERE nhere # fd<<\! NXHERE nhere # fd<renamed[i] = EMPTY; + sv->fd0_redirected = fd0_redirected; sv->next = redirlist; redirlist = sv; } for (n = redir ; n ; n = n->nfile.next) { fd = n->nfile.fd; + if (fd == 0) + fd0_redirected = 1; if ((n->nfile.type == NTOFD || n->nfile.type == NFROMFD) && n->ndup.dupfd == fd) continue; /* redirect from/to same file descriptor */ @@ -134,8 +138,6 @@ redirect(union node *redir, int flags) sv->renamed[fd] = i; INTON; } - if (fd == 0) - fd0_redirected++; openredirect(n, memory); } if (memory[1]) @@ -303,8 +305,6 @@ popredir(void) for (i = 0 ; i < 10 ; i++) { if (rp->renamed[i] != EMPTY) { - if (i == 0) - fd0_redirected--; if (rp->renamed[i] >= 0) { dup2(rp->renamed[i], i); close(rp->renamed[i]); @@ -314,6 +314,7 @@ popredir(void) } } INTOFF; + fd0_redirected = rp->fd0_redirected; redirlist = rp->next; ckfree(rp); INTON; Modified: stable/10/bin/sh/sh.1 ============================================================================== --- stable/10/bin/sh/sh.1 Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/sh.1 Sun Mar 9 17:04:31 2014 (r262951) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 14, 2013 +.Dd January 26, 2014 .Dt SH 1 .Os .Sh NAME @@ -235,10 +235,16 @@ or .Dq Li || operator; or if the command is a pipeline preceded by the .Ic !\& -operator. +keyword. If a shell function is executed and its exit status is explicitly tested, all commands of the function are considered to be tested as well. +.Pp +It is recommended to check for failures explicitly +instead of relying on +.Fl e +because it tends to behave in unexpected ways, +particularly in larger scripts. .It Fl f Li noglob Disable pathname expansion. .It Fl h Li trackall @@ -527,6 +533,20 @@ would become .Pp .Dl "ls -F foobar" .Pp +Aliases are also recognized after an alias +whose value ends with a space or tab. +For example, if there is also an alias called +.Dq Li nohup +with the value +.Dq Li "nohup " , +then the input +.Pp +.Dl "nohup lf foobar" +.Pp +would become +.Pp +.Dl "nohup ls -F foobar" +.Pp Aliases provide a convenient way for naive users to create shorthands for commands without having to learn how to create functions with arguments. Modified: stable/10/bin/sh/show.c ============================================================================== --- stable/10/bin/sh/show.c Sun Mar 9 15:36:56 2014 (r262950) +++ stable/10/bin/sh/show.c Sun Mar 9 17:04:31 2014 (r262951) @@ -390,11 +390,11 @@ opentrace(void) else p = "/tmp"; } - scopy(p, s); + strcpy(s, p); strcat(s, "/trace"); } #else - scopy("./trace", s); + strcpy(s, "./trace"); #endif /* not_this_way */ if ((tracefile = fopen(s, "a")) == NULL) { fprintf(stderr, "Can't open %s: %s\n", s, strerror(errno)); Modified: stable/10/bin/sh/tests/Makefile ============================================================================== --- head/bin/sh/tests/Makefile Wed Dec 11 04:09:17 2013 (r259210) +++ stable/10/bin/sh/tests/Makefile Sun Mar 9 17:04:31 2014 (r262951) @@ -6,6 +6,12 @@ TESTSDIR= ${TESTSBASE}/bin/sh TAP_TESTS_SH= legacy_test TAP_TESTS_SH_SED_legacy_test= -e 's,__SH__,/bin/sh,g' +# Some tests in here are silently not run when the tests are executed as +# root. Explicitly tell Kyua to drop privileges. +# +# TODO(jmmv): Kyua needs to do this by default, not only when explicitly +# requested. See https://code.google.com/p/kyua/issues/detail?id=6 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 9 21:02:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5EB793A1; Sun, 9 Mar 2014 21:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 30FA460E; Sun, 9 Mar 2014 21:02: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 s29L2PIu055850; Sun, 9 Mar 2014 21:02:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29L2OLR055848; Sun, 9 Mar 2014 21:02:24 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403092102.s29L2OLR055848@svn.freebsd.org> From: Dimitry Andric Date: Sun, 9 Mar 2014 21:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262956 - in stable: 10/contrib/libc++/include 9/contrib/libc++/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 21:02:25 -0000 Author: dim Date: Sun Mar 9 21:02:23 2014 New Revision: 262956 URL: http://svnweb.freebsd.org/changeset/base/262956 Log: MFC r262805: Pull in r199848 from upstream libc++ trunk: Const qualify __mem_fn call operator QOI improvement. Differential Revision: http://llvm-reviews.chandlerc.com/D2059 This should help with building recent versions of Mesa. See also: https://bugs.freedesktop.org/show_bug.cgi?id=75505 Reported by: dumbbell Modified: stable/10/contrib/libc++/include/__functional_03 stable/10/contrib/libc++/include/functional Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/libc++/include/__functional_03 stable/9/contrib/libc++/include/functional Directory Properties: stable/9/contrib/libc++/ (props changed) Modified: stable/10/contrib/libc++/include/__functional_03 ============================================================================== --- stable/10/contrib/libc++/include/__functional_03 Sun Mar 9 20:51:14 2014 (r262955) +++ stable/10/contrib/libc++/include/__functional_03 Sun Mar 9 21:02:23 2014 (r262956) @@ -33,28 +33,28 @@ public: // invoke typename __invoke_return::type - operator() () + operator() () const { return __invoke(__f_); } template typename __invoke_return0::type - operator() (_A0& __a0) + operator() (_A0& __a0) const { return __invoke(__f_, __a0); } template typename __invoke_return1::type - operator() (_A0& __a0, _A1& __a1) + operator() (_A0& __a0, _A1& __a1) const { return __invoke(__f_, __a0, __a1); } template typename __invoke_return2::type - operator() (_A0& __a0, _A1& __a1, _A2& __a2) + operator() (_A0& __a0, _A1& __a1, _A2& __a2) const { return __invoke(__f_, __a0, __a1, __a2); } Modified: stable/10/contrib/libc++/include/functional ============================================================================== --- stable/10/contrib/libc++/include/functional Sun Mar 9 20:51:14 2014 (r262955) +++ stable/10/contrib/libc++/include/functional Sun Mar 9 21:02:23 2014 (r262956) @@ -1221,7 +1221,7 @@ public: template _LIBCPP_INLINE_VISIBILITY typename __invoke_return::type - operator() (_ArgTypes&&... __args) + operator() (_ArgTypes&&... __args) const { return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...); } From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 9 23:47:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A029E132; Sun, 9 Mar 2014 23:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB703F3; Sun, 9 Mar 2014 23:47: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 s29NlYdW022382; Sun, 9 Mar 2014 23:47:34 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29NlYW7022381; Sun, 9 Mar 2014 23:47:34 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201403092347.s29NlYW7022381@svn.freebsd.org> From: "Andrey A. Chernov" Date: Sun, 9 Mar 2014 23:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262964 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 23:47:34 -0000 Author: ache Date: Sun Mar 9 23:47:34 2014 New Revision: 262964 URL: http://svnweb.freebsd.org/changeset/base/262964 Log: MFC r262689: Add fetch and patch to .PHONY and .NOTMAIN only if PORTNAME is defined. Unconditional addition cause real fetch(1) and patch(1) programs are builded every time. Modified: stable/10/share/mk/bsd.sys.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.sys.mk ============================================================================== --- stable/10/share/mk/bsd.sys.mk Sun Mar 9 22:38:11 2014 (r262963) +++ stable/10/share/mk/bsd.sys.mk Sun Mar 9 23:47:34 2014 (r262964) @@ -151,11 +151,15 @@ CFLAGS+= ${CWARNFLAGS} PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ beforelinking build build-tools buildfiles buildincludes \ checkdpadd clean cleandepend cleandir cleanobj configure \ - depend dependall distclean distribute exe extract fetch \ + depend dependall distclean distribute exe extract \ html includes install installfiles installincludes lint \ - obj objlink objs objwarn patch realall realdepend \ + obj objlink objs objwarn realall realdepend \ realinstall regress subdir-all subdir-depend subdir-install \ tags whereobj +.if defined(PORTNAME) +PHONY_NOTMAIN+= fetch patch +.endif + .PHONY: ${PHONY_NOTMAIN} .NOTMAIN: ${PHONY_NOTMAIN} From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 10 00:53:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 35ED69E6; Mon, 10 Mar 2014 00:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22052B99; Mon, 10 Mar 2014 00:53: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 s2A0rc8X050913; Mon, 10 Mar 2014 00:53:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2A0rb4M050910; Mon, 10 Mar 2014 00:53:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403100053.s2A0rb4M050910@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Mar 2014 00:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262965 - in stable/10/lib/libc: stdio string X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 00:53:38 -0000 Author: eadler Date: Mon Mar 10 00:53:37 2014 New Revision: 262965 URL: http://svnweb.freebsd.org/changeset/base/262965 Log: MFC r262890: libc man pages: Remove reference to non-existent FreeBSD Security Architecture Modified: stable/10/lib/libc/stdio/tmpnam.3 stable/10/lib/libc/string/strcat.3 stable/10/lib/libc/string/strcpy.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/tmpnam.3 ============================================================================== --- stable/10/lib/libc/stdio/tmpnam.3 Sun Mar 9 23:47:34 2014 (r262964) +++ stable/10/lib/libc/stdio/tmpnam.3 Mon Mar 10 00:53:37 2014 (r262965) @@ -244,5 +244,3 @@ file permissions may be specified. It is strongly suggested that .Xr mkstemp 3 be used in place of these functions. -(See -the FSA.) Modified: stable/10/lib/libc/string/strcat.3 ============================================================================== --- stable/10/lib/libc/string/strcat.3 Sun Mar 9 23:47:34 2014 (r262964) +++ stable/10/lib/libc/string/strcat.3 Mon Mar 10 00:53:37 2014 (r262965) @@ -103,8 +103,6 @@ The function is easily misused in a manner which enables malicious users to arbitrarily change a running program's functionality through a buffer overflow attack. -(See -the FSA.) .Pp Avoid using .Fn strcat . Modified: stable/10/lib/libc/string/strcpy.3 ============================================================================== --- stable/10/lib/libc/string/strcpy.3 Sun Mar 9 23:47:34 2014 (r262964) +++ stable/10/lib/libc/string/strcpy.3 Mon Mar 10 00:53:37 2014 (r262965) @@ -210,7 +210,3 @@ The function is easily misused in a manner which enables malicious users to arbitrarily change a running program's functionality through a buffer overflow attack. -(See -the FSA -and -.Sx EXAMPLES . ) From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 10 02:31:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 449D7959; Mon, 10 Mar 2014 02:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 258A43F5; Mon, 10 Mar 2014 02:31: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 s2A2VpjJ088978; Mon, 10 Mar 2014 02:31:51 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2A2VodI088975; Mon, 10 Mar 2014 02:31:50 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201403100231.s2A2VodI088975@svn.freebsd.org> From: Mark Johnston Date: Mon, 10 Mar 2014 02:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262967 - stable/10/sys/dev/mfi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 02:31:51 -0000 Author: markj Date: Mon Mar 10 02:31:50 2014 New Revision: 262967 URL: http://svnweb.freebsd.org/changeset/base/262967 Log: MFC r261535: Add support for MegaRAID Fury cards. The main change needed to boot from a 9341-4i controller was to ensure that scatter/gather lists are ended with an end-of-list marker. Both the mrsas and Linux megaraid_sas drivers use this marker with Invader cards as well, so we do the same thing, though it is apparently not strictly necessary. PR: 187312 Modified: stable/10/sys/dev/mfi/mfi_pci.c stable/10/sys/dev/mfi/mfi_tbolt.c stable/10/sys/dev/mfi/mfivar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mfi/mfi_pci.c ============================================================================== --- stable/10/sys/dev/mfi/mfi_pci.c Mon Mar 10 01:34:38 2014 (r262966) +++ stable/10/sys/dev/mfi/mfi_pci.c Mon Mar 10 02:31:50 2014 (r262967) @@ -131,7 +131,8 @@ struct mfi_ident { {0x1000, 0x005b, 0x8086, 0x9265, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Intel (R) RAID Controller RS25DB080"}, {0x1000, 0x005b, 0x8086, 0x9285, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Intel (R) RAID Controller RS25NB008"}, {0x1000, 0x005b, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "ThunderBolt"}, - {0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT, "Invader"}, + {0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_INVADER, "Invader"}, + {0x1000, 0x005f, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_FURY, "Fury"}, {0x1000, 0x0060, 0x1028, 0xffff, MFI_FLAGS_1078, "Dell PERC 6"}, {0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"}, {0x1000, 0x0071, 0xffff, 0xffff, MFI_FLAGS_SKINNY, "Drake Skinny"}, Modified: stable/10/sys/dev/mfi/mfi_tbolt.c ============================================================================== --- stable/10/sys/dev/mfi/mfi_tbolt.c Mon Mar 10 01:34:38 2014 (r262966) +++ stable/10/sys/dev/mfi/mfi_tbolt.c Mon Mar 10 02:31:50 2014 (r262967) @@ -850,7 +850,8 @@ mfi_tbolt_build_ldio(struct mfi_softc *s io_request = cmd->io_request; io_request->RaidContext.TargetID = device_id; io_request->RaidContext.Status = 0; - io_request->RaidContext.exStatus =0; + io_request->RaidContext.exStatus = 0; + io_request->RaidContext.regLockFlags = 0; start_lba_lo = mfi_cmd->cm_frame->io.lba_lo; start_lba_hi = mfi_cmd->cm_frame->io.lba_hi; @@ -945,6 +946,7 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, uint8_t i, sg_processed, sg_to_process; uint8_t sge_count, sge_idx; union mfi_sgl *os_sgl; + pMpi25IeeeSgeChain64_t sgl_end; /* * Return 0 if there is no data transfer @@ -968,6 +970,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, else sge_idx = sge_count; + if (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY)) { + sgl_end = sgl_ptr + (sc->max_SGEs_in_main_message - 1); + sgl_end->Flags = 0; + } + for (i = 0; i < sge_idx; i++) { /* * For 32bit BSD we are getting 32 bit SGL's from OS @@ -981,7 +988,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, sgl_ptr->Length = os_sgl->sg32[i].len; sgl_ptr->Address = os_sgl->sg32[i].addr; } - sgl_ptr->Flags = 0; + if (i == sge_count - 1 && + (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY))) + sgl_ptr->Flags = MPI25_IEEE_SGE_FLAGS_END_OF_LIST; + else + sgl_ptr->Flags = 0; sgl_ptr++; cmd->io_request->ChainOffset = 0; } @@ -996,8 +1007,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, sg_chain = sgl_ptr; /* Prepare chain element */ sg_chain->NextChainOffset = 0; - sg_chain->Flags = (MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT | - MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); + if (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY)) + sg_chain->Flags = MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT; + else + sg_chain->Flags = MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT | + MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR; sg_chain->Length = (sizeof(MPI2_SGE_IO_UNION) * (sge_count - sg_processed)); sg_chain->Address = cmd->sg_frame_phys_addr; @@ -1010,7 +1024,13 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, sgl_ptr->Length = os_sgl->sg32[i].len; sgl_ptr->Address = os_sgl->sg32[i].addr; } - sgl_ptr->Flags = 0; + if (i == sge_count - 1 && + (sc->mfi_flags & + (MFI_FLAGS_INVADER | MFI_FLAGS_FURY))) + sgl_ptr->Flags = + MPI25_IEEE_SGE_FLAGS_END_OF_LIST; + else + sgl_ptr->Flags = 0; sgl_ptr++; } } Modified: stable/10/sys/dev/mfi/mfivar.h ============================================================================== --- stable/10/sys/dev/mfi/mfivar.h Mon Mar 10 01:34:38 2014 (r262966) +++ stable/10/sys/dev/mfi/mfivar.h Mon Mar 10 02:31:50 2014 (r262967) @@ -199,6 +199,8 @@ struct mfi_softc { #define MFI_FLAGS_GEN2 (1<<6) #define MFI_FLAGS_SKINNY (1<<7) #define MFI_FLAGS_TBOLT (1<<8) +#define MFI_FLAGS_INVADER (1<<10) +#define MFI_FLAGS_FURY (1<<11) // Start: LSIP200113393 bus_dma_tag_t verbuf_h_dmat; bus_dmamap_t verbuf_h_dmamap; From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 10 09:46:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 300669B6; Mon, 10 Mar 2014 09:46:45 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id E0A23DC8; Mon, 10 Mar 2014 09:46:44 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 75E245297; Mon, 10 Mar 2014 09:46:38 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 6775C1C11; Mon, 10 Mar 2014 10:46:10 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Robert Watson Subject: Re: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-comp... References: <201402271729.s1RHT2rx075258@svn.freebsd.org> <201403031536.33679.jhb@freebsd.org> Date: Mon, 10 Mar 2014 10:46:09 +0100 In-Reply-To: (Robert Watson's message of "Sun, 9 Mar 2014 14:49:14 +0000 (GMT)") Message-ID: <864n36e68u.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-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org, John Baldwin X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 09:46:45 -0000 Robert Watson writes: > Most userspace tools that support Capsicum will explicitly test for a > kernel generating ENOSYS due to non-support and 'fail open' by not > using sandboxing. That strategy becomes more complex as applications > become more complex, and in the long term we'll want to move away from > conditional support. In the mean time, I'd generally recommend that > any code being used on 9.x support runtime detection of Capsicum -- > either via feature_is_present(3) or ENOSYS back from cap_enter(). The > ugly bit is whether or not to use other sandboxing techniques (e.g., > chroot()) if Capsicum can't be found, since that stuff tends to be > pretty messy. In this particular case, we fall back to essentially the same mechanism as without Capsicum, i.e. setrlimit(2). And we're talking 10 / 11, not 9... DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 10 20:47:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B95C57F6; Mon, 10 Mar 2014 20:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99B91D03; Mon, 10 Mar 2014 20:47: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 s2AKlQxO048907; Mon, 10 Mar 2014 20:47:26 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2AKlP7M048901; Mon, 10 Mar 2014 20:47:25 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201403102047.s2AKlP7M048901@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 10 Mar 2014 20:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262981 - in stable: 10/sys/amd64/amd64 10/sys/amd64/include 10/sys/x86/acpica 8/sys/amd64/acpica 8/sys/amd64/amd64 8/sys/amd64/include 9/sys/amd64/acpica 9/sys/amd64/amd64 9/sys/amd64/... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 20:47:26 -0000 Author: jkim Date: Mon Mar 10 20:47:24 2014 New Revision: 262981 URL: http://svnweb.freebsd.org/changeset/base/262981 Log: MFC: r262746, r262748, r262750, r262752 Move fpusave() wrapper for suspend hander to sys/amd64/amd64/fpu.c. Modified: stable/10/sys/amd64/amd64/cpu_switch.S stable/10/sys/amd64/amd64/fpu.c stable/10/sys/amd64/amd64/mp_machdep.c stable/10/sys/amd64/include/fpu.h stable/10/sys/amd64/include/md_var.h stable/10/sys/x86/acpica/acpi_wakeup.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/amd64/acpica/acpi_wakeup.c stable/8/sys/amd64/amd64/cpu_switch.S stable/8/sys/amd64/amd64/fpu.c stable/8/sys/amd64/amd64/mp_machdep.c stable/8/sys/amd64/include/fpu.h stable/8/sys/amd64/include/md_var.h stable/9/sys/amd64/acpica/acpi_wakeup.c stable/9/sys/amd64/amd64/cpu_switch.S stable/9/sys/amd64/amd64/fpu.c stable/9/sys/amd64/amd64/mp_machdep.c stable/9/sys/amd64/include/fpu.h stable/9/sys/amd64/include/md_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/9/sys/ (props changed) Modified: stable/10/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/10/sys/amd64/amd64/cpu_switch.S Mon Mar 10 19:36:26 2014 (r262980) +++ stable/10/sys/amd64/amd64/cpu_switch.S Mon Mar 10 20:47:24 2014 (r262981) @@ -345,8 +345,8 @@ ENTRY(savectx) movq %r14,PCB_R14(%rdi) movq %r15,PCB_R15(%rdi) - movq %cr0,%rsi - movq %rsi,PCB_CR0(%rdi) + movq %cr0,%rax + movq %rax,PCB_CR0(%rdi) movq %cr2,%rax movq %rax,PCB_CR2(%rdi) movq %cr3,%rax @@ -409,8 +409,6 @@ ENTRY(savectx) sldt PCB_LDT(%rdi) str PCB_TR(%rdi) -2: movq %rsi,%cr0 /* The previous %cr0 is saved in %rsi. */ - movl $1,%eax ret END(savectx) @@ -548,14 +546,3 @@ ENTRY(resumectx) xorl %eax,%eax ret END(resumectx) - -/* - * Wrapper around fpusave to care about TS0_CR. - */ -ENTRY(ctx_fpusave) - movq %cr0,%rsi - clts - call fpusave - movq %rsi,%cr0 - ret -END(ctx_fpusave) Modified: stable/10/sys/amd64/amd64/fpu.c ============================================================================== --- stable/10/sys/amd64/amd64/fpu.c Mon Mar 10 19:36:26 2014 (r262980) +++ stable/10/sys/amd64/amd64/fpu.c Mon Mar 10 20:47:24 2014 (r262981) @@ -162,6 +162,17 @@ fpurestore(void *addr) fxrstor((char *)addr); } +void +fpususpend(void *addr) +{ + u_long cr0; + + cr0 = rcr0(); + stop_emulating(); + fpusave(addr); + load_cr0(cr0); +} + /* * Enable XSAVE if supported and allowed by user. * Calculate the xsave_mask. Modified: stable/10/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_machdep.c Mon Mar 10 19:36:26 2014 (r262980) +++ stable/10/sys/amd64/amd64/mp_machdep.c Mon Mar 10 20:47:24 2014 (r262981) @@ -1464,7 +1464,7 @@ cpususpend_handler(void) cpu = PCPU_GET(cpuid); if (savectx(susppcbs[cpu])) { - ctx_fpusave(susppcbs[cpu]->pcb_fpususpend); + fpususpend(susppcbs[cpu]->pcb_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { Modified: stable/10/sys/amd64/include/fpu.h ============================================================================== --- stable/10/sys/amd64/include/fpu.h Mon Mar 10 19:36:26 2014 (r262980) +++ stable/10/sys/amd64/include/fpu.h Mon Mar 10 20:47:24 2014 (r262981) @@ -63,6 +63,7 @@ int fpusetregs(struct thread *td, struct char *xfpustate, size_t xfpustate_size); int fpusetxstate(struct thread *td, char *xfpustate, size_t xfpustate_size); +void fpususpend(void *addr); int fputrap_sse(void); int fputrap_x87(void); void fpuuserinited(struct thread *td); Modified: stable/10/sys/amd64/include/md_var.h ============================================================================== --- stable/10/sys/amd64/include/md_var.h Mon Mar 10 19:36:26 2014 (r262980) +++ stable/10/sys/amd64/include/md_var.h Mon Mar 10 20:47:24 2014 (r262981) @@ -89,7 +89,6 @@ void *alloc_fpusave(int flags); void amd64_syscall(struct thread *td, int traced); void busdma_swi(void); void cpu_setregs(void); -void ctx_fpusave(void *); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); void ld_ds(void) __asm(__STRING(ld_ds)); Modified: stable/10/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- stable/10/sys/x86/acpica/acpi_wakeup.c Mon Mar 10 19:36:26 2014 (r262980) +++ stable/10/sys/x86/acpica/acpi_wakeup.c Mon Mar 10 20:47:24 2014 (r262981) @@ -202,7 +202,7 @@ acpi_sleep_machdep(struct acpi_softc *sc if (savectx(susppcbs[0])) { #ifdef __amd64__ - ctx_fpusave(susppcbs[0]->pcb_fpususpend); + fpususpend(susppcbs[0]->pcb_fpususpend); #endif #ifdef SMP if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 05:58:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7FE6D968; Tue, 11 Mar 2014 05:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D1AB5F6; Tue, 11 Mar 2014 05:58: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 s2B5wreg090052; Tue, 11 Mar 2014 05:58:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B5wrs7090051; Tue, 11 Mar 2014 05:58:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201403110558.s2B5wrs7090051@svn.freebsd.org> From: Rui Paulo Date: Tue, 11 Mar 2014 05:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262998 - stable/10/sys/dev/ath X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 05:58:53 -0000 Author: rpaulo Date: Tue Mar 11 05:58:52 2014 New Revision: 262998 URL: http://svnweb.freebsd.org/changeset/base/262998 Log: MFC r262930 Call ieee80211_dump_pkt() based on IFF_DUMPPKTS(). Modified: stable/10/sys/dev/ath/if_ath_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ath/if_ath_tx.c ============================================================================== --- stable/10/sys/dev/ath/if_ath_tx.c Tue Mar 11 04:25:12 2014 (r262997) +++ stable/10/sys/dev/ath/if_ath_tx.c Tue Mar 11 05:58:52 2014 (r262998) @@ -3767,9 +3767,10 @@ ath_tx_tid_drain_print(struct ath_softc ni->ni_txseqs[tid->tid]); /* XXX Dump the frame, see what it is? */ - ieee80211_dump_pkt(ni->ni_ic, - mtod(bf->bf_m, const uint8_t *), - bf->bf_m->m_len, 0, -1); + if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) + ieee80211_dump_pkt(ni->ni_ic, + mtod(bf->bf_m, const uint8_t *), + bf->bf_m->m_len, 0, -1); } /* From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 07:33:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 518AD9D8; Tue, 11 Mar 2014 07:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EDFFDC0; Tue, 11 Mar 2014 07:33: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 s2B7XYFt053649; Tue, 11 Mar 2014 07:33:34 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B7XY1D053648; Tue, 11 Mar 2014 07:33:34 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201403110733.s2B7XY1D053648@svn.freebsd.org> From: Kevin Lo Date: Tue, 11 Mar 2014 07:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263000 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 07:33:34 -0000 Author: kevlo Date: Tue Mar 11 07:33:33 2014 New Revision: 263000 URL: http://svnweb.freebsd.org/changeset/base/263000 Log: MFC r262822: Fix a logic error when enabling MAC. Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Tue Mar 11 06:07:12 2014 (r262999) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Tue Mar 11 07:33:33 2014 (r263000) @@ -1890,8 +1890,8 @@ urtwn_power_on(struct urtwn_softc *sc) urtwn_write_2(sc, R92C_APS_FSMCO, urtwn_read_2(sc, R92C_APS_FSMCO) | R92C_APS_FSMCO_APFM_ONMAC); for (ntries = 0; ntries < 1000; ntries++) { - if (urtwn_read_2(sc, R92C_APS_FSMCO) & - R92C_APS_FSMCO_APFM_ONMAC) + if (!(urtwn_read_2(sc, R92C_APS_FSMCO) & + R92C_APS_FSMCO_APFM_ONMAC)) break; DELAY(5); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 12:04:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9705F566; Tue, 11 Mar 2014 12:04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 78D28C18; Tue, 11 Mar 2014 12:04: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 s2BC4xBi063249; Tue, 11 Mar 2014 12:04:59 GMT (envelope-from jhay@svn.freebsd.org) Received: (from jhay@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BC4xw6063248; Tue, 11 Mar 2014 12:04:59 GMT (envelope-from jhay@svn.freebsd.org) Message-Id: <201403111204.s2BC4xw6063248@svn.freebsd.org> From: John Hay Date: Tue, 11 Mar 2014 12:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263015 - stable/10/release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 12:04:59 -0000 Author: jhay Date: Tue Mar 11 12:04:58 2014 New Revision: 263015 URL: http://svnweb.freebsd.org/changeset/base/263015 Log: MFC r262036 etcupdate should use the src tree from where the release is built, not the default (/usr/src) tree. Modified: stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Tue Mar 11 10:27:57 2014 (r263014) +++ stable/10/release/Makefile Tue Mar 11 12:04:58 2014 (r263015) @@ -105,7 +105,7 @@ base.txz: sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \ "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${.OBJDIR}/${DISTDIR}/base" etcupdate extract -B -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \ - -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" + -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" # Package all components cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR} mv ${DISTDIR}/*.txz . From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 12:58:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3799C52F; Tue, 11 Mar 2014 12:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 23603194; Tue, 11 Mar 2014 12:58: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 s2BCwkR3084292; Tue, 11 Mar 2014 12:58:46 GMT (envelope-from jhay@svn.freebsd.org) Received: (from jhay@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BCwkVU084291; Tue, 11 Mar 2014 12:58:46 GMT (envelope-from jhay@svn.freebsd.org) Message-Id: <201403111258.s2BCwkVU084291@svn.freebsd.org> From: John Hay Date: Tue, 11 Mar 2014 12:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263017 - stable/10/sys/arm/xscale/ixp425 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 12:58:46 -0000 Author: jhay Date: Tue Mar 11 12:58:45 2014 New Revision: 263017 URL: http://svnweb.freebsd.org/changeset/base/263017 Log: MFC r262020: Make it possible to use the env kernel config file option for AVILA and CAMBRIA boards that does not use loader to load the kernel. This is basically how it was done for i386. This way tunables can also be set. For example in config file: env "/conf/AVILA.env" And in AVILA.env: vfs.unmapped_buf_allowed=0 Modified: stable/10/sys/arm/xscale/ixp425/avila_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/avila_machdep.c Tue Mar 11 12:24:19 2014 (r263016) +++ stable/10/sys/arm/xscale/ixp425/avila_machdep.c Tue Mar 11 12:58:45 2014 (r263017) @@ -228,6 +228,8 @@ initarm(struct arm_boot_params *abp) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + if (envmode == 1) + kern_envp = static_env; /* Do basic tuning, hz etc */ init_param1(); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 13:06:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2CBD19C8; Tue, 11 Mar 2014 13:06: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1535E256; Tue, 11 Mar 2014 13:06: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 s2BD6Cwb088434; Tue, 11 Mar 2014 13:06:12 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BD69V7088415; Tue, 11 Mar 2014 13:06:09 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201403111306.s2BD69V7088415@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 11 Mar 2014 13:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263019 - in stable/10: contrib/libucl contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests lib lib/libucl share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 13:06:12 -0000 Author: bapt Date: Tue Mar 11 13:06:09 2014 New Revision: 263019 URL: http://svnweb.freebsd.org/changeset/base/263019 Log: MFC: r262398,r262399,r262410,r262975 Import libucl into head UCL is heavily infused by nginx configuration as the example of a convenient configuration system. However, UCL is fully compatible with JSON format and is able to parse json files. UCL is used by pkg(8) for its configuration file as well for the manifest format in packages, it will be used in base for the pkg boostrap (signature checking and configuration file parsing.) libucl has been developped and is maintained by vsevolod@ Added: stable/10/contrib/libucl/ - copied from r262398, head/contrib/libucl/ stable/10/contrib/libucl/Makefile.unix - copied unchanged from r262975, head/contrib/libucl/Makefile.unix stable/10/contrib/libucl/Makefile.w32 - copied unchanged from r262975, head/contrib/libucl/Makefile.w32 stable/10/contrib/libucl/tests/10.in - copied unchanged from r262975, head/contrib/libucl/tests/10.in stable/10/lib/libucl/ - copied from r262398, head/lib/libucl/ Deleted: stable/10/contrib/libucl/Makefile Modified: stable/10/contrib/libucl/doc/api.md stable/10/contrib/libucl/include/ucl.h stable/10/contrib/libucl/src/ucl_internal.h stable/10/contrib/libucl/src/ucl_parser.c stable/10/contrib/libucl/src/ucl_util.c stable/10/contrib/libucl/tests/8.in stable/10/contrib/libucl/tests/8.res stable/10/lib/Makefile stable/10/lib/libucl/Makefile stable/10/share/mk/bsd.libnames.mk Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/libucl/Makefile.unix (from r262975, head/contrib/libucl/Makefile.unix) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libucl/Makefile.unix Tue Mar 11 13:06:09 2014 (r263019, copy of r262975, head/contrib/libucl/Makefile.unix) @@ -0,0 +1,79 @@ +CC ?= gcc +DESTDIR ?= /usr/local +LD ?= gcc +C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src +MAJOR_VERSION = 0 +MINOR_VERSION = 2 +PATCH_VERSION = 8 +VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" +SONAME = libucl.so +SONAME_FULL = $(SONAME).$(MAJOR_VERSION) +OBJDIR ?= .obj +TESTDIR ?= tests +SRCDIR ?= src +INCLUDEDIR ?= include +MKDIR ?= mkdir +INSTALL ?= install +RM ?= rm +RMDIR ?= rmdir +LN ?= ln +LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm +LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl +LD_ADD ?= -lrt +COPT_FLAGS ?= -O2 +HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o + +all: $(OBJDIR) $(OBJDIR)/$(SONAME) + +$(OBJDIR)/$(SONAME): $(OBJDIR)/$(SONAME_FULL) + $(LN) -sf $(SONAME_FULL) $(OBJDIR)/$(SONAME) + +$(OBJDIR)/$(SONAME_FULL): $(OBJECTS) + $(CC) -o $(OBJDIR)/$(SONAME_FULL) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS) + +$(OBJDIR): + @$(MKDIR) -p $(OBJDIR) + +# Compile rules +$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c +$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c +$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c +$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) + $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c + +clean: + $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate + $(RMDIR) $(OBJDIR) + +# Utils + +chargen: utils/chargen.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c +objdump: utils/objdump.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS) + +# Tests + +test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + +run-test: test + TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + +$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) +$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) +$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD) + +install: $(OBJDIR)/$(SONAME) + $(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME) + $(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h + +.PHONY: clean $(OBJDIR) Copied: stable/10/contrib/libucl/Makefile.w32 (from r262975, head/contrib/libucl/Makefile.w32) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libucl/Makefile.w32 Tue Mar 11 13:06:09 2014 (r263019, copy of r262975, head/contrib/libucl/Makefile.w32) @@ -0,0 +1,79 @@ +CC ?= gcc +DESTDIR ?= /usr/local +LD ?= gcc +C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src +MAJOR_VERSION = 0 +MINOR_VERSION = 2 +PATCH_VERSION = 8 +VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" +SONAME = libucl.dll +OBJDIR ?= .obj +TESTDIR ?= tests +SRCDIR ?= src +INCLUDEDIR ?= include +MKDIR ?= mkdir +INSTALL ?= install +RM ?= rm +RMDIR ?= rmdir +ifeq (Windows_NT, $(OS)) +LN ?= ln +else +LN ?= rem ln +endif +LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm +LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl +LD_ADD ?= -lrt +COPT_FLAGS ?= -O2 +HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o + +all: $(OBJDIR) $(OBJDIR)/$(SONAME) + +$(OBJDIR)/$(SONAME): $(OBJECTS) + $(CC) -o $(OBJDIR)/$(SONAME) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS) + +$(OBJDIR): + @$(MKDIR) -p $(OBJDIR) + +# Compile rules +$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c +$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c +$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c +$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) + $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c + +clean: + $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate + $(RMDIR) $(OBJDIR) + +# Utils + +chargen: utils/chargen.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c +objdump: utils/objdump.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS) + +# Tests + +test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + +run-test: test + TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + +$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) +$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) +$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD) + +install: $(OBJDIR)/$(SONAME) + $(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME) + $(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h + +.PHONY: clean $(OBJDIR) Modified: stable/10/contrib/libucl/doc/api.md ============================================================================== --- head/contrib/libucl/doc/api.md Sun Feb 23 21:49:21 2014 (r262398) +++ stable/10/contrib/libucl/doc/api.md Tue Mar 11 13:06:09 2014 (r263019) @@ -260,4 +260,89 @@ Here is a list of all conversion functio - `ucl_object_tolstring` - returns `const char *` and `size_t` len of UCL object (string can be not NULL terminated) - `ucl_object_tostring_forced` - returns string representation of any UCL object -Strings returned by these pointers are associated with the UCL object and exist over its lifetime. A caller should not free this memory. \ No newline at end of file +Strings returned by these pointers are associated with the UCL object and exist over its lifetime. A caller should not free this memory. + +# Generation functions + +It is possible to generate UCL objects from C primitive types. Moreover, libucl permits to create and modify complex UCL objects, such as arrays or associative objects. + +## ucl_object_new +~~~C +ucl_object_t * ucl_object_new (void) +~~~ + +Creates new object of type `UCL_NULL`. This object should be released by caller. + +## ucl_object_typed_new +~~~C +ucl_object_t * ucl_object_typed_new (unsigned int type) +~~~ + +Create an object of a specified type: +- `UCL_OBJECT` - UCL object - key/value pairs +- `UCL_ARRAY` - UCL array +- `UCL_INT` - integer number +- `UCL_FLOAT` - floating point number +- `UCL_STRING` - NULL terminated string +- `UCL_BOOLEAN` - boolean value +- `UCL_TIME` - time value (floating point number of seconds) +- `UCL_USERDATA` - opaque userdata pointer (may be used in macros) +- `UCL_NULL` - null value + +This object should be released by caller. + +## Primitive objects generation +Libucl provides the functions similar to inverse conversion functions called with the specific C type: +- `ucl_object_fromint` - converts `int64_t` to UCL object +- `ucl_object_fromdouble` - converts `double` to UCL object +- `ucl_object_fromboolean` - converts `bool` to UCL object +- `ucl_object_fromstring` - converts `const char *` to UCL object (this string is NULL terminated) +- `ucl_object_fromlstring` - converts `const char *` and `size_t` len to UCL object (string can be not NULL terminated) + +Also there is a function to generate UCL object from a string performing various parsing or conversion operations called `ucl_object_fromstring_common`. + +## ucl_object_fromstring_common +~~~C +ucl_object_t * ucl_object_fromstring_common (const char *str, + size_t len, enum ucl_string_flags flags) +~~~ + +This function is used to convert a string `str` of size `len` to an UCL objects applying `flags` conversions. If `len` is equal to zero then a `str` is assumed as NULL-terminated. This function supports the following flags (a set of flags can be specified using logical `OR` operation): + +- `UCL_STRING_ESCAPE` - perform JSON escape +- `UCL_STRING_TRIM` - trim leading and trailing whitespaces +- `UCL_STRING_PARSE_BOOLEAN` - parse passed string and detect boolean +- `UCL_STRING_PARSE_INT` - parse passed string and detect integer number +- `UCL_STRING_PARSE_DOUBLE` - parse passed string and detect integer or float number +- `UCL_STRING_PARSE_NUMBER` - parse passed string and detect number (both float or integer types) +- `UCL_STRING_PARSE` - parse passed string (and detect booleans and numbers) +- `UCL_STRING_PARSE_BYTES` - assume that numeric multipliers are in bytes notation, for example `10k` means `10*1024` and not `10*1000` as assumed without this flag + +If parsing operations fail then the resulting UCL object will be a `UCL_STRING`. A caller should always check the type of the returned object and release it after using. + +# Iteration function + +Iteration are used to iterate over UCL compound types: arrays and objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). To iterate over an object, an array or a key with multiple values there is a function `ucl_iterate_object`. + +## ucl_iterate_object +~~~C +ucl_object_t* ucl_iterate_object (ucl_object_t *obj, + ucl_object_iter_t *iter, bool expand_values); +~~~ + +This function accept opaque iterator pointer `iter`. In the first call this iterator *must* be initialized to `NULL`. Iterator is changed by this function call. `ucl_iterate_object` returns the next UCL object in the compound object `obj` or `NULL` if all objects have been iterated. The reference count of the object returned is not increased, so a caller should not unref the object or modify its content (e.g. by inserting to another compound object). The object `obj` should not be changed during the iteration process as well. `expand_values` flag speicifies whether `ucl_iterate_object` should expand keys with multiple values. The general rule is that if you need to iterate throught the *object* or *explicit array*, then you always need to set this flag to `true`. However, if you get some key in the object and want to extract all its values then you should set `expand_values` to `false`. Mixing of iteration types are not permitted since the iterator is set according to the iteration type and cannot be reused. Here is an example of iteration over the objects using libucl API (assuming that `top` is `UCL_OBJECT` in this example): + +~~~C +ucl_object_iter_t it = NULL, it_obj = NULL; +ucl_object_t *cur, *tmp; + +/* Iterate over the object */ +while ((obj = ucl_iterate_object (top, &it, true))) { + printf ("key: \"%s\"\n", ucl_object_key (obj)); + /* Iterate over the values of a key */ + while ((cur = ucl_iterate_object (obj, &it_obj, false))) { + printf ("value: \"%s\"\n", + ucl_object_tostring_forced (cur)); + } +} +~~~ \ No newline at end of file Modified: stable/10/contrib/libucl/include/ucl.h ============================================================================== --- head/contrib/libucl/include/ucl.h Sun Feb 23 21:49:21 2014 (r262398) +++ stable/10/contrib/libucl/include/ucl.h Tue Mar 11 13:06:09 2014 (r263019) @@ -32,6 +32,12 @@ #include #include +#ifdef _WIN32 +# define UCL_EXTERN __declspec(dllexport) +#else +# define UCL_EXTERN +#endif + /** * @mainpage * This is a reference manual for UCL API. You may find the description of UCL format by following this @@ -200,14 +206,14 @@ typedef struct ucl_object_s { * @param obj CL object * @return zero terminated key */ -char* ucl_copy_key_trash (ucl_object_t *obj); +UCL_EXTERN char* ucl_copy_key_trash (ucl_object_t *obj); /** * Copy and return a string value of an object, returned key is zero-terminated * @param obj CL object * @return zero terminated string representation of object value */ -char* ucl_copy_value_trash (ucl_object_t *obj); +UCL_EXTERN char* ucl_copy_value_trash (ucl_object_t *obj); /** * Creates a new object @@ -253,7 +259,7 @@ ucl_object_typed_new (unsigned int type) * @param flags conversion flags * @return new object */ -ucl_object_t * ucl_object_fromstring_common (const char *str, size_t len, +UCL_EXTERN ucl_object_t * ucl_object_fromstring_common (const char *str, size_t len, enum ucl_string_flags flags) UCL_WARN_UNUSED_RESULT; /** @@ -345,7 +351,7 @@ ucl_object_frombool (bool bv) * @param copy_key make an internal copy of key * @return new value of top object */ -ucl_object_t* ucl_object_insert_key (ucl_object_t *top, ucl_object_t *elt, +UCL_EXTERN ucl_object_t* ucl_object_insert_key (ucl_object_t *top, ucl_object_t *elt, const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT; /** @@ -358,10 +364,25 @@ ucl_object_t* ucl_object_insert_key (ucl * @param copy_key make an internal copy of key * @return new value of top object */ -ucl_object_t* ucl_object_replace_key (ucl_object_t *top, ucl_object_t *elt, +UCL_EXTERN ucl_object_t* ucl_object_replace_key (ucl_object_t *top, ucl_object_t *elt, const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT; /** + * Delete a object associated with key 'key', old object will be unrefered, + * @param top object + * @param key key associated to the object to remove + * @param keylen length of the key (or 0 for NULL terminated keys) + */ +UCL_EXTERN bool ucl_object_delete_keyl (ucl_object_t *top, const char *key, size_t keylen); + +/** + * Delete a object associated with key 'key', old object will be unrefered, + * @param top object + * @param key key associated to the object to remove + */ +UCL_EXTERN bool ucl_object_delete_key (ucl_object_t *top, const char *key); + +/** * Insert a object 'elt' to the hash 'top' and associate it with key 'key', if the specified key exist, * try to merge its content * @param top destination object (will be created automatically if top is NULL) @@ -371,7 +392,7 @@ ucl_object_t* ucl_object_replace_key (uc * @param copy_key make an internal copy of key * @return new value of top object */ -ucl_object_t* ucl_object_insert_key_merged (ucl_object_t *top, ucl_object_t *elt, +UCL_EXTERN ucl_object_t* ucl_object_insert_key_merged (ucl_object_t *top, ucl_object_t *elt, const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT; /** @@ -791,7 +812,7 @@ ucl_object_tolstring (ucl_object_t *obj, * @param key key to search * @return object matched the specified key or NULL if key is not found */ -ucl_object_t * ucl_object_find_key (ucl_object_t *obj, const char *key); +UCL_EXTERN ucl_object_t * ucl_object_find_key (ucl_object_t *obj, const char *key); /** * Return object identified by a fixed size key in the specified object @@ -800,7 +821,7 @@ ucl_object_t * ucl_object_find_key (ucl_ * @param klen length of a key * @return object matched the specified key or NULL if key is not found */ -ucl_object_t *ucl_object_find_keyl (ucl_object_t *obj, const char *key, size_t klen); +UCL_EXTERN ucl_object_t *ucl_object_find_keyl (ucl_object_t *obj, const char *key, size_t klen); /** * Returns a key of an object as a NULL terminated string @@ -830,7 +851,7 @@ ucl_object_keyl (ucl_object_t *obj, size * Free ucl object * @param obj ucl object to free */ -void ucl_object_free (ucl_object_t *obj); +UCL_EXTERN void ucl_object_free (ucl_object_t *obj); /** * Increase reference count for an object @@ -865,7 +886,7 @@ typedef void* ucl_object_iter_t; * while ((cur = ucl_iterate_object (obj, &it)) != NULL) ... * @return the next object or NULL */ -ucl_object_t* ucl_iterate_object (ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); +UCL_EXTERN ucl_object_t* ucl_iterate_object (ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); /** @} */ @@ -894,7 +915,7 @@ struct ucl_parser; * @param pool pool to allocate memory from * @return new parser object */ -struct ucl_parser* ucl_parser_new (int flags); +UCL_EXTERN struct ucl_parser* ucl_parser_new (int flags); /** * Register new handler for a macro @@ -903,7 +924,7 @@ struct ucl_parser* ucl_parser_new (int f * @param handler handler (it is called immediately after macro is parsed) * @param ud opaque user data for a handler */ -void ucl_parser_register_macro (struct ucl_parser *parser, const char *macro, +UCL_EXTERN void ucl_parser_register_macro (struct ucl_parser *parser, const char *macro, ucl_macro_handler handler, void* ud); /** @@ -912,7 +933,7 @@ void ucl_parser_register_macro (struct u * @param var variable name * @param value variable value */ -void ucl_parser_register_variable (struct ucl_parser *parser, const char *var, +UCL_EXTERN void ucl_parser_register_variable (struct ucl_parser *parser, const char *var, const char *value); /** @@ -923,7 +944,7 @@ void ucl_parser_register_variable (struc * @param err if *err is NULL it is set to parser error * @return true if chunk has been added and false in case of error */ -bool ucl_parser_add_chunk (struct ucl_parser *parser, const unsigned char *data, size_t len); +UCL_EXTERN bool ucl_parser_add_chunk (struct ucl_parser *parser, const unsigned char *data, size_t len); /** * Load and add data from a file @@ -932,7 +953,7 @@ bool ucl_parser_add_chunk (struct ucl_pa * @param err if *err is NULL it is set to parser error * @return true if chunk has been added and false in case of error */ -bool ucl_parser_add_file (struct ucl_parser *parser, const char *filename); +UCL_EXTERN bool ucl_parser_add_file (struct ucl_parser *parser, const char *filename); /** * Get a top object for a parser @@ -940,18 +961,18 @@ bool ucl_parser_add_file (struct ucl_par * @param err if *err is NULL it is set to parser error * @return top parser object or NULL */ -ucl_object_t* ucl_parser_get_object (struct ucl_parser *parser); +UCL_EXTERN ucl_object_t* ucl_parser_get_object (struct ucl_parser *parser); /** * Get the error string if failing * @param parser parser object */ -const char *ucl_parser_get_error(struct ucl_parser *parser); +UCL_EXTERN const char *ucl_parser_get_error(struct ucl_parser *parser); /** * Free ucl parser object * @param parser parser object */ -void ucl_parser_free (struct ucl_parser *parser); +UCL_EXTERN void ucl_parser_free (struct ucl_parser *parser); /** * Add new public key to parser for signatures check @@ -961,7 +982,7 @@ void ucl_parser_free (struct ucl_parser * @param err if *err is NULL it is set to parser error * @return true if a key has been successfully added */ -bool ucl_pubkey_add (struct ucl_parser *parser, const unsigned char *key, size_t len); +UCL_EXTERN bool ucl_pubkey_add (struct ucl_parser *parser, const unsigned char *key, size_t len); /** * Set FILENAME and CURDIR variables in parser @@ -970,7 +991,7 @@ bool ucl_pubkey_add (struct ucl_parser * * @param need_expand perform realpath() if this variable is true and filename is not NULL * @return true if variables has been set */ -bool ucl_parser_set_filevars (struct ucl_parser *parser, const char *filename, +UCL_EXTERN bool ucl_parser_set_filevars (struct ucl_parser *parser, const char *filename, bool need_expand); /** @} */ @@ -1005,7 +1026,7 @@ struct ucl_emitter_functions { * #UCL_EMIT_CONFIG then emit config like object * @return dump of an object (must be freed after using) or NULL in case of error */ -unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type); +UCL_EXTERN unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type); /** * Emit object to a string @@ -1014,7 +1035,7 @@ unsigned char *ucl_object_emit (ucl_obje * #UCL_EMIT_CONFIG then emit config like object * @return dump of an object (must be freed after using) or NULL in case of error */ -bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type, +UCL_EXTERN bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type, struct ucl_emitter_functions *emitter); /** @} */ Modified: stable/10/contrib/libucl/src/ucl_internal.h ============================================================================== --- head/contrib/libucl/src/ucl_internal.h Sun Feb 23 21:49:21 2014 (r262398) +++ stable/10/contrib/libucl/src/ucl_internal.h Tue Mar 11 13:06:09 2014 (r263019) @@ -25,7 +25,9 @@ #define UCL_INTERNAL_H_ #include +#ifndef _WIN32 #include +#endif #include #include Modified: stable/10/contrib/libucl/src/ucl_parser.c ============================================================================== --- head/contrib/libucl/src/ucl_parser.c Sun Feb 23 21:49:21 2014 (r262398) +++ stable/10/contrib/libucl/src/ucl_parser.c Tue Mar 11 13:06:09 2014 (r263019) @@ -1233,6 +1233,28 @@ ucl_parse_multiline_string (struct ucl_p return len; } +static ucl_object_t* +ucl_get_value_object (struct ucl_parser *parser) +{ + ucl_object_t *t, *obj = NULL; + + if (parser->stack->obj->type == UCL_ARRAY) { + /* Object must be allocated */ + obj = ucl_object_new (); + t = parser->stack->obj->value.av; + DL_APPEND (t, obj); + parser->cur_obj = obj; + parser->stack->obj->value.av = t; + parser->stack->obj->len ++; + } + else { + /* Object has been already allocated */ + obj = parser->cur_obj; + } + + return obj; +} + /** * Handle value data * @param parser @@ -1243,32 +1265,30 @@ static bool ucl_parse_value (struct ucl_parser *parser, struct ucl_chunk *chunk) { const unsigned char *p, *c; - ucl_object_t *obj = NULL, *t; + ucl_object_t *obj = NULL; unsigned int stripped_spaces; int str_len; bool need_unescape = false, ucl_escape = false, var_expand = false; p = chunk->pos; - while (p < chunk->end) { - if (obj == NULL) { - if (parser->stack->obj->type == UCL_ARRAY) { - /* Object must be allocated */ - obj = ucl_object_new (); - t = parser->stack->obj->value.av; - DL_APPEND (t, obj); - parser->cur_obj = obj; - parser->stack->obj->value.av = t; - parser->stack->obj->len ++; - } - else { - /* Object has been already allocated */ - obj = parser->cur_obj; - } + /* Skip any spaces and comments */ + if (ucl_test_character (*p, UCL_CHARACTER_WHITESPACE_UNSAFE) || + (chunk->remain >= 2 && ucl_lex_is_comment (p[0], p[1]))) { + while (p < chunk->end && ucl_test_character (*p, UCL_CHARACTER_WHITESPACE_UNSAFE)) { + ucl_chunk_skipc (chunk, p); + } + if (!ucl_skip_comments (parser)) { + return false; } + p = chunk->pos; + } + + while (p < chunk->end) { c = p; switch (*p) { case '"': + obj = ucl_get_value_object (parser); ucl_chunk_skipc (chunk, p); if (!ucl_lex_json_string (parser, chunk, &need_unescape, &ucl_escape, &var_expand)) { return false; @@ -1285,6 +1305,7 @@ ucl_parse_value (struct ucl_parser *pars return true; break; case '{': + obj = ucl_get_value_object (parser); /* We have a new object */ obj = ucl_add_parser_stack (obj, parser, false, parser->stack->level); @@ -1292,13 +1313,25 @@ ucl_parse_value (struct ucl_parser *pars return true; break; case '[': + obj = ucl_get_value_object (parser); /* We have a new array */ obj = ucl_add_parser_stack (obj, parser, true, parser->stack->level); ucl_chunk_skipc (chunk, p); return true; break; + case ']': + /* We have the array ending */ + if (parser->stack && parser->stack->obj->type == UCL_ARRAY) { + parser->state = UCL_STATE_AFTER_VALUE; + return true; + } + else { + goto parse_string; + } + break; case '<': + obj = ucl_get_value_object (parser); /* We have something like multiline value, which must be <<[A-Z]+\n */ if (chunk->end - p > 3) { if (memcmp (p, "<<", 2) == 0) { @@ -1332,17 +1365,9 @@ ucl_parse_value (struct ucl_parser *pars } /* Fallback to ordinary strings */ default: - /* Skip any spaces and comments */ - if (ucl_test_character (*p, UCL_CHARACTER_WHITESPACE_UNSAFE) || - (chunk->remain >= 2 && ucl_lex_is_comment (p[0], p[1]))) { - while (p < chunk->end && ucl_test_character (*p, UCL_CHARACTER_WHITESPACE_UNSAFE)) { - ucl_chunk_skipc (chunk, p); - } - if (!ucl_skip_comments (parser)) { - return false; - } - p = chunk->pos; - continue; +parse_string: + if (obj == NULL) { + obj = ucl_get_value_object (parser); } /* Parse atom */ if (ucl_test_character (*p, UCL_CHARACTER_VALUE_DIGIT_START)) { Modified: stable/10/contrib/libucl/src/ucl_util.c ============================================================================== --- head/contrib/libucl/src/ucl_util.c Sun Feb 23 21:49:21 2014 (r262398) +++ stable/10/contrib/libucl/src/ucl_util.c Tue Mar 11 13:06:09 2014 (r263019) @@ -35,6 +35,75 @@ #include #endif +#ifdef _WIN32 +#include + +#define PROT_READ 1 +#define PROT_WRITE 2 +#define PROT_READWRITE 3 +#define MAP_SHARED 1 +#define MAP_PRIVATE 2 +#define MAP_FAILED ((void *) -1) + +static void *mmap(char *addr, size_t length, int prot, int access, int fd, off_t offset) +{ + void *map = NULL; + HANDLE handle = INVALID_HANDLE_VALUE; + + switch (prot) { + default: + case PROT_READ: + { + handle = CreateFileMapping((HANDLE) _get_osfhandle(fd), 0, PAGE_READONLY, 0, length, 0); + if (!handle) break; + map = (void *) MapViewOfFile(handle, FILE_MAP_READ, 0, 0, length); + CloseHandle(handle); + break; + } + case PROT_WRITE: + { + handle = CreateFileMapping((HANDLE) _get_osfhandle(fd), 0, PAGE_READWRITE, 0, length, 0); + if (!handle) break; + map = (void *) MapViewOfFile(handle, FILE_MAP_WRITE, 0, 0, length); + CloseHandle(handle); + break; + } + case PROT_READWRITE: + { + handle = CreateFileMapping((HANDLE) _get_osfhandle(fd), 0, PAGE_READWRITE, 0, length, 0); + if (!handle) break; + map = (void *) MapViewOfFile(handle, FILE_MAP_ALL_ACCESS, 0, 0, length); + CloseHandle(handle); + break; + } + } + if (map == (void *) NULL) { + return (void *) MAP_FAILED; + } + return (void *) ((char *) map + offset); +} + +static int munmap(void *map,size_t length) +{ + if (!UnmapViewOfFile(map)) { + return(-1); + } + return(0); +} + +static char* realpath(const char *path, char *resolved_path) { + char *p; + char tmp[MAX_PATH + 1]; + strncpy(tmp, path, sizeof(tmp)-1); + p = tmp; + while(*p) { + if (*p == '/') *p = '\\'; + p++; + } + return _fullpath(resolved_path, tmp, MAX_PATH); +} +#endif + /** * @file rcl_util.c * Utilities for rcl parsing @@ -177,7 +246,7 @@ ucl_unescape_json_string (char *str, siz return (t - str); } -char * +UCL_EXTERN char * ucl_copy_key_trash (ucl_object_t *obj) { if (obj->trash_stack[UCL_TRASH_KEY] == NULL && obj->key != NULL) { @@ -193,7 +262,7 @@ ucl_copy_key_trash (ucl_object_t *obj) return obj->trash_stack[UCL_TRASH_KEY]; } -char * +UCL_EXTERN char * ucl_copy_value_trash (ucl_object_t *obj) { if (obj->trash_stack[UCL_TRASH_VALUE] == NULL) { @@ -216,7 +285,7 @@ ucl_copy_value_trash (ucl_object_t *obj) return obj->trash_stack[UCL_TRASH_VALUE]; } -ucl_object_t* +UCL_EXTERN ucl_object_t* ucl_parser_get_object (struct ucl_parser *parser) { if (parser->state != UCL_STATE_ERROR && parser->top_obj != NULL) { @@ -226,7 +295,7 @@ ucl_parser_get_object (struct ucl_parser return NULL; } -void +UCL_EXTERN void ucl_parser_free (struct ucl_parser *parser) { struct ucl_stack *stack, *stmp; @@ -266,7 +335,7 @@ ucl_parser_free (struct ucl_parser *pars UCL_FREE (sizeof (struct ucl_parser), parser); } -const char * +UCL_EXTERN const char * ucl_parser_get_error(struct ucl_parser *parser) { if (parser->err == NULL) @@ -275,7 +344,7 @@ ucl_parser_get_error(struct ucl_parser * return utstring_body(parser->err); } -bool +UCL_EXTERN bool ucl_pubkey_add (struct ucl_parser *parser, const unsigned char *key, size_t len) { #ifndef HAVE_OPENSSL @@ -679,7 +748,7 @@ ucl_include_file (const unsigned char *d * @param err error ptr * @return */ -bool +UCL_EXTERN bool ucl_include_handler (const unsigned char *data, size_t len, void* ud) { struct ucl_parser *parser = ud; @@ -700,7 +769,7 @@ ucl_include_handler (const unsigned char * @param err error ptr * @return */ -bool +UCL_EXTERN bool ucl_includes_handler (const unsigned char *data, size_t len, void* ud) { struct ucl_parser *parser = ud; @@ -714,7 +783,7 @@ ucl_includes_handler (const unsigned cha } -bool +UCL_EXTERN bool ucl_try_include_handler (const unsigned char *data, size_t len, void* ud) { struct ucl_parser *parser = ud; @@ -727,7 +796,7 @@ ucl_try_include_handler (const unsigned return ucl_include_url (data, len, parser, false, false); } -bool +UCL_EXTERN bool ucl_parser_set_filevars (struct ucl_parser *parser, const char *filename, bool need_expand) { char realbuf[PATH_MAX], *curdir; @@ -757,7 +826,7 @@ ucl_parser_set_filevars (struct ucl_pars return true; } -bool +UCL_EXTERN bool ucl_parser_add_file (struct ucl_parser *parser, const char *filename) { unsigned char *buf; @@ -1055,6 +1124,29 @@ ucl_object_insert_key_common (ucl_object return top; } +bool +ucl_object_delete_keyl(ucl_object_t *top, const char *key, size_t keylen) +{ + ucl_object_t *found; + + found = ucl_object_find_keyl(top, key, keylen); + + if (found == NULL) + return false; + + ucl_hash_delete(top->value.ov, found); + ucl_object_unref (found); + top->len --; + + return true; +} + +bool +ucl_object_delete_key(ucl_object_t *top, const char *key) +{ + return ucl_object_delete_keyl(top, key, 0); +} + ucl_object_t * ucl_object_insert_key (ucl_object_t *top, ucl_object_t *elt, const char *key, size_t keylen, bool copy_key) Copied: stable/10/contrib/libucl/tests/10.in (from r262975, head/contrib/libucl/tests/10.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libucl/tests/10.in Tue Mar 11 13:06:09 2014 (r263019, copy of r262975, head/contrib/libucl/tests/10.in) @@ -0,0 +1 @@ +a [] Modified: stable/10/contrib/libucl/tests/8.in ============================================================================== --- head/contrib/libucl/tests/8.in Sun Feb 23 21:49:21 2014 (r262398) +++ stable/10/contrib/libucl/tests/8.in Tue Mar 11 13:06:09 2014 (r263019) @@ -19,3 +19,5 @@ section test { section foo { # test param = 123.2; } + +array = [] Modified: stable/10/contrib/libucl/tests/8.res ============================================================================== --- head/contrib/libucl/tests/8.res Sun Feb 23 21:49:21 2014 (r262398) +++ stable/10/contrib/libucl/tests/8.res Tue Mar 11 13:06:09 2014 (r263019) @@ -33,4 +33,6 @@ section { param = 123.200000; } } +array [ +] Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Tue Mar 11 13:03:05 2014 (r263018) +++ stable/10/lib/Makefile Tue Mar 11 13:06:09 2014 (r263019) @@ -114,6 +114,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libtelnet} \ ${_libthr} \ libthread_db \ + libucl \ libufs \ libugidfw \ libulog \ Modified: stable/10/lib/libucl/Makefile ============================================================================== --- head/lib/libucl/Makefile Sun Feb 23 21:49:21 2014 (r262398) +++ stable/10/lib/libucl/Makefile Tue Mar 11 13:06:09 2014 (r263019) @@ -13,7 +13,7 @@ SRCS= ucl_emitter.c \ .PATH: ${LIBUCL}/src -WARNS= 2 +WARNS= 1 CFLAGS+= -I${LIBUCL}/include \ -I${LIBUCL}/src \ -I${LIBUCL}/uthash Modified: stable/10/share/mk/bsd.libnames.mk ============================================================================== --- stable/10/share/mk/bsd.libnames.mk Tue Mar 11 13:03:05 2014 (r263018) +++ stable/10/share/mk/bsd.libnames.mk Tue Mar 11 13:06:09 2014 (r263019) @@ -148,6 +148,7 @@ LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacp LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTERMCAP" LIBTINFO?= "don't use LIBTINFO, use LIBNCURSES" +LIBUCL?= ${DESTDIR}${LIBPRIVATEDIR}/libucl.a LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 13:16:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B5ED4BD2; Tue, 11 Mar 2014 13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A0922340; Tue, 11 Mar 2014 13:16: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 s2BDG4Ga092453; Tue, 11 Mar 2014 13:16:04 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BDG4T1092450; Tue, 11 Mar 2014 13:16:04 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201403111316.s2BDG4T1092450@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 11 Mar 2014 13:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263020 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 13:16:04 -0000 Author: bapt Date: Tue Mar 11 13:16:03 2014 New Revision: 263020 URL: http://svnweb.freebsd.org/changeset/base/263020 Log: r262400,r262401,r262418 Sync pkg(7) with head Modified: stable/10/usr.sbin/pkg/Makefile stable/10/usr.sbin/pkg/config.c stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/Makefile ============================================================================== --- stable/10/usr.sbin/pkg/Makefile Tue Mar 11 13:06:09 2014 (r263019) +++ stable/10/usr.sbin/pkg/Makefile Tue Mar 11 13:16:03 2014 (r263020) @@ -4,11 +4,11 @@ PROG= pkg SRCS= pkg.c dns_utils.c config.c MAN= pkg.7 -CFLAGS+=-I${.CURDIR}/../../contrib/libyaml/include -.PATH: ${.CURDIR}/../../contrib/libyaml/include -DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF} ${LIBSSL} \ +CFLAGS+=-I${.CURDIR}/../../contrib/libucl/include +.PATH: ${.CURDIR}/../../contrib/libucl/include +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ ${LIBCRYPTO} -LDADD= -larchive -lelf -lfetch -lyaml -lsbuf -lssl -lcrypto -USEPRIVATELIB= yaml +LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto +USEPRIVATELIB= ucl .include Modified: stable/10/usr.sbin/pkg/config.c ============================================================================== --- stable/10/usr.sbin/pkg/config.c Tue Mar 11 13:06:09 2014 (r263019) +++ stable/10/usr.sbin/pkg/config.c Tue Mar 11 13:16:03 2014 (r263020) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Baptiste Daroussin + * Copyright (c) 2014 Baptiste Daroussin * Copyright (c) 2013 Bryan Drewery * All rights reserved. * @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include @@ -509,76 +509,45 @@ boolstr_to_bool(const char *str) } static void -config_parse(yaml_document_t *doc, yaml_node_t *node, pkg_conf_file_t conftype) +config_parse(ucl_object_t *obj, pkg_conf_file_t conftype) { - yaml_node_item_t *item; - yaml_node_pair_t *pair; - yaml_node_t *key, *val, *item_val; struct sbuf *buf = sbuf_new_auto(); + ucl_object_t *cur, *seq; + ucl_object_iter_t it = NULL, itseq = NULL; struct config_entry *temp_config; struct config_value *cv; + const char *key; int i; size_t j; - pair = node->data.mapping.pairs.start; - /* Temporary config for configs that may be disabled. */ temp_config = calloc(CONFIG_SIZE, sizeof(struct config_entry)); - while (pair < node->data.mapping.pairs.top) { - key = yaml_document_get_node(doc, pair->key); - val = yaml_document_get_node(doc, pair->value); - - /* - * ignoring silently empty keys can be empty lines - * or user mistakes - */ - if (key->data.scalar.length <= 0) { - ++pair; - continue; - } - - /* - * silently skip on purpose to allow user to leave - * empty lines without complaining - */ - if (val->type == YAML_NO_NODE || - (val->type == YAML_SCALAR_NODE && - val->data.scalar.length <= 0)) { - ++pair; + while ((cur = ucl_iterate_object(obj, &it, true))) { + key = ucl_object_key(cur); + if (key == NULL) continue; - } - sbuf_clear(buf); if (conftype == CONFFILE_PKG) { - for (j = 0; j < strlen(key->data.scalar.value); ++j) - sbuf_putc(buf, - toupper(key->data.scalar.value[j])); + for (j = 0; j < strlen(key); ++j) + sbuf_putc(buf, key[j]); sbuf_finish(buf); } else if (conftype == CONFFILE_REPO) { - /* The CONFFILE_REPO type is more restrictive. Only - parse known elements. */ - if (strcasecmp(key->data.scalar.value, "url") == 0) + if (strcasecmp(key, "url") == 0) sbuf_cpy(buf, "PACKAGESITE"); - else if (strcasecmp(key->data.scalar.value, - "mirror_type") == 0) + else if (strcasecmp(key, "mirror_type") == 0) sbuf_cpy(buf, "MIRROR_TYPE"); - else if (strcasecmp(key->data.scalar.value, - "signature_type") == 0) + else if (strcasecmp(key, "signature_type") == 0) sbuf_cpy(buf, "SIGNATURE_TYPE"); - else if (strcasecmp(key->data.scalar.value, - "fingerprints") == 0) + else if (strcasecmp(key, "fingerprints") == 0) sbuf_cpy(buf, "FINGERPRINTS"); - else if (strcasecmp(key->data.scalar.value, - "enabled") == 0) { - /* Skip disabled repos. */ - if (!boolstr_to_bool(val->data.scalar.value)) + else if (strcasecmp(key, "enabled") == 0) { + if ((cur->type != UCL_BOOLEAN) || + !ucl_object_toboolean(cur)) goto cleanup; - } else { /* Skip unknown entries for future use. */ - ++pair; + } else continue; - } sbuf_finish(buf); } @@ -588,51 +557,40 @@ config_parse(yaml_document_t *doc, yaml_ } /* Silently skip unknown keys to be future compatible. */ - if (i == CONFIG_SIZE) { - ++pair; + if (i == CONFIG_SIZE) continue; - } /* env has priority over config file */ - if (c[i].envset) { - ++pair; + if (c[i].envset) continue; - } /* Parse sequence value ["item1", "item2"] */ switch (c[i].type) { case PKG_CONFIG_LIST: - if (val->type != YAML_SEQUENCE_NODE) { - fprintf(stderr, "Skipping invalid array " + if (cur->type != UCL_ARRAY) { + warnx("Skipping invalid array " "value for %s.\n", c[i].key); - ++pair; continue; } - item = val->data.sequence.items.start; temp_config[i].list = malloc(sizeof(*temp_config[i].list)); STAILQ_INIT(temp_config[i].list); - while (item < val->data.sequence.items.top) { - item_val = yaml_document_get_node(doc, *item); - if (item_val->type != YAML_SCALAR_NODE) { - ++item; + while ((seq = ucl_iterate_object(cur, &itseq, true))) { + if (seq->type != UCL_STRING) continue; - } cv = malloc(sizeof(struct config_value)); cv->value = - strdup(item_val->data.scalar.value); + strdup(ucl_object_tostring(seq)); STAILQ_INSERT_TAIL(temp_config[i].list, cv, next); - ++item; } break; default: /* Normal string value. */ - temp_config[i].value = strdup(val->data.scalar.value); + temp_config[i].value = strdup(ucl_object_tostring(cur)); break; } - ++pair; } /* Repo is enabled, copy over all settings from temp_config. */ @@ -662,27 +620,22 @@ cleanup: * etc... */ static void -parse_repo_file(yaml_document_t *doc, yaml_node_t *node) +parse_repo_file(ucl_object_t *obj) { - yaml_node_pair_t *pair; + ucl_object_iter_t it = NULL; + ucl_object_t *cur; + const char *key; - pair = node->data.mapping.pairs.start; - while (pair < node->data.mapping.pairs.top) { - yaml_node_t *key = yaml_document_get_node(doc, pair->key); - yaml_node_t *val = yaml_document_get_node(doc, pair->value); + while ((cur = ucl_iterate_object(obj, &it, true))) { + key = ucl_object_key(cur); - if (key->data.scalar.length <= 0) { - ++pair; + if (key == NULL) continue; - } - if (val->type != YAML_MAPPING_NODE) { - ++pair; + if (cur->type != UCL_OBJECT) continue; - } - config_parse(doc, val, CONFFILE_REPO); - ++pair; + config_parse(cur, CONFFILE_REPO); } } @@ -690,37 +643,33 @@ parse_repo_file(yaml_document_t *doc, ya static int read_conf_file(const char *confpath, pkg_conf_file_t conftype) { - FILE *fp; - yaml_parser_t parser; - yaml_document_t doc; - yaml_node_t *node; + struct ucl_parser *p; + ucl_object_t *obj = NULL; - if ((fp = fopen(confpath, "r")) == NULL) { + p = ucl_parser_new(0); + + if (!ucl_parser_add_file(p, confpath)) { if (errno != ENOENT) - err(EXIT_FAILURE, "Unable to open configuration " - "file %s", confpath); + errx(EXIT_FAILURE, "Unable to parse configuration " + "file %s: %s", confpath, ucl_parser_get_error(p)); + ucl_parser_free(p); /* no configuration present */ return (1); } - yaml_parser_initialize(&parser); - yaml_parser_set_input_file(&parser, fp); - yaml_parser_load(&parser, &doc); - - node = yaml_document_get_root_node(&doc); - - if (node == NULL || node->type != YAML_MAPPING_NODE) + obj = ucl_parser_get_object(p); + if (obj->type != UCL_OBJECT) warnx("Invalid configuration format, ignoring the " "configuration file %s", confpath); else { if (conftype == CONFFILE_PKG) - config_parse(&doc, node, conftype); + config_parse(obj, conftype); else if (conftype == CONFFILE_REPO) - parse_repo_file(&doc, node); + parse_repo_file(obj); } - yaml_document_delete(&doc); - yaml_parser_delete(&parser); + ucl_object_free(obj); + ucl_parser_free(p); return (0); } Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Tue Mar 11 13:06:09 2014 (r263019) +++ stable/10/usr.sbin/pkg/pkg.c Tue Mar 11 13:16:03 2014 (r263020) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2013 Baptiste Daroussin + * Copyright (c) 2012-2014 Baptiste Daroussin * Copyright (c) 2013 Bryan Drewery * All rights reserved. * @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include @@ -271,38 +271,28 @@ cleanup: } static struct fingerprint * -parse_fingerprint(yaml_document_t *doc, yaml_node_t *node) +parse_fingerprint(ucl_object_t *obj) { - yaml_node_pair_t *pair; - yaml_char_t *function, *fp; + ucl_object_t *cur; + ucl_object_iter_t it = NULL; + const char *function, *fp, *key; struct fingerprint *f; hash_t fct = HASH_UNKNOWN; function = fp = NULL; - pair = node->data.mapping.pairs.start; - while (pair < node->data.mapping.pairs.top) { - yaml_node_t *key = yaml_document_get_node(doc, pair->key); - yaml_node_t *val = yaml_document_get_node(doc, pair->value); - - if (key->data.scalar.length <= 0) { - ++pair; + while ((cur = ucl_iterate_object(obj, &it, true))) { + key = ucl_object_key(cur); + if (cur->type != UCL_STRING) + continue; + if (strcasecmp(key, "function") == 0) { + function = ucl_object_tostring(cur); continue; } - - if (val->type != YAML_SCALAR_NODE) { - ++pair; + if (strcasecmp(key, "fingerprint") == 0) { + fp = ucl_object_tostring(cur); continue; } - - if (strcasecmp(key->data.scalar.value, "function") == 0) - function = val->data.scalar.value; - else if (strcasecmp(key->data.scalar.value, "fingerprint") - == 0) - fp = val->data.scalar.value; - - ++pair; - continue; } if (fp == NULL || function == NULL) @@ -312,7 +302,7 @@ parse_fingerprint(yaml_document_t *doc, fct = HASH_SHA256; if (fct == HASH_UNKNOWN) { - fprintf(stderr, "Unsupported hashing function: %s\n", function); + warnx("Unsupported hashing function: %s", function); return (NULL); } @@ -339,10 +329,8 @@ free_fingerprint_list(struct fingerprint static struct fingerprint * load_fingerprint(const char *dir, const char *filename) { - yaml_parser_t parser; - yaml_document_t doc; - yaml_node_t *node; - FILE *fp; + ucl_object_t *obj = NULL; + struct ucl_parser *p = NULL; struct fingerprint *f; char path[MAXPATHLEN]; @@ -350,24 +338,23 @@ load_fingerprint(const char *dir, const snprintf(path, MAXPATHLEN, "%s/%s", dir, filename); - if ((fp = fopen(path, "r")) == NULL) + p = ucl_parser_new(0); + if (!ucl_parser_add_file(p, path)) { + warnx("%s: %s", path, ucl_parser_get_error(p)); + ucl_parser_free(p); return (NULL); + } - yaml_parser_initialize(&parser); - yaml_parser_set_input_file(&parser, fp); - yaml_parser_load(&parser, &doc); - - node = yaml_document_get_root_node(&doc); - if (node == NULL || node->type != YAML_MAPPING_NODE) - goto out; - - f = parse_fingerprint(&doc, node); - f->name = strdup(filename); - -out: - yaml_document_delete(&doc); - yaml_parser_delete(&parser); - fclose(fp); + obj = ucl_parser_get_object(p); + + if (obj->type == UCL_OBJECT) + f = parse_fingerprint(obj); + + if (f != NULL) + f->name = strdup(filename); + + ucl_object_free(obj); + ucl_parser_free(p); return (f); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 14:33:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0152AA70; Tue, 11 Mar 2014 14:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C74E6D0B; Tue, 11 Mar 2014 14:33: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 s2BEXgO3024819; Tue, 11 Mar 2014 14:33:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BEXgbo024818; Tue, 11 Mar 2014 14:33:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201403111433.s2BEXgbo024818@svn.freebsd.org> From: John Baldwin Date: Tue, 11 Mar 2014 14:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263022 - in stable: 10/sys/dev/acpica 9/sys/dev/acpica X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 14:33:43 -0000 Author: jhb Date: Tue Mar 11 14:33:42 2014 New Revision: 263022 URL: http://svnweb.freebsd.org/changeset/base/263022 Log: MFC 261243: Some BIOSes incorrectly use standard memory resource ranges to list the memory ranges that they decode for downstream devices rather than creating ResourceProducer range resource entries. The result is that we allocate the full range to the PCI root bridge device causing allocations in child devices to all fail. As a workaround, ignore any standard memory resources on a PCI root bridge device. It is normal for a PCI root bridge to allocate an I/O resource for the I/O ports used for PCI config access, but I have not seen any PCI root bridges that legitimately allocate a memory resource. Modified: stable/10/sys/dev/acpica/acpi.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/acpica/acpi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/sys/dev/acpica/acpi.c ============================================================================== --- stable/10/sys/dev/acpica/acpi.c Tue Mar 11 13:47:11 2014 (r263021) +++ stable/10/sys/dev/acpica/acpi.c Tue Mar 11 14:33:42 2014 (r263022) @@ -1190,12 +1190,28 @@ acpi_set_resource(device_t dev, device_t struct acpi_softc *sc = device_get_softc(dev); struct acpi_device *ad = device_get_ivars(child); struct resource_list *rl = &ad->ad_rl; + ACPI_DEVICE_INFO *devinfo; u_long end; /* Ignore IRQ resources for PCI link devices. */ if (type == SYS_RES_IRQ && ACPI_ID_PROBE(dev, child, pcilink_ids) != NULL) return (0); + /* + * Ignore memory resources for PCI root bridges. Some BIOSes + * incorrectly enumerate the memory ranges they decode as plain + * memory resources instead of as a ResourceProducer range. + */ + if (type == SYS_RES_MEMORY) { + if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) { + if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { + AcpiOsFree(devinfo); + return (0); + } + AcpiOsFree(devinfo); + } + } + /* If the resource is already allocated, fail. */ if (resource_list_busy(rl, type, rid)) return (EBUSY); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 14:59:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0A00A93A; Tue, 11 Mar 2014 14:59: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE89DF4D; Tue, 11 Mar 2014 14:59: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 s2BExYel034169; Tue, 11 Mar 2014 14:59:34 GMT (envelope-from achim@svn.freebsd.org) Received: (from achim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BExYX0034165; Tue, 11 Mar 2014 14:59:34 GMT (envelope-from achim@svn.freebsd.org) Message-Id: <201403111459.s2BExYX0034165@svn.freebsd.org> From: Achim Leubner Date: Tue, 11 Mar 2014 14:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263024 - stable/10/sys/dev/aacraid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 14:59:35 -0000 Author: achim Date: Tue Mar 11 14:59:34 2014 New Revision: 263024 URL: http://svnweb.freebsd.org/changeset/base/263024 Log: MFC r257847, r260243: Update aacraid to version 3.2.5. Approved by: emaste (co-mentor) Modified: stable/10/sys/dev/aacraid/aacraid.c stable/10/sys/dev/aacraid/aacraid_cam.c stable/10/sys/dev/aacraid/aacraid_reg.h stable/10/sys/dev/aacraid/aacraid_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/aacraid/aacraid.c ============================================================================== --- stable/10/sys/dev/aacraid/aacraid.c Tue Mar 11 14:48:44 2014 (r263023) +++ stable/10/sys/dev/aacraid/aacraid.c Tue Mar 11 14:59:34 2014 (r263024) @@ -98,8 +98,11 @@ static int aac_alloc(struct aac_softc *s static void aac_common_map(void *arg, bus_dma_segment_t *segs, int nseg, int error); static int aac_check_firmware(struct aac_softc *sc); +static void aac_define_int_mode(struct aac_softc *sc); static int aac_init(struct aac_softc *sc); +static int aac_find_pci_capability(struct aac_softc *sc, int cap); static int aac_setup_intr(struct aac_softc *sc); +static int aac_check_config(struct aac_softc *sc); /* PMC SRC interface */ static int aac_src_get_fwstatus(struct aac_softc *sc); @@ -110,7 +113,7 @@ static void aac_src_set_mailbox(struct a u_int32_t arg0, u_int32_t arg1, u_int32_t arg2, u_int32_t arg3); static int aac_src_get_mailbox(struct aac_softc *sc, int mb); -static void aac_src_set_interrupts(struct aac_softc *sc, int enable); +static void aac_src_access_devreg(struct aac_softc *sc, int mode); static int aac_src_send_command(struct aac_softc *sc, struct aac_command *cm); static int aac_src_get_outb_queue(struct aac_softc *sc); static void aac_src_set_outb_queue(struct aac_softc *sc, int index); @@ -122,7 +125,7 @@ struct aac_interface aacraid_src_interfa aac_src_clear_istatus, aac_src_set_mailbox, aac_src_get_mailbox, - aac_src_set_interrupts, + aac_src_access_devreg, aac_src_send_command, aac_src_get_outb_queue, aac_src_set_outb_queue @@ -141,7 +144,7 @@ struct aac_interface aacraid_srcv_interf aac_src_clear_istatus, aac_srcv_set_mailbox, aac_srcv_get_mailbox, - aac_src_set_interrupts, + aac_src_access_devreg, aac_src_send_command, aac_src_get_outb_queue, aac_src_set_outb_queue @@ -258,6 +261,7 @@ aacraid_attach(struct aac_softc *sc) /* * Check that the firmware on the card is supported. */ + sc->msi_enabled = FALSE; if ((error = aac_check_firmware(sc)) != 0) return(error); @@ -278,6 +282,7 @@ aacraid_attach(struct aac_softc *sc) if ((error = aac_alloc(sc)) != 0) return(error); if (!(sc->flags & AAC_FLAGS_SYNC_MODE)) { + aac_define_int_mode(sc); if ((error = aac_init(sc)) != 0) return(error); } @@ -341,7 +346,7 @@ aacraid_attach(struct aac_softc *sc) sc->aac_state &= ~AAC_STATE_SUSPEND; /* enable interrupts now */ - AAC_UNMASK_INTERRUPTS(sc); + AAC_ACCESS_DEVREG(sc, AAC_ENABLE_INTERRUPT); #if __FreeBSD_version >= 800000 mtx_lock(&sc->aac_io_lock); @@ -442,6 +447,7 @@ aac_get_container_info(struct aac_softc struct aac_fib *fib; struct aac_mntinfo *mi; struct aac_cnt_config *ccfg; + int rval; if (sync_fib == NULL) { if (aacraid_alloc_command(sc, &cm)) { @@ -499,9 +505,10 @@ aac_get_container_info(struct aac_softc *uid = cid; if (mir->MntTable[0].VolType != CT_NONE && !(mir->MntTable[0].ContentState & AAC_FSCS_HIDDEN)) { - if (!(sc->aac_support_opt2 & AAC_SUPPORTED_VARIABLE_BLOCK_SIZE)) - mir->MntTable[0].ObjExtension.BlockSize = 0x200; - + if (!(sc->aac_support_opt2 & AAC_SUPPORTED_VARIABLE_BLOCK_SIZE)) { + mir->MntTable[0].ObjExtension.BlockDevice.BlockSize = 0x200; + mir->MntTable[0].ObjExtension.BlockDevice.bdLgclPhysMap = 0; + } ccfg = (struct aac_cnt_config *)&fib->data[0]; bzero(ccfg, sizeof (*ccfg) - CT_PACKET_SIZE); ccfg->Command = VM_ContainerConfig; @@ -509,9 +516,10 @@ aac_get_container_info(struct aac_softc ccfg->CTCommand.param[0] = cid; if (sync_fib) { - if (aac_sync_fib(sc, ContainerCommand, 0, fib, - sizeof(struct aac_cnt_config) == 0) && - ccfg->CTCommand.param[0] == ST_OK && + rval = aac_sync_fib(sc, ContainerCommand, 0, fib, + sizeof(struct aac_cnt_config)); + if (rval == 0 && ccfg->Command == ST_OK && + ccfg->CTCommand.param[0] == CT_OK && mir->MntTable[0].VolType != CT_PASSTHRU) *uid = ccfg->CTCommand.param[1]; } else { @@ -527,8 +535,9 @@ aac_get_container_info(struct aac_softc AAC_FIBSTATE_ASYNC | AAC_FIBSTATE_FAST_RESPONSE; fib->Header.Command = ContainerCommand; - if (aacraid_wait_command(cm) == 0 && - ccfg->CTCommand.param[0] == ST_OK && + rval = aacraid_wait_command(cm); + if (rval == 0 && ccfg->Command == ST_OK && + ccfg->CTCommand.param[0] == CT_OK && mir->MntTable[0].VolType != CT_PASSTHRU) *uid = ccfg->CTCommand.param[1]; aacraid_release_command(cm); @@ -681,6 +690,8 @@ aac_alloc(struct aac_softc *sc) void aacraid_free(struct aac_softc *sc) { + int i; + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); /* remove the control device */ @@ -704,11 +715,18 @@ aacraid_free(struct aac_softc *sc) bus_dma_tag_destroy(sc->aac_common_dmat); /* disconnect the interrupt handler */ - if (sc->aac_intr) - bus_teardown_intr(sc->aac_dev, sc->aac_irq, sc->aac_intr); - if (sc->aac_irq != NULL) - bus_release_resource(sc->aac_dev, SYS_RES_IRQ, sc->aac_irq_rid, - sc->aac_irq); + for (i = 0; i < AAC_MAX_MSIX; ++i) { + if (sc->aac_intr[i]) + bus_teardown_intr(sc->aac_dev, + sc->aac_irq[i], sc->aac_intr[i]); + if (sc->aac_irq[i]) + bus_release_resource(sc->aac_dev, SYS_RES_IRQ, + sc->aac_irq_rid[i], sc->aac_irq[i]); + else + break; + } + if (sc->msi_enabled) + pci_release_msi(sc->aac_dev); /* destroy data-transfer DMA tag */ if (sc->aac_buffer_dmat) @@ -815,14 +833,14 @@ aacraid_shutdown(device_t dev) bzero(cc, sizeof(struct aac_close_command)); cc->Command = VM_CloseAll; - cc->ContainerId = 0xffffffff; + cc->ContainerId = 0xfffffffe; if (aac_sync_fib(sc, ContainerCommand, 0, fib, sizeof(struct aac_close_command))) printf("FAILED.\n"); else printf("done\n"); - AAC_MASK_INTERRUPTS(sc); + AAC_ACCESS_DEVREG(sc, AAC_DISABLE_INTERRUPT); aac_release_sync_fib(sc); mtx_unlock(&sc->aac_io_lock); @@ -842,7 +860,7 @@ aacraid_suspend(device_t dev) fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); sc->aac_state |= AAC_STATE_SUSPEND; - AAC_MASK_INTERRUPTS(sc); + AAC_ACCESS_DEVREG(sc, AAC_DISABLE_INTERRUPT); return(0); } @@ -858,7 +876,7 @@ aacraid_resume(device_t dev) fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); sc->aac_state &= ~AAC_STATE_SUSPEND; - AAC_UNMASK_INTERRUPTS(sc); + AAC_ACCESS_DEVREG(sc, AAC_ENABLE_INTERRUPT); return(0); } @@ -868,23 +886,75 @@ aacraid_resume(device_t dev) void aacraid_new_intr_type1(void *arg) { + struct aac_msix_ctx *ctx; struct aac_softc *sc; + int vector_no; struct aac_command *cm; struct aac_fib *fib; u_int32_t bellbits, bellbits_shifted, index, handle; - int isFastResponse, isAif, noMoreAif; + int isFastResponse, isAif, noMoreAif, mode; - sc = (struct aac_softc *)arg; + ctx = (struct aac_msix_ctx *)arg; + sc = ctx->sc; + vector_no = ctx->vector_no; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); mtx_lock(&sc->aac_io_lock); - bellbits = AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_R); - if (bellbits & AAC_DB_RESPONSE_SENT_NS) { - bellbits = AAC_DB_RESPONSE_SENT_NS; - AAC_MEM0_SETREG4(sc, AAC_SRC_ODBR_C, bellbits); - AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_R); /* ODR readback,Prep #238630 */ + + if (sc->msi_enabled) { + mode = AAC_INT_MODE_MSI; + if (vector_no == 0) { + bellbits = AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_MSI); + if (bellbits & 0x40000) + mode |= AAC_INT_MODE_AIF; + else if (bellbits & 0x1000) + mode |= AAC_INT_MODE_SYNC; + } + } else { + mode = AAC_INT_MODE_INTX; + bellbits = AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_R); + if (bellbits & AAC_DB_RESPONSE_SENT_NS) { + bellbits = AAC_DB_RESPONSE_SENT_NS; + AAC_MEM0_SETREG4(sc, AAC_SRC_ODBR_C, bellbits); + } else { + bellbits_shifted = (bellbits >> AAC_SRC_ODR_SHIFT); + AAC_MEM0_SETREG4(sc, AAC_SRC_ODBR_C, bellbits); + if (bellbits_shifted & AAC_DB_AIF_PENDING) + mode |= AAC_INT_MODE_AIF; + else if (bellbits_shifted & AAC_DB_SYNC_COMMAND) + mode |= AAC_INT_MODE_SYNC; + } + /* ODR readback, Prep #238630 */ + AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_R); + } + + if (mode & AAC_INT_MODE_SYNC) { + if (sc->aac_sync_cm) { + cm = sc->aac_sync_cm; + cm->cm_flags |= AAC_CMD_COMPLETED; + /* is there a completion handler? */ + if (cm->cm_complete != NULL) { + cm->cm_complete(cm); + } else { + /* assume that someone is sleeping on this command */ + wakeup(cm); + } + sc->flags &= ~AAC_QUEUE_FRZN; + sc->aac_sync_cm = NULL; + } + mode = 0; + } + + if (mode & AAC_INT_MODE_AIF) { + if (mode & AAC_INT_MODE_INTX) { + aac_request_aif(sc); + mode = 0; + } + } + + if (mode) { /* handle async. status */ - index = sc->aac_host_rrq_idx; + index = sc->aac_host_rrq_idx[vector_no]; for (;;) { isFastResponse = isAif = noMoreAif = 0; /* remove toggle bit (31) */ @@ -901,6 +971,7 @@ aacraid_new_intr_type1(void *arg) cm = sc->aac_commands + (handle - 1); fib = cm->cm_fib; + sc->aac_rrq_outstanding[vector_no]--; if (isAif) { noMoreAif = (fib->Header.XferState & AAC_FIBSTATE_NOMOREAIF) ? 1:0; if (!noMoreAif) @@ -928,34 +999,19 @@ aacraid_new_intr_type1(void *arg) } sc->aac_common->ac_host_rrq[index++] = 0; - if (index == sc->aac_max_fibs) - index = 0; - sc->aac_host_rrq_idx = index; + if (index == (vector_no + 1) * sc->aac_vector_cap) + index = vector_no * sc->aac_vector_cap; + sc->aac_host_rrq_idx[vector_no] = index; if ((isAif && !noMoreAif) || sc->aif_pending) aac_request_aif(sc); } - } else { - bellbits_shifted = (bellbits >> AAC_SRC_ODR_SHIFT); - AAC_MEM0_SETREG4(sc, AAC_SRC_ODBR_C, bellbits); - if (bellbits_shifted & AAC_DB_AIF_PENDING) { - /* handle AIF */ - aac_request_aif(sc); - } else if (bellbits_shifted & AAC_DB_SYNC_COMMAND) { - if (sc->aac_sync_cm) { - cm = sc->aac_sync_cm; - cm->cm_flags |= AAC_CMD_COMPLETED; - /* is there a completion handler? */ - if (cm->cm_complete != NULL) { - cm->cm_complete(cm); - } else { - /* assume that someone is sleeping on this command */ - wakeup(cm); - } - sc->flags &= ~AAC_QUEUE_FRZN; - sc->aac_sync_cm = NULL; - } - } + } + + if (mode & AAC_INT_MODE_AIF) { + aac_request_aif(sc); + AAC_ACCESS_DEVREG(sc, AAC_CLEAR_AIF_BIT); + mode = 0; } /* see if we can start some more I/O */ @@ -1479,32 +1535,47 @@ static int aac_check_firmware(struct aac_softc *sc) { u_int32_t code, major, minor, maxsize; - u_int32_t options = 0, atu_size = 0, status; + u_int32_t options = 0, atu_size = 0, status, waitCount; time_t then; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + + /* check if flash update is running */ + if (AAC_GET_FWSTATUS(sc) & AAC_FLASH_UPD_PENDING) { + then = time_uptime; + do { + code = AAC_GET_FWSTATUS(sc); + if (time_uptime > (then + AAC_FWUPD_TIMEOUT)) { + device_printf(sc->aac_dev, + "FATAL: controller not coming ready, " + "status %x\n", code); + return(ENXIO); + } + } while (!(code & AAC_FLASH_UPD_SUCCESS) && !(code & AAC_FLASH_UPD_FAILED)); + /* + * Delay 10 seconds. Because right now FW is doing a soft reset, + * do not read scratch pad register at this time + */ + waitCount = 10 * 10000; + while (waitCount) { + DELAY(100); /* delay 100 microseconds */ + waitCount--; + } + } + /* * Wait for the adapter to come ready. */ then = time_uptime; do { code = AAC_GET_FWSTATUS(sc); - if (code & AAC_SELF_TEST_FAILED) { - device_printf(sc->aac_dev, "FATAL: selftest failed\n"); - return(ENXIO); - } - if (code & AAC_KERNEL_PANIC) { - device_printf(sc->aac_dev, - "FATAL: controller kernel panic"); - return(ENXIO); - } if (time_uptime > (then + AAC_BOOT_TIMEOUT)) { device_printf(sc->aac_dev, "FATAL: controller not coming ready, " "status %x\n", code); return(ENXIO); } - } while (!(code & AAC_UP_AND_RUNNING)); + } while (!(code & AAC_UP_AND_RUNNING) || code == 0xffffffff); /* * Retrieve the firmware version numbers. Dell PERC2/QC cards with @@ -1629,9 +1700,13 @@ aac_check_firmware(struct aac_softc *sc) options = AAC_GET_MAILBOX(sc, 2); sc->aac_sg_tablesize = (options >> 16); options = AAC_GET_MAILBOX(sc, 3); - sc->aac_max_fibs = (options & 0xFFFF); + sc->aac_max_fibs = ((options >> 16) & 0xFFFF); + if (sc->aac_max_fibs == 0 || sc->aac_hwif != AAC_HWIF_SRCV) + sc->aac_max_fibs = (options & 0xFFFF); options = AAC_GET_MAILBOX(sc, 4); sc->aac_max_aif = (options & 0xFFFF); + options = AAC_GET_MAILBOX(sc, 5); + sc->aac_max_msix =(sc->flags & AAC_FLAGS_NEW_COMM_TYPE2) ? options : 0; } maxsize = sc->aac_max_fib_size + 31; @@ -1653,7 +1728,9 @@ aac_check_firmware(struct aac_softc *sc) device_printf(sc->aac_dev, "Enable 64-bit array\n"); } +#ifdef AACRAID_DEBUG aacraid_get_fw_debug_buffer(sc); +#endif return (0); } @@ -1661,12 +1738,14 @@ static int aac_init(struct aac_softc *sc) { struct aac_adapter_init *ip; - int error; + int i, error; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); /* reset rrq index */ - sc->aac_host_rrq_idx = 0; + sc->aac_fibs_pushed_no = 0; + for (i = 0; i < sc->aac_max_msix; i++) + sc->aac_host_rrq_idx[i] = i * sc->aac_vector_cap; /* * Fill in the init structure. This tells the adapter about the @@ -1678,7 +1757,7 @@ aac_init(struct aac_softc *sc) ip->InitStructRevision = AAC_INIT_STRUCT_REVISION_4; sc->flags |= AAC_FLAGS_RAW_IO; } - ip->MiniPortRevision = AAC_INIT_STRUCT_MINIPORT_REVISION; + ip->NoOfMSIXVectors = sc->aac_max_msix; ip->AdapterFibsPhysicalAddress = sc->aac_common_busaddr + offsetof(struct aac_common, ac_fibs); @@ -1708,7 +1787,6 @@ aac_init(struct aac_softc *sc) ip->InitStructRevision = AAC_INIT_STRUCT_REVISION_6; ip->InitFlags |= (AAC_INITFLAGS_NEW_COMM_TYPE1_SUPPORTED | AAC_INITFLAGS_FAST_JBOD_SUPPORTED); - ip->MiniPortRevision = 0L; device_printf(sc->aac_dev, "New comm. interface type1 enabled\n"); } else if (sc->flags & AAC_FLAGS_NEW_COMM_TYPE2) { ip->InitStructRevision = AAC_INIT_STRUCT_REVISION_7; @@ -1750,31 +1828,209 @@ aac_init(struct aac_softc *sc) goto out; } + /* + * Check configuration issues + */ + if ((error = aac_check_config(sc)) != 0) + goto out; + error = 0; out: return(error); } +static void +aac_define_int_mode(struct aac_softc *sc) +{ + device_t dev; + int cap, msi_count, error = 0; + uint32_t val; + + dev = sc->aac_dev; + + /* max. vectors from AAC_MONKER_GETCOMMPREF */ + if (sc->aac_max_msix == 0) { + sc->aac_max_msix = 1; + sc->aac_vector_cap = sc->aac_max_fibs; + return; + } + + /* OS capability */ + msi_count = pci_msix_count(dev); + if (msi_count > AAC_MAX_MSIX) + msi_count = AAC_MAX_MSIX; + if (msi_count > sc->aac_max_msix) + msi_count = sc->aac_max_msix; + if (msi_count == 0 || (error = pci_alloc_msix(dev, &msi_count)) != 0) { + device_printf(dev, "alloc msix failed - msi_count=%d, err=%d; " + "will try MSI\n", msi_count, error); + pci_release_msi(dev); + } else { + sc->msi_enabled = TRUE; + device_printf(dev, "using MSI-X interrupts (%u vectors)\n", + msi_count); + } + + if (!sc->msi_enabled) { + msi_count = 1; + if ((error = pci_alloc_msi(dev, &msi_count)) != 0) { + device_printf(dev, "alloc msi failed - err=%d; " + "will use INTx\n", error); + pci_release_msi(dev); + } else { + sc->msi_enabled = TRUE; + device_printf(dev, "using MSI interrupts\n"); + } + } + + if (sc->msi_enabled) { + /* now read controller capability from PCI config. space */ + cap = aac_find_pci_capability(sc, PCIY_MSIX); + val = (cap != 0 ? pci_read_config(dev, cap + 2, 2) : 0); + if (!(val & AAC_PCI_MSI_ENABLE)) { + pci_release_msi(dev); + sc->msi_enabled = FALSE; + } + } + + if (!sc->msi_enabled) { + device_printf(dev, "using legacy interrupts\n"); + sc->aac_max_msix = 1; + } else { + AAC_ACCESS_DEVREG(sc, AAC_ENABLE_MSIX); + if (sc->aac_max_msix > msi_count) + sc->aac_max_msix = msi_count; + } + sc->aac_vector_cap = sc->aac_max_fibs / sc->aac_max_msix; + + fwprintf(sc, HBA_FLAGS_DBG_DEBUG_B, "msi_enabled %d vector_cap %d max_fibs %d max_msix %d", + sc->msi_enabled,sc->aac_vector_cap, sc->aac_max_fibs, sc->aac_max_msix); +} + static int -aac_setup_intr(struct aac_softc *sc) +aac_find_pci_capability(struct aac_softc *sc, int cap) { - sc->aac_irq_rid = 0; - if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ, - &sc->aac_irq_rid, - RF_SHAREABLE | - RF_ACTIVE)) == NULL) { - device_printf(sc->aac_dev, "can't allocate interrupt\n"); - return (EINVAL); + device_t dev; + uint32_t status; + uint8_t ptr; + + dev = sc->aac_dev; + + status = pci_read_config(dev, PCIR_STATUS, 2); + if (!(status & PCIM_STATUS_CAPPRESENT)) + return (0); + + status = pci_read_config(dev, PCIR_HDRTYPE, 1); + switch (status & PCIM_HDRTYPE) { + case 0: + case 1: + ptr = PCIR_CAP_PTR; + break; + case 2: + ptr = PCIR_CAP_PTR_2; + break; + default: + return (0); + break; } - if (aac_bus_setup_intr(sc->aac_dev, sc->aac_irq, - INTR_MPSAFE|INTR_TYPE_BIO, NULL, - aacraid_new_intr_type1, sc, &sc->aac_intr)) { - device_printf(sc->aac_dev, "can't set up interrupt\n"); - return (EINVAL); + ptr = pci_read_config(dev, ptr, 1); + + while (ptr != 0) { + int next, val; + next = pci_read_config(dev, ptr + PCICAP_NEXTPTR, 1); + val = pci_read_config(dev, ptr + PCICAP_ID, 1); + if (val == cap) + return (ptr); + ptr = next; + } + + return (0); +} + +static int +aac_setup_intr(struct aac_softc *sc) +{ + int i, msi_count, rid; + struct resource *res; + void *tag; + + msi_count = sc->aac_max_msix; + rid = (sc->msi_enabled ? 1:0); + + for (i = 0; i < msi_count; i++, rid++) { + if ((res = bus_alloc_resource_any(sc->aac_dev,SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE)) == NULL) { + device_printf(sc->aac_dev,"can't allocate interrupt\n"); + return (EINVAL); + } + sc->aac_irq_rid[i] = rid; + sc->aac_irq[i] = res; + if (aac_bus_setup_intr(sc->aac_dev, res, + INTR_MPSAFE | INTR_TYPE_BIO, NULL, + aacraid_new_intr_type1, &sc->aac_msix[i], &tag)) { + device_printf(sc->aac_dev, "can't set up interrupt\n"); + return (EINVAL); + } + sc->aac_msix[i].vector_no = i; + sc->aac_msix[i].sc = sc; + sc->aac_intr[i] = tag; } + return (0); } +static int +aac_check_config(struct aac_softc *sc) +{ + struct aac_fib *fib; + struct aac_cnt_config *ccfg; + struct aac_cf_status_hdr *cf_shdr; + int rval; + + mtx_lock(&sc->aac_io_lock); + aac_alloc_sync_fib(sc, &fib); + + ccfg = (struct aac_cnt_config *)&fib->data[0]; + bzero(ccfg, sizeof (*ccfg) - CT_PACKET_SIZE); + ccfg->Command = VM_ContainerConfig; + ccfg->CTCommand.command = CT_GET_CONFIG_STATUS; + ccfg->CTCommand.param[CNT_SIZE] = sizeof(struct aac_cf_status_hdr); + + rval = aac_sync_fib(sc, ContainerCommand, 0, fib, + sizeof (struct aac_cnt_config)); + cf_shdr = (struct aac_cf_status_hdr *)ccfg->CTCommand.data; + if (rval == 0 && ccfg->Command == ST_OK && + ccfg->CTCommand.param[0] == CT_OK) { + if (cf_shdr->action <= CFACT_PAUSE) { + bzero(ccfg, sizeof (*ccfg) - CT_PACKET_SIZE); + ccfg->Command = VM_ContainerConfig; + ccfg->CTCommand.command = CT_COMMIT_CONFIG; + + rval = aac_sync_fib(sc, ContainerCommand, 0, fib, + sizeof (struct aac_cnt_config)); + if (rval == 0 && ccfg->Command == ST_OK && + ccfg->CTCommand.param[0] == CT_OK) { + /* successful completion */ + rval = 0; + } else { + /* auto commit aborted due to error(s) */ + rval = -2; + } + } else { + /* auto commit aborted due to adapter indicating + config. issues too dangerous to auto commit */ + rval = -3; + } + } else { + /* error */ + rval = -1; + } + + aac_release_sync_fib(sc); + mtx_unlock(&sc->aac_io_lock); + return(rval); +} + /* * Send a synchronous command to the controller and wait for a result. * Indicate if the controller completed the command with an error status. @@ -1793,7 +2049,8 @@ aacraid_sync_command(struct aac_softc *s AAC_SET_MAILBOX(sc, command, arg0, arg1, arg2, arg3); /* ensure the sync command doorbell flag is cleared */ - AAC_CLEAR_ISTATUS(sc, AAC_DB_SYNC_COMMAND); + if (!sc->msi_enabled) + AAC_CLEAR_ISTATUS(sc, AAC_DB_SYNC_COMMAND); /* then set it to signal the adapter */ AAC_QNOTIFY(sc, AAC_DB_SYNC_COMMAND); @@ -1802,7 +2059,7 @@ aacraid_sync_command(struct aac_softc *s /* spin waiting for the command to complete */ then = time_uptime; do { - if (time_uptime > (then + AAC_IMMEDIATE_TIMEOUT)) { + if (time_uptime > (then + AAC_SYNC_TIMEOUT)) { fwprintf(sc, HBA_FLAGS_DBG_ERROR_B, "timed out"); return(EIO); } @@ -1849,14 +2106,13 @@ aac_sync_fib(struct aac_softc *sc, u_int fib->Header.SenderSize = sizeof(struct aac_fib); fib->Header.SenderFibAddress = 0; /* Not needed */ fib->Header.u.ReceiverFibAddress = sc->aac_common_busaddr + - offsetof(struct aac_common, - ac_sync_fib); + offsetof(struct aac_common, ac_sync_fib); /* * Give the FIB to the controller, wait for a response. */ if (aacraid_sync_command(sc, AAC_MONKER_SYNCFIB, - fib->Header.u.ReceiverFibAddress, 0, 0, 0, NULL, NULL)) { + fib->Header.u.ReceiverFibAddress, 0, 0, 0, NULL, NULL)) { fwprintf(sc, HBA_FLAGS_DBG_ERROR_B, "IO error"); return(EIO); } @@ -1873,7 +2129,7 @@ aac_timeout(struct aac_softc *sc) { struct aac_command *cm; time_t deadline; - int timedout, code; + int timedout; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); /* @@ -1883,9 +2139,7 @@ aac_timeout(struct aac_softc *sc) timedout = 0; deadline = time_uptime - AAC_CMD_TIMEOUT; TAILQ_FOREACH(cm, &sc->aac_busy, cm_link) { - if ((cm->cm_timestamp < deadline) - /* && !(cm->cm_flags & AAC_CMD_TIMEDOUT) */) { - cm->cm_flags |= AAC_CMD_TIMEDOUT; + if (cm->cm_timestamp < deadline) { device_printf(sc->aac_dev, "COMMAND %p TIMEOUT AFTER %d SECONDS\n", cm, (int)(time_uptime-cm->cm_timestamp)); @@ -1894,14 +2148,8 @@ aac_timeout(struct aac_softc *sc) } } - if (timedout) { - code = AAC_GET_FWSTATUS(sc); - if (code != AAC_UP_AND_RUNNING) { - device_printf(sc->aac_dev, "WARNING! Controller is no " - "longer running! code= 0x%x\n", code); - aac_reset_adapter(sc); - } - } + if (timedout) + aac_reset_adapter(sc); aacraid_print_queues(sc); } @@ -1937,9 +2185,20 @@ aac_src_qnotify(struct aac_softc *sc, in static int aac_src_get_istatus(struct aac_softc *sc) { + int val; + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_R) >> AAC_SRC_ODR_SHIFT); + if (sc->msi_enabled) { + val = AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_MSI); + if (val & AAC_MSI_SYNC_STATUS) + val = AAC_DB_SYNC_COMMAND; + else + val = 0; + } else { + val = AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_R) >> AAC_SRC_ODR_SHIFT; + } + return(val); } /* @@ -1950,7 +2209,12 @@ aac_src_clear_istatus(struct aac_softc * { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_MEM0_SETREG4(sc, AAC_SRC_ODBR_C, mask << AAC_SRC_ODR_SHIFT); + if (sc->msi_enabled) { + if (mask == AAC_DB_SYNC_COMMAND) + AAC_ACCESS_DEVREG(sc, AAC_CLEAR_SYNC_BIT); + } else { + AAC_MEM0_SETREG4(sc, AAC_SRC_ODBR_C, mask << AAC_SRC_ODR_SHIFT); + } } /* @@ -2005,14 +2269,77 @@ aac_srcv_get_mailbox(struct aac_softc *s * Set/clear interrupt masks */ static void -aac_src_set_interrupts(struct aac_softc *sc, int enable) +aac_src_access_devreg(struct aac_softc *sc, int mode) { - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis"); + u_int32_t val; - if (enable) { - AAC_MEM0_SETREG4(sc, AAC_SRC_OIMR, ~AAC_DB_INT_NEW_COMM_TYPE1); - } else { - AAC_MEM0_SETREG4(sc, AAC_SRC_OIMR, ~0); + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + + switch (mode) { + case AAC_ENABLE_INTERRUPT: + AAC_MEM0_SETREG4(sc, AAC_SRC_OIMR, + (sc->msi_enabled ? AAC_INT_ENABLE_TYPE1_MSIX : + AAC_INT_ENABLE_TYPE1_INTX)); + break; + + case AAC_DISABLE_INTERRUPT: + AAC_MEM0_SETREG4(sc, AAC_SRC_OIMR, AAC_INT_DISABLE_ALL); + break; + + case AAC_ENABLE_MSIX: + /* set bit 6 */ + val = AAC_MEM0_GETREG4(sc, AAC_SRC_IDBR); + val |= 0x40; + AAC_MEM0_SETREG4(sc, AAC_SRC_IDBR, val); + AAC_MEM0_GETREG4(sc, AAC_SRC_IDBR); + /* unmask int. */ + val = PMC_ALL_INTERRUPT_BITS; + AAC_MEM0_SETREG4(sc, AAC_SRC_IOAR, val); + val = AAC_MEM0_GETREG4(sc, AAC_SRC_OIMR); + AAC_MEM0_SETREG4(sc, AAC_SRC_OIMR, + val & (~(PMC_GLOBAL_INT_BIT2 | PMC_GLOBAL_INT_BIT0))); + break; + + case AAC_DISABLE_MSIX: + /* reset bit 6 */ + val = AAC_MEM0_GETREG4(sc, AAC_SRC_IDBR); + val &= ~0x40; + AAC_MEM0_SETREG4(sc, AAC_SRC_IDBR, val); + AAC_MEM0_GETREG4(sc, AAC_SRC_IDBR); + break; + + case AAC_CLEAR_AIF_BIT: + /* set bit 5 */ + val = AAC_MEM0_GETREG4(sc, AAC_SRC_IDBR); + val |= 0x20; + AAC_MEM0_SETREG4(sc, AAC_SRC_IDBR, val); + AAC_MEM0_GETREG4(sc, AAC_SRC_IDBR); + break; + + case AAC_CLEAR_SYNC_BIT: + /* set bit 4 */ + val = AAC_MEM0_GETREG4(sc, AAC_SRC_IDBR); + val |= 0x10; + AAC_MEM0_SETREG4(sc, AAC_SRC_IDBR, val); + AAC_MEM0_GETREG4(sc, AAC_SRC_IDBR); + break; + + case AAC_ENABLE_INTX: + /* set bit 7 */ + val = AAC_MEM0_GETREG4(sc, AAC_SRC_IDBR); + val |= 0x80; + AAC_MEM0_SETREG4(sc, AAC_SRC_IDBR, val); + AAC_MEM0_GETREG4(sc, AAC_SRC_IDBR); + /* unmask int. */ + val = PMC_ALL_INTERRUPT_BITS; + AAC_MEM0_SETREG4(sc, AAC_SRC_IOAR, val); + val = AAC_MEM0_GETREG4(sc, AAC_SRC_OIMR); + AAC_MEM0_SETREG4(sc, AAC_SRC_OIMR, + val & (~(PMC_GLOBAL_INT_BIT2))); + break; + + default: + break; } } @@ -2028,6 +2355,34 @@ aac_src_send_command(struct aac_softc *s fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "send command (new comm. type1)"); + if (sc->msi_enabled && cm->cm_fib->Header.Command != AifRequest && + sc->aac_max_msix > 1) { + u_int16_t vector_no, first_choice = 0xffff; + + vector_no = sc->aac_fibs_pushed_no % sc->aac_max_msix; + do { + vector_no += 1; + if (vector_no == sc->aac_max_msix) + vector_no = 1; + if (sc->aac_rrq_outstanding[vector_no] < + sc->aac_vector_cap) + break; + if (0xffff == first_choice) + first_choice = vector_no; + else if (vector_no == first_choice) + break; + } while (1); + if (vector_no == first_choice) + vector_no = 0; + sc->aac_rrq_outstanding[vector_no]++; + if (sc->aac_fibs_pushed_no == 0xffffffff) + sc->aac_fibs_pushed_no = 0; + else + sc->aac_fibs_pushed_no++; + + cm->cm_fib->Header.Handle += (vector_no << 16); + } + if (sc->flags & AAC_FLAGS_NEW_COMM_TYPE2) { /* Calculate the amount to the fibsize bits */ fibsize = (cm->cm_fib->Header.Size + 127) / 128 - 1; @@ -3364,9 +3719,11 @@ aac_reset_adapter(struct aac_softc *sc) struct aac_command *cm; struct aac_fib *fib; struct aac_pause_command *pc; - u_int32_t status, old_flags, reset_mask, waitCount; + u_int32_t status, reset_mask, waitCount, max_msix_orig; + int msi_enabled_orig; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + mtx_assert(&sc->aac_io_lock, MA_OWNED); if (sc->aac_state & AAC_STATE_RESET) { device_printf(sc->aac_dev, "aac_reset_adapter() already in progress\n"); @@ -3375,7 +3732,7 @@ aac_reset_adapter(struct aac_softc *sc) sc->aac_state |= AAC_STATE_RESET; /* disable interrupt */ - AAC_MASK_INTERRUPTS(sc); + AAC_ACCESS_DEVREG(sc, AAC_DISABLE_INTERRUPT); /* * Abort all pending commands: @@ -3458,35 +3815,39 @@ aac_reset_adapter(struct aac_softc *sc) } } else if (sc->aac_support_opt2 & AAC_SUPPORTED_DOORBELL_RESET) { AAC_MEM0_SETREG4(sc, AAC_SRC_IDBR, reset_mask); - /* We need to wait for 5 seconds before accessing the doorbell again - * 10000 * 100us = 1000,000us = 1000ms = 1s + /* + * We need to wait for 5 seconds before accessing the doorbell + * again, 10000 * 100us = 1000,000us = 1000ms = 1s */ waitCount = 5 * 10000; while (waitCount) { - DELAY(100); /* delay 100 microseconds */ + DELAY(100); /* delay 100 microseconds */ waitCount--; } } /* - * Re-read and renegotiate the FIB parameters, as one of the actions - * that can result from an IOP reset is the running of a new firmware - * image. - */ - old_flags = sc->flags; - /* * Initialize the adapter. */ + max_msix_orig = sc->aac_max_msix; + msi_enabled_orig = sc->msi_enabled; + sc->msi_enabled = FALSE; if (aac_check_firmware(sc) != 0) goto finish; if (!(sc->flags & AAC_FLAGS_SYNC_MODE)) { - if (aac_init(sc) != 0) - goto finish; + sc->aac_max_msix = max_msix_orig; + if (msi_enabled_orig) { + sc->msi_enabled = msi_enabled_orig; + AAC_ACCESS_DEVREG(sc, AAC_ENABLE_MSIX); + } + mtx_unlock(&sc->aac_io_lock); + aac_init(sc); + mtx_lock(&sc->aac_io_lock); } finish: sc->aac_state &= ~AAC_STATE_RESET; - AAC_UNMASK_INTERRUPTS(sc); + AAC_ACCESS_DEVREG(sc, AAC_ENABLE_INTERRUPT); aacraid_startio(sc); return (0); } Modified: stable/10/sys/dev/aacraid/aacraid_cam.c ============================================================================== --- stable/10/sys/dev/aacraid/aacraid_cam.c Tue Mar 11 14:48:44 2014 (r263023) +++ stable/10/sys/dev/aacraid/aacraid_cam.c Tue Mar 11 14:59:34 2014 (r263024) @@ -709,7 +709,7 @@ aac_container_special_command(struct cam "Container READ_CAPACITY id %d lun %d len %d", ccb->ccb_h.target_id, ccb->ccb_h.target_lun, ccb->csio.dxfer_len); - scsi_ulto4b(co->co_mntobj.ObjExtension.BlockSize, p->length); + scsi_ulto4b(co->co_mntobj.ObjExtension.BlockDevice.BlockSize, p->length); /* check if greater than 2TB */ if (co->co_mntobj.CapacityHigh) { if (sc->flags & AAC_FLAGS_LBA_64BIT) @@ -737,9 +737,20 @@ aac_container_special_command(struct cam xpt_done(ccb); return; } - scsi_ulto4b(co->co_mntobj.ObjExtension.BlockSize, p->length); + scsi_ulto4b(co->co_mntobj.ObjExtension.BlockDevice.BlockSize, p->length); scsi_ulto4b(co->co_mntobj.CapacityHigh, p->addr); scsi_ulto4b(co->co_mntobj.Capacity-1, &p->addr[4]); + + if (ccb->csio.dxfer_len >= 14) { + u_int32_t mapping = co->co_mntobj.ObjExtension.BlockDevice.bdLgclPhysMap; + p->prot_lbppbe = 0; + while (mapping > 1) { + mapping >>= 1; + p->prot_lbppbe++; + } + p->prot_lbppbe &= 0x0f; + } + ccb->ccb_h.status = CAM_REQ_CMP; break; } @@ -769,7 +780,7 @@ aac_container_special_command(struct cam p->hd.block_descr_len = sizeof(struct scsi_mode_block_descr); p->hd.datalen += p->hd.block_descr_len; - scsi_ulto3b(co->co_mntobj.ObjExtension.BlockSize, p->bd.block_len); + scsi_ulto3b(co->co_mntobj.ObjExtension.BlockDevice.BlockSize, p->bd.block_len); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 15:17:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5DDCF10F; Tue, 11 Mar 2014 15:17: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 49B871E2; Tue, 11 Mar 2014 15:17: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 s2BFH5eD041980; Tue, 11 Mar 2014 15:17:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BFH59k041979; Tue, 11 Mar 2014 15:17:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403111517.s2BFH59k041979@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 11 Mar 2014 15:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263025 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 15:17:05 -0000 Author: glebius Date: Tue Mar 11 15:17:04 2014 New Revision: 263025 URL: http://svnweb.freebsd.org/changeset/base/263025 Log: Merge r261169: Fix compilation with IGB_LEGACY_TX defined. PR: 185909 Modified: stable/10/sys/dev/e1000/if_igb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Tue Mar 11 14:59:34 2014 (r263024) +++ stable/10/sys/dev/e1000/if_igb.c Tue Mar 11 15:17:04 2014 (r263025) @@ -2380,7 +2380,9 @@ igb_allocate_legacy(struct adapter *adap { device_t dev = adapter->dev; struct igb_queue *que = adapter->queues; +#ifndef IGB_LEGACY_TX struct tx_ring *txr = adapter->tx_rings; +#endif int error, rid = 0; /* Turn off all interrupts */ From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 15:19:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5B5D033E; Tue, 11 Mar 2014 15:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E06B1F9; Tue, 11 Mar 2014 15:19: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 s2BFJCuw042252; Tue, 11 Mar 2014 15:19:12 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BFJCS1042251; Tue, 11 Mar 2014 15:19:12 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403111519.s2BFJCS1042251@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 11 Mar 2014 15:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263026 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 15:19:12 -0000 Author: glebius Date: Tue Mar 11 15:19:11 2014 New Revision: 263026 URL: http://svnweb.freebsd.org/changeset/base/263026 Log: Merge r261028: fix resource leak and simplify code for DIOCCHANGEADDR. Modified: stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Tue Mar 11 15:17:04 2014 (r263025) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Tue Mar 11 15:19:11 2014 (r263026) @@ -2277,6 +2277,7 @@ DIOCGETSTATES_full: bcopy(&pca->addr, newpa, sizeof(struct pf_pooladdr)); if (newpa->ifname[0]) kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); + newpa->kif = NULL; } #define ERROUT(x) { error = (x); goto DIOCCHANGEADDR_error; } @@ -2294,8 +2295,8 @@ DIOCGETSTATES_full: if (newpa->ifname[0]) { newpa->kif = pfi_kif_attach(kif, newpa->ifname); pfi_kif_ref(newpa->kif); - } else - newpa->kif = NULL; + kif = NULL; + } switch (newpa->addr.type) { case PF_ADDR_DYNIFTL: @@ -2309,32 +2310,24 @@ DIOCGETSTATES_full: error = ENOMEM; break; } - if (error) { - if (newpa->kif) - pfi_kif_unref(newpa->kif); - PF_RULES_WUNLOCK(); - free(newpa, M_PFRULE); - break; - } + if (error) + goto DIOCCHANGEADDR_error; } - if (pca->action == PF_CHANGE_ADD_HEAD) + switch (pca->action) { + case PF_CHANGE_ADD_HEAD: oldpa = TAILQ_FIRST(&pool->list); - else if (pca->action == PF_CHANGE_ADD_TAIL) + break; + case PF_CHANGE_ADD_TAIL: oldpa = TAILQ_LAST(&pool->list, pf_palist); - else { - int i = 0; - + break; + default: oldpa = TAILQ_FIRST(&pool->list); - while ((oldpa != NULL) && (i < pca->nr)) { + for (int i = 0; oldpa && i < pca->nr; i++) oldpa = TAILQ_NEXT(oldpa, entries); - i++; - } - if (oldpa == NULL) { - PF_RULES_WUNLOCK(); - error = EINVAL; - break; - } + + if (oldpa == NULL) + ERROUT(EINVAL); } if (pca->action == PF_CHANGE_REMOVE) { @@ -2362,13 +2355,14 @@ DIOCGETSTATES_full: } pool->cur = TAILQ_FIRST(&pool->list); - PF_ACPY(&pool->counter, &pool->cur->addr.v.a.addr, - pca->af); + PF_ACPY(&pool->counter, &pool->cur->addr.v.a.addr, pca->af); PF_RULES_WUNLOCK(); break; #undef ERROUT DIOCCHANGEADDR_error: + if (newpa->kif) + pfi_kif_unref(newpa->kif); PF_RULES_WUNLOCK(); if (newpa != NULL) free(newpa, M_PFRULE); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 15:20:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9AF005F7; Tue, 11 Mar 2014 15:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84DF42B0; Tue, 11 Mar 2014 15:20: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 s2BFKlqP042510; Tue, 11 Mar 2014 15:20:47 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BFKled042509; Tue, 11 Mar 2014 15:20:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403111520.s2BFKled042509@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 11 Mar 2014 15:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263027 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 15:20:47 -0000 Author: glebius Date: Tue Mar 11 15:20:47 2014 New Revision: 263027 URL: http://svnweb.freebsd.org/changeset/base/263027 Log: Merge r261029: remove NULL pointer dereference. Modified: stable/10/sys/netpfil/pf/pf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf.c ============================================================================== --- stable/10/sys/netpfil/pf/pf.c Tue Mar 11 15:19:11 2014 (r263026) +++ stable/10/sys/netpfil/pf/pf.c Tue Mar 11 15:20:47 2014 (r263027) @@ -5265,7 +5265,6 @@ pf_route(struct mbuf **m, struct pf_rule PF_STATE_UNLOCK(s); rt = rtalloc1_fib(sintosa(&dst), 0, 0, M_GETFIB(m0)); if (rt == NULL) { - RTFREE_LOCKED(rt); KMOD_IPSTAT_INC(ips_noroute); error = EHOSTUNREACH; goto bad; From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 15:28:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4EC178BD; Tue, 11 Mar 2014 15:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A62B365; Tue, 11 Mar 2014 15:28: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 s2BFSgsZ046275; Tue, 11 Mar 2014 15:28:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BFSfDE046272; Tue, 11 Mar 2014 15:28:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201403111528.s2BFSfDE046272@svn.freebsd.org> From: John Baldwin Date: Tue, 11 Mar 2014 15:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263028 - in stable: 10/usr.sbin/services_mkdb 9/usr.sbin/services_mkdb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 15:28:42 -0000 Author: jhb Date: Tue Mar 11 15:28:41 2014 New Revision: 263028 URL: http://svnweb.freebsd.org/changeset/base/263028 Log: MFC 261030: Similar to cap_mkdb(1), add endianness support to services_mkdb(1) to support cross-builds once this is invoked during releases. Modified: stable/10/usr.sbin/services_mkdb/extern.h stable/10/usr.sbin/services_mkdb/services_mkdb.8 stable/10/usr.sbin/services_mkdb/services_mkdb.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/usr.sbin/services_mkdb/services_mkdb.8 stable/9/usr.sbin/services_mkdb/services_mkdb.c Directory Properties: stable/9/usr.sbin/services_mkdb/ (props changed) Modified: stable/10/usr.sbin/services_mkdb/extern.h ============================================================================== --- stable/10/usr.sbin/services_mkdb/extern.h Tue Mar 11 15:20:47 2014 (r263027) +++ stable/10/usr.sbin/services_mkdb/extern.h Tue Mar 11 15:28:41 2014 (r263028) @@ -29,6 +29,6 @@ * $FreeBSD$ */ -extern const HASHINFO hinfo; +extern HASHINFO hinfo; void uniq(const char *); Modified: stable/10/usr.sbin/services_mkdb/services_mkdb.8 ============================================================================== --- stable/10/usr.sbin/services_mkdb/services_mkdb.8 Tue Mar 11 15:20:47 2014 (r263027) +++ stable/10/usr.sbin/services_mkdb/services_mkdb.8 Tue Mar 11 15:28:41 2014 (r263028) @@ -37,6 +37,7 @@ .Nd generate the services database .Sh SYNOPSIS .Nm +.Op Fl b | l .Op Fl q .Op Fl o Ar database .Op Ar file @@ -61,6 +62,10 @@ The file must be in the correct format ( .Pp The options are as follows: .Bl -tag -width indent +.It Fl b +Use big-endian byte order for database metadata. +.It Fl l +Use little-endian byte order for database metadata. .It Fl o Ar database Put the output databases in the named file. .It Fl q @@ -70,6 +75,13 @@ Print the services file to stdout, omitt .El .Pp The databases are used by the C library services routines (see +.Pp +The +.Fl b +and +.Fl l +flags are mutually exclusive. +The default byte ordering is the current host order. .Xr getservent 3 ) . .Sh FILES .Bl -tag -width ".Pa /var/db/services.db.tmp" -compact Modified: stable/10/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- stable/10/usr.sbin/services_mkdb/services_mkdb.c Tue Mar 11 15:20:47 2014 (r263027) +++ stable/10/usr.sbin/services_mkdb/services_mkdb.c Tue Mar 11 15:28:41 2014 (r263028) @@ -67,7 +67,7 @@ static const char *getprotostr(StringLis static const char *mkaliases(StringList *, char *, size_t); static void usage(void); -const HASHINFO hinfo = { +HASHINFO hinfo = { .bsize = 256, .ffactor = 4, .nelem = 32768, @@ -87,14 +87,21 @@ main(int argc, char *argv[]) int warndup = 1; int unique = 0; int otherflag = 0; + int byteorder = 0; size_t cnt = 0; StringList *sl, ***svc; size_t port, proto; setprogname(argv[0]); - while ((ch = getopt(argc, argv, "qo:u")) != -1) + while ((ch = getopt(argc, argv, "blo:qu")) != -1) switch (ch) { + case 'b': + case 'l': + if (byteorder != 0) + usage(); + byteorder = ch == 'b' ? 4321 : 1234; + break; case 'q': otherflag = 1; warndup = 0; @@ -119,6 +126,9 @@ main(int argc, char *argv[]) if (argc == 1) fname = argv[0]; + /* Set byte order. */ + hinfo.lorder = byteorder; + if (unique) uniq(fname); @@ -423,7 +433,8 @@ out: static void usage(void) { - (void)fprintf(stderr, "Usage:\t%s [-q] [-o ] []\n" + (void)fprintf(stderr, + "Usage:\t%s [-b | -l] [-q] [-o ] []\n" "\t%s -u []\n", getprogname(), getprogname()); exit(1); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 15:43:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AEC9EE02; Tue, 11 Mar 2014 15:43:07 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8EB71753; Tue, 11 Mar 2014 15:43:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BFh7Rq053678; Tue, 11 Mar 2014 15:43:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BFh6LW053673; Tue, 11 Mar 2014 15:43:06 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403111543.s2BFh6LW053673@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 11 Mar 2014 15:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263029 - in stable/10: sbin/pfctl sys/net sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 15:43:07 -0000 Author: glebius Date: Tue Mar 11 15:43:06 2014 New Revision: 263029 URL: http://svnweb.freebsd.org/changeset/base/263029 Log: Merge r261882, r261898, r261937, r262760, r262799: Once pf became not covered by a single mutex, many counters in it became race prone. Some just gather statistics, but some are later used in different calculations. A real problem was the race provoked underflow of the states_cur counter on a rule. Once it goes below zero, it wraps to UINT32_MAX. Later this value is used in pf_state_expires() and any state created by this rule is immediately expired. Thus, make fields states_cur, states_tot and src_nodes of struct pf_rule be counter(9)s. Modified: stable/10/sbin/pfctl/pfctl.c stable/10/sys/net/pfvar.h stable/10/sys/netpfil/pf/if_pfsync.c stable/10/sys/netpfil/pf/pf.c stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/pfctl/pfctl.c ============================================================================== --- stable/10/sbin/pfctl/pfctl.c Tue Mar 11 15:28:41 2014 (r263028) +++ stable/10/sbin/pfctl/pfctl.c Tue Mar 11 15:43:06 2014 (r263029) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -796,17 +797,17 @@ pfctl_print_rule_counters(struct pf_rule } if (opts & PF_OPT_VERBOSE) { printf(" [ Evaluations: %-8llu Packets: %-8llu " - "Bytes: %-10llu States: %-6u]\n", + "Bytes: %-10llu States: %-6ju]\n", (unsigned long long)rule->evaluations, (unsigned long long)(rule->packets[0] + rule->packets[1]), (unsigned long long)(rule->bytes[0] + - rule->bytes[1]), rule->states_cur); + rule->bytes[1]), (uintmax_t)rule->u_states_cur); if (!(opts & PF_OPT_DEBUG)) printf(" [ Inserted: uid %u pid %u " - "State Creations: %-6u]\n", + "State Creations: %-6ju]\n", (unsigned)rule->cuid, (unsigned)rule->cpid, - rule->states_tot); + (uintmax_t)rule->u_states_tot); } } @@ -908,7 +909,7 @@ pfctl_show_rules(int dev, char *path, in case PFCTL_SHOW_LABELS: if (pr.rule.label[0]) { printf("%s %llu %llu %llu %llu" - " %llu %llu %llu %llu\n", + " %llu %llu %llu %ju\n", pr.rule.label, (unsigned long long)pr.rule.evaluations, (unsigned long long)(pr.rule.packets[0] + @@ -919,7 +920,7 @@ pfctl_show_rules(int dev, char *path, in (unsigned long long)pr.rule.bytes[0], (unsigned long long)pr.rule.packets[1], (unsigned long long)pr.rule.bytes[1], - (unsigned long long)pr.rule.states_tot); + (uintmax_t)pr.rule.u_states_tot); } break; case PFCTL_SHOW_RULES: Modified: stable/10/sys/net/pfvar.h ============================================================================== --- stable/10/sys/net/pfvar.h Tue Mar 11 15:28:41 2014 (r263028) +++ stable/10/sys/net/pfvar.h Tue Mar 11 15:43:06 2014 (r263029) @@ -35,6 +35,7 @@ #include #include +#include #include #include @@ -588,13 +589,9 @@ struct pf_rule { int rtableid; u_int32_t timeout[PFTM_MAX]; - u_int32_t states_cur; - u_int32_t states_tot; u_int32_t max_states; - u_int32_t src_nodes; u_int32_t max_src_nodes; u_int32_t max_src_states; - u_int32_t spare1; /* netgraph */ u_int32_t max_src_conn; struct { u_int32_t limit; @@ -608,6 +605,10 @@ struct pf_rule { uid_t cuid; pid_t cpid; + counter_u64_t states_cur; + counter_u64_t states_tot; + counter_u64_t src_nodes; + u_int16_t return_icmp; u_int16_t return_icmp6; u_int16_t max_mss; @@ -655,6 +656,10 @@ struct pf_rule { struct pf_addr addr; u_int16_t port; } divert; + + uint64_t u_states_cur; + uint64_t u_states_tot; + uint64_t u_src_nodes; }; /* rule flags */ Modified: stable/10/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/10/sys/netpfil/pf/if_pfsync.c Tue Mar 11 15:28:41 2014 (r263028) +++ stable/10/sys/netpfil/pf/if_pfsync.c Tue Mar 11 15:43:06 2014 (r263029) @@ -436,7 +436,8 @@ pfsync_state_import(struct pfsync_state else r = &V_pf_default_rule; - if ((r->max_states && r->states_cur >= r->max_states)) + if ((r->max_states && + counter_u64_fetch(r->states_cur) >= r->max_states)) goto cleanup; /* @@ -514,18 +515,15 @@ pfsync_state_import(struct pfsync_state st->pfsync_time = time_uptime; st->sync_state = PFSYNC_S_NONE; - /* XXX when we have nat_rule/anchors, use STATE_INC_COUNTERS */ - r->states_cur++; - r->states_tot++; - if (!(flags & PFSYNC_SI_IOCTL)) st->state_flags |= PFSTATE_NOSYNC; - if ((error = pf_state_insert(kif, skw, sks, st)) != 0) { - /* XXX when we have nat_rule/anchors, use STATE_DEC_COUNTERS */ - r->states_cur--; + if ((error = pf_state_insert(kif, skw, sks, st)) != 0) goto cleanup_state; - } + + /* XXX when we have nat_rule/anchors, use STATE_INC_COUNTERS */ + counter_u64_add(r->states_cur, 1); + counter_u64_add(r->states_tot, 1); if (!(flags & PFSYNC_SI_IOCTL)) { st->state_flags &= ~PFSTATE_NOSYNC; Modified: stable/10/sys/netpfil/pf/pf.c ============================================================================== --- stable/10/sys/netpfil/pf/pf.c Tue Mar 11 15:28:41 2014 (r263028) +++ stable/10/sys/netpfil/pf/pf.c Tue Mar 11 15:43:06 2014 (r263029) @@ -327,27 +327,27 @@ VNET_DEFINE(struct pf_limit, pf_limits[P #define BOUND_IFACE(r, k) \ ((r)->rule_flag & PFRULE_IFBOUND) ? (k) : V_pfi_all -#define STATE_INC_COUNTERS(s) \ - do { \ - s->rule.ptr->states_cur++; \ - s->rule.ptr->states_tot++; \ - if (s->anchor.ptr != NULL) { \ - s->anchor.ptr->states_cur++; \ - s->anchor.ptr->states_tot++; \ - } \ - if (s->nat_rule.ptr != NULL) { \ - s->nat_rule.ptr->states_cur++; \ - s->nat_rule.ptr->states_tot++; \ - } \ +#define STATE_INC_COUNTERS(s) \ + do { \ + counter_u64_add(s->rule.ptr->states_cur, 1); \ + counter_u64_add(s->rule.ptr->states_tot, 1); \ + if (s->anchor.ptr != NULL) { \ + counter_u64_add(s->anchor.ptr->states_cur, 1); \ + counter_u64_add(s->anchor.ptr->states_tot, 1); \ + } \ + if (s->nat_rule.ptr != NULL) { \ + counter_u64_add(s->nat_rule.ptr->states_cur, 1);\ + counter_u64_add(s->nat_rule.ptr->states_tot, 1);\ + } \ } while (0) -#define STATE_DEC_COUNTERS(s) \ - do { \ - if (s->nat_rule.ptr != NULL) \ - s->nat_rule.ptr->states_cur--; \ - if (s->anchor.ptr != NULL) \ - s->anchor.ptr->states_cur--; \ - s->rule.ptr->states_cur--; \ +#define STATE_DEC_COUNTERS(s) \ + do { \ + if (s->nat_rule.ptr != NULL) \ + counter_u64_add(s->nat_rule.ptr->states_cur, -1);\ + if (s->anchor.ptr != NULL) \ + counter_u64_add(s->anchor.ptr->states_cur, -1); \ + counter_u64_add(s->rule.ptr->states_cur, -1); \ } while (0) static MALLOC_DEFINE(M_PFHASH, "pf_hash", "pf(4) hash header structures"); @@ -639,7 +639,7 @@ pf_insert_src_node(struct pf_src_node ** PF_HASHROW_ASSERT(sh); if (!rule->max_src_nodes || - rule->src_nodes < rule->max_src_nodes) + counter_u64_fetch(rule->src_nodes) < rule->max_src_nodes) (*sn) = uma_zalloc(V_pf_sources_z, M_NOWAIT | M_ZERO); else V_pf_status.lcounters[LCNT_SRCNODES]++; @@ -659,7 +659,7 @@ pf_insert_src_node(struct pf_src_node ** (*sn)->creation = time_uptime; (*sn)->ruletype = rule->action; if ((*sn)->rule.ptr != NULL) - (*sn)->rule.ptr->src_nodes++; + counter_u64_add((*sn)->rule.ptr->src_nodes, 1); PF_HASHROW_UNLOCK(sh); V_pf_status.scounters[SCNT_SRC_NODE_INSERT]++; V_pf_status.src_nodes++; @@ -684,7 +684,7 @@ pf_unlink_src_node_locked(struct pf_src_ #endif LIST_REMOVE(src, entry); if (src->rule.ptr) - src->rule.ptr->src_nodes--; + counter_u64_add(src->rule.ptr->src_nodes, -1); V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++; V_pf_status.src_nodes--; } @@ -1470,7 +1470,7 @@ pf_state_expires(const struct pf_state * start = state->rule.ptr->timeout[PFTM_ADAPTIVE_START]; if (start) { end = state->rule.ptr->timeout[PFTM_ADAPTIVE_END]; - states = state->rule.ptr->states_cur; /* XXXGL */ + states = counter_u64_fetch(state->rule.ptr->states_cur); } else { start = V_pf_default_rule.timeout[PFTM_ADAPTIVE_START]; end = V_pf_default_rule.timeout[PFTM_ADAPTIVE_END]; @@ -1579,11 +1579,7 @@ pf_unlink_state(struct pf_state *s, u_in if (pfsync_delete_state_ptr != NULL) pfsync_delete_state_ptr(s); - --s->rule.ptr->states_cur; - if (s->nat_rule.ptr != NULL) - --s->nat_rule.ptr->states_cur; - if (s->anchor.ptr != NULL) - --s->anchor.ptr->states_cur; + STATE_DEC_COUNTERS(s); s->timeout = PFTM_UNLINKED; @@ -3444,7 +3440,8 @@ pf_create_state(struct pf_rule *r, struc u_short reason; /* check maximums */ - if (r->max_states && (r->states_cur >= r->max_states)) { + if (r->max_states && + (counter_u64_fetch(r->states_cur) >= r->max_states)) { V_pf_status.lcounters[LCNT_STATES]++; REASON_SET(&reason, PFRES_MAXSTATES); return (PF_DROP); Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Tue Mar 11 15:28:41 2014 (r263028) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Tue Mar 11 15:43:06 2014 (r263029) @@ -225,6 +225,10 @@ pfattach(void) V_pf_default_rule.nr = -1; V_pf_default_rule.rtableid = -1; + V_pf_default_rule.states_cur = counter_u64_alloc(M_WAITOK); + V_pf_default_rule.states_tot = counter_u64_alloc(M_WAITOK); + V_pf_default_rule.src_nodes = counter_u64_alloc(M_WAITOK); + /* initialize default timeouts */ my_timeout[PFTM_TCP_FIRST_PACKET] = PFTM_TCP_FIRST_PACKET_VAL; my_timeout[PFTM_TCP_OPENING] = PFTM_TCP_OPENING_VAL; @@ -394,6 +398,9 @@ pf_free_rule(struct pf_rule *rule) pfi_kif_unref(rule->kif); pf_anchor_remove(rule); pf_empty_pool(&rule->rpool.list); + counter_u64_free(rule->states_cur); + counter_u64_free(rule->states_tot); + counter_u64_free(rule->src_nodes); free(rule, M_PFRULE); } @@ -1145,6 +1152,9 @@ pfioctl(struct cdev *dev, u_long cmd, ca bcopy(&pr->rule, rule, sizeof(struct pf_rule)); if (rule->ifname[0]) kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); + rule->states_cur = counter_u64_alloc(M_WAITOK); + rule->states_tot = counter_u64_alloc(M_WAITOK); + rule->src_nodes = counter_u64_alloc(M_WAITOK); rule->cuid = td->td_ucred->cr_ruid; rule->cpid = td->td_proc ? td->td_proc->p_pid : 0; TAILQ_INIT(&rule->rpool.list); @@ -1261,6 +1271,9 @@ pfioctl(struct cdev *dev, u_long cmd, ca #undef ERROUT DIOCADDRULE_error: PF_RULES_WUNLOCK(); + counter_u64_free(rule->states_cur); + counter_u64_free(rule->states_tot); + counter_u64_free(rule->src_nodes); free(rule, M_PFRULE); if (kif) free(kif, PFI_MTYPE); @@ -1332,6 +1345,9 @@ DIOCADDRULE_error: break; } bcopy(rule, &pr->rule, sizeof(struct pf_rule)); + pr->rule.u_states_cur = counter_u64_fetch(rule->states_cur); + pr->rule.u_states_tot = counter_u64_fetch(rule->states_tot); + pr->rule.u_src_nodes = counter_u64_fetch(rule->src_nodes); if (pf_anchor_copyout(ruleset, rule, pr)) { PF_RULES_WUNLOCK(); error = EBUSY; @@ -1350,7 +1366,7 @@ DIOCADDRULE_error: rule->evaluations = 0; rule->packets[0] = rule->packets[1] = 0; rule->bytes[0] = rule->bytes[1] = 0; - rule->states_tot = 0; + counter_u64_zero(rule->states_tot); } PF_RULES_WUNLOCK(); break; @@ -1390,15 +1406,14 @@ DIOCADDRULE_error: #endif /* INET6 */ newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK); bcopy(&pcr->rule, newrule, sizeof(struct pf_rule)); + if (newrule->ifname[0]) + kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); + newrule->states_cur = counter_u64_alloc(M_WAITOK); + newrule->states_tot = counter_u64_alloc(M_WAITOK); + newrule->src_nodes = counter_u64_alloc(M_WAITOK); newrule->cuid = td->td_ucred->cr_ruid; newrule->cpid = td->td_proc ? td->td_proc->p_pid : 0; TAILQ_INIT(&newrule->rpool.list); - /* Initialize refcounting. */ - newrule->states_cur = 0; - newrule->entries.tqe_prev = NULL; - - if (newrule->ifname[0]) - kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); } #define ERROUT(x) { error = (x); goto DIOCCHANGERULE_error; } @@ -1566,8 +1581,12 @@ DIOCADDRULE_error: #undef ERROUT DIOCCHANGERULE_error: PF_RULES_WUNLOCK(); - if (newrule != NULL) + if (newrule != NULL) { + counter_u64_free(newrule->states_cur); + counter_u64_free(newrule->states_tot); + counter_u64_free(newrule->src_nodes); free(newrule, M_PFRULE); + } if (kif != NULL) free(kif, PFI_MTYPE); break; @@ -3423,6 +3442,11 @@ shutdown_pf(void) char nn = '\0'; V_pf_status.running = 0; + + counter_u64_free(V_pf_default_rule.states_cur); + counter_u64_free(V_pf_default_rule.states_tot); + counter_u64_free(V_pf_default_rule.src_nodes); + do { if ((error = pf_begin_rules(&t[0], PF_RULESET_SCRUB, &nn)) != 0) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 11 20:47:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0D2D0637; Tue, 11 Mar 2014 20:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EC01DE9F; Tue, 11 Mar 2014 20:47: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 s2BKl2bu079997; Tue, 11 Mar 2014 20:47:02 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BKl1MU079990; Tue, 11 Mar 2014 20:47:01 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201403112047.s2BKl1MU079990@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 11 Mar 2014 20:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263046 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 20:47:03 -0000 Author: edwin Date: Tue Mar 11 20:47:01 2014 New Revision: 263046 URL: http://svnweb.freebsd.org/changeset/base/263046 Log: MFC of 263041, tzdata2014a: - Fix historical info about asia/Zion, Ukraine - Fiji starts DST at 02:00 instead of 03:00 - Turkey will move to DST at 31 March this year. Modified: stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/australasia stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/northamerica stable/10/contrib/tzdata/southamerica Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Tue Mar 11 20:37:39 2014 (r263045) +++ stable/10/contrib/tzdata/asia Tue Mar 11 20:47:01 2014 (r263046) @@ -1090,8 +1090,13 @@ Rule Zion 1986 only - May 18 0:00 1:00 D Rule Zion 1986 only - Sep 7 0:00 0 S Rule Zion 1987 only - Apr 15 0:00 1:00 D Rule Zion 1987 only - Sep 13 0:00 0 S -Rule Zion 1988 only - Apr 9 0:00 1:00 D -Rule Zion 1988 only - Sep 3 0:00 0 S + +# From Avigdor Finkelstein (2014-03-05): +# I check the Parliament (Knesset) records and there it's stated that the +# [1988] transition should take place on Saturday night, when the Sabbath +# ends and changes to Sunday. +Rule Zion 1988 only - Apr 10 0:00 1:00 D +Rule Zion 1988 only - Sep 4 0:00 0 S # From Ephraim Silverberg # (1997-03-04, 1998-03-16, 1998-12-28, 2000-01-17, 2000-07-25, 2004-12-22, Modified: stable/10/contrib/tzdata/australasia ============================================================================== --- stable/10/contrib/tzdata/australasia Tue Mar 11 20:37:39 2014 (r263045) +++ stable/10/contrib/tzdata/australasia Tue Mar 11 20:47:01 2014 (r263046) @@ -354,16 +354,18 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=6702&catid=71&Itemid=155 # From the Fijian Government Media Center (2013-08-30) via David Wheeler: -# Fiji will start daylight savings on Sunday 27th October, 2013 and end at 3am -# on Sunday 19th January, 2014.... move clocks forward by one hour from 2am +# Fiji will start daylight savings on Sunday 27th October, 2013 ... +# move clocks forward by one hour from 2am # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-27th-OCTOBER-201.aspx -# -# From Paul Eggert (2013-09-09): + +# From Steffen Thorsen (2013-01-10): +# Fiji will end DST on 2014-01-19 02:00: +# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVINGS-TO-END-THIS-MONTH-%281%29.aspx + +# From Paul Eggert (2014-01-10): # For now, guess that Fiji springs forward the Sunday before the fourth -# Monday in October. This matches both recent practice and -# timeanddate.com's current spring-forward prediction. -# For the January 2014 transition we guessed right while timeanddate.com -# guessed wrong, so leave the fall-back prediction alone. +# Monday in October, and springs back the penultimate Sunday in January. +# This is ad hoc, but matches recent practice. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S @@ -372,7 +374,8 @@ Rule Fiji 2009 only - Nov 29 2:00 1:00 S Rule Fiji 2010 only - Mar lastSun 3:00 0 - Rule Fiji 2010 max - Oct Sun>=21 2:00 1:00 S Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - -Rule Fiji 2012 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - +Rule Fiji 2014 max - Jan Sun>=18 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time Modified: stable/10/contrib/tzdata/europe ============================================================================== --- stable/10/contrib/tzdata/europe Tue Mar 11 20:37:39 2014 (r263045) +++ stable/10/contrib/tzdata/europe Tue Mar 11 20:47:01 2014 (r263046) @@ -2745,14 +2745,18 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # According to the articles linked below, Turkey will change into summer # time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27. # This change is due to a nationwide exam on 27th. -# -# # http://www.worldbulletin.net/?aType=haber&ArticleID=70872 -# # Turkish: -# # http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373 -# + +# From Faruk Pasin (2014-02-14): +# The DST for Turkey has been changed for this year because of the +# Turkish Local election.... +# http://www.sabah.com.tr/Ekonomi/2014/02/12/yaz-saatinde-onemli-degisiklik +# ... so Turkey will move clocks forward one hour on March 31 at 3:00 a.m. +# From Paul Eggert (2014-02-17): +# Here is an English-language source: +# http://www.worldbulletin.net/turkey/129016/turkey-switches-to-daylight-saving-time-march-31 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S @@ -2821,6 +2825,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 Turkey EE%sT 2007 2:00 EU EE%sT 2011 Mar 27 1:00u 2:00 - EET 2011 Mar 28 1:00u + 2:00 EU EE%sT 2014 Mar 30 1:00u + 2:00 - EET 2014 Mar 31 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. @@ -2842,19 +2848,13 @@ Link Europe/Istanbul Asia/Istanbul # Ist # approval from 266 deputies. # # Ukraine abolishes transter back to the winter time (in Russian) -# # http://news.mail.ru/politics/6861560/ -# # # The Ukrainians will no longer change the clock (in Russian) -# # http://www.segodnya.ua/news/14290482.html -# # # Deputies cancelled the winter time (in Russian) -# # http://www.pravda.com.ua/rus/news/2011/09/20/6600616/ -# # # From Philip Pizzey (2011-10-18): # Today my Ukrainian colleagues have informed me that the @@ -2865,18 +2865,39 @@ Link Europe/Istanbul Asia/Istanbul # Ist # As far as I understand, the recent change to the Ukrainian time zone # (Europe/Kiev) to introduce permanent daylight saving time (similar # to Russia) was reverted today: -# -# # http://portal.rada.gov.ua/rada/control/en/publish/article/info_left?art_id=287324&cat_id=105995 -# # # Also reported by Alexander Bokovoy (2011-10-18) who also noted: # The law documents themselves are at -# -# # http://w1.c1.rada.gov.ua/pls/zweb_n/webproc4_1?id=&pf3511=41484 -# +# From Vladimir in Moscow via Alois Treindl re Kiev time 1991/2 (2014-02-28): +# First in Ukraine they changed Time zone from UTC+3 to UTC+2 with DST: +# 03 25 1990 02:00 -03.00 1 Time Zone 3 with DST +# 07 01 1990 02:00 -02.00 1 Time Zone 2 with DST +# * Ukrainian Government's Resolution of 18.06.1990, No. 134. +# http://search.ligazakon.ua/l_doc2.nsf/link1/T001500.html +# +# They did not end DST in September, 1990 (according to the law, +# "summer time" was still in action): +# 09 30 1990 03:00 -02.00 1 Time Zone 2 with DST +# * Ukrainian Government's Resolution of 21.09.1990, No. 272. +# http://search.ligazakon.ua/l_doc2.nsf/link1/KP900272.html +# +# Again no change in March, 1991 ("summer time" in action): +# 03 31 1991 02:00 -02.00 1 Time Zone 2 with DST +# +# DST ended in September 1991 ("summer time" ended): +# 09 29 1991 03:00 -02.00 0 Time Zone 2, no DST +# * Ukrainian Government's Resolution of 25.09.1991, No. 225. +# http://www.uazakon.com/documents/date_21/pg_iwgdoc.htm +# This is an answer. +# +# Since 1992 they had normal DST procedure: +# 03 29 1992 02:00 -02.00 1 DST started +# 09 27 1992 03:00 -02.00 0 DST ended +# * Ukrainian Government's Resolution of 20.03.1992, No. 139. +# http://www.uazakon.com/documents/date_8u/pg_grcasa.htm # Zone NAME GMTOFF RULES FORMAT [UNTIL] # Most of Ukraine since 1970 has been like Kiev. @@ -2887,9 +2908,8 @@ Zone Europe/Kiev 2:02:04 - LMT 1880 2:00 - EET 1930 Jun 21 3:00 - MSK 1941 Sep 20 1:00 C-Eur CE%sT 1943 Nov 6 - 3:00 Russia MSK/MSD 1990 - 3:00 - MSK 1990 Jul 1 2:00 - 2:00 - EET 1992 + 3:00 Russia MSK/MSD 1990 Jul 1 2:00 + 2:00 1:00 EEST 1991 Sep 29 3:00 2:00 E-Eur EE%sT 1995 2:00 EU EE%sT # Ruthenia used CET 1990/1991. Modified: stable/10/contrib/tzdata/northamerica ============================================================================== --- stable/10/contrib/tzdata/northamerica Tue Mar 11 20:37:39 2014 (r263045) +++ stable/10/contrib/tzdata/northamerica Tue Mar 11 20:47:01 2014 (r263046) @@ -391,9 +391,10 @@ Zone America/Denver -6:59:56 - LMT 1883 # US Pacific time, represented by Los Angeles # # California, northern Idaho (Benewah, Bonner, Boundary, Clearwater, -# Idaho, Kootenai, Latah, Lewis, Nez Perce, and Shoshone counties, -# and the northern three-quarters of Idaho county), -# most of Nevada, most of Oregon, and Washington +# Kootenai, Latah, Lewis, Nez Perce, and Shoshone counties, Idaho county +# north of the Salmon River, and the towns of Burgdorf and Warren), +# Nevada (except West Wendover), Oregon (except the northern 3/4 of +# Malheur county), and Washington # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule CA 1948 only - Mar 14 2:00 1:00 D Modified: stable/10/contrib/tzdata/southamerica ============================================================================== --- stable/10/contrib/tzdata/southamerica Tue Mar 11 20:37:39 2014 (r263045) +++ stable/10/contrib/tzdata/southamerica Tue Mar 11 20:47:01 2014 (r263046) @@ -1275,6 +1275,13 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # start date is 2013-09-08 00:00.... # http://www.gob.cl/informa/2013/02/15/gobierno-anuncia-fechas-de-cambio-de-hora-para-el-ano-2013.htm +# From Jose Miguel Garrido (2014-02-19): +# Today appeared in the Diario Oficial a decree amending the time change +# dates to 2014. +# DST End: last Saturday of April 2014 (Sun 27 Apr 2014 03:00 UTC) +# DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC) +# http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf + # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1608,6 +1615,9 @@ Rule Para 2010 2012 - Apr Sun>=8 0:00 0 # From Carlos Raul Perasso (2013-03-15): # The change in Paraguay is now final. Decree number 10780 # http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf +# From Carlos Raul Perasso (2014-02-28): +# Decree 1264 can be found at: +# http://www.presidencia.gov.py/archivos/documentos/DECRETO1264_ey9r8zai.pdf Rule Para 2013 max - Mar Sun>=22 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1666,18 +1676,19 @@ Zone America/Paramaribo -3:40:40 - LMT 1 Zone America/Port_of_Spain -4:06:04 - LMT 1912 Mar 2 -4:00 - AST +# These all agree with Trinidad and Tobago since 1970. Link America/Port_of_Spain America/Anguilla Link America/Port_of_Spain America/Dominica Link America/Port_of_Spain America/Grenada Link America/Port_of_Spain America/Guadeloupe -Link America/Port_of_Spain America/Marigot +Link America/Port_of_Spain America/Marigot # St Martin (French part) Link America/Port_of_Spain America/Montserrat Link America/Port_of_Spain America/St_Barthelemy -Link America/Port_of_Spain America/St_Kitts +Link America/Port_of_Spain America/St_Kitts # St Kitts & Nevis Link America/Port_of_Spain America/St_Lucia -Link America/Port_of_Spain America/St_Thomas +Link America/Port_of_Spain America/St_Thomas # Virgin Islands (US) Link America/Port_of_Spain America/St_Vincent -Link America/Port_of_Spain America/Tortola +Link America/Port_of_Spain America/Tortola # Virgin Islands (UK) # Uruguay # From Paul Eggert (1993-11-18): From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 12 07:15:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3C90987C; Wed, 12 Mar 2014 07:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24952FED; Wed, 12 Mar 2014 07:15: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 s2C7FgeY038916; Wed, 12 Mar 2014 07:15:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2C7Ffkl038914; Wed, 12 Mar 2014 07:15:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403120715.s2C7Ffkl038914@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 12 Mar 2014 07:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263063 - in stable/10: share/man/man4 sys/dev/usb/input X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 07:15:42 -0000 Author: hselasky Date: Wed Mar 12 07:15:41 2014 New Revision: 263063 URL: http://svnweb.freebsd.org/changeset/base/263063 Log: MFC r262417, r262439, r262454, r262455 and r262478: - Several updates and improvements to ATP driver. - Start effort merging WSP and ATP driver. Modified: stable/10/share/man/man4/atp.4 stable/10/sys/dev/usb/input/atp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/atp.4 ============================================================================== --- stable/10/share/man/man4/atp.4 Wed Mar 12 01:28:21 2014 (r263062) +++ stable/10/share/man/man4/atp.4 Wed Mar 12 07:15:41 2014 (r263063) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009 Rohit Grover . +.\" Copyright (c) 2014 Rohit Grover . .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2014 +.Dd February 24, 2014 .Dt ATP 4 .Os .Sh NAME @@ -41,8 +41,7 @@ your kernel configuration file: .Cd "device usb" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent atp_load="YES" @@ -50,24 +49,21 @@ atp_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the Apple Internal Trackpad -device found in many Apple laptops. +driver provides support for the Apple Internal Trackpad device found in many +Apple laptops. Older (Fountain/Geyser) and the newer (Wellspring) trackpad +families are all supported through a unified driver. +.Pp +The driver simulates a three\-button mouse using multi\-finger tap detection. +Single finger tap generates a left\-button click; two\-finger tap maps to the +middle button; whereas a three\-finger tap gets treated as a right button +click. +.Pp +There is support for 2\-finger horizontal scrolling, which translates to +page\-back/forward events; vertical multi\-finger scrolling emulates the mouse +wheel. .Pp -The driver simulates a three\-button mouse using multi\-finger tap -detection. -. -A single\-finger tap generates a left button click; -two\-finger tap maps to the middle button; whereas a three\-finger tap -gets treated as a right button click. -. A double\-tap followed by a drag is treated as a selection gesture; a virtual left\-button click is assumed for the lifespan of the drag. -. -.Nm -attempts to filter away activity at the horizontal edges of the -trackpad\-\-this is to keep unintentional palm movement from being -considered as user input. -. .Pp .Nm supports dynamic reconfiguration using @@ -76,6 +72,28 @@ through nodes under .Nm hw.usb.atp . Pointer sensitivity can be controlled using the sysctl tunable .Nm hw.usb.atp.scale_factor . +Smaller values of +.Fa scale_factor +result in faster movement. +. +A simple high-pass filter is used to reduce contributions +from small movements; the threshold for this filter may be controlled by +.Nm hw.usb.atp.small_movement . +. +The maximum tolerable duration of a touch gesture is controlled by +.Nm hw.usb.atp.touch_timeout +(in microseconds); beyond this period, touches are considered to be slides. +(This conversion also happens when a finger stroke accumulates at least +.Nm hw.usb.atp.slide_min_movement +movement (in mickeys). +. +The maximum time (in microseconds) to allow an association between a double- +tap and drag gesture may be controlled by +.Nm hw.usb.atp.double_tap_threshold . +. +Should one want to disable tap detection and rely only upon physical button +presses, set the following sysctl to a value of 2 +.Nm hw.usb.atp.tap_minimum . . .Sh HARDWARE The @@ -84,6 +102,8 @@ driver provides support for the followin .Pp .Bl -bullet -compact .It +PowerBooks, iBooks (IDs: 0x020e, 0x020f, 0x0210, 0x0214, 0x0215, 0x0216) +.It Core Duo MacBook & MacBook Pro (IDs: 0x0217, 0x0218, 0x0219) .It Core2 Duo MacBook & MacBook Pro (IDs: 0x021a, 0x021b, 0x021c) @@ -95,6 +115,14 @@ Core2 Duo MacBook3,1 (IDs: 0x0229, 0x022 15 inch PowerBook (IDs: 0x020e, 0x020f, 0x0215) .It 17 inch PowerBook (ID: 0x020d) +.It +Almost all recent Macbook-Pros and Airs (IDs: 0x0223, 0x0223, 0x0224, 0x0224, +0x0225, 0x0225, 0x0230, 0x0230, 0x0231, 0x0231, 0x0232, 0x0232, 0x0236, +0x0236, 0x0237, 0x0237, 0x0238, 0x0238, 0x023f, 0x023f, 0x0240, 0x0241, +0x0242, 0x0243, 0x0244, 0x0245, 0x0246, 0x0247, 0x0249, 0x024a, 0x024b, +0x024c, 0x024d, 0x024e, 0x0252, 0x0252, 0x0253, 0x0253, 0x0254, 0x0254, +0x0259, 0x025a, 0x025b, 0x0262, 0x0262, 0x0263, 0x0264, 0x0290, 0x0291, +0x0292) .El .Pp To discover the product\-id of a touchpad, search for 'Trackpad' in the Modified: stable/10/sys/dev/usb/input/atp.c ============================================================================== --- stable/10/sys/dev/usb/input/atp.c Wed Mar 12 01:28:21 2014 (r263062) +++ stable/10/sys/dev/usb/input/atp.c Wed Mar 12 07:15:41 2014 (r263063) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 Rohit Grover + * Copyright (c) 2014 Rohit Grover * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,29 +24,64 @@ * SUCH DAMAGE. */ +/* + * Some tables, structures, definitions and constant values for the + * touchpad protocol has been copied from Linux's + * "drivers/input/mouse/bcm5974.c" which has the following copyright + * holders under GPLv2. All device specific code in this driver has + * been written from scratch. The decoding algorithm is based on + * output from FreeBSD's usbdump. + * + * Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se) + * Copyright (C) 2008 Scott Shawcroft (scott.shawcroft@gmail.com) + * Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com) + * Copyright (C) 2005 Johannes Berg (johannes@sipsolutions.net) + * Copyright (C) 2005 Stelian Pop (stelian@popies.net) + * Copyright (C) 2005 Frank Arnold (frank@scirocco-5v-turbo.de) + * Copyright (C) 2005 Peter Osterlund (petero2@telia.com) + * Copyright (C) 2005 Michael Hanselmann (linux-kernel@hansmi.ch) + * Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch) + */ + +/* + * Author's note: 'atp' supports two distinct families of Apple trackpad + * products: the older Fountain/Geyser and the latest Wellspring trackpads. + * The first version made its appearance with FreeBSD 8 and worked only with + * the Fountain/Geyser hardware. A fork of this driver for Wellspring was + * contributed by Huang Wen Hui. This driver unifies the Wellspring effort + * and also improves upon the original work. + * + * I'm grateful to Stephan Scheunig, Angela Naegele, and Nokia IT-support + * for helping me with access to hardware. Thanks also go to Nokia for + * giving me an opportunity to do this work. + */ + #include __FBSDID("$FreeBSD$"); +#include +#include #include +#include #include #include -#include +#include #include #include #include -#include +#include +#include #include #include #include #include #include -#include -#include #include #include #include #include + #include "usbdevs.h" #define USB_DEBUG_VAR atp_debug @@ -61,17 +96,35 @@ __FBSDID("$FreeBSD$"); * `options' statements in the kernel configuration file. */ -/* The multiplier used to translate sensor reported positions to mickeys. */ +/* The divisor used to translate sensor reported positions to mickeys. */ #ifndef ATP_SCALE_FACTOR -#define ATP_SCALE_FACTOR 48 +#define ATP_SCALE_FACTOR 16 +#endif + +/* Threshold for small movement noise (in mickeys) */ +#ifndef ATP_SMALL_MOVEMENT_THRESHOLD +#define ATP_SMALL_MOVEMENT_THRESHOLD 30 +#endif + +/* Threshold of instantaneous deltas beyond which movement is considered fast.*/ +#ifndef ATP_FAST_MOVEMENT_TRESHOLD +#define ATP_FAST_MOVEMENT_TRESHOLD 150 #endif /* - * This is the age (in microseconds) beyond which a touch is - * considered to be a slide; and therefore a tap event isn't registered. + * This is the age in microseconds beyond which a touch is considered + * to be a slide; and therefore a tap event isn't registered. */ #ifndef ATP_TOUCH_TIMEOUT -#define ATP_TOUCH_TIMEOUT 125000 +#define ATP_TOUCH_TIMEOUT 125000 +#endif + +#ifndef ATP_IDLENESS_THRESHOLD +#define ATP_IDLENESS_THRESHOLD 10 +#endif + +#ifndef FG_SENSOR_NOISE_THRESHOLD +#define FG_SENSOR_NOISE_THRESHOLD 2 #endif /* @@ -82,39 +135,40 @@ __FBSDID("$FreeBSD$"); * tap events preceding the slide for such a gesture. */ #ifndef ATP_DOUBLE_TAP_N_DRAG_THRESHOLD -#define ATP_DOUBLE_TAP_N_DRAG_THRESHOLD 200000 +#define ATP_DOUBLE_TAP_N_DRAG_THRESHOLD 200000 #endif /* - * The device provides us only with pressure readings from an array of - * X and Y sensors; for our algorithms, we need to interpret groups - * (typically pairs) of X and Y readings as being related to a single - * finger stroke. We can relate X and Y readings based on their times - * of incidence. The coincidence window should be at least 10000us - * since it is used against values from getmicrotime(), which has a - * precision of around 10ms. - */ -#ifndef ATP_COINCIDENCE_THRESHOLD -#define ATP_COINCIDENCE_THRESHOLD 40000 /* unit: microseconds */ -#if ATP_COINCIDENCE_THRESHOLD > 100000 -#error "ATP_COINCIDENCE_THRESHOLD too large" -#endif -#endif /* #ifndef ATP_COINCIDENCE_THRESHOLD */ + * The wait duration in ticks after losing a touch contact before + * zombied strokes are reaped and turned into button events. + */ +#define ATP_ZOMBIE_STROKE_REAP_INTERVAL (hz / 20) /* 50 ms */ + +/* The multiplier used to translate sensor reported positions to mickeys. */ +#define FG_SCALE_FACTOR 380 /* - * The wait duration (in microseconds) after losing a touch contact - * before zombied strokes are reaped and turned into button events. + * The movement threshold for a stroke; this is the maximum difference + * in position which will be resolved as a continuation of a stroke + * component. */ -#define ATP_ZOMBIE_STROKE_REAP_WINDOW 50000 -#if ATP_ZOMBIE_STROKE_REAP_WINDOW > 100000 -#error "ATP_ZOMBIE_STROKE_REAP_WINDOW too large" +#define FG_MAX_DELTA_MICKEYS ((3 * (FG_SCALE_FACTOR)) >> 1) + +/* Distance-squared threshold for matching a finger with a known stroke */ +#ifndef WSP_MAX_ALLOWED_MATCH_DISTANCE_SQ +#define WSP_MAX_ALLOWED_MATCH_DISTANCE_SQ 1000000 #endif -/* end of driver specific options */ +/* Ignore pressure spans with cumulative press. below this value. */ +#define FG_PSPAN_MIN_CUM_PRESSURE 10 +/* Maximum allowed width for pressure-spans.*/ +#define FG_PSPAN_MAX_WIDTH 4 + +/* end of driver specific options */ /* Tunables */ -static SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB ATP"); #ifdef USB_DEBUG enum atp_log_level { @@ -130,12 +184,13 @@ SYSCTL_INT(_hw_usb_atp, OID_AUTO, debug, static u_int atp_touch_timeout = ATP_TOUCH_TIMEOUT; SYSCTL_UINT(_hw_usb_atp, OID_AUTO, touch_timeout, CTLFLAG_RW, - &atp_touch_timeout, 125000, "age threshold (in micros) for a touch"); + &atp_touch_timeout, 125000, "age threshold in microseconds for a touch"); static u_int atp_double_tap_threshold = ATP_DOUBLE_TAP_N_DRAG_THRESHOLD; SYSCTL_UINT(_hw_usb_atp, OID_AUTO, double_tap_threshold, CTLFLAG_RW, &atp_double_tap_threshold, ATP_DOUBLE_TAP_N_DRAG_THRESHOLD, - "maximum time (in micros) between a double-tap"); + "maximum time in microseconds to allow association between a double-tap and " + "drag gesture"); static u_int atp_mickeys_scale_factor = ATP_SCALE_FACTOR; static int atp_sysctl_scale_factor_handler(SYSCTL_HANDLER_ARGS); @@ -143,264 +198,539 @@ SYSCTL_PROC(_hw_usb_atp, OID_AUTO, scale &atp_mickeys_scale_factor, sizeof(atp_mickeys_scale_factor), atp_sysctl_scale_factor_handler, "IU", "movement scale factor"); -static u_int atp_small_movement_threshold = ATP_SCALE_FACTOR >> 3; +static u_int atp_small_movement_threshold = ATP_SMALL_MOVEMENT_THRESHOLD; SYSCTL_UINT(_hw_usb_atp, OID_AUTO, small_movement, CTLFLAG_RW, - &atp_small_movement_threshold, ATP_SCALE_FACTOR >> 3, + &atp_small_movement_threshold, ATP_SMALL_MOVEMENT_THRESHOLD, "the small movement black-hole for filtering noise"); -/* - * The movement threshold for a stroke; this is the maximum difference - * in position which will be resolved as a continuation of a stroke - * component. - */ -static u_int atp_max_delta_mickeys = ((3 * ATP_SCALE_FACTOR) >> 1); -SYSCTL_UINT(_hw_usb_atp, OID_AUTO, max_delta_mickeys, CTLFLAG_RW, - &atp_max_delta_mickeys, ((3 * ATP_SCALE_FACTOR) >> 1), - "max. mickeys-delta which will match against an existing stroke"); + +static u_int atp_tap_minimum = 1; +SYSCTL_UINT(_hw_usb_atp, OID_AUTO, tap_minimum, CTLFLAG_RW, + &atp_tap_minimum, 1, "Minimum number of taps before detection"); + /* * Strokes which accumulate at least this amount of absolute movement * from the aggregate of their components are considered as * slides. Unit: mickeys. */ -static u_int atp_slide_min_movement = (ATP_SCALE_FACTOR >> 3); +static u_int atp_slide_min_movement = 2 * ATP_SMALL_MOVEMENT_THRESHOLD; SYSCTL_UINT(_hw_usb_atp, OID_AUTO, slide_min_movement, CTLFLAG_RW, - &atp_slide_min_movement, (ATP_SCALE_FACTOR >> 3), + &atp_slide_min_movement, 2 * ATP_SMALL_MOVEMENT_THRESHOLD, "strokes with at least this amt. of movement are considered slides"); /* * The minimum age of a stroke for it to be considered mature; this * helps filter movements (noise) from immature strokes. Units: interrupts. */ -static u_int atp_stroke_maturity_threshold = 2; +static u_int atp_stroke_maturity_threshold = 4; SYSCTL_UINT(_hw_usb_atp, OID_AUTO, stroke_maturity_threshold, CTLFLAG_RW, - &atp_stroke_maturity_threshold, 2, + &atp_stroke_maturity_threshold, 4, "the minimum age of a stroke for it to be considered mature"); -/* Accept pressure readings from sensors only if above this value. */ -static u_int atp_sensor_noise_threshold = 2; -SYSCTL_UINT(_hw_usb_atp, OID_AUTO, sensor_noise_threshold, CTLFLAG_RW, - &atp_sensor_noise_threshold, 2, - "accept pressure readings from sensors only if above this value"); +typedef enum atp_trackpad_family { + TRACKPAD_FAMILY_FOUNTAIN_GEYSER, + TRACKPAD_FAMILY_WELLSPRING, + TRACKPAD_FAMILY_MAX /* keep this at the tail end of the enumeration */ +} trackpad_family_t; + +enum fountain_geyser_product { + FOUNTAIN, + GEYSER1, + GEYSER1_17inch, + GEYSER2, + GEYSER3, + GEYSER4, + FOUNTAIN_GEYSER_PRODUCT_MAX /* keep this at the end */ +}; -/* Ignore pressure spans with cumulative press. below this value. */ -static u_int atp_pspan_min_cum_pressure = 10; -SYSCTL_UINT(_hw_usb_atp, OID_AUTO, pspan_min_cum_pressure, CTLFLAG_RW, - &atp_pspan_min_cum_pressure, 10, - "ignore pressure spans with cumulative press. below this value"); +enum wellspring_product { + WELLSPRING1, + WELLSPRING2, + WELLSPRING3, + WELLSPRING4, + WELLSPRING4A, + WELLSPRING5, + WELLSPRING6A, + WELLSPRING6, + WELLSPRING5A, + WELLSPRING7, + WELLSPRING7A, + WELLSPRING8, + WELLSPRING_PRODUCT_MAX /* keep this at the end of the enumeration */ +}; -/* Maximum allowed width for pressure-spans.*/ -static u_int atp_pspan_max_width = 4; -SYSCTL_UINT(_hw_usb_atp, OID_AUTO, pspan_max_width, CTLFLAG_RW, - &atp_pspan_max_width, 4, - "maximum allowed width (in sensors) for pressure-spans"); - -/* We support three payload protocols */ -typedef enum { - ATP_PROT_GEYSER1, - ATP_PROT_GEYSER2, - ATP_PROT_GEYSER3, -} atp_protocol; +/* trackpad header types */ +enum fountain_geyser_trackpad_type { + FG_TRACKPAD_TYPE_GEYSER1, + FG_TRACKPAD_TYPE_GEYSER2, + FG_TRACKPAD_TYPE_GEYSER3, + FG_TRACKPAD_TYPE_GEYSER4, +}; +enum wellspring_trackpad_type { + WSP_TRACKPAD_TYPE1, /* plain trackpad */ + WSP_TRACKPAD_TYPE2, /* button integrated in trackpad */ + WSP_TRACKPAD_TYPE3 /* additional header fields since June 2013 */ +}; -/* Define the various flavours of devices supported by this driver. */ -enum { - ATP_DEV_PARAMS_0, - ATP_DEV_PARAMS_PBOOK, - ATP_DEV_PARAMS_PBOOK_15A, - ATP_DEV_PARAMS_PBOOK_17, - ATP_N_DEV_PARAMS +/* + * Trackpad family and product and family are encoded together in the + * driver_info value associated with a trackpad product. + */ +#define N_PROD_BITS 8 /* Number of bits used to encode product */ +#define ENCODE_DRIVER_INFO(FAMILY, PROD) \ + (((FAMILY) << N_PROD_BITS) | (PROD)) +#define DECODE_FAMILY_FROM_DRIVER_INFO(INFO) ((INFO) >> N_PROD_BITS) +#define DECODE_PRODUCT_FROM_DRIVER_INFO(INFO) \ + ((INFO) & ((1 << N_PROD_BITS) - 1)) + +#define FG_DRIVER_INFO(PRODUCT) \ + ENCODE_DRIVER_INFO(TRACKPAD_FAMILY_FOUNTAIN_GEYSER, PRODUCT) +#define WELLSPRING_DRIVER_INFO(PRODUCT) \ + ENCODE_DRIVER_INFO(TRACKPAD_FAMILY_WELLSPRING, PRODUCT) + +/* + * The following structure captures the state of a pressure span along + * an axis. Each contact with the touchpad results in separate + * pressure spans along the two axes. + */ +typedef struct fg_pspan { + u_int width; /* in units of sensors */ + u_int cum; /* cumulative compression (from all sensors) */ + u_int cog; /* center of gravity */ + u_int loc; /* location (scaled using the mickeys factor) */ + boolean_t matched; /* to track pspans as they match against strokes. */ +} fg_pspan; + +#define FG_MAX_PSPANS_PER_AXIS 3 +#define FG_MAX_STROKES (2 * FG_MAX_PSPANS_PER_AXIS) + +#define WELLSPRING_INTERFACE_INDEX 1 + +/* trackpad finger data offsets, le16-aligned */ +#define WSP_TYPE1_FINGER_DATA_OFFSET (13 * 2) +#define WSP_TYPE2_FINGER_DATA_OFFSET (15 * 2) +#define WSP_TYPE3_FINGER_DATA_OFFSET (19 * 2) + +/* trackpad button data offsets */ +#define WSP_TYPE2_BUTTON_DATA_OFFSET 15 +#define WSP_TYPE3_BUTTON_DATA_OFFSET 23 + +/* list of device capability bits */ +#define HAS_INTEGRATED_BUTTON 1 + +/* trackpad finger structure - little endian */ +struct wsp_finger_sensor_data { + int16_t origin; /* zero when switching track finger */ + int16_t abs_x; /* absolute x coordinate */ + int16_t abs_y; /* absolute y coordinate */ + int16_t rel_x; /* relative x coordinate */ + int16_t rel_y; /* relative y coordinate */ + int16_t tool_major; /* tool area, major axis */ + int16_t tool_minor; /* tool area, minor axis */ + int16_t orientation; /* 16384 when point, else 15 bit angle */ + int16_t touch_major; /* touch area, major axis */ + int16_t touch_minor; /* touch area, minor axis */ + int16_t unused[3]; /* zeros */ + int16_t multi; /* one finger: varies, more fingers: constant */ +} __packed; + +typedef struct wsp_finger { + /* to track fingers as they match against strokes. */ + boolean_t matched; + + /* location (scaled using the mickeys factor) */ + int x; + int y; +} wsp_finger_t; + +#define WSP_MAX_FINGERS 16 +#define WSP_SIZEOF_FINGER_SENSOR_DATA sizeof(struct wsp_finger_sensor_data) +#define WSP_SIZEOF_ALL_FINGER_DATA (WSP_MAX_FINGERS * \ + WSP_SIZEOF_FINGER_SENSOR_DATA) +#define WSP_MAX_FINGER_ORIENTATION 16384 + +#define ATP_SENSOR_DATA_BUF_MAX 1024 +#if (ATP_SENSOR_DATA_BUF_MAX < ((WSP_MAX_FINGERS * 14 * 2) + \ + WSP_TYPE3_FINGER_DATA_OFFSET)) +/* note: 14 * 2 in the above is based on sizeof(struct wsp_finger_sensor_data)*/ +#error "ATP_SENSOR_DATA_BUF_MAX is too small" +#endif + +#define ATP_MAX_STROKES MAX(WSP_MAX_FINGERS, FG_MAX_STROKES) + +#define FG_MAX_XSENSORS 26 +#define FG_MAX_YSENSORS 16 + +/* device-specific configuration */ +struct fg_dev_params { + u_int data_len; /* for sensor data */ + u_int n_xsensors; + u_int n_ysensors; + enum fountain_geyser_trackpad_type prot; }; -struct atp_dev_params { - u_int data_len; /* for sensor data */ - u_int n_xsensors; - u_int n_ysensors; - atp_protocol prot; -} atp_dev_params[ATP_N_DEV_PARAMS] = { - [ATP_DEV_PARAMS_0] = { - .data_len = 64, - .n_xsensors = 20, - .n_ysensors = 10, - .prot = ATP_PROT_GEYSER3 +struct wsp_dev_params { + uint8_t caps; /* device capability bitmask */ + uint8_t tp_type; /* type of trackpad interface */ + uint8_t finger_data_offset; /* offset to trackpad finger data */ +}; + +static const struct fg_dev_params fg_dev_params[FOUNTAIN_GEYSER_PRODUCT_MAX] = { + [FOUNTAIN] = { + .data_len = 81, + .n_xsensors = 16, + .n_ysensors = 16, + .prot = FG_TRACKPAD_TYPE_GEYSER1 }, - [ATP_DEV_PARAMS_PBOOK] = { + [GEYSER1] = { .data_len = 81, .n_xsensors = 16, .n_ysensors = 16, - .prot = ATP_PROT_GEYSER1 + .prot = FG_TRACKPAD_TYPE_GEYSER1 + }, + [GEYSER1_17inch] = { + .data_len = 81, + .n_xsensors = 26, + .n_ysensors = 16, + .prot = FG_TRACKPAD_TYPE_GEYSER1 }, - [ATP_DEV_PARAMS_PBOOK_15A] = { + [GEYSER2] = { .data_len = 64, .n_xsensors = 15, .n_ysensors = 9, - .prot = ATP_PROT_GEYSER2 + .prot = FG_TRACKPAD_TYPE_GEYSER2 }, - [ATP_DEV_PARAMS_PBOOK_17] = { - .data_len = 81, - .n_xsensors = 26, - .n_ysensors = 16, - .prot = ATP_PROT_GEYSER1 + [GEYSER3] = { + .data_len = 64, + .n_xsensors = 20, + .n_ysensors = 10, + .prot = FG_TRACKPAD_TYPE_GEYSER3 }, + [GEYSER4] = { + .data_len = 64, + .n_xsensors = 20, + .n_ysensors = 10, + .prot = FG_TRACKPAD_TYPE_GEYSER4 + } }; -static const STRUCT_USB_HOST_ID atp_devs[] = { +static const STRUCT_USB_HOST_ID fg_devs[] = { + /* PowerBooks Feb 2005, iBooks G4 */ + { USB_VPI(USB_VENDOR_APPLE, 0x020e, FG_DRIVER_INFO(FOUNTAIN)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x020f, FG_DRIVER_INFO(FOUNTAIN)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0210, FG_DRIVER_INFO(FOUNTAIN)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x030a, FG_DRIVER_INFO(FOUNTAIN)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x030b, FG_DRIVER_INFO(GEYSER1)) }, + + /* PowerBooks Oct 2005 */ + { USB_VPI(USB_VENDOR_APPLE, 0x0214, FG_DRIVER_INFO(GEYSER2)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0215, FG_DRIVER_INFO(GEYSER2)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0216, FG_DRIVER_INFO(GEYSER2)) }, + /* Core Duo MacBook & MacBook Pro */ - { USB_VPI(USB_VENDOR_APPLE, 0x0217, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x0218, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x0219, ATP_DEV_PARAMS_0) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0217, FG_DRIVER_INFO(GEYSER3)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0218, FG_DRIVER_INFO(GEYSER3)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0219, FG_DRIVER_INFO(GEYSER3)) }, /* Core2 Duo MacBook & MacBook Pro */ - { USB_VPI(USB_VENDOR_APPLE, 0x021a, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x021b, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x021c, ATP_DEV_PARAMS_0) }, + { USB_VPI(USB_VENDOR_APPLE, 0x021a, FG_DRIVER_INFO(GEYSER4)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x021b, FG_DRIVER_INFO(GEYSER4)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x021c, FG_DRIVER_INFO(GEYSER4)) }, /* Core2 Duo MacBook3,1 */ - { USB_VPI(USB_VENDOR_APPLE, 0x0229, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x022a, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x022b, ATP_DEV_PARAMS_0) }, - - /* 12 inch PowerBook and iBook */ - { USB_VPI(USB_VENDOR_APPLE, 0x030a, ATP_DEV_PARAMS_PBOOK) }, - { USB_VPI(USB_VENDOR_APPLE, 0x030b, ATP_DEV_PARAMS_PBOOK) }, - - /* 15 inch PowerBook */ - { USB_VPI(USB_VENDOR_APPLE, 0x020e, ATP_DEV_PARAMS_PBOOK) }, - { USB_VPI(USB_VENDOR_APPLE, 0x020f, ATP_DEV_PARAMS_PBOOK) }, - { USB_VPI(USB_VENDOR_APPLE, 0x0215, ATP_DEV_PARAMS_PBOOK_15A) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0229, FG_DRIVER_INFO(GEYSER4)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x022a, FG_DRIVER_INFO(GEYSER4)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x022b, FG_DRIVER_INFO(GEYSER4)) }, /* 17 inch PowerBook */ - { USB_VPI(USB_VENDOR_APPLE, 0x020d, ATP_DEV_PARAMS_PBOOK_17) }, + { USB_VPI(USB_VENDOR_APPLE, 0x020d, FG_DRIVER_INFO(GEYSER1_17inch)) }, +}; +static const struct wsp_dev_params wsp_dev_params[WELLSPRING_PRODUCT_MAX] = { + [WELLSPRING1] = { + .caps = 0, + .tp_type = WSP_TRACKPAD_TYPE1, + .finger_data_offset = WSP_TYPE1_FINGER_DATA_OFFSET, + }, + [WELLSPRING2] = { + .caps = 0, + .tp_type = WSP_TRACKPAD_TYPE1, + .finger_data_offset = WSP_TYPE1_FINGER_DATA_OFFSET, + }, + [WELLSPRING3] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING4] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING4A] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING5] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING6] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING5A] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING6A] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING7] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING7A] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING8] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE3, + .finger_data_offset = WSP_TYPE3_FINGER_DATA_OFFSET, + }, }; -/* - * The following structure captures the state of a pressure span along - * an axis. Each contact with the touchpad results in separate - * pressure spans along the two axes. - */ -typedef struct atp_pspan { - u_int width; /* in units of sensors */ - u_int cum; /* cumulative compression (from all sensors) */ - u_int cog; /* center of gravity */ - u_int loc; /* location (scaled using the mickeys factor) */ - boolean_t matched; /* to track pspans as they match against strokes. */ -} atp_pspan; +#define ATP_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + +/* TODO: STRUCT_USB_HOST_ID */ +static const struct usb_device_id wsp_devs[] = { + /* MacbookAir1.1 */ + ATP_DEV(APPLE, WELLSPRING_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING1)), + ATP_DEV(APPLE, WELLSPRING_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING1)), + ATP_DEV(APPLE, WELLSPRING_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING1)), + + /* MacbookProPenryn, aka wellspring2 */ + ATP_DEV(APPLE, WELLSPRING2_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING2)), + ATP_DEV(APPLE, WELLSPRING2_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING2)), + ATP_DEV(APPLE, WELLSPRING2_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING2)), + + /* Macbook5,1 (unibody), aka wellspring3 */ + ATP_DEV(APPLE, WELLSPRING3_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING3)), + ATP_DEV(APPLE, WELLSPRING3_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING3)), + ATP_DEV(APPLE, WELLSPRING3_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING3)), + + /* MacbookAir3,2 (unibody), aka wellspring4 */ + ATP_DEV(APPLE, WELLSPRING4_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING4)), + ATP_DEV(APPLE, WELLSPRING4_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING4)), + ATP_DEV(APPLE, WELLSPRING4_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING4)), + + /* MacbookAir3,1 (unibody), aka wellspring4 */ + ATP_DEV(APPLE, WELLSPRING4A_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING4A)), + ATP_DEV(APPLE, WELLSPRING4A_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING4A)), + ATP_DEV(APPLE, WELLSPRING4A_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING4A)), + + /* Macbook8 (unibody, March 2011) */ + ATP_DEV(APPLE, WELLSPRING5_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING5)), + ATP_DEV(APPLE, WELLSPRING5_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING5)), + ATP_DEV(APPLE, WELLSPRING5_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING5)), + + /* MacbookAir4,1 (unibody, July 2011) */ + ATP_DEV(APPLE, WELLSPRING6A_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING6A)), + ATP_DEV(APPLE, WELLSPRING6A_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING6A)), + ATP_DEV(APPLE, WELLSPRING6A_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING6A)), + + /* MacbookAir4,2 (unibody, July 2011) */ + ATP_DEV(APPLE, WELLSPRING6_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING6)), + ATP_DEV(APPLE, WELLSPRING6_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING6)), + ATP_DEV(APPLE, WELLSPRING6_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING6)), + + /* Macbook8,2 (unibody) */ + ATP_DEV(APPLE, WELLSPRING5A_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING5A)), + ATP_DEV(APPLE, WELLSPRING5A_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING5A)), + ATP_DEV(APPLE, WELLSPRING5A_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING5A)), + + /* MacbookPro10,1 (unibody, June 2012) */ + /* MacbookPro11,? (unibody, June 2013) */ + ATP_DEV(APPLE, WELLSPRING7_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING7)), + ATP_DEV(APPLE, WELLSPRING7_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING7)), + ATP_DEV(APPLE, WELLSPRING7_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING7)), + + /* MacbookPro10,2 (unibody, October 2012) */ + ATP_DEV(APPLE, WELLSPRING7A_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING7A)), + ATP_DEV(APPLE, WELLSPRING7A_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING7A)), + ATP_DEV(APPLE, WELLSPRING7A_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING7A)), + + /* MacbookAir6,2 (unibody, June 2013) */ + ATP_DEV(APPLE, WELLSPRING8_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING8)), + ATP_DEV(APPLE, WELLSPRING8_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING8)), + ATP_DEV(APPLE, WELLSPRING8_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING8)), +}; typedef enum atp_stroke_type { ATP_STROKE_TOUCH, ATP_STROKE_SLIDE, } atp_stroke_type; -#define ATP_MAX_PSPANS_PER_AXIS 3 +typedef enum atp_axis { + X = 0, + Y = 1, + NUM_AXES +} atp_axis; + +#define ATP_FIFO_BUF_SIZE 8 /* bytes */ +#define ATP_FIFO_QUEUE_MAXLEN 50 /* units */ + +enum { + ATP_INTR_DT, + ATP_RESET, + ATP_N_TRANSFER, +}; -typedef struct atp_stroke_component { +typedef struct fg_stroke_component { /* Fields encapsulating the pressure-span. */ u_int loc; /* location (scaled) */ u_int cum_pressure; /* cumulative compression */ u_int max_cum_pressure; /* max cumulative compression */ boolean_t matched; /*to track components as they match against pspans.*/ - /* Fields containing information about movement. */ int delta_mickeys; /* change in location (un-smoothened movement)*/ - int pending; /* cum. of pending short movements */ - int movement; /* current smoothened movement */ -} atp_stroke_component; - -typedef enum atp_axis { - X = 0, - Y = 1 -} atp_axis; - -#define ATP_MAX_STROKES (2 * ATP_MAX_PSPANS_PER_AXIS) +} fg_stroke_component_t; /* * The following structure captures a finger contact with the * touchpad. A stroke comprises two p-span components and some state. */ typedef struct atp_stroke { - atp_stroke_type type; - struct timeval ctime; /* create time; for coincident siblings. */ - u_int age; /* - * Unit: interrupts; we maintain - * this value in addition to - * 'ctime' in order to avoid the - * expensive call to microtime() - * at every interrupt. - */ - - atp_stroke_component components[2]; - u_int velocity_squared; /* - * Average magnitude (squared) - * of recent velocity. - */ - u_int cum_movement; /* cum. absolute movement so far */ - - uint32_t flags; /* the state of this stroke */ -#define ATSF_ZOMBIE 0x1 -} atp_stroke; + TAILQ_ENTRY(atp_stroke) entry; -#define ATP_FIFO_BUF_SIZE 8 /* bytes */ -#define ATP_FIFO_QUEUE_MAXLEN 50 /* units */ + atp_stroke_type type; + uint32_t flags; /* the state of this stroke */ +#define ATSF_ZOMBIE 0x1 + boolean_t matched; /* to track match against fingers.*/ -enum { - ATP_INTR_DT, - ATP_RESET, - ATP_N_TRANSFER, -}; + struct timeval ctime; /* create time; for coincident siblings. */ + + /* + * Unit: interrupts; we maintain this value in + * addition to 'ctime' in order to avoid the + * expensive call to microtime() at every + * interrupt. + */ + uint32_t age; + + /* Location */ + int x; + int y; + + /* Fields containing information about movement. */ + int instantaneous_dx; /* curr. change in X location (un-smoothened) */ + int instantaneous_dy; /* curr. change in Y location (un-smoothened) */ + int pending_dx; /* cum. of pending short movements */ + int pending_dy; /* cum. of pending short movements */ + int movement_dx; /* interpreted smoothened movement */ + int movement_dy; /* interpreted smoothened movement */ + int cum_movement_x; /* cum. horizontal movement */ + int cum_movement_y; /* cum. vertical movement */ + + /* + * The following member is relevant only for fountain-geyser trackpads. + * For these, there is the need to track pressure-spans and cumulative + * pressures for stroke components. + */ + fg_stroke_component_t components[NUM_AXES]; +} atp_stroke_t; + +struct atp_softc; /* forward declaration */ +typedef void (*sensor_data_interpreter_t)(struct atp_softc *sc, u_int len); struct atp_softc { - device_t sc_dev; - struct usb_device *sc_usb_device; -#define MODE_LENGTH 8 - char sc_mode_bytes[MODE_LENGTH]; /* device mode */ - struct mtx sc_mutex; /* for synchronization */ - struct usb_xfer *sc_xfer[ATP_N_TRANSFER]; - struct usb_fifo_sc sc_fifo; - - struct atp_dev_params *sc_params; - - mousehw_t sc_hw; - mousemode_t sc_mode; - u_int sc_pollrate; - mousestatus_t sc_status; - u_int sc_state; -#define ATP_ENABLED 0x01 -#define ATP_ZOMBIES_EXIST 0x02 -#define ATP_DOUBLE_TAP_DRAG 0x04 -#define ATP_VALID 0x08 - - u_int sc_left_margin; - u_int sc_right_margin; - - atp_stroke sc_strokes[ATP_MAX_STROKES]; - u_int sc_n_strokes; - - int8_t *sensor_data; /* from interrupt packet */ - int *base_x; /* base sensor readings */ - int *base_y; - int *cur_x; /* current sensor readings */ - int *cur_y; - int *pressure_x; /* computed pressures */ - int *pressure_y; + device_t sc_dev; + struct usb_device *sc_usb_device; + struct mtx sc_mutex; /* for synchronization */ + struct usb_fifo_sc sc_fifo; + +#define MODE_LENGTH 8 + char sc_mode_bytes[MODE_LENGTH]; /* device mode */ + + trackpad_family_t sc_family; + const void *sc_params; /* device configuration */ + sensor_data_interpreter_t sensor_data_interpreter; + + mousehw_t sc_hw; + mousemode_t sc_mode; + mousestatus_t sc_status; + + u_int sc_state; +#define ATP_ENABLED 0x01 +#define ATP_ZOMBIES_EXIST 0x02 +#define ATP_DOUBLE_TAP_DRAG 0x04 +#define ATP_VALID 0x08 + + struct usb_xfer *sc_xfer[ATP_N_TRANSFER]; + + u_int sc_pollrate; + int sc_fflags; + + atp_stroke_t sc_strokes_data[ATP_MAX_STROKES]; + TAILQ_HEAD(,atp_stroke) sc_stroke_free; + TAILQ_HEAD(,atp_stroke) sc_stroke_used; + u_int sc_n_strokes; - u_int sc_idlecount; /* preceding idle interrupts */ -#define ATP_IDLENESS_THRESHOLD 10 + struct callout sc_callout; + + /* + * button status. Set to non-zero if the mouse-button is physically + * pressed. This state variable is exposed through softc to allow + * reap_sibling_zombies to avoid registering taps while the trackpad + * button is pressed. + */ + uint8_t sc_ibtn; + + /* + * Time when touch zombies were last reaped; useful for detecting + * double-touch-n-drag. + */ + struct timeval sc_touch_reap_time; - struct timeval sc_reap_time; - struct timeval sc_reap_ctime; /*ctime of siblings to be reaped*/ + u_int sc_idlecount; + + /* Regarding the data transferred from t-pad in USB INTR packets. */ + u_int sc_expected_sensor_data_len; + uint8_t sc_sensor_data[ATP_SENSOR_DATA_BUF_MAX] __aligned(4); + + int sc_cur_x[FG_MAX_XSENSORS]; /* current sensor readings */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 12 07:27:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 80C0DDD; Wed, 12 Mar 2014 07:27: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C7691BC; Wed, 12 Mar 2014 07:27: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 s2C7R6fF043116; Wed, 12 Mar 2014 07:27:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2C7R6FV043115; Wed, 12 Mar 2014 07:27:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403120727.s2C7R6FV043115@svn.freebsd.org> From: Alexander Motin Date: Wed, 12 Mar 2014 07:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263065 - stable/10/sys/dev/hyperv/storvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 07:27:06 -0000 Author: mav Date: Wed Mar 12 07:27:05 2014 New Revision: 263065 URL: http://svnweb.freebsd.org/changeset/base/263065 Log: MFC r262789, r262847: Remove custom bus scanner code and fix use of CAM's default scanner. This fixes kernel panic during boot, caused by incompatibility of recent CAM locking changes and this bus scanner code. Submitted by: Microsoft Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Mar 12 07:18:39 2014 (r263064) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Mar 12 07:27:05 2014 (r263065) @@ -171,15 +171,12 @@ static struct storvsc_driver_props g_drv STORVSC_RINGBUFFER_SIZE} }; -static struct storvsc_softc *hs_softc[HS_MAX_ADAPTERS]; - /* static functions */ static int storvsc_probe(device_t dev); static int storvsc_attach(device_t dev); static int storvsc_detach(device_t dev); static void storvsc_poll(struct cam_sim * sim); static void storvsc_action(struct cam_sim * sim, union ccb * ccb); -static void scan_for_luns(struct storvsc_softc * sc); static void create_storvsc_request(union ccb *ccb, struct hv_storvsc_request *reqp); static void storvsc_free_request(struct storvsc_softc *sc, struct hv_storvsc_request *reqp); static enum hv_storage_type storvsc_get_storage_type(device_t dev); @@ -669,84 +666,6 @@ hv_storvsc_on_channel_callback(void *con } /** - * @brief callback function for completing a single LUN scan - * - * This function is responsible for waking up the executer of - * the scan LUN CCB action (cam_periph_runccb.) cam_periph_ccbwait - * sleeps on the mutex being signaled. - * - * @param periph a pointer to a CAM peripheral - * @param done_ccb pointer to CAM control block - */ -static void -storvsc_xptdone(struct cam_periph *periph, union ccb *done_ccb) -{ - wakeup(&done_ccb->ccb_h.cbfcnp); -} - -/** - * @brief scan for attached logical unit numbers (LUNs) - * - * In Hyper-V there is no backend changed device operation which - * presents FreeBSD with a list of devices to connect. The result is - * that we have to scan for a list of luns in the storvsc_attach() - * routine. There is only one SCSI target, so scan for the maximum - * number of luns. - * - * @param pointer to softc - */ -static void -scan_for_luns(struct storvsc_softc *sc) -{ - union ccb *request_ccb; - struct cam_path *path = sc->hs_path; - struct cam_path *my_path = NULL; - cam_status status; - int lun_nb = 0; - int error; - - request_ccb = malloc(sizeof(union ccb), M_CAMXPT, M_WAITOK); - my_path = malloc(sizeof(*my_path), M_CAMXPT, M_WAITOK); - - mtx_lock(&sc->hs_lock); - do { - /* - * Scan the next LUN. Reuse path and ccb structs. - */ - bzero(my_path, sizeof(*my_path)); - bzero(request_ccb, sizeof(*request_ccb)); - status = xpt_compile_path(my_path, - xpt_periph, - path->bus->path_id, - 0, - lun_nb); - - if (status != CAM_REQ_CMP) { - mtx_unlock(&sc->hs_lock); - xpt_print(path, "scan_for_lunYYY: can't compile" - " path, 0x%p can't continue\n", - sc->hs_path); - free(request_ccb, M_CAMXPT); - free(my_path, M_CAMXPT); - return; - } - - xpt_setup_ccb(&request_ccb->ccb_h, my_path, 5); - request_ccb->ccb_h.func_code = XPT_SCAN_LUN; - request_ccb->ccb_h.cbfcnp = storvsc_xptdone; - request_ccb->crcn.flags = CAM_FLAG_NONE; - - error = cam_periph_runccb(request_ccb, NULL, - CAM_FLAG_NONE, 0, NULL); - KASSERT(error == 0, ("cam_periph_runccb failed %d\n", error)); - xpt_release_path(my_path); - } while ( ++lun_nb < sc->hs_drv_props->drv_max_luns_per_target); - mtx_unlock(&sc->hs_lock); - free(request_ccb, M_CAMXPT); - free(my_path, M_CAMXPT); -} - -/** * @brief StorVSC probe function * * Device probe function. Returns 0 if the input device is a StorVSC @@ -904,10 +823,6 @@ storvsc_attach(device_t dev) } mtx_unlock(&sc->hs_lock); - scan_for_luns(sc); - for (i = 0; (hs_softc[i] != NULL) && (i < HS_MAX_ADAPTERS); i++); - KASSERT(i < HS_MAX_ADAPTERS, ("storvsc_attach: hs_softc full\n")); - hs_softc[i] = sc; root_mount_rel(root_mount_token); return (0); @@ -1147,7 +1062,7 @@ storvsc_action(struct cam_sim *sim, unio cpi->hba_eng_cnt = 0; cpi->max_target = STORVSC_MAX_TARGETS; cpi->max_lun = sc->hs_drv_props->drv_max_luns_per_target; - cpi->initiator_id = 0; + cpi->initiator_id = cpi->max_target; cpi->bus_id = cam_sim_bus(sim); cpi->base_transfer_speed = 300000; cpi->transport = XPORT_SAS; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 12 08:15:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 40E8FD37; Wed, 12 Mar 2014 08:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D15794C; Wed, 12 Mar 2014 08:15: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 s2C8FGhf063404; Wed, 12 Mar 2014 08:15:16 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2C8FGU5063403; Wed, 12 Mar 2014 08:15:16 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403120815.s2C8FGU5063403@svn.freebsd.org> From: Christian Brueffer Date: Wed, 12 Mar 2014 08:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263069 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 08:15:16 -0000 Author: brueffer Date: Wed Mar 12 08:15:15 2014 New Revision: 263069 URL: http://svnweb.freebsd.org/changeset/base/263069 Log: MFC: r261710 Only count table lookups when we're actually processing packets. PR: 183462 Submitted by: Sven-Thorsten Dietrich Reviewed by: bms Modified: stable/10/sys/netinet6/ip6_mroute.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/10/sys/netinet6/ip6_mroute.c Wed Mar 12 08:08:41 2014 (r263068) +++ stable/10/sys/netinet6/ip6_mroute.c Wed Mar 12 08:15:15 2014 (r263069) @@ -283,7 +283,6 @@ static VNET_DEFINE(int, pim6); #define MF6CFIND(o, g, rt) do { \ struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \ rt = NULL; \ - MRT6STAT_INC(mrt6s_mfc_lookups); \ while (_rt) { \ if (IN6_ARE_ADDR_EQUAL(&_rt->mf6c_origin.sin6_addr, &(o)) && \ IN6_ARE_ADDR_EQUAL(&_rt->mf6c_mcastgrp.sin6_addr, &(g)) && \ @@ -1099,6 +1098,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru * Determine forwarding mifs from the forwarding cache table */ MF6CFIND(ip6->ip6_src, ip6->ip6_dst, rt); + MRT6STAT_INC(mrt6s_mfc_lookups); /* Entry exists, so forward if necessary */ if (rt) { From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 12 08:23:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3FDF0477; Wed, 12 Mar 2014 08:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 125AAA31; Wed, 12 Mar 2014 08:23: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 s2C8NRGc067432; Wed, 12 Mar 2014 08:23:27 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2C8NRCo067431; Wed, 12 Mar 2014 08:23:27 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403120823.s2C8NRCo067431@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 12 Mar 2014 08:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263072 - stable/10/sys/dev/usb/input X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 08:23:28 -0000 Author: hselasky Date: Wed Mar 12 08:23:27 2014 New Revision: 263072 URL: http://svnweb.freebsd.org/changeset/base/263072 Log: MFC r262477: Updates for WSP driver. Modified: stable/10/sys/dev/usb/input/wsp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/input/wsp.c ============================================================================== --- stable/10/sys/dev/usb/input/wsp.c Wed Mar 12 08:21:36 2014 (r263071) +++ stable/10/sys/dev/usb/input/wsp.c Wed Mar 12 08:23:27 2014 (r263072) @@ -94,8 +94,8 @@ static struct wsp_tuning { .z_factor = 5, .pressure_touch_threshold = 50, .pressure_untouch_threshold = 10, - .pressure_tap_threshold = 120, - .scr_hor_threshold = 50, + .pressure_tap_threshold = 100, + .scr_hor_threshold = 10, }; static void @@ -791,9 +791,13 @@ wsp_intr_callback(struct usb_xfer *xfer, } break; case 2: - if (sc->distance < MAX_DISTANCE) + DPRINTFN(WSP_LLEVEL_INFO, "sum_x=%5d, sum_y=%5d\n", + sc->dx_sum, sc->dy_sum); + if (sc->distance < MAX_DISTANCE && abs(sc->dx_sum) < 5 && + abs(sc->dy_sum) < 5) { wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON3DOWN); - DPRINTFN(WSP_LLEVEL_INFO, "RIGHT CLICK!\n"); + DPRINTFN(WSP_LLEVEL_INFO, "RIGHT CLICK!\n"); + } break; case 3: wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON2DOWN); @@ -804,8 +808,7 @@ wsp_intr_callback(struct usb_xfer *xfer, } wsp_add_to_queue(sc, 0, 0, 0, 0); /* button release */ } - if (sc->intr_count >= WSP_TAP_MAX_COUNT && - (sc->dt_sum / tun.scr_hor_threshold) != 0 && + if ((sc->dt_sum / tun.scr_hor_threshold) != 0 && sc->ntaps == 2 && sc->scr_mode == WSP_SCR_HOR) { /* @@ -903,7 +906,7 @@ wsp_intr_callback(struct usb_xfer *xfer, if (ntouch == 2 && sc->sc_status.button == 0) { if (sc->scr_mode == WSP_SCR_NONE && - abs(sc->dx_sum) + abs(sc->dy_sum) > 50) + abs(sc->dx_sum) + abs(sc->dy_sum) > tun.scr_hor_threshold) sc->scr_mode = abs(sc->dx_sum) > abs(sc->dy_sum) ? WSP_SCR_HOR : WSP_SCR_VER; @@ -918,10 +921,16 @@ wsp_intr_callback(struct usb_xfer *xfer, dy = 0; if (sc->dz_count == 0) dz = sc->dz_sum / tun.z_factor; - if (abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || + if (sc->scr_mode == WSP_SCR_HOR || + abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || abs(sc->pos_y[0] - sc->pos_y[1]) > MAX_DISTANCE) dz = 0; } + if (ntouch == 3) { + dx = 0; + dy = 0; + dz = 0; + } if (sc->intr_count < WSP_TAP_MAX_COUNT && abs(dx) < 3 && abs(dy) < 3 && abs(dz) < 3) { dx = dy = dz = 0; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 12 08:25:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CC17D607; Wed, 12 Mar 2014 08:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF65A4C; Wed, 12 Mar 2014 08:25: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 s2C8PPWx067712; Wed, 12 Mar 2014 08:25:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2C8PPBt067711; Wed, 12 Mar 2014 08:25:25 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403120825.s2C8PPBt067711@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 12 Mar 2014 08:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263073 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 08:25:25 -0000 Author: hselasky Date: Wed Mar 12 08:25:25 2014 New Revision: 263073 URL: http://svnweb.freebsd.org/changeset/base/263073 Log: MFC r262795: - Temporary fix for race in RUN driver which can cause freed memory to be accessed. - Properly lock callout_reset()'s. Modified: stable/10/sys/dev/usb/wlan/if_run.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_run.c Wed Mar 12 08:23:27 2014 (r263072) +++ stable/10/sys/dev/usb/wlan/if_run.c Wed Mar 12 08:25:25 2014 (r263073) @@ -2507,9 +2507,7 @@ run_ratectl_cb(void *arg, int pending) if (vap == NULL) return; - if (sc->rvp_cnt <= 1 && vap->iv_opmode == IEEE80211_M_STA) - run_iter_func(sc, vap->iv_bss); - else { + if (sc->rvp_cnt > 1 || vap->iv_opmode != IEEE80211_M_STA) { /* * run_reset_livelock() doesn't do anything with AMRR, * but Ralink wants us to call it every 1 sec. So, we @@ -2522,9 +2520,10 @@ run_ratectl_cb(void *arg, int pending) /* just in case, there are some stats to drain */ run_drain_fifo(sc); RUN_UNLOCK(sc); - ieee80211_iterate_nodes(&ic->ic_sta, run_iter_func, sc); } + ieee80211_iterate_nodes(&ic->ic_sta, run_iter_func, sc); + RUN_LOCK(sc); if(sc->ratectl_run != RUN_RATECTL_OFF) usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc); @@ -2604,6 +2603,11 @@ run_iter_func(void *arg, struct ieee8021 RUN_LOCK(sc); + /* Check for special case */ + if (sc->rvp_cnt <= 1 && vap->iv_opmode == IEEE80211_M_STA && + ni != vap->iv_bss) + goto fail; + if (sc->rvp_cnt <= 1 && (vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_STA)) { /* read statistic counters (clear on read) and update AMRR state */ @@ -2732,7 +2736,10 @@ run_newassoc(struct ieee80211_node *ni, rn->mgt_ridx = ridx; DPRINTF("rate=%d, mgmt_ridx=%d\n", rate, rn->mgt_ridx); - usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc); + RUN_LOCK(sc); + if(sc->ratectl_run != RUN_RATECTL_OFF) + usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc); + RUN_UNLOCK(sc); } /* From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 12 08:32:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 67D83D3B; Wed, 12 Mar 2014 08:32: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 54899B23; Wed, 12 Mar 2014 08:32: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 s2C8W2OI071525; Wed, 12 Mar 2014 08:32:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2C8W1LZ071523; Wed, 12 Mar 2014 08:32:01 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403120832.s2C8W1LZ071523@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 12 Mar 2014 08:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263076 - in stable/10/sys/dev/usb: . quirk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 08:32:02 -0000 Author: hselasky Date: Wed Mar 12 08:32:01 2014 New Revision: 263076 URL: http://svnweb.freebsd.org/changeset/base/263076 Log: MFC r262732: Add new quirk. PR: usb/187188 Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/10/sys/dev/usb/quirk/usb_quirk.c Wed Mar 12 08:30:18 2014 (r263075) +++ stable/10/sys/dev/usb/quirk/usb_quirk.c Wed Mar 12 08:32:01 2014 (r263076) @@ -93,6 +93,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(TELEX, MIC1, 0x009, 0x009, UQ_AU_NO_FRAC), USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC), USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS), + USB_QUIRK(REALTEK, RTL8196EU, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* Quirks for printer devices */ Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Wed Mar 12 08:30:18 2014 (r263075) +++ stable/10/sys/dev/usb/usbdevs Wed Mar 12 08:32:01 2014 (r263076) @@ -3659,6 +3659,7 @@ product REALTEK RTL8188CU_1 0x817a RTL81 product REALTEK RTL8188CU_2 0x817b RTL8188CU product REALTEK RTL8187 0x8187 RTL8187 Wireless Adapter product REALTEK RTL8187B_0 0x8189 RTL8187B Wireless Adapter +product REALTEK RTL8196EU 0x8196 RTL8196EU product REALTEK RTL8187B_1 0x8197 RTL8187B Wireless Adapter product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Adapter product REALTEK RTL8188CUS 0x818a RTL8188CUS From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 12 10:46:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F0B52D30; Wed, 12 Mar 2014 10:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D8440A91; Wed, 12 Mar 2014 10:46: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 s2CAk5gG025780; Wed, 12 Mar 2014 10:46:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CAjxnX025719; Wed, 12 Mar 2014 10:45:59 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403121045.s2CAjxnX025719@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 12 Mar 2014 10:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263086 - in stable/10: contrib/libpcap contrib/tcpdump etc/mtree include sbin/ifconfig sbin/ipfw sys/contrib/altq/altq sys/net sys/netpfil/ipfw sys/netpfil/pf usr.bin/kdump usr.bin/net... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 10:46:06 -0000 Author: glebius Date: Wed Mar 12 10:45:58 2014 New Revision: 263086 URL: http://svnweb.freebsd.org/changeset/base/263086 Log: Bulk sync of pf changes from head, in attempt to fixup broken build I made in r263029. Merge r257186,257215,257349,259736,261797. These changesets split pfvar.h into several smaller headers and make userland utilities to include only some of them. Added: stable/10/sys/netpfil/pf/pf.h - copied, changed from r257215, head/sys/netpfil/pf/pf.h stable/10/sys/netpfil/pf/pf_altq.h - copied unchanged from r257215, head/sys/netpfil/pf/pf_altq.h stable/10/sys/netpfil/pf/pf_mtag.h - copied unchanged from r257215, head/sys/netpfil/pf/pf_mtag.h Deleted: stable/10/sys/net/pf_mtag.h Modified: stable/10/contrib/libpcap/grammar.y stable/10/contrib/tcpdump/print-ip.c stable/10/etc/mtree/BSD.include.dist stable/10/include/Makefile stable/10/sbin/ifconfig/Makefile stable/10/sbin/ipfw/Makefile stable/10/sbin/ipfw/ipfw2.h stable/10/sys/contrib/altq/altq/altq_cbq.c stable/10/sys/contrib/altq/altq/altq_cdnr.c stable/10/sys/contrib/altq/altq/altq_hfsc.c stable/10/sys/contrib/altq/altq/altq_priq.c stable/10/sys/contrib/altq/altq/altq_red.c stable/10/sys/contrib/altq/altq/altq_rio.c stable/10/sys/contrib/altq/altq/altq_rmclass.c stable/10/sys/contrib/altq/altq/altq_subr.c stable/10/sys/net/if_ethersubr.c stable/10/sys/net/pfvar.h stable/10/sys/netpfil/ipfw/ip_fw2.c stable/10/sys/netpfil/pf/pf.c stable/10/sys/netpfil/pf/pf_lb.c stable/10/sys/netpfil/pf/pf_norm.c stable/10/usr.bin/kdump/Makefile stable/10/usr.bin/kdump/mkioctls stable/10/usr.bin/netstat/Makefile stable/10/usr.bin/netstat/if.c stable/10/usr.bin/netstat/main.c stable/10/usr.sbin/bsnmpd/modules/Makefile stable/10/usr.sbin/tcpdump/tcpdump/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libpcap/grammar.y ============================================================================== --- stable/10/contrib/libpcap/grammar.y Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/contrib/libpcap/grammar.y Wed Mar 12 10:45:58 2014 (r263086) @@ -56,7 +56,7 @@ struct rtentry; #include "gencode.h" #ifdef HAVE_NET_PFVAR_H #include -#include +#include #include #endif #include "ieee80211.h" Modified: stable/10/contrib/tcpdump/print-ip.c ============================================================================== --- stable/10/contrib/tcpdump/print-ip.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/contrib/tcpdump/print-ip.c Wed Mar 12 10:45:58 2014 (r263086) @@ -483,9 +483,11 @@ again: pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); break; +#if defined(HAVE_NET_PFVAR_H) case IPPROTO_PFSYNC: pfsync_ip_print(ipds->cp, ipds->len); break; +#endif default: if (ndo->ndo_nflag==0 && (proto = getprotobynumber(ipds->nh)) != NULL) Modified: stable/10/etc/mtree/BSD.include.dist ============================================================================== --- stable/10/etc/mtree/BSD.include.dist Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/etc/mtree/BSD.include.dist Wed Mar 12 10:45:58 2014 (r263086) @@ -287,6 +287,10 @@ sig .. .. + netpfil + pf + .. + .. netsmb .. nfs Modified: stable/10/include/Makefile ============================================================================== --- stable/10/include/Makefile Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/include/Makefile Wed Mar 12 10:45:58 2014 (r263086) @@ -280,6 +280,13 @@ symlinks: ${DESTDIR}${INCLUDEDIR}/netinet; \ done .endif +.if ${MK_PF} != "no" + cd ${.CURDIR}/../sys/netpfil/pf; \ + for h in *.h; do \ + ln -fs ../../../../sys/netpfil/pf/$$h \ + ${DESTDIR}${INCLUDEDIR}/netpfil/pf; \ + done +.endif cd ${.CURDIR}/../sys/crypto; \ for h in rijndael/rijndael.h; do \ ln -fs ../../../sys/crypto/$$h \ Modified: stable/10/sbin/ifconfig/Makefile ============================================================================== --- stable/10/sbin/ifconfig/Makefile Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sbin/ifconfig/Makefile Wed Mar 12 10:45:58 2014 (r263086) @@ -40,7 +40,9 @@ LDADD+= -lbsdxml -lsbuf SRCS+= carp.c # SIOC[GS]VH support SRCS+= ifgroup.c # ... +.if ${MK_PF} != "no" SRCS+= ifpfsync.c # pfsync(4) support +.endif SRCS+= ifbridge.c # bridge support SRCS+= iflagg.c # lagg support Modified: stable/10/sbin/ipfw/Makefile ============================================================================== --- stable/10/sbin/ipfw/Makefile Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sbin/ipfw/Makefile Wed Mar 12 10:45:58 2014 (r263086) @@ -1,8 +1,16 @@ # $FreeBSD$ +.include + PROG= ipfw -SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c altq.c +SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c WARNS?= 2 + +.if ${MK_PF} != "no" +SRCS+= altq.c +CFLAGS+=-DPF +.endif + DPADD= ${LIBUTIL} LDADD= -lutil MAN= ipfw.8 Modified: stable/10/sbin/ipfw/ipfw2.h ============================================================================== --- stable/10/sbin/ipfw/ipfw2.h Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sbin/ipfw/ipfw2.h Wed Mar 12 10:45:58 2014 (r263086) @@ -266,11 +266,14 @@ void ipfw_flush(int force); void ipfw_zero(int ac, char *av[], int optname); void ipfw_list(int ac, char *av[], int show_counters); +#ifdef PF /* altq.c */ void altq_set_enabled(int enabled); u_int32_t altq_name_to_qid(const char *name); - void print_altq_cmd(struct _ipfw_insn_altq *altqptr); +#else +#define NO_ALTQ +#endif /* dummynet.c */ void dummynet_list(int ac, char *av[], int show_counters); Modified: stable/10/sys/contrib/altq/altq/altq_cbq.c ============================================================================== --- stable/10/sys/contrib/altq/altq/altq_cbq.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/contrib/altq/altq/altq_cbq.c Wed Mar 12 10:45:58 2014 (r263086) @@ -54,9 +54,12 @@ #endif #include +#include #include -#include +#include +#include +#include #include #include #ifdef ALTQ3_COMPAT Modified: stable/10/sys/contrib/altq/altq/altq_cdnr.c ============================================================================== --- stable/10/sys/contrib/altq/altq/altq_cdnr.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/contrib/altq/altq/altq_cdnr.c Wed Mar 12 10:45:58 2014 (r263086) @@ -55,6 +55,7 @@ #include #endif +#include #include #ifdef ALTQ3_COMPAT #include Modified: stable/10/sys/contrib/altq/altq/altq_hfsc.c ============================================================================== --- stable/10/sys/contrib/altq/altq/altq_hfsc.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/contrib/altq/altq/altq_hfsc.c Wed Mar 12 10:45:58 2014 (r263086) @@ -66,9 +66,12 @@ #endif /* ALTQ3_COMPAT */ #include +#include #include -#include +#include +#include +#include #include #include #ifdef ALTQ3_COMPAT Modified: stable/10/sys/contrib/altq/altq/altq_priq.c ============================================================================== --- stable/10/sys/contrib/altq/altq/altq_priq.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/contrib/altq/altq/altq_priq.c Wed Mar 12 10:45:58 2014 (r263086) @@ -51,9 +51,12 @@ #include #include +#include #include -#include +#include +#include +#include #include #ifdef ALTQ3_COMPAT #include Modified: stable/10/sys/contrib/altq/altq/altq_red.c ============================================================================== --- stable/10/sys/contrib/altq/altq/altq_red.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/contrib/altq/altq/altq_red.c Wed Mar 12 10:45:58 2014 (r263086) @@ -86,6 +86,7 @@ #endif /* ALTQ3_COMPAT */ #include +#include #include #include @@ -94,7 +95,9 @@ #include #endif -#include +#include +#include +#include #include #include #ifdef ALTQ3_COMPAT Modified: stable/10/sys/contrib/altq/altq/altq_rio.c ============================================================================== --- stable/10/sys/contrib/altq/altq/altq_rio.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/contrib/altq/altq/altq_rio.c Wed Mar 12 10:45:58 2014 (r263086) @@ -81,6 +81,7 @@ #endif #include +#include #include #include @@ -89,7 +90,8 @@ #include #endif -#include +#include +#include #include #include #include Modified: stable/10/sys/contrib/altq/altq/altq_rmclass.c ============================================================================== --- stable/10/sys/contrib/altq/altq/altq_rmclass.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/contrib/altq/altq/altq_rmclass.c Wed Mar 12 10:45:58 2014 (r263086) @@ -59,12 +59,14 @@ #endif #include +#include #ifdef ALTQ3_COMPAT #include #include #include #endif +#include #include #include #include Modified: stable/10/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- stable/10/sys/contrib/altq/altq/altq_subr.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/contrib/altq/altq/altq_subr.c Wed Mar 12 10:45:58 2014 (r263086) @@ -49,6 +49,7 @@ #include #include +#include #include #include #ifdef __FreeBSD__ @@ -64,7 +65,8 @@ #include #include -#include +#include +#include #include #ifdef ALTQ3_COMPAT #include Modified: stable/10/sys/net/if_ethersubr.c ============================================================================== --- stable/10/sys/net/if_ethersubr.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/net/if_ethersubr.c Wed Mar 12 10:45:58 2014 (r263086) @@ -62,10 +62,11 @@ #include #include #include -#include #include #include +#include + #if defined(INET) || defined(INET6) #include #include Modified: stable/10/sys/net/pfvar.h ============================================================================== --- stable/10/sys/net/pfvar.h Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/net/pfvar.h Wed Mar 12 10:45:58 2014 (r263086) @@ -42,82 +42,9 @@ #include #include -#include - -#define PF_TCPS_PROXY_SRC ((TCP_NSTATES)+0) -#define PF_TCPS_PROXY_DST ((TCP_NSTATES)+1) - -#define PF_MD5_DIGEST_LENGTH 16 -#ifdef MD5_DIGEST_LENGTH -#if PF_MD5_DIGEST_LENGTH != MD5_DIGEST_LENGTH -#error -#endif -#endif - -enum { PF_INOUT, PF_IN, PF_OUT }; -enum { PF_PASS, PF_DROP, PF_SCRUB, PF_NOSCRUB, PF_NAT, PF_NONAT, - PF_BINAT, PF_NOBINAT, PF_RDR, PF_NORDR, PF_SYNPROXY_DROP, PF_DEFER }; -enum { PF_RULESET_SCRUB, PF_RULESET_FILTER, PF_RULESET_NAT, - PF_RULESET_BINAT, PF_RULESET_RDR, PF_RULESET_MAX }; -enum { PF_OP_NONE, PF_OP_IRG, PF_OP_EQ, PF_OP_NE, PF_OP_LT, - PF_OP_LE, PF_OP_GT, PF_OP_GE, PF_OP_XRG, PF_OP_RRG }; -enum { PF_DEBUG_NONE, PF_DEBUG_URGENT, PF_DEBUG_MISC, PF_DEBUG_NOISY }; -enum { PF_CHANGE_NONE, PF_CHANGE_ADD_HEAD, PF_CHANGE_ADD_TAIL, - PF_CHANGE_ADD_BEFORE, PF_CHANGE_ADD_AFTER, - PF_CHANGE_REMOVE, PF_CHANGE_GET_TICKET }; -enum { PF_GET_NONE, PF_GET_CLR_CNTR }; -enum { PF_SK_WIRE, PF_SK_STACK, PF_SK_BOTH }; - -/* - * Note about PFTM_*: real indices into pf_rule.timeout[] come before - * PFTM_MAX, special cases afterwards. See pf_state_expires(). - */ -enum { PFTM_TCP_FIRST_PACKET, PFTM_TCP_OPENING, PFTM_TCP_ESTABLISHED, - PFTM_TCP_CLOSING, PFTM_TCP_FIN_WAIT, PFTM_TCP_CLOSED, - PFTM_UDP_FIRST_PACKET, PFTM_UDP_SINGLE, PFTM_UDP_MULTIPLE, - PFTM_ICMP_FIRST_PACKET, PFTM_ICMP_ERROR_REPLY, - PFTM_OTHER_FIRST_PACKET, PFTM_OTHER_SINGLE, - PFTM_OTHER_MULTIPLE, PFTM_FRAG, PFTM_INTERVAL, - PFTM_ADAPTIVE_START, PFTM_ADAPTIVE_END, PFTM_SRC_NODE, - PFTM_TS_DIFF, PFTM_MAX, PFTM_PURGE, PFTM_UNLINKED }; - -/* PFTM default values */ -#define PFTM_TCP_FIRST_PACKET_VAL 120 /* First TCP packet */ -#define PFTM_TCP_OPENING_VAL 30 /* No response yet */ -#define PFTM_TCP_ESTABLISHED_VAL 24*60*60/* Established */ -#define PFTM_TCP_CLOSING_VAL 15 * 60 /* Half closed */ -#define PFTM_TCP_FIN_WAIT_VAL 45 /* Got both FINs */ -#define PFTM_TCP_CLOSED_VAL 90 /* Got a RST */ -#define PFTM_UDP_FIRST_PACKET_VAL 60 /* First UDP packet */ -#define PFTM_UDP_SINGLE_VAL 30 /* Unidirectional */ -#define PFTM_UDP_MULTIPLE_VAL 60 /* Bidirectional */ -#define PFTM_ICMP_FIRST_PACKET_VAL 20 /* First ICMP packet */ -#define PFTM_ICMP_ERROR_REPLY_VAL 10 /* Got error response */ -#define PFTM_OTHER_FIRST_PACKET_VAL 60 /* First packet */ -#define PFTM_OTHER_SINGLE_VAL 30 /* Unidirectional */ -#define PFTM_OTHER_MULTIPLE_VAL 60 /* Bidirectional */ -#define PFTM_FRAG_VAL 30 /* Fragment expire */ -#define PFTM_INTERVAL_VAL 10 /* Expire interval */ -#define PFTM_SRC_NODE_VAL 0 /* Source tracking */ -#define PFTM_TS_DIFF_VAL 30 /* Allowed TS diff */ - -enum { PF_NOPFROUTE, PF_FASTROUTE, PF_ROUTETO, PF_DUPTO, PF_REPLYTO }; -enum { PF_LIMIT_STATES, PF_LIMIT_SRC_NODES, PF_LIMIT_FRAGS, - PF_LIMIT_TABLE_ENTRIES, PF_LIMIT_MAX }; -#define PF_POOL_IDMASK 0x0f -enum { PF_POOL_NONE, PF_POOL_BITMASK, PF_POOL_RANDOM, - PF_POOL_SRCHASH, PF_POOL_ROUNDROBIN }; -enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE, PF_ADDR_DYNIFTL, - PF_ADDR_TABLE, PF_ADDR_URPFFAILED, - PF_ADDR_RANGE }; -#define PF_POOL_TYPEMASK 0x0f -#define PF_POOL_STICKYADDR 0x20 -#define PF_WSCALE_FLAG 0x80 -#define PF_WSCALE_MASK 0x0f - -#define PF_LOG 0x01 -#define PF_LOG_ALL 0x02 -#define PF_LOG_SOCKET_LOOKUP 0x04 +#include +#include +#include struct pf_addr { union { @@ -134,8 +61,6 @@ struct pf_addr { #define addr32 pfa.addr32 }; -#define PF_TABLE_NAME_SIZE 32 - #define PFI_AFLAG_NETWORK 0x01 #define PFI_AFLAG_BROADCAST 0x02 #define PFI_AFLAG_PEER 0x04 @@ -564,7 +489,6 @@ struct pf_rule { union pf_rule_ptr skip[PF_SKIP_COUNT]; #define PF_RULE_LABEL_SIZE 64 char label[PF_RULE_LABEL_SIZE]; -#define PF_QNAME_SIZE 64 char ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; char pqname[PF_QNAME_SIZE]; @@ -1199,43 +1123,6 @@ struct pf_pdesc { #define PF_DPORT_RANGE 0x01 /* Dest port uses range */ #define PF_RPORT_RANGE 0x02 /* RDR'ed port uses range */ -/* Reasons code for passing/dropping a packet */ -#define PFRES_MATCH 0 /* Explicit match of a rule */ -#define PFRES_BADOFF 1 /* Bad offset for pull_hdr */ -#define PFRES_FRAG 2 /* Dropping following fragment */ -#define PFRES_SHORT 3 /* Dropping short packet */ -#define PFRES_NORM 4 /* Dropping by normalizer */ -#define PFRES_MEMORY 5 /* Dropped due to lacking mem */ -#define PFRES_TS 6 /* Bad TCP Timestamp (RFC1323) */ -#define PFRES_CONGEST 7 /* Congestion (of ipintrq) */ -#define PFRES_IPOPTIONS 8 /* IP option */ -#define PFRES_PROTCKSUM 9 /* Protocol checksum invalid */ -#define PFRES_BADSTATE 10 /* State mismatch */ -#define PFRES_STATEINS 11 /* State insertion failure */ -#define PFRES_MAXSTATES 12 /* State limit */ -#define PFRES_SRCLIMIT 13 /* Source node/conn limit */ -#define PFRES_SYNPROXY 14 /* SYN proxy */ -#define PFRES_MAX 15 /* total+1 */ - -#define PFRES_NAMES { \ - "match", \ - "bad-offset", \ - "fragment", \ - "short", \ - "normalize", \ - "memory", \ - "bad-timestamp", \ - "congestion", \ - "ip-option", \ - "proto-cksum", \ - "state-mismatch", \ - "state-insert", \ - "state-limit", \ - "src-limit", \ - "synproxy", \ - NULL \ -} - /* Counters for other things we want to keep track of */ #define LCNT_STATES 0 /* states */ #define LCNT_SRCSTATES 1 /* max-src-states */ @@ -1326,69 +1213,6 @@ struct pf_status { u_int8_t pf_chksum[PF_MD5_DIGEST_LENGTH]; }; -struct cbq_opts { - u_int minburst; - u_int maxburst; - u_int pktsize; - u_int maxpktsize; - u_int ns_per_byte; - u_int maxidle; - int minidle; - u_int offtime; - int flags; -}; - -struct priq_opts { - int flags; -}; - -struct hfsc_opts { - /* real-time service curve */ - u_int rtsc_m1; /* slope of the 1st segment in bps */ - u_int rtsc_d; /* the x-projection of m1 in msec */ - u_int rtsc_m2; /* slope of the 2nd segment in bps */ - /* link-sharing service curve */ - u_int lssc_m1; - u_int lssc_d; - u_int lssc_m2; - /* upper-limit service curve */ - u_int ulsc_m1; - u_int ulsc_d; - u_int ulsc_m2; - int flags; -}; - -struct pf_altq { - char ifname[IFNAMSIZ]; - - void *altq_disc; /* discipline-specific state */ - TAILQ_ENTRY(pf_altq) entries; - - /* scheduler spec */ - u_int8_t scheduler; /* scheduler type */ - u_int16_t tbrsize; /* tokenbucket regulator size */ - u_int32_t ifbandwidth; /* interface bandwidth */ - - /* queue spec */ - char qname[PF_QNAME_SIZE]; /* queue name */ - char parent[PF_QNAME_SIZE]; /* parent name */ - u_int32_t parent_qid; /* parent queue id */ - u_int32_t bandwidth; /* queue bandwidth */ - u_int8_t priority; /* priority */ - u_int8_t local_flags; /* dynamic interface */ -#define PFALTQ_FLAG_IF_REMOVED 0x01 - - u_int16_t qlimit; /* queue size limit */ - u_int16_t flags; /* misc flags */ - union { - struct cbq_opts cbq_opts; - struct priq_opts priq_opts; - struct hfsc_opts hfsc_opts; - } pq_u; - - u_int32_t qid; /* return value */ -}; - struct pf_divert { union { struct in_addr ipv4; Modified: stable/10/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw2.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/netpfil/ipfw/ip_fw2.c Wed Mar 12 10:45:58 2014 (r263086) @@ -60,10 +60,11 @@ __FBSDID("$FreeBSD$"); #include /* for ETHERTYPE_IP */ #include #include -#include #include #include +#include + #include #include #include Modified: stable/10/sys/netpfil/pf/pf.c ============================================================================== --- stable/10/sys/netpfil/pf/pf.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/netpfil/pf/pf.c Wed Mar 12 10:45:58 2014 (r263086) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Copied and modified: stable/10/sys/netpfil/pf/pf.h (from r257215, head/sys/netpfil/pf/pf.h) ============================================================================== --- head/sys/netpfil/pf/pf.h Sun Oct 27 16:25:57 2013 (r257215, copy source) +++ stable/10/sys/netpfil/pf/pf.h Wed Mar 12 10:45:58 2014 (r263086) @@ -31,7 +31,7 @@ */ #ifndef _NET_PF_H_ -#define _NET_PFAR_H_ +#define _NET_PF_H_ #define PF_TCPS_PROXY_SRC ((TCP_NSTATES)+0) #define PF_TCPS_PROXY_DST ((TCP_NSTATES)+1) Copied: stable/10/sys/netpfil/pf/pf_altq.h (from r257215, head/sys/netpfil/pf/pf_altq.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/netpfil/pf/pf_altq.h Wed Mar 12 10:45:58 2014 (r263086, copy of r257215, head/sys/netpfil/pf/pf_altq.h) @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2001 Daniel Hartmeier + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - 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 COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDERS 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. + * + * $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ + * $FreeBSD$ + */ + +#ifndef _NET_PF_ALTQ_H_ +#define _NET_PF_ALTQ_H_ + +struct cbq_opts { + u_int minburst; + u_int maxburst; + u_int pktsize; + u_int maxpktsize; + u_int ns_per_byte; + u_int maxidle; + int minidle; + u_int offtime; + int flags; +}; + +struct priq_opts { + int flags; +}; + +struct hfsc_opts { + /* real-time service curve */ + u_int rtsc_m1; /* slope of the 1st segment in bps */ + u_int rtsc_d; /* the x-projection of m1 in msec */ + u_int rtsc_m2; /* slope of the 2nd segment in bps */ + /* link-sharing service curve */ + u_int lssc_m1; + u_int lssc_d; + u_int lssc_m2; + /* upper-limit service curve */ + u_int ulsc_m1; + u_int ulsc_d; + u_int ulsc_m2; + int flags; +}; + +struct pf_altq { + char ifname[IFNAMSIZ]; + + void *altq_disc; /* discipline-specific state */ + TAILQ_ENTRY(pf_altq) entries; + + /* scheduler spec */ + uint8_t scheduler; /* scheduler type */ + uint16_t tbrsize; /* tokenbucket regulator size */ + uint32_t ifbandwidth; /* interface bandwidth */ + + /* queue spec */ + char qname[PF_QNAME_SIZE]; /* queue name */ + char parent[PF_QNAME_SIZE]; /* parent name */ + uint32_t parent_qid; /* parent queue id */ + uint32_t bandwidth; /* queue bandwidth */ + uint8_t priority; /* priority */ + uint8_t local_flags; /* dynamic interface */ +#define PFALTQ_FLAG_IF_REMOVED 0x01 + + uint16_t qlimit; /* queue size limit */ + uint16_t flags; /* misc flags */ + union { + struct cbq_opts cbq_opts; + struct priq_opts priq_opts; + struct hfsc_opts hfsc_opts; + } pq_u; + + uint32_t qid; /* return value */ +}; + +#endif /* _NET_PF_ALTQ_H_ */ Modified: stable/10/sys/netpfil/pf/pf_lb.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_lb.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/netpfil/pf/pf_lb.c Wed Mar 12 10:45:58 2014 (r263086) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x Copied: stable/10/sys/netpfil/pf/pf_mtag.h (from r257215, head/sys/netpfil/pf/pf_mtag.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/netpfil/pf/pf_mtag.h Wed Mar 12 10:45:58 2014 (r263086, copy of r257215, head/sys/netpfil/pf/pf_mtag.h) @@ -0,0 +1,62 @@ +/* $FreeBSD$ */ +/* + * Copyright (c) 2001 Daniel Hartmeier + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - 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 COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDERS 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. + * + */ + +#ifndef _NET_PF_MTAG_H_ +#define _NET_PF_MTAG_H_ + +#ifdef _KERNEL + +#define PF_TAG_GENERATED 0x01 +#define PF_TAG_FRAGCACHE 0x02 +#define PF_TAG_TRANSLATE_LOCALHOST 0x04 +#define PF_PACKET_LOOPED 0x08 +#define PF_FASTFWD_OURS_PRESENT 0x10 + +struct pf_mtag { + void *hdr; /* saved hdr pos in mbuf, for ECN */ + u_int32_t qid; /* queue id */ + u_int16_t tag; /* tag id */ + u_int8_t flags; + u_int8_t routed; +}; + +static __inline struct pf_mtag * +pf_find_mtag(struct mbuf *m) +{ + struct m_tag *mtag; + + if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) == NULL) + return (NULL); + + return ((struct pf_mtag *)(mtag + 1)); +} +#endif /* _KERNEL */ +#endif /* _NET_PF_MTAG_H_ */ Modified: stable/10/sys/netpfil/pf/pf_norm.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_norm.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/sys/netpfil/pf/pf_norm.c Wed Mar 12 10:45:58 2014 (r263086) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/usr.bin/kdump/Makefile ============================================================================== --- stable/10/usr.bin/kdump/Makefile Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/usr.bin/kdump/Makefile Wed Mar 12 10:45:58 2014 (r263086) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + .if (${MACHINE_ARCH} == "amd64") SFX= 32 .endif @@ -12,6 +14,10 @@ SRCS= kdump_subr.c kdump.c ioctl.c subr DPSRCS= kdump_subr.h CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I. +.if ${MK_PF} != "no" +CFLAGS+=-DPF +.endif + .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" SRCS+= linux_syscalls.c .endif Modified: stable/10/usr.bin/kdump/mkioctls ============================================================================== --- stable/10/usr.bin/kdump/mkioctls Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/usr.bin/kdump/mkioctls Wed Mar 12 10:45:58 2014 (r263086) @@ -21,7 +21,8 @@ LC_ALL=C; export LC_ALL # XXX should we use an ANSI cpp? ioctl_includes=$( cd $includedir - find -H -s * -name '*.h' | grep -v '.*disk.*\.h' | \ + find -H -s * -name '*.h' | \ + egrep -v '(.*disk.*|net/pfvar|net/if_pfsync)\.h' | \ xargs egrep -l \ '^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | awk '{printf("#include <%s>\\n", $1)}' @@ -54,7 +55,10 @@ BEGIN { print "#include " print "#include " print "#include " + print "#ifdef PF" print "#include " + print "#include " + print "#endif" print "#include " print "#include " print "#include " Modified: stable/10/usr.bin/netstat/Makefile ============================================================================== --- stable/10/usr.bin/netstat/Makefile Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/usr.bin/netstat/Makefile Wed Mar 12 10:45:58 2014 (r263086) @@ -27,6 +27,10 @@ CFLAGS+=-DINET6 CFLAGS+=-DSDP .endif +.if ${MK_PF} != "no" +CFLAGS+=-DPF +.endif + BINGRP= kmem BINMODE=2555 DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBUTIL} Modified: stable/10/usr.bin/netstat/if.c ============================================================================== --- stable/10/usr.bin/netstat/if.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/usr.bin/netstat/if.c Wed Mar 12 10:45:58 2014 (r263086) @@ -49,13 +49,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include #include #include #include +#ifdef PF +#include +#include +#endif #include #include @@ -81,6 +83,7 @@ static void sidewaysintpr(int); static char addr_buf[NI_MAXHOST]; /* for getnameinfo() */ #endif +#ifdef PF static const char* pfsyncacts[] = { /* PFSYNC_ACT_CLR */ "clear all request", /* PFSYNC_ACT_INS */ "state insert", @@ -155,6 +158,7 @@ pfsync_stats(u_long off, const char *nam p(pfsyncs_oerrors, "\t\t%ju send error%s\n"); #undef p } +#endif /* PF */ /* * Display a formatted value, or a '-' in the same space. Modified: stable/10/usr.bin/netstat/main.c ============================================================================== --- stable/10/usr.bin/netstat/main.c Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/usr.bin/netstat/main.c Wed Mar 12 10:45:58 2014 (r263086) @@ -214,8 +214,10 @@ struct protox { pim_stats, NULL, "pim", 1, IPPROTO_PIM }, { -1, N_CARPSTAT, 1, NULL, carp_stats, NULL, "carp", 1, 0 }, +#ifdef PF { -1, N_PFSYNCSTAT, 1, NULL, pfsync_stats, NULL, "pfsync", 1, 0 }, +#endif { -1, N_ARPSTAT, 1, NULL, arp_stats, NULL, "arp", 1, 0 }, { -1, -1, 0, NULL, Modified: stable/10/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/Makefile Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/usr.sbin/bsnmpd/modules/Makefile Wed Mar 12 10:45:58 2014 (r263086) @@ -13,12 +13,15 @@ SUBDIR= ${_snmp_atm} \ snmp_hast \ snmp_hostres \ snmp_mibII \ - snmp_pf \ snmp_target \ snmp_usm \ snmp_vacm \ snmp_wlan +.if ${MK_PF} != "no" +SUBDIR+=snmp_pf +.endif + .if ${MK_NETGRAPH_SUPPORT} != "no" SUBDIR+=snmp_netgraph .endif Modified: stable/10/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- stable/10/usr.sbin/tcpdump/tcpdump/Makefile Wed Mar 12 10:45:22 2014 (r263085) +++ stable/10/usr.sbin/tcpdump/tcpdump/Makefile Wed Mar 12 10:45:58 2014 (r263086) @@ -89,7 +89,6 @@ SRCS= addrtoname.c \ print-olsr.c \ print-ospf.c \ print-otv.c \ - print-pfsync.c \ print-pgm.c \ print-pim.c \ print-ppi.c \ @@ -171,7 +170,8 @@ CFLAGS+= -DHAVE_LIBCRYPTO -DHAVE_OPENSSL .endif .if ${MK_PF} != "no" -SRCS+= print-pflog.c +SRCS+= print-pflog.c \ + print-pfsync.c CFLAGS+= -DHAVE_NET_PFVAR_H .endif From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 12 11:03:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E4786206; Wed, 12 Mar 2014 11:03:47 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ABA38C18; Wed, 12 Mar 2014 11:03:46 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id f8so2171204wiw.0 for ; Wed, 12 Mar 2014 04:03: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=aV/VZ+lotF9oDxho4N/OdJEfJuXnWe0GN1JJlUrp/FI=; b=ws0XJtvDzpfd0wgMewCFHcfGgD2gErAIHW3tO1beVmNoP2sMAnJNf14KYb20hvzqf7 o3uj5WE22KeP/RpU8UTE0Iv7fWHTD8JXu/qGieFFw72lHhwGL2PqzsWGz2ePA1gYPQ+M 6NjF7JuwEdJzfqPIF04HLDn7CNaFiUvaJnkf00btp76ycXT0xP53/QnvHi2dw/Er4aBo LI6I90Po0HMpCbajzcc9DwrIgq7lZQTANwPTw2So5ZrEJjtmY8Z0TdvE65I35+oDvwVy MoiZ2D2dAlAXwA5fGZzM4JEX5Iw0hYuz+q7+jCZinhV04gBaSosGzD4KXsTz0B+QE8me 09MA== MIME-Version: 1.0 X-Received: by 10.194.108.162 with SMTP id hl2mr52140wjb.84.1394622225063; Wed, 12 Mar 2014 04:03:45 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.217.140.73 with HTTP; Wed, 12 Mar 2014 04:03:45 -0700 (PDT) In-Reply-To: <201403121045.s2CAjxnX025719@svn.freebsd.org> References: <201403121045.s2CAjxnX025719@svn.freebsd.org> Date: Wed, 12 Mar 2014 15:03:45 +0400 X-Google-Sender-Auth: lz5SXLg0houWUv259JPWf6BHQys Message-ID: Subject: Re: svn commit: r263086 - in stable/10: contrib/libpcap contrib/tcpdump etc/mtree include sbin/ifconfig sbin/ipfw sys/contrib/altq/altq sys/net sys/netpfil/ipfw sys/netpfil/pf usr.bin/kdump usr.bin/net... From: Sergey Kandaurov To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 11:03:48 -0000 On 12 March 2014 14:45, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Mar 12 10:45:58 2014 > New Revision: 263086 > URL: http://svnweb.freebsd.org/changeset/base/263086 > > Log: > Bulk sync of pf changes from head, in attempt to fixup broken build I > made in r263029. > > Merge r257186,257215,257349,259736,261797. > > These changesets split pfvar.h into several smaller headers and make > userland utilities to include only some of them. > Unfortunately, this doesn't fix build for me. You probably want this change: http://svnweb.freebsd.org/base/head/sys/sys/counter.h?r1=253082&r2=256514 (Note, the revision was partially reverted in head.) -- wbr, pluknet From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 12 11:09:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C4E08491; Wed, 12 Mar 2014 11:09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1995C61; Wed, 12 Mar 2014 11:09: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 s2CB9HPv034236; Wed, 12 Mar 2014 11:09:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CB9HnA034235; Wed, 12 Mar 2014 11:09:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403121109.s2CB9HnA034235@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 12 Mar 2014 11:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263088 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 11:09:17 -0000 Author: glebius Date: Wed Mar 12 11:09:17 2014 New Revision: 263088 URL: http://svnweb.freebsd.org/changeset/base/263088 Log: Merge r256514: - While we are spreading the counter(9) across network stack, more userland tools would need to know about the counter_u64_t type. Allow to include sys/counter.h from userspace. Modified: stable/10/sys/sys/counter.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/counter.h ============================================================================== --- stable/10/sys/sys/counter.h Wed Mar 12 10:59:51 2014 (r263087) +++ stable/10/sys/sys/counter.h Wed Mar 12 11:09:17 2014 (r263088) @@ -31,6 +31,7 @@ typedef uint64_t *counter_u64_t; +#ifdef _KERNEL #include counter_u64_t counter_u64_alloc(int); @@ -58,4 +59,5 @@ uint64_t counter_u64_fetch(counter_u64_t for (int i = 0; i < (n); i++) \ counter_u64_zero((a)[i]); \ } while (0) +#endif /* _KERNEL */ #endif /* ! __SYS_COUNTER_H__ */ From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 13 01:12:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CAD2E88E; Thu, 13 Mar 2014 01:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B69A2D66; Thu, 13 Mar 2014 01:12: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 s2D1CRMa002177; Thu, 13 Mar 2014 01:12:27 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2D1CR0P002176; Thu, 13 Mar 2014 01:12:27 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403130112.s2D1CR0P002176@svn.freebsd.org> From: Bryan Drewery Date: Thu, 13 Mar 2014 01:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263098 - stable/10/share/termcap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 01:12:27 -0000 Author: bdrewery Date: Thu Mar 13 01:12:27 2014 New Revision: 263098 URL: http://svnweb.freebsd.org/changeset/base/263098 Log: MFC r262220: Add missing Save Cursor support for VT520 PR: conf/174937 Modified: stable/10/share/termcap/termcap.src Directory Properties: stable/10/ (props changed) Modified: stable/10/share/termcap/termcap.src ============================================================================== --- stable/10/share/termcap/termcap.src Wed Mar 12 19:52:04 2014 (r263097) +++ stable/10/share/termcap/termcap.src Thu Mar 13 01:12:27 2014 (r263098) @@ -2729,7 +2729,7 @@ vt520|DEC VT520 :\ :kb=\b:kd=\E[B:ke=\E>:kl=\E[D:\ :kr=\E[C:ks=\E=:ku=\E[A:nd=\E[C:\ :rc=\E8:rf=/usr/lib/tabset/vt100:\ - :se=\E[m:so=\E[7m:\ + :sc=\E7:se=\E[m:so=\E[7m:\ :sr=\EM:ue=\E[m:up=\E[A:us=\E[4m:nl=\E[B:ko=do,nd,up: # vt520nam|vt520-nam|v520n|DEC VT520 with no automargins:\ From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 13 03:42:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 807CD6AB; Thu, 13 Mar 2014 03:42: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C028BFC; Thu, 13 Mar 2014 03:42: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 s2D3g1cq063517; Thu, 13 Mar 2014 03:42:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2D3g0E0063510; Thu, 13 Mar 2014 03:42:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403130342.s2D3g0E0063510@svn.freebsd.org> From: Eitan Adler Date: Thu, 13 Mar 2014 03:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263101 - in stable/10: sys/compat/linprocfs usr.bin/makewhatis X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 03:42:01 -0000 Author: eadler Date: Thu Mar 13 03:42:00 2014 New Revision: 263101 URL: http://svnweb.freebsd.org/changeset/base/263101 Log: MFC r262539: linprocfs: add support for /sys/kernel/random/uuid PR: kern/186187 Modified: stable/10/sys/compat/linprocfs/linprocfs.c stable/10/usr.bin/makewhatis/makewhatis.1 stable/10/usr.bin/makewhatis/makewhatis.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Thu Mar 13 01:16:51 2014 (r263100) +++ stable/10/sys/compat/linprocfs/linprocfs.c Thu Mar 13 03:42:00 2014 (r263101) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1336,6 +1337,22 @@ linprocfs_dofdescfs(PFS_FILL_ARGS) return (0); } + +/* + * Filler function for proc/sys/kernel/random/uuid + */ +static int +linprocfs_douuid(PFS_FILL_ARGS) +{ + struct uuid uuid; + + kern_uuidgen(&uuid, 1); + sbuf_printf_uuid(sb, &uuid); + sbuf_printf(sb, "\n"); + return(0); +} + + /* * Constructor */ @@ -1435,6 +1452,11 @@ linprocfs_init(PFS_INIT_ARGS) pfs_create_file(dir, "sem", &linprocfs_dosem, NULL, NULL, NULL, PFS_RD); + /* /proc/sys/kernel/random/... */ + dir = pfs_create_dir(dir, "random", NULL, NULL, NULL, 0); + pfs_create_file(dir, "uuid", &linprocfs_douuid, + NULL, NULL, NULL, PFS_RD); + return (0); } Modified: stable/10/usr.bin/makewhatis/makewhatis.1 ============================================================================== --- stable/10/usr.bin/makewhatis/makewhatis.1 Thu Mar 13 01:16:51 2014 (r263100) +++ stable/10/usr.bin/makewhatis/makewhatis.1 Thu Mar 13 03:42:00 2014 (r263101) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 3, 2005 -.Dt MAKEWHATIS 1 +.Dd December 8, 2013 +.Dt MAKEWHATIS 8 .Os .Sh NAME .Nm makewhatis -.Nd "create whatis database" +.Nd create whatis database .Sh SYNOPSIS .Nm .Op Fl a @@ -98,9 +98,6 @@ option is used. .It Ev MACHINE If set, its value is used to override the current machine type when searching machine specific subdirectories. -.It Ev MACHINE_ARCH -If set, its value is used to override the current -architecture when searching architecture specific subdirectories. .It Ev MANPATH Determines the set of directories to be processed if none are given on the command line. @@ -133,4 +130,6 @@ program was originally written in Perl a The current version of .Nm was rewritten in C by -.An John Rochester . +.An John Rochester +with additional contributions by +.An Franco Fichtner Aq Mt franco@lastsummer.de . Modified: stable/10/usr.bin/makewhatis/makewhatis.c ============================================================================== --- stable/10/usr.bin/makewhatis/makewhatis.c Thu Mar 13 01:16:51 2014 (r263100) +++ stable/10/usr.bin/makewhatis/makewhatis.c Thu Mar 13 03:42:00 2014 (r263101) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2002 John Rochester + * Copyright (c) 2013 Franco Fichtner * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,21 +25,19 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ -#include -__FBSDID("$FreeBSD$"); - +#include #include -#include #include #include -#include +#include #include #include #include -#include #include #include #include @@ -52,16 +51,56 @@ __FBSDID("$FreeBSD$"); static char blank[] = ""; /* - * Information collected about each man page in a section. + * Information collected about each man page alias. + */ +struct page_alias { + RB_ENTRY(page_alias) entry; + char *filename; + char *name; + char *suffix; + int gzipped; +}; + +/* + * Information collected about each unique man page. */ struct page_info { - char * filename; - char * name; - char * suffix; - int gzipped; - ino_t inode; + RB_HEAD(page_alias_tree, page_alias) head; + RB_ENTRY(page_info) entry; + ino_t inode; }; +static RB_HEAD(page_info_tree, page_info) page_head = RB_INITIALIZER(&page_head); + +/* + * Sorts page info by inode number. + */ +static int +infosort(const struct page_info *a, const struct page_info *b) +{ + return (memcmp(&a->inode, &b->inode, sizeof(a->inode))); +} + +RB_PROTOTYPE(page_info_tree, page_info, entry, infosort); +RB_GENERATE(page_info_tree, page_info, entry, infosort); + +/* + * Sorts page alias first by suffix, then name. + */ +static int +aliassort(const struct page_alias *a, const struct page_alias *b) +{ + int ret = strcmp(a->suffix, b->suffix); + if (ret) { + return (ret); + } + + return (strcmp(a->name, b->name)); +} + +RB_PROTOTYPE(page_alias_tree, page_alias, entry, aliassort); +RB_GENERATE(page_alias_tree, page_alias, entry, aliassort); + /* * An entry kept for each visited directory. */ @@ -100,7 +139,7 @@ static const char *whatis_name="whatis"; static char *common_output; /* -o option: the single output file */ static char *locale; /* user's locale if -L is used */ static char *lang_locale; /* short form of locale */ -static const char *machine, *machine_arch; +static const char *machine; static int exit_code; /* exit code to use when finished */ static SLIST_HEAD(, visited_dir) visited_dirs = @@ -132,62 +171,66 @@ static char mdoc_commands[] = "ArDvErEvF static void free_page_info(struct page_info *info) { - free(info->filename); - free(info->name); - free(info->suffix); + struct page_alias *alias; + + while ((alias = RB_ROOT(&info->head))) { + RB_REMOVE(page_alias_tree, &info->head, alias); + free(alias->filename); + free(alias->suffix); + free(alias->name); + free(alias); + } + free(info); } /* - * Allocates and fills in a new struct page_info given the - * name of the man section directory and the dirent of the file. - * If the file is not a man page, returns NULL. + * Allocates and fills in a new struct page_alias given the + * full file name of the man page and its dirent. + * If the file is not a man page, nothing is added. */ -static struct page_info * -new_page_info(char *dir, struct dirent *dirent) +static void +new_page_alias(struct page_info *info, char *filename, struct dirent *dirent) { - struct page_info *info; - int basename_length; + int gzipped, basename_length; + struct page_alias *alias; char *suffix; - struct stat st; - info = (struct page_info *) malloc(sizeof(struct page_info)); - if (info == NULL) - err(1, "malloc"); basename_length = strlen(dirent->d_name); suffix = &dirent->d_name[basename_length]; - asprintf(&info->filename, "%s/%s", dir, dirent->d_name); - if ((info->gzipped = basename_length >= 4 && strcmp(&dirent->d_name[basename_length - 3], ".gz") == 0)) { + + gzipped = basename_length >= 4 && + strcmp(&dirent->d_name[basename_length - 3], ".gz") == 0; + if (gzipped) { suffix -= 3; *suffix = '\0'; } + for (;;) { if (--suffix == dirent->d_name || !isalnum(*suffix)) { - if (*suffix == '.') + if (*suffix == '.') { break; - if (verbose) - warnx("%s: invalid man page name", info->filename); - free(info->filename); - free(info); - return NULL; + } + if (verbose) { + warnx("%s: invalid man page name", filename); + } + return; } } + *suffix++ = '\0'; - info->name = strdup(dirent->d_name); - info->suffix = strdup(suffix); - if (stat(info->filename, &st) < 0) { - warn("%s", info->filename); - free_page_info(info); - return NULL; - } - if (!S_ISREG(st.st_mode)) { - if (verbose && !S_ISDIR(st.st_mode)) - warnx("%s: not a regular file", info->filename); - free_page_info(info); - return NULL; + + alias = malloc(sizeof(*alias)); + if (alias == NULL) { + err(1, "malloc"); } - info->inode = st.st_ino; - return info; + + alias->name = strdup(dirent->d_name); /* XXX unsafe */ + alias->filename = strdup(filename); /* XXX unsafe */ + alias->suffix = strdup(suffix); /* XXX unsafe */ + alias->gzipped = gzipped; + + RB_INSERT(page_alias_tree, &info->head, alias); } /* @@ -206,10 +249,10 @@ static struct sbuf * new_sbuf(void) { struct sbuf *sbuf = (struct sbuf *) malloc(sizeof(struct sbuf)); - sbuf->content = (char *) malloc(LINE_ALLOC); + sbuf->content = malloc(LINE_ALLOC); sbuf->last = sbuf->content + LINE_ALLOC - 1; sbuf_clear(sbuf); - return sbuf; + return(sbuf); } /* @@ -227,7 +270,7 @@ sbuf_need(struct sbuf *sbuf, int nchars) size *= 2; cntsize = sbuf->end - sbuf->content; - new_content = (char *)malloc(size); + new_content = malloc(size); memcpy(new_content, sbuf->content, cntsize); free(sbuf->content); sbuf->content = new_content; @@ -288,29 +331,7 @@ static char * sbuf_content(struct sbuf *sbuf) { *sbuf->end = '\0'; - return sbuf->content; -} - -/* - * Returns true if no man page exists in the directory with - * any of the names in the StringList. - */ -static int -no_page_exists(char *dir, StringList *names, char *suffix) -{ - char path[MAXPATHLEN]; - size_t i; - - for (i = 0; i < names->sl_cur; i++) { - snprintf(path, sizeof path, "%s/%s.%s.gz", dir, names->sl_str[i], suffix); - if (access(path, F_OK) < 0) { - path[strlen(path) - 3] = '\0'; - if (access(path, F_OK) < 0) - continue; - } - return 0; - } - return 1; + return(sbuf->content); } static void @@ -337,7 +358,7 @@ open_output(char *name) if (output == NULL) { warn("%s", name); exit_code = 1; - return NULL; + return(NULL); } while (fgets(line, sizeof line, output) != NULL) { line[strlen(line) - 1] = '\0'; @@ -352,15 +373,15 @@ open_output(char *name) if (output == NULL) { warn("%s", name); exit_code = 1; - return NULL; + return(NULL); } - return output; + return(output); } static int linesort(const void *a, const void *b) { - return strcmp((*(const char * const *)a), (*(const char * const *)b)); + return(strcmp((*(const char * const *)a), (*(const char * const *)b))); } /* @@ -372,7 +393,8 @@ finish_output(FILE *output, char *name) size_t i; char *prev = NULL; - qsort(whatis_lines->sl_str, whatis_lines->sl_cur, sizeof(char *), linesort); + qsort(whatis_lines->sl_str, whatis_lines->sl_cur, sizeof(char *), + linesort); for (i = 0; i < whatis_lines->sl_cur; i++) { char *line = whatis_lines->sl_str[i]; if (i > 0 && strcmp(line, prev) == 0) @@ -395,7 +417,7 @@ open_whatis(char *mandir) char filename[MAXPATHLEN]; snprintf(filename, sizeof filename, "%s/%s", mandir, whatis_name); - return open_output(filename); + return(open_output(filename)); } static void @@ -419,20 +441,20 @@ already_visited(char *dir) if (stat(dir, &st) < 0) { warn("%s", dir); exit_code = 1; - return 1; + return(1); } SLIST_FOREACH(visit, &visited_dirs, next) { if (visit->inode == st.st_ino && visit->device == st.st_dev) { warnx("already visited %s", dir); - return 1; + return(1); } } visit = (struct visited_dir *) malloc(sizeof(struct visited_dir)); visit->device = st.st_dev; visit->inode = st.st_ino; SLIST_INSERT_HEAD(&visited_dirs, visit, next); - return 0; + return(0); } /* @@ -446,7 +468,7 @@ trim_rhs(char *str) while (--rhs > str && isspace(*rhs)) ; *++rhs = '\0'; - return rhs; + return(rhs); } /* @@ -457,7 +479,7 @@ skip_spaces(char *s) { while (*s != '\0' && isspace(*s)) s++; - return s; + return(s); } /* @@ -467,10 +489,10 @@ static int only_digits(char *line) { if (!isdigit(*line++)) - return 0; + return(0); while (isdigit(*line)) line++; - return *line == '\0'; + return(*line == '\0'); } /* @@ -487,7 +509,7 @@ name_section_line(char *line, const char const char **title; if (strncmp(line, section_start, 3) != 0) - return 0; + return(0); line = skip_spaces(line + 3); rhs = trim_rhs(line); if (*line == '"') { @@ -497,8 +519,8 @@ name_section_line(char *line, const char } for (title = name_section_titles; *title != NULL; title++) if (strcmp(*title, line) == 0) - return 1; - return 0; + return(1); + return(0); } /* @@ -518,7 +540,7 @@ de_nroff_copy(char *from, char *to, int switch (*++from) { case '(': if (strncmp(&from[1], "em", 2) == 0 || - strncmp(&from[1], "mi", 2) == 0) { + strncmp(&from[1], "mi", 2) == 0) { from += 3; continue; } @@ -534,7 +556,8 @@ de_nroff_copy(char *from, char *to, int if (*++from == '(') from += 3; else if (*from == '[') { - while (*++from != ']' && from < from_end); + while (*++from != ']' && from < from_end) + ; from++; } else from++; @@ -547,7 +570,7 @@ de_nroff_copy(char *from, char *to, int } *to++ = *from++; } - return to; + return(to); } /* @@ -594,6 +617,38 @@ process_man_line(char *line) } } +struct mdoc_text { + const char *mdoc; + const char *text; +}; + +static int +process_mdoc_macro(char *line) +{ + static const struct mdoc_text list[] = { + { ".At", "AT&T UNIX" }, + { ".Bsx", "BSD/OS" }, + { ".Bx", "BSD" }, + { ".Dx", "DragonFly" }, + { ".Fx", "FreeBSD" }, + { ".Nx", "NetBSD" }, + { ".Ox", "OpenBSD" }, + { ".Ux", "UNIX" }, + }; + unsigned int i; + + for (i = 0; i < sizeof(list) / sizeof(list[0]); ++i) { + if (!strcmp(line, list[i].mdoc)) { + sbuf_append(whatis_proto, list[i].text, + strlen(list[i].text)); + sbuf_append(whatis_proto, " ", 1); + return (1); + } + } + + return (0); +} + /* * Processes a new-style mdoc(7) line. */ @@ -613,6 +668,9 @@ process_mdoc_line(char *line) sbuf_append(whatis_proto, " ", 1); return; } + if (process_mdoc_macro(line)) { + return; + } xref = strncmp(line, ".Xr", 3) == 0; line += 3; while ((line = skip_spaces(line)) < line_end) { @@ -663,27 +721,6 @@ process_mdoc_line(char *line) sbuf_append(whatis_proto, " ", 1); } -/* - * Collects a list of comma-separated names from the text. - */ -static void -collect_names(StringList *names, char *text) -{ - char *arg; - - for (;;) { - arg = text; - text = strchr(text, ','); - if (text != NULL) - *text++ = '\0'; - sl_add(names, arg); - if (text == NULL) - return; - if (*text == ' ') - text++; - } -} - enum { STATE_UNKNOWN, STATE_MANSTYLE, STATE_MDOCNAME, STATE_MDOCDESC }; /* @@ -691,25 +728,33 @@ enum { STATE_UNKNOWN, STATE_MANSTYLE, ST * to whatis_lines. */ static void -process_page(struct page_info *page, char *section_dir) +process_page(struct page_info *info) { - gzFile in; - char buffer[4096]; - char *line; - StringList *names; - char *descr; int state = STATE_UNKNOWN; - size_t i; + struct page_alias *alias; + char *line, *descr; + char buffer[4096]; + gzFile in; + + /* + * Only read the page once for each inode. It's + * safe to assume that page->list is set. + */ + alias = RB_MIN(page_alias_tree, &info->head); + + if (verbose) { + fprintf(stderr, "\treading %s\n", alias->filename); + } sbuf_clear(whatis_proto); - if ((in = gzopen(page->filename, "r")) == NULL) { - warn("%s", page->filename); + if ((in = gzopen(alias->filename, "r")) == NULL) { + warn("%s", alias->filename); exit_code = 1; return; } - while (gzgets(in, buffer, sizeof buffer) != NULL) { + while (gzgets(in, buffer, sizeof(buffer)) != NULL) { line = buffer; - if (strncmp(line, ".\\\"", 3) == 0) /* ignore comments */ + if (strncmp(line, ".\\\"", 3) == 0) /* ignore comments */ continue; switch (state) { /* @@ -779,7 +824,9 @@ process_page(struct page_info *page, cha descr = strchr(line, ' '); if (descr == NULL) { if (verbose) - fprintf(stderr, " ignoring junk description \"%s\"\n", line); + fprintf(stderr, + "\tignoring junk description \"%s\"\n", + line); return; } *descr++ = '\0'; @@ -787,19 +834,16 @@ process_page(struct page_info *page, cha *descr = '\0'; descr += 3; } - names = sl_init(); - collect_names(names, line); sbuf_clear(whatis_final); - if (!sl_find(names, page->name) && no_page_exists(section_dir, names, page->suffix)) { + RB_FOREACH(alias, page_alias_tree, &info->head) { /* - * Add the page name since that's the only thing that - * man(1) will find. + * This won't append names stored in `line'. + * The reason for that is that we cannot be sure + * which section they belong to unless we have + * a real alias (via MLINKS) in this list. */ - add_whatis_name(page->name, page->suffix); + add_whatis_name(alias->name, alias->suffix); } - for (i = 0; i < names->sl_cur; i++) - add_whatis_name(names->sl_str[i], page->suffix); - sl_free(names, 0); sbuf_retract(whatis_final, 2); /* remove last ", " */ while (sbuf_length(whatis_final) < indent) sbuf_append(whatis_final, " ", 1); @@ -809,33 +853,19 @@ process_page(struct page_info *page, cha } /* - * Sorts pages first by inode number, then by name. - */ -static int -pagesort(const void *a, const void *b) -{ - const struct page_info *p1 = *(struct page_info * const *) a; - const struct page_info *p2 = *(struct page_info * const *) b; - if (p1->inode == p2->inode) - return strcmp(p1->name, p2->name); - return p1->inode - p2->inode; -} - -/* * Processes a single man section. */ static void process_section(char *section_dir) { struct dirent **entries; + struct page_info *info; int nentries; - struct page_info **pages; - int npages = 0; int i; - ino_t prev_inode = 0; - if (verbose) + if (verbose) { fprintf(stderr, " %s\n", section_dir); + } /* * scan the man section directory for pages @@ -846,33 +876,55 @@ process_section(char *section_dir) exit_code = 1; return; } + /* * collect information about man pages */ - pages = (struct page_info **) calloc(nentries, sizeof(struct page_info *)); for (i = 0; i < nentries; i++) { - struct page_info *info = new_page_info(section_dir, entries[i]); - if (info != NULL) - pages[npages++] = info; + struct page_info ref; + char *filename; + struct stat st; + + if (asprintf(&filename, "%s/%s", section_dir, + entries[i]->d_name) < 0) { + err(1, "malloc"); + } + + if (stat(filename, &st) < 0) { + warn("%s", filename); + goto process_section_next; + } + + if (!S_ISREG(st.st_mode)) { + if (verbose && !S_ISDIR(st.st_mode)) + warnx("%s: not a regular file", filename); + goto process_section_next; + } + + ref.inode = st.st_ino; + + info = RB_FIND(page_info_tree, &page_head, &ref); + if (info == NULL) { + info = malloc(sizeof(*info)); + if (info == NULL) { + err(1, "malloc"); + } + + bzero(info, sizeof(*info)); + info->inode = st.st_ino; + RB_INIT(&info->head); + + RB_INSERT(page_info_tree, &page_head, info); + } + + new_page_alias(info, filename, entries[i]); + +process_section_next: + free(entries[i]); + free(filename); } free(entries); - qsort(pages, npages, sizeof(struct page_info *), pagesort); - /* - * process each unique page - */ - for (i = 0; i < npages; i++) { - struct page_info *page = pages[i]; - if (page->inode != prev_inode) { - prev_inode = page->inode; - if (verbose) - fprintf(stderr, " reading %s\n", page->filename); - process_page(page, section_dir); - } else if (verbose) - fprintf(stderr, " skipping %s, duplicate\n", page->filename); - free_page_info(page); - } - free(pages); } /* @@ -884,12 +936,12 @@ select_sections(const struct dirent *ent const char *p = &entry->d_name[3]; if (strncmp(entry->d_name, "man", 3) != 0) - return 0; + return(0); while (*p != '\0') { if (!isalnum(*p++)) - return 0; + return(0); } - return 1; + return(1); } /* @@ -900,6 +952,7 @@ static void process_mandir(char *dir_name) { struct dirent **entries; + struct page_info *info; int nsections; FILE *fp = NULL; int i; @@ -919,21 +972,26 @@ process_mandir(char *dir_name) return; for (i = 0; i < nsections; i++) { char section_dir[MAXPATHLEN]; - snprintf(section_dir, sizeof section_dir, "%s/%s", dir_name, entries[i]->d_name); + snprintf(section_dir, sizeof section_dir, "%s/%s", dir_name, + entries[i]->d_name); process_section(section_dir); snprintf(section_dir, sizeof section_dir, "%s/%s/%s", dir_name, - entries[i]->d_name, machine); + entries[i]->d_name, machine); if (stat(section_dir, &st) == 0 && S_ISDIR(st.st_mode)) process_section(section_dir); - if (strcmp(machine_arch, machine) != 0) { - snprintf(section_dir, sizeof section_dir, "%s/%s/%s", - dir_name, entries[i]->d_name, machine_arch); - if (stat(section_dir, &st) == 0 && S_ISDIR(st.st_mode)) - process_section(section_dir); - } free(entries[i]); } free(entries); + + /* + * process and free all pages + */ + while ((info = RB_ROOT(&page_head))) { + RB_REMOVE(page_info_tree, &page_head, info); + process_page(info); + free_page_info(info); + } + if (common_output == NULL) finish_whatis(fp, dir_name); } @@ -1003,7 +1061,9 @@ main(int argc, char **argv) char *sep = strchr(locale, '_'); if (sep != NULL && isupper(sep[1]) && isupper(sep[2])) { - asprintf(&lang_locale, "%.*s%s", (int)(ptrdiff_t)(sep - locale), locale, &sep[3]); + asprintf(&lang_locale, "%.*s%s", + (int)(sep - locale), + locale, &sep[3]); } } break; @@ -1021,16 +1081,8 @@ main(int argc, char **argv) whatis_proto = new_sbuf(); whatis_final = new_sbuf(); - if ((machine = getenv("MACHINE")) == NULL) { - static struct utsname utsname; - - if (uname(&utsname) == -1) - err(1, "uname"); - machine = utsname.machine; - } - - if ((machine_arch = getenv("MACHINE_ARCH")) == NULL) - machine_arch = MACHINE_ARCH; + if ((machine = getenv("MACHINE")) == NULL) + machine = MACHINE; if (common_output != NULL && (fp = open_output(common_output)) == NULL) err(1, "%s", common_output); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 13 04:25:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B6208F4A; Thu, 13 Mar 2014 04:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A1F56F09; Thu, 13 Mar 2014 04:25: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 s2D4PxpM080436; Thu, 13 Mar 2014 04:25:59 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2D4Px1J080434; Thu, 13 Mar 2014 04:25:59 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403130425.s2D4Px1J080434@svn.freebsd.org> From: Eitan Adler Date: Thu, 13 Mar 2014 04:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263104 - stable/10/usr.bin/makewhatis X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 04:25:59 -0000 Author: eadler Date: Thu Mar 13 04:25:59 2014 New Revision: 263104 URL: http://svnweb.freebsd.org/changeset/base/263104 Log: MFC r262540: r262540 | eadler | 2014-02-26 19:52:34 -0500 (Wed, 26 Feb 2014) | 2 lines I had some unrelated (wrong) changes to makewhatis. Undo them. Modified: stable/10/usr.bin/makewhatis/makewhatis.1 stable/10/usr.bin/makewhatis/makewhatis.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/makewhatis/makewhatis.1 ============================================================================== --- stable/10/usr.bin/makewhatis/makewhatis.1 Thu Mar 13 03:57:33 2014 (r263103) +++ stable/10/usr.bin/makewhatis/makewhatis.1 Thu Mar 13 04:25:59 2014 (r263104) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2013 -.Dt MAKEWHATIS 8 +.Dd December 3, 2005 +.Dt MAKEWHATIS 1 .Os .Sh NAME .Nm makewhatis -.Nd create whatis database +.Nd "create whatis database" .Sh SYNOPSIS .Nm .Op Fl a @@ -98,6 +98,9 @@ option is used. .It Ev MACHINE If set, its value is used to override the current machine type when searching machine specific subdirectories. +.It Ev MACHINE_ARCH +If set, its value is used to override the current +architecture when searching architecture specific subdirectories. .It Ev MANPATH Determines the set of directories to be processed if none are given on the command line. @@ -130,6 +133,4 @@ program was originally written in Perl a The current version of .Nm was rewritten in C by -.An John Rochester -with additional contributions by -.An Franco Fichtner Aq Mt franco@lastsummer.de . +.An John Rochester . Modified: stable/10/usr.bin/makewhatis/makewhatis.c ============================================================================== --- stable/10/usr.bin/makewhatis/makewhatis.c Thu Mar 13 03:57:33 2014 (r263103) +++ stable/10/usr.bin/makewhatis/makewhatis.c Thu Mar 13 04:25:59 2014 (r263104) @@ -1,6 +1,5 @@ /*- * Copyright (c) 2002 John Rochester - * Copyright (c) 2013 Franco Fichtner * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,19 +24,21 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ -#include +#include +__FBSDID("$FreeBSD$"); + #include +#include #include #include -#include +#include #include #include #include +#include #include #include #include @@ -51,56 +52,16 @@ static char blank[] = ""; /* - * Information collected about each man page alias. - */ -struct page_alias { - RB_ENTRY(page_alias) entry; - char *filename; - char *name; - char *suffix; - int gzipped; -}; - -/* - * Information collected about each unique man page. + * Information collected about each man page in a section. */ struct page_info { - RB_HEAD(page_alias_tree, page_alias) head; - RB_ENTRY(page_info) entry; - ino_t inode; + char * filename; + char * name; + char * suffix; + int gzipped; + ino_t inode; }; -static RB_HEAD(page_info_tree, page_info) page_head = RB_INITIALIZER(&page_head); - -/* - * Sorts page info by inode number. - */ -static int -infosort(const struct page_info *a, const struct page_info *b) -{ - return (memcmp(&a->inode, &b->inode, sizeof(a->inode))); -} - -RB_PROTOTYPE(page_info_tree, page_info, entry, infosort); -RB_GENERATE(page_info_tree, page_info, entry, infosort); - -/* - * Sorts page alias first by suffix, then name. - */ -static int -aliassort(const struct page_alias *a, const struct page_alias *b) -{ - int ret = strcmp(a->suffix, b->suffix); - if (ret) { - return (ret); - } - - return (strcmp(a->name, b->name)); -} - -RB_PROTOTYPE(page_alias_tree, page_alias, entry, aliassort); -RB_GENERATE(page_alias_tree, page_alias, entry, aliassort); - /* * An entry kept for each visited directory. */ @@ -139,7 +100,7 @@ static const char *whatis_name="whatis"; static char *common_output; /* -o option: the single output file */ static char *locale; /* user's locale if -L is used */ static char *lang_locale; /* short form of locale */ -static const char *machine; +static const char *machine, *machine_arch; static int exit_code; /* exit code to use when finished */ static SLIST_HEAD(, visited_dir) visited_dirs = @@ -171,66 +132,62 @@ static char mdoc_commands[] = "ArDvErEvF static void free_page_info(struct page_info *info) { - struct page_alias *alias; - - while ((alias = RB_ROOT(&info->head))) { - RB_REMOVE(page_alias_tree, &info->head, alias); - free(alias->filename); - free(alias->suffix); - free(alias->name); - free(alias); - } - + free(info->filename); + free(info->name); + free(info->suffix); free(info); } /* - * Allocates and fills in a new struct page_alias given the - * full file name of the man page and its dirent. - * If the file is not a man page, nothing is added. + * Allocates and fills in a new struct page_info given the + * name of the man section directory and the dirent of the file. + * If the file is not a man page, returns NULL. */ -static void -new_page_alias(struct page_info *info, char *filename, struct dirent *dirent) +static struct page_info * +new_page_info(char *dir, struct dirent *dirent) { - int gzipped, basename_length; - struct page_alias *alias; + struct page_info *info; + int basename_length; char *suffix; + struct stat st; + info = (struct page_info *) malloc(sizeof(struct page_info)); + if (info == NULL) + err(1, "malloc"); basename_length = strlen(dirent->d_name); suffix = &dirent->d_name[basename_length]; - - gzipped = basename_length >= 4 && - strcmp(&dirent->d_name[basename_length - 3], ".gz") == 0; - if (gzipped) { + asprintf(&info->filename, "%s/%s", dir, dirent->d_name); + if ((info->gzipped = basename_length >= 4 && strcmp(&dirent->d_name[basename_length - 3], ".gz") == 0)) { suffix -= 3; *suffix = '\0'; } - for (;;) { if (--suffix == dirent->d_name || !isalnum(*suffix)) { - if (*suffix == '.') { + if (*suffix == '.') break; - } - if (verbose) { - warnx("%s: invalid man page name", filename); - } - return; + if (verbose) + warnx("%s: invalid man page name", info->filename); + free(info->filename); + free(info); + return NULL; } } - *suffix++ = '\0'; - - alias = malloc(sizeof(*alias)); - if (alias == NULL) { - err(1, "malloc"); + info->name = strdup(dirent->d_name); + info->suffix = strdup(suffix); + if (stat(info->filename, &st) < 0) { + warn("%s", info->filename); + free_page_info(info); + return NULL; } - - alias->name = strdup(dirent->d_name); /* XXX unsafe */ - alias->filename = strdup(filename); /* XXX unsafe */ - alias->suffix = strdup(suffix); /* XXX unsafe */ - alias->gzipped = gzipped; - - RB_INSERT(page_alias_tree, &info->head, alias); + if (!S_ISREG(st.st_mode)) { + if (verbose && !S_ISDIR(st.st_mode)) + warnx("%s: not a regular file", info->filename); + free_page_info(info); + return NULL; + } + info->inode = st.st_ino; + return info; } /* @@ -249,10 +206,10 @@ static struct sbuf * new_sbuf(void) { struct sbuf *sbuf = (struct sbuf *) malloc(sizeof(struct sbuf)); - sbuf->content = malloc(LINE_ALLOC); + sbuf->content = (char *) malloc(LINE_ALLOC); sbuf->last = sbuf->content + LINE_ALLOC - 1; sbuf_clear(sbuf); - return(sbuf); + return sbuf; } /* @@ -270,7 +227,7 @@ sbuf_need(struct sbuf *sbuf, int nchars) size *= 2; cntsize = sbuf->end - sbuf->content; - new_content = malloc(size); + new_content = (char *)malloc(size); memcpy(new_content, sbuf->content, cntsize); free(sbuf->content); sbuf->content = new_content; @@ -331,7 +288,29 @@ static char * sbuf_content(struct sbuf *sbuf) { *sbuf->end = '\0'; - return(sbuf->content); + return sbuf->content; +} + +/* + * Returns true if no man page exists in the directory with + * any of the names in the StringList. + */ +static int +no_page_exists(char *dir, StringList *names, char *suffix) +{ + char path[MAXPATHLEN]; + size_t i; + + for (i = 0; i < names->sl_cur; i++) { + snprintf(path, sizeof path, "%s/%s.%s.gz", dir, names->sl_str[i], suffix); + if (access(path, F_OK) < 0) { + path[strlen(path) - 3] = '\0'; + if (access(path, F_OK) < 0) + continue; + } + return 0; + } + return 1; } static void @@ -358,7 +337,7 @@ open_output(char *name) if (output == NULL) { warn("%s", name); exit_code = 1; - return(NULL); + return NULL; } while (fgets(line, sizeof line, output) != NULL) { line[strlen(line) - 1] = '\0'; @@ -373,15 +352,15 @@ open_output(char *name) if (output == NULL) { warn("%s", name); exit_code = 1; - return(NULL); + return NULL; } - return(output); + return output; } static int linesort(const void *a, const void *b) { - return(strcmp((*(const char * const *)a), (*(const char * const *)b))); + return strcmp((*(const char * const *)a), (*(const char * const *)b)); } /* @@ -393,8 +372,7 @@ finish_output(FILE *output, char *name) size_t i; char *prev = NULL; - qsort(whatis_lines->sl_str, whatis_lines->sl_cur, sizeof(char *), - linesort); + qsort(whatis_lines->sl_str, whatis_lines->sl_cur, sizeof(char *), linesort); for (i = 0; i < whatis_lines->sl_cur; i++) { char *line = whatis_lines->sl_str[i]; if (i > 0 && strcmp(line, prev) == 0) @@ -417,7 +395,7 @@ open_whatis(char *mandir) char filename[MAXPATHLEN]; snprintf(filename, sizeof filename, "%s/%s", mandir, whatis_name); - return(open_output(filename)); + return open_output(filename); } static void @@ -441,20 +419,20 @@ already_visited(char *dir) if (stat(dir, &st) < 0) { warn("%s", dir); exit_code = 1; - return(1); + return 1; } SLIST_FOREACH(visit, &visited_dirs, next) { if (visit->inode == st.st_ino && visit->device == st.st_dev) { warnx("already visited %s", dir); - return(1); + return 1; } } visit = (struct visited_dir *) malloc(sizeof(struct visited_dir)); visit->device = st.st_dev; visit->inode = st.st_ino; SLIST_INSERT_HEAD(&visited_dirs, visit, next); - return(0); + return 0; } /* @@ -468,7 +446,7 @@ trim_rhs(char *str) while (--rhs > str && isspace(*rhs)) ; *++rhs = '\0'; - return(rhs); + return rhs; } /* @@ -479,7 +457,7 @@ skip_spaces(char *s) { while (*s != '\0' && isspace(*s)) s++; - return(s); + return s; } /* @@ -489,10 +467,10 @@ static int only_digits(char *line) { if (!isdigit(*line++)) - return(0); + return 0; while (isdigit(*line)) line++; - return(*line == '\0'); + return *line == '\0'; } /* @@ -509,7 +487,7 @@ name_section_line(char *line, const char const char **title; if (strncmp(line, section_start, 3) != 0) - return(0); + return 0; line = skip_spaces(line + 3); rhs = trim_rhs(line); if (*line == '"') { @@ -519,8 +497,8 @@ name_section_line(char *line, const char } for (title = name_section_titles; *title != NULL; title++) if (strcmp(*title, line) == 0) - return(1); - return(0); + return 1; + return 0; } /* @@ -540,7 +518,7 @@ de_nroff_copy(char *from, char *to, int switch (*++from) { case '(': if (strncmp(&from[1], "em", 2) == 0 || - strncmp(&from[1], "mi", 2) == 0) { + strncmp(&from[1], "mi", 2) == 0) { from += 3; continue; } @@ -556,8 +534,7 @@ de_nroff_copy(char *from, char *to, int if (*++from == '(') from += 3; else if (*from == '[') { - while (*++from != ']' && from < from_end) - ; + while (*++from != ']' && from < from_end); from++; } else from++; @@ -570,7 +547,7 @@ de_nroff_copy(char *from, char *to, int } *to++ = *from++; } - return(to); + return to; } /* @@ -617,38 +594,6 @@ process_man_line(char *line) } } -struct mdoc_text { - const char *mdoc; - const char *text; -}; - -static int -process_mdoc_macro(char *line) -{ - static const struct mdoc_text list[] = { - { ".At", "AT&T UNIX" }, - { ".Bsx", "BSD/OS" }, - { ".Bx", "BSD" }, - { ".Dx", "DragonFly" }, - { ".Fx", "FreeBSD" }, - { ".Nx", "NetBSD" }, - { ".Ox", "OpenBSD" }, - { ".Ux", "UNIX" }, - }; - unsigned int i; - - for (i = 0; i < sizeof(list) / sizeof(list[0]); ++i) { - if (!strcmp(line, list[i].mdoc)) { - sbuf_append(whatis_proto, list[i].text, - strlen(list[i].text)); - sbuf_append(whatis_proto, " ", 1); - return (1); - } - } - - return (0); -} - /* * Processes a new-style mdoc(7) line. */ @@ -668,9 +613,6 @@ process_mdoc_line(char *line) sbuf_append(whatis_proto, " ", 1); return; } - if (process_mdoc_macro(line)) { - return; - } xref = strncmp(line, ".Xr", 3) == 0; line += 3; while ((line = skip_spaces(line)) < line_end) { @@ -721,6 +663,27 @@ process_mdoc_line(char *line) sbuf_append(whatis_proto, " ", 1); } +/* + * Collects a list of comma-separated names from the text. + */ +static void +collect_names(StringList *names, char *text) +{ + char *arg; + + for (;;) { + arg = text; + text = strchr(text, ','); + if (text != NULL) + *text++ = '\0'; + sl_add(names, arg); + if (text == NULL) + return; + if (*text == ' ') + text++; + } +} + enum { STATE_UNKNOWN, STATE_MANSTYLE, STATE_MDOCNAME, STATE_MDOCDESC }; /* @@ -728,33 +691,25 @@ enum { STATE_UNKNOWN, STATE_MANSTYLE, ST * to whatis_lines. */ static void -process_page(struct page_info *info) +process_page(struct page_info *page, char *section_dir) { - int state = STATE_UNKNOWN; - struct page_alias *alias; - char *line, *descr; - char buffer[4096]; gzFile in; - - /* - * Only read the page once for each inode. It's - * safe to assume that page->list is set. - */ - alias = RB_MIN(page_alias_tree, &info->head); - - if (verbose) { - fprintf(stderr, "\treading %s\n", alias->filename); - } + char buffer[4096]; + char *line; + StringList *names; + char *descr; + int state = STATE_UNKNOWN; + size_t i; sbuf_clear(whatis_proto); - if ((in = gzopen(alias->filename, "r")) == NULL) { - warn("%s", alias->filename); + if ((in = gzopen(page->filename, "r")) == NULL) { + warn("%s", page->filename); exit_code = 1; return; } - while (gzgets(in, buffer, sizeof(buffer)) != NULL) { + while (gzgets(in, buffer, sizeof buffer) != NULL) { line = buffer; - if (strncmp(line, ".\\\"", 3) == 0) /* ignore comments */ + if (strncmp(line, ".\\\"", 3) == 0) /* ignore comments */ continue; switch (state) { /* @@ -824,9 +779,7 @@ process_page(struct page_info *info) descr = strchr(line, ' '); if (descr == NULL) { if (verbose) - fprintf(stderr, - "\tignoring junk description \"%s\"\n", - line); + fprintf(stderr, " ignoring junk description \"%s\"\n", line); return; } *descr++ = '\0'; @@ -834,16 +787,19 @@ process_page(struct page_info *info) *descr = '\0'; descr += 3; } + names = sl_init(); + collect_names(names, line); sbuf_clear(whatis_final); - RB_FOREACH(alias, page_alias_tree, &info->head) { + if (!sl_find(names, page->name) && no_page_exists(section_dir, names, page->suffix)) { /* - * This won't append names stored in `line'. - * The reason for that is that we cannot be sure - * which section they belong to unless we have - * a real alias (via MLINKS) in this list. + * Add the page name since that's the only thing that + * man(1) will find. */ - add_whatis_name(alias->name, alias->suffix); + add_whatis_name(page->name, page->suffix); } + for (i = 0; i < names->sl_cur; i++) + add_whatis_name(names->sl_str[i], page->suffix); + sl_free(names, 0); sbuf_retract(whatis_final, 2); /* remove last ", " */ while (sbuf_length(whatis_final) < indent) sbuf_append(whatis_final, " ", 1); @@ -853,19 +809,33 @@ process_page(struct page_info *info) } /* + * Sorts pages first by inode number, then by name. + */ +static int +pagesort(const void *a, const void *b) +{ + const struct page_info *p1 = *(struct page_info * const *) a; + const struct page_info *p2 = *(struct page_info * const *) b; + if (p1->inode == p2->inode) + return strcmp(p1->name, p2->name); + return p1->inode - p2->inode; +} + +/* * Processes a single man section. */ static void process_section(char *section_dir) { struct dirent **entries; - struct page_info *info; int nentries; + struct page_info **pages; + int npages = 0; int i; + ino_t prev_inode = 0; - if (verbose) { + if (verbose) fprintf(stderr, " %s\n", section_dir); - } /* * scan the man section directory for pages @@ -876,55 +846,33 @@ process_section(char *section_dir) exit_code = 1; return; } - /* * collect information about man pages */ + pages = (struct page_info **) calloc(nentries, sizeof(struct page_info *)); for (i = 0; i < nentries; i++) { - struct page_info ref; - char *filename; - struct stat st; - - if (asprintf(&filename, "%s/%s", section_dir, - entries[i]->d_name) < 0) { - err(1, "malloc"); - } - - if (stat(filename, &st) < 0) { - warn("%s", filename); - goto process_section_next; - } - - if (!S_ISREG(st.st_mode)) { - if (verbose && !S_ISDIR(st.st_mode)) - warnx("%s: not a regular file", filename); - goto process_section_next; - } - - ref.inode = st.st_ino; - - info = RB_FIND(page_info_tree, &page_head, &ref); - if (info == NULL) { - info = malloc(sizeof(*info)); - if (info == NULL) { - err(1, "malloc"); - } - - bzero(info, sizeof(*info)); - info->inode = st.st_ino; - RB_INIT(&info->head); - - RB_INSERT(page_info_tree, &page_head, info); - } - - new_page_alias(info, filename, entries[i]); - -process_section_next: - + struct page_info *info = new_page_info(section_dir, entries[i]); + if (info != NULL) + pages[npages++] = info; free(entries[i]); - free(filename); } free(entries); + qsort(pages, npages, sizeof(struct page_info *), pagesort); + /* + * process each unique page + */ + for (i = 0; i < npages; i++) { + struct page_info *page = pages[i]; + if (page->inode != prev_inode) { + prev_inode = page->inode; + if (verbose) + fprintf(stderr, " reading %s\n", page->filename); + process_page(page, section_dir); + } else if (verbose) + fprintf(stderr, " skipping %s, duplicate\n", page->filename); + free_page_info(page); + } + free(pages); } /* @@ -936,12 +884,12 @@ select_sections(const struct dirent *ent const char *p = &entry->d_name[3]; if (strncmp(entry->d_name, "man", 3) != 0) - return(0); + return 0; while (*p != '\0') { if (!isalnum(*p++)) - return(0); + return 0; } - return(1); + return 1; } /* @@ -952,7 +900,6 @@ static void process_mandir(char *dir_name) { struct dirent **entries; - struct page_info *info; int nsections; FILE *fp = NULL; int i; @@ -972,26 +919,21 @@ process_mandir(char *dir_name) return; for (i = 0; i < nsections; i++) { char section_dir[MAXPATHLEN]; - snprintf(section_dir, sizeof section_dir, "%s/%s", dir_name, - entries[i]->d_name); + snprintf(section_dir, sizeof section_dir, "%s/%s", dir_name, entries[i]->d_name); process_section(section_dir); snprintf(section_dir, sizeof section_dir, "%s/%s/%s", dir_name, - entries[i]->d_name, machine); + entries[i]->d_name, machine); if (stat(section_dir, &st) == 0 && S_ISDIR(st.st_mode)) process_section(section_dir); + if (strcmp(machine_arch, machine) != 0) { + snprintf(section_dir, sizeof section_dir, "%s/%s/%s", + dir_name, entries[i]->d_name, machine_arch); + if (stat(section_dir, &st) == 0 && S_ISDIR(st.st_mode)) + process_section(section_dir); + } free(entries[i]); } free(entries); - - /* - * process and free all pages - */ - while ((info = RB_ROOT(&page_head))) { - RB_REMOVE(page_info_tree, &page_head, info); - process_page(info); - free_page_info(info); - } - if (common_output == NULL) finish_whatis(fp, dir_name); } @@ -1061,9 +1003,7 @@ main(int argc, char **argv) char *sep = strchr(locale, '_'); if (sep != NULL && isupper(sep[1]) && isupper(sep[2])) { - asprintf(&lang_locale, "%.*s%s", - (int)(sep - locale), - locale, &sep[3]); + asprintf(&lang_locale, "%.*s%s", (int)(ptrdiff_t)(sep - locale), locale, &sep[3]); } } break; @@ -1081,8 +1021,16 @@ main(int argc, char **argv) whatis_proto = new_sbuf(); whatis_final = new_sbuf(); - if ((machine = getenv("MACHINE")) == NULL) - machine = MACHINE; + if ((machine = getenv("MACHINE")) == NULL) { + static struct utsname utsname; + + if (uname(&utsname) == -1) + err(1, "uname"); + machine = utsname.machine; + } + + if ((machine_arch = getenv("MACHINE_ARCH")) == NULL) + machine_arch = MACHINE_ARCH; if (common_output != NULL && (fp = open_output(common_output)) == NULL) err(1, "%s", common_output); From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 14 00:12:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 302015C2; Fri, 14 Mar 2014 00:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0FB331F6; Fri, 14 Mar 2014 00:12: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 s2E0Ct1T068513; Fri, 14 Mar 2014 00:12:55 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E0CrY3068505; Fri, 14 Mar 2014 00:12:53 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201403140012.s2E0CrY3068505@svn.freebsd.org> From: Justin Hibbits Date: Fri, 14 Mar 2014 00:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263122 - in stable/10: lib/libpmc sys/conf sys/dev/hwpmc sys/powerpc/include sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 00:12:55 -0000 Author: jhibbits Date: Fri Mar 14 00:12:53 2014 New Revision: 263122 URL: http://svnweb.freebsd.org/changeset/base/263122 Log: MFC r261342 Add hwpmc(4) support for the PowerPC 970 class processors, direct events. This also fixes asserts on removal of the module for the mpc74xx. The PowerPC 970 processors have two different types of events: direct events and indirect events. Thus far only direct events are supported. I included some documentation in the driver on how indirect events work, but support is for the future. Added: stable/10/sys/dev/hwpmc/hwpmc_ppc970.c - copied unchanged from r261342, head/sys/dev/hwpmc/hwpmc_ppc970.c Modified: stable/10/lib/libpmc/libpmc.c stable/10/sys/conf/files.powerpc stable/10/sys/dev/hwpmc/hwpmc_mpc7xxx.c stable/10/sys/dev/hwpmc/hwpmc_powerpc.c stable/10/sys/dev/hwpmc/hwpmc_powerpc.h stable/10/sys/dev/hwpmc/pmc_events.h stable/10/sys/powerpc/include/pmc_mdep.h stable/10/sys/powerpc/include/spr.h stable/10/sys/sys/pmc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpmc/libpmc.c ============================================================================== --- stable/10/lib/libpmc/libpmc.c Thu Mar 13 23:31:05 2014 (r263121) +++ stable/10/lib/libpmc/libpmc.c Fri Mar 14 00:12:53 2014 (r263122) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -85,7 +86,7 @@ static int soft_allocate_pmc(enum pmc_ev struct pmc_op_pmcallocate *_pmc_config); #if defined(__powerpc__) -static int ppc7450_allocate_pmc(enum pmc_event _pe, char* ctrspec, +static int powerpc_allocate_pmc(enum pmc_event _pe, char* ctrspec, struct pmc_op_pmcallocate *_pmc_config); #endif /* __powerpc__ */ @@ -156,6 +157,7 @@ PMC_CLASSDEP_TABLE(mips24k, MIPS24K); PMC_CLASSDEP_TABLE(octeon, OCTEON); PMC_CLASSDEP_TABLE(ucf, UCF); PMC_CLASSDEP_TABLE(ppc7450, PPC7450); +PMC_CLASSDEP_TABLE(ppc970, PPC970); static struct pmc_event_descr soft_event_table[PMC_EV_DYN_COUNT]; @@ -262,6 +264,7 @@ PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_SOFT, PMC_CLASS_MIPS24K); PMC_MDEP_TABLE(octeon, OCTEON, PMC_CLASS_SOFT, PMC_CLASS_OCTEON); PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_SOFT, PMC_CLASS_PPC7450); +PMC_MDEP_TABLE(ppc970, PPC970, PMC_CLASS_SOFT, PMC_CLASS_PPC970); PMC_MDEP_TABLE(generic, SOFT, PMC_CLASS_SOFT); static const struct pmc_event_descr tsc_event_table[] = @@ -322,7 +325,8 @@ PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, m PMC_CLASS_TABLE_DESC(octeon, OCTEON, octeon, mips); #endif /* __mips__ */ #if defined(__powerpc__) -PMC_CLASS_TABLE_DESC(ppc7450, PPC7450, ppc7450, ppc7450); +PMC_CLASS_TABLE_DESC(ppc7450, PPC7450, ppc7450, powerpc); +PMC_CLASS_TABLE_DESC(ppc970, PPC970, ppc970, powerpc); #endif static struct pmc_class_descr soft_class_table_descr = @@ -2404,13 +2408,19 @@ static struct pmc_event_alias ppc7450_al EV_ALIAS(NULL, NULL) }; -#define PPC7450_KW_OS "os" -#define PPC7450_KW_USR "usr" -#define PPC7450_KW_ANYTHREAD "anythread" +static struct pmc_event_alias ppc970_aliases[] = { + EV_ALIAS("instructions", "INSTR_COMPLETED"), + EV_ALIAS("cycles", "CYCLES"), + EV_ALIAS(NULL, NULL) +}; + +#define POWERPC_KW_OS "os" +#define POWERPC_KW_USR "usr" +#define POWERPC_KW_ANYTHREAD "anythread" static int -ppc7450_allocate_pmc(enum pmc_event pe, char *ctrspec __unused, - struct pmc_op_pmcallocate *pmc_config __unused) +powerpc_allocate_pmc(enum pmc_event pe, char *ctrspec __unused, + struct pmc_op_pmcallocate *pmc_config __unused) { char *p; @@ -2419,11 +2429,11 @@ ppc7450_allocate_pmc(enum pmc_event pe, pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); while ((p = strsep(&ctrspec, ",")) != NULL) { - if (KWMATCH(p, PPC7450_KW_OS)) + if (KWMATCH(p, POWERPC_KW_OS)) pmc_config->pm_caps |= PMC_CAP_SYSTEM; - else if (KWMATCH(p, PPC7450_KW_USR)) + else if (KWMATCH(p, POWERPC_KW_USR)) pmc_config->pm_caps |= PMC_CAP_USER; - else if (KWMATCH(p, PPC7450_KW_ANYTHREAD)) + else if (KWMATCH(p, POWERPC_KW_ANYTHREAD)) pmc_config->pm_caps |= (PMC_CAP_USER | PMC_CAP_SYSTEM); else return (-1); @@ -2431,6 +2441,7 @@ ppc7450_allocate_pmc(enum pmc_event pe, return (0); } + #endif /* __powerpc__ */ @@ -2830,6 +2841,10 @@ pmc_event_names_of_class(enum pmc_class ev = ppc7450_event_table; count = PMC_EVENT_TABLE_SIZE(ppc7450); break; + case PMC_CLASS_PPC970: + ev = ppc970_event_table; + count = PMC_EVENT_TABLE_SIZE(ppc970); + break; case PMC_CLASS_SOFT: ev = soft_event_table; count = soft_event_info.pm_nevent; @@ -3100,6 +3115,10 @@ pmc_init(void) PMC_MDEP_INIT(ppc7450); pmc_class_table[n] = &ppc7450_class_table_descr; break; + case PMC_CPU_PPC_970: + PMC_MDEP_INIT(ppc970); + pmc_class_table[n] = &ppc970_class_table_descr; + break; #endif default: /* @@ -3270,6 +3289,9 @@ _pmc_name_of_event(enum pmc_event pe, en } else if (pe >= PMC_EV_PPC7450_FIRST && pe <= PMC_EV_PPC7450_LAST) { ev = ppc7450_event_table; evfence = ppc7450_event_table + PMC_EVENT_TABLE_SIZE(ppc7450); + } else if (pe >= PMC_EV_PPC970_FIRST && pe <= PMC_EV_PPC970_LAST) { + ev = ppc970_event_table; + evfence = ppc970_event_table + PMC_EVENT_TABLE_SIZE(ppc970); } else if (pe == PMC_EV_TSC_TSC) { ev = tsc_event_table; evfence = tsc_event_table + PMC_EVENT_TABLE_SIZE(tsc); Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Thu Mar 13 23:31:05 2014 (r263121) +++ stable/10/sys/conf/files.powerpc Fri Mar 14 00:12:53 2014 (r263122) @@ -31,6 +31,7 @@ dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc +dev/hwpmc/hwpmc_ppc970.c optional hwpmc dev/iicbus/ad7417.c optional ad7417 powermac dev/iicbus/ds1631.c optional ds1631 powermac dev/iicbus/ds1775.c optional ds1775 powermac Modified: stable/10/sys/dev/hwpmc/hwpmc_mpc7xxx.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_mpc7xxx.c Thu Mar 13 23:31:05 2014 (r263121) +++ stable/10/sys/dev/hwpmc/hwpmc_mpc7xxx.c Fri Mar 14 00:12:53 2014 (r263122) @@ -69,10 +69,10 @@ __FBSDID("$FreeBSD$"); * specifically). */ -struct powerpc_event_code_map { +struct mpc7xxx_event_code_map { enum pmc_event pe_ev; /* enum value */ uint8_t pe_counter_mask; /* Which counter this can be counted in. */ - uint8_t pe_code; /* numeric code */ + uint8_t pe_code; /* numeric code */ }; #define PPC_PMC_MASK1 0 @@ -85,7 +85,7 @@ struct powerpc_event_code_map { #define PMC_POWERPC_EVENT(id, mask, number) \ { .pe_ev = PMC_EV_PPC7450_##id, .pe_counter_mask = mask, .pe_code = number } -static struct powerpc_event_code_map powerpc_event_codes[] = { +static struct mpc7xxx_event_code_map mpc7xxx_event_codes[] = { PMC_POWERPC_EVENT(CYCLE,PPC_PMC_MASK_ALL, 1), PMC_POWERPC_EVENT(INSTR_COMPLETED, 0x0f, 2), PMC_POWERPC_EVENT(TLB_BIT_TRANSITIONS, 0x0f, 3), @@ -311,8 +311,8 @@ static struct powerpc_event_code_map pow PMC_POWERPC_EVENT(PREFETCH_ENGINE_FULL, 0x20, 57) }; -const size_t powerpc_event_codes_size = - sizeof(powerpc_event_codes) / sizeof(powerpc_event_codes[0]); +const size_t mpc7xxx_event_codes_size = + sizeof(mpc7xxx_event_codes) / sizeof(mpc7xxx_event_codes[0]); static pmc_value_t mpc7xxx_pmcn_read(unsigned int pmc) @@ -565,6 +565,7 @@ mpc7xxx_pcpu_init(struct pmc_mdep *md, i M_WAITOK|M_ZERO); pac->pc_ppcpmcs = malloc(sizeof(struct pmc_hw) * MPC7XXX_MAX_PMCS, M_PMC, M_WAITOK|M_ZERO); + pac->pc_class = PMC_CLASS_PPC7450; pc = pmc_pcpu[cpu]; first_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_PPC7450].pcd_ri; KASSERT(pc != NULL, ("[powerpc,%d] NULL per-cpu pointer", __LINE__)); @@ -611,14 +612,14 @@ mpc7xxx_allocate_pmc(int cpu, int ri, st caps = a->pm_caps; pe = a->pm_ev; - for (i = 0; i < powerpc_event_codes_size; i++) { - if (powerpc_event_codes[i].pe_ev == pe) { - config = powerpc_event_codes[i].pe_code; - counter = powerpc_event_codes[i].pe_counter_mask; + for (i = 0; i < mpc7xxx_event_codes_size; i++) { + if (mpc7xxx_event_codes[i].pe_ev == pe) { + config = mpc7xxx_event_codes[i].pe_code; + counter = mpc7xxx_event_codes[i].pe_counter_mask; break; } } - if (i == powerpc_event_codes_size) + if (i == mpc7xxx_event_codes_size) return (EINVAL); if ((counter & (1 << ri)) == 0) @@ -724,6 +725,8 @@ pmc_mpc7xxx_initialize(struct pmc_mdep * { struct pmc_classdep *pcd; + pmc_mdep->pmd_cputype = PMC_CPU_PPC_7450; + pcd = &pmc_mdep->pmd_classdep[PMC_MDEP_CLASS_INDEX_PPC7450]; pcd->pcd_caps = POWERPC_PMC_CAPS; pcd->pcd_class = PMC_CLASS_PPC7450; @@ -735,6 +738,8 @@ pmc_mpc7xxx_initialize(struct pmc_mdep * pcd->pcd_config_pmc = mpc7xxx_config_pmc; pcd->pcd_pcpu_fini = mpc7xxx_pcpu_fini; pcd->pcd_pcpu_init = mpc7xxx_pcpu_init; + pcd->pcd_describe = powerpc_describe; + pcd->pcd_get_config = powerpc_get_config; pcd->pcd_read_pmc = mpc7xxx_read_pmc; pcd->pcd_release_pmc = mpc7xxx_release_pmc; pcd->pcd_start_pmc = mpc7xxx_start_pmc; @@ -742,7 +747,7 @@ pmc_mpc7xxx_initialize(struct pmc_mdep * pcd->pcd_write_pmc = mpc7xxx_write_pmc; pmc_mdep->pmd_npmc += MPC7XXX_MAX_PMCS; - pmc_mdep->pmd_intr = mpc7xxx_intr; + pmc_mdep->pmd_intr = mpc7xxx_intr; - return 0; + return (0); } Modified: stable/10/sys/dev/hwpmc/hwpmc_powerpc.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_powerpc.c Thu Mar 13 23:31:05 2014 (r263121) +++ stable/10/sys/dev/hwpmc/hwpmc_powerpc.c Fri Mar 14 00:12:53 2014 (r263122) @@ -96,7 +96,7 @@ powerpc_describe(int cpu, int ri, struct if ((error = copystr(powerpc_name, pi->pm_name, PMC_NAME_MAX, NULL)) != 0) return error; - pi->pm_class = PMC_CLASS_PPC7450; + pi->pm_class = powerpc_pcpu[cpu]->pc_class; if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { pi->pm_enabled = TRUE; *ppmc = phw->phw_pmc; @@ -133,8 +133,6 @@ pmc_md_initialize() /* Just one class */ pmc_mdep = pmc_mdep_alloc(1); - pmc_mdep->pmd_cputype = PMC_CPU_PPC_7450; - vers = mfpvr() >> 16; pmc_mdep->pmd_switch_in = powerpc_switch_in; @@ -151,6 +149,8 @@ pmc_md_initialize() case IBM970: case IBM970FX: case IBM970MP: + error = pmc_ppc970_initialize(pmc_mdep); + break; default: error = -1; break; @@ -159,7 +159,6 @@ pmc_md_initialize() if (error != 0) { pmc_mdep_free(pmc_mdep); pmc_mdep = NULL; - return NULL; } return (pmc_mdep); @@ -168,7 +167,9 @@ pmc_md_initialize() void pmc_md_finalize(struct pmc_mdep *md) { - free(md, M_PMC); + + free(powerpc_pcpu, M_PMC); + powerpc_pcpu = NULL; } int Modified: stable/10/sys/dev/hwpmc/hwpmc_powerpc.h ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_powerpc.h Thu Mar 13 23:31:05 2014 (r263121) +++ stable/10/sys/dev/hwpmc/hwpmc_powerpc.h Fri Mar 14 00:12:53 2014 (r263122) @@ -46,11 +46,13 @@ struct powerpc_cpu { struct pmc_hw *pc_ppcpmcs; + enum pmc_class pc_class; }; extern struct powerpc_cpu **powerpc_pcpu; extern int pmc_mpc7xxx_initialize(struct pmc_mdep *pmc_mdep); +extern int pmc_ppc970_initialize(struct pmc_mdep *pmc_mdep); extern int powerpc_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc); extern int powerpc_get_config(int cpu, int ri, struct pmc **ppm); Copied: stable/10/sys/dev/hwpmc/hwpmc_ppc970.c (from r261342, head/sys/dev/hwpmc/hwpmc_ppc970.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/hwpmc/hwpmc_ppc970.c Fri Mar 14 00:12:53 2014 (r263122, copy of r261342, head/sys/dev/hwpmc/hwpmc_ppc970.c) @@ -0,0 +1,689 @@ +/*- + * Copyright (c) 2013 Justin Hibbits + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +#include "hwpmc_powerpc.h" + +#define PPC970_MAX_PMCS 8 + +/* MMCR0, PMC1 is 8 bytes in, PMC2 is 1 byte in. */ +#define PPC970_SET_MMCR0_PMCSEL(r, x, i) \ + ((r & ~(0x1f << (7 * (1 - i) + 1))) | (x << (7 * (1 - i) + 1))) +/* MMCR1 has 6 PMC*SEL items (PMC3->PMC8), in sequence. */ +#define PPC970_SET_MMCR1_PMCSEL(r, x, i) \ + ((r & ~(0x1f << (5 * (7 - i) + 2))) | (x << (5 * (7 - i) + 2))) + +#define PPC970_PMC_HAS_OVERFLOWED(x) (ppc970_pmcn_read(x) & (0x1 << 31)) + +/* How PMC works on PPC970: + * + * Any PMC can count a direct event. Indirect events are handled specially. + * Direct events: As published. + * + * Encoding 00 000 -- Add byte lane bit counters + * MMCR1[24:31] -- select bit matching PMC being an adder. + * Bus events: + * PMCxSEL: 1x -- select from byte lane: 10 == lower lane (0/1), 11 == upper + * lane (2/3). + * PMCxSEL[2:4] -- bit in the byte lane selected. + * + * PMC[1,2,5,6] == lane 0/lane 2 + * PMC[3,4,7,8] == lane 1,3 + * + * + * Lanes: + * Lane 0 -- TTM0(FPU,ISU,IFU,VPU) + * TTM1(IDU,ISU,STS) + * LSU0 byte 0 + * LSU1 byte 0 + * Lane 1 -- TTM0 + * TTM1 + * LSU0 byte 1 + * LSU1 byte 1 + * Lane 2 -- TTM0 + * TTM1 + * LSU0 byte 2 + * LSU1 byte 2 or byte 6 + * Lane 3 -- TTM0 + * TTM1 + * LSU0 byte 3 + * LSU1 byte 3 or byte 7 + * + * Adders: + * Add byte lane for PMC (above), bit 0+4, 1+5, 2+6, 3+7 + */ + +struct pmc_ppc970_event { + enum pmc_event pe_event; + uint32_t pe_flags; +#define PMC_PPC970_FLAG_PMCS 0x000000ff +#define PMC_PPC970_FLAG_PMC1 0x01 +#define PMC_PPC970_FLAG_PMC2 0x02 +#define PMC_PPC970_FLAG_PMC3 0x04 +#define PMC_PPC970_FLAG_PMC4 0x08 +#define PMC_PPC970_FLAG_PMC5 0x10 +#define PMC_PPC970_FLAG_PMC6 0x20 +#define PMC_PPC970_FLAG_PMC7 0x40 +#define PMC_PPC970_FLAG_PMC8 0x80 + uint32_t pe_code; +}; + +static struct pmc_ppc970_event ppc970_event_codes[] = { + {PMC_EV_PPC970_INSTR_COMPLETED, + .pe_flags = PMC_PPC970_FLAG_PMCS, + .pe_code = 0x09 + }, + {PMC_EV_PPC970_MARKED_GROUP_DISPATCH, + .pe_flags = PMC_PPC970_FLAG_PMC1, + .pe_code = 0x2 + }, + {PMC_EV_PPC970_MARKED_STORE_COMPLETED, + .pe_flags = PMC_PPC970_FLAG_PMC1, + .pe_code = 0x03 + }, + {PMC_EV_PPC970_GCT_EMPTY, + .pe_flags = PMC_PPC970_FLAG_PMC1, + .pe_code = 0x04 + }, + {PMC_EV_PPC970_RUN_CYCLES, + .pe_flags = PMC_PPC970_FLAG_PMC1, + .pe_code = 0x05 + }, + {PMC_EV_PPC970_OVERFLOW, + .pe_flags = PMC_PPC970_FLAG_PMCS, + .pe_code = 0x0a + }, + {PMC_EV_PPC970_CYCLES, + .pe_flags = PMC_PPC970_FLAG_PMCS, + .pe_code = 0x0f + }, + {PMC_EV_PPC970_THRESHOLD_TIMEOUT, + .pe_flags = PMC_PPC970_FLAG_PMC2, + .pe_code = 0x3 + }, + {PMC_EV_PPC970_GROUP_DISPATCH, + .pe_flags = PMC_PPC970_FLAG_PMC2, + .pe_code = 0x4 + }, + {PMC_EV_PPC970_BR_MARKED_INSTR_FINISH, + .pe_flags = PMC_PPC970_FLAG_PMC2, + .pe_code = 0x5 + }, + {PMC_EV_PPC970_GCT_EMPTY_BY_SRQ_FULL, + .pe_flags = PMC_PPC970_FLAG_PMC2, + .pe_code = 0xb + }, + {PMC_EV_PPC970_STOP_COMPLETION, + .pe_flags = PMC_PPC970_FLAG_PMC3, + .pe_code = 0x1 + }, + {PMC_EV_PPC970_LSU_EMPTY, + .pe_flags = PMC_PPC970_FLAG_PMC3, + .pe_code = 0x2 + }, + {PMC_EV_PPC970_MARKED_STORE_WITH_INTR, + .pe_flags = PMC_PPC970_FLAG_PMC3, + .pe_code = 0x3 + }, + {PMC_EV_PPC970_CYCLES_IN_SUPER, + .pe_flags = PMC_PPC970_FLAG_PMC3, + .pe_code = 0x4 + }, + {PMC_EV_PPC970_VPU_MARKED_INSTR_COMPLETED, + .pe_flags = PMC_PPC970_FLAG_PMC3, + .pe_code = 0x5 + }, + {PMC_EV_PPC970_FXU0_IDLE_FXU1_BUSY, + .pe_flags = PMC_PPC970_FLAG_PMC4, + .pe_code = 0x2 + }, + {PMC_EV_PPC970_SRQ_EMPTY, + .pe_flags = PMC_PPC970_FLAG_PMC4, + .pe_code = 0x3 + }, + {PMC_EV_PPC970_MARKED_GROUP_COMPLETED, + .pe_flags = PMC_PPC970_FLAG_PMC4, + .pe_code = 0x4 + }, + {PMC_EV_PPC970_CR_MARKED_INSTR_FINISH, + .pe_flags = PMC_PPC970_FLAG_PMC4, + .pe_code = 0x5 + }, + {PMC_EV_PPC970_DISPATCH_SUCCESS, + .pe_flags = PMC_PPC970_FLAG_PMC5, + .pe_code = 0x1 + }, + {PMC_EV_PPC970_FXU0_IDLE_FXU1_IDLE, + .pe_flags = PMC_PPC970_FLAG_PMC5, + .pe_code = 0x2 + }, + {PMC_EV_PPC970_ONE_PLUS_INSTR_COMPLETED, + .pe_flags = PMC_PPC970_FLAG_PMC5, + .pe_code = 0x3 + }, + {PMC_EV_PPC970_GROUP_MARKED_IDU, + .pe_flags = PMC_PPC970_FLAG_PMC5, + .pe_code = 0x4 + }, + {PMC_EV_PPC970_MARKED_GROUP_COMPLETE_TIMEOUT, + .pe_flags = PMC_PPC970_FLAG_PMC5, + .pe_code = 0x5 + }, + {PMC_EV_PPC970_FXU0_BUSY_FXU1_BUSY, + .pe_flags = PMC_PPC970_FLAG_PMC6, + .pe_code = 0x2 + }, + {PMC_EV_PPC970_MARKED_STORE_SENT_TO_STS, + .pe_flags = PMC_PPC970_FLAG_PMC6, + .pe_code = 0x3 + }, + {PMC_EV_PPC970_FXU_MARKED_INSTR_FINISHED, + .pe_flags = PMC_PPC970_FLAG_PMC6, + .pe_code = 0x4 + }, + {PMC_EV_PPC970_MARKED_GROUP_ISSUED, + .pe_flags = PMC_PPC970_FLAG_PMC6, + .pe_code = 0x5 + }, + {PMC_EV_PPC970_FXU0_BUSY_FXU1_IDLE, + .pe_flags = PMC_PPC970_FLAG_PMC7, + .pe_code = 0x2 + }, + {PMC_EV_PPC970_GROUP_COMPLETED, + .pe_flags = PMC_PPC970_FLAG_PMC7, + .pe_code = 0x3 + }, + {PMC_EV_PPC970_FPU_MARKED_INSTR_COMPLETED, + .pe_flags = PMC_PPC970_FLAG_PMC7, + .pe_code = 0x4 + }, + {PMC_EV_PPC970_MARKED_INSTR_FINISH_ANY_UNIT, + .pe_flags = PMC_PPC970_FLAG_PMC7, + .pe_code = 0x5 + }, + {PMC_EV_PPC970_EXTERNAL_INTERRUPT, + .pe_flags = PMC_PPC970_FLAG_PMC8, + .pe_code = 0x2 + }, + {PMC_EV_PPC970_GROUP_DISPATCH_REJECT, + .pe_flags = PMC_PPC970_FLAG_PMC8, + .pe_code = 0x3 + }, + {PMC_EV_PPC970_LSU_MARKED_INSTR_FINISH, + .pe_flags = PMC_PPC970_FLAG_PMC8, + .pe_code = 0x4 + }, + {PMC_EV_PPC970_TIMEBASE_EVENT, + .pe_flags = PMC_PPC970_FLAG_PMC8, + .pe_code = 0x5 + }, +#if 0 + {PMC_EV_PPC970_LSU_COMPLETION_STALL, }, + {PMC_EV_PPC970_FXU_COMPLETION_STALL, }, + {PMC_EV_PPC970_DCACHE_MISS_COMPLETION_STALL, }, + {PMC_EV_PPC970_FPU_COMPLETION_STALL, }, + {PMC_EV_PPC970_FXU_LONG_INSTR_COMPLETION_STALL, }, + {PMC_EV_PPC970_REJECT_COMPLETION_STALL, }, + {PMC_EV_PPC970_FPU_LONG_INSTR_COMPLETION_STALL, }, + {PMC_EV_PPC970_GCT_EMPTY_BY_ICACHE_MISS, }, + {PMC_EV_PPC970_REJECT_COMPLETION_STALL_ERAT_MISS, }, + {PMC_EV_PPC970_GCT_EMPTY_BY_BRANCH_MISS_PREDICT, }, +#endif +}; +static size_t ppc970_event_codes_size = nitems(ppc970_event_codes); + +static pmc_value_t +ppc970_pmcn_read(unsigned int pmc) +{ + pmc_value_t val; + + switch (pmc) { + case 0: + val = mfspr(SPR_970PMC1); + break; + case 1: + val = mfspr(SPR_970PMC2); + break; + case 2: + val = mfspr(SPR_970PMC3); + break; + case 3: + val = mfspr(SPR_970PMC4); + break; + case 4: + val = mfspr(SPR_970PMC5); + break; + case 5: + val = mfspr(SPR_970PMC6); + break; + case 6: + val = mfspr(SPR_970PMC7); + break; + case 7: + val = mfspr(SPR_970PMC8); + break; + default: + panic("Invalid PMC number: %d\n", pmc); + } + + return (val); +} + +static void +ppc970_pmcn_write(unsigned int pmc, uint32_t val) +{ + switch (pmc) { + case 0: + mtspr(SPR_970PMC1, val); + break; + case 1: + mtspr(SPR_970PMC2, val); + break; + case 2: + mtspr(SPR_970PMC3, val); + break; + case 3: + mtspr(SPR_970PMC4, val); + break; + case 4: + mtspr(SPR_970PMC5, val); + break; + case 5: + mtspr(SPR_970PMC6, val); + break; + case 6: + mtspr(SPR_970PMC7, val); + break; + case 7: + mtspr(SPR_970PMC8, val); + break; + default: + panic("Invalid PMC number: %d\n", pmc); + } +} + +static int +ppc970_config_pmc(int cpu, int ri, struct pmc *pm) +{ + struct pmc_hw *phw; + + PMCDBG(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm); + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < PPC970_MAX_PMCS, + ("[powerpc,%d] illegal row-index %d", __LINE__, ri)); + + phw = &powerpc_pcpu[cpu]->pc_ppcpmcs[ri]; + + KASSERT(pm == NULL || phw->phw_pmc == NULL, + ("[powerpc,%d] pm=%p phw->pm=%p hwpmc not unconfigured", + __LINE__, pm, phw->phw_pmc)); + + phw->phw_pmc = pm; + + return 0; +} + +static int +ppc970_set_pmc(int cpu, int ri, int config) +{ + struct pmc *pm; + struct pmc_hw *phw; + register_t pmc_mmcr; + + phw = &powerpc_pcpu[cpu]->pc_ppcpmcs[ri]; + pm = phw->phw_pmc; + + /* + * Disable the PMCs. + */ + switch (ri) { + case 0: + case 1: + pmc_mmcr = mfspr(SPR_970MMCR0); + pmc_mmcr = PPC970_SET_MMCR0_PMCSEL(pmc_mmcr, config, ri); + mtspr(SPR_970MMCR0, pmc_mmcr); + break; + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + pmc_mmcr = mfspr(SPR_970MMCR1); + pmc_mmcr = PPC970_SET_MMCR1_PMCSEL(pmc_mmcr, config, ri); + mtspr(SPR_970MMCR1, pmc_mmcr); + break; + } + return 0; +} + +static int +ppc970_start_pmc(int cpu, int ri) +{ + struct pmc *pm; + struct pmc_hw *phw; + register_t pmc_mmcr; + uint32_t config; + int error; + + phw = &powerpc_pcpu[cpu]->pc_ppcpmcs[ri]; + pm = phw->phw_pmc; + config = pm->pm_md.pm_powerpc.pm_powerpc_evsel & ~POWERPC_PMC_ENABLE; + + error = ppc970_set_pmc(cpu, ri, config); + + /* The mask is inverted (enable is 1) compared to the flags in MMCR0, which + * are Freeze flags. + */ + config = ~pm->pm_md.pm_powerpc.pm_powerpc_evsel & POWERPC_PMC_ENABLE; + + pmc_mmcr = mfspr(SPR_970MMCR0); + pmc_mmcr &= ~SPR_MMCR0_FC; + pmc_mmcr |= config; + mtspr(SPR_970MMCR0, pmc_mmcr); + + return 0; +} + +static int +ppc970_stop_pmc(int cpu, int ri) +{ + return ppc970_set_pmc(cpu, ri, PMC970N_NONE); +} + +static int +ppc970_read_pmc(int cpu, int ri, pmc_value_t *v) +{ + struct pmc *pm; + pmc_value_t tmp; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < PPC970_MAX_PMCS, + ("[powerpc,%d] illegal row index %d", __LINE__, ri)); + + pm = powerpc_pcpu[cpu]->pc_ppcpmcs[ri].phw_pmc; + KASSERT(pm, + ("[core,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, + ri)); + + tmp = ppc970_pmcn_read(ri); + PMCDBG(MDP,REA,2,"ppc-read id=%d -> %jd", ri, tmp); + if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) + *v = POWERPC_PERFCTR_VALUE_TO_RELOAD_COUNT(tmp); + else + *v = tmp; + + return 0; +} + +static int +ppc970_write_pmc(int cpu, int ri, pmc_value_t v) +{ + struct pmc *pm; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < PPC970_MAX_PMCS, + ("[powerpc,%d] illegal row-index %d", __LINE__, ri)); + + pm = powerpc_pcpu[cpu]->pc_ppcpmcs[ri].phw_pmc; + + if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) + v = POWERPC_RELOAD_COUNT_TO_PERFCTR_VALUE(v); + + PMCDBG(MDP,WRI,1,"powerpc-write cpu=%d ri=%d v=%jx", cpu, ri, v); + + ppc970_pmcn_write(ri, v); + + return 0; +} + +static int +ppc970_intr(int cpu, struct trapframe *tf) +{ + struct pmc *pm; + struct powerpc_cpu *pac; + pmc_value_t v; + uint32_t config; + int i, error, retval; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] out of range CPU %d", __LINE__, cpu)); + + PMCDBG(MDP,INT,1, "cpu=%d tf=%p um=%d", cpu, (void *) tf, + TRAPF_USERMODE(tf)); + + retval = 0; + + pac = powerpc_pcpu[cpu]; + + /* + * look for all PMCs that have interrupted: + * - look for a running, sampling PMC which has overflowed + * and which has a valid 'struct pmc' association + * + * If found, we call a helper to process the interrupt. + */ + + config = mfspr(SPR_970MMCR0); + mtspr(SPR_970MMCR0, config | SPR_MMCR0_FC); + for (i = 0; i < PPC970_MAX_PMCS; i++) { + if ((pm = pac->pc_ppcpmcs[i].phw_pmc) == NULL || + !PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) { + continue; + } + + if (!PPC970_PMC_HAS_OVERFLOWED(i)) + continue; + + retval = 1; /* Found an interrupting PMC. */ + + if (pm->pm_state != PMC_STATE_RUNNING) + continue; + + /* Stop the PMC, reload count. */ + v = pm->pm_sc.pm_reloadcount; + + ppc970_pmcn_write(i, v); + + /* Restart the counter if logging succeeded. */ + error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, + TRAPF_USERMODE(tf)); + mtspr(SPR_970MMCR0, config); + if (error != 0) + ppc970_stop_pmc(cpu, i); + atomic_add_int(retval ? &pmc_stats.pm_intr_processed : + &pmc_stats.pm_intr_ignored, 1); + + } + + /* Re-enable PERF exceptions. */ + mtspr(SPR_970MMCR0, mfspr(SPR_970MMCR0) | SPR_MMCR0_PMXE); + + return (retval); +} + +static int +ppc970_pcpu_init(struct pmc_mdep *md, int cpu) +{ + struct pmc_cpu *pc; + struct powerpc_cpu *pac; + struct pmc_hw *phw; + int first_ri, i; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] wrong cpu number %d", __LINE__, cpu)); + PMCDBG(MDP,INI,1,"powerpc-init cpu=%d", cpu); + + powerpc_pcpu[cpu] = pac = malloc(sizeof(struct powerpc_cpu), M_PMC, + M_WAITOK|M_ZERO); + pac->pc_ppcpmcs = malloc(sizeof(struct pmc_hw) * PPC970_MAX_PMCS, + M_PMC, M_WAITOK|M_ZERO); + pac->pc_class = PMC_CLASS_PPC970; + + pc = pmc_pcpu[cpu]; + first_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_PPC970].pcd_ri; + KASSERT(pc != NULL, ("[powerpc,%d] NULL per-cpu pointer", __LINE__)); + + for (i = 0, phw = pac->pc_ppcpmcs; i < PPC970_MAX_PMCS; i++, phw++) { + phw->phw_state = PMC_PHW_FLAG_IS_ENABLED | + PMC_PHW_CPU_TO_STATE(cpu) | PMC_PHW_INDEX_TO_STATE(i); + phw->phw_pmc = NULL; + pc->pc_hwpmcs[i + first_ri] = phw; + } + + /* Clear the MMCRs, and set FC, to disable all PMCs. */ + /* 970 PMC is not counted when set to 0x08 */ + mtspr(SPR_970MMCR0, SPR_MMCR0_FC | SPR_MMCR0_PMXE | SPR_MMCR0_PMC1CE | + SPR_MMCR0_PMCNCE | SPR_970MMCR0_PMC1SEL(0x8) | SPR_970MMCR0_PMC2SEL(0x8)); + mtspr(SPR_970MMCR1, 0x4218420); + + return 0; +} + +static int +ppc970_pcpu_fini(struct pmc_mdep *md, int cpu) +{ + register_t mmcr0 = mfspr(SPR_MMCR0); + + mmcr0 |= SPR_MMCR0_FC; + mmcr0 &= ~SPR_MMCR0_PMXE; + mtspr(SPR_MMCR0, mmcr0); + free(powerpc_pcpu[cpu]->pc_ppcpmcs, M_PMC); + free(powerpc_pcpu[cpu], M_PMC); + return 0; +} + +static int +ppc970_allocate_pmc(int cpu, int ri, struct pmc *pm, + const struct pmc_op_pmcallocate *a) +{ + enum pmc_event pe; + uint32_t caps, config = 0, counter = 0; + int i; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < PPC970_MAX_PMCS, + ("[powerpc,%d] illegal row index %d", __LINE__, ri)); + + caps = a->pm_caps; + + pe = a->pm_ev; + + if (pe < PMC_EV_PPC970_FIRST || pe > PMC_EV_PPC970_LAST) + return (EINVAL); + + for (i = 0; i < ppc970_event_codes_size; i++) { + if (ppc970_event_codes[i].pe_event == pe) { + config = ppc970_event_codes[i].pe_code; + counter = ppc970_event_codes[i].pe_flags; + break; + } + } + if (i == ppc970_event_codes_size) + return (EINVAL); + + if ((counter & (1 << ri)) == 0) + return (EINVAL); + + if (caps & PMC_CAP_SYSTEM) + config |= POWERPC_PMC_KERNEL_ENABLE; + if (caps & PMC_CAP_USER) + config |= POWERPC_PMC_USER_ENABLE; + if ((caps & (PMC_CAP_USER | PMC_CAP_SYSTEM)) == 0) + config |= POWERPC_PMC_ENABLE; + + pm->pm_md.pm_powerpc.pm_powerpc_evsel = config; + + PMCDBG(MDP,ALL,2,"powerpc-allocate ri=%d -> config=0x%x", ri, config); + + return 0; +} + +static int +ppc970_release_pmc(int cpu, int ri, struct pmc *pmc) +{ + struct pmc_hw *phw; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[powerpc,%d] illegal CPU value %d", __LINE__, cpu)); + KASSERT(ri >= 0 && ri < PPC970_MAX_PMCS, + ("[powerpc,%d] illegal row-index %d", __LINE__, ri)); + + phw = &powerpc_pcpu[cpu]->pc_ppcpmcs[ri]; + KASSERT(phw->phw_pmc == NULL, + ("[powerpc,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); + + return 0; +} + +int +pmc_ppc970_initialize(struct pmc_mdep *pmc_mdep) +{ + struct pmc_classdep *pcd; + + pmc_mdep->pmd_cputype = PMC_CPU_PPC_970; + + pcd = &pmc_mdep->pmd_classdep[PMC_MDEP_CLASS_INDEX_PPC970]; + pcd->pcd_caps = POWERPC_PMC_CAPS; + pcd->pcd_class = PMC_CLASS_PPC970; + pcd->pcd_num = PPC970_MAX_PMCS; + pcd->pcd_ri = pmc_mdep->pmd_npmc; + pcd->pcd_width = 32; + + pcd->pcd_allocate_pmc = ppc970_allocate_pmc; + pcd->pcd_config_pmc = ppc970_config_pmc; + pcd->pcd_pcpu_fini = ppc970_pcpu_fini; + pcd->pcd_pcpu_init = ppc970_pcpu_init; + pcd->pcd_describe = powerpc_describe; + pcd->pcd_get_config = powerpc_get_config; + pcd->pcd_read_pmc = ppc970_read_pmc; + pcd->pcd_release_pmc = ppc970_release_pmc; + pcd->pcd_start_pmc = ppc970_start_pmc; + pcd->pcd_stop_pmc = ppc970_stop_pmc; + pcd->pcd_write_pmc = ppc970_write_pmc; + + pmc_mdep->pmd_npmc += PPC970_MAX_PMCS; + pmc_mdep->pmd_intr = ppc970_intr; + + return (0); +} Modified: stable/10/sys/dev/hwpmc/pmc_events.h ============================================================================== --- stable/10/sys/dev/hwpmc/pmc_events.h Thu Mar 13 23:31:05 2014 (r263121) +++ stable/10/sys/dev/hwpmc/pmc_events.h Fri Mar 14 00:12:53 2014 (r263122) @@ -4749,6 +4749,61 @@ __PMC_EV_ALIAS("IMPC_C0H_TRK_REQUEST.ALL #define PMC_EV_PPC7450_FIRST PMC_EV_PPC7450_CYCLE #define PMC_EV_PPC7450_LAST PMC_EV_PPC7450_PREFETCH_ENGINE_FULL +#define __PMC_EV_PPC970() \ + __PMC_EV(PPC970, INSTR_COMPLETED) \ + __PMC_EV(PPC970, MARKED_GROUP_DISPATCH) \ + __PMC_EV(PPC970, MARKED_STORE_COMPLETED) \ + __PMC_EV(PPC970, GCT_EMPTY) \ + __PMC_EV(PPC970, RUN_CYCLES) \ + __PMC_EV(PPC970, OVERFLOW) \ + __PMC_EV(PPC970, CYCLES) \ + __PMC_EV(PPC970, THRESHOLD_TIMEOUT) \ + __PMC_EV(PPC970, GROUP_DISPATCH) \ + __PMC_EV(PPC970, BR_MARKED_INSTR_FINISH) \ + __PMC_EV(PPC970, GCT_EMPTY_BY_SRQ_FULL) \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 14 00:57:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E53F5EA5; Fri, 14 Mar 2014 00:57:33 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B768F768; Fri, 14 Mar 2014 00:57:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E0vX0S085182; Fri, 14 Mar 2014 00:57:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E0vXXg085179; Fri, 14 Mar 2014 00:57:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403140057.s2E0vXXg085179@svn.freebsd.org> From: Xin LI Date: Fri, 14 Mar 2014 00:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263125 - stable/10/sys/dev/tws X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 00:57:34 -0000 Author: delphij Date: Fri Mar 14 00:57:32 2014 New Revision: 263125 URL: http://svnweb.freebsd.org/changeset/base/263125 Log: MFC r262572: Get rid of the 'chan' from softc structure and use the latter directly as sleep channel. PR: kern/174684 Submitted by: jmg Modified: stable/10/sys/dev/tws/tws.h stable/10/sys/dev/tws/tws_cam.c stable/10/sys/dev/tws/tws_user.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/tws/tws.h ============================================================================== --- stable/10/sys/dev/tws/tws.h Fri Mar 14 00:49:02 2014 (r263124) +++ stable/10/sys/dev/tws/tws.h Fri Mar 14 00:57:32 2014 (r263125) @@ -248,7 +248,6 @@ struct tws_softc { struct mtx io_lock; /* IO lock */ struct tws_ioctl_lock ioctl_lock; /* ioctl lock */ u_int32_t seq_id; /* Sequence id */ - void *chan; /* IOCTL req wait channel */ struct tws_circular_q aen_q; /* aen q */ struct tws_circular_q trace_q; /* trace q */ struct tws_stats stats; /* I/O stats */ Modified: stable/10/sys/dev/tws/tws_cam.c ============================================================================== --- stable/10/sys/dev/tws/tws_cam.c Fri Mar 14 00:49:02 2014 (r263124) +++ stable/10/sys/dev/tws/tws_cam.c Fri Mar 14 00:57:32 2014 (r263125) @@ -1297,7 +1297,7 @@ tws_reinit(void *arg) tws_turn_on_interrupts(sc); - wakeup_one(sc->chan); + wakeup_one(sc); } Modified: stable/10/sys/dev/tws/tws_user.c ============================================================================== --- stable/10/sys/dev/tws/tws_user.c Fri Mar 14 00:49:02 2014 (r263124) +++ stable/10/sys/dev/tws/tws_user.c Fri Mar 14 00:57:32 2014 (r263125) @@ -103,8 +103,7 @@ tws_passthru(struct tws_softc *sc, void do { req = tws_get_request(sc, TWS_REQ_TYPE_PASSTHRU); if ( !req ) { - sc->chan = (void *)sc; - error = tsleep(sc->chan, 0, "tws_sleep", TWS_IOCTL_TIMEOUT*hz); + error = tsleep(sc, 0, "tws_sleep", TWS_IOCTL_TIMEOUT*hz); if ( error == EWOULDBLOCK ) { return(ETIMEDOUT); } @@ -203,7 +202,7 @@ out_data: // req->state = TWS_REQ_STATE_FREE; - wakeup_one(sc->chan); + wakeup_one(sc); return(error); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 14 01:09:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 82CF9391; Fri, 14 Mar 2014 01:09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F517837; Fri, 14 Mar 2014 01:09:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E19hOV089597; Fri, 14 Mar 2014 01:09:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E19hMU089596; Fri, 14 Mar 2014 01:09:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403140109.s2E19hMU089596@svn.freebsd.org> From: Xin LI Date: Fri, 14 Mar 2014 01:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263127 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 01:09:43 -0000 Author: delphij Date: Fri Mar 14 01:09:42 2014 New Revision: 263127 URL: http://svnweb.freebsd.org/changeset/base/263127 Log: MFC r262577: MFV r262570: 4626 libzfs memleak in zpool_in_use() Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Mar 14 01:05:32 2014 (r263126) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Mar 14 01:09:42 2014 (r263127) @@ -20,8 +20,8 @@ */ /* * Copyright (c) 2005, 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 2014 Nexenta Systems, Inc. All rights reserved. */ /* @@ -1613,9 +1613,16 @@ zpool_in_use(libzfs_handle_t *hdl, int f * its state to active. */ if (pool_active(hdl, name, guid, &isactive) == 0 && isactive && - (zhp = zpool_open_canfail(hdl, name)) != NULL && - zpool_get_prop_int(zhp, ZPOOL_PROP_READONLY, NULL)) - stateval = POOL_STATE_ACTIVE; + (zhp = zpool_open_canfail(hdl, name)) != NULL) { + if (zpool_get_prop_int(zhp, ZPOOL_PROP_READONLY, NULL)) + stateval = POOL_STATE_ACTIVE; + + /* + * All we needed the zpool handle for is the + * readonly prop check. + */ + zpool_close(zhp); + } ret = B_TRUE; break; From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 14 02:37:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A159D1CD; Fri, 14 Mar 2014 02:37:07 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D893EBA; Fri, 14 Mar 2014 02:37:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E2b7f2026226; Fri, 14 Mar 2014 02:37:07 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E2b7MG026225; Fri, 14 Mar 2014 02:37:07 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201403140237.s2E2b7MG026225@svn.freebsd.org> From: Justin Hibbits Date: Fri, 14 Mar 2014 02:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263132 - stable/10/sys/modules/hwpmc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:37:07 -0000 Author: jhibbits Date: Fri Mar 14 02:37:07 2014 New Revision: 263132 URL: http://svnweb.freebsd.org/changeset/base/263132 Log: MFC r262530 Add missing file to Makefile Modified: stable/10/sys/modules/hwpmc/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/hwpmc/Makefile ============================================================================== --- stable/10/sys/modules/hwpmc/Makefile Fri Mar 14 02:10:30 2014 (r263131) +++ stable/10/sys/modules/hwpmc/Makefile Fri Mar 14 02:37:07 2014 (r263132) @@ -29,7 +29,7 @@ SRCS+= hwpmc_ia64.c .endif .if ${MACHINE_CPUARCH} == "powerpc" -SRCS+= hwpmc_powerpc.c hwpmc_mpc7xxx.c +SRCS+= hwpmc_powerpc.c hwpmc_mpc7xxx.c hwpmc_ppc970.c .endif .if ${MACHINE_CPUARCH} == "sparc64" From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 14 04:35:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D6025BF2; Fri, 14 Mar 2014 04:35: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8B80B7F; Fri, 14 Mar 2014 04:35: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 s2E4ZJqa076319; Fri, 14 Mar 2014 04:35:19 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E4ZJO1076318; Fri, 14 Mar 2014 04:35:19 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201403140435.s2E4ZJO1076318@svn.freebsd.org> From: Justin Hibbits Date: Fri, 14 Mar 2014 04:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263151 - stable/10/sys/dev/hwpmc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 04:35:19 -0000 Author: jhibbits Date: Fri Mar 14 04:35:18 2014 New Revision: 263151 URL: http://svnweb.freebsd.org/changeset/base/263151 Log: MFC r262547 Fix callchain capture for hwpmc(4). While here, some style(9) fixes, too. Modified: stable/10/sys/dev/hwpmc/hwpmc_powerpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hwpmc/hwpmc_powerpc.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_powerpc.c Fri Mar 14 03:42:05 2014 (r263150) +++ stable/10/sys/dev/hwpmc/hwpmc_powerpc.c Fri Mar 14 04:35:18 2014 (r263151) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -60,10 +61,14 @@ pmc_save_kernel_callchain(uintptr_t *cc, cc[frames++] = PMC_TRAPFRAME_TO_PC(tf); sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf); - for (frames = 1; frames < maxsamples; frames++) { + for (; frames < maxsamples; frames++) { if (!INKERNEL(sp)) break; +#ifdef __powerpc64__ + cc[frames++] = sp[2]; +#else cc[frames++] = sp[1]; +#endif sp = (uintptr_t *)*sp; } return (frames); @@ -72,12 +77,14 @@ pmc_save_kernel_callchain(uintptr_t *cc, static int powerpc_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) { + return (0); } static int powerpc_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) { + return (0); } @@ -111,6 +118,7 @@ powerpc_describe(int cpu, int ri, struct int powerpc_get_config(int cpu, int ri, struct pmc **ppm) { + *ppm = powerpc_pcpu[cpu]->pc_ppcpmcs[ri].phw_pmc; return (0); @@ -182,11 +190,23 @@ pmc_save_user_callchain(uintptr_t *cc, i cc[frames++] = PMC_TRAPFRAME_TO_PC(tf); sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf); - for (frames = 1; frames < maxsamples; frames++) { + for (; frames < maxsamples; frames++) { if (!INUSER(sp)) break; - cc[frames++] = fuword(sp + 1); - sp = (uintptr_t *)fuword(sp); +#ifdef __powerpc64__ + /* Check if 32-bit mode. */ + if (!(tf->srr1 & PSL_SF)) { + cc[frames++] = fuword32((uint32_t *)sp + 1); + sp = (uintptr_t *)(uintptr_t)fuword32(sp); + } else { + cc[frames++] = fuword(sp + 2); + sp = (uintptr_t *)fuword(sp); + } +#else + cc[frames++] = fuword32((uint32_t *)sp + 1); + sp = (uintptr_t *)fuword32(sp); +#endif } + return (frames); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 14 07:47:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DD6B42D2; Fri, 14 Mar 2014 07:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF6B7ED5; Fri, 14 Mar 2014 07:47: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 s2E7lTXA053723; Fri, 14 Mar 2014 07:47:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E7lT8t053721; Fri, 14 Mar 2014 07:47:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403140747.s2E7lT8t053721@svn.freebsd.org> From: Alexander Motin Date: Fri, 14 Mar 2014 07:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263156 - in stable/10/sys: cam/ata sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 07:47:29 -0000 Author: mav Date: Fri Mar 14 07:47:28 2014 New Revision: 263156 URL: http://svnweb.freebsd.org/changeset/base/263156 Log: MFC r262886: Fix support for increased logical sector size (4K-native drives). - Logical sector size is measured in words, not bytes. - If physical sector is not bigger then logical sector, it does not mean it should be set equal to 512 bytes, but set to logical sector. PR: misc/187269 Submitted by: Ravi Pokala Modified: stable/10/sys/cam/ata/ata_all.c stable/10/sys/sys/ata.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ata/ata_all.c ============================================================================== --- stable/10/sys/cam/ata/ata_all.c Fri Mar 14 07:11:33 2014 (r263155) +++ stable/10/sys/cam/ata/ata_all.c Fri Mar 14 07:47:28 2014 (r263156) @@ -338,10 +338,10 @@ semb_print_ident_short(struct sep_identi uint32_t ata_logical_sector_size(struct ata_params *ident_data) { - if ((ident_data->pss & 0xc000) == 0x4000 && + if ((ident_data->pss & ATA_PSS_VALID_MASK) == ATA_PSS_VALID_VALUE && (ident_data->pss & ATA_PSS_LSSABOVE512)) { - return ((u_int32_t)ident_data->lss_1 | - ((u_int32_t)ident_data->lss_2 << 16)); + return (((u_int32_t)ident_data->lss_1 | + ((u_int32_t)ident_data->lss_2 << 16)) * 2); } return (512); } @@ -349,10 +349,13 @@ ata_logical_sector_size(struct ata_param uint64_t ata_physical_sector_size(struct ata_params *ident_data) { - if ((ident_data->pss & 0xc000) == 0x4000 && - (ident_data->pss & ATA_PSS_MULTLS)) { - return ((uint64_t)ata_logical_sector_size(ident_data) * - (1 << (ident_data->pss & ATA_PSS_LSPPS))); + if ((ident_data->pss & ATA_PSS_VALID_MASK) == ATA_PSS_VALID_VALUE) { + if (ident_data->pss & ATA_PSS_MULTLS) { + return ((uint64_t)ata_logical_sector_size(ident_data) * + (1 << (ident_data->pss & ATA_PSS_LSPPS))); + } else { + return (uint64_t)ata_logical_sector_size(ident_data); + } } return (512); } Modified: stable/10/sys/sys/ata.h ============================================================================== --- stable/10/sys/sys/ata.h Fri Mar 14 07:11:33 2014 (r263155) +++ stable/10/sys/sys/ata.h Fri Mar 14 07:47:28 2014 (r263156) @@ -214,6 +214,8 @@ struct ata_params { #define ATA_PSS_LSPPS 0x000F #define ATA_PSS_LSSABOVE512 0x1000 #define ATA_PSS_MULTLS 0x2000 +#define ATA_PSS_VALID_MASK 0xC000 +#define ATA_PSS_VALID_VALUE 0x4000 /*107*/ u_int16_t isd; /*108*/ u_int16_t wwn[4]; u_int16_t reserved112[5]; From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 14 09:11:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 544429DA; Fri, 14 Mar 2014 09:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36AC4ACC; Fri, 14 Mar 2014 09:11: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 s2E9BAOP093812; Fri, 14 Mar 2014 09:11:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E9BAZQ093811; Fri, 14 Mar 2014 09:11:10 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403140911.s2E9BAZQ093811@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 14 Mar 2014 09:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263162 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 09:11:10 -0000 Author: hselasky Date: Fri Mar 14 09:11:09 2014 New Revision: 263162 URL: http://svnweb.freebsd.org/changeset/base/263162 Log: MFC r262550, r262551 and r262554: Add support for kqfilter to USB character devices. Modified: stable/10/sys/dev/usb/usb_dev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_dev.c ============================================================================== --- stable/10/sys/dev/usb/usb_dev.c Fri Mar 14 08:56:19 2014 (r263161) +++ stable/10/sys/dev/usb/usb_dev.c Fri Mar 14 09:11:09 2014 (r263162) @@ -109,7 +109,7 @@ static void usb_dev_uninit(void *); static int usb_fifo_uiomove(struct usb_fifo *, void *, int, struct uio *); static void usb_fifo_check_methods(struct usb_fifo_methods *); -static struct usb_fifo *usb_fifo_alloc(void); +static struct usb_fifo *usb_fifo_alloc(struct mtx *); static struct usb_endpoint *usb_dev_get_ep(struct usb_device *, uint8_t, uint8_t); static void usb_loc_fill(struct usb_fs_privdata *, @@ -124,6 +124,7 @@ static d_ioctl_t usb_ioctl; static d_read_t usb_read; static d_write_t usb_write; static d_poll_t usb_poll; +static d_kqfilter_t usb_kqfilter; static d_ioctl_t usb_static_ioctl; @@ -141,7 +142,8 @@ struct cdevsw usb_devsw = { .d_flags = D_TRACKCLOSE, .d_read = usb_read, .d_write = usb_write, - .d_poll = usb_poll + .d_poll = usb_poll, + .d_kqfilter = usb_kqfilter, }; static struct cdev* usb_dev = NULL; @@ -368,15 +370,17 @@ usb_unref_device(struct usb_cdev_privdat } static struct usb_fifo * -usb_fifo_alloc(void) +usb_fifo_alloc(struct mtx *mtx) { struct usb_fifo *f; f = malloc(sizeof(*f), M_USBDEV, M_WAITOK | M_ZERO); - if (f) { + if (f != NULL) { cv_init(&f->cv_io, "FIFO-IO"); cv_init(&f->cv_drain, "FIFO-DRAIN"); + f->priv_mtx = mtx; f->refcount = 1; + knlist_init_mtx(&f->selinfo.si_note, mtx); } return (f); } @@ -500,7 +504,7 @@ usb_fifo_create(struct usb_cdev_privdata DPRINTFN(5, "dev_get_endpoint returned NULL\n"); return (EINVAL); } - f = usb_fifo_alloc(); + f = usb_fifo_alloc(&udev->device_mtx); if (f == NULL) { DPRINTFN(5, "could not alloc tx fifo\n"); return (ENOMEM); @@ -508,7 +512,6 @@ usb_fifo_create(struct usb_cdev_privdata /* update some fields */ f->fifo_index = n + USB_FIFO_TX; f->dev_ep_index = e; - f->priv_mtx = &udev->device_mtx; f->priv_sc0 = ep; f->methods = &usb_ugen_methods; f->iface_index = ep->iface_index; @@ -527,7 +530,7 @@ usb_fifo_create(struct usb_cdev_privdata DPRINTFN(5, "dev_get_endpoint returned NULL\n"); return (EINVAL); } - f = usb_fifo_alloc(); + f = usb_fifo_alloc(&udev->device_mtx); if (f == NULL) { DPRINTFN(5, "could not alloc rx fifo\n"); return (ENOMEM); @@ -535,7 +538,6 @@ usb_fifo_create(struct usb_cdev_privdata /* update some fields */ f->fifo_index = n + USB_FIFO_RX; f->dev_ep_index = e; - f->priv_mtx = &udev->device_mtx; f->priv_sc0 = ep; f->methods = &usb_ugen_methods; f->iface_index = ep->iface_index; @@ -620,6 +622,10 @@ usb_fifo_free(struct usb_fifo *f) cv_destroy(&f->cv_io); cv_destroy(&f->cv_drain); + knlist_clear(&f->selinfo.si_note, 0); + seldrain(&f->selinfo); + knlist_destroy(&f->selinfo.si_note); + free(f, M_USBDEV); } @@ -774,7 +780,12 @@ usb_fifo_close(struct usb_fifo *f, int f mtx_lock(f->priv_mtx); /* clear current cdev private data pointer */ + mtx_lock(&usb_ref_lock); f->curr_cpd = NULL; + mtx_unlock(&usb_ref_lock); + + /* check if we are watched by kevent */ + KNOTE_LOCKED(&f->selinfo.si_note, 0); /* check if we are selected */ if (f->flag_isselect) { @@ -1117,6 +1128,162 @@ done: return (err); } +static void +usb_filter_detach(struct knote *kn) +{ + struct usb_fifo *f = kn->kn_hook; + knlist_remove(&f->selinfo.si_note, kn, 0); +} + +static int +usb_filter_write(struct knote *kn, long hint) +{ + struct usb_cdev_privdata* cpd; + struct usb_fifo *f; + struct usb_mbuf *m; + + DPRINTFN(2, "\n"); + + f = kn->kn_hook; + + mtx_assert(f->priv_mtx, MA_OWNED); + + cpd = f->curr_cpd; + if (cpd == NULL) { + m = (void *)1; + } else if (f->fs_ep_max == 0) { + if (f->flag_iserror) { + /* we got an error */ + m = (void *)1; + } else { + if (f->queue_data == NULL) { + /* + * start write transfer, if not + * already started + */ + (f->methods->f_start_write) (f); + } + /* check if any packets are available */ + USB_IF_POLL(&f->free_q, m); + } + } else { + if (f->flag_iscomplete) { + m = (void *)1; + } else { + m = NULL; + } + } + return (m ? 1 : 0); +} + +static int +usb_filter_read(struct knote *kn, long hint) +{ + struct usb_cdev_privdata* cpd; + struct usb_fifo *f; + struct usb_mbuf *m; + + DPRINTFN(2, "\n"); + + f = kn->kn_hook; + + mtx_assert(f->priv_mtx, MA_OWNED); + + cpd = f->curr_cpd; + if (cpd == NULL) { + m = (void *)1; + } else if (f->fs_ep_max == 0) { + if (f->flag_iserror) { + /* we have an error */ + m = (void *)1; + } else { + if (f->queue_data == NULL) { + /* + * start read transfer, if not + * already started + */ + (f->methods->f_start_read) (f); + } + /* check if any packets are available */ + USB_IF_POLL(&f->used_q, m); + + /* start reading data, if any */ + if (m == NULL) + (f->methods->f_start_read) (f); + } + } else { + if (f->flag_iscomplete) { + m = (void *)1; + } else { + m = NULL; + } + } + return (m ? 1 : 0); +} + +static struct filterops usb_filtops_write = { + .f_isfd = 1, + .f_detach = usb_filter_detach, + .f_event = usb_filter_write, +}; + +static struct filterops usb_filtops_read = { + .f_isfd = 1, + .f_detach = usb_filter_detach, + .f_event = usb_filter_read, +}; + + +/* ARGSUSED */ +static int +usb_kqfilter(struct cdev* dev, struct knote *kn) +{ + struct usb_cdev_refdata refs; + struct usb_cdev_privdata* cpd; + struct usb_fifo *f; + int fflags; + int err = EINVAL; + + DPRINTFN(2, "\n"); + + if (devfs_get_cdevpriv((void **)&cpd) != 0 || + usb_ref_device(cpd, &refs, 0) != 0) + return (ENXIO); + + fflags = cpd->fflags; + + /* Figure out who needs service */ + switch (kn->kn_filter) { + case EVFILT_WRITE: + if (fflags & FWRITE) { + f = refs.txfifo; + kn->kn_fop = &usb_filtops_write; + err = 0; + } + break; + case EVFILT_READ: + if (fflags & FREAD) { + f = refs.rxfifo; + kn->kn_fop = &usb_filtops_read; + err = 0; + } + break; + default: + err = EOPNOTSUPP; + break; + } + + if (err == 0) { + kn->kn_hook = f; + mtx_lock(f->priv_mtx); + knlist_add(&f->selinfo.si_note, kn, 1); + mtx_unlock(f->priv_mtx); + } + + usb_unref_device(cpd, &refs); + return (err); +} + /* ARGSUSED */ static int usb_poll(struct cdev* dev, int events, struct thread* td) @@ -1184,7 +1351,7 @@ usb_poll(struct cdev* dev, int events, s if (!refs.is_usbfs) { if (f->flag_iserror) { - /* we have and error */ + /* we have an error */ m = (void *)1; } else { if (f->queue_data == NULL) { @@ -1581,6 +1748,8 @@ usb_fifo_wakeup(struct usb_fifo *f) { usb_fifo_signal(f); + KNOTE_LOCKED(&f->selinfo.si_note, 0); + if (f->flag_isselect) { selwakeup(&f->selinfo); f->flag_isselect = 0; @@ -1696,8 +1865,8 @@ usb_fifo_attach(struct usb_device *udev, break; } - f_tx = usb_fifo_alloc(); - f_rx = usb_fifo_alloc(); + f_tx = usb_fifo_alloc(priv_mtx); + f_rx = usb_fifo_alloc(priv_mtx); if ((f_tx == NULL) || (f_rx == NULL)) { usb_fifo_free(f_tx); @@ -1708,7 +1877,6 @@ usb_fifo_attach(struct usb_device *udev, f_tx->fifo_index = n + USB_FIFO_TX; f_tx->dev_ep_index = -1; - f_tx->priv_mtx = priv_mtx; f_tx->priv_sc0 = priv_sc; f_tx->methods = pm; f_tx->iface_index = iface_index; @@ -1716,7 +1884,6 @@ usb_fifo_attach(struct usb_device *udev, f_rx->fifo_index = n + USB_FIFO_RX; f_rx->dev_ep_index = -1; - f_rx->priv_mtx = priv_mtx; f_rx->priv_sc0 = priv_sc; f_rx->methods = pm; f_rx->iface_index = iface_index; From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 14 09:42:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 197E9CBE; Fri, 14 Mar 2014 09:42:58 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED7CDE7B; Fri, 14 Mar 2014 09:42: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 s2E9gvEa006768; Fri, 14 Mar 2014 09:42:57 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E9gvaY006767; Fri, 14 Mar 2014 09:42:57 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403140942.s2E9gvaY006767@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 14 Mar 2014 09:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263164 - stable/10/etc/devd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 09:42:58 -0000 Author: hselasky Date: Fri Mar 14 09:42:57 2014 New Revision: 263164 URL: http://svnweb.freebsd.org/changeset/base/263164 Log: MFC Sync usb.conf file to head branch. Modified: stable/10/etc/devd/usb.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/devd/usb.conf ============================================================================== --- stable/10/etc/devd/usb.conf Fri Mar 14 09:13:53 2014 (r263163) +++ stable/10/etc/devd/usb.conf Fri Mar 14 09:42:57 2014 (r263164) @@ -1,7 +1,7 @@ # # $FreeBSD$ # -# This file was automatically generated by "tools/bus_autoconf.sh". +# This file was automatically generated by "tools/tools/bus_autoconf/bus_autoconf.sh". # Please do not edit! # @@ -721,6 +721,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x050d"; + match "product" "0x1103"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; match "product" "0x1203"; action "kldload -n ubsa"; }; @@ -1064,6 +1072,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0586"; + match "product" "0x3421"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x058f"; match "product" "0x9720"; action "kldload -n uplcom"; @@ -1081,7 +1097,39 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05ac"; - match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c|0x0229|0x022a|0x022b|0x030a|0x030b)"; + match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c)"; + action "kldload -n atp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x0223|0x0224|0x0225)"; + action "kldload -n wsp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x0229|0x022a|0x022b)"; + action "kldload -n atp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x0230|0x0231|0x0232|0x0236|0x0237|0x0238|0x023f|0x0240|0x0241|0x0242|0x0243|0x0244|0x0245|0x0246|0x0247|0x0249|0x024a|0x024b|0x024c|0x024d|0x024e|0x0252|0x0253|0x0254|0x0259|0x025a|0x025b|0x0262|0x0263|0x0264|0x0290|0x0291|0x0292)"; + action "kldload -n wsp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x030a|0x030b)"; action "kldload -n atp"; }; @@ -1801,6 +1849,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0846"; + match "product" "0x1100"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; match "product" "0x4240"; action "kldload -n if_upgt"; }; @@ -2185,7 +2241,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0af0"; - match "product" "(0x7601|0xc031|0xd013|0xd031)"; + match "product" "(0x7601|0x9000|0xc031|0xd013|0xd031)"; action "kldload -n uhso"; }; @@ -2289,6 +2345,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b05"; + match "product" "0x17ad"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; match "product" "(0x17b5|0x17cb)"; action "kldload -n ng_ubt"; }; @@ -2361,7 +2425,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b95"; - match "product" "(0x1720|0x1780|0x7720|0x772a|0x772b|0x7e2b)"; + match "product" "(0x1720|0x1780)"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b95"; + match "product" "(0x178a|0x1790)"; + action "kldload -n if_axge"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b95"; + match "product" "(0x7720|0x772a|0x772b|0x7e2b)"; action "kldload -n if_axe"; }; @@ -2433,7 +2513,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "(0x8176|0x8177|0x8178|0x817a|0x817b|0x817c|0x817d|0x817e)"; + match "product" "(0x8176|0x8176|0x8177|0x8178|0x817a|0x817b|0x817c|0x817d|0x817e)"; action "kldload -n if_urtwn"; }; @@ -3104,6 +3184,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0fde"; + match "product" "0xca05"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0fe6"; match "product" "(0x8101|0x9700)"; action "kldload -n if_udav"; @@ -3265,7 +3353,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x10c4"; - match "product" "(0x8066|0x806f|0x807a|0x80c4|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x815f|0x818b|0x819f|0x81a6|0x81a9|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x83d8|0x8411|0x8418|0x846e|0x8477|0x85ea|0x85eb|0x8664|0x8665|0xea60|0xea61|0xea70|0xea71|0xea80|0xf001|0xf002|0xf003|0xf004)"; + match "product" "(0x8066|0x806f|0x807a|0x80c4|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x815f|0x818b|0x819f|0x81a6|0x81a9|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x83d8|0x8411|0x8418|0x846e|0x8477|0x85ea|0x85eb|0x85f8|0x8664|0x8665|0x88a4|0x88a5|0xea60|0xea61|0xea70|0xea71|0xea80|0xf001|0xf002|0xf003|0xf004)"; action "kldload -n uslcom"; }; @@ -3777,7 +3865,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x148f"; - match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x5370|0x5572|0x8070)"; + match "product" "(0x2770|0x2870|0x2878|0x3070|0x3071|0x3072|0x3370|0x3572|0x3573|0x5370|0x5572|0x8070)"; action "kldload -n if_run"; }; @@ -4376,6 +4464,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1adb"; + match "product" "0x0001"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x1b3d"; match "product" "(0x0100|0x0101|0x0102|0x0103|0x0104|0x0105|0x0106|0x0107|0x0108|0x0109|0x010a|0x010b|0x010c|0x010d|0x010e|0x010f|0x0110|0x0111|0x0112|0x0113|0x0114|0x0115|0x0116|0x0117|0x0118|0x0119|0x011a|0x011b|0x011c|0x011d|0x011e|0x011f|0x0120|0x0121|0x0122|0x0123|0x0124|0x0125|0x0126|0x0128|0x0129|0x012a|0x012b|0x012d|0x012e|0x012f|0x0130|0x0131|0x0132|0x0133|0x0134|0x0135|0x0136|0x0137|0x0138|0x0139|0x013a|0x013b|0x013c|0x013d|0x013e|0x013f|0x0140|0x0141|0x0142|0x0143|0x0144|0x0145|0x0146|0x0147|0x0148|0x0149|0x014a|0x014b|0x014c|0x014d|0x014e|0x014f|0x0150|0x0151|0x0152|0x0153|0x0159|0x015a|0x015b|0x015c|0x015d|0x015e|0x015f|0x0160|0x0161|0x0162|0x0163|0x0164|0x0165|0x0166|0x0167|0x0168|0x0169|0x016a|0x016b|0x016c|0x016d|0x016e|0x016f|0x0170|0x0171|0x0172|0x0173|0x0174|0x0175|0x0176|0x0177|0x0178|0x0179|0x017a|0x017b|0x017c|0x017d|0x017e|0x017f|0x0180|0x0181|0x0182|0x0183|0x0184|0x0185|0x0186|0x0187|0x0188|0x0189|0x018a|0x018b|0x018c|0x018d|0x018e|0x018f|0x0190|0x0191|0x019 2|0x0193|0x0194|0x0195|0x0196|0x0197|0x0198|0x0199|0x019a|0x019b|0x019c|0x019d|0x019e|0x019f|0x01a0|0x01a1|0x01a2|0x01a3|0x01a4|0x01a5|0x01a6|0x01a7|0x01a8|0x01a9|0x01aa|0x01ab|0x01ac|0x01ad|0x01ae|0x01af|0x01b0|0x01b1|0x01b2|0x01b3|0x01b4|0x01b5|0x01b6|0x01b7|0x01b8|0x01b9|0x01ba|0x01bb|0x01bc|0x01bd|0x01be|0x01bf|0x01c0|0x01c1|0x01c2|0x01c3|0x01c4|0x01c5|0x01c6|0x01c7|0x01c8|0x01c9|0x01ca|0x01cb|0x01cc|0x01cd|0x01ce|0x01cf|0x01d0|0x01d1|0x01d2|0x01d3|0x01d4|0x01d5|0x01d6|0x01d7|0x01d8|0x01d9|0x01da|0x01db|0x01dc|0x01dd|0x01de|0x01df|0x01e0|0x01e1|0x01e2|0x01e3|0x01e4|0x01e5|0x01e6|0x01e7|0x01e8|0x01e9|0x01ea|0x01eb|0x01ec|0x01ed|0x01ee|0x01ef|0x01f0|0x01f1|0x01f2|0x01f3|0x01f4|0x01f5|0x01f6|0x01f7|0x01f8|0x01f9|0x01fa|0x01fb|0x01fc|0x01fd|0x01fe|0x01ff)"; action "kldload -n uftdi"; @@ -4512,6 +4608,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1fb9"; + match "product" "(0x0100|0x0200|0x0201|0x0202|0x0203|0x0300|0x0301|0x0302|0x0303|0x0400|0x0401|0x0402|0x0403|0x0404|0x0600|0x0601|0x0602|0x0700|0x0701)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x2001"; match "product" "(0x1a00|0x1a02)"; action "kldload -n if_axe"; @@ -4561,7 +4665,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b)"; + match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b|0x3c1f)"; action "kldload -n if_run"; }; @@ -4768,6 +4872,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x2405"; + match "product" "0x0003"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x2478"; match "product" "0x2008"; action "kldload -n uplcom"; @@ -4985,7 +5097,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x7392"; - match "product" "(0x7711|0x7717|0x7718)"; + match "product" "(0x7711|0x7717|0x7718|0x7733)"; action "kldload -n if_run"; }; @@ -5122,6 +5234,15 @@ nomatch 32 { match "mode" "host"; match "intclass" "0x02"; match "intsubclass" "0x02"; + match "intprotocol" "0x00"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; match "intprotocol" "0x01"; action "kldload -n umodem"; }; @@ -5192,6 +5313,24 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "intclass" "0xe0"; + match "intsubclass" "0x01"; + match "intprotocol" "0x03"; + action "kldload -n if_urndis"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0xef"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload -n if_urndis"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "intclass" "0xff"; match "intsubclass" "0x5d"; match "intprotocol" "0x01"; @@ -5260,5 +5399,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2545 USB entries processed +# 2621 USB entries processed From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 14 16:42:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 46B5DC8C; Fri, 14 Mar 2014 16:42: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 326E7145; Fri, 14 Mar 2014 16:42: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 s2EGgLit082141; Fri, 14 Mar 2014 16:42:21 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EGgLcX082140; Fri, 14 Mar 2014 16:42:21 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201403141642.s2EGgLcX082140@svn.freebsd.org> From: Justin Hibbits Date: Fri, 14 Mar 2014 16:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263177 - stable/10/contrib/binutils/gas/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 16:42:21 -0000 Author: jhibbits Date: Fri Mar 14 16:42:20 2014 New Revision: 263177 URL: http://svnweb.freebsd.org/changeset/base/263177 Log: MFC r261422 Make gas accept any PowerPC instruction by default. This is a local change, and will not be submitted upstream. Discussed with: nwhitehorn,rdivacky Modified: stable/10/contrib/binutils/gas/config/tc-ppc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-ppc.c ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-ppc.c Fri Mar 14 14:16:53 2014 (r263176) +++ stable/10/contrib/binutils/gas/config/tc-ppc.c Fri Mar 14 16:42:20 2014 (r263177) @@ -681,7 +681,7 @@ ppc_parse_name (const char *name, expres /* The type of processor we are assembling for. This is one or more of the PPC_OPCODE flags defined in opcode/ppc.h. */ -static unsigned long ppc_cpu = 0; +static unsigned long ppc_cpu = PPC_OPCODE_ANY; /* Whether to target xcoff64/elf64. */ static unsigned int ppc_obj64 = BFD_DEFAULT_TARGET_SIZE == 64; From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 15 00:23:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 149FBE4F; Sat, 15 Mar 2014 00:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E82ECDB; Sat, 15 Mar 2014 00:23: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 s2F0NZOs069098; Sat, 15 Mar 2014 00:23:35 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2F0NZL9069095; Sat, 15 Mar 2014 00:23:35 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201403150023.s2F0NZL9069095@svn.freebsd.org> From: Justin Hibbits Date: Sat, 15 Mar 2014 00:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263197 - in stable/10/sys: conf dev/iicbus powerpc/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 00:23:36 -0000 Author: jhibbits Date: Sat Mar 15 00:23:35 2014 New Revision: 263197 URL: http://svnweb.freebsd.org/changeset/base/263197 Log: MFC r261421 Add driver for the ADT7460/ADT7467 fan controller found in later PowerBooks and iBooks. Original work by andreast. Added: stable/10/sys/dev/iicbus/adt746x.c - copied unchanged from r261421, head/sys/dev/iicbus/adt746x.c Modified: stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/conf/GENERIC Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Fri Mar 14 22:07:08 2014 (r263196) +++ stable/10/sys/conf/files.powerpc Sat Mar 15 00:23:35 2014 (r263197) @@ -33,6 +33,7 @@ dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/hwpmc/hwpmc_mpc7xxx.c optional hwpmc dev/hwpmc/hwpmc_ppc970.c optional hwpmc dev/iicbus/ad7417.c optional ad7417 powermac +dev/iicbus/adt746x.c optional adt746x powermac dev/iicbus/ds1631.c optional ds1631 powermac dev/iicbus/ds1775.c optional ds1775 powermac dev/iicbus/max6690.c optional max6690 powermac Copied: stable/10/sys/dev/iicbus/adt746x.c (from r261421, head/sys/dev/iicbus/adt746x.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/iicbus/adt746x.c Sat Mar 15 00:23:35 2014 (r263197, copy of r261421, head/sys/dev/iicbus/adt746x.c) @@ -0,0 +1,664 @@ +/*- + * Copyright (c) 2012 Andreas Tobler + * Copyright (c) 2014 Justin Hibbits + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +/* ADT746X registers. */ +#define ADT746X_TACH1LOW 0x28 +#define ADT746X_TACH1HIGH 0x29 +#define ADT746X_TACH2LOW 0x2a +#define ADT746X_TACH2HIGH 0x2b +#define ADT746X_PWM1 0x30 +#define ADT746X_PWM2 0x31 +#define ADT746X_DEVICE_ID 0x3d +#define ADT746X_COMPANY_ID 0x3e +#define ADT746X_REV_ID 0x3f +#define ADT746X_CONFIG 0x40 +#define ADT746X_PWM1_CONF 0x5c +#define ADT746X_PWM2_CONF 0x5d +#define ADT746X_MANUAL_MASK 0xe0 + +#define ADT7460_DEV_ID 0x27 +#define ADT7467_DEV_ID 0x68 + +struct adt746x_fan { + struct pmac_fan fan; + device_t dev; + int id; + int setpoint; + int pwm_reg; + int conf_reg; +}; + +struct adt746x_sensor { + struct pmac_therm therm; + device_t dev; + int id; + cell_t reg; + enum { + ADT746X_SENSOR_TEMP, + ADT746X_SENSOR_VOLT, + ADT746X_SENSOR_SPEED + } type; +}; + +struct adt746x_softc { + device_t sc_dev; + struct intr_config_hook enum_hook; + uint32_t sc_addr; + /* The 7467 supports up to 4 fans, 2 voltage and 3 temperature sensors. */ + struct adt746x_fan sc_fans[4]; + int sc_nfans; + struct adt746x_sensor sc_sensors[9]; + int sc_nsensors; + int device_id; + +}; + + +/* Regular bus attachment functions */ + +static int adt746x_probe(device_t); +static int adt746x_attach(device_t); + + +/* Utility functions */ +static void adt746x_attach_fans(device_t dev); +static void adt746x_attach_sensors(device_t dev); +static int adt746x_fill_fan_prop(device_t dev); +static int adt746x_fill_sensor_prop(device_t dev); + +static int adt746x_fan_set_pwm(struct adt746x_fan *fan, int pwm); +static int adt746x_fan_get_pwm(struct adt746x_fan *fan); +static int adt746x_sensor_read(struct adt746x_sensor *sens); +static void adt746x_start(void *xdev); + +/* i2c read/write functions. */ +static int adt746x_write(device_t dev, uint32_t addr, uint8_t reg, + uint8_t *buf); +static int adt746x_read(device_t dev, uint32_t addr, uint8_t reg, + uint8_t *data); + +static device_method_t adt746x_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, adt746x_probe), + DEVMETHOD(device_attach, adt746x_attach), + { 0, 0 }, +}; + +static driver_t adt746x_driver = { + "adt746x", + adt746x_methods, + sizeof(struct adt746x_softc) +}; + +static devclass_t adt746x_devclass; + +DRIVER_MODULE(adt746x, iicbus, adt746x_driver, adt746x_devclass, 0, 0); +static MALLOC_DEFINE(M_ADT746X, "adt746x", "ADT Sensor Information"); + + +/* i2c read/write functions. */ + +static int +adt746x_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buff) +{ + uint8_t buf[4]; + int try = 0; + + struct iic_msg msg[] = { + {addr, IIC_M_WR, 2, buf } + }; + + /* Prepare the write msg. */ + buf[0] = reg; + memcpy(buf + 1, buff, 1); + + for (;;) + { + if (iicbus_transfer(dev, msg, 1) == 0) + return (0); + if (++try > 5) { + device_printf(dev, "iicbus write failed\n"); + return (-1); + } + pause("adt746x_write", hz); + } + return (0); +} + +static int +adt746x_read(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) +{ + uint8_t buf[4]; + int err, try = 0; + + struct iic_msg msg[2] = { + {addr, IIC_M_WR | IIC_M_NOSTOP, 1, ®}, + {addr, IIC_M_RD, 1, buf}, + }; + + for (;;) + { + err = iicbus_transfer(dev, msg, 2); + if (err != 0) + goto retry; + + *data = *((uint8_t*)buf); + return (0); + retry: + if (++try > 5) { + device_printf(dev, "iicbus read failed\n"); + return (-1); + } + pause("adt746x_read", hz); + } +} + +static int +adt746x_probe(device_t dev) +{ + const char *name, *compatible; + struct adt746x_softc *sc; + + name = ofw_bus_get_name(dev); + compatible = ofw_bus_get_compat(dev); + + if (!name) + return (ENXIO); + + if (strcmp(name, "fan") != 0 || + (strcmp(compatible, "adt7460") != 0 && + strcmp(compatible, "adt7467") != 0)) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + device_set_desc(dev, "Apple Thermostat Unit ADT746X"); + + return (0); +} + +static int +adt746x_attach(device_t dev) +{ + struct adt746x_softc *sc; + + sc = device_get_softc(dev); + + sc->enum_hook.ich_func = adt746x_start; + sc->enum_hook.ich_arg = dev; + + /* We have to wait until interrupts are enabled. I2C read and write + * only works if the interrupts are available. + * The unin/i2c is controlled by the htpic on unin. But this is not + * the master. The openpic on mac-io is controlling the htpic. + * This one gets attached after the mac-io probing and then the + * interrupts will be available. + */ + + if (config_intrhook_establish(&sc->enum_hook) != 0) + return (ENOMEM); + + return (0); +} + +static void +adt746x_start(void *xdev) +{ + uint8_t did, cid, rev, conf; + + struct adt746x_softc *sc; + + device_t dev = (device_t)xdev; + + sc = device_get_softc(dev); + + adt746x_read(sc->sc_dev, sc->sc_addr, ADT746X_DEVICE_ID, &did); + adt746x_read(sc->sc_dev, sc->sc_addr, ADT746X_COMPANY_ID, &cid); + adt746x_read(sc->sc_dev, sc->sc_addr, ADT746X_REV_ID, &rev); + adt746x_read(sc->sc_dev, sc->sc_addr, ADT746X_CONFIG, &conf); + + device_printf(dev, "Dev ID %#x, Company ID %#x, Rev ID %#x CNF: %#x\n", + did, cid, rev, conf); + + /* We can get the device id either from 'of' properties or from the chip + itself. This method makes sure we can read the chip, otherwise + we return. */ + + sc->device_id = did; + + conf = 1; + /* Start the ADT7460. */ + if (sc->device_id == ADT7460_DEV_ID) + adt746x_write(sc->sc_dev, sc->sc_addr, ADT746X_CONFIG, &conf); + + /* Detect and attach child devices. */ + adt746x_attach_fans(dev); + adt746x_attach_sensors(dev); + config_intrhook_disestablish(&sc->enum_hook); +} + +/* + * Sensor and fan management + */ +static int +adt746x_fan_set_pwm(struct adt746x_fan *fan, int pwm) +{ + uint8_t reg = 0, manual, mode = 0; + struct adt746x_softc *sc; + uint8_t buf; + + sc = device_get_softc(fan->dev); + + /* Clamp to allowed range */ + pwm = max(fan->fan.min_rpm, pwm); + pwm = min(fan->fan.max_rpm, pwm); + + reg = fan->pwm_reg; + mode = fan->conf_reg; + + /* From the 7460 datasheet: + PWM dutycycle can be programmed from 0% (0x00) to 100% (0xFF) + in steps of 0.39% (256 steps). + */ + buf = (pwm * 100 / 39) - (pwm ? 1 : 0); + fan->setpoint = buf; + + /* Manual mode. */ + adt746x_read(sc->sc_dev, sc->sc_addr, mode, &manual); + manual |= ADT746X_MANUAL_MASK; + adt746x_write(sc->sc_dev, sc->sc_addr, mode, &manual); + + /* Write speed. */ + adt746x_write(sc->sc_dev, sc->sc_addr, reg, &buf); + + return (0); +} + +static int +adt746x_fan_get_pwm(struct adt746x_fan *fan) +{ + uint8_t buf, reg; + uint16_t pwm; + struct adt746x_softc *sc; + + sc = device_get_softc(fan->dev); + + reg = fan->pwm_reg; + + adt746x_read(sc->sc_dev, sc->sc_addr, reg, &buf); + + pwm = (buf * 39 / 100) + (buf ? 1 : 0); + return (pwm); +} + +static int +adt746x_fill_fan_prop(device_t dev) +{ + phandle_t child; + struct adt746x_softc *sc; + u_int *id; + char *location; + int i, id_len, len = 0, location_len, prev_len = 0; + + sc = device_get_softc(dev); + + child = ofw_bus_get_node(dev); + + /* Fill the fan location property. */ + location_len = OF_getprop_alloc(child, "hwctrl-location", 1, (void **)&location); + id_len = OF_getprop_alloc(child, "hwctrl-id", sizeof(cell_t), (void **)&id); + if (location_len == -1 || id_len == -1) { + free(location, M_OFWPROP); + free(id, M_OFWPROP); + return 0; + } + + /* Fill in all the properties for each fan. */ + for (i = 0; i < id_len; i++) { + strlcpy(sc->sc_fans[i].fan.name, location + len, 32); + prev_len = strlen(location + len) + 1; + len += prev_len; + sc->sc_fans[i].id = id[i]; + if (id[i] == 6) { + sc->sc_fans[i].pwm_reg = ADT746X_PWM1; + sc->sc_fans[i].conf_reg = ADT746X_PWM1_CONF; + } else if (id[i] == 7) { + sc->sc_fans[i].pwm_reg = ADT746X_PWM2; + sc->sc_fans[i].conf_reg = ADT746X_PWM2_CONF; + } else { + sc->sc_fans[i].pwm_reg = ADT746X_PWM1 + i; + sc->sc_fans[i].conf_reg = ADT746X_PWM1_CONF + i; + } + sc->sc_fans[i].dev = sc->sc_dev; + sc->sc_fans[i].fan.min_rpm = 5; /* Percent */ + sc->sc_fans[i].fan.max_rpm = 100; + sc->sc_fans[i].fan.read = NULL; + sc->sc_fans[i].fan.set = + (int (*)(struct pmac_fan *, int))(adt746x_fan_set_pwm); + sc->sc_fans[i].fan.default_rpm = sc->sc_fans[i].fan.max_rpm; + } + free(location, M_OFWPROP); + free(id, M_OFWPROP); + + return (i); +} + +static int +adt746x_fill_sensor_prop(device_t dev) +{ + phandle_t child, node; + struct adt746x_softc *sc; + char sens_type[32]; + int i = 0, reg, sensid; + + sc = device_get_softc(dev); + + child = ofw_bus_get_node(dev); + + /* Fill in the sensor properties for each child. */ + for (node = OF_child(child); node != 0; node = OF_peer(node)) { + if (OF_getprop(node, "sensor-id", &sensid, sizeof(sensid)) == -1) + continue; + OF_getprop(node, "location", sc->sc_sensors[i].therm.name, 32); + OF_getprop(node, "device_type", sens_type, sizeof(sens_type)); + if (strcmp(sens_type, "temperature") == 0) + sc->sc_sensors[i].type = ADT746X_SENSOR_TEMP; + else if (strcmp(sens_type, "voltage") == 0) + sc->sc_sensors[i].type = ADT746X_SENSOR_VOLT; + else + sc->sc_sensors[i].type = ADT746X_SENSOR_SPEED; + OF_getprop(node, "reg", ®, sizeof(reg)); + OF_getprop(node, "sensor-id", &sensid, + sizeof(sensid)); + /* This is the i2c register of the sensor. */ + sc->sc_sensors[i].reg = reg; + sc->sc_sensors[i].id = sensid; + OF_getprop(node, "zone", &sc->sc_sensors[i].therm.zone, + sizeof(sc->sc_sensors[i].therm.zone)); + sc->sc_sensors[i].dev = dev; + sc->sc_sensors[i].therm.read = + (int (*)(struct pmac_therm *))adt746x_sensor_read; + if (sc->sc_sensors[i].type == ADT746X_SENSOR_TEMP) { + /* Make up some ranges */ + sc->sc_sensors[i].therm.target_temp = 500 + ZERO_C_TO_K; + sc->sc_sensors[i].therm.max_temp = 800 + ZERO_C_TO_K; + + pmac_thermal_sensor_register(&sc->sc_sensors[i].therm); + } + i++; + } + + return (i); +} + +static int +adt746x_fanrpm_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t adt; + struct adt746x_softc *sc; + struct adt746x_fan *fan; + int pwm = 0, error; + + adt = arg1; + sc = device_get_softc(adt); + fan = &sc->sc_fans[arg2]; + pwm = adt746x_fan_get_pwm(fan); + error = sysctl_handle_int(oidp, &pwm, 0, req); + + if (error || !req->newptr) + return (error); + + return (adt746x_fan_set_pwm(fan, pwm)); +} + +static void +adt746x_attach_fans(device_t dev) +{ + struct adt746x_softc *sc; + struct sysctl_oid *oid, *fanroot_oid; + struct sysctl_ctx_list *ctx; + phandle_t child; + char sysctl_name[32]; + int i, j; + + sc = device_get_softc(dev); + + sc->sc_nfans = 0; + + child = ofw_bus_get_node(dev); + + /* Count the actual number of fans. */ + sc->sc_nfans = adt746x_fill_fan_prop(dev); + + device_printf(dev, "%d fans detected!\n", sc->sc_nfans); + + if (sc->sc_nfans == 0) { + device_printf(dev, "WARNING: No fans detected!\n"); + return; + } + + ctx = device_get_sysctl_ctx(dev); + fanroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "fans", + CTLFLAG_RD, 0, "ADT Fan Information"); + + /* Now we can fill the properties into the allocated struct. */ + sc->sc_nfans = adt746x_fill_fan_prop(dev); + + /* Register fans with pmac_thermal */ + for (i = 0; i < sc->sc_nfans; i++) + pmac_thermal_fan_register(&sc->sc_fans[i].fan); + + /* Add sysctls for the fans. */ + for (i = 0; i < sc->sc_nfans; i++) { + for (j = 0; j < strlen(sc->sc_fans[i].fan.name); j++) { + sysctl_name[j] = tolower(sc->sc_fans[i].fan.name[j]); + if (isspace(sysctl_name[j])) + sysctl_name[j] = '_'; + } + sysctl_name[j] = 0; + + sc->sc_fans[i].setpoint = + adt746x_fan_get_pwm(&sc->sc_fans[i]); + + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(fanroot_oid), + OID_AUTO, sysctl_name, CTLFLAG_RD, 0, "Fan Information"); + + /* I use i to pass the fan id. */ + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "pwm", CTLTYPE_INT | CTLFLAG_RW, dev, i, + adt746x_fanrpm_sysctl, "I", "Fan PWM in %"); + } + + /* Dump fan location & type. */ + if (bootverbose) { + for (i = 0; i < sc->sc_nfans; i++) { + device_printf(dev, "Fan location: %s", + sc->sc_fans[i].fan.name); + device_printf(dev, " id: %d RPM: %d\n", + sc->sc_fans[i].id, + sc->sc_fans[i].setpoint); + } + } +} + +static int +adt746x_sensor_read(struct adt746x_sensor *sens) +{ + struct adt746x_softc *sc; + uint16_t tmp = 0; + uint16_t val; + uint8_t temp, data[1], data1[1]; + + sc = device_get_softc(sens->dev); + if (sens->type != ADT746X_SENSOR_SPEED) { + if (adt746x_read(sc->sc_dev, sc->sc_addr, sens->reg, + &temp) < 0) + return (-1); + if (sens->type == ADT746X_SENSOR_TEMP) + tmp = 10 * temp + ZERO_C_TO_K; + else + tmp = temp; + } else { + if (adt746x_read(sc->sc_dev, sc->sc_addr, sens->reg, + data) < 0) + return (-1); + if (adt746x_read(sc->sc_dev, sc->sc_addr, sens->reg + 1, + data1) < 0) + return (-1); + val = data[0] + (data1[0] << 8); + /* A value of 0xffff means the fan is stopped. */ + if (val == 0 || val == 0xffff) + tmp = 0; + else + tmp = (90000 * 60) / val; + } + return (tmp); +} + +static int +adt746x_sensor_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + struct adt746x_softc *sc; + struct adt746x_sensor *sens; + int value, error; + + dev = arg1; + sc = device_get_softc(dev); + sens = &sc->sc_sensors[arg2]; + + value = sens->therm.read(&sens->therm); + if (value < 0) + return (ENXIO); + + error = sysctl_handle_int(oidp, &value, 0, req); + + return (error); +} + +static void +adt746x_attach_sensors(device_t dev) +{ + struct adt746x_softc *sc; + struct sysctl_oid *oid, *sensroot_oid; + struct sysctl_ctx_list *ctx; + phandle_t child; + char sysctl_name[40]; + const char *unit; + const char *desc; + int i, j; + + + sc = device_get_softc(dev); + sc->sc_nsensors = 0; + child = ofw_bus_get_node(dev); + + /* Count the actual number of sensors. */ + sc->sc_nsensors = adt746x_fill_sensor_prop(dev); + device_printf(dev, "%d sensors detected!\n", sc->sc_nsensors); + if (sc->sc_nsensors == 0) { + device_printf(dev, "WARNING: No sensors detected!\n"); + return; + } + + ctx = device_get_sysctl_ctx(dev); + sensroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensors", + CTLFLAG_RD, 0, "ADT Sensor Information"); + + /* Add the sysctl for the sensors. */ + for (i = 0; i < sc->sc_nsensors; i++) { + for (j = 0; j < strlen(sc->sc_sensors[i].therm.name); j++) { + sysctl_name[j] = tolower(sc->sc_sensors[i].therm.name[j]); + if (isspace(sysctl_name[j])) + sysctl_name[j] = '_'; + } + sysctl_name[j] = 0; + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), + OID_AUTO, + sysctl_name, CTLFLAG_RD, 0, + "Sensor Information"); + if (sc->sc_sensors[i].type == ADT746X_SENSOR_TEMP) { + unit = "temp"; + desc = "sensor unit (C)"; + } else if (sc->sc_sensors[i].type == ADT746X_SENSOR_VOLT) { + unit = "volt"; + desc = "sensor unit (mV)"; + } else { + unit = "rpm"; + desc = "sensor unit (RPM)"; + } + /* I use i to pass the sensor id. */ + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + unit, CTLTYPE_INT | CTLFLAG_RD, dev, i, + adt746x_sensor_sysctl, + sc->sc_sensors[i].type == ADT746X_SENSOR_TEMP ? + "IK" : "I", desc); + } + + /* Dump sensor location & type. */ + if (bootverbose) { + for (i = 0; i < sc->sc_nsensors; i++) { + device_printf(dev, "Sensor location: %s", + sc->sc_sensors[i].therm.name); + device_printf(dev, " type: %d id: %d reg: 0x%x\n", + sc->sc_sensors[i].type, + sc->sc_sensors[i].id, + sc->sc_sensors[i].reg); + } + } +} Modified: stable/10/sys/powerpc/conf/GENERIC ============================================================================== --- stable/10/sys/powerpc/conf/GENERIC Fri Mar 14 22:07:08 2014 (r263196) +++ stable/10/sys/powerpc/conf/GENERIC Sat Mar 15 00:23:35 2014 (r263197) @@ -180,6 +180,7 @@ options AH_SUPPORT_AR5416 device iicbus # I2C bus code device kiic # Keywest I2C device ad7417 # PowerMac7,2 temperature sensor +device adt746x # PowerBook5,8 temperature sensor device ds1631 # PowerMac11,2 temperature sensor device ds1775 # PowerMac7,2 temperature sensor device fcu # Apple Fan Control Unit From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 15 18:19:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BEA99210; Sat, 15 Mar 2014 18:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F985660; Sat, 15 Mar 2014 18:19: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 s2FIJ9uB012216; Sat, 15 Mar 2014 18:19:09 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2FIJ9SE012215; Sat, 15 Mar 2014 18:19:09 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403151819.s2FIJ9SE012215@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 15 Mar 2014 18:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263208 - stable/10/sys/dev/usb/input X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 18:19:09 -0000 Author: hselasky Date: Sat Mar 15 18:19:09 2014 New Revision: 263208 URL: http://svnweb.freebsd.org/changeset/base/263208 Log: MFC r262663: - Make pointer easier to control when moving slowly. - Increase chance of vertical scrolling as vertical scrolling is used more often. Modified: stable/10/sys/dev/usb/input/wsp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/input/wsp.c ============================================================================== --- stable/10/sys/dev/usb/input/wsp.c Sat Mar 15 16:59:57 2014 (r263207) +++ stable/10/sys/dev/usb/input/wsp.c Sat Mar 15 18:19:09 2014 (r263208) @@ -401,6 +401,9 @@ struct wsp_softc { int dz_count; #define WSP_DZ_MAX_COUNT 32 int dt_sum; /* T-axis cumulative movement */ + int rdx; /* x axis remainder of divide by scale_factor */ + int rdy; /* y axis remainder of divide by scale_factor */ + int rdz; /* z axis remainder of divide by scale_factor */ int tp_datalen; uint8_t o_ntouch; /* old touch finger status */ uint8_t finger; /* 0 or 1 *, check which finger moving */ @@ -669,6 +672,9 @@ wsp_intr_callback(struct usb_xfer *xfer, int dx = 0; int dy = 0; int dz = 0; + int rdx = 0; + int rdy = 0; + int rdz = 0; int len; int i; @@ -830,6 +836,9 @@ wsp_intr_callback(struct usb_xfer *xfer, sc->dt_sum = 0; sc->dx_sum = 0; sc->dy_sum = 0; + sc->rdx = 0; + sc->rdy = 0; + sc->rdz = 0; sc->scr_mode = WSP_SCR_NONE; } else if (f[0].touch_major >= tun.pressure_touch_threshold && sc->sc_touch == WSP_UNTOUCH) { /* ignore first touch */ @@ -894,13 +903,22 @@ wsp_intr_callback(struct usb_xfer *xfer, DPRINTFN(WSP_LLEVEL_INFO, "dx=%5d, dy=%5d, mov=%5d\n", dx, dy, sc->finger); } - if (sc->dz_count--) - sc->dz_sum -= (dy / tun.scale_factor); + if (sc->dz_count--) { + rdz = (dy + sc->rdz) % tun.scale_factor; + sc->dz_sum -= (dy + sc->rdz) / tun.scale_factor; + sc->rdz = rdz; + } if ((sc->dz_sum / tun.z_factor) != 0) sc->dz_count = 0; } - dx /= tun.scale_factor; - dy /= tun.scale_factor; + rdx = (dx + sc->rdx) % tun.scale_factor; + dx = (dx + sc->rdx) / tun.scale_factor; + sc->rdx = rdx; + + rdy = (dy + sc->rdy) % tun.scale_factor; + dy = (dy + sc->rdy) / tun.scale_factor; + sc->rdy = rdy; + sc->dx_sum += dx; sc->dy_sum += dy; @@ -908,7 +926,7 @@ wsp_intr_callback(struct usb_xfer *xfer, if (sc->scr_mode == WSP_SCR_NONE && abs(sc->dx_sum) + abs(sc->dy_sum) > tun.scr_hor_threshold) sc->scr_mode = abs(sc->dx_sum) > - abs(sc->dy_sum) ? WSP_SCR_HOR : + abs(sc->dy_sum) * 3 ? WSP_SCR_HOR : WSP_SCR_VER; DPRINTFN(WSP_LLEVEL_INFO, "scr_mode=%5d, count=%d, dx_sum=%d, dy_sum=%d\n", sc->scr_mode, sc->intr_count, sc->dx_sum, sc->dy_sum); @@ -945,8 +963,10 @@ wsp_intr_callback(struct usb_xfer *xfer, sc->sc_status.dz += dz; wsp_add_to_queue(sc, dx, -dy, dz, sc->sc_status.button); - if (sc->dz_count == 0) + if (sc->dz_count == 0) { sc->dz_sum = 0; + sc->rdz = 0; + } } sc->pre_pos_x = sc->pos_x[0]; From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 16 16:33:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A897E562; Sun, 16 Mar 2014 16:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93914AD5; Sun, 16 Mar 2014 16:33: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 s2GGXQa5054170; Sun, 16 Mar 2014 16:33:26 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GGXQT0054169; Sun, 16 Mar 2014 16:33:26 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403161633.s2GGXQT0054169@svn.freebsd.org> From: Dimitry Andric Date: Sun, 16 Mar 2014 16:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263247 - in stable: 10/contrib/llvm/lib/Target/X86 9/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 16:33:26 -0000 Author: dim Date: Sun Mar 16 16:33:25 2014 New Revision: 263247 URL: http://svnweb.freebsd.org/changeset/base/263247 Log: Pull in r192123 from upstream llvm trunk (by Benjamin Kramer): X86: Fix type check. Just because an integer type is illegal doesn't mean it's i64. Fixes PR17495, where an i24 triggered this code. It's intended to optimize i64 loads on 32 bit x86. Fixes "Cannot select" fatal errors when building the audio/jack port with ALSA support turned on. This is a direct commit to stable/9 and stable/10, since head already has the commit as part of an upgrade to llvm/clang 3.4. Reported by: Radim Kolar via http://llvm.org/bugs/ Modified: stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Changes in other areas also in this revision: Modified: stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Modified: stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sun Mar 16 15:22:52 2014 (r263246) +++ stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sun Mar 16 16:33:25 2014 (r263247) @@ -17669,7 +17669,7 @@ static SDValue PerformSINT_TO_FPCombine( if (!Ld->isVolatile() && !N->getValueType(0).isVector() && ISD::isNON_EXTLoad(Op0.getNode()) && Op0.hasOneUse() && !XTLI->getSubtarget()->is64Bit() && - !DAG.getTargetLoweringInfo().isTypeLegal(VT)) { + VT == MVT::i64) { SDValue FILDChain = XTLI->BuildFILD(SDValue(N, 0), Ld->getValueType(0), Ld->getChain(), Op0, DAG); DAG.ReplaceAllUsesOfValueWith(Op0.getValue(1), FILDChain.getValue(1)); From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 17 02:14:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3DAF34B9; Mon, 17 Mar 2014 02:14: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1DFA1EE3; Mon, 17 Mar 2014 02:14: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 s2H2EDDU090778; Mon, 17 Mar 2014 02:14:13 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2H2EDQg090776; Mon, 17 Mar 2014 02:14:13 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201403170214.s2H2EDQg090776@svn.freebsd.org> From: Kevin Lo Date: Mon, 17 Mar 2014 02:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263256 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 02:14:14 -0000 Author: kevlo Date: Mon Mar 17 02:14:13 2014 New Revision: 263256 URL: http://svnweb.freebsd.org/changeset/base/263256 Log: MFC r263153, r263154: - Similar to r246614, fix panic on removing urtwn(4). It happens because nodes are freed after the adapter is gone. - Reset the bit of the R92C_MCUFWDL associated with checksum report before loading firmware page. It may fix this problem: "urtwn0: timeout waiting for checksum report" Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c stable/10/sys/dev/usb/wlan/if_urtwnreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Mar 17 02:10:45 2014 (r263255) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Mar 17 02:14:13 2014 (r263256) @@ -245,8 +245,8 @@ static void urtwn_iq_calib(struct urtwn static void urtwn_lc_calib(struct urtwn_softc *); static void urtwn_init(void *); static void urtwn_init_locked(void *); -static void urtwn_stop(struct ifnet *, int); -static void urtwn_stop_locked(struct ifnet *, int); +static void urtwn_stop(struct ifnet *); +static void urtwn_stop_locked(struct ifnet *); static void urtwn_abort_xfers(struct urtwn_softc *); static int urtwn_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); @@ -457,20 +457,40 @@ urtwn_detach(device_t self) struct urtwn_softc *sc = device_get_softc(self); struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + unsigned int x; - if (!device_is_attached(self)) - return (0); + /* Prevent further ioctls. */ + URTWN_LOCK(sc); + sc->sc_flags |= URTWN_DETACHED; + URTWN_UNLOCK(sc); - urtwn_stop(ifp, 1); + urtwn_stop(ifp); callout_drain(&sc->sc_watchdog_ch); - /* stop all USB transfers */ - usbd_transfer_unsetup(sc->sc_xfer, URTWN_N_TRANSFER); - ieee80211_ifdetach(ic); + /* Prevent further allocations from RX/TX data lists. */ + URTWN_LOCK(sc); + STAILQ_INIT(&sc->sc_tx_active); + STAILQ_INIT(&sc->sc_tx_inactive); + STAILQ_INIT(&sc->sc_tx_pending); + + STAILQ_INIT(&sc->sc_rx_active); + STAILQ_INIT(&sc->sc_rx_inactive); + URTWN_UNLOCK(sc); + + /* drain USB transfers */ + for (x = 0; x != URTWN_N_TRANSFER; x++) + usbd_transfer_drain(sc->sc_xfer[x]); + /* Free data buffers. */ + URTWN_LOCK(sc); urtwn_free_tx_list(sc); urtwn_free_rx_list(sc); + URTWN_UNLOCK(sc); + + /* stop all USB transfers */ + usbd_transfer_unsetup(sc->sc_xfer, URTWN_N_TRANSFER); + ieee80211_ifdetach(ic); if_free(ifp); mtx_destroy(&sc->sc_mtx); @@ -1756,10 +1776,17 @@ urtwn_start_locked(struct ifnet *ifp, st static int urtwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { + struct urtwn_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; int error = 0, startall = 0; + URTWN_LOCK(sc); + error = (sc->sc_flags & URTWN_DETACHED) ? ENXIO : 0; + URTWN_UNLOCK(sc); + if (error != 0) + return (error); + switch (cmd) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { @@ -1769,7 +1796,7 @@ urtwn_ioctl(struct ifnet *ifp, u_long cm } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) - urtwn_stop(ifp, 1); + urtwn_stop(ifp); } if (startall) ieee80211_start_all(ic); @@ -2069,6 +2096,10 @@ urtwn_load_firmware(struct urtwn_softc * urtwn_write_1(sc, R92C_MCUFWDL + 2, urtwn_read_1(sc, R92C_MCUFWDL + 2) & ~0x08); + /* Reset the FWDL checksum. */ + urtwn_write_1(sc, R92C_MCUFWDL, + urtwn_read_1(sc, R92C_MCUFWDL) | R92C_MCUFWDL_CHKSUM_RPT); + for (page = 0; len > 0; page++) { mlen = min(len, R92C_FW_PAGE_SIZE); error = urtwn_fw_loadpage(sc, page, ptr, mlen); @@ -2783,7 +2814,7 @@ urtwn_init_locked(void *arg) int error; if (ifp->if_drv_flags & IFF_DRV_RUNNING) - urtwn_stop_locked(ifp, 0); + urtwn_stop_locked(ifp); /* Init firmware commands ring. */ sc->fwcur = 0; @@ -2941,11 +2972,10 @@ urtwn_init(void *arg) } static void -urtwn_stop_locked(struct ifnet *ifp, int disable) +urtwn_stop_locked(struct ifnet *ifp) { struct urtwn_softc *sc = ifp->if_softc; - (void)disable; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); callout_stop(&sc->sc_watchdog_ch); @@ -2953,12 +2983,12 @@ urtwn_stop_locked(struct ifnet *ifp, int } static void -urtwn_stop(struct ifnet *ifp, int disable) +urtwn_stop(struct ifnet *ifp) { struct urtwn_softc *sc = ifp->if_softc; URTWN_LOCK(sc); - urtwn_stop_locked(ifp, disable); + urtwn_stop_locked(ifp); URTWN_UNLOCK(sc); } Modified: stable/10/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwnreg.h Mon Mar 17 02:10:45 2014 (r263255) +++ stable/10/sys/dev/usb/wlan/if_urtwnreg.h Mon Mar 17 02:14:13 2014 (r263256) @@ -1119,6 +1119,7 @@ struct urtwn_softc { int ac2idx[WME_NUM_AC]; u_int sc_flags; #define URTWN_FLAG_CCK_HIPWR 0x01 +#define URTWN_DETACHED 0x02 u_int chip; #define URTWN_CHIP_92C 0x01 From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 17 05:03:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8E452E72; Mon, 17 Mar 2014 05:03: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BEE1ECF; Mon, 17 Mar 2014 05:03: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 s2H53svS060038; Mon, 17 Mar 2014 05:03:54 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2H53seK060037; Mon, 17 Mar 2014 05:03:54 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201403170503.s2H53seK060037@svn.freebsd.org> From: David Xu Date: Mon, 17 Mar 2014 05:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263258 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 05:03:54 -0000 Author: davidxu Date: Mon Mar 17 05:03:53 2014 New Revision: 263258 URL: http://svnweb.freebsd.org/changeset/base/263258 Log: MFC r263107: To avoid missing a chance to cancel thread, call _pthread_testcancel at the beginning of _sem_timedwait. Submitted by: Eric van Gyzen < eric at vangyzen dot net > Modified: stable/10/lib/libc/gen/sem_new.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/sem_new.c ============================================================================== --- stable/10/lib/libc/gen/sem_new.c Mon Mar 17 04:38:10 2014 (r263257) +++ stable/10/lib/libc/gen/sem_new.c Mon Mar 17 05:03:53 2014 (r263258) @@ -381,6 +381,7 @@ _sem_timedwait(sem_t * __restrict sem, return (-1); retval = 0; + _pthread_testcancel(); for (;;) { while ((val = sem->_kern._count) > 0) { if (atomic_cmpset_acq_int(&sem->_kern._count, val, val - 1)) From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 17 06:38:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F0CF5B5A; Mon, 17 Mar 2014 06:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCA988AD; Mon, 17 Mar 2014 06:38: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 s2H6ceDW096358; Mon, 17 Mar 2014 06:38:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2H6cegh096357; Mon, 17 Mar 2014 06:38:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403170638.s2H6cegh096357@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 17 Mar 2014 06:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263261 - stable/10/sys/dev/usb/input X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 06:38:41 -0000 Author: hselasky Date: Mon Mar 17 06:38:40 2014 New Revision: 263261 URL: http://svnweb.freebsd.org/changeset/base/263261 Log: MFC r262972: Ignore USB keyboard driver calls from critical sections. Modified: stable/10/sys/dev/usb/input/ukbd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/10/sys/dev/usb/input/ukbd.c Mon Mar 17 06:36:54 2014 (r263260) +++ stable/10/sys/dev/usb/input/ukbd.c Mon Mar 17 06:38:40 2014 (r263261) @@ -1909,6 +1909,12 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, int result; /* + * XXX Check of someone is calling us from a critical section: + */ + if (curthread->td_critnest != 0) + return (EDEADLK); + + /* * XXX KDGKBSTATE, KDSKBSTATE and KDSETLED can be called from any * context where printf(9) can be called, which among other things * includes interrupt filters and threads with any kinds of locks From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 17 19:09:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 32BBAC9F; Mon, 17 Mar 2014 19:09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EDA2C5A; Mon, 17 Mar 2014 19:09: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 s2HJ90Vr004573; Mon, 17 Mar 2014 19:09:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HJ90Rv004572; Mon, 17 Mar 2014 19:09:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403171909.s2HJ90Rv004572@svn.freebsd.org> From: Xin LI Date: Mon, 17 Mar 2014 19:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263269 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 19:09:01 -0000 Author: delphij Date: Mon Mar 17 19:09:00 2014 New Revision: 263269 URL: http://svnweb.freebsd.org/changeset/base/263269 Log: MFC r262676: All callers of static method load_nvlist() in spa.c handles error case, so there is no reason to assert that we won't hit an error. Instead, just return that error to caller and have the upper layer handle it. Obtained from: FreeNAS Reported by: rodrigc Reviewed by: Matthew Ahrens Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Mar 17 16:45:28 2014 (r263268) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Mar 17 19:09:00 2014 (r263269) @@ -1594,7 +1594,9 @@ load_nvlist(spa_t *spa, uint64_t obj, nv int error; *value = NULL; - VERIFY(0 == dmu_bonus_hold(spa->spa_meta_objset, obj, FTAG, &db)); + error = dmu_bonus_hold(spa->spa_meta_objset, obj, FTAG, &db); + if (error != 0) + return (error); nvsize = *(uint64_t *)db->db_data; dmu_buf_rele(db, FTAG); From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 17 20:42:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 867E1A0A; Mon, 17 Mar 2014 20:42: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71F9A859; Mon, 17 Mar 2014 20:42: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 s2HKgkAR045394; Mon, 17 Mar 2014 20:42:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HKgk7N045392; Mon, 17 Mar 2014 20:42:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403172042.s2HKgk7N045392@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Mar 2014 20:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263272 - in stable: 10/contrib/libc++/include 9/contrib/libc++/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 20:42:46 -0000 Author: dim Date: Mon Mar 17 20:42:45 2014 New Revision: 263272 URL: http://svnweb.freebsd.org/changeset/base/263272 Log: MFC r263120: Pull in r201021 from upstream libc++ trunk: Fix for PR18735 - self-assignment for map/multimap gives incorrect results in C++03 (Please note: that is an LLVM PR identifier, not a FreeBSD one.) Reported by: rakuco Modified: stable/10/contrib/libc++/include/map stable/10/contrib/libc++/include/unordered_map Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/libc++/include/map stable/9/contrib/libc++/include/unordered_map Directory Properties: stable/9/contrib/libc++/ (props changed) Modified: stable/10/contrib/libc++/include/map ============================================================================== --- stable/10/contrib/libc++/include/map Mon Mar 17 19:55:27 2014 (r263271) +++ stable/10/contrib/libc++/include/map Mon Mar 17 20:42:45 2014 (r263272) @@ -884,10 +884,12 @@ public: #if __cplusplus >= 201103L __tree_ = __m.__tree_; #else - __tree_.clear(); - __tree_.value_comp() = __m.__tree_.value_comp(); - __tree_.__copy_assign_alloc(__m.__tree_); - insert(__m.begin(), __m.end()); + if (this != &__m) { + __tree_.clear(); + __tree_.value_comp() = __m.__tree_.value_comp(); + __tree_.__copy_assign_alloc(__m.__tree_); + insert(__m.begin(), __m.end()); + } #endif return *this; } @@ -1616,10 +1618,12 @@ public: #if __cplusplus >= 201103L __tree_ = __m.__tree_; #else - __tree_.clear(); - __tree_.value_comp() = __m.__tree_.value_comp(); - __tree_.__copy_assign_alloc(__m.__tree_); - insert(__m.begin(), __m.end()); + if (this != &__m) { + __tree_.clear(); + __tree_.value_comp() = __m.__tree_.value_comp(); + __tree_.__copy_assign_alloc(__m.__tree_); + insert(__m.begin(), __m.end()); + } #endif return *this; } Modified: stable/10/contrib/libc++/include/unordered_map ============================================================================== --- stable/10/contrib/libc++/include/unordered_map Mon Mar 17 19:55:27 2014 (r263271) +++ stable/10/contrib/libc++/include/unordered_map Mon Mar 17 20:42:45 2014 (r263272) @@ -831,12 +831,14 @@ public: #if __cplusplus >= 201103L __table_ = __u.__table_; #else - __table_.clear(); - __table_.hash_function() = __u.__table_.hash_function(); - __table_.key_eq() = __u.__table_.key_eq(); - __table_.max_load_factor() = __u.__table_.max_load_factor(); - __table_.__copy_assign_alloc(__u.__table_); - insert(__u.begin(), __u.end()); + if (this != &__u) { + __table_.clear(); + __table_.hash_function() = __u.__table_.hash_function(); + __table_.key_eq() = __u.__table_.key_eq(); + __table_.max_load_factor() = __u.__table_.max_load_factor(); + __table_.__copy_assign_alloc(__u.__table_); + insert(__u.begin(), __u.end()); + } #endif return *this; } @@ -1567,12 +1569,14 @@ public: #if __cplusplus >= 201103L __table_ = __u.__table_; #else - __table_.clear(); - __table_.hash_function() = __u.__table_.hash_function(); - __table_.key_eq() = __u.__table_.key_eq(); - __table_.max_load_factor() = __u.__table_.max_load_factor(); - __table_.__copy_assign_alloc(__u.__table_); - insert(__u.begin(), __u.end()); + if (this != &__u) { + __table_.clear(); + __table_.hash_function() = __u.__table_.hash_function(); + __table_.key_eq() = __u.__table_.key_eq(); + __table_.max_load_factor() = __u.__table_.max_load_factor(); + __table_.__copy_assign_alloc(__u.__table_); + insert(__u.begin(), __u.end()); + } #endif return *this; } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 18 00:29:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1BC68F15; Tue, 18 Mar 2014 00:29: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06F35E48; Tue, 18 Mar 2014 00:29: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 s2I0TXl4037281; Tue, 18 Mar 2014 00:29:33 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I0TXJc037279; Tue, 18 Mar 2014 00:29:33 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201403180029.s2I0TXJc037279@svn.freebsd.org> From: Mark Johnston Date: Tue, 18 Mar 2014 00:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263281 - in stable/10/sys: cddl/contrib/opensolaris/uts/intel/dtrace kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 00:29:34 -0000 Author: markj Date: Tue Mar 18 00:29:33 2014 New Revision: 263281 URL: http://svnweb.freebsd.org/changeset/base/263281 Log: MFC r259535: The fasttrap fork handler is responsible for removing tracepoints in the child process that were inherited from its parent. However, this should not be done in the case of a vfork, since the fork handler ends up removing the tracepoints from the shared vm space, and userland DTrace probes in the parent will no longer fire as a result. Now the child of a vfork may trigger userland DTrace probes enabled in its parent, so modify the fasttrap probe handler to handle this case and handle the child process in the same way that it would handle the traced process. In particular, if once traces function foo() in a process that vforks, and the child calls foo(), fasttrap will treat this call as having come from the parent. This is the behaviour of the upstream code. While here, add #ifdef guards to some code that isn't present upstream. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/10/sys/kern/kern_fork.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Mar 17 23:30:38 2014 (r263280) +++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue Mar 18 00:29:33 2014 (r263281) @@ -988,6 +988,9 @@ int fasttrap_pid_probe(struct reg *rp) { proc_t *p = curproc; +#if !defined(sun) + proc_t *pp; +#endif uintptr_t pc = rp->r_rip - 1; uintptr_t new_pc = 0; fasttrap_bucket_t *bucket; @@ -1023,24 +1026,32 @@ fasttrap_pid_probe(struct reg *rp) curthread->t_dtrace_regv = 0; #endif -#if defined(sun) /* * Treat a child created by a call to vfork(2) as if it were its * parent. We know that there's only one thread of control in such a * process: this one. */ +#if defined(sun) while (p->p_flag & SVFORK) { p = p->p_parent; } -#endif - PROC_LOCK(p); - _PHOLD(p); pid = p->p_pid; -#if defined(sun) pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; mutex_enter(pid_mtx); +#else + pp = p; + sx_slock(&proctree_lock); + while (pp->p_vmspace == pp->p_pptr->p_vmspace) + pp = pp->p_pptr; + pid = pp->p_pid; + sx_sunlock(&proctree_lock); + pp = NULL; + + PROC_LOCK(p); + _PHOLD(p); #endif + bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; /* @@ -1060,9 +1071,10 @@ fasttrap_pid_probe(struct reg *rp) if (tp == NULL) { #if defined(sun) mutex_exit(pid_mtx); -#endif +#else _PRELE(p); PROC_UNLOCK(p); +#endif return (-1); } @@ -1184,9 +1196,10 @@ fasttrap_pid_probe(struct reg *rp) * tracepoint again later if we need to light up any return probes. */ tp_local = *tp; - PROC_UNLOCK(p); #if defined(sun) mutex_exit(pid_mtx); +#else + PROC_UNLOCK(p); #endif tp = &tp_local; @@ -1736,7 +1749,7 @@ fasttrap_pid_probe(struct reg *rp) #if defined(sun) if (fasttrap_copyout(scratch, (char *)addr, i)) { #else - if (uwrite(curproc, scratch, i, addr)) { + if (uwrite(p, scratch, i, addr)) { #endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; @@ -1795,10 +1808,12 @@ done: rp->r_rip = new_pc; +#if !defined(sun) PROC_LOCK(p); proc_write_regs(curthread, rp); _PRELE(p); PROC_UNLOCK(p); +#endif return (0); } Modified: stable/10/sys/kern/kern_fork.c ============================================================================== --- stable/10/sys/kern/kern_fork.c Mon Mar 17 23:30:38 2014 (r263280) +++ stable/10/sys/kern/kern_fork.c Tue Mar 18 00:29:33 2014 (r263281) @@ -684,12 +684,12 @@ do_fork(struct thread *td, int flags, st #ifdef KDTRACE_HOOKS /* - * Tell the DTrace fasttrap provider about the new process - * if it has registered an interest. We have to do this only after - * p_state is PRS_NORMAL since the fasttrap module will use pfind() - * later on. + * Tell the DTrace fasttrap provider about the new process so that any + * tracepoints inherited from the parent can be removed. We have to do + * this only after p_state is PRS_NORMAL since the fasttrap module will + * use pfind() later on. */ - if (dtrace_fasttrap_fork) + if ((flags & RFMEM) == 0 && dtrace_fasttrap_fork) dtrace_fasttrap_fork(p1, p2); #endif if ((p1->p_flag & (P_TRACED | P_FOLLOWFORK)) == (P_TRACED | From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 18 00:55:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 57D014AC; Tue, 18 Mar 2014 00:55: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 448D2105; Tue, 18 Mar 2014 00:55: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 s2I0tK2B049262; Tue, 18 Mar 2014 00:55:20 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I0tKmj049261; Tue, 18 Mar 2014 00:55:20 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201403180055.s2I0tKmj049261@svn.freebsd.org> From: Mark Johnston Date: Tue, 18 Mar 2014 00:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263283 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 00:55:20 -0000 Author: markj Date: Tue Mar 18 00:55:19 2014 New Revision: 263283 URL: http://svnweb.freebsd.org/changeset/base/263283 Log: MFC r262325: Print a backtrace if the SDT(9) stub gets called so that there's at least some hope of figuring out how it happened. Modified: stable/10/sys/kern/kern_sdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_sdt.c ============================================================================== --- stable/10/sys/kern/kern_sdt.c Tue Mar 18 00:38:36 2014 (r263282) +++ stable/10/sys/kern/kern_sdt.c Tue Mar 18 00:55:19 2014 (r263283) @@ -29,6 +29,7 @@ #include #include +#include #include SDT_PROVIDER_DEFINE(sdt); @@ -49,5 +50,6 @@ sdt_probe_stub(uint32_t id, uintptr_t ar uintptr_t arg2, uintptr_t arg3, uintptr_t arg4) { - printf("sdt_probe_stub: Why did this get called?\n"); + printf("sdt_probe_stub: unexpectedly called\n"); + kdb_backtrace(); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 18 00:59:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 07E0AAE3; Tue, 18 Mar 2014 00:59: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E53A9154; Tue, 18 Mar 2014 00:59: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 s2I0xqa4049978; Tue, 18 Mar 2014 00:59:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I0xnS8049957; Tue, 18 Mar 2014 00:59:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403180059.s2I0xnS8049957@svn.freebsd.org> From: Xin LI Date: Tue, 18 Mar 2014 00:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263285 - in stable/10/contrib/xz: . src/liblzma/api/lzma src/liblzma/check src/liblzma/common src/lzmainfo src/xz src/xzdec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 00:59:53 -0000 Author: delphij Date: Tue Mar 18 00:59:49 2014 New Revision: 263285 URL: http://svnweb.freebsd.org/changeset/base/263285 Log: MFC r262754: MFV r253848 (mm): Update vendor/xz from v5.0 branch to post-5.0.5 Modified: stable/10/contrib/xz/ChangeLog stable/10/contrib/xz/README stable/10/contrib/xz/THANKS stable/10/contrib/xz/src/liblzma/api/lzma/version.h stable/10/contrib/xz/src/liblzma/check/sha256.c stable/10/contrib/xz/src/liblzma/common/alone_decoder.c stable/10/contrib/xz/src/liblzma/common/alone_decoder.h stable/10/contrib/xz/src/liblzma/common/auto_decoder.c stable/10/contrib/xz/src/lzmainfo/lzmainfo.1 stable/10/contrib/xz/src/xz/coder.c stable/10/contrib/xz/src/xz/coder.h stable/10/contrib/xz/src/xz/file_io.c stable/10/contrib/xz/src/xz/list.c stable/10/contrib/xz/src/xz/util.c stable/10/contrib/xz/src/xz/xz.1 stable/10/contrib/xz/src/xzdec/xzdec.1 stable/10/contrib/xz/src/xzdec/xzdec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/xz/ChangeLog ============================================================================== --- stable/10/contrib/xz/ChangeLog Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/ChangeLog Tue Mar 18 00:59:49 2014 (r263285) @@ -1,3 +1,348 @@ +commit b69900ed0b2f914fc6c0a180dcb522dbe5b80ea7 +Author: Lasse Collin +Date: Sun Jun 30 18:02:27 2013 +0300 + + Man pages: Use similar syntax for synopsis as in xz. + + The man pages of lzmainfo, xzmore, and xzdec had similar + constructs as the man page of xz had before the commit + eb6ca9854b8eb9fbf72497c1cf608d6b19d2d494. Eric S. Raymond + didn't mention these man pages in his bug report, but + it's nice to be consistent. + +commit cf4a1e1879d89be314ef3c064bd2656ea452f87e +Author: Lasse Collin +Date: Sun Jun 30 15:55:09 2013 +0300 + + Update NEWS for 5.0.5. + +commit cb94bb6d1f34e1e93c2d634ea9c3b7dfb3981d05 +Author: Lasse Collin +Date: Sun Jun 30 15:54:38 2013 +0300 + + Bump version and soname for 5.0.5. + +commit b7dee202d5b041ccae028d0c5433b83cecbe9e5d +Author: Lasse Collin +Date: Fri Jun 28 23:56:17 2013 +0300 + + xz: Fix return value type in io_write_buf(). + + It didn't affect the behavior of the code since -1 + becomes true anyway. + +commit 265e7b44d804b47373f10b7da28350db7611cea6 +Author: Lasse Collin +Date: Fri Jun 28 18:46:13 2013 +0300 + + xz: Remove an outdated NetBSD-specific comment. + + Nowadays errno == EFTYPE is documented in open(2). + +commit 78c2f8db902195468b8249c432252a6b281db836 +Author: Lasse Collin +Date: Fri Jun 28 18:09:47 2013 +0300 + + xz: Fix error detection of fcntl(fd, F_SETFL, flags) calls. + + POSIX says that fcntl(fd, F_SETFL, flags) returns -1 on + error and "other than -1" on success. This is how it is + documented e.g. on OpenBSD too. On Linux, success with + F_SETFL is always 0 (at least accorinding to fcntl(2) + from man-pages 3.51). + +commit 91750dff8f2c654ff636f12a2acdffe5492374b3 +Author: Lasse Collin +Date: Fri Jun 28 17:36:47 2013 +0300 + + xz: Fix use of wrong variable in a fcntl() call. + + Due to a wrong variable name, when writing a sparse file + to standard output, *all* file status flags were cleared + (to the extent the operating system allowed it) instead of + only clearing the O_APPEND flag. In practice this worked + fine in the common situations on GNU/Linux, but I didn't + check how it behaved elsewhere. + + The original flags were still restored correctly. I still + changed the code to use a separate boolean variable to + indicate when the flags should be restored instead of + relying on a special value in stdout_flags. + +commit e11888a79a4a77a69afde60445880d44f63d01aa +Author: Lasse Collin +Date: Wed Jun 26 13:30:57 2013 +0300 + + xz: Check the value of lzma_stream_flags.version in --list. + + It is a no-op for now, but if an old xz version is used + together with a newer liblzma that supports something new, + then this check becomes important and will stop the old xz + from trying to parse files that it won't understand. + +commit f39ddd88f3222219ada88998cf30abfdd3e0e96c +Author: Lasse Collin +Date: Wed Jun 26 12:17:00 2013 +0300 + + Build: Require Automake 1.12 and use serial-tests option. + + It should actually still work with Automake 1.10 if + the serial-tests option is removed. Automake 1.13 started + using parallel tests by default and the option to get + the old behavior isn't supported before 1.12. + + At least for now, parallel tests don't improve anything + in XZ Utils but they hide the progress output from + test_compress.sh. + +commit cb84e278027a90e9827a6f4d3bb0b4d4744a2fbb +Author: Lasse Collin +Date: Sun Jun 23 17:36:47 2013 +0300 + + xz: Validate Uncompressed Size from Block Header in list.c. + + This affects only "xz -lvv". Normal decompression with xz + already detected if Block Header and Index had mismatched + Uncompressed Size fields. So this just makes "xz -lvv" + show such files as corrupt instead of showing the + Uncompressed Size from Index. + +commit f01780fce454c7489f7dcbf806299b50da5f51b7 +Author: Lasse Collin +Date: Wed Jun 26 10:58:58 2013 +0300 + + Update THANKS. + +commit d98ede7d700b892e32d9c2f46563b6ebc566786d +Author: Lasse Collin +Date: Fri Jun 21 22:04:45 2013 +0300 + + xz: Make the man page more friendly to doclifter. + + Thanks to Eric S. Raymond. + +commit 19b447b64b3f520cd5b11429000b092f7c76709b +Author: Lasse Collin +Date: Fri Jun 21 21:54:59 2013 +0300 + + xz: A couple of man page fixes. + + Now the interaction of presets and custom filter chains + is described correctly. Earlier it contradicted itself. + + Thanks to DevHC who reported these issues on IRC to me + on 2012-12-14. + +commit 45edf2966fc9a4d2eae8f84b2fa027fb4fa1df8b +Author: Lasse Collin +Date: Fri Jun 21 21:50:26 2013 +0300 + + xz: Fix interaction between preset and custom filter chains. + + There was somewhat illogical behavior when --extreme was + specified and mixed with custom filter chains. + + Before this commit, "xz -9 --lzma2 -e" was equivalent + to "xz --lzma2". After it is equivalent to "xz -6e" + (all earlier preset options get forgotten when a custom + filter chain is specified and the default preset is 6 + to which -e is applied). I find this less illogical. + + This also affects the meaning of "xz -9e --lzma2 -7". + Earlier it was equivalent to "xz -7e" (the -e specified + before a custom filter chain wasn't forgotten). Now it + is "xz -7". Note that "xz -7e" still is the same as "xz -e7". + + Hopefully very few cared about this in the first place, + so pretty much no one should even notice this change. + + Thanks to Conley Moorhous. + +commit b065984e5a9272eb50bc0c6d3731e6199c0ae8a8 +Author: Lasse Collin +Date: Fri Apr 8 17:53:05 2011 +0300 + + xz: Change size_t to uint32_t in a few places. + +commit 32be621f52f2e1686db88baa7b01dc1ae338f426 +Author: Lasse Collin +Date: Sat Apr 27 22:07:46 2013 +0300 + + Build: Use -Wvla with GCC if supported. + + Variable-length arrays are mandatory in C99 but optional in C11. + The code doesn't currently use any VLAs and it shouldn't in the + future either to stay compatible with C11 without requiring any + optional C11 features. + +commit efb07cfba65e9e05984c02cd796c1b0338ce04dc +Author: Lasse Collin +Date: Mon Apr 15 19:29:09 2013 +0300 + + xzdec: Improve the --help message. + + The options are now ordered in the same order as in xz's help + message. + + Descriptions were added to the options that are ignored. + I left them in parenthesis even if it looks a bit weird + because I find it easier to spot the ignored vs. non-ignored + options from the list that way. + +commit e3c8be13699e2813f5e2879d8187444b46d82d89 +Author: Lasse Collin +Date: Fri Apr 5 19:25:40 2013 +0300 + + Update THANKS. + +commit ad8282efe483612f6b5544f9a0d2e4914fb2532a +Author: Jeff Bastian +Date: Wed Apr 3 13:59:17 2013 +0200 + + xzgrep: make the '-h' option to be --no-filename equivalent + + * src/scripts/xzgrep.in: Accept the '-h' option in argument parsing. + +commit 9271a3eb0e022b23e8712154be851d0afe4c02e4 +Author: Lasse Collin +Date: Fri Apr 5 19:34:09 2013 +0300 + + liblzma: Be less picky in lzma_alone_decoder(). + + To avoid false positives when detecting .lzma files, + rare values in dictionary size and uncompressed size fields + were rejected. They will still be rejected if .lzma files + are decoded with lzma_auto_decoder(), but when using + lzma_alone_decoder() directly, such files will now be accepted. + Hopefully this is an OK compromise. + + This doesn't affect xz because xz still has its own file + format detection code. This does affect lzmadec though. + So after this commit lzmadec will accept files that xz or + xz-emulating-lzma doesn't. + + NOTE: lzma_alone_decoder() still won't decode all .lzma files + because liblzma's LZMA decoder doesn't support lc + lp > 4. + + Reported here: + http://sourceforge.net/projects/lzmautils/forums/forum/708858/topic/7068827 + + Conflicts: + src/liblzma/common/alone_decoder.c + src/liblzma/common/alone_decoder.h + +commit 211b931cee58626c1d2e021810cb108cb5cbc10f +Author: Lasse Collin +Date: Tue Mar 5 19:14:50 2013 +0200 + + Avoid unneeded use of awk in xzless. + + Use "read" instead of "awk" in xzless to get the version + number of "less". The need for awk was introduced in + the commit db5c1817fabf7cbb9e4087b1576eb26f0747338e. + + Thanks to Ariel P for the patch. + +commit 9f62fd9605eade23b62b07a235d1f02156f7a5c6 +Author: Jonathan Nieder +Date: Mon Nov 19 00:10:10 2012 -0800 + + xzless: Make "less -V" parsing more robust + + In v4.999.9beta~30 (xzless: Support compressed standard input, + 2009-08-09), xzless learned to parse ‘less -V’ output to figure out + whether less is new enough to handle $LESSOPEN settings starting + with “|-â€. That worked well for a while, but the version string from + ‘less’ versions 448 (June, 2012) is misparsed, producing a warning: + + $ xzless /tmp/test.xz; echo $? + /usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \ + integer expression expected + 0 + + More precisely, modern ‘less’ lists the regexp implementation along + with its version number, and xzless passes the entire version number + with attached parenthetical phrase as a number to "test $a -gt $b", + producing the above confusing message. + + $ less-444 -V | head -1 + less 444 + $ less -V | head -1 + less 456 (no regular expressions) + + So relax the pattern matched --- instead of expecting "less ", + look for a line of the form "less [ (extra parenthetical)]". + While at it, improve the behavior when no matching line is found --- + instead of producing a cryptic message, we can fall back on a LESSPIPE + setting that is supported by all versions of ‘less’. + + The implementation uses "awk" for simplicity. Hopefully that’s + portable enough. + + Reported-by: Jörg-Volker Peetz + Signed-off-by: Jonathan Nieder + +commit 1d05980f5b5c2c94d833001daccacce4a466876e +Author: Lasse Collin +Date: Wed Oct 3 15:54:24 2012 +0300 + + xz: Fix the note about --rsyncable on the man page. + +commit fb68497333598688d309a92838d91fd560f7e9f0 +Author: Lasse Collin +Date: Fri Sep 28 20:11:09 2012 +0300 + + xz: Improve handling of failed realloc in xrealloc. + + Thanks to Jim Meyering. + +commit 75013db6d4d63c195bd8b8d45729b4be0665a812 +Author: Lasse Collin +Date: Sat Dec 15 20:01:02 2012 +0200 + + A few typo fixes to comments and the xz man page. + + Thanks to Jim Meyering. + +commit e44b21839b1dcbac5097be39b87dd2ddb6e114fd +Author: Lasse Collin +Date: Thu Aug 2 17:13:30 2012 +0300 + + Build: Bump gettext version requirement to 0.18. + + Otherwise too old version of m4/lib-link.m4 gets included + when autoreconf -fi is run. + +commit fd3dbb23ca7e75a7a888d7e897c381dc06308307 +Author: Lasse Collin +Date: Thu Jul 5 07:36:28 2012 +0300 + + Tests: Remove tests/test_block.c that had gotten committed accidentally. + +commit 05a735d279d74af437c31f25f69aded4713c1a3d +Author: Lasse Collin +Date: Thu Jul 5 07:33:35 2012 +0300 + + Build: Include macosx/build.sh in the distribution. + + It has been in the Git repository since 2010 but probably + few people have seen it since it hasn't been included in + the release tarballs. :-( + +commit 4e6d62793b5e7b87edcc93c7ded072c1ecd94173 +Author: Lasse Collin +Date: Thu Jul 5 07:24:45 2012 +0300 + + Docs: Fix the name LZMA Utils -> XZ Utils in debug/README. + +commit dd95b5e7614baf1f07a1316b5106bd616a9efa79 +Author: Lasse Collin +Date: Thu Jul 5 07:23:17 2012 +0300 + + Include debug/translation.bash in the distribution. + + Also fix the script name mentioned in README. + commit 20778053a07eb90c159c1377ca8dc05a90fd530b Author: Lasse Collin Date: Fri Jun 22 14:36:16 2012 +0300 Modified: stable/10/contrib/xz/README ============================================================================== --- stable/10/contrib/xz/README Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/README Tue Mar 18 00:59:49 2014 (r263285) @@ -210,8 +210,8 @@ XZ Utils # make -C po update-po make install - bash debug/translations.bash | less - bash debug/translations.bash | less -S # For --list outputs + bash debug/translation.bash | less + bash debug/translation.bash | less -S # For --list outputs Repeat the above as needed (no need to re-run configure though). Modified: stable/10/contrib/xz/THANKS ============================================================================== --- stable/10/contrib/xz/THANKS Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/THANKS Tue Mar 18 00:59:49 2014 (r263285) @@ -6,6 +6,7 @@ Some people have helped more, some less, has been important. :-) In alphabetical order: - Mark Adler - H. Peter Anvin + - Jeff Bastian - Nelson H. F. Beebe - Karl Berry - Anders F. Björklund @@ -47,6 +48,7 @@ has been important. :-) In alphabetical - Bela Lubkin - Gregory Margo - Jim Meyering + - Conley Moorhous - RafaÅ‚ MużyÅ‚o - Adrien Nader - Hongbo Ni @@ -58,8 +60,10 @@ has been important. :-) In alphabetical - Diego Elio Pettenò - Elbert Pol - Mikko Pouru + - Pavel Raiskup - Robert Readman - Bernhard Reutner-Fischer + - Eric S. Raymond - Cristian Rodríguez - Christian von Roques - Jukka Salmi Modified: stable/10/contrib/xz/src/liblzma/api/lzma/version.h ============================================================================== --- stable/10/contrib/xz/src/liblzma/api/lzma/version.h Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/liblzma/api/lzma/version.h Tue Mar 18 00:59:49 2014 (r263285) @@ -22,7 +22,7 @@ */ #define LZMA_VERSION_MAJOR 5 #define LZMA_VERSION_MINOR 0 -#define LZMA_VERSION_PATCH 4 +#define LZMA_VERSION_PATCH 5 #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE #ifndef LZMA_VERSION_COMMIT Modified: stable/10/contrib/xz/src/liblzma/check/sha256.c ============================================================================== --- stable/10/contrib/xz/src/liblzma/check/sha256.c Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/liblzma/check/sha256.c Tue Mar 18 00:59:49 2014 (r263285) @@ -6,7 +6,6 @@ /// \todo Crypto++ has x86 ASM optimizations. They use SSE so if they /// are imported to liblzma, SSE instructions need to be used /// conditionally to keep the code working on older boxes. -/// We could also support using some external libary for SHA-256. // // This code is based on the code found from 7-Zip, which has a modified // version of the SHA-256 found from Crypto++ . Modified: stable/10/contrib/xz/src/liblzma/common/alone_decoder.c ============================================================================== --- stable/10/contrib/xz/src/liblzma/common/alone_decoder.c Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/liblzma/common/alone_decoder.c Tue Mar 18 00:59:49 2014 (r263285) @@ -26,6 +26,11 @@ struct lzma_coder_s { SEQ_CODE, } sequence; + /// If true, reject files that are unlikely to be .lzma files. + /// If false, more non-.lzma files get accepted and will give + /// LZMA_DATA_ERROR either immediately or after a few output bytes. + bool picky; + /// Position in the header fields size_t pos; @@ -68,13 +73,13 @@ alone_decode(lzma_coder *coder, |= (size_t)(in[*in_pos]) << (coder->pos * 8); if (++coder->pos == 4) { - if (coder->options.dict_size != UINT32_MAX) { + if (coder->picky && coder->options.dict_size + != UINT32_MAX) { // A hack to ditch tons of false positives: // We allow only dictionary sizes that are // 2^n or 2^n + 2^(n-1). LZMA_Alone created // only files with 2^n, but accepts any - // dictionary size. If someone complains, this - // will be reconsidered. + // dictionary size. uint32_t d = coder->options.dict_size - 1; d |= d >> 2; d |= d >> 3; @@ -103,9 +108,9 @@ alone_decode(lzma_coder *coder, // Another hack to ditch false positives: Assume that // if the uncompressed size is known, it must be less - // than 256 GiB. Again, if someone complains, this - // will be reconsidered. - if (coder->uncompressed_size != LZMA_VLI_UNKNOWN + // than 256 GiB. + if (coder->picky + && coder->uncompressed_size != LZMA_VLI_UNKNOWN && coder->uncompressed_size >= (LZMA_VLI_C(1) << 38)) return LZMA_FORMAT_ERROR; @@ -189,7 +194,7 @@ alone_decoder_memconfig(lzma_coder *code extern lzma_ret lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator, - uint64_t memlimit) + uint64_t memlimit, bool picky) { lzma_next_coder_init(&lzma_alone_decoder_init, next, allocator); @@ -208,6 +213,7 @@ lzma_alone_decoder_init(lzma_next_coder } next->coder->sequence = SEQ_PROPERTIES; + next->coder->picky = picky; next->coder->pos = 0; next->coder->options.dict_size = 0; next->coder->options.preset_dict = NULL; @@ -223,7 +229,7 @@ lzma_alone_decoder_init(lzma_next_coder extern LZMA_API(lzma_ret) lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit) { - lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit); + lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit, false); strm->internal->supported_actions[LZMA_RUN] = true; strm->internal->supported_actions[LZMA_FINISH] = true; Modified: stable/10/contrib/xz/src/liblzma/common/alone_decoder.h ============================================================================== --- stable/10/contrib/xz/src/liblzma/common/alone_decoder.h Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/liblzma/common/alone_decoder.h Tue Mar 18 00:59:49 2014 (r263285) @@ -16,7 +16,8 @@ #include "common.h" -extern lzma_ret lzma_alone_decoder_init(lzma_next_coder *next, - lzma_allocator *allocator, uint64_t memlimit); +extern lzma_ret lzma_alone_decoder_init( + lzma_next_coder *next, lzma_allocator *allocator, + uint64_t memlimit, bool picky); #endif Modified: stable/10/contrib/xz/src/liblzma/common/auto_decoder.c ============================================================================== --- stable/10/contrib/xz/src/liblzma/common/auto_decoder.c Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/liblzma/common/auto_decoder.c Tue Mar 18 00:59:49 2014 (r263285) @@ -54,7 +54,7 @@ auto_decode(lzma_coder *coder, lzma_allo coder->memlimit, coder->flags)); } else { return_if_error(lzma_alone_decoder_init(&coder->next, - allocator, coder->memlimit)); + allocator, coder->memlimit, true)); // If the application wants to know about missing // integrity check or about the check in general, we Modified: stable/10/contrib/xz/src/lzmainfo/lzmainfo.1 ============================================================================== --- stable/10/contrib/xz/src/lzmainfo/lzmainfo.1 Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/lzmainfo/lzmainfo.1 Tue Mar 18 00:59:49 2014 (r263285) @@ -4,14 +4,14 @@ .\" This file has been put into the public domain. .\" You can do whatever you want with this file. .\" -.TH LZMAINFO 1 "2010-09-27" "Tukaani" "XZ Utils" +.TH LZMAINFO 1 "2013-06-30" "Tukaani" "XZ Utils" .SH NAME lzmainfo \- show information stored in the .lzma file header .SH SYNOPSIS .B lzmainfo .RB [ \-\-help ] .RB [ \-\-version ] -.RI [ file ]... +.RI [ file... ] .SH DESCRIPTION .B lzmainfo shows information stored in the Modified: stable/10/contrib/xz/src/xz/coder.c ============================================================================== --- stable/10/contrib/xz/src/xz/coder.c Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/xz/coder.c Tue Mar 18 00:59:49 2014 (r263285) @@ -37,15 +37,10 @@ static io_buf in_buf; static io_buf out_buf; /// Number of filters. Zero indicates that we are using a preset. -static size_t filters_count = 0; +static uint32_t filters_count = 0; /// Number of the preset (0-9) -static size_t preset_number = 6; - -/// If a preset is used (no custom filter chain) and preset_extreme is true, -/// a significantly slower compression is used to achieve slightly better -/// compression ratio. -static bool preset_extreme = false; +static uint32_t preset_number = LZMA_PRESET_DEFAULT; /// Integrity check type static lzma_check check; @@ -63,11 +58,9 @@ coder_set_check(lzma_check new_check) } -extern void -coder_set_preset(size_t new_preset) +static void +forget_filter_chain(void) { - preset_number = new_preset; - // Setting a preset makes us forget a possibly defined custom // filter chain. while (filters_count > 0) { @@ -81,9 +74,20 @@ coder_set_preset(size_t new_preset) extern void +coder_set_preset(uint32_t new_preset) +{ + preset_number &= ~LZMA_PRESET_LEVEL_MASK; + preset_number |= new_preset; + forget_filter_chain(); + return; +} + + +extern void coder_set_extreme(void) { - preset_extreme = true; + preset_number |= LZMA_PRESET_EXTREME; + forget_filter_chain(); return; } @@ -98,6 +102,12 @@ coder_add_filter(lzma_vli id, void *opti filters[filters_count].options = options; ++filters_count; + // Setting a custom filter chain makes us forget the preset options. + // This makes a difference if one specifies e.g. "xz -9 --lzma2 -e" + // where the custom filter chain resets the preset level back to + // the default 6, making the example equivalent to "xz -6e". + preset_number = LZMA_PRESET_DEFAULT; + return; } @@ -134,9 +144,6 @@ coder_set_compression_settings(void) } // Get the preset for LZMA1 or LZMA2. - if (preset_extreme) - preset_number |= LZMA_PRESET_EXTREME; - if (lzma_lzma_preset(&opt_lzma, preset_number)) message_bug(); Modified: stable/10/contrib/xz/src/xz/coder.h ============================================================================== --- stable/10/contrib/xz/src/xz/coder.h Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/xz/coder.h Tue Mar 18 00:59:49 2014 (r263285) @@ -46,7 +46,7 @@ extern bool opt_auto_adjust; extern void coder_set_check(lzma_check check); /// Set preset number -extern void coder_set_preset(size_t new_preset); +extern void coder_set_preset(uint32_t new_preset); /// Enable extreme mode extern void coder_set_extreme(void); Modified: stable/10/contrib/xz/src/xz/file_io.c ============================================================================== --- stable/10/contrib/xz/src/xz/file_io.c Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/xz/file_io.c Tue Mar 18 00:59:49 2014 (r263285) @@ -41,9 +41,10 @@ static bool warn_fchown; static bool try_sparse = true; #ifndef TUKLIB_DOSLIKE -/// File status flags of standard output. This is used by io_open_dest() -/// and io_close_dest(). -static int stdout_flags = 0; +/// Original file status flags of standard output. This is used by +/// io_open_dest() and io_close_dest() to save and restore the flags. +static int stdout_flags; +static bool restore_stdout_flags = false; #endif @@ -397,10 +398,6 @@ io_open_src_real(file_pair *pair) was_symlink = true; # elif defined(__NetBSD__) - // As of 2010-09-05, NetBSD doesn't document what errno is - // used with O_NOFOLLOW. It is EFTYPE though, and I - // understood that is very unlikely to change even though - // it is undocumented. if (errno == EFTYPE) was_symlink = true; @@ -441,7 +438,7 @@ io_open_src_real(file_pair *pair) flags &= ~O_NONBLOCK; - if (fcntl(pair->src_fd, F_SETFL, flags)) + if (fcntl(pair->src_fd, F_SETFL, flags) == -1) goto error_msg; } #endif @@ -634,11 +631,11 @@ io_open_dest_real(file_pair *pair) if (!S_ISREG(pair->dest_st.st_mode)) return false; - const int flags = fcntl(STDOUT_FILENO, F_GETFL); - if (flags == -1) + stdout_flags = fcntl(STDOUT_FILENO, F_GETFL); + if (stdout_flags == -1) return false; - if (flags & O_APPEND) { + if (stdout_flags & O_APPEND) { // Creating a sparse file is not possible // when O_APPEND is active (it's used by // shell's >> redirection). As I understand @@ -657,12 +654,14 @@ io_open_dest_real(file_pair *pair) return false; if (fcntl(STDOUT_FILENO, F_SETFL, - stdout_flags & ~O_APPEND)) + stdout_flags & ~O_APPEND) + == -1) return false; - // Remember the flags so that io_close_dest() - // can restore them. - stdout_flags = flags; + // Disabling O_APPEND succeeded. Mark + // that the flags should be restored + // in io_close_dest(). + restore_stdout_flags = true; } else if (lseek(STDOUT_FILENO, 0, SEEK_CUR) != pair->dest_st.st_size) { @@ -703,13 +702,12 @@ io_close_dest(file_pair *pair, bool succ { #ifndef TUKLIB_DOSLIKE // If io_open_dest() has disabled O_APPEND, restore it here. - if (stdout_flags != 0) { + if (restore_stdout_flags) { assert(pair->dest_fd == STDOUT_FILENO); - const int fail = fcntl(STDOUT_FILENO, F_SETFL, stdout_flags); - stdout_flags = 0; + restore_stdout_flags = false; - if (fail) { + if (fcntl(STDOUT_FILENO, F_SETFL, stdout_flags) == -1) { message_error(_("Error restoring the O_APPEND flag " "to standard output: %s"), strerror(errno)); @@ -882,7 +880,7 @@ io_write_buf(file_pair *pair, const uint if (amount == -1) { if (errno == EINTR) { if (user_abort) - return -1; + return true; continue; } Modified: stable/10/contrib/xz/src/xz/list.c ============================================================================== --- stable/10/contrib/xz/src/xz/list.c Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/xz/list.c Tue Mar 18 00:59:49 2014 (r263285) @@ -203,6 +203,20 @@ parse_indexes(xz_file_info *xfi, file_pa goto error; } + // Check that the Stream Footer doesn't specify something + // that we don't support. This can only happen if the xz + // version is older than liblzma and liblzma supports + // something new. + // + // It is enough to check Stream Footer. Stream Header must + // match when it is compared against Stream Footer with + // lzma_stream_flags_compare(). + if (footer_flags.version != 0) { + message_error("%s: %s", pair->src_name, + message_strm(LZMA_OPTIONS_ERROR)); + goto error; + } + // Check that the size of the Index field looks sane. lzma_vli index_size = footer_flags.backward_size; if ((lzma_vli)(pos) < index_size + LZMA_STREAM_HEADER_SIZE) { @@ -429,7 +443,19 @@ parse_block_header(file_pair *pair, cons switch (lzma_block_compressed_size(&block, iter->block.unpadded_size)) { case LZMA_OK: - break; + // Validate also block.uncompressed_size if it is present. + // If it isn't present, there's no need to set it since + // we aren't going to actually decompress the Block; if + // we were decompressing, then we should set it so that + // the Block decoder could validate the Uncompressed Size + // that was stored in the Index. + if (block.uncompressed_size == LZMA_VLI_UNKNOWN + || block.uncompressed_size + == iter->block.uncompressed_size) + break; + + // If the above fails, the file is corrupt so + // LZMA_DATA_ERROR is a good error code. case LZMA_DATA_ERROR: // Free the memory allocated by lzma_block_header_decode(). Modified: stable/10/contrib/xz/src/xz/util.c ============================================================================== --- stable/10/contrib/xz/src/xz/util.c Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/xz/util.c Tue Mar 18 00:59:49 2014 (r263285) @@ -26,9 +26,19 @@ xrealloc(void *ptr, size_t size) { assert(size > 0); + // Save ptr so that we can free it if realloc fails. + // The point is that message_fatal ends up calling stdio functions + // which in some libc implementations might allocate memory from + // the heap. Freeing ptr improves the chances that there's free + // memory for stdio functions if they need it. + void *p = ptr; ptr = realloc(ptr, size); - if (ptr == NULL) - message_fatal("%s", strerror(errno)); + + if (ptr == NULL) { + const int saved_errno = errno; + free(p); + message_fatal("%s", strerror(saved_errno)); + } return ptr; } Modified: stable/10/contrib/xz/src/xz/xz.1 ============================================================================== --- stable/10/contrib/xz/src/xz/xz.1 Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/xz/xz.1 Tue Mar 18 00:59:49 2014 (r263285) @@ -5,16 +5,17 @@ .\" This file has been put into the public domain. .\" You can do whatever you want with this file. .\" -.TH XZ 1 "2012-05-27" "Tukaani" "XZ Utils" +.TH XZ 1 "2013-06-21" "Tukaani" "XZ Utils" . .SH NAME xz, unxz, xzcat, lzma, unlzma, lzcat \- Compress or decompress .xz and .lzma files . .SH SYNOPSIS .B xz -.RI [ option ]... -.RI [ file ]... -.PP +.RI [ option... ] +.RI [ file... ] +. +.SH COMMAND ALIASES .B unxz is equivalent to .BR "xz \-\-decompress" . @@ -708,7 +709,7 @@ be dramatically higher than that of the DecMem contains the decompressor memory requirements. That is, the compression settings determine the memory requirements of the decompressor. -The exact decompressor memory usage is slighly more than +The exact decompressor memory usage is slightly more than the LZMA2 dictionary size, but the values in the table have been rounded up to the next full MiB. .RE @@ -897,11 +898,14 @@ if threading will be enabled by default. .SS "Custom compressor filter chains" A custom filter chain allows specifying the compression settings in detail instead of relying on -the settings associated to the preset levels. +the settings associated to the presets. When a custom filter chain is specified, -the compression preset level options -(\fB\-0\fR ... \fB\-9\fR and \fB\-\-extreme\fR) are -silently ignored. +preset options (\fB\-0\fR ... \fB\-9\fR and \fB\-\-extreme\fR) +earlier on the command line are forgotten. +If a preset option is specified +after one or more custom filter chain options, +the new preset takes effect and +the custom filter chain options specified earlier are forgotten. .PP A filter chain is comparable to piping on the command line. When compressing, the uncompressed input goes to the first filter, @@ -934,6 +938,15 @@ Extra commas in are ignored. Every option has a default value, so you need to specify only those you want to change. +.PP +To see the whole filter chain and +.IR options , +use +.B "xz \-vv" +(that is, use +.B \-\-verbose +twice). +This works also for viewing the filter chain options used by presets. .TP \fB\-\-lzma1\fR[\fB=\fIoptions\fR] .PD 0 @@ -976,13 +989,12 @@ The only supported modifier is currently .BR e , which matches .BR \-\-extreme . -The default -.I preset -is -.BR 6 , -from which the default values for the rest of the LZMA1 or LZMA2 +If no +.B preset +is specified, the default values of LZMA1 or LZMA2 .I options -are taken. +are taken from the preset +.BR 6 . .TP .BI dict= size Dictionary (history buffer) @@ -1578,7 +1590,7 @@ is supported only together with .BR \-\-info\-memory , and .BR \-\-list . -It will be supported for normal compression and +It will be supported for compression and decompression in the future. . .SS Version @@ -2179,14 +2191,15 @@ The output can vary even between differe builds of the same XZ Utils version, if different build options are used. .PP -The above means that implementing +The above means that once .B \-\-rsyncable -to create rsyncable -.B .xz -files is not going to happen without -freezing a part of the encoder -implementation, which can then be used with -.BR \-\-rsyncable . +has been implemented, +the resulting files won't necessarily be rsyncable +unless both old and new files have been compressed +with the same xz version. +This problem can be fixed if a part of the encoder +implementation is frozen to keep rsyncable output +stable across xz versions. . .SS "Embedded .xz decompressors" Embedded Modified: stable/10/contrib/xz/src/xzdec/xzdec.1 ============================================================================== --- stable/10/contrib/xz/src/xzdec/xzdec.1 Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/xzdec/xzdec.1 Tue Mar 18 00:59:49 2014 (r263285) @@ -4,17 +4,17 @@ .\" This file has been put into the public domain. .\" You can do whatever you want with this file. .\" -.TH XZDEC 1 "2010-09-27" "Tukaani" "XZ Utils" +.TH XZDEC 1 "2013-06-30" "Tukaani" "XZ Utils" .SH NAME xzdec, lzmadec \- Small .xz and .lzma decompressors .SH SYNOPSIS .B xzdec -.RI [ option ]... -.RI [ file ]... +.RI [ option... ] +.RI [ file... ] .br .B lzmadec -.RI [ option ]... -.RI [ file ]... +.RI [ option... ] +.RI [ file... ] .SH DESCRIPTION .B xzdec is a liblzma-based decompression-only tool for Modified: stable/10/contrib/xz/src/xzdec/xzdec.c ============================================================================== --- stable/10/contrib/xz/src/xzdec/xzdec.c Tue Mar 18 00:55:40 2014 (r263284) +++ stable/10/contrib/xz/src/xzdec/xzdec.c Tue Mar 18 00:59:49 2014 (r263285) @@ -62,13 +62,13 @@ help(void) { printf( "Usage: %s [OPTION]... [FILE]...\n" -"Uncompress files in the ." TOOL_FORMAT " format to the standard output.\n" +"Decompress files in the ." TOOL_FORMAT " format to standard output.\n" "\n" -" -c, --stdout (ignored)\n" -" -d, --decompress (ignored)\n" -" -k, --keep (ignored)\n" +" -d, --decompress (ignored, only decompression is supported)\n" +" -k, --keep (ignored, files are never deleted)\n" +" -c, --stdout (ignored, output is always written to standard output)\n" " -q, --quiet specify *twice* to suppress errors\n" -" -Q, --no-warn (ignored)\n" +" -Q, --no-warn (ignored, the exit status 2 is never used)\n" " -h, --help display this help and exit\n" " -V, --version display the version number and exit\n" "\n" From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 18 14:18:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CE85480B; Tue, 18 Mar 2014 14:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BABD57B5; Tue, 18 Mar 2014 14:18: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 s2IEIjDe077469; Tue, 18 Mar 2014 14:18:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IEIjmW077468; Tue, 18 Mar 2014 14:18:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403181418.s2IEIjmW077468@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Mar 2014 14:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263299 - stable/10/sys/cam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 14:18:45 -0000 Author: mav Date: Tue Mar 18 14:18:45 2014 New Revision: 263299 URL: http://svnweb.freebsd.org/changeset/base/263299 Log: MFC r262741: Do not retry on CAM_FUNC_NOTAVAIL error, but return immediately. Modified: stable/10/sys/cam/cam_periph.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_periph.c ============================================================================== --- stable/10/sys/cam/cam_periph.c Tue Mar 18 13:47:27 2014 (r263298) +++ stable/10/sys/cam/cam_periph.c Tue Mar 18 14:18:45 2014 (r263299) @@ -1655,6 +1655,7 @@ cam_periph_error(union ccb *ccb, cam_fla case CAM_REQ_TOO_BIG: case CAM_LUN_INVALID: case CAM_TID_INVALID: + case CAM_FUNC_NOTAVAIL: error = EINVAL; break; case CAM_SCSI_BUS_RESET: From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 18 16:56:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9FDB9578; Tue, 18 Mar 2014 16:56: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8AEECDCE; Tue, 18 Mar 2014 16:56: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 s2IGu6X6045404; Tue, 18 Mar 2014 16:56:06 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IGu5E9045398; Tue, 18 Mar 2014 16:56:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403181656.s2IGu5E9045398@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Mar 2014 16:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263307 - in stable/10/sys: netinet netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 16:56:06 -0000 Author: glebius Date: Tue Mar 18 16:56:05 2014 New Revision: 263307 URL: http://svnweb.freebsd.org/changeset/base/263307 Log: Merge r263091: fix mbuf flags clash that lead to failure of operation of IPSEC and packet filters. PR: kern/185876 PR: kern/186755 Modified: stable/10/sys/netinet/ip_input.c stable/10/sys/netinet/ip_var.h stable/10/sys/netinet6/in6.h stable/10/sys/netinet6/ip6_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_input.c ============================================================================== --- stable/10/sys/netinet/ip_input.c Tue Mar 18 16:41:32 2014 (r263306) +++ stable/10/sys/netinet/ip_input.c Tue Mar 18 16:56:05 2014 (r263307) @@ -707,6 +707,7 @@ ours: * ip_reass() will return a different mbuf. */ if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) { + /* XXXGL: shouldn't we save & set m_flags? */ m = ip_reass(m); if (m == NULL) return; @@ -799,6 +800,8 @@ SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxf NULL, 0, sysctl_maxnipq, "I", "Maximum number of IPv4 fragment reassembly queue entries"); +#define M_IP_FRAG M_PROTO9 + /* * Take incoming datagram fragment and try to reassemble it into * whole datagram. If the argument is the first fragment or one Modified: stable/10/sys/netinet/ip_var.h ============================================================================== --- stable/10/sys/netinet/ip_var.h Tue Mar 18 16:41:32 2014 (r263306) +++ stable/10/sys/netinet/ip_var.h Tue Mar 18 16:56:05 2014 (r263307) @@ -162,15 +162,6 @@ void kmod_ipstat_dec(int statnum); #define IP_ROUTETOIF SO_DONTROUTE /* 0x10 bypass routing tables */ #define IP_ALLOWBROADCAST SO_BROADCAST /* 0x20 can send broadcast packets */ -/* - * IPv4 protocol layer specific mbuf flags. - */ -#define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ -#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ -#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing, - keep in sync with IP6 */ -#define M_IP_FRAG M_PROTO4 /* fragment reassembly */ - #ifdef __NO_STRICT_ALIGNMENT #define IP_HDR_ALIGNED_P(ip) 1 #else Modified: stable/10/sys/netinet6/in6.h ============================================================================== --- stable/10/sys/netinet6/in6.h Tue Mar 18 16:41:32 2014 (r263306) +++ stable/10/sys/netinet6/in6.h Tue Mar 18 16:56:05 2014 (r263307) @@ -622,13 +622,18 @@ struct ip6_mtuinfo { #endif /* __BSD_VISIBLE */ /* - * Redefinition of mbuf flags + * Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, + * the protocol specific mbuf flags are shared between them. */ -#define M_AUTHIPHDR M_PROTO2 -#define M_DECRYPTED M_PROTO3 -#define M_LOOP M_PROTO4 -#define M_AUTHIPDGM M_PROTO5 -#define M_RTALERT_MLD M_PROTO6 +#define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ +#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ +#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ +#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing */ +#define M_AUTHIPHDR M_PROTO4 +#define M_DECRYPTED M_PROTO5 +#define M_LOOP M_PROTO6 +#define M_AUTHIPDGM M_PROTO7 +#define M_RTALERT_MLD M_PROTO8 #ifdef _KERNEL struct cmsghdr; Modified: stable/10/sys/netinet6/ip6_var.h ============================================================================== --- stable/10/sys/netinet6/ip6_var.h Tue Mar 18 16:41:32 2014 (r263306) +++ stable/10/sys/netinet6/ip6_var.h Tue Mar 18 16:56:05 2014 (r263307) @@ -293,13 +293,6 @@ struct ip6aux { #define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */ #define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */ -/* - * IPv6 protocol layer specific mbuf flags. - */ -#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ -#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing, - keep in sync with IPv4 */ - #ifdef __NO_STRICT_ALIGNMENT #define IP6_HDR_ALIGNED_P(ip) 1 #else From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 00:53:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3B4B9E1A; Wed, 19 Mar 2014 00:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 273A4863; Wed, 19 Mar 2014 00:53: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 s2J0rPA0042660; Wed, 19 Mar 2014 00:53:25 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J0rPJg042659; Wed, 19 Mar 2014 00:53:25 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403190053.s2J0rPJg042659@svn.freebsd.org> From: Bryan Drewery Date: Wed, 19 Mar 2014 00:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263325 - stable/10/lib/libfetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 00:53:25 -0000 Author: bdrewery Date: Wed Mar 19 00:53:24 2014 New Revision: 263325 URL: http://svnweb.freebsd.org/changeset/base/263325 Log: MFC r263021: Support Last-Modified behind proxies which return UTC instead of GMT. Modified: stable/10/lib/libfetch/http.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/http.c ============================================================================== --- stable/10/lib/libfetch/http.c Wed Mar 19 00:38:27 2014 (r263324) +++ stable/10/lib/libfetch/http.c Wed Mar 19 00:53:24 2014 (r263325) @@ -876,6 +876,12 @@ http_parse_mtime(const char *p, time_t * strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); setlocale(LC_TIME, "C"); r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm); + /* + * Some proxies use UTC in response, but it should still be + * parsed. RFC2616 states GMT and UTC are exactly equal for HTTP. + */ + if (r == NULL) + r = strptime(p, "%a, %d %b %Y %H:%M:%S UTC", &tm); /* XXX should add support for date-2 and date-3 */ setlocale(LC_TIME, locale); if (r == NULL) From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 01:43:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 61B54F73; Wed, 19 Mar 2014 01:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4B6DEC5F; Wed, 19 Mar 2014 01:43: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 s2J1h5di063339; Wed, 19 Mar 2014 01:43:05 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J1h3Do063330; Wed, 19 Mar 2014 01:43:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403190143.s2J1h3Do063330@svn.freebsd.org> From: Glen Barber Date: Wed, 19 Mar 2014 01:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263330 - in stable/10/share/man: man4 man8 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 01:43:05 -0000 Author: gjb Date: Wed Mar 19 01:43:03 2014 New Revision: 263330 URL: http://svnweb.freebsd.org/changeset/base/263330 Log: MFC r263105, r263106: r263105: Add hyperv manual pages provided by Microsoft, formatted for FreeBSD standards. Very little, if any, content was modified. r263106: Connect the hyperv driver manuals to the build. Sponsored by: The FreeBSD Foundation Added: stable/10/share/man/man4/hv_ata_pci_disengage.4 - copied unchanged from r263105, head/share/man/man4/hv_ata_pci_disengage.4 stable/10/share/man/man4/hv_kvp.4 - copied unchanged from r263105, head/share/man/man4/hv_kvp.4 stable/10/share/man/man4/hv_netvsc.4 - copied unchanged from r263105, head/share/man/man4/hv_netvsc.4 stable/10/share/man/man4/hv_storvsc.4 - copied unchanged from r263105, head/share/man/man4/hv_storvsc.4 stable/10/share/man/man4/hv_utils.4 - copied unchanged from r263105, head/share/man/man4/hv_utils.4 stable/10/share/man/man4/hv_vmbus.4 - copied unchanged from r263105, head/share/man/man4/hv_vmbus.4 stable/10/share/man/man8/hv_kvp_daemon.8 - copied unchanged from r263105, head/share/man/man8/hv_kvp_daemon.8 Modified: stable/10/share/man/man4/Makefile stable/10/share/man/man8/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Wed Mar 19 01:27:56 2014 (r263329) +++ stable/10/share/man/man4/Makefile Wed Mar 19 01:43:03 2014 (r263330) @@ -168,6 +168,12 @@ MAN= aac.4 \ ${_hptmv.4} \ ${_hptnr.4} \ ${_hptrr.4} \ + hv_ata_pci_disengage.4 \ + hv_kvp.4 \ + hv_netvsc.4 \ + hv_storvsc.4 \ + hv_utils.4 \ + hv_vmbus.4 \ hwpmc.4 \ ichsmb.4 \ ${_ichwd.4} \ Copied: stable/10/share/man/man4/hv_ata_pci_disengage.4 (from r263105, head/share/man/man4/hv_ata_pci_disengage.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/hv_ata_pci_disengage.4 Wed Mar 19 01:43:03 2014 (r263330, copy of r263105, head/share/man/man4/hv_ata_pci_disengage.4) @@ -0,0 +1,90 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" 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. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_ata_pci_disengage +.Nd Hyper-V ATA PCI Disengage driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +driver prevents the native +.Fx +ATA driver from +loading in the presence of Hyper-V. +.Fx +guests running on Hyper-V can take advantage of the Hyper-V Storage +Virtual Consumer +.Pq Xr hv_storvsc 4 +for using their IDE devices. +Since the ATA +driver serves IDE devices as well, there is a chance that the ATA driver may +interfere with the operations of +.Xr hv_storvsc 4 . +The +.Nm +driver avoids +conflicts between the ATA driver and +.Xr hv_storvsc 4 +by disabling the ATA driver +when the +.Fx +guest is booting. +.Pp +A side effect of disabling the ATA driver is that CDROM may become +inoperational on +.Fx +guest partitions. +If CDROM access is a must then users may use +"set hw.ata.disk_enable=1" at boot time to prevent the ATA driver from being +disabled. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Copied: stable/10/share/man/man4/hv_kvp.4 (from r263105, head/share/man/man4/hv_kvp.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/hv_kvp.4 Wed Mar 19 01:43:03 2014 (r263330, copy of r263105, head/share/man/man4/hv_kvp.4) @@ -0,0 +1,96 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" 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. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_kvp +.Nd Hyper-V Key Value Pair Driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides the ability to store, retrieve, modify and delete +key value pairs for +.Fx +guest partitions running on Hyper-V. +Hyper-V allows administrators to store custom metadata in the form +of key value pairs inside the +.Fx +guest partition. +Administrators can use Windows Powershell scripts to add, read, +modify and delete such key value pairs. +.Pp +The driver is bare bones and merely forwards requests to its counterpart +user mode daemon, +.Xr hv_kvp_daemon 8 . +The daemon maintains pools of key value +pairs and does the actual metadata management. +.Pp +The same driver and daemon combination are also used to set and get +IP addresses from a +.Fx +guest. +.Pp +The set functionality is particularly +useful when the +.Fx +guest is assigned a static IP address and is failed over from one +Hyper-V host to another. +After failover, Hyper-V uses the set IP functionality to automatically +update the +.Fx +guest's IP address to its original static value. +.Pp +On the other hand, the get IP functionality is used to update the guest IP +address in the Hyper-V management console window. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 , +.Xr hv_ata_pci_disengage 4 , +.Xr hv_kvp_daemon 8 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix +Incorporated, Microsoft Corporation and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Copied: stable/10/share/man/man4/hv_netvsc.4 (from r263105, head/share/man/man4/hv_netvsc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/hv_netvsc.4 Wed Mar 19 01:43:03 2014 (r263330, copy of r263105, head/share/man/man4/hv_netvsc.4) @@ -0,0 +1,83 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" 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. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_netvsc +.Nd Hyper-V Network Virtual Service Consumer +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +driver implements the virtual network device for +.Fx +guest +partitions running on Hyper-V. +.Fx +guest partitions running on Hyper-V do not have direct access to +network devices attached to the Hyper-V server. +Although a +.Fx +guest can access network devices using Hyper-V's +full emulation mode, the performance in this mode tends to be unsatisfactory. +.Pp +To counter the above issues, the +.Nm +driver implements a network +Virtual +Service Consumer (VSC) that relays network requests from the guest partition +to the network Virtual Service Provider (VSP) hosted in the root partition +using the high performance data exchange infrastructure provided by +.Xr hv_vmbus 4 +driver. +The VSP in the root partition then forwards the network related requests to +the physical network card. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_storvsc 4 , +.Xr hv_ata_pci_disengage 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Copied: stable/10/share/man/man4/hv_storvsc.4 (from r263105, head/share/man/man4/hv_storvsc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/hv_storvsc.4 Wed Mar 19 01:43:03 2014 (r263330, copy of r263105, head/share/man/man4/hv_storvsc.4) @@ -0,0 +1,89 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" 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. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_storvsc +.Nd Hyper-V Storage Virtual Service Consumer +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +driver implements the virtual store device for +.Fx +guest +partitions running on Hyper-V. +.Fx +guest partitions running on Hyper-V do not have direct access to +storage devices attached to the Hyper-V server. +Although a +.Fx +guest can access storage devices using Hyper-V's +full emulation mode, the performance in this mode tends to be unsatisfactory. +.Pp +To counter the above issues, the +.Nm +driver implements a storage +Virtual +Service Consumer (VSC) that relays storage requests from the guest partition +to the storage Virtual Service Provider (VSP) hosted in the root partition +using the high performance data exchange infrastructure provided by +.Xr hv_vmbus 4 +driver. +The VSP in the root partition then forwards the storage related requests to +the physical storage device. +.Pp +This driver functions by presenting a SCSI HBA interface to the Comman Access +Method (CAM) layer. +CAM control blocks (CCBs) are +converted into VSCSI protocol messages which are delivered to the root +partition VSP over the Hyper-V VMBus. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_ata_pci_disengage 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Copied: stable/10/share/man/man4/hv_utils.4 (from r263105, head/share/man/man4/hv_utils.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/hv_utils.4 Wed Mar 19 01:43:03 2014 (r263330, copy of r263105, head/share/man/man4/hv_utils.4) @@ -0,0 +1,85 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" 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. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_utils +.Nd Hyper-V Utilities Driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides time keeping, shutdown and heartbeat +functionality for +.Fx +guest partitions running on Hyper-V. +Hyper-V is a hypervisor-based virtualization technology from Microsoft. +The +.Nm +driver is one of the core drivers required to be present in guest +partitions running on Hyper-V. +This driver provides the following +functionalities to guest partitions: +.Pp +(a) Time Keeping: The clock inside the guest partition will remain accurate by +synchronizing to the clock on the virtualization server via Timesync service, +and with the help of the pluggable time source device. +.Pp +(b) Integrated shutdown: Guest partitions running +.Fx +can be shut down from +Hyper-V Manager console by using the +.Qq Shut down +command. +.Pp +(c) Heartbeat: This feature allows the virtualization server to detect whether +the guest partition is running and responsive. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 , +.Xr hv_ata_pci_disengage 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Copied: stable/10/share/man/man4/hv_vmbus.4 (from r263105, head/share/man/man4/hv_vmbus.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/hv_vmbus.4 Wed Mar 19 01:43:03 2014 (r263330, copy of r263105, head/share/man/man4/hv_vmbus.4) @@ -0,0 +1,93 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" 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. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_vmbus +.Nd Hyper-V Virtual Machine Bus (VMBus) Driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +provides a high performance communication interface between +guest and root partitions in Hyper-V. +Hyper-V is a hypervisor-based virtualization technology from Microsoft. +Hyper-V supports isolation in terms of a partition. +A partition is a +logical unit of isolation, supported by the hypervisor, in which +operating systems execute. +.Pp +The Microsoft hypervisor must have at least one parent, or root, +partition, running Windows Server operating system. +The virtualization stack runs in the parent partition and has +direct access to the hardware devices. +The root partition then creates the child partitions which host +the guest operating systems. +.Pp +Child partitions do not have direct access to other hardware resources +and are presented +a virtual view of the resources, as virtual devices (VDevs). +Requests to the virtual devices are +redirected either via the VMBus or the hypervisor to the devices in +the parent partition, which handles the requests. +.Pp +The VMBus is a logical inter-partition communication channel. +The parent partition hosts Virtualization Service Providers (VSPs) +which communicate over the VMBus to handle device access requests from +child partitions. +Child partitions host Virtualization Service +Consumers (VSCs) which redirect device requests to VSPs in the parent +partition via the VMBus. +The Hyper-V VMBus driver defines and implements +the interface that facilitate high performance bi-directional communication +between the VSCs and VSPs. +All VSCs utilize the VMBus driver. +.Sh SEE ALSO +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 , +.Xr hv_ata_pci_disengage 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Modified: stable/10/share/man/man8/Makefile ============================================================================== --- stable/10/share/man/man8/Makefile Wed Mar 19 01:27:56 2014 (r263329) +++ stable/10/share/man/man8/Makefile Wed Mar 19 01:43:03 2014 (r263330) @@ -3,6 +3,7 @@ MAN= crash.8 \ diskless.8 \ + hv_kvp_daemon.8 \ intro.8 \ nanobsd.8 \ picobsd.8 \ Copied: stable/10/share/man/man8/hv_kvp_daemon.8 (from r263105, head/share/man/man8/hv_kvp_daemon.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man8/hv_kvp_daemon.8 Wed Mar 19 01:43:03 2014 (r263330, copy of r263105, head/share/man/man8/hv_kvp_daemon.8) @@ -0,0 +1,96 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" 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. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_kvp_daemon +.Nd Hyper-V Key Value Pair Daemon +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +daemon provides the ability to store, retrieve, modify and delete +Key Value pairs for +.Fx +guest partitions running on Hyper-V. +Hyper-V allows administrators to store custom metadata in the form +of Key Value pairs inside the +.Fx +guest partition. +Administrators can use Windows Powershell scripts to add, read, modify +and delete such Key Value pairs. +.Pp +The +.Nm +accepts Key Value pair management requests from the +.Xr hv_kvp 4 +driver and performs the actual metadata management on the file-system. +.Pp +The same daemon and driver combination is also used to set and get +IP addresses from a +.Fx +guest. +.Pp +The set functionality is particularly +useful when the +.Fx +guest is assigned a static IP address and is failed +over from one Hyper-V host to another. +After failover, Hyper-V uses the set IP functionality to automatically +update the +.Fx +guest's IP address to its original static value. +.Pp +On the other hand, the get IP functionality is used to update the guest IP +address in the Hyper-V management console window. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 , +.Xr hv_ata_pci_disengage 4 , +.Xr hv_kvp 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The daemon was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 09:23:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 45BA7EFE; Wed, 19 Mar 2014 09:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 31AD3BBB; Wed, 19 Mar 2014 09:23: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 s2J9NxIA051314; Wed, 19 Mar 2014 09:23:59 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J9NxnF051313; Wed, 19 Mar 2014 09:23:59 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403190923.s2J9NxnF051313@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 19 Mar 2014 09:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263334 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 09:23:59 -0000 Author: glebius Date: Wed Mar 19 09:23:58 2014 New Revision: 263334 URL: http://svnweb.freebsd.org/changeset/base/263334 Log: Merge r262747: remove extraneous ifa_ref()/ifa_free(). Modified: stable/10/sys/netinet/ip_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_output.c ============================================================================== --- stable/10/sys/netinet/ip_output.c Wed Mar 19 06:08:03 2014 (r263333) +++ stable/10/sys/netinet/ip_output.c Wed Mar 19 09:23:58 2014 (r263334) @@ -295,7 +295,6 @@ again: goto bad; } ia = ifatoia(rte->rt_ifa); - ifa_ref(&ia->ia_ifa); ifp = rte->rt_ifp; rte->rt_rmx.rmx_pksent++; if (rte->rt_flags & RTF_GATEWAY) @@ -532,11 +531,8 @@ sendit: #endif error = netisr_queue(NETISR_IP, m); goto done; - } else { - if (ia != NULL) - ifa_free(&ia->ia_ifa); + } else goto again; /* Redo the routing table lookup. */ - } } /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ @@ -565,8 +561,6 @@ sendit: m->m_flags |= M_SKIP_FIREWALL; m->m_flags &= ~M_IP_NEXTHOP; m_tag_delete(m, fwd_tag); - if (ia != NULL) - ifa_free(&ia->ia_ifa); goto again; } @@ -677,8 +671,6 @@ passout: done: if (ro == &iproute) RO_RTFREE(ro); - if (ia != NULL) - ifa_free(&ia->ia_ifa); return (error); bad: m_freem(m); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 09:36:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 057B41C2; Wed, 19 Mar 2014 09:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9511C94; Wed, 19 Mar 2014 09:36: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 s2J9aUmt055660; Wed, 19 Mar 2014 09:36:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J9aT6h055653; Wed, 19 Mar 2014 09:36:29 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403190936.s2J9aT6h055653@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 19 Mar 2014 09:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263335 - stable/10/usr.bin/netstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 09:36:31 -0000 Author: glebius Date: Wed Mar 19 09:36:29 2014 New Revision: 263335 URL: http://svnweb.freebsd.org/changeset/base/263335 Log: Merge r259562,r259566,r259638,r259645,r260124 by melifaro: Switch netstat -rn to use standard API for retrieving list of routes instead of peeking inside in-kernel radix via kget. Modified: stable/10/usr.bin/netstat/if.c stable/10/usr.bin/netstat/main.c stable/10/usr.bin/netstat/mroute.c stable/10/usr.bin/netstat/mroute6.c stable/10/usr.bin/netstat/netgraph.c stable/10/usr.bin/netstat/netstat.h stable/10/usr.bin/netstat/route.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/netstat/if.c ============================================================================== --- stable/10/usr.bin/netstat/if.c Wed Mar 19 09:23:58 2014 (r263334) +++ stable/10/usr.bin/netstat/if.c Wed Mar 19 09:36:29 2014 (r263335) @@ -224,7 +224,7 @@ next_ifma(struct ifmaddrs *ifma, const c * Print a description of the network interfaces. */ void -intpr(int interval, void (*pfunc)(char *)) +intpr(int interval, void (*pfunc)(char *), int af) { struct ifaddrs *ifap, *ifa; struct ifmaddrs *ifmap, *ifma; Modified: stable/10/usr.bin/netstat/main.c ============================================================================== --- stable/10/usr.bin/netstat/main.c Wed Mar 19 09:23:58 2014 (r263334) +++ stable/10/usr.bin/netstat/main.c Wed Mar 19 09:36:29 2014 (r263335) @@ -552,41 +552,41 @@ main(int argc, char *argv[]) * used for the queries, which is slower. */ #endif - kread(0, NULL, 0); if (iflag && !sflag) { - intpr(interval, NULL); + intpr(interval, NULL, af); exit(0); } if (rflag) { if (sflag) { - rt_stats(nl[N_RTSTAT].n_value, nl[N_RTTRASH].n_value); + rt_stats(); flowtable_stats(); } else - routepr(nl[N_RTREE].n_value, fib); + routepr(fib, af); exit(0); } + if (gflag) { if (sflag) { if (af == AF_INET || af == AF_UNSPEC) - mrt_stats(nl[N_MRTSTAT].n_value); + mrt_stats(); #ifdef INET6 if (af == AF_INET6 || af == AF_UNSPEC) - mrt6_stats(nl[N_MRT6STAT].n_value); + mrt6_stats(); #endif } else { if (af == AF_INET || af == AF_UNSPEC) - mroutepr(nl[N_MFCHASHTBL].n_value, - nl[N_MFCTABLESIZE].n_value, - nl[N_VIFTABLE].n_value); + mroutepr(); #ifdef INET6 if (af == AF_INET6 || af == AF_UNSPEC) - mroute6pr(nl[N_MF6CTABLE].n_value, - nl[N_MIF6TABLE].n_value); + mroute6pr(); #endif } exit(0); } + /* Load all necessary kvm symbols */ + kresolve_list(nl); + if (tp) { printproto(tp, tp->pr_name); exit(0); @@ -639,7 +639,7 @@ printproto(struct protox *tp, const char if (sflag) { if (iflag) { if (tp->pr_istats) - intpr(interval, tp->pr_istats); + intpr(interval, tp->pr_istats, af); else if (pflag) printf("%s: no per-interface stats routine\n", tp->pr_name); @@ -702,7 +702,23 @@ kvmd_init(void) return (-1); } - if (kvm_nlist(kvmd, nl) < 0) { + return (0); +} + +/* + * Resolve symbol list, return 0 on success. + */ +int +kresolve_list(struct nlist *_nl) +{ + + if ((kvmd == NULL) && (kvmd_init() != 0)) + return (-1); + + if (_nl[0].n_type != 0) + return (0); + + if (kvm_nlist(kvmd, _nl) < 0) { if (nlistf) errx(1, "%s: kvm_nlist: %s", nlistf, kvm_geterr(kvmd)); @@ -710,13 +726,6 @@ kvmd_init(void) errx(1, "kvm_nlist: %s", kvm_geterr(kvmd)); } - if (nl[0].n_type == 0) { - if (nlistf) - errx(1, "%s: no namelist", nlistf); - else - errx(1, "no namelist"); - } - return (0); } Modified: stable/10/usr.bin/netstat/mroute.c ============================================================================== --- stable/10/usr.bin/netstat/mroute.c Wed Mar 19 09:23:58 2014 (r263334) +++ stable/10/usr.bin/netstat/mroute.c Wed Mar 19 09:36:29 2014 (r263335) @@ -65,11 +65,26 @@ __FBSDID("$FreeBSD$"); #undef _KERNEL #include +#include #include #include #include #include "netstat.h" +/* + * kvm(3) bindings for every needed symbol + */ +static struct nlist mrl[] = { +#define N_MRTSTAT 0 + { .n_name = "_mrtstat" }, +#define N_MFCHASHTBL 1 + { .n_name = "_mfchashtbl" }, +#define N_VIFTABLE 2 + { .n_name = "_viftable" }, +#define N_MFCTABLESIZE 3 + { .n_name = "_mfctablesize" }, + { .n_name = NULL }, +}; static void print_bw_meter(struct bw_meter *, int *); static void print_mfc(struct mfc *, int, int *); @@ -193,11 +208,12 @@ print_mfc(struct mfc *m, int maxvif, int } void -mroutepr(u_long pmfchashtbl, u_long pmfctablesize, u_long pviftbl) +mroutepr() { struct vif viftable[MAXVIFS]; struct vif *v; struct mfc *m; + u_long pmfchashtbl, pmfctablesize, pviftbl; int banner_printed; int saved_numeric_addr; size_t len; @@ -221,6 +237,16 @@ mroutepr(u_long pmfchashtbl, u_long pmfc */ maxvif = 0; + kresolve_list(mrl); + pmfchashtbl = mrl[N_MFCHASHTBL].n_value; + pmfctablesize = mrl[N_MFCTABLESIZE].n_value; + pviftbl = mrl[N_VIFTABLE].n_value; + + if (pmfchashtbl == 0 || pmfctablesize == 0 || pviftbl == 0) { + fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); + return; + } + len = sizeof(viftable); if (live) { if (sysctlbyname("net.inet.ip.viftable", viftable, &len, NULL, @@ -338,15 +364,24 @@ mroutepr(u_long pmfchashtbl, u_long pmfc } void -mrt_stats(u_long mstaddr) +mrt_stats() { struct mrtstat mrtstat; - size_t len = sizeof mrtstat; + u_long mstaddr; + size_t len = sizeof(mrtstat); + + kresolve_list(mrl); + mstaddr = mrl[N_MRTSTAT].n_value; + + if (mstaddr == 0) { + fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); + return; + } if (live) { if (sysctlbyname("net.inet.ip.mrtstat", &mrtstat, &len, NULL, 0) < 0) { - warn("sysctl: net.inet.ip.mrtstat"); + warn("sysctl: net.inet.ip.mrtstat failed."); return; } } else Modified: stable/10/usr.bin/netstat/mroute6.c ============================================================================== --- stable/10/usr.bin/netstat/mroute6.c Wed Mar 19 09:23:58 2014 (r263334) +++ stable/10/usr.bin/netstat/mroute6.c Wed Mar 19 09:36:29 2014 (r263335) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -95,17 +96,32 @@ __FBSDID("$FreeBSD$"); #include "netstat.h" +/* + * kvm(3) bindings for every needed symbol + */ +static struct nlist mrl[] = { +#define N_MF6CTABLE 0 + { .n_name = "_mf6ctable" }, +#define N_MIF6TABLE 1 + { .n_name = "_mif6table" }, +#define N_MRT6STAT 2 + { .n_name = "_mrt6stat" }, + { .n_name = NULL }, +}; + + #define WID_ORG (Wflag ? 39 : (numeric_addr ? 29 : 18)) /* width of origin column */ #define WID_GRP (Wflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */ void -mroute6pr(u_long mfcaddr, u_long mifaddr) +mroute6pr() { struct mf6c *mf6ctable[MF6CTBLSIZ], *mfcp; struct mif6 mif6table[MAXMIFS]; struct mf6c mfc; struct rtdetq rte, *rtep; struct mif6 *mifp; + u_long mfcaddr, mifaddr; mifi_t mifi; int i; int banner_printed; @@ -114,6 +130,15 @@ mroute6pr(u_long mfcaddr, u_long mifaddr long int waitings; size_t len; + kresolve_list(mrl); + mfcaddr = mrl[N_MF6CTABLE].n_value; + mifaddr = mrl[N_MIF6TABLE].n_value; + + if (mfcaddr == 0 || mifaddr == 0) { + fprintf(stderr, "No IPv6 MROUTING kernel support.\n"); + return; + } + len = sizeof(mif6table); if (live) { if (sysctlbyname("net.inet6.ip6.mif6table", mif6table, &len, @@ -217,11 +242,20 @@ mroute6pr(u_long mfcaddr, u_long mifaddr } void -mrt6_stats(u_long mstaddr) +mrt6_stats() { struct mrt6stat mrtstat; + u_long mstaddr; size_t len = sizeof mrtstat; + kresolve_list(mrl); + mstaddr = mrl[N_MRT6STAT].n_value; + + if (mstaddr == 0) { + fprintf(stderr, "No IPv6 MROUTING kernel support.\n"); + return; + } + if (live) { if (sysctlbyname("net.inet6.ip6.mrt6stat", &mrtstat, &len, NULL, 0) < 0) { Modified: stable/10/usr.bin/netstat/netgraph.c ============================================================================== --- stable/10/usr.bin/netstat/netgraph.c Wed Mar 19 09:23:58 2014 (r263334) +++ stable/10/usr.bin/netstat/netgraph.c Wed Mar 19 09:36:29 2014 (r263335) @@ -72,53 +72,10 @@ netgraphprotopr(u_long off, const char * /* If symbol not found, try looking in the KLD module */ if (off == 0) { - const char *const modname = "ng_socket.ko"; -/* XXX We should get "mpath" from "sysctl kern.module_path" */ - const char *mpath[] = { "/", "/boot/", "/modules/", NULL }; - struct nlist sym[] = { { .n_name = "_ngsocklist" }, - { .n_name = NULL } }; - const char **pre; - struct kld_file_stat ks; - int fileid; - - /* Can't do this for core dumps. */ - if (!live) - return; - - /* See if module is loaded */ - if ((fileid = kldfind(modname)) < 0) { - if (debug) - warn("kldfind(%s)", modname); - return; - } - - /* Get module info */ - memset(&ks, 0, sizeof(ks)); - ks.version = sizeof(struct kld_file_stat); - if (kldstat(fileid, &ks) < 0) { - if (debug) - warn("kldstat(%d)", fileid); - return; - } - - /* Get symbol table from module file */ - for (pre = mpath; *pre; pre++) { - char path[MAXPATHLEN]; - - snprintf(path, sizeof(path), "%s%s", *pre, modname); - if (nlist(path, sym) == 0) - break; - } - - /* Did we find it? */ - if (sym[0].n_value == 0) { - if (debug) - warnx("%s not found", modname); - return; - } - - /* Symbol found at load address plus symbol offset */ - off = (u_long) ks.address + sym[0].n_value; + if (debug) + fprintf(stderr, + "Error reading symbols from ng_socket.ko"); + return; } /* Get pointer to first socket */ Modified: stable/10/usr.bin/netstat/netstat.h ============================================================================== --- stable/10/usr.bin/netstat/netstat.h Wed Mar 19 09:23:58 2014 (r263334) +++ stable/10/usr.bin/netstat/netstat.h Wed Mar 19 09:36:29 2014 (r263335) @@ -56,11 +56,12 @@ extern int interval; /* repeat interval extern char *interface; /* desired i/f for stats, or NULL for all i/fs */ extern int unit; /* unit number for above */ -extern int af; /* address family */ extern int live; /* true if we are examining a live system */ +struct nlist; int kread(u_long addr, void *buf, size_t size); int kread_counters(u_long addr, void *buf, size_t size); +int kresolve_list(struct nlist *); const char *plural(uintmax_t); const char *plurales(uintmax_t); const char *pluralies(uintmax_t); @@ -97,8 +98,8 @@ void icmp6_stats(u_long, const char *, i void icmp6_ifstats(char *); void pim6_stats(u_long, const char *, int, int); void rip6_stats(u_long, const char *, int, int); -void mroute6pr(u_long, u_long); -void mrt6_stats(u_long); +void mroute6pr(void); +void mrt6_stats(void); struct sockaddr_in6; struct in6_addr; @@ -119,11 +120,11 @@ void netisr_stats(void *); void hostpr(u_long, u_long); void impstats(u_long, u_long); -void intpr(int, void (*)(char *)); +void intpr(int, void (*)(char *), int); void pr_rthdr(int); void pr_family(int); -void rt_stats(u_long, u_long); +void rt_stats(void); void flowtable_stats(void); char *ipx_pnet(struct sockaddr *); char *ipx_phost(struct sockaddr *); @@ -136,7 +137,7 @@ char *atalk_print(struct sockaddr *, int char *atalk_print2(struct sockaddr *, struct sockaddr *, int); char *ipx_print(struct sockaddr *); char *ns_print(struct sockaddr *); -void routepr(u_long, int); +void routepr(int, int); void ipxprotopr(u_long, const char *, int, int); void spx_stats(u_long, const char *, int, int); @@ -166,6 +167,6 @@ void tp_protopr(u_long, const char *, in void tp_inproto(u_long); void tp_stats(caddr_t, caddr_t); -void mroutepr(u_long, u_long, u_long); -void mrt_stats(u_long); +void mroutepr(void); +void mrt_stats(void); void bpf_stats(char *); Modified: stable/10/usr.bin/netstat/route.c ============================================================================== --- stable/10/usr.bin/netstat/route.c Wed Mar 19 09:23:58 2014 (r263334) +++ stable/10/usr.bin/netstat/route.c Wed Mar 19 09:36:29 2014 (r263335) @@ -58,8 +58,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include #include #include @@ -105,6 +107,19 @@ struct bits { { 0 , 0 } }; +/* + * kvm(3) bindings for every needed symbol + */ +static struct nlist rl[] = { +#define N_RTSTAT 0 + { .n_name = "_rtstat" }, +#define N_RTREE 1 + { .n_name = "_rt_tables"}, +#define N_RTTRASH 2 + { .n_name = "_rttrash" }, + { .n_name = NULL }, +}; + typedef union { long dummy; /* Helps align structure. */ struct sockaddr u_sa; @@ -113,13 +128,19 @@ typedef union { static sa_u pt_u; +struct ifmap_entry { + char ifname[IFNAMSIZ]; +}; + +static struct ifmap_entry *ifmap; +static int ifmap_size; + int do_rtent = 0; struct rtentry rtentry; struct radix_node rnode; struct radix_mask rmask; -struct radix_node_head **rt_tables; -int NewTree = 0; +int NewTree = 1; struct timespec uptime; @@ -127,27 +148,27 @@ static struct sockaddr *kgetsa(struct so static void size_cols(int ef, struct radix_node *rn); static void size_cols_tree(struct radix_node *rn); static void size_cols_rtentry(struct rtentry *rt); -static void p_tree(struct radix_node *); -static void p_rtnode(void); -static void ntreestuff(void); -static void np_rtentry(struct rt_msghdr *); +static void p_rtnode_kvm(void); +static void p_rtable_sysctl(int, int); +static void p_rtable_kvm(int, int ); +static void p_rtree_kvm(struct radix_node *); +static void p_rtentry_sysctl(struct rt_msghdr *); static void p_sockaddr(struct sockaddr *, struct sockaddr *, int, int); static const char *fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags); static void p_flags(int, const char *); static const char *fmt_flags(int f); -static void p_rtentry(struct rtentry *); +static void p_rtentry_kvm(struct rtentry *); static void domask(char *, in_addr_t, u_long); /* * Print routing tables. */ void -routepr(u_long rtree, int fibnum) +routepr(int fibnum, int af) { - struct radix_node_head **rnhp, *rnh, head; size_t intsize; - int fam, numfibs; + int numfibs; intsize = sizeof(int); if (fibnum == -1 && @@ -157,10 +178,6 @@ routepr(u_long rtree, int fibnum) numfibs = 1; if (fibnum < 0 || fibnum > numfibs - 1) errx(EX_USAGE, "%d: invalid fib", fibnum); - rt_tables = calloc(numfibs * (AF_MAX+1), - sizeof(struct radix_node_head *)); - if (rt_tables == NULL) - err(EX_OSERR, "memory allocation failed"); /* * Since kernel & userland use different timebase * (time_uptime vs time_second) and we are reading kernel memory @@ -174,55 +191,13 @@ routepr(u_long rtree, int fibnum) printf(" (fib: %d)", fibnum); printf("\n"); - if (Aflag == 0 && NewTree) - ntreestuff(); - else { - if (rtree == 0) { - printf("rt_tables: symbol not in namelist\n"); - return; - } - - if (kread((u_long)(rtree), (char *)(rt_tables), (numfibs * - (AF_MAX+1) * sizeof(struct radix_node_head *))) != 0) - return; - for (fam = 0; fam <= AF_MAX; fam++) { - int tmpfib; - - switch (fam) { - case AF_INET6: - case AF_INET: - tmpfib = fibnum; - break; - default: - tmpfib = 0; - } - rnhp = (struct radix_node_head **)*rt_tables; - /* Calculate the in-kernel address. */ - rnhp += tmpfib * (AF_MAX+1) + fam; - /* Read the in kernel rhn pointer. */ - if (kget(rnhp, rnh) != 0) - continue; - if (rnh == NULL) - continue; - /* Read the rnh data. */ - if (kget(rnh, head) != 0) - continue; - if (fam == AF_UNSPEC) { - if (Aflag && af == 0) { - printf("Netmasks:\n"); - p_tree(head.rnh_treetop); - } - } else if (af == AF_UNSPEC || af == fam) { - size_cols(fam, head.rnh_treetop); - pr_family(fam); - do_rtent = 1; - pr_rthdr(fam); - p_tree(head.rnh_treetop); - } - } - } + if (Aflag == 0 && live != 0 && NewTree) + p_rtable_sysctl(fibnum, af); + else + p_rtable_kvm(fibnum, af); } + /* * Print address family header before a section of the routing table. */ @@ -288,7 +263,7 @@ static int wid_if; static int wid_expire; static void -size_cols(int ef __unused, struct radix_node *rn) +size_cols(int ef, struct radix_node *rn) { wid_dst = WID_DST_DEFAULT(ef); wid_gw = WID_GW_DEFAULT(ef); @@ -299,7 +274,7 @@ size_cols(int ef __unused, struct radix_ wid_if = WID_IF_DEFAULT(ef); wid_expire = 6; - if (Wflag) + if (Wflag && rn != NULL) size_cols_tree(rn); } @@ -397,27 +372,14 @@ pr_rthdr(int af1) if (Aflag) printf("%-8.8s ","Address"); - if (af1 == AF_INET || Wflag) { - if (Wflag) { - printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*.*s %*.*s %*s\n", - wid_dst, wid_dst, "Destination", - wid_gw, wid_gw, "Gateway", - wid_flags, wid_flags, "Flags", - wid_refs, wid_refs, "Refs", - wid_use, wid_use, "Use", - wid_mtu, wid_mtu, "Mtu", - wid_if, wid_if, "Netif", - wid_expire, "Expire"); - } else { - printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*.*s %*s\n", - wid_dst, wid_dst, "Destination", - wid_gw, wid_gw, "Gateway", - wid_flags, wid_flags, "Flags", - wid_refs, wid_refs, "Refs", - wid_use, wid_use, "Use", - wid_if, wid_if, "Netif", - wid_expire, "Expire"); - } + if (Wflag) { + printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*s\n", + wid_dst, wid_dst, "Destination", + wid_gw, wid_gw, "Gateway", + wid_flags, wid_flags, "Flags", + wid_mtu, wid_mtu, "Mtu", + wid_if, wid_if, "Netif", + wid_expire, "Expire"); } else { printf("%-*.*s %-*.*s %-*.*s %*.*s %*s\n", wid_dst, wid_dst, "Destination", @@ -439,8 +401,77 @@ kgetsa(struct sockaddr *dst) return (&pt_u.u_sa); } +/* + * Print kernel routing tables for given fib + * using debugging kvm(3) interface. + */ +static void +p_rtable_kvm(int fibnum, int af) +{ + struct radix_node_head **rnhp, *rnh, head; + struct radix_node_head **rt_tables; + u_long rtree; + int fam, af_size; + + kresolve_list(rl); + if ((rtree = rl[N_RTREE].n_value) == 0) { + printf("rt_tables: symbol not in namelist\n"); + return; + } + + af_size = (AF_MAX + 1) * sizeof(struct radix_node_head *); + rt_tables = calloc(1, af_size); + if (rt_tables == NULL) + err(EX_OSERR, "memory allocation failed"); + + if (kread((u_long)(rtree), (char *)(rt_tables) + fibnum * af_size, + af_size) != 0) + err(EX_OSERR, "error retrieving radix pointers"); + for (fam = 0; fam <= AF_MAX; fam++) { + int tmpfib; + + switch (fam) { + case AF_INET6: + case AF_INET: + tmpfib = fibnum; + break; + default: + tmpfib = 0; + } + rnhp = (struct radix_node_head **)*rt_tables; + /* Calculate the in-kernel address. */ + rnhp += tmpfib * (AF_MAX + 1) + fam; + /* Read the in kernel rhn pointer. */ + if (kget(rnhp, rnh) != 0) + continue; + if (rnh == NULL) + continue; + /* Read the rnh data. */ + if (kget(rnh, head) != 0) + continue; + if (fam == AF_UNSPEC) { + if (Aflag && af == 0) { + printf("Netmasks:\n"); + p_rtree_kvm(head.rnh_treetop); + } + } else if (af == AF_UNSPEC || af == fam) { + size_cols(fam, head.rnh_treetop); + pr_family(fam); + do_rtent = 1; + pr_rthdr(fam); + p_rtree_kvm(head.rnh_treetop); + } + } + + free(rt_tables); +} + +/* + * Print given kernel radix tree using + * debugging kvm(3) interface. + */ static void -p_tree(struct radix_node *rn) +p_rtree_kvm(struct radix_node *rn) { again: @@ -457,9 +488,9 @@ again: rnode.rn_dupedkey ? " =>\n" : "\n"); } else if (do_rtent) { if (kget(rn, rtentry) == 0) { - p_rtentry(&rtentry); + p_rtentry_kvm(&rtentry); if (Aflag) - p_rtnode(); + p_rtnode_kvm(); } } else { p_sockaddr(kgetsa((struct sockaddr *)rnode.rn_key), @@ -471,18 +502,18 @@ again: } else { if (Aflag && do_rtent) { printf("%-8.8lx ", (u_long)rn); - p_rtnode(); + p_rtnode_kvm(); } rn = rnode.rn_right; - p_tree(rnode.rn_left); - p_tree(rn); + p_rtree_kvm(rnode.rn_left); + p_rtree_kvm(rn); } } char nbuf[20]; static void -p_rtnode(void) +p_rtnode_kvm(void) { struct radix_mask *rm = rnode.rn_mklist; @@ -522,72 +553,137 @@ p_rtnode(void) } static void -ntreestuff(void) +p_rtable_sysctl(int fibnum, int af) { size_t needed; - int mib[6]; + int mib[7]; char *buf, *next, *lim; struct rt_msghdr *rtm; + struct sockaddr *sa; + int fam = 0, ifindex = 0, size; + + struct ifaddrs *ifap, *ifa; + struct sockaddr_dl *sdl; + + /* + * Retrieve interface list at first + * since we need #ifindex -> if_xname match + */ + if (getifaddrs(&ifap) != 0) + err(EX_OSERR, "getifaddrs"); + + for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + + if (ifa->ifa_addr->sa_family != AF_LINK) + continue; + + sdl = (struct sockaddr_dl *)ifa->ifa_addr; + ifindex = sdl->sdl_index; + + if (ifindex >= ifmap_size) { + size = roundup(ifindex + 1, 32) * + sizeof(struct ifmap_entry); + if ((ifmap = realloc(ifmap, size)) == NULL) + errx(2, "realloc(%d) failed", size); + memset(&ifmap[ifmap_size], 0, + size - ifmap_size * + sizeof(struct ifmap_entry)); + + ifmap_size = roundup(ifindex + 1, 32); + } + + if (*ifmap[ifindex].ifname != '\0') + continue; + + strlcpy(ifmap[ifindex].ifname, ifa->ifa_name, IFNAMSIZ); + } + + freeifaddrs(ifap); mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; - mib[3] = 0; + mib[3] = af; mib[4] = NET_RT_DUMP; mib[5] = 0; - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { - err(1, "sysctl: net.route.0.0.dump estimate"); + mib[6] = fibnum; + if (sysctl(mib, 7, NULL, &needed, NULL, 0) < 0) { + err(1, "sysctl: net.route.0.%d.dump.%d estimate", af, fibnum); } if ((buf = malloc(needed)) == 0) { errx(2, "malloc(%lu)", (unsigned long)needed); } if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { - err(1, "sysctl: net.route.0.0.dump"); + err(1, "sysctl: net.route.0.%d.dump.%d", af, fibnum); } lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; - np_rtentry(rtm); + /* + * Peek inside header to determine AF + */ + sa = (struct sockaddr *)(rtm + 1); + if (fam != sa->sa_family) { + fam = sa->sa_family; + size_cols(fam, NULL); + pr_family(fam); + pr_rthdr(fam); + } + p_rtentry_sysctl(rtm); } } static void -np_rtentry(struct rt_msghdr *rtm) +p_rtentry_sysctl(struct rt_msghdr *rtm) { struct sockaddr *sa = (struct sockaddr *)(rtm + 1); -#ifdef notdef - static int masks_done, banner_printed; -#endif - static int old_af; - int af1 = 0, interesting = RTF_UP | RTF_GATEWAY | RTF_HOST; + char buffer[128]; + char prettyname[128]; + sa_u addr, mask, gw; + unsigned int l; + +#define GETSA(_s, _f) { \ + bzero(&(_s), sizeof(_s)); \ + if (rtm->rtm_addrs & _f) { \ + l = roundup(sa->sa_len, sizeof(long)); \ + memcpy(&(_s), sa, (l > sizeof(_s)) ? sizeof(_s) : l); \ + sa = (struct sockaddr *)((char *)sa + l); \ + } \ +} + + GETSA(addr, RTA_DST); + GETSA(gw, RTA_GATEWAY); + GETSA(mask, RTA_NETMASK); + p_sockaddr(&addr.u_sa, &mask.u_sa, rtm->rtm_flags, wid_dst); + p_sockaddr(&gw.u_sa, NULL, RTF_HOST, wid_gw); -#ifdef notdef - /* for the moment, netmasks are skipped over */ - if (!banner_printed) { - printf("Netmasks:\n"); - banner_printed = 1; - } - if (masks_done == 0) { - if (rtm->rtm_addrs != RTA_DST ) { - masks_done = 1; - af1 = sa->sa_family; - } - } else -#endif - af1 = sa->sa_family; - if (af1 != old_af) { - pr_family(af1); - old_af = af1; + snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); + p_flags(rtm->rtm_flags, buffer); + if (Wflag) { + if (rtm->rtm_rmx.rmx_mtu != 0) + printf("%*lu ", wid_mtu, rtm->rtm_rmx.rmx_mtu); + else + printf("%*s ", wid_mtu, ""); } - if (rtm->rtm_addrs == RTA_DST) - p_sockaddr(sa, NULL, 0, 36); - else { - p_sockaddr(sa, NULL, rtm->rtm_flags, 16); - sa = (struct sockaddr *)(SA_SIZE(sa) + (char *)sa); - p_sockaddr(sa, NULL, 0, 18); + + memset(prettyname, 0, sizeof(prettyname)); + if (rtm->rtm_index < ifmap_size) { + strlcpy(prettyname, ifmap[rtm->rtm_index].ifname, + sizeof(prettyname)); + if (*prettyname == '\0') + strlcpy(prettyname, "---", sizeof(prettyname)); } - p_flags(rtm->rtm_flags & interesting, "%-6.6s "); + + printf("%*.*s", wid_if, wid_if, prettyname); + if (rtm->rtm_rmx.rmx_expire) { + time_t expire_time; + + if ((expire_time = + rtm->rtm_rmx.rmx_expire - uptime.tv_sec) > 0) + printf(" %*d", wid_expire, (int)expire_time); + } + putchar('\n'); } @@ -756,7 +852,7 @@ fmt_flags(int f) } static void -p_rtentry(struct rtentry *rt) +p_rtentry_kvm(struct rtentry *rt) { static struct ifnet ifnet, *lastif; static char buffer[128]; @@ -775,8 +871,10 @@ p_rtentry(struct rtentry *rt) snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); p_flags(rt->rt_flags, buffer); if (addr.u_sa.sa_family == AF_INET || Wflag) { +#if 0 printf("%*d %*lu ", wid_refs, rt->rt_refcnt, wid_use, rt->rt_use); +#endif if (Wflag) { if (rt->rt_rmx.rmx_mtu != 0) printf("%*lu ", wid_mtu, rt->rt_rmx.rmx_mtu); @@ -1009,16 +1107,19 @@ routename6(struct sockaddr_in6 *sa6) * Print routing statistics */ void -rt_stats(u_long rtsaddr, u_long rttaddr) +rt_stats(void) { struct rtstat rtstat; + u_long rtsaddr, rttaddr; int rttrash; - if (rtsaddr == 0) { + kresolve_list(rl); + + if ((rtsaddr = rl[N_RTSTAT].n_value) == 0) { printf("rtstat: symbol not in namelist\n"); return; } - if (rttaddr == 0) { + if ((rttaddr = rl[N_RTTRASH].n_value) == 0) { printf("rttrash: symbol not in namelist\n"); return; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 12:55:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 942202C7; Wed, 19 Mar 2014 12:55: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 809F31DC; Wed, 19 Mar 2014 12:55: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 s2JCtvQX036918; Wed, 19 Mar 2014 12:55:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JCtvJq036917; Wed, 19 Mar 2014 12:55:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403191255.s2JCtvJq036917@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Mar 2014 12:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263354 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 12:55:57 -0000 Author: kib Date: Wed Mar 19 12:55:57 2014 New Revision: 263354 URL: http://svnweb.freebsd.org/changeset/base/263354 Log: MFC r263079: The auio structure is only initialized when the vnode is symlink, avoid reading from it otherwise. Modified: stable/10/sys/kern/vfs_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Wed Mar 19 12:52:49 2014 (r263353) +++ stable/10/sys/kern/vfs_syscalls.c Wed Mar 19 12:55:57 2014 (r263354) @@ -2554,9 +2554,9 @@ kern_readlinkat(struct thread *td, int f auio.uio_td = td; auio.uio_resid = count; error = VOP_READLINK(vp, &auio, td->td_ucred); + td->td_retval[0] = count - auio.uio_resid; } vput(vp); - td->td_retval[0] = count - auio.uio_resid; return (error); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:02:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0C1C7813; Wed, 19 Mar 2014 13:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D28DC297; Wed, 19 Mar 2014 13:02: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 s2JD2IFT040849; Wed, 19 Mar 2014 13:02:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JD2Isg040846; Wed, 19 Mar 2014 13:02:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403191302.s2JD2Isg040846@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Mar 2014 13:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263357 - in stable/10/sys: dev/cpuctl dev/hwpmc kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:02:19 -0000 Author: kib Date: Wed Mar 19 13:02:17 2014 New Revision: 263357 URL: http://svnweb.freebsd.org/changeset/base/263357 Log: MFC r263080: Use correct types for sizeof() in the calculations for the malloc(9) sizes. Modified: stable/10/sys/dev/cpuctl/cpuctl.c stable/10/sys/dev/hwpmc/hwpmc_piv.c stable/10/sys/kern/kern_linker.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/10/sys/dev/cpuctl/cpuctl.c Wed Mar 19 13:00:44 2014 (r263356) +++ stable/10/sys/dev/cpuctl/cpuctl.c Wed Mar 19 13:02:17 2014 (r263357) @@ -510,13 +510,8 @@ cpuctl_modevent(module_t mod __unused, i } if (bootverbose) printf("cpuctl: access to MSR registers/cpuid info.\n"); - cpuctl_devs = (struct cdev **)malloc(sizeof(void *) * mp_ncpus, - M_CPUCTL, M_WAITOK | M_ZERO); - if (cpuctl_devs == NULL) { - DPRINTF("[cpuctl,%d]: cannot allocate memory\n", - __LINE__); - return (ENOMEM); - } + cpuctl_devs = malloc(sizeof(*cpuctl_devs) * mp_ncpus, M_CPUCTL, + M_WAITOK | M_ZERO); for (cpu = 0; cpu < mp_ncpus; cpu++) if (cpu_enabled(cpu)) cpuctl_devs[cpu] = make_dev(&cpuctl_cdevsw, cpu, Modified: stable/10/sys/dev/hwpmc/hwpmc_piv.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_piv.c Wed Mar 19 13:00:44 2014 (r263356) +++ stable/10/sys/dev/hwpmc/hwpmc_piv.c Wed Mar 19 13:02:17 2014 (r263357) @@ -1620,8 +1620,7 @@ pmc_p4_initialize(struct pmc_mdep *md, i PMCDBG(MDP,INI,1, "%s", "p4-initialize"); /* Allocate space for pointers to per-cpu descriptors. */ - p4_pcpu = malloc(sizeof(struct p4_cpu **) * ncpus, M_PMC, - M_ZERO|M_WAITOK); + p4_pcpu = malloc(sizeof(*p4_pcpu) * ncpus, M_PMC, M_ZERO | M_WAITOK); /* Fill in the class dependent descriptor. */ pcd = &md->pmd_classdep[PMC_MDEP_CLASS_INDEX_P4]; Modified: stable/10/sys/kern/kern_linker.c ============================================================================== --- stable/10/sys/kern/kern_linker.c Wed Mar 19 13:00:44 2014 (r263356) +++ stable/10/sys/kern/kern_linker.c Wed Mar 19 13:02:17 2014 (r263357) @@ -725,14 +725,11 @@ linker_file_add_dependency(linker_file_t linker_file_t *newdeps; sx_assert(&kld_sx, SA_XLOCKED); - newdeps = malloc((file->ndeps + 1) * sizeof(linker_file_t *), - M_LINKER, M_WAITOK | M_ZERO); - if (newdeps == NULL) - return (ENOMEM); + newdeps = malloc((file->ndeps + 1) * sizeof(*newdeps), M_LINKER, + M_WAITOK | M_ZERO); if (file->deps) { - bcopy(file->deps, newdeps, - file->ndeps * sizeof(linker_file_t *)); + bcopy(file->deps, newdeps, file->ndeps * sizeof(*newdeps)); free(file->deps, M_LINKER); } file->deps = newdeps; From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:04:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E1500AA4; Wed, 19 Mar 2014 13:04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDC5B2B2; Wed, 19 Mar 2014 13:04: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 s2JD4GJj041152; Wed, 19 Mar 2014 13:04:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JD4Gi5041151; Wed, 19 Mar 2014 13:04:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403191304.s2JD4Gi5041151@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Mar 2014 13:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263359 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:04:17 -0000 Author: kib Date: Wed Mar 19 13:04:16 2014 New Revision: 263359 URL: http://svnweb.freebsd.org/changeset/base/263359 Log: MFC r263092: Do not vdrop() the tmpfs vnode until it is unlocked. The hold reference might be the last, and then vdrop() would free the vnode. Modified: stable/10/sys/vm/vm_object.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_object.c ============================================================================== --- stable/10/sys/vm/vm_object.c Wed Mar 19 13:02:26 2014 (r263358) +++ stable/10/sys/vm/vm_object.c Wed Mar 19 13:04:16 2014 (r263359) @@ -536,17 +536,18 @@ vm_object_deallocate(vm_object_t object) vhold(vp); VM_OBJECT_WUNLOCK(object); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - vdrop(vp); VM_OBJECT_WLOCK(object); if (object->type == OBJT_DEAD || object->ref_count != 1) { VM_OBJECT_WUNLOCK(object); VOP_UNLOCK(vp, 0); + vdrop(vp); return; } if ((object->flags & OBJ_TMPFS) != 0) VOP_UNSET_TEXT(vp); VOP_UNLOCK(vp, 0); + vdrop(vp); } if (object->shadow_count == 0 && object->handle == NULL && From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:09:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0E45CE47; Wed, 19 Mar 2014 13:09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF1F7316; Wed, 19 Mar 2014 13:09: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 s2JD9HWs041857; Wed, 19 Mar 2014 13:09:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JD9HYk041856; Wed, 19 Mar 2014 13:09:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403191309.s2JD9HYk041856@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Mar 2014 13:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263360 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:09:18 -0000 Author: kib Date: Wed Mar 19 13:09:17 2014 New Revision: 263360 URL: http://svnweb.freebsd.org/changeset/base/263360 Log: MFC r263095: Initialize paddr to handle the case of zero size. Modified: stable/10/sys/vm/device_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/device_pager.c ============================================================================== --- stable/10/sys/vm/device_pager.c Wed Mar 19 13:04:16 2014 (r263359) +++ stable/10/sys/vm/device_pager.c Wed Mar 19 13:09:17 2014 (r263360) @@ -412,6 +412,7 @@ old_dev_pager_ctor(void *handle, vm_ooff * XXX assumes VM_PROT_* == PROT_* */ npages = OFF_TO_IDX(size); + paddr = 0; /* Make paddr initialized for the case of size == 0. */ for (off = foff; npages--; off += PAGE_SIZE) { if (csw->d_mmap(dev, off, &paddr, (int)prot, &dummy) != 0) { dev_relthread(dev, ref); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:11:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DE6C22A5; Wed, 19 Mar 2014 13:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C60B13A7; Wed, 19 Mar 2014 13:11: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 s2JDBgnK045245; Wed, 19 Mar 2014 13:11:42 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JDBaPK045202; Wed, 19 Mar 2014 13:11:36 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403191311.s2JDBaPK045202@svn.freebsd.org> From: Ed Maste Date: Wed, 19 Mar 2014 13:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263363 - in stable/10: contrib/llvm/tools/lldb/include/lldb contrib/llvm/tools/lldb/include/lldb/API contrib/llvm/tools/lldb/include/lldb/Breakpoint contrib/llvm/tools/lldb/include/lld... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:11:43 -0000 Author: emaste Date: Wed Mar 19 13:11:35 2014 New Revision: 263363 URL: http://svnweb.freebsd.org/changeset/base/263363 Log: MFC r258054: Update LLDB to upstream r194122 snapshot Inludes minor changes relative to upstream, for compatibility with FreeBSD's in-tree LLVM 3.3: - Reverted LLDB r191806, restoring use of previous API. - Reverted part of LLDB r189317, restoring previous enum names. - Work around missing LLVM r192504, using previous registerEHFrames API (limited functionality). - Removed PlatformWindows header include and init/terminate calls. Sponsored by: DARPA, AFRL Added: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/StreamGDBRemote.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/include/lldb/Core/StreamGDBRemote.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/OptionParser.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/include/lldb/Host/OptionParser.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/SystemRuntime.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/include/lldb/Target/SystemRuntime.h stable/10/contrib/llvm/tools/lldb/source/Core/StreamGDBRemote.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Core/StreamGDBRemote.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/LibCxxUnorderedMap.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/DataFormatters/LibCxxUnorderedMap.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/ValueObjectPrinter.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/DataFormatters/ValueObjectPrinter.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/OptionParser.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Host/common/OptionParser.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/ProcessRunLock.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Host/common/ProcessRunLock.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Platform/POSIX/ - copied from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Platform/POSIX/ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_mips64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_i386.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_mips64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_mips64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX_x86.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_mips64.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_mips64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_i386.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_i386.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_mips64.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_mips64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_x86_64.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_x86_64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h stable/10/contrib/llvm/tools/lldb/source/Target/SystemRuntime.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/source/Target/SystemRuntime.cpp stable/10/contrib/llvm/tools/lldb/tools/driver/ELWrapper.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/tools/driver/ELWrapper.cpp stable/10/contrib/llvm/tools/lldb/tools/driver/ELWrapper.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/tools/driver/ELWrapper.h stable/10/contrib/llvm/tools/lldb/tools/driver/GetOptWrapper.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/tools/driver/GetOptWrapper.cpp stable/10/contrib/llvm/tools/lldb/tools/driver/GetOptWrapper.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/tools/driver/GetOptWrapper.h stable/10/contrib/llvm/tools/lldb/tools/driver/Platform.cpp - copied unchanged from r258054, head/contrib/llvm/tools/lldb/tools/driver/Platform.cpp stable/10/contrib/llvm/tools/lldb/tools/driver/Platform.h - copied unchanged from r258054, head/contrib/llvm/tools/lldb/tools/driver/Platform.h stable/10/contrib/llvm/tools/lldb/tools/lldb-platform/ - copied from r258054, head/contrib/llvm/tools/lldb/tools/lldb-platform/ Deleted: stable/10/contrib/llvm/tools/lldb/include/lldb/Utility/RefCounter.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_i386.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_i386.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_x86_64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextCoreFreeBSD_x86_64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextCoreFreeBSD_x86_64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextCoreLinux_x86_64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextCoreLinux_x86_64.h stable/10/contrib/llvm/tools/lldb/source/Utility/RefCounter.cpp Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBHostOS.h stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointList.h stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocation.h stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolver.h stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointSiteList.h stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/StoppointLocation.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Address.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ArchSpec.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionFileDescriptor.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionMachPort.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConstString.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/DataExtractor.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Disassembler.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/EmulateInstruction.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Error.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Flags.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Log.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Module.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ModuleList.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ModuleSpec.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Opcode.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/PluginManager.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/RangeMap.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/RegularExpression.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/UUID.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Value.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ValueObject.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectDynamicValue.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/dwarf.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/CXXFormatterFunctions.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/DataVisualization.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatCache.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatClasses.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatManager.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatNavigator.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeCategory.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeCategoryMap.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeSummary.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeSynthetic.h stable/10/contrib/llvm/tools/lldb/include/lldb/Expression/ClangExpressionDeclMap.h stable/10/contrib/llvm/tools/lldb/include/lldb/Expression/ClangFunction.h stable/10/contrib/llvm/tools/lldb/include/lldb/Expression/ClangUserExpression.h stable/10/contrib/llvm/tools/lldb/include/lldb/Expression/DWARFExpression.h stable/10/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h stable/10/contrib/llvm/tools/lldb/include/lldb/Expression/IRForTarget.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/Condition.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/Config.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/File.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/FileSpec.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/Host.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/Mutex.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/ProcessRunLock.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/SocketAddress.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/Symbols.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/Terminal.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/TimeValue.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/Args.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/CommandObject.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionValueBoolean.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/OptionValueEnumeration.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/Options.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/PythonDataObjects.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/ScriptInterpreter.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/Block.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/ClangASTImporter.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/ClangASTType.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/ClangNamespaceDecl.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/ObjectFile.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/Symbol.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/SymbolContext.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/Symtab.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/Type.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/TypeList.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/DynamicLoader.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/ExecutionContext.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/Platform.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/Process.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/RegisterContext.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/StackFrame.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/StackFrameList.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/StackID.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/Target.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/Thread.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanCallFunction.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanStepOverRange.h stable/10/contrib/llvm/tools/lldb/include/lldb/Utility/SharingPtr.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-defines.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-enumerations.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-forward.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-private-enumerations.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-private-interfaces.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-private-log.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-private.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-types.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-versioning.h stable/10/contrib/llvm/tools/lldb/source/API/SBCommandInterpreter.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBData.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBDebugger.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBFileSpec.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBFunction.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBHostOS.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBModuleSpec.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBProcess.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBSymbol.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBTarget.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBThread.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBType.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBTypeCategory.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBTypeNameSpecifier.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBValue.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolver.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/StoppointLocation.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandCompletions.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectArgs.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectCommands.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectDisassemble.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectExpression.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectExpression.h stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectFrame.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectHelp.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectLog.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectMemory.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlatform.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectRegister.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectSource.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectTarget.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectThread.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectType.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectWatchpoint.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectWatchpointCommand.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Address.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Communication.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ConnectionFileDescriptor.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ConnectionMachPort.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ConnectionSharedMemory.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ConstString.cpp stable/10/contrib/llvm/tools/lldb/source/Core/DataBufferMemoryMap.cpp stable/10/contrib/llvm/tools/lldb/source/Core/DataExtractor.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Debugger.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Disassembler.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Error.cpp stable/10/contrib/llvm/tools/lldb/source/Core/FileLineResolver.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Log.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Mangled.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Module.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ModuleList.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Opcode.cpp stable/10/contrib/llvm/tools/lldb/source/Core/PluginManager.cpp stable/10/contrib/llvm/tools/lldb/source/Core/SearchFilter.cpp stable/10/contrib/llvm/tools/lldb/source/Core/SourceManager.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Timer.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Value.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ValueObject.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ValueObjectDynamicValue.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ValueObjectSyntheticFilter.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ValueObjectVariable.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/CXXFormatterFunctions.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/DataVisualization.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/FormatCache.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/FormatManager.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/TypeCategory.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/TypeCategoryMap.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/TypeFormat.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/TypeSummary.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/ClangASTSource.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/ClangExpressionDeclMap.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/ClangFunction.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/ClangUserExpression.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/DWARFExpression.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/IRInterpreter.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/IRMemoryMap.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/Materializer.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/Condition.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/File.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/Host.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/Mutex.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/SocketAddress.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/Terminal.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/TimeValue.cpp stable/10/contrib/llvm/tools/lldb/source/Host/freebsd/Host.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/Args.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupArchitecture.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupBoolean.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupFile.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupFormat.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupOutputFile.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupPlatform.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupString.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupUInt64.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupUUID.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupVariable.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionGroupWatchpoint.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/OptionValueProperties.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/PythonDataObjects.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/ScriptInterpreter.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/ScriptInterpreterPython.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.h stable/10/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h stable/10/contrib/llvm/tools/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessMessage.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessMessage.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContext_x86.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/ClangASTImporter.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/CompileUnit.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/DWARFCallFrameInfo.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/FuncUnwinders.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/LineEntry.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/ObjectFile.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/Symbol.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/SymbolContext.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/Symtab.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/Type.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/UnwindTable.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/Variable.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ExecutionContext.cpp stable/10/contrib/llvm/tools/lldb/source/Target/LanguageRuntime.cpp stable/10/contrib/llvm/tools/lldb/source/Target/Platform.cpp stable/10/contrib/llvm/tools/lldb/source/Target/Process.cpp stable/10/contrib/llvm/tools/lldb/source/Target/RegisterContext.cpp stable/10/contrib/llvm/tools/lldb/source/Target/StackFrame.cpp stable/10/contrib/llvm/tools/lldb/source/Target/StackFrameList.cpp stable/10/contrib/llvm/tools/lldb/source/Target/StopInfo.cpp stable/10/contrib/llvm/tools/lldb/source/Target/Target.cpp stable/10/contrib/llvm/tools/lldb/source/Target/TargetList.cpp stable/10/contrib/llvm/tools/lldb/source/Target/Thread.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanRunToAddress.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepOut.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepOverRange.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepRange.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepThrough.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepUntil.cpp stable/10/contrib/llvm/tools/lldb/source/Target/UnixSignals.cpp stable/10/contrib/llvm/tools/lldb/source/Utility/PseudoTerminal.cpp stable/10/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp stable/10/contrib/llvm/tools/lldb/source/Utility/StringExtractor.cpp stable/10/contrib/llvm/tools/lldb/source/Utility/StringExtractor.h stable/10/contrib/llvm/tools/lldb/source/Utility/StringExtractorGDBRemote.cpp stable/10/contrib/llvm/tools/lldb/source/Utility/StringExtractorGDBRemote.h stable/10/contrib/llvm/tools/lldb/source/lldb-log.cpp stable/10/contrib/llvm/tools/lldb/source/lldb.cpp stable/10/contrib/llvm/tools/lldb/tools/driver/Driver.cpp stable/10/contrib/llvm/tools/lldb/tools/driver/Driver.h stable/10/contrib/llvm/tools/lldb/tools/driver/IOChannel.cpp stable/10/contrib/llvm/tools/lldb/tools/driver/IOChannel.h stable/10/lib/clang/liblldbCore/Makefile stable/10/lib/clang/liblldbDataFormatters/Makefile stable/10/lib/clang/liblldbHostCommon/Makefile stable/10/lib/clang/liblldbPluginProcessElfCore/Makefile stable/10/lib/clang/liblldbPluginProcessPOSIX/Makefile stable/10/lib/clang/liblldbPluginSymbolFileDWARF/Makefile stable/10/lib/clang/liblldbTarget/Makefile stable/10/lib/clang/liblldbUtility/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBHostOS.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBHostOS.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBHostOS.h Wed Mar 19 13:11:35 2014 (r263363) @@ -30,7 +30,7 @@ public: static lldb::thread_t ThreadCreate (const char *name, - void *(*thread_function)(void *), + thread_func_t thread_function, void *thread_arg, lldb::SBError *err); @@ -43,7 +43,7 @@ public: lldb::SBError *err); static bool ThreadJoin (lldb::thread_t thread, - void **result, + thread_result_t *result, lldb::SBError *err); Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h Wed Mar 19 13:11:35 2014 (r263363) @@ -269,6 +269,38 @@ public: lldb::SBError UnloadImage (uint32_t image_token); + //------------------------------------------------------------------ + /// Return the number of different thread-origin extended backtraces + /// this process can support. + /// + /// When the process is stopped and you have an SBThread, lldb may be + /// able to show a backtrace of when that thread was originally created, + /// or the work item was enqueued to it (in the case of a libdispatch + /// queue). + /// + /// @return + /// The number of thread-origin extended backtrace types that may be + /// available. + //------------------------------------------------------------------ + uint32_t + GetNumExtendedBacktraceTypes (); + + //------------------------------------------------------------------ + /// Return the name of one of the thread-origin extended backtrace + /// methods. + /// + /// @param [in] idx + /// The index of the name to return. They will be returned in + /// the order that the user will most likely want to see them. + /// e.g. if the type at index 0 is not available for a thread, + /// see if the type at index 1 provides an extended backtrace. + /// + /// @return + /// The name at that index. + //------------------------------------------------------------------ + const char * + GetExtendedBacktraceTypeAtIndex (uint32_t idx); + protected: friend class SBAddress; friend class SBBreakpoint; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h Wed Mar 19 13:11:35 2014 (r263363) @@ -747,6 +747,9 @@ public: lldb::SBType GetBasicType(lldb::BasicType type); + lldb::SBValue + CreateValueFromAddress (const char *name, lldb::SBAddress addr, lldb::SBType type); + SBSourceManager GetSourceManager(); Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h Wed Mar 19 13:11:35 2014 (r263363) @@ -94,6 +94,9 @@ public: const char * GetQueueName() const; + lldb::queue_id_t + GetQueueID() const; + void StepOver (lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping); @@ -117,6 +120,9 @@ public: lldb::SBFileSpec &file_spec, uint32_t line); + SBError + JumpToLine (lldb::SBFileSpec &file_spec, uint32_t line); + void RunToAddress (lldb::addr_t addr); @@ -195,6 +201,9 @@ public: bool GetStatus (lldb::SBStream &status) const; + SBThread + GetExtendedBacktrace (const char *type); + protected: friend class SBBreakpoint; friend class SBBreakpointLocation; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h Wed Mar 19 13:11:35 2014 (r263363) @@ -576,6 +576,12 @@ public: InvokeCallback (StoppointCallbackContext *context, lldb::break_id_t bp_loc_id); + bool + IsHardware() const + { + return m_hardware; + } + protected: friend class Target; //------------------------------------------------------------------ @@ -590,7 +596,10 @@ protected: /// variants that make breakpoints for some common cases. //------------------------------------------------------------------ // This is the generic constructor - Breakpoint(Target &target, lldb::SearchFilterSP &filter_sp, lldb::BreakpointResolverSP &resolver_sp); + Breakpoint(Target &target, + lldb::SearchFilterSP &filter_sp, + lldb::BreakpointResolverSP &resolver_sp, + bool hardware); friend class BreakpointLocation; // To call the following two when determining whether to stop. @@ -609,12 +618,13 @@ private: // For Breakpoint only //------------------------------------------------------------------ bool m_being_created; + bool m_hardware; // If this breakpoint is required to use a hardware breakpoint Target &m_target; // The target that holds this breakpoint. lldb::SearchFilterSP m_filter_sp; // The filter that constrains the breakpoint's domain. lldb::BreakpointResolverSP m_resolver_sp; // The resolver that defines this breakpoint. BreakpointOptions m_options; // Settable breakpoint options BreakpointLocationList m_locations; // The list of locations currently found for this breakpoint. - std::string m_kind_description; + std::string m_kind_description; void SendBreakpointChangedEvent (lldb::BreakpointEventType eventKind); Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointList.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointList.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointList.h Wed Mar 19 13:11:35 2014 (r263363) @@ -149,11 +149,17 @@ public: /// @param[in] module_list /// The module list that has changed. /// - /// @param[in] added + /// @param[in] load /// \b true if the modules are loaded, \b false if unloaded. + /// + /// @param[in] delete_locations + /// If \a load is \b false, then delete breakpoint locations when + /// when updating breakpoints. //------------------------------------------------------------------ void - UpdateBreakpoints (ModuleList &module_list, bool added); + UpdateBreakpoints (ModuleList &module_list, + bool load, + bool delete_locations); void UpdateBreakpointsWhenModuleIsReplaced (lldb::ModuleSP old_module_sp, lldb::ModuleSP new_module_sp); Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocation.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocation.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocation.h Wed Mar 19 13:11:35 2014 (r263363) @@ -324,7 +324,6 @@ public: protected: friend class BreakpointLocationList; - friend class CommandObjectBreakpointCommandAdd; friend class Process; //------------------------------------------------------------------ @@ -375,8 +374,8 @@ private: BreakpointLocation (lldb::break_id_t bid, Breakpoint &owner, const Address &addr, - lldb::tid_t tid = LLDB_INVALID_THREAD_ID, - bool hardware = false); + lldb::tid_t tid, + bool hardware); //------------------------------------------------------------------ // Data members: Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolver.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolver.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolver.h Wed Mar 19 13:11:35 2014 (r263363) @@ -134,6 +134,13 @@ public: } protected: + //------------------------------------------------------------------ + /// SetSCMatchesByLine - Takes a symbol context list of matches which supposedly represent the same file and + /// line number in a CU, and find the nearest actual line number that matches, and then filter down the + /// matching addresses to unique entries, and skip the prologue if asked to do so, and then set + /// breakpoint locations in this breakpoint for all the resultant addresses. + void SetSCMatchesByLine (SearchFilter &filter, SymbolContextList &sc_list, bool skip_prologue, const char *log_ident); + Breakpoint *m_breakpoint; // This is the breakpoint we add locations to. private: Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointSiteList.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointSiteList.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointSiteList.h Wed Mar 19 13:11:35 2014 (r263363) @@ -13,6 +13,7 @@ // C Includes // C++ Includes #include +#include // Other libraries and framework includes // Project includes #include "lldb/Breakpoint/BreakpointSite.h" Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/StoppointLocation.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/StoppointLocation.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/StoppointLocation.h Wed Mar 19 13:11:35 2014 (r263363) @@ -72,20 +72,20 @@ public: uint32_t GetHardwareIndex () const { - return m_hw_index; + return m_hardware_index; } bool - HardwarePreferred () const + HardwareRequired () const { - return m_hw_preferred; + return m_hardware; } virtual bool IsHardware () const { - return m_hw_index != LLDB_INVALID_INDEX32; + return m_hardware_index != LLDB_INVALID_INDEX32; } @@ -103,7 +103,7 @@ public: void SetHardwareIndex (uint32_t index) { - m_hw_index = index; + m_hardware_index = index; } @@ -120,8 +120,8 @@ protected: lldb::break_id_t m_loc_id; // Stoppoint location ID lldb::addr_t m_addr; // The load address of this stop point. The base Stoppoint doesn't // store a full Address since that's not needed for the breakpoint sites. - bool m_hw_preferred; // 1 if this point has been requested to be set using hardware (which may fail due to lack of resources) - uint32_t m_hw_index; // The hardware resource index for this breakpoint/watchpoint + bool m_hardware; // True if this point has been is required to use hardware (which may fail due to lack of resources) + uint32_t m_hardware_index; // The hardware resource index for this breakpoint/watchpoint uint32_t m_byte_size; // The size in bytes of stop location. e.g. the length of the trap opcode for // software breakpoints, or the optional length in bytes for // hardware breakpoints, or the length of the watchpoint. Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Address.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Address.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Address.h Wed Mar 19 13:11:35 2014 (r263363) @@ -540,6 +540,18 @@ protected: //------------------------------------------------------------------ lldb::SectionWP m_section_wp; ///< The section for the address, can be NULL. std::atomic m_offset; ///< Offset into section if \a m_section_wp is valid... + + //------------------------------------------------------------------ + // Returns true if the m_section_wp once had a reference to a valid + // section shared pointer, but no longer does. This can happen if + // we have an address from a module that gets unloaded and deleted. + // This function should only be called if GetSection() returns an + // empty shared pointer and you want to know if this address used to + // have a valid section. + //------------------------------------------------------------------ + bool + SectionWasDeleted() const; + }; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ArchSpec.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ArchSpec.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ArchSpec.h Wed Mar 19 13:11:35 2014 (r263363) @@ -41,6 +41,7 @@ public: eCore_arm_armv5e, eCore_arm_armv5t, eCore_arm_armv6, + eCore_arm_armv6m, eCore_arm_armv7, eCore_arm_armv7f, eCore_arm_armv7s, @@ -53,6 +54,7 @@ public: eCore_thumbv5, eCore_thumbv5e, eCore_thumbv6, + eCore_thumbv6m, eCore_thumbv7, eCore_thumbv7f, eCore_thumbv7s, @@ -60,6 +62,8 @@ public: eCore_thumbv7m, eCore_thumbv7em, + eCore_mips64, + eCore_ppc_generic, eCore_ppc_ppc601, eCore_ppc_ppc602, Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionFileDescriptor.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionFileDescriptor.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionFileDescriptor.h Wed Mar 19 13:11:35 2014 (r263363) @@ -11,20 +11,27 @@ #define liblldb_ConnectionFileDescriptor_h_ // C Includes +#ifdef _WIN32 +typedef unsigned short in_port_t; +#else #include #include #include +#endif // C++ Includes +#include + // Other libraries and framework includes // Project includes #include "lldb/Core/Connection.h" #include "lldb/Host/Mutex.h" #include "lldb/Host/Predicate.h" -#include "lldb/Host/SocketAddress.h" namespace lldb_private { +class SocketAddress; + class ConnectionFileDescriptor : public Connection { @@ -70,6 +77,13 @@ public: GetWritePort () const; protected: + + typedef enum + { + eFDTypeFile, // Other FD requireing read/write + eFDTypeSocket, // Socket requiring send/recv + eFDTypeSocketUDP // Unconnected UDP socket requiring sendto/recvfrom + } FDType; void OpenCommandPipe (); @@ -96,20 +110,13 @@ protected: NamedSocketConnect (const char *socket_name, Error *error_ptr); lldb::ConnectionStatus - Close (int& fd, Error *error); - - typedef enum - { - eFDTypeFile, // Other FD requireing read/write - eFDTypeSocket, // Socket requiring send/recv - eFDTypeSocketUDP // Unconnected UDP socket requiring sendto/recvfrom - } FDType; + Close (int& fd, FDType type, Error *error); int m_fd_send; int m_fd_recv; FDType m_fd_send_type; FDType m_fd_recv_type; - SocketAddress m_udp_send_sockaddr; + std::unique_ptr m_udp_send_sockaddr; bool m_should_close_fd; // True if this class should close the file descriptor when it goes away. uint32_t m_socket_timeout_usec; int m_pipe_read; // A pipe that we select on the reading end of along with Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionMachPort.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionMachPort.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionMachPort.h Wed Mar 19 13:11:35 2014 (r263363) @@ -12,7 +12,8 @@ #define liblldb_ConnectionMachPort_h_ // C Includes -#include +#include +#include // C++ Includes #include Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConstString.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConstString.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ConstString.h Wed Mar 19 13:11:35 2014 (r263363) @@ -86,7 +86,7 @@ public: /// @param[in] cstr /// A pointer to the first character in the C string. The C /// string can be NULL terminated in a buffer that contains - /// more characters than the length of the stirng, or the + /// more characters than the length of the string, or the /// string can be part of another string and a new substring /// can be created. /// @@ -148,11 +148,11 @@ public: /// /b True this object contains a valid non-empty C string, \b /// false otherwise. //------------------------------------------------------------------ - operator bool() const + explicit operator bool() const { return m_string && m_string[0]; } - + //------------------------------------------------------------------ /// Assignment operator /// Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/DataExtractor.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/DataExtractor.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/DataExtractor.h Wed Mar 19 13:11:35 2014 (r263363) @@ -468,6 +468,27 @@ public: } //------------------------------------------------------------------ + /// Copy \a length bytes from \a *offset, without swapping bytes. + /// + /// @param[in] offset + /// The offset into this data from which to start copying + /// + /// @param[in] length + /// The length of the data to copy from this object + /// + /// @param[out] dst + /// The buffer to place the output data. + /// + /// @return + /// Returns the number of bytes that were copied, or zero if + /// anything goes wrong. + //------------------------------------------------------------------ + lldb::offset_t + CopyData (lldb::offset_t offset, + lldb::offset_t length, + void *dst) const; + + //------------------------------------------------------------------ /// Copy \a dst_len bytes from \a *offset_ptr and ensure the copied /// data is treated as a value that can be swapped to match the /// specified byte order. Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h Wed Mar 19 13:11:35 2014 (r263363) @@ -13,7 +13,6 @@ #include -#include #include @@ -323,6 +322,9 @@ public: GetDisassemblyLineCount () const; bool + GetAutoOneLineSummaries () const; + + bool GetNotifyVoid () const; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Disassembler.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Disassembler.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Disassembler.h Wed Mar 19 13:11:35 2014 (r263363) @@ -270,7 +270,8 @@ public: const char *plugin_name, const char *flavor, const ExecutionContext &exe_ctx, - const AddressRange &disasm_range); + const AddressRange &disasm_range, + bool prefer_file_cache); static lldb::DisassemblerSP DisassembleBytes (const ArchSpec &arch, Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/EmulateInstruction.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/EmulateInstruction.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/EmulateInstruction.h Wed Mar 19 13:11:35 2014 (r263363) @@ -69,14 +69,14 @@ /// debugging. The current debugging model is "process centric" where /// all threads must be stopped when any thread is stopped; when /// hitting software breakpoints we must disable the breakpoint by -/// restoring the original breakpoint opcde, single stepping and +/// restoring the original breakpoint opcode, single stepping and /// restoring the breakpoint trap. If all threads were allowed to run /// then other threads could miss the breakpoint. /// /// This class centralizes the code that usually is done in separate /// code paths in a debugger (single step prediction, finding save /// restore locations of registers for unwinding stack frame variables) -/// and emulating the intruction is just a bonus. +/// and emulating the instruction is just a bonus. //---------------------------------------------------------------------- namespace lldb_private { @@ -394,7 +394,7 @@ public: // Mandatory overrides //---------------------------------------------------------------------- virtual bool - SupportsEmulatingIntructionsOfType (InstructionType inst_type) = 0; + SupportsEmulatingInstructionsOfType (InstructionType inst_type) = 0; virtual bool SetTargetTriple (const ArchSpec &arch) = 0; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Error.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Error.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Error.h Wed Mar 19 13:11:35 2014 (r263363) @@ -11,11 +11,10 @@ #define __DCError_h__ #if defined(__cplusplus) -#if defined (__APPLE__) -#include -#endif -#include -#include +#include "llvm/Support/DataTypes.h" + +#include +#include #include #include "lldb/lldb-private.h" @@ -70,7 +69,7 @@ public: Error (ValueType err, lldb::ErrorType type = lldb::eErrorTypeGeneric); explicit - Error (const char* err_str); + Error (const char *format, ...) __attribute__ ((format (printf, 2, 3))); Error (const Error &rhs); //------------------------------------------------------------------ Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Flags.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Flags.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Flags.h Wed Mar 19 13:11:35 2014 (r263363) @@ -13,7 +13,6 @@ #include -#include namespace lldb_private { Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Log.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Log.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Log.h Wed Mar 19 13:11:35 2014 (r263363) @@ -11,11 +11,10 @@ #define liblldb_Log_h_ // C Includes -#include +#include #include #include #include -#include // C++ Includes // Other libraries and framework includes Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Module.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Module.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Module.h Wed Mar 19 13:11:35 2014 (r263363) @@ -347,6 +347,32 @@ public: SymbolContextList& sc_list); //------------------------------------------------------------------ + /// Find addresses by file/line + /// + /// @param[in] target_sp + /// The target the addresses are desired for. + /// + /// @param[in] file + /// Source file to locate. + /// + /// @param[in] line + /// Source line to locate. + /// + /// @param[in] function + /// Optional filter function. Addresses within this function will be + /// added to the 'local' list. All others will be added to the 'extern' list. + /// + /// @param[out] output_local + /// All matching addresses within 'function' + /// + /// @param[out] output_extern + /// All matching addresses not within 'function' + void FindAddressesForLine (const lldb::TargetSP target_sp, + const FileSpec &file, uint32_t line, + Function *function, + std::vector
&output_local, std::vector
&output_extern); + + //------------------------------------------------------------------ /// Find global and static variables by name. /// /// @param[in] name @@ -723,8 +749,49 @@ public: bool ResolveFileAddress (lldb::addr_t vm_addr, Address& so_addr); + //------------------------------------------------------------------ + /// Resolve the symbol context for the given address. + /// + /// Tries to resolve the matching symbol context based on a lookup + /// from the current symbol vendor. If the lazy lookup fails, + /// an attempt is made to parse the eh_frame section to handle + /// stripped symbols. If this fails, an attempt is made to resolve + /// the symbol to the previous address to handle the case of a + /// function with a tail call. + /// + /// Use properties of the modified SymbolContext to inspect any + /// resolved target, module, compilation unit, symbol, function, + /// function block or line entry. Use the return value to determine + /// which of these properties have been modified. + /// + /// @param[in] so_addr + /// A load address to resolve. + /// + /// @param[in] resolve_scope + /// The scope that should be resolved (see SymbolContext::Scope). + /// A combination of flags from the enumeration SymbolContextItem + /// requesting a resolution depth. Note that the flags that are + /// actually resolved may be a superset of the requested flags. + /// For instance, eSymbolContextSymbol requires resolution of + /// eSymbolContextModule, and eSymbolContextFunction requires + /// eSymbolContextSymbol. + /// + /// @param[out] sc + /// The SymbolContext that is modified based on symbol resolution. + /// + /// @param[in] resolve_tail_call_address + /// Determines if so_addr should resolve to a symbol in the case + /// of a function whose last instruction is a call. In this case, + /// the PC can be one past the address range of the function. + /// + /// @return + /// The scope that has been resolved (see SymbolContext::Scope). + /// + /// @see SymbolContext::Scope + //------------------------------------------------------------------ uint32_t - ResolveSymbolContextForAddress (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc); + ResolveSymbolContextForAddress (const Address& so_addr, uint32_t resolve_scope, + SymbolContext& sc, bool resolve_tail_call_address = false); //------------------------------------------------------------------ /// Resolve items in the symbol context for a given file and line. Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ModuleList.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ModuleList.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ModuleList.h Wed Mar 19 13:11:35 2014 (r263363) @@ -439,7 +439,35 @@ public: bool FindSourceFile (const FileSpec &orig_spec, FileSpec &new_spec) const; - + + + //------------------------------------------------------------------ + /// Find addresses by file/line + /// + /// @param[in] target_sp + /// The target the addresses are desired for. + /// + /// @param[in] file + /// Source file to locate. + /// + /// @param[in] line + /// Source line to locate. + /// + /// @param[in] function + /// Optional filter function. Addresses within this function will be + /// added to the 'local' list. All others will be added to the 'extern' list. + /// + /// @param[out] output_local + /// All matching addresses within 'function' + /// + /// @param[out] output_extern + /// All matching addresses not within 'function' + void FindAddressesForLine (const lldb::TargetSP target_sp, + const FileSpec &file, uint32_t line, + Function *function, + std::vector
&output_local, std::vector
&output_extern); + + bool Remove (const lldb::ModuleSP &module_sp); Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ModuleSpec.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ModuleSpec.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/ModuleSpec.h Wed Mar 19 13:11:35 2014 (r263363) @@ -288,7 +288,7 @@ public: } - operator bool () const + explicit operator bool () const { if (m_file) return true; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Opcode.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Opcode.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Opcode.h Wed Mar 19 13:11:35 2014 (r263363) @@ -38,7 +38,7 @@ namespace lldb_private { eType64, eTypeBytes }; - + Opcode () : m_type (eTypeInvalid) { } @@ -78,7 +78,7 @@ namespace lldb_private { { return m_type; } - + uint8_t GetOpcode8 (uint8_t invalid_opcode = UINT8_MAX) const { @@ -91,7 +91,6 @@ namespace lldb_private { case Opcode::eType32: break; case Opcode::eType64: break; case Opcode::eTypeBytes: break; - break; } return invalid_opcode; } @@ -157,7 +156,7 @@ namespace lldb_private { m_type = eType16; m_data.inst16 = inst; } - + void SetOpcode16_2 (uint32_t inst) { @@ -206,7 +205,7 @@ namespace lldb_private { return m_data.inst.bytes; return NULL; } - + uint32_t GetByteSize () const { @@ -222,7 +221,7 @@ namespace lldb_private { } return 0; } - + // Get the opcode exactly as it would be laid out in memory. uint32_t GetData (DataExtractor &data) const; @@ -246,7 +245,7 @@ namespace lldb_private { } return NULL; } - + lldb::ByteOrder GetDataByteOrder () const; @@ -257,7 +256,7 @@ namespace lldb_private { uint16_t inst16; uint32_t inst32; uint64_t inst64; - struct + struct { uint8_t bytes[16]; // This must be big enough to handle any opcode for any supported target. uint8_t length; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/PluginManager.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/PluginManager.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/PluginManager.h Wed Mar 19 13:11:35 2014 (r263363) @@ -132,6 +132,24 @@ public: //------------------------------------------------------------------ + // SystemRuntime + //------------------------------------------------------------------ + static bool + RegisterPlugin (const ConstString &name, + const char *description, + SystemRuntimeCreateInstance create_callback); + + static bool + UnregisterPlugin (SystemRuntimeCreateInstance create_callback); + + static SystemRuntimeCreateInstance + GetSystemRuntimeCreateCallbackAtIndex (uint32_t idx); + + static SystemRuntimeCreateInstance + GetSystemRuntimeCreateCallbackForPluginName (const ConstString &name); + + + //------------------------------------------------------------------ // ObjectFile //------------------------------------------------------------------ static bool Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/RangeMap.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/RangeMap.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/RangeMap.h Wed Mar 19 13:11:35 2014 (r263363) @@ -592,7 +592,7 @@ namespace lldb_private { void Reserve (typename Collection::size_type size) { - m_entries.resize (size); + m_entries.reserve (size); } bool @@ -1229,16 +1229,11 @@ namespace lldb_private { typename Collection::const_iterator end = m_entries.end(); typename Collection::const_iterator pos = std::lower_bound (begin, end, entry, BaseLessThan); + while(pos != begin && pos[-1].Contains(addr)) + --pos; + if (pos != end && pos->Contains(addr)) - { return std::distance (begin, pos); - } - else if (pos != begin) - { - --pos; - if (pos->Contains(addr)) - return std::distance (begin, pos); - } } return UINT32_MAX; } @@ -1257,19 +1252,12 @@ namespace lldb_private { typename Collection::iterator begin = m_entries.begin(); typename Collection::iterator end = m_entries.end(); typename Collection::iterator pos = std::lower_bound (begin, end, entry, BaseLessThan); + + while(pos != begin && pos[-1].Contains(addr)) + --pos; if (pos != end && pos->Contains(addr)) - { return &(*pos); - } - else if (pos != begin) - { - --pos; - if (pos->Contains(addr)) - { - return &(*pos); - } - } } return NULL; } @@ -1288,18 +1276,11 @@ namespace lldb_private { typename Collection::const_iterator end = m_entries.end(); typename Collection::const_iterator pos = std::lower_bound (begin, end, entry, BaseLessThan); - if (pos != end && pos->Contains(addr)) - { - return &(*pos); - } - else if (pos != begin) - { + while(pos != begin && pos[-1].Contains(addr)) --pos; - if (pos->Contains(addr)) - { - return &(*pos); - } - } + + if (pos != end && pos->Contains(addr)) + return &(*pos); } return NULL; } @@ -1316,18 +1297,11 @@ namespace lldb_private { typename Collection::const_iterator end = m_entries.end(); typename Collection::const_iterator pos = std::lower_bound (begin, end, range, BaseLessThan); - if (pos != end && pos->Contains(range)) - { - return &(*pos); - } - else if (pos != begin) - { + while(pos != begin && pos[-1].Contains(range)) --pos; - if (pos->Contains(range)) - { - return &(*pos); - } - } + + if (pos != end && pos->Contains(range)) + return &(*pos); } return NULL; } @@ -1501,12 +1475,15 @@ namespace lldb_private { typename Collection::iterator end = m_entries.end(); typename Collection::iterator pos = std::lower_bound (begin, end, entry, BaseLessThan); + while(pos != begin && pos[-1].addr == addr) + --pos; + if (pos != end) { if (pos->addr == addr || !exact_match_only) return &(*pos); } - } + } return NULL; } Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/RegularExpression.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/RegularExpression.h Wed Mar 19 13:10:25 2014 (r263362) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/RegularExpression.h Wed Mar 19 13:11:35 2014 (r263363) @@ -11,7 +11,36 @@ #define liblldb_DBRegex_h_ #if defined(__cplusplus) +#ifdef _WIN32 +#include "../lib/Support/regex_impl.h" + +typedef llvm_regmatch_t regmatch_t; +typedef llvm_regex_t regex_t; + +inline int regcomp(llvm_regex_t * a, const char *b, int c) +{ + return llvm_regcomp(a, b, c); +} + +inline size_t regerror(int a, const llvm_regex_t *b, char *c, size_t d) +{ + return llvm_regerror(a, b, c, d); +} + +inline int regexec(const llvm_regex_t * a, const char * b, size_t c, + llvm_regmatch_t d [], int e) +{ + return llvm_regexec(a, b, c, d, e); +} + +inline void regfree(llvm_regex_t * a) +{ + llvm_regfree(a); +} + +#else #include +#endif #include #include Copied: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/StreamGDBRemote.h (from r258054, head/contrib/llvm/tools/lldb/include/lldb/Core/StreamGDBRemote.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/StreamGDBRemote.h Wed Mar 19 13:11:35 2014 (r263363, copy of r258054, head/contrib/llvm/tools/lldb/include/lldb/Core/StreamGDBRemote.h) @@ -0,0 +1,54 @@ +//===-- StreamGDBRemote.h ----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_StreamGDBRemote_h_ +#define liblldb_StreamGDBRemote_h_ + +// C Includes +// C++ Includes + +// Other libraries and framework includes +// Project includes + +#include "lldb/Core/StreamString.h" + +namespace lldb_private { + + class StreamGDBRemote : public StreamString + { + public: + StreamGDBRemote (); + + StreamGDBRemote (uint32_t flags, + uint32_t addr_size, + lldb::ByteOrder byte_order); + + virtual + ~StreamGDBRemote (); + + //------------------------------------------------------------------ + /// Output a block of data to the stream performing GDB-remote escaping. + /// + /// @param[in] s + /// A block of data. + /// + /// @param[in] src_len + /// The amount of data to write. + /// + /// @return + /// Number of bytes written. + //------------------------------------------------------------------ + int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:13:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 670BD479; Wed, 19 Mar 2014 13:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 392E53D7; Wed, 19 Mar 2014 13:13: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 s2JDDmGE045554; Wed, 19 Mar 2014 13:13:48 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JDDmsQ045553; Wed, 19 Mar 2014 13:13:48 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403191313.s2JDDmsQ045553@svn.freebsd.org> From: Ed Maste Date: Wed, 19 Mar 2014 13:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263364 - stable/10/contrib/llvm/tools/lldb/source/Host/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:13:48 -0000 Author: emaste Date: Wed Mar 19 13:13:47 2014 New Revision: 263364 URL: http://svnweb.freebsd.org/changeset/base/263364 Log: MFC r258094: lldb: Correct a standalone debug file path For a file /bin/ls with a .gnu_debuglink entry of "ls.debug" the path should be /usr/lib/debug/bin/ls.debug, not /usr/lib/debug/bin/ls. ref: https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html Upstream defect pr17903 (http://llvm.org/pr17903) Sponsored by: DARPA, AFRL Modified: stable/10/contrib/llvm/tools/lldb/source/Host/common/Symbols.cpp Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/tools/lldb/source/Host/common/Symbols.cpp ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Host/common/Symbols.cpp Wed Mar 19 13:11:35 2014 (r263363) +++ stable/10/contrib/llvm/tools/lldb/source/Host/common/Symbols.cpp Wed Mar 19 13:13:47 2014 (r263364) @@ -61,9 +61,9 @@ Symbols::LocateExecutableSymbolFile (con uuid_str = uuid_str + ".debug"; } - // Get full path to our module. Needed to check debug files like this: - // /usr/lib/debug/usr/lib/libboost_date_time.so.1.46.1 - std::string module_filename = module_spec.GetFileSpec().GetPath(); + // Get directory of our module. Needed to check debug files like this: + // /usr/lib/debug/usr/lib/library.so.debug + std::string module_directory = module_spec.GetFileSpec().GetDirectory().AsCString(); size_t num_directories = debug_file_search_paths.GetSize(); for (size_t idx = 0; idx < num_directories; ++idx) @@ -79,7 +79,7 @@ Symbols::LocateExecutableSymbolFile (con files.push_back (dirname + "/" + symbol_filename); files.push_back (dirname + "/.debug/" + symbol_filename); files.push_back (dirname + "/.build-id/" + uuid_str); - files.push_back (dirname + module_filename); + files.push_back (dirname + module_directory + "/" + symbol_filename); const uint32_t num_files = files.size(); for (size_t idx_file = 0; idx_file < num_files; ++idx_file) From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:15:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 948E45E3; Wed, 19 Mar 2014 13:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66AD63EA; Wed, 19 Mar 2014 13:15: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 s2JDFHNe045804; Wed, 19 Mar 2014 13:15:17 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JDFHWX045802; Wed, 19 Mar 2014 13:15:17 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403191315.s2JDFHWX045802@svn.freebsd.org> From: Ed Maste Date: Wed, 19 Mar 2014 13:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263365 - stable/10/contrib/llvm/tools/lldb/source/Target X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:15:17 -0000 Author: emaste Date: Wed Mar 19 13:15:16 2014 New Revision: 263365 URL: http://svnweb.freebsd.org/changeset/base/263365 Log: MFC r258098: Merge upstream LLDB r194487: Log failure to restore thread state in ThreadPlanCallFunction::DoTakedown In order to help track down llvm.org/pr17226. Sponsored by: DARPA, AFRL Modified: stable/10/contrib/llvm/tools/lldb/source/Target/Thread.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/tools/lldb/source/Target/Thread.cpp ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Target/Thread.cpp Wed Mar 19 13:13:47 2014 (r263364) +++ stable/10/contrib/llvm/tools/lldb/source/Target/Thread.cpp Wed Mar 19 13:15:16 2014 (r263365) @@ -511,8 +511,7 @@ Thread::CheckpointThreadState (ThreadSta bool Thread::RestoreRegisterStateFromCheckpoint (ThreadStateCheckpoint &saved_state) { - RestoreSaveFrameZero(saved_state.register_backup); - return true; + return RestoreSaveFrameZero(saved_state.register_backup); } bool Modified: stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp Wed Mar 19 13:13:47 2014 (r263364) +++ stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp Wed Mar 19 13:15:16 2014 (r263365) @@ -299,7 +299,11 @@ ThreadPlanCallFunction::DoTakedown (bool m_takedown_done = true; m_stop_address = m_thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC(); m_real_stop_info_sp = GetPrivateStopInfo (); - m_thread.RestoreRegisterStateFromCheckpoint(m_stored_thread_state); + if (!m_thread.RestoreRegisterStateFromCheckpoint(m_stored_thread_state)) + { + if (log) + log->Printf("ThreadPlanCallFunction(%p): DoTakedown failed to restore register state", this); + } SetPlanComplete(success); ClearBreakpoints(); if (log && log->GetVerbose()) From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:16:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 40828751; Wed, 19 Mar 2014 13:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 11CCE402; Wed, 19 Mar 2014 13:16: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 s2JDGwIh046028; Wed, 19 Mar 2014 13:16:58 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JDGwBA046027; Wed, 19 Mar 2014 13:16:58 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403191316.s2JDGwBA046027@svn.freebsd.org> From: Ed Maste Date: Wed, 19 Mar 2014 13:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263366 - stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:16:59 -0000 Author: emaste Date: Wed Mar 19 13:16:58 2014 New Revision: 263366 URL: http://svnweb.freebsd.org/changeset/base/263366 Log: MFC r258873: Workaround lldb issue with main module base address On FreeBSD lldb sometimes reloads the the main module's (executable's) symbols at the wrong address. Work around this for now by explicitly reloading at base_address=0 when it happens. A proper fix is needed but early testers have reported this issue so this workaround should allow them to make further progress. http://llvm.org/bugs/show_bug.cgi?id=17880 Sponsored by: DARPA, AFRL Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Wed Mar 19 13:15:16 2014 (r263365) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Wed Mar 19 13:16:58 2014 (r263366) @@ -454,6 +454,17 @@ DynamicLoaderPOSIXDYLD::LoadAllCurrentMo const char *module_path = I->path.c_str(); FileSpec file(module_path, false); ModuleSP module_sp = LoadModuleAtAddress(file, I->link_addr, I->base_addr); +#ifdef __FreeBSD__ // llvm.org/pr17880 + if (module_sp == executable) + { + Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER)); + if (log) + log->Printf("DynamicLoaderPOSIXDYLD::%s reloading main module, ignoring rendezvous base addr %" PRIx64, + __FUNCTION__, I->base_addr); + ModuleSP module_sp = LoadModuleAtAddress(file, I->link_addr, 0); + } +#endif + if (module_sp.get()) { module_list.Append(module_sp); From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:18:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AAA5E8C2; Wed, 19 Mar 2014 13:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 91B275FA; Wed, 19 Mar 2014 13:18: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 s2JDIlL7046281; Wed, 19 Mar 2014 13:18:47 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JDIhd1046254; Wed, 19 Mar 2014 13:18:43 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403191318.s2JDIhd1046254@svn.freebsd.org> From: Ed Maste Date: Wed, 19 Mar 2014 13:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263367 - in stable/10: contrib/llvm/tools/lldb/include/lldb contrib/llvm/tools/lldb/include/lldb/API contrib/llvm/tools/lldb/include/lldb/Breakpoint contrib/llvm/tools/lldb/include/lld... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:18:47 -0000 Author: emaste Date: Wed Mar 19 13:18:42 2014 New Revision: 263367 URL: http://svnweb.freebsd.org/changeset/base/263367 Log: MFC r258884: Update LLDB to upstream r196259 snapshot Sponsored by: DARPA, AFRL Added: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBPlatform.h - copied unchanged from r258884, head/contrib/llvm/tools/lldb/include/lldb/API/SBPlatform.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/Debug.h - copied unchanged from r258884, head/contrib/llvm/tools/lldb/include/lldb/Host/Debug.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/RegisterCheckpoint.h - copied unchanged from r258884, head/contrib/llvm/tools/lldb/include/lldb/Target/RegisterCheckpoint.h stable/10/contrib/llvm/tools/lldb/include/lldb/Utility/Iterable.h - copied unchanged from r258884, head/contrib/llvm/tools/lldb/include/lldb/Utility/Iterable.h stable/10/contrib/llvm/tools/lldb/source/API/SBPlatform.cpp - copied unchanged from r258884, head/contrib/llvm/tools/lldb/source/API/SBPlatform.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryThread.cpp - copied unchanged from r258884, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryThread.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryThread.h - copied unchanged from r258884, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryThread.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp - copied unchanged from r258884, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryUnwind.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryUnwind.h - copied unchanged from r258884, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryUnwind.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextHistory.cpp - copied unchanged from r258884, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextHistory.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h - copied unchanged from r258884, head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBDebugger.h stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBError.h stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBExpressionOptions.h stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBFileSpec.h stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBModule.h stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointList.h stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationList.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Address.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Module.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/CXXFormatterFunctions.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatCache.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatClasses.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatManager.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatNavigator.h stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeCategory.h stable/10/contrib/llvm/tools/lldb/include/lldb/Expression/ClangFunction.h stable/10/contrib/llvm/tools/lldb/include/lldb/Expression/ClangUserExpression.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/File.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/FileSpec.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/Host.h stable/10/contrib/llvm/tools/lldb/include/lldb/Host/OptionParser.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/PythonDataObjects.h stable/10/contrib/llvm/tools/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h stable/10/contrib/llvm/tools/lldb/include/lldb/Symbol/TypeList.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/ABI.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/LanguageRuntime.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/Platform.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/Process.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/RegisterContext.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/SystemRuntime.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/Target.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/Thread.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/ThreadList.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanCallFunction.h stable/10/contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanCallUserExpression.h stable/10/contrib/llvm/tools/lldb/include/lldb/Utility/PythonPointer.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-enumerations.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-forward.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-private-enumerations.h stable/10/contrib/llvm/tools/lldb/include/lldb/lldb-python.h stable/10/contrib/llvm/tools/lldb/source/API/SBDebugger.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBExpressionOptions.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBFileSpec.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBModule.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBProcess.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBStream.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBTarget.cpp stable/10/contrib/llvm/tools/lldb/source/API/SBThread.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectExpression.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectMemory.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlatform.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlugin.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectTarget.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectThread.cpp stable/10/contrib/llvm/tools/lldb/source/Commands/CommandObjectWatchpoint.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Address.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ConnectionFileDescriptor.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Debugger.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Mangled.cpp stable/10/contrib/llvm/tools/lldb/source/Core/Module.cpp stable/10/contrib/llvm/tools/lldb/source/Core/StreamFile.cpp stable/10/contrib/llvm/tools/lldb/source/Core/ValueObjectSyntheticFilter.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/CXXFormatterFunctions.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/FormatClasses.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/FormatManager.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/LibCxx.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/LibStdcpp.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/NSDictionary.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/NSSet.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/TypeCategory.cpp stable/10/contrib/llvm/tools/lldb/source/DataFormatters/TypeCategoryMap.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/ClangFunction.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/ClangUserExpression.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/Materializer.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/File.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/Host.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/OptionParser.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/Args.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/PythonDataObjects.cpp stable/10/contrib/llvm/tools/lldb/source/Interpreter/ScriptInterpreterPython.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h stable/10/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h stable/10/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterInfos_x86_64.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h stable/10/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp stable/10/contrib/llvm/tools/lldb/source/Target/Platform.cpp stable/10/contrib/llvm/tools/lldb/source/Target/Process.cpp stable/10/contrib/llvm/tools/lldb/source/Target/RegisterContext.cpp stable/10/contrib/llvm/tools/lldb/source/Target/StackFrameList.cpp stable/10/contrib/llvm/tools/lldb/source/Target/SystemRuntime.cpp stable/10/contrib/llvm/tools/lldb/source/Target/Target.cpp stable/10/contrib/llvm/tools/lldb/source/Target/Thread.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallFunction.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanCallUserExpression.cpp stable/10/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepInRange.cpp stable/10/contrib/llvm/tools/lldb/source/Utility/StringExtractor.cpp stable/10/contrib/llvm/tools/lldb/source/Utility/StringExtractorGDBRemote.cpp stable/10/contrib/llvm/tools/lldb/source/Utility/StringExtractorGDBRemote.h stable/10/contrib/llvm/tools/lldb/source/lldb.cpp stable/10/contrib/llvm/tools/lldb/tools/lldb-platform/lldb-platform.cpp stable/10/lib/clang/liblldbAPI/Makefile stable/10/lib/clang/liblldbPluginProcessUtility/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBDebugger.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBDebugger.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBDebugger.h Wed Mar 19 13:18:42 2014 (r263367) @@ -10,9 +10,11 @@ #ifndef LLDB_SBDebugger_h_ #define LLDB_SBDebugger_h_ -#include "lldb/API/SBDefines.h" #include +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBPlatform.h" + namespace lldb { class SBDebugger @@ -153,6 +155,12 @@ public: void SetSelectedTarget (SBTarget& target); + lldb::SBPlatform + GetSelectedPlatform(); + + void + SetSelectedPlatform(lldb::SBPlatform &platform); + lldb::SBSourceManager GetSourceManager (); Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBError.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBError.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBError.h Wed Mar 19 13:18:42 2014 (r263367) @@ -72,6 +72,7 @@ protected: friend class SBCommunication; friend class SBHostOS; friend class SBInputReader; + friend class SBPlatform; friend class SBProcess; friend class SBThread; friend class SBTarget; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBExpressionOptions.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBExpressionOptions.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBExpressionOptions.h Wed Mar 19 13:18:42 2014 (r263367) @@ -65,6 +65,12 @@ public: void SetTryAllThreads (bool run_others = true); + bool + GetTrapExceptions () const; + + void + SetTrapExceptions (bool trap_exceptions = true); + protected: SBExpressionOptions (lldb_private::EvaluateExpressionOptions &expression_options); Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBFileSpec.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBFileSpec.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBFileSpec.h Wed Mar 19 13:18:42 2014 (r263367) @@ -45,6 +45,12 @@ public: const char * GetDirectory() const; + void + SetFilename(const char *filename); + + void + SetDirectory(const char *directory); + uint32_t GetPath (char *dst_path, size_t dst_len) const; @@ -65,6 +71,7 @@ private: friend class SBLineEntry; friend class SBModule; friend class SBModuleSpec; + friend class SBPlatform; friend class SBProcess; friend class SBSourceManager; friend class SBThread; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBModule.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBModule.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBModule.h Wed Mar 19 13:18:42 2014 (r263367) @@ -76,6 +76,42 @@ public: bool SetPlatformFileSpec (const lldb::SBFileSpec &platform_file); + //------------------------------------------------------------------ + /// Get accessor for the remote install path for a module. + /// + /// When debugging to a remote platform by connecting to a remote + /// platform, the install path of the module can be set. If the + /// install path is set, every time the process is about to launch + /// the target will install this module on the remote platform prior + /// to launching. + /// + /// @return + /// A file specification object. + //------------------------------------------------------------------ + lldb::SBFileSpec + GetRemoteInstallFileSpec (); + + //------------------------------------------------------------------ + /// Set accessor for the remote install path for a module. + /// + /// When debugging to a remote platform by connecting to a remote + /// platform, the install path of the module can be set. If the + /// install path is set, every time the process is about to launch + /// the target will install this module on the remote platform prior + /// to launching. + /// + /// If \a file specifies a full path to an install location, the + /// module will be installed to this path. If the path is relative + /// (no directory specified, or the path is partial like "usr/lib" + /// or "./usr/lib", then the install path will be resolved using + /// the platform's current working directory as the base path. + /// + /// @param[in] + /// A file specification object. + //------------------------------------------------------------------ + bool + SetRemoteInstallFileSpec (lldb::SBFileSpec &file); + lldb::ByteOrder GetByteOrder (); Copied: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBPlatform.h (from r258884, head/contrib/llvm/tools/lldb/include/lldb/API/SBPlatform.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBPlatform.h Wed Mar 19 13:18:42 2014 (r263367, copy of r258884, head/contrib/llvm/tools/lldb/include/lldb/API/SBPlatform.h) @@ -0,0 +1,198 @@ +//===-- SBPlatform.h --------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_SBPlatform_h_ +#define LLDB_SBPlatform_h_ + +#include "lldb/API/SBDefines.h" + +struct PlatformConnectOptions; +struct PlatformShellCommand; + +namespace lldb { + + class SBPlatformConnectOptions + { + public: + SBPlatformConnectOptions (const char *url); + + SBPlatformConnectOptions (const SBPlatformConnectOptions &rhs); + + ~SBPlatformConnectOptions (); + + void + operator=(const SBPlatformConnectOptions &rhs); + + const char * + GetURL(); + + void + SetURL(const char *url); + + bool + GetRsyncEnabled(); + + void + EnableRsync (const char *options, + const char *remote_path_prefix, + bool omit_remote_hostname); + + void + DisableRsync (); + + const char * + GetLocalCacheDirectory(); + + void + SetLocalCacheDirectory(const char *path); + protected: + PlatformConnectOptions *m_opaque_ptr; + }; + + class SBPlatformShellCommand + { + public: + SBPlatformShellCommand (const char *shell_command); + + SBPlatformShellCommand (const SBPlatformShellCommand &rhs); + + ~SBPlatformShellCommand(); + + void + Clear(); + + const char * + GetCommand(); + + void + SetCommand(const char *shell_command); + + const char * + GetWorkingDirectory (); + + void + SetWorkingDirectory (const char *path); + + uint32_t + GetTimeoutSeconds (); + + void + SetTimeoutSeconds (uint32_t sec); + + int + GetSignal (); + + int + GetStatus (); + + const char * + GetOutput (); + + protected: + friend class SBPlatform; + + PlatformShellCommand *m_opaque_ptr; + }; + + class SBPlatform + { + public: + + SBPlatform (); + + SBPlatform (const char *platform_name); + + ~SBPlatform(); + + bool + IsValid () const; + + void + Clear (); + + const char * + GetWorkingDirectory(); + + bool + SetWorkingDirectory(const char *path); + + const char * + GetName (); + + SBError + ConnectRemote (SBPlatformConnectOptions &connect_options); + + void + DisconnectRemote (); + + bool + IsConnected(); + + //---------------------------------------------------------------------- + // The following functions will work if the platform is connected + //---------------------------------------------------------------------- + const char * + GetTriple(); + + const char * + GetHostname (); + + const char * + GetOSBuild (); + + const char * + GetOSDescription (); + + uint32_t + GetOSMajorVersion (); + + uint32_t + GetOSMinorVersion (); + + uint32_t + GetOSUpdateVersion (); + + SBError + Put (SBFileSpec &src, SBFileSpec &dst); + + SBError + Get (SBFileSpec &src, SBFileSpec &dst); + + SBError + Install (SBFileSpec& src, SBFileSpec& dst); + + SBError + Run (SBPlatformShellCommand &shell_command); + + SBError + MakeDirectory (const char *path, uint32_t file_permissions = eFilePermissionsDirectoryDefault); + + uint32_t + GetFilePermissions (const char *path); + + SBError + SetFilePermissions (const char *path, uint32_t file_permissions); + + protected: + + friend class SBDebugger; + friend class SBTarget; + + lldb::PlatformSP + GetSP () const; + + void + SetSP (const lldb::PlatformSP& platform_sp); + + lldb::PlatformSP m_opaque_sp; + }; + +} // namespace lldb + +#endif // LLDB_SBPlatform_h_ Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h Wed Mar 19 13:18:42 2014 (r263367) @@ -268,6 +268,23 @@ public: GetProcess (); //------------------------------------------------------------------ + /// Install any binaries that need to be installed. + /// + /// This function does nothing when debugging on the host system. + /// When connected to remote platforms, the target's main executable + /// and any modules that have their remote install path set will be + /// installed on the remote platform. If the main executable doesn't + /// have an install location set, it will be installed in the remote + /// platform's working directory. + /// + /// @return + /// An error describing anything that went wrong during + /// installation. + //------------------------------------------------------------------ + SBError + Install(); + + //------------------------------------------------------------------ /// Launch a new process. /// /// Launch a new process by spawning a new process using the Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h Wed Mar 19 13:18:42 2014 (r263367) @@ -202,7 +202,10 @@ public: GetStatus (lldb::SBStream &status) const; SBThread - GetExtendedBacktrace (const char *type); + GetExtendedBacktraceThread (const char *type); + + uint32_t + GetExtendedBacktraceOriginatingIndexID (); protected: friend class SBBreakpoint; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h Wed Mar 19 13:18:42 2014 (r263367) @@ -311,6 +311,24 @@ public: //------------------------------------------------------------------ lldb::BreakpointLocationSP GetLocationAtIndex (size_t index); + + //------------------------------------------------------------------ + /// Removes all invalid breakpoint locations. + /// + /// Removes all breakpoint locations with architectures that aren't + /// compatible with \a arch. Also remove any breakpoint locations + /// with whose locations have address where the section has been + /// deleted (module and object files no longer exist). + /// + /// This is typically used after the process calls exec, or anytime + /// the architecture of the target changes. + /// + /// @param[in] arch + /// If valid, check the module in each breakpoint to make sure + /// they are compatible, otherwise, ignore architecture. + //------------------------------------------------------------------ + void + RemoveInvalidLocations (const ArchSpec &arch); //------------------------------------------------------------------ // The next section deals with various breakpoint options. Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointList.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointList.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointList.h Wed Mar 19 13:18:42 2014 (r263367) @@ -132,6 +132,25 @@ public: bool Remove (lldb::break_id_t breakID, bool notify); + + //------------------------------------------------------------------ + /// Removes all invalid breakpoint locations. + /// + /// Removes all breakpoint locations in the list with architectures + /// that aren't compatible with \a arch. Also remove any breakpoint + /// locations with whose locations have address where the section + /// has been deleted (module and object files no longer exist). + /// + /// This is typically used after the process calls exec, or anytime + /// the architecture of the target changes. + /// + /// @param[in] arch + /// If valid, check the module in each breakpoint to make sure + /// they are compatible, otherwise, ignore architecture. + //------------------------------------------------------------------ + void + RemoveInvalidLocations (const ArchSpec &arch); + void SetEnabledAll (bool enabled); Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationList.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationList.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationList.h Wed Mar 19 13:18:42 2014 (r263367) @@ -250,6 +250,9 @@ protected: bool RemoveLocation (const lldb::BreakpointLocationSP &bp_loc_sp); + + void + RemoveInvalidLocations (const ArchSpec &arch); typedef std::vector collection; typedef std::map addr_map; Breakpoint &m_owner; - collection m_locations; + collection m_locations; // Vector of locations, sorted by ID addr_map m_address_to_location; mutable Mutex m_mutex; lldb::break_id_t m_next_id; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Address.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Address.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Address.h Wed Mar 19 13:18:42 2014 (r263367) @@ -534,6 +534,16 @@ public: bool CalculateSymbolContextLineEntry (LineEntry &line_entry) const; + //------------------------------------------------------------------ + // Returns true if the section should be valid, but isn't because + // the shared pointer to the section can't be reconstructed from + // a weak pointer that contains a valid weak reference to a section. + // Returns false if the section weak pointer has no reference to + // a section, or if the section is still valid + //------------------------------------------------------------------ + bool + SectionWasDeleted() const; + protected: //------------------------------------------------------------------ // Member variables. @@ -550,7 +560,7 @@ protected: // have a valid section. //------------------------------------------------------------------ bool - SectionWasDeleted() const; + SectionWasDeletedPrivate() const; }; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h Wed Mar 19 13:18:42 2014 (r263367) @@ -17,9 +17,6 @@ #include #include "lldb/lldb-public.h" - -#include "lldb/API/SBDefines.h" - #include "lldb/Core/Broadcaster.h" #include "lldb/Core/Communication.h" #include "lldb/Core/InputReaderStack.h" @@ -55,6 +52,10 @@ friend class SourceManager; // For GetS public: + typedef lldb::DynamicLibrarySP (*LoadPluginCallbackType) (const lldb::DebuggerSP &debugger_sp, + const FileSpec& spec, + Error& error); + static lldb::DebuggerSP CreateInstance (lldb::LogOutputCallback log_callback = NULL, void *baton = NULL); @@ -65,7 +66,7 @@ public: FindTargetWithProcess (Process *process); static void - Initialize (); + Initialize (LoadPluginCallbackType load_plugin_callback); static void Terminate (); @@ -333,9 +334,7 @@ public: { return m_instance_name; } - - typedef bool (*LLDBCommandPluginInit) (lldb::SBDebugger& debugger); - + bool LoadPlugin (const FileSpec& spec, Error& error); @@ -377,6 +376,7 @@ protected: LogStreamMap m_log_streams; lldb::StreamSP m_log_callback_stream_sp; ConstString m_instance_name; + static LoadPluginCallbackType g_load_plugin_callback; typedef std::vector LoadedPluginsList; LoadedPluginsList m_loaded_plugins; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Module.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Module.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/Core/Module.h Wed Mar 19 13:18:42 2014 (r263367) @@ -570,6 +570,18 @@ public: } const FileSpec & + GetRemoteInstallFileSpec () const + { + return m_remote_install_file; + } + + void + SetRemoteInstallFileSpec (const FileSpec &file) + { + m_remote_install_file = file; + } + + const FileSpec & GetSymbolFileFileSpec () const { return m_symfile_spec; @@ -1059,6 +1071,7 @@ protected: lldb_private::UUID m_uuid; ///< Each module is assumed to have a unique identifier to help match it up to debug symbols. FileSpec m_file; ///< The file representation on disk for this module (if there is one). FileSpec m_platform_file;///< The path to the module on the platform on which it is being debugged + FileSpec m_remote_install_file; ///< If set when debugging on remote platforms, this module will be installed at this location FileSpec m_symfile_spec; ///< If this path is valid, then this is the file that _will_ be used as the symbol file for this module ConstString m_object_name; ///< The name an object within this module that is selected, or empty of the module is represented by \a m_file. uint64_t m_object_offset; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/CXXFormatterFunctions.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/CXXFormatterFunctions.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/CXXFormatterFunctions.h Wed Mar 19 13:18:42 2014 (r263367) @@ -17,6 +17,8 @@ #include "lldb/Core/ConstString.h" #include "lldb/DataFormatters/FormatClasses.h" +#include "lldb/DataFormatters/TypeSynthetic.h" +#include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Target.h" #include "clang/AST/ASTContext.h" Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatCache.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatCache.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatCache.h Wed Mar 19 13:18:42 2014 (r263367) @@ -18,6 +18,7 @@ // Project includes #include "lldb/lldb-public.h" #include "lldb/Core/ConstString.h" +#include "lldb/Host/Mutex.h" #include "lldb/DataFormatters/FormatClasses.h" namespace lldb_private { Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatClasses.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatClasses.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatClasses.h Wed Mar 19 13:18:42 2014 (r263367) @@ -10,9 +10,6 @@ #ifndef lldb_FormatClasses_h_ #define lldb_FormatClasses_h_ -// C Includes -#include - // C++ Includes #include #include @@ -23,17 +20,86 @@ #include "lldb/lldb-public.h" #include "lldb/lldb-enumerations.h" -#include "lldb/Core/ValueObject.h" -#include "lldb/Interpreter/ScriptInterpreterPython.h" #include "lldb/Symbol/ClangASTType.h" #include "lldb/Symbol/Type.h" -#include "lldb/DataFormatters/TypeFormat.h" -#include "lldb/DataFormatters/TypeSummary.h" -#include "lldb/DataFormatters/TypeSynthetic.h" - namespace lldb_private { +class FormattersMatchCandidate +{ +public: + + FormattersMatchCandidate (ConstString name, + uint32_t reason, + bool strip_ptr, + bool strip_ref, + bool strip_tydef) : + m_type_name(name), + m_reason(reason), + m_stripped_pointer(strip_ptr), + m_stripped_reference(strip_ref), + m_stripped_typedef(strip_tydef) + { + } + + ~FormattersMatchCandidate () + {} + + ConstString + GetTypeName () const + { + return m_type_name; + } + + uint32_t + GetReason () const + { + return m_reason; + } + + bool + DidStripPointer () const + { + return m_stripped_pointer; + } + + bool + DidStripReference () const + { + return m_stripped_reference; + } + + bool + DidStripTypedef () const + { + return m_stripped_typedef; + } + + template + bool + IsMatch (const std::shared_ptr& formatter_sp) const + { + if (!formatter_sp) + return false; + if (formatter_sp->Cascades() == false && DidStripTypedef()) + return false; + if (formatter_sp->SkipsPointers() && DidStripPointer()) + return false; + if (formatter_sp->SkipsReferences() && DidStripReference()) + return false; + return true; + } + +private: + ConstString m_type_name; + uint32_t m_reason; + bool m_stripped_pointer; + bool m_stripped_reference; + bool m_stripped_typedef; +}; + +typedef std::vector FormattersMatchVector; + class TypeNameSpecifierImpl { public: Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatManager.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatManager.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatManager.h Wed Mar 19 13:18:42 2014 (r263367) @@ -19,6 +19,7 @@ #include "lldb/lldb-enumerations.h" #include "lldb/DataFormatters/FormatCache.h" +#include "lldb/DataFormatters/FormatClasses.h" #include "lldb/DataFormatters/FormatNavigator.h" #include "lldb/DataFormatters/TypeCategory.h" #include "lldb/DataFormatters/TypeCategoryMap.h" @@ -213,7 +214,36 @@ public: { } + static FormattersMatchVector + GetPossibleMatches (ValueObject& valobj, + lldb::DynamicValueType use_dynamic) + { + FormattersMatchVector matches; + GetPossibleMatches (valobj, + valobj.GetClangType(), + lldb_private::eFormatterChoiceCriterionDirectChoice, + use_dynamic, + matches, + false, + false, + false, + true); + return matches; + } + private: + + static void + GetPossibleMatches (ValueObject& valobj, + ClangASTType clang_type, + uint32_t reason, + lldb::DynamicValueType use_dynamic, + FormattersMatchVector& entries, + bool did_strip_ptr, + bool did_strip_ref, + bool did_strip_typedef, + bool root_level = false); + FormatCache m_format_cache; NamedSummariesMap m_named_summaries_map; std::atomic m_last_revision; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatNavigator.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatNavigator.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatNavigator.h Wed Mar 19 13:18:42 2014 (r263367) @@ -26,6 +26,9 @@ #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/FormatClasses.h" +#include "lldb/DataFormatters/TypeFormat.h" +#include "lldb/DataFormatters/TypeSummary.h" +#include "lldb/DataFormatters/TypeSynthetic.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ClangASTType.h" @@ -459,228 +462,29 @@ protected: } return false; } - - bool - Get_BitfieldMatch (ValueObject& valobj, - ConstString typeName, - MapValueType& entry, - uint32_t& reason) - { - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); - // for bitfields, append size to the typename so one can custom format them - StreamString sstring; - sstring.Printf("%s:%d",typeName.AsCString(),valobj.GetBitfieldBitSize()); - ConstString bitfieldname = ConstString(sstring.GetData()); - if (log) - log->Printf("[Get_BitfieldMatch] appended bitfield info, final result is %s", bitfieldname.GetCString()); - if (Get(bitfieldname, entry)) - { - if (log) - log->Printf("[Get_BitfieldMatch] bitfield direct match found, returning"); - return true; - } - else - { - reason |= lldb_private::eFormatterChoiceCriterionStrippedBitField; - if (log) - log->Printf("[Get_BitfieldMatch] no bitfield direct match"); - return false; - } - } - - bool Get_ObjC (ValueObject& valobj, - MapValueType& entry) - { - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); - lldb::ProcessSP process_sp = valobj.GetProcessSP(); - ObjCLanguageRuntime* runtime = process_sp->GetObjCLanguageRuntime(); - if (runtime == NULL) - { - if (log) - log->Printf("[Get_ObjC] no valid ObjC runtime, skipping dynamic"); - return false; - } - ObjCLanguageRuntime::ClassDescriptorSP objc_class_sp (runtime->GetClassDescriptor(valobj)); - if (!objc_class_sp) - { - if (log) - log->Printf("[Get_ObjC] invalid ISA, skipping dynamic"); - return false; - } - ConstString name (objc_class_sp->GetClassName()); - if (log) - log->Printf("[Get_ObjC] dynamic type inferred is %s - looking for direct dynamic match", name.GetCString()); - if (Get(name, entry)) - { - if (log) - log->Printf("[Get_ObjC] direct dynamic match found, returning"); - return true; - } - if (log) - log->Printf("[Get_ObjC] no dynamic match"); - return false; - } - + bool - Get_Impl (ValueObject& valobj, - ClangASTType clang_type, - MapValueType& entry, - lldb::DynamicValueType use_dynamic, - uint32_t& reason) + Get (const FormattersMatchVector& candidates, + MapValueType& entry, + uint32_t *reason) { - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); - - if (!clang_type.IsValid()) - { - if (log) - log->Printf("[Get_Impl] type is invalid, returning"); - return false; - } - - clang_type = clang_type.RemoveFastQualifiers(); - - ConstString typeName(clang_type.GetConstTypeName()); - - if (valobj.GetBitfieldBitSize() > 0) + for (const FormattersMatchCandidate& candidate : candidates) { - if (Get_BitfieldMatch(valobj, typeName, entry, reason)) - return true; - } - - if (log) - log->Printf("[Get_Impl] trying to get %s for VO name %s of type %s", - m_name.c_str(), - valobj.GetName().AsCString(), - typeName.AsCString()); - - if (Get(typeName, entry)) - { - if (log) - log->Printf("[Get] direct match found, returning"); - return true; - } - if (log) - log->Printf("[Get_Impl] no direct match"); - - // strip pointers and references and see if that helps - if (clang_type.IsReferenceType()) - { - if (log) - log->Printf("[Get_Impl] stripping reference"); - if (Get_Impl(valobj, clang_type.GetNonReferenceType(), entry, use_dynamic, reason) && !entry->SkipsReferences()) + if (Get(candidate.GetTypeName(),entry)) { - reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference; - return true; - } - } - else if (clang_type.IsPointerType()) - { - if (log) - log->Printf("[Get_Impl] stripping pointer"); - if (Get_Impl(valobj, clang_type.GetPointeeType(), entry, use_dynamic, reason) && !entry->SkipsPointers()) - { - reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference; - return true; - } - } - - bool canBeObjCDynamic = valobj.GetClangType().IsPossibleDynamicType (NULL, - false, // no C++ - true); // yes ObjC - - if (canBeObjCDynamic) - { - if (use_dynamic != lldb::eNoDynamicValues) - { - if (log) - log->Printf("[Get_Impl] allowed to figure out dynamic ObjC type"); - if (Get_ObjC(valobj,entry)) + if (candidate.IsMatch(entry) == false) { - reason |= lldb_private::eFormatterChoiceCriterionDynamicObjCDiscovery; - return true; + entry.reset(); + continue; } - } - if (log) - log->Printf("[Get_Impl] dynamic disabled or failed - stripping ObjC pointer"); - if (Get_Impl(valobj, clang_type.GetPointeeType(), entry, use_dynamic, reason) && !entry->SkipsPointers()) - { - reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference; - return true; - } - } - - // try to strip typedef chains - if (clang_type.IsTypedefType()) - { - if (log) - log->Printf("[Get_Impl] stripping typedef"); - if ((Get_Impl(valobj, clang_type.GetTypedefedType(), entry, use_dynamic, reason)) && entry->Cascades()) - { - reason |= lldb_private::eFormatterChoiceCriterionNavigatedTypedefs; - return true; - } - } - - // out of luck here - return false; - } - - // we are separately passing in valobj and type because the valobj is fixed (and is used for ObjC discovery and bitfield size) - // but the type can change (e.g. stripping pointers, ...) - bool Get (ValueObject& valobj, - ClangASTType clang_type, - MapValueType& entry, - lldb::DynamicValueType use_dynamic, - uint32_t& reason) - { - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); - - if (Get_Impl (valobj, clang_type, entry, use_dynamic, reason)) - return true; - - // try going to the unqualified type - do { - if (log) - log->Printf("[Get] trying the unqualified type"); - if (!clang_type.IsValid()) - break; - - ClangASTType unqual_clang_ast_type = clang_type.GetFullyUnqualifiedType(); - if (!unqual_clang_ast_type.IsValid()) - { - if (log) - log->Printf("[Get] could not get the unqual_clang_ast_type"); - break; - } - if (unqual_clang_ast_type.GetOpaqueQualType() != clang_type.GetOpaqueQualType()) - { - if (log) - log->Printf("[Get] unqualified type is there and is not the same, let's try"); - if (Get_Impl (valobj, unqual_clang_ast_type,entry, use_dynamic, reason)) - return true; - } - else if (log) - log->Printf("[Get] unqualified type same as original type"); - } while(false); - - // if all else fails, go to static type - if (valobj.IsDynamic()) - { - if (log) - log->Printf("[Get] going to static value"); - lldb::ValueObjectSP static_value_sp(valobj.GetStaticValue()); - if (static_value_sp) - { - if (log) - log->Printf("[Get] has a static value - actually use it"); - if (Get(*static_value_sp.get(), static_value_sp->GetClangType(), entry, use_dynamic, reason)) + else { - reason |= lldb_private::eFormatterChoiceCriterionWentToStaticValue; + if(reason) + *reason = candidate.GetReason(); return true; } } } - return false; } }; Modified: stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeCategory.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeCategory.h Wed Mar 19 13:16:58 2014 (r263366) +++ stable/10/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeCategory.h Wed Mar 19 13:18:42 2014 (r263367) @@ -18,6 +18,7 @@ #include "lldb/lldb-public.h" #include "lldb/lldb-enumerations.h" +#include "lldb/DataFormatters/FormatClasses.h" #include "lldb/DataFormatters/FormatNavigator.h" namespace lldb_private { @@ -177,23 +178,22 @@ namespace lldb_private { return m_enabled_position; } - bool Get (ValueObject& valobj, + const FormattersMatchVector& candidates, lldb::TypeFormatImplSP& entry, - lldb::DynamicValueType use_dynamic, uint32_t* reason = NULL); bool Get (ValueObject& valobj, + const FormattersMatchVector& candidates, lldb::TypeSummaryImplSP& entry, - lldb::DynamicValueType use_dynamic, uint32_t* reason = NULL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:19:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C4FC0A70; Wed, 19 Mar 2014 13:19:58 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE38B60E; Wed, 19 Mar 2014 13:19:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JDJwrs046488; Wed, 19 Mar 2014 13:19:58 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JDJuua046475; Wed, 19 Mar 2014 13:19:56 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403191319.s2JDJuua046475@svn.freebsd.org> From: Ed Maste Date: Wed, 19 Mar 2014 13:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263368 - in stable/10: contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD contrib/llvm/tools/lldb/source/Plugins/Process/POSIX lib/clang/liblldbPluginProcessFreeBSD X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:19:58 -0000 Author: emaste Date: Wed Mar 19 13:19:56 2014 New Revision: 263368 URL: http://svnweb.freebsd.org/changeset/base/263368 Log: MFC r258892: lldb: Threaded inferior support for FreeBSD This is in the process of being submitted to the upstream LLDB repository. The thread list functionality is modelled in part on GDBRemoteCommunicationClient. LLDB bug pr16696 and code review D2267 Sponsored by: DARPA, AFRL Added: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp - copied unchanged from r258892, head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h - copied unchanged from r258892, head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.h stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h stable/10/lib/clang/liblldbPluginProcessFreeBSD/Makefile Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp (from r258892, head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp Wed Mar 19 13:19:56 2014 (r263368, copy of r258892, head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp) @@ -0,0 +1,69 @@ +//===-- FreeBSDThread.cpp ---------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// C Includes +// C++ Includes +// Other libraries and framework includes +#include "lldb/Core/State.h" + +// Project includes +#include "FreeBSDThread.h" +#include "ProcessFreeBSD.h" +#include "ProcessPOSIXLog.h" + +using namespace lldb; +using namespace lldb_private; + +//------------------------------------------------------------------------------ +// Constructors and destructors. + +FreeBSDThread::FreeBSDThread(Process &process, lldb::tid_t tid) + : POSIXThread(process, tid) +{ +} + +FreeBSDThread::~FreeBSDThread() +{ +} + +//------------------------------------------------------------------------------ +// ProcessInterface protocol. + +void +FreeBSDThread::WillResume(lldb::StateType resume_state) +{ + Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD)); + if (log) + log->Printf("tid %lu resume_state = %s", GetID(), + lldb_private::StateAsCString(resume_state)); + ProcessSP process_sp(GetProcess()); + ProcessFreeBSD *process = static_cast(process_sp.get()); + int signo = GetResumeSignal(); + bool signo_valid = process->GetUnixSignals().SignalIsValid(signo); + + switch (resume_state) + { + case eStateSuspended: + case eStateStopped: + process->m_suspend_tids.push_back(GetID()); + break; + case eStateRunning: + process->m_run_tids.push_back(GetID()); + if (signo_valid) + process->m_resume_signo = signo; + break; + case eStateStepping: + process->m_step_tids.push_back(GetID()); + if (signo_valid) + process->m_resume_signo = signo; + break; + default: + break; + } +} Copied: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h (from r258892, head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h Wed Mar 19 13:19:56 2014 (r263368, copy of r258892, head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h) @@ -0,0 +1,39 @@ +//===-- FreeBSDThread.h -----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_FreeBSDThread_H_ +#define liblldb_FreeBSDThread_H_ + +// Other libraries and framework includes +#include "POSIXThread.h" + +//------------------------------------------------------------------------------ +// @class FreeBSDThread +// @brief Abstraction of a FreeBSD thread. +class FreeBSDThread + : public POSIXThread +{ +public: + + //------------------------------------------------------------------ + // Constructors and destructors + //------------------------------------------------------------------ + FreeBSDThread(lldb_private::Process &process, lldb::tid_t tid); + + virtual ~FreeBSDThread(); + + //-------------------------------------------------------------------------- + // FreeBSDThread internal API. + + // POSIXThread override + virtual void + WillResume(lldb::StateType resume_state); +}; + +#endif // #ifndef liblldb_FreeBSDThread_H_ Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp Wed Mar 19 13:18:42 2014 (r263367) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp Wed Mar 19 13:19:56 2014 (r263368) @@ -23,7 +23,7 @@ #include "ProcessPOSIXLog.h" #include "Plugins/Process/Utility/InferiorCallPOSIX.h" #include "ProcessMonitor.h" -#include "POSIXThread.h" +#include "FreeBSDThread.h" using namespace lldb; using namespace lldb_private; @@ -140,29 +140,136 @@ ProcessFreeBSD::DoDetach(bool keep_stopp return error; } +Error +ProcessFreeBSD::DoResume() +{ + Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS)); + + // FreeBSD's ptrace() uses 0 to indicate "no signal is to be sent." + int resume_signal = 0; + + SetPrivateState(eStateRunning); + + Mutex::Locker lock(m_thread_list.GetMutex()); + bool do_step = false; + + for (tid_collection::const_iterator t_pos = m_run_tids.begin(), t_end = m_run_tids.end(); t_pos != t_end; ++t_pos) + { + m_monitor->ThreadSuspend(*t_pos, false); + } + for (tid_collection::const_iterator t_pos = m_step_tids.begin(), t_end = m_step_tids.end(); t_pos != t_end; ++t_pos) + { + m_monitor->ThreadSuspend(*t_pos, false); + do_step = true; + } + for (tid_collection::const_iterator t_pos = m_suspend_tids.begin(), t_end = m_suspend_tids.end(); t_pos != t_end; ++t_pos) + { + m_monitor->ThreadSuspend(*t_pos, true); + // XXX Cannot PT_CONTINUE properly with suspended threads. + do_step = true; + } + + if (log) + log->Printf("process %lu resuming (%s)", GetID(), do_step ? "step" : "continue"); + if (do_step) + m_monitor->SingleStep(GetID(), resume_signal); + else + m_monitor->Resume(GetID(), resume_signal); + + return Error(); +} + bool ProcessFreeBSD::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list) { - Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD)); - if (log && log->GetMask().Test(POSIX_LOG_VERBOSE)) - log->Printf ("ProcessFreeBSD::%s() (pid = %" PRIu64 ")", __FUNCTION__, GetID()); - - bool has_updated = false; - const lldb::pid_t pid = GetID(); - // Update the process thread list with this new thread. - // FIXME: We should be using tid, not pid. - assert(m_monitor); - ThreadSP thread_sp (old_thread_list.FindThreadByID (pid, false)); - if (!thread_sp) { - ProcessSP me = this->shared_from_this(); - thread_sp.reset(new POSIXThread(*me, pid)); - has_updated = true; + Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS)); + if (log) + log->Printf("ProcessFreeBSD::%s (pid = %" PRIu64 ")", __FUNCTION__, GetID()); + + std::vector tds; + if (!GetMonitor().GetCurrentThreadIDs(tds)) + { + return false; } - if (log && log->GetMask().Test(POSIX_LOG_VERBOSE)) - log->Printf ("ProcessFreeBSD::%s() updated tid = %" PRIu64, __FUNCTION__, pid); + ThreadList old_thread_list_copy(old_thread_list); + for (size_t i = 0; i < tds.size(); ++i) + { + tid_t tid = tds[i]; + ThreadSP thread_sp (old_thread_list_copy.RemoveThreadByID(tid, false)); + if (!thread_sp) + { + thread_sp.reset(new FreeBSDThread(*this, tid)); + if (log) + log->Printf("ProcessFreeBSD::%s new tid = %" PRIu64, __FUNCTION__, tid); + } + else + { + if (log) + log->Printf("ProcessFreeBSD::%s existing tid = %" PRIu64, __FUNCTION__, tid); + } + new_thread_list.AddThread(thread_sp); + } + for (size_t i = 0; i < old_thread_list_copy.GetSize(false); ++i) + { + ThreadSP old_thread_sp(old_thread_list_copy.GetThreadAtIndex(i, false)); + if (old_thread_sp) + { + if (log) + log->Printf("ProcessFreeBSD::%s remove tid", __FUNCTION__); + } + } - new_thread_list.AddThread(thread_sp); + return true; +} - return has_updated; // the list has been updated +Error +ProcessFreeBSD::WillResume() +{ + m_suspend_tids.clear(); + m_run_tids.clear(); + m_step_tids.clear(); + return ProcessPOSIX::WillResume(); } + +void +ProcessFreeBSD::SendMessage(const ProcessMessage &message) +{ + Mutex::Locker lock(m_message_mutex); + + switch (message.GetKind()) + { + case ProcessMessage::eInvalidMessage: + return; + + case ProcessMessage::eAttachMessage: + SetPrivateState(eStateStopped); + return; + + case ProcessMessage::eLimboMessage: + case ProcessMessage::eExitMessage: + m_exit_status = message.GetExitStatus(); + SetExitStatus(m_exit_status, NULL); + break; + + case ProcessMessage::eSignalMessage: + case ProcessMessage::eSignalDeliveredMessage: + case ProcessMessage::eBreakpointMessage: + case ProcessMessage::eTraceMessage: + case ProcessMessage::eWatchpointMessage: + case ProcessMessage::eCrashMessage: + SetPrivateState(eStateStopped); + break; + + case ProcessMessage::eNewThreadMessage: + assert(0 && "eNewThreadMessage unexpected on FreeBSD"); + break; + + case ProcessMessage::eExecMessage: + SetPrivateState(eStateStopped); + break; + } + + m_message_queue.push(message); +} + Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h Wed Mar 19 13:18:42 2014 (r263367) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h Wed Mar 19 13:19:56 2014 (r263368) @@ -60,6 +60,15 @@ public: virtual bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list); + virtual lldb_private::Error + DoResume(); + + virtual lldb_private::Error + WillResume(); + + virtual void + SendMessage(const ProcessMessage &message); + //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ @@ -80,6 +89,16 @@ public: EnablePluginLogging(lldb_private::Stream *strm, lldb_private::Args &command); +protected: + friend class FreeBSDThread; + + typedef std::vector tid_collection; + tid_collection m_suspend_tids; + tid_collection m_run_tids; + tid_collection m_step_tids; + + int m_resume_signo; + }; #endif // liblldb_MacOSXProcess_H_ Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Wed Mar 19 13:18:42 2014 (r263367) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Wed Mar 19 13:19:56 2014 (r263368) @@ -560,6 +560,31 @@ LwpInfoOperation::Execute(ProcessMonitor } //------------------------------------------------------------------------------ +/// @class ThreadSuspendOperation +/// @brief Implements ProcessMonitor::ThreadSuspend. +class ThreadSuspendOperation : public Operation +{ +public: + ThreadSuspendOperation(lldb::tid_t tid, bool suspend, bool &result) + : m_tid(tid), m_suspend(suspend), m_result(result) { } + + void Execute(ProcessMonitor *monitor); + +private: + lldb::tid_t m_tid; + bool m_suspend; + bool &m_result; +} ; + +void +ThreadSuspendOperation::Execute(ProcessMonitor *monitor) +{ + m_result = !PTRACE(m_suspend ? PT_SUSPEND : PT_RESUME, m_tid, NULL, 0); +} + + + +//------------------------------------------------------------------------------ /// @class EventMessageOperation /// @brief Implements ProcessMonitor::GetEventMessage. class EventMessageOperation : public Operation @@ -1041,6 +1066,29 @@ FINISH: return args->m_error.Success(); } +size_t +ProcessMonitor::GetCurrentThreadIDs(std::vector&thread_ids) +{ + lwpid_t *tids; + int tdcnt; + + thread_ids.clear(); + + tdcnt = PTRACE(PT_GETNUMLWPS, m_pid, NULL, 0); + if (tdcnt <= 0) + return 0; + tids = (lwpid_t *)malloc(tdcnt * sizeof(*tids)); + if (tids == NULL) + return 0; + if (PTRACE(PT_GETLWPLIST, m_pid, (void *)tids, tdcnt) < 0) { + free(tids); + return 0; + } + thread_ids = std::vector(tids, tids + tdcnt); + free(tids); + return thread_ids.size(); +} + bool ProcessMonitor::MonitorCallback(void *callback_baton, lldb::pid_t pid, @@ -1073,11 +1121,11 @@ ProcessMonitor::MonitorCallback(void *ca switch (plwp.pl_siginfo.si_signo) { case SIGTRAP: - message = MonitorSIGTRAP(monitor, &plwp.pl_siginfo, pid); + message = MonitorSIGTRAP(monitor, &plwp.pl_siginfo, plwp.pl_lwpid); break; default: - message = MonitorSignal(monitor, &plwp.pl_siginfo, pid); + message = MonitorSignal(monitor, &plwp.pl_siginfo, plwp.pl_lwpid); break; } @@ -1090,7 +1138,7 @@ ProcessMonitor::MonitorCallback(void *ca ProcessMessage ProcessMonitor::MonitorSIGTRAP(ProcessMonitor *monitor, - const siginfo_t *info, lldb::pid_t pid) + const siginfo_t *info, lldb::tid_t tid) { ProcessMessage message; @@ -1111,26 +1159,26 @@ ProcessMonitor::MonitorSIGTRAP(ProcessMo // state of "limbo" until we are explicitly commanded to detach, // destroy, resume, etc. unsigned long data = 0; - if (!monitor->GetEventMessage(pid, &data)) + if (!monitor->GetEventMessage(tid, &data)) data = -1; if (log) - log->Printf ("ProcessMonitor::%s() received exit? event, data = %lx, pid = %" PRIu64, __FUNCTION__, data, pid); - message = ProcessMessage::Limbo(pid, (data >> 8)); + log->Printf ("ProcessMonitor::%s() received exit? event, data = %lx, tid = %" PRIu64, __FUNCTION__, data, tid); + message = ProcessMessage::Limbo(tid, (data >> 8)); break; } case 0: case TRAP_TRACE: if (log) - log->Printf ("ProcessMonitor::%s() received trace event, pid = %" PRIu64, __FUNCTION__, pid); - message = ProcessMessage::Trace(pid); + log->Printf ("ProcessMonitor::%s() received trace event, tid = %" PRIu64, __FUNCTION__, tid); + message = ProcessMessage::Trace(tid); break; case SI_KERNEL: case TRAP_BRKPT: if (log) - log->Printf ("ProcessMonitor::%s() received breakpoint event, pid = %" PRIu64, __FUNCTION__, pid); - message = ProcessMessage::Break(pid); + log->Printf ("ProcessMonitor::%s() received breakpoint event, tid = %" PRIu64, __FUNCTION__, tid); + message = ProcessMessage::Break(tid); break; } @@ -1139,7 +1187,7 @@ ProcessMonitor::MonitorSIGTRAP(ProcessMo ProcessMessage ProcessMonitor::MonitorSignal(ProcessMonitor *monitor, - const siginfo_t *info, lldb::pid_t pid) + const siginfo_t *info, lldb::tid_t tid) { ProcessMessage message; int signo = info->si_signo; @@ -1163,9 +1211,9 @@ ProcessMonitor::MonitorSignal(ProcessMon "SI_USER", info->si_pid); if (info->si_pid == getpid()) - return ProcessMessage::SignalDelivered(pid, signo); + return ProcessMessage::SignalDelivered(tid, signo); else - return ProcessMessage::Signal(pid, signo); + return ProcessMessage::Signal(tid, signo); } if (log) @@ -1174,30 +1222,30 @@ ProcessMonitor::MonitorSignal(ProcessMon if (signo == SIGSEGV) { lldb::addr_t fault_addr = reinterpret_cast(info->si_addr); ProcessMessage::CrashReason reason = GetCrashReasonForSIGSEGV(info); - return ProcessMessage::Crash(pid, reason, signo, fault_addr); + return ProcessMessage::Crash(tid, reason, signo, fault_addr); } if (signo == SIGILL) { lldb::addr_t fault_addr = reinterpret_cast(info->si_addr); ProcessMessage::CrashReason reason = GetCrashReasonForSIGILL(info); - return ProcessMessage::Crash(pid, reason, signo, fault_addr); + return ProcessMessage::Crash(tid, reason, signo, fault_addr); } if (signo == SIGFPE) { lldb::addr_t fault_addr = reinterpret_cast(info->si_addr); ProcessMessage::CrashReason reason = GetCrashReasonForSIGFPE(info); - return ProcessMessage::Crash(pid, reason, signo, fault_addr); + return ProcessMessage::Crash(tid, reason, signo, fault_addr); } if (signo == SIGBUS) { lldb::addr_t fault_addr = reinterpret_cast(info->si_addr); ProcessMessage::CrashReason reason = GetCrashReasonForSIGBUS(info); - return ProcessMessage::Crash(pid, reason, signo, fault_addr); + return ProcessMessage::Crash(tid, reason, signo, fault_addr); } // Everything else is "normal" and does not require any special action on // our part. - return ProcessMessage::Signal(pid, signo); + return ProcessMessage::Signal(tid, signo); } ProcessMessage::CrashReason @@ -1508,6 +1556,15 @@ ProcessMonitor::GetLwpInfo(lldb::tid_t t } bool +ProcessMonitor::ThreadSuspend(lldb::tid_t tid, bool suspend) +{ + bool result; + ThreadSuspendOperation op(tid, suspend, result); + DoOperation(&op); + return result; +} + +bool ProcessMonitor::GetEventMessage(lldb::tid_t tid, unsigned long *message) { bool result; Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h Wed Mar 19 13:18:42 2014 (r263367) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h Wed Mar 19 13:19:56 2014 (r263368) @@ -164,11 +164,19 @@ public: bool ReadThreadPointer(lldb::tid_t tid, lldb::addr_t &value); + /// Returns current thread IDs in process + size_t + GetCurrentThreadIDs(std::vector &thread_ids); + /// Writes a ptrace_lwpinfo structure corresponding to the given thread ID /// to the memory region pointed to by @p lwpinfo. bool GetLwpInfo(lldb::tid_t tid, void *lwpinfo, int &error_no); + /// Suspends or unsuspends a thread prior to process resume or step. + bool + ThreadSuspend(lldb::tid_t tid, bool suspend); + /// Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG) /// corresponding to the given thread IDto the memory pointed to by @p /// message. Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp Wed Mar 19 13:18:42 2014 (r263367) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp Wed Mar 19 13:19:56 2014 (r263368) @@ -83,6 +83,7 @@ POSIXThread::GetMonitor() return process.GetMonitor(); } +// Overridden by FreeBSDThread; this is used only on Linux. void POSIXThread::RefreshStateAfterStop() { @@ -257,6 +258,7 @@ POSIXThread::GetUnwinder() return m_unwinder_ap.get(); } +// Overridden by FreeBSDThread; this is used only on Linux. void POSIXThread::WillResume(lldb::StateType resume_state) { @@ -274,43 +276,6 @@ POSIXThread::DidStop() // Don't set the thread state to stopped unless we really stopped. } -bool -POSIXThread::Resume() -{ - lldb::StateType resume_state = GetResumeState(); - ProcessMonitor &monitor = GetMonitor(); - bool status; - - Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD)); - if (log) - log->Printf ("POSIXThread::%s (), resume_state = %s", __FUNCTION__, - StateAsCString(resume_state)); - - switch (resume_state) - { - default: - assert(false && "Unexpected state for resume!"); - status = false; - break; - - case lldb::eStateRunning: - SetState(resume_state); - status = monitor.Resume(GetID(), GetResumeSignal()); - break; - - case lldb::eStateStepping: - SetState(resume_state); - status = monitor.SingleStep(GetID(), GetResumeSignal()); - break; - case lldb::eStateStopped: - case lldb::eStateSuspended: - status = true; - break; - } - - return status; -} - void POSIXThread::Notify(const ProcessMessage &message) { Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.h Wed Mar 19 13:18:42 2014 (r263367) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.h Wed Mar 19 13:19:56 2014 (r263368) @@ -79,8 +79,6 @@ public: //-------------------------------------------------------------------------- // These methods form a specialized interface to POSIX threads. // - bool Resume(); - void Notify(const ProcessMessage &message); //-------------------------------------------------------------------------- Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp Wed Mar 19 13:18:42 2014 (r263367) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp Wed Mar 19 13:19:56 2014 (r263368) @@ -259,31 +259,6 @@ ProcessPOSIX::DidLaunch() { } -Error -ProcessPOSIX::DoResume() -{ - StateType state = GetPrivateState(); - - assert(state == eStateStopped); - - SetPrivateState(eStateRunning); - - bool did_resume = false; - - Mutex::Locker lock(m_thread_list.GetMutex()); - - uint32_t thread_count = m_thread_list.GetSize(false); - for (uint32_t i = 0; i < thread_count; ++i) - { - POSIXThread *thread = static_cast( - m_thread_list.GetThreadAtIndex(i, false).get()); - did_resume = thread->Resume() || did_resume; - } - assert(did_resume && "Process resume failed!"); - - return Error(); -} - addr_t ProcessPOSIX::GetImageInfoAddress() { @@ -376,107 +351,6 @@ ProcessPOSIX::DoDidExec() } } -void -ProcessPOSIX::SendMessage(const ProcessMessage &message) -{ - Mutex::Locker lock(m_message_mutex); - - Mutex::Locker thread_lock(m_thread_list.GetMutex()); - - POSIXThread *thread = static_cast( - m_thread_list.FindThreadByID(message.GetTID(), false).get()); - - switch (message.GetKind()) - { - case ProcessMessage::eInvalidMessage: - return; - - case ProcessMessage::eAttachMessage: - SetPrivateState(eStateStopped); - return; - - case ProcessMessage::eLimboMessage: - assert(thread); - thread->SetState(eStateStopped); - if (message.GetTID() == GetID()) - { - m_exit_status = message.GetExitStatus(); - if (m_exit_now) - { - SetPrivateState(eStateExited); - m_monitor->Detach(GetID()); - } - else - { - StopAllThreads(message.GetTID()); - SetPrivateState(eStateStopped); - } - } - else - { - StopAllThreads(message.GetTID()); - SetPrivateState(eStateStopped); - } - break; - - case ProcessMessage::eExitMessage: - assert(thread); - thread->SetState(eStateExited); - // FIXME: I'm not sure we need to do this. - if (message.GetTID() == GetID()) - { - m_exit_status = message.GetExitStatus(); - SetExitStatus(m_exit_status, NULL); - } - else if (!IsAThreadRunning()) - SetPrivateState(eStateStopped); - break; - - case ProcessMessage::eSignalMessage: - case ProcessMessage::eSignalDeliveredMessage: - if (message.GetSignal() == SIGSTOP && - AddThreadForInitialStopIfNeeded(message.GetTID())) - return; - // Intentional fall-through - - case ProcessMessage::eBreakpointMessage: - case ProcessMessage::eTraceMessage: - case ProcessMessage::eWatchpointMessage: - case ProcessMessage::eCrashMessage: - assert(thread); - thread->SetState(eStateStopped); - StopAllThreads(message.GetTID()); - SetPrivateState(eStateStopped); - break; - - case ProcessMessage::eNewThreadMessage: - { - lldb::tid_t new_tid = message.GetChildTID(); - if (WaitingForInitialStop(new_tid)) - { - m_monitor->WaitForInitialTIDStop(new_tid); - } - assert(thread); - thread->SetState(eStateStopped); - StopAllThreads(message.GetTID()); - SetPrivateState(eStateStopped); - break; - } - - case ProcessMessage::eExecMessage: - { - assert(thread); - thread->SetState(eStateStopped); - StopAllThreads(message.GetTID()); - SetPrivateState(eStateStopped); - break; - } - } - - - m_message_queue.push(message); -} - void ProcessPOSIX::StopAllThreads(lldb::tid_t stop_tid) { Modified: stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h Wed Mar 19 13:18:42 2014 (r263367) +++ stable/10/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h Wed Mar 19 13:19:56 2014 (r263368) @@ -64,7 +64,7 @@ public: DidLaunch(); virtual lldb_private::Error - DoResume(); + DoResume() = 0; virtual lldb_private::Error DoHalt(bool &caused_stop); @@ -148,7 +148,8 @@ public: // ProcessPOSIX internal API. /// Registers the given message with this process. - void SendMessage(const ProcessMessage &message); + virtual void + SendMessage(const ProcessMessage &message) = 0; ProcessMonitor & GetMonitor() { assert(m_monitor); return *m_monitor; } Modified: stable/10/lib/clang/liblldbPluginProcessFreeBSD/Makefile ============================================================================== --- stable/10/lib/clang/liblldbPluginProcessFreeBSD/Makefile Wed Mar 19 13:18:42 2014 (r263367) +++ stable/10/lib/clang/liblldbPluginProcessFreeBSD/Makefile Wed Mar 19 13:19:56 2014 (r263368) @@ -9,7 +9,8 @@ CFLAGS+=-I${.CURDIR}/../../../contrib/ll CFLAGS+=-I${.CURDIR}/../../../contrib/llvm/tools/lldb/source/Plugins/Process/POSIX SRCDIR= tools/lldb/source/Plugins/Process/FreeBSD -SRCS= ProcessFreeBSD.cpp \ +SRCS= FreeBSDThread.cpp \ + ProcessFreeBSD.cpp \ ProcessMonitor.cpp TGHDRS= DiagnosticCommonKinds \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:24:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EEFD3C6E; Wed, 19 Mar 2014 13:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9EFC6CF; Wed, 19 Mar 2014 13:24: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 s2JDOlh3050017; Wed, 19 Mar 2014 13:24:47 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JDOlKP050015; Wed, 19 Mar 2014 13:24:47 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403191324.s2JDOlKP050015@svn.freebsd.org> From: Ed Maste Date: Wed, 19 Mar 2014 13:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263369 - in stable/10/contrib/llvm/tools/lldb/source: Breakpoint Symbol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:24:48 -0000 Author: emaste Date: Wed Mar 19 13:24:47 2014 New Revision: 263369 URL: http://svnweb.freebsd.org/changeset/base/263369 Log: MFC r258897: Update LLDB to upstream r196322 snapshot Upstream revisions of note: r196298 - Fix use of std::lower_bound r196322 - Fix log message for new invalidation checks Sponsored by: DARPA, AFRL Modified: stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp Wed Mar 19 13:19:56 2014 (r263368) +++ stable/10/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp Wed Mar 19 13:24:47 2014 (r263369) @@ -86,16 +86,13 @@ Compare (BreakpointLocationSP lhs, lldb: BreakpointLocationSP BreakpointLocationList::FindByID (lldb::break_id_t break_id) const { - BreakpointLocationSP bp_loc_sp; Mutex::Locker locker (m_mutex); - - collection::const_iterator begin = m_locations.begin(), end = m_locations.end(); - collection::const_iterator result; - result = std::lower_bound(begin, end, break_id, Compare); - if (result == end) - return bp_loc_sp; + collection::const_iterator end = m_locations.end(); + collection::const_iterator pos = std::lower_bound(m_locations.begin(), end, break_id, Compare); + if (pos != end && (*pos)->GetID() == break_id) + return *(pos); else - return *(result); + return BreakpointLocationSP(); } size_t Modified: stable/10/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp ============================================================================== --- stable/10/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp Wed Mar 19 13:19:56 2014 (r263368) +++ stable/10/contrib/llvm/tools/lldb/source/Symbol/UnwindPlan.cpp Wed Mar 19 13:24:47 2014 (r263369) @@ -379,7 +379,19 @@ UnwindPlan::PlanValidAtAddress (Address { Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); if (log) - log->Printf ("Testing if UnwindPlan is valid at pc 0x%" PRIx64 ": No unwind rows - is invalid."); + { + StreamString s; + if (addr.Dump (&s, NULL, Address::DumpStyleSectionNameOffset)) + { + log->Printf ("UnwindPlan is invalid -- no unwind rows for UnwindPlan '%s' at address %s", + m_source_name.GetCString(), s.GetData()); + } + else + { + log->Printf ("UnwindPlan is invalid -- no unwind rows for UnwindPlan '%s'", + m_source_name.GetCString()); + } + } return false; } @@ -389,7 +401,19 @@ UnwindPlan::PlanValidAtAddress (Address { Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND)); if (log) - log->Printf ("Testing if UnwindPlan is valid at pc 0x%" PRIx64 ": No CFA register - is invalid."); + { + StreamString s; + if (addr.Dump (&s, NULL, Address::DumpStyleSectionNameOffset)) + { + log->Printf ("UnwindPlan is invalid -- no CFA register defined in row 0 for UnwindPlan '%s' at address %s", + m_source_name.GetCString(), s.GetData()); + } + else + { + log->Printf ("UnwindPlan is invalid -- no CFA register defined in row 0 for UnwindPlan '%s'", + m_source_name.GetCString()); + } + } return false; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 13:37:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 10F38349; Wed, 19 Mar 2014 13:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F15B2847; Wed, 19 Mar 2014 13:37: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 s2JDbp4a054424; Wed, 19 Mar 2014 13:37:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JDbpM8054423; Wed, 19 Mar 2014 13:37:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403191337.s2JDbpM8054423@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 19 Mar 2014 13:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263370 - stable/10/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:37:52 -0000 Author: glebius Date: Wed Mar 19 13:37:51 2014 New Revision: 263370 URL: http://svnweb.freebsd.org/changeset/base/263370 Log: Merge r257485: install netpfil/pf includes. Modified: stable/10/include/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/include/Makefile ============================================================================== --- stable/10/include/Makefile Wed Mar 19 13:24:47 2014 (r263369) +++ stable/10/include/Makefile Wed Mar 19 13:37:51 2014 (r263370) @@ -187,6 +187,11 @@ copies: ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/netinet .endif +.if ${MK_PF} != "no" + cd ${.CURDIR}/../sys/netpfil/pf; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ + ${DESTDIR}${INCLUDEDIR}/netpfil/pf +.endif cd ${.CURDIR}/../sys/crypto; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \ ${DESTDIR}${INCLUDEDIR}/crypto From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 19:31:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 58B7654D; Wed, 19 Mar 2014 19:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 391C5230; Wed, 19 Mar 2014 19:31: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 s2JJVMJQ098324; Wed, 19 Mar 2014 19:31:22 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JJVM3f098323; Wed, 19 Mar 2014 19:31:22 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403191931.s2JJVM3f098323@svn.freebsd.org> From: Ed Maste Date: Wed, 19 Mar 2014 19:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263374 - stable/10/contrib/llvm/include/llvm/Support X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 19:31:22 -0000 Author: emaste Date: Wed Mar 19 19:31:21 2014 New Revision: 263374 URL: http://svnweb.freebsd.org/changeset/base/263374 Log: MFC r258003: Merge upstream LLVM r182803: [Mips] Add Mips specific dynamic table entry tags. Sponsored by: DARPA, AFRL Modified: stable/10/contrib/llvm/include/llvm/Support/ELF.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/include/llvm/Support/ELF.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/Support/ELF.h Wed Mar 19 18:54:53 2014 (r263373) +++ stable/10/contrib/llvm/include/llvm/Support/ELF.h Wed Mar 19 19:31:21 2014 (r263374) @@ -1468,7 +1468,81 @@ enum { DT_VERDEF = 0X6FFFFFFC, // The address of the version definition table. DT_VERDEFNUM = 0X6FFFFFFD, // The number of entries in DT_VERDEF. DT_VERNEED = 0X6FFFFFFE, // The address of the version Dependency table. - DT_VERNEEDNUM = 0X6FFFFFFF // The number of entries in DT_VERNEED. + DT_VERNEEDNUM = 0X6FFFFFFF, // The number of entries in DT_VERNEED. + + // Mips specific dynamic table entry tags. + DT_MIPS_RLD_VERSION = 0x70000001, // 32 bit version number for runtime + // linker interface. + DT_MIPS_TIME_STAMP = 0x70000002, // Time stamp. + DT_MIPS_ICHECKSUM = 0x70000003, // Checksum of external strings + // and common sizes. + DT_MIPS_IVERSION = 0x70000004, // Index of version string + // in string table. + DT_MIPS_FLAGS = 0x70000005, // 32 bits of flags. + DT_MIPS_BASE_ADDRESS = 0x70000006, // Base address of the segment. + DT_MIPS_MSYM = 0x70000007, // Address of .msym section. + DT_MIPS_CONFLICT = 0x70000008, // Address of .conflict section. + DT_MIPS_LIBLIST = 0x70000009, // Address of .liblist section. + DT_MIPS_LOCAL_GOTNO = 0x7000000a, // Number of local global offset + // table entries. + DT_MIPS_CONFLICTNO = 0x7000000b, // Number of entries + // in the .conflict section. + DT_MIPS_LIBLISTNO = 0x70000010, // Number of entries + // in the .liblist section. + DT_MIPS_SYMTABNO = 0x70000011, // Number of entries + // in the .dynsym section. + DT_MIPS_UNREFEXTNO = 0x70000012, // Index of first external dynamic symbol + // not referenced locally. + DT_MIPS_GOTSYM = 0x70000013, // Index of first dynamic symbol + // in global offset table. + DT_MIPS_HIPAGENO = 0x70000014, // Number of page table entries + // in global offset table. + DT_MIPS_RLD_MAP = 0x70000016, // Address of run time loader map, + // used for debugging. + DT_MIPS_DELTA_CLASS = 0x70000017, // Delta C++ class definition. + DT_MIPS_DELTA_CLASS_NO = 0x70000018, // Number of entries + // in DT_MIPS_DELTA_CLASS. + DT_MIPS_DELTA_INSTANCE = 0x70000019, // Delta C++ class instances. + DT_MIPS_DELTA_INSTANCE_NO = 0x7000001A, // Number of entries + // in DT_MIPS_DELTA_INSTANCE. + DT_MIPS_DELTA_RELOC = 0x7000001B, // Delta relocations. + DT_MIPS_DELTA_RELOC_NO = 0x7000001C, // Number of entries + // in DT_MIPS_DELTA_RELOC. + DT_MIPS_DELTA_SYM = 0x7000001D, // Delta symbols that Delta + // relocations refer to. + DT_MIPS_DELTA_SYM_NO = 0x7000001E, // Number of entries + // in DT_MIPS_DELTA_SYM. + DT_MIPS_DELTA_CLASSSYM = 0x70000020, // Delta symbols that hold + // class declarations. + DT_MIPS_DELTA_CLASSSYM_NO = 0x70000021, // Number of entries + // in DT_MIPS_DELTA_CLASSSYM. + DT_MIPS_CXX_FLAGS = 0x70000022, // Flags indicating information + // about C++ flavor. + DT_MIPS_PIXIE_INIT = 0x70000023, // Pixie information. + DT_MIPS_SYMBOL_LIB = 0x70000024, // Address of .MIPS.symlib + DT_MIPS_LOCALPAGE_GOTIDX = 0x70000025, // The GOT index of the first PTE + // for a segment + DT_MIPS_LOCAL_GOTIDX = 0x70000026, // The GOT index of the first PTE + // for a local symbol + DT_MIPS_HIDDEN_GOTIDX = 0x70000027, // The GOT index of the first PTE + // for a hidden symbol + DT_MIPS_PROTECTED_GOTIDX = 0x70000028, // The GOT index of the first PTE + // for a protected symbol + DT_MIPS_OPTIONS = 0x70000029, // Address of `.MIPS.options'. + DT_MIPS_INTERFACE = 0x7000002A, // Address of `.interface'. + DT_MIPS_DYNSTR_ALIGN = 0x7000002B, // Unknown. + DT_MIPS_INTERFACE_SIZE = 0x7000002C, // Size of the .interface section. + DT_MIPS_RLD_TEXT_RESOLVE_ADDR = 0x7000002D, // Size of rld_text_resolve + // function stored in the GOT. + DT_MIPS_PERF_SUFFIX = 0x7000002E, // Default suffix of DSO to be added + // by rld on dlopen() calls. + DT_MIPS_COMPACT_SIZE = 0x7000002F, // Size of compact relocation + // section (O32). + DT_MIPS_GP_VALUE = 0x70000030, // GP value for auxiliary GOTs. + DT_MIPS_AUX_DYNAMIC = 0x70000031, // Address of auxiliary .dynamic. + DT_MIPS_PLTGOT = 0x70000032, // Address of the base of the PLTGOT. + DT_MIPS_RWPLT = 0x70000034 // Points to the base + // of a writable PLT. }; // DT_FLAGS values. @@ -1501,6 +1575,31 @@ enum { DF_1_DISPRELPND = 0x00010000 // Disp reloc applied at run-time. }; +// DT_MIPS_FLAGS values. +enum { + RHF_NONE = 0x00000000, // No flags. + RHF_QUICKSTART = 0x00000001, // Uses shortcut pointers. + RHF_NOTPOT = 0x00000002, // Hash size is not a power of two. + RHS_NO_LIBRARY_REPLACEMENT = 0x00000004, // Ignore LD_LIBRARY_PATH. + RHF_NO_MOVE = 0x00000008, // DSO address may not be relocated. + RHF_SGI_ONLY = 0x00000010, // SGI specific features. + RHF_GUARANTEE_INIT = 0x00000020, // Guarantee that .init will finish + // executing before any non-init + // code in DSO is called. + RHF_DELTA_C_PLUS_PLUS = 0x00000040, // Contains Delta C++ code. + RHF_GUARANTEE_START_INIT = 0x00000080, // Guarantee that .init will start + // executing before any non-init + // code in DSO is called. + RHF_PIXIE = 0x00000100, // Generated by pixie. + RHF_DEFAULT_DELAY_LOAD = 0x00000200, // Delay-load DSO by default. + RHF_REQUICKSTART = 0x00000400, // Object may be requickstarted + RHF_REQUICKSTARTED = 0x00000800, // Object has been requickstarted + RHF_CORD = 0x00001000, // Generated by cord. + RHF_NO_UNRES_UNDEF = 0x00002000, // Object contains no unresolved + // undef symbols. + RHF_RLD_ORDER_SAFE = 0x00004000 // Symbol table is in a safe order. +}; + // ElfXX_VerDef structure version (GNU versioning) enum { VER_DEF_NONE = 0, From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 20:46:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 14C332B3; Wed, 19 Mar 2014 20:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA229B2D; Wed, 19 Mar 2014 20:46: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 s2JKk2i3029170; Wed, 19 Mar 2014 20:46:02 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JKk2lq029167; Wed, 19 Mar 2014 20:46:02 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403192046.s2JKk2lq029167@svn.freebsd.org> From: Ed Maste Date: Wed, 19 Mar 2014 20:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263378 - in stable/10/contrib/llvm: include/llvm/Support lib/Support X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 20:46:03 -0000 Author: emaste Date: Wed Mar 19 20:46:02 2014 New Revision: 263378 URL: http://svnweb.freebsd.org/changeset/base/263378 Log: MFC r258005: Merge upstream LLVM r192118: Formally added an explicit enum for DWARF TLS support. No functionality change. Sponsored by: DARPA, AFRL Modified: stable/10/contrib/llvm/include/llvm/Support/Dwarf.h stable/10/contrib/llvm/lib/Support/Dwarf.cpp Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/include/llvm/Support/Dwarf.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/Support/Dwarf.h Wed Mar 19 20:40:57 2014 (r263377) +++ stable/10/contrib/llvm/include/llvm/Support/Dwarf.h Wed Mar 19 20:46:02 2014 (r263378) @@ -484,6 +484,9 @@ enum dwarf_constants { DW_OP_lo_user = 0xe0, DW_OP_hi_user = 0xff, + // Extensions for GNU-style thread-local storage. + DW_OP_GNU_push_tls_address = 0xe0, + // Extensions for Fission proposal. DW_OP_GNU_addr_index = 0xfb, DW_OP_GNU_const_index = 0xfc, Modified: stable/10/contrib/llvm/lib/Support/Dwarf.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Support/Dwarf.cpp Wed Mar 19 20:40:57 2014 (r263377) +++ stable/10/contrib/llvm/lib/Support/Dwarf.cpp Wed Mar 19 20:46:02 2014 (r263378) @@ -453,10 +453,11 @@ const char *llvm::dwarf::OperationEncodi case DW_OP_bit_piece: return "DW_OP_bit_piece"; case DW_OP_implicit_value: return "DW_OP_implicit_value"; case DW_OP_stack_value: return "DW_OP_stack_value"; - case DW_OP_lo_user: return "DW_OP_lo_user"; - case DW_OP_hi_user: return "DW_OP_hi_user"; - // DWARF5 Fission Proposal Op Extensions + // GNU thread-local storage + case DW_OP_GNU_push_tls_address: return "DW_OP_GNU_push_tls_address"; + + // DWARF5 Fission Proposal Op Extensions case DW_OP_GNU_addr_index: return "DW_OP_GNU_addr_index"; case DW_OP_GNU_const_index: return "DW_OP_GNU_const_index"; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 22:50:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 93D138CE; Wed, 19 Mar 2014 22:50: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 667589AB; Wed, 19 Mar 2014 22:50: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 s2JMoFLw079263; Wed, 19 Mar 2014 22:50:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JMoFNS079261; Wed, 19 Mar 2014 22:50:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403192250.s2JMoFNS079261@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Mar 2014 22:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263384 - in stable: 10/sys/dev/isp 9/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 22:50:15 -0000 Author: dim Date: Wed Mar 19 22:50:14 2014 New Revision: 263384 URL: http://svnweb.freebsd.org/changeset/base/263384 Log: MFC r259860 (by mjacob): Harvest one no longer used constant string. Remove another and place it into play in the normally ifdef protected zone it would be used int. Noticed by: dim Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/isp/isp.c stable/9/sys/dev/isp/isp_freebsd.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Wed Mar 19 22:27:10 2014 (r263383) +++ stable/10/sys/dev/isp/isp.c Wed Mar 19 22:50:14 2014 (r263384) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); static const char fconf[] = "Chan %d PortDB[%d] changed:\n current =(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)\n database=(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)"; static const char notresp[] = "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d) nlooked %d"; static const char topology[] = "Chan %d WWPN 0x%08x%08x PortID 0x%06x N-Port Handle %d, Connection '%s'"; -static const char sc4[] = "NVRAM"; static const char bun[] = "bad underrun (count %d, resid %d, status %s)"; static const char lipd[] = "Chan %d LIP destroyed %d active commands"; static const char sacq[] = "unable to acquire scratch area"; Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 19 22:27:10 2014 (r263383) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Mar 19 22:50:14 2014 (r263384) @@ -56,7 +56,6 @@ int isp_quickboot_time = 7; /* don't wai int isp_gone_device_time = 30; /* grace time before reporting device lost */ int isp_autoconfig = 1; /* automatically attach/detach devices */ static const char prom3[] = "Chan %d PortID 0x%06x Departed from Target %u because of %s"; -static const char rqo[] = "%s: Request Queue Overflow\n"; static void isp_freeze_loopdown(ispsoftc_t *, int, char *); static d_ioctl_t ispioctl; @@ -2152,7 +2151,8 @@ isp_target_putback_atio(union ccb *ccb) qe = isp_getrqentry(isp); if (qe == NULL) { - xpt_print(ccb->ccb_h.path, rqo, __func__); + xpt_print(ccb->ccb_h.path, + "%s: Request Queue Overflow\n", __func__); (void) timeout(isp_refire_putback_atio, ccb, 10); return; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 23:36:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 995B8D71; Wed, 19 Mar 2014 23:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8115FDDF; Wed, 19 Mar 2014 23:36: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 s2JNaI2h099357; Wed, 19 Mar 2014 23:36:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JNaDGi099324; Wed, 19 Mar 2014 23:36:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403192336.s2JNaDGi099324@svn.freebsd.org> From: Xin LI Date: Wed, 19 Mar 2014 23:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263390 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contri... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 23:36:18 -0000 Author: delphij Date: Wed Mar 19 23:36:12 2014 New Revision: 263390 URL: http://svnweb.freebsd.org/changeset/base/263390 Log: MFC r259813 + r259813: MFV r258374: 4171 clean up spa_feature_*() interfaces 4172 implement extensible_dataset feature for use by other zpool features illumos/illumos-gate@2acef22db7808606888f8f92715629ff3ba555b9 Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Mar 19 23:36:12 2014 (r263390) @@ -559,16 +559,20 @@ get_metaslab_refcount(vdev_t *vd) static int verify_spacemap_refcounts(spa_t *spa) { - int expected_refcount, actual_refcount; + uint64_t expected_refcount = 0; + uint64_t actual_refcount; - expected_refcount = spa_feature_get_refcount(spa, - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + (void) feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM], + &expected_refcount); actual_refcount = get_dtl_refcount(spa->spa_root_vdev); actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); if (expected_refcount != actual_refcount) { - (void) printf("space map refcount mismatch: expected %d != " - "actual %d\n", expected_refcount, actual_refcount); + (void) printf("space map refcount mismatch: expected %lld != " + "actual %lld\n", + (longlong_t)expected_refcount, + (longlong_t)actual_refcount); return (2); } return (0); @@ -670,8 +674,7 @@ dump_metaslab(metaslab_t *msp) } if (dump_opt['m'] > 1 && sm != NULL && - spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + spa_feature_is_active(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { /* * The space map histogram represents free space in chunks * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). @@ -2417,8 +2420,7 @@ dump_block_stats(spa_t *spa) (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, count_block_cb, &zcb, NULL); } - if (spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + if (spa_feature_is_active(spa, SPA_FEATURE_ASYNC_DESTROY)) { VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset, spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb, &zcb, NULL)); @@ -2719,7 +2721,7 @@ dump_zpool(spa_t *spa) } if (spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + SPA_FEATURE_ASYNC_DESTROY)) { dump_bptree(spa->spa_meta_objset, spa->spa_dsl_pool->dp_bptree_obj, "Pool dataset frees"); Modified: stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c Wed Mar 19 23:36:12 2014 (r263390) @@ -283,12 +283,13 @@ zhack_do_feature_stat(int argc, char **a } static void -feature_enable_sync(void *arg, dmu_tx_t *tx) +zhack_feature_enable_sync(void *arg, dmu_tx_t *tx) { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; - spa_feature_enable(spa, feature, tx); + feature_enable_sync(spa, feature, tx); + spa_history_log_internal(spa, "zhack enable feature", tx, "name=%s can_readonly=%u", feature->fi_guid, feature->fi_can_readonly); @@ -302,7 +303,7 @@ zhack_do_feature_enable(int argc, char * spa_t *spa; objset_t *mos; zfeature_info_t feature; - zfeature_info_t *nodeps[] = { NULL }; + spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; /* * Features are not added to the pool's label until their refcounts @@ -349,14 +350,14 @@ zhack_do_feature_enable(int argc, char * zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; - if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) + if (zfeature_is_supported(feature.fi_guid)) fatal(spa, FTAG, "'%s' is a real feature, will not enable"); if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid)) fatal(spa, FTAG, "feature already enabled: %s", feature.fi_guid); VERIFY0(dsl_sync_task(spa_name(spa), NULL, - feature_enable_sync, &feature, 5)); + zhack_feature_enable_sync, &feature, 5)); spa_close(spa, FTAG); @@ -368,8 +369,10 @@ feature_incr_sync(void *arg, dmu_tx_t *t { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; + uint64_t refcount; - spa_feature_incr(spa, feature, tx); + VERIFY0(feature_get_refcount(spa, feature, &refcount)); + feature_sync(spa, feature, refcount + 1, tx); spa_history_log_internal(spa, "zhack feature incr", tx, "name=%s", feature->fi_guid); } @@ -379,8 +382,10 @@ feature_decr_sync(void *arg, dmu_tx_t *t { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; + uint64_t refcount; - spa_feature_decr(spa, feature, tx); + VERIFY0(feature_get_refcount(spa, feature, &refcount)); + feature_sync(spa, feature, refcount - 1, tx); spa_history_log_internal(spa, "zhack feature decr", tx, "name=%s", feature->fi_guid); } @@ -394,7 +399,7 @@ zhack_do_feature_ref(int argc, char **ar spa_t *spa; objset_t *mos; zfeature_info_t feature; - zfeature_info_t *nodeps[] = { NULL }; + spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; /* * fi_desc does not matter here because it was written to disk @@ -437,9 +442,10 @@ zhack_do_feature_ref(int argc, char **ar zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; - if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) - fatal(spa, FTAG, "'%s' is a real feature, will not change " - "refcount"); + if (zfeature_is_supported(feature.fi_guid)) { + fatal(spa, FTAG, + "'%s' is a real feature, will not change refcount"); + } if (0 == zap_contains(mos, spa->spa_feat_for_read_obj, feature.fi_guid)) { @@ -451,9 +457,14 @@ zhack_do_feature_ref(int argc, char **ar fatal(spa, FTAG, "feature is not enabled: %s", feature.fi_guid); } - if (decr && !spa_feature_is_active(spa, &feature)) - fatal(spa, FTAG, "feature refcount already 0: %s", - feature.fi_guid); + if (decr) { + uint64_t count; + if (feature_get_refcount(spa, &feature, &count) == 0 && + count != 0) { + fatal(spa, FTAG, "feature refcount already 0: %s", + feature.fi_guid); + } + } VERIFY0(dsl_sync_task(spa_name(spa), NULL, decr ? feature_decr_sync : feature_incr_sync, &feature, 5)); Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Wed Mar 19 23:36:12 2014 (r263390) @@ -269,6 +269,23 @@ an existing space map is upgraded to the Once the feature is .Sy active , it will remain in that state until the pool is destroyed. +.It Sy extensible_dataset +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:extensible_dataset" +.It GUID Ta com.delphix:extensible_dataset +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +This feature allows more flexible use of internal ZFS data structures, +and exists for other features to depend on. +.Pp +This feature will be +.Sy active +when the first dependent feature uses it, +and will be returned to the +.Sy enabled +state when all datasets that use +this feature are destroyed. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Mar 19 23:36:12 2014 (r263390) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 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) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. @@ -1004,7 +1004,7 @@ zpool_do_create(int argc, char **argv) * Hand off to libzfs. */ if (enable_all_pool_feat) { - int i; + spa_feature_t i; for (i = 0; i < SPA_FEATURES; i++) { char propname[MAXPATHLEN]; zfeature_info_t *feat = &spa_feature_table[i]; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed Mar 19 23:36:12 2014 (r263390) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 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) 2013 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -443,10 +443,9 @@ zpool_valid_proplist(libzfs_handle_t *hd prop = zpool_name_to_prop(propname); if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) { int err; - zfeature_info_t *feature; char *fname = strchr(propname, '@') + 1; - err = zfeature_lookup_name(fname, &feature); + err = zfeature_lookup_name(fname, NULL); if (err != 0) { ASSERT3U(err, ==, ENOENT); zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -839,14 +838,14 @@ zpool_prop_get_feature(zpool_handle_t *z */ if (supported) { int ret; - zfeature_info_t *fi; + spa_feature_t fid; - ret = zfeature_lookup_name(feature, &fi); + ret = zfeature_lookup_name(feature, &fid); if (ret != 0) { (void) strlcpy(buf, "-", len); return (ENOTSUP); } - feature = fi->fi_guid; + feature = spa_feature_table[fid].fi_guid; } if (nvlist_lookup_uint64(features, feature, &refcount) == 0) Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Wed Mar 19 23:36:12 2014 (r263390) @@ -91,32 +91,22 @@ zfeature_is_supported(const char *guid) if (zfeature_checks_disable) return (B_TRUE); - return (0 == zfeature_lookup_guid(guid, NULL)); -} - -int -zfeature_lookup_guid(const char *guid, zfeature_info_t **res) -{ - for (int i = 0; i < SPA_FEATURES; i++) { + for (spa_feature_t i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *feature = &spa_feature_table[i]; - if (strcmp(guid, feature->fi_guid) == 0) { - if (res != NULL) - *res = feature; - return (0); - } + if (strcmp(guid, feature->fi_guid) == 0) + return (B_TRUE); } - - return (ENOENT); + return (B_FALSE); } int -zfeature_lookup_name(const char *name, zfeature_info_t **res) +zfeature_lookup_name(const char *name, spa_feature_t *res) { - for (int i = 0; i < SPA_FEATURES; i++) { + for (spa_feature_t i = 0; i < SPA_FEATURES; i++) { zfeature_info_t *feature = &spa_feature_table[i]; if (strcmp(name, feature->fi_uname) == 0) { if (res != NULL) - *res = feature; + *res = i; return (0); } } @@ -125,11 +115,12 @@ zfeature_lookup_name(const char *name, z } static void -zfeature_register(int fid, const char *guid, const char *name, const char *desc, - boolean_t readonly, boolean_t mos, zfeature_info_t **deps) +zfeature_register(spa_feature_t fid, const char *guid, const char *name, + const char *desc, boolean_t readonly, boolean_t mos, + const spa_feature_t *deps) { zfeature_info_t *feature = &spa_feature_table[fid]; - static zfeature_info_t *nodeps[] = { NULL }; + static spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; ASSERT(name != NULL); ASSERT(desc != NULL); @@ -140,6 +131,7 @@ zfeature_register(int fid, const char *g if (deps == NULL) deps = nodeps; + feature->fi_feature = fid; feature->fi_guid = guid; feature->fi_uname = name; feature->fi_desc = desc; @@ -166,4 +158,8 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, "com.delphix:spacemap_histogram", "spacemap_histogram", "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_EXTENSIBLE_DATASET, + "com.delphix:extensible_dataset", "extensible_dataset", + "Enhanced dataset functionality, used by other features.", + B_FALSE, B_FALSE, NULL); } Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Wed Mar 19 23:36:12 2014 (r263390) @@ -37,35 +37,38 @@ extern "C" { struct zfeature_info; +typedef enum spa_feature { + SPA_FEATURE_NONE = -1, + SPA_FEATURE_ASYNC_DESTROY, + SPA_FEATURE_EMPTY_BPOBJ, + SPA_FEATURE_LZ4_COMPRESS, + SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + SPA_FEATURE_SPACEMAP_HISTOGRAM, + SPA_FEATURE_EXTENSIBLE_DATASET, + SPA_FEATURES +} spa_feature_t; + typedef struct zfeature_info { + spa_feature_t fi_feature; const char *fi_uname; /* User-facing feature name */ const char *fi_guid; /* On-disk feature identifier */ const char *fi_desc; /* Feature description */ boolean_t fi_can_readonly; /* Can open pool readonly w/o support? */ boolean_t fi_mos; /* Is the feature necessary to read the MOS? */ - struct zfeature_info **fi_depends; /* array; null terminated */ + /* array of dependencies, terminated by SPA_FEATURE_NONE */ + const spa_feature_t *fi_depends; } zfeature_info_t; typedef int (zfeature_func_t)(zfeature_info_t *fi, void *arg); #define ZFS_FEATURE_DEBUG -static enum spa_feature { - SPA_FEATURE_ASYNC_DESTROY, - SPA_FEATURE_EMPTY_BPOBJ, - SPA_FEATURE_LZ4_COMPRESS, - SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, - SPA_FEATURE_SPACEMAP_HISTOGRAM, - SPA_FEATURES -} spa_feature_t; - extern zfeature_info_t spa_feature_table[SPA_FEATURES]; extern boolean_t zfeature_is_valid_guid(const char *); extern boolean_t zfeature_is_supported(const char *); -extern int zfeature_lookup_guid(const char *, zfeature_info_t **res); -extern int zfeature_lookup_name(const char *, zfeature_info_t **res); +extern int zfeature_lookup_name(const char *name, spa_feature_t *res); extern void zpool_feature_init(void); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Wed Mar 19 23:36:12 2014 (r263390) @@ -36,13 +36,11 @@ uint64_t bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx) { - zfeature_info_t *empty_bpobj_feat = - &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; spa_t *spa = dmu_objset_spa(os); dsl_pool_t *dp = dmu_objset_pool(os); - if (spa_feature_is_enabled(spa, empty_bpobj_feat)) { - if (!spa_feature_is_active(spa, empty_bpobj_feat)) { + if (spa_feature_is_enabled(spa, SPA_FEATURE_EMPTY_BPOBJ)) { + if (!spa_feature_is_active(spa, SPA_FEATURE_EMPTY_BPOBJ)) { ASSERT0(dp->dp_empty_bpobj); dp->dp_empty_bpobj = bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx); @@ -51,7 +49,7 @@ bpobj_alloc_empty(objset_t *os, int bloc DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, &dp->dp_empty_bpobj, tx) == 0); } - spa_feature_incr(spa, empty_bpobj_feat, tx); + spa_feature_incr(spa, SPA_FEATURE_EMPTY_BPOBJ, tx); ASSERT(dp->dp_empty_bpobj != 0); return (dp->dp_empty_bpobj); } else { @@ -62,12 +60,11 @@ bpobj_alloc_empty(objset_t *os, int bloc void bpobj_decr_empty(objset_t *os, dmu_tx_t *tx) { - zfeature_info_t *empty_bpobj_feat = - &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; dsl_pool_t *dp = dmu_objset_pool(os); - spa_feature_decr(dmu_objset_spa(os), empty_bpobj_feat, tx); - if (!spa_feature_is_active(dmu_objset_spa(os), empty_bpobj_feat)) { + spa_feature_decr(dmu_objset_spa(os), SPA_FEATURE_EMPTY_BPOBJ, tx); + if (!spa_feature_is_active(dmu_objset_spa(os), + SPA_FEATURE_EMPTY_BPOBJ)) { VERIFY3U(0, ==, zap_remove(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_EMPTY_BPOBJ, tx)); @@ -265,6 +262,7 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_i mutex_exit(&bpo->bpo_lock); return (err); } + ASSERT3U(doi.doi_type, ==, DMU_OT_BPOBJ_SUBOBJ); epb = doi.doi_data_block_size / sizeof (uint64_t); for (i = bpo->bpo_phys->bpo_num_subobjs - 1; i >= 0; i--) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Wed Mar 19 23:36:12 2014 (r263390) @@ -27,6 +27,8 @@ #include #include #include +#include +#include uint64_t dmu_object_alloc(objset_t *os, dmu_object_type_t ot, int blocksize, @@ -195,3 +197,54 @@ dmu_object_next(objset_t *os, uint64_t * return (error); } + +/* + * Turn this object from old_type into DMU_OTN_ZAP_METADATA, and bump the + * refcount on SPA_FEATURE_EXTENSIBLE_DATASET. + * + * Only for use from syncing context, on MOS objects. + */ +void +dmu_object_zapify(objset_t *mos, uint64_t object, dmu_object_type_t old_type, + dmu_tx_t *tx) +{ + dnode_t *dn; + + ASSERT(dmu_tx_is_syncing(tx)); + + VERIFY0(dnode_hold(mos, object, FTAG, &dn)); + if (dn->dn_type == DMU_OTN_ZAP_METADATA) { + dnode_rele(dn, FTAG); + return; + } + ASSERT3U(dn->dn_type, ==, old_type); + ASSERT0(dn->dn_maxblkid); + dn->dn_next_type[tx->tx_txg & TXG_MASK] = dn->dn_type = + DMU_OTN_ZAP_METADATA; + dnode_setdirty(dn, tx); + dnode_rele(dn, FTAG); + + mzap_create_impl(mos, object, 0, 0, tx); + + spa_feature_incr(dmu_objset_spa(mos), + SPA_FEATURE_EXTENSIBLE_DATASET, tx); +} + +void +dmu_object_free_zapified(objset_t *mos, uint64_t object, dmu_tx_t *tx) +{ + dnode_t *dn; + dmu_object_type_t t; + + ASSERT(dmu_tx_is_syncing(tx)); + + VERIFY0(dnode_hold(mos, object, FTAG, &dn)); + t = dn->dn_type; + dnode_rele(dn, FTAG); + + if (t == DMU_OTN_ZAP_METADATA) { + spa_feature_decr(dmu_objset_spa(mos), + SPA_FEATURE_EXTENSIBLE_DATASET, tx); + } + VERIFY0(dmu_object_free(mos, object, tx)); +} Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Wed Mar 19 23:36:12 2014 (r263390) @@ -605,7 +605,7 @@ traverse_pool(spa_t *spa, uint64_t txg_s continue; } - if (doi.doi_type == DMU_OT_DSL_DATASET) { + if (doi.doi_bonus_type == DMU_OT_DSL_DATASET) { dsl_dataset_t *ds; uint64_t txg = txg_start; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Wed Mar 19 23:36:12 2014 (r263390) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -577,7 +577,12 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) BP_GET_LSIZE(&dnp->dn_blkptr[0]) == dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT); - if (dn->dn_next_blksz[txgoff]) { + if (dn->dn_next_type[txgoff] != 0) { + dnp->dn_type = dn->dn_type; + dn->dn_next_type[txgoff] = 0; + } + + if (dn->dn_next_blksz[txgoff] != 0) { ASSERT(P2PHASE(dn->dn_next_blksz[txgoff], SPA_MINBLOCKSIZE) == 0); ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[0]) || @@ -590,7 +595,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dn->dn_next_blksz[txgoff] = 0; } - if (dn->dn_next_bonuslen[txgoff]) { + if (dn->dn_next_bonuslen[txgoff] != 0) { if (dn->dn_next_bonuslen[txgoff] == DN_ZERO_BONUSLEN) dnp->dn_bonuslen = 0; else @@ -599,7 +604,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dn->dn_next_bonuslen[txgoff] = 0; } - if (dn->dn_next_bonustype[txgoff]) { + if (dn->dn_next_bonustype[txgoff] != 0) { ASSERT(DMU_OT_IS_VALID(dn->dn_next_bonustype[txgoff])); dnp->dn_bonustype = dn->dn_next_bonustype[txgoff]; dn->dn_next_bonustype[txgoff] = 0; @@ -617,7 +622,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dn->dn_rm_spillblk[txgoff] = 0; } - if (dn->dn_next_indblkshift[txgoff]) { + if (dn->dn_next_indblkshift[txgoff] != 0) { ASSERT(dnp->dn_nlevels == 1); dnp->dn_indblkshift = dn->dn_next_indblkshift[txgoff]; dn->dn_next_indblkshift[txgoff] = 0; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Mar 19 23:36:12 2014 (r263390) @@ -358,7 +358,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin /* Make sure dsobj has the correct object type. */ dmu_object_info_from_db(dbuf, &doi); - if (doi.doi_type != DMU_OT_DSL_DATASET) { + if (doi.doi_bonus_type != DMU_OT_DSL_DATASET) { dmu_buf_rele(dbuf, tag); return (SET_ERROR(EINVAL)); } @@ -3053,3 +3053,11 @@ dsl_dataset_is_before(dsl_dataset_t *lat dsl_dataset_rele(origin, FTAG); return (ret); } + + +void +dsl_dataset_zapify(dsl_dataset_t *ds, dmu_tx_t *tx) +{ + objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; + dmu_object_zapify(mos, ds->ds_object, DMU_OT_DSL_DATASET, tx); +} Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Wed Mar 19 23:36:12 2014 (r263390) @@ -38,6 +38,7 @@ #include #include #include +#include typedef struct dmu_snapshots_destroy_arg { nvlist_t *dsda_snaps; @@ -448,7 +449,7 @@ dsl_destroy_snapshot_sync_impl(dsl_datas VERIFY0(zap_destroy(mos, ds->ds_phys->ds_userrefs_obj, tx)); dsl_dir_rele(ds->ds_dir, ds); ds->ds_dir = NULL; - VERIFY0(dmu_object_free(mos, obj, tx)); + dmu_object_free_zapified(mos, obj, tx); } static void @@ -671,7 +672,7 @@ dsl_dir_destroy_sync(uint64_t ddobj, dmu dd->dd_parent->dd_phys->dd_child_dir_zapobj, dd->dd_myname, tx)); dsl_dir_rele(dd, FTAG); - VERIFY0(dmu_object_free(mos, ddobj, tx)); + dmu_object_free_zapified(mos, ddobj, tx); } void @@ -724,10 +725,6 @@ dsl_destroy_head_sync_impl(dsl_dataset_t ds->ds_prev->ds_phys->ds_num_children--; } - zfeature_info_t *async_destroy = - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]; - objset_t *os; - /* * Destroy the deadlist. Unless it's a clone, the * deadlist should be empty. (If it's a clone, it's @@ -738,9 +735,10 @@ dsl_destroy_head_sync_impl(dsl_dataset_t dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_phys->ds_deadlist_obj = 0; + objset_t *os; VERIFY0(dmu_objset_from_ds(ds, &os)); - if (!spa_feature_is_enabled(dp->dp_spa, async_destroy)) { + if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) { old_synchronous_dataset_destroy(ds, tx); } else { /* @@ -751,10 +749,11 @@ dsl_destroy_head_sync_impl(dsl_dataset_t zil_destroy_sync(dmu_objset_zil(os), tx); - if (!spa_feature_is_active(dp->dp_spa, async_destroy)) { + if (!spa_feature_is_active(dp->dp_spa, + SPA_FEATURE_ASYNC_DESTROY)) { dsl_scan_t *scn = dp->dp_scan; - - spa_feature_incr(dp->dp_spa, async_destroy, tx); + spa_feature_incr(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY, + tx); dp->dp_bptree_obj = bptree_alloc(mos, tx); VERIFY0(zap_add(mos, DMU_POOL_DIRECTORY_OBJECT, @@ -814,7 +813,7 @@ dsl_destroy_head_sync_impl(dsl_dataset_t ASSERT0(ds->ds_phys->ds_userrefs_obj); dsl_dir_rele(ds->ds_dir, ds); ds->ds_dir = NULL; - VERIFY0(dmu_object_free(mos, obj, tx)); + dmu_object_free_zapified(mos, obj, tx); dsl_dir_destroy_sync(ddobj, tx); @@ -870,8 +869,7 @@ dsl_destroy_head(const char *name) error = spa_open(name, &spa, FTAG); if (error != 0) return (error); - isenabled = spa_feature_is_enabled(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]); + isenabled = spa_feature_is_enabled(spa, SPA_FEATURE_ASYNC_DESTROY); spa_close(spa, FTAG); ddha.ddha_name = name; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Wed Mar 19 23:36:12 2014 (r263390) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -93,7 +94,7 @@ dsl_dir_hold_obj(dsl_pool_t *dp, uint64_ { dmu_object_info_t doi; dmu_object_info_from_db(dbuf, &doi); - ASSERT3U(doi.doi_type, ==, DMU_OT_DSL_DIR); + ASSERT3U(doi.doi_bonus_type, ==, DMU_OT_DSL_DIR); ASSERT3U(doi.doi_bonus_size, >=, sizeof (dsl_dir_phys_t)); } #endif @@ -1363,3 +1364,10 @@ dsl_dir_snap_cmtime_update(dsl_dir_t *dd dd->dd_snap_cmtime = t; mutex_exit(&dd->dd_lock); } + +void +dsl_dir_zapify(dsl_dir_t *dd, dmu_tx_t *tx) +{ + objset_t *mos = dd->dd_pool->dp_meta_objset; + dmu_object_zapify(mos, dd->dd_object, DMU_OT_DSL_DIR, tx); +} Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed Mar 19 23:36:12 2014 (r263390) @@ -278,8 +278,7 @@ dsl_pool_open(dsl_pool_t *dp) dp->dp_meta_objset, obj)); } - if (spa_feature_is_active(dp->dp_spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) { err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1, &dp->dp_bptree_obj); @@ -287,8 +286,7 @@ dsl_pool_open(dsl_pool_t *dp) goto out; } - if (spa_feature_is_active(dp->dp_spa, - &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ])) { + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_EMPTY_BPOBJ)) { err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, &dp->dp_empty_bpobj); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Wed Mar 19 23:36:12 2014 (r263390) @@ -132,7 +132,7 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t t */ ASSERT(!scn->scn_async_destroying); scn->scn_async_destroying = spa_feature_is_active(dp->dp_spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]); + SPA_FEATURE_ASYNC_DESTROY); err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, "scrub_func", sizeof (uint64_t), 1, &f); @@ -1387,7 +1387,6 @@ dsl_scan_active(dsl_scan_t *scn) return (B_FALSE); if (spa_shutting_down(spa)) return (B_FALSE); - if (scn->scn_phys.scn_state == DSS_SCANNING || scn->scn_async_destroying) return (B_TRUE); @@ -1446,7 +1445,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * VERIFY3U(0, ==, zio_wait(scn->scn_zio_root)); if (err == 0 && spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + SPA_FEATURE_ASYNC_DESTROY)) { ASSERT(scn->scn_async_destroying); scn->scn_is_bptree = B_TRUE; scn->scn_zio_root = zio_root(dp->dp_spa, NULL, @@ -1457,11 +1456,11 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * VERIFY0(zio_wait(scn->scn_zio_root)); if (err == 0) { - zfeature_info_t *feat = &spa_feature_table - [SPA_FEATURE_ASYNC_DESTROY]; /* finished; deactivate async destroy feature */ - spa_feature_decr(spa, feat, tx); - ASSERT(!spa_feature_is_active(spa, feat)); + spa_feature_decr(spa, SPA_FEATURE_ASYNC_DESTROY, + tx); + ASSERT(!spa_feature_is_active(spa, + SPA_FEATURE_ASYNC_DESTROY)); VERIFY0(zap_remove(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, tx)); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Mar 19 23:36:12 2014 (r263390) @@ -2352,14 +2352,12 @@ spa_load_impl(spa_t *spa, uint64_t pool_ enabled_feat = fnvlist_alloc(); unsup_feat = fnvlist_alloc(); - if (!feature_is_supported(spa->spa_meta_objset, - spa->spa_feat_for_read_obj, spa->spa_feat_desc_obj, + if (!spa_features_check(spa, B_FALSE, unsup_feat, enabled_feat)) missing_feat_read = B_TRUE; if (spa_writeable(spa) || state == SPA_LOAD_TRYIMPORT) { - if (!feature_is_supported(spa->spa_meta_objset, - spa->spa_feat_for_write_obj, spa->spa_feat_desc_obj, + if (!spa_features_check(spa, B_TRUE, unsup_feat, enabled_feat)) { missing_feat_write = B_TRUE; } @@ -6233,7 +6231,7 @@ spa_sync_props(void *arg, dmu_tx_t *tx) zpool_prop_t prop; const char *propname; zprop_type_t proptype; - zfeature_info_t *feature; + spa_feature_t fid; switch (prop = zpool_name_to_prop(nvpair_name(elem))) { case ZPROP_INVAL: @@ -6243,9 +6241,9 @@ spa_sync_props(void *arg, dmu_tx_t *tx) ASSERT(zpool_prop_feature(nvpair_name(elem))); fname = strchr(nvpair_name(elem), '@') + 1; - VERIFY0(zfeature_lookup_name(fname, &feature)); + VERIFY0(zfeature_lookup_name(fname, &fid)); - spa_feature_enable(spa, feature, tx); + spa_feature_enable(spa, fid, tx); spa_history_log_internal(spa, "set", tx, "%s=enabled", nvpair_name(elem)); break; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Wed Mar 19 23:36:12 2014 (r263390) @@ -1195,15 +1195,17 @@ spa_vdev_state_exit(spa_t *spa, vdev_t * void spa_activate_mos_feature(spa_t *spa, const char *feature) { - (void) nvlist_add_boolean(spa->spa_label_features, feature); - vdev_config_dirty(spa->spa_root_vdev); + if (!nvlist_exists(spa->spa_label_features, feature)) { + fnvlist_add_boolean(spa->spa_label_features, feature); + vdev_config_dirty(spa->spa_root_vdev); + } } void spa_deactivate_mos_feature(spa_t *spa, const char *feature) { - (void) nvlist_remove_all(spa->spa_label_features, feature); - vdev_config_dirty(spa->spa_root_vdev); + if (nvlist_remove_all(spa->spa_label_features, feature) == 0) + vdev_config_dirty(spa->spa_root_vdev); } /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Wed Mar 19 23:36:12 2014 (r263390) @@ -474,8 +474,6 @@ space_map_truncate(space_map_t *sm, dmu_ { objset_t *os = sm->sm_os; spa_t *spa = dmu_objset_spa(os); - zfeature_info_t *space_map_histogram = - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]; dmu_object_info_t doi; int bonuslen; @@ -485,7 +483,7 @@ space_map_truncate(space_map_t *sm, dmu_ VERIFY0(dmu_free_range(os, space_map_object(sm), 0, -1ULL, tx)); dmu_object_info_from_db(sm->sm_dbuf, &doi); - if (spa_feature_is_enabled(spa, space_map_histogram)) { + if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { bonuslen = sizeof (space_map_phys_t); ASSERT3U(bonuslen, <=, dmu_bonus_max()); } else { @@ -525,13 +523,11 @@ uint64_t space_map_alloc(objset_t *os, dmu_tx_t *tx) { spa_t *spa = dmu_objset_spa(os); - zfeature_info_t *space_map_histogram = - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]; uint64_t object; int bonuslen; - if (spa_feature_is_enabled(spa, space_map_histogram)) { - spa_feature_incr(spa, space_map_histogram, tx); + if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { + spa_feature_incr(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM, tx); bonuslen = sizeof (space_map_phys_t); ASSERT3U(bonuslen, <=, dmu_bonus_max()); } else { @@ -549,20 +545,20 @@ void space_map_free(space_map_t *sm, dmu_tx_t *tx) { spa_t *spa; - zfeature_info_t *space_map_histogram = - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]; if (sm == NULL) return; spa = dmu_objset_spa(sm->sm_os); - if (spa_feature_is_enabled(spa, space_map_histogram)) { + if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { dmu_object_info_t doi; dmu_object_info_from_db(sm->sm_dbuf, &doi); if (doi.doi_bonus_size != SPACE_MAP_SIZE_V0) { - VERIFY(spa_feature_is_active(spa, space_map_histogram)); - spa_feature_decr(spa, space_map_histogram, tx); + VERIFY(spa_feature_is_active(spa, + SPA_FEATURE_SPACEMAP_HISTOGRAM)); + spa_feature_decr(spa, + SPA_FEATURE_SPACEMAP_HISTOGRAM, tx); } } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Wed Mar 19 23:36:12 2014 (r263390) @@ -301,6 +301,8 @@ typedef struct dmu_sendarg { uint64_t dsa_last_data_offset; } dmu_sendarg_t; +void dmu_object_zapify(objset_t *, uint64_t, dmu_object_type_t, dmu_tx_t *); +void dmu_object_free_zapified(objset_t *, uint64_t, dmu_tx_t *); #ifdef __cplusplus } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Wed Mar 19 23:36:12 2014 (r263390) @@ -178,6 +178,7 @@ typedef struct dnode { uint16_t dn_datablkszsec; /* in 512b sectors */ uint32_t dn_datablksz; /* in bytes */ uint64_t dn_maxblkid; + uint8_t dn_next_type[TXG_SIZE]; uint8_t dn_next_nblkptr[TXG_SIZE]; uint8_t dn_next_nlevels[TXG_SIZE]; uint8_t dn_next_indblkshift[TXG_SIZE]; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Wed Mar 19 23:36:12 2014 (r263390) @@ -49,9 +49,9 @@ struct dsl_pool; #define DS_FLAG_INCONSISTENT (1ULL<<0) #define DS_IS_INCONSISTENT(ds) \ ((ds)->ds_phys->ds_flags & DS_FLAG_INCONSISTENT) + /* - * Note: nopromote can not yet be set, but we want support for it in this - * on-disk version, so that we don't need to upgrade for it later. + * Do not allow this dataset to be promoted. */ #define DS_FLAG_NOPROMOTE (1ULL<<1) @@ -71,6 +71,11 @@ struct dsl_pool; ((ds)->ds_phys->ds_flags & DS_FLAG_DEFER_DESTROY) /* + * DS_FIELD_* are strings that are used in the "extensified" dataset zap object. + * They should be of the format :. + */ + +/* * DS_FLAG_CI_DATASET is set if the dataset contains a file system whose * name lookups should be performed case-insensitively. */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Wed Mar 19 23:36:12 2014 (r263390) @@ -141,6 +141,12 @@ uint64_t zap_create_link(objset_t *os, d uint64_t parent_obj, const char *name, dmu_tx_t *tx); /* + * Initialize an already-allocated object. + */ +void mzap_create_impl(objset_t *os, uint64_t obj, int normflags, + zap_flags_t flags, dmu_tx_t *tx); + +/* * Create a new zapobj with no attributes from the given (unallocated) * object number. */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h Wed Mar 19 23:36:12 2014 (r263390) @@ -27,6 +27,7 @@ #define _SYS_ZFEATURE_H #include +#include #include "zfeature_common.h" #ifdef __cplusplus @@ -37,17 +38,25 @@ struct spa; struct dmu_tx; struct objset; -extern boolean_t feature_is_supported(struct objset *os, uint64_t obj, - uint64_t desc_obj, nvlist_t *unsup_feat, nvlist_t *enabled_feat); - extern void spa_feature_create_zap_objects(struct spa *, struct dmu_tx *); -extern void spa_feature_enable(struct spa *, zfeature_info_t *, +extern void spa_feature_enable(struct spa *, spa_feature_t, + struct dmu_tx *); +extern void spa_feature_incr(struct spa *, spa_feature_t, struct dmu_tx *); +extern void spa_feature_decr(struct spa *, spa_feature_t, struct dmu_tx *); +extern boolean_t spa_feature_is_enabled(struct spa *, spa_feature_t); +extern boolean_t spa_feature_is_active(struct spa *, spa_feature_t); +extern uint64_t spa_feature_refcount(spa_t *, spa_feature_t, uint64_t); +extern boolean_t spa_features_check(spa_t *, boolean_t, nvlist_t *, nvlist_t *); + +/* + * These functions are only exported for zhack and zdb; normal callers should + * use the above interfaces. + */ +extern int feature_get_refcount(struct spa *, zfeature_info_t *, uint64_t *); +extern void feature_enable_sync(struct spa *, zfeature_info_t *, + struct dmu_tx *); +extern void feature_sync(struct spa *, zfeature_info_t *, uint64_t, struct dmu_tx *); -extern void spa_feature_incr(struct spa *, zfeature_info_t *, struct dmu_tx *); -extern void spa_feature_decr(struct spa *, zfeature_info_t *, struct dmu_tx *); -extern boolean_t spa_feature_is_enabled(struct spa *, zfeature_info_t *); -extern boolean_t spa_feature_is_active(struct spa *, zfeature_info_t *); -extern int spa_feature_get_refcount(struct spa *, zfeature_info_t *); #ifdef __cplusplus } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Wed Mar 19 23:31:47 2014 (r263389) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Wed Mar 19 23:36:12 2014 (r263390) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 23:44:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A15372B7; Wed, 19 Mar 2014 23:44: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8ABF0EB5; Wed, 19 Mar 2014 23:44: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 s2JNi5MA003419; Wed, 19 Mar 2014 23:44:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JNi4Y1003411; Wed, 19 Mar 2014 23:44:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403192344.s2JNi4Y1003411@svn.freebsd.org> From: Xin LI Date: Wed, 19 Mar 2014 23:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263393 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzpool/common cddl/contrib/opensolaris/lib/libzpool/common/sys... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 23:44:05 -0000 Author: delphij Date: Wed Mar 19 23:44:03 2014 New Revision: 263393 URL: http://svnweb.freebsd.org/changeset/base/263393 Log: MFC r260138: MFV r242733: 3306 zdb should be able to issue reads in parallel 3321 'zpool reopen' command should be documented in the man page and help message illumos/illumos-gate@31d7e8fa33fae995f558673adb22641b5aa8b6e1 FreeBSD porting notes: the kernel part of this changeset depends on Solaris buf(9S) interfaces and are not really applicable for our use. vdev_disk.c is patched as-is to reduce diverge from upstream, but vdev_file.c is left intact. Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Wed Mar 19 23:40:08 2014 (r263392) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Wed Mar 19 23:44:03 2014 (r263393) @@ -14,11 +14,12 @@ .\" .\" Copyright 2012, Richard Lowe. .\" Copyright (c) 2012, Marcelo Araujo . +.\" Copyright (c) 2012 by Delphix. All rights reserved. .\" All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd May 10, 2012 +.Dd December 31, 2013 .Dt ZDB 8 .Os .Sh NAME @@ -29,27 +30,35 @@ .Op Fl CumdibcsDvhLXFPA .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 .Ar poolname .Op Ar object ... .Nm .Op Fl divPA .Op Fl e Op Fl p Ar path... +.Op Fl U Ar cache .Ar dataset .Op Ar object ... .Nm .Fl m Op Fl LXFPA .Op Fl t Ar txg .Op Fl e Op Fl p Ar path... +.Op Fl U Ar cache .Ar poolname .Nm .Fl R Op Fl A .Op Fl e Op Fl p Ar path... +.Op Fl U Ar cache +.Ar poolname .Ar poolname .Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags .Nm .Fl S .Op Fl AP .Op Fl e Op Fl p Ar path... +.Op Fl U Ar cache +.Ar poolname .Ar poolname .Nm .Fl l @@ -205,6 +214,11 @@ flag specifies the path under which devi .It Fl F Attempt to make an unreadable pool readable by trying progressively older transactions. +.It Fl M 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 +option. .It Fl P Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather than 1M. @@ -218,9 +232,7 @@ options for a means to see the available transaction numbers. .It Fl U Ar cachefile Use a cache file other than -.Pa /etc/zfs/zpool.cache . -This option is only valid with -.Fl C +.Pa /boot/zfs/zpool.cache . .It Fl v Enable verbosity. Specify multiple times for increased verbosity. Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Mar 19 23:40:08 2014 (r263392) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Mar 19 23:44:03 2014 (r263393) @@ -89,6 +89,7 @@ extern void dump_intent_log(zilog_t *); uint64_t *zopt_object = NULL; int zopt_objects = 0; libzfs_handle_t *g_zfs; +uint64_t max_inflight = 200; /* * These libumem hooks provide a reasonable set of defaults for the allocator's @@ -110,16 +111,17 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]]" - "poolname [object...]\n" - " %s [-divPA] [-e -p path...] dataset [object...]\n" - " %s -m [-LXFPA] [-t txg] [-e [-p path...]]" - "poolname [vdev [metaslab...]]\n" - " %s -R [-A] [-e [-p path...]] poolname " - "vdev:offset:size[:flags]\n" - " %s -S [-PA] [-e [-p path...]] poolname\n" - " %s -l [-uA] device\n" - " %s -C [-A] [-U config]\n\n", + "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " + "[-U config] [-M inflight I/Os] poolname [object...]\n" + " %s [-divPA] [-e -p path...] [-U config] dataset " + "[object...]\n" + " %s -m [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " + "poolname [vdev [metaslab...]]\n" + " %s -R [-A] [-e [-p path...]] poolname " + "vdev:offset:size[:flags]\n" + " %s -S [-PA] [-e [-p path...]] [-U config] poolname\n" + " %s -l [-uA] device\n" + " %s -C [-A] [-U config]\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); (void) fprintf(stderr, " Dataset name must include at least one " @@ -164,6 +166,8 @@ 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 -- " + "specify the maximum number of checksumming I/Os [default is 200]"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -2154,6 +2158,47 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t * bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0); } +/* ARGSUSED */ +static void +zdb_blkptr_done(zio_t *zio) +{ + spa_t *spa = zio->io_spa; + blkptr_t *bp = zio->io_bp; + int ioerr = zio->io_error; + zdb_cb_t *zcb = zio->io_private; + zbookmark_t *zb = &zio->io_bookmark; + + zio_data_buf_free(zio->io_data, zio->io_size); + + mutex_enter(&spa->spa_scrub_lock); + spa->spa_scrub_inflight--; + cv_broadcast(&spa->spa_scrub_io_cv); + + if (ioerr && !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) { + char blkbuf[BP_SPRINTF_LEN]; + + zcb->zcb_haderrors = 1; + zcb->zcb_errors[ioerr]++; + + if (dump_opt['b'] >= 2) + sprintf_blkptr(blkbuf, bp); + else + blkbuf[0] = '\0'; + + (void) printf("zdb_blkptr_cb: " + "Got error %d reading " + "<%llu, %llu, %lld, %llx> %s -- skipping\n", + ioerr, + (u_longlong_t)zb->zb_objset, + (u_longlong_t)zb->zb_object, + (u_longlong_t)zb->zb_level, + (u_longlong_t)zb->zb_blkid, + blkbuf); + } + mutex_exit(&spa->spa_scrub_lock); +} + +/* ARGSUSED */ static int zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) @@ -2174,38 +2219,22 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)); if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) { - int ioerr; size_t size = BP_GET_PSIZE(bp); - void *data = malloc(size); + void *data = zio_data_buf_alloc(size); int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW; /* If it's an intent log block, failure is expected. */ if (zb->zb_level == ZB_ZIL_LEVEL) flags |= ZIO_FLAG_SPECULATIVE; - ioerr = zio_wait(zio_read(NULL, spa, bp, data, size, - NULL, NULL, ZIO_PRIORITY_ASYNC_READ, flags, zb)); - - free(data); - if (ioerr && !(flags & ZIO_FLAG_SPECULATIVE)) { - zcb->zcb_haderrors = 1; - zcb->zcb_errors[ioerr]++; + mutex_enter(&spa->spa_scrub_lock); + while (spa->spa_scrub_inflight > max_inflight) + cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock); + spa->spa_scrub_inflight++; + mutex_exit(&spa->spa_scrub_lock); - if (dump_opt['b'] >= 2) - sprintf_blkptr(blkbuf, bp); - else - blkbuf[0] = '\0'; - - (void) printf("zdb_blkptr_cb: " - "Got error %d reading " - "<%llu, %llu, %lld, %llx> %s -- skipping\n", - ioerr, - (u_longlong_t)zb->zb_objset, - (u_longlong_t)zb->zb_object, - (u_longlong_t)zb->zb_level, - (u_longlong_t)zb->zb_blkid, - blkbuf); - } + zio_nowait(zio_read(NULL, spa, bp, data, size, + zdb_blkptr_done, zcb, ZIO_PRIORITY_ASYNC_READ, flags, zb)); } zcb->zcb_readfails = 0; @@ -2433,6 +2462,18 @@ dump_block_stats(spa_t *spa) zcb.zcb_start = zcb.zcb_lastprint = gethrtime(); zcb.zcb_haderrors |= traverse_pool(spa, 0, flags, zdb_blkptr_cb, &zcb); + /* + * If we've traversed the data blocks then we need to wait for those + * I/Os to complete. We leverage "The Godfather" zio to wait on + * all async I/Os to complete. + */ + if (dump_opt['c']) { + (void) zio_wait(spa->spa_async_zio_root); + spa->spa_async_zio_root = zio_root(spa, NULL, NULL, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | + ZIO_FLAG_GODFATHER); + } + if (zcb.zcb_haderrors) { (void) printf("\nError counts:\n\n"); (void) printf("\t%5s %s\n", "errno", "count"); @@ -3203,7 +3244,7 @@ main(int argc, char **argv) dprintf_setup(&argc, argv); - while ((c = getopt(argc, argv, "bcdhilmsuCDRSAFLXevp:t:U:P")) != -1) { + while ((c = getopt(argc, argv, "bcdhilmM:suCDRSAFLXevp:t:U:P")) != -1) { switch (c) { case 'b': case 'c': @@ -3232,6 +3273,15 @@ main(int argc, char **argv) case 'v': verbose++; break; + case 'M': + max_inflight = strtoull(optarg, NULL, 0); + if (max_inflight == 0) { + (void) fprintf(stderr, "maximum number " + "of inflight I/Os must be greater " + "than 0\n"); + usage(); + } + break; case 'p': if (searchdirs == NULL) { searchdirs = umem_alloc(sizeof (char *), Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Mar 19 23:40:08 2014 (r263392) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Wed Mar 19 23:44:03 2014 (r263393) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2013 +.Dd December 31, 2013 .Dt ZPOOL 8 .Os .Sh NAME @@ -141,6 +141,9 @@ .Cm remove .Ar pool device ... .Nm +.Cm reopen +.Ar pool +.Nm .Cm replace .Op Fl f .Ar pool device @@ -1431,6 +1434,13 @@ command. Non-redundant and devices cannot be removed from a pool. .It Xo .Nm +.Cm reopen +.Ar pool +.Xc +.Pp +Reopen all the vdevs associated with the pool. +.It Xo +.Nm .Cm replace .Op Fl f .Ar pool device Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Mar 19 23:40:08 2014 (r263392) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Mar 19 23:44:03 2014 (r263393) @@ -248,7 +248,7 @@ get_usage(zpool_help_t idx) { case HELP_REMOVE: return (gettext("\tremove ...\n")); case HELP_REOPEN: - return (""); /* Undocumented command */ + return (gettext("\treopen \n")); case HELP_SCRUB: return (gettext("\tscrub [-s] ...\n")); case HELP_STATUS: @@ -3720,22 +3720,37 @@ zpool_do_reguid(int argc, char **argv) * zpool reopen * * Reopen the pool so that the kernel can update the sizes of all vdevs. - * - * NOTE: This command is currently undocumented. If the command is ever - * exposed then the appropriate usage() messages will need to be made. */ int zpool_do_reopen(int argc, char **argv) { + int c; int ret = 0; zpool_handle_t *zhp; char *pool; + /* check options */ + while ((c = getopt(argc, argv, "")) != -1) { + switch (c) { + case '?': + (void) fprintf(stderr, gettext("invalid option '%c'\n"), + optopt); + usage(B_FALSE); + } + } + argc--; argv++; - if (argc != 1) - return (2); + if (argc < 1) { + (void) fprintf(stderr, gettext("missing pool name\n")); + usage(B_FALSE); + } + + if (argc > 1) { + (void) fprintf(stderr, gettext("too many arguments\n")); + usage(B_FALSE); + } pool = argv[0]; if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL) Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed Mar 19 23:40:08 2014 (r263392) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed Mar 19 23:44:03 2014 (r263393) @@ -661,7 +661,7 @@ __dprintf(const char *file, const char * if (dprintf_find_string("pid")) (void) printf("%d ", getpid()); if (dprintf_find_string("tid")) - (void) printf("%u ", thr_self()); + (void) printf("%ul ", thr_self()); #if 0 if (dprintf_find_string("cpu")) (void) printf("%u ", getcpuid()); @@ -1125,3 +1125,50 @@ zvol_create_minors(const char *name) return (0); } #endif + +#ifdef illumos +void +bioinit(buf_t *bp) +{ + bzero(bp, sizeof (buf_t)); +} + +void +biodone(buf_t *bp) +{ + if (bp->b_iodone != NULL) { + (*(bp->b_iodone))(bp); + return; + } + ASSERT((bp->b_flags & B_DONE) == 0); + bp->b_flags |= B_DONE; +} + +void +bioerror(buf_t *bp, int error) +{ + ASSERT(bp != NULL); + ASSERT(error >= 0); + + if (error != 0) { + bp->b_flags |= B_ERROR; + } else { + bp->b_flags &= ~B_ERROR; + } + bp->b_error = error; +} + + +int +geterror(struct buf *bp) +{ + int error = 0; + + if (bp->b_flags & B_ERROR) { + error = bp->b_error; + if (!error) + error = EIO; + } + return (error); +} +#endif Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Wed Mar 19 23:40:08 2014 (r263392) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Wed Mar 19 23:44:03 2014 (r263393) @@ -778,6 +778,38 @@ extern void cyclic_remove(cyclic_id_t); extern int cyclic_reprogram(cyclic_id_t, hrtime_t); #endif /* illumos */ +#ifdef illumos +/* + * Buf structure + */ +#define B_BUSY 0x0001 +#define B_DONE 0x0002 +#define B_ERROR 0x0004 +#define B_READ 0x0040 /* read when I/O occurs */ +#define B_WRITE 0x0100 /* non-read pseudo-flag */ + +typedef struct buf { + int b_flags; + size_t b_bcount; + union { + caddr_t b_addr; + } b_un; + + lldaddr_t _b_blkno; +#define b_lblkno _b_blkno._f + size_t b_resid; + size_t b_bufsize; + int (*b_iodone)(struct buf *); + int b_error; + void *b_private; +} buf_t; + +extern void bioinit(buf_t *); +extern void biodone(buf_t *); +extern void bioerror(buf_t *, int); +extern int geterror(buf_t *); +#endif + #ifdef __cplusplus } #endif Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed Mar 19 23:40:08 2014 (r263392) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed Mar 19 23:44:03 2014 (r263393) @@ -359,6 +359,16 @@ extern void vdev_set_min_asize(vdev_t *v /* zdb uses this tunable, so it must be declared here to make lint happy. */ extern int zfs_vdev_cache_size; +#ifdef illumos +/* + * The vdev_buf_t is used to translate between zio_t and buf_t, and back again. + */ +typedef struct vdev_buf { + buf_t vb_buf; /* buffer that describes the io */ + zio_t *vb_io; /* pointer back to the original zio_t */ +} vdev_buf_t; +#endif + #ifdef __cplusplus } #endif Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Wed Mar 19 23:40:08 2014 (r263392) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Wed Mar 19 23:44:03 2014 (r263393) @@ -42,11 +42,6 @@ extern ldi_ident_t zfs_li; -typedef struct vdev_disk_buf { - buf_t vdb_buf; - zio_t *vdb_io; -} vdev_disk_buf_t; - static void vdev_disk_hold(vdev_t *vd) { @@ -483,8 +478,8 @@ vdev_disk_ldi_physio(ldi_handle_t vd_lh, static void vdev_disk_io_intr(buf_t *bp) { - vdev_disk_buf_t *vdb = (vdev_disk_buf_t *)bp; - zio_t *zio = vdb->vdb_io; + vdev_buf_t *vb = (vdev_buf_t *)bp; + zio_t *zio = vb->vb_io; /* * The rest of the zio stack only deals with EIO, ECKSUM, and ENXIO. @@ -496,7 +491,7 @@ vdev_disk_io_intr(buf_t *bp) if (zio->io_error == 0 && bp->b_resid != 0) zio->io_error = SET_ERROR(EIO); - kmem_free(vdb, sizeof (vdev_disk_buf_t)); + kmem_free(vb, sizeof (vdev_buf_t)); zio_interrupt(zio); } @@ -527,7 +522,7 @@ vdev_disk_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; vdev_disk_t *dvd = vd->vdev_tsd; - vdev_disk_buf_t *vdb; + vdev_buf_t *vb; struct dk_callback *dkc; buf_t *bp; int error; @@ -591,10 +586,10 @@ vdev_disk_io_start(zio_t *zio) return (ZIO_PIPELINE_CONTINUE); } - vdb = kmem_alloc(sizeof (vdev_disk_buf_t), KM_SLEEP); + vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); - vdb->vdb_io = zio; - bp = &vdb->vdb_buf; + vb->vb_io = zio; + bp = &vb->vb_buf; bioinit(bp); bp->b_flags = B_BUSY | B_NOCACHE | From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 23:50:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F1054754; Wed, 19 Mar 2014 23:50: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1457EFD; Wed, 19 Mar 2014 23:50: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 s2JNoDT2004350; Wed, 19 Mar 2014 23:50:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JNoDG6004348; Wed, 19 Mar 2014 23:50:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403192350.s2JNoDG6004348@svn.freebsd.org> From: Xin LI Date: Wed, 19 Mar 2014 23:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263395 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 23:50:14 -0000 Author: delphij Date: Wed Mar 19 23:50:13 2014 New Revision: 263395 URL: http://svnweb.freebsd.org/changeset/base/263395 Log: MFC r260141: MFV r258385: (Note: this change is not applicable to FreeBSD and the file is not included in build. It's integrated for completeness). 4128 disks in zpools never go away when pulled illumos/illumos-gate@39cddb10a31c1c2e66aed69e6871d09caa4c8147 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h Wed Mar 19 23:46:59 2014 (r263394) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h Wed Mar 19 23:50:13 2014 (r263395) @@ -22,6 +22,7 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright (c) 2013 Joyent, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SYS_VDEV_DISK_H @@ -44,6 +45,8 @@ typedef struct vdev_disk { ddi_devid_t vd_devid; char *vd_minor; ldi_handle_t vd_lh; + list_t vd_ldi_cbs; + boolean_t vd_ldi_offline; } vdev_disk_t; #endif Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Wed Mar 19 23:46:59 2014 (r263394) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Wed Mar 19 23:50:13 2014 (r263395) @@ -22,7 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. - * Copyright 2013 Joyent, Inc. All rights reserved. + * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ #include @@ -42,6 +42,146 @@ extern ldi_ident_t zfs_li; +static void vdev_disk_close(vdev_t *); + +typedef struct vdev_disk_ldi_cb { + list_node_t lcb_next; + ldi_callback_id_t lcb_id; +} vdev_disk_ldi_cb_t; + +static void +vdev_disk_alloc(vdev_t *vd) +{ + vdev_disk_t *dvd; + + dvd = vd->vdev_tsd = kmem_zalloc(sizeof (vdev_disk_t), KM_SLEEP); + /* + * Create the LDI event callback list. + */ + list_create(&dvd->vd_ldi_cbs, sizeof (vdev_disk_ldi_cb_t), + offsetof(vdev_disk_ldi_cb_t, lcb_next)); +} + +static void +vdev_disk_free(vdev_t *vd) +{ + vdev_disk_t *dvd = vd->vdev_tsd; + vdev_disk_ldi_cb_t *lcb; + + if (dvd == NULL) + return; + + /* + * We have already closed the LDI handle. Clean up the LDI event + * callbacks and free vd->vdev_tsd. + */ + while ((lcb = list_head(&dvd->vd_ldi_cbs)) != NULL) { + list_remove(&dvd->vd_ldi_cbs, lcb); + (void) ldi_ev_remove_callbacks(lcb->lcb_id); + kmem_free(lcb, sizeof (vdev_disk_ldi_cb_t)); + } + list_destroy(&dvd->vd_ldi_cbs); + kmem_free(dvd, sizeof (vdev_disk_t)); + vd->vdev_tsd = NULL; +} + +/* ARGSUSED */ +static int +vdev_disk_off_notify(ldi_handle_t lh, ldi_ev_cookie_t ecookie, void *arg, + void *ev_data) +{ + vdev_t *vd = (vdev_t *)arg; + vdev_disk_t *dvd = vd->vdev_tsd; + + /* + * Ignore events other than offline. + */ + if (strcmp(ldi_ev_get_type(ecookie), LDI_EV_OFFLINE) != 0) + return (LDI_EV_SUCCESS); + + /* + * All LDI handles must be closed for the state change to succeed, so + * call on vdev_disk_close() to do this. + * + * We inform vdev_disk_close that it is being called from offline + * notify context so it will defer cleanup of LDI event callbacks and + * freeing of vd->vdev_tsd to the offline finalize or a reopen. + */ + dvd->vd_ldi_offline = B_TRUE; + vdev_disk_close(vd); + + /* + * Now that the device is closed, request that the spa_async_thread + * mark the device as REMOVED and notify FMA of the removal. + */ + zfs_post_remove(vd->vdev_spa, vd); + vd->vdev_remove_wanted = B_TRUE; + spa_async_request(vd->vdev_spa, SPA_ASYNC_REMOVE); + + return (LDI_EV_SUCCESS); +} + +/* ARGSUSED */ +static void +vdev_disk_off_finalize(ldi_handle_t lh, ldi_ev_cookie_t ecookie, + int ldi_result, void *arg, void *ev_data) +{ + vdev_t *vd = (vdev_t *)arg; + + /* + * Ignore events other than offline. + */ + if (strcmp(ldi_ev_get_type(ecookie), LDI_EV_OFFLINE) != 0) + return; + + /* + * We have already closed the LDI handle in notify. + * Clean up the LDI event callbacks and free vd->vdev_tsd. + */ + vdev_disk_free(vd); + + /* + * Request that the vdev be reopened if the offline state change was + * unsuccessful. + */ + if (ldi_result != LDI_EV_SUCCESS) { + vd->vdev_probe_wanted = B_TRUE; + spa_async_request(vd->vdev_spa, SPA_ASYNC_PROBE); + } +} + +static ldi_ev_callback_t vdev_disk_off_callb = { + .cb_vers = LDI_EV_CB_VERS, + .cb_notify = vdev_disk_off_notify, + .cb_finalize = vdev_disk_off_finalize +}; + +/* ARGSUSED */ +static void +vdev_disk_dgrd_finalize(ldi_handle_t lh, ldi_ev_cookie_t ecookie, + int ldi_result, void *arg, void *ev_data) +{ + vdev_t *vd = (vdev_t *)arg; + + /* + * Ignore events other than degrade. + */ + if (strcmp(ldi_ev_get_type(ecookie), LDI_EV_DEGRADE) != 0) + return; + + /* + * Degrade events always succeed. Mark the vdev as degraded. + * This status is purely informative for the user. + */ + (void) vdev_degrade(vd->vdev_spa, vd->vdev_guid, 0); +} + +static ldi_ev_callback_t vdev_disk_dgrd_callb = { + .cb_vers = LDI_EV_CB_VERS, + .cb_notify = NULL, + .cb_finalize = vdev_disk_dgrd_finalize +}; + static void vdev_disk_hold(vdev_t *vd) { @@ -146,7 +286,9 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi uint64_t *ashift) { spa_t *spa = vd->vdev_spa; - vdev_disk_t *dvd; + vdev_disk_t *dvd = vd->vdev_tsd; + ldi_ev_cookie_t ecookie; + vdev_disk_ldi_cb_t *lcb; union { struct dk_minfo_ext ude; struct dk_minfo ud; @@ -172,13 +314,25 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi * Reopen the device if it's not currently open. Otherwise, * just update the physical size of the device. */ - if (vd->vdev_tsd != NULL) { - ASSERT(vd->vdev_reopening); - dvd = vd->vdev_tsd; - goto skip_open; + if (dvd != NULL) { + if (dvd->vd_ldi_offline && dvd->vd_lh == NULL) { + /* + * If we are opening a device in its offline notify + * context, the LDI handle was just closed. Clean + * up the LDI event callbacks and free vd->vdev_tsd. + */ + vdev_disk_free(vd); + } else { + ASSERT(vd->vdev_reopening); + goto skip_open; + } } - dvd = vd->vdev_tsd = kmem_zalloc(sizeof (vdev_disk_t), KM_SLEEP); + /* + * Create vd->vdev_tsd. + */ + vdev_disk_alloc(vd); + dvd = vd->vdev_tsd; /* * When opening a disk device, we want to preserve the user's original @@ -211,23 +365,28 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi if (vd->vdev_wholedisk == -1ULL) { size_t len = strlen(vd->vdev_path) + 3; char *buf = kmem_alloc(len, KM_SLEEP); - ldi_handle_t lh; (void) snprintf(buf, len, "%ss0", vd->vdev_path); - if (ldi_open_by_name(buf, spa_mode(spa), kcred, - &lh, zfs_li) == 0) { + error = ldi_open_by_name(buf, spa_mode(spa), kcred, + &dvd->vd_lh, zfs_li); + if (error == 0) { spa_strfree(vd->vdev_path); vd->vdev_path = buf; vd->vdev_wholedisk = 1ULL; - (void) ldi_close(lh, spa_mode(spa), kcred); } else { kmem_free(buf, len); } } - error = ldi_open_by_name(vd->vdev_path, spa_mode(spa), kcred, - &dvd->vd_lh, zfs_li); + /* + * If we have not yet opened the device, try to open it by the + * specified path. + */ + if (error != 0) { + error = ldi_open_by_name(vd->vdev_path, spa_mode(spa), + kcred, &dvd->vd_lh, zfs_li); + } /* * Compare the devid to the stored value. @@ -334,6 +493,27 @@ vdev_disk_open(vdev_t *vd, uint64_t *psi kmem_free(physpath, MAXPATHLEN); } + /* + * Register callbacks for the LDI offline event. + */ + if (ldi_ev_get_cookie(dvd->vd_lh, LDI_EV_OFFLINE, &ecookie) == + LDI_EV_SUCCESS) { + lcb = kmem_zalloc(sizeof (vdev_disk_ldi_cb_t), KM_SLEEP); + list_insert_tail(&dvd->vd_ldi_cbs, lcb); + (void) ldi_ev_register_callbacks(dvd->vd_lh, ecookie, + &vdev_disk_off_callb, (void *) vd, &lcb->lcb_id); + } + + /* + * Register callbacks for the LDI degrade event. + */ + if (ldi_ev_get_cookie(dvd->vd_lh, LDI_EV_DEGRADE, &ecookie) == + LDI_EV_SUCCESS) { + lcb = kmem_zalloc(sizeof (vdev_disk_ldi_cb_t), KM_SLEEP); + list_insert_tail(&dvd->vd_ldi_cbs, lcb); + (void) ldi_ev_register_callbacks(dvd->vd_lh, ecookie, + &vdev_disk_dgrd_callb, (void *) vd, &lcb->lcb_id); + } skip_open: /* * Determine the actual size of the device. @@ -412,18 +592,31 @@ vdev_disk_close(vdev_t *vd) if (vd->vdev_reopening || dvd == NULL) return; - if (dvd->vd_minor != NULL) + if (dvd->vd_minor != NULL) { ddi_devid_str_free(dvd->vd_minor); + dvd->vd_minor = NULL; + } - if (dvd->vd_devid != NULL) + if (dvd->vd_devid != NULL) { ddi_devid_free(dvd->vd_devid); + dvd->vd_devid = NULL; + } - if (dvd->vd_lh != NULL) + if (dvd->vd_lh != NULL) { (void) ldi_close(dvd->vd_lh, spa_mode(vd->vdev_spa), kcred); + dvd->vd_lh = NULL; + } vd->vdev_delayed_close = B_FALSE; - kmem_free(dvd, sizeof (vdev_disk_t)); - vd->vdev_tsd = NULL; + /* + * If we closed the LDI handle due to an offline notify from LDI, + * don't free vd->vdev_tsd or unregister the callbacks here; + * the offline finalize callback or a reopen will take care of it. + */ + if (dvd->vd_ldi_offline) + return; + + vdev_disk_free(vd); } int @@ -432,6 +625,13 @@ vdev_disk_physio(vdev_t *vd, caddr_t dat { vdev_disk_t *dvd = vd->vdev_tsd; + /* + * If the vdev is closed, it's likely in the REMOVED or FAULTED state. + * Nothing to be done here but return failure. + */ + if (dvd == NULL || (dvd->vd_ldi_offline && dvd->vd_lh == NULL)) + return (EIO); + ASSERT(vd->vdev_ops == &vdev_disk_ops); /* @@ -527,6 +727,15 @@ vdev_disk_io_start(zio_t *zio) buf_t *bp; int error; + /* + * If the vdev is closed, it's likely in the REMOVED or FAULTED state. + * Nothing to be done here but return failure. + */ + if (dvd == NULL || (dvd->vd_ldi_offline && dvd->vd_lh == NULL)) { + zio->io_error = ENXIO; + return (ZIO_PIPELINE_CONTINUE); + } + if (zio->io_type == ZIO_TYPE_IOCTL) { /* XXPOLICY */ if (!vdev_readable(vd)) { From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 19 23:55:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4B06DB62; Wed, 19 Mar 2014 23:55: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3417AFB1; Wed, 19 Mar 2014 23:55: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 s2JNt65q007856; Wed, 19 Mar 2014 23:55:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JNt3S6007840; Wed, 19 Mar 2014 23:55:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403192355.s2JNt3S6007840@svn.freebsd.org> From: Xin LI Date: Wed, 19 Mar 2014 23:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263397 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool lib/libprocstat/zfs sys/boot/zfs sys/cddl/boot/zfs sys/cdd... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 23:55:06 -0000 Author: delphij Date: Wed Mar 19 23:55:03 2014 New Revision: 263397 URL: http://svnweb.freebsd.org/changeset/base/263397 Log: MFC r260150: MFV r259170: 4370 avoid transmitting holes during zfs send 4371 DMU code clean up illumos/illumos-gate@43466aae47bfcd2ad9bf501faec8e75c08095e4f NOTE: Make sure the boot code is updated if a zpool upgrade is done on boot zpool. Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/10/lib/libprocstat/zfs/Makefile stable/10/sys/boot/zfs/zfsimpl.c stable/10/sys/cddl/boot/zfs/zfsimpl.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Mar 19 23:55:03 2014 (r263397) @@ -764,7 +764,7 @@ dump_dde(const ddt_t *ddt, const ddt_ent if (ddp->ddp_phys_birth == 0) continue; ddt_bp_create(ddt->ddt_checksum, ddk, ddp, &blk); - sprintf_blkptr(blkbuf, &blk); + snprintf_blkptr(blkbuf, sizeof (blkbuf), &blk); (void) printf("index %llx refcnt %llu %s %s\n", (u_longlong_t)index, (u_longlong_t)ddp->ddp_refcnt, types[p], blkbuf); @@ -1024,31 +1024,39 @@ blkid2offset(const dnode_phys_t *dnp, co } static void -sprintf_blkptr_compact(char *blkbuf, const blkptr_t *bp) +snprintf_blkptr_compact(char *blkbuf, size_t buflen, const blkptr_t *bp) { const dva_t *dva = bp->blk_dva; int ndvas = dump_opt['d'] > 5 ? BP_GET_NDVAS(bp) : 1; if (dump_opt['b'] >= 6) { - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, buflen, bp); return; } blkbuf[0] = '\0'; for (int i = 0; i < ndvas; i++) - (void) sprintf(blkbuf + strlen(blkbuf), "%llu:%llx:%llx ", + (void) snprintf(blkbuf + strlen(blkbuf), + buflen - strlen(blkbuf), "%llu:%llx:%llx ", (u_longlong_t)DVA_GET_VDEV(&dva[i]), (u_longlong_t)DVA_GET_OFFSET(&dva[i]), (u_longlong_t)DVA_GET_ASIZE(&dva[i])); - (void) sprintf(blkbuf + strlen(blkbuf), - "%llxL/%llxP F=%llu B=%llu/%llu", - (u_longlong_t)BP_GET_LSIZE(bp), - (u_longlong_t)BP_GET_PSIZE(bp), - (u_longlong_t)bp->blk_fill, - (u_longlong_t)bp->blk_birth, - (u_longlong_t)BP_PHYSICAL_BIRTH(bp)); + if (BP_IS_HOLE(bp)) { + (void) snprintf(blkbuf + strlen(blkbuf), + buflen - strlen(blkbuf), "B=%llu", + (u_longlong_t)bp->blk_birth); + } else { + (void) snprintf(blkbuf + strlen(blkbuf), + buflen - strlen(blkbuf), + "%llxL/%llxP F=%llu B=%llu/%llu", + (u_longlong_t)BP_GET_LSIZE(bp), + (u_longlong_t)BP_GET_PSIZE(bp), + (u_longlong_t)bp->blk_fill, + (u_longlong_t)bp->blk_birth, + (u_longlong_t)BP_PHYSICAL_BIRTH(bp)); + } } static void @@ -1073,7 +1081,7 @@ print_indirect(blkptr_t *bp, const zbook } } - sprintf_blkptr_compact(blkbuf, bp); + snprintf_blkptr_compact(blkbuf, sizeof (blkbuf), bp); (void) printf("%s\n", blkbuf); } @@ -1088,7 +1096,7 @@ visit_indirect(spa_t *spa, const dnode_p print_indirect(bp, zb, dnp); - if (BP_GET_LEVEL(bp) > 0) { + if (BP_GET_LEVEL(bp) > 0 && !BP_IS_HOLE(bp)) { uint32_t flags = ARC_WAIT; int i; blkptr_t *cbp; @@ -1213,7 +1221,7 @@ dump_dsl_dataset(objset_t *os, uint64_t zdb_nicenum(ds->ds_compressed_bytes, compressed); zdb_nicenum(ds->ds_uncompressed_bytes, uncompressed); zdb_nicenum(ds->ds_unique_bytes, unique); - sprintf_blkptr(blkbuf, &ds->ds_bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), &ds->ds_bp); (void) printf("\t\tdir_obj = %llu\n", (u_longlong_t)ds->ds_dir_obj); @@ -1258,7 +1266,7 @@ dump_bptree_cb(void *arg, const blkptr_t char blkbuf[BP_SPRINTF_LEN]; if (bp->blk_birth != 0) { - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); (void) printf("\t%s\n", blkbuf); } return (0); @@ -1296,7 +1304,7 @@ dump_bpobj_cb(void *arg, const blkptr_t char blkbuf[BP_SPRINTF_LEN]; ASSERT(bp->blk_birth != 0); - sprintf_blkptr_compact(blkbuf, bp); + snprintf_blkptr_compact(blkbuf, sizeof (blkbuf), bp); (void) printf("\t%s\n", blkbuf); return (0); } @@ -1795,8 +1803,9 @@ dump_dir(objset_t *os) zdb_nicenum(refdbytes, numbuf); if (verbosity >= 4) { - (void) sprintf(blkbuf, ", rootbp "); - (void) sprintf_blkptr(blkbuf + strlen(blkbuf), os->os_rootbp); + (void) snprintf(blkbuf, sizeof (blkbuf), ", rootbp "); + (void) snprintf_blkptr(blkbuf + strlen(blkbuf), + sizeof (blkbuf) - strlen(blkbuf), os->os_rootbp); } else { blkbuf[0] = '\0'; } @@ -1826,7 +1835,7 @@ dump_dir(objset_t *os) if (verbosity < 2) return; - if (os->os_rootbp->blk_birth == 0) + if (BP_IS_HOLE(os->os_rootbp)) return; dump_object(os, 0, verbosity, &print_header); @@ -1867,7 +1876,7 @@ dump_uberblock(uberblock_t *ub, const ch (u_longlong_t)ub->ub_timestamp, asctime(localtime(×tamp))); if (dump_opt['u'] >= 3) { char blkbuf[BP_SPRINTF_LEN]; - sprintf_blkptr(blkbuf, &ub->ub_rootbp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), &ub->ub_rootbp); (void) printf("\trootbp = %s\n", blkbuf); } (void) printf(footer ? footer : ""); @@ -2181,7 +2190,7 @@ zdb_blkptr_done(zio_t *zio) zcb->zcb_errors[ioerr]++; if (dump_opt['b'] >= 2) - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); else blkbuf[0] = '\0'; @@ -2204,11 +2213,22 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { zdb_cb_t *zcb = arg; - char blkbuf[BP_SPRINTF_LEN]; dmu_object_type_t type; boolean_t is_metadata; - if (bp == NULL) + if (dump_opt['b'] >= 5 && bp->blk_birth > 0) { + char blkbuf[BP_SPRINTF_LEN]; + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); + (void) printf("objset %llu object %llu " + "level %lld offset 0x%llx %s\n", + (u_longlong_t)zb->zb_objset, + (u_longlong_t)zb->zb_object, + (longlong_t)zb->zb_level, + (u_longlong_t)blkid2offset(dnp, bp, zb), + blkbuf); + } + + if (BP_IS_HOLE(bp)) return (0); type = BP_GET_TYPE(bp); @@ -2239,17 +2259,6 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog zcb->zcb_readfails = 0; - if (dump_opt['b'] >= 5) { - sprintf_blkptr(blkbuf, bp); - (void) printf("objset %llu object %llu " - "level %lld offset 0x%llx %s\n", - (u_longlong_t)zb->zb_objset, - (u_longlong_t)zb->zb_object, - (longlong_t)zb->zb_level, - (u_longlong_t)blkid2offset(dnp, bp, zb), - blkbuf); - } - if (dump_opt['b'] < 5 && isatty(STDERR_FILENO) && gethrtime() > zcb->zcb_lastprint + NANOSEC) { uint64_t now = gethrtime(); @@ -2406,7 +2415,7 @@ count_block_cb(void *arg, const blkptr_t if (dump_opt['b'] >= 5) { char blkbuf[BP_SPRINTF_LEN]; - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); (void) printf("[%s] %s\n", "deferred free", blkbuf); } @@ -2640,7 +2649,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo avl_index_t where; zdb_ddt_entry_t *zdde, zdde_search; - if (bp == NULL) + if (BP_IS_HOLE(bp)) return (0); if (dump_opt['S'] > 1 && zb->zb_level == ZB_ROOT_LEVEL) { @@ -2807,7 +2816,7 @@ zdb_print_blkptr(blkptr_t *bp, int flags if (flags & ZDB_FLAG_BSWAP) byteswap_uint64_array((void *)bp, sizeof (blkptr_t)); - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); (void) printf("%s\n", blkbuf); } Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Wed Mar 19 23:55:03 2014 (r263397) @@ -24,6 +24,10 @@ */ /* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + +/* * Print intent log header and statistics. */ @@ -47,7 +51,7 @@ print_log_bp(const blkptr_t *bp, const c { char blkbuf[BP_SPRINTF_LEN]; - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); (void) printf("%s%s\n", prefix, blkbuf); } @@ -132,6 +136,7 @@ zil_prt_rec_write(zilog_t *zilog, int tx if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) { (void) printf("%shas blkptr, %s\n", prefix, + !BP_IS_HOLE(bp) && bp->blk_birth >= spa_first_txg(zilog->zl_spa) ? "will claim" : "won't claim"); print_log_bp(bp, prefix); @@ -139,8 +144,6 @@ zil_prt_rec_write(zilog_t *zilog, int tx if (BP_IS_HOLE(bp)) { (void) printf("\t\t\tLSIZE 0x%llx\n", (u_longlong_t)BP_GET_LSIZE(bp)); - } - if (bp->blk_birth == 0) { bzero(buf, sizeof (buf)); (void) printf("%s\n", prefix); return; @@ -313,7 +316,8 @@ print_log_block(zilog_t *zilog, blkptr_t if (verbose >= 5) { (void) strcpy(blkbuf, ", "); - sprintf_blkptr(blkbuf + strlen(blkbuf), bp); + snprintf_blkptr(blkbuf + strlen(blkbuf), + sizeof (blkbuf) - strlen(blkbuf), bp); } else { blkbuf[0] = '\0'; } @@ -361,7 +365,7 @@ dump_intent_log(zilog_t *zilog) int verbose = MAX(dump_opt['d'], dump_opt['i']); int i; - if (zh->zh_log.blk_birth == 0 || verbose < 1) + if (BP_IS_HOLE(&zh->zh_log) || verbose < 1) return; (void) printf("\n ZIL header: claim_txg %llu, " Modified: stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c Wed Mar 19 23:55:03 2014 (r263397) @@ -277,6 +277,9 @@ zhack_do_feature_stat(int argc, char **a dump_obj(os, spa->spa_feat_for_read_obj, "for_read"); dump_obj(os, spa->spa_feat_for_write_obj, "for_write"); dump_obj(os, spa->spa_feat_desc_obj, "descriptions"); + if (spa_feature_is_active(spa, SPA_FEATURE_ENABLED_TXG)) { + dump_obj(os, spa->spa_feat_enabled_txg_obj, "enabled_txg"); + } dump_mos(spa); spa_close(spa, FTAG); @@ -313,7 +316,9 @@ zhack_do_feature_enable(int argc, char * feature.fi_uname = "zhack"; feature.fi_mos = B_FALSE; feature.fi_can_readonly = B_FALSE; + feature.fi_activate_on_enable = B_FALSE; feature.fi_depends = nodeps; + feature.fi_feature = SPA_FEATURE_NONE; optind = 1; while ((c = getopt(argc, argv, "rmd:")) != -1) { @@ -371,7 +376,7 @@ feature_incr_sync(void *arg, dmu_tx_t *t zfeature_info_t *feature = arg; uint64_t refcount; - VERIFY0(feature_get_refcount(spa, feature, &refcount)); + VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount)); feature_sync(spa, feature, refcount + 1, tx); spa_history_log_internal(spa, "zhack feature incr", tx, "name=%s", feature->fi_guid); @@ -384,7 +389,7 @@ feature_decr_sync(void *arg, dmu_tx_t *t zfeature_info_t *feature = arg; uint64_t refcount; - VERIFY0(feature_get_refcount(spa, feature, &refcount)); + VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount)); feature_sync(spa, feature, refcount - 1, tx); spa_history_log_internal(spa, "zhack feature decr", tx, "name=%s", feature->fi_guid); @@ -411,6 +416,7 @@ zhack_do_feature_ref(int argc, char **ar feature.fi_mos = B_FALSE; feature.fi_desc = NULL; feature.fi_depends = nodeps; + feature.fi_feature = SPA_FEATURE_NONE; optind = 1; while ((c = getopt(argc, argv, "md")) != -1) { @@ -459,8 +465,8 @@ zhack_do_feature_ref(int argc, char **ar if (decr) { uint64_t count; - if (feature_get_refcount(spa, &feature, &count) == 0 && - count != 0) { + if (feature_get_refcount_from_disk(spa, &feature, + &count) == 0 && count != 0) { fatal(spa, FTAG, "feature refcount already 0: %s", feature.fi_guid); } Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Wed Mar 19 23:55:03 2014 (r263397) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 08, 2013 +.Dd December 31, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -286,6 +286,76 @@ and will be returned to the .Sy enabled state when all datasets that use this feature are destroyed. +.It Sy enabled_txg +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:enabled_txg" +.It GUID Ta com.delphix:enabled_txg +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +Once this feature is enabled ZFS records the transaction group number +in which new features are enabled. This has no user-visible impact, +but other features may depend on this feature. +.Pp +This feature becomes +.Sy active +as soon as it is enabled and will +never return to being +.Sy enabled . +.It Sy hole_birth +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:hole_birth" +.It GUID Ta com.delphix:hole_birth +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta enabled_txg +.El +.Pp +This feature improves performance of incremental sends +.Pq Dq zfs send -i +and receives for objects with many holes. +The most common case of +hole-filled objects is zvols. +.Pp +An incremental send stream from snapshot +.Sy A +to snapshot +.Sy B +contains information about every block that changed between +.Sy A +and +.Sy B . +Blocks which did not change between those snapshots can be +identified and omitted from the stream using a piece of metadata called +the 'block birth time', but birth times are not recorded for holes +.Pq blocks filled only with zeroes . +Since holes created after +.Sy A +cannot be +distinguished from holes created before +.Sy A , +information about every +hole in the entire filesystem or zvol is included in the send stream. +.Pp +For workloads where holes are rare this is not a problem. +However, when +incrementally replicating filesystems or zvols with many holes +.Pq for example a zvol formatted with another filesystem +a lot of time will +be spent sending and receiving unnecessary information about holes that +already exist on the receiving side. +.Pp +Once the +.Sy hole_birth +feature has been enabled the block birth times +of all new holes will be recorded. +Incremental sends between snapshots +created after this feature is enabled will use this new metadata to avoid +sending information about holes that already exist on the receiving side. +.Pp +This feature becomes +.Sy active +as soon as it is enabled and will +never return to being +.Sy enabled . .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/10/lib/libprocstat/zfs/Makefile ============================================================================== --- stable/10/lib/libprocstat/zfs/Makefile Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/lib/libprocstat/zfs/Makefile Wed Mar 19 23:55:03 2014 (r263397) @@ -10,6 +10,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys Modified: stable/10/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/10/sys/boot/zfs/zfsimpl.c Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/sys/boot/zfs/zfsimpl.c Wed Mar 19 23:55:03 2014 (r263397) @@ -53,6 +53,9 @@ static vdev_list_t zfs_vdevs; * List of ZFS features supported for read */ static const char *features_for_read[] = { + "org.illumos:lz4_compress", + "com.delphix:hole_birth", + "com.delphix:extensible_dataset", NULL }; Modified: stable/10/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- stable/10/sys/cddl/boot/zfs/zfsimpl.h Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/sys/cddl/boot/zfs/zfsimpl.h Wed Mar 19 23:55:03 2014 (r263397) @@ -222,9 +222,10 @@ typedef struct blkptr { * Macros to get and set fields in a bp or DVA. */ #define DVA_GET_ASIZE(dva) \ - BF64_GET_SB((dva)->dva_word[0], 0, 24, SPA_MINBLOCKSHIFT, 0) + BF64_GET_SB((dva)->dva_word[0], 0, SPA_ASIZEBITS, SPA_MINBLOCKSHIFT, 0) #define DVA_SET_ASIZE(dva, x) \ - BF64_SET_SB((dva)->dva_word[0], 0, 24, SPA_MINBLOCKSHIFT, 0, x) + BF64_SET_SB((dva)->dva_word[0], 0, SPA_ASIZEBITS, \ + SPA_MINBLOCKSHIFT, 0, x) #define DVA_GET_GRID(dva) BF64_GET((dva)->dva_word[0], 24, 8) #define DVA_SET_GRID(dva, x) BF64_SET((dva)->dva_word[0], 24, 8, x) @@ -242,14 +243,14 @@ typedef struct blkptr { #define BP_GET_LSIZE(bp) \ (BP_IS_HOLE(bp) ? 0 : \ - BF64_GET_SB((bp)->blk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1)) + BF64_GET_SB((bp)->blk_prop, 0, SPA_LSIZEBITS, SPA_MINBLOCKSHIFT, 1)) #define BP_SET_LSIZE(bp, x) \ - BF64_SET_SB((bp)->blk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1, x) + BF64_SET_SB((bp)->blk_prop, 0, SPA_LSIZEBITS, SPA_MINBLOCKSHIFT, 1, x) #define BP_GET_PSIZE(bp) \ - BF64_GET_SB((bp)->blk_prop, 16, 16, SPA_MINBLOCKSHIFT, 1) + BF64_GET_SB((bp)->blk_prop, 16, SPA_LSIZEBITS, SPA_MINBLOCKSHIFT, 1) #define BP_SET_PSIZE(bp, x) \ - BF64_SET_SB((bp)->blk_prop, 16, 16, SPA_MINBLOCKSHIFT, 1, x) + BF64_SET_SB((bp)->blk_prop, 16, SPA_LSIZEBITS, SPA_MINBLOCKSHIFT, 1, x) #define BP_GET_COMPRESS(bp) BF64_GET((bp)->blk_prop, 32, 8) #define BP_SET_COMPRESS(bp, x) BF64_SET((bp)->blk_prop, 32, 8, x) @@ -266,7 +267,7 @@ typedef struct blkptr { #define BP_GET_DEDUP(bp) BF64_GET((bp)->blk_prop, 62, 1) #define BP_SET_DEDUP(bp, x) BF64_SET((bp)->blk_prop, 62, 1, x) -#define BP_GET_BYTEORDER(bp) (0 - BF64_GET((bp)->blk_prop, 63, 1)) +#define BP_GET_BYTEORDER(bp) BF64_GET((bp)->blk_prop, 63, 1) #define BP_SET_BYTEORDER(bp, x) BF64_SET((bp)->blk_prop, 63, 1, x) #define BP_PHYSICAL_BIRTH(bp) \ @@ -285,11 +286,6 @@ typedef struct blkptr { !!DVA_GET_ASIZE(&(bp)->blk_dva[1]) + \ !!DVA_GET_ASIZE(&(bp)->blk_dva[2])) -#define BP_COUNT_GANG(bp) \ - (DVA_GET_GANG(&(bp)->blk_dva[0]) + \ - DVA_GET_GANG(&(bp)->blk_dva[1]) + \ - DVA_GET_GANG(&(bp)->blk_dva[2])) - #define DVA_EQUAL(dva1, dva2) \ ((dva1)->dva_word[1] == (dva2)->dva_word[1] && \ (dva1)->dva_word[0] == (dva2)->dva_word[0]) @@ -313,7 +309,9 @@ typedef struct blkptr { #define BP_IDENTITY(bp) (&(bp)->blk_dva[0]) #define BP_IS_GANG(bp) DVA_GET_GANG(BP_IDENTITY(bp)) -#define BP_IS_HOLE(bp) ((bp)->blk_birth == 0) +#define DVA_IS_EMPTY(dva) ((dva)->dva_word[0] == 0ULL && \ + (dva)->dva_word[1] == 0ULL) +#define BP_IS_HOLE(bp) DVA_IS_EMPTY(BP_IDENTITY(bp)) #define BP_IS_OLDER(bp, txg) (!BP_IS_HOLE(bp) && (bp)->blk_birth < (txg)) #define BP_ZERO(bp) \ Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Wed Mar 19 23:55:03 2014 (r263397) @@ -114,10 +114,21 @@ zfeature_lookup_name(const char *name, s return (ENOENT); } +boolean_t +zfeature_depends_on(spa_feature_t fid, spa_feature_t check) { + zfeature_info_t *feature = &spa_feature_table[fid]; + + for (int i = 0; feature->fi_depends[i] != SPA_FEATURE_NONE; i++) { + if (feature->fi_depends[i] == check) + return (B_TRUE); + } + return (B_FALSE); +} + static void zfeature_register(spa_feature_t fid, const char *guid, const char *name, const char *desc, boolean_t readonly, boolean_t mos, - const spa_feature_t *deps) + boolean_t activate_on_enable, const spa_feature_t *deps) { zfeature_info_t *feature = &spa_feature_table[fid]; static spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; @@ -137,6 +148,7 @@ zfeature_register(spa_feature_t fid, con feature->fi_desc = desc; feature->fi_can_readonly = readonly; feature->fi_mos = mos; + feature->fi_activate_on_enable = activate_on_enable; feature->fi_depends = deps; } @@ -145,21 +157,43 @@ zpool_feature_init(void) { zfeature_register(SPA_FEATURE_ASYNC_DESTROY, "com.delphix:async_destroy", "async_destroy", - "Destroy filesystems asynchronously.", B_TRUE, B_FALSE, NULL); + "Destroy filesystems asynchronously.", B_TRUE, B_FALSE, + B_FALSE, NULL); + zfeature_register(SPA_FEATURE_EMPTY_BPOBJ, "com.delphix:empty_bpobj", "empty_bpobj", - "Snapshots use less space.", B_TRUE, B_FALSE, NULL); + "Snapshots use less space.", B_TRUE, B_FALSE, + B_FALSE, NULL); + zfeature_register(SPA_FEATURE_LZ4_COMPRESS, "org.illumos:lz4_compress", "lz4_compress", - "LZ4 compression algorithm support.", B_FALSE, B_FALSE, NULL); + "LZ4 compression algorithm support.", B_FALSE, B_FALSE, + B_FALSE, NULL); + zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", - "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, NULL); + "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, + B_FALSE, NULL); + zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, "com.delphix:spacemap_histogram", "spacemap_histogram", - "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); + "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, + B_FALSE, NULL); + + zfeature_register(SPA_FEATURE_ENABLED_TXG, + "com.delphix:enabled_txg", "enabled_txg", + "Record txg at which a feature is enabled", B_TRUE, B_FALSE, + B_FALSE, NULL); + + static spa_feature_t hole_birth_deps[] = { SPA_FEATURE_ENABLED_TXG, + SPA_FEATURE_NONE }; + zfeature_register(SPA_FEATURE_HOLE_BIRTH, + "com.delphix:hole_birth", "hole_birth", + "Retain hole birth txg for more precise zfs send", + B_FALSE, B_TRUE, B_TRUE, hole_birth_deps); + zfeature_register(SPA_FEATURE_EXTENSIBLE_DATASET, "com.delphix:extensible_dataset", "extensible_dataset", "Enhanced dataset functionality, used by other features.", - B_FALSE, B_FALSE, NULL); + B_FALSE, B_FALSE, B_FALSE, NULL); } Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Wed Mar 19 23:55:03 2014 (r263397) @@ -44,10 +44,14 @@ typedef enum spa_feature { SPA_FEATURE_LZ4_COMPRESS, SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, SPA_FEATURE_SPACEMAP_HISTOGRAM, + SPA_FEATURE_ENABLED_TXG, + SPA_FEATURE_HOLE_BIRTH, SPA_FEATURE_EXTENSIBLE_DATASET, SPA_FEATURES } spa_feature_t; +#define SPA_FEATURE_DISABLED (-1ULL) + typedef struct zfeature_info { spa_feature_t fi_feature; const char *fi_uname; /* User-facing feature name */ @@ -55,6 +59,8 @@ typedef struct zfeature_info { const char *fi_desc; /* Feature description */ boolean_t fi_can_readonly; /* Can open pool readonly w/o support? */ boolean_t fi_mos; /* Is the feature necessary to read the MOS? */ + /* Activate this feature at the same time it is enabled */ + boolean_t fi_activate_on_enable; /* array of dependencies, terminated by SPA_FEATURE_NONE */ const spa_feature_t *fi_depends; } zfeature_info_t; @@ -69,6 +75,7 @@ extern boolean_t zfeature_is_valid_guid( extern boolean_t zfeature_is_supported(const char *); extern int zfeature_lookup_name(const char *name, spa_feature_t *res); +extern boolean_t zfeature_depends_on(spa_feature_t fid, spa_feature_t check); extern void zpool_feature_init(void); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Mar 19 23:55:03 2014 (r263397) @@ -845,7 +845,7 @@ buf_hash(uint64_t spa, const dva_t *dva, #define BUF_EMPTY(buf) \ ((buf)->b_dva.dva_word[0] == 0 && \ (buf)->b_dva.dva_word[1] == 0 && \ - (buf)->b_birth == 0) + (buf)->b_cksum0 == 0) #define BUF_EQUAL(spa, dva, birth, buf) \ ((buf)->b_dva.dva_word[0] == (dva)->dva_word[0]) && \ @@ -3767,9 +3767,13 @@ arc_write_done(zio_t *zio) ASSERT(hdr->b_acb == NULL); if (zio->io_error == 0) { - hdr->b_dva = *BP_IDENTITY(zio->io_bp); - hdr->b_birth = BP_PHYSICAL_BIRTH(zio->io_bp); - hdr->b_cksum0 = zio->io_bp->blk_cksum.zc_word[0]; + if (BP_IS_HOLE(zio->io_bp)) { + buf_discard_identity(hdr); + } else { + hdr->b_dva = *BP_IDENTITY(zio->io_bp); + hdr->b_birth = BP_PHYSICAL_BIRTH(zio->io_bp); + hdr->b_cksum0 = zio->io_bp->blk_cksum.zc_word[0]; + } } else { ASSERT(BUF_EMPTY(hdr)); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Wed Mar 19 23:55:03 2014 (r263397) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -141,7 +141,7 @@ bptree_visit_cb(spa_t *spa, zilog_t *zil int err; struct bptree_args *ba = arg; - if (bp == NULL) + if (BP_IS_HOLE(bp)) return (0); err = ba->ba_func(ba->ba_arg, bp, ba->ba_tx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Wed Mar 19 23:51:29 2014 (r263396) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Wed Mar 19 23:55:03 2014 (r263397) @@ -455,10 +455,9 @@ dbuf_loan_arcbuf(dmu_buf_impl_t *db) mutex_enter(&db->db_mtx); if (arc_released(db->db_buf) || refcount_count(&db->db_holds) > 1) { int blksz = db->db.db_size; - spa_t *spa; + spa_t *spa = db->db_objset->os_spa; mutex_exit(&db->db_mtx); - DB_GET_SPA(&spa, db); abuf = arc_loan_buf(spa, blksz); bcopy(db->db.db_data, abuf->b_data, blksz); } else { @@ -519,7 +518,6 @@ static void dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t *flags) { dnode_t *dn; - spa_t *spa; zbookmark_t zb; uint32_t aflags = ARC_NOWAIT; @@ -559,9 +557,9 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t BP_IS_HOLE(db->db_blkptr)))) { arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); - dbuf_set_data(db, arc_buf_alloc(dn->dn_objset->os_spa, - db->db.db_size, db, type)); DB_DNODE_EXIT(db); + dbuf_set_data(db, arc_buf_alloc(db->db_objset->os_spa, + db->db.db_size, db, type)); bzero(db->db.db_data, db->db.db_size); db->db_state = DB_CACHED; *flags |= DB_RF_CACHED; @@ -569,7 +567,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t return; } - spa = dn->dn_objset->os_spa; DB_DNODE_EXIT(db); db->db_state = DB_READ; @@ -586,7 +583,7 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t dbuf_add_ref(db, NULL); - (void) arc_read(zio, spa, db->db_blkptr, + (void) arc_read(zio, db->db_objset->os_spa, db->db_blkptr, dbuf_read_done, db, ZIO_PRIORITY_SYNC_READ, (*flags & DB_RF_CANFAIL) ? ZIO_FLAG_CANFAIL : ZIO_FLAG_MUSTSUCCEED, &aflags, &zb); @@ -598,8 +595,8 @@ int dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags) { int err = 0; - int havepzio = (zio != NULL); - int prefetch; + boolean_t havepzio = (zio != NULL); + boolean_t prefetch; dnode_t *dn; /* @@ -694,11 +691,10 @@ dbuf_noread(dmu_buf_impl_t *db) cv_wait(&db->db_changed, &db->db_mtx); if (db->db_state == DB_UNCACHED) { arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); - spa_t *spa; + spa_t *spa = db->db_objset->os_spa; ASSERT(db->db_buf == NULL); ASSERT(db->db.db_data == NULL); - DB_GET_SPA(&spa, db); dbuf_set_data(db, arc_buf_alloc(spa, db->db.db_size, db, type)); db->db_state = DB_FILL; } else if (db->db_state == DB_NOFILL) { @@ -753,9 +749,8 @@ dbuf_fix_old_data(dmu_buf_impl_t *db, ui } else if (refcount_count(&db->db_holds) > db->db_dirtycnt) { int size = db->db.db_size; arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); - spa_t *spa; + spa_t *spa = db->db_objset->os_spa; - DB_GET_SPA(&spa, db); dr->dt.dl.dr_data = arc_buf_alloc(spa, size, db, type); bcopy(db->db.db_data, dr->dt.dl.dr_data->b_data, size); } else { @@ -781,12 +776,9 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) ASSERT(db->db_data_pending != dr); /* free this block */ - if (!BP_IS_HOLE(bp) && !dr->dt.dl.dr_nopwrite) { - spa_t *spa; + if (!BP_IS_HOLE(bp) && !dr->dt.dl.dr_nopwrite) + zio_free(db->db_objset->os_spa, txg, bp); - DB_GET_SPA(&spa, db); - zio_free(spa, txg, bp); - } dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; dr->dt.dl.dr_nopwrite = B_FALSE; @@ -804,9 +796,7 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) /* * Evict (if its unreferenced) or clear (if its referenced) any level-0 * data blocks in the free range, so that any future readers will find - * empty blocks. Also, if we happen across any level-1 dbufs in the - * range that have not already been marked dirty, mark them dirty so - * they stay in memory. + * empty blocks. * * This is a no-op if the dataset is in the middle of an incremental * receive; see comment below for details. @@ -816,14 +806,9 @@ dbuf_free_range(dnode_t *dn, uint64_t st { dmu_buf_impl_t *db, *db_next; uint64_t txg = tx->tx_txg; - int epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; - uint64_t first_l1 = start >> epbs; - uint64_t last_l1 = end >> epbs; - if (end > dn->dn_maxblkid && (end != DMU_SPILL_BLKID)) { + if (end > dn->dn_maxblkid && (end != DMU_SPILL_BLKID)) end = dn->dn_maxblkid; - last_l1 = end >> epbs; - } dprintf_dnode(dn, "start=%llu end=%llu\n", start, end); mutex_enter(&dn->dn_dbufs_mtx); @@ -846,23 +831,8 @@ dbuf_free_range(dnode_t *dn, uint64_t st db_next = list_next(&dn->dn_dbufs, db); ASSERT(db->db_blkid != DMU_BONUS_BLKID); - if (db->db_level == 1 && - db->db_blkid >= first_l1 && db->db_blkid <= last_l1) { - mutex_enter(&db->db_mtx); - if (db->db_last_dirty && - db->db_last_dirty->dr_txg < txg) { - dbuf_add_ref(db, FTAG); - mutex_exit(&db->db_mtx); - dbuf_will_dirty(db, tx); - dbuf_rele(db, FTAG); - } else { - mutex_exit(&db->db_mtx); - } - } - if (db->db_level != 0) continue; - dprintf_dbuf(db, "found buf %s\n", ""); if (db->db_blkid < start || db->db_blkid > end) continue; @@ -939,24 +909,29 @@ dbuf_block_freeable(dmu_buf_impl_t *db) * We don't need any locking to protect db_blkptr: * If it's syncing, then db_last_dirty will be set * so we'll ignore db_blkptr. + * + * This logic ensures that only block births for + * filled blocks are considered. */ ASSERT(MUTEX_HELD(&db->db_mtx)); - if (db->db_last_dirty) + if (db->db_last_dirty && (db->db_blkptr == NULL || + !BP_IS_HOLE(db->db_blkptr))) { birth_txg = db->db_last_dirty->dr_txg; - else if (db->db_blkptr) + } else if (db->db_blkptr != NULL && !BP_IS_HOLE(db->db_blkptr)) { birth_txg = db->db_blkptr->blk_birth; + } /* - * If we don't exist or are in a snapshot, we can't be freed. + * If this block don't exist or is in a snapshot, it can't be freed. * Don't pass the bp to dsl_dataset_block_freeable() since we * are holding the db_mtx lock and might deadlock if we are * prefetching a dedup-ed block. */ - if (birth_txg) + if (birth_txg != 0) return (ds == NULL || dsl_dataset_block_freeable(ds, NULL, birth_txg)); else - return (FALSE); + return (B_FALSE); } void @@ -976,7 +951,7 @@ dbuf_new_size(dmu_buf_impl_t *db, int si ASSERT(RW_WRITE_HELD(&dn->dn_struct_rwlock)); /* - * This call to dbuf_will_dirty() with the dn_struct_rwlock held + * This call to dmu_buf_will_dirty() with the dn_struct_rwlock held * is OK, because there can be no other references to the db * when we are changing its size, so no concurrent DB_FILL can * be happening. @@ -985,7 +960,7 @@ dbuf_new_size(dmu_buf_impl_t *db, int si * XXX we should be doing a dbuf_read, checking the return * value and returning that up to our callers */ - dbuf_will_dirty(db, tx); + dmu_buf_will_dirty(&db->db, tx); /* create the data buffer for the new block */ buf = arc_buf_alloc(dn->dn_objset->os_spa, size, db, type); @@ -1015,9 +990,8 @@ dbuf_new_size(dmu_buf_impl_t *db, int si void dbuf_release_bp(dmu_buf_impl_t *db) { - objset_t *os; + objset_t *os = db->db_objset; - DB_GET_OBJSET(&os, db); ASSERT(dsl_pool_sync_context(dmu_objset_pool(os))); ASSERT(arc_released(os->os_phys_buf) || list_link_active(&os->os_dsl_dataset->ds_synced_link)); @@ -1391,10 +1365,10 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ return (B_FALSE); } -#pragma weak dmu_buf_will_dirty = dbuf_will_dirty void -dbuf_will_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx) +dmu_buf_will_dirty(dmu_buf_t *db_fake, dmu_tx_t *tx) { + dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake; int rf = DB_RF_MUST_SUCCEED | DB_RF_NOPREFETCH; ASSERT(tx->tx_txg != 0); @@ -1517,7 +1491,7 @@ dbuf_assign_arcbuf(dmu_buf_impl_t *db, a db->db_state = DB_FILL; mutex_exit(&db->db_mtx); (void) dbuf_dirty(db, tx); - dbuf_fill_done(db, tx); + dmu_buf_fill_done(&db->db, tx); } /* @@ -2022,7 +1996,6 @@ dbuf_add_ref(dmu_buf_impl_t *db, void *t * Without that, the dbuf_rele() could lead to a dnode_rele() followed by the * dnode's parent dbuf evicting its dnode handles. */ -#pragma weak dmu_buf_rele = dbuf_rele void dbuf_rele(dmu_buf_impl_t *db, void *tag) { @@ -2030,6 +2003,12 @@ dbuf_rele(dmu_buf_impl_t *db, void *tag) dbuf_rele_and_unlock(db, tag); } +void +dmu_buf_rele(dmu_buf_t *db, void *tag) +{ + dbuf_rele((dmu_buf_impl_t *)db, tag); +} + /* * dbuf_rele() for an already-locked dbuf. This is necessary to allow * db_dirtycnt and db_holds to be updated atomically. @@ -2480,18 +2459,14 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * dnode_diduse_space(dn, delta - zio->io_prev_space_delta); zio->io_prev_space_delta = delta; - if (BP_IS_HOLE(bp)) { - ASSERT(bp->blk_fill == 0); - DB_DNODE_EXIT(db); - return; + if (bp->blk_birth != 0) { + ASSERT((db->db_blkid != DMU_SPILL_BLKID && + BP_GET_TYPE(bp) == dn->dn_type) || + (db->db_blkid == DMU_SPILL_BLKID && + BP_GET_TYPE(bp) == dn->dn_bonustype)); + ASSERT(BP_GET_LEVEL(bp) == db->db_level); } - ASSERT((db->db_blkid != DMU_SPILL_BLKID && - BP_GET_TYPE(bp) == dn->dn_type) || - (db->db_blkid == DMU_SPILL_BLKID && - BP_GET_TYPE(bp) == dn->dn_bonustype)); - ASSERT(BP_GET_LEVEL(bp) == db->db_level); - mutex_enter(&db->db_mtx); #ifdef ZFS_DEBUG @@ -2517,7 +2492,11 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * fill++; } } else { - fill = 1; + if (BP_IS_HOLE(bp)) { + fill = 0; + } else { + fill = 1; + } } } else { blkptr_t *ibp = db->db.db_data; @@ -2572,9 +2551,10 @@ static void dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb) { dmu_buf_impl_t *db = vdb; - blkptr_t *bp = zio->io_bp; blkptr_t *bp_orig = &zio->io_bp_orig; - uint64_t txg = zio->io_txg; + blkptr_t *bp = db->db_blkptr; + objset_t *os = db->db_objset; + dmu_tx_t *tx = os->os_synctx; dbuf_dirty_record_t **drp, *dr; ASSERT0(zio->io_error); @@ -2587,14 +2567,7 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b if (zio->io_flags & (ZIO_FLAG_IO_REWRITE | ZIO_FLAG_NOPWRITE)) { ASSERT(BP_EQUAL(bp, bp_orig)); } else { - objset_t *os; - dsl_dataset_t *ds; - dmu_tx_t *tx; - - DB_GET_OBJSET(&os, db); - ds = os->os_dsl_dataset; - tx = os->os_synctx; - + dsl_dataset_t *ds = os->os_dsl_dataset; (void) dsl_dataset_block_kill(ds, bp_orig, tx, B_TRUE); dsl_dataset_block_born(ds, bp, tx); } @@ -2607,7 +2580,6 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 20 00:01:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 023706E; Thu, 20 Mar 2014 00:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2D8BC3; Thu, 20 Mar 2014 00:01: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 s2K01JDf012013; Thu, 20 Mar 2014 00:01:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K01JeL012011; Thu, 20 Mar 2014 00:01:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403200001.s2K01JeL012011@svn.freebsd.org> From: Xin LI Date: Thu, 20 Mar 2014 00:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263399 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 00:01:20 -0000 Author: delphij Date: Thu Mar 20 00:01:19 2014 New Revision: 263399 URL: http://svnweb.freebsd.org/changeset/base/263399 Log: MFC r260157: MFV r260153: 4121 vdev_label_init should treat request as succeeded when pool is read only illumos/illumos-gate@973c78e94bf9634782164382c9e291bf81161fa5 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed Mar 19 23:58:05 2014 (r263398) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Thu Mar 20 00:01:19 2014 (r263399) @@ -646,7 +646,7 @@ vdev_label_init(vdev_t *vd, uint64_t crt /* Track the creation time for this vdev */ vd->vdev_crtxg = crtxg; - if (!vd->vdev_ops->vdev_op_leaf) + if (!vd->vdev_ops->vdev_op_leaf || !spa_writeable(spa)) return (0); /* From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 20 00:05:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 19F45474; Thu, 20 Mar 2014 00:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0634011E; Thu, 20 Mar 2014 00:05: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 s2K05NDW013176; Thu, 20 Mar 2014 00:05:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K05NwE013175; Thu, 20 Mar 2014 00:05:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403200005.s2K05NwE013175@svn.freebsd.org> From: Xin LI Date: Thu, 20 Mar 2014 00:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263401 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 00:05:24 -0000 Author: delphij Date: Thu Mar 20 00:05:23 2014 New Revision: 263401 URL: http://svnweb.freebsd.org/changeset/base/263401 Log: MFC r260181: Fix build on platforms where atomic_swap_64 is not available. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Thu Mar 20 00:02:14 2014 (r263400) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Thu Mar 20 00:05:23 2014 (r263401) @@ -312,8 +312,12 @@ feature_sync(spa_t *spa, zfeature_info_t if (feature->fi_feature != SPA_FEATURE_NONE) { uint64_t *refcount_cache = &spa->spa_feat_refcount_cache[feature->fi_feature]; +#ifdef atomic_swap_64 VERIFY3U(*refcount_cache, ==, atomic_swap_64(refcount_cache, refcount)); +#else + *refcount_cache = refcount; +#endif } if (refcount == 0) From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 20 00:10:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6136E9E3; Thu, 20 Mar 2014 00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3C44716D; Thu, 20 Mar 2014 00: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 s2K0AxSx016905; Thu, 20 Mar 2014 00:10:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K0Awwr016903; Thu, 20 Mar 2014 00:10:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403200010.s2K0Awwr016903@svn.freebsd.org> From: Xin LI Date: Thu, 20 Mar 2014 00:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263403 - stable/10/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 00:10:59 -0000 Author: delphij Date: Thu Mar 20 00:10:58 2014 New Revision: 263403 URL: http://svnweb.freebsd.org/changeset/base/263403 Log: MFC r256999 (smh): Added support for the 'zfs list -t snap' and 'zfs snap' aliases which are available under Oracle Solaris 11. This includes an update to the ZFS(8) man page to reflect all the available alias (snap, umount, and recv). Initial changes obtained from ZFS On Linux + fixes for man page and cmd help: https://github.com/zfsonlinux/zfs/commit/10b75496bb0cb7a7b8146c263164adc37f1d176a https://github.com/zfsonlinux/zfs/commit/cf81b00a73fe47fdb21586ac1cc179b734540973 Obtained from: https://github.com/zfsonlinux/zfs Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 20 00:06:16 2014 (r263402) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 20 00:10:58 2014 (r263403) @@ -25,10 +25,11 @@ .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2013, Joyent, Inc. All rights reserved. +.\" Copyright (c) 2013, Steven Hartland .\" .\" $FreeBSD$ .\" -.Dd September 20, 2013 +.Dd October 23, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -61,7 +62,7 @@ .Op , Ns ... .Sm on .Nm -.Cm snapshot +.Cm snapshot Ns | Ns Cm snap .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns Ar volume@snapname @@ -157,7 +158,7 @@ .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... .Fl a | Ar filesystem .Nm -.Cm unmount +.Cm unmount Ns | Ns Cm umount .Op Fl f .Fl a | Ar filesystem Ns | Ns Ar mountpoint .Nm @@ -172,11 +173,11 @@ .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Nm -.Cm receive +.Cm receive Ns | Ns Cm recv .Op Fl vnFu .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm -.Cm receive +.Cm receive Ns | Ns Cm recv .Op Fl vnFu .Op Fl d | e .Ar filesystem @@ -1653,7 +1654,7 @@ options, as they can destroy large porti behavior for mounted file systems in use. .It Xo .Nm -.Cm snapshot +.Cm snapshot Ns | Ns Cm snap .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns volume@snapname @@ -1865,7 +1866,7 @@ syntax. A comma-separated list of types to display, where .Ar type is one of -.Sy filesystem , snapshot , volume , No or Sy all . +.Sy filesystem , snapshot , snap, volume , No or Sy all . For example, specifying .Fl t Cm snapshot displays only snapshots. @@ -2194,7 +2195,7 @@ Mount the specified filesystem. .El .It Xo .Nm -.Cm unmount +.Cm unmount Ns | Ns Cm umount .Op Fl f .Fl a | Ar filesystem Ns | Ns Ar mountpoint .Xc @@ -2377,13 +2378,13 @@ on future versions of .Tn ZFS . .It Xo .Nm -.Cm receive +.Cm receive Ns | Ns Cm recv .Op Fl vnFu .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc .It Xo .Nm -.Cm receive +.Cm receive Ns | Ns Cm recv .Op Fl vnFu .Op Fl d | e .Ar filesystem Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Mar 20 00:06:16 2014 (r263402) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Mar 20 00:10:58 2014 (r263403) @@ -259,9 +259,9 @@ get_usage(zfs_help_t idx) case HELP_PROMOTE: return (gettext("\tpromote \n")); case HELP_RECEIVE: - return (gettext("\treceive [-vnFu] \n" - "\treceive [-vnFu] [-d | -e] \n")); + "\treceive|recv [-vnFu] [-d | -e] \n")); case HELP_RENAME: return (gettext("\trename [-f] " "\n" @@ -280,10 +280,10 @@ get_usage(zfs_help_t idx) case HELP_SHARE: return (gettext("\tshare <-a | filesystem>\n")); case HELP_SNAPSHOT: - return (gettext("\tsnapshot [-r] [-o property=value] ... " + return (gettext("\tsnapshot|snap [-r] [-o property=value] ... " " ...\n")); case HELP_UNMOUNT: - return (gettext("\tunmount [-f] " + return (gettext("\tunmount|umount [-f] " "<-a | filesystem|mountpoint>\n")); case HELP_UNSHARE: return (gettext("\tunshare " @@ -3027,7 +3027,7 @@ zfs_do_list(int argc, char **argv) flags &= ~ZFS_ITER_PROP_LISTSNAPS; while (*optarg != '\0') { static char *type_subopts[] = { "filesystem", - "volume", "snapshot", "all", NULL }; + "volume", "snapshot", "snap", "all", NULL }; switch (getsubopt(&optarg, type_subopts, &value)) { @@ -3038,9 +3038,10 @@ zfs_do_list(int argc, char **argv) types |= ZFS_TYPE_VOLUME; break; case 2: + case 3: types |= ZFS_TYPE_SNAPSHOT; break; - case 3: + case 4: types = ZFS_TYPE_DATASET; break; @@ -6726,6 +6727,12 @@ main(int argc, char **argv) cmdname = "receive"; /* + * The 'snap' command is an alias for 'snapshot' + */ + if (strcmp(cmdname, "snap") == 0) + cmdname = "snapshot"; + + /* * Special case '-?' */ if (strcmp(cmdname, "-?") == 0) From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 20 00:24:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 69DE510A; Thu, 20 Mar 2014 00:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 53EB6355; Thu, 20 Mar 2014 00:24: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 s2K0Obe6021586; Thu, 20 Mar 2014 00:24:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K0OacY021580; Thu, 20 Mar 2014 00:24:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403200024.s2K0OacY021580@svn.freebsd.org> From: Xin LI Date: Thu, 20 Mar 2014 00:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263405 - in stable/10/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 00:24:37 -0000 Author: delphij Date: Thu Mar 20 00:24:35 2014 New Revision: 263405 URL: http://svnweb.freebsd.org/changeset/base/263405 Log: MFC r259850: MFV r258384: 2583 Add -p (parsable) option to zfs list illumos/illumos-gate@43d68d68c1ce08fb35026bebfb141af422e7082e Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 20 00:14:45 2014 (r263404) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 20 00:24:35 2014 (r263405) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2013 +.Dd December 24, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -102,7 +102,7 @@ .Nm .Cm list .Op Fl r Ns | Ns Fl d Ar depth -.Op Fl H +.Op Fl Hp .Op Fl o Ar property Ns Oo , Ns property Ns Oc Ns ... .Op Fl t Ar type Ns Oo , Ns type Ns Oc Ns ... .Oo Fl s Ar property Oc Ns ... @@ -1807,7 +1807,7 @@ only dataset that can be renamed recursi .Nm .Cm list .Op Fl r Ns | Ns Fl d Ar depth -.Op Fl H +.Op Fl Hp .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... .Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... .Oo Fl s Ar property Oc Ns ... @@ -1838,6 +1838,8 @@ will display only the dataset and its di .It Fl H Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary white space. +.It Fl p +Display numbers in parsable (exact) values. .It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... A comma-separated list of properties to display. The property must be: .Bl -bullet -offset 2n @@ -1978,7 +1980,7 @@ Display output in a form more easily par omitted, and fields are explicitly separated by a single tab instead of an arbitrary amount of space. .It Fl p -Display numbers in parseable (exact) values. +Display numbers in parsable (exact) values. .It Fl o Cm all | Ar field Ns Oo , Ns Ar field Oc Ns ... A comma-separated list of columns to display. Supported values are .Sy name,property,value,received,source . @@ -2820,7 +2822,7 @@ option of .It \&P Ta event port (not supported on Fx ) .El .It Fl H -Give more parseable tab-separated output, without header lines and without +Give more parsable tab-separated output, without header lines and without arrows. .It Fl t Display the path's inode change time as the first column of output. Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Thu Mar 20 00:14:45 2014 (r263404) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Thu Mar 20 00:24:35 2014 (r263405) @@ -18,10 +18,12 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -109,7 +111,8 @@ zfs_callback(zfs_handle_t *zhp, void *da cb->cb_props_table); if (zfs_expand_proplist(zhp, cb->cb_proplist, - (cb->cb_flags & ZFS_ITER_RECVD_PROPS)) + (cb->cb_flags & ZFS_ITER_RECVD_PROPS), + (cb->cb_flags & ZFS_ITER_LITERAL_PROPS)) != 0) { free(node); return (-1); Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h Thu Mar 20 00:14:45 2014 (r263404) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h Thu Mar 20 00:24:35 2014 (r263405) @@ -18,9 +18,11 @@ * * CDDL HEADER END */ + /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #ifndef ZFS_ITER_H @@ -44,6 +46,7 @@ typedef struct zfs_sort_column { #define ZFS_ITER_DEPTH_LIMIT (1 << 3) #define ZFS_ITER_RECVD_PROPS (1 << 4) #define ZFS_ITER_SIMPLE (1 << 5) +#define ZFS_ITER_LITERAL_PROPS (1 << 6) int zfs_for_each(int, char **, int options, zfs_type_t, zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *); Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Mar 20 00:14:45 2014 (r263404) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Mar 20 00:24:35 2014 (r263405) @@ -21,7 +21,6 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. @@ -29,6 +28,7 @@ * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -249,9 +249,8 @@ get_usage(zfs_help_t idx) case HELP_UNJAIL: return (gettext("\tunjail \n")); case HELP_LIST: - return (gettext("\tlist [-rH][-d max] " - "[-o property[,...]] [-t type[,...]] [-s property] ...\n" - "\t [-S property] ... " + return (gettext("\tlist [-Hp] [-r|-d max] [-o property[,...]] " + "[-s property]...\n\t [-S property]... [-t type[,...]] " "[filesystem|volume|snapshot] ...\n")); case HELP_MOUNT: return (gettext("\tmount\n" @@ -310,12 +309,12 @@ get_usage(zfs_help_t idx) "\n")); case HELP_USERSPACE: return (gettext("\tuserspace [-Hinp] [-o field[,...]] " - "[-s field] ...\n\t[-S field] ... " - "[-t type[,...]] \n")); + "[-s field]...\n\t [-S field]... [-t type[,...]] " + "\n")); case HELP_GROUPSPACE: return (gettext("\tgroupspace [-Hinp] [-o field[,...]] " - "[-s field] ...\n\t[-S field] ... " - "[-t type[,...]] \n")); + "[-s field]...\n\t [-S field]... [-t type[,...]] " + "\n")); case HELP_HOLD: return (gettext("\thold [-r] ...\n")); case HELP_HOLDS: @@ -2124,7 +2123,7 @@ zfs_do_upgrade(int argc, char **argv) * -i Translate SID to POSIX ID. * -n Print numeric ID instead of user/group name. * -o Control which fields to display. - * -p Use exact (parseable) numeric output. + * -p Use exact (parsable) numeric output. * -s Specify sort columns, descending order. * -S Specify sort columns, ascending order. * -t Control which object types to display. @@ -2811,24 +2810,25 @@ zfs_do_userspace(int argc, char **argv) } /* - * list [-r][-d max] [-H] [-o property[,property]...] [-t type[,type]...] - * [-s property [-s property]...] [-S property [-S property]...] - * ... + * list [-Hp][-r|-d max] [-o property[,...]] [-s property] ... [-S property] ... + * [-t type[,...]] [filesystem|volume|snapshot] ... * - * -r Recurse over all children + * -H Scripted mode; elide headers and separate columns by tabs. + * -p Display values in parsable (literal) format. + * -r Recurse over all children. * -d Limit recursion by depth. - * -H Scripted mode; elide headers and separate columns by tabs * -o Control which fields to display. - * -t Control which object types to display. * -s Specify sort columns, descending order. * -S Specify sort columns, ascending order. + * -t Control which object types to display. * - * When given no arguments, lists all filesystems in the system. + * When given no arguments, list all filesystems in the system. * Otherwise, list the specified datasets, optionally recursing down them if * '-r' is specified. */ typedef struct list_cbdata { boolean_t cb_first; + boolean_t cb_literal; boolean_t cb_scripted; zprop_list_t *cb_proplist; } list_cbdata_t; @@ -2837,8 +2837,9 @@ typedef struct list_cbdata { * Given a list of columns to display, output appropriate headers for each one. */ static void -print_header(zprop_list_t *pl) +print_header(list_cbdata_t *cb) { + zprop_list_t *pl = cb->cb_proplist; char headerbuf[ZFS_MAXPROPLEN]; const char *header; int i; @@ -2879,19 +2880,19 @@ print_header(zprop_list_t *pl) * to the described layout. */ static void -print_dataset(zfs_handle_t *zhp, zprop_list_t *pl, boolean_t scripted) +print_dataset(zfs_handle_t *zhp, list_cbdata_t *cb) { + zprop_list_t *pl = cb->cb_proplist; boolean_t first = B_TRUE; char property[ZFS_MAXPROPLEN]; nvlist_t *userprops = zfs_get_user_props(zhp); nvlist_t *propval; char *propstr; boolean_t right_justify; - int width; for (; pl != NULL; pl = pl->pl_next) { if (!first) { - if (scripted) + if (cb->cb_scripted) (void) printf("\t"); else (void) printf(" "); @@ -2906,22 +2907,22 @@ print_dataset(zfs_handle_t *zhp, zprop_l right_justify = zfs_prop_align_right(pl->pl_prop); } else if (pl->pl_prop != ZPROP_INVAL) { if (zfs_prop_get(zhp, pl->pl_prop, property, - sizeof (property), NULL, NULL, 0, B_FALSE) != 0) + sizeof (property), NULL, NULL, 0, + cb->cb_literal) != 0) propstr = "-"; else propstr = property; - right_justify = zfs_prop_align_right(pl->pl_prop); } else if (zfs_prop_userquota(pl->pl_user_prop)) { if (zfs_prop_get_userquota(zhp, pl->pl_user_prop, - property, sizeof (property), B_FALSE) != 0) + property, sizeof (property), cb->cb_literal) != 0) propstr = "-"; else propstr = property; right_justify = B_TRUE; } else if (zfs_prop_written(pl->pl_user_prop)) { if (zfs_prop_get_written(zhp, pl->pl_user_prop, - property, sizeof (property), B_FALSE) != 0) + property, sizeof (property), cb->cb_literal) != 0) propstr = "-"; else propstr = property; @@ -2936,19 +2937,17 @@ print_dataset(zfs_handle_t *zhp, zprop_l right_justify = B_FALSE; } - width = pl->pl_width; - /* * If this is being called in scripted mode, or if this is the * last column and it is left-justified, don't include a width * format specifier. */ - if (scripted || (pl->pl_next == NULL && !right_justify)) + if (cb->cb_scripted || (pl->pl_next == NULL && !right_justify)) (void) printf("%s", propstr); else if (right_justify) - (void) printf("%*s", width, propstr); + (void) printf("%*s", pl->pl_width, propstr); else - (void) printf("%-*s", width, propstr); + (void) printf("%-*s", pl->pl_width, propstr); } (void) printf("\n"); @@ -2964,11 +2963,11 @@ list_callback(zfs_handle_t *zhp, void *d if (cbp->cb_first) { if (!cbp->cb_scripted) - print_header(cbp->cb_proplist); + print_header(cbp); cbp->cb_first = B_FALSE; } - print_dataset(zhp, cbp->cb_proplist, cbp->cb_scripted); + print_dataset(zhp, cbp); return (0); } @@ -2977,7 +2976,6 @@ static int zfs_do_list(int argc, char **argv) { int c; - boolean_t scripted = B_FALSE; static char default_fields[] = "name,used,available,referenced,mountpoint"; int types = ZFS_TYPE_DATASET; @@ -2991,11 +2989,15 @@ zfs_do_list(int argc, char **argv) int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS; /* check options */ - while ((c = getopt(argc, argv, ":d:o:rt:Hs:S:")) != -1) { + while ((c = getopt(argc, argv, "HS:d:o:prs:t:")) != -1) { switch (c) { case 'o': fields = optarg; break; + case 'p': + cb.cb_literal = B_TRUE; + flags |= ZFS_ITER_LITERAL_PROPS; + break; case 'd': limit = parse_depth(optarg, &flags); break; @@ -3003,7 +3005,7 @@ zfs_do_list(int argc, char **argv) flags |= ZFS_ITER_RECURSE; break; case 'H': - scripted = B_TRUE; + cb.cb_scripted = B_TRUE; break; case 's': if (zfs_add_sort_column(&sortcol, optarg, @@ -3093,7 +3095,6 @@ zfs_do_list(int argc, char **argv) != 0) usage(B_FALSE); - cb.cb_scripted = scripted; cb.cb_first = B_TRUE; ret = zfs_for_each(argc, argv, flags, types, sortcol, &cb.cb_proplist, Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Mar 20 00:14:45 2014 (r263404) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Mar 20 00:24:35 2014 (r263405) @@ -21,13 +21,13 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #ifndef _LIBZFS_H @@ -463,7 +463,8 @@ typedef struct zprop_list { boolean_t pl_fixed; } zprop_list_t; -extern int zfs_expand_proplist(zfs_handle_t *, zprop_list_t **, boolean_t); +extern int zfs_expand_proplist(zfs_handle_t *, zprop_list_t **, boolean_t, + boolean_t); extern void zfs_prune_proplist(zfs_handle_t *, uint8_t *); #define ZFS_MOUNTPOINT_NONE "none" Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Mar 20 00:14:45 2014 (r263404) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Mar 20 00:24:35 2014 (r263405) @@ -23,11 +23,11 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -3882,7 +3882,8 @@ zfs_get_recvd_props(zfs_handle_t *zhp) * of the RECEIVED column. */ int -zfs_expand_proplist(zfs_handle_t *zhp, zprop_list_t **plp, boolean_t received) +zfs_expand_proplist(zfs_handle_t *zhp, zprop_list_t **plp, boolean_t received, + boolean_t literal) { libzfs_handle_t *hdl = zhp->zfs_hdl; zprop_list_t *entry; @@ -3944,18 +3945,18 @@ zfs_expand_proplist(zfs_handle_t *zhp, z * Now go through and check the width of any non-fixed columns */ for (entry = *plp; entry != NULL; entry = entry->pl_next) { - if (entry->pl_fixed) + if (entry->pl_fixed && !literal) continue; if (entry->pl_prop != ZPROP_INVAL) { if (zfs_prop_get(zhp, entry->pl_prop, - buf, sizeof (buf), NULL, NULL, 0, B_FALSE) == 0) { + buf, sizeof (buf), NULL, NULL, 0, literal) == 0) { if (strlen(buf) > entry->pl_width) entry->pl_width = strlen(buf); } if (received && zfs_prop_get_recvd(zhp, zfs_prop_to_name(entry->pl_prop), - buf, sizeof (buf), B_FALSE) == 0) + buf, sizeof (buf), literal) == 0) if (strlen(buf) > entry->pl_recvd_width) entry->pl_recvd_width = strlen(buf); } else { @@ -3968,7 +3969,7 @@ zfs_expand_proplist(zfs_handle_t *zhp, z } if (received && zfs_prop_get_recvd(zhp, entry->pl_user_prop, - buf, sizeof (buf), B_FALSE) == 0) + buf, sizeof (buf), literal) == 0) if (strlen(buf) > entry->pl_recvd_width) entry->pl_recvd_width = strlen(buf); } From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 20 00:28:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 03476525; Thu, 20 Mar 2014 00:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF15139C; Thu, 20 Mar 2014 00:28: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 s2K0Ssva022205; Thu, 20 Mar 2014 00:28:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K0SrHU022198; Thu, 20 Mar 2014 00:28:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403200028.s2K0SrHU022198@svn.freebsd.org> From: Xin LI Date: Thu, 20 Mar 2014 00:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263407 - in stable/10: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common cd... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 00:28:55 -0000 Author: delphij Date: Thu Mar 20 00:28:53 2014 New Revision: 263407 URL: http://svnweb.freebsd.org/changeset/base/263407 Log: MFC r260183: MFV r260154 + 260182: 4369 implement zfs bookmarks 4368 zfs send filesystems from readonly pools Illumos/illumos-gate@78f171005391b928aaf1642b3206c534ed644332 Added: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c - copied unchanged from r260183, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_bookmark.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_bookmark.h - copied unchanged from r260183, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_bookmark.h Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h stable/10/cddl/contrib/opensolaris/lib/pyzfs/common/allow.py stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 20 00:25:40 2014 (r263406) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 20 00:28:53 2014 (r263407) @@ -18,7 +18,7 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright (c) 2012 by Delphix. All rights reserved. +.\" Copyright (c) 2013 by Delphix. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2012, Bryan Drewery @@ -26,10 +26,11 @@ .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" Copyright (c) 2013, Steven Hartland +.\" Copyright (c) 2014, Xin LI .\" .\" $FreeBSD$ .\" -.Dd December 24, 2013 +.Dd January 2, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -57,11 +58,16 @@ .Cm destroy .Op Fl dnpRrv .Sm off -.Ar snapshot -.Op % Ns Ar snapname +.Ar filesystem Ns | Ns volume +.Ns @snap +.Op % Ns Ar snap +.Op , Ns Ar snap Op % Ns Ar snap .Op , Ns ... .Sm on .Nm +.Cm destroy +.Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark +.Nm .Cm snapshot Ns | Ns Cm snap .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... @@ -168,11 +174,19 @@ .Cm unshare .Fl a | Ar filesystem Ns | Ns Ar mountpoint .Nm +.Cm bookmark +.Ar snapshot +.Ar bookmark +.Nm .Cm send .Op Fl DnPpRv .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Nm +.Cm send +.Op Fl i Ar snapshot Ns | Ns bookmark +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Nm .Cm receive Ns | Ns Cm recv .Op Fl vnFu .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot @@ -1654,6 +1668,13 @@ options, as they can destroy large porti behavior for mounted file systems in use. .It Xo .Nm +.Cm destroy +.Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark +.Xc +.Pp +The given bookmark is destroyed. +.It Xo +.Nm .Cm snapshot Ns | Ns Cm snap .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... @@ -1686,14 +1707,24 @@ Roll back the given dataset to a previou back, all data that has changed since the snapshot is discarded, and the dataset reverts to the state at the time of the snapshot. By default, the command refuses to roll back to a snapshot other than the most recent one. In -order to do so, all intermediate snapshots must be destroyed by specifying the +order to do so, all intermediate snapshots and bookmarks must be destroyed +by specifying the .Fl r option. +.Pp +The +.Fl rR +options do not recursively destroy the child snapshots of a +recursive snapshot. +Only direct snapshots of the specified filesystem +are destroyed by either of these options. +To completely roll back a +recursive snapshot, you must rollback the individual child snapshots. .Bl -tag -width indent .It Fl r -Recursively destroy any snapshots more recent than the one specified. +Destroy any snapshots and bookmarks more recent than the one specified. .It Fl R -Recursively destroy any more recent snapshots, as well as any clones of those +Destroy any more recent snapshots and bookmarks, as well as any clones of those snapshots. .It Fl f Used with the @@ -1868,7 +1899,7 @@ syntax. A comma-separated list of types to display, where .Ar type is one of -.Sy filesystem , snapshot , snap, volume , No or Sy all . +.Sy filesystem , snapshot , snap , volume , bookmark , No or Sy all . For example, specifying .Fl t Cm snapshot displays only snapshots. @@ -1965,7 +1996,7 @@ sections. The special value .Cm all can be used to display all properties that apply to the given dataset's type -(filesystem, volume, or snapshot). +(filesystem, volume, snapshot, or bookmark). .Bl -tag -width indent .It Fl r Recursively display properties for any children. @@ -2283,6 +2314,26 @@ file system shared on the system. .El .It Xo .Nm +.Cm bookmark +.Ar snapshot +.Ar bookmark +.Xc +.Pp +Creates a bookmark of the given snapshot. +Bookmarks mark the point in time +when the snapshot was created, and can be used as the incremental source for +a +.Qq Nm Cm send +command. +.Pp +This feature must be enabled to be used. +See +.Xr zpool-features 7 +for details on ZFS feature flags and the +.Sy bookmark +feature. +.It Xo +.Nm .Cm send .Op Fl DnPpRv .Op Fl i Ar snapshot | Fl I Ar snapshot @@ -2301,17 +2352,15 @@ a file or to a different system (for exa By default, a full stream is generated. .Bl -tag -width indent .It Fl i Ar snapshot -Generate an incremental stream from the -.Fl i Ar snapshot -to the last -.Ar snapshot . -The incremental source (the -.Fl i Ar snapshot ) -can be specified as the last component of the snapshot name (for example, the -part after the -.Sy @ ) , -and it is assumed to be from the same file system as the last -.Ar snapshot . +Generate an incremental stream from the first +.Ar snapshot Pq the incremental source +to the second +.Ar snapshot Pq the incremental target . +The incremental source can be specified as the last component of the +snapshot name +.Pq the Em @ No character and following +and +it is assumed to be from the same file system as the incremental target. .Pp If the destination is a clone, the source may be the origin snapshot, which must be fully specified (for example, @@ -2319,15 +2368,16 @@ must be fully specified (for example, not just .Cm @origin ) . .It Fl I Ar snapshot -Generate a stream package that sends all intermediary snapshots from the -.Fl I Ar snapshot -to the last +Generate a stream package that sends all intermediary snapshots from the first +.Ar snapshot +to the second .Ar snapshot . For example, .Ic -I @a fs@d is similar to .Ic -i @a fs@b; -i @b fs@c; -i @c fs@d . -The incremental source snapshot may be specified as with the +The incremental +source may be specified as with the .Fl i option. .It Fl R @@ -2380,6 +2430,35 @@ on future versions of .Tn ZFS . .It Xo .Nm +.Cm send +.Op Fl i Ar snapshot Ns | Ns Ar bookmark +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Xc +.Pp +Generate a send stream, which may be of a filesystem, and may be +incremental from a bookmark. +If the destination is a filesystem or volume, +the pool must be read-only, or the filesystem must not be mounted. +When the +stream generated from a filesystem or volume is received, the default snapshot +name will be +.Pq --head-- . +.Bl -tag -width indent +.It Fl i Ar snapshot Ns | Ns bookmark +Generate an incremental send stream. +The incremental source must be an earlier +snapshot in the destination's history. +It will commonly be an earlier +snapshot in the destination's filesystem, in which case it can be +specified as the last component of the name +.Pq the Em # No or Em @ No character and following . +.Pp +If the incremental target is a clone, the incremental source can +be the origin snapshot, or an earlier snapshot in the origin's filesystem, +or the origin's origin, etc. +.El +.It Xo +.Nm .Cm receive Ns | Ns Cm recv .Op Fl vnFu .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Thu Mar 20 00:25:40 2014 (r263406) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Thu Mar 20 00:28:53 2014 (r263407) @@ -24,6 +24,7 @@ * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -72,7 +73,7 @@ uu_avl_pool_t *avl_pool; * Include snaps if they were requested or if this a zfs list where types * were not specified and the "listsnapshots" property is set on this pool. */ -static int +static boolean_t zfs_include_snapshots(zfs_handle_t *zhp, callback_data_t *cb) { zpool_handle_t *zph; @@ -92,8 +93,9 @@ static int zfs_callback(zfs_handle_t *zhp, void *data) { callback_data_t *cb = data; - int dontclose = 0; - int include_snaps = zfs_include_snapshots(zhp, cb); + boolean_t dontclose = B_FALSE; + boolean_t include_snaps = zfs_include_snapshots(zhp, cb); + boolean_t include_bmarks = (cb->cb_types & ZFS_TYPE_BOOKMARK); if ((zfs_get_type(zhp) & cb->cb_types) || ((zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) && include_snaps)) { @@ -119,7 +121,7 @@ zfs_callback(zfs_handle_t *zhp, void *da } } uu_avl_insert(cb->cb_avl, node, idx); - dontclose = 1; + dontclose = B_TRUE; } else { free(node); } @@ -134,11 +136,14 @@ zfs_callback(zfs_handle_t *zhp, void *da cb->cb_depth++; if (zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) (void) zfs_iter_filesystems(zhp, zfs_callback, data); - if ((zfs_get_type(zhp) != ZFS_TYPE_SNAPSHOT) && include_snaps) { + if (((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT | + ZFS_TYPE_BOOKMARK)) == 0) && include_snaps) (void) zfs_iter_snapshots(zhp, (cb->cb_flags & ZFS_ITER_SIMPLE) != 0, zfs_callback, data); - } + if (((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT | + ZFS_TYPE_BOOKMARK)) == 0) && include_bmarks) + (void) zfs_iter_bookmarks(zhp, zfs_callback, data); cb->cb_depth--; } Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Mar 20 00:25:40 2014 (r263406) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Mar 20 00:28:53 2014 (r263407) @@ -107,6 +107,7 @@ static int zfs_do_release(int argc, char static int zfs_do_diff(int argc, char **argv); static int zfs_do_jail(int argc, char **argv); static int zfs_do_unjail(int argc, char **argv); +static int zfs_do_bookmark(int argc, char **argv); /* * Enable a reasonable set of defaults for libumem debugging on DEBUG builds. @@ -155,6 +156,7 @@ typedef enum { HELP_HOLDS, HELP_RELEASE, HELP_DIFF, + HELP_BOOKMARK, } zfs_help_t; typedef struct zfs_command { @@ -181,6 +183,7 @@ static zfs_command_t command_table[] = { { "clone", zfs_do_clone, HELP_CLONE }, { "promote", zfs_do_promote, HELP_PROMOTE }, { "rename", zfs_do_rename, HELP_RENAME }, + { "bookmark", zfs_do_bookmark, HELP_BOOKMARK }, { NULL }, { "list", zfs_do_list, HELP_LIST }, { NULL }, @@ -231,11 +234,12 @@ get_usage(zfs_help_t idx) case HELP_DESTROY: return (gettext("\tdestroy [-fnpRrv] \n" "\tdestroy [-dnpRrv] " - "[%][,...]\n")); + "@[%][,...]\n" + "\tdestroy #\n")); case HELP_GET: return (gettext("\tget [-rHp] [-d max] " - "[-o \"all\" | field[,...]] [-t type[,...]] " - "[-s source[,...]]\n" + "[-o \"all\" | field[,...]]\n" + "\t [-t type[,...]] [-s source[,...]]\n" "\t <\"all\" | property[,...]> " "[filesystem|volume|snapshot] ...\n")); case HELP_INHERIT: @@ -264,15 +268,16 @@ get_usage(zfs_help_t idx) case HELP_RENAME: return (gettext("\trename [-f] " "\n" - "\trename [-f] -p " - "\n" + "\trename [-f] -p \n" "\trename -r \n" "\trename -u [-p] ")); case HELP_ROLLBACK: return (gettext("\trollback [-rRf] \n")); case HELP_SEND: - return (gettext("\tsend [-DnPpRv] " - "[-i snapshot | -I snapshot] \n")); + return (gettext("\tsend [-DnPpRv] [-[iI] snapshot] " + "\n" + "\tsend [-i snapshot|bookmark] " + "\n")); case HELP_SET: return (gettext("\tset " " ...\n")); @@ -280,7 +285,7 @@ get_usage(zfs_help_t idx) return (gettext("\tshare <-a | filesystem>\n")); case HELP_SNAPSHOT: return (gettext("\tsnapshot|snap [-r] [-o property=value] ... " - " ...\n")); + "@ ...\n")); case HELP_UNMOUNT: return (gettext("\tunmount|umount [-f] " "<-a | filesystem|mountpoint>\n")); @@ -309,11 +314,13 @@ get_usage(zfs_help_t idx) "\n")); case HELP_USERSPACE: return (gettext("\tuserspace [-Hinp] [-o field[,...]] " - "[-s field]...\n\t [-S field]... [-t type[,...]] " + "[-s field] ...\n" + "\t [-S field] ... [-t type[,...]] " "\n")); case HELP_GROUPSPACE: return (gettext("\tgroupspace [-Hinp] [-o field[,...]] " - "[-s field]...\n\t [-S field]... [-t type[,...]] " + "[-s field] ...\n" + "\t [-S field] ... [-t type[,...]] " "\n")); case HELP_HOLD: return (gettext("\thold [-r] ...\n")); @@ -324,6 +331,8 @@ get_usage(zfs_help_t idx) case HELP_DIFF: return (gettext("\tdiff [-FHt] " "[snapshot|filesystem]\n")); + case HELP_BOOKMARK: + return (gettext("\tbookmark \n")); } abort(); @@ -926,6 +935,7 @@ typedef struct destroy_cbdata { char *cb_prevsnap; int64_t cb_snapused; char *cb_snapspec; + char *cb_bookmark; } destroy_cbdata_t; /* @@ -1195,7 +1205,7 @@ zfs_do_destroy(int argc, char **argv) int err = 0; int c; zfs_handle_t *zhp = NULL; - char *at; + char *at, *pound; zfs_type_t type = ZFS_TYPE_DATASET; /* check options */ @@ -1247,6 +1257,7 @@ zfs_do_destroy(int argc, char **argv) } at = strchr(argv[0], '@'); + pound = strchr(argv[0], '#'); if (at != NULL) { /* Build the list of snaps to destroy in cb_nvl. */ @@ -1308,6 +1319,46 @@ zfs_do_destroy(int argc, char **argv) if (err != 0) rv = 1; + } else if (pound != NULL) { + int err; + nvlist_t *nvl; + + if (cb.cb_dryrun) { + (void) fprintf(stderr, + "dryrun is not supported with bookmark\n"); + return (-1); + } + + if (cb.cb_defer_destroy) { + (void) fprintf(stderr, + "defer destroy is not supported with bookmark\n"); + return (-1); + } + + if (cb.cb_recurse) { + (void) fprintf(stderr, + "recursive is not supported with bookmark\n"); + return (-1); + } + + if (!zfs_bookmark_exists(argv[0])) { + (void) fprintf(stderr, gettext("bookmark '%s' " + "does not exist.\n"), argv[0]); + return (1); + } + + nvl = fnvlist_alloc(); + fnvlist_add_boolean(nvl, argv[0]); + + err = lzc_destroy_bookmarks(nvl, NULL); + if (err != 0) { + (void) zfs_standard_error(g_zfs, err, + "cannot destroy bookmark"); + } + + nvlist_free(cb.cb_nvl); + + return (err); } else { /* Open the given dataset */ if ((zhp = zfs_open(g_zfs, argv[0], type)) == NULL) @@ -1670,7 +1721,8 @@ zfs_do_get(int argc, char **argv) flags &= ~ZFS_ITER_PROP_LISTSNAPS; while (*optarg != '\0') { static char *type_subopts[] = { "filesystem", - "volume", "snapshot", "all", NULL }; + "volume", "snapshot", "bookmark", + "all", NULL }; switch (getsubopt(&optarg, type_subopts, &value)) { @@ -1684,7 +1736,11 @@ zfs_do_get(int argc, char **argv) types |= ZFS_TYPE_SNAPSHOT; break; case 3: - types = ZFS_TYPE_DATASET; + types |= ZFS_TYPE_BOOKMARK; + break; + case 4: + types = ZFS_TYPE_DATASET | + ZFS_TYPE_BOOKMARK; break; default: @@ -3029,7 +3085,8 @@ zfs_do_list(int argc, char **argv) flags &= ~ZFS_ITER_PROP_LISTSNAPS; while (*optarg != '\0') { static char *type_subopts[] = { "filesystem", - "volume", "snapshot", "snap", "all", NULL }; + "volume", "snapshot", "snap", "bookmark", + "all", NULL }; switch (getsubopt(&optarg, type_subopts, &value)) { @@ -3044,9 +3101,12 @@ zfs_do_list(int argc, char **argv) types |= ZFS_TYPE_SNAPSHOT; break; case 4: - types = ZFS_TYPE_DATASET; + types |= ZFS_TYPE_BOOKMARK; + break; + case 5: + types = ZFS_TYPE_DATASET | + ZFS_TYPE_BOOKMARK; break; - default: (void) fprintf(stderr, gettext("invalid type '%s'\n"), @@ -3286,9 +3346,29 @@ typedef struct rollback_cbdata { char *cb_target; int cb_error; boolean_t cb_recurse; - boolean_t cb_dependent; } rollback_cbdata_t; +static int +rollback_check_dependent(zfs_handle_t *zhp, void *data) +{ + rollback_cbdata_t *cbp = data; + + if (cbp->cb_first && cbp->cb_recurse) { + (void) fprintf(stderr, gettext("cannot rollback to " + "'%s': clones of previous snapshots exist\n"), + cbp->cb_target); + (void) fprintf(stderr, gettext("use '-R' to " + "force deletion of the following clones and " + "dependents:\n")); + cbp->cb_first = 0; + cbp->cb_error = 1; + } + + (void) fprintf(stderr, "%s\n", zfs_get_name(zhp)); + + zfs_close(zhp); + return (0); +} /* * Report any snapshots more recent than the one specified. Used when '-r' is * not specified. We reuse this same callback for the snapshot dependents - if @@ -3305,52 +3385,30 @@ rollback_check(zfs_handle_t *zhp, void * return (0); } - if (!cbp->cb_dependent) { - if (strcmp(zfs_get_name(zhp), cbp->cb_target) != 0 && - zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT && - zfs_prop_get_int(zhp, ZFS_PROP_CREATETXG) > - cbp->cb_create) { - - if (cbp->cb_first && !cbp->cb_recurse) { - (void) fprintf(stderr, gettext("cannot " - "rollback to '%s': more recent snapshots " - "exist\n"), - cbp->cb_target); - (void) fprintf(stderr, gettext("use '-r' to " - "force deletion of the following " - "snapshots:\n")); - cbp->cb_first = 0; - cbp->cb_error = 1; - } - - if (cbp->cb_recurse) { - cbp->cb_dependent = B_TRUE; - if (zfs_iter_dependents(zhp, B_TRUE, - rollback_check, cbp) != 0) { - zfs_close(zhp); - return (-1); - } - cbp->cb_dependent = B_FALSE; - } else { - (void) fprintf(stderr, "%s\n", - zfs_get_name(zhp)); - } - } - } else { - if (cbp->cb_first && cbp->cb_recurse) { - (void) fprintf(stderr, gettext("cannot rollback to " - "'%s': clones of previous snapshots exist\n"), + if (zfs_prop_get_int(zhp, ZFS_PROP_CREATETXG) > cbp->cb_create) { + if (cbp->cb_first && !cbp->cb_recurse) { + (void) fprintf(stderr, gettext("cannot " + "rollback to '%s': more recent snapshots " + "or bookmarks exist\n"), cbp->cb_target); - (void) fprintf(stderr, gettext("use '-R' to " - "force deletion of the following clones and " - "dependents:\n")); + (void) fprintf(stderr, gettext("use '-r' to " + "force deletion of the following " + "snapshots and bookmarks:\n")); cbp->cb_first = 0; cbp->cb_error = 1; } - (void) fprintf(stderr, "%s\n", zfs_get_name(zhp)); + if (cbp->cb_recurse) { + if (zfs_iter_dependents(zhp, B_TRUE, + rollback_check_dependent, cbp) != 0) { + zfs_close(zhp); + return (-1); + } + } else { + (void) fprintf(stderr, "%s\n", + zfs_get_name(zhp)); + } } - zfs_close(zhp); return (0); } @@ -3420,7 +3478,9 @@ zfs_do_rollback(int argc, char **argv) cb.cb_create = zfs_prop_get_int(snap, ZFS_PROP_CREATETXG); cb.cb_first = B_TRUE; cb.cb_error = 0; - if ((ret = zfs_iter_children(zhp, rollback_check, &cb)) != 0) + if ((ret = zfs_iter_snapshots(zhp, B_FALSE, rollback_check, &cb)) != 0) + goto out; + if ((ret = zfs_iter_bookmarks(zhp, rollback_check, &cb)) != 0) goto out; if ((ret = cb.cb_error) != 0) @@ -3715,12 +3775,45 @@ zfs_do_send(int argc, char **argv) return (1); } - cp = strchr(argv[0], '@'); - if (cp == NULL) { - (void) fprintf(stderr, - gettext("argument must be a snapshot\n")); - usage(B_FALSE); + /* + * Special case sending a filesystem, or from a bookmark. + */ + if (strchr(argv[0], '@') == NULL || + (fromname && strchr(fromname, '#') != NULL)) { + char frombuf[ZFS_MAXNAMELEN]; + + if (flags.replicate || flags.doall || flags.props || + flags.dedup || flags.dryrun || flags.verbose || + flags.progress) { + (void) fprintf(stderr, + gettext("Error: " + "Unsupported flag with filesystem or bookmark.\n")); + return (1); + } + + zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_DATASET); + if (zhp == NULL) + return (1); + + if (fromname != NULL && + (fromname[0] == '#' || fromname[0] == '@')) { + /* + * Incremental source name begins with # or @. + * Default to same fs as target. + */ + (void) strncpy(frombuf, argv[0], sizeof (frombuf)); + cp = strchr(frombuf, '@'); + if (cp != NULL) + *cp = '\0'; + (void) strlcat(frombuf, fromname, sizeof (frombuf)); + fromname = frombuf; + } + err = zfs_send_one(zhp, fromname, STDOUT_FILENO); + zfs_close(zhp); + return (err != 0); } + + cp = strchr(argv[0], '@'); *cp = '\0'; toname = cp + 1; zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME); @@ -3876,6 +3969,7 @@ zfs_do_receive(int argc, char **argv) #define ZFS_DELEG_PERM_HOLD "hold" #define ZFS_DELEG_PERM_RELEASE "release" #define ZFS_DELEG_PERM_DIFF "diff" +#define ZFS_DELEG_PERM_BOOKMARK "bookmark" #define ZFS_NUM_DELEG_NOTES ZFS_DELEG_NOTE_NONE @@ -3895,6 +3989,7 @@ static zfs_deleg_perm_tab_t zfs_deleg_pe { ZFS_DELEG_PERM_SEND, ZFS_DELEG_NOTE_SEND }, { ZFS_DELEG_PERM_SHARE, ZFS_DELEG_NOTE_SHARE }, { ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT }, + { ZFS_DELEG_PERM_BOOKMARK, ZFS_DELEG_NOTE_BOOKMARK }, { ZFS_DELEG_PERM_GROUPQUOTA, ZFS_DELEG_NOTE_GROUPQUOTA }, { ZFS_DELEG_PERM_GROUPUSED, ZFS_DELEG_NOTE_GROUPUSED }, @@ -6666,6 +6761,108 @@ zfs_do_diff(int argc, char **argv) return (err != 0); } +/* + * zfs bookmark + * + * Creates a bookmark with the given name from the given snapshot. + */ +static int +zfs_do_bookmark(int argc, char **argv) +{ + char snapname[ZFS_MAXNAMELEN]; + zfs_handle_t *zhp; + nvlist_t *nvl; + int ret = 0; + int c; + + /* check options */ + while ((c = getopt(argc, argv, "")) != -1) { + switch (c) { + case '?': + (void) fprintf(stderr, + gettext("invalid option '%c'\n"), optopt); + goto usage; + } + } + + argc -= optind; + argv += optind; + + /* check number of arguments */ + if (argc < 1) { + (void) fprintf(stderr, gettext("missing snapshot argument\n")); + goto usage; + } + if (argc < 2) { + (void) fprintf(stderr, gettext("missing bookmark argument\n")); + goto usage; + } + + if (strchr(argv[1], '#') == NULL) { + (void) fprintf(stderr, + gettext("invalid bookmark name '%s' -- " + "must contain a '#'\n"), argv[1]); + goto usage; + } + + if (argv[0][0] == '@') { + /* + * Snapshot name begins with @. + * Default to same fs as bookmark. + */ + (void) strncpy(snapname, argv[1], sizeof (snapname)); + *strchr(snapname, '#') = '\0'; + (void) strlcat(snapname, argv[0], sizeof (snapname)); + } else { + (void) strncpy(snapname, argv[0], sizeof (snapname)); + } + zhp = zfs_open(g_zfs, snapname, ZFS_TYPE_SNAPSHOT); + if (zhp == NULL) + goto usage; + zfs_close(zhp); + + + nvl = fnvlist_alloc(); + fnvlist_add_string(nvl, argv[1], snapname); + ret = lzc_bookmark(nvl, NULL); + fnvlist_free(nvl); + + if (ret != 0) { + const char *err_msg; + char errbuf[1024]; + + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot create bookmark '%s'"), argv[1]); + + switch (ret) { + case EXDEV: + err_msg = "bookmark is in a different pool"; + break; + case EEXIST: + err_msg = "bookmark exists"; + break; + case EINVAL: + err_msg = "invalid argument"; + break; + case ENOTSUP: + err_msg = "bookmark feature not enabled"; + break; + default: + err_msg = "unknown error"; + break; + } + (void) fprintf(stderr, "%s: %s\n", errbuf, + dgettext(TEXT_DOMAIN, err_msg)); + } + + return (ret); + +usage: + usage(B_FALSE); + return (-1); +} + int main(int argc, char **argv) { Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Thu Mar 20 00:25:40 2014 (r263406) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Thu Mar 20 00:28:53 2014 (r263407) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 31, 2013 +.Dd January 2, 2014 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -222,12 +222,16 @@ command. Please note that doing so will immediately activate the .Sy lz4_compress feature on the underlying -pool (even before any data is written). Since this feature is not -read-only compatible, this operation will render the pool unimportable -on systems without support for the +pool +.Pq even before any data is written , +and the feature will not be +deactivated. +Since this feature is not read-only compatible, this +operation will render the pool unimportable on systems without support +for the .Sy lz4_compress -feature. At the -moment, this operation cannot be reversed. Booting off of +feature. +Booting off of .Sy lz4 -compressed root pools is supported. .It Sy multi_vdev_crash_dump @@ -286,6 +290,25 @@ and will be returned to the .Sy enabled state when all datasets that use this feature are destroyed. +.It Sy bookmarks +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:bookmarks" +.It GUID Ta com.delphix:bookmarks +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta extensible_dataset +.El +.Pp +This feature enables use of the +.Nm zfs +.Cm bookmark +subcommand. +.Pp +This feature is +.Sy active +while any bookmarks exist in the pool. +All bookmarks in the pool can be listed by running +.Nm zfs +.Cm list +.Fl t No bookmark Fl r Ar poolname . .It Sy enabled_txg .Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:enabled_txg" .It GUID Ta com.delphix:enabled_txg Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Mar 20 00:25:40 2014 (r263406) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Mar 20 00:28:53 2014 (r263407) @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -193,6 +193,7 @@ extern int zpool_log_history(libzfs_hand extern int libzfs_errno(libzfs_handle_t *); extern const char *libzfs_error_action(libzfs_handle_t *); extern const char *libzfs_error_description(libzfs_handle_t *); +extern int zfs_standard_error(libzfs_handle_t *, int, const char *); extern void libzfs_mnttab_init(libzfs_handle_t *); extern void libzfs_mnttab_fini(libzfs_handle_t *); extern void libzfs_mnttab_cache(libzfs_handle_t *, boolean_t); @@ -537,6 +538,7 @@ extern int zfs_iter_filesystems(zfs_hand extern int zfs_iter_snapshots(zfs_handle_t *, boolean_t, zfs_iter_f, void *); extern int zfs_iter_snapshots_sorted(zfs_handle_t *, zfs_iter_f, void *); extern int zfs_iter_snapspec(zfs_handle_t *, const char *, zfs_iter_f, void *); +extern int zfs_iter_bookmarks(zfs_handle_t *, zfs_iter_f, void *); typedef struct get_all_cb { zfs_handle_t **cb_handles; @@ -611,6 +613,7 @@ typedef boolean_t (snapfilter_cb_t)(zfs_ extern int zfs_send(zfs_handle_t *, const char *, const char *, sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **); +extern int zfs_send_one(zfs_handle_t *, const char *, int); extern int zfs_promote(zfs_handle_t *); extern int zfs_hold(zfs_handle_t *, const char *, const char *, @@ -680,6 +683,7 @@ extern zfs_handle_t *zfs_path_to_zhandle extern boolean_t zfs_dataset_exists(libzfs_handle_t *, const char *, zfs_type_t); extern int zfs_spa_version(zfs_handle_t *, int *); +extern boolean_t zfs_bookmark_exists(const char *path); /* * Mount support functions. Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Mar 20 00:25:40 2014 (r263406) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Mar 20 00:28:53 2014 (r263407) @@ -295,7 +295,7 @@ zpool_handle(zfs_handle_t *zhp) int len; zpool_handle_t *zph; - len = strcspn(zhp->zfs_name, "/@") + 1; + len = strcspn(zhp->zfs_name, "/@#") + 1; pool_name = zfs_alloc(zhp->zfs_hdl, len); (void) strlcpy(pool_name, zhp->zfs_name, len); @@ -579,6 +579,70 @@ zfs_handle_dup(zfs_handle_t *zhp_orig) return (zhp); } +boolean_t +zfs_bookmark_exists(const char *path) +{ + nvlist_t *bmarks; + nvlist_t *props; + char fsname[ZFS_MAXNAMELEN]; + char *bmark_name; + char *pound; + int err; + boolean_t rv; + + + (void) strlcpy(fsname, path, sizeof (fsname)); + pound = strchr(fsname, '#'); + if (pound == NULL) + return (B_FALSE); + + *pound = '\0'; + bmark_name = pound + 1; + props = fnvlist_alloc(); + err = lzc_get_bookmarks(fsname, props, &bmarks); + nvlist_free(props); + if (err != 0) { + nvlist_free(bmarks); + return (B_FALSE); + } + + rv = nvlist_exists(bmarks, bmark_name); + nvlist_free(bmarks); + return (rv); +} + +zfs_handle_t * +make_bookmark_handle(zfs_handle_t *parent, const char *path, + nvlist_t *bmark_props) +{ + zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1); + + if (zhp == NULL) + return (NULL); + + /* Fill in the name. */ + zhp->zfs_hdl = parent->zfs_hdl; + (void) strlcpy(zhp->zfs_name, path, sizeof (zhp->zfs_name)); + + /* Set the property lists. */ + if (nvlist_dup(bmark_props, &zhp->zfs_props, 0) != 0) { + free(zhp); + return (NULL); + } + + /* Set the types. */ + zhp->zfs_head_type = parent->zfs_head_type; + zhp->zfs_type = ZFS_TYPE_BOOKMARK; + + if ((zhp->zpool_hdl = zpool_handle(zhp)) == NULL) { + nvlist_free(zhp->zfs_props); + free(zhp); + return (NULL); + } + + return (zhp); +} + /* * Opens the given snapshot, filesystem, or volume. The 'types' * argument is a mask of acceptable types. The function will print an @@ -2271,6 +2335,9 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop case ZFS_TYPE_SNAPSHOT: str = "snapshot"; break; + case ZFS_TYPE_BOOKMARK: + str = "bookmark"; + break; default: abort(); } @@ -3133,6 +3200,19 @@ zfs_destroy(zfs_handle_t *zhp, boolean_t { zfs_cmd_t zc = { 0 }; + if (zhp->zfs_type == ZFS_TYPE_BOOKMARK) { + nvlist_t *nv = fnvlist_alloc(); + fnvlist_add_boolean(nv, zhp->zfs_name); + int error = lzc_destroy_bookmarks(nv, NULL); + fnvlist_free(nv); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 20 23:48:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 82D0BA1A; Thu, 20 Mar 2014 23:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E46E7CC; Thu, 20 Mar 2014 23:48: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 s2KNmJG5089438; Thu, 20 Mar 2014 23:48:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KNmJUt089437; Thu, 20 Mar 2014 23:48:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403202348.s2KNmJUt089437@svn.freebsd.org> From: Dimitry Andric Date: Thu, 20 Mar 2014 23:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263455 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 23:48:19 -0000 Author: dim Date: Thu Mar 20 23:48:18 2014 New Revision: 263455 URL: http://svnweb.freebsd.org/changeset/base/263455 Log: MFC r262393 (by ian): Fix a typo _IMX51_TZICRREG_H_ -> _IMX51_TZICREG_H_ (extra R) Modified: stable/10/sys/arm/freescale/imx/imx51_tzicreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx51_tzicreg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_tzicreg.h Thu Mar 20 23:16:58 2014 (r263454) +++ stable/10/sys/arm/freescale/imx/imx51_tzicreg.h Thu Mar 20 23:48:18 2014 (r263455) @@ -57,7 +57,7 @@ */ #ifndef _IMX51_TZICREG_H_ -#define _IMX51_TZICRREG_H_ +#define _IMX51_TZICREG_H_ #include From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 21 00:19:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9441D172; Fri, 21 Mar 2014 00:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80B32AA9; Fri, 21 Mar 2014 00:19: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 s2L0JL4L002490; Fri, 21 Mar 2014 00:19:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2L0JLSK002489; Fri, 21 Mar 2014 00:19:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403210019.s2L0JLSK002489@svn.freebsd.org> From: Dimitry Andric Date: Fri, 21 Mar 2014 00:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263456 - stable/10/sys/arm/ti/twl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 00:19:21 -0000 Author: dim Date: Fri Mar 21 00:19:20 2014 New Revision: 263456 URL: http://svnweb.freebsd.org/changeset/base/263456 Log: MFC r262408 (by ian): Eliminate an unused-var warning by wrapping #if 0 around some tables of values that were probably entered "for completeness" from a datasheet, and for all I know may be useful/necessary some day. Modified: stable/10/sys/arm/ti/twl/twl_vreg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/ti/twl/twl_vreg.c ============================================================================== --- stable/10/sys/arm/ti/twl/twl_vreg.c Thu Mar 20 23:48:18 2014 (r263455) +++ stable/10/sys/arm/ti/twl/twl_vreg.c Fri Mar 21 00:19:20 2014 (r263456) @@ -138,6 +138,7 @@ static const uint16_t twl4030_vsim_volta static const uint16_t twl4030_vdac_voltages[] = { 1200, 1300, 1800, 1800 }; +#if 0 /* vdd1, vdd2, vdio, not currently used. */ static const uint16_t twl4030_vdd1_voltages[] = { 800, 1450 }; @@ -147,6 +148,7 @@ static const uint16_t twl4030_vdd2_volta static const uint16_t twl4030_vio_voltages[] = { 1800, 1850 }; +#endif static const uint16_t twl4030_vintana2_voltages[] = { 2500, 2750 }; From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 21 13:31:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E129D8D3; Fri, 21 Mar 2014 13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C7AB6A73; Fri, 21 Mar 2014 13: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 s2LDVu8r024039; Fri, 21 Mar 2014 13:31:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LDVudg024038; Fri, 21 Mar 2014 13:31:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403211331.s2LDVudg024038@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 21 Mar 2014 13:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263470 - stable/10/sys/x86/iommu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 13:31:57 -0000 Author: kib Date: Fri Mar 21 13:31:56 2014 New Revision: 263470 URL: http://svnweb.freebsd.org/changeset/base/263470 Log: MFC r263304: Trim at EOL. Modified: stable/10/sys/x86/iommu/busdma_dmar.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/busdma_dmar.c ============================================================================== --- stable/10/sys/x86/iommu/busdma_dmar.c Fri Mar 21 11:11:30 2014 (r263469) +++ stable/10/sys/x86/iommu/busdma_dmar.c Fri Mar 21 13:31:56 2014 (r263470) @@ -237,7 +237,7 @@ dmar_bus_dmamap_create(bus_dma_tag_t dma map->cansleep = false; tag->map_count++; *mapp = (bus_dmamap_t)map; - + return (0); } @@ -280,7 +280,7 @@ dmar_bus_dmamem_alloc(bus_dma_tag_t dmat mflags |= (flags & BUS_DMA_ZERO) != 0 ? M_ZERO : 0; attr = (flags & BUS_DMA_NOCACHE) != 0 ? VM_MEMATTR_UNCACHEABLE : VM_MEMATTR_DEFAULT; - + tag = (struct bus_dma_tag_dmar *)dmat; map = (struct bus_dmamap_dmar *)*mapp; From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 21 15:15:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DE140BC4; Fri, 21 Mar 2014 15:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2FBC84B; Fri, 21 Mar 2014 15:15: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 s2LFFbt5064897; Fri, 21 Mar 2014 15:15:37 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LFFVUb064861; Fri, 21 Mar 2014 15:15:31 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403211515.s2LFFVUb064861@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 21 Mar 2014 15:15:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263478 - in stable/10: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 15:15:38 -0000 Author: glebius Date: Fri Mar 21 15:15:30 2014 New Revision: 263478 URL: http://svnweb.freebsd.org/changeset/base/263478 Log: Merge r262763, r262767, r262771, r262806 from head: - Remove rt_metrics_lite and simply put its members into rtentry. - Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This removes another cache trashing ++ from packet forwarding path. - Create zini/fini methods for the rtentry UMA zone. Via initialize mutex and counter in them. - Fix reporting of rmx_pksent to routing socket. - Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode. Modified: stable/10/share/man/man9/rtentry.9 stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/10/sys/net/if_disc.c stable/10/sys/net/if_faith.c stable/10/sys/net/if_loop.c stable/10/sys/net/if_stf.c stable/10/sys/net/radix_mpath.c stable/10/sys/net/route.c stable/10/sys/net/route.h stable/10/sys/net/rtsock.c stable/10/sys/netatalk/at_proto.c stable/10/sys/netatalk/ddp_output.c stable/10/sys/netinet/in_rmx.c stable/10/sys/netinet/ip_fastfwd.c stable/10/sys/netinet/ip_input.c stable/10/sys/netinet/ip_ipsec.c stable/10/sys/netinet/ip_output.c stable/10/sys/netinet/sctp_os_bsd.h stable/10/sys/netinet/tcp_output.c stable/10/sys/netinet/tcp_subr.c stable/10/sys/netinet6/in6_rmx.c stable/10/sys/netinet6/ip6_ipsec.c stable/10/sys/netinet6/ip6_output.c stable/10/sys/netipx/ipx_input.c stable/10/sys/netipx/ipx_outputfl.c stable/10/sys/netpfil/pf/pf.c stable/10/sys/nfs/bootp_subr.c stable/10/usr.bin/netstat/main.c stable/10/usr.bin/netstat/netstat.h stable/10/usr.bin/netstat/route.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/rtentry.9 ============================================================================== --- stable/10/share/man/man9/rtentry.9 Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/share/man/man9/rtentry.9 Fri Mar 21 15:15:30 2014 (r263478) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 11, 2008 +.Dd March 5, 2014 .Dt RTENTRY 9 .Os .Sh NAME @@ -78,6 +78,12 @@ intermediate stop on the way to that des flag is set). .It Vt "int rt_flags" ; See below. +If the +.Dv RTF_UP +flag is not present, the +.Fn rtfree +function will delete the route from the radix tree when the last +reference drops. .It Vt "int rt_refcnt" ; Route entries are reference-counted; this field indicates the number of external (to the radix tree) references. @@ -89,14 +95,14 @@ as it were, to the question posed by a r name the interface and interface address to be used in sending a packet to the destination or set of destinations which this route represents. -.It Vt "struct rt_metrics_lite rt_rmx" ; -See below. -If the -.Dv RTF_UP -flag is not present, the -.Fn rtfree -function will delete the route from the radix tree when the last -reference drops. +.It Vt "u_long rt_mtu"; +See description of rmx_mtu below. +.It Vt "u_long rt_weight"; +See description of rmx_weight below. +.It Vt "u_long rt_expire"; +See description of rmx_expire below. +.It Vt "counter64_t rt_pksent"; +See description of rmx_pksent below. .It Vt "struct rtentry *rt_gwroute" ; This member is a reference to a route whose destination is .Va rt_gateway . @@ -165,9 +171,7 @@ Indicates that the destination is a broa Indicates that the destination is a multicast address. .El .Pp -Every route has associated with it a set of metrics, stored in -.Vt "struct rt_metrics_lite" . -Metrics are supplied in +Several metrics are supplied in .Vt "struct rt_metrics" passed with routing control messages via .Xr route 4 @@ -176,8 +180,7 @@ Currently only .Vt rmx_mtu , rmx_expire , and .Vt rmx_pksent -metrics are used in -.Vt "struct rt_metrics_lite" . +metrics are supplied. All others are ignored. .Pp The following metrics are defined by Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Fri Mar 21 15:15:30 2014 (r263478) @@ -802,7 +802,7 @@ ipf_fastroute(m0, mpp, fin, fdp) if (ro->ro_rt->rt_flags & RTF_GATEWAY) dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway; if (ro->ro_rt) - ro->ro_rt->rt_use++; + counter_u64_add(ro->ro_rt->rt_pksent, 1); /* * For input packets which are being "fastrouted", they won't Modified: stable/10/sys/net/if_disc.c ============================================================================== --- stable/10/sys/net/if_disc.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/net/if_disc.c Fri Mar 21 15:15:30 2014 (r263478) @@ -185,7 +185,7 @@ static void discrtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info) { RT_LOCK_ASSERT(rt); - rt->rt_rmx.rmx_mtu = DSMTU; + rt->rt_mtu = DSMTU; } /* Modified: stable/10/sys/net/if_faith.c ============================================================================== --- stable/10/sys/net/if_faith.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/net/if_faith.c Fri Mar 21 15:15:30 2014 (r263478) @@ -245,7 +245,7 @@ faithrtrequest(cmd, rt, info) struct rt_addrinfo *info; { RT_LOCK_ASSERT(rt); - rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; + rt->rt_mtu = rt->rt_ifp->if_mtu; } /* Modified: stable/10/sys/net/if_loop.c ============================================================================== --- stable/10/sys/net/if_loop.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/net/if_loop.c Fri Mar 21 15:15:30 2014 (r263478) @@ -394,7 +394,7 @@ lortrequest(int cmd, struct rtentry *rt, { RT_LOCK_ASSERT(rt); - rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; + rt->rt_mtu = rt->rt_ifp->if_mtu; } /* Modified: stable/10/sys/net/if_stf.c ============================================================================== --- stable/10/sys/net/if_stf.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/net/if_stf.c Fri Mar 21 15:15:30 2014 (r263478) @@ -784,7 +784,7 @@ stf_rtrequest(cmd, rt, info) struct rt_addrinfo *info; { RT_LOCK_ASSERT(rt); - rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; + rt->rt_mtu = rt->rt_ifp->if_mtu; } static int Modified: stable/10/sys/net/radix_mpath.c ============================================================================== --- stable/10/sys/net/radix_mpath.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/net/radix_mpath.c Fri Mar 21 15:15:30 2014 (r263478) @@ -85,7 +85,7 @@ rn_mpath_count(struct radix_node *rn) while (rn != NULL) { rt = (struct rtentry *)rn; - i += rt->rt_rmx.rmx_weight; + i += rt->rt_weight; rn = rn_mpath_next(rn); } return (i); @@ -288,8 +288,8 @@ rtalloc_mpath_fib(struct route *ro, uint hash += hashjitter; hash %= n; for (weight = abs((int32_t)hash), rt = ro->ro_rt; - weight >= rt->rt_rmx.rmx_weight && rn; - weight -= rt->rt_rmx.rmx_weight) { + weight >= rt->rt_weight && rn; + weight -= rt->rt_weight) { /* stay within the multipath routes */ if (rn->rn_dupedkey && rn->rn_mask != rn->rn_dupedkey->rn_mask) Modified: stable/10/sys/net/route.c ============================================================================== --- stable/10/sys/net/route.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/net/route.c Fri Mar 21 15:15:30 2014 (r263478) @@ -200,6 +200,48 @@ route_init(void) } SYSINIT(route_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, route_init, 0); +static int +rtentry_zinit(void *mem, int size, int how) +{ + struct rtentry *rt = mem; + + rt->rt_pksent = counter_u64_alloc(how); + if (rt->rt_pksent == NULL) + return (ENOMEM); + + RT_LOCK_INIT(rt); + + return (0); +} + +static void +rtentry_zfini(void *mem, int size) +{ + struct rtentry *rt = mem; + + RT_LOCK_DESTROY(rt); + counter_u64_free(rt->rt_pksent); +} + +static int +rtentry_ctor(void *mem, int size, void *arg, int how) +{ + struct rtentry *rt = mem; + + bzero(rt, offsetof(struct rtentry, rt_endzero)); + counter_u64_zero(rt->rt_pksent); + + return (0); +} + +static void +rtentry_dtor(void *mem, int size, void *arg) +{ + struct rtentry *rt = mem; + + RT_UNLOCK_COND(rt); +} + static void vnet_route_init(const void *unused __unused) { @@ -211,8 +253,9 @@ vnet_route_init(const void *unused __unu V_rt_tables = malloc(rt_numfibs * (AF_MAX+1) * sizeof(struct radix_node_head *), M_RTABLE, M_WAITOK|M_ZERO); - V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); + V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), + rtentry_ctor, rtentry_dtor, + rtentry_zinit, rtentry_zfini, UMA_ALIGN_PTR, 0); for (dom = domains; dom; dom = dom->dom_next) { if (dom->dom_rtattach == NULL) continue; @@ -489,7 +532,6 @@ rtfree(struct rtentry *rt) /* * and the rtentry itself of course */ - RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); return; } @@ -1173,12 +1215,11 @@ rtrequest1_fib(int req, struct rt_addrin } else ifa_ref(info->rti_ifa); ifa = info->rti_ifa; - rt = uma_zalloc(V_rtzone, M_NOWAIT | M_ZERO); + rt = uma_zalloc(V_rtzone, M_NOWAIT); if (rt == NULL) { ifa_free(ifa); senderr(ENOBUFS); } - RT_LOCK_INIT(rt); rt->rt_flags = RTF_UP | flags; rt->rt_fibnum = fibnum; /* @@ -1186,7 +1227,6 @@ rtrequest1_fib(int req, struct rt_addrin */ RT_LOCK(rt); if ((error = rt_setgate(rt, dst, gateway)) != 0) { - RT_LOCK_DESTROY(rt); ifa_free(ifa); uma_zfree(V_rtzone, rt); senderr(error); @@ -1212,7 +1252,7 @@ rtrequest1_fib(int req, struct rt_addrin */ rt->rt_ifa = ifa; rt->rt_ifp = ifa->ifa_ifp; - rt->rt_rmx.rmx_weight = 1; + rt->rt_weight = 1; #ifdef RADIX_MPATH /* do not permit exactly the same dst/mask/gw pair */ @@ -1220,7 +1260,6 @@ rtrequest1_fib(int req, struct rt_addrin rt_mpath_conflict(rnh, rt, netmask)) { ifa_free(rt->rt_ifa); Free(rt_key(rt)); - RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); senderr(EEXIST); } @@ -1288,7 +1327,6 @@ rtrequest1_fib(int req, struct rt_addrin if (rn == NULL) { ifa_free(rt->rt_ifa); Free(rt_key(rt)); - RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); #ifdef FLOWTABLE if (rt0 != NULL) Modified: stable/10/sys/net/route.h ============================================================================== --- stable/10/sys/net/route.h Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/net/route.h Fri Mar 21 15:15:30 2014 (r263478) @@ -33,6 +33,8 @@ #ifndef _NET_ROUTE_H_ #define _NET_ROUTE_H_ +#include + /* * Kernel resident routing tables. * @@ -57,17 +59,6 @@ struct route { #define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ #define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ -/* - * These numbers are used by reliable protocols for determining - * retransmission behavior and are included in the routing structure. - */ -struct rt_metrics_lite { - u_long rmx_mtu; /* MTU for this path */ - u_long rmx_expire; /* lifetime for route, e.g. redirect */ - u_long rmx_pksent; /* packets sent using this route */ - u_long rmx_weight; /* absolute weight */ -}; - struct rt_metrics { u_long rmx_locks; /* Kernel must leave these values alone */ u_long rmx_mtu; /* MTU for this path */ @@ -112,6 +103,8 @@ struct mbuf; #include #endif #endif + +#if defined(_KERNEL) || defined(_WANT_RTENTRY) struct rtentry { struct radix_node rt_nodes[2]; /* tree glue, and other values */ /* @@ -122,17 +115,19 @@ struct rtentry { #define rt_key(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_key))) #define rt_mask(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_mask))) struct sockaddr *rt_gateway; /* value */ - int rt_flags; /* up/down?, host/net */ - int rt_refcnt; /* # held references */ struct ifnet *rt_ifp; /* the answer: interface to use */ struct ifaddr *rt_ifa; /* the answer: interface address to use */ - struct rt_metrics_lite rt_rmx; /* metrics used by rx'ing protocols */ - u_int rt_fibnum; /* which FIB */ -#ifdef _KERNEL - /* XXX ugly, user apps use this definition but don't have a mtx def */ - struct mtx rt_mtx; /* mutex for routing entry */ -#endif + int rt_flags; /* up/down?, host/net */ + int rt_refcnt; /* # held references */ + u_int rt_fibnum; /* which FIB */ + u_long rt_mtu; /* MTU for this path */ + u_long rt_weight; /* absolute weight */ + u_long rt_expire; /* lifetime for route, e.g. redirect */ +#define rt_endzero rt_pksent + counter_u64_t rt_pksent; /* packets sent using this route */ + struct mtx rt_mtx; /* mutex for routing entry */ }; +#endif /* _KERNEL || _WANT_RTENTRY */ /* * Following structure necessary for 4.3 compatibility; @@ -148,8 +143,6 @@ struct ortentry { struct ifnet *rt_ifp; /* the answer: interface to use */ }; -#define rt_use rt_rmx.rmx_pksent - #define RTF_UP 0x1 /* route usable */ #define RTF_GATEWAY 0x2 /* destination is a gateway */ #define RTF_HOST 0x4 /* host entry (net otherwise) */ @@ -314,6 +307,10 @@ struct rt_addrinfo { #define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx) #define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx) #define RT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED) +#define RT_UNLOCK_COND(_rt) do { \ + if (mtx_owned(&(_rt)->rt_mtx)) \ + mtx_unlock(&(_rt)->rt_mtx); \ +} while (0) #define RT_ADDREF(_rt) do { \ RT_LOCK_ASSERT(_rt); \ Modified: stable/10/sys/net/rtsock.c ============================================================================== --- stable/10/sys/net/rtsock.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/net/rtsock.c Fri Mar 21 15:15:30 2014 (r263478) @@ -194,10 +194,8 @@ static int sysctl_dumpentry(struct radix static int sysctl_iflist(int af, struct walkarg *w); static int sysctl_ifmalist(int af, struct walkarg *w); static int route_output(struct mbuf *m, struct socket *so); -static void rt_setmetrics(u_long which, const struct rt_metrics *in, - struct rt_metrics_lite *out); -static void rt_getmetrics(const struct rt_metrics_lite *in, - struct rt_metrics *out); +static void rt_setmetrics(const struct rt_msghdr *rtm, struct rtentry *rt); +static void rt_getmetrics(const struct rtentry *rt, struct rt_metrics *out); static void rt_dispatch(struct mbuf *, sa_family_t); static struct netisr_handler rtsock_nh = { @@ -685,8 +683,7 @@ route_output(struct mbuf *m, struct sock rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; #endif RT_LOCK(saved_nrt); - rt_setmetrics(rtm->rtm_inits, - &rtm->rtm_rmx, &saved_nrt->rt_rmx); + rt_setmetrics(rtm, saved_nrt); rtm->rtm_index = saved_nrt->rt_ifp->if_index; RT_REMREF(saved_nrt); RT_UNLOCK(saved_nrt); @@ -860,7 +857,7 @@ route_output(struct mbuf *m, struct sock (rt->rt_flags & ~RTF_GWFLAG_COMPAT); else rtm->rtm_flags = rt->rt_flags; - rt_getmetrics(&rt->rt_rmx, &rtm->rtm_rmx); + rt_getmetrics(rt, &rtm->rtm_rmx); rtm->rtm_addrs = info.rti_addrs; break; @@ -923,8 +920,7 @@ route_output(struct mbuf *m, struct sock /* Allow some flags to be toggled on change. */ rt->rt_flags = (rt->rt_flags & ~RTF_FMASK) | (rtm->rtm_flags & RTF_FMASK); - rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx, - &rt->rt_rmx); + rt_setmetrics(rtm, rt); rtm->rtm_index = rt->rt_ifp->if_index; if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest) rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, &info); @@ -1012,34 +1008,30 @@ flush: } static void -rt_setmetrics(u_long which, const struct rt_metrics *in, - struct rt_metrics_lite *out) +rt_setmetrics(const struct rt_msghdr *rtm, struct rtentry *rt) { -#define metric(f, e) if (which & (f)) out->e = in->e; - /* - * Only these are stored in the routing entry since introduction - * of tcp hostcache. The rest is ignored. - */ - metric(RTV_MTU, rmx_mtu); - metric(RTV_WEIGHT, rmx_weight); - /* Userland -> kernel timebase conversion. */ - if (which & RTV_EXPIRE) - out->rmx_expire = in->rmx_expire ? - in->rmx_expire - time_second + time_uptime : 0; -#undef metric + + if (rtm->rtm_inits & RTV_MTU) + rt->rt_mtu = rtm->rtm_rmx.rmx_mtu; + if (rtm->rtm_inits & RTV_WEIGHT) + rt->rt_weight = rtm->rtm_rmx.rmx_weight; + /* Kernel -> userland timebase conversion. */ + if (rtm->rtm_inits & RTV_EXPIRE) + rt->rt_expire = rtm->rtm_rmx.rmx_expire ? + rtm->rtm_rmx.rmx_expire - time_second + time_uptime : 0; } static void -rt_getmetrics(const struct rt_metrics_lite *in, struct rt_metrics *out) +rt_getmetrics(const struct rtentry *rt, struct rt_metrics *out) { -#define metric(e) out->e = in->e; + bzero(out, sizeof(*out)); - metric(rmx_mtu); - metric(rmx_weight); + out->rmx_mtu = rt->rt_mtu; + out->rmx_weight = rt->rt_weight; + out->rmx_pksent = counter_u64_fetch(rt->rt_pksent); /* Kernel -> userland timebase conversion. */ - out->rmx_expire = in->rmx_expire ? - in->rmx_expire - time_uptime + time_second : 0; -#undef metric + out->rmx_expire = rt->rt_expire ? + rt->rt_expire - time_uptime + time_second : 0; } /* @@ -1603,11 +1595,7 @@ sysctl_dumpentry(struct radix_node *rn, (rt->rt_flags & ~RTF_GWFLAG_COMPAT); else rtm->rtm_flags = rt->rt_flags; - /* - * let's be honest about this being a retarded hack - */ - rtm->rtm_fmask = rt->rt_rmx.rmx_pksent; - rt_getmetrics(&rt->rt_rmx, &rtm->rtm_rmx); + rt_getmetrics(rt, &rtm->rtm_rmx); rtm->rtm_index = rt->rt_ifp->if_index; rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0; rtm->rtm_addrs = info.rti_addrs; Modified: stable/10/sys/netatalk/at_proto.c ============================================================================== --- stable/10/sys/netatalk/at_proto.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netatalk/at_proto.c Fri Mar 21 15:15:30 2014 (r263478) @@ -24,6 +24,7 @@ */ #include +#include #include #include #include Modified: stable/10/sys/netatalk/ddp_output.c ============================================================================== --- stable/10/sys/netatalk/ddp_output.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netatalk/ddp_output.c Fri Mar 21 15:15:30 2014 (r263478) @@ -221,7 +221,7 @@ ddp_route(struct mbuf *m, struct route * elh->el_type = ELAP_DDPEXTEND; elh->el_dnode = gate.sat_addr.s_node; } - ro->ro_rt->rt_use++; + counter_u64_add(ro->ro_rt->rt_pksent, 1); #ifdef NETATALK_DEBUG printf ("ddp_route: from %d.%d to %d.%d, via %d.%d (%s)\n", Modified: stable/10/sys/netinet/in_rmx.c ============================================================================== --- stable/10/sys/netinet/in_rmx.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet/in_rmx.c Fri Mar 21 15:15:30 2014 (r263478) @@ -93,8 +93,8 @@ in_addroute(void *v_arg, void *n_arg, st if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) rt->rt_flags |= RTF_MULTICAST; - if (!rt->rt_rmx.rmx_mtu && rt->rt_ifp) - rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; + if (rt->rt_mtu == 0 && rt->rt_ifp != NULL) + rt->rt_mtu = rt->rt_ifp->if_mtu; return (rn_addroute(v_arg, n_arg, head, treenodes)); } @@ -114,7 +114,7 @@ in_matroute(void *v_arg, struct radix_no RT_LOCK(rt); if (rt->rt_flags & RTPRF_OURS) { rt->rt_flags &= ~RTPRF_OURS; - rt->rt_rmx.rmx_expire = 0; + rt->rt_expire = 0; } RT_UNLOCK(rt); } @@ -167,7 +167,7 @@ in_clsroute(struct radix_node *rn, struc */ if (V_rtq_reallyold != 0) { rt->rt_flags |= RTPRF_OURS; - rt->rt_rmx.rmx_expire = time_uptime + V_rtq_reallyold; + rt->rt_expire = time_uptime + V_rtq_reallyold; } else { rtexpunge(rt); } @@ -199,7 +199,7 @@ in_rtqkill(struct radix_node *rn, void * if (rt->rt_flags & RTPRF_OURS) { ap->found++; - if (ap->draining || rt->rt_rmx.rmx_expire <= time_uptime) { + if (ap->draining || rt->rt_expire <= time_uptime) { if (rt->rt_refcnt > 0) panic("rtqkill route really not free"); @@ -215,13 +215,9 @@ in_rtqkill(struct radix_node *rn, void * } } else { if (ap->updating && - (rt->rt_rmx.rmx_expire - time_uptime > - V_rtq_reallyold)) { - rt->rt_rmx.rmx_expire = - time_uptime + V_rtq_reallyold; - } - ap->nextstop = lmin(ap->nextstop, - rt->rt_rmx.rmx_expire); + (rt->rt_expire - time_uptime > V_rtq_reallyold)) + rt->rt_expire = time_uptime + V_rtq_reallyold; + ap->nextstop = lmin(ap->nextstop, rt->rt_expire); } } Modified: stable/10/sys/netinet/ip_fastfwd.c ============================================================================== --- stable/10/sys/netinet/ip_fastfwd.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet/ip_fastfwd.c Fri Mar 21 15:15:30 2014 (r263478) @@ -491,8 +491,7 @@ passout: * Check if route is dampned (when ARP is unable to resolve) */ if ((ro.ro_rt->rt_flags & RTF_REJECT) && - (ro.ro_rt->rt_rmx.rmx_expire == 0 || - time_uptime < ro.ro_rt->rt_rmx.rmx_expire)) { + (ro.ro_rt->rt_expire == 0 || time_uptime < ro.ro_rt->rt_expire)) { icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); goto consumed; } @@ -520,8 +519,8 @@ passout: /* * Check if packet fits MTU or if hardware will fragment for us */ - if (ro.ro_rt->rt_rmx.rmx_mtu) - mtu = min(ro.ro_rt->rt_rmx.rmx_mtu, ifp->if_mtu); + if (ro.ro_rt->rt_mtu) + mtu = min(ro.ro_rt->rt_mtu, ifp->if_mtu); else mtu = ifp->if_mtu; @@ -586,7 +585,7 @@ passout: if (error != 0) IPSTAT_INC(ips_odropped); else { - ro.ro_rt->rt_rmx.rmx_pksent++; + counter_u64_add(ro.ro_rt->rt_pksent, 1); IPSTAT_INC(ips_forward); IPSTAT_INC(ips_fastforward); } Modified: stable/10/sys/netinet/ip_input.c ============================================================================== --- stable/10/sys/netinet/ip_input.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet/ip_input.c Fri Mar 21 15:15:30 2014 (r263478) @@ -1471,7 +1471,7 @@ ip_forward(struct mbuf *m, int srcrt) error = ip_output(m, NULL, &ro, IP_FORWARDING, NULL, NULL); if (error == EMSGSIZE && ro.ro_rt) - mtu = ro.ro_rt->rt_rmx.rmx_mtu; + mtu = ro.ro_rt->rt_mtu; RO_RTFREE(&ro); if (error) Modified: stable/10/sys/netinet/ip_ipsec.c ============================================================================== --- stable/10/sys/netinet/ip_ipsec.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet/ip_ipsec.c Fri Mar 21 15:15:30 2014 (r263478) @@ -236,9 +236,7 @@ ip_ipsec_mtu(struct mbuf *m, int mtu) sp->req->sav->sah != NULL) { ro = &sp->req->sav->sah->route_cache.sa_route; if (ro->ro_rt && ro->ro_rt->rt_ifp) { - mtu = - ro->ro_rt->rt_rmx.rmx_mtu ? - ro->ro_rt->rt_rmx.rmx_mtu : + mtu = ro->ro_rt->rt_mtu ? ro->ro_rt->rt_mtu : ro->ro_rt->rt_ifp->if_mtu; mtu -= ipsechdr; } Modified: stable/10/sys/netinet/ip_output.c ============================================================================== --- stable/10/sys/netinet/ip_output.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet/ip_output.c Fri Mar 21 15:15:30 2014 (r263478) @@ -296,7 +296,7 @@ again: } ia = ifatoia(rte->rt_ifa); ifp = rte->rt_ifp; - rte->rt_rmx.rmx_pksent++; + counter_u64_add(rte->rt_pksent, 1); if (rte->rt_flags & RTF_GATEWAY) gw = (struct sockaddr_in *)rte->rt_gateway; if (rte->rt_flags & RTF_HOST) @@ -316,9 +316,9 @@ again: * them, there is no way for one to update all its * routes when the MTU is changed. */ - if (rte->rt_rmx.rmx_mtu > ifp->if_mtu) - rte->rt_rmx.rmx_mtu = ifp->if_mtu; - mtu = rte->rt_rmx.rmx_mtu; + if (rte->rt_mtu > ifp->if_mtu) + rte->rt_mtu = ifp->if_mtu; + mtu = rte->rt_mtu; } else { mtu = ifp->if_mtu; } Modified: stable/10/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/10/sys/netinet/sctp_os_bsd.h Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet/sctp_os_bsd.h Fri Mar 21 15:15:30 2014 (r263478) @@ -328,11 +328,11 @@ typedef struct callout sctp_os_timer_t; /* MTU */ /*************************/ #define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, af) ((struct ifnet *)ifn)->if_mtu -#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_rmx.rmx_mtu : 0) +#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_mtu : 0) #define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0) #define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) do { \ if (rt != NULL) \ - rt->rt_rmx.rmx_mtu = mtu; \ + rt->rt_mtu = mtu; \ } while(0) /* (de-)register interface event notifications */ Modified: stable/10/sys/netinet/tcp_output.c ============================================================================== --- stable/10/sys/netinet/tcp_output.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet/tcp_output.c Fri Mar 21 15:15:30 2014 (r263478) @@ -1195,7 +1195,7 @@ send: NULL, NULL, tp->t_inpcb); if (error == EMSGSIZE && ro.ro_rt != NULL) - mtu = ro.ro_rt->rt_rmx.rmx_mtu; + mtu = ro.ro_rt->rt_mtu; RO_RTFREE(&ro); } #endif /* INET6 */ @@ -1233,7 +1233,7 @@ send: tp->t_inpcb); if (error == EMSGSIZE && ro.ro_rt != NULL) - mtu = ro.ro_rt->rt_rmx.rmx_mtu; + mtu = ro.ro_rt->rt_mtu; RO_RTFREE(&ro); } #endif /* INET */ Modified: stable/10/sys/netinet/tcp_subr.c ============================================================================== --- stable/10/sys/netinet/tcp_subr.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet/tcp_subr.c Fri Mar 21 15:15:30 2014 (r263478) @@ -1797,10 +1797,10 @@ tcp_maxmtu(struct in_conninfo *inc, stru } if (sro.ro_rt != NULL) { ifp = sro.ro_rt->rt_ifp; - if (sro.ro_rt->rt_rmx.rmx_mtu == 0) + if (sro.ro_rt->rt_mtu == 0) maxmtu = ifp->if_mtu; else - maxmtu = min(sro.ro_rt->rt_rmx.rmx_mtu, ifp->if_mtu); + maxmtu = min(sro.ro_rt->rt_mtu, ifp->if_mtu); /* Report additional interface capabilities. */ if (cap != NULL) { @@ -1834,10 +1834,10 @@ tcp_maxmtu6(struct in_conninfo *inc, str } if (sro6.ro_rt != NULL) { ifp = sro6.ro_rt->rt_ifp; - if (sro6.ro_rt->rt_rmx.rmx_mtu == 0) + if (sro6.ro_rt->rt_mtu == 0) maxmtu = IN6_LINKMTU(sro6.ro_rt->rt_ifp); else - maxmtu = min(sro6.ro_rt->rt_rmx.rmx_mtu, + maxmtu = min(sro6.ro_rt->rt_mtu, IN6_LINKMTU(sro6.ro_rt->rt_ifp)); /* Report additional interface capabilities. */ Modified: stable/10/sys/netinet6/in6_rmx.c ============================================================================== --- stable/10/sys/netinet6/in6_rmx.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet6/in6_rmx.c Fri Mar 21 15:15:30 2014 (r263478) @@ -135,8 +135,8 @@ in6_addroute(void *v_arg, void *n_arg, s } } - if (!rt->rt_rmx.rmx_mtu && rt->rt_ifp) - rt->rt_rmx.rmx_mtu = IN6_LINKMTU(rt->rt_ifp); + if (!rt->rt_mtu && rt->rt_ifp) + rt->rt_mtu = IN6_LINKMTU(rt->rt_ifp); ret = rn_addroute(v_arg, n_arg, head, treenodes); if (ret == NULL) { @@ -206,12 +206,11 @@ in6_mtuexpire(struct radix_node *rn, voi if (!rt) panic("rt == NULL in in6_mtuexpire"); - if (rt->rt_rmx.rmx_expire && !(rt->rt_flags & RTF_PROBEMTU)) { - if (rt->rt_rmx.rmx_expire <= time_uptime) { + if (rt->rt_expire && !(rt->rt_flags & RTF_PROBEMTU)) { + if (rt->rt_expire <= time_uptime) { rt->rt_flags |= RTF_PROBEMTU; } else { - ap->nextstop = lmin(ap->nextstop, - rt->rt_rmx.rmx_expire); + ap->nextstop = lmin(ap->nextstop, rt->rt_expire); } } Modified: stable/10/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/10/sys/netinet6/ip6_ipsec.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet6/ip6_ipsec.c Fri Mar 21 15:15:30 2014 (r263478) @@ -369,9 +369,7 @@ ip6_ipsec_mtu(struct mbuf *m) sp->req->sav->sah != NULL) { ro = &sp->req->sav->sah->route_cache.sa_route; if (ro->ro_rt && ro->ro_rt->rt_ifp) { - mtu = - ro->ro_rt->rt_rmx.rmx_mtu ? - ro->ro_rt->rt_rmx.rmx_mtu : + mtu = ro->ro_rt->rt_mtu ? ro->ro_rt->rt_mtu : ro->ro_rt->rt_ifp->if_mtu; mtu -= ipsechdr; } Modified: stable/10/sys/netinet6/ip6_output.c ============================================================================== --- stable/10/sys/netinet6/ip6_output.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netinet6/ip6_output.c Fri Mar 21 15:15:30 2014 (r263478) @@ -218,9 +218,9 @@ in6_delayed_cksum(struct mbuf *m, uint32 * skipped and ro->ro_rt would be used. If ro is present but ro->ro_rt is NULL, * then result of route lookup is stored in ro->ro_rt. * - * type of "mtu": rt_rmx.rmx_mtu is u_long, ifnet.ifr_mtu is int, and + * type of "mtu": rt_mtu is u_long, ifnet.ifr_mtu is int, and * nd_ifinfo.linkmtu is u_int32_t. so we use u_long to hold largest one, - * which is rt_rmx.rmx_mtu. + * which is rt_mtu. * * ifpp - XXX: just for statistics */ @@ -660,7 +660,7 @@ again: } if (rt != NULL) { ia = (struct in6_ifaddr *)(rt->rt_ifa); - rt->rt_use++; + counter_u64_add(rt->rt_pksent, 1); } @@ -1396,9 +1396,9 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s ifmtu = IN6_LINKMTU(ifp); mtu = tcp_hc_getmtu(&inc); if (mtu) - mtu = min(mtu, ro_pmtu->ro_rt->rt_rmx.rmx_mtu); + mtu = min(mtu, ro_pmtu->ro_rt->rt_mtu); else - mtu = ro_pmtu->ro_rt->rt_rmx.rmx_mtu; + mtu = ro_pmtu->ro_rt->rt_mtu; if (mtu == 0) mtu = ifmtu; else if (mtu < IPV6_MMTU) { @@ -1422,7 +1422,7 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s * field isn't locked). */ mtu = ifmtu; - ro_pmtu->ro_rt->rt_rmx.rmx_mtu = mtu; + ro_pmtu->ro_rt->rt_mtu = mtu; } } else if (ifp) { mtu = IN6_LINKMTU(ifp); Modified: stable/10/sys/netipx/ipx_input.c ============================================================================== --- stable/10/sys/netipx/ipx_input.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netipx/ipx_input.c Fri Mar 21 15:15:30 2014 (r263478) @@ -454,7 +454,7 @@ ipx_do_route(struct ipx_addr *src, struc if (ro->ro_rt == NULL || ro->ro_rt->rt_ifp == NULL) { return (0); } - ro->ro_rt->rt_use++; + counter_u64_add(ro->ro_rt->rt_pksent, 1); return (1); } Modified: stable/10/sys/netipx/ipx_outputfl.c ============================================================================== --- stable/10/sys/netipx/ipx_outputfl.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netipx/ipx_outputfl.c Fri Mar 21 15:15:30 2014 (r263478) @@ -129,7 +129,7 @@ ipx_outputfl(struct mbuf *m0, struct rou error = ENETUNREACH; goto bad; } - ro->ro_rt->rt_use++; + counter_u64_add(ro->ro_rt->rt_pksent, 1); if (ro->ro_rt->rt_flags & (RTF_GATEWAY|RTF_HOST)) dst = (struct sockaddr_ipx *)ro->ro_rt->rt_gateway; gotif: Modified: stable/10/sys/netpfil/pf/pf.c ============================================================================== --- stable/10/sys/netpfil/pf/pf.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/netpfil/pf/pf.c Fri Mar 21 15:15:30 2014 (r263478) @@ -5267,7 +5267,7 @@ pf_route(struct mbuf **m, struct pf_rule } ifp = rt->rt_ifp; - rt->rt_rmx.rmx_pksent++; + counter_u64_add(rt->rt_pksent, 1); if (rt->rt_flags & RTF_GATEWAY) bcopy(satosin(rt->rt_gateway), &dst, sizeof(dst)); Modified: stable/10/sys/nfs/bootp_subr.c ============================================================================== --- stable/10/sys/nfs/bootp_subr.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/sys/nfs/bootp_subr.c Fri Mar 21 15:15:30 2014 (r263478) @@ -342,7 +342,7 @@ bootpboot_p_rtentry(struct rtentry *rt) bootpboot_p_sa(rt->rt_gateway, NULL); printf(" "); printf("flags %x", (unsigned short) rt->rt_flags); - printf(" %d", (int) rt->rt_rmx.rmx_expire); + printf(" %d", (int) rt->rt_expire); printf(" %s\n", rt->rt_ifp->if_xname); } Modified: stable/10/usr.bin/netstat/main.c ============================================================================== --- stable/10/usr.bin/netstat/main.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/usr.bin/netstat/main.c Fri Mar 21 15:15:30 2014 (r263478) @@ -749,6 +749,19 @@ kread(u_long addr, void *buf, size_t siz } /* + * Read single counter(9). + */ +uint64_t +kread_counter(u_long addr) +{ + + if (kvmd_init() < 0) + return (-1); + + return (kvm_counter_u64_fetch(kvmd, addr)); +} + +/* * Read an array of N counters in kernel memory into array of N uint64_t's. */ int Modified: stable/10/usr.bin/netstat/netstat.h ============================================================================== --- stable/10/usr.bin/netstat/netstat.h Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/usr.bin/netstat/netstat.h Fri Mar 21 15:15:30 2014 (r263478) @@ -60,6 +60,7 @@ extern int live; /* true if we are exami struct nlist; int kread(u_long addr, void *buf, size_t size); +uint64_t kread_counter(u_long addr); int kread_counters(u_long addr, void *buf, size_t size); int kresolve_list(struct nlist *); const char *plural(uintmax_t); Modified: stable/10/usr.bin/netstat/route.c ============================================================================== --- stable/10/usr.bin/netstat/route.c Fri Mar 21 15:04:09 2014 (r263477) +++ stable/10/usr.bin/netstat/route.c Fri Mar 21 15:15:30 2014 (r263478) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WANT_RTENTRY #include #include @@ -181,7 +182,7 @@ routepr(int fibnum, int af) /* * Since kernel & userland use different timebase * (time_uptime vs time_second) and we are reading kernel memory - * directly we should do rt_rmx.rmx_expire --> expire_time conversion. + * directly we should do rt_expire --> expire_time conversion. */ if (clock_gettime(CLOCK_UPTIME, &uptime) < 0) err(EX_OSERR, "clock_gettime() failed"); @@ -256,8 +257,7 @@ pr_family(int af1) static int wid_dst; static int wid_gw; static int wid_flags; -static int wid_refs; -static int wid_use; +static int wid_pksent; static int wid_mtu; static int wid_if; static int wid_expire; @@ -268,8 +268,7 @@ size_cols(int ef, struct radix_node *rn) wid_dst = WID_DST_DEFAULT(ef); wid_gw = WID_GW_DEFAULT(ef); wid_flags = 6; - wid_refs = 6; - wid_use = 8; + wid_pksent = 8; wid_mtu = 6; wid_if = WID_IF_DEFAULT(ef); wid_expire = 6; @@ -329,16 +328,10 @@ size_cols_rtentry(struct rtentry *rt) len = strlen(bp); wid_flags = MAX(len, wid_flags); - if (addr.u_sa.sa_family == AF_INET || Wflag) { - len = snprintf(buffer, sizeof(buffer), "%d", rt->rt_refcnt); - wid_refs = MAX(len, wid_refs); - len = snprintf(buffer, sizeof(buffer), "%lu", rt->rt_use); - wid_use = MAX(len, wid_use); - if (Wflag && rt->rt_rmx.rmx_mtu != 0) { - len = snprintf(buffer, sizeof(buffer), - "%lu", rt->rt_rmx.rmx_mtu); - wid_mtu = MAX(len, wid_mtu); - } + if (Wflag) { + len = snprintf(buffer, sizeof(buffer), "%lu", + kread_counter((u_long )rt->rt_pksent)); + wid_pksent = MAX(len, wid_pksent); } if (rt->rt_ifp) { if (rt->rt_ifp != lastif) { @@ -349,11 +342,11 @@ size_cols_rtentry(struct rtentry *rt) lastif = rt->rt_ifp; wid_if = MAX(len, wid_if); } - if (rt->rt_rmx.rmx_expire) { + if (rt->rt_expire) { time_t expire_time; if ((expire_time = - rt->rt_rmx.rmx_expire - uptime.tv_sec) > 0) { + rt->rt_expire - uptime.tv_sec) > 0) { len = snprintf(buffer, sizeof(buffer), "%d", (int)expire_time); wid_expire = MAX(len, wid_expire); @@ -373,10 +366,11 @@ pr_rthdr(int af1) if (Aflag) printf("%-8.8s ","Address"); if (Wflag) { - printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*s\n", + printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*.*s %*s\n", wid_dst, wid_dst, "Destination", wid_gw, wid_gw, "Gateway", wid_flags, wid_flags, "Flags", + wid_pksent, wid_pksent, "Use", wid_mtu, wid_mtu, "Mtu", wid_if, wid_if, "Netif", wid_expire, "Expire"); @@ -661,6 +655,8 @@ p_rtentry_sysctl(struct rt_msghdr *rtm) snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); p_flags(rtm->rtm_flags, buffer); if (Wflag) { + printf("%*lu ", wid_pksent, rtm->rtm_rmx.rmx_pksent); + if (rtm->rtm_rmx.rmx_mtu != 0) printf("%*lu ", wid_mtu, rtm->rtm_rmx.rmx_mtu); else @@ -870,17 +866,14 @@ p_rtentry_kvm(struct rtentry *rt) p_sockaddr(kgetsa(rt->rt_gateway), NULL, RTF_HOST, wid_gw); snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); p_flags(rt->rt_flags, buffer); - if (addr.u_sa.sa_family == AF_INET || Wflag) { -#if 0 - printf("%*d %*lu ", wid_refs, rt->rt_refcnt, - wid_use, rt->rt_use); -#endif - if (Wflag) { - if (rt->rt_rmx.rmx_mtu != 0) - printf("%*lu ", wid_mtu, rt->rt_rmx.rmx_mtu); - else - printf("%*s ", wid_mtu, ""); - } + if (Wflag) { + printf("%*lu ", wid_pksent, + kread_counter((u_long )rt->rt_pksent)); + + if (rt->rt_mtu != 0) + printf("%*lu ", wid_mtu, rt->rt_mtu); + else + printf("%*s ", wid_mtu, ""); } if (rt->rt_ifp) { if (rt->rt_ifp != lastif) { @@ -892,11 +885,11 @@ p_rtentry_kvm(struct rtentry *rt) lastif = rt->rt_ifp; } printf("%*.*s", wid_if, wid_if, prettyname); - if (rt->rt_rmx.rmx_expire) { + if (rt->rt_expire) { time_t expire_time; if ((expire_time = - rt->rt_rmx.rmx_expire - uptime.tv_sec) > 0) + rt->rt_expire - uptime.tv_sec) > 0) printf(" %*d", wid_expire, (int)expire_time); } if (rt->rt_nodes[0].rn_dupedkey) From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 21 17:54:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9A25382B; Fri, 21 Mar 2014 17:54: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80A7CBA6; Fri, 21 Mar 2014 17:54: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 s2LHs5kp030386; Fri, 21 Mar 2014 17:54:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LHs1Pk030364; Fri, 21 Mar 2014 17:54:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403211754.s2LHs1Pk030364@svn.freebsd.org> From: Dimitry Andric Date: Fri, 21 Mar 2014 17:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263508 - in stable/10: . contrib/gcc contrib/llvm contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llv... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 17:54:05 -0000 Author: dim Date: Fri Mar 21 17:53:59 2014 New Revision: 263508 URL: http://svnweb.freebsd.org/changeset/base/263508 Log: MFC 261991: Upgrade our copy of llvm/clang to 3.4 release. This version supports all of the features in the current working draft of the upcoming C++ standard, provisionally named C++1y. The code generator's performance is greatly increased, and the loop auto-vectorizer is now enabled at -Os and -O2 in addition to -O3. The PowerPC backend has made several major improvements to code generation quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ backends have all seen major feature work. Release notes for llvm and clang can be found here: MFC 262121 (by emaste): Update lldb for clang/llvm 3.4 import This commit largely restores the lldb source to the upstream r196259 snapshot with the addition of threaded inferior support and a few bug fixes. Specific upstream lldb revisions restored include: SVN git 181387 779e6ac 181703 7bef4e2 182099 b31044e 182650 f2dcf35 182683 0d91b80 183862 15c1774 183929 99447a6 184177 0b2934b 184948 4dc3761 184954 007e7bc 186990 eebd175 Sponsored by: DARPA, AFRL MFC 262186 (by emaste): Fix mismerge in r262121 A break statement was lost in the merge. The error had no functional impact, but restore it to reduce the diff against upstream. MFC 262303: Pull in r197521 from upstream clang trunk (by rdivacky): Use the integrated assembler by default on FreeBSD/ppc and ppc64. Requested by: jhibbits MFC 262611: Pull in r196874 from upstream llvm trunk: Fix a crash that occurs when PWD is invalid. MCJIT needs to be able to run in hostile environments, even when PWD is invalid. There's no need to crash MCJIT in this case. The obvious fix is to simply leave MCContext's CompilationDir empty when PWD can't be determined. This way, MCJIT clients, and other clients that link with LLVM don't need a valid working directory. If we do want to guarantee valid CompilationDir, that should be done only for clients of getCompilationDir(). This is as simple as checking for an empty string. The only current use of getCompilationDir is EmitGenDwarfInfo, which won't conceivably run with an invalid working dir. However, in the purely hypothetically and untestable case that this happens, the AT_comp_dir will be omitted from the compilation_unit DIE. This should help fix assertions occurring with ports-mgmt/tinderbox, when it is using jails, and sometimes invalidates clang's current working directory. Reported by: decke MFC 262809: Pull in r203007 from upstream clang trunk: Don't produce an alias between destructors with different calling conventions. Fixes pr19007. (Please note that is an LLVM PR identifier, not a FreeBSD one.) This should fix Firefox and/or libxul crashes (due to problems with regparm/stdcall calling conventions) on i386. Reported by: multiple users on freebsd-current PR: bin/187103 MFC 263048: Repair recognition of "CC" as an alias for the C++ compiler, since it was silently broken by upstream for a Windows-specific use-case. Apparently some versions of CMake still rely on this archaic feature... Reported by: rakuco MFC 263049: Garbage collect the old way of adding the libstdc++ include directories in clang's InitHeaderSearch.cpp. This has been superseded by David Chisnall's commit in r255321. Moreover, if libc++ is used, the libstdc++ include directories should not be in the search path at all. These directories are now only used if you pass -stdlib=libstdc++. Added: stable/10/contrib/llvm/include/llvm-c/IRReader.h - copied unchanged from r261991, head/contrib/llvm/include/llvm-c/IRReader.h stable/10/contrib/llvm/include/llvm-c/Support.h - copied unchanged from r261991, head/contrib/llvm/include/llvm-c/Support.h stable/10/contrib/llvm/include/llvm/ADT/polymorphic_ptr.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/ADT/polymorphic_ptr.h stable/10/contrib/llvm/include/llvm/Analysis/CFG.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Analysis/CFG.h stable/10/contrib/llvm/include/llvm/CodeGen/LiveRegUnits.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/CodeGen/LiveRegUnits.h stable/10/contrib/llvm/include/llvm/CodeGen/StackMaps.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/CodeGen/StackMaps.h stable/10/contrib/llvm/include/llvm/CodeGen/StackProtector.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/CodeGen/StackProtector.h stable/10/contrib/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h stable/10/contrib/llvm/include/llvm/IR/IntrinsicsAArch64.td - copied unchanged from r261991, head/contrib/llvm/include/llvm/IR/IntrinsicsAArch64.td stable/10/contrib/llvm/include/llvm/IR/LegacyPassManager.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/IR/LegacyPassManager.h stable/10/contrib/llvm/include/llvm/IR/LegacyPassManagers.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/IR/LegacyPassManagers.h stable/10/contrib/llvm/include/llvm/IR/PassManager.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/IR/PassManager.h stable/10/contrib/llvm/include/llvm/LTO/ - copied from r261991, head/contrib/llvm/include/llvm/LTO/ stable/10/contrib/llvm/include/llvm/MC/MCAsmInfoELF.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/MC/MCAsmInfoELF.h stable/10/contrib/llvm/include/llvm/MC/MCExternalSymbolizer.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/MC/MCExternalSymbolizer.h stable/10/contrib/llvm/include/llvm/MC/MCFunction.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/MC/MCFunction.h stable/10/contrib/llvm/include/llvm/MC/MCModuleYAML.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/MC/MCModuleYAML.h stable/10/contrib/llvm/include/llvm/MC/MCObjectDisassembler.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/MC/MCObjectDisassembler.h stable/10/contrib/llvm/include/llvm/MC/MCObjectSymbolizer.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/MC/MCObjectSymbolizer.h stable/10/contrib/llvm/include/llvm/MC/MCRelocationInfo.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/MC/MCRelocationInfo.h stable/10/contrib/llvm/include/llvm/MC/MCSymbolizer.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/MC/MCSymbolizer.h stable/10/contrib/llvm/include/llvm/Object/COFFYAML.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Object/COFFYAML.h stable/10/contrib/llvm/include/llvm/Object/ELFObjectFile.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Object/ELFObjectFile.h stable/10/contrib/llvm/include/llvm/Object/ELFTypes.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Object/ELFTypes.h stable/10/contrib/llvm/include/llvm/Object/ELFYAML.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Object/ELFYAML.h stable/10/contrib/llvm/include/llvm/Object/MachOUniversal.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Object/MachOUniversal.h stable/10/contrib/llvm/include/llvm/Object/YAML.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Object/YAML.h stable/10/contrib/llvm/include/llvm/Support/MD5.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Support/MD5.h stable/10/contrib/llvm/include/llvm/Support/StringRefMemoryObject.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Support/StringRefMemoryObject.h stable/10/contrib/llvm/include/llvm/Support/Unicode.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Support/Unicode.h stable/10/contrib/llvm/include/llvm/Support/UnicodeCharRanges.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Support/UnicodeCharRanges.h stable/10/contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/GlobalStatus.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Transforms/Utils/GlobalStatus.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/SpecialCaseList.h - copied unchanged from r261991, head/contrib/llvm/include/llvm/Transforms/Utils/SpecialCaseList.h stable/10/contrib/llvm/lib/Analysis/CFG.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Analysis/CFG.cpp stable/10/contrib/llvm/lib/Analysis/Delinearization.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Analysis/Delinearization.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp - copied unchanged from r261991, head/contrib/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DIEHash.h - copied unchanged from r261991, head/contrib/llvm/lib/CodeGen/AsmPrinter/DIEHash.h stable/10/contrib/llvm/lib/CodeGen/LiveRegUnits.cpp - copied unchanged from r261991, head/contrib/llvm/lib/CodeGen/LiveRegUnits.cpp stable/10/contrib/llvm/lib/CodeGen/StackMaps.cpp - copied unchanged from r261991, head/contrib/llvm/lib/CodeGen/StackMaps.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFDebugLoc.cpp - copied unchanged from r261991, head/contrib/llvm/lib/DebugInfo/DWARFDebugLoc.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFDebugLoc.h - copied unchanged from r261991, head/contrib/llvm/lib/DebugInfo/DWARFDebugLoc.h stable/10/contrib/llvm/lib/DebugInfo/DWARFTypeUnit.cpp - copied unchanged from r261991, head/contrib/llvm/lib/DebugInfo/DWARFTypeUnit.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFTypeUnit.h - copied unchanged from r261991, head/contrib/llvm/lib/DebugInfo/DWARFTypeUnit.h stable/10/contrib/llvm/lib/DebugInfo/DWARFUnit.cpp - copied unchanged from r261991, head/contrib/llvm/lib/DebugInfo/DWARFUnit.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFUnit.h - copied unchanged from r261991, head/contrib/llvm/lib/DebugInfo/DWARFUnit.h stable/10/contrib/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp - copied unchanged from r261991, head/contrib/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp stable/10/contrib/llvm/lib/IR/AsmWriter.h - copied unchanged from r261991, head/contrib/llvm/lib/IR/AsmWriter.h stable/10/contrib/llvm/lib/IR/LegacyPassManager.cpp - copied unchanged from r261991, head/contrib/llvm/lib/IR/LegacyPassManager.cpp stable/10/contrib/llvm/lib/LTO/ - copied from r261991, head/contrib/llvm/lib/LTO/ stable/10/contrib/llvm/lib/MC/MCAsmInfoELF.cpp - copied unchanged from r261991, head/contrib/llvm/lib/MC/MCAsmInfoELF.cpp stable/10/contrib/llvm/lib/MC/MCExternalSymbolizer.cpp - copied unchanged from r261991, head/contrib/llvm/lib/MC/MCExternalSymbolizer.cpp stable/10/contrib/llvm/lib/MC/MCFunction.cpp - copied unchanged from r261991, head/contrib/llvm/lib/MC/MCFunction.cpp stable/10/contrib/llvm/lib/MC/MCModuleYAML.cpp - copied unchanged from r261991, head/contrib/llvm/lib/MC/MCModuleYAML.cpp stable/10/contrib/llvm/lib/MC/MCObjectDisassembler.cpp - copied unchanged from r261991, head/contrib/llvm/lib/MC/MCObjectDisassembler.cpp stable/10/contrib/llvm/lib/MC/MCObjectSymbolizer.cpp - copied unchanged from r261991, head/contrib/llvm/lib/MC/MCObjectSymbolizer.cpp stable/10/contrib/llvm/lib/MC/MCRelocationInfo.cpp - copied unchanged from r261991, head/contrib/llvm/lib/MC/MCRelocationInfo.cpp stable/10/contrib/llvm/lib/MC/MCSymbolizer.cpp - copied unchanged from r261991, head/contrib/llvm/lib/MC/MCSymbolizer.cpp stable/10/contrib/llvm/lib/Object/COFFYAML.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Object/COFFYAML.cpp stable/10/contrib/llvm/lib/Object/ELF.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Object/ELF.cpp stable/10/contrib/llvm/lib/Object/ELFYAML.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Object/ELFYAML.cpp stable/10/contrib/llvm/lib/Object/MachOUniversal.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Object/MachOUniversal.cpp stable/10/contrib/llvm/lib/Object/YAML.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Object/YAML.cpp stable/10/contrib/llvm/lib/Support/MD5.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Support/MD5.cpp stable/10/contrib/llvm/lib/Support/StringRefMemoryObject.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Support/StringRefMemoryObject.cpp stable/10/contrib/llvm/lib/Support/Unicode.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Support/Unicode.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64InstrNEON.td - copied unchanged from r261991, head/contrib/llvm/lib/Target/AArch64/AArch64InstrNEON.td stable/10/contrib/llvm/lib/Target/ARM/ARMFPUName.def - copied unchanged from r261991, head/contrib/llvm/lib/Target/ARM/ARMFPUName.def stable/10/contrib/llvm/lib/Target/ARM/ARMFPUName.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/ARM/ARMFPUName.h stable/10/contrib/llvm/lib/Target/ARM/ARMFeatures.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/ARM/ARMFeatures.h stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachORelocationInfo.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachORelocationInfo.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonCopyToCombine.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/Hexagon/HexagonCopyToCombine.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonMachineFunctionInfo.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/Hexagon/HexagonMachineFunctionInfo.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonSplitConst32AndConst64.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/Hexagon/HexagonSplitConst32AndConst64.cpp stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp stable/10/contrib/llvm/lib/Target/Mips/MSA.txt - copied unchanged from r261991, head/contrib/llvm/lib/Target/Mips/MSA.txt stable/10/contrib/llvm/lib/Target/Mips/Mips16HardFloat.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/Mips/Mips16HardFloat.cpp stable/10/contrib/llvm/lib/Target/Mips/Mips16HardFloat.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/Mips/Mips16HardFloat.h stable/10/contrib/llvm/lib/Target/Mips/MipsMSAInstrFormats.td - copied unchanged from r261991, head/contrib/llvm/lib/Target/Mips/MipsMSAInstrFormats.td stable/10/contrib/llvm/lib/Target/Mips/MipsMSAInstrInfo.td - copied unchanged from r261991, head/contrib/llvm/lib/Target/Mips/MipsMSAInstrInfo.td stable/10/contrib/llvm/lib/Target/Mips/MipsTargetStreamer.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/Mips/MipsTargetStreamer.h stable/10/contrib/llvm/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXMCExpr.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/NVPTX/NVPTXMCExpr.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXMCExpr.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/NVPTX/NVPTXMCExpr.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXPrologEpilogPass.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/NVPTX/NVPTXPrologEpilogPass.cpp stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.h stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h stable/10/contrib/llvm/lib/Target/PowerPC/PPCTargetStreamer.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/PowerPC/PPCTargetStreamer.h stable/10/contrib/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp stable/10/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCCodeEmitter.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/R600/R600ClauseMergePass.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/R600/R600ClauseMergePass.cpp stable/10/contrib/llvm/lib/Target/R600/R600InstrFormats.td - copied unchanged from r261991, head/contrib/llvm/lib/Target/R600/R600InstrFormats.td stable/10/contrib/llvm/lib/Target/R600/R600OptimizeVectorRegisters.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/R600/R600OptimizeVectorRegisters.cpp stable/10/contrib/llvm/lib/Target/R600/R600TextureIntrinsicsReplacer.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/R600/R600TextureIntrinsicsReplacer.cpp stable/10/contrib/llvm/lib/Target/R600/SIFixSGPRCopies.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/R600/SIFixSGPRCopies.cpp stable/10/contrib/llvm/lib/Target/R600/SITypeRewriter.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/R600/SITypeRewriter.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcCodeEmitter.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/Sparc/SparcCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcJITInfo.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/Sparc/SparcJITInfo.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcJITInfo.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/Sparc/SparcJITInfo.h stable/10/contrib/llvm/lib/Target/Sparc/SparcRelocations.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/Sparc/SparcRelocations.h stable/10/contrib/llvm/lib/Target/SystemZ/Disassembler/ - copied from r261991, head/contrib/llvm/lib/Target/SystemZ/Disassembler/ stable/10/contrib/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZLongBranch.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/SystemZ/SystemZLongBranch.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZProcessors.td - copied unchanged from r261991, head/contrib/llvm/lib/Target/SystemZ/SystemZProcessors.td stable/10/contrib/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.h stable/10/contrib/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp stable/10/contrib/llvm/lib/Target/X86/X86CallingConv.h - copied unchanged from r261991, head/contrib/llvm/lib/Target/X86/X86CallingConv.h stable/10/contrib/llvm/lib/Target/X86/X86InstrAVX512.td - copied unchanged from r261991, head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td stable/10/contrib/llvm/lib/Target/X86/X86ScheduleSLM.td - copied unchanged from r261991, head/contrib/llvm/lib/Target/X86/X86ScheduleSLM.td stable/10/contrib/llvm/lib/Target/XCore/XCoreTargetTransformInfo.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Target/XCore/XCoreTargetTransformInfo.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/DebugIR.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Instrumentation/DebugIR.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/DebugIR.h - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Instrumentation/DebugIR.h stable/10/contrib/llvm/lib/Transforms/ObjCARC/ARCRuntimeEntryPoints.h - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/ObjCARC/ARCRuntimeEntryPoints.h stable/10/contrib/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/SampleProfile.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Scalar/SampleProfile.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp stable/10/contrib/llvm/lib/Transforms/Utils/FlattenCFG.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Utils/FlattenCFG.cpp stable/10/contrib/llvm/lib/Transforms/Utils/GlobalStatus.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Utils/GlobalStatus.cpp stable/10/contrib/llvm/lib/Transforms/Utils/SpecialCaseList.cpp - copied unchanged from r261991, head/contrib/llvm/lib/Transforms/Utils/SpecialCaseList.cpp stable/10/contrib/llvm/tools/clang/include/clang/AST/ASTFwd.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/AST/ASTFwd.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ASTLambda.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/AST/ASTLambda.h stable/10/contrib/llvm/tools/clang/include/clang/AST/MangleNumberingContext.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/AST/MangleNumberingContext.h stable/10/contrib/llvm/tools/clang/include/clang/AST/StmtOpenMP.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/AST/StmtOpenMP.h stable/10/contrib/llvm/tools/clang/include/clang/ASTMatchers/Dynamic/ - copied from r261991, head/contrib/llvm/tools/clang/include/clang/ASTMatchers/Dynamic/ stable/10/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/Consumed.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/Consumed.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsXCore.def - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsXCore.def stable/10/contrib/llvm/tools/clang/include/clang/CodeGen/CGFunctionInfo.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/CodeGen/CGFunctionInfo.h stable/10/contrib/llvm/tools/clang/include/clang/CodeGen/CodeGenABITypes.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/CodeGen/CodeGenABITypes.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/CLCompatOptions.td - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/Driver/CLCompatOptions.td stable/10/contrib/llvm/tools/clang/include/clang/Driver/SanitizerArgs.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/Driver/SanitizerArgs.h stable/10/contrib/llvm/tools/clang/include/clang/Index/ - copied from r261991, head/contrib/llvm/tools/clang/include/clang/Index/ stable/10/contrib/llvm/tools/clang/include/clang/Sema/SemaLambda.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/Sema/SemaLambda.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h stable/10/contrib/llvm/tools/clang/include/clang/Tooling/ReplacementsYaml.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/include/clang/Tooling/ReplacementsYaml.h stable/10/contrib/llvm/tools/clang/lib/AST/ASTTypeTraits.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/AST/ASTTypeTraits.cpp stable/10/contrib/llvm/tools/clang/lib/AST/MangleNumberingContext.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/AST/MangleNumberingContext.cpp stable/10/contrib/llvm/tools/clang/lib/ASTMatchers/Dynamic/ - copied from r261991, head/contrib/llvm/tools/clang/lib/ASTMatchers/Dynamic/ stable/10/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CodeGenABITypes.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenABITypes.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/EHScopeStack.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/CodeGen/EHScopeStack.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftVBTables.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftVBTables.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftVBTables.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftVBTables.h stable/10/contrib/llvm/tools/clang/lib/Driver/SanitizerArgs.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Driver/SanitizerArgs.cpp stable/10/contrib/llvm/tools/clang/lib/Format/ContinuationIndenter.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Format/ContinuationIndenter.cpp stable/10/contrib/llvm/tools/clang/lib/Format/ContinuationIndenter.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Format/ContinuationIndenter.h stable/10/contrib/llvm/tools/clang/lib/Format/Encoding.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Format/Encoding.h stable/10/contrib/llvm/tools/clang/lib/Format/FormatToken.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Format/FormatToken.cpp stable/10/contrib/llvm/tools/clang/lib/Format/FormatToken.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Format/FormatToken.h stable/10/contrib/llvm/tools/clang/lib/Headers/Intrin.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Headers/Intrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/shaintrin.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Headers/shaintrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/tbmintrin.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Headers/tbmintrin.h stable/10/contrib/llvm/tools/clang/lib/Index/ - copied from r261991, head/contrib/llvm/tools/clang/lib/Index/ stable/10/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CommonBugCategories.cpp - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CommonBugCategories.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PrettyStackTraceLocationContext.h - copied unchanged from r261991, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PrettyStackTraceLocationContext.h stable/10/contrib/llvm/tools/lli/ChildTarget/ - copied from r261991, head/contrib/llvm/tools/lli/ChildTarget/ stable/10/contrib/llvm/tools/lli/RemoteMemoryManager.cpp - copied unchanged from r261991, head/contrib/llvm/tools/lli/RemoteMemoryManager.cpp stable/10/contrib/llvm/tools/lli/RemoteMemoryManager.h - copied unchanged from r261991, head/contrib/llvm/tools/lli/RemoteMemoryManager.h stable/10/contrib/llvm/tools/lli/RemoteTargetExternal.cpp - copied unchanged from r261991, head/contrib/llvm/tools/lli/RemoteTargetExternal.cpp stable/10/contrib/llvm/tools/lli/RemoteTargetExternal.h - copied unchanged from r261991, head/contrib/llvm/tools/lli/RemoteTargetExternal.h stable/10/contrib/llvm/tools/lli/RemoteTargetMessage.h - copied unchanged from r261991, head/contrib/llvm/tools/lli/RemoteTargetMessage.h stable/10/contrib/llvm/tools/lli/Unix/ - copied from r261991, head/contrib/llvm/tools/lli/Unix/ stable/10/contrib/llvm/tools/lli/Windows/ - copied from r261991, head/contrib/llvm/tools/lli/Windows/ stable/10/lib/clang/include/PPCGenFastISel.inc - copied unchanged from r261991, head/lib/clang/include/PPCGenFastISel.inc stable/10/lib/clang/include/clang/Parse/AttrIdentifierArg.inc - copied unchanged from r261991, head/lib/clang/include/clang/Parse/AttrIdentifierArg.inc stable/10/lib/clang/include/clang/Parse/AttrTypeArg.inc - copied unchanged from r261991, head/lib/clang/include/clang/Parse/AttrTypeArg.inc stable/10/lib/clang/include/clang/Sema/AttrParsedAttrImpl.inc - copied unchanged from r261991, head/lib/clang/include/clang/Sema/AttrParsedAttrImpl.inc stable/10/lib/clang/libllvmoption/ - copied from r261991, head/lib/clang/libllvmoption/ Deleted: stable/10/contrib/llvm/include/llvm/ADT/NullablePtr.h stable/10/contrib/llvm/include/llvm/Analysis/PathNumbering.h stable/10/contrib/llvm/include/llvm/Analysis/PathProfileInfo.h stable/10/contrib/llvm/include/llvm/Analysis/ProfileDataLoader.h stable/10/contrib/llvm/include/llvm/Analysis/ProfileDataTypes.h stable/10/contrib/llvm/include/llvm/Analysis/ProfileInfo.h stable/10/contrib/llvm/include/llvm/Analysis/ProfileInfoLoader.h stable/10/contrib/llvm/include/llvm/Analysis/ProfileInfoTypes.h stable/10/contrib/llvm/include/llvm/Bitcode/Archive.h stable/10/contrib/llvm/include/llvm/Object/MachOFormat.h stable/10/contrib/llvm/include/llvm/PassManagers.h stable/10/contrib/llvm/include/llvm/Support/IntegersSubset.h stable/10/contrib/llvm/include/llvm/Support/IntegersSubsetMapping.h stable/10/contrib/llvm/include/llvm/Support/PathV1.h stable/10/contrib/llvm/include/llvm/Support/PathV2.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/BlackList.h stable/10/contrib/llvm/lib/Analysis/PathNumbering.cpp stable/10/contrib/llvm/lib/Analysis/PathProfileInfo.cpp stable/10/contrib/llvm/lib/Analysis/PathProfileVerifier.cpp stable/10/contrib/llvm/lib/Analysis/ProfileDataLoader.cpp stable/10/contrib/llvm/lib/Analysis/ProfileDataLoaderPass.cpp stable/10/contrib/llvm/lib/Analysis/ProfileEstimatorPass.cpp stable/10/contrib/llvm/lib/Analysis/ProfileInfo.cpp stable/10/contrib/llvm/lib/Analysis/ProfileInfoLoader.cpp stable/10/contrib/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp stable/10/contrib/llvm/lib/Analysis/ProfileVerifierPass.cpp stable/10/contrib/llvm/lib/Archive/ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SDNodeOrdering.h stable/10/contrib/llvm/lib/CodeGen/ShrinkWrapping.cpp stable/10/contrib/llvm/lib/CodeGen/StrongPHIElimination.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFAttribute.h stable/10/contrib/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp stable/10/contrib/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.h stable/10/contrib/llvm/lib/Support/LocaleGeneric.inc stable/10/contrib/llvm/lib/Support/LocaleWindows.inc stable/10/contrib/llvm/lib/Support/LocaleXlocale.inc stable/10/contrib/llvm/lib/Support/PathV2.cpp stable/10/contrib/llvm/lib/Support/Unix/PathV2.inc stable/10/contrib/llvm/lib/Support/Windows/PathV2.inc stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.h stable/10/contrib/llvm/lib/Target/MBlaze/ stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsDirectObjLower.cpp stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsDirectObjLower.h stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXNumRegisters.h stable/10/contrib/llvm/lib/Target/R600/AMDGPUIndirectAddressing.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUStructurizeCFG.cpp stable/10/contrib/llvm/lib/Target/R600/AMDIL.h stable/10/contrib/llvm/lib/Target/R600/AMDIL7XXDevice.cpp stable/10/contrib/llvm/lib/Target/R600/AMDIL7XXDevice.h stable/10/contrib/llvm/lib/Target/R600/AMDILDevice.cpp stable/10/contrib/llvm/lib/Target/R600/AMDILDevice.h stable/10/contrib/llvm/lib/Target/R600/AMDILDeviceInfo.cpp stable/10/contrib/llvm/lib/Target/R600/AMDILDeviceInfo.h stable/10/contrib/llvm/lib/Target/R600/AMDILDevices.h stable/10/contrib/llvm/lib/Target/R600/AMDILEvergreenDevice.cpp stable/10/contrib/llvm/lib/Target/R600/AMDILEvergreenDevice.h stable/10/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/R600/AMDILNIDevice.cpp stable/10/contrib/llvm/lib/Target/R600/AMDILNIDevice.h stable/10/contrib/llvm/lib/Target/R600/AMDILSIDevice.cpp stable/10/contrib/llvm/lib/Target/R600/AMDILSIDevice.h stable/10/contrib/llvm/lib/Target/Sparc/FPMover.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/BlackList.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/ProfilingUtils.h stable/10/contrib/llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp stable/10/contrib/llvm/lib/Transforms/Vectorize/VecUtils.cpp stable/10/contrib/llvm/lib/Transforms/Vectorize/VecUtils.h stable/10/contrib/llvm/tools/clang/include/clang/AST/LambdaMangleContext.h stable/10/contrib/llvm/tools/clang/include/clang/Analysis/Support/BlkExprDeclBitVector.h stable/10/contrib/llvm/tools/clang/include/clang/Analysis/Visitors/ stable/10/contrib/llvm/tools/clang/include/clang/Driver/Arg.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/ArgList.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/OptParser.td stable/10/contrib/llvm/tools/clang/include/clang/Driver/OptSpecifier.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/OptTable.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/Option.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/CommonBugCategories.h stable/10/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp stable/10/contrib/llvm/tools/clang/lib/AST/LambdaMangleContext.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/Arg.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ArgList.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/OptTable.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/Option.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/SanitizerArgs.h stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CommonBugCategories.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp stable/10/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp stable/10/contrib/llvm/tools/lli/RecordingMemoryManager.cpp stable/10/contrib/llvm/tools/lli/RecordingMemoryManager.h stable/10/contrib/llvm/tools/llvm-objdump/MCFunction.cpp stable/10/contrib/llvm/tools/llvm-objdump/MCFunction.h stable/10/contrib/llvm/tools/llvm-prof/ stable/10/contrib/llvm/tools/llvm-ranlib/ stable/10/contrib/llvm/tools/llvm-stub/ stable/10/contrib/llvm/utils/TableGen/StringToOffsetTable.h stable/10/lib/clang/include/clang/Parse/AttrExprArgs.inc stable/10/lib/clang/libllvmarchive/ stable/10/usr.bin/clang/llvm-prof/ stable/10/usr.bin/clang/llvm-ranlib/ Modified: stable/10/ObsoleteFiles.inc stable/10/UPDATING stable/10/contrib/gcc/libgcc2.c stable/10/contrib/gcc/libgcc2.h stable/10/contrib/llvm/LICENSE.TXT stable/10/contrib/llvm/include/llvm-c/BitReader.h stable/10/contrib/llvm/include/llvm-c/BitWriter.h stable/10/contrib/llvm/include/llvm-c/Core.h stable/10/contrib/llvm/include/llvm-c/Disassembler.h stable/10/contrib/llvm/include/llvm-c/ExecutionEngine.h stable/10/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h stable/10/contrib/llvm/include/llvm-c/Object.h stable/10/contrib/llvm/include/llvm-c/Target.h stable/10/contrib/llvm/include/llvm-c/TargetMachine.h stable/10/contrib/llvm/include/llvm-c/Transforms/Scalar.h stable/10/contrib/llvm/include/llvm-c/lto.h stable/10/contrib/llvm/include/llvm/ADT/APFloat.h stable/10/contrib/llvm/include/llvm/ADT/APInt.h stable/10/contrib/llvm/include/llvm/ADT/APSInt.h stable/10/contrib/llvm/include/llvm/ADT/ArrayRef.h stable/10/contrib/llvm/include/llvm/ADT/BitVector.h stable/10/contrib/llvm/include/llvm/ADT/DenseMap.h stable/10/contrib/llvm/include/llvm/ADT/FoldingSet.h stable/10/contrib/llvm/include/llvm/ADT/ImmutableMap.h stable/10/contrib/llvm/include/llvm/ADT/ImmutableSet.h stable/10/contrib/llvm/include/llvm/ADT/IntervalMap.h stable/10/contrib/llvm/include/llvm/ADT/OwningPtr.h stable/10/contrib/llvm/include/llvm/ADT/PointerIntPair.h stable/10/contrib/llvm/include/llvm/ADT/PointerUnion.h stable/10/contrib/llvm/include/llvm/ADT/STLExtras.h stable/10/contrib/llvm/include/llvm/ADT/SetVector.h stable/10/contrib/llvm/include/llvm/ADT/SmallBitVector.h stable/10/contrib/llvm/include/llvm/ADT/SmallPtrSet.h stable/10/contrib/llvm/include/llvm/ADT/SmallVector.h stable/10/contrib/llvm/include/llvm/ADT/SparseBitVector.h stable/10/contrib/llvm/include/llvm/ADT/StringExtras.h stable/10/contrib/llvm/include/llvm/ADT/StringMap.h stable/10/contrib/llvm/include/llvm/ADT/StringRef.h stable/10/contrib/llvm/include/llvm/ADT/Triple.h stable/10/contrib/llvm/include/llvm/ADT/ilist.h stable/10/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h stable/10/contrib/llvm/include/llvm/Analysis/BlockFrequencyImpl.h stable/10/contrib/llvm/include/llvm/Analysis/BlockFrequencyInfo.h stable/10/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h stable/10/contrib/llvm/include/llvm/Analysis/CFGPrinter.h stable/10/contrib/llvm/include/llvm/Analysis/CallGraph.h stable/10/contrib/llvm/include/llvm/Analysis/ConstantFolding.h stable/10/contrib/llvm/include/llvm/Analysis/DependenceAnalysis.h stable/10/contrib/llvm/include/llvm/Analysis/Dominators.h stable/10/contrib/llvm/include/llvm/Analysis/InlineCost.h stable/10/contrib/llvm/include/llvm/Analysis/InstructionSimplify.h stable/10/contrib/llvm/include/llvm/Analysis/LoopInfo.h stable/10/contrib/llvm/include/llvm/Analysis/LoopInfoImpl.h stable/10/contrib/llvm/include/llvm/Analysis/LoopPass.h stable/10/contrib/llvm/include/llvm/Analysis/MemoryBuiltins.h stable/10/contrib/llvm/include/llvm/Analysis/Passes.h stable/10/contrib/llvm/include/llvm/Analysis/PostDominators.h stable/10/contrib/llvm/include/llvm/Analysis/RegionPass.h stable/10/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h stable/10/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h stable/10/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h stable/10/contrib/llvm/include/llvm/Analysis/TargetTransformInfo.h stable/10/contrib/llvm/include/llvm/Analysis/ValueTracking.h stable/10/contrib/llvm/include/llvm/AutoUpgrade.h stable/10/contrib/llvm/include/llvm/Bitcode/BitstreamReader.h stable/10/contrib/llvm/include/llvm/Bitcode/BitstreamWriter.h stable/10/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h stable/10/contrib/llvm/include/llvm/CodeGen/Analysis.h stable/10/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h stable/10/contrib/llvm/include/llvm/CodeGen/CalcSpillWeights.h stable/10/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h stable/10/contrib/llvm/include/llvm/CodeGen/CommandFlags.h stable/10/contrib/llvm/include/llvm/CodeGen/FastISel.h stable/10/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h stable/10/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h stable/10/contrib/llvm/include/llvm/CodeGen/LexicalScopes.h stable/10/contrib/llvm/include/llvm/CodeGen/LiveInterval.h stable/10/contrib/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h stable/10/contrib/llvm/include/llvm/CodeGen/LiveIntervalUnion.h stable/10/contrib/llvm/include/llvm/CodeGen/LiveRangeEdit.h stable/10/contrib/llvm/include/llvm/CodeGen/LiveVariables.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineConstantPool.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineInstr.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineOperand.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineRelocation.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineScheduler.h stable/10/contrib/llvm/include/llvm/CodeGen/PBQP/Graph.h stable/10/contrib/llvm/include/llvm/CodeGen/PBQP/HeuristicBase.h stable/10/contrib/llvm/include/llvm/CodeGen/PBQP/HeuristicSolver.h stable/10/contrib/llvm/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h stable/10/contrib/llvm/include/llvm/CodeGen/PBQP/Solution.h stable/10/contrib/llvm/include/llvm/CodeGen/Passes.h stable/10/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h stable/10/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h stable/10/contrib/llvm/include/llvm/CodeGen/RegisterClassInfo.h stable/10/contrib/llvm/include/llvm/CodeGen/RegisterPressure.h stable/10/contrib/llvm/include/llvm/CodeGen/RegisterScavenging.h stable/10/contrib/llvm/include/llvm/CodeGen/RuntimeLibcalls.h stable/10/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h stable/10/contrib/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h stable/10/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h stable/10/contrib/llvm/include/llvm/CodeGen/SelectionDAGISel.h stable/10/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h stable/10/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h stable/10/contrib/llvm/include/llvm/CodeGen/TargetSchedule.h stable/10/contrib/llvm/include/llvm/CodeGen/ValueTypes.h stable/10/contrib/llvm/include/llvm/CodeGen/ValueTypes.td stable/10/contrib/llvm/include/llvm/DIBuilder.h stable/10/contrib/llvm/include/llvm/DebugInfo.h stable/10/contrib/llvm/include/llvm/DebugInfo/DIContext.h stable/10/contrib/llvm/include/llvm/DebugInfo/DWARFFormValue.h stable/10/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h stable/10/contrib/llvm/include/llvm/ExecutionEngine/JITMemoryManager.h stable/10/contrib/llvm/include/llvm/ExecutionEngine/ObjectBuffer.h stable/10/contrib/llvm/include/llvm/ExecutionEngine/ObjectCache.h stable/10/contrib/llvm/include/llvm/ExecutionEngine/ObjectImage.h stable/10/contrib/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h stable/10/contrib/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h stable/10/contrib/llvm/include/llvm/GVMaterializer.h stable/10/contrib/llvm/include/llvm/IR/Argument.h stable/10/contrib/llvm/include/llvm/IR/Attributes.h stable/10/contrib/llvm/include/llvm/IR/CallingConv.h stable/10/contrib/llvm/include/llvm/IR/Constants.h stable/10/contrib/llvm/include/llvm/IR/DataLayout.h stable/10/contrib/llvm/include/llvm/IR/Function.h stable/10/contrib/llvm/include/llvm/IR/GlobalAlias.h stable/10/contrib/llvm/include/llvm/IR/GlobalValue.h stable/10/contrib/llvm/include/llvm/IR/GlobalVariable.h stable/10/contrib/llvm/include/llvm/IR/IRBuilder.h stable/10/contrib/llvm/include/llvm/IR/InlineAsm.h stable/10/contrib/llvm/include/llvm/IR/InstrTypes.h stable/10/contrib/llvm/include/llvm/IR/Instruction.def stable/10/contrib/llvm/include/llvm/IR/Instructions.h stable/10/contrib/llvm/include/llvm/IR/Intrinsics.h stable/10/contrib/llvm/include/llvm/IR/Intrinsics.td stable/10/contrib/llvm/include/llvm/IR/IntrinsicsARM.td stable/10/contrib/llvm/include/llvm/IR/IntrinsicsMips.td stable/10/contrib/llvm/include/llvm/IR/IntrinsicsNVVM.td stable/10/contrib/llvm/include/llvm/IR/IntrinsicsPowerPC.td stable/10/contrib/llvm/include/llvm/IR/IntrinsicsX86.td stable/10/contrib/llvm/include/llvm/IR/IntrinsicsXCore.td stable/10/contrib/llvm/include/llvm/IR/LLVMContext.h stable/10/contrib/llvm/include/llvm/IR/Metadata.h stable/10/contrib/llvm/include/llvm/IR/Module.h stable/10/contrib/llvm/include/llvm/IR/Operator.h stable/10/contrib/llvm/include/llvm/IR/Type.h stable/10/contrib/llvm/include/llvm/IR/TypeBuilder.h stable/10/contrib/llvm/include/llvm/IR/Use.h stable/10/contrib/llvm/include/llvm/IR/Value.h stable/10/contrib/llvm/include/llvm/InitializePasses.h stable/10/contrib/llvm/include/llvm/InstVisitor.h stable/10/contrib/llvm/include/llvm/LinkAllPasses.h stable/10/contrib/llvm/include/llvm/Linker.h stable/10/contrib/llvm/include/llvm/MC/MCAsmBackend.h stable/10/contrib/llvm/include/llvm/MC/MCAsmInfo.h stable/10/contrib/llvm/include/llvm/MC/MCAssembler.h stable/10/contrib/llvm/include/llvm/MC/MCAtom.h stable/10/contrib/llvm/include/llvm/MC/MCCodeGenInfo.h stable/10/contrib/llvm/include/llvm/MC/MCContext.h stable/10/contrib/llvm/include/llvm/MC/MCDisassembler.h stable/10/contrib/llvm/include/llvm/MC/MCDwarf.h stable/10/contrib/llvm/include/llvm/MC/MCELFObjectWriter.h stable/10/contrib/llvm/include/llvm/MC/MCELFStreamer.h stable/10/contrib/llvm/include/llvm/MC/MCELFSymbolFlags.h stable/10/contrib/llvm/include/llvm/MC/MCExpr.h stable/10/contrib/llvm/include/llvm/MC/MCInstPrinter.h stable/10/contrib/llvm/include/llvm/MC/MCInstrAnalysis.h stable/10/contrib/llvm/include/llvm/MC/MCInstrDesc.h stable/10/contrib/llvm/include/llvm/MC/MCInstrItineraries.h stable/10/contrib/llvm/include/llvm/MC/MCMachOSymbolFlags.h stable/10/contrib/llvm/include/llvm/MC/MCMachObjectWriter.h stable/10/contrib/llvm/include/llvm/MC/MCModule.h stable/10/contrib/llvm/include/llvm/MC/MCObjectFileInfo.h stable/10/contrib/llvm/include/llvm/MC/MCObjectStreamer.h stable/10/contrib/llvm/include/llvm/MC/MCParser/AsmLexer.h stable/10/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h stable/10/contrib/llvm/include/llvm/MC/MCRegisterInfo.h stable/10/contrib/llvm/include/llvm/MC/MCSchedule.h stable/10/contrib/llvm/include/llvm/MC/MCSectionCOFF.h stable/10/contrib/llvm/include/llvm/MC/MCSectionMachO.h stable/10/contrib/llvm/include/llvm/MC/MCStreamer.h stable/10/contrib/llvm/include/llvm/MC/MCSubtargetInfo.h stable/10/contrib/llvm/include/llvm/MC/MCTargetAsmParser.h stable/10/contrib/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h stable/10/contrib/llvm/include/llvm/MC/MachineLocation.h stable/10/contrib/llvm/include/llvm/MC/SubtargetFeature.h stable/10/contrib/llvm/include/llvm/Object/Archive.h stable/10/contrib/llvm/include/llvm/Object/Binary.h stable/10/contrib/llvm/include/llvm/Object/COFF.h stable/10/contrib/llvm/include/llvm/Object/ELF.h stable/10/contrib/llvm/include/llvm/Object/Error.h stable/10/contrib/llvm/include/llvm/Object/MachO.h stable/10/contrib/llvm/include/llvm/Object/ObjectFile.h stable/10/contrib/llvm/include/llvm/Object/RelocVisitor.h stable/10/contrib/llvm/include/llvm/Option/ArgList.h stable/10/contrib/llvm/include/llvm/Option/OptParser.td stable/10/contrib/llvm/include/llvm/Option/OptTable.h stable/10/contrib/llvm/include/llvm/Option/Option.h stable/10/contrib/llvm/include/llvm/PassManager.h stable/10/contrib/llvm/include/llvm/Support/Allocator.h stable/10/contrib/llvm/include/llvm/Support/BlockFrequency.h stable/10/contrib/llvm/include/llvm/Support/CFG.h stable/10/contrib/llvm/include/llvm/Support/COFF.h stable/10/contrib/llvm/include/llvm/Support/CallSite.h stable/10/contrib/llvm/include/llvm/Support/Casting.h stable/10/contrib/llvm/include/llvm/Support/CommandLine.h stable/10/contrib/llvm/include/llvm/Support/Compiler.h stable/10/contrib/llvm/include/llvm/Support/Compression.h stable/10/contrib/llvm/include/llvm/Support/ConstantRange.h stable/10/contrib/llvm/include/llvm/Support/ConvertUTF.h stable/10/contrib/llvm/include/llvm/Support/DataTypes.h.in stable/10/contrib/llvm/include/llvm/Support/Debug.h stable/10/contrib/llvm/include/llvm/Support/DebugLoc.h stable/10/contrib/llvm/include/llvm/Support/Dwarf.h stable/10/contrib/llvm/include/llvm/Support/ELF.h stable/10/contrib/llvm/include/llvm/Support/ErrorOr.h stable/10/contrib/llvm/include/llvm/Support/FileSystem.h stable/10/contrib/llvm/include/llvm/Support/FileUtilities.h stable/10/contrib/llvm/include/llvm/Support/FormattedStream.h stable/10/contrib/llvm/include/llvm/Support/GCOV.h stable/10/contrib/llvm/include/llvm/Support/GetElementPtrTypeIterator.h stable/10/contrib/llvm/include/llvm/Support/GraphWriter.h stable/10/contrib/llvm/include/llvm/Support/Host.h stable/10/contrib/llvm/include/llvm/Support/LEB128.h stable/10/contrib/llvm/include/llvm/Support/MachO.h stable/10/contrib/llvm/include/llvm/Support/ManagedStatic.h stable/10/contrib/llvm/include/llvm/Support/MathExtras.h stable/10/contrib/llvm/include/llvm/Support/MemoryBuffer.h stable/10/contrib/llvm/include/llvm/Support/MemoryObject.h stable/10/contrib/llvm/include/llvm/Support/PassNameParser.h stable/10/contrib/llvm/include/llvm/Support/Path.h stable/10/contrib/llvm/include/llvm/Support/PatternMatch.h stable/10/contrib/llvm/include/llvm/Support/PrettyStackTrace.h stable/10/contrib/llvm/include/llvm/Support/Process.h stable/10/contrib/llvm/include/llvm/Support/Program.h stable/10/contrib/llvm/include/llvm/Support/RecyclingAllocator.h stable/10/contrib/llvm/include/llvm/Support/Regex.h stable/10/contrib/llvm/include/llvm/Support/Registry.h stable/10/contrib/llvm/include/llvm/Support/Signals.h stable/10/contrib/llvm/include/llvm/Support/Solaris.h stable/10/contrib/llvm/include/llvm/Support/SourceMgr.h stable/10/contrib/llvm/include/llvm/Support/StreamableMemoryObject.h stable/10/contrib/llvm/include/llvm/Support/SystemUtils.h stable/10/contrib/llvm/include/llvm/Support/TargetRegistry.h stable/10/contrib/llvm/include/llvm/Support/TimeValue.h stable/10/contrib/llvm/include/llvm/Support/ToolOutputFile.h stable/10/contrib/llvm/include/llvm/Support/Valgrind.h stable/10/contrib/llvm/include/llvm/Support/ValueHandle.h stable/10/contrib/llvm/include/llvm/Support/YAMLParser.h stable/10/contrib/llvm/include/llvm/Support/YAMLTraits.h stable/10/contrib/llvm/include/llvm/Support/raw_ostream.h stable/10/contrib/llvm/include/llvm/TableGen/Record.h stable/10/contrib/llvm/include/llvm/TableGen/TableGenBackend.h stable/10/contrib/llvm/include/llvm/Target/CostTable.h stable/10/contrib/llvm/include/llvm/Target/Mangler.h stable/10/contrib/llvm/include/llvm/Target/Target.td stable/10/contrib/llvm/include/llvm/Target/TargetCallingConv.h stable/10/contrib/llvm/include/llvm/Target/TargetCallingConv.td stable/10/contrib/llvm/include/llvm/Target/TargetFrameLowering.h stable/10/contrib/llvm/include/llvm/Target/TargetInstrInfo.h stable/10/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h stable/10/contrib/llvm/include/llvm/Target/TargetLowering.h stable/10/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h stable/10/contrib/llvm/include/llvm/Target/TargetMachine.h stable/10/contrib/llvm/include/llvm/Target/TargetOpcodes.h stable/10/contrib/llvm/include/llvm/Target/TargetOptions.h stable/10/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h stable/10/contrib/llvm/include/llvm/Target/TargetSchedule.td stable/10/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td stable/10/contrib/llvm/include/llvm/Target/TargetSelectionDAGInfo.h stable/10/contrib/llvm/include/llvm/Target/TargetSubtargetInfo.h stable/10/contrib/llvm/include/llvm/Transforms/IPO.h stable/10/contrib/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h stable/10/contrib/llvm/include/llvm/Transforms/Instrumentation.h stable/10/contrib/llvm/include/llvm/Transforms/Scalar.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/Cloning.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/Local.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/ModuleUtils.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h stable/10/contrib/llvm/include/llvm/Transforms/Utils/ValueMapper.h stable/10/contrib/llvm/include/llvm/Transforms/Vectorize.h stable/10/contrib/llvm/lib/Analysis/AliasAnalysis.cpp stable/10/contrib/llvm/lib/Analysis/AliasSetTracker.cpp stable/10/contrib/llvm/lib/Analysis/Analysis.cpp stable/10/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp stable/10/contrib/llvm/lib/Analysis/BlockFrequencyInfo.cpp stable/10/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp stable/10/contrib/llvm/lib/Analysis/CaptureTracking.cpp stable/10/contrib/llvm/lib/Analysis/ConstantFolding.cpp stable/10/contrib/llvm/lib/Analysis/CostModel.cpp stable/10/contrib/llvm/lib/Analysis/DependenceAnalysis.cpp stable/10/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp stable/10/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp stable/10/contrib/llvm/lib/Analysis/IPA/GlobalsModRef.cpp stable/10/contrib/llvm/lib/Analysis/IPA/IPA.cpp stable/10/contrib/llvm/lib/Analysis/IPA/InlineCost.cpp stable/10/contrib/llvm/lib/Analysis/InstructionSimplify.cpp stable/10/contrib/llvm/lib/Analysis/LazyValueInfo.cpp stable/10/contrib/llvm/lib/Analysis/Lint.cpp stable/10/contrib/llvm/lib/Analysis/LoopInfo.cpp stable/10/contrib/llvm/lib/Analysis/LoopPass.cpp stable/10/contrib/llvm/lib/Analysis/MemoryBuiltins.cpp stable/10/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp stable/10/contrib/llvm/lib/Analysis/RegionInfo.cpp stable/10/contrib/llvm/lib/Analysis/ScalarEvolution.cpp stable/10/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp stable/10/contrib/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp stable/10/contrib/llvm/lib/Analysis/TargetTransformInfo.cpp stable/10/contrib/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp stable/10/contrib/llvm/lib/Analysis/ValueTracking.cpp stable/10/contrib/llvm/lib/AsmParser/LLLexer.cpp stable/10/contrib/llvm/lib/AsmParser/LLParser.cpp stable/10/contrib/llvm/lib/AsmParser/LLParser.h stable/10/contrib/llvm/lib/AsmParser/LLToken.h stable/10/contrib/llvm/lib/AsmParser/Parser.cpp stable/10/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp stable/10/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.h stable/10/contrib/llvm/lib/Bitcode/Reader/BitstreamReader.cpp stable/10/contrib/llvm/lib/Bitcode/Writer/BitWriter.cpp stable/10/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp stable/10/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp stable/10/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h stable/10/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp stable/10/contrib/llvm/lib/CodeGen/Analysis.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.h stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h stable/10/contrib/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp stable/10/contrib/llvm/lib/CodeGen/BranchFolding.cpp stable/10/contrib/llvm/lib/CodeGen/BranchFolding.h stable/10/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp stable/10/contrib/llvm/lib/CodeGen/CallingConvLower.cpp stable/10/contrib/llvm/lib/CodeGen/CodeGen.cpp stable/10/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp stable/10/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h stable/10/contrib/llvm/lib/CodeGen/DFAPacketizer.cpp stable/10/contrib/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp stable/10/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp stable/10/contrib/llvm/lib/CodeGen/ExecutionDepsFix.cpp stable/10/contrib/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp stable/10/contrib/llvm/lib/CodeGen/IfConversion.cpp stable/10/contrib/llvm/lib/CodeGen/InlineSpiller.cpp stable/10/contrib/llvm/lib/CodeGen/InterferenceCache.cpp stable/10/contrib/llvm/lib/CodeGen/InterferenceCache.h stable/10/contrib/llvm/lib/CodeGen/IntrinsicLowering.cpp stable/10/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp stable/10/contrib/llvm/lib/CodeGen/LexicalScopes.cpp stable/10/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp stable/10/contrib/llvm/lib/CodeGen/LiveDebugVariables.h stable/10/contrib/llvm/lib/CodeGen/LiveInterval.cpp stable/10/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp stable/10/contrib/llvm/lib/CodeGen/LiveRangeCalc.cpp stable/10/contrib/llvm/lib/CodeGen/LiveRangeCalc.h stable/10/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp stable/10/contrib/llvm/lib/CodeGen/LiveRegMatrix.cpp stable/10/contrib/llvm/lib/CodeGen/LiveVariables.cpp stable/10/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp stable/10/contrib/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp stable/10/contrib/llvm/lib/CodeGen/MachineBlockPlacement.cpp stable/10/contrib/llvm/lib/CodeGen/MachineCSE.cpp stable/10/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp stable/10/contrib/llvm/lib/CodeGen/MachineFunction.cpp stable/10/contrib/llvm/lib/CodeGen/MachineInstr.cpp stable/10/contrib/llvm/lib/CodeGen/MachineLICM.cpp stable/10/contrib/llvm/lib/CodeGen/MachineModuleInfo.cpp stable/10/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp stable/10/contrib/llvm/lib/CodeGen/MachineSSAUpdater.cpp stable/10/contrib/llvm/lib/CodeGen/MachineScheduler.cpp stable/10/contrib/llvm/lib/CodeGen/MachineSink.cpp stable/10/contrib/llvm/lib/CodeGen/MachineTraceMetrics.cpp stable/10/contrib/llvm/lib/CodeGen/MachineVerifier.cpp stable/10/contrib/llvm/lib/CodeGen/PHIElimination.cpp stable/10/contrib/llvm/lib/CodeGen/PHIEliminationUtils.h stable/10/contrib/llvm/lib/CodeGen/Passes.cpp stable/10/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp stable/10/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp stable/10/contrib/llvm/lib/CodeGen/ProcessImplicitDefs.cpp stable/10/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp stable/10/contrib/llvm/lib/CodeGen/PrologEpilogInserter.h stable/10/contrib/llvm/lib/CodeGen/RegAllocBase.cpp stable/10/contrib/llvm/lib/CodeGen/RegAllocBase.h stable/10/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp stable/10/contrib/llvm/lib/CodeGen/RegAllocFast.cpp stable/10/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp stable/10/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp stable/10/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp stable/10/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp stable/10/contrib/llvm/lib/CodeGen/RegisterPressure.cpp stable/10/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp stable/10/contrib/llvm/lib/CodeGen/ScheduleDAG.cpp stable/10/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp stable/10/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp stable/10/contrib/llvm/lib/CodeGen/SpillPlacement.cpp stable/10/contrib/llvm/lib/CodeGen/SpillPlacement.h stable/10/contrib/llvm/lib/CodeGen/Spiller.cpp stable/10/contrib/llvm/lib/CodeGen/SplitKit.cpp stable/10/contrib/llvm/lib/CodeGen/SplitKit.h stable/10/contrib/llvm/lib/CodeGen/StackColoring.cpp stable/10/contrib/llvm/lib/CodeGen/StackProtector.cpp stable/10/contrib/llvm/lib/CodeGen/StackSlotColoring.cpp stable/10/contrib/llvm/lib/CodeGen/TailDuplication.cpp stable/10/contrib/llvm/lib/CodeGen/TargetInstrInfo.cpp stable/10/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp stable/10/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp stable/10/contrib/llvm/lib/CodeGen/TargetOptionsImpl.cpp stable/10/contrib/llvm/lib/CodeGen/TargetRegisterInfo.cpp stable/10/contrib/llvm/lib/CodeGen/TargetSchedule.cpp stable/10/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp stable/10/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp stable/10/contrib/llvm/lib/CodeGen/VirtRegMap.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFAbbreviationDeclaration.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFAbbreviationDeclaration.h stable/10/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.h stable/10/contrib/llvm/lib/DebugInfo/DWARFContext.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFContext.h stable/10/contrib/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFDebugArangeSet.h stable/10/contrib/llvm/lib/DebugInfo/DWARFDebugAranges.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFDebugAranges.h stable/10/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.h stable/10/contrib/llvm/lib/DebugInfo/DWARFDebugLine.cpp stable/10/contrib/llvm/lib/DebugInfo/DWARFFormValue.cpp stable/10/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp stable/10/contrib/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp stable/10/contrib/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h stable/10/contrib/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp stable/10/contrib/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp stable/10/contrib/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h stable/10/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp stable/10/contrib/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp stable/10/contrib/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp stable/10/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp stable/10/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h stable/10/contrib/llvm/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp stable/10/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp stable/10/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp stable/10/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/JITRegistrar.h stable/10/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h stable/10/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp stable/10/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp stable/10/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h stable/10/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h stable/10/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp stable/10/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h stable/10/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp stable/10/contrib/llvm/lib/IR/AsmWriter.cpp stable/10/contrib/llvm/lib/IR/AttributeImpl.h stable/10/contrib/llvm/lib/IR/Attributes.cpp stable/10/contrib/llvm/lib/IR/AutoUpgrade.cpp stable/10/contrib/llvm/lib/IR/ConstantFold.cpp stable/10/contrib/llvm/lib/IR/Constants.cpp stable/10/contrib/llvm/lib/IR/Core.cpp stable/10/contrib/llvm/lib/IR/DIBuilder.cpp stable/10/contrib/llvm/lib/IR/DataLayout.cpp stable/10/contrib/llvm/lib/IR/DebugInfo.cpp stable/10/contrib/llvm/lib/IR/Function.cpp stable/10/contrib/llvm/lib/IR/GCOV.cpp stable/10/contrib/llvm/lib/IR/Globals.cpp stable/10/contrib/llvm/lib/IR/Instruction.cpp stable/10/contrib/llvm/lib/IR/Instructions.cpp stable/10/contrib/llvm/lib/IR/LLVMContextImpl.h stable/10/contrib/llvm/lib/IR/Metadata.cpp stable/10/contrib/llvm/lib/IR/Module.cpp stable/10/contrib/llvm/lib/IR/PassManager.cpp stable/10/contrib/llvm/lib/IR/PassRegistry.cpp stable/10/contrib/llvm/lib/IR/Type.cpp stable/10/contrib/llvm/lib/IR/TypeFinder.cpp stable/10/contrib/llvm/lib/IR/Value.cpp stable/10/contrib/llvm/lib/IR/ValueTypes.cpp stable/10/contrib/llvm/lib/IR/Verifier.cpp stable/10/contrib/llvm/lib/IRReader/IRReader.cpp stable/10/contrib/llvm/lib/Linker/LinkModules.cpp stable/10/contrib/llvm/lib/MC/ELFObjectWriter.cpp stable/10/contrib/llvm/lib/MC/MCAsmBackend.cpp stable/10/contrib/llvm/lib/MC/MCAsmInfo.cpp stable/10/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp stable/10/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp stable/10/contrib/llvm/lib/MC/MCAsmStreamer.cpp stable/10/contrib/llvm/lib/MC/MCAssembler.cpp stable/10/contrib/llvm/lib/MC/MCAtom.cpp stable/10/contrib/llvm/lib/MC/MCContext.cpp stable/10/contrib/llvm/lib/MC/MCDisassembler.cpp stable/10/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp stable/10/contrib/llvm/lib/MC/MCDisassembler/Disassembler.h stable/10/contrib/llvm/lib/MC/MCDwarf.cpp stable/10/contrib/llvm/lib/MC/MCELF.cpp stable/10/contrib/llvm/lib/MC/MCELFObjectTargetWriter.cpp stable/10/contrib/llvm/lib/MC/MCELFStreamer.cpp stable/10/contrib/llvm/lib/MC/MCExpr.cpp stable/10/contrib/llvm/lib/MC/MCInstPrinter.cpp stable/10/contrib/llvm/lib/MC/MCInstrAnalysis.cpp stable/10/contrib/llvm/lib/MC/MCMachOStreamer.cpp stable/10/contrib/llvm/lib/MC/MCModule.cpp stable/10/contrib/llvm/lib/MC/MCNullStreamer.cpp stable/10/contrib/llvm/lib/MC/MCObjectFileInfo.cpp stable/10/contrib/llvm/lib/MC/MCObjectStreamer.cpp stable/10/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp stable/10/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp stable/10/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp stable/10/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp stable/10/contrib/llvm/lib/MC/MCPureStreamer.cpp stable/10/contrib/llvm/lib/MC/MCRegisterInfo.cpp stable/10/contrib/llvm/lib/MC/MCSectionCOFF.cpp stable/10/contrib/llvm/lib/MC/MCSectionELF.cpp stable/10/contrib/llvm/lib/MC/MCStreamer.cpp stable/10/contrib/llvm/lib/MC/MCSubtargetInfo.cpp stable/10/contrib/llvm/lib/MC/MCSymbol.cpp stable/10/contrib/llvm/lib/MC/MCWin64EH.cpp stable/10/contrib/llvm/lib/MC/MachObjectWriter.cpp stable/10/contrib/llvm/lib/MC/SubtargetFeature.cpp stable/10/contrib/llvm/lib/MC/WinCOFFObjectWriter.cpp stable/10/contrib/llvm/lib/MC/WinCOFFStreamer.cpp stable/10/contrib/llvm/lib/Object/Archive.cpp stable/10/contrib/llvm/lib/Object/Binary.cpp stable/10/contrib/llvm/lib/Object/COFFObjectFile.cpp stable/10/contrib/llvm/lib/Object/ELFObjectFile.cpp stable/10/contrib/llvm/lib/Object/Error.cpp stable/10/contrib/llvm/lib/Object/MachOObjectFile.cpp stable/10/contrib/llvm/lib/Object/Object.cpp stable/10/contrib/llvm/lib/Object/ObjectFile.cpp stable/10/contrib/llvm/lib/Option/ArgList.cpp stable/10/contrib/llvm/lib/Option/OptTable.cpp stable/10/contrib/llvm/lib/Option/Option.cpp stable/10/contrib/llvm/lib/Support/APFloat.cpp stable/10/contrib/llvm/lib/Support/APInt.cpp stable/10/contrib/llvm/lib/Support/Allocator.cpp stable/10/contrib/llvm/lib/Support/BlockFrequency.cpp stable/10/contrib/llvm/lib/Support/CommandLine.cpp stable/10/contrib/llvm/lib/Support/Compression.cpp stable/10/contrib/llvm/lib/Support/ConstantRange.cpp stable/10/contrib/llvm/lib/Support/ConvertUTFWrapper.cpp stable/10/contrib/llvm/lib/Support/CrashRecoveryContext.cpp stable/10/contrib/llvm/lib/Support/DataStream.cpp stable/10/contrib/llvm/lib/Support/Disassembler.cpp stable/10/contrib/llvm/lib/Support/Dwarf.cpp stable/10/contrib/llvm/lib/Support/DynamicLibrary.cpp stable/10/contrib/llvm/lib/Support/Errno.cpp stable/10/contrib/llvm/lib/Support/ErrorHandling.cpp stable/10/contrib/llvm/lib/Support/FileOutputBuffer.cpp stable/10/contrib/llvm/lib/Support/FileUtilities.cpp stable/10/contrib/llvm/lib/Support/FormattedStream.cpp stable/10/contrib/llvm/lib/Support/GraphWriter.cpp stable/10/contrib/llvm/lib/Support/Host.cpp stable/10/contrib/llvm/lib/Support/Locale.cpp stable/10/contrib/llvm/lib/Support/LockFileManager.cpp stable/10/contrib/llvm/lib/Support/MemoryBuffer.cpp stable/10/contrib/llvm/lib/Support/MemoryObject.cpp stable/10/contrib/llvm/lib/Support/Path.cpp stable/10/contrib/llvm/lib/Support/PrettyStackTrace.cpp stable/10/contrib/llvm/lib/Support/Process.cpp stable/10/contrib/llvm/lib/Support/Program.cpp stable/10/contrib/llvm/lib/Support/Regex.cpp stable/10/contrib/llvm/lib/Support/SmallPtrSet.cpp stable/10/contrib/llvm/lib/Support/SourceMgr.cpp stable/10/contrib/llvm/lib/Support/StreamableMemoryObject.cpp stable/10/contrib/llvm/lib/Support/StringRef.cpp stable/10/contrib/llvm/lib/Support/SystemUtils.cpp stable/10/contrib/llvm/lib/Support/TargetRegistry.cpp stable/10/contrib/llvm/lib/Support/ThreadLocal.cpp stable/10/contrib/llvm/lib/Support/Timer.cpp stable/10/contrib/llvm/lib/Support/ToolOutputFile.cpp stable/10/contrib/llvm/lib/Support/Triple.cpp stable/10/contrib/llvm/lib/Support/Unix/Memory.inc stable/10/contrib/llvm/lib/Support/Unix/Path.inc stable/10/contrib/llvm/lib/Support/Unix/Process.inc stable/10/contrib/llvm/lib/Support/Unix/Program.inc stable/10/contrib/llvm/lib/Support/Unix/Signals.inc stable/10/contrib/llvm/lib/Support/Unix/ThreadLocal.inc stable/10/contrib/llvm/lib/Support/Unix/TimeValue.inc stable/10/contrib/llvm/lib/Support/Unix/Unix.h stable/10/contrib/llvm/lib/Support/Windows/DynamicLibrary.inc stable/10/contrib/llvm/lib/Support/Windows/Memory.inc stable/10/contrib/llvm/lib/Support/Windows/Path.inc stable/10/contrib/llvm/lib/Support/Windows/Process.inc stable/10/contrib/llvm/lib/Support/Windows/Program.inc stable/10/contrib/llvm/lib/Support/Windows/RWMutex.inc stable/10/contrib/llvm/lib/Support/Windows/Signals.inc stable/10/contrib/llvm/lib/Support/Windows/TimeValue.inc stable/10/contrib/llvm/lib/Support/Windows/Windows.h stable/10/contrib/llvm/lib/Support/YAMLParser.cpp stable/10/contrib/llvm/lib/Support/YAMLTraits.cpp stable/10/contrib/llvm/lib/Support/raw_ostream.cpp stable/10/contrib/llvm/lib/TableGen/Main.cpp stable/10/contrib/llvm/lib/TableGen/Record.cpp stable/10/contrib/llvm/lib/TableGen/TGParser.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64.td stable/10/contrib/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64AsmPrinter.h stable/10/contrib/llvm/lib/Target/AArch64/AArch64BranchFixupPass.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64CallingConv.td stable/10/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.h stable/10/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.h stable/10/contrib/llvm/lib/Target/AArch64/AArch64InstrFormats.td stable/10/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.h stable/10/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td stable/10/contrib/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.h stable/10/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.td stable/10/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.h stable/10/contrib/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp stable/10/contrib/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp stable/10/contrib/llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp stable/10/contrib/llvm/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp stable/10/contrib/llvm/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.h stable/10/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp stable/10/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp stable/10/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h stable/10/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h stable/10/contrib/llvm/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp stable/10/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.cpp stable/10/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h stable/10/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp stable/10/contrib/llvm/lib/Target/ARM/ARM.td stable/10/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h stable/10/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h stable/10/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h stable/10/contrib/llvm/lib/Target/ARM/ARMBuildAttrs.h stable/10/contrib/llvm/lib/Target/ARM/ARMCallingConv.td stable/10/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.h stable/10/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMHazardRecognizer.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMHazardRecognizer.h stable/10/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMISelLowering.h stable/10/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td stable/10/contrib/llvm/lib/Target/ARM/ARMInstrInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td stable/10/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td stable/10/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td stable/10/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td stable/10/contrib/llvm/lib/Target/ARM/ARMInstrVFP.td stable/10/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMMCInstLower.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMMachineFunctionInfo.h stable/10/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.h stable/10/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td stable/10/contrib/llvm/lib/Target/ARM/ARMSchedule.td stable/10/contrib/llvm/lib/Target/ARM/ARMScheduleA9.td stable/10/contrib/llvm/lib/Target/ARM/ARMScheduleSwift.td stable/10/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h stable/10/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMSubtarget.h stable/10/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp stable/10/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp stable/10/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp stable/10/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAddressingModes.h stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.h stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp stable/10/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h stable/10/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp stable/10/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.h stable/10/contrib/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp stable/10/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/Thumb2RegisterInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/Thumb2RegisterInfo.h stable/10/contrib/llvm/lib/Target/CppBackend/CPPBackend.cpp stable/10/contrib/llvm/lib/Target/Hexagon/Hexagon.h stable/10/contrib/llvm/lib/Target/Hexagon/Hexagon.td stable/10/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonCallingConvLower.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonCallingConvLower.h stable/10/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.h stable/10/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormats.td stable/10/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.h stable/10/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.td stable/10/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td stable/10/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV5.td stable/10/contrib/llvm/lib/Target/Hexagon/HexagonMCInstLower.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonMachineFunctionInfo.h stable/10/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.h stable/10/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonPeephole.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.h stable/10/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.td stable/10/contrib/llvm/lib/Target/Hexagon/HexagonSelectionDAGInfo.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonSelectionDAGInfo.h stable/10/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h stable/10/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp stable/10/contrib/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.h stable/10/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp stable/10/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.cpp stable/10/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h stable/10/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.h stable/10/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.h stable/10/contrib/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp stable/10/contrib/llvm/lib/Target/MSP430/MSP430CallingConv.td stable/10/contrib/llvm/lib/Target/MSP430/MSP430FrameLowering.h stable/10/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp stable/10/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h stable/10/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp stable/10/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.h stable/10/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.td stable/10/contrib/llvm/lib/Target/MSP430/MSP430MCInstLower.cpp stable/10/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp stable/10/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h stable/10/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td stable/10/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp stable/10/contrib/llvm/lib/Target/Mangler.cpp stable/10/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp stable/10/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp stable/10/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp stable/10/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsFixupKinds.h stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.h stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.h stable/10/contrib/llvm/lib/Target/Mips/MicroMipsInstrFormats.td stable/10/contrib/llvm/lib/Target/Mips/MicroMipsInstrInfo.td stable/10/contrib/llvm/lib/Target/Mips/Mips.h stable/10/contrib/llvm/lib/Target/Mips/Mips.td stable/10/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.cpp stable/10/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.h stable/10/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.h stable/10/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp stable/10/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h stable/10/contrib/llvm/lib/Target/Mips/Mips16InstrFormats.td stable/10/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp stable/10/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.h stable/10/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.td stable/10/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp stable/10/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.h stable/10/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td stable/10/contrib/llvm/lib/Target/Mips/MipsAnalyzeImmediate.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsAnalyzeImmediate.h stable/10/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.h stable/10/contrib/llvm/lib/Target/Mips/MipsCallingConv.td stable/10/contrib/llvm/lib/Target/Mips/MipsCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsCondMov.td stable/10/contrib/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td stable/10/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.h stable/10/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsISelLowering.h stable/10/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td stable/10/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td stable/10/contrib/llvm/lib/Target/Mips/MipsInstrInfo.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h stable/10/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td stable/10/contrib/llvm/lib/Target/Mips/MipsJITInfo.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsLongBranch.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsMCInstLower.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsMCInstLower.h stable/10/contrib/llvm/lib/Target/Mips/MipsMachineFunction.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h stable/10/contrib/llvm/lib/Target/Mips/MipsOs16.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h stable/10/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td stable/10/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.h stable/10/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.h stable/10/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.h stable/10/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.h stable/10/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.h stable/10/contrib/llvm/lib/Target/Mips/MipsSchedule.td stable/10/contrib/llvm/lib/Target/Mips/MipsSubtarget.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsSubtarget.h stable/10/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp stable/10/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h stable/10/contrib/llvm/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.cpp stable/10/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXBaseInfo.h stable/10/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.h stable/10/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/NVPTX/ManagedStringPool.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTX.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTX.td stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXAllocaHoisting.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXFrameLowering.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.td stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXSection.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXSplitBBatBar.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.h stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp stable/10/contrib/llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h stable/10/contrib/llvm/lib/Target/NVPTX/NVVMReflect.cpp stable/10/contrib/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp stable/10/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp stable/10/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h stable/10/contrib/llvm/lib/Target/PowerPC/PPC.h stable/10/contrib/llvm/lib/Target/PowerPC/PPC.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCCallingConv.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.h stable/10/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.h stable/10/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h stable/10/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCInstrAltivec.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCInstrFormats.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h stable/10/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCJITInfo.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h stable/10/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h stable/10/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCSchedule.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCScheduleA2.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCScheduleE500mc.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCScheduleE5500.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h stable/10/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp stable/10/contrib/llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPU.h stable/10/contrib/llvm/lib/Target/R600/AMDGPU.td stable/10/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.h stable/10/contrib/llvm/lib/Target/R600/AMDGPUCallingConv.td stable/10/contrib/llvm/lib/Target/R600/AMDGPUFrameLowering.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.h stable/10/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.h stable/10/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.td stable/10/contrib/llvm/lib/Target/R600/AMDGPUInstructions.td stable/10/contrib/llvm/lib/Target/R600/AMDGPUIntrinsics.td stable/10/contrib/llvm/lib/Target/R600/AMDGPUMCInstLower.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUMachineFunction.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUMachineFunction.h stable/10/contrib/llvm/lib/Target/R600/AMDGPURegisterInfo.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPURegisterInfo.h stable/10/contrib/llvm/lib/Target/R600/AMDGPURegisterInfo.td stable/10/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.h stable/10/contrib/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUTargetMachine.h stable/10/contrib/llvm/lib/Target/R600/AMDILBase.td stable/10/contrib/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp stable/10/contrib/llvm/lib/Target/R600/AMDILISelLowering.cpp stable/10/contrib/llvm/lib/Target/R600/AMDILInstrInfo.td stable/10/contrib/llvm/lib/Target/R600/AMDILIntrinsicInfo.cpp stable/10/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp stable/10/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h stable/10/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUAsmBackend.cpp stable/10/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.h stable/10/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCCodeEmitter.h stable/10/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.h stable/10/contrib/llvm/lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/R600/Processors.td stable/10/contrib/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp stable/10/contrib/llvm/lib/Target/R600/R600Defines.h stable/10/contrib/llvm/lib/Target/R600/R600EmitClauseMarkers.cpp stable/10/contrib/llvm/lib/Target/R600/R600ExpandSpecialInstrs.cpp stable/10/contrib/llvm/lib/Target/R600/R600ISelLowering.cpp stable/10/contrib/llvm/lib/Target/R600/R600ISelLowering.h stable/10/contrib/llvm/lib/Target/R600/R600InstrInfo.cpp stable/10/contrib/llvm/lib/Target/R600/R600InstrInfo.h stable/10/contrib/llvm/lib/Target/R600/R600Instructions.td stable/10/contrib/llvm/lib/Target/R600/R600Intrinsics.td stable/10/contrib/llvm/lib/Target/R600/R600MachineFunctionInfo.cpp stable/10/contrib/llvm/lib/Target/R600/R600MachineFunctionInfo.h stable/10/contrib/llvm/lib/Target/R600/R600MachineScheduler.cpp stable/10/contrib/llvm/lib/Target/R600/R600MachineScheduler.h stable/10/contrib/llvm/lib/Target/R600/R600Packetizer.cpp stable/10/contrib/llvm/lib/Target/R600/R600RegisterInfo.cpp stable/10/contrib/llvm/lib/Target/R600/R600RegisterInfo.h stable/10/contrib/llvm/lib/Target/R600/R600RegisterInfo.td stable/10/contrib/llvm/lib/Target/R600/R600Schedule.td stable/10/contrib/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp stable/10/contrib/llvm/lib/Target/R600/SIDefines.h stable/10/contrib/llvm/lib/Target/R600/SIISelLowering.cpp stable/10/contrib/llvm/lib/Target/R600/SIISelLowering.h stable/10/contrib/llvm/lib/Target/R600/SIInsertWaits.cpp stable/10/contrib/llvm/lib/Target/R600/SIInstrFormats.td stable/10/contrib/llvm/lib/Target/R600/SIInstrInfo.cpp stable/10/contrib/llvm/lib/Target/R600/SIInstrInfo.h stable/10/contrib/llvm/lib/Target/R600/SIInstrInfo.td stable/10/contrib/llvm/lib/Target/R600/SIInstructions.td stable/10/contrib/llvm/lib/Target/R600/SIIntrinsics.td stable/10/contrib/llvm/lib/Target/R600/SILowerControlFlow.cpp stable/10/contrib/llvm/lib/Target/R600/SIMachineFunctionInfo.cpp stable/10/contrib/llvm/lib/Target/R600/SIMachineFunctionInfo.h stable/10/contrib/llvm/lib/Target/R600/SIRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/R600/SIRegisterInfo.h stable/10/contrib/llvm/lib/Target/R600/SIRegisterInfo.td stable/10/contrib/llvm/lib/Target/R600/TargetInfo/AMDGPUTargetInfo.cpp stable/10/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.h stable/10/contrib/llvm/lib/Target/Sparc/Sparc.h stable/10/contrib/llvm/lib/Target/Sparc/Sparc.td stable/10/contrib/llvm/lib/Target/Sparc/SparcAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcCallingConv.td stable/10/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.h stable/10/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h stable/10/contrib/llvm/lib/Target/Sparc/SparcInstr64Bit.td stable/10/contrib/llvm/lib/Target/Sparc/SparcInstrFormats.td stable/10/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.h stable/10/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td stable/10/contrib/llvm/lib/Target/Sparc/SparcMachineFunctionInfo.h stable/10/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h stable/10/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td stable/10/contrib/llvm/lib/Target/Sparc/SparcSubtarget.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcSubtarget.h stable/10/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.h stable/10/contrib/llvm/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp stable/10/contrib/llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp stable/10/contrib/llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp stable/10/contrib/llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.h stable/10/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp stable/10/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.h stable/10/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.h stable/10/contrib/llvm/lib/Target/SystemZ/README.txt stable/10/contrib/llvm/lib/Target/SystemZ/SystemZ.h stable/10/contrib/llvm/lib/Target/SystemZ/SystemZ.td stable/10/contrib/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZCallingConv.td stable/10/contrib/llvm/lib/Target/SystemZ/SystemZConstantPoolValue.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZFrameLowering.h stable/10/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h stable/10/contrib/llvm/lib/Target/SystemZ/SystemZInstrFP.td stable/10/contrib/llvm/lib/Target/SystemZ/SystemZInstrFormats.td stable/10/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.h stable/10/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.td stable/10/contrib/llvm/lib/Target/SystemZ/SystemZMCInstLower.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZMCInstLower.h stable/10/contrib/llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.h stable/10/contrib/llvm/lib/Target/SystemZ/SystemZOperands.td stable/10/contrib/llvm/lib/Target/SystemZ/SystemZOperators.td stable/10/contrib/llvm/lib/Target/SystemZ/SystemZPatterns.td stable/10/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h stable/10/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td stable/10/contrib/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZSubtarget.h stable/10/contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp stable/10/contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.h stable/10/contrib/llvm/lib/Target/Target.cpp stable/10/contrib/llvm/lib/Target/TargetLibraryInfo.cpp stable/10/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp stable/10/contrib/llvm/lib/Target/TargetMachine.cpp stable/10/contrib/llvm/lib/Target/TargetMachineC.cpp stable/10/contrib/llvm/lib/Target/TargetSubtargetInfo.cpp stable/10/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp stable/10/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp stable/10/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c stable/10/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h stable/10/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h stable/10/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp stable/10/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h stable/10/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp stable/10/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.h stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp stable/10/contrib/llvm/lib/Target/X86/X86.td stable/10/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp stable/10/contrib/llvm/lib/Target/X86/X86AsmPrinter.h stable/10/contrib/llvm/lib/Target/X86/X86CallingConv.td stable/10/contrib/llvm/lib/Target/X86/X86CodeEmitter.cpp stable/10/contrib/llvm/lib/Target/X86/X86FastISel.cpp stable/10/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp stable/10/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp stable/10/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp stable/10/contrib/llvm/lib/Target/X86/X86FrameLowering.h stable/10/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.h stable/10/contrib/llvm/lib/Target/X86/X86InstrArithmetic.td stable/10/contrib/llvm/lib/Target/X86/X86InstrCompiler.td stable/10/contrib/llvm/lib/Target/X86/X86InstrControl.td stable/10/contrib/llvm/lib/Target/X86/X86InstrExtension.td stable/10/contrib/llvm/lib/Target/X86/X86InstrFMA.td stable/10/contrib/llvm/lib/Target/X86/X86InstrFPStack.td stable/10/contrib/llvm/lib/Target/X86/X86InstrFormats.td stable/10/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td stable/10/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp stable/10/contrib/llvm/lib/Target/X86/X86InstrInfo.h stable/10/contrib/llvm/lib/Target/X86/X86InstrInfo.td stable/10/contrib/llvm/lib/Target/X86/X86InstrMMX.td stable/10/contrib/llvm/lib/Target/X86/X86InstrSSE.td stable/10/contrib/llvm/lib/Target/X86/X86InstrSVM.td stable/10/contrib/llvm/lib/Target/X86/X86InstrShiftRotate.td stable/10/contrib/llvm/lib/Target/X86/X86InstrSystem.td stable/10/contrib/llvm/lib/Target/X86/X86InstrTSX.td stable/10/contrib/llvm/lib/Target/X86/X86InstrXOP.td stable/10/contrib/llvm/lib/Target/X86/X86JITInfo.cpp stable/10/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp stable/10/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp stable/10/contrib/llvm/lib/Target/X86/X86RegisterInfo.h stable/10/contrib/llvm/lib/Target/X86/X86RegisterInfo.td stable/10/contrib/llvm/lib/Target/X86/X86SchedHaswell.td stable/10/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td stable/10/contrib/llvm/lib/Target/X86/X86Schedule.td stable/10/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td stable/10/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp stable/10/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.h stable/10/contrib/llvm/lib/Target/X86/X86Subtarget.cpp stable/10/contrib/llvm/lib/Target/X86/X86Subtarget.h stable/10/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp stable/10/contrib/llvm/lib/Target/X86/X86TargetObjectFile.cpp stable/10/contrib/llvm/lib/Target/X86/X86TargetObjectFile.h stable/10/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp stable/10/contrib/llvm/lib/Target/X86/X86VZeroUpper.cpp stable/10/contrib/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp stable/10/contrib/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.h stable/10/contrib/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/XCore/XCore.h stable/10/contrib/llvm/lib/Target/XCore/XCoreAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.cpp stable/10/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp stable/10/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h stable/10/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.cpp stable/10/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.h stable/10/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td stable/10/contrib/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp stable/10/contrib/llvm/lib/Target/XCore/XCoreMCInstLower.cpp stable/10/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h stable/10/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.cpp stable/10/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.h stable/10/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp stable/10/contrib/llvm/lib/Transforms/IPO/ConstantMerge.cpp stable/10/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp stable/10/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp stable/10/contrib/llvm/lib/Transforms/IPO/FunctionAttrs.cpp stable/10/contrib/llvm/lib/Transforms/IPO/GlobalDCE.cpp stable/10/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp stable/10/contrib/llvm/lib/Transforms/IPO/InlineAlways.cpp stable/10/contrib/llvm/lib/Transforms/IPO/InlineSimple.cpp stable/10/contrib/llvm/lib/Transforms/IPO/Inliner.cpp stable/10/contrib/llvm/lib/Transforms/IPO/Internalize.cpp stable/10/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp stable/10/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp stable/10/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp stable/10/contrib/llvm/lib/Transforms/IPO/StripSymbols.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineWorklist.h stable/10/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp stable/10/contrib/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp stable/10/contrib/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.h stable/10/contrib/llvm/lib/Transforms/ObjCARC/ObjCARC.h stable/10/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCAliasAnalysis.cpp stable/10/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCAliasAnalysis.h stable/10/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp stable/10/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp stable/10/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCUtil.cpp stable/10/contrib/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.h stable/10/contrib/llvm/lib/Transforms/Scalar/ADCE.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/EarlyCSE.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/GVN.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/GlobalMerge.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/SROA.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/Scalar.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp stable/10/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp stable/10/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp stable/10/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp stable/10/contrib/llvm/lib/Transforms/Utils/CodeExtractor.cpp stable/10/contrib/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp stable/10/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp stable/10/contrib/llvm/lib/Transforms/Utils/LCSSA.cpp stable/10/contrib/llvm/lib/Transforms/Utils/Local.cpp stable/10/contrib/llvm/lib/Transforms/Utils/LoopSimplify.cpp stable/10/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp stable/10/contrib/llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp stable/10/contrib/llvm/lib/Transforms/Utils/LowerInvoke.cpp stable/10/contrib/llvm/lib/Transforms/Utils/LowerSwitch.cpp stable/10/contrib/llvm/lib/Transforms/Utils/MetaRenamer.cpp stable/10/contrib/llvm/lib/Transforms/Utils/ModuleUtils.cpp stable/10/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp stable/10/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp stable/10/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp stable/10/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp stable/10/contrib/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp stable/10/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp stable/10/contrib/llvm/lib/Transforms/Vectorize/BBVectorize.cpp stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp stable/10/contrib/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp stable/10/contrib/llvm/tools/bugpoint/BugDriver.cpp stable/10/contrib/llvm/tools/bugpoint/BugDriver.h stable/10/contrib/llvm/tools/bugpoint/CrashDebugger.cpp stable/10/contrib/llvm/tools/bugpoint/ExecutionDriver.cpp stable/10/contrib/llvm/tools/bugpoint/ExtractFunction.cpp stable/10/contrib/llvm/tools/bugpoint/FindBugs.cpp stable/10/contrib/llvm/tools/bugpoint/Miscompilation.cpp stable/10/contrib/llvm/tools/bugpoint/OptimizerDriver.cpp stable/10/contrib/llvm/tools/bugpoint/ToolRunner.cpp stable/10/contrib/llvm/tools/bugpoint/ToolRunner.h stable/10/contrib/llvm/tools/bugpoint/bugpoint.cpp stable/10/contrib/llvm/tools/clang/include/clang-c/CXCompilationDatabase.h stable/10/contrib/llvm/tools/clang/include/clang-c/CXString.h stable/10/contrib/llvm/tools/clang/include/clang-c/Index.h stable/10/contrib/llvm/tools/clang/include/clang/ARCMigrate/ARCMT.h stable/10/contrib/llvm/tools/clang/include/clang/ARCMigrate/ARCMTActions.h stable/10/contrib/llvm/tools/clang/include/clang/ARCMigrate/FileRemapper.h stable/10/contrib/llvm/tools/clang/include/clang/AST/APValue.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ASTConsumer.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ASTDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ASTImporter.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ASTMutationListener.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ASTTypeTraits.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ASTUnresolvedSet.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ASTVector.h stable/10/contrib/llvm/tools/clang/include/clang/AST/Attr.h stable/10/contrib/llvm/tools/clang/include/clang/AST/CXXInheritance.h stable/10/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h stable/10/contrib/llvm/tools/clang/include/clang/AST/CharUnits.h stable/10/contrib/llvm/tools/clang/include/clang/AST/Comment.h stable/10/contrib/llvm/tools/clang/include/clang/AST/CommentCommandTraits.h stable/10/contrib/llvm/tools/clang/include/clang/AST/CommentCommands.td stable/10/contrib/llvm/tools/clang/include/clang/AST/CommentDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/AST/CommentParser.h stable/10/contrib/llvm/tools/clang/include/clang/AST/CommentSema.h stable/10/contrib/llvm/tools/clang/include/clang/AST/Decl.h stable/10/contrib/llvm/tools/clang/include/clang/AST/DeclAccessPair.h stable/10/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h stable/10/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h stable/10/contrib/llvm/tools/clang/include/clang/AST/DeclContextInternals.h stable/10/contrib/llvm/tools/clang/include/clang/AST/DeclFriend.h stable/10/contrib/llvm/tools/clang/include/clang/AST/DeclLookups.h stable/10/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h stable/10/contrib/llvm/tools/clang/include/clang/AST/DeclOpenMP.h stable/10/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h stable/10/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h stable/10/contrib/llvm/tools/clang/include/clang/AST/EvaluatedExprVisitor.h stable/10/contrib/llvm/tools/clang/include/clang/AST/Expr.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h stable/10/contrib/llvm/tools/clang/include/clang/AST/GlobalDecl.h stable/10/contrib/llvm/tools/clang/include/clang/AST/Mangle.h stable/10/contrib/llvm/tools/clang/include/clang/AST/NestedNameSpecifier.h stable/10/contrib/llvm/tools/clang/include/clang/AST/ParentMap.h stable/10/contrib/llvm/tools/clang/include/clang/AST/PrettyPrinter.h stable/10/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h stable/10/contrib/llvm/tools/clang/include/clang/AST/RecordLayout.h stable/10/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h stable/10/contrib/llvm/tools/clang/include/clang/AST/Redeclarable.h stable/10/contrib/llvm/tools/clang/include/clang/AST/Stmt.h stable/10/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h stable/10/contrib/llvm/tools/clang/include/clang/AST/StmtIterator.h stable/10/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h stable/10/contrib/llvm/tools/clang/include/clang/AST/StmtVisitor.h stable/10/contrib/llvm/tools/clang/include/clang/AST/TemplateBase.h stable/10/contrib/llvm/tools/clang/include/clang/AST/Type.h stable/10/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h stable/10/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def stable/10/contrib/llvm/tools/clang/include/clang/AST/TypeOrdering.h stable/10/contrib/llvm/tools/clang/include/clang/AST/TypeVisitor.h stable/10/contrib/llvm/tools/clang/include/clang/AST/UnresolvedSet.h stable/10/contrib/llvm/tools/clang/include/clang/AST/VTTBuilder.h stable/10/contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h stable/10/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchFinder.h stable/10/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchers.h stable/10/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersInternal.h stable/10/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersMacros.h stable/10/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h stable/10/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/ThreadSafety.h stable/10/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/UninitializedValues.h stable/10/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h stable/10/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/Analysis/CFG.h stable/10/contrib/llvm/tools/clang/include/clang/Analysis/CallGraph.h stable/10/contrib/llvm/tools/clang/include/clang/Analysis/FlowSensitive/DataflowSolver.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/ABI.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/Attr.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/AttrKinds.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsMips.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsNVPTX.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/CapturedStmt.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticASTKinds.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommentKinds.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSerializationKinds.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/FileSystemStatCache.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/Lambda.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/Linkage.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/Module.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/ObjCRuntime.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/OperatorKinds.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/PartialDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td stable/10/contrib/llvm/tools/clang/include/clang/Basic/TargetBuiltins.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/TargetOptions.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/TemplateKinds.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def stable/10/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/Visibility.h stable/10/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td stable/10/contrib/llvm/tools/clang/include/clang/Driver/Action.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.td stable/10/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td stable/10/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/Driver.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/DriverDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/Job.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/Options.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/Options.td stable/10/contrib/llvm/tools/clang/include/clang/Driver/Tool.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/Types.def stable/10/contrib/llvm/tools/clang/include/clang/Driver/Types.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/Util.h stable/10/contrib/llvm/tools/clang/include/clang/Edit/Commit.h stable/10/contrib/llvm/tools/clang/include/clang/Edit/EditedSource.h stable/10/contrib/llvm/tools/clang/include/clang/Edit/Rewriters.h stable/10/contrib/llvm/tools/clang/include/clang/Format/Format.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/ASTConsumers.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.def stable/10/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInstance.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInvocation.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/DependencyOutputOptions.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/FrontendAction.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/FrontendDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/DirectoryLookup.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/LexDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/ModuleLoader.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/ModuleMap.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/MultipleIncludeOpt.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/PPConditionalDirectiveRecord.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/PTHLexer.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/PreprocessorLexer.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/Token.h stable/10/contrib/llvm/tools/clang/include/clang/Lex/TokenLexer.h stable/10/contrib/llvm/tools/clang/include/clang/Parse/ParseDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/Parse/Parser.h stable/10/contrib/llvm/tools/clang/include/clang/Rewrite/Core/HTMLRewrite.h stable/10/contrib/llvm/tools/clang/include/clang/Rewrite/Core/Rewriter.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/AnalysisBasedWarnings.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/AttributeList.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/DelayedDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/ExternalSemaSource.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/IdentifierResolver.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/MultiplexExternalSemaSource.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/Overload.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/Ownership.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/Scope.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/ScopeInfo.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/Sema.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/SemaDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/SemaInternal.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/Template.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h stable/10/contrib/llvm/tools/clang/include/clang/Sema/TypoCorrection.h stable/10/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h stable/10/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h stable/10/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h stable/10/contrib/llvm/tools/clang/include/clang/Serialization/GlobalModuleIndex.h stable/10/contrib/llvm/tools/clang/include/clang/Serialization/ModuleManager.h stable/10/contrib/llvm/tools/clang/include/clang/Serialization/SerializationDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Analyses.def stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerRegistry.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h stable/10/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h stable/10/contrib/llvm/tools/clang/include/clang/Tooling/ArgumentsAdjusters.h stable/10/contrib/llvm/tools/clang/include/clang/Tooling/CommonOptionsParser.h stable/10/contrib/llvm/tools/clang/include/clang/Tooling/CompilationDatabase.h stable/10/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring.h stable/10/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h stable/10/contrib/llvm/tools/clang/lib/ARCMigrate/ARCMT.cpp stable/10/contrib/llvm/tools/clang/lib/ARCMigrate/FileRemapper.cpp stable/10/contrib/llvm/tools/clang/lib/ARCMigrate/ObjCMT.cpp stable/10/contrib/llvm/tools/clang/lib/ARCMigrate/TransUnbridgedCasts.cpp stable/10/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.cpp stable/10/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.h stable/10/contrib/llvm/tools/clang/lib/AST/APValue.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp stable/10/contrib/llvm/tools/clang/lib/AST/AttrImpl.cpp stable/10/contrib/llvm/tools/clang/lib/AST/CXXABI.h stable/10/contrib/llvm/tools/clang/lib/AST/CXXInheritance.cpp stable/10/contrib/llvm/tools/clang/lib/AST/Comment.cpp stable/10/contrib/llvm/tools/clang/lib/AST/CommentCommandTraits.cpp stable/10/contrib/llvm/tools/clang/lib/AST/CommentLexer.cpp stable/10/contrib/llvm/tools/clang/lib/AST/CommentParser.cpp stable/10/contrib/llvm/tools/clang/lib/AST/CommentSema.cpp stable/10/contrib/llvm/tools/clang/lib/AST/Decl.cpp stable/10/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp stable/10/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp stable/10/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp stable/10/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp stable/10/contrib/llvm/tools/clang/lib/AST/DeclOpenMP.cpp stable/10/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp stable/10/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp stable/10/contrib/llvm/tools/clang/lib/AST/DeclarationName.cpp stable/10/contrib/llvm/tools/clang/lib/AST/Expr.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp stable/10/contrib/llvm/tools/clang/lib/AST/InheritViz.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp stable/10/contrib/llvm/tools/clang/lib/AST/Mangle.cpp stable/10/contrib/llvm/tools/clang/lib/AST/MicrosoftCXXABI.cpp stable/10/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp stable/10/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ParentMap.cpp stable/10/contrib/llvm/tools/clang/lib/AST/RawCommentList.cpp stable/10/contrib/llvm/tools/clang/lib/AST/RecordLayout.cpp stable/10/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp stable/10/contrib/llvm/tools/clang/lib/AST/Stmt.cpp stable/10/contrib/llvm/tools/clang/lib/AST/StmtIterator.cpp stable/10/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp stable/10/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp stable/10/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp stable/10/contrib/llvm/tools/clang/lib/AST/Type.cpp stable/10/contrib/llvm/tools/clang/lib/AST/TypeLoc.cpp stable/10/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp stable/10/contrib/llvm/tools/clang/lib/AST/VTableBuilder.cpp stable/10/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchFinder.cpp stable/10/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchersInternal.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/CFGReachabilityAnalysis.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/ReachableCode.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/ScanfFormatString.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/Builtins.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/Module.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/ObjCRuntime.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/OpenMPKinds.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/OperatorPrecedence.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/Targets.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/Version.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/ABIInfo.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGCUDARuntime.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGExprComplex.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGRTTI.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGValue.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h stable/10/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.h stable/10/contrib/llvm/tools/clang/lib/Driver/Action.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/CC1AsOptions.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/Compilation.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/Driver.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/DriverOptions.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/InputInfo.h stable/10/contrib/llvm/tools/clang/lib/Driver/Job.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.h stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.h stable/10/contrib/llvm/tools/clang/lib/Driver/Types.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/WindowsToolChain.cpp stable/10/contrib/llvm/tools/clang/lib/Edit/Commit.cpp stable/10/contrib/llvm/tools/clang/lib/Format/BreakableToken.cpp stable/10/contrib/llvm/tools/clang/lib/Format/BreakableToken.h stable/10/contrib/llvm/tools/clang/lib/Format/Format.cpp stable/10/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.cpp stable/10/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.h stable/10/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.cpp stable/10/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.h stable/10/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.cpp stable/10/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.h stable/10/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/CacheTokens.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/ChainedIncludesSource.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/FrontendOptions.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/HeaderIncludeGen.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/MultiplexConsumer.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/TextDiagnostic.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp stable/10/contrib/llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp stable/10/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp stable/10/contrib/llvm/tools/clang/lib/Headers/avx2intrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/avxintrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/emmintrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/f16cintrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/immintrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/limits.h stable/10/contrib/llvm/tools/clang/lib/Headers/module.map stable/10/contrib/llvm/tools/clang/lib/Headers/prfchwintrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/rdseedintrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/rtmintrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/smmintrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/tgmath.h stable/10/contrib/llvm/tools/clang/lib/Headers/unwind.h stable/10/contrib/llvm/tools/clang/lib/Headers/x86intrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h stable/10/contrib/llvm/tools/clang/lib/Headers/xopintrin.h stable/10/contrib/llvm/tools/clang/lib/Lex/HeaderMap.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/ModuleMap.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/PPConditionalDirectiveRecord.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/PTHLexer.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/PreprocessorLexer.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp stable/10/contrib/llvm/tools/clang/lib/Lex/UnicodeCharSets.h stable/10/contrib/llvm/tools/clang/lib/Parse/ParseAST.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParseInit.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParseOpenMP.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParsePragma.h stable/10/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/Parser.cpp stable/10/contrib/llvm/tools/clang/lib/Parse/RAIIObjectsForParser.h stable/10/contrib/llvm/tools/clang/lib/Rewrite/Core/HTMLRewrite.cpp stable/10/contrib/llvm/tools/clang/lib/Rewrite/Core/Rewriter.cpp stable/10/contrib/llvm/tools/clang/lib/Rewrite/Frontend/FixItRewriter.cpp stable/10/contrib/llvm/tools/clang/lib/Rewrite/Frontend/FrontendActions.cpp stable/10/contrib/llvm/tools/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp stable/10/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteMacros.cpp stable/10/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp stable/10/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteObjC.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/AttributeList.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/IdentifierResolver.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/Sema.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaExprMember.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaFixItUtils.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaLambda.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaPseudoObject.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaStmtAsm.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/TargetAttributesSema.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h stable/10/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.h stable/10/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.cpp stable/10/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.h stable/10/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp stable/10/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp stable/10/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp stable/10/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp stable/10/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp stable/10/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp stable/10/contrib/llvm/tools/clang/lib/Serialization/GeneratePCH.cpp stable/10/contrib/llvm/tools/clang/lib/Serialization/GlobalModuleIndex.cpp stable/10/contrib/llvm/tools/clang/lib/Serialization/ModuleManager.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ClangSACheckers.h stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporter.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/MemRegion.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ProgramState.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Store.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp stable/10/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp stable/10/contrib/llvm/tools/clang/lib/Tooling/ArgumentsAdjusters.cpp stable/10/contrib/llvm/tools/clang/lib/Tooling/CommonOptionsParser.cpp stable/10/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp stable/10/contrib/llvm/tools/clang/lib/Tooling/FileMatchTrie.cpp stable/10/contrib/llvm/tools/clang/lib/Tooling/JSONCompilationDatabase.cpp stable/10/contrib/llvm/tools/clang/lib/Tooling/Refactoring.cpp stable/10/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp stable/10/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp stable/10/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp stable/10/contrib/llvm/tools/clang/tools/driver/driver.cpp stable/10/contrib/llvm/tools/clang/utils/TableGen/ClangAttrEmitter.cpp stable/10/contrib/llvm/tools/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp stable/10/contrib/llvm/tools/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp stable/10/contrib/llvm/tools/clang/utils/TableGen/NeonEmitter.cpp stable/10/contrib/llvm/tools/clang/utils/TableGen/TableGen.cpp stable/10/contrib/llvm/tools/clang/utils/TableGen/TableGenBackends.h stable/10/contrib/llvm/tools/llc/llc.cpp stable/10/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h stable/10/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp stable/10/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp stable/10/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp stable/10/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp stable/10/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp stable/10/contrib/llvm/tools/lli/RemoteTarget.cpp stable/10/contrib/llvm/tools/lli/RemoteTarget.h stable/10/contrib/llvm/tools/lli/lli.cpp stable/10/contrib/llvm/tools/llvm-ar/llvm-ar.cpp stable/10/contrib/llvm/tools/llvm-as/llvm-as.cpp stable/10/contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp stable/10/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp stable/10/contrib/llvm/tools/llvm-diff/llvm-diff.cpp stable/10/contrib/llvm/tools/llvm-dis/llvm-dis.cpp stable/10/contrib/llvm/tools/llvm-extract/llvm-extract.cpp stable/10/contrib/llvm/tools/llvm-link/llvm-link.cpp stable/10/contrib/llvm/tools/llvm-mc/Disassembler.cpp stable/10/contrib/llvm/tools/llvm-mc/llvm-mc.cpp stable/10/contrib/llvm/tools/llvm-nm/llvm-nm.cpp stable/10/contrib/llvm/tools/llvm-objdump/COFFDump.cpp stable/10/contrib/llvm/tools/llvm-objdump/ELFDump.cpp stable/10/contrib/llvm/tools/llvm-objdump/MachODump.cpp stable/10/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp stable/10/contrib/llvm/tools/llvm-objdump/llvm-objdump.h stable/10/contrib/llvm/tools/llvm-readobj/COFFDumper.cpp stable/10/contrib/llvm/tools/llvm-readobj/ELFDumper.cpp stable/10/contrib/llvm/tools/llvm-readobj/MachODumper.cpp stable/10/contrib/llvm/tools/llvm-readobj/llvm-readobj.cpp stable/10/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp stable/10/contrib/llvm/tools/llvm-stress/llvm-stress.cpp stable/10/contrib/llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp stable/10/contrib/llvm/tools/llvm-symbolizer/LLVMSymbolize.h stable/10/contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp stable/10/contrib/llvm/tools/macho-dump/macho-dump.cpp stable/10/contrib/llvm/tools/opt/opt.cpp stable/10/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp stable/10/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp stable/10/contrib/llvm/utils/TableGen/AsmWriterInst.cpp stable/10/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp stable/10/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.h stable/10/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp stable/10/contrib/llvm/utils/TableGen/CodeGenInstruction.h stable/10/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h stable/10/contrib/llvm/utils/TableGen/CodeGenMapTable.cpp stable/10/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp stable/10/contrib/llvm/utils/TableGen/CodeGenRegisters.h stable/10/contrib/llvm/utils/TableGen/CodeGenSchedule.cpp stable/10/contrib/llvm/utils/TableGen/CodeGenSchedule.h stable/10/contrib/llvm/utils/TableGen/CodeGenTarget.cpp stable/10/contrib/llvm/utils/TableGen/DAGISelEmitter.cpp stable/10/contrib/llvm/utils/TableGen/DAGISelMatcher.cpp stable/10/contrib/llvm/utils/TableGen/DAGISelMatcher.h stable/10/contrib/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp stable/10/contrib/llvm/utils/TableGen/DAGISelMatcherOpt.cpp stable/10/contrib/llvm/utils/TableGen/FastISelEmitter.cpp stable/10/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp stable/10/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp stable/10/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp stable/10/contrib/llvm/utils/TableGen/OptParserEmitter.cpp stable/10/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp stable/10/contrib/llvm/utils/TableGen/SequenceToOffsetTable.h stable/10/contrib/llvm/utils/TableGen/SetTheory.cpp stable/10/contrib/llvm/utils/TableGen/SubtargetEmitter.cpp stable/10/contrib/llvm/utils/TableGen/TGValueTypes.cpp stable/10/contrib/llvm/utils/TableGen/X86DisassemblerTables.cpp stable/10/contrib/llvm/utils/TableGen/X86DisassemblerTables.h stable/10/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp stable/10/contrib/llvm/utils/TableGen/X86RecognizableInstr.h stable/10/etc/mtree/BSD.include.dist stable/10/lib/clang/Makefile stable/10/lib/clang/clang.build.mk stable/10/lib/clang/include/Makefile stable/10/lib/clang/include/clang/Basic/Version.inc stable/10/lib/clang/include/llvm/Config/config.h stable/10/lib/clang/include/llvm/Config/llvm-config.h stable/10/lib/clang/libclanganalysis/Makefile stable/10/lib/clang/libclangast/Makefile stable/10/lib/clang/libclangcodegen/Makefile stable/10/lib/clang/libclangdriver/Makefile stable/10/lib/clang/libclangparse/Makefile stable/10/lib/clang/libclangsema/Makefile stable/10/lib/clang/libclangstaticanalyzercheckers/Makefile stable/10/lib/clang/libclangstaticanalyzercore/Makefile stable/10/lib/clang/libllvmanalysis/Makefile stable/10/lib/clang/libllvmarmdesc/Makefile stable/10/lib/clang/libllvmasmprinter/Makefile stable/10/lib/clang/libllvmcodegen/Makefile stable/10/lib/clang/libllvmcore/Makefile stable/10/lib/clang/libllvmdebuginfo/Makefile stable/10/lib/clang/libllvmexecutionengine/Makefile stable/10/lib/clang/libllvminstrumentation/Makefile stable/10/lib/clang/libllvmjit/Makefile stable/10/lib/clang/libllvmmc/Makefile stable/10/lib/clang/libllvmmipscodegen/Makefile stable/10/lib/clang/libllvmmipsdesc/Makefile stable/10/lib/clang/libllvmobject/Makefile stable/10/lib/clang/libllvmpowerpccodegen/Makefile stable/10/lib/clang/libllvmpowerpcdesc/Makefile stable/10/lib/clang/libllvmscalaropts/Makefile stable/10/lib/clang/libllvmsupport/Makefile stable/10/lib/clang/libllvmtransformutils/Makefile stable/10/lib/clang/libllvmvectorize/Makefile stable/10/lib/clang/libllvmx86desc/Makefile stable/10/share/mk/bsd.sys.mk stable/10/sys/amd64/conf/GENERIC stable/10/sys/conf/kern.mk stable/10/sys/i386/conf/GENERIC stable/10/sys/i386/conf/XEN stable/10/sys/sys/param.h stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.bin/clang/Makefile stable/10/usr.bin/clang/bugpoint/bugpoint.1 stable/10/usr.bin/clang/clang-tblgen/Makefile stable/10/usr.bin/clang/clang.prog.mk stable/10/usr.bin/clang/clang/Makefile stable/10/usr.bin/clang/clang/clang.1 stable/10/usr.bin/clang/llc/Makefile stable/10/usr.bin/clang/llc/llc.1 stable/10/usr.bin/clang/lldb/Makefile stable/10/usr.bin/clang/lli/Makefile stable/10/usr.bin/clang/lli/lli.1 stable/10/usr.bin/clang/llvm-ar/Makefile stable/10/usr.bin/clang/llvm-ar/llvm-ar.1 stable/10/usr.bin/clang/llvm-as/llvm-as.1 stable/10/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 stable/10/usr.bin/clang/llvm-diff/llvm-diff.1 stable/10/usr.bin/clang/llvm-dis/llvm-dis.1 stable/10/usr.bin/clang/llvm-extract/llvm-extract.1 stable/10/usr.bin/clang/llvm-link/llvm-link.1 stable/10/usr.bin/clang/llvm-mc/Makefile stable/10/usr.bin/clang/llvm-nm/Makefile stable/10/usr.bin/clang/llvm-nm/llvm-nm.1 stable/10/usr.bin/clang/llvm-objdump/Makefile stable/10/usr.bin/clang/llvm-rtdyld/Makefile stable/10/usr.bin/clang/opt/Makefile stable/10/usr.bin/clang/opt/opt.1 stable/10/usr.bin/clang/tblgen/tblgen.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/ObsoleteFiles.inc Fri Mar 21 17:53:59 2014 (r263508) @@ -38,6 +38,43 @@ # xargs -n1 | sort | uniq -d; # done +# 20140321: new clang import which bumps version from 3.3 to 3.4. +OLD_FILES+=usr/bin/llvm-prof +OLD_FILES+=usr/bin/llvm-ranlib +OLD_FILES+=usr/include/clang/3.3/__wmmintrin_aes.h +OLD_FILES+=usr/include/clang/3.3/__wmmintrin_pclmul.h +OLD_FILES+=usr/include/clang/3.3/altivec.h +OLD_FILES+=usr/include/clang/3.3/ammintrin.h +OLD_FILES+=usr/include/clang/3.3/avx2intrin.h +OLD_FILES+=usr/include/clang/3.3/avxintrin.h +OLD_FILES+=usr/include/clang/3.3/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.3/bmiintrin.h +OLD_FILES+=usr/include/clang/3.3/cpuid.h +OLD_FILES+=usr/include/clang/3.3/emmintrin.h +OLD_FILES+=usr/include/clang/3.3/f16cintrin.h +OLD_FILES+=usr/include/clang/3.3/fma4intrin.h +OLD_FILES+=usr/include/clang/3.3/fmaintrin.h +OLD_FILES+=usr/include/clang/3.3/immintrin.h +OLD_FILES+=usr/include/clang/3.3/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.3/mm3dnow.h +OLD_FILES+=usr/include/clang/3.3/mm_malloc.h +OLD_FILES+=usr/include/clang/3.3/mmintrin.h +OLD_FILES+=usr/include/clang/3.3/module.map +OLD_FILES+=usr/include/clang/3.3/nmmintrin.h +OLD_FILES+=usr/include/clang/3.3/pmmintrin.h +OLD_FILES+=usr/include/clang/3.3/popcntintrin.h +OLD_FILES+=usr/include/clang/3.3/prfchwintrin.h +OLD_FILES+=usr/include/clang/3.3/rdseedintrin.h +OLD_FILES+=usr/include/clang/3.3/rtmintrin.h +OLD_FILES+=usr/include/clang/3.3/smmintrin.h +OLD_FILES+=usr/include/clang/3.3/tmmintrin.h +OLD_FILES+=usr/include/clang/3.3/wmmintrin.h +OLD_FILES+=usr/include/clang/3.3/x86intrin.h +OLD_FILES+=usr/include/clang/3.3/xmmintrin.h +OLD_FILES+=usr/include/clang/3.3/xopintrin.h +OLD_FILES+=usr/share/man/man1/llvm-prof.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz +OLD_DIRS+=usr/include/clang/3.3 # 20131109: extattr(2) mlinks fixed OLD_FILES+=usr/share/man/man2/extattr_delete_list.2.gz OLD_FILES+=usr/share/man/man2/extattr_get_list.2.gz Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/UPDATING Fri Mar 21 17:53:59 2014 (r263508) @@ -17,6 +17,9 @@ stable/10, and then rebuild without this older version of current is a bit fragile. +20140321: + Clang and llvm have been upgraded to 3.4 release. + 20140306: If a Makefile in a tests/ directory was auto-generating a Kyuafile instead of providing an explicit one, this would prevent such Modified: stable/10/contrib/gcc/libgcc2.c ============================================================================== --- stable/10/contrib/gcc/libgcc2.c Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/gcc/libgcc2.c Fri Mar 21 17:53:59 2014 (r263508) @@ -2007,8 +2007,8 @@ __eprintf (const char *string, const cha /* Clear part of an instruction cache. */ void -__clear_cache (char *beg __attribute__((__unused__)), - char *end __attribute__((__unused__))) +__clear_cache (void *beg __attribute__((__unused__)), + void *end __attribute__((__unused__))) { #ifdef CLEAR_INSN_CACHE CLEAR_INSN_CACHE (beg, end); Modified: stable/10/contrib/gcc/libgcc2.h ============================================================================== --- stable/10/contrib/gcc/libgcc2.h Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/gcc/libgcc2.h Fri Mar 21 17:53:59 2014 (r263508) @@ -35,7 +35,7 @@ Software Foundation, 51 Franklin Street, #endif extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t); -extern void __clear_cache (char *, char *); +extern void __clear_cache (void *, void *); extern void __eprintf (const char *, const char *, unsigned int, const char *) __attribute__ ((__noreturn__)); Modified: stable/10/contrib/llvm/LICENSE.TXT ============================================================================== --- stable/10/contrib/llvm/LICENSE.TXT Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/llvm/LICENSE.TXT Fri Mar 21 17:53:59 2014 (r263508) @@ -68,3 +68,4 @@ Google Test llvm/utils/unittest/ OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} ARM contributions llvm/lib/Target/ARM/LICENSE.TXT +md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h Modified: stable/10/contrib/llvm/include/llvm-c/BitReader.h ============================================================================== --- stable/10/contrib/llvm/include/llvm-c/BitReader.h Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/llvm/include/llvm-c/BitReader.h Fri Mar 21 17:53:59 2014 (r263508) @@ -34,7 +34,7 @@ extern "C" { /* Builds a module from the bitcode in the specified memory buffer, returning a reference to the module via the OutModule parameter. Returns 0 on success. - Optionally returns a human-readable error message via OutMessage. */ + Optionally returns a human-readable error message via OutMessage. */ LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, char **OutMessage); @@ -44,7 +44,7 @@ LLVMBool LLVMParseBitcodeInContext(LLVMC /** Reads a module from the specified path, returning via the OutMP parameter a module provider which performs lazy deserialization. Returns 0 on success. - Optionally returns a human-readable error message via OutMessage. */ + Optionally returns a human-readable error message via OutMessage. */ LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, Modified: stable/10/contrib/llvm/include/llvm-c/BitWriter.h ============================================================================== --- stable/10/contrib/llvm/include/llvm-c/BitWriter.h Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/llvm/include/llvm-c/BitWriter.h Fri Mar 21 17:53:59 2014 (r263508) @@ -34,7 +34,7 @@ extern "C" { /*===-- Operations on modules ---------------------------------------------===*/ -/** Writes a module to the specified path. Returns 0 on success. */ +/** Writes a module to the specified path. Returns 0 on success. */ int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path); /** Writes a module to an open file descriptor. Returns 0 on success. */ @@ -42,7 +42,7 @@ int LLVMWriteBitcodeToFD(LLVMModuleRef M int Unbuffered); /** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file - descriptor. Returns 0 on success. Closes the Handle. */ + descriptor. Returns 0 on success. Closes the Handle. */ int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle); /** Modified: stable/10/contrib/llvm/include/llvm-c/Core.h ============================================================================== --- stable/10/contrib/llvm/include/llvm-c/Core.h Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/llvm/include/llvm-c/Core.h Fri Mar 21 17:53:59 2014 (r263508) @@ -165,7 +165,9 @@ typedef enum { a temporary measure until the API/ABI impact to the C API is understood and the path forward agreed upon. LLVMAddressSafety = 1ULL << 32, - LLVMStackProtectStrongAttribute = 1ULL<<33 + LLVMStackProtectStrongAttribute = 1ULL<<33, + LLVMCold = 1ULL << 34, + LLVMOptimizeNone = 1ULL << 35 */ } LLVMAttribute; @@ -220,6 +222,7 @@ typedef enum { LLVMPtrToInt = 39, LLVMIntToPtr = 40, LLVMBitCast = 41, + LLVMAddrSpaceCast = 60, /* Other Operators */ LLVMICmp = 42, @@ -272,7 +275,7 @@ typedef enum { LLVMLinkOnceAnyLinkage, /**< Keep one copy of function when linking (inline)*/ LLVMLinkOnceODRLinkage, /**< Same, but only replaced by something equivalent. */ - LLVMLinkOnceODRAutoHideLinkage, /**< Like LinkOnceODR, but possibly hidden. */ + LLVMLinkOnceODRAutoHideLinkage, /**< Obsolete */ LLVMWeakAnyLinkage, /**< Keep one copy of function when linking (weak) */ LLVMWeakODRLinkage, /**< Same, but only replaced by something equivalent. */ @@ -299,6 +302,8 @@ typedef enum { LLVMCCallConv = 0, LLVMFastCallConv = 8, LLVMColdCallConv = 9, + LLVMWebKitJSCallConv = 12, + LLVMAnyRegCallConv = 13, LLVMX86StdcallCallConv = 64, LLVMX86FastcallCallConv = 65 } LLVMCallConv; @@ -352,26 +357,26 @@ typedef enum { LLVMAtomicOrderingNotAtomic = 0, /**< A load or store which is not atomic */ LLVMAtomicOrderingUnordered = 1, /**< Lowest level of atomicity, guarantees somewhat sane results, lock free. */ - LLVMAtomicOrderingMonotonic = 2, /**< guarantees that if you take all the - operations affecting a specific address, + LLVMAtomicOrderingMonotonic = 2, /**< guarantees that if you take all the + operations affecting a specific address, a consistent ordering exists */ - LLVMAtomicOrderingAcquire = 4, /**< Acquire provides a barrier of the sort - necessary to acquire a lock to access other + LLVMAtomicOrderingAcquire = 4, /**< Acquire provides a barrier of the sort + necessary to acquire a lock to access other memory with normal loads and stores. */ - LLVMAtomicOrderingRelease = 5, /**< Release is similar to Acquire, but with - a barrier of the sort necessary to release + LLVMAtomicOrderingRelease = 5, /**< Release is similar to Acquire, but with + a barrier of the sort necessary to release a lock. */ - LLVMAtomicOrderingAcquireRelease = 6, /**< provides both an Acquire and a - Release barrier (for fences and + LLVMAtomicOrderingAcquireRelease = 6, /**< provides both an Acquire and a + Release barrier (for fences and operations which both read and write memory). */ - LLVMAtomicOrderingSequentiallyConsistent = 7 /**< provides Acquire semantics - for loads and Release - semantics for stores. - Additionally, it guarantees - that a total ordering exists - between all - SequentiallyConsistent + LLVMAtomicOrderingSequentiallyConsistent = 7 /**< provides Acquire semantics + for loads and Release + semantics for stores. + Additionally, it guarantees + that a total ordering exists + between all + SequentiallyConsistent operations. */ } LLVMAtomicOrdering; @@ -384,16 +389,16 @@ typedef enum { LLVMAtomicRMWBinOpOr, /**< OR a value and return the old one */ LLVMAtomicRMWBinOpXor, /**< Xor a value and return the old one */ LLVMAtomicRMWBinOpMax, /**< Sets the value if it's greater than the - original using a signed comparison and return + original using a signed comparison and return the old one */ LLVMAtomicRMWBinOpMin, /**< Sets the value if it's Smaller than the - original using a signed comparison and return + original using a signed comparison and return the old one */ LLVMAtomicRMWBinOpUMax, /**< Sets the value if it's greater than the - original using an unsigned comparison and return + original using an unsigned comparison and return the old one */ LLVMAtomicRMWBinOpUMin /**< Sets the value if it's greater than the - original using an unsigned comparison and return + original using an unsigned comparison and return the old one */ } LLVMAtomicRMWBinOp; @@ -406,13 +411,37 @@ void LLVMInitializeCore(LLVMPassRegistry /** Deallocate and destroy all ManagedStatic variables. @see llvm::llvm_shutdown @see ManagedStatic */ -void LLVMShutdown(); +void LLVMShutdown(void); /*===-- Error handling ----------------------------------------------------===*/ +char *LLVMCreateMessage(const char *Message); void LLVMDisposeMessage(char *Message); +typedef void (*LLVMFatalErrorHandler)(const char *Reason); + +/** + * Install a fatal error handler. By default, if LLVM detects a fatal error, it + * will call exit(1). This may not be appropriate in many contexts. For example, + * doing exit(1) will bypass many crash reporting/tracing system tools. This + * function allows you to install a callback that will be invoked prior to the + * call to exit(1). + */ +void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler); + +/** + * Reset the fatal error handler. This resets LLVM's fatal error handling + * behavior to the default. + */ +void LLVMResetFatalErrorHandler(void); + +/** + * Enable LLVM's built-in stack trace code. This intercepts the OS's crash + * signals and prints which component of LLVM you were in at the time if the + * crash. + */ +void LLVMEnablePrettyStackTrace(void); /** * @defgroup LLVMCCoreContext Contexts @@ -458,7 +487,7 @@ unsigned LLVMGetMDKindID(const char* Nam /** * @defgroup LLVMCCoreModule Modules * - * Modules represent the top-level structure in a LLVM program. An LLVM + * Modules represent the top-level structure in an LLVM program. An LLVM * module is effectively a translation unit or a collection of * translation units merged together. * @@ -538,6 +567,14 @@ LLVMBool LLVMPrintModuleToFile(LLVMModul char **ErrorMessage); /** + * Return a string representation of the module. Use + * LLVMDisposeMessage to free the string. + * + * @see Module::print() + */ +char *LLVMPrintModuleToString(LLVMModuleRef M); + +/** * Set inline assembly for a module. * * @see Module::setModuleInlineAsm() @@ -689,6 +726,21 @@ LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty) LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty); /** + * Dump a representation of a type to stderr. + * + * @see llvm::Type::dump() + */ +void LLVMDumpType(LLVMTypeRef Val); + +/** + * Return a string representation of the type. Use + * LLVMDisposeMessage to free the string. + * + * @see llvm::Type::print() + */ +char *LLVMPrintTypeToString(LLVMTypeRef Val); + +/** * @defgroup LLVMCCoreTypeInt Integer Types * * Functions in this section operate on integer types. @@ -1039,7 +1091,7 @@ LLVMTypeRef LLVMX86MMXType(void); * hierarchy of classes within this type. Depending on the instance * obtained, not all APIs are available. * - * Callers can determine the type of a LLVMValueRef by calling the + * Callers can determine the type of an LLVMValueRef by calling the * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These * functions are defined by a macro, so it isn't obvious which are * available by looking at the Doxygen source code. Instead, look at the @@ -1061,6 +1113,9 @@ LLVMTypeRef LLVMX86MMXType(void); macro(BlockAddress) \ macro(ConstantAggregateZero) \ macro(ConstantArray) \ + macro(ConstantDataSequential) \ + macro(ConstantDataArray) \ + macro(ConstantDataVector) \ macro(ConstantExpr) \ macro(ConstantFP) \ macro(ConstantInt) \ @@ -1105,6 +1160,7 @@ LLVMTypeRef LLVMX86MMXType(void); macro(UnaryInstruction) \ macro(AllocaInst) \ macro(CastInst) \ + macro(AddrSpaceCastInst) \ macro(BitCastInst) \ macro(FPExtInst) \ macro(FPToSIInst) \ @@ -1160,6 +1216,14 @@ void LLVMSetValueName(LLVMValueRef Val, void LLVMDumpValue(LLVMValueRef Val); /** + * Return a string representation of the value. Use + * LLVMDisposeMessage to free the string. + * + * @see llvm::Value::print() + */ +char *LLVMPrintValueToString(LLVMValueRef Val); + +/** * Replace all uses of a value with another one. * * @see llvm::Value::replaceAllUsesWith() @@ -1179,7 +1243,7 @@ LLVMBool LLVMIsUndef(LLVMValueRef Val); /** * Convert value instances between types. * - * Internally, a LLVMValueRef is "pinned" to a specific type. This + * Internally, an LLVMValueRef is "pinned" to a specific type. This * series of functions allows you to cast an instance to a specific * type. * @@ -1201,7 +1265,7 @@ LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLAR * This module defines functions that allow you to inspect the uses of a * LLVMValueRef. * - * It is possible to obtain a LLVMUseRef for any LLVMValueRef instance. + * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance. * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a * llvm::User and llvm::Value. * @@ -1568,6 +1632,7 @@ LLVMValueRef LLVMConstFPToSI(LLVMValueRe LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType); LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType); LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal, @@ -1623,8 +1688,33 @@ const char *LLVMGetSection(LLVMValueRef void LLVMSetSection(LLVMValueRef Global, const char *Section); LLVMVisibility LLVMGetVisibility(LLVMValueRef Global); void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz); -unsigned LLVMGetAlignment(LLVMValueRef Global); -void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes); + +/** + * @defgroup LLVMCCoreValueWithAlignment Values with alignment + * + * Functions in this group only apply to values with alignment, i.e. + * global variables, load and store instructions. + */ + +/** + * Obtain the preferred alignment of the value. + * @see llvm::LoadInst::getAlignment() + * @see llvm::StoreInst::getAlignment() + * @see llvm::GlobalValue::getAlignment() + */ +unsigned LLVMGetAlignment(LLVMValueRef V); + +/** + * Set the preferred alignment of the value. + * @see llvm::LoadInst::setAlignment() + * @see llvm::StoreInst::setAlignment() + * @see llvm::GlobalValue::setAlignment() + */ +void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes); + +/** + * @} + */ /** * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables @@ -1804,7 +1894,7 @@ LLVMValueRef LLVMGetParam(LLVMValueRef F /** * Obtain the function to which this argument belongs. * - * Unlike other functions in this group, this one takes a LLVMValueRef + * Unlike other functions in this group, this one takes an LLVMValueRef * that corresponds to a llvm::Attribute. * * The returned LLVMValueRef is the llvm::Function to which this @@ -1829,7 +1919,7 @@ LLVMValueRef LLVMGetLastParam(LLVMValueR /** * Obtain the next parameter to a function. * - * This takes a LLVMValueRef obtained from LLVMGetFirstParam() (which is + * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is * actually a wrapped iterator) and obtains the next parameter from the * underlying iterator. */ @@ -1978,12 +2068,12 @@ void LLVMGetMDNodeOperands(LLVMValueRef LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB); /** - * Determine whether a LLVMValueRef is itself a basic block. + * Determine whether an LLVMValueRef is itself a basic block. */ LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val); /** - * Convert a LLVMValueRef to a LLVMBasicBlockRef instance. + * Convert an LLVMValueRef to an LLVMBasicBlockRef instance. */ LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val); @@ -2140,7 +2230,7 @@ LLVMValueRef LLVMGetFirstInstruction(LLV /** * Obtain the last instruction in a basic block. * - * The returned LLVMValueRef corresponds to a LLVM:Instruction. + * The returned LLVMValueRef corresponds to an LLVM:Instruction. */ LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB); @@ -2322,12 +2412,12 @@ void LLVMAddIncoming(LLVMValueRef PhiNod unsigned LLVMCountIncoming(LLVMValueRef PhiNode); /** - * Obtain an incoming value to a PHI node as a LLVMValueRef. + * Obtain an incoming value to a PHI node as an LLVMValueRef. */ LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index); /** - * Obtain an incoming value to a PHI node as a LLVMBasicBlockRef. + * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef. */ LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index); @@ -2518,6 +2608,8 @@ LLVMValueRef LLVMBuildIntToPtr(LLVMBuild LLVMTypeRef DestTy, const char *Name); LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, @@ -2571,9 +2663,9 @@ LLVMValueRef LLVMBuildIsNotNull(LLVMBuil const char *Name); LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op, - LLVMValueRef PTR, LLVMValueRef Val, - LLVMAtomicOrdering ordering, +LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op, + LLVMValueRef PTR, LLVMValueRef Val, + LLVMAtomicOrdering ordering, LLVMBool singleThread); /** @@ -2706,16 +2798,16 @@ void LLVMDisposePassManager(LLVMPassMana initialization succeeded. Must be executed in isolation from all other LLVM api calls. @see llvm::llvm_start_multithreaded */ -LLVMBool LLVMStartMultithreaded(); +LLVMBool LLVMStartMultithreaded(void); /** Deallocate structures necessary to make LLVM safe for multithreading. Must be executed in isolation from all other LLVM api calls. @see llvm::llvm_stop_multithreaded */ -void LLVMStopMultithreaded(); +void LLVMStopMultithreaded(void); /** Check whether LLVM is executing in thread-safe mode or not. @see llvm::llvm_is_multithreaded */ -LLVMBool LLVMIsMultithreaded(); +LLVMBool LLVMIsMultithreaded(void); /** * @} Modified: stable/10/contrib/llvm/include/llvm-c/Disassembler.h ============================================================================== --- stable/10/contrib/llvm/include/llvm-c/Disassembler.h Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/llvm/include/llvm-c/Disassembler.h Fri Mar 21 17:53:59 2014 (r263508) @@ -42,7 +42,7 @@ typedef void *LLVMDisasmContextRef; * instruction are specified by the Offset parameter and its byte widith is the * size parameter. For instructions sets with fixed widths and one symbolic * operand per instruction, the Offset parameter will be zero and Size parameter - * will be the instruction width. The information is returned in TagBuf and is + * will be the instruction width. The information is returned in TagBuf and is * Triple specific with its specific information defined by the value of * TagType for that Triple. If symbolic information is returned the function * returns 1, otherwise it returns 0. @@ -58,7 +58,7 @@ typedef int (*LLVMOpInfoCallback)(void * * SubtractSymbol can be link edited independent of each other. Many other * platforms only allow a relocatable expression of the form AddSymbol + Offset * to be encoded. - * + * * The LLVMOpInfoCallback() for the TagType value of 1 uses the struct * LLVMOpInfo1. The value of the relocatable expression for the operand, * including any PC adjustment, is passed in to the call back in the Value @@ -130,6 +130,17 @@ typedef const char *(*LLVMSymbolLookupCa /* The output reference is to a cstring address in a literal pool. */ #define LLVMDisassembler_ReferenceType_Out_LitPool_CstrAddr 3 +/* The output reference is to a Objective-C CoreFoundation string. */ +#define LLVMDisassembler_ReferenceType_Out_Objc_CFString_Ref 4 +/* The output reference is to a Objective-C message. */ +#define LLVMDisassembler_ReferenceType_Out_Objc_Message 5 +/* The output reference is to a Objective-C message ref. */ +#define LLVMDisassembler_ReferenceType_Out_Objc_Message_Ref 6 +/* The output reference is to a Objective-C selector ref. */ +#define LLVMDisassembler_ReferenceType_Out_Objc_Selector_Ref 7 +/* The output reference is to a Objective-C class ref. */ +#define LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref 8 + #ifdef __cplusplus extern "C" { #endif /* !defined(__cplusplus) */ @@ -170,6 +181,10 @@ int LLVMSetDisasmOptions(LLVMDisasmConte #define LLVMDisassembler_Option_PrintImmHex 2 /* The option use the other assembler printer variant */ #define LLVMDisassembler_Option_AsmPrinterVariant 4 +/* The option to set comment on instructions */ +#define LLVMDisassembler_Option_SetInstrComments 8 + /* The option to print latency information alongside instructions */ +#define LLVMDisassembler_Option_PrintLatency 16 /** * Dispose of a disassembler context. Modified: stable/10/contrib/llvm/include/llvm-c/ExecutionEngine.h ============================================================================== --- stable/10/contrib/llvm/include/llvm-c/ExecutionEngine.h Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/llvm/include/llvm-c/ExecutionEngine.h Fri Mar 21 17:53:59 2014 (r263508) @@ -40,12 +40,14 @@ void LLVMLinkInInterpreter(void); typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef; typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef; +typedef struct LLVMOpaqueMCJITMemoryManager *LLVMMCJITMemoryManagerRef; struct LLVMMCJITCompilerOptions { unsigned OptLevel; LLVMCodeModel CodeModel; LLVMBool NoFramePointerElim; LLVMBool EnableFastISel; + LLVMMCJITMemoryManagerRef MCJMM; }; /*===-- Operations on generic values --------------------------------------===*/ @@ -167,12 +169,44 @@ void LLVMAddGlobalMapping(LLVMExecutionE void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global); +/*===-- Operations on memory managers -------------------------------------===*/ + +typedef uint8_t *(*LLVMMemoryManagerAllocateCodeSectionCallback)( + void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, + const char *SectionName); +typedef uint8_t *(*LLVMMemoryManagerAllocateDataSectionCallback)( + void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, + const char *SectionName, LLVMBool IsReadOnly); +typedef LLVMBool (*LLVMMemoryManagerFinalizeMemoryCallback)( + void *Opaque, char **ErrMsg); +typedef void (*LLVMMemoryManagerDestroyCallback)(void *Opaque); + +/** + * Create a simple custom MCJIT memory manager. This memory manager can + * intercept allocations in a module-oblivious way. This will return NULL + * if any of the passed functions are NULL. + * + * @param Opaque An opaque client object to pass back to the callbacks. + * @param AllocateCodeSection Allocate a block of memory for executable code. + * @param AllocateDataSection Allocate a block of memory for data. + * @param FinalizeMemory Set page permissions and flush cache. Return 0 on + * success, 1 on error. + */ +LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager( + void *Opaque, + LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection, + LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection, + LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory, + LLVMMemoryManagerDestroyCallback Destroy); + +void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM); + /** * @} */ #ifdef __cplusplus -} +} #endif /* defined(__cplusplus) */ #endif Copied: stable/10/contrib/llvm/include/llvm-c/IRReader.h (from r261991, head/contrib/llvm/include/llvm-c/IRReader.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/include/llvm-c/IRReader.h Fri Mar 21 17:53:59 2014 (r263508, copy of r261991, head/contrib/llvm/include/llvm-c/IRReader.h) @@ -0,0 +1,40 @@ +/*===-- llvm-c/IRReader.h - IR Reader C Interface -----------------*- C -*-===*\ +|* *| +|* The LLVM Compiler Infrastructure *| +|* *| +|* This file is distributed under the University of Illinois Open Source *| +|* License. See LICENSE.TXT for details. *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file defines the C interface to the IR Reader. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_C_IRREADER_H +#define LLVM_C_IRREADER_H + +#include "llvm-c/Core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Read LLVM IR from a memory buffer and convert it into an in-memory Module + * object. Returns 0 on success. + * Optionally returns a human-readable description of any errors that + * occured during parsing IR. OutMessage must be disposed with + * LLVMDisposeMessage. + * + * @see llvm::ParseIR() + */ +LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef, + LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, + char **OutMessage); + +#ifdef __cplusplus +} +#endif + +#endif Modified: stable/10/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h ============================================================================== --- stable/10/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h Fri Mar 21 17:53:59 2014 (r263508) @@ -4,7 +4,7 @@ // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -// +// //===----------------------------------------------------------------------===// // // This header provides a C API to use the LLVM link time optimization @@ -46,7 +46,7 @@ extern "C" { // Added C-specific error codes LLVM_LTO_NULL_OBJECT } llvm_lto_status_t; - + /// This provides C interface to initialize link time optimizer. This allows /// linker to use dlopen() interface to dynamically load LinkTimeOptimizer. /// extern "C" helps, because dlopen() interface uses name to find the symbol. Modified: stable/10/contrib/llvm/include/llvm-c/Object.h ============================================================================== --- stable/10/contrib/llvm/include/llvm-c/Object.h Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/llvm/include/llvm-c/Object.h Fri Mar 21 17:53:59 2014 (r263508) @@ -100,4 +100,3 @@ const char *LLVMGetRelocationValueString #endif /* defined(__cplusplus) */ #endif - Copied: stable/10/contrib/llvm/include/llvm-c/Support.h (from r261991, head/contrib/llvm/include/llvm-c/Support.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/include/llvm-c/Support.h Fri Mar 21 17:53:59 2014 (r263508, copy of r261991, head/contrib/llvm/include/llvm-c/Support.h) @@ -0,0 +1,35 @@ +/*===-- llvm-c/Support.h - Support C Interface --------------------*- C -*-===*\ +|* *| +|* The LLVM Compiler Infrastructure *| +|* *| +|* This file is distributed under the University of Illinois Open Source *| +|* License. See LICENSE.TXT for details. *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file defines the C interface to the LLVM support library. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_C_SUPPORT_H +#define LLVM_C_SUPPORT_H + +#include "llvm-c/Core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function permanently loads the dynamic library at the given path. + * It is safe to call this function multiple times for the same library. + * + * @see sys::DynamicLibrary::LoadLibraryPermanently() + */ +LLVMBool LLVMLoadLibraryPermanently(const char* Filename); + +#ifdef __cplusplus +} +#endif + +#endif Modified: stable/10/contrib/llvm/include/llvm-c/Target.h ============================================================================== --- stable/10/contrib/llvm/include/llvm-c/Target.h Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/llvm/include/llvm-c/Target.h Fri Mar 21 17:53:59 2014 (r263508) @@ -22,6 +22,10 @@ #include "llvm-c/Core.h" #include "llvm/Config/llvm-config.h" +#if defined(_MSC_VER) && !defined(inline) +#define inline __inline +#endif + #ifdef __cplusplus extern "C" { #endif @@ -37,14 +41,13 @@ enum LLVMByteOrdering { LLVMBigEndian, L typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef; typedef struct LLVMOpaqueTargetLibraryInfotData *LLVMTargetLibraryInfoRef; -typedef struct LLVMStructLayout *LLVMStructLayoutRef; /* Declare all of the target-initialization functions that are available. */ #define LLVM_TARGET(TargetName) \ void LLVMInitialize##TargetName##TargetInfo(void); #include "llvm/Config/Targets.def" #undef LLVM_TARGET /* Explicit undef to make SWIG happier */ - + #define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##Target(void); #include "llvm/Config/Targets.def" #undef LLVM_TARGET /* Explicit undef to make SWIG happier */ @@ -53,7 +56,7 @@ typedef struct LLVMStructLayout *LLVMStr void LLVMInitialize##TargetName##TargetMC(void); #include "llvm/Config/Targets.def" #undef LLVM_TARGET /* Explicit undef to make SWIG happier */ - + /* Declare all of the available assembly printer initialization functions. */ #define LLVM_ASM_PRINTER(TargetName) \ void LLVMInitialize##TargetName##AsmPrinter(void); @@ -71,7 +74,7 @@ typedef struct LLVMStructLayout *LLVMStr void LLVMInitialize##TargetName##Disassembler(void); #include "llvm/Config/Disassemblers.def" #undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */ - + /** LLVMInitializeAllTargetInfos - The main program should call this function if it wants access to all available targets that LLVM is configured to support. */ @@ -98,7 +101,7 @@ static inline void LLVMInitializeAllTarg #include "llvm/Config/Targets.def" #undef LLVM_TARGET /* Explicit undef to make SWIG happier */ } - + /** LLVMInitializeAllAsmPrinters - The main program should call this function if it wants all asm printers that LLVM is configured to support, to make them available via the TargetRegistry. */ @@ -107,7 +110,7 @@ static inline void LLVMInitializeAllAsmP #include "llvm/Config/AsmPrinters.def" #undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */ } - + /** LLVMInitializeAllAsmParsers - The main program should call this function if it wants all asm parsers that LLVM is configured to support, to make them available via the TargetRegistry. */ @@ -116,7 +119,7 @@ static inline void LLVMInitializeAllAsmP #include "llvm/Config/AsmParsers.def" #undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */ } - + /** LLVMInitializeAllDisassemblers - The main program should call this function if it wants all disassemblers that LLVM is configured to support, to make them available via the TargetRegistry. */ @@ -126,9 +129,9 @@ static inline void LLVMInitializeAllDisa #include "llvm/Config/Disassemblers.def" #undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */ } - + /** LLVMInitializeNativeTarget - The main program should call this function to - initialize the native target corresponding to the host. This is useful + initialize the native target corresponding to the host. This is useful for JIT applications to ensure that the target gets linked in correctly. */ static inline LLVMBool LLVMInitializeNativeTarget(void) { /* If we have a native target, initialize it to ensure it is linked in. */ @@ -140,7 +143,43 @@ static inline LLVMBool LLVMInitializeNat #else return 1; #endif -} +} + +/** LLVMInitializeNativeTargetAsmParser - The main program should call this + function to initialize the parser for the native target corresponding to the + host. */ +static inline LLVMBool LLVMInitializeNativeAsmParser(void) { +#ifdef LLVM_NATIVE_ASMPARSER + LLVM_NATIVE_ASMPARSER(); + return 0; +#else + return 1; +#endif +} + +/** LLVMInitializeNativeTargetAsmPrinter - The main program should call this + function to initialize the printer for the native target corresponding to + the host. */ +static inline LLVMBool LLVMInitializeNativeAsmPrinter(void) { +#ifdef LLVM_NATIVE_ASMPRINTER + LLVM_NATIVE_ASMPRINTER(); + return 0; +#else + return 1; +#endif +} + +/** LLVMInitializeNativeTargetDisassembler - The main program should call this + function to initialize the disassembler for the native target corresponding + to the host. */ +static inline LLVMBool LLVMInitializeNativeDisassembler(void) { +#ifdef LLVM_NATIVE_DISASSEMBLER + LLVM_NATIVE_DISASSEMBLER(); + return 0; +#else + return 1; +#endif +} /*===-- Target Data -------------------------------------------------------===*/ @@ -151,83 +190,94 @@ LLVMTargetDataRef LLVMCreateTargetData(c /** Adds target data information to a pass manager. This does not take ownership of the target data. See the method llvm::PassManagerBase::add. */ -void LLVMAddTargetData(LLVMTargetDataRef, LLVMPassManagerRef); +void LLVMAddTargetData(LLVMTargetDataRef TD, LLVMPassManagerRef PM); /** Adds target library information to a pass manager. This does not take ownership of the target library info. See the method llvm::PassManagerBase::add. */ -void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef, LLVMPassManagerRef); +void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI, + LLVMPassManagerRef PM); /** Converts target data to a target layout string. The string must be disposed with LLVMDisposeMessage. See the constructor llvm::DataLayout::DataLayout. */ -char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef); +char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD); /** Returns the byte order of a target, either LLVMBigEndian or LLVMLittleEndian. See the method llvm::DataLayout::isLittleEndian. */ -enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef); +enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD); /** Returns the pointer size in bytes for a target. See the method llvm::DataLayout::getPointerSize. */ -unsigned LLVMPointerSize(LLVMTargetDataRef); +unsigned LLVMPointerSize(LLVMTargetDataRef TD); /** Returns the pointer size in bytes for a target for a specified address space. See the method llvm::DataLayout::getPointerSize. */ -unsigned LLVMPointerSizeForAS(LLVMTargetDataRef, unsigned AS); +unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS); + +/** Returns the integer type that is the same size as a pointer on a target. + See the method llvm::DataLayout::getIntPtrType. */ +LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD); + +/** Returns the integer type that is the same size as a pointer on a target. + This version allows the address space to be specified. + See the method llvm::DataLayout::getIntPtrType. */ +LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS); /** Returns the integer type that is the same size as a pointer on a target. See the method llvm::DataLayout::getIntPtrType. */ -LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef); +LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD); /** Returns the integer type that is the same size as a pointer on a target. This version allows the address space to be specified. See the method llvm::DataLayout::getIntPtrType. */ -LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef, unsigned AS); +LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD, + unsigned AS); /** Computes the size of a type in bytes for a target. See the method llvm::DataLayout::getTypeSizeInBits. */ -unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef, LLVMTypeRef); +unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the storage size of a type in bytes for a target. See the method llvm::DataLayout::getTypeStoreSize. */ -unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef, LLVMTypeRef); +unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the ABI size of a type in bytes for a target. See the method llvm::DataLayout::getTypeAllocSize. */ -unsigned long long LLVMABISizeOfType(LLVMTargetDataRef, LLVMTypeRef); +unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the ABI alignment of a type in bytes for a target. See the method llvm::DataLayout::getTypeABISize. */ -unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef); +unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the call frame alignment of a type in bytes for a target. See the method llvm::DataLayout::getTypeABISize. */ -unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef); +unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the preferred alignment of a type in bytes for a target. See the method llvm::DataLayout::getTypeABISize. */ -unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef); +unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the preferred alignment of a global variable in bytes for a target. See the method llvm::DataLayout::getPreferredAlignment. */ -unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef, +unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD, LLVMValueRef GlobalVar); /** Computes the structure element that contains the byte offset for a target. See the method llvm::StructLayout::getElementContainingOffset. */ -unsigned LLVMElementAtOffset(LLVMTargetDataRef, LLVMTypeRef StructTy, +unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy, unsigned long long Offset); /** Computes the byte offset of the indexed struct element for a target. See the method llvm::StructLayout::getElementContainingOffset. */ -unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef, LLVMTypeRef StructTy, - unsigned Element); +unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD, + LLVMTypeRef StructTy, unsigned Element); /** Deallocates a TargetData. See the destructor llvm::DataLayout::~DataLayout. */ -void LLVMDisposeTargetData(LLVMTargetDataRef); +void LLVMDisposeTargetData(LLVMTargetDataRef TD); /** * @} Modified: stable/10/contrib/llvm/include/llvm-c/TargetMachine.h ============================================================================== --- stable/10/contrib/llvm/include/llvm-c/TargetMachine.h Fri Mar 21 17:53:25 2014 (r263507) +++ stable/10/contrib/llvm/include/llvm-c/TargetMachine.h Fri Mar 21 17:53:59 2014 (r263508) @@ -57,11 +57,21 @@ typedef enum { } LLVMCodeGenFileType; /** Returns the first llvm::Target in the registered targets list. */ -LLVMTargetRef LLVMGetFirstTarget(); +LLVMTargetRef LLVMGetFirstTarget(void); /** Returns the next llvm::Target given a previous one (or null if there's none) */ LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T); /*===-- Target ------------------------------------------------------------===*/ +/** Finds the target corresponding to the given name and stores it in \p T. + Returns 0 on success. */ +LLVMTargetRef LLVMGetTargetFromName(const char *Name); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 21 19:08:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 90CAEB50; Fri, 21 Mar 2014 19:08:01 +0000 (UTC) Received: from frv154.fwdcdn.com (frv154.fwdcdn.com [212.42.77.154]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 452C63C4; Fri, 21 Mar 2014 19:08:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=p9pp6iiGLRjrKWdsEYF41OnZtxJpGl7DbEiQ3IH5rYc=; b=fuFLt5122u+WU0s+m4gmsXXGmlHyqW/6pgkJVp+lXDKuMqdtrmM54YLQg3BIB1+g6l4dbmqdlNkMkgPyQ4YParjUun0y3L5iYJUmzJWLo6ju5zqU86LyziY2fR5M94CbrPqCqxDURTZzgx7bpX7afyaGWumSh64jd4ppUZNKbL4=; Received: from [134.249.90.229] (helo=nonamehost.local) by frv154.fwdcdn.com with esmtpsa ID 1WR4nJ-0000tk-3k ; Fri, 21 Mar 2014 21:07:53 +0200 Date: Fri, 21 Mar 2014 21:07:52 +0200 From: Ivan Klymenko To: Dimitry Andric Subject: Re: svn commit: r263508 - in stable/10: . contrib/gcc contrib/llvm contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llv... Message-ID: <20140321210752.2b9098f6@nonamehost.local> In-Reply-To: <201403211754.s2LHs1Pk030364@svn.freebsd.org> References: <201403211754.s2LHs1Pk030364@svn.freebsd.org> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Authentication-Result: IP=134.249.90.229; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 19:08:01 -0000 =D0=92 Fri, 21 Mar 2014 17:54:01 +0000 (UTC) Dimitry Andric =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > Author: dim > Date: Fri Mar 21 17:53:59 2014 > New Revision: 263508 > URL: http://svnweb.freebsd.org/changeset/base/263508 >=20 > Log: > MFC 261991: > =20 > Upgrade our copy of llvm/clang to 3.4 release. This version > supports all of the features in the current working draft of the > upcoming C++ standard, provisionally named C++1y. > =20 http://svnweb.freebsd.org/base/stable/10/share/mk/bsd.sys.mk?limit_changes= =3D0&r1=3D263508&r2=3D263507&pathrev=3D263508 /usr/local/libexec/ccache/world/cc --sysroot=3D/usr/obj/usr/src/tmp -B/usr/= obj/usr/src/tmp/usr/bin -O2 -pipe -O3 -march=3Dcorei7-avx -fpic -fvisibili= ty=3Dhidden -DVISIBILITY_HIDDEN -std=3Dgnu99 -Qunused-arguments -fstack-pr= otector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -= Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-var= iable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality= -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wn= o-knr-promoted-parameter -c /usr/src/lib/libcompiler_rt/../../contrib/compi= ler-rt/lib/addvdi3.c -o addvdi3.o --- absvsi2.o --- error: unknown warning option '-Wno-unused-const-variable'; did you mean '-= Wno-unused-variable'? [-Werror,-Wunknown-warning-option] *** [absvsi2.o] Error code 1 make[4]: stopped in /usr/src/lib/libcompiler_rt --- addvdi3.o --- error: unknown warning option '-Wno-unused-const-variable'; did you mean '-= Wno-unused-variable'? [-Werror,-Wunknown-warning-option] --- absvdi2.o --- error: unknown warning option '-Wno-unused-const-variable'; did you mean '-= Wno-unused-variable'? [-Werror,-Wunknown-warning-option] --- addvdi3.o --- *** [addvdi3.o] Error code 1 make[4]: stopped in /usr/src/lib/libcompiler_rt --- absvdi2.o --- *** [absvdi2.o] Error code 1 make[4]: stopped in /usr/src/lib/libcompiler_rt --- absvti2.o --- error: unknown warning option '-Wno-unused-const-variable'; did you mean '-= Wno-unused-variable'? [-Werror,-Wunknown-warning-option] *** [absvti2.o] Error code 1 make[4]: stopped in /usr/src/lib/libcompiler_rt 4 errors make[4]: stopped in /usr/src/lib/libcompiler_rt A failure has been detected in another branch of the parallel make make[3]: stopped in /usr/src *** [libraries] Error code 2 make[2]: stopped in /usr/src 1 error make[2]: stopped in /usr/src *** [_libraries] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildworld] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 21 19:17:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A8EDF12D; Fri, 21 Mar 2014 19:17:15 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6281F69E; Fri, 21 Mar 2014 19:17:15 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::d046:1f4f:8cfd:8ab2] (unknown [IPv6:2001:7b8:3a7:0:d046:1f4f:8cfd:8ab2]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E548F5C45; Fri, 21 Mar 2014 20:17:10 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_26184AD4-5F6C-44C4-A97E-A5536FB48E6F"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263508 - in stable/10: . contrib/gcc contrib/llvm contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llv... From: Dimitry Andric In-Reply-To: <20140321210752.2b9098f6@nonamehost.local> Date: Fri, 21 Mar 2014 20:17:03 +0100 Message-Id: <0ACA0301-B69A-45C1-A752-AC23DAA1AC83@FreeBSD.org> References: <201403211754.s2LHs1Pk030364@svn.freebsd.org> <20140321210752.2b9098f6@nonamehost.local> To: Ivan Klymenko X-Mailer: Apple Mail (2.1874) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 19:17:15 -0000 --Apple-Mail=_26184AD4-5F6C-44C4-A97E-A5536FB48E6F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 21 Mar 2014, at 20:07, Ivan Klymenko wrote: > =D0=92 Fri, 21 Mar 2014 17:54:01 +0000 (UTC) > Dimitry Andric =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 >> Author: dim >> Date: Fri Mar 21 17:53:59 2014 >> New Revision: 263508 >> URL: http://svnweb.freebsd.org/changeset/base/263508 >>=20 >> Log: >> MFC 261991: >>=20 >> Upgrade our copy of llvm/clang to 3.4 release. This version >> supports all of the features in the current working draft of the >> upcoming C++ standard, provisionally named C++1y. >>=20 >=20 > = http://svnweb.freebsd.org/base/stable/10/share/mk/bsd.sys.mk?limit_changes= =3D0&r1=3D263508&r2=3D263507&pathrev=3D263508 >=20 > /usr/local/libexec/ccache/world/cc --sysroot=3D/usr/obj/usr/src/tmp = -B/usr/obj/usr/src/tmp/usr/bin -O2 -pipe -O3 -march=3Dcorei7-avx -fpic = -fvisibility=3Dhidden -DVISIBILITY_HIDDEN -std=3Dgnu99 = -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall = -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body = -Wno-string-plus-int -Wno-unused-const-variable = -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality = -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum = -Wno-knr-promoted-parameter -c = /usr/src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/addvdi3.c -o = addvdi3.o > --- absvsi2.o --- > error: unknown warning option '-Wno-unused-const-variable'; did you = mean '-Wno-unused-variable'? [-Werror,-Wunknown-warning-option] > *** [absvsi2.o] Error code 1 Unfortunately ccache does not work properly for buildworld. At least, not when you are upgrading the compiler itself. In this case, it seems to be invoking the wrong compiler, e.g. running cc from /usr/bin instead of /usr/obj/usr/src/tmp/usr/bin. Please disable ccache, and try again. -Dimitry --Apple-Mail=_26184AD4-5F6C-44C4-A97E-A5536FB48E6F 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----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlMskDUACgkQsF6jCi4glqMqUgCeLg/j2eXFXKSYwW6KbdqD5f6G LcwAoPemKxARWVXgk33XXGjoj/XFHNk+ =hh4P -----END PGP SIGNATURE----- --Apple-Mail=_26184AD4-5F6C-44C4-A97E-A5536FB48E6F-- From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 21 20:07:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2A3B4D69 for ; Fri, 21 Mar 2014 20:07:34 +0000 (UTC) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A0FCCC43 for ; Fri, 21 Mar 2014 20:07:33 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id e16so2038157lan.16 for ; Fri, 21 Mar 2014 13:07:31 -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=u07PXG7j5uYNhwJ1GRRkLle6AnxH4oGoYi8uHwdpVVY=; b=JiNQp37IAe9ANXb+u3gpTGbxQH8iPT3iO4f5iHJcn0tG5agefd7z59rndhYZjS14nw wFTKiecSZud2stwAE5Xf+WhWganzXaCEWZmSXqfdzwO/yvSTa8SHjfg9u9ODe2tB7ZX4 r6W/S6oh3w/S9OFTufFSjkEw6Gc8rHu/+4mAO02Sw3Ut1t7oJe56QtdNLz61EuQrQyx7 hNoH5Xt9PYQvjmiay2Av5Cog3dl0UziT/0UP4MgifhcALv9yVqyNNKWm/iEPmXaVeVCl AoAg+EdUPNCIVmOHkctJ+3gYZhFpqD+lBOVVCK9+w58gJ+oG6UK1oWFr1Wf2qwQowS5y TrTQ== X-Gm-Message-State: ALoCoQli5oerbBtuSzPD56VT6vJUXWoVttjQG0dVbucuXtEMkN/pNgDbw/CmpdxzS4rbvgLcUOq+ X-Received: by 10.152.209.70 with SMTP id mk6mr35555637lac.13.1395432451497; Fri, 21 Mar 2014 13:07:31 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id a2sm3980092lbz.25.2014.03.21.13.07.30 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 13:07:30 -0700 (PDT) Message-ID: <532C9C02.5010409@freebsd.org> Date: Sat, 22 Mar 2014 00:07:30 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r263478 - in stable/10: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat References: <201403211515.s2LFFVUb064861@svn.freebsd.org> In-Reply-To: <201403211515.s2LFFVUb064861@svn.freebsd.org> X-Enigmail-Version: 1.7a1pre Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 20:07:34 -0000 On 21.03.2014 19:15, Gleb Smirnoff wrote: > - Remove rt_metrics_lite and simply put its members into rtentry. > - Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This > removes another cache trashing ++ from packet forwarding path. > - Create zini/fini methods for the rtentry UMA zone. Via initialize > mutex and counter in them. > - Fix reporting of rmx_pksent to routing socket. > - Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode. 'make world' on i386 recent stable-10: /usr/src/usr.bin/netstat/route.c:333:7: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] kread_counter((u_long )rt->rt_pksent)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/src/usr.bin/netstat/route.c:871:7: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] kread_counter((u_long )rt->rt_pksent)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. *** Error code 1 Stop. -- http://ache.vniz.net/ From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 21 20:27:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 584EA895 for ; Fri, 21 Mar 2014 20:27:28 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CEC30E07 for ; Fri, 21 Mar 2014 20:27:27 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id p9so1994599lbv.24 for ; Fri, 21 Mar 2014 13:27:25 -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=RT0udrIkVGfLCY3embvPIWePYNOUFNRk2ZXWm7sX2NA=; b=edf6XAlzEbPRwVx1qxeNDXV68sUgBhJ8UZbGGZkCbD65DaBaIEdLJpdGRMeRapbR9f r+2nLhNNLyGP30p9TLSzpER786Ap7lkUUD5ILPv/sRbrWLpGS+QgOqWOO5uuHXXbEY1l 8+oCM/vtW34LNBOnz28v/4Jy059Ln/psd3r7pvRyUC6xB/mcUA5Q+3Wl+MsHrB8qs250 kOXHvJIPZwBUsToW6/d5YnTv2Eb4DArQu/zkHQ8ASBt0imwd6wpebCHxUd4nyr6hO+2C BYTxxtfRjW1m9+id0DFuB2jTqiXfUv1mrfsaYwK8HYfQEVCKX9037KV90jil3Is1tP6J g0XA== X-Gm-Message-State: ALoCoQnxP90VGS95jCFxBysN0iFbihLp28+6tWsqXzyJdLSFs/Nh3uRzqfEmX1XfCuzyidw/dLBL X-Received: by 10.152.246.43 with SMTP id xt11mr3159176lac.34.1395433645860; Fri, 21 Mar 2014 13:27:25 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id sx1sm5683681lac.1.2014.03.21.13.27.24 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 13:27:25 -0700 (PDT) Message-ID: <532CA0AD.2000608@freebsd.org> Date: Sat, 22 Mar 2014 00:27:25 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r263478 - in stable/10: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat References: <201403211515.s2LFFVUb064861@svn.freebsd.org> <532C9C02.5010409@freebsd.org> In-Reply-To: <532C9C02.5010409@freebsd.org> X-Enigmail-Version: 1.7a1pre Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 20:27:28 -0000 On 22.03.2014 0:07, Andrey Chernov wrote: > /usr/src/usr.bin/netstat/route.c:333:7: error: format specifies type > 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long > long') [-Werror,-Wformat] > kread_counter((u_long )rt->rt_pksent)); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The whole expression is len = snprintf(buffer, sizeof(buffer), "%lu", kread_counter((u_long )rt->rt_pksent)); You can't print uint64_t kread_counter() using %lu on i386. > /usr/src/usr.bin/netstat/route.c:871:7: error: format specifies type > 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long > long') [-Werror,-Wformat] > kread_counter((u_long )rt->rt_pksent)); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 2 errors generated. > *** Error code 1 > > Stop. -- http://ache.vniz.net/ From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 21 22:43:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3AE5E8F7; Fri, 21 Mar 2014 22:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2736CC5F; Fri, 21 Mar 2014 22:43: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 s2LMh1S0051189; Fri, 21 Mar 2014 22:43:01 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LMh0cG051186; Fri, 21 Mar 2014 22:43:00 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403212243.s2LMh0cG051186@svn.freebsd.org> From: Alan Somers Date: Fri, 21 Mar 2014 22:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263572 - stable/10/tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 22:43:01 -0000 Author: asomers Date: Fri Mar 21 22:43:00 2014 New Revision: 263572 URL: http://svnweb.freebsd.org/changeset/base/263572 Log: MFC r262868 Only use -lpthread for unix_seqpacket_test, not for all test programs. MFC r262894 kern/Makefile Set WARNS=5 for all files in this directory kern/unix_seqpacket_test.c Fix compiler warnings. Most were benign, but rcvbuf_oversized wasn't working as intended because I forgot to set the buffer sizes. Modified: stable/10/tests/sys/kern/Makefile stable/10/tests/sys/kern/unix_seqpacket_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/Makefile ============================================================================== --- stable/10/tests/sys/kern/Makefile Fri Mar 21 22:40:16 2014 (r263571) +++ stable/10/tests/sys/kern/Makefile Fri Mar 21 22:43:00 2014 (r263572) @@ -5,6 +5,8 @@ TESTSDIR= ${TESTSBASE}/sys/kern ATF_TESTS_C= unix_seqpacket_test TEST_METADATA.unix_seqpacket_test+= timeout="15" -LDADD+= -lpthread +LDADD.unix_seqpacket_test+= -lpthread + +WARNS?= 5 .include Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- stable/10/tests/sys/kern/unix_seqpacket_test.c Fri Mar 21 22:40:16 2014 (r263571) +++ stable/10/tests/sys/kern/unix_seqpacket_test.c Fri Mar 21 22:43:00 2014 (r263572) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #define MIN(x, y) ((x) < (y) ? (x) : (y)) #define MAX(x, y) ((x) > (y) ? (x) : (y)) -void +static void do_socketpair(int *sv) { int s; @@ -55,7 +55,7 @@ do_socketpair(int *sv) ATF_REQUIRE(sv[0] != sv[1]); } -void +static void do_socketpair_nonblocking(int *sv) { int s; @@ -73,7 +73,7 @@ do_socketpair_nonblocking(int *sv) * Returns a pair of sockets made the hard way: bind, listen, connect & accept * @return const char* The path to the socket */ -const char* +static const char* mk_pair_of_sockets(int *sv) { struct sockaddr_un sun; @@ -116,7 +116,7 @@ mk_pair_of_sockets(int *sv) static volatile sig_atomic_t got_sigpipe = 0; static void -shutdown_send_sigpipe_handler(int x) +shutdown_send_sigpipe_handler(int __unused x) { got_sigpipe = 1; } @@ -124,16 +124,16 @@ shutdown_send_sigpipe_handler(int x) /* * Parameterized test function bodies */ -void +static void test_eagain(size_t sndbufsize, size_t rcvbufsize) { int i; int sv[2]; const size_t totalsize = (sndbufsize + rcvbufsize) * 2; const size_t pktsize = MIN(sndbufsize, rcvbufsize) / 4; + const int numpkts = totalsize / pktsize; char sndbuf[pktsize]; - char recv_buf[pktsize]; - ssize_t ssize, rsize; + ssize_t ssize; /* setup the socket pair */ do_socketpair_nonblocking(sv); @@ -145,7 +145,7 @@ test_eagain(size_t sndbufsize, size_t rc bzero(sndbuf, pktsize); /* Send data until we get EAGAIN */ - for(i=0; i < totalsize / pktsize; i++) { + for(i=0; i < numpkts; i++) { ssize = send(sv[0], sndbuf, pktsize, MSG_EOR); if (ssize == -1) { if (errno == EAGAIN) @@ -159,11 +159,11 @@ test_eagain(size_t sndbufsize, size_t rc atf_tc_fail("Never got EAGAIN"); } -void +static void test_sendrecv_symmetric_buffers(size_t bufsize, int blocking) { int s; int sv[2]; - const size_t pktsize = bufsize / 2; + const ssize_t pktsize = bufsize / 2; char sndbuf[pktsize]; char recv_buf[pktsize]; ssize_t ssize, rsize; @@ -201,12 +201,12 @@ test_sendrecv_symmetric_buffers(size_t b pktsize, rsize); } -void +static void test_pipe_simulator(size_t sndbufsize, size_t rcvbufsize) { - int s, num_sent, num_received; + int num_sent, num_received; int sv[2]; - const size_t pktsize = MIN(sndbufsize, rcvbufsize) / 4; + const ssize_t pktsize = MIN(sndbufsize, rcvbufsize) / 4; int numpkts; char sndbuf[pktsize]; char rcvbuf[pktsize]; @@ -331,12 +331,11 @@ test_pipe_reader(void* args) } -void +static void test_pipe(size_t sndbufsize, size_t rcvbufsize) { test_pipe_thread_data_t writer_data, reader_data; pthread_t writer, reader; - int num_sent, num_received; int sv[2]; const size_t pktsize = MIN(sndbufsize, rcvbufsize) / 4; int numpkts; @@ -605,12 +604,11 @@ ATF_TC_BODY(resize_connected_buffers, tc ATF_TC_WITHOUT_HEAD(send_recv); ATF_TC_BODY(send_recv, tc) { - int s; int sv[2]; const int bufsize = 64; const char *data = "data"; char recv_buf[bufsize]; - size_t datalen; + ssize_t datalen; ssize_t ssize, rsize; /* setup the socket pair */ @@ -642,12 +640,11 @@ ATF_TC_BODY(sendto_recvfrom, tc) { const char* path; struct sockaddr_storage from; - int s; int sv[2]; const int bufsize = 64; const char *data = "data"; char recv_buf[bufsize]; - size_t datalen; + ssize_t datalen; ssize_t ssize, rsize; socklen_t fromlen; @@ -690,12 +687,11 @@ ATF_TC_BODY(sendto_recvfrom, tc) ATF_TC_WITHOUT_HEAD(send_recv_with_connect); ATF_TC_BODY(send_recv_with_connect, tc) { - const char* path; int sv[2]; const int bufsize = 64; const char *data = "data"; char recv_buf[bufsize]; - size_t datalen; + ssize_t datalen; ssize_t ssize, rsize; mk_pair_of_sockets(sv); @@ -751,12 +747,11 @@ ATF_TC_BODY(shutdown_send_sigpipe, tc) ATF_TC_WITHOUT_HEAD(send_recv_nonblocking); ATF_TC_BODY(send_recv_nonblocking, tc) { - int s; int sv[2]; const int bufsize = 64; const char *data = "data"; char recv_buf[bufsize]; - size_t datalen; + ssize_t datalen; ssize_t ssize, rsize; /* setup the socket pair */ @@ -788,14 +783,12 @@ ATF_TC_BODY(send_recv_nonblocking, tc) ATF_TC_WITHOUT_HEAD(emsgsize); ATF_TC_BODY(emsgsize, tc) { - int s; int sv[2]; const size_t sndbufsize = 8192; const size_t rcvbufsize = 8192; const size_t pktsize = (sndbufsize + rcvbufsize) * 2; char sndbuf[pktsize]; - char recv_buf[pktsize]; - ssize_t ssize, rsize; + ssize_t ssize; /* setup the socket pair */ do_socketpair(sv); @@ -817,14 +810,12 @@ ATF_TC_BODY(emsgsize, tc) ATF_TC_WITHOUT_HEAD(emsgsize_nonblocking); ATF_TC_BODY(emsgsize_nonblocking, tc) { - int s; int sv[2]; const size_t sndbufsize = 8192; const size_t rcvbufsize = 8192; const size_t pktsize = (sndbufsize + rcvbufsize) * 2; char sndbuf[pktsize]; - char recv_buf[pktsize]; - ssize_t ssize, rsize; + ssize_t ssize; /* setup the socket pair */ do_socketpair_nonblocking(sv); @@ -877,25 +868,29 @@ ATF_TC_BODY(eagain_128k_128k, tc) ATF_TC_WITHOUT_HEAD(rcvbuf_oversized); ATF_TC_BODY(rcvbuf_oversized, tc) { - int s, i, j; + int i; int sv[2]; + const int pktsize = 1024; const size_t sndbufsize = 8192; const size_t rcvbufsize = 131072; - const size_t geom_mean_bufsize = 32768; - const int pktsize = 1024; + const size_t geometric_mean_bufsize = 32768; + const int numpkts = geometric_mean_bufsize / pktsize; char sndbuf[pktsize]; char recv_buf[pktsize]; - size_t datalen; ssize_t ssize, rsize; /* setup the socket pair */ do_socketpair_nonblocking(sv); + ATF_REQUIRE_EQ(0, setsockopt(sv[0], SOL_SOCKET, SO_SNDBUF, &sndbufsize, + sizeof(sndbufsize))); + ATF_REQUIRE_EQ(0, setsockopt(sv[1], SOL_SOCKET, SO_RCVBUF, &rcvbufsize, + sizeof(rcvbufsize))); /* * Send and receive packets that are collectively greater than the send * buffer, but less than the receive buffer */ - for (i=0; i < geom_mean_bufsize / pktsize; i++) { + for (i=0; i < numpkts; i++) { /* Fill the buffer */ memset(sndbuf, i, pktsize); From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 21 23:04:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC48B60C; Fri, 21 Mar 2014 23:04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A75CE02; Fri, 21 Mar 2014 23:04: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 s2LN4NpD059843; Fri, 21 Mar 2014 23:04:23 GMT (envelope-from edavis@svn.freebsd.org) Received: (from edavis@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LN4NZU059842; Fri, 21 Mar 2014 23:04:23 GMT (envelope-from edavis@svn.freebsd.org) Message-Id: <201403212304.s2LN4NZU059842@svn.freebsd.org> From: Eric Davis Date: Fri, 21 Mar 2014 23:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263581 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 23:04:23 -0000 Author: edavis Date: Fri Mar 21 23:04:23 2014 New Revision: 263581 URL: http://svnweb.freebsd.org/changeset/base/263581 Log: MFC 262999 Fixed MSI interrupt allocation and handling. Fixed a DMA mapping leak that occurs when defragmenting packet chains. Approved by: davidch (mentor) Modified: stable/10/sys/dev/bxe/bxe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Fri Mar 21 22:57:15 2014 (r263580) +++ stable/10/sys/dev/bxe/bxe.c Fri Mar 21 23:04:23 2014 (r263581) @@ -34,7 +34,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.77" +#define BXE_DRIVER_VERSION "1.78.78" #include "bxe.h" #include "ecore_sp.h" @@ -911,7 +911,7 @@ bxe_dma_map_addr(void *arg, bus_dma_segm dma->paddr = segs->ds_addr; dma->nseg = nseg; #if 0 - BLOGD(dma->sc, DBG_LOAD,, + BLOGD(dma->sc, DBG_LOAD, "DMA alloc '%s': vaddr=%p paddr=%p nseg=%d size=%lu\n", dma->msg, dma->vaddr, (void *)dma->paddr, dma->nseg, dma->size); @@ -5486,7 +5486,7 @@ bxe_tx_encap(struct bxe_fastpath *fp, st } /* make sure it fits in the packet window */ - if (__predict_false(nsegs > 12)) { + if (__predict_false(nsegs > BXE_MAX_SEGMENTS)) { /* * The mbuf may be to big for the controller to handle. If the frame * is a TSO frame we'll need to do an additional check. @@ -5501,8 +5501,9 @@ bxe_tx_encap(struct bxe_fastpath *fp, st fp->eth_q_stats.tx_window_violation_std++; } - /* lets try to defragment this mbuf */ + /* lets try to defragment this mbuf and remap it */ fp->eth_q_stats.mbuf_defrag_attempts++; + bus_dmamap_unload(fp->tx_mbuf_tag, tx_buf->m_map); m0 = m_defrag(*m_head, M_DONTWAIT); if (m0 == NULL) { @@ -5520,10 +5521,12 @@ bxe_tx_encap(struct bxe_fastpath *fp, st /* No sense in trying to defrag/copy chain, drop it. :( */ rc = error; } - - /* if the chain is still too long then drop it */ - if (__predict_false(nsegs > 12)) { - rc = ENODEV; + else { + /* if the chain is still too long then drop it */ + if (__predict_false(nsegs > BXE_MAX_SEGMENTS)) { + bus_dmamap_unload(fp->tx_mbuf_tag, tx_buf->m_map); + rc = ENODEV; + } } } } @@ -9397,13 +9400,13 @@ bxe_interrupt_alloc(struct bxe_softc *sc } if (((sc->devinfo.pcie_cap_flags & BXE_MSI_CAPABLE_FLAG) == 0) || - (msi_count < 2)) { + (msi_count < 1)) { sc->interrupt_mode = INTR_MODE_INTX; /* try INTx next */ break; } - /* ask for the necessary number of MSI vectors */ - num_requested = min((sc->num_queues + 1), msi_count); + /* ask for a single MSI vector */ + num_requested = 1; BLOGD(sc, DBG_LOAD, "Requesting %d MSI vectors\n", num_requested); @@ -9414,8 +9417,8 @@ bxe_interrupt_alloc(struct bxe_softc *sc break; } - if (num_allocated < 2) { /* possible? */ - BLOGE(sc, "MSI allocation less than 2!\n"); + if (num_allocated != 1) { /* possible? */ + BLOGE(sc, "MSI allocation is not 1!\n"); sc->interrupt_mode = INTR_MODE_INTX; /* try INTx next */ pci_release_msi(sc->dev); break; @@ -9426,38 +9429,26 @@ bxe_interrupt_alloc(struct bxe_softc *sc /* best effort so use the number of vectors allocated to us */ sc->intr_count = num_allocated; - sc->num_queues = num_allocated - 1; + sc->num_queues = num_allocated; rid = 1; /* initial resource identifier */ - /* allocate the MSI vectors */ - for (i = 0; i < num_allocated; i++) { - sc->intr[i].rid = (rid + i); - - if ((sc->intr[i].resource = - bus_alloc_resource_any(sc->dev, - SYS_RES_IRQ, - &sc->intr[i].rid, - RF_ACTIVE)) == NULL) { - BLOGE(sc, "Failed to map MSI[%d] (rid=%d)!\n", - i, (rid + i)); - - for (j = (i - 1); j >= 0; j--) { - bus_release_resource(sc->dev, - SYS_RES_IRQ, - sc->intr[j].rid, - sc->intr[j].resource); - } - - sc->intr_count = 0; - sc->num_queues = 0; - sc->interrupt_mode = INTR_MODE_INTX; /* try INTx next */ - pci_release_msi(sc->dev); - break; - } + sc->intr[0].rid = rid; - BLOGD(sc, DBG_LOAD, "Mapped MSI[%d] (rid=%d)\n", i, (rid + i)); + if ((sc->intr[0].resource = + bus_alloc_resource_any(sc->dev, + SYS_RES_IRQ, + &sc->intr[0].rid, + RF_ACTIVE)) == NULL) { + BLOGE(sc, "Failed to map MSI[0] (rid=%d)!\n", rid); + sc->intr_count = 0; + sc->num_queues = 0; + sc->interrupt_mode = INTR_MODE_INTX; /* try INTx next */ + pci_release_msi(sc->dev); + break; } + + BLOGD(sc, DBG_LOAD, "Mapped MSI[0] (rid=%d)\n", rid); } while (0); do { /* try allocating INTx vector resources */ @@ -9636,54 +9627,21 @@ bxe_interrupt_attach(struct bxe_softc *s fp->state = BXE_FP_STATE_IRQ; } } else if (sc->interrupt_mode == INTR_MODE_MSI) { - BLOGD(sc, DBG_LOAD, "Enabling slowpath MSI[0] vector.\n"); + BLOGD(sc, DBG_LOAD, "Enabling MSI[0] vector\n"); /* - * Setup the interrupt handler. Note that we pass the driver instance - * to the interrupt handler for the slowpath. + * Setup the interrupt handler. Note that we pass the + * driver instance to the interrupt handler which + * will handle both the slowpath and fastpath. */ if ((rc = bus_setup_intr(sc->dev, sc->intr[0].resource, (INTR_TYPE_NET | INTR_MPSAFE), - NULL, bxe_intr_sp, sc, + NULL, bxe_intr_legacy, sc, &sc->intr[0].tag)) != 0) { BLOGE(sc, "Failed to allocate MSI[0] vector (%d)\n", rc); goto bxe_interrupt_attach_exit; } - bus_describe_intr(sc->dev, sc->intr[0].resource, - sc->intr[0].tag, "sp"); - - /* bus_bind_intr(sc->dev, sc->intr[0].resource, 0); */ - - /* initialize the fastpath vectors (note the first was used for sp) */ - for (i = 0; i < sc->num_queues; i++) { - fp = &sc->fp[i]; - BLOGD(sc, DBG_LOAD, "Enabling MSI[%d] vector\n", (i + 1)); - - /* - * Setup the interrupt handler. Note that we pass the - * fastpath context to the interrupt handler in this - * case. - */ - if ((rc = bus_setup_intr(sc->dev, sc->intr[i + 1].resource, - (INTR_TYPE_NET | INTR_MPSAFE), - NULL, bxe_intr_fp, fp, - &sc->intr[i + 1].tag)) != 0) { - BLOGE(sc, "Failed to allocate MSI[%d] vector (%d)\n", - (i + 1), rc); - goto bxe_interrupt_attach_exit; - } - - bus_describe_intr(sc->dev, sc->intr[i + 1].resource, - sc->intr[i + 1].tag, "fp%02d", i); - - /* bind the fastpath instance to a cpu */ - if (sc->num_queues > 1) { - bus_bind_intr(sc->dev, sc->intr[i + 1].resource, i); - } - - fp->state = BXE_FP_STATE_IRQ; - } } else { /* (sc->interrupt_mode == INTR_MODE_INTX) */ BLOGD(sc, DBG_LOAD, "Enabling INTx interrupts\n"); From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 22 10:40:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D4574AF8; Sat, 22 Mar 2014 10:40: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A773ADE7; Sat, 22 Mar 2014 10:40: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 s2MAe496052041; Sat, 22 Mar 2014 10:40:04 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MAe4jE052039; Sat, 22 Mar 2014 10:40:04 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403221040.s2MAe4jE052039@svn.freebsd.org> From: Bryan Drewery Date: Sat, 22 Mar 2014 10:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263621 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 10:40:04 -0000 Author: bdrewery Date: Sat Mar 22 10:40:04 2014 New Revision: 263621 URL: http://svnweb.freebsd.org/changeset/base/263621 Log: MFC r263180: Fix ABI from /usr/local/etc/pkg.conf not being respected. Modified: stable/10/usr.sbin/pkg/config.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/config.c ============================================================================== --- stable/10/usr.sbin/pkg/config.c Sat Mar 22 10:26:09 2014 (r263620) +++ stable/10/usr.sbin/pkg/config.c Sat Mar 22 10:40:04 2014 (r263621) @@ -66,6 +66,7 @@ struct config_entry { char *value; STAILQ_HEAD(, config_value) *list; bool envset; + bool main_only; /* Only set in pkg.conf. */ }; static struct config_entry c[] = { @@ -76,6 +77,7 @@ static struct config_entry c[] = { NULL, NULL, false, + false, }, [ABI] = { PKG_CONFIG_STRING, @@ -84,6 +86,7 @@ static struct config_entry c[] = { NULL, NULL, false, + true, }, [MIRROR_TYPE] = { PKG_CONFIG_STRING, @@ -92,6 +95,7 @@ static struct config_entry c[] = { NULL, NULL, false, + false, }, [ASSUME_ALWAYS_YES] = { PKG_CONFIG_BOOL, @@ -100,6 +104,7 @@ static struct config_entry c[] = { NULL, NULL, false, + true, }, [SIGNATURE_TYPE] = { PKG_CONFIG_STRING, @@ -108,6 +113,7 @@ static struct config_entry c[] = { NULL, NULL, false, + false, }, [FINGERPRINTS] = { PKG_CONFIG_STRING, @@ -116,6 +122,7 @@ static struct config_entry c[] = { NULL, NULL, false, + false, }, [REPOS_DIR] = { PKG_CONFIG_LIST, @@ -124,6 +131,7 @@ static struct config_entry c[] = { NULL, NULL, false, + true, }, }; @@ -597,6 +605,9 @@ config_parse(ucl_object_t *obj, pkg_conf for (i = 0; i < CONFIG_SIZE; i++) { if (c[i].envset) continue; + /* Prevent overriding ABI, ASSUME_ALWAYS_YES, etc. */ + if (conftype != CONFFILE_PKG && c[i].main_only == true) + continue; switch (c[i].type) { case PKG_CONFIG_LIST: c[i].list = temp_config[i].list; From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 22 10:47:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 70CCEE84; Sat, 22 Mar 2014 10:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D800E77; Sat, 22 Mar 2014 10:47: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 s2MAloIF055889; Sat, 22 Mar 2014 10:47:50 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MAlo3L055888; Sat, 22 Mar 2014 10:47:50 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403221047.s2MAlo3L055888@svn.freebsd.org> From: Bryan Drewery Date: Sat, 22 Mar 2014 10:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263624 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 10:47:50 -0000 Author: bdrewery Date: Sat Mar 22 10:47:49 2014 New Revision: 263624 URL: http://svnweb.freebsd.org/changeset/base/263624 Log: MFC r263181: Fix ASSUME_ALWAYS_YES not being parsed properly from config after UCL conversion. Modified: stable/10/usr.sbin/pkg/config.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/config.c ============================================================================== --- stable/10/usr.sbin/pkg/config.c Sat Mar 22 10:44:42 2014 (r263623) +++ stable/10/usr.sbin/pkg/config.c Sat Mar 22 10:47:49 2014 (r263624) @@ -594,6 +594,10 @@ config_parse(ucl_object_t *obj, pkg_conf next); } break; + case PKG_CONFIG_BOOL: + temp_config[i].value = + strdup(ucl_object_toboolean(cur) ? "yes" : "no"); + break; default: /* Normal string value. */ temp_config[i].value = strdup(ucl_object_tostring(cur)); From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 22 11:43:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F1AC3CB; Sat, 22 Mar 2014 11:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C3CD73B6; Sat, 22 Mar 2014 11:43: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 s2MBhZc6080054; Sat, 22 Mar 2014 11:43:35 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MBhZ4r080052; Sat, 22 Mar 2014 11:43:35 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201403221143.s2MBhZ4r080052@svn.freebsd.org> From: Kirk McKusick Date: Sat, 22 Mar 2014 11:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263629 - stable/10/sbin/fsck_ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 11:43:36 -0000 Author: mckusick Date: Sat Mar 22 11:43:35 2014 New Revision: 263629 URL: http://svnweb.freebsd.org/changeset/base/263629 Log: MFC of 263062: Avoid segment fault when attempting to clean up cylinder group buffer cache. PR: 187221 Submitted by: Petr Lampa Obtained from: Petr Lampa MFC after: 1 week MFC of 262488: Arguments for malloc and calloc should be size_t, not int. Use proper bounds check when trying to free cached memory. Spotted by: Xin Li Tested by: Dmitry Sivachenko MFC after: 2 weeks Modified: stable/10/sbin/fsck_ffs/fsck.h stable/10/sbin/fsck_ffs/fsutil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/10/sbin/fsck_ffs/fsck.h Sat Mar 22 11:26:39 2014 (r263628) +++ stable/10/sbin/fsck_ffs/fsck.h Sat Mar 22 11:43:35 2014 (r263629) @@ -369,7 +369,7 @@ int flushentry(void); * to get space. */ static inline void* -Malloc(int size) +Malloc(size_t size) { void *retval; @@ -384,7 +384,7 @@ Malloc(int size) * to get space. */ static inline void* -Calloc(int cnt, int size) +Calloc(size_t cnt, size_t size) { void *retval; Modified: stable/10/sbin/fsck_ffs/fsutil.c ============================================================================== --- stable/10/sbin/fsck_ffs/fsutil.c Sat Mar 22 11:26:39 2014 (r263628) +++ stable/10/sbin/fsck_ffs/fsutil.c Sat Mar 22 11:43:35 2014 (r263629) @@ -225,7 +225,7 @@ cgget(int cg) struct cg *cgp; if (cgbufs == NULL) { - cgbufs = Calloc(sblock.fs_ncg, sizeof(struct bufarea)); + cgbufs = calloc(sblock.fs_ncg, sizeof(struct bufarea)); if (cgbufs == NULL) errx(EEXIT, "cannot allocate cylinder group buffers"); } @@ -254,6 +254,8 @@ flushentry(void) { struct bufarea *cgbp; + if (flushtries == sblock.fs_ncg || cgbufs == NULL) + return (0); cgbp = &cgbufs[flushtries++]; if (cgbp->b_un.b_cg == NULL) return (0); @@ -434,13 +436,15 @@ ckfini(int markclean) } if (numbufs != cnt) errx(EEXIT, "panic: lost %d buffers", numbufs - cnt); - for (cnt = 0; cnt < sblock.fs_ncg; cnt++) { - if (cgbufs[cnt].b_un.b_cg == NULL) - continue; - flush(fswritefd, &cgbufs[cnt]); - free(cgbufs[cnt].b_un.b_cg); + if (cgbufs != NULL) { + for (cnt = 0; cnt < sblock.fs_ncg; cnt++) { + if (cgbufs[cnt].b_un.b_cg == NULL) + continue; + flush(fswritefd, &cgbufs[cnt]); + free(cgbufs[cnt].b_un.b_cg); + } + free(cgbufs); } - free(cgbufs); pbp = pdirbp = (struct bufarea *)0; if (cursnapshot == 0 && sblock.fs_clean != markclean) { if ((sblock.fs_clean = markclean) != 0) { From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 22 17:16:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 78282440; Sat, 22 Mar 2014 17:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64947224; Sat, 22 Mar 2014 17:16: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 s2MHGfPI014131; Sat, 22 Mar 2014 17:16:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MHGfRd014130; Sat, 22 Mar 2014 17:16:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403221716.s2MHGfRd014130@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 22 Mar 2014 17:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263642 - stable/10/sys/dev/sound/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 17:16:41 -0000 Author: hselasky Date: Sat Mar 22 17:16:40 2014 New Revision: 263642 URL: http://svnweb.freebsd.org/changeset/base/263642 Log: MFC r263155: Add support for more sample rates to USB audio driver. PR: usb/171254 Modified: stable/10/sys/dev/sound/usb/uaudio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/10/sys/dev/sound/usb/uaudio.c Sat Mar 22 17:14:08 2014 (r263641) +++ stable/10/sys/dev/sound/usb/uaudio.c Sat Mar 22 17:16:40 2014 (r263642) @@ -182,7 +182,7 @@ struct uaudio_configure_msg { struct uaudio_softc *sc; }; -#define CHAN_MAX_ALT 20 +#define CHAN_MAX_ALT 24 struct uaudio_chan_alt { union uaudio_asf1d p_asf1d; @@ -1883,6 +1883,10 @@ uaudio_chan_fill_info_sub(struct uaudio_ /* This structure defines all the supported rates. */ static const uint32_t uaudio_rate_list[CHAN_MAX_ALT] = { + 384000, + 352800, + 192000, + 176400, 96000, 88200, 88000, From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 22 17:18:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BB846583; Sat, 22 Mar 2014 17:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A793122C; Sat, 22 Mar 2014 17:18: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 s2MHIjve014393; Sat, 22 Mar 2014 17:18:45 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MHIiP8014389; Sat, 22 Mar 2014 17:18:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403221718.s2MHIiP8014389@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 22 Mar 2014 17:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263643 - in stable/10/sys/dev: sound/usb usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 17:18:45 -0000 Author: hselasky Date: Sat Mar 22 17:18:44 2014 New Revision: 263643 URL: http://svnweb.freebsd.org/changeset/base/263643 Log: MFC r263159: Workaround for USB MIDI adapters which use non-supported values of wMaxPacketSize for BULK endpoints. Modified: stable/10/sys/dev/sound/usb/uaudio.c stable/10/sys/dev/usb/usb_core.h stable/10/sys/dev/usb/usb_transfer.c stable/10/sys/dev/usb/usbdi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/10/sys/dev/sound/usb/uaudio.c Sat Mar 22 17:16:40 2014 (r263642) +++ stable/10/sys/dev/sound/usb/uaudio.c Sat Mar 22 17:18:44 2014 (r263643) @@ -5674,6 +5674,25 @@ umidi_probe(device_t dev) DPRINTF("error=%s\n", usbd_errstr(error)); goto detach; } + + /* + * Some USB MIDI device makers couldn't resist using + * wMaxPacketSize = 4 for RX and TX BULK endpoints, although + * that size is an unsupported value for FULL speed BULK + * endpoints. The same applies to some HIGH speed MIDI devices + * which are using a wMaxPacketSize different from 512 bytes. + * + * Refer to section 5.8.3 in USB 2.0 PDF: Cite: "All Host + * Controllers are required to have support for 8-, 16-, 32-, + * and 64-byte maximum packet sizes for full-speed bulk + * endpoints and 512 bytes for high-speed bulk endpoints." + */ + if (usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER])) + chan->single_command = 1; + + if (chan->single_command != 0) + device_printf(dev, "Single command MIDI quirk enabled\n"); + if ((chan->max_cable > UMIDI_CABLES_MAX) || (chan->max_cable == 0)) { chan->max_cable = UMIDI_CABLES_MAX; Modified: stable/10/sys/dev/usb/usb_core.h ============================================================================== --- stable/10/sys/dev/usb/usb_core.h Sat Mar 22 17:16:40 2014 (r263642) +++ stable/10/sys/dev/usb/usb_core.h Sat Mar 22 17:18:44 2014 (r263643) @@ -114,6 +114,8 @@ struct usb_xfer_flags_int { uint8_t can_cancel_immed:1; /* set if USB transfer can be * cancelled immediately */ uint8_t doing_callback:1; /* set if executing the callback */ + uint8_t maxp_was_clamped:1; /* set if the max packet size + * was outside its allowed range */ }; /* Modified: stable/10/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/10/sys/dev/usb/usb_transfer.c Sat Mar 22 17:16:40 2014 (r263642) +++ stable/10/sys/dev/usb/usb_transfer.c Sat Mar 22 17:18:44 2014 (r263643) @@ -346,6 +346,7 @@ usbd_transfer_setup_sub(struct usb_setup usb_frcount_t n_frlengths; usb_frcount_t n_frbuffers; usb_frcount_t x; + uint16_t maxp_old; uint8_t type; uint8_t zmps; @@ -433,6 +434,11 @@ usbd_transfer_setup_sub(struct usb_setup if (xfer->max_packet_count > parm->hc_max_packet_count) { xfer->max_packet_count = parm->hc_max_packet_count; } + + /* store max packet size value before filtering */ + + maxp_old = xfer->max_packet_size; + /* filter "wMaxPacketSize" according to HC capabilities */ if ((xfer->max_packet_size > parm->hc_max_packet_size) || @@ -465,6 +471,13 @@ usbd_transfer_setup_sub(struct usb_setup } } + /* + * Check if the max packet size was outside its allowed range + * and clamped to a valid value: + */ + if (maxp_old != xfer->max_packet_size) + xfer->flags_int.maxp_was_clamped = 1; + /* compute "max_frame_size" */ usbd_update_max_frame_size(xfer); @@ -3432,3 +3445,13 @@ usbd_xfer_get_timestamp(struct usb_xfer { return (xfer->isoc_time_complete); } + +/* + * The following function returns non-zero if the max packet size + * field was clamped to a valid value. Else it returns zero. + */ +uint8_t +usbd_xfer_maxp_was_clamped(struct usb_xfer *xfer) +{ + return (xfer->flags_int.maxp_was_clamped); +} Modified: stable/10/sys/dev/usb/usbdi.h ============================================================================== --- stable/10/sys/dev/usb/usbdi.h Sat Mar 22 17:16:40 2014 (r263642) +++ stable/10/sys/dev/usb/usbdi.h Sat Mar 22 17:18:44 2014 (r263643) @@ -569,6 +569,7 @@ int usbd_xfer_is_stalled(struct usb_xfer void usbd_xfer_set_flag(struct usb_xfer *xfer, int flag); void usbd_xfer_clr_flag(struct usb_xfer *xfer, int flag); uint16_t usbd_xfer_get_timestamp(struct usb_xfer *xfer); +uint8_t usbd_xfer_maxp_was_clamped(struct usb_xfer *xfer); void usbd_copy_in(struct usb_page_cache *cache, usb_frlength_t offset, const void *ptr, usb_frlength_t len); From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 22 21:14:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EEF0DC35; Sat, 22 Mar 2014 21:14:39 +0000 (UTC) Received: from apnoea.adamw.org (apnoea.adamw.org [204.109.59.150]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2330888; Sat, 22 Mar 2014 21:14:39 +0000 (UTC) Received: by apnoea.adamw.org (Postfix, from userid 1002) id DEC261207A0; Sat, 22 Mar 2014 17:14:29 -0400 (EDT) Date: Sat, 22 Mar 2014 17:14:29 -0400 From: Adam Weinberger To: Andrey Chernov Subject: Re: svn commit: r263478 - in stable/10: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat Message-ID: <20140322211429.GA1584@apnoea.adamw.org> References: <201403211515.s2LFFVUb064861@svn.freebsd.org> <532C9C02.5010409@freebsd.org> <532CA0AD.2000608@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <532CA0AD.2000608@freebsd.org> X-Editor: Vim 7.3 http://www.vim.org X-Mailer: Mutt 1.5 http://www.mutt.org X-Adamw: ADAMW!!! X-URL: http://www.adamw.org User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 21:14:40 -0000 >> (2014/03/21 @ 1627 EST): Andrey Chernov said, in 1.1K: << > On 22.03.2014 0:07, Andrey Chernov wrote: > > /usr/src/usr.bin/netstat/route.c:333:7: error: format specifies type > > 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long > > long') [-Werror,-Wformat] > > kread_counter((u_long )rt->rt_pksent)); > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > The whole expression is > len = snprintf(buffer, sizeof(buffer), "%lu", > kread_counter((u_long )rt->rt_pksent)); > > You can't print uint64_t kread_counter() using %lu on i386. >> end of "Re: svn commit: r263478 - in stable/10: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat" from Andrey Chernov << Can somebody maybe merge r262819? 10-STABLE is unbuildable on i386 right now. # Adam -- Adam Weinberger adamw@adamw.org http://www.adamw.org From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 22 21:36:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4210C487; Sat, 22 Mar 2014 21:36:13 +0000 (UTC) Received: from apnoea.adamw.org (apnoea.adamw.org [204.109.59.150]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE784A07; Sat, 22 Mar 2014 21:36:12 +0000 (UTC) Received: by apnoea.adamw.org (Postfix, from userid 1002) id 2BBC2121759; Sat, 22 Mar 2014 17:36:12 -0400 (EDT) Date: Sat, 22 Mar 2014 17:36:11 -0400 From: Adam Weinberger To: Adam Weinberger Subject: Re: svn commit: r263478 - in stable/10: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat Message-ID: <20140322213611.GA28948@apnoea.adamw.org> References: <201403211515.s2LFFVUb064861@svn.freebsd.org> <532C9C02.5010409@freebsd.org> <532CA0AD.2000608@freebsd.org> <20140322211429.GA1584@apnoea.adamw.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140322211429.GA1584@apnoea.adamw.org> X-Editor: Vim 7.3 http://www.vim.org X-Mailer: Mutt 1.5 http://www.mutt.org X-Adamw: ADAMW!!! X-URL: http://www.adamw.org User-Agent: Mutt/1.5.23 (2014-03-12) Cc: src-committers@freebsd.org, Andrey Chernov , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 21:36:13 -0000 >> (2014/03/22 @ 1714 EST): Adam Weinberger said, in 1.2K: << > >> (2014/03/21 @ 1627 EST): Andrey Chernov said, in 1.1K: << > > On 22.03.2014 0:07, Andrey Chernov wrote: > > > /usr/src/usr.bin/netstat/route.c:333:7: error: format specifies type > > > 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long > > > long') [-Werror,-Wformat] > > > kread_counter((u_long )rt->rt_pksent)); > > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > The whole expression is > > len = snprintf(buffer, sizeof(buffer), "%lu", > > kread_counter((u_long )rt->rt_pksent)); > > > > You can't print uint64_t kread_counter() using %lu on i386. > >> end of "Re: svn commit: r263478 - in stable/10: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat" from Andrey Chernov << > > Can somebody maybe merge r262819? 10-STABLE is unbuildable on i386 right > now. > >> end of "Re: svn commit: r263478 - in stable/10: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat" from Adam Weinberger << Well, with that commit applied, it still dies later on. glebius, what's the deal man, this one looks like it's from March 12. ===> usr.sbin/route6d (all) clang -O2 -pipe -mtune=native -march=native -O2 -pipe -Qunused-arguments -DHAVE_POLL_H -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -c /usr/src/usr.sbin/route6d/route6d.c In file included from /usr/src/usr.sbin/route6d/route6d.c:68: In file included from /usr/obj/usr/src/tmp/usr/include/net/route.h:36: In file included from /usr/obj/usr/src/tmp/usr/include/sys/counter.h:35: /usr/obj/usr/src/tmp/usr/include/machine/counter.h:170:3: error: implicit declaration of function 'critical_enter' is invalid in C99 [-Werror,-Wimplicit-function-declaration] critical_enter(); ^ /usr/obj/usr/src/tmp/usr/include/machine/counter.h:172:3: error: implicit declaration of function 'critical_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration] critical_exit(); ^ /usr/obj/usr/src/tmp/usr/include/machine/counter.h:172:3: note: did you mean 'critical_enter'? /usr/obj/usr/src/tmp/usr/include/machine/counter.h:170:3: note: 'critical_enter' declared here critical_enter(); ^ 2 errors generated. *** Error code 1 Stop. make[4]: stopped in /usr/src/usr.sbin/route6d *** Error code 1 Stop. make[3]: stopped in /usr/src/usr.sbin *** Error code 1 Stop. make[2]: stopped in /usr/src *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src -- Adam Weinberger adamw@adamw.org http://www.adamw.org From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 23 02:29:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 86B10815; Sun, 23 Mar 2014 02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5879F194; Sun, 23 Mar 2014 02: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 s2N2TTli037925; Sun, 23 Mar 2014 02:29:29 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2N2TTAK037924; Sun, 23 Mar 2014 02:29:29 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403230229.s2N2TTAK037924@svn.freebsd.org> From: Glen Barber Date: Sun, 23 Mar 2014 02:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263655 - stable/10/contrib/subversion/subversion/svn X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 02:29:29 -0000 Author: gjb Date: Sun Mar 23 02:29:28 2014 New Revision: 263655 URL: http://svnweb.freebsd.org/changeset/base/263655 Log: MFC r263434: Update commit template to include 'Relnotes:' tag, to help re@ track release notes candidates. Sponsored by: The FreeBSD Foundation Modified: stable/10/contrib/subversion/subversion/svn/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/subversion/subversion/svn/util.c ============================================================================== --- stable/10/contrib/subversion/subversion/svn/util.c Sun Mar 23 01:17:02 2014 (r263654) +++ stable/10/contrib/subversion/subversion/svn/util.c Sun Mar 23 02:29:28 2014 (r263655) @@ -338,6 +338,7 @@ static const char *prefixes[] = { "Approved by:", "Obtained from:", "MFC after:", + "Relnotes:", "Security:", "Sponsored by:" }; @@ -408,6 +409,7 @@ svn_cl__get_log_message(const char **log svn_stringbuf_appendcstr(default_msg, "Approved by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Obtained from:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "MFC after:\t" APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "Relnotes:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Security:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Sponsored by:\t" #ifdef HAS_ORGANIZATION_NAME @@ -423,6 +425,7 @@ svn_cl__get_log_message(const char **log svn_stringbuf_appendcstr(default_msg, "> Approved by: If you needed approval for this commit." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Obtained from: If the change is from a third party." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Relnotes: Set to 'yes' for mention in release notes." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Security: Vulnerability reference (one per line) or description." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Sponsored by: If the change was sponsored by an organization." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Empty fields above will be automatically removed." APR_EOL_STR); From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 23 02:44:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2097CBDD; Sun, 23 Mar 2014 02:44:29 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E10392BC; Sun, 23 Mar 2014 02:44:28 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 1D37614F6B; Sun, 23 Mar 2014 02:44:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 1D37614F6B Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sat, 22 Mar 2014 22:44:25 -0400 From: Glen Barber To: Gleb Smirnoff Subject: Re: svn commit: r263335 - stable/10/usr.bin/netstat Message-ID: <20140323024425.GQ3452@glenbarber.us> References: <201403190936.s2J9aT6h055653@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JaBjgNvtdKe5H086" Content-Disposition: inline In-Reply-To: <201403190936.s2J9aT6h055653@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 02:44:29 -0000 --JaBjgNvtdKe5H086 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 19, 2014 at 09:36:29AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Mar 19 09:36:29 2014 > New Revision: 263335 > URL: http://svnweb.freebsd.org/changeset/base/263335 >=20 > Log: > Merge r259562,r259566,r259638,r259645,r260124 by melifaro: > =20 > Switch netstat -rn to use standard API for retrieving list > of routes instead of peeking inside in-kernel radix via kget. >=20 > Modified: > stable/10/usr.bin/netstat/if.c > stable/10/usr.bin/netstat/main.c > stable/10/usr.bin/netstat/mroute.c > stable/10/usr.bin/netstat/mroute6.c > stable/10/usr.bin/netstat/netgraph.c > stable/10/usr.bin/netstat/netstat.h > stable/10/usr.bin/netstat/route.c > Directory Properties: > stable/10/ (props changed) >=20 I think this breaks the build for all architectures except amd64. http://tinderbox.des.no/tinderbox-freebsd10-build-RELENG_10-i386-i386.full Glen --JaBjgNvtdKe5H086 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTLkqJAAoJELls3eqvi17QZqIQALJGme5HBR6+RywMcxseAgOC +6FzA5zd6hwkrgDzBdc9OhBPr5hILdXWyNoAfDwF+pY0RWTlGzHpdbeD3j/YAK3h oUJIyaMWz3HULKSEV2sNqut3OsVZGMS/k8sAt4qbtFHkItOLUR2Vwv9/CEw+XhwQ K0wiZdptFapog3xNVviAxl9EpewvqEnGTO1bJAQ+CwFy64ygxUyntJ6qauKFKoo5 1Yu5WaBRclNJF11Dv0X2KvgNrfIKpiWgY6HzbmqYfbuwqI9V9kJIv3lhzrbhW/3i z/IhzRZC47clmILcv56ZUBiiy0MsDkxTSqMY772pf+2S0bfnl2YgXrVIm4fQmiJ9 jxKqc/Y/ASCBiIzHiW2JG70MM6ScN8cGGDWQKmytPnDteGGnrrR8sa4jx13zU3TB wCVr/BfE6F0DNKEkVp6vfI/5zMV7PV94x65CSDSkCxrsPqCY++x9+j6hrpAB+aEJ ZW/JFB0dnObQjLgllC8Q28gnX4ee3HioOdFlTI3eOBXU6uWXB14jZIEbyJFtOvfp zfoaURb3jPtTBGfJi7iw8+RW8N8KwX69oxx60QWwIkGTqz4fSzcSbs9vIF0gu6Ea h1TbO7/maSf3MOdoLQjymd86y00DcVzqaj5Lzk+ME3gmnCEG0nq+Fo0Sfd7EGJsL PY4VbNay4N2CFyfThNO6 =lAAb -----END PGP SIGNATURE----- --JaBjgNvtdKe5H086-- From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 23 06:05:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 80305E1F; Sun, 23 Mar 2014 06:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6CC8E2D8; Sun, 23 Mar 2014 06:05: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 s2N65xUd026817; Sun, 23 Mar 2014 06:05:59 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2N65xSn026816; Sun, 23 Mar 2014 06:05:59 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403230605.s2N65xSn026816@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 23 Mar 2014 06:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263657 - stable/10/usr.bin/netstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 06:05:59 -0000 Author: glebius Date: Sun Mar 23 06:05:58 2014 New Revision: 263657 URL: http://svnweb.freebsd.org/changeset/base/263657 Log: Merge missed r262819, that fixes broken build. Modified: stable/10/usr.bin/netstat/route.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/netstat/route.c ============================================================================== --- stable/10/usr.bin/netstat/route.c Sun Mar 23 04:21:56 2014 (r263656) +++ stable/10/usr.bin/netstat/route.c Sun Mar 23 06:05:58 2014 (r263657) @@ -329,8 +329,8 @@ size_cols_rtentry(struct rtentry *rt) wid_flags = MAX(len, wid_flags); if (Wflag) { - len = snprintf(buffer, sizeof(buffer), "%lu", - kread_counter((u_long )rt->rt_pksent)); + len = snprintf(buffer, sizeof(buffer), "%ju", + (uintmax_t )kread_counter((u_long )rt->rt_pksent)); wid_pksent = MAX(len, wid_pksent); } if (rt->rt_ifp) { @@ -867,8 +867,8 @@ p_rtentry_kvm(struct rtentry *rt) snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); p_flags(rt->rt_flags, buffer); if (Wflag) { - printf("%*lu ", wid_pksent, - kread_counter((u_long )rt->rt_pksent)); + printf("%*ju ", wid_pksent, + (uintmax_t )kread_counter((u_long )rt->rt_pksent)); if (rt->rt_mtu != 0) printf("%*lu ", wid_mtu, rt->rt_mtu); From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 23 06:11:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9E34AF85; Sun, 23 Mar 2014 06:11:38 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6312C309; Sun, 23 Mar 2014 06:11:37 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s2N6BXvU034992 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 23 Mar 2014 10:11:33 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s2N6BWCv034991; Sun, 23 Mar 2014 10:11:32 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 23 Mar 2014 10:11:32 +0400 From: Gleb Smirnoff To: Adam Weinberger Subject: Re: svn commit: r263478 - in stable/10: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat Message-ID: <20140323061132.GY1499@FreeBSD.org> References: <201403211515.s2LFFVUb064861@svn.freebsd.org> <532C9C02.5010409@freebsd.org> <532CA0AD.2000608@freebsd.org> <20140322211429.GA1584@apnoea.adamw.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140322211429.GA1584@apnoea.adamw.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 06:11:38 -0000 On Sat, Mar 22, 2014 at 05:14:29PM -0400, Adam Weinberger wrote: A> >> (2014/03/21 @ 1627 EST): Andrey Chernov said, in 1.1K: << A> > On 22.03.2014 0:07, Andrey Chernov wrote: A> > > /usr/src/usr.bin/netstat/route.c:333:7: error: format specifies type A> > > 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long A> > > long') [-Werror,-Wformat] A> > > kread_counter((u_long )rt->rt_pksent)); A> > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A> > A> > The whole expression is A> > len = snprintf(buffer, sizeof(buffer), "%lu", A> > kread_counter((u_long )rt->rt_pksent)); A> > A> > You can't print uint64_t kread_counter() using %lu on i386. A> >> end of "Re: svn commit: r263478 - in stable/10: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat" from Andrey Chernov << A> A> Can somebody maybe merge r262819? 10-STABLE is unbuildable on i386 right A> now. I missed that one in the merge queue, sorry. It is merged now. I am investigating the counter.h breakage. -- Totus tuus, Glebius. From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 23 12:58:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EC601A31; Sun, 23 Mar 2014 12:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D89DD789; Sun, 23 Mar 2014 12:58: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 s2NCwmSc095408; Sun, 23 Mar 2014 12:58:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2NCwmdA095407; Sun, 23 Mar 2014 12:58:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403231258.s2NCwmdA095407@svn.freebsd.org> From: Christian Brueffer Date: Sun, 23 Mar 2014 12:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263661 - stable/10/etc/periodic/security X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 12:58:49 -0000 Author: brueffer Date: Sun Mar 23 12:58:48 2014 New Revision: 263661 URL: http://svnweb.freebsd.org/changeset/base/263661 Log: Further refine the auth fail regex to catch more auth failures and reduce false positives. The committed patch was provided by Christian Marg. PR: 91732 Submitted by: Daniel O'Connor Skye Poier Alan Amesbury Christian Marg Modified: stable/10/etc/periodic/security/800.loginfail Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/periodic/security/800.loginfail ============================================================================== --- stable/10/etc/periodic/security/800.loginfail Sun Mar 23 12:49:25 2014 (r263660) +++ stable/10/etc/periodic/security/800.loginfail Sun Mar 23 12:58:48 2014 (r263661) @@ -64,7 +64,7 @@ if check_yesno_period security_status_lo then echo "" echo "${host} login failures:" - n=$(catmsgs | egrep -ia "^$yesterday.*: .*(fail|invalid|bad|illegal)" | + n=$(catmsgs | egrep -ia "^$yesterday.*: .*\b(fail(ures?|ed)?|invalid|bad|illegal|auth.*error)\b" | tee /dev/stderr | wc -l) [ $n -gt 0 ] && rc=1 || rc=0 fi From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 23 14:18:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 76BD1737; Sun, 23 Mar 2014 14:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63897DB7; Sun, 23 Mar 2014 14:18: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 s2NEIfgx027942; Sun, 23 Mar 2014 14:18:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2NEIfVx027941; Sun, 23 Mar 2014 14:18:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403231418.s2NEIfVx027941@svn.freebsd.org> From: Dimitry Andric Date: Sun, 23 Mar 2014 14:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263665 - in stable: 10 7 8 9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 14:18:41 -0000 Author: dim Date: Sun Mar 23 14:18:40 2014 New Revision: 263665 URL: http://svnweb.freebsd.org/changeset/base/263665 Log: Turn off warnings for building aicasm. Various versions of yacc exist, which can result in different warnings-as-errors in this tool, but these are all completely harmless. This is a direct commit to stable/7, stable/8, stable/9 and stable/10, since this kernel build tool has already been removed in head. Modified: stable/10/Makefile.inc1 Changes in other areas also in this revision: Modified: stable/7/Makefile.inc1 stable/8/Makefile.inc1 stable/9/Makefile.inc1 Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Sun Mar 23 14:06:09 2014 (r263664) +++ stable/10/Makefile.inc1 Sun Mar 23 14:18:40 2014 (r263665) @@ -1023,15 +1023,16 @@ buildkernel: cd ${KRNLOBJDIR}/${_kernel}; \ PATH=${BPATH}:${PATH} \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD \ - -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \ + -DEARLY_BUILD -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) .for target in obj depend all cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ PATH=${BPATH}:${PATH} \ MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD ${target} + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \ + -DEARLY_BUILD ${target} .endfor .endif .if !defined(NO_KERNELDEPEND) From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 23 19:07:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 61A6D97C; Sun, 23 Mar 2014 19:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D4AFA7B; Sun, 23 Mar 2014 19:07: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 s2NJ7Fu0048167; Sun, 23 Mar 2014 19:07:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2NJ7FEP048166; Sun, 23 Mar 2014 19:07:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403231907.s2NJ7FEP048166@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 23 Mar 2014 19:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263668 - stable/10/usr.sbin/route6d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 19:07:15 -0000 Author: glebius Date: Sun Mar 23 19:07:14 2014 New Revision: 263668 URL: http://svnweb.freebsd.org/changeset/base/263668 Log: Merge r263658 from head: remove unneeded fake _KERNEL definition. Should fix broken builds. Modified: stable/10/usr.sbin/route6d/route6d.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/route6d/route6d.c ============================================================================== --- stable/10/usr.sbin/route6d/route6d.c Sun Mar 23 16:49:03 2014 (r263667) +++ stable/10/usr.sbin/route6d/route6d.c Sun Mar 23 19:07:14 2014 (r263668) @@ -64,9 +64,7 @@ static const char _rcsid[] = "$KAME: rou #include #include #include -#define _KERNEL 1 #include -#undef _KERNEL #include #include #include From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 23 19:48:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 23B6F8BF; Sun, 23 Mar 2014 19:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 10364E26; Sun, 23 Mar 2014 19:48:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2NJmUIA064695; Sun, 23 Mar 2014 19:48:30 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2NJmU76064694; Sun, 23 Mar 2014 19:48:30 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403231948.s2NJmU76064694@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 23 Mar 2014 19:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263670 - stable/10/sys/fs/msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 19:48:31 -0000 Author: pfg Date: Sun Mar 23 19:48:30 2014 New Revision: 263670 URL: http://svnweb.freebsd.org/changeset/base/263670 Log: MFC: r263441: msdosfs: minor format fix - spaces vs tab Modified: stable/10/sys/fs/msdosfs/msdosfs_fileno.c Modified: stable/10/sys/fs/msdosfs/msdosfs_fileno.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_fileno.c Sun Mar 23 19:22:13 2014 (r263669) +++ stable/10/sys/fs/msdosfs/msdosfs_fileno.c Sun Mar 23 19:48:30 2014 (r263670) @@ -75,7 +75,7 @@ msdosfs_fileno_init(mp) RB_INIT(&pmp->pm_filenos); pmp->pm_nfileno = FILENO_FIRST_DYN; - if (pmp->pm_HugeSectors > 0xffffffff / + if (pmp->pm_HugeSectors > 0xffffffff / (pmp->pm_BytesPerSec / sizeof(struct direntry)) + 1) pmp->pm_flags |= MSDOSFS_LARGEFS; } From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 24 10:19:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B1364384; Mon, 24 Mar 2014 10:19:07 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D509CA3; Mon, 24 Mar 2014 10:19:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2OAJ7Rp021228; Mon, 24 Mar 2014 10:19:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2OAJ79G021227; Mon, 24 Mar 2014 10:19:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403241019.s2OAJ79G021227@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 24 Mar 2014 10:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263680 - stable/10/sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 10:19:07 -0000 Author: glebius Date: Mon Mar 24 10:19:07 2014 New Revision: 263680 URL: http://svnweb.freebsd.org/changeset/base/263680 Log: Merge r263497: fix ipfw + VIMAGE sysctls. PR: kern/187665 Modified: stable/10/sys/netpfil/ipfw/ip_fw_pfil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_pfil.c Mon Mar 24 08:24:32 2014 (r263679) +++ stable/10/sys/netpfil/ipfw/ip_fw_pfil.c Mon Mar 24 10:19:07 2014 (r263680) @@ -536,30 +536,22 @@ ipfw_attach_hooks(int arg) int ipfw_chg_hook(SYSCTL_HANDLER_ARGS) { - int *enable; int newval; int error; int af; - if (arg1 == &VNET_NAME(fw_enable)) { - enable = &V_fw_enable; + if (arg1 == &V_fw_enable) af = AF_INET; - } #ifdef INET6 - else if (arg1 == &VNET_NAME(fw6_enable)) { - enable = &V_fw6_enable; + else if (arg1 == &V_fw6_enable) af = AF_INET6; - } #endif - else if (arg1 == &VNET_NAME(fwlink_enable)) { - enable = &V_fwlink_enable; + else if (arg1 == &V_fwlink_enable) af = AF_LINK; - } else return (EINVAL); - newval = *enable; - + newval = *(int *)arg1; /* Handle sysctl change */ error = sysctl_handle_int(oidp, &newval, 0, req); @@ -569,13 +561,13 @@ ipfw_chg_hook(SYSCTL_HANDLER_ARGS) /* Formalize new value */ newval = (newval) ? 1 : 0; - if (*enable == newval) + if (*(int *)arg1 == newval) return (0); error = ipfw_hook(newval, af); if (error) return (error); - *enable = newval; + *(int *)arg1 = newval; return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 24 12:40:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AF75CDE4; Mon, 24 Mar 2014 12:40: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE30E2E; Mon, 24 Mar 2014 12:40: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 s2OCergD082418; Mon, 24 Mar 2014 12:40:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2OCer5g082417; Mon, 24 Mar 2014 12:40:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403241240.s2OCer5g082417@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 24 Mar 2014 12:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263684 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 12:40:53 -0000 Author: kib Date: Mon Mar 24 12:40:53 2014 New Revision: 263684 URL: http://svnweb.freebsd.org/changeset/base/263684 Log: MFC r263471: Initialize vm_map_entry member wiring_thread on the map entry creation. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Mon Mar 24 11:54:00 2014 (r263683) +++ stable/10/sys/vm/vm_map.c Mon Mar 24 12:40:53 2014 (r263684) @@ -1275,6 +1275,7 @@ charged: new_entry->protection = prot; new_entry->max_protection = max; new_entry->wired_count = 0; + new_entry->wiring_thread = NULL; new_entry->read_ahead = VM_FAULT_READ_AHEAD_INIT; new_entry->next_read = OFF_TO_IDX(offset); From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 24 13:48:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B21C4494; Mon, 24 Mar 2014 13:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A6CF7F6; Mon, 24 Mar 2014 13:48: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 s2ODmDW1011869; Mon, 24 Mar 2014 13:48:13 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ODm48X011815; Mon, 24 Mar 2014 13:48:04 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403241348.s2ODm48X011815@svn.freebsd.org> From: Ed Maste Date: Mon, 24 Mar 2014 13:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263687 - in stable/10: contrib/file contrib/pf/pflogd contrib/tnftp contrib/vis lib/libedit share/man/man9 sys/compat/svr4 sys/dev/esp sys/dev/le sys/dev/usb/serial sys/mips/cavium sys... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 13:48:13 -0000 Author: emaste Date: Mon Mar 24 13:48:04 2014 New Revision: 263687 URL: http://svnweb.freebsd.org/changeset/base/263687 Log: MFC r263289: Update NetBSD Foundation copyrights to 2-clause BSD The NetBSD Foundation states "Third parties are encouraged to change the license on any files which have a 4-clause license contributed to the NetBSD Foundation to a 2-clause license." This change removes clauses 3 and 4 from copyright / license blocks that list The NetBSD Foundation as the only copyright holder. Sponsored by: The FreeBSD Foundation Modified: stable/10/contrib/file/mygetopt.h stable/10/contrib/pf/pflogd/pidfile.c stable/10/contrib/tnftp/COPYING stable/10/contrib/vis/extern.h stable/10/lib/libedit/chartype.h stable/10/share/man/man9/bus_dma.9 stable/10/share/man/man9/bus_space.9 stable/10/sys/compat/svr4/svr4_fuser.h stable/10/sys/compat/svr4/svr4_ipc.c stable/10/sys/compat/svr4/svr4_resource.c stable/10/sys/compat/svr4/svr4_resource.h stable/10/sys/dev/esp/ncr53c9xvar.h stable/10/sys/dev/le/am7990.c stable/10/sys/dev/le/am79900.c stable/10/sys/dev/le/am79900reg.h stable/10/sys/dev/le/am7990reg.h stable/10/sys/dev/le/if_le_isa.c stable/10/sys/dev/le/if_le_pci.c stable/10/sys/dev/le/lance.c stable/10/sys/dev/le/lancereg.h stable/10/sys/dev/usb/serial/ubsa.c stable/10/sys/dev/usb/serial/ubser.c stable/10/sys/dev/usb/serial/uchcom.c stable/10/sys/dev/usb/serial/ufoma.c stable/10/sys/dev/usb/serial/umodem.c stable/10/sys/dev/usb/serial/uplcom.c stable/10/sys/dev/usb/serial/usb_serial.c stable/10/sys/dev/usb/serial/usb_serial.h stable/10/sys/mips/cavium/octopci_bus_space.c stable/10/sys/mips/include/bus.h stable/10/sys/mips/mips/bus_space_fdt.c stable/10/sys/mips/mips/bus_space_generic.c stable/10/sys/mips/mips/gdb_machdep.c stable/10/sys/powerpc/aim/mmu_oea.c stable/10/sys/powerpc/aim/mmu_oea64.c stable/10/sys/powerpc/aim/moea64_native.c stable/10/sys/powerpc/include/bat.h stable/10/sys/powerpc/include/bus.h stable/10/sys/sys/bus_dma.h stable/10/sys/tools/miidevs2h.awk stable/10/sys/tools/pccarddevs2h.awk stable/10/sys/x86/include/bus.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/file/mygetopt.h ============================================================================== --- stable/10/contrib/file/mygetopt.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/contrib/file/mygetopt.h Mon Mar 24 13:48:04 2014 (r263687) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/contrib/pf/pflogd/pidfile.c ============================================================================== --- stable/10/contrib/pf/pflogd/pidfile.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/contrib/pf/pflogd/pidfile.c Mon Mar 24 13:48:04 2014 (r263687) @@ -17,13 +17,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/contrib/tnftp/COPYING ============================================================================== --- stable/10/contrib/tnftp/COPYING Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/contrib/tnftp/COPYING Mon Mar 24 13:48:04 2014 (r263687) @@ -14,13 +14,6 @@ are met: 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the NetBSD - Foundation, Inc. and its contributors. -4. Neither the name of The NetBSD Foundation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/contrib/vis/extern.h ============================================================================== --- stable/10/contrib/vis/extern.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/contrib/vis/extern.h Mon Mar 24 13:48:04 2014 (r263687) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/lib/libedit/chartype.h ============================================================================== --- stable/10/lib/libedit/chartype.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/lib/libedit/chartype.h Mon Mar 24 13:48:04 2014 (r263687) @@ -12,13 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/share/man/man9/bus_dma.9 ============================================================================== --- stable/10/share/man/man9/bus_dma.9 Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/share/man/man9/bus_dma.9 Mon Mar 24 13:48:04 2014 (r263687) @@ -37,13 +37,6 @@ .\" 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 acknowledgment: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/share/man/man9/bus_space.9 ============================================================================== --- stable/10/share/man/man9/bus_space.9 Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/share/man/man9/bus_space.9 Mon Mar 24 13:48:04 2014 (r263687) @@ -36,13 +36,6 @@ .\" 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 acknowledgment: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/compat/svr4/svr4_fuser.h ============================================================================== --- stable/10/sys/compat/svr4/svr4_fuser.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/compat/svr4/svr4_fuser.h Mon Mar 24 13:48:04 2014 (r263687) @@ -20,13 +20,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/compat/svr4/svr4_ipc.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_ipc.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/compat/svr4/svr4_ipc.c Mon Mar 24 13:48:04 2014 (r263687) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/compat/svr4/svr4_resource.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_resource.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/compat/svr4/svr4_resource.c Mon Mar 24 13:48:04 2014 (r263687) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/compat/svr4/svr4_resource.h ============================================================================== --- stable/10/sys/compat/svr4/svr4_resource.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/compat/svr4/svr4_resource.h Mon Mar 24 13:48:04 2014 (r263687) @@ -18,13 +18,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/esp/ncr53c9xvar.h ============================================================================== --- stable/10/sys/dev/esp/ncr53c9xvar.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/esp/ncr53c9xvar.h Mon Mar 24 13:48:04 2014 (r263687) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/le/am7990.c ============================================================================== --- stable/10/sys/dev/le/am7990.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/le/am7990.c Mon Mar 24 13:48:04 2014 (r263687) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/le/am79900.c ============================================================================== --- stable/10/sys/dev/le/am79900.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/le/am79900.c Mon Mar 24 13:48:04 2014 (r263687) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/le/am79900reg.h ============================================================================== --- stable/10/sys/dev/le/am79900reg.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/le/am79900reg.h Mon Mar 24 13:48:04 2014 (r263687) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/le/am7990reg.h ============================================================================== --- stable/10/sys/dev/le/am7990reg.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/le/am7990reg.h Mon Mar 24 13:48:04 2014 (r263687) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/le/if_le_isa.c ============================================================================== --- stable/10/sys/dev/le/if_le_isa.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/le/if_le_isa.c Mon Mar 24 13:48:04 2014 (r263687) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/le/if_le_pci.c ============================================================================== --- stable/10/sys/dev/le/if_le_pci.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/le/if_le_pci.c Mon Mar 24 13:48:04 2014 (r263687) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/le/lance.c ============================================================================== --- stable/10/sys/dev/le/lance.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/le/lance.c Mon Mar 24 13:48:04 2014 (r263687) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/le/lancereg.h ============================================================================== --- stable/10/sys/dev/le/lancereg.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/le/lancereg.h Mon Mar 24 13:48:04 2014 (r263687) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/usb/serial/ubsa.c ============================================================================== --- stable/10/sys/dev/usb/serial/ubsa.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/usb/serial/ubsa.c Mon Mar 24 13:48:04 2014 (r263687) @@ -41,13 +41,6 @@ __FBSDID("$FreeBSD$"); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/usb/serial/ubser.c ============================================================================== --- stable/10/sys/dev/usb/serial/ubser.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/usb/serial/ubser.c Mon Mar 24 13:48:04 2014 (r263687) @@ -48,13 +48,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uchcom.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/usb/serial/uchcom.c Mon Mar 24 13:48:04 2014 (r263687) @@ -41,13 +41,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/usb/serial/ufoma.c ============================================================================== --- stable/10/sys/dev/usb/serial/ufoma.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/usb/serial/ufoma.c Mon Mar 24 13:48:04 2014 (r263687) @@ -46,13 +46,6 @@ __FBSDID("$FreeBSD$"); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/10/sys/dev/usb/serial/umodem.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/usb/serial/umodem.c Mon Mar 24 13:48:04 2014 (r263687) @@ -45,13 +45,6 @@ __FBSDID("$FreeBSD$"); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uplcom.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/usb/serial/uplcom.c Mon Mar 24 13:48:04 2014 (r263687) @@ -44,13 +44,6 @@ __FBSDID("$FreeBSD$"); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/10/sys/dev/usb/serial/usb_serial.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/usb/serial/usb_serial.c Mon Mar 24 13:48:04 2014 (r263687) @@ -46,13 +46,6 @@ __FBSDID("$FreeBSD$"); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/dev/usb/serial/usb_serial.h ============================================================================== --- stable/10/sys/dev/usb/serial/usb_serial.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/dev/usb/serial/usb_serial.h Mon Mar 24 13:48:04 2014 (r263687) @@ -43,13 +43,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/mips/cavium/octopci_bus_space.c ============================================================================== --- stable/10/sys/mips/cavium/octopci_bus_space.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/mips/cavium/octopci_bus_space.c Mon Mar 24 13:48:04 2014 (r263687) @@ -17,13 +17,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/mips/include/bus.h ============================================================================== --- stable/10/sys/mips/include/bus.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/mips/include/bus.h Mon Mar 24 13:48:04 2014 (r263687) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/mips/mips/bus_space_fdt.c ============================================================================== --- stable/10/sys/mips/mips/bus_space_fdt.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/mips/mips/bus_space_fdt.c Mon Mar 24 13:48:04 2014 (r263687) @@ -17,13 +17,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/mips/mips/bus_space_generic.c ============================================================================== --- stable/10/sys/mips/mips/bus_space_generic.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/mips/mips/bus_space_generic.c Mon Mar 24 13:48:04 2014 (r263687) @@ -17,13 +17,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/mips/mips/gdb_machdep.c ============================================================================== --- stable/10/sys/mips/mips/gdb_machdep.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/mips/mips/gdb_machdep.c Mon Mar 24 13:48:04 2014 (r263687) @@ -41,13 +41,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/powerpc/aim/mmu_oea.c ============================================================================== --- stable/10/sys/powerpc/aim/mmu_oea.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/powerpc/aim/mmu_oea.c Mon Mar 24 13:48:04 2014 (r263687) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/10/sys/powerpc/aim/mmu_oea64.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/powerpc/aim/mmu_oea64.c Mon Mar 24 13:48:04 2014 (r263687) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/powerpc/aim/moea64_native.c ============================================================================== --- stable/10/sys/powerpc/aim/moea64_native.c Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/powerpc/aim/moea64_native.c Mon Mar 24 13:48:04 2014 (r263687) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/powerpc/include/bat.h ============================================================================== --- stable/10/sys/powerpc/include/bat.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/powerpc/include/bat.h Mon Mar 24 13:48:04 2014 (r263687) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/powerpc/include/bus.h ============================================================================== --- stable/10/sys/powerpc/include/bus.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/powerpc/include/bus.h Mon Mar 24 13:48:04 2014 (r263687) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/sys/bus_dma.h ============================================================================== --- stable/10/sys/sys/bus_dma.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/sys/bus_dma.h Mon Mar 24 13:48:04 2014 (r263687) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/tools/miidevs2h.awk ============================================================================== --- stable/10/sys/tools/miidevs2h.awk Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/tools/miidevs2h.awk Mon Mar 24 13:48:04 2014 (r263687) @@ -16,13 +16,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the NetBSD -# Foundation, Inc. and its contributors. -# 4. Neither the name of The NetBSD Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/tools/pccarddevs2h.awk ============================================================================== --- stable/10/sys/tools/pccarddevs2h.awk Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/tools/pccarddevs2h.awk Mon Mar 24 13:48:04 2014 (r263687) @@ -17,13 +17,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the NetBSD -# Foundation, Inc. and its contributors. -# 4. Neither the name of The NetBSD Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: stable/10/sys/x86/include/bus.h ============================================================================== --- stable/10/sys/x86/include/bus.h Mon Mar 24 13:13:52 2014 (r263686) +++ stable/10/sys/x86/include/bus.h Mon Mar 24 13:48:04 2014 (r263687) @@ -49,13 +49,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 11:41:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AE4DCDB4; Tue, 25 Mar 2014 11:41: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80D65E36; Tue, 25 Mar 2014 11:41: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 s2PBfAxi059047; Tue, 25 Mar 2014 11:41:10 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PBfA2I059046; Tue, 25 Mar 2014 11:41:10 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251141.s2PBfA2I059046@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 11:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263713 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 11:41:10 -0000 Author: trasz Date: Tue Mar 25 11:41:10 2014 New Revision: 263713 URL: http://svnweb.freebsd.org/changeset/base/263713 Log: MFC r261765: Improve error reporting. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Tue Mar 25 11:05:34 2014 (r263712) +++ stable/10/usr.sbin/ctld/kernel.c Tue Mar 25 11:41:10 2014 (r263713) @@ -678,8 +678,15 @@ kernel_listen(struct addrinfo *ai, bool req.data.listen.addr = ai->ai_addr; req.data.listen.addrlen = ai->ai_addrlen; - if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) - log_warn("error issuing CTL_ISCSI_LISTEN ioctl"); + if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { + log_err(1, "error issuing CTL_ISCSI ioctl"); + return; + } + + if (req.status != CTL_ISCSI_OK) { + log_errx(1, "error returned from CTL iSCSI listen: %s", + req.error_str); + } } int @@ -692,7 +699,13 @@ kernel_accept(void) req.type = CTL_ISCSI_ACCEPT; if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { - log_warn("error issuing CTL_ISCSI_LISTEN ioctl"); + log_warn("error issuing CTL_ISCSI ioctl"); + return (0); + } + + if (req.status != CTL_ISCSI_OK) { + log_warnx("error returned from CTL iSCSI accept: %s", + req.error_str); return (0); } @@ -712,13 +725,15 @@ kernel_send(struct pdu *pdu) req.data.send.data_segment_len = pdu->pdu_data_len; req.data.send.data_segment = pdu->pdu_data; - if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) + if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { log_err(1, "error issuing CTL_ISCSI ioctl; " "dropping connection"); + } - if (req.status != CTL_ISCSI_OK) + if (req.status != CTL_ISCSI_OK) { log_errx(1, "error returned from CTL iSCSI send: " "%s; dropping connection", req.error_str); + } } void @@ -738,13 +753,15 @@ kernel_receive(struct pdu *pdu) req.data.receive.data_segment_len = MAX_DATA_SEGMENT_LENGTH; req.data.receive.data_segment = pdu->pdu_data; - if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) + if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { log_err(1, "error issuing CTL_ISCSI ioctl; " "dropping connection"); + } - if (req.status != CTL_ISCSI_OK) + if (req.status != CTL_ISCSI_OK) { log_errx(1, "error returned from CTL iSCSI receive: " "%s; dropping connection", req.error_str); + } } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 11:43:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 564CF158; Tue, 25 Mar 2014 11:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42FD5EC1; Tue, 25 Mar 2014 11:43: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 s2PBhAgH059706; Tue, 25 Mar 2014 11:43:10 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PBhA1H059705; Tue, 25 Mar 2014 11:43:10 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251143.s2PBhA1H059705@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 11:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263714 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 11:43:10 -0000 Author: trasz Date: Tue Mar 25 11:43:09 2014 New Revision: 263714 URL: http://svnweb.freebsd.org/changeset/base/263714 Log: MFC r261766: Make ctld error out on invalid characters in ctl.conf. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/token.l Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/token.l ============================================================================== --- stable/10/usr.sbin/ctld/token.l Tue Mar 25 11:41:10 2014 (r263713) +++ stable/10/usr.sbin/ctld/token.l Tue Mar 25 11:43:09 2014 (r263714) @@ -82,4 +82,5 @@ timeout { return TIMEOUT; } #.*$ /* ignore comments */; \n { lineno++; } [ \t]+ /* ignore whitespace */; +. { yylval.str = strdup(yytext); return STR; } %% From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 11:45:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 94DDE29E; Tue, 25 Mar 2014 11:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 81B9AED5; Tue, 25 Mar 2014 11:45: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 s2PBj3OK060042; Tue, 25 Mar 2014 11:45:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PBj30T060041; Tue, 25 Mar 2014 11:45:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251145.s2PBj30T060041@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 11:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263715 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 11:45:03 -0000 Author: trasz Date: Tue Mar 25 11:45:03 2014 New Revision: 263715 URL: http://svnweb.freebsd.org/changeset/base/263715 Log: MFC r261767: Show proper configuration file line numbers in error messages. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Tue Mar 25 11:43:09 2014 (r263714) +++ stable/10/usr.sbin/ctld/parse.y Tue Mar 25 11:45:03 2014 (r263715) @@ -598,7 +598,7 @@ conf_new_from_file(const char *path) return (NULL); } check_perms(path); - lineno = 0; + lineno = 1; yyrestart(yyin); error = yyparse(); auth_group = NULL; From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 11:46:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 09A4B447; Tue, 25 Mar 2014 11:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E90AEF07; Tue, 25 Mar 2014 11:46: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 s2PBkkXm060269; Tue, 25 Mar 2014 11:46:46 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PBkkHp060268; Tue, 25 Mar 2014 11:46:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251146.s2PBkkHp060268@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 11:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263716 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 11:46:47 -0000 Author: trasz Date: Tue Mar 25 11:46:46 2014 New Revision: 263716 URL: http://svnweb.freebsd.org/changeset/base/263716 Log: MFC r261768: Make the debug messages during ctld(8) shutdown less confusing. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 11:45:03 2014 (r263715) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 11:46:46 2014 (r263716) @@ -1057,8 +1057,8 @@ conf_apply(struct conf *oldconf, struct if (newtarg == NULL) { TAILQ_FOREACH_SAFE(oldlun, &oldtarg->t_luns, l_next, tmplun) { - log_debugx("target %s not found in the " - "configuration file; removing its lun %d, " + log_debugx("target %s not found in new " + "configuration; removing its lun %d, " "backed by CTL lun %d", oldtarg->t_iqn, oldlun->l_lun, oldlun->l_ctl_lun); @@ -1084,7 +1084,7 @@ conf_apply(struct conf *oldconf, struct newlun = lun_find(newtarg, oldlun->l_lun); if (newlun == NULL) { log_debugx("lun %d, target %s, CTL lun %d " - "not found in the configuration file; " + "not found in new configuration; " "removing", oldlun->l_lun, oldtarg->t_iqn, oldlun->l_ctl_lun); error = kernel_lun_remove(oldlun); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 11:53:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 151F1711; Tue, 25 Mar 2014 11:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA001FC8; Tue, 25 Mar 2014 11:53: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 s2PBrlps063994; Tue, 25 Mar 2014 11:53:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PBrlso063993; Tue, 25 Mar 2014 11:53:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251153.s2PBrlso063993@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 11:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263717 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 11:53:48 -0000 Author: trasz Date: Tue Mar 25 11:53:47 2014 New Revision: 263717 URL: http://svnweb.freebsd.org/changeset/base/263717 Log: MFC r261749: Refactor. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 11:46:46 2014 (r263716) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 11:53:47 2014 (r263717) @@ -869,14 +869,74 @@ conf_print(struct conf *conf) } #endif +static int +conf_verify_lun(struct lun *lun) +{ + const struct lun *lun2; + + if (lun->l_backend == NULL) + lun_set_backend(lun, "block"); + if (strcmp(lun->l_backend, "block") == 0) { + if (lun->l_path == NULL) { + log_warnx("missing path for lun %d, target \"%s\"", + lun->l_lun, lun->l_target->t_iqn); + return (1); + } + } else if (strcmp(lun->l_backend, "ramdisk") == 0) { + if (lun->l_size == 0) { + log_warnx("missing size for ramdisk-backed lun %d, " + "target \"%s\"", lun->l_lun, lun->l_target->t_iqn); + return (1); + } + if (lun->l_path != NULL) { + log_warnx("path must not be specified " + "for ramdisk-backed lun %d, target \"%s\"", + lun->l_lun, lun->l_target->t_iqn); + return (1); + } + } + if (lun->l_lun < 0 || lun->l_lun > 255) { + log_warnx("invalid lun number for lun %d, target \"%s\"; " + "must be between 0 and 255", lun->l_lun, + lun->l_target->t_iqn); + return (1); + } +#if 1 /* Should we? */ + TAILQ_FOREACH(lun2, &lun->l_target->t_luns, l_next) { + if (lun == lun2) + continue; + if (lun->l_path != NULL && lun2->l_path != NULL && + strcmp(lun->l_path, lun2->l_path) == 0) + log_debugx("WARNING: duplicate path for lun %d, " + "target \"%s\"", lun->l_lun, lun->l_target->t_iqn); + } +#endif + if (lun->l_blocksize == 0) { + lun_set_blocksize(lun, DEFAULT_BLOCKSIZE); + } else if (lun->l_blocksize < 0) { + log_warnx("invalid blocksize for lun %d, target \"%s\"; " + "must be larger than 0", lun->l_lun, lun->l_target->t_iqn); + return (1); + } + if (lun->l_size != 0 && lun->l_size % lun->l_blocksize != 0) { + log_warnx("invalid size for lun %d, target \"%s\"; " + "must be multiple of blocksize", lun->l_lun, + lun->l_target->t_iqn); + return (1); + } + + return (0); +} + int conf_verify(struct conf *conf) { struct auth_group *ag; struct portal_group *pg; struct target *targ; - struct lun *lun, *lun2; + struct lun *lun; bool found_lun0; + int error; if (conf->conf_pidfile_path == NULL) conf->conf_pidfile_path = checked_strdup(DEFAULT_PIDFILE); @@ -895,65 +955,11 @@ conf_verify(struct conf *conf) } found_lun0 = false; TAILQ_FOREACH(lun, &targ->t_luns, l_next) { + error = conf_verify_lun(lun); + if (error != 0) + return (error); if (lun->l_lun == 0) found_lun0 = true; - if (lun->l_backend == NULL) - lun_set_backend(lun, "block"); - if (strcmp(lun->l_backend, "block") == 0 && - lun->l_path == NULL) { - log_warnx("missing path for lun %d, " - "target \"%s\"", lun->l_lun, targ->t_iqn); - return (1); - } - if (strcmp(lun->l_backend, "ramdisk") == 0) { - if (lun->l_size == 0) { - log_warnx("missing size for " - "ramdisk-backed lun %d, " - "target \"%s\"", - lun->l_lun, targ->t_iqn); - return (1); - } - if (lun->l_path != NULL) { - log_warnx("path must not be specified " - "for ramdisk-backed lun %d, " - "target \"%s\"", - lun->l_lun, targ->t_iqn); - return (1); - } - } - if (lun->l_lun < 0 || lun->l_lun > 255) { - log_warnx("invalid lun number for lun %d, " - "target \"%s\"; must be between 0 and 255", - lun->l_lun, targ->t_iqn); - return (1); - } -#if 1 /* Should we? */ - TAILQ_FOREACH(lun2, &targ->t_luns, l_next) { - if (lun == lun2) - continue; - if (lun->l_path != NULL && - lun2->l_path != NULL && - strcmp(lun->l_path, lun2->l_path) == 0) - log_debugx("WARNING: duplicate path " - "for lun %d, target \"%s\"", - lun->l_lun, targ->t_iqn); - } -#endif - if (lun->l_blocksize == 0) { - lun_set_blocksize(lun, DEFAULT_BLOCKSIZE); - } else if (lun->l_blocksize <= 0) { - log_warnx("invalid blocksize for lun %d, " - "target \"%s\"; must be larger than 0", - lun->l_lun, targ->t_iqn); - return (1); - } - if (lun->l_size != 0 && - lun->l_size % lun->l_blocksize != 0) { - log_warnx("invalid size for lun %d, target " - "\"%s\"; must be multiple of blocksize", - lun->l_lun, targ->t_iqn); - return (1); - } } if (!found_lun0) { log_warnx("mandatory LUN 0 not configured " From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 11:58:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E67C6885; Tue, 25 Mar 2014 11:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9074FEE; Tue, 25 Mar 2014 11:58: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 s2PBwOwf064574; Tue, 25 Mar 2014 11:58:24 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PBwOEh064573; Tue, 25 Mar 2014 11:58:24 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251158.s2PBwOEh064573@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 11:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263718 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 11:58:25 -0000 Author: trasz Date: Tue Mar 25 11:58:24 2014 New Revision: 263718 URL: http://svnweb.freebsd.org/changeset/base/263718 Log: MFC r261750: Improve check for duplicated paths. It shows the warning twice for every path (once for each duplicate found), but it should do for now. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 11:53:47 2014 (r263717) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 11:58:24 2014 (r263718) @@ -873,6 +873,7 @@ static int conf_verify_lun(struct lun *lun) { const struct lun *lun2; + const struct target *targ2; if (lun->l_backend == NULL) lun_set_backend(lun, "block"); @@ -901,16 +902,6 @@ conf_verify_lun(struct lun *lun) lun->l_target->t_iqn); return (1); } -#if 1 /* Should we? */ - TAILQ_FOREACH(lun2, &lun->l_target->t_luns, l_next) { - if (lun == lun2) - continue; - if (lun->l_path != NULL && lun2->l_path != NULL && - strcmp(lun->l_path, lun2->l_path) == 0) - log_debugx("WARNING: duplicate path for lun %d, " - "target \"%s\"", lun->l_lun, lun->l_target->t_iqn); - } -#endif if (lun->l_blocksize == 0) { lun_set_blocksize(lun, DEFAULT_BLOCKSIZE); } else if (lun->l_blocksize < 0) { @@ -924,6 +915,20 @@ conf_verify_lun(struct lun *lun) lun->l_target->t_iqn); return (1); } + TAILQ_FOREACH(targ2, &lun->l_target->t_conf->conf_targets, t_next) { + TAILQ_FOREACH(lun2, &targ2->t_luns, l_next) { + if (lun == lun2) + continue; + if (lun->l_path != NULL && lun2->l_path != NULL && + strcmp(lun->l_path, lun2->l_path) == 0) { + log_debugx("WARNING: path \"%s\" duplicated " + "between lun %d, target \"%s\", and " + "lun %d, target \"%s\"", lun->l_path, + lun->l_lun, lun->l_target->t_iqn, + lun2->l_lun, lun2->l_target->t_iqn); + } + } + } return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:00:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 33C72BD5; Tue, 25 Mar 2014 12:00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 211049; Tue, 25 Mar 2014 12:00: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 s2PC05wm066663; Tue, 25 Mar 2014 12:00:06 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PC05Oa066662; Tue, 25 Mar 2014 12:00:05 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251200.s2PC05Oa066662@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:00:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263719 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:00:06 -0000 Author: trasz Date: Tue Mar 25 12:00:05 2014 New Revision: 263719 URL: http://svnweb.freebsd.org/changeset/base/263719 Log: MFC r261753: Daemonize after applying configuration, not before, so that any problems - including "daemon already running" - are visible on the terminal and not just in logs. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 11:58:24 2014 (r263718) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:00:05 2014 (r263719) @@ -1644,14 +1644,6 @@ main(int argc, char **argv) newconf->conf_debug = debug; } - if (dont_daemonize == false) { - if (daemon(0, 0) == -1) { - log_warn("cannot daemonize"); - pidfile_remove(newconf->conf_pidfh); - exit(1); - } - } - #ifdef ICL_KERNEL_PROXY log_debugx("enabling CTL iSCSI port"); error = kernel_port_on(); @@ -1674,6 +1666,15 @@ main(int argc, char **argv) log_errx(1, "failed to enable CTL iSCSI port, exiting"); #endif + if (dont_daemonize == false) { + log_debugx("daemonizing"); + if (daemon(0, 0) == -1) { + log_warn("cannot daemonize"); + pidfile_remove(newconf->conf_pidfh); + exit(1); + } + } + for (;;) { main_loop(newconf, dont_daemonize); if (sighup_received) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:01:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 94848D6E; Tue, 25 Mar 2014 12:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 661D913C; Tue, 25 Mar 2014 12:01: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 s2PC1vcH068072; Tue, 25 Mar 2014 12:01:57 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PC1u8X068066; Tue, 25 Mar 2014 12:01:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251201.s2PC1u8X068066@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263720 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:01:57 -0000 Author: trasz Date: Tue Mar 25 12:01:55 2014 New Revision: 263720 URL: http://svnweb.freebsd.org/changeset/base/263720 Log: MFC r261754: Implement initiator-name and initiator-portal restrictions. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctl.conf.5 stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/login.c stable/10/usr.sbin/ctld/parse.y stable/10/usr.sbin/ctld/token.l Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Tue Mar 25 12:00:05 2014 (r263719) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Tue Mar 25 12:01:55 2014 (r263720) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2013 +.Dd February 11, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -107,6 +107,18 @@ Specifies CHAP authentication credential 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. +.It Ic initiator-name Ao Ar initiator-name Ac +Specifies iSCSI initiator name. +If not defined, there will be no restrictions based on initiator +name. +Otherwise, only initiators with names matching one of defined +ones will be allowed to connect. +.It Ic initiator-portal Ao Ar address Ac +Specifies iSCSI initiator portal - IPv4 or IPv6 address. +If not defined, there will be no restrictions based on initiator +address. +Otherwise, only initiators with addresses matching one of defined +ones will be allowed to connect. .El .Ss portal-group level The following statements are available at the portal-group level: @@ -143,6 +155,22 @@ or chap-mutual clauses; it's a configura 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. +.It Ic initiator-name Ao Ar initiator-name Ac +Specifies iSCSI initiator name. +If not defined, there will be no restrictions based on initiator +name. +Otherwise, only initiators with names matching one of defined +ones will be allowed to connect. +This clause is mutually exclusive with auth-group; one cannot use +both in a single target. +.It Ic initiator-portal Ao Ar address Ac +Specifies iSCSI initiator portal - IPv4 or IPv6 address. +If not defined, there will be no restrictions based on initiator +address. +Otherwise, only initiators with addresses matching one of defined +ones will be allowed to connect. +This clause is mutually exclusive with auth-group; one cannot use +both in a single target. .It Ic portal-group Aq Ar name Assigns previously defined portal group to that target. Default portal group is "default", which makes the target available Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:00:05 2014 (r263719) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:01:55 2014 (r263720) @@ -149,6 +149,94 @@ auth_find(struct auth_group *ag, const c return (NULL); } +const struct auth_name * +auth_name_new(struct auth_group *ag, const char *name) +{ + struct auth_name *an; + + an = calloc(1, sizeof(*an)); + if (an == NULL) + log_err(1, "calloc"); + an->an_auth_group = ag; + an->an_initator_name = checked_strdup(name); + TAILQ_INSERT_TAIL(&ag->ag_names, an, an_next); + return (an); +} + +static void +auth_name_delete(struct auth_name *an) +{ + TAILQ_REMOVE(&an->an_auth_group->ag_names, an, an_next); + + free(an->an_initator_name); + free(an); +} + +bool +auth_name_defined(const struct auth_group *ag) +{ + if (TAILQ_EMPTY(&ag->ag_names)) + return (false); + return (true); +} + +const struct auth_name * +auth_name_find(const struct auth_group *ag, const char *name) +{ + const struct auth_name *auth_name; + + TAILQ_FOREACH(auth_name, &ag->ag_names, an_next) { + if (strcmp(auth_name->an_initator_name, name) == 0) + return (auth_name); + } + + return (NULL); +} + +const struct auth_portal * +auth_portal_new(struct auth_group *ag, const char *portal) +{ + struct auth_portal *ap; + + ap = calloc(1, sizeof(*ap)); + if (ap == NULL) + log_err(1, "calloc"); + ap->ap_auth_group = ag; + ap->ap_initator_portal = checked_strdup(portal); + TAILQ_INSERT_TAIL(&ag->ag_portals, ap, ap_next); + return (ap); +} + +static void +auth_portal_delete(struct auth_portal *ap) +{ + TAILQ_REMOVE(&ap->ap_auth_group->ag_portals, ap, ap_next); + + free(ap->ap_initator_portal); + free(ap); +} + +bool +auth_portal_defined(const struct auth_group *ag) +{ + if (TAILQ_EMPTY(&ag->ag_portals)) + return (false); + return (true); +} + +const struct auth_portal * +auth_portal_find(const struct auth_group *ag, const char *portal) +{ + const struct auth_portal *auth_portal; + + TAILQ_FOREACH(auth_portal, &ag->ag_portals, ap_next) { + if (strcmp(auth_portal->ap_initator_portal, portal) == 0) + return (auth_portal); + } + + return (NULL); +} + struct auth_group * auth_group_new(struct conf *conf, const char *name) { @@ -168,6 +256,8 @@ auth_group_new(struct conf *conf, const if (name != NULL) ag->ag_name = checked_strdup(name); TAILQ_INIT(&ag->ag_auths); + TAILQ_INIT(&ag->ag_names); + TAILQ_INIT(&ag->ag_portals); ag->ag_conf = conf; TAILQ_INSERT_TAIL(&conf->conf_auth_groups, ag, ag_next); @@ -177,12 +267,19 @@ auth_group_new(struct conf *conf, const void auth_group_delete(struct auth_group *ag) { - struct auth *auth, *tmp; + struct auth *auth, *auth_tmp; + struct auth_name *auth_name, *auth_name_tmp; + struct auth_portal *auth_portal, *auth_portal_tmp; TAILQ_REMOVE(&ag->ag_conf->conf_auth_groups, ag, ag_next); - TAILQ_FOREACH_SAFE(auth, &ag->ag_auths, a_next, tmp) + TAILQ_FOREACH_SAFE(auth, &ag->ag_auths, a_next, auth_tmp) auth_delete(auth); + TAILQ_FOREACH_SAFE(auth_name, &ag->ag_names, an_next, auth_name_tmp) + auth_name_delete(auth_name); + TAILQ_FOREACH_SAFE(auth_portal, &ag->ag_portals, ap_next, + auth_portal_tmp) + auth_portal_delete(auth_portal); free(ag->ag_name); free(ag); } @@ -832,6 +929,8 @@ conf_print(struct conf *conf) { struct auth_group *ag; struct auth *auth; + struct auth_name *auth_name; + struct auth_portal *auth_portal; struct portal_group *pg; struct portal *portal; struct target *targ; @@ -844,6 +943,12 @@ conf_print(struct conf *conf) fprintf(stderr, "\t chap-mutual %s %s %s %s\n", auth->a_user, auth->a_secret, auth->a_mutual_user, auth->a_mutual_secret); + TAILQ_FOREACH(auth_name, &ag->ag_names, an_next) + fprintf(stderr, "\t initiator-name %s\n", + auth_name->an_initator_name); + TAILQ_FOREACH(auth_portal, &ag->ag_portals, an_next) + fprintf(stderr, "\t initiator-portal %s\n", + auth_portal->an_initator_portal); fprintf(stderr, "}\n"); } TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:00:05 2014 (r263719) +++ stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:01:55 2014 (r263720) @@ -53,6 +53,18 @@ struct auth { char *a_mutual_secret; }; +struct auth_name { + TAILQ_ENTRY(auth_name) an_next; + struct auth_group *an_auth_group; + char *an_initator_name; +}; + +struct auth_portal { + TAILQ_ENTRY(auth_portal) ap_next; + struct auth_group *ap_auth_group; + char *ap_initator_portal; +}; + #define AG_TYPE_UNKNOWN 0 #define AG_TYPE_NO_AUTHENTICATION 1 #define AG_TYPE_CHAP 2 @@ -65,6 +77,8 @@ struct auth_group { struct target *ag_target; int ag_type; TAILQ_HEAD(, auth) ag_auths; + TAILQ_HEAD(, auth_name) ag_names; + TAILQ_HEAD(, auth_portal) ag_portals; }; struct portal { @@ -192,6 +206,18 @@ const struct auth *auth_new_chap_mutual( const struct auth *auth_find(struct auth_group *ag, const char *user); +const struct auth_name *auth_name_new(struct auth_group *ag, + const char *initiator_name); +bool auth_name_defined(const struct auth_group *ag); +const struct auth_name *auth_name_find(const struct auth_group *ag, + const char *initiator_name); + +const struct auth_portal *auth_portal_new(struct auth_group *ag, + const char *initiator_portal); +bool auth_portal_defined(const struct auth_group *ag); +const struct auth_portal *auth_portal_find(const struct auth_group *ag, + const char *initiator_portal); + struct portal_group *portal_group_new(struct conf *conf, const char *name); void portal_group_delete(struct portal_group *pg); struct portal_group *portal_group_find(struct conf *conf, const char *name); Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:00:05 2014 (r263719) +++ stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:01:55 2014 (r263720) @@ -940,6 +940,33 @@ login(struct connection *conn) } /* + * Enforce initiator-name and initiator-portal. + */ + if (auth_name_defined(ag)) { + if (auth_name_find(ag, initiator_name) == NULL) { + login_send_error(request, 0x02, 0x02); + log_errx(1, "initiator does not match allowed " + "initiator names"); + } + log_debugx("initiator matches allowed initiator names"); + } else { + log_debugx("auth-group does not define initiator name " + "restrictions"); + } + + if (auth_portal_defined(ag)) { + if (auth_portal_find(ag, conn->conn_initiator_addr) == NULL) { + login_send_error(request, 0x02, 0x02); + log_errx(1, "initiator does not match allowed " + "initiator portals"); + } + log_debugx("initiator matches allowed initiator portals"); + } else { + log_debugx("auth-group does not define initiator portal " + "restrictions"); + } + + /* * Let's see if the initiator intends to do any kind of authentication * at all. */ Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:00:05 2014 (r263719) +++ stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:01:55 2014 (r263720) @@ -58,9 +58,9 @@ extern void yyrestart(FILE *); %} %token ALIAS AUTH_GROUP BACKEND BLOCKSIZE CHAP CHAP_MUTUAL CLOSING_BRACKET -%token DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP LISTEN LISTEN_ISER LUN MAXPROC NUM -%token OPENING_BRACKET OPTION PATH PIDFILE PORTAL_GROUP SERIAL SIZE STR TARGET -%token TIMEOUT +%token DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP INITIATOR_NAME INITIATOR_PORTAL +%token LISTEN LISTEN_ISER LUN MAXPROC NUM OPENING_BRACKET OPTION PATH PIDFILE +%token PORTAL_GROUP SERIAL SIZE STR TARGET TIMEOUT %union { @@ -148,6 +148,10 @@ auth_group_entry: auth_group_chap | auth_group_chap_mutual + | + auth_group_initiator_name + | + auth_group_initiator_portal ; auth_group_chap: CHAP STR STR @@ -176,6 +180,28 @@ auth_group_chap_mutual: CHAP_MUTUAL STR } ; +auth_group_initiator_name: INITIATOR_NAME STR + { + const struct auth_name *an; + + an = auth_name_new(auth_group, $2); + free($2); + if (an == NULL) + return (1); + } + ; + +auth_group_initiator_portal: INITIATOR_PORTAL STR + { + const struct auth_portal *ap; + + ap = auth_portal_new(auth_group, $2); + free($2); + if (ap == NULL) + return (1); + } + ; + portal_group_definition: PORTAL_GROUP portal_group_name OPENING_BRACKET portal_group_entries CLOSING_BRACKET { @@ -277,6 +303,10 @@ target_entry: | chap_mutual_statement | + initiator_name_statement + | + initiator_portal_statement + | portal_group_statement | lun_statement @@ -382,6 +412,60 @@ chap_mutual_statement: CHAP_MUTUAL STR S } ; +initiator_name_statement: INITIATOR_NAME STR + { + const struct auth_name *an; + + if (target->t_auth_group != NULL) { + if (target->t_auth_group->ag_name != NULL) { + log_warnx("cannot mix auth-group with " + "initiator-name for target \"%s\"", + target->t_iqn); + free($2); + return (1); + } + } else { + target->t_auth_group = auth_group_new(conf, NULL); + if (target->t_auth_group == NULL) { + free($2); + return (1); + } + target->t_auth_group->ag_target = target; + } + an = auth_name_new(target->t_auth_group, $2); + free($2); + if (an == NULL) + return (1); + } + ; + +initiator_portal_statement: INITIATOR_PORTAL STR + { + const struct auth_portal *ap; + + if (target->t_auth_group != NULL) { + if (target->t_auth_group->ag_name != NULL) { + log_warnx("cannot mix auth-group with " + "initiator-portal for target \"%s\"", + target->t_iqn); + free($2); + return (1); + } + } else { + target->t_auth_group = auth_group_new(conf, NULL); + if (target->t_auth_group == NULL) { + free($2); + return (1); + } + target->t_auth_group->ag_target = target; + } + ap = auth_portal_new(target->t_auth_group, $2); + free($2); + if (ap == NULL) + return (1); + } + ; + portal_group_statement: PORTAL_GROUP STR { if (target->t_portal_group != NULL) { Modified: stable/10/usr.sbin/ctld/token.l ============================================================================== --- stable/10/usr.sbin/ctld/token.l Tue Mar 25 12:00:05 2014 (r263719) +++ stable/10/usr.sbin/ctld/token.l Tue Mar 25 12:01:55 2014 (r263720) @@ -57,6 +57,8 @@ chap-mutual { return CHAP_MUTUAL; } debug { return DEBUG; } device-id { return DEVICE_ID; } discovery-auth-group { return DISCOVERY_AUTH_GROUP; } +initiator-name { return INITIATOR_NAME; } +initiator-portal { return INITIATOR_PORTAL; } listen { return LISTEN; } listen-iser { return LISTEN_ISER; } lun { return LUN; } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:06:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DA71AFA4; Tue, 25 Mar 2014 12:06: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA8E3177; Tue, 25 Mar 2014 12:06: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 s2PC6g15068634; Tue, 25 Mar 2014 12:06:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PC6g9o068633; Tue, 25 Mar 2014 12:06:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251206.s2PC6g9o068633@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263721 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:06:42 -0000 Author: trasz Date: Tue Mar 25 12:06:42 2014 New Revision: 263721 URL: http://svnweb.freebsd.org/changeset/base/263721 Log: MFC r261755: Make function ordering slightly more logical; no functional changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:01:55 2014 (r263720) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:06:42 2014 (r263721) @@ -149,6 +149,126 @@ auth_find(struct auth_group *ag, const c return (NULL); } +static void +auth_check_secret_length(struct auth *auth) +{ + size_t len; + + len = strlen(auth->a_secret); + if (len > 16) { + if (auth->a_auth_group->ag_name != NULL) + log_warnx("secret for user \"%s\", auth-group \"%s\", " + "is too long; it should be at most 16 characters " + "long", auth->a_user, auth->a_auth_group->ag_name); + else + log_warnx("secret for user \"%s\", target \"%s\", " + "is too long; it should be at most 16 characters " + "long", auth->a_user, + auth->a_auth_group->ag_target->t_iqn); + } + if (len < 12) { + if (auth->a_auth_group->ag_name != NULL) + log_warnx("secret for user \"%s\", auth-group \"%s\", " + "is too short; it should be at least 12 characters " + "long", auth->a_user, + auth->a_auth_group->ag_name); + else + log_warnx("secret for user \"%s\", target \"%s\", " + "is too short; it should be at least 16 characters " + "long", auth->a_user, + auth->a_auth_group->ag_target->t_iqn); + } + + if (auth->a_mutual_secret != NULL) { + len = strlen(auth->a_secret); + if (len > 16) { + if (auth->a_auth_group->ag_name != NULL) + log_warnx("mutual secret for user \"%s\", " + "auth-group \"%s\", is too long; it should " + "be at most 16 characters long", + auth->a_user, auth->a_auth_group->ag_name); + else + log_warnx("mutual secret for user \"%s\", " + "target \"%s\", is too long; it should " + "be at most 16 characters long", + auth->a_user, + auth->a_auth_group->ag_target->t_iqn); + } + if (len < 12) { + if (auth->a_auth_group->ag_name != NULL) + log_warnx("mutual secret for user \"%s\", " + "auth-group \"%s\", is too short; it " + "should be at least 12 characters long", + auth->a_user, auth->a_auth_group->ag_name); + else + log_warnx("mutual secret for user \"%s\", " + "target \"%s\", is too short; it should be " + "at least 16 characters long", + auth->a_user, + auth->a_auth_group->ag_target->t_iqn); + } + } +} + +const struct auth * +auth_new_chap(struct auth_group *ag, const char *user, + const char *secret) +{ + struct auth *auth; + + if (ag->ag_type == AG_TYPE_UNKNOWN) + ag->ag_type = AG_TYPE_CHAP; + if (ag->ag_type != AG_TYPE_CHAP) { + if (ag->ag_name != NULL) + log_warnx("cannot mix \"chap\" authentication with " + "other types for auth-group \"%s\"", ag->ag_name); + else + log_warnx("cannot mix \"chap\" authentication with " + "other types for target \"%s\"", + ag->ag_target->t_iqn); + return (NULL); + } + + auth = auth_new(ag); + auth->a_user = checked_strdup(user); + auth->a_secret = checked_strdup(secret); + + auth_check_secret_length(auth); + + return (auth); +} + +const struct auth * +auth_new_chap_mutual(struct auth_group *ag, const char *user, + const char *secret, const char *user2, const char *secret2) +{ + struct auth *auth; + + if (ag->ag_type == AG_TYPE_UNKNOWN) + ag->ag_type = AG_TYPE_CHAP_MUTUAL; + if (ag->ag_type != AG_TYPE_CHAP_MUTUAL) { + if (ag->ag_name != NULL) + log_warnx("cannot mix \"chap-mutual\" authentication " + "with other types for auth-group \"%s\"", + ag->ag_name); + else + log_warnx("cannot mix \"chap-mutual\" authentication " + "with other types for target \"%s\"", + ag->ag_target->t_iqn); + return (NULL); + } + + auth = auth_new(ag); + auth->a_user = checked_strdup(user); + auth->a_secret = checked_strdup(secret); + auth->a_mutual_user = checked_strdup(user2); + auth->a_mutual_secret = checked_strdup(secret2); + + auth_check_secret_length(auth); + + return (auth); +} + const struct auth_name * auth_name_new(struct auth_group *ag, const char *name) { @@ -297,126 +417,6 @@ auth_group_find(struct conf *conf, const return (NULL); } -static void -auth_check_secret_length(struct auth *auth) -{ - size_t len; - - len = strlen(auth->a_secret); - if (len > 16) { - if (auth->a_auth_group->ag_name != NULL) - log_warnx("secret for user \"%s\", auth-group \"%s\", " - "is too long; it should be at most 16 characters " - "long", auth->a_user, auth->a_auth_group->ag_name); - else - log_warnx("secret for user \"%s\", target \"%s\", " - "is too long; it should be at most 16 characters " - "long", auth->a_user, - auth->a_auth_group->ag_target->t_iqn); - } - if (len < 12) { - if (auth->a_auth_group->ag_name != NULL) - log_warnx("secret for user \"%s\", auth-group \"%s\", " - "is too short; it should be at least 12 characters " - "long", auth->a_user, - auth->a_auth_group->ag_name); - else - log_warnx("secret for user \"%s\", target \"%s\", " - "is too short; it should be at least 16 characters " - "long", auth->a_user, - auth->a_auth_group->ag_target->t_iqn); - } - - if (auth->a_mutual_secret != NULL) { - len = strlen(auth->a_secret); - if (len > 16) { - if (auth->a_auth_group->ag_name != NULL) - log_warnx("mutual secret for user \"%s\", " - "auth-group \"%s\", is too long; it should " - "be at most 16 characters long", - auth->a_user, auth->a_auth_group->ag_name); - else - log_warnx("mutual secret for user \"%s\", " - "target \"%s\", is too long; it should " - "be at most 16 characters long", - auth->a_user, - auth->a_auth_group->ag_target->t_iqn); - } - if (len < 12) { - if (auth->a_auth_group->ag_name != NULL) - log_warnx("mutual secret for user \"%s\", " - "auth-group \"%s\", is too short; it " - "should be at least 12 characters long", - auth->a_user, auth->a_auth_group->ag_name); - else - log_warnx("mutual secret for user \"%s\", " - "target \"%s\", is too short; it should be " - "at least 16 characters long", - auth->a_user, - auth->a_auth_group->ag_target->t_iqn); - } - } -} - -const struct auth * -auth_new_chap(struct auth_group *ag, const char *user, - const char *secret) -{ - struct auth *auth; - - if (ag->ag_type == AG_TYPE_UNKNOWN) - ag->ag_type = AG_TYPE_CHAP; - if (ag->ag_type != AG_TYPE_CHAP) { - if (ag->ag_name != NULL) - log_warnx("cannot mix \"chap\" authentication with " - "other types for auth-group \"%s\"", ag->ag_name); - else - log_warnx("cannot mix \"chap\" authentication with " - "other types for target \"%s\"", - ag->ag_target->t_iqn); - return (NULL); - } - - auth = auth_new(ag); - auth->a_user = checked_strdup(user); - auth->a_secret = checked_strdup(secret); - - auth_check_secret_length(auth); - - return (auth); -} - -const struct auth * -auth_new_chap_mutual(struct auth_group *ag, const char *user, - const char *secret, const char *user2, const char *secret2) -{ - struct auth *auth; - - if (ag->ag_type == AG_TYPE_UNKNOWN) - ag->ag_type = AG_TYPE_CHAP_MUTUAL; - if (ag->ag_type != AG_TYPE_CHAP_MUTUAL) { - if (ag->ag_name != NULL) - log_warnx("cannot mix \"chap-mutual\" authentication " - "with other types for auth-group \"%s\"", - ag->ag_name); - else - log_warnx("cannot mix \"chap-mutual\" authentication " - "with other types for target \"%s\"", - ag->ag_target->t_iqn); - return (NULL); - } - - auth = auth_new(ag); - auth->a_user = checked_strdup(user); - auth->a_secret = checked_strdup(secret); - auth->a_mutual_user = checked_strdup(user2); - auth->a_mutual_secret = checked_strdup(secret2); - - auth_check_secret_length(auth); - - return (auth); -} - static struct portal * portal_new(struct portal_group *pg) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:08:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8689029F; Tue, 25 Mar 2014 12:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 671941AE; Tue, 25 Mar 2014 12:08: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 s2PC8alU068903; Tue, 25 Mar 2014 12:08:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PC8a2a068902; Tue, 25 Mar 2014 12:08:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251208.s2PC8a2a068902@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263722 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:08:36 -0000 Author: trasz Date: Tue Mar 25 12:08:35 2014 New Revision: 263722 URL: http://svnweb.freebsd.org/changeset/base/263722 Log: MFC r261756: Yacc cleanup; no functional changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:06:42 2014 (r263721) +++ stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:08:35 2014 (r263722) @@ -79,40 +79,40 @@ statements: ; statement: - debug_statement + debug | - timeout_statement + timeout | - maxproc_statement + maxproc | - pidfile_statement + pidfile | - auth_group_definition + auth_group | - portal_group_definition + portal_group | - target_statement + target ; -debug_statement: DEBUG NUM +debug: DEBUG NUM { conf->conf_debug = $2; } ; -timeout_statement: TIMEOUT NUM +timeout: TIMEOUT NUM { conf->conf_timeout = $2; } ; -maxproc_statement: MAXPROC NUM +maxproc: MAXPROC NUM { conf->conf_maxproc = $2; } ; -pidfile_statement: PIDFILE STR +pidfile: PIDFILE STR { if (conf->conf_pidfile_path != NULL) { log_warnx("pidfile specified more than once"); @@ -123,7 +123,7 @@ pidfile_statement: PIDFILE STR } ; -auth_group_definition: AUTH_GROUP auth_group_name +auth_group: AUTH_GROUP auth_group_name OPENING_BRACKET auth_group_entries CLOSING_BRACKET { auth_group = NULL; @@ -202,7 +202,7 @@ auth_group_initiator_portal: INITIATOR_P } ; -portal_group_definition: PORTAL_GROUP portal_group_name +portal_group: PORTAL_GROUP portal_group_name OPENING_BRACKET portal_group_entries CLOSING_BRACKET { portal_group = NULL; @@ -273,14 +273,14 @@ portal_group_listen_iser: LISTEN_ISER ST } ; -target_statement: TARGET target_iqn +target: TARGET target_name OPENING_BRACKET target_entries CLOSING_BRACKET { target = NULL; } ; -target_iqn: STR +target_name: STR { target = target_new(conf, $1); free($1); @@ -295,24 +295,24 @@ target_entries: ; target_entry: - alias_statement + target_alias | - auth_group_statement + target_auth_group | - chap_statement + target_chap | - chap_mutual_statement + target_chap_mutual | - initiator_name_statement + target_initiator_name | - initiator_portal_statement + target_initiator_portal | - portal_group_statement + target_portal_group | - lun_statement + target_lun ; -alias_statement: ALIAS STR +target_alias: ALIAS STR { if (target->t_alias != NULL) { log_warnx("alias for target \"%s\" " @@ -323,7 +323,7 @@ alias_statement: ALIAS STR } ; -auth_group_statement: AUTH_GROUP STR +target_auth_group: AUTH_GROUP STR { if (target->t_auth_group != NULL) { if (target->t_auth_group->ag_name != NULL) @@ -345,7 +345,7 @@ auth_group_statement: AUTH_GROUP STR } ; -chap_statement: CHAP STR STR +target_chap: CHAP STR STR { const struct auth *ca; @@ -375,7 +375,7 @@ chap_statement: CHAP STR STR } ; -chap_mutual_statement: CHAP_MUTUAL STR STR STR STR +target_chap_mutual: CHAP_MUTUAL STR STR STR STR { const struct auth *ca; @@ -412,7 +412,7 @@ chap_mutual_statement: CHAP_MUTUAL STR S } ; -initiator_name_statement: INITIATOR_NAME STR +target_initiator_name: INITIATOR_NAME STR { const struct auth_name *an; @@ -439,7 +439,7 @@ initiator_name_statement: INITIATOR_NAME } ; -initiator_portal_statement: INITIATOR_PORTAL STR +target_initiator_portal: INITIATOR_PORTAL STR { const struct auth_portal *ap; @@ -466,7 +466,7 @@ initiator_portal_statement: INITIATOR_PO } ; -portal_group_statement: PORTAL_GROUP STR +target_portal_group: PORTAL_GROUP STR { if (target->t_portal_group != NULL) { log_warnx("portal-group for target \"%s\" " @@ -485,8 +485,8 @@ portal_group_statement: PORTAL_GROUP STR } ; -lun_statement: LUN lun_number - OPENING_BRACKET lun_statement_entries CLOSING_BRACKET +target_lun: LUN lun_number + OPENING_BRACKET lun_entries CLOSING_BRACKET { lun = NULL; } @@ -500,28 +500,28 @@ lun_number: NUM } ; -lun_statement_entries: +lun_entries: | - lun_statement_entries lun_statement_entry + lun_entries lun_entry ; -lun_statement_entry: - backend_statement +lun_entry: + lun_backend | - blocksize_statement + lun_blocksize | - device_id_statement + lun_device_id | - option_statement + lun_option | - path_statement + lun_path | - serial_statement + lun_serial | - size_statement + lun_size ; -backend_statement: BACKEND STR +lun_backend: BACKEND STR { if (lun->l_backend != NULL) { log_warnx("backend for lun %d, target \"%s\" " @@ -535,7 +535,7 @@ backend_statement: BACKEND STR } ; -blocksize_statement: BLOCKSIZE NUM +lun_blocksize: BLOCKSIZE NUM { if (lun->l_blocksize != 0) { log_warnx("blocksize for lun %d, target \"%s\" " @@ -547,7 +547,7 @@ blocksize_statement: BLOCKSIZE NUM } ; -device_id_statement: DEVICE_ID STR +lun_device_id: DEVICE_ID STR { if (lun->l_device_id != NULL) { log_warnx("device_id for lun %d, target \"%s\" " @@ -561,7 +561,7 @@ device_id_statement: DEVICE_ID STR } ; -option_statement: OPTION STR STR +lun_option: OPTION STR STR { struct lun_option *clo; @@ -573,7 +573,7 @@ option_statement: OPTION STR STR } ; -path_statement: PATH STR +lun_path: PATH STR { if (lun->l_path != NULL) { log_warnx("path for lun %d, target \"%s\" " @@ -587,7 +587,7 @@ path_statement: PATH STR } ; -serial_statement: SERIAL STR +lun_serial: SERIAL STR { if (lun->l_serial != NULL) { log_warnx("serial for lun %d, target \"%s\" " @@ -601,7 +601,7 @@ serial_statement: SERIAL STR } ; -size_statement: SIZE NUM +lun_size: SIZE NUM { if (lun->l_size != 0) { log_warnx("size for lun %d, target \"%s\" " From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:10:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3155B4AA; Tue, 25 Mar 2014 12:10: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C2ED1C5; Tue, 25 Mar 2014 12:10: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 s2PCAW3B070030; Tue, 25 Mar 2014 12:10:32 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCAUaa070023; Tue, 25 Mar 2014 12:10:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251210.s2PCAUaa070023@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263723 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:10:32 -0000 Author: trasz Date: Tue Mar 25 12:10:30 2014 New Revision: 263723 URL: http://svnweb.freebsd.org/changeset/base/263723 Log: MFC r261757: Rename a variable, no functional changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/discovery.c stable/10/usr.sbin/ctld/kernel.c stable/10/usr.sbin/ctld/login.c stable/10/usr.sbin/ctld/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:08:35 2014 (r263722) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:10:30 2014 (r263723) @@ -164,7 +164,7 @@ auth_check_secret_length(struct auth *au log_warnx("secret for user \"%s\", target \"%s\", " "is too long; it should be at most 16 characters " "long", auth->a_user, - auth->a_auth_group->ag_target->t_iqn); + auth->a_auth_group->ag_target->t_name); } if (len < 12) { if (auth->a_auth_group->ag_name != NULL) @@ -176,7 +176,7 @@ auth_check_secret_length(struct auth *au log_warnx("secret for user \"%s\", target \"%s\", " "is too short; it should be at least 16 characters " "long", auth->a_user, - auth->a_auth_group->ag_target->t_iqn); + auth->a_auth_group->ag_target->t_name); } if (auth->a_mutual_secret != NULL) { @@ -192,7 +192,7 @@ auth_check_secret_length(struct auth *au "target \"%s\", is too long; it should " "be at most 16 characters long", auth->a_user, - auth->a_auth_group->ag_target->t_iqn); + auth->a_auth_group->ag_target->t_name); } if (len < 12) { if (auth->a_auth_group->ag_name != NULL) @@ -205,7 +205,7 @@ auth_check_secret_length(struct auth *au "target \"%s\", is too short; it should be " "at least 16 characters long", auth->a_user, - auth->a_auth_group->ag_target->t_iqn); + auth->a_auth_group->ag_target->t_name); } } } @@ -225,7 +225,7 @@ auth_new_chap(struct auth_group *ag, con else log_warnx("cannot mix \"chap\" authentication with " "other types for target \"%s\"", - ag->ag_target->t_iqn); + ag->ag_target->t_name); return (NULL); } @@ -254,7 +254,7 @@ auth_new_chap_mutual(struct auth_group * else log_warnx("cannot mix \"chap-mutual\" authentication " "with other types for target \"%s\"", - ag->ag_target->t_iqn); + ag->ag_target->t_name); return (NULL); } @@ -686,31 +686,31 @@ valid_iscsi_name(const char *name) } struct target * -target_new(struct conf *conf, const char *iqn) +target_new(struct conf *conf, const char *name) { struct target *targ; int i, len; - targ = target_find(conf, iqn); + targ = target_find(conf, name); if (targ != NULL) { - log_warnx("duplicated target \"%s\"", iqn); + log_warnx("duplicated target \"%s\"", name); return (NULL); } - if (valid_iscsi_name(iqn) == false) { - log_warnx("target name \"%s\" is invalid", iqn); + if (valid_iscsi_name(name) == false) { + log_warnx("target name \"%s\" is invalid", name); return (NULL); } targ = calloc(1, sizeof(*targ)); if (targ == NULL) log_err(1, "calloc"); - targ->t_iqn = checked_strdup(iqn); + targ->t_name = checked_strdup(name); /* * RFC 3722 requires us to normalize the name to lowercase. */ - len = strlen(iqn); + len = strlen(name); for (i = 0; i < len; i++) - targ->t_iqn[i] = tolower(targ->t_iqn[i]); + targ->t_name[i] = tolower(targ->t_name[i]); TAILQ_INIT(&targ->t_luns); targ->t_conf = conf; @@ -728,17 +728,17 @@ target_delete(struct target *targ) TAILQ_FOREACH_SAFE(lun, &targ->t_luns, l_next, tmp) lun_delete(lun); - free(targ->t_iqn); + free(targ->t_name); free(targ); } struct target * -target_find(struct conf *conf, const char *iqn) +target_find(struct conf *conf, const char *name) { struct target *targ; TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { - if (strcasecmp(targ->t_iqn, iqn) == 0) + if (strcasecmp(targ->t_name, name) == 0) return (targ); } @@ -753,7 +753,7 @@ lun_new(struct target *targ, int lun_id) lun = lun_find(targ, lun_id); if (lun != NULL) { log_warnx("duplicated lun %d for target \"%s\"", - lun_id, targ->t_iqn); + lun_id, targ->t_name); return (NULL); } @@ -854,7 +854,7 @@ lun_option_new(struct lun *lun, const ch lo = lun_option_find(lun, name); if (lo != NULL) { log_warnx("duplicated lun option %s for lun %d, target \"%s\"", - name, lun->l_lun, lun->l_target->t_iqn); + name, lun->l_lun, lun->l_target->t_name); return (NULL); } @@ -958,7 +958,7 @@ conf_print(struct conf *conf) fprintf(stderr, "}\n"); } TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { - fprintf(stderr, "target %s {\n", targ->t_iqn); + fprintf(stderr, "target %s {\n", targ->t_name); if (targ->t_alias != NULL) fprintf(stderr, "\t alias %s\n", targ->t_alias); TAILQ_FOREACH(lun, &targ->t_luns, l_next) { @@ -985,39 +985,39 @@ conf_verify_lun(struct lun *lun) if (strcmp(lun->l_backend, "block") == 0) { if (lun->l_path == NULL) { log_warnx("missing path for lun %d, target \"%s\"", - lun->l_lun, lun->l_target->t_iqn); + lun->l_lun, lun->l_target->t_name); return (1); } } else if (strcmp(lun->l_backend, "ramdisk") == 0) { if (lun->l_size == 0) { log_warnx("missing size for ramdisk-backed lun %d, " - "target \"%s\"", lun->l_lun, lun->l_target->t_iqn); + "target \"%s\"", lun->l_lun, lun->l_target->t_name); return (1); } if (lun->l_path != NULL) { log_warnx("path must not be specified " "for ramdisk-backed lun %d, target \"%s\"", - lun->l_lun, lun->l_target->t_iqn); + lun->l_lun, lun->l_target->t_name); return (1); } } if (lun->l_lun < 0 || lun->l_lun > 255) { log_warnx("invalid lun number for lun %d, target \"%s\"; " "must be between 0 and 255", lun->l_lun, - lun->l_target->t_iqn); + lun->l_target->t_name); return (1); } if (lun->l_blocksize == 0) { lun_set_blocksize(lun, DEFAULT_BLOCKSIZE); } else if (lun->l_blocksize < 0) { log_warnx("invalid blocksize for lun %d, target \"%s\"; " - "must be larger than 0", lun->l_lun, lun->l_target->t_iqn); + "must be larger than 0", lun->l_lun, lun->l_target->t_name); return (1); } if (lun->l_size != 0 && lun->l_size % lun->l_blocksize != 0) { log_warnx("invalid size for lun %d, target \"%s\"; " "must be multiple of blocksize", lun->l_lun, - lun->l_target->t_iqn); + lun->l_target->t_name); return (1); } TAILQ_FOREACH(targ2, &lun->l_target->t_conf->conf_targets, t_next) { @@ -1029,8 +1029,8 @@ conf_verify_lun(struct lun *lun) log_debugx("WARNING: path \"%s\" duplicated " "between lun %d, target \"%s\", and " "lun %d, target \"%s\"", lun->l_path, - lun->l_lun, lun->l_target->t_iqn, - lun2->l_lun, lun2->l_target->t_iqn); + lun->l_lun, lun->l_target->t_name, + lun2->l_lun, lun2->l_target->t_name); } } } @@ -1055,7 +1055,7 @@ conf_verify(struct conf *conf) if (targ->t_auth_group == NULL) { log_warnx("missing authentication for target \"%s\"; " "must specify either \"auth-group\", \"chap\", " - "or \"chap-mutual\"", targ->t_iqn); + "or \"chap-mutual\"", targ->t_name); return (1); } if (targ->t_portal_group == NULL) { @@ -1073,7 +1073,7 @@ conf_verify(struct conf *conf) } if (!found_lun0) { log_warnx("mandatory LUN 0 not configured " - "for target \"%s\"", targ->t_iqn); + "for target \"%s\"", targ->t_name); return (1); } } @@ -1169,20 +1169,20 @@ conf_apply(struct conf *oldconf, struct * First, remove any targets present in the old configuration * and missing in the new one. */ - newtarg = target_find(newconf, oldtarg->t_iqn); + newtarg = target_find(newconf, oldtarg->t_name); if (newtarg == NULL) { TAILQ_FOREACH_SAFE(oldlun, &oldtarg->t_luns, l_next, tmplun) { log_debugx("target %s not found in new " "configuration; removing its lun %d, " "backed by CTL lun %d", - oldtarg->t_iqn, oldlun->l_lun, + oldtarg->t_name, oldlun->l_lun, oldlun->l_ctl_lun); error = kernel_lun_remove(oldlun); if (error != 0) { log_warnx("failed to remove lun %d, " "target %s, CTL lun %d", - oldlun->l_lun, oldtarg->t_iqn, + oldlun->l_lun, oldtarg->t_name, oldlun->l_ctl_lun); cumulated_error++; } @@ -1201,13 +1201,13 @@ conf_apply(struct conf *oldconf, struct if (newlun == NULL) { log_debugx("lun %d, target %s, CTL lun %d " "not found in new configuration; " - "removing", oldlun->l_lun, oldtarg->t_iqn, + "removing", oldlun->l_lun, oldtarg->t_name, oldlun->l_ctl_lun); error = kernel_lun_remove(oldlun); if (error != 0) { log_warnx("failed to remove lun %d, " "target %s, CTL lun %d", - oldlun->l_lun, oldtarg->t_iqn, + oldlun->l_lun, oldtarg->t_name, oldlun->l_ctl_lun); cumulated_error++; } @@ -1224,14 +1224,14 @@ conf_apply(struct conf *oldconf, struct if (strcmp(newlun->l_backend, oldlun->l_backend) != 0) { log_debugx("backend for lun %d, target %s, " "CTL lun %d changed; removing", - oldlun->l_lun, oldtarg->t_iqn, + oldlun->l_lun, oldtarg->t_name, oldlun->l_ctl_lun); changed = 1; } if (oldlun->l_blocksize != newlun->l_blocksize) { log_debugx("blocksize for lun %d, target %s, " "CTL lun %d changed; removing", - oldlun->l_lun, oldtarg->t_iqn, + oldlun->l_lun, oldtarg->t_name, oldlun->l_ctl_lun); changed = 1; } @@ -1241,7 +1241,7 @@ conf_apply(struct conf *oldconf, struct 0)) { log_debugx("device-id for lun %d, target %s, " "CTL lun %d changed; removing", - oldlun->l_lun, oldtarg->t_iqn, + oldlun->l_lun, oldtarg->t_name, oldlun->l_ctl_lun); changed = 1; } @@ -1250,7 +1250,7 @@ conf_apply(struct conf *oldconf, struct strcmp(oldlun->l_path, newlun->l_path) != 0)) { log_debugx("path for lun %d, target %s, " "CTL lun %d, changed; removing", - oldlun->l_lun, oldtarg->t_iqn, + oldlun->l_lun, oldtarg->t_name, oldlun->l_ctl_lun); changed = 1; } @@ -1259,7 +1259,7 @@ conf_apply(struct conf *oldconf, struct strcmp(oldlun->l_serial, newlun->l_serial) != 0)) { log_debugx("serial for lun %d, target %s, " "CTL lun %d changed; removing", - oldlun->l_lun, oldtarg->t_iqn, + oldlun->l_lun, oldtarg->t_name, oldlun->l_ctl_lun); changed = 1; } @@ -1268,7 +1268,7 @@ conf_apply(struct conf *oldconf, struct if (error != 0) { log_warnx("failed to remove lun %d, " "target %s, CTL lun %d", - oldlun->l_lun, oldtarg->t_iqn, + oldlun->l_lun, oldtarg->t_name, oldlun->l_ctl_lun); cumulated_error++; } @@ -1284,7 +1284,7 @@ conf_apply(struct conf *oldconf, struct * Now add new targets or modify existing ones. */ TAILQ_FOREACH(newtarg, &newconf->conf_targets, t_next) { - oldtarg = target_find(oldconf, newtarg->t_iqn); + oldtarg = target_find(oldconf, newtarg->t_name); TAILQ_FOREACH(newlun, &newtarg->t_luns, l_next) { if (oldtarg != NULL) { @@ -1294,7 +1294,7 @@ conf_apply(struct conf *oldconf, struct log_debugx("resizing lun %d, " "target %s, CTL lun %d", newlun->l_lun, - newtarg->t_iqn, + newtarg->t_name, newlun->l_ctl_lun); error = kernel_lun_resize(newlun); @@ -1304,7 +1304,7 @@ conf_apply(struct conf *oldconf, struct "target %s, " "CTL lun %d", newlun->l_lun, - newtarg->t_iqn, + newtarg->t_name, newlun->l_lun); cumulated_error++; } @@ -1313,11 +1313,11 @@ conf_apply(struct conf *oldconf, struct } } log_debugx("adding lun %d, target %s", - newlun->l_lun, newtarg->t_iqn); + newlun->l_lun, newtarg->t_name); error = kernel_lun_add(newlun); if (error != 0) { log_warnx("failed to add lun %d, target %s", - newlun->l_lun, newtarg->t_iqn); + newlun->l_lun, newtarg->t_name); cumulated_error++; } } Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:08:35 2014 (r263722) +++ stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:10:30 2014 (r263723) @@ -131,7 +131,7 @@ struct target { struct conf *t_conf; struct auth_group *t_auth_group; struct portal_group *t_portal_group; - char *t_iqn; + char *t_name; char *t_alias; }; @@ -224,10 +224,10 @@ struct portal_group *portal_group_find(s int portal_group_add_listen(struct portal_group *pg, const char *listen, bool iser); -struct target *target_new(struct conf *conf, const char *iqn); +struct target *target_new(struct conf *conf, const char *name); void target_delete(struct target *target); struct target *target_find(struct conf *conf, - const char *iqn); + const char *name); struct lun *lun_new(struct target *target, int lun_id); void lun_delete(struct lun *lun); Modified: stable/10/usr.sbin/ctld/discovery.c ============================================================================== --- stable/10/usr.sbin/ctld/discovery.c Tue Mar 25 12:08:35 2014 (r263722) +++ stable/10/usr.sbin/ctld/discovery.c Tue Mar 25 12:10:30 2014 (r263723) @@ -186,10 +186,10 @@ discovery(struct connection *conn) conn->conn_portal->p_portal_group) { log_debugx("not returning target \"%s\"; " "belongs to a different portal group", - targ->t_iqn); + targ->t_name); continue; } - keys_add(response_keys, "TargetName", targ->t_iqn); + keys_add(response_keys, "TargetName", targ->t_name); } } else { targ = target_find(conn->conn_portal->p_portal_group->pg_conf, @@ -198,7 +198,7 @@ discovery(struct connection *conn) log_debugx("initiator requested information on unknown " "target \"%s\"; returning nothing", send_targets); } else { - keys_add(response_keys, "TargetName", targ->t_iqn); + keys_add(response_keys, "TargetName", targ->t_name); } } keys_save(response_keys, response); Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Tue Mar 25 12:08:35 2014 (r263722) +++ stable/10/usr.sbin/ctld/kernel.c Tue Mar 25 12:10:30 2014 (r263723) @@ -352,7 +352,7 @@ retry: log_warnx("found CTL lun %ju, backing lun %d, target " "%s, also backed by CTL lun %d; ignoring", (uintmax_t) lun->lun_id, cl->l_lun, - cl->l_target->t_iqn, cl->l_ctl_lun); + cl->l_target->t_name, cl->l_ctl_lun); continue; } @@ -382,7 +382,7 @@ retry: log_warnx("unable to add CTL lun option %s " "for CTL lun %ju for lun %d, target %s", nv->name, (uintmax_t) lun->lun_id, - cl->l_lun, cl->l_target->t_iqn); + cl->l_lun, cl->l_target->t_name); } } @@ -434,10 +434,10 @@ kernel_lun_add(struct lun *lun) lo = lun_option_find(lun, "cfiscsi_target"); if (lo != NULL) { - lun_option_set(lo, lun->l_target->t_iqn); + lun_option_set(lo, lun->l_target->t_name); } else { lo = lun_option_new(lun, "cfiscsi_target", - lun->l_target->t_iqn); + lun->l_target->t_name); assert(lo != NULL); } @@ -598,7 +598,7 @@ kernel_handoff(struct connection *conn) conn->conn_initiator_alias, sizeof(req.data.handoff.initiator_alias)); } strlcpy(req.data.handoff.target_name, - conn->conn_target->t_iqn, sizeof(req.data.handoff.target_name)); + conn->conn_target->t_name, sizeof(req.data.handoff.target_name)); req.data.handoff.socket = conn->conn_socket; req.data.handoff.portal_group_tag = conn->conn_portal->p_portal_group->pg_tag; Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:08:35 2014 (r263722) +++ stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:10:30 2014 (r263723) @@ -922,11 +922,11 @@ login(struct connection *conn) if (ag->ag_name != NULL) { log_debugx("initiator requests to connect " "to target \"%s\"; auth-group \"%s\"", - conn->conn_target->t_iqn, + conn->conn_target->t_name, conn->conn_target->t_auth_group->ag_name); } else { log_debugx("initiator requests to connect " - "to target \"%s\"", conn->conn_target->t_iqn); + "to target \"%s\"", conn->conn_target->t_name); } } else { assert(conn->conn_session_type == CONN_SESSION_TYPE_DISCOVERY); Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:08:35 2014 (r263722) +++ stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:10:30 2014 (r263723) @@ -316,7 +316,7 @@ target_alias: ALIAS STR { if (target->t_alias != NULL) { log_warnx("alias for target \"%s\" " - "specified more than once", target->t_iqn); + "specified more than once", target->t_name); return (1); } target->t_alias = $2; @@ -328,17 +328,17 @@ target_auth_group: AUTH_GROUP STR if (target->t_auth_group != NULL) { if (target->t_auth_group->ag_name != NULL) log_warnx("auth-group for target \"%s\" " - "specified more than once", target->t_iqn); + "specified more than once", target->t_name); else log_warnx("cannot mix auth-group with explicit " "authorisations for target \"%s\"", - target->t_iqn); + target->t_name); return (1); } target->t_auth_group = auth_group_find(conf, $2); if (target->t_auth_group == NULL) { log_warnx("unknown auth-group \"%s\" for target " - "\"%s\"", $2, target->t_iqn); + "\"%s\"", $2, target->t_name); return (1); } free($2); @@ -353,7 +353,7 @@ target_chap: CHAP STR STR if (target->t_auth_group->ag_name != NULL) { log_warnx("cannot mix auth-group with explicit " "authorisations for target \"%s\"", - target->t_iqn); + target->t_name); free($2); free($3); return (1); @@ -383,7 +383,7 @@ target_chap_mutual: CHAP_MUTUAL STR STR if (target->t_auth_group->ag_name != NULL) { log_warnx("cannot mix auth-group with explicit " "authorisations for target \"%s\"", - target->t_iqn); + target->t_name); free($2); free($3); free($4); @@ -420,7 +420,7 @@ target_initiator_name: INITIATOR_NAME ST if (target->t_auth_group->ag_name != NULL) { log_warnx("cannot mix auth-group with " "initiator-name for target \"%s\"", - target->t_iqn); + target->t_name); free($2); return (1); } @@ -447,7 +447,7 @@ target_initiator_portal: INITIATOR_PORTA if (target->t_auth_group->ag_name != NULL) { log_warnx("cannot mix auth-group with " "initiator-portal for target \"%s\"", - target->t_iqn); + target->t_name); free($2); return (1); } @@ -470,14 +470,14 @@ target_portal_group: PORTAL_GROUP STR { if (target->t_portal_group != NULL) { log_warnx("portal-group for target \"%s\" " - "specified more than once", target->t_iqn); + "specified more than once", target->t_name); free($2); return (1); } target->t_portal_group = portal_group_find(conf, $2); if (target->t_portal_group == NULL) { log_warnx("unknown portal-group \"%s\" for target " - "\"%s\"", $2, target->t_iqn); + "\"%s\"", $2, target->t_name); free($2); return (1); } @@ -526,7 +526,7 @@ lun_backend: BACKEND STR if (lun->l_backend != NULL) { log_warnx("backend for lun %d, target \"%s\" " "specified more than once", - lun->l_lun, target->t_iqn); + lun->l_lun, target->t_name); free($2); return (1); } @@ -540,7 +540,7 @@ lun_blocksize: BLOCKSIZE NUM if (lun->l_blocksize != 0) { log_warnx("blocksize for lun %d, target \"%s\" " "specified more than once", - lun->l_lun, target->t_iqn); + lun->l_lun, target->t_name); return (1); } lun_set_blocksize(lun, $2); @@ -552,7 +552,7 @@ lun_device_id: DEVICE_ID STR if (lun->l_device_id != NULL) { log_warnx("device_id for lun %d, target \"%s\" " "specified more than once", - lun->l_lun, target->t_iqn); + lun->l_lun, target->t_name); free($2); return (1); } @@ -578,7 +578,7 @@ lun_path: PATH STR if (lun->l_path != NULL) { log_warnx("path for lun %d, target \"%s\" " "specified more than once", - lun->l_lun, target->t_iqn); + lun->l_lun, target->t_name); free($2); return (1); } @@ -592,7 +592,7 @@ lun_serial: SERIAL STR if (lun->l_serial != NULL) { log_warnx("serial for lun %d, target \"%s\" " "specified more than once", - lun->l_lun, target->t_iqn); + lun->l_lun, target->t_name); free($2); return (1); } @@ -606,7 +606,7 @@ lun_size: SIZE NUM if (lun->l_size != 0) { log_warnx("size for lun %d, target \"%s\" " "specified more than once", - lun->l_lun, target->t_iqn); + lun->l_lun, target->t_name); return (1); } lun_set_size(lun, $2); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:12:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AD2BC69A; Tue, 25 Mar 2014 12:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C46B257; Tue, 25 Mar 2014 12:12: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 s2PCCcaU072398; Tue, 25 Mar 2014 12:12:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCCb7A072391; Tue, 25 Mar 2014 12:12:37 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251212.s2PCCb7A072391@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263724 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:12:38 -0000 Author: trasz Date: Tue Mar 25 12:12:37 2014 New Revision: 263724 URL: http://svnweb.freebsd.org/changeset/base/263724 Log: MFC r261758: Add auth-type. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctl.conf.5 stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/parse.y stable/10/usr.sbin/ctld/token.l Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Tue Mar 25 12:10:30 2014 (r263723) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Tue Mar 25 12:12:37 2014 (r263724) @@ -101,6 +101,11 @@ Setting it to 0 disables the timeout. .Ss auth-group level The following statements are available at the auth-group level: .Bl -tag -width indent +.It Ic auth-type Ao Ar type Ac +Specifies authentication type. +Type can be either "none", "chap", or "chap-mutual". +In most cases it is not neccessary 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 @@ -147,6 +152,13 @@ There is no default; every target must u or chap, or chap-mutual statements. A special auth-group, "no-authentication", may be used to permit access without authentication. +.It Ic auth-type Ao Ar type Ac +Specifies authentication type. +Type can be either "none", "chap", or "chap-mutual". +In most cases it is not neccessary 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, Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:10:30 2014 (r263723) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:12:37 2014 (r263724) @@ -417,6 +417,58 @@ auth_group_find(struct conf *conf, const return (NULL); } +static int +auth_group_set_type(struct auth_group *ag, int type) +{ + + if (ag->ag_type == AG_TYPE_UNKNOWN) { + ag->ag_type = type; + return (0); + } + + if (ag->ag_type == type) + return (0); + + return (1); +} + +int +auth_group_set_type_str(struct auth_group *ag, const char *str) +{ + int error, type; + + if (strcmp(str, "none") == 0) { + type = AG_TYPE_NO_AUTHENTICATION; + } else if (strcmp(str, "chap") == 0) { + type = AG_TYPE_CHAP; + } else if (strcmp(str, "chap-mutual") == 0) { + type = AG_TYPE_CHAP_MUTUAL; + } else { + if (ag->ag_name != NULL) + log_warnx("invalid auth-type \"%s\" for auth-group " + "\"%s\"", str, ag->ag_name); + else + log_warnx("invalid auth-type \"%s\" for target " + "\"%s\"", str, ag->ag_target->t_name); + return (1); + } + + error = auth_group_set_type(ag, type); + if (error != 0) { + if (ag->ag_name != NULL) + log_warnx("cannot set auth-type to \"%s\" for " + "auth-group \"%s\"; already has a different " + "type", str, ag->ag_name); + else + log_warnx("cannot set auth-type to \"%s\" for target " + "\"%s\"; already has a different type", + str, ag->ag_target->t_name); + return (1); + } + + return (error); +} + static struct portal * portal_new(struct portal_group *pg) { Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:10:30 2014 (r263723) +++ stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:12:37 2014 (r263724) @@ -197,6 +197,8 @@ int conf_verify(struct conf *conf); struct auth_group *auth_group_new(struct conf *conf, const char *name); void auth_group_delete(struct auth_group *ag); struct auth_group *auth_group_find(struct conf *conf, const char *name); +int auth_group_set_type_str(struct auth_group *ag, + const char *type); const struct auth *auth_new_chap(struct auth_group *ag, const char *user, const char *secret); Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:10:30 2014 (r263723) +++ stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:12:37 2014 (r263724) @@ -57,10 +57,10 @@ extern void yyrestart(FILE *); %} -%token ALIAS AUTH_GROUP BACKEND BLOCKSIZE CHAP CHAP_MUTUAL CLOSING_BRACKET -%token DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP INITIATOR_NAME INITIATOR_PORTAL -%token LISTEN LISTEN_ISER LUN MAXPROC NUM OPENING_BRACKET OPTION PATH PIDFILE -%token PORTAL_GROUP SERIAL SIZE STR TARGET TIMEOUT +%token ALIAS AUTH_GROUP AUTH_TYPE BACKEND BLOCKSIZE CHAP CHAP_MUTUAL +%token CLOSING_BRACKET DEBUG DEVICE_ID DISCOVERY_AUTH_GROUP INITIATOR_NAME +%token INITIATOR_PORTAL LISTEN LISTEN_ISER LUN MAXPROC NUM OPENING_BRACKET +%token OPTION PATH PIDFILE PORTAL_GROUP SERIAL SIZE STR TARGET TIMEOUT %union { @@ -145,6 +145,8 @@ auth_group_entries: ; auth_group_entry: + auth_group_auth_type + | auth_group_chap | auth_group_chap_mutual @@ -154,6 +156,17 @@ auth_group_entry: auth_group_initiator_portal ; +auth_group_auth_type: AUTH_TYPE STR + { + int error; + + error = auth_group_set_type_str(auth_group, $2); + free($2); + if (error != 0) + return (1); + } + ; + auth_group_chap: CHAP STR STR { const struct auth *ca; @@ -299,6 +312,8 @@ target_entry: | target_auth_group | + target_auth_type + | target_chap | target_chap_mutual @@ -330,7 +345,7 @@ target_auth_group: AUTH_GROUP STR log_warnx("auth-group for target \"%s\" " "specified more than once", target->t_name); else - log_warnx("cannot mix auth-group with explicit " + log_warnx("cannot use both auth-group and explicit " "authorisations for target \"%s\"", target->t_name); return (1); @@ -345,14 +360,40 @@ target_auth_group: AUTH_GROUP STR } ; +target_auth_type: AUTH_TYPE STR + { + int error; + + if (target->t_auth_group != NULL) { + if (target->t_auth_group->ag_name != NULL) { + log_warnx("cannot use both auth-group and " + "auth-type for target \"%s\"", + target->t_name); + return (1); + } + } else { + target->t_auth_group = auth_group_new(conf, NULL); + if (target->t_auth_group == NULL) { + free($2); + return (1); + } + target->t_auth_group->ag_target = target; + } + error = auth_group_set_type_str(target->t_auth_group, $2); + free($2); + if (error != 0) + return (1); + } + ; + target_chap: CHAP STR STR { const struct auth *ca; if (target->t_auth_group != NULL) { if (target->t_auth_group->ag_name != NULL) { - log_warnx("cannot mix auth-group with explicit " - "authorisations for target \"%s\"", + log_warnx("cannot use both auth-group and " + "chap for target \"%s\"", target->t_name); free($2); free($3); @@ -381,8 +422,8 @@ target_chap_mutual: CHAP_MUTUAL STR STR if (target->t_auth_group != NULL) { if (target->t_auth_group->ag_name != NULL) { - log_warnx("cannot mix auth-group with explicit " - "authorisations for target \"%s\"", + log_warnx("cannot use both auth-group and " + "chap-mutual for target \"%s\"", target->t_name); free($2); free($3); @@ -418,7 +459,7 @@ target_initiator_name: INITIATOR_NAME ST if (target->t_auth_group != NULL) { if (target->t_auth_group->ag_name != NULL) { - log_warnx("cannot mix auth-group with " + log_warnx("cannot use both auth-group and " "initiator-name for target \"%s\"", target->t_name); free($2); @@ -445,7 +486,7 @@ target_initiator_portal: INITIATOR_PORTA if (target->t_auth_group != NULL) { if (target->t_auth_group->ag_name != NULL) { - log_warnx("cannot mix auth-group with " + log_warnx("cannot use both auth-group and " "initiator-portal for target \"%s\"", target->t_name); free($2); Modified: stable/10/usr.sbin/ctld/token.l ============================================================================== --- stable/10/usr.sbin/ctld/token.l Tue Mar 25 12:10:30 2014 (r263723) +++ stable/10/usr.sbin/ctld/token.l Tue Mar 25 12:12:37 2014 (r263724) @@ -50,6 +50,7 @@ extern int yylex(void); %% alias { return ALIAS; } auth-group { return AUTH_GROUP; } +auth-type { return AUTH_TYPE; } backend { return BACKEND; } blocksize { return BLOCKSIZE; } chap { return CHAP; } From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:14:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DB62C7EC; Tue, 25 Mar 2014 12:14: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE02B26E; Tue, 25 Mar 2014 12:14: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 s2PCEmDv072680; Tue, 25 Mar 2014 12:14:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCEmtq072678; Tue, 25 Mar 2014 12:14:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251214.s2PCEmtq072678@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263725 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:14:48 -0000 Author: trasz Date: Tue Mar 25 12:14:48 2014 New Revision: 263725 URL: http://svnweb.freebsd.org/changeset/base/263725 Log: MFC r261759: Make it possible to redefine portal-group "default". Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:12:37 2014 (r263724) +++ stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:14:48 2014 (r263725) @@ -146,6 +146,9 @@ struct conf { uint16_t conf_last_portal_group_tag; struct pidfh *conf_pidfh; + + bool conf_default_pg_defined; + bool conf_default_ag_defined; }; #define CONN_SESSION_TYPE_NONE 0 Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:12:37 2014 (r263724) +++ stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:14:48 2014 (r263725) @@ -224,7 +224,17 @@ portal_group: PORTAL_GROUP portal_group_ portal_group_name: STR { - portal_group = portal_group_new(conf, $1); + /* + * Make it possible to redefine default + * portal-group. but only once. + */ + if (strcmp($1, "default") == 0 && + conf->conf_default_pg_defined == false) { + portal_group = portal_group_find(conf, $1); + conf->conf_default_pg_defined = true; + } else { + portal_group = portal_group_new(conf, $1); + } free($1); if (portal_group == NULL) return (1); @@ -703,6 +713,7 @@ conf_new_from_file(const char *path) conf = conf_new(); ag = auth_group_new(conf, "no-authentication"); + assert(ag != NULL); ag->ag_type = AG_TYPE_NO_AUTHENTICATION; /* @@ -710,11 +721,11 @@ conf_new_from_file(const char *path) * any entries and thus will always deny access. */ ag = auth_group_new(conf, "no-access"); + assert(ag != NULL); ag->ag_type = AG_TYPE_CHAP; pg = portal_group_new(conf, "default"); - portal_group_add_listen(pg, "0.0.0.0:3260", false); - portal_group_add_listen(pg, "[::]:3260", false); + assert(pg != NULL); yyin = fopen(path, "r"); if (yyin == NULL) { @@ -736,6 +747,15 @@ conf_new_from_file(const char *path) return (NULL); } + if (conf->conf_default_pg_defined == false) { + log_debugx("portal-group \"default\" not defined; " + "going with defaults"); + pg = portal_group_find(conf, "default"); + assert(pg != NULL); + portal_group_add_listen(pg, "0.0.0.0:3260", false); + portal_group_add_listen(pg, "[::]:3260", false); + } + error = conf_verify(conf); if (error != 0) { conf_delete(conf); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:16:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D0A47B76; Tue, 25 Mar 2014 12:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2D03293; Tue, 25 Mar 2014 12:16: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 s2PCGr2P073060; Tue, 25 Mar 2014 12:16:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCGrwF073058; Tue, 25 Mar 2014 12:16:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251216.s2PCGrwF073058@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263726 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:16:53 -0000 Author: trasz Date: Tue Mar 25 12:16:52 2014 New Revision: 263726 URL: http://svnweb.freebsd.org/changeset/base/263726 Log: MFC r261760: Add a new auth-group "default", defaulting to deny, and make it possible to redefine it. From now on, assigning auth-group to a target is no longer mandatory. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:14:48 2014 (r263725) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:16:52 2014 (r263726) @@ -1105,10 +1105,9 @@ conf_verify(struct conf *conf) TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { if (targ->t_auth_group == NULL) { - log_warnx("missing authentication for target \"%s\"; " - "must specify either \"auth-group\", \"chap\", " - "or \"chap-mutual\"", targ->t_name); - return (1); + targ->t_auth_group = auth_group_find(conf, + "default"); + assert(targ->t_auth_group != NULL); } if (targ->t_portal_group == NULL) { targ->t_portal_group = portal_group_find(conf, Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:14:48 2014 (r263725) +++ stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:16:52 2014 (r263726) @@ -132,7 +132,17 @@ auth_group: AUTH_GROUP auth_group_name auth_group_name: STR { - auth_group = auth_group_new(conf, $1); + /* + * Make it possible to redefine default + * auth-group. but only once. + */ + if (strcmp($1, "default") == 0 && + conf->conf_default_ag_defined == false) { + auth_group = auth_group_find(conf, $1); + conf->conf_default_ag_defined = true; + } else { + auth_group = auth_group_new(conf, $1); + } free($1); if (auth_group == NULL) return (1); @@ -712,6 +722,9 @@ conf_new_from_file(const char *path) conf = conf_new(); + ag = auth_group_new(conf, "default"); + assert(ag != NULL); + ag = auth_group_new(conf, "no-authentication"); assert(ag != NULL); ag->ag_type = AG_TYPE_NO_AUTHENTICATION; @@ -747,6 +760,14 @@ conf_new_from_file(const char *path) return (NULL); } + if (conf->conf_default_ag_defined == false) { + log_debugx("auth-group \"default\" not defined; " + "going with defaults"); + ag = auth_group_find(conf, "default"); + assert(ag != NULL); + ag->ag_type = AG_TYPE_CHAP; + } + if (conf->conf_default_pg_defined == false) { log_debugx("portal-group \"default\" not defined; " "going with defaults"); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:18:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3D3D3E24; Tue, 25 Mar 2014 12:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 29C522AC; Tue, 25 Mar 2014 12:18: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 s2PCIcW3073308; Tue, 25 Mar 2014 12:18:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCIcXI073307; Tue, 25 Mar 2014 12:18:38 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251218.s2PCIcXI073307@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263727 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:18:38 -0000 Author: trasz Date: Tue Mar 25 12:18:37 2014 New Revision: 263727 URL: http://svnweb.freebsd.org/changeset/base/263727 Log: MFC r261761: Update manual page to match recent auth-group "default" changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctl.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Tue Mar 25 12:16:52 2014 (r263726) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Tue Mar 25 12:18:37 2014 (r263727) @@ -148,9 +148,10 @@ Assigns human-readable description to th There is no default. .It Ic auth-group Aq Ar name Assigns previously defined authentication group to that target. -There is no default; every target must use either auth-group, -or chap, or chap-mutual statements. -A special auth-group, "no-authentication", may be used to permit access +By default, targets that do not specify their own auth settings, +using clauses such as "chap" or "initiator-name", are assigned +predefined auth-group "default", which denies all access. +Another predefined auth-group, "no-authentication", may be used to permit access without authentication. .It Ic auth-type Ao Ar type Ac Specifies authentication type. From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:20:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 408D1F75; Tue, 25 Mar 2014 12:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 132852BA; Tue, 25 Mar 2014 12:20: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 s2PCKTWP073938; Tue, 25 Mar 2014 12:20:29 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCKT8c073936; Tue, 25 Mar 2014 12:20:29 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251220.s2PCKT8c073936@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263728 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:20:30 -0000 Author: trasz Date: Tue Mar 25 12:20:29 2014 New Revision: 263728 URL: http://svnweb.freebsd.org/changeset/base/263728 Log: MFC r261762: Use "default" as default discovery-auth-group, instead of "no-access". It doesn't change visible behaviour, as previously auth-group "default" wasn't redefinable, so by default access was always denied. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctl.conf.5 stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Tue Mar 25 12:18:37 2014 (r263727) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Tue Mar 25 12:20:29 2014 (r263728) @@ -131,9 +131,11 @@ The following statements are available a .It Ic discovery-auth-group Aq Ar name Assigns previously defined authentication group to that portal group, to be used for target discovery. -By default, the discovery will be denied. -A special auth-group, "no-authentication", may be used to allow for discovery -without authentication. +By default, portal groups that do not specify their own auth settings, +using clauses such as "chap" or "initiator-name", are assigned +predefined auth-group "default", which denies discovery. +Another predefined auth-group, "no-authentication", may be used +to permit discovery without authentication. .It Ic listen Aq Ar address Specifies IPv4 or IPv6 address and port to listen on for incoming connections. .It Ic listen-iser Aq Ar address Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:18:37 2014 (r263727) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:20:29 2014 (r263728) @@ -1132,7 +1132,7 @@ conf_verify(struct conf *conf) assert(pg->pg_name != NULL); if (pg->pg_discovery_auth_group == NULL) { pg->pg_discovery_auth_group = - auth_group_find(conf, "no-access"); + auth_group_find(conf, "default"); assert(pg->pg_discovery_auth_group != NULL); } @@ -1159,6 +1159,7 @@ conf_verify(struct conf *conf) break; } if (targ == NULL && ag->ag_name != NULL && + strcmp(ag->ag_name, "default") != 0 && strcmp(ag->ag_name, "no-authentication") != 0 && strcmp(ag->ag_name, "no-access") != 0) { log_warnx("auth-group \"%s\" not assigned " From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:22:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8891616A; Tue, 25 Mar 2014 12:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73AEA34F; Tue, 25 Mar 2014 12:22:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PCMV3P076767; Tue, 25 Mar 2014 12:22:31 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCMU9H076758; Tue, 25 Mar 2014 12:22:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251222.s2PCMU9H076758@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263729 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:22:31 -0000 Author: trasz Date: Tue Mar 25 12:22:30 2014 New Revision: 263729 URL: http://svnweb.freebsd.org/changeset/base/263729 Log: MFC r261763: Use new auth-type "deny" instead of using "chap" with no chap entries; it's cleaner this way, and gives better feedback to the user. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctl.conf.5 stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/login.c stable/10/usr.sbin/ctld/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Tue Mar 25 12:20:29 2014 (r263728) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Tue Mar 25 12:22:30 2014 (r263729) @@ -103,7 +103,7 @@ The following statements are available a .Bl -tag -width indent .It Ic auth-type Ao Ar type Ac Specifies authentication type. -Type can be either "none", "chap", or "chap-mutual". +Type can be either "none", "deny", "chap", or "chap-mutual". In most cases it is not neccessary 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 @@ -157,7 +157,7 @@ Another predefined auth-group, "no-authe without authentication. .It Ic auth-type Ao Ar type Ac Specifies authentication type. -Type can be either "none", "chap", or "chap-mutual". +Type can be either "none", "deny", "chap", or "chap-mutual". In most cases it is not neccessary 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 Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:20:29 2014 (r263728) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:22:30 2014 (r263729) @@ -439,6 +439,8 @@ auth_group_set_type_str(struct auth_grou if (strcmp(str, "none") == 0) { type = AG_TYPE_NO_AUTHENTICATION; + } else if (strcmp(str, "deny") == 0) { + type = AG_TYPE_DENY; } else if (strcmp(str, "chap") == 0) { type = AG_TYPE_CHAP; } else if (strcmp(str, "chap-mutual") == 0) { Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:20:29 2014 (r263728) +++ stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:22:30 2014 (r263729) @@ -66,9 +66,10 @@ struct auth_portal { }; #define AG_TYPE_UNKNOWN 0 -#define AG_TYPE_NO_AUTHENTICATION 1 -#define AG_TYPE_CHAP 2 -#define AG_TYPE_CHAP_MUTUAL 3 +#define AG_TYPE_DENY 1 +#define AG_TYPE_NO_AUTHENTICATION 2 +#define AG_TYPE_CHAP 3 +#define AG_TYPE_CHAP_MUTUAL 4 struct auth_group { TAILQ_ENTRY(auth_group) ag_next; Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:20:29 2014 (r263728) +++ stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:22:30 2014 (r263729) @@ -1034,6 +1034,11 @@ login(struct connection *conn) return; } + if (ag->ag_type == AG_TYPE_DENY) { + login_send_error(request, 0x02, 0x01); + log_errx(1, "auth-group type is \"deny\""); + } + if (ag->ag_type == AG_TYPE_UNKNOWN) { /* * This can happen with empty auth-group. Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:20:29 2014 (r263728) +++ stable/10/usr.sbin/ctld/parse.y Tue Mar 25 12:22:30 2014 (r263729) @@ -729,13 +729,9 @@ conf_new_from_file(const char *path) assert(ag != NULL); ag->ag_type = AG_TYPE_NO_AUTHENTICATION; - /* - * Here, the type doesn't really matter, as the group doesn't contain - * any entries and thus will always deny access. - */ ag = auth_group_new(conf, "no-access"); assert(ag != NULL); - ag->ag_type = AG_TYPE_CHAP; + ag->ag_type = AG_TYPE_DENY; pg = portal_group_new(conf, "default"); assert(pg != NULL); @@ -765,7 +761,7 @@ conf_new_from_file(const char *path) "going with defaults"); ag = auth_group_find(conf, "default"); assert(ag != NULL); - ag->ag_type = AG_TYPE_CHAP; + ag->ag_type = AG_TYPE_DENY; } if (conf->conf_default_pg_defined == false) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:24:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C12D52C7; Tue, 25 Mar 2014 12:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD78C35A; Tue, 25 Mar 2014 12:24: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 s2PCOIVJ077019; Tue, 25 Mar 2014 12:24:18 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCOIVl077018; Tue, 25 Mar 2014 12:24:18 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251224.s2PCOIVl077018@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263730 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:24:18 -0000 Author: trasz Date: Tue Mar 25 12:24:18 2014 New Revision: 263730 URL: http://svnweb.freebsd.org/changeset/base/263730 Log: MFC r261764: So, it turns out SIGCHLD is discarded by default, so we have to set up a dummy handler to make it interrupt an ioctl(2) or select(2). This makes those short-lived ctld(8) zombies disappear. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:22:30 2014 (r263729) +++ stable/10/usr.sbin/ctld/ctld.c Tue Mar 25 12:24:18 2014 (r263730) @@ -1742,6 +1742,17 @@ sigterm_handler(int dummy __unused) } static void +sigchld_handler(int dummy __unused) +{ + + /* + * The only purpose of this handler is to make SIGCHLD + * interrupt the ISCSIDWAIT ioctl(2), so we can call + * wait_for_children(). + */ +} + +static void register_signals(void) { struct sigaction sa; @@ -1763,6 +1774,11 @@ register_signals(void) error = sigaction(SIGINT, &sa, NULL); if (error != 0) log_err(1, "sigaction"); + + sa.sa_handler = sigchld_handler; + error = sigaction(SIGCHLD, &sa, NULL); + if (error != 0) + log_err(1, "sigaction"); } int From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:26:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 62998455; Tue, 25 Mar 2014 12:26: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4EACE374; Tue, 25 Mar 2014 12:26: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 s2PCQ1mD077295; Tue, 25 Mar 2014 12:26:01 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCQ1XI077294; Tue, 25 Mar 2014 12:26:01 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251226.s2PCQ1XI077294@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263731 - stable/10/usr.bin/rctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:26:01 -0000 Author: trasz Date: Tue Mar 25 12:26:00 2014 New Revision: 263731 URL: http://svnweb.freebsd.org/changeset/base/263731 Log: MFC r261962: Mention that rctl(8) was sponsored by the Foundation. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/rctl/rctl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/rctl/rctl.8 ============================================================================== --- stable/10/usr.bin/rctl/rctl.8 Tue Mar 25 12:24:18 2014 (r263730) +++ stable/10/usr.bin/rctl/rctl.8 Tue Mar 25 12:26:00 2014 (r263731) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2014 +.Dd February 16, 2014 .Dt RCTL 8 .Os .Sh NAME @@ -267,8 +267,9 @@ command appeared in .An -nosplit The .Nm -command was written by -.An Edward Tomasz Napierala Aq trasz@FreeBSD.org . +was developed by +.An Edward Tomasz Napierala Aq trasz@FreeBSD.org +under sponsorship from the FreeBSD Foundation. .Sh BUGS Limiting .Sy memoryuse From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:31:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 236CC82F; Tue, 25 Mar 2014 12:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0E160614; Tue, 25 Mar 2014 12:31: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 s2PCV896078885; Tue, 25 Mar 2014 12:31:08 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCV8N7078884; Tue, 25 Mar 2014 12:31:08 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251231.s2PCV8N7078884@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263732 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:31:09 -0000 Author: trasz Date: Tue Mar 25 12:31:08 2014 New Revision: 263732 URL: http://svnweb.freebsd.org/changeset/base/263732 Log: MFC r261751: The log_whatever() routines don't accept NULL for format strings, so mark them as __printflike instead of__printf0like. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:26:00 2014 (r263731) +++ stable/10/usr.sbin/ctld/ctld.h Tue Mar 25 12:31:08 2014 (r263732) @@ -295,12 +295,12 @@ void log_init(int level); void log_set_peer_name(const char *name); void log_set_peer_addr(const char *addr); void log_err(int, const char *, ...) - __dead2 __printf0like(2, 3); + __dead2 __printflike(2, 3); void log_errx(int, const char *, ...) - __dead2 __printf0like(2, 3); -void log_warn(const char *, ...) __printf0like(1, 2); + __dead2 __printflike(2, 3); +void log_warn(const char *, ...) __printflike(1, 2); void log_warnx(const char *, ...) __printflike(1, 2); -void log_debugx(const char *, ...) __printf0like(1, 2); +void log_debugx(const char *, ...) __printflike(1, 2); char *checked_strdup(const char *); bool valid_iscsi_name(const char *name); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:33:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EF10E98B; Tue, 25 Mar 2014 12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C1783636; Tue, 25 Mar 2014 12: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 s2PCXH8m081243; Tue, 25 Mar 2014 12:33:17 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCXHgI081239; Tue, 25 Mar 2014 12:33:17 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251233.s2PCXHgI081239@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263733 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:33:18 -0000 Author: trasz Date: Tue Mar 25 12:33:16 2014 New Revision: 263733 URL: http://svnweb.freebsd.org/changeset/base/263733 Log: MFC r261752: Empty data segment during Login Phase is rather unlikely, but it's not, by itself, a protocol error. This fixes interoperability with OpenBSD initiator. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/discovery.c stable/10/usr.sbin/ctld/keys.c stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/discovery.c ============================================================================== --- stable/10/usr.sbin/ctld/discovery.c Tue Mar 25 12:31:08 2014 (r263732) +++ stable/10/usr.sbin/ctld/discovery.c Tue Mar 25 12:33:16 2014 (r263733) @@ -61,9 +61,6 @@ text_receive(struct connection *conn) */ if ((bhstr->bhstr_flags & BHSTR_FLAGS_CONTINUE) != 0) log_errx(1, "received Text PDU with unsupported \"C\" flag"); - if (request->pdu_data_len == 0) - log_errx(1, "received Text PDU with empty data segment"); - if (ntohl(bhstr->bhstr_cmdsn) < conn->conn_cmdsn) { log_errx(1, "received Text PDU with decreasing CmdSN: " "was %d, is %d", conn->conn_cmdsn, ntohl(bhstr->bhstr_cmdsn)); Modified: stable/10/usr.sbin/ctld/keys.c ============================================================================== --- stable/10/usr.sbin/ctld/keys.c Tue Mar 25 12:31:08 2014 (r263732) +++ stable/10/usr.sbin/ctld/keys.c Tue Mar 25 12:33:16 2014 (r263733) @@ -64,7 +64,7 @@ keys_load(struct keys *keys, const struc size_t pair_len; if (pdu->pdu_data_len == 0) - log_errx(1, "protocol error: empty data segment"); + return; if (pdu->pdu_data[pdu->pdu_data_len - 1] != '\0') log_errx(1, "protocol error: key not NULL-terminated\n"); Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:31:08 2014 (r263732) +++ stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:33:16 2014 (r263733) @@ -128,10 +128,6 @@ login_receive(struct connection *conn, b log_errx(1, "received Login PDU with unsupported " "Version-min 0x%x", bhslr->bhslr_version_min); } - if (request->pdu_data_len == 0) { - login_send_error(request, 0x02, 0x00); - log_errx(1, "received Login PDU with empty data segment"); - } if (ntohl(bhslr->bhslr_cmdsn) < conn->conn_cmdsn) { login_send_error(request, 0x02, 0x05); log_errx(1, "received Login PDU with decreasing CmdSN: " From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 12:38:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D0B0BBB0; Tue, 25 Mar 2014 12:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD019688; Tue, 25 Mar 2014 12:38:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PCchpY081886; Tue, 25 Mar 2014 12:38:43 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PCch3N081885; Tue, 25 Mar 2014 12:38:43 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251238.s2PCch3N081885@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 12:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263734 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 12:38:43 -0000 Author: trasz Date: Tue Mar 25 12:38:43 2014 New Revision: 263734 URL: http://svnweb.freebsd.org/changeset/base/263734 Log: MFC r263356: Make the error message more clear. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:33:16 2014 (r263733) +++ stable/10/usr.sbin/ctld/login.c Tue Mar 25 12:38:43 2014 (r263734) @@ -1032,7 +1032,7 @@ login(struct connection *conn) if (ag->ag_type == AG_TYPE_DENY) { login_send_error(request, 0x02, 0x01); - log_errx(1, "auth-group type is \"deny\""); + log_errx(1, "auth-type is \"deny\""); } if (ag->ag_type == AG_TYPE_UNKNOWN) { @@ -1040,7 +1040,7 @@ login(struct connection *conn) * This can happen with empty auth-group. */ login_send_error(request, 0x02, 0x01); - log_errx(1, "auth-group type not set, denying access"); + log_errx(1, "auth-type not set, denying access"); } log_debugx("CHAP authentication required"); From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 13:18:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6B1D8971; Tue, 25 Mar 2014 13:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 568CFA4A; Tue, 25 Mar 2014 13:18: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 s2PDIAa5098462; Tue, 25 Mar 2014 13:18:10 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PDIAlJ098461; Tue, 25 Mar 2014 13:18:10 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251318.s2PDIAlJ098461@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 13:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263735 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 13:18:10 -0000 Author: trasz Date: Tue Mar 25 13:18:09 2014 New Revision: 263735 URL: http://svnweb.freebsd.org/changeset/base/263735 Log: MFC 262782: Fix missing unlock in persistent reservations code, which resulted in panics with Hyper-V Failover Cluster. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Mar 25 12:38:43 2014 (r263734) +++ stable/10/sys/cam/ctl/ctl.c Tue Mar 25 13:18:09 2014 (r263735) @@ -8071,6 +8071,7 @@ ctl_persistent_reserve_out(struct ctl_sc ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } + mtx_unlock(&softc->ctl_lock); } else /* create a reservation */ { /* * If it's not an "all registrants" type record From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 20:16:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DF25E429; Tue, 25 Mar 2014 20:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB6CCEAE; Tue, 25 Mar 2014 20:16: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 s2PKGSO3073213; Tue, 25 Mar 2014 20:16:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PKGSiv073212; Tue, 25 Mar 2014 20:16:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403252016.s2PKGSiv073212@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Mar 2014 20:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263746 - stable/10/sys/x86/iommu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 20:16:29 -0000 Author: kib Date: Tue Mar 25 20:16:28 2014 New Revision: 263746 URL: http://svnweb.freebsd.org/changeset/base/263746 Log: MFC r263305: Provide a workaround by identity mapping the 32 pages after the bogus entry start, which seems to be enough for the reported BIOS. Modified: stable/10/sys/x86/iommu/intel_ctx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/intel_ctx.c ============================================================================== --- stable/10/sys/x86/iommu/intel_ctx.c Tue Mar 25 19:28:40 2014 (r263745) +++ stable/10/sys/x86/iommu/intel_ctx.c Tue Mar 25 20:16:28 2014 (r263746) @@ -182,6 +182,15 @@ ctx_init_rmrr(struct dmar_ctx *ctx, devi end = entry->end; entry->start = trunc_page(start); entry->end = round_page(end); + if (entry->start == entry->end) { + /* Workaround for some AMI (?) BIOSes */ + if (bootverbose) { + device_printf(dev, "BIOS bug: dmar%d RMRR " + "region (%jx, %jx) corrected\n", + ctx->dmar->unit, start, end); + } + entry->end += DMAR_PAGE_SIZE * 0x20; + } size = OFF_TO_IDX(entry->end - entry->start); ma = malloc(sizeof(vm_page_t) * size, M_TEMP, M_WAITOK); for (i = 0; i < size; i++) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Mar 25 20:17:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C3623584; Tue, 25 Mar 2014 20:17:58 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A42EDEC4; Tue, 25 Mar 2014 20:17:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PKHwaF073409; Tue, 25 Mar 2014 20:17:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PKHwMG073406; Tue, 25 Mar 2014 20:17:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403252017.s2PKHwMG073406@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Mar 2014 20:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263747 - stable/10/sys/x86/iommu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 20:17:58 -0000 Author: kib Date: Tue Mar 25 20:17:57 2014 New Revision: 263747 URL: http://svnweb.freebsd.org/changeset/base/263747 Log: MFC r263306: Add some support for the PCI(e)-PCI bridges to the Intel VT-d driver. Modified: stable/10/sys/x86/iommu/busdma_dmar.c stable/10/sys/x86/iommu/intel_ctx.c stable/10/sys/x86/iommu/intel_dmar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/iommu/busdma_dmar.c ============================================================================== --- stable/10/sys/x86/iommu/busdma_dmar.c Tue Mar 25 20:16:28 2014 (r263746) +++ stable/10/sys/x86/iommu/busdma_dmar.c Tue Mar 25 20:17:57 2014 (r263747) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -69,15 +70,10 @@ __FBSDID("$FreeBSD$"); */ static bool -dmar_bus_dma_is_dev_disabled(device_t dev) +dmar_bus_dma_is_dev_disabled(int domain, int bus, int slot, int func) { char str[128], *env; - int domain, bus, slot, func; - domain = pci_get_domain(dev); - bus = pci_get_bus(dev); - slot = pci_get_slot(dev); - func = pci_get_function(dev); snprintf(str, sizeof(str), "hw.busdma.pci%d.%d.%d.%d.bounce", domain, bus, slot, func); env = getenv(str); @@ -87,11 +83,119 @@ dmar_bus_dma_is_dev_disabled(device_t de return (true); } +/* + * Given original device, find the requester ID that will be seen by + * the DMAR unit and used for page table lookup. PCI bridges may take + * ownership of transactions from downstream devices, so it may not be + * the same as the BSF of the target device. In those cases, all + * devices downstream of the bridge must share a single mapping + * domain, and must collectively be assigned to use either DMAR or + * bounce mapping. + */ +static device_t +dmar_get_requester(device_t dev, int *bus, int *slot, int *func) +{ + devclass_t pci_class; + device_t pci, pcib, requester; + int cap_offset; + + pci_class = devclass_find("pci"); + requester = dev; + + *bus = pci_get_bus(dev); + *slot = pci_get_slot(dev); + *func = pci_get_function(dev); + + /* + * Walk the bridge hierarchy from the target device to the + * host port to find the translating bridge nearest the DMAR + * unit. + */ + for (;;) { + pci = device_get_parent(dev); + KASSERT(pci != NULL, ("NULL parent for pci%d:%d:%d:%d", + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev))); + KASSERT(device_get_devclass(pci) == pci_class, + ("Non-pci parent for pci%d:%d:%d:%d", + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev))); + + pcib = device_get_parent(pci); + KASSERT(pcib != NULL, ("NULL bridge for pci%d:%d:%d:%d", + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev))); + + /* + * The parent of our "bridge" isn't another PCI bus, + * so pcib isn't a PCI->PCI bridge but rather a host + * port, and the requester ID won't be translated + * further. + */ + if (device_get_devclass(device_get_parent(pcib)) != pci_class) + break; + + if (pci_find_cap(dev, PCIY_EXPRESS, &cap_offset) != 0) { + /* + * Device is not PCIe, it cannot be seen as a + * requester by DMAR unit. + */ + requester = pcib; + + /* Check whether the bus above is PCIe. */ + if (pci_find_cap(pcib, PCIY_EXPRESS, + &cap_offset) == 0) { + /* + * The current device is not PCIe, but + * the bridge above it is. This is a + * PCIe->PCI bridge. Assume that the + * requester ID will be the secondary + * bus number with slot and function + * set to zero. + * + * XXX: Doesn't handle the case where + * the bridge is PCIe->PCI-X, and the + * bridge will only take ownership of + * requests in some cases. We should + * provide context entries with the + * same page tables for taken and + * non-taken transactions. + */ + *bus = pci_get_bus(dev); + *slot = *func = 0; + } else { + /* + * Neither the device nor the bridge + * above it are PCIe. This is a + * conventional PCI->PCI bridge, which + * will use the bridge's BSF as the + * requester ID. + */ + *bus = pci_get_bus(pcib); + *slot = pci_get_slot(pcib); + *func = pci_get_function(pcib); + } + } + /* + * Do not stop the loop even if the target device is + * PCIe, because it is possible (but unlikely) to have + * a PCI->PCIe bridge somewhere in the hierarchy. + */ + + dev = pcib; + } + return (requester); +} + struct dmar_ctx * dmar_instantiate_ctx(struct dmar_unit *dmar, device_t dev, bool rmrr) { + device_t requester; struct dmar_ctx *ctx; bool disabled; + int bus, slot, func; + + requester = dmar_get_requester(dev, &bus, &slot, &func); /* * If the user requested the IOMMU disabled for the device, we @@ -100,11 +204,11 @@ dmar_instantiate_ctx(struct dmar_unit *d * Instead provide the identity mapping for the device * context. */ - disabled = dmar_bus_dma_is_dev_disabled(dev); - ctx = dmar_get_ctx(dmar, dev, disabled, rmrr); + disabled = dmar_bus_dma_is_dev_disabled(pci_get_domain(dev), bus, + slot, func); + ctx = dmar_get_ctx(dmar, requester, bus, slot, func, disabled, rmrr); if (ctx == NULL) return (NULL); - ctx->ctx_tag.owner = dev; if (disabled) { /* * Keep the first reference on context, release the Modified: stable/10/sys/x86/iommu/intel_ctx.c ============================================================================== --- stable/10/sys/x86/iommu/intel_ctx.c Tue Mar 25 20:16:28 2014 (r263746) +++ stable/10/sys/x86/iommu/intel_ctx.c Tue Mar 25 20:17:57 2014 (r263747) @@ -262,17 +262,15 @@ dmar_ctx_dtr(struct dmar_ctx *ctx, bool } struct dmar_ctx * -dmar_get_ctx(struct dmar_unit *dmar, device_t dev, bool id_mapped, bool rmrr_init) +dmar_get_ctx(struct dmar_unit *dmar, device_t dev, int bus, int slot, int func, + bool id_mapped, bool rmrr_init) { struct dmar_ctx *ctx, *ctx1; dmar_ctx_entry_t *ctxp; struct sf_buf *sf; - int bus, slot, func, error, mgaw; + int error, mgaw; bool enable; - bus = pci_get_bus(dev); - slot = pci_get_slot(dev); - func = pci_get_function(dev); enable = false; TD_PREP_PINNED_ASSERT; DMAR_LOCK(dmar); @@ -356,6 +354,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev ctx = dmar_find_ctx_locked(dmar, bus, slot, func); if (ctx == NULL) { ctx = ctx1; + ctx->ctx_tag.owner = dev; ctx->domain = alloc_unrl(dmar->domids); if (ctx->domain == -1) { DMAR_UNLOCK(dmar); @@ -376,9 +375,11 @@ dmar_get_ctx(struct dmar_unit *dmar, dev LIST_INSERT_HEAD(&dmar->contexts, ctx, link); ctx_id_entry_init(ctx, ctxp); device_printf(dev, - "dmar%d pci%d:%d:%d:%d domain %d mgaw %d agaw %d\n", + "dmar%d pci%d:%d:%d:%d domain %d mgaw %d " + "agaw %d %s-mapped\n", dmar->unit, dmar->segment, bus, slot, - func, ctx->domain, ctx->mgaw, ctx->agaw); + func, ctx->domain, ctx->mgaw, ctx->agaw, + id_mapped ? "id" : "re"); } else { dmar_ctx_dtr(ctx1, true, true); } Modified: stable/10/sys/x86/iommu/intel_dmar.h ============================================================================== --- stable/10/sys/x86/iommu/intel_dmar.h Tue Mar 25 20:16:28 2014 (r263746) +++ stable/10/sys/x86/iommu/intel_dmar.h Tue Mar 25 20:17:57 2014 (r263747) @@ -270,7 +270,7 @@ void ctx_free_pgtbl(struct dmar_ctx *ctx struct dmar_ctx *dmar_instantiate_ctx(struct dmar_unit *dmar, device_t dev, bool rmrr); struct dmar_ctx *dmar_get_ctx(struct dmar_unit *dmar, device_t dev, - bool id_mapped, bool rmrr_init); + int bus, int slot, int func, bool id_mapped, bool rmrr_init); void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); void dmar_free_ctx(struct dmar_ctx *ctx); struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 26 07:32:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2BB43885; Wed, 26 Mar 2014 07:32:07 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1385D2B2; Wed, 26 Mar 2014 07:32:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2Q7W7E9054172; Wed, 26 Mar 2014 07:32:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2Q7VvM5054096; Wed, 26 Mar 2014 07:31:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403260731.s2Q7VvM5054096@svn.freebsd.org> From: Dimitry Andric Date: Wed, 26 Mar 2014 07:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263763 - in stable/10: contrib/compiler-rt/lib contrib/gcc contrib/llvm/include/llvm/MC contrib/llvm/include/llvm/Object contrib/llvm/include/llvm/Support contrib/llvm/lib/CodeGen/AsmP... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 07:32:07 -0000 Author: dim Date: Wed Mar 26 07:31:57 2014 New Revision: 263763 URL: http://svnweb.freebsd.org/changeset/base/263763 Log: MFC r262613: Merge the projects/clang-sparc64 branch back to head. This brings in several updates from the llvm and clang trunks to make the sparc64 backend fully functional. Apart from one patch to sys/sparc64/include/pcpu.h which is still under discussion, this makes it possible to let clang fully build world and kernel for sparc64. Any assistance with testing this on actual sparc64 hardware is greatly appreciated, as there will unavoidably be bugs left. Many thanks go to Roman Divacky for his upstream work on getting the sparc64 backend into shape. MFC r262985: Repair a few minor mismerges from r262261 in the clang-sparc64 project branch. This is also to minimize differences with upstream. Added: stable/10/contrib/llvm/lib/Target/Sparc/AsmParser/ - copied from r262613, head/contrib/llvm/lib/Target/Sparc/AsmParser/ stable/10/contrib/llvm/lib/Target/Sparc/Disassembler/ - copied from r262613, head/contrib/llvm/lib/Target/Sparc/Disassembler/ stable/10/contrib/llvm/lib/Target/Sparc/InstPrinter/ - copied from r262613, head/contrib/llvm/lib/Target/Sparc/InstPrinter/ stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcFixupKinds.h - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcFixupKinds.h stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp - copied, changed from r262613, head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.cpp - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcInstrAliases.td - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/SparcInstrAliases.td stable/10/contrib/llvm/lib/Target/Sparc/SparcMCInstLower.cpp - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/SparcMCInstLower.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcTargetObjectFile.h - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/SparcTargetObjectFile.h stable/10/contrib/llvm/lib/Target/Sparc/SparcTargetStreamer.h - copied unchanged from r262613, head/contrib/llvm/lib/Target/Sparc/SparcTargetStreamer.h stable/10/lib/clang/include/SparcGenAsmMatcher.inc - copied unchanged from r262613, head/lib/clang/include/SparcGenAsmMatcher.inc stable/10/lib/clang/include/SparcGenAsmWriter.inc - copied unchanged from r262613, head/lib/clang/include/SparcGenAsmWriter.inc stable/10/lib/clang/include/SparcGenCallingConv.inc - copied unchanged from r262613, head/lib/clang/include/SparcGenCallingConv.inc stable/10/lib/clang/include/SparcGenCodeEmitter.inc - copied unchanged from r262613, head/lib/clang/include/SparcGenCodeEmitter.inc stable/10/lib/clang/include/SparcGenDAGISel.inc - copied unchanged from r262613, head/lib/clang/include/SparcGenDAGISel.inc stable/10/lib/clang/include/SparcGenDisassemblerTables.inc - copied unchanged from r262613, head/lib/clang/include/SparcGenDisassemblerTables.inc stable/10/lib/clang/include/SparcGenInstrInfo.inc - copied unchanged from r262613, head/lib/clang/include/SparcGenInstrInfo.inc stable/10/lib/clang/include/SparcGenMCCodeEmitter.inc - copied unchanged from r262613, head/lib/clang/include/SparcGenMCCodeEmitter.inc stable/10/lib/clang/include/SparcGenRegisterInfo.inc - copied unchanged from r262613, head/lib/clang/include/SparcGenRegisterInfo.inc stable/10/lib/clang/include/SparcGenSubtargetInfo.inc - copied unchanged from r262613, head/lib/clang/include/SparcGenSubtargetInfo.inc stable/10/lib/clang/libllvmsparcasmparser/ - copied from r262613, head/lib/clang/libllvmsparcasmparser/ stable/10/lib/clang/libllvmsparccodegen/ - copied from r262613, head/lib/clang/libllvmsparccodegen/ stable/10/lib/clang/libllvmsparcdesc/ - copied from r262613, head/lib/clang/libllvmsparcdesc/ stable/10/lib/clang/libllvmsparcdisassembler/ - copied from r262613, head/lib/clang/libllvmsparcdisassembler/ stable/10/lib/clang/libllvmsparcinfo/ - copied from r262613, head/lib/clang/libllvmsparcinfo/ stable/10/lib/clang/libllvmsparcinstprinter/ - copied from r262613, head/lib/clang/libllvmsparcinstprinter/ Deleted: stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h Modified: stable/10/contrib/compiler-rt/lib/absvti2.c stable/10/contrib/compiler-rt/lib/addvti3.c stable/10/contrib/compiler-rt/lib/ashlti3.c stable/10/contrib/compiler-rt/lib/ashrti3.c stable/10/contrib/compiler-rt/lib/clzti2.c stable/10/contrib/compiler-rt/lib/cmpti2.c stable/10/contrib/compiler-rt/lib/ctzti2.c stable/10/contrib/compiler-rt/lib/divti3.c stable/10/contrib/compiler-rt/lib/ffsti2.c stable/10/contrib/compiler-rt/lib/fixdfti.c stable/10/contrib/compiler-rt/lib/fixsfti.c stable/10/contrib/compiler-rt/lib/fixunsdfti.c stable/10/contrib/compiler-rt/lib/fixunssfti.c stable/10/contrib/compiler-rt/lib/fixunsxfti.c stable/10/contrib/compiler-rt/lib/fixxfti.c stable/10/contrib/compiler-rt/lib/floattidf.c stable/10/contrib/compiler-rt/lib/floattisf.c stable/10/contrib/compiler-rt/lib/floattixf.c stable/10/contrib/compiler-rt/lib/floatuntidf.c stable/10/contrib/compiler-rt/lib/floatuntisf.c stable/10/contrib/compiler-rt/lib/floatuntixf.c stable/10/contrib/compiler-rt/lib/int_types.h stable/10/contrib/compiler-rt/lib/lshrti3.c stable/10/contrib/compiler-rt/lib/modti3.c stable/10/contrib/compiler-rt/lib/muloti4.c stable/10/contrib/compiler-rt/lib/multi3.c stable/10/contrib/compiler-rt/lib/mulvti3.c stable/10/contrib/compiler-rt/lib/negti2.c stable/10/contrib/compiler-rt/lib/negvti2.c stable/10/contrib/compiler-rt/lib/parityti2.c stable/10/contrib/compiler-rt/lib/popcountti2.c stable/10/contrib/compiler-rt/lib/subvti3.c stable/10/contrib/compiler-rt/lib/ucmpti2.c stable/10/contrib/compiler-rt/lib/udivmodti4.c stable/10/contrib/compiler-rt/lib/udivti3.c stable/10/contrib/compiler-rt/lib/umodti3.c stable/10/contrib/gcc/longlong.h stable/10/contrib/llvm/include/llvm/MC/MCAsmInfo.h stable/10/contrib/llvm/include/llvm/Object/ELFObjectFile.h stable/10/contrib/llvm/include/llvm/Support/ELF.h stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp stable/10/contrib/llvm/lib/MC/MCObjectFileInfo.cpp stable/10/contrib/llvm/lib/Object/ELF.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp stable/10/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp stable/10/contrib/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.h stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.h stable/10/contrib/llvm/lib/Target/Sparc/Sparc.h stable/10/contrib/llvm/lib/Target/Sparc/Sparc.td stable/10/contrib/llvm/lib/Target/Sparc/SparcAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcCallingConv.td stable/10/contrib/llvm/lib/Target/Sparc/SparcCodeEmitter.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h stable/10/contrib/llvm/lib/Target/Sparc/SparcInstr64Bit.td stable/10/contrib/llvm/lib/Target/Sparc/SparcInstrFormats.td stable/10/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td stable/10/contrib/llvm/lib/Target/Sparc/SparcJITInfo.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcRelocations.h stable/10/contrib/llvm/lib/Target/Sparc/SparcSubtarget.cpp stable/10/contrib/llvm/lib/Target/Sparc/SparcSubtarget.h stable/10/contrib/llvm/tools/clang/lib/Basic/Targets.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp stable/10/lib/clang/Makefile stable/10/lib/clang/clang.build.mk stable/10/lib/clang/include/llvm/Config/AsmParsers.def stable/10/lib/clang/include/llvm/Config/AsmPrinters.def stable/10/lib/clang/include/llvm/Config/Disassemblers.def stable/10/lib/clang/include/llvm/Config/Targets.def stable/10/lib/libc/sparc64/sys/__sparc_utrap_setup.c stable/10/lib/msun/Makefile stable/10/share/mk/bsd.sys.mk stable/10/sys/boot/sparc64/boot1/Makefile stable/10/sys/conf/kern.mk stable/10/sys/dev/esp/esp_sbus.c stable/10/sys/dev/fb/creator.c stable/10/sys/dev/fb/machfb.c stable/10/sys/dev/mk48txx/mk48txx.c stable/10/sys/sparc64/conf/GENERIC stable/10/sys/sparc64/isa/isa.c stable/10/sys/sparc64/pci/firereg.h stable/10/usr.bin/clang/clang/Makefile stable/10/usr.bin/clang/llc/Makefile stable/10/usr.bin/clang/llvm-mc/Makefile stable/10/usr.bin/clang/llvm-objdump/Makefile stable/10/usr.bin/clang/llvm-rtdyld/Makefile stable/10/usr.bin/clang/opt/Makefile stable/10/usr.sbin/eeprom/ofw_options.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/compiler-rt/lib/absvti2.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/absvti2.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/absvti2.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: absolute value */ @@ -30,4 +30,5 @@ __absvti2(ti_int a) return (a ^ s) - s; } -#endif +#endif /* CRT_HAS_128BIT */ + Modified: stable/10/contrib/compiler-rt/lib/addvti3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/addvti3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/addvti3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a + b */ @@ -37,4 +37,4 @@ __addvti3(ti_int a, ti_int b) return s; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/ashlti3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/ashlti3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/ashlti3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a << b */ @@ -42,4 +42,4 @@ __ashlti3(ti_int a, si_int b) return result.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/ashrti3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/ashrti3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/ashrti3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: arithmetic a >> b */ @@ -43,4 +43,4 @@ __ashrti3(ti_int a, si_int b) return result.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/clzti2.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/clzti2.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/clzti2.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: the number of leading 0-bits */ @@ -30,4 +30,4 @@ __clzti2(ti_int a) ((si_int)f & ((si_int)(sizeof(di_int) * CHAR_BIT))); } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/cmpti2.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/cmpti2.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/cmpti2.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: if (a < b) returns 0 * if (a == b) returns 1 @@ -39,4 +39,4 @@ __cmpti2(ti_int a, ti_int b) return 1; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/ctzti2.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/ctzti2.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/ctzti2.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: the number of trailing 0-bits */ @@ -30,4 +30,4 @@ __ctzti2(ti_int a) ((si_int)f & ((si_int)(sizeof(di_int) * CHAR_BIT))); } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/divti3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/divti3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/divti3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); @@ -32,4 +32,4 @@ __divti3(ti_int a, ti_int b) return (__udivmodti4(a, b, (tu_int*)0) ^ s_a) - s_a; /* negate if s_a == -1 */ } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/ffsti2.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/ffsti2.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/ffsti2.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: the index of the least significant 1-bit in a, or * the value zero if a is zero. The least significant bit is index one. @@ -34,4 +34,4 @@ __ffsti2(ti_int a) return __builtin_ctzll(x.s.low) + 1; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/fixdfti.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/fixdfti.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/fixdfti.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a signed long long, rounding toward zero. */ @@ -42,4 +42,4 @@ __fixdfti(double a) return (r ^ s) - s; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/fixsfti.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/fixsfti.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/fixsfti.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a signed long long, rounding toward zero. */ @@ -42,4 +42,4 @@ __fixsfti(float a) return (r ^ s) - s; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/fixunsdfti.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/fixunsdfti.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/fixunsdfti.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a unsigned long long, rounding toward zero. * Negative values all become zero. @@ -44,4 +44,4 @@ __fixunsdfti(double a) return r; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/fixunssfti.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/fixunssfti.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/fixunssfti.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a unsigned long long, rounding toward zero. * Negative values all become zero. @@ -44,4 +44,4 @@ __fixunssfti(float a) return r; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/fixunsxfti.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/fixunsxfti.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/fixunsxfti.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a unsigned long long, rounding toward zero. * Negative values all become zero. @@ -46,4 +46,4 @@ __fixunsxfti(long double a) return r; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/fixxfti.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/fixxfti.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/fixxfti.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a signed long long, rounding toward zero. */ @@ -44,4 +44,4 @@ __fixxfti(long double a) return (r ^ s) - s; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/floattidf.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/floattidf.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/floattidf.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a double, rounding toward even.*/ @@ -82,4 +82,4 @@ __floattidf(ti_int a) return fb.f; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/floattisf.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/floattisf.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/floattisf.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a float, rounding toward even. */ @@ -81,4 +81,4 @@ __floattisf(ti_int a) return fb.f; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/floattixf.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/floattixf.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/floattixf.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a long double, rounding toward even. */ @@ -47,7 +47,7 @@ __floattixf(ti_int a) * P = bit LDBL_MANT_DIG-1 bits to the right of 1 * Q = bit LDBL_MANT_DIG bits to the right of 1 * R = "or" of all bits to the right of Q - */ + */ switch (sd) { case LDBL_MANT_DIG + 1: @@ -83,4 +83,4 @@ __floattixf(ti_int a) return fb.f; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/floatuntidf.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/floatuntidf.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/floatuntidf.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a double, rounding toward even. */ @@ -43,7 +43,7 @@ __floatuntidf(tu_int a) * P = bit DBL_MANT_DIG-1 bits to the right of 1 * Q = bit DBL_MANT_DIG bits to the right of 1 * R = "or" of all bits to the right of Q - */ + */ switch (sd) { case DBL_MANT_DIG + 1: @@ -79,4 +79,4 @@ __floatuntidf(tu_int a) return fb.f; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/floatuntisf.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/floatuntisf.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/floatuntisf.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a float, rounding toward even. */ @@ -78,4 +78,4 @@ __floatuntisf(tu_int a) return fb.f; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/floatuntixf.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/floatuntixf.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/floatuntixf.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a long double, rounding toward even. */ Modified: stable/10/contrib/compiler-rt/lib/int_types.h ============================================================================== --- stable/10/contrib/compiler-rt/lib/int_types.h Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/int_types.h Wed Mar 26 07:31:57 2014 (r263763) @@ -56,8 +56,11 @@ typedef union }s; } udwords; -#if __x86_64 +#if __LP64__ +#define CRT_HAS_128BIT +#endif +#ifdef CRT_HAS_128BIT typedef int ti_int __attribute__ ((mode (TI))); typedef unsigned tu_int __attribute__ ((mode (TI))); @@ -105,7 +108,7 @@ static inline tu_int make_tu(du_int h, d return r.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ typedef union { Modified: stable/10/contrib/compiler-rt/lib/lshrti3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/lshrti3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/lshrti3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: logical a >> b */ @@ -42,4 +42,4 @@ __lshrti3(ti_int a, si_int b) return result.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/modti3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/modti3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/modti3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); @@ -33,4 +33,4 @@ __modti3(ti_int a, ti_int b) return (r ^ s) - s; /* negate if s == -1 */ } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/muloti4.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/muloti4.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/muloti4.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a * b */ @@ -59,4 +59,4 @@ __muloti4(ti_int a, ti_int b, int* overf return result; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/multi3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/multi3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/multi3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a * b */ @@ -55,4 +55,4 @@ __multi3(ti_int a, ti_int b) return r.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/mulvti3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/mulvti3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/mulvti3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a * b */ @@ -57,4 +57,4 @@ __mulvti3(ti_int a, ti_int b) return a * b; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/negti2.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/negti2.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/negti2.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: -a */ @@ -27,4 +27,4 @@ __negti2(ti_int a) return -a; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/negvti2.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/negvti2.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/negvti2.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: -a */ @@ -29,4 +29,4 @@ __negvti2(ti_int a) return -a; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/parityti2.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/parityti2.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/parityti2.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: 1 if number of bits is odd else returns 0 */ @@ -28,4 +28,4 @@ __parityti2(ti_int a) return __paritydi2(x.s.high ^ x.s.low); } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/popcountti2.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/popcountti2.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/popcountti2.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: count of 1 bits */ @@ -41,4 +41,4 @@ __popcountti2(ti_int a) return (x + (x >> 8)) & 0xFF; /* (8 significant bits) */ } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/subvti3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/subvti3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/subvti3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a - b */ @@ -37,4 +37,4 @@ __subvti3(ti_int a, ti_int b) return s; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/ucmpti2.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/ucmpti2.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/ucmpti2.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: if (a < b) returns 0 * if (a == b) returns 1 @@ -39,4 +39,4 @@ __ucmpti2(tu_int a, tu_int b) return 1; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/udivmodti4.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/udivmodti4.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/udivmodti4.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Effects: if rem != 0, *rem = a % b * Returns: a / b @@ -253,4 +253,4 @@ __udivmodti4(tu_int a, tu_int b, tu_int* return q.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/udivti3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/udivti3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/udivti3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); @@ -26,4 +26,4 @@ __udivti3(tu_int a, tu_int b) return __udivmodti4(a, b, 0); } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/compiler-rt/lib/umodti3.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/umodti3.c Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/compiler-rt/lib/umodti3.c Wed Mar 26 07:31:57 2014 (r263763) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); @@ -28,4 +28,4 @@ __umodti3(tu_int a, tu_int b) return r; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: stable/10/contrib/gcc/longlong.h ============================================================================== --- stable/10/contrib/gcc/longlong.h Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/gcc/longlong.h Wed Mar 26 07:31:57 2014 (r263763) @@ -1086,8 +1086,8 @@ UDItype __umulsidi3 (USItype, USItype); "bcs,a,pn %%xcc, 1f\n\t" \ "add %0, 1, %0\n" \ "1:" \ - : "=r" ((UDItype)(sh)), \ - "=&r" ((UDItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "%rJ" ((UDItype)(ah)), \ "rI" ((UDItype)(bh)), \ "%rJ" ((UDItype)(al)), \ @@ -1100,8 +1100,8 @@ UDItype __umulsidi3 (USItype, USItype); "bcs,a,pn %%xcc, 1f\n\t" \ "sub %0, 1, %0\n\t" \ "1:" \ - : "=r" ((UDItype)(sh)), \ - "=&r" ((UDItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "rJ" ((UDItype)(ah)), \ "rI" ((UDItype)(bh)), \ "rJ" ((UDItype)(al)), \ @@ -1133,8 +1133,8 @@ UDItype __umulsidi3 (USItype, USItype); "sllx %3,32,%3\n\t" \ "add %1,%3,%1\n\t" \ "add %5,%2,%0" \ - : "=r" ((UDItype)(wh)), \ - "=&r" ((UDItype)(wl)), \ + : "=r" (wh), \ + "=&r" (wl), \ "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) \ : "r" ((UDItype)(u)), \ "r" ((UDItype)(v)) \ Modified: stable/10/contrib/llvm/include/llvm/MC/MCAsmInfo.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/MC/MCAsmInfo.h Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/llvm/include/llvm/MC/MCAsmInfo.h Wed Mar 26 07:31:57 2014 (r263763) @@ -371,7 +371,7 @@ namespace llvm { unsigned Encoding, MCStreamer &Streamer) const; - const MCExpr * + virtual const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const; Modified: stable/10/contrib/llvm/include/llvm/Object/ELFObjectFile.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/Object/ELFObjectFile.h Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/llvm/include/llvm/Object/ELFObjectFile.h Wed Mar 26 07:31:57 2014 (r263763) @@ -922,6 +922,9 @@ StringRef ELFObjectFile::getFileFo return "ELF32-mips"; case ELF::EM_PPC: return "ELF32-ppc"; + case ELF::EM_SPARC: + case ELF::EM_SPARC32PLUS: + return "ELF32-sparc"; default: return "ELF32-unknown"; } @@ -937,6 +940,8 @@ StringRef ELFObjectFile::getFileFo return "ELF64-ppc64"; case ELF::EM_S390: return "ELF64-s390"; + case ELF::EM_SPARCV9: + return "ELF64-sparc"; default: return "ELF64-unknown"; } @@ -967,6 +972,13 @@ unsigned ELFObjectFile::getArch() : Triple::ppc64; case ELF::EM_S390: return Triple::systemz; + + case ELF::EM_SPARC: + case ELF::EM_SPARC32PLUS: + return Triple::sparc; + case ELF::EM_SPARCV9: + return Triple::sparcv9; + default: return Triple::UnknownArch; } Modified: stable/10/contrib/llvm/include/llvm/Support/ELF.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/Support/ELF.h Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/llvm/include/llvm/Support/ELF.h Wed Mar 26 07:31:57 2014 (r263763) @@ -1087,6 +1087,94 @@ enum { R_390_IRELATIVE = 61 }; +// ELF Relocation type for Sparc. +enum { + R_SPARC_NONE = 0, + R_SPARC_8 = 1, + R_SPARC_16 = 2, + R_SPARC_32 = 3, + R_SPARC_DISP8 = 4, + R_SPARC_DISP16 = 5, + R_SPARC_DISP32 = 6, + R_SPARC_WDISP30 = 7, + R_SPARC_WDISP22 = 8, + R_SPARC_HI22 = 9, + R_SPARC_22 = 10, + R_SPARC_13 = 11, + R_SPARC_LO10 = 12, + R_SPARC_GOT10 = 13, + R_SPARC_GOT13 = 14, + R_SPARC_GOT22 = 15, + R_SPARC_PC10 = 16, + R_SPARC_PC22 = 17, + R_SPARC_WPLT30 = 18, + R_SPARC_COPY = 19, + R_SPARC_GLOB_DAT = 20, + R_SPARC_JMP_SLOT = 21, + R_SPARC_RELATIVE = 22, + R_SPARC_UA32 = 23, + R_SPARC_PLT32 = 24, + R_SPARC_HIPLT22 = 25, + R_SPARC_LOPLT10 = 26, + R_SPARC_PCPLT32 = 27, + R_SPARC_PCPLT22 = 28, + R_SPARC_PCPLT10 = 29, + R_SPARC_10 = 30, + R_SPARC_11 = 31, + R_SPARC_64 = 32, + R_SPARC_OLO10 = 33, + R_SPARC_HH22 = 34, + R_SPARC_HM10 = 35, + R_SPARC_LM22 = 36, + R_SPARC_PC_HH22 = 37, + R_SPARC_PC_HM10 = 38, + R_SPARC_PC_LM22 = 39, + R_SPARC_WDISP16 = 40, + R_SPARC_WDISP19 = 41, + R_SPARC_7 = 43, + R_SPARC_5 = 44, + R_SPARC_6 = 45, + R_SPARC_DISP64 = 46, + R_SPARC_PLT64 = 47, + R_SPARC_HIX22 = 48, + R_SPARC_LOX10 = 49, + R_SPARC_H44 = 50, + R_SPARC_M44 = 51, + R_SPARC_L44 = 52, + R_SPARC_REGISTER = 53, + R_SPARC_UA64 = 54, + R_SPARC_UA16 = 55, + R_SPARC_TLS_GD_HI22 = 56, + R_SPARC_TLS_GD_LO10 = 57, + R_SPARC_TLS_GD_ADD = 58, + R_SPARC_TLS_GD_CALL = 59, + R_SPARC_TLS_LDM_HI22 = 60, + R_SPARC_TLS_LDM_LO10 = 61, + R_SPARC_TLS_LDM_ADD = 62, + R_SPARC_TLS_LDM_CALL = 63, + R_SPARC_TLS_LDO_HIX22 = 64, + R_SPARC_TLS_LDO_LOX10 = 65, + R_SPARC_TLS_LDO_ADD = 66, + R_SPARC_TLS_IE_HI22 = 67, + R_SPARC_TLS_IE_LO10 = 68, + R_SPARC_TLS_IE_LD = 69, + R_SPARC_TLS_IE_LDX = 70, + R_SPARC_TLS_IE_ADD = 71, + R_SPARC_TLS_LE_HIX22 = 72, + R_SPARC_TLS_LE_LOX10 = 73, + R_SPARC_TLS_DTPMOD32 = 74, + R_SPARC_TLS_DTPMOD64 = 75, + R_SPARC_TLS_DTPOFF32 = 76, + R_SPARC_TLS_DTPOFF64 = 77, + R_SPARC_TLS_TPOFF32 = 78, + R_SPARC_TLS_TPOFF64 = 79, + R_SPARC_GOTDATA_HIX22 = 80, + R_SPARC_GOTDATA_LOX22 = 81, + R_SPARC_GOTDATA_OP_HIX22 = 82, + R_SPARC_GOTDATA_OP_LOX22 = 83, + R_SPARC_GOTDATA_OP = 84 +}; + // Section header. struct Elf32_Shdr { Elf32_Word sh_name; // Section name (index into string table) Modified: stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Mar 26 07:31:57 2014 (r263763) @@ -23,6 +23,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstrBundle.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" @@ -2221,14 +2222,13 @@ isBlockOnlyReachableByFallthrough(const if (!MI.isBranch() || MI.isIndirectBranch()) return false; - // If we are the operands of one of the branches, this is not - // a fall through. - for (MachineInstr::mop_iterator OI = MI.operands_begin(), - OE = MI.operands_end(); OI != OE; ++OI) { - const MachineOperand& OP = *OI; - if (OP.isJTI()) + // If we are the operands of one of the branches, this is not a fall + // through. Note that targets with delay slots will usually bundle + // terminators with the delay slot instruction. + for (ConstMIBundleOperands OP(&MI); OP.isValid(); ++OP) { + if (OP->isJTI()) return false; - if (OP.isMBB() && OP.getMBB() == MBB) + if (OP->isMBB() && OP->getMBB() == MBB) return false; } } Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Wed Mar 26 07:31:57 2014 (r263763) @@ -220,10 +220,19 @@ void InstrEmitter::CreateVirtualRegister unsigned VRBase = 0; const TargetRegisterClass *RC = TRI->getAllocatableClass(TII->getRegClass(II, i, TRI, *MF)); - // If the register class is unknown for the given definition, then try to - // infer one from the value type. - if (!RC && i < NumResults) - RC = TLI->getRegClassFor(Node->getSimpleValueType(i)); + // Always let the value type influence the used register class. The + // constraints on the instruction may be too lax to represent the value + // type correctly. For example, a 64-bit float (X86::FR64) can't live in + // the 32-bit float super-class (X86::FR32). + if (i < NumResults && TLI->isTypeLegal(Node->getSimpleValueType(i))) { + const TargetRegisterClass *VTRC = + TLI->getRegClassFor(Node->getSimpleValueType(i)); + if (RC) + VTRC = TRI->getCommonSubClass(RC, VTRC); + if (VTRC) + RC = VTRC; + } + if (II.OpInfo[i].isOptionalDef()) { // Optional def must be a physical register. unsigned NumResults = CountResults(Node); Modified: stable/10/contrib/llvm/lib/MC/MCObjectFileInfo.cpp ============================================================================== --- stable/10/contrib/llvm/lib/MC/MCObjectFileInfo.cpp Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/llvm/lib/MC/MCObjectFileInfo.cpp Wed Mar 26 07:31:57 2014 (r263763) @@ -310,6 +310,33 @@ void MCObjectFileInfo::InitELFMCObjectFi FDEEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_udata8; TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_udata8; + } else if (T.getArch() == Triple::sparc) { + if (RelocM == Reloc::PIC_) { + LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; + PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | + dwarf::DW_EH_PE_sdata4; + FDEEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; + TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | + dwarf::DW_EH_PE_sdata4; + } else { + LSDAEncoding = dwarf::DW_EH_PE_absptr; + PersonalityEncoding = dwarf::DW_EH_PE_absptr; + FDEEncoding = dwarf::DW_EH_PE_udata4; + TTypeEncoding = dwarf::DW_EH_PE_absptr; + } + } else if (T.getArch() == Triple::sparcv9) { + LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; + if (RelocM == Reloc::PIC_) { + PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | + dwarf::DW_EH_PE_sdata4; + FDEEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; + TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | + dwarf::DW_EH_PE_sdata4; + } else { + PersonalityEncoding = dwarf::DW_EH_PE_absptr; + FDEEncoding = dwarf::DW_EH_PE_udata4; + TTypeEncoding = dwarf::DW_EH_PE_absptr; + } } else if (T.getArch() == Triple::systemz) { // All currently-defined code models guarantee that 4-byte PC-relative // values will be in range. Modified: stable/10/contrib/llvm/lib/Object/ELF.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Object/ELF.cpp Wed Mar 26 06:26:53 2014 (r263762) +++ stable/10/contrib/llvm/lib/Object/ELF.cpp Wed Mar 26 07:31:57 2014 (r263763) @@ -702,6 +702,98 @@ StringRef getELFRelocationTypeName(uint3 break; } break; + case ELF::EM_SPARC: + case ELF::EM_SPARC32PLUS: + case ELF::EM_SPARCV9: + switch (Type) { + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_NONE); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_8); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_16); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_DISP8); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_DISP16); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_DISP32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_WDISP30); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_WDISP22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_HI22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_13); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_LO10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOT10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOT13); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOT22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PC10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PC22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_WPLT30); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_COPY); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GLOB_DAT); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_JMP_SLOT); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_RELATIVE); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_UA32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PLT32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_HIPLT22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_LOPLT10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PCPLT32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PCPLT22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PCPLT10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_11); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_OLO10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_HH22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_HM10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_LM22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PC_HH22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PC_HM10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PC_LM22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_WDISP16); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_WDISP19); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_7); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_5); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_6); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_DISP64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PLT64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_HIX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_LOX10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_H44); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_M44); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_L44); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_REGISTER); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_UA64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_UA16); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_GD_HI22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_GD_LO10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_GD_ADD); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_GD_CALL); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDM_HI22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDM_LO10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDM_ADD); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDM_CALL); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDO_HIX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDO_LOX10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDO_ADD); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_IE_HI22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_IE_LO10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_IE_LD); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_IE_LDX); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_IE_ADD); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LE_HIX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LE_LOX10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_DTPMOD32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_DTPMOD64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_DTPOFF32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_DTPOFF64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_TPOFF32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_TPOFF64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOTDATA_HIX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOTDATA_LOX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOTDATA_OP_HIX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOTDATA_OP_LOX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOTDATA_OP); + default: + break; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 26 07:42:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 95757D4A; Wed, 26 Mar 2014 07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6745837B; Wed, 26 Mar 2014 07: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 s2Q7gm8c058506; Wed, 26 Mar 2014 07:42:48 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2Q7gkPX058491; Wed, 26 Mar 2014 07:42:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403260742.s2Q7gkPX058491@svn.freebsd.org> From: Dimitry Andric Date: Wed, 26 Mar 2014 07:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263765 - in stable: 10/contrib/llvm/include/llvm/CodeGen 10/contrib/llvm/lib/CodeGen 10/contrib/llvm/lib/CodeGen/SelectionDAG 10/contrib/llvm/lib/MC/MCParser 10/contrib/llvm/lib/Target... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 07:42:48 -0000 Author: dim Date: Wed Mar 26 07:42:43 2014 New Revision: 263765 URL: http://svnweb.freebsd.org/changeset/base/263765 Log: MFC r263312: Pull in r196939 from upstream llvm trunk (by Reid Kleckner): Reland "Fix miscompile of MS inline assembly with stack realignment" This re-lands commit r196876, which was reverted in r196879. The tests have been fixed to pass on platforms with a stack alignment larger than 4. Update to clang side tests will land shortly. Pull in r196986 from upstream llvm trunk (by Reid Kleckner): Revert the backend fatal error from r196939 The combination of inline asm, stack realignment, and dynamic allocas turns out to be too common to reject out of hand. ASan inserts empy inline asm fragments and uses aligned allocas. Compiling any trivial function containing a dynamic alloca with ASan is enough to trigger the check. XFAIL the test cases that would be miscompiled and add one that uses the relevant functionality. Pull in r202930 from upstream llvm trunk (by Hans Wennborg): Check for dynamic allocas and inline asm that clobbers sp before building selection dag (PR19012) In X86SelectionDagInfo::EmitTargetCodeForMemcpy we check with MachineFrameInfo to make sure that ESI isn't used as a base pointer register before we choose to emit rep movs (which clobbers esi). The problem is that MachineFrameInfo wouldn't know about dynamic allocas or inline asm that clobbers the stack pointer until SelectionDAGBuilder has encountered them. This patch fixes the problem by checking for such things when building the FunctionLoweringInfo. Differential Revision: http://llvm-reviews.chandlerc.com/D2954 Together, these commits fix the problem encountered in the devel/emacs port on the i386 architecture, where a combination of stack realignment, alloca() and memcpy() could incidentally clobber the %esi register, leading to segfaults in the temacs build-time utility. See also: http://llvm.org/PR18171 and http://llvm.org/PR19012 Reported by: ashish PR: ports/183064 MFC r263313: Pull in r203311 from upstream llvm trunk (by Arnold Schwaighofer): ISel: Make VSELECT selection terminate in cases where the condition type has to be split and the result type widened. When the condition of a vselect has to be split it makes no sense widening the vselect and thereby widening the condition. We end up in an endless loop of widening (vselect result type) and splitting (condition mask type) doing this. Instead, split both the condition and the vselect and widen the result. I ran this over the test suite with i686 and mattr=+sse and saw no regressions. Fixes PR18036. With this fix the original problem case from the graphics/rawtherapee port (posted in http://llvm.org/PR18036 ) now compiles within ~97MB RSS. Reported by: mandree MFC r263320: Add separate patch files for all the customizations we have currently applied to our copy of llvm/clang. These can be applied in alphabetical order to a pristine llvm/clang 3.4 release source tree, to result in the same version used in FreeBSD. This is intended to clearly document all the changes until now, which mostly consist of cherry pickings from the respective upstream trunks, plus a number of hand-written FreeBSD-specific ones. Hopefully those can eventually be cleaned up and sent upstream too. Added: stable/10/contrib/llvm/patches/ - copied from r263320, head/contrib/llvm/patches/ Modified: stable/10/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h stable/10/contrib/llvm/include/llvm/CodeGen/MachineFunction.h stable/10/contrib/llvm/lib/CodeGen/MachineFunction.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp stable/10/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp stable/10/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/9/contrib/llvm/patches/ - copied from r263320, head/contrib/llvm/patches/ Modified: stable/9/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineFunction.h stable/9/contrib/llvm/lib/CodeGen/MachineFunction.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp stable/9/contrib/llvm/lib/MC/MCParser/AsmParser.cpp stable/9/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp stable/9/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/llvm/ (props changed) Modified: stable/10/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h Wed Mar 26 07:42:43 2014 (r263765) @@ -41,6 +41,7 @@ class MachineBasicBlock; class MachineFunction; class MachineModuleInfo; class MachineRegisterInfo; +class SelectionDAG; class TargetLowering; class Value; @@ -125,7 +126,7 @@ public: /// set - Initialize this FunctionLoweringInfo with the given Function /// and its associated MachineFunction. /// - void set(const Function &Fn, MachineFunction &MF); + void set(const Function &Fn, MachineFunction &MF, SelectionDAG *DAG); /// clear - Clear out all the function-specific state. This returns this /// FunctionLoweringInfo to an empty state, ready to be used for a Modified: stable/10/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h Wed Mar 26 07:42:43 2014 (r263765) @@ -223,6 +223,10 @@ class MachineFrameInfo { /// Whether the "realign-stack" option is on. bool RealignOption; + /// True if the function includes inline assembly that adjusts the stack + /// pointer. + bool HasInlineAsmWithSPAdjust; + const TargetFrameLowering *getFrameLowering() const; public: explicit MachineFrameInfo(const TargetMachine &TM, bool RealignOpt) @@ -240,6 +244,7 @@ public: LocalFrameSize = 0; LocalFrameMaxAlign = 0; UseLocalStackAllocationBlock = false; + HasInlineAsmWithSPAdjust = false; } /// hasStackObjects - Return true if there are any stack objects in this @@ -451,6 +456,10 @@ public: bool hasCalls() const { return HasCalls; } void setHasCalls(bool V) { HasCalls = V; } + /// Returns true if the function contains any stack-adjusting inline assembly. + bool hasInlineAsmWithSPAdjust() const { return HasInlineAsmWithSPAdjust; } + void setHasInlineAsmWithSPAdjust(bool B) { HasInlineAsmWithSPAdjust = B; } + /// getMaxCallFrameSize - Return the maximum size of a call frame that must be /// allocated for an outgoing function call. This is only available if /// CallFrameSetup/Destroy pseudo instructions are used by the target, and @@ -521,7 +530,7 @@ public: /// variable sized object is created, whether or not the index returned is /// actually used. /// - int CreateVariableSizedObject(unsigned Alignment); + int CreateVariableSizedObject(unsigned Alignment, const AllocaInst *Alloca); /// getCalleeSavedInfo - Returns a reference to call saved info vector for the /// current function. Modified: stable/10/contrib/llvm/include/llvm/CodeGen/MachineFunction.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/CodeGen/MachineFunction.h Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/include/llvm/CodeGen/MachineFunction.h Wed Mar 26 07:42:43 2014 (r263765) @@ -131,8 +131,8 @@ class MachineFunction { /// about the control flow of such functions. bool ExposesReturnsTwice; - /// True if the function includes MS-style inline assembly. - bool HasMSInlineAsm; + /// True if the function includes any inline assembly. + bool HasInlineAsm; MachineFunction(const MachineFunction &) LLVM_DELETED_FUNCTION; void operator=(const MachineFunction&) LLVM_DELETED_FUNCTION; @@ -218,15 +218,14 @@ public: ExposesReturnsTwice = B; } - /// Returns true if the function contains any MS-style inline assembly. - bool hasMSInlineAsm() const { - return HasMSInlineAsm; + /// Returns true if the function contains any inline assembly. + bool hasInlineAsm() const { + return HasInlineAsm; } - /// Set a flag that indicates that the function contains MS-style inline - /// assembly. - void setHasMSInlineAsm(bool B) { - HasMSInlineAsm = B; + /// Set a flag that indicates that the function contains inline assembly. + void setHasInlineAsm(bool B) { + HasInlineAsm = B; } /// getInfo - Keep track of various per-function pieces of information for Modified: stable/10/contrib/llvm/lib/CodeGen/MachineFunction.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/MachineFunction.cpp Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/lib/CodeGen/MachineFunction.cpp Wed Mar 26 07:42:43 2014 (r263765) @@ -525,13 +525,14 @@ int MachineFrameInfo::CreateSpillStackOb /// variable sized object is created, whether or not the index returned is /// actually used. /// -int MachineFrameInfo::CreateVariableSizedObject(unsigned Alignment) { +int MachineFrameInfo::CreateVariableSizedObject(unsigned Alignment, + const AllocaInst *Alloca) { HasVarSizedObjects = true; Alignment = clampStackAlignment(!getFrameLowering()->isStackRealignable() || !RealignOption, Alignment, getFrameLowering()->getStackAlignment()); - Objects.push_back(StackObject(0, Alignment, 0, false, false, true, 0)); + Objects.push_back(StackObject(0, Alignment, 0, false, false, true, Alloca)); ensureMaxAlignment(Alignment); return (int)Objects.size()-NumFixedObjects-1; } Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp Wed Mar 26 07:42:43 2014 (r263765) @@ -33,6 +33,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MathExtras.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Target/TargetFrameLowering.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetRegisterInfo.h" @@ -55,7 +56,8 @@ static bool isUsedOutsideOfDefiningBlock return false; } -void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf) { +void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, + SelectionDAG *DAG) { const TargetLowering *TLI = TM.getTargetLowering(); Fn = &fn; @@ -100,6 +102,43 @@ void FunctionLoweringInfo::set(const Fun for (; BB != EB; ++BB) for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) { + // Look for dynamic allocas. + if (const AllocaInst *AI = dyn_cast(I)) { + if (!AI->isStaticAlloca()) { + unsigned Align = std::max( + (unsigned)TLI->getDataLayout()->getPrefTypeAlignment( + AI->getAllocatedType()), + AI->getAlignment()); + unsigned StackAlign = TM.getFrameLowering()->getStackAlignment(); + if (Align <= StackAlign) + Align = 0; + // Inform the Frame Information that we have variable-sized objects. + MF->getFrameInfo()->CreateVariableSizedObject(Align ? Align : 1, AI); + } + } + + // Look for inline asm that clobbers the SP register. + if (isa(I) || isa(I)) { + ImmutableCallSite CS(I); + if (const InlineAsm *IA = dyn_cast(CS.getCalledValue())) { + unsigned SP = TLI->getStackPointerRegisterToSaveRestore(); + std::vector Ops = + TLI->ParseConstraints(CS); + for (size_t I = 0, E = Ops.size(); I != E; ++I) { + TargetLowering::AsmOperandInfo &Op = Ops[I]; + if (Op.Type == InlineAsm::isClobber) { + // Clobbers don't have SDValue operands, hence SDValue(). + TLI->ComputeConstraintToUse(Op, SDValue(), DAG); + std::pair PhysReg = + TLI->getRegForInlineAsmConstraint(Op.ConstraintCode, + Op.ConstraintVT); + if (PhysReg.first == SP) + MF->getFrameInfo()->setHasInlineAsmWithSPAdjust(true); + } + } + } + } + // Mark values used outside their block as exported, by allocating // a virtual register for them. if (isUsedOutsideOfDefiningBlock(I)) Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Wed Mar 26 07:42:43 2014 (r263765) @@ -2180,6 +2180,17 @@ SDValue DAGTypeLegalizer::WidenVecRes_SE if (getTypeAction(CondVT) == TargetLowering::TypeWidenVector) Cond1 = GetWidenedVector(Cond1); + // If we have to split the condition there is no point in widening the + // select. This would result in an cycle of widening the select -> + // widening the condition operand -> splitting the condition operand -> + // splitting the select -> widening the select. Instead split this select + // further and widen the resulting type. + if (getTypeAction(CondVT) == TargetLowering::TypeSplitVector) { + SDValue SplitSelect = SplitVecOp_VSELECT(N, 0); + SDValue Res = ModifyToType(SplitSelect, WidenVT); + return Res; + } + if (Cond1.getValueType() != CondWidenVT) Cond1 = ModifyToType(Cond1, CondWidenVT); } Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Mar 26 07:42:43 2014 (r263765) @@ -851,12 +851,20 @@ void RegsForValue::AddInlineAsmOperands( SDValue Res = DAG.getTargetConstant(Flag, MVT::i32); Ops.push_back(Res); + unsigned SP = TLI.getStackPointerRegisterToSaveRestore(); for (unsigned Value = 0, Reg = 0, e = ValueVTs.size(); Value != e; ++Value) { unsigned NumRegs = TLI.getNumRegisters(*DAG.getContext(), ValueVTs[Value]); MVT RegisterVT = RegVTs[Value]; for (unsigned i = 0; i != NumRegs; ++i) { assert(Reg < Regs.size() && "Mismatch in # registers expected"); - Ops.push_back(DAG.getRegister(Regs[Reg++], RegisterVT)); + unsigned TheReg = Regs[Reg++]; + Ops.push_back(DAG.getRegister(TheReg, RegisterVT)); + + if (TheReg == SP && Code == InlineAsm::Kind_Clobber) { + // If we clobbered the stack pointer, MFI should know about it. + assert(DAG.getMachineFunction().getFrameInfo()-> + hasInlineAsmWithSPAdjust()); + } } } } @@ -3370,9 +3378,7 @@ void SelectionDAGBuilder::visitAlloca(co setValue(&I, DSA); DAG.setRoot(DSA.getValue(1)); - // Inform the Frame Information that we have just allocated a variable-sized - // object. - FuncInfo.MF->getFrameInfo()->CreateVariableSizedObject(Align ? Align : 1); + assert(FuncInfo.MF->getFrameInfo()->hasVarSizedObjects()); } void SelectionDAGBuilder::visitLoad(const LoadInst &I) { Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Mar 26 07:42:43 2014 (r263765) @@ -419,7 +419,7 @@ bool SelectionDAGISel::runOnMachineFunct SplitCriticalSideEffectEdges(const_cast(Fn), this); CurDAG->init(*MF, TTI, TLI); - FuncInfo->set(Fn, *MF); + FuncInfo->set(Fn, *MF, CurDAG); if (UseMBPI && OptLevel != CodeGenOpt::None) FuncInfo->BPI = &getAnalysis(); @@ -428,7 +428,8 @@ bool SelectionDAGISel::runOnMachineFunct SDB->init(GFI, *AA, LibInfo); - MF->setHasMSInlineAsm(false); + MF->setHasInlineAsm(false); + SelectAllBasicBlocks(Fn); // If the first basic block in the function has live ins that need to be @@ -511,7 +512,7 @@ bool SelectionDAGISel::runOnMachineFunct for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E; ++I) { - if (MFI->hasCalls() && MF->hasMSInlineAsm()) + if (MFI->hasCalls() && MF->hasInlineAsm()) break; const MachineBasicBlock *MBB = I; @@ -522,8 +523,8 @@ bool SelectionDAGISel::runOnMachineFunct II->isStackAligningInlineAsm()) { MFI->setHasCalls(true); } - if (II->isMSInlineAsm()) { - MF->setHasMSInlineAsm(true); + if (II->isInlineAsm()) { + MF->setHasInlineAsm(true); } } } Modified: stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Wed Mar 26 07:42:43 2014 (r263765) @@ -4192,6 +4192,11 @@ bool AsmParser::parseMSInlineAsm( AsmStrRewrites.push_back(AsmRewrite(AOK_Input, Start, SymName.size())); } } + + // Consider implicit defs to be clobbers. Think of cpuid and push. + const uint16_t *ImpDefs = Desc.getImplicitDefs(); + for (unsigned I = 0, E = Desc.getNumImplicitDefs(); I != E; ++I) + ClobberRegs.push_back(ImpDefs[I]); } // Set the number of Outputs and Inputs. Modified: stable/10/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp Wed Mar 26 07:42:43 2014 (r263765) @@ -50,7 +50,7 @@ bool X86FrameLowering::hasFP(const Machi return (MF.getTarget().Options.DisableFramePointerElim(MF) || RegInfo->needsStackRealignment(MF) || MFI->hasVarSizedObjects() || - MFI->isFrameAddressTaken() || MF.hasMSInlineAsm() || + MFI->isFrameAddressTaken() || MFI->hasInlineAsmWithSPAdjust() || MF.getInfo()->getForceFramePointer() || MMI.callsUnwindInit() || MMI.callsEHReturn()); } Modified: stable/10/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp Wed Mar 26 07:35:24 2014 (r263764) +++ stable/10/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp Wed Mar 26 07:42:43 2014 (r263765) @@ -403,18 +403,15 @@ bool X86RegisterInfo::hasBasePointer(con if (!EnableBasePointer) return false; - // When we need stack realignment and there are dynamic allocas, we can't - // reference off of the stack pointer, so we reserve a base pointer. - // - // This is also true if the function contain MS-style inline assembly. We - // do this because if any stack changes occur in the inline assembly, e.g., - // "pusha", then any C local variable or C argument references in the - // inline assembly will be wrong because the SP is not properly tracked. - if ((needsStackRealignment(MF) && MFI->hasVarSizedObjects()) || - MF.hasMSInlineAsm()) - return true; - - return false; + // When we need stack realignment, we can't address the stack from the frame + // pointer. When we have dynamic allocas or stack-adjusting inline asm, we + // can't address variables from the stack pointer. MS inline asm can + // reference locals while also adjusting the stack pointer. When we can't + // use both the SP and the FP, we need a separate base pointer register. + bool CantUseFP = needsStackRealignment(MF); + bool CantUseSP = + MFI->hasVarSizedObjects() || MFI->hasInlineAsmWithSPAdjust(); + return CantUseFP && CantUseSP; } bool X86RegisterInfo::canRealignStack(const MachineFunction &MF) const { From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 26 16:59:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D7448465; Wed, 26 Mar 2014 16:59: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 C2F0ACD2; Wed, 26 Mar 2014 16:59: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 s2QGxSiN084269; Wed, 26 Mar 2014 16:59:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QGxSnJ084267; Wed, 26 Mar 2014 16:59:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403261659.s2QGxSnJ084267@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 26 Mar 2014 16:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263770 - in stable/10/sys: compat/freebsd32 kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 16:59:28 -0000 Author: kib Date: Wed Mar 26 16:59:28 2014 New Revision: 263770 URL: http://svnweb.freebsd.org/changeset/base/263770 Log: MFC r263349: Make the array pointed to by AT_PAGESIZES auxv properly aligned. Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c stable/10/sys/kern/kern_exec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_misc.c Wed Mar 26 14:01:41 2014 (r263769) +++ stable/10/sys/compat/freebsd32/freebsd32_misc.c Wed Mar 26 16:59:28 2014 (r263770) @@ -2790,7 +2790,8 @@ freebsd32_copyout_strings(struct image_p { int argc, envc, i; u_int32_t *vectp; - char *stringp, *destp; + char *stringp; + uintptr_t destp; u_int32_t *stack_base; struct freebsd32_ps_strings *arginfo; char canary[sizeof(long) * 8]; @@ -2812,35 +2813,34 @@ freebsd32_copyout_strings(struct image_p szsigcode = *(imgp->proc->p_sysent->sv_szsigcode); else szsigcode = 0; - destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - - roundup(execpath_len, sizeof(char *)) - - roundup(sizeof(canary), sizeof(char *)) - - roundup(sizeof(pagesizes32), sizeof(char *)) - - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); + destp = (uintptr_t)arginfo; /* * install sigcode */ - if (szsigcode != 0) - copyout(imgp->proc->p_sysent->sv_sigcode, - ((caddr_t)arginfo - szsigcode), szsigcode); + if (szsigcode != 0) { + destp -= szsigcode; + destp = rounddown2(destp, sizeof(uint32_t)); + copyout(imgp->proc->p_sysent->sv_sigcode, (void *)destp, + szsigcode); + } /* * Copy the image path for the rtld. */ if (execpath_len != 0) { - imgp->execpathp = (uintptr_t)arginfo - szsigcode - execpath_len; - copyout(imgp->execpath, (void *)imgp->execpathp, - execpath_len); + destp -= execpath_len; + imgp->execpathp = destp; + copyout(imgp->execpath, (void *)destp, execpath_len); } /* * Prepare the canary for SSP. */ arc4rand(canary, sizeof(canary), 0); - imgp->canary = (uintptr_t)arginfo - szsigcode - execpath_len - - sizeof(canary); - copyout(canary, (void *)imgp->canary, sizeof(canary)); + destp -= sizeof(canary); + imgp->canary = destp; + copyout(canary, (void *)destp, sizeof(canary)); imgp->canarylen = sizeof(canary); /* @@ -2848,11 +2848,15 @@ freebsd32_copyout_strings(struct image_p */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; - imgp->pagesizes = (uintptr_t)arginfo - szsigcode - execpath_len - - roundup(sizeof(canary), sizeof(char *)) - sizeof(pagesizes32); - copyout(pagesizes32, (void *)imgp->pagesizes, sizeof(pagesizes32)); + destp -= sizeof(pagesizes32); + destp = rounddown2(destp, sizeof(uint32_t)); + imgp->pagesizes = destp; + copyout(pagesizes32, (void *)destp, sizeof(pagesizes32)); imgp->pagesizeslen = sizeof(pagesizes32); + destp -= ARG_MAX - imgp->args->stringspace; + destp = rounddown2(destp, sizeof(uint32_t)); + /* * If we have a valid auxargs ptr, prepare some room * on the stack. @@ -2872,13 +2876,14 @@ freebsd32_copyout_strings(struct image_p vectp = (u_int32_t *) (destp - (imgp->args->argc + imgp->args->envc + 2 + imgp->auxarg_size + execpath_len) * sizeof(u_int32_t)); - } else + } else { /* * The '+ 2' is for the null pointers at the end of each of * the arg and env vector sets */ - vectp = (u_int32_t *) - (destp - (imgp->args->argc + imgp->args->envc + 2) * sizeof(u_int32_t)); + vectp = (u_int32_t *)(destp - (imgp->args->argc + + imgp->args->envc + 2) * sizeof(u_int32_t)); + } /* * vectp also becomes our initial stack base @@ -2891,7 +2896,7 @@ freebsd32_copyout_strings(struct image_p /* * Copy out strings - arguments and environment. */ - copyout(stringp, destp, ARG_MAX - imgp->args->stringspace); + copyout(stringp, (void *)destp, ARG_MAX - imgp->args->stringspace); /* * Fill in "ps_strings" struct for ps, w, etc. Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Wed Mar 26 14:01:41 2014 (r263769) +++ stable/10/sys/kern/kern_exec.c Wed Mar 26 16:59:28 2014 (r263770) @@ -1232,7 +1232,8 @@ exec_copyout_strings(imgp) { int argc, envc; char **vectp; - char *stringp, *destp; + char *stringp; + uintptr_t destp; register_t *stack_base; struct ps_strings *arginfo; struct proc *p; @@ -1256,45 +1257,47 @@ exec_copyout_strings(imgp) if (p->p_sysent->sv_szsigcode != NULL) szsigcode = *(p->p_sysent->sv_szsigcode); } - destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - - roundup(execpath_len, sizeof(char *)) - - roundup(sizeof(canary), sizeof(char *)) - - roundup(szps, sizeof(char *)) - - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); + destp = (uintptr_t)arginfo; /* * install sigcode */ - if (szsigcode != 0) - copyout(p->p_sysent->sv_sigcode, ((caddr_t)arginfo - - szsigcode), szsigcode); + if (szsigcode != 0) { + destp -= szsigcode; + destp = rounddown2(destp, sizeof(void *)); + copyout(p->p_sysent->sv_sigcode, (void *)destp, szsigcode); + } /* * Copy the image path for the rtld. */ if (execpath_len != 0) { - imgp->execpathp = (uintptr_t)arginfo - szsigcode - execpath_len; - copyout(imgp->execpath, (void *)imgp->execpathp, - execpath_len); + destp -= execpath_len; + imgp->execpathp = destp; + copyout(imgp->execpath, (void *)destp, execpath_len); } /* * Prepare the canary for SSP. */ arc4rand(canary, sizeof(canary), 0); - imgp->canary = (uintptr_t)arginfo - szsigcode - execpath_len - - sizeof(canary); - copyout(canary, (void *)imgp->canary, sizeof(canary)); + destp -= sizeof(canary); + imgp->canary = destp; + copyout(canary, (void *)destp, sizeof(canary)); imgp->canarylen = sizeof(canary); /* * Prepare the pagesizes array. */ - imgp->pagesizes = (uintptr_t)arginfo - szsigcode - execpath_len - - roundup(sizeof(canary), sizeof(char *)) - szps; - copyout(pagesizes, (void *)imgp->pagesizes, szps); + destp -= szps; + destp = rounddown2(destp, sizeof(void *)); + imgp->pagesizes = destp; + copyout(pagesizes, (void *)destp, szps); imgp->pagesizeslen = szps; + destp -= ARG_MAX - imgp->args->stringspace; + destp = rounddown2(destp, sizeof(void *)); + /* * If we have a valid auxargs ptr, prepare some room * on the stack. @@ -1319,8 +1322,8 @@ exec_copyout_strings(imgp) * The '+ 2' is for the null pointers at the end of each of * the arg and env vector sets */ - vectp = (char **)(destp - (imgp->args->argc + imgp->args->envc + 2) * - sizeof(char *)); + vectp = (char **)(destp - (imgp->args->argc + imgp->args->envc + + 2) * sizeof(char *)); } /* @@ -1335,7 +1338,7 @@ exec_copyout_strings(imgp) /* * Copy out strings - arguments and environment. */ - copyout(stringp, destp, ARG_MAX - imgp->args->stringspace); + copyout(stringp, (void *)destp, ARG_MAX - imgp->args->stringspace); /* * Fill in "ps_strings" struct for ps, w, etc. From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 26 20:10:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 958F2A81; Wed, 26 Mar 2014 20:10:07 +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 820545EE; Wed, 26 Mar 2014 20:10:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2QKA7X9063260; Wed, 26 Mar 2014 20:10:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QKA7Lp063259; Wed, 26 Mar 2014 20:10:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403262010.s2QKA7Lp063259@svn.freebsd.org> From: Dimitry Andric Date: Wed, 26 Mar 2014 20:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263776 - stable/10/usr.bin/clang/lldb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 20:10:07 -0000 Author: dim Date: Wed Mar 26 20:10:07 2014 New Revision: 263776 URL: http://svnweb.freebsd.org/changeset/base/263776 Log: MFC r262657: Apply fix for lldb not linking after the sparc backend import. Reported by: se Pointy hat to: dim Modified: stable/10/usr.bin/clang/lldb/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/clang/lldb/Makefile ============================================================================== --- stable/10/usr.bin/clang/lldb/Makefile Wed Mar 26 19:57:50 2014 (r263775) +++ stable/10/usr.bin/clang/lldb/Makefile Wed Mar 26 20:10:07 2014 (r263776) @@ -115,6 +115,12 @@ LIBDEPS=\ llvmexecutionengine \ llvmcodegen \ llvmscalaropts \ + llvmsparcdisassembler \ + llvmsparccodegen \ + llvmsparcasmparser \ + llvmsparcdesc \ + llvmsparcinfo \ + llvmsparcinstprinter \ llvmarminfo \ llvmarminstprinter \ llvmmcparser \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Mar 26 23:57:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 87EAA136; Wed, 26 Mar 2014 23:57: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 74817DFA; Wed, 26 Mar 2014 23:57: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 s2QNvAQe057602; Wed, 26 Mar 2014 23:57:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QNvAmm057601; Wed, 26 Mar 2014 23:57:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403262357.s2QNvAmm057601@svn.freebsd.org> From: Xin LI Date: Wed, 26 Mar 2014 23:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263781 - stable/10/sys/nlm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 23:57:10 -0000 Author: delphij Date: Wed Mar 26 23:57:09 2014 New Revision: 263781 URL: http://svnweb.freebsd.org/changeset/base/263781 Log: MFC r262991: Correct a typo in nlm_find_host_by_addr(): the intention of the code is to give "" rather than comparing the buffer against it. Modified: stable/10/sys/nlm/nlm_prot_impl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/nlm/nlm_prot_impl.c ============================================================================== --- stable/10/sys/nlm/nlm_prot_impl.c Wed Mar 26 23:34:27 2014 (r263780) +++ stable/10/sys/nlm/nlm_prot_impl.c Wed Mar 26 23:57:09 2014 (r263781) @@ -1072,7 +1072,7 @@ nlm_find_host_by_addr(const struct socka break; #endif default: - strcmp(tmp, ""); + strlcpy(tmp, "", sizeof(tmp)); } From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 27 00:23:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7BF35B95; Thu, 27 Mar 2014 00:23: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 67762131; Thu, 27 Mar 2014 00:23: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 s2R0NjL4070581; Thu, 27 Mar 2014 00:23:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2R0NjLL070580; Thu, 27 Mar 2014 00:23:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403270023.s2R0NjLL070580@svn.freebsd.org> From: Xin LI Date: Thu, 27 Mar 2014 00:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263783 - stable/10/secure/lib/libcrypt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 00:23:45 -0000 Author: delphij Date: Thu Mar 27 00:23:44 2014 New Revision: 263783 URL: http://svnweb.freebsd.org/changeset/base/263783 Log: MFC r262501: Refresh our implementation of OpenBSD's Blowfish password format. Notable changes: - Support of $2b$ password format to address a problem where very long passwords (more than 256 characters, when an integer overflow would happen and cause the length to wrap at 256). - Updated pseudo code in comments to reflect the reality. - Removed our local shortcut of processing magic string and rely on the centralized and tigntened validation. - Diff reduction from upstream. For now we are still generating the older $2a$ format of password but we will migrate to the new format once the format is formally finalized. Modified: stable/10/secure/lib/libcrypt/crypt-blowfish.c Directory Properties: stable/10/ (props changed) Modified: stable/10/secure/lib/libcrypt/crypt-blowfish.c ============================================================================== --- stable/10/secure/lib/libcrypt/crypt-blowfish.c Wed Mar 26 23:58:17 2014 (r263782) +++ stable/10/secure/lib/libcrypt/crypt-blowfish.c Thu Mar 27 00:23:44 2014 (r263783) @@ -1,3 +1,5 @@ +/* $OpenBSD: bcrypt.c,v 1.29 2014/02/24 19:45:43 tedu Exp $ */ + /* * Copyright 1997 Niels Provos * All rights reserved. @@ -35,10 +37,10 @@ __FBSDID("$FreeBSD$"); * and works as follows: * * 1. state := InitState () - * 2. state := ExpandKey (state, salt, password) 3. - * REPEAT rounds: + * 2. state := ExpandKey (state, salt, password) + * 3. REPEAT rounds: + * state := ExpandKey (state, 0, password) * state := ExpandKey (state, 0, salt) - * state := ExpandKey(state, 0, password) * 4. ctext := "OrpheanBeholderScryDoubt" * 5. REPEAT 64: * ctext := Encrypt_ECB (state, ctext); @@ -48,6 +50,7 @@ __FBSDID("$FreeBSD$"); /* * FreeBSD implementation by Paul Herman + * and updated by Xin Li */ #include @@ -66,18 +69,18 @@ __FBSDID("$FreeBSD$"); #define BCRYPT_VERSION '2' #define BCRYPT_MAXSALT 16 /* Precomputation is just so nice */ #define BCRYPT_BLOCKS 6 /* Ciphertext blocks */ -#define BCRYPT_MINROUNDS 16 /* we have log2(rounds) in salt */ +#define BCRYPT_MINLOGROUNDS 4 /* we have log2(rounds) in salt */ + static void encode_base64(u_int8_t *, u_int8_t *, u_int16_t); static void decode_base64(u_int8_t *, u_int16_t, const u_int8_t *); static char encrypted[_PASSWORD_LEN]; -static const u_int8_t Base64Code[] = +const static u_int8_t Base64Code[] = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; -static const u_int8_t index_64[128] = -{ +const static u_int8_t index_64[128] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, @@ -108,7 +111,7 @@ decode_base64(u_int8_t *buffer, u_int16_ if (c1 == 255 || c2 == 255) break; - *bp++ = (u_int8_t)((c1 << 2) | ((c2 & 0x30) >> 4)); + *bp++ = (c1 << 2) | ((c2 & 0x30) >> 4); if (bp >= buffer + len) break; @@ -138,23 +141,19 @@ crypt_blowfish(const char *key, const ch blf_ctx state; u_int32_t rounds, i, k; u_int16_t j; - u_int8_t key_len, salt_len, logr, minr; + size_t key_len; + u_int8_t salt_len, logr, minr; u_int8_t ciphertext[4 * BCRYPT_BLOCKS] = "OrpheanBeholderScryDoubt"; u_int8_t csalt[BCRYPT_MAXSALT]; u_int32_t cdata[BCRYPT_BLOCKS]; - static const char *magic = "$2a$04$"; - - /* Defaults */ - minr = 'a'; - logr = 4; - rounds = 1 << logr; + char arounds[3]; - /* If it starts with the magic string, then skip that */ - if(!strncmp(salt, magic, strlen(magic))) { - salt += strlen(magic); - } - else if (*salt == '$') { + /* Defaults */ + minr = 'a'; + logr = BCRYPT_MINLOGROUNDS; + rounds = 1U << logr; + if (*salt == '$') { /* Discard "$" identifier */ salt++; @@ -166,9 +165,9 @@ crypt_blowfish(const char *key, const ch /* Check for minor versions */ if (salt[1] != '$') { switch (salt[1]) { - case 'a': - /* 'ab' should not yield the same as 'abab' */ - minr = (u_int8_t)salt[1]; + case 'a': /* 'ab' should not yield the same as 'abab' */ + case 'b': /* cap input length at 72 bytes */ + minr = salt[1]; salt++; break; default: @@ -184,21 +183,38 @@ crypt_blowfish(const char *key, const ch /* Out of sync with passwd entry */ return NULL; - /* Computer power doesnt increase linear, 2^x should be fine */ - logr = (u_int8_t)atoi(salt); - rounds = 1 << logr; - if (rounds < BCRYPT_MINROUNDS) + memcpy(arounds, salt, sizeof(arounds)); + if (arounds[sizeof(arounds) - 1] != '$') + return NULL; + arounds[sizeof(arounds) - 1] = 0; + logr = strtonum(arounds, BCRYPT_MINLOGROUNDS, 31, NULL); + if (logr == 0) return NULL; + /* Computer power doesn't increase linearly, 2^x should be fine */ + rounds = 1U << logr; /* Discard num rounds + "$" identifier */ salt += 3; } + if (strlen(salt) * 3 / 4 < BCRYPT_MAXSALT) + return NULL; /* We dont want the base64 salt but the raw data */ - decode_base64(csalt, BCRYPT_MAXSALT, (const u_int8_t *)salt); + decode_base64(csalt, BCRYPT_MAXSALT, (const u_int8_t *) salt); salt_len = BCRYPT_MAXSALT; - key_len = (u_int8_t)(strlen(key) + (minr >= 'a' ? 1 : 0)); + if (minr <= 'a') + key_len = (u_int8_t)(strlen(key) + (minr >= 'a' ? 1 : 0)); + else { + /* strlen() returns a size_t, but the function calls + * below result in implicit casts to a narrower integer + * type, so cap key_len at the actual maximum supported + * length here to avoid integer wraparound */ + key_len = strlen(key); + if (key_len > 72) + key_len = 72; + key_len++; /* include the NUL */ + } /* Setting up S-Boxes and Subkeys */ Blowfish_initstate(&state); @@ -233,7 +249,7 @@ crypt_blowfish(const char *key, const ch encrypted[i++] = '$'; encrypted[i++] = BCRYPT_VERSION; if (minr) - encrypted[i++] = (int8_t)minr; + encrypted[i++] = minr; encrypted[i++] = '$'; snprintf(encrypted + i, 4, "%2.2u$", logr); @@ -241,6 +257,10 @@ crypt_blowfish(const char *key, const ch encode_base64((u_int8_t *) encrypted + i + 3, csalt, BCRYPT_MAXSALT); encode_base64((u_int8_t *) encrypted + strlen(encrypted), ciphertext, 4 * BCRYPT_BLOCKS - 1); + memset(&state, 0, sizeof(state)); + memset(ciphertext, 0, sizeof(ciphertext)); + memset(csalt, 0, sizeof(csalt)); + memset(cdata, 0, sizeof(cdata)); return encrypted; } @@ -273,7 +293,6 @@ encode_base64(u_int8_t *buffer, u_int8_t } *bp = '\0'; } - #if 0 void main() @@ -288,11 +307,11 @@ main() snprintf(salt + 3, 4, "%2.2u$", 5); printf("24 bytes of salt: "); - fgets(salt + 6, 94, stdin); + fgets(salt + 6, sizeof(salt) - 6, stdin); salt[99] = 0; printf("72 bytes of password: "); fpurge(stdin); - fgets(blubber, 73, stdin); + fgets(blubber, sizeof(blubber), stdin); blubber[72] = 0; p = crypt(blubber, salt); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 27 06:55:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 71663FF; Thu, 27 Mar 2014 06:55: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 5CD0A79E; Thu, 27 Mar 2014 06:55: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 s2R6tRXJ033130; Thu, 27 Mar 2014 06:55:27 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2R6tRMH033128; Thu, 27 Mar 2014 06:55:27 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403270655.s2R6tRMH033128@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 27 Mar 2014 06:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263796 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 06:55:27 -0000 Author: hselasky Date: Thu Mar 27 06:55:26 2014 New Revision: 263796 URL: http://svnweb.freebsd.org/changeset/base/263796 Log: MFC r263291 and r263292: Update USB template manual page. Added: stable/10/share/man/man4/usb_template.4 - copied unchanged from r263292, head/share/man/man4/usb_template.4 Deleted: stable/10/share/man/man4/usb2_template.4 Modified: stable/10/share/man/man4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Thu Mar 27 06:36:38 2014 (r263795) +++ stable/10/share/man/man4/Makefile Thu Mar 27 06:55:26 2014 (r263796) @@ -534,6 +534,7 @@ MAN= aac.4 \ ${_urtw.4} \ urtwn.4 \ usb.4 \ + usb_template.4 \ usb_quirk.4 \ uslcom.4 \ utopia.4 \ Copied: stable/10/share/man/man4/usb_template.4 (from r263292, head/share/man/man4/usb_template.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/usb_template.4 Thu Mar 27 06:55:26 2014 (r263796, copy of r263292, head/share/man/man4/usb_template.4) @@ -0,0 +1,83 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2008 Hans Petter Selasky. 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. +.\" +.Dd March 18, 2014 +.Dt USB_TEMPLATE 4 +.Os +. +.Sh NAME +. +. +.Nm usb_template +. +.Nd "USB templates" +. +. +.Sh SYNOPSIS +To compile this module into the kernel, place the following line in +your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device usb_template" +.Ed +.Pp +To load the module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +usb_template_load="YES" +.Ed +. +.Sh DESCRIPTION +The +.Nm +module implements various USB templates that are needed when +programming an USB device side driver. +. +A USB template consists of an USB device descriptor, one or more USB +configuration descriptors, one or more USB interface descriptors, one +or more USB endpoint descriptors, USB strings and additional USB +descriptors. +. +The USB template module currently has templates for USB Mass Storage, +USB CDC Ethernet and Message Transfer Protocol. +. +USB templates are currently selected using the "hw.usb.template" +sysctl. +. +The "hw.usb.template" value can be changed at any time, but will not +have any effect until the USB device has been re-enumerated. +. +. +. +.Sh SEE ALSO +.Xr usb 4 +.Sh STANDARDS +The +.Nm +module complies to the USB 1.0, 2.0 and 3.0 standard. +.Sh HISTORY +The +.Nm +module was written by +.An Hans Petter Selasky Aq hselasky@FreeBSD.org . From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 27 06:59:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 70C94486; Thu, 27 Mar 2014 06:59: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 5C9917C6; Thu, 27 Mar 2014 06:59: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 s2R6xveF033751; Thu, 27 Mar 2014 06:59:57 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2R6xuXY033747; Thu, 27 Mar 2014 06:59:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403270659.s2R6xuXY033747@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 27 Mar 2014 06:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263799 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 06:59:57 -0000 Author: hselasky Date: Thu Mar 27 06:59:56 2014 New Revision: 263799 URL: http://svnweb.freebsd.org/changeset/base/263799 Log: MFC r263423: Try to resolve a possible deadlock when detaching USB devices which create character devices. The deadlock can happen if an application is issuing IOCTLs which require USB refcounting, at the same time the USB device is detaching. There is already a counter in place in the USB device structure to detect this situation, but it was not always checked ahead of invoking functions that might destroy character devices, like detach, set configuration, set alternate interface or detach active kernel driver. Modified: stable/10/sys/dev/usb/usb_dev.c stable/10/sys/dev/usb/usb_device.c stable/10/sys/dev/usb/usb_process.c stable/10/sys/dev/usb/usb_process.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_dev.c ============================================================================== --- stable/10/sys/dev/usb/usb_dev.c Thu Mar 27 06:57:32 2014 (r263798) +++ stable/10/sys/dev/usb/usb_dev.c Thu Mar 27 06:59:56 2014 (r263799) @@ -214,12 +214,13 @@ usb_ref_device(struct usb_cdev_privdata DPRINTFN(2, "device is detached\n"); goto error; } - if (cpd->udev->refcount == USB_DEV_REF_MAX) { - DPRINTFN(2, "no dev ref\n"); - goto error; - } if (need_uref) { DPRINTFN(2, "ref udev - needed\n"); + + if (cpd->udev->refcount == USB_DEV_REF_MAX) { + DPRINTFN(2, "no dev ref\n"); + goto error; + } cpd->udev->refcount++; mtx_unlock(&usb_ref_lock); @@ -293,9 +294,8 @@ error: usbd_enum_unlock(cpd->udev); if (crd->is_uref) { - if (--(cpd->udev->refcount) == 0) { - cv_signal(&cpd->udev->ref_cv); - } + cpd->udev->refcount--; + cv_broadcast(&cpd->udev->ref_cv); } mtx_unlock(&usb_ref_lock); DPRINTFN(2, "fail\n"); @@ -361,10 +361,9 @@ usb_unref_device(struct usb_cdev_privdat crd->is_write = 0; } if (crd->is_uref) { - if (--(cpd->udev->refcount) == 0) { - cv_signal(&cpd->udev->ref_cv); - } crd->is_uref = 0; + cpd->udev->refcount--; + cv_broadcast(&cpd->udev->ref_cv); } mtx_unlock(&usb_ref_lock); } Modified: stable/10/sys/dev/usb/usb_device.c ============================================================================== --- stable/10/sys/dev/usb/usb_device.c Thu Mar 27 06:57:32 2014 (r263798) +++ stable/10/sys/dev/usb/usb_device.c Thu Mar 27 06:59:56 2014 (r263799) @@ -452,6 +452,65 @@ usb_endpoint_foreach(struct usb_device * } /*------------------------------------------------------------------------* + * usb_wait_pending_ref_locked + * + * This function will wait for any USB references to go away before + * returning and disable further USB device refcounting on the + * specified USB device. This function is used when detaching a USB + * device. + *------------------------------------------------------------------------*/ +static void +usb_wait_pending_ref_locked(struct usb_device *udev) +{ +#if USB_HAVE_UGEN + const uint16_t refcount = + usb_proc_is_called_from( + USB_BUS_EXPLORE_PROC(udev->bus)) ? 1 : 2; + + DPRINTF("Refcount = %d\n", (int)refcount); + + while (1) { + /* wait for any pending references to go away */ + mtx_lock(&usb_ref_lock); + if (udev->refcount == refcount) { + /* prevent further refs being taken */ + udev->refcount = USB_DEV_REF_MAX; + mtx_unlock(&usb_ref_lock); + break; + } + usbd_enum_unlock(udev); + cv_wait(&udev->ref_cv, &usb_ref_lock); + mtx_unlock(&usb_ref_lock); + (void) usbd_enum_lock(udev); + } +#endif +} + +/*------------------------------------------------------------------------* + * usb_ref_restore_locked + * + * This function will restore the reference count value after a call + * to "usb_wait_pending_ref_locked()". + *------------------------------------------------------------------------*/ +static void +usb_ref_restore_locked(struct usb_device *udev) +{ +#if USB_HAVE_UGEN + const uint16_t refcount = + usb_proc_is_called_from( + USB_BUS_EXPLORE_PROC(udev->bus)) ? 1 : 2; + + DPRINTF("Refcount = %d\n", (int)refcount); + + /* restore reference count and wakeup waiters, if any */ + mtx_lock(&usb_ref_lock); + udev->refcount = refcount; + cv_broadcast(&udev->ref_cv); + mtx_unlock(&usb_ref_lock); +#endif +} + +/*------------------------------------------------------------------------* * usb_unconfigure * * This function will free all USB interfaces and USB endpoints belonging @@ -1121,6 +1180,9 @@ usb_detach_device(struct usb_device *ude sx_assert(&udev->enum_sx, SA_LOCKED); + /* wait for pending refs to go away */ + usb_wait_pending_ref_locked(udev); + /* * First detach the child to give the child's detach routine a * chance to detach the sub-devices in the correct order. @@ -1147,6 +1209,8 @@ usb_detach_device(struct usb_device *ude usb_detach_device_sub(udev, &iface->subdev, &iface->pnpinfo, flag); } + + usb_ref_restore_locked(udev); } /*------------------------------------------------------------------------* @@ -2088,14 +2152,6 @@ usb_free_device(struct usb_device *udev, udev->ugen_symlink = NULL; } - /* wait for all pending references to go away: */ - mtx_lock(&usb_ref_lock); - udev->refcount--; - while (udev->refcount != 0) { - cv_wait(&udev->ref_cv, &usb_ref_lock); - } - mtx_unlock(&usb_ref_lock); - usb_destroy_dev(udev->ctrl_dev); #endif @@ -2612,8 +2668,14 @@ usb_fifo_free_wrap(struct usb_device *ud /* no need to free this FIFO */ continue; } + /* wait for pending refs to go away */ + usb_wait_pending_ref_locked(udev); + /* free this FIFO */ usb_fifo_free(f); + + /* restore refcount */ + usb_ref_restore_locked(udev); } } #endif Modified: stable/10/sys/dev/usb/usb_process.c ============================================================================== --- stable/10/sys/dev/usb/usb_process.c Thu Mar 27 06:57:32 2014 (r263798) +++ stable/10/sys/dev/usb/usb_process.c Thu Mar 27 06:59:56 2014 (r263799) @@ -501,3 +501,15 @@ usb_proc_rewakeup(struct usb_process *up cv_signal(&up->up_cv); } } + +/*------------------------------------------------------------------------* + * usb_proc_is_called_from + * + * This function will return non-zero if called from inside the USB + * process passed as first argument. Else this function returns zero. + *------------------------------------------------------------------------*/ +int +usb_proc_is_called_from(struct usb_process *up) +{ + return (up->up_curtd == curthread); +} Modified: stable/10/sys/dev/usb/usb_process.h ============================================================================== --- stable/10/sys/dev/usb/usb_process.h Thu Mar 27 06:57:32 2014 (r263798) +++ stable/10/sys/dev/usb/usb_process.h Thu Mar 27 06:59:56 2014 (r263799) @@ -81,6 +81,7 @@ void usb_proc_mwait(struct usb_process * void usb_proc_free(struct usb_process *up); void *usb_proc_msignal(struct usb_process *up, void *pm0, void *pm1); void usb_proc_rewakeup(struct usb_process *up); +int usb_proc_is_called_from(struct usb_process *up); void usb_proc_explore_mwait(struct usb_device *, void *, void *); void *usb_proc_explore_msignal(struct usb_device *, void *, void *); From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 27 16:47:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 61680C5; Thu, 27 Mar 2014 16:47: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 41A3C89D; Thu, 27 Mar 2014 16:47: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 s2RGlaND073516; Thu, 27 Mar 2014 16:47:36 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RGlZtS073511; Thu, 27 Mar 2014 16:47:35 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403271647.s2RGlZtS073511@svn.freebsd.org> From: Alan Somers Date: Thu, 27 Mar 2014 16:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263820 - in stable/10: sys/kern sys/sys tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 16:47:36 -0000 Author: asomers Date: Thu Mar 27 16:47:35 2014 New Revision: 263820 URL: http://svnweb.freebsd.org/changeset/base/263820 Log: MFC r262867 Fix PR kern/185813 "SOCK_SEQPACKET AF_UNIX sockets with asymmetrical buffers drop packets". It was caused by a check for the space available in a sockbuf, but it was checking the wrong sockbuf. sys/sys/sockbuf.h sys/kern/uipc_sockbuf.c Add sbappendaddr_nospacecheck_locked(), which is just like sbappendaddr_locked but doesn't validate the receiving socket's space. Factor out common code into sbappendaddr_locked_internal(). We shouldn't simply make sbappendaddr_locked check the space and then call sbappendaddr_nospacecheck_locked, because that would cause the O(n) function m_length to be called twice. sys/kern/uipc_usrreq.c Use sbappendaddr_nospacecheck_locked for SOCK_SEQPACKET sockets, because the receiving sockbuf's size limit is irrelevant. tests/sys/kern/unix_seqpacket_test.c Now that 185813 is fixed, pipe_128k_8k fails intermittently due to 185812. Make it fail every time by adding a usleep after starting the writer thread and before starting the reader thread in test_pipe. That gives the writer time to fill up its send buffer. Also, clear the expected failure message due to 185813. It actually said "185812", but that was a typo. PR: kern/185813 Modified: stable/10/sys/kern/uipc_sockbuf.c stable/10/sys/kern/uipc_usrreq.c stable/10/sys/sys/sockbuf.h stable/10/tests/sys/kern/unix_seqpacket_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/10/sys/kern/uipc_sockbuf.c Thu Mar 27 16:28:46 2014 (r263819) +++ stable/10/sys/kern/uipc_sockbuf.c Thu Mar 27 16:47:35 2014 (r263820) @@ -620,29 +620,12 @@ sbappendrecord(struct sockbuf *sb, struc SOCKBUF_UNLOCK(sb); } -/* - * Append address and data, and optionally, control (ancillary) data to the - * receive queue of a socket. If present, m0 must include a packet header - * with total length. Returns 0 if no space in sockbuf or insufficient - * mbufs. - */ -int -sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, - struct mbuf *m0, struct mbuf *control) +/* Helper routine that appends data, control, and address to a sockbuf. */ +static int +sbappendaddr_locked_internal(struct sockbuf *sb, const struct sockaddr *asa, + struct mbuf *m0, struct mbuf *control, struct mbuf *ctrl_last) { struct mbuf *m, *n, *nlast; - int space = asa->sa_len; - - SOCKBUF_LOCK_ASSERT(sb); - - if (m0 && (m0->m_flags & M_PKTHDR) == 0) - panic("sbappendaddr_locked"); - if (m0) - space += m0->m_pkthdr.len; - space += m_length(control, &n); - - if (space > sbspace(sb)) - return (0); #if MSIZE <= 256 if (asa->sa_len > MLEN) return (0); @@ -652,8 +635,8 @@ sbappendaddr_locked(struct sockbuf *sb, return (0); m->m_len = asa->sa_len; bcopy(asa, mtod(m, caddr_t), asa->sa_len); - if (n) - n->m_next = m0; /* concatenate data to control */ + if (ctrl_last) + ctrl_last->m_next = m0; /* concatenate data to control */ else control = m0; m->m_next = control; @@ -677,6 +660,50 @@ sbappendaddr_locked(struct sockbuf *sb, * mbufs. */ int +sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, + struct mbuf *m0, struct mbuf *control) +{ + struct mbuf *ctrl_last; + int space = asa->sa_len; + + SOCKBUF_LOCK_ASSERT(sb); + + if (m0 && (m0->m_flags & M_PKTHDR) == 0) + panic("sbappendaddr_locked"); + if (m0) + space += m0->m_pkthdr.len; + space += m_length(control, &ctrl_last); + + if (space > sbspace(sb)) + return (0); + return (sbappendaddr_locked_internal(sb, asa, m0, control, ctrl_last)); +} + +/* + * Append address and data, and optionally, control (ancillary) data to the + * receive queue of a socket. If present, m0 must include a packet header + * with total length. Returns 0 if insufficient mbufs. Does not validate space + * on the receiving sockbuf. + */ +int +sbappendaddr_nospacecheck_locked(struct sockbuf *sb, const struct sockaddr *asa, + struct mbuf *m0, struct mbuf *control) +{ + struct mbuf *ctrl_last; + + SOCKBUF_LOCK_ASSERT(sb); + + ctrl_last = (control == NULL) ? NULL : m_last(control); + return (sbappendaddr_locked_internal(sb, asa, m0, control, ctrl_last)); +} + +/* + * Append address and data, and optionally, control (ancillary) data to the + * receive queue of a socket. If present, m0 must include a packet header + * with total length. Returns 0 if no space in sockbuf or insufficient + * mbufs. + */ +int sbappendaddr(struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control) { Modified: stable/10/sys/kern/uipc_usrreq.c ============================================================================== --- stable/10/sys/kern/uipc_usrreq.c Thu Mar 27 16:28:46 2014 (r263819) +++ stable/10/sys/kern/uipc_usrreq.c Thu Mar 27 16:47:35 2014 (r263820) @@ -892,7 +892,8 @@ uipc_send(struct socket *so, int flags, from = &sun_noname; so2 = unp2->unp_socket; SOCKBUF_LOCK(&so2->so_rcv); - if (sbappendaddr_locked(&so2->so_rcv, from, m, control)) { + if (sbappendaddr_nospacecheck_locked(&so2->so_rcv, from, m, + control)) { sorwakeup_locked(so2); m = NULL; control = NULL; @@ -977,8 +978,14 @@ uipc_send(struct socket *so, int flags, const struct sockaddr *from; from = &sun_noname; - if (sbappendaddr_locked(&so2->so_rcv, from, m, - control)) + /* + * Don't check for space available in so2->so_rcv. + * Unix domain sockets only check for space in the + * sending sockbuf, and that check is performed one + * level up the stack. + */ + if (sbappendaddr_nospacecheck_locked(&so2->so_rcv, + from, m, control)) control = NULL; break; } Modified: stable/10/sys/sys/sockbuf.h ============================================================================== --- stable/10/sys/sys/sockbuf.h Thu Mar 27 16:28:46 2014 (r263819) +++ stable/10/sys/sys/sockbuf.h Thu Mar 27 16:47:35 2014 (r263820) @@ -127,6 +127,8 @@ int sbappendaddr(struct sockbuf *sb, con struct mbuf *m0, struct mbuf *control); int sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control); +int sbappendaddr_nospacecheck_locked(struct sockbuf *sb, + const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control); int sbappendcontrol(struct sockbuf *sb, struct mbuf *m0, struct mbuf *control); int sbappendcontrol_locked(struct sockbuf *sb, struct mbuf *m0, Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- stable/10/tests/sys/kern/unix_seqpacket_test.c Thu Mar 27 16:28:46 2014 (r263819) +++ stable/10/tests/sys/kern/unix_seqpacket_test.c Thu Mar 27 16:47:35 2014 (r263820) @@ -360,6 +360,12 @@ test_pipe(size_t sndbufsize, size_t rcvb reader_data.so = sv[1]; ATF_REQUIRE_EQ(0, pthread_create(&writer, NULL, test_pipe_writer, (void*)&writer_data)); + /* + * Give the writer time to start writing, and hopefully block, before + * starting the reader. This increases the likelihood of the test case + * failing due to PR kern/185812 + */ + usleep(1000); ATF_REQUIRE_EQ(0, pthread_create(&reader, NULL, test_pipe_reader, (void*)&reader_data)); @@ -946,7 +952,6 @@ ATF_TC_BODY(pipe_simulator_8k_128k, tc) ATF_TC_WITHOUT_HEAD(pipe_simulator_128k_8k); ATF_TC_BODY(pipe_simulator_128k_8k, tc) { - atf_tc_expect_fail("PR kern/185812 SOCK_SEQPACKET AF_UNIX sockets with asymmetrical buffers drop packets"); test_pipe_simulator(131072, 8192); } From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 27 20:13:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 03DFA6C0; Thu, 27 Mar 2014 20:13: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 C9F1EEFD; Thu, 27 Mar 2014 20:13: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 s2RKDrW7059396; Thu, 27 Mar 2014 20:13:53 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RKDrfX059395; Thu, 27 Mar 2014 20:13:53 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403272013.s2RKDrfX059395@svn.freebsd.org> From: Christian Brueffer Date: Thu, 27 Mar 2014 20:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263830 - stable/10/libexec/bootpd/tools/bootptest X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 20:13:54 -0000 Author: brueffer Date: Thu Mar 27 20:13:53 2014 New Revision: 263830 URL: http://svnweb.freebsd.org/changeset/base/263830 Log: MFC: r263121 Re-format the license to conform to our BSD license template as much as possible. This does not change the wording in any way. Remove the 3rd clause ("advertising clause") of the BSD license as permitted by the University of Berkeley on July 22, 1999. While the clause itself mentions Lawrence Berkeley Laboratory, UCB is the sole copyright holder of this file. Reviewed by: imp, emaste, eadler Modified: stable/10/libexec/bootpd/tools/bootptest/print-bootp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/bootpd/tools/bootptest/print-bootp.c ============================================================================== --- stable/10/libexec/bootpd/tools/bootptest/print-bootp.c Thu Mar 27 20:10:26 2014 (r263829) +++ stable/10/libexec/bootpd/tools/bootptest/print-bootp.c Thu Mar 27 20:13:53 2014 (r263830) @@ -1,19 +1,18 @@ /* - * Copyright (c) 1988-1990 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988-1990 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that: (1) source code distributions - * retain the above copyright notice and this paragraph in its entirety, (2) - * distributions including binary code include the above copyright notice and - * this paragraph in its entirety in the documentation or other materials - * provided with the distribution, and (3) all advertising materials mentioning - * features or use of this software display the following acknowledgement: - * ``This product includes software developed by the University of California, - * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of - * the University nor the names of its contributors may be used to endorse - * or promote products derived from this software without specific prior - * written permission. + * modification, are permitted provided that: + * 1. Source code distributions retain the above copyright + * notice and this paragraph in its entirety + * 2. Distributions including binary code include the above copyright + * notice and this paragraph in its entirety in the documentation + * or other materials provided with the distribution, and + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 27 20:19:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9841DDAB; Thu, 27 Mar 2014 20:19: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 845CEF40; Thu, 27 Mar 2014 20:19: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 s2RKJBoR060293; Thu, 27 Mar 2014 20:19:11 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RKJBXj060292; Thu, 27 Mar 2014 20:19:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403272019.s2RKJBXj060292@svn.freebsd.org> From: Christian Brueffer Date: Thu, 27 Mar 2014 20:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263835 - stable/10/usr.sbin/btxld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 20:19:11 -0000 Author: brueffer Date: Thu Mar 27 20:19:11 2014 New Revision: 263835 URL: http://svnweb.freebsd.org/changeset/base/263835 Log: MFC: r262484 In puthdr(), start the ELF .data section on a new page, as this is what btxldr expects (.set MEM_DATA,start+0x1000 in btxldr.S). This makes resulting ELF binaries bootable with grub, gptboot and boot2. PR: 153801 Submitted by: Gleb Kurtsou Tested by: Ruben Kerkhof Glanced at by: jhb, peter Modified: stable/10/usr.sbin/btxld/btxld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/btxld/btxld.c ============================================================================== --- stable/10/usr.sbin/btxld/btxld.c Thu Mar 27 20:15:35 2014 (r263834) +++ stable/10/usr.sbin/btxld/btxld.c Thu Mar 27 20:19:11 2014 (r263835) @@ -426,7 +426,7 @@ puthdr(int fd, struct hdr *hdr) le32toh(eh.p[0].p_filesz)); eh.p[1].p_vaddr = eh.p[1].p_paddr = htole32(align(le32toh(eh.p[0].p_paddr) + le32toh(eh.p[0].p_memsz), - 4)); + 4096)); eh.p[1].p_filesz = eh.p[1].p_memsz = htole32(hdr->data); eh.sh[2].sh_addr = eh.p[0].p_vaddr; eh.sh[2].sh_offset = eh.p[0].p_offset; From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 27 20:32:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 878CE3D3; Thu, 27 Mar 2014 20:32: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 73981159; Thu, 27 Mar 2014 20:32: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 s2RKWxce067848; Thu, 27 Mar 2014 20:32:59 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RKWxuF067847; Thu, 27 Mar 2014 20:32:59 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403272032.s2RKWxuF067847@svn.freebsd.org> From: Dimitry Andric Date: Thu, 27 Mar 2014 20:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263838 - in stable: 10 9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 20:32:59 -0000 Author: dim Date: Thu Mar 27 20:32:58 2014 New Revision: 263838 URL: http://svnweb.freebsd.org/changeset/base/263838 Log: MFC r263692: Add a note to UPDATING about customized kernel configuration files now requiring -gdwarf-2 for debug info, when using clang 3.4. Suggested by: adrian Modified: stable/10/UPDATING Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/UPDATING (contents, props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Thu Mar 27 20:21:13 2014 (r263837) +++ stable/10/UPDATING Thu Mar 27 20:32:58 2014 (r263838) @@ -18,7 +18,16 @@ older version of current is a bit fragil 20140321: - Clang and llvm have been upgraded to 3.4 release. + Clang and llvm have been upgraded to 3.4 release. Please note that + clang 3.4 now defaults to DWARF4 debug information format when you + specify -g. Since kgdb(1) only supports DWARF2, you should update any + customized kernel configurations which include debug information to + explicitly use -gdwarf-2, e.g: + + makeoptions DEBUG=-gdwarf-2 + + This has already been applied to the appropriate GENERIC configuration + files, so if you inherit from those, no changes are required. 20140306: If a Makefile in a tests/ directory was auto-generating a Kyuafile From owner-svn-src-stable-10@FreeBSD.ORG Thu Mar 27 20:46:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 96B6C9D5; Thu, 27 Mar 2014 20:46: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 83104258; Thu, 27 Mar 2014 20:46: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 s2RKklcd072563; Thu, 27 Mar 2014 20:46:47 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RKklUT072562; Thu, 27 Mar 2014 20:46:47 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403272046.s2RKklUT072562@svn.freebsd.org> From: Dimitry Andric Date: Thu, 27 Mar 2014 20:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263839 - in stable: 10/sbin/devd 9/sbin/devd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 20:46:47 -0000 Author: dim Date: Thu Mar 27 20:46:46 2014 New Revision: 263839 URL: http://svnweb.freebsd.org/changeset/base/263839 Log: MFC r263694: Apply a temporary band-aid for building devd with clang 3.4, libstdc++ and -Wsystem-headers enabled (which is the default for any non-zero WARNS level, crazily enough!). This is primarily meant to be MFC'd as soon as possible. Modified: stable/10/sbin/devd/Makefile Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sbin/devd/Makefile Directory Properties: stable/9/sbin/devd/ (props changed) Modified: stable/10/sbin/devd/Makefile ============================================================================== --- stable/10/sbin/devd/Makefile Thu Mar 27 20:32:58 2014 (r263838) +++ stable/10/sbin/devd/Makefile Thu Mar 27 20:46:46 2014 (r263839) @@ -13,6 +13,7 @@ LDADD= -ll -lutil YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} +CFLAGS.clang+=-Wno-keyword-compat CLEANFILES= y.output From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 28 01:13:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5FAF6A80; Fri, 28 Mar 2014 01:13: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 3185621F; Fri, 28 Mar 2014 01:13: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 s2S1D9kv087864; Fri, 28 Mar 2014 01:13:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2S1D9Ps087863; Fri, 28 Mar 2014 01:13:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403280113.s2S1D9Ps087863@svn.freebsd.org> From: Xin LI Date: Fri, 28 Mar 2014 01:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263853 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 01:13:09 -0000 Author: delphij Date: Fri Mar 28 01:13:08 2014 New Revision: 263853 URL: http://svnweb.freebsd.org/changeset/base/263853 Log: MFC r259180 (pjd) + r263123: Hide a few messages under bootverbose. Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Mar 27 23:51:39 2014 (r263852) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Mar 28 01:13:08 2014 (r263853) @@ -182,7 +182,8 @@ netvsc_drv_init(void) static void netvsc_init(void) { - printf("Netvsc initializing... "); + if (bootverbose) + printf("Netvsc initializing... "); /* * XXXKYS: cleanup initialization @@ -190,9 +191,10 @@ netvsc_init(void) if (!cold && !g_netvsc_drv.drv_inited) { g_netvsc_drv.drv_inited = 1; netvsc_drv_init(); - } else { + if (bootverbose) + printf("done!\n"); + } else if (bootverbose) printf("Already initialized!\n"); - } } /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ @@ -213,7 +215,8 @@ netvsc_probe(device_t dev) p = vmbus_get_type(dev); if (!memcmp(p, &g_net_vsc_device_type.data, sizeof(hv_guid))) { device_set_desc(dev, "Synthetic Network Interface"); - printf("Netvsc probe... DONE \n"); + if (bootverbose) + printf("Netvsc probe... DONE \n"); return (0); } @@ -299,7 +302,8 @@ netvsc_detach(device_t dev) { struct hv_device *hv_device = vmbus_get_devctx(dev); - printf("netvsc_detach\n"); + if (bootverbose) + printf("netvsc_detach\n"); /* * XXXKYS: Need to clean up all our @@ -894,7 +898,8 @@ hn_stop(hn_softc_t *sc) ifp = sc->hn_ifp; - printf(" Closing Device ...\n"); + if (bootverbose) + printf(" Closing Device ...\n"); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->hn_initdone = 0; From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 28 08:55:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9F4B6FCD; Fri, 28 Mar 2014 08:55: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 8AFF8F90; Fri, 28 Mar 2014 08:55: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 s2S8tYXY075048; Fri, 28 Mar 2014 08:55:34 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2S8tYXj075047; Fri, 28 Mar 2014 08:55:34 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403280855.s2S8tYXj075047@svn.freebsd.org> From: Christian Brueffer Date: Fri, 28 Mar 2014 08:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263869 - stable/10/sys/dev/amdtemp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 08:55:34 -0000 Author: brueffer Date: Fri Mar 28 08:55:34 2014 New Revision: 263869 URL: http://svnweb.freebsd.org/changeset/base/263869 Log: MFC: r263169 Add support for AMD Family 16h (Kabini) sensor devices. PR: 186587 Submitted by: David Rufino Modified: stable/10/sys/dev/amdtemp/amdtemp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/amdtemp/amdtemp.c ============================================================================== --- stable/10/sys/dev/amdtemp/amdtemp.c Fri Mar 28 08:23:39 2014 (r263868) +++ stable/10/sys/dev/amdtemp/amdtemp.c Fri Mar 28 08:55:34 2014 (r263869) @@ -79,6 +79,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC12 0x1403 #define DEVICEID_AMD_MISC14 0x1703 #define DEVICEID_AMD_MISC15 0x1603 +#define DEVICEID_AMD_MISC16 0x1533 static struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -90,6 +91,7 @@ static struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_MISC12 }, { VENDORID_AMD, DEVICEID_AMD_MISC14 }, { VENDORID_AMD, DEVICEID_AMD_MISC15 }, + { VENDORID_AMD, DEVICEID_AMD_MISC16 }, { 0, 0 } }; @@ -204,6 +206,7 @@ amdtemp_probe(device_t dev) case 0x12: case 0x14: case 0x15: + case 0x16: break; default: return (ENXIO); @@ -327,6 +330,7 @@ amdtemp_attach(device_t dev) case 0x12: case 0x14: case 0x15: + case 0x16: /* * There is only one sensor per package. */ From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 28 15:09:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C72E8FE9; Fri, 28 Mar 2014 15:09: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 B323B8C0; Fri, 28 Mar 2014 15:09: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 s2SF9Zdg028091; Fri, 28 Mar 2014 15:09:35 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SF9ZT7028090; Fri, 28 Mar 2014 15:09:35 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403281509.s2SF9ZT7028090@svn.freebsd.org> From: Alan Somers Date: Fri, 28 Mar 2014 15:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263874 - stable/10/cddl/contrib/opensolaris/lib/libuutil/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 15:09:35 -0000 Author: asomers Date: Fri Mar 28 15:09:35 2014 New Revision: 263874 URL: http://svnweb.freebsd.org/changeset/base/263874 Log: MFC r262912 cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c Fix a memory leak in uu_avl_pool_create: pthread_mutex_init without a corresponding pthread_mutex_destroy. It shows up, among other places, when doing "zfs list". Modified: stable/10/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c Fri Mar 28 12:50:39 2014 (r263873) +++ stable/10/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c Fri Mar 28 15:09:35 2014 (r263874) @@ -128,6 +128,7 @@ uu_avl_pool_destroy(uu_avl_pool_t *pp) pp->uap_next->uap_prev = pp->uap_prev; pp->uap_prev->uap_next = pp->uap_next; (void) pthread_mutex_unlock(&uu_apool_list_lock); + (void) pthread_mutex_destroy(&pp->uap_lock); pp->uap_prev = NULL; pp->uap_next = NULL; uu_free(pp); From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 28 15:38:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E743BB2B; Fri, 28 Mar 2014 15:38: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 D22C4B8B; Fri, 28 Mar 2014 15:38: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 s2SFceko040246; Fri, 28 Mar 2014 15:38:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SFcdO2040237; Fri, 28 Mar 2014 15:38:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403281538.s2SFcdO2040237@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 28 Mar 2014 15:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263875 - in stable/10/sys: amd64/amd64 amd64/include kern sys vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 15:38:41 -0000 Author: kib Date: Fri Mar 28 15:38:38 2014 New Revision: 263875 URL: http://svnweb.freebsd.org/changeset/base/263875 Log: MFC r263475: Fix two issues with /dev/mem access on amd64, both causing kernel page faults. First, for accesses to direct map region should check for the limit by which direct map is instantiated. Second, for accesses to the kernel map, use a new thread private flag TDP_DEVMEMIO, which instructs vm_fault() to return error when fault happens on the MAP_ENTRY_NOFAULT entry, instead of panicing. MFC r263498: Add change forgotten in r263475. Make dmaplimit accessible outside amd64/pmap.c. Modified: stable/10/sys/amd64/amd64/mem.c stable/10/sys/amd64/amd64/pmap.c stable/10/sys/amd64/amd64/trap.c stable/10/sys/amd64/include/pmap.h stable/10/sys/kern/subr_trap.c stable/10/sys/sys/proc.h stable/10/sys/vm/vm_fault.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/mem.c ============================================================================== --- stable/10/sys/amd64/amd64/mem.c Fri Mar 28 15:09:35 2014 (r263874) +++ stable/10/sys/amd64/amd64/mem.c Fri Mar 28 15:38:38 2014 (r263875) @@ -76,14 +76,16 @@ MALLOC_DEFINE(M_MEMDESC, "memdesc", "mem int memrw(struct cdev *dev, struct uio *uio, int flags) { - int o; - u_long c = 0, v; struct iovec *iov; - int error = 0; + u_long c, v; + int error, o, sflags; vm_offset_t addr, eaddr; GIANT_REQUIRED; + error = 0; + c = 0; + sflags = curthread_pflags_set(TDP_DEVMEMIO); while (uio->uio_resid > 0 && error == 0) { iov = uio->uio_iov; if (iov->iov_len == 0) { @@ -98,7 +100,15 @@ memrw(struct cdev *dev, struct uio *uio, kmemphys: o = v & PAGE_MASK; c = min(uio->uio_resid, (u_int)(PAGE_SIZE - o)); - error = uiomove((void *)PHYS_TO_DMAP(v), (int)c, uio); + v = PHYS_TO_DMAP(v); + if (v < DMAP_MIN_ADDRESS || + (v > DMAP_MIN_ADDRESS + dmaplimit && + v <= DMAP_MAX_ADDRESS) || + pmap_kextract(v) == 0) { + error = EFAULT; + goto ret; + } + error = uiomove((void *)v, (int)c, uio); continue; } else if (dev2unit(dev) == CDEV_MINOR_KMEM) { @@ -119,22 +129,30 @@ kmemphys: addr = trunc_page(v); eaddr = round_page(v + c); - if (addr < VM_MIN_KERNEL_ADDRESS) - return (EFAULT); - for (; addr < eaddr; addr += PAGE_SIZE) - if (pmap_extract(kernel_pmap, addr) == 0) - return (EFAULT); - + if (addr < VM_MIN_KERNEL_ADDRESS) { + error = EFAULT; + goto ret; + } + for (; addr < eaddr; addr += PAGE_SIZE) { + if (pmap_extract(kernel_pmap, addr) == 0) { + error = EFAULT; + goto ret; + } + } if (!kernacc((caddr_t)(long)v, c, uio->uio_rw == UIO_READ ? - VM_PROT_READ : VM_PROT_WRITE)) - return (EFAULT); + VM_PROT_READ : VM_PROT_WRITE)) { + error = EFAULT; + goto ret; + } error = uiomove((caddr_t)(long)v, (int)c, uio); continue; } /* else panic! */ } +ret: + curthread_pflags_restore(sflags); return (error); } Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Fri Mar 28 15:09:35 2014 (r263874) +++ stable/10/sys/amd64/amd64/pmap.c Fri Mar 28 15:38:38 2014 (r263875) @@ -321,7 +321,7 @@ SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTL "Number of kernel page table pages allocated on bootup"); static int ndmpdp; -static vm_paddr_t dmaplimit; +vm_paddr_t dmaplimit; vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS; pt_entry_t pg_nx; Modified: stable/10/sys/amd64/amd64/trap.c ============================================================================== --- stable/10/sys/amd64/amd64/trap.c Fri Mar 28 15:09:35 2014 (r263874) +++ stable/10/sys/amd64/amd64/trap.c Fri Mar 28 15:38:38 2014 (r263875) @@ -788,6 +788,12 @@ nogo: frame->tf_rip = (long)curpcb->pcb_onfault; return (0); } + if ((td->td_pflags & TDP_DEVMEMIO) != 0) { + KASSERT(curpcb->pcb_onfault != NULL, + ("/dev/mem without pcb_onfault")); + frame->tf_rip = (long)curpcb->pcb_onfault; + return (0); + } trap_fatal(frame, eva); return (-1); } Modified: stable/10/sys/amd64/include/pmap.h ============================================================================== --- stable/10/sys/amd64/include/pmap.h Fri Mar 28 15:09:35 2014 (r263874) +++ stable/10/sys/amd64/include/pmap.h Fri Mar 28 15:38:38 2014 (r263875) @@ -368,6 +368,7 @@ extern vm_paddr_t phys_avail[]; extern vm_paddr_t dump_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; +extern vm_paddr_t dmaplimit; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) Modified: stable/10/sys/kern/subr_trap.c ============================================================================== --- stable/10/sys/kern/subr_trap.c Fri Mar 28 15:09:35 2014 (r263874) +++ stable/10/sys/kern/subr_trap.c Fri Mar 28 15:38:38 2014 (r263875) @@ -155,6 +155,8 @@ userret(struct thread *td, struct trapfr ("userret: Returning with %d locks held", td->td_locks)); KASSERT((td->td_pflags & TDP_NOFAULTING) == 0, ("userret: Returning with pagefaults disabled")); + KASSERT((td->td_pflags & TDP_DEVMEMIO) == 0, + ("userret: Returning with /dev/mem i/o leaked")); KASSERT(td->td_no_sleeping == 0, ("userret: Returning with sleep disabled")); KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0, Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Fri Mar 28 15:09:35 2014 (r263874) +++ stable/10/sys/sys/proc.h Fri Mar 28 15:38:38 2014 (r263875) @@ -424,6 +424,7 @@ do { \ #define TDP_RESETSPUR 0x04000000 /* Reset spurious page fault history. */ #define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ #define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ +#define TDP_DEVMEMIO 0x20000000 /* Accessing memory for /dev/mem */ /* * Reasons that the current thread can not be run yet. Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Fri Mar 28 15:09:35 2014 (r263874) +++ stable/10/sys/vm/vm_fault.c Fri Mar 28 15:38:38 2014 (r263875) @@ -276,6 +276,10 @@ RetryFault:; map_generation = fs.map->timestamp; if (fs.entry->eflags & MAP_ENTRY_NOFAULT) { + if ((curthread->td_pflags & TDP_DEVMEMIO) != 0) { + vm_map_unlock_read(fs.map); + return (KERN_FAILURE); + } panic("vm_fault: fault on nofault entry, addr: %lx", (u_long)vaddr); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 28 16:27:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EDF072C4; Fri, 28 Mar 2014 16:27: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 DA37BBE; Fri, 28 Mar 2014 16:27: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 s2SGRmxN061168; Fri, 28 Mar 2014 16:27:48 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SGRmbZ061165; Fri, 28 Mar 2014 16:27:48 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403281627.s2SGRmbZ061165@svn.freebsd.org> From: Alan Somers Date: Fri, 28 Mar 2014 16:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263880 - stable/10/sbin/devd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 16:27:49 -0000 Author: asomers Date: Fri Mar 28 16:27:48 2014 New Revision: 263880 URL: http://svnweb.freebsd.org/changeset/base/263880 Log: MFC r262914 sbin/devd/devd.8 sbin/devd/devd.cc Add a -q flag to devd that will suppress syslog logging at LOG_NOTICE or below. Modified: stable/10/sbin/devd/devd.8 stable/10/sbin/devd/devd.cc Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/devd/devd.8 ============================================================================== --- stable/10/sbin/devd/devd.8 Fri Mar 28 16:11:20 2014 (r263879) +++ stable/10/sbin/devd/devd.8 Fri Mar 28 16:27:48 2014 (r263880) @@ -33,7 +33,7 @@ .Nd "device state change daemon" .Sh SYNOPSIS .Nm -.Op Fl dn +.Op Fl dnq .Op Fl f Ar file .Op Fl l Ar num .Sh DESCRIPTION @@ -63,6 +63,8 @@ The default connection limit is 10. .It Fl n Do not process all pending events before becoming a daemon. Instead, call daemon right away. +.It Fl q +Quiet mode. Only log messages at priority LOG_WARNING or above. .El .Sh IMPLEMENTATION NOTES The Modified: stable/10/sbin/devd/devd.cc ============================================================================== --- stable/10/sbin/devd/devd.cc Fri Mar 28 16:11:20 2014 (r263879) +++ stable/10/sbin/devd/devd.cc Fri Mar 28 16:27:48 2014 (r263880) @@ -129,8 +129,9 @@ static const char detach = '-'; static struct pidfh *pfh; -int dflag; -int nflag; +static int no_daemon = 0; +static int daemonize_quick = 0; +static int quiet_mode = 0; static unsigned total_events = 0; static volatile sig_atomic_t got_siginfo = 0; static volatile sig_atomic_t romeo_must_die = 0; @@ -291,7 +292,7 @@ match::do_match(config &c) * can consume excessive amounts of systime inside of connect(). Only * log when we're in -d mode. */ - if (dflag) { + if (no_daemon) { devdlog(LOG_DEBUG, "Testing %s=%s against %s, invert=%d\n", _var.c_str(), value.c_str(), _re.c_str(), _inv); } @@ -401,7 +402,7 @@ var_list::set_variable(const string &var * can consume excessive amounts of systime inside of connect(). Only * log when we're in -d mode. */ - if (dflag) + if (no_daemon) devdlog(LOG_DEBUG, "setting %s=%s\n", var.c_str(), val.c_str()); _vars[var] = val; } @@ -945,7 +946,7 @@ event_loop(void) accepting = 1; max_fd = max(fd, server_fd) + 1; while (!romeo_must_die) { - if (!once && !dflag && !nflag) { + if (!once && !no_daemon && !daemonize_quick) { // Check to see if we have any events pending. tv.tv_sec = 0; tv.tv_usec = 0; @@ -1139,9 +1140,9 @@ devdlog(int priority, const char* fmt, . va_list argp; va_start(argp, fmt); - if (dflag) + if (no_daemon) vfprintf(stderr, fmt, argp); - else + else if ((! quiet_mode) || (priority <= LOG_WARNING)) vsyslog(priority, fmt, argp); va_end(argp); } @@ -1149,7 +1150,7 @@ devdlog(int priority, const char* fmt, . static void usage() { - fprintf(stderr, "usage: %s [-dn] [-l connlimit] [-f file]\n", + fprintf(stderr, "usage: %s [-dnq] [-l connlimit] [-f file]\n", getprogname()); exit(1); } @@ -1179,10 +1180,10 @@ main(int argc, char **argv) int ch; check_devd_enabled(); - while ((ch = getopt(argc, argv, "df:l:n")) != -1) { + while ((ch = getopt(argc, argv, "df:l:nq")) != -1) { switch (ch) { case 'd': - dflag++; + no_daemon = 1; break; case 'f': configfile = optarg; @@ -1191,7 +1192,10 @@ main(int argc, char **argv) max_clients = MAX(1, strtoul(optarg, NULL, 0)); break; case 'n': - nflag++; + daemonize_quick = 1; + break; + case 'q': + quiet_mode = 1; break; default: usage(); @@ -1199,7 +1203,7 @@ main(int argc, char **argv) } cfg.parse(); - if (!dflag && nflag) { + if (!no_daemon && daemonize_quick) { cfg.open_pidfile(); daemon(0, 0); cfg.write_pidfile(); From owner-svn-src-stable-10@FreeBSD.ORG Fri Mar 28 20:12:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A08455F2; Fri, 28 Mar 2014 20:12: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 82D7CD64; Fri, 28 Mar 2014 20:12:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SKCVNq055537; Fri, 28 Mar 2014 20:12:31 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SKCVcS055535; Fri, 28 Mar 2014 20:12:31 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201403282012.s2SKCVcS055535@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 28 Mar 2014 20:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263882 - in stable/10/share: examples/etc mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 20:12:31 -0000 Author: jkim Date: Fri Mar 28 20:12:30 2014 New Revision: 263882 URL: http://svnweb.freebsd.org/changeset/base/263882 Log: MFC: r263435 Add new CPUTYPEs supported by Clang 3.4. Modified: stable/10/share/examples/etc/make.conf stable/10/share/mk/bsd.cpu.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/etc/make.conf ============================================================================== --- stable/10/share/examples/etc/make.conf Fri Mar 28 16:31:12 2014 (r263881) +++ stable/10/share/examples/etc/make.conf Fri Mar 28 20:12:30 2014 (r263882) @@ -45,8 +45,8 @@ # if omitted), ultrasparc3 # Additionally the following CPU types are recognized by clang: # Intel x86 architecture (for both amd64 and i386): -# (AMD CPUs) bdver2, bdver1, btver2, btver1 -# (Intel CPUs) core-avx2, core-avx-i, corei7-avx, corei7, atom +# (AMD CPUs) bdver3, bdver2, bdver1, btver2, btver1 +# (Intel CPUs) slm, core-avx2, core-avx-i, corei7-avx, corei7, atom # # (?= allows to buildworld for a different CPUTYPE.) # Modified: stable/10/share/mk/bsd.cpu.mk ============================================================================== --- stable/10/share/mk/bsd.cpu.mk Fri Mar 28 16:31:12 2014 (r263881) +++ stable/10/share/mk/bsd.cpu.mk Fri Mar 28 20:12:30 2014 (r263882) @@ -142,7 +142,8 @@ _CPUCFLAGS = -mcpu=ultrasparc3 # presence of a CPU feature. . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "bdver2" || ${CPUTYPE} == "bdver1" +. if ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2" || \ + ${CPUTYPE} == "bdver1" MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} == "btver2" MACHINE_CPU = avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 @@ -170,7 +171,7 @@ MACHINE_CPU = k5 i586 MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "core-avx-i" || ${CPUTYPE} == "corei7-avx" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "corei7" +. elif ${CPUTYPE} == "slm" || ${CPUTYPE} == "corei7" MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "penryn" MACHINE_CPU = sse41 ssse3 sse3 sse2 sse i686 mmx i586 @@ -204,7 +205,8 @@ MACHINE_CPU = mmx . endif MACHINE_CPU += i486 . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "bdver2" || ${CPUTYPE} == "bdver1" +. if ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2" || \ + ${CPUTYPE} == "bdver1" MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 . elif ${CPUTYPE} == "btver2" MACHINE_CPU = avx sse42 sse41 ssse3 sse4a sse3 @@ -222,7 +224,7 @@ MACHINE_CPU = k8 3dnow MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "core-avx-i" || ${CPUTYPE} == "corei7-avx" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 -. elif ${CPUTYPE} == "corei7" +. elif ${CPUTYPE} == "slm" || ${CPUTYPE} == "corei7" MACHINE_CPU = sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "penryn" MACHINE_CPU = sse41 ssse3 sse3 From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 29 04:44:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DF2C5F62; Sat, 29 Mar 2014 04:44: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 BF90430A; Sat, 29 Mar 2014 04:44: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 s2T4iPG3072355; Sat, 29 Mar 2014 04:44:25 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2T4iOhX072350; Sat, 29 Mar 2014 04:44:24 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201403290444.s2T4iOhX072350@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 29 Mar 2014 04:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263906 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 04:44:26 -0000 Author: edwin Date: Sat Mar 29 04:44:24 2014 New Revision: 263906 URL: http://svnweb.freebsd.org/changeset/base/263906 Log: MFC of 263901, tzdata2014b - Update antartica. - Comments about historical data for Hawaii. - Update details for Crimea on 30 March - Move location data Simferopol. Modified: stable/10/contrib/tzdata/africa stable/10/contrib/tzdata/antarctica stable/10/contrib/tzdata/australasia stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/zone.tab Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/africa ============================================================================== --- stable/10/contrib/tzdata/africa Sat Mar 29 04:25:04 2014 (r263905) +++ stable/10/contrib/tzdata/africa Sat Mar 29 04:44:24 2014 (r263906) @@ -868,7 +868,10 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # Another source (specifying the time for start and end in the decree): # http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html -# From Paul Eggert (2013-10-03): +# From Sebastien Willemijns (2014-03-18): +# http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp + +# From Paul Eggert (2014-03-19): # To estimate what the Moroccan government will do in future years, # transition dates for 2014 through 2038 were determined by running # the following program under GNU Emacs 24.3: Modified: stable/10/contrib/tzdata/antarctica ============================================================================== --- stable/10/contrib/tzdata/antarctica Sat Mar 29 04:25:04 2014 (r263905) +++ stable/10/contrib/tzdata/antarctica Sat Mar 29 04:44:24 2014 (r263906) @@ -230,24 +230,41 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 2 # year-round base # Scott Base, Ross Island, since 1957-01. # See Pacific/Auckland. -# -# These rules for New Zealand are stolen from the 'australasia' file. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule NZAQ 1974 only - Nov 3 2:00s 1:00 D -Rule NZAQ 1975 1988 - Oct lastSun 2:00s 1:00 D -Rule NZAQ 1989 only - Oct 8 2:00s 1:00 D -Rule NZAQ 1990 2006 - Oct Sun>=1 2:00s 1:00 D -Rule NZAQ 1975 only - Feb 23 2:00s 0 S -Rule NZAQ 1976 1989 - Mar Sun>=1 2:00s 0 S -Rule NZAQ 1990 2007 - Mar Sun>=15 2:00s 0 S -Rule NZAQ 2007 max - Sep lastSun 2:00s 1:00 D -Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S # Norway - territories # Bouvet (never inhabited) # # claims # Peter I Island (never inhabited) +# +# year-round base +# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12 +# +# From Paul-Inge Flakstad (2014-03-10): +# I recently had a long dialog about this with the developer of timegenie.com. +# In the absence of specific dates, he decided to choose some likely ones: +# GMT +1 - From March 1 to the last Sunday in March +# GMT +2 - From the last Sunday in March until the last Sunday in October +# GMT +1 - From the last Sunday in October until November 7 +# GMT +0 - From November 7 until March 1 +# The dates for switching to and from UTC+0 will probably not be absolutely +# correct, but they should be quite close to the actual dates. +# +# From Paul Eggert (2014-03-21): +# The CET-switching Troll rules require zic from tzcode 2014b or later, so as +# suggested by Bengt-Inge Larsson comment them out for now, and approximate +# with only UTC and CEST. Uncomment them when 2014b is more prevalent. +# +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +#Rule Troll 2005 max - Mar 1 1:00u 1:00 CET +Rule Troll 2005 max - Mar lastSun 1:00u 2:00 CEST +#Rule Troll 2005 max - Oct lastSun 1:00u 1:00 CET +#Rule Troll 2004 max - Nov 7 1:00u 0:00 UTC +# Remove the following line when uncommenting the above '#Rule' lines. +Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Antarctica/Troll 0 - zzz 2005 Feb 12 + 0:00 Troll %s # Poland - year-round base # Arctowski, King George Island, -620945-0582745, since 1977 Modified: stable/10/contrib/tzdata/australasia ============================================================================== --- stable/10/contrib/tzdata/australasia Sat Mar 29 04:25:04 2014 (r263905) +++ stable/10/contrib/tzdata/australasia Sat Mar 29 04:44:24 2014 (r263906) @@ -763,14 +763,29 @@ Zone Pacific/Funafuti 11:56:52 - LMT 190 # Johnston # -# From Paul Eggert (2013-09-03): +# From Paul Eggert (2014-03-11): +# Sometimes Johnston kept Hawaii time, and sometimes it was an hour behind. +# Details are uncertain. We have no data for Johnston after 1970, so +# treat it like Hawaii for now. +# # In his memoirs of June 6th to October 4, 1945 # (2005), Herbert C. Bach writes, # "We started our letdown to Kwajalein Atoll and landed there at 5:00 AM # Johnston time, 1:30 AM Kwajalein time." This was in June 1945, and # confirms that Johnston kept the same time as Honolulu in summer 1945. -# We have no better information, so for now, assume this has been true -# indefinitely into the past. +# +# From Lyle McElhaney (2014-03-11): +# [W]hen JI was being used for that [atomic bomb] testing, the time being used +# was not Hawaiian time but rather the same time being used on the ships, +# which had a GMT offset of -11 hours. This apparently applied to at least the +# time from Operation Newsreel (Hardtack I/Teak shot, 1958-08-01) to the last +# Operation Fishbowl shot (Tightrope, 1962-11-04).... [See] Herman Hoerlin, +# "The United States High-Altitude Test Experience: A Review Emphasizing the +# Impact on the Environment", Los Alamos LA-6405, Oct 1976 +# . +# See the table on page 4 where he lists GMT and local times for the tests; a +# footnote for the JI tests reads that local time is "JI time = Hawaii Time +# Minus One Hour". # # See 'northamerica' for Pacific/Johnston. Modified: stable/10/contrib/tzdata/europe ============================================================================== --- stable/10/contrib/tzdata/europe Sat Mar 29 04:25:04 2014 (r263905) +++ stable/10/contrib/tzdata/europe Sat Mar 29 04:44:24 2014 (r263906) @@ -2963,7 +2963,11 @@ Zone Europe/Simferopol 2:16:24 - LMT 188 # Assume it happened in March by not changing the clocks. 3:00 Russia MSK/MSD 1997 3:00 - MSK 1997 Mar lastSun 1:00u - 2:00 EU EE%sT +# From Alexander Krivenyshev (2014-03-17): +# time change at 2:00 (2am) on March 30, 2014 +# http://vz.ru/news/2014/3/17/677464.html + 2:00 EU EE%sT 2014 Mar 30 2:00 + 4:00 - MSK # Vatican City # See Europe/Rome. Modified: stable/10/contrib/tzdata/zone.tab ============================================================================== --- stable/10/contrib/tzdata/zone.tab Sat Mar 29 04:25:04 2014 (r263905) +++ stable/10/contrib/tzdata/zone.tab Sat Mar 29 04:44:24 2014 (r263906) @@ -52,6 +52,7 @@ AQ -6617+11031 Antarctica/Casey Casey St AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I +AQ -720041+0023206 Antarctica/Troll Troll Station, Queen Maud Land AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF) AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF) AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN) @@ -344,6 +345,7 @@ RU +5443+02030 Europe/Kaliningrad Moscow RU +5545+03735 Europe/Moscow Moscow+00 - west Russia RU +4844+04425 Europe/Volgograd Moscow+00 - Caspian Sea RU +5312+05009 Europe/Samara Moscow+00 - Samara, Udmurtia +RU +4457+03406 Europe/Simferopol Moscow+00 - Crimea RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk @@ -399,7 +401,6 @@ TZ -0648+03917 Africa/Dar_es_Salaam UA +5026+03031 Europe/Kiev most locations UA +4837+02218 Europe/Uzhgorod Ruthenia UA +4750+03510 Europe/Zaporozhye Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk -UA +4457+03406 Europe/Simferopol central Crimea UG +0019+03225 Africa/Kampala UM +1645-16931 Pacific/Johnston Johnston Atoll UM +2813-17722 Pacific/Midway Midway Islands From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 29 11:33:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1672C944; Sat, 29 Mar 2014 11:33: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 DE24D75C; Sat, 29 Mar 2014 11:33: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 s2TBXrh2042446; Sat, 29 Mar 2014 11:33:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TBXrSX042443; Sat, 29 Mar 2014 11:33:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403291133.s2TBXrSX042443@svn.freebsd.org> From: Dimitry Andric Date: Sat, 29 Mar 2014 11:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263911 - in stable: 10/contrib/libstdc++/include/bits 10/sbin/devd 9/contrib/libstdc++/include/bits 9/sbin/devd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 11:33:54 -0000 Author: dim Date: Sat Mar 29 11:33:52 2014 New Revision: 263911 URL: http://svnweb.freebsd.org/changeset/base/263911 Log: MFC r263774: Revert r263694, and apply a better fix to squelch unnecessary warnings from clang about possible keywords being treated as identifiers for the remainder of the translation unit (a.k.a. -Wkeyword-compat), when using libstdc++ in combination with -Wsystem-headers. This will not only fix devd, but any C++ program using libstdc++. Modified: stable/10/contrib/libstdc++/include/bits/cpp_type_traits.h stable/10/sbin/devd/Makefile Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/libstdc++/include/bits/cpp_type_traits.h stable/9/sbin/devd/Makefile Directory Properties: stable/9/contrib/libstdc++/ (props changed) stable/9/sbin/devd/ (props changed) Modified: stable/10/contrib/libstdc++/include/bits/cpp_type_traits.h ============================================================================== --- stable/10/contrib/libstdc++/include/bits/cpp_type_traits.h Sat Mar 29 10:11:19 2014 (r263910) +++ stable/10/contrib/libstdc++/include/bits/cpp_type_traits.h Sat Mar 29 11:33:52 2014 (r263911) @@ -80,6 +80,13 @@ _GLIBCXX_END_NAMESPACE _GLIBCXX_BEGIN_NAMESPACE(std) +#ifdef __clang__ +// When using clang, suppress warnings about possible keywords (such as +// __is_void, __is_pod, etc) being used as identifiers. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-compat" +#endif + namespace __detail { // NB: g++ can not compile these if declared within the class @@ -398,6 +405,10 @@ namespace __detail }; #endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + _GLIBCXX_END_NAMESPACE #endif //_CPP_TYPE_TRAITS_H Modified: stable/10/sbin/devd/Makefile ============================================================================== --- stable/10/sbin/devd/Makefile Sat Mar 29 10:11:19 2014 (r263910) +++ stable/10/sbin/devd/Makefile Sat Mar 29 11:33:52 2014 (r263911) @@ -13,7 +13,6 @@ LDADD= -ll -lutil YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} -CFLAGS.clang+=-Wno-keyword-compat CLEANFILES= y.output From owner-svn-src-stable-10@FreeBSD.ORG Sat Mar 29 17:18:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 236B03A9; Sat, 29 Mar 2014 17:18: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 03753856; Sat, 29 Mar 2014 17:18: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 s2THINWn087362; Sat, 29 Mar 2014 17:18:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2THINAZ087361; Sat, 29 Mar 2014 17:18:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403291718.s2THINAZ087361@svn.freebsd.org> From: Dimitry Andric Date: Sat, 29 Mar 2014 17:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263915 - in stable: 10/cddl/contrib/opensolaris/tools/ctf/cvt 9/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 17:18:24 -0000 Author: dim Date: Sat Mar 29 17:18:23 2014 New Revision: 263915 URL: http://svnweb.freebsd.org/changeset/base/263915 Log: MFC r260880 (by kaiw, from projects/elftoolchain): * Make die_mem_offset() be able to handle DW_AT_data_member_location attributes generated by Clang 3.4. * Document how different compilers generate DW_AT_data_member_location attributes differently. * Document the quirks about DW_FORM_data[48]. This is a slightly modified version, adapted to work with the old libdwarf in stable/9 and stable/10. It should fix DTrace on these branches, when the kernel is compiled with clang 3.4. Note that you have to build *and* install the CTF tools first, before building the kernel. Otherwise you can possibly still get error messages similar to "failed to copy type of 'pr_uid': Type information is in parent and unavailable", when attempting to run dtrace(1). Submitted by: kaiw Modified: stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Mar 29 14:35:36 2014 (r263914) +++ stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Mar 29 17:18:23 2014 (r263915) @@ -489,16 +489,59 @@ die_mem_offset(dwarf_t *dw, Dwarf_Die di { Dwarf_Locdesc *loc = NULL; Dwarf_Signed locnum = 0; + Dwarf_Attribute at; + Dwarf_Half form; - if (dwarf_locdesc(die, name, &loc, &locnum, &dw->dw_err) != DW_DLV_OK) + if (name != DW_AT_data_member_location) + terminate("die %llu: can only process attribute " + "DW_AT_data_member_location\n", die_off(dw, die)); + + if ((at = die_attr(dw, die, name, 0)) == NULL) return (0); - if (locnum != 1 || loc->ld_s->lr_atom != DW_OP_plus_uconst) { - terminate("die %llu: cannot parse member offset\n", - die_off(dw, die)); - } + if (dwarf_whatform(at, &form, &dw->dw_err) != DW_DLV_OK) + return (0); - *valp = loc->ld_s->lr_number; + switch (form) { + case DW_FORM_block: + case DW_FORM_block1: + case DW_FORM_block2: + case DW_FORM_block4: + /* + * GCC in base and Clang (3.3 or below) generates + * DW_AT_data_member_location attribute with DW_FORM_block* + * form. The attribute contains one DW_OP_plus_uconst + * operator. The member offset stores in the operand. + */ + if (dwarf_locdesc(die, name, &loc, &locnum, &dw->dw_err) != + DW_DLV_OK) + return (0); + if (locnum != 1 || loc->ld_s->lr_atom != DW_OP_plus_uconst) { + terminate("die %llu: cannot parse member offset\n", + die_off(dw, die)); + } + *valp = loc->ld_s->lr_number; + break; + + case DW_FORM_data1: + case DW_FORM_data2: + case DW_FORM_data4: + case DW_FORM_data8: + case DW_FORM_udata: + /* + * Clang 3.4 generates DW_AT_data_member_location attribute + * with DW_FORM_data* form (constant class). The attribute + * stores a contant value which is the member offset. + */ + if (dwarf_attrval_unsigned(die, name, valp, &dw->dw_err) != + DW_DLV_OK) + return (0); + break; + + default: + terminate("die %llu: cannot parse member offset with form " + "%u\n", die_off(dw, die), form); + } if (loc != NULL) if (dwarf_locdesc_free(loc, &dw->dw_err) != DW_DLV_OK) @@ -885,6 +928,9 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st int type, const char *typename) { Dwarf_Unsigned sz, bitsz, bitoff, maxsz=0; +#if BYTE_ORDER == _LITTLE_ENDIAN + Dwarf_Unsigned bysz; +#endif Dwarf_Die mem; mlist_t *ml, **mlastp; iidesc_t *ii; @@ -959,8 +1005,26 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st #if BYTE_ORDER == _BIG_ENDIAN ml->ml_offset += bitoff; #else - ml->ml_offset += tdesc_bitsize(ml->ml_type) - bitoff - - ml->ml_size; + /* + * Note that Clang 3.4 will sometimes generate + * member DIE before generating the DIE for the + * member's type. The code can not handle this + * properly so that tdesc_bitsize(ml->ml_type) will + * return 0 because ml->ml_type is unknown. As a + * result, a wrong member offset will be calculated. + * To workaround this, we can instead try to + * retrieve the value of DW_AT_byte_size attribute + * which stores the byte size of the space occupied + * by the type. If this attribute exists, its value + * should equal to tdesc_bitsize(ml->ml_type)/NBBY. + */ + if (die_unsigned(dw, mem, DW_AT_byte_size, &bysz, 0) && + bysz > 0) + ml->ml_offset += bysz * NBBY - bitoff - + ml->ml_size; + else + ml->ml_offset += tdesc_bitsize(ml->ml_type) - + bitoff - ml->ml_size; #endif } From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 30 15:29:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3CE4FE72; Sun, 30 Mar 2014 15: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 252ADAA7; Sun, 30 Mar 2014 15: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 s2UFTt4m036999; Sun, 30 Mar 2014 15:29:55 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UFTsKH036998; Sun, 30 Mar 2014 15:29:54 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403301529.s2UFTsKH036998@svn.freebsd.org> From: Bryan Drewery Date: Sun, 30 Mar 2014 15:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263938 - stable/10/etc/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 15:29:55 -0000 Author: bdrewery Date: Sun Mar 30 15:29:54 2014 New Revision: 263938 URL: http://svnweb.freebsd.org/changeset/base/263938 Log: MFC r263937: Give hint on how to disable the default repository. Modified: stable/10/etc/pkg/FreeBSD.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/pkg/FreeBSD.conf ============================================================================== --- stable/10/etc/pkg/FreeBSD.conf Sun Mar 30 15:24:17 2014 (r263937) +++ stable/10/etc/pkg/FreeBSD.conf Sun Mar 30 15:29:54 2014 (r263938) @@ -1,4 +1,12 @@ # $FreeBSD$ +# +# To disable this repository, instead of modifying or removing this file, +# create a /usr/local/etc/pkg/repos/FreeBSD.conf file: +# +# mkdir -p /usr/local/etc/pkg/repos +# echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf +# + FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", mirror_type: "srv", From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 30 16:48:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 62A44358; Sun, 30 Mar 2014 16:48: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 423D510F; Sun, 30 Mar 2014 16:48: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 s2UGm5Ms070363; Sun, 30 Mar 2014 16:48:05 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UGm5dL070362; Sun, 30 Mar 2014 16:48:05 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403301648.s2UGm5dL070362@svn.freebsd.org> From: Bryan Drewery Date: Sun, 30 Mar 2014 16:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263941 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 16:48:05 -0000 Author: bdrewery Date: Sun Mar 30 16:48:04 2014 New Revision: 263941 URL: http://svnweb.freebsd.org/changeset/base/263941 Log: MFC r263129: Combine similar code from vprintf(9) and log(9). Modified: stable/10/sys/kern/subr_prf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_prf.c ============================================================================== --- stable/10/sys/kern/subr_prf.c Sun Mar 30 16:04:47 2014 (r263940) +++ stable/10/sys/kern/subr_prf.c Sun Mar 30 16:48:04 2014 (r263941) @@ -248,23 +248,18 @@ ttyprintf(struct tty *tp, const char *fm return (retval); } -/* - * Log writes to the log buffer, and guarantees not to sleep (so can be - * called by interrupt routines). If there is no process reading the - * log yet, it writes to the console also. - */ -void -log(int level, const char *fmt, ...) +static int +_vprintf(int level, int flags, const char *fmt, va_list ap) { - va_list ap; struct putchar_arg pca; + int retval; #ifdef PRINTF_BUFR_SIZE char bufr[PRINTF_BUFR_SIZE]; #endif pca.tty = NULL; pca.pri = level; - pca.flags = log_open ? TOLOG : TOCONS; + pca.flags = flags; #ifdef PRINTF_BUFR_SIZE pca.p_bufr = bufr; pca.p_next = pca.p_bufr; @@ -272,12 +267,11 @@ log(int level, const char *fmt, ...) pca.remain = sizeof(bufr); *pca.p_next = '\0'; #else + /* Don't buffer console output. */ pca.p_bufr = NULL; #endif - va_start(ap, fmt); - kvprintf(fmt, putchar, &pca, 10, ap); - va_end(ap); + retval = kvprintf(fmt, putchar, &pca, 10, ap); #ifdef PRINTF_BUFR_SIZE /* Write any buffered console/log output: */ @@ -289,6 +283,24 @@ log(int level, const char *fmt, ...) cnputs(pca.p_bufr); } #endif + + return (retval); +} + +/* + * Log writes to the log buffer, and guarantees not to sleep (so can be + * called by interrupt routines). If there is no process reading the + * log yet, it writes to the console also. + */ +void +log(int level, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + (void)_vprintf(level, log_open ? TOLOG : TOCONS, fmt, ap); + va_end(ap); + msgbuftrigger = 1; } @@ -374,35 +386,9 @@ printf(const char *fmt, ...) int vprintf(const char *fmt, va_list ap) { - struct putchar_arg pca; int retval; -#ifdef PRINTF_BUFR_SIZE - char bufr[PRINTF_BUFR_SIZE]; -#endif - pca.tty = NULL; - pca.flags = TOCONS | TOLOG; - pca.pri = -1; -#ifdef PRINTF_BUFR_SIZE - pca.p_bufr = bufr; - pca.p_next = pca.p_bufr; - pca.n_bufr = sizeof(bufr); - pca.remain = sizeof(bufr); - *pca.p_next = '\0'; -#else - /* Don't buffer console output. */ - pca.p_bufr = NULL; -#endif - - retval = kvprintf(fmt, putchar, &pca, 10, ap); - -#ifdef PRINTF_BUFR_SIZE - /* Write any buffered console/log output: */ - if (*pca.p_bufr != '\0') { - cnputs(pca.p_bufr); - msglogstr(pca.p_bufr, pca.pri, /*filter_cr*/ 1); - } -#endif + retval = _vprintf(-1, TOCONS | TOLOG, fmt, ap); if (!panicstr) msgbuftrigger = 1; From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 30 16:51:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2C7A65F5; Sun, 30 Mar 2014 16:51: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 192A513F; Sun, 30 Mar 2014 16:51: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 s2UGpCtH071645; Sun, 30 Mar 2014 16:51:12 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UGpCmf071644; Sun, 30 Mar 2014 16:51:12 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403301651.s2UGpCmf071644@svn.freebsd.org> From: Bryan Drewery Date: Sun, 30 Mar 2014 16:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263943 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 16:51:13 -0000 Author: bdrewery Date: Sun Mar 30 16:51:12 2014 New Revision: 263943 URL: http://svnweb.freebsd.org/changeset/base/263943 Log: MFC r263130: Fix -o size less than PAGE_SIZE resulting in SIZE_MAX being used. Modified: stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Sun Mar 30 16:49:17 2014 (r263942) +++ stable/10/sys/fs/tmpfs/tmpfs_vfsops.c Sun Mar 30 16:51:12 2014 (r263943) @@ -200,11 +200,13 @@ tmpfs_mount(struct mount *mp) * allowed to use, based on the maximum size the user passed in * the mount structure. A value of zero is treated as if the * maximum available space was requested. */ - if (size_max < PAGE_SIZE || size_max > OFF_MAX - PAGE_SIZE || + if (size_max == 0 || size_max > OFF_MAX - PAGE_SIZE || (SIZE_MAX < OFF_MAX && size_max / PAGE_SIZE >= SIZE_MAX)) pages = SIZE_MAX; - else + else { + size_max = roundup(size_max, PAGE_SIZE); pages = howmany(size_max, PAGE_SIZE); + } MPASS(pages > 0); if (nodes_max <= 3) { From owner-svn-src-stable-10@FreeBSD.ORG Sun Mar 30 18:22:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D2291F91; Sun, 30 Mar 2014 18:22: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 B2390B57; Sun, 30 Mar 2014 18:22: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 s2UIMBuA011689; Sun, 30 Mar 2014 18:22:11 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UIMBc4011686; Sun, 30 Mar 2014 18:22:11 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403301822.s2UIMBc4011686@svn.freebsd.org> From: Bryan Drewery Date: Sun, 30 Mar 2014 18:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263946 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 18:22:11 -0000 Author: bdrewery Date: Sun Mar 30 18:22:10 2014 New Revision: 263946 URL: http://svnweb.freebsd.org/changeset/base/263946 Log: MFC r263131,r263174,r263175: Tmpfs readdir() redundant logic and code readability cleanup. r263131: Cleanup redundant logic and add some comments to help explain how it works in lieu of potentially less clear code. r263174: Rename cnt to maxcookies and change its use as the condition for when to lookup cookies to be less obscure. r263175: Add missing FALLTHROUGH comment in tmpfs_dir_getdents for looking up '.' and '..'. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Sun Mar 30 17:59:32 2014 (r263945) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Sun Mar 30 18:22:10 2014 (r263946) @@ -348,6 +348,9 @@ tmpfs_dirent_hash(const char *name, u_in static __inline off_t tmpfs_dirent_cookie(struct tmpfs_dirent *de) { + if (de == NULL) + return (TMPFS_DIRCOOKIE_EOF); + MPASS(de->td_cookie >= TMPFS_DIRCOOKIE_MIN); return (de->td_cookie); @@ -1144,7 +1147,7 @@ tmpfs_dir_getdotdotdent(struct tmpfs_nod * error code if another error happens. */ int -tmpfs_dir_getdents(struct tmpfs_node *node, struct uio *uio, int cnt, +tmpfs_dir_getdents(struct tmpfs_node *node, struct uio *uio, int maxcookies, u_long *cookies, int *ncookies) { struct tmpfs_dir_cursor dc; @@ -1155,25 +1158,33 @@ tmpfs_dir_getdents(struct tmpfs_node *no TMPFS_VALIDATE_DIR(node); off = 0; + + /* + * Lookup the node from the current offset. The starting offset of + * 0 will lookup both '.' and '..', and then the first real entry, + * or EOF if there are none. Then find all entries for the dir that + * fit into the buffer. Once no more entries are found (de == NULL), + * the offset is set to TMPFS_DIRCOOKIE_EOF, which will cause the next + * call to return 0. + */ switch (uio->uio_offset) { case TMPFS_DIRCOOKIE_DOT: error = tmpfs_dir_getdotdent(node, uio); if (error != 0) return (error); uio->uio_offset = TMPFS_DIRCOOKIE_DOTDOT; - if (cnt != 0) + if (cookies != NULL) cookies[(*ncookies)++] = off = uio->uio_offset; + /* FALLTHROUGH */ case TMPFS_DIRCOOKIE_DOTDOT: error = tmpfs_dir_getdotdotdent(node, uio); if (error != 0) return (error); de = tmpfs_dir_first(node, &dc); - if (de == NULL) - uio->uio_offset = TMPFS_DIRCOOKIE_EOF; - else - uio->uio_offset = tmpfs_dirent_cookie(de); - if (cnt != 0) + uio->uio_offset = tmpfs_dirent_cookie(de); + if (cookies != NULL) cookies[(*ncookies)++] = off = uio->uio_offset; + /* EOF. */ if (de == NULL) return (0); break; @@ -1183,7 +1194,7 @@ tmpfs_dir_getdents(struct tmpfs_node *no de = tmpfs_dir_lookup_cookie(node, uio->uio_offset, &dc); if (de == NULL) return (EINVAL); - if (cnt != 0) + if (cookies != NULL) off = tmpfs_dirent_cookie(de); } @@ -1251,25 +1262,19 @@ tmpfs_dir_getdents(struct tmpfs_node *no error = uiomove(&d, d.d_reclen, uio); if (error == 0) { de = tmpfs_dir_next(node, &dc); - if (cnt != 0) { - if (de == NULL) - off = TMPFS_DIRCOOKIE_EOF; - else - off = tmpfs_dirent_cookie(de); - MPASS(*ncookies < cnt); + if (cookies != NULL) { + off = tmpfs_dirent_cookie(de); + MPASS(*ncookies < maxcookies); cookies[(*ncookies)++] = off; } } } while (error == 0 && uio->uio_resid > 0 && de != NULL); - /* Update the offset and cache. */ - if (cnt == 0) { - if (de == NULL) - off = TMPFS_DIRCOOKIE_EOF; - else - off = tmpfs_dirent_cookie(de); - } + /* Skip setting off when using cookies as it is already done above. */ + if (cookies == NULL) + off = tmpfs_dirent_cookie(de); + /* Update the offset and cache. */ uio->uio_offset = off; node->tn_dir.tn_readdir_lastn = off; node->tn_dir.tn_readdir_lastp = de; Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Sun Mar 30 17:59:32 2014 (r263945) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Sun Mar 30 18:22:10 2014 (r263946) @@ -1199,32 +1199,38 @@ tmpfs_readdir(struct vop_readdir_args *v int error; ssize_t startresid; - int cnt = 0; + int maxcookies; struct tmpfs_node *node; /* This operation only makes sense on directory nodes. */ if (vp->v_type != VDIR) return ENOTDIR; + maxcookies = 0; node = VP_TO_TMPFS_DIR(vp); startresid = uio->uio_resid; + /* Allocate cookies for NFS and compat modules. */ if (cookies != NULL && ncookies != NULL) { - cnt = howmany(node->tn_size, sizeof(struct tmpfs_dirent)) + 2; - *cookies = malloc(cnt * sizeof(**cookies), M_TEMP, M_WAITOK); + maxcookies = howmany(node->tn_size, + sizeof(struct tmpfs_dirent)) + 2; + *cookies = malloc(maxcookies * sizeof(**cookies), M_TEMP, + M_WAITOK); *ncookies = 0; } - if (cnt == 0) + if (cookies == NULL) error = tmpfs_dir_getdents(node, uio, 0, NULL, NULL); else - error = tmpfs_dir_getdents(node, uio, cnt, *cookies, ncookies); + error = tmpfs_dir_getdents(node, uio, maxcookies, *cookies, + ncookies); + /* Buffer was filled without hitting EOF. */ if (error == EJUSTRETURN) error = (uio->uio_resid != startresid) ? 0 : EINVAL; - if (error != 0 && cnt != 0) + if (error != 0 && cookies != NULL) free(*cookies, M_TEMP); if (eofflag != NULL) From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 31 00:28:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5D3B04C3; Mon, 31 Mar 2014 00:28: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 302DBD9D; Mon, 31 Mar 2014 00:28: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 s2V0StNt067806; Mon, 31 Mar 2014 00:28:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2V0SsgM067799; Mon, 31 Mar 2014 00:28:54 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403310028.s2V0SsgM067799@svn.freebsd.org> From: Glen Barber Date: Mon, 31 Mar 2014 00:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263955 - stable/10/lib/libmd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 00:28:55 -0000 Author: gjb Date: Mon Mar 31 00:28:54 2014 New Revision: 263955 URL: http://svnweb.freebsd.org/changeset/base/263955 Log: MFC r263863: Dereference nonexistent md2(3) manual. Sponsored by: The FreeBSD Foundation Modified: stable/10/lib/libmd/ripemd.3 stable/10/lib/libmd/sha.3 stable/10/lib/libmd/sha256.3 stable/10/lib/libmd/sha512.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libmd/ripemd.3 ============================================================================== --- stable/10/lib/libmd/ripemd.3 Sun Mar 30 23:43:36 2014 (r263954) +++ stable/10/lib/libmd/ripemd.3 Mon Mar 31 00:28:54 2014 (r263955) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd February 26, 1999 +.Dd March 28, 2014 .Dt RIPEMD 3 .Os .Sh NAME @@ -123,7 +123,6 @@ If the .Fa buf argument is non-null it must point to at least 41 characters of buffer space. .Sh SEE ALSO -.Xr md2 3 , .Xr md4 3 , .Xr md5 3 , .Xr sha 3 Modified: stable/10/lib/libmd/sha.3 ============================================================================== --- stable/10/lib/libmd/sha.3 Sun Mar 30 23:43:36 2014 (r263954) +++ stable/10/lib/libmd/sha.3 Mon Mar 31 00:28:54 2014 (r263955) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd February 25, 1999 +.Dd March 28, 2014 .Dt SHA 3 .Os .Sh NAME @@ -154,7 +154,6 @@ If the .Fa buf argument is non-null it must point to at least 41 characters of buffer space. .Sh SEE ALSO -.Xr md2 3 , .Xr md4 3 , .Xr md5 3 , .Xr ripemd 3 , Modified: stable/10/lib/libmd/sha256.3 ============================================================================== --- stable/10/lib/libmd/sha256.3 Sun Mar 30 23:43:36 2014 (r263954) +++ stable/10/lib/libmd/sha256.3 Mon Mar 31 00:28:54 2014 (r263955) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd September 14, 2005 +.Dd March 28, 2014 .Dt SHA256 3 .Os .Sh NAME @@ -120,7 +120,6 @@ If the .Fa buf argument is non-null it must point to at least 65 characters of buffer space. .Sh SEE ALSO -.Xr md2 3 , .Xr md4 3 , .Xr md5 3 , .Xr ripemd 3 , Modified: stable/10/lib/libmd/sha512.3 ============================================================================== --- stable/10/lib/libmd/sha512.3 Sun Mar 30 23:43:36 2014 (r263954) +++ stable/10/lib/libmd/sha512.3 Mon Mar 31 00:28:54 2014 (r263955) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd April 1, 2011 +.Dd March 28, 2014 .Dt SHA512 3 .Os .Sh NAME @@ -120,7 +120,6 @@ If the .Fa buf argument is non-null it must point to at least 65 characters of buffer space. .Sh SEE ALSO -.Xr md2 3 , .Xr md4 3 , .Xr md5 3 , .Xr ripemd 3 , From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 31 02:17:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 774125A5; Mon, 31 Mar 2014 02:17: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 6417A7E5; Mon, 31 Mar 2014 02:17: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 s2V2HxIJ019400; Mon, 31 Mar 2014 02:17:59 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2V2Hxtt019399; Mon, 31 Mar 2014 02:17:59 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403310217.s2V2Hxtt019399@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 31 Mar 2014 02:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263958 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 02:17:59 -0000 Author: mjg Date: Mon Mar 31 02:17:58 2014 New Revision: 263958 URL: http://svnweb.freebsd.org/changeset/base/263958 Log: MFC r263460: Take filedesc lock only for reading when allocating new fdtable. Code populating the table does this already. Modified: stable/10/sys/kern/kern_descrip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Mon Mar 31 01:54:59 2014 (r263957) +++ stable/10/sys/kern/kern_descrip.c Mon Mar 31 02:17:58 2014 (r263958) @@ -1809,7 +1809,7 @@ fdinit(struct filedesc *fdp) newfdp = malloc(sizeof *newfdp, M_FILEDESC, M_WAITOK | M_ZERO); FILEDESC_LOCK_INIT(&newfdp->fd_fd); if (fdp != NULL) { - FILEDESC_XLOCK(fdp); + FILEDESC_SLOCK(fdp); newfdp->fd_fd.fd_cdir = fdp->fd_cdir; if (newfdp->fd_fd.fd_cdir) VREF(newfdp->fd_fd.fd_cdir); @@ -1819,7 +1819,7 @@ fdinit(struct filedesc *fdp) newfdp->fd_fd.fd_jdir = fdp->fd_jdir; if (newfdp->fd_fd.fd_jdir) VREF(newfdp->fd_fd.fd_jdir); - FILEDESC_XUNLOCK(fdp); + FILEDESC_SUNLOCK(fdp); } /* Create the file descriptor table. */ From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 31 02:19:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6ABC86EB; Mon, 31 Mar 2014 02:19:58 +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 579367ED; Mon, 31 Mar 2014 02:19:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2V2Jwea019662; Mon, 31 Mar 2014 02:19:58 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2V2JwMm019660; Mon, 31 Mar 2014 02:19:58 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403310219.s2V2JwMm019660@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 31 Mar 2014 02:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263959 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 02:19:58 -0000 Author: mjg Date: Mon Mar 31 02:19:57 2014 New Revision: 263959 URL: http://svnweb.freebsd.org/changeset/base/263959 Log: MFC r263530: Mark the following sysctls as MPSAFE: kern.file kern.proc.filedesc kern.proc.ofiledesc Modified: stable/10/sys/kern/kern_descrip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Mon Mar 31 02:17:58 2014 (r263958) +++ stable/10/sys/kern/kern_descrip.c Mon Mar 31 02:19:57 2014 (r263959) @@ -2976,7 +2976,7 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_kern, KERN_FILE, file, CTLTYPE_OPAQUE|CTLFLAG_RD, +SYSCTL_PROC(_kern, KERN_FILE, file, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, 0, sysctl_kern_file, "S,xfile", "Entire file table"); #ifdef KINFO_OFILE_SIZE @@ -3234,8 +3234,9 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE return (0); } -static SYSCTL_NODE(_kern_proc, KERN_PROC_OFILEDESC, ofiledesc, CTLFLAG_RD, - sysctl_kern_proc_ofiledesc, "Process ofiledesc entries"); +static SYSCTL_NODE(_kern_proc, KERN_PROC_OFILEDESC, ofiledesc, + CTLFLAG_RD||CTLFLAG_MPSAFE, sysctl_kern_proc_ofiledesc, + "Process ofiledesc entries"); #endif /* COMPAT_FREEBSD7 */ #ifdef KINFO_FILE_SIZE @@ -3747,8 +3748,9 @@ fill_shm_info(struct file *fp, struct ki return (0); } -static SYSCTL_NODE(_kern_proc, KERN_PROC_FILEDESC, filedesc, CTLFLAG_RD, - sysctl_kern_proc_filedesc, "Process filedesc entries"); +static SYSCTL_NODE(_kern_proc, KERN_PROC_FILEDESC, filedesc, + CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_filedesc, + "Process filedesc entries"); #ifdef DDB /* From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 31 02:24:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C226A96A; Mon, 31 Mar 2014 02:24: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 AEB7D896; Mon, 31 Mar 2014 02:24: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 s2V2OTR5023168; Mon, 31 Mar 2014 02:24:29 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2V2OT2S023167; Mon, 31 Mar 2014 02:24:29 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403310224.s2V2OT2S023167@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 31 Mar 2014 02:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263960 - stable/10/sys/security/audit X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 02:24:29 -0000 Author: mjg Date: Mon Mar 31 02:24:29 2014 New Revision: 263960 URL: http://svnweb.freebsd.org/changeset/base/263960 Log: MFC r263458: audit: plug FILEDESC_LOCK leak in audit_canon_path. Modified: stable/10/sys/security/audit/audit_bsm_klib.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/security/audit/audit_bsm_klib.c ============================================================================== --- stable/10/sys/security/audit/audit_bsm_klib.c Mon Mar 31 02:19:57 2014 (r263959) +++ stable/10/sys/security/audit/audit_bsm_klib.c Mon Mar 31 02:24:29 2014 (r263960) @@ -497,6 +497,7 @@ audit_canon_path(struct thread *td, int /* XXX: fgetvp() that vhold()s vnode instead of vref()ing it would be better */ error = fgetvp(td, dirfd, NULL, &cvnp); if (error) { + FILEDESC_SUNLOCK(fdp); cpath[0] = '\0'; if (rvnp != NULL) vdrop(rvnp); From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 31 02:30:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 36051AD9; Mon, 31 Mar 2014 02:30: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 089298C1; Mon, 31 Mar 2014 02:30: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 s2V2Utdd024008; Mon, 31 Mar 2014 02:30:55 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2V2UtVl024007; Mon, 31 Mar 2014 02:30:55 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403310230.s2V2UtVl024007@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 31 Mar 2014 02:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263961 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 02:30:56 -0000 Author: mjg Date: Mon Mar 31 02:30:55 2014 New Revision: 263961 URL: http://svnweb.freebsd.org/changeset/base/263961 Log: MFC r263704: Make /dev/devctl mpsafe. MFC r263753: Remove lockless check in devopen, while correct it does not make much sense. Modified: stable/10/sys/kern/subr_bus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_bus.c ============================================================================== --- stable/10/sys/kern/subr_bus.c Mon Mar 31 02:24:29 2014 (r263960) +++ stable/10/sys/kern/subr_bus.c Mon Mar 31 02:30:55 2014 (r263961) @@ -358,15 +358,16 @@ device_sysctl_fini(device_t dev) /* Deprecated way to adjust queue length */ static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS); /* XXX Need to support old-style tunable hw.bus.devctl_disable" */ -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW, NULL, - 0, sysctl_devctl_disable, "I", "devctl disable -- deprecated"); +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, "I", + "devctl disable -- deprecated"); #define DEVCTL_DEFAULT_QUEUE_LEN 1000 static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS); static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; TUNABLE_INT("hw.bus.devctl_queue", &devctl_queue_length); -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RW, NULL, - 0, sysctl_devctl_queue, "I", "devctl queue length"); +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_queue, "I", "devctl queue length"); static d_open_t devopen; static d_close_t devclose; @@ -376,7 +377,6 @@ static d_poll_t devpoll; static struct cdevsw dev_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = devopen, .d_close = devclose, .d_read = devread, @@ -420,23 +420,29 @@ devinit(void) static int devopen(struct cdev *dev, int oflags, int devtype, struct thread *td) { - if (devsoftc.inuse) + + mtx_lock(&devsoftc.mtx); + if (devsoftc.inuse) { + mtx_unlock(&devsoftc.mtx); return (EBUSY); + } /* move to init */ devsoftc.inuse = 1; devsoftc.nonblock = 0; devsoftc.async_proc = NULL; + mtx_unlock(&devsoftc.mtx); return (0); } static int devclose(struct cdev *dev, int fflag, int devtype, struct thread *td) { - devsoftc.inuse = 0; + mtx_lock(&devsoftc.mtx); + devsoftc.inuse = 0; + devsoftc.async_proc = NULL; cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); - devsoftc.async_proc = NULL; return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 31 02:44:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 131CFDCF; Mon, 31 Mar 2014 02:44: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 F39FCA1A; Mon, 31 Mar 2014 02:44:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2V2ihFF031350; Mon, 31 Mar 2014 02:44:43 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2V2ihak031349; Mon, 31 Mar 2014 02:44:43 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403310244.s2V2ihak031349@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 31 Mar 2014 02:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263962 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 02:44:44 -0000 Author: mjg Date: Mon Mar 31 02:44:43 2014 New Revision: 263962 URL: http://svnweb.freebsd.org/changeset/base/263962 Log: MFC r263755: Document a known problem with handling the process intended to receive SIGIO in /dev/devctl. Modified: stable/10/sys/kern/subr_bus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_bus.c ============================================================================== --- stable/10/sys/kern/subr_bus.c Mon Mar 31 02:30:55 2014 (r263961) +++ stable/10/sys/kern/subr_bus.c Mon Mar 31 02:44:43 2014 (r263962) @@ -497,6 +497,21 @@ devioctl(struct cdev *dev, u_long cmd, c devsoftc.nonblock = 0; return (0); case FIOASYNC: + /* + * FIXME: + * Since this is a simple assignment there is no guarantee that + * devsoftc.async_proc consumers will get a valid pointer. + * + * Example scenario where things break (processes A and B): + * 1. A opens devctl + * 2. A sends fd to B + * 3. B sets itself as async_proc + * 4. B exits + * + * However, normally this requires root privileges and the only + * in-tree consumer does not behave in a dangerous way so the + * issue is not critical. + */ if (*(int*)data) devsoftc.async_proc = td->td_proc; else @@ -582,6 +597,7 @@ devctl_queue_data_f(char *data, int flag cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); selwakeup(&devsoftc.sel); + /* XXX see a comment in devioctl */ p = devsoftc.async_proc; if (p != NULL) { PROC_LOCK(p); From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 31 02:53:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A328CF88; Mon, 31 Mar 2014 02:53: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 74C02AD6; Mon, 31 Mar 2014 02:53: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 s2V2rGWX035294; Mon, 31 Mar 2014 02:53:16 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2V2rFSZ035290; Mon, 31 Mar 2014 02:53:15 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403310253.s2V2rFSZ035290@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 31 Mar 2014 02:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263963 - in stable/10: etc/rc.d sbin/devd share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 02:53:16 -0000 Author: mjg Date: Mon Mar 31 02:53:15 2014 New Revision: 263963 URL: http://svnweb.freebsd.org/changeset/base/263963 Log: MFC r263758: Update userspace users of hw.bus.devctl_disable. This switches the code to use hw.bus.devctl_queue instead. Modified: stable/10/etc/rc.d/devd stable/10/sbin/devd/devd.cc stable/10/share/man/man4/devctl.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/devd ============================================================================== --- stable/10/etc/rc.d/devd Mon Mar 31 02:44:43 2014 (r263962) +++ stable/10/etc/rc.d/devd Mon Mar 31 02:53:15 2014 (r263963) @@ -30,9 +30,10 @@ devd_prestart() { find_pidfile - # If devd is disabled, turn it off in the kernel to avoid memory leaks. + # If devd is disabled, turn it off in the kernel to avoid unnecessary + # memory usage. if ! checkyesno ${rcvar}; then - $SYSCTL hw.bus.devctl_disable=1 + $SYSCTL hw.bus.devctl_queue=0 fi } Modified: stable/10/sbin/devd/devd.cc ============================================================================== --- stable/10/sbin/devd/devd.cc Mon Mar 31 02:44:43 2014 (r263962) +++ stable/10/sbin/devd/devd.cc Mon Mar 31 02:53:15 2014 (r263963) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); #define PIPE "/var/run/devd.pipe" #define CF "/etc/devd.conf" -#define SYSCTL "hw.bus.devctl_disable" +#define SYSCTL "hw.bus.devctl_queue" /* * Since the client socket is nonblocking, we must increase its send buffer to @@ -1164,9 +1164,9 @@ check_devd_enabled() len = sizeof(val); if (sysctlbyname(SYSCTL, &val, &len, NULL, 0) != 0) errx(1, "devctl sysctl missing from kernel!"); - if (val) { - warnx("Setting " SYSCTL " to 0"); - val = 0; + if (val == 0) { + warnx("Setting " SYSCTL " to 1000"); + val = 1000; sysctlbyname(SYSCTL, NULL, NULL, &val, sizeof(val)); } } Modified: stable/10/share/man/man4/devctl.4 ============================================================================== --- stable/10/share/man/man4/devctl.4 Mon Mar 31 02:44:43 2014 (r263962) +++ stable/10/share/man/man4/devctl.4 Mon Mar 31 02:53:15 2014 (r263963) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 11, 2003 +.Dd March 26, 2014 .Dt DEVCTL 4 .Os .Sh NAME @@ -73,9 +73,9 @@ If you try to read this device a charact the rest of the data. Listening programs are expected to cope. .Pp -The sysctl and boot parameter -.Va hw.bus.devctl_disable -is used to disable +The sysctl +.Va hw.bus.devctl_queue +can be used to control queue length. It is set to 0 to disable .Nm when no .Xr devd 8 From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 31 09:34:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5D5D19BF; Mon, 31 Mar 2014 09:34: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 49887187; Mon, 31 Mar 2014 09:34: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 s2V9YlEq099448; Mon, 31 Mar 2014 09:34:47 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2V9Ylxg099447; Mon, 31 Mar 2014 09:34:47 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201403310934.s2V9Ylxg099447@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 31 Mar 2014 09:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263964 - stable/10/sys/boot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 09:34:47 -0000 Author: ae Date: Mon Mar 31 09:34:46 2014 New Revision: 263964 URL: http://svnweb.freebsd.org/changeset/base/263964 Log: MFC r263468: When loader(8) inspects MBR, it chooses GPT as main partition table, when MBR contains only PMBR entry or it is bootcamp-compatible. If MBR has PMBR entry and some other, the loader rejects it. Make these checks to be less strict. If loader decided that PMBR isn't suitable for GPT, it will use MBR. Reported by: Paul Thornton Modified: stable/10/sys/boot/common/part.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/part.c ============================================================================== --- stable/10/sys/boot/common/part.c Mon Mar 31 02:53:15 2014 (r263963) +++ stable/10/sys/boot/common/part.c Mon Mar 31 09:34:46 2014 (r263964) @@ -634,7 +634,7 @@ ptable_open(void *dev, off_t sectors, ui for (i = 0, count = 0; i < NDOSPART; i++) { if (dp[i].dp_flag != 0 && dp[i].dp_flag != 0x80) { DEBUG("invalid partition flag %x", dp[i].dp_flag); - break; + goto out; } #ifdef LOADER_GPT_SUPPORT if (dp[i].dp_typ == DOSPTYP_PMBR) { @@ -646,15 +646,12 @@ ptable_open(void *dev, off_t sectors, ui count++; } /* Do we have some invalid values? */ - if (i != NDOSPART || - (table->type == PTABLE_GPT && count > 1)) { + if (table->type == PTABLE_GPT && count > 1) { if (dp[1].dp_typ != DOSPTYP_HFS) { table->type = PTABLE_NONE; - DEBUG("invalid values detected, ignore " - "partition table"); - goto out; - } - DEBUG("Bootcamp detected"); + DEBUG("Incorrect PMBR, ignore it"); + } else + DEBUG("Bootcamp detected"); } #ifdef LOADER_GPT_SUPPORT if (table->type == PTABLE_GPT) { From owner-svn-src-stable-10@FreeBSD.ORG Mon Mar 31 14:51:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 945FDDC1; Mon, 31 Mar 2014 14: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 7E4188FF; Mon, 31 Mar 2014 14: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 s2VEpkQV032365; Mon, 31 Mar 2014 14:51:46 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VEpkZZ032364; Mon, 31 Mar 2014 14:51:46 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403311451.s2VEpkZZ032364@svn.freebsd.org> From: Alan Somers Date: Mon, 31 Mar 2014 14:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263972 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 14:51:46 -0000 Author: asomers Date: Mon Mar 31 14:51:45 2014 New Revision: 263972 URL: http://svnweb.freebsd.org/changeset/base/263972 Log: MFC r263271 share/man/man9/counter.9 Fix logic error in the description of counter_u64_alloc: the command may fail only if M_NOWAIT is specified, not M_WAITOK. Modified: stable/10/share/man/man9/counter.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/counter.9 ============================================================================== --- stable/10/share/man/man9/counter.9 Mon Mar 31 14:40:35 2014 (r263971) +++ stable/10/share/man/man9/counter.9 Mon Mar 31 14:51:45 2014 (r263972) @@ -91,7 +91,7 @@ wait flag, should be either or .Va M_WAITOK . If -.Va M_WAITOK +.Va M_NOWAIT is specified the operation may fail. .It Fn counter_u64_free c Free the previously allocated counter From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 1 00:19:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C8555A3F; Tue, 1 Apr 2014 00:19: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 B16EE8F6; Tue, 1 Apr 2014 00:19: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 s310JHWG066609; Tue, 1 Apr 2014 00:19:17 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s310JEWZ066585; Tue, 1 Apr 2014 00:19:14 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404010019.s310JEWZ066585@svn.freebsd.org> From: Devin Teske Date: Tue, 1 Apr 2014 00:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263980 - in stable/10: . usr.sbin/bsdconfig usr.sbin/bsdconfig/share usr.sbin/bsdconfig/timezone/share usr.sbin/bsdconfig/usermgmt usr.sbin/bsdconfig/usermgmt/include usr.sbin/bsdconfi... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 00:19:17 -0000 Author: dteske Date: Tue Apr 1 00:19:13 2014 New Revision: 263980 URL: http://svnweb.freebsd.org/changeset/base/263980 Log: MFC revisions 260894,260899,262895-262902,262904,262908-262910,262982, 262984,263133-263137,263139,263141,263144-263150, and (partially) 263249 (31 revisions; summarized below)... r260894: Optimize f_expand_number(), improving performance r260899: s/__number/__num/ in f_expand_number() r262895: Allow dispatched reswords to carry arguments r262896: Add missing local declaration r262897: Fix a typo in a comment r262898: Fix incorrect return status if var_to_set and var_to_get are same r262899: Make f_show_err non-fatal r262900: Centralize function name; Update a comment while here r262901: s/__num/__number/ in f_expand_number() r262902: Comment to go with NL global introduced by previous commit r262904: Rewrite groupmgmt -- hooking it into the scripting system r262908: Change dispatch words from group* to *Group for backward compat r262909: Fix copy/paste error in a comment r262910: Take a group name on the command-line if available r262982: Whitespace r262984: Remove vestigial global, no longer used since r262904 r263133: Remove indexfile from debug statement (already logged) r263134: Add debug statement just before attempting to exec a module r263135: Comments r263136: Update copyright r263137: Fix future namespace issues for functions taking $var_to_set r263139: Remove useless NULL string in compound strings r263141: Pointy hat! Fix a broken f_isinteger() r263144: Fix a code-typo that prevented auto-sizing of a dialog r263145: Fix comments and whitespace r263146: Reduce the sleep cycle when using dialog(1) [infobox] to 1-second r263147: Fix a bug preventing errors from pw(8) from appearing r263148: For non-interactive scripts, forgot to check argument r263149: Add protection against input containing single-quotes r263150: Rewrite usermgmt r263249: (partial) Add more obsolete files Added: stable/10/usr.sbin/bsdconfig/usermgmt/share/group.subr - copied, changed from r262904, head/usr.sbin/bsdconfig/usermgmt/share/group.subr stable/10/usr.sbin/bsdconfig/usermgmt/share/user.subr - copied unchanged from r263150, head/usr.sbin/bsdconfig/usermgmt/share/user.subr Deleted: stable/10/usr.sbin/bsdconfig/usermgmt/groupinput stable/10/usr.sbin/bsdconfig/usermgmt/userinput Modified: stable/10/ObsoleteFiles.inc stable/10/usr.sbin/bsdconfig/bsdconfig stable/10/usr.sbin/bsdconfig/share/common.subr stable/10/usr.sbin/bsdconfig/share/device.subr stable/10/usr.sbin/bsdconfig/share/dialog.subr stable/10/usr.sbin/bsdconfig/share/keymap.subr stable/10/usr.sbin/bsdconfig/share/script.subr stable/10/usr.sbin/bsdconfig/share/strings.subr stable/10/usr.sbin/bsdconfig/share/variable.subr stable/10/usr.sbin/bsdconfig/timezone/share/menus.subr stable/10/usr.sbin/bsdconfig/usermgmt/Makefile stable/10/usr.sbin/bsdconfig/usermgmt/groupadd stable/10/usr.sbin/bsdconfig/usermgmt/groupdel stable/10/usr.sbin/bsdconfig/usermgmt/groupedit stable/10/usr.sbin/bsdconfig/usermgmt/include/messages.subr stable/10/usr.sbin/bsdconfig/usermgmt/share/Makefile stable/10/usr.sbin/bsdconfig/usermgmt/share/group_input.subr stable/10/usr.sbin/bsdconfig/usermgmt/share/user_input.subr stable/10/usr.sbin/bsdconfig/usermgmt/useradd stable/10/usr.sbin/bsdconfig/usermgmt/userdel stable/10/usr.sbin/bsdconfig/usermgmt/useredit Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/ObsoleteFiles.inc Tue Apr 1 00:19:13 2014 (r263980) @@ -75,6 +75,10 @@ OLD_FILES+=usr/include/clang/3.3/xopintr OLD_FILES+=usr/share/man/man1/llvm-prof.1.gz OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz OLD_DIRS+=usr/include/clang/3.3 +# 20140314: bsdconfig usermgmt rewrite +OLD_FILES+=usr/libexec/bsdconfig/070.usermgmt/userinput +# 20140307: bsdconfig groupmgmt rewrite +OLD_FILES+=usr/libexec/bsdconfig/070.usermgmt/groupinput # 20131109: extattr(2) mlinks fixed OLD_FILES+=usr/share/man/man2/extattr_delete_list.2.gz OLD_FILES+=usr/share/man/man2/extattr_get_list.2.gz Modified: stable/10/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- stable/10/usr.sbin/bsdconfig/bsdconfig Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/bsdconfig Tue Apr 1 00:19:13 2014 (r263980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -315,8 +315,7 @@ if [ "$pgm" != "bsdconfig" ]; then if indexfile=$( f_index_file "$pgm" ) && cmd=$( f_index_menusel_command "$indexfile" "$pgm" ) then - f_dprintf "pgm=[%s] indexfile=[%s] cmd=[%s]" \ - "$pgm" "$indexfile" "$cmd" + f_dprintf "pgm=[%s] cmd=[%s] *=[%s]" "$pgm" "$cmd" "$*" exec "$cmd" "$@" || exit 1 else f_include $BSDCFG_SHARE/script.subr @@ -324,7 +323,7 @@ if [ "$pgm" != "bsdconfig" ]; then [ "$pgm" = "$resword" ] || continue # Found a match f_dprintf "pgm=[%s] A valid resWord!" "$pgm" - f_dispatch $resword + f_dispatch $resword $resword "$@" exit $? done fi @@ -382,6 +381,7 @@ if [ "$1" ]; then # Not reached fi + f_dprintf "cmd=[%s] *=[%s]" "$cmd" "$*" shift exec $cmd ${USE_XDIALOG:+-X} "$@" || exit 1 # Not reached Modified: stable/10/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/common.subr Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/share/common.subr Tue Apr 1 00:19:13 2014 (r263980) @@ -1,7 +1,7 @@ if [ ! "$_COMMON_SUBR" ]; then _COMMON_SUBR=1 # # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -153,7 +153,7 @@ f_debug_init() # Process stored command-line arguments # set -- $ARGV - local OPTIND + local OPTIND flag f_dprintf "f_debug_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \ "$ARGV" "$GETOPTS_STDARGS" while getopts "$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" flag \ @@ -270,9 +270,9 @@ f_getvar() { local __var_to_get="$1" __var_to_set="$2" [ "$__var_to_set" ] || local value - eval ${__var_to_set:-value}=\"\${$__var_to_get}\" eval [ \"\${$__var_to_get+set}\" ] local __retval=$? + eval ${__var_to_set:-value}=\"\${$__var_to_get}\" eval f_dprintf '"f_getvar: var=[%s] value=[%s] r=%u"' \ \"\$__var_to_get\" \"\$${__var_to_set:-value}\" \$__retval [ "$__var_to_set" ] || { [ "$value" ] && echo "$value"; } @@ -368,13 +368,10 @@ f_show_msg() # f_show_err $format [$arguments ...] # # Display a message in a dialog box with ``Error'' i18n title (overridden by -# setting msg_error) using printf(1) syntax. If running non-interactively, -# the process will terminate (using [above] f_die()). +# setting msg_error) using printf(1) syntax. # f_show_err() { - [ "$nonInteractive" ] && f_die - local msg msg=$( printf "$@" ) @@ -523,7 +520,7 @@ f_include_lang() # f_usage $file "FOO" "BAR" # # Will cause instances of "@FOO@" appearing in $file to be replaced with the -# text "BAR" before bering printed to the screen. +# text "BAR" before being printed to the screen. # # This function is a two-parter. Below is the awk(1) portion of the function, # afterward is the sh(1) function which utilizes the below awk script. Modified: stable/10/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/device.subr Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/share/device.subr Tue Apr 1 00:19:13 2014 (r263980) @@ -1,6 +1,6 @@ if [ ! "$_DEVICE_SUBR" ]; then _DEVICE_SUBR=1 # -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -170,11 +170,10 @@ f_device_reset() for dev in $DEVICES; do f_device_shutdown $dev - # - # XXX this potentially leaks $dev->private if it's being + # XXX This potentially leaks $dev->private if it's being # used to point to something dynamic, but you're not supposed # to call this routine at such times that some open instance - # has its private member pointing somewhere anyway. XXX + # has its private member pointing somewhere anyway. # f_struct_free device_$dev done @@ -325,8 +324,7 @@ f_device_get_all() case "$diskname" in cd*) - # XXX - # Due to unknown reasons, kern.disks returns SCSI + # XXX Due to unknown reasons, kern.disks returns SCSI # CDROM as a valid disk. This will prevent bsdconfig # from presenting SCSI CDROMs as available disks in # various menus. Why GEOM treats SCSI CDROM as a disk Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/dialog.subr Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/share/dialog.subr Tue Apr 1 00:19:13 2014 (r263980) @@ -1,6 +1,6 @@ if [ ! "$_DIALOG_SUBR" ]; then _DIALOG_SUBR=1 # -# Copyright (c) 2006-2013 Devin Teske +# Copyright (c) 2006-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -469,16 +469,17 @@ f_dialog_menu_constrain() # Print debug warnings if any given (non-NULL) argument are invalid # NOTE: Don't change the name of $__{var,min,}{height,width,rows} # - local __height __width __rows + local __height_menu_constrain __width_menu_constrain + local __rows_menu_constrain local __arg __cp __fname=f_dialog_menu_constrain for __arg in height width rows; do debug= f_getvar __var_$__arg __cp [ "$__cp" ] || continue - if ! debug= f_getvar "$__cp" __$__arg; then + if ! debug= f_getvar "$__cp" __${__arg}_menu_constrain; then f_dprintf "%s: var_%s variable \`%s' not set" \ $__fname $__arg "$__cp" __retval=$FAILURE - elif ! eval f_isinteger \$__$__arg; then + elif ! eval f_isinteger \$__${__arg}_menu_constrain; then f_dprintf "%s: var_%s variable value not a number" \ $__fname $__arg __retval=$FAILURE @@ -502,9 +503,11 @@ f_dialog_menu_constrain() # Adjust height if desired if [ "$__var_height" ]; then - if [ $__height -lt ${__min_height:-0} ]; then + if [ $__height_menu_constrain -lt ${__min_height:-0} ]; then setvar "$__var_height" $__min_height - elif [ $__height -gt $__max_height_menu_constrain ]; then + elif [ $__height_menu_constrain -gt \ + $__max_height_menu_constrain ] + then setvar "$__var_height" $__max_height_menu_constrain fi fi @@ -516,9 +519,11 @@ f_dialog_menu_constrain() else : ${__min_width:=${DIALOG_MIN_WIDTH:-24}} fi - if [ $__width -lt $__min_width ]; then + if [ $__width_menu_constrain -lt $__min_width ]; then setvar "$__var_width" $__min_width - elif [ $__width -gt $__max_width_menu_constrain ]; then + elif [ $__width_menu_constrain -gt \ + $__max_width_menu_constrain ] + then setvar "$__var_width" $__max_width_menu_constrain fi fi @@ -531,16 +536,20 @@ f_dialog_menu_constrain() : ${__min_rows:=0} fi - local __max_rows=$(( $__max_height_menu_constrain - 7 )) + local __max_rows_menu_constrain=$(( + $__max_height_menu_constrain - 7 + )) # If prompt_len is zero (no prompt), bump the max-rows by 1 # Default assumption is (if no argument) that there's no prompt - [ ${__prompt_len:-0} -gt 0 ] || - __max_rows=$(( $__max_rows + 1 )) + [ ${__prompt_len:-0} -gt 0 ] || __max_rows_menu_constrain=$(( + $__max_rows_menu_constrain + 1 + )) - if [ $__rows -lt $__min_rows ]; then + if [ $__rows_menu_constrain -lt $__min_rows ]; then setvar "$__var_rows" $__min_rows - elif [ $__rows -gt $__max_rows ]; then - setvar "$__var_rows" $__max_rows + elif [ $__rows_menu_constrain -gt $__max_rows_menu_constrain ] + then + setvar "$__var_rows" $__max_rows_menu_constrain fi fi @@ -1100,19 +1109,20 @@ f_dialog_radiolist_size() # longest item-length (both used to bump the width), and the number of # rows (used to bump the height). # - local __longest_tag=0 __longest_item=0 __rows=0 + local __longest_tag=0 __longest_item=0 __rows_rlist_size=0 while [ $# -ge 3 ]; do local __tag="$1" __item="$2" shift 3 # tag/item/status [ ${#__tag} -gt $__longest_tag ] && __longest_tag=${#__tag} [ ${#__item} -gt $__longest_item ] && __longest_item=${#__item} - __rows=$(( $__rows + 1 )) + __rows_rlist_size=$(( $__rows_rlist_size + 1 )) done # Adjust rows early (for up-coming height calculation) if [ "$__var_height" -o "$__var_rows" ]; then # Add a row for visual aid if using Xdialog(1) - [ "$USE_XDIALOG" ] && __rows=$(( $__rows + 1 )) + [ "$USE_XDIALOG" ] && + __rows_rlist_size=$(( $__rows_rlist_size + 1 )) fi # Adjust height if desired @@ -1120,10 +1130,12 @@ f_dialog_radiolist_size() # Add rows to height if [ "$USE_XDIALOG" ]; then __height_rlist_size=$(( - $__height_rlist_size + $__rows + 7 )) + $__height_rlist_size + $__rows_rlist_size + 7 + )) else __height_rlist_size=$(( - $__height_rlist_size + $__rows + 4 )) + $__height_rlist_size + $__rows_rlist_size + 4 + )) fi setvar "$__var_height" $__height_rlist_size fi @@ -1140,7 +1152,7 @@ f_dialog_radiolist_size() fi # Store adjusted rows if desired - [ "$__var_rows" ] && setvar "$__var_rows" $__rows + [ "$__var_rows" ] && setvar "$__var_rows" $__rows_rlist_size # Constrain height, width, and rows to sensible minimum/maximum values # Return success if no-constrain, else return status from constrain @@ -1220,20 +1232,26 @@ f_dialog_radiolist_with_help_size() # all used to bump the width -- and the number of rows (used to bump # the height). # - local __longest_tag=0 __longest_item=0 __longest_help=0 __rows=0 + local __longest_tag=0 __longest_item=0 __longest_help=0 + local __rows_rlist_with_help_size=0 while [ $# -ge 4 ]; do local __tag="$1" __item="$2" __status="$3" __help="$4" shift 4 # tag/item/status/help [ ${#__tag} -gt $__longest_tag ] && __longest_tag=${#__tag} [ ${#__item} -gt $__longest_item ] && __longest_item=${#__item} [ ${#__help} -gt $__longest_help ] && __longest_help=${#__help} - __rows=$(( $__rows + 1 )) + __rows_rlist_with_help_size=$(( + $__rows_rlist_with_help_size + 1 + )) done # Adjust rows early (for up-coming height calculation) if [ "$__var_height" -o "$__var_rows" ]; then # Add a row for visual aid if using Xdialog(1) - [ "$USE_XDIALOG" ] && __rows=$(( $__rows + 1 )) + [ "$USE_XDIALOG" ] && + __rows_rlist_with_help_size=$(( + $__rows_rlist_with_help_size + 1 + )) fi # Adjust height if desired @@ -1241,10 +1259,14 @@ f_dialog_radiolist_with_help_size() # Add rows to height if [ "$USE_XDIALOG" ]; then __height_rlist_with_help_size=$(( - $__height_rlist_with_help_size + $__rows + 7 )) + $__height_rlist_with_help_size + + $__rows_rlist_with_help_size + 7 + )) else __height_rlist_with_help_size=$(( - $__height_rlist_with_help_size + $__rows + 4 )) + $__height_rlist_with_help_size + + $__rows_rlist_with_help_size + 4 + )) fi setvar "$__var_height" $__height fi @@ -1270,7 +1292,7 @@ f_dialog_radiolist_with_help_size() fi # Store adjusted rows if desired - [ "$__var_rows" ] && setvar "$__var_rows" $__rows + [ "$__var_rows" ] && setvar "$__var_rows" $__rows_rlist_with_help_size # Constrain height, width, and rows to sensible minimum/maximum values # Return success if no-constrain, else return status from constrain Modified: stable/10/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/keymap.subr Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/share/keymap.subr Tue Apr 1 00:19:13 2014 (r263980) @@ -165,7 +165,7 @@ f_keymap_get_all() marks[keym] = mark name = keym gsub(/[^[:alnum:]_]/, "_", name) - gsub(/'\''/, "'\''\\'\'''\''", desc); + gsub(/'\''/, "'\''\\'\'\''", desc); printf "f_keymap_checkfile %s && " \ "f_keymap_register %s '\'%s\'' %s %u\n", keym, name, desc, keym, mark Modified: stable/10/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/script.subr Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/share/script.subr Tue Apr 1 00:19:13 2014 (r263980) @@ -1,6 +1,6 @@ if [ ! "$_SCRIPT_SUBR" ]; then _SCRIPT_SUBR=1 # -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -37,6 +37,8 @@ f_include $BSDCFG_SHARE/media/tcpip.subr f_include $BSDCFG_SHARE/mustberoot.subr f_include $BSDCFG_SHARE/networking/services.subr f_include $BSDCFG_SHARE/packages/packages.subr +f_include $BSDCFG_SHARE/usermgmt/group.subr +f_include $BSDCFG_SHARE/usermgmt/user.subr f_include $BSDCFG_SHARE/variable.subr ############################################################ GLOBALS @@ -50,25 +52,23 @@ RESWORDS= # Create a new `reserved' word for scripting purposes. Reswords call pre- # defined functions but differ from those functions in the following ways: # -# + Reswords do not take arguments but instead get all their data from -# the environment variable namespace. # + Unless noError is set (must be non-NULL), if calling the resword # results in failure, the application will terminate prematurely. # + noError is unset after each/every resword is called. # # Reswords should not be used in bsdconfig itself (hence the name `reserved -# word') but instead only in scripts loaded through f_script_load()). +# word') but instead only in scripts loaded through f_script_load(). # f_resword_new() { local resword="$1" func="$2" [ "$resword" ] || return $FAILURE f_dprintf "script.subr: New resWord %s -> %s" "$resword" "$func" - eval $resword\(\){ f_dispatch $func $resword\; } + eval $resword\(\){ f_dispatch $func $resword \"\$@\"\; } RESWORDS="$RESWORDS${RESWORDS:+ }$resword" } -# f_dispatch $func [$resword] +# f_dispatch $func $resword # # Wrapper function used by `reserved words' (reswords) to call other functions. # If $noError is set and non-NULL, a failure result from $func is ignored, @@ -78,9 +78,10 @@ f_resword_new() # f_dispatch() { - local func="$1" resword="${2:-$1}" + local func="$1" resword="$2" + shift 2 # func resword f_dprintf "f_dispatch: calling resword \`%s'" "$resword" - eval $func + eval $func "$@" local retval=$? if [ $retval -ne $SUCCESS ]; then local _ignore_this_error @@ -96,7 +97,7 @@ f_dispatch() # Load a script (usually filled with reswords). If $file is missing or NULL, # use one of the following instead (in order): # -# $configFile +# $configFile (global) # install.cfg # /stand/install.fg # /tmp/install.cfg @@ -108,9 +109,10 @@ f_dispatch() # f_script_load() { + local funcname=f_script_load local script="$1" config_file retval=$SUCCESS - f_dprintf "f_script_load: script=[%s]" "$script" + f_dprintf "$funcname: script=[%s]" "$script" if [ ! "$script" ]; then f_getvar $VAR_CONFIG_FILE config_file for script in \ @@ -130,11 +132,11 @@ f_script_load() setvar $VAR_NONINTERACTIVE yes if [ "$script" = "-" ]; then - f_dprintf "f_script_load: Loading script from stdin" + f_dprintf "$funcname: Loading script from stdin" eval "$( cat )" retval=$? else - f_dprintf "f_script_load: Loading script \`%s'" "$script" + f_dprintf "$funcname: Loading script \`%s'" "$script" if [ ! -e "$script" ]; then f_show_msg "$msg_unable_to_open" "$script" return $FAILURE @@ -198,6 +200,16 @@ f_resword_new packageAdd f_package_add f_resword_new packageDelete f_package_delete f_resword_new packageReinstall f_package_reinstall +# usermgmt/group.subr +f_resword_new addGroup f_group_add +f_resword_new deleteGroup f_group_delete +f_resword_new editGroup f_group_edit + +# usermgmt/user.subr +f_resword_new addUser f_user_add +f_resword_new deleteUser f_user_delete +f_resword_new editUser f_user_edit + # variable.subr f_resword_new installVarDefaults f_variable_set_defaults f_resword_new dumpVariables f_dump_variables Modified: stable/10/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/strings.subr Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/share/strings.subr Tue Apr 1 00:19:13 2014 (r263980) @@ -34,6 +34,12 @@ BSDCFG_SHARE="/usr/share/bsdconfig" ############################################################ GLOBALS # +# A Literal newline (for use with f_replace_all(), or IFS, or whatever) +# +NL=" +" # END-QUOTE + +# # Valid characters that can appear in an sh(1) variable name # # Please note that the character ranges A-Z and a-z should be avoided because @@ -189,7 +195,7 @@ f_number_of_lines() f_isinteger() { local arg="${1#-}" - [ "${arg:-x}" = "${arg#[!0-9]*}" ] + [ "${arg:-x}" = "${arg%[!0-9]*}" ] } # f_uriencode [$text] @@ -265,6 +271,9 @@ f_uridecode() # capturing in a sub-shell (which is less recommended due to performance # degradation). # +# To replace newlines or a sequence containing the newline character, use $NL +# as `\n' is not supported. +# f_replaceall() { local __left="" __right="$1" @@ -372,14 +381,13 @@ f_expand_number() local __cp __num __bshift __maxinput # Remove any leading non-digits - while :; do - __cp="$__string" - __string="${__cp#[!0-9]}" - [ "$__string" = "$__cp" ] && break - done + __string="${__string#${__string%%[0-9]*}}" + + # Store the numbers (no trailing suffix) + __num="${__string%%[!0-9]*}" # Produce `-1' if string didn't contain any digits - if [ ! "$__string" ]; then + if [ ! "$__num" ]; then if [ "$__var_to_set" ]; then setvar "$__var_to_set" -1 else @@ -388,25 +396,8 @@ f_expand_number() return 1 # 1 = "Given $string contains no digits" fi - # Store the numbers - __num="${__string%%[!0-9]*}" - - # Shortcut - if [ $__num -eq 0 ]; then - if [ "$__var_to_set" ]; then - setvar "$__var_to_set" 0 - else - echo 0 - fi - return $SUCCESS - fi - # Remove all the leading numbers from the string to get at the prefix - while :; do - __cp="$__string" - __string="${__cp#[0-9]}" - [ "$__string" = "$__cp" ] && break - done + __string="${__string#"$__num"}" # # Test for invalid prefix (and determine bitshift length) Modified: stable/10/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/variable.subr Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/share/variable.subr Tue Apr 1 00:19:13 2014 (r263980) @@ -1,6 +1,6 @@ if [ ! "$_VARIABLE_SUBR" ]; then _VARIABLE_SUBR=1 # -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -241,6 +241,10 @@ f_variable_new VAR_FTP_PORT ftpPort f_variable_new VAR_FTP_STATE ftpState f_variable_new VAR_FTP_USER ftpUser f_variable_new VAR_GATEWAY defaultrouter +f_variable_new VAR_GROUP group +f_variable_new VAR_GROUP_GID groupGid +f_variable_new VAR_GROUP_MEMBERS groupMembers +f_variable_new VAR_GROUP_PASSWORD groupPassword f_variable_new VAR_HOSTNAME hostname f_variable_new VAR_HTTP_DIR httpDirectory f_variable_new VAR_HTTP_FTP_MODE httpFtpMode @@ -279,6 +283,21 @@ f_variable_new VAR_SLOW_ETHER slowEther f_variable_new VAR_TRY_DHCP tryDHCP f_variable_new VAR_TRY_RTSOL tryRTSOL f_variable_new VAR_UFS_PATH ufs +f_variable_new VAR_USER user +f_variable_new VAR_USER_ACCOUNT_EXPIRE userAccountExpire +f_variable_new VAR_USER_DOTFILES_CREATE userDotfilesCreate +f_variable_new VAR_USER_GECOS userGecos +f_variable_new VAR_USER_GID userGid +f_variable_new VAR_USER_GROUPS userGroups +f_variable_new VAR_USER_GROUP_DELETE userGroupDelete +f_variable_new VAR_USER_HOME userHome +f_variable_new VAR_USER_HOME_CREATE userHomeCreate +f_variable_new VAR_USER_HOME_DELETE userHomeDelete +f_variable_new VAR_USER_LOGIN_CLASS userLoginClass +f_variable_new VAR_USER_PASSWORD userPassword +f_variable_new VAR_USER_PASSWORD_EXPIRE userPasswordExpire +f_variable_new VAR_USER_SHELL userShell +f_variable_new VAR_USER_UID userUid f_variable_new VAR_ZFSINTERACTIVE zfsInteractive # Modified: stable/10/usr.sbin/bsdconfig/timezone/share/menus.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/timezone/share/menus.subr Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/timezone/share/menus.subr Tue Apr 1 00:19:13 2014 (r263980) @@ -104,7 +104,7 @@ f_make_menus_awk=' function add_zone_n_to_country_menu(tlc, n) { zone_title = ENVIRON["country_" tlc "_descr_" n] - gsub(/'\''/, "'\''\\'\'''\''", zone_title) + gsub(/'\''/, "'\''\\'\'\''", zone_title) country_menu_list[tlc] = country_menu_list[tlc] \ ( length(country_menu_list[tlc]) > 0 ? "\n" : "" ) \ n " '\''" zone_title "'\''" @@ -121,7 +121,7 @@ BEGIN { { tlc = countries[cp] title = ENVIRON["country_" tlc "_name"] - gsub(/'\''/, "'\''\\'\'''\''", title) + gsub(/'\''/, "'\''\\'\'\''", title) nzones = ENVIRON["country_" tlc "_nzones"] if (!nzones) { Modified: stable/10/usr.sbin/bsdconfig/usermgmt/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/Makefile Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/usermgmt/Makefile Tue Apr 1 00:19:13 2014 (r263980) @@ -8,8 +8,7 @@ FILESDIR= ${LIBEXECDIR}/bsdconfig/070.us FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} -SCRIPTS= groupadd groupdel groupedit groupinput \ - useradd userdel useredit userinput usermgmt +SCRIPTS= groupadd groupdel groupedit useradd userdel useredit usermgmt beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: stable/10/usr.sbin/bsdconfig/usermgmt/groupadd ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/groupadd Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/usermgmt/groupadd Tue Apr 1 00:19:13 2014 (r263980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -33,8 +33,11 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/usermgmt/group.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm && pgm="${ipgm:-$pgm}" @@ -55,9 +58,19 @@ done shift $(( $OPTIND - 1 )) # -# Chain-load to groupinput to centralize code and minimize duplication +# Initialize # -$BSDCFG_LIBE/$APP_DIR/groupinput ${USE_XDIALOG:+-X} mode="Add" +f_dialog_title "$msg_add $msg_group" +f_dialog_backtitle "${ipgm:+bsdconfig }$pgm" +f_mustberoot_init + +# +# Add a group +# +# NB: If given an argument on the command-line use it; otherwise fall-back to +# environment variable $group (handle $VAR_GROUP). +# +f_group_add ${1:+"$1"} ################################################################################ # END Modified: stable/10/usr.sbin/bsdconfig/usermgmt/groupdel ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/groupdel Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/usermgmt/groupdel Tue Apr 1 00:19:13 2014 (r263980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,6 +34,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/usermgmt/group.subr f_include $BSDCFG_SHARE/usermgmt/group_input.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" @@ -65,9 +66,17 @@ f_dialog_backtitle "${ipgm:+bsdconfig }$ f_mustberoot_init # +# If given a group name, operate on it and exit +# +if [ "$1" ]; then + f_group_delete "$1" + exit $SUCCESS +fi + +# # Loop until the user Exits, Cancels or presses ESC # -defaultitem="" +defaultitem= while :; do f_dialog_menu_group_list "$defaultitem" retval=$? @@ -81,8 +90,7 @@ while :; do # Anything else is a group name - $BSDCFG_LIBE/$APP_DIR/groupinput \ - ${USE_XDIALOG:+-X} mode="Delete" group="$mtag" + f_group_delete "$mtag" done exit $SUCCESS Modified: stable/10/usr.sbin/bsdconfig/usermgmt/groupedit ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/groupedit Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/usermgmt/groupedit Tue Apr 1 00:19:13 2014 (r263980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,6 +34,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/usermgmt/group.subr f_include $BSDCFG_SHARE/usermgmt/group_input.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" @@ -65,9 +66,17 @@ f_dialog_backtitle "${ipgm:+bsdconfig }$ f_mustberoot_init # -# Loop until the user Exits, Cancels or presses ESC +# If given a group name, operate on it and exit # -defaultitem="" +if [ "$1" ]; then + f_group_edit "$1" + exit $SUCCESS +fi + +# +# Present a list of groups and loop until user Exits, Cancels or presses ESC +# +defaultitem= while :; do f_dialog_menu_group_list "$defaultitem" retval=$? @@ -81,8 +90,7 @@ while :; do # Anything else is a group name - $BSDCFG_LIBE/$APP_DIR/groupinput \ - ${USE_XDIALOG:+-X} mode="Edit/View" group="$mtag" + f_group_edit "$mtag" done exit $SUCCESS Modified: stable/10/usr.sbin/bsdconfig/usermgmt/include/messages.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/include/messages.subr Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/usermgmt/include/messages.subr Tue Apr 1 00:19:13 2014 (r263980) @@ -1,5 +1,5 @@ # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ hline_arrows_tab_enter="Press arrows, TA hline_num_arrows_tab_enter="Use numbers, arrows, TAB or ENTER" hline_num_tab_enter="Use numbers, TAB or ENTER" msg_account_does_not_expire="Account does not expire" -msg_account_expires_in_how_many_days="Account expires in how many days?" +msg_account_expire_manual_edit="Enter account expiration time. Format is one of:\n\n a) decimal for UNIX time since %s\n b) dd-mmm-yy[yy] for day, month, and 2- or 4-digit year\n c) +n[mhdwoy] for relative time from current date\n\nNOTE: Value of zero disables expiration." msg_account_expires_on="Account Expires on" msg_add="Add" msg_add_group="Add Group" @@ -56,6 +56,7 @@ msg_edit_group="Edit/View Group" msg_edit_login="Edit/View Login" msg_edit_view="Edit/View" msg_enter_group_members_manually="Enter Group Members manually" +msg_enter_groups_manually="Enter Groups manually" msg_enter_number_of_days_into_the_future="Enter number of days into the future" msg_enter_value_manually="Edit value manually" msg_error="ERROR!" @@ -74,9 +75,8 @@ msg_group_not_found="%s: Group not found msg_group_password="Group Password" msg_group_passwords_do_not_match="Group Passwords do not match." msg_group_updated="Group Updated" +msg_groups="Groups" msg_home_directory="Home Directory" -msg_invalid_number_of_days="Invalid number of days." -msg_invalid_number_of_seconds="Invalid number of seconds." msg_login="Login" msg_login_added="Login Added" msg_login_already_used="%s: Login is already used." @@ -85,23 +85,28 @@ msg_login_deleted="Login Deleted" msg_login_is_empty="Login is empty." msg_login_management="Login/Group Management" msg_login_must_start_with_letter="Login must start with a letter." -msg_login_not_found="Login not found." +msg_login_not_found="%s: Login not found." msg_login_updated="Login Updated" msg_member_of_groups="Member of Groups" msg_n_a="N/A" msg_no="No" +msg_no_group_specified="No group specified!" +msg_no_user_specified="No user specified!" msg_number_of_seconds_since_epoch="Number of seconds since the Epoch\n(1 = %s)\nNULL or zero to disable:" msg_ok="OK" msg_password="Password" msg_password_does_not_expire="Password does not expire" -msg_password_expires_in_how_many_days="Password expires in how many days?" +msg_password_expire_manual_edit="Enter password expiration time. Format is one of:\n\n a) decimal for UNIX time since %s\n b) dd-mmm-yy[yy] for day, month, and 2- or 4-digit year\n c) +n[mhdwoy] for relative time from current date\n\nNOTE: Value of zero disables expiration." msg_password_expires_on="Password Expires on" msg_passwords_do_not_match="Passwords do not match." +msg_please_enter_a_group_name="Please enter a group name!" +msg_please_enter_a_user_name="Please enter a user name!" msg_reenter_group_password="Re-enter Group Password" msg_reenter_password="Re-enter Password" msg_save="Save" msg_save_exit_or_cancel="Choose Save/Exit when finished or Cancel." msg_select_group_members_from_list="Select Group Members from a list" +msg_select_groups_from_list="Select Groups from a list" msg_select_login_shell="Select Login Shell" msg_separated_by_commas="Separated by commas" msg_shell="Shell" Modified: stable/10/usr.sbin/bsdconfig/usermgmt/share/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/share/Makefile Mon Mar 31 21:04:15 2014 (r263979) +++ stable/10/usr.sbin/bsdconfig/usermgmt/share/Makefile Tue Apr 1 00:19:13 2014 (r263980) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/usermgmt -FILES= group_input.subr user_input.subr +FILES= group.subr group_input.subr user.subr user_input.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Copied and modified: stable/10/usr.sbin/bsdconfig/usermgmt/share/group.subr (from r262904, head/usr.sbin/bsdconfig/usermgmt/share/group.subr) ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 7 20:44:19 2014 (r262904, copy source) +++ stable/10/usr.sbin/bsdconfig/usermgmt/share/group.subr Tue Apr 1 00:19:13 2014 (r263980) @@ -96,6 +96,10 @@ f_group_add() [ "$group_name" ] || f_show_err "$msg_please_enter_a_group_name" done + if [ ! "$group_name" ]; then + f_show_err "$msg_no_group_specified" + return $FAILURE + fi local group_password group_gid group_members f_getvar $VAR_GROUP_PASSWORD group_password @@ -152,10 +156,17 @@ f_group_add() case "$mtag" in X) # Add/Exit - local cmd="pw groupadd -n '$group_name'" - [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" + local var + for var in gid members name; do + local _group_$var + eval f_shell_escape \ + \"\$group_$var\" _group_$var + done + + local cmd="pw groupadd -n '$_group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$_group_gid'" [ "$group_members" ] && - cmd="$cmd -M '$group_members'" + cmd="$cmd -M '$_group_members'" # Execute the command (break on success) if [ "$group_password_disable" ]; then @@ -163,7 +174,7 @@ f_group_add() elif [ "$group_password" ]; then echo "$group_password" | f_eval_catch $funcname \ - pw '%s -h 0' "$cmd" + pw '%s -h 0' "$cmd" else f_eval_catch $funcname pw '%s' "$cmd" fi && break @@ -192,18 +203,24 @@ f_group_add() esac done else + local var + for var in gid members name; do + local _group_$var + eval f_shell_escape \"\$group_$var\" _group_$var + done + # Form the command - local cmd="pw groupadd -n '$group_name'" - [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" - [ "$group_members" ] && cmd="$cmd -M '$group_members'" + local cmd="pw groupadd -n '$_group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$_group_gid'" + [ "$group_members" ] && cmd="$cmd -M '$_group_members'" # Execute the command local retval err if [ "$group_password_disable" ]; then f_eval_catch -k err $funcname pw '%s -h -' "$cmd" elif [ "$group_password" ]; then - echo "$group_password" | f_eval_catch -k err \ - $funcname pw '%s -h 0' "$cmd" + err=$( echo "$group_password" | f_eval_catch -de \ + $funcname pw '%s -h 0' "$cmd" 2>&1 ) else f_eval_catch -k err $funcname pw '%s' "$cmd" fi @@ -217,7 +234,7 @@ f_group_add() f_dialog_title "$title" $alert "$msg_group_added" f_dialog_title_restore - [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 2 + [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 1 return $SUCCESS } @@ -272,8 +289,10 @@ f_group_delete() case "$mtag" in X) # Delete/Exit + local _group_name + f_shell_escape "$group_name" _group_name f_eval_catch $funcname pw 'pw groupdel "%s"' \ - "$group_name" && break + "$_group_name" && break ;; 1) # Group Name (select different group from list) f_dialog_menu_group_list "$group_name" || continue @@ -292,9 +311,10 @@ f_group_delete() esac done else - local retval err + local retval err _group_name + f_shell_escape "$group_name" _group_name f_eval_catch -k err $funcname pw \ - 'pw groupdel "%s"' "$group_name" + "pw groupdel '%s'" "$_group_name" retval=$? if [ $retval -ne $SUCCESS ]; then f_show_err "%s" "$err" @@ -305,7 +325,7 @@ f_group_delete() f_dialog_title "$title" $alert "$msg_group_deleted" f_dialog_title_restore - [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 2 + [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 1 return $SUCCESS } @@ -324,7 +344,9 @@ f_group_delete() # unchanged. # VAR_GROUP_MEMBERS [Optional] # Comma separated list of users that are a member of this group. -# If NULL or unset, group membership is unmodified. +# If set but NULL, group memberships are reset (no users will be +# a member of this group). If unset, group membership is +# unmodified. # VAR_GROUP_PASSWORD [Optional] # newgrp(1) password to set for the group. If unset, the password # is unmodified. If NULL, the newgrp(1) password is disabled. @@ -400,18 +422,24 @@ f_group_edit() case "$mtag" in X) # Save/Exit - local cmd="pw groupmod -n '$group_name'" - [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" + local var + for var in gid members name; do + local _group_$var + eval f_shell_escape \ + \"\$group_$var\" _group_$var + done + + local cmd="pw groupmod -n '$_group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$_group_gid'" [ "$group_members" -o "$null_members" ] && - cmd="$cmd -M '$group_members'" + cmd="$cmd -M '$_group_members'" # Execute the command (break on success) if [ "$group_password_disable" ]; then f_eval_catch $funcname pw '%s -h -' "$cmd" elif [ "$group_password" ]; then - echo "$group_password" | - f_eval_catch $funcname \ - pw '%s -h 0' "$cmd" + echo "$group_password" | f_eval_catch \ + $funcname pw '%s -h 0' "$cmd" else f_eval_catch $funcname pw '%s' "$cmd" fi && break @@ -424,7 +452,7 @@ f_group_edit() if ! f_input_group "$mtag"; then f_show_err "$msg_group_not_found" "$mtag" - # Attempt to fall back to prevoius selection + # Attempt to fall back to previous selection f_input_group "$input" || return $FAILURE else input="$mtag" @@ -446,19 +474,25 @@ f_group_edit() esac *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 1 08:19:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BE8B121C; Tue, 1 Apr 2014 08:19: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 AA99BEDB; Tue, 1 Apr 2014 08:19:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s318JVtU062585; Tue, 1 Apr 2014 08:19:31 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s318JV6C062584; Tue, 1 Apr 2014 08:19:31 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201404010819.s318JV6C062584@svn.freebsd.org> From: Dimitry Andric Date: Tue, 1 Apr 2014 08:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263984 - in stable: 10/contrib/llvm/tools/clang/lib/Driver 9/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 08:19:31 -0000 Author: dim Date: Tue Apr 1 08:19:30 2014 New Revision: 263984 URL: http://svnweb.freebsd.org/changeset/base/263984 Log: MFC r263891: Make clang default to DWARF2 debug info format for FreeBSD 10.x and earlier. For head, this commit does not change anything, but it is purely meant to be MFC'd. Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Tue Apr 1 06:46:59 2014 (r263983) +++ stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Tue Apr 1 08:19:30 2014 (r263984) @@ -2628,8 +2628,10 @@ void Clang::ConstructJob(Compilation &C, CmdArgs.push_back("-gdwarf-4"); else if (!A->getOption().matches(options::OPT_g0) && !A->getOption().matches(options::OPT_ggdb0)) { - // Default is dwarf-2 for darwin. - if (getToolChain().getTriple().isOSDarwin()) + // Default is dwarf-2 for darwin and FreeBSD <= 10. + const llvm::Triple &Triple = getToolChain().getTriple(); + if (Triple.isOSDarwin() || (Triple.getOS() == llvm::Triple::FreeBSD && + Triple.getOSMajorVersion() <= 10)) CmdArgs.push_back("-gdwarf-2"); else CmdArgs.push_back("-g"); From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 1 12:07:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5DC0F6C5; Tue, 1 Apr 2014 12:07: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 49B869B0; Tue, 1 Apr 2014 12:07: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 s31C7GFs057162; Tue, 1 Apr 2014 12:07:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31C7G27057161; Tue, 1 Apr 2014 12:07:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404011207.s31C7G27057161@svn.freebsd.org> From: Alexander Motin Date: Tue, 1 Apr 2014 12:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263987 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 12:07:16 -0000 Author: mav Date: Tue Apr 1 12:07:15 2014 New Revision: 263987 URL: http://svnweb.freebsd.org/changeset/base/263987 Log: MFC r263118: Report ZVOL block size as GEOM stripesize. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Apr 1 10:36:11 2014 (r263986) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Apr 1 12:07:15 2014 (r263987) @@ -925,12 +925,16 @@ zvol_open(struct g_provider *pp, int fla return (SET_ERROR(ENXIO)); } - if (zv->zv_total_opens == 0) + if (zv->zv_total_opens == 0) { err = zvol_first_open(zv); - if (err) { - if (locked) - mutex_exit(&spa_namespace_lock); - return (err); + if (err) { + if (locked) + mutex_exit(&spa_namespace_lock); + return (err); + } + pp->mediasize = zv->zv_volsize; + pp->stripeoffset = 0; + pp->stripesize = zv->zv_volblocksize; } if ((flag & FWRITE) && (zv->zv_flags & ZVOL_RDONLY)) { err = SET_ERROR(EROFS); From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 2 06:17:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B9618C1A; Wed, 2 Apr 2014 06:17:58 +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 A01D5D9A; Wed, 2 Apr 2014 06:17:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s326HwXQ008998; Wed, 2 Apr 2014 06:17:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s326Hwx8008997; Wed, 2 Apr 2014 06:17:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201404020617.s326Hwx8008997@svn.freebsd.org> From: Dimitry Andric Date: Wed, 2 Apr 2014 06:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264032 - in stable: 10/contrib/gcclibs/libcpp 9/contrib/gcclibs/libcpp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 06:17:58 -0000 Author: dim Date: Wed Apr 2 06:17:57 2014 New Revision: 264032 URL: http://svnweb.freebsd.org/changeset/base/264032 Log: MFC r263775: Avoid "cc1: warning: is shorter than expected" when using GNU cpp in combination with dtrace scripts, which have "#!/usr/sbin/dtrace -Cs" shebang lines. This is because dtrace positions the file pointer after the shebang line, before passing the file to GNU cpp. To fix the warning, adjust the size downwards by the current position, after a bit of sanity checking. Suggested by: avg Modified: stable/10/contrib/gcclibs/libcpp/files.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/gcclibs/libcpp/files.c Directory Properties: stable/9/contrib/gcclibs/ (props changed) Modified: stable/10/contrib/gcclibs/libcpp/files.c ============================================================================== --- stable/10/contrib/gcclibs/libcpp/files.c Wed Apr 2 01:58:54 2014 (r264031) +++ stable/10/contrib/gcclibs/libcpp/files.c Wed Apr 2 06:17:57 2014 (r264032) @@ -546,6 +546,7 @@ static bool read_file_guts (cpp_reader *pfile, _cpp_file *file) { ssize_t size, total, count; + off_t offset; uchar *buf; bool regular; @@ -573,6 +574,21 @@ read_file_guts (cpp_reader *pfile, _cpp_ } size = file->st.st_size; + + if ((offset = lseek(file->fd, 0, SEEK_CUR)) < 0) + { + cpp_error (pfile, CPP_DL_ERROR, "%s has no current position", + file->path); + return false; + } + else if (offset > INTTYPE_MAXIMUM (ssize_t) || (ssize_t)offset > size) + { + cpp_error (pfile, CPP_DL_ERROR, "current position of %s is too large", + file->path); + return false; + } + + size -= (ssize_t)offset; } else /* 8 kilobytes is a sensible starting size. It ought to be bigger From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 3 01:00:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2185B9F9; Thu, 3 Apr 2014 01:00: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 0DC54135; Thu, 3 Apr 2014 01:00: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 s3310pBK074069; Thu, 3 Apr 2014 01:00:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3310pSV074068; Thu, 3 Apr 2014 01:00:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404030100.s3310pSV074068@svn.freebsd.org> From: Xin LI Date: Thu, 3 Apr 2014 01:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264060 - stable/10/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 01:00:52 -0000 Author: delphij Date: Thu Apr 3 01:00:51 2014 New Revision: 264060 URL: http://svnweb.freebsd.org/changeset/base/264060 Log: MFC r263385: Remove unused option -r from zpool. Submitted by: Richard Yao Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Apr 3 00:55:16 2014 (r264059) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Apr 3 01:00:51 2014 (r264060) @@ -1969,7 +1969,7 @@ zpool_do_import(int argc, char **argv) char *endptr; /* check options */ - while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:rR:T:VX")) != -1) { + while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:R:T:VX")) != -1) { switch (c) { case 'a': do_all = B_TRUE; From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 3 11:59:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E605149C; Thu, 3 Apr 2014 11:59: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 D244E260; Thu, 3 Apr 2014 11:59: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 s33Bx4jo055564; Thu, 3 Apr 2014 11:59:04 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33Bx4pg055563; Thu, 3 Apr 2014 11:59:04 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201404031159.s33Bx4pg055563@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 3 Apr 2014 11:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264071 - stable/10/sys/dev/vt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 11:59:05 -0000 Author: ray Date: Thu Apr 3 11:59:04 2014 New Revision: 264071 URL: http://svnweb.freebsd.org/changeset/base/264071 Log: MFC r263809 Fix crash on resume in vt(9). Statically allocated terminal window have not initialized callout handler, so we have to initialize it even for existing window if it is console window. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/vt/vt_core.c Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Thu Apr 3 08:16:45 2014 (r264070) +++ stable/10/sys/dev/vt/vt_core.c Thu Apr 3 11:59:04 2014 (r264071) @@ -1872,6 +1872,9 @@ vt_upgrade(struct vt_device *vd) if (vw == NULL) { /* New window. */ vw = vt_allocate_window(vd, i); + } else if (vw->vw_flags & VWF_CONSOLE) { + /* For existing console window. */ + callout_init(&vw->vw_proc_dead_timer, 0); } if (i == VT_CONSWINDOW) { /* Console window. */ From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 3 14:13:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7257D356; Thu, 3 Apr 2014 14:13:58 +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 5DE37178; Thu, 3 Apr 2014 14:13:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33EDwrh013113; Thu, 3 Apr 2014 14:13:58 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33EDw2L013112; Thu, 3 Apr 2014 14:13:58 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404031413.s33EDw2L013112@svn.freebsd.org> From: Glen Barber Date: Thu, 3 Apr 2014 14:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264074 - stable/10/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 14:13:58 -0000 Author: gjb Date: Thu Apr 3 14:13:57 2014 New Revision: 264074 URL: http://svnweb.freebsd.org/changeset/base/264074 Log: Document that the FreeBSD/i386 instability with vfs.unmapped_buf_allowed=1 may be present on VMs running on hypervisors other than VirtualBox. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Thu Apr 3 12:04:05 2014 (r264073) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Thu Apr 3 14:13:57 2014 (r264074) @@ -167,6 +167,10 @@ boot It disables unmapped I/O at every boot: vfs.unmapped_buf_allowed=0 + + [2014-04-03 update] It has been reported that + instability may be present on virtual machines running + on other hypervisors, such as Xen or KVM. From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 3 14:47:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 863B2177; Thu, 3 Apr 2014 14:47: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 722C06D2; Thu, 3 Apr 2014 14:47: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 s33Elbo7027318; Thu, 3 Apr 2014 14:47:37 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33Elbtd027317; Thu, 3 Apr 2014 14:47:37 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404031447.s33Elbtd027317@svn.freebsd.org> From: Bryan Drewery Date: Thu, 3 Apr 2014 14:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264075 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 14:47:37 -0000 Author: bdrewery Date: Thu Apr 3 14:47:36 2014 New Revision: 264075 URL: http://svnweb.freebsd.org/changeset/base/264075 Log: MFC r263812: Update build(7) with LOCAL_* vars Modified: stable/10/share/man/man7/build.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/build.7 ============================================================================== --- stable/10/share/man/man7/build.7 Thu Apr 3 14:13:57 2014 (r264074) +++ stable/10/share/man/man7/build.7 Thu Apr 3 14:47:36 2014 (r264075) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2012 +.Dd March 27, 2014 .Dt BUILD 7 .Os .Sh NAME @@ -411,8 +411,25 @@ then is set to the value of .Va KERNFAST . .It Va LOCAL_DIRS -If set, this variable supplies a list of additional directories to -build, relative to the root of the source tree. +If set, this variable supplies a list of additional directories relative to +the root of the source tree to build as part of the +.Cm everything +target. +.It Va LOCAL_LIB_DIRS +If set, this variable supplies a list of additional directories relative to +the root of the source tree to build as part of the +.Cm libraries +target. +.It Va LOCAL_MTREE +If set, this variable supplies a list of additional mtrees relative to the +root of the source tree to use as part of the +.Cm hierarchy +target. +.It Va LOCAL_TOOL_DIRS +If set, this variable supplies a list of additional directories relative to +the root of the source tree to build as part of the +.Cm build-tools +target. .It Va PORTS_MODULES A list of ports with kernel modules that should be built and installed as part of the From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 3 14:58:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 89BB766B; Thu, 3 Apr 2014 14:58: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 7561A826; Thu, 3 Apr 2014 14:58: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 s33Ewr49031778; Thu, 3 Apr 2014 14:58:53 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33Ewq90031775; Thu, 3 Apr 2014 14:58:52 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201404031458.s33Ewq90031775@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 3 Apr 2014 14:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264076 - in stable/10: sys/net usr.bin/netstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 14:58:53 -0000 Author: glebius Date: Thu Apr 3 14:58:52 2014 New Revision: 264076 URL: http://svnweb.freebsd.org/changeset/base/264076 Log: o Provide a compatibility shim for netstat(1) to obtain output queue drops via NET_RT_IFLISTL sysctl. The sysctl handler appends oqdrops at the end of struct if_msghdrl, and netstat(1) sees that as an additional field of struct if_data. This allows us to fetch the data keeping ABI and API compatibility. This is direct commit to stable/10. o Merge r263331 from head, to restore printing of queue drops. Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: stable/10/sys/net/if.h stable/10/sys/net/rtsock.c stable/10/usr.bin/netstat/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.h ============================================================================== --- stable/10/sys/net/if.h Thu Apr 3 14:47:36 2014 (r264075) +++ stable/10/sys/net/if.h Thu Apr 3 14:58:52 2014 (r264076) @@ -106,6 +106,9 @@ struct if_data { uint64_t ifi_hwassist; /* HW offload capabilities, see IFCAP */ time_t ifi_epoch; /* uptime at attach or stat reset */ struct timeval ifi_lastchange; /* time of last administrative change */ +#ifdef _IFI_OQDROPS + u_long ifi_oqdrops; /* dropped on output */ +#endif }; /*- @@ -283,6 +286,9 @@ struct if_msghdrl { u_short ifm_len; /* length of if_msghdrl incl. if_data */ u_short ifm_data_off; /* offset of if_data from beginning */ struct if_data ifm_data;/* statistics and other data about if */ +#ifdef _IN_NET_RTSOCK_C + u_long ifi_oqdrops; +#endif }; /* Modified: stable/10/sys/net/rtsock.c ============================================================================== --- stable/10/sys/net/rtsock.c Thu Apr 3 14:47:36 2014 (r264075) +++ stable/10/sys/net/rtsock.c Thu Apr 3 14:58:52 2014 (r264076) @@ -52,6 +52,7 @@ #include #include +#define _IN_NET_RTSOCK_C #include #include #include @@ -105,6 +106,7 @@ struct if_data32 { uint32_t ifi_hwassist; int32_t ifi_epoch; struct timeval32 ifi_lastchange; + uint32_t ifi_oqdrops; }; struct if_msghdr32 { @@ -1662,6 +1664,7 @@ sysctl_iflist_ifml(struct ifnet *ifp, st if (carp_get_vhid_p != NULL) ifm32->ifm_data.ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); + ifm32->ifm_data.ifi_oqdrops = ifp->if_snd.ifq_drops; return (SYSCTL_OUT(w->w_req, (caddr_t)ifm32, len)); } @@ -1679,6 +1682,9 @@ sysctl_iflist_ifml(struct ifnet *ifp, st if (carp_get_vhid_p != NULL) ifm->ifm_data.ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); + ifm->ifm_data.ifi_datalen += sizeof(u_long); + ifm->ifi_oqdrops = ifp->if_snd.ifq_drops; + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); } Modified: stable/10/usr.bin/netstat/if.c ============================================================================== --- stable/10/usr.bin/netstat/if.c Thu Apr 3 14:47:36 2014 (r264075) +++ stable/10/usr.bin/netstat/if.c Thu Apr 3 14:58:52 2014 (r264076) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#define _IFI_OQDROPS #include #include #include @@ -251,7 +252,7 @@ intpr(int interval, void (*pfunc)(char * printf(" %10.10s","Obytes"); printf(" %5s", "Coll"); if (dflag) - printf(" %s", "Drop"); + printf(" %s", "Drop"); putchar('\n'); } @@ -382,7 +383,8 @@ intpr(int interval, void (*pfunc)(char * if (bflag) show_stat("lu", 10, IFA_STAT(obytes), link|network); show_stat("NRSlu", 5, IFA_STAT(collisions), link); - /* XXXGL: output queue drops */ + if (dflag) + show_stat("LSlu", 5, IFA_STAT(oqdrops), link); putchar('\n'); if (!aflag) @@ -460,6 +462,7 @@ struct iftot { u_long ift_id; /* input drops */ u_long ift_op; /* output packets */ u_long ift_oe; /* output errors */ + u_long ift_od; /* output drops */ u_long ift_co; /* collisions */ u_long ift_ib; /* input bytes */ u_long ift_ob; /* output bytes */ @@ -495,6 +498,7 @@ fill_iftot(struct iftot *st) st->ift_ib += IFA_STAT(ibytes); st->ift_op += IFA_STAT(opackets); st->ift_oe += IFA_STAT(oerrors); + st->ift_od += IFA_STAT(oqdrops); st->ift_ob += IFA_STAT(obytes); st->ift_co += IFA_STAT(collisions); } @@ -573,7 +577,8 @@ loop: show_stat("lu", 5, new->ift_oe - old->ift_oe, 1); show_stat("lu", 10, new->ift_ob - old->ift_ob, 1); show_stat("NRSlu", 5, new->ift_co - old->ift_co, 1); - /* XXXGL: output queue drops */ + if (dflag) + show_stat("LSlu", 5, new->ift_od - old->ift_od, 1); putchar('\n'); fflush(stdout); From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 3 16:57:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 665F1430; Thu, 3 Apr 2014 16:57: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 468BE3E4; Thu, 3 Apr 2014 16:57: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 s33GvHTP080987; Thu, 3 Apr 2014 16:57:17 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33GvG04080980; Thu, 3 Apr 2014 16:57:16 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201404031657.s33GvG04080980@svn.freebsd.org> From: Alan Somers Date: Thu, 3 Apr 2014 16:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264080 - in stable/10: sys/kern sys/sys tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 16:57:17 -0000 Author: asomers Date: Thu Apr 3 16:57:16 2014 New Revision: 264080 URL: http://svnweb.freebsd.org/changeset/base/264080 Log: MFC r263116 Replace 4.4BSD Lite's unix domain socket backpressure hack with a cleaner mechanism, based on the new SB_STOP sockbuf flag. The old hack dynamically changed the sending sockbuf's high water mark whenever adding or removing data from the receiving sockbuf. It worked for stream sockets, but it never worked for SOCK_SEQPACKET sockets because of their atomic nature. If the sockbuf was partially full, it might return EMSGSIZE instead of blocking. The new solution is based on DragonFlyBSD's fix from commit 3a6117bbe0ed6a87605c1e43e12a1438d8844380 on 2008-05-27. It adds an SB_STOP flag to sockbufs. Whenever uipc_send surpasses the socket's size limit, it sets SB_STOP on the sending sockbuf. sbspace() will then return 0 for that sockbuf, causing sosend_generic and friends to block. uipc_rcvd will likewise clear SB_STOP. There are two fringe benefits: uipc_{send,rcvd} no longer need to call chgsbsize() on every send and receive because they don't change the sockbuf's high water mark. Also, uipc_sense no longer needs to acquire the UIPC linkage lock, because it's simpler to compute the st_blksizes. There is one drawback: since sbspace() will only ever return 0 or the maximum, sosend_generic will allow the sockbuf to exceed its nominal maximum size by at most one packet of size less than the max. I don't think that's a serious problem. In fact, I'm not even positive that FreeBSD guarantees a socket will always stay within its nominal size limit. sys/sys/sockbuf.h Add the SB_STOP flag and adjust sbspace() sys/sys/unpcb.h Delete the obsolete unp_cc and unp_mbcnt fields from struct unpcb. sys/kern/uipc_usrreq.c Adjust uipc_rcvd, uipc_send, and uipc_sense to use the SB_STOP backpressure mechanism. Removing obsolete unpcb fields from db_show_unpcb. tests/sys/kern/unix_seqpacket_test.c Clear expected failures from ATF. Modified: stable/10/sys/kern/uipc_usrreq.c stable/10/sys/sys/sockbuf.h stable/10/sys/sys/unpcb.h stable/10/tests/sys/kern/unix_seqpacket_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_usrreq.c ============================================================================== --- stable/10/sys/kern/uipc_usrreq.c Thu Apr 3 16:24:49 2014 (r264079) +++ stable/10/sys/kern/uipc_usrreq.c Thu Apr 3 16:57:16 2014 (r264080) @@ -51,7 +51,6 @@ * * TODO: * RDM - * distinguish datagram size limits from flow control limits in SEQPACKET * rethink name space problems * need a proper out-of-band */ @@ -789,7 +788,6 @@ uipc_rcvd(struct socket *so, int flags) struct unpcb *unp, *unp2; struct socket *so2; u_int mbcnt, sbcc; - u_long newhiwat; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_rcvd: unp == NULL")); @@ -811,6 +809,15 @@ uipc_rcvd(struct socket *so, int flags) mbcnt = so->so_rcv.sb_mbcnt; sbcc = so->so_rcv.sb_cc; SOCKBUF_UNLOCK(&so->so_rcv); + /* + * There is a benign race condition at this point. If we're planning to + * clear SB_STOP, but uipc_send is called on the connected socket at + * this instant, it might add data to the sockbuf and set SB_STOP. Then + * we would erroneously clear SB_STOP below, even though the sockbuf is + * full. The race is benign because the only ill effect is to allow the + * sockbuf to exceed its size limit, and the size limits are not + * strictly guaranteed anyway. + */ UNP_PCB_LOCK(unp); unp2 = unp->unp_conn; if (unp2 == NULL) { @@ -819,13 +826,9 @@ uipc_rcvd(struct socket *so, int flags) } so2 = unp2->unp_socket; SOCKBUF_LOCK(&so2->so_snd); - so2->so_snd.sb_mbmax += unp->unp_mbcnt - mbcnt; - newhiwat = so2->so_snd.sb_hiwat + unp->unp_cc - sbcc; - (void)chgsbsize(so2->so_cred->cr_uidinfo, &so2->so_snd.sb_hiwat, - newhiwat, RLIM_INFINITY); + if (sbcc < so2->so_snd.sb_hiwat && mbcnt < so2->so_snd.sb_mbmax) + so2->so_snd.sb_flags &= ~SB_STOP; sowwakeup_locked(so2); - unp->unp_mbcnt = mbcnt; - unp->unp_cc = sbcc; UNP_PCB_UNLOCK(unp); return (0); } @@ -836,8 +839,7 @@ uipc_send(struct socket *so, int flags, { struct unpcb *unp, *unp2; struct socket *so2; - u_int mbcnt_delta, sbcc; - u_int newhiwat; + u_int mbcnt, sbcc; int error = 0; unp = sotounpcb(so); @@ -991,27 +993,21 @@ uipc_send(struct socket *so, int flags, } } - /* - * XXXRW: While fine for SOCK_STREAM, this conflates maximum - * datagram size and back-pressure for SOCK_SEQPACKET, which - * can lead to undesired return of EMSGSIZE on send instead - * of more desirable blocking. - */ - mbcnt_delta = so2->so_rcv.sb_mbcnt - unp2->unp_mbcnt; - unp2->unp_mbcnt = so2->so_rcv.sb_mbcnt; + mbcnt = so2->so_rcv.sb_mbcnt; sbcc = so2->so_rcv.sb_cc; sorwakeup_locked(so2); + /* + * The PCB lock on unp2 protects the SB_STOP flag. Without it, + * it would be possible for uipc_rcvd to be called at this + * point, drain the receiving sockbuf, clear SB_STOP, and then + * we would set SB_STOP below. That could lead to an empty + * sockbuf having SB_STOP set + */ SOCKBUF_LOCK(&so->so_snd); - if ((int)so->so_snd.sb_hiwat >= (int)(sbcc - unp2->unp_cc)) - newhiwat = so->so_snd.sb_hiwat - (sbcc - unp2->unp_cc); - else - newhiwat = 0; - (void)chgsbsize(so->so_cred->cr_uidinfo, &so->so_snd.sb_hiwat, - newhiwat, RLIM_INFINITY); - so->so_snd.sb_mbmax -= mbcnt_delta; + if (sbcc >= so->so_snd.sb_hiwat || mbcnt >= so->so_snd.sb_mbmax) + so->so_snd.sb_flags |= SB_STOP; SOCKBUF_UNLOCK(&so->so_snd); - unp2->unp_cc = sbcc; UNP_PCB_UNLOCK(unp2); m = NULL; break; @@ -1049,27 +1045,18 @@ release: static int uipc_sense(struct socket *so, struct stat *sb) { - struct unpcb *unp, *unp2; - struct socket *so2; + struct unpcb *unp; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_sense: unp == NULL")); sb->st_blksize = so->so_snd.sb_hiwat; - UNP_LINK_RLOCK(); UNP_PCB_LOCK(unp); - unp2 = unp->unp_conn; - if ((so->so_type == SOCK_STREAM || so->so_type == SOCK_SEQPACKET) && - unp2 != NULL) { - so2 = unp2->unp_socket; - sb->st_blksize += so2->so_rcv.sb_cc; - } sb->st_dev = NODEV; if (unp->unp_ino == 0) unp->unp_ino = (++unp_ino == 0) ? ++unp_ino : unp_ino; sb->st_ino = unp->unp_ino; UNP_PCB_UNLOCK(unp); - UNP_LINK_RUNLOCK(); return (0); } @@ -2497,8 +2484,7 @@ DB_SHOW_COMMAND(unpcb, db_show_unpcb) /* XXXRW: Would be nice to print the full address, if any. */ db_printf("unp_addr: %p\n", unp->unp_addr); - db_printf("unp_cc: %d unp_mbcnt: %d unp_gencnt: %llu\n", - unp->unp_cc, unp->unp_mbcnt, + db_printf("unp_gencnt: %llu\n", (unsigned long long)unp->unp_gencnt); db_printf("unp_flags: %x (", unp->unp_flags); Modified: stable/10/sys/sys/sockbuf.h ============================================================================== --- stable/10/sys/sys/sockbuf.h Thu Apr 3 16:24:49 2014 (r264079) +++ stable/10/sys/sys/sockbuf.h Thu Apr 3 16:57:16 2014 (r264080) @@ -52,6 +52,7 @@ #define SB_NOCOALESCE 0x200 /* don't coalesce new data into existing mbufs */ #define SB_IN_TOE 0x400 /* socket buffer is in the middle of an operation */ #define SB_AUTOSIZE 0x800 /* automatically size socket buffer */ +#define SB_STOP 0x1000 /* backpressure indicator */ #define SBS_CANTSENDMORE 0x0010 /* can't send more data to peer */ #define SBS_CANTRCVMORE 0x0020 /* can't receive more data from peer */ @@ -168,9 +169,19 @@ void sbunlock(struct sockbuf *sb); * still be negative (cc > hiwat or mbcnt > mbmax). Should detect * overflow and return 0. Should use "lmin" but it doesn't exist now. */ -#define sbspace(sb) \ - ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \ - (int)((sb)->sb_mbmax - (sb)->sb_mbcnt))) +static __inline +long +sbspace(struct sockbuf *sb) +{ + long bleft; + long mleft; + + if (sb->sb_flags & SB_STOP) + return(0); + bleft = sb->sb_hiwat - sb->sb_cc; + mleft = sb->sb_mbmax - sb->sb_mbcnt; + return((bleft < mleft) ? bleft : mleft); +} /* adjust counters in sb reflecting allocation of m */ #define sballoc(sb, m) { \ Modified: stable/10/sys/sys/unpcb.h ============================================================================== --- stable/10/sys/sys/unpcb.h Thu Apr 3 16:24:49 2014 (r264079) +++ stable/10/sys/sys/unpcb.h Thu Apr 3 16:57:16 2014 (r264080) @@ -74,8 +74,8 @@ struct unpcb { struct unp_head unp_refs; /* referencing socket linked list */ LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ struct sockaddr_un *unp_addr; /* bound address of socket */ - int unp_cc; /* copy of rcv.sb_cc */ - int unp_mbcnt; /* copy of rcv.sb_mbcnt */ + int reserved1; + int reserved2; unp_gen_t unp_gencnt; /* generation count of this instance */ short unp_flags; /* flags */ short unp_gcflag; /* Garbage collector flags. */ Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- stable/10/tests/sys/kern/unix_seqpacket_test.c Thu Apr 3 16:24:49 2014 (r264079) +++ stable/10/tests/sys/kern/unix_seqpacket_test.c Thu Apr 3 16:57:16 2014 (r264080) @@ -844,25 +844,21 @@ ATF_TC_BODY(emsgsize_nonblocking, tc) ATF_TC_WITHOUT_HEAD(eagain_8k_8k); ATF_TC_BODY(eagain_8k_8k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_eagain(8192, 8192); } ATF_TC_WITHOUT_HEAD(eagain_8k_128k); ATF_TC_BODY(eagain_8k_128k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_eagain(8192, 131072); } ATF_TC_WITHOUT_HEAD(eagain_128k_8k); ATF_TC_BODY(eagain_128k_8k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_eagain(131072, 8192); } ATF_TC_WITHOUT_HEAD(eagain_128k_128k); ATF_TC_BODY(eagain_128k_128k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_eagain(131072, 131072); } @@ -969,37 +965,24 @@ ATF_TC_BODY(pipe_simulator_128k_128k, tc ATF_TC_WITHOUT_HEAD(pipe_8k_8k); ATF_TC_BODY(pipe_8k_8k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_pipe(8192, 8192); } ATF_TC_WITHOUT_HEAD(pipe_8k_128k); ATF_TC_BODY(pipe_8k_128k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_pipe(8192, 131072); } ATF_TC_WITHOUT_HEAD(pipe_128k_8k); ATF_TC_BODY(pipe_128k_8k, tc) { - /* - * kern/185812 causes this test case to both fail and timeout. The - * atf-c-api(3) doesn't have a way to set such an expectation. - * If you use atf_tc_expect_fail, then it will timeout. If you use - * atf_tc_expect_timeout, then it will fail. If you use both, then it - * will show up as an unexpected pass, which is much worse - * - * https://code.google.com/p/kyua/issues/detail?id=76 - */ - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_pipe(131072, 8192); } ATF_TC_WITHOUT_HEAD(pipe_128k_128k); ATF_TC_BODY(pipe_128k_128k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_pipe(131072, 131072); } From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 3 17:26:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0B327F2B; Thu, 3 Apr 2014 17:26: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 DEA2A90A; Thu, 3 Apr 2014 17:26: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 s33HQjVR093269; Thu, 3 Apr 2014 17:26:45 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33HQjGQ093268; Thu, 3 Apr 2014 17:26:45 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201404031726.s33HQjGQ093268@svn.freebsd.org> From: Alan Somers Date: Thu, 3 Apr 2014 17:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264081 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 17:26:46 -0000 Author: asomers Date: Thu Apr 3 17:26:45 2014 New Revision: 264081 URL: http://svnweb.freebsd.org/changeset/base/264081 Log: MFC r263428 share/man/man7/tests.7 Added a section on test suite configuration, and cleaned up up grammar errors and awkward prose. The config variables were discussed on freebsd-testing. Modified: stable/10/share/man/man7/tests.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/tests.7 ============================================================================== --- stable/10/share/man/man7/tests.7 Thu Apr 3 16:57:16 2014 (r264080) +++ stable/10/share/man/man7/tests.7 Thu Apr 3 17:26:45 2014 (r264081) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 19, 2013 +.Dd March 20, 2014 .Dt TESTS 7 .Os .Sh NAME @@ -36,30 +36,29 @@ The .Fx test suite provides a collection of automated tests for two major purposes. -On the one hand, the test suite aids +On one hand, the test suite aids .Em developers -in catching bugs and regressions in the code when they performing modifications -to the source tree. -On the other hand, the test suite allows +to detect bugs and regressions when they modify the source tree. On the other +hand, it allows .Em end users (and, in particular, system administrators) to verify that fresh installations of the .Fx -operating system behave correctly in their hardware platform and also to ensure -that the system does not suffer from regressions during regular system -operation and maintenance. +operating system behave correctly on their hardware platform and also to ensure +that the system does not suffer from regressions during regular operation and +maintenance. .Pp The .Fx -test suite is installed under the +test suite is installed in the .Pa /usr/tests hierarchy. .Pp -This manual page describes how to execute the test suite and how to configure +This manual page describes how to run the test suite and how to configure some of its optional features. .Ss When to run the tests? Before diving into the details of how to run the test suite, here are some -scenarios in which you should be running them: +scenarios in which you should run it: .Bl -bullet -offset indent .It After a fresh installation of @@ -72,8 +71,7 @@ to a different version to ensure that th hardware platform and that the upgrade did not introduce regressions in your configuration. .It -After performing changes to the source tree to catch any bugs and/or regressions -introduced by the modifications. +After modifying the source tree to detect any new bugs and/or regressions. .It Periodically, maybe from a .Xr cron 8 @@ -82,18 +80,18 @@ third-party packages or manual modificat introduce unexpected failures. .El .Ss Running the tests -First of all, you will need to install the -.Sq ports/devel/kyua -package. -.Pp -Use the following command to run the whole test suite: +First, you will need to install the +.Sq devel/kyua +package from +.Xr ports 7 . +Then use the following command to run the whole test suite: .Bd -literal -offset indent $ kyua test -k /usr/tests/Kyuafile .Ed .Pp -The above will go through all test programs in +The above will iterate through all test programs in .Pa /usr/tests -recursively, execute them, store their results and debugging data in Kyua +recursively, execute them, store their results and debugging data in Kyua's database (by default in .Pa ~/.kyua/store.db ) , and print a summary of the results. @@ -111,15 +109,15 @@ utilities: $ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut .Ed .Ss Obtaining reports of the tests execution -Additional information of the results of the execution can be later extracted -from the database by using the various reporting commands of Kyua. -For example, the following would extract a plain-text report of the executed +Additional information about the test results can be retrieved +by using Kyua's various reporting commands. +For example, the following would print a plain-text report of the executed tests and show which ones failed: .Bd -literal -offset indent $ kyua report .Ed .Pp -This other example would generate an HTML report ready to be published on a +This example would generate an HTML report ready to be published on a web server: .Bd -literal -offset indent $ kyua report-html --output ~/public_html/tests @@ -128,30 +126,47 @@ $ kyua report-html --output ~/public_htm For further details on the command-line interface of Kyua, please refer to its manual page .Xr kyua 1 . -.\".Ss Configuring the tests -.\"Some test cases in the -.\".Fx -.\"test suite require the administrator to manually set up some configuration -.\"properties before they can run. -.\"Unless these properties are defined, the tests that require them will be marked -.\"as skipped and thus they will not be really executed. -.\".Pp -.\"Test suites are configured by defining the values to their configuration -.\"variables in -.\".Pa /usr/local/etc/kyua/kyua.conf . -.\"The format of this file is detailed in -.\".Xr kyua.conf 5 . -.\".Pp -.\"The following configuration variables are available in the -.\".Fx -.\"test suite: -.\".Bl -tag -.\".It NONE REGISTERED YET -.\"TBD. +.Ss Configuring the tests +Some test cases in the +.Fx +test suite require manual configuration by the administrator before they can be +run. Unless certain properties are defined, the tests that require them will +be skipped. +.Pp +Test suites are configured by defining their configuration +variables in +.Pa /usr/local/etc/kyua/kyua.conf . +The format of this file is detailed in +.Xr kyua.conf 5 . +.Pp +The following configuration variables are available in the +.Fx +test suite: +.Bl -tag -width "allow_sysctl_side_effects" +.It allow_devfs_side_effects +If defined, enables tests that may destroy and recreate semipermanent device +nodes, like disk devices. Without this variable, tests may still create and +destroy devices nodes that are normally transient, like /dev/tap* and +/dev/pts*, as long as they clean them up afterwards. However, tests that +require this variable have a relaxed cleanup requirement; they must recreate +any devices that they destroyed, but not necessarily with the same devnames. +.It allow_sysctl_side_effects +Enables tests that change globally significant +.Xr sysctl 8 +variables. The tests will undo any changes in their cleanup phases. +.It disks +Must be set to a space delimited list of disk device nodes. Tests that need +destructive access to disks must use these devices. Tests are not required to +preserve any data present on these disks. +.It fibs +Must be set to a space delimited list of FIBs (routing tables). Tests that +need to modify a routing table may use any of these. Tests will cleanup any +new routes that they create. +.El .Ss What to do if something fails? If there is .Em any failure -during the execution of the test suite, please considering reporting it to the +during the execution of the test suite, please consider reporting it to the .Fx developers so that the failure can be analyzed and fixed. To do so, either send a message to the appropriate mailing list or file a @@ -173,7 +188,7 @@ User-specific configuration file for .Xr kyua 1 ; overrides the system file. .It Pa ~/.kyua/store.db -Default database used by Kyua to maintain the data of the executed tests. +Default result database used by Kyua. .It Pa /usr/tests/ Location of the .Fx @@ -184,9 +199,7 @@ Top-level test suite definition file. .Sh SEE ALSO .Xr kyua 1 . .Sh HISTORY -The collection of test programs in -.Pa /usr/tests -first appeared in +This test suite first appeared in .Fx 11.0 . .Pp The From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 4 07:34:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 25B8CC99; Fri, 4 Apr 2014 07:34: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 107A28EA; Fri, 4 Apr 2014 07:34: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 s347YmhP053320; Fri, 4 Apr 2014 07:34:48 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s347Yl1j053311; Fri, 4 Apr 2014 07:34:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404040734.s347Yl1j053311@svn.freebsd.org> From: Glen Barber Date: Fri, 4 Apr 2014 07:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264106 - in stable/10: release release/arm release/tools release/tools/arm share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 07:34:49 -0000 Author: gjb Date: Fri Apr 4 07:34:46 2014 New Revision: 264106 URL: http://svnweb.freebsd.org/changeset/base/264106 Log: MFC r262810, r262862, r264105: r262810: Merge enabling building FreeBSD/arm images as part of the release build process. r262862: Provide backwards-compatibility with release.conf SVNROOT entries that do not have a trailing '/'. r264105: Add ZEDBOARD support for release builds. * Local modifications: - Set SRCBRANCH from head/ to stable/10/. - Strip svn:merginfo from ^/projects/release-embedded to avoid pollution. Sponsored by: The FreeBSD Foundation Added: stable/10/release/arm/ - copied from r262810, head/release/arm/ stable/10/release/arm/ZEDBOARD.conf - copied, changed from r264105, head/release/arm/ZEDBOARD.conf stable/10/release/tools/ - copied from r262810, head/release/tools/ stable/10/release/tools/arm/crochet-ZEDBOARD.conf - copied unchanged from r264105, head/release/tools/arm/crochet-ZEDBOARD.conf Modified: stable/10/release/arm/BEAGLEBONE.conf stable/10/release/arm/PANDABOARD.conf stable/10/release/arm/RPI-B.conf stable/10/release/arm/WANDBOARD-QUAD.conf stable/10/release/release.conf.sample stable/10/release/release.sh stable/10/share/man/man7/release.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Wed Mar 5 23:17:53 2014 (r262810) +++ stable/10/release/arm/BEAGLEBONE.conf Fri Apr 4 07:34:46 2014 (r264106) @@ -14,7 +14,7 @@ fi TARGET="amd64" TARGET_ARCH="amd64" SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" +SRCBRANCH="base/stable/10@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" NODOC=yes Modified: stable/10/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Wed Mar 5 23:17:53 2014 (r262810) +++ stable/10/release/arm/PANDABOARD.conf Fri Apr 4 07:34:46 2014 (r264106) @@ -14,7 +14,7 @@ fi TARGET="amd64" TARGET_ARCH="amd64" SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" +SRCBRANCH="base/stable/10@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" NODOC=yes Modified: stable/10/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Wed Mar 5 23:17:53 2014 (r262810) +++ stable/10/release/arm/RPI-B.conf Fri Apr 4 07:34:46 2014 (r264106) @@ -14,7 +14,7 @@ fi TARGET="amd64" TARGET_ARCH="amd64" SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" +SRCBRANCH="base/stable/10@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" NODOC=yes Modified: stable/10/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- head/release/arm/WANDBOARD-QUAD.conf Wed Mar 5 23:17:53 2014 (r262810) +++ stable/10/release/arm/WANDBOARD-QUAD.conf Fri Apr 4 07:34:46 2014 (r264106) @@ -14,7 +14,7 @@ fi TARGET="amd64" TARGET_ARCH="amd64" SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" +SRCBRANCH="base/stable/10@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" NODOC=yes Copied and modified: stable/10/release/arm/ZEDBOARD.conf (from r264105, head/release/arm/ZEDBOARD.conf) ============================================================================== --- head/release/arm/ZEDBOARD.conf Fri Apr 4 07:02:38 2014 (r264105, copy source) +++ stable/10/release/arm/ZEDBOARD.conf Fri Apr 4 07:34:46 2014 (r264106) @@ -6,7 +6,7 @@ TARGET="amd64" TARGET_ARCH="amd64" SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" +SRCBRANCH="base/stable/10@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" NODOC=yes Modified: stable/10/release/release.conf.sample ============================================================================== --- stable/10/release/release.conf.sample Fri Apr 4 07:02:38 2014 (r264105) +++ stable/10/release/release.conf.sample Fri Apr 4 07:34:46 2014 (r264106) @@ -10,7 +10,7 @@ CHROOTDIR="/scratch" SVNROOT="svn://svn.FreeBSD.org/" ## Set the src/, ports/, and doc/ branches or tags. -SRCBRANCH="base/head@rHEAD" +SRCBRANCH="base/stable/10@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" @@ -45,5 +45,17 @@ PORTBRANCH="ports/head@rHEAD" ## Set miscellaneous 'make release' settings. #NODOC= #NOPORTS= -#RELSTRING= #WITH_DVD= + +## Set when building embedded images. +#EMBEDDEDBUILD= + +## Set to skip the chroot environment buildworld/installworld/distribution +## step if it is expected the build environment will exist via alternate +## means. +#CHROOTBUILD_SKIP= + +## Set to pass additional flags to make(1) for the build chroot setup, such +## as TARGET/TARGET_ARCH. +#CHROOT_MAKEENV= + Modified: stable/10/release/release.sh ============================================================================== --- stable/10/release/release.sh Fri Apr 4 07:02:38 2014 (r264105) +++ stable/10/release/release.sh Fri Apr 4 07:34:46 2014 (r264106) @@ -41,6 +41,7 @@ export PATH # The directory within which the release will be built. CHROOTDIR="/scratch" +RELENGDIR="$(realpath $(dirname $(basename ${0})))" # The default version control system command to obtain the sources. VCSCMD="svn checkout" @@ -52,6 +53,9 @@ SRCBRANCH="base/head@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" +# Set for embedded device builds. +EMBEDDEDBUILD= + # Sometimes one needs to checkout src with --force svn option. # If custom kernel configs copied to src tree before checkout, e.g. SRC_FORCE_CHECKOUT= @@ -103,14 +107,33 @@ while getopts c: opt; do done shift $(($OPTIND - 1)) +# Fix for backwards-compatibility with release.conf that does not have the +# trailing '/'. +case ${SVNROOT} in + *svn*) + SVNROOT="${SVNROOT}/" + ;; + *) + ;; +esac + # Prefix the branches with the SVNROOT for the full checkout URL. SRCBRANCH="${SVNROOT}${SRCBRANCH}" DOCBRANCH="${SVNROOT}${DOCBRANCH}" PORTBRANCH="${SVNROOT}${PORTBRANCH}" +if [ -n "${EMBEDDEDBUILD}" ]; then + if [ -z "${XDEV}" ] || [ -z "${XDEV_ARCH}" ]; then + echo "ERROR: XDEV and XDEV_ARCH must be set in ${RELEASECONF}." + exit 1 + fi + WITH_DVD= + NODOC=yes +fi + # If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree # is required to build the documentation set. -if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then +if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then echo "*** NOTICE: Setting NODOC=1 since ports tree is required" echo " and NOPORTS is set." NODOC=yes @@ -120,10 +143,10 @@ fi # The release makefile verifies definedness of NOPORTS/NODOC variables # instead of their values. DOCPORTS= -if [ "x${NOPORTS}" != "x" ]; then +if [ -n "${NOPORTS}" ]; then DOCPORTS="NOPORTS=yes " fi -if [ "x${NODOC}" != "x" ]; then +if [ -n "${NODOC}" ]; then DOCPORTS="${DOCPORTS}NODOC=yes" fi @@ -131,12 +154,12 @@ fi # this file, unless overridden by release.conf. In most cases, these # will not need to be changed. CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}" -if [ "x${TARGET}" != "x" ] && [ "x${TARGET_ARCH}" != "x" ]; then +if [ -n "${TARGET}" ] && [ -n "${TARGET_ARCH}" ]; then ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" else ARCH_FLAGS= fi -CHROOT_MAKEENV="MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" +CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" CHROOT_IMAKEFLAGS="${CONF_FILES}" CHROOT_DMAKEFLAGS="${CONF_FILES}" @@ -147,11 +170,11 @@ RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCO # Force src checkout if configured FORCE_SRC_KEY= -if [ "x${SRC_FORCE_CHECKOUT}" != "x" ]; then +if [ -n "${SRC_FORCE_CHECKOUT}" ]; then FORCE_SRC_KEY="--force" fi -if [ ! ${CHROOTDIR} ]; then +if [ -z "${CHROOTDIR}" ]; then echo "Please set CHROOTDIR." exit 1 fi @@ -166,19 +189,21 @@ set -e # Everything must succeed mkdir -p ${CHROOTDIR}/usr ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src -if [ "x${NODOC}" = "x" ]; then +if [ -z "${NODOC}" ]; then ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi -if [ "x${NOPORTS}" = "x" ]; then +if [ -z "${NOPORTS}" ]; then ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi -cd ${CHROOTDIR}/usr/src -env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld -env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \ - DESTDIR=${CHROOTDIR} -env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ - DESTDIR=${CHROOTDIR} +if [ -z "${CHROOTBUILD_SKIP}" ]; then + cd ${CHROOTDIR}/usr/src + env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld + env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \ + DESTDIR=${CHROOTDIR} + env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ + DESTDIR=${CHROOTDIR} +fi mount -t devfs devfs ${CHROOTDIR}/dev cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit @@ -194,6 +219,29 @@ if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CO cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} fi +# Embedded builds do not use the 'make release' target. +if [ -n "${EMBEDDEDBUILD}" ]; then + # If a crochet configuration file exists in *this* checkout of + # release/, copy it to the /tmp/external directory within the chroot. + # This allows building embedded releases without relying on updated + # scripts and/or configurations to exist in the branch being built. + if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \ + [ -e ${RELENGDIR}/${XDEV}/release.sh ]; then + mkdir -p ${CHROOTDIR}/tmp/external/${XDEV}/ + cp ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf \ + ${CHROOTDIR}/tmp/external/${XDEV}/crochet-${KERNEL}.conf + /bin/sh ${RELENGDIR}/${XDEV}/release.sh + fi + # If the script does not exist for this architecture, exit. + # This probably should be checked earlier, but allowing the rest + # of the build process to get this far will at least set up the + # chroot environment for testing. + exit 0 +else + # Not embedded. + continue +fi + if [ -d ${CHROOTDIR}/usr/ports ]; then # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints # is created. This is needed by ports-mgmt/pkg. @@ -201,7 +249,7 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then ## Trick the ports 'run-autotools-fixup' target to do the right thing. _OSVERSION=$(sysctl -n kern.osreldate) - if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then + if [ -d ${CHROOTDIR}/usr/doc ] && [ -z "${NODOC}" ]; then PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" PBUILD_FLAGS="${PBUILD_FLAGS}" chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ @@ -209,13 +257,9 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then fi fi -if [ "x${RELSTRING}" = "x" ]; then - RELSTRING="$(chroot ${CHROOTDIR} uname -s)-${OSRELEASE}-${TARGET_ARCH}" -fi - eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - release RELSTRING=${RELSTRING} + release eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - install DESTDIR=/R RELSTRING=${RELSTRING} + install DESTDIR=/R Copied: stable/10/release/tools/arm/crochet-ZEDBOARD.conf (from r264105, head/release/tools/arm/crochet-ZEDBOARD.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/release/tools/arm/crochet-ZEDBOARD.conf Fri Apr 4 07:34:46 2014 (r264106, copy of r264105, head/release/tools/arm/crochet-ZEDBOARD.conf) @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# This is the configuration file for use with crochet to produce +# FreeBSD ZedBoard images. + +board_setup ZedBoard +option ImageSize 1gb +option AutoSize + +export MAKEOBJDIRPREFIX=/usr/obj +FREEBSD_SRC=/usr/src +__MAKE_CONF=/dev/null +SRCCONF=/dev/null +WORKDIR=/usr/obj +_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) +_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) +KERNCONF=ZEDBOARD +TARGET=arm +TARGET_ARCH=armv6 +FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" +FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}" +FREEBSD_INSTALLWORLD_EXTRA_ARGS="" +FREEBSD_INSTALLKERNEL_EXTRA_ARGS="" +FREEBSD_WORLD_EXTRA_ARGS="" +FREEBSD_KERNEL_EXTRA_ARGS="" +FREEBSD_EXTRA_ARGS="" +IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img Modified: stable/10/share/man/man7/release.7 ============================================================================== --- stable/10/share/man/man7/release.7 Fri Apr 4 07:02:38 2014 (r264105) +++ stable/10/share/man/man7/release.7 Fri Apr 4 07:34:46 2014 (r264106) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2014 +.Dd March 5, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -138,6 +138,11 @@ configuration file supports the followin .Bl -tag -width Ev .It Va CHROOTDIR The directory within which the release will be built. +.It Va CHROOT_MAKEENV +Additional +.Xr make 1 +arguments to pass through, which directly affect the +tuning of the build chroot. .It Va SVNROOT The .Xr svn 1 @@ -249,6 +254,72 @@ target. The command run to obtain the source trees. Defaults to .Qq Cm svn checkout . +.It Va CHROOTBUILD_SKIP +If defined, the +.Li buildworld , +.Li installworld , +and +.Li distribution +stages of the +.Xr chroot 8 +build environment setup are skipped. +This is intended solely for cases where the +.Xr chroot 8 +userland are provided by alternate means. +.El +.Sh EMBEDDED BUILDS +The following +.Fa release.conf +variables are relevant only to release builds for embedded systems: +.Bl -tag -width Ev +.It Va EMBEDDEDBUILD +Set to a non-null value to enable functionality for embedded device +release builds. +.Pq This option is considered highly experimental. +.Pp +When set, +.Va WITH_DVD +is unset, and +.Va NODOC +is defined. +Additionally, +.Va XDEV +and +.Va XDEV_ARCH +must also be defined. +When the build environment is created, +.Fa release.sh +runs a separate build script located in an architecture-specific +directory in +.Pa src/release/${XDEV}/ . +.It Va EMBEDDEDPORTS +Set to the list of any ports that are required for the target device +in the format of +.Fa category/port . +The +.Fa devel/subversion +port is built by default. +.It Va CROCHETSRC +Set to the source URL for the Crochet build tool. +.It Va CROCHETBRANCH +Set to the subversion branch from +.Va ${CROCHETSRC} +to use. +Defaults to +.Pa trunk . +.It Va UBOOTSRC +Set to the source URL of u-boot, if required. +.It Va UBOOTBRANCH +Set to the subversion branch from +.Va ${UBOOTSRC} +to use. +Defaults to +.Pa trunk . +.It Va UBOOTDIR +Set to the target directory within +.Va ${CHROOTDIR} +to check out +.Va ${UBOOTSRC}/${UBOOTBRANCH} . .El .Sh MAKEFILE TARGETS The release makefile From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 4 07:43:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 91F03164; Fri, 4 Apr 2014 07:43: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 725DF9C5; Fri, 4 Apr 2014 07:43: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 s347hCvh057358; Fri, 4 Apr 2014 07:43:12 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s347hB4s057353; Fri, 4 Apr 2014 07:43:11 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404040743.s347hB4s057353@svn.freebsd.org> From: Glen Barber Date: Fri, 4 Apr 2014 07:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264108 - stable/10/release/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 07:43:12 -0000 Author: gjb Date: Fri Apr 4 07:43:11 2014 New Revision: 264108 URL: http://svnweb.freebsd.org/changeset/base/264108 Log: MFC r264107: Remove only-works-on-amd64 restriction. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/arm/BEAGLEBONE.conf stable/10/release/arm/PANDABOARD.conf stable/10/release/arm/RPI-B.conf stable/10/release/arm/WANDBOARD-QUAD.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/10/release/arm/BEAGLEBONE.conf Fri Apr 4 07:42:12 2014 (r264107) +++ stable/10/release/arm/BEAGLEBONE.conf Fri Apr 4 07:43:11 2014 (r264108) @@ -2,14 +2,6 @@ # $FreeBSD$ # -# This is only supported on amd64 right now. It may work on -# i386, but I do not have the hardware to test, so until I get -# a VM set up to make sure, be cautious and assume it will not. -if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then - echo "This is only supported on amd64 right now." - exit 0 -fi - # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" Modified: stable/10/release/arm/PANDABOARD.conf ============================================================================== --- stable/10/release/arm/PANDABOARD.conf Fri Apr 4 07:42:12 2014 (r264107) +++ stable/10/release/arm/PANDABOARD.conf Fri Apr 4 07:43:11 2014 (r264108) @@ -2,14 +2,6 @@ # $FreeBSD$ # -# This is only supported on amd64 right now. It may work on -# i386, but I do not have the hardware to test, so until I get -# a VM set up to make sure, be cautious and assume it will not. -if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then - echo "This is only supported on amd64 right now." - exit 0 -fi - # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" Modified: stable/10/release/arm/RPI-B.conf ============================================================================== --- stable/10/release/arm/RPI-B.conf Fri Apr 4 07:42:12 2014 (r264107) +++ stable/10/release/arm/RPI-B.conf Fri Apr 4 07:43:11 2014 (r264108) @@ -2,14 +2,6 @@ # $FreeBSD$ # -# This is only supported on amd64 right now. It may work on -# i386, but I do not have the hardware to test, so until I get -# a VM set up to make sure, be cautious and assume it will not. -if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then - echo "This is only supported on amd64 right now." - exit 0 -fi - # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" Modified: stable/10/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- stable/10/release/arm/WANDBOARD-QUAD.conf Fri Apr 4 07:42:12 2014 (r264107) +++ stable/10/release/arm/WANDBOARD-QUAD.conf Fri Apr 4 07:43:11 2014 (r264108) @@ -2,14 +2,6 @@ # $FreeBSD$ # -# This is only supported on amd64 right now. It may work on -# i386, but I do not have the hardware to test, so until I get -# a VM set up to make sure, be cautious and assume it will not. -if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then - echo "This is only supported on amd64 right now." - exit 0 -fi - # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 4 07:47:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BF01B35C; Fri, 4 Apr 2014 07:47:08 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.glenbarber.us", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FBEF9E8; Fri, 4 Apr 2014 07:47:08 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id A0A57BDDB; Fri, 4 Apr 2014 07:47:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us A0A57BDDB Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 4 Apr 2014 03:47:05 -0400 From: Glen Barber To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r264108 - stable/10/release/arm Message-ID: <20140404074705.GO14379@glenbarber.us> References: <201404040743.s347hB4s057353@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dLxyWiplEfGRIOx4" Content-Disposition: inline In-Reply-To: <201404040743.s347hB4s057353@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 07:47:08 -0000 --dLxyWiplEfGRIOx4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 04, 2014 at 07:43:11AM +0000, Glen Barber wrote: > Author: gjb > Date: Fri Apr 4 07:43:11 2014 > New Revision: 264108 > URL: http://svnweb.freebsd.org/changeset/base/264108 >=20 > Log: > MFC r264107: > Remove only-works-on-amd64 restriction. Yes, I realize this was an insta-MFC, but to avoid pain of requiring the build system to be amd64 (which seems is not necessary), this is effectively a noop, and should have been merged much sooner. It was, however, extensively tested for the past several weeks. Glen --dLxyWiplEfGRIOx4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTPmN4AAoJELls3eqvi17Q2CMP+wcAJuMXNwC2ox/1vJ6ceKcc 5hMICN5e06oRnfgFHaBGZtnChACgULArGcKUOdFBaFQEeMTJsXbMyYS6zHHF51Xu qU7G0sOYU3cduhpJ4VAEa98/cgkXTldvsQ7JIgMbGNp9y+CRtpCOnMSj1Md0Cyfg E7NuTSdNhSfc2YhfaLg14kSE6ZhO2x/Zbdyv0/PbDuQ9qWVfuWkMjcku1u4rlZJB jUXJFbnDFV1b+qBFqCdkYQ5JCHtOJxHlYgOuw1pVffnDWu4n7HSq/Ee40boSjCd8 b1B/4VhI7C4cvyvWN6bk3a02XhQiVI4USqr/g9cNBZcySv+v0Wg/kgzAGAOmgBjL SHx2Q+jZ+U0h1WQuaXxYciQsa7dIUWaiBL1ns0c7Bq7T7yBKrWurcXTaDbFklb+f vp0JmI1H9oIp3k6skVDv89lyszGcISlzorf8WZy0TXzwp8mBYosW9ZwpjscESfVM 3eUuV5RoO6gYIqlgwmHaXuWkZLYz82eS3l+dsjRgG4O680hMzGv+pGJXBtTCXgPV 7TlF20bEuRqPADJ4s+xBrbTQcLJsLOzPHlIemyt1mpEEVPaOndYwf6sN5ecrynHe p1YargvrIOUwTObFcHZJljArzk18ZjCXmO5bHv1oa5y5EuPxcDM3MIBUxdCEaWjN 8bn72iEX9qyP40ICYiTD =OtGq -----END PGP SIGNATURE----- --dLxyWiplEfGRIOx4-- From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 4 10:34:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2BB5C156; Fri, 4 Apr 2014 10:34: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 0C10FB22; Fri, 4 Apr 2014 10:34: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 s34AXxUU029285; Fri, 4 Apr 2014 10:33:59 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34AXx1N029284; Fri, 4 Apr 2014 10:33:59 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201404041033.s34AXx1N029284@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 4 Apr 2014 10:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264111 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 10:34:00 -0000 Author: glebius Date: Fri Apr 4 10:33:59 2014 New Revision: 264111 URL: http://svnweb.freebsd.org/changeset/base/264111 Log: Merge r262341: - Improve logging of send errors, reporting error code and interface. - Reduce code duplication between INET and INET6. Modified: stable/10/sys/netinet/ip_carp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_carp.c ============================================================================== --- stable/10/sys/netinet/ip_carp.c Fri Apr 4 08:48:55 2014 (r264110) +++ stable/10/sys/netinet/ip_carp.c Fri Apr 4 10:33:59 2014 (r264111) @@ -761,6 +761,35 @@ carp_send_ad(void *v) } static void +carp_send_ad_error(struct carp_softc *sc, int error) +{ + + if (error) { + if (sc->sc_sendad_errors < INT_MAX) + sc->sc_sendad_errors++; + if (sc->sc_sendad_errors == CARP_SENDAD_MAX_ERRORS) { + static const char fmt[] = "send error %d on %s"; + char msg[sizeof(fmt) + IFNAMSIZ]; + + sprintf(msg, fmt, error, sc->sc_carpdev->if_xname); + carp_demote_adj(V_carp_senderr_adj, msg); + } + sc->sc_sendad_success = 0; + } else { + if (sc->sc_sendad_errors >= CARP_SENDAD_MAX_ERRORS && + ++sc->sc_sendad_success >= CARP_SENDAD_MIN_SUCCESS) { + static const char fmt[] = "send ok on %s"; + char msg[sizeof(fmt) + IFNAMSIZ]; + + sprintf(msg, fmt, sc->sc_carpdev->if_xname); + carp_demote_adj(-V_carp_senderr_adj, msg); + sc->sc_sendad_errors = 0; + } else + sc->sc_sendad_errors = 0; + } +} + +static void carp_send_ad_locked(struct carp_softc *sc) { struct carp_header ch; @@ -836,25 +865,8 @@ carp_send_ad_locked(struct carp_softc *s CARPSTATS_INC(carps_opackets); - if (ip_output(m, NULL, NULL, IP_RAWOUTPUT, - &sc->sc_carpdev->if_carp->cif_imo, NULL)) { - if (sc->sc_sendad_errors < INT_MAX) - sc->sc_sendad_errors++; - if (sc->sc_sendad_errors == CARP_SENDAD_MAX_ERRORS) - carp_demote_adj(V_carp_senderr_adj, - "send error"); - sc->sc_sendad_success = 0; - } else { - if (sc->sc_sendad_errors >= CARP_SENDAD_MAX_ERRORS) { - if (++sc->sc_sendad_success >= - CARP_SENDAD_MIN_SUCCESS) { - carp_demote_adj(-V_carp_senderr_adj, - "send ok"); - sc->sc_sendad_errors = 0; - } - } else - sc->sc_sendad_errors = 0; - } + carp_send_ad_error(sc, ip_output(m, NULL, NULL, IP_RAWOUTPUT, + &sc->sc_carpdev->if_carp->cif_imo, NULL)); } #endif /* INET */ #ifdef INET6 @@ -910,25 +922,8 @@ carp_send_ad_locked(struct carp_softc *s CARPSTATS_INC(carps_opackets6); - if (ip6_output(m, NULL, NULL, 0, - &sc->sc_carpdev->if_carp->cif_im6o, NULL, NULL)) { - if (sc->sc_sendad_errors < INT_MAX) - sc->sc_sendad_errors++; - if (sc->sc_sendad_errors == CARP_SENDAD_MAX_ERRORS) - carp_demote_adj(V_carp_senderr_adj, - "send6 error"); - sc->sc_sendad_success = 0; - } else { - if (sc->sc_sendad_errors >= CARP_SENDAD_MAX_ERRORS) { - if (++sc->sc_sendad_success >= - CARP_SENDAD_MIN_SUCCESS) { - carp_demote_adj(-V_carp_senderr_adj, - "send6 ok"); - sc->sc_sendad_errors = 0; - } - } else - sc->sc_sendad_errors = 0; - } + carp_send_ad_error(sc, ip6_output(m, NULL, NULL, 0, + &sc->sc_carpdev->if_carp->cif_im6o, NULL, NULL)); } #endif /* INET6 */ From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 4 11:17:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B4083F6E; Fri, 4 Apr 2014 11:17: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 9F675ED9; Fri, 4 Apr 2014 11:17: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 s34BHoFY046729; Fri, 4 Apr 2014 11:17:50 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34BHosS046726; Fri, 4 Apr 2014 11:17:50 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201404041117.s34BHosS046726@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 4 Apr 2014 11:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264112 - in stable/10/sys/dev/vt: . hw/vga X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 11:17:50 -0000 Author: ray Date: Fri Apr 4 11:17:49 2014 New Revision: 264112 URL: http://svnweb.freebsd.org/changeset/base/264112 Log: MFC r263885 o Add new vd_driver method to do bitblt with mask, named vd_maskbitbltchr. o Move vd_bitbltchr vga's driver method to vd_maskbitbltchr. o Implement new vd_bitbltchr method for vga driver. (It do single write for 8 pixels, have to be a bit faster). Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/vt/hw/vga/vga.c stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/hw/vga/vga.c ============================================================================== --- stable/10/sys/dev/vt/hw/vga/vga.c Fri Apr 4 10:33:59 2014 (r264111) +++ stable/10/sys/dev/vt/hw/vga/vga.c Fri Apr 4 11:17:49 2014 (r264112) @@ -74,6 +74,7 @@ struct vga_softc { static vd_init_t vga_init; static vd_blank_t vga_blank; static vd_bitbltchr_t vga_bitbltchr; +static vd_maskbitbltchr_t vga_maskbitbltchr; static vd_drawrect_t vga_drawrect; static vd_setpixel_t vga_setpixel; static vd_putchar_t vga_putchar; @@ -83,6 +84,7 @@ static const struct vt_driver vt_vga_dri .vd_init = vga_init, .vd_blank = vga_blank, .vd_bitbltchr = vga_bitbltchr, + .vd_maskbitbltchr = vga_maskbitbltchr, .vd_drawrect = vga_drawrect, .vd_setpixel = vga_setpixel, .vd_putchar = vga_putchar, @@ -204,6 +206,34 @@ vga_bitbltchr(struct vt_device *vd, cons int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, unsigned int height, term_color_t fg, term_color_t bg) { + u_long dst, ldst; + int w; + + /* Don't try to put off screen pixels */ + if (((left + width) > VT_VGA_WIDTH) || ((top + height) > + VT_VGA_HEIGHT)) + return; + + dst = (VT_VGA_WIDTH * top + left) / 8; + + for (; height > 0; height--) { + ldst = dst; + for (w = width; w > 0; w -= 8) { + vga_bitblt_put(vd, ldst, fg, *src); + vga_bitblt_put(vd, ldst, bg, ~*src); + ldst++; + src++; + } + dst += VT_VGA_WIDTH / 8; + } +} + +/* Bitblt with mask support. Slow. */ +static void +vga_maskbitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, + int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, + unsigned int height, term_color_t fg, term_color_t bg) +{ struct vga_softc *sc = vd->vd_softc; u_long dst; uint8_t shift; Modified: stable/10/sys/dev/vt/vt.h ============================================================================== --- stable/10/sys/dev/vt/vt.h Fri Apr 4 10:33:59 2014 (r264111) +++ stable/10/sys/dev/vt/vt.h Fri Apr 4 11:17:49 2014 (r264112) @@ -282,6 +282,9 @@ typedef void vd_blank_t(struct vt_device typedef void vd_bitbltchr_t(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, unsigned int height, term_color_t fg, term_color_t bg); +typedef void vd_maskbitbltchr_t(struct vt_device *vd, const uint8_t *src, + const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left, + unsigned int width, unsigned int height, term_color_t fg, term_color_t bg); typedef void vd_putchar_t(struct vt_device *vd, term_char_t, vt_axis_t top, vt_axis_t left, term_color_t fg, term_color_t bg); typedef int vd_fb_ioctl_t(struct vt_device *, u_long, caddr_t, struct thread *); @@ -298,6 +301,7 @@ struct vt_driver { /* Drawing. */ vd_blank_t *vd_blank; vd_bitbltchr_t *vd_bitbltchr; + vd_maskbitbltchr_t *vd_maskbitbltchr; vd_drawrect_t *vd_drawrect; vd_setpixel_t *vd_setpixel; Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Fri Apr 4 10:33:59 2014 (r264111) +++ stable/10/sys/dev/vt/vt_core.c Fri Apr 4 11:17:49 2014 (r264112) @@ -775,7 +775,7 @@ vt_flush(struct vt_device *vd) if ((vd->vd_my + m->h) > (size.tp_row * vf->vf_height)) h = (size.tp_row * vf->vf_height) - vd->vd_my - 1; - vd->vd_driver->vd_bitbltchr(vd, m->map, m->mask, bpl, + vd->vd_driver->vd_maskbitbltchr(vd, m->map, m->mask, bpl, vd->vd_offset.tp_row + vd->vd_my, vd->vd_offset.tp_col + vd->vd_mx, w, h, TC_WHITE, TC_BLACK); @@ -1930,6 +1930,8 @@ vt_allocate(struct vt_driver *drv, void printf("%s: Replace existing VT driver.\n", __func__); } vd = main_vd; + if (drv->vd_maskbitbltchr == NULL) + drv->vd_maskbitbltchr = drv->vd_bitbltchr; /* Stop vt_flush periodic task. */ if (vd->vd_curwindow != NULL) From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 4 14:18:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2591D6F3; Fri, 4 Apr 2014 14:18: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 EBC0A350; Fri, 4 Apr 2014 14: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 s34EIb7x022013; Fri, 4 Apr 2014 14:18:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34EIbwq022012; Fri, 4 Apr 2014 14:18:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404041418.s34EIbwq022012@svn.freebsd.org> From: Ed Maste Date: Fri, 4 Apr 2014 14:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264116 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 14:18:38 -0000 Author: emaste Date: Fri Apr 4 14:18:37 2014 New Revision: 264116 URL: http://svnweb.freebsd.org/changeset/base/264116 Log: MFC r261521 by antoine: Add files to remove WITHOUT_NIS PR: misc/186412 Sponsored by: The FreeBSD Foundation Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Apr 4 13:35:36 2014 (r264115) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Apr 4 14:18:37 2014 (r264116) @@ -3278,9 +3278,60 @@ OLD_FILES+=usr/bin/nc OLD_FILES+=usr/share/man/man1/nc.1.gz .endif -#.if ${MK_NIS} == no -# to be filled in -#.endif +.if ${MK_NIS} == no +OLD_FILES+=usr/bin/ypcat +OLD_FILES+=usr/bin/ypchfn +OLD_FILES+=usr/bin/ypchpass +OLD_FILES+=usr/bin/ypchsh +OLD_FILES+=usr/bin/ypmatch +OLD_FILES+=usr/bin/yppasswd +OLD_FILES+=usr/bin/ypwhich +OLD_FILES+=usr/include/ypclnt.h +OLD_FILES+=usr/lib/libypclnt.a +OLD_FILES+=usr/lib/libypclnt.so +OLD_LIBS+=usr/lib/libypclnt.so.4 +OLD_FILES+=usr/lib/libypclnt_p.a +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" +OLD_FILES+=usr/lib32/libypclnt.a +OLD_FILES+=usr/lib32/libypclnt.so +OLD_LIBS+=usr/lib32/libypclnt.so.4 +OLD_FILES+=usr/lib32/libypclnt_p.a +.endif +OLD_FILES+=usr/libexec/mknetid +OLD_FILES+=usr/libexec/yppwupdate +OLD_FILES+=usr/libexec/ypxfr +OLD_FILES+=usr/sbin/rpc.yppasswdd +OLD_FILES+=usr/sbin/rpc.ypupdated +OLD_FILES+=usr/sbin/rpc.ypxfrd +OLD_FILES+=usr/sbin/yp_mkdb +OLD_FILES+=usr/sbin/ypbind +OLD_FILES+=usr/sbin/ypinit +OLD_FILES+=usr/sbin/yppoll +OLD_FILES+=usr/sbin/yppush +OLD_FILES+=usr/sbin/ypserv +OLD_FILES+=usr/sbin/ypset +OLD_FILES+=usr/share/man/man1/ypcat.1.gz +OLD_FILES+=usr/share/man/man1/ypchfn.1.gz +OLD_FILES+=usr/share/man/man1/ypchpass.1.gz +OLD_FILES+=usr/share/man/man1/ypchsh.1.gz +OLD_FILES+=usr/share/man/man1/ypmatch.1.gz +OLD_FILES+=usr/share/man/man1/yppasswd.1.gz +OLD_FILES+=usr/share/man/man1/ypwhich.1.gz +OLD_FILES+=usr/share/man/man5/netid.5.gz +OLD_FILES+=usr/share/man/man8/mknetid.8.gz +OLD_FILES+=usr/share/man/man8/rpc.yppasswdd.8.gz +OLD_FILES+=usr/share/man/man8/rpc.ypxfrd.8.gz +OLD_FILES+=usr/share/man/man8/yp_mkdb.8.gz +OLD_FILES+=usr/share/man/man8/ypbind.8.gz +OLD_FILES+=usr/share/man/man8/ypinit.8.gz +OLD_FILES+=usr/share/man/man8/yppoll.8.gz +OLD_FILES+=usr/share/man/man8/yppush.8.gz +OLD_FILES+=usr/share/man/man8/ypserv.8.gz +OLD_FILES+=usr/share/man/man8/ypset.8.gz +OLD_FILES+=usr/share/man/man8/ypxfr.8.gz +OLD_FILES+=var/yp/Makefile +OLD_FILES+=var/yp/Makefile.dist +.endif #.if ${MK_NLS} == no # to be filled in From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 4 14:54:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 18C4B83B; Fri, 4 Apr 2014 14:54: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 02F60962; Fri, 4 Apr 2014 14:54: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 s34EstGR039681; Fri, 4 Apr 2014 14:54:55 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34EssAp039673; Fri, 4 Apr 2014 14:54:54 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201404041454.s34EssAp039673@svn.freebsd.org> From: Roger Pau Monné Date: Fri, 4 Apr 2014 14:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264118 - in stable/10/sys: amd64/amd64 amd64/include i386/i386 i386/include i386/xen x86/xen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 14:54:56 -0000 Author: royger Date: Fri Apr 4 14:54:54 2014 New Revision: 264118 URL: http://svnweb.freebsd.org/changeset/base/264118 Log: MFC r263001 Move asm IPIs handlers to C code, so both Xen and native IPI handlers share the same code. Approved by: gibbs Sponsored by: Citrix Systems R&D Modified: stable/10/sys/amd64/amd64/apic_vector.S stable/10/sys/amd64/amd64/mp_machdep.c stable/10/sys/amd64/include/smp.h stable/10/sys/i386/i386/apic_vector.s stable/10/sys/i386/i386/mp_machdep.c stable/10/sys/i386/include/smp.h stable/10/sys/i386/xen/mp_machdep.c stable/10/sys/x86/xen/hvm.c Modified: stable/10/sys/amd64/amd64/apic_vector.S ============================================================================== --- stable/10/sys/amd64/amd64/apic_vector.S Fri Apr 4 14:42:43 2014 (r264117) +++ stable/10/sys/amd64/amd64/apic_vector.S Fri Apr 4 14:54:54 2014 (r264118) @@ -159,101 +159,26 @@ IDTVEC(xen_intr_upcall) #define NAKE_INTR_CS 24 SUPERALIGN_TEXT -global_invltlb: - movq %cr4,%rax - andq $~0x80,%rax /* PGE */ - movq %rax,%cr4 - orq $0x80,%rax - movq %rax,%cr4 -invltlb_ret_clear_pm_save: - movq smp_tlb_pmap,%rdx - testq %rdx,%rdx - jz invltlb_ret_rdx - testb $SEL_RPL_MASK,NAKE_INTR_CS(%rsp) - jz 1f - swapgs -1: - movl PCPU(CPUID),%eax - jz 2f - swapgs -2: - LK btcl %eax,PM_SAVE(%rdx) - SUPERALIGN_TEXT -invltlb_ret_rdx: - popq %rdx -invltlb_ret_rax: +invltlb_ret: movq lapic, %rax movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ - LK incl smp_tlb_wait - popq %rax + POP_FRAME jmp doreti_iret SUPERALIGN_TEXT IDTVEC(invltlb_pcid) -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) PUSH_FRAME - movl PCPU(CPUID), %eax -#ifdef COUNT_XINVLTLB_HITS - incl xhits_gbl(,%rax,4) -#endif -#ifdef COUNT_IPIS - movq ipi_invltlb_counts(,%rax,8),%rax - incq (%rax) -#endif - POP_FRAME -#endif - - pushq %rax - pushq %rdx - movq %cr3,%rax + call invltlb_pcid_handler + jmp invltlb_ret - movq $smp_tlb_invpcid,%rdx - cmpl $0,(%rdx) - je global_invltlb - cmpl $-1,(%rdx) - je global_invltlb - - /* - * Only invalidate TLB for entries with current PCID. - */ - cmpl $0,invpcid_works - je 1f - /* Use invpcid if available. */ - movl $1,%eax /* INVPCID_CTX */ - /* invpcid (%rdx),%rax */ - .byte 0x66,0x0f,0x38,0x82,0x02 - jmp invltlb_ret_clear_pm_save -1: - /* Otherwise reload %cr3 twice. */ - movq pcid_cr3,%rdx - cmpq %rax,%rdx - je 2f - movq %rdx,%cr3 /* Invalidate, bit 63 is zero. */ - btsq $63,%rax -2: - movq %rax,%cr3 - jmp invltlb_ret_clear_pm_save SUPERALIGN_TEXT IDTVEC(invltlb) -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) PUSH_FRAME - movl PCPU(CPUID), %eax -#ifdef COUNT_XINVLTLB_HITS - incl xhits_gbl(,%rax,4) -#endif -#ifdef COUNT_IPIS - movq ipi_invltlb_counts(,%rax,8),%rax - incq (%rax) -#endif - POP_FRAME -#endif - pushq %rax - movq %cr3, %rax /* invalidate the TLB */ - movq %rax, %cr3 - jmp invltlb_ret_rax + call invltlb_handler + jmp invltlb_ret /* * Single page TLB shootdown @@ -261,86 +186,17 @@ IDTVEC(invltlb) .text SUPERALIGN_TEXT IDTVEC(invlpg_pcid) -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) PUSH_FRAME - movl PCPU(CPUID), %eax -#ifdef COUNT_XINVLTLB_HITS - incl xhits_pg(,%rax,4) -#endif -#ifdef COUNT_IPIS - movq ipi_invlpg_counts(,%rax,8),%rax - incq (%rax) -#endif - POP_FRAME -#endif - pushq %rax - pushq %rdx - movq $smp_tlb_invpcid,%rdx - cmpl $0,invpcid_works - jne 2f - - /* kernel pmap - use invlpg to invalidate global mapping */ - cmpl $0,(%rdx) - je 3f - cmpl $-1,(%rdx) - je global_invltlb - - /* - * PCID supported, but INVPCID is not. - * Temporarily switch to the target address space and do INVLPG. - */ - pushq %rcx - movq %cr3,%rcx - movq pcid_cr3,%rax - cmp %rcx,%rax - je 1f - btsq $63,%rax - movq %rax,%cr3 -1: movq 8(%rdx),%rax - invlpg (%rax) - btsq $63,%rcx - movq %rcx,%cr3 - popq %rcx - jmp invltlb_ret_rdx - - /* - * Invalidate the TLB entry using INVPCID_ADDR. - */ -2: - xorl %eax,%eax -/* invpcid (%rdx),%rax */ - .byte 0x66,0x0f,0x38,0x82,0x02 - jmp invltlb_ret_rdx - - /* - * PCID is not supported or kernel pmap. - * Invalidate single page using INVLPG. - */ -3: - movq 8(%rdx),%rax - invlpg (%rax) - jmp invltlb_ret_rdx + call invlpg_pcid_handler + jmp invltlb_ret SUPERALIGN_TEXT IDTVEC(invlpg) -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) PUSH_FRAME - movl PCPU(CPUID), %eax -#ifdef COUNT_XINVLTLB_HITS - incl xhits_pg(,%rax,4) -#endif -#ifdef COUNT_IPIS - movq ipi_invlpg_counts(,%rax,8),%rax - incq (%rax) -#endif - POP_FRAME -#endif - pushq %rax - movq smp_tlb_invpcid+8,%rax - invlpg (%rax) /* invalidate single page */ - jmp invltlb_ret_rax + call invlpg_handler + jmp invltlb_ret /* * Page range TLB shootdown. @@ -348,81 +204,10 @@ IDTVEC(invlpg) .text SUPERALIGN_TEXT IDTVEC(invlrng) -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) PUSH_FRAME - movl PCPU(CPUID), %eax -#ifdef COUNT_XINVLTLB_HITS - incl xhits_rng(,%rax,4) -#endif -#ifdef COUNT_IPIS - movq ipi_invlrng_counts(,%rax,8),%rax - incq (%rax) -#endif - POP_FRAME -#endif - pushq %rax - pushq %rdx - movq $smp_tlb_invpcid,%rdx - cmpl $0,pmap_pcid_enabled - je invlrng_single_page - - /* kernel pmap - use invlpg to invalidate global mapping */ - cmpl $0,(%rdx) - je invlrng_single_page - cmpl $-1,(%rdx) - je global_invltlb - cmpl $0,invpcid_works - jne invlrng_invpcid - - pushq %rcx - movq %cr3,%rcx - movq pcid_cr3,%rax - cmpq %rcx,%rax - je 1f - btsq $63,%rax - movq %rax,%cr3 -1: - movq 8(%rdx),%rdx - movq smp_tlb_addr2,%rax -2: - invlpg (%rdx) - addq $PAGE_SIZE,%rdx - cmpq %rax,%rdx - jb 2b - btsq $63,%rcx - movq %rcx,%cr3 - popq %rcx - jmp invltlb_ret_rdx - -invlrng_invpcid: - pushq %rcx - subq $16,%rsp - movq (%rdx),%rcx - movq %rcx,(%rsp) - movq 8(%rdx),%rax - movq %rax,8(%rsp) - movq smp_tlb_addr2,%rcx - subq %rax,%rcx - shrq $PAGE_SHIFT,%rcx -1: -// invpcid (%rdx),%rax - .byte 0x66,0x0f,0x38,0x82,0x02 - addq $PAGE_SIZE,8(%rsp) - dec %rcx - jne 1b - addq $16,%rsp - popq %rcx - jmp invltlb_ret_rdx - -invlrng_single_page: - movq 8(%rdx),%rdx - movq smp_tlb_addr2,%rax -1: invlpg (%rdx) /* invalidate single page */ - addq $PAGE_SIZE,%rdx - cmpq %rax,%rdx - jb 1b - jmp invltlb_ret_rdx + call invlrng_handler + jmp invltlb_ret /* * Invalidate cache. @@ -430,17 +215,10 @@ invlrng_single_page: .text SUPERALIGN_TEXT IDTVEC(invlcache) -#ifdef COUNT_IPIS PUSH_FRAME - movl PCPU(CPUID), %eax - movq ipi_invlcache_counts(,%rax,8),%rax - incq (%rax) - POP_FRAME -#endif - pushq %rax - wbinvd - jmp invltlb_ret_rax + call invlcache_handler + jmp invltlb_ret /* * Handler for IPIs sent via the per-cpu IPI bitmap. Modified: stable/10/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_machdep.c Fri Apr 4 14:42:43 2014 (r264117) +++ stable/10/sys/amd64/amd64/mp_machdep.c Fri Apr 4 14:54:54 2014 (r264118) @@ -109,6 +109,7 @@ struct invpcid_descr smp_tlb_invpcid; volatile int smp_tlb_wait; uint64_t pcid_cr3; pmap_t smp_tlb_pmap; +extern int invpcid_works; #ifdef COUNT_IPIS /* Interrupt counts. */ @@ -1496,6 +1497,175 @@ cpususpend_handler(void) } /* + * Handlers for TLB related IPIs + */ +void +invltlb_handler(void) +{ +#ifdef COUNT_XINVLTLB_HITS + xhits_gbl[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + invltlb(); + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invltlb_pcid_handler(void) +{ + uint64_t cr3; +#ifdef COUNT_XINVLTLB_HITS + xhits_gbl[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + cr3 = rcr3(); + if (smp_tlb_invpcid.pcid != (uint64_t)-1 && + smp_tlb_invpcid.pcid != 0) { + + if (invpcid_works) { + invpcid(&smp_tlb_invpcid, INVPCID_CTX); + } else { + /* Otherwise reload %cr3 twice. */ + if (cr3 != pcid_cr3) { + load_cr3(pcid_cr3); + cr3 |= CR3_PCID_SAVE; + } + load_cr3(cr3); + } + } else { + invltlb_globpcid(); + } + if (smp_tlb_pmap != NULL) + CPU_CLR_ATOMIC(PCPU_GET(cpuid), &smp_tlb_pmap->pm_save); + + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlpg_handler(void) +{ +#ifdef COUNT_XINVLTLB_HITS + xhits_pg[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + invlpg(smp_tlb_invpcid.addr); + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlpg_pcid_handler(void) +{ +#ifdef COUNT_XINVLTLB_HITS + xhits_pg[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + if (invpcid_works) { + invpcid(&smp_tlb_invpcid, INVPCID_ADDR); + } else if (smp_tlb_invpcid.pcid == 0) { + invlpg(smp_tlb_invpcid.addr); + } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { + invltlb_globpcid(); + } else { + uint64_t cr3; + + /* + * PCID supported, but INVPCID is not. + * Temporarily switch to the target address + * space and do INVLPG. + */ + cr3 = rcr3(); + if (cr3 != pcid_cr3) + load_cr3(pcid_cr3 | CR3_PCID_SAVE); + invlpg(smp_tlb_invpcid.addr); + load_cr3(cr3 | CR3_PCID_SAVE); + } + + atomic_add_int(&smp_tlb_wait, 1); +} + +static inline void +invlpg_range(vm_offset_t start, vm_offset_t end) +{ + + do { + invlpg(start); + start += PAGE_SIZE; + } while (start < end); +} + +void +invlrng_handler(void) +{ + vm_offset_t addr; +#ifdef COUNT_XINVLTLB_HITS + xhits_rng[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invlrng_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + addr = smp_tlb_invpcid.addr; + if (pmap_pcid_enabled) { + if (invpcid_works) { + struct invpcid_descr d; + + d = smp_tlb_invpcid; + do { + invpcid(&d, INVPCID_ADDR); + d.addr += PAGE_SIZE; + } while (d.addr < smp_tlb_addr2); + } else if (smp_tlb_invpcid.pcid == 0) { + /* + * kernel pmap - use invlpg to invalidate + * global mapping. + */ + invlpg_range(addr, smp_tlb_addr2); + } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { + invltlb_globpcid(); + if (smp_tlb_pmap != NULL) { + CPU_CLR_ATOMIC(PCPU_GET(cpuid), + &smp_tlb_pmap->pm_save); + } + } else { + uint64_t cr3; + + cr3 = rcr3(); + if (cr3 != pcid_cr3) + load_cr3(pcid_cr3 | CR3_PCID_SAVE); + invlpg_range(addr, smp_tlb_addr2); + load_cr3(cr3 | CR3_PCID_SAVE); + } + } else { + invlpg_range(addr, smp_tlb_addr2); + } + + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlcache_handler(void) +{ +#ifdef COUNT_IPIS + (*ipi_invlcache_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + wbinvd(); + atomic_add_int(&smp_tlb_wait, 1); +} + +/* * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. */ Modified: stable/10/sys/amd64/include/smp.h ============================================================================== --- stable/10/sys/amd64/include/smp.h Fri Apr 4 14:42:43 2014 (r264117) +++ stable/10/sys/amd64/include/smp.h Fri Apr 4 14:54:54 2014 (r264118) @@ -62,6 +62,12 @@ struct pmap; void cpu_add(u_int apic_id, char boot_cpu); void cpustop_handler(void); void cpususpend_handler(void); +void invltlb_handler(void); +void invltlb_pcid_handler(void); +void invlpg_handler(void); +void invlpg_pcid_handler(void); +void invlrng_handler(void); +void invlcache_handler(void); void init_secondary(void); void ipi_startup(int apic_id, int vector); void ipi_all_but_self(u_int ipi); Modified: stable/10/sys/i386/i386/apic_vector.s ============================================================================== --- stable/10/sys/i386/i386/apic_vector.s Fri Apr 4 14:42:43 2014 (r264117) +++ stable/10/sys/i386/i386/apic_vector.s Fri Apr 4 14:54:54 2014 (r264118) @@ -163,39 +163,21 @@ IDTVEC(xen_intr_upcall) */ .text SUPERALIGN_TEXT -IDTVEC(invltlb) - pushl %eax - pushl %ds - movl $KDSEL, %eax /* Kernel data selector */ - movl %eax, %ds - -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - pushl %fs - movl $KPSEL, %eax /* Private space selector */ - movl %eax, %fs - movl PCPU(CPUID), %eax - popl %fs -#ifdef COUNT_XINVLTLB_HITS - incl xhits_gbl(,%eax,4) -#endif -#ifdef COUNT_IPIS - movl ipi_invltlb_counts(,%eax,4),%eax - incl (%eax) -#endif -#endif - - movl %cr3, %eax /* invalidate the TLB */ - movl %eax, %cr3 - +invltlb_ret: movl lapic, %eax movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + POP_FRAME + iret + + SUPERALIGN_TEXT +IDTVEC(invltlb) + PUSH_FRAME + SET_KERNEL_SREGS + cld - lock - incl smp_tlb_wait + call invltlb_handler - popl %ds - popl %eax - iret + jmp invltlb_ret /* * Single page TLB shootdown @@ -203,38 +185,13 @@ IDTVEC(invltlb) .text SUPERALIGN_TEXT IDTVEC(invlpg) - pushl %eax - pushl %ds - movl $KDSEL, %eax /* Kernel data selector */ - movl %eax, %ds - -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - pushl %fs - movl $KPSEL, %eax /* Private space selector */ - movl %eax, %fs - movl PCPU(CPUID), %eax - popl %fs -#ifdef COUNT_XINVLTLB_HITS - incl xhits_pg(,%eax,4) -#endif -#ifdef COUNT_IPIS - movl ipi_invlpg_counts(,%eax,4),%eax - incl (%eax) -#endif -#endif - - movl smp_tlb_addr1, %eax - invlpg (%eax) /* invalidate single page */ - - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + PUSH_FRAME + SET_KERNEL_SREGS + cld - lock - incl smp_tlb_wait + call invlpg_handler - popl %ds - popl %eax - iret + jmp invltlb_ret /* * Page range TLB shootdown. @@ -242,44 +199,13 @@ IDTVEC(invlpg) .text SUPERALIGN_TEXT IDTVEC(invlrng) - pushl %eax - pushl %edx - pushl %ds - movl $KDSEL, %eax /* Kernel data selector */ - movl %eax, %ds - -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - pushl %fs - movl $KPSEL, %eax /* Private space selector */ - movl %eax, %fs - movl PCPU(CPUID), %eax - popl %fs -#ifdef COUNT_XINVLTLB_HITS - incl xhits_rng(,%eax,4) -#endif -#ifdef COUNT_IPIS - movl ipi_invlrng_counts(,%eax,4),%eax - incl (%eax) -#endif -#endif + PUSH_FRAME + SET_KERNEL_SREGS + cld - movl smp_tlb_addr1, %edx - movl smp_tlb_addr2, %eax -1: invlpg (%edx) /* invalidate single page */ - addl $PAGE_SIZE, %edx - cmpl %eax, %edx - jb 1b + call invlrng_handler - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ - - lock - incl smp_tlb_wait - - popl %ds - popl %edx - popl %eax - iret + jmp invltlb_ret /* * Invalidate cache. @@ -287,32 +213,13 @@ IDTVEC(invlrng) .text SUPERALIGN_TEXT IDTVEC(invlcache) - pushl %eax - pushl %ds - movl $KDSEL, %eax /* Kernel data selector */ - movl %eax, %ds - -#ifdef COUNT_IPIS - pushl %fs - movl $KPSEL, %eax /* Private space selector */ - movl %eax, %fs - movl PCPU(CPUID), %eax - popl %fs - movl ipi_invlcache_counts(,%eax,4),%eax - incl (%eax) -#endif - - wbinvd - - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + PUSH_FRAME + SET_KERNEL_SREGS + cld - lock - incl smp_tlb_wait + call invlcache_handler - popl %ds - popl %eax - iret + jmp invltlb_ret /* * Handler for IPIs sent via the per-cpu IPI bitmap. Modified: stable/10/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/10/sys/i386/i386/mp_machdep.c Fri Apr 4 14:42:43 2014 (r264117) +++ stable/10/sys/i386/i386/mp_machdep.c Fri Apr 4 14:54:54 2014 (r264118) @@ -1551,6 +1551,72 @@ cpususpend_handler(void) CPU_CLR_ATOMIC(cpu, &suspended_cpus); CPU_CLR_ATOMIC(cpu, &started_cpus); } + +/* + * Handlers for TLB related IPIs + */ +void +invltlb_handler(void) +{ + uint64_t cr3; +#ifdef COUNT_XINVLTLB_HITS + xhits_gbl[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + cr3 = rcr3(); + load_cr3(cr3); + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlpg_handler(void) +{ +#ifdef COUNT_XINVLTLB_HITS + xhits_pg[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + invlpg(smp_tlb_addr1); + + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlrng_handler(void) +{ + vm_offset_t addr; +#ifdef COUNT_XINVLTLB_HITS + xhits_rng[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invlrng_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + addr = smp_tlb_addr1; + do { + invlpg(addr); + addr += PAGE_SIZE; + } while (addr < smp_tlb_addr2); + + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlcache_handler(void) +{ +#ifdef COUNT_IPIS + (*ipi_invlcache_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + wbinvd(); + atomic_add_int(&smp_tlb_wait, 1); +} + /* * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. Modified: stable/10/sys/i386/include/smp.h ============================================================================== --- stable/10/sys/i386/include/smp.h Fri Apr 4 14:42:43 2014 (r264117) +++ stable/10/sys/i386/include/smp.h Fri Apr 4 14:54:54 2014 (r264118) @@ -63,6 +63,10 @@ void cpustop_handler(void); #ifndef XEN void cpususpend_handler(void); #endif +void invltlb_handler(void); +void invlpg_handler(void); +void invlrng_handler(void); +void invlcache_handler(void); void init_secondary(void); void ipi_startup(int apic_id, int vector); void ipi_all_but_self(u_int ipi); Modified: stable/10/sys/i386/xen/mp_machdep.c ============================================================================== --- stable/10/sys/i386/xen/mp_machdep.c Fri Apr 4 14:42:43 2014 (r264117) +++ stable/10/sys/i386/xen/mp_machdep.c Fri Apr 4 14:54:54 2014 (r264118) @@ -1276,6 +1276,31 @@ cpustop_handler(void) } /* + * Handlers for TLB related IPIs + * + * On i386 Xen PV this are no-ops since this port doesn't support SMP. + */ +void +invltlb_handler(void) +{ +} + +void +invlpg_handler(void) +{ +} + +void +invlrng_handler(void) +{ +} + +void +invlcache_handler(void) +{ +} + +/* * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. */ Modified: stable/10/sys/x86/xen/hvm.c ============================================================================== --- stable/10/sys/x86/xen/hvm.c Fri Apr 4 14:42:43 2014 (r264117) +++ stable/10/sys/x86/xen/hvm.c Fri Apr 4 14:54:54 2014 (r264118) @@ -77,22 +77,12 @@ static void xen_hvm_cpu_resume(void); static void xen_hvm_cpu_init(void); /*---------------------------- Extern Declarations ---------------------------*/ -/* Variables used by mp_machdep to perform the MMU related IPIs */ -extern volatile int smp_tlb_wait; -extern vm_offset_t smp_tlb_addr2; -#ifdef __i386__ -extern vm_offset_t smp_tlb_addr1; -#else -extern struct invpcid_descr smp_tlb_invpcid; -extern uint64_t pcid_cr3; -extern int invpcid_works; -extern int pmap_pcid_enabled; -extern pmap_t smp_tlb_pmap; -#endif - #ifdef __i386__ extern void pmap_lazyfix_action(void); #endif +#ifdef __amd64__ +extern int pmap_pcid_enabled; +#endif /* Variables used by mp_machdep to perform the bitmap IPI */ extern volatile u_int cpu_ipi_pending[MAXCPU]; @@ -179,10 +169,7 @@ static int xen_smp_rendezvous_action(void *arg) { #ifdef COUNT_IPIS - int cpu; - - cpu = PCPU_GET(cpuid); - (*ipi_rendezvous_counts[cpu])++; + (*ipi_rendezvous_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ smp_rendezvous_action(); @@ -192,20 +179,8 @@ xen_smp_rendezvous_action(void *arg) static int xen_invltlb(void *arg) { -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - int cpu; - - cpu = PCPU_GET(cpuid); -#ifdef COUNT_XINVLTLB_HITS - xhits_gbl[cpu]++; -#endif /* COUNT_XINVLTLB_HITS */ -#ifdef COUNT_IPIS - (*ipi_invltlb_counts[cpu])++; -#endif /* COUNT_IPIS */ -#endif /* COUNT_XINVLTLB_HITS || COUNT_IPIS */ - invltlb(); - atomic_add_int(&smp_tlb_wait, 1); + invltlb_handler(); return (FILTER_HANDLED); } @@ -213,40 +188,8 @@ xen_invltlb(void *arg) static int xen_invltlb_pcid(void *arg) { - uint64_t cr3; -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - int cpu; - - cpu = PCPU_GET(cpuid); -#ifdef COUNT_XINVLTLB_HITS - xhits_gbl[cpu]++; -#endif /* COUNT_XINVLTLB_HITS */ -#ifdef COUNT_IPIS - (*ipi_invltlb_counts[cpu])++; -#endif /* COUNT_IPIS */ -#endif /* COUNT_XINVLTLB_HITS || COUNT_IPIS */ - cr3 = rcr3(); - if (smp_tlb_invpcid.pcid != (uint64_t)-1 && - smp_tlb_invpcid.pcid != 0) { - - if (invpcid_works) { - invpcid(&smp_tlb_invpcid, INVPCID_CTX); - } else { - /* Otherwise reload %cr3 twice. */ - if (cr3 != pcid_cr3) { - load_cr3(pcid_cr3); - cr3 |= CR3_PCID_SAVE; - } - load_cr3(cr3); - } - } else { - invltlb_globpcid(); - } - if (smp_tlb_pmap != NULL) - CPU_CLR_ATOMIC(PCPU_GET(cpuid), &smp_tlb_pmap->pm_save); - - atomic_add_int(&smp_tlb_wait, 1); + invltlb_pcid_handler(); return (FILTER_HANDLED); } #endif @@ -254,24 +197,8 @@ xen_invltlb_pcid(void *arg) static int xen_invlpg(void *arg) { -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - int cpu; - - cpu = PCPU_GET(cpuid); -#ifdef COUNT_XINVLTLB_HITS - xhits_pg[cpu]++; -#endif /* COUNT_XINVLTLB_HITS */ -#ifdef COUNT_IPIS - (*ipi_invlpg_counts[cpu])++; -#endif /* COUNT_IPIS */ -#endif /* COUNT_XINVLTLB_HITS || COUNT_IPIS */ -#ifdef __i386__ - invlpg(smp_tlb_addr1); -#else - invlpg(smp_tlb_invpcid.addr); -#endif - atomic_add_int(&smp_tlb_wait, 1); + invlpg_handler(); return (FILTER_HANDLED); } @@ -279,125 +206,25 @@ xen_invlpg(void *arg) static int xen_invlpg_pcid(void *arg) { -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - int cpu; - - cpu = PCPU_GET(cpuid); -#ifdef COUNT_XINVLTLB_HITS - xhits_pg[cpu]++; -#endif /* COUNT_XINVLTLB_HITS */ -#ifdef COUNT_IPIS - (*ipi_invlpg_counts[cpu])++; -#endif /* COUNT_IPIS */ -#endif /* COUNT_XINVLTLB_HITS || COUNT_IPIS */ - - if (invpcid_works) { - invpcid(&smp_tlb_invpcid, INVPCID_ADDR); - } else if (smp_tlb_invpcid.pcid == 0) { - invlpg(smp_tlb_invpcid.addr); - } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { - invltlb_globpcid(); - } else { - uint64_t cr3; - - /* - * PCID supported, but INVPCID is not. - * Temporarily switch to the target address - * space and do INVLPG. - */ - cr3 = rcr3(); - if (cr3 != pcid_cr3) - load_cr3(pcid_cr3 | CR3_PCID_SAVE); - invlpg(smp_tlb_invpcid.addr); - load_cr3(cr3 | CR3_PCID_SAVE); - } - atomic_add_int(&smp_tlb_wait, 1); + invlpg_pcid_handler(); return (FILTER_HANDLED); } #endif -static inline void -invlpg_range(vm_offset_t start, vm_offset_t end) -{ - do { - invlpg(start); - start += PAGE_SIZE; - } while (start < end); -} - static int xen_invlrng(void *arg) { - vm_offset_t addr; -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 4 19:17:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 825E02C9; Fri, 4 Apr 2014 19:17: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 6EC1E6E9; Fri, 4 Apr 2014 19:17: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 s34JHYkD048022; Fri, 4 Apr 2014 19:17:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34JHYeL048020; Fri, 4 Apr 2014 19:17:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404041917.s34JHYeL048020@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 4 Apr 2014 19:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264134 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 19:17:34 -0000 Author: kib Date: Fri Apr 4 19:17:33 2014 New Revision: 264134 URL: http://svnweb.freebsd.org/changeset/base/264134 Log: MFC r263878: Several fixes for the PCID implementation. Modified: stable/10/sys/amd64/amd64/mp_machdep.c stable/10/sys/amd64/amd64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_machdep.c Fri Apr 4 18:10:11 2014 (r264133) +++ stable/10/sys/amd64/amd64/mp_machdep.c Fri Apr 4 19:17:33 2014 (r264134) @@ -1257,7 +1257,7 @@ smp_masked_invltlb(cpuset_t mask, pmap_t { if (smp_started) { - smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, NULL, 0, 0); + smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, pmap, 0, 0); #ifdef COUNT_XINVLTLB_HITS ipi_masked_global++; #endif @@ -1517,6 +1517,7 @@ void invltlb_pcid_handler(void) { uint64_t cr3; + u_int cpuid; #ifdef COUNT_XINVLTLB_HITS xhits_gbl[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -1524,14 +1525,13 @@ invltlb_pcid_handler(void) (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ - cr3 = rcr3(); if (smp_tlb_invpcid.pcid != (uint64_t)-1 && smp_tlb_invpcid.pcid != 0) { - if (invpcid_works) { invpcid(&smp_tlb_invpcid, INVPCID_CTX); } else { /* Otherwise reload %cr3 twice. */ + cr3 = rcr3(); if (cr3 != pcid_cr3) { load_cr3(pcid_cr3); cr3 |= CR3_PCID_SAVE; @@ -1541,8 +1541,11 @@ invltlb_pcid_handler(void) } else { invltlb_globpcid(); } - if (smp_tlb_pmap != NULL) - CPU_CLR_ATOMIC(PCPU_GET(cpuid), &smp_tlb_pmap->pm_save); + if (smp_tlb_pmap != NULL) { + cpuid = PCPU_GET(cpuid); + if (!CPU_ISSET(cpuid, &smp_tlb_pmap->pm_active)) + CPU_CLR_ATOMIC(cpuid, &smp_tlb_pmap->pm_save); + } atomic_add_int(&smp_tlb_wait, 1); } @@ -1608,7 +1611,10 @@ invlpg_range(vm_offset_t start, vm_offse void invlrng_handler(void) { + struct invpcid_descr d; vm_offset_t addr; + uint64_t cr3; + u_int cpuid; #ifdef COUNT_XINVLTLB_HITS xhits_rng[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -1618,15 +1624,7 @@ invlrng_handler(void) addr = smp_tlb_invpcid.addr; if (pmap_pcid_enabled) { - if (invpcid_works) { - struct invpcid_descr d; - - d = smp_tlb_invpcid; - do { - invpcid(&d, INVPCID_ADDR); - d.addr += PAGE_SIZE; - } while (d.addr < smp_tlb_addr2); - } else if (smp_tlb_invpcid.pcid == 0) { + if (smp_tlb_invpcid.pcid == 0) { /* * kernel pmap - use invlpg to invalidate * global mapping. @@ -1635,12 +1633,18 @@ invlrng_handler(void) } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { invltlb_globpcid(); if (smp_tlb_pmap != NULL) { - CPU_CLR_ATOMIC(PCPU_GET(cpuid), - &smp_tlb_pmap->pm_save); + cpuid = PCPU_GET(cpuid); + if (!CPU_ISSET(cpuid, &smp_tlb_pmap->pm_active)) + CPU_CLR_ATOMIC(cpuid, + &smp_tlb_pmap->pm_save); } + } else if (invpcid_works) { + d = smp_tlb_invpcid; + do { + invpcid(&d, INVPCID_ADDR); + d.addr += PAGE_SIZE; + } while (d.addr <= smp_tlb_addr2); } else { - uint64_t cr3; - cr3 = rcr3(); if (cr3 != pcid_cr3) load_cr3(pcid_cr3 | CR3_PCID_SAVE); Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Fri Apr 4 18:10:11 2014 (r264133) +++ stable/10/sys/amd64/amd64/pmap.c Fri Apr 4 19:17:33 2014 (r264134) @@ -838,7 +838,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) kernel_pmap->pm_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(KPML4phys); kernel_pmap->pm_cr3 = KPML4phys; CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */ - CPU_ZERO(&kernel_pmap->pm_save); + CPU_FILL(&kernel_pmap->pm_save); /* always superset of pm_active */ TAILQ_INIT(&kernel_pmap->pm_pvchunk); kernel_pmap->pm_flags = pmap_flags; @@ -1492,7 +1492,8 @@ pmap_invalidate_all(pmap_t pmap) } else { invltlb_globpcid(); } - CPU_CLR_ATOMIC(cpuid, &pmap->pm_save); + if (!CPU_ISSET(cpuid, &pmap->pm_active)) + CPU_CLR_ATOMIC(cpuid, &pmap->pm_save); smp_invltlb(pmap); } else { other_cpus = all_cpus; @@ -1526,7 +1527,8 @@ pmap_invalidate_all(pmap_t pmap) } } else if (CPU_ISSET(cpuid, &pmap->pm_active)) invltlb(); - CPU_CLR_ATOMIC(cpuid, &pmap->pm_save); + if (!CPU_ISSET(cpuid, &pmap->pm_active)) + CPU_CLR_ATOMIC(cpuid, &pmap->pm_save); if (pmap_pcid_enabled) CPU_AND(&other_cpus, &pmap->pm_save); else From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 4 21:35:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5DFC1D16; Fri, 4 Apr 2014 21:35: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 4AA35405; Fri, 4 Apr 2014 21:35: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 s34LZIb3007117; Fri, 4 Apr 2014 21:35:18 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34LZIhA007116; Fri, 4 Apr 2014 21:35:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404042135.s34LZIhA007116@svn.freebsd.org> From: Glen Barber Date: Fri, 4 Apr 2014 21:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264140 - stable/10/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 21:35:18 -0000 Author: gjb Date: Fri Apr 4 21:35:17 2014 New Revision: 264140 URL: http://svnweb.freebsd.org/changeset/base/264140 Log: Document a potential panic or hang when using sas2flash to update firmware on mps(4) LSI controllers. Submitted by: smh Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Fri Apr 4 21:09:06 2014 (r264139) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Fri Apr 4 21:35:17 2014 (r264140) @@ -243,6 +243,16 @@ boot it from mounting any UDF file system. This has been fixed in &os;-CURRENT and &os; &release.current;. + + + Updating LSI firmware on &man.mps.4; controllers with + the sas2flash utility may cause + the system to hang, or may cause the sytem to panic. This + is fixed in the stable/10 branch with + revisions r262553 and + r262575, and will be included in + &os; 10.1-RELEASE. + From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 5 14:24:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 17A6855E; Sat, 5 Apr 2014 14: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 02F02607; Sat, 5 Apr 2014 14: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 s35EOTVf021479; Sat, 5 Apr 2014 14:24:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35EOTr3021476; Sat, 5 Apr 2014 14:24:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404051424.s35EOTr3021476@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 Apr 2014 14:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264147 - in stable/10/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 14:24:30 -0000 Author: kib Date: Sat Apr 5 14:24:29 2014 New Revision: 264147 URL: http://svnweb.freebsd.org/changeset/base/264147 Log: MFC r263912: Clear the kernel grab of the FPU state on fork. Modified: stable/10/sys/amd64/amd64/vm_machdep.c stable/10/sys/i386/i386/vm_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/vm_machdep.c Sat Apr 5 14:09:16 2014 (r264146) +++ stable/10/sys/amd64/amd64/vm_machdep.c Sat Apr 5 14:24:29 2014 (r264147) @@ -446,7 +446,8 @@ cpu_set_upcall(struct thread *td, struct * values here. */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE); + clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE | + PCB_KERNFPU); pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, cpu_max_ext_state_size); Modified: stable/10/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/10/sys/i386/i386/vm_machdep.c Sat Apr 5 14:09:16 2014 (r264146) +++ stable/10/sys/i386/i386/vm_machdep.c Sat Apr 5 14:24:29 2014 (r264147) @@ -457,7 +457,8 @@ cpu_set_upcall(struct thread *td, struct * values here. */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE); + pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE | + PCB_KERNNPX); pcb2->pcb_save = &pcb2->pcb_user_save; /* From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 5 19:43:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 53E0679C; Sat, 5 Apr 2014 19:43: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 26A406E8; Sat, 5 Apr 2014 19:43: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 s35Jhlg7052762; Sat, 5 Apr 2014 19:43:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35JhlpX052761; Sat, 5 Apr 2014 19:43:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404051943.s35JhlpX052761@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 5 Apr 2014 19:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264166 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 19:43:48 -0000 Author: jilles Date: Sat Apr 5 19:43:47 2014 New Revision: 264166 URL: http://svnweb.freebsd.org/changeset/base/264166 Log: MFC r262755: sh: Make argstr() return where it stopped and simplify expari() using this. Modified: stable/10/bin/sh/expand.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Sat Apr 5 19:08:16 2014 (r264165) +++ stable/10/bin/sh/expand.c Sat Apr 5 19:43:47 2014 (r264166) @@ -98,7 +98,7 @@ static struct ifsregion ifsfirst; /* fir static struct ifsregion *ifslastp; /* last struct in list */ static struct arglist exparg; /* holds expanded arg list */ -static void argstr(char *, int); +static char *argstr(char *, int); static char *exptilde(char *, int); static char *expari(char *); static void expbackq(union node *, int, int); @@ -213,7 +213,7 @@ expandarg(union node *arg, struct arglis * characters to allow for further processing. * If EXP_FULL is set, also preserve CTLQUOTEMARK characters. */ -static void +static char * argstr(char *p, int flag) { char c; @@ -231,9 +231,10 @@ argstr(char *p, int flag) CHECKSTRSPACE(2, expdest); switch (c = *p++) { case '\0': + return (p - 1); case CTLENDVAR: case CTLENDARI: - goto breakloop; + return (p); case CTLQUOTEMARK: lit_quoted = 1; /* "$@" syntax adherence hack */ @@ -290,7 +291,6 @@ argstr(char *p, int flag) expdest - stackblock(), 0); } } -breakloop:; } /* @@ -399,13 +399,11 @@ expari(char *p) arith_t result; int begoff; int quoted; - int c; - int nesting; int adj; quoted = *p++ == '"'; begoff = expdest - stackblock(); - argstr(p, 0); + p = argstr(p, 0); removerecordregions(begoff); STPUTC('\0', expdest); start = stackblock() + begoff; @@ -424,20 +422,6 @@ expari(char *p) STADJUST(adj, expdest); if (!quoted) recordregion(begoff, expdest - stackblock(), 0); - nesting = 1; - while (nesting > 0) { - c = *p++; - if (c == CTLESC) - p++; - else if (c == CTLARI) - nesting++; - else if (c == CTLENDARI) - nesting--; - else if (c == CTLVAR) - p++; /* ignore variable substitution byte */ - else if (c == '\0') - return p - 1; - } return p; } From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 5 20:01:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 13F25D15; Sat, 5 Apr 2014 20:01: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 E9A17852; Sat, 5 Apr 2014 20:01:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35K18CN058719; Sat, 5 Apr 2014 20:01:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35K18Wh058715; Sat, 5 Apr 2014 20:01:08 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404052001.s35K18Wh058715@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 5 Apr 2014 20:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264168 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 20:01:09 -0000 Author: jilles Date: Sat Apr 5 20:01:08 2014 New Revision: 264168 URL: http://svnweb.freebsd.org/changeset/base/264168 Log: MFC r263195: sh: Add some consts. Modified: stable/10/bin/sh/expand.c stable/10/bin/sh/jobs.c stable/10/bin/sh/redir.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Sat Apr 5 19:48:19 2014 (r264167) +++ stable/10/bin/sh/expand.c Sat Apr 5 20:01:08 2014 (r264168) @@ -104,8 +104,8 @@ static char *expari(char *); static void expbackq(union node *, int, int); static int subevalvar(char *, char *, int, int, int, int, int); static char *evalvar(char *, int); -static int varisset(char *, int); -static void varvalue(char *, int, int, int); +static int varisset(const char *, int); +static void varvalue(const char *, int, int, int); static void recordregion(int, int, int); static void removerecordregions(int); static void ifsbreakup(char *, struct arglist *); @@ -633,7 +633,7 @@ evalvar(char *p, int flag) int subtype; int varflags; char *var; - char *val; + const char *val; int patloc; int c; int set; @@ -827,7 +827,7 @@ record: */ static int -varisset(char *name, int nulok) +varisset(const char *name, int nulok) { if (*name == '!') @@ -876,7 +876,7 @@ strtodest(const char *p, int flag, int s */ static void -varvalue(char *name, int quoted, int subtype, int flag) +varvalue(const char *name, int quoted, int subtype, int flag) { int num; char *p; Modified: stable/10/bin/sh/jobs.c ============================================================================== --- stable/10/bin/sh/jobs.c Sat Apr 5 19:48:19 2014 (r264167) +++ stable/10/bin/sh/jobs.c Sat Apr 5 20:01:08 2014 (r264168) @@ -95,9 +95,9 @@ static void restartjob(struct job *); #endif static void freejob(struct job *); static int waitcmdloop(struct job *); -static struct job *getjob_nonotfound(char *); -static struct job *getjob(char *); pid_t getjobpgrp(char *); +static struct job *getjob_nonotfound(const char *); +static struct job *getjob(const char *); static pid_t dowait(int, struct job *); static void checkzombies(void); static void cmdtxt(union node *); @@ -558,7 +558,7 @@ jobidcmd(int argc __unused, char **argv */ static struct job * -getjob_nonotfound(char *name) +getjob_nonotfound(const char *name) { int jobno; struct job *found, *jp; @@ -628,7 +628,7 @@ currentjob: if ((jp = getcurjob(NULL)) = static struct job * -getjob(char *name) +getjob(const char *name) { struct job *jp; Modified: stable/10/bin/sh/redir.c ============================================================================== --- stable/10/bin/sh/redir.c Sat Apr 5 19:48:19 2014 (r264167) +++ stable/10/bin/sh/redir.c Sat Apr 5 20:01:08 2014 (r264168) @@ -152,7 +152,7 @@ openredirect(union node *redir, char mem { struct stat sb; int fd = redir->nfile.fd; - char *fname; + const char *fname; int f; int e; @@ -250,7 +250,7 @@ movefd: static int openhere(union node *redir) { - char *p; + const char *p; int pip[2]; size_t len = 0; int flags; From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 5 20:05:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B7CA5F59; Sat, 5 Apr 2014 20:05: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 A3DA28EC; Sat, 5 Apr 2014 20:05: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 s35K5ou0061504; Sat, 5 Apr 2014 20:05:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35K5ojY061503; Sat, 5 Apr 2014 20:05:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404052005.s35K5ojY061503@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 5 Apr 2014 20:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264169 - stable/10/usr.bin/find X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 20:05:50 -0000 Author: jilles Date: Sat Apr 5 20:05:50 2014 New Revision: 264169 URL: http://svnweb.freebsd.org/changeset/base/264169 Log: MFC r263244: find: When performing -quit, finish pending -exec ... + command lines. This avoids unexpected partial processing when a find command uses both -quit and -exec ... +. GNU find does the same. Modified: stable/10/usr.bin/find/function.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/find/function.c ============================================================================== --- stable/10/usr.bin/find/function.c Sat Apr 5 20:01:08 2014 (r264168) +++ stable/10/usr.bin/find/function.c Sat Apr 5 20:05:50 2014 (r264169) @@ -1768,6 +1768,7 @@ f_false(PLAN *plan __unused, FTSENT *ent int f_quit(PLAN *plan __unused, FTSENT *entry __unused) { + finish_execplus(); exit(0); } From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 5 20:09:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0A2F41E1; Sat, 5 Apr 2014 20:09: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 EABC8927; Sat, 5 Apr 2014 20:09: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 s35K9pMD061957; Sat, 5 Apr 2014 20:09:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35K9p5K061956; Sat, 5 Apr 2014 20:09:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404052009.s35K9p5K061956@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 5 Apr 2014 20:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264170 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 20:09:52 -0000 Author: jilles Date: Sat Apr 5 20:09:51 2014 New Revision: 264170 URL: http://svnweb.freebsd.org/changeset/base/264170 Log: waitid(2): Do not tell userland programmers to include . Userland should get these definitions by including . Modified: stable/10/lib/libc/sys/wait.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/wait.2 ============================================================================== --- stable/10/lib/libc/sys/wait.2 Sat Apr 5 20:05:50 2014 (r264169) +++ stable/10/lib/libc/sys/wait.2 Sat Apr 5 20:09:51 2014 (r264170) @@ -48,7 +48,7 @@ .Fn wait "int *status" .Ft pid_t .Fn waitpid "pid_t wpid" "int *status" "int options" -.In sys/signal.h +.In signal.h .Ft int .Fn waitid "idtype_t idtype" "id_t id" "siginfo_t *info" "int options" .In sys/time.h From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 5 20:11:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E43FB34C; Sat, 5 Apr 2014 20:11: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 D09B399A; Sat, 5 Apr 2014 20:11: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 s35KBeeu064979; Sat, 5 Apr 2014 20:11:40 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35KBeWK064978; Sat, 5 Apr 2014 20:11:40 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404052011.s35KBeWK064978@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 5 Apr 2014 20:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264171 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 20:11:41 -0000 Author: jilles Date: Sat Apr 5 20:11:40 2014 New Revision: 264171 URL: http://svnweb.freebsd.org/changeset/base/264171 Log: MFC r258794: chmod(2): Document S_ISVTX following SUSv3/SUSv4. S_ISTXT is non-standard. While here, also update fchmodat() standards entry to POSIX.1-2008. Modified: stable/10/lib/libc/sys/chmod.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/chmod.2 ============================================================================== --- stable/10/lib/libc/sys/chmod.2 Sat Apr 5 20:09:51 2014 (r264170) +++ stable/10/lib/libc/sys/chmod.2 Sat Apr 5 20:11:40 2014 (r264171) @@ -28,7 +28,7 @@ .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd December 1, 2013 .Dt CHMOD 2 .Os .Sh NAME @@ -139,21 +139,24 @@ defined in #define S_ISUID 0004000 /* set user id on execution */ #define S_ISGID 0002000 /* set group id on execution */ -#ifndef __BSD_VISIBLE -#define S_ISTXT 0001000 /* sticky bit */ -#endif +#define S_ISVTX 0001000 /* sticky bit */ .Ed .Pp +The non-standard +.Dv S_ISTXT +is a synonym for +.Dv S_ISVTX . +.Pp The .Fx VM system totally ignores the sticky bit -.Pq Dv ISTXT +.Pq Dv S_ISVTX for executables. On UFS-based file systems (FFS, LFS) the sticky bit may only be set upon directories. .Pp If mode -.Dv ISTXT +.Dv S_ISVTX (the `sticky bit') is set on a directory, an unprivileged user may not delete or rename files of other users in that directory. @@ -296,12 +299,15 @@ The system call is expected to conform to .St -p1003.1-90 , except for the return of -.Er EFTYPE -and the use of -.Dv S_ISTXT . +.Er EFTYPE . +The +.Dv S_ISVTX +bit on directories is expected to conform to +.St -susv3 . The .Fn fchmodat -system call follows The Open Group Extended API Set 2 specification. +system call is expected to conform to +.St -p1003.1-2008 . .Sh HISTORY The .Fn chmod From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 5 20:26:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B5976884; Sat, 5 Apr 2014 20:26: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 A2149AA0; Sat, 5 Apr 2014 20:26: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 s35KQHgL070056; Sat, 5 Apr 2014 20:26:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35KQHEh070055; Sat, 5 Apr 2014 20:26:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404052026.s35KQHEh070055@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 5 Apr 2014 20:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264172 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 20:26:17 -0000 Author: jilles Date: Sat Apr 5 20:26:17 2014 New Revision: 264172 URL: http://svnweb.freebsd.org/changeset/base/264172 Log: MFC r262872: fts: Don't abort if an empty pathname is given. Make fts_open(3) treat an empty pathname like any other pathname that cannot be lstatted because of [ENOENT]. It is rather confusing if rm -rf file1 "" file2 does not remove file1 and file2. PR: bin/187264 Modified: stable/10/lib/libc/gen/fts.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/fts.c ============================================================================== --- stable/10/lib/libc/gen/fts.c Sat Apr 5 20:11:40 2014 (r264171) +++ stable/10/lib/libc/gen/fts.c Sat Apr 5 20:26:17 2014 (r264172) @@ -161,11 +161,7 @@ fts_open(argv, options, compar) /* Allocate/initialize root(s). */ for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) { - /* Don't allow zero-length paths. */ - if ((len = strlen(*argv)) == 0) { - errno = ENOENT; - goto mem3; - } + len = strlen(*argv); p = fts_alloc(sp, *argv, len); p->fts_level = FTS_ROOTLEVEL; From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 6 10:56:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 90C43C18; Sun, 6 Apr 2014 10:56: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 703A213F; Sun, 6 Apr 2014 10:56: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 s36AuS2I037420; Sun, 6 Apr 2014 10:56:28 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36AuSK0037419; Sun, 6 Apr 2014 10:56:28 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404061056.s36AuSK0037419@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 6 Apr 2014 10:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264192 - stable/10/usr.bin/login X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 10:56:28 -0000 Author: jilles Date: Sun Apr 6 10:56:27 2014 New Revision: 264192 URL: http://svnweb.freebsd.org/changeset/base/264192 Log: login: Clean up PAM and audit, then exit, on SIGHUP and SIGTERM. This avoids leaving stale entries in utmpx after the connection is closed on an open login session. It also allows a clean way (SIGTERM) to forcibly terminate a user's terminal session. This does not affect the situation for "hung" processes after the connection is closed. The foreground process group receives SIGHUP and the tty becomes inaccessible. Also replace all use of the obsolete signal() function with sigaction() (not only the part where it is actually required: SIGHUP and SIGTERM must mask the other as well when caught). PR: misc/183495 Modified: stable/10/usr.bin/login/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/login/login.c ============================================================================== --- stable/10/usr.bin/login/login.c Sun Apr 6 10:13:14 2014 (r264191) +++ stable/10/usr.bin/login/login.c Sun Apr 6 10:56:27 2014 (r264192) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); static int auth_pam(void); static void bail(int, int); +static void bail_internal(int, int, int); static int export(const char *); static void export_pam_environment(void); static int motd(const char *); @@ -94,6 +95,7 @@ static void refused(const char *, cons static const char *stypeof(char *); static void sigint(int); static void timedout(int); +static void bail_sig(int); static void usage(void); #define TTYGRPNAME "tty" /* group to own ttys */ @@ -172,13 +174,18 @@ main(int argc, char *argv[]) login_cap_t *lc = NULL; login_cap_t *lc_user = NULL; pid_t pid; + sigset_t mask, omask; + struct sigaction sa; #ifdef USE_BSM_AUDIT char auditsuccess = 1; #endif - (void)signal(SIGQUIT, SIG_IGN); - (void)signal(SIGINT, SIG_IGN); - (void)signal(SIGHUP, SIG_IGN); + sa.sa_flags = SA_RESTART; + (void)sigfillset(&sa.sa_mask); + sa.sa_handler = SIG_IGN; + (void)sigaction(SIGQUIT, &sa, NULL); + (void)sigaction(SIGINT, &sa, NULL); + (void)sigaction(SIGHUP, &sa, NULL); if (setjmp(timeout_buf)) { if (failures) badlogin(username); @@ -186,7 +193,8 @@ main(int argc, char *argv[]) timeout); bail(NO_SLEEP_EXIT, 0); } - (void)signal(SIGALRM, timedout); + sa.sa_handler = timedout; + (void)sigaction(SIGALRM, &sa, NULL); (void)alarm(timeout); (void)setpriority(PRIO_PROCESS, 0, 0); @@ -370,7 +378,14 @@ main(int argc, char *argv[]) /* committed to login -- turn off timeout */ (void)alarm((u_int)0); - (void)signal(SIGHUP, SIG_DFL); + + (void)sigemptyset(&mask); + (void)sigaddset(&mask, SIGHUP); + (void)sigaddset(&mask, SIGTERM); + (void)sigprocmask(SIG_BLOCK, &mask, &omask); + sa.sa_handler = bail_sig; + (void)sigaction(SIGHUP, &sa, NULL); + (void)sigaction(SIGTERM, &sa, NULL); endpwent(); @@ -550,10 +565,17 @@ main(int argc, char *argv[]) /* * Parent: wait for child to finish, then clean up * session. + * + * If we get SIGHUP or SIGTERM, clean up the session + * and exit right away. This will make the terminal + * inaccessible and send SIGHUP to the foreground + * process group. */ int status; setproctitle("-%s [pam]", getprogname()); + (void)sigprocmask(SIG_SETMASK, &omask, NULL); waitpid(pid, &status, 0); + (void)sigprocmask(SIG_BLOCK, &mask, NULL); bail(NO_SLEEP_EXIT, 0); } @@ -627,10 +649,15 @@ main(int argc, char *argv[]) login_close(lc_user); login_close(lc); - (void)signal(SIGALRM, SIG_DFL); - (void)signal(SIGQUIT, SIG_DFL); - (void)signal(SIGINT, SIG_DFL); - (void)signal(SIGTSTP, SIG_IGN); + sa.sa_handler = SIG_DFL; + (void)sigaction(SIGALRM, &sa, NULL); + (void)sigaction(SIGQUIT, &sa, NULL); + (void)sigaction(SIGINT, &sa, NULL); + (void)sigaction(SIGTERM, &sa, NULL); + (void)sigaction(SIGHUP, &sa, NULL); + sa.sa_handler = SIG_IGN; + (void)sigaction(SIGTSTP, &sa, NULL); + (void)sigprocmask(SIG_SETMASK, &omask, NULL); /* * Login shells have a leading '-' in front of argv[0] @@ -847,17 +874,20 @@ sigint(int signo __unused) static int motd(const char *motdfile) { - sig_t oldint; + struct sigaction newint, oldint; FILE *f; int ch; if ((f = fopen(motdfile, "r")) == NULL) return (-1); motdinterrupt = 0; - oldint = signal(SIGINT, sigint); + newint.sa_handler = sigint; + newint.sa_flags = 0; + sigfillset(&newint.sa_mask); + sigaction(SIGINT, &newint, &oldint); while ((ch = fgetc(f)) != EOF && !motdinterrupt) putchar(ch); - signal(SIGINT, oldint); + sigaction(SIGINT, &oldint, NULL); if (ch != EOF || ferror(f)) { fclose(f); return (-1); @@ -966,12 +996,10 @@ pam_cleanup(void) } } -/* - * Exit, optionally after sleeping a few seconds - */ -void -bail(int sec, int eval) +static void +bail_internal(int sec, int eval, int signo) { + struct sigaction sa; pam_cleanup(); #ifdef USE_BSM_AUDIT @@ -979,5 +1007,36 @@ bail(int sec, int eval) audit_logout(); #endif (void)sleep(sec); - exit(eval); + if (signo == 0) + exit(eval); + else { + sa.sa_handler = SIG_DFL; + sa.sa_flags = 0; + (void)sigemptyset(&sa.sa_mask); + (void)sigaction(signo, &sa, NULL); + (void)sigaddset(&sa.sa_mask, signo); + (void)sigprocmask(SIG_UNBLOCK, &sa.sa_mask, NULL); + raise(signo); + exit(128 + signo); + } +} + +/* + * Exit, optionally after sleeping a few seconds + */ +static void +bail(int sec, int eval) +{ + bail_internal(sec, eval, 0); +} + +/* + * Exit because of a signal. + * This is not async-signal safe, so only call async-signal safe functions + * while the signal is unmasked. + */ +static void +bail_sig(int signo) +{ + bail_internal(NO_SLEEP_EXIT, 0, signo); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 7 01:49:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 87E5F4C8; Mon, 7 Apr 2014 01:49: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 694F5776; Mon, 7 Apr 2014 01:49:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s371nVVa061567; Mon, 7 Apr 2014 01:49:31 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s371nU8u061563; Mon, 7 Apr 2014 01:49:30 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201404070149.s371nU8u061563@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 7 Apr 2014 01:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264210 - stable/10/sys/ddb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 01:49:31 -0000 Author: pfg Date: Mon Apr 7 01:49:30 2014 New Revision: 264210 URL: http://svnweb.freebsd.org/changeset/base/264210 Log: MFC r263973; ddb: Minor style cleanups. #define should be followed by tab. Modified: stable/10/sys/ddb/db_break.h stable/10/sys/ddb/db_sym.h stable/10/sys/ddb/db_variables.h stable/10/sys/ddb/ddb.h Modified: stable/10/sys/ddb/db_break.h ============================================================================== --- stable/10/sys/ddb/db_break.h Mon Apr 7 01:46:30 2014 (r264209) +++ stable/10/sys/ddb/db_break.h Mon Apr 7 01:49:30 2014 (r264210) @@ -38,7 +38,7 @@ */ #ifndef BKPT_INST_TYPE -#define BKPT_INST_TYPE int +#define BKPT_INST_TYPE int #endif struct db_breakpoint { Modified: stable/10/sys/ddb/db_sym.h ============================================================================== --- stable/10/sys/ddb/db_sym.h Mon Apr 7 01:46:30 2014 (r264209) +++ stable/10/sys/ddb/db_sym.h Mon Apr 7 01:49:30 2014 (r264210) @@ -63,8 +63,8 @@ typedef const char * c_db_sym_t; /* cons typedef int db_strategy_t; /* search strategy */ #define DB_STGY_ANY 0 /* anything goes */ -#define DB_STGY_XTRN 1 /* only external symbols */ -#define DB_STGY_PROC 2 /* only procedures */ +#define DB_STGY_XTRN 1 /* only external symbols */ +#define DB_STGY_PROC 2 /* only procedures */ /* * Functions exported by the symtable module @@ -78,11 +78,11 @@ c_db_sym_t db_search_symbol(db_addr_t, d void db_symbol_values(c_db_sym_t, const char **, db_expr_t *); /* return name and value of symbol */ -#define db_find_sym_and_offset(val,namep,offp) \ +#define db_find_sym_and_offset(val,namep,offp) \ db_symbol_values(db_search_symbol(val,DB_STGY_ANY,offp),namep,0) /* find name&value given approx val */ -#define db_find_xtrn_sym_and_offset(val,namep,offp) \ +#define db_find_xtrn_sym_and_offset(val,namep,offp) \ db_symbol_values(db_search_symbol(val,DB_STGY_XTRN,offp),namep,0) /* ditto, but no locals */ Modified: stable/10/sys/ddb/db_variables.h ============================================================================== --- stable/10/sys/ddb/db_variables.h Mon Apr 7 01:46:30 2014 (r264209) +++ stable/10/sys/ddb/db_variables.h Mon Apr 7 01:49:30 2014 (r264210) @@ -44,8 +44,8 @@ struct db_variable { db_expr_t *valuep; /* value of variable */ /* function to call when reading/writing */ db_varfcn_t *fcn; -#define DB_VAR_GET 0 -#define DB_VAR_SET 1 +#define DB_VAR_GET 0 +#define DB_VAR_SET 1 }; #define FCN_NULL ((db_varfcn_t *)0) Modified: stable/10/sys/ddb/ddb.h ============================================================================== --- stable/10/sys/ddb/ddb.h Mon Apr 7 01:46:30 2014 (r264209) +++ stable/10/sys/ddb/ddb.h Mon Apr 7 01:49:30 2014 (r264210) @@ -118,7 +118,7 @@ struct command { * in modules in which case they will be available only when * the module is loaded. */ -#define _DB_SET(_suffix, _name, _func, list, _flag, _more) \ +#define _DB_SET(_suffix, _name, _func, list, _flag, _more) \ static struct command __CONCAT(_name,_suffix) = { \ .name = __STRING(_name), \ .fcn = _func, \ @@ -145,27 +145,27 @@ SYSUNINIT(__CONCAT(_name,_suffix), SI_SU * This macro is mostly used to define commands placed in one of * the ddb command tables; see DB_COMMAND, etc. below. */ -#define _DB_FUNC(_suffix, _name, _func, list, _flag, _more) \ +#define _DB_FUNC(_suffix, _name, _func, list, _flag, _more) \ static db_cmdfcn_t _func; \ _DB_SET(_suffix, _name, _func, list, _flag, _more); \ static void \ _func(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *modif) /* common idom provided for backwards compatibility */ -#define DB_FUNC(_name, _func, list, _flag, _more) \ +#define DB_FUNC(_name, _func, list, _flag, _more) \ _DB_FUNC(_cmd, _name, _func, list, _flag, _more) -#define DB_COMMAND(cmd_name, func_name) \ +#define DB_COMMAND(cmd_name, func_name) \ _DB_FUNC(_cmd, cmd_name, func_name, db_cmd_table, 0, NULL) -#define DB_ALIAS(alias_name, func_name) \ +#define DB_ALIAS(alias_name, func_name) \ _DB_SET(_cmd, alias_name, func_name, db_cmd_table, 0, NULL) -#define DB_SHOW_COMMAND(cmd_name, func_name) \ +#define DB_SHOW_COMMAND(cmd_name, func_name) \ _DB_FUNC(_show, cmd_name, func_name, db_show_table, 0, NULL) -#define DB_SHOW_ALIAS(alias_name, func_name) \ +#define DB_SHOW_ALIAS(alias_name, func_name) \ _DB_SET(_show, alias_name, func_name, db_show_table, 0, NULL) -#define DB_SHOW_ALL_COMMAND(cmd_name, func_name) \ +#define DB_SHOW_ALL_COMMAND(cmd_name, func_name) \ _DB_FUNC(_show_all, cmd_name, func_name, db_show_all_table, 0, NULL) -#define DB_SHOW_ALL_ALIAS(alias_name, func_name) \ +#define DB_SHOW_ALL_ALIAS(alias_name, func_name) \ _DB_SET(_show_all, alias_name, func_name, db_show_all_table, 0, NULL) extern db_expr_t db_maxoff; From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 7 01:55:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 67CF7A46; Mon, 7 Apr 2014 01:55: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 55063855; Mon, 7 Apr 2014 01:55: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 s371tt1U065353; Mon, 7 Apr 2014 01:55:55 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s371ts3c065351; Mon, 7 Apr 2014 01:55:54 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201404070155.s371ts3c065351@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 7 Apr 2014 01:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264214 - in stable/10: contrib/gcc sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 01:55:55 -0000 Author: pfg Date: Mon Apr 7 01:55:54 2014 New Revision: 264214 URL: http://svnweb.freebsd.org/changeset/base/264214 Log: MFC r264121; gcc: define __block when block support is enabled This mimics the behaviour in clang and lets us build cleanly the libdispatch port on platforms where the base gcc is still the default compiler. Bump __FreeBSD_version for ports. Tested by: theraven Modified: stable/10/contrib/gcc/c-cppbuiltin.c stable/10/sys/sys/param.h Modified: stable/10/contrib/gcc/c-cppbuiltin.c ============================================================================== --- stable/10/contrib/gcc/c-cppbuiltin.c Mon Apr 7 01:55:53 2014 (r264213) +++ stable/10/contrib/gcc/c-cppbuiltin.c Mon Apr 7 01:55:54 2014 (r264214) @@ -504,7 +504,10 @@ c_cpp_builtins (cpp_reader *pfile) /* APPLE LOCAL begin blocks */ /* APPLE LOCAL radar 5868913 */ if (flag_blocks) - cpp_define (pfile, "__BLOCKS__=1"); + { + cpp_define (pfile, "__block=__attribute__((__blocks__(byref)))"); + cpp_define (pfile, "__BLOCKS__=1"); + } /* APPLE LOCAL end blocks */ if (optimize_size) cpp_define (pfile, "__OPTIMIZE_SIZE__"); Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Mon Apr 7 01:55:53 2014 (r264213) +++ stable/10/sys/sys/param.h Mon Apr 7 01:55:54 2014 (r264214) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000705 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000706 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 7 12:50:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 51186D51; Mon, 7 Apr 2014 12:50: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 3DEE9A02; Mon, 7 Apr 2014 12:50: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 s37Co92A036647; Mon, 7 Apr 2014 12:50:09 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37Co9vP036646; Mon, 7 Apr 2014 12:50:09 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404071250.s37Co9vP036646@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Apr 2014 12:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264221 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 12:50:09 -0000 Author: ae Date: Mon Apr 7 12:50:08 2014 New Revision: 264221 URL: http://svnweb.freebsd.org/changeset/base/264221 Log: MFC r263966: Don't copy the MF flag from original IP header to ICMP error message. PR: 188092 Sponsored by: Yandex LLC Modified: stable/10/sys/netinet/ip_icmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_icmp.c ============================================================================== --- stable/10/sys/netinet/ip_icmp.c Mon Apr 7 07:06:13 2014 (r264220) +++ stable/10/sys/netinet/ip_icmp.c Mon Apr 7 12:50:08 2014 (r264221) @@ -347,6 +347,7 @@ stdreply: icmpelen = max(8, min(V_icmp_q nip->ip_hl = 5; nip->ip_p = IPPROTO_ICMP; nip->ip_tos = 0; + nip->ip_off = 0; icmp_reflect(m); freeit: From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 7 12:58:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B8C062E2; Mon, 7 Apr 2014 12:58: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 A434BB01; Mon, 7 Apr 2014 12:58: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 s37Cws0O040579; Mon, 7 Apr 2014 12:58:54 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37Cwsts040578; Mon, 7 Apr 2014 12:58:54 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404071258.s37Cwsts040578@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Apr 2014 12:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264224 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 12:58:54 -0000 Author: ae Date: Mon Apr 7 12:58:54 2014 New Revision: 264224 URL: http://svnweb.freebsd.org/changeset/base/264224 Log: MFC r263969,263971: Don't generate an ICMPv6 error message if packet was consumed by filter. Remove unused label. Sponsored by: Yandex LLC Modified: stable/10/sys/netinet6/ip6_forward.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/ip6_forward.c ============================================================================== --- stable/10/sys/netinet6/ip6_forward.c Mon Apr 7 12:51:41 2014 (r264223) +++ stable/10/sys/netinet6/ip6_forward.c Mon Apr 7 12:58:54 2014 (r264224) @@ -563,10 +563,8 @@ skip_routing: odst = ip6->ip6_dst; /* Run through list of hooks for output packets. */ error = pfil_run_hooks(&V_inet6_pfil_hook, &m, rt->rt_ifp, PFIL_OUT, NULL); - if (error != 0) - goto senderr; - if (m == NULL) - goto freecopy; + if (error != 0 || m == NULL) + goto freecopy; /* consumed by filter */ ip6 = mtod(m, struct ip6_hdr *); /* See if destination IP address was changed by packet filter. */ @@ -635,7 +633,6 @@ pass: } } -senderr: if (mcopy == NULL) goto out; switch (error) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 8 00:53:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DCCA890A; Tue, 8 Apr 2014 00:53: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 BCD9B19D8; Tue, 8 Apr 2014 00:53: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 s380rWED016107; Tue, 8 Apr 2014 00:53:32 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s380rVas016103; Tue, 8 Apr 2014 00:53:31 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404080053.s380rVas016103@svn.freebsd.org> From: Glen Barber Date: Tue, 8 Apr 2014 00:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264245 - in stable/10: release share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 00:53:32 -0000 Author: gjb Date: Tue Apr 8 00:53:31 2014 New Revision: 264245 URL: http://svnweb.freebsd.org/changeset/base/264245 Log: MFC r264027, r264028, r264029, r264030, r264046, r264073: r264027: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed as part of the 'install' target in the release/ directory. r264028: Clean up trailing whitespace in release/Makefile. r264029: Fix logic error. r264030: If WITH_COMPRESSED_IMAGES is set, add the compressed images to the CLEANFILES list. r264046: Use xz(1) instead of gzip(1) to compress release images when WITH_COMPRESSED_IMAGES is used. r264073: Allow overriding xz(1) path. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile stable/10/release/release.conf.sample stable/10/release/release.sh stable/10/share/man/man7/release.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Mon Apr 7 22:49:41 2014 (r264244) +++ stable/10/release/Makefile Tue Apr 8 00:53:31 2014 (r264245) @@ -1,7 +1,7 @@ # $FreeBSD$ # # Makefile for building releases and release media. -# +# # User-driven targets: # cdrom: Builds release CD-ROM media (disc1.iso) # dvdrom: Builds release DVD-ROM media (dvd1.iso) @@ -13,7 +13,7 @@ # # Variables affecting the build process: # WORLDDIR: location of src tree -- must have built world and default kernel -# (by default, the directory above this one) +# (by default, the directory above this one) # PORTSDIR: location of ports tree to distribute (default: /usr/ports) # DOCDIR: location of doc tree (default: /usr/doc) # NOPKG: if set, do not distribute third-party packages @@ -21,13 +21,16 @@ # NOSRC: if set, do not distribute source tree # NODOC: if set, do not generate release documentation # WITH_DVD: if set, generate dvd1.iso -# TARGET/TARGET_ARCH: architecture of built release +# WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1) +# (uncompressed images are not removed) +# TARGET/TARGET_ARCH: architecture of built release # WORLDDIR?= ${.CURDIR}/.. PORTSDIR?= /usr/ports DOCDIR?= /usr/doc RELNOTES_LANG?= en_US.ISO8859-1 +XZCMD?= /usr/bin/xz .if !defined(TARGET) || empty(TARGET) TARGET= ${MACHINE} @@ -63,7 +66,7 @@ NODOC= true NOPORTS= true .endif -EXTRA_PACKAGES= +EXTRA_PACKAGES= .if !defined(NOPORTS) EXTRA_PACKAGES+= ports.txz .endif @@ -92,6 +95,11 @@ IMAGES+= mini-memstick.img .endif CLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES} +.if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) +. for I in ${IMAGES} +CLEANFILES+= ${I}.xz +. endfor +.endif CLEANDIRS= dist ftp release bootonly dvd beforeclean: chflags -R noschg . @@ -251,6 +259,9 @@ install: cp -a ftp ${DESTDIR}/ .for I in ${IMAGES} cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} +. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) + ${XZCMD} -k ${DESTDIR}/${OSRELEASE}-${I} +. endif .endfor cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5 Modified: stable/10/release/release.conf.sample ============================================================================== --- stable/10/release/release.conf.sample Mon Apr 7 22:49:41 2014 (r264244) +++ stable/10/release/release.conf.sample Tue Apr 8 00:53:31 2014 (r264245) @@ -46,6 +46,7 @@ PORTBRANCH="ports/head@rHEAD" #NODOC= #NOPORTS= #WITH_DVD= +#WITH_COMPRESSED_IMAGES= ## Set when building embedded images. #EMBEDDEDBUILD= Modified: stable/10/release/release.sh ============================================================================== --- stable/10/release/release.sh Mon Apr 7 22:49:41 2014 (r264244) +++ stable/10/release/release.sh Tue Apr 8 00:53:31 2014 (r264245) @@ -83,6 +83,7 @@ NOPORTS= # Set to non-empty value to build dvd1.iso as part of the release. WITH_DVD= +WITH_COMPRESSED_IMAGES= usage() { echo "Usage: $0 [-c release.conf]" @@ -128,6 +129,7 @@ if [ -n "${EMBEDDEDBUILD}" ]; then exit 1 fi WITH_DVD= + WITH_COMPRESSED_IMAGES= NODOC=yes fi @@ -262,4 +264,4 @@ eval chroot ${CHROOTDIR} make -C /usr/sr eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ release eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - install DESTDIR=/R + install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} Modified: stable/10/share/man/man7/release.7 ============================================================================== --- stable/10/share/man/man7/release.7 Mon Apr 7 22:49:41 2014 (r264244) +++ stable/10/share/man/man7/release.7 Tue Apr 8 00:53:31 2014 (r264245) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2014 +.Dd April 2, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -250,6 +250,12 @@ Setting this also sets Set to a non-empty value to include the .Cm dvdrom target. +.It Va WITH_COMPRESSED_IMAGES +Set to a non-empty value to compress the release images with +.Xr xz 1 . +The original +.Pq uncompressed +images are not removed. .It Va VCSCMD The command run to obtain the source trees. Defaults to From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 8 18:27:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4A41D7D7; Tue, 8 Apr 2014 18:27: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 2A87B1243; Tue, 8 Apr 2014 18:27: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 s38IRfAK049047; Tue, 8 Apr 2014 18:27:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38IRd0D049041; Tue, 8 Apr 2014 18:27:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404081827.s38IRd0D049041@svn.freebsd.org> From: Xin LI Date: Tue, 8 Apr 2014 18:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264266 - in stable/10: crypto/openssl/crypto/bn crypto/openssl/crypto/ec crypto/openssl/ssl sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 18:27:41 -0000 Author: delphij Date: Tue Apr 8 18:27:39 2014 New Revision: 264266 URL: http://svnweb.freebsd.org/changeset/base/264266 Log: Fix NFS deadlock vulnerability. [SA-14:05] Fix "Heartbleed" vulnerability and ECDSA Cache Side-channel Attack in OpenSSL. [SA-14:06] Modified: stable/10/crypto/openssl/crypto/bn/bn.h stable/10/crypto/openssl/crypto/bn/bn_lib.c stable/10/crypto/openssl/crypto/ec/ec2_mult.c stable/10/crypto/openssl/ssl/d1_both.c stable/10/crypto/openssl/ssl/t1_lib.c stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Modified: stable/10/crypto/openssl/crypto/bn/bn.h ============================================================================== --- stable/10/crypto/openssl/crypto/bn/bn.h Tue Apr 8 18:27:32 2014 (r264265) +++ stable/10/crypto/openssl/crypto/bn/bn.h Tue Apr 8 18:27:39 2014 (r264266) @@ -538,6 +538,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *ret, BIGNUM *BN_mod_sqrt(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); +void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); + /* Deprecated versions */ #ifndef OPENSSL_NO_DEPRECATED BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe, @@ -774,11 +776,20 @@ int RAND_pseudo_bytes(unsigned char *buf #define bn_fix_top(a) bn_check_top(a) +#define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2) +#define bn_wcheck_size(bn, words) \ + do { \ + const BIGNUM *_bnum2 = (bn); \ + assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \ + } while(0) + #else /* !BN_DEBUG */ #define bn_pollute(a) #define bn_check_top(a) #define bn_fix_top(a) bn_correct_top(a) +#define bn_check_size(bn, bits) +#define bn_wcheck_size(bn, words) #endif Modified: stable/10/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/bn_lib.c Tue Apr 8 18:27:32 2014 (r264265) +++ stable/10/crypto/openssl/crypto/bn/bn_lib.c Tue Apr 8 18:27:39 2014 (r264266) @@ -824,3 +824,55 @@ int bn_cmp_part_words(const BN_ULONG *a, } return bn_cmp_words(a,b,cl); } + +/* + * Constant-time conditional swap of a and b. + * a and b are swapped if condition is not 0. The code assumes that at most one bit of condition is set. + * nwords is the number of words to swap. The code assumes that at least nwords are allocated in both a and b, + * and that no more than nwords are used by either a or b. + * a and b cannot be the same number + */ +void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords) + { + BN_ULONG t; + int i; + + bn_wcheck_size(a, nwords); + bn_wcheck_size(b, nwords); + + assert(a != b); + assert((condition & (condition - 1)) == 0); + assert(sizeof(BN_ULONG) >= sizeof(int)); + + condition = ((condition - 1) >> (BN_BITS2 - 1)) - 1; + + t = (a->top^b->top) & condition; + a->top ^= t; + b->top ^= t; + +#define BN_CONSTTIME_SWAP(ind) \ + do { \ + t = (a->d[ind] ^ b->d[ind]) & condition; \ + a->d[ind] ^= t; \ + b->d[ind] ^= t; \ + } while (0) + + + switch (nwords) { + default: + for (i = 10; i < nwords; i++) + BN_CONSTTIME_SWAP(i); + /* Fallthrough */ + case 10: BN_CONSTTIME_SWAP(9); /* Fallthrough */ + case 9: BN_CONSTTIME_SWAP(8); /* Fallthrough */ + case 8: BN_CONSTTIME_SWAP(7); /* Fallthrough */ + case 7: BN_CONSTTIME_SWAP(6); /* Fallthrough */ + case 6: BN_CONSTTIME_SWAP(5); /* Fallthrough */ + case 5: BN_CONSTTIME_SWAP(4); /* Fallthrough */ + case 4: BN_CONSTTIME_SWAP(3); /* Fallthrough */ + case 3: BN_CONSTTIME_SWAP(2); /* Fallthrough */ + case 2: BN_CONSTTIME_SWAP(1); /* Fallthrough */ + case 1: BN_CONSTTIME_SWAP(0); + } +#undef BN_CONSTTIME_SWAP +} Modified: stable/10/crypto/openssl/crypto/ec/ec2_mult.c ============================================================================== --- stable/10/crypto/openssl/crypto/ec/ec2_mult.c Tue Apr 8 18:27:32 2014 (r264265) +++ stable/10/crypto/openssl/crypto/ec/ec2_mult.c Tue Apr 8 18:27:39 2014 (r264266) @@ -208,11 +208,15 @@ static int gf2m_Mxy(const EC_GROUP *grou return ret; } + /* Computes scalar*point and stores the result in r. * point can not equal r. - * Uses algorithm 2P of + * Uses a modified algorithm 2P of * Lopez, J. and Dahab, R. "Fast multiplication on elliptic curves over * GF(2^m) without precomputation" (CHES '99, LNCS 1717). + * + * To protect against side-channel attack the function uses constant time swap, + * avoiding conditional branches. */ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, const EC_POINT *point, BN_CTX *ctx) @@ -246,6 +250,11 @@ static int ec_GF2m_montgomery_point_mult x2 = &r->X; z2 = &r->Y; + bn_wexpand(x1, group->field.top); + bn_wexpand(z1, group->field.top); + bn_wexpand(x2, group->field.top); + bn_wexpand(z2, group->field.top); + if (!BN_GF2m_mod_arr(x1, &point->X, group->poly)) goto err; /* x1 = x */ if (!BN_one(z1)) goto err; /* z1 = 1 */ if (!group->meth->field_sqr(group, z2, x1, ctx)) goto err; /* z2 = x1^2 = x^2 */ @@ -270,16 +279,12 @@ static int ec_GF2m_montgomery_point_mult word = scalar->d[i]; while (mask) { - if (word & mask) - { - if (!gf2m_Madd(group, &point->X, x1, z1, x2, z2, ctx)) goto err; - if (!gf2m_Mdouble(group, x2, z2, ctx)) goto err; - } - else - { - if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err; - if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err; - } + BN_consttime_swap(word & mask, x1, x2, group->field.top); + BN_consttime_swap(word & mask, z1, z2, group->field.top); + if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err; + if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err; + BN_consttime_swap(word & mask, x1, x2, group->field.top); + BN_consttime_swap(word & mask, z1, z2, group->field.top); mask >>= 1; } mask = BN_TBIT; Modified: stable/10/crypto/openssl/ssl/d1_both.c ============================================================================== --- stable/10/crypto/openssl/ssl/d1_both.c Tue Apr 8 18:27:32 2014 (r264265) +++ stable/10/crypto/openssl/ssl/d1_both.c Tue Apr 8 18:27:39 2014 (r264266) @@ -1458,26 +1458,36 @@ dtls1_process_heartbeat(SSL *s) unsigned int payload; unsigned int padding = 16; /* Use minimum padding */ - /* Read type and payload length first */ - hbtype = *p++; - n2s(p, payload); - pl = p; - if (s->msg_callback) s->msg_callback(0, s->version, TLS1_RT_HEARTBEAT, &s->s3->rrec.data[0], s->s3->rrec.length, s, s->msg_callback_arg); + /* Read type and payload length first */ + if (1 + 2 + 16 > s->s3->rrec.length) + return 0; /* silently discard */ + hbtype = *p++; + n2s(p, payload); + if (1 + 2 + payload + 16 > s->s3->rrec.length) + return 0; /* silently discard per RFC 6520 sec. 4 */ + pl = p; + if (hbtype == TLS1_HB_REQUEST) { unsigned char *buffer, *bp; + unsigned int write_length = 1 /* heartbeat type */ + + 2 /* heartbeat length */ + + payload + padding; int r; + if (write_length > SSL3_RT_MAX_PLAIN_LENGTH) + return 0; + /* Allocate memory for the response, size is 1 byte * message type, plus 2 bytes payload length, plus * payload, plus padding */ - buffer = OPENSSL_malloc(1 + 2 + payload + padding); + buffer = OPENSSL_malloc(write_length); bp = buffer; /* Enter response type, length and copy payload */ @@ -1488,11 +1498,11 @@ dtls1_process_heartbeat(SSL *s) /* Random padding */ RAND_pseudo_bytes(bp, padding); - r = dtls1_write_bytes(s, TLS1_RT_HEARTBEAT, buffer, 3 + payload + padding); + r = dtls1_write_bytes(s, TLS1_RT_HEARTBEAT, buffer, write_length); if (r >= 0 && s->msg_callback) s->msg_callback(1, s->version, TLS1_RT_HEARTBEAT, - buffer, 3 + payload + padding, + buffer, write_length, s, s->msg_callback_arg); OPENSSL_free(buffer); Modified: stable/10/crypto/openssl/ssl/t1_lib.c ============================================================================== --- stable/10/crypto/openssl/ssl/t1_lib.c Tue Apr 8 18:27:32 2014 (r264265) +++ stable/10/crypto/openssl/ssl/t1_lib.c Tue Apr 8 18:27:39 2014 (r264266) @@ -2486,16 +2486,20 @@ tls1_process_heartbeat(SSL *s) unsigned int payload; unsigned int padding = 16; /* Use minimum padding */ - /* Read type and payload length first */ - hbtype = *p++; - n2s(p, payload); - pl = p; - if (s->msg_callback) s->msg_callback(0, s->version, TLS1_RT_HEARTBEAT, &s->s3->rrec.data[0], s->s3->rrec.length, s, s->msg_callback_arg); + /* Read type and payload length first */ + if (1 + 2 + 16 > s->s3->rrec.length) + return 0; /* silently discard */ + hbtype = *p++; + n2s(p, payload); + if (1 + 2 + payload + 16 > s->s3->rrec.length) + return 0; /* silently discard per RFC 6520 sec. 4 */ + pl = p; + if (hbtype == TLS1_HB_REQUEST) { unsigned char *buffer, *bp; Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Tue Apr 8 18:27:32 2014 (r264265) +++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Tue Apr 8 18:27:39 2014 (r264266) @@ -1457,10 +1457,23 @@ nfsrvd_rename(struct nfsrv_descript *nd, nfsvno_relpathbuf(&fromnd); goto out; } + /* + * Unlock dp in this code section, so it is unlocked before + * tdp gets locked. This avoids a potential LOR if tdp is the + * parent directory of dp. + */ if (nd->nd_flag & ND_NFSV4) { tdp = todp; tnes = *toexp; - tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 0); + if (dp != tdp) { + NFSVOPUNLOCK(dp, 0); + tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, + p, 0); /* Might lock tdp. */ + } else { + tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, + p, 1); + NFSVOPUNLOCK(dp, 0); + } } else { tfh.nfsrvfh_len = 0; error = nfsrv_mtofh(nd, &tfh); @@ -1481,10 +1494,12 @@ nfsrvd_rename(struct nfsrv_descript *nd, tnes = *exp; tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 1); + NFSVOPUNLOCK(dp, 0); } else { + NFSVOPUNLOCK(dp, 0); nd->nd_cred->cr_uid = nd->nd_saveduid; nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, NULL, - 0, p); + 0, p); /* Locks tdp. */ if (tdp) { tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 1); @@ -1499,7 +1514,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, if (error) { if (tdp) vrele(tdp); - vput(dp); + vrele(dp); nfsvno_relpathbuf(&fromnd); nfsvno_relpathbuf(&tond); goto out; @@ -1514,7 +1529,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, } if (tdp) vrele(tdp); - vput(dp); + vrele(dp); nfsvno_relpathbuf(&fromnd); nfsvno_relpathbuf(&tond); goto out; @@ -1523,7 +1538,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, /* * Done parsing, now down to business. */ - nd->nd_repstat = nfsvno_namei(nd, &fromnd, dp, 1, exp, p, &fdirp); + nd->nd_repstat = nfsvno_namei(nd, &fromnd, dp, 0, exp, p, &fdirp); if (nd->nd_repstat) { if (nd->nd_flag & ND_NFSV3) { nfsrv_wcc(nd, fdirfor_ret, &fdirfor, fdiraft_ret, From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 8 20:40:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5BD4E307; Tue, 8 Apr 2014 20:40: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 3BDEA1173; Tue, 8 Apr 2014 20:40: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 s38Ketll006277; Tue, 8 Apr 2014 20:40:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38Kes0P006272; Tue, 8 Apr 2014 20:40:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404082040.s38Kes0P006272@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Apr 2014 20:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264273 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 20:40:55 -0000 Author: jhb Date: Tue Apr 8 20:40:54 2014 New Revision: 264273 URL: http://svnweb.freebsd.org/changeset/base/264273 Log: MFC 259635: Add an option to ignore accesses by the guest to unimplemented MSRs. Also, ignore a couple of SandyBridge uncore PMC MSRs that Centos 6.4 writes to during boot. Modified: stable/10/usr.sbin/bhyve/bhyve.8 stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/xmsr.c stable/10/usr.sbin/bhyve/xmsr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/10/usr.sbin/bhyve/bhyve.8 Tue Apr 8 20:17:11 2014 (r264272) +++ stable/10/usr.sbin/bhyve/bhyve.8 Tue Apr 8 20:40:54 2014 (r264273) @@ -32,7 +32,7 @@ .Nd "run a guest operating system inside a virtual machine" .Sh SYNOPSIS .Nm -.Op Fl aehAHPW +.Op Fl aehwAHPW .Op Fl c Ar numcpus .Op Fl g Ar gdbport .Op Fl p Ar pinnedcpu @@ -229,6 +229,8 @@ Force .Nm to exit when a guest issues an access to an I/O port that is not emulated. This is intended for debug purposes. +.It Fl w +Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes. .It Fl h Print help message and exit. .It Ar vmname Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Tue Apr 8 20:17:11 2014 (r264272) +++ stable/10/usr.sbin/bhyve/bhyverun.c Tue Apr 8 20:40:54 2014 (r264273) @@ -88,6 +88,7 @@ static int guest_vmexit_on_hlt, guest_vm static int virtio_msix = 1; static int strictio; +static int strictmsr = 1; static int acpi; @@ -123,7 +124,7 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-aehAHIPW] [-g ] [-s ] [-S ]\n" + "Usage: %s [-aehwAHIPW] [-g ] [-s ] [-S ]\n" " %*s [-c vcpus] [-p pincpu] [-m mem] [-l ] \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" " -A: create an ACPI table\n" @@ -138,7 +139,8 @@ usage(int code) " -s: PCI slot config\n" " -S: legacy PCI slot config\n" " -l: LPC device configuration\n" - " -m: memory size in MB\n", + " -m: memory size in MB\n" + " -w: ignore unimplemented MSRs\n", progname, (int)strlen(progname), ""); exit(code); @@ -316,20 +318,43 @@ vmexit_inout(struct vmctx *ctx, struct v static int vmexit_rdmsr(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu) { - fprintf(stderr, "vm exit rdmsr 0x%x, cpu %d\n", vme->u.msr.code, - *pvcpu); - return (VMEXIT_ABORT); + uint64_t val; + uint32_t eax, edx; + int error; + + val = 0; + error = emulate_rdmsr(ctx, *pvcpu, vme->u.msr.code, &val); + if (error != 0) { + fprintf(stderr, "rdmsr to register %#x on vcpu %d\n", + vme->u.msr.code, *pvcpu); + if (strictmsr) + return (VMEXIT_ABORT); + } + + eax = val; + error = vm_set_register(ctx, *pvcpu, VM_REG_GUEST_RAX, eax); + assert(error == 0); + + edx = val >> 32; + error = vm_set_register(ctx, *pvcpu, VM_REG_GUEST_RDX, edx); + assert(error == 0); + + return (VMEXIT_CONTINUE); } static int vmexit_wrmsr(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu) { - int newcpu; - int retval = VMEXIT_CONTINUE; - - newcpu = emulate_wrmsr(ctx, *pvcpu, vme->u.msr.code,vme->u.msr.wval); + int error; - return (retval); + error = emulate_wrmsr(ctx, *pvcpu, vme->u.msr.code, vme->u.msr.wval); + if (error != 0) { + fprintf(stderr, "wrmsr to register %#x(%#lx) on vcpu %d\n", + vme->u.msr.code, vme->u.msr.wval, *pvcpu); + if (strictmsr) + return (VMEXIT_ABORT); + } + return (VMEXIT_CONTINUE); } static int @@ -583,7 +608,7 @@ main(int argc, char *argv[]) guest_ncpus = 1; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:l:")) != -1) { + while ((c = getopt(argc, argv, "abehwAHIPWp:g:c:s:S:m:l:")) != -1) { switch (c) { case 'a': disable_x2apic = 1; @@ -642,6 +667,9 @@ main(int argc, char *argv[]) case 'e': strictio = 1; break; + case 'w': + strictmsr = 0; + break; case 'W': virtio_msix = 0; break; Modified: stable/10/usr.sbin/bhyve/xmsr.c ============================================================================== --- stable/10/usr.sbin/bhyve/xmsr.c Tue Apr 8 20:17:11 2014 (r264272) +++ stable/10/usr.sbin/bhyve/xmsr.c Tue Apr 8 20:40:54 2014 (r264273) @@ -43,6 +43,19 @@ int emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t val) { - printf("Unknown WRMSR code %x, val %lx, cpu %d\n", code, val, vcpu); - exit(1); + switch (code) { + case 0xd04: /* Sandy Bridge uncore PMC MSRs */ + case 0xc24: + return (0); + default: + break; + } + return (-1); +} + +int +emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t *val) +{ + + return (-1); } Modified: stable/10/usr.sbin/bhyve/xmsr.h ============================================================================== --- stable/10/usr.sbin/bhyve/xmsr.h Tue Apr 8 20:17:11 2014 (r264272) +++ stable/10/usr.sbin/bhyve/xmsr.h Tue Apr 8 20:40:54 2014 (r264273) @@ -30,5 +30,6 @@ #define _XMSR_H_ int emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t val); +int emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t *val); #endif From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 9 00:40:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 457B7680; Wed, 9 Apr 2014 00:40: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 31A1C1D38; Wed, 9 Apr 2014 00:40: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 s390eGOv025426; Wed, 9 Apr 2014 00:40:16 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s390eGTc025425; Wed, 9 Apr 2014 00:40:16 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404090040.s390eGTc025425@svn.freebsd.org> From: Glen Barber Date: Wed, 9 Apr 2014 00:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264286 - stable/10/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 00:40:16 -0000 Author: gjb Date: Wed Apr 9 00:40:15 2014 New Revision: 264286 URL: http://svnweb.freebsd.org/changeset/base/264286 Log: Document SA-14:05.nfsserver, SA-14:06.openssl. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Apr 8 23:16:19 2014 (r264285) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Wed Apr 9 00:40:15 2014 (r264286) @@ -135,6 +135,24 @@ BIND remote denial of service vulnerability + + + SA-14:05.nfsserver + + 8 April 2014 + + Deadlock in the NFS server + + + + SA-14:06.openssl + + 8 April 2014 + + OpenSSL multiple vulnerabilities + From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 9 01:26:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AB2E2DCB; Wed, 9 Apr 2014 01:26:58 +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 97239142F; Wed, 9 Apr 2014 01:26:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s391QwJl045755; Wed, 9 Apr 2014 01:26:58 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s391QwvD045754; Wed, 9 Apr 2014 01:26:58 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201404090126.s391QwvD045754@svn.freebsd.org> From: Peter Wemm Date: Wed, 9 Apr 2014 01:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264289 - head/sys/sys stable/10/sys/sys stable/9/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 01:26:58 -0000 Author: peter Date: Wed Apr 9 01:26:58 2014 New Revision: 264289 URL: http://svnweb.freebsd.org/changeset/base/264289 Log: Bump osreldate for tracking SA-14:06 Modified: stable/10/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/9/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Wed Apr 9 00:46:12 2014 (r264288) +++ stable/10/sys/sys/param.h Wed Apr 9 01:26:58 2014 (r264289) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000706 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000707 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 9 11:10:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7A6AA190; Wed, 9 Apr 2014 11:10: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 673EF1689; Wed, 9 Apr 2014 11:10: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 s39BAjxB087581; Wed, 9 Apr 2014 11:10:45 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s39BAjKf087580; Wed, 9 Apr 2014 11:10:45 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201404091110.s39BAjKf087580@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 9 Apr 2014 11:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264298 - stable/10/usr.sbin/IPXrouted X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 11:10:45 -0000 Author: glebius Date: Wed Apr 9 11:10:44 2014 New Revision: 264298 URL: http://svnweb.freebsd.org/changeset/base/264298 Log: Remove useless embedding of kernel struct rtentry into userland one. This is direct commit to stable/10. Sponsored by: Nginx, Inc. Modified: stable/10/usr.sbin/IPXrouted/table.h Modified: stable/10/usr.sbin/IPXrouted/table.h ============================================================================== --- stable/10/usr.sbin/IPXrouted/table.h Wed Apr 9 10:58:52 2014 (r264297) +++ stable/10/usr.sbin/IPXrouted/table.h Wed Apr 9 11:10:44 2014 (r264298) @@ -54,15 +54,10 @@ struct rthash { struct rt_entry *rt_back; }; -#ifdef RTM_ADD -#define rtentry ortentry -#endif - struct rt_entry { struct rt_entry *rt_forw; struct rt_entry *rt_back; union { - struct rtentry rtu_rt; struct rtuentry { u_long rtu_hash; struct sockaddr rtu_dst; From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 9 11:15:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8846834E; Wed, 9 Apr 2014 11:15: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 72777173C; Wed, 9 Apr 2014 11:15: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 s39BFqaA090776; Wed, 9 Apr 2014 11:15:52 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s39BFoOT090765; Wed, 9 Apr 2014 11:15:50 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201404091115.s39BFoOT090765@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 9 Apr 2014 11:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264299 - in stable/10: share/man/man4 share/man/man9 sys/net sys/sys usr.bin/netstat usr.sbin/ppp usr.sbin/route6d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 11:15:52 -0000 Author: glebius Date: Wed Apr 9 11:15:50 2014 New Revision: 264299 URL: http://svnweb.freebsd.org/changeset/base/264299 Log: Merge r263203: garbage collect long time obsoleted (or never used) stuff from routing API. Modified: stable/10/share/man/man4/route.4 stable/10/share/man/man9/rtentry.9 stable/10/sys/net/iso88025.h stable/10/sys/net/route.c stable/10/sys/net/route.h stable/10/sys/sys/sockio.h stable/10/usr.bin/netstat/netstat.1 stable/10/usr.bin/netstat/route.c stable/10/usr.sbin/ppp/route.c stable/10/usr.sbin/route6d/route6d.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/route.4 ============================================================================== --- stable/10/share/man/man4/route.4 Wed Apr 9 11:10:44 2014 (r264298) +++ stable/10/share/man/man4/route.4 Wed Apr 9 11:15:50 2014 (r264299) @@ -196,8 +196,6 @@ Messages include: #define RTM_REDIRECT 0x6 /* Told to use different route */ #define RTM_MISS 0x7 /* Lookup failed on this address */ #define RTM_LOCK 0x8 /* fix specified metrics */ -#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ -#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ #define RTM_RESOLVE 0xb /* request to resolve dst to LL addr - unused */ #define RTM_NEWADDR 0xc /* address being added to iface */ #define RTM_DELADDR 0xd /* address being removed from iface */ Modified: stable/10/share/man/man9/rtentry.9 ============================================================================== --- stable/10/share/man/man9/rtentry.9 Wed Apr 9 11:10:44 2014 (r264298) +++ stable/10/share/man/man9/rtentry.9 Wed Apr 9 11:15:50 2014 (r264299) @@ -157,8 +157,6 @@ Requests that output sent via this route .It Dv RTF_PROTO2 .It Dv RTF_PROTO3 Protocol-specific. -.It Dv RTF_PRCLONING -This flag is obsolete and simply ignored by facility. .It Dv RTF_PINNED (Reserved for future use to indicate routes which are not to be modified by a routing protocol.) Modified: stable/10/sys/net/iso88025.h ============================================================================== --- stable/10/sys/net/iso88025.h Wed Apr 9 11:10:44 2014 (r264298) +++ stable/10/sys/net/iso88025.h Wed Apr 9 11:15:50 2014 (r264299) @@ -162,11 +162,13 @@ struct iso88025_addr { #define ISO88025_BPF_UNSUPPORTED 0 #define ISO88025_BPF_SUPPORTED 1 +#ifdef _KERNEL void iso88025_ifattach (struct ifnet *, const u_int8_t *, int); void iso88025_ifdetach (struct ifnet *, int); int iso88025_ioctl (struct ifnet *, u_long, caddr_t ); int iso88025_output (struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); void iso88025_input (struct ifnet *, struct mbuf *); +#endif /* _KERNEL */ -#endif +#endif /* !_NET_ISO88025_H_ */ Modified: stable/10/sys/net/route.c ============================================================================== --- stable/10/sys/net/route.c Wed Apr 9 11:10:44 2014 (r264298) +++ stable/10/sys/net/route.c Wed Apr 9 11:15:50 2014 (r264299) @@ -1682,15 +1682,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int return (error); } -#ifndef BURN_BRIDGES -/* special one for inet internal use. may not use. */ -int -rtinit_fib(struct ifaddr *ifa, int cmd, int flags) -{ - return (rtinit1(ifa, cmd, flags, -1)); -} -#endif - /* * Set up a routing table entry, normally * for an interface. Modified: stable/10/sys/net/route.h ============================================================================== --- stable/10/sys/net/route.h Wed Apr 9 11:10:44 2014 (r264298) +++ stable/10/sys/net/route.h Wed Apr 9 11:15:50 2014 (r264299) @@ -84,10 +84,6 @@ struct rt_metrics { #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ extern u_int rt_numfibs; /* number fo usable routing tables */ -/* - * XXX kernel function pointer `rt_output' is visible to applications. - */ -struct mbuf; /* * We distinguish between routes to hosts and routes to networks, @@ -129,20 +125,6 @@ struct rtentry { }; #endif /* _KERNEL || _WANT_RTENTRY */ -/* - * Following structure necessary for 4.3 compatibility; - * We should eventually move it to a compat file. - */ -struct ortentry { - u_long rt_hash; /* to speed lookups */ - struct sockaddr rt_dst; /* key */ - struct sockaddr rt_gateway; /* value */ - short rt_flags; /* up/down?, host/net */ - short rt_refcnt; /* # held references */ - u_long rt_use; /* raw # packets forwarded */ - struct ifnet *rt_ifp; /* the answer: interface to use */ -}; - #define RTF_UP 0x1 /* route usable */ #define RTF_GATEWAY 0x2 /* destination is a gateway */ #define RTF_HOST 0x4 /* host entry (net otherwise) */ @@ -160,12 +142,7 @@ struct ortentry { #define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ #define RTF_PROTO2 0x4000 /* protocol specific routing flag */ #define RTF_PROTO1 0x8000 /* protocol specific routing flag */ - -/* XXX: temporary to stay API/ABI compatible with userland */ -#ifndef _KERNEL -#define RTF_PRCLONING 0x10000 /* unused, for compatibility */ -#endif - +/* 0x10000 unused, was RTF_PRCLONING */ /* 0x20000 unused, was RTF_WASCLONED */ #define RTF_PROTO3 0x40000 /* protocol specific routing flag */ /* 0x80000 unused */ @@ -227,8 +204,8 @@ struct rt_msghdr { #define RTM_REDIRECT 0x6 /* Told to use different route */ #define RTM_MISS 0x7 /* Lookup failed on this address */ #define RTM_LOCK 0x8 /* fix specified metrics */ -#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ -#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ + /* 0x9 */ + /* 0xa */ #define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ #define RTM_NEWADDR 0xc /* address being added to iface */ #define RTM_DELADDR 0xd /* address being removed from iface */ @@ -398,11 +375,6 @@ void rtredirect(struct sockaddr *, stru int rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **); -#ifndef BURN_BRIDGES -/* defaults to "all" FIBs */ -int rtinit_fib(struct ifaddr *, int, int); -#endif - /* XXX MRT NEW VERSIONS THAT USE FIBs * For now the protocol indepedent versions are the same as the AF_INET ones * but this will change.. Modified: stable/10/sys/sys/sockio.h ============================================================================== --- stable/10/sys/sys/sockio.h Wed Apr 9 11:10:44 2014 (r264298) +++ stable/10/sys/sys/sockio.h Wed Apr 9 11:15:50 2014 (r264299) @@ -44,8 +44,8 @@ #define SIOCSPGRP _IOW('s', 8, int) /* set process group */ #define SIOCGPGRP _IOR('s', 9, int) /* get process group */ -#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */ -#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */ +/* SIOCADDRT _IOW('r', 10, struct ortentry) 4.3BSD */ +/* SIOCDELRT _IOW('r', 11, struct ortentry) 4.3BSD */ #define SIOCGETVIFCNT _IOWR('r', 15, struct sioc_vif_req)/* get vif pkt cnt */ #define SIOCGETSGCNT _IOWR('r', 16, struct sioc_sg_req) /* get s,g pkt cnt */ Modified: stable/10/usr.bin/netstat/netstat.1 ============================================================================== --- stable/10/usr.bin/netstat/netstat.1 Wed Apr 9 11:10:44 2014 (r264298) +++ stable/10/usr.bin/netstat/netstat.1 Wed Apr 9 11:15:50 2014 (r264299) @@ -243,14 +243,6 @@ If is also present, show the contents of the internal Patricia tree structures; used for debugging. -If -.Fl a -is also present, -show protocol-cloned routes -(routes generated by an -.Dv RTF_PRCLONING -parent route); -normally these routes are not shown. When .Fl W is also present, @@ -430,8 +422,6 @@ The mapping between letters and flags is .It Li 3 Ta Dv RTF_PROTO3 Ta "Protocol specific routing flag #3" .It Li B Ta Dv RTF_BLACKHOLE Ta "Just discard pkts (during updates)" .It Li b Ta Dv RTF_BROADCAST Ta "The route represents a broadcast address" -.It Li C Ta Dv RTF_CLONING Ta "Generate new routes on use" -.It Li c Ta Dv RTF_PRCLONING Ta "Protocol-specified generate new routes on use" .It Li D Ta Dv RTF_DYNAMIC Ta "Created dynamically (by redirect)" .It Li G Ta Dv RTF_GATEWAY Ta "Destination requires forwarding by intermediary" .It Li H Ta Dv RTF_HOST Ta "Host entry (net otherwise)" @@ -440,7 +430,6 @@ The mapping between letters and flags is .It Li R Ta Dv RTF_REJECT Ta "Host or net unreachable" .It Li S Ta Dv RTF_STATIC Ta "Manually added" .It Li U Ta Dv RTF_UP Ta "Route usable" -.It Li W Ta Dv RTF_WASCLONED Ta "Route was generated as a result of cloning" .It Li X Ta Dv RTF_XRESOLVE Ta "External daemon translates proto to link address" .El .Pp Modified: stable/10/usr.bin/netstat/route.c ============================================================================== --- stable/10/usr.bin/netstat/route.c Wed Apr 9 11:10:44 2014 (r264298) +++ stable/10/usr.bin/netstat/route.c Wed Apr 9 11:15:50 2014 (r264299) @@ -92,19 +92,12 @@ struct bits { { RTF_STATIC, 'S' }, { RTF_PROTO1, '1' }, { RTF_PROTO2, '2' }, - { RTF_PRCLONING,'c' }, { RTF_PROTO3, '3' }, { RTF_BLACKHOLE,'B' }, { RTF_BROADCAST,'b' }, #ifdef RTF_LLINFO { RTF_LLINFO, 'L' }, #endif -#ifdef RTF_WASCLONED - { RTF_WASCLONED,'W' }, -#endif -#ifdef RTF_CLONING - { RTF_CLONING, 'C' }, -#endif { 0 , 0 } }; Modified: stable/10/usr.sbin/ppp/route.c ============================================================================== --- stable/10/usr.sbin/ppp/route.c Wed Apr 9 11:10:44 2014 (r264298) +++ stable/10/usr.sbin/ppp/route.c Wed Apr 9 11:15:50 2014 (r264299) @@ -158,26 +158,16 @@ static struct bits { { RTF_MODIFIED, 'M' }, { RTF_DONE, 'd' }, { RTF_XRESOLVE, 'X' }, -#ifdef RTF_CLONING - { RTF_CLONING, 'C' }, -#endif { RTF_STATIC, 'S' }, { RTF_PROTO1, '1' }, { RTF_PROTO2, '2' }, { RTF_BLACKHOLE, 'B' }, - #ifdef RTF_LLINFO { RTF_LLINFO, 'L' }, #endif #ifdef RTF_CLONING { RTF_CLONING, 'C' }, #endif -#ifdef RTF_WASCLONED - { RTF_WASCLONED, 'W' }, -#endif -#ifdef RTF_PRCLONING - { RTF_PRCLONING, 'c' }, -#endif #ifdef RTF_PROTO3 { RTF_PROTO3, '3' }, #endif @@ -187,10 +177,6 @@ static struct bits { { 0, '\0' } }; -#ifndef RTF_WASCLONED -#define RTF_WASCLONED (0) -#endif - static void p_flags(struct prompt *prompt, u_int32_t f, unsigned max) { @@ -434,7 +420,7 @@ route_IfDelete(struct bundle *bundle, in * route X was cloned from route Y (and is no longer there 'cos it * may have gone with route Y). */ - if (RTF_WASCLONED == 0 && pass == 0) + if (pass == 0) /* So we can't tell ! */ continue; for (cp = sp; cp < ep; cp += rtm->rtm_msglen) { @@ -461,8 +447,7 @@ route_IfDelete(struct bundle *bundle, in sa[RTAX_GATEWAY]->sa_family == AF_INET6 || #endif sa[RTAX_GATEWAY]->sa_family == AF_LINK) { - if ((pass == 0 && (rtm->rtm_flags & RTF_WASCLONED)) || - (pass == 1 && !(rtm->rtm_flags & RTF_WASCLONED))) { + if (pass == 1) { ncprange_setsa(&range, sa[RTAX_DST], sa[RTAX_NETMASK]); rt_Set(bundle, RTM_DELETE, &range, NULL, 0, 0); } else Modified: stable/10/usr.sbin/route6d/route6d.c ============================================================================== --- stable/10/usr.sbin/route6d/route6d.c Wed Apr 9 11:10:44 2014 (r264298) +++ stable/10/usr.sbin/route6d/route6d.c Wed Apr 9 11:15:50 2014 (r264299) @@ -1899,10 +1899,6 @@ rtrecv(void) if (!rt_deladdr(ifcp, rta[RTAX_IFA], rta[RTAX_NETMASK])) iface++; break; - case RTM_OLDADD: - case RTM_OLDDEL: - trace(1, "\tnot supported yet, ignored\n"); - break; } } @@ -2465,17 +2461,9 @@ do { \ RTTYPE("REDIRECT", RTM_REDIRECT); RTTYPE("MISS", RTM_MISS); RTTYPE("LOCK", RTM_LOCK); - RTTYPE("OLDADD", RTM_OLDADD); - RTTYPE("OLDDEL", RTM_OLDDEL); RTTYPE("NEWADDR", RTM_NEWADDR); RTTYPE("DELADDR", RTM_DELADDR); RTTYPE("IFINFO", RTM_IFINFO); -#ifdef RTM_OLDADD - RTTYPE("OLDADD", RTM_OLDADD); -#endif -#ifdef RTM_OLDDEL - RTTYPE("OLDDEL", RTM_OLDDEL); -#endif #ifdef RTM_OIFINFO RTTYPE("OIFINFO", RTM_OIFINFO); #endif @@ -2516,18 +2504,9 @@ do { \ #ifdef RTF_MASK RTFLAG("m", RTF_MASK); #endif -#ifdef RTF_CLONING - RTFLAG("C", RTF_CLONING); -#endif #ifdef RTF_CLONED RTFLAG("c", RTF_CLONED); #endif -#ifdef RTF_PRCLONING - RTFLAG("c", RTF_PRCLONING); -#endif -#ifdef RTF_WASCLONED - RTFLAG("W", RTF_WASCLONED); -#endif RTFLAG("X", RTF_XRESOLVE); #ifdef RTF_LLINFO RTFLAG("L", RTF_LLINFO); From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 9 13:35:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DD739A95; Wed, 9 Apr 2014 13:35: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 B01B71862; Wed, 9 Apr 2014 13:35: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 s39DZdra049606; Wed, 9 Apr 2014 13:35:39 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s39DZdVc049605; Wed, 9 Apr 2014 13:35:39 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404091335.s39DZdVc049605@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 9 Apr 2014 13:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264300 - stable/10/sbin/geom/class/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 13:35:40 -0000 Author: ae Date: Wed Apr 9 13:35:39 2014 New Revision: 264300 URL: http://svnweb.freebsd.org/changeset/base/264300 Log: MFC r264039: Document more parition types. Modified: stable/10/sbin/geom/class/part/gpart.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/10/sbin/geom/class/part/gpart.8 Wed Apr 9 11:15:50 2014 (r264299) +++ stable/10/sbin/geom/class/part/gpart.8 Wed Apr 9 13:35:39 2014 (r264300) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2013 +.Dd April 2, 2014 .Dt GPART 8 .Os .Sh NAME @@ -557,6 +557,16 @@ Interface (EFI). In such cases, the GPT partitioning scheme is used and the actual partition type for the system partition can also be specified as .Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" . +.It Cm fat16 +A partition that contains a FAT16 filesystem. +The scheme-specific type is +.Qq Li "!6" +for MBR. +.It Cm fat32 +A partition that contains a FAT32 filesystem. +The scheme-specific type is +.Qq Li "!11" +for MBR. .It Cm freebsd A .Fx @@ -620,6 +630,16 @@ A partition that is sub-partitioned by a This type is known as .Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. +.It Cm ms-basic-data +A basic data partition (BDP) for Microsoft operating systems. +In the GPT this type is the equivalent to partition types +.Cm fat16 , fat32 +and +.Cm ntfs +in MBR. +The scheme-specific type is +.Qq Li "!ebd0a0a2-b9e5-4433-87c0-68b6b72699c7" +for GPT. .It Cm ms-ldm-data A partition that contains Logical Disk Manager (LDM) volumes. The scheme-specific types are @@ -632,6 +652,11 @@ A partition that contains Logical Disk M The scheme-specific type is .Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3" for GPT. +.It Cm ntfs +A partition that contains a NTFS or exFAT filesystem. +The scheme-specific type is +.Qq Li "!7" +for MBR. .El .Sh ATTRIBUTES The scheme-specific attributes for EBR: From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 9 18:17:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3C8E59D4; Wed, 9 Apr 2014 18:17: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 258981B9C; Wed, 9 Apr 2014 18:17: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 s39IH3wv067647; Wed, 9 Apr 2014 18:17:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s39IH2ga067633; Wed, 9 Apr 2014 18:17:02 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201404091817.s39IH2ga067633@svn.freebsd.org> From: Dimitry Andric Date: Wed, 9 Apr 2014 18:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264303 - in stable: 10/bin 10/gnu/usr.bin 10/lib 10/lib/clang 10/sbin 10/share/mk 10/usr.bin 10/usr.bin/clang 10/usr.sbin 8/bin 8/gnu/usr.bin 8/lib 8/sbin 8/share/mk 8/usr.bin 8/usr.sb... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 18:17:04 -0000 Author: dim Date: Wed Apr 9 18:16:58 2014 New Revision: 264303 URL: http://svnweb.freebsd.org/changeset/base/264303 Log: MFC r263778: Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process all the SUBDIR entries in parallel, instead of serially. Apply this option to a selected number of Makefiles, which can greatly speed up the build on multi-core machines, when using make -j. This can be extended to more Makefiles later on, whenever they are verified to work correctly with parallel building. I tested this on a 24-core machine, with make -j48 buildworld (N = 6): before stddev after stddev ======= ====== ======= ====== real time 1741.1 16.5 959.8 2.7 user time 12468.7 16.4 14393.0 16.8 sys time 1825.0 54.8 2110.6 22.8 (user+sys)/real 8.2 17.1 E.g. the build was approximately 45% faster in real time. On machines with less cores, or with lower -j settings, the speedup will not be as impressive. But at least you can now almost max out a machine with buildworld! Submitted by: jilles MFC r263833: Enable parallel building for gnu/usr.bin and usr.bin/clang too. Modified: stable/10/bin/Makefile stable/10/gnu/usr.bin/Makefile stable/10/lib/Makefile stable/10/lib/clang/Makefile stable/10/sbin/Makefile stable/10/share/mk/bsd.subdir.mk stable/10/usr.bin/Makefile stable/10/usr.bin/clang/Makefile stable/10/usr.sbin/Makefile Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/bin/Makefile stable/8/gnu/usr.bin/Makefile (contents, props changed) stable/8/lib/Makefile (contents, props changed) stable/8/sbin/Makefile stable/8/share/mk/bsd.subdir.mk stable/8/usr.bin/Makefile stable/8/usr.sbin/Makefile (contents, props changed) stable/9/bin/Makefile stable/9/gnu/usr.bin/Makefile stable/9/lib/Makefile (contents, props changed) stable/9/lib/clang/Makefile stable/9/sbin/Makefile stable/9/share/mk/bsd.subdir.mk stable/9/usr.bin/Makefile stable/9/usr.bin/clang/Makefile stable/9/usr.sbin/Makefile (contents, props changed) Directory Properties: stable/8/bin/ (props changed) stable/8/gnu/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/lib/ (props changed) stable/8/sbin/ (props changed) stable/8/share/ (props changed) stable/8/share/mk/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.sbin/ (props changed) stable/9/bin/ (props changed) stable/9/lib/ (props changed) stable/9/lib/clang/ (props changed) stable/9/sbin/ (props changed) stable/9/share/ (props changed) stable/9/share/mk/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/clang/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/10/bin/Makefile ============================================================================== --- stable/10/bin/Makefile Wed Apr 9 14:50:55 2014 (r264302) +++ stable/10/bin/Makefile Wed Apr 9 18:16:58 2014 (r264303) @@ -60,4 +60,6 @@ SUBDIR+= tests SUBDIR:= ${SUBDIR:O} +SUBDIR_PARALLEL= + .include Modified: stable/10/gnu/usr.bin/Makefile ============================================================================== --- stable/10/gnu/usr.bin/Makefile Wed Apr 9 14:50:55 2014 (r264302) +++ stable/10/gnu/usr.bin/Makefile Wed Apr 9 18:16:58 2014 (r264303) @@ -46,4 +46,6 @@ _cc= cc _gdb= gdb .endif +SUBDIR_PARALLEL= + .include Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Wed Apr 9 14:50:55 2014 (r264302) +++ stable/10/lib/Makefile Wed Apr 9 18:16:58 2014 (r264303) @@ -271,4 +271,8 @@ afterinstall: ${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include .endif +.if !make(install) +SUBDIR_PARALLEL= +.endif + .include Modified: stable/10/lib/clang/Makefile ============================================================================== --- stable/10/lib/clang/Makefile Wed Apr 9 14:50:55 2014 (r264302) +++ stable/10/lib/clang/Makefile Wed Apr 9 18:16:58 2014 (r264303) @@ -147,4 +147,6 @@ SUBDIR+=liblldb \ SUBDIR+= include +SUBDIR_PARALLEL= + .include Modified: stable/10/sbin/Makefile ============================================================================== --- stable/10/sbin/Makefile Wed Apr 9 14:50:55 2014 (r264302) +++ stable/10/sbin/Makefile Wed Apr 9 18:16:58 2014 (r264303) @@ -118,4 +118,6 @@ SUBDIR+= routed SUBDIR:= ${SUBDIR:O} +SUBDIR_PARALLEL= + .include Modified: stable/10/share/mk/bsd.subdir.mk ============================================================================== --- stable/10/share/mk/bsd.subdir.mk Wed Apr 9 14:50:55 2014 (r264302) +++ stable/10/share/mk/bsd.subdir.mk Wed Apr 9 18:16:58 2014 (r264303) @@ -71,7 +71,26 @@ ${SUBDIR}: .PHONY .MAKE .for __target in all all-man checkdpadd clean cleandepend cleandir \ cleanilinks depend distribute lint maninstall manlint obj objlink \ realinstall regress tags ${SUBDIR_TARGETS} +.ifdef SUBDIR_PARALLEL +.for __dir in ${SUBDIR} +${__target}: ${__target}_subdir_${__dir} +${__target}_subdir_${__dir}: .MAKE + @${_+_}set -e; \ + if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ + ${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \ + edir=${__dir}.${MACHINE_ARCH}; \ + cd ${.CURDIR}/$${edir}; \ + else \ + ${ECHODIR} "===> ${DIRPRFX}${__dir} (${__target:realinstall=install})"; \ + edir=${__dir}; \ + cd ${.CURDIR}/$${edir}; \ + fi; \ + ${MAKE} ${__target:realinstall=install} \ + DIRPRFX=${DIRPRFX}$$edir/ +.endfor +.else ${__target}: _SUBDIR +.endif .endfor .for __target in files includes Modified: stable/10/usr.bin/Makefile ============================================================================== --- stable/10/usr.bin/Makefile Wed Apr 9 14:50:55 2014 (r264302) +++ stable/10/usr.bin/Makefile Wed Apr 9 18:16:58 2014 (r264303) @@ -376,4 +376,6 @@ SUBDIR+= svn SUBDIR:= ${SUBDIR:O} +SUBDIR_PARALLEL= + .include Modified: stable/10/usr.bin/clang/Makefile ============================================================================== --- stable/10/usr.bin/clang/Makefile Wed Apr 9 14:50:55 2014 (r264302) +++ stable/10/usr.bin/clang/Makefile Wed Apr 9 18:16:58 2014 (r264303) @@ -29,4 +29,6 @@ SUBDIR+=lldb .endif .endif # TOOLS_PREFIX +SUBDIR_PARALLEL= + .include Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Wed Apr 9 14:50:55 2014 (r264302) +++ stable/10/usr.sbin/Makefile Wed Apr 9 18:16:58 2014 (r264303) @@ -324,4 +324,6 @@ SUBDIR+= wpa SUBDIR:= ${SUBDIR:O} +SUBDIR_PARALLEL= + .include From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 10 07:00:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 30A81842; Thu, 10 Apr 2014 07:00: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 1C7911A99; Thu, 10 Apr 2014 07:00: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 s3A70Pg0085188; Thu, 10 Apr 2014 07:00:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3A70PjE085186; Thu, 10 Apr 2014 07:00:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201404100700.s3A70PjE085186@svn.freebsd.org> From: Dimitry Andric Date: Thu, 10 Apr 2014 07:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264312 - in stable: 10/contrib/binutils/opcodes 8/contrib/binutils/include/opcode 9/contrib/binutils/opcodes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 07:00:26 -0000 Author: dim Date: Thu Apr 10 07:00:24 2014 New Revision: 264312 URL: http://svnweb.freebsd.org/changeset/base/264312 Log: MFC r264238: For GNU as, add two missing modes for each of the fcomip and fucomip instructions. Partially obtained from OpenBSD by Pedro Giffuni, while I added the fcomip variants. Apparently this should help with compiling certain variants of WebKit. Modified: stable/10/contrib/binutils/opcodes/i386-opc.tbl stable/10/contrib/binutils/opcodes/i386-tbl.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/contrib/binutils/include/opcode/i386.h stable/9/contrib/binutils/opcodes/i386-opc.tbl stable/9/contrib/binutils/opcodes/i386-tbl.h Directory Properties: stable/9/contrib/binutils/ (props changed) Modified: stable/10/contrib/binutils/opcodes/i386-opc.tbl ============================================================================== --- stable/10/contrib/binutils/opcodes/i386-opc.tbl Thu Apr 10 05:04:23 2014 (r264311) +++ stable/10/contrib/binutils/opcodes/i386-opc.tbl Thu Apr 10 07:00:24 2014 (r264312) @@ -895,10 +895,14 @@ fucomi, 2, 0xdbe8, None, Cpu686, ShortFo fucomi, 0, 0xdbe9, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { 0 } fucomi, 1, 0xdbe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg } fcomip, 2, 0xdff0, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } +fcomip, 0, 0xdff1, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { 0 } +fcomip, 1, 0xdff0, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg } fcompi, 2, 0xdff0, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } fcompi, 0, 0xdff1, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { 0 } fcompi, 1, 0xdff0, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg } fucomip, 2, 0xdfe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } +fucomip, 0, 0xdfe9, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { 0 } +fucomip, 1, 0xdfe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg } fucompi, 2, 0xdfe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } fucompi, 0, 0xdfe9, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { 0 } fucompi, 1, 0xdfe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg } Modified: stable/10/contrib/binutils/opcodes/i386-tbl.h ============================================================================== --- stable/10/contrib/binutils/opcodes/i386-tbl.h Thu Apr 10 05:04:23 2014 (r264311) +++ stable/10/contrib/binutils/opcodes/i386-tbl.h Thu Apr 10 07:00:24 2014 (r264312) @@ -2236,6 +2236,12 @@ const template i386_optab[] = ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } }, + { "fcomip", 0, 0xdff1, None, Cpu686, + ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, + { 0 } }, + { "fcomip", 1, 0xdff0, None, Cpu686, + ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, + { FloatReg } }, { "fcompi", 2, 0xdff0, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, @@ -2250,6 +2256,12 @@ const template i386_optab[] = ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } }, + { "fucomip", 0, 0xdfe9, None, Cpu686, + ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, + { 0 } }, + { "fucomip", 1, 0xdfe8, None, Cpu686, + ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, + { FloatReg } }, { "fucompi", 2, 0xdfe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 10 19:51:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1A24759F; Thu, 10 Apr 2014 19:51: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 EE8B41BE6; Thu, 10 Apr 2014 19:51: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 s3AJpYQx004864; Thu, 10 Apr 2014 19:51:34 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AJpXnj004858; Thu, 10 Apr 2014 19:51:33 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201404101951.s3AJpXnj004858@svn.freebsd.org> From: Alan Somers Date: Thu, 10 Apr 2014 19:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264325 - in stable/10: . usr.sbin/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 19:51:35 -0000 Author: asomers Date: Thu Apr 10 19:51:33 2014 New Revision: 264325 URL: http://svnweb.freebsd.org/changeset/base/264325 Log: MFC r263429 Fix kern/187712: config(8) does not respect KERNCONFDIR. The impact of this bug is that you cannot build a kernel if both of the following are true: 1) The kernel config file is in a non-default location 2) The kernel config file uses the "include" statement from config(5). usr.sbin/config/main.c usr.sbin/config/config.8 usr.sbin/config/config.h usr.sbin/config/lang.l Added a "-I path" option to config(8). By analogy to cc(1), it adds an extra path in which the "include" statement will search for files. Makefile.inc1 Pass "-I ${KERNCONFDIR}" to config(8). Modified: stable/10/Makefile.inc1 stable/10/usr.sbin/config/config.8 stable/10/usr.sbin/config/config.h stable/10/usr.sbin/config/lang.l stable/10/usr.sbin/config/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Thu Apr 10 19:15:58 2014 (r264324) +++ stable/10/Makefile.inc1 Thu Apr 10 19:51:33 2014 (r264325) @@ -1000,7 +1000,7 @@ buildkernel: cd ${KRNLCONFDIR}; \ PATH=${TMPPATH} \ config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ - ${KERNCONFDIR}/${_kernel} + -I ${KERNCONFDIR} ${KERNCONFDIR}/${_kernel} .endif .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) @echo Modified: stable/10/usr.sbin/config/config.8 ============================================================================== --- stable/10/usr.sbin/config/config.8 Thu Apr 10 19:15:58 2014 (r264324) +++ stable/10/usr.sbin/config/config.8 Thu Apr 10 19:51:33 2014 (r264325) @@ -37,6 +37,7 @@ .Sh SYNOPSIS .Nm .Op Fl CVgp +.Op Fl I Ar path .Op Fl d Ar destdir .Ar SYSTEM_NAME .Nm @@ -69,6 +70,12 @@ If the INCLUDE_CONFIG_FILE is present in kernel image will contain full configuration files included literally (preserving comments). This flag is kept for backward compatibility. +.It Fl I Ar path +Search in +.Ar path +for any file included by the +.Ic include +directive. This option may be specified more than once. .It Fl d Ar destdir Use .Ar destdir Modified: stable/10/usr.sbin/config/config.h ============================================================================== --- stable/10/usr.sbin/config/config.h Thu Apr 10 19:15:58 2014 (r264324) +++ stable/10/usr.sbin/config/config.h Thu Apr 10 19:51:33 2014 (r264325) @@ -144,6 +144,13 @@ struct hint { STAILQ_HEAD(hint_head, hint) hints; +struct includepath { + char *path; + SLIST_ENTRY(includepath) path_next; +}; + +SLIST_HEAD(, includepath) includepath; + /* * Tag present in the kernelconf.tmlp template file. It's mandatory for those * two strings to be the same. Otherwise you'll get into trouble. Modified: stable/10/usr.sbin/config/lang.l ============================================================================== --- stable/10/usr.sbin/config/lang.l Thu Apr 10 19:15:58 2014 (r264324) +++ stable/10/usr.sbin/config/lang.l Thu Apr 10 19:51:33 2014 (r264325) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "y.tab.h" #include "config.h" @@ -257,6 +258,7 @@ include(const char *fname, int ateof) { FILE *fp; struct incl *in; + struct includepath* ipath; char *fnamebuf; fnamebuf = NULL; @@ -269,6 +271,17 @@ include(const char *fname, int ateof) } } if (fp == NULL) { + SLIST_FOREACH(ipath, &includepath, path_next) { + asprintf(&fnamebuf, "%s/%s", ipath->path, fname); + if (fnamebuf != NULL) { + fp = fopen(fnamebuf, "r"); + free(fnamebuf); + } + if (fp != NULL) + break; + } + } + if (fp == NULL) { yyerror("cannot open included file"); return (-1); } Modified: stable/10/usr.sbin/config/main.c ============================================================================== --- stable/10/usr.sbin/config/main.c Thu Apr 10 19:15:58 2014 (r264324) +++ stable/10/usr.sbin/config/main.c Thu Apr 10 19:51:33 2014 (r264325) @@ -110,15 +110,25 @@ main(int argc, char **argv) int ch, len; char *p; char *kernfile; + struct includepath* ipath; int printmachine; printmachine = 0; kernfile = NULL; - while ((ch = getopt(argc, argv, "Cd:gmpVx:")) != -1) + SLIST_INIT(&includepath); + while ((ch = getopt(argc, argv, "CI:d:gmpVx:")) != -1) switch (ch) { case 'C': filebased = 1; break; + case 'I': + ipath = (struct includepath *) \ + calloc(1, sizeof (struct includepath)); + if (ipath == NULL) + err(EXIT_FAILURE, "calloc"); + ipath->path = optarg; + SLIST_INSERT_HEAD(&includepath, ipath, path_next); + break; case 'm': printmachine = 1; break; From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 10 21:53:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 62C78585; Thu, 10 Apr 2014 21:53: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 4EB7218FF; Thu, 10 Apr 2014 21:53: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 s3ALrpXh059276; Thu, 10 Apr 2014 21:53:51 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ALro0c059274; Thu, 10 Apr 2014 21:53:50 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201404102153.s3ALro0c059274@svn.freebsd.org> From: Joerg Wunsch Date: Thu, 10 Apr 2014 21:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264328 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 21:53:51 -0000 Author: joerg Date: Thu Apr 10 21:53:50 2014 New Revision: 264328 URL: http://svnweb.freebsd.org/changeset/base/264328 Log: Merge r264084: make the Dresden Elektronik "USB Level Shifter Low Cost" known to the FTDI driver. Modified: stable/10/sys/dev/usb/serial/uftdi.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/10/sys/dev/usb/serial/uftdi.c Thu Apr 10 21:03:46 2014 (r264327) +++ stable/10/sys/dev/usb/serial/uftdi.c Thu Apr 10 21:53:50 2014 (r264328) @@ -235,6 +235,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(CONTEC, COM1USBH, UFTDI_TYPE_AUTO), UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, UFTDI_TYPE_8U232AM), UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, UFTDI_TYPE_8U232AM), + UFTDI_DEV(DRESDENELEKTRONIK, LEVELSHIFTERSTICKLOWCOST, UFTDI_TYPE_8U232AM), UFTDI_DEV(ELEKTOR, FT323R, UFTDI_TYPE_AUTO), UFTDI_DEV(EVOLUTION, ER1, UFTDI_TYPE_AUTO), UFTDI_DEV(EVOLUTION, HYBRID, UFTDI_TYPE_AUTO), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Thu Apr 10 21:03:46 2014 (r264327) +++ stable/10/sys/dev/usb/usbdevs Thu Apr 10 21:53:50 2014 (r264328) @@ -1650,6 +1650,7 @@ product DRAYTEK VIGOR550 0x0550 Vigor550 /* dresden elektronik products */ product DRESDENELEKTRONIK SENSORTERMINALBOARD 0x0001 SensorTerminalBoard product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL 0x0004 Wireless Handheld Terminal +product DRESDENELEKTRONIK LEVELSHIFTERSTICKLOWCOST 0x0022 Levelshifter Stick Low Cost /* Dynastream Innovations */ product DYNASTREAM ANTDEVBOARD 0x1003 ANT dev board From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 10 22:39:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4272A6BC; Thu, 10 Apr 2014 22:39: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 2A0151C99; Thu, 10 Apr 2014 22:39: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 s3AMdRXU076663; Thu, 10 Apr 2014 22:39:27 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AMdOYK076647; Thu, 10 Apr 2014 22:39:24 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201404102239.s3AMdOYK076647@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 10 Apr 2014 22:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264331 - in stable/10: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 22:39:27 -0000 Author: jkim Date: Thu Apr 10 22:39:22 2014 New Revision: 264331 URL: http://svnweb.freebsd.org/changeset/base/264331 Log: MFC: r261037, r264278 Merge OpenSSL 1.0.1f and 1.0.1g. Modified: stable/10/crypto/openssl/CHANGES stable/10/crypto/openssl/Configure stable/10/crypto/openssl/FAQ stable/10/crypto/openssl/Makefile stable/10/crypto/openssl/Makefile.org stable/10/crypto/openssl/NEWS stable/10/crypto/openssl/README stable/10/crypto/openssl/apps/Makefile stable/10/crypto/openssl/apps/apps.c stable/10/crypto/openssl/apps/apps.h stable/10/crypto/openssl/apps/crl.c stable/10/crypto/openssl/apps/dgst.c stable/10/crypto/openssl/apps/ecparam.c stable/10/crypto/openssl/apps/openssl.c stable/10/crypto/openssl/apps/pkcs12.c stable/10/crypto/openssl/apps/req.c stable/10/crypto/openssl/config stable/10/crypto/openssl/crypto/Makefile stable/10/crypto/openssl/crypto/aes/asm/aes-parisc.pl stable/10/crypto/openssl/crypto/aes/asm/bsaes-x86_64.pl stable/10/crypto/openssl/crypto/aes/asm/vpaes-x86_64.pl stable/10/crypto/openssl/crypto/armcap.c stable/10/crypto/openssl/crypto/asn1/a_int.c stable/10/crypto/openssl/crypto/asn1/asn1_err.c stable/10/crypto/openssl/crypto/bio/bss_dgram.c stable/10/crypto/openssl/crypto/bio/bss_log.c stable/10/crypto/openssl/crypto/bn/Makefile stable/10/crypto/openssl/crypto/bn/asm/mips-mont.pl stable/10/crypto/openssl/crypto/bn/asm/mips.pl stable/10/crypto/openssl/crypto/bn/asm/parisc-mont.pl stable/10/crypto/openssl/crypto/bn/asm/x86_64-gf2m.pl stable/10/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl stable/10/crypto/openssl/crypto/bn/bn_nist.c stable/10/crypto/openssl/crypto/buffer/buffer.c stable/10/crypto/openssl/crypto/buffer/buffer.h stable/10/crypto/openssl/crypto/cms/cms_lib.c stable/10/crypto/openssl/crypto/cryptlib.c stable/10/crypto/openssl/crypto/ec/ec_ameth.c stable/10/crypto/openssl/crypto/ec/ec_asn1.c stable/10/crypto/openssl/crypto/ec/ec_lib.c stable/10/crypto/openssl/crypto/engine/eng_list.c stable/10/crypto/openssl/crypto/engine/eng_rdrand.c stable/10/crypto/openssl/crypto/evp/Makefile stable/10/crypto/openssl/crypto/evp/bio_b64.c stable/10/crypto/openssl/crypto/evp/digest.c stable/10/crypto/openssl/crypto/evp/e_aes.c stable/10/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c stable/10/crypto/openssl/crypto/evp/e_des3.c stable/10/crypto/openssl/crypto/evp/p5_crpt2.c stable/10/crypto/openssl/crypto/modes/Makefile stable/10/crypto/openssl/crypto/modes/asm/ghash-parisc.pl stable/10/crypto/openssl/crypto/modes/cbc128.c stable/10/crypto/openssl/crypto/modes/ccm128.c stable/10/crypto/openssl/crypto/modes/cts128.c stable/10/crypto/openssl/crypto/modes/gcm128.c stable/10/crypto/openssl/crypto/modes/modes_lcl.h stable/10/crypto/openssl/crypto/opensslv.h stable/10/crypto/openssl/crypto/pariscid.pl stable/10/crypto/openssl/crypto/pem/pem_info.c stable/10/crypto/openssl/crypto/pkcs12/p12_crt.c stable/10/crypto/openssl/crypto/rand/md_rand.c stable/10/crypto/openssl/crypto/rand/rand.h stable/10/crypto/openssl/crypto/rand/rand_err.c stable/10/crypto/openssl/crypto/rand/rand_lib.c stable/10/crypto/openssl/crypto/rc4/asm/rc4-parisc.pl stable/10/crypto/openssl/crypto/rsa/rsa_ameth.c stable/10/crypto/openssl/crypto/rsa/rsa_chk.c stable/10/crypto/openssl/crypto/rsa/rsa_pmeth.c stable/10/crypto/openssl/crypto/sha/Makefile stable/10/crypto/openssl/crypto/sha/asm/sha1-parisc.pl stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl stable/10/crypto/openssl/crypto/sha/asm/sha512-mips.pl stable/10/crypto/openssl/crypto/sha/asm/sha512-parisc.pl stable/10/crypto/openssl/crypto/sha/sha512.c stable/10/crypto/openssl/crypto/srp/srp_grps.h stable/10/crypto/openssl/crypto/srp/srp_lib.c stable/10/crypto/openssl/crypto/symhacks.h stable/10/crypto/openssl/crypto/x509/by_dir.c stable/10/crypto/openssl/crypto/x509/x509_vfy.c stable/10/crypto/openssl/crypto/x509/x_all.c stable/10/crypto/openssl/crypto/x86cpuid.pl stable/10/crypto/openssl/doc/apps/cms.pod stable/10/crypto/openssl/doc/apps/config.pod stable/10/crypto/openssl/doc/apps/crl.pod stable/10/crypto/openssl/doc/apps/ec.pod stable/10/crypto/openssl/doc/apps/pkcs12.pod stable/10/crypto/openssl/doc/apps/req.pod stable/10/crypto/openssl/doc/apps/rsa.pod stable/10/crypto/openssl/doc/apps/s_client.pod stable/10/crypto/openssl/doc/apps/s_server.pod stable/10/crypto/openssl/doc/apps/smime.pod stable/10/crypto/openssl/doc/apps/ts.pod stable/10/crypto/openssl/doc/apps/tsget.pod stable/10/crypto/openssl/doc/crypto/BN_BLINDING_new.pod stable/10/crypto/openssl/doc/crypto/ERR_get_error.pod stable/10/crypto/openssl/doc/crypto/EVP_BytesToKey.pod stable/10/crypto/openssl/doc/crypto/EVP_EncryptInit.pod stable/10/crypto/openssl/doc/crypto/X509_STORE_CTX_get_error.pod stable/10/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod stable/10/crypto/openssl/doc/crypto/ecdsa.pod stable/10/crypto/openssl/doc/crypto/pem.pod stable/10/crypto/openssl/doc/ssl/SSL_COMP_add_compression_method.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_add_session.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_load_verify_locations.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_client_CA_list.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_session_id_context.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_ssl_version.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_verify.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_use_psk_identity_hint.pod stable/10/crypto/openssl/doc/ssl/SSL_accept.pod stable/10/crypto/openssl/doc/ssl/SSL_clear.pod stable/10/crypto/openssl/doc/ssl/SSL_connect.pod stable/10/crypto/openssl/doc/ssl/SSL_do_handshake.pod stable/10/crypto/openssl/doc/ssl/SSL_read.pod stable/10/crypto/openssl/doc/ssl/SSL_session_reused.pod stable/10/crypto/openssl/doc/ssl/SSL_set_fd.pod stable/10/crypto/openssl/doc/ssl/SSL_set_session.pod stable/10/crypto/openssl/doc/ssl/SSL_set_shutdown.pod stable/10/crypto/openssl/doc/ssl/SSL_shutdown.pod stable/10/crypto/openssl/doc/ssl/SSL_write.pod stable/10/crypto/openssl/e_os.h stable/10/crypto/openssl/engines/ccgost/gost89.h stable/10/crypto/openssl/engines/ccgost/gosthash.c stable/10/crypto/openssl/ssl/d1_both.c stable/10/crypto/openssl/ssl/d1_clnt.c stable/10/crypto/openssl/ssl/d1_lib.c stable/10/crypto/openssl/ssl/d1_pkt.c stable/10/crypto/openssl/ssl/d1_srvr.c stable/10/crypto/openssl/ssl/kssl.h stable/10/crypto/openssl/ssl/s23_clnt.c stable/10/crypto/openssl/ssl/s3_both.c stable/10/crypto/openssl/ssl/s3_clnt.c stable/10/crypto/openssl/ssl/s3_lib.c stable/10/crypto/openssl/ssl/s3_pkt.c stable/10/crypto/openssl/ssl/s3_srvr.c stable/10/crypto/openssl/ssl/ssl.h stable/10/crypto/openssl/ssl/ssl3.h stable/10/crypto/openssl/ssl/ssl_lib.c stable/10/crypto/openssl/ssl/ssl_locl.h stable/10/crypto/openssl/ssl/ssltest.c stable/10/crypto/openssl/ssl/t1_enc.c stable/10/crypto/openssl/ssl/t1_lib.c stable/10/crypto/openssl/ssl/tls1.h stable/10/crypto/openssl/util/libeay.num stable/10/crypto/openssl/util/pl/BC-32.pl stable/10/crypto/openssl/util/pl/VC-32.pl stable/10/crypto/openssl/util/shlib_wrap.sh stable/10/secure/lib/libcrypto/Makefile.inc stable/10/secure/lib/libcrypto/amd64/bsaes-x86_64.S stable/10/secure/lib/libcrypto/amd64/vpaes-x86_64.S stable/10/secure/lib/libcrypto/i386/x86cpuid.s stable/10/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/10/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/10/secure/lib/libcrypto/man/BIO_ctrl.3 stable/10/secure/lib/libcrypto/man/BIO_f_base64.3 stable/10/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/10/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/10/secure/lib/libcrypto/man/BIO_f_md.3 stable/10/secure/lib/libcrypto/man/BIO_f_null.3 stable/10/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/10/secure/lib/libcrypto/man/BIO_find_type.3 stable/10/secure/lib/libcrypto/man/BIO_new.3 stable/10/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/10/secure/lib/libcrypto/man/BIO_push.3 stable/10/secure/lib/libcrypto/man/BIO_read.3 stable/10/secure/lib/libcrypto/man/BIO_s_accept.3 stable/10/secure/lib/libcrypto/man/BIO_s_bio.3 stable/10/secure/lib/libcrypto/man/BIO_s_connect.3 stable/10/secure/lib/libcrypto/man/BIO_s_fd.3 stable/10/secure/lib/libcrypto/man/BIO_s_file.3 stable/10/secure/lib/libcrypto/man/BIO_s_mem.3 stable/10/secure/lib/libcrypto/man/BIO_s_null.3 stable/10/secure/lib/libcrypto/man/BIO_s_socket.3 stable/10/secure/lib/libcrypto/man/BIO_set_callback.3 stable/10/secure/lib/libcrypto/man/BIO_should_retry.3 stable/10/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_start.3 stable/10/secure/lib/libcrypto/man/BN_add.3 stable/10/secure/lib/libcrypto/man/BN_add_word.3 stable/10/secure/lib/libcrypto/man/BN_bn2bin.3 stable/10/secure/lib/libcrypto/man/BN_cmp.3 stable/10/secure/lib/libcrypto/man/BN_copy.3 stable/10/secure/lib/libcrypto/man/BN_generate_prime.3 stable/10/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/10/secure/lib/libcrypto/man/BN_new.3 stable/10/secure/lib/libcrypto/man/BN_num_bytes.3 stable/10/secure/lib/libcrypto/man/BN_rand.3 stable/10/secure/lib/libcrypto/man/BN_set_bit.3 stable/10/secure/lib/libcrypto/man/BN_swap.3 stable/10/secure/lib/libcrypto/man/BN_zero.3 stable/10/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/10/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/10/secure/lib/libcrypto/man/CMS_compress.3 stable/10/secure/lib/libcrypto/man/CMS_decrypt.3 stable/10/secure/lib/libcrypto/man/CMS_encrypt.3 stable/10/secure/lib/libcrypto/man/CMS_final.3 stable/10/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_type.3 stable/10/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/10/secure/lib/libcrypto/man/CMS_sign.3 stable/10/secure/lib/libcrypto/man/CMS_sign_add1_signer.3 stable/10/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/10/secure/lib/libcrypto/man/CMS_uncompress.3 stable/10/secure/lib/libcrypto/man/CMS_verify.3 stable/10/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/10/secure/lib/libcrypto/man/CONF_modules_free.3 stable/10/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/10/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/10/secure/lib/libcrypto/man/DH_generate_key.3 stable/10/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DH_new.3 stable/10/secure/lib/libcrypto/man/DH_set_method.3 stable/10/secure/lib/libcrypto/man/DH_size.3 stable/10/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/10/secure/lib/libcrypto/man/DSA_do_sign.3 stable/10/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/10/secure/lib/libcrypto/man/DSA_generate_key.3 stable/10/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DSA_new.3 stable/10/secure/lib/libcrypto/man/DSA_set_method.3 stable/10/secure/lib/libcrypto/man/DSA_sign.3 stable/10/secure/lib/libcrypto/man/DSA_size.3 stable/10/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/10/secure/lib/libcrypto/man/ERR_clear_error.3 stable/10/secure/lib/libcrypto/man/ERR_error_string.3 stable/10/secure/lib/libcrypto/man/ERR_get_error.3 stable/10/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/10/secure/lib/libcrypto/man/ERR_load_strings.3 stable/10/secure/lib/libcrypto/man/ERR_print_errors.3 stable/10/secure/lib/libcrypto/man/ERR_put_error.3 stable/10/secure/lib/libcrypto/man/ERR_remove_state.3 stable/10/secure/lib/libcrypto/man/ERR_set_mark.3 stable/10/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/10/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/10/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/10/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/10/secure/lib/libcrypto/man/EVP_SealInit.3 stable/10/secure/lib/libcrypto/man/EVP_SignInit.3 stable/10/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/10/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/10/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/10/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/10/secure/lib/libcrypto/man/OPENSSL_config.3 stable/10/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/10/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/10/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/10/secure/lib/libcrypto/man/PKCS12_create.3 stable/10/secure/lib/libcrypto/man/PKCS12_parse.3 stable/10/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/10/secure/lib/libcrypto/man/PKCS7_verify.3 stable/10/secure/lib/libcrypto/man/RAND_add.3 stable/10/secure/lib/libcrypto/man/RAND_bytes.3 stable/10/secure/lib/libcrypto/man/RAND_cleanup.3 stable/10/secure/lib/libcrypto/man/RAND_egd.3 stable/10/secure/lib/libcrypto/man/RAND_load_file.3 stable/10/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/10/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/10/secure/lib/libcrypto/man/RSA_check_key.3 stable/10/secure/lib/libcrypto/man/RSA_generate_key.3 stable/10/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/RSA_new.3 stable/10/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/10/secure/lib/libcrypto/man/RSA_print.3 stable/10/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_set_method.3 stable/10/secure/lib/libcrypto/man/RSA_sign.3 stable/10/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/10/secure/lib/libcrypto/man/RSA_size.3 stable/10/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/10/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/10/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/10/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/10/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/10/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/10/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/10/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/10/secure/lib/libcrypto/man/X509_new.3 stable/10/secure/lib/libcrypto/man/X509_verify_cert.3 stable/10/secure/lib/libcrypto/man/bio.3 stable/10/secure/lib/libcrypto/man/blowfish.3 stable/10/secure/lib/libcrypto/man/bn.3 stable/10/secure/lib/libcrypto/man/bn_internal.3 stable/10/secure/lib/libcrypto/man/buffer.3 stable/10/secure/lib/libcrypto/man/crypto.3 stable/10/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/10/secure/lib/libcrypto/man/d2i_DHparams.3 stable/10/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/10/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_X509.3 stable/10/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/10/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/10/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/10/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/10/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/10/secure/lib/libcrypto/man/des.3 stable/10/secure/lib/libcrypto/man/dh.3 stable/10/secure/lib/libcrypto/man/dsa.3 stable/10/secure/lib/libcrypto/man/ecdsa.3 stable/10/secure/lib/libcrypto/man/engine.3 stable/10/secure/lib/libcrypto/man/err.3 stable/10/secure/lib/libcrypto/man/evp.3 stable/10/secure/lib/libcrypto/man/hmac.3 stable/10/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/10/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/10/secure/lib/libcrypto/man/lh_stats.3 stable/10/secure/lib/libcrypto/man/lhash.3 stable/10/secure/lib/libcrypto/man/md5.3 stable/10/secure/lib/libcrypto/man/mdc2.3 stable/10/secure/lib/libcrypto/man/pem.3 stable/10/secure/lib/libcrypto/man/rand.3 stable/10/secure/lib/libcrypto/man/rc4.3 stable/10/secure/lib/libcrypto/man/ripemd.3 stable/10/secure/lib/libcrypto/man/rsa.3 stable/10/secure/lib/libcrypto/man/sha.3 stable/10/secure/lib/libcrypto/man/threads.3 stable/10/secure/lib/libcrypto/man/ui.3 stable/10/secure/lib/libcrypto/man/ui_compat.3 stable/10/secure/lib/libcrypto/man/x509.3 stable/10/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/10/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/10/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/10/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_free.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/10/secure/lib/libssl/man/SSL_CTX_new.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 stable/10/secure/lib/libssl/man/SSL_SESSION_free.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/10/secure/lib/libssl/man/SSL_accept.3 stable/10/secure/lib/libssl/man/SSL_alert_type_string.3 stable/10/secure/lib/libssl/man/SSL_clear.3 stable/10/secure/lib/libssl/man/SSL_connect.3 stable/10/secure/lib/libssl/man/SSL_do_handshake.3 stable/10/secure/lib/libssl/man/SSL_free.3 stable/10/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/10/secure/lib/libssl/man/SSL_get_ciphers.3 stable/10/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/10/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/10/secure/lib/libssl/man/SSL_get_error.3 stable/10/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/10/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_get_fd.3 stable/10/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/10/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/10/secure/lib/libssl/man/SSL_get_psk_identity.3 stable/10/secure/lib/libssl/man/SSL_get_rbio.3 stable/10/secure/lib/libssl/man/SSL_get_session.3 stable/10/secure/lib/libssl/man/SSL_get_verify_result.3 stable/10/secure/lib/libssl/man/SSL_get_version.3 stable/10/secure/lib/libssl/man/SSL_library_init.3 stable/10/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/10/secure/lib/libssl/man/SSL_new.3 stable/10/secure/lib/libssl/man/SSL_pending.3 stable/10/secure/lib/libssl/man/SSL_read.3 stable/10/secure/lib/libssl/man/SSL_rstate_string.3 stable/10/secure/lib/libssl/man/SSL_session_reused.3 stable/10/secure/lib/libssl/man/SSL_set_bio.3 stable/10/secure/lib/libssl/man/SSL_set_connect_state.3 stable/10/secure/lib/libssl/man/SSL_set_fd.3 stable/10/secure/lib/libssl/man/SSL_set_session.3 stable/10/secure/lib/libssl/man/SSL_set_shutdown.3 stable/10/secure/lib/libssl/man/SSL_set_verify_result.3 stable/10/secure/lib/libssl/man/SSL_shutdown.3 stable/10/secure/lib/libssl/man/SSL_state_string.3 stable/10/secure/lib/libssl/man/SSL_want.3 stable/10/secure/lib/libssl/man/SSL_write.3 stable/10/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/10/secure/lib/libssl/man/ssl.3 stable/10/secure/usr.bin/openssl/man/CA.pl.1 stable/10/secure/usr.bin/openssl/man/asn1parse.1 stable/10/secure/usr.bin/openssl/man/ca.1 stable/10/secure/usr.bin/openssl/man/ciphers.1 stable/10/secure/usr.bin/openssl/man/cms.1 stable/10/secure/usr.bin/openssl/man/crl.1 stable/10/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/10/secure/usr.bin/openssl/man/dgst.1 stable/10/secure/usr.bin/openssl/man/dhparam.1 stable/10/secure/usr.bin/openssl/man/dsa.1 stable/10/secure/usr.bin/openssl/man/dsaparam.1 stable/10/secure/usr.bin/openssl/man/ec.1 stable/10/secure/usr.bin/openssl/man/ecparam.1 stable/10/secure/usr.bin/openssl/man/enc.1 stable/10/secure/usr.bin/openssl/man/errstr.1 stable/10/secure/usr.bin/openssl/man/gendsa.1 stable/10/secure/usr.bin/openssl/man/genpkey.1 stable/10/secure/usr.bin/openssl/man/genrsa.1 stable/10/secure/usr.bin/openssl/man/nseq.1 stable/10/secure/usr.bin/openssl/man/ocsp.1 stable/10/secure/usr.bin/openssl/man/openssl.1 stable/10/secure/usr.bin/openssl/man/passwd.1 stable/10/secure/usr.bin/openssl/man/pkcs12.1 stable/10/secure/usr.bin/openssl/man/pkcs7.1 stable/10/secure/usr.bin/openssl/man/pkcs8.1 stable/10/secure/usr.bin/openssl/man/pkey.1 stable/10/secure/usr.bin/openssl/man/pkeyparam.1 stable/10/secure/usr.bin/openssl/man/pkeyutl.1 stable/10/secure/usr.bin/openssl/man/rand.1 stable/10/secure/usr.bin/openssl/man/req.1 stable/10/secure/usr.bin/openssl/man/rsa.1 stable/10/secure/usr.bin/openssl/man/rsautl.1 stable/10/secure/usr.bin/openssl/man/s_client.1 stable/10/secure/usr.bin/openssl/man/s_server.1 stable/10/secure/usr.bin/openssl/man/s_time.1 stable/10/secure/usr.bin/openssl/man/sess_id.1 stable/10/secure/usr.bin/openssl/man/smime.1 stable/10/secure/usr.bin/openssl/man/speed.1 stable/10/secure/usr.bin/openssl/man/spkac.1 stable/10/secure/usr.bin/openssl/man/ts.1 stable/10/secure/usr.bin/openssl/man/tsget.1 stable/10/secure/usr.bin/openssl/man/verify.1 stable/10/secure/usr.bin/openssl/man/version.1 stable/10/secure/usr.bin/openssl/man/x509.1 stable/10/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/crypto/openssl/CHANGES ============================================================================== --- stable/10/crypto/openssl/CHANGES Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/CHANGES Thu Apr 10 22:39:22 2014 (r264331) @@ -2,9 +2,60 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1f and 1.0.1g [7 Apr 2014] + + *) A missing bounds check in the handling of the TLS heartbeat extension + can be used to reveal up to 64k of memory to a connected client or + server. + + Thanks for Neel Mehta of Google Security for discovering this bug and to + Adam Langley and Bodo Moeller for + preparing the fix (CVE-2014-0160) + [Adam Langley, Bodo Moeller] + + *) Fix for the attack described in the paper "Recovering OpenSSL + ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack" + by Yuval Yarom and Naomi Benger. Details can be obtained from: + http://eprint.iacr.org/2014/140 + + Thanks to Yuval Yarom and Naomi Benger for discovering this + flaw and to Yuval Yarom for supplying a fix (CVE-2014-0076) + [Yuval Yarom and Naomi Benger] + + *) TLS pad extension: draft-agl-tls-padding-03 + + Workaround for the "TLS hang bug" (see FAQ and PR#2771): if the + TLS client Hello record length value would otherwise be > 255 and + less that 512 pad with a dummy extension containing zeroes so it + is at least 512 bytes long. + + [Adam Langley, Steve Henson] + + Changes between 1.0.1e and 1.0.1f [6 Jan 2014] + + *) Fix for TLS record tampering bug. A carefully crafted invalid + handshake could crash OpenSSL with a NULL pointer exception. + Thanks to Anton Johansson for reporting this issues. + (CVE-2013-4353) + + *) Keep original DTLS digest and encryption contexts in retransmission + structures so we can use the previous session parameters if they need + to be resent. (CVE-2013-6450) + [Steve Henson] + + *) Add option SSL_OP_SAFARI_ECDHE_ECDSA_BUG (part of SSL_OP_ALL) which + avoids preferring ECDHE-ECDSA ciphers when the client appears to be + Safari on OS X. Safari on OS X 10.8..10.8.3 advertises support for + several ECDHE-ECDSA ciphers, but fails to negotiate them. The bug + is fixed in OS X 10.8.4, but Apple have ruled out both hot fixing + 10.8..10.8.3 and forcing users to upgrade to 10.8.4 or newer. + [Rob Stradling, Adam Langley] + Changes between 1.0.1d and 1.0.1e [11 Feb 2013] - *) + *) Correct fix for CVE-2013-0169. The original didn't work on AES-NI + supporting platforms or when small records were transferred. + [Andy Polyakov, Steve Henson] Changes between 1.0.1c and 1.0.1d [5 Feb 2013] @@ -404,6 +455,63 @@ Add command line options to s_client/s_server. [Steve Henson] + Changes between 1.0.0j and 1.0.0k [5 Feb 2013] + + *) Make the decoding of SSLv3, TLS and DTLS CBC records constant time. + + This addresses the flaw in CBC record processing discovered by + Nadhem Alfardan and Kenny Paterson. Details of this attack can be found + at: http://www.isg.rhul.ac.uk/tls/ + + Thanks go to Nadhem Alfardan and Kenny Paterson of the Information + Security Group at Royal Holloway, University of London + (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and + Emilia Käsper for the initial patch. + (CVE-2013-0169) + [Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson] + + *) Return an error when checking OCSP signatures when key is NULL. + This fixes a DoS attack. (CVE-2013-0166) + [Steve Henson] + + *) Call OCSP Stapling callback after ciphersuite has been chosen, so + the right response is stapled. Also change SSL_get_certificate() + so it returns the certificate actually sent. + See http://rt.openssl.org/Ticket/Display.html?id=2836. + (This is a backport) + [Rob Stradling ] + + *) Fix possible deadlock when decoding public keys. + [Steve Henson] + + Changes between 1.0.0i and 1.0.0j [10 May 2012] + + [NB: OpenSSL 1.0.0i and later 1.0.0 patch levels were released after + OpenSSL 1.0.1.] + + *) Sanity check record length before skipping explicit IV in DTLS + to fix DoS attack. + + Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic + fuzzing as a service testing platform. + (CVE-2012-2333) + [Steve Henson] + + *) Initialise tkeylen properly when encrypting CMS messages. + Thanks to Solar Designer of Openwall for reporting this issue. + [Steve Henson] + + Changes between 1.0.0h and 1.0.0i [19 Apr 2012] + + *) Check for potentially exploitable overflows in asn1_d2i_read_bio + BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer + in CRYPTO_realloc_clean. + + Thanks to Tavis Ormandy, Google Security Team, for discovering this + issue and to Adam Langley for fixing it. + (CVE-2012-2110) + [Adam Langley (Google), Tavis Ormandy, Google Security Team] + Changes between 1.0.0g and 1.0.0h [12 Mar 2012] *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness @@ -1394,6 +1502,86 @@ *) Change 'Configure' script to enable Camellia by default. [NTT] + Changes between 0.9.8x and 0.9.8y [5 Feb 2013] + + *) Make the decoding of SSLv3, TLS and DTLS CBC records constant time. + + This addresses the flaw in CBC record processing discovered by + Nadhem Alfardan and Kenny Paterson. Details of this attack can be found + at: http://www.isg.rhul.ac.uk/tls/ + + Thanks go to Nadhem Alfardan and Kenny Paterson of the Information + Security Group at Royal Holloway, University of London + (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and + Emilia Käsper for the initial patch. + (CVE-2013-0169) + [Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson] + + *) Return an error when checking OCSP signatures when key is NULL. + This fixes a DoS attack. (CVE-2013-0166) + [Steve Henson] + + *) Call OCSP Stapling callback after ciphersuite has been chosen, so + the right response is stapled. Also change SSL_get_certificate() + so it returns the certificate actually sent. + See http://rt.openssl.org/Ticket/Display.html?id=2836. + (This is a backport) + [Rob Stradling ] + + *) Fix possible deadlock when decoding public keys. + [Steve Henson] + + Changes between 0.9.8w and 0.9.8x [10 May 2012] + + *) Sanity check record length before skipping explicit IV in DTLS + to fix DoS attack. + + Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic + fuzzing as a service testing platform. + (CVE-2012-2333) + [Steve Henson] + + *) Initialise tkeylen properly when encrypting CMS messages. + Thanks to Solar Designer of Openwall for reporting this issue. + [Steve Henson] + + Changes between 0.9.8v and 0.9.8w [23 Apr 2012] + + *) The fix for CVE-2012-2110 did not take into account that the + 'len' argument to BUF_MEM_grow and BUF_MEM_grow_clean is an + int in OpenSSL 0.9.8, making it still vulnerable. Fix by + rejecting negative len parameter. (CVE-2012-2131) + [Tomas Hoger ] + + Changes between 0.9.8u and 0.9.8v [19 Apr 2012] + + *) Check for potentially exploitable overflows in asn1_d2i_read_bio + BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer + in CRYPTO_realloc_clean. + + Thanks to Tavis Ormandy, Google Security Team, for discovering this + issue and to Adam Langley for fixing it. + (CVE-2012-2110) + [Adam Langley (Google), Tavis Ormandy, Google Security Team] + + Changes between 0.9.8t and 0.9.8u [12 Mar 2012] + + *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness + in CMS and PKCS7 code. When RSA decryption fails use a random key for + content decryption and always return the same error. Note: this attack + needs on average 2^20 messages so it only affects automated senders. The + old behaviour can be reenabled in the CMS code by setting the + CMS_DEBUG_DECRYPT flag: this is useful for debugging and testing where + an MMA defence is not necessary. + Thanks to Ivan Nestlerode for discovering + this issue. (CVE-2012-0884) + [Steve Henson] + + *) Fix CVE-2011-4619: make sure we really are receiving a + client hello before rejecting multiple SGC restarts. Thanks to + Ivan Nestlerode for discovering this bug. + [Steve Henson] + Changes between 0.9.8s and 0.9.8t [18 Jan 2012] *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109. @@ -1401,7 +1589,7 @@ Development, Cisco Systems, Inc. for discovering this bug and preparing a fix. (CVE-2012-0050) [Antonio Martin] - + Changes between 0.9.8r and 0.9.8s [4 Jan 2012] *) Nadhem Alfardan and Kenny Paterson have discovered an extension Modified: stable/10/crypto/openssl/Configure ============================================================================== --- stable/10/crypto/openssl/Configure Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/Configure Thu Apr 10 22:39:22 2014 (r264331) @@ -178,7 +178,7 @@ my %table=( "debug-ben-no-opt", "gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::", "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", -"debug-bodo", "gcc:$gcc_devteam_warn -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", +"debug-bodo", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll", "debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -526,7 +526,7 @@ my %table=( # 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE' "VC-WIN32","cl:-W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", # Unified CE target -"debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", +"debug-VC-WIN32","cl:-W3 -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", "VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", # Borland C++ 4.5 Modified: stable/10/crypto/openssl/FAQ ============================================================================== --- stable/10/crypto/openssl/FAQ Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/FAQ Thu Apr 10 22:39:22 2014 (r264331) @@ -768,6 +768,9 @@ openssl-security@openssl.org if you don' acknowledging receipt then resend or mail it directly to one of the more active team members (e.g. Steve). +Note that bugs only present in the openssl utility are not in general +considered to be security issues. + [PROG] ======================================================================== * Is OpenSSL thread-safe? Modified: stable/10/crypto/openssl/Makefile ============================================================================== --- stable/10/crypto/openssl/Makefile Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/Makefile Thu Apr 10 22:39:22 2014 (r264331) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1e +VERSION=1.0.1g MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 @@ -304,7 +304,8 @@ libcrypto$(SHLIB_EXT): libcrypto.a fips_ FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \ export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \ fi; \ - $(MAKE) -e SHLIBDIRS=crypto build-shared; \ + $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \ + (touch -c fips_premain_dso$(EXE_EXT) || :); \ else \ echo "There's no support for shared libraries on this platform" >&2; \ exit 1; \ Modified: stable/10/crypto/openssl/Makefile.org ============================================================================== --- stable/10/crypto/openssl/Makefile.org Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/Makefile.org Thu Apr 10 22:39:22 2014 (r264331) @@ -302,7 +302,8 @@ libcrypto$(SHLIB_EXT): libcrypto.a fips_ FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \ export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \ fi; \ - $(MAKE) -e SHLIBDIRS=crypto build-shared; \ + $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \ + (touch -c fips_premain_dso$(EXE_EXT) || :); \ else \ echo "There's no support for shared libraries on this platform" >&2; \ exit 1; \ Modified: stable/10/crypto/openssl/NEWS ============================================================================== --- stable/10/crypto/openssl/NEWS Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/NEWS Thu Apr 10 22:39:22 2014 (r264331) @@ -5,11 +5,24 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. - Major changes between OpenSSL 1.0.1d and OpenSSL 1.0.1e: + Major changes between OpenSSL 1.0.1f and OpenSSL 1.0.1g [7 Apr 2014] + + o Fix for CVE-2014-0160 + o Add TLS padding extension workaround for broken servers. + o Fix for CVE-2014-0076 + + Major changes between OpenSSL 1.0.1e and OpenSSL 1.0.1f [6 Jan 2014] + + o Don't include gmt_unix_time in TLS server and client random values + o Fix for TLS record tampering bug CVE-2013-4353 + o Fix for TLS version checking bug CVE-2013-6449 + o Fix for DTLS retransmission bug CVE-2013-6450 + + Major changes between OpenSSL 1.0.1d and OpenSSL 1.0.1e [11 Feb 2013]: o Corrected fix for CVE-2013-0169 - Major changes between OpenSSL 1.0.1c and OpenSSL 1.0.1d: + Major changes between OpenSSL 1.0.1c and OpenSSL 1.0.1d [4 Feb 2013]: o Fix renegotiation in TLS 1.1, 1.2 by using the correct TLS version. o Include the fips configuration module. @@ -17,24 +30,24 @@ o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169 o Fix for TLS AESNI record handling flaw CVE-2012-2686 - Major changes between OpenSSL 1.0.1b and OpenSSL 1.0.1c: + Major changes between OpenSSL 1.0.1b and OpenSSL 1.0.1c [10 May 2012]: o Fix TLS/DTLS record length checking bug CVE-2012-2333 o Don't attempt to use non-FIPS composite ciphers in FIPS mode. - Major changes between OpenSSL 1.0.1a and OpenSSL 1.0.1b: + Major changes between OpenSSL 1.0.1a and OpenSSL 1.0.1b [26 Apr 2012]: o Fix compilation error on non-x86 platforms. o Make FIPS capable OpenSSL ciphers work in non-FIPS mode. o Fix SSL_OP_NO_TLSv1_1 clash with SSL_OP_ALL in OpenSSL 1.0.0 - Major changes between OpenSSL 1.0.1 and OpenSSL 1.0.1a: + Major changes between OpenSSL 1.0.1 and OpenSSL 1.0.1a [19 Apr 2012]: o Fix for ASN1 overflow bug CVE-2012-2110 o Workarounds for some servers that hang on long client hellos. o Fix SEGV in AES code. - Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.1: + Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.1 [14 Mar 2012]: o TLS/DTLS heartbeat support. o SCTP support. @@ -47,17 +60,30 @@ o Preliminary FIPS capability for unvalidated 2.0 FIPS module. o SRP support. - Major changes between OpenSSL 1.0.0g and OpenSSL 1.0.0h: + Major changes between OpenSSL 1.0.0j and OpenSSL 1.0.0k [5 Feb 2013]: + + o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169 + o Fix OCSP bad key DoS attack CVE-2013-0166 + + Major changes between OpenSSL 1.0.0i and OpenSSL 1.0.0j [10 May 2012]: + + o Fix DTLS record length checking bug CVE-2012-2333 + + Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.0i [19 Apr 2012]: + + o Fix for ASN1 overflow bug CVE-2012-2110 + + Major changes between OpenSSL 1.0.0g and OpenSSL 1.0.0h [12 Mar 2012]: o Fix for CMS/PKCS#7 MMA CVE-2012-0884 o Corrected fix for CVE-2011-4619 o Various DTLS fixes. - Major changes between OpenSSL 1.0.0f and OpenSSL 1.0.0g: + Major changes between OpenSSL 1.0.0f and OpenSSL 1.0.0g [18 Jan 2012]: o Fix for DTLS DoS issue CVE-2012-0050 - Major changes between OpenSSL 1.0.0e and OpenSSL 1.0.0f: + Major changes between OpenSSL 1.0.0e and OpenSSL 1.0.0f [4 Jan 2012]: o Fix for DTLS plaintext recovery attack CVE-2011-4108 o Clear block padding bytes of SSL 3.0 records CVE-2011-4576 @@ -65,7 +91,7 @@ o Check parameters are not NULL in GOST ENGINE CVE-2012-0027 o Check for malformed RFC3779 data CVE-2011-4577 - Major changes between OpenSSL 1.0.0d and OpenSSL 1.0.0e: + Major changes between OpenSSL 1.0.0d and OpenSSL 1.0.0e [6 Sep 2011]: o Fix for CRL vulnerability issue CVE-2011-3207 o Fix for ECDH crashes CVE-2011-3210 @@ -73,11 +99,11 @@ o Support ECDH ciphersuites for certificates using SHA2 algorithms. o Various DTLS fixes. - Major changes between OpenSSL 1.0.0c and OpenSSL 1.0.0d: + Major changes between OpenSSL 1.0.0c and OpenSSL 1.0.0d [8 Feb 2011]: o Fix for security issue CVE-2011-0014 - Major changes between OpenSSL 1.0.0b and OpenSSL 1.0.0c: + Major changes between OpenSSL 1.0.0b and OpenSSL 1.0.0c [2 Dec 2010]: o Fix for security issue CVE-2010-4180 o Fix for CVE-2010-4252 @@ -85,18 +111,18 @@ o Fix various platform compilation issues. o Corrected fix for security issue CVE-2010-3864. - Major changes between OpenSSL 1.0.0a and OpenSSL 1.0.0b: + Major changes between OpenSSL 1.0.0a and OpenSSL 1.0.0b [16 Nov 2010]: o Fix for security issue CVE-2010-3864. o Fix for CVE-2010-2939 o Fix WIN32 build system for GOST ENGINE. - Major changes between OpenSSL 1.0.0 and OpenSSL 1.0.0a: + Major changes between OpenSSL 1.0.0 and OpenSSL 1.0.0a [1 Jun 2010]: o Fix for security issue CVE-2010-1633. o GOST MAC and CFB fixes. - Major changes between OpenSSL 0.9.8n and OpenSSL 1.0.0: + Major changes between OpenSSL 0.9.8n and OpenSSL 1.0.0 [29 Mar 2010]: o RFC3280 path validation: sufficient to process PKITS tests. o Integrated support for PVK files and keyblobs. @@ -119,20 +145,55 @@ o Opaque PRF Input TLS extension support. o Updated time routines to avoid OS limitations. - Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r: + Major changes between OpenSSL 0.9.8x and OpenSSL 0.9.8y [5 Feb 2013]: + + o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169 + o Fix OCSP bad key DoS attack CVE-2013-0166 + + Major changes between OpenSSL 0.9.8w and OpenSSL 0.9.8x [10 May 2012]: + + o Fix DTLS record length checking bug CVE-2012-2333 + + Major changes between OpenSSL 0.9.8v and OpenSSL 0.9.8w [23 Apr 2012]: + + o Fix for CVE-2012-2131 (corrected fix for 0.9.8 and CVE-2012-2110) + + Major changes between OpenSSL 0.9.8u and OpenSSL 0.9.8v [19 Apr 2012]: + + o Fix for ASN1 overflow bug CVE-2012-2110 + + Major changes between OpenSSL 0.9.8t and OpenSSL 0.9.8u [12 Mar 2012]: + + o Fix for CMS/PKCS#7 MMA CVE-2012-0884 + o Corrected fix for CVE-2011-4619 + o Various DTLS fixes. + + Major changes between OpenSSL 0.9.8s and OpenSSL 0.9.8t [18 Jan 2012]: + + o Fix for DTLS DoS issue CVE-2012-0050 + + Major changes between OpenSSL 0.9.8r and OpenSSL 0.9.8s [4 Jan 2012]: + + o Fix for DTLS plaintext recovery attack CVE-2011-4108 + o Fix policy check double free error CVE-2011-4109 + o Clear block padding bytes of SSL 3.0 records CVE-2011-4576 + o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619 + o Check for malformed RFC3779 data CVE-2011-4577 + + Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r [8 Feb 2011]: o Fix for security issue CVE-2011-0014 - Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q: + Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q [2 Dec 2010]: o Fix for security issue CVE-2010-4180 o Fix for CVE-2010-4252 - Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p: + Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p [16 Nov 2010]: o Fix for security issue CVE-2010-3864. - Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o: + Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o [1 Jun 2010]: o Fix for security issue CVE-2010-0742. o Various DTLS fixes. @@ -140,12 +201,12 @@ o Fix for no-rc4 compilation. o Chil ENGINE unload workaround. - Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n: + Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n [24 Mar 2010]: o CFB cipher definition fixes. o Fix security issues CVE-2010-0740 and CVE-2010-0433. - Major changes between OpenSSL 0.9.8l and OpenSSL 0.9.8m: + Major changes between OpenSSL 0.9.8l and OpenSSL 0.9.8m [25 Feb 2010]: o Cipher definition fixes. o Workaround for slow RAND_poll() on some WIN32 versions. @@ -157,33 +218,33 @@ o Ticket and SNI coexistence fixes. o Many fixes to DTLS handling. - Major changes between OpenSSL 0.9.8k and OpenSSL 0.9.8l: + Major changes between OpenSSL 0.9.8k and OpenSSL 0.9.8l [5 Nov 2009]: o Temporary work around for CVE-2009-3555: disable renegotiation. - Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k: + Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k [25 Mar 2009]: o Fix various build issues. o Fix security issues (CVE-2009-0590, CVE-2009-0591, CVE-2009-0789) - Major changes between OpenSSL 0.9.8i and OpenSSL 0.9.8j: + Major changes between OpenSSL 0.9.8i and OpenSSL 0.9.8j [7 Jan 2009]: o Fix security issue (CVE-2008-5077) o Merge FIPS 140-2 branch code. - Major changes between OpenSSL 0.9.8g and OpenSSL 0.9.8h: + Major changes between OpenSSL 0.9.8g and OpenSSL 0.9.8h [28 May 2008]: o CryptoAPI ENGINE support. o Various precautionary measures. o Fix for bugs affecting certificate request creation. o Support for local machine keyset attribute in PKCS#12 files. - Major changes between OpenSSL 0.9.8f and OpenSSL 0.9.8g: + Major changes between OpenSSL 0.9.8f and OpenSSL 0.9.8g [19 Oct 2007]: o Backport of CMS functionality to 0.9.8. o Fixes for bugs introduced with 0.9.8f. - Major changes between OpenSSL 0.9.8e and OpenSSL 0.9.8f: + Major changes between OpenSSL 0.9.8e and OpenSSL 0.9.8f [11 Oct 2007]: o Add gcc 4.2 support. o Add support for AES and SSE2 assembly lanugauge optimization @@ -194,23 +255,23 @@ o RFC4507bis support. o TLS Extensions support. - Major changes between OpenSSL 0.9.8d and OpenSSL 0.9.8e: + Major changes between OpenSSL 0.9.8d and OpenSSL 0.9.8e [23 Feb 2007]: o Various ciphersuite selection fixes. o RFC3779 support. - Major changes between OpenSSL 0.9.8c and OpenSSL 0.9.8d: + Major changes between OpenSSL 0.9.8c and OpenSSL 0.9.8d [28 Sep 2006]: o Introduce limits to prevent malicious key DoS (CVE-2006-2940) o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343) o Changes to ciphersuite selection algorithm - Major changes between OpenSSL 0.9.8b and OpenSSL 0.9.8c: + Major changes between OpenSSL 0.9.8b and OpenSSL 0.9.8c [5 Sep 2006]: o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339 o New cipher Camellia - Major changes between OpenSSL 0.9.8a and OpenSSL 0.9.8b: + Major changes between OpenSSL 0.9.8a and OpenSSL 0.9.8b [4 May 2006]: o Cipher string fixes. o Fixes for VC++ 2005. @@ -220,12 +281,12 @@ o Built in dynamic engine compilation support on Win32. o Fixes auto dynamic engine loading in Win32. - Major changes between OpenSSL 0.9.8 and OpenSSL 0.9.8a: + Major changes between OpenSSL 0.9.8 and OpenSSL 0.9.8a [11 Oct 2005]: o Fix potential SSL 2.0 rollback, CVE-2005-2969 o Extended Windows CE support - Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.8: + Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.8 [5 Jul 2005]: o Major work on the BIGNUM library for higher efficiency and to make operations more streamlined and less contradictory. This @@ -299,36 +360,36 @@ o Added initial support for Win64. o Added alternate pkg-config files. - Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m: + Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m [23 Feb 2007]: o FIPS 1.1.1 module linking. o Various ciphersuite selection fixes. - Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l: + Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l [28 Sep 2006]: o Introduce limits to prevent malicious key DoS (CVE-2006-2940) o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343) - Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k: + Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k [5 Sep 2006]: o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339 - Major changes between OpenSSL 0.9.7i and OpenSSL 0.9.7j: + Major changes between OpenSSL 0.9.7i and OpenSSL 0.9.7j [4 May 2006]: o Visual C++ 2005 fixes. o Update Windows build system for FIPS. - Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i: + Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i [14 Oct 2005]: o Give EVP_MAX_MD_SIZE it's old value, except for a FIPS build. - Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h: + Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h [11 Oct 2005]: o Fix SSL 2.0 Rollback, CVE-2005-2969 o Allow use of fixed-length exponent on DSA signing o Default fixed-window RSA, DSA, DH private-key operations - Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g: + Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g [11 Apr 2005]: o More compilation issues fixed. o Adaptation to more modern Kerberos API. @@ -337,7 +398,7 @@ o More constification. o Added processing of proxy certificates (RFC 3820). - Major changes between OpenSSL 0.9.7e and OpenSSL 0.9.7f: + Major changes between OpenSSL 0.9.7e and OpenSSL 0.9.7f [22 Mar 2005]: o Several compilation issues fixed. o Many memory allocation failure checks added. @@ -345,12 +406,12 @@ o Mandatory basic checks on certificates. o Performance improvements. - Major changes between OpenSSL 0.9.7d and OpenSSL 0.9.7e: + Major changes between OpenSSL 0.9.7d and OpenSSL 0.9.7e [25 Oct 2004]: o Fix race condition in CRL checking code. o Fixes to PKCS#7 (S/MIME) code. - Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.7d: + Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.7d [17 Mar 2004]: o Security: Fix Kerberos ciphersuite SSL/TLS handshaking bug o Security: Fix null-pointer assignment in do_change_cipher_spec() @@ -358,14 +419,14 @@ o Multiple X509 verification fixes o Speed up HMAC and other operations - Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c: + Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c [30 Sep 2003]: o Security: fix various ASN1 parsing bugs. o New -ignore_err option to OCSP utility. o Various interop and bug fixes in S/MIME code. o SSL/TLS protocol fix for unrequested client certificates. - Major changes between OpenSSL 0.9.7a and OpenSSL 0.9.7b: + Major changes between OpenSSL 0.9.7a and OpenSSL 0.9.7b [10 Apr 2003]: o Security: counter the Klima-Pokorny-Rosa extension of Bleichbacher's attack @@ -376,7 +437,7 @@ o ASN.1: treat domainComponent correctly. o Documentation: fixes and additions. - Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a: + Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a [19 Feb 2003]: o Security: Important security related bugfixes. o Enhanced compatibility with MIT Kerberos. @@ -387,7 +448,7 @@ o SSL/TLS: now handles manual certificate chain building. o SSL/TLS: certain session ID malfunctions corrected. - Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7: + Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7 [30 Dec 2002]: o New library section OCSP. o Complete rewrite of ASN1 code. @@ -433,23 +494,23 @@ o SSL/TLS: add callback to retrieve SSL/TLS messages. o SSL/TLS: support AES cipher suites (RFC3268). - Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k: + Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k [30 Sep 2003]: o Security: fix various ASN1 parsing bugs. o SSL/TLS protocol fix for unrequested client certificates. - Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j: + Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j [10 Apr 2003]: o Security: counter the Klima-Pokorny-Rosa extension of Bleichbacher's attack o Security: make RSA blinding default. o Build: shared library support fixes. - Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i: + Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i [19 Feb 2003]: o Important security related bugfixes. - Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h: + Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h [5 Dec 2002]: o New configuration targets for Tandem OSS and A/UX. o New OIDs for Microsoft attributes. @@ -463,25 +524,25 @@ o Fixes for smaller building problems. o Updates of manuals, FAQ and other instructive documents. - Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g: + Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g [9 Aug 2002]: o Important building fixes on Unix. - Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f: + Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f [8 Aug 2002]: o Various important bugfixes. - Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e: + Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e [30 Jul 2002]: o Important security related bugfixes. o Various SSL/TLS library bugfixes. - Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d: + Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d [9 May 2002]: o Various SSL/TLS library bugfixes. o Fix DH parameter generation for 'non-standard' generators. - Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c: + Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c [21 Dec 2001]: o Various SSL/TLS library bugfixes. o BIGNUM library fixes. @@ -494,7 +555,7 @@ Broadcom and Cryptographic Appliance's keyserver [in 0.9.6c-engine release]. - Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b: + Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b [9 Jul 2001]: o Security fix: PRNG improvements. o Security fix: RSA OAEP check. @@ -511,7 +572,7 @@ o Increase default size for BIO buffering filter. o Compatibility fixes in some scripts. - Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a: + Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a [5 Apr 2001]: o Security fix: change behavior of OpenSSL to avoid using environment variables when running as root. @@ -536,7 +597,7 @@ o New function BN_rand_range(). o Add "-rand" option to openssl s_client and s_server. - Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6: + Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6 [10 Oct 2000]: o Some documentation for BIO and SSL libraries. o Enhanced chain verification using key identifiers. @@ -551,7 +612,7 @@ [1] The support for external crypto devices is currently a separate distribution. See the file README.ENGINE. - Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a: + Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a [1 Apr 2000]: o Bug fixes for Win32, SuSE Linux, NeXTSTEP and FreeBSD 2.2.8 o Shared library support for HPUX and Solaris-gcc @@ -560,7 +621,7 @@ o New 'rand' application o New way to check for existence of algorithms from scripts - Major changes between OpenSSL 0.9.4 and OpenSSL 0.9.5: + Major changes between OpenSSL 0.9.4 and OpenSSL 0.9.5 [25 May 2000]: o S/MIME support in new 'smime' command o Documentation for the OpenSSL command line application @@ -596,7 +657,7 @@ o Enhanced support for Alpha Linux o Experimental MacOS support - Major changes between OpenSSL 0.9.3 and OpenSSL 0.9.4: + Major changes between OpenSSL 0.9.3 and OpenSSL 0.9.4 [9 Aug 1999]: o Transparent support for PKCS#8 format private keys: these are used by several software packages and are more secure than the standard @@ -607,7 +668,7 @@ o New pipe-like BIO that allows using the SSL library when actual I/O must be handled by the application (BIO pair) - Major changes between OpenSSL 0.9.2b and OpenSSL 0.9.3: + Major changes between OpenSSL 0.9.2b and OpenSSL 0.9.3 [24 May 1999]: o Lots of enhancements and cleanups to the Configuration mechanism o RSA OEAP related fixes o Added `openssl ca -revoke' option for revoking a certificate @@ -621,7 +682,7 @@ o Sparc assembler bignum implementation, optimized hash functions o Option to disable selected ciphers - Major changes between OpenSSL 0.9.1c and OpenSSL 0.9.2b: + Major changes between OpenSSL 0.9.1c and OpenSSL 0.9.2b [22 Mar 1999]: o Fixed a security hole related to session resumption o Fixed RSA encryption routines for the p < q case o "ALL" in cipher lists now means "everything except NULL ciphers" @@ -643,7 +704,7 @@ o Lots of memory leak fixes. o Lots of bug fixes. - Major changes between SSLeay 0.9.0b and OpenSSL 0.9.1c: + Major changes between SSLeay 0.9.0b and OpenSSL 0.9.1c [23 Dec 1998]: o Integration of the popular NO_RSA/NO_DSA patches o Initial support for compression inside the SSL record layer o Added BIO proxy and filtering functionality Modified: stable/10/crypto/openssl/README ============================================================================== --- stable/10/crypto/openssl/README Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/README Thu Apr 10 22:39:22 2014 (r264331) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1e 11 Feb 2013 + OpenSSL 1.0.1g 7 Apr 2014 Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/10/crypto/openssl/apps/Makefile ============================================================================== --- stable/10/crypto/openssl/apps/Makefile Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/apps/Makefile Thu Apr 10 22:39:22 2014 (r264331) @@ -577,14 +577,15 @@ openssl.o: ../include/openssl/objects.h openssl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h openssl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h openssl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -openssl.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h -openssl.o: ../include/openssl/sha.h ../include/openssl/srtp.h -openssl.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -openssl.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -openssl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -openssl.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h -openssl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -openssl.o: ../include/openssl/x509v3.h apps.h openssl.c progs.h s_apps.h +openssl.o: ../include/openssl/pqueue.h ../include/openssl/rand.h +openssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h +openssl.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +openssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +openssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +openssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +openssl.o: ../include/openssl/txt_db.h ../include/openssl/x509.h +openssl.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h +openssl.o: openssl.c progs.h s_apps.h passwd.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h passwd.o: ../include/openssl/buffer.h ../include/openssl/conf.h passwd.o: ../include/openssl/crypto.h ../include/openssl/des.h Modified: stable/10/crypto/openssl/apps/apps.c ============================================================================== --- stable/10/crypto/openssl/apps/apps.c Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/apps/apps.c Thu Apr 10 22:39:22 2014 (r264331) @@ -586,12 +586,12 @@ int password_callback(char *buf, int buf if (ok >= 0) ok = UI_add_input_string(ui,prompt,ui_flags,buf, - PW_MIN_LENGTH,BUFSIZ-1); + PW_MIN_LENGTH,bufsiz-1); if (ok >= 0 && verify) { buff = (char *)OPENSSL_malloc(bufsiz); ok = UI_add_verify_string(ui,prompt,ui_flags,buff, - PW_MIN_LENGTH,BUFSIZ-1, buf); + PW_MIN_LENGTH,bufsiz-1, buf); } if (ok >= 0) do @@ -2841,7 +2841,7 @@ double app_tminterval(int stop,int usert if (proc==NULL) { - if (GetVersion() < 0x80000000) + if (check_winnt()) proc = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE, GetCurrentProcessId()); if (proc==NULL) proc = (HANDLE)-1; Modified: stable/10/crypto/openssl/apps/apps.h ============================================================================== --- stable/10/crypto/openssl/apps/apps.h Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/apps/apps.h Thu Apr 10 22:39:22 2014 (r264331) @@ -188,6 +188,7 @@ extern BIO *bio_err; do { CONF_modules_unload(1); destroy_ui_method(); \ OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \ CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \ + RAND_cleanup(); \ ERR_free_strings(); zlib_cleanup();} while(0) # else # define apps_startup() \ @@ -198,6 +199,7 @@ extern BIO *bio_err; do { CONF_modules_unload(1); destroy_ui_method(); \ OBJ_cleanup(); EVP_cleanup(); \ CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \ + RAND_cleanup(); \ ERR_free_strings(); zlib_cleanup(); } while(0) # endif #endif Modified: stable/10/crypto/openssl/apps/crl.c ============================================================================== --- stable/10/crypto/openssl/apps/crl.c Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/apps/crl.c Thu Apr 10 22:39:22 2014 (r264331) @@ -81,6 +81,9 @@ static const char *crl_usage[]={ " -in arg - input file - default stdin\n", " -out arg - output file - default stdout\n", " -hash - print hash value\n", +#ifndef OPENSSL_NO_MD5 +" -hash_old - print old-style (MD5) hash value\n", +#endif " -fingerprint - print the crl fingerprint\n", " -issuer - print issuer DN\n", " -lastupdate - lastUpdate field\n", @@ -108,6 +111,9 @@ int MAIN(int argc, char **argv) int informat,outformat; char *infile=NULL,*outfile=NULL; int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0; +#ifndef OPENSSL_NO_MD5 + int hash_old=0; +#endif int fingerprint = 0, crlnumber = 0; const char **pp; X509_STORE *store = NULL; @@ -192,6 +198,10 @@ int MAIN(int argc, char **argv) text = 1; else if (strcmp(*argv,"-hash") == 0) hash= ++num; +#ifndef OPENSSL_NO_MD5 + else if (strcmp(*argv,"-hash_old") == 0) + hash_old= ++num; +#endif else if (strcmp(*argv,"-nameopt") == 0) { if (--argc < 1) goto bad; @@ -304,6 +314,14 @@ bad: BIO_printf(bio_out,"%08lx\n", X509_NAME_hash(X509_CRL_get_issuer(x))); } +#ifndef OPENSSL_NO_MD5 + if (hash_old == i) + { + BIO_printf(bio_out,"%08lx\n", + X509_NAME_hash_old( + X509_CRL_get_issuer(x))); + } +#endif if (lastupdate == i) { BIO_printf(bio_out,"lastUpdate="); Modified: stable/10/crypto/openssl/apps/dgst.c ============================================================================== --- stable/10/crypto/openssl/apps/dgst.c Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/apps/dgst.c Thu Apr 10 22:39:22 2014 (r264331) @@ -427,9 +427,9 @@ int MAIN(int argc, char **argv) goto end; } if (do_verify) - r = EVP_DigestVerifyInit(mctx, &pctx, md, e, sigkey); + r = EVP_DigestVerifyInit(mctx, &pctx, md, NULL, sigkey); else - r = EVP_DigestSignInit(mctx, &pctx, md, e, sigkey); + r = EVP_DigestSignInit(mctx, &pctx, md, NULL, sigkey); if (!r) { BIO_printf(bio_err, "Error setting context\n"); Modified: stable/10/crypto/openssl/apps/ecparam.c ============================================================================== --- stable/10/crypto/openssl/apps/ecparam.c Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/apps/ecparam.c Thu Apr 10 22:39:22 2014 (r264331) @@ -105,7 +105,7 @@ * in the asn1 der encoding * possible values: named_curve (default) * explicit - * -no_seed - if 'explicit' parameters are choosen do not use the seed + * -no_seed - if 'explicit' parameters are chosen do not use the seed * -genkey - generate ec key * -rand file - files to use for random number input * -engine e - use engine e, possibly a hardware device @@ -286,7 +286,7 @@ bad: BIO_printf(bio_err, " " " explicit\n"); BIO_printf(bio_err, " -no_seed if 'explicit'" - " parameters are choosen do not" + " parameters are chosen do not" " use the seed\n"); BIO_printf(bio_err, " -genkey generate ec" " key\n"); Modified: stable/10/crypto/openssl/apps/openssl.c ============================================================================== --- stable/10/crypto/openssl/apps/openssl.c Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/apps/openssl.c Thu Apr 10 22:39:22 2014 (r264331) @@ -117,6 +117,7 @@ #include "apps.h" #include #include +#include #include #include #include Modified: stable/10/crypto/openssl/apps/pkcs12.c ============================================================================== --- stable/10/crypto/openssl/apps/pkcs12.c Thu Apr 10 22:10:29 2014 (r264330) +++ stable/10/crypto/openssl/apps/pkcs12.c Thu Apr 10 22:39:22 2014 (r264331) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 11 01:00:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 66493D81; Fri, 11 Apr 2014 01:00: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 5181A19DC; Fri, 11 Apr 2014 01:00: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 s3B10q0o035795; Fri, 11 Apr 2014 01:00:52 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3B10pQv035793; Fri, 11 Apr 2014 01:00:51 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404110100.s3B10pQv035793@svn.freebsd.org> From: Bryan Drewery Date: Fri, 11 Apr 2014 01:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264332 - stable/10/usr.bin/kdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 01:00:52 -0000 Author: bdrewery Date: Fri Apr 11 01:00:51 2014 New Revision: 264332 URL: http://svnweb.freebsd.org/changeset/base/264332 Log: MFC r263879: Add `-S' to display syscall numbers in the output as well. Modified: stable/10/usr.bin/kdump/kdump.1 stable/10/usr.bin/kdump/kdump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/kdump/kdump.1 ============================================================================== --- stable/10/usr.bin/kdump/kdump.1 Thu Apr 10 22:39:22 2014 (r264331) +++ stable/10/usr.bin/kdump/kdump.1 Fri Apr 11 01:00:51 2014 (r264332) @@ -28,7 +28,7 @@ .\" @(#)kdump.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 4, 2012 +.Dd March 28, 2014 .Dt KDUMP 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd display kernel trace data .Sh SYNOPSIS .Nm -.Op Fl dEnlHRsTA +.Op Fl dEnlHRSsTA .Op Fl f Ar trfile .Op Fl m Ar maxdata .Op Fl p Ar pid @@ -95,6 +95,8 @@ Display relative timestamps (time since .It Fl r When decoding STRU records, display structure members such as UIDs, GIDs, dates etc. symbolically instead of numerically. +.It Fl S +Display system call numbers. .It Fl s Suppress display of I/O data. .It Fl T Modified: stable/10/usr.bin/kdump/kdump.c ============================================================================== --- stable/10/usr.bin/kdump/kdump.c Thu Apr 10 22:39:22 2014 (r264331) +++ stable/10/usr.bin/kdump/kdump.c Fri Apr 11 01:00:51 2014 (r264332) @@ -116,7 +116,7 @@ void usage(void); void ioctlname(unsigned long, int); int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, - resolv = 0, abiflag = 0; + resolv = 0, abiflag = 0, syscallno = 0; const char *tracefile = DEF_TRACEFILE; struct ktr_header ktr_header; @@ -204,7 +204,7 @@ main(int argc, char *argv[]) setlocale(LC_CTYPE, ""); - while ((ch = getopt(argc,argv,"f:dElm:np:AHRrsTt:")) != -1) + while ((ch = getopt(argc,argv,"f:dElm:np:AHRrSsTt:")) != -1) switch (ch) { case 'A': abiflag = 1; @@ -230,6 +230,9 @@ main(int argc, char *argv[]) case 'r': resolv = 1; break; + case 'S': + syscallno = 1; + break; case 's': suppressdata = 1; break; @@ -600,8 +603,11 @@ ktrsyscall(struct ktr_syscall *ktr, u_in if ((flags != 0 && ((flags & SV_ABI_MASK) != SV_ABI_FREEBSD)) || (ktr->ktr_code >= nsyscalls || ktr->ktr_code < 0)) printf("[%d]", ktr->ktr_code); - else + else { printf("%s", syscallnames[ktr->ktr_code]); + if (syscallno) + printf("[%d]", ktr->ktr_code); + } ip = &ktr->ktr_args[0]; if (narg) { char c = '('; @@ -1193,8 +1199,12 @@ ktrsysret(struct ktr_sysret *ktr, u_int if ((flags != 0 && ((flags & SV_ABI_MASK) != SV_ABI_FREEBSD)) || (code >= nsyscalls || code < 0)) printf("[%d] ", code); - else - printf("%s ", syscallnames[code]); + else { + printf("%s", syscallnames[code]); + if (syscallno) + printf("[%d]", code); + printf(" "); + } if (error == 0) { if (fancy) { @@ -1840,8 +1850,11 @@ linux_ktrsyscall(struct ktr_syscall *ktr if (ktr->ktr_code >= nlinux_syscalls || ktr->ktr_code < 0) printf("[%d]", ktr->ktr_code); - else + else { printf("%s", linux_syscallnames[ktr->ktr_code]); + if (syscallno) + printf("[%d]", ktr->ktr_code); + } ip = &ktr->ktr_args[0]; if (narg) { char c = '('; @@ -1861,8 +1874,12 @@ linux_ktrsysret(struct ktr_sysret *ktr) if (code >= nlinux_syscalls || code < 0) printf("[%d] ", code); - else - printf("%s ", linux_syscallnames[code]); + else { + printf("%s", linux_syscallnames[code]); + if (syscallno) + printf("[%d]", code); + printf(" "); + } if (error == 0) { if (fancy) { @@ -1895,7 +1912,7 @@ linux_ktrsysret(struct ktr_sysret *ktr) void usage(void) { - fprintf(stderr, "usage: kdump [-dEnlHRrsTA] [-f trfile] " + fprintf(stderr, "usage: kdump [-dEnlHRrSsTA] [-f trfile] " "[-m maxdata] [-p pid] [-t trstr]\n"); exit(1); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 11 01:23:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E0455DA8; Fri, 11 Apr 2014 01:23: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 CA2B51C60; Fri, 11 Apr 2014 01:23: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 s3B1NlYC047355; Fri, 11 Apr 2014 01:23:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3B1NlEF047350; Fri, 11 Apr 2014 01:23:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404110123.s3B1NlEF047350@svn.freebsd.org> From: Xin LI Date: Fri, 11 Apr 2014 01:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264334 - in stable/10/cddl/contrib/opensolaris/cmd: zdb zfs zpool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 01:23:48 -0000 Author: delphij Date: Fri Apr 11 01:23:46 2014 New Revision: 264334 URL: http://svnweb.freebsd.org/changeset/base/264334 Log: MFC r263459: MFV 263436-263438: 3947 zpool(1M) references nonexistent zfs-features(5) 4540 zpool(1M) man page doesn't describe "readonly" property 3948 zfs sync=default is not accepted 4611 zfs(1M) still mentions 'send -r' in synopsis 4415 zpool(1M) man page missing "import -m" description 4570 Document dedupditto pool property 4572 Dedup-related documentation additions for zpool and zdb. 1371 Add -D option description to zpool(1M) manpage 4571 Add documentation for -T and interval to "zpool list" Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Apr 11 01:04:07 2014 (r264333) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Apr 11 01:23:46 2014 (r264334) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 31, 2013 +.Dd March 20, 2014 .Dt ZDB 8 .Os .Sh NAME @@ -127,6 +127,12 @@ compression ratio (compress), inflation If specified twice, display a histogram of deduplication statistics, showing the allocated (physically present on disk) and referenced (logically referenced in the pool) block counts and sizes by reference count. +.Pp +If specified a third time, display the statistics independently for each deduplication table. +.Pp +If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks. +.Pp +If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks. .It Fl h Display pool history similar to .Cm zpool history , Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Apr 11 01:04:07 2014 (r264333) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Apr 11 01:23:46 2014 (r264334) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2014 +.Dd March 20, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -1335,10 +1335,21 @@ features being supported, the new file s these properties. .Bl -tag -width 4n .It Sy casesensitivity Ns = Ns Cm sensitive | insensitive | mixed +Indicates whether the file name matching algorithm used by the file system +should be case-sensitive, case-insensitive, or allow a combination of both +styles of matching. The default value for the +.Sy casesensitivity +property is +.Cm sensitive . +Traditionally, UNIX and POSIX file systems have case-sensitive file names. +.Pp The +.Cm mixed +value for the .Sy casesensitivity -property is currently not supported on -.Fx . +property indicates that the +file system can support requests for both case-sensitive and case-insensitive +matching behavior. .It Sy normalization Ns = Ns Cm none | formC | formD | formKC | formKD Indicates whether the file system should perform a .Sy unicode Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Apr 11 01:04:07 2014 (r264333) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Apr 11 01:23:46 2014 (r264334) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 31, 2013 +.Dd March 20, 2014 .Dt ZPOOL 8 .Os .Sh NAME @@ -624,6 +624,9 @@ Datasets of this pool can only be mounte .It To write to a read-only pool, a export and import of the pool is required. .El +.Pp +This property can also be referred to by its shortened column name, +.Sy rdonly . .El .Pp The following properties can be set at creation time and import time, and later @@ -682,7 +685,9 @@ property. Threshold for the number of block ditto copies. If the reference count for a deduplicated block increases above this number, a new ditto copy of this block is automatically stored. Default setting is -.Cm 0 . +.Cm 0 +which causes no ditto copies to be created for deduplicated blocks. +The miniumum legal nonzero setting is 100. .It Sy delegation Ns = Ns Cm on No | Cm off Controls whether a non-privileged user is granted access based on the dataset permissions defined on the dataset. See @@ -1152,9 +1157,10 @@ option is also required. .It Fl f Forces import, even if the pool appears to be potentially active. .It Fl m -Enables import with missing log devices. +Allows a pool to import when there is a missing log device. Recent transactions +can be lost because the log device will be discarded. .It Fl N -Do not mount any filesystems from the imported pool. +Import the pool without mounting any file systems. .It Fl R Ar root Sets the .Qq Sy cachefile @@ -1245,9 +1251,10 @@ option is also required. .It Fl f Forces import, even if the pool appears to be potentially active. .It Fl m -Enables import with missing log devices. +Allows a pool to import when there is a missing log device. Recent transactions +can be lost because the log device will be discarded. .It Fl N -Do not mount any filesystems from the imported pool. +Import the pool without mounting any file systems. .It Fl R Ar root Equivalent to .Qq Fl o Cm cachefile=none,altroot= Ns Pa root @@ -1336,8 +1343,9 @@ Treat exported or foreign devices as ina .Op Ar inverval Op Ar count .Xc .Pp -Lists the given pools along with a health status and space usage. When given no -arguments, all pools in the system are listed. +Lists the given pools along with a health status and space usage. If no +.Ar pools +are specified, all pools in the system are listed. .Pp When given an interval, the output is printed every .Ar interval @@ -1349,6 +1357,17 @@ is specified, the command exits after .Ar count reports are printed. .Bl -tag -width indent +.It Fl T Cm d Ns | Ns Cm u +Print a timestamp. +.Pp +Use modifier +.Cm d +for standard date format. See +.Xr date 1 . +Use modifier +.Cm u +for unixtime +.Pq equals Qq Ic date +%s . .It Fl H Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space. @@ -1677,7 +1696,7 @@ Once this is done, the pool will no long not support feature flags. See .Xr zpool-features 7 -for details on compatability with system sthat support feature flags, but do +for details on compatibility with systems that support feature flags, but do not support all features enabled on the pool. .Bl -tag -width indent .It Fl a From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 11 01:27:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 53D49F9A; Fri, 11 Apr 2014 01:27: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 33AA41C98; Fri, 11 Apr 2014 01: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 s3B1RZXn047853; Fri, 11 Apr 2014 01:27:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3B1RYSo047848; Fri, 11 Apr 2014 01:27:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404110127.s3B1RYSo047848@svn.freebsd.org> From: Xin LI Date: Fri, 11 Apr 2014 01:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264335 - in stable/10/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 01:27:35 -0000 Author: delphij Date: Fri Apr 11 01:27:33 2014 New Revision: 264335 URL: http://svnweb.freebsd.org/changeset/base/264335 Log: MFC r263889 (MFV r263887): 3993 zpool(1M) and zfs(1M) should support -p for "list" and "get" 4700 "zpool get" doesn't support -H or -o options Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Apr 11 01:23:46 2014 (r264334) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Apr 11 01:27:33 2014 (r264335) @@ -1,5 +1,6 @@ '\" te .\" Copyright (c) 2012, Martin Matuska . +.\" Copyright (c) 2013-2014, Xin Li . .\" All Rights Reserved. .\" .\" The contents of this file are subject to the terms of the @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2014 +.Dd March 28, 2014 .Dt ZPOOL 8 .Os .Sh NAME @@ -70,6 +71,8 @@ .Ar pool ... .Nm .Cm get +.Op Fl Hp +.Op Fl o Ar field Ns Op , Ns Ar ... .Ar all | property Ns Op , Ns Ar ... .Ar pool ... .Nm @@ -120,7 +123,7 @@ .Ar device .Nm .Cm list -.Op Fl H +.Op Fl Hpv .Op Fl o Ar property Ns Op , Ns Ar ... .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool @@ -1018,6 +1021,8 @@ is currently being used. This may lead t .It Xo .Nm .Cm get +.Op Fl Hp +.Op Fl o Ar field Ns Op , Ns Ar ... .Ar all | property Ns Op , Ns Ar ... .Ar pool ... .Xc @@ -1036,6 +1041,19 @@ the following fields: See the .Qq Sx Properties section for more information on the available pool properties. +.Pp +.It Fl H +Scripted mode. Do not display headers, and separate fields by a single tab +instead of arbitrary space. +.It Fl p +Display numbers in parsable (exact) values. +.It Fl o Ar field +A comma-separated list of columns to display. +.Sy name Ns , Ns +.Sy property Ns , Ns +.Sy value Ns , Ns +.Sy source +is the default value. .It Xo .Nm .Cm history @@ -1335,7 +1353,7 @@ Treat exported or foreign devices as ina .It Xo .Nm .Cm list -.Op Fl Hv +.Op Fl Hpv .Op Fl o Ar property Ns Op , Ns Ar ... .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool @@ -1371,6 +1389,8 @@ for unixtime .It Fl H Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space. +.It Fl p +Display numbers in parsable (exact) values. .It Fl v Show more detailed information. .It Fl o Ar property Ns Op , Ns Ar ... Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Apr 11 01:23:46 2014 (r264334) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Apr 11 01:27:33 2014 (r264335) @@ -236,7 +236,7 @@ get_usage(zpool_help_t idx) { case HELP_LABELCLEAR: return (gettext("\tlabelclear [-f] \n")); case HELP_LIST: - return (gettext("\tlist [-Hv] [-o property[,...]] " + return (gettext("\tlist [-Hpv] [-o property[,...]] " "[-T d|u] [pool] ... [interval [count]]\n")); case HELP_OFFLINE: return (gettext("\toffline [-t] ...\n")); @@ -258,8 +258,8 @@ get_usage(zpool_help_t idx) { return (gettext("\tupgrade [-v]\n" "\tupgrade [-V version] <-a | pool ...>\n")); case HELP_GET: - return (gettext("\tget <\"all\" | property[,...]> " - " ...\n")); + return (gettext("\tget [-Hp] [-o \"all\" | field[,...]] " + "<\"all\" | property[,...]> ...\n")); case HELP_SET: return (gettext("\tset \n")); case HELP_SPLIT: @@ -2765,6 +2765,7 @@ typedef struct list_cbdata { int cb_namewidth; boolean_t cb_scripted; zprop_list_t *cb_proplist; + boolean_t cb_literal; } list_cbdata_t; /* @@ -2860,7 +2861,7 @@ print_pool(zpool_handle_t *zhp, list_cbd zpool_get_prop_int(zhp, pl->pl_prop, NULL) == 0) propstr = "-"; else if (zpool_get_prop(zhp, pl->pl_prop, property, - sizeof (property), NULL) != 0) + sizeof (property), NULL, cb->cb_literal) != 0) propstr = "-"; else propstr = property; @@ -3011,12 +3012,13 @@ list_callback(zpool_handle_t *zhp, void } /* - * zpool list [-H] [-o prop[,prop]*] [-T d|u] [pool] ... [interval [count]] + * zpool list [-Hp] [-o prop[,prop]*] [-T d|u] [pool] ... [interval [count]] * * -H Scripted mode. Don't display headers, and separate properties * by a single tab. * -o List of properties to display. Defaults to * "name,size,allocated,free,capacity,health,altroot" + * -p Diplay values in parsable (exact) format. * -T Display a timestamp in date(1) or Unix format * * List all pools in the system, whether or not they're healthy. Output space @@ -3037,7 +3039,7 @@ zpool_do_list(int argc, char **argv) boolean_t first = B_TRUE; /* check options */ - while ((c = getopt(argc, argv, ":Ho:T:v")) != -1) { + while ((c = getopt(argc, argv, ":Ho:pT:v")) != -1) { switch (c) { case 'H': cb.cb_scripted = B_TRUE; @@ -3045,6 +3047,9 @@ zpool_do_list(int argc, char **argv) case 'o': props = optarg; break; + case 'p': + cb.cb_literal = B_TRUE; + break; case 'T': get_timestamp_arg(*optarg); break; @@ -5199,7 +5204,7 @@ get_callback(zpool_handle_t *zhp, void * } } else { if (zpool_get_prop(zhp, pl->pl_prop, value, - sizeof (value), &srctype) != 0) + sizeof (value), &srctype, cbp->cb_literal) != 0) continue; zprop_print_one_property(zpool_get_name(zhp), cbp, @@ -5210,20 +5215,32 @@ get_callback(zpool_handle_t *zhp, void * return (0); } +/* + * zpool get [-Hp] [-o "all" | field[,...]] <"all" | property[,...]> ... + * + * -H Scripted mode. Don't display headers, and separate properties + * by a single tab. + * -o List of columns to display. Defaults to + * "name,property,value,source". + * -p Diplay values in parsable (exact) format. + * + * Get properties of pools in the system. Output space statistics + * for each one as well as other attributes. + */ int zpool_do_get(int argc, char **argv) { zprop_get_cbdata_t cb = { 0 }; zprop_list_t fake_name = { 0 }; int ret; - - if (argc < 2) { - (void) fprintf(stderr, gettext("missing property " - "argument\n")); - usage(B_FALSE); - } + int c, i; + char *value; cb.cb_first = B_TRUE; + + /* + * Set up default columns and sources. + */ cb.cb_sources = ZPROP_SRC_ALL; cb.cb_columns[0] = GET_COL_NAME; cb.cb_columns[1] = GET_COL_PROPERTY; @@ -5231,10 +5248,89 @@ zpool_do_get(int argc, char **argv) cb.cb_columns[3] = GET_COL_SOURCE; cb.cb_type = ZFS_TYPE_POOL; - if (zprop_get_list(g_zfs, argv[1], &cb.cb_proplist, + /* check options */ + while ((c = getopt(argc, argv, ":Hpo:")) != -1) { + switch (c) { + case 'p': + cb.cb_literal = B_TRUE; + break; + case 'H': + cb.cb_scripted = B_TRUE; + break; + case 'o': + bzero(&cb.cb_columns, sizeof (cb.cb_columns)); + i = 0; + while (*optarg != '\0') { + static char *col_subopts[] = + { "name", "property", "value", "source", + "all", NULL }; + + if (i == ZFS_GET_NCOLS) { + (void) fprintf(stderr, gettext("too " + "many fields given to -o " + "option\n")); + usage(B_FALSE); + } + + switch (getsubopt(&optarg, col_subopts, + &value)) { + case 0: + cb.cb_columns[i++] = GET_COL_NAME; + break; + case 1: + cb.cb_columns[i++] = GET_COL_PROPERTY; + break; + case 2: + cb.cb_columns[i++] = GET_COL_VALUE; + break; + case 3: + cb.cb_columns[i++] = GET_COL_SOURCE; + break; + case 4: + if (i > 0) { + (void) fprintf(stderr, + gettext("\"all\" conflicts " + "with specific fields " + "given to -o option\n")); + usage(B_FALSE); + } + cb.cb_columns[0] = GET_COL_NAME; + cb.cb_columns[1] = GET_COL_PROPERTY; + cb.cb_columns[2] = GET_COL_VALUE; + cb.cb_columns[3] = GET_COL_SOURCE; + i = ZFS_GET_NCOLS; + break; + default: + (void) fprintf(stderr, + gettext("invalid column name " + "'%s'\n"), value); + usage(B_FALSE); + } + } + break; + case '?': + (void) fprintf(stderr, gettext("invalid option '%c'\n"), + optopt); + usage(B_FALSE); + } + } + + argc -= optind; + argv += optind; + + if (argc < 1) { + (void) fprintf(stderr, gettext("missing property " + "argument\n")); + usage(B_FALSE); + } + + if (zprop_get_list(g_zfs, argv[0], &cb.cb_proplist, ZFS_TYPE_POOL) != 0) usage(B_FALSE); + argc--; + argv++; + if (cb.cb_proplist != NULL) { fake_name.pl_prop = ZPOOL_PROP_NAME; fake_name.pl_width = strlen(gettext("NAME")); @@ -5242,7 +5338,7 @@ zpool_do_get(int argc, char **argv) cb.cb_proplist = &fake_name; } - ret = for_each_pool(argc - 2, argv + 2, B_TRUE, &cb.cb_proplist, + ret = for_each_pool(argc, argv, B_TRUE, &cb.cb_proplist, get_callback, &cb); if (cb.cb_proplist == &fake_name) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Apr 11 01:23:46 2014 (r264334) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Apr 11 01:27:33 2014 (r264335) @@ -270,7 +270,7 @@ extern int zpool_label_disk(libzfs_handl */ extern int zpool_set_prop(zpool_handle_t *, const char *, const char *); extern int zpool_get_prop(zpool_handle_t *, zpool_prop_t, char *, - size_t proplen, zprop_source_t *); + size_t proplen, zprop_source_t *, boolean_t); extern uint64_t zpool_get_prop_int(zpool_handle_t *, zpool_prop_t, zprop_source_t *); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Apr 11 01:23:46 2014 (r264334) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Apr 11 01:27:33 2014 (r264335) @@ -2237,8 +2237,8 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop } if ((zpool_get_prop(zhp->zpool_hdl, - ZPOOL_PROP_ALTROOT, buf, MAXPATHLEN, NULL)) || - (strcmp(root, "-") == 0)) + ZPOOL_PROP_ALTROOT, buf, MAXPATHLEN, NULL, + B_FALSE)) || (strcmp(root, "-") == 0)) root[0] = '\0'; /* * Special case an alternate root of '/'. This will Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Apr 11 01:23:46 2014 (r264334) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Apr 11 01:27:33 2014 (r264335) @@ -240,7 +240,7 @@ zpool_pool_state_to_name(pool_state_t st */ int zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len, - zprop_source_t *srctype) + zprop_source_t *srctype, boolean_t literal) { uint64_t intval; const char *strval; @@ -272,9 +272,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo (void) strlcpy(buf, zpool_get_prop_string(zhp, prop, &src), len); - if (srctype != NULL) - *srctype = src; - return (0); + break; } /* FALLTHROUGH */ default: @@ -306,12 +304,22 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo case ZPOOL_PROP_FREE: case ZPOOL_PROP_FREEING: case ZPOOL_PROP_EXPANDSZ: - (void) zfs_nicenum(intval, buf, len); + if (literal) { + (void) snprintf(buf, len, "%llu", + (u_longlong_t)intval); + } else { + (void) zfs_nicenum(intval, buf, len); + } break; case ZPOOL_PROP_CAPACITY: - (void) snprintf(buf, len, "%llu%%", - (u_longlong_t)intval); + if (literal) { + (void) snprintf(buf, len, "%llu", + (u_longlong_t)intval); + } else { + (void) snprintf(buf, len, "%llu%%", + (u_longlong_t)intval); + } break; case ZPOOL_PROP_DEDUPRATIO: @@ -407,7 +415,7 @@ zpool_is_bootable(zpool_handle_t *zhp) char bootfs[ZPOOL_MAXNAMELEN]; return (zpool_get_prop(zhp, ZPOOL_PROP_BOOTFS, bootfs, - sizeof (bootfs), NULL) == 0 && strncmp(bootfs, "-", + sizeof (bootfs), NULL, B_FALSE) == 0 && strncmp(bootfs, "-", sizeof (bootfs)) != 0); } @@ -806,7 +814,7 @@ zpool_expand_proplist(zpool_handle_t *zh if (entry->pl_prop != ZPROP_INVAL && zpool_get_prop(zhp, entry->pl_prop, buf, sizeof (buf), - NULL) == 0) { + NULL, B_FALSE) == 0) { if (strlen(buf) > entry->pl_width) entry->pl_width = strlen(buf); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 11 06:13:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C609F3A5; Fri, 11 Apr 2014 06:13: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 B30BB18F1; Fri, 11 Apr 2014 06:13: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 s3B6Duat068394; Fri, 11 Apr 2014 06:13:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3B6Du2M068393; Fri, 11 Apr 2014 06:13:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404110613.s3B6Du2M068393@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 11 Apr 2014 06:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264336 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 06:13:56 -0000 Author: hselasky Date: Fri Apr 11 06:13:56 2014 New Revision: 264336 URL: http://svnweb.freebsd.org/changeset/base/264336 Log: MFC r264294: Fix for infinite XHCI reset loops when the set address USB request fails. Modified: stable/10/sys/dev/usb/controller/xhci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.c Fri Apr 11 01:27:33 2014 (r264335) +++ stable/10/sys/dev/usb/controller/xhci.c Fri Apr 11 06:13:56 2014 (r264336) @@ -1218,8 +1218,20 @@ retry: */ if (timeout == 0 && xhci_reset_command_queue_locked(sc) == 0) { - timeout = 1; - goto retry; + temp = le32toh(trb->dwTrb3); + + /* + * Avoid infinite XHCI reset loops if the set + * address command fails to respond due to a + * non-enumerating device: + */ + if (XHCI_TRB_3_TYPE_GET(temp) == XHCI_TRB_TYPE_ADDRESS_DEVICE && + (temp & XHCI_TRB_3_BSR_BIT) == 0) { + DPRINTF("Set address timeout\n"); + } else { + timeout = 1; + goto retry; + } } else { DPRINTF("Controller reset!\n"); usb_bus_reset_async_locked(&sc->sc_bus); From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 06:50:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BA2D8205; Sat, 12 Apr 2014 06:50: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 A6575117F; Sat, 12 Apr 2014 06:50: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 s3C6oBPi087595; Sat, 12 Apr 2014 06:50:11 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3C6oBuv087594; Sat, 12 Apr 2014 06:50:11 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201404120650.s3C6oBuv087594@svn.freebsd.org> From: Dmitry Chagin Date: Sat, 12 Apr 2014 06:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264366 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 06:50:11 -0000 Author: dchagin Date: Sat Apr 12 06:50:11 2014 New Revision: 264366 URL: http://svnweb.freebsd.org/changeset/base/264366 Log: MFC r264151: Prevent alq from panic when the invalid alq_file path specified. Modified: stable/10/sys/kern/kern_alq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_alq.c ============================================================================== --- stable/10/sys/kern/kern_alq.c Sat Apr 12 06:49:10 2014 (r264365) +++ stable/10/sys/kern/kern_alq.c Sat Apr 12 06:50:11 2014 (r264366) @@ -488,10 +488,12 @@ alq_open(struct alq **alqp, const char * KASSERT((count >= 0), ("%s: count < 0", __func__)); if (count > 0) { - ret = alq_open_flags(alqp, file, cred, cmode, size*count, 0); - (*alqp)->aq_flags |= AQ_LEGACY; - (*alqp)->aq_entmax = count; - (*alqp)->aq_entlen = size; + if ((ret = alq_open_flags(alqp, file, cred, cmode, + size*count, 0)) == 0) { + (*alqp)->aq_flags |= AQ_LEGACY; + (*alqp)->aq_entmax = count; + (*alqp)->aq_entlen = size; + } } else ret = alq_open_flags(alqp, file, cred, cmode, size, 0); From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 14:08:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DBFDBB6A; Sat, 12 Apr 2014 14: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 C7ADE1A86; Sat, 12 Apr 2014 14:08: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 s3CE8rWi068366; Sat, 12 Apr 2014 14:08:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CE8rAX068364; Sat, 12 Apr 2014 14:08:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404121408.s3CE8rAX068364@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 12 Apr 2014 14:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264368 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 14:08:53 -0000 Author: kib Date: Sat Apr 12 14:08:53 2014 New Revision: 264368 URL: http://svnweb.freebsd.org/changeset/base/264368 Log: MFC r264146: Fix a race between kqueue_register() and kqueue_scan() setting KN_INFLUX flag while knlist is not locked, which caused lost notifications from parallel knote(). Modified: stable/10/sys/kern/kern_event.c stable/10/sys/sys/event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Sat Apr 12 12:44:09 2014 (r264367) +++ stable/10/sys/kern/kern_event.c Sat Apr 12 14:08:53 2014 (r264368) @@ -468,7 +468,7 @@ knote_fork(struct knlist *list, int pid) continue; kq = kn->kn_kq; KQ_LOCK(kq); - if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) { + if ((kn->kn_status & (KN_INFLUX | KN_SCAN)) == KN_INFLUX) { KQ_UNLOCK(kq); continue; } @@ -1145,7 +1145,7 @@ findkn: * but doing so will not reset any filter which has already been * triggered. */ - kn->kn_status |= KN_INFLUX; + kn->kn_status |= KN_INFLUX | KN_SCAN; KQ_UNLOCK(kq); KN_LIST_LOCK(kn); kn->kn_kevent.udata = kev->udata; @@ -1168,7 +1168,7 @@ done_ev_add: KQ_LOCK(kq); if (event) KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_INFLUX; + kn->kn_status &= ~(KN_INFLUX | KN_SCAN); KN_LIST_UNLOCK(kn); if ((kev->flags & EV_DISABLE) && @@ -1477,7 +1477,7 @@ retry: KQ_LOCK(kq); kn = NULL; } else { - kn->kn_status |= KN_INFLUX; + kn->kn_status |= KN_INFLUX | KN_SCAN; KQ_UNLOCK(kq); if ((kn->kn_status & KN_KQUEUE) == KN_KQUEUE) KQ_GLOBAL_LOCK(&kq_global, haskqglobal); @@ -1486,7 +1486,8 @@ retry: KQ_LOCK(kq); KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); kn->kn_status &= - ~(KN_QUEUED | KN_ACTIVE | KN_INFLUX); + ~(KN_QUEUED | KN_ACTIVE | KN_INFLUX | + KN_SCAN); kq->kq_count--; KN_LIST_UNLOCK(kn); influx = 1; @@ -1516,7 +1517,7 @@ retry: } else TAILQ_INSERT_TAIL(&kq->kq_head, kn, kn_tqe); - kn->kn_status &= ~(KN_INFLUX); + kn->kn_status &= ~(KN_INFLUX | KN_SCAN); KN_LIST_UNLOCK(kn); influx = 1; } @@ -1834,28 +1835,33 @@ knote(struct knlist *list, long hint, in */ SLIST_FOREACH(kn, &list->kl_list, kn_selnext) { kq = kn->kn_kq; - if ((kn->kn_status & KN_INFLUX) != KN_INFLUX) { + KQ_LOCK(kq); + if ((kn->kn_status & (KN_INFLUX | KN_SCAN)) == KN_INFLUX) { + /* + * Do not process the influx notes, except for + * the influx coming from the kq unlock in the + * kqueue_scan(). In the later case, we do + * not interfere with the scan, since the code + * fragment in kqueue_scan() locks the knlist, + * and cannot proceed until we finished. + */ + KQ_UNLOCK(kq); + } else if ((lockflags & KNF_NOKQLOCK) != 0) { + kn->kn_status |= KN_INFLUX; + KQ_UNLOCK(kq); + error = kn->kn_fop->f_event(kn, hint); KQ_LOCK(kq); - if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) { - KQ_UNLOCK(kq); - } else if ((lockflags & KNF_NOKQLOCK) != 0) { - kn->kn_status |= KN_INFLUX; - KQ_UNLOCK(kq); - error = kn->kn_fop->f_event(kn, hint); - KQ_LOCK(kq); - kn->kn_status &= ~KN_INFLUX; - if (error) - KNOTE_ACTIVATE(kn, 1); - KQ_UNLOCK_FLUX(kq); - } else { - kn->kn_status |= KN_HASKQLOCK; - if (kn->kn_fop->f_event(kn, hint)) - KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_HASKQLOCK; - KQ_UNLOCK(kq); - } + kn->kn_status &= ~KN_INFLUX; + if (error) + KNOTE_ACTIVATE(kn, 1); + KQ_UNLOCK_FLUX(kq); + } else { + kn->kn_status |= KN_HASKQLOCK; + if (kn->kn_fop->f_event(kn, hint)) + KNOTE_ACTIVATE(kn, 1); + kn->kn_status &= ~KN_HASKQLOCK; + KQ_UNLOCK(kq); } - kq = NULL; } if ((lockflags & KNF_LISTLOCKED) == 0) list->kl_unlock(list->kl_lockarg); Modified: stable/10/sys/sys/event.h ============================================================================== --- stable/10/sys/sys/event.h Sat Apr 12 12:44:09 2014 (r264367) +++ stable/10/sys/sys/event.h Sat Apr 12 14:08:53 2014 (r264368) @@ -206,6 +206,7 @@ struct knote { #define KN_MARKER 0x20 /* ignore this knote */ #define KN_KQUEUE 0x40 /* this knote belongs to a kq */ #define KN_HASKQLOCK 0x80 /* for _inevent */ +#define KN_SCAN 0x100 /* flux set in kqueue_scan() */ int kn_sfflags; /* saved filter flags */ intptr_t kn_sdata; /* saved data field */ union { From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 14:18:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E9862FB5; Sat, 12 Apr 2014 14:18: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 D4F8B1B31; Sat, 12 Apr 2014 14:18: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 s3CEIPTi072514; Sat, 12 Apr 2014 14:18:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CEIPDM072513; Sat, 12 Apr 2014 14:18:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404121418.s3CEIPDM072513@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 12 Apr 2014 14:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264370 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 14:18:26 -0000 Author: kib Date: Sat Apr 12 14:18:25 2014 New Revision: 264370 URL: http://svnweb.freebsd.org/changeset/base/264370 Log: MFC r264173: Use realloc(9) instead of doing the reallocation inline. Modified: stable/10/sys/kern/kern_linker.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_linker.c ============================================================================== --- stable/10/sys/kern/kern_linker.c Sat Apr 12 14:09:35 2014 (r264369) +++ stable/10/sys/kern/kern_linker.c Sat Apr 12 14:18:25 2014 (r264370) @@ -725,14 +725,8 @@ linker_file_add_dependency(linker_file_t linker_file_t *newdeps; sx_assert(&kld_sx, SA_XLOCKED); - newdeps = malloc((file->ndeps + 1) * sizeof(*newdeps), M_LINKER, - M_WAITOK | M_ZERO); - - if (file->deps) { - bcopy(file->deps, newdeps, file->ndeps * sizeof(*newdeps)); - free(file->deps, M_LINKER); - } - file->deps = newdeps; + file->deps = realloc(file->deps, (file->ndeps + 1) * sizeof(*newdeps), + M_LINKER, M_WAITOK | M_ZERO); file->deps[file->ndeps] = dep; file->ndeps++; KLD_DPF(FILE, ("linker_file_add_dependency:" From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 15:06:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2E43E346; Sat, 12 Apr 2014 15:06: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 1A16D1096; Sat, 12 Apr 2014 15:06: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 s3CF6FLs093468; Sat, 12 Apr 2014 15:06:15 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CF6FQH093467; Sat, 12 Apr 2014 15:06:15 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201404121506.s3CF6FQH093467@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 12 Apr 2014 15:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264372 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 15:06:16 -0000 Author: bapt Date: Sat Apr 12 15:06:15 2014 New Revision: 264372 URL: http://svnweb.freebsd.org/changeset/base/264372 Log: MFC: r263881, r263952, r263983, r264068, r264090, r264131 Some xdev fixes: - if TARGET_ARCH is not defined and XDEV_ARCH is defined then early define TARGET_ARCH to the valud of XDEV_ARCH: This allow the xdev-build target to be able to correctly chose the compiler it needs to build - Allow overwriting XDTP to allow a user to not chose where the xdev env will live in - Fix build for gcc only xdev (like ia64) by providing the proper -B to the toolchain and not relying on gcc being installed already in base - Fix TOOLS_PREFIX so the generated toolchain has the right default sysroot when installed intead of getting the DESTDIR one - Fix supporting DESTDIR - Also overwrite CXX (needed for cross building c++ libraries with clang) and CPP (needed to cross build some libraries when gcc is the target default compiler but gcc is not installed on the building host) - Prevent XDTP from being a relative path: XDTP is used as the default SYSROOT for clang and thus should be an absolute path. - Respect default CC Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Sat Apr 12 14:18:48 2014 (r264371) +++ stable/10/Makefile.inc1 Sat Apr 12 15:06:15 2014 (r264372) @@ -975,6 +975,8 @@ INSTALLKERNEL= ${_kernel} .endif .endfor +buildkernel ${WMAKE_TGTS} ${.ALLTARGETS:M_*}: .MAKE + # # buildkernel # @@ -1369,6 +1371,9 @@ build-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} || ${BOOTSTRAPPING} < 800035 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" _btxld= usr.sbin/btxld @@ -1875,15 +1880,21 @@ NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOU CPUTYPE=${XDEV_CPUTYPE} XDDIR=${XDEV_ARCH}-freebsd -XDTP=usr/${XDDIR} +XDTP?=/usr/${XDDIR} +.if ${XDTP:N/*} +.error XDTP variable should be an absolute path +.endif + CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ INSTALL="sh ${.CURDIR}/tools/install.sh" CDENV= ${CDBENV} \ _SHLIBDIRPREFIX=${XDDESTDIR} \ - TOOLS_PREFIX=${XDDESTDIR} + TOOLS_PREFIX=${XDTP} CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \ - -B${XDDESTDIR}/usr/lib -CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" \ + --sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \ + -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} CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp @@ -1922,11 +1933,11 @@ _xb-build-tools: _xb-cross-tools: .for _tool in \ - gnu/usr.bin/binutils \ - gnu/usr.bin/cc \ + ${_binutils} \ usr.bin/ar \ ${_clang_libs} \ - ${_clang} + ${_clang} \ + ${_cc} ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool} && \ ${CDMAKE} DIRPRFX=${_tool}/ obj && \ @@ -1950,10 +1961,11 @@ xdev-install: xdev-build _xi-mtree _xi-c _xi-cross-tools: @echo "_xi-cross-tools" .for _tool in \ - gnu/usr.bin/binutils \ - gnu/usr.bin/cc \ + ${_binutils} \ usr.bin/ar \ - ${_clang} + ${_clang_libs} \ + ${_clang} \ + ${_cc} ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} @@ -1980,5 +1992,3 @@ _xi-links: xdev xdev-build xdev-install: @echo "*** Error: Both XDEV and XDEV_ARCH must be defined for \"${.TARGET}\" target" .endif - -buildkernel ${WMAKE_TGTS} ${.ALLTARGETS:M_*}: .MAKE From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 15:13:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D4083506; Sat, 12 Apr 2014 15:13: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 C0547113F; Sat, 12 Apr 2014 15:13:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CFDhDe097296; Sat, 12 Apr 2014 15:13:43 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CFDhQR097295; Sat, 12 Apr 2014 15:13:43 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201404121513.s3CFDhQR097295@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 12 Apr 2014 15:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264373 - stable/10/contrib/byacc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 15:13:43 -0000 Author: bapt Date: Sat Apr 12 15:13:43 2014 New Revision: 264373 URL: http://svnweb.freebsd.org/changeset/base/264373 Log: MFC: r263948 Convert an unused banner from skeleton.c into a comment. It is added to every generated files and fix build at certain warning level with clang 3.4 Submitted by: Thomas Dickey (byacc upstream) Spotted by: glebius Modified: stable/10/contrib/byacc/skeleton.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/byacc/skeleton.c ============================================================================== --- stable/10/contrib/byacc/skeleton.c Sat Apr 12 15:06:15 2014 (r264372) +++ stable/10/contrib/byacc/skeleton.c Sat Apr 12 15:13:43 2014 (r264373) @@ -16,9 +16,9 @@ const char *const banner[] = { - "#ifndef lint", - "static const char yysccsid[] = \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\";", - "#endif", + "/* original parser id follows */", + "/* yysccsid[] = \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\" */", + "/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */", "", "#define YYBYACC 1", CONCAT1("#define YYMAJOR ", YYMAJOR), From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 19:57:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 52A0435F; Sat, 12 Apr 2014 19:57: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 3DCC4190A; Sat, 12 Apr 2014 19:57: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 s3CJvGmI013627; Sat, 12 Apr 2014 19:57:16 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CJvFnc013622; Sat, 12 Apr 2014 19:57:15 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201404121957.s3CJvFnc013622@svn.freebsd.org> From: Andreas Tobler Date: Sat, 12 Apr 2014 19:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264375 - in stable/10/sys: modules/sound/driver/ai2s powerpc/include powerpc/powermac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 19:57:16 -0000 Author: andreast Date: Sat Apr 12 19:57:15 2014 New Revision: 264375 URL: http://svnweb.freebsd.org/changeset/base/264375 Log: MFC r260607, r260610, r260934: r260607: The onyx codec works also as module, so add it. r260610: Described in the man page but not implemented. Here it comes, atomic_swap_32/64. The latter only for powerpc64. r260934: Fix the resource information for the i2s-a node on certain G5 PowerMacs. This is the first step needed to get the snapper codec working on those machines. The second step is to enable the corresponding I2S device and its clock. Tested on machines where the snapper codec was already working, a G4 PowerBook and a PowerMac9,1 with a Shasta based macio. The PowerMac7,2/7,3 with a K2 based macio can now also play sound. Modified: stable/10/sys/modules/sound/driver/ai2s/Makefile stable/10/sys/powerpc/include/atomic.h stable/10/sys/powerpc/powermac/macio.c stable/10/sys/powerpc/powermac/maciovar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/sound/driver/ai2s/Makefile ============================================================================== --- stable/10/sys/modules/sound/driver/ai2s/Makefile Sat Apr 12 18:01:25 2014 (r264374) +++ stable/10/sys/modules/sound/driver/ai2s/Makefile Sat Apr 12 19:57:15 2014 (r264375) @@ -5,6 +5,6 @@ KMOD= snd_ai2s SRCS= device_if.h bus_if.h ofw_bus_if.h SRCS+= channel_if.h feeder_if.h mixer_if.h -SRCS+= snapper.c tumbler.c aoa.c i2s.c +SRCS+= onyx.c snapper.c tumbler.c aoa.c i2s.c .include Modified: stable/10/sys/powerpc/include/atomic.h ============================================================================== --- stable/10/sys/powerpc/include/atomic.h Sat Apr 12 18:01:25 2014 (r264374) +++ stable/10/sys/powerpc/include/atomic.h Sat Apr 12 19:57:15 2014 (r264375) @@ -684,10 +684,47 @@ atomic_fetchadd_long(volatile u_long *p, return (value); } +static __inline u_int +atomic_swap_32(volatile u_int *p, u_int v) +{ + u_int prev; + + __asm __volatile( + "1: lwarx %0,0,%2\n" + " stwcx. %3,0,%2\n" + " bne- 1b\n" + : "=&r" (prev), "+m" (*(volatile u_int *)p) + : "r" (p), "r" (v) + : "cc", "memory"); + + return (prev); +} + +#ifdef __powerpc64__ +static __inline u_long +atomic_swap_64(volatile u_long *p, u_long v) +{ + u_long prev; + + __asm __volatile( + "1: ldarx %0,0,%2\n" + " stdcx. %3,0,%2\n" + " bne- 1b\n" + : "=&r" (prev), "+m" (*(volatile u_long *)p) + : "r" (p), "r" (v) + : "cc", "memory"); + + return (prev); +} +#endif + #define atomic_fetchadd_32 atomic_fetchadd_int +#define atomic_swap_int atomic_swap_32 #ifdef __powerpc64__ #define atomic_fetchadd_64 atomic_fetchadd_long +#define atomic_swap_long atomic_swap_64 +#define atomic_swap_ptr atomic_swap_64 #endif #undef __ATOMIC_REL Modified: stable/10/sys/powerpc/powermac/macio.c ============================================================================== --- stable/10/sys/powerpc/powermac/macio.c Sat Apr 12 18:01:25 2014 (r264374) +++ stable/10/sys/powerpc/powermac/macio.c Sat Apr 12 19:57:15 2014 (r264375) @@ -236,13 +236,45 @@ macio_add_intr(phandle_t devnode, struct static void macio_add_reg(phandle_t devnode, struct macio_devinfo *dinfo) { - struct macio_reg *reg; - int i, nreg; + struct macio_reg *reg, *regp; + phandle_t child; + char buf[8]; + int i, layout_id = 0, nreg, res; nreg = OF_getprop_alloc(devnode, "reg", sizeof(*reg), (void **)®); if (nreg == -1) return; + /* + * Some G5's have broken properties in the i2s-a area. If so we try + * to fix it. Right now we know of two different cases, one for + * sound layout-id 36 and the other one for sound layout-id 76. + * What is missing is the base address for the memory addresses. + * We take them from the parent node (i2s) and use the size + * information from the child. + */ + + if (reg[0].mr_base == 0) { + child = OF_child(devnode); + while (child != 0) { + res = OF_getprop(child, "name", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "sound") == 0) + break; + child = OF_peer(child); + } + + res = OF_getprop(child, "layout-id", &layout_id, + sizeof(layout_id)); + + if (res > 0 && (layout_id == 36 || layout_id == 76)) { + res = OF_getprop_alloc(OF_parent(devnode), "reg", + sizeof(*regp), (void **)®p); + reg[0] = regp[0]; + reg[1].mr_base = regp[1].mr_base; + reg[2].mr_base = regp[1].mr_base + reg[1].mr_size; + } + } + for (i = 0; i < nreg; i++) { resource_list_add(&dinfo->mdi_resources, SYS_RES_MEMORY, i, reg[i].mr_base, reg[i].mr_base + reg[i].mr_size, @@ -284,6 +316,7 @@ macio_attach(device_t dev) phandle_t subchild; device_t cdev; u_int reg[3]; + char compat[32]; int error, quirks; sc = device_get_softc(dev); @@ -297,6 +330,9 @@ macio_attach(device_t dev) return (ENXIO); } + /* Used later to see if we have to enable the I2S part. */ + OF_getprop(root, "compatible", compat, sizeof(compat)); + sc->sc_base = reg[2]; sc->sc_size = MACIO_REG_SIZE; @@ -378,6 +414,21 @@ macio_attach(device_t dev) bus_write_4(sc->sc_memr, HEATHROW_FCR, fcr); } + + /* + * Make sure the I2S0 and the I2S0_CLK are enabled. + * On certain G5's they are not. + */ + if ((strcmp(ofw_bus_get_name(cdev), "i2s") == 0) && + (strcmp(compat, "K2-Keylargo") == 0)) { + + uint32_t fcr1; + + fcr1 = bus_read_4(sc->sc_memr, KEYLARGO_FCR1); + fcr1 |= FCR1_I2S0_CLK_ENABLE | FCR1_I2S0_ENABLE; + bus_write_4(sc->sc_memr, KEYLARGO_FCR1, fcr1); + } + } return (bus_generic_attach(dev)); Modified: stable/10/sys/powerpc/powermac/maciovar.h ============================================================================== --- stable/10/sys/powerpc/powermac/maciovar.h Sat Apr 12 18:01:25 2014 (r264374) +++ stable/10/sys/powerpc/powermac/maciovar.h Sat Apr 12 19:57:15 2014 (r264375) @@ -48,6 +48,9 @@ #define FCR_ENET_ENABLE 0x60000000 #define FCR_ENET_RESET 0x80000000 +#define FCR1_I2S0_CLK_ENABLE 0x00001000 +#define FCR1_I2S0_ENABLE 0x00002000 + /* Used only by macio_enable_wireless() for now. */ #define KEYLARGO_GPIO_BASE 0x6a #define KEYLARGO_EXTINT_GPIO_REG_BASE 0x58 From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 20:23:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4ABF39E2; Sat, 12 Apr 2014 20:23: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 324181B12; Sat, 12 Apr 2014 20:23: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 s3CKN5k3025698; Sat, 12 Apr 2014 20:23:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CKN0Js025661; Sat, 12 Apr 2014 20:23:00 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404122023.s3CKN0Js025661@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 12 Apr 2014 20:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264377 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-compat crypto/openssh/regress secu... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 20:23:05 -0000 Author: des Date: Sat Apr 12 20:22:59 2014 New Revision: 264377 URL: http://svnweb.freebsd.org/changeset/base/264377 Log: MFH (r263712): upgrade openssh to 6.6p1 MFH (r264308): restore p level in debugging output Added: stable/10/crypto/openssh/digest-libc.c - copied unchanged from r263712, head/crypto/openssh/digest-libc.c stable/10/crypto/openssh/digest-openssl.c - copied unchanged from r263712, head/crypto/openssh/digest-openssl.c stable/10/crypto/openssh/hmac.c - copied unchanged from r263712, head/crypto/openssh/hmac.c stable/10/crypto/openssh/hmac.h - copied unchanged from r263712, head/crypto/openssh/hmac.h stable/10/crypto/openssh/openbsd-compat/explicit_bzero.c - copied unchanged from r263712, head/crypto/openssh/openbsd-compat/explicit_bzero.c stable/10/crypto/openssh/regress/dhgex.sh - copied unchanged from r263712, head/crypto/openssh/regress/dhgex.sh Deleted: stable/10/crypto/openssh/auth2-jpake.c stable/10/crypto/openssh/digest.c stable/10/crypto/openssh/jpake.c stable/10/crypto/openssh/jpake.h stable/10/crypto/openssh/schnorr.h Modified: stable/10/crypto/openssh/ChangeLog stable/10/crypto/openssh/Makefile.in stable/10/crypto/openssh/README stable/10/crypto/openssh/auth-rsa.c stable/10/crypto/openssh/auth.h stable/10/crypto/openssh/auth1.c stable/10/crypto/openssh/auth2-chall.c stable/10/crypto/openssh/auth2-gss.c stable/10/crypto/openssh/auth2-passwd.c stable/10/crypto/openssh/auth2.c stable/10/crypto/openssh/authfd.c stable/10/crypto/openssh/authfile.c stable/10/crypto/openssh/bufaux.c stable/10/crypto/openssh/bufbn.c stable/10/crypto/openssh/bufec.c stable/10/crypto/openssh/buffer.c stable/10/crypto/openssh/canohost.c stable/10/crypto/openssh/channels.c stable/10/crypto/openssh/cipher-3des1.c stable/10/crypto/openssh/cipher-chachapoly.c stable/10/crypto/openssh/cipher.c stable/10/crypto/openssh/clientloop.c stable/10/crypto/openssh/config.h stable/10/crypto/openssh/config.h.in stable/10/crypto/openssh/configure stable/10/crypto/openssh/configure.ac stable/10/crypto/openssh/contrib/caldera/openssh.spec stable/10/crypto/openssh/contrib/redhat/openssh.spec stable/10/crypto/openssh/contrib/suse/openssh.spec stable/10/crypto/openssh/digest.h stable/10/crypto/openssh/gss-serv.c stable/10/crypto/openssh/hostfile.c stable/10/crypto/openssh/kex.c stable/10/crypto/openssh/kex.h stable/10/crypto/openssh/kexc25519.c stable/10/crypto/openssh/kexdhc.c stable/10/crypto/openssh/kexdhs.c stable/10/crypto/openssh/kexecdhc.c stable/10/crypto/openssh/kexecdhs.c stable/10/crypto/openssh/kexgexc.c stable/10/crypto/openssh/kexgexs.c stable/10/crypto/openssh/key.c stable/10/crypto/openssh/krl.c stable/10/crypto/openssh/mac.c stable/10/crypto/openssh/moduli.0 stable/10/crypto/openssh/monitor.c stable/10/crypto/openssh/monitor.h stable/10/crypto/openssh/monitor_wrap.c stable/10/crypto/openssh/monitor_wrap.h stable/10/crypto/openssh/openbsd-compat/Makefile.in stable/10/crypto/openssh/openbsd-compat/bsd-poll.c stable/10/crypto/openssh/openbsd-compat/openbsd-compat.h stable/10/crypto/openssh/openbsd-compat/openssl-compat.c stable/10/crypto/openssh/openbsd-compat/openssl-compat.h stable/10/crypto/openssh/packet.c stable/10/crypto/openssh/readconf.c stable/10/crypto/openssh/readconf.h stable/10/crypto/openssh/readpass.c stable/10/crypto/openssh/regress/Makefile stable/10/crypto/openssh/regress/agent-ptrace.sh stable/10/crypto/openssh/regress/agent.sh stable/10/crypto/openssh/regress/cert-hostkey.sh stable/10/crypto/openssh/regress/host-expand.sh stable/10/crypto/openssh/regress/login-timeout.sh stable/10/crypto/openssh/regress/scp-ssh-wrapper.sh stable/10/crypto/openssh/regress/scp.sh stable/10/crypto/openssh/regress/setuid-allowed.c stable/10/crypto/openssh/regress/sftp-chroot.sh stable/10/crypto/openssh/rsa.c stable/10/crypto/openssh/sandbox-capsicum.c stable/10/crypto/openssh/sandbox-seccomp-filter.c stable/10/crypto/openssh/sandbox-systrace.c stable/10/crypto/openssh/scp.0 stable/10/crypto/openssh/servconf.c stable/10/crypto/openssh/servconf.h stable/10/crypto/openssh/serverloop.c stable/10/crypto/openssh/session.c stable/10/crypto/openssh/sftp-client.c stable/10/crypto/openssh/sftp-server.0 stable/10/crypto/openssh/sftp.0 stable/10/crypto/openssh/ssh-add.0 stable/10/crypto/openssh/ssh-add.c stable/10/crypto/openssh/ssh-agent.0 stable/10/crypto/openssh/ssh-agent.c stable/10/crypto/openssh/ssh-dss.c stable/10/crypto/openssh/ssh-ecdsa.c stable/10/crypto/openssh/ssh-ed25519.c stable/10/crypto/openssh/ssh-gss.h stable/10/crypto/openssh/ssh-keygen.0 stable/10/crypto/openssh/ssh-keygen.1 stable/10/crypto/openssh/ssh-keygen.c stable/10/crypto/openssh/ssh-keyscan.0 stable/10/crypto/openssh/ssh-keyscan.1 stable/10/crypto/openssh/ssh-keysign.0 stable/10/crypto/openssh/ssh-pkcs11-helper.0 stable/10/crypto/openssh/ssh-rsa.c stable/10/crypto/openssh/ssh.0 stable/10/crypto/openssh/ssh.c stable/10/crypto/openssh/ssh2.h stable/10/crypto/openssh/ssh_config stable/10/crypto/openssh/ssh_config.0 stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/ssh_namespace.h stable/10/crypto/openssh/sshconnect.c stable/10/crypto/openssh/sshconnect1.c stable/10/crypto/openssh/sshconnect2.c stable/10/crypto/openssh/sshd.0 stable/10/crypto/openssh/sshd.c stable/10/crypto/openssh/sshd_config stable/10/crypto/openssh/sshd_config.0 stable/10/crypto/openssh/sshd_config.5 stable/10/crypto/openssh/sshlogin.c stable/10/crypto/openssh/version.h stable/10/secure/lib/libssh/Makefile stable/10/secure/usr.sbin/sshd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/crypto/openssh/ChangeLog ============================================================================== --- stable/10/crypto/openssh/ChangeLog Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/ChangeLog Sat Apr 12 20:22:59 2014 (r264377) @@ -1,3 +1,224 @@ +20140313 + - (djm) Release OpenSSH 6.6 + +20140304 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/03/03 22:22:30 + [session.c] + ignore enviornment variables with embedded '=' or '\0' characters; + spotted by Jann Horn; ok deraadt@ + +20140301 + - (djm) [regress/Makefile] Disable dhgex regress test; it breaks when + no moduli file exists at the expected location. + +20140228 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/02/27 00:41:49 + [bufbn.c] + fix unsigned overflow that could lead to reading a short ssh protocol + 1 bignum value; found by Ben Hawkes; ok deraadt@ + - djm@cvs.openbsd.org 2014/02/27 08:25:09 + [bufbn.c] + off by one in range check + - djm@cvs.openbsd.org 2014/02/27 22:47:07 + [sshd_config.5] + bz#2184 clarify behaviour of a keyword that appears in multiple + matching Match blocks; ok dtucker@ + - djm@cvs.openbsd.org 2014/02/27 22:57:40 + [version.h] + openssh-6.6 + - dtucker@cvs.openbsd.org 2014/01/19 23:43:02 + [regress/sftp-chroot.sh] + Don't use -q on sftp as it suppresses logging, instead redirect the + output to the regress logfile. + - dtucker@cvs.openbsd.org 2014/01/20 00:00:30 + [sregress/ftp-chroot.sh] + append to rather than truncating the log file + - dtucker@cvs.openbsd.org 2014/01/25 04:35:32 + [regress/Makefile regress/dhgex.sh] + Add a test for DH GEX sizes + - djm@cvs.openbsd.org 2014/01/26 10:22:10 + [regress/cert-hostkey.sh] + automatically generate revoked keys from listed keys rather than + manually specifying each type; from portable + (Id sync only) + - djm@cvs.openbsd.org 2014/01/26 10:49:17 + [scp-ssh-wrapper.sh scp.sh] + make sure $SCP is tested on the remote end rather than whichever one + happens to be in $PATH; from portable + (Id sync only) + - djm@cvs.openbsd.org 2014/02/27 20:04:16 + [login-timeout.sh] + remove any existing LoginGraceTime from sshd_config before adding + a specific one for the test back in + - djm@cvs.openbsd.org 2014/02/27 21:21:25 + [agent-ptrace.sh agent.sh] + keep return values that are printed in error messages; + from portable + (Id sync only) + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers + - (djm) [regress/host-expand.sh] Add RCS Id + +20140227 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/02/26 20:18:37 + [ssh.c] + bz#2205: avoid early hostname lookups unless canonicalisation is enabled; + ok dtucker@ markus@ + - djm@cvs.openbsd.org 2014/02/26 20:28:44 + [auth2-gss.c gss-serv.c ssh-gss.h sshd.c] + bz#2107 - cache OIDs of supported GSSAPI mechanisms before privsep + sandboxing, as running this code in the sandbox can cause violations; + ok markus@ + - djm@cvs.openbsd.org 2014/02/26 20:29:29 + [channels.c] + don't assume that the socks4 username is \0 terminated; + spotted by Ben Hawkes; ok markus@ + - markus@cvs.openbsd.org 2014/02/26 21:53:37 + [sshd.c] + ssh_gssapi_prepare_supported_oids needs GSSAPI + +20140224 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/02/07 06:55:54 + [cipher.c mac.c] + remove some logging that makes ssh debugging output very verbose; + ok markus + - djm@cvs.openbsd.org 2014/02/15 23:05:36 + [channels.c] + avoid spurious "getsockname failed: Bad file descriptor" errors in ssh -W; + bz#2200, debian#738692 via Colin Watson; ok dtucker@ + - djm@cvs.openbsd.org 2014/02/22 01:32:19 + [readconf.c] + when processing Match blocks, skip 'exec' clauses if previous predicates + failed to match; ok markus@ + - djm@cvs.openbsd.org 2014/02/23 20:03:42 + [ssh-ed25519.c] + check for unsigned overflow; not reachable in OpenSSH but others might + copy our code... + - djm@cvs.openbsd.org 2014/02/23 20:11:36 + [readconf.c readconf.h ssh.c ssh_config.5] + reparse ssh_config and ~/.ssh/config if hostname canonicalisation changes + the hostname. This allows users to write configurations that always + refer to canonical hostnames, e.g. + + CanonicalizeHostname yes + CanonicalDomains int.example.org example.org + CanonicalizeFallbackLocal no + + Host *.int.example.org + Compression off + Host *.example.org + User djm + + ok markus@ + +20140213 + - (dtucker) [configure.ac openbsd-compat/openssl-compat.{c,h}] Add compat + code for older OpenSSL versions that don't have EVP_MD_CTX_copy_ex. + +20140207 + - OpenBSD CVS Sync + - naddy@cvs.openbsd.org 2014/02/05 20:13:25 + [ssh-keygen.1 ssh-keygen.c] + tweak synopsis: calling ssh-keygen without any arguments is fine; ok jmc@ + while here, fix ordering in usage(); requested by jmc@ + - djm@cvs.openbsd.org 2014/02/06 22:21:01 + [sshconnect.c] + in ssh_create_socket(), only do the getaddrinfo for BindAddress when + BindAddress is actually specified. Fixes regression in 6.5 for + UsePrivilegedPort=yes; patch from Corinna Vinschen + +20140206 + - (dtucker) [openbsd-compat/bsd-poll.c] Don't bother checking for non-NULL + before freeing since free(NULL) is a no-op. ok djm. + - (djm) [sandbox-seccomp-filter.c] Not all Linux architectures define + __NR_shutdown; some go via the socketcall(2) multiplexer. + +20140205 + - (djm) [sandbox-capsicum.c] Don't fatal if Capsicum is offered by + headers/libc but not supported by the kernel. Patch from Loganaden + Velvindron @ AfriNIC + +20140204 + - OpenBSD CVS Sync + - markus@cvs.openbsd.org 2014/01/27 18:58:14 + [Makefile.in digest.c digest.h hostfile.c kex.h mac.c hmac.c hmac.h] + replace openssl HMAC with an implementation based on our ssh_digest_* + ok and feedback djm@ + - markus@cvs.openbsd.org 2014/01/27 19:18:54 + [auth-rsa.c cipher.c ssh-agent.c sshconnect1.c sshd.c] + replace openssl MD5 with our ssh_digest_*; ok djm@ + - markus@cvs.openbsd.org 2014/01/27 20:13:46 + [digest.c digest-openssl.c digest-libc.c Makefile.in] + rename digest.c to digest-openssl.c and add libc variant; ok djm@ + - jmc@cvs.openbsd.org 2014/01/28 14:13:39 + [ssh-keyscan.1] + kill some bad Pa; + From: Jan Stary + - djm@cvs.openbsd.org 2014/01/29 00:19:26 + [sshd.c] + use kill(0, ...) instead of killpg(0, ...); on most operating systems + they are equivalent, but SUSv2 describes the latter as having undefined + behaviour; from portable; ok dtucker + (Id sync only; change is already in portable) + - djm@cvs.openbsd.org 2014/01/29 06:18:35 + [Makefile.in auth.h auth2-jpake.c auth2.c jpake.c jpake.h monitor.c] + [monitor.h monitor_wrap.c monitor_wrap.h readconf.c readconf.h] + [schnorr.c schnorr.h servconf.c servconf.h ssh2.h sshconnect2.c] + remove experimental, never-enabled JPAKE code; ok markus@ + - jmc@cvs.openbsd.org 2014/01/29 14:04:51 + [sshd_config.5] + document kbdinteractiveauthentication; + requested From: Ross L Richardson + + dtucker/markus helped explain its workings; + - djm@cvs.openbsd.org 2014/01/30 22:26:14 + [sandbox-systrace.c] + allow shutdown(2) syscall in sandbox - it may be called by packet_close() + from portable + (Id sync only; change is already in portable) + - tedu@cvs.openbsd.org 2014/01/31 16:39:19 + [auth2-chall.c authfd.c authfile.c bufaux.c bufec.c canohost.c] + [channels.c cipher-chachapoly.c clientloop.c configure.ac hostfile.c] + [kexc25519.c krl.c monitor.c sandbox-systrace.c session.c] + [sftp-client.c ssh-keygen.c ssh.c sshconnect2.c sshd.c sshlogin.c] + [openbsd-compat/explicit_bzero.c openbsd-compat/openbsd-compat.h] + replace most bzero with explicit_bzero, except a few that cna be memset + ok djm dtucker + - djm@cvs.openbsd.org 2014/02/02 03:44:32 + [auth1.c auth2-chall.c auth2-passwd.c authfile.c bufaux.c bufbn.c] + [buffer.c cipher-3des1.c cipher.c clientloop.c gss-serv.c kex.c] + [kexdhc.c kexdhs.c kexecdhc.c kexgexc.c kexecdhs.c kexgexs.c key.c] + [monitor.c monitor_wrap.c packet.c readpass.c rsa.c serverloop.c] + [ssh-add.c ssh-agent.c ssh-dss.c ssh-ecdsa.c ssh-ed25519.c] + [ssh-keygen.c ssh-rsa.c sshconnect.c sshconnect1.c sshconnect2.c] + [sshd.c] + convert memset of potentially-private data to explicit_bzero() + - djm@cvs.openbsd.org 2014/02/03 23:28:00 + [ssh-ecdsa.c] + fix memory leak; ECDSA_SIG_new() allocates 'r' and 's' for us, unlike + DSA_SIG_new. Reported by Batz Spear; ok markus@ + - djm@cvs.openbsd.org 2014/02/02 03:44:31 + [digest-libc.c digest-openssl.c] + convert memset of potentially-private data to explicit_bzero() + - djm@cvs.openbsd.org 2014/02/04 00:24:29 + [ssh.c] + delay lowercasing of hostname until right before hostname + canonicalisation to unbreak case-sensitive matching of ssh_config; + reported by Ike Devolder; ok markus@ + - (djm) [openbsd-compat/Makefile.in] Add missing explicit_bzero.o + - (djm) [regress/setuid-allowed.c] Missing string.h for strerror() + +20140131 + - (djm) [sandbox-seccomp-filter.c sandbox-systrace.c] Allow shutdown(2) + syscall from sandboxes; it may be called by packet_close. + - (dtucker) [readconf.c] Include for the hton macros. Fixes + build with HP-UX's compiler. Patch from Kevin Brott. + - (tim) [Makefile.in] build regress/setuid-allow. + 20140130 - (djm) [configure.ac] Only check for width-specified integer types in headers that actually exist. patch from Tom G. Christensen; @@ -2663,3 +2884,4 @@ [contrib/suse/openssh.spec] Update for release 6.0 - (djm) [README] Update URL to release notes. - (djm) Release openssh-6.0 + Modified: stable/10/crypto/openssh/Makefile.in ============================================================================== --- stable/10/crypto/openssh/Makefile.in Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/Makefile.in Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.352 2014/01/27 06:35:04 dtucker Exp $ +# $Id: Makefile.in,v 1.356 2014/02/04 00:12:56 djm Exp $ # uncomment if you run a non bourne compatable shell. Ie. csh #SHELL = @SH@ @@ -73,9 +73,9 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \ msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ - jpake.o schnorr.o ssh-pkcs11.o krl.o smult_curve25519_ref.o \ + ssh-pkcs11.o krl.o smult_curve25519_ref.o \ kexc25519.o kexc25519c.o poly1305.o chacha.o cipher-chachapoly.o \ - ssh-ed25519.o digest.o \ + ssh-ed25519.o digest-openssl.o hmac.o \ sc25519.o ge25519.o fe25519.o ed25519.o verify.o hash.o blocks.o SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ @@ -88,7 +88,7 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passw auth.o auth1.o auth2.o auth-options.o session.o \ auth-chall.o auth2-chall.o groupaccess.o \ auth-skey.o auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \ - auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake.o \ + auth2-none.o auth2-passwd.o auth2-pubkey.o \ monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o kexecdhs.o \ kexc25519s.o auth-krb5.o \ auth2-gss.o gss-serv.o gss-serv-krb5.o \ @@ -408,7 +408,7 @@ regress/setuid-allowed$(EXEEXT): $(srcdi $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $? \ $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) -tests interop-tests: $(TARGETS) regress/modpipe$(EXEEXT) +tests interop-tests: $(TARGETS) regress/modpipe$(EXEEXT) regress/setuid-allowed$(EXEEXT) BUILDDIR=`pwd`; \ TEST_SHELL="@TEST_SHELL@"; \ TEST_SSH_SCP="$${BUILDDIR}/scp"; \ Modified: stable/10/crypto/openssh/README ============================================================================== --- stable/10/crypto/openssh/README Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/README Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-6.5 for the release notes. +See http://www.openssh.com/txt/release-6.6 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.85 2014/01/16 07:51:45 djm Exp $ +$Id: README,v 1.86 2014/02/27 23:03:53 djm Exp $ Modified: stable/10/crypto/openssh/auth-rsa.c ============================================================================== --- stable/10/crypto/openssh/auth-rsa.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/auth-rsa.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-rsa.c,v 1.85 2013/07/12 00:19:58 djm Exp $ */ +/* $OpenBSD: auth-rsa.c,v 1.86 2014/01/27 19:18:54 markus Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -48,6 +47,8 @@ #include "ssh.h" #include "misc.h" +#include "digest.h" + /* import */ extern ServerOptions options; @@ -91,12 +92,13 @@ int auth_rsa_verify_response(Key *key, BIGNUM *challenge, u_char response[16]) { u_char buf[32], mdbuf[16]; - MD5_CTX md; + struct ssh_digest_ctx *md; int len; /* don't allow short keys */ if (BN_num_bits(key->rsa->n) < SSH_RSA_MINIMUM_MODULUS_SIZE) { - error("auth_rsa_verify_response: RSA modulus too small: %d < minimum %d bits", + error("%s: RSA modulus too small: %d < minimum %d bits", + __func__, BN_num_bits(key->rsa->n), SSH_RSA_MINIMUM_MODULUS_SIZE); return (0); } @@ -104,13 +106,15 @@ auth_rsa_verify_response(Key *key, BIGNU /* The response is MD5 of decrypted challenge plus session id. */ len = BN_num_bytes(challenge); if (len <= 0 || len > 32) - fatal("auth_rsa_verify_response: bad challenge length %d", len); + fatal("%s: bad challenge length %d", __func__, len); memset(buf, 0, 32); BN_bn2bin(challenge, buf + 32 - len); - MD5_Init(&md); - MD5_Update(&md, buf, 32); - MD5_Update(&md, session_id, 16); - MD5_Final(mdbuf, &md); + if ((md = ssh_digest_start(SSH_DIGEST_MD5)) == NULL || + ssh_digest_update(md, buf, 32) < 0 || + ssh_digest_update(md, session_id, 16) < 0 || + ssh_digest_final(md, mdbuf, sizeof(mdbuf)) < 0) + fatal("%s: md5 failed", __func__); + ssh_digest_free(md); /* Verify that the response is the original challenge. */ if (timingsafe_bcmp(response, mdbuf, 16) != 0) { Modified: stable/10/crypto/openssh/auth.h ============================================================================== --- stable/10/crypto/openssh/auth.h Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/auth.h Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth.h,v 1.76 2013/07/19 07:37:48 markus Exp $ */ +/* $OpenBSD: auth.h,v 1.77 2014/01/29 06:18:35 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -61,7 +61,6 @@ struct Authctxt { char *style; void *kbdintctxt; char *info; /* Extra info for next auth_log */ - void *jpake_ctx; #ifdef BSD_AUTH auth_session_t *as; #endif @@ -175,9 +174,6 @@ int bsdauth_respond(void *, u_int, char int skey_query(void *, char **, char **, u_int *, char ***, u_int **); int skey_respond(void *, u_int, char **); -void auth2_jpake_get_pwdata(Authctxt *, BIGNUM **, char **, char **); -void auth2_jpake_stop(Authctxt *); - int allowed_user(struct passwd *); struct passwd * getpwnamallow(const char *user); Modified: stable/10/crypto/openssh/auth1.c ============================================================================== --- stable/10/crypto/openssh/auth1.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/auth1.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth1.c,v 1.79 2013/05/19 02:42:42 djm Exp $ */ +/* $OpenBSD: auth1.c,v 1.80 2014/02/02 03:44:31 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -129,7 +129,7 @@ auth1_process_password(Authctxt *authctx /* Try authentication with the password. */ authenticated = PRIVSEP(auth_password(authctxt, password)); - memset(password, 0, dlen); + explicit_bzero(password, dlen); free(password); return (authenticated); @@ -222,7 +222,7 @@ auth1_process_tis_response(Authctxt *aut response = packet_get_string(&dlen); packet_check_eom(); authenticated = verify_response(authctxt, response); - memset(response, 'r', dlen); + explicit_bzero(response, dlen); free(response); return (authenticated); Modified: stable/10/crypto/openssh/auth2-chall.c ============================================================================== --- stable/10/crypto/openssh/auth2-chall.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/auth2-chall.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-chall.c,v 1.39 2013/11/08 00:39:14 djm Exp $ */ +/* $OpenBSD: auth2-chall.c,v 1.41 2014/02/02 03:44:31 djm Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2001 Per Allansson. All rights reserved. @@ -148,7 +148,7 @@ kbdint_free(KbdintAuthctxt *kbdintctxt) if (kbdintctxt->device) kbdint_reset_device(kbdintctxt); free(kbdintctxt->devices); - bzero(kbdintctxt, sizeof(*kbdintctxt)); + explicit_bzero(kbdintctxt, sizeof(*kbdintctxt)); free(kbdintctxt); } /* get next device */ @@ -312,7 +312,7 @@ input_userauth_info_response(int type, u res = kbdintctxt->device->respond(kbdintctxt->ctxt, nresp, response); for (i = 0; i < nresp; i++) { - memset(response[i], 'r', strlen(response[i])); + explicit_bzero(response[i], strlen(response[i])); free(response[i]); } free(response); Modified: stable/10/crypto/openssh/auth2-gss.c ============================================================================== --- stable/10/crypto/openssh/auth2-gss.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/auth2-gss.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-gss.c,v 1.20 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: auth2-gss.c,v 1.21 2014/02/26 20:28:44 djm Exp $ */ /* * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. @@ -62,7 +62,6 @@ userauth_gssapi(Authctxt *authctxt) gss_OID_desc goid = {0, NULL}; Gssctxt *ctxt = NULL; int mechs; - gss_OID_set supported; int present; OM_uint32 ms; u_int len; @@ -77,7 +76,6 @@ userauth_gssapi(Authctxt *authctxt) return (0); } - ssh_gssapi_supported_oids(&supported); do { mechs--; @@ -90,15 +88,12 @@ userauth_gssapi(Authctxt *authctxt) doid[1] == len - 2) { goid.elements = doid + 2; goid.length = len - 2; - gss_test_oid_set_member(&ms, &goid, supported, - &present); + ssh_gssapi_test_oid_supported(&ms, &goid, &present); } else { logit("Badly formed OID received"); } } while (mechs > 0 && !present); - gss_release_oid_set(&ms, &supported); - if (!present) { free(doid); authctxt->server_caused_failure = 1; Modified: stable/10/crypto/openssh/auth2-passwd.c ============================================================================== --- stable/10/crypto/openssh/auth2-passwd.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/auth2-passwd.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-passwd.c,v 1.10 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: auth2-passwd.c,v 1.11 2014/02/02 03:44:31 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -59,7 +59,7 @@ userauth_passwd(Authctxt *authctxt) if (change) { /* discard new password from packet */ newpass = packet_get_string(&newlen); - memset(newpass, 0, newlen); + explicit_bzero(newpass, newlen); free(newpass); } packet_check_eom(); @@ -68,7 +68,7 @@ userauth_passwd(Authctxt *authctxt) logit("password change not supported"); else if (PRIVSEP(auth_password(authctxt, password)) == 1) authenticated = 1; - memset(password, 0, len); + explicit_bzero(password, len); free(password); return authenticated; } Modified: stable/10/crypto/openssh/auth2.c ============================================================================== --- stable/10/crypto/openssh/auth2.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/auth2.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2.c,v 1.129 2013/05/19 02:42:42 djm Exp $ */ +/* $OpenBSD: auth2.c,v 1.130 2014/01/29 06:18:35 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -73,9 +73,6 @@ extern Authmethod method_hostbased; #ifdef GSSAPI extern Authmethod method_gssapi; #endif -#ifdef JPAKE -extern Authmethod method_jpake; -#endif Authmethod *authmethods[] = { &method_none, @@ -83,9 +80,6 @@ Authmethod *authmethods[] = { #ifdef GSSAPI &method_gssapi, #endif -#ifdef JPAKE - &method_jpake, -#endif &method_passwd, &method_kbdint, &method_hostbased, @@ -300,9 +294,6 @@ input_userauth_request(int type, u_int32 /* reset state */ auth2_challenge_stop(authctxt); -#ifdef JPAKE - auth2_jpake_stop(authctxt); -#endif #ifdef GSSAPI /* XXX move to auth2_gssapi_stop() */ Modified: stable/10/crypto/openssh/authfd.c ============================================================================== --- stable/10/crypto/openssh/authfd.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/authfd.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: authfd.c,v 1.91 2013/12/29 04:29:25 djm Exp $ */ +/* $OpenBSD: authfd.c,v 1.92 2014/01/31 16:39:19 tedu Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -102,7 +102,7 @@ ssh_get_authentication_socket(void) if (!authsocket) return -1; - bzero(&sunaddr, sizeof(sunaddr)); + memset(&sunaddr, 0, sizeof(sunaddr)); sunaddr.sun_family = AF_UNIX; strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path)); Modified: stable/10/crypto/openssh/authfile.c ============================================================================== --- stable/10/crypto/openssh/authfile.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/authfile.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: authfile.c,v 1.101 2013/12/29 04:35:50 djm Exp $ */ +/* $OpenBSD: authfile.c,v 1.103 2014/02/02 03:44:31 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -131,7 +131,7 @@ key_private_to_blob2(Key *prv, Buffer *b buffer_put_int(&kdf, rounds); } cipher_init(&ctx, c, key, keylen, key + keylen , ivlen, 1); - memset(key, 0, keylen + ivlen); + explicit_bzero(key, keylen + ivlen); free(key); buffer_init(&encoded); @@ -143,7 +143,7 @@ key_private_to_blob2(Key *prv, Buffer *b key_to_blob(prv, &cp, &len); /* public key */ buffer_put_string(&encoded, cp, len); - memset(cp, 0, len); + explicit_bzero(cp, len); free(cp); buffer_free(&kdf); @@ -409,7 +409,7 @@ key_parse_private2(Buffer *blob, int typ free(salt); free(comment); if (key) - memset(key, 0, keylen + ivlen); + explicit_bzero(key, keylen + ivlen); free(key); buffer_free(&encoded); buffer_free(©); @@ -496,10 +496,10 @@ key_private_rsa1_to_blob(Key *key, Buffe buffer_ptr(&buffer), buffer_len(&buffer), 0, 0) != 0) fatal("%s: cipher_crypt failed", __func__); cipher_cleanup(&ciphercontext); - memset(&ciphercontext, 0, sizeof(ciphercontext)); + explicit_bzero(&ciphercontext, sizeof(ciphercontext)); /* Destroy temporary data. */ - memset(buf, 0, sizeof(buf)); + explicit_bzero(buf, sizeof(buf)); buffer_free(&buffer); buffer_append(blob, buffer_ptr(&encrypted), buffer_len(&encrypted)); @@ -703,17 +703,17 @@ key_load_file(int fd, const char *filena __func__, filename == NULL ? "" : filename, filename == NULL ? "" : " ", strerror(errno)); buffer_clear(blob); - bzero(buf, sizeof(buf)); + explicit_bzero(buf, sizeof(buf)); return 0; } buffer_append(blob, buf, len); if (buffer_len(blob) > MAX_KEY_FILE_SIZE) { buffer_clear(blob); - bzero(buf, sizeof(buf)); + explicit_bzero(buf, sizeof(buf)); goto toobig; } } - bzero(buf, sizeof(buf)); + explicit_bzero(buf, sizeof(buf)); if ((st.st_mode & (S_IFSOCK|S_IFCHR|S_IFIFO)) == 0 && st.st_size != buffer_len(blob)) { debug("%s: key file %.200s%schanged size while reading", @@ -831,7 +831,7 @@ key_parse_private_rsa1(Buffer *blob, con buffer_ptr(©), buffer_len(©), 0, 0) != 0) fatal("%s: cipher_crypt failed", __func__); cipher_cleanup(&ciphercontext); - memset(&ciphercontext, 0, sizeof(ciphercontext)); + explicit_bzero(&ciphercontext, sizeof(ciphercontext)); buffer_free(©); check1 = buffer_get_char(&decrypted); Modified: stable/10/crypto/openssh/bufaux.c ============================================================================== --- stable/10/crypto/openssh/bufaux.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/bufaux.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: bufaux.c,v 1.54 2014/01/12 08:13:13 djm Exp $ */ +/* $OpenBSD: bufaux.c,v 1.56 2014/02/02 03:44:31 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -216,7 +216,7 @@ buffer_get_cstring_ret(Buffer *buffer, u if (cp == ret + length - 1) error("buffer_get_cstring_ret: string contains \\0"); else { - bzero(ret, length); + explicit_bzero(ret, length); free(ret); return NULL; } @@ -346,7 +346,7 @@ buffer_get_bignum2_as_string_ret(Buffer } ret = xmalloc(len); memcpy(ret, p, len); - memset(p, '\0', len); + explicit_bzero(p, len); free(bin); return ret; } @@ -383,7 +383,7 @@ buffer_put_bignum2_from_string(Buffer *b } memcpy(p, s, l); buffer_put_string(buffer, buf, l + pad); - memset(buf, '\0', l + pad); + explicit_bzero(buf, l + pad); free(buf); } Modified: stable/10/crypto/openssh/bufbn.c ============================================================================== --- stable/10/crypto/openssh/bufbn.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/bufbn.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: bufbn.c,v 1.8 2013/11/08 11:15:19 dtucker Exp $*/ +/* $OpenBSD: bufbn.c,v 1.11 2014/02/27 08:25:09 djm Exp $*/ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -80,7 +80,7 @@ buffer_put_bignum_ret(Buffer *buffer, co /* Store the binary data. */ buffer_append(buffer, buf, oi); - memset(buf, 0, bin_size); + explicit_bzero(buf, bin_size); free(buf); return (0); @@ -108,6 +108,11 @@ buffer_get_bignum_ret(Buffer *buffer, BI return (-1); } bits = get_u16(buf); + if (bits > 65535-7) { + error("buffer_get_bignum_ret: cannot handle BN of size %d", + bits); + return (-1); + } /* Compute the number of binary bytes that follow. */ bytes = (bits + 7) / 8; if (bytes > 8 * 1024) { @@ -173,7 +178,7 @@ buffer_put_bignum2_ret(Buffer *buffer, c } hasnohigh = (buf[1] & 0x80) ? 0 : 1; buffer_put_string(buffer, buf+hasnohigh, bytes-hasnohigh); - memset(buf, 0, bytes); + explicit_bzero(buf, bytes); free(buf); return (0); } Modified: stable/10/crypto/openssh/bufec.c ============================================================================== --- stable/10/crypto/openssh/bufec.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/bufec.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: bufec.c,v 1.2 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: bufec.c,v 1.3 2014/01/31 16:39:19 tedu Exp $ */ /* * Copyright (c) 2010 Damien Miller * @@ -77,7 +77,7 @@ buffer_put_ecpoint_ret(Buffer *buffer, c ret = 0; out: if (buf != NULL) { - bzero(buf, len); + explicit_bzero(buf, len); free(buf); } BN_CTX_free(bnctx); @@ -130,7 +130,7 @@ buffer_get_ecpoint_ret(Buffer *buffer, c ret = 0; out: BN_CTX_free(bnctx); - bzero(buf, len); + explicit_bzero(buf, len); free(buf); return ret; } Modified: stable/10/crypto/openssh/buffer.c ============================================================================== --- stable/10/crypto/openssh/buffer.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/buffer.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.34 2013/11/08 11:15:19 dtucker Exp $ */ +/* $OpenBSD: buffer.c,v 1.35 2014/02/02 03:44:31 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -50,7 +50,7 @@ void buffer_free(Buffer *buffer) { if (buffer->alloc > 0) { - memset(buffer->buf, 0, buffer->alloc); + explicit_bzero(buffer->buf, buffer->alloc); buffer->alloc = 0; free(buffer->buf); } Modified: stable/10/crypto/openssh/canohost.c ============================================================================== --- stable/10/crypto/openssh/canohost.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/canohost.c Sat Apr 12 20:22:59 2014 (r264377) @@ -192,7 +192,7 @@ ipv64_normalise_mapped(struct sockaddr_s memcpy(&inaddr, ((char *)&a6->sin6_addr) + 12, sizeof(inaddr)); port = a6->sin6_port; - bzero(a4, sizeof(*a4)); + memset(a4, 0, sizeof(*a4)); a4->sin_family = AF_INET; *len = sizeof(*a4); Modified: stable/10/crypto/openssh/channels.c ============================================================================== --- stable/10/crypto/openssh/channels.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/channels.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.328 2013/12/19 01:04:36 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.331 2014/02/26 20:29:29 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -430,7 +430,7 @@ channel_free(Channel *c) if (cc->abandon_cb != NULL) cc->abandon_cb(c, cc->ctx); TAILQ_REMOVE(&c->status_confirms, cc, entry); - bzero(cc, sizeof(*cc)); + explicit_bzero(cc, sizeof(*cc)); free(cc); } if (c->filter_cleanup != NULL && c->filter_ctx != NULL) @@ -1114,6 +1114,9 @@ channel_decode_socks4(Channel *c, fd_set buffer_get(&c->input, (char *)&s4_req.dest_addr, 4); have = buffer_len(&c->input); p = buffer_ptr(&c->input); + if (memchr(p, '\0', have) == NULL) + fatal("channel %d: decode socks4: user not nul terminated", + c->self); len = strlen(p); debug2("channel %d: decode socks4: user %s/%d", c->self, p, len); len++; /* trailing '\0' */ @@ -1428,7 +1431,7 @@ port_open_helper(Channel *c, char *rtype int direct; char buf[1024]; char *local_ipaddr = get_local_ipaddr(c->sock); - int local_port = get_sock_port(c->sock, 1); + int local_port = c->sock == -1 ? 65536 : get_sock_port(c->sock, 1); char *remote_ipaddr = get_peer_ipaddr(c->sock); int remote_port = get_peer_port(c->sock); @@ -2724,7 +2727,7 @@ channel_input_status_confirm(int type, u return; cc->cb(type, c, cc->ctx); TAILQ_REMOVE(&c->status_confirms, cc, entry); - bzero(cc, sizeof(*cc)); + explicit_bzero(cc, sizeof(*cc)); free(cc); } @@ -3373,9 +3376,7 @@ channel_connect_ctx_free(struct channel_ free(cctx->host); if (cctx->aitop) freeaddrinfo(cctx->aitop); - bzero(cctx, sizeof(*cctx)); - cctx->host = NULL; - cctx->ai = cctx->aitop = NULL; + memset(cctx, 0, sizeof(*cctx)); } /* Return CONNECTING channel to remote host, port */ Modified: stable/10/crypto/openssh/cipher-3des1.c ============================================================================== --- stable/10/crypto/openssh/cipher-3des1.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/cipher-3des1.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher-3des1.c,v 1.9 2013/11/08 00:39:15 djm Exp $ */ +/* $OpenBSD: cipher-3des1.c,v 1.10 2014/02/02 03:44:31 djm Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. * @@ -93,7 +93,7 @@ ssh1_3des_init(EVP_CIPHER_CTX *ctx, cons if (EVP_CipherInit(&c->k1, EVP_des_cbc(), k1, NULL, enc) == 0 || EVP_CipherInit(&c->k2, EVP_des_cbc(), k2, NULL, !enc) == 0 || EVP_CipherInit(&c->k3, EVP_des_cbc(), k3, NULL, enc) == 0) { - memset(c, 0, sizeof(*c)); + explicit_bzero(c, sizeof(*c)); free(c); EVP_CIPHER_CTX_set_app_data(ctx, NULL); return (0); @@ -134,7 +134,7 @@ ssh1_3des_cleanup(EVP_CIPHER_CTX *ctx) EVP_CIPHER_CTX_cleanup(&c->k1); EVP_CIPHER_CTX_cleanup(&c->k2); EVP_CIPHER_CTX_cleanup(&c->k3); - memset(c, 0, sizeof(*c)); + explicit_bzero(c, sizeof(*c)); free(c); EVP_CIPHER_CTX_set_app_data(ctx, NULL); } Modified: stable/10/crypto/openssh/cipher-chachapoly.c ============================================================================== --- stable/10/crypto/openssh/cipher-chachapoly.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/cipher-chachapoly.c Sat Apr 12 20:22:59 2014 (r264377) @@ -14,7 +14,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $OpenBSD: cipher-chachapoly.c,v 1.3 2013/12/15 21:42:35 djm Exp $ */ +/* $OpenBSD: cipher-chachapoly.c,v 1.4 2014/01/31 16:39:19 tedu Exp $ */ #include "includes.h" @@ -58,7 +58,7 @@ chachapoly_crypt(struct chachapoly_ctx * * Run ChaCha20 once to generate the Poly1305 key. The IV is the * packet sequence number. */ - bzero(poly_key, sizeof(poly_key)); + memset(poly_key, 0, sizeof(poly_key)); put_u64(seqbuf, seqnr); chacha_ivsetup(&ctx->main_ctx, seqbuf, NULL); chacha_encrypt_bytes(&ctx->main_ctx, @@ -90,9 +90,9 @@ chachapoly_crypt(struct chachapoly_ctx * r = 0; out: - bzero(expected_tag, sizeof(expected_tag)); - bzero(seqbuf, sizeof(seqbuf)); - bzero(poly_key, sizeof(poly_key)); + explicit_bzero(expected_tag, sizeof(expected_tag)); + explicit_bzero(seqbuf, sizeof(seqbuf)); + explicit_bzero(poly_key, sizeof(poly_key)); return r; } Modified: stable/10/crypto/openssh/cipher.c ============================================================================== --- stable/10/crypto/openssh/cipher.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/cipher.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher.c,v 1.94 2014/01/25 10:12:50 dtucker Exp $ */ +/* $OpenBSD: cipher.c,v 1.97 2014/02/07 06:55:54 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -40,8 +40,6 @@ #include -#include - #include #include #include @@ -50,6 +48,8 @@ #include "log.h" #include "misc.h" #include "cipher.h" +#include "buffer.h" +#include "digest.h" /* compatibility with old or broken OpenSSL versions */ #include "openbsd-compat/openssl-compat.h" @@ -234,8 +234,6 @@ ciphers_valid(const char *names) debug("bad cipher %s [%s]", p, names); free(cipher_list); return 0; - } else { - debug3("cipher ok: %s [%s]", p, names); } } debug3("ciphers ok: [%s]", names); @@ -343,7 +341,7 @@ cipher_init(CipherContext *cc, const Cip if (EVP_Cipher(&cc->evp, discard, junk, cipher->discard_len) == 0) fatal("evp_crypt: EVP_Cipher failed during discard"); - memset(discard, 0, cipher->discard_len); + explicit_bzero(discard, cipher->discard_len); free(junk); free(discard); } @@ -428,7 +426,7 @@ void cipher_cleanup(CipherContext *cc) { if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0) - memset(&cc->cp_ctx, 0, sizeof(cc->cp_ctx)); + explicit_bzero(&cc->cp_ctx, sizeof(cc->cp_ctx)); else if (EVP_CIPHER_CTX_cleanup(&cc->evp) == 0) error("cipher_cleanup: EVP_CIPHER_CTX_cleanup failed"); } @@ -442,17 +440,15 @@ void cipher_set_key_string(CipherContext *cc, const Cipher *cipher, const char *passphrase, int do_encrypt) { - MD5_CTX md; u_char digest[16]; - MD5_Init(&md); - MD5_Update(&md, (const u_char *)passphrase, strlen(passphrase)); - MD5_Final(digest, &md); + if (ssh_digest_memory(SSH_DIGEST_MD5, passphrase, strlen(passphrase), + digest, sizeof(digest)) < 0) + fatal("%s: md5 failed", __func__); cipher_init(cc, cipher, digest, 16, NULL, 0, do_encrypt); - memset(digest, 0, sizeof(digest)); - memset(&md, 0, sizeof(md)); + explicit_bzero(digest, sizeof(digest)); } /* Modified: stable/10/crypto/openssh/clientloop.c ============================================================================== --- stable/10/crypto/openssh/clientloop.c Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/clientloop.c Sat Apr 12 20:22:59 2014 (r264377) @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.256 2013/11/20 20:54:10 deraadt Exp $ */ +/* $OpenBSD: clientloop.c,v 1.258 2014/02/02 03:44:31 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -550,7 +550,7 @@ client_global_request_reply(int type, u_ gc->cb(type, seq, gc->ctx); if (--gc->ref_count <= 0) { TAILQ_REMOVE(&global_confirms, gc, entry); - bzero(gc, sizeof(*gc)); + explicit_bzero(gc, sizeof(*gc)); free(gc); } @@ -877,7 +877,7 @@ process_cmdline(void) int cancel_port, ok; Forward fwd; - bzero(&fwd, sizeof(fwd)); + memset(&fwd, 0, sizeof(fwd)); fwd.listen_host = fwd.connect_host = NULL; leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE); @@ -1762,7 +1762,7 @@ client_input_stdout_data(int type, u_int char *data = packet_get_string(&data_len); packet_check_eom(); buffer_append(&stdout_buffer, data, data_len); - memset(data, 0, data_len); + explicit_bzero(data, data_len); free(data); } static void @@ -1772,7 +1772,7 @@ client_input_stderr_data(int type, u_int char *data = packet_get_string(&data_len); packet_check_eom(); buffer_append(&stderr_buffer, data, data_len); - memset(data, 0, data_len); + explicit_bzero(data, data_len); free(data); } static void Modified: stable/10/crypto/openssh/config.h ============================================================================== --- stable/10/crypto/openssh/config.h Sat Apr 12 19:58:31 2014 (r264376) +++ stable/10/crypto/openssh/config.h Sat Apr 12 20:22:59 2014 (r264377) @@ -415,6 +415,9 @@ /* Define to 1 if you have the `EVP_MD_CTX_cleanup' function. */ #define HAVE_EVP_MD_CTX_CLEANUP 1 +/* Define to 1 if you have the `EVP_MD_CTX_copy_ex' function. */ +#define HAVE_EVP_MD_CTX_COPY_EX 1 + /* Define to 1 if you have the `EVP_MD_CTX_init' function. */ #define HAVE_EVP_MD_CTX_INIT 1 @@ -424,6 +427,9 @@ /* Define if you have ut_exit in utmp.h */ /* #undef HAVE_EXIT_IN_UTMP */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 20:32:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 99B0CD43; Sat, 12 Apr 2014 20:32: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 85A8B1BF3; Sat, 12 Apr 2014 20:32: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 s3CKWlbE029850; Sat, 12 Apr 2014 20:32:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CKWlAF029848; Sat, 12 Apr 2014 20:32:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404122032.s3CKWlAF029848@svn.freebsd.org> From: Glen Barber Date: Sat, 12 Apr 2014 20:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264379 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 20:32:47 -0000 Author: gjb Date: Sat Apr 12 20:32:46 2014 New Revision: 264379 URL: http://svnweb.freebsd.org/changeset/base/264379 Log: Document r264377, OpenSSH update to 6.6p1. While here, bump copyright year. Todo: strip old entries from this file since 10.0-RELEASE. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Apr 12 20:28:39 2014 (r264378) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Apr 12 20:32:46 2014 (r264379) @@ -27,6 +27,7 @@ 2011 2012 2013 + 2014 The &os; Documentation Project @@ -455,6 +456,9 @@ hv_vmbus_load="YES" Al Userland Changes + OpenSSH has + been updated to version 6.6p1. + On platforms where &man.clang.1; is the default system compiler, (such as i386, amd64, arm) GCC and GNU libstdc++ are no longer built by default. &man.clang.1; and libc++ from LLVM are used on From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 20:42:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EB4A0CC; Sat, 12 Apr 2014 20:42: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 D555C1CAC; Sat, 12 Apr 2014 20:42: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 s3CKg3Y0033916; Sat, 12 Apr 2014 20:42:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CKg3kZ033915; Sat, 12 Apr 2014 20:42:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404122042.s3CKg3kZ033915@svn.freebsd.org> From: Glen Barber Date: Sat, 12 Apr 2014 20:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264380 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 20:42:04 -0000 Author: gjb Date: Sat Apr 12 20:42:03 2014 New Revision: 264380 URL: http://svnweb.freebsd.org/changeset/base/264380 Log: Trim stale entries. Use consistent   for empty sections. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Apr 12 20:32:46 2014 (r264379) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Apr 12 20:42:03 2014 (r264380) @@ -111,238 +111,52 @@ Security Advisories - +   Kernel Changes - The use of unmapped VMIO buffers eliminates the need to perform - TLB shootdown for mapping on buffer creation and reuse, greatly reducing the - amount of IPIs for shootdown on big-SMP machines and eliminating up to 25-30% - of the system time on i/o intensive workloads. - - The maximum amount of memory the &os; kernel - can address has been increased from 1TB to 4TB. - - A new &man.cpuset.2; API has been added - for thread to CPU binding and CPU resource grouping and - assignment. The &man.cpuset.1; userland utility has been added - to allow manipulation of processor sets. - - The &man.ddb.4; kernel debugger now has an output capture - facility. Input and output from &man.ddb.4; can now be captured - to a memory buffer for later inspection using &man.sysctl.8; or - a textdump. The new capture command controls - this feature. - - The &man.ddb.4; debugger now supports a simple scripting - facility, which supports a set of named scripts consisting of a - set of &man.ddb.4; commands. These commands can be managed from - within &man.ddb.4; or with the use of the new &man.ddb.8; - utility. More details can be found in the &man.ddb.4; manual - page. - - The kernel now supports a new textdump format of kernel - dumps. A textdump provides higher-level information via - mechanically generated/extracted debugging output, rather than a - simple memory dump. This facility can be used to generate brief - kernel bug reports that are rich in debugging information, but - are not dependent on kernel symbol tables or precisely - synchronized source code. More information can be found in the - &man.textdump.4; manual page. - - Kernel support for M:N threading has been removed. While - the KSE (Kernel Scheduled Entities) project was quite successful - in bringing threading to FreeBSD, the M:N approach taken by the - KSE library was never developed to its full potential. - Backwards compatibility for applications using KSE threading - will be provided via &man.libmap.conf.5; for dynamically linked - binaries. The &os; Project greatly appreciates the work of - &a.julian;, &a.deischen;, and &a.davidxu; on KSE support. - - The &os; kernel now exports information about certain kernel - features via the kern.features sysctl tree. - The &man.feature.present.3; library call provides a convenient - interface for user applications to test the presence of - features. - - The &os; kernel now has support for large - memory page mappings (superpages). - - The ULE - scheduler is now the default process scheduler - in GENERIC kernels. - - Support was added for - the new Intel on-CPU Bull Mountain random number - generator, found on IvyBridge and supposedly later CPUs, - accessible with RDRAND instruction. +   Virtualization support - The BSD Hypervisor, &man.bhyve.8; is included - with &os;. &man.bhyve.8; requires Intel CPUs with VT-x and Extended Page Table (EPT) - support. These features are on all Nehalem models and beyond - (e.g. Nehalem and newer), but not on the lower-end Atom CPUs. - - &man.virtio.4; support has been added. &man.virtio.4; is the - name for the paravirtualization interface developed for the Linux KVM, but - since adopted to other virtual machine hypervisors (with the notable exception of Xen). - This work brings in a BSD-licensed clean-room implementation of the virtio kernel drivers - for disk IO (&man.virtio_blk.4; and &man.virtio_scsi.4;), network IO (&man.vtnet.4;), - memory ballooning (&man.virtio_balloon.4;), and PCI. - Tested with on Qemu/KVM, VirtualBox, and &man.bhyve.4;. - - Paravirtualized drivers which - support Microsoft Hyper-V have been imported and made - part of the amd64 GENERIC kernel. For i386, these drivers are not part of - GENERIC, so the following lines must be added to - /boot/loader.conf to load these drivers: - hv_ata_pci_disengage_load="YES" -hv_netsvc_load="YES" -hv_utils_load="YES" -hv_vmbus_load="YES" Alternatively, the Hyper-V drivers can be added to the i386 - kernel by adding device hyperv to the kernel config, and then - recompiling the kernel. Please refer to: - FreeBSD and Microsoft Windows Server Hyper-V support - for full instructions on how to set up Hyper-V support under FreeBSD. - - The &man.vmx.4; driver has been added. - &man.vmx.4; is a VMware VMXNET3 ethernet driver ported from - OpenBSD. - Xen PVHVM virtualization is now - part of the GENERIC kernel. +   ARM support - Raspberry PI support has been added. - Refer to these setup instructions - and quick start - guide. - - The default ABI on ARM is now the ARM EABI. This brings a number of - improvements and allows future support for VFP and Thumb-2. - - ARM support has been greatly improved, including support - for ARMv6 and ARMv7, SMP and thread-local storage (TLS). - Additionally support for some newer SoC like the MV78x60 and OMAP4 was added. - See this announcement - for further details. - - Superpages support on ARM has been added. Superpages support - provides improved performance and scalability by allowing TLB - translations to dynamically cover large physical memory regions. - All ARMv6 and ARMv7-based platforms can take advantage of this feature. - See this page - for further details. +   Boot Loader Changes - The BTX kernel used by the boot - loader has been changed to invoke BIOS routines from real - mode. This change makes it possible to boot &os; from USB - devices. - - A new gptboot boot loader has - been added to support booting from a GPT labeled disk. A - new boot command has been added to - &man.gpt.8;, which makes a GPT disk bootable by writing the - required bits of the boot loader, creating a new boot - partition if required. +   Hardware Support - The &man.cmx.4; driver, a driver for Omnikey CardMan 4040 - PCMCIA smartcard readers, has been added. - - The &man.syscons.4; driver now supports Colemak keyboard layout. - - The &man.uslcom.4; driver, a driver for Silicon - Laboratories CP2101/CP2102-based USB serial adapters, has been - imported from OpenBSD. +   Multimedia Support - Support for version 2.0 of the USB Audio reference design - has been added. New devices should support higher bandwidth, - increased sampling frequency and wider dynamic range. +   Network Interface Support - The &man.ale.4; driver has been added to provide support - for Atheros AR8121/AR8113/AR8114 Gigabit/Fast Ethernet controllers. - - The &man.em.4; driver has been split into two drivers - with some common parts. The &man.em.4; driver will continue - to support adapters up to the 82575, as well as new - client/desktop adapters. A new &man.igb.4; driver - will support new server adapters. - - The &man.jme.4; driver has been added to provide support - for PCIe network adapters based on JMicron JMC250 Gigabit - Ethernet and JMC260 Fast Ethernet controllers. - - The &man.malo.4; driver has been added to provide - support for Marvell Libertas 88W8335 based PCI network - adapters. - - The firmware for the &man.mxge.4; driver has been - updated from 1.4.25 to 1.4.29. - - The &man.sf.4; driver has been overhauled to improve its - performance and to add support for checksum offloading. It - should also work on all architectures. - - The &man.re.4; driver has been overhauled to fix a - number of issues. This driver now has Wake On LAN (WOL) - support. - - The &man.vr.4; driver has been overhauled to fix a - number of outstanding issues. It also now works on all - architectures. - - The &man.wpi.4; driver has - been updated to include a number of stability fixes. - - The &man.cxgbe.4; driver has been updated to support - 40G/10G Ethernet NICs based on Chelsio's Terminator 5 (T5) ASIC. - - The iw_cxgbe driver has been added. This is an - experimental iWARP/RDMA driver - (kernel verbs only) for Chelsio's T4 and T5 based cards. - - The Open Fabrics Enterprise Distribution (OFED) and - OFED Infiniband core has been - updated to the same version as supplied by Linux version 3.7 - - The Mellanox Infiniband driver has been updated to firmware - version 2.30.3200 for ConnectX3 NICs. Support has been added for ConnectX3 VPI NICs, where - each port can be used as Infiniband 56 GB/s or Ethernet 40 GB/s. Support has been added - for dynamically loading kernel modules for Infiniband core (ibcore) and - IP over Infiniband (ipoib). - - &man.netmap.4; has been added. &man.netmap.4; is a framework for - high-performance direct-to-hardware packet IO, offering low latency and high PPS - rates to userland applications while bypassing any kernel-side packet processing. - With &man.netmap.4; it is trivially possible to fully saturate a 10 Gbps network interface with - minimal packet sizes. For more information, see: - Netmap Project. +   @@ -350,107 +164,23 @@ hv_vmbus_load="YES" Al Network Protocols - &man.carp.4; has been rewritten to make addresses - more sane from the viewpoint of routing daemons such as - quagga/zebra. It also brings support for a single redundant - address on the subnet (carpdev), switching state with - &man.ifconfig.8;, better locking and using modern kernel - interfaces to allocate multicast memberships. - Configuration of the CARP protocol via &man.ifconfig.8; has changed, as well as format - of CARP events submitted to &man.devd.8; has changed. See &man.carp.4; - for more information. The arpbalance feature of &man.carp.4; is currently - not supported anymore. - - The &man.pf.4; firewall now supports fine-grain locking - and better utilization on multi-cpu machines resulting in - significant improvements in performance. - - Support for up to 65536 routing tables has been - introduced. - - Support for setting/matching differentiated services - codepoints (DSCP) in IP header has been added to - &man.ipfw.8;. +   Disks and Storage - The &man.aac.4; driver now supports volumes larger than - 2TB in size. - - The &man.ata.4; driver now supports a spindown command for - disks; after a configurable amount of time, if no requests - have been received for a disk, the disk will be spun down - until the next request. The &man.atacontrol.8; utility now - supports a spindown command to configure - this feature. - - The &man.hptrr.4; driver has been updated to version 1.2 - from Highpoint. - - &man.nvme.4; has been added and provides NVM Express support. - NVM Express is an optimized register interface, command set and feature set of - PCI Express (PCIe)-based Solid-State Drives (SSDs). For more information, - see nvmexpress.org. +   File Systems - A new kernel-based iSCSI target and initiator has been - added - - UFS filesystems can now be enlarged with &man.growfs.8; while - mounted read-write. This is especially useful for virtual - machines, allowing the addition of more harddrive space without - interruption of service. - - A state of the art FUSE implementation is now part of the - base system. It allows the use of nearly all fusefs file - systems - - - ZFS - - &man.bsdinstall.8; now supports installing - ZFS on the root file system. It includes a single configuration menu - that allows you to select all of the required details, including - which drives to use, what ZFS RAID level to use (taking into consideration - the selected number of drives), GPT or MBR, GELI encryption, forcing 4K sectors, - pool name, etc. - - TRIM support has been added for - ZFS. - - Support for the high performance LZ4 compression algorithm - has been added to ZFS. LZ4 is usually faster and can achieve a - higher compression ratio than LZJB, the default compression - algorithm - - Support for L2ARC compression has been added to ZFS. - - The zio nop-write improvement from Illumos - was imported into &os;. To reduce I/O, nop-write skips overwriting - data if the checksum (cryptographically secure) of new data - matches the checksum of existing data. It also saves space if - snapshots are in use. This improvement only works only on - datasets with enabled compression, disabled deduplication and - sha256 checksums. - - ZFS will now compare the checksums of incoming writes to - the checksum of the existing on-disk data and avoid issuing any - write I/O for data that has not changed. This will reduce I/O - as well as space usage because if the old block is referenced - by a snapshot, both copies of the block are kept even though - both contain the same data. - - +   - @@ -459,167 +189,10 @@ hv_vmbus_load="YES" Al OpenSSH has been updated to version 6.6p1. - On platforms where &man.clang.1; is the default - system compiler, (such as i386, amd64, arm) GCC and GNU libstdc++ are no - longer built by default. &man.clang.1; and libc++ from LLVM are used on - these platforms by instead. GCC 4.2.1 and libstdc++ are still built - and used by default on pc98 and all other platforms where &man.clang.1; - is not the default system compiler. - - - &man.clang.1; and llvm have been updated to - version 3.3 release. Please refer to - - Clang 3.3 Release Notes. - - BIND has been replaced by &man.unbound.8; for - local dns resolution in the base system. With this change, nslookup - and dig are no longer a part of the base system. Users should - instead use &man.host.1; and &man.drill.1; Alternatively, - nslookup and dig can be obtained by installing the - dns/bind-tools port. - - sysinstall has been removed from the base system. - Auxiliary libraries and tools used by sysinstall such as libdisk, libftpio, - and sade have also been removed. sysinstall has been replaced by - &man.bsdinstall.8; and &man.bsdconfig.8;. - - &man.freebsd-version.1; has been added. This tool - makes a best effort to determine the version and patch level of - the installed kernel and userland. - - GNU patch has been removed from the base system, and replaced - by a BSD-licensed &man.patch.1; program. - - GNU sort has been removed from the base system, and replaced - by a BSD-licensed &man.sort.1; program. - - Berkely yacc (byacc) has been imported - from invisible island. - This brings bison compatibilities to &man.yacc.1; while preserving full - backwards compatibility with previous version of &man.yacc.1;. - - &man.lex.1; has been replaced by flex 2.5.37 - - &man.make.1; has been replaced with the - "Portable" BSD make tool (bmake) from NetBSD. - - The &man.adduser.8; utility now supports - a option to set the mode of a new user's - home directory. - - BSD-licensed versions of &man.ar.1; and &man.ranlib.1;, - based on libarchive, have replaced the GNU - Binutils versions of these utilities. - - BSD-licensed versions of &man.bc.1; and &man.dc.1; have - replaced their GNU counterparts. - - &man.chflags.1; now supports a flag for - verbose output and a flag to ignore errors - with the same semantics as (for example) - &man.chmod.1;. - - For compatibility with other implementations, &man.cp.1; now - supports a flag, which is equivalent to - specifying the flags. - - BSD-licensed version of &man.cpio.1; based on - libarchive, has replaced the GNU cpio. - Note that the GNU cpio is still installed as - gcpio. - - The &man.env.1; program now supports - which will completely unset the given variable - name by removing it from the environment, - instead of just setting it to a null value. - - The &man.fdopendir.3; library function has been added. - - The &man.fetch.3; library now support HTTP 1.1 - If-Modified-Since behavior. The &man.fetch.1; program now - supports - which will only download the specified HTTP URL if the content - is newer than filename. - - &man.find.1; has been enhanced by the addition of a number - of primaries that were present in GNU find but not &os; - &man.find.1;. - - &man.kgdb.1; now supports a new add-kld - command to make it easier to debug crash dumps with kernel - modules. - - The &man.ls.1; program now supports a - option to specify a date format string to be used with the long - format () output. - - &man.nc.1; now supports a switch to - disable the use of TCP options. - - &man.nc.1;'s switch has been deprecated. - It will be removed in a future release. - - The &man.ping6.8; utility now returns 2 - when the packet transmission was successful but no responses - were received (this is the same behavior as &man.ping.8;). - It returned a non-zero value before this change. - - The &man.procstat.1; utility has been added to display - detailed information about processes. - - The &man.realpath.1; utility now supports - a flag to suppress warnings; it now also - accepts multiple paths on its command line. - - &man.sh.1; has many bug fixes, some new features, and will now - refuse to parse some invalid scripts. Additionally, it now - has filename completion and defaults to the "emacs" editing - mode. - - The &man.split.1; utility now supports a - flag to split a file into a certain number of chunks. - - The &man.tar.1; utility now supports a - flag to enable &man.compress.1;-style - compression/decompression. - - The &man.tar.1; utility now supports a - flag to ignore user/group names - on create and extract. - - The &man.tar.1; utility now supports an - flag to sparsify files on extraction. - - The &man.tar.1; utility now supports a - flag to substitute filenames based on the specified regular - expression. - - The &man.tcgetsid.3; library function has been added to - return the process group ID for the session leader for the - controlling terminal. It is defined in IEEE Std 1003.1-2001 - (POSIX). - - &man.top.1; now supports a flag to - provide per-CPU usage statistics. - - &man.zdump.8; is now working properly on 64 bit architectures. - - - &man.traceroute.8; now has the ability to print the AS - number for each hop with the new switch; a - new option allows selecting a particular - WHOIS server. - - &man.traceroute6.8; now supports a flag - to send probe packets with no upper-layer protocol, rather than - the usual UDP probe packets. - <filename>/etc/rc.d</filename> Scripts - +   @@ -627,99 +200,28 @@ hv_vmbus_load="YES" Al Contributed Software - &man.jemalloc.3; has been updated to 3.4.0. - See this link. - for more details. - - AMD has been updated from 6.0.10 - to 6.1.5. - - awk has been updated from 1 May - 2007 release to the 23 October 2007 release. - - bzip2 has been updated from 1.0.4 - to 1.0.5. - - CVS has been removed from the - base system, but is still available from ports - - Subversion has been imported into the base system and - is installed as svnlite. svnlite - should only be used for checking out &os; source and committing, and does not - replace the full Subversion port. - - file has been updated to 5.11. - - hostapd has been - updated from 0.5.8 to 0.5.10. - - IPFilter has been updated to 5.1.2. - - less has been updated to - v458. - - ncurses has been updated from - to 5.7-20081102. - - OpenSSH has been updated - to 6.4. - - OpenPAM has been updated to - the Micrampelis release. - - sendmail has been updated from - 8.14.1 to 8.14.7. - - The timezone database has been updated from - the tzdata2008h release to - the tzdata2009m release. - - The stdtime part of libc, &man.zdump.8; and &man.zic.8; - have been updated from the tzcode2004a - release to the tzcode2009h release. - If you have upgraded from source or via the &man.freebsd-update.8;, - then please run &man.tzsetup.8; to install a new /etc/localtime. - - - WPA Supplicant has been - updated to 2.0. - - xz has been updated - from snapshot as of 12 April 2010 to 5.0.0. - - &man.nvi.1; has been updated to 2.1.2. - - &man.nvi.1; supports wide character locales. - +   - sendmail has been - updated from 8.14.7 to 8.14.8. Ports/Packages Collection Infrastructure - The pkg_add, pkg_create, pkg_delete, pkg_info, - pkg_updating, and pkg_version utilities have been removed. - &man.pkg.7; must now be used to install binary packages. &man.pkg.7; - is the next generation &os; package manager, also referred to as "pkgng". +   Release Engineering and Integration - The supported version of - the GNOME desktop environment - (x11/gnome2) has been - updated from 2.20.1 to 2.22. +   Documentation - +   From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 20:49:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3F118365; Sat, 12 Apr 2014 20:49:08 +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 1F5071CE9; Sat, 12 Apr 2014 20:49:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CKn7O8034855; Sat, 12 Apr 2014 20:49:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CKn7qG034854; Sat, 12 Apr 2014 20:49:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404122049.s3CKn7qG034854@svn.freebsd.org> From: Glen Barber Date: Sat, 12 Apr 2014 20:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264381 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 20:49:08 -0000 Author: gjb Date: Sat Apr 12 20:49:07 2014 New Revision: 264381 URL: http://svnweb.freebsd.org/changeset/base/264381 Log: Clean up leading/trailing whitespace. Rewrap paragraphs and long lines. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Apr 12 20:42:03 2014 (r264380) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Apr 12 20:49:07 2014 (r264381) @@ -1,14 +1,16 @@ %release; ]>
-&os; &release.current; Release Notes - + + &os; &release.current; Release Notes - The &os; Project + + The &os; Project + $FreeBSD$ @@ -41,13 +43,13 @@ - The release notes for &os; &release.current; contain a summary - of the changes made to the &os; base system on the - &release.branch; development line. - This document lists applicable security advisories that were issued since - the last release, as well as significant changes to the &os; - kernel and userland. - Some brief remarks on upgrading are also presented. + The release notes for &os; &release.current; contain + a summary of the changes made to the &os; base system on the + &release.branch; development line. This document lists + applicable security advisories that were issued since the last + release, as well as significant changes to the &os; kernel and + userland. Some brief remarks on upgrading are also + presented. @@ -55,30 +57,32 @@ Introduction This document contains the release notes for &os; - &release.current;. It - describes recently added, changed, or deleted features of &os;. - It also provides some notes on upgrading - from previous versions of &os;. - - The &release.type; distribution to which these release notes - apply represents the latest point along the &release.branch; development - branch since &release.branch; was created. Information regarding pre-built, binary - &release.type; distributions along this branch - can be found at &release.url;. - - The &release.type; distribution to which these release notes - apply represents a point along the &release.branch; development - branch between &release.prev; and the future &release.next;. - Information regarding - pre-built, binary &release.type; distributions along this branch - can be found at &release.url;. - - This distribution of &os; &release.current; is a - &release.type; distribution. It can be found at &release.url; or any of its mirrors. More - information on obtaining this (or other) &release.type; - distributions of &os; can be found in the Obtaining - &os; appendix to the &os; - Handbook. + &release.current;. It describes recently added, changed, or + deleted features of &os;. It also provides some notes on + upgrading from previous versions of &os;. + + The &release.type; distribution to which + these release notes apply represents the latest point along the + &release.branch; development branch since &release.branch; was + created. Information regarding pre-built, binary &release.type; + distributions along this branch can be found at &release.url;. + + The &release.type; distribution to + which these release notes apply represents a point along the + &release.branch; development branch between &release.prev; and the + future &release.next;. Information regarding pre-built, binary + &release.type; distributions along this branch can be found at + &release.url;. + + This distribution of &os; + &release.current; is a &release.type; distribution. It can be + found at &release.url; or + any of its mirrors. More information on obtaining this (or other) + &release.type; distributions of &os; can be found in the Obtaining + &os; appendix to the &os; Handbook. All users are encouraged to consult the release errata before installing &os;. The errata document is updated with @@ -87,26 +91,22 @@ information on known bugs, security advisories, and corrections to documentation. An up-to-date copy of the errata for &os; &release.current; can be found on the &os; Web site. - What's New - This section describes - the most user-visible new or changed features in &os; - since &release.prev;. - - Typical release note items - document recent security advisories issued after - &release.prev;, - new drivers or hardware support, new commands or options, - major bug fixes, or contributed software upgrades. They may also - list changes to major ports/packages or release engineering - practices. Clearly the release notes cannot list every single - change made to &os; between releases; this document focuses - primarily on security advisories, user-visible changes, and major - architectural improvements. + This section describes the most user-visible new or changed + features in &os; since &release.prev;. + + Typical release note items document recent security advisories + issued after &release.prev;, new drivers or hardware support, new + commands or options, major bug fixes, or contributed software + upgrades. They may also list changes to major ports/packages or + release engineering practices. Clearly the release notes cannot + list every single change made to &os; between releases; this + document focuses primarily on security advisories, user-visible + changes, and major architectural improvements. Security Advisories @@ -227,15 +227,15 @@ - Upgrading from previous releases of &os; + Upgrading from Previous Releases of &os; - Beginning with &os; 6.2-RELEASE, - binary upgrades between RELEASE versions (and snapshots of the - various security branches) are supported using the - &man.freebsd-update.8; utility. The binary upgrade procedure will - update unmodified userland utilities, as well as unmodified GENERIC or - SMP kernels distributed as a part of an official &os; release. - The &man.freebsd-update.8; utility requires that the host being + Beginning with &os; 6.2-RELEASE, binary + upgrades between RELEASE versions (and snapshots of the various + security branches) are supported using the &man.freebsd-update.8; + utility. The binary upgrade procedure will update unmodified + userland utilities, as well as unmodified GENERIC or SMP kernels + distributed as a part of an official &os; release. The + &man.freebsd-update.8; utility requires that the host being upgraded have Internet connectivity. Source-based upgrades (those based on recompiling the &os; From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 20:50:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AD8D55A8; Sat, 12 Apr 2014 20:50: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 998991CF7; Sat, 12 Apr 2014 20:50:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CKoVGB035649; Sat, 12 Apr 2014 20:50:31 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CKoVlC035648; Sat, 12 Apr 2014 20:50:31 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404122050.s3CKoVlC035648@svn.freebsd.org> From: Glen Barber Date: Sat, 12 Apr 2014 20:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264382 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 20:50:31 -0000 Author: gjb Date: Sat Apr 12 20:50:31 2014 New Revision: 264382 URL: http://svnweb.freebsd.org/changeset/base/264382 Log: Remove reference to FreeBSD 6.2-R in the freebsd-update(8) note. Rewrap. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Apr 12 20:49:07 2014 (r264381) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Apr 12 20:50:31 2014 (r264382) @@ -229,14 +229,14 @@ Upgrading from Previous Releases of &os; - Beginning with &os; 6.2-RELEASE, binary - upgrades between RELEASE versions (and snapshots of the various - security branches) are supported using the &man.freebsd-update.8; - utility. The binary upgrade procedure will update unmodified - userland utilities, as well as unmodified GENERIC or SMP kernels - distributed as a part of an official &os; release. The - &man.freebsd-update.8; utility requires that the host being - upgraded have Internet connectivity. + Binary upgrades between RELEASE versions + (and snapshots of the various security branches) are supported + using the &man.freebsd-update.8; utility. The binary upgrade + procedure will update unmodified userland utilities, as well as + unmodified GENERIC or SMP kernels distributed as a part of an + official &os; release. The &man.freebsd-update.8; utility + requires that the host being upgraded have Internet + connectivity. Source-based upgrades (those based on recompiling the &os; base system from source code) from previous versions are From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 20:51:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7DBA36D8; Sat, 12 Apr 2014 20:51: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 69A211D6E; Sat, 12 Apr 2014 20:51: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 s3CKpdBt038190; Sat, 12 Apr 2014 20:51:39 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CKpdKe038189; Sat, 12 Apr 2014 20:51:39 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404122051.s3CKpdKe038189@svn.freebsd.org> From: Glen Barber Date: Sat, 12 Apr 2014 20:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264383 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 20:51:39 -0000 Author: gjb Date: Sat Apr 12 20:51:38 2014 New Revision: 264383 URL: http://svnweb.freebsd.org/changeset/base/264383 Log: Move OpenSSH entry to 'contrib' where it belongs. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Apr 12 20:50:31 2014 (r264382) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Apr 12 20:51:38 2014 (r264383) @@ -186,8 +186,7 @@ Userland Changes - OpenSSH has - been updated to version 6.6p1. +   <filename>/etc/rc.d</filename> Scripts @@ -200,7 +199,8 @@ Contributed Software -   + OpenSSH has + been updated to version 6.6p1. From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 12 23:48:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 007A07BB; Sat, 12 Apr 2014 23:48: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 DFB841BB7; Sat, 12 Apr 2014 23:48: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 s3CNm2YY011121; Sat, 12 Apr 2014 23:48:02 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CNm2ZO011120; Sat, 12 Apr 2014 23:48:02 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404122348.s3CNm2ZO011120@svn.freebsd.org> From: Rui Paulo Date: Sat, 12 Apr 2014 23:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264390 - stable/10/contrib/wpa/src/drivers X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 23:48:03 -0000 Author: rpaulo Date: Sat Apr 12 23:48:02 2014 New Revision: 264390 URL: http://svnweb.freebsd.org/changeset/base/264390 Log: MFC r263925 Enable all cryptocaps because net80211 can do software encryption. Modified: stable/10/contrib/wpa/src/drivers/driver_bsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/wpa/src/drivers/driver_bsd.c ============================================================================== --- stable/10/contrib/wpa/src/drivers/driver_bsd.c Sat Apr 12 23:40:54 2014 (r264389) +++ stable/10/contrib/wpa/src/drivers/driver_bsd.c Sat Apr 12 23:48:02 2014 (r264390) @@ -1446,6 +1446,17 @@ static int wpa_driver_bsd_capa(struct bs drv->capa.key_mgmt = WPA_DRIVER_CAPA_KEY_MGMT_WPA2 | WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK; +#ifdef __FreeBSD__ + drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 | + WPA_DRIVER_CAPA_ENC_WEP104 | + WPA_DRIVER_CAPA_ENC_TKIP | + WPA_DRIVER_CAPA_ENC_CCMP; +#else + /* + * XXX + * FreeBSD exports hardware cryptocaps. These have no meaning for wpa + * since net80211 performs software crypto. + */ if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_WEP) drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 | WPA_DRIVER_CAPA_ENC_WEP104; @@ -1453,6 +1464,7 @@ static int wpa_driver_bsd_capa(struct bs drv->capa.enc |= WPA_DRIVER_CAPA_ENC_TKIP; if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_CCM) drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP; +#endif if (devcaps.dc_drivercaps & IEEE80211_C_HOSTAP) drv->capa.flags |= WPA_DRIVER_FLAGS_AP; From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 13 22:41:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5356060C; Sun, 13 Apr 2014 22:41: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 3B3411D9A; Sun, 13 Apr 2014 22:41: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 s3DMfNCj080826; Sun, 13 Apr 2014 22:41:23 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DMfNYV080825; Sun, 13 Apr 2014 22:41:23 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404132241.s3DMfNYV080825@svn.freebsd.org> From: Glen Barber Date: Sun, 13 Apr 2014 22:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264429 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 22:41:23 -0000 Author: gjb Date: Sun Apr 13 22:41:22 2014 New Revision: 264429 URL: http://svnweb.freebsd.org/changeset/base/264429 Log: Document r260177, camcontrol '-b' addition. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 13 22:35:39 2014 (r264428) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 13 22:41:22 2014 (r264429) @@ -186,7 +186,9 @@ Userland Changes -   + A new flag is added to &man.camcontrol.8;, + -b, which outputs the existing buses and + their parents. <filename>/etc/rc.d</filename> Scripts From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 13 22:41:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8CED7808; Sun, 13 Apr 2014 22:41: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 4E62B1D9D; Sun, 13 Apr 2014 22:41: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 s3DMfRbo080994; Sun, 13 Apr 2014 22:41:27 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DMfR9Z080967; Sun, 13 Apr 2014 22:41:27 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404132241.s3DMfR9Z080967@svn.freebsd.org> From: Glen Barber Date: Sun, 13 Apr 2014 22:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264431 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 22:41:27 -0000 Author: gjb Date: Sun Apr 13 22:41:26 2014 New Revision: 264431 URL: http://svnweb.freebsd.org/changeset/base/264431 Log: Document r260385, unmapped I/O in GEOM RAID. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 13 22:41:24 2014 (r264430) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 13 22:41:26 2014 (r264431) @@ -118,6 +118,9 @@ Kernel Changes + The &man.geom.4; RAID driver has been + updated to support unmapped I/O. + The vfs.zfs.zio.use_uma &man.sysctl.8; has been re-enabled. On multi-CPU machines with enough RAM, this can easily double &man.zfs.8; performance or From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 13 22:41:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2DC038EF; Sun, 13 Apr 2014 22:41: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 2EE671DA3; Sun, 13 Apr 2014 22:41: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 s3DMfTGE081301; Sun, 13 Apr 2014 22:41:29 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DMfTkN081300; Sun, 13 Apr 2014 22:41:29 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404132241.s3DMfTkN081300@svn.freebsd.org> From: Glen Barber Date: Sun, 13 Apr 2014 22:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264432 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 22:41:30 -0000 Author: gjb Date: Sun Apr 13 22:41:28 2014 New Revision: 264432 URL: http://svnweb.freebsd.org/changeset/base/264432 Log: Fix order by svn revision. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 13 22:41:26 2014 (r264431) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 13 22:41:28 2014 (r264432) @@ -118,9 +118,6 @@ Kernel Changes - The &man.geom.4; RAID driver has been - updated to support unmapped I/O. - The vfs.zfs.zio.use_uma &man.sysctl.8; has been re-enabled. On multi-CPU machines with enough RAM, this can easily double &man.zfs.8; performance or @@ -129,6 +126,9 @@ which should be resolved due to several change in the VM subsystem. + The &man.geom.4; RAID driver has been + updated to support unmapped I/O. + Virtualization support From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 13 22:41:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 30D5B987; Sun, 13 Apr 2014 22:41: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 1D4A31DA4; Sun, 13 Apr 2014 22:41:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DMfUAn081336; Sun, 13 Apr 2014 22:41:30 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DMfUQT081335; Sun, 13 Apr 2014 22:41:30 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404132241.s3DMfUQT081335@svn.freebsd.org> From: Glen Barber Date: Sun, 13 Apr 2014 22:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264433 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 22:41:31 -0000 Author: gjb Date: Sun Apr 13 22:41:30 2014 New Revision: 264433 URL: http://svnweb.freebsd.org/changeset/base/264433 Log: Document r260431, kern.panic_reboot_wait_time sysctl. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 13 22:41:28 2014 (r264432) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 13 22:41:30 2014 (r264433) @@ -129,6 +129,11 @@ The &man.geom.4; RAID driver has been updated to support unmapped I/O. + A new &man.sysctl.8;, + kern.panic_reboot_wait_time, has been added, + which allows controlling how long the system will wait after + &man.panic.9; before rebooting. + Virtualization support From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 13 22:41:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5C1226E0; Sun, 13 Apr 2014 22:41: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 489EC1D9C; Sun, 13 Apr 2014 22:41: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 s3DMfP2R080865; Sun, 13 Apr 2014 22:41:25 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DMfPJZ080864; Sun, 13 Apr 2014 22:41:25 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404132241.s3DMfPJZ080864@svn.freebsd.org> From: Glen Barber Date: Sun, 13 Apr 2014 22:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264430 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 22:41:25 -0000 Author: gjb Date: Sun Apr 13 22:41:24 2014 New Revision: 264430 URL: http://svnweb.freebsd.org/changeset/base/264430 Log: Document r260338 Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 13 22:41:22 2014 (r264429) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 13 22:41:24 2014 (r264430) @@ -118,7 +118,13 @@ Kernel Changes -   + The vfs.zfs.zio.use_uma + &man.sysctl.8; has been re-enabled. On multi-CPU machines with + enough RAM, this can easily double &man.zfs.8; performance or + reduce CPU usage in half. It was originally disabled due to + memory and KVA exhastion problem reports, + which should be resolved due to several change in the VM + subsystem. Virtualization support From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 01:44:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 87F80FCE; Mon, 14 Apr 2014 01: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 7322F1D43; Mon, 14 Apr 2014 01: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 s3E1iv06056829; Mon, 14 Apr 2014 01:44:57 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E1iuvS056823; Mon, 14 Apr 2014 01:44:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404140144.s3E1iuvS056823@svn.freebsd.org> From: Devin Teske Date: Mon, 14 Apr 2014 01:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264438 - in stable/10/etc: . rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 01:44:57 -0000 Author: dteske Date: Mon Apr 14 01:44:56 2014 New Revision: 264438 URL: http://svnweb.freebsd.org/changeset/base/264438 Log: MFC r264243: Loosen the processing of *_IF_aliasN vars to be less strict. Previously, the first alias had to be _alias0 and processing stopped at the first non- defined variable (preventing gaps). Allowing gaps gives the administrator the ability to group aliases in an adhoc manner and also lifts the requirement to renumber aliases simply to comment-out an existing one. Aliases are processed in numerical ascending order. NB: Also Patches mdconfig{,2} rc(8) boot scripts to loosen the numbering scheme for mdconfig_mdN settings to be less strict in the same manner. Discussed on: -rc Modified: stable/10/etc/network.subr stable/10/etc/rc.d/mdconfig stable/10/etc/rc.d/mdconfig2 stable/10/etc/rc.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/network.subr ============================================================================== --- stable/10/etc/network.subr Mon Apr 14 01:18:02 2014 (r264437) +++ stable/10/etc/network.subr Mon Apr 14 01:44:56 2014 (r264438) @@ -285,10 +285,8 @@ get_if_var() fi _if=$1 - _punct=". - / +" - for _punct_c in $_punct; do - _if=`ltr ${_if} ${_punct_c} '_'` - done + _punct=".-/+" + ltr ${_if} "${_punct}" '_' _if _var=$2 _default=$3 @@ -1081,6 +1079,7 @@ ifalias_af_common_handler() ifalias_af_common() { local _ret _if _af _action alias ifconfig_args _aliasn _c _tmpargs _iaf + local _punct=".-/+" _ret=1 _aliasn= @@ -1088,10 +1087,14 @@ ifalias_af_common() _af=$2 _action=$3 + # Normalize $_if before using it in a pattern to list_vars() + ltr "$_if" "$_punct" "_" _if + # ifconfig_IF_aliasN which starts with $_af - alias=0 - while : ; do - ifconfig_args=`get_if_var $_if ifconfig_IF_alias${alias}` + for alias in `list_vars ifconfig_${_if}_alias[0-9]\* | + sort_lite -nk1.$((9+${#_if}+7))` + do + eval ifconfig_args=\"\$$alias\" _iaf= case $ifconfig_args in inet\ *) _iaf=inet ;; @@ -1113,15 +1116,15 @@ ifalias_af_common() warn "\$ifconfig_${_if}_alias${alias} needs " \ "\"inet\" keyword for an IPv4 address." esac - alias=$(($alias + 1)) done # backward compatibility: ipv6_ifconfig_IF_aliasN. case $_af in inet6) - alias=0 - while : ; do - ifconfig_args=`get_if_var $_if ipv6_ifconfig_IF_alias${alias}` + for alias in `list_vars ipv6_ifconfig_${_if}_alias[0-9]\* | + sort_lite -nk1.$((14+${#_if}+7))` + do + eval ifconfig_args=\"\$$alias\" case ${_action}:"${ifconfig_args}" in *:"") break @@ -1133,7 +1136,6 @@ ifalias_af_common() "instead." ;; esac - alias=$(($alias + 1)) done esac Modified: stable/10/etc/rc.d/mdconfig ============================================================================== --- stable/10/etc/rc.d/mdconfig Mon Apr 14 01:18:02 2014 (r264437) +++ stable/10/etc/rc.d/mdconfig Mon Apr 14 01:44:56 2014 (r264438) @@ -181,17 +181,14 @@ fi load_rc_config $name -_mdconfig_unit=0 if [ -z "${_mdconfig_list}" ]; then - while :; do - eval _mdconfig_config=\$mdconfig_md${_mdconfig_unit} - if [ -z "${_mdconfig_config}" ]; then - break - else - _mdconfig_list="${_mdconfig_list}${_mdconfig_list:+ }md${_mdconfig_unit}" - _mdconfig_unit=$((${_mdconfig_unit} + 1)) - fi + for _mdconfig_config in `list_vars mdconfig_md[0-9]\* | + sort_lite -nk1.12` + do + _mdconfig_unit=${_mdconfig_config#mdconfig_md} + _mdconfig_list="$_mdconfig_list md$_mdconfig_unit" done + _mdconfig_list="${_mdconfig_list# }" fi run_rc_command "${_mdconfig_cmd}" Modified: stable/10/etc/rc.d/mdconfig2 ============================================================================== --- stable/10/etc/rc.d/mdconfig2 Mon Apr 14 01:18:02 2014 (r264437) +++ stable/10/etc/rc.d/mdconfig2 Mon Apr 14 01:44:56 2014 (r264438) @@ -211,17 +211,14 @@ fi load_rc_config $name -_mdconfig2_unit=0 if [ -z "${_mdconfig2_list}" ]; then - while :; do - eval _mdconfig2_config=\$mdconfig_md${_mdconfig2_unit} - if [ -z "${_mdconfig2_config}" ]; then - break - else - _mdconfig2_list="${_mdconfig2_list}${_mdconfig2_list:+ }md${_mdconfig2_unit}" - _mdconfig2_unit=$((${_mdconfig2_unit} + 1)) - fi + for _mdconfig2_config in `list_vars mdconfig_md[0-9]\* | + sort_lite -nk1.12` + do + _mdconfig2_unit=${_mdconfig2_config#mdconfig_md} + _mdconfig2_list="$_mdconfig2_list md$_mdconfig2_unit" done + _mdconfig2_list="${_mdconfig2_list# }" fi run_rc_command "${_mdconfig2_cmd}" Modified: stable/10/etc/rc.subr ============================================================================== --- stable/10/etc/rc.subr Mon Apr 14 01:18:02 2014 (r264437) +++ stable/10/etc/rc.subr Mon Apr 14 01:44:56 2014 (r264438) @@ -54,6 +54,20 @@ JID=`$PS -p $$ -o jid=` # functions # --------- +# list_vars pattern +# List vars matching pattern. +# +list_vars() +{ + set | { while read LINE; do + var="${LINE%%=*}" + case "$var" in + "$LINE"|*[!a-zA-Z0-9_]*) continue ;; + $1) echo $var + esac + done; } +} + # set_rcvar_obsolete oldvar [newvar] [msg] # Define obsolete variable. # Global variable $rcvars_obsolete is used. @@ -314,6 +328,246 @@ _find_processes() eval $_proccheck } +# sort_lite [-b] [-n] [-k POS] [-t SEP] +# A lite version of sort(1) (supporting a few options) that can be used +# before the real sort(1) is available (e.g., in scripts that run prior +# to mountcritremote). Requires only shell built-in functionality. +# +sort_lite() +{ + local funcname=sort_lite + local sort_sep="$IFS" sort_ignore_leading_space= + local sort_field=0 sort_strict_fields= sort_numeric= + local nitems=0 skip_leading=0 trim= + + local OPTIND flag + while getopts bnk:t: flag; do + case "$flag" in + b) sort_ignore_leading_space=1 ;; + n) sort_numeric=1 sort_ignore_leading_space=1 ;; + k) sort_field="${OPTARG%%,*}" ;; # only up to first comma + # NB: Unlike sort(1) only one POS allowed + t) sort_sep="$OPTARG" + if [ ${#sort_sep} -gt 1 ]; then + echo "$funcname: multi-character tab \`$sort_sep'" >&2 + return 1 + fi + sort_strict_fields=1 + ;; + \?) return 1 ;; + esac + done + shift $(( $OPTIND - 1 )) + + # Create transformation pattern to trim leading text if desired + case "$sort_field" in + ""|[!0-9]*|*[!0-9.]*) + echo "$funcname: invalid sort field \`$sort_field'" >&2 + return 1 + ;; + *.*) + skip_leading=${sort_field#*.} sort_field=${sort_field%%.*} + while [ ${skip_leading:-0} -gt 1 ] 2> /dev/null; do + trim="$trim?" skip_leading=$(( $skip_leading - 1 )) + done + esac + + # Copy input to series of local numbered variables + # NB: IFS of NULL preserves leading whitespace + local LINE + while IFS= read -r LINE || [ "$LINE" ]; do + nitems=$(( $nitems + 1 )) + local src_$nitems="$LINE" + done + + # + # Sort numbered locals using insertion sort + # + local curitem curitem_orig curitem_mod curitem_haskey + local dest dest_orig dest_mod dest_haskey + local d gt n + local i=1 + while [ $i -le $nitems ]; do + curitem_haskey=1 # Assume sort field (-k POS) exists + eval curitem=\"\$src_$i\" + curitem_mod="$curitem" # for modified comparison + curitem_orig="$curitem" # for original comparison + + # Trim leading whitespace if desired + if [ "$sort_ignore_leading_space" ]; then + while case "$curitem_orig" in + [$IFS]*) : ;; *) false; esac + do + curitem_orig="${curitem_orig#?}" + done + curitem_mod="$curitem_orig" + fi + + # Shift modified comparison value if sort field (-k POS) is > 1 + n=$sort_field + while [ $n -gt 1 ]; do + case "$curitem_mod" in + *[$sort_sep]*) + # Cut text up-to (and incl.) first separator + curitem_mod="${curitem_mod#*[$sort_sep]}" + + # Skip NULLs unless strict field splitting + [ "$sort_strict_fields" ] || + [ "${curitem_mod%%[$sort_sep]*}" ] || + [ $n -eq 2 ] || + continue + ;; + *) + # Asked for a field that doesn't exist + curitem_haskey= break + esac + n=$(( $n - 1 )) + done + + # Trim trailing words if sort field >= 1 + [ $sort_field -ge 1 -a "$sort_numeric" ] && + curitem_mod="${curitem_mod%%[$sort_sep]*}" + + # Apply optional trim (-k POS.TRIM) to cut leading characters + curitem_mod="${curitem_mod#$trim}" + + # Determine the type of modified comparison to use initially + # NB: Prefer numerical if requested but fallback to standard + case "$curitem_mod" in + ""|[!0-9]*) # NULL or begins with non-number + gt=">" + [ "$sort_numeric" ] && curitem_mod=0 + ;; + *) + if [ "$sort_numeric" ]; then + gt="-gt" + curitem_mod="${curitem_mod%%[!0-9]*}" + # NB: trailing non-digits removed + # otherwise numeric comparison fails + else + gt=">" + fi + esac + + # If first time through, short-circuit below position-search + if [ $i -le 1 ]; then + d=0 + else + d=1 + fi + + # + # Find appropriate element position + # + while [ $d -gt 0 ] + do + dest_haskey=$curitem_haskey + eval dest=\"\$dest_$d\" + dest_mod="$dest" # for modified comparison + dest_orig="$dest" # for original comparison + + # Trim leading whitespace if desired + if [ "$sort_ignore_leading_space" ]; then + while case "$dest_orig" in + [$IFS]*) : ;; *) false; esac + do + dest_orig="${dest_orig#?}" + done + dest_mod="$dest_orig" + fi + + # Shift modified value if sort field (-k POS) is > 1 + n=$sort_field + while [ $n -gt 1 ]; do + case "$dest_mod" in + *[$sort_sep]*) + # Cut text up-to (and incl.) 1st sep + dest_mod="${dest_mod#*[$sort_sep]}" + + # Skip NULLs unless strict fields + [ "$sort_strict_fields" ] || + [ "${dest_mod%%[$sort_sep]*}" ] || + [ $n -eq 2 ] || + continue + ;; + *) + # Asked for a field that doesn't exist + dest_haskey= break + esac + n=$(( $n - 1 )) + done + + # Trim trailing words if sort field >= 1 + [ $sort_field -ge 1 -a "$sort_numeric" ] && + dest_mod="${dest_mod%%[$sort_sep]*}" + + # Apply optional trim (-k POS.TRIM), cut leading chars + dest_mod="${dest_mod#$trim}" + + # Determine type of modified comparison to use + # NB: Prefer numerical if requested, fallback to std + case "$dest_mod" in + ""|[!0-9]*) # NULL or begins with non-number + gt=">" + [ "$sort_numeric" ] && dest_mod=0 + ;; + *) + if [ "$sort_numeric" ]; then + gt="-gt" + dest_mod="${dest_mod%%[!0-9]*}" + # NB: kill trailing non-digits + # for numeric comparison safety + else + gt=">" + fi + esac + + # Break if we've found the proper element position + if [ "$curitem_haskey" -a "$dest_haskey" ]; then + if [ "$dest_mod" = "$curitem_mod" ]; then + [ "$dest_orig" ">" "$curitem_orig" ] && + break + elif [ "$dest_mod" $gt "$curitem_mod" ] \ + 2> /dev/null + then + break + fi + else + [ "$dest_orig" ">" "$curitem_orig" ] && break + fi + + # Break if we've hit the end + [ $d -ge $i ] && break + + d=$(( $d + 1 )) + done + + # Shift remaining positions forward, making room for new item + n=$i + while [ $n -ge $d ]; do + # Shift destination item forward one placement + eval dest_$(( $n + 1 ))=\"\$dest_$n\" + n=$(( $n - 1 )) + done + + # Place the element + if [ $i -eq 1 ]; then + local dest_1="$curitem" + else + local dest_$d="$curitem" + fi + + i=$(( $i + 1 )) + done + + # Print sorted results + d=1 + while [ $d -le $nitems ]; do + eval echo \"\$dest_$d\" + d=$(( $d + 1 )) + done +} + # # wait_for_pids pid [pid ...] # spins until none of the pids exist @@ -1524,19 +1778,20 @@ load_kld() return 0 } -# ltr str src dst +# ltr str src dst [var] # Change every $src in $str to $dst. # Useful when /usr is not yet mounted and we cannot use tr(1), sed(1) nor -# awk(1). +# awk(1). If var is non-NULL, set it to the result. ltr() { - local _str _src _dst _out _com - _str=$1 - _src=$2 - _dst=$3 + local _str _src _dst _out _com _var + _str="$1" + _src="$2" + _dst="$3" + _var="$4" _out="" - IFS=${_src} + local IFS="${_src}" for _com in ${_str}; do if [ -z "${_out}" ]; then _out="${_com}" @@ -1544,7 +1799,11 @@ ltr() _out="${_out}${_dst}${_com}" fi done - echo "${_out}" + if [ -n "${_var}" ]; then + setvar "${_var}" "${_out}" + else + echo "${_out}" + fi } # Creates a list of providers for GELI encryption. From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 03:57:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D611F1AB; Mon, 14 Apr 2014 03:57: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 C2BCF1963; Mon, 14 Apr 2014 03:57: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 s3E3vksO011936; Mon, 14 Apr 2014 03:57:46 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E3vkDp011932; Mon, 14 Apr 2014 03:57:46 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404140357.s3E3vkDp011932@svn.freebsd.org> From: Glen Barber Date: Mon, 14 Apr 2014 03:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264440 - in stable/10: release share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 03:57:47 -0000 Author: gjb Date: Mon Apr 14 03:57:45 2014 New Revision: 264440 URL: http://svnweb.freebsd.org/changeset/base/264440 Log: MFC r264343: Add SRC_UPDATE_SKIP, DOC_UPDATE_SKIP, and PORTS_UPDATE_SKIP variables. These are intended to allow bypassing the 'svn co /usr/{src,doc,ports}' step in the chroot when the tree exists from external means. The use case here is that /usr/src, /usr/doc, and /usr/ports in the chroot exist as result of zfs dataset clones, so it is possible (and happens quite often) that the included distributions may not be consistent. (This is not the case for -RELEASE builds, but does happen for snapshot builds.) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/release.conf.sample stable/10/release/release.sh stable/10/share/man/man7/release.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/release/release.conf.sample ============================================================================== --- stable/10/release/release.conf.sample Mon Apr 14 01:49:26 2014 (r264439) +++ stable/10/release/release.conf.sample Mon Apr 14 03:57:45 2014 (r264440) @@ -56,6 +56,18 @@ PORTBRANCH="ports/head@rHEAD" ## means. #CHROOTBUILD_SKIP= +## Set to a non-empty value skip checkout or update of /usr/src in +## the chroot. This is intended for use when /usr/src already exists. +#SRC_UPDATE_SKIP= + +## Set to a non-empty value skip checkout or update of /usr/doc in +## the chroot. This is intended for use when /usr/doc already exists. +#DOC_UPDATE_SKIP= + +## Set to a non-empty value skip checkout or update of /usr/ports in +## the chroot. This is intended for use when /usr/ports already exists. +#PORTS_UPDATE_SKIP= + ## Set to pass additional flags to make(1) for the build chroot setup, such ## as TARGET/TARGET_ARCH. #CHROOT_MAKEENV= Modified: stable/10/release/release.sh ============================================================================== --- stable/10/release/release.sh Mon Apr 14 01:49:26 2014 (r264439) +++ stable/10/release/release.sh Mon Apr 14 03:57:45 2014 (r264440) @@ -190,11 +190,13 @@ set -e # Everything must succeed mkdir -p ${CHROOTDIR}/usr -${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src -if [ -z "${NODOC}" ]; then +if [ -z "${SRC_UPDATE_SKIP}" ]; then + ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src +fi +if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi -if [ -z "${NOPORTS}" ]; then +if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi Modified: stable/10/share/man/man7/release.7 ============================================================================== --- stable/10/share/man/man7/release.7 Mon Apr 14 01:49:26 2014 (r264439) +++ stable/10/share/man/man7/release.7 Mon Apr 14 03:57:45 2014 (r264440) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 2, 2014 +.Dd April 11, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -272,6 +272,30 @@ build environment setup are skipped. This is intended solely for cases where the .Xr chroot 8 userland are provided by alternate means. +.It Va SRC_UPDATE_SKIP +Set to a non-empty value to prevent checkout or update of +.Fa /usr/src +within the +.Xr chroot 8 . +This is intended for use only when +.Fa /usr/src +is expected to exist by alternative means. +.It Va DOC_UPDATE_SKIP +Set to a non-empty value to prevent checkout or update of +.Fa /usr/doc +within the +.Xr chroot 8 . +This is intended for use only when +.Fa /usr/doc +is expected to exist by alternative means. +.It Va PORTS_UPDATE_SKIP +Set to a non-empty value to prevent checkout or update of +.Fa /usr/ports +within the +.Xr chroot 8 . +This is intended for use only when +.Fa /usr/ports +is expected to exist by alternative means. .El .Sh EMBEDDED BUILDS The following From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 04:52:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 022ECDCE; Mon, 14 Apr 2014 04:52: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 E1C561E01; Mon, 14 Apr 2014 04:52: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 s3E4q1V8035873; Mon, 14 Apr 2014 04:52:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E4pxMX035845; Mon, 14 Apr 2014 04:51:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201404140451.s3E4pxMX035845@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Apr 2014 04:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264442 - in stable/10/sys: dev/age dev/alc dev/ale dev/bce dev/bge dev/fxp dev/jme dev/msk dev/nfe dev/sge pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 04:52:02 -0000 Author: yongari Date: Mon Apr 14 04:51:59 2014 New Revision: 264442 URL: http://svnweb.freebsd.org/changeset/base/264442 Log: MFC r263957: Increase the number of TX DMA segments from 32 to 35. It turned out 32 is not enough to support a full sized TSO packet. While I'm here fix a long standing bug introduced in r169632 in bce(4) where it didn't include L2 header length of TSO packet in the maximum DMA segment size calculation. Modified: stable/10/sys/dev/age/if_agevar.h stable/10/sys/dev/alc/if_alcvar.h stable/10/sys/dev/ale/if_alevar.h stable/10/sys/dev/bce/if_bcereg.h stable/10/sys/dev/bge/if_bgereg.h stable/10/sys/dev/fxp/if_fxpreg.h stable/10/sys/dev/jme/if_jmevar.h stable/10/sys/dev/msk/if_mskreg.h stable/10/sys/dev/nfe/if_nfereg.h stable/10/sys/dev/sge/if_sgereg.h stable/10/sys/pci/if_rlreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/age/if_agevar.h ============================================================================== --- stable/10/sys/dev/age/if_agevar.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/dev/age/if_agevar.h Mon Apr 14 04:51:59 2014 (r264442) @@ -42,7 +42,7 @@ #define AGE_TSO_MAXSEGSIZE 4096 #define AGE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) -#define AGE_MAXTXSEGS 32 +#define AGE_MAXTXSEGS 35 #define AGE_RX_BUF_ALIGN 8 #ifndef __NO_STRICT_ALIGNMENT #define AGE_RX_BUF_SIZE (MCLBYTES - AGE_RX_BUF_ALIGN) Modified: stable/10/sys/dev/alc/if_alcvar.h ============================================================================== --- stable/10/sys/dev/alc/if_alcvar.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/dev/alc/if_alcvar.h Mon Apr 14 04:51:59 2014 (r264442) @@ -42,7 +42,7 @@ #define ALC_TSO_MAXSEGSIZE 4096 #define ALC_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) -#define ALC_MAXTXSEGS 32 +#define ALC_MAXTXSEGS 35 #define ALC_ADDR_LO(x) ((uint64_t) (x) & 0xFFFFFFFF) #define ALC_ADDR_HI(x) ((uint64_t) (x) >> 32) Modified: stable/10/sys/dev/ale/if_alevar.h ============================================================================== --- stable/10/sys/dev/ale/if_alevar.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/dev/ale/if_alevar.h Mon Apr 14 04:51:59 2014 (r264442) @@ -40,7 +40,7 @@ #define ALE_TSO_MAXSEGSIZE 4096 #define ALE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) -#define ALE_MAXTXSEGS 32 +#define ALE_MAXTXSEGS 35 #define ALE_ADDR_LO(x) ((uint64_t) (x) & 0xFFFFFFFF) #define ALE_ADDR_HI(x) ((uint64_t) (x) >> 32) Modified: stable/10/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/10/sys/dev/bce/if_bcereg.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/dev/bce/if_bcereg.h Mon Apr 14 04:51:59 2014 (r264442) @@ -6354,8 +6354,8 @@ struct fw_info { #define BCE_TX_TIMEOUT 5 -#define BCE_MAX_SEGMENTS 32 -#define BCE_TSO_MAX_SIZE 65536 +#define BCE_MAX_SEGMENTS 35 +#define BCE_TSO_MAX_SIZE (65535 + sizeof(struct ether_vlan_header)) #define BCE_TSO_MAX_SEG_SIZE 4096 #define BCE_DMA_ALIGN 8 Modified: stable/10/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/10/sys/dev/bge/if_bgereg.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/dev/bge/if_bgereg.h Mon Apr 14 04:51:59 2014 (r264442) @@ -2852,7 +2852,7 @@ struct bge_gib { */ #define BGE_NSEG_JUMBO 4 -#define BGE_NSEG_NEW 32 +#define BGE_NSEG_NEW 35 #define BGE_TSOSEG_SZ 4096 /* Maximum DMA address for controllers that have 40bit DMA address bug. */ Modified: stable/10/sys/dev/fxp/if_fxpreg.h ============================================================================== --- stable/10/sys/dev/fxp/if_fxpreg.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/dev/fxp/if_fxpreg.h Mon Apr 14 04:51:59 2014 (r264442) @@ -250,7 +250,7 @@ struct fxp_cb_ucode { /* * Number of DMA segments in a TxCB. */ -#define FXP_NTXSEG 32 +#define FXP_NTXSEG 35 struct fxp_tbd { uint32_t tb_addr; Modified: stable/10/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/10/sys/dev/jme/if_jmevar.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/dev/jme/if_jmevar.h Mon Apr 14 04:51:59 2014 (r264442) @@ -49,7 +49,7 @@ #define JME_RX_RING_ALIGN 16 #define JME_TSO_MAXSEGSIZE 4096 #define JME_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) -#define JME_MAXTXSEGS 32 +#define JME_MAXTXSEGS 35 #define JME_RX_BUF_ALIGN sizeof(uint64_t) #define JME_SSB_ALIGN 16 Modified: stable/10/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/10/sys/dev/msk/if_mskreg.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/dev/msk/if_mskreg.h Mon Apr 14 04:51:59 2014 (r264442) @@ -2338,7 +2338,7 @@ struct msk_stat_desc { #endif #define MSK_RX_BUF_ALIGN 8 #define MSK_JUMBO_RX_RING_CNT MSK_RX_RING_CNT -#define MSK_MAXTXSEGS 32 +#define MSK_MAXTXSEGS 35 #define MSK_TSO_MAXSGSIZE 4096 #define MSK_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) Modified: stable/10/sys/dev/nfe/if_nfereg.h ============================================================================== --- stable/10/sys/dev/nfe/if_nfereg.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/dev/nfe/if_nfereg.h Mon Apr 14 04:51:59 2014 (r264442) @@ -40,7 +40,7 @@ (NFE_JUMBO_FRAMELEN - NFE_RX_HEADERS) #define NFE_MIN_FRAMELEN (ETHER_MIN_LEN - ETHER_CRC_LEN) -#define NFE_MAX_SCATTER 32 +#define NFE_MAX_SCATTER 35 #define NFE_TSO_MAXSGSIZE 4096 #define NFE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) Modified: stable/10/sys/dev/sge/if_sgereg.h ============================================================================== --- stable/10/sys/dev/sge/if_sgereg.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/dev/sge/if_sgereg.h Mon Apr 14 04:51:59 2014 (r264442) @@ -284,7 +284,7 @@ struct sge_desc { #define SGE_RX_RING_CNT 256 /* [8, 1024] */ #define SGE_TX_RING_CNT 256 /* [8, 8192] */ #define SGE_DESC_ALIGN 16 -#define SGE_MAXTXSEGS 32 +#define SGE_MAXTXSEGS 35 #define SGE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) #define SGE_TSO_MAXSEGSIZE 4096 #define SGE_RX_BUF_ALIGN sizeof(uint64_t) Modified: stable/10/sys/pci/if_rlreg.h ============================================================================== --- stable/10/sys/pci/if_rlreg.h Mon Apr 14 03:58:18 2014 (r264441) +++ stable/10/sys/pci/if_rlreg.h Mon Apr 14 04:51:59 2014 (r264442) @@ -776,7 +776,7 @@ struct rl_stats { #define RL_TX_DESC_CNT RL_8169_TX_DESC_CNT #define RL_RX_DESC_CNT RL_8169_RX_DESC_CNT #define RL_RX_JUMBO_DESC_CNT RL_RX_DESC_CNT -#define RL_NTXSEGS 32 +#define RL_NTXSEGS 35 #define RL_RING_ALIGN 256 #define RL_DUMP_ALIGN 64 From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 04:58:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7015811C; Mon, 14 Apr 2014 04:58: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 42E881E6B; Mon, 14 Apr 2014 04:58: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 s3E4wp82036725; Mon, 14 Apr 2014 04:58:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E4wpV1036724; Mon, 14 Apr 2014 04:58:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201404140458.s3E4wpV1036724@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Apr 2014 04:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264444 - stable/10/sys/dev/ae X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 04:58:51 -0000 Author: yongari Date: Mon Apr 14 04:58:50 2014 New Revision: 264444 URL: http://svnweb.freebsd.org/changeset/base/264444 Log: MFC r259543: Failed m_devget(9) indicates lack of free mbuf cluster. Update if_iqdrops counter for that case since the received frame is ok. While here, simplify updating counter logic. Modified: stable/10/sys/dev/ae/if_ae.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ae/if_ae.c ============================================================================== --- stable/10/sys/dev/ae/if_ae.c Mon Apr 14 04:53:34 2014 (r264443) +++ stable/10/sys/dev/ae/if_ae.c Mon Apr 14 04:58:50 2014 (r264444) @@ -132,7 +132,7 @@ static void ae_mac_config(ae_softc_t *sc static int ae_intr(void *arg); static void ae_int_task(void *arg, int pending); static void ae_tx_intr(ae_softc_t *sc); -static int ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd); +static void ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd); static void ae_rx_intr(ae_softc_t *sc); static void ae_watchdog(ae_softc_t *sc); static void ae_tick(void *arg); @@ -1881,7 +1881,7 @@ ae_tx_intr(ae_softc_t *sc) BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } -static int +static void ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) { struct ifnet *ifp; @@ -1900,12 +1900,15 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) size = le16toh(rxd->len) - ETHER_CRC_LEN; if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) { if_printf(ifp, "Runt frame received."); - return (EIO); + ifp->if_ierrors++; + return; } m = m_devget(&rxd->data[0], size, ETHER_ALIGN, ifp, NULL); - if (m == NULL) - return (ENOBUFS); + if (m == NULL) { + ifp->if_iqdrops++; + return; + } if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 && (flags & AE_RXD_HAS_VLAN) != 0) { @@ -1913,14 +1916,13 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) m->m_flags |= M_VLANTAG; } + ifp->if_ipackets++; /* * Pass it through. */ AE_UNLOCK(sc); (*ifp->if_input)(ifp, m); AE_LOCK(sc); - - return (0); } static void @@ -1929,7 +1931,7 @@ ae_rx_intr(ae_softc_t *sc) ae_rxd_t *rxd; struct ifnet *ifp; uint16_t flags; - int count, error; + int count; KASSERT(sc != NULL, ("[ae, %d]: sc is NULL!", __LINE__)); @@ -1957,17 +1959,10 @@ ae_rx_intr(ae_softc_t *sc) */ sc->rxd_cur = (sc->rxd_cur + 1) % AE_RXD_COUNT_DEFAULT; - if ((flags & AE_RXD_SUCCESS) == 0) { - ifp->if_ierrors++; - continue; - } - error = ae_rxeof(sc, rxd); - if (error != 0) { + if ((flags & AE_RXD_SUCCESS) != 0) + ae_rxeof(sc, rxd); + else ifp->if_ierrors++; - continue; - } else { - ifp->if_ipackets++; - } } if (count > 0) { From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 05:04:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CD11E3D8; Mon, 14 Apr 2014 05:04: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 B9AC11047; Mon, 14 Apr 2014 05:04: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 s3E54NPH040459; Mon, 14 Apr 2014 05:04:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E54Nl9040458; Mon, 14 Apr 2014 05:04:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201404140504.s3E54Nl9040458@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Apr 2014 05:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264446 - stable/10/sys/dev/ale X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 05:04:23 -0000 Author: yongari Date: Mon Apr 14 05:04:23 2014 New Revision: 264446 URL: http://svnweb.freebsd.org/changeset/base/264446 Log: MFC r260429: m_defrag(9) does not touch original mbuf chain when it can't allocate new mbuf. Free original mbuf chain when driver is not able to send the packet. Modified: stable/10/sys/dev/ale/if_ale.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ale/if_ale.c ============================================================================== --- stable/10/sys/dev/ale/if_ale.c Mon Apr 14 04:59:46 2014 (r264445) +++ stable/10/sys/dev/ale/if_ale.c Mon Apr 14 05:04:23 2014 (r264446) @@ -1659,6 +1659,7 @@ ale_encap(struct ale_softc *sc, struct m (mtod(m, intptr_t) & 3) != 0) { m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { + m_freem(*m_head); *m_head = NULL; return (ENOBUFS); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 05:37:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 145B9D36; Mon, 14 Apr 2014 05:37: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 00A5012FB; Mon, 14 Apr 2014 05:37: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 s3E5bLVi052950; Mon, 14 Apr 2014 05:37:21 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E5bLWu052949; Mon, 14 Apr 2014 05:37:21 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404140537.s3E5bLWu052949@svn.freebsd.org> From: Devin Teske Date: Mon, 14 Apr 2014 05:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264449 - stable/10/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 05:37:22 -0000 Author: dteske Date: Mon Apr 14 05:37:21 2014 New Revision: 264449 URL: http://svnweb.freebsd.org/changeset/base/264449 Log: MFC r264448: Fix typo in debug/log statement. Submitted by: Rick Miller Modified: stable/10/usr.sbin/bsdinstall/scripts/script Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/script ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/script Mon Apr 14 05:35:01 2014 (r264448) +++ stable/10/usr.sbin/bsdinstall/scripts/script Mon Apr 14 05:37:21 2014 (r264449) @@ -74,7 +74,7 @@ trap error EXIT SCRIPT="$1" shift -f_dprintf "Began Instalation at %s" "$( date )" +f_dprintf "Began Installation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 05:38:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C4CE5E6A; Mon, 14 Apr 2014 05:38:29 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail0.glenbarber.us", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 923A41302; Mon, 14 Apr 2014 05:38:29 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 238A9E500; Mon, 14 Apr 2014 05:38:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 238A9E500 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Mon, 14 Apr 2014 01:38:26 -0400 From: Glen Barber To: Devin Teske Subject: Re: svn commit: r264449 - stable/10/usr.sbin/bsdinstall/scripts Message-ID: <20140414053826.GM92266@glenbarber.us> References: <201404140537.s3E5bLWu052949@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xtx0sNU5lZ46KfgK" Content-Disposition: inline In-Reply-To: <201404140537.s3E5bLWu052949@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 05:38:29 -0000 --xtx0sNU5lZ46KfgK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 14, 2014 at 05:37:21AM +0000, Devin Teske wrote: > Author: dteske > Date: Mon Apr 14 05:37:21 2014 > New Revision: 264449 > URL: http://svnweb.freebsd.org/changeset/base/264449 >=20 > Log: > MFC r264448: Fix typo in debug/log statement. > =20 MFCs have a default minimal timeframe of 3 days. Glen --xtx0sNU5lZ46KfgK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTS3RSAAoJELls3eqvi17Q7jgP/iNdF0N4d35aSTKJ+mbbf8l2 bPSwrYBC+c2QW1sDGHKd9eBq+p7MgWmWfCQTR5QlV1G0dwfF5Mbv9X2l/G40Tb2I LVnW06zdh3oSInlgU06/NjsiA4mKsVIIrQzbJhtBJK2wsjbRXtmp5+0Dv7eLIFAw SRU8WBwmp6Ev/0VskPp2gtcV6kDhSUrtV5r8+1Irg4oilltDZI7Bth8HEp5QGGiI swYc79rwrAHebZjTMuhAUcx733rJquvyY5Msc5Ay0TXiAyZhEiv+XZZOO4GQtsKF mi0HDTZ8W/XzGGY6afhTnHxH+8RF/3YNqbxvCshOiEcK0Ond4yaXIsf5eMIQPYId s36gFCxDdTMBgRArBa9VZniFibCc4y7a4iDx6ZaYt1IK7ThIoe26PZZK4feRU0LO lh8/JvoWn9JZi4yo4sV2x4/boRo5MLs9FVkFVJUKRrXCraO1YSC33D0x5AHkP0Qy RpcgMtqdkBUK0upilrk9s3aE5mlqiLAQ9vt67Hdm9BxTTjsXjBhWCmF1vCy+8fTz e2tcx/h6BgteIyVqZuQ5LxCBPCheFgBrlzfxFNPA7kE8qrWL+aiGLRAdGBoOEEbQ c/6mYcHh92GUORJ+RdLHT91kxb6JIo5c7kEYx1LetgOLZmr6mUbuSAf/JNMMelpR 5tlKZhgvhUDF+gk6n6u5 =4vkt -----END PGP SIGNATURE----- --xtx0sNU5lZ46KfgK-- From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 05:40:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 65BFF1FD; Mon, 14 Apr 2014 05:40:35 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx1.fisglobal.com", Issuer "VeriSign Class 3 Secure Server CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E5B5131E; Mon, 14 Apr 2014 05:40:34 +0000 (UTC) Received: from smarthost.fisglobal.com ([10.132.206.191]) by ltcfislmsgpa06.fnfis.com (8.14.5/8.14.5) with ESMTP id s3E5eXX6007300 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 14 Apr 2014 00:40:34 -0500 Received: from THEMADHATTER (10.242.181.54) by smarthost.fisglobal.com (10.132.206.191) with Microsoft SMTP Server id 14.3.174.1; Mon, 14 Apr 2014 00:40:31 -0500 From: Sender: Devin Teske To: "'Glen Barber'" , "'Devin Teske'" References: <201404140537.s3E5bLWu052949@svn.freebsd.org> <20140414053826.GM92266@glenbarber.us> In-Reply-To: <20140414053826.GM92266@glenbarber.us> Subject: RE: svn commit: r264449 - stable/10/usr.sbin/bsdinstall/scripts Date: Sun, 13 Apr 2014 22:40:16 -0700 Message-ID: <014a01cf57a4$05619cd0$1024d670$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQFxgxHsZtj7oF0ie6E/nuEG6xoniALFyoqBm7YTTLA= Content-Language: en-us X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.96, 1.0.14, 0.0.0000 definitions=2014-04-12_01:2014-04-11,2014-04-12,1970-01-01 signatures=0 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 05:40:35 -0000 > -----Original Message----- > From: Glen Barber [mailto:gjb@FreeBSD.org] > Sent: Sunday, April 13, 2014 10:38 PM > To: Devin Teske > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > stable@freebsd.org; svn-src-stable-10@freebsd.org > Subject: Re: svn commit: r264449 - stable/10/usr.sbin/bsdinstall/scripts > > On Mon, Apr 14, 2014 at 05:37:21AM +0000, Devin Teske wrote: > > Author: dteske > > Date: Mon Apr 14 05:37:21 2014 > > New Revision: 264449 > > URL: > https://urldefense.proofpoint.com/v1/url?u=http://svnweb.freebsd.org/ch > angeset/base/264449&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r= > Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=rcQ%2Fw0BwuT3SHeUjHm > %2Fq7pysiSrhQUwRWG7pee6lsCw%3D%0A&s=a05d45bd044a68ba178857af1 > dac1f207319326fa6f53a72919816ac9649fa20 > > > > Log: > > MFC r264448: Fix typo in debug/log statement. > > > > MFCs have a default minimal timeframe of 3 days. > I've often heard folks say that this doesn't apply to blatantly simple/trivial things like a typo. But I'll keep that in mind next time. Thanks. -- Devin _____________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 09:36:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F2B362A8; Mon, 14 Apr 2014 09:36: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 C5B9818DB; Mon, 14 Apr 2014 09:36: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 s3E9aFmW052872; Mon, 14 Apr 2014 09:36:15 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E9aFmi052871; Mon, 14 Apr 2014 09:36:15 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201404140936.s3E9aFmi052871@svn.freebsd.org> From: Martin Matuska Date: Mon, 14 Apr 2014 09:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264454 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 09:36:16 -0000 Author: mm Date: Mon Apr 14 09:36:15 2014 New Revision: 264454 URL: http://svnweb.freebsd.org/changeset/base/264454 Log: MFC r264220: Execute pf_overload_task() in vnet context. Fixes a vnet kernel panic. Reviewed by: trociny Modified: stable/10/sys/netpfil/pf/pf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf.c ============================================================================== --- stable/10/sys/netpfil/pf/pf.c Mon Apr 14 06:59:49 2014 (r264453) +++ stable/10/sys/netpfil/pf/pf.c Mon Apr 14 09:36:15 2014 (r264454) @@ -277,7 +277,7 @@ static int pf_addr_wrap_neq(struct pf_ static struct pf_state *pf_find_state(struct pfi_kif *, struct pf_state_key_cmp *, u_int); static int pf_src_connlimit(struct pf_state **); -static void pf_overload_task(void *c, int pending); +static void pf_overload_task(void *v, int pending); static int pf_insert_src_node(struct pf_src_node **, struct pf_rule *, struct pf_addr *, sa_family_t); static u_int pf_purge_expired_states(u_int, int); @@ -509,16 +509,18 @@ pf_src_connlimit(struct pf_state **state } static void -pf_overload_task(void *c, int pending) +pf_overload_task(void *v, int pending) { struct pf_overload_head queue; struct pfr_addr p; struct pf_overload_entry *pfoe, *pfoe1; uint32_t killed = 0; + CURVNET_SET((struct vnet *)v); + PF_OVERLOADQ_LOCK(); - queue = *(struct pf_overload_head *)c; - SLIST_INIT((struct pf_overload_head *)c); + queue = V_pf_overloadqueue; + SLIST_INIT(&V_pf_overloadqueue); PF_OVERLOADQ_UNLOCK(); bzero(&p, sizeof(p)); @@ -562,8 +564,10 @@ pf_overload_task(void *c, int pending) V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH]++; /* If nothing to flush, return. */ - if (SLIST_EMPTY(&queue)) + if (SLIST_EMPTY(&queue)) { + CURVNET_RESTORE(); return; + } for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; @@ -592,6 +596,8 @@ pf_overload_task(void *c, int pending) free(pfoe, M_PFTEMP); if (V_pf_status.debug >= PF_DEBUG_MISC) printf("%s: %u states killed", __func__, killed); + + CURVNET_RESTORE(); } /* @@ -788,7 +794,7 @@ pf_initialize() /* Send & overload+flush queues. */ STAILQ_INIT(&V_pf_sendqueue); SLIST_INIT(&V_pf_overloadqueue); - TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, &V_pf_overloadqueue); + TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, curvnet); mtx_init(&pf_sendqueue_mtx, "pf send queue", NULL, MTX_DEF); mtx_init(&pf_overloadqueue_mtx, "pf overload/flush queue", NULL, MTX_DEF); From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 12:40:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B8ADF326; Mon, 14 Apr 2014 12:40: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 A4C9E1324; Mon, 14 Apr 2014 12:40: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 s3ECecDH028545; Mon, 14 Apr 2014 12:40:38 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ECeckX028543; Mon, 14 Apr 2014 12:40:38 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201404141240.s3ECeckX028543@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 14 Apr 2014 12:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264455 - in stable/10/sys: dev/vt kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 12:40:38 -0000 Author: ray Date: Mon Apr 14 12:40:37 2014 New Revision: 264455 URL: http://svnweb.freebsd.org/changeset/base/264455 Log: MFC 264242,264244,264259 Fix panic on load new driver while vt(4) is in VGA textmode. o Mute terminal while vt(4) driver change in progress. o Reset VDF_TEXTMODE before init new driver. o Assign default font, if new driver is not in TEXTMODE. o Do not update screen while driver changing. o Unmute terminal when done with driver replacement. o Move init fonts to early point. o Minor cleanup. o Do not fill screen, while muted. (kern/subr_terminal.c) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/vt/vt_core.c stable/10/sys/kern/subr_terminal.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Mon Apr 14 09:36:15 2014 (r264454) +++ stable/10/sys/dev/vt/vt_core.c Mon Apr 14 12:40:37 2014 (r264455) @@ -705,8 +705,8 @@ vt_bitblt_char(struct vt_device *vd, str static void vt_flush(struct vt_device *vd) { - struct vt_window *vw = vd->vd_curwindow; - struct vt_font *vf = vw->vw_font; + struct vt_window *vw; + struct vt_font *vf; struct vt_bufmask tmask; unsigned int row, col; term_rect_t tarea; @@ -717,6 +717,13 @@ vt_flush(struct vt_device *vd) int bpl, h, w; #endif + vw = vd->vd_curwindow; + if (vw == NULL) + return; + vf = vw->vw_font; + if (((vd->vd_flags & VDF_TEXTMODE) == 0) && (vf == NULL)) + return; + if (vd->vd_flags & VDF_SPLASH || vw->vw_flags & VWF_BUSY) return; @@ -794,6 +801,7 @@ vt_timer(void *arg) vd = arg; /* Update screen if required. */ vt_flush(vd); + /* Schedule for next update. */ callout_schedule(&vd->vd_timer, hz / VT_TIMERFREQ); } @@ -1882,6 +1890,7 @@ vt_upgrade(struct vt_device *vd) vt_window_switch, vw, SHUTDOWN_PRI_DEFAULT); } terminal_maketty(vw->vw_terminal, "v%r", VT_UNIT(vw)); + } if (vd->vd_curwindow == NULL) vd->vd_curwindow = vd->vd_windows[VT_CONSWINDOW]; @@ -1902,6 +1911,9 @@ vt_resize(struct vt_device *vd) for (i = 0; i < VT_MAXWINDOWS; i++) { vw = vd->vd_windows[i]; + /* Assign default font to window, if not textmode. */ + if (!(vd->vd_flags & VDF_TEXTMODE) && vw->vw_font == NULL) + vw->vw_font = vtfont_ref(&vt_font_default); /* Resize terminal windows */ vt_change_font(vw, vw->vw_font); } @@ -1933,9 +1945,21 @@ vt_allocate(struct vt_driver *drv, void if (drv->vd_maskbitbltchr == NULL) drv->vd_maskbitbltchr = drv->vd_bitbltchr; - /* Stop vt_flush periodic task. */ - if (vd->vd_curwindow != NULL) + if (vd->vd_flags & VDF_ASYNC) { + /* Stop vt_flush periodic task. */ callout_drain(&vd->vd_timer); + /* + * Mute current terminal until we done. vt_change_font (called + * from vt_resize) will unmute it. + */ + terminal_mute(vd->vd_curwindow->vw_terminal, 1); + } + + /* + * Reset VDF_TEXTMODE flag, driver who require that flag (vt_vga) will + * set it. + */ + vd->vd_flags &= ~VDF_TEXTMODE; vd->vd_driver = drv; vd->vd_softc = softc; @@ -1951,8 +1975,10 @@ vt_allocate(struct vt_driver *drv, void vtterm_splash(vd); #endif - if (vd->vd_curwindow != NULL) + if (vd->vd_flags & VDF_ASYNC) { + terminal_mute(vd->vd_curwindow->vw_terminal, 0); callout_schedule(&vd->vd_timer, hz / VT_TIMERFREQ); + } termcn_cnregister(vd->vd_windows[VT_CONSWINDOW]->vw_terminal); Modified: stable/10/sys/kern/subr_terminal.c ============================================================================== --- stable/10/sys/kern/subr_terminal.c Mon Apr 14 09:36:15 2014 (r264454) +++ stable/10/sys/kern/subr_terminal.c Mon Apr 14 12:40:37 2014 (r264455) @@ -208,7 +208,7 @@ terminal_set_winsize_blank(struct termin teken_set_winsize(&tm->tm_emulator, &r.tr_end); TERMINAL_UNLOCK(tm); - if (blank != 0) + if ((blank != 0) && !(tm->tm_flags & TF_MUTE)) tm->tm_class->tc_fill(tm, &r, TCHAR_CREATE((teken_char_t)' ', &default_message)); From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 13:30:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EB4DF2BA; Mon, 14 Apr 2014 13:30: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 D3A1217A7; Mon, 14 Apr 2014 13:30: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 s3EDUCZU047671; Mon, 14 Apr 2014 13:30:12 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EDU8JH047639; Mon, 14 Apr 2014 13:30:08 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404141330.s3EDU8JH047639@svn.freebsd.org> From: Julio Merino Date: Mon, 14 Apr 2014 13:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264457 - in stable/10: sys/net tools/regression/lib/libc/net tools/regression/lib/libc/string tools/regression/priv tools/regression/sbin/mdconfig tools/regression/usr.bin/lastcomm too... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 13:30:13 -0000 Author: jmmv Date: Mon Apr 14 13:30:08 2014 New Revision: 264457 URL: http://svnweb.freebsd.org/changeset/base/264457 Log: MFC various fixes to the tools/regression/ tests. - r262953 Fix m4 tests so that they run cleanly with prove. - r262954 Fix printf tests so that they run cleanly with prove. - r262959 Fix sed tests so that they run cleanly with prove. - r262960 Fix yacc tests so that they run cleanly with prove. - r262961 Fix pkill tests so that they run cleanly with prove. - r262962 Fix ncal tests so that they run cleanly with prove. - r263081 Fix lastcomm tests under amd64. - r263082 Only run the make tests when make is fmake. - r263083 Fix sa tests. - r263084 Turn a test precondition into a skip in the mdconfig tests. - r263085 Make the strerror tests work without libtap. - r263087 Remove broken tests for eui64_line. - r263221 Change etcupdate tests to return 1 on test failures. - r263352 Make the priv test program exit with non-zero if any failures are detected. - r263353 errx prepends the program name to the message; don't do it by hand. - r263362 Include strings.h so that bpf_filter.c can be built in userland. Deleted: stable/10/tools/regression/lib/libc/net/test-eui64_line.c stable/10/tools/regression/lib/libc/net/test-eui64_line.t Modified: stable/10/sys/net/bpf_filter.c stable/10/tools/regression/lib/libc/net/Makefile stable/10/tools/regression/lib/libc/string/Makefile stable/10/tools/regression/lib/libc/string/test-strerror.c stable/10/tools/regression/priv/main.c stable/10/tools/regression/sbin/mdconfig/00.t stable/10/tools/regression/usr.bin/lastcomm/regress.t stable/10/tools/regression/usr.bin/lastcomm/v1-amd64.out stable/10/tools/regression/usr.bin/lastcomm/v2-amd64.out stable/10/tools/regression/usr.bin/m4/regress.gnusofterror.out stable/10/tools/regression/usr.bin/m4/regress.sh stable/10/tools/regression/usr.bin/m4/regress.t stable/10/tools/regression/usr.bin/make/common.sh stable/10/tools/regression/usr.bin/ncal/regress.sh stable/10/tools/regression/usr.bin/pkill/pgrep-_s.t stable/10/tools/regression/usr.bin/printf/regress.sh stable/10/tools/regression/usr.bin/sed/regress.sh stable/10/tools/regression/usr.bin/yacc/regress.00.out stable/10/tools/regression/usr.bin/yacc/regress.01.out stable/10/tools/regression/usr.bin/yacc/regress.02.out stable/10/tools/regression/usr.bin/yacc/regress.03.out stable/10/tools/regression/usr.bin/yacc/regress.04.out stable/10/tools/regression/usr.bin/yacc/regress.05.out stable/10/tools/regression/usr.bin/yacc/regress.06.out stable/10/tools/regression/usr.bin/yacc/regress.07.out stable/10/tools/regression/usr.bin/yacc/regress.08.out stable/10/tools/regression/usr.bin/yacc/regress.09.out stable/10/tools/regression/usr.bin/yacc/regress.10.out stable/10/tools/regression/usr.bin/yacc/regress.11.out stable/10/tools/regression/usr.bin/yacc/regress.12.out stable/10/tools/regression/usr.bin/yacc/regress.13.out stable/10/tools/regression/usr.bin/yacc/regress.14.out stable/10/tools/regression/usr.bin/yacc/regress.sh stable/10/tools/regression/usr.sbin/etcupdate/always.sh stable/10/tools/regression/usr.sbin/etcupdate/conflicts.sh stable/10/tools/regression/usr.sbin/etcupdate/fbsdid.sh stable/10/tools/regression/usr.sbin/etcupdate/ignore.sh stable/10/tools/regression/usr.sbin/etcupdate/preworld.sh stable/10/tools/regression/usr.sbin/etcupdate/tests.sh stable/10/tools/regression/usr.sbin/etcupdate/tzsetup.sh stable/10/tools/regression/usr.sbin/sa/regress.t stable/10/tools/regression/usr.sbin/sa/v1-amd64-sav.out stable/10/tools/regression/usr.sbin/sa/v1-amd64-u.out stable/10/tools/regression/usr.sbin/sa/v1-amd64-usr.out stable/10/tools/regression/usr.sbin/sa/v1-i386-sav.out stable/10/tools/regression/usr.sbin/sa/v1-i386-u.out stable/10/tools/regression/usr.sbin/sa/v1-i386-usr.out stable/10/tools/regression/usr.sbin/sa/v1-sparc64-sav.out stable/10/tools/regression/usr.sbin/sa/v1-sparc64-u.out stable/10/tools/regression/usr.sbin/sa/v1-sparc64-usr.out stable/10/tools/regression/usr.sbin/sa/v2-amd64-u.out stable/10/tools/regression/usr.sbin/sa/v2-i386-u.out stable/10/tools/regression/usr.sbin/sa/v2-sparc64-u.out Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/bpf_filter.c ============================================================================== --- stable/10/sys/net/bpf_filter.c Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/sys/net/bpf_filter.c Mon Apr 14 13:30:08 2014 (r264457) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include +#if !defined(_KERNEL) +#include +#endif #if !defined(_KERNEL) || defined(sun) #include #endif Modified: stable/10/tools/regression/lib/libc/net/Makefile ============================================================================== --- stable/10/tools/regression/lib/libc/net/Makefile Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/lib/libc/net/Makefile Mon Apr 14 13:30:08 2014 (r264457) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTS= test-ether test-eui64_aton test-eui64_line test-eui64_ntoa +TESTS= test-ether test-eui64_aton test-eui64_ntoa CFLAGS+= -g -Wall .PHONY: tests Modified: stable/10/tools/regression/lib/libc/string/Makefile ============================================================================== --- stable/10/tools/regression/lib/libc/string/Makefile Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/lib/libc/string/Makefile Mon Apr 14 13:30:08 2014 (r264457) @@ -1,9 +1,5 @@ # $FreeBSD$ -CFLAGS+= -I/usr/local/include -LDFLAGS+= -L/usr/local/lib -LDLIBS= -ltap - TESTS= test-stpncpy test-strerror test-wcscasecmp test-wcsnlen .PHONY: tests Modified: stable/10/tools/regression/lib/libc/string/test-strerror.c ============================================================================== --- stable/10/tools/regression/lib/libc/string/test-strerror.c Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/lib/libc/string/test-strerror.c Mon Apr 14 13:30:08 2014 (r264457) @@ -33,7 +33,19 @@ #include #include -#include +static int test_count = 1; +static int exit_status = EXIT_SUCCESS; + +#define CHECK(x) \ + do { \ + if (x) { \ + printf("ok %d\n", test_count); \ + } else { \ + printf("not ok %d # %s\n", test_count, #x); \ + exit_status = EXIT_FAILURE; \ + } \ + ++test_count; \ + } while (0) int main(void) @@ -42,7 +54,7 @@ main(void) char *sret; int iret; - plan_tests(27); + printf("1..27\n"); /* * strerror() failure tests. @@ -50,86 +62,86 @@ main(void) errno = 0; sret = strerror(INT_MAX); snprintf(buf, sizeof(buf), "Unknown error: %d", INT_MAX); - ok1(strcmp(sret, buf) == 0); - ok1(errno == EINVAL); + CHECK(strcmp(sret, buf) == 0); + CHECK(errno == EINVAL); /* * strerror() success tests. */ errno = 0; sret = strerror(0); - ok1(strcmp(sret, "No error: 0") == 0); - ok1(errno == 0); + CHECK(strcmp(sret, "No error: 0") == 0); + CHECK(errno == 0); errno = 0; sret = strerror(EPERM); - ok1(strcmp(sret, "Operation not permitted") == 0); - ok1(errno == 0); + CHECK(strcmp(sret, "Operation not permitted") == 0); + CHECK(errno == 0); errno = 0; sret = strerror(EPFNOSUPPORT); - ok1(strcmp(sret, "Protocol family not supported") == 0); - ok1(errno == 0); + CHECK(strcmp(sret, "Protocol family not supported") == 0); + CHECK(errno == 0); errno = 0; sret = strerror(ELAST); - ok1(errno == 0); + CHECK(errno == 0); /* * strerror_r() failure tests. */ memset(buf, '*', sizeof(buf)); iret = strerror_r(-1, buf, sizeof(buf)); - ok1(strcmp(buf, "Unknown error: -1") == 0); - ok1(iret == EINVAL); + CHECK(strcmp(buf, "Unknown error: -1") == 0); + CHECK(iret == EINVAL); memset(buf, '*', sizeof(buf)); /* One byte too short. */ iret = strerror_r(EPERM, buf, strlen("Operation not permitted")); - ok1(strcmp(buf, "Operation not permitte") == 0); - ok1(iret == ERANGE); + CHECK(strcmp(buf, "Operation not permitte") == 0); + CHECK(iret == ERANGE); memset(buf, '*', sizeof(buf)); /* One byte too short. */ iret = strerror_r(-1, buf, strlen("Unknown error: -1")); - ok1(strcmp(buf, "Unknown error: -") == 0); - ok1(iret == EINVAL); + CHECK(strcmp(buf, "Unknown error: -") == 0); + CHECK(iret == EINVAL); memset(buf, '*', sizeof(buf)); /* Two bytes too short. */ iret = strerror_r(-2, buf, strlen("Unknown error: -2") - 1); - ok1(strcmp(buf, "Unknown error: ") == 0); - ok1(iret == EINVAL); + CHECK(strcmp(buf, "Unknown error: ") == 0); + CHECK(iret == EINVAL); memset(buf, '*', sizeof(buf)); /* Three bytes too short. */ iret = strerror_r(-2, buf, strlen("Unknown error: -2") - 2); - ok1(strcmp(buf, "Unknown error:") == 0); - ok1(iret == EINVAL); + CHECK(strcmp(buf, "Unknown error:") == 0); + CHECK(iret == EINVAL); memset(buf, '*', sizeof(buf)); /* One byte too short. */ iret = strerror_r(12345, buf, strlen("Unknown error: 12345")); - ok1(strcmp(buf, "Unknown error: 1234") == 0); - ok1(iret == EINVAL); + CHECK(strcmp(buf, "Unknown error: 1234") == 0); + CHECK(iret == EINVAL); /* * strerror_r() success tests. */ memset(buf, '*', sizeof(buf)); iret = strerror_r(0, buf, sizeof(buf)); - ok1(strcmp(buf, "No error: 0") == 0); - ok1(iret == 0); + CHECK(strcmp(buf, "No error: 0") == 0); + CHECK(iret == 0); memset(buf, '*', sizeof(buf)); iret = strerror_r(EDEADLK, buf, sizeof(buf)); - ok1(strcmp(buf, "Resource deadlock avoided") == 0); - ok1(iret == 0); + CHECK(strcmp(buf, "Resource deadlock avoided") == 0); + CHECK(iret == 0); memset(buf, '*', sizeof(buf)); iret = strerror_r(EPROCLIM, buf, sizeof(buf)); - ok1(strcmp(buf, "Too many processes") == 0); - ok1(iret == 0); + CHECK(strcmp(buf, "Too many processes") == 0); + CHECK(iret == 0); - return exit_status(); + return exit_status; } Modified: stable/10/tools/regression/priv/main.c ============================================================================== --- stable/10/tools/regression/priv/main.c Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/priv/main.c Mon Apr 14 13:30:08 2014 (r264457) @@ -53,6 +53,16 @@ #include "main.h" /* + * If true, some test or preparatory step failed along the execution of this + * program. + * + * Intuitively, we would define a counter instead of a boolean. However, + * we fork to run the subtests and keeping proper track of the number of + * failed tests would be tricky and not provide any real value. + */ +static int something_failed = 0; + +/* * Registration table of privilege tests. Each test registers a name, a test * function, and a cleanup function to run after the test has completed, * regardless of success/failure. @@ -358,13 +368,18 @@ expect(const char *test, int error, int { if (error == 0) { - if (expected_error != 0) + if (expected_error != 0) { + something_failed = 1; warnx("%s: returned 0", test); + } } else { - if (expected_error == 0) + if (expected_error == 0) { + something_failed = 1; warn("%s: returned (%d, %d)", test, error, errno); - else if (expected_errno != errno) + } else if (expected_errno != errno) { + something_failed = 1; warn("%s: returned (%d, %d)", test, error, errno); + } } } @@ -488,14 +503,24 @@ run(struct test *test, int asroot, int i run_child(test, asroot, injail); fflush(stdout); fflush(stderr); - exit(0); + exit(something_failed ? EXIT_FAILURE : EXIT_SUCCESS); } else { while (1) { - pid = waitpid(childpid, NULL, 0); - if (pid == -1) + int status; + pid = waitpid(childpid, &status, 0); + if (pid == -1) { + something_failed = 1; warn("test: waitpid %s", test->t_name); - if (pid == childpid) + } + if (pid == childpid) { + if (WIFEXITED(status) && + WEXITSTATUS(status) == EXIT_SUCCESS) { + /* All good in the subprocess! */ + } else { + something_failed = 1; + } break; + } } } fflush(stdout); @@ -518,7 +543,7 @@ main(int argc, char *argv[]) * force the use of privilege, and will likely need checking. */ if (getuid() != 0 && geteuid() != 0) - errx(-1, "priv: must be run as root"); + errx(-1, "must be run as root"); /* * Run each test four times, varying whether the process is running @@ -530,5 +555,5 @@ main(int argc, char *argv[]) run(&tests[i], 1, 0); run(&tests[i], 1, 1); } - return (0); + return (something_failed ? EXIT_FAILURE : EXIT_SUCCESS); } Modified: stable/10/tools/regression/sbin/mdconfig/00.t ============================================================================== --- stable/10/tools/regression/sbin/mdconfig/00.t Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/sbin/mdconfig/00.t Mon Apr 14 13:30:08 2014 (r264457) @@ -32,8 +32,8 @@ echo "1..1" if [ `whoami` != "root" ]; then - echo "not ok 1 - you need to be root to run this test." - exit 1 + echo "ok 1 # skip You need to be root to run this test." + exit 0 fi TESTDIR=$(dirname $(realpath $0)) Modified: stable/10/tools/regression/usr.bin/lastcomm/regress.t ============================================================================== --- stable/10/tools/regression/usr.bin/lastcomm/regress.t Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/lastcomm/regress.t Mon Apr 14 13:30:08 2014 (r264457) @@ -6,6 +6,8 @@ DIR=`dirname $0` ARCH=`uname -m` +TZ=UTC; export TZ + check() { NUM=$1 Modified: stable/10/tools/regression/usr.bin/lastcomm/v1-amd64.out ============================================================================== --- stable/10/tools/regression/usr.bin/lastcomm/v1-amd64.out Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/lastcomm/v1-amd64.out Mon Apr 14 13:30:08 2014 (r264457) @@ -1,28 +1,28 @@ -core -FDX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -core -DX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -cc - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 06:44 -ld - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -as - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -cc1 - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.234 es Wed May 16 06:44 -diff - root 0.203 secs 0.203 us 0.000 sy 0.234 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 06:44 -dd - root 0.016 secs 0.000 us 0.016 sy 0.016 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 3.016 es Wed May 16 06:44 -sleep - root 0.000 secs 0.000 us 0.000 sy 3.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 1.938 es Wed May 16 06:44 -find - root 0.250 secs 0.031 us 0.219 sy 1.938 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 3.062 es Wed May 16 06:44 -egrep - root 3.031 secs 3.031 us 0.000 sy 3.062 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.188 es Wed May 16 06:44 -awk - root 0.172 secs 0.172 us 0.000 sy 0.188 es Wed May 16 06:44 -accton - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 +core -FDX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +core -DX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +cc - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 11:44 +ld - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +as - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +cc1 - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.234 es Wed May 16 11:44 +diff - root 0.203 secs 0.203 us 0.000 sy 0.234 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 11:44 +dd - root 0.016 secs 0.000 us 0.016 sy 0.016 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 3.016 es Wed May 16 11:44 +sleep - root 0.000 secs 0.000 us 0.000 sy 3.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 1.938 es Wed May 16 11:44 +find - root 0.250 secs 0.031 us 0.219 sy 1.938 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 3.062 es Wed May 16 11:44 +egrep - root 3.031 secs 3.031 us 0.000 sy 3.062 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.188 es Wed May 16 11:44 +awk - root 0.172 secs 0.172 us 0.000 sy 0.188 es Wed May 16 11:44 +accton - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 Modified: stable/10/tools/regression/usr.bin/lastcomm/v2-amd64.out ============================================================================== --- stable/10/tools/regression/usr.bin/lastcomm/v2-amd64.out Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/lastcomm/v2-amd64.out Mon Apr 14 13:30:08 2014 (r264457) @@ -1,28 +1,28 @@ -core -FDX root 0.002 secs 0.000 us 0.002 sy 0.009 es Thu May 17 00:57 -core -DX root 0.005 secs 0.000 us 0.005 sy 0.010 es Thu May 17 00:57 -cc - root 0.005 secs 0.000 us 0.005 sy 0.652 es Thu May 17 00:57 -ld - root 0.014 secs 0.005 us 0.009 sy 0.150 es Thu May 17 00:57 -as - root 0.005 secs 0.000 us 0.005 sy 0.078 es Thu May 17 00:57 -cc1 - root 0.024 secs 0.008 us 0.016 sy 0.347 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 00:57 -1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 00:57 -1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.013 es Thu May 17 00:57 -123456789012345 - root 0.002 secs 0.000 us 0.002 sy 0.010 es Thu May 17 00:57 -ln - root 0.003 secs 0.000 us 0.003 sy 0.003 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.246 es Thu May 17 00:57 -diff - root 0.223 secs 0.164 us 0.060 sy 0.243 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.079 es Thu May 17 00:57 -dd - root 0.076 secs 0.000 us 0.076 sy 0.076 es Thu May 17 00:57 -time - root 0.004 secs 0.000 us 0.004 sy 3.006 es Thu May 17 00:57 -sleep - root 0.002 secs 0.000 us 0.002 sy 3.002 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 9.945 es Thu May 17 00:57 -find - root 0.822 secs 0.055 us 0.767 sy 9.942 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 3.313 es Thu May 17 00:57 -egrep - root 3.247 secs 3.247 us 0.000 sy 3.310 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.185 es Thu May 17 00:57 -awk - root 0.163 secs 0.156 us 0.007 sy 0.164 es Thu May 17 00:57 -accton - root 0.002 secs 0.000 us 0.002 sy 0.019 es Thu May 17 00:57 +core -FDX root 0.002 secs 0.000 us 0.002 sy 0.009 es Thu May 17 05:57 +core -DX root 0.005 secs 0.000 us 0.005 sy 0.010 es Thu May 17 05:57 +cc - root 0.005 secs 0.000 us 0.005 sy 0.652 es Thu May 17 05:57 +ld - root 0.014 secs 0.005 us 0.009 sy 0.150 es Thu May 17 05:57 +as - root 0.005 secs 0.000 us 0.005 sy 0.078 es Thu May 17 05:57 +cc1 - root 0.024 secs 0.008 us 0.016 sy 0.347 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 05:57 +1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 05:57 +1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.013 es Thu May 17 05:57 +123456789012345 - root 0.002 secs 0.000 us 0.002 sy 0.010 es Thu May 17 05:57 +ln - root 0.003 secs 0.000 us 0.003 sy 0.003 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.246 es Thu May 17 05:57 +diff - root 0.223 secs 0.164 us 0.060 sy 0.243 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.079 es Thu May 17 05:57 +dd - root 0.076 secs 0.000 us 0.076 sy 0.076 es Thu May 17 05:57 +time - root 0.004 secs 0.000 us 0.004 sy 3.006 es Thu May 17 05:57 +sleep - root 0.002 secs 0.000 us 0.002 sy 3.002 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 9.945 es Thu May 17 05:57 +find - root 0.822 secs 0.055 us 0.767 sy 9.942 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 3.313 es Thu May 17 05:57 +egrep - root 3.247 secs 3.247 us 0.000 sy 3.310 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.185 es Thu May 17 05:57 +awk - root 0.163 secs 0.156 us 0.007 sy 0.164 es Thu May 17 05:57 +accton - root 0.002 secs 0.000 us 0.002 sy 0.019 es Thu May 17 05:57 Modified: stable/10/tools/regression/usr.bin/m4/regress.gnusofterror.out ============================================================================== --- stable/10/tools/regression/usr.bin/m4/regress.gnusofterror.out Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/m4/regress.gnusofterror.out Mon Apr 14 13:30:08 2014 (r264457) @@ -1 +1,2 @@ +m4: gnusofterror.m4 at line 3: include(hey I do not exit): No such file or directory abc Modified: stable/10/tools/regression/usr.bin/m4/regress.sh ============================================================================== --- stable/10/tools/regression/usr.bin/m4/regress.sh Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/m4/regress.sh Mon Apr 14 13:30:08 2014 (r264457) @@ -2,7 +2,7 @@ LC_ALL=C; export LC_ALL -echo 1..22 +echo 1..21 REGRESSION_START($1) @@ -17,7 +17,7 @@ REGRESSION_TEST(`gnuformat', `m4 -g gnuf REGRESSION_TEST(`gnupatterns', `m4 -g gnupatterns.m4') REGRESSION_TEST(`gnupatterns2', `m4 -g gnupatterns2.m4') REGRESSION_TEST(`gnuprefix', `m4 -P gnuprefix.m4 2>&1') -REGRESSION_TEST(`gnusofterror', `m4 -g gnusofterror.m4') +REGRESSION_TEST(`gnusofterror', `m4 -g gnusofterror.m4 2>&1') REGRESSION_TEST(`gnutranslit2', `m4 -g translit2.m4') REGRESSION_TEST(`includes', `m4 -I. includes.m4') REGRESSION_TEST(`m4wrap3', `m4 m4wrap3.m4') Modified: stable/10/tools/regression/usr.bin/m4/regress.t ============================================================================== --- stable/10/tools/regression/usr.bin/m4/regress.t Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/m4/regress.t Mon Apr 14 13:30:08 2014 (r264457) @@ -3,4 +3,4 @@ cd `dirname $0` -sh regress.sh +m4 ../regress.m4 regress.sh | sh Modified: stable/10/tools/regression/usr.bin/make/common.sh ============================================================================== --- stable/10/tools/regression/usr.bin/make/common.sh Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/make/common.sh Mon Apr 14 13:30:08 2014 (r264457) @@ -13,6 +13,13 @@ fatal() exit 1 } +make_is_fmake() { + # This test is not very reliable but works for now: the old fmake + # does have a -v option while bmake doesn't. + ${MAKE_PROG} -f Makefile.non-existent -v 2>&1 | \ + grep -q "cannot open.*non-existent" +} + # # Check whether the working directory exists - it must. # @@ -322,19 +329,25 @@ eval_compare() while [ ${N} -le ${TEST_N} ] ; do fail= todo= + skip= if ! skip_test ${N} ; then do_compare stdout ${N} || fail="${fail}stdout " do_compare stderr ${N} || fail="${fail}stderr " do_compare status ${N} || fail="${fail}status " eval todo=\${TEST_${N}_TODO} + else + eval skip=\${TEST_${N}_SKIP} fi if [ ! -z "$fail" ]; then echo -n "not " fi echo -n "ok ${N} ${SUBDIR}/${N}" - if [ ! -z "$fail" -o ! -z "$todo" ]; then + if [ ! -z "$fail" -o ! -z "$todo" -o ! -z "$skip" ]; then echo -n " # " fi + if [ ! -z "$skip" ] ; then + echo -n "skip $skip; " + fi if [ ! -z "$todo" ] ; then echo -n "TODO $todo; " fi @@ -473,6 +486,12 @@ eval_cmd() set -- prove fi + if ! make_is_fmake ; then + for i in $(jot ${TEST_N:-1}) ; do + eval TEST_${i}_SKIP=\"make is not fmake\" + done + fi + for i do case $i in Modified: stable/10/tools/regression/usr.bin/ncal/regress.sh ============================================================================== --- stable/10/tools/regression/usr.bin/ncal/regress.sh Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/ncal/regress.sh Mon Apr 14 13:30:08 2014 (r264457) @@ -6,6 +6,8 @@ NCAL="${CAL_BIN} -N" YEARS="2008 2009 2010 2011" ONEYEAR="2009" +echo 1..89 + REGRESSION_START($1) # @@ -15,8 +17,6 @@ REGRESSION_START($1) # Full year calendars -echo 1..16 - for y in ${YEARS}; do # Regular calendar, Month days, No-highlight REGRESSION_TEST(`r-y${y}-md-nhl', `$NCAL -h ${y}') @@ -30,8 +30,6 @@ done # 3 month calendars -echo 17 .. 29 - for m in $(jot -w %02d 12); do # Regular calendar, Month days, No-highlight REGRESSION_TEST(`r-3m${ONEYEAR}${m}-md-nhl', Modified: stable/10/tools/regression/usr.bin/pkill/pgrep-_s.t ============================================================================== --- stable/10/tools/regression/usr.bin/pkill/pgrep-_s.t Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/pkill/pgrep-_s.t Mon Apr 14 13:30:08 2014 (r264457) @@ -5,15 +5,17 @@ base=`basename $0` echo "1..2" +exp_pid="$(ps ax | grep '\[idle\]' | awk '{print $1}')" + name="pgrep -S" -pid=`pgrep -Sx g_event` -if [ "$pid" = "2" ]; then +pid=`pgrep -Sx idle` +if [ "$pid" = "$exp_pid" ]; then echo "ok 1 - $name" else echo "not ok 1 - $name" fi -pid=`pgrep -x g_event` -if [ "$pid" != "2" ]; then +pid=`pgrep -x idle` +if [ "$pid" != "$exp_pid" ]; then echo "ok 2 - $name" else echo "not ok 2 - $name" Modified: stable/10/tools/regression/usr.bin/printf/regress.sh ============================================================================== --- stable/10/tools/regression/usr.bin/printf/regress.sh Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/printf/regress.sh Mon Apr 14 13:30:08 2014 (r264457) @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..12' +echo '1..15' REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"') REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123') Modified: stable/10/tools/regression/usr.bin/sed/regress.sh ============================================================================== --- stable/10/tools/regression/usr.bin/sed/regress.sh Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/sed/regress.sh Mon Apr 14 13:30:08 2014 (r264457) @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..25' +echo '1..26' REGRESSION_TEST(`G', `sed G < regress.in') REGRESSION_TEST(`P', `sed P < regress.in') Modified: stable/10/tools/regression/usr.bin/yacc/regress.00.out ============================================================================== --- stable/10/tools/regression/usr.bin/yacc/regress.00.out Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/yacc/regress.00.out Mon Apr 14 13:30:08 2014 (r264457) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -77,10 +78,11 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 0 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { -"end-of-file", +"end-of-file","illegal-symbol", }; static const char *yyrule[] = { "$accept : rule", @@ -105,12 +107,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -145,7 +147,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -219,9 +221,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -303,9 +303,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -348,9 +346,7 @@ yyreduce: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: stable/10/tools/regression/usr.bin/yacc/regress.01.out ============================================================================== --- stable/10/tools/regression/usr.bin/yacc/regress.01.out Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/yacc/regress.01.out Mon Apr 14 13:30:08 2014 (r264457) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -25,7 +26,7 @@ int base; extern int yylex(void); static void yyerror(const char *s); -#line 28 "/dev/stdout" +#line 29 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -152,6 +153,7 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 259 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -162,7 +164,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS", +0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -204,12 +206,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -263,7 +265,7 @@ yylex(void) } return( c ); } -#line 266 "/dev/stdout" +#line 267 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -287,7 +289,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -361,9 +363,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -445,9 +445,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -529,7 +527,7 @@ case 18: #line 63 "calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 532 "/dev/stdout" +#line 529 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -551,9 +549,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: stable/10/tools/regression/usr.bin/yacc/regress.02.out ============================================================================== --- stable/10/tools/regression/usr.bin/yacc/regress.02.out Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/yacc/regress.02.out Mon Apr 14 13:30:08 2014 (r264457) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -55,7 +56,7 @@ typedef union INTERVAL vval; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ -#line 58 "/dev/stdout" +#line 59 "/dev/stdout" /* compatibility with bison */ #ifdef YYPARSE_PARAM @@ -192,6 +193,7 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 260 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -202,7 +204,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,"DREG","VREG","CONST","UMINUS", +0,0,"DREG","VREG","CONST","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : line", @@ -254,12 +256,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -402,7 +404,7 @@ vdiv(double a, double b, INTERVAL v) { return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); } -#line 405 "/dev/stdout" +#line 406 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -426,7 +428,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -500,9 +502,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -584,9 +584,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -771,7 +769,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 774 "/dev/stdout" +#line 771 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -793,9 +791,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: stable/10/tools/regression/usr.bin/yacc/regress.03.out ============================================================================== --- stable/10/tools/regression/usr.bin/yacc/regress.03.out Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/yacc/regress.03.out Mon Apr 14 13:30:08 2014 (r264457) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -28,7 +29,7 @@ int YYLEX_DECL(); static void YYERROR_DECL(); #endif -#line 31 "/dev/stdout" +#line 32 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -159,6 +160,7 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 259 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -169,7 +171,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS", +0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -206,12 +208,12 @@ int yynerrs; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -270,7 +272,7 @@ YYLEX_DECL() } return( c ); } -#line 273 "/dev/stdout" +#line 274 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -294,7 +296,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -375,9 +377,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -459,9 +459,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -543,7 +541,7 @@ case 18: #line 73 "calc3.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 546 "/dev/stdout" +#line 543 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -565,9 +563,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: stable/10/tools/regression/usr.bin/yacc/regress.04.out ============================================================================== --- stable/10/tools/regression/usr.bin/yacc/regress.04.out Mon Apr 14 12:49:18 2014 (r264456) +++ stable/10/tools/regression/usr.bin/yacc/regress.04.out Mon Apr 14 13:30:08 2014 (r264457) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 17:54:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 073FE5C1; Mon, 14 Apr 2014 17:54: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 DB21016AC; Mon, 14 Apr 2014 17:54: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 s3EHs2gS058170; Mon, 14 Apr 2014 17:54:02 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EHs2Vv058168; Mon, 14 Apr 2014 17:54:02 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201404141754.s3EHs2Vv058168@svn.freebsd.org> From: Dimitry Andric Date: Mon, 14 Apr 2014 17:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264464 - in stable: 10 10/contrib/llvm/tools/clang/lib/Driver 9 9/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 17:54:03 -0000 Author: dim Date: Mon Apr 14 17:54:01 2014 New Revision: 264464 URL: http://svnweb.freebsd.org/changeset/base/264464 Log: MFC r264345: Amend r263891, by making clang default to DWARF2 debug info format for all FreeBSD versions, not just 10.x and earlier. Apparently too many people seem to have trouble with post-1993 formats. Also remove the related notes about messing with kernel configuration files from UPDATING, which are now superfluous. Requested by: many Modified: stable/10/UPDATING stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/UPDATING (contents, props changed) stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Mon Apr 14 16:55:09 2014 (r264463) +++ stable/10/UPDATING Mon Apr 14 17:54:01 2014 (r264464) @@ -16,18 +16,8 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. - 20140321: - Clang and llvm have been upgraded to 3.4 release. Please note that - clang 3.4 now defaults to DWARF4 debug information format when you - specify -g. Since kgdb(1) only supports DWARF2, you should update any - customized kernel configurations which include debug information to - explicitly use -gdwarf-2, e.g: - - makeoptions DEBUG=-gdwarf-2 - - This has already been applied to the appropriate GENERIC configuration - files, so if you inherit from those, no changes are required. + Clang and llvm have been upgraded to 3.4 release. 20140306: If a Makefile in a tests/ directory was auto-generating a Kyuafile Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Mon Apr 14 16:55:09 2014 (r264463) +++ stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Mon Apr 14 17:54:01 2014 (r264464) @@ -2628,10 +2628,9 @@ void Clang::ConstructJob(Compilation &C, CmdArgs.push_back("-gdwarf-4"); else if (!A->getOption().matches(options::OPT_g0) && !A->getOption().matches(options::OPT_ggdb0)) { - // Default is dwarf-2 for darwin and FreeBSD <= 10. + // Default is dwarf-2 for darwin and FreeBSD. const llvm::Triple &Triple = getToolChain().getTriple(); - if (Triple.isOSDarwin() || (Triple.getOS() == llvm::Triple::FreeBSD && - Triple.getOSMajorVersion() <= 10)) + if (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::FreeBSD) CmdArgs.push_back("-gdwarf-2"); else CmdArgs.push_back("-g"); From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 21:04:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5C60E59A; Mon, 14 Apr 2014 21:04: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 3C8A21BD2; Mon, 14 Apr 2014 21:04: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 s3EL4xHD038202; Mon, 14 Apr 2014 21:04:59 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EL4wb3038200; Mon, 14 Apr 2014 21:04:58 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404142104.s3EL4wb3038200@svn.freebsd.org> From: Devin Teske Date: Mon, 14 Apr 2014 21:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264472 - stable/10/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 21:04:59 -0000 Author: dteske Date: Mon Apr 14 21:04:58 2014 New Revision: 264472 URL: http://svnweb.freebsd.org/changeset/base/264472 Log: MFC r260866,260900,261960 (3 revisions; summarized below): 260866: Fix a bad comparison operator and fix dumpdev comment 260900: Dummy commit; show r260866 was in-part by Christoph Mallon 261960: Add zfsboot to bsdinstall(8) scripted interface Modified: stable/10/usr.sbin/bsdinstall/scripts/script stable/10/usr.sbin/bsdinstall/scripts/services Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/script ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/script Mon Apr 14 21:02:20 2014 (r264471) +++ stable/10/usr.sbin/bsdinstall/scripts/script Mon Apr 14 21:04:58 2014 (r264472) @@ -95,7 +95,11 @@ fi # Make partitions rm -f $PATH_FSTAB touch $PATH_FSTAB -bsdinstall scriptedpart "$PARTITIONS" +if [ "$ZFSBOOT_DISKS" ]; then + bsdinstall zfsboot +else + bsdinstall scriptedpart "$PARTITIONS" +fi bsdinstall mount # Unpack distributions Modified: stable/10/usr.sbin/bsdinstall/scripts/services ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/services Mon Apr 14 21:02:20 2014 (r264471) +++ stable/10/usr.sbin/bsdinstall/scripts/services Mon Apr 14 21:04:58 2014 (r264472) @@ -29,7 +29,8 @@ : ${DIALOG_OK=0} if [ -f $BSDINSTALL_TMPETC/rc.conf.services ]; then - eval `sed -e s/YES/on/i -e s/NO/off/i $BSDINSTALL_TMPETC/rc.conf.services` + eval $( sed -e s/YES/on/i -e s/NO/off/i \ + $BSDINSTALL_TMPETC/rc.conf.services ) else # Default service states. Everything is off if not enabled. sshd_enable="on" @@ -38,30 +39,29 @@ fi echo -n > $BSDINSTALL_TMPETC/rc.conf.services exec 3>&1 -DAEMONS=$(dialog --backtitle "FreeBSD Installer" \ +DAEMONS=$( dialog --backtitle "FreeBSD Installer" \ --title "System Configuration" --nocancel --separate-output \ --checklist "Choose the services you would like to be started at boot:" \ 0 0 0 \ sshd "Secure shell daemon" ${sshd_enable:-off} \ moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ - powerd "Adjust CPU frequency dynamically if supported" ${powerd_enable:-off} \ + powerd "Adjust CPU frequency dynamically if supported" \ + ${powerd_enable:-off} \ dumpdev "Enable kernel crash dumps to /var/crash" ${dumpdev:-on} \ -2>&1 1>&3) +2>&1 1>&3 ) exec 3>&- havedump= for daemon in $DAEMONS; do - if [ "$daemon" == "dumpdev" ]; then - havedump=1 - echo '# Set dumpdev to "AUTO" to enable crash dumps, "NO"' \ - 'to disable' >> $BSDINSTALL_TMPETC/rc.conf.services - echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services - continue - fi + [ "$daemon" = "dumpdev" ] && havedump=1 continue echo ${daemon}_enable=\"YES\" >> $BSDINSTALL_TMPETC/rc.conf.services done -if [ ! "$havedump" ]; then +echo '# Set dumpdev to "AUTO" to enable crash dumps, "NO"' \ + 'to disable' >> $BSDINSTALL_TMPETC/rc.conf.services +if [ "$havedump" ]; then + echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services +else echo dumpdev=\"NO\" >> $BSDINSTALL_TMPETC/rc.conf.services fi From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 21:07:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BB321704; Mon, 14 Apr 2014 21:07: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 A6EC91BFE; Mon, 14 Apr 2014 21:07: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 s3EL7aEr038565; Mon, 14 Apr 2014 21:07:36 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EL7aSm038564; Mon, 14 Apr 2014 21:07:36 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404142107.s3EL7aSm038564@svn.freebsd.org> From: Christian Brueffer Date: Mon, 14 Apr 2014 21:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264473 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 21:07:36 -0000 Author: brueffer Date: Mon Apr 14 21:07:36 2014 New Revision: 264473 URL: http://svnweb.freebsd.org/changeset/base/264473 Log: MFC: r264349 mdoc and spelling cleanup. Modified: stable/10/share/man/man4/wsp.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/wsp.4 ============================================================================== --- stable/10/share/man/man4/wsp.4 Mon Apr 14 21:04:58 2014 (r264472) +++ stable/10/share/man/man4/wsp.4 Mon Apr 14 21:07:36 2014 (r264473) @@ -41,7 +41,7 @@ your kernel configuration file: .Cd "device usb" .Ed .Pp -Alternativly, to load the driver as a module at boot time, +Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent @@ -53,31 +53,28 @@ The driver provides support for the Apple Internal Trackpad device found in many Apple laptops. .Pp -The driver simulates a three\-button mouse using multi\-finger tap +The driver simulates a three-button mouse using multi-finger tap detection. -. -A single\-finger press generates a left button click. -A two\-finger tap maps to the right button; whereas a three\-finger tap +A single-finger press generates a left button click. +A two-finger tap maps to the right button; whereas a three-finger tap gets treated as a middle button click. -. .Pp .Nm supports dynamic reconfiguration using -.Xr sysctl 8 ; +.Xr sysctl 8 through nodes under .Nm hw.usb.wsp . Pointer sensitivity can be controlled using the sysctl tunable .Nm hw.usb.wsp.scale_factor . -. .Sh FILES .Nm -creates a blocking pseudo\-device file, +creates a blocking pseudo-device file, .Pa /dev/wsp0 , which presents the mouse as a -.Ar sysmouse +.Em sysmouse or -.Ar mousesystems -type device\-\-see +.Em mousesystems +type device--see .Xr moused 8 for an explanation of these mouse types. From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 21:12:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 763F5D54; Mon, 14 Apr 2014 21:12: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 629351CBB; Mon, 14 Apr 2014 21:12: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 s3ELCdhG042405; Mon, 14 Apr 2014 21:12:39 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ELCdnj042404; Mon, 14 Apr 2014 21:12:39 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404142112.s3ELCdnj042404@svn.freebsd.org> From: Christian Brueffer Date: Mon, 14 Apr 2014 21:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264477 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 21:12:39 -0000 Author: brueffer Date: Mon Apr 14 21:12:38 2014 New Revision: 264477 URL: http://svnweb.freebsd.org/changeset/base/264477 Log: MFC: r264362 Remove stray .Nm macro. Modified: stable/10/share/man/man4/terasic_mtl.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/terasic_mtl.4 ============================================================================== --- stable/10/share/man/man4/terasic_mtl.4 Mon Apr 14 21:10:10 2014 (r264476) +++ stable/10/share/man/man4/terasic_mtl.4 Mon Apr 14 21:12:38 2014 (r264477) @@ -109,7 +109,6 @@ as part of the DARPA CRASH research prog This device driver was written by .An Robert N. M. Watson . .Sh BUGS -.Nm The .Xr syscons 4 attachment does not support the hardware cursor feature. From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 21:26:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 680729E; Mon, 14 Apr 2014 21:26: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 53F781DC0; Mon, 14 Apr 2014 21:26: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 s3ELQaM4046947; Mon, 14 Apr 2014 21:26:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ELQZh7046940; Mon, 14 Apr 2014 21:26:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404142126.s3ELQZh7046940@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 14 Apr 2014 21:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264478 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 21:26:36 -0000 Author: jilles Date: Mon Apr 14 21:26:34 2014 New Revision: 264478 URL: http://svnweb.freebsd.org/changeset/base/264478 Log: MFC r263777: sh: Fix possible memory leaks and double frees with unexpected SIGINT. Modified: stable/10/bin/sh/alias.c stable/10/bin/sh/exec.c stable/10/bin/sh/expand.c stable/10/bin/sh/redir.c stable/10/bin/sh/var.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/alias.c ============================================================================== --- stable/10/bin/sh/alias.c Mon Apr 14 21:12:38 2014 (r264477) +++ stable/10/bin/sh/alias.c Mon Apr 14 21:26:34 2014 (r264478) @@ -180,6 +180,7 @@ printaliases(void) int i, j; struct alias **sorted, *ap; + INTOFF; sorted = ckmalloc(aliases * sizeof(*sorted)); j = 0; for (i = 0; i < ATABSIZE; i++) @@ -187,9 +188,13 @@ printaliases(void) if (*ap->name != '\0') sorted[j++] = ap; qsort(sorted, aliases, sizeof(*sorted), comparealiases); - for (i = 0; i < aliases; i++) + for (i = 0; i < aliases; i++) { printalias(sorted[i]); + if (int_pending()) + break; + } ckfree(sorted); + INTON; } int Modified: stable/10/bin/sh/exec.c ============================================================================== --- stable/10/bin/sh/exec.c Mon Apr 14 21:12:38 2014 (r264477) +++ stable/10/bin/sh/exec.c Mon Apr 14 21:26:34 2014 (r264478) @@ -612,6 +612,7 @@ defun(const char *name, union node *func /* * Delete a function if it exists. + * Called with interrupts off. */ int Modified: stable/10/bin/sh/expand.c ============================================================================== --- stable/10/bin/sh/expand.c Mon Apr 14 21:12:38 2014 (r264477) +++ stable/10/bin/sh/expand.c Mon Apr 14 21:26:34 2014 (r264478) @@ -956,6 +956,7 @@ recordregion(int start, int end, int inq { struct ifsregion *ifsp; + INTOFF; if (ifslastp == NULL) { ifsp = &ifsfirst; } else { @@ -963,6 +964,7 @@ recordregion(int start, int end, int inq && ifslastp->inquotes == inquotes) { /* extend previous area */ ifslastp->endoff = end; + INTON; return; } ifsp = (struct ifsregion *)ckmalloc(sizeof (struct ifsregion)); @@ -973,6 +975,7 @@ recordregion(int start, int end, int inq ifslastp->begoff = start; ifslastp->endoff = end; ifslastp->inquotes = inquotes; + INTON; } Modified: stable/10/bin/sh/redir.c ============================================================================== --- stable/10/bin/sh/redir.c Mon Apr 14 21:12:38 2014 (r264477) +++ stable/10/bin/sh/redir.c Mon Apr 14 21:26:34 2014 (r264478) @@ -92,6 +92,13 @@ static int openhere(union node *); * undone by calling popredir. If the REDIR_BACKQ flag is set, then the * standard output, and the standard error if it becomes a duplicate of * stdout, is saved in memory. +* + * We suppress interrupts so that we won't leave open file + * descriptors around. Because the signal handler remains + * installed and we do not use system call restart, interrupts + * will still abort blocking opens such as fifos (they will fail + * with EINTR). There is, however, a race condition if an interrupt + * arrives after INTOFF and before open blocks. */ void @@ -103,6 +110,7 @@ redirect(union node *redir, int flags) int fd; char memory[10]; /* file descriptors to write to memory */ + INTOFF; for (i = 10 ; --i >= 0 ; ) memory[i] = 0; memory[1] = flags & REDIR_BACKQ; @@ -139,11 +147,14 @@ redirect(union node *redir, int flags) INTON; } openredirect(n, memory); + INTON; + INTOFF; } if (memory[1]) out1 = &memout; if (memory[2]) out2 = &memout; + INTON; } @@ -156,15 +167,6 @@ openredirect(union node *redir, char mem int f; int e; - /* - * We suppress interrupts so that we won't leave open file - * descriptors around. Because the signal handler remains - * installed and we do not use system call restart, interrupts - * will still abort blocking opens such as fifos (they will fail - * with EINTR). There is, however, a race condition if an interrupt - * arrives after INTOFF and before open blocks. - */ - INTOFF; memory[fd] = 0; switch (redir->nfile.type) { case NFROM: @@ -237,7 +239,6 @@ movefd: default: abort(); } - INTON; } Modified: stable/10/bin/sh/var.c ============================================================================== --- stable/10/bin/sh/var.c Mon Apr 14 21:12:38 2014 (r264477) +++ stable/10/bin/sh/var.c Mon Apr 14 21:26:34 2014 (r264478) @@ -249,6 +249,7 @@ setvar(const char *name, const char *val vallen = strlen(val); len += vallen; } + INTOFF; nameeq = ckmalloc(len); memcpy(nameeq, name, namelen); nameeq[namelen] = '='; @@ -257,6 +258,7 @@ setvar(const char *name, const char *val else nameeq[namelen + 1] = '\0'; setvareq(nameeq, flags); + INTON; } static int @@ -289,6 +291,7 @@ change_env(const char *s, int set) char *eqp; char *ss; + INTOFF; ss = savestr(s); if ((eqp = strchr(ss, '=')) != NULL) *eqp = '\0'; @@ -297,6 +300,7 @@ change_env(const char *s, int set) else (void) unsetenv(ss); ckfree(ss); + INTON; return; } @@ -359,13 +363,13 @@ setvareq(char *s, int flags) /* not found */ if (flags & VNOSET) return; + INTOFF; vp = ckmalloc(sizeof (*vp)); vp->flags = flags; vp->text = s; vp->name_len = nlen; vp->next = *vpp; vp->func = NULL; - INTOFF; *vpp = vp; if ((vp->flags & VEXPORT) && localevar(s)) { change_env(s, 1); @@ -773,6 +777,7 @@ poplocalvars(void) struct localvar *lvp; struct var *vp; + INTOFF; while ((lvp = localvars) != NULL) { localvars = lvp->next; vp = lvp->vp; @@ -790,6 +795,7 @@ poplocalvars(void) } ckfree(lvp); } + INTON; } @@ -828,18 +834,21 @@ unsetcmd(int argc __unused, char **argv if (flg_func == 0 && flg_var == 0) flg_var = 1; + INTOFF; for (ap = argptr; *ap ; ap++) { if (flg_func) ret |= unsetfunc(*ap); if (flg_var) ret |= unsetvar(*ap); } + INTON; return ret; } /* * Unset the specified variable. + * Called with interrupts off. */ int @@ -853,7 +862,6 @@ unsetvar(const char *s) return (0); if (vp->flags & VREADONLY) return (1); - INTOFF; if (vp->text[vp->name_len + 1] != '\0') setvar(s, nullstr, 0); if ((vp->flags & VEXPORT) && localevar(vp->text)) { @@ -869,7 +877,6 @@ unsetvar(const char *s) *vpp = vp->next; ckfree(vp); } - INTON; return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 14 23:52:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 641E3E1A; Mon, 14 Apr 2014 23:52: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 4D09B1BEF; Mon, 14 Apr 2014 23:52: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 s3ENq2q8007903; Mon, 14 Apr 2014 23:52:02 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ENpvm4007855; Mon, 14 Apr 2014 23:51:57 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404142351.s3ENpvm4007855@svn.freebsd.org> From: Julio Merino Date: Mon, 14 Apr 2014 23:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264483 - in stable/10: bin/date/tests bin/mv/tests bin/pax/tests bin/sh/tests bin/test/tests lib/atf/libatf-c++/tests lib/atf/libatf-c++/tests/detail lib/atf/libatf-c/tests lib/atf/lib... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 23:52:02 -0000 Author: jmmv Date: Mon Apr 14 23:51:57 2014 New Revision: 264483 URL: http://svnweb.freebsd.org/changeset/base/264483 Log: MFC refactoring of the *.test.mk files. - r263161 Make bsd.test.mk the only public mk fragment for the building of tests. - r263172 Move FreeBSD Test Suite-specific code to a suite.test.mk file. - r263204 Add some documentation for bsd.test.mk. - r263217 Document support for TAP-compliant Perl test programs. This is "make tinderbox" clean. Added: stable/10/share/mk/suite.test.mk - copied unchanged from r263172, head/share/mk/suite.test.mk Modified: stable/10/bin/date/tests/Makefile stable/10/bin/mv/tests/Makefile stable/10/bin/pax/tests/Makefile stable/10/bin/sh/tests/Makefile stable/10/bin/test/tests/Makefile stable/10/lib/atf/libatf-c++/tests/Makefile stable/10/lib/atf/libatf-c++/tests/detail/Makefile stable/10/lib/atf/libatf-c/tests/Makefile stable/10/lib/atf/libatf-c/tests/detail/Makefile stable/10/lib/atf/tests/test-programs/Makefile stable/10/lib/libcrypt/tests/Makefile stable/10/libexec/atf/atf-check/tests/Makefile stable/10/share/examples/tests/tests/atf/Makefile stable/10/share/examples/tests/tests/plain/Makefile stable/10/share/mk/Makefile stable/10/share/mk/atf.test.mk stable/10/share/mk/bsd.README stable/10/share/mk/bsd.test.mk stable/10/share/mk/plain.test.mk stable/10/share/mk/tap.test.mk stable/10/tests/sys/kern/Makefile stable/10/usr.bin/atf/atf-sh/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/date/tests/Makefile ============================================================================== --- stable/10/bin/date/tests/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/bin/date/tests/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -6,4 +6,4 @@ TESTSDIR= ${TESTSBASE}/bin/date TAP_TESTS_SH= legacy_test -.include +.include Modified: stable/10/bin/mv/tests/Makefile ============================================================================== --- stable/10/bin/mv/tests/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/bin/mv/tests/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -6,4 +6,4 @@ TESTSDIR= ${TESTSBASE}/bin/mv TAP_TESTS_SH= legacy_test -.include +.include Modified: stable/10/bin/pax/tests/Makefile ============================================================================== --- stable/10/bin/pax/tests/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/bin/pax/tests/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -6,4 +6,4 @@ TESTSDIR= ${TESTSBASE}/bin/pax TAP_TESTS_PERL= legacy_test -.include +.include Modified: stable/10/bin/sh/tests/Makefile ============================================================================== --- stable/10/bin/sh/tests/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/bin/sh/tests/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -15,4 +15,4 @@ TEST_METADATA.legacy_test+= required_use SUBDIR+= builtins errors execution expansion parameters parser set-e -.include +.include Modified: stable/10/bin/test/tests/Makefile ============================================================================== --- stable/10/bin/test/tests/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/bin/test/tests/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -12,4 +12,4 @@ TAP_TESTS_SH= legacy_test # requested. See https://code.google.com/p/kyua/issues/detail?id=6 TEST_METADATA.legacy_test+= required_user="unprivileged" -.include +.include Modified: stable/10/lib/atf/libatf-c++/tests/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c++/tests/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/lib/atf/libatf-c++/tests/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -28,4 +28,4 @@ SRCS.${_T}= ${_T}.cpp test_helpers.cpp ATF_TESTS_SH= pkg_config_test -.include +.include Modified: stable/10/lib/atf/libatf-c++/tests/detail/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c++/tests/detail/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/lib/atf/libatf-c++/tests/detail/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -29,4 +29,4 @@ BINDIR.${p}= ${TESTSDIR} version_helper.o: atf-version .include "../../../common.mk" -.include +.include Modified: stable/10/lib/atf/libatf-c/tests/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c/tests/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/lib/atf/libatf-c/tests/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -35,4 +35,4 @@ SRCS.${_T}= ${_T}.c test_helpers.c ATF_TESTS_SH= pkg_config_test -.include +.include Modified: stable/10/lib/atf/libatf-c/tests/detail/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c/tests/detail/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/lib/atf/libatf-c/tests/detail/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -31,4 +31,4 @@ BINDIR.${p}= ${TESTSDIR} version_helper.o: atf-version .include "../../../common.mk" -.include +.include Modified: stable/10/lib/atf/tests/test-programs/Makefile ============================================================================== --- stable/10/lib/atf/tests/test-programs/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/lib/atf/tests/test-programs/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -21,4 +21,4 @@ ATF_TESTS_SH+= ${_T} ATF_TESTS_SH_SRC_${_T}= common.sh ${_T}.sh .endfor -.include +.include Modified: stable/10/lib/libcrypt/tests/Makefile ============================================================================== --- stable/10/lib/libcrypt/tests/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/lib/libcrypt/tests/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -9,4 +9,4 @@ ATF_TESTS_C= crypt_tests CFLAGS+= -I${.CURDIR:H} LDADD+= -L${.OBJDIR:H} -lcrypt -.include +.include Modified: stable/10/libexec/atf/atf-check/tests/Makefile ============================================================================== --- stable/10/libexec/atf/atf-check/tests/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/libexec/atf/atf-check/tests/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -9,4 +9,4 @@ ATF= ${.CURDIR:H:H:H:H}/contrib/atf ATF_TESTS_SH= atf-check_test -.include +.include Modified: stable/10/share/examples/tests/tests/atf/Makefile ============================================================================== --- stable/10/share/examples/tests/tests/atf/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/share/examples/tests/tests/atf/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -27,4 +27,4 @@ ATF_TESTS_SH= cp_test # definitions from above. KYUAFILE= yes -.include +.include Modified: stable/10/share/examples/tests/tests/plain/Makefile ============================================================================== --- stable/10/share/examples/tests/tests/plain/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/share/examples/tests/tests/plain/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -27,4 +27,4 @@ PLAIN_TESTS_SH= cp_test # definitions from above. KYUAFILE= yes -.include +.include Modified: stable/10/share/mk/Makefile ============================================================================== --- stable/10/share/mk/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/share/mk/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -46,6 +46,7 @@ FILESDIR= ${BINDIR}/mk .if ${MK_TESTS} != "no" FILES+= atf.test.mk FILES+= plain.test.mk +FILES+= suite.test.mk FILES+= tap.test.mk .endif Modified: stable/10/share/mk/atf.test.mk ============================================================================== --- stable/10/share/mk/atf.test.mk Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/share/mk/atf.test.mk Mon Apr 14 23:51:57 2014 (r264483) @@ -1,9 +1,13 @@ # $FreeBSD$ # +# You must include bsd.test.mk instead of this file from your Makefile. +# # Logic to build and install ATF test programs; i.e. test programs linked # against the ATF libraries. -.include +.if !target(____) +.error atf.test.mk cannot be included directly. +.endif # List of C, C++ and shell test programs to build. # @@ -164,5 +168,3 @@ realtest: .PHONY .endif .endif - -.include Modified: stable/10/share/mk/bsd.README ============================================================================== --- stable/10/share/mk/bsd.README Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/share/mk/bsd.README Mon Apr 14 23:51:57 2014 (r264483) @@ -39,6 +39,7 @@ bsd.prog.mk - building programs from so bsd.snmpmod.mk - building modules for the SNMP daemon bsnmpd bsd.subdir.mk - targets for building subdirectories bsd.sys.mk - common settings used for building FreeBSD sources +bsd.test.mk - building test programs from source files sys.mk - default rules for all makes This file does not document bsd.port*.mk. They are documented in ports(7). @@ -365,3 +366,97 @@ It has rules for building profiled objec built by default. Libraries are ranlib'd before installation. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +The include file handles building one or more test programs +intended to be used in the FreeBSD Test Suite under /usr/tests/. + +It has seven targets: + + all: + build the test programs. + clean: + remove the test programs and any object files. + cleandir: + remove all of the files removed by the target clean, as + well as .depend and tags. + depend: + make the dependencies for the source files, and store + them in the file .depend. + install: + install the test programs and their data files; if the + Makefile does not itself define the target install, the + targets beforeinstall and afterinstall may also be used + to cause actions immediately before and after the + install target is executed. + lint: + run lint on the source files. + tags: + create a tags file for the source files. + test: + runs the test programs from the object directory; if the + Makefile does not itself define the target test, the + targets beforetest and aftertest may also be used to + cause actions immediately before and after the test + target is executed. + +It sets/uses the following variables, among many others: + +TESTDIR Path to the installed tests. Must be a subdirectory of + TESTSBASE and the subpath should match the relative + location of the tests within the src tree. + +KYUAFILE If 'auto' (the default), generate a Kyuafile out of the + test programs defined in the Makefile. If 'yes', then a + manually-crafted Kyuafile must be supplied with the + sources. If 'no', no Kyuafile is installed (useful for + subdirectories providing helper programs or data files + only). + +ATF_TESTS_C The names of the ATF C test programs to build. + +ATF_TESTS_CXX The names of the ATF C++ test programs to build. + +ATF_TESTS_SH The names of the ATF sh test programs to build. + +PLAIN_TESTS_C The names of the plain (legacy) programs to build. + +PLAIN_TESTS_CXX The names of the plain (legacy) test programs to build. + +PLAIN_TESTS_SH The names of the plain (legacy) test programs to build. + +TAP_PERL_INTERPRETER + Path to the Perl interpreter to be used for + TAP-compliant test programs that are written in Perl. + Refer to TAP_TESTS_PERL for details. + +TAP_TESTS_C The names of the TAP-compliant C test programs to build. + +TAP_TESTS_CXX The names of the TAP-compliant C++ test programs to + build. + +TAP_TESTS_PERL The names of the TAP-compliant Perl test programs to + build. The corresponding source files should end with + the .pl extension; the test program is marked as + requiring Perl; and TAP_PERL_INTERPRETER is used in the + built scripts as the interpreter of choice. + +TAP_TESTS_SH The names of the TAP-compliant sh test programs to + build. + +TESTS_SUBDIRS List of subdirectories containing tests into which to + recurse. Differs from SUBDIR in that these directories + get registered into the automatically-generated + Kyuafile (if any). + +NOT_FOR_TEST_SUITE + If defined, none of the built test programs get + installed under /usr/tests/ and no Kyuafile is + automatically generated. Should not be used within the + FreeBSD source tree but is provided for the benefit of + third-parties. + +The actual building of the test programs is performed by . +Please see the documentation above for this other file for additional +details on the behavior of . Modified: stable/10/share/mk/bsd.test.mk ============================================================================== --- stable/10/share/mk/bsd.test.mk Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/share/mk/bsd.test.mk Mon Apr 14 23:51:57 2014 (r264483) @@ -2,23 +2,13 @@ # # Generic build infrastructure for test programs. # -# The code in this file is independent of the implementation of the test -# programs being built; this file just provides generic infrastructure for the -# build and the definition of various helper variables and targets. -# -# Makefiles should never include this file directly. Instead, they should -# include one of the various *.test.mk depending on the specific test programs -# being built. +# This is the only public file that should be included by Makefiles when +# tests are to be built. All other *.test.mk files are internal and not +# to be included directly. .include -# Directory in which to install tests defined by the current Makefile. -# Makefiles have to override this to point to a subdirectory of TESTSBASE. -TESTSDIR?= . - -# Name of the test suite these tests belong to. Should rarely be changed for -# Makefiles built into the FreeBSD src tree. -TESTSUITE?= FreeBSD +____: # List of subdirectories containing tests into which to recurse. This has the # same semantics as SUBDIR at build-time. However, the directories listed here @@ -29,31 +19,10 @@ TESTSUITE?= FreeBSD # SUBDIR for directories that may contain helper binaries and/or data files. TESTS_SUBDIRS?= -# Knob to control the handling of the Kyuafile for this Makefile. -# -# If 'yes', a Kyuafile exists in the source tree and is installed into -# TESTSDIR. -# -# If 'auto', a Kyuafile is automatically generated based on the list of test -# programs built by the Makefile and is installed into TESTSDIR. This is the -# default and is sufficient in the majority of the cases. -# -# If 'no', no Kyuafile is installed. -KYUAFILE?= auto - -# Per-test program interface definition. -# -# The name provided here must match one of the interface names supported by -# Kyua as this is later encoded in the Kyuafile test program definitions. -#TEST_INTERFACE.= interface-name - -# Per-test program metadata properties as a list of key/value pairs. -# -# All the variables for a particular program are appended to the program's -# definition in the Kyuafile. This feature can be used to avoid having to -# explicitly supply a Kyuafile in the source directory, allowing the caller -# Makefile to rely on the KYUAFILE=auto behavior defined here. -#TEST_METADATA.+= key="value" +# If defined, indicates that the tests built by the Makefile are not part of +# the FreeBSD Test Suite. The implication of this is that the tests won't be +# installed under /usr/tests/ and that Kyua won't be able to run them. +#NOT_FOR_TEST_SUITE= # List of variables to pass to the tests at run-time via the environment. TESTS_ENV?= @@ -67,17 +36,14 @@ TESTS_ENV+= PATH=${TESTS_PATH:tW:C/ +/:/ TESTS_LD_LIBRARY_PATH+= ${DESTDIR}/lib ${DESTDIR}/usr/lib TESTS_ENV+= LD_LIBRARY_PATH=${TESTS_LD_LIBRARY_PATH:tW:C/ +/:/g} -# List of all tests being built. This variable is internal should not be -# defined by the Makefile. The various *.test.mk modules extend this variable -# as needed. -_TESTS?= - -# Path to the prefix of the installed Kyua CLI, if any. -# -# If kyua is installed from ports, we automatically define a realtest target -# below to run the tests using this tool. The tools are searched for in the -# hierarchy specified by this variable. -KYUA_PREFIX?= /usr/local +# List of all tests being built. The various *.test.mk modules extend this +# variable as needed. +_TESTS= + +# Pull in the definitions of all supported test interfaces. +.include +.include +.include .if !empty(TESTS_SUBDIRS) SUBDIR+= ${TESTS_SUBDIRS} @@ -93,82 +59,9 @@ WITHOUT_MAN=yes PROG_VARS+= BINDIR PROGS_TARGETS+= install -.if ${KYUAFILE:tl} == "yes" -FILES+= Kyuafile -FILESDIR_Kyuafile= ${TESTSDIR} - -CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp -.elif ${KYUAFILE:tl} == "auto" -FILES+= Kyuafile.auto -FILESDIR_Kyuafile.auto= ${TESTSDIR} -FILESNAME_Kyuafile.auto= Kyuafile - -CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp - -.NOPATH: Kyuafile.auto -Kyuafile.auto: Makefile - @{ \ - echo '-- Automatically generated by bsd.test.mk.'; \ - echo; \ - echo 'syntax(2)'; \ - echo; \ - echo 'test_suite("${TESTSUITE}")'; \ - echo; \ - } >Kyuafile.auto.tmp -.for _T in ${_TESTS} - @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ - >>Kyuafile.auto.tmp -.endfor -.for _T in ${TESTS_SUBDIRS:N.WAIT} - @echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.auto.tmp -.endfor - @mv Kyuafile.auto.tmp Kyuafile.auto -.endif - -KYUA?= ${KYUA_PREFIX}/bin/kyua -.if exists(${KYUA}) -# Definition of the "make test" target and supporting variables. -# -# This target, by necessity, can only work for native builds (i.e. a FreeBSD -# host building a release for the same system). The target runs Kyua, which is -# not in the toolchain, and the tests execute code built for the target host. -# -# Due to the dependencies of the binaries built by the source tree and how they -# are used by tests, it is highly possible for a execution of "make test" to -# report bogus results unless the new binaries are put in place. -realtest: .PHONY - @echo "*** WARNING: make test is experimental" - @echo "***" - @echo "*** Using this test does not preclude you from running the tests" - @echo "*** installed in ${TESTSBASE}. This test run may raise false" - @echo "*** positives and/or false negatives." - @echo - @set -e; \ - ${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile; \ - result=0; \ - echo; \ - echo "*** Once again, note that "make test" is unsupported."; \ - test $${result} -eq 0 -.endif - -beforetest: .PHONY -.if defined(TESTSDIR) -.if ${TESTSDIR} == ${TESTSBASE} -# Forbid running from ${TESTSBASE}. It can cause false positives/negatives and -# it does not cover all the tests (e.g. it misses testing software in external). - @echo "*** Sorry, you cannot use make test from src/tests. Install the" - @echo "*** tests into their final location and run them from ${TESTSBASE}" - @false -.else - @echo "*** Using this test does not preclude you from running the tests" - @echo "*** installed in ${TESTSBASE}. This test run may raise false" - @echo "*** positives and/or false negatives." -.endif -.else - @echo "*** No TESTSDIR defined; nothing to do." - @false +.if !defined(NOT_FOR_TEST_SUITE) +.include .endif - @echo .if !target(realtest) realtest: .PHONY Modified: stable/10/share/mk/plain.test.mk ============================================================================== --- stable/10/share/mk/plain.test.mk Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/share/mk/plain.test.mk Mon Apr 14 23:51:57 2014 (r264483) @@ -1,10 +1,14 @@ # $FreeBSD$ # +# You must include bsd.test.mk instead of this file from your Makefile. +# # Logic to build and install plain test programs. A plain test programs it not # supposed to use any specific testing framework: all it does is run some code # and report the test's pass or fail status via a 0 or 1 exit code. -.include +.if !target(____) +.error plain.test.mk cannot be included directly. +.endif # List of C, C++ and shell test programs to build. # @@ -58,5 +62,3 @@ ${_T}: ${PLAIN_TESTS_SH_SRC_${_T}} mv ${.TARGET}.tmp ${.TARGET} .endfor .endif - -.include Copied: stable/10/share/mk/suite.test.mk (from r263172, head/share/mk/suite.test.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/mk/suite.test.mk Mon Apr 14 23:51:57 2014 (r264483, copy of r263172, head/share/mk/suite.test.mk) @@ -0,0 +1,127 @@ +# $FreeBSD$ +# +# You must include bsd.test.mk instead of this file from your Makefile. +# +# Internal glue for the build of /usr/tests/. + +.if !target(____) +.error suite.test.mk cannot be included directly. +.endif + +# Directory in which to install tests defined by the current Makefile. +# Makefiles have to override this to point to a subdirectory of TESTSBASE. +TESTSDIR?= . + +# Name of the test suite these tests belong to. Should rarely be changed for +# Makefiles built into the FreeBSD src tree. +TESTSUITE?= FreeBSD + +# Knob to control the handling of the Kyuafile for this Makefile. +# +# If 'yes', a Kyuafile exists in the source tree and is installed into +# TESTSDIR. +# +# If 'auto', a Kyuafile is automatically generated based on the list of test +# programs built by the Makefile and is installed into TESTSDIR. This is the +# default and is sufficient in the majority of the cases. +# +# If 'no', no Kyuafile is installed. +KYUAFILE?= auto + +# Per-test program interface definition. +# +# The name provided here must match one of the interface names supported by +# Kyua as this is later encoded in the Kyuafile test program definitions. +#TEST_INTERFACE.= interface-name + +# Per-test program metadata properties as a list of key/value pairs. +# +# All the variables for a particular program are appended to the program's +# definition in the Kyuafile. This feature can be used to avoid having to +# explicitly supply a Kyuafile in the source directory, allowing the caller +# Makefile to rely on the KYUAFILE=auto behavior defined here. +#TEST_METADATA.+= key="value" + +# Path to the prefix of the installed Kyua CLI, if any. +# +# If kyua is installed from ports, we automatically define a realtest target +# below to run the tests using this tool. The tools are searched for in the +# hierarchy specified by this variable. +KYUA_PREFIX?= /usr/local + +.if ${KYUAFILE:tl} == "yes" +FILES+= Kyuafile +FILESDIR_Kyuafile= ${TESTSDIR} + +CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp +.elif ${KYUAFILE:tl} == "auto" +FILES+= Kyuafile.auto +FILESDIR_Kyuafile.auto= ${TESTSDIR} +FILESNAME_Kyuafile.auto= Kyuafile + +CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp + +.NOPATH: Kyuafile.auto +Kyuafile.auto: Makefile + @{ \ + echo '-- Automatically generated by bsd.test.mk.'; \ + echo; \ + echo 'syntax(2)'; \ + echo; \ + echo 'test_suite("${TESTSUITE}")'; \ + echo; \ + } >Kyuafile.auto.tmp +.for _T in ${_TESTS} + @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ + >>Kyuafile.auto.tmp +.endfor +.for _T in ${TESTS_SUBDIRS:N.WAIT} + @echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.auto.tmp +.endfor + @mv Kyuafile.auto.tmp Kyuafile.auto +.endif + +KYUA?= ${KYUA_PREFIX}/bin/kyua +.if exists(${KYUA}) +# Definition of the "make test" target and supporting variables. +# +# This target, by necessity, can only work for native builds (i.e. a FreeBSD +# host building a release for the same system). The target runs Kyua, which is +# not in the toolchain, and the tests execute code built for the target host. +# +# Due to the dependencies of the binaries built by the source tree and how they +# are used by tests, it is highly possible for a execution of "make test" to +# report bogus results unless the new binaries are put in place. +realtest: .PHONY + @echo "*** WARNING: make test is experimental" + @echo "***" + @echo "*** Using this test does not preclude you from running the tests" + @echo "*** installed in ${TESTSBASE}. This test run may raise false" + @echo "*** positives and/or false negatives." + @echo + @set -e; \ + ${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile; \ + result=0; \ + echo; \ + echo "*** Once again, note that "make test" is unsupported."; \ + test $${result} -eq 0 +.endif + +beforetest: .PHONY +.if defined(TESTSDIR) +.if ${TESTSDIR} == ${TESTSBASE} +# Forbid running from ${TESTSBASE}. It can cause false positives/negatives and +# it does not cover all the tests (e.g. it misses testing software in external). + @echo "*** Sorry, you cannot use make test from src/tests. Install the" + @echo "*** tests into their final location and run them from ${TESTSBASE}" + @false +.else + @echo "*** Using this test does not preclude you from running the tests" + @echo "*** installed in ${TESTSBASE}. This test run may raise false" + @echo "*** positives and/or false negatives." +.endif +.else + @echo "*** No TESTSDIR defined; nothing to do." + @false +.endif + @echo Modified: stable/10/share/mk/tap.test.mk ============================================================================== --- stable/10/share/mk/tap.test.mk Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/share/mk/tap.test.mk Mon Apr 14 23:51:57 2014 (r264483) @@ -1,12 +1,16 @@ # $FreeBSD$ # +# You must include bsd.test.mk instead of this file from your Makefile. +# # Logic to build and install TAP-compliant test programs. # # This is provided to support existing tests in the FreeBSD source tree # (particularly those coming from tools/regression/) that comply with the # Test Anything Protocol. It should not be used for new tests. -.include +.if !target(____) +.error tap.test.mk cannot be included directly. +.endif # List of C, C++ and shell test programs to build. # @@ -87,5 +91,3 @@ ${_T}: ${TAP_TESTS_SH_SRC_${_T}} mv ${.TARGET}.tmp ${.TARGET} .endfor .endif - -.include Modified: stable/10/tests/sys/kern/Makefile ============================================================================== --- stable/10/tests/sys/kern/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/tests/sys/kern/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -9,4 +9,4 @@ LDADD.unix_seqpacket_test+= -lpthread WARNS?= 5 -.include +.include Modified: stable/10/usr.bin/atf/atf-sh/tests/Makefile ============================================================================== --- stable/10/usr.bin/atf/atf-sh/tests/Makefile Mon Apr 14 22:49:37 2014 (r264482) +++ stable/10/usr.bin/atf/atf-sh/tests/Makefile Mon Apr 14 23:51:57 2014 (r264483) @@ -23,4 +23,4 @@ misc_helpers: misc_helpers.sh chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} -.include +.include From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 02:17:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3191C728; Tue, 15 Apr 2014 02:17: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 1E1D2191D; Tue, 15 Apr 2014 02:17: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 s3F2HkXX066573; Tue, 15 Apr 2014 02:17:46 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F2Hkok066572; Tue, 15 Apr 2014 02:17:46 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201404150217.s3F2Hkok066572@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 15 Apr 2014 02:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264485 - stable/10/tools/test/ppsapi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 02:17:47 -0000 Author: gnn Date: Tue Apr 15 02:17:46 2014 New Revision: 264485 URL: http://svnweb.freebsd.org/changeset/base/264485 Log: MFC: 264016 Silence an unnecessary warning. Modified: stable/10/tools/test/ppsapi/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/test/ppsapi/Makefile ============================================================================== --- stable/10/tools/test/ppsapi/Makefile Tue Apr 15 00:45:38 2014 (r264484) +++ stable/10/tools/test/ppsapi/Makefile Tue Apr 15 02:17:46 2014 (r264485) @@ -7,5 +7,7 @@ WARNS?= 5 .include +CFLAGS+=-Wno-format-security + test: ${PROG} ./${PROG} /dev/cuau0 From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 07:50:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B838072D; Tue, 15 Apr 2014 07:50: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 A4649183E; Tue, 15 Apr 2014 07:50: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 s3F7oIEx003586; Tue, 15 Apr 2014 07:50:18 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F7oIcJ003585; Tue, 15 Apr 2014 07:50:18 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201404150750.s3F7oIcJ003585@svn.freebsd.org> From: Scott Long Date: Tue, 15 Apr 2014 07:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264490 - stable/10/sys/ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 07:50:18 -0000 Author: scottl Date: Tue Apr 15 07:50:18 2014 New Revision: 264490 URL: http://svnweb.freebsd.org/changeset/base/264490 Log: MFC r262812 - Gracefully handle truncation failures when trying to shrink directories. This could cause dirhash panics since the dirhash state would be successfully truncated while the directory was not. Submitted by: jeffr Modified: stable/10/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_lookup.c Tue Apr 15 07:37:56 2014 (r264489) +++ stable/10/sys/ufs/ufs/ufs_lookup.c Tue Apr 15 07:50:18 2014 (r264490) @@ -1130,12 +1130,15 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir dp->i_endoff && dp->i_endoff < dp->i_size) { if (tvp != NULL) VOP_UNLOCK(tvp, 0); + error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, + IO_NORMAL | IO_SYNC, cr); + if (error != 0) + vprint("ufs_direnter: failted to truncate", dvp); #ifdef UFS_DIRHASH - if (dp->i_dirhash != NULL) + if (error == 0 && dp->i_dirhash != NULL) ufsdirhash_dirtrunc(dp, dp->i_endoff); #endif - (void) UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, - IO_NORMAL | IO_SYNC, cr); + error = 0; if (tvp != NULL) vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 07:54:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC9588B6; Tue, 15 Apr 2014 07:54: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 A8A071877; Tue, 15 Apr 2014 07:54: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 s3F7sH8q006908; Tue, 15 Apr 2014 07:54:17 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F7sHtb006907; Tue, 15 Apr 2014 07:54:17 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201404150754.s3F7sHtb006907@svn.freebsd.org> From: Scott Long Date: Tue, 15 Apr 2014 07:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264491 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 07:54:17 -0000 Author: scottl Date: Tue Apr 15 07:54:17 2014 New Revision: 264491 URL: http://svnweb.freebsd.org/changeset/base/264491 Log: MFC r262814 - If we fail to do a non-blocking acquire of a buf lock while doing a waiting sync pass we need to do a blocking acquire and restart. Another thread, typically the buf daemon, may have this buf locked and if we don't wait we can fail to sync the file. This lead to a great variety of softdep panics because we rely on all dependencies being flushed before proceeding in several cases. Submitted by: jeffr Modified: stable/10/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_vnops.c Tue Apr 15 07:50:18 2014 (r264490) +++ stable/10/sys/ufs/ffs/ffs_vnops.c Tue Apr 15 07:54:17 2014 (r264491) @@ -259,9 +259,17 @@ loop: continue; if (bp->b_lblkno > lbn) panic("ffs_syncvnode: syncing truncated data."); - if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) + if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) { + BO_UNLOCK(bo); + } else if (wait != 0) { + if (BUF_LOCK(bp, + LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, + BO_LOCKPTR(bo)) != 0) { + bp->b_vflags &= ~BV_SCANNED; + goto next; + } + } else continue; - BO_UNLOCK(bo); if ((bp->b_flags & B_DELWRI) == 0) panic("ffs_fsync: not dirty"); /* From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 08:02:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C89B8C28; Tue, 15 Apr 2014 08:02:58 +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 A79671945; Tue, 15 Apr 2014 08:02:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3F82wiQ011060; Tue, 15 Apr 2014 08:02:58 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F82wcB011055; Tue, 15 Apr 2014 08:02:58 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201404150802.s3F82wcB011055@svn.freebsd.org> From: Scott Long Date: Tue, 15 Apr 2014 08:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264492 - stable/10/sys/dev/mps X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 08:02:59 -0000 Author: scottl Date: Tue Apr 15 08:02:57 2014 New Revision: 264492 URL: http://svnweb.freebsd.org/changeset/base/264492 Log: MFC r264229 Add some assertions to ensure that the target array doesn't get accessed out of bounds. Modified: stable/10/sys/dev/mps/mps_sas.c stable/10/sys/dev/mps/mps_sas.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mps/mps_sas.c ============================================================================== --- stable/10/sys/dev/mps/mps_sas.c Tue Apr 15 07:54:17 2014 (r264491) +++ stable/10/sys/dev/mps/mps_sas.c Tue Apr 15 08:02:57 2014 (r264492) @@ -154,7 +154,7 @@ mpssas_find_target_by_handle(struct mpss struct mpssas_target *target; int i; - for (i = start; i < sassc->sc->facts->MaxTargets; i++) { + for (i = start; i < sassc->maxtargets; i++) { target = &sassc->targets[i]; if (target->handle == handle) return (target); @@ -709,8 +709,16 @@ mps_attach_sas(struct mps_softc *sc) __func__, __LINE__); return (ENOMEM); } + + /* + * XXX MaxTargets could change during a reinit. Since we don't + * resize the targets[] array during such an event, cache the value + * of MaxTargets here so that we don't get into trouble later. This + * should move into the reinit logic. + */ + sassc->maxtargets = sc->facts->MaxTargets; sassc->targets = malloc(sizeof(struct mpssas_target) * - sc->facts->MaxTargets, M_MPT2, M_WAITOK|M_ZERO); + sassc->maxtargets, M_MPT2, M_WAITOK|M_ZERO); if(!sassc->targets) { device_printf(sc->mps_dev, "Cannot allocate memory %s %d\n", __func__, __LINE__); @@ -868,7 +876,7 @@ mps_detach_sas(struct mps_softc *sc) if (sassc->devq != NULL) cam_simq_free(sassc->devq); - for(i=0; i< sc->facts->MaxTargets ;i++) { + for(i=0; i< sassc->maxtargets ;i++) { targ = &sassc->targets[i]; SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, lun_tmp) { free(lun, M_MPT2); @@ -959,9 +967,9 @@ mpssas_action(struct cam_sim *sim, union cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; #endif cpi->hba_eng_cnt = 0; - cpi->max_target = sassc->sc->facts->MaxTargets - 1; + cpi->max_target = sassc->maxtargets - 1; cpi->max_lun = 255; - cpi->initiator_id = sassc->sc->facts->MaxTargets - 1; + cpi->initiator_id = sassc->maxtargets - 1; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "LSILogic", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); @@ -992,6 +1000,9 @@ mpssas_action(struct cam_sim *sim, union sas = &cts->xport_specific.sas; scsi = &cts->proto_specific.scsi; + KASSERT(cts->ccb_h.target_id < sassc->maxtargets, + ("Target %d out of bounds in XPT_GET_TRANS_SETTINGS\n", + cts->ccb_h.target_id)); targ = &sassc->targets[cts->ccb_h.target_id]; if (targ->handle == 0x0) { cts->ccb_h.status = CAM_SEL_TIMEOUT; @@ -1155,7 +1166,7 @@ mpssas_handle_reinit(struct mps_softc *s * reset, and we have to rediscover all the targets and use the new * handles. */ - for (i = 0; i < sc->facts->MaxTargets; i++) { + for (i = 0; i < sc->sassc->maxtargets; i++) { if (sc->sassc->targets[i].outstanding != 0) mps_dprint(sc, MPS_INIT, "target %u outstanding %u\n", i, sc->sassc->targets[i].outstanding); @@ -1631,6 +1642,9 @@ mpssas_action_scsiio(struct mpssas_softc mtx_assert(&sc->mps_mtx, MA_OWNED); csio = &ccb->csio; + KASSERT(csio->ccb_h.target_id < sassc->maxtargets, + ("Target %d out of bounds in XPT_SCSI_IO\n", + csio->ccb_h.target_id)); targ = &sassc->targets[csio->ccb_h.target_id]; mps_dprint(sc, MPS_TRACE, "ccb %p target flag %x\n", ccb, targ->flags); if (targ->handle == 0x0) { @@ -2929,6 +2943,8 @@ mpssas_action_smpio(struct mpssas_softc /* * Make sure the target exists. */ + KASSERT(ccb->ccb_h.target_id < sassc->maxtargets, + ("Target %d out of bounds in XPT_SMP_IO\n", ccb->ccb_h.target_id)); targ = &sassc->targets[ccb->ccb_h.target_id]; if (targ->handle == 0x0) { mps_dprint(sc, MPS_ERROR, @@ -3063,6 +3079,9 @@ mpssas_action_resetdev(struct mpssas_sof MPS_FUNCTRACE(sassc->sc); mtx_assert(&sassc->sc->mps_mtx, MA_OWNED); + KASSERT(ccb->ccb_h.target_id < sassc->maxtargets, + ("Target %d out of bounds in XPT_RESET_DEV\n", + ccb->ccb_h.target_id)); sc = sassc->sc; tm = mps_alloc_command(sc); if (tm == NULL) { @@ -3191,6 +3210,9 @@ mpssas_async(void *callback_arg, uint32_ /* * We should have a handle for this, but check to make sure. */ + KASSERT(xpt_path_target_id(path) < sassc->maxtargets, + ("Target %d out of bounds in mpssas_async\n", + xpt_path_target_id(path))); target = &sassc->targets[xpt_path_target_id(path)]; if (target->handle == 0) break; @@ -3278,6 +3300,9 @@ mpssas_check_eedp(struct mps_softc *sc, targetid = xpt_path_target_id(path); lunid = xpt_path_lun_id(path); + KASSERT(targetid < sassc->maxtargets, + ("Target %d out of bounds in mpssas_check_eedp\n", + targetid)); target = &sassc->targets[targetid]; if (target->handle == 0x0) return; @@ -3413,6 +3438,9 @@ mpssas_read_cap_done(struct cam_periph * * target. */ sassc = (struct mpssas_softc *)done_ccb->ccb_h.ppriv_ptr1; + KASSERT(done_ccb->ccb_h.target_id < sassc->maxtargets, + ("Target %d out of bounds in mpssas_read_cap_done\n", + done_ccb->ccb_h.target_id)); target = &sassc->targets[done_ccb->ccb_h.target_id]; SLIST_FOREACH(lun, &target->luns, lun_link) { if (lun->lun_id != done_ccb->ccb_h.target_lun) Modified: stable/10/sys/dev/mps/mps_sas.h ============================================================================== --- stable/10/sys/dev/mps/mps_sas.h Tue Apr 15 07:54:17 2014 (r264491) +++ stable/10/sys/dev/mps/mps_sas.h Tue Apr 15 08:02:57 2014 (r264492) @@ -87,6 +87,7 @@ struct mpssas_softc { #define MPSSAS_DISCOVERY_TIMEOUT_PENDING (1 << 2) #define MPSSAS_QUEUE_FROZEN (1 << 3) #define MPSSAS_SHUTDOWN (1 << 4) + u_int maxtargets; struct mpssas_target *targets; struct cam_devq *devq; struct cam_sim *sim; From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 08:08:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5A01FDD6; Tue, 15 Apr 2014 08:08: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 454AB1989; Tue, 15 Apr 2014 08:08: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 s3F88jBd011751; Tue, 15 Apr 2014 08:08:45 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F88ikA011749; Tue, 15 Apr 2014 08:08:44 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201404150808.s3F88ikA011749@svn.freebsd.org> From: Scott Long Date: Tue, 15 Apr 2014 08:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264493 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 08:08:45 -0000 Author: scottl Date: Tue Apr 15 08:08:44 2014 New Revision: 264493 URL: http://svnweb.freebsd.org/changeset/base/264493 Log: MFC r261558 Add a new sysctl, dev.cxgbe.N.rsrv_noflow, and a companion tunable, hw.cxgbe.rsrv_noflow. When set, queue 0 of the port is reserved for TX packets without a flowid. The hash value of packets with a flowid is bumped up by 1. The intent is to provide a private queue for link-level packets like LACP that is unlikely to overflow or suffer deep queue latency. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Tue Apr 15 08:02:57 2014 (r264492) +++ stable/10/sys/dev/cxgbe/adapter.h Tue Apr 15 08:08:44 2014 (r264493) @@ -208,6 +208,7 @@ struct port_info { /* These need to be int as they are used in sysctl */ int ntxq; /* # of tx queues */ int first_txq; /* index of first tx queue */ + int rsrv_noflowq; /* Reserve queue 0 for non-flowid packets */ int nrxq; /* # of rx queues */ int first_rxq; /* index of first rx queue */ #ifdef TCP_OFFLOAD Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Tue Apr 15 08:02:57 2014 (r264492) +++ stable/10/sys/dev/cxgbe/t4_main.c Tue Apr 15 08:08:44 2014 (r264493) @@ -197,6 +197,9 @@ TUNABLE_INT("hw.cxgbe.ntxq1g", &t4_ntxq1 static int t4_nrxq1g = -1; TUNABLE_INT("hw.cxgbe.nrxq1g", &t4_nrxq1g); +static int t4_rsrv_noflowq = 0; +TUNABLE_INT("hw.cxgbe.rsrv_noflowq", &t4_rsrv_noflowq); + #ifdef TCP_OFFLOAD #define NOFLDTXQ_10G 8 static int t4_nofldtxq10g = -1; @@ -299,6 +302,7 @@ struct intrs_and_queues { int nrxq10g; /* # of NIC rxq's for each 10G port */ int ntxq1g; /* # of NIC txq's for each 1G port */ int nrxq1g; /* # of NIC rxq's for each 1G port */ + int rsrv_noflowq; /* Flag whether to reserve queue 0 */ #ifdef TCP_OFFLOAD int nofldtxq10g; /* # of TOE txq's for each 10G port */ int nofldrxq10g; /* # of TOE rxq's for each 10G port */ @@ -375,6 +379,7 @@ static int cxgbe_sysctls(struct port_inf static int sysctl_int_array(SYSCTL_HANDLER_ARGS); static int sysctl_bitfield(SYSCTL_HANDLER_ARGS); static int sysctl_btphy(SYSCTL_HANDLER_ARGS); +static int sysctl_noflowq(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); @@ -782,6 +787,11 @@ t4_attach(device_t dev) pi->ntxq = iaq.ntxq1g; } + if (pi->ntxq > 1) + pi->rsrv_noflowq = iaq.rsrv_noflowq ? 1 : 0; + else + pi->rsrv_noflowq = 0; + rqidx += pi->nrxq; tqidx += pi->ntxq; @@ -1267,7 +1277,8 @@ cxgbe_transmit(struct ifnet *ifp, struct } if (m->m_flags & M_FLOWID) - txq += (m->m_pkthdr.flowid % pi->ntxq); + txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi->rsrv_noflowq)) + + pi->rsrv_noflowq); br = txq->br; if (TXQ_TRYLOCK(txq) == 0) { @@ -1719,6 +1730,7 @@ cfg_itype_and_nqueues(struct adapter *sc iaq->ntxq1g = t4_ntxq1g; iaq->nrxq10g = nrxq10g = t4_nrxq10g; iaq->nrxq1g = nrxq1g = t4_nrxq1g; + iaq->rsrv_noflowq = t4_rsrv_noflowq; #ifdef TCP_OFFLOAD if (is_offload(sc)) { iaq->nofldtxq10g = t4_nofldtxq10g; @@ -4498,6 +4510,9 @@ cxgbe_sysctls(struct port_info *pi) &pi->first_rxq, 0, "index of first rx queue"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_txq", CTLFLAG_RD, &pi->first_txq, 0, "index of first tx queue"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rsrv_noflowq", CTLTYPE_INT | + CTLFLAG_RW, pi, 0, sysctl_noflowq, "IU", + "Reserve queue 0 for non-flowid packets"); #ifdef TCP_OFFLOAD if (is_offload(pi->adapter)) { @@ -4752,6 +4767,25 @@ sysctl_btphy(SYSCTL_HANDLER_ARGS) } static int +sysctl_noflowq(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + int rc, val; + + val = pi->rsrv_noflowq; + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + if ((val >= 1) && (pi->ntxq > 1)) + pi->rsrv_noflowq = 1; + else + pi->rsrv_noflowq = 0; + + return (rc); +} + +static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS) { struct port_info *pi = arg1; From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 09:41:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4F0CA654; Tue, 15 Apr 2014 09:41: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 37F86137B; Tue, 15 Apr 2014 09:41: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 s3F9fti5052406; Tue, 15 Apr 2014 09:41:55 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F9fqv4052392; Tue, 15 Apr 2014 09:41:52 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201404150941.s3F9fqv4052392@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 15 Apr 2014 09:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264496 - in stable/10: include sys/arm/include sys/ia64/include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 09:41:55 -0000 Author: tijl Date: Tue Apr 15 09:41:52 2014 New Revision: 264496 URL: http://svnweb.freebsd.org/changeset/base/264496 Log: MFC r263998: Rename __wchar_t so it no longer conflicts with __wchar_t from clang 3.4 -fms-extensions. Modified: stable/10/include/inttypes.h stable/10/include/stddef.h stable/10/include/stdlib.h stable/10/include/wchar.h stable/10/sys/arm/include/_types.h stable/10/sys/ia64/include/_types.h stable/10/sys/mips/include/_types.h stable/10/sys/powerpc/include/_types.h stable/10/sys/sparc64/include/_types.h stable/10/sys/sys/stdatomic.h stable/10/sys/x86/include/_types.h Directory Properties: stable/10/ (props changed) Modified: stable/10/include/inttypes.h ============================================================================== --- stable/10/include/inttypes.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/include/inttypes.h Tue Apr 15 09:41:52 2014 (r264496) @@ -34,7 +34,7 @@ #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED -typedef __wchar_t wchar_t; +typedef ___wchar_t wchar_t; #define _WCHAR_T_DECLARED #endif #endif Modified: stable/10/include/stddef.h ============================================================================== --- stable/10/include/stddef.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/include/stddef.h Tue Apr 15 09:41:52 2014 (r264496) @@ -54,7 +54,7 @@ typedef __size_t size_t; #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED -typedef __wchar_t wchar_t; +typedef ___wchar_t wchar_t; #define _WCHAR_T_DECLARED #endif #endif Modified: stable/10/include/stdlib.h ============================================================================== --- stable/10/include/stdlib.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/include/stdlib.h Tue Apr 15 09:41:52 2014 (r264496) @@ -51,7 +51,7 @@ typedef __size_t size_t; #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED -typedef __wchar_t wchar_t; +typedef ___wchar_t wchar_t; #define _WCHAR_T_DECLARED #endif #endif Modified: stable/10/include/wchar.h ============================================================================== --- stable/10/include/wchar.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/include/wchar.h Tue Apr 15 09:41:52 2014 (r264496) @@ -78,7 +78,7 @@ typedef __size_t size_t; #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED -typedef __wchar_t wchar_t; +typedef ___wchar_t wchar_t; #define _WCHAR_T_DECLARED #endif #endif Modified: stable/10/sys/arm/include/_types.h ============================================================================== --- stable/10/sys/arm/include/_types.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/sys/arm/include/_types.h Tue Apr 15 09:41:52 2014 (r264496) @@ -106,11 +106,11 @@ typedef __uint64_t __vm_pindex_t; typedef __uint32_t __vm_size_t; #ifdef __ARM_EABI__ -typedef unsigned int __wchar_t; +typedef unsigned int ___wchar_t; #define __WCHAR_MIN 0 /* min value for a wchar_t */ #define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ #else -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ #endif Modified: stable/10/sys/ia64/include/_types.h ============================================================================== --- stable/10/sys/ia64/include/_types.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/sys/ia64/include/_types.h Tue Apr 15 09:41:52 2014 (r264496) @@ -96,7 +96,7 @@ typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ Modified: stable/10/sys/mips/include/_types.h ============================================================================== --- stable/10/sys/mips/include/_types.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/sys/mips/include/_types.h Tue Apr 15 09:41:52 2014 (r264496) @@ -145,7 +145,7 @@ typedef __uint32_t __vm_paddr_t; typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_pindex_t; -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ Modified: stable/10/sys/powerpc/include/_types.h ============================================================================== --- stable/10/sys/powerpc/include/_types.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/sys/powerpc/include/_types.h Tue Apr 15 09:41:52 2014 (r264496) @@ -133,7 +133,7 @@ typedef __uint32_t __vm_size_t; #endif typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_pindex_t; -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ Modified: stable/10/sys/sparc64/include/_types.h ============================================================================== --- stable/10/sys/sparc64/include/_types.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/sys/sparc64/include/_types.h Tue Apr 15 09:41:52 2014 (r264496) @@ -92,7 +92,7 @@ typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ Modified: stable/10/sys/sys/stdatomic.h ============================================================================== --- stable/10/sys/sys/stdatomic.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/sys/sys/stdatomic.h Tue Apr 15 09:41:52 2014 (r264496) @@ -198,7 +198,7 @@ typedef _Atomic(long long) atomic_llong typedef _Atomic(unsigned long long) atomic_ullong; typedef _Atomic(__char16_t) atomic_char16_t; typedef _Atomic(__char32_t) atomic_char32_t; -typedef _Atomic(__wchar_t) atomic_wchar_t; +typedef _Atomic(___wchar_t) atomic_wchar_t; typedef _Atomic(__int_least8_t) atomic_int_least8_t; typedef _Atomic(__uint_least8_t) atomic_uint_least8_t; typedef _Atomic(__int_least16_t) atomic_int_least16_t; Modified: stable/10/sys/x86/include/_types.h ============================================================================== --- stable/10/sys/x86/include/_types.h Tue Apr 15 09:40:45 2014 (r264495) +++ stable/10/sys/x86/include/_types.h Tue Apr 15 09:41:52 2014 (r264496) @@ -142,7 +142,7 @@ typedef __uint32_t __vm_size_t; #endif typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_pindex_t; -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 09:49:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 196DE83B; Tue, 15 Apr 2014 09:49: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 0250A13DB; Tue, 15 Apr 2014 09:49: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 s3F9nmLr053392; Tue, 15 Apr 2014 09:49:48 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F9ni6V053367; Tue, 15 Apr 2014 09:49:44 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201404150949.s3F9ni6V053367@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 15 Apr 2014 09:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264497 - in stable/10/lib: libc/iconv libiconv_modules/BIG5 libiconv_modules/DECHanyu libiconv_modules/EUCTW libiconv_modules/ISO2022 libiconv_modules/UES libiconv_modules/VIQR libicon... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 09:49:49 -0000 Author: tijl Date: Tue Apr 15 09:49:44 2014 New Revision: 264497 URL: http://svnweb.freebsd.org/changeset/base/264497 Log: MFC r263986: - In the libiconv module for ISO 2022 restore the original order of the fields of a private struct such that variables of this type are initialised correctly. Fixes conversion from ISO 2022. Also do this in the BIG5 module to prevent similar errors in the future. - In the libiconv module for EUC-TW replace 2^cs with 1<ci_ops->io_uninit_shared == NULL || ci->ci_ops->io_init_context == NULL || ci->ci_ops->io_uninit_context == NULL || - ci->ci_ops->io_convert == NULL) + ci->ci_ops->io_convert == NULL) { + ret = EINVAL; goto err; + } /* initialize the converter */ ret = (*ci->ci_ops->io_init_shared)(ci, src, dst); Modified: stable/10/lib/libc/iconv/citrus_lookup.c ============================================================================== --- stable/10/lib/libc/iconv/citrus_lookup.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libc/iconv/citrus_lookup.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_lookup.c,v 1.6 2009/02/03 04:58:38 lukem Exp $ */ +/* $NetBSD: citrus_lookup.c,v 1.7 2012/05/04 16:45:05 joerg Exp $ */ /*- * Copyright (c)2003 Citrus Project, Modified: stable/10/lib/libc/iconv/citrus_mapper.c ============================================================================== --- stable/10/lib/libc/iconv/citrus_mapper.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libc/iconv/citrus_mapper.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_mapper.c,v 1.7 2008/07/25 14:05:25 christos Exp $ */ +/* $NetBSD: citrus_mapper.c,v 1.10 2012/06/08 07:49:42 martin Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -244,8 +244,10 @@ mapper_open(struct _citrus_mapper_area * if (!cm->cm_ops->mo_init || !cm->cm_ops->mo_uninit || !cm->cm_ops->mo_convert || - !cm->cm_ops->mo_init_state) + !cm->cm_ops->mo_init_state) { + ret = EINVAL; goto err; + } /* allocate traits structure */ cm->cm_traits = malloc(sizeof(*cm->cm_traits)); Modified: stable/10/lib/libc/iconv/citrus_memstream.c ============================================================================== --- stable/10/lib/libc/iconv/citrus_memstream.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libc/iconv/citrus_memstream.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_memstream.c,v 1.4 2009/02/03 05:02:12 lukem Exp $ */ +/* $NetBSD: citrus_memstream.c,v 1.5 2012/03/13 21:13:31 christos Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -44,8 +44,7 @@ _citrus_memory_stream_getln(struct _citr size_t * __restrict rlen) { const uint8_t *h, *p; - size_t ret; - int i; + size_t i, ret; if (ms->ms_pos>=_region_size(&ms->ms_region)) return (NULL); Modified: stable/10/lib/libc/iconv/citrus_mmap.c ============================================================================== --- stable/10/lib/libc/iconv/citrus_mmap.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libc/iconv/citrus_mmap.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_mmap.c,v 1.3 2005/01/19 00:52:37 mycroft Exp $ */ +/* $NetBSD: citrus_mmap.c,v 1.4 2011/10/15 23:00:01 christos Exp $ */ /*- * Copyright (c)2003 Citrus Project, Modified: stable/10/lib/libc/iconv/citrus_prop.c ============================================================================== --- stable/10/lib/libc/iconv/citrus_prop.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libc/iconv/citrus_prop.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_prop.c,v 1.3 2006/11/22 23:47:21 tnozaki Exp $ */ +/* $NetBSD: citrus_prop.c,v 1.4 2011/03/30 08:22:01 jruoho Exp $ */ /*- * Copyright (c)2006 Citrus Project, Modified: stable/10/lib/libc/iconv/citrus_prop.h ============================================================================== --- stable/10/lib/libc/iconv/citrus_prop.h Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libc/iconv/citrus_prop.h Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_prop.h,v 1.3 2006/11/23 13:59:03 tnozaki Exp $ */ +/* $NetBSD: citrus_prop.h,v 1.5 2011/05/23 14:52:32 joerg Exp $ */ /*- * Copyright (c)2006 Citrus Project, @@ -82,7 +82,7 @@ struct _citrus_prop_hint_t { #define _CITRUS_PROP_HINT_NUM(name, cb) \ { name, _CITRUS_PROP_NUM, { .num = { cb } } } #define _CITRUS_PROP_HINT_END \ - { NULL, _CITRUS_PROP_NUM, { .num = { 0 } } } + { .name = NULL } __BEGIN_DECLS int _citrus_prop_parse_variable(const _citrus_prop_hint_t * __restrict, Modified: stable/10/lib/libc/iconv/citrus_stdenc.c ============================================================================== --- stable/10/lib/libc/iconv/citrus_stdenc.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libc/iconv/citrus_stdenc.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_stdenc.c,v 1.3 2005/10/29 18:02:04 tshiozak Exp $ */ +/* $NetBSD: citrus_stdenc.c,v 1.4 2011/11/19 18:39:58 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -102,8 +102,10 @@ _citrus_stdenc_open(struct _citrus_stden ce->ce_ops->eo_cstomb == NULL || ce->ce_ops->eo_mbtowc == NULL || ce->ce_ops->eo_wctomb == NULL || - ce->ce_ops->eo_get_state_desc == NULL) + ce->ce_ops->eo_get_state_desc == NULL) { + ret = EINVAL; goto bad; + } /* allocate traits */ ce->ce_traits = malloc(sizeof(*ce->ce_traits)); Modified: stable/10/lib/libiconv_modules/BIG5/citrus_big5.c ============================================================================== --- stable/10/lib/libiconv_modules/BIG5/citrus_big5.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libiconv_modules/BIG5/citrus_big5.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_big5.c,v 1.12 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_big5.c,v 1.13 2011/05/23 14:53:46 joerg Exp $ */ /*- * Copyright (c)2002, 2006 Citrus Project, @@ -92,8 +92,8 @@ typedef struct { typedef struct _BIG5Exclude { TAILQ_ENTRY(_BIG5Exclude) entry; - wint_t end; wint_t start; + wint_t end; } _BIG5Exclude; typedef TAILQ_HEAD(_BIG5ExcludeList, _BIG5Exclude) _BIG5ExcludeList; @@ -358,7 +358,7 @@ _citrus_BIG5_wcrtomb_priv(_BIG5EncodingI size_t n, wchar_t wc, _BIG5State * __restrict psenc __unused, size_t * __restrict nresult) { - unsigned char l; + size_t l; int ret; /* check invalid sequence */ Modified: stable/10/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c ============================================================================== --- stable/10/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_dechanyu.c,v 1.3 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_dechanyu.c,v 1.4 2011/11/19 18:20:13 tnozaki Exp $ */ /*- * Copyright (c)2007 Citrus Project, Modified: stable/10/lib/libiconv_modules/EUCTW/citrus_euctw.c ============================================================================== --- stable/10/lib/libiconv_modules/EUCTW/citrus_euctw.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libiconv_modules/EUCTW/citrus_euctw.c Tue Apr 15 09:49:44 2014 (r264497) @@ -119,7 +119,7 @@ _citrus_EUCTW_count(int cs) case 1: /*FALLTHROUGH*/ case 2: - return (2^cs); + return (1 << cs); case 3: abort(); /*NOTREACHED*/ Modified: stable/10/lib/libiconv_modules/ISO2022/citrus_iso2022.c ============================================================================== --- stable/10/lib/libiconv_modules/ISO2022/citrus_iso2022.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libiconv_modules/ISO2022/citrus_iso2022.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_iso2022.c,v 1.19 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $ */ /*- * Copyright (c)1999, 2002 Citrus Project, @@ -78,9 +78,9 @@ #define CS96MULTI (3U) typedef struct { - unsigned char interm; - unsigned char final; unsigned char type; + unsigned char final; + unsigned char interm; unsigned char vers; } _ISO2022Charset; Modified: stable/10/lib/libiconv_modules/UES/citrus_ues.c ============================================================================== --- stable/10/lib/libiconv_modules/UES/citrus_ues.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libiconv_modules/UES/citrus_ues.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_ues.c,v 1.1 2006/11/13 15:16:31 tnozaki Exp $ */ +/* $NetBSD: citrus_ues.c,v 1.3 2012/02/12 13:51:29 wiz Exp $ */ /*- * Copyright (c)2006 Citrus Project, Modified: stable/10/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- stable/10/lib/libiconv_modules/VIQR/citrus_viqr.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libiconv_modules/VIQR/citrus_viqr.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_viqr.c,v 1.4 2008/06/14 16:01:08 tnozaki Exp $ */ +/* $NetBSD: citrus_viqr.c,v 1.5 2011/11/19 18:20:13 tnozaki Exp $ */ /*- * Copyright (c)2006 Citrus Project, Modified: stable/10/lib/libiconv_modules/iconv_none/citrus_iconv_none.c ============================================================================== --- stable/10/lib/libiconv_modules/iconv_none/citrus_iconv_none.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libiconv_modules/iconv_none/citrus_iconv_none.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_iconv_none.c,v 1.2 2003/07/01 09:42:16 tshiozak Exp $ */ +/* $NetBSD: citrus_iconv_none.c,v 1.3 2011/05/23 14:45:44 joerg Exp $ */ /*- * Copyright (c)2003 Citrus Project, Modified: stable/10/lib/libiconv_modules/iconv_std/citrus_iconv_std.c ============================================================================== --- stable/10/lib/libiconv_modules/iconv_std/citrus_iconv_std.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libiconv_modules/iconv_std/citrus_iconv_std.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_iconv_std.c,v 1.15 2006/11/13 19:08:19 tnozaki Exp $ */ +/* $NetBSD: citrus_iconv_std.c,v 1.16 2012/02/12 13:51:29 wiz Exp $ */ /*- * Copyright (c)2003 Citrus Project, Modified: stable/10/lib/libiconv_modules/mapper_std/citrus_mapper_std.c ============================================================================== --- stable/10/lib/libiconv_modules/mapper_std/citrus_mapper_std.c Tue Apr 15 09:41:52 2014 (r264496) +++ stable/10/lib/libiconv_modules/mapper_std/citrus_mapper_std.c Tue Apr 15 09:49:44 2014 (r264497) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_mapper_std.c,v 1.8 2006/09/11 13:06:33 tnozaki Exp $ */ +/* $NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $ */ /*- * Copyright (c)2003, 2006 Citrus Project, @@ -174,8 +174,11 @@ rowcol_parse_variable_compat(struct _cit n = be32toh(rcx->rcx_src_row_end); if (m + n > 0) { ret = set_linear_zone(lz, m, n); - if (ret != 0) + if (ret != 0) { + free(rc->rc_src_rowcol); + rc->rc_src_rowcol = NULL; return (ret); + } ++rc->rc_src_rowcol_len, ++lz; } m = be32toh(rcx->rcx_src_col_begin); From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 15:18:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2A0B4B48; Tue, 15 Apr 2014 15:18:33 +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 15EDB177E; Tue, 15 Apr 2014 15:18:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FFIWYD089009; Tue, 15 Apr 2014 15:18:32 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FFIW7I089008; Tue, 15 Apr 2014 15:18:32 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404151518.s3FFIW7I089008@svn.freebsd.org> From: Bryan Drewery Date: Tue, 15 Apr 2014 15:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264502 - stable/10/etc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 15:18:33 -0000 Author: bdrewery Date: Tue Apr 15 15:18:32 2014 New Revision: 264502 URL: http://svnweb.freebsd.org/changeset/base/264502 Log: MFC r264420: Always install pkg.conf. Don't depend on MK_PKGBOOTSTRAP. Modified: stable/10/etc/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Tue Apr 15 15:11:10 2014 (r264501) +++ stable/10/etc/Makefile Tue Apr 15 15:18:32 2014 (r264502) @@ -225,9 +225,7 @@ distribution: ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install -.if ${MK_PKGBOOTSTRAP} != "no" ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install -.endif ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install ${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 17:49:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A4511ED1; Tue, 15 Apr 2014 17:49: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 76DC117CE; Tue, 15 Apr 2014 17:49: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 s3FHnmW1052397; Tue, 15 Apr 2014 17:49:48 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FHnmLl052396; Tue, 15 Apr 2014 17:49:48 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404151749.s3FHnmLl052396@svn.freebsd.org> From: Sean Bruno Date: Tue, 15 Apr 2014 17:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264510 - stable/10/sys/dev/ciss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 17:49:48 -0000 Author: sbruno Date: Tue Apr 15 17:49:47 2014 New Revision: 264510 URL: http://svnweb.freebsd.org/changeset/base/264510 Log: MFC r264354 Fix insta-panic on assert of unlocked periph mtx in ciss(4) when logical volume state changes. Sponsored by: Yahoo! Inc. Modified: stable/10/sys/dev/ciss/ciss.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ciss/ciss.c ============================================================================== --- stable/10/sys/dev/ciss/ciss.c Tue Apr 15 17:06:26 2014 (r264509) +++ stable/10/sys/dev/ciss/ciss.c Tue Apr 15 17:49:47 2014 (r264510) @@ -180,8 +180,6 @@ static int ciss_cam_emulate(struct ciss_ static void ciss_cam_poll(struct cam_sim *sim); static void ciss_cam_complete(struct ciss_request *cr); static void ciss_cam_complete_fixup(struct ciss_softc *sc, struct ccb_scsiio *csio); -static struct cam_periph *ciss_find_periph(struct ciss_softc *sc, - int bus, int target); static int ciss_name_device(struct ciss_softc *sc, int bus, int target); /* periodic status monitoring */ @@ -3398,27 +3396,6 @@ ciss_cam_complete_fixup(struct ciss_soft /******************************************************************************** - * Find a peripheral attached at (target) - */ -static struct cam_periph * -ciss_find_periph(struct ciss_softc *sc, int bus, int target) -{ - struct cam_periph *periph; - struct cam_path *path; - int status; - - status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]), - target, 0); - if (status == CAM_REQ_CMP) { - periph = cam_periph_find(path, NULL); - xpt_free_path(path); - } else { - periph = NULL; - } - return(periph); -} - -/******************************************************************************** * Name the device at (target) * * XXX is this strictly correct? @@ -3427,12 +3404,22 @@ static int ciss_name_device(struct ciss_softc *sc, int bus, int target) { struct cam_periph *periph; + struct cam_path *path; + int status; if (CISS_IS_PHYSICAL(bus)) return (0); - if ((periph = ciss_find_periph(sc, bus, target)) != NULL) { + + status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]), + target, 0); + + if (status == CAM_REQ_CMP) { + xpt_path_lock(path); + periph = cam_periph_find(path, NULL); sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d", periph->periph_name, periph->unit_number); + xpt_path_unlock(path); + xpt_free_path(path); return(0); } sc->ciss_logical[bus][target].cl_name[0] = 0; From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 18:24:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 83F25780; Tue, 15 Apr 2014 18:24: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 6FF561BB7; Tue, 15 Apr 2014 18:24: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 s3FIOPAe068231; Tue, 15 Apr 2014 18:24:25 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FIOPgl068230; Tue, 15 Apr 2014 18:24:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404151824.s3FIOPgl068230@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Apr 2014 18:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264512 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 18:24:25 -0000 Author: jilles Date: Tue Apr 15 18:24:24 2014 New Revision: 264512 URL: http://svnweb.freebsd.org/changeset/base/264512 Log: MFC r263846: sh: Fix memory leak when trying to set a read only variable. Modified: stable/10/bin/sh/var.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/var.c ============================================================================== --- stable/10/bin/sh/var.c Tue Apr 15 17:52:22 2014 (r264511) +++ stable/10/bin/sh/var.c Tue Apr 15 18:24:24 2014 (r264512) @@ -325,8 +325,11 @@ setvareq(char *s, int flags) mklocal(s); vp = find_var(s, &vpp, &nlen); if (vp != NULL) { - if (vp->flags & VREADONLY) + if (vp->flags & VREADONLY) { + if ((flags & (VTEXTFIXED|VSTACK)) == 0) + ckfree(s); error("%.*s: is read only", vp->name_len, s); + } if (flags & VNOSET) return; INTOFF; From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 15 18:29:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 678A690D; Tue, 15 Apr 2014 18:29: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 544C41BF0; Tue, 15 Apr 2014 18:29: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 s3FIT6c5068764; Tue, 15 Apr 2014 18:29:06 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FIT6F1068763; Tue, 15 Apr 2014 18:29:06 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404151829.s3FIT6F1068763@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Apr 2014 18:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264513 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 18:29:06 -0000 Author: jilles Date: Tue Apr 15 18:29:05 2014 New Revision: 264513 URL: http://svnweb.freebsd.org/changeset/base/264513 Log: MFC r263847: sh: Fix memory leak with an assignment before a regular builtin Modified: stable/10/bin/sh/var.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/var.c ============================================================================== --- stable/10/bin/sh/var.c Tue Apr 15 18:24:24 2014 (r264512) +++ stable/10/bin/sh/var.c Tue Apr 15 18:29:05 2014 (r264513) @@ -330,8 +330,11 @@ setvareq(char *s, int flags) ckfree(s); error("%.*s: is read only", vp->name_len, s); } - if (flags & VNOSET) + if (flags & VNOSET) { + if ((flags & (VTEXTFIXED|VSTACK)) == 0) + ckfree(s); return; + } INTOFF; if (vp->func && (flags & VNOFUNC) == 0) @@ -364,8 +367,11 @@ setvareq(char *s, int flags) return; } /* not found */ - if (flags & VNOSET) + if (flags & VNOSET) { + if ((flags & (VTEXTFIXED|VSTACK)) == 0) + ckfree(s); return; + } INTOFF; vp = ckmalloc(sizeof (*vp)); vp->flags = flags; From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 16 10:04:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9D3DE776; Wed, 16 Apr 2014 10:04: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 87A15171A; Wed, 16 Apr 2014 10:04: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 s3GA4K2q052571; Wed, 16 Apr 2014 10:04:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GA4K4u052569; Wed, 16 Apr 2014 10:04:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404161004.s3GA4K4u052569@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 Apr 2014 10:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264522 - in stable/10: share/man/man4 sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 10:04:20 -0000 Author: mav Date: Wed Apr 16 10:04:19 2014 New Revision: 264522 URL: http://svnweb.freebsd.org/changeset/base/264522 Log: MFC r264295: Remove support of LUN-based CD changers from cd(4) driver. This code was heavily broken few months ago during CAM locking changes. Fixing it would require almost complete rewrite. Since there are no known devices on market using this interface younger then ~15 years, and they are CD, not even DVD, I don't see much reason to rewrite it. This change does not mean those devices won't work. They will just work slower due to inefficient disks load/unload schedule if several LUNs accessed same time. Modified: stable/10/share/man/man4/cd.4 stable/10/sys/cam/scsi/scsi_cd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/cd.4 ============================================================================== --- stable/10/share/man/man4/cd.4 Wed Apr 16 09:25:20 2014 (r264521) +++ stable/10/share/man/man4/cd.4 Wed Apr 16 10:04:19 2014 (r264522) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd April 9, 2014 .Dt CD 4 .Os .Sh NAME @@ -33,8 +33,6 @@ .Nd SCSI CD-ROM driver .Sh SYNOPSIS .Cd device cd -.Cd "options ""CHANGER_MIN_BUSY_SECONDS=3""" -.Cd "options ""CHANGER_MAX_BUSY_SECONDS=11""" .Sh DESCRIPTION The .Nm @@ -288,65 +286,6 @@ Some work is planned to support some of the more common `broken' .Tn CD-ROM drives; however, this is not yet under way. -.Sh CHANGER OPERATION -This driver has built-in support for LUN-based CD changers. -A LUN-based CD -changer is a drive that can hold two or more CDs, but only has one CD -player mechanism. -Each CD in the drive shows up as a separate logical unit -on the -.Tn SCSI -bus. -The -.Nm -driver automatically recognizes LUN-based changers, and routes commands for -changers through an internal scheduler. -The scheduler prevents changer -"thrashing", which is caused by sending commands to different LUNs in the -changer at the same time. -.Pp -The scheduler honors minimum and maximum time -quanta that the driver will spend on a particular LUN. -The minimum time -is the guaranteed minimum amount of time that the driver will spend on a -given LUN, even if there is no outstanding I/O for that LUN. -The maximum -time is the maximum amount of time the changer will spend on a LUN if there -is outstanding I/O for another LUN. -If there is no outstanding I/O for -another LUN, the driver will allow indefinite access to a given LUN. -.Pp -The minimum and maximum time quanta are configurable via kernel options and -also via sysctl and kernel tunable variables. -The kernel options are: -.Pp -.Bl -item -compact -.It -.Cd "options ""CHANGER_MIN_BUSY_SECONDS=3""" -.It -.Cd "options ""CHANGER_MAX_BUSY_SECONDS=11""" -.El -.Pp -The sysctl/kernel tunable variables are: -.Pp -.Bl -item -compact -.It -.Va kern.cam.cd.changer.min_busy_seconds -.It -.Va kern.cam.cd.changer.max_busy_seconds -.El -.Pp -It is suggested that the user try experimenting with the minimum and -maximum timeouts via the sysctl variables to arrive at the proper values -for your changer. -Once you have settled on the proper timeouts for your -changer, you can then put them in your kernel config file. -.Pp -If your system does have a LUN-based changer, you may notice that the -probe messages for the various LUNs of the changer will continue to appear -while the boot process is going on. -This is normal, and is caused by the -changer scheduling code. .Sh SYSCTL VARIABLES The following variables are available as both .Xr sysctl 8 @@ -397,12 +336,6 @@ Valid minimum command sizes are 6 and 10. Any value above 6 will be rounded to 10, and any value below 6 will be rounded to 6. -.It kern.cam.cd.changer.min_busy_seconds -.It kern.cam.cd.changer.max_busy_seconds -.Pp -Tune how long individual LUNs are 'locked' for I/O operations to -optimize changer operation. -See CHANGER OPERATION section for information on how to use these items. .El .Sh FILES .Bl -tag -width /dev/cd[0-9][a-h] -compact @@ -437,21 +370,3 @@ were poorly chosen, and a number of spel the names of the .Fn ioctl commands. -.Pp -There is no mechanism currently to set different minimum and maximum -timeouts for different CD changers; the timeout values set by the kernel -options or the sysctl variables apply to all LUN-based CD changers in the -system. -It is possible to implement such support, but the sysctl -implementation at least would be rather inelegant, because of the current -inability of the sysctl code to handle the addition of nodes after compile -time. -Thus, it would take one dynamically sized sysctl variable and a -userland utility to get/set the timeout values. -Implementation of separate -timeouts for different CD devices in the kernel config file would likely -require modification of -.Xr config 8 -to support the two timeouts when hardwiring -.Nm -devices. Modified: stable/10/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_cd.c Wed Apr 16 09:25:20 2014 (r264521) +++ stable/10/sys/cam/scsi/scsi_cd.c Wed Apr 16 10:04:19 2014 (r264522) @@ -87,8 +87,6 @@ typedef enum { CD_Q_NONE = 0x00, CD_Q_NO_TOUCH = 0x01, CD_Q_BCD_TRACKS = 0x02, - CD_Q_NO_CHANGER = 0x04, - CD_Q_CHANGER = 0x08, CD_Q_10_BYTE_ONLY = 0x10 } cd_quirks; @@ -96,8 +94,6 @@ typedef enum { "\020" \ "\001NO_TOUCH" \ "\002BCD_TRACKS" \ - "\003NO_CHANGER" \ - "\004CHANGER" \ "\00510_BYTE_ONLY" typedef enum { @@ -106,7 +102,6 @@ typedef enum { CD_FLAG_DISC_LOCKED = 0x0004, CD_FLAG_DISC_REMOVABLE = 0x0008, CD_FLAG_SAW_MEDIA = 0x0010, - CD_FLAG_CHANGER = 0x0040, CD_FLAG_ACTIVE = 0x0080, CD_FLAG_SCHED_ON_COMP = 0x0100, CD_FLAG_RETRY_UA = 0x0200, @@ -123,13 +118,6 @@ typedef enum { CD_CCB_RETRY_UA = 0x10 } cd_ccb_state; -typedef enum { - CHANGER_TIMEOUT_SCHED = 0x01, - CHANGER_SHORT_TMOUT_SCHED = 0x02, - CHANGER_MANUAL_CALL = 0x04, - CHANGER_NEED_TIMEOUT = 0x08 -} cd_changer_flags; - #define ccb_state ppriv_field0 #define ccb_bp ppriv_ptr1 @@ -157,9 +145,6 @@ struct cd_softc { struct cd_params params; union ccb saved_ccb; cd_quirks quirks; - STAILQ_ENTRY(cd_softc) changer_links; - struct cdchanger *changer; - int bufs_left; struct cam_periph *periph; int minimum_command_size; int outstanding_cmds; @@ -189,13 +174,6 @@ struct cd_quirk_entry { }; /* - * The changer quirk entries aren't strictly necessary. Basically, what - * they do is tell cdregister() up front that a device is a changer. - * Otherwise, it will figure that fact out once it sees a LUN on the device - * that is greater than 0. If it is known up front that a device is a changer, - * all I/O to the device will go through the changer scheduling routines, as - * opposed to the "normal" CD code. - * * NOTE ON 10_BYTE_ONLY quirks: Any 10_BYTE_ONLY quirks MUST be because * your device hangs when it gets a 10 byte command. Adding a quirk just * to get rid of the informative diagnostic message is not acceptable. All @@ -209,18 +187,6 @@ struct cd_quirk_entry { static struct cd_quirk_entry cd_quirk_table[] = { { - { T_CDROM, SIP_MEDIA_REMOVABLE, "NRC", "MBR-7", "*"}, - /*quirks*/ CD_Q_CHANGER - }, - { - { T_CDROM, SIP_MEDIA_REMOVABLE, "PIONEER", "CD-ROM DRM*", - "*"}, /* quirks */ CD_Q_CHANGER - }, - { - { T_CDROM, SIP_MEDIA_REMOVABLE, "NAKAMICH", "MJ-*", "*"}, - /* quirks */ CD_Q_CHANGER - }, - { { T_CDROM, SIP_MEDIA_REMOVABLE, "CHINON", "CD-ROM CDS-535","*"}, /* quirks */ CD_Q_BCD_TRACKS } @@ -241,15 +207,11 @@ static void cdasync(void *callback_arg, static int cdcmdsizesysctl(SYSCTL_HANDLER_ARGS); static void cdshorttimeout(void *arg); static void cdschedule(struct cam_periph *periph, int priority); -static void cdrunchangerqueue(void *arg); -static void cdchangerschedule(struct cd_softc *softc); static int cdrunccb(union ccb *ccb, int (*error_routine)(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags), u_int32_t cam_flags, u_int32_t sense_flags); -static union ccb *cdgetccb(struct cam_periph *periph, - u_int32_t priority); static void cddone(struct cam_periph *periph, union ccb *start_ccb); static union cd_pages *cdgetpage(struct cd_mode_params *mode_params); @@ -311,22 +273,12 @@ PERIPHDRIVER_DECLARE(cd, cddriver); #ifndef CD_DEFAULT_TIMEOUT #define CD_DEFAULT_TIMEOUT 30000 #endif -#ifndef CHANGER_MIN_BUSY_SECONDS -#define CHANGER_MIN_BUSY_SECONDS 5 -#endif -#ifndef CHANGER_MAX_BUSY_SECONDS -#define CHANGER_MAX_BUSY_SECONDS 15 -#endif static int cd_poll_period = CD_DEFAULT_POLL_PERIOD; static int cd_retry_count = CD_DEFAULT_RETRY; static int cd_timeout = CD_DEFAULT_TIMEOUT; -static int changer_min_busy_seconds = CHANGER_MIN_BUSY_SECONDS; -static int changer_max_busy_seconds = CHANGER_MAX_BUSY_SECONDS; static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver"); -static SYSCTL_NODE(_kern_cam_cd, OID_AUTO, changer, CTLFLAG_RD, 0, - "CD Changer"); SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RW, &cd_poll_period, 0, "Media polling period in seconds"); TUNABLE_INT("kern.cam.cd.poll_period", &cd_poll_period); @@ -336,30 +288,6 @@ TUNABLE_INT("kern.cam.cd.retry_count", & SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RW, &cd_timeout, 0, "Timeout, in us, for read operations"); TUNABLE_INT("kern.cam.cd.timeout", &cd_timeout); -SYSCTL_INT(_kern_cam_cd_changer, OID_AUTO, min_busy_seconds, CTLFLAG_RW, - &changer_min_busy_seconds, 0, "Minimum changer scheduling quantum"); -TUNABLE_INT("kern.cam.cd.changer.min_busy_seconds", &changer_min_busy_seconds); -SYSCTL_INT(_kern_cam_cd_changer, OID_AUTO, max_busy_seconds, CTLFLAG_RW, - &changer_max_busy_seconds, 0, "Maximum changer scheduling quantum"); -TUNABLE_INT("kern.cam.cd.changer.max_busy_seconds", &changer_max_busy_seconds); - -struct cdchanger { - path_id_t path_id; - target_id_t target_id; - int num_devices; - struct camq devq; - struct timeval start_time; - struct cd_softc *cur_device; - struct callout short_handle; - struct callout long_handle; - volatile cd_changer_flags flags; - STAILQ_ENTRY(cdchanger) changer_links; - STAILQ_HEAD(chdevlist, cd_softc) chluns; -}; - -static struct mtx changerq_mtx; -static STAILQ_HEAD(changerlist, cdchanger) changerq; -static int num_changers; static MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers"); @@ -368,9 +296,6 @@ cdinit(void) { cam_status status; - mtx_init(&changerq_mtx, "cdchangerq", "SCSI CD Changer List", MTX_DEF); - STAILQ_INIT(&changerq); - /* * Install a global async callback. This callback will * receive async callbacks like "new device found". @@ -417,15 +342,6 @@ cdoninvalidate(struct cam_periph *periph */ bioq_flush(&softc->bio_queue, NULL, ENXIO); - /* - * If this device is part of a changer, and it was scheduled - * to run, remove it from the run queue since we just nuked - * all of its scheduled I/O. - */ - if ((softc->flags & CD_FLAG_CHANGER) - && (softc->pinfo.index != CAM_UNQUEUED_INDEX)) - camq_remove(&softc->changer->devq, softc->pinfo.index); - disk_gone(softc->disk); } @@ -436,73 +352,6 @@ cdcleanup(struct cam_periph *periph) softc = (struct cd_softc *)periph->softc; - /* - * In the queued, non-active case, the device in question - * has already been removed from the changer run queue. Since this - * device is active, we need to de-activate it, and schedule - * another device to run. (if there is another one to run) - */ - if ((softc->flags & CD_FLAG_CHANGER) - && (softc->flags & CD_FLAG_ACTIVE)) { - - /* - * The purpose of the short timeout is soley to determine - * whether the current device has finished or not. Well, - * since we're removing the active device, we know that it - * is finished. So, get rid of the short timeout. - * Otherwise, if we're in the time period before the short - * timeout fires, and there are no other devices in the - * queue to run, there won't be any other device put in the - * active slot. i.e., when we call cdrunchangerqueue() - * below, it won't do anything. Then, when the short - * timeout fires, it'll look at the "current device", which - * we are free below, and possibly panic the kernel on a - * bogus pointer reference. - * - * The long timeout doesn't really matter, since we - * decrement the qfrozen_cnt to indicate that there is - * nothing in the active slot now. Therefore, there won't - * be any bogus pointer references there. - */ - if (softc->changer->flags & CHANGER_SHORT_TMOUT_SCHED) { - callout_stop(&softc->changer->short_handle); - softc->changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; - } - softc->changer->devq.qfrozen_cnt--; - softc->changer->flags |= CHANGER_MANUAL_CALL; - cdrunchangerqueue(softc->changer); - } - - /* - * If we're removing the last device on the changer, go ahead and - * remove the changer device structure. - */ - if ((softc->flags & CD_FLAG_CHANGER) - && (--softc->changer->num_devices == 0)) { - - /* - * Theoretically, there shouldn't be any timeouts left, but - * I'm not completely sure that that will be the case. So, - * it won't hurt to check and see if there are any left. - */ - if (softc->changer->flags & CHANGER_TIMEOUT_SCHED) { - callout_stop(&softc->changer->long_handle); - softc->changer->flags &= ~CHANGER_TIMEOUT_SCHED; - } - - if (softc->changer->flags & CHANGER_SHORT_TMOUT_SCHED) { - callout_stop(&softc->changer->short_handle); - softc->changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; - } - - mtx_lock(&changerq_mtx); - STAILQ_REMOVE(&changerq, softc->changer, cdchanger, - changer_links); - num_changers--; - mtx_unlock(&changerq_mtx); - xpt_print(periph->path, "removing changer entry\n"); - free(softc->changer, M_DEVBUF); - } cam_periph_unlock(periph); if ((softc->flags & CD_FLAG_SCTX_INIT) != 0 && sysctl_ctx_free(&softc->sysctl_ctx) != 0) { @@ -834,237 +683,16 @@ cdregister(struct cam_periph *periph, vo AC_SCSI_AEN | AC_UNIT_ATTENTION, cdasync, periph, periph->path); /* - * If the target lun is greater than 0, we most likely have a CD - * changer device. Check the quirk entries as well, though, just - * in case someone has a CD tower with one lun per drive or - * something like that. Also, if we know up front that a - * particular device is a changer, we can mark it as such starting - * with lun 0, instead of lun 1. It shouldn't be necessary to have - * a quirk entry to define something as a changer, however. - */ - if (((cgd->ccb_h.target_lun > 0) - && ((softc->quirks & CD_Q_NO_CHANGER) == 0)) - || ((softc->quirks & CD_Q_CHANGER) != 0)) { - struct cdchanger *nchanger; - struct cam_periph *nperiph; - struct cam_path *path; - cam_status status; - int found; - - /* Set the changer flag in the current device's softc */ - softc->flags |= CD_FLAG_CHANGER; - - /* - * Now, look around for an existing changer device with the - * same path and target ID as the current device. - */ - mtx_lock(&changerq_mtx); - for (found = 0, - nchanger = (struct cdchanger *)STAILQ_FIRST(&changerq); - nchanger != NULL; - nchanger = STAILQ_NEXT(nchanger, changer_links)){ - if ((nchanger->path_id == cgd->ccb_h.path_id) - && (nchanger->target_id == cgd->ccb_h.target_id)) { - found = 1; - break; - } - } - mtx_unlock(&changerq_mtx); - - /* - * If we found a matching entry, just add this device to - * the list of devices on this changer. - */ - if (found == 1) { - struct chdevlist *chlunhead; - - chlunhead = &nchanger->chluns; - - /* - * XXX KDM look at consolidating this code with the - * code below in a separate function. - */ - - /* - * Create a path with lun id 0, and see if we can - * find a matching device - */ - status = xpt_create_path(&path, /*periph*/ periph, - cgd->ccb_h.path_id, - cgd->ccb_h.target_id, 0); - - if ((status == CAM_REQ_CMP) - && ((nperiph = cam_periph_find(path, "cd")) != NULL)){ - struct cd_softc *nsoftc; - - nsoftc = (struct cd_softc *)nperiph->softc; - - if ((nsoftc->flags & CD_FLAG_CHANGER) == 0){ - nsoftc->flags |= CD_FLAG_CHANGER; - nchanger->num_devices++; - if (camq_resize(&nchanger->devq, - nchanger->num_devices)!=CAM_REQ_CMP){ - printf("cdregister: " - "camq_resize " - "failed, changer " - "support may " - "be messed up\n"); - } - nsoftc->changer = nchanger; - nsoftc->pinfo.index =CAM_UNQUEUED_INDEX; - - STAILQ_INSERT_TAIL(&nchanger->chluns, - nsoftc,changer_links); - } - xpt_free_path(path); - } else if (status == CAM_REQ_CMP) - xpt_free_path(path); - else { - printf("cdregister: unable to allocate path\n" - "cdregister: changer support may be " - "broken\n"); - } - - nchanger->num_devices++; - - softc->changer = nchanger; - softc->pinfo.index = CAM_UNQUEUED_INDEX; - - if (camq_resize(&nchanger->devq, - nchanger->num_devices) != CAM_REQ_CMP) { - printf("cdregister: camq_resize " - "failed, changer support may " - "be messed up\n"); - } - - STAILQ_INSERT_TAIL(chlunhead, softc, changer_links); - } - /* - * In this case, we don't already have an entry for this - * particular changer, so we need to create one, add it to - * the queue, and queue this device on the list for this - * changer. Before we queue this device, however, we need - * to search for lun id 0 on this target, and add it to the - * queue first, if it exists. (and if it hasn't already - * been marked as part of the changer.) - */ - else { - nchanger = malloc(sizeof(struct cdchanger), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (nchanger == NULL) { - softc->flags &= ~CD_FLAG_CHANGER; - printf("cdregister: unable to malloc " - "changer structure\ncdregister: " - "changer support disabled\n"); - - /* - * Yes, gotos can be gross but in this case - * I think it's justified.. - */ - goto cdregisterexit; - } - if (camq_init(&nchanger->devq, 1) != 0) { - softc->flags &= ~CD_FLAG_CHANGER; - printf("cdregister: changer support " - "disabled\n"); - goto cdregisterexit; - } - - nchanger->path_id = cgd->ccb_h.path_id; - nchanger->target_id = cgd->ccb_h.target_id; - - /* this is superfluous, but it makes things clearer */ - nchanger->num_devices = 0; - - STAILQ_INIT(&nchanger->chluns); - - callout_init_mtx(&nchanger->long_handle, - cam_periph_mtx(periph), 0); - callout_init_mtx(&nchanger->short_handle, - cam_periph_mtx(periph), 0); - - mtx_lock(&changerq_mtx); - num_changers++; - STAILQ_INSERT_TAIL(&changerq, nchanger, - changer_links); - mtx_unlock(&changerq_mtx); - - /* - * Create a path with lun id 0, and see if we can - * find a matching device - */ - status = xpt_create_path(&path, /*periph*/ periph, - cgd->ccb_h.path_id, - cgd->ccb_h.target_id, 0); - - /* - * If we were able to allocate the path, and if we - * find a matching device and it isn't already - * marked as part of a changer, then we add it to - * the current changer. - */ - if ((status == CAM_REQ_CMP) - && ((nperiph = cam_periph_find(path, "cd")) != NULL) - && ((((struct cd_softc *)periph->softc)->flags & - CD_FLAG_CHANGER) == 0)) { - struct cd_softc *nsoftc; - - nsoftc = (struct cd_softc *)nperiph->softc; - - nsoftc->flags |= CD_FLAG_CHANGER; - nchanger->num_devices++; - if (camq_resize(&nchanger->devq, - nchanger->num_devices) != CAM_REQ_CMP) { - printf("cdregister: camq_resize " - "failed, changer support may " - "be messed up\n"); - } - nsoftc->changer = nchanger; - nsoftc->pinfo.index = CAM_UNQUEUED_INDEX; - - STAILQ_INSERT_TAIL(&nchanger->chluns, - nsoftc, changer_links); - xpt_free_path(path); - } else if (status == CAM_REQ_CMP) - xpt_free_path(path); - else { - printf("cdregister: unable to allocate path\n" - "cdregister: changer support may be " - "broken\n"); - } - - softc->changer = nchanger; - softc->pinfo.index = CAM_UNQUEUED_INDEX; - nchanger->num_devices++; - if (camq_resize(&nchanger->devq, - nchanger->num_devices) != CAM_REQ_CMP) { - printf("cdregister: camq_resize " - "failed, changer support may " - "be messed up\n"); - } - STAILQ_INSERT_TAIL(&nchanger->chluns, softc, - changer_links); - } - } - - /* * Schedule a periodic media polling events. */ callout_init_mtx(&softc->mediapoll_c, cam_periph_mtx(periph), 0); if ((softc->flags & CD_FLAG_DISC_REMOVABLE) && - (softc->flags & CD_FLAG_CHANGER) == 0 && (cgd->inq_flags & SID_AEN) == 0 && cd_poll_period != 0) callout_reset(&softc->mediapoll_c, cd_poll_period * hz, cdmediapoll, periph); -cdregisterexit: - - if ((softc->flags & CD_FLAG_CHANGER) == 0) - xpt_schedule(periph, CAM_PRIORITY_DEV); - else - cdschedule(periph, CAM_PRIORITY_DEV); - + xpt_schedule(periph, CAM_PRIORITY_DEV); return(CAM_REQ_CMP); } @@ -1153,251 +781,6 @@ cdclose(struct disk *dp) return (0); } -static void -cdshorttimeout(void *arg) -{ - struct cdchanger *changer; - - changer = (struct cdchanger *)arg; - - /* Always clear the short timeout flag, since that's what we're in */ - changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; - - /* - * Check to see if there is any more pending or outstanding I/O for - * this device. If not, move it out of the active slot. - */ - if ((bioq_first(&changer->cur_device->bio_queue) == NULL) - && (changer->cur_device->outstanding_cmds == 0)) { - changer->flags |= CHANGER_MANUAL_CALL; - cdrunchangerqueue(changer); - } -} - -/* - * This is a wrapper for xpt_schedule. It only applies to changers. - */ -static void -cdschedule(struct cam_periph *periph, int priority) -{ - struct cd_softc *softc; - - softc = (struct cd_softc *)periph->softc; - - /* - * If this device isn't currently queued, and if it isn't - * the active device, then we queue this device and run the - * changer queue if there is no timeout scheduled to do it. - * If this device is the active device, just schedule it - * to run again. If this device is queued, there should be - * a timeout in place already that will make sure it runs. - */ - if ((softc->pinfo.index == CAM_UNQUEUED_INDEX) - && ((softc->flags & CD_FLAG_ACTIVE) == 0)) { - /* - * We don't do anything with the priority here. - * This is strictly a fifo queue. - */ - softc->pinfo.priority = CAM_PRIORITY_NORMAL; - softc->pinfo.generation = ++softc->changer->devq.generation; - camq_insert(&softc->changer->devq, (cam_pinfo *)softc); - - /* - * Since we just put a device in the changer queue, - * check and see if there is a timeout scheduled for - * this changer. If so, let the timeout handle - * switching this device into the active slot. If - * not, manually call the timeout routine to - * bootstrap things. - */ - if (((softc->changer->flags & CHANGER_TIMEOUT_SCHED)==0) - && ((softc->changer->flags & CHANGER_NEED_TIMEOUT)==0) - && ((softc->changer->flags & CHANGER_SHORT_TMOUT_SCHED)==0)){ - softc->changer->flags |= CHANGER_MANUAL_CALL; - cdrunchangerqueue(softc->changer); - } - } else if ((softc->flags & CD_FLAG_ACTIVE) - && ((softc->flags & CD_FLAG_SCHED_ON_COMP) == 0)) - xpt_schedule(periph, priority); -} - -static void -cdrunchangerqueue(void *arg) -{ - struct cd_softc *softc; - struct cdchanger *changer; - int called_from_timeout; - - changer = (struct cdchanger *)arg; - - /* - * If we have NOT been called from cdstrategy() or cddone(), and - * instead from a timeout routine, go ahead and clear the - * timeout flag. - */ - if ((changer->flags & CHANGER_MANUAL_CALL) == 0) { - changer->flags &= ~CHANGER_TIMEOUT_SCHED; - called_from_timeout = 1; - } else - called_from_timeout = 0; - - /* Always clear the manual call flag */ - changer->flags &= ~CHANGER_MANUAL_CALL; - - /* nothing to do if the queue is empty */ - if (changer->devq.entries <= 0) { - return; - } - - /* - * If the changer queue is frozen, that means we have an active - * device. - */ - if (changer->devq.qfrozen_cnt > 0) { - - /* - * We always need to reset the frozen count and clear the - * active flag. - */ - changer->devq.qfrozen_cnt--; - changer->cur_device->flags &= ~CD_FLAG_ACTIVE; - changer->cur_device->flags &= ~CD_FLAG_SCHED_ON_COMP; - - if (changer->cur_device->outstanding_cmds > 0) { - changer->cur_device->flags |= CD_FLAG_SCHED_ON_COMP; - changer->cur_device->bufs_left = - changer->cur_device->outstanding_cmds; - if (called_from_timeout) { - callout_reset(&changer->long_handle, - changer_max_busy_seconds * hz, - cdrunchangerqueue, changer); - changer->flags |= CHANGER_TIMEOUT_SCHED; - } - return; - } - - /* - * Check to see whether the current device has any I/O left - * to do. If so, requeue it at the end of the queue. If - * not, there is no need to requeue it. - */ - if (bioq_first(&changer->cur_device->bio_queue) != NULL) { - - changer->cur_device->pinfo.generation = - ++changer->devq.generation; - camq_insert(&changer->devq, - (cam_pinfo *)changer->cur_device); - } - } - - softc = (struct cd_softc *)camq_remove(&changer->devq, CAMQ_HEAD); - - changer->cur_device = softc; - - changer->devq.qfrozen_cnt++; - softc->flags |= CD_FLAG_ACTIVE; - - /* Just in case this device is waiting */ - wakeup(&softc->changer); - xpt_schedule(softc->periph, CAM_PRIORITY_NORMAL); - - /* - * Get rid of any pending timeouts, and set a flag to schedule new - * ones so this device gets its full time quantum. - */ - if (changer->flags & CHANGER_TIMEOUT_SCHED) { - callout_stop(&changer->long_handle); - changer->flags &= ~CHANGER_TIMEOUT_SCHED; - } - - if (changer->flags & CHANGER_SHORT_TMOUT_SCHED) { - callout_stop(&changer->short_handle); - changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; - } - - /* - * We need to schedule timeouts, but we only do this after the - * first transaction has completed. This eliminates the changer - * switch time. - */ - changer->flags |= CHANGER_NEED_TIMEOUT; -} - -static void -cdchangerschedule(struct cd_softc *softc) -{ - struct cdchanger *changer; - - changer = softc->changer; - - /* - * If this is a changer, and this is the current device, - * and this device has at least the minimum time quantum to - * run, see if we can switch it out. - */ - if ((softc->flags & CD_FLAG_ACTIVE) - && ((changer->flags & CHANGER_SHORT_TMOUT_SCHED) == 0) - && ((changer->flags & CHANGER_NEED_TIMEOUT) == 0)) { - /* - * We try three things here. The first is that we - * check to see whether the schedule on completion - * flag is set. If it is, we decrement the number - * of buffers left, and if it's zero, we reschedule. - * Next, we check to see whether the pending buffer - * queue is empty and whether there are no - * outstanding transactions. If so, we reschedule. - * Next, we see if the pending buffer queue is empty. - * If it is, we set the number of buffers left to - * the current active buffer count and set the - * schedule on complete flag. - */ - if (softc->flags & CD_FLAG_SCHED_ON_COMP) { - if (--softc->bufs_left == 0) { - softc->changer->flags |= - CHANGER_MANUAL_CALL; - softc->flags &= ~CD_FLAG_SCHED_ON_COMP; - cdrunchangerqueue(softc->changer); - } - } else if ((bioq_first(&softc->bio_queue) == NULL) - && (softc->outstanding_cmds == 0)) { - softc->changer->flags |= CHANGER_MANUAL_CALL; - cdrunchangerqueue(softc->changer); - } - } else if ((softc->changer->flags & CHANGER_NEED_TIMEOUT) - && (softc->flags & CD_FLAG_ACTIVE)) { - - /* - * Now that the first transaction to this - * particular device has completed, we can go ahead - * and schedule our timeouts. - */ - if ((changer->flags & CHANGER_TIMEOUT_SCHED) == 0) { - callout_reset(&changer->long_handle, - changer_max_busy_seconds * hz, - cdrunchangerqueue, changer); - changer->flags |= CHANGER_TIMEOUT_SCHED; - } else - printf("cdchangerschedule: already have a long" - " timeout!\n"); - - if ((changer->flags & CHANGER_SHORT_TMOUT_SCHED) == 0) { - callout_reset(&changer->short_handle, - changer_min_busy_seconds * hz, - cdshorttimeout, changer); - changer->flags |= CHANGER_SHORT_TMOUT_SCHED; - } else - printf("cdchangerschedule: already have a short " - "timeout!\n"); - - /* - * We just scheduled timeouts, no need to schedule - * more. - */ - changer->flags &= ~CHANGER_NEED_TIMEOUT; - - } -} - static int cdrunccb(union ccb *ccb, int (*error_routine)(union ccb *ccb, u_int32_t cam_flags, @@ -1414,50 +797,9 @@ cdrunccb(union ccb *ccb, int (*error_rou error = cam_periph_runccb(ccb, error_routine, cam_flags, sense_flags, softc->disk->d_devstat); - if (softc->flags & CD_FLAG_CHANGER) - cdchangerschedule(softc); - return(error); } -static union ccb * -cdgetccb(struct cam_periph *periph, u_int32_t priority) -{ - struct cd_softc *softc; - - softc = (struct cd_softc *)periph->softc; - - if (softc->flags & CD_FLAG_CHANGER) { - /* - * This should work the first time this device is woken up, - * but just in case it doesn't, we use a while loop. - */ - while ((softc->flags & CD_FLAG_ACTIVE) == 0) { - /* - * If this changer isn't already queued, queue it up. - */ - if (softc->pinfo.index == CAM_UNQUEUED_INDEX) { - softc->pinfo.priority = CAM_PRIORITY_NORMAL; - softc->pinfo.generation = - ++softc->changer->devq.generation; - camq_insert(&softc->changer->devq, - (cam_pinfo *)softc); - } - if (((softc->changer->flags & CHANGER_TIMEOUT_SCHED)==0) - && ((softc->changer->flags & CHANGER_NEED_TIMEOUT)==0) - && ((softc->changer->flags - & CHANGER_SHORT_TMOUT_SCHED)==0)) { - softc->changer->flags |= CHANGER_MANUAL_CALL; - cdrunchangerqueue(softc->changer); - } else - cam_periph_sleep(periph, &softc->changer, - PRIBIO, "cgticb", 0); - } - } - return(cam_periph_getccb(periph, priority)); -} - - /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include @@ -1505,14 +847,7 @@ cdstrategy(struct bio *bp) */ bioq_disksort(&softc->bio_queue, bp); - /* - * Schedule ourselves for performing the work. We do things - * differently for changers. - */ - if ((softc->flags & CD_FLAG_CHANGER) == 0) - xpt_schedule(periph, CAM_PRIORITY_NORMAL); - else - cdschedule(periph, CAM_PRIORITY_NORMAL); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); cam_periph_unlock(periph); return; @@ -1699,9 +1034,6 @@ cddone(struct cam_periph *periph, union LIST_REMOVE(&done_ccb->ccb_h, periph_links.le); softc->outstanding_cmds--; - if (softc->flags & CD_FLAG_CHANGER) - cdchangerschedule(softc); - biofinish(bp, NULL, 0); break; } @@ -1864,8 +1196,6 @@ cddone(struct cam_periph *periph, union xpt_announce_periph(periph, announce_buf); xpt_announce_quirks(periph, softc->quirks, CD_Q_BIT_STRING); - if (softc->flags & CD_FLAG_CHANGER) - cdchangerschedule(softc); /* * Create our sysctl variables, now that we know * we have successfully attached. @@ -2841,7 +2171,7 @@ cdprevent(struct cam_periph *periph, int return; } - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); scsi_prevent(&ccb->csio, /*retries*/ cd_retry_count, @@ -3021,7 +2351,7 @@ cdsize(struct cam_periph *periph, u_int3 softc = (struct cd_softc *)periph->softc; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); /* XXX Should be M_WAITOK */ rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), @@ -3266,9 +2596,6 @@ cdmediapoll(void *arg) struct cam_periph *periph = arg; struct cd_softc *softc = periph->softc; - if (softc->flags & CD_FLAG_CHANGER) - return; - if (softc->state == CD_STATE_NORMAL && !softc->tur && softc->outstanding_cmds == 0) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { @@ -3297,7 +2624,7 @@ cdreadtoc(struct cam_periph *periph, u_i ntoc = len; error = 0; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; @@ -3344,7 +2671,7 @@ cdreadsubchannel(struct cam_periph *peri error = 0; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; @@ -3396,7 +2723,7 @@ cdgetmode(struct cam_periph *periph, str *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 16 10:05:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6FDCD8D3; Wed, 16 Apr 2014 10:05: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 5BB59173B; Wed, 16 Apr 2014 10:05: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 s3GA5aE0052770; Wed, 16 Apr 2014 10:05:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GA5axE052769; Wed, 16 Apr 2014 10:05:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404161005.s3GA5axE052769@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 Apr 2014 10:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264523 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 10:05:36 -0000 Author: mav Date: Wed Apr 16 10:05:35 2014 New Revision: 264523 URL: http://svnweb.freebsd.org/changeset/base/264523 Log: MFC r264307: Fix three refcounter leaks and lock recursion they covered. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:04:19 2014 (r264522) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:05:35 2014 (r264523) @@ -1448,6 +1448,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * mtx_unlock(&cfiscsi_softc.lock); snprintf(ci->error_str, sizeof(ci->error_str), "connection not found"); ci->status = CTL_ISCSI_ERROR; + cfiscsi_target_release(ct); return; } mtx_unlock(&cfiscsi_softc.lock); @@ -2086,15 +2087,9 @@ cfiscsi_target_hold(struct cfiscsi_targe static void cfiscsi_target_release(struct cfiscsi_target *ct) { - int old; struct cfiscsi_softc *softc; softc = ct->ct_softc; - - old = ct->ct_refcount; - if (old > 1 && atomic_cmpset_int(&ct->ct_refcount, old, old - 1)) - return; - mtx_lock(&softc->lock); if (refcount_release(&ct->ct_refcount)) { TAILQ_REMOVE(&softc->targets, ct, ct_next); @@ -2271,6 +2266,7 @@ cfiscsi_lun_enable(void *arg, struct ctl tmp = strtoul(lun, NULL, 10); cfiscsi_target_set_lun(ct, tmp, lun_id); + cfiscsi_target_release(ct); return (0); } @@ -2290,8 +2286,9 @@ cfiscsi_lun_disable(void *arg, struct ct continue; if (ct->ct_luns[i] != lun_id) continue; + mtx_unlock(&softc->lock); cfiscsi_target_unset_lun(ct, i); - break; + return (0); } } mtx_unlock(&softc->lock); From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 16 14:45:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 60CC79C1; Wed, 16 Apr 2014 14:45:00 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 5056A178A; Wed, 16 Apr 2014 14:44:59 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 8103A20E7088B; Wed, 16 Apr 2014 14:44:52 +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.3 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 1157720E70886; Wed, 16 Apr 2014 14:44:47 +0000 (UTC) Message-ID: <0A192F0FA084413FA4840BDCE2F3CAA8@multiplay.co.uk> From: "Steven Hartland" To: "Alexander Motin" , , , , References: <201404161004.s3GA4K4u052569@svn.freebsd.org> Subject: Re: svn commit: r264522 - in stable/10: share/man/man4 sys/cam/scsi Date: Wed, 16 Apr 2014 15:44:43 +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-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 14:45:00 -0000 Does this need r264311 MFC'ed too mav? Regards Steve ----- Original Message ----- From: "Alexander Motin" To: ; ; ; Sent: Wednesday, April 16, 2014 11:04 AM Subject: svn commit: r264522 - in stable/10: share/man/man4 sys/cam/scsi > Author: mav > Date: Wed Apr 16 10:04:19 2014 > New Revision: 264522 > URL: http://svnweb.freebsd.org/changeset/base/264522 > > Log: > MFC r264295: > Remove support of LUN-based CD changers from cd(4) driver. > > This code was heavily broken few months ago during CAM locking changes. > Fixing it would require almost complete rewrite. Since there are no > known devices on market using this interface younger then ~15 years, and > they are CD, not even DVD, I don't see much reason to rewrite it. > > This change does not mean those devices won't work. They will just work > slower due to inefficient disks load/unload schedule if several LUNs > accessed same time. > > Modified: > stable/10/share/man/man4/cd.4 > stable/10/sys/cam/scsi/scsi_cd.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/share/man/man4/cd.4 > ============================================================================== > --- stable/10/share/man/man4/cd.4 Wed Apr 16 09:25:20 2014 (r264521) > +++ stable/10/share/man/man4/cd.4 Wed Apr 16 10:04:19 2014 (r264522) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd February 8, 2012 > +.Dd April 9, 2014 > .Dt CD 4 > .Os > .Sh NAME > @@ -33,8 +33,6 @@ > .Nd SCSI CD-ROM driver > .Sh SYNOPSIS > .Cd device cd > -.Cd "options ""CHANGER_MIN_BUSY_SECONDS=3""" > -.Cd "options ""CHANGER_MAX_BUSY_SECONDS=11""" > .Sh DESCRIPTION > The > .Nm > @@ -288,65 +286,6 @@ Some work is planned to support > some of the more common `broken' > .Tn CD-ROM > drives; however, this is not yet under way. > -.Sh CHANGER OPERATION > -This driver has built-in support for LUN-based CD changers. > -A LUN-based CD > -changer is a drive that can hold two or more CDs, but only has one CD > -player mechanism. > -Each CD in the drive shows up as a separate logical unit > -on the > -.Tn SCSI > -bus. > -The > -.Nm > -driver automatically recognizes LUN-based changers, and routes commands for > -changers through an internal scheduler. > -The scheduler prevents changer > -"thrashing", which is caused by sending commands to different LUNs in the > -changer at the same time. > -.Pp > -The scheduler honors minimum and maximum time > -quanta that the driver will spend on a particular LUN. > -The minimum time > -is the guaranteed minimum amount of time that the driver will spend on a > -given LUN, even if there is no outstanding I/O for that LUN. > -The maximum > -time is the maximum amount of time the changer will spend on a LUN if there > -is outstanding I/O for another LUN. > -If there is no outstanding I/O for > -another LUN, the driver will allow indefinite access to a given LUN. > -.Pp > -The minimum and maximum time quanta are configurable via kernel options and > -also via sysctl and kernel tunable variables. > -The kernel options are: > -.Pp > -.Bl -item -compact > -.It > -.Cd "options ""CHANGER_MIN_BUSY_SECONDS=3""" > -.It > -.Cd "options ""CHANGER_MAX_BUSY_SECONDS=11""" > -.El > -.Pp > -The sysctl/kernel tunable variables are: > -.Pp > -.Bl -item -compact > -.It > -.Va kern.cam.cd.changer.min_busy_seconds > -.It > -.Va kern.cam.cd.changer.max_busy_seconds > -.El > -.Pp > -It is suggested that the user try experimenting with the minimum and > -maximum timeouts via the sysctl variables to arrive at the proper values > -for your changer. > -Once you have settled on the proper timeouts for your > -changer, you can then put them in your kernel config file. > -.Pp > -If your system does have a LUN-based changer, you may notice that the > -probe messages for the various LUNs of the changer will continue to appear > -while the boot process is going on. > -This is normal, and is caused by the > -changer scheduling code. > .Sh SYSCTL VARIABLES > The following variables are available as both > .Xr sysctl 8 > @@ -397,12 +336,6 @@ Valid minimum command sizes > are 6 and 10. > Any value above 6 will be rounded to 10, and any value below > 6 will be rounded to 6. > -.It kern.cam.cd.changer.min_busy_seconds > -.It kern.cam.cd.changer.max_busy_seconds > -.Pp > -Tune how long individual LUNs are 'locked' for I/O operations to > -optimize changer operation. > -See CHANGER OPERATION section for information on how to use these items. > .El > .Sh FILES > .Bl -tag -width /dev/cd[0-9][a-h] -compact > @@ -437,21 +370,3 @@ were poorly chosen, and a number of spel > the names of the > .Fn ioctl > commands. > -.Pp > -There is no mechanism currently to set different minimum and maximum > -timeouts for different CD changers; the timeout values set by the kernel > -options or the sysctl variables apply to all LUN-based CD changers in the > -system. > -It is possible to implement such support, but the sysctl > -implementation at least would be rather inelegant, because of the current > -inability of the sysctl code to handle the addition of nodes after compile > -time. > -Thus, it would take one dynamically sized sysctl variable and a > -userland utility to get/set the timeout values. > -Implementation of separate > -timeouts for different CD devices in the kernel config file would likely > -require modification of > -.Xr config 8 > -to support the two timeouts when hardwiring > -.Nm > -devices. > > Modified: stable/10/sys/cam/scsi/scsi_cd.c > ============================================================================== > --- stable/10/sys/cam/scsi/scsi_cd.c Wed Apr 16 09:25:20 2014 (r264521) > +++ stable/10/sys/cam/scsi/scsi_cd.c Wed Apr 16 10:04:19 2014 (r264522) > @@ -87,8 +87,6 @@ typedef enum { > CD_Q_NONE = 0x00, > CD_Q_NO_TOUCH = 0x01, > CD_Q_BCD_TRACKS = 0x02, > - CD_Q_NO_CHANGER = 0x04, > - CD_Q_CHANGER = 0x08, > CD_Q_10_BYTE_ONLY = 0x10 > } cd_quirks; > > @@ -96,8 +94,6 @@ typedef enum { > "\020" \ > "\001NO_TOUCH" \ > "\002BCD_TRACKS" \ > - "\003NO_CHANGER" \ > - "\004CHANGER" \ > "\00510_BYTE_ONLY" > > typedef enum { > @@ -106,7 +102,6 @@ typedef enum { > CD_FLAG_DISC_LOCKED = 0x0004, > CD_FLAG_DISC_REMOVABLE = 0x0008, > CD_FLAG_SAW_MEDIA = 0x0010, > - CD_FLAG_CHANGER = 0x0040, > CD_FLAG_ACTIVE = 0x0080, > CD_FLAG_SCHED_ON_COMP = 0x0100, > CD_FLAG_RETRY_UA = 0x0200, > @@ -123,13 +118,6 @@ typedef enum { > CD_CCB_RETRY_UA = 0x10 > } cd_ccb_state; > > -typedef enum { > - CHANGER_TIMEOUT_SCHED = 0x01, > - CHANGER_SHORT_TMOUT_SCHED = 0x02, > - CHANGER_MANUAL_CALL = 0x04, > - CHANGER_NEED_TIMEOUT = 0x08 > -} cd_changer_flags; > - > #define ccb_state ppriv_field0 > #define ccb_bp ppriv_ptr1 > > @@ -157,9 +145,6 @@ struct cd_softc { > struct cd_params params; > union ccb saved_ccb; > cd_quirks quirks; > - STAILQ_ENTRY(cd_softc) changer_links; > - struct cdchanger *changer; > - int bufs_left; > struct cam_periph *periph; > int minimum_command_size; > int outstanding_cmds; > @@ -189,13 +174,6 @@ struct cd_quirk_entry { > }; > > /* > - * The changer quirk entries aren't strictly necessary. Basically, what > - * they do is tell cdregister() up front that a device is a changer. > - * Otherwise, it will figure that fact out once it sees a LUN on the device > - * that is greater than 0. If it is known up front that a device is a changer, > - * all I/O to the device will go through the changer scheduling routines, as > - * opposed to the "normal" CD code. > - * > * NOTE ON 10_BYTE_ONLY quirks: Any 10_BYTE_ONLY quirks MUST be because > * your device hangs when it gets a 10 byte command. Adding a quirk just > * to get rid of the informative diagnostic message is not acceptable. All > @@ -209,18 +187,6 @@ struct cd_quirk_entry { > static struct cd_quirk_entry cd_quirk_table[] = > { > { > - { T_CDROM, SIP_MEDIA_REMOVABLE, "NRC", "MBR-7", "*"}, > - /*quirks*/ CD_Q_CHANGER > - }, > - { > - { T_CDROM, SIP_MEDIA_REMOVABLE, "PIONEER", "CD-ROM DRM*", > - "*"}, /* quirks */ CD_Q_CHANGER > - }, > - { > - { T_CDROM, SIP_MEDIA_REMOVABLE, "NAKAMICH", "MJ-*", "*"}, > - /* quirks */ CD_Q_CHANGER > - }, > - { > { T_CDROM, SIP_MEDIA_REMOVABLE, "CHINON", "CD-ROM CDS-535","*"}, > /* quirks */ CD_Q_BCD_TRACKS > } > @@ -241,15 +207,11 @@ static void cdasync(void *callback_arg, > static int cdcmdsizesysctl(SYSCTL_HANDLER_ARGS); > static void cdshorttimeout(void *arg); > static void cdschedule(struct cam_periph *periph, int priority); > -static void cdrunchangerqueue(void *arg); > -static void cdchangerschedule(struct cd_softc *softc); > static int cdrunccb(union ccb *ccb, > int (*error_routine)(union ccb *ccb, > u_int32_t cam_flags, > u_int32_t sense_flags), > u_int32_t cam_flags, u_int32_t sense_flags); > -static union ccb *cdgetccb(struct cam_periph *periph, > - u_int32_t priority); > static void cddone(struct cam_periph *periph, > union ccb *start_ccb); > static union cd_pages *cdgetpage(struct cd_mode_params *mode_params); > @@ -311,22 +273,12 @@ PERIPHDRIVER_DECLARE(cd, cddriver); > #ifndef CD_DEFAULT_TIMEOUT > #define CD_DEFAULT_TIMEOUT 30000 > #endif > -#ifndef CHANGER_MIN_BUSY_SECONDS > -#define CHANGER_MIN_BUSY_SECONDS 5 > -#endif > -#ifndef CHANGER_MAX_BUSY_SECONDS > -#define CHANGER_MAX_BUSY_SECONDS 15 > -#endif > > static int cd_poll_period = CD_DEFAULT_POLL_PERIOD; > static int cd_retry_count = CD_DEFAULT_RETRY; > static int cd_timeout = CD_DEFAULT_TIMEOUT; > -static int changer_min_busy_seconds = CHANGER_MIN_BUSY_SECONDS; > -static int changer_max_busy_seconds = CHANGER_MAX_BUSY_SECONDS; > > static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver"); > -static SYSCTL_NODE(_kern_cam_cd, OID_AUTO, changer, CTLFLAG_RD, 0, > - "CD Changer"); > SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RW, > &cd_poll_period, 0, "Media polling period in seconds"); > TUNABLE_INT("kern.cam.cd.poll_period", &cd_poll_period); > @@ -336,30 +288,6 @@ TUNABLE_INT("kern.cam.cd.retry_count", & > SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RW, > &cd_timeout, 0, "Timeout, in us, for read operations"); > TUNABLE_INT("kern.cam.cd.timeout", &cd_timeout); > -SYSCTL_INT(_kern_cam_cd_changer, OID_AUTO, min_busy_seconds, CTLFLAG_RW, > - &changer_min_busy_seconds, 0, "Minimum changer scheduling quantum"); > -TUNABLE_INT("kern.cam.cd.changer.min_busy_seconds", &changer_min_busy_seconds); > -SYSCTL_INT(_kern_cam_cd_changer, OID_AUTO, max_busy_seconds, CTLFLAG_RW, > - &changer_max_busy_seconds, 0, "Maximum changer scheduling quantum"); > -TUNABLE_INT("kern.cam.cd.changer.max_busy_seconds", &changer_max_busy_seconds); > - > -struct cdchanger { > - path_id_t path_id; > - target_id_t target_id; > - int num_devices; > - struct camq devq; > - struct timeval start_time; > - struct cd_softc *cur_device; > - struct callout short_handle; > - struct callout long_handle; > - volatile cd_changer_flags flags; > - STAILQ_ENTRY(cdchanger) changer_links; > - STAILQ_HEAD(chdevlist, cd_softc) chluns; > -}; > - > -static struct mtx changerq_mtx; > -static STAILQ_HEAD(changerlist, cdchanger) changerq; > -static int num_changers; > > static MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers"); > > @@ -368,9 +296,6 @@ cdinit(void) > { > cam_status status; > > - mtx_init(&changerq_mtx, "cdchangerq", "SCSI CD Changer List", MTX_DEF); > - STAILQ_INIT(&changerq); > - > /* > * Install a global async callback. This callback will > * receive async callbacks like "new device found". > @@ -417,15 +342,6 @@ cdoninvalidate(struct cam_periph *periph > */ > bioq_flush(&softc->bio_queue, NULL, ENXIO); > > - /* > - * If this device is part of a changer, and it was scheduled > - * to run, remove it from the run queue since we just nuked > - * all of its scheduled I/O. > - */ > - if ((softc->flags & CD_FLAG_CHANGER) > - && (softc->pinfo.index != CAM_UNQUEUED_INDEX)) > - camq_remove(&softc->changer->devq, softc->pinfo.index); > - > disk_gone(softc->disk); > } > > @@ -436,73 +352,6 @@ cdcleanup(struct cam_periph *periph) > > softc = (struct cd_softc *)periph->softc; > > - /* > - * In the queued, non-active case, the device in question > - * has already been removed from the changer run queue. Since this > - * device is active, we need to de-activate it, and schedule > - * another device to run. (if there is another one to run) > - */ > - if ((softc->flags & CD_FLAG_CHANGER) > - && (softc->flags & CD_FLAG_ACTIVE)) { > - > - /* > - * The purpose of the short timeout is soley to determine > - * whether the current device has finished or not. Well, > - * since we're removing the active device, we know that it > - * is finished. So, get rid of the short timeout. > - * Otherwise, if we're in the time period before the short > - * timeout fires, and there are no other devices in the > - * queue to run, there won't be any other device put in the > - * active slot. i.e., when we call cdrunchangerqueue() > - * below, it won't do anything. Then, when the short > - * timeout fires, it'll look at the "current device", which > - * we are free below, and possibly panic the kernel on a > - * bogus pointer reference. > - * > - * The long timeout doesn't really matter, since we > - * decrement the qfrozen_cnt to indicate that there is > - * nothing in the active slot now. Therefore, there won't > - * be any bogus pointer references there. > - */ > - if (softc->changer->flags & CHANGER_SHORT_TMOUT_SCHED) { > - callout_stop(&softc->changer->short_handle); > - softc->changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; > - } > - softc->changer->devq.qfrozen_cnt--; > - softc->changer->flags |= CHANGER_MANUAL_CALL; > - cdrunchangerqueue(softc->changer); > - } > - > - /* > - * If we're removing the last device on the changer, go ahead and > - * remove the changer device structure. > - */ > - if ((softc->flags & CD_FLAG_CHANGER) > - && (--softc->changer->num_devices == 0)) { > - > - /* > - * Theoretically, there shouldn't be any timeouts left, but > - * I'm not completely sure that that will be the case. So, > - * it won't hurt to check and see if there are any left. > - */ > - if (softc->changer->flags & CHANGER_TIMEOUT_SCHED) { > - callout_stop(&softc->changer->long_handle); > - softc->changer->flags &= ~CHANGER_TIMEOUT_SCHED; > - } > - > - if (softc->changer->flags & CHANGER_SHORT_TMOUT_SCHED) { > - callout_stop(&softc->changer->short_handle); > - softc->changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; > - } > - > - mtx_lock(&changerq_mtx); > - STAILQ_REMOVE(&changerq, softc->changer, cdchanger, > - changer_links); > - num_changers--; > - mtx_unlock(&changerq_mtx); > - xpt_print(periph->path, "removing changer entry\n"); > - free(softc->changer, M_DEVBUF); > - } > cam_periph_unlock(periph); > if ((softc->flags & CD_FLAG_SCTX_INIT) != 0 > && sysctl_ctx_free(&softc->sysctl_ctx) != 0) { > @@ -834,237 +683,16 @@ cdregister(struct cam_periph *periph, vo > AC_SCSI_AEN | AC_UNIT_ATTENTION, cdasync, periph, periph->path); > > /* > - * If the target lun is greater than 0, we most likely have a CD > - * changer device. Check the quirk entries as well, though, just > - * in case someone has a CD tower with one lun per drive or > - * something like that. Also, if we know up front that a > - * particular device is a changer, we can mark it as such starting > - * with lun 0, instead of lun 1. It shouldn't be necessary to have > - * a quirk entry to define something as a changer, however. > - */ > - if (((cgd->ccb_h.target_lun > 0) > - && ((softc->quirks & CD_Q_NO_CHANGER) == 0)) > - || ((softc->quirks & CD_Q_CHANGER) != 0)) { > - struct cdchanger *nchanger; > - struct cam_periph *nperiph; > - struct cam_path *path; > - cam_status status; > - int found; > - > - /* Set the changer flag in the current device's softc */ > - softc->flags |= CD_FLAG_CHANGER; > - > - /* > - * Now, look around for an existing changer device with the > - * same path and target ID as the current device. > - */ > - mtx_lock(&changerq_mtx); > - for (found = 0, > - nchanger = (struct cdchanger *)STAILQ_FIRST(&changerq); > - nchanger != NULL; > - nchanger = STAILQ_NEXT(nchanger, changer_links)){ > - if ((nchanger->path_id == cgd->ccb_h.path_id) > - && (nchanger->target_id == cgd->ccb_h.target_id)) { > - found = 1; > - break; > - } > - } > - mtx_unlock(&changerq_mtx); > - > - /* > - * If we found a matching entry, just add this device to > - * the list of devices on this changer. > - */ > - if (found == 1) { > - struct chdevlist *chlunhead; > - > - chlunhead = &nchanger->chluns; > - > - /* > - * XXX KDM look at consolidating this code with the > - * code below in a separate function. > - */ > - > - /* > - * Create a path with lun id 0, and see if we can > - * find a matching device > - */ > - status = xpt_create_path(&path, /*periph*/ periph, > - cgd->ccb_h.path_id, > - cgd->ccb_h.target_id, 0); > - > - if ((status == CAM_REQ_CMP) > - && ((nperiph = cam_periph_find(path, "cd")) != NULL)){ > - struct cd_softc *nsoftc; > - > - nsoftc = (struct cd_softc *)nperiph->softc; > - > - if ((nsoftc->flags & CD_FLAG_CHANGER) == 0){ > - nsoftc->flags |= CD_FLAG_CHANGER; > - nchanger->num_devices++; > - if (camq_resize(&nchanger->devq, > - nchanger->num_devices)!=CAM_REQ_CMP){ > - printf("cdregister: " > - "camq_resize " > - "failed, changer " > - "support may " > - "be messed up\n"); > - } > - nsoftc->changer = nchanger; > - nsoftc->pinfo.index =CAM_UNQUEUED_INDEX; > - > - STAILQ_INSERT_TAIL(&nchanger->chluns, > - nsoftc,changer_links); > - } > - xpt_free_path(path); > - } else if (status == CAM_REQ_CMP) > - xpt_free_path(path); > - else { > - printf("cdregister: unable to allocate path\n" > - "cdregister: changer support may be " > - "broken\n"); > - } > - > - nchanger->num_devices++; > - > - softc->changer = nchanger; > - softc->pinfo.index = CAM_UNQUEUED_INDEX; > - > - if (camq_resize(&nchanger->devq, > - nchanger->num_devices) != CAM_REQ_CMP) { > - printf("cdregister: camq_resize " > - "failed, changer support may " > - "be messed up\n"); > - } > - > - STAILQ_INSERT_TAIL(chlunhead, softc, changer_links); > - } > - /* > - * In this case, we don't already have an entry for this > - * particular changer, so we need to create one, add it to > - * the queue, and queue this device on the list for this > - * changer. Before we queue this device, however, we need > - * to search for lun id 0 on this target, and add it to the > - * queue first, if it exists. (and if it hasn't already > - * been marked as part of the changer.) > - */ > - else { > - nchanger = malloc(sizeof(struct cdchanger), > - M_DEVBUF, M_NOWAIT | M_ZERO); > - if (nchanger == NULL) { > - softc->flags &= ~CD_FLAG_CHANGER; > - printf("cdregister: unable to malloc " > - "changer structure\ncdregister: " > - "changer support disabled\n"); > - > - /* > - * Yes, gotos can be gross but in this case > - * I think it's justified.. > - */ > - goto cdregisterexit; > - } > - if (camq_init(&nchanger->devq, 1) != 0) { > - softc->flags &= ~CD_FLAG_CHANGER; > - printf("cdregister: changer support " > - "disabled\n"); > - goto cdregisterexit; > - } > - > - nchanger->path_id = cgd->ccb_h.path_id; > - nchanger->target_id = cgd->ccb_h.target_id; > - > - /* this is superfluous, but it makes things clearer */ > - nchanger->num_devices = 0; > - > - STAILQ_INIT(&nchanger->chluns); > - > - callout_init_mtx(&nchanger->long_handle, > - cam_periph_mtx(periph), 0); > - callout_init_mtx(&nchanger->short_handle, > - cam_periph_mtx(periph), 0); > - > - mtx_lock(&changerq_mtx); > - num_changers++; > - STAILQ_INSERT_TAIL(&changerq, nchanger, > - changer_links); > - mtx_unlock(&changerq_mtx); > - > - /* > - * Create a path with lun id 0, and see if we can > - * find a matching device > - */ > - status = xpt_create_path(&path, /*periph*/ periph, > - cgd->ccb_h.path_id, > - cgd->ccb_h.target_id, 0); > - > - /* > - * If we were able to allocate the path, and if we > - * find a matching device and it isn't already > - * marked as part of a changer, then we add it to > - * the current changer. > - */ > - if ((status == CAM_REQ_CMP) > - && ((nperiph = cam_periph_find(path, "cd")) != NULL) > - && ((((struct cd_softc *)periph->softc)->flags & > - CD_FLAG_CHANGER) == 0)) { > - struct cd_softc *nsoftc; > - > - nsoftc = (struct cd_softc *)nperiph->softc; > - > - nsoftc->flags |= CD_FLAG_CHANGER; > - nchanger->num_devices++; > - if (camq_resize(&nchanger->devq, > - nchanger->num_devices) != CAM_REQ_CMP) { > - printf("cdregister: camq_resize " > - "failed, changer support may " > - "be messed up\n"); > - } > - nsoftc->changer = nchanger; > - nsoftc->pinfo.index = CAM_UNQUEUED_INDEX; > - > - STAILQ_INSERT_TAIL(&nchanger->chluns, > - nsoftc, changer_links); > - xpt_free_path(path); > - } else if (status == CAM_REQ_CMP) > - xpt_free_path(path); > - else { > - printf("cdregister: unable to allocate path\n" > - "cdregister: changer support may be " > - "broken\n"); > - } > - > - softc->changer = nchanger; > - softc->pinfo.index = CAM_UNQUEUED_INDEX; > - nchanger->num_devices++; > - if (camq_resize(&nchanger->devq, > - nchanger->num_devices) != CAM_REQ_CMP) { > - printf("cdregister: camq_resize " > - "failed, changer support may " > - "be messed up\n"); > - } > - STAILQ_INSERT_TAIL(&nchanger->chluns, softc, > - changer_links); > - } > - } > - > - /* > * Schedule a periodic media polling events. > */ > callout_init_mtx(&softc->mediapoll_c, cam_periph_mtx(periph), 0); > if ((softc->flags & CD_FLAG_DISC_REMOVABLE) && > - (softc->flags & CD_FLAG_CHANGER) == 0 && > (cgd->inq_flags & SID_AEN) == 0 && > cd_poll_period != 0) > callout_reset(&softc->mediapoll_c, cd_poll_period * hz, > cdmediapoll, periph); > > -cdregisterexit: > - > - if ((softc->flags & CD_FLAG_CHANGER) == 0) > - xpt_schedule(periph, CAM_PRIORITY_DEV); > - else > - cdschedule(periph, CAM_PRIORITY_DEV); > - > + xpt_schedule(periph, CAM_PRIORITY_DEV); > return(CAM_REQ_CMP); > } > > @@ -1153,251 +781,6 @@ cdclose(struct disk *dp) > return (0); > } > > -static void > -cdshorttimeout(void *arg) > -{ > - struct cdchanger *changer; > - > - changer = (struct cdchanger *)arg; > - > - /* Always clear the short timeout flag, since that's what we're in */ > - changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; > - > - /* > - * Check to see if there is any more pending or outstanding I/O for > - * this device. If not, move it out of the active slot. > - */ > - if ((bioq_first(&changer->cur_device->bio_queue) == NULL) > - && (changer->cur_device->outstanding_cmds == 0)) { > - changer->flags |= CHANGER_MANUAL_CALL; > - cdrunchangerqueue(changer); > - } > -} > - > -/* > - * This is a wrapper for xpt_schedule. It only applies to changers. > - */ > -static void > -cdschedule(struct cam_periph *periph, int priority) > -{ > - struct cd_softc *softc; > - > - softc = (struct cd_softc *)periph->softc; > - > - /* > - * If this device isn't currently queued, and if it isn't > - * the active device, then we queue this device and run the > - * changer queue if there is no timeout scheduled to do it. > - * If this device is the active device, just schedule it > - * to run again. If this device is queued, there should be > - * a timeout in place already that will make sure it runs. > - */ > - if ((softc->pinfo.index == CAM_UNQUEUED_INDEX) > - && ((softc->flags & CD_FLAG_ACTIVE) == 0)) { > - /* > - * We don't do anything with the priority here. > - * This is strictly a fifo queue. > - */ > - softc->pinfo.priority = CAM_PRIORITY_NORMAL; > - softc->pinfo.generation = ++softc->changer->devq.generation; > - camq_insert(&softc->changer->devq, (cam_pinfo *)softc); > - > - /* > - * Since we just put a device in the changer queue, > - * check and see if there is a timeout scheduled for > - * this changer. If so, let the timeout handle > - * switching this device into the active slot. If > - * not, manually call the timeout routine to > - * bootstrap things. > - */ > - if (((softc->changer->flags & CHANGER_TIMEOUT_SCHED)==0) > - && ((softc->changer->flags & CHANGER_NEED_TIMEOUT)==0) > - && ((softc->changer->flags & CHANGER_SHORT_TMOUT_SCHED)==0)){ > - softc->changer->flags |= CHANGER_MANUAL_CALL; > - cdrunchangerqueue(softc->changer); > - } > - } else if ((softc->flags & CD_FLAG_ACTIVE) > - && ((softc->flags & CD_FLAG_SCHED_ON_COMP) == 0)) > - xpt_schedule(periph, priority); > -} > - > -static void > -cdrunchangerqueue(void *arg) > -{ > - struct cd_softc *softc; > - struct cdchanger *changer; > - int called_from_timeout; > - > - changer = (struct cdchanger *)arg; > - > - /* > - * If we have NOT been called from cdstrategy() or cddone(), and > - * instead from a timeout routine, go ahead and clear the > - * timeout flag. > - */ > - if ((changer->flags & CHANGER_MANUAL_CALL) == 0) { > - changer->flags &= ~CHANGER_TIMEOUT_SCHED; > - called_from_timeout = 1; > - } else > - called_from_timeout = 0; > - > - /* Always clear the manual call flag */ > - changer->flags &= ~CHANGER_MANUAL_CALL; > - > - /* nothing to do if the queue is empty */ > - if (changer->devq.entries <= 0) { > - return; > - } > - > - /* > - * If the changer queue is frozen, that means we have an active > - * device. > - */ > - if (changer->devq.qfrozen_cnt > 0) { > - > - /* > - * We always need to reset the frozen count and clear the > - * active flag. > - */ > - changer->devq.qfrozen_cnt--; > - changer->cur_device->flags &= ~CD_FLAG_ACTIVE; > - changer->cur_device->flags &= ~CD_FLAG_SCHED_ON_COMP; > - > - if (changer->cur_device->outstanding_cmds > 0) { > - changer->cur_device->flags |= CD_FLAG_SCHED_ON_COMP; > - changer->cur_device->bufs_left = > - changer->cur_device->outstanding_cmds; > - if (called_from_timeout) { > - callout_reset(&changer->long_handle, > - changer_max_busy_seconds * hz, > - cdrunchangerqueue, changer); > - changer->flags |= CHANGER_TIMEOUT_SCHED; > - } > - return; > - } > - > - /* > - * Check to see whether the current device has any I/O left > - * to do. If so, requeue it at the end of the queue. If > - * not, there is no need to requeue it. > - */ > - if (bioq_first(&changer->cur_device->bio_queue) != NULL) { > - > - changer->cur_device->pinfo.generation = > - ++changer->devq.generation; > - camq_insert(&changer->devq, > - (cam_pinfo *)changer->cur_device); > - } > - } > - > - softc = (struct cd_softc *)camq_remove(&changer->devq, CAMQ_HEAD); > - > - changer->cur_device = softc; > - > - changer->devq.qfrozen_cnt++; > - softc->flags |= CD_FLAG_ACTIVE; > - > - /* Just in case this device is waiting */ > - wakeup(&softc->changer); > - xpt_schedule(softc->periph, CAM_PRIORITY_NORMAL); > - > - /* > - * Get rid of any pending timeouts, and set a flag to schedule new > - * ones so this device gets its full time quantum. > - */ > - if (changer->flags & CHANGER_TIMEOUT_SCHED) { > - callout_stop(&changer->long_handle); > - changer->flags &= ~CHANGER_TIMEOUT_SCHED; > - } > - > - if (changer->flags & CHANGER_SHORT_TMOUT_SCHED) { > - callout_stop(&changer->short_handle); > - changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; > - } > - > - /* > - * We need to schedule timeouts, but we only do this after the > - * first transaction has completed. This eliminates the changer > - * switch time. > - */ > - changer->flags |= CHANGER_NEED_TIMEOUT; > -} > - > -static void > -cdchangerschedule(struct cd_softc *softc) > -{ > - struct cdchanger *changer; > - > - changer = softc->changer; > - > - /* > - * If this is a changer, and this is the current device, > - * and this device has at least the minimum time quantum to > - * run, see if we can switch it out. > - */ > - if ((softc->flags & CD_FLAG_ACTIVE) > - && ((changer->flags & CHANGER_SHORT_TMOUT_SCHED) == 0) > - && ((changer->flags & CHANGER_NEED_TIMEOUT) == 0)) { > - /* > - * We try three things here. The first is that we > - * check to see whether the schedule on completion > - * flag is set. If it is, we decrement the number > - * of buffers left, and if it's zero, we reschedule. > - * Next, we check to see whether the pending buffer > - * queue is empty and whether there are no > - * outstanding transactions. If so, we reschedule. > - * Next, we see if the pending buffer queue is empty. > - * If it is, we set the number of buffers left to > - * the current active buffer count and set the > - * schedule on complete flag. > - */ > - if (softc->flags & CD_FLAG_SCHED_ON_COMP) { > - if (--softc->bufs_left == 0) { > - softc->changer->flags |= > - CHANGER_MANUAL_CALL; > - softc->flags &= ~CD_FLAG_SCHED_ON_COMP; > - cdrunchangerqueue(softc->changer); > - } > - } else if ((bioq_first(&softc->bio_queue) == NULL) > - && (softc->outstanding_cmds == 0)) { > - softc->changer->flags |= CHANGER_MANUAL_CALL; > - cdrunchangerqueue(softc->changer); > - } > - } else if ((softc->changer->flags & CHANGER_NEED_TIMEOUT) > - && (softc->flags & CD_FLAG_ACTIVE)) { > - > - /* > - * Now that the first transaction to this > - * particular device has completed, we can go ahead > - * and schedule our timeouts. > - */ > - if ((changer->flags & CHANGER_TIMEOUT_SCHED) == 0) { > - callout_reset(&changer->long_handle, > - changer_max_busy_seconds * hz, > - cdrunchangerqueue, changer); > - changer->flags |= CHANGER_TIMEOUT_SCHED; > - } else > - printf("cdchangerschedule: already have a long" > - " timeout!\n"); > - > - if ((changer->flags & CHANGER_SHORT_TMOUT_SCHED) == 0) { > - callout_reset(&changer->short_handle, > - changer_min_busy_seconds * hz, > - cdshorttimeout, changer); > - changer->flags |= CHANGER_SHORT_TMOUT_SCHED; > - } else > - printf("cdchangerschedule: already have a short " > - "timeout!\n"); > - > - /* > - * We just scheduled timeouts, no need to schedule > - * more. > - */ > - changer->flags &= ~CHANGER_NEED_TIMEOUT; > - > - } > -} > - > static int > cdrunccb(union ccb *ccb, int (*error_routine)(union ccb *ccb, > u_int32_t cam_flags, > @@ -1414,50 +797,9 @@ cdrunccb(union ccb *ccb, int (*error_rou > error = cam_periph_runccb(ccb, error_routine, cam_flags, sense_flags, > softc->disk->d_devstat); > > - if (softc->flags & CD_FLAG_CHANGER) > - cdchangerschedule(softc); > - > return(error); > } > > -static union ccb * > -cdgetccb(struct cam_periph *periph, u_int32_t priority) > -{ > - struct cd_softc *softc; > - > - softc = (struct cd_softc *)periph->softc; > - > - if (softc->flags & CD_FLAG_CHANGER) { > - /* > - * This should work the first time this device is woken up, > - * but just in case it doesn't, we use a while loop. > - */ > - while ((softc->flags & CD_FLAG_ACTIVE) == 0) { > - /* > - * If this changer isn't already queued, queue it up. > - */ > - if (softc->pinfo.index == CAM_UNQUEUED_INDEX) { > - softc->pinfo.priority = CAM_PRIORITY_NORMAL; > - softc->pinfo.generation = > - ++softc->changer->devq.generation; > - camq_insert(&softc->changer->devq, > - (cam_pinfo *)softc); > - } > - if (((softc->changer->flags & CHANGER_TIMEOUT_SCHED)==0) > - && ((softc->changer->flags & CHANGER_NEED_TIMEOUT)==0) > - && ((softc->changer->flags > - & CHANGER_SHORT_TMOUT_SCHED)==0)) { > - softc->changer->flags |= CHANGER_MANUAL_CALL; > - cdrunchangerqueue(softc->changer); > - } else > - cam_periph_sleep(periph, &softc->changer, > - PRIBIO, "cgticb", 0); > - } > - } > - return(cam_periph_getccb(periph, priority)); > -} > - > - > /* > * Actually translate the requested transfer into one the physical driver > * can understand. The transfer is described by a buf and will include > @@ -1505,14 +847,7 @@ cdstrategy(struct bio *bp) > */ > bioq_disksort(&softc->bio_queue, bp); > > - /* > - * Schedule ourselves for performing the work. We do things > - * differently for changers. > - */ > - if ((softc->flags & CD_FLAG_CHANGER) == 0) > - xpt_schedule(periph, CAM_PRIORITY_NORMAL); > - else > - cdschedule(periph, CAM_PRIORITY_NORMAL); > + xpt_schedule(periph, CAM_PRIORITY_NORMAL); > > cam_periph_unlock(periph); > return; > @@ -1699,9 +1034,6 @@ cddone(struct cam_periph *periph, union > LIST_REMOVE(&done_ccb->ccb_h, periph_links.le); > softc->outstanding_cmds--; > > - if (softc->flags & CD_FLAG_CHANGER) > - cdchangerschedule(softc); > - > biofinish(bp, NULL, 0); > break; > } > @@ -1864,8 +1196,6 @@ cddone(struct cam_periph *periph, union > xpt_announce_periph(periph, announce_buf); > xpt_announce_quirks(periph, softc->quirks, > CD_Q_BIT_STRING); > - if (softc->flags & CD_FLAG_CHANGER) > - cdchangerschedule(softc); > /* > * Create our sysctl variables, now that we know > * we have successfully attached. > @@ -2841,7 +2171,7 @@ cdprevent(struct cam_periph *periph, int > return; > } > > - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); > + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); > > scsi_prevent(&ccb->csio, > /*retries*/ cd_retry_count, > @@ -3021,7 +2351,7 @@ cdsize(struct cam_periph *periph, u_int3 > > softc = (struct cd_softc *)periph->softc; > > - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); > + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); > > /* XXX Should be M_WAITOK */ > rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), > @@ -3266,9 +2596,6 @@ cdmediapoll(void *arg) > struct cam_periph *periph = arg; > struct cd_softc *softc = periph->softc; > > - if (softc->flags & CD_FLAG_CHANGER) > - return; > - > if (softc->state == CD_STATE_NORMAL && !softc->tur && > softc->outstanding_cmds == 0) { > if (cam_periph_acquire(periph) == CAM_REQ_CMP) { > @@ -3297,7 +2624,7 @@ cdreadtoc(struct cam_periph *periph, u_i > ntoc = len; > error = 0; > > - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); > + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); > > csio = &ccb->csio; > > @@ -3344,7 +2671,7 @@ cdreadsubchannel(struct cam_periph *peri > > error = 0; > > - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); > + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); > > csio = &ccb->csio; > > @@ -3396,7 +2723,7 @@ cdgetmode(struct cam_periph *periph, str > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 16 15:27:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5B7D393A; Wed, 16 Apr 2014 15:27: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 47C691B65; Wed, 16 Apr 2014 15:27: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 s3GFRFSg084817; Wed, 16 Apr 2014 15:27:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GFRFEt084816; Wed, 16 Apr 2014 15:27:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404161527.s3GFRFEt084816@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 Apr 2014 15:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264541 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 15:27:15 -0000 Author: mav Date: Wed Apr 16 15:27:14 2014 New Revision: 264541 URL: http://svnweb.freebsd.org/changeset/base/264541 Log: MFC r264311 (by smh): Fix build breakage caused by r264295 Modified: stable/10/sys/cam/scsi/scsi_cd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_cd.c Wed Apr 16 14:37:11 2014 (r264540) +++ stable/10/sys/cam/scsi/scsi_cd.c Wed Apr 16 15:27:14 2014 (r264541) @@ -205,8 +205,6 @@ static periph_oninv_t cdoninvalidate; static void cdasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg); static int cdcmdsizesysctl(SYSCTL_HANDLER_ARGS); -static void cdshorttimeout(void *arg); -static void cdschedule(struct cam_periph *periph, int priority); static int cdrunccb(union ccb *ccb, int (*error_routine)(union ccb *ccb, u_int32_t cam_flags, From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 16 17:57:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 925FA45E; Wed, 16 Apr 2014 17:57: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 7EA9D1CAE; Wed, 16 Apr 2014 17:57: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 s3GHv9jX046859; Wed, 16 Apr 2014 17:57:09 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GHv9Bf046858; Wed, 16 Apr 2014 17:57:09 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201404161757.s3GHv9Bf046858@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 16 Apr 2014 17:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264546 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 17:57:09 -0000 Author: emax Date: Wed Apr 16 17:57:08 2014 New Revision: 264546 URL: http://svnweb.freebsd.org/changeset/base/264546 Log: MFC r263690 change defaule permissions on /dev/devstat. while i'm here remove D_NEEDGIANT flag Submitted by: jhb Reviewed by: jhb, scottl, rwatson, delphij, phk Modified: stable/10/sys/kern/subr_devstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_devstat.c ============================================================================== --- stable/10/sys/kern/subr_devstat.c Wed Apr 16 17:39:59 2014 (r264545) +++ stable/10/sys/kern/subr_devstat.c Wed Apr 16 17:57:08 2014 (r264546) @@ -462,7 +462,6 @@ static d_mmap_t devstat_mmap; static struct cdevsw devstat_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_mmap = devstat_mmap, .d_name = "devstat", }; @@ -484,13 +483,16 @@ devstat_mmap(struct cdev *dev, vm_ooffse if (nprot != VM_PROT_READ) return (-1); + mtx_lock(&devstat_mutex); TAILQ_FOREACH(spp, &pagelist, list) { if (offset == 0) { *paddr = vtophys(spp->stat); + mtx_unlock(&devstat_mutex); return (0); } offset -= PAGE_SIZE; } + mtx_unlock(&devstat_mutex); return (-1); } @@ -505,7 +507,7 @@ devstat_alloc(void) mtx_assert(&devstat_mutex, MA_NOTOWNED); if (!once) { make_dev_credf(MAKEDEV_ETERNAL | MAKEDEV_CHECKNAME, - &devstat_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0400, + &devstat_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0444, DEVSTAT_DEVICE_NAME); once = 1; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 16 23:12:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 38512C24; Wed, 16 Apr 2014 23:12: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 229281FF6; Wed, 16 Apr 2014 23:12: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 s3GNCacO092421; Wed, 16 Apr 2014 23:12:36 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GNCacw092416; Wed, 16 Apr 2014 23:12:36 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404162312.s3GNCacw092416@svn.freebsd.org> From: Julio Merino Date: Wed, 16 Apr 2014 23:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264572 - in stable/10: gnu/usr.bin/groff/tmac share/man/man7 tools/build/options X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 23:12:37 -0000 Author: jmmv Date: Wed Apr 16 23:12:35 2014 New Revision: 264572 URL: http://svnweb.freebsd.org/changeset/base/264572 Log: MFC several WITH_TESTS-related documentation fixes. - r258014 Document WITH_TESTS src.conf(5) option. - r263089 Fix description of WITHOUT_BMAKE's purpose. - r264408 Fix test suite name in src.conf(5). - r264410 Document how to install the test suite. - r264412 Add FreeBSD 10.1 to the list of recognized releases for Fx. - r264413 Miscellaneous fixes to tests(7). Added: stable/10/tools/build/options/WITH_TESTS - copied, changed from r258014, head/tools/build/options/WITH_TESTS Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local stable/10/share/man/man7/Makefile stable/10/share/man/man7/tests.7 stable/10/tools/build/options/WITHOUT_BMAKE Directory Properties: stable/10/ (props changed) Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- stable/10/gnu/usr.bin/groff/tmac/mdoc.local Wed Apr 16 22:26:42 2014 (r264571) +++ stable/10/gnu/usr.bin/groff/tmac/mdoc.local Wed Apr 16 23:12:35 2014 (r264572) @@ -58,6 +58,7 @@ .ds doc-operating-system-FreeBSD-9.1 9.1 .ds doc-operating-system-FreeBSD-9.2 9.2 .ds doc-operating-system-FreeBSD-10.0 10.0 +.ds doc-operating-system-FreeBSD-10.1 10.1 .ds doc-operating-system-NetBSD-7.0 7.0 . .\" Definitions not (yet) in doc-syms Modified: stable/10/share/man/man7/Makefile ============================================================================== --- stable/10/share/man/man7/Makefile Wed Apr 16 22:26:42 2014 (r264571) +++ stable/10/share/man/man7/Makefile Wed Apr 16 23:12:35 2014 (r264572) @@ -27,12 +27,9 @@ MAN= adding_user.7 \ sprog.7 \ stdint.7 \ sticky.7 \ + tests.7 \ tuning.7 -.if ${MK_TESTS} != "no" -MAN+= tests.7 -.endif - MLINKS= intro.7 miscellaneous.7 MLINKS+= security.7 securelevel.7 MLINKS+= c99.7 c.7 Modified: stable/10/share/man/man7/tests.7 ============================================================================== --- stable/10/share/man/man7/tests.7 Wed Apr 16 22:26:42 2014 (r264571) +++ stable/10/share/man/man7/tests.7 Wed Apr 16 23:12:35 2014 (r264572) @@ -26,16 +26,16 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 20, 2014 +.Dd April 13, 2014 .Dt TESTS 7 .Os .Sh NAME .Nm tests -.Nd introduction to the FreeBSD test suite +.Nd introduction to the FreeBSD Test Suite .Sh DESCRIPTION The .Fx -test suite provides a collection of automated tests for two major purposes. +Test Suite provides a collection of automated tests for two major purposes. On one hand, the test suite aids .Em developers to detect bugs and regressions when they modify the source tree. On the other @@ -50,12 +50,31 @@ maintenance. .Pp The .Fx -test suite is installed in the +Test Suite can be found in the .Pa /usr/tests hierarchy. .Pp This manual page describes how to run the test suite and how to configure some of its optional features. +.Ss Installing the test suite +The test suite is not yet installed by default as part of +.Fx , +but this is bound to change during the development of +.Fx 11.0 . +.Pp +If the +.Pa /usr/tests +directory is missing, then you will have to enable the build of the test +suite, rebuild your system and install the results. +You can do so by setting +.Sq WITH_TESTS=yes +in your +.Pa /etc/src.conf +file (see +.Xr src.conf 5 +for details) +and rebuilding the system as described in +.Xr build 7 . .Ss When to run the tests? Before diving into the details of how to run the test suite, here are some scenarios in which you should run it: @@ -129,7 +148,7 @@ to its manual page .Ss Configuring the tests Some test cases in the .Fx -test suite require manual configuration by the administrator before they can be +Test Suite require manual configuration by the administrator before they can be run. Unless certain properties are defined, the tests that require them will be skipped. .Pp @@ -141,7 +160,7 @@ The format of this file is detailed in .Pp The following configuration variables are available in the .Fx -test suite: +Test Suite: .Bl -tag -width "allow_sysctl_side_effects" .It allow_devfs_side_effects If defined, enables tests that may destroy and recreate semipermanent device @@ -192,21 +211,24 @@ Default result database used by Kyua. .It Pa /usr/tests/ Location of the .Fx -test suite. +Test Suite. .It Pa /usr/tests/Kyuafile Top-level test suite definition file. .El .Sh SEE ALSO -.Xr kyua 1 . +.Xr kyua 1 , +.Xr build 7 .Sh HISTORY -This test suite first appeared in -.Fx 11.0 . +The +.Fx +Test Suite first appeared in +.Fx 10.1 . .Pp The .Nm manual page first appeared in .Nx 6.0 and was later ported to -.Fx 11.0 . +.Fx 10.1 . .Sh AUTHORS -.An Julio Merino Aq Mt jmmv@google.com +.An Julio Merino Aq Mt jmmv@FreeBSD.org Modified: stable/10/tools/build/options/WITHOUT_BMAKE ============================================================================== --- stable/10/tools/build/options/WITHOUT_BMAKE Wed Apr 16 22:26:42 2014 (r264571) +++ stable/10/tools/build/options/WITHOUT_BMAKE Wed Apr 16 23:12:35 2014 (r264572) @@ -3,6 +3,6 @@ Set to not build and install the portabl .Xr make 1 instead of the traditional FreeBSD make. This build option is temporary. -It allows developers to switch to bmake in order to work out any remaining -kinks or issues. +It allows developers to switch to the traditional FreeBSD make in order to +work out any remaining kinks or issues. This option will be removed in due time. Copied and modified: stable/10/tools/build/options/WITH_TESTS (from r258014, head/tools/build/options/WITH_TESTS) ============================================================================== --- head/tools/build/options/WITH_TESTS Mon Nov 11 21:13:14 2013 (r258014, copy source) +++ stable/10/tools/build/options/WITH_TESTS Wed Apr 16 23:12:35 2014 (r264572) @@ -1,2 +1,7 @@ .\" $FreeBSD$ -Set to install the Kyua test suite. +Set to install the +.Fx +Test Suite. +See +.Xr tests 7 +for more details. From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 00:31:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9769AFF3; Thu, 17 Apr 2014 00:31: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 772961A7D; Thu, 17 Apr 2014 00:31: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 s3H0VLDN024990; Thu, 17 Apr 2014 00:31:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3H0VK5X024986; Thu, 17 Apr 2014 00:31:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404170031.s3H0VK5X024986@svn.freebsd.org> From: Xin LI Date: Thu, 17 Apr 2014 00:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264577 - stable/10/bin/dd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 00:31:21 -0000 Author: delphij Date: Thu Apr 17 00:31:20 2014 New Revision: 264577 URL: http://svnweb.freebsd.org/changeset/base/264577 Log: MFC r264059+264067: Implement GNU's extension of 'status' operand. The GNU syntax is borrowed where syntax status=noxfer means no transfer statistics and status=none means no status information at all. This feature is useful because the statistics information can sometimes be annoying, and redirecting stderr to /dev/null would mean error messages also gets silenced. Obtained from: OpenBSD Modified: stable/10/bin/dd/args.c stable/10/bin/dd/dd.1 stable/10/bin/dd/dd.h stable/10/bin/dd/misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/args.c ============================================================================== --- stable/10/bin/dd/args.c Thu Apr 17 00:31:02 2014 (r264576) +++ stable/10/bin/dd/args.c Thu Apr 17 00:31:20 2014 (r264577) @@ -66,6 +66,7 @@ static void f_obs(char *); static void f_of(char *); static void f_seek(char *); static void f_skip(char *); +static void f_status(char *); static uintmax_t get_num(const char *); static off_t get_off_t(const char *); @@ -88,6 +89,7 @@ static const struct arg { { "oseek", f_seek, C_SEEK, C_SEEK }, { "seek", f_seek, C_SEEK, C_SEEK }, { "skip", f_skip, C_SKIP, C_SKIP }, + { "status", f_status, C_STATUS,C_STATUS }, }; static char *oper; @@ -292,6 +294,18 @@ f_skip(char *arg) in.offset = get_off_t(arg); } +static void +f_status(char *arg) +{ + + if (strcmp(arg, "none") == 0) + ddflags |= C_NOINFO; + else if (strcmp(arg, "noxfer") == 0) + ddflags |= C_NOXFER; + else + errx(1, "unknown status %s", arg); +} + static const struct conv { const char *name; u_int set, noset; Modified: stable/10/bin/dd/dd.1 ============================================================================== --- stable/10/bin/dd/dd.1 Thu Apr 17 00:31:02 2014 (r264576) +++ stable/10/bin/dd/dd.1 Thu Apr 17 00:31:20 2014 (r264577) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd October 1, 2013 +.Dd April 2, 2014 .Dt DD 1 .Os .Sh NAME @@ -156,6 +156,17 @@ Otherwise, input data is read and discar For pipes, the correct number of bytes is read. For all other devices, the correct number of blocks is read without distinguishing between a partial or complete block being read. +.It Cm status Ns = Ns Ar value +Where +.Cm value +is one of the symbols from the following list. +.Bl -tag -width ".Cm noxfer" +.It Cm noxfer +Do not print the transfer statistics as the last line of status output. +.It Cm none +Do not print the status output. +Error messages are shown; informational messages are not. +.El .It Cm conv Ns = Ns Ar value Ns Op , Ns Ar value ... Where .Cm value @@ -410,7 +421,9 @@ utility is expected to be a superset of standard. The .Cm files -operand and the +and +.Cm status +operands and the .Cm ascii , .Cm ebcdic , .Cm ibm , Modified: stable/10/bin/dd/dd.h ============================================================================== --- stable/10/bin/dd/dd.h Thu Apr 17 00:31:02 2014 (r264576) +++ stable/10/bin/dd/dd.h Thu Apr 17 00:31:20 2014 (r264577) @@ -68,32 +68,35 @@ typedef struct { } STAT; /* Flags (in ddflags). */ -#define C_ASCII 0x00001 -#define C_BLOCK 0x00002 -#define C_BS 0x00004 -#define C_CBS 0x00008 -#define C_COUNT 0x00010 -#define C_EBCDIC 0x00020 -#define C_FILES 0x00040 -#define C_IBS 0x00080 -#define C_IF 0x00100 -#define C_LCASE 0x00200 -#define C_NOERROR 0x00400 -#define C_NOTRUNC 0x00800 -#define C_OBS 0x01000 -#define C_OF 0x02000 -#define C_OSYNC 0x04000 -#define C_PAREVEN 0x08000 -#define C_PARNONE 0x100000 -#define C_PARODD 0x200000 -#define C_PARSET 0x400000 -#define C_SEEK 0x800000 -#define C_SKIP 0x1000000 -#define C_SPARSE 0x2000000 -#define C_SWAB 0x4000000 -#define C_SYNC 0x8000000 -#define C_UCASE 0x10000000 -#define C_UNBLOCK 0x20000000 -#define C_FILL 0x40000000 +#define C_ASCII 0x00000001 +#define C_BLOCK 0x00000002 +#define C_BS 0x00000004 +#define C_CBS 0x00000008 +#define C_COUNT 0x00000010 +#define C_EBCDIC 0x00000020 +#define C_FILES 0x00000040 +#define C_IBS 0x00000080 +#define C_IF 0x00000100 +#define C_LCASE 0x00000200 +#define C_NOERROR 0x00000400 +#define C_NOTRUNC 0x00000800 +#define C_OBS 0x00001000 +#define C_OF 0x00002000 +#define C_OSYNC 0x00004000 +#define C_PAREVEN 0x00008000 +#define C_PARNONE 0x00010000 +#define C_PARODD 0x00020000 +#define C_PARSET 0x00040000 +#define C_SEEK 0x00080000 +#define C_SKIP 0x00100000 +#define C_SPARSE 0x00200000 +#define C_SWAB 0x00400000 +#define C_SYNC 0x00800000 +#define C_UCASE 0x01000000 +#define C_UNBLOCK 0x02000000 +#define C_FILL 0x04000000 +#define C_STATUS 0x08000000 +#define C_NOXFER 0x10000000 +#define C_NOINFO 0x20000000 #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) Modified: stable/10/bin/dd/misc.c ============================================================================== --- stable/10/bin/dd/misc.c Thu Apr 17 00:31:02 2014 (r264576) +++ stable/10/bin/dd/misc.c Thu Apr 17 00:31:20 2014 (r264577) @@ -59,6 +59,9 @@ summary(void) struct timeval tv; double secs; + if (ddflags & C_NOINFO) + return; + (void)gettimeofday(&tv, NULL); secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start; if (secs < 1e-6) @@ -72,9 +75,11 @@ summary(void) if (st.trunc) (void)fprintf(stderr, "%ju truncated %s\n", st.trunc, (st.trunc == 1) ? "block" : "blocks"); - (void)fprintf(stderr, - "%ju bytes transferred in %.6f secs (%.0f bytes/sec)\n", - st.bytes, secs, st.bytes / secs); + if (!(ddflags & C_NOXFER)) { + (void)fprintf(stderr, + "%ju bytes transferred in %.6f secs (%.0f bytes/sec)\n", + st.bytes, secs, st.bytes / secs); + } need_summary = 0; } From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 10:37:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4BBA556A; Thu, 17 Apr 2014 10:37: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 3839C18F0; Thu, 17 Apr 2014 10:37: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 s3HAbMJd081163; Thu, 17 Apr 2014 10:37:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HAbMnQ081162; Thu, 17 Apr 2014 10:37:22 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404171037.s3HAbMnQ081162@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Apr 2014 10:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264586 - stable/10/usr.sbin/wlandebug X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 10:37:22 -0000 Author: brueffer Date: Thu Apr 17 10:37:21 2014 New Revision: 264586 URL: http://svnweb.freebsd.org/changeset/base/264586 Log: MFC: r264315, r264316 Fix Xref order in SEE ALSO. Modified: stable/10/usr.sbin/wlandebug/wlandebug.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/wlandebug/wlandebug.8 ============================================================================== --- stable/10/usr.sbin/wlandebug/wlandebug.8 Thu Apr 17 10:27:18 2014 (r264585) +++ stable/10/usr.sbin/wlandebug/wlandebug.8 Thu Apr 17 10:37:21 2014 (r264586) @@ -153,10 +153,10 @@ The following might be used to debug bas it enables debug messages while scanning, authenticating to an access point, and associating to an access point. .Sh SEE ALSO -.Xr ifconfig 8 , -.Xr wlanstats 8 , .Xr athdebug 8 , -.Xr athstats 8 . +.Xr athstats 8 , +.Xr ifconfig 8 , +.Xr wlanstats 8 .Sh NOTES Different wireless drivers support different debugging messages. Drivers such as From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 10:43:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 217BCA16; Thu, 17 Apr 2014 10:43: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 0C54F19E0; Thu, 17 Apr 2014 10:43: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 s3HAhcsg084948; Thu, 17 Apr 2014 10:43:38 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HAhcp8084947; Thu, 17 Apr 2014 10:43:38 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404171043.s3HAhcp8084947@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Apr 2014 10:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264589 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 10:43:39 -0000 Author: brueffer Date: Thu Apr 17 10:43:38 2014 New Revision: 264589 URL: http://svnweb.freebsd.org/changeset/base/264589 Log: MFC: r264453 Correct geli parameter. PR: 188582 Submitted by: Michael Hall Modified: stable/10/share/man/man5/fstab.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man5/fstab.5 ============================================================================== --- stable/10/share/man/man5/fstab.5 Thu Apr 17 10:41:26 2014 (r264588) +++ stable/10/share/man/man5/fstab.5 Thu Apr 17 10:43:38 2014 (r264589) @@ -32,7 +32,7 @@ .\" @(#)fstab.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 10, 2013 +.Dd April 14, 2014 .Dt FSTAB 5 .Os .Sh NAME @@ -245,7 +245,7 @@ devices will cause automatic creation of The .Dq ealgo , .Dq aalgo , -.Dq keylength , +.Dq keylen , and .Dq sectorsize options may be passed to control those From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 11:49:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DC04B94C; Thu, 17 Apr 2014 11:49: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 C848610C5; Thu, 17 Apr 2014 11:49: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 s3HBnJ3i010948; Thu, 17 Apr 2014 11:49:19 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HBnJrW010947; Thu, 17 Apr 2014 11:49:19 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404171149.s3HBnJrW010947@svn.freebsd.org> From: Julio Merino Date: Thu, 17 Apr 2014 11:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264592 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 11:49:19 -0000 Author: jmmv Date: Thu Apr 17 11:49:19 2014 New Revision: 264592 URL: http://svnweb.freebsd.org/changeset/base/264592 Log: MFC r263090: Make ether_line really report an error when all input is invalid. Modified: stable/10/lib/libc/net/ether_addr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/ether_addr.c ============================================================================== --- stable/10/lib/libc/net/ether_addr.c Thu Apr 17 11:48:34 2014 (r264591) +++ stable/10/lib/libc/net/ether_addr.c Thu Apr 17 11:49:19 2014 (r264592) @@ -72,11 +72,13 @@ ether_line(const char *l, struct ether_a i = sscanf(l, "%x:%x:%x:%x:%x:%x %s", &o[0], &o[1], &o[2], &o[3], &o[4], &o[5], hostname); - if (i != 7) - return (i); - for (i=0; i<6; i++) - e->octet[i] = o[i]; - return (0); + if (i == 7) { + for (i = 0; i < 6; i++) + e->octet[i] = o[i]; + return (0); + } else { + return (-1); + } } /* From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 12:16:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0C3E572C; Thu, 17 Apr 2014 12:16: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 EA3AB13BA; Thu, 17 Apr 2014 12:16: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 s3HCGRpq023507; Thu, 17 Apr 2014 12:16:27 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HCGRJ6023506; Thu, 17 Apr 2014 12:16:27 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404171216.s3HCGRJ6023506@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 17 Apr 2014 12:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264598 - stable/10/usr.sbin/ntp/sntp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 12:16:28 -0000 Author: des Date: Thu Apr 17 12:16:27 2014 New Revision: 264598 URL: http://svnweb.freebsd.org/changeset/base/264598 Log: MFH (r262555): install the sntp(1) man page Modified: stable/10/usr.sbin/ntp/sntp/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ntp/sntp/Makefile ============================================================================== --- stable/10/usr.sbin/ntp/sntp/Makefile Thu Apr 17 12:11:00 2014 (r264597) +++ stable/10/usr.sbin/ntp/sntp/Makefile Thu Apr 17 12:16:27 2014 (r264598) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../../contrib/ntp/sntp PROG= sntp -NO_MAN= +MAN= sntp.1 SRCS= internet.c main.c socket.c timing.c unix.c CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include -I${.CURDIR}/../ \ From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 12:41:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9BDB65AB; Thu, 17 Apr 2014 12:41: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 87C901739; Thu, 17 Apr 2014 12:41: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 s3HCfC7O033210; Thu, 17 Apr 2014 12:41:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HCfCYJ033209; Thu, 17 Apr 2014 12:41:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404171241.s3HCfCYJ033209@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 17 Apr 2014 12:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264602 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 12:41:12 -0000 Author: trasz Date: Thu Apr 17 12:41:12 2014 New Revision: 264602 URL: http://svnweb.freebsd.org/changeset/base/264602 Log: MFC r262837: Make reset handling in iSCSI target RFC-compliant. This fixes some rare hangs with Open-iSCSI (Linux). Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Apr 17 12:33:26 2014 (r264601) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Apr 17 12:41:12 2014 (r264602) @@ -633,11 +633,11 @@ cfiscsi_pdu_handle_task_request(struct i #endif io->taskio.task_action = CTL_TASK_LUN_RESET; break; - case BHSTMR_FUNCTION_TARGET_COLD_RESET: + case BHSTMR_FUNCTION_TARGET_WARM_RESET: #if 0 - CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_TARGET_COLD_RESET"); + CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_TARGET_WARM_RESET"); #endif - io->taskio.task_action = CTL_TASK_BUS_RESET; + io->taskio.task_action = CTL_TASK_TARGET_RESET; break; default: CFISCSI_SESSION_DEBUG(cs, "unsupported function 0x%x", From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 12:42:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5D5266E9; Thu, 17 Apr 2014 12:42: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 2FC1C1749; Thu, 17 Apr 2014 12:42: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 s3HCggJt035956; Thu, 17 Apr 2014 12:42:42 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HCggot035955; Thu, 17 Apr 2014 12:42:42 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404171242.s3HCggot035955@svn.freebsd.org> From: Julio Merino Date: Thu, 17 Apr 2014 12:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264603 - stable/10/share/examples/tests/tests/atf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 12:42:42 -0000 Author: jmmv Date: Thu Apr 17 12:42:41 2014 New Revision: 264603 URL: http://svnweb.freebsd.org/changeset/base/264603 Log: MFC r263173: Remove unnecessary svn:executable property from source file. Modified: Directory Properties: stable/10/ (props changed) stable/10/share/examples/tests/tests/atf/cp_test.sh (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 13:10:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D366548A; Thu, 17 Apr 2014 13: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 BD32619D7; Thu, 17 Apr 2014 13: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 s3HDAU51046215; Thu, 17 Apr 2014 13:10:30 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HDAUj7046214; Thu, 17 Apr 2014 13:10:30 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404171310.s3HDAUj7046214@svn.freebsd.org> From: Julio Merino Date: Thu, 17 Apr 2014 13:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264606 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 13:10:30 -0000 Author: jmmv Date: Thu Apr 17 13:10:30 2014 New Revision: 264606 URL: http://svnweb.freebsd.org/changeset/base/264606 Log: Regen src.conf.5. Notional merge of r264409 which regenerated this manpage after the rewording of WITH_TESTS. Modified: stable/10/share/man/man5/src.conf.5 Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Thu Apr 17 13:02:59 2014 (r264605) +++ stable/10/share/man/man5/src.conf.5 Thu Apr 17 13:10:30 2014 (r264606) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des +.\" from FreeBSD: stable/10/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd March 1, 2014 +.Dd April 14, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -78,54 +78,54 @@ The following list provides a name and s that can be used for source builds. .Bl -tag -width indent .It Va WITHOUT_ACCT -.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed Set to not build process accounting tools such as .Xr accton 8 and .Xr sa 8 . .It Va WITHOUT_ACPI -.\" from FreeBSD: head/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru Set to not build .Xr acpiconf 8 , .Xr acpidump 8 and related programs. .It Va WITHOUT_AMD -.\" from FreeBSD: head/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam Set to not build .Xr amd 8 , and related programs. .It Va WITHOUT_APM -.\" from FreeBSD: head/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam Set to not build .Xr apm 8 , .Xr apmd 8 and related programs. .It Va WITHOUT_ARM_EABI -.\" from FreeBSD: head/tools/build/options/WITHOUT_ARM_EABI 253396 2013-07-16 19:15:19Z andrew +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ARM_EABI 253396 2013-07-16 19:15:19Z andrew Set the ARM ABI to OABI. .It Va WITHOUT_ASSERT_DEBUG -.\" from FreeBSD: head/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru Set to compile programs and libraries without the .Xr assert 3 checks. .It Va WITHOUT_AT -.\" from FreeBSD: head/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam Set to not build .Xr at 1 and related utilities. .It Va WITHOUT_ATM -.\" from FreeBSD: head/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru Set to not build programs and libraries related to ATM networking. .It Va WITHOUT_AUDIT -.\" from FreeBSD: head/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru Set to not build audit support into system programs. .It Va WITHOUT_AUTHPF -.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru Set to not build .Xr authpf 8 . .It Va WITHOUT_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 255974 2013-10-01 17:40:56Z emaste +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BINUTILS 255974 2013-10-01 17:40:56Z emaste Set to not install binutils (as, c++-filt, gconv, ld, nm, objcopy, objdump, readelf, size and strip). .Bf -symbolic @@ -133,34 +133,34 @@ The option does not generally work for b toolchain is enabled. .Ef .It Va WITHOUT_BLUETOOTH -.\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. .It Va WITHOUT_BMAKE -.\" from FreeBSD: head/tools/build/options/WITHOUT_BMAKE 250839 2013-05-21 00:41:49Z delphij +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BMAKE 264572 2014-04-16 23:12:35Z jmmv Set to not build and install the portable BSD make (bmake) as .Xr make 1 instead of the traditional FreeBSD make. This build option is temporary. -It allows developers to switch to bmake in order to work out any remaining -kinks or issues. +It allows developers to switch to the traditional FreeBSD make in order to +work out any remaining kinks or issues. This option will be removed in due time. .It Va WITHOUT_BOOT -.\" from FreeBSD: head/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru Set to not build the boot blocks and loader. .It Va WITHOUT_BSD_CPIO -.\" from FreeBSD: head/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . .It Va WITH_BSD_GREP -.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien +.\" from FreeBSD: stable/10/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien Install BSD-licensed grep as '[ef]grep' instead of GNU grep. .It Va WITHOUT_BSNMP -.\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam Set to not build or install .Xr bsnmpd 1 and related libraries and data files. .It Va WITHOUT_BZIP2 -.\" from FreeBSD: head/tools/build/options/WITHOUT_BZIP2 174550 2007-12-12 16:43:17Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BZIP2 174550 2007-12-12 16:43:17Z ru Set to not build contributed bzip2 software as a part of the base system. .Bf -symbolic The option has no effect yet. @@ -172,17 +172,17 @@ When set, it also enforces the following .Va WITHOUT_BZIP2_SUPPORT .El .It Va WITHOUT_BZIP2_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_BZIP2_SUPPORT 166255 2007-01-26 10:19:08Z delphij +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_BZIP2_SUPPORT 166255 2007-01-26 10:19:08Z delphij Set to build some programs without optional bzip2 support. .It Va WITHOUT_CALENDAR -.\" from FreeBSD: head/tools/build/options/WITHOUT_CALENDAR 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CALENDAR 156932 2006-03-21 07:50:50Z ru Set to not build .Xr calendar 1 . .It Va WITHOUT_CAPSICUM -.\" from FreeBSD: head/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 21:57:58Z rwatson +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 21:57:58Z rwatson Set to not build Capsicum support into system programs. .It Va WITHOUT_CDDL -.\" from FreeBSD: head/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb Set to not build code licensed under Sun's CDDL. When set, it also enforces the following options: .Pp @@ -193,7 +193,7 @@ When set, it also enforces the following .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208971 2010-06-10 06:20:26Z ed +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CLANG 208971 2010-06-10 06:20:26Z ed Set to not build the Clang C/C++ compiler. .Pp It is a default setting on @@ -207,30 +207,30 @@ When set, it also enforces the following .Va WITHOUT_CLANG_FULL .El .It Va WITH_CLANG -.\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru Set to build the Clang C/C++ compiler. .Pp It is a default setting on amd64/amd64, arm/arm, arm/armv6, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITH_CLANG_EXTRAS -.\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim +.\" from FreeBSD: stable/10/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim Set to build additional clang and llvm tools, such as bugpoint. .It Va WITHOUT_CLANG_FULL -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_FULL 246259 2013-02-02 22:28:29Z dim +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp It is a default setting on arm/arm, arm/armeb, arm/armv6, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. .It Va WITH_CLANG_FULL -.\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim +.\" from FreeBSD: stable/10/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp It is a default setting on amd64/amd64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_CLANG_IS_CC -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks Set to install the GCC compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ @@ -246,7 +246,7 @@ When set, it also enforces the following .Va WITHOUT_LLDB .El .It Va WITH_CLANG_IS_CC -.\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb +.\" from FreeBSD: stable/10/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ @@ -256,15 +256,15 @@ and It is a default setting on amd64/amd64, arm/arm, arm/armv6, i386/i386 and pc98/i386. .It Va WITHOUT_CPP -.\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build .Xr cpp 1 . .It Va WITHOUT_CROSS_COMPILER -.\" from FreeBSD: head/tools/build/options/WITHOUT_CROSS_COMPILER 250659 2013-05-15 14:30:03Z brooks +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CROSS_COMPILER 250659 2013-05-15 14:30:03Z brooks Set to not build a cross compiler in the cross-tools stage of buildworld, buildkernel, etc. .It Va WITHOUT_CRYPT -.\" from FreeBSD: head/tools/build/options/WITHOUT_CRYPT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CRYPT 156932 2006-03-21 07:50:50Z ru Set to not build any crypto code. When set, it also enforces the following options: .Pp @@ -288,17 +288,17 @@ When set, the following options are also is set explicitly) .El .It Va WITH_CTF -.\" from FreeBSD: head/tools/build/options/WITH_CTF 228159 2011-11-30 18:22:44Z fjoe +.\" from FreeBSD: stable/10/tools/build/options/WITH_CTF 228159 2011-11-30 18:22:44Z fjoe Set to compile with CTF (Compact C Type Format) data. CTF data encapsulates a reduced form of debugging information similar to DWARF and the venerable stabs and is required for DTrace. .It Va WITHOUT_CTM -.\" from FreeBSD: head/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam Set to not build .Xr ctm 1 and related utilities. .It Va WITHOUT_CXX -.\" from FreeBSD: head/tools/build/options/WITHOUT_CXX 220402 2011-04-06 20:19:07Z uqs +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_CXX 220402 2011-04-06 20:19:07Z uqs Set to not build .Xr g++ 1 and related libraries. @@ -319,7 +319,7 @@ When set, it also enforces the following .Va WITHOUT_GROFF .El .It Va WITH_DEBUG_FILES -.\" from FreeBSD: head/tools/build/options/WITH_DEBUG_FILES 251512 2013-06-07 21:40:02Z emaste +.\" from FreeBSD: stable/10/tools/build/options/WITH_DEBUG_FILES 251512 2013-06-07 21:40:02Z emaste Set to strip debug info into a separate file for each executable binary and shared library. The debug files will be placed in a subdirectory of @@ -327,40 +327,40 @@ The debug files will be placed in a subd and are located automatically by .Xr gdb 1 . .It Va WITHOUT_DICT -.\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. .It Va WITHOUT_DYNAMICROOT -.\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru Set this if you do not want to link .Pa /bin and .Pa /sbin dynamically. .It Va WITHOUT_ED_CRYPTO -.\" from FreeBSD: head/tools/build/options/WITHOUT_ED_CRYPTO 235660 2012-05-19 20:05:27Z marcel +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ED_CRYPTO 235660 2012-05-19 20:05:27Z marcel Set to build .Xr ed 1 without support for encryption/decryption. .It Va WITHOUT_EXAMPLES -.\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru Set to avoid installing examples to .Pa /usr/share/examples/ . .It Va WITHOUT_FDT -.\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru Set to not build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .Pp It is a default setting on amd64/amd64, i386/i386, ia64/ia64, pc98/i386 and sparc64/sparc64. .It Va WITH_FDT -.\" from FreeBSD: head/tools/build/options/WITH_FDT 221730 2011-05-10 11:14:40Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITH_FDT 221730 2011-05-10 11:14:40Z ru Set to build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. .Pp It is a default setting on arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_FLOPPY -.\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru Set to not build or install programs for operating floppy disk driver. .It Va WITHOUT_FMTREE @@ -368,49 +368,49 @@ for operating floppy disk driver. Set to not build and install .Pa /usr/sbin/fmtree . .It Va WITHOUT_FORMAT_EXTENSIONS -.\" from FreeBSD: head/tools/build/options/WITHOUT_FORMAT_EXTENSIONS 250658 2013-05-15 13:04:10Z brooks +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FORMAT_EXTENSIONS 250658 2013-05-15 13:04:10Z brooks Set to not enable .Fl fformat-extensions when compiling the kernel. Also disables all format checking. .It Va WITHOUT_FORTH -.\" from FreeBSD: head/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru Set to build bootloaders without Forth support. .It Va WITHOUT_FP_LIBC -.\" from FreeBSD: head/tools/build/options/WITHOUT_FP_LIBC 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FP_LIBC 156932 2006-03-21 07:50:50Z ru Set to build .Nm libc without floating-point support. .It Va WITHOUT_FREEBSD_UPDATE -.\" from FreeBSD: head/tools/build/options/WITHOUT_FREEBSD_UPDATE 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_FREEBSD_UPDATE 183242 2008-09-21 22:02:26Z sam Set to not build .Xr freebsd-update 8 . .It Va WITHOUT_GAMES -.\" from FreeBSD: head/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru Set to not build games. .It Va WITHOUT_GCC -.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC 255326 2013-09-06 20:49:48Z zeising +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GCC 255326 2013-09-06 20:49:48Z zeising Set to not build and install gcc and g++. .Pp It is a default setting on amd64/amd64, arm/arm, arm/armv6 and i386/i386. .It Va WITH_GCC -.\" from FreeBSD: head/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising +.\" from FreeBSD: stable/10/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising Set to build and install gcc and g++. .Pp It is a default setting on arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GCOV -.\" from FreeBSD: head/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru Set to not build the .Xr gcov 1 tool. .It Va WITHOUT_GDB -.\" from FreeBSD: head/tools/build/options/WITHOUT_GDB 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GDB 156932 2006-03-21 07:50:50Z ru Set to not build .Xr gdb 1 . .It Va WITHOUT_GNU -.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru Set to not build contributed GNU software as a part of the base system. This option can be useful if the system built must not contain any code covered by the GNU Public License due to legal reasons. @@ -424,36 +424,36 @@ When set, it also enforces the following .Va WITHOUT_GNU_SUPPORT .El .It Va WITHOUT_GNUCXX -.\" from FreeBSD: head/tools/build/options/WITHOUT_GNUCXX 255321 2013-09-06 20:08:03Z theraven +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GNUCXX 255321 2013-09-06 20:08:03Z theraven Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. .Pp It is a default setting on amd64/amd64, arm/arm, arm/armv6, i386/i386 and pc98/i386. .It Va WITH_GNUCXX -.\" from FreeBSD: head/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven +.\" from FreeBSD: stable/10/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven Build the GNU C++ stack (g++, libstdc++). This is the default on platforms where gcc is the system compiler. .Pp It is a default setting on arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GNU_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without optional GNU support. .It Va WITHOUT_GPIB -.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIB 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GPIB 156932 2006-03-21 07:50:50Z ru Set to not build GPIB bus support. .It Va WITHOUT_GPIO -.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIO 228081 2011-11-28 17:54:34Z dim +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GPIO 228081 2011-11-28 17:54:34Z dim Set to not build .Xr gpioctl 8 as part of the base system. .It Va WITH_GPL_DTC -.\" from FreeBSD: head/tools/build/options/WITH_GPL_DTC 246262 2013-02-02 22:42:46Z dim +.\" from FreeBSD: stable/10/tools/build/options/WITH_GPL_DTC 246262 2013-02-02 22:42:46Z dim Set to build the GPL'd version of the device tree compiler from elinux.org, instead of the BSD licensed one. .It Va WITHOUT_GROFF -.\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs Set to not build .Xr groff 1 and @@ -461,19 +461,19 @@ and You should consider installing the textproc/groff port to not break .Xr man 1 . .It Va WITHOUT_GSSAPI -.\" from FreeBSD: head/tools/build/options/WITHOUT_GSSAPI 174548 2007-12-12 16:39:32Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_GSSAPI 174548 2007-12-12 16:39:32Z ru Set to not build libgssapi. .It Va WITH_HESIOD -.\" from FreeBSD: head/tools/build/options/WITH_HESIOD 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITH_HESIOD 156932 2006-03-21 07:50:50Z ru Set to build Hesiod support. .It Va WITHOUT_HTML -.\" from FreeBSD: head/tools/build/options/WITHOUT_HTML 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_HTML 156932 2006-03-21 07:50:50Z ru Set to not build HTML docs. .It Va WITHOUT_ICONV -.\" from FreeBSD: head/tools/build/options/WITHOUT_ICONV 254919 2013-08-26 17:15:56Z antoine +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ICONV 254919 2013-08-26 17:15:56Z antoine Set to not build iconv as part of libc. .It Va WITHOUT_INET -.\" from FreeBSD: head/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz Set to not build programs and libraries related to IPv4 networking. When set, it also enforces the following options: .Pp @@ -482,7 +482,7 @@ When set, it also enforces the following .Va WITHOUT_INET_SUPPORT .El .It Va WITHOUT_INET6 -.\" from FreeBSD: head/tools/build/options/WITHOUT_INET6 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INET6 156932 2006-03-21 07:50:50Z ru Set to not build programs and libraries related to IPv6 networking. When set, it also enforces the following options: @@ -492,24 +492,24 @@ When set, it also enforces the following .Va WITHOUT_INET6_SUPPORT .El .It Va WITHOUT_INET6_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build libraries, programs, and kernel modules without IPv6 support. .It Va WITHOUT_INET_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz Set to build libraries, programs, and kernel modules without IPv4 support. .It Va WITHOUT_INFO -.\" from FreeBSD: head/tools/build/options/WITHOUT_INFO 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INFO 156932 2006-03-21 07:50:50Z ru Set to not make or install .Xr info 5 files. .It Va WITHOUT_INSTALLLIB -.\" from FreeBSD: head/tools/build/options/WITHOUT_INSTALLLIB 174497 2007-12-09 21:56:21Z dougb +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_INSTALLLIB 174497 2007-12-09 21:56:21Z dougb Set this if you do not want to install optional libraries. For example when creating a .Xr nanobsd 8 image. .It Va WITH_INSTALL_AS_USER -.\" from FreeBSD: head/tools/build/options/WITH_INSTALL_AS_USER 238021 2012-07-02 20:24:01Z marcel +.\" from FreeBSD: stable/10/tools/build/options/WITH_INSTALL_AS_USER 238021 2012-07-02 20:24:01Z marcel Set to make install targets succeed for non-root users by installing files with owner and group attributes set to that of the user running the @@ -519,13 +519,13 @@ The user still has to set the .Va DESTDIR variable to point to a directory where the user has write permissions. .It Va WITHOUT_IPFILTER -.\" from FreeBSD: head/tools/build/options/WITHOUT_IPFILTER 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_IPFILTER 156932 2006-03-21 07:50:50Z ru Set to not build IP Filter package. .It Va WITHOUT_IPFW -.\" from FreeBSD: head/tools/build/options/WITHOUT_IPFW 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_IPFW 183242 2008-09-21 22:02:26Z sam Set to not build IPFW tools. .It Va WITHOUT_IPX -.\" from FreeBSD: head/tools/build/options/WITHOUT_IPX 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_IPX 156932 2006-03-21 07:50:50Z ru Set to not build programs and libraries related to IPX networking. When set, it also enforces the following options: .Pp @@ -534,20 +534,20 @@ When set, it also enforces the following .Va WITHOUT_IPX_SUPPORT .El .It Va WITHOUT_IPX_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_IPX_SUPPORT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_IPX_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without IPX support. .It Va WITHOUT_JAIL -.\" from FreeBSD: head/tools/build/options/WITHOUT_JAIL 249966 2013-04-27 04:09:09Z eadler +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_JAIL 249966 2013-04-27 04:09:09Z eadler Set to not build tools for the support of jails; e.g., .Xr jail 8 . .It Va WITHOUT_KDUMP -.\" from FreeBSD: head/tools/build/options/WITHOUT_KDUMP 240690 2012-09-19 11:38:37Z zeising +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KDUMP 240690 2012-09-19 11:38:37Z zeising Set to not build .Xr kdump 1 and .Xr truss 1 . .It Va WITHOUT_KERBEROS -.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS 174549 2007-12-12 16:42:03Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KERBEROS 174549 2007-12-12 16:42:03Z ru Set this if you do not want to build Kerberos 5 (KTH Heimdal). When set, it also enforces the following options: .Pp @@ -565,7 +565,7 @@ When set, the following options are also is set explicitly) .El .It Va WITHOUT_KERBEROS_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS_SUPPORT 251794 2013-06-15 20:29:07Z eadler +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KERBEROS_SUPPORT 251794 2013-06-15 20:29:07Z eadler Set to build some programs without Kerberos support, like .Xr ssh 1 , .Xr telnet 1 , @@ -573,13 +573,13 @@ Set to build some programs without Kerbe and .Xr telnetd 8 . .It Va WITHOUT_KERNEL_SYMBOLS -.\" from FreeBSD: head/tools/build/options/WITHOUT_KERNEL_SYMBOLS 222189 2011-05-22 18:23:17Z imp +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KERNEL_SYMBOLS 222189 2011-05-22 18:23:17Z imp Set to not install kernel symbol files. .Bf -symbolic This option is recommended for those people who have small root partitions. .Ef .It Va WITHOUT_KVM -.\" from FreeBSD: head/tools/build/options/WITHOUT_KVM 174550 2007-12-12 16:43:17Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KVM 174550 2007-12-12 16:43:17Z ru Set to not build the .Nm libkvm library as a part of the base system. @@ -593,12 +593,12 @@ When set, it also enforces the following .Va WITHOUT_KVM_SUPPORT .El .It Va WITHOUT_KVM_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_KVM_SUPPORT 170644 2007-06-13 02:08:04Z sepotvin +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_KVM_SUPPORT 170644 2007-06-13 02:08:04Z sepotvin Set to build some programs without optional .Nm libkvm support. .It Va WITHOUT_LDNS -.\" from FreeBSD: head/tools/build/options/WITHOUT_LDNS 255591 2013-09-15 13:11:13Z des +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LDNS 255591 2013-09-15 13:11:13Z des Setting this variable will prevent the LDNS library from being built. When set, it also enforces the following options: .Pp @@ -609,27 +609,27 @@ When set, it also enforces the following .Va WITHOUT_UNBOUND .El .It Va WITHOUT_LDNS_UTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_LDNS_UTILS 255850 2013-09-24 14:33:31Z des +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LDNS_UTILS 255850 2013-09-24 14:33:31Z des Setting this variable will prevent building the LDNS utilities .Xr drill 1 and .Xr host 1 . .It Va WITHOUT_LEGACY_CONSOLE -.\" from FreeBSD: head/tools/build/options/WITHOUT_LEGACY_CONSOLE 249966 2013-04-27 04:09:09Z eadler +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LEGACY_CONSOLE 249966 2013-04-27 04:09:09Z eadler Set to not build programs that support a legacy PC console; e.g., .Xr kbdcontrol 8 and .Xr vidcontrol 8 . .It Va WITHOUT_LIB32 -.\" from FreeBSD: head/tools/build/options/WITHOUT_LIB32 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LIB32 156932 2006-03-21 07:50:50Z ru On amd64, set to not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. .It Va WITHOUT_LIBCPLUSPLUS -.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBCPLUSPLUS 246262 2013-02-02 22:42:46Z dim +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LIBCPLUSPLUS 246262 2013-02-02 22:42:46Z dim Set to avoid building libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD -.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm Set to not build the .Nm libpthread providing library, @@ -641,35 +641,35 @@ When set, it also enforces the following .Va WITHOUT_LIBTHR .El .It Va WITHOUT_LIBTHR -.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBTHR 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LIBTHR 156932 2006-03-21 07:50:50Z ru Set to not build the .Nm libthr (1:1 threading) library. .It Va WITH_LLDB -.\" from FreeBSD: head/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste +.\" from FreeBSD: stable/10/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste Set to build the LLDB debugger. .It Va WITHOUT_LOCALES -.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru Set to not build localization files; see .Xr locale 1 . .It Va WITHOUT_LOCATE -.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCATE 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LOCATE 183242 2008-09-21 22:02:26Z sam Set to not build .Xr locate 1 and related programs. .It Va WITHOUT_LPR -.\" from FreeBSD: head/tools/build/options/WITHOUT_LPR 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LPR 156932 2006-03-21 07:50:50Z ru Set to not build .Xr lpr 1 and related programs. .It Va WITHOUT_LS_COLORS -.\" from FreeBSD: head/tools/build/options/WITHOUT_LS_COLORS 235660 2012-05-19 20:05:27Z marcel +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_LS_COLORS 235660 2012-05-19 20:05:27Z marcel Set to build .Xr ls 1 without support for colors to distinguish file types. .It Va WITHOUT_MAIL -.\" from FreeBSD: head/tools/build/options/WITHOUT_MAIL 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_MAIL 183242 2008-09-21 22:02:26Z sam Set to not build any mail support (MUA or MTA). When set, it also enforces the following options: .Pp @@ -680,17 +680,17 @@ When set, it also enforces the following .Va WITHOUT_SENDMAIL .El .It Va WITHOUT_MAILWRAPPER -.\" from FreeBSD: head/tools/build/options/WITHOUT_MAILWRAPPER 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_MAILWRAPPER 156932 2006-03-21 07:50:50Z ru Set to not build the .Xr mailwrapper 8 MTA selector. .It Va WITHOUT_MAKE -.\" from FreeBSD: head/tools/build/options/WITHOUT_MAKE 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_MAKE 183242 2008-09-21 22:02:26Z sam Set to not install .Xr make 1 and related support files. .It Va WITHOUT_MAN -.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_MAN 156932 2006-03-21 07:50:50Z ru Set to not build manual pages. When set, the following options are also in effect: .Pp @@ -701,7 +701,7 @@ When set, the following options are also is set explicitly) .El .It Va WITHOUT_MAN_UTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim Set to not build utilities for manual pages, .Xr apropos 1 , .Xr catman 1 , @@ -711,7 +711,7 @@ Set to not build utilities for manual pa .Xr manctl 8 , and related support files. .It Va WITH_NAND -.\" from FreeBSD: head/tools/build/options/WITH_NAND 235537 2012-05-17 10:11:18Z gber +.\" from FreeBSD: stable/10/tools/build/options/WITH_NAND 235537 2012-05-17 10:11:18Z gber Set to build the NAND Flash components. .It Va WITHOUT_NCURSESW .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NCURSESW 262644 2014-03-01 03:11:26Z brooks @@ -719,16 +719,16 @@ Set to not build or depend on the .Nm libncursesw library. .It Va WITHOUT_NDIS -.\" from FreeBSD: head/tools/build/options/WITHOUT_NDIS 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NDIS 183242 2008-09-21 22:02:26Z sam Set to not build programs and libraries related to NDIS emulation support. .It Va WITHOUT_NETCAT -.\" from FreeBSD: head/tools/build/options/WITHOUT_NETCAT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NETCAT 156932 2006-03-21 07:50:50Z ru Set to not build .Xr nc 1 utility. .It Va WITHOUT_NETGRAPH -.\" from FreeBSD: head/tools/build/options/WITHOUT_NETGRAPH 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NETGRAPH 183242 2008-09-21 22:02:26Z sam Set to not build applications to support .Xr netgraph 4 . When set, it also enforces the following options: @@ -742,10 +742,10 @@ When set, it also enforces the following .Va WITHOUT_NETGRAPH_SUPPORT .El .It Va WITHOUT_NETGRAPH_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_NETGRAPH_SUPPORT 183305 2008-09-23 16:11:15Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NETGRAPH_SUPPORT 183305 2008-09-23 16:11:15Z sam Set to build libraries, programs, and kernel modules without netgraph support. .It Va WITHOUT_NIS -.\" from FreeBSD: head/tools/build/options/WITHOUT_NIS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NIS 156932 2006-03-21 07:50:50Z ru Set to not build .Xr NIS 8 support and related programs. @@ -755,10 +755,10 @@ and remove .Sq nis entries. .It Va WITHOUT_NLS -.\" from FreeBSD: head/tools/build/options/WITHOUT_NLS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NLS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalogs. .It Va WITHOUT_NLS_CATALOGS -.\" from FreeBSD: head/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalog support for .Xr csh 1 . .It Va WITHOUT_NMTREE @@ -772,7 +772,7 @@ By default is installed as .Xr mtree 8 . .It Va WITHOUT_NS_CACHING -.\" from FreeBSD: head/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru Set to disable name caching in the .Pa nsswitch subsystem. @@ -780,20 +780,20 @@ The generic caching daemon, .Xr nscd 8 , will not be built either if this option is set. .It Va WITHOUT_NTP -.\" from FreeBSD: head/tools/build/options/WITHOUT_NTP 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NTP 183242 2008-09-21 22:02:26Z sam Set to not build .Xr ntpd 8 and related programs. .It Va WITH_OFED -.\" from FreeBSD: head/tools/build/options/WITH_OFED 228081 2011-11-28 17:54:34Z dim +.\" from FreeBSD: stable/10/tools/build/options/WITH_OFED 228081 2011-11-28 17:54:34Z dim Set to build the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack. .It Va WITHOUT_OPENSSH -.\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSH. .It Va WITH_OPENSSH_NONE_CIPHER -.\" from FreeBSD: head/tools/build/options/WITH_OPENSSH_NONE_CIPHER 245527 2013-01-17 01:51:04Z bz +.\" from FreeBSD: stable/10/tools/build/options/WITH_OPENSSH_NONE_CIPHER 245527 2013-01-17 01:51:04Z bz Set to include the "None" cipher support in OpenSSH and its libraries. Additional adjustments may need to be done to system configuration files, such as @@ -803,7 +803,7 @@ Please see .Pa /usr/src/crypto/openssh/README.hpn for full details. .It Va WITHOUT_OPENSSL -.\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSL. When set, it also enforces the following options: .Pp @@ -825,7 +825,7 @@ When set, the following options are also is set explicitly) .El .It Va WITHOUT_PAM -.\" from FreeBSD: head/tools/build/options/WITHOUT_PAM 174550 2007-12-12 16:43:17Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PAM 174550 2007-12-12 16:43:17Z ru Set to not build PAM library and modules. .Bf -symbolic This option is deprecated and does nothing. @@ -837,18 +837,18 @@ When set, it also enforces the following .Va WITHOUT_PAM_SUPPORT .El .It Va WITHOUT_PAM_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_PAM_SUPPORT 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PAM_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without PAM support, particularly .Xr ftpd 8 and .Xr ppp 8 . .It Va WITHOUT_PC_SYSINSTALL -.\" from FreeBSD: head/tools/build/options/WITHOUT_PC_SYSINSTALL 245606 2013-01-18 15:57:09Z eadler +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PC_SYSINSTALL 245606 2013-01-18 15:57:09Z eadler Set to not build .Xr pc-sysinstall 8 and related programs. .It Va WITHOUT_PF -.\" from FreeBSD: head/tools/build/options/WITHOUT_PF 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PF 156932 2006-03-21 07:50:50Z ru Set to not build PF firewall package. When set, it also enforces the following options: .Pp @@ -862,35 +862,35 @@ Set to not build .Xr pkg 7 bootstrap tool. .It Va WITH_PKGTOOLS -.\" from FreeBSD: head/tools/build/options/WITH_PKGTOOLS 253305 2013-07-12 23:11:17Z bapt +.\" from FreeBSD: stable/10/tools/build/options/WITH_PKGTOOLS 253305 2013-07-12 23:11:17Z bapt Set to build .Xr pkg_add 8 and related programs. .It Va WITHOUT_PMC -.\" from FreeBSD: head/tools/build/options/WITHOUT_PMC 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PMC 183242 2008-09-21 22:02:26Z sam Set to not build .Xr pmccontrol 8 and related programs. .It Va WITHOUT_PORTSNAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_PORTSNAP 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PORTSNAP 183242 2008-09-21 22:02:26Z sam Set to not build or install .Xr portsnap 8 and related files. .It Va WITHOUT_PPP -.\" from FreeBSD: head/tools/build/options/WITHOUT_PPP 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PPP 183242 2008-09-21 22:02:26Z sam Set to not build .Xr ppp 8 and related programs. .It Va WITHOUT_PROFILE -.\" from FreeBSD: head/tools/build/options/WITHOUT_PROFILE 228196 2011-12-02 09:09:54Z fjoe +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PROFILE 228196 2011-12-02 09:09:54Z fjoe Set to avoid compiling profiled libraries. .It Va WITHOUT_QUOTAS -.\" from FreeBSD: head/tools/build/options/WITHOUT_QUOTAS 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_QUOTAS 183242 2008-09-21 22:02:26Z sam Set to not build .Xr quota 8 and related programs. .It Va WITHOUT_RCMDS -.\" from FreeBSD: head/tools/build/options/WITHOUT_RCMDS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_RCMDS 156932 2006-03-21 07:50:50Z ru Disable building of the .Bx r-commands. @@ -899,43 +899,43 @@ This includes .Xr rsh 1 , etc. .It Va WITHOUT_RCS -.\" from FreeBSD: head/tools/build/options/WITHOUT_RCS 256198 2013-10-09 17:07:20Z gjb +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_RCS 256198 2013-10-09 17:07:20Z gjb Set to not build .Xr rcs 1 and related utilities. .It Va WITHOUT_RESCUE -.\" from FreeBSD: head/tools/build/options/WITHOUT_RESCUE 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_RESCUE 156932 2006-03-21 07:50:50Z ru Set to not build .Xr rescue 8 . .It Va WITHOUT_ROUTED -.\" from FreeBSD: head/tools/build/options/WITHOUT_ROUTED 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ROUTED 183242 2008-09-21 22:02:26Z sam Set to not build .Xr routed 8 utility. .It Va WITHOUT_SENDMAIL -.\" from FreeBSD: head/tools/build/options/WITHOUT_SENDMAIL 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SENDMAIL 156932 2006-03-21 07:50:50Z ru Set to not build .Xr sendmail 8 and related programs. .It Va WITHOUT_SETUID_LOGIN -.\" from FreeBSD: head/tools/build/options/WITHOUT_SETUID_LOGIN 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SETUID_LOGIN 156932 2006-03-21 07:50:50Z ru Set this to disable the installation of .Xr login 1 as a set-user-ID root program. .It Va WITHOUT_SHAREDOCS -.\" from FreeBSD: head/tools/build/options/WITHOUT_SHAREDOCS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SHAREDOCS 156932 2006-03-21 07:50:50Z ru Set to not build the .Bx 4.4 legacy docs. .It Va WITH_SHARED_TOOLCHAIN -.\" from FreeBSD: head/tools/build/options/WITH_SHARED_TOOLCHAIN 235342 2012-05-12 16:12:36Z gjb +.\" from FreeBSD: stable/10/tools/build/options/WITH_SHARED_TOOLCHAIN 235342 2012-05-12 16:12:36Z gjb Set to build the toolchain binaries shared. The set includes .Xr cc 1 , .Xr make 1 and necessary utilities like assembler, linker and library archive manager. .It Va WITHOUT_SOURCELESS -.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS 230972 2012-02-04 00:54:43Z rmh +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SOURCELESS 230972 2012-02-04 00:54:43Z rmh Set to not build kernel modules that include sourceless code (either microcode or native code for host CPU). When set, it also enforces the following options: .Pp @@ -946,51 +946,59 @@ When set, it also enforces the following .Va WITHOUT_SOURCELESS_UCODE .El .It Va WITHOUT_SOURCELESS_HOST -.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_HOST 230972 2012-02-04 00:54:43Z rmh +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SOURCELESS_HOST 230972 2012-02-04 00:54:43Z rmh Set to not build kernel modules that include sourceless native code for host CPU. .It Va WITHOUT_SOURCELESS_UCODE -.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_UCODE 230972 2012-02-04 00:54:43Z rmh +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SOURCELESS_UCODE 230972 2012-02-04 00:54:43Z rmh Set to not build kernel modules that include sourceless microcode. .It Va WITHOUT_SSP -.\" from FreeBSD: head/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru Set to not build world with propolice stack smashing protection. .It Va WITH_SVN -.\" from FreeBSD: head/tools/build/options/WITH_SVN 252561 2013-07-03 12:36:47Z zeising +.\" from FreeBSD: stable/10/tools/build/options/WITH_SVN 252561 2013-07-03 12:36:47Z zeising Set to install .Xr svnlite 1 as .Xr svn 1 . .It Va WITHOUT_SVNLITE -.\" from FreeBSD: head/tools/build/options/WITHOUT_SVNLITE 252561 2013-07-03 12:36:47Z zeising +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SVNLITE 252561 2013-07-03 12:36:47Z zeising Set to not build .Xr svnlite 1 and related programs. .It Va WITHOUT_SYMVER -.\" from FreeBSD: head/tools/build/options/WITHOUT_SYMVER 169649 2007-05-17 05:03:24Z deischen +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SYMVER 169649 2007-05-17 05:03:24Z deischen Set to disable symbol versioning when building shared libraries. .It Va WITHOUT_SYSCONS -.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSCONS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SYSCONS 156932 2006-03-21 07:50:50Z ru Set to not build .Xr syscons 4 support files such as keyboard maps, fonts, and screen output maps. .It Va WITHOUT_SYSINSTALL -.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSINSTALL 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SYSINSTALL 183242 2008-09-21 22:02:26Z sam Set to not build .Xr sysinstall 8 and related programs. .It Va WITHOUT_TCSH -.\" from FreeBSD: head/tools/build/options/WITHOUT_TCSH 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TCSH 156932 2006-03-21 07:50:50Z ru Set to not build and install .Pa /bin/csh (which is .Xr tcsh 1 ) . .It Va WITHOUT_TELNET -.\" from FreeBSD: head/tools/build/options/WITHOUT_TELNET 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TELNET 183242 2008-09-21 22:02:26Z sam Set to not build .Xr telnet 8 and related programs. +.It Va WITH_TESTS +.\" from FreeBSD: stable/10/tools/build/options/WITH_TESTS 264572 2014-04-16 23:12:35Z jmmv +Set to install the +.Fx +Test Suite. +See +.Xr tests 7 +for more details. .It Va WITHOUT_TEXTPROC -.\" from FreeBSD: head/tools/build/options/WITHOUT_TEXTPROC 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TEXTPROC 183242 2008-09-21 22:02:26Z sam Set to not build programs used for text processing. When set, it also enforces the following options: @@ -1000,7 +1008,7 @@ When set, it also enforces the following .Va WITHOUT_GROFF .El .It Va WITHOUT_TOOLCHAIN -.\" from FreeBSD: head/tools/build/options/WITHOUT_TOOLCHAIN 174550 2007-12-12 16:43:17Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TOOLCHAIN 174550 2007-12-12 16:43:17Z ru Set to not install programs used for program development, compilers, debuggers etc. @@ -1024,18 +1032,18 @@ When set, it also enforces the following .Va WITHOUT_GDB .El .It Va WITHOUT_UNBOUND -.\" from FreeBSD: head/tools/build/options/WITHOUT_UNBOUND 255597 2013-09-15 14:51:23Z des +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_UNBOUND 255597 2013-09-15 14:51:23Z des Set to not build .Xr unbound 8 and related programs. .It Va WITHOUT_USB -.\" from FreeBSD: head/tools/build/options/WITHOUT_USB 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_USB 156932 2006-03-21 07:50:50Z ru Set to not build USB-related programs and libraries. .It Va WITH_USB_GADGET_EXAMPLES -.\" from FreeBSD: head/tools/build/options/WITH_USB_GADGET_EXAMPLES 254919 2013-08-26 17:15:56Z antoine +.\" from FreeBSD: stable/10/tools/build/options/WITH_USB_GADGET_EXAMPLES 254919 2013-08-26 17:15:56Z antoine Set to build USB gadget kernel modules. .It Va WITHOUT_UTMPX -.\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 231530 2012-02-11 20:28:42Z ed +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_UTMPX 231530 2012-02-11 20:28:42Z ed Set to not build user accounting tools such as .Xr last 1 , .Xr users 1 , @@ -1045,7 +1053,7 @@ Set to not build user accounting tools s and .Xr utx 8 . .It Va WITHOUT_WIRELESS -.\" from FreeBSD: head/tools/build/options/WITHOUT_WIRELESS 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_WIRELESS 183242 2008-09-21 22:02:26Z sam Set to not build programs used for 802.11 wireless networks; especially .Xr wpa_supplicant 8 and @@ -1057,21 +1065,21 @@ When set, it also enforces the following .Va WITHOUT_WIRELESS_SUPPORT .El .It Va WITHOUT_WIRELESS_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_WIRELESS_SUPPORT 183305 2008-09-23 16:11:15Z sam +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_WIRELESS_SUPPORT 183305 2008-09-23 16:11:15Z sam Set to build libraries, programs, and kernel modules without 802.11 wireless support. .It Va WITHOUT_WPA_SUPPLICANT_EAPOL -.\" from FreeBSD: head/tools/build/options/WITHOUT_WPA_SUPPLICANT_EAPOL 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_WPA_SUPPLICANT_EAPOL 156932 2006-03-21 07:50:50Z ru Build .Xr wpa_supplicant 8 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 13:11:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 341AA5C3; Thu, 17 Apr 2014 13:11: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 207431A5A; Thu, 17 Apr 2014 13:11: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 s3HDBuiP048687; Thu, 17 Apr 2014 13:11:56 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HDBupY048686; Thu, 17 Apr 2014 13:11:56 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404171311.s3HDBupY048686@svn.freebsd.org> From: Julio Merino Date: Thu, 17 Apr 2014 13:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264607 - stable/10/tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 13:11:57 -0000 Author: jmmv Date: Thu Apr 17 13:11:56 2014 New Revision: 264607 URL: http://svnweb.freebsd.org/changeset/base/264607 Log: MFC r264133: Fix variable type to avoid printf formatter warning. Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- stable/10/tests/sys/kern/unix_seqpacket_test.c Thu Apr 17 13:10:30 2014 (r264606) +++ stable/10/tests/sys/kern/unix_seqpacket_test.c Thu Apr 17 13:11:56 2014 (r264607) @@ -872,7 +872,7 @@ ATF_TC_BODY(rcvbuf_oversized, tc) { int i; int sv[2]; - const int pktsize = 1024; + const ssize_t pktsize = 1024; const size_t sndbufsize = 8192; const size_t rcvbufsize = 131072; const size_t geometric_mean_bufsize = 32768; From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 14:18:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F1C0835C; Thu, 17 Apr 2014 14:18: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 DDCE31434; Thu, 17 Apr 2014 14:18: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 s3HEIUXp075342; Thu, 17 Apr 2014 14:18:30 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HEIUQm075341; Thu, 17 Apr 2014 14:18:30 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201404171418.s3HEIUQm075341@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 17 Apr 2014 14:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264611 - stable/10/sys/dev/vt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 14:18:31 -0000 Author: ray Date: Thu Apr 17 14:18:30 2014 New Revision: 264611 URL: http://svnweb.freebsd.org/changeset/base/264611 Log: MFC r264258 Fix cursor color in reverse video mode. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/vt/vt_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Thu Apr 17 14:16:02 2014 (r264610) +++ stable/10/sys/dev/vt/vt_core.c Thu Apr 17 14:18:30 2014 (r264611) @@ -652,24 +652,26 @@ static inline void vt_determine_colors(term_char_t c, int cursor, term_color_t *fg, term_color_t *bg) { + term_color_t tmp; + int invert; + + invert = 0; *fg = TCHAR_FGCOLOR(c); if (TCHAR_FORMAT(c) & TF_BOLD) *fg = TCOLOR_LIGHT(*fg); *bg = TCHAR_BGCOLOR(c); - if (TCHAR_FORMAT(c) & TF_REVERSE) { - term_color_t tmp; + if (TCHAR_FORMAT(c) & TF_REVERSE) + invert ^= 1; + if (cursor) + invert ^= 1; + if (invert) { tmp = *fg; *fg = *bg; *bg = tmp; } - - if (cursor) { - *fg = *bg; - *bg = TC_WHITE; - } } static void From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 17:20:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8333286A; Thu, 17 Apr 2014 17:20:58 +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 6C3BF195F; Thu, 17 Apr 2014 17:20:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HHKwTl053569; Thu, 17 Apr 2014 17:20:58 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HHKu0P053557; Thu, 17 Apr 2014 17:20:56 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404171720.s3HHKu0P053557@svn.freebsd.org> From: Julio Merino Date: Thu, 17 Apr 2014 17:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264618 - in stable/10: contrib/atf contrib/atf/atf-c contrib/atf/atf-c++ contrib/atf/atf-sh etc/mtree lib/atf/libatf-c lib/atf/libatf-c++ usr.bin/atf/atf-sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 17:20:58 -0000 Author: jmmv Date: Thu Apr 17 17:20:56 2014 New Revision: 264618 URL: http://svnweb.freebsd.org/changeset/base/264618 Log: MFC r263989: Add atf m4 files from the vendor branch. Added: stable/10/contrib/atf/atf-c++/atf-c++.m4 - copied unchanged from r263989, head/contrib/atf/atf-c++/atf-c++.m4 stable/10/contrib/atf/atf-c/atf-c.m4 - copied unchanged from r263989, head/contrib/atf/atf-c/atf-c.m4 stable/10/contrib/atf/atf-c/atf-common.m4 - copied unchanged from r263989, head/contrib/atf/atf-c/atf-common.m4 stable/10/contrib/atf/atf-sh/atf-sh.m4 - copied unchanged from r263989, head/contrib/atf/atf-sh/atf-sh.m4 Modified: stable/10/contrib/atf/FREEBSD-Xlist stable/10/etc/mtree/BSD.tests.dist stable/10/lib/atf/libatf-c++/Makefile stable/10/lib/atf/libatf-c/Makefile stable/10/usr.bin/atf/atf-sh/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/atf/FREEBSD-Xlist ============================================================================== --- stable/10/contrib/atf/FREEBSD-Xlist Thu Apr 17 16:00:26 2014 (r264617) +++ stable/10/contrib/atf/FREEBSD-Xlist Thu Apr 17 17:20:56 2014 (r264618) @@ -7,7 +7,6 @@ INSTALL Makefile* aclocal.m4 admin/ -atf-*/atf-*.m4 atf-config/ atf-report/ atf-run/ Copied: stable/10/contrib/atf/atf-c++/atf-c++.m4 (from r263989, head/contrib/atf/atf-c++/atf-c++.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/atf/atf-c++/atf-c++.m4 Thu Apr 17 17:20:56 2014 (r264618, copy of r263989, head/contrib/atf/atf-c++/atf-c++.m4) @@ -0,0 +1,48 @@ +dnl +dnl Automated Testing Framework (atf) +dnl +dnl Copyright 2011 Google Inc. +dnl All rights reserved. +dnl +dnl Redistribution and use in source and binary forms, with or without +dnl modification, are permitted provided that the following conditions are +dnl met: +dnl +dnl * Redistributions of source code must retain the above copyright +dnl notice, this list of conditions and the following disclaimer. +dnl * Redistributions in binary form must reproduce the above copyright +dnl notice, this list of conditions and the following disclaimer in the +dnl documentation and/or other materials provided with the distribution. +dnl * Neither the name of Google Inc. nor the names of its contributors +dnl may be used to endorse or promote products derived from this software +dnl without specific prior written permission. +dnl +dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +dnl + +dnl ATF_CHECK_CXX([version-spec]) +dnl +dnl Checks if atf-c++ is present. If version-spec is provided, ensures that +dnl the installed version of atf-sh matches the required version. This +dnl argument must be something like '>= 0.14' and accepts any version +dnl specification supported by pkg-config. +dnl +dnl Defines and substitutes ATF_CXX_CFLAGS and ATF_CXX_LIBS with the compiler +dnl and linker flags need to build against atf-c++. +AC_DEFUN([ATF_CHECK_CXX], [ + spec="atf-c++[]m4_default_nblank([ $1], [])" + _ATF_CHECK_ARG_WITH( + [PKG_CHECK_MODULES([ATF_CXX], [${spec}], + [found=yes found_atf_cxx=yes], [found=no])], + [required ${spec} not found]) +]) Copied: stable/10/contrib/atf/atf-c/atf-c.m4 (from r263989, head/contrib/atf/atf-c/atf-c.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/atf/atf-c/atf-c.m4 Thu Apr 17 17:20:56 2014 (r264618, copy of r263989, head/contrib/atf/atf-c/atf-c.m4) @@ -0,0 +1,48 @@ +dnl +dnl Automated Testing Framework (atf) +dnl +dnl Copyright 2011 Google Inc. +dnl All rights reserved. +dnl +dnl Redistribution and use in source and binary forms, with or without +dnl modification, are permitted provided that the following conditions are +dnl met: +dnl +dnl * Redistributions of source code must retain the above copyright +dnl notice, this list of conditions and the following disclaimer. +dnl * Redistributions in binary form must reproduce the above copyright +dnl notice, this list of conditions and the following disclaimer in the +dnl documentation and/or other materials provided with the distribution. +dnl * Neither the name of Google Inc. nor the names of its contributors +dnl may be used to endorse or promote products derived from this software +dnl without specific prior written permission. +dnl +dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +dnl + +dnl ATF_CHECK_C([version-spec]) +dnl +dnl Checks if atf-c is present. If version-spec is provided, ensures that +dnl the installed version of atf-sh matches the required version. This +dnl argument must be something like '>= 0.14' and accepts any version +dnl specification supported by pkg-config. +dnl +dnl Defines and substitutes ATF_C_CFLAGS and ATF_C_LIBS with the compiler +dnl and linker flags need to build against atf-c. +AC_DEFUN([ATF_CHECK_C], [ + spec="atf-c[]m4_default_nblank([ $1], [])" + _ATF_CHECK_ARG_WITH( + [PKG_CHECK_MODULES([ATF_C], [${spec}], + [found=yes found_atf_c=yes], [found=no])], + [required ${spec} not found]) +]) Copied: stable/10/contrib/atf/atf-c/atf-common.m4 (from r263989, head/contrib/atf/atf-c/atf-common.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/atf/atf-c/atf-common.m4 Thu Apr 17 17:20:56 2014 (r264618, copy of r263989, head/contrib/atf/atf-c/atf-common.m4) @@ -0,0 +1,92 @@ +dnl +dnl Automated Testing Framework (atf) +dnl +dnl Copyright 2011 Google Inc. +dnl All rights reserved. +dnl +dnl Redistribution and use in source and binary forms, with or without +dnl modification, are permitted provided that the following conditions are +dnl met: +dnl +dnl * Redistributions of source code must retain the above copyright +dnl notice, this list of conditions and the following disclaimer. +dnl * Redistributions in binary form must reproduce the above copyright +dnl notice, this list of conditions and the following disclaimer in the +dnl documentation and/or other materials provided with the distribution. +dnl * Neither the name of Google Inc. nor the names of its contributors +dnl may be used to endorse or promote products derived from this software +dnl without specific prior written permission. +dnl +dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +dnl + +dnl ATF_ARG_WITH +dnl +dnl Adds a --with-atf flag to the configure script that allows the user to +dnl enable or disable atf support. +dnl +dnl The ATF_CHECK_{C,CXX,SH} macros honor the flag defined herein if +dnl instantiated. If not instantiated, they will request the presence of +dnl the libraries unconditionally. +dnl +dnl Defines the WITH_ATF Automake conditional if ATF has been found by any +dnl of the ATF_CHECK_{C,CXX,SH} macros. +AC_DEFUN([ATF_ARG_WITH], [ + m4_define([atf_arg_with_called], [yes]) + + m4_divert_text([DEFAULTS], [with_atf=auto]) + AC_ARG_WITH([atf], + [AS_HELP_STRING([--with-atf=], + [build atf-based test programs])], + [with_atf=${withval}], [with_atf=auto]) + + m4_divert_text([DEFAULTS], [ + found_atf_c=no + found_atf_cxx=no + found_atf_sh=no + ]) + AM_CONDITIONAL([WITH_ATF], [test x"${found_atf_c}" = x"yes" -o \ + x"${found_atf_cxx}" = x"yes" -o \ + x"${found_atf_sh}" = x"yes"]) +]) + +dnl _ATF_CHECK_ARG_WITH(check, error_message) +dnl +dnl Internal macro to execute a check conditional on the --with-atf flag +dnl and handle the result accordingly. +dnl +dnl 'check' specifies the piece of code to be run to detect the feature. +dnl This code must set the 'found' shell variable to yes or no depending +dnl on the raw result of the check. +AC_DEFUN([_ATF_CHECK_ARG_WITH], [ + m4_ifdef([atf_arg_with_called], [ + m4_fatal([ATF_ARG_WITH must be called after the ATF_CHECK_* checks]) + ]) + + m4_divert_text([DEFAULTS], [with_atf=yes]) + + if test x"${with_atf}" = x"no"; then + _found=no + else + $1 + if test x"${with_atf}" = x"auto"; then + _found="${found}" + else + if test x"${found}" = x"yes"; then + _found=yes + else + AC_MSG_ERROR([$2]) + fi + fi + fi +]) Copied: stable/10/contrib/atf/atf-sh/atf-sh.m4 (from r263989, head/contrib/atf/atf-sh/atf-sh.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/atf/atf-sh/atf-sh.m4 Thu Apr 17 17:20:56 2014 (r264618, copy of r263989, head/contrib/atf/atf-sh/atf-sh.m4) @@ -0,0 +1,53 @@ +dnl +dnl Automated Testing Framework (atf) +dnl +dnl Copyright 2011 Google Inc. +dnl All rights reserved. +dnl +dnl Redistribution and use in source and binary forms, with or without +dnl modification, are permitted provided that the following conditions are +dnl met: +dnl +dnl * Redistributions of source code must retain the above copyright +dnl notice, this list of conditions and the following disclaimer. +dnl * Redistributions in binary form must reproduce the above copyright +dnl notice, this list of conditions and the following disclaimer in the +dnl documentation and/or other materials provided with the distribution. +dnl * Neither the name of Google Inc. nor the names of its contributors +dnl may be used to endorse or promote products derived from this software +dnl without specific prior written permission. +dnl +dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +dnl + +dnl ATF_CHECK_SH([version-spec]) +dnl +dnl Checks if atf-sh is present. If version-spec is provided, ensures that +dnl the installed version of atf-sh matches the required version. This +dnl argument must be something like '>= 0.14' and accepts any version +dnl specification supported by pkg-config. +dnl +dnl Defines and substitutes ATF_SH with the full path to the atf-sh interpreter. +AC_DEFUN([ATF_CHECK_SH], [ + spec="atf-sh[]m4_default_nblank([ $1], [])" + _ATF_CHECK_ARG_WITH( + [AC_MSG_CHECKING([for ${spec}]) + PKG_CHECK_EXISTS([${spec}], [found=yes], [found=no]) + if test "${found}" = yes; then + ATF_SH="$(${PKG_CONFIG} --variable=interpreter atf-sh)" + AC_SUBST([ATF_SH], [${ATF_SH}]) + found_atf_sh=yes + fi + AC_MSG_RESULT([${ATF_SH}])], + [required ${spec} not found]) +]) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Thu Apr 17 16:00:26 2014 (r264617) +++ stable/10/etc/mtree/BSD.tests.dist Thu Apr 17 17:20:56 2014 (r264618) @@ -12,6 +12,8 @@ .. .. share + aclocal + .. atf .. doc Modified: stable/10/lib/atf/libatf-c++/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c++/Makefile Thu Apr 17 16:00:26 2014 (r264617) +++ stable/10/lib/atf/libatf-c++/Makefile Thu Apr 17 17:20:56 2014 (r264618) @@ -83,6 +83,8 @@ atf-c++.pc: atf-c++.pc.in atf-version beforeinstall: ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ atf-c++.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-c++/atf-c++.m4 ${DESTDIR}${SHAREDIR}/aclocal .if ${MK_TESTS} != "no" SUBDIR= tests Modified: stable/10/lib/atf/libatf-c/Makefile ============================================================================== --- stable/10/lib/atf/libatf-c/Makefile Thu Apr 17 16:00:26 2014 (r264617) +++ stable/10/lib/atf/libatf-c/Makefile Thu Apr 17 17:20:56 2014 (r264618) @@ -85,6 +85,10 @@ atf-c.pc: atf-c.pc.in atf-version beforeinstall: ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ atf-c.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-c/atf-common.m4 ${DESTDIR}${SHAREDIR}/aclocal + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-c/atf-c.m4 ${DESTDIR}${SHAREDIR}/aclocal .if ${MK_TESTS} != "no" SUBDIR= tests Modified: stable/10/usr.bin/atf/atf-sh/Makefile ============================================================================== --- stable/10/usr.bin/atf/atf-sh/Makefile Thu Apr 17 16:00:26 2014 (r264617) +++ stable/10/usr.bin/atf/atf-sh/Makefile Thu Apr 17 17:20:56 2014 (r264618) @@ -54,6 +54,8 @@ atf-sh.pc: atf-sh.pc.in atf-version beforeinstall: ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ atf-sh.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-sh/atf-sh.m4 ${DESTDIR}${SHAREDIR}/aclocal .if ${MK_TESTS} != "no" SUBDIR+= tests From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 17 18:00:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8CC8C1D6; Thu, 17 Apr 2014 18:00: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 781EE1D3A; Thu, 17 Apr 2014 18:00: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 s3HI092U069045; Thu, 17 Apr 2014 18:00:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HI08iO069034; Thu, 17 Apr 2014 18:00:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404171800.s3HI08iO069034@svn.freebsd.org> From: John Baldwin Date: Thu, 17 Apr 2014 18:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264619 - in stable/10: sys/amd64/include sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 18:00:09 -0000 Author: jhb Date: Thu Apr 17 18:00:07 2014 New Revision: 264619 URL: http://svnweb.freebsd.org/changeset/base/264619 Log: MFC 258860,260167,260238,260397: - Restructure the VMX code to enter and exit the guest. In large part this change hides the setjmp/longjmp semantics of VM enter/exit. vmx_enter_guest() is used to enter guest context and vmx_exit_guest() is used to transition back into host context. Fix a longstanding race where a vcpu interrupt notification might be ignored if it happens after vmx_inject_interrupts() but before host interrupts are disabled in vmx_resume/vmx_launch. We now call vmx_inject_interrupts() with host interrupts disabled to prevent this. - The 'protection' field in the VM exit collateral for the PAGING exit is not used - get rid of it. Reviewed by: grehan Modified: stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/intel/vmx.h stable/10/sys/amd64/vmm/intel/vmx_genassym.c stable/10/sys/amd64/vmm/intel/vmx_support.S stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyvectl/bhyvectl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Thu Apr 17 17:20:56 2014 (r264618) +++ stable/10/sys/amd64/include/vmm.h Thu Apr 17 18:00:07 2014 (r264619) @@ -286,7 +286,6 @@ struct vm_exit { struct { uint64_t gpa; int fault_type; - int protection; } paging; struct { uint64_t gpa; @@ -299,9 +298,19 @@ struct vm_exit { * exitcode to represent the VM-exit. */ struct { - int error; /* vmx inst error */ + int status; /* vmx inst status */ + /* + * 'exit_reason' and 'exit_qualification' are valid + * only if 'status' is zero. + */ uint32_t exit_reason; uint64_t exit_qualification; + /* + * 'inst_error' and 'inst_type' are valid + * only if 'status' is non-zero. + */ + int inst_type; + int inst_error; } vmx; struct { uint32_t code; /* ecx value */ Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Thu Apr 17 17:20:56 2014 (r264618) +++ stable/10/sys/amd64/vmm/intel/vmx.c Thu Apr 17 18:00:07 2014 (r264619) @@ -286,82 +286,6 @@ exit_reason_to_str(int reason) return (reasonbuf); } } - -#ifdef SETJMP_TRACE -static const char * -vmx_setjmp_rc2str(int rc) -{ - switch (rc) { - case VMX_RETURN_DIRECT: - return "direct"; - case VMX_RETURN_LONGJMP: - return "longjmp"; - case VMX_RETURN_VMRESUME: - return "vmresume"; - case VMX_RETURN_VMLAUNCH: - return "vmlaunch"; - case VMX_RETURN_AST: - return "ast"; - default: - return "unknown"; - } -} - -#define SETJMP_TRACE(vmx, vcpu, vmxctx, regname) \ - VCPU_CTR1((vmx)->vm, (vcpu), "setjmp trace " #regname " 0x%016lx", \ - (vmxctx)->regname) - -static void -vmx_setjmp_trace(struct vmx *vmx, int vcpu, struct vmxctx *vmxctx, int rc) -{ - uint64_t host_rip, host_rsp; - - if (vmxctx != &vmx->ctx[vcpu]) - panic("vmx_setjmp_trace: invalid vmxctx %p; should be %p", - vmxctx, &vmx->ctx[vcpu]); - - VCPU_CTR1((vmx)->vm, (vcpu), "vmxctx = %p", vmxctx); - VCPU_CTR2((vmx)->vm, (vcpu), "setjmp return code %s(%d)", - vmx_setjmp_rc2str(rc), rc); - - host_rip = vmcs_read(VMCS_HOST_RIP); - host_rsp = vmcs_read(VMCS_HOST_RSP); - VCPU_CTR2((vmx)->vm, (vcpu), "vmcs host_rip 0x%016lx, host_rsp %#lx", - host_rip, host_rsp); - - SETJMP_TRACE(vmx, vcpu, vmxctx, host_r15); - SETJMP_TRACE(vmx, vcpu, vmxctx, host_r14); - SETJMP_TRACE(vmx, vcpu, vmxctx, host_r13); - SETJMP_TRACE(vmx, vcpu, vmxctx, host_r12); - SETJMP_TRACE(vmx, vcpu, vmxctx, host_rbp); - SETJMP_TRACE(vmx, vcpu, vmxctx, host_rsp); - SETJMP_TRACE(vmx, vcpu, vmxctx, host_rbx); - SETJMP_TRACE(vmx, vcpu, vmxctx, host_rip); - - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_rdi); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_rsi); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_rdx); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_rcx); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_r8); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_r9); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_rax); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_rbx); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_rbp); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_r10); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_r11); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_r12); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_r13); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_r14); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_r15); - SETJMP_TRACE(vmx, vcpu, vmxctx, guest_cr2); -} -#endif -#else -static void __inline -vmx_setjmp_trace(struct vmx *vmx, int vcpu, struct vmxctx *vmxctx, int rc) -{ - return; -} #endif /* KTR */ u_long @@ -825,7 +749,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) } error = vmcs_set_defaults(&vmx->vmcs[i], - (u_long)vmx_longjmp, + (u_long)vmx_exit_guest, (u_long)&vmx->ctx[i], vmx->eptp, pinbased_ctls, @@ -1222,21 +1146,6 @@ ept_fault_type(uint64_t ept_qual) return (fault_type); } -static int -ept_protection(uint64_t ept_qual) -{ - int prot = 0; - - if (ept_qual & EPT_VIOLATION_GPA_READABLE) - prot |= VM_PROT_READ; - if (ept_qual & EPT_VIOLATION_GPA_WRITEABLE) - prot |= VM_PROT_WRITE; - if (ept_qual & EPT_VIOLATION_GPA_EXECUTABLE) - prot |= VM_PROT_EXECUTE; - - return (prot); -} - static boolean_t ept_emulation_fault(uint64_t ept_qual) { @@ -1269,15 +1178,14 @@ static int vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) { int error, handled; - struct vmcs *vmcs; struct vmxctx *vmxctx; uint32_t eax, ecx, edx, idtvec_info, idtvec_err, reason; uint64_t qual, gpa; bool retu; handled = 0; - vmcs = &vmx->vmcs[vcpu]; vmxctx = &vmx->ctx[vcpu]; + qual = vmexit->u.vmx.exit_qualification; reason = vmexit->u.vmx.exit_reason; vmexit->exitcode = VM_EXITCODE_BOGUS; @@ -1421,7 +1329,6 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->exitcode = VM_EXITCODE_PAGING; vmexit->u.paging.gpa = gpa; vmexit->u.paging.fault_type = ept_fault_type(qual); - vmexit->u.paging.protection = ept_protection(qual); } else if (ept_emulation_fault(qual)) { vmexit->exitcode = VM_EXITCODE_INST_EMUL; vmexit->u.inst_emul.gpa = gpa; @@ -1455,7 +1362,7 @@ vmx_exit_process(struct vmx *vmx, int vc * treat it as a generic VMX exit. */ vmexit->exitcode = VM_EXITCODE_VMX; - vmexit->u.vmx.error = 0; + vmexit->u.vmx.status = VM_SUCCESS; } else { /* * The exitcode and collateral have been populated. @@ -1466,32 +1373,69 @@ vmx_exit_process(struct vmx *vmx, int vc return (handled); } +static __inline int +vmx_exit_astpending(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) +{ + + vmexit->rip = vmcs_guest_rip(); + vmexit->inst_length = 0; + vmexit->exitcode = VM_EXITCODE_BOGUS; + vmx_astpending_trace(vmx, vcpu, vmexit->rip); + vmm_stat_incr(vmx->vm, vcpu, VMEXIT_ASTPENDING, 1); + + return (HANDLED); +} + +static __inline int +vmx_exit_inst_error(struct vmxctx *vmxctx, int rc, struct vm_exit *vmexit) +{ + + KASSERT(vmxctx->inst_fail_status != VM_SUCCESS, + ("vmx_exit_inst_error: invalid inst_fail_status %d", + vmxctx->inst_fail_status)); + + vmexit->inst_length = 0; + vmexit->exitcode = VM_EXITCODE_VMX; + vmexit->u.vmx.status = vmxctx->inst_fail_status; + vmexit->u.vmx.inst_error = vmcs_instruction_error(); + vmexit->u.vmx.exit_reason = ~0; + vmexit->u.vmx.exit_qualification = ~0; + + switch (rc) { + case VMX_VMRESUME_ERROR: + case VMX_VMLAUNCH_ERROR: + case VMX_INVEPT_ERROR: + vmexit->u.vmx.inst_type = rc; + break; + default: + panic("vm_exit_inst_error: vmx_enter_guest returned %d", rc); + } + + return (UNHANDLED); +} + static int -vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap) +vmx_run(void *arg, int vcpu, register_t startrip, pmap_t pmap) { - int vie, rc, handled, astpending; - uint32_t exit_reason; + int rc, handled, launched; struct vmx *vmx; struct vmxctx *vmxctx; struct vmcs *vmcs; struct vm_exit *vmexit; + uint64_t rip; + uint32_t exit_reason; vmx = arg; vmcs = &vmx->vmcs[vcpu]; vmxctx = &vmx->ctx[vcpu]; - vmxctx->launched = 0; - - astpending = 0; vmexit = vm_exitinfo(vmx->vm, vcpu); + launched = 0; KASSERT(vmxctx->pmap == pmap, ("pmap %p different than ctx pmap %p", pmap, vmxctx->pmap)); KASSERT(vmxctx->eptp == vmx->eptp, ("eptp %p different than ctx eptp %#lx", eptp, vmxctx->eptp)); - /* - * XXX Can we avoid doing this every time we do a vm run? - */ VMPTRLD(vmcs); /* @@ -1503,76 +1447,55 @@ vmx_run(void *arg, int vcpu, register_t * of a single process we could do this once in vmcs_set_defaults(). */ vmcs_write(VMCS_HOST_CR3, rcr3()); - vmcs_write(VMCS_GUEST_RIP, rip); - vmx_set_pcpu_defaults(vmx, vcpu); + vmcs_write(VMCS_GUEST_RIP, startrip); + vmx_set_pcpu_defaults(vmx, vcpu); do { - vmx_inject_interrupts(vmx, vcpu); - vmx_run_trace(vmx, vcpu); - rc = vmx_setjmp(vmxctx); -#ifdef SETJMP_TRACE - vmx_setjmp_trace(vmx, vcpu, vmxctx, rc); -#endif - switch (rc) { - case VMX_RETURN_DIRECT: - if (vmxctx->launched == 0) { - vmxctx->launched = 1; - vmx_launch(vmxctx); - } else - vmx_resume(vmxctx); - panic("vmx_launch/resume should not return"); - break; - case VMX_RETURN_LONGJMP: - break; /* vm exit */ - case VMX_RETURN_AST: - astpending = 1; - break; - case VMX_RETURN_VMRESUME: - vie = vmcs_instruction_error(); - if (vmxctx->launch_error == VM_FAIL_INVALID || - vie != VMRESUME_WITH_NON_LAUNCHED_VMCS) { - printf("vmresume error %d vmcs inst error %d\n", - vmxctx->launch_error, vie); - goto err_exit; - } - vmx_launch(vmxctx); /* try to launch the guest */ - panic("vmx_launch should not return"); + /* + * Interrupts are disabled from this point on until the + * guest starts executing. This is done for the following + * reasons: + * + * If an AST is asserted on this thread after the check below, + * then the IPI_AST notification will not be lost, because it + * will cause a VM exit due to external interrupt as soon as + * the guest state is loaded. + * + * A posted interrupt after 'vmx_inject_interrupts()' will + * not be "lost" because it will be held pending in the host + * APIC because interrupts are disabled. The pending interrupt + * will be recognized as soon as the guest state is loaded. + * + * The same reasoning applies to the IPI generated by + * pmap_invalidate_ept(). + */ + disable_intr(); + if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) { + enable_intr(); + handled = vmx_exit_astpending(vmx, vcpu, vmexit); break; - case VMX_RETURN_VMLAUNCH: - vie = vmcs_instruction_error(); -#if 1 - printf("vmlaunch error %d vmcs inst error %d\n", - vmxctx->launch_error, vie); -#endif - goto err_exit; - case VMX_RETURN_INVEPT: - panic("vm %s:%d invept error %d", - vm_name(vmx->vm), vcpu, vmxctx->launch_error); - default: - panic("vmx_setjmp returned %d", rc); } - - /* enable interrupts */ + + vmx_inject_interrupts(vmx, vcpu); + vmx_run_trace(vmx, vcpu); + rc = vmx_enter_guest(vmxctx, launched); + enable_intr(); - /* collect some basic information for VM exit processing */ + /* Collect some information for VM exit processing */ vmexit->rip = rip = vmcs_guest_rip(); vmexit->inst_length = vmexit_instruction_length(); vmexit->u.vmx.exit_reason = exit_reason = vmcs_exit_reason(); vmexit->u.vmx.exit_qualification = vmcs_exit_qualification(); - if (astpending) { - handled = 1; - vmexit->inst_length = 0; - vmexit->exitcode = VM_EXITCODE_BOGUS; - vmx_astpending_trace(vmx, vcpu, rip); - vmm_stat_incr(vmx->vm, vcpu, VMEXIT_ASTPENDING, 1); - break; + if (rc == VMX_GUEST_VMEXIT) { + launched = 1; + handled = vmx_exit_process(vmx, vcpu, vmexit); + } else { + handled = vmx_exit_inst_error(vmxctx, rc, vmexit); } - handled = vmx_exit_process(vmx, vcpu, vmexit); vmx_exit_trace(vmx, vcpu, rip, exit_reason, handled); - } while (handled); /* @@ -1588,26 +1511,11 @@ vmx_run(void *arg, int vcpu, register_t if (!handled) vmm_stat_incr(vmx->vm, vcpu, VMEXIT_USERSPACE, 1); - VCPU_CTR1(vmx->vm, vcpu, "goto userland: exitcode %d",vmexit->exitcode); + VCPU_CTR1(vmx->vm, vcpu, "returning from vmx_run: exitcode %d", + vmexit->exitcode); - /* - * XXX - * We need to do this to ensure that any VMCS state cached by the - * processor is flushed to memory. We need to do this in case the - * VM moves to a different cpu the next time it runs. - * - * Can we avoid doing this? - */ VMCLEAR(vmcs); return (0); - -err_exit: - vmexit->exitcode = VM_EXITCODE_VMX; - vmexit->u.vmx.exit_reason = (uint32_t)-1; - vmexit->u.vmx.exit_qualification = (uint32_t)-1; - vmexit->u.vmx.error = vie; - VMCLEAR(vmcs); - return (ENOEXEC); } static void Modified: stable/10/sys/amd64/vmm/intel/vmx.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.h Thu Apr 17 17:20:56 2014 (r264618) +++ stable/10/sys/amd64/vmm/intel/vmx.h Thu Apr 17 18:00:07 2014 (r264619) @@ -36,9 +36,6 @@ struct pmap; #define GUEST_MSR_MAX_ENTRIES 64 /* arbitrary */ struct vmxctx { - register_t tmpstk[32]; /* vmx_return() stack */ - register_t tmpstktop; - register_t guest_rdi; /* Guest state */ register_t guest_rsi; register_t guest_rdx; @@ -68,8 +65,7 @@ struct vmxctx { * XXX todo debug registers and fpu state */ - int launched; /* vmcs launch state */ - int launch_error; + int inst_fail_status; long eptgen[MAXCPU]; /* cached pmap->pm_eptgen */ @@ -107,25 +103,12 @@ CTASSERT((offsetof(struct vmx, vmcs) & P CTASSERT((offsetof(struct vmx, msr_bitmap) & PAGE_MASK) == 0); CTASSERT((offsetof(struct vmx, guest_msrs) & 15) == 0); -#define VMX_RETURN_DIRECT 0 -#define VMX_RETURN_LONGJMP 1 -#define VMX_RETURN_VMRESUME 2 -#define VMX_RETURN_VMLAUNCH 3 -#define VMX_RETURN_AST 4 -#define VMX_RETURN_INVEPT 5 -/* - * vmx_setjmp() returns: - * - 0 when it returns directly - * - 1 when it returns from vmx_longjmp - * - 2 when it returns from vmx_resume (which would only be in the error case) - * - 3 when it returns from vmx_launch (which would only be in the error case) - * - 4 when it returns from vmx_resume or vmx_launch because of AST pending - * - 5 when it returns from vmx_launch/vmx_resume because of invept error - */ -int vmx_setjmp(struct vmxctx *ctx); -void vmx_longjmp(void); /* returns via vmx_setjmp */ -void vmx_launch(struct vmxctx *ctx) __dead2; /* may return via vmx_setjmp */ -void vmx_resume(struct vmxctx *ctx) __dead2; /* may return via vmx_setjmp */ +#define VMX_GUEST_VMEXIT 0 +#define VMX_VMRESUME_ERROR 1 +#define VMX_VMLAUNCH_ERROR 2 +#define VMX_INVEPT_ERROR 3 +int vmx_enter_guest(struct vmxctx *ctx, int launched); +void vmx_exit_guest(void); u_long vmx_fix_cr0(u_long cr0); u_long vmx_fix_cr4(u_long cr4); Modified: stable/10/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_genassym.c Thu Apr 17 17:20:56 2014 (r264618) +++ stable/10/sys/amd64/vmm/intel/vmx_genassym.c Thu Apr 17 18:00:07 2014 (r264619) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -42,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include "vmx_cpufunc.h" #include "vmx.h" -ASSYM(VMXCTX_TMPSTKTOP, offsetof(struct vmxctx, tmpstktop)); ASSYM(VMXCTX_GUEST_RDI, offsetof(struct vmxctx, guest_rdi)); ASSYM(VMXCTX_GUEST_RSI, offsetof(struct vmxctx, guest_rsi)); ASSYM(VMXCTX_GUEST_RDX, offsetof(struct vmxctx, guest_rdx)); @@ -69,27 +67,19 @@ ASSYM(VMXCTX_HOST_RSP, offsetof(struct v ASSYM(VMXCTX_HOST_RBX, offsetof(struct vmxctx, host_rbx)); ASSYM(VMXCTX_HOST_RIP, offsetof(struct vmxctx, host_rip)); -ASSYM(VMXCTX_LAUNCH_ERROR, offsetof(struct vmxctx, launch_error)); +ASSYM(VMXCTX_INST_FAIL_STATUS, offsetof(struct vmxctx, inst_fail_status)); ASSYM(VMXCTX_EPTGEN, offsetof(struct vmxctx, eptgen)); ASSYM(VMXCTX_PMAP, offsetof(struct vmxctx, pmap)); ASSYM(VMXCTX_EPTP, offsetof(struct vmxctx, eptp)); -ASSYM(VM_SUCCESS, VM_SUCCESS); ASSYM(VM_FAIL_INVALID, VM_FAIL_INVALID); ASSYM(VM_FAIL_VALID, VM_FAIL_VALID); +ASSYM(VMX_GUEST_VMEXIT, VMX_GUEST_VMEXIT); +ASSYM(VMX_VMRESUME_ERROR, VMX_VMRESUME_ERROR); +ASSYM(VMX_VMLAUNCH_ERROR, VMX_VMLAUNCH_ERROR); +ASSYM(VMX_INVEPT_ERROR, VMX_INVEPT_ERROR); -ASSYM(VMX_RETURN_DIRECT, VMX_RETURN_DIRECT); -ASSYM(VMX_RETURN_LONGJMP, VMX_RETURN_LONGJMP); -ASSYM(VMX_RETURN_VMRESUME, VMX_RETURN_VMRESUME); -ASSYM(VMX_RETURN_VMLAUNCH, VMX_RETURN_VMLAUNCH); -ASSYM(VMX_RETURN_AST, VMX_RETURN_AST); -ASSYM(VMX_RETURN_INVEPT, VMX_RETURN_INVEPT); - -ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); -ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); -ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); -ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); Modified: stable/10/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_support.S Thu Apr 17 17:20:56 2014 (r264618) +++ stable/10/sys/amd64/vmm/intel/vmx_support.S Thu Apr 17 18:00:07 2014 (r264619) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2011 NetApp, Inc. + * Copyright (c) 2013 Neel Natu * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,32 +38,6 @@ #endif /* - * Disable interrupts before updating %rsp in VMX_CHECK_AST or - * VMX_GUEST_RESTORE. - * - * The location that %rsp points to is a 'vmxctx' and not a - * real stack so we don't want an interrupt handler to trash it - */ -#define VMX_DISABLE_INTERRUPTS cli - -/* - * If the thread hosting the vcpu has an ast pending then take care of it - * by returning from vmx_setjmp() with a return value of VMX_RETURN_AST. - * - * Assumes that %rdi holds a pointer to the 'vmxctx' and that interrupts - * are disabled. - */ -#define VMX_CHECK_AST \ - movq PCPU(CURTHREAD),%rax; \ - testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax); \ - je 9f; \ - movq $VMX_RETURN_AST,%rsi; \ - movq %rdi,%rsp; \ - addq $VMXCTX_TMPSTKTOP,%rsp; \ - callq vmx_return; \ -9: - -/* * Assumes that %rdi holds a pointer to the 'vmxctx'. * * On "return" all registers are updated to reflect guest state. The two @@ -93,132 +68,132 @@ movq VMXCTX_GUEST_RDI(%rdi),%rdi; /* restore rdi the last */ /* - * Check for an error after executing a VMX instruction. - * 'errreg' will be zero on success and non-zero otherwise. - * 'ctxreg' points to the 'struct vmxctx' associated with the vcpu. + * Save and restore the host context. + * + * Assumes that %rdi holds a pointer to the 'vmxctx'. */ -#define VM_INSTRUCTION_ERROR(errreg, ctxreg) \ - jnc 1f; \ - movl $VM_FAIL_INVALID,errreg; /* CF is set */ \ - jmp 3f; \ -1: jnz 2f; \ - movl $VM_FAIL_VALID,errreg; /* ZF is set */ \ - jmp 3f; \ -2: movl $VM_SUCCESS,errreg; \ -3: movl errreg,VMXCTX_LAUNCH_ERROR(ctxreg) +#define VMX_HOST_SAVE(tmpreg) \ + movq (%rsp), tmpreg; /* return address */ \ + movq %r15, VMXCTX_HOST_R15(%rdi); \ + movq %r14, VMXCTX_HOST_R14(%rdi); \ + movq %r13, VMXCTX_HOST_R13(%rdi); \ + movq %r12, VMXCTX_HOST_R12(%rdi); \ + movq %rbp, VMXCTX_HOST_RBP(%rdi); \ + movq %rsp, VMXCTX_HOST_RSP(%rdi); \ + movq %rbx, VMXCTX_HOST_RBX(%rdi); \ + movq tmpreg, VMXCTX_HOST_RIP(%rdi) + +#define VMX_HOST_RESTORE(tmpreg) \ + movq VMXCTX_HOST_R15(%rdi), %r15; \ + movq VMXCTX_HOST_R14(%rdi), %r14; \ + movq VMXCTX_HOST_R13(%rdi), %r13; \ + movq VMXCTX_HOST_R12(%rdi), %r12; \ + movq VMXCTX_HOST_RBP(%rdi), %rbp; \ + movq VMXCTX_HOST_RSP(%rdi), %rsp; \ + movq VMXCTX_HOST_RBX(%rdi), %rbx; \ + movq VMXCTX_HOST_RIP(%rdi), tmpreg; \ + movq tmpreg, (%rsp) /* return address */ + +/* + * vmx_enter_guest(struct vmxctx *vmxctx, int launched) + * %rdi: pointer to the 'vmxctx' + * %esi: launch state of the VMCS + * Interrupts must be disabled on entry. + */ +ENTRY(vmx_enter_guest) + /* + * Save host state before doing anything else. + */ + VMX_HOST_SAVE(%r10) -/* - * set or clear the appropriate bit in 'pm_active' - * %rdi = vmxctx - * %rax, %r11 = scratch registers - */ -#define VMX_SET_PM_ACTIVE \ - movq VMXCTX_PMAP(%rdi), %r11; \ - movl PCPU(CPUID), %eax; \ + /* + * Activate guest pmap on this cpu. + */ + movq VMXCTX_PMAP(%rdi), %r11 + movl PCPU(CPUID), %eax LK btsl %eax, PM_ACTIVE(%r11) -#define VMX_CLEAR_PM_ACTIVE \ - movq VMXCTX_PMAP(%rdi), %r11; \ - movl PCPU(CPUID), %eax; \ - LK btrl %eax, PM_ACTIVE(%r11) - -/* - * If 'vmxctx->eptgen[curcpu]' is not identical to 'pmap->pm_eptgen' - * then we must invalidate all mappings associated with this eptp. - * - * %rdi = vmxctx - * %rax, %rbx, %r11 = scratch registers - */ -#define VMX_CHECK_EPTGEN \ - movl PCPU(CPUID), %ebx; \ - movq VMXCTX_PMAP(%rdi), %r11; \ - movq PM_EPTGEN(%r11), %rax; \ - cmpq %rax, VMXCTX_EPTGEN(%rdi, %rbx, 8); \ - je 9f; \ - \ - /* Refresh 'vmxctx->eptgen[curcpu]' */ \ - movq %rax, VMXCTX_EPTGEN(%rdi, %rbx, 8); \ - \ - /* Setup the invept descriptor at the top of tmpstk */ \ - mov %rdi, %r11; \ - addq $VMXCTX_TMPSTKTOP, %r11; \ - movq VMXCTX_EPTP(%rdi), %rax; \ - movq %rax, -16(%r11); \ - movq $0x0, -8(%r11); \ - mov $0x1, %eax; /* Single context invalidate */ \ - invept -16(%r11), %rax; \ - \ - /* Check for invept error */ \ - VM_INSTRUCTION_ERROR(%eax, %rdi); \ - testl %eax, %eax; \ - jz 9f; \ - \ - /* Return via vmx_setjmp with retval of VMX_RETURN_INVEPT */ \ - movq $VMX_RETURN_INVEPT, %rsi; \ - movq %rdi,%rsp; \ - addq $VMXCTX_TMPSTKTOP, %rsp; \ - callq vmx_return; \ -9: ; + /* + * If 'vmxctx->eptgen[curcpu]' is not identical to 'pmap->pm_eptgen' + * then we must invalidate all mappings associated with this EPTP. + */ + movq PM_EPTGEN(%r11), %r10 + cmpq %r10, VMXCTX_EPTGEN(%rdi, %rax, 8) + je guest_restore + + /* Refresh 'vmxctx->eptgen[curcpu]' */ + movq %r10, VMXCTX_EPTGEN(%rdi, %rax, 8) + + /* Setup the invept descriptor on the host stack */ + mov %rsp, %r11 + movq VMXCTX_EPTP(%rdi), %rax + movq %rax, -16(%r11) + movq $0x0, -8(%r11) + mov $0x1, %eax /* Single context invalidate */ + invept -16(%r11), %rax + jbe invept_error /* Check invept instruction error */ + +guest_restore: + cmpl $0, %esi + je do_launch - .text -/* - * int vmx_setjmp(ctxp) - * %rdi = ctxp - * - * Return value is '0' when it returns directly from here. - * Return value is '1' when it returns after a vm exit through vmx_longjmp. - */ -ENTRY(vmx_setjmp) - movq (%rsp),%rax /* return address */ - movq %r15,VMXCTX_HOST_R15(%rdi) - movq %r14,VMXCTX_HOST_R14(%rdi) - movq %r13,VMXCTX_HOST_R13(%rdi) - movq %r12,VMXCTX_HOST_R12(%rdi) - movq %rbp,VMXCTX_HOST_RBP(%rdi) - movq %rsp,VMXCTX_HOST_RSP(%rdi) - movq %rbx,VMXCTX_HOST_RBX(%rdi) - movq %rax,VMXCTX_HOST_RIP(%rdi) + VMX_GUEST_RESTORE + vmresume + /* + * In the common case 'vmresume' returns back to the host through + * 'vmx_exit_guest' with %rsp pointing to 'vmxctx'. + * + * If there is an error we return VMX_VMRESUME_ERROR to the caller. + */ + movq %rsp, %rdi /* point %rdi back to 'vmxctx' */ + movl $VMX_VMRESUME_ERROR, %eax + jmp decode_inst_error +do_launch: + VMX_GUEST_RESTORE + vmlaunch /* - * XXX save host debug registers + * In the common case 'vmlaunch' returns back to the host through + * 'vmx_exit_guest' with %rsp pointing to 'vmxctx'. + * + * If there is an error we return VMX_VMLAUNCH_ERROR to the caller. */ - movl $VMX_RETURN_DIRECT,%eax - ret -END(vmx_setjmp) + movq %rsp, %rdi /* point %rdi back to 'vmxctx' */ + movl $VMX_VMLAUNCH_ERROR, %eax + jmp decode_inst_error -/* - * void vmx_return(struct vmxctx *ctxp, int retval) - * %rdi = ctxp - * %rsi = retval - * Return to vmm context through vmx_setjmp() with a value of 'retval'. - */ -ENTRY(vmx_return) - /* The pmap is no longer active on the host cpu */ - VMX_CLEAR_PM_ACTIVE - - /* Restore host context. */ - movq VMXCTX_HOST_R15(%rdi),%r15 - movq VMXCTX_HOST_R14(%rdi),%r14 - movq VMXCTX_HOST_R13(%rdi),%r13 - movq VMXCTX_HOST_R12(%rdi),%r12 - movq VMXCTX_HOST_RBP(%rdi),%rbp - movq VMXCTX_HOST_RSP(%rdi),%rsp - movq VMXCTX_HOST_RBX(%rdi),%rbx - movq VMXCTX_HOST_RIP(%rdi),%rax - movq %rax,(%rsp) /* return address */ +invept_error: + movl $VMX_INVEPT_ERROR, %eax + jmp decode_inst_error + +decode_inst_error: + movl $VM_FAIL_VALID, %r11d + jz inst_error + movl $VM_FAIL_INVALID, %r11d +inst_error: + movl %r11d, VMXCTX_INST_FAIL_STATUS(%rdi) + + /* + * The return value is already populated in %eax so we cannot use + * it as a scratch register beyond this point. + */ /* - * XXX restore host debug registers + * Deactivate guest pmap from this cpu. */ - movl %esi,%eax + movq VMXCTX_PMAP(%rdi), %r11 + movl PCPU(CPUID), %r10d + LK btrl %r10d, PM_ACTIVE(%r11) + + VMX_HOST_RESTORE(%r10) ret -END(vmx_return) +END(vmx_enter_guest) /* - * void vmx_longjmp(void) + * void vmx_exit_guest(void) * %rsp points to the struct vmxctx */ -ENTRY(vmx_longjmp) +ENTRY(vmx_exit_guest) /* * Save guest state that is not automatically saved in the vmcs. */ @@ -242,80 +217,20 @@ ENTRY(vmx_longjmp) movq %rdi,VMXCTX_GUEST_CR2(%rsp) movq %rsp,%rdi - movq $VMX_RETURN_LONGJMP,%rsi - - addq $VMXCTX_TMPSTKTOP,%rsp - callq vmx_return -END(vmx_longjmp) - -/* - * void vmx_resume(struct vmxctx *ctxp) - * %rdi = ctxp - * - * Although the return type is a 'void' this function may return indirectly - * through vmx_setjmp() with a return value of 2. - */ -ENTRY(vmx_resume) - VMX_DISABLE_INTERRUPTS - - VMX_CHECK_AST - - VMX_SET_PM_ACTIVE /* This vcpu is now active on the host cpu */ - - VMX_CHECK_EPTGEN /* Check if we have to invalidate TLB */ - - /* - * Restore guest state that is not automatically loaded from the vmcs. - */ - VMX_GUEST_RESTORE - - vmresume - - /* - * Capture the reason why vmresume failed. - */ - VM_INSTRUCTION_ERROR(%eax, %rsp) - - /* Return via vmx_setjmp with return value of VMX_RETURN_VMRESUME */ - movq %rsp,%rdi - movq $VMX_RETURN_VMRESUME,%rsi - - addq $VMXCTX_TMPSTKTOP,%rsp - callq vmx_return -END(vmx_resume) - -/* - * void vmx_launch(struct vmxctx *ctxp) - * %rdi = ctxp - * - * Although the return type is a 'void' this function may return indirectly - * through vmx_setjmp() with a return value of 3. - */ -ENTRY(vmx_launch) - VMX_DISABLE_INTERRUPTS - - VMX_CHECK_AST - - VMX_SET_PM_ACTIVE /* This vcpu is now active on the host cpu */ - - VMX_CHECK_EPTGEN /* Check if we have to invalidate TLB */ /* - * Restore guest state that is not automatically loaded from the vmcs. + * Deactivate guest pmap from this cpu. */ - VMX_GUEST_RESTORE + movq VMXCTX_PMAP(%rdi), %r11 + movl PCPU(CPUID), %r10d + LK btrl %r10d, PM_ACTIVE(%r11) - vmlaunch + VMX_HOST_RESTORE(%r10) /* - * Capture the reason why vmlaunch failed. + * This will return to the caller of 'vmx_enter_guest()' with a return + * value of VMX_GUEST_VMEXIT. */ - VM_INSTRUCTION_ERROR(%eax, %rsp) - - /* Return via vmx_setjmp with return value of VMX_RETURN_VMLAUNCH */ - movq %rsp,%rdi - movq $VMX_RETURN_VMLAUNCH,%rsi - - addq $VMXCTX_TMPSTKTOP,%rsp - callq vmx_return -END(vmx_launch) + movl $VMX_GUEST_VMEXIT, %eax + ret +END(vmx_exit_guest) Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Thu Apr 17 17:20:56 2014 (r264618) +++ stable/10/usr.sbin/bhyve/bhyverun.c Thu Apr 17 18:00:07 2014 (r264619) @@ -388,10 +388,12 @@ vmexit_vmx(struct vmctx *ctx, struct vm_ fprintf(stderr, "\treason\t\tVMX\n"); fprintf(stderr, "\trip\t\t0x%016lx\n", vmexit->rip); fprintf(stderr, "\tinst_length\t%d\n", vmexit->inst_length); - fprintf(stderr, "\terror\t\t%d\n", vmexit->u.vmx.error); + fprintf(stderr, "\tstatus\t\t%d\n", vmexit->u.vmx.status); fprintf(stderr, "\texit_reason\t%u\n", vmexit->u.vmx.exit_reason); fprintf(stderr, "\tqualification\t0x%016lx\n", vmexit->u.vmx.exit_qualification); + fprintf(stderr, "\tinst_type\t\t%d\n", vmexit->u.vmx.inst_type); + fprintf(stderr, "\tinst_error\t\t%d\n", vmexit->u.vmx.inst_error); return (VMEXIT_ABORT); } Modified: stable/10/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- stable/10/usr.sbin/bhyvectl/bhyvectl.c Thu Apr 17 17:20:56 2014 (r264618) +++ stable/10/usr.sbin/bhyvectl/bhyvectl.c Thu Apr 17 18:00:07 2014 (r264619) @@ -273,11 +273,13 @@ dump_vm_run_exitcode(struct vm_exit *vme break; case VM_EXITCODE_VMX: printf("\treason\t\tVMX\n"); - printf("\terror\t\t%d\n", vmexit->u.vmx.error); + printf("\tstatus\t\t%d\n", vmexit->u.vmx.status); printf("\texit_reason\t0x%08x (%u)\n", vmexit->u.vmx.exit_reason, vmexit->u.vmx.exit_reason); printf("\tqualification\t0x%016lx\n", vmexit->u.vmx.exit_qualification); + printf("\tinst_type\t\t%d\n", vmexit->u.vmx.inst_type); + printf("\tinst_error\t\t%d\n", vmexit->u.vmx.inst_error); break; default: printf("*** unknown vm run exitcode %d\n", vmexit->exitcode); From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 18 00:48:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BFFE3C96; Fri, 18 Apr 2014 00:48: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 A0070175F; Fri, 18 Apr 2014 00:48: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 s3I0mRZs041978; Fri, 18 Apr 2014 00:48:27 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3I0mRCb041976; Fri, 18 Apr 2014 00:48:27 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404180048.s3I0mRCb041976@svn.freebsd.org> From: Devin Teske Date: Fri, 18 Apr 2014 00:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264632 - stable/10/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 00:48:27 -0000 Author: dteske Date: Fri Apr 18 00:48:26 2014 New Revision: 264632 URL: http://svnweb.freebsd.org/changeset/base/264632 Log: MFC r264488: When merging docsinstall and zfsboot updates to stable/9 it was discovered that the slightly older dialog(1) requires --separate-output when using the --checklist widget to force response to produce unquoted values (whereas in stable/10 --checklist widget without --separate-output will only quote the checklist labels in the response if the label is multi-word (contains any whitespace). Since these enhancements (see revisions 263956 and 264437) were developed originally on 10, the --separate-output option was omitted. When merged to stable/9, we (Allan Jude) and I found during testing that the "always- quoting" of the response was causing things like struct interpolation to fail (`f_struct device_$dev' would produce `f_struct device_\"da0\"' for example -- literal quotes inherited from dialog(1) --checklist response). To see the behavior, execute the following on stable/9 versus stable/10: dialog --checklist disks: 0 0 0 da0 "" off da1 "" off Check both items and hit enter. On stable/10, the response is: da0 da1 On stable/9 the response is: "da0" "da1" If you use the --separate-output option, the response is the same for both: da0 da1 So applying --separate-output on every platform until either one of two things occurs 1) dialog(1,3) gets synchronized between stable/9, higher or 2) we drop support for stable/9. Reviewed by: Allan Jude Modified: stable/10/usr.sbin/bsdinstall/scripts/docsinstall stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/docsinstall ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/docsinstall Fri Apr 18 00:02:06 2014 (r264631) +++ stable/10/usr.sbin/bsdinstall/scripts/docsinstall Fri Apr 18 00:48:26 2014 (r264632) @@ -119,6 +119,7 @@ dialog_menu_main() selected=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ + --separate-output \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Fri Apr 18 00:02:06 2014 (r264631) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Fri Apr 18 00:48:26 2014 (r264632) @@ -581,6 +581,7 @@ dialog_menu_layout() selections=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ + --separate-output \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_back\" \ From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 18 07:48:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E5588E3D; Fri, 18 Apr 2014 07:48: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 D17C71FA3; Fri, 18 Apr 2014 07:48: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 s3I7mTTT019354; Fri, 18 Apr 2014 07:48:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3I7mTWq019353; Fri, 18 Apr 2014 07:48:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404180748.s3I7mTWq019353@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 18 Apr 2014 07:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264640 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 07:48:30 -0000 Author: hselasky Date: Fri Apr 18 07:48:29 2014 New Revision: 264640 URL: http://svnweb.freebsd.org/changeset/base/264640 Log: MFC r264340: Correct IMOD default value according to comment. Modified: stable/10/sys/dev/usb/controller/xhcireg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhcireg.h ============================================================================== --- stable/10/sys/dev/usb/controller/xhcireg.h Fri Apr 18 07:46:26 2014 (r264639) +++ stable/10/sys/dev/usb/controller/xhcireg.h Fri Apr 18 07:48:29 2014 (r264640) @@ -166,7 +166,7 @@ #define XHCI_IMOD_IVAL_SET(x) (((x) & 0xFFFF) << 0) /* 250ns unit */ #define XHCI_IMOD_ICNT_GET(x) (((x) >> 16) & 0xFFFF) /* 250ns unit */ #define XHCI_IMOD_ICNT_SET(x) (((x) & 0xFFFF) << 16) /* 250ns unit */ -#define XHCI_IMOD_DEFAULT 0x000003E8U /* 8000 IRQ/second */ +#define XHCI_IMOD_DEFAULT 0x000001F4U /* 8000 IRQ/second */ #define XHCI_ERSTSZ(n) (0x0028 + (0x20 * (n))) /* XHCI event ring segment table size */ #define XHCI_ERSTS_GET(x) ((x) & 0xFFFF) #define XHCI_ERSTS_SET(x) ((x) & 0xFFFF) From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 18 07:50:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 473B2FC2; Fri, 18 Apr 2014 07:50: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 345281052; Fri, 18 Apr 2014 07:50: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 s3I7oQkP020000; Fri, 18 Apr 2014 07:50:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3I7oPus019998; Fri, 18 Apr 2014 07:50:25 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404180750.s3I7oPus019998@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 18 Apr 2014 07:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264641 - stable/10/lib/libusb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 07:50:26 -0000 Author: hselasky Date: Fri Apr 18 07:50:25 2014 New Revision: 264641 URL: http://svnweb.freebsd.org/changeset/base/264641 Log: MFC r264344: Tune buffer sizes for SuperSpeed USB when using LibUSB v0.1 and v1.0 APIs to increase the maximum bandwidth limit. Modified: stable/10/lib/libusb/libusb01.c stable/10/lib/libusb/libusb10.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libusb/libusb01.c ============================================================================== --- stable/10/lib/libusb/libusb01.c Fri Apr 18 07:48:29 2014 (r264640) +++ stable/10/lib/libusb/libusb01.c Fri Apr 18 07:50:25 2014 (r264641) @@ -127,6 +127,8 @@ usb_get_transfer_by_ep_no(usb_dev_handle bufsize = 256; } else if (speed == LIBUSB20_SPEED_FULL) { bufsize = 4096; + } else if (speed == LIBUSB20_SPEED_SUPER) { + bufsize = 65536; } else { bufsize = 16384; } Modified: stable/10/lib/libusb/libusb10.c ============================================================================== --- stable/10/lib/libusb/libusb10.c Fri Apr 18 07:48:29 2014 (r264640) +++ stable/10/lib/libusb/libusb10.c Fri Apr 18 07:50:25 2014 (r264641) @@ -935,6 +935,9 @@ libusb10_get_buffsize(struct libusb20_de case LIBUSB20_SPEED_FULL: ret = 4096; break; + case LIBUSB20_SPEED_SUPER: + ret = 65536; + break; default: ret = 16384; break; From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 20 01:37:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1FF30ADE; Sun, 20 Apr 2014 01:37: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 0C60A16F2; Sun, 20 Apr 2014 01:37:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3K1bU4k054601; Sun, 20 Apr 2014 01:37:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3K1bUqG054600; Sun, 20 Apr 2014 01:37:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404200137.s3K1bUqG054600@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 20 Apr 2014 01:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264684 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 01:37:31 -0000 Author: kib Date: Sun Apr 20 01:37:30 2014 New Revision: 264684 URL: http://svnweb.freebsd.org/changeset/base/264684 Log: MFC r264620: Fix typo. Modified: stable/10/sys/kern/subr_fattime.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_fattime.c ============================================================================== --- stable/10/sys/kern/subr_fattime.c Sat Apr 19 22:18:57 2014 (r264683) +++ stable/10/sys/kern/subr_fattime.c Sun Apr 20 01:37:30 2014 (r264684) @@ -49,7 +49,7 @@ * "New Technology". Anyway... * * The 'utc' argument determines if the resulting FATTIME timestamp - * should b on the UTC or local timezone calendar. + * should be on the UTC or local timezone calendar. * * The conversion functions below cut time into four-year leap-second * cycles rather than single years and uses table lookups inside those From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 20 06:46:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7D337C2C; Sun, 20 Apr 2014 06:46: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 4F27A1052; Sun, 20 Apr 2014 06:46: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 s3K6k52O080846; Sun, 20 Apr 2014 06:46:05 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3K6k5SD080845; Sun, 20 Apr 2014 06:46:05 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201404200646.s3K6k5SD080845@svn.freebsd.org> From: "George V. Neville-Neil" Date: Sun, 20 Apr 2014 06:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264688 - stable/10/usr.sbin/arp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 06:46:05 -0000 Author: gnn Date: Sun Apr 20 06:46:04 2014 New Revision: 264688 URL: http://svnweb.freebsd.org/changeset/base/264688 Log: MFC: 264174 Speed up the lookup of interfaces when there are a large number of them, such in a system with a large number of VLANs. Submitted by: Nick Rogers Modified: stable/10/usr.sbin/arp/arp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/arp/arp.c ============================================================================== --- stable/10/usr.sbin/arp/arp.c Sun Apr 20 05:40:13 2014 (r264687) +++ stable/10/usr.sbin/arp/arp.c Sun Apr 20 06:46:04 2014 (r264688) @@ -104,6 +104,8 @@ static char *rifname; static time_t expire_time; static int flags, doing_proxy; +struct if_nameindex *ifnameindex; + /* which function we're supposed to do */ #define F_GET 1 #define F_SET 2 @@ -200,6 +202,9 @@ main(int argc, char *argv[]) break; } + if (ifnameindex != NULL) + if_freenameindex(ifnameindex); + return (rtn); } @@ -558,8 +563,6 @@ search(u_long addr, action_fn *action) /* * Display an arp entry */ -static char lifname[IF_NAMESIZE]; -static int64_t lifindex = -1; static void print_entry(struct sockaddr_dl *sdl, @@ -568,8 +571,13 @@ print_entry(struct sockaddr_dl *sdl, const char *host; struct hostent *hp; struct iso88025_sockaddr_dl_data *trld; + struct if_nameindex *p; int seg; + if (ifnameindex == NULL) + if ((ifnameindex = if_nameindex()) == NULL) + err(1, "cannot retrieve interface names"); + if (nflag == 0) hp = gethostbyaddr((caddr_t)&(addr->sin_addr), sizeof addr->sin_addr, AF_INET); @@ -596,12 +604,15 @@ print_entry(struct sockaddr_dl *sdl, } } else printf("(incomplete)"); - if (sdl->sdl_index != lifindex && - if_indextoname(sdl->sdl_index, lifname) != NULL) { - lifindex = sdl->sdl_index; - printf(" on %s", lifname); - } else if (sdl->sdl_index == lifindex) - printf(" on %s", lifname); + + for (p = ifnameindex; p && ifnameindex->if_index && + ifnameindex->if_name; p++) { + if (p->if_index == sdl->sdl_index) { + printf(" on %s", p->if_name); + break; + } + } + if (rtm->rtm_rmx.rmx_expire == 0) printf(" permanent"); else { From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 20 12:46:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F1CD5F61; Sun, 20 Apr 2014 12:46: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 D37371B98; Sun, 20 Apr 2014 12:46: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 s3KCkKoj027269; Sun, 20 Apr 2014 12:46:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KCkI5L027257; Sun, 20 Apr 2014 12:46:18 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404201246.s3KCkI5L027257@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 20 Apr 2014 12:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264692 - stable/10/crypto/openssh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 12:46:21 -0000 Author: des Date: Sun Apr 20 12:46:18 2014 New Revision: 264692 URL: http://svnweb.freebsd.org/changeset/base/264692 Log: MFH (r264691): merge upstream patch for EC calculation bug Modified: stable/10/crypto/openssh/bufaux.c stable/10/crypto/openssh/compat.c stable/10/crypto/openssh/compat.h stable/10/crypto/openssh/ssh_config stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/sshconnect2.c stable/10/crypto/openssh/sshd.c stable/10/crypto/openssh/sshd_config stable/10/crypto/openssh/sshd_config.5 stable/10/crypto/openssh/version.h Directory Properties: stable/10/ (props changed) Modified: stable/10/crypto/openssh/bufaux.c ============================================================================== --- stable/10/crypto/openssh/bufaux.c Sun Apr 20 11:34:33 2014 (r264691) +++ stable/10/crypto/openssh/bufaux.c Sun Apr 20 12:46:18 2014 (r264692) @@ -1,4 +1,4 @@ -/* $OpenBSD: bufaux.c,v 1.56 2014/02/02 03:44:31 djm Exp $ */ +/* $OpenBSD: bufaux.c,v 1.57 2014/04/16 23:22:45 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -372,6 +372,9 @@ buffer_put_bignum2_from_string(Buffer *b if (l > 8 * 1024) fatal("%s: length %u too long", __func__, l); + /* Skip leading zero bytes */ + for (; l > 0 && *s == 0; l--, s++) + ; p = buf = xmalloc(l + 1); /* * If most significant bit is set then prepend a zero byte to Modified: stable/10/crypto/openssh/compat.c ============================================================================== --- stable/10/crypto/openssh/compat.c Sun Apr 20 11:34:33 2014 (r264691) +++ stable/10/crypto/openssh/compat.c Sun Apr 20 12:46:18 2014 (r264692) @@ -96,6 +96,9 @@ compat_datafellows(const char *version) { "Sun_SSH_1.0*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF}, { "OpenSSH_4*", 0 }, { "OpenSSH_5*", SSH_NEW_OPENSSH|SSH_BUG_DYNAMIC_RPORT}, + { "OpenSSH_6.6.1*", SSH_NEW_OPENSSH}, + { "OpenSSH_6.5*," + "OpenSSH_6.6*", SSH_NEW_OPENSSH|SSH_BUG_CURVE25519PAD}, { "OpenSSH*", SSH_NEW_OPENSSH }, { "*MindTerm*", 0 }, { "2.1.0*", SSH_BUG_SIGBLOB|SSH_BUG_HMAC| @@ -262,7 +265,6 @@ compat_cipher_proposal(char *cipher_prop return cipher_prop; } - char * compat_pkalg_proposal(char *pkalg_prop) { @@ -276,3 +278,16 @@ compat_pkalg_proposal(char *pkalg_prop) return pkalg_prop; } +char * +compat_kex_proposal(char *kex_prop) +{ + if (!(datafellows & SSH_BUG_CURVE25519PAD)) + return kex_prop; + debug2("%s: original KEX proposal: %s", __func__, kex_prop); + kex_prop = filter_proposal(kex_prop, "curve25519-sha256@libssh.org"); + debug2("%s: compat KEX proposal: %s", __func__, kex_prop); + if (*kex_prop == '\0') + fatal("No supported key exchange algorithms found"); + return kex_prop; +} + Modified: stable/10/crypto/openssh/compat.h ============================================================================== --- stable/10/crypto/openssh/compat.h Sun Apr 20 11:34:33 2014 (r264691) +++ stable/10/crypto/openssh/compat.h Sun Apr 20 12:46:18 2014 (r264692) @@ -60,7 +60,9 @@ #define SSH_BUG_RFWD_ADDR 0x02000000 #define SSH_NEW_OPENSSH 0x04000000 #define SSH_BUG_DYNAMIC_RPORT 0x08000000 -#define SSH_BUG_LARGEWINDOW 0x10000000 +#define SSH_BUG_CURVE25519PAD 0x10000000 + +#define SSH_BUG_LARGEWINDOW 0x80000000 void enable_compat13(void); void enable_compat20(void); @@ -68,6 +70,7 @@ void compat_datafellows(const char * int proto_spec(const char *); char *compat_cipher_proposal(char *); char *compat_pkalg_proposal(char *); +char *compat_kex_proposal(char *); extern int compat13; extern int compat20; Modified: stable/10/crypto/openssh/ssh_config ============================================================================== --- stable/10/crypto/openssh/ssh_config Sun Apr 20 11:34:33 2014 (r264691) +++ stable/10/crypto/openssh/ssh_config Sun Apr 20 12:46:18 2014 (r264692) @@ -48,4 +48,4 @@ # ProxyCommand ssh -q -W %h:%p gateway.example.com # RekeyLimit 1G 1h # VerifyHostKeyDNS yes -# VersionAddendum FreeBSD-20140324 +# VersionAddendum FreeBSD-20140420 Modified: stable/10/crypto/openssh/ssh_config.5 ============================================================================== --- stable/10/crypto/openssh/ssh_config.5 Sun Apr 20 11:34:33 2014 (r264691) +++ stable/10/crypto/openssh/ssh_config.5 Sun Apr 20 12:46:18 2014 (r264692) @@ -1423,7 +1423,7 @@ See also VERIFYING HOST KEYS in Specifies a string to append to the regular version string to identify OS- or site-specific modifications. The default is -.Dq FreeBSD-20140324 . +.Dq FreeBSD-20140420 . .It Cm VisualHostKey If this flag is set to .Dq yes , Modified: stable/10/crypto/openssh/sshconnect2.c ============================================================================== --- stable/10/crypto/openssh/sshconnect2.c Sun Apr 20 11:34:33 2014 (r264691) +++ stable/10/crypto/openssh/sshconnect2.c Sun Apr 20 12:46:18 2014 (r264692) @@ -206,6 +206,8 @@ ssh_kex2(char *host, struct sockaddr *ho } if (options.kex_algorithms != NULL) myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; + myproposal[PROPOSAL_KEX_ALGS] = compat_kex_proposal( + myproposal[PROPOSAL_KEX_ALGS]); if (options.rekey_limit || options.rekey_interval) packet_set_rekey_limits((u_int32_t)options.rekey_limit, Modified: stable/10/crypto/openssh/sshd.c ============================================================================== --- stable/10/crypto/openssh/sshd.c Sun Apr 20 11:34:33 2014 (r264691) +++ stable/10/crypto/openssh/sshd.c Sun Apr 20 12:46:18 2014 (r264692) @@ -2528,6 +2528,9 @@ do_ssh2_kex(void) if (options.kex_algorithms != NULL) myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; + myproposal[PROPOSAL_KEX_ALGS] = compat_kex_proposal( + myproposal[PROPOSAL_KEX_ALGS]); + if (options.rekey_limit || options.rekey_interval) packet_set_rekey_limits((u_int32_t)options.rekey_limit, (time_t)options.rekey_interval); Modified: stable/10/crypto/openssh/sshd_config ============================================================================== --- stable/10/crypto/openssh/sshd_config Sun Apr 20 11:34:33 2014 (r264691) +++ stable/10/crypto/openssh/sshd_config Sun Apr 20 12:46:18 2014 (r264692) @@ -120,7 +120,7 @@ #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none -#VersionAddendum FreeBSD-20140324 +#VersionAddendum FreeBSD-20140420 # no default banner path #Banner none Modified: stable/10/crypto/openssh/sshd_config.5 ============================================================================== --- stable/10/crypto/openssh/sshd_config.5 Sun Apr 20 11:34:33 2014 (r264691) +++ stable/10/crypto/openssh/sshd_config.5 Sun Apr 20 12:46:18 2014 (r264692) @@ -1253,7 +1253,7 @@ restrictions. Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default is -.Dq FreeBSD-20140324 . +.Dq FreeBSD-20140420 . .It Cm X11DisplayOffset Specifies the first display number available for .Xr sshd 8 Ns 's Modified: stable/10/crypto/openssh/version.h ============================================================================== --- stable/10/crypto/openssh/version.h Sun Apr 20 11:34:33 2014 (r264691) +++ stable/10/crypto/openssh/version.h Sun Apr 20 12:46:18 2014 (r264692) @@ -1,10 +1,10 @@ /* $OpenBSD: version.h,v 1.70 2014/02/27 22:57:40 djm Exp $ */ /* $FreeBSD$ */ -#define SSH_VERSION "OpenSSH_6.6" +#define SSH_VERSION "OpenSSH_6.6.1" #define SSH_PORTABLE "p1" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE -#define SSH_VERSION_FREEBSD "FreeBSD-20140324" +#define SSH_VERSION_FREEBSD "FreeBSD-20140420" #define SSH_VERSION_HPN "_hpn13v11" From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 20 22:57:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5F5F53EE; Sun, 20 Apr 2014 22:57: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 4B96C1CB6; Sun, 20 Apr 2014 22:57: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 s3KMvGhW086127; Sun, 20 Apr 2014 22:57:16 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KMvG1l086126; Sun, 20 Apr 2014 22:57:16 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404202257.s3KMvG1l086126@svn.freebsd.org> From: Glen Barber Date: Sun, 20 Apr 2014 22:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264706 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 22:57:16 -0000 Author: gjb Date: Sun Apr 20 22:57:15 2014 New Revision: 264706 URL: http://svnweb.freebsd.org/changeset/base/264706 Log: MFC r260689 (partial): Remove 'of course' statement from upgrading note. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 20 22:19:00 2014 (r264705) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Apr 20 22:57:15 2014 (r264706) @@ -260,7 +260,7 @@ /usr/src/UPDATING. - Upgrading &os; should, of course, only be attempted after + Upgrading &os; should only be attempted after backing up all data and configuration files. From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 21 02:48:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0307F16D; Mon, 21 Apr 2014 02:48: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 E2A2710D6; Mon, 21 Apr 2014 02:48: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 s3L2m4Cj080849; Mon, 21 Apr 2014 02:48:04 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3L2m4Ze080848; Mon, 21 Apr 2014 02:48:04 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404210248.s3L2m4Ze080848@svn.freebsd.org> From: Bryan Drewery Date: Mon, 21 Apr 2014 02:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264712 - stable/10/sys/geom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 02:48:05 -0000 Author: bdrewery Date: Mon Apr 21 02:48:04 2014 New Revision: 264712 URL: http://svnweb.freebsd.org/changeset/base/264712 Log: MFC r264320: Fix spelling error in g_trace() call. Modified: stable/10/sys/geom/geom_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Mon Apr 21 02:09:14 2014 (r264711) +++ stable/10/sys/geom/geom_disk.c Mon Apr 21 02:48:04 2014 (r264712) @@ -184,7 +184,7 @@ g_disk_kerneldump(struct bio *bp, struct gkd = (struct g_kerneldump*)bp->bio_data; gp = bp->bio_to->geom; - g_trace(G_T_TOPOLOGY, "g_disk_kernedump(%s, %jd, %jd)", + g_trace(G_T_TOPOLOGY, "g_disk_kerneldump(%s, %jd, %jd)", gp->name, (intmax_t)gkd->offset, (intmax_t)gkd->length); if (dp->d_dump == NULL) { g_io_deliver(bp, ENODEV); From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 21 02:49:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 404702A1; Mon, 21 Apr 2014 02:49: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 2BFCD10DE; Mon, 21 Apr 2014 02:49: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 s3L2ngxp081036; Mon, 21 Apr 2014 02:49:42 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3L2ngHw081035; Mon, 21 Apr 2014 02:49:42 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404210249.s3L2ngHw081035@svn.freebsd.org> From: Bryan Drewery Date: Mon, 21 Apr 2014 02:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264713 - stable/10/sys/geom/mirror X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 02:49:42 -0000 Author: bdrewery Date: Mon Apr 21 02:49:41 2014 New Revision: 264713 URL: http://svnweb.freebsd.org/changeset/base/264713 Log: MFC r264142: Show error code when failing to destroy a mirror on delay Modified: stable/10/sys/geom/mirror/g_mirror.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/10/sys/geom/mirror/g_mirror.c Mon Apr 21 02:48:04 2014 (r264712) +++ stable/10/sys/geom/mirror/g_mirror.c Mon Apr 21 02:49:41 2014 (r264713) @@ -2824,7 +2824,8 @@ g_mirror_destroy_delayed(void *arg, int G_MIRROR_DEBUG(1, "Destroying %s (delayed).", sc->sc_name); error = g_mirror_destroy(sc, G_MIRROR_DESTROY_SOFT); if (error != 0) { - G_MIRROR_DEBUG(0, "Cannot destroy %s.", sc->sc_name); + G_MIRROR_DEBUG(0, "Cannot destroy %s (error=%d).", + sc->sc_name, error); sx_xunlock(&sc->sc_lock); } g_topology_lock(); From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 21 02:55:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 376EA8C1; Mon, 21 Apr 2014 02:55: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 09516118B; Mon, 21 Apr 2014 02:55: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 s3L2tR2x084853; Mon, 21 Apr 2014 02:55:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3L2tR0j084852; Mon, 21 Apr 2014 02:55:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404210255.s3L2tR0j084852@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 21 Apr 2014 02:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264718 - stable/10/libexec/rtld-elf/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 02:55:28 -0000 Author: kib Date: Mon Apr 21 02:55:27 2014 New Revision: 264718 URL: http://svnweb.freebsd.org/changeset/base/264718 Log: MFC r264481: Add dwarf annotations to the amd64 _rtld_bind_start to allow debuggers to unwind around the calls from PLT to binder. Modified: stable/10/libexec/rtld-elf/amd64/rtld_start.S Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/amd64/rtld_start.S ============================================================================== --- stable/10/libexec/rtld-elf/amd64/rtld_start.S Mon Apr 21 02:54:15 2014 (r264717) +++ stable/10/libexec/rtld-elf/amd64/rtld_start.S Mon Apr 21 02:55:27 2014 (r264718) @@ -79,17 +79,39 @@ .globl _rtld_bind_start .type _rtld_bind_start,@function _rtld_bind_start: + .cfi_startproc + .cfi_adjust_cfa_offset 16 subq $8,%rsp + .cfi_adjust_cfa_offset 8 pushfq # Save rflags + .cfi_adjust_cfa_offset 8 pushq %rax # Save %rax + .cfi_adjust_cfa_offset 8 + .cfi_offset %rax,-32 pushq %rdx # Save %rdx + .cfi_adjust_cfa_offset 8 + .cfi_offset %rdx,-40 pushq %rcx # Save %rcx + .cfi_adjust_cfa_offset 8 + .cfi_offset %rcx,-48 pushq %rsi # Save %rsi + .cfi_adjust_cfa_offset 8 + .cfi_offset %rsi,-56 pushq %rdi # Save %rdi + .cfi_adjust_cfa_offset 8 + .cfi_offset %rdi,-64 pushq %r8 # Save %r8 + .cfi_adjust_cfa_offset 8 + .cfi_offset %r8,-72 pushq %r9 # Save %r9 + .cfi_adjust_cfa_offset 8 + .cfi_offset %r9,-80 pushq %r10 # Save %r10 + .cfi_adjust_cfa_offset 8 + .cfi_offset %r10,-88 pushq %r11 # Save %r11 + .cfi_adjust_cfa_offset 8 + .cfi_offset %r11,-96 movq 0x58(%rsp),%rdi # Fetch obj argument movq 0x60(%rsp),%rsi # Fetch reloff argument @@ -101,16 +123,37 @@ _rtld_bind_start: movq %rax,0x60(%rsp) # Store target over reloff argument popq %r11 # Restore %r11 + .cfi_adjust_cfa_offset -8 + .cfi_restore %r11 popq %r10 # Restore %r10 + .cfi_adjust_cfa_offset -8 + .cfi_restore %r10 popq %r9 # Restore %r9 + .cfi_adjust_cfa_offset -8 + .cfi_restore %r9 popq %r8 # Restore %r8 + .cfi_adjust_cfa_offset -8 + .cfi_restore %r8 popq %rdi # Restore %rdi + .cfi_adjust_cfa_offset -8 + .cfi_restore %rdi popq %rsi # Restore %rsi + .cfi_adjust_cfa_offset -8 + .cfi_restore %rsi popq %rcx # Restore %rcx + .cfi_adjust_cfa_offset -8 + .cfi_restore %rcx popq %rdx # Restore %rdx + .cfi_adjust_cfa_offset -8 + .cfi_restore %rdx popq %rax # Restore %rax + .cfi_adjust_cfa_offset -8 + .cfi_restore %rax popfq # Restore rflags + .cfi_adjust_cfa_offset -8 leaq 16(%rsp),%rsp # Discard spare, obj, do not change rflags ret # "Return" to target address + .cfi_endproc + .size _rtld_bind_start, . - _rtld_bind_start .section .note.GNU-stack,"",%progbits From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 21 11:17:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 801DEA08; Mon, 21 Apr 2014 11:17: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 6BD521B99; Mon, 21 Apr 2014 11:17: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 s3LBHUH1088446; Mon, 21 Apr 2014 11:17:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LBHUDL088445; Mon, 21 Apr 2014 11:17:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404211117.s3LBHUDL088445@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 21 Apr 2014 11:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264722 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 11:17:30 -0000 Author: ae Date: Mon Apr 21 11:17:29 2014 New Revision: 264722 URL: http://svnweb.freebsd.org/changeset/base/264722 Log: MFC r264364: Properly release the in6_multi lock. Sponsored by: Yandex LLC Modified: stable/10/sys/netinet6/in6_mcast.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/in6_mcast.c ============================================================================== --- stable/10/sys/netinet6/in6_mcast.c Mon Apr 21 09:43:22 2014 (r264721) +++ stable/10/sys/netinet6/in6_mcast.c Mon Apr 21 11:17:29 2014 (r264722) @@ -1449,16 +1449,15 @@ in6p_block_unblock_source(struct inpcb * CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", __func__); } - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) - CTR1(KTR_MLD, "%s: failed mld downcall", __func__); - IN6_MULTI_UNLOCK(); out_im6f_rollback: @@ -2046,29 +2045,27 @@ in6p_join_group(struct inpcb *inp, struc if (is_new) { error = in6_mc_join_locked(ifp, &gsa->sin6.sin6_addr, imf, &inm, 0); - if (error) + if (error) { + IN6_MULTI_UNLOCK(); goto out_im6o_free; + } imo->im6o_membership[idx] = inm; } else { CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; - } - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) { - CTR1(KTR_MLD, "%s: failed mld downcall", - __func__); - goto out_im6f_rollback; + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", + __func__); } } IN6_MULTI_UNLOCK(); - -out_im6f_rollback: INP_WLOCK_ASSERT(inp); if (error) { im6f_rollback(imf); @@ -2295,23 +2292,20 @@ in6p_leave_group(struct inpcb *inp, stru } else { CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; - } - - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) { - CTR1(KTR_MLD, "%s: failed mld downcall", - __func__); + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", + __func__); } } IN6_MULTI_UNLOCK(); -out_im6f_rollback: if (error) im6f_rollback(imf); else @@ -2520,16 +2514,15 @@ in6p_set_source_filters(struct inpcb *in */ CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", __func__); } - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) - CTR1(KTR_MLD, "%s: failed mld downcall", __func__); - IN6_MULTI_UNLOCK(); out_im6f_rollback: From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 21 16:26:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F2DFB459; Mon, 21 Apr 2014 16:26: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 DE9FA1928; Mon, 21 Apr 2014 16:26: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 s3LGQPfX015297; Mon, 21 Apr 2014 16:26:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LGQPKr015291; Mon, 21 Apr 2014 16:26:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404211626.s3LGQPKr015291@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Apr 2014 16:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264727 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 16:26:26 -0000 Author: mav Date: Mon Apr 21 16:26:24 2014 New Revision: 264727 URL: http://svnweb.freebsd.org/changeset/base/264727 Log: MFC r264191: Report stripe size and offset of the backing device in READ CAPACITY (16) as physical sector size and offset. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend.h stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Mon Apr 21 15:36:28 2014 (r264726) +++ stable/10/sys/cam/ctl/ctl.c Mon Apr 21 16:26:24 2014 (r264727) @@ -6883,6 +6883,8 @@ ctl_read_capacity_16(struct ctl_scsiio * scsi_u64to8b(lun->be_lun->maxlba, data->addr); /* XXX KDM this may not be 512 bytes... */ scsi_ulto4b(lun->be_lun->blocksize, data->length); + data->prot_lbppbe = lun->be_lun->pblockexp & SRC16_LBPPBE; + scsi_ulto2b(lun->be_lun->pblockoff & SRC16_LALBA_A, data->lalba_lbp); ctsio->scsi_status = SCSI_STATUS_OK; Modified: stable/10/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.h Mon Apr 21 15:36:28 2014 (r264726) +++ stable/10/sys/cam/ctl/ctl_backend.h Mon Apr 21 16:26:24 2014 (r264727) @@ -137,6 +137,10 @@ typedef void (*be_lun_config_t)(void *be * this should be 512. In theory CTL should be able to handle other block * sizes. Host application software may not deal with it very well, though. * + * pblockexp is the log2() of number of LBAs on the LUN per physical sector. + * + * pblockoff is the lowest LBA on the LUN aligned ot physical sector. + * * req_lun_id is the requested LUN ID. CTL only pays attention to this * field if the CTL_LUN_FLAG_ID_REQ flag is set. If the requested LUN ID is * not available, the LUN addition will fail. If a particular LUN ID isn't @@ -185,6 +189,8 @@ struct ctl_be_lun { void *be_lun; /* passed to CTL */ uint64_t maxlba; /* passed to CTL */ uint32_t blocksize; /* passed to CTL */ + uint16_t pblockexp; /* passed to CTL */ + uint16_t pblockoff; /* passed to CTL */ uint32_t req_lun_id; /* passed to CTL */ uint32_t lun_id; /* returned from CTL */ uint8_t serial_num[CTL_SN_LEN]; /* passed to CTL */ Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Mon Apr 21 15:36:28 2014 (r264726) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Mon Apr 21 16:26:24 2014 (r264727) @@ -158,6 +158,8 @@ struct ctl_be_block_lun { uint64_t size_bytes; uint32_t blocksize; int blocksize_shift; + uint16_t pblockexp; + uint16_t pblockoff; struct ctl_be_block_softc *softc; struct devstat *disk_stats; ctl_be_block_lun_flags flags; @@ -1370,6 +1372,7 @@ ctl_be_block_open_dev(struct ctl_be_bloc struct cdev *dev; struct cdevsw *devsw; int error; + off_t ps, pss, po, pos; params = &req->reqdata.create; @@ -1467,6 +1470,24 @@ ctl_be_block_open_dev(struct ctl_be_bloc be_lun->size_bytes = params->lun_size_bytes; } + error = devsw->d_ioctl(dev, DIOCGSTRIPESIZE, + (caddr_t)&ps, FREAD, curthread); + if (error) + ps = po = 0; + else { + error = devsw->d_ioctl(dev, DIOCGSTRIPEOFFSET, + (caddr_t)&po, FREAD, curthread); + if (error) + po = 0; + } + pss = ps / be_lun->blocksize; + pos = po / be_lun->blocksize; + if ((pss > 0) && (pss * be_lun->blocksize == ps) && (pss >= pos) && + ((pss & (pss - 1)) == 0) && (pos * be_lun->blocksize == po)) { + be_lun->pblockexp = fls(pss) - 1; + be_lun->pblockoff = (pss - pos) % pss; + } + return (0); } @@ -1691,6 +1712,8 @@ ctl_be_block_create(struct ctl_be_block_ * For processor devices, we don't have any size. */ be_lun->blocksize = 0; + be_lun->pblockexp = 0; + be_lun->pblockoff = 0; be_lun->size_blocks = 0; be_lun->size_bytes = 0; be_lun->ctl_be_lun.maxlba = 0; @@ -1751,6 +1774,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; be_lun->ctl_be_lun.be_lun = be_lun; be_lun->ctl_be_lun.blocksize = be_lun->blocksize; + be_lun->ctl_be_lun.pblockexp = be_lun->pblockexp; + be_lun->ctl_be_lun.pblockoff = be_lun->pblockoff; /* Tell the user the blocksize we ended up using */ params->blocksize_bytes = be_lun->blocksize; if (params->flags & CTL_LUN_FLAG_ID_REQ) { From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 21 16:33:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0708F8BD; Mon, 21 Apr 2014 16: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 E684019FA; Mon, 21 Apr 2014 16:33: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 s3LGXnoF019166; Mon, 21 Apr 2014 16:33:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LGXnon019165; Mon, 21 Apr 2014 16:33:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404211633.s3LGXnon019165@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Apr 2014 16:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264729 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 16:33:50 -0000 Author: mav Date: Mon Apr 21 16:33:49 2014 New Revision: 264729 URL: http://svnweb.freebsd.org/changeset/base/264729 Log: MFC r264341: Create zvol devices on zfs clone. While big and shiny patch is not ready, it is better to have something. PR: kern/178999 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Apr 21 16:29:54 2014 (r264728) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Apr 21 16:33:49 2014 (r264729) @@ -3352,6 +3352,10 @@ zfs_ioc_clone(const char *fsname, nvlist if (error != 0) (void) dsl_destroy_head(fsname); } +#ifdef __FreeBSD__ + if (error == 0) + zvol_create_minors(fsname); +#endif return (error); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 21 16:42:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A69C0EAF; Mon, 21 Apr 2014 16:42: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 88CA51AD3; Mon, 21 Apr 2014 16:42: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 s3LGgFwa023476; Mon, 21 Apr 2014 16:42:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LGgFwL023475; Mon, 21 Apr 2014 16:42:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404211642.s3LGgFwL023475@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Apr 2014 16:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264732 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 16:42:15 -0000 Author: mav Date: Mon Apr 21 16:42:15 2014 New Revision: 264732 URL: http://svnweb.freebsd.org/changeset/base/264732 Log: MFC r264077: Add BIO_DELETE support to ZVOL. It is an adapted merge from the vendor branch of: 701 UNMAP support for COMSTAR (in part related to ZFS) 2130 zvol DKIOCFREE uses nested DMU transactions Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Apr 21 16:35:19 2014 (r264731) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Apr 21 16:42:15 2014 (r264732) @@ -25,9 +25,12 @@ * All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * + * Portions Copyright 2010 Robert Milkowski + * + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ -/* Portions Copyright 2010 Robert Milkowski */ /* Portions Copyright 2011 Martin Matuska */ /* @@ -153,6 +156,8 @@ int zvol_maxphys = DMU_MAX_ACCESS/2; extern int zfs_set_prop_nvlist(const char *, zprop_source_t, nvlist_t *, nvlist_t *); +static void zvol_log_truncate(zvol_state_t *zv, dmu_tx_t *tx, uint64_t off, + uint64_t len, boolean_t sync); static int zvol_remove_zv(zvol_state_t *); static int zvol_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio); static int zvol_dumpify(zvol_state_t *zv); @@ -386,6 +391,24 @@ zvol_create_cb(objset_t *os, void *arg, } /* + * Replay a TX_TRUNCATE ZIL transaction if asked. TX_TRUNCATE is how we + * implement DKIOCFREE/free-long-range. + */ +static int +zvol_replay_truncate(zvol_state_t *zv, lr_truncate_t *lr, boolean_t byteswap) +{ + uint64_t offset, length; + + if (byteswap) + byteswap_uint64_array(lr, sizeof (*lr)); + + offset = lr->lr_offset; + length = lr->lr_length; + + return (dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, offset, length)); +} + +/* * Replay a TX_WRITE ZIL transaction that didn't get committed * after a system failure */ @@ -435,7 +458,7 @@ zvol_replay_err(zvol_state_t *zv, lr_t * /* * Callback vectors for replaying records. - * Only TX_WRITE is needed for zvol. + * Only TX_WRITE and TX_TRUNCATE are needed for zvol. */ zil_replay_func_t *zvol_replay_vector[TX_MAX_TYPE] = { zvol_replay_err, /* 0 no such transaction type */ @@ -448,7 +471,7 @@ zil_replay_func_t *zvol_replay_vector[TX zvol_replay_err, /* TX_LINK */ zvol_replay_err, /* TX_RENAME */ zvol_replay_write, /* TX_WRITE */ - zvol_replay_err, /* TX_TRUNCATE */ + zvol_replay_truncate, /* TX_TRUNCATE */ zvol_replay_err, /* TX_SETATTR */ zvol_replay_err, /* TX_ACL */ zvol_replay_err, /* TX_CREATE_ACL */ @@ -1316,6 +1339,21 @@ zvol_strategy(struct bio *bp) rl = zfs_range_lock(&zv->zv_znode, off, resid, doread ? RL_READER : RL_WRITER); + if (bp->bio_cmd == BIO_DELETE) { + dmu_tx_t *tx = dmu_tx_create(zv->zv_objset); + error = dmu_tx_assign(tx, TXG_WAIT); + if (error != 0) { + dmu_tx_abort(tx); + } else { + zvol_log_truncate(zv, tx, off, resid, B_TRUE); + dmu_tx_commit(tx); + error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, + off, resid); + resid = 0; + } + goto unlock; + } + while (resid != 0 && off < volsize) { size_t size = MIN(resid, zvol_maxphys); #ifdef illumos @@ -1351,6 +1389,7 @@ zvol_strategy(struct bio *bp) addr += size; resid -= size; } +unlock: zfs_range_unlock(rl); bp->bio_completed = bp->bio_length - resid; @@ -1648,9 +1687,36 @@ zvol_log_write_minor(void *minor_hdl, dm /* * END entry points to allow external callers access to the volume. */ +#endif /* sun */ /* + * Log a DKIOCFREE/free-long-range to the ZIL with TX_TRUNCATE. + */ +static void +zvol_log_truncate(zvol_state_t *zv, dmu_tx_t *tx, uint64_t off, uint64_t len, + boolean_t sync) +{ + itx_t *itx; + lr_truncate_t *lr; + zilog_t *zilog = zv->zv_zilog; + + if (zil_replaying(zilog, tx)) + return; + + itx = zil_itx_create(TX_TRUNCATE, sizeof (*lr)); + lr = (lr_truncate_t *)&itx->itx_lr; + lr->lr_foid = ZVOL_OBJ; + lr->lr_offset = off; + lr->lr_length = len; + + itx->itx_sync = sync; + zil_itx_assign(zilog, itx, tx); +} + +#ifdef sun +/* * Dirtbag ioctls to support mkfs(1M) for UFS filesystems. See dkio(7I). + * Also a dirtbag dkio ioctl for unmap/free-block functionality. */ /*ARGSUSED*/ int @@ -2271,12 +2337,12 @@ zvol_geom_start(struct bio *bp) break; case BIO_READ: case BIO_WRITE: + case BIO_DELETE: if (!THREAD_CAN_SLEEP()) goto enqueue; zvol_strategy(bp); break; case BIO_GETATTR: - case BIO_DELETE: default: g_io_deliver(bp, EOPNOTSUPP); break; From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 21 16:46:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 706D3DC; Mon, 21 Apr 2014 16:46: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 5BFF41B0A; Mon, 21 Apr 2014 16:46: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 s3LGkj0j024094; Mon, 21 Apr 2014 16:46:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LGkjAp024093; Mon, 21 Apr 2014 16:46:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404211646.s3LGkjAp024093@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Apr 2014 16:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264733 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 16:46:45 -0000 Author: mav Date: Mon Apr 21 16:46:44 2014 New Revision: 264733 URL: http://svnweb.freebsd.org/changeset/base/264733 Log: MFC r264193: In addition to r264077, tell GEOM that we do support BIO_DELETE now. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Apr 21 16:42:15 2014 (r264732) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Apr 21 16:46:44 2014 (r264733) @@ -2343,6 +2343,9 @@ zvol_geom_start(struct bio *bp) zvol_strategy(bp); break; case BIO_GETATTR: + if (g_handleattr_int(bp, "GEOM::candelete", 1)) + return; + /* FALLTHROUGH */ default: g_io_deliver(bp, EOPNOTSUPP); break; From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 21 16:54:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2898C3FE; Mon, 21 Apr 2014 16:54: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 13D3A1BFD; Mon, 21 Apr 2014 16:54: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 s3LGsck6027963; Mon, 21 Apr 2014 16:54:38 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LGscDa027961; Mon, 21 Apr 2014 16:54:38 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404211654.s3LGscDa027961@svn.freebsd.org> From: Sean Bruno Date: Mon, 21 Apr 2014 16:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264734 - stable/10/sys/dev/ciss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 16:54:39 -0000 Author: sbruno Date: Mon Apr 21 16:54:38 2014 New Revision: 264734 URL: http://svnweb.freebsd.org/changeset/base/264734 Log: MFC r264127 Add PCI-IDs for TBD Gen9 RAID controller HBAs from HP to ciss(4) Submitted by: Benesh, Scott Sponsored by: Yahoo! Inc. Modified: stable/10/sys/dev/ciss/ciss.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ciss/ciss.c ============================================================================== --- stable/10/sys/dev/ciss/ciss.c Mon Apr 21 16:46:44 2014 (r264733) +++ stable/10/sys/dev/ciss/ciss.c Mon Apr 21 16:54:38 2014 (r264734) @@ -345,6 +345,21 @@ static struct { 0x103C, 0x1928, CISS_BOARD_SA5, "HP Smart Array P230i" }, { 0x103C, 0x1929, CISS_BOARD_SA5, "HP Smart Array P530" }, { 0x103C, 0x192A, CISS_BOARD_SA5, "HP Smart Array P531" }, + { 0x103C, 0x21BD, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21BE, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21BF, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C0, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C2, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C3, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C5, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C6, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C7, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C8, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CA, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CB, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CC, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CD, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CE, CISS_BOARD_SA5, "HP Smart Array TBD" }, { 0, 0, 0, NULL } }; From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 21 17:17:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E71F4910; Mon, 21 Apr 2014 17:17: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 D35741E4C; Mon, 21 Apr 2014 17:17: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 s3LHHNl5036602; Mon, 21 Apr 2014 17:17:23 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LHHNVw036601; Mon, 21 Apr 2014 17:17:23 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201404211717.s3LHHNVw036601@svn.freebsd.org> From: Maksim Yevmenkin Date: Mon, 21 Apr 2014 17:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264736 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 17:17:24 -0000 Author: emax Date: Mon Apr 21 17:17:23 2014 New Revision: 264736 URL: http://svnweb.freebsd.org/changeset/base/264736 Log: MFC r264621 use correct (integer) type for the temperature sysctl Reviewed by: np, scottl Obtained from: Netflix Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Mon Apr 21 16:55:02 2014 (r264735) +++ stable/10/sys/dev/cxgbe/t4_main.c Mon Apr 21 17:17:23 2014 (r264736) @@ -4266,7 +4266,7 @@ t4_sysctls(struct adapter *sc) NULL, sc->tids.nftids, "number of filters"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", CTLTYPE_INT | - CTLFLAG_RD, sc, 0, sysctl_temperature, "A", + CTLFLAG_RD, sc, 0, sysctl_temperature, "I", "chip temperature (in Celsius)"); t4_sge_sysctls(sc, ctx, children); From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 22 04:30:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9194B3BC; Tue, 22 Apr 2014 04:30: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 726881001; Tue, 22 Apr 2014 04:30: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 s3M4UPin014856; Tue, 22 Apr 2014 04:30:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3M4UPVG014855; Tue, 22 Apr 2014 04:30:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201404220430.s3M4UPVG014855@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 22 Apr 2014 04:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264745 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 04:30:25 -0000 Author: yongari Date: Tue Apr 22 04:30:24 2014 New Revision: 264745 URL: http://svnweb.freebsd.org/changeset/base/264745 Log: MFC r264062: Correct endianness handling in getting station address from EEPROM. While I'm here, remove aue_eeprom_getword() as its only usage is to read station address and make it more readable. This change is inspired by NetBSD. With this change, aue(4) should work on big endian architectures. PR: 188177 Modified: stable/10/sys/dev/usb/net/if_aue.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_aue.c ============================================================================== --- stable/10/sys/dev/usb/net/if_aue.c Mon Apr 21 22:52:18 2014 (r264744) +++ stable/10/sys/dev/usb/net/if_aue.c Tue Apr 22 04:30:24 2014 (r264745) @@ -208,9 +208,7 @@ static uint8_t aue_csr_read_1(struct aue static uint16_t aue_csr_read_2(struct aue_softc *, uint16_t); static void aue_csr_write_1(struct aue_softc *, uint16_t, uint8_t); static void aue_csr_write_2(struct aue_softc *, uint16_t, uint16_t); -static void aue_eeprom_getword(struct aue_softc *, int, uint16_t *); -static void aue_read_eeprom(struct aue_softc *, uint8_t *, uint16_t, - uint16_t); +static uint16_t aue_eeprom_getword(struct aue_softc *, int); static void aue_reset(struct aue_softc *); static void aue_reset_pegasus_II(struct aue_softc *); @@ -372,11 +370,10 @@ aue_csr_write_2(struct aue_softc *sc, ui /* * Read a word of data stored in the EEPROM at address 'addr.' */ -static void -aue_eeprom_getword(struct aue_softc *sc, int addr, uint16_t *dest) +static uint16_t +aue_eeprom_getword(struct aue_softc *sc, int addr) { int i; - uint16_t word = 0; aue_csr_write_1(sc, AUE_EE_REG, addr); aue_csr_write_1(sc, AUE_EE_CTL, AUE_EECTL_READ); @@ -391,22 +388,23 @@ aue_eeprom_getword(struct aue_softc *sc, if (i == AUE_TIMEOUT) device_printf(sc->sc_ue.ue_dev, "EEPROM read timed out\n"); - word = aue_csr_read_2(sc, AUE_EE_DATA); - *dest = word; + return (aue_csr_read_2(sc, AUE_EE_DATA)); } /* - * Read a sequence of words from the EEPROM. + * Read station address(offset 0) from the EEPROM. */ static void -aue_read_eeprom(struct aue_softc *sc, uint8_t *dest, - uint16_t off, uint16_t len) +aue_read_mac(struct aue_softc *sc, uint8_t *eaddr) { - uint16_t *ptr = (uint16_t *)dest; - int i; + int i, offset; + uint16_t word; - for (i = 0; i != len; i++, ptr++) - aue_eeprom_getword(sc, off + i, ptr); + for (i = 0, offset = 0; i < ETHER_ADDR_LEN / 2; i++) { + word = aue_eeprom_getword(sc, offset + i); + eaddr[i * 2] = (uint8_t)word; + eaddr[i * 2 + 1] = (uint8_t)(word >> 8); + } } static int @@ -632,7 +630,7 @@ aue_attach_post(struct usb_ether *ue) aue_reset(sc); /* get station address from the EEPROM */ - aue_read_eeprom(sc, ue->ue_eaddr, 0, 3); + aue_read_mac(sc, ue->ue_eaddr); } /* From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 22 04:35:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 751C171C; Tue, 22 Apr 2014 04:35:08 +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 4946D10CB; Tue, 22 Apr 2014 04:35:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3M4Z8OP018463; Tue, 22 Apr 2014 04:35:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3M4Z8YW018462; Tue, 22 Apr 2014 04:35:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201404220435.s3M4Z8YW018462@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 22 Apr 2014 04:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264747 - stable/10/sys/dev/nfe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 04:35:08 -0000 Author: yongari Date: Tue Apr 22 04:35:07 2014 New Revision: 264747 URL: http://svnweb.freebsd.org/changeset/base/264747 Log: MFC r264293: Add workaround for MCP61 Ethernet controller found on MSI K9 motherboard. PHY hardware used for the controller responded at all possible addresses which in turn resulted in having 32 PHYs for the controller. If driver detects "MSI K9N6PGM2-V2 (MS-7309)" motherboard, tell miibus(4) PHY is located at 0. Modified: stable/10/sys/dev/nfe/if_nfe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/10/sys/dev/nfe/if_nfe.c Tue Apr 22 04:31:07 2014 (r264746) +++ stable/10/sys/dev/nfe/if_nfe.c Tue Apr 22 04:35:07 2014 (r264747) @@ -78,6 +78,7 @@ static int nfe_suspend(device_t); static int nfe_resume(device_t); static int nfe_shutdown(device_t); static int nfe_can_use_msix(struct nfe_softc *); +static int nfe_detect_msik9(struct nfe_softc *); static void nfe_power(struct nfe_softc *); static int nfe_miibus_readreg(device_t, int, int); static int nfe_miibus_writereg(device_t, int, int, int); @@ -333,13 +334,38 @@ nfe_alloc_msix(struct nfe_softc *sc, int } } + +static int +nfe_detect_msik9(struct nfe_softc *sc) +{ + static const char *maker = "MSI"; + static const char *product = "K9N6PGM2-V2 (MS-7309)"; + char *m, *p; + int found; + + found = 0; + m = getenv("smbios.planar.maker"); + p = getenv("smbios.planar.product"); + if (m != NULL && p != NULL) { + if (strcmp(m, maker) == 0 && strcmp(p, product) == 0) + found = 1; + } + if (m != NULL) + freeenv(m); + if (p != NULL) + freeenv(p); + + return (found); +} + + static int nfe_attach(device_t dev) { struct nfe_softc *sc; struct ifnet *ifp; bus_addr_t dma_addr_max; - int error = 0, i, msic, reg, rid; + int error = 0, i, msic, phyloc, reg, rid; sc = device_get_softc(dev); sc->nfe_dev = dev; @@ -607,8 +633,16 @@ nfe_attach(device_t dev) #endif /* Do MII setup */ + phyloc = MII_PHY_ANY; + if (sc->nfe_devid == PCI_PRODUCT_NVIDIA_MCP61_LAN1 || + sc->nfe_devid == PCI_PRODUCT_NVIDIA_MCP61_LAN2 || + sc->nfe_devid == PCI_PRODUCT_NVIDIA_MCP61_LAN3 || + sc->nfe_devid == PCI_PRODUCT_NVIDIA_MCP61_LAN4) { + if (nfe_detect_msik9(sc) != 0) + phyloc = 0; + } error = mii_attach(dev, &sc->nfe_miibus, ifp, nfe_ifmedia_upd, - nfe_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, + nfe_ifmedia_sts, BMSR_DEFCAPMASK, phyloc, MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 22 13:02:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E700366A; Tue, 22 Apr 2014 13:02: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 8AC3813AE; Tue, 22 Apr 2014 13:02: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 s3MD24SG031671; Tue, 22 Apr 2014 13:02:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MD24Jr031668; Tue, 22 Apr 2014 13:02:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404221302.s3MD24Jr031668@svn.freebsd.org> From: Marius Strobl Date: Tue, 22 Apr 2014 13:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264761 - in stable/10/sys/dev: puc uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 13:02:05 -0000 Author: marius Date: Tue Apr 22 13:02:03 2014 New Revision: 264761 URL: http://svnweb.freebsd.org/changeset/base/264761 Log: MFC: r264257, r264327, r264514 Distinguish between the different variants and configurations of Sunix {MIO,SER}5xxxx chips instead of treating all of them as PUC_PORT_2S. Among others, this fixes the hang seen when trying to probe the none- existent second UART on an actually 1-port chip. Obtained from: NetBSD (BAR layouts) Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sys/dev/puc/pucdata.c stable/10/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/puc/pucdata.c ============================================================================== --- stable/10/sys/dev/puc/pucdata.c Tue Apr 22 11:08:33 2014 (r264760) +++ stable/10/sys/dev/puc/pucdata.c Tue Apr 22 13:02:03 2014 (r264761) @@ -58,6 +58,7 @@ static puc_config_f puc_config_oxford_pc static puc_config_f puc_config_quatech; static puc_config_f puc_config_syba; static puc_config_f puc_config_siig; +static puc_config_f puc_config_sunix; static puc_config_f puc_config_timedia; static puc_config_f puc_config_titan; @@ -986,12 +987,46 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_syba }, - { 0x1fd4, 0x1999, 0xffff, 0, - "Sunix SER5437A", + { 0x1fd4, 0x1999, 0x1fd4, 0x0002, + "Sunix SER5xxxx 2-port serial", DEFAULT_RCLK * 8, PUC_PORT_2S, 0x10, 0, 8, }, + { 0x1fd4, 0x1999, 0x1fd4, 0x0004, + "Sunix SER5xxxx 4-port serial", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + + { 0x1fd4, 0x1999, 0x1fd4, 0x0008, + "Sunix SER5xxxx 8-port serial", + DEFAULT_RCLK * 8, + PUC_PORT_8S, -1, -1, -1, + .config_function = puc_config_sunix + }, + + { 0x1fd4, 0x1999, 0x1fd4, 0x0101, + "Sunix MIO5xxxx 1-port serial and 1284 Printer port", + DEFAULT_RCLK * 8, + PUC_PORT_1S1P, -1, -1, -1, + .config_function = puc_config_sunix + }, + + { 0x1fd4, 0x1999, 0x1fd4, 0x0102, + "Sunix MIO5xxxx 2-port serial and 1284 Printer port", + DEFAULT_RCLK * 8, + PUC_PORT_2S1P, -1, -1, -1, + .config_function = puc_config_sunix + }, + + { 0x1fd4, 0x1999, 0x1fd4, 0x0104, + "Sunix MIO5xxxx 4-port serial and 1284 Printer port", + DEFAULT_RCLK * 8, + PUC_PORT_4S1P, -1, -1, -1, + .config_function = puc_config_sunix + }, + { 0x5372, 0x6873, 0xffff, 0, "Sun 1040 PCI Quad Serial", DEFAULT_RCLK, @@ -1023,8 +1058,8 @@ const struct puc_cfg puc_pci_devices[] = }, /* - * This is more specific than the generic NM9835 entry that follows, and - * is placed here to _prevent_ puc from claiming this single port card. + * This is more specific than the generic NM9835 entry, and is placed + * here to _prevent_ puc(4) from claiming this single port card. * * uart(4) will claim this device. */ @@ -1613,6 +1648,31 @@ puc_config_oxford_pcie(struct puc_softc } static int +puc_config_sunix(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, + intptr_t *res) +{ + int error; + + switch (cmd) { + case PUC_CFG_GET_OFS: + error = puc_config(sc, PUC_CFG_GET_TYPE, port, res); + if (error != 0) + return (error); + *res = (*res == PUC_TYPE_SERIAL) ? (port & 3) * 8 : 0; + return (0); + case PUC_CFG_GET_RID: + error = puc_config(sc, PUC_CFG_GET_TYPE, port, res); + if (error != 0) + return (error); + *res = (*res == PUC_TYPE_SERIAL && port <= 3) ? 0x10 : 0x14; + return (0); + default: + break; + } + return (ENXIO); +} + +static int puc_config_titan(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { Modified: stable/10/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_pci.c Tue Apr 22 11:08:33 2014 (r264760) +++ stable/10/sys/dev/uart/uart_bus_pci.c Tue Apr 22 13:02:03 2014 (r264761) @@ -114,6 +114,8 @@ static const struct pci_id pci_ns8250_id 0x10, 16384000 }, { 0x14e4, 0x4344, 0xffff, 0, "Sony Ericsson GC89 PC Card", 0x10}, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, +{ 0x1fd4, 0x1999, 0x1fd4, 0x0001, "Sunix SER5xxxx Serial Port", 0x10, + 8 * DEFAULT_RCLK }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, { 0x8086, 0x1d3d, 0xffff, 0, "Intel C600/X79 Series Chipset KT Controller", 0x10 }, { 0x8086, 0x2e17, 0xffff, 0, "4 Series Chipset Serial KT Controller", 0x10 }, From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 22 20:51:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 22C9FE7D; Tue, 22 Apr 2014 20:51:08 +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 0E2111ACB; Tue, 22 Apr 2014 20:51:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3MKp72b025746; Tue, 22 Apr 2014 20:51:07 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MKp7qQ025745; Tue, 22 Apr 2014 20:51:07 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404222051.s3MKp7qQ025745@svn.freebsd.org> From: Christian Brueffer Date: Tue, 22 Apr 2014 20:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264775 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 20:51:08 -0000 Author: brueffer Date: Tue Apr 22 20:51:07 2014 New Revision: 264775 URL: http://svnweb.freebsd.org/changeset/base/264775 Log: MFC: r264384, r264415 mdoc and language improvements. Modified: stable/10/share/man/man4/timecounters.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/timecounters.4 ============================================================================== --- stable/10/share/man/man4/timecounters.4 Tue Apr 22 20:37:07 2014 (r264774) +++ stable/10/share/man/man4/timecounters.4 Tue Apr 22 20:51:07 2014 (r264775) @@ -24,27 +24,27 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2011 +.Dd April 12, 2014 .Dt TIMECOUNTERS 4 .Os .Sh NAME .Nm timecounters .Nd kernel time counters subsystem .Sh SYNOPSIS -Kernel uses several types of time-related devices, such as: real time clocks, +The kernel uses several types of time-related devices, such as: real time clocks, time counters and event timers. -Real time clocks responsible for tracking real world time, mostly when system +Real time clocks are responsible for tracking real world time, mostly when the system is down. -Time counters are responsible for tracking purposes, when system is running. -Event timers are responsible for generating interrupts at specified time or +Time counters are responsible for tracking purposes, when the system is running. +Event timers are responsible for generating interrupts at a specified time or periodically, to run different time-based events. This page is about the second. .Sh DESCRIPTION -Time counters are the lowest level of time tracking in kernel. +Time counters are the lowest level of time tracking in the kernel. They provide monotonically increasing timestamps with known width and update frequency. -They can overflow, drift, etc and so in raw form used only in very limited -performance-critical places like process scheduler. +They can overflow, drift, etc and so in raw form can be used only in very limited +performance-critical places like the process scheduler. .Pp More usable time is created by scaling the values read from the selected time counter and combining it with some offset, regularly updated by @@ -54,13 +54,14 @@ on invocation. .Pp Different platforms provide different kinds of timer hardware. -The goal of the time counters subsystem is to provide unified way to access +The goal of the time counters subsystem is to provide a unified way to access that hardware. .Pp -Each driver implementing time counters, registers them at the subsystem. -It is possible to see the list of present time counters, like this, via +Each driver implementing time counters registers them with the subsystem. +It is possible to see the list of present time counters, via the .Va kern.timecounter -sysctl: +.Xr sysctl 8 +variable: .Bd -literal kern.timecounter.choice: TSC-low(-100) HPET(950) i8254(0) ACPI-fast(900) dummy(-1000000) kern.timecounter.tc.ACPI-fast.mask: 16777215 @@ -81,7 +82,7 @@ kern.timecounter.tc.TSC-low.frequency: 1 kern.timecounter.tc.TSC-low.quality: -100 .Ed .Pp -where: +The output nodes are defined as follows: .Bl -inset .It Va kern.timecounter.tc. Ns Ar X Ns Va .mask is a bitmask, defining valid counter bits, @@ -90,13 +91,13 @@ is a present counter value, .It Va kern.timecounter.tc. Ns Ar X Ns Va .frequency is a counter update frequency, .It Va kern.timecounter.tc. Ns Ar X Ns Va .quality -is an integral value, defining how good is this time counter, -comparing to others. -Negative value means that this time counter is broken and should not be used. +is an integral value, defining the quality of this time counter +compared to others. +A negative value means this time counter is broken and should not be used. .El .Pp -Time management code of the kernel chooses one time counter from that list. -Current choice can be read and affected via +The time management code of the kernel chooses one time counter from that list. +The current choice can be read and affected via the .Va kern.timecounter.hardware tunable/sysctl. .Sh SEE ALSO From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 22 20:55:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A9D0C1CA; Tue, 22 Apr 2014 20:55: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 7B45D1B0E; Tue, 22 Apr 2014 20:55: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 s3MKtlgs028578; Tue, 22 Apr 2014 20:55:47 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MKtlBM028577; Tue, 22 Apr 2014 20:55:47 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404222055.s3MKtlBM028577@svn.freebsd.org> From: Christian Brueffer Date: Tue, 22 Apr 2014 20:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264777 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 20:55:47 -0000 Author: brueffer Date: Tue Apr 22 20:55:46 2014 New Revision: 264777 URL: http://svnweb.freebsd.org/changeset/base/264777 Log: MFC: r264386 Improve markup and remove contractions. Modified: stable/10/share/man/man4/usb_quirk.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/usb_quirk.4 ============================================================================== --- stable/10/share/man/man4/usb_quirk.4 Tue Apr 22 20:53:05 2014 (r264776) +++ stable/10/share/man/man4/usb_quirk.4 Tue Apr 22 20:55:46 2014 (r264777) @@ -49,13 +49,13 @@ swap left and right channels .It UQ_AU_INP_ASYNC input is async despite claim of adaptive .It UQ_AU_NO_FRAC -don't adjust for fractional samples +do not adjust for fractional samples .It UQ_AU_NO_XU audio device has broken extension unit .It UQ_BAD_ADC bad audio spec version number .It UQ_BAD_AUDIO -device claims audio class, but isn't +device claims audio class, but is not .It UQ_BROKEN_BIDIR printer has broken bidir mode .It UQ_BUS_POWERED @@ -69,7 +69,7 @@ device should set the boot protocol .It UQ_UMS_IGNORE device should be ignored by ums class .It UQ_MS_BAD_CLASS -doesn't identify properly +does not identify properly .It UQ_MS_LEADING_BYTE mouse sends an unknown leading byte .It UQ_MS_REVZ @@ -150,27 +150,28 @@ ejects after Huawei USB command ejects after Sierra USB command .It UQ_MSC_EJECT_SCSIEJECT ejects after SCSI eject command -0x1b0000000200 +.Dv 0x1b0000000200 .It UQ_MSC_EJECT_REZERO ejects after SCSI rezero command -0x010000000000 +.Dv 0x010000000000 .It UQ_MSC_EJECT_ZTESTOR ejects after ZTE SCSI command -0x850101011801010101010000 +.Dv 0x850101011801010101010000 .It UQ_MSC_EJECT_CMOTECH ejects after C-motech SCSI command -0xff52444556434847 +.Dv 0xff52444556434847 .It UQ_MSC_EJECT_WAIT wait for the device to eject .It UQ_MSC_EJECT_SAEL_M460 ejects after Sael USB commands .It UQ_MSC_EJECT_HUAWEISCSI ejects after Huawei SCSI command -0x11060000000000000000000000000000 +.Dv 0x11060000000000000000000000000000 .It UQ_MSC_EJECT_TCT ejects after TCT SCSI command -0x06f504025270 +.Dv 0x06f504025270 .El +.Pp See .Pa /sys/dev/usb/quirk/usb_quirk.h for the complete list of supported quirks. From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 22 21:02:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8992E582; Tue, 22 Apr 2014 21:02: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 765591BE9; Tue, 22 Apr 2014 21:02: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 s3ML23n4032529; Tue, 22 Apr 2014 21:02:03 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ML23MG032528; Tue, 22 Apr 2014 21:02:03 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404222102.s3ML23MG032528@svn.freebsd.org> From: Christian Brueffer Date: Tue, 22 Apr 2014 21:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264779 - stable/10/sys/dev/iwn X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 21:02:03 -0000 Author: brueffer Date: Tue Apr 22 21:02:02 2014 New Revision: 264779 URL: http://svnweb.freebsd.org/changeset/base/264779 Log: MFC: r264416 Add a missing comma between error message definitions. CID: 1199266 Found with: Coverity Prevent(tm) MFC after: 1 week Modified: stable/10/sys/dev/iwn/if_iwnreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iwn/if_iwnreg.h ============================================================================== --- stable/10/sys/dev/iwn/if_iwnreg.h Tue Apr 22 20:57:23 2014 (r264778) +++ stable/10/sys/dev/iwn/if_iwnreg.h Tue Apr 22 21:02:02 2014 (r264779) @@ -2019,7 +2019,7 @@ static const char * const iwn_fw_errmsg[ "NMI_INTERRUPT_DATA_ACTION_PT", "NMI_TRM_HW_ER", "NMI_INTERRUPT_TRM", - "NMI_INTERRUPT_BREAKPOINT" + "NMI_INTERRUPT_BREAKPOINT", "DEBUG_0", "DEBUG_1", "DEBUG_2", From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 22 21:13:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C8E75B69; Tue, 22 Apr 2014 21:13: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 B57F11CFF; Tue, 22 Apr 2014 21:13: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 s3MLDPAw036835; Tue, 22 Apr 2014 21:13:25 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MLDPCE036834; Tue, 22 Apr 2014 21:13:25 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404222113.s3MLDPCE036834@svn.freebsd.org> From: Christian Brueffer Date: Tue, 22 Apr 2014 21:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264782 - stable/10/usr.bin/find X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 21:13:25 -0000 Author: brueffer Date: Tue Apr 22 21:13:25 2014 New Revision: 264782 URL: http://svnweb.freebsd.org/changeset/base/264782 Log: MFC: r264418 Avoid double free in f_acl(). CID: 1018508 Found with: Coverity Prevent(tm) Modified: stable/10/usr.bin/find/function.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/find/function.c ============================================================================== --- stable/10/usr.bin/find/function.c Tue Apr 22 21:07:56 2014 (r264781) +++ stable/10/usr.bin/find/function.c Tue Apr 22 21:13:25 2014 (r264782) @@ -404,7 +404,6 @@ f_acl(PLAN *plan __unused, FTSENT *entry acl_free(facl); if (ret) { warn("%s", entry->fts_accpath); - acl_free(facl); return (0); } if (trivial) From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 22 21:25:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1925D123; Tue, 22 Apr 2014 21:25: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 056FE1E53; Tue, 22 Apr 2014 21:25: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 s3MLP3wE041244; Tue, 22 Apr 2014 21:25:03 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MLP30i041243; Tue, 22 Apr 2014 21:25:03 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404222125.s3MLP30i041243@svn.freebsd.org> From: Christian Brueffer Date: Tue, 22 Apr 2014 21:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264785 - stable/10/usr.bin/ldd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 21:25:04 -0000 Author: brueffer Date: Tue Apr 22 21:25:03 2014 New Revision: 264785 URL: http://svnweb.freebsd.org/changeset/base/264785 Log: MFC: r264419 Avoid double close() of a file descriptor. CID: 1006089 Found with: Coverity Prevent(tm) Modified: stable/10/usr.bin/ldd/sods.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/ldd/sods.c ============================================================================== --- stable/10/usr.bin/ldd/sods.c Tue Apr 22 21:17:12 2014 (r264784) +++ stable/10/usr.bin/ldd/sods.c Tue Apr 22 21:25:03 2014 (r264785) @@ -204,7 +204,6 @@ dump_file(const char *fname) warnx("%s: this is an ELF program; use objdump to examine", fname); ++error_count; munmap(objbase, sb.st_size); - close(fd); return; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 01:27:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CCC4024C; Wed, 23 Apr 2014 01:27: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 A047815B8; Wed, 23 Apr 2014 01:27: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 s3N1RrqN041249; Wed, 23 Apr 2014 01:27:53 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N1RrMh041248; Wed, 23 Apr 2014 01:27:53 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404230127.s3N1RrMh041248@svn.freebsd.org> From: Glen Barber Date: Wed, 23 Apr 2014 01:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264792 - stable/10/release/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 01:27:53 -0000 Author: gjb Date: Wed Apr 23 01:27:53 2014 New Revision: 264792 URL: http://svnweb.freebsd.org/changeset/base/264792 Log: MFC r264518, r264697, r264698, r264703: r264518: Fix armv6 build failure: "armv6-freebsd-gcc: not found" r264697: When building the 'xdev' target when WITH_GCC=1 and WITHOUT_CLANG_IS_CC=1, it appears WITHOUT_CLANG=1 must also be set. While here, reorder the lines to put the WITH_* and WITHOUT_* entries on the same line. r264698: Fix EOL escape. r264703: Apply a slightly different color hammer to arm/release.sh: - gcc(1) fails to build usr.bin/dtc - lack of WITH_GNUCXX=1 causes cc1plus(1) calls to fail - u-boot fails to build with clang (hard-coded gcc(1) calls) Implement the proper incantation of WITH_/WITHOUT_ knobs to get arm snapshot builds working again. Since the cc(1) binary no longer needs to be cc(1) instead of clang(1), remove the chroot(8) post-install cc(1) overwrite. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/arm/release.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/arm/release.sh ============================================================================== --- stable/10/release/arm/release.sh Tue Apr 22 22:12:24 2014 (r264791) +++ stable/10/release/arm/release.sh Wed Apr 23 01:27:53 2014 (r264792) @@ -92,14 +92,10 @@ install_uboot() { } main() { - # Build gcc for use in the chroot for arm builds. - # This is not '-j'-safe, so force '-j1' to allow using - # additional, non-'-j' options specified in WORLD_FLAGS. - eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \ - WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ - XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} WITH_GCC=1 \ + WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1 \ + XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ ${WORLD_FLAGS} xdev # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 03:26:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5813357B; Wed, 23 Apr 2014 03:26: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 42EF31482; Wed, 23 Apr 2014 03:26: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 s3N3QUHL091300; Wed, 23 Apr 2014 03:26:30 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N3QTeP091298; Wed, 23 Apr 2014 03:26:29 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201404230326.s3N3QTeP091298@svn.freebsd.org> From: Mark Johnston Date: Wed, 23 Apr 2014 03:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264796 - in stable/10: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 03:26:30 -0000 Author: markj Date: Wed Apr 23 03:26:29 2014 New Revision: 264796 URL: http://svnweb.freebsd.org/changeset/base/264796 Log: MFC r262596: 4478 dtrace_dof_maxsize is far too small illumos/illumos-gate@d339a29bb4765c4b6883a935cf69b669cd05bca0 Added: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh - copied unchanged from r262596, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: stable/10/ (props changed) Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh (from r262596, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh Wed Apr 23 03:26:29 2014 (r264796, copy of r262596, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh) @@ -0,0 +1,97 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012, Joyent, Inc. All rights reserved. +# + +let j=8 + +enable() +{ + prog=/var/tmp/dtest.$$.d + err=/var/tmp/dtest.$$.err + + nawk -v nprobes=$1 'BEGIN { \ + for (i = 0; i < nprobes - 1; i++) { \ + printf("dtrace:::BEGIN,\n"); \ + } \ + \ + printf("dtrace:::BEGIN { exit(0); }\n"); \ + }' /dev/null > $prog + + dtrace -qs $prog > /dev/null 2> $err + + if [[ "$?" -eq 0 ]]; then + return 0 + else + if ! grep "DIF program exceeds maximum program size" $err \ + 1> /dev/null 2>&1 ; then + echo "failed to enable $prog: `cat $err`" + exit 1 + fi + + return 1 + fi +} + +# +# First, establish an upper bound +# +let upper=1 + +while enable $upper ; do + let lower=upper + let upper=upper+upper + echo success at $lower, raised to $upper +done + +# +# Now search for the highest value that can be enabled +# +while [[ "$lower" -lt "$upper" ]]; do + let guess=$(((lower + upper) / 2)) + echo "lower is $lower; upper is $upper; guess is $guess\c" + + if enable $guess ; then + if [[ $((upper - lower)) -le 2 ]]; then + let upper=guess + fi + + echo " (success)" + let lower=guess + else + echo " (failure)" + let upper=guess + fi +done + +let expected=10000 + +if [[ "$lower" -lt "$expected" ]]; then + echo "expected support for enablings of at least $expected probes; \c" + echo "found $lower" + exit 1 +fi + +echo "maximum supported enabled probes found to be $lower" +exit 0 + Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Apr 23 02:21:17 2014 (r264795) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Apr 23 03:26:29 2014 (r264796) @@ -155,7 +155,7 @@ int dtrace_destructive_disallow = 0; dtrace_optval_t dtrace_nonroot_maxsize = (16 * 1024 * 1024); size_t dtrace_difo_maxsize = (256 * 1024); -dtrace_optval_t dtrace_dof_maxsize = (256 * 1024); +dtrace_optval_t dtrace_dof_maxsize = (8 * 1024 * 1024); size_t dtrace_global_maxsize = (16 * 1024); size_t dtrace_actions_max = (16 * 1024); size_t dtrace_retain_max = 1024; From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 07:22:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 34BBE697; Wed, 23 Apr 2014 07:22: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 2054D1A64; Wed, 23 Apr 2014 07:22: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 s3N7MeNb088420; Wed, 23 Apr 2014 07:22:40 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N7MesI088419; Wed, 23 Apr 2014 07:22:40 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404230722.s3N7MesI088419@svn.freebsd.org> From: Christian Brueffer Date: Wed, 23 Apr 2014 07:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264804 - stable/10/sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 07:22:41 -0000 Author: brueffer Date: Wed Apr 23 07:22:40 2014 New Revision: 264804 URL: http://svnweb.freebsd.org/changeset/base/264804 Log: MFC: r264421 Free resources in error cases; re-indent a curly brace while here. CID: 1199366 Found with: Coverity Prevent(tm) Modified: stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Apr 23 05:57:45 2014 (r264803) +++ stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Apr 23 07:22:40 2014 (r264804) @@ -1039,8 +1039,10 @@ ipfw_ctl(struct sockopt *sopt) if (sopt->sopt_valsize == RULESIZE7(rule)) { is7 = 1; error = convert_rule_to_8(rule); - if (error) + if (error) { + free(rule, M_TEMP); return error; + } if (error == 0) error = check_ipfw_struct(rule, RULESIZE(rule)); } else { @@ -1056,11 +1058,13 @@ ipfw_ctl(struct sockopt *sopt) if (is7) { error = convert_rule_to_7(rule); size = RULESIZE7(rule); - if (error) + if (error) { + free(rule, M_TEMP); return error; + } } error = sooptcopyout(sopt, rule, size); - } + } } free(rule, M_TEMP); break; From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 07:33:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 920B1AC0; Wed, 23 Apr 2014 07:33: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 7DF3F1B84; Wed, 23 Apr 2014 07:33: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 s3N7XpMH092695; Wed, 23 Apr 2014 07:33:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N7XpMG092694; Wed, 23 Apr 2014 07:33:51 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404230733.s3N7XpMG092694@svn.freebsd.org> From: Christian Brueffer Date: Wed, 23 Apr 2014 07:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264806 - stable/10/sbin/savecore X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 07:33:51 -0000 Author: brueffer Date: Wed Apr 23 07:33:51 2014 New Revision: 264806 URL: http://svnweb.freebsd.org/changeset/base/264806 Log: MFC: r264479 Fix double fclose() in an error case. CID: 1006120 Found with: Coverity Prevent(tm) Modified: stable/10/sbin/savecore/savecore.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/savecore/savecore.c ============================================================================== --- stable/10/sbin/savecore/savecore.c Wed Apr 23 07:24:01 2014 (r264805) +++ stable/10/sbin/savecore/savecore.c Wed Apr 23 07:33:51 2014 (r264806) @@ -672,7 +672,7 @@ DoFile(const char *savedir, const char * if (fclose(fp) < 0) { syslog(LOG_ERR, "error on %s: %m", corename); nerr++; - goto closeall; + goto closefd; } symlinks_remove(); From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 09:22:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C518C7D1; Wed, 23 Apr 2014 09:22: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 B130B179E; Wed, 23 Apr 2014 09:22: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 s3N9MOi4037716; Wed, 23 Apr 2014 09:22:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N9MOZJ037715; Wed, 23 Apr 2014 09:22:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404230922.s3N9MOZJ037715@svn.freebsd.org> From: Christian Brueffer Date: Wed, 23 Apr 2014 09:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264808 - stable/10/sbin/gbde X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 09:22:24 -0000 Author: brueffer Date: Wed Apr 23 09:22:24 2014 New Revision: 264808 URL: http://svnweb.freebsd.org/changeset/base/264808 Log: MFC: r264489 Add a missing break in option parsing. CID: 1011452 Found with: Coverity Prevent(tm) Modified: stable/10/sbin/gbde/gbde.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/gbde/gbde.c ============================================================================== --- stable/10/sbin/gbde/gbde.c Wed Apr 23 07:35:08 2014 (r264807) +++ stable/10/sbin/gbde/gbde.c Wed Apr 23 09:22:24 2014 (r264808) @@ -805,6 +805,7 @@ main(int argc, char **argv) break; case 'i': i_opt = !i_opt; + break; case 'k': k_opt = optarg; break; From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 09:27:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 874BDD2B; Wed, 23 Apr 2014 09:27: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 7336E180A; Wed, 23 Apr 2014 09:27: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 s3N9RCoB038525; Wed, 23 Apr 2014 09:27:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N9RCKL038524; Wed, 23 Apr 2014 09:27:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404230927.s3N9RCKL038524@svn.freebsd.org> From: Christian Brueffer Date: Wed, 23 Apr 2014 09:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264811 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 09:27:12 -0000 Author: brueffer Date: Wed Apr 23 09:27:11 2014 New Revision: 264811 URL: http://svnweb.freebsd.org/changeset/base/264811 Log: MFC: r264460 Document the xdev* targets. PR: 188519 Submitted by: Idwer Vollering Reviewed by: bapt Modified: stable/10/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile ============================================================================== --- stable/10/Makefile Wed Apr 23 09:24:26 2014 (r264810) +++ stable/10/Makefile Wed Apr 23 09:27:11 2014 (r264811) @@ -32,6 +32,10 @@ # targets - Print a list of supported TARGET/TARGET_ARCH pairs # for world and kernel targets. # toolchains - Build a toolchain for all world and kernel targets. +# xdev - xdev-build + xdev-install for the architecture +# specified with XDEV and XDEV_ARCH. +# xdev-build - Build cross-development tools. +# xdev-install - Install cross-development tools. # # "quick" way to test all kernel builds: # _jflag=`sysctl -n hw.ncpu` From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 09:56:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 871CA3C1; Wed, 23 Apr 2014 09:56: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 72AE31ABC; Wed, 23 Apr 2014 09:56: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 s3N9uIcB051353; Wed, 23 Apr 2014 09:56:18 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N9uISu051352; Wed, 23 Apr 2014 09:56:18 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404230956.s3N9uISu051352@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 23 Apr 2014 09:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264813 - stable/10/sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 09:56:18 -0000 Author: ae Date: Wed Apr 23 09:56:17 2014 New Revision: 264813 URL: http://svnweb.freebsd.org/changeset/base/264813 Log: MFC r264540: Set oif only for outgoing packets. PR: 188543 Modified: stable/10/sys/netpfil/ipfw/ip_fw_pfil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_pfil.c Wed Apr 23 09:32:33 2014 (r264812) +++ stable/10/sys/netpfil/ipfw/ip_fw_pfil.c Wed Apr 23 09:56:17 2014 (r264813) @@ -334,7 +334,7 @@ ipfw_check_frame(void *arg, struct mbuf m_adj(m, ETHER_HDR_LEN); /* strip ethernet header */ args.m = m; /* the packet we are looking at */ - args.oif = dst; /* destination, if any */ + args.oif = dir == PFIL_OUT ? dst: NULL; /* destination, if any */ args.next_hop = NULL; /* we do not support forward yet */ args.next_hop6 = NULL; /* we do not support forward yet */ args.eh = &save_eh; /* MAC header for bridged/MAC packets */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 11:22:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8911FE6E; Wed, 23 Apr 2014 11:22: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 69C641830; Wed, 23 Apr 2014 11:22: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 s3NBMtx9088812; Wed, 23 Apr 2014 11:22:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NBMsG8088809; Wed, 23 Apr 2014 11:22:54 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404231122.s3NBMsG8088809@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 23 Apr 2014 11:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264814 - stable/10/sys/netipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 11:22:55 -0000 Author: ae Date: Wed Apr 23 11:22:54 2014 New Revision: 264814 URL: http://svnweb.freebsd.org/changeset/base/264814 Log: MFC r264124: Remove dead code. MFC r264125: Remove unused variable. MFC r264126: The check for local address spoofing lacks ifaddr locking. Remove these loops and use in_localip() and in6_localip() functions instead. MFC r264520: Remove _IP_VHL* macros and related ifdefs. Modified: stable/10/sys/netipsec/ipsec.c stable/10/sys/netipsec/ipsec_output.c stable/10/sys/netipsec/xform_ipip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/ipsec.c ============================================================================== --- stable/10/sys/netipsec/ipsec.c Wed Apr 23 09:56:17 2014 (r264813) +++ stable/10/sys/netipsec/ipsec.c Wed Apr 23 11:22:54 2014 (r264814) @@ -559,11 +559,7 @@ ipsec_setspidx(struct mbuf *m, struct se m_copydata(m, 0, sizeof(ipbuf), (caddr_t)&ipbuf); ip = &ipbuf; } -#ifdef _IP_VHL - v = _IP_VHL_V(ip->ip_vhl); -#else v = ip->ip_v; -#endif switch (v) { case 4: error = ipsec4_setspidx_ipaddr(m, spidx); @@ -607,11 +603,7 @@ ipsec4_get_ulp(struct mbuf *m, struct se struct ip *ip = mtod(m, struct ip *); if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) goto done; -#ifdef _IP_VHL - off = _IP_VHL_HL(ip->ip_vhl) << 2; -#else off = ip->ip_hl << 2; -#endif nxt = ip->ip_p; } else { struct ip ih; @@ -619,11 +611,7 @@ ipsec4_get_ulp(struct mbuf *m, struct se m_copydata(m, 0, sizeof (struct ip), (caddr_t) &ih); if (ih.ip_off & htons(IP_MF | IP_OFFMASK)) goto done; -#ifdef _IP_VHL - off = _IP_VHL_HL(ih.ip_vhl) << 2; -#else off = ih.ip_hl << 2; -#endif nxt = ih.ip_p; } Modified: stable/10/sys/netipsec/ipsec_output.c ============================================================================== --- stable/10/sys/netipsec/ipsec_output.c Wed Apr 23 09:56:17 2014 (r264813) +++ stable/10/sys/netipsec/ipsec_output.c Wed Apr 23 11:22:54 2014 (r264814) @@ -205,11 +205,7 @@ ipsec_process_done(struct mbuf *m, struc */ if (sav->natt_type) { struct ip *ip = mtod(m, struct ip *); -#ifdef _IP_VHL - const int hlen = IP_VHL_HL(ip->ip_vhl); -#else const int hlen = (ip->ip_hl << 2); -#endif int size, off; struct mbuf *mi; struct udphdr *udp; @@ -504,15 +500,7 @@ ipsec4_process_packet( ip = mtod(m, struct ip *); ip->ip_len = htons(m->m_pkthdr.len); ip->ip_sum = 0; -#ifdef _IP_VHL - if (ip->ip_vhl == IP_VHL_BORING) - ip->ip_sum = in_cksum_hdr(ip); - else - ip->ip_sum = in_cksum(m, - _IP_VHL_HL(ip->ip_vhl) << 2); -#else ip->ip_sum = in_cksum(m, ip->ip_hl << 2); -#endif /* Encapsulate the packet */ error = ipip_output(m, isr, &mp, 0, 0); Modified: stable/10/sys/netipsec/xform_ipip.c ============================================================================== --- stable/10/sys/netipsec/xform_ipip.c Wed Apr 23 09:56:17 2014 (r264813) +++ stable/10/sys/netipsec/xform_ipip.c Wed Apr 23 11:22:54 2014 (r264814) @@ -64,9 +64,6 @@ #include #include #include -#ifdef MROUTING -#include -#endif #include #include @@ -161,18 +158,11 @@ ip4_input(struct mbuf *m, int off) static void _ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp) { -#ifdef INET - register struct sockaddr_in *sin; -#endif - register struct ifnet *ifp; - register struct ifaddr *ifa; struct ip *ipo; #ifdef INET6 - register struct sockaddr_in6 *sin6; struct ip6_hdr *ip6 = NULL; u_int8_t itos; #endif - u_int8_t nxt; int isr; u_int8_t otos; u_int8_t v; @@ -207,18 +197,8 @@ _ipip_input(struct mbuf *m, int iphlen, return; } } - ipo = mtod(m, struct ip *); -#ifdef MROUTING - if (ipo->ip_v == IPVERSION && ipo->ip_p == IPPROTO_IPV4) { - if (IN_MULTICAST(((struct ip *)((char *) ipo + iphlen))->ip_dst.s_addr)) { - ipip_mroute_input (m, iphlen); - return; - } - } -#endif /* MROUTING */ - /* Keep outer ecn field. */ switch (v >> 4) { #ifdef INET @@ -287,14 +267,12 @@ _ipip_input(struct mbuf *m, int iphlen, #ifdef INET case 4: ipo = mtod(m, struct ip *); - nxt = ipo->ip_p; ip_ecn_egress(V_ip4_ipsec_ecn, &otos, &ipo->ip_tos); break; #endif /* INET */ #ifdef INET6 case 6: ip6 = (struct ip6_hdr *) ipo; - nxt = ip6->ip6_nxt; itos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; ip_ecn_egress(V_ip6_ipsec_ecn, &otos, &itos); ip6->ip6_flow &= ~htonl(0xff << 20); @@ -309,47 +287,22 @@ _ipip_input(struct mbuf *m, int iphlen, if ((m->m_pkthdr.rcvif == NULL || !(m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK)) && V_ipip_allow != 2) { - IFNET_RLOCK_NOSLEEP(); - TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { -#ifdef INET - if (ipo) { - if (ifa->ifa_addr->sa_family != - AF_INET) - continue; - - sin = (struct sockaddr_in *) ifa->ifa_addr; - - if (sin->sin_addr.s_addr == - ipo->ip_src.s_addr) { - IPIPSTAT_INC(ipips_spoof); - m_freem(m); - IFNET_RUNLOCK_NOSLEEP(); - return; - } - } -#endif /* INET */ - +#ifdef INET + if ((v >> 4) == IPVERSION && + in_localip(ipo->ip_src) != 0) { + IPIPSTAT_INC(ipips_spoof); + m_freem(m); + return; + } +#endif #ifdef INET6 - if (ip6) { - if (ifa->ifa_addr->sa_family != - AF_INET6) - continue; - - sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; - - if (IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, &ip6->ip6_src)) { - IPIPSTAT_INC(ipips_spoof); - m_freem(m); - IFNET_RUNLOCK_NOSLEEP(); - return; - } - - } -#endif /* INET6 */ - } + if ((v & IPV6_VERSION_MASK) == IPV6_VERSION && + in6_localip(&ip6->ip6_src) != 0) { + IPIPSTAT_INC(ipips_spoof); + m_freem(m); + return; } - IFNET_RUNLOCK_NOSLEEP(); +#endif } /* Statistics */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 12:08:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 027C0EC3; Wed, 23 Apr 2014 12:08: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 E2C161CCE; Wed, 23 Apr 2014 12:08: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 s3NC8Kkb006077; Wed, 23 Apr 2014 12:08:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NC8K9c006076; Wed, 23 Apr 2014 12:08:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404231208.s3NC8K9c006076@svn.freebsd.org> From: Christian Brueffer Date: Wed, 23 Apr 2014 12:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264816 - stable/10/sys/boot/i386/libfirewire X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 12:08:21 -0000 Author: brueffer Date: Wed Apr 23 12:08:20 2014 New Revision: 264816 URL: http://svnweb.freebsd.org/changeset/base/264816 Log: MFC: r264482 Re-indent break statement. Modified: stable/10/sys/boot/i386/libfirewire/firewire.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/i386/libfirewire/firewire.c ============================================================================== --- stable/10/sys/boot/i386/libfirewire/firewire.c Wed Apr 23 12:05:53 2014 (r264815) +++ stable/10/sys/boot/i386/libfirewire/firewire.c Wed Apr 23 12:08:20 2014 (r264816) @@ -137,7 +137,7 @@ fw_init(void) if (sc->state == FWOHCI_STATE_DEAD) break; avail ++; - break; + break; } fw_initialized = 1; From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 12:11:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DFC40268; Wed, 23 Apr 2014 12:11: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 CC85D1D69; Wed, 23 Apr 2014 12:11: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 s3NCBEQB007040; Wed, 23 Apr 2014 12:11:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NCBEYk007039; Wed, 23 Apr 2014 12:11:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404231211.s3NCBEYk007039@svn.freebsd.org> From: Christian Brueffer Date: Wed, 23 Apr 2014 12:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264818 - stable/10/lib/libc/posix1e X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 12:11:15 -0000 Author: brueffer Date: Wed Apr 23 12:11:14 2014 New Revision: 264818 URL: http://svnweb.freebsd.org/changeset/base/264818 Log: MFC: r264507 Mention Capsicum. Modified: stable/10/lib/libc/posix1e/posix1e.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/posix1e/posix1e.3 ============================================================================== --- stable/10/lib/libc/posix1e/posix1e.3 Wed Apr 23 12:09:15 2014 (r264817) +++ stable/10/lib/libc/posix1e/posix1e.3 Wed Apr 23 12:11:14 2014 (r264818) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2009 +.Dd April 15, 2014 .Dt POSIX1E 3 .Os .Sh NAME @@ -65,6 +65,10 @@ However, does implement the .Xr libbsm audit API. +It also provides +.Xr capsicum 4 , +a lightweight OS capability and sandbox framework implementing a +hybrid capability system model. .Sh ENVIRONMENT POSIX.1e assigns security attributes to all objects, extending the security functionality described in POSIX.1. @@ -89,8 +93,10 @@ for mandatory access control labels. .Xr extattr 2 , .Xr acl 3 , .Xr extattr 3 , +.Xr libcapsicum 3 , .Xr libbsm 3 , .Xr mac 3 , +.Xr capsicum 4 , .Xr ffs 7 , .Xr getfmac 8 , .Xr setfmac 8 , From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 12:15:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AD65B625; Wed, 23 Apr 2014 12:15: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 9BB911D8B; Wed, 23 Apr 2014 12:15: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 s3NCFEb5010484; Wed, 23 Apr 2014 12:15:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NCFE7F010483; Wed, 23 Apr 2014 12:15:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404231215.s3NCFE7F010483@svn.freebsd.org> From: Christian Brueffer Date: Wed, 23 Apr 2014 12:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264819 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 12:15:15 -0000 Author: brueffer Date: Wed Apr 23 12:15:14 2014 New Revision: 264819 URL: http://svnweb.freebsd.org/changeset/base/264819 Log: MFC: r264422, r264471 Set buf to NULL only when we don't allocate memory, and free buf unconditionally. Found with: Coverity Prevent(tm) Requested by: kib (r264471) Modified: stable/10/sys/kern/imgact_elf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Wed Apr 23 12:11:14 2014 (r264818) +++ stable/10/sys/kern/imgact_elf.c Wed Apr 23 12:15:14 2014 (r264819) @@ -1740,14 +1740,16 @@ __elfN(note_threadmd)(void *arg, struct td = (struct thread *)arg; size = *sizep; - buf = NULL; if (size != 0 && sb != NULL) buf = malloc(size, M_TEMP, M_ZERO | M_WAITOK); + else + buf = NULL; size = 0; __elfN(dump_thread)(td, buf, &size); KASSERT(*sizep == size, ("invalid size")); if (size != 0 && sb != NULL) sbuf_bcat(sb, buf, size); + free(buf, M_TEMP); *sizep = size; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 23 12:46:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7B0C414A; Wed, 23 Apr 2014 12:46: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 6778311EA; Wed, 23 Apr 2014 12:46: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 s3NCkSnZ023328; Wed, 23 Apr 2014 12:46:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NCkSZQ023327; Wed, 23 Apr 2014 12:46:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404231246.s3NCkSZQ023327@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Apr 2014 12:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264821 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 12:46:28 -0000 Author: mav Date: Wed Apr 23 12:46:27 2014 New Revision: 264821 URL: http://svnweb.freebsd.org/changeset/base/264821 Log: MFC r264550: Fix VIRTUAL and PROF interval timers for short intervals, broken at r247903. Due to the way those timers are implemented, we can't handle very short intervals. In addition to that mentioned patch caused math overflows for short intervals. To avoid that round those intervals to 1 tick. PR: kern/187668 Modified: stable/10/sys/kern/kern_time.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_time.c ============================================================================== --- stable/10/sys/kern/kern_time.c Wed Apr 23 12:16:36 2014 (r264820) +++ stable/10/sys/kern/kern_time.c Wed Apr 23 12:46:27 2014 (r264821) @@ -774,6 +774,14 @@ kern_setitimer(struct thread *td, u_int timevalsub(&oitv->it_value, &ctv); } } else { + if (aitv->it_interval.tv_sec == 0 && + aitv->it_interval.tv_usec != 0 && + aitv->it_interval.tv_usec < tick) + aitv->it_interval.tv_usec = tick; + if (aitv->it_value.tv_sec == 0 && + aitv->it_value.tv_usec != 0 && + aitv->it_value.tv_usec < tick) + aitv->it_value.tv_usec = tick; PROC_SLOCK(p); *oitv = p->p_stats->p_timer[which]; p->p_stats->p_timer[which] = *aitv; From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 24 00:29:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 322079C1; Thu, 24 Apr 2014 00:29: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 1E77A1ABF; Thu, 24 Apr 2014 00:29: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 s3O0T2PO023308; Thu, 24 Apr 2014 00:29:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O0T2oK023307; Thu, 24 Apr 2014 00:29:02 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404240029.s3O0T2oK023307@svn.freebsd.org> From: Glen Barber Date: Thu, 24 Apr 2014 00:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264847 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 00:29:03 -0000 Author: gjb Date: Thu Apr 24 00:29:02 2014 New Revision: 264847 URL: http://svnweb.freebsd.org/changeset/base/264847 Log: MFC r264731: urndis(4) will first appear in 9.3-RELEASE. Sponsored by: The FreeBSD Foundation Modified: stable/10/share/man/man4/urndis.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/urndis.4 ============================================================================== --- stable/10/share/man/man4/urndis.4 Thu Apr 24 00:27:34 2014 (r264846) +++ stable/10/share/man/man4/urndis.4 Thu Apr 24 00:29:02 2014 (r264847) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2014 +.Dd April 21, 2014 .Dt URNDIS 4 .Os .Sh NAME @@ -81,7 +81,7 @@ device driver first appeared in The first .Fx release to include it was -.Fx 10.1 . +.Fx 9.3 . .Sh AUTHORS .An -nosplit The From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 24 04:43:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DFBBD418; Thu, 24 Apr 2014 04:43: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 CA00C1393; Thu, 24 Apr 2014 04:43: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 s3O4hokf030796; Thu, 24 Apr 2014 04:43:50 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O4hooS030793; Thu, 24 Apr 2014 04:43:50 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201404240443.s3O4hooS030793@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 24 Apr 2014 04:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264866 - in stable/10: share/man/man4 sys/dev/vmware/vmxnet3 sys/modules/vmware/vmxnet3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 04:43:51 -0000 Author: bryanv Date: Thu Apr 24 04:43:50 2014 New Revision: 264866 URL: http://svnweb.freebsd.org/changeset/base/264866 Log: MFC r263259 Add Tx/Rx multiqueue support to vmx(4) As a prerequisite for multiple queues, the guest must have MSIX enabled. Unfortunately, to work around device passthrough bugs, FreeBSD disables MSIX when running as a VMWare guest due to the hw.pci.honor_msi_blacklist tunable; this tunable must be disabled for multiple queues. Also included is various minor changes from the projects/vmxnet branch. MFC r264865 Update the date that was missed in r263259 Modified: stable/10/share/man/man4/vmx.4 stable/10/sys/dev/vmware/vmxnet3/if_vmx.c stable/10/sys/dev/vmware/vmxnet3/if_vmxreg.h stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h stable/10/sys/modules/vmware/vmxnet3/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/vmx.4 ============================================================================== --- stable/10/share/man/man4/vmx.4 Thu Apr 24 03:31:07 2014 (r264865) +++ stable/10/share/man/man4/vmx.4 Thu Apr 24 04:43:50 2014 (r264866) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 2013 +.Dd March 17, 2014 .Dt VMX 4 .Os .Sh NAME @@ -81,12 +81,35 @@ VMware Fusion 2.0 and newer .Pp For more information on configuring this device, see .Xr ifconfig 8 . +.Sh MULTIPLE QUEUES +The +.Nm +driver supports multiple transmit and receive queues. +Multiple queues are only supported by certain VMware products, such as ESXi. +The number of queues allocated depends on the presence of MSI-X, +the number of configured CPUs, +and the tunables listed below. +.Fx +does not enable MSI-X support on VMware by default. +The +.Va hw.pci.honor_msi_blacklist +tunable must be disabled to enable MSI-X support. .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent +.It Va hw.vmx.txnqueue +.It Va hw.vmx. Ns Ar X Ns Va .txnqueue +Maximum number of transmit queues allocated by default by the driver. +The default value is 8. +The maximum supported by the VMXNET3 virtual NIC is 8. +.It Va hw.vmx.rxnqueue +.It Va hw.vmx. Ns Ar X Ns Va .rxnqueue +Maximum number of receive queues allocated by default by the driver. +The default value is 8. +The maximum supported by the VMXNET3 virtual NIC is 16. .It Va hw.vmx.txndesc .It Va hw.vmx. Ns Ar X Ns Va .txndesc .Pp Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Thu Apr 24 03:31:07 2014 (r264865) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Thu Apr 24 04:43:50 2014 (r264866) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -67,9 +69,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -/* Always enable for now - useful for queue hangs. */ -#define VMXNET3_DEBUG_SYSCTL - #ifdef VMXNET3_FAILPOINTS #include static SYSCTL_NODE(DEBUG_FP, OID_AUTO, vmxnet3, CTLFLAG_RW, 0, @@ -86,6 +85,7 @@ static int vmxnet3_alloc_resources(struc static void vmxnet3_free_resources(struct vmxnet3_softc *); static int vmxnet3_check_version(struct vmxnet3_softc *); static void vmxnet3_initial_config(struct vmxnet3_softc *); +static void vmxnet3_check_multiqueue(struct vmxnet3_softc *); static int vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *); static int vmxnet3_alloc_msi_interrupts(struct vmxnet3_softc *); @@ -102,6 +102,13 @@ static void vmxnet3_free_interrupt(struc struct vmxnet3_interrupt *); static void vmxnet3_free_interrupts(struct vmxnet3_softc *); +#ifndef VMXNET3_LEGACY_TX +static int vmxnet3_alloc_taskqueue(struct vmxnet3_softc *); +static void vmxnet3_start_taskqueue(struct vmxnet3_softc *); +static void vmxnet3_drain_taskqueue(struct vmxnet3_softc *); +static void vmxnet3_free_taskqueue(struct vmxnet3_softc *); +#endif + static int vmxnet3_init_rxq(struct vmxnet3_softc *, int); static int vmxnet3_init_txq(struct vmxnet3_softc *, int); static int vmxnet3_alloc_rxtx_queues(struct vmxnet3_softc *); @@ -120,6 +127,7 @@ static void vmxnet3_free_queue_data(stru static int vmxnet3_alloc_mcast_table(struct vmxnet3_softc *); static void vmxnet3_init_shared_data(struct vmxnet3_softc *); static void vmxnet3_reinit_interface(struct vmxnet3_softc *); +static void vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *); static void vmxnet3_reinit_shared_data(struct vmxnet3_softc *); static int vmxnet3_alloc_data(struct vmxnet3_softc *); static void vmxnet3_free_data(struct vmxnet3_softc *); @@ -150,13 +158,24 @@ static int vmxnet3_reinit(struct vmxnet3 static void vmxnet3_init_locked(struct vmxnet3_softc *); static void vmxnet3_init(void *); -static int vmxnet3_txq_offload_ctx(struct mbuf *, int *, int *, int *); +static int vmxnet3_txq_offload_ctx(struct vmxnet3_txqueue *,struct mbuf *, + int *, int *, int *); static int vmxnet3_txq_load_mbuf(struct vmxnet3_txqueue *, struct mbuf **, bus_dmamap_t, bus_dma_segment_t [], int *); static void vmxnet3_txq_unload_mbuf(struct vmxnet3_txqueue *, bus_dmamap_t); static int vmxnet3_txq_encap(struct vmxnet3_txqueue *, struct mbuf **); +static void vmxnet3_txq_update_pending(struct vmxnet3_txqueue *); +#ifdef VMXNET3_LEGACY_TX static void vmxnet3_start_locked(struct ifnet *); static void vmxnet3_start(struct ifnet *); +#else +static int vmxnet3_txq_mq_start_locked(struct vmxnet3_txqueue *, + struct mbuf *); +static int vmxnet3_txq_mq_start(struct ifnet *, struct mbuf *); +static void vmxnet3_txq_tq_deferred(void *, int); +#endif +static void vmxnet3_txq_start(struct vmxnet3_txqueue *); +static void vmxnet3_tx_start_all(struct vmxnet3_softc *); static void vmxnet3_update_vlan_filter(struct vmxnet3_softc *, int, uint16_t); @@ -166,7 +185,16 @@ static void vmxnet3_set_rxfilter(struct static int vmxnet3_change_mtu(struct vmxnet3_softc *, int); static int vmxnet3_ioctl(struct ifnet *, u_long, caddr_t); +#ifndef VMXNET3_LEGACY_TX +static void vmxnet3_qflush(struct ifnet *); +#endif + static int vmxnet3_watchdog(struct vmxnet3_txqueue *); +static void vmxnet3_refresh_host_stats(struct vmxnet3_softc *); +static void vmxnet3_txq_accum_stats(struct vmxnet3_txqueue *, + struct vmxnet3_txq_stats *); +static void vmxnet3_rxq_accum_stats(struct vmxnet3_rxqueue *, + struct vmxnet3_rxq_stats *); static void vmxnet3_tick(void *); static void vmxnet3_link_status(struct vmxnet3_softc *); static void vmxnet3_media_status(struct ifnet *, struct ifmediareq *); @@ -211,6 +239,12 @@ typedef enum { static void vmxnet3_barrier(struct vmxnet3_softc *, vmxnet3_barrier_t); /* Tunables. */ +static int vmxnet3_mq_disable = 0; +TUNABLE_INT("hw.vmx.mq_disable", &vmxnet3_mq_disable); +static int vmxnet3_default_txnqueue = VMXNET3_DEF_TX_QUEUES; +TUNABLE_INT("hw.vmx.txnqueue", &vmxnet3_default_txnqueue); +static int vmxnet3_default_rxnqueue = VMXNET3_DEF_RX_QUEUES; +TUNABLE_INT("hw.vmx.rxnqueue", &vmxnet3_default_rxnqueue); static int vmxnet3_default_txndesc = VMXNET3_DEF_TX_NDESC; TUNABLE_INT("hw.vmx.txndesc", &vmxnet3_default_txndesc); static int vmxnet3_default_rxndesc = VMXNET3_DEF_RX_NDESC; @@ -280,10 +314,18 @@ vmxnet3_attach(device_t dev) if (error) goto fail; +#ifndef VMXNET3_LEGACY_TX + error = vmxnet3_alloc_taskqueue(sc); + if (error) + goto fail; +#endif + error = vmxnet3_alloc_interrupts(sc); if (error) goto fail; + vmxnet3_check_multiqueue(sc); + error = vmxnet3_alloc_data(sc); if (error) goto fail; @@ -300,7 +342,9 @@ vmxnet3_attach(device_t dev) } vmxnet3_setup_sysctl(sc); - vmxnet3_link_status(sc); +#ifndef VMXNET3_LEGACY_TX + vmxnet3_start_taskqueue(sc); +#endif fail: if (error) @@ -319,11 +363,16 @@ vmxnet3_detach(device_t dev) ifp = sc->vmx_ifp; if (device_is_attached(dev)) { - ether_ifdetach(ifp); VMXNET3_CORE_LOCK(sc); vmxnet3_stop(sc); VMXNET3_CORE_UNLOCK(sc); + callout_drain(&sc->vmx_tick); +#ifndef VMXNET3_LEGACY_TX + vmxnet3_drain_taskqueue(sc); +#endif + + ether_ifdetach(ifp); } if (sc->vmx_vlan_attach != NULL) { @@ -335,6 +384,9 @@ vmxnet3_detach(device_t dev) sc->vmx_vlan_detach = NULL; } +#ifndef VMXNET3_LEGACY_TX + vmxnet3_free_taskqueue(sc); +#endif vmxnet3_free_interrupts(sc); if (ifp != NULL) { @@ -461,14 +513,26 @@ vmxnet3_check_version(struct vmxnet3_sof static void vmxnet3_initial_config(struct vmxnet3_softc *sc) { - int ndesc; + int nqueue, ndesc; - /* - * BMV Much of the work is already done, but this driver does - * not support multiqueue yet. - */ - sc->vmx_ntxqueues = VMXNET3_TX_QUEUES; - sc->vmx_nrxqueues = VMXNET3_RX_QUEUES; + nqueue = vmxnet3_tunable_int(sc, "txnqueue", vmxnet3_default_txnqueue); + if (nqueue > VMXNET3_MAX_TX_QUEUES || nqueue < 1) + nqueue = VMXNET3_DEF_TX_QUEUES; + if (nqueue > mp_ncpus) + nqueue = mp_ncpus; + sc->vmx_max_ntxqueues = nqueue; + + nqueue = vmxnet3_tunable_int(sc, "rxnqueue", vmxnet3_default_rxnqueue); + if (nqueue > VMXNET3_MAX_RX_QUEUES || nqueue < 1) + nqueue = VMXNET3_DEF_RX_QUEUES; + if (nqueue > mp_ncpus) + nqueue = mp_ncpus; + sc->vmx_max_nrxqueues = nqueue; + + if (vmxnet3_tunable_int(sc, "mq_disable", vmxnet3_mq_disable)) { + sc->vmx_max_nrxqueues = 1; + sc->vmx_max_ntxqueues = 1; + } ndesc = vmxnet3_tunable_int(sc, "txd", vmxnet3_default_txndesc); if (ndesc > VMXNET3_MAX_TX_NDESC || ndesc < VMXNET3_MIN_TX_NDESC) @@ -486,6 +550,27 @@ vmxnet3_initial_config(struct vmxnet3_so sc->vmx_max_rxsegs = VMXNET3_MAX_RX_SEGS; } +static void +vmxnet3_check_multiqueue(struct vmxnet3_softc *sc) +{ + + if (sc->vmx_intr_type != VMXNET3_IT_MSIX) + goto out; + + /* BMV: Just use the maximum configured for now. */ + sc->vmx_nrxqueues = sc->vmx_max_nrxqueues; + sc->vmx_ntxqueues = sc->vmx_max_ntxqueues; + + if (sc->vmx_nrxqueues > 1) + sc->vmx_flags |= VMXNET3_FLAG_RSS; + + return; + +out: + sc->vmx_ntxqueues = 1; + sc->vmx_nrxqueues = 1; +} + static int vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *sc) { @@ -498,7 +583,7 @@ vmxnet3_alloc_msix_interrupts(struct vmx return (1); /* Allocate an additional vector for the events interrupt. */ - required = sc->vmx_nrxqueues + sc->vmx_ntxqueues + 1; + required = sc->vmx_max_nrxqueues + sc->vmx_max_ntxqueues + 1; nmsix = pci_msix_count(dev); if (nmsix < required) @@ -511,6 +596,8 @@ vmxnet3_alloc_msix_interrupts(struct vmx } else pci_release_msi(dev); + /* BMV TODO Fallback to sharing MSIX vectors if possible. */ + return (1); } @@ -584,10 +671,6 @@ vmxnet3_alloc_intr_resources(struct vmxn return (0); } -/* - * NOTE: We only support the simple case of each Rx and Tx queue on its - * own MSIX vector. This is good enough until we support mulitqueue. - */ static int vmxnet3_setup_msix_interrupts(struct vmxnet3_softc *sc) { @@ -649,10 +732,6 @@ vmxnet3_setup_legacy_interrupt(struct vm return (error); } -/* - * XXX BMV Should probably reorganize the attach and just do - * this in vmxnet3_init_shared_data(). - */ static void vmxnet3_set_interrupt_idx(struct vmxnet3_softc *sc) { @@ -782,6 +861,71 @@ vmxnet3_free_interrupts(struct vmxnet3_s pci_release_msi(sc->vmx_dev); } +#ifndef VMXNET3_LEGACY_TX +static int +vmxnet3_alloc_taskqueue(struct vmxnet3_softc *sc) +{ + device_t dev; + + dev = sc->vmx_dev; + + sc->vmx_tq = taskqueue_create(device_get_nameunit(dev), M_NOWAIT, + taskqueue_thread_enqueue, &sc->vmx_tq); + if (sc->vmx_tq == NULL) + return (ENOMEM); + + return (0); +} + +static void +vmxnet3_start_taskqueue(struct vmxnet3_softc *sc) +{ + device_t dev; + int nthreads, error; + + dev = sc->vmx_dev; + + /* + * The taskqueue is typically not frequently used, so a dedicated + * thread for each queue is unnecessary. + */ + nthreads = MAX(1, sc->vmx_ntxqueues / 2); + + /* + * Most drivers just ignore the return value - it only fails + * with ENOMEM so an error is not likely. It is hard for us + * to recover from an error here. + */ + error = taskqueue_start_threads(&sc->vmx_tq, nthreads, PI_NET, + "%s taskq", device_get_nameunit(dev)); + if (error) + device_printf(dev, "failed to start taskqueue: %d", error); +} + +static void +vmxnet3_drain_taskqueue(struct vmxnet3_softc *sc) +{ + struct vmxnet3_txqueue *txq; + int i; + + if (sc->vmx_tq != NULL) { + for (i = 0; i < sc->vmx_max_ntxqueues; i++) { + txq = &sc->vmx_txq[i]; + taskqueue_drain(sc->vmx_tq, &txq->vxtxq_defrtask); + } + } +} + +static void +vmxnet3_free_taskqueue(struct vmxnet3_softc *sc) +{ + if (sc->vmx_tq != NULL) { + taskqueue_free(sc->vmx_tq); + sc->vmx_tq = NULL; + } +} +#endif + static int vmxnet3_init_rxq(struct vmxnet3_softc *sc, int q) { @@ -837,6 +981,15 @@ vmxnet3_init_txq(struct vmxnet3_softc *s txq->vxtxq_comp_ring.vxcr_ndesc = sc->vmx_ntxdescs; +#ifndef VMXNET3_LEGACY_TX + TASK_INIT(&txq->vxtxq_defrtask, 0, vmxnet3_txq_tq_deferred, txq); + + txq->vxtxq_br = buf_ring_alloc(VMXNET3_DEF_BUFRING_SIZE, M_DEVBUF, + M_NOWAIT, &txq->vxtxq_mtx); + if (txq->vxtxq_br == NULL) + return (ENOMEM); +#endif + return (0); } @@ -845,20 +998,32 @@ vmxnet3_alloc_rxtx_queues(struct vmxnet3 { int i, error; + /* + * Only attempt to create multiple queues if MSIX is available. MSIX is + * disabled by default because its apparently broken for devices passed + * through by at least ESXi 5.1. The hw.pci.honor_msi_blacklist tunable + * must be set to zero for MSIX. This check prevents us from allocating + * queue structures that we will not use. + */ + if (sc->vmx_flags & VMXNET3_FLAG_NO_MSIX) { + sc->vmx_max_nrxqueues = 1; + sc->vmx_max_ntxqueues = 1; + } + sc->vmx_rxq = malloc(sizeof(struct vmxnet3_rxqueue) * - sc->vmx_nrxqueues, M_DEVBUF, M_NOWAIT | M_ZERO); + sc->vmx_max_nrxqueues, M_DEVBUF, M_NOWAIT | M_ZERO); sc->vmx_txq = malloc(sizeof(struct vmxnet3_txqueue) * - sc->vmx_ntxqueues, M_DEVBUF, M_NOWAIT | M_ZERO); + sc->vmx_max_ntxqueues, M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->vmx_rxq == NULL || sc->vmx_txq == NULL) return (ENOMEM); - for (i = 0; i < sc->vmx_nrxqueues; i++) { + for (i = 0; i < sc->vmx_max_nrxqueues; i++) { error = vmxnet3_init_rxq(sc, i); if (error) return (error); } - for (i = 0; i < sc->vmx_ntxqueues; i++) { + for (i = 0; i < sc->vmx_max_ntxqueues; i++) { error = vmxnet3_init_txq(sc, i); if (error) return (error); @@ -899,6 +1064,13 @@ vmxnet3_destroy_txq(struct vmxnet3_txque txq->vxtxq_sc = NULL; txq->vxtxq_id = -1; +#ifndef VMXNET3_LEGACY_TX + if (txq->vxtxq_br != NULL) { + buf_ring_free(txq->vxtxq_br, M_DEVBUF); + txq->vxtxq_br = NULL; + } +#endif + if (txr->vxtxr_txbuf != NULL) { free(txr->vxtxr_txbuf, M_DEVBUF); txr->vxtxr_txbuf = NULL; @@ -914,14 +1086,14 @@ vmxnet3_free_rxtx_queues(struct vmxnet3_ int i; if (sc->vmx_rxq != NULL) { - for (i = 0; i < sc->vmx_nrxqueues; i++) + for (i = 0; i < sc->vmx_max_nrxqueues; i++) vmxnet3_destroy_rxq(&sc->vmx_rxq[i]); free(sc->vmx_rxq, M_DEVBUF); sc->vmx_rxq = NULL; } if (sc->vmx_txq != NULL) { - for (i = 0; i < sc->vmx_ntxqueues; i++) + for (i = 0; i < sc->vmx_max_ntxqueues; i++) vmxnet3_destroy_txq(&sc->vmx_txq[i]); free(sc->vmx_txq, M_DEVBUF); sc->vmx_txq = NULL; @@ -965,6 +1137,17 @@ vmxnet3_alloc_shared_data(struct vmxnet3 kva += sizeof(struct vmxnet3_rxq_shared); } + if (sc->vmx_flags & VMXNET3_FLAG_RSS) { + size = sizeof(struct vmxnet3_rss_shared); + error = vmxnet3_dma_malloc(sc, size, 128, &sc->vmx_rss_dma); + if (error) { + device_printf(dev, "cannot alloc rss shared memory\n"); + return (error); + } + sc->vmx_rss = + (struct vmxnet3_rss_shared *) sc->vmx_rss_dma.dma_vaddr; + } + return (0); } @@ -972,6 +1155,11 @@ static void vmxnet3_free_shared_data(struct vmxnet3_softc *sc) { + if (sc->vmx_rss != NULL) { + vmxnet3_dma_free(sc, &sc->vmx_rss_dma); + sc->vmx_rss = NULL; + } + if (sc->vmx_qs != NULL) { vmxnet3_dma_free(sc, &sc->vmx_qs_dma); sc->vmx_qs = NULL; @@ -1008,7 +1196,7 @@ vmxnet3_alloc_txq_data(struct vmxnet3_so BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - VMXNET3_TSO_MAXSIZE, /* maxsize */ + VMXNET3_TX_MAXSIZE, /* maxsize */ VMXNET3_TX_MAXSEGS, /* nsegments */ VMXNET3_TX_MAXSEGSIZE, /* maxsegsize */ 0, /* flags */ @@ -1333,6 +1521,13 @@ vmxnet3_init_shared_data(struct vmxnet3_ ds->queue_shared_len = sc->vmx_qs_dma.dma_size; ds->nrxsg_max = sc->vmx_max_rxsegs; + /* RSS conf */ + if (sc->vmx_flags & VMXNET3_FLAG_RSS) { + ds->rss.version = 1; + ds->rss.paddr = sc->vmx_rss_dma.dma_paddr; + ds->rss.len = sc->vmx_rss_dma.dma_size; + } + /* Interrupt control. */ ds->automask = sc->vmx_intr_mask_mode == VMXNET3_IMM_AUTO; ds->nintr = sc->vmx_nintrs; @@ -1392,9 +1587,43 @@ vmxnet3_reinit_interface(struct vmxnet3_ if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) ifp->if_hwassist |= VMXNET3_CSUM_OFFLOAD_IPV6; if (ifp->if_capenable & IFCAP_TSO4) - ifp->if_hwassist |= CSUM_TSO; + ifp->if_hwassist |= CSUM_IP_TSO; if (ifp->if_capenable & IFCAP_TSO6) - ifp->if_hwassist |= CSUM_TSO; /* No CSUM_TSO_IPV6. */ + ifp->if_hwassist |= CSUM_IP6_TSO; +} + +static void +vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *sc) +{ + /* + * Use the same key as the Linux driver until FreeBSD can do + * RSS (presumably Toeplitz) in software. + */ + static const uint8_t rss_key[UPT1_RSS_MAX_KEY_SIZE] = { + 0x3b, 0x56, 0xd1, 0x56, 0x13, 0x4a, 0xe7, 0xac, + 0xe8, 0x79, 0x09, 0x75, 0xe8, 0x65, 0x79, 0x28, + 0x35, 0x12, 0xb9, 0x56, 0x7c, 0x76, 0x4b, 0x70, + 0xd8, 0x56, 0xa3, 0x18, 0x9b, 0x0a, 0xee, 0xf3, + 0x96, 0xa6, 0x9f, 0x8f, 0x9e, 0x8c, 0x90, 0xc9, + }; + + struct vmxnet3_driver_shared *ds; + struct vmxnet3_rss_shared *rss; + int i; + + ds = sc->vmx_ds; + rss = sc->vmx_rss; + + rss->hash_type = + UPT1_RSS_HASH_TYPE_IPV4 | UPT1_RSS_HASH_TYPE_TCP_IPV4 | + UPT1_RSS_HASH_TYPE_IPV6 | UPT1_RSS_HASH_TYPE_TCP_IPV6; + rss->hash_func = UPT1_RSS_HASH_FUNC_TOEPLITZ; + rss->hash_key_size = UPT1_RSS_MAX_KEY_SIZE; + rss->ind_table_size = UPT1_RSS_MAX_IND_TABLE_SIZE; + memcpy(rss->hash_key, rss_key, UPT1_RSS_MAX_KEY_SIZE); + + for (i = 0; i < UPT1_RSS_MAX_IND_TABLE_SIZE; i++) + rss->ind_table[i] = i % sc->vmx_nrxqueues; } static void @@ -1406,6 +1635,10 @@ vmxnet3_reinit_shared_data(struct vmxnet ifp = sc->vmx_ifp; ds = sc->vmx_ds; + ds->mtu = ifp->if_mtu; + ds->ntxqueue = sc->vmx_ntxqueues; + ds->nrxqueue = sc->vmx_nrxqueues; + ds->upt_features = 0; if (ifp->if_capenable & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) ds->upt_features |= UPT1_F_CSUM; @@ -1414,9 +1647,10 @@ vmxnet3_reinit_shared_data(struct vmxnet if (ifp->if_capenable & IFCAP_LRO) ds->upt_features |= UPT1_F_LRO; - ds->mtu = ifp->if_mtu; - ds->ntxqueue = sc->vmx_ntxqueues; - ds->nrxqueue = sc->vmx_nrxqueues; + if (sc->vmx_flags & VMXNET3_FLAG_RSS) { + ds->upt_features |= UPT1_F_RSS; + vmxnet3_reinit_rss_shared_data(sc); + } vmxnet3_write_bar1(sc, VMXNET3_BAR1_DSL, sc->vmx_ds_dma.dma_paddr); vmxnet3_write_bar1(sc, VMXNET3_BAR1_DSH, @@ -1471,17 +1705,26 @@ vmxnet3_setup_interface(struct vmxnet3_s if_initname(ifp, device_get_name(dev), device_get_unit(dev)); #if __FreeBSD_version < 1000025 ifp->if_baudrate = 1000000000; -#else +#elif __FreeBSD_version < 1100011 if_initbaudrate(ifp, IF_Gbps(10)); +#else + ifp->if_baudrate = IF_Gbps(10); #endif ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vmxnet3_init; ifp->if_ioctl = vmxnet3_ioctl; + ifp->if_hw_tsomax = VMXNET3_TSO_MAXSIZE; + +#ifdef VMXNET3_LEGACY_TX ifp->if_start = vmxnet3_start; ifp->if_snd.ifq_drv_maxlen = sc->vmx_ntxdescs - 1; IFQ_SET_MAXLEN(&ifp->if_snd, sc->vmx_ntxdescs - 1); IFQ_SET_READY(&ifp->if_snd); +#else + ifp->if_transmit = vmxnet3_txq_mq_start; + ifp->if_qflush = vmxnet3_qflush; +#endif vmxnet3_get_lladdr(sc); ether_ifattach(ifp, sc->vmx_lladdr); @@ -1529,8 +1772,11 @@ vmxnet3_evintr(struct vmxnet3_softc *sc) event = sc->vmx_ds->event; vmxnet3_write_bar1(sc, VMXNET3_BAR1_EVENT, event); - if (event & VMXNET3_EVENT_LINK) + if (event & VMXNET3_EVENT_LINK) { vmxnet3_link_status(sc); + if (sc->vmx_link_active != 0) + vmxnet3_tx_start_all(sc); + } if (event & (VMXNET3_EVENT_TQERROR | VMXNET3_EVENT_RQERROR)) { reset = 1; @@ -1566,6 +1812,7 @@ vmxnet3_txq_eof(struct vmxnet3_txqueue * struct vmxnet3_comp_ring *txc; struct vmxnet3_txcompdesc *txcd; struct vmxnet3_txbuf *txb; + struct mbuf *m; u_int sop; sc = txq->vxtxq_sc; @@ -1589,15 +1836,18 @@ vmxnet3_txq_eof(struct vmxnet3_txqueue * sop = txr->vxtxr_next; txb = &txr->vxtxr_txbuf[sop]; - if (txb->vtxb_m != NULL) { + if ((m = txb->vtxb_m) != NULL) { bus_dmamap_sync(txr->vxtxr_txtag, txb->vtxb_dmamap, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(txr->vxtxr_txtag, txb->vtxb_dmamap); - m_freem(txb->vtxb_m); - txb->vtxb_m = NULL; + txq->vxtxq_stats.vmtxs_opackets++; + txq->vxtxq_stats.vmtxs_obytes += m->m_pkthdr.len; + if (m->m_flags & M_MCAST) + txq->vxtxq_stats.vmtxs_omcasts++; - ifp->if_opackets++; + m_freem(m); + txb->vtxb_m = NULL; } txr->vxtxr_next = (txcd->eop_idx + 1) % txr->vxtxr_ndesc; @@ -1771,11 +2021,39 @@ vmxnet3_rxq_input(struct vmxnet3_rxqueue ifp = sc->vmx_ifp; if (rxcd->error) { - ifp->if_ierrors++; + rxq->vxrxq_stats.vmrxs_ierrors++; m_freem(m); return; } +#ifdef notyet + switch (rxcd->rss_type) { + case VMXNET3_RCD_RSS_TYPE_IPV4: + m->m_pkthdr.flowid = rxcd->rss_hash; + M_HASHTYPE_SET(m, M_HASHTYPE_RSS_IPV4); + break; + case VMXNET3_RCD_RSS_TYPE_TCPIPV4: + m->m_pkthdr.flowid = rxcd->rss_hash; + M_HASHTYPE_SET(m, M_HASHTYPE_RSS_TCP_IPV4); + break; + case VMXNET3_RCD_RSS_TYPE_IPV6: + m->m_pkthdr.flowid = rxcd->rss_hash; + M_HASHTYPE_SET(m, M_HASHTYPE_RSS_IPV6); + break; + case VMXNET3_RCD_RSS_TYPE_TCPIPV6: + m->m_pkthdr.flowid = rxcd->rss_hash; + M_HASHTYPE_SET(m, M_HASHTYPE_RSS_TCP_IPV6); + break; + default: /* VMXNET3_RCD_RSS_TYPE_NONE */ + m->m_pkthdr.flowid = rxq->vxrxq_id; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + break; + } +#else + m->m_pkthdr.flowid = rxq->vxrxq_id; + m->m_flags |= M_FLOWID; +#endif + if (!rxcd->no_csum) vmxnet3_rx_csum(rxcd, m); if (rxcd->vlan) { @@ -1783,7 +2061,9 @@ vmxnet3_rxq_input(struct vmxnet3_rxqueue m->m_pkthdr.ether_vtag = rxcd->vtag; } - ifp->if_ipackets++; + rxq->vxrxq_stats.vmrxs_ipackets++; + rxq->vxrxq_stats.vmrxs_ibytes += m->m_pkthdr.len; + VMXNET3_RXQ_UNLOCK(rxq); (*ifp->if_input)(ifp, m); VMXNET3_RXQ_LOCK(rxq); @@ -1865,7 +2145,7 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue * } if (vmxnet3_newbuf(sc, rxr) != 0) { - ifp->if_iqdrops++; + rxq->vxrxq_stats.vmrxs_iqdrops++; vmxnet3_rxq_eof_discard(rxq, rxr, idx); if (!rxcd->eop) vmxnet3_rxq_discard_chain(rxq); @@ -1884,7 +2164,7 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue * ("%s: frame not started?", __func__)); if (vmxnet3_newbuf(sc, rxr) != 0) { - ifp->if_iqdrops++; + rxq->vxrxq_stats.vmrxs_iqdrops++; vmxnet3_rxq_eof_discard(rxq, rxr, idx); if (!rxcd->eop) vmxnet3_rxq_discard_chain(rxq); @@ -1953,8 +2233,7 @@ vmxnet3_legacy_intr(void *xsc) VMXNET3_TXQ_LOCK(txq); vmxnet3_txq_eof(txq); - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vmxnet3_start_locked(ifp); + vmxnet3_txq_start(txq); VMXNET3_TXQ_UNLOCK(txq); vmxnet3_enable_all_intrs(sc); @@ -1976,8 +2255,7 @@ vmxnet3_txq_intr(void *xtxq) VMXNET3_TXQ_LOCK(txq); vmxnet3_txq_eof(txq); - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vmxnet3_start_locked(ifp); + vmxnet3_txq_start(txq); VMXNET3_TXQ_UNLOCK(txq); vmxnet3_enable_intr(sc, txq->vxtxq_intr_idx); @@ -2056,6 +2334,7 @@ vmxnet3_rxstop(struct vmxnet3_softc *sc, if (rxb->vrxb_m == NULL) continue; + bus_dmamap_sync(rxr->vxrxr_rxtag, rxb->vrxb_dmamap, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(rxr->vxrxr_rxtag, rxb->vrxb_dmamap); @@ -2318,7 +2597,8 @@ vmxnet3_init(void *xsc) * the mbuf packet header. Bug andre@. */ static int -vmxnet3_txq_offload_ctx(struct mbuf *m, int *etype, int *proto, int *start) +vmxnet3_txq_offload_ctx(struct vmxnet3_txqueue *txq, struct mbuf *m, + int *etype, int *proto, int *start) { struct ether_vlan_header *evh; int offset; @@ -2342,7 +2622,7 @@ vmxnet3_txq_offload_ctx(struct mbuf *m, (caddr_t) &iphdr); ip = &iphdr; } else - ip = (struct ip *)(m->m_data + offset); + ip = mtodo(m, offset); *proto = ip->ip_p; *start = offset + (ip->ip_hl << 2); break; @@ -2370,19 +2650,21 @@ vmxnet3_txq_offload_ctx(struct mbuf *m, return (EINVAL); } - if (m->m_len < *start + sizeof(struct tcphdr)) { - m_copydata(m, offset, sizeof(struct tcphdr), - (caddr_t) &tcphdr); - tcp = &tcphdr; - } else - tcp = (struct tcphdr *)(m->m_data + *start); + txq->vxtxq_stats.vmtxs_tso++; /* * For TSO, the size of the protocol header is also * included in the descriptor header size. */ + if (m->m_len < *start + sizeof(struct tcphdr)) { + m_copydata(m, offset, sizeof(struct tcphdr), + (caddr_t) &tcphdr); + tcp = &tcphdr; + } else + tcp = mtodo(m, *start); *start += (tcp->th_off << 2); - } + } else + txq->vxtxq_stats.vmtxs_csum++; return (0); } @@ -2394,18 +2676,17 @@ vmxnet3_txq_load_mbuf(struct vmxnet3_txq struct vmxnet3_txring *txr; struct mbuf *m; bus_dma_tag_t tag; - int maxsegs, error; + int error; txr = &txq->vxtxq_cmd_ring; m = *m0; tag = txr->vxtxr_txtag; - maxsegs = VMXNET3_TX_MAXSEGS; error = bus_dmamap_load_mbuf_sg(tag, dmap, m, segs, nsegs, 0); if (error == 0 || error != EFBIG) return (error); - m = m_collapse(m, M_NOWAIT, maxsegs); + m = m_defrag(m, M_NOWAIT); if (m != NULL) { *m0 = m; error = bus_dmamap_load_mbuf_sg(tag, dmap, m, segs, nsegs, 0); @@ -2415,8 +2696,9 @@ vmxnet3_txq_load_mbuf(struct vmxnet3_txq if (error) { m_freem(*m0); *m0 = NULL; + txq->vxtxq_sc->vmx_stats.vmst_defrag_failed++; } else - txq->vxtxq_sc->vmx_stats.vmst_collapsed++; + txq->vxtxq_sc->vmx_stats.vmst_defragged++; return (error); } @@ -2459,13 +2741,13 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue ("%s: mbuf %p with too many segments %d", __func__, m, nsegs)); if (VMXNET3_TXRING_AVAIL(txr) < nsegs) { - txq->vxtxq_stats.vtxrs_full++; + txq->vxtxq_stats.vmtxs_full++; vmxnet3_txq_unload_mbuf(txq, dmap); return (ENOSPC); } else if (m->m_pkthdr.csum_flags & VMXNET3_CSUM_ALL_OFFLOAD) { - error = vmxnet3_txq_offload_ctx(m, &etype, &proto, &start); + error = vmxnet3_txq_offload_ctx(txq, m, &etype, &proto, &start); if (error) { - txq->vxtxq_stats.vtxrs_offload_failed++; + txq->vxtxq_stats.vmtxs_offload_failed++; vmxnet3_txq_unload_mbuf(txq, dmap); m_freem(m); *m0 = NULL; @@ -2531,6 +2813,22 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue } static void +vmxnet3_txq_update_pending(struct vmxnet3_txqueue *txq) +{ + struct vmxnet3_txring *txr; + + txr = &txq->vxtxq_cmd_ring; + + if (txq->vxtxq_ts->npending > 0) { + txq->vxtxq_ts->npending = 0; + vmxnet3_write_bar0(txq->vxtxq_sc, + VMXNET3_BAR0_TXH(txq->vxtxq_id), txr->vxtxr_head); + } +} + +#ifdef VMXNET3_LEGACY_TX + +static void vmxnet3_start_locked(struct ifnet *ifp) { struct vmxnet3_softc *sc; @@ -2575,11 +2873,7 @@ vmxnet3_start_locked(struct ifnet *ifp) } if (tx > 0) { - if (txq->vxtxq_ts->npending > 0) { - txq->vxtxq_ts->npending = 0; - vmxnet3_write_bar0(sc, VMXNET3_BAR0_TXH(txq->vxtxq_id), - txr->vxtxr_head); - } + vmxnet3_txq_update_pending(txq); txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT; } } @@ -2598,6 +2892,153 @@ vmxnet3_start(struct ifnet *ifp) VMXNET3_TXQ_UNLOCK(txq); } +#else /* !VMXNET3_LEGACY_TX */ + +static int +vmxnet3_txq_mq_start_locked(struct vmxnet3_txqueue *txq, struct mbuf *m) +{ + struct vmxnet3_softc *sc; + struct vmxnet3_txring *txr; + struct buf_ring *br; + struct ifnet *ifp; + int tx, avail, error; + + sc = txq->vxtxq_sc; + br = txq->vxtxq_br; + ifp = sc->vmx_ifp; + txr = &txq->vxtxq_cmd_ring; + tx = 0; + error = 0; + + VMXNET3_TXQ_LOCK_ASSERT(txq); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sc->vmx_link_active == 0) { + if (m != NULL) + error = drbr_enqueue(ifp, br, m); + return (error); + } + + if (m != NULL) { + error = drbr_enqueue(ifp, br, m); + if (error) + return (error); + } + + while ((avail = VMXNET3_TXRING_AVAIL(txr)) >= 2) { + m = drbr_peek(ifp, br); + if (m == NULL) + break; + + /* Assume worse case if this mbuf is the head of a chain. */ + if (m->m_next != NULL && avail < VMXNET3_TX_MAXSEGS) { + drbr_putback(ifp, br, m); + error = ENOBUFS; + break; + } + + error = vmxnet3_txq_encap(txq, &m); + if (error) { + if (m != NULL) + drbr_putback(ifp, br, m); + else + drbr_advance(ifp, br); + break; + } + drbr_advance(ifp, br); + + tx++; + ETHER_BPF_MTAP(ifp, m); + } + + if (tx > 0) { + vmxnet3_txq_update_pending(txq); + txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT; + } + + return (error); +} + +static int +vmxnet3_txq_mq_start(struct ifnet *ifp, struct mbuf *m) +{ + struct vmxnet3_softc *sc; + struct vmxnet3_txqueue *txq; + int i, ntxq, error; + + sc = ifp->if_softc; + ntxq = sc->vmx_ntxqueues; + + if (m->m_flags & M_FLOWID) + i = m->m_pkthdr.flowid % ntxq; + else + i = curcpu % ntxq; + + txq = &sc->vmx_txq[i]; + + if (VMXNET3_TXQ_TRYLOCK(txq) != 0) { + error = vmxnet3_txq_mq_start_locked(txq, m); + VMXNET3_TXQ_UNLOCK(txq); + } else { + error = drbr_enqueue(ifp, txq->vxtxq_br, m); + taskqueue_enqueue(sc->vmx_tq, &txq->vxtxq_defrtask); + } + + return (error); +} + +static void +vmxnet3_txq_tq_deferred(void *xtxq, int pending) +{ + struct vmxnet3_softc *sc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 24 10:22:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4907C59D; Thu, 24 Apr 2014 10:22: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 295D61503; Thu, 24 Apr 2014 10:22: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 s3OAM1OI068590; Thu, 24 Apr 2014 10:22:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OAM1qQ068589; Thu, 24 Apr 2014 10:22:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404241022.s3OAM1qQ068589@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Apr 2014 10:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264868 - stable/10/sys/geom/raid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 10:22:01 -0000 Author: mav Date: Thu Apr 24 10:22:00 2014 New Revision: 264868 URL: http://svnweb.freebsd.org/changeset/base/264868 Log: MFC r264318: Fix wrong sizes used to access PD_Type and PD_State DDF metadata fields. This caused incorrect behavior of arrays with big-endian DDF metadata. Little-endian (like used by Adaptec controllers) should not be harmed. Add workaround should be enough to manage compatibility. Modified: stable/10/sys/geom/raid/md_ddf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/raid/md_ddf.c ============================================================================== --- stable/10/sys/geom/raid/md_ddf.c Thu Apr 24 05:04:54 2014 (r264867) +++ stable/10/sys/geom/raid/md_ddf.c Thu Apr 24 10:22:00 2014 (r264868) @@ -1182,6 +1182,28 @@ hdrerror: g_free(buf); if (GET32(meta, pdr->Signature) != DDF_PDR_SIGNATURE) goto hdrerror; + /* + * Workaround for reading metadata corrupted due to graid bug. + * XXX: Remove this before we have disks above 128PB. :) + */ + if (meta->bigendian) { + for (i = 0; i < GET16(meta, pdr->Populated_PDEs); i++) { + if (isff(meta->pdr->entry[i].PD_GUID, 24)) + continue; + if (GET32(meta, pdr->entry[i].PD_Reference) == + 0xffffffff) + continue; + if (GET64(meta, pdr->entry[i].Configured_Size) >= + (1ULL << 48)) { + SET16(meta, pdr->entry[i].PD_State, + GET16(meta, pdr->entry[i].PD_State) & + ~DDF_PDE_FAILED); + SET64(meta, pdr->entry[i].Configured_Size, + GET64(meta, pdr->entry[i].Configured_Size) & + ((1ULL << 48) - 1)); + } + } + } /* Read virtual disk records. */ buf = g_read_data(cp, (lba + GET32(meta, hdr->vdr_section)) * ss, @@ -1711,7 +1733,7 @@ nofit: /* Welcome the new disk. */ if (resurrection) g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); - else if (GET8(gmeta, pdr->entry[md_pde_pos].PD_State) & DDF_PDE_PFA) + else if (GET16(gmeta, pdr->entry[md_pde_pos].PD_State) & DDF_PDE_PFA) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); @@ -1730,11 +1752,11 @@ nofit: /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (GET8(gmeta, pdr->entry[md_pde_pos].PD_State) & DDF_PDE_PFA) { + } else if (GET16(gmeta, pdr->entry[md_pde_pos].PD_State) & DDF_PDE_PFA) { /* Failed disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_FAILED); - } else if ((GET8(gmeta, pdr->entry[md_pde_pos].PD_State) & + } else if ((GET16(gmeta, pdr->entry[md_pde_pos].PD_State) & (DDF_PDE_FAILED | DDF_PDE_REBUILD)) != 0) { /* Rebuilding disk. */ g_raid_change_subdisk_state(sd, @@ -2833,24 +2855,24 @@ g_raid_md_write_ddf(struct g_raid_md_obj GET32(vmeta, bvdc[bvd]->Physical_Disk_Sequence[pos])); if (j < 0) continue; - SET32(gmeta, pdr->entry[j].PD_Type, - GET32(gmeta, pdr->entry[j].PD_Type) | + SET16(gmeta, pdr->entry[j].PD_Type, + GET16(gmeta, pdr->entry[j].PD_Type) | DDF_PDE_PARTICIPATING); if (sd->sd_state == G_RAID_SUBDISK_S_NONE) - SET32(gmeta, pdr->entry[j].PD_State, - GET32(gmeta, pdr->entry[j].PD_State) | + SET16(gmeta, pdr->entry[j].PD_State, + GET16(gmeta, pdr->entry[j].PD_State) | (DDF_PDE_FAILED | DDF_PDE_MISSING)); else if (sd->sd_state == G_RAID_SUBDISK_S_FAILED) - SET32(gmeta, pdr->entry[j].PD_State, - GET32(gmeta, pdr->entry[j].PD_State) | + SET16(gmeta, pdr->entry[j].PD_State, + GET16(gmeta, pdr->entry[j].PD_State) | (DDF_PDE_FAILED | DDF_PDE_PFA)); else if (sd->sd_state <= G_RAID_SUBDISK_S_REBUILD) - SET32(gmeta, pdr->entry[j].PD_State, - GET32(gmeta, pdr->entry[j].PD_State) | + SET16(gmeta, pdr->entry[j].PD_State, + GET16(gmeta, pdr->entry[j].PD_State) | DDF_PDE_REBUILD); else - SET32(gmeta, pdr->entry[j].PD_State, - GET32(gmeta, pdr->entry[j].PD_State) | + SET16(gmeta, pdr->entry[j].PD_State, + GET16(gmeta, pdr->entry[j].PD_State) | DDF_PDE_ONLINE); } } @@ -2863,8 +2885,8 @@ g_raid_md_write_ddf(struct g_raid_md_obj if (i < 0) continue; if (disk->d_state == G_RAID_DISK_S_FAILED) { - SET32(gmeta, pdr->entry[i].PD_State, - GET32(gmeta, pdr->entry[i].PD_State) | + SET16(gmeta, pdr->entry[i].PD_State, + GET16(gmeta, pdr->entry[i].PD_State) | (DDF_PDE_FAILED | DDF_PDE_PFA)); } if (disk->d_state != G_RAID_DISK_S_SPARE) @@ -2881,8 +2903,8 @@ g_raid_md_write_ddf(struct g_raid_md_obj GET16(gmeta, pdr->entry[i].PD_Type) | DDF_PDE_CONFIG_SPARE); } - SET32(gmeta, pdr->entry[i].PD_State, - GET32(gmeta, pdr->entry[i].PD_State) | + SET16(gmeta, pdr->entry[i].PD_State, + GET16(gmeta, pdr->entry[i].PD_State) | DDF_PDE_ONLINE); } From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 24 10:23:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9276F83B; Thu, 24 Apr 2014 10:23: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 7F32A1529; Thu, 24 Apr 2014 10:23: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 s3OANapq068849; Thu, 24 Apr 2014 10:23:36 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OANa15068848; Thu, 24 Apr 2014 10:23:36 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404241023.s3OANa15068848@svn.freebsd.org> From: Christian Brueffer Date: Thu, 24 Apr 2014 10:23:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264870 - stable/10/lib/libipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 10:23:36 -0000 Author: brueffer Date: Thu Apr 24 10:23:35 2014 New Revision: 264870 URL: http://svnweb.freebsd.org/changeset/base/264870 Log: MFC: r264585 Add a missing break in the TCP case. Reviewed by: bms Modified: stable/10/lib/libipsec/ipsec_dump_policy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libipsec/ipsec_dump_policy.c ============================================================================== --- stable/10/lib/libipsec/ipsec_dump_policy.c Thu Apr 24 10:23:11 2014 (r264869) +++ stable/10/lib/libipsec/ipsec_dump_policy.c Thu Apr 24 10:23:35 2014 (r264870) @@ -199,6 +199,7 @@ ipsec_dump_ipsecrequest(buf, len, xisr, break; case IPPROTO_TCP: proto = "tcp"; + break; default: __ipsec_errcode = EIPSEC_INVAL_PROTO; return NULL; From owner-svn-src-stable-10@FreeBSD.ORG Thu Apr 24 11:12:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D415A6C7; Thu, 24 Apr 2014 11:12: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 C01DC1A5E; Thu, 24 Apr 2014 11:12: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 s3OBCrhu089365; Thu, 24 Apr 2014 11:12:53 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OBCren089364; Thu, 24 Apr 2014 11:12:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404241112.s3OBCren089364@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 24 Apr 2014 11:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264873 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 11:12:53 -0000 Author: ae Date: Thu Apr 24 11:12:53 2014 New Revision: 264873 URL: http://svnweb.freebsd.org/changeset/base/264873 Log: MFC r264582: Remove unused variable. PR: 173521 Modified: stable/10/sys/netinet6/ip6_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/ip6_input.c ============================================================================== --- stable/10/sys/netinet6/ip6_input.c Thu Apr 24 10:27:21 2014 (r264872) +++ stable/10/sys/netinet6/ip6_input.c Thu Apr 24 11:12:53 2014 (r264873) @@ -1074,7 +1074,6 @@ ip6_hopopts_input(u_int32_t *plenp, u_in struct mbuf *m = *mp; int off = *offp, hbhlen; struct ip6_hbh *hbh; - u_int8_t *opt; /* validation of the length of the header */ #ifndef PULLDOWN_TEST @@ -1101,8 +1100,6 @@ ip6_hopopts_input(u_int32_t *plenp, u_in #endif off += hbhlen; hbhlen -= sizeof(struct ip6_hbh); - opt = (u_int8_t *)hbh + sizeof(struct ip6_hbh); - if (ip6_process_hopopts(m, (u_int8_t *)hbh + sizeof(struct ip6_hbh), hbhlen, rtalertp, plenp) < 0) return (-1); From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 04:49:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B0595C84; Fri, 25 Apr 2014 04:49: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 90F081B44; Fri, 25 Apr 2014 04:49: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 s3P4nSGG028721; Fri, 25 Apr 2014 04:49:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3P4nSfb028718; Fri, 25 Apr 2014 04:49:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404250449.s3P4nSfb028718@svn.freebsd.org> From: Xin LI Date: Fri, 25 Apr 2014 04:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264911 - stable/10/contrib/netcat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 04:49:28 -0000 Author: delphij Date: Fri Apr 25 04:49:27 2014 New Revision: 264911 URL: http://svnweb.freebsd.org/changeset/base/264911 Log: MFC r258195+r264361: nc from OpenBSD 5.5. Modified: stable/10/contrib/netcat/nc.1 stable/10/contrib/netcat/netcat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netcat/nc.1 ============================================================================== --- stable/10/contrib/netcat/nc.1 Fri Apr 25 04:01:25 2014 (r264910) +++ stable/10/contrib/netcat/nc.1 Fri Apr 25 04:49:27 2014 (r264911) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.62 2013/03/20 09:27:56 sthen Exp $ +.\" $OpenBSD: nc.1,v 1.67 2014/02/26 20:56:11 claudio Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 7, 2012 +.Dd April 11, 2014 .Dt NC 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Sh SYNOPSIS .Nm nc .Bk -words -.Op Fl 46DdEhklNnrStUuvz +.Op Fl 46DdEFhklNnrStUuvz .Op Fl e Ar IPsec_policy .Op Fl I Ar length .Op Fl i Ar interval @@ -120,6 +120,21 @@ to be used using the syntax described in .Xr ipsec_set_policy 3 . This flag can be specified up to two times, as typically one policy for each direction is needed. +.It Fl F +Pass the first connected socket using +.Xr sendmsg 2 +to stdout and exit. +This is useful in conjunction with +.Fl X +to have +.Nm +perform connection setup with a proxy but then leave the rest of the +connection to another program (e.g.\& +.Xr ssh 1 +using the +.Xr ssh_config 5 +.Cm ProxyUseFdPass +option). .It Fl h Prints out .Nm @@ -236,7 +251,6 @@ flag is given. Set the routing table .Pq Dq FIB to be used. -The default is 0. .It Fl v Have .Nm @@ -365,7 +379,7 @@ Using a second machine, connect to the l .Nm process, feeding it the file which is to be transferred: .Pp -.Dl $ nc host.example.com 1234 \*(Lt filename.in +.Dl $ nc -N host.example.com 1234 \*(Lt filename.in .Pp After the file has been transferred, the connection will close automatically. .Sh TALKING TO SERVERS @@ -490,10 +504,10 @@ if the proxy requires it: .Xr tcp 4 .Sh AUTHORS Original implementation by *Hobbit* -.Aq hobbit@avian.org . +.Aq Mt hobbit@avian.org . .br Rewritten with IPv6 support by -.An Eric Jackson Aq ericj@monkey.org . +.An Eric Jackson Aq Mt ericj@monkey.org . .Sh CAVEATS UDP port scans using the .Fl uz Modified: stable/10/contrib/netcat/netcat.c ============================================================================== --- stable/10/contrib/netcat/netcat.c Fri Apr 25 04:01:25 2014 (r264910) +++ stable/10/contrib/netcat/netcat.c Fri Apr 25 04:49:27 2014 (r264911) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.111 2013/03/20 09:27:56 sthen Exp $ */ +/* $OpenBSD: netcat.c,v 1.117 2013/10/26 21:33:29 sthen Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -74,6 +75,7 @@ /* Command Line Options */ int dflag; /* detached, no stdin */ +int Fflag; /* fdpass sock to stdout */ unsigned int iflag; /* Interval Flag */ int kflag; /* More than one connect */ int lflag; /* Bind to local port */ @@ -94,7 +96,7 @@ int Iflag; /* TCP receive buffer siz int Oflag; /* TCP send buffer size */ int Sflag; /* TCP MD5 signature option */ int Tflag = -1; /* IP Type of Service */ -u_int rtableid; +int rtableid = -1; int timeout = -1; int family = AF_UNSPEC; @@ -106,6 +108,7 @@ void build_ports(char *); void help(void); int local_listen(char *, char *, struct addrinfo); void readwrite(int); +void fdpass(int nfd) __attribute__((noreturn)); int remote_connect(const char *, const char *, struct addrinfo); int timeout_connect(int, const struct sockaddr *, socklen_t); int socks_connect(const char *, const char *, struct addrinfo, @@ -152,9 +155,12 @@ main(int argc, char *argv[]) host = NULL; uport = NULL; sv = NULL; +#if 0 + rtableid = getrtable(); +#endif while ((ch = getopt_long(argc, argv, - "46DdEe:hI:i:klNnoO:P:p:rSs:tT:UuV:vw:X:x:z", + "46DdEe:FhI:i:klNnoO:P:p:rSs:tT:UuV:vw:X:x:z", longopts, NULL)) != -1) { switch (ch) { case '4': @@ -194,6 +200,9 @@ main(int argc, char *argv[]) errx(1, "IPsec support unavailable."); #endif break; + case 'F': + Fflag = 1; + break; case 'h': help(); break; @@ -238,7 +247,7 @@ main(int argc, char *argv[]) case 'V': if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1) errx(1, "Multiple FIBS not supported"); - rtableid = (unsigned int)strtonum(optarg, 0, + rtableid = (int)strtonum(optarg, 0, numfibs - 1, &errstr); if (errstr) errx(1, "rtable %s: %s", errstr, optarg); @@ -508,7 +517,9 @@ main(int argc, char *argv[]) uflag ? "udp" : "tcp", sv ? sv->s_name : "*"); } - if (!zflag) + if (Fflag) + fdpass(s); + else if (!zflag) readwrite(s); } } @@ -568,7 +579,7 @@ unix_connect(char *path) if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) return (-1); } - (void)fcntl(s, F_SETFD, 1); + (void)fcntl(s, F_SETFD, FD_CLOEXEC); memset(&sun, 0, sizeof(struct sockaddr_un)); sun.sun_family = AF_UNIX; @@ -631,12 +642,9 @@ remote_connect(const char *host, const c add_ipsec_policy(s, ipsec_policy[1]); #endif - if (rtableid) { - if (setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid, - sizeof(rtableid)) == -1) - err(1, "setsockopt(.., SO_SETFIB, %u, ..)", - rtableid); - } + if (rtableid >= 0 && (setsockopt(s, SOL_SOCKET, SO_SETFIB, + &rtableid, sizeof(rtableid)) == -1)) + err(1, "setsockopt SO_SETFIB"); /* Bind to a local port or source address if specified. */ if (sflag || pflag) { @@ -743,13 +751,9 @@ local_listen(char *host, char *port, str res0->ai_protocol)) < 0) continue; - if (rtableid) { - ret = setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid, - sizeof(rtableid)); - if (ret == -1) - err(1, "setsockopt(.., SO_SETFIB, %u, ..)", - rtableid); - } + if (rtableid >= 0 && (setsockopt(s, IPPROTO_IP, SO_SETFIB, + &rtableid, sizeof(rtableid)) == -1)) + err(1, "setsockopt SO_SETFIB"); ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); if (ret == -1) @@ -850,6 +854,66 @@ readwrite(int nfd) } } +/* + * fdpass() + * Pass the connected file descriptor to stdout and exit. + */ +void +fdpass(int nfd) +{ + struct msghdr mh; + union { + struct cmsghdr hdr; + char buf[CMSG_SPACE(sizeof(int))]; + } cmsgbuf; + struct cmsghdr *cmsg; + struct iovec iov; + char c = '\0'; + ssize_t r; + struct pollfd pfd; + + /* Avoid obvious stupidity */ + if (isatty(STDOUT_FILENO)) + errx(1, "Cannot pass file descriptor to tty"); + + bzero(&mh, sizeof(mh)); + bzero(&cmsgbuf, sizeof(cmsgbuf)); + bzero(&iov, sizeof(iov)); + bzero(&pfd, sizeof(pfd)); + + mh.msg_control = (caddr_t)&cmsgbuf.buf; + mh.msg_controllen = sizeof(cmsgbuf.buf); + cmsg = CMSG_FIRSTHDR(&mh); + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + *(int *)CMSG_DATA(cmsg) = nfd; + + iov.iov_base = &c; + iov.iov_len = 1; + mh.msg_iov = &iov; + mh.msg_iovlen = 1; + + bzero(&pfd, sizeof(pfd)); + pfd.fd = STDOUT_FILENO; + for (;;) { + r = sendmsg(STDOUT_FILENO, &mh, 0); + if (r == -1) { + if (errno == EAGAIN || errno == EINTR) { + pfd.events = POLLOUT; + if (poll(&pfd, 1, -1) == -1) + err(1, "poll"); + continue; + } + err(1, "sendmsg"); + } else if (r == -1) + errx(1, "sendmsg: unexpected return value %zd", r); + else + break; + } + exit(0); +} + /* Deal with RFC 854 WILL/WONT DO/DONT negotiation. */ void atelnet(int nfd, unsigned char *buf, unsigned int size) @@ -1088,6 +1152,7 @@ help(void) \t-e policy Use specified IPsec policy\n"); #endif fprintf(stderr, "\ + \t-F Pass socket fd\n\ \t-h This help text\n\ \t-I length TCP receive buffer length\n\ \t-i secs\t Delay interval for lines sent, ports scanned\n\ @@ -1146,9 +1211,9 @@ usage(int ret) { fprintf(stderr, #ifdef IPSEC - "usage: nc [-46DdEhklNnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdEFhklNnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" #else - "usage: nc [-46DdhklNnrStUuvz] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdFhklNnrStUuvz] [-I length] [-i interval] [-O length]\n" #endif "\t [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n" "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 09:53:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3050280A; Fri, 25 Apr 2014 09:53: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 1C9AB1AD9; Fri, 25 Apr 2014 09:53: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 s3P9rFRn056469; Fri, 25 Apr 2014 09:53:15 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3P9rFUx056467; Fri, 25 Apr 2014 09:53:15 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404250953.s3P9rFUx056467@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 25 Apr 2014 09:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264913 - in stable/10/sys/dev/usb: . quirk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 09:53:16 -0000 Author: hselasky Date: Fri Apr 25 09:53:15 2014 New Revision: 264913 URL: http://svnweb.freebsd.org/changeset/base/264913 Log: MFC r264653: Add new USB quirk. Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/10/sys/dev/usb/quirk/usb_quirk.c Fri Apr 25 08:01:22 2014 (r264912) +++ stable/10/sys/dev/usb/quirk/usb_quirk.c Fri Apr 25 09:53:15 2014 (r264913) @@ -236,6 +236,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(JMICRON, JM20337, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(KINGSTON, HYPERX3_0, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(KYOCERA, FINECAM_L3, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(KYOCERA, FINECAM_S3X, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Fri Apr 25 08:01:22 2014 (r264912) +++ stable/10/sys/dev/usb/usbdevs Fri Apr 25 09:53:15 2014 (r264913) @@ -2501,6 +2501,7 @@ product KEYSPAN UIA11 0x0202 UIA-11 rem /* Kingston products */ product KINGSTON XX1 0x0008 Ethernet product KINGSTON KNU101TX 0x000a KNU101TX USB Ethernet +product KINGSTON HYPERX3_0 0x162b DT HyperX 3.0 /* Kawasaki products */ product KLSI DUH3E10BT 0x0008 USB Ethernet From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 21:20:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8E0B582C; Fri, 25 Apr 2014 21:20: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 61D291860; Fri, 25 Apr 2014 21:20: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 s3PLKNNP045468; Fri, 25 Apr 2014 21:20:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PLKNIf045466; Fri, 25 Apr 2014 21:20:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404252120.s3PLKNIf045466@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Apr 2014 21:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264936 - stable/10/usr.sbin/makefs/cd9660 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:20:23 -0000 Author: marius Date: Fri Apr 25 21:20:22 2014 New Revision: 264936 URL: http://svnweb.freebsd.org/changeset/base/264936 Log: MFC: r260041 Record the IEEE P1282 Rock Ridge version 1.12 POSIX File Serial Number, i. e. the POSIX:5.6.1 st_ino field, which can be used to detect hard links in the file system. This is also the default in mkisofs(8) and according to its man page, no system only being able to cope with Rock Ridge version 1.10 is known to exist. PR: 185138 Submitted by: Kurt Lidl Modified: stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c Fri Apr 25 21:11:00 2014 (r264935) +++ stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c Fri Apr 25 21:20:22 2014 (r264936) @@ -634,7 +634,7 @@ cd9660_createSL(cd9660node *node) int cd9660node_rrip_px(struct ISO_SUSP_ATTRIBUTES *v, fsnode *pxinfo) { - v->attr.rr_entry.PX.h.length[0] = 36; + v->attr.rr_entry.PX.h.length[0] = 44; v->attr.rr_entry.PX.h.version[0] = 1; cd9660_bothendian_dword(pxinfo->inode->st.st_mode, v->attr.rr_entry.PX.mode); @@ -644,8 +644,9 @@ cd9660node_rrip_px(struct ISO_SUSP_ATTRI v->attr.rr_entry.PX.uid); cd9660_bothendian_dword(pxinfo->inode->st.st_gid, v->attr.rr_entry.PX.gid); + cd9660_bothendian_dword(pxinfo->inode->st.st_ino, + v->attr.rr_entry.PX.serial); - /* Ignoring the serial number for now */ return 1; } Modified: stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.h ============================================================================== --- stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.h Fri Apr 25 21:11:00 2014 (r264935) +++ stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.h Fri Apr 25 21:20:22 2014 (r264936) @@ -103,7 +103,7 @@ typedef struct { u_char links [ISODCL(13,20)]; u_char uid [ISODCL(21,28)]; u_char gid [ISODCL(29,36)]; - u_char serial [ISODCL(37,44)];/* Not used */ + u_char serial [ISODCL(37,44)]; } ISO_RRIP_PX; typedef struct { From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 21:24:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6D1DCBF6; Fri, 25 Apr 2014 21:24: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 599B71921; Fri, 25 Apr 2014 21:24: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 s3PLOYNJ048793; Fri, 25 Apr 2014 21:24:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PLOYK1048792; Fri, 25 Apr 2014 21:24:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404252124.s3PLOYK1048792@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Apr 2014 21:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264938 - stable/10/sys/dev/aac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:24:34 -0000 Author: marius Date: Fri Apr 25 21:24:33 2014 New Revision: 264938 URL: http://svnweb.freebsd.org/changeset/base/264938 Log: MFC: r260044 Free the MSI again on detach if allocated. Arguably, this code would be better off living in aac_pci.c, but it doesn't seem worth creating a aac_pci_detach() and it's also not the first PCI-specific bit in aac.c Modified: stable/10/sys/dev/aac/aac.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/aac/aac.c ============================================================================== --- stable/10/sys/dev/aac/aac.c Fri Apr 25 21:20:28 2014 (r264937) +++ stable/10/sys/dev/aac/aac.c Fri Apr 25 21:24:33 2014 (r264938) @@ -631,9 +631,11 @@ aac_free(struct aac_softc *sc) /* disconnect the interrupt handler */ if (sc->aac_intr) bus_teardown_intr(sc->aac_dev, sc->aac_irq, sc->aac_intr); - if (sc->aac_irq != NULL) + if (sc->aac_irq != NULL) { bus_release_resource(sc->aac_dev, SYS_RES_IRQ, rman_get_rid(sc->aac_irq), sc->aac_irq); + pci_release_msi(sc->aac_dev); + } /* destroy data-transfer DMA tag */ if (sc->aac_buffer_dmat) From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 21:28:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 160D8ED4; Fri, 25 Apr 2014 21:28: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 EAC6C1950; Fri, 25 Apr 2014 21:28: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 s3PLSdx1049323; Fri, 25 Apr 2014 21:28:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PLSdUU049322; Fri, 25 Apr 2014 21:28:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404252128.s3PLSdUU049322@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Apr 2014 21:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264940 - stable/10/sys/dev/bge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:28:40 -0000 Author: marius Date: Fri Apr 25 21:28:39 2014 New Revision: 264940 URL: http://svnweb.freebsd.org/changeset/base/264940 Log: MFC: r260045 - Simplify MSI allocation and release. For a single one, we don't need to fiddle with the MSI count and pci_release_msi(9) is smart enough to just do nothing in case of INTx. - Don't allocate MSI as RF_SHAREABLE. Modified: stable/10/sys/dev/bge/if_bge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bge/if_bge.c ============================================================================== --- stable/10/sys/dev/bge/if_bge.c Fri Apr 25 21:24:53 2014 (r264939) +++ stable/10/sys/dev/bge/if_bge.c Fri Apr 25 21:28:39 2014 (r264940) @@ -3301,7 +3301,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg, pcistate; u_char eaddr[ETHER_ADDR_LEN]; - int capmask, error, msicount, reg, rid, trys; + int capmask, error, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -3310,11 +3310,11 @@ bge_attach(device_t dev) TASK_INIT(&sc->bge_intr_task, 0, bge_intr_task, sc); callout_init_mtx(&sc->bge_stat_ch, &sc->bge_mtx, 0); - /* - * Map control/status registers. - */ pci_enable_busmaster(dev); + /* + * Allocate control/status registers. + */ rid = PCIR_BAR(0); sc->bge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -3624,13 +3624,8 @@ bge_attach(device_t dev) rid = 0; if (pci_find_cap(sc->bge_dev, PCIY_MSI, ®) == 0) { sc->bge_msicap = reg; - if (bge_can_use_msi(sc)) { - msicount = pci_msi_count(dev); - if (msicount > 1) - msicount = 1; - } else - msicount = 0; - if (msicount == 1 && pci_alloc_msi(dev, &msicount) == 0) { + reg = 1; + if (bge_can_use_msi(sc) && pci_alloc_msi(dev, ®) == 0) { rid = 1; sc->bge_flags |= BGE_FLAG_MSI; } @@ -3647,7 +3642,7 @@ bge_attach(device_t dev) #endif sc->bge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); + RF_ACTIVE | (rid != 0 ? 0 : RF_SHAREABLE)); if (sc->bge_irq == NULL) { device_printf(sc->bge_dev, "couldn't map interrupt\n"); @@ -3990,20 +3985,19 @@ bge_release_resources(struct bge_softc * if (sc->bge_intrhand != NULL) bus_teardown_intr(dev, sc->bge_irq, sc->bge_intrhand); - if (sc->bge_irq != NULL) + if (sc->bge_irq != NULL) { bus_release_resource(dev, SYS_RES_IRQ, - sc->bge_flags & BGE_FLAG_MSI ? 1 : 0, sc->bge_irq); - - if (sc->bge_flags & BGE_FLAG_MSI) + rman_get_rid(sc->bge_irq), sc->bge_irq); pci_release_msi(dev); + } if (sc->bge_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(0), sc->bge_res); + rman_get_rid(sc->bge_res), sc->bge_res); if (sc->bge_res2 != NULL) bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(2), sc->bge_res2); + rman_get_rid(sc->bge_res2), sc->bge_res2); if (sc->bge_ifp != NULL) if_free(sc->bge_ifp); From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 21:32:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BD8361E9; Fri, 25 Apr 2014 21:32: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 A8AB719DC; Fri, 25 Apr 2014 21:32: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 s3PLWauD052862; Fri, 25 Apr 2014 21:32:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PLWZjI052852; Fri, 25 Apr 2014 21:32:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404252132.s3PLWZjI052852@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Apr 2014 21:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264942 - stable/10/sys/dev/ed X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:32:36 -0000 Author: marius Date: Fri Apr 25 21:32:34 2014 New Revision: 264942 URL: http://svnweb.freebsd.org/changeset/base/264942 Log: MFC: r260050, r261528 - Switch to using the common MII bitbang'ing code instead of duplicating it. - Based on lessons learnt with dc(4) (see r185750), add bus space barriers to the MII bitbang read and write functions as well as to instances of page switching. - Add missing locking to ed_ifmedia_{upd,sts}(). - Canonicalize some messages. - Based on actual functionality, ED_TC5299J_MII_DIROUT should be rather named ED_TC5299J_MII_DIRIN. - Remove unused headers. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Modified: stable/10/sys/dev/ed/if_ed.c stable/10/sys/dev/ed/if_ed_3c503.c stable/10/sys/dev/ed/if_ed_hpp.c stable/10/sys/dev/ed/if_ed_pccard.c stable/10/sys/dev/ed/if_ed_rtl80x9.c stable/10/sys/dev/ed/if_edreg.h stable/10/sys/dev/ed/if_edvar.h stable/10/sys/dev/ed/tc5299jreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ed/if_ed.c ============================================================================== --- stable/10/sys/dev/ed/if_ed.c Fri Apr 25 21:28:41 2014 (r264941) +++ stable/10/sys/dev/ed/if_ed.c Fri Apr 25 21:32:34 2014 (r264942) @@ -419,7 +419,11 @@ ed_stop_hw(struct ed_softc *sc) /* * Stop everything on the interface, and select page 0 registers. */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * Wait for interface to enter stopped state, but limit # of checks to @@ -527,7 +531,11 @@ ed_init_locked(struct ed_softc *sc) /* * Set interface for page 0, Remote DMA complete, Stopped */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (sc->isa16bit) /* @@ -590,7 +598,11 @@ ed_init_locked(struct ed_softc *sc) /* * Program Command Register for page 1 */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * Copy out our station address @@ -644,7 +656,11 @@ ed_xmit(struct ed_softc *sc) /* * Set NIC for page 0 register access */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * Set TX buffer start page @@ -661,7 +677,11 @@ ed_xmit(struct ed_softc *sc) /* * Set page 0, Remote DMA complete, Transmit Packet, and *Start* */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_TXP | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); sc->xmit_busy = 1; /* @@ -800,7 +820,11 @@ ed_rint(struct ed_softc *sc) /* * Set NIC to page 1 registers to get 'current' pointer */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * 'sc->next_packet' is the logical beginning of the ring-buffer - @@ -904,14 +928,22 @@ ed_rint(struct ed_softc *sc) /* * Set NIC to page 0 registers to update boundry register */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_BNRY, boundry); /* * Set NIC to page 1 registers before looping to top (prepare * to get 'CURR' current pointer) */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } } @@ -934,7 +966,11 @@ edintr(void *arg) /* * Set NIC to page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * loop until there are no more new interrupts. When the card goes @@ -1152,7 +1188,11 @@ edintr(void *arg) * set in the transmit routine, is *okay* - it is 'edge' * triggered from low to high) */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * If the Network Talley Counters overflow, read them to reset @@ -1354,7 +1394,11 @@ ed_pio_readmem(struct ed_softc *sc, bus_ { /* Regular Novell cards */ /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* round up to a word */ if (amount & 1) @@ -1387,7 +1431,11 @@ ed_pio_writemem(struct ed_softc *sc, uin int maxwait = 200; /* about 240us */ /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* reset remote DMA complete flag */ ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RDC); @@ -1444,7 +1492,11 @@ ed_pio_write_mbufs(struct ed_softc *sc, dma_len++; /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* reset remote DMA complete flag */ ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RDC); @@ -1555,7 +1607,11 @@ ed_setrcr(struct ed_softc *sc) reg1 = 0x00; /* set page 1 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (ifp->if_flags & IFF_PROMISC) { @@ -1570,7 +1626,11 @@ ed_setrcr(struct ed_softc *sc) * runts and packets with CRC & alignment errors. */ /* Set page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_RCR, ED_RCR_PRO | ED_RCR_AM | ED_RCR_AB | ED_RCR_AR | ED_RCR_SEP | reg1); @@ -1592,7 +1652,11 @@ ed_setrcr(struct ed_softc *sc) ed_nic_outb(sc, ED_P1_MAR(i), ((u_char *) mcaf)[i]); /* Set page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_RCR, ED_RCR_AM | ED_RCR_AB | reg1); } else { @@ -1605,6 +1669,8 @@ ed_setrcr(struct ed_softc *sc) ed_nic_outb(sc, ED_P1_MAR(i), 0x00); /* Set page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); ed_nic_outb(sc, ED_P0_RCR, ED_RCR_AB | reg1); Modified: stable/10/sys/dev/ed/if_ed_3c503.c ============================================================================== --- stable/10/sys/dev/ed/if_ed_3c503.c Fri Apr 25 21:28:41 2014 (r264941) +++ stable/10/sys/dev/ed/if_ed_3c503.c Fri Apr 25 21:32:34 2014 (r264942) @@ -216,7 +216,11 @@ ed_probe_3Com(device_t dev, int port_rid /* * select page 0 registers */ - ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + ed_nic_outb(sc, ED_P0_CR, ED_CR_PAGE_0 | ED_CR_RD2 | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * Attempt to clear WTS bit. If it doesn't clear, then this is a 16bit @@ -227,7 +231,11 @@ ed_probe_3Com(device_t dev, int port_rid /* * select page 2 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_PAGE_2 | ED_CR_RD2 | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * The 3c503 forces the WTS bit to a one if this is a 16bit board Modified: stable/10/sys/dev/ed/if_ed_hpp.c ============================================================================== --- stable/10/sys/dev/ed/if_ed_hpp.c Fri Apr 25 21:28:41 2014 (r264941) +++ stable/10/sys/dev/ed/if_ed_hpp.c Fri Apr 25 21:32:34 2014 (r264942) @@ -564,7 +564,11 @@ ed_hpp_write_mbufs(struct ed_softc *sc, int use_32bit_accesses = !(sc->hpp_id & ED_HPP_ID_16_BIT_ACCESS); /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* reset remote DMA complete flag */ ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RDC); Modified: stable/10/sys/dev/ed/if_ed_pccard.c ============================================================================== --- stable/10/sys/dev/ed/if_ed_pccard.c Fri Apr 25 21:28:41 2014 (r264941) +++ stable/10/sys/dev/ed/if_ed_pccard.c Fri Apr 25 21:32:34 2014 (r264942) @@ -75,9 +75,6 @@ #include #include #include -#include -#include - #include #include #include @@ -246,6 +243,54 @@ static const struct ed_product { }; /* + * MII bit-bang glue + */ +static uint32_t ed_pccard_dl100xx_mii_bitbang_read(device_t dev); +static void ed_pccard_dl100xx_mii_bitbang_write(device_t dev, uint32_t val); + +static const struct mii_bitbang_ops ed_pccard_dl100xx_mii_bitbang_ops = { + ed_pccard_dl100xx_mii_bitbang_read, + ed_pccard_dl100xx_mii_bitbang_write, + { + ED_DL100XX_MII_DATAOUT, /* MII_BIT_MDO */ + ED_DL100XX_MII_DATAIN, /* MII_BIT_MDI */ + ED_DL100XX_MII_CLK, /* MII_BIT_MDC */ + ED_DL100XX_MII_DIROUT, /* MII_BIT_DIR_HOST_PHY */ + 0 /* MII_BIT_DIR_PHY_HOST */ + } +}; + +static uint32_t ed_pccard_ax88x90_mii_bitbang_read(device_t dev); +static void ed_pccard_ax88x90_mii_bitbang_write(device_t dev, uint32_t val); + +static const struct mii_bitbang_ops ed_pccard_ax88x90_mii_bitbang_ops = { + ed_pccard_ax88x90_mii_bitbang_read, + ed_pccard_ax88x90_mii_bitbang_write, + { + ED_AX88X90_MII_DATAOUT, /* MII_BIT_MDO */ + ED_AX88X90_MII_DATAIN, /* MII_BIT_MDI */ + ED_AX88X90_MII_CLK, /* MII_BIT_MDC */ + 0, /* MII_BIT_DIR_HOST_PHY */ + ED_AX88X90_MII_DIRIN /* MII_BIT_DIR_PHY_HOST */ + } +}; + +static uint32_t ed_pccard_tc5299j_mii_bitbang_read(device_t dev); +static void ed_pccard_tc5299j_mii_bitbang_write(device_t dev, uint32_t val); + +static const struct mii_bitbang_ops ed_pccard_tc5299j_mii_bitbang_ops = { + ed_pccard_tc5299j_mii_bitbang_read, + ed_pccard_tc5299j_mii_bitbang_write, + { + ED_TC5299J_MII_DATAOUT, /* MII_BIT_MDO */ + ED_TC5299J_MII_DATAIN, /* MII_BIT_MDI */ + ED_TC5299J_MII_CLK, /* MII_BIT_MDC */ + 0, /* MII_BIT_DIR_HOST_PHY */ + ED_AX88X90_MII_DIRIN /* MII_BIT_DIR_PHY_HOST */ + } +}; + +/* * PC Card (PCMCIA) specific code. */ static int ed_pccard_probe(device_t); @@ -254,23 +299,14 @@ static void ed_pccard_tick(struct ed_sof static int ed_pccard_dl100xx(device_t dev, const struct ed_product *); static void ed_pccard_dl100xx_mii_reset(struct ed_softc *sc); -static u_int ed_pccard_dl100xx_mii_readbits(struct ed_softc *sc, int nbits); -static void ed_pccard_dl100xx_mii_writebits(struct ed_softc *sc, u_int val, - int nbits); static int ed_pccard_ax88x90(device_t dev, const struct ed_product *); -static u_int ed_pccard_ax88x90_mii_readbits(struct ed_softc *sc, int nbits); -static void ed_pccard_ax88x90_mii_writebits(struct ed_softc *sc, u_int val, - int nbits); static int ed_miibus_readreg(device_t dev, int phy, int reg); static int ed_ifmedia_upd(struct ifnet *); static void ed_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int ed_pccard_tc5299j(device_t dev, const struct ed_product *); -static u_int ed_pccard_tc5299j_mii_readbits(struct ed_softc *sc, int nbits); -static void ed_pccard_tc5299j_mii_writebits(struct ed_softc *sc, u_int val, - int nbits); static void ed_pccard_print_entry(const struct ed_product *pp) @@ -501,7 +537,7 @@ ed_pccard_attach(device_t dev) error = ed_pccard_tc5299j(dev, pp); if (error != 0) { error = ed_probe_Novell_generic(dev, flags); - printf("Novell probe generic %d\n", error); + printf("Novell generic probe failed: %d\n", error); } if (error != 0 && (pp->flags & NE2000DVF_TOSHIBA)) { flags |= ED_FLAGS_TOSH_ETHER; @@ -626,7 +662,7 @@ ed_pccard_dl100xx(device_t dev, const st if (!(pp->flags & NE2000DVF_DL100XX)) return (ENXIO); if (bootverbose) - device_printf(dev, "Trying DL100xx probing\n"); + device_printf(dev, "Trying DL100xx\n"); error = ed_probe_Novell_generic(dev, device_get_flags(dev)); if (bootverbose && error) device_printf(dev, "Novell generic probe failed: %d\n", error); @@ -677,16 +713,11 @@ ed_pccard_dl100xx(device_t dev, const st sc->chip_type = (id & 0x90) == 0x90 ? ED_CHIP_TYPE_DL10022 : ED_CHIP_TYPE_DL10019; sc->type_str = ((id & 0x90) == 0x90) ? "DL10022" : "DL10019"; - sc->mii_readbits = ed_pccard_dl100xx_mii_readbits; - sc->mii_writebits = ed_pccard_dl100xx_mii_writebits; + sc->mii_bitbang_ops = &ed_pccard_dl100xx_mii_bitbang_ops; return (0); } /* MII bit-twiddling routines for cards using Dlink chipset */ -#define DL100XX_MIISET(sc, x) ed_asic_outb(sc, ED_DL100XX_MIIBUS, \ - ed_asic_inb(sc, ED_DL100XX_MIIBUS) | (x)) -#define DL100XX_MIICLR(sc, x) ed_asic_outb(sc, ED_DL100XX_MIIBUS, \ - ed_asic_inb(sc, ED_DL100XX_MIIBUS) & ~(x)) static void ed_pccard_dl100xx_mii_reset(struct ed_softc *sc) @@ -708,36 +739,29 @@ ed_pccard_dl100xx_mii_reset(struct ed_so } static void -ed_pccard_dl100xx_mii_writebits(struct ed_softc *sc, u_int val, int nbits) +ed_pccard_dl100xx_mii_bitbang_write(device_t dev, uint32_t val) { - int i; + struct ed_softc *sc; - DL100XX_MIISET(sc, ED_DL100XX_MII_DIROUT); - for (i = nbits - 1; i >= 0; i--) { - if ((val >> i) & 1) - DL100XX_MIISET(sc, ED_DL100XX_MII_DATAOUT); - else - DL100XX_MIICLR(sc, ED_DL100XX_MII_DATAOUT); - DL100XX_MIISET(sc, ED_DL100XX_MII_CLK); - DL100XX_MIICLR(sc, ED_DL100XX_MII_CLK); - } + sc = device_get_softc(dev); + + ed_asic_outb(sc, ED_DL100XX_MIIBUS, val); + ed_asic_barrier(sc, ED_DL100XX_MIIBUS, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } -static u_int -ed_pccard_dl100xx_mii_readbits(struct ed_softc *sc, int nbits) +static uint32_t +ed_pccard_dl100xx_mii_bitbang_read(device_t dev) { - int i; - u_int val = 0; + struct ed_softc *sc; + uint32_t val; - DL100XX_MIICLR(sc, ED_DL100XX_MII_DIROUT); - for (i = nbits - 1; i >= 0; i--) { - DL100XX_MIISET(sc, ED_DL100XX_MII_CLK); - val <<= 1; - if (ed_asic_inb(sc, ED_DL100XX_MIIBUS) & ED_DL100XX_MII_DATAIN) - val++; - DL100XX_MIICLR(sc, ED_DL100XX_MII_CLK); - } - return val; + sc = device_get_softc(dev); + + val = ed_asic_inb(sc, ED_DL100XX_MIIBUS); + ed_asic_barrier(sc, ED_DL100XX_MIIBUS, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return (val); } static void @@ -746,7 +770,11 @@ ed_pccard_ax88x90_reset(struct ed_softc int i; /* Reset Card */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STP | ED_CR_PAGE_0); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_asic_outb(sc, ED_NOVELL_RESET, ed_asic_inb(sc, ED_NOVELL_RESET)); /* Wait for the RST bit to assert, but cap it at 10ms */ @@ -879,7 +907,6 @@ ed_pccard_ax88x90_check_mii(device_t dev if (i == 32) return (ENXIO); return (0); - } /* @@ -909,18 +936,17 @@ ed_pccard_ax88x90(device_t dev, const st pccard_ccr_write_1(dev, PCCARD_CCR_IOBASE0, iobase & 0xff); pccard_ccr_write_1(dev, PCCARD_CCR_IOBASE1, (iobase >> 8) & 0xff); - sc->mii_readbits = ed_pccard_ax88x90_mii_readbits; - sc->mii_writebits = ed_pccard_ax88x90_mii_writebits; error = ed_probe_ax88x90_generic(dev, device_get_flags(dev)); if (error) { if (bootverbose) device_printf(dev, "probe ax88x90 failed %d\n", error); - goto fail; + return (error); } + sc->mii_bitbang_ops = &ed_pccard_ax88x90_mii_bitbang_ops; error = ed_pccard_ax88x90_check_mii(dev, sc); if (error) - goto fail; + return (error); sc->vendor = ED_VENDOR_NOVELL; sc->type = ED_TYPE_NE2000; if (sc->chip_type == ED_CHIP_TYPE_AX88190) @@ -928,40 +954,32 @@ ed_pccard_ax88x90(device_t dev, const st else sc->type_str = "AX88790"; return (0); -fail:; - sc->mii_readbits = 0; - sc->mii_writebits = 0; - return (error); } static void -ed_pccard_ax88x90_mii_writebits(struct ed_softc *sc, u_int val, int nbits) +ed_pccard_ax88x90_mii_bitbang_write(device_t dev, uint32_t val) { - int i, data; + struct ed_softc *sc; - for (i = nbits - 1; i >= 0; i--) { - data = (val >> i) & 1 ? ED_AX88X90_MII_DATAOUT : 0; - ed_asic_outb(sc, ED_AX88X90_MIIBUS, data); - ed_asic_outb(sc, ED_AX88X90_MIIBUS, data | ED_AX88X90_MII_CLK); - } + sc = device_get_softc(dev); + + ed_asic_outb(sc, ED_AX88X90_MIIBUS, val); + ed_asic_barrier(sc, ED_AX88X90_MIIBUS, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } -static u_int -ed_pccard_ax88x90_mii_readbits(struct ed_softc *sc, int nbits) +static uint32_t +ed_pccard_ax88x90_mii_bitbang_read(device_t dev) { - int i; - u_int val = 0; - uint8_t mdio; + struct ed_softc *sc; + uint32_t val; - mdio = ED_AX88X90_MII_DIRIN; - for (i = nbits - 1; i >= 0; i--) { - ed_asic_outb(sc, ED_AX88X90_MIIBUS, mdio); - val <<= 1; - if (ed_asic_inb(sc, ED_AX88X90_MIIBUS) & ED_AX88X90_MII_DATAIN) - val++; - ed_asic_outb(sc, ED_AX88X90_MIIBUS, mdio | ED_AX88X90_MII_CLK); - } - return val; + sc = device_get_softc(dev); + + val = ed_asic_inb(sc, ED_AX88X90_MIIBUS); + ed_asic_barrier(sc, ED_AX88X90_MIIBUS, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return (val); } /* @@ -982,7 +1000,7 @@ ed_pccard_tc5299j(device_t dev, const st error = ed_probe_Novell_generic(dev, device_get_flags(dev)); if (bootverbose) - device_printf(dev, "probe novel returns %d\n", error); + device_printf(dev, "Novell generic probe failed: %d\n", error); if (error != 0) return (error); @@ -991,24 +1009,17 @@ ed_pccard_tc5299j(device_t dev, const st * devices have MII and a PHY, so we use this to weed out chips that * would otherwise make it through the tests we have after this point. */ - sc->mii_readbits = ed_pccard_tc5299j_mii_readbits; - sc->mii_writebits = ed_pccard_tc5299j_mii_writebits; + sc->mii_bitbang_ops = &ed_pccard_tc5299j_mii_bitbang_ops; for (i = 0; i < 32; i++) { id = ed_miibus_readreg(dev, i, MII_PHYIDR1); if (id != 0 && id != 0xffff) break; } - if (i == 32) { - sc->mii_readbits = 0; - sc->mii_writebits = 0; + if (i == 32) return (ENXIO); - } ts = "TC5299J"; - if (ed_pccard_rom_mac(dev, sc->enaddr) == 0) { - sc->mii_readbits = 0; - sc->mii_writebits = 0; + if (ed_pccard_rom_mac(dev, sc->enaddr) == 0) return (ENXIO); - } sc->vendor = ED_VENDOR_NOVELL; sc->type = ED_TYPE_NE2000; sc->chip_type = ED_CHIP_TYPE_TC5299J; @@ -1017,50 +1028,31 @@ ed_pccard_tc5299j(device_t dev, const st } static void -ed_pccard_tc5299j_mii_writebits(struct ed_softc *sc, u_int val, int nbits) +ed_pccard_tc5299j_mii_bitbang_write(device_t dev, uint32_t val) { - int i; - uint8_t cr, data; + struct ed_softc *sc; - /* Select page 3 */ - cr = ed_nic_inb(sc, ED_P0_CR); - ed_nic_outb(sc, ED_P0_CR, cr | ED_CR_PAGE_3); - - for (i = nbits - 1; i >= 0; i--) { - data = (val >> i) & 1 ? ED_TC5299J_MII_DATAOUT : 0; - ed_nic_outb(sc, ED_TC5299J_MIIBUS, data); - ed_nic_outb(sc, ED_TC5299J_MIIBUS, data | ED_TC5299J_MII_CLK); - } - ed_nic_outb(sc, ED_TC5299J_MIIBUS, 0); - - /* Restore prior page */ - ed_nic_outb(sc, ED_P0_CR, cr); + sc = device_get_softc(dev); + + /* We are already on page 3. */ + ed_nic_outb(sc, ED_TC5299J_MIIBUS, val); + ed_nic_barrier(sc, ED_TC5299J_MIIBUS, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } -static u_int -ed_pccard_tc5299j_mii_readbits(struct ed_softc *sc, int nbits) +static uint32_t +ed_pccard_tc5299j_mii_bitbang_read(device_t dev) { - int i; - u_int val = 0; - uint8_t cr; + struct ed_softc *sc; + uint32_t val; + + sc = device_get_softc(dev); - /* Select page 3 */ - cr = ed_nic_inb(sc, ED_P0_CR); - ed_nic_outb(sc, ED_P0_CR, cr | ED_CR_PAGE_3); - - ed_asic_outb(sc, ED_TC5299J_MIIBUS, ED_TC5299J_MII_DIROUT); - for (i = nbits - 1; i >= 0; i--) { - ed_nic_outb(sc, ED_TC5299J_MIIBUS, - ED_TC5299J_MII_CLK | ED_TC5299J_MII_DIROUT); - val <<= 1; - if (ed_nic_inb(sc, ED_TC5299J_MIIBUS) & ED_TC5299J_MII_DATAIN) - val++; - ed_nic_outb(sc, ED_TC5299J_MIIBUS, ED_TC5299J_MII_DIROUT); - } - - /* Restore prior page */ - ed_nic_outb(sc, ED_P0_CR, cr); - return val; + /* We are already on page 3. */ + val = ed_asic_inb(sc, ED_TC5299J_MIIBUS); + ed_nic_barrier(sc, ED_TC5299J_MIIBUS, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return (val); } /* @@ -1070,7 +1062,8 @@ static int ed_miibus_readreg(device_t dev, int phy, int reg) { struct ed_softc *sc; - int failed, val; + int val; + uint8_t cr = 0; sc = device_get_softc(dev); /* @@ -1084,10 +1077,6 @@ ed_miibus_readreg(device_t dev, int phy, * Also, PHYs above 16 appear to be phantoms on some cards, but not * others. Registers read for this are often the same as prior values * read. Filter all register requests to 17-31. - * - * I can't explain it, since I don't have the DL100xx data sheets, but - * the DL100xx chips do 13-bits before the 'ACK' but, but the AX88x90 - * chips have 14. The linux pcnet and axnet drivers confirm this. */ if (sc->chip_type == ED_CHIP_TYPE_AX88790) { if (phy > 0x10) @@ -1097,29 +1086,33 @@ ed_miibus_readreg(device_t dev, int phy, ED_AX88X90_GPIO_INT_PHY); else ed_asic_outb(sc, ED_AX88X90_GPIO, 0); + ed_asic_barrier(sc, ED_AX88X90_GPIO, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + } else if (sc->chip_type == ED_CHIP_TYPE_TC5299J) { + /* Select page 3. */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + cr = ed_nic_inb(sc, ED_P0_CR); + ed_nic_outb(sc, ED_P0_CR, cr | ED_CR_PAGE_3); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + } + val = mii_bitbang_readreg(dev, sc->mii_bitbang_ops, phy, reg); + if (sc->chip_type == ED_CHIP_TYPE_TC5299J) { + /* Restore prior page. */ + ed_nic_outb(sc, ED_P0_CR, cr); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } - - (*sc->mii_writebits)(sc, 0xffffffff, 32); - (*sc->mii_writebits)(sc, ED_MII_STARTDELIM, ED_MII_STARTDELIM_BITS); - (*sc->mii_writebits)(sc, ED_MII_READOP, ED_MII_OP_BITS); - (*sc->mii_writebits)(sc, phy, ED_MII_PHY_BITS); - (*sc->mii_writebits)(sc, reg, ED_MII_REG_BITS); - if (sc->chip_type == ED_CHIP_TYPE_AX88790 || - sc->chip_type == ED_CHIP_TYPE_AX88190) - (*sc->mii_readbits)(sc, ED_MII_ACK_BITS); - failed = (*sc->mii_readbits)(sc, ED_MII_ACK_BITS); - val = (*sc->mii_readbits)(sc, ED_MII_DATA_BITS); - (*sc->mii_writebits)(sc, ED_MII_IDLE, ED_MII_IDLE_BITS); -/* printf("Reading phy %d reg %#x returning %#x (valid %d)\n", phy, reg, val, !failed); */ - return (failed ? 0 : val); + return (val); } static int ed_miibus_writereg(device_t dev, int phy, int reg, int data) { struct ed_softc *sc; + uint8_t cr = 0; -/* printf("Writing phy %d reg %#x data %#x\n", phy, reg, data); */ sc = device_get_softc(dev); /* See ed_miibus_readreg for details */ if (sc->chip_type == ED_CHIP_TYPE_AX88790) { @@ -1130,15 +1123,24 @@ ed_miibus_writereg(device_t dev, int phy ED_AX88X90_GPIO_INT_PHY); else ed_asic_outb(sc, ED_AX88X90_GPIO, 0); + ed_asic_barrier(sc, ED_AX88X90_GPIO, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + } else if (sc->chip_type == ED_CHIP_TYPE_TC5299J) { + /* Select page 3. */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + cr = ed_nic_inb(sc, ED_P0_CR); + ed_nic_outb(sc, ED_P0_CR, cr | ED_CR_PAGE_3); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + } + mii_bitbang_writereg(dev, sc->mii_bitbang_ops, phy, reg, data); + if (sc->chip_type == ED_CHIP_TYPE_TC5299J) { + /* Restore prior page. */ + ed_nic_outb(sc, ED_P0_CR, cr); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } - (*sc->mii_writebits)(sc, 0xffffffff, 32); - (*sc->mii_writebits)(sc, ED_MII_STARTDELIM, ED_MII_STARTDELIM_BITS); - (*sc->mii_writebits)(sc, ED_MII_WRITEOP, ED_MII_OP_BITS); - (*sc->mii_writebits)(sc, phy, ED_MII_PHY_BITS); - (*sc->mii_writebits)(sc, reg, ED_MII_REG_BITS); - (*sc->mii_writebits)(sc, ED_MII_TURNAROUND, ED_MII_TURNAROUND_BITS); - (*sc->mii_writebits)(sc, data, ED_MII_DATA_BITS); - (*sc->mii_writebits)(sc, ED_MII_IDLE, ED_MII_IDLE_BITS); return (0); } @@ -1149,9 +1151,12 @@ ed_ifmedia_upd(struct ifnet *ifp) int error; sc = ifp->if_softc; - if (sc->miibus == NULL) - return (ENXIO); ED_LOCK(sc); + if (sc->miibus == NULL) { + ED_UNLOCK(sc); + return (ENXIO); + } + error = ed_pccard_kick_phy(sc); ED_UNLOCK(sc); return (error); @@ -1164,13 +1169,17 @@ ed_ifmedia_sts(struct ifnet *ifp, struct struct mii_data *mii; sc = ifp->if_softc; - if (sc->miibus == NULL) + ED_LOCK(sc); + if (sc->miibus == NULL) { return; + ED_UNLOCK(sc); + } mii = device_get_softc(sc->miibus); mii_pollstat(mii); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; + ED_UNLOCK(sc); } static void @@ -1225,7 +1234,7 @@ static device_method_t ed_pccard_methods DEVMETHOD(miibus_readreg, ed_miibus_readreg), DEVMETHOD(miibus_writereg, ed_miibus_writereg), - { 0, 0 } + DEVMETHOD_END }; static driver_t ed_pccard_driver = { @@ -1234,7 +1243,7 @@ static driver_t ed_pccard_driver = { sizeof(struct ed_softc) }; -DRIVER_MODULE(ed, pccard, ed_pccard_driver, ed_devclass, 0, 0); -DRIVER_MODULE(miibus, ed, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(ed, pccard, ed_pccard_driver, ed_devclass, 0, NULL); +DRIVER_MODULE(miibus, ed, miibus_driver, miibus_devclass, 0, NULL); MODULE_DEPEND(ed, miibus, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); Modified: stable/10/sys/dev/ed/if_ed_rtl80x9.c ============================================================================== --- stable/10/sys/dev/ed/if_ed_rtl80x9.c Fri Apr 25 21:28:41 2014 (r264941) +++ stable/10/sys/dev/ed/if_ed_rtl80x9.c Fri Apr 25 21:32:34 2014 (r264942) @@ -116,7 +116,11 @@ ed_probe_RTL80x9(device_t dev, int port_ ifmedia_add(&sc->ifmedia, IFM_ETHER | IFM_10_5, 0, 0); ifmedia_add(&sc->ifmedia, IFM_ETHER | IFM_AUTO, 0, 0); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_PAGE_3 | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); switch (ed_nic_inb(sc, ED_RTL80X9_CONFIG2) & ED_RTL80X9_CF2_MEDIA) { case ED_RTL80X9_CF2_AUTO: @@ -144,8 +148,12 @@ ed_rtl_set_media(struct ifnet *ifp) sc = ifp->if_softc; ED_LOCK(sc); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_3 | (ed_nic_inb(sc, ED_P0_CR) & (ED_CR_STA | ED_CR_STP))); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); switch(IFM_SUBTYPE(sc->ifmedia.ifm_cur->ifm_media)) { case IFM_10_T: @@ -189,8 +197,12 @@ ed_rtl_get_media(struct ifnet *ifp, stru if (IFM_SUBTYPE(imr->ifm_active) == IFM_AUTO) { ED_LOCK(sc); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_3 | (ed_nic_inb(sc, ED_P0_CR) & (ED_CR_STA | ED_CR_STP))); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); switch (ed_nic_inb(sc, ED_RTL80X9_CONFIG0) & (sc->chip_type == ED_CHIP_TYPE_RTL8029 ? ED_RTL80X9_CF0_BNC Modified: stable/10/sys/dev/ed/if_edreg.h ============================================================================== --- stable/10/sys/dev/ed/if_edreg.h Fri Apr 25 21:28:41 2014 (r264941) +++ stable/10/sys/dev/ed/if_edreg.h Fri Apr 25 21:32:34 2014 (r264942) @@ -1079,22 +1079,3 @@ struct ed_ring { #define ED_CHIP_TYPE_TC5299J 10 #define ED_CHIP_TYPE_W89C926 11 #define ED_CHIP_TYPE_WD790 12 - -/* - * MII bus definitions. These are common to both DL100xx and AX88x90 - * MII definitions, because they are standards based. - */ -#define ED_MII_STARTDELIM 0x01 -#define ED_MII_WRITEOP 0x01 -#define ED_MII_READOP 0x02 -#define ED_MII_TURNAROUND 0x02 -#define ED_MII_IDLE 0x01 - -#define ED_MII_STARTDELIM_BITS 2 -#define ED_MII_OP_BITS 2 -#define ED_MII_PHY_BITS 5 -#define ED_MII_REG_BITS 5 -#define ED_MII_TURNAROUND_BITS 2 -#define ED_MII_ACK_BITS 1 -#define ED_MII_DATA_BITS 16 -#define ED_MII_IDLE_BITS 1 Modified: stable/10/sys/dev/ed/if_edvar.h ============================================================================== --- stable/10/sys/dev/ed/if_edvar.h Fri Apr 25 21:28:41 2014 (r264941) +++ stable/10/sys/dev/ed/if_edvar.h Fri Apr 25 21:32:34 2014 (r264942) @@ -28,7 +28,10 @@ */ #ifndef SYS_DEV_ED_IF_EDVAR_H -#define SYS_DEV_ED_IF_EDVAR_H +#define SYS_DEV_ED_IF_EDVAR_H + +#include + /* * ed_softc: per line info and status */ @@ -62,8 +65,7 @@ struct ed_softc { u_long command); void (*sc_mediachg)(struct ed_softc *); device_t miibus; /* MII bus for cards with MII. */ - void (*mii_writebits)(struct ed_softc *, u_int, int); - u_int (*mii_readbits)(struct ed_softc *, int); + mii_bitbang_ops_t mii_bitbang_ops; struct callout tick_ch; void (*sc_tick)(struct ed_softc *); void (*readmem)(struct ed_softc *sc, bus_size_t src, uint8_t *dst, @@ -109,6 +111,10 @@ struct ed_softc { struct ifmib_iso_8802_3 mibdata; /* stuff for network mgmt */ }; +#define ed_nic_barrier(sc, port, length, flags) \ + bus_space_barrier(sc->port_bst, sc->port_bsh, \ + (sc)->nic_offset + (port), (length), (flags)) + #define ed_nic_inb(sc, port) \ bus_space_read_1(sc->port_bst, sc->port_bsh, (sc)->nic_offset + (port)) @@ -147,6 +153,10 @@ struct ed_softc { bus_space_write_multi_4(sc->port_bst, sc->port_bsh, \ (sc)->nic_offset + (port), (uint32_t *)(addr), (count)) +#define ed_asic_barrier(sc, port, length, flags) \ + bus_space_barrier(sc->port_bst, sc->port_bsh, \ + (sc)->asic_offset + (port), (length), (flags)) + #define ed_asic_inb(sc, port) \ bus_space_read_1(sc->port_bst, sc->port_bsh, \ (sc)->asic_offset + (port)) Modified: stable/10/sys/dev/ed/tc5299jreg.h ============================================================================== --- stable/10/sys/dev/ed/tc5299jreg.h Fri Apr 25 21:28:41 2014 (r264941) +++ stable/10/sys/dev/ed/tc5299jreg.h Fri Apr 25 21:32:34 2014 (r264942) @@ -34,5 +34,5 @@ #define ED_TC5299J_MII_CLK 0x01 #define ED_TC5299J_MII_DATAOUT 0x02 -#define ED_TC5299J_MII_DIROUT 0x04 +#define ED_TC5299J_MII_DIRIN 0x04 #define ED_TC5299J_MII_DATAIN 0x08 From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 21:42:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0DCE0A0A; Fri, 25 Apr 2014 21:42: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 CE2F01AEB; Fri, 25 Apr 2014 21:42: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 s3PLgqUT057105; Fri, 25 Apr 2014 21:42:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PLgqof057103; Fri, 25 Apr 2014 21:42:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404252142.s3PLgqof057103@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Apr 2014 21:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264945 - stable/10/sys/dev/iwn X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:42:53 -0000 Author: marius Date: Fri Apr 25 21:42:52 2014 New Revision: 264945 URL: http://svnweb.freebsd.org/changeset/base/264945 Log: MFC: r260053 - There's no need to keep track of resource IDs. - Simplify MSI allocation and release. For a single one, we don't need to fiddle with the MSI count and pci_release_msi(9) is smart enough to just do nothing in case of INTx. - Don't allocate MSI as RF_SHAREABLE. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Modified: stable/10/sys/dev/iwn/if_iwn.c stable/10/sys/dev/iwn/if_iwnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/10/sys/dev/iwn/if_iwn.c Fri Apr 25 21:42:46 2014 (r264944) +++ stable/10/sys/dev/iwn/if_iwn.c Fri Apr 25 21:42:52 2014 (r264945) @@ -413,7 +413,8 @@ static device_method_t iwn_methods[] = { DEVMETHOD(device_shutdown, iwn_shutdown), DEVMETHOD(device_suspend, iwn_suspend), DEVMETHOD(device_resume, iwn_resume), - { 0, 0 } + + DEVMETHOD_END }; static driver_t iwn_driver = { @@ -423,7 +424,7 @@ static driver_t iwn_driver = { }; static devclass_t iwn_devclass; -DRIVER_MODULE(iwn, pci, iwn_driver, iwn_devclass, 0, 0); +DRIVER_MODULE(iwn, pci, iwn_driver, iwn_devclass, NULL, NULL); MODULE_VERSION(iwn, 1); @@ -453,7 +454,7 @@ iwn_attach(device_t dev) struct ieee80211com *ic; struct ifnet *ifp; uint32_t reg; - int i, error, result; + int i, error, rid; uint8_t macaddr[IEEE80211_ADDR_LEN]; sc->sc_dev = dev; @@ -494,8 +495,8 @@ iwn_attach(device_t dev) /* Enable bus-mastering. */ pci_enable_busmaster(dev); - sc->mem_rid = PCIR_BAR(0); - sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + rid = PCIR_BAR(0); + sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->mem == NULL) { device_printf(dev, "can't map mem space\n"); @@ -505,13 +506,13 @@ iwn_attach(device_t dev) sc->sc_st = rman_get_bustag(sc->mem); sc->sc_sh = rman_get_bushandle(sc->mem); - sc->irq_rid = 0; - if ((result = pci_msi_count(dev)) == 1 && - pci_alloc_msi(dev, &result) == 0) - sc->irq_rid = 1; + i = 1; + rid = 0; + if (pci_alloc_msi(dev, &i) == 0) + rid = 1; /* Install interrupt handler. */ - sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, - RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | + (rid != 0 ? 0 : RF_SHAREABLE)); if (sc->irq == NULL) { device_printf(dev, "can't map interrupt\n"); error = ENOMEM; @@ -976,9 +977,9 @@ iwn_detach(device_t dev) /* Uninstall interrupt handler. */ if (sc->irq != NULL) { bus_teardown_intr(dev, sc->irq, sc->sc_ih); - bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq); - if (sc->irq_rid == 1) - pci_release_msi(dev); + bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq), + sc->irq); + pci_release_msi(dev); } /* Free DMA resources. */ @@ -992,7 +993,8 @@ iwn_detach(device_t dev) iwn_free_fwmem(sc); if (sc->mem != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem); + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->mem), sc->mem); if (ifp != NULL) if_free(ifp); Modified: stable/10/sys/dev/iwn/if_iwnvar.h ============================================================================== --- stable/10/sys/dev/iwn/if_iwnvar.h Fri Apr 25 21:42:46 2014 (r264944) +++ stable/10/sys/dev/iwn/if_iwnvar.h Fri Apr 25 21:42:52 2014 (r264945) @@ -294,11 +294,9 @@ struct iwn_softc { struct iwn_tx_ring txq[IWN5000_NTXQUEUES]; struct iwn_rx_ring rxq; - int mem_rid; struct resource *mem; bus_space_tag_t sc_st; bus_space_handle_t sc_sh; - int irq_rid; struct resource *irq; void *sc_ih; bus_size_t sc_sz; From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 21:58:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 55B0358A; Fri, 25 Apr 2014 21:58: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 427D41C3A; Fri, 25 Apr 2014 21:58: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 s3PLwT8u062086; Fri, 25 Apr 2014 21:58:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PLwTZl062085; Fri, 25 Apr 2014 21:58:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404252158.s3PLwTZl062085@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Apr 2014 21:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264948 - stable/10/sys/dev/iwn X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:58:29 -0000 Author: marius Date: Fri Apr 25 21:58:28 2014 New Revision: 264948 URL: http://svnweb.freebsd.org/changeset/base/264948 Log: MFC: r260086 - Probe with BUS_PROBE_DEFAULT instead of 0. - Remove clearing PCIM_CMD_INTxDIS; pci(4) will do that as appropriate since r189367. Modified: stable/10/sys/dev/iwn/if_iwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/10/sys/dev/iwn/if_iwn.c Fri Apr 25 21:58:16 2014 (r264947) +++ stable/10/sys/dev/iwn/if_iwn.c Fri Apr 25 21:58:28 2014 (r264948) @@ -441,7 +441,7 @@ iwn_probe(device_t dev) if (pci_get_vendor(dev) == ident->vendor && pci_get_device(dev) == ident->device) { device_set_desc(dev, ident->name); - return 0; + return (BUS_PROBE_DEFAULT); } } return ENXIO; @@ -453,7 +453,6 @@ iwn_attach(device_t dev) struct iwn_softc *sc = (struct iwn_softc *)device_get_softc(dev); struct ieee80211com *ic; struct ifnet *ifp; - uint32_t reg; int i, error, rid; uint8_t macaddr[IEEE80211_ADDR_LEN]; @@ -483,15 +482,6 @@ iwn_attach(device_t dev) /* Clear device-specific "PCI retry timeout" register (41h). */ pci_write_config(dev, 0x41, 0, 1); - /* Hardware bug workaround. */ - reg = pci_read_config(dev, PCIR_COMMAND, 2); - if (reg & PCIM_CMD_INTxDIS) { - DPRINTF(sc, IWN_DEBUG_RESET, "%s: PCIe INTx Disable set\n", - __func__); - reg &= ~PCIM_CMD_INTxDIS; - pci_write_config(dev, PCIR_COMMAND, reg, 2); - } - /* Enable bus-mastering. */ pci_enable_busmaster(dev); From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 22:01:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E5407945; Fri, 25 Apr 2014 22:01: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 D14A61CBD; Fri, 25 Apr 2014 22:01: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 s3PM13Gt063406; Fri, 25 Apr 2014 22:01:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PM137U063397; Fri, 25 Apr 2014 22:01:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404252201.s3PM137U063397@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Apr 2014 22:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264949 - stable/10/sys/dev/mpt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 22:01:04 -0000 Author: marius Date: Fri Apr 25 22:01:02 2014 New Revision: 264949 URL: http://svnweb.freebsd.org/changeset/base/264949 Log: MFC: r260058 - Remove a redundant variable in mpt_pci_attach(). - #if 0 the currently unused paired port linking and unlinking of dual adapters. - Simplify MSI/MSI-X allocation and release. For a single one, we don't need to fiddle with the MSI/MSI-X count and pci_release_msi(9) is smart enough to just do nothing in case of INTx. - Canonicalize actions taken on attach failure and detach. - Remove the remainder of incomplete support for older FreeBSD versions. Modified: stable/10/sys/dev/mpt/mpt.h stable/10/sys/dev/mpt/mpt_cam.c stable/10/sys/dev/mpt/mpt_pci.c stable/10/sys/dev/mpt/mpt_raid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mpt/mpt.h ============================================================================== --- stable/10/sys/dev/mpt/mpt.h Fri Apr 25 21:58:28 2014 (r264948) +++ stable/10/sys/dev/mpt/mpt.h Fri Apr 25 22:01:02 2014 (r264949) @@ -220,9 +220,6 @@ int mpt_modevent(module_t, int, void *); #define bus_dmamap_sync_range(dma_tag, dmamap, offset, len, op) \ bus_dmamap_sync(dma_tag, dmamap, op) -#if __FreeBSD_version < 600000 -#define bus_get_dma_tag(x) NULL -#endif #define mpt_dma_tag_create(mpt, parent_tag, alignment, boundary, \ lowaddr, highaddr, filter, filterarg, \ maxsize, nsegments, maxsegsz, flags, \ @@ -239,34 +236,6 @@ struct mpt_map_info { }; void mpt_map_rquest(void *, bus_dma_segment_t *, int, int); -/* **************************** NewBUS interrupt Crock ************************/ -#if __FreeBSD_version < 700031 -#define mpt_setup_intr(d, i, f, U, if, ifa, hp) \ - bus_setup_intr(d, i, f, if, ifa, hp) -#else -#define mpt_setup_intr bus_setup_intr -#endif - -/* **************************** NewBUS CAM Support ****************************/ -#if __FreeBSD_version < 700049 -#define mpt_xpt_bus_register(sim, parent, bus) \ - xpt_bus_register(sim, bus) -#else -#define mpt_xpt_bus_register xpt_bus_register -#endif - -/**************************** Kernel Thread Support ***************************/ -#if __FreeBSD_version > 800001 -#define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mpt_kthread_exit(status) \ - kproc_exit(status) -#else -#define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ - kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#define mpt_kthread_exit(status) \ - kthread_exit(status) -#endif /********************************** Endianess *********************************/ #define MPT_2_HOST64(ptr, tag) ptr->tag = le64toh(ptr->tag) @@ -671,7 +640,6 @@ struct mpt_softc { /* * PCI Hardware info */ - int pci_msi_count; struct resource * pci_irq; /* Interrupt map for chip */ void * ih; /* Interrupt handle */ #if 0 @@ -754,9 +722,10 @@ struct mpt_softc { uint16_t sequence; /* Sequence Number */ uint16_t pad3; - +#if 0 /* Paired port in some dual adapters configurations */ struct mpt_softc * mpt2; +#endif /* FW Image management */ uint32_t fw_image_size; Modified: stable/10/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/10/sys/dev/mpt/mpt_cam.c Fri Apr 25 21:58:28 2014 (r264948) +++ stable/10/sys/dev/mpt/mpt_cam.c Fri Apr 25 22:01:02 2014 (r264949) @@ -110,12 +110,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if __FreeBSD_version >= 700025 -#ifndef CAM_NEW_TRAN_CODE -#define CAM_NEW_TRAN_CODE 1 -#endif -#endif - static void mpt_poll(struct cam_sim *); static timeout_t mpt_timeout; static void mpt_action(struct cam_sim *, union ccb *); @@ -344,7 +338,7 @@ mpt_cam_attach(struct mpt_softc *mpt) * Register exactly this bus. */ MPT_LOCK(mpt); - if (mpt_xpt_bus_register(mpt->sim, mpt->dev, 0) != CAM_SUCCESS) { + if (xpt_bus_register(mpt->sim, mpt->dev, 0) != CAM_SUCCESS) { mpt_prt(mpt, "Bus registration Failed!\n"); error = ENOMEM; MPT_UNLOCK(mpt); @@ -383,7 +377,7 @@ mpt_cam_attach(struct mpt_softc *mpt) * Register this bus. */ MPT_LOCK(mpt); - if (mpt_xpt_bus_register(mpt->phydisk_sim, mpt->dev, 1) != + if (xpt_bus_register(mpt->phydisk_sim, mpt->dev, 1) != CAM_SUCCESS) { mpt_prt(mpt, "Physical Disk Bus registration Failed!\n"); error = ENOMEM; @@ -2338,7 +2332,6 @@ mpt_cam_event(struct mpt_softc *mpt, req break; case MPI_EVENT_RESCAN: -#if __FreeBSD_version >= 600000 { union ccb *ccb; uint32_t pathid; @@ -2373,10 +2366,7 @@ mpt_cam_event(struct mpt_softc *mpt, req xpt_rescan(ccb); break; } -#else - mpt_prt(mpt, "Rescan Port: %d\n", (data0 >> 8) & 0xff); - break; -#endif + case MPI_EVENT_LINK_STATUS_CHANGE: mpt_prt(mpt, "Port %d: LinkState: %s\n", (data1 >> 8) & 0xff, @@ -3324,11 +3314,8 @@ mpt_action(struct cam_sim *sim, union cc break; } -#ifdef CAM_NEW_TRAN_CODE #define IS_CURRENT_SETTINGS(c) ((c)->type == CTS_TYPE_CURRENT_SETTINGS) -#else -#define IS_CURRENT_SETTINGS(c) ((c)->flags & CCB_TRANS_CURRENT_SETTINGS) -#endif + #define DP_DISC_ENABLE 0x1 #define DP_DISC_DISABL 0x2 #define DP_DISC (DP_DISC_ENABLE|DP_DISC_DISABL) @@ -3345,10 +3332,8 @@ mpt_action(struct cam_sim *sim, union cc case XPT_SET_TRAN_SETTINGS: /* Nexus Settings */ { -#ifdef CAM_NEW_TRAN_CODE struct ccb_trans_settings_scsi *scsi; struct ccb_trans_settings_spi *spi; -#endif uint8_t dval; u_int period; u_int offset; @@ -3361,7 +3346,6 @@ mpt_action(struct cam_sim *sim, union cc break; } -#ifdef CAM_NEW_TRAN_CODE scsi = &cts->proto_specific.scsi; spi = &cts->xport_specific.spi; @@ -3372,7 +3356,6 @@ mpt_action(struct cam_sim *sim, union cc mpt_set_ccb_status(ccb, CAM_REQ_CMP); break; } -#endif /* * Skip attempting settings on RAID volume disks. @@ -3402,28 +3385,6 @@ mpt_action(struct cam_sim *sim, union cc period = 0; offset = 0; -#ifndef CAM_NEW_TRAN_CODE - if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) { - dval |= (cts->flags & CCB_TRANS_DISC_ENB) ? - DP_DISC_ENABLE : DP_DISC_DISABL; - } - - if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) { - dval |= (cts->flags & CCB_TRANS_TAG_ENB) ? - DP_TQING_ENABLE : DP_TQING_DISABL; - } - - if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0) { - dval |= cts->bus_width ? DP_WIDE : DP_NARROW; - } - - if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) && - (cts->valid & CCB_TRANS_SYNC_OFFSET_VALID)) { - dval |= DP_SYNC; - period = cts->sync_period; - offset = cts->sync_offset; - } -#else if ((spi->valid & CTS_SPI_VALID_DISC) != 0) { dval |= ((spi->flags & CTS_SPI_FLAGS_DISC_ENB) != 0) ? DP_DISC_ENABLE : DP_DISC_DISABL; @@ -3459,7 +3420,7 @@ mpt_action(struct cam_sim *sim, union cc period &= MPI_SCSIDEVPAGE1_RP_MIN_SYNC_PERIOD_MASK; period >>= MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD; } -#endif + if (dval & DP_DISC_ENABLE) { mpt->mpt_disc_enable |= (1 << tgt); } else if (dval & DP_DISC_DISABL) { @@ -3492,7 +3453,6 @@ mpt_action(struct cam_sim *sim, union cc } case XPT_GET_TRAN_SETTINGS: { -#ifdef CAM_NEW_TRAN_CODE struct ccb_trans_settings_scsi *scsi; cts = &ccb->cts; cts->protocol = PROTO_SCSI; @@ -3524,21 +3484,6 @@ mpt_action(struct cam_sim *sim, union cc scsi = &cts->proto_specific.scsi; scsi->valid = CTS_SCSI_VALID_TQ; scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; -#else - cts = &ccb->cts; - if (mpt->is_fc) { - cts->flags = CCB_TRANS_TAG_ENB | CCB_TRANS_DISC_ENB; - cts->valid = CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID; - cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT; - } else if (mpt->is_sas) { - cts->flags = CCB_TRANS_TAG_ENB | CCB_TRANS_DISC_ENB; - cts->valid = CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID; - cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT; - } else if (mpt_get_spi_settings(mpt, cts) != 0) { - mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); - break; - } -#endif mpt_set_ccb_status(ccb, CAM_REQ_CMP); break; } @@ -3592,7 +3537,6 @@ mpt_action(struct cam_sim *sim, union cc /* * The base speed is the speed of the underlying connection. */ -#ifdef CAM_NEW_TRAN_CODE cpi->protocol = PROTO_SCSI; if (mpt->is_fc) { cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; @@ -3616,21 +3560,6 @@ mpt_action(struct cam_sim *sim, union cc cpi->transport_version = 2; cpi->protocol_version = SCSI_REV_2; } -#else - if (mpt->is_fc) { - cpi->hba_misc = PIM_NOBUSRESET; - cpi->base_transfer_speed = 100000; - cpi->hba_inquiry = PI_TAG_ABLE; - } else if (mpt->is_sas) { - cpi->hba_misc = PIM_NOBUSRESET; - cpi->base_transfer_speed = 300000; - cpi->hba_inquiry = PI_TAG_ABLE; - } else { - cpi->hba_misc = PIM_SEQSCAN; - cpi->base_transfer_speed = 3300; - cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; - } -#endif /* * We give our fake RAID passhtru bus a width that is MaxVolumes @@ -3726,10 +3655,8 @@ mpt_action(struct cam_sim *sim, union cc static int mpt_get_spi_settings(struct mpt_softc *mpt, struct ccb_trans_settings *cts) { -#ifdef CAM_NEW_TRAN_CODE struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi; -#endif target_id_t tgt; uint32_t dval, pval, oval; int rv; @@ -3790,29 +3717,6 @@ mpt_get_spi_settings(struct mpt_softc *m pval = MPI_SCSIPORTPAGE0_CAP_GET_MIN_SYNC_PERIOD(pval); } -#ifndef CAM_NEW_TRAN_CODE - cts->flags &= ~(CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB); - cts->valid = 0; - cts->sync_period = pval; - cts->sync_offset = oval; - cts->valid |= CCB_TRANS_SYNC_RATE_VALID; - cts->valid |= CCB_TRANS_SYNC_OFFSET_VALID; - cts->valid |= CCB_TRANS_BUS_WIDTH_VALID; - if (dval & DP_WIDE) { - cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT; - } else { - cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT; - } - if (cts->ccb_h.target_lun != CAM_LUN_WILDCARD) { - cts->valid |= CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID; - if (dval & DP_DISC_ENABLE) { - cts->flags |= CCB_TRANS_DISC_ENB; - } - if (dval & DP_TQING_ENABLE) { - cts->flags |= CCB_TRANS_TAG_ENB; - } - } -#else spi->valid = 0; scsi->valid = 0; spi->flags = 0; @@ -3837,10 +3741,10 @@ mpt_get_spi_settings(struct mpt_softc *m spi->flags |= CTS_SPI_FLAGS_DISC_ENB; } } -#endif + mpt_lprt(mpt, MPT_PRT_NEGOTIATION, "mpt_get_spi_settings[%d]: %s flags 0x%x per 0x%x off=%d\n", tgt, - IS_CURRENT_SETTINGS(cts)? "ACTIVE" : "NVRAM ", dval, pval, oval); + IS_CURRENT_SETTINGS(cts) ? "ACTIVE" : "NVRAM ", dval, pval, oval); return (0); } @@ -3910,7 +3814,7 @@ mpt_spawn_recovery_thread(struct mpt_sof { int error; - error = mpt_kthread_create(mpt_recovery_thread, mpt, + error = kproc_create(mpt_recovery_thread, mpt, &mpt->recovery_thread, /*flags*/0, /*altstack*/0, "mpt_recovery%d", mpt->unit); return (error); @@ -3953,7 +3857,7 @@ mpt_recovery_thread(void *arg) mpt->recovery_thread = NULL; wakeup(&mpt->recovery_thread); MPT_UNLOCK(mpt); - mpt_kthread_exit(0); + kproc_exit(0); } static int Modified: stable/10/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/10/sys/dev/mpt/mpt_pci.c Fri Apr 25 21:58:28 2014 (r264948) +++ stable/10/sys/dev/mpt/mpt_pci.c Fri Apr 25 22:01:02 2014 (r264949) @@ -105,14 +105,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if __FreeBSD_version < 700000 -#define pci_msix_count(x) 0 -#define pci_msi_count(x) 0 -#define pci_alloc_msi(x, y) 1 -#define pci_alloc_msix(x, y) 1 -#define pci_release_msi(x) do { ; } while (0) -#endif - /* * XXX it seems no other MPT driver knows about the following chips. */ @@ -149,10 +141,6 @@ __FBSDID("$FreeBSD$"); #define MPI_MANUFACTPAGE_DEVID_SAS1078DE_FB 0x007C #endif -#ifndef PCIM_CMD_SERRESPEN -#define PCIM_CMD_SERRESPEN 0x0100 -#endif - static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); static void mpt_free_bus_resources(struct mpt_softc *mpt); @@ -178,6 +166,7 @@ static device_method_t mpt_methods[] = { static driver_t mpt_driver = { "mpt", mpt_methods, sizeof(struct mpt_softc) }; + static devclass_t mpt_devclass; DRIVER_MODULE(mpt, pci, mpt_driver, mpt_devclass, NULL, NULL); MODULE_DEPEND(mpt, pci, 1, 1, 1); @@ -288,6 +277,7 @@ mpt_set_options(struct mpt_softc *mpt) } } +#if 0 static void mpt_link_peer(struct mpt_softc *mpt) { @@ -326,13 +316,14 @@ mpt_unlink_peer(struct mpt_softc *mpt) mpt->mpt2->mpt2 = NULL; } } +#endif static int mpt_pci_attach(device_t dev) { struct mpt_softc *mpt; int iqd; - uint32_t data, cmd; + uint32_t val; int mpt_io_bar, mpt_mem_bar; mpt = (struct mpt_softc*)device_get_softc(dev); @@ -393,19 +384,19 @@ mpt_pci_attach(device_t dev) /* * Make sure that SERR, PERR, WRITE INVALIDATE and BUSMASTER are set. */ - cmd = pci_read_config(dev, PCIR_COMMAND, 2); - cmd |= - PCIM_CMD_SERRESPEN | PCIM_CMD_PERRESPEN | + val = pci_read_config(dev, PCIR_COMMAND, 2); + val |= PCIM_CMD_SERRESPEN | PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MWRICEN; - pci_write_config(dev, PCIR_COMMAND, cmd, 2); + pci_write_config(dev, PCIR_COMMAND, val, 2); /* * Make sure we've disabled the ROM. */ - data = pci_read_config(dev, PCIR_BIOS, 4); - data &= ~PCIM_BIOS_ENABLE; - pci_write_config(dev, PCIR_BIOS, data, 4); + val = pci_read_config(dev, PCIR_BIOS, 4); + val &= ~PCIM_BIOS_ENABLE; + pci_write_config(dev, PCIR_BIOS, val, 4); +#if 0 /* * Is this part a dual? * If so, link with our partner (around yet) @@ -422,12 +413,13 @@ mpt_pci_attach(device_t dev) default: break; } +#endif /* * Figure out which are the I/O and MEM Bars */ - data = pci_read_config(dev, PCIR_BAR(0), 4); - if (PCI_BAR_IO(data)) { + val = pci_read_config(dev, PCIR_BAR(0), 4); + if (PCI_BAR_IO(val)) { /* BAR0 is IO, BAR1 is memory */ mpt_io_bar = 0; mpt_mem_bar = 1; @@ -484,25 +476,15 @@ mpt_pci_attach(device_t dev) * First try to alloc an MSI-X message. If that * fails, then try to alloc an MSI message instead. */ - if (pci_msix_count(dev) == 1) { - mpt->pci_msi_count = 1; - if (pci_alloc_msix(dev, &mpt->pci_msi_count) == 0) { - iqd = 1; - } else { - mpt->pci_msi_count = 0; - } - } - if (iqd == 0 && pci_msi_count(dev) == 1) { - mpt->pci_msi_count = 1; - if (pci_alloc_msi(dev, &mpt->pci_msi_count) == 0) { - iqd = 1; - } else { - mpt->pci_msi_count = 0; - } - } + val = 1; + if (pci_alloc_msix(dev, &val) == 0) + iqd = 1; + val = 1; + if (iqd == 0 && pci_alloc_msi(dev, &val) == 0) + iqd = 1; } mpt->pci_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd, - RF_ACTIVE | (mpt->pci_msi_count ? 0 : RF_SHAREABLE)); + RF_ACTIVE | (iqd != 0 ? 0 : RF_SHAREABLE)); if (mpt->pci_irq == NULL) { device_printf(dev, "could not allocate interrupt\n"); goto bad; @@ -514,7 +496,7 @@ mpt_pci_attach(device_t dev) mpt_disable_ints(mpt); /* Register the interrupt handler */ - if (mpt_setup_intr(dev, mpt->pci_irq, MPT_IFLAGS, NULL, mpt_pci_intr, + if (bus_setup_intr(dev, mpt->pci_irq, MPT_IFLAGS, NULL, mpt_pci_intr, mpt, &mpt->ih)) { device_printf(dev, "could not setup interrupt\n"); goto bad; @@ -562,7 +544,10 @@ mpt_pci_attach(device_t dev) if (mpt->eh == NULL) { mpt_prt(mpt, "shutdown event registration failed\n"); + mpt_disable_ints(mpt); (void) mpt_detach(mpt); + mpt_reset(mpt, /*reinit*/FALSE); + mpt_raid_free_mem(mpt); goto bad; } return (0); @@ -570,7 +555,9 @@ mpt_pci_attach(device_t dev) bad: mpt_dma_mem_free(mpt); mpt_free_bus_resources(mpt); +#if 0 mpt_unlink_peer(mpt); +#endif MPT_LOCK_DESTROY(mpt); @@ -595,25 +582,21 @@ mpt_free_bus_resources(struct mpt_softc if (mpt->pci_irq) { bus_release_resource(mpt->dev, SYS_RES_IRQ, rman_get_rid(mpt->pci_irq), mpt->pci_irq); + pci_release_msi(mpt->dev); mpt->pci_irq = NULL; } - if (mpt->pci_msi_count) { - pci_release_msi(mpt->dev); - mpt->pci_msi_count = 0; - } - if (mpt->pci_pio_reg) { bus_release_resource(mpt->dev, SYS_RES_IOPORT, rman_get_rid(mpt->pci_pio_reg), mpt->pci_pio_reg); mpt->pci_pio_reg = NULL; } + if (mpt->pci_reg) { bus_release_resource(mpt->dev, SYS_RES_MEMORY, rman_get_rid(mpt->pci_reg), mpt->pci_reg); mpt->pci_reg = NULL; } - MPT_LOCK_DESTROY(mpt); } /* @@ -630,12 +613,16 @@ mpt_pci_detach(device_t dev) mpt_disable_ints(mpt); mpt_detach(mpt); mpt_reset(mpt, /*reinit*/FALSE); + mpt_raid_free_mem(mpt); mpt_dma_mem_free(mpt); mpt_free_bus_resources(mpt); - mpt_raid_free_mem(mpt); +#if 0 + mpt_unlink_peer(mpt); +#endif if (mpt->eh != NULL) { EVENTHANDLER_DEREGISTER(shutdown_post_sync, mpt->eh); } + MPT_LOCK_DESTROY(mpt); } return(0); } @@ -649,11 +636,8 @@ mpt_pci_shutdown(device_t dev) struct mpt_softc *mpt; mpt = (struct mpt_softc *)device_get_softc(dev); - if (mpt) { - int r; - r = mpt_shutdown(mpt); - return (r); - } + if (mpt) + return (mpt_shutdown(mpt)); return(0); } @@ -669,20 +653,11 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) } len = sizeof (request_t) * MPT_MAX_REQUESTS(mpt); -#ifdef RELENG_4 - mpt->request_pool = (request_t *)malloc(len, M_DEVBUF, M_WAITOK); - if (mpt->request_pool == NULL) { - mpt_prt(mpt, "cannot allocate request pool\n"); - return (1); - } - memset(mpt->request_pool, 0, len); -#else mpt->request_pool = (request_t *)malloc(len, M_DEVBUF, M_WAITOK|M_ZERO); if (mpt->request_pool == NULL) { mpt_prt(mpt, "cannot allocate request pool\n"); return (1); } -#endif /* * Create a parent dma tag for this device. Modified: stable/10/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/10/sys/dev/mpt/mpt_raid.c Fri Apr 25 21:58:28 2014 (r264948) +++ stable/10/sys/dev/mpt/mpt_raid.c Fri Apr 25 22:01:02 2014 (r264949) @@ -636,7 +636,7 @@ mpt_spawn_raid_thread(struct mpt_softc * MPT_LOCK(mpt); xpt_freeze_simq(mpt->phydisk_sim, 1); MPT_UNLOCK(mpt); - error = mpt_kthread_create(mpt_raid_thread, mpt, + error = kproc_create(mpt_raid_thread, mpt, &mpt->raid_thread, /*flags*/0, /*altstack*/0, "mpt_raid%d", mpt->unit); if (error != 0) { @@ -719,7 +719,7 @@ mpt_raid_thread(void *arg) mpt->raid_thread = NULL; wakeup(&mpt->raid_thread); MPT_UNLOCK(mpt); - mpt_kthread_exit(0); + kproc_exit(0); } #if 0 From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 22:04:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E7BBAD44; Fri, 25 Apr 2014 22:04: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 D40041CEF; Fri, 25 Apr 2014 22:04: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 s3PM4eew066108; Fri, 25 Apr 2014 22:04:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PM4ePA066107; Fri, 25 Apr 2014 22:04:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404252204.s3PM4ePA066107@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Apr 2014 22:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264952 - stable/10/sys/dev/ral X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 22:04:41 -0000 Author: marius Date: Fri Apr 25 22:04:40 2014 New Revision: 264952 URL: http://svnweb.freebsd.org/changeset/base/264952 Log: MFC: r260061 - Add support for using MSI instead of INTx, controllable via the tunable hw.ral.msi_disable (defaulting to using MSI). - Probe with BUS_PROBE_DEFAULT instead of 0. - Nuke code setting PCI_POWERSTATE_D0; pci(4) already does that for type 0 devices. - Use PCIR_BAR instead of a homegrown macro. - There's no need to keep track of resource IDs. - Release resources again in case attaching fails. - Quiesce the interrupt before detaching. - Sprinkle const. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. - Trim headers. - Nuke dupe $FreeBSD$. Modified: stable/10/sys/dev/ral/if_ral_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ral/if_ral_pci.c ============================================================================== --- stable/10/sys/dev/ral/if_ral_pci.c Fri Apr 25 22:04:33 2014 (r264951) +++ stable/10/sys/dev/ral/if_ral_pci.c Fri Apr 25 22:04:40 2014 (r264952) @@ -1,5 +1,3 @@ -/* $FreeBSD$ */ - /*- * Copyright (c) 2005, 2006 * Damien Bergamini @@ -25,32 +23,26 @@ __FBSDID("$FreeBSD$"); */ #include -#include -#include -#include -#include -#include #include +#include +#include +#include #include #include -#include -#include +#include +#include +#include #include #include -#include -#include -#include -#include #include -#include +#include #include -#include +#include #include #include -#include #include #include @@ -64,6 +56,9 @@ MODULE_DEPEND(ral, firmware, 1, 1, 1); MODULE_DEPEND(ral, wlan, 1, 1, 1); MODULE_DEPEND(ral, wlan_amrr, 1, 1, 1); +static int ral_msi_disable; +TUNABLE_INT("hw.ral.msi_disable", &ral_msi_disable); + struct ral_pci_ident { uint16_t vendor; uint16_t device; @@ -105,7 +100,7 @@ static const struct ral_pci_ident ral_pc { 0, 0, NULL } }; -static struct ral_opns { +static const struct ral_opns { int (*attach)(device_t, int); int (*detach)(void *); void (*shutdown)(void *); @@ -144,9 +139,7 @@ struct ral_pci_softc { struct rt2860_softc sc_rt2860; } u; - struct ral_opns *sc_opns; - int irq_rid; - int mem_rid; + const struct ral_opns *sc_opns; struct resource *irq; struct resource *mem; void *sc_ih; @@ -168,7 +161,7 @@ static device_method_t ral_pci_methods[] DEVMETHOD(device_suspend, ral_pci_suspend), DEVMETHOD(device_resume, ral_pci_resume), - { 0, 0 } + DEVMETHOD_END }; static driver_t ral_pci_driver = { @@ -179,7 +172,7 @@ static driver_t ral_pci_driver = { static devclass_t ral_devclass; -DRIVER_MODULE(ral, pci, ral_pci_driver, ral_devclass, 0, 0); +DRIVER_MODULE(ral, pci, ral_pci_driver, ral_devclass, NULL, NULL); static int ral_pci_probe(device_t dev) @@ -190,29 +183,19 @@ ral_pci_probe(device_t dev) if (pci_get_vendor(dev) == ident->vendor && pci_get_device(dev) == ident->device) { device_set_desc(dev, ident->name); - return 0; + return (BUS_PROBE_DEFAULT); } } return ENXIO; } -/* Base Address Register */ -#define RAL_PCI_BAR0 0x10 - static int ral_pci_attach(device_t dev) { struct ral_pci_softc *psc = device_get_softc(dev); struct rt2560_softc *sc = &psc->u.sc_rt2560; - int error; - - if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { - device_printf(dev, "chip is in D%d power mode " - "-- setting to D0\n", pci_get_powerstate(dev)); - pci_set_powerstate(dev, PCI_POWERSTATE_D0); - } + int count, error, rid; - /* enable bus-mastering */ pci_enable_busmaster(dev); switch (pci_get_device(dev)) { @@ -229,8 +212,8 @@ ral_pci_attach(device_t dev) break; } - psc->mem_rid = RAL_PCI_BAR0; - psc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &psc->mem_rid, + rid = PCIR_BAR(0); + psc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (psc->mem == NULL) { device_printf(dev, "could not allocate memory resource\n"); @@ -241,17 +224,27 @@ ral_pci_attach(device_t dev) sc->sc_sh = rman_get_bushandle(psc->mem); sc->sc_invalid = 1; - psc->irq_rid = 0; - psc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &psc->irq_rid, - RF_ACTIVE | RF_SHAREABLE); + rid = 0; + if (ral_msi_disable == 0) { + count = 1; + if (pci_alloc_msi(dev, &count) == 0) + rid = 1; + } + psc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | + (rid != 0 ? 0 : RF_SHAREABLE)); if (psc->irq == NULL) { device_printf(dev, "could not allocate interrupt resource\n"); + pci_release_msi(dev); + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(psc->mem), psc->mem); return ENXIO; } error = (*psc->sc_opns->attach)(dev, pci_get_device(dev)); - if (error != 0) + if (error != 0) { + (void)ral_pci_detach(dev); return error; + } /* * Hook our interrupt after all initialization is complete. @@ -260,6 +253,7 @@ ral_pci_attach(device_t dev) NULL, psc->sc_opns->intr, psc, &psc->sc_ih); if (error != 0) { device_printf(dev, "could not set up interrupt\n"); + (void)ral_pci_detach(dev); return error; } sc->sc_invalid = 0; @@ -275,14 +269,18 @@ ral_pci_detach(device_t dev) /* check if device was removed */ sc->sc_invalid = !bus_child_present(dev); - + + if (psc->sc_ih != NULL) + bus_teardown_intr(dev, psc->irq, psc->sc_ih); (*psc->sc_opns->detach)(psc); bus_generic_detach(dev); - bus_teardown_intr(dev, psc->irq, psc->sc_ih); - bus_release_resource(dev, SYS_RES_IRQ, psc->irq_rid, psc->irq); + bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(psc->irq), + psc->irq); + pci_release_msi(dev); - bus_release_resource(dev, SYS_RES_MEMORY, psc->mem_rid, psc->mem); + bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(psc->mem), + psc->mem); return 0; } From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 22:19:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D39DD98D; Fri, 25 Apr 2014 22:19: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 C02681E78; Fri, 25 Apr 2014 22:19: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 s3PMJIwf070880; Fri, 25 Apr 2014 22:19:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PMJI84070877; Fri, 25 Apr 2014 22:19:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404252219.s3PMJI84070877@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Apr 2014 22:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264954 - stable/10/sys/dev/iwi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 22:19:19 -0000 Author: marius Date: Fri Apr 25 22:19:18 2014 New Revision: 264954 URL: http://svnweb.freebsd.org/changeset/base/264954 Log: MFC: r260063 - Probe with BUS_PROBE_DEFAULT instead of 0. - Nuke code setting PCI_POWERSTATE_D0; pci(4) already does that for type 0 devices. - Use PCIR_BAR instead of a homegrown macro. - There's no need to keep track of resource IDs. - Quiesce the interrupt before actually detaching. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Modified: stable/10/sys/dev/iwi/if_iwi.c stable/10/sys/dev/iwi/if_iwivar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/10/sys/dev/iwi/if_iwi.c Fri Apr 25 22:19:06 2014 (r264953) +++ stable/10/sys/dev/iwi/if_iwi.c Fri Apr 25 22:19:18 2014 (r264954) @@ -219,7 +219,7 @@ static device_method_t iwi_methods[] = { DEVMETHOD(device_suspend, iwi_suspend), DEVMETHOD(device_resume, iwi_resume), - { 0, 0 } + DEVMETHOD_END }; static driver_t iwi_driver = { @@ -230,7 +230,7 @@ static driver_t iwi_driver = { static devclass_t iwi_devclass; -DRIVER_MODULE(iwi, pci, iwi_driver, iwi_devclass, 0, 0); +DRIVER_MODULE(iwi, pci, iwi_driver, iwi_devclass, NULL, NULL); MODULE_VERSION(iwi, 1); @@ -257,15 +257,12 @@ iwi_probe(device_t dev) if (pci_get_vendor(dev) == ident->vendor && pci_get_device(dev) == ident->device) { device_set_desc(dev, ident->name); - return 0; + return (BUS_PROBE_DEFAULT); } } return ENXIO; } -/* Base Address Register */ -#define IWI_PCI_BAR0 0x10 - static int iwi_attach(device_t dev) { @@ -300,20 +297,13 @@ iwi_attach(device_t dev) callout_init_mtx(&sc->sc_wdtimer, &sc->sc_mtx, 0); callout_init_mtx(&sc->sc_rftimer, &sc->sc_mtx, 0); - if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { - device_printf(dev, "chip is in D%d power mode " - "-- setting to D0\n", pci_get_powerstate(dev)); - pci_set_powerstate(dev, PCI_POWERSTATE_D0); - } - pci_write_config(dev, 0x41, 0, 1); /* enable bus-mastering */ pci_enable_busmaster(dev); - sc->mem_rid = IWI_PCI_BAR0; - sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, - RF_ACTIVE); + i = PCIR_BAR(0); + sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &i, RF_ACTIVE); if (sc->mem == NULL) { device_printf(dev, "could not allocate memory resource\n"); goto fail; @@ -322,8 +312,8 @@ iwi_attach(device_t dev) sc->sc_st = rman_get_bustag(sc->mem); sc->sc_sh = rman_get_bushandle(sc->mem); - sc->irq_rid = 0; - sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + i = 0; + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE); if (sc->irq == NULL) { device_printf(dev, "could not allocate interrupt resource\n"); @@ -459,6 +449,8 @@ iwi_detach(device_t dev) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + bus_teardown_intr(dev, sc->irq, sc->sc_ih); + /* NB: do early to drain any pending tasks */ ieee80211_draintask(ic, &sc->sc_radiontask); ieee80211_draintask(ic, &sc->sc_radiofftask); @@ -480,10 +472,10 @@ iwi_detach(device_t dev) iwi_free_tx_ring(sc, &sc->txq[3]); iwi_free_rx_ring(sc, &sc->rxq); - bus_teardown_intr(dev, sc->irq, sc->sc_ih); - bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq); + bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq), sc->irq); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem); + bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->mem), + sc->mem); delete_unrhdr(sc->sc_unr); Modified: stable/10/sys/dev/iwi/if_iwivar.h ============================================================================== --- stable/10/sys/dev/iwi/if_iwivar.h Fri Apr 25 22:19:06 2014 (r264953) +++ stable/10/sys/dev/iwi/if_iwivar.h Fri Apr 25 22:19:18 2014 (r264954) @@ -153,8 +153,6 @@ struct iwi_softc { bus_space_tag_t sc_st; bus_space_handle_t sc_sh; void *sc_ih; - int mem_rid; - int irq_rid; /* * The card needs external firmware images to work, which is made of a From owner-svn-src-stable-10@FreeBSD.ORG Fri Apr 25 22:23:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3847ED36; Fri, 25 Apr 2014 22:23: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 18EEF1077; Fri, 25 Apr 2014 22:23: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 s3PMNcCM074612; Fri, 25 Apr 2014 22:23:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PMNcbd074610; Fri, 25 Apr 2014 22:23:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404252223.s3PMNcbd074610@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Apr 2014 22:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264956 - stable/10/sys/dev/wpi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 22:23:39 -0000 Author: marius Date: Fri Apr 25 22:23:38 2014 New Revision: 264956 URL: http://svnweb.freebsd.org/changeset/base/264956 Log: MFC: r260064 - Probe with BUS_PROBE_DEFAULT instead of 0. - Nuke code setting PCI_POWERSTATE_D0; pci(4) already does that for type 0 devices. - There's no need to keep track of resource IDs. - Quiesce the interrupt before actually detaching. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Modified: stable/10/sys/dev/wpi/if_wpi.c stable/10/sys/dev/wpi/if_wpivar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/10/sys/dev/wpi/if_wpi.c Fri Apr 25 22:23:26 2014 (r264955) +++ stable/10/sys/dev/wpi/if_wpi.c Fri Apr 25 22:23:38 2014 (r264956) @@ -252,7 +252,6 @@ static int wpi_shutdown(device_t); static int wpi_suspend(device_t); static int wpi_resume(device_t); - static device_method_t wpi_methods[] = { /* Device interface */ DEVMETHOD(device_probe, wpi_probe), @@ -262,7 +261,7 @@ static device_method_t wpi_methods[] = { DEVMETHOD(device_suspend, wpi_suspend), DEVMETHOD(device_resume, wpi_resume), - { 0, 0 } + DEVMETHOD_END }; static driver_t wpi_driver = { @@ -273,7 +272,7 @@ static driver_t wpi_driver = { static devclass_t wpi_devclass; -DRIVER_MODULE(wpi, pci, wpi_driver, wpi_devclass, 0, 0); +DRIVER_MODULE(wpi, pci, wpi_driver, wpi_devclass, NULL, NULL); MODULE_VERSION(wpi, 1); @@ -284,12 +283,12 @@ static const uint8_t wpi_ridx_to_plcp[] /* CCK: device-dependent */ 10, 20, 55, 110 }; + static const uint8_t wpi_ridx_to_rate[] = { 12, 18, 24, 36, 48, 72, 96, 108, /* OFDM */ 2, 4, 11, 22 /*CCK */ }; - static int wpi_probe(device_t dev) { @@ -299,7 +298,7 @@ wpi_probe(device_t dev) if (pci_get_vendor(dev) == ident->vendor && pci_get_device(dev) == ident->device) { device_set_desc(dev, ident->name); - return 0; + return (BUS_PROBE_DEFAULT); } } return ENXIO; @@ -492,7 +491,7 @@ wpi_attach(device_t dev) struct wpi_softc *sc = device_get_softc(dev); struct ifnet *ifp; struct ieee80211com *ic; - int ac, error, supportsa = 1; + int ac, error, rid, supportsa = 1; uint32_t tmp; const struct wpi_ident *ident; uint8_t macaddr[IEEE80211_ADDR_LEN]; @@ -524,20 +523,14 @@ wpi_attach(device_t dev) callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0); callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0); - if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { - device_printf(dev, "chip is in D%d power mode " - "-- setting to D0\n", pci_get_powerstate(dev)); - pci_set_powerstate(dev, PCI_POWERSTATE_D0); - } - /* disable the retry timeout register */ pci_write_config(dev, 0x41, 0, 1); /* enable bus-mastering */ pci_enable_busmaster(dev); - sc->mem_rid = PCIR_BAR(0); - sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + rid = PCIR_BAR(0); + sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->mem == NULL) { device_printf(dev, "could not allocate memory resource\n"); @@ -548,8 +541,8 @@ wpi_attach(device_t dev) sc->sc_st = rman_get_bustag(sc->mem); sc->sc_sh = rman_get_bushandle(sc->mem); - sc->irq_rid = 0; - sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + rid = 0; + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | RF_SHAREABLE); if (sc->irq == NULL) { device_printf(dev, "could not allocate interrupt resource\n"); @@ -716,6 +709,9 @@ wpi_detach(device_t dev) struct ieee80211com *ic; int ac; + if (sc->irq != NULL) + bus_teardown_intr(dev, sc->irq, sc->sc_ih); + if (ifp != NULL) { ic = ifp->if_l2com; @@ -745,13 +741,12 @@ wpi_detach(device_t dev) wpi_free_fwmem(sc); WPI_UNLOCK(sc); - if (sc->irq != NULL) { - bus_teardown_intr(dev, sc->irq, sc->sc_ih); - bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq); - } - + if (sc->irq != NULL) + bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq), + sc->irq); if (sc->mem != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem); + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->mem), sc->mem); if (ifp != NULL) if_free(ifp); @@ -3191,7 +3186,6 @@ wpi_stop_locked(struct wpi_softc *sc) callout_stop(&sc->watchdog_to); callout_stop(&sc->calib_to); - /* disable interrupts */ WPI_WRITE(sc, WPI_MASK, 0); WPI_WRITE(sc, WPI_INTR, WPI_INTR_MASK); Modified: stable/10/sys/dev/wpi/if_wpivar.h ============================================================================== --- stable/10/sys/dev/wpi/if_wpivar.h Fri Apr 25 22:23:26 2014 (r264955) +++ stable/10/sys/dev/wpi/if_wpivar.h Fri Apr 25 22:23:38 2014 (r264956) @@ -162,8 +162,6 @@ struct wpi_softc { bus_space_tag_t sc_st; bus_space_handle_t sc_sh; void *sc_ih; - int mem_rid; - int irq_rid; struct wpi_config config; int temp; From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 26 00:40:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C541958D; Sat, 26 Apr 2014 00:40: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 B28291BEE; Sat, 26 Apr 2014 00:40: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 s3Q0eGIb033160; Sat, 26 Apr 2014 00:40:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3Q0eGWC033158; Sat, 26 Apr 2014 00:40:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404260040.s3Q0eGWC033158@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 Apr 2014 00:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264958 - stable/10/sys/dev/sound/pci/hda X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 00:40:16 -0000 Author: marius Date: Sat Apr 26 00:40:16 2014 New Revision: 264958 URL: http://svnweb.freebsd.org/changeset/base/264958 Log: MFC: r264831 Add quirk to configure headphones redirection on Intel DH87RL boards. Modified: stable/10/sys/dev/sound/pci/hda/hdaa_patches.c stable/10/sys/dev/sound/pci/hda/hdac.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdaa_patches.c Sat Apr 26 00:40:02 2014 (r264957) +++ stable/10/sys/dev/sound/pci/hda/hdaa_patches.c Sat Apr 26 00:40:16 2014 (r264958) @@ -356,7 +356,7 @@ hdac_pin_patch(struct hdaa_widget *w) case 25: patch = "as=1 seq=15"; break; - /* + /* * Group onboard mic and headphone mic * together. Fixes onboard mic. */ @@ -384,6 +384,13 @@ hdac_pin_patch(struct hdaa_widget *w) patch = "as=1 seq=15"; break; } + } else if (id == HDA_CODEC_ALC892 && + subid == INTEL_DH87RL_SUBVENDOR) { + switch (nid) { + case 27: + patch = "as=1 seq=15"; + break; + } } if (patch != NULL) Modified: stable/10/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.h Sat Apr 26 00:40:02 2014 (r264957) +++ stable/10/sys/dev/sound/pci/hda/hdac.h Sat Apr 26 00:40:16 2014 (r264958) @@ -155,6 +155,7 @@ /* OEM/subvendors */ /* Intel */ +#define INTEL_DH87RL_SUBVENDOR HDA_MODEL_CONSTRUCT(INTEL, 0x204a) #define INTEL_D101GGC_SUBVENDOR HDA_MODEL_CONSTRUCT(INTEL, 0xd600) /* HP/Compaq */ From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 26 00:51:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A64CD731; Sat, 26 Apr 2014 00:51:08 +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 92F561C92; Sat, 26 Apr 2014 00:51:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3Q0p8RL040229; Sat, 26 Apr 2014 00:51:08 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3Q0p7KK040223; Sat, 26 Apr 2014 00:51:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404260051.s3Q0p7KK040223@svn.freebsd.org> From: Glen Barber Date: Sat, 26 Apr 2014 00:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264959 - stable/10/release/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 00:51:08 -0000 Author: gjb Date: Sat Apr 26 00:51:07 2014 New Revision: 264959 URL: http://svnweb.freebsd.org/changeset/base/264959 Log: MFC r264794: Move xdev knobs from release/arm/release.sh and into an XDEV_FLAGS variable in ${KERNCONF}.conf file. Local changes: Fix XDEV_FLAGS for stable/10 branch, in particular, remove WITH_GCC_BOOTSTRAP=1 and add WITH_GNUCXX=1. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/arm/BEAGLEBONE.conf stable/10/release/arm/PANDABOARD.conf stable/10/release/arm/RPI-B.conf stable/10/release/arm/WANDBOARD-QUAD.conf stable/10/release/arm/ZEDBOARD.conf stable/10/release/arm/release.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/10/release/arm/BEAGLEBONE.conf Sat Apr 26 00:40:16 2014 (r264958) +++ stable/10/release/arm/BEAGLEBONE.conf Sat Apr 26 00:51:07 2014 (r264959) @@ -22,6 +22,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" XDEV="arm" XDEV_ARCH="armv6" +XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="BEAGLEBONE" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" CROCHETBRANCH="trunk" Modified: stable/10/release/arm/PANDABOARD.conf ============================================================================== --- stable/10/release/arm/PANDABOARD.conf Sat Apr 26 00:40:16 2014 (r264958) +++ stable/10/release/arm/PANDABOARD.conf Sat Apr 26 00:51:07 2014 (r264959) @@ -22,6 +22,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" XDEV="arm" XDEV_ARCH="armv6" +XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="PANDABOARD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" CROCHETBRANCH="trunk" Modified: stable/10/release/arm/RPI-B.conf ============================================================================== --- stable/10/release/arm/RPI-B.conf Sat Apr 26 00:40:16 2014 (r264958) +++ stable/10/release/arm/RPI-B.conf Sat Apr 26 00:51:07 2014 (r264959) @@ -22,6 +22,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" XDEV="arm" XDEV_ARCH="armv6" +XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="RPI-B" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" CROCHETBRANCH="trunk" Modified: stable/10/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- stable/10/release/arm/WANDBOARD-QUAD.conf Sat Apr 26 00:40:16 2014 (r264958) +++ stable/10/release/arm/WANDBOARD-QUAD.conf Sat Apr 26 00:51:07 2014 (r264959) @@ -22,6 +22,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" XDEV="arm" XDEV_ARCH="armv6" +XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="WANDBOARD-QUAD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" CROCHETBRANCH="trunk" Modified: stable/10/release/arm/ZEDBOARD.conf ============================================================================== --- stable/10/release/arm/ZEDBOARD.conf Sat Apr 26 00:40:16 2014 (r264958) +++ stable/10/release/arm/ZEDBOARD.conf Sat Apr 26 00:51:07 2014 (r264959) @@ -21,6 +21,7 @@ CHROOTDIR="/scratch" EMBEDDEDBUILD=1 XDEV="arm" XDEV_ARCH="armv6" +XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="ZEDBOARD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" CROCHETBRANCH="trunk" Modified: stable/10/release/arm/release.sh ============================================================================== --- stable/10/release/arm/release.sh Sat Apr 26 00:40:16 2014 (r264958) +++ stable/10/release/arm/release.sh Sat Apr 26 00:51:07 2014 (r264959) @@ -94,8 +94,7 @@ install_uboot() { main() { # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ - WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1 \ - XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ + ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ ${WORLD_FLAGS} xdev # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints From owner-svn-src-stable-10@FreeBSD.ORG Sat Apr 26 01:00:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6B417A10; Sat, 26 Apr 2014 01:00: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 4C3F81D48; Sat, 26 Apr 2014 01:00: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 s3Q10TnP041863; Sat, 26 Apr 2014 01:00:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3Q10SQM041860; Sat, 26 Apr 2014 01:00:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404260100.s3Q10SQM041860@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 Apr 2014 01:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264961 - stable/10/sys/dev/sound/pci/hda X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 01:00:29 -0000 Author: marius Date: Sat Apr 26 01:00:28 2014 New Revision: 264961 URL: http://svnweb.freebsd.org/changeset/base/264961 Log: MFC: r264832 - Sprinkle const and static as appropriate. - Convert the remainder of snd_hda(4) to take advantage of nitems(). - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c stable/10/sys/dev/sound/pci/hda/hdac.c stable/10/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdaa.c Sat Apr 26 00:55:36 2014 (r264960) +++ stable/10/sys/dev/sound/pci/hda/hdaa.c Sat Apr 26 01:00:28 2014 (r264961) @@ -53,7 +53,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define hdaa_lockowned(devinfo) mtx_owned((devinfo)->lock) static const struct { - char *key; + const char *key; uint32_t value; } hdaa_quirks_tab[] = { { "softpcmvol", HDAA_QUIRK_SOFTPCMVOL }, @@ -71,28 +71,26 @@ static const struct { { "ovref", HDAA_QUIRK_OVREF }, { "vref", HDAA_QUIRK_VREF }, }; -#define HDAA_QUIRKS_TAB_LEN \ - (sizeof(hdaa_quirks_tab) / sizeof(hdaa_quirks_tab[0])) #define HDA_PARSE_MAXDEPTH 10 MALLOC_DEFINE(M_HDAA, "hdaa", "HDA Audio"); -const char *HDA_COLORS[16] = {"Unknown", "Black", "Grey", "Blue", "Green", "Red", - "Orange", "Yellow", "Purple", "Pink", "Res.A", "Res.B", "Res.C", "Res.D", - "White", "Other"}; +static const char *HDA_COLORS[16] = {"Unknown", "Black", "Grey", "Blue", + "Green", "Red", "Orange", "Yellow", "Purple", "Pink", "Res.A", "Res.B", + "Res.C", "Res.D", "White", "Other"}; -const char *HDA_DEVS[16] = {"Line-out", "Speaker", "Headphones", "CD", +static const char *HDA_DEVS[16] = {"Line-out", "Speaker", "Headphones", "CD", "SPDIF-out", "Digital-out", "Modem-line", "Modem-handset", "Line-in", "AUX", "Mic", "Telephony", "SPDIF-in", "Digital-in", "Res.E", "Other"}; -const char *HDA_CONNS[4] = {"Jack", "None", "Fixed", "Both"}; +static const char *HDA_CONNS[4] = {"Jack", "None", "Fixed", "Both"}; -const char *HDA_CONNECTORS[16] = { +static const char *HDA_CONNECTORS[16] = { "Unknown", "1/8", "1/4", "ATAPI", "RCA", "Optical", "Digital", "Analog", "DIN", "XLR", "RJ-11", "Combo", "0xc", "0xd", "0xe", "Other" }; -const char *HDA_LOCS[64] = { +static const char *HDA_LOCS[64] = { "0x00", "Rear", "Front", "Left", "Right", "Top", "Bottom", "Rear-panel", "Drive-bay", "0x09", "0x0a", "0x0b", "0x0c", "0x0d", "0x0e", "0x0f", "Internal", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "Riser", @@ -102,10 +100,10 @@ const char *HDA_LOCS[64] = { "Other", "0x31", "0x32", "0x33", "0x34", "0x35", "Other-Bott", "Lid-In", "Lid-Out", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "0x3f" }; -const char *HDA_GPIO_ACTIONS[8] = { +static const char *HDA_GPIO_ACTIONS[8] = { "keep", "set", "clear", "disable", "input", "0x05", "0x06", "0x07"}; -const char *HDA_HDMI_CODING_TYPES[18] = { +static const char *HDA_HDMI_CODING_TYPES[18] = { "undefined", "LPCM", "AC-3", "MPEG1", "MP3", "MPEG2", "AAC-LC", "DTS", "ATRAC", "DSD", "E-AC-3", "DTS-HD", "MLP", "DST", "WMAPro", "HE-AAC", "HE-AACv2", "MPEG-Surround" @@ -1113,7 +1111,7 @@ hdaa_dump_pin_sb(struct sbuf *sb, struct } static void -hdaa_dump_amp_sb(struct sbuf *sb, uint32_t cap, char *banner) +hdaa_dump_amp_sb(struct sbuf *sb, uint32_t cap, const char *banner) { int offset, size, step; @@ -1274,7 +1272,7 @@ hdaa_config_fetch(const char *str, uint3 inv = 2; else inv = 0; - for (k = 0; len > inv && k < HDAA_QUIRKS_TAB_LEN; k++) { + for (k = 0; len > inv && k < nitems(hdaa_quirks_tab); k++) { if (strncmp(str + i + inv, hdaa_quirks_tab[k].key, len - inv) != 0) continue; @@ -1302,7 +1300,7 @@ hdaa_sysctl_quirks(SYSCTL_HANDLER_ARGS) quirks = *(uint32_t *)oidp->oid_arg1; buf[0] = 0; - for (i = 0; i < HDAA_QUIRKS_TAB_LEN; i++) { + for (i = 0; i < nitems(hdaa_quirks_tab); i++) { if ((quirks & hdaa_quirks_tab[i].value) != 0) n += snprintf(buf + n, sizeof(buf) - n, "%s%s", n != 0 ? "," : "", hdaa_quirks_tab[i].key); @@ -1576,7 +1574,7 @@ hdaa_widget_parse(struct hdaa_widget *w) static void hdaa_widget_postprocess(struct hdaa_widget *w) { - char *typestr; + const char *typestr; w->type = HDA_PARAM_AUDIO_WIDGET_CAP_TYPE(w->param.widget_cap); switch (w->type) { @@ -5778,7 +5776,7 @@ hdaa_dump_pin_configs(struct hdaa_devinf } static void -hdaa_dump_amp(device_t dev, uint32_t cap, char *banner) +hdaa_dump_amp(device_t dev, uint32_t cap, const char *banner) { int offset, size, step; @@ -6209,7 +6207,7 @@ hdaa_configure(device_t dev) HDA_BOOTVERBOSE( if (devinfo->quirks != 0) { device_printf(dev, "FG config/quirks:"); - for (i = 0; i < HDAA_QUIRKS_TAB_LEN; i++) { + for (i = 0; i < nitems(hdaa_quirks_tab); i++) { if ((devinfo->quirks & hdaa_quirks_tab[i].value) == hdaa_quirks_tab[i].value) @@ -6834,7 +6832,7 @@ static device_method_t hdaa_methods[] = DEVMETHOD(hdac_stream_intr, hdaa_stream_intr), DEVMETHOD(hdac_unsol_intr, hdaa_unsol_intr), DEVMETHOD(hdac_pindump, hdaa_pindump), - { 0, 0 } + DEVMETHOD_END }; static driver_t hdaa_driver = { @@ -6845,7 +6843,7 @@ static driver_t hdaa_driver = { static devclass_t hdaa_devclass; -DRIVER_MODULE(snd_hda, hdacc, hdaa_driver, hdaa_devclass, 0, 0); +DRIVER_MODULE(snd_hda, hdacc, hdaa_driver, hdaa_devclass, NULL, NULL); static void hdaa_chan_formula(struct hdaa_devinfo *devinfo, int asid, @@ -7143,7 +7141,7 @@ static device_method_t hdaa_pcm_methods[ DEVMETHOD(device_probe, hdaa_pcm_probe), DEVMETHOD(device_attach, hdaa_pcm_attach), DEVMETHOD(device_detach, hdaa_pcm_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t hdaa_pcm_driver = { @@ -7152,6 +7150,6 @@ static driver_t hdaa_pcm_driver = { PCM_SOFTC_SIZE, }; -DRIVER_MODULE(snd_hda_pcm, hdaa, hdaa_pcm_driver, pcm_devclass, 0, 0); +DRIVER_MODULE(snd_hda_pcm, hdaa, hdaa_pcm_driver, pcm_devclass, NULL, NULL); MODULE_DEPEND(snd_hda, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(snd_hda, 1); Modified: stable/10/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.c Sat Apr 26 00:55:36 2014 (r264960) +++ stable/10/sys/dev/sound/pci/hda/hdac.c Sat Apr 26 01:00:28 2014 (r264961) @@ -60,21 +60,19 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDAC_QUIRK_MSI (1 << 2) static const struct { - char *key; + const char *key; uint32_t value; } hdac_quirks_tab[] = { { "64bit", HDAC_QUIRK_DMAPOS }, { "dmapos", HDAC_QUIRK_DMAPOS }, { "msi", HDAC_QUIRK_MSI }, }; -#define HDAC_QUIRKS_TAB_LEN \ - (sizeof(hdac_quirks_tab) / sizeof(hdac_quirks_tab[0])) MALLOC_DEFINE(M_HDAC, "hdac", "HDA Controller"); static const struct { uint32_t model; - char *desc; + const char *desc; char quirks_on; char quirks_off; } hdac_devices[] = { @@ -170,7 +168,6 @@ static const struct { { HDA_SIS_ALL, "SiS", 0, 0 }, { HDA_ULI_ALL, "ULI", 0, 0 }, }; -#define HDAC_DEVICES_LEN (sizeof(hdac_devices) / sizeof(hdac_devices[0])) static const struct { uint16_t vendor; @@ -182,8 +179,6 @@ static const struct { { ATI_VENDORID, 0x42, 0xf8, 0x02 }, { NVIDIA_VENDORID, 0x4e, 0xf0, 0x0f }, }; -#define HDAC_PCIESNOOP_LEN \ - (sizeof(hdac_pcie_snoop) / sizeof(hdac_pcie_snoop[0])) /**************************************************************************** * Function prototypes @@ -254,7 +249,7 @@ hdac_config_fetch(struct hdac_softc *sc, inv = 2; else inv = 0; - for (k = 0; len > inv && k < HDAC_QUIRKS_TAB_LEN; k++) { + for (k = 0; len > inv && k < nitems(hdac_quirks_tab); k++) { if (strncmp(res + i + inv, hdac_quirks_tab[k].key, len - inv) != 0) continue; @@ -1024,7 +1019,7 @@ hdac_probe(device_t dev) bzero(desc, sizeof(desc)); result = ENXIO; - for (i = 0; i < HDAC_DEVICES_LEN; i++) { + for (i = 0; i < nitems(hdac_devices); i++) { if (hdac_devices[i].model == model) { strlcpy(desc, hdac_devices[i].desc, sizeof(desc)); result = BUS_PROBE_DEFAULT; @@ -1096,7 +1091,7 @@ hdac_attach(device_t dev) class = pci_get_class(dev); subclass = pci_get_subclass(dev); - for (i = 0; i < HDAC_DEVICES_LEN; i++) { + for (i = 0; i < nitems(hdac_devices); i++) { if (hdac_devices[i].model == model) { devid = i; break; @@ -1175,7 +1170,7 @@ hdac_attach(device_t dev) * * http://msdn2.microsoft.com/en-us/library/ms790324.aspx */ - for (i = 0; i < HDAC_PCIESNOOP_LEN; i++) { + for (i = 0; i < nitems(hdac_pcie_snoop); i++) { if (hdac_pcie_snoop[i].vendor != vendor) continue; sc->flags &= ~HDAC_F_DMA_NOCACHE; @@ -2078,7 +2073,7 @@ static device_method_t hdac_methods[] = DEVMETHOD(hdac_stream_getptr, hdac_stream_getptr), DEVMETHOD(hdac_unsol_alloc, hdac_unsol_alloc), DEVMETHOD(hdac_unsol_free, hdac_unsol_free), - { 0, 0 } + DEVMETHOD_END }; static driver_t hdac_driver = { @@ -2089,4 +2084,4 @@ static driver_t hdac_driver = { static devclass_t hdac_devclass; -DRIVER_MODULE(snd_hda, pci, hdac_driver, hdac_devclass, 0, 0); +DRIVER_MODULE(snd_hda, pci, hdac_driver, hdac_devclass, NULL, NULL); Modified: stable/10/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdacc.c Sat Apr 26 00:55:36 2014 (r264960) +++ stable/10/sys/dev/sound/pci/hda/hdacc.c Sat Apr 26 01:00:28 2014 (r264961) @@ -71,7 +71,7 @@ MALLOC_DEFINE(M_HDACC, "hdacc", "HDA COD static const struct { uint32_t id; uint16_t revid; - char *name; + const char *name; } hdacc_codecs[] = { { HDA_CODEC_CS4206, 0, "Cirrus Logic CS4206" }, { HDA_CODEC_CS4207, 0, "Cirrus Logic CS4207" }, @@ -341,7 +341,6 @@ static const struct { { HDA_CODEC_STACXXXX, 0, "Sigmatel" }, { HDA_CODEC_VTXXXX, 0, "VIA" }, }; -#define HDACC_CODECS_LEN (sizeof(hdacc_codecs) / sizeof(hdacc_codecs[0])) static int hdacc_suspend(device_t dev) @@ -381,7 +380,7 @@ hdacc_probe(device_t dev) id = ((uint32_t)hda_get_vendor_id(dev) << 16) + hda_get_device_id(dev); revid = ((uint32_t)hda_get_revision_id(dev) << 8) + hda_get_stepping_id(dev); - for (i = 0; i < HDACC_CODECS_LEN; i++) { + for (i = 0; i < nitems(hdacc_codecs); i++) { if (!HDA_DEV_MATCH(hdacc_codecs[i].id, id)) continue; if (hdacc_codecs[i].revid != 0 && @@ -389,7 +388,7 @@ hdacc_probe(device_t dev) continue; break; } - if (i < HDACC_CODECS_LEN) { + if (i < nitems(hdacc_codecs)) { if ((hdacc_codecs[i].id & 0xffff) != 0xffff) strlcpy(buf, hdacc_codecs[i].name, sizeof(buf)); else @@ -713,7 +712,7 @@ static device_method_t hdacc_methods[] = DEVMETHOD(hdac_unsol_free, hdacc_unsol_free), DEVMETHOD(hdac_unsol_intr, hdacc_unsol_intr), DEVMETHOD(hdac_pindump, hdacc_pindump), - { 0, 0 } + DEVMETHOD_END }; static driver_t hdacc_driver = { @@ -724,4 +723,4 @@ static driver_t hdacc_driver = { static devclass_t hdacc_devclass; -DRIVER_MODULE(snd_hda, hdac, hdacc_driver, hdacc_devclass, 0, 0); +DRIVER_MODULE(snd_hda, hdac, hdacc_driver, hdacc_devclass, NULL, NULL); From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 27 01:15:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5198EE06; Sun, 27 Apr 2014 01:15: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 3824B18F0; Sun, 27 Apr 2014 01:15: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 s3R1FG5P051672; Sun, 27 Apr 2014 01:15:16 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R1FASk051640; Sun, 27 Apr 2014 01:15:10 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404270115.s3R1FASk051640@svn.freebsd.org> From: Julio Merino Date: Sun, 27 Apr 2014 01:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r264996 - in stable/10: . bin/pkill bin/pkill/tests etc/mtree sbin sbin/dhclient sbin/dhclient/tests sbin/growfs sbin/growfs/tests sbin/mdconfig sbin/mdconfig/tests sbin/tests tools/bui... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 01:15:16 -0000 Author: jmmv Date: Sun Apr 27 01:15:10 2014 New Revision: 264996 URL: http://svnweb.freebsd.org/changeset/base/264996 Log: MFC various moves of tools/regressions/ tests to the new infrastructure. - r263220 Migrate tools/regression/sbin/ to the new tests layout. - r263222 Add Makefile missed in r263220. - r263226 Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout. - r263227 Migrate most of tools/regression/usr.bin/ to the new tests layout. - r263345 Expand tabs that sneaked in into spaces. - r263346 Migrate tools/regression/usr.bin/make/ to the new tests layout. - r263348 Add Makefiles missed in r263346. - r263351 Migrate tools/regression/usr.bin/pkill/ to the new tests layout. - r263388 Mark multi_test as requiring /usr/share/dict/words. - r263814 Fix path to the run.pl script to let these tests run. - r264742 Prevent building tests when bootstrapping make. This is 'make tinderbox' clean. Added: stable/10/bin/pkill/tests/ - copied from r263351, head/bin/pkill/tests/ stable/10/sbin/dhclient/tests/ - copied from r263220, head/sbin/dhclient/tests/ stable/10/sbin/growfs/tests/ - copied from r263220, head/sbin/growfs/tests/ stable/10/sbin/mdconfig/tests/ - copied from r263220, head/sbin/mdconfig/tests/ stable/10/sbin/mdconfig/tests/Makefile - copied unchanged from r263222, head/sbin/mdconfig/tests/Makefile stable/10/sbin/tests/ - copied from r263220, head/sbin/tests/ stable/10/usr.bin/apply/tests/ - copied from r263227, head/usr.bin/apply/tests/ stable/10/usr.bin/calendar/tests/ - copied from r263227, head/usr.bin/calendar/tests/ stable/10/usr.bin/comm/tests/ - copied from r263227, head/usr.bin/comm/tests/ stable/10/usr.bin/file2c/tests/ - copied from r263227, head/usr.bin/file2c/tests/ stable/10/usr.bin/join/tests/ - copied from r263227, head/usr.bin/join/tests/ stable/10/usr.bin/jot/tests/ - copied from r263227, head/usr.bin/jot/tests/ stable/10/usr.bin/lastcomm/tests/ - copied from r263226, head/usr.bin/lastcomm/tests/ stable/10/usr.bin/m4/tests/ - copied from r263227, head/usr.bin/m4/tests/ stable/10/usr.bin/make/tests/ - copied from r263346, head/usr.bin/make/tests/ stable/10/usr.bin/make/tests/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/Makefile stable/10/usr.bin/make/tests/archives/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/archives/Makefile stable/10/usr.bin/make/tests/archives/fmt_44bsd/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/archives/fmt_44bsd/Makefile stable/10/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile stable/10/usr.bin/make/tests/archives/fmt_oldbsd/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile stable/10/usr.bin/make/tests/basic/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/basic/Makefile stable/10/usr.bin/make/tests/basic/t0/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/basic/t0/Makefile stable/10/usr.bin/make/tests/basic/t1/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/basic/t1/Makefile stable/10/usr.bin/make/tests/basic/t2/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/basic/t2/Makefile stable/10/usr.bin/make/tests/basic/t3/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/basic/t3/Makefile stable/10/usr.bin/make/tests/execution/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/execution/Makefile stable/10/usr.bin/make/tests/execution/ellipsis/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/execution/ellipsis/Makefile stable/10/usr.bin/make/tests/execution/empty/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/execution/empty/Makefile stable/10/usr.bin/make/tests/execution/joberr/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/execution/joberr/Makefile stable/10/usr.bin/make/tests/execution/plus/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/execution/plus/Makefile stable/10/usr.bin/make/tests/shell/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/shell/Makefile stable/10/usr.bin/make/tests/shell/builtin/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/shell/builtin/Makefile stable/10/usr.bin/make/tests/shell/meta/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/shell/meta/Makefile stable/10/usr.bin/make/tests/shell/path/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/shell/path/Makefile stable/10/usr.bin/make/tests/shell/path_select/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/shell/path_select/Makefile stable/10/usr.bin/make/tests/shell/replace/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/shell/replace/Makefile stable/10/usr.bin/make/tests/shell/select/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/shell/select/Makefile stable/10/usr.bin/make/tests/suffixes/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/suffixes/Makefile stable/10/usr.bin/make/tests/suffixes/basic/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/suffixes/basic/Makefile stable/10/usr.bin/make/tests/suffixes/src_wild1/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/suffixes/src_wild1/Makefile stable/10/usr.bin/make/tests/suffixes/src_wild2/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/suffixes/src_wild2/Makefile stable/10/usr.bin/make/tests/syntax/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/syntax/Makefile stable/10/usr.bin/make/tests/syntax/directive-t0/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/syntax/directive-t0/Makefile stable/10/usr.bin/make/tests/syntax/enl/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/syntax/enl/Makefile stable/10/usr.bin/make/tests/syntax/funny-targets/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/syntax/funny-targets/Makefile stable/10/usr.bin/make/tests/syntax/semi/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/syntax/semi/Makefile stable/10/usr.bin/make/tests/sysmk/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/Makefile stable/10/usr.bin/make/tests/sysmk/t0/2/1/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t0/2/1/Makefile stable/10/usr.bin/make/tests/sysmk/t0/2/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t0/2/Makefile stable/10/usr.bin/make/tests/sysmk/t0/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t0/Makefile stable/10/usr.bin/make/tests/sysmk/t0/mk/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t0/mk/Makefile stable/10/usr.bin/make/tests/sysmk/t1/2/1/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t1/2/1/Makefile stable/10/usr.bin/make/tests/sysmk/t1/2/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t1/2/Makefile stable/10/usr.bin/make/tests/sysmk/t1/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t1/Makefile stable/10/usr.bin/make/tests/sysmk/t1/mk/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t1/mk/Makefile stable/10/usr.bin/make/tests/sysmk/t2/2/1/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t2/2/1/Makefile stable/10/usr.bin/make/tests/sysmk/t2/2/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t2/2/Makefile stable/10/usr.bin/make/tests/sysmk/t2/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t2/Makefile stable/10/usr.bin/make/tests/sysmk/t2/mk/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/sysmk/t2/mk/Makefile stable/10/usr.bin/make/tests/variables/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/variables/Makefile stable/10/usr.bin/make/tests/variables/modifier_M/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/variables/modifier_M/Makefile stable/10/usr.bin/make/tests/variables/modifier_t/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/variables/modifier_t/Makefile stable/10/usr.bin/make/tests/variables/opt_V/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/variables/opt_V/Makefile stable/10/usr.bin/make/tests/variables/t0/Makefile - copied unchanged from r263348, head/usr.bin/make/tests/variables/t0/Makefile stable/10/usr.bin/ncal/tests/ - copied from r263227, head/usr.bin/ncal/tests/ stable/10/usr.bin/printf/tests/ - copied from r263227, head/usr.bin/printf/tests/ stable/10/usr.bin/sed/tests/ - copied from r263227, head/usr.bin/sed/tests/ stable/10/usr.bin/tests/regress.m4 - copied unchanged from r263227, head/usr.bin/tests/regress.m4 stable/10/usr.bin/tr/tests/ - copied from r263227, head/usr.bin/tr/tests/ stable/10/usr.bin/uudecode/tests/ - copied from r263227, head/usr.bin/uudecode/tests/ stable/10/usr.bin/uuencode/tests/ - copied from r263227, head/usr.bin/uuencode/tests/ stable/10/usr.bin/xargs/tests/ - copied from r263227, head/usr.bin/xargs/tests/ stable/10/usr.bin/yacc/tests/ - copied from r263227, head/usr.bin/yacc/tests/ stable/10/usr.sbin/etcupdate/tests/ - copied from r263226, head/usr.sbin/etcupdate/tests/ stable/10/usr.sbin/newsyslog/tests/ - copied from r263226, head/usr.sbin/newsyslog/tests/ stable/10/usr.sbin/sa/tests/ - copied from r263226, head/usr.sbin/sa/tests/ stable/10/usr.sbin/tests/ - copied from r263226, head/usr.sbin/tests/ Deleted: stable/10/tools/regression/sbin/ stable/10/tools/regression/usr.bin/Makefile stable/10/tools/regression/usr.bin/apply/ stable/10/tools/regression/usr.bin/calendar/ stable/10/tools/regression/usr.bin/comm/ stable/10/tools/regression/usr.bin/file2c/ stable/10/tools/regression/usr.bin/join/ stable/10/tools/regression/usr.bin/jot/ stable/10/tools/regression/usr.bin/lastcomm/ stable/10/tools/regression/usr.bin/m4/ stable/10/tools/regression/usr.bin/make/ stable/10/tools/regression/usr.bin/ncal/ stable/10/tools/regression/usr.bin/pkill/ stable/10/tools/regression/usr.bin/printf/ stable/10/tools/regression/usr.bin/regress.m4 stable/10/tools/regression/usr.bin/sed/ stable/10/tools/regression/usr.bin/tr/ stable/10/tools/regression/usr.bin/uudecode/ stable/10/tools/regression/usr.bin/uuencode/ stable/10/tools/regression/usr.bin/xargs/ stable/10/tools/regression/usr.bin/yacc/ stable/10/tools/regression/usr.sbin/ Modified: stable/10/Makefile stable/10/bin/pkill/Makefile stable/10/etc/mtree/BSD.tests.dist stable/10/sbin/Makefile stable/10/sbin/dhclient/Makefile stable/10/sbin/growfs/Makefile stable/10/sbin/mdconfig/Makefile stable/10/sbin/mdconfig/tests/legacy_test.sh stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.bin/apply/Makefile stable/10/usr.bin/calendar/Makefile stable/10/usr.bin/comm/Makefile stable/10/usr.bin/file2c/Makefile stable/10/usr.bin/join/Makefile stable/10/usr.bin/jot/Makefile stable/10/usr.bin/lastcomm/Makefile stable/10/usr.bin/m4/Makefile stable/10/usr.bin/make/Makefile stable/10/usr.bin/ncal/Makefile stable/10/usr.bin/printf/Makefile stable/10/usr.bin/sed/Makefile stable/10/usr.bin/sed/tests/Makefile stable/10/usr.bin/tests/Makefile stable/10/usr.bin/tr/Makefile stable/10/usr.bin/uudecode/Makefile stable/10/usr.bin/uuencode/Makefile stable/10/usr.bin/xargs/Makefile stable/10/usr.bin/yacc/Makefile stable/10/usr.sbin/Makefile stable/10/usr.sbin/etcupdate/Makefile stable/10/usr.sbin/newsyslog/Makefile stable/10/usr.sbin/sa/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile ============================================================================== --- stable/10/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -345,7 +345,8 @@ MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ MMAKE= ${MMAKEENV} ${MAKE} \ -D_UPGRADING \ -DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WERROR DESTDIR= PROGNAME=${MYMAKE:T} + -DNO_CPU_CFLAGS -DNO_WERROR \ + DESTDIR= MK_TESTS=no PROGNAME=${MYMAKE:T} make bmake: .PHONY @echo Modified: stable/10/bin/pkill/Makefile ============================================================================== --- stable/10/bin/pkill/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/bin/pkill/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -1,6 +1,8 @@ # $NetBSD: Makefile,v 1.1 2002/03/01 11:21:58 ad Exp $ # $FreeBSD$ +.include + PROG= pkill DPADD= ${LIBKVM} @@ -17,4 +19,8 @@ MLINKS= pkill.1 pgrep.1 SYMLINKS= ${BINDIR}/pkill /usr/bin/pkill SYMLINKS+= ${BINDIR}/pgrep /usr/bin/pgrep +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/etc/mtree/BSD.tests.dist Sun Apr 27 01:15:10 2014 (r264996) @@ -29,6 +29,8 @@ .. pax .. + pkill + .. sh builtins .. @@ -70,6 +72,14 @@ .. .. .. + sbin + dhclient + .. + growfs + .. + mdconfig + .. + .. share examples tests @@ -85,10 +95,150 @@ .. .. usr.bin + apply + .. atf atf-sh .. .. + calendar + .. + comm + .. + file2c + .. + join + .. + jot + .. + lastcomm + .. + m4 + .. + make + archives + fmt_44bsd + .. + fmt_44bsd_mod + .. + fmt_oldbsd + .. + .. + basic + t0 + .. + t1 + .. + t2 + .. + t3 + .. + .. + execution + ellipsis + .. + empty + .. + joberr + .. + plus + .. + .. + shell + builtin + .. + meta + .. + path + .. + path_select + .. + replace + .. + select + .. + .. + suffixes + basic + .. + src_wild1 + .. + src_wild2 + .. + .. + syntax + directive-t0 + .. + enl + .. + funny-targets + .. + semi + .. + .. + sysmk + t0 + 2 + 1 + .. + .. + mk + .. + .. + t1 + 2 + 1 + .. + .. + mk + .. + .. + t2 + 2 + 1 + .. + .. + mk + .. + .. + .. + variables + modifier_M + .. + modifier_t + .. + opt_V + .. + t0 + .. + .. + .. + ncal + .. + printf + .. + sed + regress.multitest.out + .. + .. + tr + .. + uudecode + .. + uuencode + .. + xargs + .. + yacc + .. + .. + usr.sbin + etcupdate + .. + newsyslog + .. + sa + .. .. .. .. Modified: stable/10/sbin/Makefile ============================================================================== --- stable/10/sbin/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/sbin/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -114,6 +114,10 @@ SUBDIR+= quotacheck SUBDIR+= routed .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include SUBDIR:= ${SUBDIR:O} Modified: stable/10/sbin/dhclient/Makefile ============================================================================== --- stable/10/sbin/dhclient/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/sbin/dhclient/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -31,6 +31,8 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. # +.include + SRCS= dhclient.c clparse.c alloc.c dispatch.c hash.c bpf.c options.c \ tree.c conflex.c errwarn.c inet.c packet.c convert.c tables.c \ parse.c privsep.c @@ -44,4 +46,8 @@ LDADD= -lutil WARNS?= 2 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/sbin/growfs/Makefile ============================================================================== --- stable/10/sbin/growfs/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/sbin/growfs/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -6,6 +6,8 @@ #GFSDBG= +.include + .PATH: ${.CURDIR}/../mount PROG= growfs @@ -20,4 +22,8 @@ SRCS+= debug.c DPADD= ${LIBUTIL} LDADD= -lutil +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/sbin/mdconfig/Makefile ============================================================================== --- stable/10/sbin/mdconfig/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/sbin/mdconfig/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -1,9 +1,15 @@ # $FreeBSD$ +.include + PROG= mdconfig MAN= mdconfig.8 DPADD= ${LIBUTIL} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} LDADD= -lutil -lgeom -lbsdxml -lsbuf +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Copied: stable/10/sbin/mdconfig/tests/Makefile (from r263222, head/sbin/mdconfig/tests/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sbin/mdconfig/tests/Makefile Sun Apr 27 01:15:10 2014 (r264996, copy of r263222, head/sbin/mdconfig/tests/Makefile) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sbin/mdconfig + +TAP_TESTS_SH= legacy_test +TAP_TESTS_SH_SED_legacy_test= 's,__PERL__,${TAP_PERL_INTERPRETER},g' +TEST_METADATA.legacy_test+= required_programs="${TAP_PERL_INTERPRETER}" + +FILESDIR= ${TESTSDIR} +FILES= mdconfig.test +FILES+= run.pl + +.include Modified: stable/10/sbin/mdconfig/tests/legacy_test.sh ============================================================================== --- head/sbin/mdconfig/tests/legacy_test.sh Sun Mar 16 02:07:08 2014 (r263220) +++ stable/10/sbin/mdconfig/tests/legacy_test.sh Sun Apr 27 01:15:10 2014 (r264996) @@ -38,7 +38,7 @@ fi TESTDIR=$(dirname $(realpath $0)) -__PERL__ -w -U $TESTDIR/run $TESTDIR/mdconfig.test > /dev/null +__PERL__ -w -U $TESTDIR/run.pl $TESTDIR/mdconfig.test > /dev/null if [ $? -eq 0 ]; then echo "ok 1" Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sun Apr 27 01:15:10 2014 (r264996) @@ -4092,6 +4092,376 @@ OLD_FILES+=usr/tests/lib/atf/libatf-c/pr OLD_FILES+=usr/tests/lib/atf/libatf-c/sanity_test OLD_FILES+=usr/tests/lib/atf/libatf-c/text_test OLD_FILES+=usr/tests/lib/atf/libatf-c/user_test +.if ${MK_MAKE} == yes && ${MK_BMAKE} == yes +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/libtest.a +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/libtest.a +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/libtest.a +OLD_FILES+=usr/tests/usr.bin/make/archives/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/basic/t0/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/basic/t0/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/basic/t0/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t0/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t0/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t3/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/basic/t3/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/basic/t3/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t3/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t3/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/sh +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/sh +OLD_FILES+=usr/tests/usr.bin/make/shell/path/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/path/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/path/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/sh +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/shell +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/shell +OLD_FILES+=usr/tests/usr.bin/make/shell/select/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/select/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/select/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/TEST1.a +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/TEST1.a +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/TEST2.a +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/TEST1.a +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/TEST2.a +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.status.3 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.status.4 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.status.5 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stderr.3 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stderr.4 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stderr.5 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stdout.3 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stdout.4 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stdout.5 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/mk/sys.mk +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/mk/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/cleanup +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/mk/sys.mk +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/mk/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/cleanup +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/mk/sys.mk +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/mk/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.status.3 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stderr.3 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stdout.3 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/common.sh +OLD_FILES+=usr/tests/usr.bin/make/test-new.mk +OLD_DIRS+=usr/tests/usr.bin/make/variables/t0 +OLD_DIRS+=usr/tests/usr.bin/make/variables/opt_V +OLD_DIRS+=usr/tests/usr.bin/make/variables/modifier_t +OLD_DIRS+=usr/tests/usr.bin/make/variables/modifier_M +OLD_DIRS+=usr/tests/usr.bin/make/variables +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t2/mk +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t2/2/1 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t2/2 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t2 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t1/mk +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t1/2/1 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t1/2 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t1 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t0/mk +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t0/2/1 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t0/2 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t0 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk +OLD_DIRS+=usr/tests/usr.bin/make/syntax/semi +OLD_DIRS+=usr/tests/usr.bin/make/syntax/funny-targets +OLD_DIRS+=usr/tests/usr.bin/make/syntax/enl +OLD_DIRS+=usr/tests/usr.bin/make/syntax/directive-t0 +OLD_DIRS+=usr/tests/usr.bin/make/syntax +OLD_DIRS+=usr/tests/usr.bin/make/suffixes/src_wild2 +OLD_DIRS+=usr/tests/usr.bin/make/suffixes/src_wild1 +OLD_DIRS+=usr/tests/usr.bin/make/suffixes/basic +OLD_DIRS+=usr/tests/usr.bin/make/suffixes +OLD_DIRS+=usr/tests/usr.bin/make/shell/select +OLD_DIRS+=usr/tests/usr.bin/make/shell/replace +OLD_DIRS+=usr/tests/usr.bin/make/shell/path_select +OLD_DIRS+=usr/tests/usr.bin/make/shell/path +OLD_DIRS+=usr/tests/usr.bin/make/shell/meta +OLD_DIRS+=usr/tests/usr.bin/make/shell/builtin +OLD_DIRS+=usr/tests/usr.bin/make/shell +OLD_DIRS+=usr/tests/usr.bin/make/execution/plus +OLD_DIRS+=usr/tests/usr.bin/make/execution/joberr +OLD_DIRS+=usr/tests/usr.bin/make/execution/empty +OLD_DIRS+=usr/tests/usr.bin/make/execution/ellipsis +OLD_DIRS+=usr/tests/usr.bin/make/execution +OLD_DIRS+=usr/tests/usr.bin/make/basic/t3 +OLD_DIRS+=usr/tests/usr.bin/make/basic/t2 +OLD_DIRS+=usr/tests/usr.bin/make/basic/t1 +OLD_DIRS+=usr/tests/usr.bin/make/basic/t0 +OLD_DIRS+=usr/tests/usr.bin/make/basic +OLD_DIRS+=usr/tests/usr.bin/make/archives/fmt_oldbsd +OLD_DIRS+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod +OLD_DIRS+=usr/tests/usr.bin/make/archives/fmt_44bsd +OLD_DIRS+=usr/tests/usr.bin/make/archives +OLD_DIRS+=usr/tests/usr.bin/make +.endif .else # ATF libraries. OLD_FILES+=usr/bin/atf-sh Modified: stable/10/usr.bin/apply/Makefile ============================================================================== --- stable/10/usr.bin/apply/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/usr.bin/apply/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -1,8 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= apply DPADD= ${LIBSBUF} LDADD= -lsbuf +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/calendar/Makefile ============================================================================== --- stable/10/usr.bin/calendar/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/usr.bin/calendar/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= calendar SRCS= calendar.c locale.c events.c dates.c parsedata.c io.c day.c \ ostern.c paskha.c pom.c sunpos.c calcpp.c @@ -31,4 +33,8 @@ beforeinstall: ln -s fr_FR.ISO8859-1 ${DESTDIR}${SHAREDIR}/calendar/${link} .endfor +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/comm/Makefile ============================================================================== --- stable/10/usr.bin/comm/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/usr.bin/comm/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -1,6 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= comm +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/file2c/Makefile ============================================================================== --- stable/10/usr.bin/file2c/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/usr.bin/file2c/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -1,4 +1,11 @@ # $FreeBSD$ +.include + PROG= file2c + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/join/Makefile ============================================================================== --- stable/10/usr.bin/join/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/usr.bin/join/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -1,5 +1,12 @@ +# $FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +.include + PROG= join +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/jot/Makefile ============================================================================== --- stable/10/usr.bin/jot/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/usr.bin/jot/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -1,6 +1,12 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= jot +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/lastcomm/Makefile ============================================================================== --- stable/10/usr.bin/lastcomm/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/usr.bin/lastcomm/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -1,7 +1,13 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= lastcomm SRCS= lastcomm.c readrec.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/m4/Makefile ============================================================================== --- stable/10/usr.bin/m4/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/usr.bin/m4/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -4,6 +4,8 @@ # -DEXTENDED # if you want the paste & spaste macros. +.include + PROG= m4 CFLAGS+=-DEXTENDED -I${.CURDIR} -I${.CURDIR}/lib DPADD= ${LIBY} ${LIBL} ${LIBM} @@ -22,4 +24,8 @@ tokenizer.o: parser.h CLEANFILES+= parser.c parser.h tokenizer.o +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.bin/make/Makefile ============================================================================== --- stable/10/usr.bin/make/Makefile Sun Apr 27 01:06:02 2014 (r264995) +++ stable/10/usr.bin/make/Makefile Sun Apr 27 01:15:10 2014 (r264996) @@ -118,4 +118,8 @@ fmake.1: make.1 cp ${.ALLSRC} ${.TARGET} .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Copied: stable/10/usr.bin/make/tests/Makefile (from r263348, head/usr.bin/make/tests/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/make/tests/Makefile Sun Apr 27 01:15:10 2014 (r264996, copy of r263348, head/usr.bin/make/tests/Makefile) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make + +FILESDIR= ${TESTSDIR} +FILES= common.sh +FILES+= test-new.mk + +TESTS_SUBDIRS= archives +TESTS_SUBDIRS+= basic +TESTS_SUBDIRS+= execution +TESTS_SUBDIRS+= shell +TESTS_SUBDIRS+= suffixes +TESTS_SUBDIRS+= syntax +TESTS_SUBDIRS+= sysmk +TESTS_SUBDIRS+= variables + +.include Copied: stable/10/usr.bin/make/tests/archives/Makefile (from r263348, head/usr.bin/make/tests/archives/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/make/tests/archives/Makefile Sun Apr 27 01:15:10 2014 (r264996, copy of r263348, head/usr.bin/make/tests/archives/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/archives + +TESTS_SUBDIRS= fmt_44bsd fmt_44bsd_mod fmt_oldbsd + +.include Copied: stable/10/usr.bin/make/tests/archives/fmt_44bsd/Makefile (from r263348, head/usr.bin/make/tests/archives/fmt_44bsd/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/make/tests/archives/fmt_44bsd/Makefile Sun Apr 27 01:15:10 2014 (r264996, copy of r263348, head/usr.bin/make/tests/archives/fmt_44bsd/Makefile) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/archives/fmt_44bsd + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.status.3 +FILES+= expected.status.4 +FILES+= expected.status.5 +FILES+= expected.status.6 +FILES+= expected.status.7 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stderr.3 +FILES+= expected.stderr.4 +FILES+= expected.stderr.5 +FILES+= expected.stderr.6 +FILES+= expected.stderr.7 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= expected.stdout.3 +FILES+= expected.stdout.4 +FILES+= expected.stdout.5 +FILES+= expected.stdout.6 +FILES+= expected.stdout.7 +FILES+= libtest.a + +.include Copied: stable/10/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile (from r263348, head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile Sun Apr 27 01:15:10 2014 (r264996, copy of r263348, head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/archives/fmt_44bsd_mod + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.status.3 +FILES+= expected.status.4 +FILES+= expected.status.5 +FILES+= expected.status.6 +FILES+= expected.status.7 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stderr.3 +FILES+= expected.stderr.4 +FILES+= expected.stderr.5 +FILES+= expected.stderr.6 +FILES+= expected.stderr.7 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= expected.stdout.3 +FILES+= expected.stdout.4 +FILES+= expected.stdout.5 +FILES+= expected.stdout.6 +FILES+= expected.stdout.7 +FILES+= libtest.a + +.include Copied: stable/10/usr.bin/make/tests/archives/fmt_oldbsd/Makefile (from r263348, head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/make/tests/archives/fmt_oldbsd/Makefile Sun Apr 27 01:15:10 2014 (r264996, copy of r263348, head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/archives/fmt_oldbsd + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.status.3 +FILES+= expected.status.4 +FILES+= expected.status.5 +FILES+= expected.status.6 +FILES+= expected.status.7 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stderr.3 +FILES+= expected.stderr.4 +FILES+= expected.stderr.5 +FILES+= expected.stderr.6 +FILES+= expected.stderr.7 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= expected.stdout.3 +FILES+= expected.stdout.4 +FILES+= expected.stdout.5 +FILES+= expected.stdout.6 +FILES+= expected.stdout.7 +FILES+= libtest.a + +.include Copied: stable/10/usr.bin/make/tests/basic/Makefile (from r263348, head/usr.bin/make/tests/basic/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/make/tests/basic/Makefile Sun Apr 27 01:15:10 2014 (r264996, copy of r263348, head/usr.bin/make/tests/basic/Makefile) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/basic + +TESTS_SUBDIRS= t0 t1 t2 t3 + +.include Copied: stable/10/usr.bin/make/tests/basic/t0/Makefile (from r263348, head/usr.bin/make/tests/basic/t0/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/make/tests/basic/t0/Makefile Sun Apr 27 01:15:10 2014 (r264996, copy of r263348, head/usr.bin/make/tests/basic/t0/Makefile) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/basic/t0 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Copied: stable/10/usr.bin/make/tests/basic/t1/Makefile (from r263348, head/usr.bin/make/tests/basic/t1/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/make/tests/basic/t1/Makefile Sun Apr 27 01:15:10 2014 (r264996, copy of r263348, head/usr.bin/make/tests/basic/t1/Makefile) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/basic/t1 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sun Apr 27 09:05:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E81E06B6; Sun, 27 Apr 2014 09:05: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 D402C1D03; Sun, 27 Apr 2014 09:05: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 s3R95Z23043738; Sun, 27 Apr 2014 09:05:35 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R95ZeT043735; Sun, 27 Apr 2014 09:05:35 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201404270905.s3R95ZeT043735@svn.freebsd.org> From: Martin Matuska Date: Sun, 27 Apr 2014 09:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265008 - in stable/10/sys: net netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 09:05:36 -0000 Author: mm Date: Sun Apr 27 09:05:34 2014 New Revision: 265008 URL: http://svnweb.freebsd.org/changeset/base/265008 Log: MFC r264689: De-virtualize UMA zone pf_mtag_z and move to global initialization part. The m_tag struct does not know about vnet context and the pf_mtag_free() callback is called unaware of current vnet. This causes a panic. PR: kern/182964 Modified: stable/10/sys/net/pfvar.h stable/10/sys/netpfil/pf/pf.c stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/pfvar.h ============================================================================== --- stable/10/sys/net/pfvar.h Sun Apr 27 08:22:44 2014 (r265007) +++ stable/10/sys/net/pfvar.h Sun Apr 27 09:05:34 2014 (r265008) @@ -1531,6 +1531,8 @@ VNET_DECLARE(struct pf_rulequeue, pf_unl #define V_pf_unlinked_rules VNET(pf_unlinked_rules) void pf_initialize(void); +void pf_mtag_initialize(void); +void pf_mtag_cleanup(void); void pf_cleanup(void); struct pf_mtag *pf_get_mtag(struct mbuf *); Modified: stable/10/sys/netpfil/pf/pf.c ============================================================================== --- stable/10/sys/netpfil/pf/pf.c Sun Apr 27 08:22:44 2014 (r265007) +++ stable/10/sys/netpfil/pf/pf.c Sun Apr 27 09:05:34 2014 (r265008) @@ -186,8 +186,7 @@ struct mtx pf_unlnkdrules_mtx; static VNET_DEFINE(uma_zone_t, pf_sources_z); #define V_pf_sources_z VNET(pf_sources_z) -static VNET_DEFINE(uma_zone_t, pf_mtag_z); -#define V_pf_mtag_z VNET(pf_mtag_z) +uma_zone_t pf_mtag_z; VNET_DEFINE(uma_zone_t, pf_state_z); VNET_DEFINE(uma_zone_t, pf_state_key_z); @@ -282,7 +281,7 @@ static int pf_insert_src_node(struct p struct pf_rule *, struct pf_addr *, sa_family_t); static u_int pf_purge_expired_states(u_int, int); static void pf_purge_unlinked_rules(void); -static int pf_mtag_init(void *, int, int); +static int pf_mtag_uminit(void *, int, int); static void pf_mtag_free(struct m_tag *); #ifdef INET static void pf_route(struct mbuf **, struct pf_rule *, int, @@ -727,7 +726,16 @@ pf_free_src_nodes(struct pf_src_node_lis return (count); } -/* Data storage structures initialization. */ +void +pf_mtag_initialize() +{ + + pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) + + sizeof(struct pf_mtag), NULL, NULL, pf_mtag_uminit, NULL, + UMA_ALIGN_PTR, 0); +} + +/* Per-vnet data storage structures initialization. */ void pf_initialize() { @@ -786,10 +794,6 @@ pf_initialize() V_pf_altqs_active = &V_pf_altqs[0]; V_pf_altqs_inactive = &V_pf_altqs[1]; - /* Mbuf tags */ - V_pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) + - sizeof(struct pf_mtag), NULL, NULL, pf_mtag_init, NULL, - UMA_ALIGN_PTR, 0); /* Send & overload+flush queues. */ STAILQ_INIT(&V_pf_sendqueue); @@ -805,6 +809,13 @@ pf_initialize() } void +pf_mtag_cleanup() +{ + + uma_zdestroy(pf_mtag_z); +} + +void pf_cleanup() { struct pf_keyhash *kh; @@ -841,14 +852,13 @@ pf_cleanup() mtx_destroy(&pf_overloadqueue_mtx); mtx_destroy(&pf_unlnkdrules_mtx); - uma_zdestroy(V_pf_mtag_z); uma_zdestroy(V_pf_sources_z); uma_zdestroy(V_pf_state_z); uma_zdestroy(V_pf_state_key_z); } static int -pf_mtag_init(void *mem, int size, int how) +pf_mtag_uminit(void *mem, int size, int how) { struct m_tag *t; @@ -865,7 +875,7 @@ static void pf_mtag_free(struct m_tag *t) { - uma_zfree(V_pf_mtag_z, t); + uma_zfree(pf_mtag_z, t); } struct pf_mtag * @@ -876,7 +886,7 @@ pf_get_mtag(struct mbuf *m) if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) != NULL) return ((struct pf_mtag *)(mtag + 1)); - mtag = uma_zalloc(V_pf_mtag_z, M_NOWAIT); + mtag = uma_zalloc(pf_mtag_z, M_NOWAIT); if (mtag == NULL) return (NULL); bzero(mtag + 1, sizeof(struct pf_mtag)); Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Sun Apr 27 08:22:44 2014 (r265007) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Sun Apr 27 09:05:34 2014 (r265008) @@ -204,6 +204,8 @@ pfattach(void) u_int32_t *my_timeout = V_pf_default_rule.timeout; int error; + if (IS_DEFAULT_VNET(curvnet)) + pf_mtag_initialize(); pf_initialize(); pfr_initialize(); pfi_initialize(); @@ -3721,6 +3723,8 @@ pf_unload(void) pfr_cleanup(); pf_osfp_flush(); pf_cleanup(); + if (IS_DEFAULT_VNET(curvnet)) + pf_mtag_cleanup(); PF_RULES_WUNLOCK(); destroy_dev(pf_dev); rw_destroy(&pf_rules_lock); From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 28 04:20:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 77199725; Mon, 28 Apr 2014 04:20: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 608E91527; Mon, 28 Apr 2014 04:20: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 s3S4KIBd022478; Mon, 28 Apr 2014 04:20:18 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3S4KE7n022458; Mon, 28 Apr 2014 04:20:14 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404280420.s3S4KE7n022458@svn.freebsd.org> From: Julio Merino Date: Mon, 28 Apr 2014 04:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265037 - in stable/10: cddl cddl/lib cddl/lib/tests cddl/sbin cddl/sbin/tests cddl/tests cddl/usr.bin cddl/usr.bin/tests cddl/usr.sbin cddl/usr.sbin/tests etc etc/mtree etc/tests games... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 04:20:18 -0000 Author: jmmv Date: Mon Apr 28 04:20:14 2014 New Revision: 265037 URL: http://svnweb.freebsd.org/changeset/base/265037 Log: MFC r264741: Add placeholder Kyuafiles for various top-level hierarchies. This is "make tinderbox" clean. Added: stable/10/cddl/lib/tests/ - copied from r264741, head/cddl/lib/tests/ stable/10/cddl/sbin/tests/ - copied from r264741, head/cddl/sbin/tests/ stable/10/cddl/tests/ - copied from r264741, head/cddl/tests/ stable/10/cddl/usr.bin/tests/ - copied from r264741, head/cddl/usr.bin/tests/ stable/10/cddl/usr.sbin/tests/ - copied from r264741, head/cddl/usr.sbin/tests/ stable/10/etc/tests/ - copied from r264741, head/etc/tests/ stable/10/games/tests/ - copied from r264741, head/games/tests/ stable/10/gnu/lib/tests/ - copied from r264741, head/gnu/lib/tests/ stable/10/gnu/tests/ - copied from r264741, head/gnu/tests/ stable/10/gnu/usr.bin/tests/ - copied from r264741, head/gnu/usr.bin/tests/ stable/10/secure/lib/tests/ - copied from r264741, head/secure/lib/tests/ stable/10/secure/libexec/tests/ - copied from r264741, head/secure/libexec/tests/ stable/10/secure/tests/ - copied from r264741, head/secure/tests/ stable/10/secure/usr.bin/tests/ - copied from r264741, head/secure/usr.bin/tests/ stable/10/secure/usr.sbin/tests/ - copied from r264741, head/secure/usr.sbin/tests/ Modified: stable/10/cddl/Makefile stable/10/cddl/lib/Makefile stable/10/cddl/sbin/Makefile stable/10/cddl/usr.bin/Makefile stable/10/cddl/usr.sbin/Makefile stable/10/etc/Makefile stable/10/etc/mtree/BSD.tests.dist stable/10/games/Makefile stable/10/gnu/Makefile stable/10/gnu/lib/Makefile stable/10/gnu/usr.bin/Makefile stable/10/secure/Makefile stable/10/secure/lib/Makefile stable/10/secure/libexec/Makefile stable/10/secure/usr.bin/Makefile stable/10/secure/usr.sbin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/Makefile ============================================================================== --- stable/10/cddl/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/cddl/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -1,5 +1,11 @@ # $FreeBSD$ +.include + SUBDIR= lib sbin usr.bin usr.sbin +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include Modified: stable/10/cddl/lib/Makefile ============================================================================== --- stable/10/cddl/lib/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/cddl/lib/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -11,7 +11,12 @@ SUBDIR= ${_drti} \ libuutil \ ${_libzfs_core} \ ${_libzfs} \ - ${_libzpool} + ${_libzpool} \ + ${_tests} + +.if ${MK_TESTS} != "no" +_tests= tests +.endif .if ${MK_ZFS} != "no" _libzfs_core= libzfs_core Modified: stable/10/cddl/sbin/Makefile ============================================================================== --- stable/10/cddl/sbin/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/cddl/sbin/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -2,7 +2,11 @@ .include -SUBDIR= ${_zfs} ${_zpool} +SUBDIR= ${_tests} ${_zfs} ${_zpool} + +.if ${MK_TESTS} != "no" +_tests= tests +.endif .if ${MK_ZFS} != "no" _zfs= zfs Modified: stable/10/cddl/usr.bin/Makefile ============================================================================== --- stable/10/cddl/usr.bin/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/cddl/usr.bin/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -7,11 +7,16 @@ SUBDIR= \ ctfdump \ ctfmerge \ sgsmsg \ + ${_tests} \ ${_zinject} \ ${_zlook} \ ${_zstreamdump} \ ${_ztest} +.if ${MK_TESTS} != "no" +_tests= tests +.endif + .if ${MK_ZFS} != "no" _zinject= zinject #_zlook= zlook Modified: stable/10/cddl/usr.sbin/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/cddl/usr.sbin/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -5,9 +5,14 @@ SUBDIR= ${_dtrace} \ ${_dtruss} \ ${_lockstat} \ + ${_tests} \ ${_zdb} \ ${_zhack} +.if ${MK_TESTS} != "no" +_tests= tests +.endif + .if ${MK_ZFS} != "no" .if ${MK_LIBTHR} != "no" _zdb= zdb Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/etc/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -7,6 +7,10 @@ SUBDIR= sendmail .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + BIN1= crontab \ devd.conf \ devfs.conf \ Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/etc/mtree/BSD.tests.dist Mon Apr 28 04:20:14 2014 (r265037) @@ -50,6 +50,26 @@ test .. .. + cddl + lib + .. + sbin + .. + usr.bin + .. + usr.sbin + .. + .. + etc + .. + games + .. + gnu + lib + .. + usr.bin + .. + .. lib atf libatf-c @@ -80,6 +100,16 @@ mdconfig .. .. + secure + lib + .. + libexec + .. + usr.bin + .. + usr.sbin + .. + .. share examples tests Modified: stable/10/games/Makefile ============================================================================== --- stable/10/games/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/games/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -1,6 +1,7 @@ -# @(#)Makefile 8.2 (Berkeley) 3/31/94 # $FreeBSD$ +.include + SUBDIR= \ bcd \ caesar \ @@ -12,6 +13,11 @@ SUBDIR= \ pom \ ppt \ primes \ - random + random \ + ${_tests} + +.if ${MK_TESTS} != "no" +_tests= tests +.endif .include Modified: stable/10/gnu/Makefile ============================================================================== --- stable/10/gnu/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/gnu/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -1,6 +1,12 @@ # @(#)Makefile 5.33.1.1 (Berkeley) 5/6/91 # $FreeBSD$ -SUBDIR= lib usr.bin +.include + +SUBDIR= lib ${_tests} usr.bin + +.if ${MK_TESTS} != "no" +_tests= tests +.endif .include Modified: stable/10/gnu/lib/Makefile ============================================================================== --- stable/10/gnu/lib/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/gnu/lib/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -8,6 +8,10 @@ SUBDIR= csu libgcc libgcov libdialog lib SUBDIR+= libssp .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + # libsupc++ uses libstdc++ headers, although 'make includes' should # have taken care of that already. .if ${MK_GNUCXX} != "no" Modified: stable/10/gnu/usr.bin/Makefile ============================================================================== --- stable/10/gnu/usr.bin/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/gnu/usr.bin/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -15,6 +15,7 @@ SUBDIR= ${_binutils} \ ${_rcs} \ sdiff \ send-pr \ + ${_tests} \ ${_texinfo} .if ${MK_CXX} != "no" @@ -36,6 +37,10 @@ _texinfo= texinfo _rcs= rcs .endif +.if ${MK_TESTS} != "no" +_tests= tests +.endif + .if ${MK_BINUTILS} != "no" _binutils= binutils .endif Modified: stable/10/secure/Makefile ============================================================================== --- stable/10/secure/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/secure/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -2,7 +2,11 @@ .include -SUBDIR= lib libexec usr.bin usr.sbin +SUBDIR= lib libexec ${_tests} usr.bin usr.sbin + +.if ${MK_TESTS} != "no" +_tests= tests +.endif # These are the programs which depend on crypto, but not Kerberos. SPROGS= lib/libfetch lib/libpam lib/libradius lib/libtelnet \ Modified: stable/10/secure/lib/Makefile ============================================================================== --- stable/10/secure/lib/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/secure/lib/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -10,4 +10,8 @@ SUBDIR+=libssh .endif .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include Modified: stable/10/secure/libexec/Makefile ============================================================================== --- stable/10/secure/libexec/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/secure/libexec/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -7,4 +7,8 @@ SUBDIR= SUBDIR+=sftp-server ssh-keysign ssh-pkcs11-helper .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include Modified: stable/10/secure/usr.bin/Makefile ============================================================================== --- stable/10/secure/usr.bin/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/secure/usr.bin/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -10,4 +10,8 @@ SUBDIR+=scp sftp ssh ssh-add ssh-agent s .endif .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include Modified: stable/10/secure/usr.sbin/Makefile ============================================================================== --- stable/10/secure/usr.sbin/Makefile Mon Apr 28 02:35:28 2014 (r265036) +++ stable/10/secure/usr.sbin/Makefile Mon Apr 28 04:20:14 2014 (r265037) @@ -7,4 +7,8 @@ SUBDIR= SUBDIR+=sshd .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 28 06:11:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3CD8231F; Mon, 28 Apr 2014 06: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 28F301D88; Mon, 28 Apr 2014 06: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 s3S6B4bD068924; Mon, 28 Apr 2014 06:11:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3S6B3O6068922; Mon, 28 Apr 2014 06:11:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404280611.s3S6B3O6068922@svn.freebsd.org> From: Xin LI Date: Mon, 28 Apr 2014 06:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265039 - in stable/10/cddl/contrib/opensolaris: cmd/zdb lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 06:11:04 -0000 Author: delphij Date: Mon Apr 28 06:11:03 2014 New Revision: 265039 URL: http://svnweb.freebsd.org/changeset/base/265039 Log: MFC r264467: Take into account when zpool history block grows exceeding 128KB in zpool(8) and zdb(8) by growing the buffer on demand with a cap of 1GB (specified in spa_history_create_obj()). PR: bin/186574 Submitted by: Andrew Childs (with changes) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Apr 28 05:39:20 2014 (r265038) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Apr 28 06:11:03 2014 (r265039) @@ -929,11 +929,16 @@ dump_dtl(vdev_t *vd, int indent) dump_dtl(vd->vdev_child[c], indent + 4); } +/* from spa_history.c: spa_history_create_obj() */ +#define HIS_BUF_LEN_DEF (128 << 10) +#define HIS_BUF_LEN_MAX (1 << 30) + static void dump_history(spa_t *spa) { nvlist_t **events = NULL; - char buf[SPA_MAXBLOCKSIZE]; + char *buf = NULL; + uint64_t bufsize = HIS_BUF_LEN_DEF; uint64_t resid, len, off = 0; uint_t num = 0; int error; @@ -942,8 +947,11 @@ dump_history(spa_t *spa) char tbuf[30]; char internalstr[MAXPATHLEN]; + if ((buf = malloc(bufsize)) == NULL) + (void) fprintf(stderr, "Unable to read history: " + "out of memory\n"); do { - len = sizeof (buf); + len = bufsize; if ((error = spa_history_get(spa, &off, &len, buf)) != 0) { (void) fprintf(stderr, "Unable to read history: " @@ -953,9 +961,26 @@ dump_history(spa_t *spa) if (zpool_history_unpack(buf, len, &resid, &events, &num) != 0) break; - off -= resid; + + /* + * If the history block is too big, double the buffer + * size and try again. + */ + if (resid == len) { + free(buf); + buf = NULL; + + bufsize <<= 1; + if ((bufsize >= HIS_BUF_LEN_MAX) || + ((buf = malloc(bufsize)) == NULL)) { + (void) fprintf(stderr, "Unable to read history: " + "out of memory\n"); + return; + } + } } while (len != 0); + free(buf); (void) printf("\nHistory:\n"); for (int i = 0; i < num; i++) { Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Apr 28 05:39:20 2014 (r265038) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Apr 28 06:11:03 2014 (r265039) @@ -3744,7 +3744,9 @@ zpool_history_unpack(char *buf, uint64_t return (0); } -#define HIS_BUF_LEN (128*1024) +/* from spa_history.c: spa_history_create_obj() */ +#define HIS_BUF_LEN_DEF (128 << 10) +#define HIS_BUF_LEN_MAX (1 << 30) /* * Retrieve the command history of a pool. @@ -3752,21 +3754,24 @@ zpool_history_unpack(char *buf, uint64_t int zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp) { - char buf[HIS_BUF_LEN]; + char *buf = NULL; + uint64_t bufsize = HIS_BUF_LEN_DEF; uint64_t off = 0; nvlist_t **records = NULL; uint_t numrecords = 0; int err, i; + if ((buf = malloc(bufsize)) == NULL) + return (ENOMEM); do { - uint64_t bytes_read = sizeof (buf); + uint64_t bytes_read = bufsize; uint64_t leftover; if ((err = get_history(zhp, buf, &off, &bytes_read)) != 0) break; /* if nothing else was read in, we're at EOF, just return */ - if (!bytes_read) + if (bytes_read == 0) break; if ((err = zpool_history_unpack(buf, bytes_read, @@ -3774,8 +3779,25 @@ zpool_get_history(zpool_handle_t *zhp, n break; off -= leftover; + /* + * If the history block is too big, double the buffer + * size and try again. + */ + if (leftover == bytes_read) { + free(buf); + buf = NULL; + + bufsize <<= 1; + if ((bufsize >= HIS_BUF_LEN_MAX) || + ((buf = malloc(bufsize)) == NULL)) { + err = ENOMEM; + break; + } + } + /* CONSTCOND */ } while (1); + free(buf); if (!err) { verify(nvlist_alloc(nvhisp, NV_UNIQUE_NAME, 0) == 0); From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 28 12:46:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9B26AA1F; Mon, 28 Apr 2014 12:46: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 7B97A17B8; Mon, 28 Apr 2014 12:46: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 s3SCkOEU030888; Mon, 28 Apr 2014 12:46:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SCkORV030885; Mon, 28 Apr 2014 12:46:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404281246.s3SCkORV030885@svn.freebsd.org> From: Ian Lepore Date: Mon, 28 Apr 2014 12:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265047 - in stable/10: share/man/man4 sys/dev/usb sys/dev/usb/serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 12:46:24 -0000 Author: ian Date: Mon Apr 28 12:46:23 2014 New Revision: 265047 URL: http://svnweb.freebsd.org/changeset/base/265047 Log: MFC uftdi(4) driver changes... r264010: Support speeds up to 12mbaud on newer chips. r264031: Use 2K IO buffers for improved throughput. r264149: Add ioctl(2) calls to access bitbang, MPSSE, CPU_FIFO, and other modes. Added: stable/10/sys/dev/usb/uftdiio.h - copied unchanged from r264149, head/sys/dev/usb/uftdiio.h Modified: stable/10/share/man/man4/uftdi.4 stable/10/sys/dev/usb/serial/uftdi.c stable/10/sys/dev/usb/serial/uftdi_reg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/uftdi.4 ============================================================================== --- stable/10/share/man/man4/uftdi.4 Mon Apr 28 09:00:00 2014 (r265046) +++ stable/10/share/man/man4/uftdi.4 Mon Apr 28 12:46:23 2014 (r265047) @@ -61,6 +61,87 @@ The device is accessed through the .Xr ucom 4 driver which makes it behave like a .Xr tty 4 . +.Pp +Many of the supported chips provide additional functionality +such as bitbang mode and the MPSSE engine for serial bus emulation. +The +.Nm +driver provides access to that functionality with the following +.Xr ioctl 2 +calls, defined in +.In dev/usb/uftdiio.h : +.Bl -tag -width indent +.It Dv UFTDIIOC_RESET_IO Pq Vt int +Reset the channel to its default configuration, flush RX and TX FIFOs. +.It Dv UFTDIIOC_RESET_RX Pq Vt int +Flush the RX FIFO. +.It Dv UFTDIIOC_RESET_TX Pq Vt int +Flush the TX FIFO. +.It Dv UFTDIIOC_SET_BITMODE Pq Vt "struct uftdi_bitmode" +Put the channel into the operating mode specified in +.Va mode , +and set the pins indicated by ones in +.Va iomask +to output mode. +The +.Va mode +must be one of the +.Va uftdi_bitmodes +values. +.Bd -literal +enum uftdi_bitmodes +{ + UFTDI_BITMODE_ASYNC = 0, + UFTDI_BITMODE_MPSSE = 1, + UFTDI_BITMODE_SYNC = 2, + UFTDI_BITMODE_CPU_EMUL = 3, + UFTDI_BITMODE_FAST_SERIAL = 4, + UFTDI_BITMODE_CBUS = 5, + UFTDI_BITMODE_NONE = 0xff, +}; + +struct uftdi_bitmode +{ + uint8_t mode; + uint8_t iomask; +}; +.Ed +.Pp +Manuals and application notes published by FTDI describe these +modes in detail. +To use most of these modes, you first put the channel into +the desired mode, then you +.Xr read 2 +and +.Xr write 2 +data which either reflects pin state or is interpreted +as MPSSE commands and parameters, depending on the mode. +.It Dv UFTDIIOC_GET_BITMODE Pq Vt "struct uftdi_bitmode" +Return the state of the bitbang pins at the time of the call in the +.Va iomask +member. +The +.Va mode +member is unused. +.It Dv UFTDIIOC_SET_ERROR_CHAR Pq Vt int +Set the character which is inserted into the buffer to mark +the point of an error such as FIFO overflow. +.It Dv UFTDIIOC_SET_EVENT_CHAR Pq Vt int +Set the character which causes a partial FIFO full of data +to be returned immediately even if the FIFO is not full. +.It Dv UFTDIIOC_SET_LATENCY Pq Vt int +Set the amount of time to wait for a full FIFO, +in milliseconds. +If more than this much time elapses without receiving a new +character, any characters in the FIFO are returned. +.It Dv UFTDIIOC_GET_LATENCY Pq Vt int +Get the current value of the latency timer. +.It Dv UFTDIIOC_GET_HWREV Pq Vt int +Get the hardware revision number. +This is the +.Va bcdDevice +value from the +.Va usb_device_descriptor . .Sh HARDWARE The .Nm Modified: stable/10/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/10/sys/dev/usb/serial/uftdi.c Mon Apr 28 09:00:00 2014 (r265046) +++ stable/10/sys/dev/usb/serial/uftdi.c Mon Apr 28 12:46:23 2014 (r265047) @@ -38,7 +38,14 @@ __FBSDID("$FreeBSD$"); */ /* - * FTDI FT2232x, FT8U100AX and FT8U232AM serial adapter driver + * FTDI FT232x, FT2232x, FT4232x, FT8U100AX and FT8U232xM serial adapters. + * + * Note that we specifically do not do a reset or otherwise alter the state of + * the chip during attach, detach, open, and close, because it could be + * pre-initialized (via an attached serial eeprom) to power-on into a mode such + * as bitbang in which the pins are being driven to a specific state which we + * must not perturb. The device gets reset at power-on, and doesn't need to be + * reset again after that to function, except as directed by ioctl() calls. */ #include @@ -63,6 +70,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "usbdevs.h" #define USB_DEBUG_VAR uftdi_debug @@ -71,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef USB_DEBUG static int uftdi_debug = 0; @@ -83,8 +93,34 @@ SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debu #define UFTDI_CONFIG_INDEX 0 #define UFTDI_IFACE_INDEX_JTAG 0 -#define UFTDI_OBUFSIZE 64 /* bytes, cannot be increased due to - * do size encoding */ +/* + * IO buffer sizes and FTDI device procotol sizes. + * + * Note that the output packet size in the following defines is not the usb + * protocol packet size based on bus speed, it is the size dictated by the FTDI + * device itself, and is used only on older chips. + * + * We allocate buffers bigger than the hardware's packet size, and process + * multiple packets within each buffer. This allows the controller to make + * optimal use of the usb bus by conducting multiple transfers with the device + * during a single bus timeslice to fill or drain the chip's fifos. + * + * The output data on newer chips has no packet header, and we are able to pack + * any number of output bytes into a buffer. On some older chips, each output + * packet contains a 1-byte header and up to 63 bytes of payload. The size is + * encoded in 6 bits of the header, hence the 64-byte limit on packet size. We + * loop to fill the buffer with many of these header+payload packets. + * + * The input data on all chips consists of packets which contain a 2-byte header + * followed by data payload. The total size of the packet is wMaxPacketSize + * which can change based on the bus speed (e.g., 64 for full speed, 512 for + * high speed). We loop to extract the headers and payloads from the packets + * packed into an input buffer. + */ +#define UFTDI_IBUFSIZE 2048 +#define UFTDI_IHDRSIZE 2 +#define UFTDI_OBUFSIZE 2048 +#define UFTDI_OPKTSIZE 64 enum { UFTDI_BULK_DT_WR, @@ -92,6 +128,21 @@ enum { UFTDI_N_TRANSFER, }; +enum { + DEVT_SIO, + DEVT_232A, + DEVT_232B, + DEVT_2232D, /* Includes 2232C */ + DEVT_232R, + DEVT_2232H, + DEVT_4232H, + DEVT_232H, + DEVT_230X, +}; + +#define DEVF_BAUDBITS_HINDEX 0x01 /* Baud bits in high byte of index. */ +#define DEVF_BAUDCLK_12M 0X02 /* Base baud clock is 12MHz. */ + struct uftdi_softc { struct ucom_super_softc sc_super_ucom; struct ucom_softc sc_ucom; @@ -104,16 +155,18 @@ struct uftdi_softc { uint32_t sc_unit; uint16_t sc_last_lcr; + uint16_t sc_bcdDevice; - uint8_t sc_type; - uint8_t sc_iface_index; + uint8_t sc_devtype; + uint8_t sc_devflags; uint8_t sc_hdrlen; uint8_t sc_msr; uint8_t sc_lsr; }; struct uftdi_param_config { - uint16_t rate; + uint16_t baud_lobits; + uint16_t baud_hibits; uint16_t lcr; uint8_t v_start; uint8_t v_stop; @@ -132,20 +185,29 @@ static usb_callback_t uftdi_read_callbac static void uftdi_free(struct ucom_softc *); static void uftdi_cfg_open(struct ucom_softc *); +static void uftdi_cfg_close(struct ucom_softc *); static void uftdi_cfg_set_dtr(struct ucom_softc *, uint8_t); static void uftdi_cfg_set_rts(struct ucom_softc *, uint8_t); static void uftdi_cfg_set_break(struct ucom_softc *, uint8_t); -static int uftdi_set_parm_soft(struct termios *, - struct uftdi_param_config *, uint8_t); +static int uftdi_set_parm_soft(struct ucom_softc *, struct termios *, + struct uftdi_param_config *); static int uftdi_pre_param(struct ucom_softc *, struct termios *); static void uftdi_cfg_param(struct ucom_softc *, struct termios *); static void uftdi_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); +static int uftdi_reset(struct ucom_softc *, int); +static int uftdi_set_bitmode(struct ucom_softc *, uint8_t, uint8_t); +static int uftdi_get_bitmode(struct ucom_softc *, uint8_t *); +static int uftdi_set_latency(struct ucom_softc *, int); +static int uftdi_get_latency(struct ucom_softc *, int *); +static int uftdi_set_event_char(struct ucom_softc *, int); +static int uftdi_set_error_char(struct ucom_softc *, int); +static int uftdi_ioctl(struct ucom_softc *, uint32_t, caddr_t, int, + struct thread *); static void uftdi_start_read(struct ucom_softc *); static void uftdi_stop_read(struct ucom_softc *); static void uftdi_start_write(struct ucom_softc *); static void uftdi_stop_write(struct ucom_softc *); -static uint8_t uftdi_8u232am_getrate(uint32_t, uint16_t *); static void uftdi_poll(struct ucom_softc *ucom); static const struct usb_config uftdi_config[UFTDI_N_TRANSFER] = { @@ -163,7 +225,7 @@ static const struct usb_config uftdi_con .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .bufsize = 0, /* use wMaxPacketSize */ + .bufsize = UFTDI_IBUFSIZE, .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = &uftdi_read_callback, }, @@ -176,7 +238,9 @@ static const struct ucom_callback uftdi_ .ucom_cfg_set_break = &uftdi_cfg_set_break, .ucom_cfg_param = &uftdi_cfg_param, .ucom_cfg_open = &uftdi_cfg_open, + .ucom_cfg_close = &uftdi_cfg_close, .ucom_pre_param = &uftdi_pre_param, + .ucom_ioctl = &uftdi_ioctl, .ucom_start_read = &uftdi_start_read, .ucom_stop_read = &uftdi_stop_read, .ucom_start_write = &uftdi_start_write, @@ -847,6 +911,82 @@ static const STRUCT_USB_HOST_ID uftdi_de #undef UFTDI_DEV }; +/* + * Set up softc fields whose value depends on the device type. + * + * Note that the 2232C and 2232D devices are the same for our purposes. In the + * silicon the difference is that the D series has CPU FIFO mode and C doesn't. + * I haven't found any way of determining the C/D difference from info provided + * by the chip other than trying to set CPU FIFO mode and having it work or not. + * + * Due to a hardware bug, a 232B chip without an eeprom reports itself as a + * 232A, but if the serial number is also zero we know it's really a 232B. + */ +static void +uftdi_devtype_setup(struct uftdi_softc *sc, struct usb_attach_arg *uaa) +{ + struct usb_device_descriptor *dd; + + sc->sc_bcdDevice = uaa->info.bcdDevice; + + switch (uaa->info.bcdDevice) { + case 0x200: + dd = usbd_get_device_descriptor(sc->sc_udev); + if (dd->iSerialNumber == 0) { + sc->sc_devtype = DEVT_232B; + } else { + sc->sc_devtype = DEVT_232A; + } + sc->sc_ucom.sc_portno = 0; + break; + case 0x400: + sc->sc_devtype = DEVT_232B; + sc->sc_ucom.sc_portno = 0; + break; + case 0x500: + sc->sc_devtype = DEVT_2232D; + sc->sc_devflags |= DEVF_BAUDBITS_HINDEX; + sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; + break; + case 0x600: + sc->sc_devtype = DEVT_232R; + sc->sc_ucom.sc_portno = 0; + break; + case 0x700: + sc->sc_devtype = DEVT_2232H; + sc->sc_devflags |= DEVF_BAUDBITS_HINDEX | DEVF_BAUDCLK_12M; + sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; + break; + case 0x800: + sc->sc_devtype = DEVT_4232H; + sc->sc_devflags |= DEVF_BAUDBITS_HINDEX | DEVF_BAUDCLK_12M; + sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; + break; + case 0x900: + sc->sc_devtype = DEVT_232H; + sc->sc_devflags |= DEVF_BAUDBITS_HINDEX | DEVF_BAUDCLK_12M; + sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; + break; + case 0x1000: + sc->sc_devtype = DEVT_230X; + sc->sc_devflags |= DEVF_BAUDBITS_HINDEX; + sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; + break; + default: + if (uaa->info.bcdDevice < 0x200) { + sc->sc_devtype = DEVT_SIO; + sc->sc_hdrlen = 1; + } else { + sc->sc_devtype = DEVT_232R; + device_printf(sc->sc_dev, "Warning: unknown FTDI " + "device type, bcdDevice=0x%04x, assuming 232R", + uaa->info.bcdDevice); + } + sc->sc_ucom.sc_portno = 0; + break; + } +} + static int uftdi_probe(device_t dev) { @@ -886,6 +1026,8 @@ uftdi_attach(device_t dev) struct uftdi_softc *sc = device_get_softc(dev); int error; + DPRINTF("\n"); + sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); @@ -894,34 +1036,11 @@ uftdi_attach(device_t dev) mtx_init(&sc->sc_mtx, "uftdi", NULL, MTX_DEF); ucom_ref(&sc->sc_super_ucom); - DPRINTF("\n"); - sc->sc_iface_index = uaa->info.bIfaceIndex; - sc->sc_type = USB_GET_DRIVER_INFO(uaa) & UFTDI_TYPE_MASK; - - switch (sc->sc_type) { - case UFTDI_TYPE_AUTO: - /* simplified type check */ - if (uaa->info.bcdDevice >= 0x0200 || - usbd_get_iface(uaa->device, 1) != NULL) { - sc->sc_type = UFTDI_TYPE_8U232AM; - sc->sc_hdrlen = 0; - } else { - sc->sc_type = UFTDI_TYPE_SIO; - sc->sc_hdrlen = 1; - } - break; - case UFTDI_TYPE_SIO: - sc->sc_hdrlen = 1; - break; - case UFTDI_TYPE_8U232AM: - default: - sc->sc_hdrlen = 0; - break; - } + uftdi_devtype_setup(sc, uaa); error = usbd_transfer_setup(uaa->device, - &sc->sc_iface_index, sc->sc_xfer, uftdi_config, + &uaa->info.bIfaceIndex, sc->sc_xfer, uftdi_config, UFTDI_N_TRANSFER, sc, &sc->sc_mtx); if (error) { @@ -929,8 +1048,6 @@ uftdi_attach(device_t dev) "transfers failed\n"); goto detach; } - sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; - /* clear stall at first run */ mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[UFTDI_BULK_DT_WR]); @@ -993,37 +1110,25 @@ uftdi_free(struct ucom_softc *ucom) static void uftdi_cfg_open(struct ucom_softc *ucom) { - struct uftdi_softc *sc = ucom->sc_parent; - uint16_t wIndex = ucom->sc_portno; - struct usb_device_request req; + /* + * This do-nothing open routine exists for the sole purpose of this + * DPRINTF() so that you can see the point at which open gets called + * when debugging is enabled. + */ DPRINTF(""); +} - /* perform a full reset on the device */ - - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = FTDI_SIO_RESET; - USETW(req.wValue, FTDI_SIO_RESET_SIO); - USETW(req.wIndex, wIndex); - USETW(req.wLength, 0); - ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, - &req, NULL, 0, 1000); - - /* turn on RTS/CTS flow control */ - - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = FTDI_SIO_SET_FLOW_CTRL; - USETW(req.wValue, 0); - USETW2(req.wIndex, FTDI_SIO_RTS_CTS_HS, wIndex); - USETW(req.wLength, 0); - ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, - &req, NULL, 0, 1000); +static void +uftdi_cfg_close(struct ucom_softc *ucom) +{ /* - * NOTE: with the new UCOM layer there will always be a - * "uftdi_cfg_param()" call after "open()", so there is no need for - * "open()" to configure anything + * This do-nothing close routine exists for the sole purpose of this + * DPRINTF() so that you can see the point at which close gets called + * when debugging is enabled. */ + DPRINTF(""); } static void @@ -1031,35 +1136,47 @@ uftdi_write_callback(struct usb_xfer *xf { struct uftdi_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc; - uint32_t actlen; + uint32_t pktlen; + uint32_t buflen; uint8_t buf[1]; switch (USB_GET_STATE(xfer)) { + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + } + /* FALLTHROUGH */ case USB_ST_SETUP: case USB_ST_TRANSFERRED: -tr_setup: + /* + * If output packets don't require headers (the common case) we + * can just load the buffer up with payload bytes all at once. + * Otherwise, loop to format packets into the buffer while there + * is data available, and room for a packet header and at least + * one byte of payload. + */ pc = usbd_xfer_get_frame(xfer, 0); - if (ucom_get_data(&sc->sc_ucom, pc, - sc->sc_hdrlen, UFTDI_OBUFSIZE - sc->sc_hdrlen, - &actlen)) { - - if (sc->sc_hdrlen > 0) { - buf[0] = - FTDI_OUT_TAG(actlen, sc->sc_ucom.sc_portno); - usbd_copy_in(pc, 0, buf, 1); + if (sc->sc_hdrlen == 0) { + ucom_get_data(&sc->sc_ucom, pc, 0, UFTDI_OBUFSIZE, + &buflen); + } else { + buflen = 0; + while (buflen < UFTDI_OBUFSIZE - sc->sc_hdrlen - 1 && + ucom_get_data(&sc->sc_ucom, pc, buflen + + sc->sc_hdrlen, UFTDI_OPKTSIZE - sc->sc_hdrlen, + &pktlen) != 0) { + buf[0] = FTDI_OUT_TAG(pktlen, + sc->sc_ucom.sc_portno); + usbd_copy_in(pc, buflen, buf, 1); + buflen += pktlen + sc->sc_hdrlen; } - usbd_xfer_set_frame_len(xfer, 0, actlen + sc->sc_hdrlen); - usbd_transfer_submit(xfer); } - return; - - default: /* Error */ - if (error != USB_ERR_CANCELLED) { - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - goto tr_setup; + if (buflen != 0) { + usbd_xfer_set_frame_len(xfer, 0, buflen); + usbd_transfer_submit(xfer); } - return; + break; } } @@ -1072,23 +1189,47 @@ uftdi_read_callback(struct usb_xfer *xfe uint8_t ftdi_msr; uint8_t msr; uint8_t lsr; - int actlen; + int buflen; + int pktlen; + int pktmax; + int offset; - usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + usbd_xfer_status(xfer, &buflen, NULL, NULL, NULL); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - - if (actlen < 2) { + if (buflen < UFTDI_IHDRSIZE) goto tr_setup; - } pc = usbd_xfer_get_frame(xfer, 0); - usbd_copy_out(pc, 0, buf, 2); - + pktmax = xfer->max_packet_size - UFTDI_IHDRSIZE; + lsr = 0; + msr = 0; + offset = 0; + /* + * Extract packet headers and payload bytes from the buffer. + * Feed payload bytes to ucom/tty layer; OR-accumulate header + * status bits which are transient and could toggle with each + * packet. After processing all packets in the buffer, process + * the accumulated transient MSR and LSR values along with the + * non-transient bits from the last packet header. + */ + while (buflen >= UFTDI_IHDRSIZE) { + usbd_copy_out(pc, offset, buf, UFTDI_IHDRSIZE); + offset += UFTDI_IHDRSIZE; + buflen -= UFTDI_IHDRSIZE; + lsr |= FTDI_GET_LSR(buf); + if (FTDI_GET_MSR(buf) & FTDI_SIO_RI_MASK) + msr |= SER_RI; + pktlen = min(buflen, pktmax); + if (pktlen != 0) { + ucom_put_data(&sc->sc_ucom, pc, offset, + pktlen); + offset += pktlen; + buflen -= pktlen; + } + } ftdi_msr = FTDI_GET_MSR(buf); - lsr = FTDI_GET_LSR(buf); - msr = 0; if (ftdi_msr & FTDI_SIO_CTS_MASK) msr |= SER_CTS; if (ftdi_msr & FTDI_SIO_DSR_MASK) @@ -1109,11 +1250,7 @@ uftdi_read_callback(struct usb_xfer *xfe ucom_status_change(&sc->sc_ucom); } - actlen -= 2; - - if (actlen > 0) { - ucom_put_data(&sc->sc_ucom, pc, 2, actlen); - } + /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); @@ -1193,58 +1330,162 @@ uftdi_cfg_set_break(struct ucom_softc *u &req, NULL, 0, 1000); } -static int -uftdi_set_parm_soft(struct termios *t, - struct uftdi_param_config *cfg, uint8_t type) +/* + * Return true if the given speed is within operational tolerance of the target + * speed. FTDI recommends that the hardware speed be within 3% of nominal. + */ +static inline boolean_t +uftdi_baud_within_tolerance(uint64_t speed, uint64_t target) { + return ((speed >= (target * 100) / 103) && + (speed <= (target * 100) / 97)); +} - memset(cfg, 0, sizeof(*cfg)); +static int +uftdi_sio_encode_baudrate(struct uftdi_softc *sc, speed_t speed, + struct uftdi_param_config *cfg) +{ + u_int i; + const speed_t sio_speeds[] = { + 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 + }; - switch (type) { - case UFTDI_TYPE_SIO: - switch (t->c_ospeed) { - case 300: - cfg->rate = ftdi_sio_b300; - break; - case 600: - cfg->rate = ftdi_sio_b600; - break; - case 1200: - cfg->rate = ftdi_sio_b1200; - break; - case 2400: - cfg->rate = ftdi_sio_b2400; - break; - case 4800: - cfg->rate = ftdi_sio_b4800; - break; - case 9600: - cfg->rate = ftdi_sio_b9600; - break; - case 19200: - cfg->rate = ftdi_sio_b19200; - break; - case 38400: - cfg->rate = ftdi_sio_b38400; - break; - case 57600: - cfg->rate = ftdi_sio_b57600; - break; - case 115200: - cfg->rate = ftdi_sio_b115200; - break; - default: - return (EINVAL); + /* + * The original SIO chips were limited to a small choice of speeds + * listed in an internal table of speeds chosen by an index value. + */ + for (i = 0; i < nitems(sio_speeds); ++i) { + if (speed == sio_speeds[i]) { + cfg->baud_lobits = i; + cfg->baud_hibits = 0; + return (0); } - break; + } + return (ERANGE); +} - case UFTDI_TYPE_8U232AM: - if (uftdi_8u232am_getrate(t->c_ospeed, &cfg->rate)) { - return (EINVAL); - } - break; +static int +uftdi_encode_baudrate(struct uftdi_softc *sc, speed_t speed, + struct uftdi_param_config *cfg) +{ + static const uint8_t encoded_fraction[8] = {0, 3, 2, 4, 1, 5, 6, 7}; + static const uint8_t roundoff_232a[16] = { + 0, 1, 0, 1, 0, -1, 2, 1, + 0, -1, -2, -3, 4, 3, 2, 1, + }; + uint32_t clk, divisor, fastclk_flag, frac, hwspeed; + + /* + * If this chip has the fast clock capability and the speed is within + * range, use the 12MHz clock, otherwise the standard clock is 3MHz. + */ + if ((sc->sc_devflags & DEVF_BAUDCLK_12M) && speed >= 1200) { + clk = 12000000; + fastclk_flag = (1 << 17); + } else { + clk = 3000000; + fastclk_flag = 0; } + /* + * Make sure the requested speed is reachable with the available clock + * and a 14-bit divisor. + */ + if (speed < (clk >> 14) || speed > clk) + return (ERANGE); + + /* + * Calculate the divisor, initially yielding a fixed point number with a + * 4-bit (1/16ths) fraction, then round it to the nearest fraction the + * hardware can handle. When the integral part of the divisor is + * greater than one, the fractional part is in 1/8ths of the base clock. + * The FT8U232AM chips can handle only 0.125, 0.250, and 0.5 fractions. + * Later chips can handle all 1/8th fractions. + * + * If the integral part of the divisor is 1, a special rule applies: the + * fractional part can only be .0 or .5 (this is a limitation of the + * hardware). We handle this by truncating the fraction rather than + * rounding, because this only applies to the two fastest speeds the + * chip can achieve and rounding doesn't matter, either you've asked for + * that exact speed or you've asked for something the chip can't do. + * + * For the FT8U232AM chips, use a roundoff table to adjust the result + * to the nearest 1/8th fraction that is supported by the hardware, + * leaving a fixed-point number with a 3-bit fraction which exactly + * represents the math the hardware divider will do. For later-series + * chips that support all 8 fractional divisors, just round 16ths to + * 8ths by adding 1 and dividing by 2. + */ + divisor = (clk << 4) / speed; + if ((divisor & 0xfffffff0) == 1) + divisor &= 0xfffffff8; + else if (sc->sc_devtype == DEVT_232A) + divisor += roundoff_232a[divisor & 0x0f]; + else + divisor += 1; /* Rounds odd 16ths up to next 8th. */ + divisor >>= 1; + + /* + * Ensure the resulting hardware speed will be within operational + * tolerance (within 3% of nominal). + */ + hwspeed = (clk << 3) / divisor; + if (!uftdi_baud_within_tolerance(hwspeed, speed)) + return (ERANGE); + + /* + * Re-pack the divisor into hardware format. The lower 14-bits hold the + * integral part, while the upper bits specify the fraction by indexing + * a table of fractions within the hardware which is laid out as: + * {0.0, 0.5, 0.25, 0.125, 0.325, 0.625, 0.725, 0.875} + * The A-series chips only have the first four table entries; the + * roundoff table logic above ensures that the fractional part for those + * chips will be one of the first four values. + * + * When the divisor is 1 a special encoding applies: 1.0 is encoded as + * 0.0, and 1.5 is encoded as 1.0. The rounding logic above has already + * ensured that the fraction is either .0 or .5 if the integral is 1. + */ + frac = divisor & 0x07; + divisor >>= 3; + if (divisor == 1) { + if (frac == 0) + divisor = 0; /* 1.0 becomes 0.0 */ + else + frac = 0; /* 1.5 becomes 1.0 */ + } + divisor |= (encoded_fraction[frac] << 14) | fastclk_flag; + + cfg->baud_lobits = (uint16_t)divisor; + cfg->baud_hibits = (uint16_t)(divisor >> 16); + + /* + * If this chip requires the baud bits to be in the high byte of the + * index word, move the bits up to that location. + */ + if (sc->sc_devflags & DEVF_BAUDBITS_HINDEX) { + cfg->baud_hibits <<= 8; + } + + return (0); +} + +static int +uftdi_set_parm_soft(struct ucom_softc *ucom, struct termios *t, + struct uftdi_param_config *cfg) +{ + struct uftdi_softc *sc = ucom->sc_parent; + int err; + + memset(cfg, 0, sizeof(*cfg)); + + if (sc->sc_devtype == DEVT_SIO) + err = uftdi_sio_encode_baudrate(sc, t->c_ospeed, cfg); + else + err = uftdi_encode_baudrate(sc, t->c_ospeed, cfg); + if (err != 0) + return (err); + if (t->c_cflag & CSTOPB) cfg->lcr = FTDI_SIO_SET_DATA_STOP_BITS_2; else @@ -1294,12 +1535,11 @@ uftdi_set_parm_soft(struct termios *t, static int uftdi_pre_param(struct ucom_softc *ucom, struct termios *t) { - struct uftdi_softc *sc = ucom->sc_parent; struct uftdi_param_config cfg; DPRINTF("\n"); - return (uftdi_set_parm_soft(t, &cfg, sc->sc_type)); + return (uftdi_set_parm_soft(ucom, t, &cfg)); } static void @@ -1310,7 +1550,7 @@ uftdi_cfg_param(struct ucom_softc *ucom, struct uftdi_param_config cfg; struct usb_device_request req; - if (uftdi_set_parm_soft(t, &cfg, sc->sc_type)) { + if (uftdi_set_parm_soft(ucom, t, &cfg)) { /* should not happen */ return; } @@ -1320,8 +1560,8 @@ uftdi_cfg_param(struct ucom_softc *ucom, req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = FTDI_SIO_SET_BAUD_RATE; - USETW(req.wValue, cfg.rate); - USETW(req.wIndex, wIndex); + USETW(req.wValue, cfg.baud_lobits); + USETW(req.wIndex, cfg.baud_hibits | wIndex); USETW(req.wLength, 0); ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000); @@ -1355,6 +1595,186 @@ uftdi_cfg_get_status(struct ucom_softc * *lsr = sc->sc_lsr; } +static int +uftdi_reset(struct ucom_softc *ucom, int reset_type) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_RESET; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 0); + USETW(req.wValue, reset_type); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); +} + +static int +uftdi_set_bitmode(struct ucom_softc *ucom, uint8_t bitmode, uint8_t iomask) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_SET_BITMODE; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 0); + + if (bitmode == UFTDI_BITMODE_NONE) + USETW2(req.wValue, 0, 0); + else + USETW2(req.wValue, (1 << bitmode), iomask); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); +} + +static int +uftdi_get_bitmode(struct ucom_softc *ucom, uint8_t *iomask) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_GET_BITMODE; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 1); + USETW(req.wValue, 0); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, iomask)); +} + +static int +uftdi_set_latency(struct ucom_softc *ucom, int latency) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + + if (latency < 0 || latency > 255) + return (USB_ERR_INVAL); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_SET_LATENCY; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 0); + USETW2(req.wValue, 0, latency); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); +} + +static int +uftdi_get_latency(struct ucom_softc *ucom, int *latency) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + usb_error_t err; + uint8_t buf; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_GET_LATENCY; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 1); + USETW(req.wValue, 0); + + err = usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, &buf); + *latency = buf; + + return (err); +} + +static int +uftdi_set_event_char(struct ucom_softc *ucom, int echar) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + uint8_t enable; + + enable = (echar == -1) ? 0 : 1; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_SET_EVENT_CHAR; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 0); + USETW2(req.wValue, enable, echar & 0xff); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); +} + +static int +uftdi_set_error_char(struct ucom_softc *ucom, int echar) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + uint8_t enable; + + enable = (echar == -1) ? 0 : 1; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_SET_ERROR_CHAR; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 0); + USETW2(req.wValue, enable, echar & 0xff); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); +} + +static int +uftdi_ioctl(struct ucom_softc *ucom, uint32_t cmd, caddr_t data, + int flag, struct thread *td) +{ + struct uftdi_softc *sc = ucom->sc_parent; + int err; + struct uftdi_bitmode * mode; + + DPRINTF("portno: %d cmd: %#x\n", ucom->sc_portno, cmd); + + switch (cmd) { + case UFTDIIOC_RESET_IO: + case UFTDIIOC_RESET_RX: + case UFTDIIOC_RESET_TX: + err = uftdi_reset(ucom, + cmd == UFTDIIOC_RESET_IO ? FTDI_SIO_RESET_SIO : + (cmd == UFTDIIOC_RESET_RX ? FTDI_SIO_RESET_PURGE_RX : + FTDI_SIO_RESET_PURGE_TX)); + break; + case UFTDIIOC_SET_BITMODE: + mode = (struct uftdi_bitmode *)data; + err = uftdi_set_bitmode(ucom, mode->mode, mode->iomask); + break; + case UFTDIIOC_GET_BITMODE: + mode = (struct uftdi_bitmode *)data; + err = uftdi_get_bitmode(ucom, &mode->iomask); + break; + case UFTDIIOC_SET_LATENCY: + err = uftdi_set_latency(ucom, *((int *)data)); + break; + case UFTDIIOC_GET_LATENCY: + err = uftdi_get_latency(ucom, (int *)data); + break; + case UFTDIIOC_SET_ERROR_CHAR: + err = uftdi_set_event_char(ucom, *(int *)data); + break; + case UFTDIIOC_SET_EVENT_CHAR: + err = uftdi_set_error_char(ucom, *(int *)data); + case UFTDIIOC_GET_HWREV: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 28 13:12:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 42437616; Mon, 28 Apr 2014 13:12: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 E3E101AB4; Mon, 28 Apr 2014 13:12: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 s3SDCJXj043269; Mon, 28 Apr 2014 13:12:19 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SDCJtV043268; Mon, 28 Apr 2014 13:12:19 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404281312.s3SDCJtV043268@svn.freebsd.org> From: Ian Lepore Date: Mon, 28 Apr 2014 13:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265048 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 13:12:20 -0000 Author: ian Date: Mon Apr 28 13:12:19 2014 New Revision: 265048 URL: http://svnweb.freebsd.org/changeset/base/265048 Log: MFC r264800: fixes for problems found by Coverity scan... - Get transmit loop more in line with the other serial drivers. - Add a comment about FTDI and ZLPs. - Correctly check odditiy of baud rate divisor. - Correct IOCTL handling for "error" and "event" char. Modified: stable/10/sys/dev/usb/serial/uftdi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/10/sys/dev/usb/serial/uftdi.c Mon Apr 28 12:46:23 2014 (r265047) +++ stable/10/sys/dev/usb/serial/uftdi.c Mon Apr 28 13:12:19 2014 (r265048) @@ -1155,11 +1155,17 @@ uftdi_write_callback(struct usb_xfer *xf * Otherwise, loop to format packets into the buffer while there * is data available, and room for a packet header and at least * one byte of payload. + * + * NOTE: The FTDI chip doesn't accept zero length + * packets. This cannot happen because the "pktlen" + * will always be non-zero when "ucom_get_data()" + * returns non-zero which we check below. */ pc = usbd_xfer_get_frame(xfer, 0); if (sc->sc_hdrlen == 0) { - ucom_get_data(&sc->sc_ucom, pc, 0, UFTDI_OBUFSIZE, - &buflen); + if (ucom_get_data(&sc->sc_ucom, pc, 0, UFTDI_OBUFSIZE, + &buflen) == 0) + break; } else { buflen = 0; while (buflen < UFTDI_OBUFSIZE - sc->sc_hdrlen - 1 && @@ -1417,7 +1423,7 @@ uftdi_encode_baudrate(struct uftdi_softc * 8ths by adding 1 and dividing by 2. */ divisor = (clk << 4) / speed; - if ((divisor & 0xfffffff0) == 1) + if ((divisor & 0xf) == 1) divisor &= 0xfffffff8; else if (sc->sc_devtype == DEVT_232A) divisor += roundoff_232a[divisor & 0x0f]; @@ -1759,10 +1765,11 @@ uftdi_ioctl(struct ucom_softc *ucom, uin err = uftdi_get_latency(ucom, (int *)data); break; case UFTDIIOC_SET_ERROR_CHAR: - err = uftdi_set_event_char(ucom, *(int *)data); + err = uftdi_set_error_char(ucom, *(int *)data); break; case UFTDIIOC_SET_EVENT_CHAR: - err = uftdi_set_error_char(ucom, *(int *)data); + err = uftdi_set_event_char(ucom, *(int *)data); + break; case UFTDIIOC_GET_HWREV: *(int *)data = sc->sc_bcdDevice; err = 0; From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 28 13:18:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4AFDEA6A; Mon, 28 Apr 2014 13:18: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 379371B0E; Mon, 28 Apr 2014 13:18:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SDIV2E044252; Mon, 28 Apr 2014 13:18:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SDIVPn044251; Mon, 28 Apr 2014 13:18:31 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404281318.s3SDIVPn044251@svn.freebsd.org> From: Ian Lepore Date: Mon, 28 Apr 2014 13:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265049 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 13:18:31 -0000 Author: ian Date: Mon Apr 28 13:18:30 2014 New Revision: 265049 URL: http://svnweb.freebsd.org/changeset/base/265049 Log: MFC r264018: update list of supported FTDI chips. Modified: stable/10/share/man/man4/uftdi.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/uftdi.4 ============================================================================== --- stable/10/share/man/man4/uftdi.4 Mon Apr 28 13:12:19 2014 (r265048) +++ stable/10/share/man/man4/uftdi.4 Mon Apr 28 13:18:30 2014 (r265049) @@ -29,12 +29,13 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2011 +.Dd March 31, 2014 .Dt UFTDI 4 .Os .Sh NAME .Nm uftdi -.Nd USB support for serial adapters based on the FT8U100AX and FT8U232AM chips +.Nd USB support for serial adapters based on the FTDI family of USB +serial adapter chips. .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -54,8 +55,29 @@ uftdi_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for various serial adapters based on the FTDI -FT2232C, FT8U100AX and FT8U232AM chips. +driver provides support for various serial adapters based on the +following FTDI chips: +.Pp +.Bl -bullet -compact +.It +FT8U100AX +.It +FT8U232AM +.It +FT8U232BM +.It +FT232R +.It +FT2232C +.It +FT2232D +.It +FT2232H +.It +FT4232H +.It +FT230X +.El .Pp The device is accessed through the .Xr ucom 4 From owner-svn-src-stable-10@FreeBSD.ORG Mon Apr 28 23:46:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6A52836D; Mon, 28 Apr 2014 23:46: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 3BD87113F; Mon, 28 Apr 2014 23:46: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 s3SNk5WY007508; Mon, 28 Apr 2014 23:46:05 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SNk4t1007506; Mon, 28 Apr 2014 23:46:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404282346.s3SNk4t1007506@svn.freebsd.org> From: Ian Lepore Date: Mon, 28 Apr 2014 23:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265064 - stable/10/sys/boot/arm/uboot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 23:46:05 -0000 Author: ian Date: Mon Apr 28 23:46:04 2014 New Revision: 265064 URL: http://svnweb.freebsd.org/changeset/base/265064 Log: MFC r257210, r258527: No hardfloat in ubldr, save/restore r9 for api calls. Modified: stable/10/sys/boot/arm/uboot/Makefile stable/10/sys/boot/arm/uboot/start.S Modified: stable/10/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/10/sys/boot/arm/uboot/Makefile Mon Apr 28 23:16:46 2014 (r265063) +++ stable/10/sys/boot/arm/uboot/Makefile Mon Apr 28 23:46:04 2014 (r265064) @@ -90,7 +90,7 @@ CFLAGS+= -I. CLEANFILES+= vers.c loader.help -CFLAGS+= -ffreestanding +CFLAGS+= -ffreestanding -msoft-float LDFLAGS= -nostdlib -static LDFLAGS+= -T ldscript.generated Modified: stable/10/sys/boot/arm/uboot/start.S ============================================================================== --- stable/10/sys/boot/arm/uboot/start.S Mon Apr 28 23:16:46 2014 (r265063) +++ stable/10/sys/boot/arm/uboot/start.S Mon Apr 28 23:46:04 2014 (r265064) @@ -39,9 +39,10 @@ _start: ldr ip, =uboot_address str sp, [ip] - /* Save U-Boot's r8 */ + /* Save U-Boot's r8 and r9 */ ldr ip, =saved_regs str r8, [ip, #0] + str r9, [ip, #4] #ifdef _ARM_ARCH_6 mrc p15, 0, r2, c1, c0, 0 @@ -57,21 +58,24 @@ _start: * syscall() */ ENTRY(syscall) - /* Save caller's lr and r8 */ + /* Save caller's lr, r8 and r9 */ ldr ip, =saved_regs - str lr, [ip, #4] str r8, [ip, #8] - /* Restore U-Boot's r8 */ + str r9, [ip, #12] + str lr, [ip, #16] + /* Restore U-Boot's r8 and r9 */ ldr r8, [ip, #0] + ldr r9, [ip, #4] /* Call into U-Boot */ ldr lr, =return_from_syscall ldr ip, =syscall_ptr ldr pc, [ip] return_from_syscall: - /* Restore loader's r8 and lr */ + /* Restore loader's r8, r9 and lr */ ldr ip, =saved_regs + ldr lr, [ip, #16] + ldr r9, [ip, #12] ldr r8, [ip, #8] - ldr lr, [ip, #4] /* Return to caller */ mov pc, lr @@ -90,5 +94,7 @@ uboot_address: saved_regs: .long 0 /* U-Boot's r8 */ + .long 0 /* U-Boot's r9 */ .long 0 /* Loader's r8 */ + .long 0 /* Loader's r9 */ .long 0 /* Loader's lr */ From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 29 00:09:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CC722909; Tue, 29 Apr 2014 00:09: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 B860E130C; Tue, 29 Apr 2014 00:09: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 s3T09muB016882; Tue, 29 Apr 2014 00:09:48 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T09m0J016881; Tue, 29 Apr 2014 00:09:48 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404290009.s3T09m0J016881@svn.freebsd.org> From: Ian Lepore Date: Tue, 29 Apr 2014 00:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265065 - stable/10/sys/boot/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 00:09:48 -0000 Author: ian Date: Tue Apr 29 00:09:48 2014 New Revision: 265065 URL: http://svnweb.freebsd.org/changeset/base/265065 Log: MFC r261819 & r262242: Actually validate the header of a loaded dtb file. Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Mon Apr 28 23:46:04 2014 (r265064) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Tue Apr 29 00:09:48 2014 (r265065) @@ -227,10 +227,15 @@ fdt_load_dtb(vm_offset_t va) static int fdt_load_dtb_addr(struct fdt_header *header) { + int err; - // TODO: Verify that there really is an FDT at - // the specified location. fdtp_size = fdt_totalsize(header); + err = fdt_check_header(header); + if (err < 0) { + sprintf(command_errbuf, "error validating blob: %s", + fdt_strerror(err)); + return (err); + } free(fdtp); if ((fdtp = malloc(fdtp_size)) == NULL) { command_errmsg = "can't allocate memory for device tree copy"; @@ -662,7 +667,7 @@ fdt_fixup(void) { const char *env; char *ethstr; - int chosen, err, eth_no, len; + int chosen, eth_no, len; struct sys_info *si; env = NULL; @@ -670,13 +675,8 @@ fdt_fixup(void) ethstr = NULL; len = 0; - if (fdtp == NULL) { - err = fdt_setup_fdtp(); - if (err) { - sprintf(command_errbuf, "No valid device tree blob found!"); - return (0); - } - } + if (fdtp == NULL && fdt_setup_fdtp() != 0) + return (0); /* Create /chosen node (if not exists) */ if ((chosen = fdt_subnode_offset(fdtp, 0, "chosen")) == @@ -742,7 +742,7 @@ fdt_copy(vm_offset_t va) if (fdtp == NULL) { err = fdt_setup_fdtp(); if (err) { - printf("No valid device tree blob found!"); + printf("No valid device tree blob found!\n"); return (0); } } From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 29 00:13:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 22470A66; Tue, 29 Apr 2014 00:13: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 E85231397; Tue, 29 Apr 2014 00:13: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 s3T0DPMG020309; Tue, 29 Apr 2014 00:13:25 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T0DP20020308; Tue, 29 Apr 2014 00:13:25 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404290013.s3T0DP20020308@svn.freebsd.org> From: Ian Lepore Date: Tue, 29 Apr 2014 00:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265066 - stable/10/sys/boot/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 00:13:26 -0000 Author: ian Date: Tue Apr 29 00:13:25 2014 New Revision: 265066 URL: http://svnweb.freebsd.org/changeset/base/265066 Log: MFC r262326 (white space) and r262327 (fdt_addr). This change was supposed to be whitespace only, but a functional change snuck in, as follows: Look for both fdtaddr and fdt_addr env var names. Grepping the u-boot source shows that board vendors seem to be about evenly split on this. The added lines were: /* Board vendors use both fdtaddr and fdt_addr names. Grrrr. */ if (s == NULL) s = ub_env_get("fdt_addr"); Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Tue Apr 29 00:09:48 2014 (r265065) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Tue Apr 29 00:13:25 2014 (r265066) @@ -250,39 +250,42 @@ fdt_load_dtb_addr(struct fdt_header *hea static int fdt_setup_fdtp() { - struct preloaded_file *bfp; - struct fdt_header *hdr; - const char *s; - char *p; - vm_offset_t va; - - if ((bfp = file_findfile(NULL, "dtb")) != NULL) { - printf("Using DTB from loaded file.\n"); - return fdt_load_dtb(bfp->f_addr); - } - - if (fdt_to_load != NULL) { - printf("Using DTB from memory address 0x%08X.\n", - (unsigned int)fdt_to_load); - return fdt_load_dtb_addr(fdt_to_load); - } - - s = ub_env_get("fdtaddr"); - if (s != NULL && *s != '\0') { - hdr = (struct fdt_header *)strtoul(s, &p, 16); - if (*p == '\0') { - printf("Using DTB provided by U-Boot.\n"); - return fdt_load_dtb_addr(hdr); - } - } - - if ((va = fdt_find_static_dtb()) != 0) { - printf("Using DTB compiled into kernel.\n"); - return (fdt_load_dtb(va)); - } - - command_errmsg = "no device tree blob found!"; - return (1); + struct preloaded_file *bfp; + struct fdt_header *hdr; + const char *s; + char *p; + vm_offset_t va; + + if ((bfp = file_findfile(NULL, "dtb")) != NULL) { + printf("Using DTB from loaded file.\n"); + return fdt_load_dtb(bfp->f_addr); + } + + if (fdt_to_load != NULL) { + printf("Using DTB from memory address 0x%08X.\n", + (unsigned int)fdt_to_load); + return fdt_load_dtb_addr(fdt_to_load); + } + + /* Board vendors use both fdtaddr and fdt_addr names. Grrrr. */ + s = ub_env_get("fdtaddr"); + if (s == NULL) + s = ub_env_get("fdt_addr"); + if (s != NULL && *s != '\0') { + hdr = (struct fdt_header *)strtoul(s, &p, 16); + if (*p == '\0') { + printf("Using DTB provided by U-Boot.\n"); + return fdt_load_dtb_addr(hdr); + } + } + + if ((va = fdt_find_static_dtb()) != 0) { + printf("Using DTB compiled into kernel.\n"); + return (fdt_load_dtb(va)); + } + + command_errmsg = "no device tree blob found!"; + return (1); } #define fdt_strtovect(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 29 00:17:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D3745D02; Tue, 29 Apr 2014 00:17: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 BE47013CA; Tue, 29 Apr 2014 00:17: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 s3T0HUCS020901; Tue, 29 Apr 2014 00:17:30 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T0HUOY020900; Tue, 29 Apr 2014 00:17:30 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404290017.s3T0HUOY020900@svn.freebsd.org> From: Ian Lepore Date: Tue, 29 Apr 2014 00:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265067 - stable/10/sys/boot/uboot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 00:17:30 -0000 Author: ian Date: Tue Apr 29 00:17:30 2014 New Revision: 265067 URL: http://svnweb.freebsd.org/changeset/base/265067 Log: MFC r262337: Allow the boot device to be choosen by a u-boot env variable. If a "loaderdev=" env variable is set and the named device exists, it is used. If the device doesn't exist, fall back to the historic "probe" loop that prefers disk devices over network devices. Modified: stable/10/sys/boot/uboot/common/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/uboot/common/main.c ============================================================================== --- stable/10/sys/boot/uboot/common/main.c Tue Apr 29 00:13:25 2014 (r265066) +++ stable/10/sys/boot/uboot/common/main.c Tue Apr 29 00:17:30 2014 (r265067) @@ -120,8 +120,9 @@ int main(void) { struct api_signature *sig = NULL; - int i; + int diskdev, i, netdev, usedev; struct open_file f; + const char * loaderdev; if (!api_search_sig(&sig)) return (-1); @@ -167,8 +168,49 @@ main(void) meminfo(); /* - * March through the device switch probing for things. + * March through the device switch probing for things -- sort of. + * + * The devsw array will have one or two items in it. If + * LOADER_DISK_SUPPORT is defined the first item will be a disk (which + * may not actually work if u-boot didn't supply one). If + * LOADER_NET_SUPPORT is defined the next item will be a network + * interface. Again it may not actually work at the u-boot level. + * + * The original logic was to always use a disk if it could be + * successfully opened, otherwise use the network interface. Now that + * logic is amended to first check whether the u-boot environment + * contains a loaderdev variable which tells us which device to use. If + * it does, we use it and skip the original (second) loop which "probes" + * for a device. We still loop over the devsw just in case it ever gets + * expanded to hold more than 2 devices (but then unit numbers, which + * don't currently exist, may come into play). If the device named by + * loaderdev isn't found, fall back using to the old "probe" loop. + * + * The original probe loop still effectively behaves as it always has: + * the first usable disk device is choosen, and a network device is used + * only if no disk device is found. The logic has been reworked so that + * it examines (and thus lists) every potential device along the way + * instead of breaking out of the loop when the first device is found. */ + loaderdev = ub_env_get("loaderdev"); + usedev = -1; + if (loaderdev != NULL) { + for (i = 0; devsw[i] != NULL; i++) { + if (strcmp(loaderdev, devsw[i]->dv_name) == 0) { + if (devsw[i]->dv_init == NULL) + continue; + if ((devsw[i]->dv_init)() != 0) + continue; + usedev = i; + goto have_device; + } + } + printf("U-Boot env contains 'loaderdev=%s', " + "device not found.\n", loaderdev); + } + printf("Probing for bootable devices...\n"); + diskdev = -1; + netdev = -1; for (i = 0; devsw[i] != NULL; i++) { if (devsw[i]->dv_init == NULL) @@ -176,27 +218,43 @@ main(void) if ((devsw[i]->dv_init)() != 0) continue; - printf("\nDevice: %s\n", devsw[i]->dv_name); - - currdev.d_dev = devsw[i]; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = 0; + printf("Bootable device: %s\n", devsw[i]->dv_name); if (strncmp(devsw[i]->dv_name, "disk", strlen(devsw[i]->dv_name)) == 0) { f.f_devdata = &currdev; + currdev.d_dev = devsw[i]; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = 0; currdev.d_disk.slice = 0; - if (devsw[i]->dv_open(&f,&currdev) == 0) - break; + if (devsw[i]->dv_open(&f, &currdev) == 0) { + devsw[i]->dv_close(&f); + if (diskdev == -1) + diskdev = i; + } + } else if (strncmp(devsw[i]->dv_name, "net", + strlen(devsw[i]->dv_name)) == 0) { + if (netdev == -1) + netdev = i; } - - if (strncmp(devsw[i]->dv_name, "net", - strlen(devsw[i]->dv_name)) == 0) - break; } - if (devsw[i] == NULL) - panic("No boot device found!"); + if (diskdev != -1) + usedev = diskdev; + else if (netdev != -1) + usedev = netdev; + else + panic("No bootable devices found!\n"); + +have_device: + + currdev.d_dev = devsw[usedev]; + currdev.d_type = devsw[usedev]->dv_type; + currdev.d_unit = 0; + if (currdev.d_type == DEV_TYP_STOR) + currdev.d_disk.slice = 0; + + printf("Current device: %s\n", currdev.d_dev->dv_name); env_setenv("currdev", EV_VOLATILE, uboot_fmtdev(&currdev), uboot_setcurrdev, env_nounset); From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 29 00:31:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 237D4B5; Tue, 29 Apr 2014 00:31:33 +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 035E415DC; Tue, 29 Apr 2014 00:31:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3T0VWbZ026664; Tue, 29 Apr 2014 00:31:32 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T0VWt1026659; Tue, 29 Apr 2014 00:31:32 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404290031.s3T0VWt1026659@svn.freebsd.org> From: Ian Lepore Date: Tue, 29 Apr 2014 00:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265068 - in stable/10/sys/boot: common fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 00:31:33 -0000 Author: ian Date: Tue Apr 29 00:31:32 2014 New Revision: 265068 URL: http://svnweb.freebsd.org/changeset/base/265068 Log: MFC r262340, r262345, r262347, find and load an appropriate dtb file. The search order for a usable dtb in fdt_setup_fdtp() is now - A dtb loaded with an explicit "load -t dtb" command. - A dtb already loaded into memory somehow[*] and pointed to by fdt_to_load. - A dtb in the memory pointed to by the u-boot env vars fdtaddr or fdt_addr. - A file named by the u-boot env vars fdtfile or fdt_file. - A static dtb compiled into the kernel. * Presumably by some arch-specific command or code. Modified: stable/10/sys/boot/common/bootstrap.h stable/10/sys/boot/common/module.c stable/10/sys/boot/fdt/fdt_loader_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/bootstrap.h ============================================================================== --- stable/10/sys/boot/common/bootstrap.h Tue Apr 29 00:17:30 2014 (r265067) +++ stable/10/sys/boot/common/bootstrap.h Tue Apr 29 00:31:32 2014 (r265068) @@ -233,6 +233,7 @@ int mod_loadkld(const char *name, int struct preloaded_file *file_alloc(void); struct preloaded_file *file_findfile(char *name, char *type); struct file_metadata *file_findmetadata(struct preloaded_file *fp, int type); +struct preloaded_file *file_loadraw(char *name, char *type); void file_discard(struct preloaded_file *fp); void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); int file_addmodule(struct preloaded_file *fp, char *modname, int version, Modified: stable/10/sys/boot/common/module.c ============================================================================== --- stable/10/sys/boot/common/module.c Tue Apr 29 00:17:30 2014 (r265067) +++ stable/10/sys/boot/common/module.c Tue Apr 29 00:31:32 2014 (r265068) @@ -52,7 +52,6 @@ struct moduledir { }; static int file_load(char *filename, vm_offset_t dest, struct preloaded_file **result); -static int file_loadraw(char *type, char *name); static int file_load_dependencies(struct preloaded_file *base_mod); static char * file_search(const char *name, char **extlist); static struct kernel_module * file_findmodule(struct preloaded_file *fp, char *modname, struct mod_depend *verinfo); @@ -134,7 +133,7 @@ command_load(int argc, char *argv[]) command_errmsg = "invalid load type"; return(CMD_ERROR); } - return(file_loadraw(typestr, argv[1])); + return(file_loadraw(argv[1], typestr) ? CMD_OK : CMD_ERROR); } /* * Do we have explicit KLD load ? @@ -189,7 +188,7 @@ command_load_geli(int argc, char *argv[] argv += (optind - 1); argc -= (optind - 1); sprintf(typestr, "%s:geli_keyfile%d", argv[1], num); - return(file_loadraw(typestr, argv[2])); + return(file_loadraw(argv[2], typestr) ? CMD_OK : CMD_ERROR); } COMMAND_SET(unload, "unload", "unload all modules", command_unload); @@ -357,8 +356,8 @@ file_load_dependencies(struct preloaded_ * We've been asked to load (name) as (type), so just suck it in, * no arguments or anything. */ -int -file_loadraw(char *type, char *name) +struct preloaded_file * +file_loadraw(char *name, char *type) { struct preloaded_file *fp; char *cp; @@ -368,21 +367,21 @@ file_loadraw(char *type, char *name) /* We can't load first */ if ((file_findfile(NULL, NULL)) == NULL) { command_errmsg = "can't load file before kernel"; - return(CMD_ERROR); + return(NULL); } /* locate the file on the load path */ cp = file_search(name, NULL); if (cp == NULL) { sprintf(command_errbuf, "can't find '%s'", name); - return(CMD_ERROR); + return(NULL); } name = cp; if ((fd = open(name, O_RDONLY)) < 0) { sprintf(command_errbuf, "can't open '%s': %s", name, strerror(errno)); free(name); - return(CMD_ERROR); + return(NULL); } if (archsw.arch_loadaddr != NULL) @@ -398,7 +397,7 @@ file_loadraw(char *type, char *name) sprintf(command_errbuf, "error reading '%s': %s", name, strerror(errno)); free(name); close(fd); - return(CMD_ERROR); + return(NULL); } laddr += got; } @@ -419,7 +418,7 @@ file_loadraw(char *type, char *name) /* Add to the list of loaded files */ file_insert_tail(fp); close(fd); - return(CMD_OK); + return(fp); } /* Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Tue Apr 29 00:17:30 2014 (r265067) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Tue Apr 29 00:31:32 2014 (r265068) @@ -128,6 +128,8 @@ fdt_find_static_dtb() char *strp; int i, sym_count; + debugf("fdt_find_static_dtb()\n"); + sym_count = symtab = strtab = 0; strp = NULL; @@ -189,6 +191,8 @@ fdt_load_dtb(vm_offset_t va) struct fdt_header header; int err; + debugf("fdt_load_dtb(0x%08jx)\n", (uintmax_t)va); + COPYOUT(va, &header, sizeof(header)); err = fdt_check_header(&header); if (err < 0) { @@ -229,6 +233,8 @@ fdt_load_dtb_addr(struct fdt_header *hea { int err; + debugf("fdt_load_dtb_addr(0x%p)\n", header); + fdtp_size = fdt_totalsize(header); err = fdt_check_header(header); if (err < 0) { @@ -248,6 +254,32 @@ fdt_load_dtb_addr(struct fdt_header *hea } static int +fdt_load_dtb_file(const char * filename) +{ + struct preloaded_file *bfp, *oldbfp; + int err; + + debugf("fdt_load_dtb_file(%s)\n", filename); + + oldbfp = file_findfile(NULL, "dtb"); + + /* Attempt to load and validate a new dtb from a file. */ + if ((bfp = file_loadraw(filename, "dtb")) == NULL) { + sprintf(command_errbuf, "failed to load file '%s'", filename); + return (1); + } + if ((err = fdt_load_dtb(bfp->f_addr)) != 0) { + file_discard(bfp); + return (err); + } + + /* A new dtb was validated, discard any previous file. */ + if (oldbfp) + file_discard(oldbfp); + return (0); +} + +static int fdt_setup_fdtp() { struct preloaded_file *bfp; @@ -256,35 +288,68 @@ fdt_setup_fdtp() char *p; vm_offset_t va; + debugf("fdt_setup_fdtp()\n"); + + /* If we already loaded a file, use it. */ if ((bfp = file_findfile(NULL, "dtb")) != NULL) { - printf("Using DTB from loaded file.\n"); - return fdt_load_dtb(bfp->f_addr); + if (fdt_load_dtb(bfp->f_addr) == 0) { + printf("Using DTB from loaded file '%s'.\n", + bfp->f_name); + return (0); + } } - + + /* If we were given the address of a valid blob in memory, use it. */ if (fdt_to_load != NULL) { - printf("Using DTB from memory address 0x%08X.\n", - (unsigned int)fdt_to_load); - return fdt_load_dtb_addr(fdt_to_load); + if (fdt_load_dtb_addr(fdt_to_load) == 0) { + printf("Using DTB from memory address 0x%08X.\n", + (unsigned int)fdt_to_load); + return (0); + } } - /* Board vendors use both fdtaddr and fdt_addr names. Grrrr. */ + /* + * If the U-boot environment contains a variable giving the address of a + * valid blob in memory, use it. Board vendors use both fdtaddr and + * fdt_addr names. + */ s = ub_env_get("fdtaddr"); if (s == NULL) s = ub_env_get("fdt_addr"); if (s != NULL && *s != '\0') { hdr = (struct fdt_header *)strtoul(s, &p, 16); if (*p == '\0') { - printf("Using DTB provided by U-Boot.\n"); - return fdt_load_dtb_addr(hdr); + if (fdt_load_dtb_addr(hdr) == 0) { + printf("Using DTB provided by U-Boot at " + "address 0x%p.\n", hdr); + return (0); + } } } - + + /* + * If the U-boot environment contains a variable giving the name of a + * file, use it if we can load and validate it. + */ + s = ub_env_get("fdtfile"); + if (s == NULL) + s = ub_env_get("fdt_file"); + if (s != NULL && *s != '\0') { + if (fdt_load_dtb_file(s) == 0) { + printf("Loaded DTB from file '%s'.\n", s); + return (0); + } + } + + /* If there is a dtb compiled into the kernel, use it. */ if ((va = fdt_find_static_dtb()) != 0) { - printf("Using DTB compiled into kernel.\n"); - return (fdt_load_dtb(va)); + if (fdt_load_dtb(va) == 0) { + printf("Using DTB compiled into kernel.\n"); + return (0); + } } - command_errmsg = "no device tree blob found!"; + command_errmsg = "No device tree blob found!\n"; return (1); } @@ -678,6 +743,8 @@ fdt_fixup(void) ethstr = NULL; len = 0; + debugf("fdt_fixup()\n"); + if (fdtp == NULL && fdt_setup_fdtp() != 0) return (0); @@ -741,7 +808,7 @@ int fdt_copy(vm_offset_t va) { int err; - + debugf("fdt_copy va 0x%08x\n", va); if (fdtp == NULL) { err = fdt_setup_fdtp(); if (err) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 29 00:36:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 48FC4465; Tue, 29 Apr 2014 00:36: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 34EB4163C; Tue, 29 Apr 2014 00:36: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 s3T0arfY028996; Tue, 29 Apr 2014 00:36:53 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T0aqKj028991; Tue, 29 Apr 2014 00:36:52 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404290036.s3T0aqKj028991@svn.freebsd.org> From: Ian Lepore Date: Tue, 29 Apr 2014 00:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265069 - in stable/10/sys/boot: fdt uboot/common uboot/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 00:36:53 -0000 Author: ian Date: Tue Apr 29 00:36:51 2014 New Revision: 265069 URL: http://svnweb.freebsd.org/changeset/base/265069 Log: MFC r262664, r262694: Prevent fdt data loaded from a file from overwriting the kernel environment, by having uboot_autoload() do the fdt setup (which may load a file) rather than waiting until we're actually in the process of launching the kernel. As part of making this happen... - Define LOADER_FDT_SUPPORT on the uboot/lib compile command line when MK_FDT is set. - Make fdt_setup_fdtb() public. - Declare public fdt_whatever() functions in a header instead of using scattered extern decls in .c files. Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c stable/10/sys/boot/uboot/common/metadata.c stable/10/sys/boot/uboot/lib/Makefile stable/10/sys/boot/uboot/lib/libuboot.h stable/10/sys/boot/uboot/lib/module.c Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Tue Apr 29 00:31:32 2014 (r265068) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Tue Apr 29 00:36:51 2014 (r265069) @@ -279,7 +279,7 @@ fdt_load_dtb_file(const char * filename) return (0); } -static int +int fdt_setup_fdtp() { struct preloaded_file *bfp; Modified: stable/10/sys/boot/uboot/common/metadata.c ============================================================================== --- stable/10/sys/boot/uboot/common/metadata.c Tue Apr 29 00:31:32 2014 (r265068) +++ stable/10/sys/boot/uboot/common/metadata.c Tue Apr 29 00:36:51 2014 (r265069) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #if defined(LOADER_FDT_SUPPORT) -extern int fdt_copy(vm_offset_t); +#include "libuboot.h" #endif /* Modified: stable/10/sys/boot/uboot/lib/Makefile ============================================================================== --- stable/10/sys/boot/uboot/lib/Makefile Tue Apr 29 00:31:32 2014 (r265068) +++ stable/10/sys/boot/uboot/lib/Makefile Tue Apr 29 00:36:51 2014 (r265069) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../common LIB= uboot @@ -18,6 +20,16 @@ SRCS+= disk.c CFLAGS+= -DLOADER_DISK_SUPPORT .endif +.if ${MK_FDT} != "no" +LOADER_FDT_SUPPORT= yes +.else +LOADER_FDT_SUPPORT= no +.endif + +.if ${LOADER_FDT_SUPPORT} == "yes" +CFLAGS+= -DLOADER_FDT_SUPPORT +.endif + # Pick up FDT includes CFLAGS+= -I${.CURDIR}/../../../../sys/contrib/libfdt/ Modified: stable/10/sys/boot/uboot/lib/libuboot.h ============================================================================== --- stable/10/sys/boot/uboot/lib/libuboot.h Tue Apr 29 00:31:32 2014 (r265068) +++ stable/10/sys/boot/uboot/lib/libuboot.h Tue Apr 29 00:36:51 2014 (r265069) @@ -69,3 +69,9 @@ struct file_format; extern struct file_format uboot_elf; void reboot(void); + +#if defined(LOADER_FDT_SUPPORT) +extern int fdt_setup_fdtp(); +extern int fdt_copy(vm_offset_t); +#endif + Modified: stable/10/sys/boot/uboot/lib/module.c ============================================================================== --- stable/10/sys/boot/uboot/lib/module.c Tue Apr 29 00:31:32 2014 (r265068) +++ stable/10/sys/boot/uboot/lib/module.c Tue Apr 29 00:36:51 2014 (r265069) @@ -29,19 +29,23 @@ __FBSDID("$FreeBSD$"); /* * U-Boot-specific module functionality. - * - * XXX not much for now... - * */ #include #include #include "bootstrap.h" +#include "libuboot.h" int uboot_autoload(void) { +#if defined(LOADER_FDT_SUPPORT) + int err; + + if ((err = fdt_setup_fdtp()) != 0) + return (err); +#endif return(0); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 29 00:38:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 82B4F640; Tue, 29 Apr 2014 00:38: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 6E45A1663; Tue, 29 Apr 2014 00:38: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 s3T0clbx029229; Tue, 29 Apr 2014 00:38:47 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T0clCP029228; Tue, 29 Apr 2014 00:38:47 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404290038.s3T0clCP029228@svn.freebsd.org> From: Ian Lepore Date: Tue, 29 Apr 2014 00:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265070 - stable/10/sys/boot/uboot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 00:38:47 -0000 Author: ian Date: Tue Apr 29 00:38:46 2014 New Revision: 265070 URL: http://svnweb.freebsd.org/changeset/base/265070 Log: MFC r262666: exit with code 0xbadab1 if the u-boot API support is missing. Modified: stable/10/sys/boot/uboot/common/main.c Modified: stable/10/sys/boot/uboot/common/main.c ============================================================================== --- stable/10/sys/boot/uboot/common/main.c Tue Apr 29 00:36:51 2014 (r265069) +++ stable/10/sys/boot/uboot/common/main.c Tue Apr 29 00:38:46 2014 (r265070) @@ -124,15 +124,21 @@ main(void) struct open_file f; const char * loaderdev; + /* + * If we can't find the magic signature and related info, exit with a + * unique error code that U-Boot reports as "## Application terminated, + * rc = 0xnnbadab1". Hopefully 'badab1' looks enough like "bad api" to + * provide a clue. It's better than 0xffffffff anyway. + */ if (!api_search_sig(&sig)) - return (-1); + return (0x01badab1); syscall_ptr = sig->syscall; if (syscall_ptr == NULL) - return (-2); + return (0x02badab1); if (sig->version > API_SIG_VERSION) - return (-3); + return (0x03badab1); /* Clear BSS sections */ bzero(__sbss_start, __sbss_end - __sbss_start); From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 29 00:45:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0E204903; Tue, 29 Apr 2014 00:45: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 EC4071723; Tue, 29 Apr 2014 00:45:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3T0jhhj032980; Tue, 29 Apr 2014 00:45:43 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T0jhxD032973; Tue, 29 Apr 2014 00:45:43 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404290045.s3T0jhxD032973@svn.freebsd.org> From: Ian Lepore Date: Tue, 29 Apr 2014 00:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265071 - in stable/10/sys/boot/uboot: common lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 00:45:44 -0000 Author: ian Date: Tue Apr 29 00:45:42 2014 New Revision: 265071 URL: http://svnweb.freebsd.org/changeset/base/265071 Log: MFC r263052, r263124, r263265, r263267... Enhance loaderdev env var. Enhance the mechanism that lets you configure the ubldr boot device by setting the u-boot environment variable loaderdev=. It used to accept only 'disk' or 'net'. Now it allows specification of unit, slice, and partition as well. In addition to the generic 'disk' it also accepts specific storage device types such as 'mmc' or 'sata'. If there isn't a loaderdev env var, the historical behavior is maintained. It will use the first storage device it finds, or a network device if no working storage device exists. 99% of the work on this was done by Patrick Kelsey, but I made some changes, so if anything goes wrong, blame me. (Indeed, the 3 followup commits fixed things I got wrong on the first.) Modified: stable/10/sys/boot/uboot/common/main.c stable/10/sys/boot/uboot/lib/api_public.h stable/10/sys/boot/uboot/lib/disk.c stable/10/sys/boot/uboot/lib/glue.c stable/10/sys/boot/uboot/lib/libuboot.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/uboot/common/main.c ============================================================================== --- stable/10/sys/boot/uboot/common/main.c Tue Apr 29 00:38:46 2014 (r265070) +++ stable/10/sys/boot/uboot/common/main.c Tue Apr 29 00:45:42 2014 (r265071) @@ -36,10 +36,27 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #include "libuboot.h" +#ifndef nitems +#define nitems(x) (sizeof((x)) / sizeof((x)[0])) +#endif + struct uboot_devdesc currdev; struct arch_switch archsw; /* MI/MD interface boundary */ int devs_no; +struct device_type { + const char *name; + int type; +} device_types[] = { + { "disk", DEV_TYP_STOR }, + { "ide", DEV_TYP_STOR | DT_STOR_IDE }, + { "mmc", DEV_TYP_STOR | DT_STOR_MMC }, + { "sata", DEV_TYP_STOR | DT_STOR_SATA }, + { "scsi", DEV_TYP_STOR | DT_STOR_SCSI }, + { "usb", DEV_TYP_STOR | DT_STOR_USB }, + { "net", DEV_TYP_NET } +}; + extern char end[]; extern char bootprog_name[]; extern char bootprog_rev[]; @@ -111,17 +128,265 @@ meminfo(void) for (i = 0; i < 3; i++) { size = memsize(si, t[i]); if (size > 0) - printf("%s:\t %lldMB\n", ub_mem_type(t[i]), + printf("%s: %lldMB\n", ub_mem_type(t[i]), size / 1024 / 1024); } } +static const char * +get_device_type(const char *devstr, int *devtype) +{ + int i; + int namelen; + struct device_type *dt; + + if (devstr) { + for (i = 0; i < nitems(device_types); i++) { + dt = &device_types[i]; + namelen = strlen(dt->name); + if (strncmp(dt->name, devstr, namelen) == 0) { + *devtype = dt->type; + return (devstr + namelen); + } + } + printf("Unknown device type '%s'\n", devstr); + } + + *devtype = -1; + return (NULL); +} + +static const char * +device_typename(int type) +{ + int i; + + for (i = 0; i < nitems(device_types); i++) + if (device_types[i].type == type) + return (device_types[i].name); + + return (""); +} + +/* + * Parse a device string into type, unit, slice and partition numbers. A + * returned value of -1 for type indicates a search should be done for the + * first loadable device, otherwise a returned value of -1 for unit + * indicates a search should be done for the first loadable device of the + * given type. + * + * The returned values for slice and partition are interpreted by + * disk_open(). + * + * Valid device strings: For device types: + * + * DEV_TYP_STOR, DEV_TYP_NET + * DEV_TYP_STOR, DEV_TYP_NET + * : DEV_TYP_STOR, DEV_TYP_NET + * : DEV_TYP_STOR + * :. DEV_TYP_STOR + * :. DEV_TYP_STOR + * + * For valid type names, see the device_types array, above. + * + * Slice numbers are 1-based. 0 is a wildcard. + */ +static void +get_load_device(int *type, int *unit, int *slice, int *partition) +{ + char *devstr; + const char *p; + char *endp; + + *type = -1; + *unit = -1; + *slice = 0; + *partition = -1; + + devstr = ub_env_get("loaderdev"); + if (devstr == NULL) { + printf("U-Boot env: loaderdev not set, will probe all devices.\n"); + return; + } + printf("U-Boot env: loaderdev='%s'\n", devstr); + + p = get_device_type(devstr, type); + + /* + * Empty device string, or unknown device name, or a bare, known + * device name. + */ + if ((*type == -1) || (*p == '\0')) { + return; + } + + /* Malformed unit number. */ + if (!isdigit(*p)) { + *type = -1; + return; + } + + /* Guaranteed to extract a number from the string, as *p is a digit. */ + *unit = strtol(p, &endp, 10); + p = endp; + + /* Known device name with unit number and nothing else. */ + if (*p == '\0') { + return; + } + + /* Device string is malformed beyond unit number. */ + if (*p != ':') { + *type = -1; + *unit = -1; + return; + } + + p++; + + /* No slice and partition specification. */ + if ('\0' == *p ) + return; + + /* Only DEV_TYP_STOR devices can have a slice specification. */ + if (!(*type & DEV_TYP_STOR)) { + *type = -1; + *unit = -1; + return; + } + + *slice = strtoul(p, &endp, 10); + + /* Malformed slice number. */ + if (p == endp) { + *type = -1; + *unit = -1; + *slice = 0; + return; + } + + p = endp; + + /* No partition specification. */ + if (*p == '\0') + return; + + /* Device string is malformed beyond slice number. */ + if (*p != '.') { + *type = -1; + *unit = -1; + *slice = 0; + return; + } + + p++; + + /* No partition specification. */ + if (*p == '\0') + return; + + *partition = strtol(p, &endp, 10); + p = endp; + + /* Full, valid device string. */ + if (*endp == '\0') + return; + + /* Junk beyond partition number. */ + *type = -1; + *unit = -1; + *slice = 0; + *partition = -1; +} + +static void +print_disk_probe_info() +{ + char slice[32]; + char partition[32]; + + if (currdev.d_disk.slice > 0) + sprintf(slice, "%d", currdev.d_disk.slice); + else + strcpy(slice, ""); + + if (currdev.d_disk.partition > 0) + sprintf(partition, "%d", currdev.d_disk.partition); + else + strcpy(partition, ""); + + printf(" Checking unit=%d slice=%s partition=%s...", + currdev.d_unit, slice, partition); + +} + +static int +probe_disks(int devidx, int load_type, int load_unit, int load_slice, + int load_partition) +{ + int open_result, unit; + struct open_file f; + + currdev.d_disk.slice = load_slice; + currdev.d_disk.partition = load_partition; + + f.f_devdata = &currdev; + open_result = -1; + + if (load_type == -1) { + printf(" Probing all disk devices...\n"); + /* Try each disk in succession until one works. */ + for (currdev.d_unit = 0; currdev.d_unit < UB_MAX_DEV; + currdev.d_unit++) { + print_disk_probe_info(); + open_result = devsw[devidx]->dv_open(&f, &currdev); + if (open_result == 0) { + printf(" good.\n"); + return (0); + } + printf("\n"); + } + return (-1); + } + + if (load_unit == -1) { + printf(" Probing all %s devices...\n", device_typename(load_type)); + /* Try each disk of given type in succession until one works. */ + for (unit = 0; unit < UB_MAX_DEV; unit++) { + currdev.d_unit = uboot_diskgetunit(load_type, unit); + if (currdev.d_unit == -1) + break; + print_disk_probe_info(); + open_result = devsw[devidx]->dv_open(&f, &currdev); + if (open_result == 0) { + printf(" good.\n"); + return (0); + } + printf("\n"); + } + return (-1); + } + + if ((currdev.d_unit = uboot_diskgetunit(load_type, load_unit)) != -1) { + print_disk_probe_info(); + open_result = devsw[devidx]->dv_open(&f,&currdev); + if (open_result == 0) { + printf(" good.\n"); + return (0); + } + printf("\n"); + } + + printf(" Requested disk type/unit not found\n"); + return (-1); +} + int main(void) { struct api_signature *sig = NULL; - int diskdev, i, netdev, usedev; - struct open_file f; + int load_type, load_unit, load_slice, load_partition; + int i; const char * loaderdev; /* @@ -145,21 +410,26 @@ main(void) bzero(__bss_start, _end - __bss_start); /* - * Set up console. - */ + * Initialise the heap as early as possible. Once this is done, + * alloc() is usable. The stack is buried inside us, so this is safe. + */ + setheap((void *)end, (void *)(end + 512 * 1024)); + + /* + * Set up console. + */ cons_probe(); + printf("Compatible U-Boot API signature found @%x\n", (uint32_t)sig); - printf("Compatible API signature found @%x\n", (uint32_t)sig); + printf("\n"); + printf("%s, Revision %s\n", bootprog_name, bootprog_rev); + printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n"); dump_sig(sig); dump_addr_info(); - /* - * Initialise the heap as early as possible. Once this is done, - * alloc() is usable. The stack is buried inside us, so this is - * safe. - */ - setheap((void *)end, (void *)(end + 512 * 1024)); + meminfo(); /* * Enumerate U-Boot devices @@ -168,55 +438,11 @@ main(void) panic("no U-Boot devices found"); printf("Number of U-Boot devices: %d\n", devs_no); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); - meminfo(); + get_load_device(&load_type, &load_unit, &load_slice, &load_partition); /* - * March through the device switch probing for things -- sort of. - * - * The devsw array will have one or two items in it. If - * LOADER_DISK_SUPPORT is defined the first item will be a disk (which - * may not actually work if u-boot didn't supply one). If - * LOADER_NET_SUPPORT is defined the next item will be a network - * interface. Again it may not actually work at the u-boot level. - * - * The original logic was to always use a disk if it could be - * successfully opened, otherwise use the network interface. Now that - * logic is amended to first check whether the u-boot environment - * contains a loaderdev variable which tells us which device to use. If - * it does, we use it and skip the original (second) loop which "probes" - * for a device. We still loop over the devsw just in case it ever gets - * expanded to hold more than 2 devices (but then unit numbers, which - * don't currently exist, may come into play). If the device named by - * loaderdev isn't found, fall back using to the old "probe" loop. - * - * The original probe loop still effectively behaves as it always has: - * the first usable disk device is choosen, and a network device is used - * only if no disk device is found. The logic has been reworked so that - * it examines (and thus lists) every potential device along the way - * instead of breaking out of the loop when the first device is found. + * March through the device switch probing for things. */ - loaderdev = ub_env_get("loaderdev"); - usedev = -1; - if (loaderdev != NULL) { - for (i = 0; devsw[i] != NULL; i++) { - if (strcmp(loaderdev, devsw[i]->dv_name) == 0) { - if (devsw[i]->dv_init == NULL) - continue; - if ((devsw[i]->dv_init)() != 0) - continue; - usedev = i; - goto have_device; - } - } - printf("U-Boot env contains 'loaderdev=%s', " - "device not found.\n", loaderdev); - } - printf("Probing for bootable devices...\n"); - diskdev = -1; - netdev = -1; for (i = 0; devsw[i] != NULL; i++) { if (devsw[i]->dv_init == NULL) @@ -224,43 +450,33 @@ main(void) if ((devsw[i]->dv_init)() != 0) continue; - printf("Bootable device: %s\n", devsw[i]->dv_name); + printf("Found U-Boot device: %s\n", devsw[i]->dv_name); - if (strncmp(devsw[i]->dv_name, "disk", - strlen(devsw[i]->dv_name)) == 0) { - f.f_devdata = &currdev; - currdev.d_dev = devsw[i]; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = 0; - currdev.d_disk.slice = 0; - if (devsw[i]->dv_open(&f, &currdev) == 0) { - devsw[i]->dv_close(&f); - if (diskdev == -1) - diskdev = i; - } - } else if (strncmp(devsw[i]->dv_name, "net", - strlen(devsw[i]->dv_name)) == 0) { - if (netdev == -1) - netdev = i; + currdev.d_dev = devsw[i]; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = 0; + + if ((load_type == -1 || (load_type & DEV_TYP_STOR)) && + strcmp(devsw[i]->dv_name, "disk") == 0) { + if (probe_disks(i, load_type, load_unit, load_slice, + load_partition) == 0) + break; } - } - if (diskdev != -1) - usedev = diskdev; - else if (netdev != -1) - usedev = netdev; - else - panic("No bootable devices found!\n"); - -have_device: - - currdev.d_dev = devsw[usedev]; - currdev.d_type = devsw[usedev]->dv_type; - currdev.d_unit = 0; - if (currdev.d_type == DEV_TYP_STOR) - currdev.d_disk.slice = 0; + if ((load_type == -1 || (load_type & DEV_TYP_NET)) && + strcmp(devsw[i]->dv_name, "net") == 0) + break; + } - printf("Current device: %s\n", currdev.d_dev->dv_name); + /* + * If we couldn't find a boot device, return an error to u-boot. + * U-boot may be running a boot script that can try something different + * so returning an error is better than forcing a reboot. + */ + if (devsw[i] == NULL) { + printf("No boot device found!\n"); + return (0xbadef1ce); + } env_setenv("currdev", EV_VOLATILE, uboot_fmtdev(&currdev), uboot_setcurrdev, env_nounset); Modified: stable/10/sys/boot/uboot/lib/api_public.h ============================================================================== --- stable/10/sys/boot/uboot/lib/api_public.h Tue Apr 29 00:38:46 2014 (r265070) +++ stable/10/sys/boot/uboot/lib/api_public.h Tue Apr 29 00:45:42 2014 (r265071) @@ -132,7 +132,7 @@ typedef unsigned long lbastart_t; #define DT_STOR_SCSI 0x0020 #define DT_STOR_USB 0x0040 #define DT_STOR_MMC 0x0080 -#define DT_STOR_NAND 0x0100 +#define DT_STOR_SATA 0x0100 #define DEV_STA_CLOSED 0x0000 /* invalid, closed */ #define DEV_STA_OPEN 0x0001 /* open i.e. active */ Modified: stable/10/sys/boot/uboot/lib/disk.c ============================================================================== --- stable/10/sys/boot/uboot/lib/disk.c Tue Apr 29 00:38:46 2014 (r265070) +++ stable/10/sys/boot/uboot/lib/disk.c Tue Apr 29 00:45:42 2014 (r265071) @@ -278,3 +278,26 @@ stor_ioctl(struct open_file *f, u_long c return (0); } + +/* + * Return the device unit number for the given type and type-relative unit + * number. + */ +int +uboot_diskgetunit(int type, int type_unit) +{ + int local_type_unit; + int i; + + local_type_unit = 0; + for (i = 0; i < stor_info_no; i++) { + if ((stor_info[i].type & type) == type) { + if (local_type_unit == type_unit) { + return (i); + } + local_type_unit++; + } + } + + return (-1); +} Modified: stable/10/sys/boot/uboot/lib/glue.c ============================================================================== --- stable/10/sys/boot/uboot/lib/glue.c Tue Apr 29 00:38:46 2014 (r265070) +++ stable/10/sys/boot/uboot/lib/glue.c Tue Apr 29 00:45:42 2014 (r265071) @@ -404,8 +404,8 @@ ub_stor_type(int type) if (type & DT_STOR_MMC) return ("MMC"); - if (type & DT_STOR_NAND) - return ("NAND"); + if (type & DT_STOR_SATA) + return ("SATA"); return ("Unknown"); } Modified: stable/10/sys/boot/uboot/lib/libuboot.h ============================================================================== --- stable/10/sys/boot/uboot/lib/libuboot.h Tue Apr 29 00:38:46 2014 (r265070) +++ stable/10/sys/boot/uboot/lib/libuboot.h Tue Apr 29 00:45:42 2014 (r265071) @@ -32,9 +32,9 @@ struct uboot_devdesc struct devsw *d_dev; int d_type; int d_unit; + void *d_opendata; union { struct { - void *data; int slice; int partition; off_t offset; @@ -70,6 +70,8 @@ extern struct file_format uboot_elf; void reboot(void); +int uboot_diskgetunit(int type, int type_unit); + #if defined(LOADER_FDT_SUPPORT) extern int fdt_setup_fdtp(); extern int fdt_copy(vm_offset_t); From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 29 03:36:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D639FA94; Tue, 29 Apr 2014 03:36: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 C333995F; Tue, 29 Apr 2014 03:36: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 s3T3a4fs003365; Tue, 29 Apr 2014 03:36:04 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T3a45A003364; Tue, 29 Apr 2014 03:36:04 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201404290336.s3T3a45A003364@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Apr 2014 03:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265073 - stable/10/lib/libproc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 03:36:04 -0000 Author: markj Date: Tue Apr 29 03:36:04 2014 New Revision: 265073 URL: http://svnweb.freebsd.org/changeset/base/265073 Log: MFC r264436: Fix some off-by-one errors. The kve_end and rdl_eaddr fields contain the first address after the end of the map entry and should therefore be excluded. Modified: stable/10/lib/libproc/proc_sym.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libproc/proc_sym.c ============================================================================== --- stable/10/lib/libproc/proc_sym.c Tue Apr 29 01:17:43 2014 (r265072) +++ stable/10/lib/libproc/proc_sym.c Tue Apr 29 03:36:04 2014 (r265073) @@ -96,7 +96,7 @@ proc_objname(struct proc_handle *p, uint for (i = 0; i < p->nobjs; i++) { rdl = &p->rdobjs[i]; - if (addr >= rdl->rdl_saddr && addr <= rdl->rdl_eaddr) { + if (addr >= rdl->rdl_saddr && addr < rdl->rdl_eaddr) { strlcpy(objname, rdl->rdl_path, objnamesz); return (objname); } @@ -176,7 +176,7 @@ proc_addr2map(struct proc_handle *p, uin kve = kves + i; if (kve->kve_type == KVME_TYPE_VNODE) lastvn = i; - if (addr >= kve->kve_start && addr <= kve->kve_end) { + if (addr >= kve->kve_start && addr < kve->kve_end) { if ((map = malloc(sizeof(*map))) == NULL) { free(kves); return (NULL); @@ -209,7 +209,7 @@ proc_addr2map(struct proc_handle *p, uin for (i = 0; i < p->nobjs; i++) { rdl = &p->rdobjs[i]; - if (addr >= rdl->rdl_saddr && addr <= rdl->rdl_eaddr) { + if (addr >= rdl->rdl_saddr && addr < rdl->rdl_eaddr) { if ((map = malloc(sizeof(*map))) == NULL) return (NULL); proc_rdl2prmap(rdl, map); From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 29 03:49:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5343FE9F; Tue, 29 Apr 2014 03:49: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 41321A48; Tue, 29 Apr 2014 03:49: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 s3T3nfrA007936; Tue, 29 Apr 2014 03:49:41 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T3nf73007935; Tue, 29 Apr 2014 03:49:41 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201404290349.s3T3nf73007935@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Apr 2014 03:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265075 - stable/10/sbin/savecore X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 03:49:41 -0000 Author: markj Date: Tue Apr 29 03:49:40 2014 New Revision: 265075 URL: http://svnweb.freebsd.org/changeset/base/265075 Log: MFC r262775: Log the name of the file that we failed to open rather than an uninitialized buffer. Modified: stable/10/sbin/savecore/savecore.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/savecore/savecore.c ============================================================================== --- stable/10/sbin/savecore/savecore.c Tue Apr 29 03:37:30 2014 (r265074) +++ stable/10/sbin/savecore/savecore.c Tue Apr 29 03:49:40 2014 (r265075) @@ -618,7 +618,7 @@ DoFile(const char *savedir, const char * */ fdinfo = open(infoname, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fdinfo < 0) { - syslog(LOG_ERR, "%s: %m", buf); + syslog(LOG_ERR, "%s: %m", infoname); nerr++; goto closefd; } From owner-svn-src-stable-10@FreeBSD.ORG Tue Apr 29 05:45:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C69DA6FD; Tue, 29 Apr 2014 05:45: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 A74331431; Tue, 29 Apr 2014 05:45: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 s3T5jIix056880; Tue, 29 Apr 2014 05:45:18 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T5jHWE056876; Tue, 29 Apr 2014 05:45:17 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404290545.s3T5jHWE056876@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 29 Apr 2014 05:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265078 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 05:45:19 -0000 Author: hselasky Date: Tue Apr 29 05:45:17 2014 New Revision: 265078 URL: http://svnweb.freebsd.org/changeset/base/265078 Log: MFC r265015: Setting the IMOD value below 0x3F8 can cause IRQ lockups in the Intel LynxPoint USB 3.0 controllers found in MacBookPro 2013's. Modified: stable/10/sys/dev/usb/controller/xhci.c stable/10/sys/dev/usb/controller/xhci.h stable/10/sys/dev/usb/controller/xhci_pci.c stable/10/sys/dev/usb/controller/xhcireg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.c Tue Apr 29 03:58:17 2014 (r265077) +++ stable/10/sys/dev/usb/controller/xhci.c Tue Apr 29 05:45:17 2014 (r265078) @@ -495,8 +495,12 @@ xhci_start_controller(struct xhci_softc XWRITE4(sc, runt, XHCI_ERSTSZ(0), XHCI_ERSTS_SET(temp)); + /* Check if we should use the default IMOD value */ + if (sc->sc_imod_default == 0) + sc->sc_imod_default = XHCI_IMOD_DEFAULT; + /* Setup interrupt rate */ - XWRITE4(sc, runt, XHCI_IMOD(0), XHCI_IMOD_DEFAULT); + XWRITE4(sc, runt, XHCI_IMOD(0), sc->sc_imod_default); usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res); Modified: stable/10/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.h Tue Apr 29 03:58:17 2014 (r265077) +++ stable/10/sys/dev/usb/controller/xhci.h Tue Apr 29 05:45:17 2014 (r265078) @@ -481,6 +481,7 @@ struct xhci_softc { uint16_t sc_erst_max; uint16_t sc_event_idx; uint16_t sc_command_idx; + uint16_t sc_imod_default; uint8_t sc_event_ccs; uint8_t sc_command_ccs; Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Tue Apr 29 03:58:17 2014 (r265077) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Tue Apr 29 05:45:17 2014 (r265078) @@ -242,6 +242,7 @@ xhci_pci_attach(device_t self) case 0x1e318086: /* Panther Point */ case 0x8c318086: /* Lynx Point */ sc->sc_port_route = &xhci_pci_port_route; + sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; break; default: break; Modified: stable/10/sys/dev/usb/controller/xhcireg.h ============================================================================== --- stable/10/sys/dev/usb/controller/xhcireg.h Tue Apr 29 03:58:17 2014 (r265077) +++ stable/10/sys/dev/usb/controller/xhcireg.h Tue Apr 29 05:45:17 2014 (r265078) @@ -166,7 +166,8 @@ #define XHCI_IMOD_IVAL_SET(x) (((x) & 0xFFFF) << 0) /* 250ns unit */ #define XHCI_IMOD_ICNT_GET(x) (((x) >> 16) & 0xFFFF) /* 250ns unit */ #define XHCI_IMOD_ICNT_SET(x) (((x) & 0xFFFF) << 16) /* 250ns unit */ -#define XHCI_IMOD_DEFAULT 0x000001F4U /* 8000 IRQ/second */ +#define XHCI_IMOD_DEFAULT 0x000001F4U /* 8000 IRQs/second */ +#define XHCI_IMOD_DEFAULT_LP 0x000003F8U /* 4000 IRQs/second - LynxPoint */ #define XHCI_ERSTSZ(n) (0x0028 + (0x20 * (n))) /* XHCI event ring segment table size */ #define XHCI_ERSTS_GET(x) ((x) & 0xFFFF) #define XHCI_ERSTS_SET(x) ((x) & 0xFFFF) From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 30 04:03:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BFAC7A89; Wed, 30 Apr 2014 04:03: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 AB7DD119F; Wed, 30 Apr 2014 04:03: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 s3U436oR013993; Wed, 30 Apr 2014 04:03:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U435jM013989; Wed, 30 Apr 2014 04:03:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404300403.s3U435jM013989@svn.freebsd.org> From: Xin LI Date: Wed, 30 Apr 2014 04:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265122 - in stable/10: crypto/openssl/ssl etc/defaults sys/netinet sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 04:03:06 -0000 Author: delphij Date: Wed Apr 30 04:03:05 2014 New Revision: 265122 URL: http://svnweb.freebsd.org/changeset/base/265122 Log: Fix devfs rules not applied by default for jails. Fix OpenSSL use-after-free vulnerability. Fix TCP reassembly vulnerability. Security: FreeBSD-SA-14:07.devfs Security: CVE-2014-3001 Security: FreeBSD-SA-14:08.tcp Security: CVE-2014-3000 Security: FreeBSD-SA-14:09.openssl Security: CVE-2010-5298 Modified: stable/10/crypto/openssl/ssl/s3_pkt.c stable/10/etc/defaults/rc.conf stable/10/sys/netinet/tcp_reass.c stable/10/sys/sys/param.h Modified: stable/10/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- stable/10/crypto/openssl/ssl/s3_pkt.c Wed Apr 30 04:02:57 2014 (r265121) +++ stable/10/crypto/openssl/ssl/s3_pkt.c Wed Apr 30 04:03:05 2014 (r265122) @@ -1055,7 +1055,7 @@ start: { s->rstate=SSL_ST_READ_HEADER; rr->off=0; - if (s->mode & SSL_MODE_RELEASE_BUFFERS) + if (s->mode & SSL_MODE_RELEASE_BUFFERS && s->s3->rbuf.left == 0) ssl3_release_read_buffer(s); } } Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Wed Apr 30 04:02:57 2014 (r265121) +++ stable/10/etc/defaults/rc.conf Wed Apr 30 04:03:05 2014 (r265122) @@ -649,7 +649,7 @@ devfs_rulesets="/etc/defaults/devfs.rule devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to # apply (must be mounted already, i.e. fstab(5)) -devfs_load_rulesets="NO" # Enable to always load the default rulesets +devfs_load_rulesets="YES" # Enable to always load the default rulesets performance_cx_lowest="HIGH" # Online CPU idle state performance_cpu_freq="NONE" # Online CPU frequency economy_cx_lowest="HIGH" # Offline CPU idle state Modified: stable/10/sys/netinet/tcp_reass.c ============================================================================== --- stable/10/sys/netinet/tcp_reass.c Wed Apr 30 04:02:57 2014 (r265121) +++ stable/10/sys/netinet/tcp_reass.c Wed Apr 30 04:03:05 2014 (r265122) @@ -205,7 +205,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd * Investigate why and re-evaluate the below limit after the behaviour * is understood. */ - if (th->th_seq != tp->rcv_nxt && + if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { V_tcp_reass_overflows++; TCPSTAT_INC(tcps_rcvmemdrop); @@ -228,7 +228,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd */ te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT); if (te == NULL) { - if (th->th_seq != tp->rcv_nxt) { + if (th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) { TCPSTAT_INC(tcps_rcvmemdrop); m_freem(m); *tlenp = 0; @@ -276,7 +276,8 @@ tcp_reass(struct tcpcb *tp, struct tcphd TCPSTAT_INC(tcps_rcvduppack); TCPSTAT_ADD(tcps_rcvdupbyte, *tlenp); m_freem(m); - uma_zfree(V_tcp_reass_zone, te); + if (te != &tqs) + uma_zfree(V_tcp_reass_zone, te); tp->t_segqlen--; /* * Try to present any queued data Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Wed Apr 30 04:02:57 2014 (r265121) +++ stable/10/sys/sys/param.h Wed Apr 30 04:03:05 2014 (r265122) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000707 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000708 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 30 09:55:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 20990AF; Wed, 30 Apr 2014 09:55: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 0DACB19B6; Wed, 30 Apr 2014 09:55: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 s3U9toX2062308; Wed, 30 Apr 2014 09:55:50 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U9toWL062304; Wed, 30 Apr 2014 09:55:50 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404300955.s3U9toWL062304@svn.freebsd.org> From: Steven Hartland Date: Wed, 30 Apr 2014 09:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265143 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 09:55:51 -0000 Author: smh Date: Wed Apr 30 09:55:50 2014 New Revision: 265143 URL: http://svnweb.freebsd.org/changeset/base/265143 Log: MFC r265046 Fix ZIO reordering issue which could cause data loss / corruption. Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Wed Apr 30 09:55:45 2014 (r265142) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Wed Apr 30 09:55:50 2014 (r265143) @@ -349,7 +349,7 @@ typedef struct zio_transform { struct zio_transform *zt_next; } zio_transform_t; -typedef int zio_pipe_stage_t(zio_t *zio); +typedef int zio_pipe_stage_t(zio_t **ziop); /* * The io_reexecute flags are distinct from io_flags because the child must Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Apr 30 09:55:45 2014 (r265142) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Apr 30 09:55:50 2014 (r265143) @@ -1022,8 +1022,9 @@ zio_shrink(zio_t *zio, uint64_t size) */ static int -zio_read_bp_init(zio_t *zio) +zio_read_bp_init(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; if (BP_GET_COMPRESS(bp) != ZIO_COMPRESS_OFF && @@ -1048,8 +1049,9 @@ zio_read_bp_init(zio_t *zio) } static int -zio_write_bp_init(zio_t *zio) +zio_write_bp_init(zio_t **ziop) { + zio_t *zio = *ziop; spa_t *spa = zio->io_spa; zio_prop_t *zp = &zio->io_prop; enum zio_compress compress = zp->zp_compress; @@ -1199,8 +1201,9 @@ zio_write_bp_init(zio_t *zio) } static int -zio_free_bp_init(zio_t *zio) +zio_free_bp_init(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; if (zio->io_child_type == ZIO_CHILD_LOGICAL) { @@ -1283,8 +1286,10 @@ zio_taskq_member(zio_t *zio, zio_taskq_t } static int -zio_issue_async(zio_t *zio) +zio_issue_async(zio_t **ziop) { + zio_t *zio = *ziop; + zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE, B_FALSE); return (ZIO_PIPELINE_STOP); @@ -1352,7 +1357,7 @@ zio_execute(zio_t *zio) } zio->io_stage = stage; - rv = zio_pipeline[highbit(stage) - 1](zio); + rv = zio_pipeline[highbit(stage) - 1](&zio); if (rv == ZIO_PIPELINE_STOP) return; @@ -1786,8 +1791,9 @@ zio_gang_tree_issue(zio_t *pio, zio_gang } static int -zio_gang_assemble(zio_t *zio) +zio_gang_assemble(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; ASSERT(BP_IS_GANG(bp) && zio->io_gang_leader == NULL); @@ -1801,8 +1807,9 @@ zio_gang_assemble(zio_t *zio) } static int -zio_gang_issue(zio_t *zio) +zio_gang_issue(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE)) @@ -1936,8 +1943,9 @@ zio_write_gang_block(zio_t *pio) * writes) and as a result is mutually exclusive with dedup. */ static int -zio_nop_write(zio_t *zio) +zio_nop_write(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; blkptr_t *bp_orig = &zio->io_bp_orig; zio_prop_t *zp = &zio->io_prop; @@ -2008,8 +2016,9 @@ zio_ddt_child_read_done(zio_t *zio) } static int -zio_ddt_read_start(zio_t *zio) +zio_ddt_read_start(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; ASSERT(BP_GET_DEDUP(bp)); @@ -2051,8 +2060,9 @@ zio_ddt_read_start(zio_t *zio) } static int -zio_ddt_read_done(zio_t *zio) +zio_ddt_read_done(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; if (zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE)) @@ -2220,8 +2230,9 @@ zio_ddt_ditto_write_done(zio_t *zio) } static int -zio_ddt_write(zio_t *zio) +zio_ddt_write(zio_t **ziop) { + zio_t *zio = *ziop; spa_t *spa = zio->io_spa; blkptr_t *bp = zio->io_bp; uint64_t txg = zio->io_txg; @@ -2332,8 +2343,9 @@ zio_ddt_write(zio_t *zio) ddt_entry_t *freedde; /* for debugging */ static int -zio_ddt_free(zio_t *zio) +zio_ddt_free(zio_t **ziop) { + zio_t *zio = *ziop; spa_t *spa = zio->io_spa; blkptr_t *bp = zio->io_bp; ddt_t *ddt = ddt_select(spa, bp); @@ -2358,8 +2370,9 @@ zio_ddt_free(zio_t *zio) * ========================================================================== */ static int -zio_dva_allocate(zio_t *zio) +zio_dva_allocate(zio_t **ziop) { + zio_t *zio = *ziop; spa_t *spa = zio->io_spa; metaslab_class_t *mc = spa_normal_class(spa); blkptr_t *bp = zio->io_bp; @@ -2401,16 +2414,19 @@ zio_dva_allocate(zio_t *zio) } static int -zio_dva_free(zio_t *zio) +zio_dva_free(zio_t **ziop) { + zio_t *zio = *ziop; + metaslab_free(zio->io_spa, zio->io_bp, zio->io_txg, B_FALSE); return (ZIO_PIPELINE_CONTINUE); } static int -zio_dva_claim(zio_t *zio) +zio_dva_claim(zio_t **ziop) { + zio_t *zio = *ziop; int error; error = metaslab_claim(zio->io_spa, zio->io_bp, zio->io_txg); @@ -2504,8 +2520,9 @@ zio_free_zil(spa_t *spa, uint64_t txg, b * ========================================================================== */ static int -zio_vdev_io_start(zio_t *zio) +zio_vdev_io_start(zio_t **ziop) { + zio_t *zio = *ziop; vdev_t *vd = zio->io_vd; uint64_t align; spa_t *spa = zio->io_spa; @@ -2599,6 +2616,7 @@ zio_vdev_io_start(zio_t *zio) if ((zio = vdev_queue_io(zio)) == NULL) return (ZIO_PIPELINE_STOP); + *ziop = zio; if (!vdev_accessible(vd, zio)) { zio->io_error = SET_ERROR(ENXIO); @@ -2622,8 +2640,9 @@ zio_vdev_io_start(zio_t *zio) } static int -zio_vdev_io_done(zio_t *zio) +zio_vdev_io_done(zio_t **ziop) { + zio_t *zio = *ziop; vdev_t *vd = zio->io_vd; vdev_ops_t *ops = vd ? vd->vdev_ops : &vdev_mirror_ops; boolean_t unexpected_error = B_FALSE; @@ -2697,8 +2716,9 @@ zio_vsd_default_cksum_report(zio_t *zio, } static int -zio_vdev_io_assess(zio_t *zio) +zio_vdev_io_assess(zio_t **ziop) { + zio_t *zio = *ziop; vdev_t *vd = zio->io_vd; if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) @@ -2811,8 +2831,9 @@ zio_vdev_io_bypass(zio_t *zio) * ========================================================================== */ static int -zio_checksum_generate(zio_t *zio) +zio_checksum_generate(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; enum zio_checksum checksum; @@ -2842,8 +2863,9 @@ zio_checksum_generate(zio_t *zio) } static int -zio_checksum_verify(zio_t *zio) +zio_checksum_verify(zio_t **ziop) { + zio_t *zio = *ziop; zio_bad_cksum_t info; blkptr_t *bp = zio->io_bp; int error; @@ -2914,8 +2936,9 @@ zio_worst_error(int e1, int e2) * ========================================================================== */ static int -zio_ready(zio_t *zio) +zio_ready(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; zio_t *pio, *pio_next; @@ -2972,8 +2995,9 @@ zio_ready(zio_t *zio) } static int -zio_done(zio_t *zio) +zio_done(zio_t **ziop) { + zio_t *zio = *ziop; spa_t *spa = zio->io_spa; zio_t *lio = zio->io_logical; blkptr_t *bp = zio->io_bp; From owner-svn-src-stable-10@FreeBSD.ORG Wed Apr 30 20:39:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1685AFA4; Wed, 30 Apr 2014 20: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 024C31439; Wed, 30 Apr 2014 20:39: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 s3UKdB5W039382; Wed, 30 Apr 2014 20: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 s3UKd9JV039364; Wed, 30 Apr 2014 20:39:09 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201404302039.s3UKd9JV039364@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 30 Apr 2014 20:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265160 - in stable/10/usr.bin: grep grep/regex patch printf sort X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 20:39:12 -0000 Author: pfg Date: Wed Apr 30 20:39:08 2014 New Revision: 265160 URL: http://svnweb.freebsd.org/changeset/base/265160 Log: MFC r264581, r264744: Various style(9) fixes and typos in printf, grep, sort and patch. #define should be followed by a tab. Modified: stable/10/usr.bin/grep/grep.c stable/10/usr.bin/grep/grep.h stable/10/usr.bin/grep/regex/tre-fastmatch.c stable/10/usr.bin/patch/common.h stable/10/usr.bin/patch/pch.h stable/10/usr.bin/printf/printf.c stable/10/usr.bin/sort/bwstring.h stable/10/usr.bin/sort/coll.h stable/10/usr.bin/sort/file.h stable/10/usr.bin/sort/mem.h stable/10/usr.bin/sort/radixsort.h stable/10/usr.bin/sort/sort.1.in stable/10/usr.bin/sort/sort.h stable/10/usr.bin/sort/vsort.h Modified: stable/10/usr.bin/grep/grep.c ============================================================================== --- stable/10/usr.bin/grep/grep.c Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/grep/grep.c Wed Apr 30 20:39:08 2014 (r265160) @@ -311,7 +311,7 @@ read_patterns(const char *fn) fclose(f); return; } - while ((line = fgetln(f, &len)) != NULL) + while ((line = fgetln(f, &len)) != NULL) add_pattern(line, line[0] == '\n' ? 0 : len); if (ferror(f)) err(2, "%s", fn); Modified: stable/10/usr.bin/grep/grep.h ============================================================================== --- stable/10/usr.bin/grep/grep.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/grep/grep.h Wed Apr 30 20:39:08 2014 (r265160) @@ -39,48 +39,48 @@ #include "fastmatch.h" #ifdef WITHOUT_NLS -#define getstr(n) errstr[n] +#define getstr(n) errstr[n] #else #include extern nl_catd catalog; -#define getstr(n) catgets(catalog, 1, n, errstr[n]) +#define getstr(n) catgets(catalog, 1, n, errstr[n]) #endif extern const char *errstr[]; -#define VERSION "2.5.1-FreeBSD" +#define VERSION "2.5.1-FreeBSD" -#define GREP_FIXED 0 -#define GREP_BASIC 1 -#define GREP_EXTENDED 2 - -#define BINFILE_BIN 0 -#define BINFILE_SKIP 1 -#define BINFILE_TEXT 2 - -#define FILE_STDIO 0 -#define FILE_MMAP 1 -#define FILE_GZIP 2 -#define FILE_BZIP 3 -#define FILE_XZ 4 -#define FILE_LZMA 5 - -#define DIR_READ 0 -#define DIR_SKIP 1 -#define DIR_RECURSE 2 - -#define DEV_READ 0 -#define DEV_SKIP 1 - -#define LINK_READ 0 -#define LINK_EXPLICIT 1 -#define LINK_SKIP 2 +#define GREP_FIXED 0 +#define GREP_BASIC 1 +#define GREP_EXTENDED 2 + +#define BINFILE_BIN 0 +#define BINFILE_SKIP 1 +#define BINFILE_TEXT 2 + +#define FILE_STDIO 0 +#define FILE_MMAP 1 +#define FILE_GZIP 2 +#define FILE_BZIP 3 +#define FILE_XZ 4 +#define FILE_LZMA 5 + +#define DIR_READ 0 +#define DIR_SKIP 1 +#define DIR_RECURSE 2 + +#define DEV_READ 0 +#define DEV_SKIP 1 + +#define LINK_READ 0 +#define LINK_EXPLICIT 1 +#define LINK_SKIP 2 -#define EXCL_PAT 0 -#define INCL_PAT 1 +#define EXCL_PAT 0 +#define INCL_PAT 1 -#define MAX_LINE_MATCHES 32 +#define MAX_LINE_MATCHES 32 struct file { int fd; @@ -129,7 +129,7 @@ extern regex_t *er_pattern, *r_pattern; extern fastmatch_t *fg_pattern; /* For regex errors */ -#define RE_ERROR_BUF 512 +#define RE_ERROR_BUF 512 extern char re_error[RE_ERROR_BUF + 1]; /* Seems big enough */ /* util.c */ Modified: stable/10/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- stable/10/usr.bin/grep/regex/tre-fastmatch.c Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/grep/regex/tre-fastmatch.c Wed Apr 30 20:39:08 2014 (r265160) @@ -444,7 +444,7 @@ static int fastcmp(const fastmatch_t *fg } /* - * Copies the pattern pat having lenght n to p and stores + * Copies the pattern pat having length n to p and stores * the size in l. */ #define SAVE_PATTERN(src, srclen, dst, dstlen) \ Modified: stable/10/usr.bin/patch/common.h ============================================================================== --- stable/10/usr.bin/patch/common.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/patch/common.h Wed Apr 30 20:39:08 2014 (r265160) @@ -32,32 +32,32 @@ #include #include -#define DEBUGGING +#define DEBUGGING /* constants */ -#define MAXHUNKSIZE 200000 /* is this enough lines? */ -#define INITHUNKMAX 125 /* initial dynamic allocation size */ -#define INITLINELEN 4096 -#define BUFFERSIZE 4096 - -#define SCCSPREFIX "s." -#define GET "get -e %s" -#define SCCSDIFF "get -p %s | diff - %s >/dev/null" - -#define RCSSUFFIX ",v" -#define CHECKOUT "co -l %s" -#define RCSDIFF "rcsdiff %s > /dev/null" +#define MAXHUNKSIZE 200000 /* is this enough lines? */ +#define INITHUNKMAX 125 /* initial dynamic allocation size */ +#define INITLINELEN 4096 +#define BUFFERSIZE 4096 + +#define SCCSPREFIX "s." +#define GET "get -e %s" +#define SCCSDIFF "get -p %s | diff - %s >/dev/null" + +#define RCSSUFFIX ",v" +#define CHECKOUT "co -l %s" +#define RCSDIFF "rcsdiff %s > /dev/null" -#define ORIGEXT ".orig" -#define REJEXT ".rej" +#define ORIGEXT ".orig" +#define REJEXT ".rej" /* handy definitions */ -#define strNE(s1,s2) (strcmp(s1, s2)) -#define strEQ(s1,s2) (!strcmp(s1, s2)) -#define strnNE(s1,s2,l) (strncmp(s1, s2, l)) -#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) +#define strNE(s1,s2) (strcmp(s1, s2)) +#define strEQ(s1,s2) (!strcmp(s1, s2)) +#define strnNE(s1,s2,l) (strncmp(s1, s2, l)) +#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) /* typedefs */ @@ -73,7 +73,7 @@ extern size_t buf_size; /* size of gener extern bool using_plan_a; /* try to keep everything in memory */ extern bool out_of_mem; /* ran out of memory in plan a */ -#define MAXFILEC 2 +#define MAXFILEC 2 extern char *filearg[MAXFILEC]; extern bool ok_to_create_file; @@ -105,11 +105,11 @@ extern bool warn_on_invalid_line; extern bool last_line_missing_eol; -#define CONTEXT_DIFF 1 -#define NORMAL_DIFF 2 -#define ED_DIFF 3 -#define NEW_CONTEXT_DIFF 4 -#define UNI_DIFF 5 +#define CONTEXT_DIFF 1 +#define NORMAL_DIFF 2 +#define ED_DIFF 3 +#define NEW_CONTEXT_DIFF 4 +#define UNI_DIFF 5 extern int diff_type; extern char *revision; /* prerequisite revision, if any */ Modified: stable/10/usr.bin/patch/pch.h ============================================================================== --- stable/10/usr.bin/patch/pch.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/patch/pch.h Wed Apr 30 20:39:08 2014 (r265160) @@ -27,10 +27,10 @@ * $FreeBSD$ */ -#define OLD_FILE 0 -#define NEW_FILE 1 -#define INDEX_FILE 2 -#define MAX_FILE 3 +#define OLD_FILE 0 +#define NEW_FILE 1 +#define INDEX_FILE 2 +#define MAX_FILE 3 struct file_name { char *path; Modified: stable/10/usr.bin/printf/printf.c ============================================================================== --- stable/10/usr.bin/printf/printf.c Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/printf/printf.c Wed Apr 30 20:39:08 2014 (r265160) @@ -61,13 +61,13 @@ static const char rcsid[] = #include #ifdef SHELL -#define main printfcmd +#define main printfcmd #include "bltin/bltin.h" #include "error.h" #include "options.h" #endif -#define PF(f, func) do { \ +#define PF(f, func) do { \ char *b = NULL; \ if (havewidth) \ if (haveprec) \ Modified: stable/10/usr.bin/sort/bwstring.h ============================================================================== --- stable/10/usr.bin/sort/bwstring.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/bwstring.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__BWSTRING_H__) -#define __BWSTRING_H__ +#define __BWSTRING_H__ #include #include @@ -41,7 +41,7 @@ extern bool byte_sort; /* wchar_t is of 4 bytes: */ -#define SIZEOF_WCHAR_STRING(LEN) ((LEN)*sizeof(wchar_t)) +#define SIZEOF_WCHAR_STRING(LEN) ((LEN)*sizeof(wchar_t)) /* * Binary "wide" string @@ -64,7 +64,7 @@ struct reader_buffer typedef void *bwstring_iterator; -#define BWSLEN(s) ((s)->len) +#define BWSLEN(s) ((s)->len) struct bwstring *bwsalloc(size_t sz); @@ -135,7 +135,7 @@ bws_get_iter_value(bwstring_iterator ite int bws_iterator_cmp(bwstring_iterator iter1, bwstring_iterator iter2, size_t len); -#define BWS_GET(bws, pos) ((MB_CUR_MAX == 1) ? ((bws)->data.cstr[(pos)]) : (bws)->data.wstr[(pos)]) +#define BWS_GET(bws, pos) ((MB_CUR_MAX == 1) ? ((bws)->data.cstr[(pos)]) : (bws)->data.wstr[(pos)]) void initialise_months(void); Modified: stable/10/usr.bin/sort/coll.h ============================================================================== --- stable/10/usr.bin/sort/coll.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/coll.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__COLL_H__) -#define __COLL_H__ +#define __COLL_H__ #include "bwstring.h" #include "sort.h" Modified: stable/10/usr.bin/sort/file.h ============================================================================== --- stable/10/usr.bin/sort/file.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/file.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__SORT_FILE_H__) -#define __SORT_FILE_H__ +#define __SORT_FILE_H__ #include "coll.h" #include "sort.h" @@ -39,8 +39,8 @@ #define SORT_HEAPSORT 3 #define SORT_RADIXSORT 4 -#define DEFAULT_SORT_ALGORITHM SORT_HEAPSORT -#define DEFAULT_SORT_FUNC heapsort +#define DEFAULT_SORT_ALGORITHM SORT_HEAPSORT +#define DEFAULT_SORT_FUNC heapsort /* * List of data to be sorted. Modified: stable/10/usr.bin/sort/mem.h ============================================================================== --- stable/10/usr.bin/sort/mem.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/mem.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__SORT_MEM_H__) -#define __SORT_MEM_H__ +#define __SORT_MEM_H__ #include #include Modified: stable/10/usr.bin/sort/radixsort.h ============================================================================== --- stable/10/usr.bin/sort/radixsort.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/radixsort.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__SORT_RADIX_H__) -#define __SORT_RADIX_H__ +#define __SORT_RADIX_H__ #include "coll.h" #include "sort.h" Modified: stable/10/usr.bin/sort/sort.1.in ============================================================================== --- stable/10/usr.bin/sort/sort.1.in Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/sort.1.in Wed Apr 30 20:39:08 2014 (r265160) @@ -194,7 +194,7 @@ This is a random permutation of the inpu the equal keys sort together. It is implemented by hashing the input keys and sorting the hash values. -The hash function is choosen randomly. +The hash function is chosen randomly. The hash function is randomized by .Cm /dev/random content, or by file content if it is specified by @@ -212,7 +212,7 @@ The files are compared by their prefixes zeros are ignored in version numbers, see example below). If an input string does not match the pattern, then it is compared using the byte compare function. -All string comparisions are performed in C locale, the locale +All string comparisons are performed in C locale, the locale environment setting is ignored. .Bl -tag -width indent .It Example: Modified: stable/10/usr.bin/sort/sort.h ============================================================================== --- stable/10/usr.bin/sort/sort.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/sort.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__BSD_SORT_H__) -#define __BSD_SORT_H__ +#define __BSD_SORT_H__ #include #include @@ -53,7 +53,7 @@ extern nl_catd catalog; extern const char *nlsstr[]; #if defined(SORT_THREADS) -#define MT_SORT_THRESHOLD (10000) +#define MT_SORT_THRESHOLD (10000) extern unsigned int ncpu; extern size_t nthreads; #endif Modified: stable/10/usr.bin/sort/vsort.h ============================================================================== --- stable/10/usr.bin/sort/vsort.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/vsort.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #ifndef _VSORT_H_ -#define _VSORT_H_ +#define _VSORT_H_ #include "bwstring.h" From owner-svn-src-stable-10@FreeBSD.ORG Thu May 1 00:31:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5DA81F7B; Thu, 1 May 2014 00:31: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 48F7919F1; Thu, 1 May 2014 00:31: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 s410VLsZ039125; Thu, 1 May 2014 00:31:21 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s410VJQd039117; Thu, 1 May 2014 00:31:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405010031.s410VJQd039117@svn.freebsd.org> From: Warner Losh Date: Thu, 1 May 2014 00:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265166 - in stable/10/tools/tools/nanobsd: . Files/root dhcpd gateworks pcengines X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 00:31:21 -0000 Author: imp Date: Thu May 1 00:31:19 2014 New Revision: 265166 URL: http://svnweb.freebsd.org/changeset/base/265166 Log: MFC: r258705,r258709,r263140,r263184,r263185,r263186,r263187,r263188, r263189,r263190,r263192,r263193,r263287,r263288,r263890,r264281, r264655,r264656,r264856,r264857,r264858,r264859,r264860,r264861, r264891,r264892,r264909 Catch up on all the referenced changes in -current, in brief: r258705 | n_hibma | Use NANO_PMAKE for build, but not install r258709 | mr | pkgng goo + bootstrap r263140 | glebius | Axe IPX. r263184 | imp | Fix build with spaces in names. r263185 | imp | Make pcengines config files compile again. r263186 | imp | Use UFS2 by default, but allow fallback to UFS1 r263187 | imp | Print an error message when we exit out early. r263188 | imp | Sometimes only copy MBR when backing via swap r263189 | imp | Update save_cfg r263190 | imp | Be more explicit about setting SRCCONF to /dev/null r263192 | imp | Rely on default UFS type r263193 | imp | Remove TARGET_BIG_ENDIAN. It's no longer relevant. r263287 | bdrewery | pkg(8) has no limits r263288 | bdrewery | Remove comment meant for removal in r263287 r263890 | imp | Up default media size to 1GB. r264281 | imp | Ignore .hg and .git files r264655 | imp | rm -x for safety r264656 | imp | new example: dhcpd derived from FreeNAS/BSDRP r264856 | imp | Override the parallel make target to use all CPUs. r264857 | imp | No need for true here, remove it. r264858 | imp | NANO_PKG_META_BASE r264859 | imp | stylize umount hack r264860 | imp | switch dhcpd to pkg(8). r264861 | imp | CR and CR0 added from dhcpd r264891 | imp | Try to alwaays use () for functions r264892 | imp | bash whines about r264857, revert r264909 | imp | Move back to {} for functions that need global effects Added: stable/10/tools/tools/nanobsd/dhcpd/ - copied from r264688, head/tools/tools/nanobsd/dhcpd/ Modified: stable/10/tools/tools/nanobsd/Files/root/save_cfg stable/10/tools/tools/nanobsd/dhcpd/common stable/10/tools/tools/nanobsd/dhcpd/os-base stable/10/tools/tools/nanobsd/gateworks/common stable/10/tools/tools/nanobsd/nanobsd.sh stable/10/tools/tools/nanobsd/pcengines/ALIX_DSK stable/10/tools/tools/nanobsd/pcengines/common.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/nanobsd/Files/root/save_cfg ============================================================================== --- stable/10/tools/tools/nanobsd/Files/root/save_cfg Thu May 1 00:12:24 2014 (r265165) +++ stable/10/tools/tools/nanobsd/Files/root/save_cfg Thu May 1 00:31:19 2014 (r265166) @@ -1,6 +1,7 @@ #!/bin/sh # # Copyright (c) 2006 Mathieu Arnold +# Copyright (c) 2010 Alex Bakhtin # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -32,11 +33,86 @@ set -e trap "umount /cfg" 1 2 15 EXIT mount /cfg ( +cd /etc +for filename in "$@" `find * -type f` +do + if [ ! -f /cfg/$filename -a ! -f /cfg/.ignore/$filename ] + then + + # + # If file doesn't exist in /cfg and file is not in the 'ignore' list + # then check if this file is exactly the same as original file + # in nanobsd image + # + if ! cmp -s /etc/$filename /conf/base/etc/$filename + then + file_path=`echo "$filename" | sed 's/\/[^/]*$//'` + if [ $file_path != $filename ] + then + if [ ! -d /etc/$file_path ] + then + # should never go here unless we have some errors in + # sed script extracting file path + echo "Error: Path /etc/$file_path is not directory." + exit 1; + fi + fi + + # + # Ask user - how should we handle this file. + # Add to cfg (y/n/i)? + # y) -> save this file in /cfg + # n) -> do not save this file in /cfg for current script invocation ONLY + # i) -> add file to ignore list (/cfg/.ignore hiereachy) and never save + # try to add this file to /cfg. + # + # touch is ised to add files to /cfg to keep the script flow straight and easy + # + read -p "New file /etc/$filename found. Add to /cfg (y/n/i)? " key + case "$key" in + [yY]) + if [ $file_path != $filename ] + then + mkdir -vp /cfg/$file_path + fi + touch /cfg/$filename && echo "File /etc/$filename added to /cfg." + ;; + [iI]) + mkdir -vp /cfg/.ignore + if [ $file_path != $filename ] + then + mkdir -vp /cfg/.ignore/$file_path + fi + touch /cfg/.ignore/$filename && echo "File /etc/$filename added to ignore list." + ;; + esac + fi + fi +done + +# +# Actually check all files in /cfg and save if necessary +# cd /cfg -for i in "$@" `find * -type f` +for filename in "$@" `find * -type f` do - cmp -s /etc/$i /cfg/$i || cp -pfv /etc/$i /cfg/$i + if [ -f /etc/$filename ] + then + cmp -s /etc/$filename /cfg/$filename || cp -pfv /etc/$filename /cfg/$filename + else + + # + # Give user an option to remove file from /cfg if this file is removed from /etc + # + read -p "File /cfg/$filename not found in /etc. Remove from /cfg (y/n)? " key + case "$key" in + [yY]) + rm /cfg/$filename && echo "File /cfg/$filename removed" + ;; + esac + fi done + ) umount /cfg trap 1 2 15 EXIT Modified: stable/10/tools/tools/nanobsd/dhcpd/common ============================================================================== --- head/tools/tools/nanobsd/dhcpd/common Sun Apr 20 06:46:04 2014 (r264688) +++ stable/10/tools/tools/nanobsd/dhcpd/common Thu May 1 00:31:19 2014 (r265166) @@ -33,7 +33,9 @@ # simplified to meet the needs of the example. # -NANO_PMAKE="make" # NB: disable -j 3 +# NB: You want the other file + +NANO_PMAKE="make -j $(sysctl -n hw.ncpu)" NANO_CFG_BASE=$(pwd) NANO_CFG_BASE=${NANO_CFG_BASE%/dhcpd} @@ -42,7 +44,8 @@ NANO_SRC=${NANO_SRC%/tools/tools/nanobsd NANO_OBJ=${NANO_SRC}/../dhcpd/obj # Where cust_pkg() finds packages to install #XXX: Is this the right place? -NANO_PORTS=${NANO_SRC}/../ports +#NANO_PORTS=$(realpath ${NANO_SRC}/../ports) +NANO_PORTS=/usr/ports NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg NANO_DATADIR=${NANO_OBJ}/_.data NANO_DATASIZE=40960 @@ -153,11 +156,6 @@ WITHOUT_RCS=true NANO_PACKAGE_ONLY=1 -CR() -{ - chroot ${NANO_WORLDDIR} /bin/sh -exc "$*" -} - # install a package from a pre-built binary do_add_pkg () { @@ -171,7 +169,7 @@ do_add_pkg () ${NANO_WORLDDIR}/usr/ports/packages mount -t nullfs -o noatime ${NANO_OBJ}/ports/distfiles \ ${NANO_WORLDDIR}/usr/ports/distfiles - CR "cd /usr/ports/packages/All;pkg_add -F $1.tbz" + CR env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /usr/ports/packages/All/$1.txz umount ${NANO_WORLDDIR}/usr/ports/distfiles umount ${NANO_WORLDDIR}/usr/ports/packages rmdir ${NANO_WORLDDIR}/usr/ports/packages @@ -204,12 +202,16 @@ do_add_port () mount -t devfs devfs ${NANO_WORLDDIR}/dev mkdir -p ${NANO_WORLDDIR}/usr/workdir cp /etc/resolv.conf ${NANO_WORLDDIR}/etc/resolv.conf + # OK, a little inefficient, but likely not enough to worry about. + CR ldconfig /lib /usr/lib /usr/local/lib + CR ldconfig -R + CR ldconfig -r # Improvement: Don't know why package-recursive don't works here CR "env UNAME_p=${NANO_ARCH} TARGET=${NANO_ARCH} \ - TARGET_ARCH=${NANO_ARCH} make \ + TARGET_ARCH=${NANO_ARCH} PORTSDIR=${NANO_PORTS} make \ __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ WRKDIRPREFIX=/usr/workdir -C /usr/ports/$port_path \ - package BATCH=yes $* clean FORCE_PKG_REGISTER=t" + package-recursive BATCH=yes $* clean FORCE_PKG_REGISTER=t" rm ${NANO_WORLDDIR}/etc/resolv.conf rm -rf ${NANO_WORLDDIR}/usr/obj rm -rf ${NANO_WORLDDIR}/usr/workdir @@ -226,15 +228,14 @@ do_add_port () add_port () { local port_path=$1 local port=`echo $1 | sed -e 's/\//_/'` - export PORTSDIR=${NANO_PORTS} shift # Check if package allready exist # Need to: # 1. check ARCH of this package! # 2. Add a trap cd ${NANO_PORTS}/${port_path} - PKG_NAME=`make ${PKGNAME_HACK} PORTSDIR=${NANO_PORTS} __MAKE_CONF=${NANO_MAKE_CONF_BUILD} package-name` - if [ -f ${NANO_OBJ}/ports/packages/All/${PKG_NAME}.tbz ]; then + PKG_NAME=`env PORTSDIR=${NANO_PORTS} make __MAKE_CONF=${NANO_MAKE_CONF_BUILD} package-name` + if [ -f ${NANO_OBJ}/ports/packages/All/${PKG_NAME}.txz ]; then # Pkg file found: Generate add_pkg_NAME function eval " add_pkg_${port} () { @@ -265,6 +266,10 @@ create_amd64_diskimage() create_i386_diskimage "$*" } +# Automatically include the packaging port here so it is always first so it +# builds the port and adds the package so we can add other packages. +add_port ports-mgmt/pkg + rp=$(realpath ${NANO_OBJ}/) __a=`mount | grep ${rp} | awk '{print length($3), $3;}' | sort -rn | awk '{$1=""; print;}'` if [ -n "$__a" ]; then Modified: stable/10/tools/tools/nanobsd/dhcpd/os-base ============================================================================== --- head/tools/tools/nanobsd/dhcpd/os-base Sun Apr 20 06:46:04 2014 (r264688) +++ stable/10/tools/tools/nanobsd/dhcpd/os-base Thu May 1 00:31:19 2014 (r265166) @@ -108,28 +108,6 @@ save_build ( ) } customize_cmd save_build -# Move the $world/data to the /data partion -move_data() -{ - db=${NANO_WORLDDIR}/data - rm -rf ${NANO_DATADIR} - mkdir -p ${NANO_DATADIR} - ( cd ${db} ; find . | cpio -R root:wheel -dumpv ${NANO_DATADIR} ) - rm -rf ${db} -} -customize_cmd move_data - -add_data_to_fstab ( ) -{ - ( - cd ${NANO_WORLDDIR} - echo "/dev/${NANO_DRIVE}s4 /data ufs rw,noatime 2 2" >> etc/fstab - mkdir -p data - ) - -} -customize_cmd add_data_to_fstab - remove_patch_divots ( ) { find ${NANO_WORLDDIR} -name \*.orig -or -name \*.rej -delete @@ -168,7 +146,7 @@ customize_cmd unmute_console_logging fi -freenas_custom() +product_custom() { gzip -v9 ${NANO_WORLDDIR}/boot/kernel/kernel @@ -199,29 +177,10 @@ freenas_custom() # magic.mgc is just a speed optimization. Kill it for 1.7MB rm -f ${NANO_WORLDDIR}/usr/share/misc/magic.mgc - # strip binaries (saves spaces on non-debug images). - if [ "${DEBUG}" != 1 ]; then - pprint 4 "Stripping binaries and libraries" - for dir in $(find ${NANO_WORLDDIR}/usr/local -name '*bin' -or -name 'libexec' -maxdepth 3); do - for f in $(find $dir -type f); do - if ! dontstrip "$f" - then - strip 2>/dev/null $f || : - fi - done - done - # .so's are the only thing that need to be stripped. The rest - # should remain untouched. - for f in $(find ${NANO_WORLDDIR}/usr/local/lib -name '*.so' -or -name '*.so.*' -maxdepth 3); do - strip 2>/dev/null $f || : - done - fi - # Last second tweaks chown -R root:wheel ${NANO_WORLDDIR}/root chmod 0755 ${NANO_WORLDDIR}/root/* chmod 0755 ${NANO_WORLDDIR}/* - chmod 0440 ${NANO_WORLDDIR}/usr/local/etc/sudoers chown -R root:wheel ${NANO_WORLDDIR}/etc chown -R root:wheel ${NANO_WORLDDIR}/boot chown root:wheel ${NANO_WORLDDIR}/ @@ -229,16 +188,7 @@ freenas_custom() find ${NANO_WORLDDIR} -type f -name "*~" -delete find ${NANO_WORLDDIR}/usr/local -type f -name "*.po" -delete find ${NANO_WORLDDIR} -type f -name "*.service" -delete - mkdir ${NANO_WORLDDIR}/data/zfs - ln -s -f /usr/local/bin/bash ${NANO_WORLDDIR}/bin/bash - ln -s -f /data/zfs/zpool.cache ${NANO_WORLDDIR}/boot/zfs/zpool.cache - - # This is wrong. Needs a way to tell kernel how to find the mount utility - # instead. - mv ${NANO_WORLDDIR}/sbin/mount_ntfs ${NANO_WORLDDIR}/sbin/mount_ntfs-kern - ln -s -f /usr/local/bin/ntfs-3g ${NANO_WORLDDIR}/sbin/mount_ntfs - } -late_customize_cmd freenas_custom +late_customize_cmd product_custom fi # [ $PACKAGE_PREP_BUILD = 1 ] Modified: stable/10/tools/tools/nanobsd/gateworks/common ============================================================================== --- stable/10/tools/tools/nanobsd/gateworks/common Thu May 1 00:12:24 2014 (r265165) +++ stable/10/tools/tools/nanobsd/gateworks/common Thu May 1 00:31:19 2014 (r265166) @@ -125,7 +125,6 @@ WITHOUT_HTML=true WITHOUT_INET6=true WITHOUT_INFO=true WITHOUT_IPFILTER=true -WITHOUT_IPX=true WITHOUT_KERBEROS=true WITHOUT_LOCALES=true WITHOUT_LPR=true Modified: stable/10/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- stable/10/tools/tools/nanobsd/nanobsd.sh Thu May 1 00:12:24 2014 (r265165) +++ stable/10/tools/tools/nanobsd/nanobsd.sh Thu May 1 00:31:19 2014 (r265166) @@ -49,6 +49,9 @@ NANO_TOOLS=tools/tools/nanobsd NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg NANO_PACKAGE_LIST="*" +# where package metadata gets placed +NANO_PKG_META_BASE=/var/db + # Object tree directory # default is subdir of /usr/obj #NANO_OBJ="" @@ -57,7 +60,8 @@ NANO_PACKAGE_LIST="*" # default is ${NANO_OBJ} #NANO_DISKIMGDIR="" -# Parallel Make +# Make & parallel Make +NANO_MAKE="make" NANO_PMAKE="make -j 3" # The default name for any image we create. @@ -85,13 +89,13 @@ NANO_CUSTOMIZE="" NANO_LATE_CUSTOMIZE="" # Newfs paramters to use -NANO_NEWFS="-b 4096 -f 512 -i 8192 -O1 -U" +NANO_NEWFS="-b 4096 -f 512 -i 8192 -U" # The drive name of the media at runtime NANO_DRIVE=ad0 # Target media size in 512 bytes sectors -NANO_MEDIASIZE=1500000 +NANO_MEDIASIZE=2000000 # Number of code images on media (1 or 2) NANO_IMAGES=2 @@ -135,6 +139,9 @@ NANO_BOOT2CFG="-h" # Can be "file" or "swap" NANO_MD_BACKING="file" +# for swap type md(4) backing, write out the mbr only +NANO_IMAGE_MBRONLY=true + # Progress Print level PPLEVEL=3 @@ -159,6 +166,10 @@ NANO_CFGDIR="" # Directory to populate /data from NANO_DATADIR="" +# src.conf to use when building the image. Defaults to /dev/null for the sake +# of determinism. +SRCCONF=${SRCCONF:=/dev/null} + ####################################################################### # # The functions which do the real work. @@ -166,12 +177,31 @@ NANO_DATADIR="" # ####################################################################### +# run in the world chroot, errors fatal +CR() +{ + chroot ${NANO_WORLDDIR} /bin/sh -exc "$*" +} + +# run in the world chroot, errors not fatal +CR0() +{ + chroot ${NANO_WORLDDIR} /bin/sh -c "$*" || true +} + +nano_cleanup ( ) ( + if [ $? -ne 0 ]; then + echo "Error encountered. Check for errors in last log file." 1>&2 + fi + exit $? +) + clean_build ( ) ( pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" - if ! rm -rf ${MAKEOBJDIRPREFIX} > /dev/null 2>&1 ; then - chflags -R noschg ${MAKEOBJDIRPREFIX} - rm -r ${MAKEOBJDIRPREFIX} + if ! rm -xrf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then + chflags -R noschg ${MAKEOBJDIRPREFIX}/ + rm -xr ${MAKEOBJDIRPREFIX}/ fi mkdir -p ${MAKEOBJDIRPREFIX} printenv > ${MAKEOBJDIRPREFIX}/_.env @@ -182,7 +212,6 @@ make_conf_build ( ) ( echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_BUILD} echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF_BUILD} - echo "SRCCONF=/dev/null" >> ${NANO_MAKE_CONF_BUILD} ) build_world ( ) ( @@ -191,17 +220,20 @@ build_world ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} \ + SRCCONF=${SRCCONF} \ __MAKE_CONF=${NANO_MAKE_CONF_BUILD} buildworld \ > ${MAKEOBJDIRPREFIX}/_.bw 2>&1 ) build_kernel ( ) ( + local extra + pprint 2 "build kernel ($NANO_KERNEL)" pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bk" ( if [ -f ${NANO_KERNEL} ] ; then - kernconfdir=$(realpath $(dirname ${NANO_KERNEL})) + extra="KERNCONFDIR=$(realpath $(dirname ${NANO_KERNEL}))" kernconf=$(basename ${NANO_KERNEL}) else kernconf=${NANO_KERNEL} @@ -211,12 +243,11 @@ build_kernel ( ) ( # unset these just in case to avoid compiler complaints # when cross-building unset TARGET_CPUTYPE - unset TARGET_BIG_ENDIAN # Note: We intentionally build all modules, not only the ones in # NANO_MODULES so the built world can be reused by multiple images. env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ - __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ - ${kernconfdir:+"KERNCONFDIR="}${kernconfdir} \ + SRCCONF=${SRCCONF} \ + ${extra} __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ KERNCONF=${kernconf} ) > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 ) @@ -224,17 +255,17 @@ build_kernel ( ) ( clean_world ( ) ( if [ "${NANO_OBJ}" != "${MAKEOBJDIRPREFIX}" ]; then pprint 2 "Clean and create object directory (${NANO_OBJ})" - if ! rm -rf ${NANO_OBJ} > /dev/null 2>&1 ; then + if ! rm -rxf ${NANO_OBJ}/ > /dev/null 2>&1 ; then chflags -R noschg ${NANO_OBJ} - rm -r ${NANO_OBJ} + rm -xr ${NANO_OBJ}/ fi mkdir -p ${NANO_OBJ} ${NANO_WORLDDIR} printenv > ${NANO_OBJ}/_.env else pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" - if ! rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then + if ! rm -rxf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then chflags -R noschg ${NANO_WORLDDIR} - rm -rf ${NANO_WORLDDIR} + rm -rxf ${NANO_WORLDDIR}/ fi mkdir -p ${NANO_WORLDDIR} fi @@ -245,7 +276,6 @@ make_conf_install ( ) ( echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_INSTALL} echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF_INSTALL} - echo "SRCCONF=/dev/null" >> ${NANO_MAKE_CONF_INSTALL} ) install_world ( ) ( @@ -254,7 +284,8 @@ install_world ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} \ - ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \ + ${NANO_MAKE} SRCCONF=${SRCCONF} \ + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \ DESTDIR=${NANO_WORLDDIR} \ > ${NANO_OBJ}/_.iw 2>&1 chflags -R noschg ${NANO_WORLDDIR} @@ -267,7 +298,8 @@ install_etc ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} \ - ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ + ${NANO_MAKE} SRCCONF=${SRCCONF} \ + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ DESTDIR=${NANO_WORLDDIR} \ > ${NANO_OBJ}/_.etc 2>&1 # make.conf doesn't get created by default, but some ports need it @@ -276,22 +308,24 @@ install_etc ( ) ( ) install_kernel ( ) ( + local extra + pprint 2 "install kernel ($NANO_KERNEL)" pprint 3 "log: ${NANO_OBJ}/_.ik" ( if [ -f ${NANO_KERNEL} ] ; then - kernconfdir=$(realpath $(dirname ${NANO_KERNEL})) + extra="KERNCONFDIR=$(realpath $(dirname ${NANO_KERNEL}))" kernconf=$(basename ${NANO_KERNEL}) else kernconf=${NANO_KERNEL} fi cd ${NANO_SRC} - env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} installkernel \ + env TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ DESTDIR=${NANO_WORLDDIR} \ - __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} \ - ${kernconfdir:+"KERNCONFDIR="}${kernconfdir} \ + SRCCONF=${SRCCONF} \ + ${extra} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} \ KERNCONF=${kernconf} \ MODULES_OVERRIDE="${NANO_MODULES}" ) > ${NANO_OBJ}/_.ik 2>&1 @@ -406,6 +440,12 @@ newfs_part ( ) ( mount -o async ${dev} ${mnt} ) +# Convenient spot to work around any umount issues that your build environment +# hits by overriding this method. +nano_umount () ( + umount ${1} +) + populate_slice ( ) ( local dev dir mnt lbl dev=$1 @@ -417,10 +457,10 @@ populate_slice ( ) ( if [ -n "${dir}" -a -d "${dir}" ]; then echo "Populating ${lbl} from ${dir}" cd ${dir} - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${mnt} fi df -i ${mnt} - umount ${mnt} + nano_umount ${mnt} ) populate_cfg_slice ( ) ( @@ -519,7 +559,7 @@ create_i386_diskimage ( ) ( -y ${NANO_HEADS}` fi - trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT + trap "echo 'Running exit trap code' ; df -i ${MNT} ; nano_umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD} fdisk ${MD} @@ -535,7 +575,7 @@ create_i386_diskimage ( ) ( echo "Generating mtree..." ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du - umount ${MNT} + nano_umount ${MNT} if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) @@ -546,7 +586,7 @@ create_i386_diskimage ( ) ( do sed -i "" "s=${NANO_DRIVE}s1=${NANO_DRIVE}s2=g" $f done - umount ${MNT} + nano_umount ${MNT} # Override the label from the first partition so we # don't confuse glabel with duplicates. if [ ! -z ${NANO_LABEL} ]; then @@ -563,6 +603,14 @@ create_i386_diskimage ( ) ( fi if [ "${NANO_MD_BACKING}" = "swap" ] ; then + if [ ${NANO_IMAGE_MBRONLY} ]; then + echo "Writing out _.disk.mbr..." + dd if=/dev/${MD} of=${NANO_DISKIMGDIR}/_.disk.mbr bs=512 count=1 + else + echo "Writing out ${NANO_IMGNAME}..." + dd if=/dev/${MD} of=${IMG} bs=64k + fi + echo "Writing out ${NANO_IMGNAME}..." dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k fi @@ -573,7 +621,8 @@ create_i386_diskimage ( ) ( fi mdconfig -d -u $MD - trap - 1 2 15 EXIT + trap - 1 2 15 + trap nano_cleanup EXIT ) > ${NANO_OBJ}/_.di 2>&1 ) @@ -677,7 +726,7 @@ cust_allow_ssh_root () ( cust_install_files () ( cd ${NANO_TOOLS}/Files - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -Ldumpv ${NANO_WORLDDIR} + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv ${NANO_WORLDDIR} ) ####################################################################### @@ -692,7 +741,7 @@ cust_pkg () ( fi # Copy packages into chroot - mkdir -p ${NANO_WORLDDIR}/Pkg + mkdir -p ${NANO_WORLDDIR}/Pkg ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg ( cd ${NANO_PACKAGE_DIR} find ${NANO_PACKAGE_LIST} -print | @@ -707,18 +756,17 @@ cust_pkg () ( while true do # Record how many we have now - have=`ls ${NANO_WORLDDIR}/var/db/pkg | wc -l` + have=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` # Attempt to install more packages # ...but no more than 200 at a time due to pkg_add's internal # limitations. - chroot ${NANO_WORLDDIR} sh -c \ - 'ls Pkg/*tbz | xargs -n 200 pkg_add -F' || true + CR0 'ls Pkg/*tbz | xargs -n 200 env PKG_DBDIR='${NANO_PKG_META_BASE}'/pkg pkg_add -v -F' # See what that got us - now=`ls ${NANO_WORLDDIR}/var/db/pkg | wc -l` + now=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` echo "=== NOW $now" - ls ${NANO_WORLDDIR}/var/db/pkg + ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg echo "===" @@ -730,7 +778,71 @@ cust_pkg () ( exit 2 fi done - rm -rf ${NANO_WORLDDIR}/Pkg + rm -rxf ${NANO_WORLDDIR}/Pkg +) + +cust_pkgng () ( + + # If the package directory doesn't exist, we're done. + if [ ! -d ${NANO_PACKAGE_DIR} ]; then + echo "DONE 0 packages" + return 0 + fi + + # Find a pkg-* package + for x in `find -s ${NANO_PACKAGE_DIR} -iname 'pkg-*'`; do + _NANO_PKG_PACKAGE=`basename "$x"` + done + if [ -z "${_NANO_PKG_PACKAGE}" -o ! -f "${NANO_PACKAGE_DIR}/${_NANO_PKG_PACKAGE}" ]; then + echo "FAILED: need a pkg/ package for bootstrapping" + exit 2 + fi + + # Copy packages into chroot + mkdir -p ${NANO_WORLDDIR}/Pkg + ( + cd ${NANO_PACKAGE_DIR} + find ${NANO_PACKAGE_LIST} -print | + cpio -Ldumpv ${NANO_WORLDDIR}/Pkg + ) + + #Bootstrap pkg + CR env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /Pkg/${_NANO_PKG_PACKAGE} + CR pkg -N >/dev/null 2>&1 + if [ "$?" -ne "0" ]; then + echo "FAILED: pkg bootstrapping faied" + exit 2 + fi + rm -f ${NANO_WORLDDIR}/Pkg/pkg-* + + # Count & report how many we have to install + todo=`ls ${NANO_WORLDDIR}/Pkg | /usr/bin/wc -l` + todo=$(expr $todo + 1) # add one for pkg since it is installed already + echo "=== TODO: $todo" + ls ${NANO_WORLDDIR}/Pkg + echo "===" + while true + do + # Record how many we have now + have=$(CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l) + + # Attempt to install more packages + CR0 'ls 'Pkg/*txz' | xargs env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg add' + + # See what that got us + now=$(CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l) + echo "=== NOW $now" + CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info + echo "===" + if [ $now -eq $todo ] ; then + echo "DONE $now packages" + break + elif [ $now -eq $have ] ; then + echo "FAILED: Nothing happened on this pass" + exit 2 + fi + done + rm -rxf ${NANO_WORLDDIR}/Pkg ) ####################################################################### @@ -758,12 +870,12 @@ late_customize_cmd () { # Progress Print # Print $2 at level $1. -pprint() { +pprint() ( if [ "$1" -le $PPLEVEL ]; then runtime=$(( `date +%s` - $NANO_STARTTIME )) printf "%s %.${1}s %s\n" "`date -u -r $runtime +%H:%M:%S`" "#####" "$2" 1>&3 fi -} +) usage () { ( @@ -855,6 +967,8 @@ if [ $# -gt 0 ] ; then usage fi +trap nano_cleanup EXIT + ####################################################################### # Setup and Export Internal variables # @@ -878,6 +992,7 @@ fi if $do_clean ; then true else + NANO_MAKE="${NANO_MAKE} -DNO_CLEAN" NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN" fi @@ -897,6 +1012,7 @@ export NANO_DRIVE export NANO_HEADS export NANO_IMAGES export NANO_IMGNAME +export NANO_MAKE export NANO_MAKE_CONF_BUILD export NANO_MAKE_CONF_INSTALL export NANO_MEDIASIZE Modified: stable/10/tools/tools/nanobsd/pcengines/ALIX_DSK ============================================================================== --- stable/10/tools/tools/nanobsd/pcengines/ALIX_DSK Thu May 1 00:12:24 2014 (r265165) +++ stable/10/tools/tools/nanobsd/pcengines/ALIX_DSK Thu May 1 00:31:19 2014 (r265166) @@ -23,6 +23,9 @@ options PSEUDOFS options GEOM_PART_GPT options GEOM_LABEL options COMPAT_43TTY +options COMPAT_FREEBSD4 # Compatible with FreeBSD4 +options COMPAT_FREEBSD5 # Compatible with FreeBSD5 +options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 options SCSI_DELAY=5000 options SYSVSHM @@ -32,12 +35,11 @@ options P1003_1B_SEMAPHORES options _KPOSIX_PRIORITY_SCHEDULING options PRINTF_BUFR_SIZE=128 device apic +device cpufreq +device acpi device pci device fdc device ata -device atadisk -device atapicd -device atapist options ATA_STATIC_ID device scbus device da Modified: stable/10/tools/tools/nanobsd/pcengines/common.conf ============================================================================== --- stable/10/tools/tools/nanobsd/pcengines/common.conf Thu May 1 00:12:24 2014 (r265165) +++ stable/10/tools/tools/nanobsd/pcengines/common.conf Thu May 1 00:31:19 2014 (r265166) @@ -2,8 +2,11 @@ # $FreeBSD$ # -NANO_TOOLS=`pwd` -NANO_PACKAGE_DIR=`pwd`/Pkg +NANO_SRC=$(pwd) +NANO_SRC=${NANO_SRC%/tools/tools/nanobsd/pcengines} +NANO_OBJ=${NANO_SRC}/../${NANO_NAME}/obj +NANO_TOOLS=$(pwd) +NANO_PACKAGE_DIR=$(pwd)/Pkg #NANO_RAM_TMPVARSIZE=20480 #NANO_RAM_TMPVARSIZE=30720 NANO_RAM_TMPVARSIZE=40960 From owner-svn-src-stable-10@FreeBSD.ORG Thu May 1 03:18:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E4F7845D; Thu, 1 May 2014 03:18: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 D297518BD; Thu, 1 May 2014 03:18: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 s413IBre007223; Thu, 1 May 2014 03:18:11 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s413IBlE007222; Thu, 1 May 2014 03:18:11 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405010318.s413IBlE007222@svn.freebsd.org> From: Mark Johnston Date: Thu, 1 May 2014 03:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265169 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 03:18:12 -0000 Author: markj Date: Thu May 1 03:18:11 2014 New Revision: 265169 URL: http://svnweb.freebsd.org/changeset/base/265169 Log: MFC r262733: Use a full path to the target for make rules which create symlinks @, machine and ${MACHINE_CPUARCH}. Otherwise the presence of a file named "x86" or "x86.c" in the make path can cause problems. Modified: stable/10/sys/conf/kmod.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/kmod.mk ============================================================================== --- stable/10/sys/conf/kmod.mk Thu May 1 03:16:40 2014 (r265168) +++ stable/10/sys/conf/kmod.mk Thu May 1 03:18:11 2014 (r265169) @@ -238,7 +238,7 @@ beforedepend: ${_ILINKS} # causes all the modules to be rebuilt when the directory pointed to changes. .for _link in ${_ILINKS} .if !exists(${.OBJDIR}/${_link}) -${OBJS}: ${_link} +${OBJS}: ${.OBJDIR}/${_link} .endif .endfor @@ -252,18 +252,23 @@ SYSDIR= ${_dir} .error "can't find kernel source tree" .endif -${_ILINKS}: - @case ${.TARGET} in \ +.for _link in ${_ILINKS} +.PHONY: ${_link} +${_link}: ${.OBJDIR}/${_link} + +${.OBJDIR}/${_link}: + @case ${.TARGET:T} in \ machine) \ path=${SYSDIR}/${MACHINE}/include ;; \ @) \ path=${SYSDIR} ;; \ *) \ - path=${SYSDIR}/${.TARGET}/include ;; \ + path=${SYSDIR}/${.TARGET:T}/include ;; \ esac ; \ path=`(cd $$path && /bin/pwd)` ; \ - ${ECHO} ${.TARGET} "->" $$path ; \ - ln -sf $$path ${.TARGET} + ${ECHO} ${.TARGET:T} "->" $$path ; \ + ln -sf $$path ${.TARGET:T} +.endfor CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} From owner-svn-src-stable-10@FreeBSD.ORG Fri May 2 10:29:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1C4C2A54; Fri, 2 May 2014 10: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 08A15160D; Fri, 2 May 2014 10: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 s42ATs1i081783; Fri, 2 May 2014 10:29:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42ATs1L081782; Fri, 2 May 2014 10:29:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405021029.s42ATs1L081782@svn.freebsd.org> From: Marius Strobl Date: Fri, 2 May 2014 10:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265220 - stable/10/contrib/libstdc++/include/bits X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 10:29:55 -0000 Author: marius Date: Fri May 2 10:29:54 2014 New Revision: 265220 URL: http://svnweb.freebsd.org/changeset/base/265220 Log: MFC: r265090 Merge r133175 from upstream: 2008-03-13 Dennis Czeremin PR libstdc++/35566 * include/bits/stl_multimap.h (multimap<>::multimap(_InputIterator, _InputIterator)): Forward to _M_insert_equal, not _M_insert_unique. This patch was GPL2 at the time and fixes a regression introduced with the merge of GCC r129013 in FreeBSD r236829. Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/contrib/libstdc++/include/bits/stl_multimap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libstdc++/include/bits/stl_multimap.h ============================================================================== --- stable/10/contrib/libstdc++/include/bits/stl_multimap.h Fri May 2 10:02:37 2014 (r265219) +++ stable/10/contrib/libstdc++/include/bits/stl_multimap.h Fri May 2 10:29:54 2014 (r265220) @@ -185,7 +185,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL template multimap(_InputIterator __first, _InputIterator __last) : _M_t() - { _M_t._M_insert_unique(__first, __last); } + { _M_t._M_insert_equal(__first, __last); } /** * @brief Builds a %multimap from a range. From owner-svn-src-stable-10@FreeBSD.ORG Fri May 2 14:44:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 23F09D9D; Fri, 2 May 2014 14:44: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 1104F1FD7; Fri, 2 May 2014 14:44: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 s42EiHFP090754; Fri, 2 May 2014 14:44:17 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42EiH1D090753; Fri, 2 May 2014 14:44:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201405021444.s42EiH1D090753@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 2 May 2014 14:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265227 - stable/10/sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 14:44:18 -0000 Author: trociny Date: Fri May 2 14:44:17 2014 New Revision: 265227 URL: http://svnweb.freebsd.org/changeset/base/265227 Log: MFC r264963: Define startup order the same way as it is in dummynet. Modified: stable/10/sys/netpfil/ipfw/ip_fw_nat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_nat.c Fri May 2 13:32:07 2014 (r265226) +++ stable/10/sys/netpfil/ipfw/ip_fw_nat.c Fri May 2 14:44:17 2014 (r265227) @@ -674,8 +674,8 @@ static moduledata_t ipfw_nat_mod = { }; /* Define startup order. */ -#define IPFW_NAT_SI_SUB_FIREWALL (SI_SUB_PROTO_IFATTACHDOMAIN + 1) -#define IPFW_NAT_MODEVENT_ORDER (SI_ORDER_ANY - 255) +#define IPFW_NAT_SI_SUB_FIREWALL SI_SUB_PROTO_IFATTACHDOMAIN +#define IPFW_NAT_MODEVENT_ORDER (SI_ORDER_ANY - 128) /* after ipfw */ #define IPFW_NAT_MODULE_ORDER (IPFW_NAT_MODEVENT_ORDER + 1) #define IPFW_NAT_VNET_ORDER (IPFW_NAT_MODEVENT_ORDER + 2) From owner-svn-src-stable-10@FreeBSD.ORG Fri May 2 20:12:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E21CBCB3; Fri, 2 May 2014 20:12: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 C3B541692; Fri, 2 May 2014 20:12: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 s42KCWQc032504; Fri, 2 May 2014 20:12:32 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42KCWMU032500; Fri, 2 May 2014 20:12:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405022012.s42KCWMU032500@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 2 May 2014 20:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265234 - in stable/10: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:12:33 -0000 Author: pfg Date: Fri May 2 20:12:31 2014 New Revision: 265234 URL: http://svnweb.freebsd.org/changeset/base/265234 Log: MFC r264040: 4248 dtrace(1M) should never create DOF with empty probes section 4249 Only probes from the first DTrace object file will be included Illumos Revision: 4a20ab41aadcb81c53e72fc65886e964e9add59 Reference: https://www.illumos.org/issues/4248 https://www.illumos.org/issues/4249 Obtained from: Illumos Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Fri May 2 18:00:03 2014 (r265233) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Fri May 2 20:12:31 2014 (r265234) @@ -22,6 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -486,7 +487,7 @@ dof_add_probe(dt_idhash_t *dhp, dt_ident return (0); } -static void +static int dof_add_provider(dt_dof_t *ddo, const dt_provider_t *pvp) { dtrace_hdl_t *dtp = ddo->ddo_hdl; @@ -497,8 +498,12 @@ dof_add_provider(dt_dof_t *ddo, const dt size_t sz; id_t i; - if (pvp->pv_flags & DT_PROVIDER_IMPL) - return; /* ignore providers that are exported by dtrace(7D) */ + if (pvp->pv_flags & DT_PROVIDER_IMPL) { + /* + * ignore providers that are exported by dtrace(7D) + */ + return (0); + } nxr = dt_popcb(pvp->pv_xrefs, pvp->pv_xrmax); dofs = alloca(sizeof (dof_secidx_t) * (nxr + 1)); @@ -525,6 +530,9 @@ dof_add_provider(dt_dof_t *ddo, const dt (void) dt_idhash_iter(pvp->pv_probes, dof_add_probe, ddo); + if (dt_buf_len(&ddo->ddo_probes) == 0) + return (dt_set_errno(dtp, EDT_NOPROBES)); + dofpv.dofpv_probes = dof_add_lsect(ddo, NULL, DOF_SECT_PROBES, sizeof (uint64_t), 0, sizeof (dof_probe_t), dt_buf_len(&ddo->ddo_probes)); @@ -579,6 +587,8 @@ dof_add_provider(dt_dof_t *ddo, const dt sizeof (dof_secidx_t), 0, sizeof (dof_secidx_t), sizeof (dof_secidx_t) * (nxr + 1)); } + + return (0); } static int @@ -822,8 +832,10 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtr */ if (flags & DTRACE_D_PROBES) { for (pvp = dt_list_next(&dtp->dt_provlist); - pvp != NULL; pvp = dt_list_next(pvp)) - dof_add_provider(ddo, pvp); + pvp != NULL; pvp = dt_list_next(pvp)) { + if (dof_add_provider(ddo, pvp) != 0) + return (NULL); + } } /* Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c Fri May 2 18:00:03 2014 (r265233) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c Fri May 2 20:12:31 2014 (r265234) @@ -26,6 +26,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -109,7 +110,8 @@ static const struct { { EDT_BADSTACKPC, "Invalid stack program counter size" }, { EDT_BADAGGVAR, "Invalid aggregation variable identifier" }, { EDT_OVERSION, "Client requested deprecated version of library" }, - { EDT_ENABLING_ERR, "Failed to enable probe" } + { EDT_ENABLING_ERR, "Failed to enable probe" }, + { EDT_NOPROBES, "No probe sites found for declared provider" } }; static const int _dt_nerr = sizeof (_dt_errlist) / sizeof (_dt_errlist[0]); Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Fri May 2 18:00:03 2014 (r265233) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Fri May 2 20:12:31 2014 (r265234) @@ -25,7 +25,7 @@ */ /* - * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -535,7 +535,8 @@ enum { EDT_BADSTACKPC, /* invalid stack program counter size */ EDT_BADAGGVAR, /* invalid aggregation variable identifier */ EDT_OVERSION, /* client is requesting deprecated version */ - EDT_ENABLING_ERR /* failed to enable probe */ + EDT_ENABLING_ERR, /* failed to enable probe */ + EDT_NOPROBES /* no probes sites for declared provider */ }; /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri May 2 18:00:03 2014 (r265233) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri May 2 20:12:31 2014 (r265234) @@ -22,9 +22,9 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved - * Use is subject to license terms. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -14571,8 +14571,8 @@ dtrace_helper_provider_add(dof_helper_t * Check to make sure this isn't a duplicate. */ for (i = 0; i < help->dthps_nprovs; i++) { - if (dofhp->dofhp_addr == - help->dthps_provs[i]->dthp_prov.dofhp_addr) + if (dofhp->dofhp_dof == + help->dthps_provs[i]->dthp_prov.dofhp_dof) return (EALREADY); } From owner-svn-src-stable-10@FreeBSD.ORG Fri May 2 21:31:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A9EB6651; Fri, 2 May 2014 21:31: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 8A9341D59; Fri, 2 May 2014 21:31: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 s42LV0Nk063901; Fri, 2 May 2014 21:31:00 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42LUxvL063889; Fri, 2 May 2014 21:30:59 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405022130.s42LUxvL063889@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 2 May 2014 21:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265243 - in stable/10/sys: fs/smbfs netsmb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 21:31:00 -0000 Author: ae Date: Fri May 2 21:30:59 2014 New Revision: 265243 URL: http://svnweb.freebsd.org/changeset/base/265243 Log: MFC r264494: Use SMB_QUERY_FS_SIZE_INFO request to populate statfs structure. When server doesn't support this request, try to use SMB_INFO_ALLOCATION. And use SMB_COM_QUERY_INFORMATION_DISK request as fallback. MFC r264600: Remove redundant unlock. This code was removed from the opensolaris and darwin's netsmb implementations, in DfBSD it also has been disabled. Modified: stable/10/sys/fs/smbfs/smbfs_smb.c stable/10/sys/fs/smbfs/smbfs_subr.h stable/10/sys/fs/smbfs/smbfs_vfsops.c stable/10/sys/netsmb/smb_iod.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- stable/10/sys/fs/smbfs/smbfs_smb.c Fri May 2 21:19:13 2014 (r265242) +++ stable/10/sys/fs/smbfs/smbfs_smb.c Fri May 2 21:30:59 2014 (r265243) @@ -135,8 +135,49 @@ smbfs_smb_lock(struct smbnode *np, int o return smbfs_smb_lockandx(np, op, (uintptr_t)id, start, end, scred); } -int -smbfs_smb_statfs2(struct smb_share *ssp, struct statfs *sbp, +static int +smbfs_query_info_fs(struct smb_share *ssp, struct statfs *sbp, + struct smb_cred *scred) +{ + struct smb_t2rq *t2p; + struct mbchain *mbp; + struct mdchain *mdp; + uint32_t bsize, bpu; + int64_t units, funits; + int error; + + error = smb_t2_alloc(SSTOCP(ssp), SMB_TRANS2_QUERY_FS_INFORMATION, + scred, &t2p); + if (error) + return (error); + mbp = &t2p->t2_tparam; + mb_init(mbp); + mb_put_uint16le(mbp, SMB_QUERY_FS_SIZE_INFO); + t2p->t2_maxpcount = 2; + t2p->t2_maxdcount = sizeof(int64_t) * 2 + sizeof(uint32_t) * 2; + error = smb_t2_request(t2p); + if (error) { + smb_t2_done(t2p); + return (error); + } + mdp = &t2p->t2_rdata; + md_get_int64le(mdp, &units); + md_get_int64le(mdp, &funits); + md_get_uint32le(mdp, &bpu); + md_get_uint32le(mdp, &bsize); + sbp->f_bsize = bpu * bsize; /* fundamental filesystem block size */ + sbp->f_blocks= (uint64_t)units; /* total data blocks in filesystem */ + sbp->f_bfree = (uint64_t)funits;/* free blocks in fs */ + sbp->f_bavail= (uint64_t)funits;/* free blocks avail to non-superuser */ + sbp->f_files = 0xffff; /* total file nodes in filesystem */ + sbp->f_ffree = 0xffff; /* free file nodes in fs */ + smb_t2_done(t2p); + return (0); +} + + +static int +smbfs_query_info_alloc(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred) { struct smb_t2rq *t2p; @@ -176,8 +217,8 @@ smbfs_smb_statfs2(struct smb_share *ssp, return 0; } -int -smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp, +static int +smbfs_query_info_disk(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred) { struct smb_rq *rqp; @@ -213,6 +254,20 @@ smbfs_smb_statfs(struct smb_share *ssp, return 0; } +int +smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp, + struct smb_cred *scred) +{ + + if (SMB_DIALECT(SSTOVC(ssp)) >= SMB_DIALECT_LANMAN2_0) { + if (smbfs_query_info_fs(ssp, sbp, scred) == 0) + return (0); + if (smbfs_query_info_alloc(ssp, sbp, scred) == 0) + return (0); + } + return (smbfs_query_info_disk(ssp, sbp, scred)); +} + static int smbfs_smb_seteof(struct smbnode *np, int64_t newsize, struct smb_cred *scred) { Modified: stable/10/sys/fs/smbfs/smbfs_subr.h ============================================================================== --- stable/10/sys/fs/smbfs/smbfs_subr.h Fri May 2 21:19:13 2014 (r265242) +++ stable/10/sys/fs/smbfs/smbfs_subr.h Fri May 2 21:30:59 2014 (r265243) @@ -126,8 +126,6 @@ struct smbfs_fctx { */ int smbfs_smb_lock(struct smbnode *np, int op, caddr_t id, off_t start, off_t end, struct smb_cred *scred); -int smbfs_smb_statfs2(struct smb_share *ssp, struct statfs *sbp, - struct smb_cred *scred); int smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred); int smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred); Modified: stable/10/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- stable/10/sys/fs/smbfs/smbfs_vfsops.c Fri May 2 21:19:13 2014 (r265242) +++ stable/10/sys/fs/smbfs/smbfs_vfsops.c Fri May 2 21:30:59 2014 (r265243) @@ -390,7 +390,7 @@ smbfs_statfs(struct mount *mp, struct st struct smbnode *np = smp->sm_root; struct smb_share *ssp = smp->sm_share; struct smb_cred *scred; - int error = 0; + int error; if (np == NULL) { vfs_mount_error(mp, "np == NULL"); @@ -400,16 +400,9 @@ smbfs_statfs(struct mount *mp, struct st sbp->f_iosize = SSTOVC(ssp)->vc_txmax; /* optimal transfer block size */ scred = smbfs_malloc_scred(); smb_makescred(scred, td, td->td_ucred); - - if (SMB_DIALECT(SSTOVC(ssp)) >= SMB_DIALECT_LANMAN2_0) - error = smbfs_smb_statfs2(ssp, sbp, scred); - else - error = smbfs_smb_statfs(ssp, sbp, scred); - if (error) { - smbfs_free_scred(scred); - return error; - } - sbp->f_flags = 0; /* copy of mount exported flags */ + error = smbfs_smb_statfs(ssp, sbp, scred); + if (error == 0) + sbp->f_flags = 0; /* copy of mount exported flags */ smbfs_free_scred(scred); - return 0; + return (error); } Modified: stable/10/sys/netsmb/smb_iod.c ============================================================================== --- stable/10/sys/netsmb/smb_iod.c Fri May 2 21:19:13 2014 (r265242) +++ stable/10/sys/netsmb/smb_iod.c Fri May 2 21:30:59 2014 (r265243) @@ -87,8 +87,6 @@ smb_iod_invrq(struct smbiod *iod) */ SMB_IOD_RQLOCK(iod); TAILQ_FOREACH(rqp, &iod->iod_rqlist, sr_link) { - if (rqp->sr_flags & SMBR_INTERNAL) - SMBRQ_SUNLOCK(rqp); rqp->sr_flags |= SMBR_RESTART; smb_iod_rqprocessed(rqp, ENOTCONN); } From owner-svn-src-stable-10@FreeBSD.ORG Sat May 3 13:19:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E161D331; Sat, 3 May 2014 13:19: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 CD8A31BC9; Sat, 3 May 2014 13:19: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 s43DJBBc064800; Sat, 3 May 2014 13:19:11 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43DJBCt064798; Sat, 3 May 2014 13:19:11 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201405031319.s43DJBCt064798@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 3 May 2014 13:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265265 - stable/10/bin/date X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 13:19:12 -0000 Author: dumbbell Date: Sat May 3 13:19:11 2014 New Revision: 265265 URL: http://svnweb.freebsd.org/changeset/base/265265 Log: date(1): Add "-R" flag to use RFC 2822 date and time output format [MFC] As stated in the man page, this is equivalent to use "%a, %d %b %Y %T %z" as the output format while LC_TIME is set to the "C" locale. This is compatible with date(1) from the GNU core utilities. This is an MFC of r264968 and r264970. Modified: stable/10/bin/date/date.1 stable/10/bin/date/date.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/date/date.1 ============================================================================== --- stable/10/bin/date/date.1 Sat May 3 11:39:04 2014 (r265264) +++ stable/10/bin/date/date.1 Sat May 3 13:19:11 2014 (r265265) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd June 3, 2010 +.Dd April 26, 2014 .Dt DATE 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd display or set date and time .Sh SYNOPSIS .Nm -.Op Fl ju +.Op Fl jRu .Op Fl r Ar seconds .Oo .Fl v @@ -58,7 +58,7 @@ .Ar MM Op Ar .ss .Sm on .Nm -.Op Fl jnu +.Op Fl jnRu .Fl f Ar input_fmt new_date .Op Cm + Ns Ar output_fmt .Nm @@ -130,6 +130,16 @@ The .Fl n option suppresses this behavior and causes the time to be set only on the current machine. +.It Fl R +Use RFC 2822 date and time output format. This is equivalent to use +.Dq Li %a, %d %b %Y \&%T %z +as +.Ar output_fmt +while +.Ev LC_TIME +is set to the +.Dq C +locale . .It Fl r Ar seconds Print the date and time represented by .Ar seconds , Modified: stable/10/bin/date/date.c ============================================================================== --- stable/10/bin/date/date.c Sat May 3 11:39:04 2014 (r265264) +++ stable/10/bin/date/date.c Sat May 3 13:19:11 2014 (r265265) @@ -69,12 +69,14 @@ static void setthetime(const char *, con static void badformat(void); static void usage(void); +static const char *rfc2822_format = "%a, %d %b %Y %T %z"; + int main(int argc, char *argv[]) { struct timezone tz; int ch, rflag; - int jflag, nflag; + int jflag, nflag, Rflag; const char *format; char buf[1024]; char *endptr, *fmt; @@ -89,9 +91,9 @@ main(int argc, char *argv[]) (void) setlocale(LC_TIME, ""); tz.tz_dsttime = tz.tz_minuteswest = 0; rflag = 0; - jflag = nflag = 0; + jflag = nflag = Rflag = 0; set_timezone = 0; - while ((ch = getopt(argc, argv, "d:f:jnr:t:uv:")) != -1) + while ((ch = getopt(argc, argv, "d:f:jnRr:t:uv:")) != -1) switch((char)ch) { case 'd': /* daylight savings time */ tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0; @@ -108,6 +110,9 @@ main(int argc, char *argv[]) case 'n': /* don't set network */ nflag = 1; break; + case 'R': /* RFC 2822 datetime format */ + Rflag = 1; + break; case 'r': /* user specified seconds */ rflag = 1; tval = strtoq(optarg, &tmp, 0); @@ -145,6 +150,9 @@ main(int argc, char *argv[]) format = "%+"; + if (Rflag) + format = rfc2822_format; + /* allow the operands in any order */ if (*argv && **argv == '+') { format = *argv + 1; @@ -169,6 +177,14 @@ main(int argc, char *argv[]) usage(); } vary_destroy(v); + + if (format == rfc2822_format) + /* + * When using RFC 2822 datetime format, don't honor the + * locale. + */ + setlocale(LC_TIME, "C"); + (void)strftime(buf, sizeof(buf), format, <); (void)printf("%s\n", buf); if (fflush(stdout)) @@ -301,7 +317,7 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: date [-jnu] [-d dst] [-r seconds] [-t west] " + "usage: date [-jnRu] [-d dst] [-r seconds] [-t west] " "[-v[+|-]val[ymwdHMS]] ... ", " " "[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]"); From owner-svn-src-stable-10@FreeBSD.ORG Sat May 3 16:08:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7BC3F5A7; Sat, 3 May 2014 16: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 5C30819EC; Sat, 3 May 2014 16:08: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 s43G8rGV036284; Sat, 3 May 2014 16:08:53 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43G8qIK036279; Sat, 3 May 2014 16:08:52 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405031608.s43G8qIK036279@svn.freebsd.org> From: Mark Johnston Date: Sat, 3 May 2014 16:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265273 - in stable/10: cddl/lib/libdtrace sys/cddl/contrib/opensolaris/uts/intel/dtrace sys/cddl/dev/dtrace/amd64 sys/cddl/dev/dtrace/i386 sys/cddl/dev/dtrace/x86 sys/modules/dtrace/dt... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 16:08:53 -0000 Author: markj Date: Sat May 3 16:08:52 2014 New Revision: 265273 URL: http://svnweb.freebsd.org/changeset/base/265273 Log: MFC r262542: Move some files that are identical on i386 and amd64 to an x86 subdirectory rather than keeping duplicate copies. Added: stable/10/sys/cddl/dev/dtrace/x86/ - copied from r262542, head/sys/cddl/dev/dtrace/x86/ Deleted: stable/10/sys/cddl/dev/dtrace/amd64/dis_tables.c stable/10/sys/cddl/dev/dtrace/amd64/dis_tables.h stable/10/sys/cddl/dev/dtrace/amd64/regset.h stable/10/sys/cddl/dev/dtrace/i386/dis_tables.c stable/10/sys/cddl/dev/dtrace/i386/dis_tables.h stable/10/sys/cddl/dev/dtrace/i386/regset.h Modified: stable/10/cddl/lib/libdtrace/Makefile stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/10/sys/modules/dtrace/dtrace/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/lib/libdtrace/Makefile ============================================================================== --- stable/10/cddl/lib/libdtrace/Makefile Sat May 3 15:57:12 2014 (r265272) +++ stable/10/cddl/lib/libdtrace/Makefile Sat May 3 16:08:52 2014 (r265273) @@ -69,9 +69,11 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ #CFLAGS+= -DYYDEBUG .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -I${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386 .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} +.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 .elif ${MACHINE_CPUARCH} == "sparc64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat May 3 15:57:12 2014 (r265272) +++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat May 3 16:08:52 2014 (r265273) @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include Modified: stable/10/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- stable/10/sys/modules/dtrace/dtrace/Makefile Sat May 3 15:57:12 2014 (r265272) +++ stable/10/sys/modules/dtrace/dtrace/Makefile Sat May 3 16:08:52 2014 (r265273) @@ -14,9 +14,11 @@ SRCS= dtrace.c \ dtrace_subr.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +.PATH: ${.CURDIR}/../../../cddl/dev/dtrace/x86 SRCS+= dis_tables.c \ instr_size.c -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel +CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel \ + -I${.CURDIR}/../../../cddl/dev/dtrace/x86 .endif SRCS+= bus_if.h device_if.h vnode_if.h From owner-svn-src-stable-10@FreeBSD.ORG Sat May 3 16:24:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1734570; Sat, 3 May 2014 16:24: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 DE8CA1B6A; Sat, 3 May 2014 16:24: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 s43GOIQV044742; Sat, 3 May 2014 16:24:18 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43GOIlF044741; Sat, 3 May 2014 16:24:18 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405031624.s43GOIlF044741@svn.freebsd.org> From: Mark Johnston Date: Sat, 3 May 2014 16:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265277 - stable/10/sys/cddl/dev/dtrace/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 16:24:19 -0000 Author: markj Date: Sat May 3 16:24:18 2014 New Revision: 265277 URL: http://svnweb.freebsd.org/changeset/base/265277 Log: MFC r262543: Fix the struct reg mappings for i386 and amd64, which differ between illumos and FreeBSD. Modified: stable/10/sys/cddl/dev/dtrace/x86/regset.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/dtrace/x86/regset.h ============================================================================== --- stable/10/sys/cddl/dev/dtrace/x86/regset.h Sat May 3 16:18:42 2014 (r265276) +++ stable/10/sys/cddl/dev/dtrace/x86/regset.h Sat May 3 16:24:18 2014 (r265277) @@ -61,6 +61,7 @@ extern "C" { #define REG_GSBASE 27 #define REG_FSBASE 26 +#if defined(sun) #define REG_DS 25 #define REG_ES 24 @@ -88,11 +89,40 @@ extern "C" { #define REG_R13 2 #define REG_R14 1 #define REG_R15 0 +#else +#define REG_SS 25 +#define REG_RSP 24 +#define REG_RFL 23 +#define REG_CS 22 +#define REG_RIP 21 +#define REG_DS 20 +#define REG_ES 19 +#define REG_ERR 18 +#define REG_GS 17 +#define REG_FS 16 +#define REG_TRAPNO 15 +#define REG_RAX 14 +#define REG_RCX 13 +#define REG_RDX 12 +#define REG_RBX 11 +#define REG_RBP 10 +#define REG_RSI 9 +#define REG_RDI 8 +#define REG_R8 7 +#define REG_R9 6 +#define REG_R10 5 +#define REG_R11 4 +#define REG_R12 3 +#define REG_R13 2 +#define REG_R14 1 +#define REG_R15 0 +#endif /* * The names and offsets defined here are specified by i386 ABI suppl. */ +#if defined(sun) #define SS 18 /* only stored on a privilege transition */ #define UESP 17 /* only stored on a privilege transition */ #define EFL 16 @@ -112,6 +142,27 @@ extern "C" { #define ES 2 #define FS 1 #define GS 0 +#else +#define GS 18 +#define SS 17 /* only stored on a privilege transition */ +#define UESP 16 /* only stored on a privilege transition */ +#define EFL 15 +#define CS 14 +#define EIP 13 +#define ERR 12 +#define TRAPNO 11 +#define EAX 10 +#define ECX 9 +#define EDX 8 +#define EBX 7 +#define ESP 6 +#define EBP 5 +#define ESI 4 +#define EDI 3 +#define DS 2 +#define ES 1 +#define FS 0 +#endif #define REG_PC EIP #define REG_FP EBP From owner-svn-src-stable-10@FreeBSD.ORG Sat May 3 17:33:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AD48AFEC; Sat, 3 May 2014 17:33: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 9990811C2; Sat, 3 May 2014 17:33: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 s43HXUae073655; Sat, 3 May 2014 17:33:30 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43HXUWn073654; Sat, 3 May 2014 17:33:30 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201405031733.s43HXUWn073654@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 3 May 2014 17:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265281 - stable/10/sys/dev/virtio/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 17:33:30 -0000 Author: bryanv Date: Sat May 3 17:33:30 2014 New Revision: 265281 URL: http://svnweb.freebsd.org/changeset/base/265281 Log: MFC r261147: Remove spaces before tabs in the function prototype list MFC r261149: Read each field of the configuration individually Modified: stable/10/sys/dev/virtio/scsi/virtio_scsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- stable/10/sys/dev/virtio/scsi/virtio_scsi.c Sat May 3 16:38:05 2014 (r265280) +++ stable/10/sys/dev/virtio/scsi/virtio_scsi.c Sat May 3 17:33:30 2014 (r265281) @@ -75,13 +75,15 @@ static int vtscsi_suspend(device_t); static int vtscsi_resume(device_t); static void vtscsi_negotiate_features(struct vtscsi_softc *); +static void vtscsi_read_config(struct vtscsi_softc *, + struct virtio_scsi_config *); static int vtscsi_maximum_segments(struct vtscsi_softc *, int); static int vtscsi_alloc_virtqueues(struct vtscsi_softc *); static void vtscsi_write_device_config(struct vtscsi_softc *); static int vtscsi_reinit(struct vtscsi_softc *); static int vtscsi_alloc_cam(struct vtscsi_softc *); -static int vtscsi_register_cam(struct vtscsi_softc *); +static int vtscsi_register_cam(struct vtscsi_softc *); static void vtscsi_free_cam(struct vtscsi_softc *); static void vtscsi_cam_async(void *, uint32_t, struct cam_path *, void *); static int vtscsi_register_async(struct vtscsi_softc *); @@ -91,7 +93,7 @@ static void vtscsi_cam_poll(struct cam_s static void vtscsi_cam_scsi_io(struct vtscsi_softc *, struct cam_sim *, union ccb *); -static void vtscsi_cam_get_tran_settings(struct vtscsi_softc *, +static void vtscsi_cam_get_tran_settings(struct vtscsi_softc *, union ccb *); static void vtscsi_cam_reset_bus(struct vtscsi_softc *, union ccb *); static void vtscsi_cam_reset_dev(struct vtscsi_softc *, union ccb *); @@ -99,69 +101,69 @@ static void vtscsi_cam_abort(struct vtsc static void vtscsi_cam_path_inquiry(struct vtscsi_softc *, struct cam_sim *, union ccb *); -static int vtscsi_sg_append_scsi_buf(struct vtscsi_softc *, +static int vtscsi_sg_append_scsi_buf(struct vtscsi_softc *, struct sglist *, struct ccb_scsiio *); -static int vtscsi_fill_scsi_cmd_sglist(struct vtscsi_softc *, +static int vtscsi_fill_scsi_cmd_sglist(struct vtscsi_softc *, struct vtscsi_request *, int *, int *); -static int vtscsi_execute_scsi_cmd(struct vtscsi_softc *, +static int vtscsi_execute_scsi_cmd(struct vtscsi_softc *, struct vtscsi_request *); -static int vtscsi_start_scsi_cmd(struct vtscsi_softc *, union ccb *); +static int vtscsi_start_scsi_cmd(struct vtscsi_softc *, union ccb *); static void vtscsi_complete_abort_timedout_scsi_cmd(struct vtscsi_softc *, struct vtscsi_request *); -static int vtscsi_abort_timedout_scsi_cmd(struct vtscsi_softc *, +static int vtscsi_abort_timedout_scsi_cmd(struct vtscsi_softc *, struct vtscsi_request *); static void vtscsi_timedout_scsi_cmd(void *); static cam_status vtscsi_scsi_cmd_cam_status(struct virtio_scsi_cmd_resp *); static cam_status vtscsi_complete_scsi_cmd_response(struct vtscsi_softc *, struct ccb_scsiio *, struct virtio_scsi_cmd_resp *); -static void vtscsi_complete_scsi_cmd(struct vtscsi_softc *, +static void vtscsi_complete_scsi_cmd(struct vtscsi_softc *, struct vtscsi_request *); static void vtscsi_poll_ctrl_req(struct vtscsi_softc *, struct vtscsi_request *); -static int vtscsi_execute_ctrl_req(struct vtscsi_softc *, +static int vtscsi_execute_ctrl_req(struct vtscsi_softc *, struct vtscsi_request *, struct sglist *, int, int, int); -static void vtscsi_complete_abort_task_cmd(struct vtscsi_softc *c, +static void vtscsi_complete_abort_task_cmd(struct vtscsi_softc *c, struct vtscsi_request *); -static int vtscsi_execute_abort_task_cmd(struct vtscsi_softc *, +static int vtscsi_execute_abort_task_cmd(struct vtscsi_softc *, struct vtscsi_request *); -static int vtscsi_execute_reset_dev_cmd(struct vtscsi_softc *, +static int vtscsi_execute_reset_dev_cmd(struct vtscsi_softc *, struct vtscsi_request *); -static void vtscsi_get_request_lun(uint8_t [], target_id_t *, lun_id_t *); +static void vtscsi_get_request_lun(uint8_t [], target_id_t *, lun_id_t *); static void vtscsi_set_request_lun(struct ccb_hdr *, uint8_t []); static void vtscsi_init_scsi_cmd_req(struct ccb_scsiio *, struct virtio_scsi_cmd_req *); static void vtscsi_init_ctrl_tmf_req(struct ccb_hdr *, uint32_t, uintptr_t, struct virtio_scsi_ctrl_tmf_req *); -static void vtscsi_freeze_simq(struct vtscsi_softc *, int); +static void vtscsi_freeze_simq(struct vtscsi_softc *, int); static int vtscsi_thaw_simq(struct vtscsi_softc *, int); -static void vtscsi_announce(struct vtscsi_softc *, uint32_t, target_id_t, +static void vtscsi_announce(struct vtscsi_softc *, uint32_t, target_id_t, lun_id_t); -static void vtscsi_execute_rescan(struct vtscsi_softc *, target_id_t, +static void vtscsi_execute_rescan(struct vtscsi_softc *, target_id_t, lun_id_t); -static void vtscsi_execute_rescan_bus(struct vtscsi_softc *); +static void vtscsi_execute_rescan_bus(struct vtscsi_softc *); -static void vtscsi_handle_event(struct vtscsi_softc *, +static void vtscsi_handle_event(struct vtscsi_softc *, struct virtio_scsi_event *); -static int vtscsi_enqueue_event_buf(struct vtscsi_softc *, +static int vtscsi_enqueue_event_buf(struct vtscsi_softc *, struct virtio_scsi_event *); static int vtscsi_init_event_vq(struct vtscsi_softc *); -static void vtscsi_reinit_event_vq(struct vtscsi_softc *); -static void vtscsi_drain_event_vq(struct vtscsi_softc *); +static void vtscsi_reinit_event_vq(struct vtscsi_softc *); +static void vtscsi_drain_event_vq(struct vtscsi_softc *); -static void vtscsi_complete_vqs_locked(struct vtscsi_softc *); -static void vtscsi_complete_vqs(struct vtscsi_softc *); -static void vtscsi_drain_vqs(struct vtscsi_softc *); -static void vtscsi_cancel_request(struct vtscsi_softc *, +static void vtscsi_complete_vqs_locked(struct vtscsi_softc *); +static void vtscsi_complete_vqs(struct vtscsi_softc *); +static void vtscsi_drain_vqs(struct vtscsi_softc *); +static void vtscsi_cancel_request(struct vtscsi_softc *, struct vtscsi_request *); static void vtscsi_drain_vq(struct vtscsi_softc *, struct virtqueue *); static void vtscsi_stop(struct vtscsi_softc *); static int vtscsi_reset_bus(struct vtscsi_softc *); -static void vtscsi_init_request(struct vtscsi_softc *, +static void vtscsi_init_request(struct vtscsi_softc *, struct vtscsi_request *); static int vtscsi_alloc_requests(struct vtscsi_softc *); static void vtscsi_free_requests(struct vtscsi_softc *); @@ -170,18 +172,18 @@ static void vtscsi_enqueue_request(struc static struct vtscsi_request * vtscsi_dequeue_request(struct vtscsi_softc *); static void vtscsi_complete_request(struct vtscsi_request *); -static void vtscsi_complete_vq(struct vtscsi_softc *, struct virtqueue *); +static void vtscsi_complete_vq(struct vtscsi_softc *, struct virtqueue *); static void vtscsi_control_vq_intr(void *); static void vtscsi_event_vq_intr(void *); static void vtscsi_request_vq_intr(void *); -static void vtscsi_disable_vqs_intr(struct vtscsi_softc *); -static void vtscsi_enable_vqs_intr(struct vtscsi_softc *); +static void vtscsi_disable_vqs_intr(struct vtscsi_softc *); +static void vtscsi_enable_vqs_intr(struct vtscsi_softc *); -static void vtscsi_get_tunables(struct vtscsi_softc *); -static void vtscsi_add_sysctl(struct vtscsi_softc *); +static void vtscsi_get_tunables(struct vtscsi_softc *); +static void vtscsi_add_sysctl(struct vtscsi_softc *); -static void vtscsi_printf_req(struct vtscsi_request *, const char *, +static void vtscsi_printf_req(struct vtscsi_request *, const char *, const char *, ...); /* Global tunables. */ @@ -287,8 +289,7 @@ vtscsi_attach(device_t dev) if (virtio_with_feature(dev, VIRTIO_SCSI_F_HOTPLUG)) sc->vtscsi_flags |= VTSCSI_FLAG_HOTPLUG; - virtio_read_device_config(dev, 0, &scsicfg, - sizeof(struct virtio_scsi_config)); + vtscsi_read_config(sc, &scsicfg); sc->vtscsi_max_channel = scsicfg.max_channel; sc->vtscsi_max_target = scsicfg.max_target; @@ -408,6 +409,35 @@ vtscsi_negotiate_features(struct vtscsi_ sc->vtscsi_features = features; } +#define VTSCSI_GET_CONFIG(_dev, _field, _cfg) \ + virtio_read_device_config(_dev, \ + offsetof(struct virtio_scsi_config, _field), \ + &(_cfg)->_field, sizeof((_cfg)->_field)) \ + +static void +vtscsi_read_config(struct vtscsi_softc *sc, + struct virtio_scsi_config *scsicfg) +{ + device_t dev; + + dev = sc->vtscsi_dev; + + bzero(scsicfg, sizeof(struct virtio_scsi_config)); + + VTSCSI_GET_CONFIG(dev, num_queues, scsicfg); + VTSCSI_GET_CONFIG(dev, seg_max, scsicfg); + VTSCSI_GET_CONFIG(dev, max_sectors, scsicfg); + VTSCSI_GET_CONFIG(dev, cmd_per_lun, scsicfg); + VTSCSI_GET_CONFIG(dev, event_info_size, scsicfg); + VTSCSI_GET_CONFIG(dev, sense_size, scsicfg); + VTSCSI_GET_CONFIG(dev, cdb_size, scsicfg); + VTSCSI_GET_CONFIG(dev, max_channel, scsicfg); + VTSCSI_GET_CONFIG(dev, max_target, scsicfg); + VTSCSI_GET_CONFIG(dev, max_lun, scsicfg); +} + +#undef VTSCSI_GET_CONFIG + static int vtscsi_maximum_segments(struct vtscsi_softc *sc, int seg_max) { From owner-svn-src-stable-10@FreeBSD.ORG Sat May 3 19:40:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 115576B; Sat, 3 May 2014 19:40: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 F13101D44; Sat, 3 May 2014 19:40: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 s43JefwJ028117; Sat, 3 May 2014 19:40:41 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43JefMW028114; Sat, 3 May 2014 19:40:41 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201405031940.s43JefMW028114@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 3 May 2014 19:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265286 - stable/10/sys/dev/virtio/network X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 19:40:42 -0000 Author: bryanv Date: Sat May 3 19:40:41 2014 New Revision: 265286 URL: http://svnweb.freebsd.org/changeset/base/265286 Log: MFC r261150, r261151, r261164, r261166, r261167, r261168, r261394, r261395: - Read and write the MAC address in the config space byte by byte - Also include the mbuf's csum_flags in an assert message - Remove stray space - Move duplicated transmit start code into a single function - Avoid queue unlock followed by relock when the enable interrupt race is lost - Check for a full virtqueue in the multiqueue transmit path - Do not place the sglist used for Rx/Tx on the stack - Use m_defrag() instead of m_collapse() to compact a long mbuf chain Modified: stable/10/sys/dev/virtio/network/if_vtnet.c stable/10/sys/dev/virtio/network/if_vtnetvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/10/sys/dev/virtio/network/if_vtnet.c Sat May 3 18:50:47 2014 (r265285) +++ stable/10/sys/dev/virtio/network/if_vtnet.c Sat May 3 19:40:41 2014 (r265286) @@ -145,6 +145,7 @@ static int vtnet_txq_mq_start_locked(str static int vtnet_txq_mq_start(struct ifnet *, struct mbuf *); static void vtnet_txq_tq_deferred(void *, int); #endif +static void vtnet_txq_start(struct vtnet_txq *); static void vtnet_txq_tq_intr(void *, int); static void vtnet_txq_eof(struct vtnet_txq *); static void vtnet_tx_vq_intr(void *); @@ -606,6 +607,20 @@ vtnet_setup_features(struct vtnet_softc } else sc->vtnet_hdr_size = sizeof(struct virtio_net_hdr); + if (sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) + sc->vtnet_rx_nsegs = VTNET_MRG_RX_SEGS; + else if (sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG) + sc->vtnet_rx_nsegs = VTNET_MAX_RX_SEGS; + else + sc->vtnet_rx_nsegs = VTNET_MIN_RX_SEGS; + + if (virtio_with_feature(dev, VIRTIO_NET_F_GSO) || + virtio_with_feature(dev, VIRTIO_NET_F_HOST_TSO4) || + virtio_with_feature(dev, VIRTIO_NET_F_HOST_TSO6)) + sc->vtnet_tx_nsegs = VTNET_MAX_TX_SEGS; + else + sc->vtnet_tx_nsegs = VTNET_MIN_TX_SEGS; + if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { sc->vtnet_flags |= VTNET_FLAG_CTRL_VQ; @@ -661,6 +676,10 @@ vtnet_init_rxq(struct vtnet_softc *sc, i rxq->vtnrx_sc = sc; rxq->vtnrx_id = id; + rxq->vtnrx_sg = sglist_alloc(sc->vtnet_rx_nsegs, M_NOWAIT); + if (rxq->vtnrx_sg == NULL) + return (ENOMEM); + TASK_INIT(&rxq->vtnrx_intrtask, 0, vtnet_rxq_tq_intr, rxq); rxq->vtnrx_tq = taskqueue_create(rxq->vtnrx_name, M_NOWAIT, taskqueue_thread_enqueue, &rxq->vtnrx_tq); @@ -682,6 +701,10 @@ vtnet_init_txq(struct vtnet_softc *sc, i txq->vtntx_sc = sc; txq->vtntx_id = id; + txq->vtntx_sg = sglist_alloc(sc->vtnet_tx_nsegs, M_NOWAIT); + if (txq->vtntx_sg == NULL) + return (ENOMEM); + #ifndef VTNET_LEGACY_TX txq->vtntx_br = buf_ring_alloc(VTNET_DEFAULT_BUFRING_SIZE, M_DEVBUF, M_NOWAIT, &txq->vtntx_mtx); @@ -734,6 +757,11 @@ vtnet_destroy_rxq(struct vtnet_rxq *rxq) rxq->vtnrx_sc = NULL; rxq->vtnrx_id = -1; + if (rxq->vtnrx_sg != NULL) { + sglist_free(rxq->vtnrx_sg); + rxq->vtnrx_sg = NULL; + } + if (mtx_initialized(&rxq->vtnrx_mtx) != 0) mtx_destroy(&rxq->vtnrx_mtx); } @@ -745,6 +773,11 @@ vtnet_destroy_txq(struct vtnet_txq *txq) txq->vtntx_sc = NULL; txq->vtntx_id = -1; + if (txq->vtntx_sg != NULL) { + sglist_free(txq->vtntx_sg); + txq->vtntx_sg = NULL; + } + #ifndef VTNET_LEGACY_TX if (txq->vtntx_br != NULL) { buf_ring_free(txq->vtntx_br, M_DEVBUF); @@ -819,40 +852,27 @@ vtnet_alloc_virtqueues(struct vtnet_soft struct vq_alloc_info *info; struct vtnet_rxq *rxq; struct vtnet_txq *txq; - int i, idx, flags, nvqs, rxsegs, error; + int i, idx, flags, nvqs, error; dev = sc->vtnet_dev; flags = 0; - /* - * Indirect descriptors are not needed for the Rx virtqueue when - * mergeable buffers are negotiated. The header is placed inline - * with the data, not in a separate descriptor, and mbuf clusters - * are always physically contiguous. - */ - if (sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) - rxsegs = 0; - else if (sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG) - rxsegs = VTNET_MAX_RX_SEGS; - else - rxsegs = VTNET_MIN_RX_SEGS; - nvqs = sc->vtnet_max_vq_pairs * 2; if (sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) nvqs++; - info = malloc(sizeof(struct vq_alloc_info) * nvqs , M_TEMP, M_NOWAIT); + info = malloc(sizeof(struct vq_alloc_info) * nvqs, M_TEMP, M_NOWAIT); if (info == NULL) return (ENOMEM); for (i = 0, idx = 0; i < sc->vtnet_max_vq_pairs; i++, idx+=2) { rxq = &sc->vtnet_rxqs[i]; - VQ_ALLOC_INFO_INIT(&info[idx], rxsegs, + VQ_ALLOC_INFO_INIT(&info[idx], sc->vtnet_rx_nsegs, vtnet_rx_vq_intr, rxq, &rxq->vtnrx_vq, "%s-%d rx", device_get_nameunit(dev), rxq->vtnrx_id); txq = &sc->vtnet_txqs[i]; - VQ_ALLOC_INFO_INIT(&info[idx+1], VTNET_MAX_TX_SEGS, + VQ_ALLOC_INFO_INIT(&info[idx+1], sc->vtnet_tx_nsegs, vtnet_tx_vq_intr, txq, &txq->vtntx_vq, "%s-%d tx", device_get_nameunit(dev), txq->vtntx_id); } @@ -1359,14 +1379,14 @@ vtnet_rxq_replace_buf(struct vtnet_rxq * static int vtnet_rxq_enqueue_buf(struct vtnet_rxq *rxq, struct mbuf *m) { - struct sglist sg; - struct sglist_seg segs[VTNET_MAX_RX_SEGS]; struct vtnet_softc *sc; + struct sglist *sg; struct vtnet_rx_header *rxhdr; uint8_t *mdata; int offset, error; sc = rxq->vtnrx_sc; + sg = rxq->vtnrx_sg; mdata = mtod(m, uint8_t *); VTNET_RXQ_LOCK_ASSERT(rxq); @@ -1376,22 +1396,22 @@ vtnet_rxq_enqueue_buf(struct vtnet_rxq * ("%s: unexpected cluster size %d/%d", __func__, m->m_len, sc->vtnet_rx_clsize)); - sglist_init(&sg, VTNET_MAX_RX_SEGS, segs); + sglist_reset(sg); if ((sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) == 0) { MPASS(sc->vtnet_hdr_size == sizeof(struct virtio_net_hdr)); rxhdr = (struct vtnet_rx_header *) mdata; - sglist_append(&sg, &rxhdr->vrh_hdr, sc->vtnet_hdr_size); + sglist_append(sg, &rxhdr->vrh_hdr, sc->vtnet_hdr_size); offset = sizeof(struct vtnet_rx_header); } else offset = 0; - sglist_append(&sg, mdata + offset, m->m_len - offset); + sglist_append(sg, mdata + offset, m->m_len - offset); if (m->m_next != NULL) { - error = sglist_append_mbuf(&sg, m->m_next); + error = sglist_append_mbuf(sg, m->m_next); MPASS(error == 0); } - error = virtqueue_enqueue(rxq->vtnrx_vq, m, &sg, 0, sg.sg_nseg); + error = virtqueue_enqueue(rxq->vtnrx_vq, m, sg, 0, sg->sg_nseg); return (error); } @@ -1818,9 +1838,9 @@ vtnet_rx_vq_intr(void *xrxq) return; } -again: VTNET_RXQ_LOCK(rxq); +again: if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { VTNET_RXQ_UNLOCK(rxq); return; @@ -1834,10 +1854,11 @@ again: * This is an occasional condition or race (when !more), * so retry a few times before scheduling the taskqueue. */ - rxq->vtnrx_stats.vrxs_rescheduled++; - VTNET_RXQ_UNLOCK(rxq); if (tries++ < VTNET_INTR_DISABLE_RETRIES) goto again; + + VTNET_RXQ_UNLOCK(rxq); + rxq->vtnrx_stats.vrxs_rescheduled++; taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); } else VTNET_RXQ_UNLOCK(rxq); @@ -2025,7 +2046,8 @@ vtnet_txq_offload(struct vtnet_txq *txq, } KASSERT(hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM, - ("%s: mbuf %p TSO without checksum offload", __func__, m)); + ("%s: mbuf %p TSO without checksum offload %#x", + __func__, m, flags)); error = vtnet_txq_offload_tso(txq, m, etype, csum_start, hdr); if (error) @@ -2043,45 +2065,43 @@ static int vtnet_txq_enqueue_buf(struct vtnet_txq *txq, struct mbuf **m_head, struct vtnet_tx_header *txhdr) { - struct sglist sg; - struct sglist_seg segs[VTNET_MAX_TX_SEGS]; struct vtnet_softc *sc; struct virtqueue *vq; + struct sglist *sg; struct mbuf *m; - int collapsed, error; + int error; - vq = txq->vtntx_vq; sc = txq->vtntx_sc; + vq = txq->vtntx_vq; + sg = txq->vtntx_sg; m = *m_head; - collapsed = 0; - sglist_init(&sg, VTNET_MAX_TX_SEGS, segs); - error = sglist_append(&sg, &txhdr->vth_uhdr, sc->vtnet_hdr_size); - KASSERT(error == 0 && sg.sg_nseg == 1, + sglist_reset(sg); + error = sglist_append(sg, &txhdr->vth_uhdr, sc->vtnet_hdr_size); + KASSERT(error == 0 && sg->sg_nseg == 1, ("%s: error %d adding header to sglist", __func__, error)); -again: - error = sglist_append_mbuf(&sg, m); + error = sglist_append_mbuf(sg, m); if (error) { - if (collapsed) - goto fail; - - m = m_collapse(m, M_NOWAIT, VTNET_MAX_TX_SEGS - 1); + m = m_defrag(m, M_NOWAIT); if (m == NULL) goto fail; *m_head = m; - collapsed = 1; - txq->vtntx_stats.vtxs_collapsed++; - goto again; + sc->vtnet_stats.tx_defragged++; + + error = sglist_append_mbuf(sg, m); + if (error) + goto fail; } txhdr->vth_mbuf = m; - error = virtqueue_enqueue(vq, txhdr, &sg, sg.sg_nseg, 0); + error = virtqueue_enqueue(vq, txhdr, sg, sg->sg_nseg, 0); return (error); fail: + sc->vtnet_stats.tx_defrag_failed++; m_freem(*m_head); *m_head = NULL; @@ -2238,6 +2258,12 @@ vtnet_txq_mq_start_locked(struct vtnet_t vtnet_txq_eof(txq); while ((m = drbr_peek(ifp, br)) != NULL) { + if (virtqueue_full(vq)) { + drbr_putback(ifp, br, m); + error = ENOBUFS; + break; + } + error = vtnet_txq_encap(txq, &m); if (error) { if (m != NULL) @@ -2306,6 +2332,24 @@ vtnet_txq_tq_deferred(void *xtxq, int pe #endif /* VTNET_LEGACY_TX */ static void +vtnet_txq_start(struct vtnet_txq *txq) +{ + struct vtnet_softc *sc; + struct ifnet *ifp; + + sc = txq->vtntx_sc; + ifp = sc->vtnet_ifp; + +#ifdef VTNET_LEGACY_TX + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + vtnet_start_locked(txq, ifp); +#else + if (!drbr_empty(ifp, txq->vtntx_br)) + vtnet_txq_mq_start_locked(txq, NULL); +#endif +} + +static void vtnet_txq_tq_intr(void *xtxq, int pending) { struct vtnet_softc *sc; @@ -2325,13 +2369,7 @@ vtnet_txq_tq_intr(void *xtxq, int pendin vtnet_txq_eof(txq); -#ifdef VTNET_LEGACY_TX - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vtnet_start_locked(txq, ifp); -#else - if (!drbr_empty(ifp, txq->vtntx_br)) - vtnet_txq_mq_start_locked(txq, NULL); -#endif + vtnet_txq_start(txq); if (vtnet_txq_enable_intr(txq) != 0) { vtnet_txq_disable_intr(txq); @@ -2392,9 +2430,9 @@ vtnet_tx_vq_intr(void *xtxq) return; } -again: VTNET_TXQ_LOCK(txq); +again: if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { VTNET_TXQ_UNLOCK(txq); return; @@ -2402,13 +2440,7 @@ again: vtnet_txq_eof(txq); -#ifdef VTNET_LEGACY_TX - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vtnet_start_locked(txq, ifp); -#else - if (!drbr_empty(ifp, txq->vtntx_br)) - vtnet_txq_mq_start_locked(txq, NULL); -#endif + vtnet_txq_start(txq); if (vtnet_txq_enable_intr(txq) != 0) { vtnet_txq_disable_intr(txq); @@ -2416,9 +2448,10 @@ again: * This is an occasional race, so retry a few times * before scheduling the taskqueue. */ - VTNET_TXQ_UNLOCK(txq); if (tries++ < VTNET_INTR_DISABLE_RETRIES) goto again; + + VTNET_TXQ_UNLOCK(txq); txq->vtntx_stats.vtxs_rescheduled++; taskqueue_enqueue(txq->vtntx_tq, &txq->vtntx_intrtask); } else @@ -2428,24 +2461,16 @@ again: static void vtnet_tx_start_all(struct vtnet_softc *sc) { - struct ifnet *ifp; struct vtnet_txq *txq; int i; - ifp = sc->vtnet_ifp; VTNET_CORE_LOCK_ASSERT(sc); for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { txq = &sc->vtnet_txqs[i]; VTNET_TXQ_LOCK(txq); -#ifdef VTNET_LEGACY_TX - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vtnet_start_locked(txq, ifp); -#else - if (!drbr_empty(ifp, txq->vtntx_br)) - vtnet_txq_mq_start_locked(txq, NULL); -#endif + vtnet_txq_start(txq); VTNET_TXQ_UNLOCK(txq); } } @@ -2521,7 +2546,6 @@ vtnet_txq_accum_stats(struct vtnet_txq * accum->vtxs_obytes += st->vtxs_obytes; accum->vtxs_csum += st->vtxs_csum; accum->vtxs_tso += st->vtxs_tso; - accum->vtxs_collapsed += st->vtxs_collapsed; accum->vtxs_rescheduled += st->vtxs_rescheduled; } @@ -2839,9 +2863,10 @@ vtnet_init_rx_queues(struct vtnet_softc sc->vtnet_rx_clsize = clsize; sc->vtnet_rx_nmbufs = VTNET_NEEDED_RX_MBUFS(sc, clsize); - /* The first segment is reserved for the header. */ - KASSERT(sc->vtnet_rx_nmbufs < VTNET_MAX_RX_SEGS, - ("%s: too many rx mbufs %d", __func__, sc->vtnet_rx_nmbufs)); + KASSERT(sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS || + sc->vtnet_rx_nmbufs < sc->vtnet_rx_nsegs, + ("%s: too many rx mbufs %d for %d segments", __func__, + sc->vtnet_rx_nmbufs, sc->vtnet_rx_nsegs)); for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { rxq = &sc->vtnet_rxqs[i]; @@ -3483,6 +3508,7 @@ static void vtnet_set_hwaddr(struct vtnet_softc *sc) { device_t dev; + int i; dev = sc->vtnet_dev; @@ -3490,9 +3516,11 @@ vtnet_set_hwaddr(struct vtnet_softc *sc) if (vtnet_ctrl_mac_cmd(sc, sc->vtnet_hwaddr) != 0) device_printf(dev, "unable to set MAC address\n"); } else if (sc->vtnet_flags & VTNET_FLAG_MAC) { - virtio_write_device_config(dev, - offsetof(struct virtio_net_config, mac), - sc->vtnet_hwaddr, ETHER_ADDR_LEN); + for (i = 0; i < ETHER_ADDR_LEN; i++) { + virtio_write_dev_config_1(dev, + offsetof(struct virtio_net_config, mac) + i, + sc->vtnet_hwaddr[i]); + } } } @@ -3500,6 +3528,7 @@ static void vtnet_get_hwaddr(struct vtnet_softc *sc) { device_t dev; + int i; dev = sc->vtnet_dev; @@ -3517,8 +3546,10 @@ vtnet_get_hwaddr(struct vtnet_softc *sc) return; } - virtio_read_device_config(dev, offsetof(struct virtio_net_config, mac), - sc->vtnet_hwaddr, ETHER_ADDR_LEN); + for (i = 0; i < ETHER_ADDR_LEN; i++) { + sc->vtnet_hwaddr[i] = virtio_read_dev_config_1(dev, + offsetof(struct virtio_net_config, mac) + i); + } } static void @@ -3595,8 +3626,6 @@ vtnet_setup_txq_sysctl(struct sysctl_ctx &stats->vtxs_csum, "Transmit checksum offloaded"); SYSCTL_ADD_UQUAD(ctx, list, OID_AUTO, "tso", CTLFLAG_RD, &stats->vtxs_tso, "Transmit segmentation offloaded"); - SYSCTL_ADD_UQUAD(ctx, list, OID_AUTO, "collapsed", CTLFLAG_RD, - &stats->vtxs_collapsed, "Transmit mbufs collapsed"); SYSCTL_ADD_UQUAD(ctx, list, OID_AUTO, "rescheduled", CTLFLAG_RD, &stats->vtxs_rescheduled, "Transmit interrupt handler rescheduled"); @@ -3676,6 +3705,12 @@ vtnet_setup_stat_sysctl(struct sysctl_ct SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "tx_tso_not_tcp", CTLFLAG_RD, &stats->tx_tso_not_tcp, "Aborted transmit of TSO buffer with non TCP protocol"); + SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "tx_defragged", + CTLFLAG_RD, &stats->tx_defragged, + "Transmit mbufs defragged"); + SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "tx_defrag_failed", + CTLFLAG_RD, &stats->tx_defrag_failed, + "Aborted transmit of buffer because defrag failed"); SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "tx_csum_offloaded", CTLFLAG_RD, &stats->tx_csum_offloaded, "Offloaded checksum of transmitted buffer"); Modified: stable/10/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- stable/10/sys/dev/virtio/network/if_vtnetvar.h Sat May 3 18:50:47 2014 (r265285) +++ stable/10/sys/dev/virtio/network/if_vtnetvar.h Sat May 3 19:40:41 2014 (r265286) @@ -44,6 +44,8 @@ struct vtnet_statistics { uint64_t tx_csum_bad_ethtype; uint64_t tx_tso_bad_ethtype; uint64_t tx_tso_not_tcp; + uint64_t tx_defragged; + uint64_t tx_defrag_failed; /* * These are accumulated from each Rx/Tx queue. @@ -70,6 +72,7 @@ struct vtnet_rxq { struct mtx vtnrx_mtx; struct vtnet_softc *vtnrx_sc; struct virtqueue *vtnrx_vq; + struct sglist *vtnrx_sg; int vtnrx_id; int vtnrx_process_limit; struct vtnet_rxq_stats vtnrx_stats; @@ -91,7 +94,6 @@ struct vtnet_txq_stats { uint64_t vtxs_omcasts; /* if_omcasts */ uint64_t vtxs_csum; uint64_t vtxs_tso; - uint64_t vtxs_collapsed; uint64_t vtxs_rescheduled; }; @@ -99,6 +101,7 @@ struct vtnet_txq { struct mtx vtntx_mtx; struct vtnet_softc *vtntx_sc; struct virtqueue *vtntx_vq; + struct sglist *vtntx_sg; #ifndef VTNET_LEGACY_TX struct buf_ring *vtntx_br; #endif @@ -143,9 +146,11 @@ struct vtnet_softc { int vtnet_link_active; int vtnet_hdr_size; int vtnet_rx_process_limit; + int vtnet_rx_nsegs; int vtnet_rx_nmbufs; int vtnet_rx_clsize; int vtnet_rx_new_clsize; + int vtnet_tx_nsegs; int vtnet_if_flags; int vtnet_act_vq_pairs; int vtnet_max_vq_pairs; @@ -293,11 +298,14 @@ CTASSERT(sizeof(struct vtnet_mac_filter) /* * Used to preallocate the Vq indirect descriptors. The first segment - * is reserved for the header. + * is reserved for the header, except for mergeable buffers since the + * header is placed inline with the data. */ +#define VTNET_MRG_RX_SEGS 1 #define VTNET_MIN_RX_SEGS 2 #define VTNET_MAX_RX_SEGS 34 -#define VTNET_MAX_TX_SEGS 34 +#define VTNET_MIN_TX_SEGS 4 +#define VTNET_MAX_TX_SEGS 64 /* * Assert we can receive and transmit the maximum with regular @@ -314,7 +322,7 @@ CTASSERT(((VTNET_MAX_TX_SEGS - 1) * MCLB /* * Determine how many mbufs are in each receive buffer. For LRO without - * mergeable descriptors, we must allocate an mbuf chain large enough to + * mergeable buffers, we must allocate an mbuf chain large enough to * hold both the vtnet_rx_header and the maximum receivable data. */ #define VTNET_NEEDED_RX_MBUFS(_sc, _clsize) \ From owner-svn-src-stable-10@FreeBSD.ORG Sun May 4 00:09:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1B7ED358; Sun, 4 May 2014 00:09:08 +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 E346F15D4; Sun, 4 May 2014 00:09:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44097B7053997; Sun, 4 May 2014 00:09:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44097PB053996; Sun, 4 May 2014 00:09:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405040009.s44097PB053996@svn.freebsd.org> From: Glen Barber Date: Sun, 4 May 2014 00:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265293 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 00:09:08 -0000 Author: gjb Date: Sun May 4 00:09:07 2014 New Revision: 265293 URL: http://svnweb.freebsd.org/changeset/base/265293 Log: MFC r264907, r264908, r264922: Record mergeinfo for r264907 and r264908, reverted in r264922. This commit is for merge tracking purposes only. Sponsored by: The FreeBSD Foundation Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Sun May 4 00:13:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4B34470A; Sun, 4 May 2014 00:13:08 +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 1E71F1655; Sun, 4 May 2014 00:13:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s440D7aw057684; Sun, 4 May 2014 00:13:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s440D7FI057682; Sun, 4 May 2014 00:13:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405040013.s440D7FI057682@svn.freebsd.org> From: Glen Barber Date: Sun, 4 May 2014 00:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265296 - in stable/10/release: amd64 i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 00:13:08 -0000 Author: gjb Date: Sun May 4 00:13:07 2014 New Revision: 265296 URL: http://svnweb.freebsd.org/changeset/base/265296 Log: MFC r264933: Fix indentation in make-memstick.sh. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/amd64/make-memstick.sh stable/10/release/i386/make-memstick.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/amd64/make-memstick.sh ============================================================================== --- stable/10/release/amd64/make-memstick.sh Sun May 4 00:10:25 2014 (r265295) +++ stable/10/release/amd64/make-memstick.sh Sun May 4 00:13:07 2014 (r265296) @@ -14,32 +14,32 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH if [ $# -ne 2 ]; then - echo "make-memstick.sh /path/to/directory /path/to/image/file" - exit 1 + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 fi if [ ! -d ${1} ]; then - echo "${1} must be a directory" - exit 1 + echo "${1} must be a directory" + exit 1 fi if [ -e ${2} ]; then - echo "won't overwrite ${2}" - exit 1 + echo "won't overwrite ${2}" + exit 1 fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab makefs -B little -o label=FreeBSD_Install ${2} ${1} if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 + echo "makefs failed" + exit 1 fi rm ${1}/etc/fstab -unit=`mdconfig -a -t vnode -f ${2}` +unit=$(mdconfig -a -t vnode -f ${2}) if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 + echo "mdconfig failed" + exit 1 fi gpart create -s BSD ${unit} gpart bootcode -b ${1}/boot/boot ${unit} Modified: stable/10/release/i386/make-memstick.sh ============================================================================== --- stable/10/release/i386/make-memstick.sh Sun May 4 00:10:25 2014 (r265295) +++ stable/10/release/i386/make-memstick.sh Sun May 4 00:13:07 2014 (r265296) @@ -14,32 +14,32 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH if [ $# -ne 2 ]; then - echo "make-memstick.sh /path/to/directory /path/to/image/file" - exit 1 + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 fi if [ ! -d ${1} ]; then - echo "${1} must be a directory" - exit 1 + echo "${1} must be a directory" + exit 1 fi if [ -e ${2} ]; then - echo "won't overwrite ${2}" - exit 1 + echo "won't overwrite ${2}" + exit 1 fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab makefs -B little -o label=FreeBSD_Install ${2} ${1} if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 + echo "makefs failed" + exit 1 fi rm ${1}/etc/fstab -unit=`mdconfig -a -t vnode -f ${2}` +unit=$(mdconfig -a -t vnode -f ${2}) if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 + echo "mdconfig failed" + exit 1 fi gpart create -s BSD ${unit} gpart bootcode -b ${1}/boot/boot ${unit} From owner-svn-src-stable-10@FreeBSD.ORG Sun May 4 07:19:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D38419E8; Sun, 4 May 2014 07:19: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 A69CC172F; Sun, 4 May 2014 07:19: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 s447JbVC034013; Sun, 4 May 2014 07:19:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s447JbOK034012; Sun, 4 May 2014 07:19:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405040719.s447JbOK034012@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 May 2014 07:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265311 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 07:19:37 -0000 Author: kib Date: Sun May 4 07:19:37 2014 New Revision: 265311 URL: http://svnweb.freebsd.org/changeset/base/265311 Log: MFC r265002: Fix vm_fault_copy_entry() operation on upgrade; allow it to find the pages in the shadowed objects. Modified: stable/10/sys/vm/vm_fault.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Sun May 4 04:01:26 2014 (r265310) +++ stable/10/sys/vm/vm_fault.c Sun May 4 07:19:37 2014 (r265311) @@ -1229,7 +1229,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm vm_offset_t vaddr; vm_page_t dst_m; vm_page_t src_m; - boolean_t src_readonly, upgrade; + boolean_t upgrade; #ifdef lint src_map++; @@ -1239,7 +1239,6 @@ vm_fault_copy_entry(vm_map_t dst_map, vm src_object = src_entry->object.vm_object; src_pindex = OFF_TO_IDX(src_entry->offset); - src_readonly = (src_entry->protection & VM_PROT_WRITE) == 0; /* * Create the top-level object for the destination entry. (Doesn't @@ -1310,25 +1309,33 @@ vm_fault_copy_entry(vm_map_t dst_map, vm /* * Find the page in the source object, and copy it in. - * (Because the source is wired down, the page will be in - * memory.) + * Because the source is wired down, the page will be + * in memory. */ VM_OBJECT_RLOCK(src_object); object = src_object; pindex = src_pindex + dst_pindex; while ((src_m = vm_page_lookup(object, pindex)) == NULL && - src_readonly && (backing_object = object->backing_object) != NULL) { /* - * Allow fallback to backing objects if we are reading. + * Unless the source mapping is read-only or + * it is presently being upgraded from + * read-only, the first object in the shadow + * chain should provide all of the pages. In + * other words, this loop body should never be + * executed when the source mapping is already + * read/write. */ + KASSERT((src_entry->protection & VM_PROT_WRITE) == 0 || + upgrade, + ("vm_fault_copy_entry: main object missing page")); + VM_OBJECT_RLOCK(backing_object); pindex += OFF_TO_IDX(object->backing_object_offset); VM_OBJECT_RUNLOCK(object); object = backing_object; } - if (src_m == NULL) - panic("vm_fault_copy_wired: page missing"); + KASSERT(src_m != NULL, ("vm_fault_copy_entry: page missing")); pmap_copy_page(src_m, dst_m); VM_OBJECT_RUNLOCK(object); dst_m->valid = VM_PAGE_BITS_ALL; From owner-svn-src-stable-10@FreeBSD.ORG Sun May 4 07:22:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D587AB4A; Sun, 4 May 2014 07:22: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 C213017C2; Sun, 4 May 2014 07:22: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 s447MpCh037376; Sun, 4 May 2014 07:22:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s447Mp6s037375; Sun, 4 May 2014 07:22:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405040722.s447Mp6s037375@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 May 2014 07:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265312 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 07:22:51 -0000 Author: kib Date: Sun May 4 07:22:51 2014 New Revision: 265312 URL: http://svnweb.freebsd.org/changeset/base/265312 Log: MFC r265004: Same as it was done in r263878 for invlrng_handler(), fix order of checks for special pcid values in invlpg_pcid_handler(). Modified: stable/10/sys/amd64/amd64/mp_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_machdep.c Sun May 4 07:19:37 2014 (r265311) +++ stable/10/sys/amd64/amd64/mp_machdep.c Sun May 4 07:22:51 2014 (r265312) @@ -1567,6 +1567,7 @@ invlpg_handler(void) void invlpg_pcid_handler(void) { + uint64_t cr3; #ifdef COUNT_XINVLTLB_HITS xhits_pg[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -1574,15 +1575,13 @@ invlpg_pcid_handler(void) (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ - if (invpcid_works) { - invpcid(&smp_tlb_invpcid, INVPCID_ADDR); + if (smp_tlb_invpcid.pcid == (uint64_t)-1) { + invltlb_globpcid(); } else if (smp_tlb_invpcid.pcid == 0) { invlpg(smp_tlb_invpcid.addr); - } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { - invltlb_globpcid(); + } else if (invpcid_works) { + invpcid(&smp_tlb_invpcid, INVPCID_ADDR); } else { - uint64_t cr3; - /* * PCID supported, but INVPCID is not. * Temporarily switch to the target address From owner-svn-src-stable-10@FreeBSD.ORG Sun May 4 07:28:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1A8FFDD9; Sun, 4 May 2014 07:28: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 06E07181B; Sun, 4 May 2014 07:28: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 s447SQss037994; Sun, 4 May 2014 07:28:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s447SQ9Y037993; Sun, 4 May 2014 07:28:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405040728.s447SQ9Y037993@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 May 2014 07:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265313 - stable/10/secure/usr.sbin/sshd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 07:28:27 -0000 Author: kib Date: Sun May 4 07:28:26 2014 New Revision: 265313 URL: http://svnweb.freebsd.org/changeset/base/265313 Log: MFC r265003: Fix order of libthr and libc in the global dso list for sshd. Modified: stable/10/secure/usr.sbin/sshd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/secure/usr.sbin/sshd/Makefile ============================================================================== --- stable/10/secure/usr.sbin/sshd/Makefile Sun May 4 07:22:51 2014 (r265312) +++ stable/10/secure/usr.sbin/sshd/Makefile Sun May 4 07:28:26 2014 (r265313) @@ -57,6 +57,16 @@ CFLAGS+= -DNONE_CIPHER_ENABLED DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} LDADD+= -lcrypt -lcrypto -lz +# Fix the order of NEEDED entries for libthr and libc. The libthr +# needs to interpose libc symbols, leaving the libthr loading as +# dependency of krb causes reversed order and broken interposing. Put +# the threading library last on the linker command line, just before +# the -lc added by a compiler driver. +.if ${MK_KERBEROS_SUPPORT} != "no" +DPADD+= ${LIBPTHREAD} +LDADD+= -lpthread +.endif + .if defined(LOCALBASE) CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" .endif From owner-svn-src-stable-10@FreeBSD.ORG Mon May 5 01:29:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DB68E663; Mon, 5 May 2014 01:29: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 C8C3A1714; Mon, 5 May 2014 01:29: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 s451TKxM041303; Mon, 5 May 2014 01:29:20 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s451TK1S041302; Mon, 5 May 2014 01:29:20 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405050129.s451TK1S041302@svn.freebsd.org> From: Glen Barber Date: Mon, 5 May 2014 01:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265342 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 01:29:21 -0000 Author: gjb Date: Mon May 5 01:29:20 2014 New Revision: 265342 URL: http://svnweb.freebsd.org/changeset/base/265342 Log: MRC r265230: Clarify that MAKEOBJDIRPREFIX and MAKEOBJDIR are not honored as make(1) arguments. Sponsored by: The FreeBSD Foundation Modified: stable/10/share/man/man5/make.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man5/make.conf.5 ============================================================================== --- stable/10/share/man/man5/make.conf.5 Mon May 5 01:26:28 2014 (r265341) +++ stable/10/share/man/man5/make.conf.5 Mon May 5 01:29:20 2014 (r265342) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2013 +.Dd May 2, 2014 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -689,6 +689,8 @@ and .Ev MAKEOBJDIR are environment variables and should not be set in .Nm +or as command line arguments to +.Xr make 1 , but in make's environment. .Sh BUGS This manual page may occasionally be out of date with respect to From owner-svn-src-stable-10@FreeBSD.ORG Mon May 5 01:50:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DF434BF3; Mon, 5 May 2014 01:50: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 C0E041893; Mon, 5 May 2014 01:50: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 s451o2Fo050109; Mon, 5 May 2014 01:50:02 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s451o22w050106; Mon, 5 May 2014 01:50:02 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201405050150.s451o22w050106@svn.freebsd.org> From: Kevin Lo Date: Mon, 5 May 2014 01:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265345 - in stable/10: share/man/man4 sys/dev/usb sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 01:50:03 -0000 Author: kevlo Date: Mon May 5 01:50:01 2014 New Revision: 265345 URL: http://svnweb.freebsd.org/changeset/base/265345 Log: MFC r264317, r264864: - Add the Asus USB-N10 NANO [1] - Fix panic by adding mtx_assert() to urtwn_init_locked() and urtwn_stop_locked() [2] Tested by: Kuan-Chung Chiu [1] Anthony Jenkins [2] Modified: stable/10/share/man/man4/urtwn.4 stable/10/sys/dev/usb/usbdevs stable/10/sys/dev/usb/wlan/if_urtwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/urtwn.4 ============================================================================== --- stable/10/share/man/man4/urtwn.4 Mon May 5 01:47:05 2014 (r265344) +++ stable/10/share/man/man4/urtwn.4 Mon May 5 01:50:01 2014 (r265345) @@ -61,6 +61,7 @@ It operates in the 2GHz spectrum only. The following adapters should work: .Pp .Bl -tag -width Ds -offset indent -compact +.It ASUS USB-N10 NANO .It Belkin F7D1102 Surf Wireless Micro .It D-Link DWA-131 .It Edimax EW-7811Un Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Mon May 5 01:47:05 2014 (r265344) +++ stable/10/sys/dev/usb/usbdevs Mon May 5 01:50:01 2014 (r265345) @@ -1186,6 +1186,7 @@ product ASUS RT3070_1 0x1790 RT3070 product ASUS USBN10 0x1786 USB-N10 product ASUS RTL8192CU 0x17ab RTL8192CU product ASUS USBN66 0x17ad USB-N66 +product ASUS USBN10NANO 0x17ba USB-N10 Nano product ASUS RTL8192SU 0x1791 RTL8192SU product ASUS A730W 0x4202 ASUS MyPal A730W product ASUS P535 0x420f ASUS P535 PDA Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Mon May 5 01:47:05 2014 (r265344) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Mon May 5 01:50:01 2014 (r265345) @@ -91,6 +91,7 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(ABOCOM, RTL8188CU_2), URTWN_DEV(ABOCOM, RTL8192CU), URTWN_DEV(ASUS, RTL8192CU), + URTWN_DEV(ASUS, USBN10NANO), URTWN_DEV(AZUREWAVE, RTL8188CE_1), URTWN_DEV(AZUREWAVE, RTL8188CE_2), URTWN_DEV(AZUREWAVE, RTL8188CU), @@ -2051,6 +2052,7 @@ urtwn_load_firmware(struct urtwn_softc * uint32_t reg; int mlen, ntries, page, error; + URTWN_UNLOCK(sc); /* Read firmware image from the filesystem. */ if ((sc->chip & (URTWN_CHIP_UMC_A_CUT | URTWN_CHIP_92C)) == URTWN_CHIP_UMC_A_CUT) @@ -2059,6 +2061,7 @@ urtwn_load_firmware(struct urtwn_softc * imagename = "urtwn-rtl8192cfwT"; fw = firmware_get(imagename); + URTWN_LOCK(sc); if (fw == NULL) { device_printf(sc->sc_dev, "failed loadfirmware of file %s\n", imagename); @@ -2813,6 +2816,8 @@ urtwn_init_locked(void *arg) uint32_t reg; int error; + URTWN_ASSERT_LOCKED(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) urtwn_stop_locked(ifp); @@ -2976,6 +2981,8 @@ urtwn_stop_locked(struct ifnet *ifp) { struct urtwn_softc *sc = ifp->if_softc; + URTWN_ASSERT_LOCKED(sc); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); callout_stop(&sc->sc_watchdog_ch); From owner-svn-src-stable-10@FreeBSD.ORG Mon May 5 03:15:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9201A579; Mon, 5 May 2014 03:15: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 64A2B1580; Mon, 5 May 2014 03:15: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 s453Fsk6027600; Mon, 5 May 2014 03:15:54 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s453FsXJ027599; Mon, 5 May 2014 03:15:54 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405050315.s453FsXJ027599@svn.freebsd.org> From: Mark Johnston Date: Mon, 5 May 2014 03:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265346 - stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 03:15:54 -0000 Author: markj Date: Mon May 5 03:15:53 2014 New Revision: 265346 URL: http://svnweb.freebsd.org/changeset/base/265346 Log: MFC r262661: Fix emulation of call and jmp instructions on i386 and for 32-bit processes on amd64. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon May 5 01:50:01 2014 (r265345) +++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon May 5 03:15:53 2014 (r265346) @@ -1429,10 +1429,7 @@ fasttrap_pid_probe(struct reg *rp) if (tp->ftt_code == 0) { new_pc = tp->ftt_dest; } else { -#ifdef __amd64 - uintptr_t value; -#endif - uintptr_t addr = tp->ftt_dest; + uintptr_t value, addr = tp->ftt_dest; if (tp->ftt_base != FASTTRAP_NOREG) addr += fasttrap_getreg(rp, tp->ftt_base); @@ -1456,6 +1453,7 @@ fasttrap_pid_probe(struct reg *rp) #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { +#endif if ((value = fasttrap_fulword((void *)addr)) == -1) { fasttrap_sigsegv(p, curthread, @@ -1464,9 +1462,8 @@ fasttrap_pid_probe(struct reg *rp) break; } new_pc = value; +#ifdef __amd64 } else { -#endif -#ifdef __i386__ uint32_t value32; addr = (uintptr_t)(uint32_t)addr; if ((value32 = fasttrap_fuword32((void *)addr)) @@ -1477,13 +1474,11 @@ fasttrap_pid_probe(struct reg *rp) break; } new_pc = value32; -#endif } -#ifdef __amd64 +#endif } else { new_pc = addr; } -#endif } /* @@ -1502,11 +1497,9 @@ fasttrap_pid_probe(struct reg *rp) ret = fasttrap_sulword((void *)addr, pcps); } else { #endif -#ifdef __i386__ addr = rp->r_rsp - sizeof (uint32_t); pcps = (uint32_t)(pc + tp->ftt_size); ret = fasttrap_suword32((void *)addr, pcps); -#endif #ifdef __amd64 } #endif From owner-svn-src-stable-10@FreeBSD.ORG Mon May 5 14:50:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B426453F; Mon, 5 May 2014 14:50: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 A091415A4; Mon, 5 May 2014 14:50: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 s45EorZH037443; Mon, 5 May 2014 14:50:53 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45EorXF037442; Mon, 5 May 2014 14:50:53 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405051450.s45EorXF037442@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 5 May 2014 14:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265361 - stable/10/lib/libc/locale X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 14:50:53 -0000 Author: pfg Date: Mon May 5 14:50:53 2014 New Revision: 265361 URL: http://svnweb.freebsd.org/changeset/base/265361 Log: MFC r265095, r265167; citrus: Avoid invalid code points. The UTF-8 decoder should not accept byte sequences which decode to unicode code positions U+D800 to U+DFFF (UTF-16 surrogates).[1] Contrary to the original OpenBSD patch, we do pass U+FFFE and U+FFFF, both values are valid "non-characters" [2] and must be mapped through UTFs. [1] http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 [2] http://www.unicode.org/faq/private_use.html Reported by: Stefan Sperling [1] Thanks to: jilles [2] Obtained from: OpenBSD Modified: stable/10/lib/libc/locale/utf8.c Modified: stable/10/lib/libc/locale/utf8.c ============================================================================== --- stable/10/lib/libc/locale/utf8.c Mon May 5 14:50:44 2014 (r265360) +++ stable/10/lib/libc/locale/utf8.c Mon May 5 14:50:53 2014 (r265361) @@ -203,6 +203,13 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, errno = EILSEQ; return ((size_t)-1); } + if (wch >= 0xd800 && wch <= 0xdfff) { + /* + * Malformed input; invalid code points. + */ + errno = EILSEQ; + return ((size_t)-1); + } if (pwc != NULL) *pwc = wch; us->want = 0; From owner-svn-src-stable-10@FreeBSD.ORG Mon May 5 16:52:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EAAA1514; Mon, 5 May 2014 16:52: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 D75ED38E; Mon, 5 May 2014 16:52: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 s45Gqc12091675; Mon, 5 May 2014 16:52:38 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45Gqcdl091674; Mon, 5 May 2014 16:52:38 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201405051652.s45Gqcdl091674@svn.freebsd.org> From: Guy Helmer Date: Mon, 5 May 2014 16:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265368 - stable/10/libexec/atrun X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 16:52:39 -0000 Author: ghelmer Date: Mon May 5 16:52:38 2014 New Revision: 265368 URL: http://svnweb.freebsd.org/changeset/base/265368 Log: MFC r264617: Fix releasing the lock in the parent atrun process after the queue directory has been processed. Otherwise, a long-running child process caused other atrun invocations to stall unnecessarily. Submitted by: J.R. Oldroyd jr at opal.com Modified: stable/10/libexec/atrun/atrun.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/atrun/atrun.c ============================================================================== --- stable/10/libexec/atrun/atrun.c Mon May 5 16:41:15 2014 (r265367) +++ stable/10/libexec/atrun/atrun.c Mon May 5 16:52:38 2014 (r265368) @@ -567,6 +567,12 @@ main(int argc, char *argv[]) if (run_batch && (gloadavg() < load_avg)) run_file(batch_name, batch_uid, batch_gid); + if (flock(dirfd(spool), LOCK_UN) == -1) + perr("cannot unlock %s", ATJOB_DIR); + + if (closedir(spool) == -1) + perr("cannot closedir %s", ATJOB_DIR); + closelog(); exit(EXIT_SUCCESS); } From owner-svn-src-stable-10@FreeBSD.ORG Mon May 5 20:35:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1FE783DD; Mon, 5 May 2014 20:35: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 0116A375; Mon, 5 May 2014 20:35: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 s45KZbca062790; Mon, 5 May 2014 20:35:37 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45KZZaZ062773; Mon, 5 May 2014 20:35:35 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405052035.s45KZZaZ062773@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 5 May 2014 20:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265388 - in stable/10: share/man/man4 sys/amd64/conf sys/conf sys/dev/mpr sys/i386/conf sys/ia64/conf sys/mips/conf sys/modules sys/modules/mpr sys/sparc64/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 20:35:38 -0000 Author: ken Date: Mon May 5 20:35:35 2014 New Revision: 265388 URL: http://svnweb.freebsd.org/changeset/base/265388 Log: MFC the mpr(4) driver for LSI's 12Gb SAS cards. This includes r265236, r265237, r265241 and r265261: ------------------------------------------------------------------------ r265236 | ken | 2014-05-02 14:25:09 -0600 (Fri, 02 May 2014) | 51 lines Bring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers. This is derived from the mps(4) driver, but it supports only the 12Gb IT and IR hardware including the SAS 3004, SAS 3008 and SAS 3108. Some notes about this driver: o The 12Gb hardware can do "FastPath" I/O, and that capability is included in this driver. o WarpDrive functionality has been removed, since it isn't supported in the 12Gb driver interface. o The Scatter/Gather list handling code is significantly different between the 6Gb and 12Gb hardware. The 12Gb boards support IEEE Scatter/Gather lists. Thanks to LSI for developing and testing this driver for FreeBSD. share/man/man4/mpr.4: mpr(4) man page. sys/dev/mpr/*: mpr(4) driver files. sys/modules/Makefile, sys/modules/mpr/Makefile: Add a module Makefile for the mpr(4) driver. sys/conf/files: Add the mpr(4) driver. sys/amd64/conf/GENERIC, sys/i386/conf/GENERIC, sys/mips/conf/OCTEON1, sys/sparc64/conf/GENERIC: Add the mpr(4) driver to all config files that currently have the mps(4) driver. sys/ia64/conf/GENERIC: Add the mps(4) and mpr(4) drivers to the ia64 GENERIC config file. sys/i386/conf/XEN: Exclude the mpr module from building here. Submitted by: Steve McConnell Tested by: Chris Reeves Sponsored by: LSI, Spectra Logic Relnotes: LSI 12Gb SAS driver mpr(4) added ------------------------------------------------------------------------ ------------------------------------------------------------------------ r265237 | ken | 2014-05-02 14:36:20 -0600 (Fri, 02 May 2014) | 8 lines Add the mpr(4) man page to the man4 Makefile. This should have been included in r265236. Submitted by: Steve McConnell MFC after: 3 days Sponsored by: LSI, Spectra Logic ------------------------------------------------------------------------ ------------------------------------------------------------------------ r265241 | brueffer | 2014-05-02 15:14:28 -0600 (Fri, 02 May 2014) | 2 lines Use our standard SYNOPSIS wording; perform some cleanup while here. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r265261 | brueffer | 2014-05-03 05:15:28 -0600 (Sat, 03 May 2014) | 2 lines Add a missing colon. ------------------------------------------------------------------------ Submitted by: Steve McConnell Tested by: Chris Reeves Sponsored by: LSI, Spectra Logic Relnotes: LSI 12Gb SAS driver mpr(4) added Added: stable/10/share/man/man4/mpr.4 - copied, changed from r265236, head/share/man/man4/mpr.4 stable/10/sys/dev/mpr/ - copied from r265236, head/sys/dev/mpr/ stable/10/sys/modules/mpr/ - copied from r265236, head/sys/modules/mpr/ Modified: stable/10/share/man/man4/Makefile stable/10/sys/amd64/conf/GENERIC stable/10/sys/conf/files stable/10/sys/i386/conf/GENERIC stable/10/sys/i386/conf/XEN stable/10/sys/ia64/conf/GENERIC stable/10/sys/mips/conf/OCTEON1 stable/10/sys/modules/Makefile stable/10/sys/sparc64/conf/GENERIC Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Mon May 5 20:13:25 2014 (r265387) +++ stable/10/share/man/man4/Makefile Mon May 5 20:35:35 2014 (r265388) @@ -259,6 +259,7 @@ MAN= aac.4 \ mod_cc.4 \ mos.4 \ mouse.4 \ + mpr.4 \ mps.4 \ mpt.4 \ msk.4 \ Copied and modified: stable/10/share/man/man4/mpr.4 (from r265236, head/share/man/man4/mpr.4) ============================================================================== --- head/share/man/man4/mpr.4 Fri May 2 20:25:09 2014 (r265236, copy source) +++ stable/10/share/man/man4/mpr.4 Mon May 5 20:35:35 2014 (r265388) @@ -36,7 +36,7 @@ .\" $Id$ .\" $FreeBSD$ .\" -.Dd Apr 28, 2014 +.Dd May 2, 2014 .Dt MPR 4 .Os .Sh NAME @@ -51,7 +51,8 @@ kernel configuration file: .Cd "device mpr" .Ed .Pp -Or, to load the driver as a module at boot, place the following line in +Alternatively, to load the driver as a +module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent mpr_load="YES" @@ -65,7 +66,7 @@ controllers. .Sh HARDWARE The following controllers are supported by the .Nm -driver +driver: .Pp .Bl -bullet -compact .It @@ -156,7 +157,8 @@ control for all adapters by setting the hw.mpr.exclude_ids=Y .Ed .Pp -where Y is the target ID of the device. If more than one device is to be +where Y is the target ID of the device. +If more than one device is to be excluded, target ID's are separated by commas. .Pp Devices can be excluded from @@ -167,7 +169,8 @@ control for a specific adapter by settin dev.mpr.X.exclude_ids=Y .Ed .Pp -where X is the adapter number and Y is the target ID of the device. If more +where X is the adapter number and Y is the target ID of the device. +If more than one device is to be excluded, target ID's are separated by commas. .Sh DEBUGGING To enable debugging prints from the @@ -200,8 +203,8 @@ The following bits have the described ef .Xr cd 4 , .Xr ch 4 , .Xr da 4 , -.Xr mpt 4 , .Xr mps 4 , +.Xr mpt 4 , .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , Modified: stable/10/sys/amd64/conf/GENERIC ============================================================================== --- stable/10/sys/amd64/conf/GENERIC Mon May 5 20:13:25 2014 (r265387) +++ stable/10/sys/amd64/conf/GENERIC Mon May 5 20:35:35 2014 (r265388) @@ -111,6 +111,7 @@ device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 +device mpr # LSI-Logic MPT-Fusion 3 #device ncr # NCR/Symbios Logic device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') device trm # Tekram DC395U/UW/F DC315U adapters Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon May 5 20:13:25 2014 (r265387) +++ stable/10/sys/conf/files Mon May 5 20:35:35 2014 (r265388) @@ -1841,6 +1841,17 @@ dev/mmc/mmcbr_if.m standard dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd dev/mn/if_mn.c optional mn pci +dev/mpr/mpr.c optional mpr +dev/mpr/mpr_config.c optional mpr +# XXX Work around clang warning, until maintainer approves fix. +dev/mpr/mpr_mapping.c optional mpr \ + compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" +dev/mpr/mpr_pci.c optional mpr pci +dev/mpr/mpr_sas.c optional mpr \ + compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}" +dev/mpr/mpr_sas_lsi.c optional mpr +dev/mpr/mpr_table.c optional mpr +dev/mpr/mpr_user.c optional mpr dev/mps/mps.c optional mps dev/mps/mps_config.c optional mps # XXX Work around clang warning, until maintainer approves fix. Modified: stable/10/sys/i386/conf/GENERIC ============================================================================== --- stable/10/sys/i386/conf/GENERIC Mon May 5 20:13:25 2014 (r265387) +++ stable/10/sys/i386/conf/GENERIC Mon May 5 20:35:35 2014 (r265388) @@ -113,6 +113,7 @@ device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 +device mpr # LSI-Logic MPT-Fusion 3 #device ncr # NCR/Symbios Logic device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') device trm # Tekram DC395U/UW/F DC315U adapters Modified: stable/10/sys/i386/conf/XEN ============================================================================== --- stable/10/sys/i386/conf/XEN Mon May 5 20:13:25 2014 (r265387) +++ stable/10/sys/i386/conf/XEN Mon May 5 20:35:35 2014 (r265388) @@ -7,7 +7,7 @@ cpu I686_CPU ident XEN makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols -makeoptions WITHOUT_MODULES="aha ahb amd ctl cxgb dpt drm drm2 hptnr hptmv ida malo mps mwl nve rdma sound sym trm xfs" +makeoptions WITHOUT_MODULES="aha ahb amd ctl cxgb dpt drm drm2 hptnr hptmv ida malo mpr mps mwl nve rdma sound sym trm xfs" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: stable/10/sys/ia64/conf/GENERIC ============================================================================== --- stable/10/sys/ia64/conf/GENERIC Mon May 5 20:13:25 2014 (r265387) +++ stable/10/sys/ia64/conf/GENERIC Mon May 5 20:35:35 2014 (r265388) @@ -86,6 +86,8 @@ device ahd # AHA39320/29320 and AIC79x device hptiop # Highpoint RocketRaid 3xxx series device isp # Qlogic family device mpt # LSI-Logic MPT-Fusion +device mps # LSI-Logic MPT-Fusion 2 +device mpr # LSI-Logic MPT-Fusion 3 device sym # NCR/Symbios Logic # RAID controllers interfaced to the SCSI subsystem Modified: stable/10/sys/mips/conf/OCTEON1 ============================================================================== --- stable/10/sys/mips/conf/OCTEON1 Mon May 5 20:13:25 2014 (r265387) +++ stable/10/sys/mips/conf/OCTEON1 Mon May 5 20:35:35 2014 (r265388) @@ -129,6 +129,7 @@ device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 +device mpr # LSI-Logic MPT-Fusion 3 #device ncr # NCR/Symbios Logic device trm # Tekram DC395U/UW/F DC315U adapters Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Mon May 5 20:13:25 2014 (r265387) +++ stable/10/sys/modules/Makefile Mon May 5 20:35:35 2014 (r265388) @@ -216,6 +216,7 @@ SUBDIR= \ ${_mly} \ mmc \ mmcsd \ + mpr \ mps \ mpt \ mqueue \ Modified: stable/10/sys/sparc64/conf/GENERIC ============================================================================== --- stable/10/sys/sparc64/conf/GENERIC Mon May 5 20:13:25 2014 (r265387) +++ stable/10/sys/sparc64/conf/GENERIC Mon May 5 20:35:35 2014 (r265388) @@ -101,6 +101,7 @@ device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 +device mpr # LSI-Logic MPT-Fusion 3 device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D # ATA/SCSI peripherals From owner-svn-src-stable-10@FreeBSD.ORG Mon May 5 21:34:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 166B6F3A; Mon, 5 May 2014 21:34: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 0108A935; Mon, 5 May 2014 21:34: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 s45LYA9v082177; Mon, 5 May 2014 21:34:10 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45LYAVR082176; Mon, 5 May 2014 21:34:10 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405052134.s45LYAVR082176@svn.freebsd.org> From: Christian Brueffer Date: Mon, 5 May 2014 21:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265394 - stable/10/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:34:11 -0000 Author: brueffer Date: Mon May 5 21:34:10 2014 New Revision: 265394 URL: http://svnweb.freebsd.org/changeset/base/265394 Log: MFC: r265242 Generate hardware notes for mpr(4) and bump copyright for 2014. Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Mon May 5 21:33:20 2014 (r265393) +++ stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Mon May 5 21:34:10 2014 (r265394) @@ -29,6 +29,7 @@ 2011 2012 2013 + 2014 The &os; Documentation Project @@ -732,6 +733,8 @@ &hwlist.mly; + &hwlist.mpr; + &hwlist.mps; &hwlist.mpt; From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 02:22:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 07904BD7; Tue, 6 May 2014 02:22: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 E7FE2B8; Tue, 6 May 2014 02:22: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 s462MrR2011566; Tue, 6 May 2014 02:22:53 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s462Mr4q011562; Tue, 6 May 2014 02:22:53 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201405060222.s462Mr4q011562@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 6 May 2014 02:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265410 - in stable/10/sys/dev/cxgbe: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 02:22:54 -0000 Author: np Date: Tue May 6 02:22:52 2014 New Revision: 265410 URL: http://svnweb.freebsd.org/changeset/base/265410 Log: MFC r261533, r261536, r261537, and r263457. r261533: cxgbe(4): Use the port's tx channel to identify it to t4_clr_port_stats. r261536: cxgbe(4): The T5 allows for a different freelist starvation threshold for queues with buffer packing. Use the correct value to calculate a freelist's low water mark. r261537: cxgbe(4): Use the rx channel map (instead of the tx channel map) as the congestion channel map. r263457: cxgbe(4): Recognize the "spider" configuration where a T5 card's 40G QSFP port is presented as 4 distinct 10G SFP+ ports to the driver. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/common/t4_hw.c stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Tue May 6 01:15:42 2014 (r265409) +++ stable/10/sys/dev/cxgbe/adapter.h Tue May 6 02:22:52 2014 (r265410) @@ -204,6 +204,7 @@ struct port_info { uint8_t mod_type; uint8_t port_id; uint8_t tx_chan; + uint8_t rx_chan_map; /* rx MPS channel bitmap */ /* These need to be int as they are used in sysctl */ int ntxq; /* # of tx queues */ @@ -512,6 +513,7 @@ struct sge { int timer_val[SGE_NTIMERS]; int counter_val[SGE_NCOUNTERS]; int fl_starve_threshold; + int fl_starve_threshold2; int eq_s_qpp; int iq_s_qpp; Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/10/sys/dev/cxgbe/common/t4_hw.c Tue May 6 01:15:42 2014 (r265409) +++ stable/10/sys/dev/cxgbe/common/t4_hw.c Tue May 6 02:22:52 2014 (r265410) @@ -5647,6 +5647,7 @@ int __devinit t4_port_init(struct port_i p->viid = ret; p->tx_chan = j; + p->rx_chan_map = get_mps_bg_map(adap, j); p->lport = j; p->rss_size = rss_size; t4_os_set_hw_addr(adap, p->port_id, addr); Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Tue May 6 01:15:42 2014 (r265409) +++ stable/10/sys/dev/cxgbe/t4_main.c Tue May 6 02:22:52 2014 (r265410) @@ -2622,6 +2622,7 @@ build_medialist(struct port_info *pi) ifmedia_set(media, m | IFM_10G_CX4); break; + case FW_PORT_TYPE_QSFP_10G: case FW_PORT_TYPE_SFP: case FW_PORT_TYPE_FIBER_XFI: case FW_PORT_TYPE_FIBER_XAUI: @@ -7754,11 +7755,11 @@ t4_ioctl(struct cdev *dev, unsigned long if (port_id >= sc->params.nports) return (EINVAL); + pi = sc->port[port_id]; /* MAC stats */ - t4_clr_port_stats(sc, port_id); + t4_clr_port_stats(sc, pi->tx_chan); - pi = sc->port[port_id]; if (pi->flags & PORT_INIT_DONE) { struct sge_rxq *rxq; struct sge_txq *txq; Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Tue May 6 01:15:42 2014 (r265409) +++ stable/10/sys/dev/cxgbe/t4_sge.c Tue May 6 02:22:52 2014 (r265410) @@ -568,6 +568,10 @@ t4_read_chip_settings(struct adapter *sc r = t4_read_reg(sc, A_SGE_CONM_CTRL); s->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1; + if (is_t4(sc)) + s->fl_starve_threshold2 = s->fl_starve_threshold; + else + s->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(r) * 2 + 1; /* egress queues: log2 of # of doorbells per BAR2 page */ r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF); @@ -2232,7 +2236,9 @@ alloc_iq_fl(struct port_info *pi, struct return (rc); } fl->needed = fl->cap; - fl->lowat = roundup2(sc->sge.fl_starve_threshold, 8); + fl->lowat = fl->flags & FL_BUF_PACKING ? + roundup2(sc->sge.fl_starve_threshold2, 8) : + roundup2(sc->sge.fl_starve_threshold, 8); c.iqns_to_fl0congen |= htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) | @@ -2467,7 +2473,7 @@ tnl_cong(struct port_info *pi) else if (cong_drop == 1) return (0); else - return (1 << pi->tx_chan); + return (pi->rx_chan_map); } static int @@ -2574,7 +2580,7 @@ alloc_ofld_rxq(struct port_info *pi, str char name[16]; rc = alloc_iq_fl(pi, &ofld_rxq->iq, &ofld_rxq->fl, intr_idx, - 1 << pi->tx_chan); + pi->rx_chan_map); if (rc != 0) return (rc); From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 02:44:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6702B173; Tue, 6 May 2014 02:44: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 39BDA27F; Tue, 6 May 2014 02:44: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 s462i2EM020599; Tue, 6 May 2014 02:44:02 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s462i2fg020598; Tue, 6 May 2014 02:44:02 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405060244.s462i2fg020598@svn.freebsd.org> From: Rick Macklem Date: Tue, 6 May 2014 02:44:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265412 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 02:44:02 -0000 Author: rmacklem Date: Tue May 6 02:44:01 2014 New Revision: 265412 URL: http://svnweb.freebsd.org/changeset/base/265412 Log: MFC: r264469, r264498 Lagg did not set the value of if_hw_tsomax, so when lagg was stacked on top of network interfaces that set if_hw_tsomax, tcp_output() would see the default value instead of the value set by the network interface(s). This patch modifies lagg so that it sets if_hw_tsomax to the minimum of the value(s) for the underlying network interfaces. Modified: stable/10/sys/net/if_lagg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_lagg.c ============================================================================== --- stable/10/sys/net/if_lagg.c Tue May 6 02:32:27 2014 (r265411) +++ stable/10/sys/net/if_lagg.c Tue May 6 02:44:01 2014 (r265412) @@ -54,11 +54,11 @@ __FBSDID("$FreeBSD$"); #if defined(INET) || defined(INET6) #include +#include #endif #ifdef INET #include #include -#include #endif #ifdef INET6 @@ -448,6 +448,11 @@ lagg_capabilities(struct lagg_softc *sc) struct lagg_port *lp; int cap = ~0, ena = ~0; u_long hwa = ~0UL; +#if defined(INET) || defined(INET6) + u_int hw_tsomax = IP_MAXPACKET; /* Initialize to the maximum value. */ +#else + u_int hw_tsomax = ~0; /* if_hw_tsomax is only for INET/INET6, but.. */ +#endif LAGG_WLOCK_ASSERT(sc); @@ -456,6 +461,10 @@ lagg_capabilities(struct lagg_softc *sc) cap &= lp->lp_ifp->if_capabilities; ena &= lp->lp_ifp->if_capenable; hwa &= lp->lp_ifp->if_hwassist; + /* Set to the minimum value of the lagg ports. */ + if (lp->lp_ifp->if_hw_tsomax < hw_tsomax && + lp->lp_ifp->if_hw_tsomax > 0) + hw_tsomax = lp->lp_ifp->if_hw_tsomax; } cap = (cap == ~0 ? 0 : cap); ena = (ena == ~0 ? 0 : ena); @@ -463,10 +472,12 @@ lagg_capabilities(struct lagg_softc *sc) if (sc->sc_ifp->if_capabilities != cap || sc->sc_ifp->if_capenable != ena || - sc->sc_ifp->if_hwassist != hwa) { + sc->sc_ifp->if_hwassist != hwa || + sc->sc_ifp->if_hw_tsomax != hw_tsomax) { sc->sc_ifp->if_capabilities = cap; sc->sc_ifp->if_capenable = ena; sc->sc_ifp->if_hwassist = hwa; + sc->sc_ifp->if_hw_tsomax = hw_tsomax; getmicrotime(&sc->sc_ifp->if_lastchange); if (sc->sc_ifflags & IFF_DEBUG) From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 02:49:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D55FB2FC; Tue, 6 May 2014 02:49: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 C1EC32B2; Tue, 6 May 2014 02:49:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s462nVdQ021419; Tue, 6 May 2014 02:49:31 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s462nVXu021418; Tue, 6 May 2014 02:49:31 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405060249.s462nVXu021418@svn.freebsd.org> From: Rick Macklem Date: Tue, 6 May 2014 02:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265413 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 02:49:31 -0000 Author: rmacklem Date: Tue May 6 02:49:31 2014 New Revision: 265413 URL: http://svnweb.freebsd.org/changeset/base/265413 Log: MFC: r264517 Vlan did not set the value of if_hw_tsomax, so when vlan was stacked on top of a network interface that set if_hw_tsomax, tcp_output() would see the default value instead of the value set by the network interface. This patch modifies vlan so that it sets if_hw_tsomax to the value of the parent interface. Modified: stable/10/sys/net/if_vlan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_vlan.c ============================================================================== --- stable/10/sys/net/if_vlan.c Tue May 6 02:44:01 2014 (r265412) +++ stable/10/sys/net/if_vlan.c Tue May 6 02:49:31 2014 (r265413) @@ -1509,6 +1509,8 @@ vlan_capabilities(struct ifvlan *ifv) * propagate the hardware-assisted flag. TSO on VLANs * does not necessarily require hardware VLAN tagging. */ + if (p->if_hw_tsomax > 0) + ifp->if_hw_tsomax = p->if_hw_tsomax; if (p->if_capabilities & IFCAP_VLAN_HWTSO) ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO; if (p->if_capenable & IFCAP_VLAN_HWTSO) { From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 02:55:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EFF594C7; Tue, 6 May 2014 02:54: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 C2447368; Tue, 6 May 2014 02:54: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 s462sxgg025148; Tue, 6 May 2014 02:54:59 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s462sxND025147; Tue, 6 May 2014 02:54:59 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405060254.s462sxND025147@svn.freebsd.org> From: Rick Macklem Date: Tue, 6 May 2014 02:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265414 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 02:55:00 -0000 Author: rmacklem Date: Tue May 6 02:54:59 2014 New Revision: 265414 URL: http://svnweb.freebsd.org/changeset/base/265414 Log: MFC: r264630 For NFS mounts using rsize,wsize=65536 over TSO enabled network interfaces limited to 32 transmit segments, there are two known issues. The more serious one is that for an I/O of slightly less than 64K, the net device driver prepends an ethernet header, resulting in a TSO segment slightly larger than 64K. Since m_defrag() copies this into 33 mbuf clusters, the transmit fails with EFBIG. A tester indicated observing a similar failure using iSCSI. The second less critical problem is that the network device driver must copy the mbuf chain via m_defrag() (m_collapse() is not sufficient), resulting in measurable overhead. This patch reduces the default size of if_hw_tsomax slightly, so that the first issue is avoided. Fixing the second issue will require a way for the network device driver to inform tcp_output() that it is limited to 32 transmit segments. Modified: stable/10/sys/net/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Tue May 6 02:49:31 2014 (r265413) +++ stable/10/sys/net/if.c Tue May 6 02:54:59 2014 (r265414) @@ -74,6 +74,7 @@ #include #if defined(INET) || defined(INET6) +#include #include #include #include @@ -658,7 +659,8 @@ if_attach_internal(struct ifnet *ifp, in #if defined(INET) || defined(INET6) /* Initialize to max value. */ if (ifp->if_hw_tsomax == 0) - ifp->if_hw_tsomax = IP_MAXPACKET; + ifp->if_hw_tsomax = min(IP_MAXPACKET, 32 * MCLBYTES - + (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); KASSERT(ifp->if_hw_tsomax <= IP_MAXPACKET && ifp->if_hw_tsomax >= IP_MAXPACKET / 8, ("%s: tsomax outside of range", __func__)); From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 03:02:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9DA2B7A7; Tue, 6 May 2014 03:02: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 8A5C36A1; Tue, 6 May 2014 03:02: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 s4632223029961; Tue, 6 May 2014 03:02:02 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46322el029960; Tue, 6 May 2014 03:02:02 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201405060302.s46322el029960@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 6 May 2014 03:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265415 - stable/10/tools/tools/cxgbetool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 03:02:02 -0000 Author: np Date: Tue May 6 03:02:02 2014 New Revision: 265415 URL: http://svnweb.freebsd.org/changeset/base/265415 Log: MFC r261534: cxgbetool: Display the congestion channel map in hex. Modified: stable/10/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- stable/10/tools/tools/cxgbetool/cxgbetool.c Tue May 6 02:54:59 2014 (r265414) +++ stable/10/tools/tools/cxgbetool/cxgbetool.c Tue May 6 03:02:02 2014 (r265415) @@ -1368,7 +1368,7 @@ show_sge_context(const struct t4_sge_con FIELD1("CngDBPHdr:", 6), FIELD1("CngDBPData:", 5), FIELD1("CngIMSG:", 4), - FIELD("CngChMap:", 0, 3), + { "CngChMap:", 0, 3, 0, 1, 0}, { NULL } }; static struct field_desc t5_conm[] = { @@ -1377,7 +1377,7 @@ show_sge_context(const struct t4_sge_con FIELD1("CngDBPHdr:", 18), FIELD1("CngDBPData:", 17), FIELD1("CngIMSG:", 16), - FIELD("CngChMap:", 0, 15), + { "CngChMap:", 0, 15, 0, 1, 0}, { NULL } }; From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 03:05:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2B5AA935; Tue, 6 May 2014 03:05: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 180706D6; Tue, 6 May 2014 03:05: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 s4635Ep7030604; Tue, 6 May 2014 03:05:14 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4635EH4030603; Tue, 6 May 2014 03:05:14 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201405060305.s4635EH4030603@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 6 May 2014 03:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265416 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 03:05:15 -0000 Author: np Date: Tue May 6 03:05:14 2014 New Revision: 265416 URL: http://svnweb.freebsd.org/changeset/base/265416 Log: MFC r261804: Provide additional information in some panic strings. Modified: stable/10/sys/sys/mbuf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/mbuf.h ============================================================================== --- stable/10/sys/sys/mbuf.h Tue May 6 03:02:02 2014 (r265415) +++ stable/10/sys/sys/mbuf.h Tue May 6 03:05:14 2014 (r265416) @@ -539,7 +539,7 @@ m_gettype(int size) type = EXT_JUMBO16; break; default: - panic("%s: invalid cluster size", __func__); + panic("%s: invalid cluster size %d", __func__, size); } return (type); @@ -588,7 +588,7 @@ m_getzone(int size) zone = zone_jumbo16; break; default: - panic("%s: invalid cluster size", __func__); + panic("%s: invalid cluster size %d", __func__, size); } return (zone); @@ -733,7 +733,7 @@ m_cljset(struct mbuf *m, void *cl, int t zone = zone_jumbo16; break; default: - panic("%s: unknown cluster type", __func__); + panic("%s: unknown cluster type %d", __func__, type); break; } From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 03:38:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 75D89F29; Tue, 6 May 2014 03:38: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 626259C8; Tue, 6 May 2014 03:38: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 s463c5eP043872; Tue, 6 May 2014 03:38:05 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s463c5bT043871; Tue, 6 May 2014 03:38:05 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201405060338.s463c5bT043871@svn.freebsd.org> From: Bryan Venteicher Date: Tue, 6 May 2014 03:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265417 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 03:38:05 -0000 Author: bryanv Date: Tue May 6 03:38:04 2014 New Revision: 265417 URL: http://svnweb.freebsd.org/changeset/base/265417 Log: MFC r265287: Fix SYNOPSIS ("device if_vtnet" -> "device vtnet"). Modified: stable/10/share/man/man4/vtnet.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/vtnet.4 ============================================================================== --- stable/10/share/man/man4/vtnet.4 Tue May 6 03:05:14 2014 (r265416) +++ stable/10/share/man/man4/vtnet.4 Tue May 6 03:38:04 2014 (r265417) @@ -35,7 +35,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device if_vtnet" +.Cd "device vtnet" .Ed .Pp Alternatively, to load the driver as a From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 04:22:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4C837C23; Tue, 6 May 2014 04:22:07 +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 1FA8ED4F; Tue, 6 May 2014 04:22:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s464M6f6065889; Tue, 6 May 2014 04:22:06 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s464M6CG065883; Tue, 6 May 2014 04:22:06 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201405060422.s464M6CG065883@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 6 May 2014 04:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265421 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 04:22:07 -0000 Author: np Date: Tue May 6 04:22:06 2014 New Revision: 265421 URL: http://svnweb.freebsd.org/changeset/base/265421 Log: MFC r260210 (by adrian@): Add an option to enable or disable the small RX packet copying that is done to improve performance of small frames. When doing RX packing, the RX copying isn't necessarily required. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Tue May 6 04:22:01 2014 (r265420) +++ stable/10/sys/dev/cxgbe/adapter.h Tue May 6 04:22:06 2014 (r265421) @@ -643,6 +643,8 @@ struct adapter { const char *last_op; const void *last_op_thr; #endif + + int sc_do_rxcopy; }; #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Tue May 6 04:22:01 2014 (r265420) +++ stable/10/sys/dev/cxgbe/t4_main.c Tue May 6 04:22:06 2014 (r265421) @@ -4207,6 +4207,10 @@ t4_sysctls(struct adapter *sc) oid = device_get_sysctl_tree(sc->dev); c0 = children = SYSCTL_CHILDREN(oid); + sc->sc_do_rxcopy = 1; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "do_rx_copy", CTLFLAG_RW, + &sc->sc_do_rxcopy, 1, "Do RX copy of small frames"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nports", CTLFLAG_RD, NULL, sc->params.nports, "# of ports"); Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Tue May 6 04:22:01 2014 (r265420) +++ stable/10/sys/dev/cxgbe/t4_sge.c Tue May 6 04:22:06 2014 (r265421) @@ -1450,7 +1450,7 @@ get_fl_payload1(struct adapter *sc, stru bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, BUS_DMASYNC_POSTREAD); - if (len < RX_COPY_THRESHOLD) { + if (sc->sc_do_rxcopy && (len < RX_COPY_THRESHOLD)) { #ifdef T4_PKT_TIMESTAMP /* Leave room for a timestamp */ m0->m_data += 8; @@ -1601,7 +1601,7 @@ get_fl_payload2(struct adapter *sc, stru bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, BUS_DMASYNC_POSTREAD); - if (len < RX_COPY_THRESHOLD) { + if (sc->sc_do_rxcopy && (len < RX_COPY_THRESHOLD)) { #ifdef T4_PKT_TIMESTAMP /* Leave room for a timestamp */ m0->m_data += 8; From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 06:49:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 76AB4E98; Tue, 6 May 2014 06: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 6156AADD; Tue, 6 May 2014 06: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 s466neYa029677; Tue, 6 May 2014 06:49:40 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s466nd0F029672; Tue, 6 May 2014 06:49:39 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201405060649.s466nd0F029672@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 6 May 2014 06:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265425 - in stable/10: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 06:49:40 -0000 Author: np Date: Tue May 6 06:49:39 2014 New Revision: 265425 URL: http://svnweb.freebsd.org/changeset/base/265425 Log: MFC r263317, r263412, and r263451. r263317: cxgbe(4): significant rx rework. - More flexible cluster size selection, including the ability to fall back to a safe cluster size (PAGE_SIZE from zone_jumbop by default) in case an allocation of a larger size fails. - A single get_fl_payload() function that assembles the payload into an mbuf chain for any kind of freelist. This replaces two variants: one for freelists with buffer packing enabled and another for those without. - Buffer packing with any sized cluster. It was limited to 4K clusters only before this change. - Enable buffer packing for TOE rx queues as well. - Statistics and tunables to go with all these changes. The driver's man page will be updated separately. r263412: cxgbe(4): if_iqdrops statistic should include tunnel congestion drops. r263451: cxgbe(4): man page updates. Modified: stable/10/share/man/man4/cxgbe.4 stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/common/t4_hw.h stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/cxgbe.4 ============================================================================== --- stable/10/share/man/man4/cxgbe.4 Tue May 6 06:18:43 2014 (r265424) +++ stable/10/share/man/man4/cxgbe.4 Tue May 6 06:49:39 2014 (r265425) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2013, Chelsio Inc +.\" Copyright (c) 2011-2014, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2013 +.Dd March 20, 2014 .Dt CXGBE 4 .Os .Sh NAME @@ -141,11 +141,11 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width indent .It Va hw.cxgbe.ntxq10g -The number of tx queues to use for a 10Gb port. +The number of tx queues to use for a 10Gb or 40Gb port. The default is 16 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq10g -The number of rx queues to use for a 10Gb port. +The number of rx queues to use for a 10Gb or 40Gb port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.ntxq1g @@ -157,11 +157,11 @@ The number of rx queues to use for a 1Gb The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq10g -The number of TOE tx queues to use for a 10Gb port. +The number of TOE tx queues to use for a 10Gb or 40Gb port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldrxq10g -The number of TOE rx queues to use for a 10Gb port. +The number of TOE rx queues to use for a 10Gb or 40Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq1g @@ -177,8 +177,7 @@ The timer index value to use to delay in The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a value from this list. -The default value is 1 for both 10Gb and 1Gb ports, which means the -timer value is 5us. +The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G @@ -186,9 +185,8 @@ dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X The packet-count index value to use to delay interrupts. The packet-count list has the values 1, 8, 16, and 32 by default and the index selects a value from this list. -The default value is -1 for both 10Gb and 1Gb ports, which means packet -counting is disabled and interrupts are generated based solely on the -holdoff timer value. +The default value is -1 which means packet counting is disabled and interrupts +are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the dev.cxgbe.X.holdoff_pktc_idx or dev.cxl.X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by @@ -228,6 +226,43 @@ already on the card. long as it is compatible with the driver and is a different version than the one already on the card. The default is 1. +.It Va hw.cxgbe.fl_pktshift +The number of bytes of padding inserted before the begining of an Ethernet +frame in the receive buffer. +The default value of 2 ensures that the Ethernet payload (usually the IP header) +is at a 4 byte aligned address. +0-7 are all valid values. +.It Va hw.cxgbe.fl_pad +A non-zero value ensures that writes from the hardware to a receive buffer are +padded up to the specified boundary. +The default is -1 which lets the driver pick a pad boundary. +0 disables trailer padding completely. +.It Va hw.cxgbe.cong_drop +Controls the hardware response to congestion. +-1 disables congestion feedback and is not recommended. +0 instructs the hardware to backpressure its pipeline on congestion. +This usually results in the port emitting pause frames. +1 instructs the hardware to drop frames destined for congested queues. +.It Va hw.cxgbe.buffer_packing +Allow the hardware to deliver multiple frames in the same receive buffer +opportunistically. +The default is -1 which lets the driver decide. +0 or 1 explicitly disable or enable this feature. +.It Va hw.cxgbe.allow_mbufs_in_cluster +1 allows the driver to lay down one or more mbufs within the receive buffer +opportunistically. This is the default. +0 prohibits the driver from doing so. +.It Va hw.cxgbe.largest_rx_cluster +.It Va hw.cxgbe.safest_rx_cluster +Sizes of rx clusters. Each of these must be set to one of the sizes available +(usually 2048, 4096, 9216, and 16384) and largest_rx_cluster must be greater +than or equal to safest_rx_cluster. +The defaults are 16384 and 4096 respectively. +The driver will never attempt to allocate a receive buffer larger than +largest_rx_cluster and will fall back to allocating buffers of +safest_rx_cluster size if an allocation larger than safest_rx_cluster fails. +Note that largest_rx_cluster merely establishes a ceiling -- the driver is +allowed to allocate buffers of smaller sizes. .It Va hw.cxgbe.config_file Select a pre-packaged device configuration file. A configuration file contains a recipe for partitioning and configuring the @@ -235,7 +270,7 @@ hardware resources on the card. This tunable is for specialized applications only and should not be used in normal operation. The configuration profile currently in use is available in the dev.t4nex.X.cf -and dev.t4nex.X.cfcsum sysctls. +and dev.t4nex.X.cfcsum (dev.t5nex for T5 cards) sysctls. .It Va hw.cxgbe.linkcaps_allowed .It Va hw.cxgbe.niccaps_allowed .It Va hw.cxgbe.toecaps_allowed @@ -249,7 +284,7 @@ capability. This tunable is for specialized applications only and should not be used in normal operation. The capabilities for which hardware resources have been reserved are listed in -dev.t4nex.X.*caps sysctls. +dev.t4nex.X.*caps or dev.t5nex.X.*caps sysctls. .El .Sh SUPPORT For general information and support, Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Tue May 6 06:18:43 2014 (r265424) +++ stable/10/sys/dev/cxgbe/adapter.h Tue May 6 06:49:39 2014 (r265425) @@ -128,10 +128,11 @@ enum { RX_FL_ESIZE = EQ_ESIZE, /* 8 64bit addresses */ #if MJUMPAGESIZE != MCLBYTES - FL_BUF_SIZES_MAX = 5, /* cluster, jumbop, jumbo9k, jumbo16k, extra */ + SW_ZONE_SIZES = 4, /* cluster, jumbop, jumbo9k, jumbo16k */ #else - FL_BUF_SIZES_MAX = 4, /* cluster, jumbo9k, jumbo16k, extra */ + SW_ZONE_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ #endif + CL_METADATA_SIZE = CACHE_LINE_SIZE, CTRL_EQ_QSIZE = 128, @@ -235,15 +236,28 @@ struct port_info { uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */ }; -struct fl_sdesc { - bus_dmamap_t map; - caddr_t cl; - uint8_t tag_idx; /* the fl->tag entry this map comes from */ +/* Where the cluster came from, how it has been carved up. */ +struct cluster_layout { + int8_t zidx; + int8_t hwidx; + uint16_t region1; /* mbufs laid out within this region */ + /* region2 is the DMA region */ + uint16_t region3; /* cluster_metadata within this region */ +}; + +struct cluster_metadata { + u_int refcount; #ifdef INVARIANTS - __be64 ba_hwtag; + struct fl_sdesc *sd; /* For debug only. Could easily be stale */ #endif }; +struct fl_sdesc { + caddr_t cl; + uint8_t nmbuf; + struct cluster_layout cll; +}; + struct tx_desc { __be64 flit[8]; }; @@ -362,17 +376,19 @@ struct sge_eq { uint32_t unstalled; /* recovered from stall */ }; -struct fl_buf_info { - u_int size; - int type; - int hwtag:4; /* tag in low 4 bits of the pa. */ - uma_zone_t zone; -}; -#define FL_BUF_SIZES(sc) (sc->sge.fl_buf_sizes) -#define FL_BUF_SIZE(sc, x) (sc->sge.fl_buf_info[x].size) -#define FL_BUF_TYPE(sc, x) (sc->sge.fl_buf_info[x].type) -#define FL_BUF_HWTAG(sc, x) (sc->sge.fl_buf_info[x].hwtag) -#define FL_BUF_ZONE(sc, x) (sc->sge.fl_buf_info[x].zone) +struct sw_zone_info { + uma_zone_t zone; /* zone that this cluster comes from */ + int size; /* size of cluster: 2K, 4K, 9K, 16K, etc. */ + int type; /* EXT_xxx type of the cluster */ + int8_t head_hwidx; + int8_t tail_hwidx; +}; + +struct hw_buf_info { + int8_t zidx; /* backpointer to zone; -ve means unused */ + int8_t next; /* next hwidx for this zone; -1 means no more */ + int size; +}; enum { FL_STARVING = (1 << 0), /* on the adapter's list of starving fl's */ @@ -386,9 +402,8 @@ enum { struct sge_fl { bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; - bus_dma_tag_t tag[FL_BUF_SIZES_MAX]; /* only first FL_BUF_SIZES(sc) are - valid */ - uint8_t tag_idx; + struct cluster_layout cll_def; /* default refill zone, layout */ + struct cluster_layout cll_alt; /* alternate refill zone, layout */ struct mtx fl_lock; char lockname[16]; int flags; @@ -405,9 +420,17 @@ struct sge_fl { uint32_t needed; /* # of buffers needed to fill up fl. */ uint32_t lowat; /* # of buffers <= this means fl needs help */ uint32_t pending; /* # of bufs allocated since last doorbell */ - u_int dmamap_failed; - struct mbuf *mstash[8]; TAILQ_ENTRY(sge_fl) link; /* All starving freelists */ + + struct mbuf *m0; + struct mbuf **pnext; + u_int remaining; + + uint64_t mbuf_allocated;/* # of mbuf allocated from zone_mbuf */ + uint64_t mbuf_inlined; /* # of mbuf created within clusters */ + uint64_t cl_allocated; /* # of clusters allocated */ + uint64_t cl_recycled; /* # of clusters recycled */ + uint64_t cl_fast_recycled; /* # of clusters recycled (fast) */ }; /* txq: SGE egress queue + what's needed for Ethernet NIC */ @@ -541,8 +564,11 @@ struct sge { struct sge_iq **iqmap; /* iq->cntxt_id to iq mapping */ struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ - u_int fl_buf_sizes __aligned(CACHE_LINE_SIZE); - struct fl_buf_info fl_buf_info[FL_BUF_SIZES_MAX]; + int pack_boundary; + int8_t safe_hwidx1; /* may not have room for metadata */ + int8_t safe_hwidx2; /* with room for metadata and maybe more */ + struct sw_zone_info sw_zone_info[SW_ZONE_SIZES]; + struct hw_buf_info hw_buf_info[SGE_FLBUF_SIZES]; }; struct rss_header; Modified: stable/10/sys/dev/cxgbe/common/t4_hw.h ============================================================================== --- stable/10/sys/dev/cxgbe/common/t4_hw.h Tue May 6 06:18:43 2014 (r265424) +++ stable/10/sys/dev/cxgbe/common/t4_hw.h Tue May 6 06:49:39 2014 (r265425) @@ -87,6 +87,7 @@ enum { SGE_NTIMERS = 6, /* # of interrupt holdoff timer values */ SGE_NCOUNTERS = 4, /* # of interrupt packet counter values */ SGE_MAX_IQ_SIZE = 65520, + SGE_FLBUF_SIZES = 16, }; struct sge_qstat { /* data written to SGE queue status entries */ Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Tue May 6 06:18:43 2014 (r265424) +++ stable/10/sys/dev/cxgbe/t4_main.c Tue May 6 06:49:39 2014 (r265425) @@ -494,6 +494,8 @@ CTASSERT(offsetof(struct sge_ofld_rxq, f CTASSERT(nitems(((struct adapter *)0)->cpl_handler) == NUM_CPL_CMDS); CTASSERT(nitems(((struct adapter *)0)->fw_msg_handler) == NUM_FW6_TYPES); +CTASSERT(sizeof(struct cluster_metadata) <= CL_METADATA_SIZE); + static int t4_probe(device_t dev) { @@ -4039,6 +4041,7 @@ static void cxgbe_tick(void *arg) { struct port_info *pi = arg; + struct adapter *sc = pi->adapter; struct ifnet *ifp = pi->ifp; struct sge_txq *txq; int i, drops; @@ -4050,7 +4053,7 @@ cxgbe_tick(void *arg) return; /* without scheduling another callout */ } - t4_get_port_stats(pi->adapter, pi->tx_chan, s); + t4_get_port_stats(sc, pi->tx_chan, s); ifp->if_opackets = s->tx_frames - s->tx_pause; ifp->if_ipackets = s->rx_frames - s->rx_pause; @@ -4061,6 +4064,19 @@ cxgbe_tick(void *arg) ifp->if_iqdrops = s->rx_ovflow0 + s->rx_ovflow1 + s->rx_ovflow2 + s->rx_ovflow3 + s->rx_trunc0 + s->rx_trunc1 + s->rx_trunc2 + s->rx_trunc3; + for (i = 0; i < 4; i++) { + if (pi->rx_chan_map & (1 << i)) { + uint32_t v; + + /* + * XXX: indirect reads from the same ADDR/DATA pair can + * race with each other. + */ + t4_read_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, &v, + 1, A_TP_MIB_TNL_CNG_DROP_0 + i); + ifp->if_iqdrops += v; + } + } drops = s->tx_drop; for_each_txq(pi, i, txq) Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Tue May 6 06:18:43 2014 (r265424) +++ stable/10/sys/dev/cxgbe/t4_sge.c Tue May 6 06:49:39 2014 (r265425) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -51,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "common/common.h" #include "common/t4_regs.h" @@ -123,6 +126,27 @@ static int t4_fl_pack; static int t5_fl_pack; TUNABLE_INT("hw.cxgbe.fl_pack", &fl_pack); +/* + * Allow the driver to create mbuf(s) in a cluster allocated for rx. + * 0: never; always allocate mbufs from the zone_mbuf UMA zone. + * 1: ok to create mbuf(s) within a cluster if there is room. + */ +static int allow_mbufs_in_cluster = 1; +TUNABLE_INT("hw.cxgbe.allow_mbufs_in_cluster", &allow_mbufs_in_cluster); + +/* + * Largest rx cluster size that the driver is allowed to allocate. + */ +static int largest_rx_cluster = MJUM16BYTES; +TUNABLE_INT("hw.cxgbe.largest_rx_cluster", &largest_rx_cluster); + +/* + * Size of cluster allocation that's most likely to succeed. The driver will + * fall back to this size if it fails to allocate clusters larger than this. + */ +static int safest_rx_cluster = PAGE_SIZE; +TUNABLE_INT("hw.cxgbe.safest_rx_cluster", &safest_rx_cluster); + /* Used to track coalesced tx work request */ struct txpkts { uint64_t *flitp; /* ptr to flit where next pkt should start */ @@ -139,9 +163,7 @@ struct sgl { }; static int service_iq(struct sge_iq *, int); -static struct mbuf *get_fl_payload1(struct adapter *, struct sge_fl *, uint32_t, - int *); -static struct mbuf *get_fl_payload2(struct adapter *, struct sge_fl *, uint32_t, +static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t, int *); static int t4_eth_rx(struct sge_iq *, const struct rss_header *, struct mbuf *); static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int, @@ -157,6 +179,8 @@ static int free_ring(struct adapter *, b static int alloc_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *, int, int); static int free_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *); +static void add_fl_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *, + struct sge_fl *); static int alloc_fwq(struct adapter *); static int free_fwq(struct adapter *); static int alloc_mgmtq(struct adapter *); @@ -190,7 +214,8 @@ static int refill_fl(struct adapter *, s static void refill_sfl(void *); static int alloc_fl_sdesc(struct sge_fl *); static void free_fl_sdesc(struct adapter *, struct sge_fl *); -static void set_fl_tag_idx(struct adapter *, struct sge_fl *, int); +static void find_best_refill_source(struct adapter *, struct sge_fl *, int); +static void find_safe_refill_source(struct adapter *, struct sge_fl *); static void add_fl_to_sfl(struct adapter *, struct sge_fl *); static int get_pkt_sgl(struct sge_txq *, struct mbuf **, struct sgl *, int); @@ -215,6 +240,7 @@ static int handle_fw_msg(struct sge_iq * struct mbuf *); static int sysctl_uint16(SYSCTL_HANDLER_ARGS); +static int sysctl_bufsizes(SYSCTL_HANDLER_ARGS); /* * Called on MOD_LOAD. Validates and calculates the SGE tunables. @@ -263,7 +289,7 @@ t4_sge_modload(void) /* T5's pack boundary is independent of the pad boundary. */ if (fl_pack < 16 || fl_pack == 32 || fl_pack > 4096 || !powerof2(fl_pack)) - t5_fl_pack = max(pad, 64); + t5_fl_pack = max(pad, CACHE_LINE_SIZE); else t5_fl_pack = fl_pack; @@ -312,14 +338,18 @@ t4_tweak_chip_settings(struct adapter *s int timer_max = M_TIMERVALUE0 * 1000 / sc->params.vpd.cclk; int intr_pktcount[SGE_NCOUNTERS] = {1, 8, 16, 32}; /* 63 max */ uint16_t indsz = min(RX_COPY_THRESHOLD - 1, M_INDICATESIZE); - int sw_flbuf_sizes[] = { + static int sge_flbuf_sizes[] = { MCLBYTES, #if MJUMPAGESIZE != MCLBYTES MJUMPAGESIZE, + MJUMPAGESIZE - CL_METADATA_SIZE, + MJUMPAGESIZE - 2 * MSIZE - CL_METADATA_SIZE, #endif MJUM9BYTES, MJUM16BYTES, - MJUMPAGESIZE - MSIZE + MCLBYTES - MSIZE - CL_METADATA_SIZE, + MJUM9BYTES - CL_METADATA_SIZE, + MJUM16BYTES - CL_METADATA_SIZE, }; KASSERT(sc->flags & MASTER_PF, @@ -357,9 +387,11 @@ t4_tweak_chip_settings(struct adapter *s V_HOSTPAGESIZEPF7(PAGE_SHIFT - 10); t4_write_reg(sc, A_SGE_HOST_PAGE_SIZE, v); - for (i = 0; i < min(nitems(sw_flbuf_sizes), 16); i++) { + KASSERT(nitems(sge_flbuf_sizes) <= SGE_FLBUF_SIZES, + ("%s: hw buffer size table too big", __func__)); + for (i = 0; i < min(nitems(sge_flbuf_sizes), SGE_FLBUF_SIZES); i++) { t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE0 + (4 * i), - sw_flbuf_sizes[i]); + sge_flbuf_sizes[i]); } v = V_THRESHOLD_0(intr_pktcount[0]) | V_THRESHOLD_1(intr_pktcount[1]) | @@ -414,6 +446,18 @@ t4_tweak_chip_settings(struct adapter *s } /* + * SGE wants the buffer to be at least 64B and then a multiple of the pad + * boundary or 16, whichever is greater. + */ +static inline int +hwsz_ok(int hwsz) +{ + int mask = max(fl_pad, 16) - 1; + + return (hwsz >= 64 && (hwsz & mask) == 0); +} + +/* * XXX: driver really should be able to deal with unexpected settings. */ int @@ -423,7 +467,7 @@ t4_read_chip_settings(struct adapter *sc int i, j, n, rc = 0; uint32_t m, v, r; uint16_t indsz = min(RX_COPY_THRESHOLD - 1, M_INDICATESIZE); - uint32_t sge_flbuf_sizes[16], sw_flbuf_sizes[] = { + static int sw_buf_sizes[] = { /* Sorted by size */ MCLBYTES, #if MJUMPAGESIZE != MCLBYTES MJUMPAGESIZE, @@ -431,6 +475,8 @@ t4_read_chip_settings(struct adapter *sc MJUM9BYTES, MJUM16BYTES }; + struct sw_zone_info *swz, *safe_swz; + struct hw_buf_info *hwb; m = V_PKTSHIFT(M_PKTSHIFT) | F_RXPKTCPLMODE | F_EGRSTATUSPAGESIZE; v = V_PKTSHIFT(fl_pktshift) | F_RXPKTCPLMODE | @@ -461,6 +507,7 @@ t4_read_chip_settings(struct adapter *sc rc = EINVAL; } } + s->pack_boundary = is_t4(sc) ? t4_fl_pack : t5_fl_pack; v = V_HOSTPAGESIZEPF0(PAGE_SHIFT - 10) | V_HOSTPAGESIZEPF1(PAGE_SHIFT - 10) | @@ -476,45 +523,93 @@ t4_read_chip_settings(struct adapter *sc rc = EINVAL; } - /* - * Make a list of SGE FL buffer sizes programmed in the chip and tally - * it with the FL buffer sizes that we'd like to use. - */ - n = 0; - for (i = 0; i < nitems(sge_flbuf_sizes); i++) { + /* Filter out unusable hw buffer sizes entirely (mark with -2). */ + hwb = &s->hw_buf_info[0]; + for (i = 0; i < nitems(s->hw_buf_info); i++, hwb++) { r = t4_read_reg(sc, A_SGE_FL_BUFFER_SIZE0 + (4 * i)); - sge_flbuf_sizes[i] = r; - if (r == MJUMPAGESIZE - MSIZE && - (sc->flags & BUF_PACKING_OK) == 0) { - sc->flags |= BUF_PACKING_OK; - FL_BUF_HWTAG(sc, n) = i; - FL_BUF_SIZE(sc, n) = MJUMPAGESIZE - MSIZE; - FL_BUF_TYPE(sc, n) = m_gettype(MJUMPAGESIZE); - FL_BUF_ZONE(sc, n) = m_getzone(MJUMPAGESIZE); - n++; - } + hwb->size = r; + hwb->zidx = hwsz_ok(r) ? -1 : -2; + hwb->next = -1; } - for (i = 0; i < nitems(sw_flbuf_sizes); i++) { - for (j = 0; j < nitems(sge_flbuf_sizes); j++) { - if (sw_flbuf_sizes[i] != sge_flbuf_sizes[j]) + + /* + * Create a sorted list in decreasing order of hw buffer sizes (and so + * increasing order of spare area) for each software zone. + */ + n = 0; /* no usable buffer size to begin with */ + swz = &s->sw_zone_info[0]; + safe_swz = NULL; + for (i = 0; i < SW_ZONE_SIZES; i++, swz++) { + int8_t head = -1, tail = -1; + + swz->size = sw_buf_sizes[i]; + swz->zone = m_getzone(swz->size); + swz->type = m_gettype(swz->size); + + if (swz->size == safest_rx_cluster) + safe_swz = swz; + + hwb = &s->hw_buf_info[0]; + for (j = 0; j < SGE_FLBUF_SIZES; j++, hwb++) { + if (hwb->zidx != -1 || hwb->size > swz->size) continue; - FL_BUF_HWTAG(sc, n) = j; - FL_BUF_SIZE(sc, n) = sw_flbuf_sizes[i]; - FL_BUF_TYPE(sc, n) = m_gettype(sw_flbuf_sizes[i]); - FL_BUF_ZONE(sc, n) = m_getzone(sw_flbuf_sizes[i]); + hwb->zidx = i; + if (head == -1) + head = tail = j; + else if (hwb->size < s->hw_buf_info[tail].size) { + s->hw_buf_info[tail].next = j; + tail = j; + } else { + int8_t *cur; + struct hw_buf_info *t; + + for (cur = &head; *cur != -1; cur = &t->next) { + t = &s->hw_buf_info[*cur]; + if (hwb->size == t->size) { + hwb->zidx = -2; + break; + } + if (hwb->size > t->size) { + hwb->next = *cur; + *cur = j; + break; + } + } + } + } + swz->head_hwidx = head; + swz->tail_hwidx = tail; + + if (tail != -1) { n++; - break; + if (swz->size - s->hw_buf_info[tail].size >= + CL_METADATA_SIZE) + sc->flags |= BUF_PACKING_OK; } } if (n == 0) { device_printf(sc->dev, "no usable SGE FL buffer size.\n"); rc = EINVAL; - } else if (n == 1 && (sc->flags & BUF_PACKING_OK)) { - device_printf(sc->dev, - "no usable SGE FL buffer size when not packing buffers.\n"); - rc = EINVAL; } - FL_BUF_SIZES(sc) = n; + + s->safe_hwidx1 = -1; + s->safe_hwidx2 = -1; + if (safe_swz != NULL) { + s->safe_hwidx1 = safe_swz->head_hwidx; + for (i = safe_swz->head_hwidx; i != -1; i = hwb->next) { + int spare; + + hwb = &s->hw_buf_info[i]; + spare = safe_swz->size - hwb->size; + if (spare < CL_METADATA_SIZE) + continue; + if (s->safe_hwidx2 == -1 || + spare == CL_METADATA_SIZE + MSIZE) + s->safe_hwidx2 = i; + if (spare >= CL_METADATA_SIZE + MSIZE) + break; + } + } r = t4_read_reg(sc, A_SGE_INGRESS_RX_THRESHOLD); s->counter_val[0] = G_THRESHOLD_0(r); @@ -626,6 +721,10 @@ t4_sge_sysctls(struct adapter *sc, struc struct sysctl_oid_list *children) { + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "buffer_sizes", + CTLTYPE_STRING | CTLFLAG_RD, &sc->sge, 0, sysctl_bufsizes, "A", + "freelist buffer sizes"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pktshift", CTLFLAG_RD, NULL, fl_pktshift, "payload DMA offset in rx buffer (bytes)"); @@ -643,8 +742,7 @@ t4_sge_sysctls(struct adapter *sc, struc "pack multiple frames in one fl buffer"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pack", CTLFLAG_RD, - NULL, is_t5(sc) ? t5_fl_pack : t4_fl_pack, - "payload pack boundary (bytes)"); + NULL, sc->sge.pack_boundary, "payload pack boundary (bytes)"); } int @@ -764,7 +862,7 @@ port_intr_iq(struct port_info *pi, int i #ifdef TCP_OFFLOAD if (sc->flags & INTR_DIRECT) { idx %= pi->nrxq + pi->nofldrxq; - + if (idx >= pi->nrxq) { idx -= pi->nrxq; iq = &s->ofld_rxq[pi->first_ofld_rxq + idx].iq; @@ -795,29 +893,28 @@ port_intr_iq(struct port_info *pi, int i return (iq); } +/* Maximum payload that can be delivered with a single iq descriptor */ static inline int -mtu_to_bufsize(int mtu) +mtu_to_max_payload(struct adapter *sc, int mtu, const int toe) { - int bufsize; - - /* large enough for a frame even when VLAN extraction is disabled */ - bufsize = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + mtu; - bufsize = roundup2(bufsize + fl_pktshift, fl_pad); - - return (bufsize); -} + int payload; #ifdef TCP_OFFLOAD -static inline int -mtu_to_bufsize_toe(struct adapter *sc, int mtu) -{ - - if (sc->tt.rx_coalesce) - return (G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2))); + if (toe) { + payload = sc->tt.rx_coalesce ? + G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2)) : mtu; + } else { +#endif + /* large enough even when hw VLAN extraction is disabled */ + payload = fl_pktshift + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + + mtu; +#ifdef TCP_OFFLOAD + } +#endif + payload = roundup2(payload, fl_pad); - return (mtu); + return (payload); } -#endif int t4_setup_port_queues(struct port_info *pi) @@ -836,7 +933,7 @@ t4_setup_port_queues(struct port_info *p struct ifnet *ifp = pi->ifp; struct sysctl_oid *oid = device_get_sysctl_tree(pi->dev); struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); - int bufsize, pack; + int maxp, pack, mtu = ifp->if_mtu; oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "rxq", CTLFLAG_RD, NULL, "rx queues"); @@ -857,7 +954,7 @@ t4_setup_port_queues(struct port_info *p * a) initialize iq and fl * b) allocate queue iff it will take direct interrupts. */ - bufsize = mtu_to_bufsize(ifp->if_mtu); + maxp = mtu_to_max_payload(sc, mtu, 0); pack = enable_buffer_packing(sc); for_each_rxq(pi, i, rxq) { @@ -866,7 +963,7 @@ t4_setup_port_queues(struct port_info *p snprintf(name, sizeof(name), "%s rxq%d-fl", device_get_nameunit(pi->dev), i); - init_fl(sc, &rxq->fl, pi->qsize_rxq / 8, bufsize, pack, name); + init_fl(sc, &rxq->fl, pi->qsize_rxq / 8, maxp, pack, name); if (sc->flags & INTR_DIRECT #ifdef TCP_OFFLOAD @@ -882,8 +979,7 @@ t4_setup_port_queues(struct port_info *p } #ifdef TCP_OFFLOAD - bufsize = mtu_to_bufsize_toe(sc, ifp->if_mtu); - pack = 0; /* XXX: think about this some more */ + maxp = mtu_to_max_payload(sc, mtu, 1); for_each_ofld_rxq(pi, i, ofld_rxq) { init_iq(&ofld_rxq->iq, sc, pi->tmr_idx, pi->pktc_idx, @@ -891,8 +987,7 @@ t4_setup_port_queues(struct port_info *p snprintf(name, sizeof(name), "%s ofld_rxq%d-fl", device_get_nameunit(pi->dev), i); - init_fl(sc, &ofld_rxq->fl, pi->qsize_rxq / 8, bufsize, pack, - name); + init_fl(sc, &ofld_rxq->fl, pi->qsize_rxq / 8, maxp, pack, name); if (sc->flags & INTR_DIRECT || (sc->intr_count > 1 && pi->nofldrxq > pi->nrxq)) { @@ -1169,10 +1264,7 @@ service_iq(struct sge_iq *iq, int budget ("%s: data for an iq (%p) with no freelist", __func__, iq)); - m0 = fl->flags & FL_BUF_PACKING ? - get_fl_payload1(sc, fl, lq, &fl_bufs_used) : - get_fl_payload2(sc, fl, lq, &fl_bufs_used); - + m0 = get_fl_payload(sc, fl, lq, &fl_bufs_used); if (__predict_false(m0 == NULL)) goto process_iql; #ifdef T4_PKT_TIMESTAMP @@ -1245,6 +1337,14 @@ service_iq(struct sge_iq *iq, int budget break; } + if (fl_bufs_used >= 16) { + FL_LOCK(fl); + fl->needed += fl_bufs_used; + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + fl_bufs_used = 0; + } + iq_next(iq); if (++ndescs == limit) { t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), @@ -1261,14 +1361,6 @@ service_iq(struct sge_iq *iq, int budget } #endif - if (fl_bufs_used > 0) { - FL_LOCK(fl); - fl->needed += fl_bufs_used; - refill_fl(sc, fl, fl->cap / 8); - FL_UNLOCK(fl); - fl_bufs_used = 0; - } - if (budget) return (EINPROGRESS); } @@ -1311,7 +1403,7 @@ process_iql: FL_LOCK(fl); fl->needed += fl_bufs_used; - starved = refill_fl(sc, fl, fl->cap / 4); + starved = refill_fl(sc, fl, 64); FL_UNLOCK(fl); if (__predict_false(starved != 0)) add_fl_to_sfl(sc, fl); @@ -1320,74 +1412,28 @@ process_iql: return (0); } -static int -fill_mbuf_stash(struct sge_fl *fl) -{ - int i; - - for (i = 0; i < nitems(fl->mstash); i++) { - if (fl->mstash[i] == NULL) { - struct mbuf *m; - if ((m = m_get(M_NOWAIT, MT_NOINIT)) == NULL) - return (ENOBUFS); - fl->mstash[i] = m; - } - } - return (0); -} - -static struct mbuf * -get_mbuf_from_stash(struct sge_fl *fl) +static inline int +cl_has_metadata(struct sge_fl *fl, struct cluster_layout *cll) { - int i; + int rc = fl->flags & FL_BUF_PACKING || cll->region1 > 0; - for (i = 0; i < nitems(fl->mstash); i++) { - if (fl->mstash[i] != NULL) { - struct mbuf *m; - - m = fl->mstash[i]; - fl->mstash[i] = NULL; - return (m); - } else - fl->mstash[i] = m_get(M_NOWAIT, MT_NOINIT); - } + if (rc) + MPASS(cll->region3 >= CL_METADATA_SIZE); - return (m_get(M_NOWAIT, MT_NOINIT)); + return (rc); } -static void -return_mbuf_to_stash(struct sge_fl *fl, struct mbuf *m) +static inline struct cluster_metadata * +cl_metadata(struct adapter *sc, struct sge_fl *fl, struct cluster_layout *cll, + caddr_t cl) { - int i; - if (m == NULL) - return; + if (cl_has_metadata(fl, cll)) { + struct sw_zone_info *swz = &sc->sge.sw_zone_info[cll->zidx]; - for (i = 0; i < nitems(fl->mstash); i++) { - if (fl->mstash[i] == NULL) { - fl->mstash[i] = m; - return; - } + return ((struct cluster_metadata *)(cl + swz->size) - 1); } - m_init(m, NULL, 0, M_NOWAIT, MT_DATA, 0); - m_free(m); -} - -/* buf can be any address within the buffer */ -static inline u_int * -find_buf_refcnt(caddr_t buf) -{ - uintptr_t ptr = (uintptr_t)buf; - - return ((u_int *)((ptr & ~(MJUMPAGESIZE - 1)) + MSIZE - sizeof(u_int))); -} - -static inline struct mbuf * -find_buf_mbuf(caddr_t buf) -{ - uintptr_t ptr = (uintptr_t)buf; - - return ((struct mbuf *)(ptr & ~(MJUMPAGESIZE - 1))); + return (NULL); } static int @@ -1395,179 +1441,117 @@ rxb_free(struct mbuf *m, void *arg1, voi { uma_zone_t zone = arg1; caddr_t cl = arg2; -#ifdef notyet - u_int refcount; - refcount = *find_buf_refcnt(cl); - KASSERT(refcount == 0, ("%s: cl %p refcount is %u", __func__, - cl - MSIZE, refcount)); -#endif - cl -= MSIZE; uma_zfree(zone, cl); return (EXT_FREE_OK); } +/* + * The mbuf returned by this function could be allocated from zone_mbuf or + * constructed in spare room in the cluster. + * + * The mbuf carries the payload in one of these ways + * a) frame inside the mbuf (mbuf from zone_mbuf) + * b) m_cljset (for clusters without metadata) zone_mbuf + * c) m_extaddref (cluster with metadata) inline mbuf + * d) m_extaddref (cluster with metadata) zone_mbuf + */ static struct mbuf * -get_fl_payload1(struct adapter *sc, struct sge_fl *fl, uint32_t len_newbuf, - int *fl_bufs_used) +get_scatter_segment(struct adapter *sc, struct sge_fl *fl, int total, int flags) { - struct mbuf *m0, *m; + struct mbuf *m; struct fl_sdesc *sd = &fl->sdesc[fl->cidx]; - unsigned int nbuf, len; - int pack_boundary = is_t4(sc) ? t4_fl_pack : t5_fl_pack; + struct cluster_layout *cll = &sd->cll; + struct sw_zone_info *swz = &sc->sge.sw_zone_info[cll->zidx]; + struct hw_buf_info *hwb = &sc->sge.hw_buf_info[cll->hwidx]; + struct cluster_metadata *clm = cl_metadata(sc, fl, cll, sd->cl); + int len, padded_len; + caddr_t payload; + + len = min(total, hwb->size - fl->rx_offset); + padded_len = roundup2(len, fl_pad); + payload = sd->cl + cll->region1 + fl->rx_offset; - /* - * No assertion for the fl lock because we don't need it. This routine - * is called only from the rx interrupt handler and it only updates - * fl->cidx. (Contrast that with fl->pidx/fl->needed which could be - * updated in the rx interrupt handler or the starvation helper routine. - * That's why code that manipulates fl->pidx/fl->needed needs the fl - * lock but this routine does not). - */ + if (sc->sc_do_rxcopy && len < RX_COPY_THRESHOLD) { - KASSERT(fl->flags & FL_BUF_PACKING, - ("%s: buffer packing disabled for fl %p", __func__, fl)); - - len = G_RSPD_LEN(len_newbuf); + /* + * Copy payload into a freshly allocated mbuf. + */ - if ((len_newbuf & F_RSPD_NEWBUF) == 0) { - KASSERT(fl->rx_offset > 0, - ("%s: packed frame but driver at offset=0", __func__)); - - /* A packed frame is guaranteed to fit entirely in this buf. */ - KASSERT(FL_BUF_SIZE(sc, sd->tag_idx) - fl->rx_offset >= len, - ("%s: packing error. bufsz=%u, offset=%u, len=%u", - __func__, FL_BUF_SIZE(sc, sd->tag_idx), fl->rx_offset, - len)); - - m0 = get_mbuf_from_stash(fl); - if (m0 == NULL || - m_init(m0, NULL, 0, M_NOWAIT, MT_DATA, M_PKTHDR) != 0) { - return_mbuf_to_stash(fl, m0); + m = flags & M_PKTHDR ? + m_gethdr(M_NOWAIT, MT_DATA) : m_get(M_NOWAIT, MT_DATA); + if (m == NULL) return (NULL); - } - - bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, - BUS_DMASYNC_POSTREAD); - if (sc->sc_do_rxcopy && (len < RX_COPY_THRESHOLD)) { + fl->mbuf_allocated++; #ifdef T4_PKT_TIMESTAMP - /* Leave room for a timestamp */ - m0->m_data += 8; + /* Leave room for a timestamp */ + m->m_data += 8; #endif - bcopy(sd->cl + fl->rx_offset, mtod(m0, caddr_t), len); - m0->m_pkthdr.len = len; - m0->m_len = len; - } else { - m0->m_pkthdr.len = len; - m0->m_len = len; - m_extaddref(m0, sd->cl + fl->rx_offset, - roundup2(m0->m_len, fl_pad), - find_buf_refcnt(sd->cl), rxb_free, - FL_BUF_ZONE(sc, sd->tag_idx), sd->cl); - } - fl->rx_offset += len; - fl->rx_offset = roundup2(fl->rx_offset, fl_pad); - fl->rx_offset = roundup2(fl->rx_offset, pack_boundary); - if (fl->rx_offset >= FL_BUF_SIZE(sc, sd->tag_idx)) { - fl->rx_offset = 0; - (*fl_bufs_used) += 1; - if (__predict_false(++fl->cidx == fl->cap)) - fl->cidx = 0; - } + /* copy data to mbuf */ + bcopy(payload, mtod(m, caddr_t), len); - return (m0); - } + } else if (sd->nmbuf * MSIZE < cll->region1) { - KASSERT(len_newbuf & F_RSPD_NEWBUF, - ("%s: only new buffer handled here", __func__)); + /* + * There's spare room in the cluster for an mbuf. Create one *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 07:21:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A8749CCE; Tue, 6 May 2014 07:21: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 9437ADF1; Tue, 6 May 2014 07:21: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 s467Lp9f045843; Tue, 6 May 2014 07:21:51 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s467Loxa045725; Tue, 6 May 2014 07:21:50 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201405060721.s467Loxa045725@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 6 May 2014 07:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265426 - in stable/10/sys/dev/cxgbe: . common tom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 07:21:51 -0000 Author: np Date: Tue May 6 07:21:50 2014 New Revision: 265426 URL: http://svnweb.freebsd.org/changeset/base/265426 Log: MFC r259382: Read card capabilities after firmware initialization, instead of setting them up as part of firmware initialization (which the driver gets to do only if it's the master driver). Read the range of tids available for the ETHOFLD functionality if it's enabled. New is_ftid() and is_etid() functions to test whether a tid falls within the range of filter tids or ETHOFLD tids respectively. Modified: stable/10/sys/dev/cxgbe/common/common.h stable/10/sys/dev/cxgbe/offload.h stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_sge.c stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/10/sys/dev/cxgbe/common/common.h Tue May 6 06:49:39 2014 (r265425) +++ stable/10/sys/dev/cxgbe/common/common.h Tue May 6 07:21:50 2014 (r265426) @@ -267,8 +267,10 @@ struct adapter_params { unsigned short a_wnd[NCCTRL_WIN]; unsigned short b_wnd[NCCTRL_WIN]; - unsigned int mc_size; /* MC memory size */ - unsigned int nfilters; /* size of filter region */ + u_int ftid_min; + u_int ftid_max; + u_int etid_min; + u_int netids; unsigned int cim_la_size; @@ -280,8 +282,10 @@ struct adapter_params { unsigned int offload:1; /* hw is TOE capable, fw has divvied up card resources for TOE operation. */ unsigned int bypass:1; /* this is a bypass card */ + unsigned int ethoffload:1; unsigned int ofldq_wr_cred; + unsigned int eo_wr_cred; }; #define CHELSIO_T4 0x4 @@ -318,11 +322,28 @@ struct link_config { #define for_each_port(adapter, iter) \ for (iter = 0; iter < (adapter)->params.nports; ++iter) +static inline int is_ftid(const struct adapter *sc, u_int tid) +{ + + return (tid >= sc->params.ftid_min && tid <= sc->params.ftid_max); +} + +static inline int is_etid(const struct adapter *sc, u_int tid) +{ + + return (tid >= sc->params.etid_min); +} + static inline int is_offload(const struct adapter *adap) { return adap->params.offload; } +static inline int is_ethoffload(const struct adapter *adap) +{ + return adap->params.ethoffload; +} + static inline int chip_id(struct adapter *adap) { return adap->params.chipid; Modified: stable/10/sys/dev/cxgbe/offload.h ============================================================================== --- stable/10/sys/dev/cxgbe/offload.h Tue May 6 06:49:39 2014 (r265425) +++ stable/10/sys/dev/cxgbe/offload.h Tue May 6 07:21:50 2014 (r265426) @@ -101,6 +101,11 @@ struct tid_info { u_int nftids; u_int ftid_base; u_int ftids_in_use; + + struct mtx etid_lock __aligned(CACHE_LINE_SIZE); + struct etid_entry *etid_tab; + u_int netids; + u_int etid_base; }; struct t4_range { Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Tue May 6 06:49:39 2014 (r265425) +++ stable/10/sys/dev/cxgbe/t4_main.c Tue May 6 07:21:50 2014 (r265426) @@ -2357,7 +2357,6 @@ use_config_on_flash: #define LIMIT_CAPS(x) do { \ caps.x &= htobe16(t4_##x##_allowed); \ - sc->x = htobe16(caps.x); \ } while (0) /* @@ -2459,6 +2458,8 @@ get_params__post_init(struct adapter *sc sc->sge.eq_start = val[1]; sc->tids.ftid_base = val[2]; sc->tids.nftids = val[3] - val[2] + 1; + sc->params.ftid_min = val[2]; + sc->params.ftid_max = val[3]; sc->vres.l2t.start = val[4]; sc->vres.l2t.size = val[5] - val[4] + 1; KASSERT(sc->vres.l2t.size <= L2T_SIZE, @@ -2477,7 +2478,35 @@ get_params__post_init(struct adapter *sc return (rc); } - if (caps.toecaps) { +#define READ_CAPS(x) do { \ + sc->x = htobe16(caps.x); \ +} while (0) + READ_CAPS(linkcaps); + READ_CAPS(niccaps); + READ_CAPS(toecaps); + READ_CAPS(rdmacaps); + READ_CAPS(iscsicaps); + READ_CAPS(fcoecaps); + + if (sc->niccaps & FW_CAPS_CONFIG_NIC_ETHOFLD) { + param[0] = FW_PARAM_PFVF(ETHOFLD_START); + param[1] = FW_PARAM_PFVF(ETHOFLD_END); + param[2] = FW_PARAM_DEV(FLOWC_BUFFIFO_SZ); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 3, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query NIC parameters: %d.\n", rc); + return (rc); + } + sc->tids.etid_base = val[0]; + sc->params.etid_min = val[0]; + sc->tids.netids = val[1] - val[0] + 1; + sc->params.netids = sc->tids.netids; + sc->params.eo_wr_cred = val[2]; + sc->params.ethoffload = 1; + } + + if (sc->toecaps) { /* query offload-related parameters */ param[0] = FW_PARAM_DEV(NTID); param[1] = FW_PARAM_PFVF(SERVER_START); @@ -2500,7 +2529,7 @@ get_params__post_init(struct adapter *sc sc->params.ofldq_wr_cred = val[5]; sc->params.offload = 1; } - if (caps.rdmacaps) { + if (sc->rdmacaps) { param[0] = FW_PARAM_PFVF(STAG_START); param[1] = FW_PARAM_PFVF(STAG_END); param[2] = FW_PARAM_PFVF(RQ_START); @@ -2539,7 +2568,7 @@ get_params__post_init(struct adapter *sc sc->vres.ocq.start = val[4]; sc->vres.ocq.size = val[5] - val[4] + 1; } - if (caps.iscsicaps) { + if (sc->iscsicaps) { param[0] = FW_PARAM_PFVF(ISCSI_START); param[1] = FW_PARAM_PFVF(ISCSI_END); rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); @@ -4504,6 +4533,7 @@ cxgbe_sysctls(struct port_info *pi) struct sysctl_ctx_list *ctx; struct sysctl_oid *oid; struct sysctl_oid_list *children; + struct adapter *sc = pi->adapter; ctx = device_get_sysctl_ctx(pi->dev); @@ -4536,7 +4566,7 @@ cxgbe_sysctls(struct port_info *pi) "Reserve queue 0 for non-flowid packets"); #ifdef TCP_OFFLOAD - if (is_offload(pi->adapter)) { + if (is_offload(sc)) { SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldrxq", CTLFLAG_RD, &pi->nofldrxq, 0, "# of rx queues for offloaded TCP connections"); @@ -4575,7 +4605,7 @@ cxgbe_sysctls(struct port_info *pi) #define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ - CTLTYPE_U64 | CTLFLAG_RD, pi->adapter, reg, \ + CTLTYPE_U64 | CTLFLAG_RD, sc, reg, \ sysctl_handle_t4_reg64, "QU", desc) SYSCTL_ADD_T4_REG64(pi, "tx_octets", "# of octets in good frames", @@ -6164,6 +6194,11 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) t->ftid_base + t->nftids - 1); } + if (t->netids) { + sbuf_printf(sb, "ETID range: %u-%u\n", t->etid_base, + t->etid_base + t->netids - 1); + } + sbuf_printf(sb, "HW TID usage: %u IP users, %u IPv6 users", t4_read_reg(sc, A_LE_DB_ACT_CNT_IPV4), t4_read_reg(sc, A_LE_DB_ACT_CNT_IPV6)); @@ -7195,14 +7230,17 @@ t4_filter_rpl(struct sge_iq *iq, const s struct adapter *sc = iq->adapter; const struct cpl_set_tcb_rpl *rpl = (const void *)(rss + 1); unsigned int idx = GET_TID(rpl); + unsigned int rc; + struct filter_entry *f; KASSERT(m == NULL, ("%s: payload with opcode %02x", __func__, rss->opcode)); - if (idx >= sc->tids.ftid_base && - (idx -= sc->tids.ftid_base) < sc->tids.nftids) { - unsigned int rc = G_COOKIE(rpl->cookie); - struct filter_entry *f = &sc->tids.ftid_tab[idx]; + if (is_ftid(sc, idx)) { + + idx -= sc->tids.ftid_base; + f = &sc->tids.ftid_tab[idx]; + rc = G_COOKIE(rpl->cookie); mtx_lock(&sc->tids.ftid_lock); if (rc == FW_FILTER_WR_FLT_ADDED) { Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Tue May 6 06:49:39 2014 (r265425) +++ stable/10/sys/dev/cxgbe/t4_sge.c Tue May 6 07:21:50 2014 (r265426) @@ -2833,7 +2833,6 @@ alloc_wrq(struct adapter *sc, struct por SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "unstalled", CTLFLAG_RD, &wrq->eq.unstalled, 0, "# of times queue recovered after stall"); - return (rc); } Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Tue May 6 06:49:39 2014 (r265425) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Tue May 6 07:21:50 2014 (r265426) @@ -1299,18 +1299,18 @@ do_rx_data(struct sge_iq *iq, const stru #define V_CPL_FW4_ACK_OPCODE(x) ((x) << S_CPL_FW4_ACK_OPCODE) #define G_CPL_FW4_ACK_OPCODE(x) \ (((x) >> S_CPL_FW4_ACK_OPCODE) & M_CPL_FW4_ACK_OPCODE) - + #define S_CPL_FW4_ACK_FLOWID 0 #define M_CPL_FW4_ACK_FLOWID 0xffffff #define V_CPL_FW4_ACK_FLOWID(x) ((x) << S_CPL_FW4_ACK_FLOWID) #define G_CPL_FW4_ACK_FLOWID(x) \ (((x) >> S_CPL_FW4_ACK_FLOWID) & M_CPL_FW4_ACK_FLOWID) - + #define S_CPL_FW4_ACK_CR 24 #define M_CPL_FW4_ACK_CR 0xff #define V_CPL_FW4_ACK_CR(x) ((x) << S_CPL_FW4_ACK_CR) #define G_CPL_FW4_ACK_CR(x) (((x) >> S_CPL_FW4_ACK_CR) & M_CPL_FW4_ACK_CR) - + #define S_CPL_FW4_ACK_SEQVAL 0 #define M_CPL_FW4_ACK_SEQVAL 0x1 #define V_CPL_FW4_ACK_SEQVAL(x) ((x) << S_CPL_FW4_ACK_SEQVAL) @@ -1437,8 +1437,7 @@ do_set_tcb_rpl(struct sge_iq *iq, const ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); - if (tid >= sc->tids.ftid_base && - tid < sc->tids.ftid_base + sc->tids.nftids) + if (is_ftid(sc, tid)) return (t4_filter_rpl(iq, rss, m)); /* TCB is a filter */ CXGBE_UNIMPLEMENTED(__func__); From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 09:51:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 35CE2834; Tue, 6 May 2014 09:51: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 232E5C6B; Tue, 6 May 2014 09:51: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 s469pGZs013490; Tue, 6 May 2014 09:51:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s469pFoP013489; Tue, 6 May 2014 09:51:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405060951.s469pFoP013489@svn.freebsd.org> From: Alexander Motin Date: Tue, 6 May 2014 09:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265428 - stable/10/sys/dev/ahci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 09:51:16 -0000 Author: mav Date: Tue May 6 09:51:15 2014 New Revision: 265428 URL: http://svnweb.freebsd.org/changeset/base/265428 Log: MFC r260830: Add ID for one more ASMedia AHCI-compatible controller. Modified: stable/10/sys/dev/ahci/ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Tue May 6 09:12:32 2014 (r265427) +++ stable/10/sys/dev/ahci/ahci.c Tue May 6 09:51:15 2014 (r265428) @@ -146,6 +146,7 @@ static struct { {0x78021022, 0x00, "AMD Hudson-2", 0}, {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, + {0x06111b21, 0x00, "ASMedia ASM2106", 0}, {0x06121b21, 0x00, "ASMedia ASM1061", 0}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 09:54:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 870F7AF1; Tue, 6 May 2014 09:54: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 743BECA6; Tue, 6 May 2014 09:54: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 s469sPKd015811; Tue, 6 May 2014 09:54:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s469sPQb015810; Tue, 6 May 2014 09:54:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405060954.s469sPQb015810@svn.freebsd.org> From: Alexander Motin Date: Tue, 6 May 2014 09:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265430 - stable/10/sys/dev/ahci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 09:54:25 -0000 Author: mav Date: Tue May 6 09:54:24 2014 New Revision: 265430 URL: http://svnweb.freebsd.org/changeset/base/265430 Log: MFC r264610: Correct AMD chipsets identification. Modified: stable/10/sys/dev/ahci/ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Tue May 6 09:52:37 2014 (r265429) +++ stable/10/sys/dev/ahci/ahci.c Tue May 6 09:54:24 2014 (r265430) @@ -134,13 +134,13 @@ static struct { "\014ALTSIG" \ "\015NOMSI" } ahci_ids[] = { - {0x43801002, 0x00, "ATI IXP600", AHCI_Q_NOMSI}, - {0x43901002, 0x00, "ATI IXP700", 0}, - {0x43911002, 0x00, "ATI IXP700", 0}, - {0x43921002, 0x00, "ATI IXP700", 0}, - {0x43931002, 0x00, "ATI IXP700", 0}, - {0x43941002, 0x00, "ATI IXP800", 0}, - {0x43951002, 0x00, "ATI IXP800", 0}, + {0x43801002, 0x00, "AMD SB600", AHCI_Q_NOMSI}, + {0x43901002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, + {0x43911002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, + {0x43921002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, + {0x43931002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, + {0x43941002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, + {0x43951002, 0x00, "AMD SB8x0/SB9x0", 0}, {0x78001022, 0x00, "AMD Hudson-2", 0}, {0x78011022, 0x00, "AMD Hudson-2", 0}, {0x78021022, 0x00, "AMD Hudson-2", 0}, From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 12:15:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0A633549; Tue, 6 May 2014 12:15: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 EB005169; Tue, 6 May 2014 12:15: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 s46CF5pb079924; Tue, 6 May 2014 12:15:05 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46CF59Z079918; Tue, 6 May 2014 12:15:05 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405061215.s46CF59Z079918@svn.freebsd.org> From: Rick Macklem Date: Tue, 6 May 2014 12:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265434 - in stable/10/sys/fs: nfs nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 12:15:06 -0000 Author: rmacklem Date: Tue May 6 12:15:05 2014 New Revision: 265434 URL: http://svnweb.freebsd.org/changeset/base/265434 Log: MFC: r264672 Modify the Lookup RPC for NFSv4 so that it acquires directory attributes. This allows the client to cache directory names when they are looked up, reducing the Lookup RPC count by about 40% for software builds. Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfsclient/nfs_clcomsubs.c stable/10/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Tue May 6 11:12:56 2014 (r265433) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Tue May 6 12:15:05 2014 (r265434) @@ -101,8 +101,8 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_ { 0, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* Lock */ { 0, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* LockT */ { 0, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* LockU */ - { 1, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* Lookup */ - { 1, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* Lookupp */ + { 1, 2, 0, 0, LK_EXCLUSIVE, 1 }, /* Lookup */ + { 1, 2, 0, 0, LK_EXCLUSIVE, 1 }, /* Lookupp */ { 0, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* NVerify */ { 1, 1, 0, 1, LK_EXCLUSIVE, 1 }, /* Open */ { 1, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* OpenAttr */ Modified: stable/10/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 6 11:12:56 2014 (r265433) +++ stable/10/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 6 12:15:05 2014 (r265434) @@ -219,9 +219,18 @@ nfscl_reqstart(struct nfsrv_descript *nd procnum != NFSPROC_COMMITDS) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); - NFSWCCATTR_ATTRBIT(&attrbits); + /* + * For Lookup Ops, we want all the directory + * attributes, so we can load the name cache. + */ + if (procnum == NFSPROC_LOOKUP || + procnum == NFSPROC_LOOKUPP) + NFSGETATTR_ATTRBIT(&attrbits); + else { + NFSWCCATTR_ATTRBIT(&attrbits); + nd->nd_flag |= ND_V4WCCATTR; + } (void) nfsrv_putattrbit(nd, &attrbits); - nd->nd_flag |= ND_V4WCCATTR; } } if (procnum != NFSPROC_RENEW || Modified: stable/10/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clrpcops.c Tue May 6 11:12:56 2014 (r265433) +++ stable/10/sys/fs/nfsclient/nfs_clrpcops.c Tue May 6 12:15:05 2014 (r265434) @@ -1238,14 +1238,23 @@ nfsrpc_lookup(vnode_t dvp, char *name, i } if (nd->nd_flag & ND_NFSV3) error = nfscl_postop_attr(nd, dnap, dattrflagp, stuff); + else if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == + ND_NFSV4) { + /* Load the directory attributes. */ + error = nfsm_loadattr(nd, dnap); + if (error == 0) + *dattrflagp = 1; + } goto nfsmout; } if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == ND_NFSV4) { - NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); - if (*(tl + 1)) { - nd->nd_flag |= ND_NOMOREDATA; + /* Load the directory attributes. */ + error = nfsm_loadattr(nd, dnap); + if (error != 0) goto nfsmout; - } + *dattrflagp = 1; + /* Skip over the Lookup and GetFH operation status values. */ + NFSM_DISSECT(tl, u_int32_t *, 4 * NFSX_UNSIGNED); } error = nfsm_getfh(nd, nfhpp); if (error) @@ -2702,14 +2711,6 @@ nfsrpc_readdir(vnode_t vp, struct uio *u * Joy, oh joy. For V4 we get to hand craft '.' and '..'. */ if (uiop->uio_offset == 0) { -#if defined(__FreeBSD_version) && __FreeBSD_version >= 800000 - error = VOP_GETATTR(vp, &nfsva.na_vattr, cred); -#else - error = VOP_GETATTR(vp, &nfsva.na_vattr, cred, p); -#endif - if (error) - return (error); - dotfileid = nfsva.na_fileid; NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV4OP_GETFH); @@ -2718,9 +2719,16 @@ nfsrpc_readdir(vnode_t vp, struct uio *u error = nfscl_request(nd, vp, p, cred, stuff); if (error) return (error); + dotfileid = 0; /* Fake out the compiler. */ + if ((nd->nd_flag & ND_NOMOREDATA) == 0) { + error = nfsm_loadattr(nd, &nfsva); + if (error != 0) + goto nfsmout; + dotfileid = nfsva.na_fileid; + } if (nd->nd_repstat == 0) { - NFSM_DISSECT(tl, u_int32_t *, 3*NFSX_UNSIGNED); - len = fxdr_unsigned(int, *(tl + 2)); + NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED); + len = fxdr_unsigned(int, *(tl + 4)); if (len > 0 && len <= NFSX_V4FHMAX) error = nfsm_advance(nd, NFSM_RNDUP(len), -1); else @@ -3129,15 +3137,6 @@ nfsrpc_readdirplus(vnode_t vp, struct ui * Joy, oh joy. For V4 we get to hand craft '.' and '..'. */ if (uiop->uio_offset == 0) { -#if defined(__FreeBSD_version) && __FreeBSD_version >= 800000 - error = VOP_GETATTR(vp, &nfsva.na_vattr, cred); -#else - error = VOP_GETATTR(vp, &nfsva.na_vattr, cred, p); -#endif - if (error) - return (error); - dctime = nfsva.na_ctime; - dotfileid = nfsva.na_fileid; NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV4OP_GETFH); @@ -3146,9 +3145,17 @@ nfsrpc_readdirplus(vnode_t vp, struct ui error = nfscl_request(nd, vp, p, cred, stuff); if (error) return (error); + dotfileid = 0; /* Fake out the compiler. */ + if ((nd->nd_flag & ND_NOMOREDATA) == 0) { + error = nfsm_loadattr(nd, &nfsva); + if (error != 0) + goto nfsmout; + dctime = nfsva.na_ctime; + dotfileid = nfsva.na_fileid; + } if (nd->nd_repstat == 0) { - NFSM_DISSECT(tl, u_int32_t *, 3*NFSX_UNSIGNED); - len = fxdr_unsigned(int, *(tl + 2)); + NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED); + len = fxdr_unsigned(int, *(tl + 4)); if (len > 0 && len <= NFSX_V4FHMAX) error = nfsm_advance(nd, NFSM_RNDUP(len), -1); else From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 12:20:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7EB0982C; Tue, 6 May 2014 12:20:08 +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 6BD971B5; Tue, 6 May 2014 12:20:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46CK8v8080690; Tue, 6 May 2014 12:20:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46CK8bO080689; Tue, 6 May 2014 12:20:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405061220.s46CK8bO080689@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 6 May 2014 12:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265435 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 12:20:08 -0000 Author: kib Date: Tue May 6 12:20:07 2014 New Revision: 265435 URL: http://svnweb.freebsd.org/changeset/base/265435 Log: MFC r265100: Fix the comparision for the end of range in vm_phys_fictitious_reg_range(). Modified: stable/10/sys/vm/vm_phys.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_phys.c ============================================================================== --- stable/10/sys/vm/vm_phys.c Tue May 6 12:15:05 2014 (r265434) +++ stable/10/sys/vm/vm_phys.c Tue May 6 12:20:07 2014 (r265435) @@ -552,7 +552,9 @@ vm_phys_fictitious_reg_range(vm_paddr_t #ifdef VM_PHYSSEG_DENSE pi = atop(start); - if (pi >= first_page && atop(end) < vm_page_array_size) { + if (pi >= first_page && pi < vm_page_array_size + first_page) { + if (atop(end) >= vm_page_array_size + first_page) + return (EINVAL); fp = &vm_page_array[pi - first_page]; malloced = FALSE; } else From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 12:31:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CAC5FB4A; Tue, 6 May 2014 12:31: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 B83F83CC; Tue, 6 May 2014 12:31: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 s46CVPMJ088185; Tue, 6 May 2014 12:31:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46CVPHZ088184; Tue, 6 May 2014 12:31:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405061231.s46CVPHZ088184@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 6 May 2014 12:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265437 - stable/10/sys/dev/drm2/i915 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 12:31:25 -0000 Author: kib Date: Tue May 6 12:31:25 2014 New Revision: 265437 URL: http://svnweb.freebsd.org/changeset/base/265437 Log: MFC r265102: Fix two cases of recursive acquisitions of the vm object lock, only possible in rare failure situations. Modified: stable/10/sys/dev/drm2/i915/i915_gem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_gem.c Tue May 6 12:31:17 2014 (r265436) +++ stable/10/sys/dev/drm2/i915/i915_gem.c Tue May 6 12:31:25 2014 (r265437) @@ -1431,6 +1431,7 @@ retry: m = vm_phys_fictitious_to_vm_page(dev->agp->base + obj->gtt_offset + offset); if (m == NULL) { + VM_OBJECT_WUNLOCK(vm_obj); cause = 60; ret = -EFAULT; goto unlock; @@ -1450,7 +1451,6 @@ retry: DRM_UNLOCK(dev); VM_OBJECT_WUNLOCK(vm_obj); VM_WAIT; - VM_OBJECT_WLOCK(vm_obj); goto retry; } m->valid = VM_PAGE_BITS_ALL; From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 14:38:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7F0EA5C7; Tue, 6 May 2014 14:38: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 6BD369EF; Tue, 6 May 2014 14:38: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 s46Ec45N047434; Tue, 6 May 2014 14:38:04 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46Ec4O5047433; Tue, 6 May 2014 14:38:04 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201405061438.s46Ec4O5047433@svn.freebsd.org> From: Brooks Davis Date: Tue, 6 May 2014 14:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265449 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 14:38:04 -0000 Author: brooks Date: Tue May 6 14:38:03 2014 New Revision: 265449 URL: http://svnweb.freebsd.org/changeset/base/265449 Log: MFC r265097: Merge from CheriBSD: commit 1d1b908107255ffdff4d17f015d8f057d73cc6cb Author: Brooks Davis Date: Fri Mar 28 16:24:45 2014 +0000 Add a long needed seatbelt. Exit with an error when make is called without a target at the top level rather than poluting the source tree and causing use confusion in future builds. commit a9d9aa341b2f4308a227ab460ba85f1f287ad028 Author: Brooks Davis Date: Tue Apr 29 16:06:12 2014 +0000 Simplify seatbelt added in 1d1b908 based in feedback. Discussed with: imp@FreeBSD.org Reviewed by: imp Sponsored by: DARPA, AFRL Modified: stable/10/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile ============================================================================== --- stable/10/Makefile Tue May 6 14:33:18 2014 (r265448) +++ stable/10/Makefile Tue May 6 14:38:03 2014 (r265449) @@ -252,8 +252,17 @@ tinderbox toolchains kernel-toolchains: ${TGTS}: ${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET} -# Set a reasonable default -.MAIN: all +# The historic default "all" target creates files which may cause stale +# or (in the cross build case) unlinkable results. Fail with an error +# when no target is given. The users can explicitly specify "all" +# if they want the historic behavior. +.MAIN: _guard + +_guard: + @echo + @echo "Explicit target required (use \"all\" for historic behavior)" + @echo + @false STARTTIME!= LC_ALL=C date CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s ; echo From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 21:47:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 68B3A2FF; Tue, 6 May 2014 21:47: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 54F5F939; Tue, 6 May 2014 21:47: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 s46Llijn050997; Tue, 6 May 2014 21:47:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46LlhF0050994; Tue, 6 May 2014 21:47:43 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405062147.s46LlhF0050994@svn.freebsd.org> From: Rick Macklem Date: Tue, 6 May 2014 21:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265466 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 21:47:44 -0000 Author: rmacklem Date: Tue May 6 21:47:43 2014 New Revision: 265466 URL: http://svnweb.freebsd.org/changeset/base/265466 Log: MFC: r264681 Modify the NFSv4 client open/create RPC so that it acquires post-open/create directory attributes. This allows the RPC to name cache the newly created file and reduces the lookup RPC count by about 10% for software builds. Modified: stable/10/sys/fs/nfsclient/nfs_clcomsubs.c stable/10/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 6 21:34:01 2014 (r265465) +++ stable/10/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 6 21:47:43 2014 (r265466) @@ -66,7 +66,7 @@ static struct { { NFSV4OP_READLINK, 2, "Readlink", 8, }, { NFSV4OP_READ, 1, "Read", 4, }, { NFSV4OP_WRITE, 2, "Write", 5, }, - { NFSV4OP_OPEN, 3, "Open", 4, }, + { NFSV4OP_OPEN, 5, "Open", 4, }, { NFSV4OP_CREATE, 3, "Create", 6, }, { NFSV4OP_CREATE, 1, "Create", 6, }, { NFSV4OP_CREATE, 3, "Create", 6, }, Modified: stable/10/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clrpcops.c Tue May 6 21:34:01 2014 (r265465) +++ stable/10/sys/fs/nfsclient/nfs_clrpcops.c Tue May 6 21:47:43 2014 (r265466) @@ -1956,6 +1956,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, struct nfsmount *nmp; nmp = VFSTONFS(dvp->v_mount); + np = VTONFS(dvp); *unlockedp = 0; *nfhpp = NULL; *dpp = NULL; @@ -2005,17 +2006,22 @@ nfsrpc_createv4(vnode_t dvp, char *name, NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OPEN_CLAIMNULL); (void) nfsm_strtom(nd, name, namelen); + /* Get the new file's handle and attributes. */ NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV4OP_GETFH); *tl = txdr_unsigned(NFSV4OP_GETATTR); NFSGETATTR_ATTRBIT(&attrbits); (void) nfsrv_putattrbit(nd, &attrbits); + /* Get the directory's post-op attributes. */ + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_PUTFH); + (void) nfsm_fhtom(nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_GETATTR); + (void) nfsrv_putattrbit(nd, &attrbits); error = nfscl_request(nd, dvp, p, cred, dstuff); if (error) return (error); - error = nfscl_wcc_data(nd, dvp, dnap, dattrflagp, NULL, dstuff); - if (error) - goto nfsmout; NFSCL_INCRSEQID(owp->nfsow_seqid, nd); if (nd->nd_repstat == 0) { NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID + @@ -2087,6 +2093,13 @@ nfsrpc_createv4(vnode_t dvp, char *name, error = nfscl_mtofh(nd, nfhpp, nnap, attrflagp); if (error) goto nfsmout; + /* Get rid of the PutFH and Getattr status values. */ + NFSM_DISSECT(tl, u_int32_t *, 4 * NFSX_UNSIGNED); + /* Load the directory attributes. */ + error = nfsm_loadattr(nd, dnap); + if (error) + goto nfsmout; + *dattrflagp = 1; if (dp != NULL && *attrflagp) { dp->nfsdl_change = nnap->na_filerev; dp->nfsdl_modtime = nnap->na_mtime; @@ -2130,7 +2143,6 @@ nfsrpc_createv4(vnode_t dvp, char *name, if ((rflags & NFSV4OPEN_RESULTCONFIRM) && (owp->nfsow_clp->nfsc_flags & NFSCLFLAGS_GOTDELEG) && !error && dp == NULL) { - np = VTONFS(dvp); do { ret = nfsrpc_openrpc(VFSTONFS(vnode_mount(dvp)), dvp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 21:54:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 20F2273B; Tue, 6 May 2014 21:54: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 E89D19F9; Tue, 6 May 2014 21:54: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 s46LsqMe054938; Tue, 6 May 2014 21:54:52 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46LsqeF054935; Tue, 6 May 2014 21:54:52 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405062154.s46LsqeF054935@svn.freebsd.org> From: Rick Macklem Date: Tue, 6 May 2014 21:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265469 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 21:54:53 -0000 Author: rmacklem Date: Tue May 6 21:54:52 2014 New Revision: 265469 URL: http://svnweb.freebsd.org/changeset/base/265469 Log: MFC: r264705, r264749 Modify the NFSv4 client create/mkdir RPC so that it acquires post-create/mkdir directory attributes. This allows the RPC to name cache the newly created directory and reduces the lookup RPC count for applications creating a lot of directories. Modified: stable/10/sys/fs/nfsclient/nfs_clcomsubs.c stable/10/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 6 21:54:05 2014 (r265468) +++ stable/10/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 6 21:54:52 2014 (r265469) @@ -67,7 +67,7 @@ static struct { { NFSV4OP_READ, 1, "Read", 4, }, { NFSV4OP_WRITE, 2, "Write", 5, }, { NFSV4OP_OPEN, 5, "Open", 4, }, - { NFSV4OP_CREATE, 3, "Create", 6, }, + { NFSV4OP_CREATE, 5, "Create", 6, }, { NFSV4OP_CREATE, 1, "Create", 6, }, { NFSV4OP_CREATE, 3, "Create", 6, }, { NFSV4OP_REMOVE, 1, "Remove", 6, }, Modified: stable/10/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clrpcops.c Tue May 6 21:54:05 2014 (r265468) +++ stable/10/sys/fs/nfsclient/nfs_clrpcops.c Tue May 6 21:54:52 2014 (r265469) @@ -2545,10 +2545,12 @@ nfsrpc_mkdir(vnode_t dvp, char *name, in struct nfsrv_descript nfsd, *nd = &nfsd; nfsattrbit_t attrbits; int error = 0; + struct nfsfh *fhp; *nfhpp = NULL; *attrflagp = 0; *dattrflagp = 0; + fhp = VTONFS(dvp)->n_fhp; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp); @@ -2564,6 +2566,12 @@ nfsrpc_mkdir(vnode_t dvp, char *name, in *tl++ = txdr_unsigned(NFSV4OP_GETFH); *tl = txdr_unsigned(NFSV4OP_GETATTR); (void) nfsrv_putattrbit(nd, &attrbits); + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_PUTFH); + (void) nfsm_fhtom(nd, fhp->nfh_fh, fhp->nfh_len, 0); + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_GETATTR); + (void) nfsrv_putattrbit(nd, &attrbits); } error = nfscl_request(nd, dvp, p, cred, dstuff); if (error) @@ -2577,6 +2585,14 @@ nfsrpc_mkdir(vnode_t dvp, char *name, in } if (!error) error = nfscl_mtofh(nd, nfhpp, nnap, attrflagp); + if (error == 0 && (nd->nd_flag & ND_NFSV4) != 0) { + /* Get rid of the PutFH and Getattr status values. */ + NFSM_DISSECT(tl, u_int32_t *, 4 * NFSX_UNSIGNED); + /* Load the directory attributes. */ + error = nfsm_loadattr(nd, dnap); + if (error == 0) + *dattrflagp = 1; + } } if ((nd->nd_flag & ND_NFSV3) && !error) error = nfscl_wcc_data(nd, dvp, dnap, dattrflagp, NULL, dstuff); From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 21:59:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 729438B0; Tue, 6 May 2014 21:59: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 5F468A20; Tue, 6 May 2014 21:59: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 s46Lxnxl055689; Tue, 6 May 2014 21:59:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46LxnMY055688; Tue, 6 May 2014 21:59:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405062159.s46LxnMY055688@svn.freebsd.org> From: Rick Macklem Date: Tue, 6 May 2014 21:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265470 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 21:59:49 -0000 Author: rmacklem Date: Tue May 6 21:59:48 2014 New Revision: 265470 URL: http://svnweb.freebsd.org/changeset/base/265470 Log: MFC: r264738 For an NFSv4 mount with the "nocto" option, don't get the up to date file attributes upon close. This reduces the Getattr RPC count by about 65% for software builds. Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvnops.c Tue May 6 21:54:52 2014 (r265469) +++ stable/10/sys/fs/nfsclient/nfs_clvnops.c Tue May 6 21:59:48 2014 (r265470) @@ -768,7 +768,9 @@ nfs_close(struct vop_close_args *ap) /* * Get attributes so "change" is up to date. */ - if (error == 0 && nfscl_mustflush(vp) != 0) { + if (error == 0 && nfscl_mustflush(vp) != 0 && + vp->v_type == VREG && + (VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOCTO) == 0) { ret = nfsrpc_getattr(vp, cred, ap->a_td, &nfsva, NULL); if (!ret) { From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 22:04:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E092FA5D; Tue, 6 May 2014 22:04: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 CD68BAB2; Tue, 6 May 2014 22:04: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 s46M4oTk059767; Tue, 6 May 2014 22:04:50 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46M4omF059766; Tue, 6 May 2014 22:04:50 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405062204.s46M4omF059766@svn.freebsd.org> From: Rick Macklem Date: Tue, 6 May 2014 22:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265471 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 22:04:51 -0000 Author: rmacklem Date: Tue May 6 22:04:50 2014 New Revision: 265471 URL: http://svnweb.freebsd.org/changeset/base/265471 Log: MFC: r264739 Add {} braces so that the code conforms to the indentation. Fortunately, I don't think doing the assignment of cap->tsomax unconditionally causes any problem. Modified: stable/10/sys/netinet/tcp_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_subr.c ============================================================================== --- stable/10/sys/netinet/tcp_subr.c Tue May 6 21:59:48 2014 (r265470) +++ stable/10/sys/netinet/tcp_subr.c Tue May 6 22:04:50 2014 (r265471) @@ -1805,9 +1805,10 @@ tcp_maxmtu(struct in_conninfo *inc, stru /* Report additional interface capabilities. */ if (cap != NULL) { if (ifp->if_capenable & IFCAP_TSO4 && - ifp->if_hwassist & CSUM_TSO) + ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + } } RTFREE(sro.ro_rt); } @@ -1843,9 +1844,10 @@ tcp_maxmtu6(struct in_conninfo *inc, str /* Report additional interface capabilities. */ if (cap != NULL) { if (ifp->if_capenable & IFCAP_TSO6 && - ifp->if_hwassist & CSUM_TSO) + ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + } } RTFREE(sro6.ro_rt); } From owner-svn-src-stable-10@FreeBSD.ORG Tue May 6 23:28:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B6607E7F; Tue, 6 May 2014 23:28: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 A2FC912D; Tue, 6 May 2014 23:28: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 s46NSmCA096454; Tue, 6 May 2014 23:28:48 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46NSmEV096453; Tue, 6 May 2014 23:28:48 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405062328.s46NSmEV096453@svn.freebsd.org> From: Ed Maste Date: Tue, 6 May 2014 23:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265475 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 23:28:48 -0000 Author: emaste Date: Tue May 6 23:28:48 2014 New Revision: 265475 URL: http://svnweb.freebsd.org/changeset/base/265475 Log: MFC r261908 by ian: Fix a typo, C_ALSOLUTE -> C_ABSOLUTE. Modified: stable/10/share/man/man9/timeout.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/timeout.9 ============================================================================== --- stable/10/share/man/man9/timeout.9 Tue May 6 23:28:37 2014 (r265474) +++ stable/10/share/man/man9/timeout.9 Tue May 6 23:28:48 2014 (r265475) @@ -357,7 +357,7 @@ The following .Fa flags may be specified: .Bl -tag -width ".Dv C_DIRECT_EXEC" -.It Dv C_ALSOLUTE +.It Dv C_ABSOLUTE Handle the .Fa sbt argument as absolute time of the event since boot, or relative time otherwise. From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 00:32:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 12D0F9D0; Wed, 7 May 2014 00:32: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 F37508A6; Wed, 7 May 2014 00:32: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 s470Wn9E028286; Wed, 7 May 2014 00:32:49 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s470WnHg028284; Wed, 7 May 2014 00:32:49 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405070032.s470WnHg028284@svn.freebsd.org> From: Alan Cox Date: Wed, 7 May 2014 00:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265476 - in stable/10/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 00:32:50 -0000 Author: alc Date: Wed May 7 00:32:49 2014 New Revision: 265476 URL: http://svnweb.freebsd.org/changeset/base/265476 Log: MFC r262338 When the kernel is running in a virtual machine, it cannot rely upon the processor family to determine if the workaround for AMD Family 10h Erratum 383 should be enabled. To enable virtual machine migration among a heterogeneous collection of physical machines, the hypervisor may have been configured to report an older processor family with a reduced feature set. Effectively, the reported processor family and its features are like a "least common denominator" for the collection of machines. Therefore, when the kernel is running in a virtual machine, instead of relying upon the processor family, we now test for features that prove that the underlying processor is not affected by the erratum. (The features that we test for are unlikely to ever be emulated in software on an affected physical processor.) PR: 186061 Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/i386/i386/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Tue May 6 23:28:48 2014 (r265475) +++ stable/10/sys/amd64/amd64/pmap.c Wed May 7 00:32:49 2014 (r265476) @@ -1008,12 +1008,18 @@ pmap_init(void) } /* - * If the kernel is running in a virtual machine on an AMD Family 10h - * processor, then it must assume that MCA is enabled by the virtual - * machine monitor. - */ - if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD && - CPUID_TO_FAMILY(cpu_id) == 0x10) + * If the kernel is running on a virtual machine, then it must assume + * that MCA is enabled by the hypervisor. Moreover, the kernel must + * be prepared for the hypervisor changing the vendor and family that + * are reported by CPUID. Consequently, the workaround for AMD Family + * 10h Erratum 383 is enabled if the processor's feature set does not + * include at least one feature that is only supported by older Intel + * or newer AMD processors. + */ + if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 && + (cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI | + CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP | + AMDID2_FMA4)) == 0) workaround_erratum383 = 1; /* Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Tue May 6 23:28:48 2014 (r265475) +++ stable/10/sys/i386/i386/pmap.c Wed May 7 00:32:49 2014 (r265476) @@ -752,12 +752,18 @@ pmap_init(void) pv_entry_high_water = 9 * (pv_entry_max / 10); /* - * If the kernel is running in a virtual machine on an AMD Family 10h - * processor, then it must assume that MCA is enabled by the virtual - * machine monitor. - */ - if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD && - CPUID_TO_FAMILY(cpu_id) == 0x10) + * If the kernel is running on a virtual machine, then it must assume + * that MCA is enabled by the hypervisor. Moreover, the kernel must + * be prepared for the hypervisor changing the vendor and family that + * are reported by CPUID. Consequently, the workaround for AMD Family + * 10h Erratum 383 is enabled if the processor's feature set does not + * include at least one feature that is only supported by older Intel + * or newer AMD processors. + */ + if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 && + (cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI | + CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP | + AMDID2_FMA4)) == 0) workaround_erratum383 = 1; /* From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:10:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2281E6D9; Wed, 7 May 2014 06: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 0F13787C; Wed, 7 May 2014 06: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 s476Atn3079039; Wed, 7 May 2014 06:10:55 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476AtvH079038; Wed, 7 May 2014 06:10:55 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070610.s476AtvH079038@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265487 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:10:56 -0000 Author: trasz Date: Wed May 7 06:10:55 2014 New Revision: 265487 URL: http://svnweb.freebsd.org/changeset/base/265487 Log: MFC r263742: Fix harmless warning after reconnecting a session and not doing anything with it. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 05:28:23 2014 (r265486) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 06:10:55 2014 (r265487) @@ -1280,8 +1280,8 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ is->is_conn->ic_data_crc32c = false; is->is_cmdsn = 0; - is->is_expcmdsn = 1; - is->is_maxcmdsn = 1; + is->is_expcmdsn = 0; + is->is_maxcmdsn = 0; is->is_waiting_for_iscsid = false; is->is_login_phase = false; is->is_timeout = 0; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:13:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A5A82820; Wed, 7 May 2014 06:13: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 785C289C; Wed, 7 May 2014 06:13: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 s476D0Uu082437; Wed, 7 May 2014 06:13:00 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476D0CJ082435; Wed, 7 May 2014 06:13:00 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070613.s476D0CJ082435@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265488 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:13:00 -0000 Author: trasz Date: Wed May 7 06:12:59 2014 New Revision: 265488 URL: http://svnweb.freebsd.org/changeset/base/265488 Log: MFC r263743: Move the ic_outstanding_count under #ifdef DIAGNOSTIC. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/icl.c stable/10/sys/dev/iscsi/icl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 06:10:55 2014 (r265487) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 06:12:59 2014 (r265488) @@ -135,11 +135,15 @@ icl_pdu_new(struct icl_conn *ic, int fla { struct icl_pdu *ip; +#ifdef DIAGNOSTIC refcount_acquire(&ic->ic_outstanding_pdus); +#endif ip = uma_zalloc(icl_pdu_zone, flags | M_ZERO); if (ip == NULL) { ICL_WARN("failed to allocate %zd bytes", sizeof(*ip)); +#ifdef DIAGNOSTIC refcount_release(&ic->ic_outstanding_pdus); +#endif return (NULL); } @@ -159,7 +163,9 @@ icl_pdu_free(struct icl_pdu *ip) m_freem(ip->ip_ahs_mbuf); m_freem(ip->ip_data_mbuf); uma_zfree(icl_pdu_zone, ip); +#ifdef DIAGNOSTIC refcount_release(&ic->ic_outstanding_pdus); +#endif } /* @@ -977,7 +983,9 @@ icl_conn_new(void) mtx_init(&ic->ic_lock, "icl_lock", NULL, MTX_DEF); cv_init(&ic->ic_send_cv, "icl_tx"); cv_init(&ic->ic_receive_cv, "icl_rx"); +#ifdef DIAGNOSTIC refcount_init(&ic->ic_outstanding_pdus, 0); +#endif ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH; return (ic); Modified: stable/10/sys/dev/iscsi/icl.h ============================================================================== --- stable/10/sys/dev/iscsi/icl.h Wed May 7 06:10:55 2014 (r265487) +++ stable/10/sys/dev/iscsi/icl.h Wed May 7 06:12:59 2014 (r265488) @@ -76,7 +76,9 @@ void icl_pdu_free(struct icl_pdu *ip); struct icl_conn { struct mtx ic_lock; struct socket *ic_socket; +#ifdef DIAGNOSTIC volatile u_int ic_outstanding_pdus; +#endif TAILQ_HEAD(, icl_pdu) ic_to_send; size_t ic_receive_len; int ic_receive_state; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:14:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 55DF7957; Wed, 7 May 2014 06:14: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 426DB8A5; Wed, 7 May 2014 06:14: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 s476Eg36082718; Wed, 7 May 2014 06:14:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476EgNu082717; Wed, 7 May 2014 06:14:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070614.s476EgNu082717@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265489 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:14:42 -0000 Author: trasz Date: Wed May 7 06:14:41 2014 New Revision: 265489 URL: http://svnweb.freebsd.org/changeset/base/265489 Log: MFC r263745: Target Transfer Tag is opaque; no need to htonl(3) it. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:12:59 2014 (r265488) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:14:41 2014 (r265489) @@ -2488,7 +2488,7 @@ cfiscsi_datamove_out(union ctl_io *io) return; } cdw->cdw_ctl_io = io; - cdw->cdw_target_transfer_tag = htonl(target_transfer_tag); + cdw->cdw_target_transfer_tag = target_transfer_tag; cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; if (cs->cs_immediate_data && icl_pdu_data_segment_length(request) > 0) { @@ -2528,7 +2528,7 @@ cfiscsi_datamove_out(union ctl_io *io) bhsr2t->bhsr2t_flags = 0x80; bhsr2t->bhsr2t_lun = bhssc->bhssc_lun; bhsr2t->bhsr2t_initiator_task_tag = bhssc->bhssc_initiator_task_tag; - bhsr2t->bhsr2t_target_transfer_tag = htonl(target_transfer_tag); + bhsr2t->bhsr2t_target_transfer_tag = target_transfer_tag; /* * XXX: Here we assume that cfiscsi_datamove() won't ever * be running concurrently on several CPUs for a given From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:18:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C9505B92; Wed, 7 May 2014 06:18: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 B61088C7; Wed, 7 May 2014 06:18: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 s476I3x1083435; Wed, 7 May 2014 06:18:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476I3VL083434; Wed, 7 May 2014 06:18:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070618.s476I3VL083434@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265490 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:18:04 -0000 Author: trasz Date: Wed May 7 06:18:03 2014 New Revision: 265490 URL: http://svnweb.freebsd.org/changeset/base/265490 Log: MFC r263810: Rework cfiscsi_datamove_in() to obey expected data transfer length received from the initiator. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:14:41 2014 (r265489) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:18:03 2014 (r265490) @@ -2303,8 +2303,8 @@ cfiscsi_datamove_in(union ctl_io *io) const struct iscsi_bhs_scsi_command *bhssc; struct iscsi_bhs_data_in *bhsdi; struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; - size_t copy_len, len, off; - const char *addr; + size_t len, expected_len, sg_len, buffer_offset; + const char *sg_addr; int ctl_sg_count, error, i; request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; @@ -2326,26 +2326,49 @@ cfiscsi_datamove_in(union ctl_io *io) } /* - * We need to record it so that we can properly report + * This is the total amount of data to be transferred within the current + * SCSI command. We need to record it so that we can properly report * underflow/underflow. */ PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; /* - * This is the offset within the current SCSI command; - * i.e. for the first call of datamove(), it will be 0, - * and for subsequent ones it will be the sum of lengths - * of previous ones. + * This is the offset within the current SCSI command; for the first + * call to cfiscsi_datamove() it will be 0, and for subsequent ones + * it will be the sum of lengths of previous ones. It's being + * incremented as we append data to the data segment. */ - off = htonl(io->scsiio.kern_rel_offset); + buffer_offset = io->scsiio.kern_rel_offset; + + /* + * This is the transfer length expected by the initiator. In theory, + * it could be different from the correct amount of data from the SCSI + * point of view, even if that doesn't make any sense. + */ + expected_len = ntohl(bhssc->bhssc_expected_data_transfer_length); +#if 0 + if (expected_len != io->scsiio.kern_total_len) + CFISCSI_SESSION_DEBUG(cs, "expected transfer length = %zd, " + "actual length = %zd", expected_len, + io->scsiio.kern_total_len); +#endif + + if (buffer_offset >= expected_len) { +#if 0 + CFISCSI_SESSION_DEBUG(cs, "buffer_offset = %zd, " + "already sent the expected len", buffer_offset); +#endif + io->scsiio.ext_data_filled = io->scsiio.kern_total_len; + io->scsiio.be_move_done(io); + return; + } i = 0; - addr = NULL; - len = 0; + sg_addr = NULL; + sg_len = 0; response = NULL; bhsdi = NULL; for (;;) { - KASSERT(i < ctl_sg_count, ("i >= ctl_sg_count")); if (response == NULL) { response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { @@ -2362,22 +2385,43 @@ cfiscsi_datamove_in(union ctl_io *io) bhssc->bhssc_initiator_task_tag; bhsdi->bhsdi_datasn = htonl(PDU_EXPDATASN(request)); PDU_EXPDATASN(request)++; - bhsdi->bhsdi_buffer_offset = htonl(off); + bhsdi->bhsdi_buffer_offset = htonl(buffer_offset); } - if (len == 0) { - addr = ctl_sglist[i].addr; - len = ctl_sglist[i].len; - KASSERT(len > 0, ("len <= 0")); + KASSERT(i < ctl_sg_count, ("i >= ctl_sg_count")); + if (sg_len == 0) { + sg_addr = ctl_sglist[i].addr; + sg_len = ctl_sglist[i].len; + KASSERT(sg_len > 0, ("sg_len <= 0")); } - copy_len = len; - if (response->ip_data_len + copy_len > + len = sg_len; + + /* + * Truncate to maximum data segment length. + */ + KASSERT(response->ip_data_len < cs->cs_max_data_segment_length, + ("max_data_segment_length %zd >= ip_data_len %zd", + response->ip_data_len, cs->cs_max_data_segment_length)); + if (response->ip_data_len + len > cs->cs_max_data_segment_length) - copy_len = cs->cs_max_data_segment_length - + len = cs->cs_max_data_segment_length - response->ip_data_len; - KASSERT(copy_len <= len, ("copy_len > len")); - error = icl_pdu_append_data(response, addr, copy_len, M_NOWAIT); + + /* + * Truncate to expected data transfer length. + */ + KASSERT(buffer_offset + response->ip_data_len < expected_len, + ("%zd >= %zd", buffer_offset + response->ip_data_len, expected_len)); + if (buffer_offset + response->ip_data_len + len > expected_len) { + CFISCSI_SESSION_DEBUG(cs, "truncating from %zd " + "to expected data transfer length %zd", + buffer_offset + response->ip_data_len + len, expected_len); + len = expected_len - (buffer_offset + response->ip_data_len); + } + + KASSERT(len <= sg_len, ("len > sg_len")); + error = icl_pdu_append_data(response, sg_addr, len, M_NOWAIT); if (error != 0) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); @@ -2387,12 +2431,19 @@ cfiscsi_datamove_in(union ctl_io *io) cfiscsi_session_terminate(cs); return; } - addr += copy_len; - len -= copy_len; - off += copy_len; - io->scsiio.ext_data_filled += copy_len; + sg_addr += len; + sg_len -= len; + buffer_offset += len; + io->scsiio.ext_data_filled += len; + + if (buffer_offset == expected_len) { + /* + * Already have the amount of data the initiator wanted. + */ + break; + } - if (len == 0) { + if (sg_len == 0) { /* * End of scatter-gather segment; * proceed to the next one... @@ -2415,27 +2466,18 @@ cfiscsi_datamove_in(union ctl_io *io) * call to cfiscsi_datamove(), and we want * to set the F flag only on the last of them. */ - if (off == io->scsiio.kern_total_len) + if (buffer_offset == io->scsiio.kern_total_len || + buffer_offset == expected_len) bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; - KASSERT(response->ip_data_len > 0, - ("sending empty Data-In")); cfiscsi_pdu_queue(response); response = NULL; bhsdi = NULL; } } - KASSERT(i == ctl_sg_count - 1, ("missed SG segment")); - KASSERT(len == 0, ("missed data from SG segment")); if (response != NULL) { - if (off == io->scsiio.kern_total_len) { + if (buffer_offset == io->scsiio.kern_total_len || + buffer_offset == expected_len) bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; -#if 0 - } else { - CFISCSI_SESSION_DEBUG(cs, "not setting the F flag; " - "have %zd, need %zd", off, - (size_t)io->scsiio.kern_total_len); -#endif - } KASSERT(response->ip_data_len > 0, ("sending empty Data-In")); cfiscsi_pdu_queue(response); } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:20:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 26EACE56; Wed, 7 May 2014 06:20: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 080DA8FA; Wed, 7 May 2014 06:20: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 s476Ka41084385; Wed, 7 May 2014 06:20:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476Ka1r084377; Wed, 7 May 2014 06:20:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070620.s476Ka1r084377@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265491 - in stable/10/sys: cam/ctl conf modules/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:20:37 -0000 Author: trasz Date: Wed May 7 06:20:35 2014 New Revision: 265491 URL: http://svnweb.freebsd.org/changeset/base/265491 Log: MFC r263811: Remove ctl_mem_pool.{c,h}. Sponsored by: The FreeBSD Foundation Deleted: stable/10/sys/cam/ctl/ctl_mem_pool.c stable/10/sys/cam/ctl/ctl_mem_pool.h Modified: stable/10/sys/cam/ctl/README.ctl.txt stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_internal.c stable/10/sys/conf/files stable/10/sys/modules/ctl/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/README.ctl.txt ============================================================================== --- stable/10/sys/cam/ctl/README.ctl.txt Wed May 7 06:18:03 2014 (r265490) +++ stable/10/sys/cam/ctl/README.ctl.txt Wed May 7 06:20:35 2014 (r265491) @@ -394,14 +394,6 @@ ctl_ioctl.h: This defines all ioctls available through the CTL character device, and the data structures needed for those ioctls. -ctl_mem_pool.c -ctl_mem_pool.h: --------------- - -Generic memory pool implementation. This is currently only used by the -internal frontend. The internal frontend can probably be rewritten to use -UMA zones and this can be removed. - ctl_private.h: ------------- Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Wed May 7 06:18:03 2014 (r265490) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Wed May 7 06:20:35 2014 (r265491) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #define io_ptr spriv_ptr1 Modified: stable/10/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_internal.c Wed May 7 06:18:03 2014 (r265490) +++ stable/10/sys/cam/ctl/ctl_frontend_internal.c Wed May 7 06:20:35 2014 (r265491) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -73,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -118,7 +118,6 @@ struct cfi_metatask { cfi_tasktype tasktype; cfi_mt_status status; union cfi_taskinfo taskinfo; - struct ctl_mem_element *element; void *cfi_context; STAILQ_ENTRY(cfi_metatask) links; }; @@ -153,7 +152,6 @@ struct cfi_lun { int blocksize_powerof2; uint32_t cur_tag_num; cfi_lun_state state; - struct ctl_mem_element *element; struct cfi_softc *softc; STAILQ_HEAD(, cfi_lun_io) io_list; STAILQ_ENTRY(cfi_lun) links; @@ -181,12 +179,13 @@ struct cfi_softc { cfi_flags flags; STAILQ_HEAD(, cfi_lun) lun_list; STAILQ_HEAD(, cfi_metatask) metatask_list; - struct ctl_mem_pool lun_pool; - struct ctl_mem_pool metatask_pool; }; MALLOC_DEFINE(M_CTL_CFI, "ctlcfi", "CTL CFI"); +static uma_zone_t cfi_lun_zone; +static uma_zone_t cfi_metatask_zone; + static struct cfi_softc fetd_internal_softc; int cfi_init(void); @@ -275,48 +274,15 @@ cfi_init(void) if (ctl_frontend_register(fe, (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) { printf("%s: internal frontend registration failed\n", __func__); - retval = 1; - goto bailout; + return (0); } - if (ctl_init_mem_pool(&softc->lun_pool, - sizeof(struct cfi_lun), - CTL_MEM_POOL_PERM_GROW, /*grow_inc*/ 3, - /* initial_pool_size */ CTL_MAX_LUNS) != 0) { - printf("%s: can't initialize LUN memory pool\n", __func__); - retval = 1; - goto bailout_error; - } - - if (ctl_init_mem_pool(&softc->metatask_pool, - sizeof(struct cfi_metatask), - CTL_MEM_POOL_PERM_GROW, /*grow_inc*/ 3, - /*initial_pool_size*/ 10) != 0) { - printf("%s: can't initialize metatask memory pool\n", __func__); - retval = 2; - goto bailout_error; - } -bailout: + cfi_lun_zone = uma_zcreate("cfi_lun", sizeof(struct cfi_lun), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + cfi_metatask_zone = uma_zcreate("cfi_metatask", sizeof(struct cfi_metatask), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); return (0); - -bailout_error: - - switch (retval) { - case 3: - ctl_shrink_mem_pool(&softc->metatask_pool); - /* FALLTHROUGH */ - case 2: - ctl_shrink_mem_pool(&softc->lun_pool); - /* FALLTHROUGH */ - case 1: - ctl_frontend_deregister(fe); - break; - default: - break; - } - - return (ENOMEM); } void @@ -332,11 +298,8 @@ cfi_shutdown(void) if (ctl_frontend_deregister(&softc->fe) != 0) printf("%s: ctl_frontend_deregister() failed\n", __func__); - if (ctl_shrink_mem_pool(&softc->lun_pool) != 0) - printf("%s: error shrinking LUN pool\n", __func__); - - if (ctl_shrink_mem_pool(&softc->metatask_pool) != 0) - printf("%s: error shrinking LUN pool\n", __func__); + uma_zdestroy(cfi_lun_zone); + uma_zdestroy(cfi_metatask_zone); } static int @@ -398,7 +361,6 @@ cfi_targ_disable(void *arg, struct ctl_i static int cfi_lun_enable(void *arg, struct ctl_id target_id, int lun_id) { - struct ctl_mem_element *element; struct cfi_softc *softc; struct cfi_lun *lun; int found; @@ -423,16 +385,12 @@ cfi_lun_enable(void *arg, struct ctl_id if (found != 0) return (0); - element = ctl_alloc_mem_element(&softc->lun_pool, /*can_wait*/ 0); - - if (element == NULL) { + lun = uma_zalloc(cfi_lun_zone, M_NOWAIT | M_ZERO); + if (lun == NULL) { printf("%s: unable to allocate LUN structure\n", __func__); return (1); } - lun = (struct cfi_lun *)element->bytes; - - lun->element = element; lun->target_id = target_id; lun->lun_id = lun_id; lun->cur_tag_num = 0; @@ -485,7 +443,7 @@ cfi_lun_disable(void *arg, struct ctl_id return (1); } - ctl_free_mem_element(lun->element); + uma_zfree(cfi_lun_zone, lun); return (0); } @@ -1682,106 +1640,20 @@ cfi_action(struct cfi_metatask *metatask } } -#ifdef oldapi -void -cfi_shutdown_shelf(cfi_cb_t callback, void *callback_arg) -{ - struct ctl_mem_element *element; - struct cfi_softc *softc; - struct cfi_metatask *metatask; - - softc = &fetd_internal_softc; - - element = ctl_alloc_mem_element(&softc->metatask_pool, /*can_wait*/ 0); - if (element == NULL) { - callback(callback_arg, - /*status*/ CFI_MT_ERROR, - /*sluns_found*/ 0, - /*sluns_complete*/ 0, - /*sluns_failed*/ 0); - return; - } - - metatask = (struct cfi_metatask *)element->bytes; - - memset(metatask, 0, sizeof(*metatask)); - metatask->tasktype = CFI_TASK_SHUTDOWN; - metatask->status = CFI_MT_NONE; - metatask->taskinfo.startstop.callback = callback; - metatask->taskinfo.startstop.callback_arg = callback_arg; - metatask->element = element; - - cfi_action(softc, metatask); - - /* - * - send a report luns to lun 0, get LUN list. - * - send an inquiry to each lun - * - send a stop/offline to each direct access LUN - * - if we get a reservation conflict, reset the LUN and then - * retry sending the stop/offline - * - return status back to the caller - */ -} - -void -cfi_start_shelf(cfi_cb_t callback, void *callback_arg) -{ - struct ctl_mem_element *element; - struct cfi_softc *softc; - struct cfi_metatask *metatask; - - softc = &fetd_internal_softc; - - element = ctl_alloc_mem_element(&softc->metatask_pool, /*can_wait*/ 0); - if (element == NULL) { - callback(callback_arg, - /*status*/ CFI_MT_ERROR, - /*sluns_found*/ 0, - /*sluns_complete*/ 0, - /*sluns_failed*/ 0); - return; - } - - metatask = (struct cfi_metatask *)element->bytes; - - memset(metatask, 0, sizeof(*metatask)); - metatask->tasktype = CFI_TASK_STARTUP; - metatask->status = CFI_MT_NONE; - metatask->taskinfo.startstop.callback = callback; - metatask->taskinfo.startstop.callback_arg = callback_arg; - metatask->element = element; - - cfi_action(softc, metatask); - - /* - * - send a report luns to lun 0, get LUN list. - * - send an inquiry to each lun - * - send a stop/offline to each direct access LUN - * - if we get a reservation conflict, reset the LUN and then - * retry sending the stop/offline - * - return status back to the caller - */ -} - -#endif - struct cfi_metatask * cfi_alloc_metatask(int can_wait) { - struct ctl_mem_element *element; struct cfi_metatask *metatask; struct cfi_softc *softc; softc = &fetd_internal_softc; - element = ctl_alloc_mem_element(&softc->metatask_pool, can_wait); - if (element == NULL) + metatask = uma_zalloc(cfi_metatask_zone, + (can_wait ? M_WAITOK : M_NOWAIT) | M_ZERO); + if (metatask == NULL) return (NULL); - metatask = (struct cfi_metatask *)element->bytes; - memset(metatask, 0, sizeof(*metatask)); metatask->status = CFI_MT_NONE; - metatask->element = element; return (metatask); } @@ -1789,7 +1661,8 @@ cfi_alloc_metatask(int can_wait) void cfi_free_metatask(struct cfi_metatask *metatask) { - ctl_free_mem_element(metatask->element); + + uma_zfree(cfi_metatask_zone, metatask); } /* Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Wed May 7 06:18:03 2014 (r265490) +++ stable/10/sys/conf/files Wed May 7 06:20:35 2014 (r265491) @@ -125,7 +125,6 @@ cam/ctl/ctl_frontend.c optional ctl cam/ctl/ctl_frontend_cam_sim.c optional ctl cam/ctl/ctl_frontend_internal.c optional ctl cam/ctl/ctl_frontend_iscsi.c optional ctl -cam/ctl/ctl_mem_pool.c optional ctl cam/ctl/ctl_scsi_all.c optional ctl cam/ctl/ctl_error.c optional ctl cam/ctl/ctl_util.c optional ctl Modified: stable/10/sys/modules/ctl/Makefile ============================================================================== --- stable/10/sys/modules/ctl/Makefile Wed May 7 06:18:03 2014 (r265490) +++ stable/10/sys/modules/ctl/Makefile Wed May 7 06:20:35 2014 (r265491) @@ -13,7 +13,6 @@ SRCS+= ctl_frontend.c SRCS+= ctl_frontend_cam_sim.c SRCS+= ctl_frontend_internal.c SRCS+= ctl_frontend_iscsi.c -SRCS+= ctl_mem_pool.c SRCS+= ctl_scsi_all.c SRCS+= ctl_error.c SRCS+= ctl_util.c From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:22:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A0F2F9D; Wed, 7 May 2014 06:22: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 8D7A198E; Wed, 7 May 2014 06:22: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 s476MpTb087211; Wed, 7 May 2014 06:22:51 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476MpJk087210; Wed, 7 May 2014 06:22:51 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070622.s476MpJk087210@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265492 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:22:51 -0000 Author: trasz Date: Wed May 7 06:22:51 2014 New Revision: 265492 URL: http://svnweb.freebsd.org/changeset/base/265492 Log: MFC r263978: Make it possible to have multiple CTL worker threads. Leave the default of 1 for now. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed May 7 06:20:35 2014 (r265491) +++ stable/10/sys/cam/ctl/ctl.c Wed May 7 06:22:51 2014 (r265492) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -320,6 +321,10 @@ static int ctl_is_single = 1; static int index_to_aps_page; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); +static int worker_threads = 1; +TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads); +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN, + &worker_threads, 1, "Number of worker threads"); /* * Serial number (0x80), device id (0x83), and supported pages (0x00) @@ -950,10 +955,7 @@ ctl_init(void) struct ctl_frontend *fe; struct ctl_lun *lun; uint8_t sc_id =0; -#if 0 - int i; -#endif - int error, retval; + int i, error, retval; //int isc_retval; retval = 0; @@ -1085,17 +1087,35 @@ ctl_init(void) mtx_unlock(&softc->ctl_lock); #endif - error = kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, - "ctl_thrd"); - if (error != 0) { - printf("error creating CTL work thread!\n"); - mtx_lock(&softc->ctl_lock); - ctl_free_lun(lun); - mtx_unlock(&softc->ctl_lock); - ctl_pool_free(internal_pool); - ctl_pool_free(emergency_pool); - ctl_pool_free(other_pool); - return (error); + if (worker_threads > MAXCPU || worker_threads == 0) { + printf("invalid kern.cam.ctl.worker_threads value; " + "setting to 1"); + worker_threads = 1; + } else if (worker_threads < 0) { + if (mp_ncpus > 2) { + /* + * Using more than two worker threads actually hurts + * performance due to lock contention. + */ + worker_threads = 2; + } else { + worker_threads = 1; + } + } + + for (i = 0; i < worker_threads; i++) { + error = kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, + "ctl_thrd%d", i); + if (error != 0) { + printf("error creating CTL work thread!\n"); + mtx_lock(&softc->ctl_lock); + ctl_free_lun(lun); + mtx_unlock(&softc->ctl_lock); + ctl_pool_free(internal_pool); + ctl_pool_free(emergency_pool); + ctl_pool_free(other_pool); + return (error); + } } if (bootverbose) printf("ctl: CAM Target Layer loaded\n"); @@ -12993,7 +13013,11 @@ ctl_work_thread(void *arg) if (io != NULL) { STAILQ_REMOVE_HEAD(&softc->rtr_queue, links); mtx_unlock(&softc->ctl_lock); - goto execute; + retval = ctl_scsiio(&io->scsiio); + if (retval != CTL_RETVAL_COMPLETE) + CTL_DEBUG_PRINT(("ctl_scsiio failed\n")); + mtx_lock(&softc->ctl_lock); + continue; } } io = (union ctl_io *)STAILQ_FIRST(&softc->incoming_queue); @@ -13024,19 +13048,6 @@ ctl_work_thread(void *arg) /* Back to the top of the loop to see what woke us up. */ continue; - -execute: - retval = ctl_scsiio(&io->scsiio); - switch (retval) { - case CTL_RETVAL_COMPLETE: - break; - default: - /* - * Probably need to make sure this doesn't happen. - */ - break; - } - mtx_lock(&softc->ctl_lock); } } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:24:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 298F1243; Wed, 7 May 2014 06:24: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 EF7AF9A6; Wed, 7 May 2014 06:24: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 s476OknH087514; Wed, 7 May 2014 06:24:46 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476OkC3087513; Wed, 7 May 2014 06:24:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070624.s476OkC3087513@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265493 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:24:47 -0000 Author: trasz Date: Wed May 7 06:24:46 2014 New Revision: 265493 URL: http://svnweb.freebsd.org/changeset/base/265493 Log: MFC r263979: Hide CTL messages about SCSI error responses. Too many users take them for actual target errors. They can be enabled back by setting kern.cam.ctl.verbose=1, or booting with bootverbose. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed May 7 06:22:51 2014 (r265492) +++ stable/10/sys/cam/ctl/ctl.c Wed May 7 06:24:46 2014 (r265493) @@ -325,6 +325,10 @@ static int worker_threads = 1; TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads); SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN, &worker_threads, 1, "Number of worker threads"); +static int verbose = 0; +TUNABLE_INT("kern.cam.ctl.verbose", &verbose); +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verbose, CTLFLAG_RWTUN, + &verbose, 0, "Show SCSI errors returned to initiator"); /* * Serial number (0x80), device id (0x83), and supported pages (0x00) @@ -12351,7 +12355,8 @@ ctl_process_done(union ctl_io *io, int h case CTL_IO_SCSI: break; case CTL_IO_TASK: - ctl_io_error_print(io, NULL); + if (bootverbose || verbose > 0) + ctl_io_error_print(io, NULL); if (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) ctl_free_io(io); else @@ -12607,7 +12612,8 @@ ctl_process_done(union ctl_io *io, int h "skipped", skipped_prints); #endif } - ctl_io_error_print(io, NULL); + if (bootverbose || verbose > 0) + ctl_io_error_print(io, NULL); } } else { if (have_lock == 0) @@ -12618,7 +12624,8 @@ ctl_process_done(union ctl_io *io, int h case CTL_IO_TASK: if (have_lock == 0) mtx_unlock(&ctl_softc->ctl_lock); - ctl_io_error_print(io, NULL); + if (bootverbose || verbose > 0) + ctl_io_error_print(io, NULL); break; default: if (have_lock == 0) From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:26:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C9991421; Wed, 7 May 2014 06:26: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 A927C9CC; Wed, 7 May 2014 06:26: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 s476QYQh087821; Wed, 7 May 2014 06:26:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476QYoX087820; Wed, 7 May 2014 06:26:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070626.s476QYoX087820@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265494 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:26:35 -0000 Author: trasz Date: Wed May 7 06:26:34 2014 New Revision: 265494 URL: http://svnweb.freebsd.org/changeset/base/265494 Log: MFC r264020: Remove the homegrown ctl_be_block_io allocator, replacing it with UMA. There is no performance difference. Reviewed by: mav@ Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Wed May 7 06:24:46 2014 (r265493) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Wed May 7 06:26:34 2014 (r265494) @@ -177,9 +177,7 @@ struct ctl_be_block_lun { * Overall softc structure for the block backend module. */ struct ctl_be_block_softc { - STAILQ_HEAD(, ctl_be_block_io) beio_free_queue; struct mtx lock; - int prealloc_beio; int num_disks; STAILQ_HEAD(, ctl_block_disk) disk_list; int num_luns; @@ -209,7 +207,6 @@ struct ctl_be_block_io { uint64_t io_offset; struct ctl_be_block_softc *softc; struct ctl_be_block_lun *lun; - STAILQ_ENTRY(ctl_be_block_io) links; }; static int cbb_num_threads = 14; @@ -221,10 +218,6 @@ SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO static struct ctl_be_block_io *ctl_alloc_beio(struct ctl_be_block_softc *softc); static void ctl_free_beio(struct ctl_be_block_io *beio); -static int ctl_grow_beio(struct ctl_be_block_softc *softc, int count); -#if 0 -static void ctl_shrink_beio(struct ctl_be_block_softc *softc); -#endif static void ctl_complete_beio(struct ctl_be_block_io *beio); static int ctl_be_block_move_done(union ctl_io *io); static void ctl_be_block_biodone(struct bio *bio); @@ -286,68 +279,24 @@ static struct ctl_backend_driver ctl_be_ MALLOC_DEFINE(M_CTLBLK, "ctlblk", "Memory used for CTL block backend"); CTL_BACKEND_DECLARE(cbb, ctl_be_block_driver); +static uma_zone_t beio_zone; + static struct ctl_be_block_io * ctl_alloc_beio(struct ctl_be_block_softc *softc) { struct ctl_be_block_io *beio; - int count; - - mtx_lock(&softc->lock); - - beio = STAILQ_FIRST(&softc->beio_free_queue); - if (beio != NULL) { - STAILQ_REMOVE(&softc->beio_free_queue, beio, - ctl_be_block_io, links); - } - mtx_unlock(&softc->lock); - - if (beio != NULL) { - bzero(beio, sizeof(*beio)); - beio->softc = softc; - return (beio); - } - - for (;;) { - - count = ctl_grow_beio(softc, /*count*/ 10); - - /* - * This shouldn't be possible, since ctl_grow_beio() uses a - * blocking malloc. - */ - if (count == 0) - return (NULL); - - /* - * Since we have to drop the lock when we're allocating beio - * structures, it's possible someone else can come along and - * allocate the beio's we've just allocated. - */ - mtx_lock(&softc->lock); - beio = STAILQ_FIRST(&softc->beio_free_queue); - if (beio != NULL) { - STAILQ_REMOVE(&softc->beio_free_queue, beio, - ctl_be_block_io, links); - } - mtx_unlock(&softc->lock); - if (beio != NULL) { - bzero(beio, sizeof(*beio)); - beio->softc = softc; - break; - } - } + beio = uma_zalloc(beio_zone, M_WAITOK | M_ZERO); + beio->softc = softc; return (beio); } static void ctl_free_beio(struct ctl_be_block_io *beio) { - struct ctl_be_block_softc *softc; int duplicate_free; int i; - softc = beio->softc; duplicate_free = 0; for (i = 0; i < beio->num_segs; i++) { @@ -362,47 +311,10 @@ ctl_free_beio(struct ctl_be_block_io *be printf("%s: %d duplicate frees out of %d segments\n", __func__, duplicate_free, beio->num_segs); } - mtx_lock(&softc->lock); - STAILQ_INSERT_TAIL(&softc->beio_free_queue, beio, links); - mtx_unlock(&softc->lock); -} -static int -ctl_grow_beio(struct ctl_be_block_softc *softc, int count) -{ - int i; - - for (i = 0; i < count; i++) { - struct ctl_be_block_io *beio; - - beio = (struct ctl_be_block_io *)malloc(sizeof(*beio), - M_CTLBLK, - M_WAITOK | M_ZERO); - beio->softc = softc; - mtx_lock(&softc->lock); - STAILQ_INSERT_TAIL(&softc->beio_free_queue, beio, links); - mtx_unlock(&softc->lock); - } - - return (i); + uma_zfree(beio_zone, beio); } -#if 0 -static void -ctl_shrink_beio(struct ctl_be_block_softc *softc) -{ - struct ctl_be_block_io *beio, *beio_tmp; - - mtx_lock(&softc->lock); - STAILQ_FOREACH_SAFE(beio, &softc->beio_free_queue, links, beio_tmp) { - STAILQ_REMOVE(&softc->beio_free_queue, beio, - ctl_be_block_io, links); - free(beio, M_CTLBLK); - } - mtx_unlock(&softc->lock); -} -#endif - static void ctl_complete_beio(struct ctl_be_block_io *beio) { @@ -937,16 +849,7 @@ ctl_be_block_cw_dispatch(struct ctl_be_b softc = be_lun->softc; beio = ctl_alloc_beio(softc); - if (beio == NULL) { - /* - * This should not happen. ctl_alloc_beio() will call - * ctl_grow_beio() with a blocking malloc as needed. - * A malloc with M_WAITOK should not fail. - */ - ctl_set_busy(&io->scsiio); - ctl_done(io); - return; - } + KASSERT(beio != NULL, ("ctl_alloc_beio() failed")); beio->io = io; beio->softc = softc; @@ -1017,16 +920,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc } beio = ctl_alloc_beio(softc); - if (beio == NULL) { - /* - * This should not happen. ctl_alloc_beio() will call - * ctl_grow_beio() with a blocking malloc as needed. - * A malloc with M_WAITOK should not fail. - */ - ctl_set_busy(&io->scsiio); - ctl_done(io); - return; - } + KASSERT(beio != NULL, ("ctl_alloc_beio() failed")); beio->io = io; beio->softc = softc; @@ -2369,10 +2263,10 @@ ctl_be_block_init(void) retval = 0; mtx_init(&softc->lock, "ctlblk", NULL, MTX_DEF); - STAILQ_INIT(&softc->beio_free_queue); + beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); STAILQ_INIT(&softc->disk_list); STAILQ_INIT(&softc->lun_list); - ctl_grow_beio(softc, 200); return (retval); } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:29:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E9B38630; Wed, 7 May 2014 06:29: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 C8C359E7; Wed, 7 May 2014 06:29: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 s476T2c9088191; Wed, 7 May 2014 06:29:02 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476T2OB088186; Wed, 7 May 2014 06:29:02 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070629.s476T2OB088186@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265495 - in stable/10/sys: cam/ctl dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:29:03 -0000 Author: trasz Date: Wed May 7 06:29:01 2014 New Revision: 265495 URL: http://svnweb.freebsd.org/changeset/base/265495 Log: MFC r264022: Get rid of ICL lock; use upper-layer (initiator or target) lock instead. This avoids extra locking in icl_pdu_queue(); the upper layer needs to call it while holding its own lock anyway, to avoid sending PDUs out of order. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/dev/iscsi/icl.c stable/10/sys/dev/iscsi/icl.h stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:26:34 2014 (r265494) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:29:01 2014 (r265495) @@ -1206,7 +1206,7 @@ cfiscsi_session_new(struct cfiscsi_softc cv_init(&cs->cs_login_cv, "cfiscsi_login"); #endif - cs->cs_conn = icl_conn_new(); + cs->cs_conn = icl_conn_new(&cs->cs_lock); cs->cs_conn->ic_receive = cfiscsi_receive_callback; cs->cs_conn->ic_error = cfiscsi_error_callback; cs->cs_conn->ic_prv0 = cs; Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 06:26:34 2014 (r265494) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 06:29:01 2014 (r265495) @@ -85,9 +85,10 @@ static volatile u_int icl_ncons; __func__, ## __VA_ARGS__); \ } while (0) -#define ICL_CONN_LOCK(X) mtx_lock(&X->ic_lock) -#define ICL_CONN_UNLOCK(X) mtx_unlock(&X->ic_lock) -#define ICL_CONN_LOCK_ASSERT(X) mtx_assert(&X->ic_lock, MA_OWNED) +#define ICL_CONN_LOCK(X) mtx_lock(X->ic_lock) +#define ICL_CONN_UNLOCK(X) mtx_unlock(X->ic_lock) +#define ICL_CONN_LOCK_ASSERT(X) mtx_assert(X->ic_lock, MA_OWNED) +#define ICL_CONN_LOCK_ASSERT_NOT(X) mtx_assert(X->ic_lock, MA_NOTOWNED) static void icl_conn_fail(struct icl_conn *ic) @@ -893,7 +894,7 @@ icl_send_thread(void *arg) break; } icl_conn_send_pdus(ic); - cv_wait(&ic->ic_send_cv, &ic->ic_lock); + cv_wait(&ic->ic_send_cv, ic->ic_lock); } ic->ic_send_running = false; @@ -958,20 +959,19 @@ icl_pdu_queue(struct icl_pdu *ip) ic = ip->ip_conn; - ICL_CONN_LOCK(ic); + ICL_CONN_LOCK_ASSERT(ic); + if (ic->ic_disconnecting || ic->ic_socket == NULL) { ICL_DEBUG("icl_pdu_queue on closed connection"); - ICL_CONN_UNLOCK(ic); icl_pdu_free(ip); return; } TAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); - ICL_CONN_UNLOCK(ic); cv_signal(&ic->ic_send_cv); } struct icl_conn * -icl_conn_new(void) +icl_conn_new(struct mtx *lock) { struct icl_conn *ic; @@ -980,7 +980,7 @@ icl_conn_new(void) ic = uma_zalloc(icl_conn_zone, M_WAITOK | M_ZERO); TAILQ_INIT(&ic->ic_to_send); - mtx_init(&ic->ic_lock, "icl_lock", NULL, MTX_DEF); + ic->ic_lock = lock; cv_init(&ic->ic_send_cv, "icl_tx"); cv_init(&ic->ic_receive_cv, "icl_rx"); #ifdef DIAGNOSTIC @@ -995,7 +995,6 @@ void icl_conn_free(struct icl_conn *ic) { - mtx_destroy(&ic->ic_lock); cv_destroy(&ic->ic_send_cv); cv_destroy(&ic->ic_receive_cv); uma_zfree(icl_conn_zone, ic); @@ -1099,6 +1098,8 @@ icl_conn_handoff(struct icl_conn *ic, in cap_rights_t rights; int error; + ICL_CONN_LOCK_ASSERT_NOT(ic); + /* * Steal the socket from userland. */ @@ -1138,6 +1139,7 @@ icl_conn_handoff(struct icl_conn *ic, in void icl_conn_shutdown(struct icl_conn *ic) { + ICL_CONN_LOCK_ASSERT_NOT(ic); ICL_CONN_LOCK(ic); if (ic->ic_socket == NULL) { @@ -1154,6 +1156,8 @@ icl_conn_close(struct icl_conn *ic) { struct icl_pdu *pdu; + ICL_CONN_LOCK_ASSERT_NOT(ic); + ICL_CONN_LOCK(ic); if (ic->ic_socket == NULL) { ICL_CONN_UNLOCK(ic); @@ -1211,6 +1215,7 @@ icl_conn_close(struct icl_conn *ic) bool icl_conn_connected(struct icl_conn *ic) { + ICL_CONN_LOCK_ASSERT_NOT(ic); ICL_CONN_LOCK(ic); if (ic->ic_socket == NULL) { @@ -1231,6 +1236,8 @@ icl_conn_handoff_sock(struct icl_conn *i { int error; + ICL_CONN_LOCK_ASSERT_NOT(ic); + if (so->so_type != SOCK_STREAM) return (EINVAL); Modified: stable/10/sys/dev/iscsi/icl.h ============================================================================== --- stable/10/sys/dev/iscsi/icl.h Wed May 7 06:26:34 2014 (r265494) +++ stable/10/sys/dev/iscsi/icl.h Wed May 7 06:29:01 2014 (r265495) @@ -74,7 +74,7 @@ void icl_pdu_free(struct icl_pdu *ip); #define ICL_MAX_DATA_SEGMENT_LENGTH (128 * 1024) struct icl_conn { - struct mtx ic_lock; + struct mtx *ic_lock; struct socket *ic_socket; #ifdef DIAGNOSTIC volatile u_int ic_outstanding_pdus; @@ -102,7 +102,7 @@ struct icl_conn { void *ic_prv0; }; -struct icl_conn *icl_conn_new(void); +struct icl_conn *icl_conn_new(struct mtx *lock); void icl_conn_free(struct icl_conn *ic); int icl_conn_handoff(struct icl_conn *ic, int fd); void icl_conn_shutdown(struct icl_conn *ic); Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 06:26:34 2014 (r265494) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 06:29:01 2014 (r265495) @@ -1633,7 +1633,7 @@ iscsi_ioctl_session_add(struct iscsi_sof return (EBUSY); } - is->is_conn = icl_conn_new(); + is->is_conn = icl_conn_new(&is->is_lock); is->is_conn->ic_receive = iscsi_receive_callback; is->is_conn->ic_error = iscsi_error_callback; is->is_conn->ic_prv0 = is; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:31:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6EF999E4; Wed, 7 May 2014 06:31: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 5BAB3A83; Wed, 7 May 2014 06:31: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 s476Vkn4091661; Wed, 7 May 2014 06:31:46 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476Vj9q091657; Wed, 7 May 2014 06:31:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070631.s476Vj9q091657@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265496 - in stable/10/sys: cam/ctl dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:31:46 -0000 Author: trasz Date: Wed May 7 06:31:45 2014 New Revision: 265496 URL: http://svnweb.freebsd.org/changeset/base/265496 Log: MFC r264023: Instead of "icltx" and "iclrx", use thread names with prefix from upper layer, so that one can see which side of the stack the threads are for. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/dev/iscsi/icl.c stable/10/sys/dev/iscsi/icl.h stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:29:01 2014 (r265495) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:31:45 2014 (r265496) @@ -1206,7 +1206,7 @@ cfiscsi_session_new(struct cfiscsi_softc cv_init(&cs->cs_login_cv, "cfiscsi_login"); #endif - cs->cs_conn = icl_conn_new(&cs->cs_lock); + cs->cs_conn = icl_conn_new("cfiscsi", &cs->cs_lock); cs->cs_conn->ic_receive = cfiscsi_receive_callback; cs->cs_conn->ic_error = cfiscsi_error_callback; cs->cs_conn->ic_prv0 = cs; Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 06:29:01 2014 (r265495) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 06:31:45 2014 (r265496) @@ -971,7 +971,7 @@ icl_pdu_queue(struct icl_pdu *ip) } struct icl_conn * -icl_conn_new(struct mtx *lock) +icl_conn_new(const char *name, struct mtx *lock) { struct icl_conn *ic; @@ -987,6 +987,7 @@ icl_conn_new(struct mtx *lock) refcount_init(&ic->ic_outstanding_pdus, 0); #endif ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH; + ic->ic_name = name; return (ic); } @@ -1062,14 +1063,16 @@ icl_conn_start(struct icl_conn *ic) /* * Start threads. */ - error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "icltx"); + error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "%stx", + ic->ic_name); if (error != 0) { ICL_WARN("kthread_add(9) failed with error %d", error); icl_conn_close(ic); return (error); } - error = kthread_add(icl_receive_thread, ic, NULL, NULL, 0, 0, "iclrx"); + error = kthread_add(icl_receive_thread, ic, NULL, NULL, 0, 0, "%srx", + ic->ic_name); if (error != 0) { ICL_WARN("kthread_add(9) failed with error %d", error); icl_conn_close(ic); Modified: stable/10/sys/dev/iscsi/icl.h ============================================================================== --- stable/10/sys/dev/iscsi/icl.h Wed May 7 06:29:01 2014 (r265495) +++ stable/10/sys/dev/iscsi/icl.h Wed May 7 06:31:45 2014 (r265496) @@ -92,6 +92,7 @@ struct icl_conn { size_t ic_max_data_segment_length; bool ic_disconnecting; bool ic_iser; + const char *ic_name; void (*ic_receive)(struct icl_pdu *); void (*ic_error)(struct icl_conn *); @@ -102,7 +103,7 @@ struct icl_conn { void *ic_prv0; }; -struct icl_conn *icl_conn_new(struct mtx *lock); +struct icl_conn *icl_conn_new(const char *name, struct mtx *lock); void icl_conn_free(struct icl_conn *ic); int icl_conn_handoff(struct icl_conn *ic, int fd); void icl_conn_shutdown(struct icl_conn *ic); Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 06:29:01 2014 (r265495) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 06:31:45 2014 (r265496) @@ -1633,7 +1633,7 @@ iscsi_ioctl_session_add(struct iscsi_sof return (EBUSY); } - is->is_conn = icl_conn_new(&is->is_lock); + is->is_conn = icl_conn_new("iscsi", &is->is_lock); is->is_conn->ic_receive = iscsi_receive_callback; is->is_conn->ic_error = iscsi_error_callback; is->is_conn->ic_prv0 = is; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:34:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 007D8C19; Wed, 7 May 2014 06:34: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 E1A6CAA5; Wed, 7 May 2014 06:34: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 s476Y3uT092066; Wed, 7 May 2014 06:34:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476Y3Fc092065; Wed, 7 May 2014 06:34:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070634.s476Y3Fc092065@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265497 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:34:04 -0000 Author: trasz Date: Wed May 7 06:34:03 2014 New Revision: 265497 URL: http://svnweb.freebsd.org/changeset/base/265497 Log: MFC r264024: Use atomic ops instead of mutexes where appropriate. Submitted by: mav@ Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:31:45 2014 (r265496) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:34:03 2014 (r265497) @@ -958,9 +958,7 @@ cfiscsi_callout(void *context) callout_schedule(&cs->cs_callout, 1 * hz); - CFISCSI_SESSION_LOCK(cs); - cs->cs_timeout++; - CFISCSI_SESSION_UNLOCK(cs); + atomic_add_int(&cs->cs_timeout, 1); #ifdef ICL_KERNEL_PROXY if (cs->cs_waiting_for_ctld || cs->cs_login_phase) { @@ -2510,10 +2508,8 @@ cfiscsi_datamove_out(union ctl_io *io) */ PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; - CFISCSI_SESSION_LOCK(cs); - target_transfer_tag = cs->cs_target_transfer_tag; - cs->cs_target_transfer_tag++; - CFISCSI_SESSION_UNLOCK(cs); + target_transfer_tag = + atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1); #if 0 CFISCSI_SESSION_DEBUG(cs, "expecting Data-Out with initiator " From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:38:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6A3D7F1B; Wed, 7 May 2014 06:38: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 4B913AEF; Wed, 7 May 2014 06:38: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 s476cKdA092700; Wed, 7 May 2014 06:38:20 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476cK2J092699; Wed, 7 May 2014 06:38:20 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070638.s476cK2J092699@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265498 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:38:20 -0000 Author: trasz Date: Wed May 7 06:38:19 2014 New Revision: 265498 URL: http://svnweb.freebsd.org/changeset/base/265498 Log: MFC r264025: Get rid of the "autoscaling", instead just set socket buffer sizes in the usual way. The only thing the old code did was making things less predictable. MFC r264058: Fix build, broken by r264025. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/icl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 06:34:03 2014 (r265497) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 06:38:19 2014 (r265498) @@ -68,6 +68,14 @@ TUNABLE_INT("kern.icl.partial_receive_le SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RW, &partial_receive_len, 1 * 1024, "Minimum read size for partially received " "data segment"); +static int sendspace = 1048576; +TUNABLE_INT("kern.icl.sendspace", &sendspace); +SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RW, + &sendspace, 1048576, "Default send socket buffer size"); +static int recvspace = 1048576; +TUNABLE_INT("kern.icl.recvspace", &recvspace); +SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RW, + &recvspace, 1048576, "Default receive socket buffer size"); static uma_zone_t icl_conn_zone; static uma_zone_t icl_pdu_zone; @@ -1005,7 +1013,7 @@ icl_conn_free(struct icl_conn *ic) static int icl_conn_start(struct icl_conn *ic) { - size_t bufsize; + size_t minspace; struct sockopt opt; int error, one = 1; @@ -1026,18 +1034,28 @@ icl_conn_start(struct icl_conn *ic) ICL_CONN_UNLOCK(ic); /* - * Use max available sockbuf size for sending. Do it manually - * instead of sbreserve(9) to work around resource limits. + * For sendspace, this is required because the current code cannot + * send a PDU in pieces; thus, the minimum buffer size is equal + * to the maximum PDU size. "+4" is to account for possible padding. * - * XXX: This kind of sucks. On one hand, we don't currently support - * sending a part of data segment; we always do it in one piece, - * so we have to make sure it can fit in the socket buffer. - * Once I've implemented partial send, we'll get rid of this - * and use autoscaling. + * What we should actually do here is to use autoscaling, but set + * some minimal buffer size to "minspace". I don't know a way to do + * that, though. */ - bufsize = (sizeof(struct iscsi_bhs) + - ic->ic_max_data_segment_length) * 8; - error = soreserve(ic->ic_socket, bufsize, bufsize); + minspace = sizeof(struct iscsi_bhs) + ic->ic_max_data_segment_length + + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; + if (sendspace < minspace) { + ICL_WARN("kern.icl.sendspace too low; must be at least %zd", + minspace); + sendspace = minspace; + } + if (recvspace < minspace) { + ICL_WARN("kern.icl.recvspace too low; must be at least %zd", + minspace); + recvspace = minspace; + } + + error = soreserve(ic->ic_socket, sendspace, recvspace); if (error != 0) { ICL_WARN("soreserve failed with error %d", error); icl_conn_close(ic); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:41:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6CAD3330; Wed, 7 May 2014 06:41: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 5A483BA2; Wed, 7 May 2014 06:41: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 s476fY8p093944; Wed, 7 May 2014 06:41:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476fYNC093943; Wed, 7 May 2014 06:41:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070641.s476fYNC093943@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265499 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:41:34 -0000 Author: trasz Date: Wed May 7 06:41:33 2014 New Revision: 265499 URL: http://svnweb.freebsd.org/changeset/base/265499 Log: MFC r264026: Enable a KASSERT. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/icl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 06:38:19 2014 (r265498) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 06:41:33 2014 (r265499) @@ -1222,10 +1222,7 @@ icl_conn_close(struct icl_conn *ic) KASSERT(TAILQ_EMPTY(&ic->ic_to_send), ("destroying session with non-empty send queue")); - /* - * XXX - */ -#if 0 +#ifdef DIAGNOSTIC KASSERT(ic->ic_outstanding_pdus == 0, ("destroying session with %d outstanding PDUs", ic->ic_outstanding_pdus)); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:44:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 541B0655; Wed, 7 May 2014 06:44: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 40B9ABDB; Wed, 7 May 2014 06:44: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 s476iKKd096542; Wed, 7 May 2014 06:44:20 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476iJqs096537; Wed, 7 May 2014 06:44:19 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070644.s476iJqs096537@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265500 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:44:20 -0000 Author: trasz Date: Wed May 7 06:44:19 2014 New Revision: 265500 URL: http://svnweb.freebsd.org/changeset/base/265500 Log: MFC r264109: We don't need TAILQ for iSCSI PDUs; STAILQ is enough. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/icl.c stable/10/sys/dev/iscsi/icl.h stable/10/sys/dev/iscsi/iscsi.c stable/10/sys/dev/iscsi/iscsi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 06:41:33 2014 (r265499) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 06:44:19 2014 (r265500) @@ -851,11 +851,11 @@ icl_conn_send_pdus(struct icl_conn *ic) available = sbspace(&so->so_snd); SOCKBUF_UNLOCK(&so->so_snd); - while (!TAILQ_EMPTY(&ic->ic_to_send)) { + while (!STAILQ_EMPTY(&ic->ic_to_send)) { if (ic->ic_disconnecting) return; - request = TAILQ_FIRST(&ic->ic_to_send); + request = STAILQ_FIRST(&ic->ic_to_send); size = icl_pdu_size(request); if (available < size) { /* @@ -874,7 +874,7 @@ icl_conn_send_pdus(struct icl_conn *ic) return; } available -= size; - TAILQ_REMOVE(&ic->ic_to_send, request, ip_next); + STAILQ_REMOVE_HEAD(&ic->ic_to_send, ip_next); error = icl_pdu_send(request); if (error != 0) { ICL_DEBUG("failed to send PDU; " @@ -974,7 +974,7 @@ icl_pdu_queue(struct icl_pdu *ip) icl_pdu_free(ip); return; } - TAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); + STAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); cv_signal(&ic->ic_send_cv); } @@ -987,7 +987,7 @@ icl_conn_new(const char *name, struct mt ic = uma_zalloc(icl_conn_zone, M_WAITOK | M_ZERO); - TAILQ_INIT(&ic->ic_to_send); + STAILQ_INIT(&ic->ic_to_send); ic->ic_lock = lock; cv_init(&ic->ic_send_cv, "icl_tx"); cv_init(&ic->ic_receive_cv, "icl_rx"); @@ -1214,13 +1214,13 @@ icl_conn_close(struct icl_conn *ic) /* * Remove any outstanding PDUs from the send queue. */ - while (!TAILQ_EMPTY(&ic->ic_to_send)) { - pdu = TAILQ_FIRST(&ic->ic_to_send); - TAILQ_REMOVE(&ic->ic_to_send, pdu, ip_next); + while (!STAILQ_EMPTY(&ic->ic_to_send)) { + pdu = STAILQ_FIRST(&ic->ic_to_send); + STAILQ_REMOVE_HEAD(&ic->ic_to_send, ip_next); icl_pdu_free(pdu); } - KASSERT(TAILQ_EMPTY(&ic->ic_to_send), + KASSERT(STAILQ_EMPTY(&ic->ic_to_send), ("destroying session with non-empty send queue")); #ifdef DIAGNOSTIC KASSERT(ic->ic_outstanding_pdus == 0, Modified: stable/10/sys/dev/iscsi/icl.h ============================================================================== --- stable/10/sys/dev/iscsi/icl.h Wed May 7 06:41:33 2014 (r265499) +++ stable/10/sys/dev/iscsi/icl.h Wed May 7 06:44:19 2014 (r265500) @@ -40,7 +40,7 @@ struct icl_conn; struct icl_pdu { - TAILQ_ENTRY(icl_pdu) ip_next; + STAILQ_ENTRY(icl_pdu) ip_next; struct icl_conn *ip_conn; struct iscsi_bhs *ip_bhs; struct mbuf *ip_bhs_mbuf; @@ -79,7 +79,7 @@ struct icl_conn { #ifdef DIAGNOSTIC volatile u_int ic_outstanding_pdus; #endif - TAILQ_HEAD(, icl_pdu) ic_to_send; + STAILQ_HEAD(, icl_pdu) ic_to_send; size_t ic_receive_len; int ic_receive_state; struct icl_pdu *ic_receive_pdu; Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 06:41:33 2014 (r265499) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 06:44:19 2014 (r265500) @@ -209,12 +209,12 @@ iscsi_session_send_postponed(struct iscs ISCSI_SESSION_LOCK_ASSERT(is); - while (!TAILQ_EMPTY(&is->is_postponed)) { - request = TAILQ_FIRST(&is->is_postponed); + while (!STAILQ_EMPTY(&is->is_postponed)) { + request = STAILQ_FIRST(&is->is_postponed); postpone = iscsi_pdu_prepare(request); if (postpone) break; - TAILQ_REMOVE(&is->is_postponed, request, ip_next); + STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_queue(request); } } @@ -230,7 +230,7 @@ iscsi_pdu_queue_locked(struct icl_pdu *r iscsi_session_send_postponed(is); postpone = iscsi_pdu_prepare(request); if (postpone) { - TAILQ_INSERT_TAIL(&is->is_postponed, request, ip_next); + STAILQ_INSERT_TAIL(&is->is_postponed, request, ip_next); return; } icl_pdu_queue(request); @@ -318,9 +318,9 @@ iscsi_maintenance_thread_reconnect(struc /* * Remove postponed PDUs. */ - while (!TAILQ_EMPTY(&is->is_postponed)) { - pdu = TAILQ_FIRST(&is->is_postponed); - TAILQ_REMOVE(&is->is_postponed, pdu, ip_next); + while (!STAILQ_EMPTY(&is->is_postponed)) { + pdu = STAILQ_FIRST(&is->is_postponed); + STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_free(pdu); } @@ -332,7 +332,7 @@ iscsi_maintenance_thread_reconnect(struc KASSERT(TAILQ_EMPTY(&is->is_outstanding), ("destroying session with active tasks")); - KASSERT(TAILQ_EMPTY(&is->is_postponed), + KASSERT(STAILQ_EMPTY(&is->is_postponed), ("destroying session with postponed PDUs")); /* @@ -387,9 +387,9 @@ iscsi_maintenance_thread_terminate(struc /* * Remove postponed PDUs. */ - while (!TAILQ_EMPTY(&is->is_postponed)) { - pdu = TAILQ_FIRST(&is->is_postponed); - TAILQ_REMOVE(&is->is_postponed, pdu, ip_next); + while (!STAILQ_EMPTY(&is->is_postponed)) { + pdu = STAILQ_FIRST(&is->is_postponed); + STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_free(pdu); } @@ -419,7 +419,7 @@ iscsi_maintenance_thread_terminate(struc KASSERT(TAILQ_EMPTY(&is->is_outstanding), ("destroying session with active tasks")); - KASSERT(TAILQ_EMPTY(&is->is_postponed), + KASSERT(STAILQ_EMPTY(&is->is_postponed), ("destroying session with postponed PDUs")); ISCSI_SESSION_UNLOCK(is); @@ -450,7 +450,7 @@ iscsi_maintenance_thread(void *arg) ISCSI_SESSION_LOCK(is); if (is->is_reconnecting == false && is->is_terminating == false && - TAILQ_EMPTY(&is->is_postponed)) + STAILQ_EMPTY(&is->is_postponed)) cv_wait(&is->is_maintenance_cv, &is->is_lock); if (is->is_reconnecting) { @@ -628,7 +628,7 @@ iscsi_pdu_update_statsn(const struct icl * Command window increased; kick the maintanance thread * to send out postponed commands. */ - if (!TAILQ_EMPTY(&is->is_postponed)) + if (!STAILQ_EMPTY(&is->is_postponed)) cv_signal(&is->is_maintenance_cv); } else if (maxcmdsn < is->is_maxcmdsn) { ISCSI_SESSION_DEBUG(is, "PDU MaxCmdSN %d < session MaxCmdSN %d; ignoring", @@ -1638,7 +1638,7 @@ iscsi_ioctl_session_add(struct iscsi_sof is->is_conn->ic_error = iscsi_error_callback; is->is_conn->ic_prv0 = is; TAILQ_INIT(&is->is_outstanding); - TAILQ_INIT(&is->is_postponed); + STAILQ_INIT(&is->is_postponed); mtx_init(&is->is_lock, "iscsi_lock", NULL, MTX_DEF); cv_init(&is->is_maintenance_cv, "iscsi_mt"); #ifdef ICL_KERNEL_PROXY Modified: stable/10/sys/dev/iscsi/iscsi.h ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.h Wed May 7 06:41:33 2014 (r265499) +++ stable/10/sys/dev/iscsi/iscsi.h Wed May 7 06:44:19 2014 (r265500) @@ -69,7 +69,7 @@ struct iscsi_session { char is_target_alias[ISCSI_ALIAS_LEN]; TAILQ_HEAD(, iscsi_outstanding) is_outstanding; - TAILQ_HEAD(, icl_pdu) is_postponed; + STAILQ_HEAD(, icl_pdu) is_postponed; struct callout is_callout; unsigned int is_timeout; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 06:47:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 98CF48FD; Wed, 7 May 2014 06:47: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 78833C0A; Wed, 7 May 2014 06:47: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 s476l0bC096940; Wed, 7 May 2014 06:47:00 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s476kxbE096929; Wed, 7 May 2014 06:46:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070646.s476kxbE096929@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 06:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265501 - in stable/10/sys: cam/ctl dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:47:00 -0000 Author: trasz Date: Wed May 7 06:46:59 2014 New Revision: 265501 URL: http://svnweb.freebsd.org/changeset/base/265501 Log: MFC r264110: All the iSCSI sysctls are also tunables; advertise that. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/dev/iscsi/icl.c stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:44:19 2014 (r265500) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:46:59 2014 (r265501) @@ -82,19 +82,19 @@ SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, isc "CAM Target Layer iSCSI Frontend"); static int debug = 3; TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug); -SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 1, "Enable debug messages"); static int ping_timeout = 5; TUNABLE_INT("kern.cam.ctl.iscsi.ping_timeout", &ping_timeout); -SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN, &ping_timeout, 5, "Interval between ping (NOP-Out) requests, in seconds"); static int login_timeout = 60; TUNABLE_INT("kern.cam.ctl.iscsi.login_timeout", &login_timeout); -SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN, &login_timeout, 60, "Time to wait for ctld(8) to finish Login Phase, in seconds"); static int maxcmdsn_delta = 256; TUNABLE_INT("kern.cam.ctl.iscsi.maxcmdsn_delta", &maxcmdsn_delta); -SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN, &maxcmdsn_delta, 256, "Number of commands the initiator can send " "without confirmation"); Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 06:44:19 2014 (r265500) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 06:46:59 2014 (r265501) @@ -61,20 +61,20 @@ SYSCTL_NODE(_kern, OID_AUTO, icl, CTLFLAG_RD, 0, "iSCSI Common Layer"); static int debug = 1; TUNABLE_INT("kern.icl.debug", &debug); -SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 1, "Enable debug messages"); static int partial_receive_len = 1 * 1024; /* XXX: More? */ TUNABLE_INT("kern.icl.partial_receive_len", &partial_receive_len); -SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RW, +SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, &partial_receive_len, 1 * 1024, "Minimum read size for partially received " "data segment"); static int sendspace = 1048576; TUNABLE_INT("kern.icl.sendspace", &sendspace); -SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RW, +SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RWTUN, &sendspace, 1048576, "Default send socket buffer size"); static int recvspace = 1048576; TUNABLE_INT("kern.icl.recvspace", &recvspace); -SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RW, +SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RWTUN, &recvspace, 1048576, "Default receive socket buffer size"); static uma_zone_t icl_conn_zone; Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 06:44:19 2014 (r265500) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 06:46:59 2014 (r265501) @@ -74,23 +74,23 @@ static struct iscsi_softc *sc; SYSCTL_NODE(_kern, OID_AUTO, iscsi, CTLFLAG_RD, 0, "iSCSI initiator"); static int debug = 1; TUNABLE_INT("kern.iscsi.debug", &debug); -SYSCTL_INT(_kern_iscsi, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_kern_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 2, "Enable debug messages"); static int ping_timeout = 5; TUNABLE_INT("kern.iscsi.ping_timeout", &ping_timeout); -SYSCTL_INT(_kern_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RW, &ping_timeout, +SYSCTL_INT(_kern_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN, &ping_timeout, 5, "Timeout for ping (NOP-Out) requests, in seconds"); static int iscsid_timeout = 60; TUNABLE_INT("kern.iscsi.iscsid_timeout", &iscsid_timeout); -SYSCTL_INT(_kern_iscsi, OID_AUTO, iscsid_timeout, CTLFLAG_RW, &iscsid_timeout, +SYSCTL_INT(_kern_iscsi, OID_AUTO, iscsid_timeout, CTLFLAG_RWTUN, &iscsid_timeout, 60, "Time to wait for iscsid(8) to handle reconnection, in seconds"); static int login_timeout = 60; TUNABLE_INT("kern.iscsi.login_timeout", &login_timeout); -SYSCTL_INT(_kern_iscsi, OID_AUTO, login_timeout, CTLFLAG_RW, &login_timeout, +SYSCTL_INT(_kern_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN, &login_timeout, 60, "Time to wait for iscsid(8) to finish Login Phase, in seconds"); static int maxtags = 255; TUNABLE_INT("kern.iscsi.maxtags", &maxtags); -SYSCTL_INT(_kern_iscsi, OID_AUTO, maxtags, CTLFLAG_RW, &maxtags, +SYSCTL_INT(_kern_iscsi, OID_AUTO, maxtags, CTLFLAG_RWTUN, &maxtags, 255, "Max number of IO requests queued"); static MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI initiator"); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:17:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 469B9501; Wed, 7 May 2014 07:17: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 3049DECA; Wed, 7 May 2014 07:17: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 s477HBcw011053; Wed, 7 May 2014 07:17:11 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477HBq9011049; Wed, 7 May 2014 07:17:11 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070717.s477HBq9011049@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265502 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:17:12 -0000 Author: trasz Date: Wed May 7 07:17:11 2014 New Revision: 265502 URL: http://svnweb.freebsd.org/changeset/base/265502 Log: MFC r264122: Rework the iSCSI PDU transmit code to avoid lock contention and coalesce PDUs before sending. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/icl.c stable/10/sys/dev/iscsi/icl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 06:46:59 2014 (r265501) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 07:17:11 2014 (r265502) @@ -63,6 +63,10 @@ static int debug = 1; TUNABLE_INT("kern.icl.debug", &debug); SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 1, "Enable debug messages"); +static int coalesce = 1; +TUNABLE_INT("kern.icl.coalesce", &coalesce); +SYSCTL_INT(_kern_icl, OID_AUTO, coalesce, CTLFLAG_RWTUN, + &coalesce, 1, "Try to coalesce PDUs before sending"); static int partial_receive_len = 1 * 1024; /* XXX: More? */ TUNABLE_INT("kern.icl.partial_receive_len", &partial_receive_len); SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, @@ -769,18 +773,14 @@ icl_soupcall_receive(struct socket *so, } static int -icl_pdu_send(struct icl_pdu *request) +icl_pdu_finalize(struct icl_pdu *request) { size_t padding, pdu_len; uint32_t digest, zero = 0; - int error, ok; - struct socket *so; + int ok; struct icl_conn *ic; ic = request->ip_conn; - so = request->ip_conn->ic_socket; - - ICL_CONN_LOCK_ASSERT(ic); icl_pdu_set_data_segment_length(request, request->ip_data_len); @@ -813,7 +813,7 @@ icl_pdu_send(struct icl_pdu *request) ok = m_append(request->ip_data_mbuf, sizeof(digest), (void *)&digest); if (ok != 1) { - ICL_WARN("failed to append header digest"); + ICL_WARN("failed to append data digest"); return (1); } } @@ -824,64 +824,114 @@ icl_pdu_send(struct icl_pdu *request) request->ip_bhs_mbuf->m_pkthdr.len = pdu_len; - error = sosend(so, NULL, NULL, request->ip_bhs_mbuf, - NULL, MSG_DONTWAIT, curthread); - request->ip_bhs_mbuf = NULL; /* Sosend consumes the mbuf. */ - if (error != 0) { - ICL_DEBUG("sosend error %d", error); - return (error); - } - return (0); } static void -icl_conn_send_pdus(struct icl_conn *ic) +icl_conn_send_pdus(struct icl_conn *ic, void *fts) { - struct icl_pdu *request; + STAILQ_HEAD(, icl_pdu) *queue = fts; /* XXX */ + struct icl_pdu *request, *request2; struct socket *so; - size_t available, size; - int error; + size_t available, size, size2; + int coalesced, error; - ICL_CONN_LOCK_ASSERT(ic); + ICL_CONN_LOCK_ASSERT_NOT(ic); so = ic->ic_socket; SOCKBUF_LOCK(&so->so_snd); + /* + * Check how much space do we have for transmit. We can't just + * call sosend() and retry when we get EWOULDBLOCK or EMSGSIZE, + * as it always frees the mbuf chain passed to it, even in case + * of error. + */ available = sbspace(&so->so_snd); + + /* + * Notify the socket layer that it doesn't need to call + * send socket upcall for the time being. + */ + so->so_snd.sb_lowat = so->so_snd.sb_hiwat; SOCKBUF_UNLOCK(&so->so_snd); - while (!STAILQ_EMPTY(&ic->ic_to_send)) { + while (!STAILQ_EMPTY(queue)) { if (ic->ic_disconnecting) return; - - request = STAILQ_FIRST(&ic->ic_to_send); + request = STAILQ_FIRST(queue); size = icl_pdu_size(request); if (available < size) { +#if 1 + ICL_DEBUG("no space to send; " + "have %zd, need %zd", + available, size); +#endif + /* * Set the low watermark on the socket, - * to avoid waking up until there is enough - * space. + * to avoid unneccessary wakeups until there + * is enough space for the PDU to fit. */ SOCKBUF_LOCK(&so->so_snd); so->so_snd.sb_lowat = size; SOCKBUF_UNLOCK(&so->so_snd); -#if 1 - ICL_DEBUG("no space to send; " - "have %zd, need %zd", - available, size); -#endif return; } - available -= size; - STAILQ_REMOVE_HEAD(&ic->ic_to_send, ip_next); - error = icl_pdu_send(request); + STAILQ_REMOVE_HEAD(queue, ip_next); + error = icl_pdu_finalize(request); if (error != 0) { - ICL_DEBUG("failed to send PDU; " + ICL_DEBUG("failed to finalize PDU; " "dropping connection"); icl_conn_fail(ic); + icl_pdu_free(request); return; - } + } + if (coalesce) { + coalesced = 1; + for (;;) { + request2 = STAILQ_FIRST(queue); + if (request2 == NULL) + break; + size2 = icl_pdu_size(request2); + if (available < size + size2) + break; + STAILQ_REMOVE_HEAD(queue, ip_next); + error = icl_pdu_finalize(request2); + if (error != 0) { + ICL_DEBUG("failed to finalize PDU; " + "dropping connection"); + icl_conn_fail(ic); + icl_pdu_free(request); + icl_pdu_free(request2); + return; + } + m_cat(request->ip_bhs_mbuf, request2->ip_bhs_mbuf); + request2->ip_bhs_mbuf = NULL; + request->ip_bhs_mbuf->m_pkthdr.len += size2; + size += size2; + STAILQ_REMOVE_AFTER(queue, request, ip_next); + icl_pdu_free(request2); + coalesced++; + } +#if 0 + if (coalesced > 1) { + ICL_DEBUG("coalesced %d PDUs into %zd bytes", + coalesced, size); + } +#endif + } + available -= size; + error = sosend(so, NULL, NULL, request->ip_bhs_mbuf, + NULL, MSG_DONTWAIT, curthread); + request->ip_bhs_mbuf = NULL; /* Sosend consumes the mbuf. */ + if (error != 0) { + ICL_DEBUG("failed to send PDU, error %d; " + "dropping connection", error); + icl_conn_fail(ic); + icl_pdu_free(request); + return; + } icl_pdu_free(request); } } @@ -890,9 +940,12 @@ static void icl_send_thread(void *arg) { struct icl_conn *ic; + STAILQ_HEAD(, icl_pdu) queue; ic = arg; + STAILQ_INIT(&queue); + ICL_CONN_LOCK(ic); ic->ic_send_running = true; @@ -901,10 +954,54 @@ icl_send_thread(void *arg) //ICL_DEBUG("terminating"); break; } - icl_conn_send_pdus(ic); + + for (;;) { + /* + * If the local queue is empty, populate it from + * the main one. This way the icl_conn_send_pdus() + * can go through all the queued PDUs without holding + * any locks. + */ + if (STAILQ_EMPTY(&queue)) + STAILQ_SWAP(&ic->ic_to_send, &queue, icl_pdu); + + ic->ic_check_send_space = false; + ICL_CONN_UNLOCK(ic); + icl_conn_send_pdus(ic, &queue); + ICL_CONN_LOCK(ic); + + /* + * The icl_soupcall_send() was called since the last + * call to sbspace(); go around; + */ + if (ic->ic_check_send_space) + continue; + + /* + * Local queue is empty, but we still have PDUs + * in the main one; go around. + */ + if (STAILQ_EMPTY(&queue) && + !STAILQ_EMPTY(&ic->ic_to_send)) + continue; + + /* + * There might be some stuff in the local queue, + * which didn't get sent due to not having enough send + * space. Wait for socket upcall. + */ + break; + } + cv_wait(&ic->ic_send_cv, ic->ic_lock); } + /* + * We're exiting; move PDUs back to the main queue, so they can + * get freed properly. At this point ordering doesn't matter. + */ + STAILQ_CONCAT(&ic->ic_to_send, &queue); + ic->ic_send_running = false; ICL_CONN_UNLOCK(ic); kthread_exit(); @@ -916,12 +1013,19 @@ icl_soupcall_send(struct socket *so, voi struct icl_conn *ic; ic = arg; + + ICL_CONN_LOCK(ic); + ic->ic_check_send_space = true; + ICL_CONN_UNLOCK(ic); + cv_signal(&ic->ic_send_cv); + return (SU_OK); } int -icl_pdu_append_data(struct icl_pdu *request, const void *addr, size_t len, int flags) +icl_pdu_append_data(struct icl_pdu *request, const void *addr, size_t len, + int flags) { struct mbuf *mb, *newmb; size_t copylen, off = 0; @@ -974,6 +1078,17 @@ icl_pdu_queue(struct icl_pdu *ip) icl_pdu_free(ip); return; } + + if (!STAILQ_EMPTY(&ic->ic_to_send)) { + STAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); + /* + * If the queue is not empty, someone else had already + * signaled the send thread; no need to do that again, + * just return. + */ + return; + } + STAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); cv_signal(&ic->ic_send_cv); } @@ -1185,6 +1300,20 @@ icl_conn_close(struct icl_conn *ic) return; } + /* + * Deregister socket upcalls. + */ + ICL_CONN_UNLOCK(ic); + SOCKBUF_LOCK(&ic->ic_socket->so_snd); + if (ic->ic_socket->so_snd.sb_upcall != NULL) + soupcall_clear(ic->ic_socket, SO_SND); + SOCKBUF_UNLOCK(&ic->ic_socket->so_snd); + SOCKBUF_LOCK(&ic->ic_socket->so_rcv); + if (ic->ic_socket->so_rcv.sb_upcall != NULL) + soupcall_clear(ic->ic_socket, SO_RCV); + SOCKBUF_UNLOCK(&ic->ic_socket->so_rcv); + ICL_CONN_LOCK(ic); + ic->ic_disconnecting = true; /* @@ -1202,7 +1331,9 @@ icl_conn_close(struct icl_conn *ic) } //ICL_DEBUG("send/receive threads terminated"); + ICL_CONN_UNLOCK(ic); soclose(ic->ic_socket); + ICL_CONN_LOCK(ic); ic->ic_socket = NULL; if (ic->ic_receive_pdu != NULL) { Modified: stable/10/sys/dev/iscsi/icl.h ============================================================================== --- stable/10/sys/dev/iscsi/icl.h Wed May 7 06:46:59 2014 (r265501) +++ stable/10/sys/dev/iscsi/icl.h Wed May 7 07:17:11 2014 (r265502) @@ -80,6 +80,7 @@ struct icl_conn { volatile u_int ic_outstanding_pdus; #endif STAILQ_HEAD(, icl_pdu) ic_to_send; + bool ic_check_send_space; size_t ic_receive_len; int ic_receive_state; struct icl_pdu *ic_receive_pdu; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:18:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6200675C; Wed, 7 May 2014 07:18: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 4ED0EED4; Wed, 7 May 2014 07:18: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 s477IdkQ011298; Wed, 7 May 2014 07:18:39 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477Iddc011297; Wed, 7 May 2014 07:18:39 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070718.s477Iddc011297@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265503 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:18:39 -0000 Author: trasz Date: Wed May 7 07:18:38 2014 New Revision: 265503 URL: http://svnweb.freebsd.org/changeset/base/265503 Log: MFC r264163: Remove hack to pass STAILQ to a function and do it properly instead. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/icl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 07:17:11 2014 (r265502) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 07:18:38 2014 (r265503) @@ -102,6 +102,8 @@ static volatile u_int icl_ncons; #define ICL_CONN_LOCK_ASSERT(X) mtx_assert(X->ic_lock, MA_OWNED) #define ICL_CONN_LOCK_ASSERT_NOT(X) mtx_assert(X->ic_lock, MA_NOTOWNED) +STAILQ_HEAD(icl_pdu_stailq, icl_pdu); + static void icl_conn_fail(struct icl_conn *ic) { @@ -828,9 +830,8 @@ icl_pdu_finalize(struct icl_pdu *request } static void -icl_conn_send_pdus(struct icl_conn *ic, void *fts) +icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) { - STAILQ_HEAD(, icl_pdu) *queue = fts; /* XXX */ struct icl_pdu *request, *request2; struct socket *so; size_t available, size, size2; @@ -940,7 +941,7 @@ static void icl_send_thread(void *arg) { struct icl_conn *ic; - STAILQ_HEAD(, icl_pdu) queue; + struct icl_pdu_stailq queue; ic = arg; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:20:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EAA119C2; Wed, 7 May 2014 07:20: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 D820CEE2; Wed, 7 May 2014 07:20: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 s477K2tv011580; Wed, 7 May 2014 07:20:02 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477K2qo011579; Wed, 7 May 2014 07:20:02 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070720.s477K2qo011579@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265504 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:20:03 -0000 Author: trasz Date: Wed May 7 07:20:02 2014 New Revision: 265504 URL: http://svnweb.freebsd.org/changeset/base/265504 Log: MFC r264264 by mav@: Wakeup only one thread of added in r263978i at a time. This slightly reduces lock congestion between threads. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed May 7 07:18:38 2014 (r265503) +++ stable/10/sys/cam/ctl/ctl.c Wed May 7 07:20:02 2014 (r265504) @@ -13065,7 +13065,7 @@ ctl_wakeup_thread() softc = control_softc; - wakeup(softc); + wakeup_one(softc); } /* Initialization and failover */ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:25:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B4B71C78; Wed, 7 May 2014 07:25: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 95636F84; Wed, 7 May 2014 07:25: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 s477Pmsn015427; Wed, 7 May 2014 07:25:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477PmJa015424; Wed, 7 May 2014 07:25:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070725.s477PmJa015424@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265505 - in stable/10/sys: cam/ctl dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:25:48 -0000 Author: trasz Date: Wed May 7 07:25:47 2014 New Revision: 265505 URL: http://svnweb.freebsd.org/changeset/base/265505 Log: MFC r263740: Use a less unusual syntax in debug printfs. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/dev/iscsi/icl.c stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:20:02 2014 (r265504) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:25:47 2014 (r265505) @@ -98,29 +98,38 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO &maxcmdsn_delta, 256, "Number of commands the initiator can send " "without confirmation"); -#define CFISCSI_DEBUG(X, ...) \ - if (debug > 1) { \ - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ +#define CFISCSI_DEBUG(X, ...) \ + do { \ + if (debug > 1) { \ + printf("%s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) -#define CFISCSI_WARN(X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s: " X "\n", \ - __func__, ## __VA_ARGS__); \ +#define CFISCSI_WARN(X, ...) \ + do { \ + if (debug > 0) { \ + printf("WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) -#define CFISCSI_SESSION_DEBUG(S, X, ...) \ - if (debug > 1) { \ - printf("%s: %s (%s): " X "\n", \ - __func__, S->cs_initiator_addr, \ - S->cs_initiator_name, ## __VA_ARGS__); \ +#define CFISCSI_SESSION_DEBUG(S, X, ...) \ + do { \ + if (debug > 1) { \ + printf("%s: %s (%s): " X "\n", \ + __func__, S->cs_initiator_addr, \ + S->cs_initiator_name, ## __VA_ARGS__); \ + } \ } while (0) -#define CFISCSI_SESSION_WARN(S, X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s (%s): " X "\n", \ - S->cs_initiator_addr, \ - S->cs_initiator_name, ## __VA_ARGS__); \ +#define CFISCSI_SESSION_WARN(S, X, ...) \ + do { \ + if (debug > 0) { \ + printf("WARNING: %s (%s): " X "\n", \ + S->cs_initiator_addr, \ + S->cs_initiator_name, ## __VA_ARGS__); \ + } \ } while (0) #define CFISCSI_SESSION_LOCK(X) mtx_lock(&X->cs_lock) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 07:20:02 2014 (r265504) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 07:25:47 2014 (r265505) @@ -86,15 +86,18 @@ static uma_zone_t icl_pdu_zone; static volatile u_int icl_ncons; -#define ICL_DEBUG(X, ...) \ - if (debug > 1) { \ - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ +#define ICL_DEBUG(X, ...) \ + do { \ + if (debug > 1) \ + printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ } while (0) -#define ICL_WARN(X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s: " X "\n", \ - __func__, ## __VA_ARGS__); \ +#define ICL_WARN(X, ...) \ + do { \ + if (debug > 0) { \ + printf("WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) #define ICL_CONN_LOCK(X) mtx_lock(X->ic_lock) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:20:02 2014 (r265504) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:25:47 2014 (r265505) @@ -99,29 +99,36 @@ static uma_zone_t iscsi_outstanding_zone #define CONN_SESSION(X) ((struct iscsi_session *)X->ic_prv0) #define PDU_SESSION(X) (CONN_SESSION(X->ip_conn)) -#define ISCSI_DEBUG(X, ...) \ - if (debug > 1) { \ - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ +#define ISCSI_DEBUG(X, ...) \ + do { \ + if (debug > 1) \ + printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ } while (0) -#define ISCSI_WARN(X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s: " X "\n", \ - __func__, ## __VA_ARGS__); \ +#define ISCSI_WARN(X, ...) \ + do { \ + if (debug > 0) { \ + printf("WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) -#define ISCSI_SESSION_DEBUG(S, X, ...) \ - if (debug > 1) { \ - printf("%s: %s (%s): " X "\n", \ - __func__, S->is_conf.isc_target_addr, \ - S->is_conf.isc_target, ## __VA_ARGS__); \ +#define ISCSI_SESSION_DEBUG(S, X, ...) \ + do { \ + if (debug > 1) { \ + printf("%s: %s (%s): " X "\n", \ + __func__, S->is_conf.isc_target_addr, \ + S->is_conf.isc_target, ## __VA_ARGS__); \ + } \ } while (0) -#define ISCSI_SESSION_WARN(S, X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s (%s): " X "\n", \ - S->is_conf.isc_target_addr, \ - S->is_conf.isc_target, ## __VA_ARGS__); \ +#define ISCSI_SESSION_WARN(S, X, ...) \ + do { \ + if (debug > 0) { \ + printf("WARNING: %s (%s): " X "\n", \ + S->is_conf.isc_target_addr, \ + S->is_conf.isc_target, ## __VA_ARGS__); \ + } \ } while (0) #define ISCSI_SESSION_LOCK(X) mtx_lock(&X->is_lock) From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:28:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 89237FDA; Wed, 7 May 2014 07:28: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 75E79F98; Wed, 7 May 2014 07:28: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 s477SOLd015822; Wed, 7 May 2014 07:28:24 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477SOOG015821; Wed, 7 May 2014 07:28:24 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070728.s477SOOG015821@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265506 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:28:24 -0000 Author: trasz Date: Wed May 7 07:28:23 2014 New Revision: 265506 URL: http://svnweb.freebsd.org/changeset/base/265506 Log: MFC r264500: Stop treating LUN 0 as mandatory. There is no reason to do that. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:25:47 2014 (r265505) +++ stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:28:23 2014 (r265506) @@ -1099,7 +1099,7 @@ conf_verify(struct conf *conf) struct portal_group *pg; struct target *targ; struct lun *lun; - bool found_lun0; + bool found_lun; int error; if (conf->conf_pidfile_path == NULL) @@ -1116,17 +1116,16 @@ conf_verify(struct conf *conf) "default"); assert(targ->t_portal_group != NULL); } - found_lun0 = false; + found_lun = false; TAILQ_FOREACH(lun, &targ->t_luns, l_next) { error = conf_verify_lun(lun); if (error != 0) return (error); - if (lun->l_lun == 0) - found_lun0 = true; + found_lun = true; } - if (!found_lun0) { - log_warnx("mandatory LUN 0 not configured " - "for target \"%s\"", targ->t_name); + if (!found_lun) { + log_warnx("no LUNs defined for target \"%s\"", + targ->t_name); return (1); } } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:29:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 666AB2BC; Wed, 7 May 2014 07:29: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 528FCF9F; Wed, 7 May 2014 07:29: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 s477Tf6A016040; Wed, 7 May 2014 07:29:41 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477TeBX016035; Wed, 7 May 2014 07:29:40 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070729.s477TeBX016035@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265507 - in stable/10: sys/cam/ctl usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:29:41 -0000 Author: trasz Date: Wed May 7 07:29:39 2014 New Revision: 265507 URL: http://svnweb.freebsd.org/changeset/base/265507 Log: MFC r264524: Make it possible for the iSCSI target side to operate in both normal and ICL_KERNEL_PROXY mode, and fix some bit rot so the latter actually works again. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_ioctl.h stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/kernel.c stable/10/usr.sbin/ctld/pdu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:28:23 2014 (r265506) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:29:39 2014 (r265507) @@ -1419,9 +1419,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * struct cfiscsi_session *cs; struct cfiscsi_target *ct; struct ctl_iscsi_handoff_params *cihp; -#ifndef ICL_KERNEL_PROXY int error; -#endif cihp = (struct ctl_iscsi_handoff_params *)&(ci->data); softc = &cfiscsi_softc; @@ -1446,27 +1444,39 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * } #ifdef ICL_KERNEL_PROXY - mtx_lock(&cfiscsi_softc.lock); - TAILQ_FOREACH(cs, &cfiscsi_softc.sessions, cs_next) { - if (cs->cs_id == cihp->socket) - break; - } - if (cs == NULL) { - mtx_unlock(&cfiscsi_softc.lock); - snprintf(ci->error_str, sizeof(ci->error_str), "connection not found"); + if (cihp->socket > 0 && cihp->connection_id > 0) { + snprintf(ci->error_str, sizeof(ci->error_str), + "both socket and connection_id set"); ci->status = CTL_ISCSI_ERROR; cfiscsi_target_release(ct); return; } - mtx_unlock(&cfiscsi_softc.lock); -#else - cs = cfiscsi_session_new(softc); - if (cs == NULL) { - ci->status = CTL_ISCSI_ERROR; - snprintf(ci->error_str, sizeof(ci->error_str), - "%s: cfiscsi_session_new failed", __func__); - cfiscsi_target_release(ct); - return; + if (cihp->socket == 0) { + mtx_lock(&cfiscsi_softc.lock); + TAILQ_FOREACH(cs, &cfiscsi_softc.sessions, cs_next) { + if (cs->cs_id == cihp->socket) + break; + } + if (cs == NULL) { + mtx_unlock(&cfiscsi_softc.lock); + snprintf(ci->error_str, sizeof(ci->error_str), + "connection not found"); + ci->status = CTL_ISCSI_ERROR; + cfiscsi_target_release(ct); + return; + } + mtx_unlock(&cfiscsi_softc.lock); + } else { +#endif + cs = cfiscsi_session_new(softc); + if (cs == NULL) { + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "%s: cfiscsi_session_new failed", __func__); + cfiscsi_target_release(ct); + return; + } +#ifdef ICL_KERNEL_PROXY } #endif cs->cs_target = ct; @@ -1495,16 +1505,18 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cihp->initiator_alias, sizeof(cs->cs_initiator_alias)); #ifdef ICL_KERNEL_PROXY - cs->cs_login_phase = false; -#else - error = icl_conn_handoff(cs->cs_conn, cihp->socket); - if (error != 0) { - cfiscsi_session_delete(cs); - ci->status = CTL_ISCSI_ERROR; - snprintf(ci->error_str, sizeof(ci->error_str), - "%s: icl_conn_handoff failed with error %d", - __func__, error); - return; + if (cihp->socket > 0) { +#endif + error = icl_conn_handoff(cs->cs_conn, cihp->socket); + if (error != 0) { + cfiscsi_session_delete(cs); + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "%s: icl_conn_handoff failed with error %d", + __func__, error); + return; + } +#ifdef ICL_KERNEL_PROXY } #endif @@ -1514,6 +1526,8 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cfiscsi_session_register_initiator(cs); #ifdef ICL_KERNEL_PROXY + cs->cs_login_phase = false; + /* * First PDU of the Full Feature phase has likely already arrived. * We have to pick it up and execute properly. @@ -1831,7 +1845,9 @@ cfiscsi_ioctl_send(struct ctl_iscsi *ci) icl_pdu_append_data(ip, data, datalen, M_WAITOK); free(data, M_CFISCSI); } + CFISCSI_SESSION_LOCK(cs); icl_pdu_queue(ip); + CFISCSI_SESSION_UNLOCK(cs); ci->status = CTL_ISCSI_OK; } Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Wed May 7 07:28:23 2014 (r265506) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Wed May 7 07:29:39 2014 (r265507) @@ -640,15 +640,7 @@ struct ctl_iscsi_handoff_params { char initiator_addr[CTL_ISCSI_ADDR_LEN]; char initiator_alias[CTL_ISCSI_ALIAS_LEN]; char target_name[CTL_ISCSI_NAME_LEN]; -#ifdef ICL_KERNEL_PROXY - int connection_id; - /* - * XXX - */ int socket; -#else - int socket; -#endif int portal_group_tag; /* @@ -662,7 +654,12 @@ struct ctl_iscsi_handoff_params { uint32_t max_burst_length; uint32_t first_burst_length; uint32_t immediate_data; +#ifdef ICL_KERNEL_PROXY + int connection_id; + int spare[3]; +#else int spare[4]; +#endif }; struct ctl_iscsi_list_params { @@ -715,7 +712,7 @@ struct ctl_iscsi_send_params { void *spare2; size_t data_segment_len; void *data_segment; - int spare[4]; + int spare3[4]; }; struct ctl_iscsi_receive_params { @@ -725,7 +722,7 @@ struct ctl_iscsi_receive_params { void *spare2; size_t data_segment_len; void *data_segment; - int spare[4]; + int spare3[4]; }; struct ctl_iscsi_close_params { Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:28:23 2014 (r265506) +++ stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:29:39 2014 (r265507) @@ -48,6 +48,8 @@ #include "ctld.h" +bool proxy_mode = false; + static volatile bool sighup_received = false; static volatile bool sigterm_received = false; static volatile bool sigalrm_received = false; @@ -553,14 +555,6 @@ portal_group_add_listen(struct portal_gr const char *port; int error, colons = 0; -#ifndef ICL_KERNEL_PROXY - if (iser) { - log_warnx("ctld(8) compiled without ICL_KERNEL_PROXY " - "does not support iSER protocol"); - return (-1); - } -#endif - portal = portal_new(pg); portal->p_listen = checked_strdup(value); portal->p_iser = iser; @@ -1180,9 +1174,7 @@ conf_apply(struct conf *oldconf, struct struct portal *oldp, *newp; pid_t otherpid; int changed, cumulated_error = 0, error; -#ifndef ICL_KERNEL_PROXY int one = 1; -#endif if (oldconf->conf_debug != newconf->conf_debug) { log_debugx("changing debug level to %d", newconf->conf_debug); @@ -1415,10 +1407,14 @@ conf_apply(struct conf *oldconf, struct } #ifdef ICL_KERNEL_PROXY - log_debugx("listening on %s, portal-group \"%s\" using ICL proxy", - newp->p_listen, newpg->pg_name); - kernel_listen(newp->p_ai, newp->p_iser); -#else + if (proxy_mode) { + log_debugx("listening on %s, portal-group \"%s\" using ICL proxy", + newp->p_listen, newpg->pg_name); + kernel_listen(newp->p_ai, newp->p_iser); + continue; + } +#endif + assert(proxy_mode == false); assert(newp->p_iser == false); log_debugx("listening on %s, portal-group \"%s\"", @@ -1461,7 +1457,6 @@ conf_apply(struct conf *oldconf, struct cumulated_error++; continue; } -#endif /* !ICL_KERNEL_PROXY */ } } @@ -1579,11 +1574,9 @@ static void handle_connection(struct portal *portal, int fd, bool dont_fork) { struct connection *conn; -#ifndef ICL_KERNEL_PROXY struct sockaddr_storage ss; socklen_t sslen = sizeof(ss); int error; -#endif pid_t pid; char host[NI_MAXHOST + 1]; struct conf *conf; @@ -1619,20 +1612,25 @@ handle_connection(struct portal *portal, /* * XXX */ - log_set_peer_addr("XXX"); -#else - error = getpeername(fd, (struct sockaddr *)&ss, &sslen); - if (error != 0) - log_err(1, "getpeername"); - error = getnameinfo((struct sockaddr *)&ss, sslen, - host, sizeof(host), NULL, 0, NI_NUMERICHOST); - if (error != 0) - log_errx(1, "getaddrinfo: %s", gai_strerror(error)); - - log_debugx("accepted connection from %s; portal group \"%s\"", - host, portal->p_portal_group->pg_name); - log_set_peer_addr(host); - setproctitle("%s", host); + if (proxy_mode) { + log_set_peer_addr("XXX"); + } else { +#endif + assert(proxy_mode == false); + error = getpeername(fd, (struct sockaddr *)&ss, &sslen); + if (error != 0) + log_err(1, "getpeername"); + error = getnameinfo((struct sockaddr *)&ss, sslen, + host, sizeof(host), NULL, 0, NI_NUMERICHOST); + if (error != 0) + log_errx(1, "getaddrinfo: %s", gai_strerror(error)); + + log_debugx("accepted connection from %s; portal group \"%s\"", + host, portal->p_portal_group->pg_name); + log_set_peer_addr(host); + setproctitle("%s", host); +#ifdef ICL_KERNEL_PROXY + } #endif conn = connection_new(portal, fd, host); @@ -1650,7 +1648,6 @@ handle_connection(struct portal *portal, exit(0); } -#ifndef ICL_KERNEL_PROXY static int fd_add(int fd, fd_set *fdset, int nfds) { @@ -1666,7 +1663,6 @@ fd_add(int fd, fd_set *fdset, int nfds) nfds = fd; return (nfds); } -#endif static void main_loop(struct conf *conf, bool dont_fork) @@ -1675,10 +1671,9 @@ main_loop(struct conf *conf, bool dont_f struct portal *portal; #ifdef ICL_KERNEL_PROXY int connection_id; -#else +#endif fd_set fdset; int error, nfds, client_fd; -#endif pidfile_write(conf->conf_pidfh); @@ -1687,42 +1682,48 @@ main_loop(struct conf *conf, bool dont_f return; #ifdef ICL_KERNEL_PROXY - connection_id = kernel_accept(); - if (connection_id == 0) - continue; + if (proxy_mode) { + connection_id = kernel_accept(); + if (connection_id == 0) + continue; - /* - * XXX: This is obviously temporary. - */ - pg = TAILQ_FIRST(&conf->conf_portal_groups); - portal = TAILQ_FIRST(&pg->pg_portals); + /* + * XXX: This is obviously temporary. + */ + pg = TAILQ_FIRST(&conf->conf_portal_groups); + portal = TAILQ_FIRST(&pg->pg_portals); - handle_connection(portal, connection_id, dont_fork); -#else - FD_ZERO(&fdset); - nfds = 0; - TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { - TAILQ_FOREACH(portal, &pg->pg_portals, p_next) - nfds = fd_add(portal->p_socket, &fdset, nfds); - } - error = select(nfds + 1, &fdset, NULL, NULL, NULL); - if (error <= 0) { - if (errno == EINTR) - return; - log_err(1, "select"); - } - TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { - TAILQ_FOREACH(portal, &pg->pg_portals, p_next) { - if (!FD_ISSET(portal->p_socket, &fdset)) - continue; - client_fd = accept(portal->p_socket, NULL, 0); - if (client_fd < 0) - log_err(1, "accept"); - handle_connection(portal, client_fd, dont_fork); - break; + handle_connection(portal, connection_id, dont_fork); + } else { +#endif + assert(proxy_mode == false); + + FD_ZERO(&fdset); + nfds = 0; + TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { + TAILQ_FOREACH(portal, &pg->pg_portals, p_next) + nfds = fd_add(portal->p_socket, &fdset, nfds); + } + error = select(nfds + 1, &fdset, NULL, NULL, NULL); + if (error <= 0) { + if (errno == EINTR) + return; + log_err(1, "select"); + } + TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { + TAILQ_FOREACH(portal, &pg->pg_portals, p_next) { + if (!FD_ISSET(portal->p_socket, &fdset)) + continue; + client_fd = accept(portal->p_socket, NULL, 0); + if (client_fd < 0) + log_err(1, "accept"); + handle_connection(portal, client_fd, dont_fork); + break; + } } +#ifdef ICL_KERNEL_PROXY } -#endif /* !ICL_KERNEL_PROXY */ +#endif } } @@ -1788,7 +1789,7 @@ main(int argc, char **argv) int debug = 0, ch, error; bool dont_daemonize = false; - while ((ch = getopt(argc, argv, "df:")) != -1) { + while ((ch = getopt(argc, argv, "df:R")) != -1) { switch (ch) { case 'd': dont_daemonize = true; @@ -1797,6 +1798,13 @@ main(int argc, char **argv) case 'f': config_path = optarg; break; + case 'R': +#ifndef ICL_KERNEL_PROXY + log_errx(1, "ctld(8) compiled without ICL_KERNEL_PROXY " + "does not support iSER protocol"); +#endif + proxy_mode = true; + break; case '?': default: usage(); @@ -1818,12 +1826,10 @@ main(int argc, char **argv) newconf->conf_debug = debug; } -#ifdef ICL_KERNEL_PROXY log_debugx("enabling CTL iSCSI port"); error = kernel_port_on(); if (error != 0) log_errx(1, "failed to enable CTL iSCSI port, exiting"); -#endif error = conf_apply(oldconf, newconf); if (error != 0) @@ -1833,13 +1839,6 @@ main(int argc, char **argv) register_signals(); -#ifndef ICL_KERNEL_PROXY - log_debugx("enabling CTL iSCSI port"); - error = kernel_port_on(); - if (error != 0) - log_errx(1, "failed to enable CTL iSCSI port, exiting"); -#endif - if (dont_daemonize == false) { log_debugx("daemonizing"); if (daemon(0, 0) == -1) { Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Wed May 7 07:28:23 2014 (r265506) +++ stable/10/usr.sbin/ctld/kernel.c Wed May 7 07:29:39 2014 (r265507) @@ -65,11 +65,13 @@ #include #include +#include "ctld.h" + #ifdef ICL_KERNEL_PROXY #include #endif -#include "ctld.h" +extern bool proxy_mode; static int ctl_fd = 0; @@ -599,7 +601,14 @@ kernel_handoff(struct connection *conn) } strlcpy(req.data.handoff.target_name, conn->conn_target->t_name, sizeof(req.data.handoff.target_name)); +#ifdef ICL_KERNEL_PROXY + if (proxy_mode) + req.data.handoff.connection_id = conn->conn_socket; + else + req.data.handoff.socket = conn->conn_socket; +#else req.data.handoff.socket = conn->conn_socket; +#endif req.data.handoff.portal_group_tag = conn->conn_portal->p_portal_group->pg_tag; if (conn->conn_header_digest == CONN_DIGEST_CRC32C) Modified: stable/10/usr.sbin/ctld/pdu.c ============================================================================== --- stable/10/usr.sbin/ctld/pdu.c Wed May 7 07:28:23 2014 (r265506) +++ stable/10/usr.sbin/ctld/pdu.c Wed May 7 07:29:39 2014 (r265507) @@ -44,6 +44,8 @@ #include #endif +extern bool proxy_mode; + static int pdu_ahs_length(const struct pdu *pdu) { @@ -101,11 +103,13 @@ pdu_new_response(struct pdu *request) #ifdef ICL_KERNEL_PROXY -void -pdu_receive(struct pdu *pdu) +static void +pdu_receive_proxy(struct pdu *pdu) { size_t len; + assert(proxy_mode); + kernel_receive(pdu); len = pdu_ahs_length(pdu); @@ -117,15 +121,17 @@ pdu_receive(struct pdu *pdu) pdu->pdu_data_len = len; } -void -pdu_send(struct pdu *pdu) +static void +pdu_send_proxy(struct pdu *pdu) { + assert(proxy_mode); + pdu_set_data_segment_length(pdu, pdu->pdu_data_len); kernel_send(pdu); } -#else /* !ICL_KERNEL_PROXY */ +#endif /* ICL_KERNEL_PROXY */ static size_t pdu_padding(const struct pdu *pdu) @@ -161,6 +167,13 @@ pdu_receive(struct pdu *pdu) size_t len, padding; char dummy[4]; +#ifdef ICL_KERNEL_PROXY + if (proxy_mode) + return (pdu_receive_proxy(pdu)); +#endif + + assert(proxy_mode == false); + pdu_read(pdu->pdu_connection->conn_socket, (char *)pdu->pdu_bhs, sizeof(*pdu->pdu_bhs)); @@ -202,6 +215,13 @@ pdu_send(struct pdu *pdu) struct iovec iov[3]; int iovcnt; +#ifdef ICL_KERNEL_PROXY + if (proxy_mode) + return (pdu_send_proxy(pdu)); +#endif + + assert(proxy_mode == false); + pdu_set_data_segment_length(pdu, pdu->pdu_data_len); iov[0].iov_base = pdu->pdu_bhs; iov[0].iov_len = sizeof(*pdu->pdu_bhs); @@ -234,8 +254,6 @@ pdu_send(struct pdu *pdu) log_errx(1, "short write"); } -#endif /* !ICL_KERNEL_PROXY */ - void pdu_delete(struct pdu *pdu) { From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:31:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 33E8351B; Wed, 7 May 2014 07:31: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 06E15FAF; Wed, 7 May 2014 07:31: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 s477VPcs018531; Wed, 7 May 2014 07:31:25 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477VP4k018525; Wed, 7 May 2014 07:31:25 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070731.s477VP4k018525@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265508 - in stable/10/sys: cam/ctl dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:31:26 -0000 Author: trasz Date: Wed May 7 07:31:25 2014 New Revision: 265508 URL: http://svnweb.freebsd.org/changeset/base/265508 Log: MFC r264525: Add some stuff to make it easier to figure out for the system administrator whether the ICL_KERNEL_PROXY stuff got compiled in correctly. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_ioctl.h stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:29:39 2014 (r265507) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:31:25 2014 (r265508) @@ -75,6 +75,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef ICL_KERNEL_PROXY +FEATURE(cfiscsi_kernel_proxy, "iSCSI target built with ICL_KERNEL_PROXY"); +#endif + static MALLOC_DEFINE(M_CFISCSI, "cfiscsi", "Memory used for CTL iSCSI frontend"); static uma_zone_t cfiscsi_data_wait_zone; @@ -1960,7 +1964,18 @@ cfiscsi_ioctl(struct cdev *dev, case CTL_ISCSI_CLOSE: cfiscsi_ioctl_close(ci); break; -#endif /* ICL_KERNEL_PROXY */ +#else + case CTL_ISCSI_LISTEN: + case CTL_ISCSI_ACCEPT: + case CTL_ISCSI_SEND: + case CTL_ISCSI_RECEIVE: + case CTL_ISCSI_CLOSE: + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "%s: CTL compiled without ICL_KERNEL_PROXY", + __func__); + break; +#endif /* !ICL_KERNEL_PROXY */ default: ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Wed May 7 07:29:39 2014 (r265507) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Wed May 7 07:31:25 2014 (r265508) @@ -617,7 +617,11 @@ typedef enum { CTL_ISCSI_LIST, CTL_ISCSI_LOGOUT, CTL_ISCSI_TERMINATE, -#ifdef ICL_KERNEL_PROXY +#if defined(ICL_KERNEL_PROXY) || 1 + /* + * We actually need those in all cases, but leave the ICL_KERNEL_PROXY, + * to remember to remove them along with rest of proxy code, eventually. + */ CTL_ISCSI_LISTEN, CTL_ISCSI_ACCEPT, CTL_ISCSI_SEND, Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:29:39 2014 (r265507) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:31:25 2014 (r265508) @@ -65,6 +65,10 @@ #include #endif +#ifdef ICL_KERNEL_PROXY +FEATURE(iscsi_kernel_proxy, "iSCSI initiator built with ICL_KERNEL_PROXY"); +#endif + /* * XXX: This is global so the iscsi_unload() can access it. * Think about how to do this properly. From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:32:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A17F0649; Wed, 7 May 2014 07:32: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 8269C73; Wed, 7 May 2014 07:32: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 s477WlfH019631; Wed, 7 May 2014 07:32:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477WjH0019619; Wed, 7 May 2014 07:32:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070732.s477WjH0019619@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265509 - in stable/10: sys/cam/ctl sys/dev/iscsi usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:32:47 -0000 Author: trasz Date: Wed May 7 07:32:45 2014 New Revision: 265509 URL: http://svnweb.freebsd.org/changeset/base/265509 Log: MFC r264526: Properly identify target portal when running in proxy mode. While here, remove CTL_ISCSI_CLOSE, it wasn't used or implemented anyway. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h stable/10/sys/cam/ctl/ctl_ioctl.h stable/10/sys/dev/iscsi/icl.h stable/10/sys/dev/iscsi/icl_proxy.c stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:31:25 2014 (r265508) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:32:45 2014 (r265509) @@ -1350,7 +1350,7 @@ cfiscsi_module_event_handler(module_t mo #ifdef ICL_KERNEL_PROXY static void -cfiscsi_accept(struct socket *so) +cfiscsi_accept(struct socket *so, int portal_id) { struct cfiscsi_session *cs; @@ -1361,6 +1361,7 @@ cfiscsi_accept(struct socket *so) } icl_conn_handoff_sock(cs->cs_conn, so); + cs->cs_portal_id = portal_id; cs->cs_waiting_for_ctld = true; cv_signal(&cfiscsi_softc.accept_cv); } @@ -1739,7 +1740,7 @@ cfiscsi_ioctl_listen(struct ctl_iscsi *c } error = icl_listen_add(cfiscsi_softc.listener, cilp->iser, cilp->domain, - cilp->socktype, cilp->protocol, sa); + cilp->socktype, cilp->protocol, sa, cilp->portal_id); if (error != 0) { free(sa, M_SONAME); CFISCSI_DEBUG("icl_listen_add, error %d", error); @@ -1783,6 +1784,7 @@ cfiscsi_ioctl_accept(struct ctl_iscsi *c cs->cs_login_phase = true; ciap->connection_id = cs->cs_id; + ciap->portal_id = cs->cs_portal_id; ci->status = CTL_ISCSI_OK; } @@ -1916,13 +1918,6 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * ci->status = CTL_ISCSI_OK; } -static void -cfiscsi_ioctl_close(struct ctl_iscsi *ci) -{ - /* - * XXX - */ -} #endif /* !ICL_KERNEL_PROXY */ static int @@ -1961,15 +1956,11 @@ cfiscsi_ioctl(struct cdev *dev, case CTL_ISCSI_RECEIVE: cfiscsi_ioctl_receive(ci); break; - case CTL_ISCSI_CLOSE: - cfiscsi_ioctl_close(ci); - break; #else case CTL_ISCSI_LISTEN: case CTL_ISCSI_ACCEPT: case CTL_ISCSI_SEND: case CTL_ISCSI_RECEIVE: - case CTL_ISCSI_CLOSE: ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), "%s: CTL compiled without ICL_KERNEL_PROXY", Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Wed May 7 07:31:25 2014 (r265508) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Wed May 7 07:32:45 2014 (r265509) @@ -82,6 +82,7 @@ struct cfiscsi_session { unsigned int cs_id; int cs_ctl_initid; #ifdef ICL_KERNEL_PROXY + int cs_portal_id; bool cs_login_phase; bool cs_waiting_for_ctld; struct cv cs_login_cv; Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Wed May 7 07:31:25 2014 (r265508) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Wed May 7 07:32:45 2014 (r265509) @@ -626,7 +626,6 @@ typedef enum { CTL_ISCSI_ACCEPT, CTL_ISCSI_SEND, CTL_ISCSI_RECEIVE, - CTL_ISCSI_CLOSE, #endif } ctl_iscsi_type; @@ -701,11 +700,14 @@ struct ctl_iscsi_listen_params { int protocol; struct sockaddr *addr; socklen_t addrlen; + int portal_id; int spare[4]; }; struct ctl_iscsi_accept_params { int connection_id; + struct sockaddr *initiator_addr; + int portal_id; int spare[4]; }; @@ -729,10 +731,6 @@ struct ctl_iscsi_receive_params { int spare3[4]; }; -struct ctl_iscsi_close_params { - int connection_id; - int spare[4]; -}; #endif /* ICL_KERNEL_PROXY */ union ctl_iscsi_data { @@ -745,7 +743,6 @@ union ctl_iscsi_data { struct ctl_iscsi_accept_params accept; struct ctl_iscsi_send_params send; struct ctl_iscsi_receive_params receive; - struct ctl_iscsi_close_params close; #endif }; Modified: stable/10/sys/dev/iscsi/icl.h ============================================================================== --- stable/10/sys/dev/iscsi/icl.h Wed May 7 07:31:25 2014 (r265508) +++ stable/10/sys/dev/iscsi/icl.h Wed May 7 07:32:45 2014 (r265509) @@ -118,16 +118,17 @@ struct icl_listen; struct icl_listen_sock { TAILQ_ENTRY(icl_listen_sock) ils_next; - struct icl_listen *ils_listen; - struct socket *ils_socket; - bool ils_running; - bool ils_disconnecting; + struct icl_listen *ils_listen; + struct socket *ils_socket; + bool ils_running; + bool ils_disconnecting; + int ils_id; }; struct icl_listen { TAILQ_HEAD(, icl_listen_sock) il_sockets; struct sx il_lock; - void (*il_accept)(struct socket *); + void (*il_accept)(struct socket *, int); }; /* @@ -139,10 +140,11 @@ int icl_conn_connect(struct icl_conn * /* * Target part. */ -struct icl_listen *icl_listen_new(void (*accept_cb)(struct socket *)); +struct icl_listen *icl_listen_new(void (*accept_cb)(struct socket *, int)); void icl_listen_free(struct icl_listen *il); -int icl_listen_add(struct icl_listen *il, bool rdma, int domain, - int socktype, int protocol, struct sockaddr *sa); +int icl_listen_add(struct icl_listen *il, bool rdma, + int domain, int socktype, int protocol, + struct sockaddr *sa, int portal_id); int icl_listen_remove(struct icl_listen *il, struct sockaddr *sa); /* Modified: stable/10/sys/dev/iscsi/icl_proxy.c ============================================================================== --- stable/10/sys/dev/iscsi/icl_proxy.c Wed May 7 07:31:25 2014 (r265508) +++ stable/10/sys/dev/iscsi/icl_proxy.c Wed May 7 07:32:45 2014 (r265509) @@ -182,7 +182,7 @@ icl_conn_connect(struct icl_conn *ic, bo } struct icl_listen * -icl_listen_new(void (*accept_cb)(struct socket *)) +icl_listen_new(void (*accept_cb)(struct socket *, int)) { struct icl_listen *il; @@ -298,13 +298,13 @@ icl_accept_thread(void *arg) soclose(so); } - (ils->ils_listen->il_accept)(so); + (ils->ils_listen->il_accept)(so, ils->ils_id); } } static int -icl_listen_add_tcp(struct icl_listen *il, int domain, int socktype, int protocol, - struct sockaddr *sa) +icl_listen_add_tcp(struct icl_listen *il, int domain, int socktype, + int protocol, struct sockaddr *sa, int portal_id) { struct icl_listen_sock *ils; struct socket *so; @@ -348,6 +348,7 @@ icl_listen_add_tcp(struct icl_listen *il ils = malloc(sizeof(*ils), M_ICL_PROXY, M_ZERO | M_WAITOK); ils->ils_listen = il; ils->ils_socket = so; + ils->ils_id = portal_id; error = kthread_add(icl_accept_thread, ils, NULL, NULL, 0, 0, "iclacc"); if (error != 0) { @@ -366,8 +367,8 @@ icl_listen_add_tcp(struct icl_listen *il } int -icl_listen_add(struct icl_listen *il, bool rdma, int domain, int socktype, int protocol, - struct sockaddr *sa) +icl_listen_add(struct icl_listen *il, bool rdma, int domain, int socktype, + int protocol, struct sockaddr *sa, int portal_id) { if (rdma) { @@ -375,12 +376,14 @@ icl_listen_add(struct icl_listen *il, bo ICL_DEBUG("RDMA not supported"); return (EOPNOTSUPP); #else - return (icl_listen_add_rdma(il, domain, socktype, protocol, sa)); + return (icl_listen_add_rdma(il, domain, socktype, protocol, + sa, portal_id)); #endif } - return (icl_listen_add_tcp(il, domain, socktype, protocol, sa)); + return (icl_listen_add_tcp(il, domain, socktype, protocol, sa, + portal_id)); } int Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:31:25 2014 (r265508) +++ stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:32:45 2014 (r265509) @@ -1408,9 +1408,13 @@ conf_apply(struct conf *oldconf, struct #ifdef ICL_KERNEL_PROXY if (proxy_mode) { - log_debugx("listening on %s, portal-group \"%s\" using ICL proxy", - newp->p_listen, newpg->pg_name); - kernel_listen(newp->p_ai, newp->p_iser); + newpg->pg_conf->conf_portal_id++; + newp->p_id = newpg->pg_conf->conf_portal_id; + log_debugx("listening on %s, portal-group " + "\"%s\", portal id %d, using ICL proxy", + newp->p_listen, newpg->pg_name, newp->p_id); + kernel_listen(newp->p_ai, newp->p_iser, + newp->p_id); continue; } #endif @@ -1671,6 +1675,7 @@ main_loop(struct conf *conf, bool dont_f struct portal *portal; #ifdef ICL_KERNEL_PROXY int connection_id; + int portal_id; #endif fd_set fdset; int error, nfds, client_fd; @@ -1683,16 +1688,22 @@ main_loop(struct conf *conf, bool dont_f #ifdef ICL_KERNEL_PROXY if (proxy_mode) { - connection_id = kernel_accept(); - if (connection_id == 0) - continue; + kernel_accept(&connection_id, &portal_id); + + log_debugx("incoming connection, id %d, portal id %d", + connection_id, portal_id); + TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { + TAILQ_FOREACH(portal, &pg->pg_portals, p_next) { + if (portal->p_id == portal_id) { + goto found; + } + } + } - /* - * XXX: This is obviously temporary. - */ - pg = TAILQ_FIRST(&conf->conf_portal_groups); - portal = TAILQ_FIRST(&pg->pg_portals); + log_errx(1, "kernel returned invalid portal_id %d", + portal_id); +found: handle_connection(portal, connection_id, dont_fork); } else { #endif Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Wed May 7 07:31:25 2014 (r265508) +++ stable/10/usr.sbin/ctld/ctld.h Wed May 7 07:32:45 2014 (r265509) @@ -88,6 +88,9 @@ struct portal { bool p_iser; char *p_listen; struct addrinfo *p_ai; +#ifdef ICL_KERNEL_PROXY + int p_id; +#endif TAILQ_HEAD(, target) p_targets; int p_socket; @@ -146,6 +149,9 @@ struct conf { int conf_maxproc; uint16_t conf_last_portal_group_tag; +#ifdef ICL_KERNEL_PROXY + int conf_portal_id; +#endif struct pidfh *conf_pidfh; bool conf_default_pg_defined; @@ -265,8 +271,9 @@ void kernel_capsicate(void); /* * ICL_KERNEL_PROXY */ -void kernel_listen(struct addrinfo *ai, bool iser); -int kernel_accept(void); +void kernel_listen(struct addrinfo *ai, bool iser, + int portal_id); +void kernel_accept(int *connection_id, int *portal_id); void kernel_send(struct pdu *pdu); void kernel_receive(struct pdu *pdu); Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Wed May 7 07:31:25 2014 (r265508) +++ stable/10/usr.sbin/ctld/kernel.c Wed May 7 07:32:45 2014 (r265509) @@ -622,13 +622,15 @@ kernel_handoff(struct connection *conn) req.data.handoff.max_burst_length = conn->conn_max_burst_length; req.data.handoff.immediate_data = conn->conn_immediate_data; - if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) + if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { log_err(1, "error issuing CTL_ISCSI ioctl; " "dropping connection"); + } - if (req.status != CTL_ISCSI_OK) + if (req.status != CTL_ISCSI_OK) { log_errx(1, "error returned from CTL iSCSI handoff request: " "%s; dropping connection", req.error_str); + } } int @@ -673,7 +675,7 @@ kernel_port_off(void) #ifdef ICL_KERNEL_PROXY void -kernel_listen(struct addrinfo *ai, bool iser) +kernel_listen(struct addrinfo *ai, bool iser, int portal_id) { struct ctl_iscsi req; @@ -686,11 +688,10 @@ kernel_listen(struct addrinfo *ai, bool req.data.listen.protocol = ai->ai_protocol; req.data.listen.addr = ai->ai_addr; req.data.listen.addrlen = ai->ai_addrlen; + req.data.listen.portal_id = portal_id; - if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { + if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) log_err(1, "error issuing CTL_ISCSI ioctl"); - return; - } if (req.status != CTL_ISCSI_OK) { log_errx(1, "error returned from CTL iSCSI listen: %s", @@ -698,8 +699,8 @@ kernel_listen(struct addrinfo *ai, bool } } -int -kernel_accept(void) +void +kernel_accept(int *connection_id, int *portal_id) { struct ctl_iscsi req; @@ -707,18 +708,16 @@ kernel_accept(void) req.type = CTL_ISCSI_ACCEPT; - if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { - log_warn("error issuing CTL_ISCSI ioctl"); - return (0); - } + if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) + log_err(1, "error issuing CTL_ISCSI ioctl"); if (req.status != CTL_ISCSI_OK) { - log_warnx("error returned from CTL iSCSI accept: %s", + log_errx(1, "error returned from CTL iSCSI accept: %s", req.error_str); - return (0); } - return (req.data.accept.connection_id); + *connection_id = req.data.accept.connection_id; + *portal_id = req.data.accept.portal_id; } void From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:33:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 60B6D792; Wed, 7 May 2014 07:33: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 3411481; Wed, 7 May 2014 07:33: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 s477XvLB019868; Wed, 7 May 2014 07:33:57 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477Xv7l019867; Wed, 7 May 2014 07:33:57 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070733.s477Xv7l019867@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265510 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:33:57 -0000 Author: trasz Date: Wed May 7 07:33:56 2014 New Revision: 265510 URL: http://svnweb.freebsd.org/changeset/base/265510 Log: MFC r264527: Make it possible to interrupt login when running in proxy mode. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:32:45 2014 (r265509) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:33:56 2014 (r265510) @@ -1130,6 +1130,9 @@ cfiscsi_session_terminate(struct cfiscsi return; cs->cs_terminating = 1; cv_signal(&cs->cs_maintenance_cv); +#ifdef ICL_KERNEL_PROXY + cv_signal(&cs->cs_login_cv); +#endif } static int @@ -1864,6 +1867,7 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * struct cfiscsi_session *cs; struct icl_pdu *ip; void *data; + int error; cirp = (struct ctl_iscsi_receive_params *)&(ci->data); @@ -1874,7 +1878,8 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * } if (cs == NULL) { mtx_unlock(&cfiscsi_softc.lock); - snprintf(ci->error_str, sizeof(ci->error_str), "connection not found"); + snprintf(ci->error_str, sizeof(ci->error_str), + "connection not found"); ci->status = CTL_ISCSI_ERROR; return; } @@ -1886,12 +1891,21 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * #endif CFISCSI_SESSION_LOCK(cs); - while (cs->cs_login_pdu == NULL && - cs->cs_terminating == false) - cv_wait(&cs->cs_login_cv, &cs->cs_lock); + while (cs->cs_login_pdu == NULL && cs->cs_terminating == false) { + error = cv_wait_sig(&cs->cs_login_cv, &cs->cs_lock); + if (error != 0) { + CFISCSI_SESSION_UNLOCK(cs); + snprintf(ci->error_str, sizeof(ci->error_str), + "interrupted by signal"); + ci->status = CTL_ISCSI_ERROR; + return; + } + } + if (cs->cs_terminating) { CFISCSI_SESSION_UNLOCK(cs); - snprintf(ci->error_str, sizeof(ci->error_str), "connection terminating"); + snprintf(ci->error_str, sizeof(ci->error_str), + "connection terminating"); ci->status = CTL_ISCSI_ERROR; return; } @@ -1901,7 +1915,8 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * if (ip->ip_data_len > cirp->data_segment_len) { icl_pdu_free(ip); - snprintf(ci->error_str, sizeof(ci->error_str), "data segment too big"); + snprintf(ci->error_str, sizeof(ci->error_str), + "data segment too big"); ci->status = CTL_ISCSI_ERROR; return; } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:35:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1F204919; Wed, 7 May 2014 07:35: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 000A79C; Wed, 7 May 2014 07:35: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 s477ZL7d020161; Wed, 7 May 2014 07:35:21 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477ZLus020157; Wed, 7 May 2014 07:35:21 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070735.s477ZLus020157@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265511 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:35:22 -0000 Author: trasz Date: Wed May 7 07:35:21 2014 New Revision: 265511 URL: http://svnweb.freebsd.org/changeset/base/265511 Log: MFC r264528: Rework the way we enable CTL iSCSI port. Previously conf_apply() needed it to be already enabled, because listening in proxy mode requires it; however, it's conf_apply() that opens pidfiles, so it resulted in port being enabled before pidfile was opened. This was not so bad, but it was also disabled when pidfile couldn't be opened due to ctld already running; this means that starting second ctld instance screwed up the first. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:33:56 2014 (r265510) +++ stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:35:21 2014 (r265511) @@ -1209,6 +1209,19 @@ conf_apply(struct conf *oldconf, struct } } + if (oldconf->conf_kernel_port_on != newconf->conf_kernel_port_on) { + if (newconf->conf_kernel_port_on == true) { + log_debugx("enabling CTL iSCSI port"); + error = kernel_port_on(); + if (error != 0) + log_errx(1, "failed to enable CTL iSCSI port, exiting"); + } else { + error = kernel_port_off(); + if (error != 0) + log_warnx("failed to disable CTL iSCSI port"); + } + } + TAILQ_FOREACH_SAFE(oldtarg, &oldconf->conf_targets, t_next, tmptarg) { /* * First, remove any targets present in the old configuration @@ -1837,11 +1850,6 @@ main(int argc, char **argv) newconf->conf_debug = debug; } - log_debugx("enabling CTL iSCSI port"); - error = kernel_port_on(); - if (error != 0) - log_errx(1, "failed to enable CTL iSCSI port, exiting"); - error = conf_apply(oldconf, newconf); if (error != 0) log_errx(1, "failed to apply configuration, exiting"); @@ -1886,9 +1894,6 @@ main(int argc, char **argv) log_debugx("disabling CTL iSCSI port " "and terminating all connections"); - error = kernel_port_off(); - if (error != 0) - log_warnx("failed to disable CTL iSCSI port"); oldconf = newconf; newconf = conf_new(); Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Wed May 7 07:33:56 2014 (r265510) +++ stable/10/usr.sbin/ctld/ctld.h Wed May 7 07:35:21 2014 (r265511) @@ -156,6 +156,7 @@ struct conf { bool conf_default_pg_defined; bool conf_default_ag_defined; + bool conf_kernel_port_on; }; #define CONN_SESSION_TYPE_NONE 0 Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Wed May 7 07:33:56 2014 (r265510) +++ stable/10/usr.sbin/ctld/parse.y Wed May 7 07:35:21 2014 (r265511) @@ -773,6 +773,8 @@ conf_new_from_file(const char *path) portal_group_add_listen(pg, "[::]:3260", false); } + conf->conf_kernel_port_on = true; + error = conf_verify(conf); if (error != 0) { conf_delete(conf); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:36:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 48B20A60; Wed, 7 May 2014 07:36: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 1AD55BC; Wed, 7 May 2014 07:36: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 s477akPi020391; Wed, 7 May 2014 07:36:46 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477akLA020390; Wed, 7 May 2014 07:36:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070736.s477akLA020390@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265512 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:36:47 -0000 Author: trasz Date: Wed May 7 07:36:46 2014 New Revision: 265512 URL: http://svnweb.freebsd.org/changeset/base/265512 Log: MFC r264529: Use socket address from accept(2) instead of retrieving it via getpeername(2). Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:35:21 2014 (r265511) +++ stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:36:46 2014 (r265512) @@ -1588,11 +1588,10 @@ wait_for_children(bool block) } static void -handle_connection(struct portal *portal, int fd, bool dont_fork) +handle_connection(struct portal *portal, int fd, const struct sockaddr_storage *ss, + socklen_t sslen, bool dont_fork) { struct connection *conn; - struct sockaddr_storage ss; - socklen_t sslen = sizeof(ss); int error; pid_t pid; char host[NI_MAXHOST + 1]; @@ -1634,13 +1633,10 @@ handle_connection(struct portal *portal, } else { #endif assert(proxy_mode == false); - error = getpeername(fd, (struct sockaddr *)&ss, &sslen); - if (error != 0) - log_err(1, "getpeername"); - error = getnameinfo((struct sockaddr *)&ss, sslen, + error = getnameinfo((struct sockaddr *)ss, sslen, host, sizeof(host), NULL, 0, NI_NUMERICHOST); if (error != 0) - log_errx(1, "getaddrinfo: %s", gai_strerror(error)); + log_errx(1, "getnameinfo: %s", gai_strerror(error)); log_debugx("accepted connection from %s; portal group \"%s\"", host, portal->p_portal_group->pg_name); @@ -1686,6 +1682,8 @@ main_loop(struct conf *conf, bool dont_f { struct portal_group *pg; struct portal *portal; + struct sockaddr_storage client_sa; + socklen_t client_salen; #ifdef ICL_KERNEL_PROXY int connection_id; int portal_id; @@ -1717,7 +1715,7 @@ main_loop(struct conf *conf, bool dont_f portal_id); found: - handle_connection(portal, connection_id, dont_fork); + handle_connection(portal, connection_id, NULL, 0, dont_fork); } else { #endif assert(proxy_mode == false); @@ -1738,10 +1736,14 @@ found: TAILQ_FOREACH(portal, &pg->pg_portals, p_next) { if (!FD_ISSET(portal->p_socket, &fdset)) continue; - client_fd = accept(portal->p_socket, NULL, 0); + client_salen = sizeof(client_sa); + client_fd = accept(portal->p_socket, + (struct sockaddr *)&client_sa, + &client_salen); if (client_fd < 0) log_err(1, "accept"); - handle_connection(portal, client_fd, dont_fork); + handle_connection(portal, client_fd, + &client_sa, client_salen, dont_fork); break; } } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:37:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 33551C00; Wed, 7 May 2014 07:37: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 1EC82100; Wed, 7 May 2014 07:37: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 s477buQC020581; Wed, 7 May 2014 07:37:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477btWE020569; Wed, 7 May 2014 07:37:55 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070737.s477btWE020569@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265513 - in stable/10: sys/cam/ctl sys/dev/iscsi usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:37:57 -0000 Author: trasz Date: Wed May 7 07:37:55 2014 New Revision: 265513 URL: http://svnweb.freebsd.org/changeset/base/265513 Log: MFC r264530: Properly pass the initiator address when running in proxy mode. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h stable/10/sys/cam/ctl/ctl_ioctl.h stable/10/sys/dev/iscsi/icl.h stable/10/sys/dev/iscsi/icl_proxy.c stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:36:46 2014 (r265512) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:37:55 2014 (r265513) @@ -1353,7 +1353,7 @@ cfiscsi_module_event_handler(module_t mo #ifdef ICL_KERNEL_PROXY static void -cfiscsi_accept(struct socket *so, int portal_id) +cfiscsi_accept(struct socket *so, struct sockaddr *sa, int portal_id) { struct cfiscsi_session *cs; @@ -1364,6 +1364,7 @@ cfiscsi_accept(struct socket *so, int po } icl_conn_handoff_sock(cs->cs_conn, so); + cs->cs_initiator_sa = sa; cs->cs_portal_id = portal_id; cs->cs_waiting_for_ctld = true; cv_signal(&cfiscsi_softc.accept_cv); @@ -1788,6 +1789,16 @@ cfiscsi_ioctl_accept(struct ctl_iscsi *c ciap->connection_id = cs->cs_id; ciap->portal_id = cs->cs_portal_id; + ciap->initiator_addrlen = cs->cs_initiator_sa->sa_len; + error = copyout(cs->cs_initiator_sa, ciap->initiator_addr, + cs->cs_initiator_sa->sa_len); + if (error != 0) { + snprintf(ci->error_str, sizeof(ci->error_str), + "copyout failed with error %d", error); + ci->status = CTL_ISCSI_ERROR; + return; + } + ci->status = CTL_ISCSI_OK; } Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Wed May 7 07:36:46 2014 (r265512) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Wed May 7 07:37:55 2014 (r265513) @@ -82,6 +82,7 @@ struct cfiscsi_session { unsigned int cs_id; int cs_ctl_initid; #ifdef ICL_KERNEL_PROXY + struct sockaddr *cs_initiator_sa; int cs_portal_id; bool cs_login_phase; bool cs_waiting_for_ctld; Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Wed May 7 07:36:46 2014 (r265512) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Wed May 7 07:37:55 2014 (r265513) @@ -706,8 +706,9 @@ struct ctl_iscsi_listen_params { struct ctl_iscsi_accept_params { int connection_id; - struct sockaddr *initiator_addr; int portal_id; + struct sockaddr *initiator_addr; + socklen_t initiator_addrlen; int spare[4]; }; Modified: stable/10/sys/dev/iscsi/icl.h ============================================================================== --- stable/10/sys/dev/iscsi/icl.h Wed May 7 07:36:46 2014 (r265512) +++ stable/10/sys/dev/iscsi/icl.h Wed May 7 07:37:55 2014 (r265513) @@ -128,7 +128,8 @@ struct icl_listen_sock { struct icl_listen { TAILQ_HEAD(, icl_listen_sock) il_sockets; struct sx il_lock; - void (*il_accept)(struct socket *, int); + void (*il_accept)(struct socket *, + struct sockaddr *, int); }; /* @@ -140,7 +141,8 @@ int icl_conn_connect(struct icl_conn * /* * Target part. */ -struct icl_listen *icl_listen_new(void (*accept_cb)(struct socket *, int)); +struct icl_listen *icl_listen_new(void (*accept_cb)(struct socket *, + struct sockaddr *, int)); void icl_listen_free(struct icl_listen *il); int icl_listen_add(struct icl_listen *il, bool rdma, int domain, int socktype, int protocol, Modified: stable/10/sys/dev/iscsi/icl_proxy.c ============================================================================== --- stable/10/sys/dev/iscsi/icl_proxy.c Wed May 7 07:36:46 2014 (r265512) +++ stable/10/sys/dev/iscsi/icl_proxy.c Wed May 7 07:37:55 2014 (r265513) @@ -182,7 +182,7 @@ icl_conn_connect(struct icl_conn *ic, bo } struct icl_listen * -icl_listen_new(void (*accept_cb)(struct socket *, int)) +icl_listen_new(void (*accept_cb)(struct socket *, struct sockaddr *, int)) { struct icl_listen *il; @@ -296,9 +296,10 @@ icl_accept_thread(void *arg) if (sa != NULL) free(sa, M_SONAME); soclose(so); + continue; } - (ils->ils_listen->il_accept)(so, ils->ils_id); + (ils->ils_listen->il_accept)(so, sa, ils->ils_id); } } Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:36:46 2014 (r265512) +++ stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:37:55 2014 (r265513) @@ -1588,8 +1588,8 @@ wait_for_children(bool block) } static void -handle_connection(struct portal *portal, int fd, const struct sockaddr_storage *ss, - socklen_t sslen, bool dont_fork) +handle_connection(struct portal *portal, int fd, + const struct sockaddr *client_sa, socklen_t client_salen, bool dont_fork) { struct connection *conn; int error; @@ -1624,27 +1624,15 @@ handle_connection(struct portal *portal, } pidfile_close(conf->conf_pidfh); -#ifdef ICL_KERNEL_PROXY - /* - * XXX - */ - if (proxy_mode) { - log_set_peer_addr("XXX"); - } else { -#endif - assert(proxy_mode == false); - error = getnameinfo((struct sockaddr *)ss, sslen, - host, sizeof(host), NULL, 0, NI_NUMERICHOST); - if (error != 0) - log_errx(1, "getnameinfo: %s", gai_strerror(error)); - - log_debugx("accepted connection from %s; portal group \"%s\"", - host, portal->p_portal_group->pg_name); - log_set_peer_addr(host); - setproctitle("%s", host); -#ifdef ICL_KERNEL_PROXY - } -#endif + error = getnameinfo(client_sa, client_salen, + host, sizeof(host), NULL, 0, NI_NUMERICHOST); + if (error != 0) + log_errx(1, "getnameinfo: %s", gai_strerror(error)); + + log_debugx("accepted connection from %s; portal group \"%s\"", + host, portal->p_portal_group->pg_name); + log_set_peer_addr(host); + setproctitle("%s", host); conn = connection_new(portal, fd, host); set_timeout(conf); @@ -1699,7 +1687,9 @@ main_loop(struct conf *conf, bool dont_f #ifdef ICL_KERNEL_PROXY if (proxy_mode) { - kernel_accept(&connection_id, &portal_id); + client_salen = sizeof(client_sa); + kernel_accept(&connection_id, &portal_id, + (struct sockaddr *)&client_sa, &client_salen); log_debugx("incoming connection, id %d, portal id %d", connection_id, portal_id); @@ -1715,7 +1705,9 @@ main_loop(struct conf *conf, bool dont_f portal_id); found: - handle_connection(portal, connection_id, NULL, 0, dont_fork); + handle_connection(portal, connection_id, + (struct sockaddr *)&client_sa, client_salen, + dont_fork); } else { #endif assert(proxy_mode == false); @@ -1743,7 +1735,8 @@ found: if (client_fd < 0) log_err(1, "accept"); handle_connection(portal, client_fd, - &client_sa, client_salen, dont_fork); + (struct sockaddr *)&client_sa, + client_salen, dont_fork); break; } } Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Wed May 7 07:36:46 2014 (r265512) +++ stable/10/usr.sbin/ctld/ctld.h Wed May 7 07:37:55 2014 (r265513) @@ -33,6 +33,10 @@ #define CTLD_H #include +#ifdef ICL_KERNEL_PROXY +#include +#include +#endif #include #include @@ -269,14 +273,15 @@ int kernel_port_on(void); int kernel_port_off(void); void kernel_capsicate(void); -/* - * ICL_KERNEL_PROXY - */ +#ifdef ICL_KERNEL_PROXY void kernel_listen(struct addrinfo *ai, bool iser, int portal_id); -void kernel_accept(int *connection_id, int *portal_id); +void kernel_accept(int *connection_id, int *portal_id, + struct sockaddr *client_sa, + socklen_t *client_salen); void kernel_send(struct pdu *pdu); void kernel_receive(struct pdu *pdu); +#endif struct keys *keys_new(void); void keys_delete(struct keys *keys); Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Wed May 7 07:36:46 2014 (r265512) +++ stable/10/usr.sbin/ctld/kernel.c Wed May 7 07:37:55 2014 (r265513) @@ -700,13 +700,16 @@ kernel_listen(struct addrinfo *ai, bool } void -kernel_accept(int *connection_id, int *portal_id) +kernel_accept(int *connection_id, int *portal_id, + struct sockaddr *client_sa, socklen_t *client_salen) { struct ctl_iscsi req; + struct sockaddr_storage ss; bzero(&req, sizeof(req)); req.type = CTL_ISCSI_ACCEPT; + req.data.accept.initiator_addr = (struct sockaddr *)&ss; if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) log_err(1, "error issuing CTL_ISCSI ioctl"); @@ -718,6 +721,8 @@ kernel_accept(int *connection_id, int *p *connection_id = req.data.accept.connection_id; *portal_id = req.data.accept.portal_id; + *client_salen = req.data.accept.initiator_addrlen; + memcpy(client_sa, &ss, *client_salen); } void From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:39:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B0A76D50; Wed, 7 May 2014 07:39: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 9D3EF115; Wed, 7 May 2014 07:39: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 s477dH53020924; Wed, 7 May 2014 07:39:17 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477dHYW020920; Wed, 7 May 2014 07:39:17 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070739.s477dHYW020920@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265514 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:39:17 -0000 Author: trasz Date: Wed May 7 07:39:16 2014 New Revision: 265514 URL: http://svnweb.freebsd.org/changeset/base/265514 Log: MFC r264531: Constify. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/ctld.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:37:55 2014 (r265513) +++ stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:39:16 2014 (r265514) @@ -139,7 +139,7 @@ auth_delete(struct auth *auth) } const struct auth * -auth_find(struct auth_group *ag, const char *user) +auth_find(const struct auth_group *ag, const char *user) { const struct auth *auth; @@ -407,7 +407,7 @@ auth_group_delete(struct auth_group *ag) } struct auth_group * -auth_group_find(struct conf *conf, const char *name) +auth_group_find(const struct conf *conf, const char *name) { struct auth_group *ag; @@ -534,7 +534,7 @@ portal_group_delete(struct portal_group } struct portal_group * -portal_group_find(struct conf *conf, const char *name) +portal_group_find(const struct conf *conf, const char *name) { struct portal_group *pg; @@ -833,7 +833,7 @@ lun_delete(struct lun *lun) } struct lun * -lun_find(struct target *targ, int lun_id) +lun_find(const struct target *targ, int lun_id) { struct lun *lun; @@ -929,7 +929,7 @@ lun_option_delete(struct lun_option *lo) } struct lun_option * -lun_option_find(struct lun *lun, const char *name) +lun_option_find(const struct lun *lun, const char *name) { struct lun_option *lo; Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Wed May 7 07:37:55 2014 (r265513) +++ stable/10/usr.sbin/ctld/ctld.h Wed May 7 07:39:16 2014 (r265514) @@ -211,7 +211,8 @@ int conf_verify(struct conf *conf); struct auth_group *auth_group_new(struct conf *conf, const char *name); void auth_group_delete(struct auth_group *ag); -struct auth_group *auth_group_find(struct conf *conf, const char *name); +struct auth_group *auth_group_find(const struct conf *conf, + const char *name); int auth_group_set_type_str(struct auth_group *ag, const char *type); @@ -220,7 +221,7 @@ const struct auth *auth_new_chap(struct const struct auth *auth_new_chap_mutual(struct auth_group *ag, const char *user, const char *secret, const char *user2, const char *secret2); -const struct auth *auth_find(struct auth_group *ag, +const struct auth *auth_find(const struct auth_group *ag, const char *user); const struct auth_name *auth_name_new(struct auth_group *ag, @@ -237,7 +238,8 @@ const struct auth_portal *auth_portal_fi struct portal_group *portal_group_new(struct conf *conf, const char *name); void portal_group_delete(struct portal_group *pg); -struct portal_group *portal_group_find(struct conf *conf, const char *name); +struct portal_group *portal_group_find(const struct conf *conf, + const char *name); int portal_group_add_listen(struct portal_group *pg, const char *listen, bool iser); @@ -248,7 +250,7 @@ struct target *target_find(struct conf struct lun *lun_new(struct target *target, int lun_id); void lun_delete(struct lun *lun); -struct lun *lun_find(struct target *target, int lun_id); +struct lun *lun_find(const struct target *target, int lun_id); void lun_set_backend(struct lun *lun, const char *value); void lun_set_blocksize(struct lun *lun, size_t value); void lun_set_device_id(struct lun *lun, const char *value); @@ -260,7 +262,8 @@ void lun_set_ctl_lun(struct lun *lun, struct lun_option *lun_option_new(struct lun *lun, const char *name, const char *value); void lun_option_delete(struct lun_option *clo); -struct lun_option *lun_option_find(struct lun *lun, const char *name); +struct lun_option *lun_option_find(const struct lun *lun, + const char *name); void lun_option_set(struct lun_option *clo, const char *value); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:40:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6D785F6D; Wed, 7 May 2014 07:40: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 59DA9192; Wed, 7 May 2014 07:40: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 s477ek17022947; Wed, 7 May 2014 07:40:46 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477ekbq022946; Wed, 7 May 2014 07:40:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070740.s477ekbq022946@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265515 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:40:46 -0000 Author: trasz Date: Wed May 7 07:40:45 2014 New Revision: 265515 URL: http://svnweb.freebsd.org/changeset/base/265515 Log: MFC r264532: Use proper terminology in debug messages. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Wed May 7 07:39:16 2014 (r265514) +++ stable/10/usr.sbin/ctld/login.c Wed May 7 07:40:45 2014 (r265515) @@ -787,7 +787,7 @@ login_negotiate(struct connection *conn, bool skipped_security; if (request == NULL) { - log_debugx("beginning parameter negotiation; " + log_debugx("beginning operational parameter negotiation; " "waiting for Login PDU"); request = login_receive(conn, false); skipped_security = false; @@ -813,7 +813,7 @@ login_negotiate(struct connection *conn, response_keys); } - log_debugx("parameter negotiation done; " + log_debugx("operational parameter negotiation done; " "transitioning to Full Feature Phase"); keys_save(response_keys, response); @@ -987,7 +987,7 @@ login(struct connection *conn) * but we don't need it. */ log_debugx("authentication not required; " - "transitioning to parameter negotiation"); + "transitioning to operational parameter negotiation"); if ((bhslr->bhslr_flags & BHSLR_FLAGS_TRANSIT) == 0) log_warnx("initiator did not set the \"T\" flag; " From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:41:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B775E14E; Wed, 7 May 2014 07:41:58 +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 A45381AF; Wed, 7 May 2014 07:41:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s477fwCC024377; Wed, 7 May 2014 07:41:58 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477fwAk024376; Wed, 7 May 2014 07:41:58 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070741.s477fwAk024376@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265516 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:41:58 -0000 Author: trasz Date: Wed May 7 07:41:58 2014 New Revision: 265516 URL: http://svnweb.freebsd.org/changeset/base/265516 Log: MFC r264533: Use consistent punctuation. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:40:45 2014 (r265515) +++ stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:41:58 2014 (r265516) @@ -1214,7 +1214,7 @@ conf_apply(struct conf *oldconf, struct log_debugx("enabling CTL iSCSI port"); error = kernel_port_on(); if (error != 0) - log_errx(1, "failed to enable CTL iSCSI port, exiting"); + log_errx(1, "failed to enable CTL iSCSI port; exiting"); } else { error = kernel_port_off(); if (error != 0) @@ -1839,7 +1839,7 @@ main(int argc, char **argv) oldconf = conf_new_from_kernel(); newconf = conf_new_from_file(config_path); if (newconf == NULL) - log_errx(1, "configuration error, exiting"); + log_errx(1, "configuration error; exiting"); if (debug > 0) { oldconf->conf_debug = debug; newconf->conf_debug = debug; @@ -1847,7 +1847,8 @@ main(int argc, char **argv) error = conf_apply(oldconf, newconf); if (error != 0) - log_errx(1, "failed to apply configuration, exiting"); + log_errx(1, "failed to apply configuration; exiting"); + conf_delete(oldconf); oldconf = NULL; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:43:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8DF7B35E; Wed, 7 May 2014 07:43: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 7A90A1B7; Wed, 7 May 2014 07:43: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 s477hDx3024662; Wed, 7 May 2014 07:43:13 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477hDuR024661; Wed, 7 May 2014 07:43:13 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070743.s477hDuR024661@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265518 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:43:13 -0000 Author: trasz Date: Wed May 7 07:43:13 2014 New Revision: 265518 URL: http://svnweb.freebsd.org/changeset/base/265518 Log: MFC r264534: If we fail to create LUN, try again on next configuration reload. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:42:47 2014 (r265517) +++ stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:43:13 2014 (r265518) @@ -1222,6 +1222,13 @@ conf_apply(struct conf *oldconf, struct } } + /* + * XXX: If target or lun removal fails, we should somehow "move" + * the old lun or target into newconf, so that subsequent + * conf_apply() will try to remove them again. That would + * be somewhat hairy, and lun deletion doesn't really happen, + * so leave it as it is for now. + */ TAILQ_FOREACH_SAFE(oldtarg, &oldconf->conf_targets, t_next, tmptarg) { /* * First, remove any targets present in the old configuration @@ -1344,7 +1351,7 @@ conf_apply(struct conf *oldconf, struct TAILQ_FOREACH(newtarg, &newconf->conf_targets, t_next) { oldtarg = target_find(oldconf, newtarg->t_name); - TAILQ_FOREACH(newlun, &newtarg->t_luns, l_next) { + TAILQ_FOREACH_SAFE(newlun, &newtarg->t_luns, l_next, tmplun) { if (oldtarg != NULL) { oldlun = lun_find(oldtarg, newlun->l_lun); if (oldlun != NULL) { @@ -1376,6 +1383,7 @@ conf_apply(struct conf *oldconf, struct if (error != 0) { log_warnx("failed to add lun %d, target %s", newlun->l_lun, newtarg->t_name); + lun_delete(newlun); cumulated_error++; } } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:44:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5108A493; Wed, 7 May 2014 07:44: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 3D0691C0; Wed, 7 May 2014 07:44: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 s477iIv5024897; Wed, 7 May 2014 07:44:18 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477iIYd024896; Wed, 7 May 2014 07:44:18 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070744.s477iIYd024896@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265519 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:44:18 -0000 Author: trasz Date: Wed May 7 07:44:17 2014 New Revision: 265519 URL: http://svnweb.freebsd.org/changeset/base/265519 Log: MFC r264535: English. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:43:13 2014 (r265518) +++ stable/10/usr.sbin/ctld/ctld.c Wed May 7 07:44:17 2014 (r265519) @@ -1225,9 +1225,9 @@ conf_apply(struct conf *oldconf, struct /* * XXX: If target or lun removal fails, we should somehow "move" * the old lun or target into newconf, so that subsequent - * conf_apply() will try to remove them again. That would - * be somewhat hairy, and lun deletion doesn't really happen, - * so leave it as it is for now. + * conf_apply() would try to remove them again. That would + * be somewhat hairy, though, and lun deletion failures don't + * really happen, so leave it as it is for now. */ TAILQ_FOREACH_SAFE(oldtarg, &oldconf->conf_targets, t_next, tmptarg) { /* From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:45:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EAF875CC; Wed, 7 May 2014 07:45: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 BE0C21C8; Wed, 7 May 2014 07:45: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 s477jMht025113; Wed, 7 May 2014 07:45:22 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477jMp7025111; Wed, 7 May 2014 07:45:22 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070745.s477jMp7025111@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265520 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:45:23 -0000 Author: trasz Date: Wed May 7 07:45:22 2014 New Revision: 265520 URL: http://svnweb.freebsd.org/changeset/base/265520 Log: MFC r264536: Get rid of ISCSIDCLOSE; it wasn't used and is redundant anyway, because of ISCSIDFAIL. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/iscsi.c stable/10/sys/dev/iscsi/iscsi_ioctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:44:17 2014 (r265519) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:45:22 2014 (r265520) @@ -1551,28 +1551,6 @@ iscsi_ioctl_daemon_receive(struct iscsi_ return (0); } - -static int -iscsi_ioctl_daemon_close(struct iscsi_softc *sc, - struct iscsi_daemon_close *idc) -{ - struct iscsi_session *is; - - sx_slock(&sc->sc_lock); - TAILQ_FOREACH(is, &sc->sc_sessions, is_next) { - if (is->is_id == idc->idc_session_id) - break; - } - if (is == NULL) { - sx_sunlock(&sc->sc_lock); - return (ESRCH); - } - sx_sunlock(&sc->sc_lock); - - iscsi_session_reconnect(is); - - return (0); -} #endif /* ICL_KERNEL_PROXY */ static void @@ -1803,9 +1781,6 @@ iscsi_ioctl(struct cdev *dev, u_long cmd case ISCSIDRECEIVE: return (iscsi_ioctl_daemon_receive(sc, (struct iscsi_daemon_receive *)arg)); - case ISCSIDCLOSE: - return (iscsi_ioctl_daemon_close(sc, - (struct iscsi_daemon_close *)arg)); #endif /* ICL_KERNEL_PROXY */ case ISCSISADD: return (iscsi_ioctl_session_add(sc, Modified: stable/10/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- stable/10/sys/dev/iscsi/iscsi_ioctl.h Wed May 7 07:44:17 2014 (r265519) +++ stable/10/sys/dev/iscsi/iscsi_ioctl.h Wed May 7 07:45:22 2014 (r265520) @@ -175,15 +175,9 @@ struct iscsi_daemon_receive { int idr_spare[4]; }; -struct iscsi_daemon_close { - int idc_session_id; - int idc_spare[4]; -}; - #define ISCSIDCONNECT _IOWR('I', 0x04, struct iscsi_daemon_connect) #define ISCSIDSEND _IOWR('I', 0x05, struct iscsi_daemon_send) #define ISCSIDRECEIVE _IOWR('I', 0x06, struct iscsi_daemon_receive) -#define ISCSIDCLOSE _IOWR('I', 0x07, struct iscsi_daemon_close) #endif /* ICL_KERNEL_PROXY */ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:46:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 303FB6FE; Wed, 7 May 2014 07:46: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 1C4501D5; Wed, 7 May 2014 07:46: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 s477kNEW025308; Wed, 7 May 2014 07:46:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477kN8T025307; Wed, 7 May 2014 07:46:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070746.s477kN8T025307@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265521 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:46:24 -0000 Author: trasz Date: Wed May 7 07:46:23 2014 New Revision: 265521 URL: http://svnweb.freebsd.org/changeset/base/265521 Log: MFC r264537: Be more strict with locking for is_waiting_for_iscsid variable. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:45:22 2014 (r265520) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:46:23 2014 (r265521) @@ -1201,8 +1201,10 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof sx_slock(&sc->sc_lock); for (;;) { TAILQ_FOREACH(is, &sc->sc_sessions, is_next) { + ISCSI_SESSION_LOCK(is); if (is->is_waiting_for_iscsid) break; + ISCSI_SESSION_UNLOCK(is); } if (is == NULL) { @@ -1217,7 +1219,6 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof continue; } - ISCSI_SESSION_LOCK(is); is->is_waiting_for_iscsid = false; is->is_login_phase = true; is->is_reason[0] = '\0'; @@ -1650,8 +1651,10 @@ iscsi_ioctl_session_add(struct iscsi_sof /* * Trigger immediate reconnection. */ + ISCSI_SESSION_LOCK(is); is->is_waiting_for_iscsid = true; strlcpy(is->is_reason, "Waiting for iscsid(8)", sizeof(is->is_reason)); + ISCSI_SESSION_UNLOCK(is); cv_signal(&sc->sc_cv); sx_xunlock(&sc->sc_lock); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:47:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CFAFC858; Wed, 7 May 2014 07:47: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 BCC0A1EE; Wed, 7 May 2014 07:47: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 s477lTkM025495; Wed, 7 May 2014 07:47:29 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477lT4x025494; Wed, 7 May 2014 07:47:29 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070747.s477lT4x025494@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265522 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:47:29 -0000 Author: trasz Date: Wed May 7 07:47:29 2014 New Revision: 265522 URL: http://svnweb.freebsd.org/changeset/base/265522 Log: MFC r264538: Remove useless debug. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:46:23 2014 (r265521) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:47:29 2014 (r265522) @@ -2005,7 +2005,6 @@ iscsi_action(struct cam_sim *sim, union ISCSI_SESSION_LOCK_ASSERT(is); if (is->is_terminating) { - ISCSI_SESSION_DEBUG(is, "called during termination"); ccb->ccb_h.status = CAM_DEV_NOT_THERE; xpt_done(ccb); return; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:48:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8189698E; Wed, 7 May 2014 07:48:33 +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 5F7901F7; Wed, 7 May 2014 07:48:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s477mXAd025703; Wed, 7 May 2014 07:48:33 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477mXoX025702; Wed, 7 May 2014 07:48:33 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070748.s477mXoX025702@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265523 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:48:33 -0000 Author: trasz Date: Wed May 7 07:48:32 2014 New Revision: 265523 URL: http://svnweb.freebsd.org/changeset/base/265523 Log: MFC r264544: Add kern.iscsi.fail_on_disconnection; this is required for gmultipath to work. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:47:29 2014 (r265522) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:48:32 2014 (r265523) @@ -96,6 +96,10 @@ static int maxtags = 255; TUNABLE_INT("kern.iscsi.maxtags", &maxtags); SYSCTL_INT(_kern_iscsi, OID_AUTO, maxtags, CTLFLAG_RWTUN, &maxtags, 255, "Max number of IO requests queued"); +static int fail_on_disconnection = 0; +TUNABLE_INT("kern.iscsi.fail_on_disconnection", &fail_on_disconnection); +SYSCTL_INT(_kern_iscsi, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN, + &fail_on_disconnection, 0, "Destroy CAM SIM on connection failure"); static MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI initiator"); static uma_zone_t iscsi_outstanding_zone; @@ -300,22 +304,11 @@ iscsi_session_terminate_tasks(struct isc } static void -iscsi_maintenance_thread_reconnect(struct iscsi_session *is) +iscsi_session_cleanup(struct iscsi_session *is, bool destroy_sim) { struct icl_pdu *pdu; - icl_conn_shutdown(is->is_conn); - icl_conn_close(is->is_conn); - - ISCSI_SESSION_LOCK(is); - -#ifdef ICL_KERNEL_PROXY - if (is->is_login_pdu != NULL) { - icl_pdu_free(is->is_login_pdu); - is->is_login_pdu = NULL; - } - cv_signal(&is->is_login_cv); -#endif + ISCSI_SESSION_LOCK_ASSERT(is); /* * Don't queue any new PDUs. @@ -335,12 +328,63 @@ iscsi_maintenance_thread_reconnect(struc icl_pdu_free(pdu); } - /* - * Terminate SCSI tasks, asking CAM to requeue them. - */ - //ISCSI_SESSION_DEBUG(is, "terminating tasks"); - iscsi_session_terminate_tasks(is, true); + if (destroy_sim == false) { + /* + * Terminate SCSI tasks, asking CAM to requeue them. + */ + iscsi_session_terminate_tasks(is, true); + return; + } + + iscsi_session_terminate_tasks(is, false); + if (is->is_sim == NULL) + return; + + ISCSI_SESSION_DEBUG(is, "deregistering SIM"); + xpt_async(AC_LOST_DEVICE, is->is_path, NULL); + + if (is->is_simq_frozen) { + xpt_release_simq(is->is_sim, 1); + is->is_simq_frozen = false; + } + + xpt_free_path(is->is_path); + is->is_path = NULL; + xpt_bus_deregister(cam_sim_path(is->is_sim)); + cam_sim_free(is->is_sim, TRUE /*free_devq*/); + is->is_sim = NULL; + is->is_devq = NULL; +} + +static void +iscsi_maintenance_thread_reconnect(struct iscsi_session *is) +{ + + icl_conn_shutdown(is->is_conn); + icl_conn_close(is->is_conn); + + ISCSI_SESSION_LOCK(is); + + is->is_connected = false; + is->is_reconnecting = false; + is->is_login_phase = false; + +#ifdef ICL_KERNEL_PROXY + if (is->is_login_pdu != NULL) { + icl_pdu_free(is->is_login_pdu); + is->is_login_pdu = NULL; + } + cv_signal(&is->is_login_cv); +#endif + + if (fail_on_disconnection) { + ISCSI_SESSION_DEBUG(is, "connection failed, destroying devices"); + iscsi_session_cleanup(is, true); + } else { + iscsi_session_cleanup(is, false); + } + KASSERT(TAILQ_EMPTY(&is->is_outstanding), ("destroying session with active tasks")); KASSERT(STAILQ_EMPTY(&is->is_postponed), @@ -350,9 +394,6 @@ iscsi_maintenance_thread_reconnect(struc * Request immediate reconnection from iscsid(8). */ //ISCSI_SESSION_DEBUG(is, "waking up iscsid(8)"); - is->is_connected = false; - is->is_reconnecting = false; - is->is_login_phase = false; is->is_waiting_for_iscsid = true; strlcpy(is->is_reason, "Waiting for iscsid(8)", sizeof(is->is_reason)); is->is_timeout = 0; @@ -364,7 +405,6 @@ static void iscsi_maintenance_thread_terminate(struct iscsi_session *is) { struct iscsi_softc *sc; - struct icl_pdu *pdu; sc = is->is_softc; sx_xlock(&sc->sc_lock); @@ -385,48 +425,9 @@ iscsi_maintenance_thread_terminate(struc cv_signal(&is->is_login_cv); #endif - /* - * Don't queue any new PDUs. - */ callout_drain(&is->is_callout); - if (is->is_sim != NULL && is->is_simq_frozen == false) { - ISCSI_SESSION_DEBUG(is, "freezing"); - xpt_freeze_simq(is->is_sim, 1); - is->is_simq_frozen = true; - } - /* - * Remove postponed PDUs. - */ - while (!STAILQ_EMPTY(&is->is_postponed)) { - pdu = STAILQ_FIRST(&is->is_postponed); - STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); - icl_pdu_free(pdu); - } - - /* - * Forcibly terminate SCSI tasks. - */ - ISCSI_SESSION_DEBUG(is, "terminating tasks"); - iscsi_session_terminate_tasks(is, false); - - /* - * Deregister CAM. - */ - if (is->is_sim != NULL) { - ISCSI_SESSION_DEBUG(is, "deregistering SIM"); - xpt_async(AC_LOST_DEVICE, is->is_path, NULL); - - if (is->is_simq_frozen) { - xpt_release_simq(is->is_sim, 1); - is->is_simq_frozen = false; - } - - xpt_free_path(is->is_path); - xpt_bus_deregister(cam_sim_path(is->is_sim)); - cam_sim_free(is->is_sim, TRUE /*free_devq*/); - is->is_sim = NULL; - } + iscsi_session_cleanup(is, true); KASSERT(TAILQ_EMPTY(&is->is_outstanding), ("destroying session with active tasks")); @@ -2004,7 +2005,8 @@ iscsi_action(struct cam_sim *sim, union ISCSI_SESSION_LOCK_ASSERT(is); - if (is->is_terminating) { + if (is->is_terminating || + (is->is_connected == false && fail_on_disconnection)) { ccb->ccb_h.status = CAM_DEV_NOT_THERE; xpt_done(ccb); return; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:53:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 43FE4BAD; Wed, 7 May 2014 07:53: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 2FCBB2A3; Wed, 7 May 2014 07:53: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 s477rPqf029444; Wed, 7 May 2014 07:53:25 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477rPTP029443; Wed, 7 May 2014 07:53:25 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070753.s477rPTP029443@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265524 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:53:25 -0000 Author: trasz Date: Wed May 7 07:53:24 2014 New Revision: 265524 URL: http://svnweb.freebsd.org/changeset/base/265524 Log: MFC r264348 by mav@: Improve use of socket buffer upcalls. Use soreadable()/sowriteable() in socket upcalls to avoid extra wakeups until we have enough data to read or space to write. Increase partial receive len from 1K to 128K to not wake up on every received packet. This significantly reduces locks congestion and CPU usage and improves throughput for large I/Os on NICs without TSO and LRO. MFC r264552 by mav@: Close the race in older code, that caused connection stuck after r264348. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/dev/iscsi/icl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 07:48:32 2014 (r265523) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 07:53:24 2014 (r265524) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -67,7 +68,7 @@ static int coalesce = 1; TUNABLE_INT("kern.icl.coalesce", &coalesce); SYSCTL_INT(_kern_icl, OID_AUTO, coalesce, CTLFLAG_RWTUN, &coalesce, 1, "Try to coalesce PDUs before sending"); -static int partial_receive_len = 1 * 1024; /* XXX: More? */ +static int partial_receive_len = 128 * 1024; TUNABLE_INT("kern.icl.partial_receive_len", &partial_receive_len); SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, &partial_receive_len, 1 * 1024, "Minimum read size for partially received " @@ -750,12 +751,19 @@ icl_receive_thread(void *arg) break; } + /* + * Set the low watermark, to be checked by + * soreadable() in icl_soupcall_receive() + * to avoid unneccessary wakeups until there + * is enough data received to read the PDU. + */ SOCKBUF_LOCK(&so->so_rcv); available = so->so_rcv.sb_cc; if (available < ic->ic_receive_len) { so->so_rcv.sb_lowat = ic->ic_receive_len; cv_wait(&ic->ic_receive_cv, &so->so_rcv.sb_mtx); - } + } else + so->so_rcv.sb_lowat = so->so_rcv.sb_hiwat + 1; SOCKBUF_UNLOCK(&so->so_rcv); icl_conn_receive_pdus(ic, available); @@ -772,6 +780,9 @@ icl_soupcall_receive(struct socket *so, { struct icl_conn *ic; + if (!soreadable(so)) + return (SU_OK); + ic = arg; cv_signal(&ic->ic_receive_cv); return (SU_OK); @@ -854,10 +865,10 @@ icl_conn_send_pdus(struct icl_conn *ic, available = sbspace(&so->so_snd); /* - * Notify the socket layer that it doesn't need to call - * send socket upcall for the time being. + * Notify the socket upcall that we don't need wakeups + * for the time being. */ - so->so_snd.sb_lowat = so->so_snd.sb_hiwat; + so->so_snd.sb_lowat = so->so_snd.sb_hiwat + 1; SOCKBUF_UNLOCK(&so->so_snd); while (!STAILQ_EMPTY(queue)) { @@ -866,21 +877,26 @@ icl_conn_send_pdus(struct icl_conn *ic, request = STAILQ_FIRST(queue); size = icl_pdu_size(request); if (available < size) { -#if 1 - ICL_DEBUG("no space to send; " - "have %zd, need %zd", - available, size); -#endif /* - * Set the low watermark on the socket, + * Set the low watermark, to be checked by + * sowritable() in icl_soupcall_send() * to avoid unneccessary wakeups until there * is enough space for the PDU to fit. */ SOCKBUF_LOCK(&so->so_snd); - so->so_snd.sb_lowat = size; + available = sbspace(&so->so_snd); + if (available < size) { +#if 1 + ICL_DEBUG("no space to send; " + "have %zd, need %zd", + available, size); +#endif + so->so_snd.sb_lowat = size; + SOCKBUF_UNLOCK(&so->so_snd); + return; + } SOCKBUF_UNLOCK(&so->so_snd); - return; } STAILQ_REMOVE_HEAD(queue, ip_next); error = icl_pdu_finalize(request); @@ -1016,6 +1032,9 @@ icl_soupcall_send(struct socket *so, voi { struct icl_conn *ic; + if (!sowriteable(so)) + return (SU_OK); + ic = arg; ICL_CONN_LOCK(ic); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:54:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 64E83CF4; Wed, 7 May 2014 07:54: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 51A122B4; Wed, 7 May 2014 07:54: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 s477smLI029674; Wed, 7 May 2014 07:54:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477smuT029673; Wed, 7 May 2014 07:54:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070754.s477smuT029673@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265525 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:54:48 -0000 Author: trasz Date: Wed May 7 07:54:47 2014 New Revision: 265525 URL: http://svnweb.freebsd.org/changeset/base/265525 Log: MFC r264545: Fix typo. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/icl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 07:53:24 2014 (r265524) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 07:54:47 2014 (r265525) @@ -880,7 +880,7 @@ icl_conn_send_pdus(struct icl_conn *ic, /* * Set the low watermark, to be checked by - * sowritable() in icl_soupcall_send() + * sowriteable() in icl_soupcall_send() * to avoid unneccessary wakeups until there * is enough space for the PDU to fit. */ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:56:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B6571ED6; Wed, 7 May 2014 07:56: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 971C32D7; Wed, 7 May 2014 07:56: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 s477ubr0030062; Wed, 7 May 2014 07:56:37 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477uaoe030054; Wed, 7 May 2014 07:56:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070756.s477uaoe030054@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265526 - in stable/10: sys/dev/iscsi usr.sbin/iscsid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:56:37 -0000 Author: trasz Date: Wed May 7 07:56:36 2014 New Revision: 265526 URL: http://svnweb.freebsd.org/changeset/base/265526 Log: MFC r264549: Make it possible for the initiator side to operate in both proxy and normal mode; this makes it possible to compile with the former by default, but use it only when neccessary. That's especially important for the userland part. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/iscsi.c stable/10/sys/dev/iscsi/iscsi_ioctl.h stable/10/usr.sbin/iscsid/iscsid.c stable/10/usr.sbin/iscsid/iscsid.h stable/10/usr.sbin/iscsid/pdu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:54:47 2014 (r265525) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:56:36 2014 (r265526) @@ -1303,12 +1303,19 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ ISCSI_SESSION_UNLOCK(is); -#ifndef ICL_KERNEL_PROXY - error = icl_conn_handoff(is->is_conn, handoff->idh_socket); - if (error != 0) { - sx_sunlock(&sc->sc_lock); - iscsi_session_terminate(is); - return (error); +#ifdef ICL_KERNEL_PROXY + if (handoff->idh_socket != 0) { +#endif + /* + * Handoff without using ICL proxy. + */ + error = icl_conn_handoff(is->is_conn, handoff->idh_socket); + if (error != 0) { + sx_sunlock(&sc->sc_lock); + iscsi_session_terminate(is); + return (error); + } +#ifdef ICL_KERNEL_PROXY } #endif @@ -1419,13 +1426,18 @@ iscsi_ioctl_daemon_connect(struct iscsi_ if (idc->idc_from_addrlen > 0) { error = getsockaddr(&from_sa, (void *)idc->idc_from_addr, idc->idc_from_addrlen); - if (error != 0) + if (error != 0) { + ISCSI_SESSION_WARN(is, + "getsockaddr failed with error %d", error); return (error); + } } else { from_sa = NULL; } error = getsockaddr(&to_sa, (void *)idc->idc_to_addr, idc->idc_to_addrlen); if (error != 0) { + ISCSI_SESSION_WARN(is, "getsockaddr failed with error %d", + error); free(from_sa, M_SONAME); return (error); } Modified: stable/10/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- stable/10/sys/dev/iscsi/iscsi_ioctl.h Wed May 7 07:54:47 2014 (r265525) +++ stable/10/sys/dev/iscsi/iscsi_ioctl.h Wed May 7 07:56:36 2014 (r265526) @@ -129,9 +129,9 @@ struct iscsi_daemon_fail { /* * When ICL_KERNEL_PROXY is not defined, the iscsid(8) is responsible - * for creating the socket, connecting, performing Login Phase using - * socked in the usual userspace way, and then passing the socket file - * descriptor to the kernel part using ISCSIDHANDOFF. + * for creating the socket, connecting, and performing Login Phase using + * the socket in the usual userspace way, and then passing the socket + * file descriptor to the kernel part using ISCSIDHANDOFF. * * When ICL_KERNEL_PROXY is defined, the iscsid(8) creates the session * using ISCSICONNECT, performs Login Phase using ISCSISEND/ISCSIRECEIVE @@ -162,7 +162,7 @@ struct iscsi_daemon_send { void *ids_spare2; size_t ids_data_segment_len; void *ids_data_segment; - int ids_spare[4]; + int ids_spare3[4]; }; struct iscsi_daemon_receive { @@ -172,7 +172,7 @@ struct iscsi_daemon_receive { void *idr_spare2; size_t idr_data_segment_len; void *idr_data_segment; - int idr_spare[4]; + int idr_spare3[4]; }; #define ISCSIDCONNECT _IOWR('I', 0x04, struct iscsi_daemon_connect) Modified: stable/10/usr.sbin/iscsid/iscsid.c ============================================================================== --- stable/10/usr.sbin/iscsid/iscsid.c Wed May 7 07:54:47 2014 (r265525) +++ stable/10/usr.sbin/iscsid/iscsid.c Wed May 7 07:56:36 2014 (r265526) @@ -194,30 +194,32 @@ connection_new(unsigned int session_id, resolve_addr(conn, to_addr, &to_ai, false); #ifdef ICL_KERNEL_PROXY + if (conn->conn_conf.isc_iser) { + memset(&idc, 0, sizeof(idc)); + idc.idc_session_id = conn->conn_session_id; + if (conn->conn_conf.isc_iser) + idc.idc_iser = 1; + idc.idc_domain = to_ai->ai_family; + idc.idc_socktype = to_ai->ai_socktype; + idc.idc_protocol = to_ai->ai_protocol; + if (from_ai != NULL) { + idc.idc_from_addr = from_ai->ai_addr; + idc.idc_from_addrlen = from_ai->ai_addrlen; + } + idc.idc_to_addr = to_ai->ai_addr; + idc.idc_to_addrlen = to_ai->ai_addrlen; - memset(&idc, 0, sizeof(idc)); - idc.idc_session_id = conn->conn_session_id; - if (conn->conn_conf.isc_iser) - idc.idc_iser = 1; - idc.idc_domain = to_ai->ai_family; - idc.idc_socktype = to_ai->ai_socktype; - idc.idc_protocol = to_ai->ai_protocol; - if (from_ai != NULL) { - idc.idc_from_addr = from_ai->ai_addr; - idc.idc_from_addrlen = from_ai->ai_addrlen; - } - idc.idc_to_addr = to_ai->ai_addr; - idc.idc_to_addrlen = to_ai->ai_addrlen; + log_debugx("connecting to %s using ICL kernel proxy", to_addr); + error = ioctl(iscsi_fd, ISCSIDCONNECT, &idc); + if (error != 0) { + fail(conn, strerror(errno)); + log_err(1, "failed to connect to %s " + "using ICL kernel proxy: ISCSIDCONNECT", to_addr); + } - log_debugx("connecting to %s using ICL kernel proxy", to_addr); - error = ioctl(iscsi_fd, ISCSIDCONNECT, &idc); - if (error != 0) { - fail(conn, strerror(errno)); - log_err(1, "failed to connect to %s using ICL kernel proxy", - to_addr); + return (conn); } - -#else /* !ICL_KERNEL_PROXY */ +#endif /* ICL_KERNEL_PROXY */ if (conn->conn_conf.isc_iser) { fail(conn, "iSER not supported"); @@ -246,8 +248,6 @@ connection_new(unsigned int session_id, log_err(1, "failed to connect to %s", to_addr); } -#endif /* !ICL_KERNEL_PROXY */ - return (conn); } @@ -261,9 +261,7 @@ handoff(struct connection *conn) memset(&idh, 0, sizeof(idh)); idh.idh_session_id = conn->conn_session_id; -#ifndef ICL_KERNEL_PROXY idh.idh_socket = conn->conn_socket; -#endif strlcpy(idh.idh_target_alias, conn->conn_target_alias, sizeof(idh.idh_target_alias)); memcpy(idh.idh_isid, conn->conn_isid, sizeof(idh.idh_isid)); Modified: stable/10/usr.sbin/iscsid/iscsid.h ============================================================================== --- stable/10/usr.sbin/iscsid/iscsid.h Wed May 7 07:54:47 2014 (r265525) +++ stable/10/usr.sbin/iscsid/iscsid.h Wed May 7 07:56:36 2014 (r265526) @@ -46,9 +46,7 @@ struct connection { int conn_iscsi_fd; -#ifndef ICL_KERNEL_PROXY int conn_socket; -#endif unsigned int conn_session_id; struct iscsi_session_conf conn_conf; char conn_target_alias[ISCSI_ADDR_LEN]; Modified: stable/10/usr.sbin/iscsid/pdu.c ============================================================================== --- stable/10/usr.sbin/iscsid/pdu.c Wed May 7 07:54:47 2014 (r265525) +++ stable/10/usr.sbin/iscsid/pdu.c Wed May 7 07:56:36 2014 (r265526) @@ -101,13 +101,15 @@ pdu_new_response(struct pdu *request) #ifdef ICL_KERNEL_PROXY -void -pdu_receive(struct pdu *pdu) +static void +pdu_receive_proxy(struct pdu *pdu) { struct iscsi_daemon_receive *idr; size_t len; int error; + assert(pdu->pdu_connection->conn_conf.isc_iser != 0); + pdu->pdu_data = malloc(ISCSI_MAX_DATA_SEGMENT_LENGTH); if (pdu->pdu_data == NULL) log_err(1, "malloc"); @@ -136,12 +138,14 @@ pdu_receive(struct pdu *pdu) free(idr); } -void -pdu_send(struct pdu *pdu) +static void +pdu_send_proxy(struct pdu *pdu) { struct iscsi_daemon_send *ids; int error; + assert(pdu->pdu_connection->conn_conf.isc_iser != 0); + pdu_set_data_segment_length(pdu, pdu->pdu_data_len); ids = calloc(1, sizeof(*ids)); @@ -160,7 +164,7 @@ pdu_send(struct pdu *pdu) free(ids); } -#else /* !ICL_KERNEL_PROXY */ +#endif /* ICL_KERNEL_PROXY */ static size_t pdu_padding(const struct pdu *pdu) @@ -196,6 +200,13 @@ pdu_receive(struct pdu *pdu) size_t len, padding; char dummy[4]; +#ifdef ICL_KERNEL_PROXY + if (pdu->pdu_connection->conn_conf.isc_iser != 0) + return (pdu_receive_proxy(pdu)); +#endif + + assert(pdu->pdu_connection->conn_conf.isc_iser == 0); + pdu_read(pdu->pdu_connection->conn_socket, (char *)pdu->pdu_bhs, sizeof(*pdu->pdu_bhs)); @@ -237,6 +248,13 @@ pdu_send(struct pdu *pdu) struct iovec iov[3]; int iovcnt; +#ifdef ICL_KERNEL_PROXY + if (pdu->pdu_connection->conn_conf.isc_iser != 0) + return (pdu_send_proxy(pdu)); +#endif + + assert(pdu->pdu_connection->conn_conf.isc_iser == 0); + pdu_set_data_segment_length(pdu, pdu->pdu_data_len); iov[0].iov_base = pdu->pdu_bhs; iov[0].iov_len = sizeof(*pdu->pdu_bhs); @@ -269,8 +287,6 @@ pdu_send(struct pdu *pdu) log_errx(1, "short write"); } -#endif /* !ICL_KERNEL_PROXY */ - void pdu_delete(struct pdu *pdu) { From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:57:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 45CF6417; Wed, 7 May 2014 07:57: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 E75902F0; Wed, 7 May 2014 07:57: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 s477vrG1030334; Wed, 7 May 2014 07:57:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477vrnk030333; Wed, 7 May 2014 07:57:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070757.s477vrnk030333@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265528 - stable/10/usr.sbin/iscsid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:57:54 -0000 Author: trasz Date: Wed May 7 07:57:53 2014 New Revision: 265528 URL: http://svnweb.freebsd.org/changeset/base/265528 Log: MFC r264604: Remove redundant code. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/iscsid/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/iscsid/login.c ============================================================================== --- stable/10/usr.sbin/iscsid/login.c Wed May 7 07:57:50 2014 (r265527) +++ stable/10/usr.sbin/iscsid/login.c Wed May 7 07:57:53 2014 (r265528) @@ -783,7 +783,6 @@ login(struct connection *conn) request = login_new_request(conn); bhslr = (struct iscsi_bhs_login_request *)request->pdu_bhs; - bhslr->bhslr_flags |= BHSLR_FLAGS_TRANSIT; request_keys = keys_new(); if (conn->conn_conf.isc_mutual_user[0] != '\0') { From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 07:59:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B02A9594; Wed, 7 May 2014 07:59: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 9AE53304; Wed, 7 May 2014 07:59: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 s477xiDe030742; Wed, 7 May 2014 07:59:44 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477xiVi030741; Wed, 7 May 2014 07:59:44 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070759.s477xiVi030741@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 07:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265529 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:59:44 -0000 Author: trasz Date: Wed May 7 07:59:44 2014 New Revision: 265529 URL: http://svnweb.freebsd.org/changeset/base/265529 Log: MFC r264876: Grammar fix. Modified: stable/10/usr.bin/iscsictl/iscsictl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.8 Wed May 7 07:57:53 2014 (r265528) +++ stable/10/usr.bin/iscsictl/iscsictl.8 Wed May 7 07:59:44 2014 (r265529) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2014 +.Dd April 24, 2014 .Dt ISCSICTL 8 .Os .Sh NAME @@ -119,7 +119,7 @@ Use .Nm Fl L to check the connection status. .Pp -Note that in order to the iSCSI initiator to be able to connect to a target, +Note that in order for the iSCSI initiator to be able to connect to a target, the .Xr iscsid 8 daemon must be running. From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 08:01:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0A6E16F3; Wed, 7 May 2014 08:01: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 E9CAA312; Wed, 7 May 2014 08:00: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 s4780xsu031221; Wed, 7 May 2014 08:00:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4780xZN031220; Wed, 7 May 2014 08:00:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070800.s4780xZN031220@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 08:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265530 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 08:01:00 -0000 Author: trasz Date: Wed May 7 08:00:59 2014 New Revision: 265530 URL: http://svnweb.freebsd.org/changeset/base/265530 Log: MFC r264877: Style fixes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctl.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Wed May 7 07:59:44 2014 (r265529) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Wed May 7 08:00:59 2014 (r265530) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 11, 2014 +.Dd April 24, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -41,7 +41,7 @@ configuration file is used by the daemon. Lines starting with .Ql # -and empty lines are interpreted as comments. +are interpreted as comments. The general syntax of the .Nm file is: @@ -129,7 +129,7 @@ ones will be allowed to connect. The following statements are available at the portal-group level: .Bl -tag -width indent .It Ic discovery-auth-group Aq Ar name -Assigns previously defined authentication group to that portal group, +Assigns previously defined authentication group to the portal group, to be used for target discovery. By default, portal groups that do not specify their own auth settings, using clauses such as "chap" or "initiator-name", are assigned @@ -146,10 +146,10 @@ using iSER (iSCSI over RDMA) protocol. The following statements are available at the target level: .Bl -tag -width indent .It Ic alias Aq Ar text -Assigns human-readable description to that target. +Assigns human-readable description to the target. There is no default. .It Ic auth-group Aq Ar name -Assigns previously defined authentication group to that target. +Assigns previously defined authentication group to the target. By default, targets that do not specify their own auth settings, using clauses such as "chap" or "initiator-name", are assigned predefined auth-group "default", which denies all access. @@ -187,7 +187,7 @@ ones will be allowed to connect. This clause is mutually exclusive with auth-group; one cannot use both in a single target. .It Ic portal-group Aq Ar name -Assigns previously defined portal group to that target. +Assigns previously defined portal group to the target. Default portal group is "default", which makes the target available on TCP port 3260 on all configured IPv4 and IPv6 addresses. .It Ic lun Aq Ar number @@ -203,7 +203,7 @@ Valid choices are and .Dq ramdisk ; block is used for LUNs backed -by files in the filesystem; ramdisk is a bitsink device, used mostly for +by files or disk device nodes; ramdisk is a bitsink device, used mostly for testing. The default backend is block. .It Ic blocksize Aq Ar size @@ -214,7 +214,7 @@ Specifies SCSI Device Identification str .It Ic option Ao Ar name Ac Aq Ar value Specifies CTL-specific options passed to the kernel. .It Ic path Aq Ar path -Specifies path to file used to back the LUN. +Specifies path to file or device node used to back the LUN. .It Ic serial Aq Ar string Specifies SCSI serial number presented to the initiator. .It Ic size Aq Ar size @@ -245,7 +245,7 @@ portal-group example2 { } target iqn.2012-06.com.example:target0 { - alias "Testing target" + alias "Example target" auth-group no-authentication lun 0 { path /dev/zvol/example_0 From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 08:03:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7D2E3853; Wed, 7 May 2014 08:03: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 693CD399; Wed, 7 May 2014 08:03:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4783VAm034696; Wed, 7 May 2014 08:03:31 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4783VsM034693; Wed, 7 May 2014 08:03:31 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070803.s4783VsM034693@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 08:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265531 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 08:03:31 -0000 Author: trasz Date: Wed May 7 08:03:30 2014 New Revision: 265531 URL: http://svnweb.freebsd.org/changeset/base/265531 Log: MFC r264355 by mav@: Remove unused val argument value from SYSCTL_INT() calls. Modified: stable/10/sys/dev/iscsi/icl.c stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed May 7 08:00:59 2014 (r265530) +++ stable/10/sys/dev/iscsi/icl.c Wed May 7 08:03:30 2014 (r265531) @@ -63,24 +63,24 @@ SYSCTL_NODE(_kern, OID_AUTO, icl, CTLFLA static int debug = 1; TUNABLE_INT("kern.icl.debug", &debug); SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RWTUN, - &debug, 1, "Enable debug messages"); + &debug, 0, "Enable debug messages"); static int coalesce = 1; TUNABLE_INT("kern.icl.coalesce", &coalesce); SYSCTL_INT(_kern_icl, OID_AUTO, coalesce, CTLFLAG_RWTUN, - &coalesce, 1, "Try to coalesce PDUs before sending"); + &coalesce, 0, "Try to coalesce PDUs before sending"); static int partial_receive_len = 128 * 1024; TUNABLE_INT("kern.icl.partial_receive_len", &partial_receive_len); SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, - &partial_receive_len, 1 * 1024, "Minimum read size for partially received " + &partial_receive_len, 0, "Minimum read size for partially received " "data segment"); static int sendspace = 1048576; TUNABLE_INT("kern.icl.sendspace", &sendspace); SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RWTUN, - &sendspace, 1048576, "Default send socket buffer size"); + &sendspace, 0, "Default send socket buffer size"); static int recvspace = 1048576; TUNABLE_INT("kern.icl.recvspace", &recvspace); SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RWTUN, - &recvspace, 1048576, "Default receive socket buffer size"); + &recvspace, 0, "Default receive socket buffer size"); static uma_zone_t icl_conn_zone; static uma_zone_t icl_pdu_zone; Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 08:00:59 2014 (r265530) +++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 08:03:30 2014 (r265531) @@ -79,23 +79,23 @@ SYSCTL_NODE(_kern, OID_AUTO, iscsi, CTLF static int debug = 1; TUNABLE_INT("kern.iscsi.debug", &debug); SYSCTL_INT(_kern_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, - &debug, 2, "Enable debug messages"); + &debug, 0, "Enable debug messages"); static int ping_timeout = 5; TUNABLE_INT("kern.iscsi.ping_timeout", &ping_timeout); SYSCTL_INT(_kern_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN, &ping_timeout, - 5, "Timeout for ping (NOP-Out) requests, in seconds"); + 0, "Timeout for ping (NOP-Out) requests, in seconds"); static int iscsid_timeout = 60; TUNABLE_INT("kern.iscsi.iscsid_timeout", &iscsid_timeout); SYSCTL_INT(_kern_iscsi, OID_AUTO, iscsid_timeout, CTLFLAG_RWTUN, &iscsid_timeout, - 60, "Time to wait for iscsid(8) to handle reconnection, in seconds"); + 0, "Time to wait for iscsid(8) to handle reconnection, in seconds"); static int login_timeout = 60; TUNABLE_INT("kern.iscsi.login_timeout", &login_timeout); SYSCTL_INT(_kern_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN, &login_timeout, - 60, "Time to wait for iscsid(8) to finish Login Phase, in seconds"); + 0, "Time to wait for iscsid(8) to finish Login Phase, in seconds"); static int maxtags = 255; TUNABLE_INT("kern.iscsi.maxtags", &maxtags); SYSCTL_INT(_kern_iscsi, OID_AUTO, maxtags, CTLFLAG_RWTUN, &maxtags, - 255, "Max number of IO requests queued"); + 0, "Max number of IO requests queued"); static int fail_on_disconnection = 0; TUNABLE_INT("kern.iscsi.fail_on_disconnection", &fail_on_disconnection); SYSCTL_INT(_kern_iscsi, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN, From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 08:04:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DF07B993; Wed, 7 May 2014 08:04: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 C98B23B0; Wed, 7 May 2014 08:04: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 s4784fcU034953; Wed, 7 May 2014 08:04:41 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4784frg034952; Wed, 7 May 2014 08:04:41 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405070804.s4784frg034952@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 7 May 2014 08:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265532 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 08:04:42 -0000 Author: trasz Date: Wed May 7 08:04:41 2014 New Revision: 265532 URL: http://svnweb.freebsd.org/changeset/base/265532 Log: MFC r264405: Fix periph listing when IOCTL buffer border hits result for wanted bus. Modified: stable/10/usr.bin/iscsictl/periphs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/periphs.c ============================================================================== --- stable/10/usr.bin/iscsictl/periphs.c Wed May 7 08:03:30 2014 (r265531) +++ stable/10/usr.bin/iscsictl/periphs.c Wed May 7 08:04:41 2014 (r265532) @@ -102,6 +102,9 @@ print_periphs(int session_id) ccb.cdm.num_patterns = 0; ccb.cdm.pattern_buf_len = 0; + skip_bus = 1; + skip_device = 1; + /* * We do the ioctl multiple times if necessary, in case there are * more than 100 nodes in the EDT. @@ -120,9 +123,6 @@ print_periphs(int session_id) break; } - skip_bus = 1; - skip_device = 1; - for (i = 0; i < ccb.cdm.num_matches; i++) { switch (ccb.cdm.matches[i].type) { case DEV_MATCH_BUS: { From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 08:06:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 68124AF0; Wed, 7 May 2014 08:06: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 52DD63D9; Wed, 7 May 2014 08:06: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 s4786vfM035482; Wed, 7 May 2014 08:06:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4786t5Z035466; Wed, 7 May 2014 08:06:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405070806.s4786t5Z035466@svn.freebsd.org> From: Xin LI Date: Wed, 7 May 2014 08:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265533 - in stable/10/usr.bin: bc dc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 08:06:57 -0000 Author: delphij Date: Wed May 7 08:06:54 2014 New Revision: 265533 URL: http://svnweb.freebsd.org/changeset/base/265533 Log: MFC r264573+264608+264609: Sync with OpenBSD. Added: stable/10/usr.bin/bc/tty.c - copied unchanged from r264573, head/usr.bin/bc/tty.c Modified: stable/10/usr.bin/bc/Makefile stable/10/usr.bin/bc/bc.1 stable/10/usr.bin/bc/bc.library stable/10/usr.bin/bc/bc.y stable/10/usr.bin/bc/extern.h stable/10/usr.bin/bc/scan.l stable/10/usr.bin/dc/bcode.c stable/10/usr.bin/dc/bcode.h stable/10/usr.bin/dc/dc.1 stable/10/usr.bin/dc/inout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bc/Makefile ============================================================================== --- stable/10/usr.bin/bc/Makefile Wed May 7 08:04:41 2014 (r265532) +++ stable/10/usr.bin/bc/Makefile Wed May 7 08:06:54 2014 (r265533) @@ -1,12 +1,12 @@ # $FreeBSD$ -# $OpenBSD: Makefile,v 1.4 2006/06/30 19:02:28 otto Exp $ +# $OpenBSD: Makefile,v 1.7 2013/09/19 16:12:00 otto Exp $ -PROG= bc -SRCS= bc.y scan.l -CFLAGS+= -I. -I${.CURDIR} +PROG= bc +SRCS= bc.y scan.l tty.c +CFLAGS+= -I. -I${.CURDIR} -DPADD= ${LIBEDIT} ${LIBTERMCAP} -LDADD= -ledit -ltermcap +LDADD+= -ledit -lcurses +DPADD+= ${LIBEDIT} ${LIBCURSES} NO_WMISSING_VARIABLE_DECLARATIONS= Modified: stable/10/usr.bin/bc/bc.1 ============================================================================== --- stable/10/usr.bin/bc/bc.1 Wed May 7 08:04:41 2014 (r265532) +++ stable/10/usr.bin/bc/bc.1 Wed May 7 08:06:54 2014 (r265533) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.\" $OpenBSD: bc.1,v 1.25 2010/01/02 19:48:56 schwarze Exp $ +.\" $OpenBSD: bc.1,v 1.30 2014/01/14 07:42:42 jmc Exp $ .\" .\" Copyright (C) Caldera International Inc. 2001-2002. .\" All rights reserved. @@ -35,7 +35,7 @@ .\" .\" @(#)bc.1 6.8 (Berkeley) 8/8/91 .\" -.Dd December 6, 2013 +.Dd April 16, 2014 .Dt BC 1 .Os .Sh NAME @@ -140,8 +140,7 @@ The following arithmetic and logical ope The semantics of the operators is the same as in the C language. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. -.Bl -column -offset indent "= += \-= *= /= %= ^=" "Associativity" \ -"multiply, divide, modulus" +.Bl -column "= += \-= *= /= %= ^=" "Associativity" "multiply, divide, modulus" -offset indent .It Sy "Operator" Ta Sy "Associativity" Ta Sy "Description" .It "++ \-\-" Ta "none" Ta "increment, decrement" .It "\-" Ta "none" Ta "unary minus" @@ -160,7 +159,7 @@ Note the following: .It The relational operators may appear in any expression. The -.St -p1003.2 +.St -p1003.1-2008 standard only allows them in the conditional expression of an .Sq if , .Sq while @@ -342,6 +341,22 @@ $ bc -l -e 'scale = 500; 2 * a(2^10000)' .Ed .Pp prints an approximation of pi. +.Sh COMMAND LINE EDITING +.Nm +supports interactive command line editing, via the +.Xr editline 3 +library. +It is enabled by default if input is from a tty. +Previous lines can be recalled and edited with the arrow keys, +and other GNU Emacs-style editing keys may be used as well. +.Pp +The +.Xr editline 3 +library is configured with a +.Pa .editrc +file \- refer to +.Xr editrc 5 +for more information. .Sh FILES .Bl -tag -width /usr/share/misc/bc.library -compact .It Pa /usr/share/misc/bc.library @@ -359,9 +374,6 @@ options are no-ops for compatibility wit and their use is discouraged. .Sh SEE ALSO .Xr dc 1 -.Pp -"BC \- An Arbitrary Precision Desk-Calculator Language", -.Pa /usr/share/doc/usd/06.bc/ . .Sh STANDARDS The .Nm @@ -370,7 +382,8 @@ utility is compliant with the specification. .Pp The flags -.Op Fl ce +.Op Fl ce , +as well as the parts noted above, are extensions to that specification. .Sh HISTORY The Modified: stable/10/usr.bin/bc/bc.library ============================================================================== --- stable/10/usr.bin/bc/bc.library Wed May 7 08:04:41 2014 (r265532) +++ stable/10/usr.bin/bc/bc.library Wed May 7 08:06:54 2014 (r265533) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $OpenBSD: bc.library,v 1.3 2007/02/03 21:15:06 otto Exp $ */ +/* $OpenBSD: bc.library,v 1.4 2012/03/14 07:35:53 otto Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -100,13 +100,13 @@ define l(x) { if (x < 1) { s = scale(x) } else { - s = length(x) - scale(x) + s = length(x)-scale(x) } scale = 0 a = (2.31*s)/1 /* estimated integer part of the answer */ s = t + length(a) + 2 /* estimated length of the answer */ while (x > 2) { - scale=0 + scale = 0 scale = (length(x) + scale(x))/2 + 1 if (scale < s) scale = s x = sqrt(x) Modified: stable/10/usr.bin/bc/bc.y ============================================================================== --- stable/10/usr.bin/bc/bc.y Wed May 7 08:04:41 2014 (r265532) +++ stable/10/usr.bin/bc/bc.y Wed May 7 08:06:54 2014 (r265533) @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: bc.y,v 1.33 2009/10/27 23:59:36 deraadt Exp $ */ +/* $OpenBSD: bc.y,v 1.44 2013/11/20 21:33:54 deraadt Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -53,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "pathnames.h" -#define BC_VER "1.0-FreeBSD" +#define BC_VER "1.1-FreeBSD" #define END_NODE ((ssize_t) -1) #define CONST_STRING ((ssize_t) -2) #define ALLOC_STRING ((ssize_t) -3) @@ -971,7 +970,12 @@ yyerror(const char *s) if (yyin != NULL && feof(yyin)) n = asprintf(&str, "%s: %s:%d: %s: unexpected EOF", __progname, filename, lineno, s); - else if (isspace(yytext[0]) || !isprint(yytext[0])) + else if (yytext[0] == '\n') + n = asprintf(&str, + "%s: %s:%d: %s: newline unexpected", + __progname, filename, lineno, s); + else if (isspace((unsigned char)yytext[0]) || + !isprint((unsigned char)yytext[0])) n = asprintf(&str, "%s: %s:%d: %s: ascii char 0x%02x unexpected", __progname, filename, lineno, s, yytext[0]); @@ -1085,26 +1089,25 @@ escape(const char *str) /* ARGSUSED */ static void -sigchld(int signo) +sigchld(int signo __unused) { pid_t pid; - int status; + int status, save_errno = errno; - switch (signo) { - default: - for (;;) { - pid = waitpid(dc, &status, WUNTRACED); - if (pid == -1) { - if (errno == EINTR) - continue; - _exit(0); - } - if (WIFEXITED(status) || WIFSIGNALED(status)) - _exit(0); - else - break; - } + for (;;) { + pid = waitpid(dc, &status, WCONTINUED | WNOHANG); + if (pid == -1) { + if (errno == EINTR) + continue; + _exit(0); + } else if (pid == 0) + break; + if (WIFEXITED(status) || WIFSIGNALED(status)) + _exit(0); + else + break; } + errno = save_errno; } static const char * @@ -1191,6 +1194,7 @@ main(int argc, char *argv[]) } } if (interactive) { + gettty(&ttysaved); el = el_init("bc", stdin, stderr, stderr); hist = history_init(); history(hist, &he, H_SETSIZE, 100); @@ -1198,6 +1202,8 @@ main(int argc, char *argv[]) el_set(el, EL_EDITOR, "emacs"); el_set(el, EL_SIGNAL, 1); el_set(el, EL_PROMPT, dummy_prompt); + el_set(el, EL_ADDFN, "bc_eof", "", bc_eof); + el_set(el, EL_BIND, "^D", "bc_eof", NULL); el_source(el, NULL); } yywrap(); Modified: stable/10/usr.bin/bc/extern.h ============================================================================== --- stable/10/usr.bin/bc/extern.h Wed May 7 08:04:41 2014 (r265532) +++ stable/10/usr.bin/bc/extern.h Wed May 7 08:06:54 2014 (r265533) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $OpenBSD: extern.h,v 1.6 2006/03/18 20:44:43 otto Exp $ */ +/* $OpenBSD: extern.h,v 1.10 2013/09/19 16:12:01 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -17,26 +17,31 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include struct lvalue { - ssize_t load; - ssize_t store; + ssize_t load; + ssize_t store; }; -int yylex(void); -void yyerror(const char *); -void fatal(const char *); -void abort_line(int); - -extern int lineno; -extern int fileindex; -extern int sargc; +int yylex(void); +void yyerror(const char *); +void fatal(const char *); +void abort_line(int); +struct termios; +int gettty(struct termios *); +void tstpcont(int); +unsigned char bc_eof(EditLine *, int); + +extern int lineno; +extern int fileindex; +extern int sargc; extern const char **sargv; extern const char *filename; -extern char *cmdexpr; extern bool interactive; extern EditLine *el; extern History *hist; extern HistEvent he; - +extern char *cmdexpr; +extern struct termios ttysaved; Modified: stable/10/usr.bin/bc/scan.l ============================================================================== --- stable/10/usr.bin/bc/scan.l Wed May 7 08:04:41 2014 (r265532) +++ stable/10/usr.bin/bc/scan.l Wed May 7 08:06:54 2014 (r265533) @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: scan.l,v 1.23 2009/10/27 23:59:36 deraadt Exp $ */ +/* $OpenBSD: scan.l,v 1.28 2013/09/19 16:12:01 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -31,19 +32,22 @@ __FBSDID("$FreeBSD$"); #include "bc.h" #include "pathnames.h" -int lineno; +int lineno; +bool interactive; -bool interactive; HistEvent he; EditLine *el; History *hist; static char *strbuf = NULL; -static size_t strbuf_sz = 1; -static bool dot_seen; +static size_t strbuf_sz = 1; +static bool dot_seen; +static int use_el; +static volatile sig_atomic_t skipchars; + +static void init_strbuf(void); +static void add_str(const char *); -static void init_strbuf(void); -static void add_str(const char *); static int bc_yyinput(char *, int); #define YY_DECL int yylex(void) @@ -51,6 +55,7 @@ static int bc_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(buf,retval,max) \ (retval = bc_yyinput(buf, max)) + %} %option always-interactive @@ -102,7 +107,7 @@ ALPHANUM [a-z_0-9] BEGIN(INITIAL); yylval.str = strbuf; unput('.'); - return (NUMBER); + return NUMBER; } else { dot_seen = true; add_str("."); @@ -113,73 +118,73 @@ ALPHANUM [a-z_0-9] BEGIN(INITIAL); unput(yytext[0]); if (strcmp(strbuf, ".") == 0) - return (DOT); + return DOT; else { yylval.str = strbuf; - return (NUMBER); + return NUMBER; } } } -"auto" return (AUTO); -"break" return (BREAK); -"continue" return (CONTINUE); -"define" return (DEFINE); -"else" return (ELSE); -"ibase" return (IBASE); -"if" return (IF); -"last" return (DOT); -"for" return (FOR); -"length" return (LENGTH); -"obase" return (OBASE); -"print" return (PRINT); -"quit" return (QUIT); -"return" return (RETURN); -"scale" return (SCALE); -"sqrt" return (SQRT); -"while" return (WHILE); - -"^" return (EXPONENT); -"*" return (MULTIPLY); -"/" return (DIVIDE); -"%" return (REMAINDER); - -"!" return (BOOL_NOT); -"&&" return (BOOL_AND); -"||" return (BOOL_OR); - -"+" return (PLUS); -"-" return (MINUS); - -"++" return (INCR); -"--" return (DECR); - -"=" yylval.str = ""; return (ASSIGN_OP); -"+=" yylval.str = "+"; return (ASSIGN_OP); -"-=" yylval.str = "-"; return (ASSIGN_OP); -"*=" yylval.str = "*"; return (ASSIGN_OP); -"/=" yylval.str = "/"; return (ASSIGN_OP); -"%=" yylval.str = "%"; return (ASSIGN_OP); -"^=" yylval.str = "^"; return (ASSIGN_OP); - -"==" return (EQUALS); -"<=" return (LESS_EQ); -">=" return (GREATER_EQ); -"!=" return (UNEQUALS); -"<" return (LESS); -">" return (GREATER); - -"," return (COMMA); -";" return (SEMICOLON); +"auto" return AUTO; +"break" return BREAK; +"continue" return CONTINUE; +"define" return DEFINE; +"else" return ELSE; +"ibase" return IBASE; +"if" return IF; +"last" return DOT; +"for" return FOR; +"length" return LENGTH; +"obase" return OBASE; +"print" return PRINT; +"quit" return QUIT; +"return" return RETURN; +"scale" return SCALE; +"sqrt" return SQRT; +"while" return WHILE; + +"^" return EXPONENT; +"*" return MULTIPLY; +"/" return DIVIDE; +"%" return REMAINDER; + +"!" return BOOL_NOT; +"&&" return BOOL_AND; +"||" return BOOL_OR; + +"+" return PLUS; +"-" return MINUS; + +"++" return INCR; +"--" return DECR; + +"=" yylval.str = ""; return ASSIGN_OP; +"+=" yylval.str = "+"; return ASSIGN_OP; +"-=" yylval.str = "-"; return ASSIGN_OP; +"*=" yylval.str = "*"; return ASSIGN_OP; +"/=" yylval.str = "/"; return ASSIGN_OP; +"%=" yylval.str = "%"; return ASSIGN_OP; +"^=" yylval.str = "^"; return ASSIGN_OP; + +"==" return EQUALS; +"<=" return LESS_EQ; +">=" return GREATER_EQ; +"!=" return UNEQUALS; +"<" return LESS; +">" return GREATER; + +"," return COMMA; +";" return SEMICOLON; -"(" return (LPAR); -")" return (RPAR); +"(" return LPAR; +")" return RPAR; -"[" return (LBRACKET); -"]" return (RBRACKET); +"[" return LBRACKET; +"]" return RBRACKET; -"{" return (LBRACE); -"}" return (RBRACE); +"{" return LBRACE; +"}" return RBRACE; {ALPHA}{ALPHANUM}* { /* alloc an extra byte for the type marker */ @@ -188,15 +193,15 @@ ALPHANUM [a-z_0-9] err(1, NULL); strlcpy(p, yytext, yyleng + 1); yylval.astr = p; - return (LETTER); + return LETTER; } \\\n lineno++; -\n lineno++; return (NEWLINE); +\n lineno++; return NEWLINE; #[^\n]* ; [ \t] ; -<> return (QUIT); +<> return QUIT; . yyerror("illegal character"); %% @@ -204,7 +209,6 @@ ALPHANUM [a-z_0-9] static void init_strbuf(void) { - if (strbuf == NULL) { strbuf = malloc(strbuf_sz); if (strbuf == NULL) @@ -221,8 +225,8 @@ add_str(const char *str) arglen = strlen(str); if (strlen(strbuf) + arglen + 1 > strbuf_sz) { - size_t newsize; - char *p; + size_t newsize; + char *p; newsize = strbuf_sz + arglen + 1; p = realloc(strbuf, newsize); @@ -236,11 +240,47 @@ add_str(const char *str) strlcat(strbuf, str, strbuf_sz); } +/* ARGSUSED */ +void +abort_line(int sig __unused) +{ + static const char str1[] = "[\n]P\n"; + static const char str2[] = "[^C\n]P\n"; + int save_errno; + const LineInfo *info; + + save_errno = errno; + if (use_el) { + write(STDOUT_FILENO, str2, sizeof(str2) - 1); + info = el_line(el); + skipchars = info->lastchar - info->buffer; + } else + write(STDOUT_FILENO, str1, sizeof(str1) - 1); + errno = save_errno; +} + +/* + * Avoid the echo of ^D by the default code of editline and take + * into account skipchars to make ^D work when the cursor is at start of + * line after a ^C. + */ +unsigned char +bc_eof(EditLine *e, int ch __unused) +{ + const struct lineinfo *info = el_line(e); + + if (info->buffer + skipchars == info->cursor && + info->cursor == info->lastchar) + return (CC_EOF); + else + return (CC_ERROR); +} + int yywrap(void) { - static YY_BUFFER_STATE buf; static int state; + static YY_BUFFER_STATE buf; if (fileindex == 0 && sargc > 0 && strcmp(sargv[0], _PATH_LIBB) == 0) { filename = sargv[fileindex++]; @@ -273,6 +313,10 @@ yywrap(void) } else if (fileindex == sargc) { fileindex++; yyin = stdin; + if (interactive) { + signal(SIGINT, abort_line); + signal(SIGTSTP, tstpcont); + } lineno = 1; filename = "stdin"; return (0); @@ -284,17 +328,32 @@ static int bc_yyinput(char *buf, int maxlen) { int num; - if (yyin == stdin && interactive) { + + if (el != NULL) + el_get(el, EL_EDITMODE, &use_el); + + if (yyin == stdin && interactive && use_el) { const char *bp; + sigset_t oset, nset; if ((bp = el_gets(el, &num)) == NULL || num == 0) return (0); + sigemptyset(&nset); + sigaddset(&nset, SIGINT); + sigprocmask(SIG_BLOCK, &nset, &oset); + if (skipchars < num) { + bp += skipchars; + num -= skipchars; + } + skipchars = 0; + sigprocmask(SIG_SETMASK, &oset, NULL); if (num > maxlen) { - el_push(el, (char *)(uintptr_t)(bp) + maxlen); + el_push(el, bp + maxlen); num = maxlen; } memcpy(buf, bp, num); history(hist, &he, H_ENTER, bp); + el_get(el, EL_EDITMODE, &use_el); } else { int c = '*'; for (num = 0; num < maxlen && @@ -308,3 +367,4 @@ bc_yyinput(char *buf, int maxlen) return (num); } + Copied: stable/10/usr.bin/bc/tty.c (from r264573, head/usr.bin/bc/tty.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/bc/tty.c Wed May 7 08:06:54 2014 (r265533, copy of r264573, head/usr.bin/bc/tty.c) @@ -0,0 +1,65 @@ +/* $FreeBSD$ */ +/* $OpenBSD: tty.c,v 1.2 2013/11/12 13:54:51 deraadt Exp $ */ + +/* + * Copyright (c) 2013, Otto Moerbeek + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include +#include +#include "extern.h" + +struct termios ttysaved, ttyedit; + +static int +settty(struct termios *t) +{ + int ret; + + while ((ret = tcsetattr(0, TCSADRAIN, t) == -1) && errno == EINTR) + continue; + return ret; +} + +int +gettty(struct termios *t) +{ + int ret; + + while ((ret = tcgetattr(0, t) == -1) && errno == EINTR) + continue; + return ret; +} + +/* ARGSUSED */ +void +tstpcont(int sig) +{ + int save_errno = errno; + + if (sig == SIGTSTP) { + signal(SIGCONT, tstpcont); + gettty(&ttyedit); + settty(&ttysaved); + } else { + signal(SIGTSTP, tstpcont); + settty(&ttyedit); + } + signal(sig, SIG_DFL); + kill(0, sig); + errno = save_errno; +} Modified: stable/10/usr.bin/dc/bcode.c ============================================================================== --- stable/10/usr.bin/dc/bcode.c Wed May 7 08:04:41 2014 (r265532) +++ stable/10/usr.bin/dc/bcode.c Wed May 7 08:06:54 2014 (r265533) @@ -1,4 +1,4 @@ -/* $OpenBSD: bcode.c,v 1.40 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: bcode.c,v 1.45 2012/11/07 11:06:14 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -#define __inline +/* #define DEBUGGING */ #define MAX_ARRAY_INDEX 2048 #define READSTACK_SIZE 8 @@ -253,7 +253,7 @@ init_bmachine(bool extended_registers) u_int bmachine_scale(void) { - return (bmachine.scale); + return bmachine.scale; } /* Reset the things needed before processing a (new) file */ @@ -428,7 +428,6 @@ get_ulong(struct number *n) void negate(struct number *n) { - BN_set_negative(n->number, !BN_is_negative(n->number)); } @@ -695,7 +694,7 @@ count_digits(const struct number *n) u_int i; if (BN_is_zero(n->number)) - return (n->scale ? n->scale : 1); + return n->scale ? n->scale : 1; int_part = new_number(); fract_part = new_number(); @@ -1171,9 +1170,10 @@ bdivmod(void) static void bexp(void) { - struct number *a, *p, *r; - u_int rscale; - bool neg; + struct number *a, *p; + struct number *r; + bool neg; + u_int rscale; p = pop_number(); if (p == NULL) { @@ -1193,8 +1193,7 @@ bexp(void) bn_checkp(f); split_number(p, i, f); if (!BN_is_zero(f)) - warnx("Runtime warning: non-zero fractional part " - "in exponent"); + warnx("Runtime warning: non-zero fractional part in exponent"); BN_free(i); BN_free(f); } Modified: stable/10/usr.bin/dc/bcode.h ============================================================================== --- stable/10/usr.bin/dc/bcode.h Wed May 7 08:04:41 2014 (r265532) +++ stable/10/usr.bin/dc/bcode.h Wed May 7 08:06:54 2014 (r265533) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $OpenBSD: bcode.h,v 1.5 2006/01/16 08:09:25 otto Exp $ */ +/* $OpenBSD: bcode.h,v 1.7 2012/11/07 11:06:14 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -83,15 +83,15 @@ struct source { int lastchar; }; -void init_bmachine(bool); -void reset_bmachine(struct source *); -u_int bmachine_scale(void); -void scale_number(BIGNUM *, int); -void normalize(struct number *, u_int); -void eval(void); -void pn(const char *, const struct number *); -void pbn(const char *, const BIGNUM *); -void negate(struct number *); -void split_number(const struct number *, BIGNUM *, BIGNUM *); -void bmul_number(struct number *, struct number *, - struct number *, u_int); +void init_bmachine(bool); +void reset_bmachine(struct source *); +u_int bmachine_scale(void); +void scale_number(BIGNUM *, int); +void normalize(struct number *, u_int); +void eval(void); +void pn(const char *, const struct number *); +void pbn(const char *, const BIGNUM *); +void negate(struct number *); +void split_number(const struct number *, BIGNUM *, BIGNUM *); +void bmul_number(struct number *, struct number *, + struct number *, u_int scale); Modified: stable/10/usr.bin/dc/dc.1 ============================================================================== --- stable/10/usr.bin/dc/dc.1 Wed May 7 08:04:41 2014 (r265532) +++ stable/10/usr.bin/dc/dc.1 Wed May 7 08:06:54 2014 (r265533) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.\" $OpenBSD: dc.1,v 1.24 2010/01/02 19:48:56 schwarze Exp $ +.\" $OpenBSD: dc.1,v 1.27 2012/08/19 12:07:21 jmc Exp $ .\" .\" Copyright (C) Caldera International Inc. 2001-2002. .\" All rights reserved. @@ -35,7 +35,7 @@ .\" .\" @(#)dc.1 8.1 (Berkeley) 6/6/93 .\" -.Dd January 22, 2010 +.Dd April 16, 2014 .Dt DC 1 .Os .Sh NAME @@ -73,12 +73,6 @@ Evaluate If multiple .Fl e options are specified, they will be processed in the order given. -If no -.Ar filename -argument is given, execution will stop after processing the expressions -given on the command line, -otherwise processing will continue with the contents of -.Ar filename . .It Fl f Ar filename , Fl Fl file Ar filename Process the content of the given file before further calculations are done. If multiple @@ -98,14 +92,26 @@ See for a more detailed description. .El .Pp +If neither +.Ar expression +nor +.Ar file +are specified on the command line, +.Nm +reads from the standard input. +Otherwise +.Ar expression +and +.Ar file +are processed and +.Nm +exits. +.Pp Ordinarily, .Nm operates on decimal integers, but one may specify an input base, output base, and a number of fractional digits (scale) to be maintained. -If an argument is given, -input is taken from that file until its end, -then from the standard input. Whitespace is ignored, except where it signals the end of a number, end of a line or when a register name is expected. The following constructions are recognized: Modified: stable/10/usr.bin/dc/inout.c ============================================================================== --- stable/10/usr.bin/dc/inout.c Wed May 7 08:04:41 2014 (r265532) +++ stable/10/usr.bin/dc/inout.c Wed May 7 08:06:54 2014 (r265533) @@ -1,4 +1,4 @@ -/* $OpenBSD: inout.c,v 1.15 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: inout.c,v 1.17 2012/11/07 11:06:14 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 09:55:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F2D8FCED; Wed, 7 May 2014 09:55: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 D13BC11A; Wed, 7 May 2014 09:55: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 s479tmw5085312; Wed, 7 May 2014 09:55:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s479tlrA085306; Wed, 7 May 2014 09:55:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405070955.s479tlrA085306@svn.freebsd.org> From: Marius Strobl Date: Wed, 7 May 2014 09:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265536 - in stable/10: sbin/gvinum sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 09:55:49 -0000 Author: marius Date: Wed May 7 09:55:47 2014 New Revision: 265536 URL: http://svnweb.freebsd.org/changeset/base/265536 Log: MFC: r265248 Allow GEOM_VINUM to be statically compiled into the kernel. Submitted by: gleb Modified: stable/10/sbin/gvinum/gvinum.c stable/10/sbin/gvinum/gvinum.h stable/10/sys/conf/NOTES stable/10/sys/conf/files stable/10/sys/conf/options Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/gvinum/gvinum.c ============================================================================== --- stable/10/sbin/gvinum/gvinum.c Wed May 7 09:15:46 2014 (r265535) +++ stable/10/sbin/gvinum/gvinum.c Wed May 7 09:55:47 2014 (r265536) @@ -95,8 +95,10 @@ main(int argc, char **argv) char buffer[BUFSIZ], *inputline, *token[GV_MAXARGS]; /* Load the module if necessary. */ - if (kldfind(GVINUMMOD) < 0 && kldload(GVINUMMOD) < 0) - err(1, GVINUMMOD ": Kernel module not available"); + if (modfind(GVINUMMOD) < 0) { + if (kldload(GVINUMKLD) < 0 && modfind(GVINUMMOD) < 0) + err(1, GVINUMKLD ": Kernel module not available"); + } /* Arguments given on the command line. */ if (argc > 1) { @@ -1204,9 +1206,10 @@ gvinum_stop(int argc, char **argv) { int err, fileid; - fileid = kldfind(GVINUMMOD); + fileid = kldfind(GVINUMKLD); if (fileid == -1) { - warn("cannot find " GVINUMMOD); + if (modfind(GVINUMMOD) < 0) + warn("cannot find " GVINUMKLD); return; } @@ -1216,7 +1219,7 @@ gvinum_stop(int argc, char **argv) * event thread will be free for the g_wither_geom() call from * gv_unload(). It's silly, but it works. */ - printf("unloading " GVINUMMOD " kernel module... "); + printf("unloading " GVINUMKLD " kernel module... "); fflush(stdout); if ((err = kldunload(fileid)) != 0 && (errno == EAGAIN)) { sleep(1); @@ -1224,7 +1227,7 @@ gvinum_stop(int argc, char **argv) } if (err != 0) { printf(" failed!\n"); - warn("cannot unload " GVINUMMOD); + warn("cannot unload " GVINUMKLD); return; } Modified: stable/10/sbin/gvinum/gvinum.h ============================================================================== --- stable/10/sbin/gvinum/gvinum.h Wed May 7 09:15:46 2014 (r265535) +++ stable/10/sbin/gvinum/gvinum.h Wed May 7 09:55:47 2014 (r265536) @@ -36,4 +36,5 @@ /* $FreeBSD$ */ -#define GVINUMMOD "geom_vinum" +#define GVINUMMOD "g_vinum" +#define GVINUMKLD "geom_vinum" Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Wed May 7 09:15:46 2014 (r265535) +++ stable/10/sys/conf/NOTES Wed May 7 09:55:47 2014 (r265536) @@ -176,6 +176,7 @@ options GEOM_SHSEC # Shared secret. options GEOM_STRIPE # Disk striping. options GEOM_SUNLABEL # Sun/Solaris partitioning options GEOM_UZIP # Read-only compressed disks +options GEOM_VINUM # Vinum logical volume manager options GEOM_VIRSTOR # Virtual storage. options GEOM_VOL # Volume names from UFS superblock options GEOM_ZERO # Performance testing helper. Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Wed May 7 09:15:46 2014 (r265535) +++ stable/10/sys/conf/files Wed May 7 09:55:47 2014 (r265536) @@ -2788,6 +2788,21 @@ contrib/xz-embedded/linux/lib/xz/xz_dec_ optional xz_embedded | geom_uncompress \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" geom/uzip/g_uzip.c optional geom_uzip +geom/vinum/geom_vinum.c optional geom_vinum +geom/vinum/geom_vinum_create.c optional geom_vinum +geom/vinum/geom_vinum_drive.c optional geom_vinum +geom/vinum/geom_vinum_plex.c optional geom_vinum +geom/vinum/geom_vinum_volume.c optional geom_vinum +geom/vinum/geom_vinum_subr.c optional geom_vinum +geom/vinum/geom_vinum_raid5.c optional geom_vinum +geom/vinum/geom_vinum_share.c optional geom_vinum +geom/vinum/geom_vinum_list.c optional geom_vinum +geom/vinum/geom_vinum_rm.c optional geom_vinum +geom/vinum/geom_vinum_init.c optional geom_vinum +geom/vinum/geom_vinum_state.c optional geom_vinum +geom/vinum/geom_vinum_rename.c optional geom_vinum +geom/vinum/geom_vinum_move.c optional geom_vinum +geom/vinum/geom_vinum_events.c optional geom_vinum geom/virstor/binstream.c optional geom_virstor geom/virstor/g_virstor.c optional geom_virstor geom/virstor/g_virstor_md.c optional geom_virstor Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Wed May 7 09:15:46 2014 (r265535) +++ stable/10/sys/conf/options Wed May 7 09:55:47 2014 (r265536) @@ -123,6 +123,7 @@ GEOM_STRIPE opt_geom.h GEOM_SUNLABEL opt_geom.h GEOM_UNCOMPRESS opt_geom.h GEOM_UZIP opt_geom.h +GEOM_VINUM opt_geom.h GEOM_VIRSTOR opt_geom.h GEOM_VOL opt_geom.h GEOM_ZERO opt_geom.h From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 11:49:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC2B04FF; Wed, 7 May 2014 11:49:06 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 97082D51; Wed, 7 May 2014 11:49:06 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 8638146B60; Wed, 7 May 2014 07:49:05 -0400 (EDT) Date: Wed, 7 May 2014 12:49:05 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Edward Tomasz Napierala Subject: Re: svn commit: r265498 - stable/10/sys/dev/iscsi In-Reply-To: <201405070638.s476cK2J092699@svn.freebsd.org> Message-ID: References: <201405070638.s476cK2J092699@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 11:49:06 -0000 On Wed, 7 May 2014, Edward Tomasz Napierala wrote: > Author: trasz > Date: Wed May 7 06:38:19 2014 > New Revision: 265498 > URL: http://svnweb.freebsd.org/changeset/base/265498 > > Log: > MFC r264025: > > Get rid of the "autoscaling", instead just set socket buffer sizes > in the usual way. The only thing the old code did was making things > less predictable. Does this mean that the autoscaling algorithm needs refining? The problem with disabling autoscaling is that the code may, in the future, fail to benefit from further global refinements, as old code that hard-coded sizes now fails to do -- and that if we don't refine the autoscaling model, other applications may fail to benefit. Robert From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 12:48:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 16FF1D20; Wed, 7 May 2014 12:48: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 0409B2D0; Wed, 7 May 2014 12:48: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 s47CmIBB064492; Wed, 7 May 2014 12:48:18 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47CmIVi064491; Wed, 7 May 2014 12:48:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405071248.s47CmIVi064491@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 12:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265545 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 12:48:19 -0000 Author: gjb Date: Wed May 7 12:48:18 2014 New Revision: 265545 URL: http://svnweb.freebsd.org/changeset/base/265545 Log: Document r265388, addition of mpr(4). Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:45:33 2014 (r265544) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:48:18 2014 (r265545) @@ -134,6 +134,10 @@ which allows controlling how long the system will wait after &man.panic.9; before rebooting. + The &man.mpr.4; device has been added, + providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA + controllers. + Virtualization support From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 16:07:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E0643FCE; Wed, 7 May 2014 16:06:59 +0000 (UTC) Received: from mail-ee0-x231.google.com (mail-ee0-x231.google.com [IPv6:2a00:1450:4013: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 D74A4B6E; Wed, 7 May 2014 16:06:58 +0000 (UTC) Received: by mail-ee0-f49.google.com with SMTP id e53so898256eek.36 for ; Wed, 07 May 2014 09:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=pPEYMBo0fmwSyo6ZjM6Ffys4wiN8wHn2WGBl4QEL90w=; b=UDlxBkoMjpEMn5cHRGtUqVH73zlknheKS05MbPlNbreF7dO/HzBV0eYajZRTMa7cPI IoqUVIz68sjRv0lvSjHpig5w2sbG6jNVQQvlEDtHXxrDOYpodB6RUXv2+VZOEapt2afa 3XGQemMrDzRyFIRJcRzMpZBaMueMN5LLuzqkSLSofuKR+RFq7k6KQxXVV4e64tI5DBRh sUYTqA8+0b3sWDpQO9+P4hwLf2cwt3Sq3nBAesExKtGSldoAfzUSBroQaJv9TdoxZVuL dJSBjb30U4IiRPbiWl481rfbP7q1cTqm5o8kJmRW0dBMDLeMpjsQfKP5sIUpj47OUMBh R92A== X-Received: by 10.14.213.6 with SMTP id z6mr16636557eeo.98.1399478816896; Wed, 07 May 2014 09:06:56 -0700 (PDT) Received: from strashydlo.home (aeaw217.neoplus.adsl.tpnet.pl. [79.186.22.217]) by mx.google.com with ESMTPSA id z48sm47263826eel.27.2014.05.07.09.06.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 09:06:56 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Subject: Re: svn commit: r265498 - stable/10/sys/dev/iscsi Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: Date: Wed, 7 May 2014 18:06:53 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405070638.s476cK2J092699@svn.freebsd.org> To: Robert Watson X-Mailer: Apple Mail (2.1283) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 16:07:00 -0000 Wiadomo=B6=E6 napisana przez Robert Watson w dniu 7 maj 2014, o godz. = 13:49: > On Wed, 7 May 2014, Edward Tomasz Napierala wrote: >=20 >> Author: trasz >> Date: Wed May 7 06:38:19 2014 >> New Revision: 265498 >> URL: http://svnweb.freebsd.org/changeset/base/265498 >>=20 >> Log: >> MFC r264025: >>=20 >> Get rid of the "autoscaling", instead just set socket buffer sizes >> in the usual way. The only thing the old code did was making things >> less predictable. >=20 > Does this mean that the autoscaling algorithm needs refining? The = problem with disabling autoscaling is that the code may, in the future, = fail to benefit from further global refinements, as old code that = hard-coded sizes now fails to do -- and that if we don't refine the = autoscaling model, other applications may fail to benefit. The commit message here was misleading - what got replaced was setting the socket buffer size "by hand" to a value computed from negotiated maximum PDU size. Now it's set to constant size. The reason we do not use autoscaling here is not performance. It's because iSCSI code can't transmit a part of PDU; it always waits until there is room for the whole thing (PDUs can be up to about 128kB in size). If the socket buffer size somehow got autoscaled below that amount, the transmit would stop indefinitely. There is a somewhat similar situation on the receive side. So, the right solution would be to either use autoscaling, but with a guarantee that the socket buffer won't shrink below some specified value, or have a way to determine that the socket buffer won't get any bigger anytime soon and so the iSCSI should transmit or receive a part of PDU. Current setting "by hand" is just a workaround, albeit pretty well working one. From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 16:52:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 392909FC; Wed, 7 May 2014 16:52: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 0986EBD; Wed, 7 May 2014 16:52: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 s47GqT2q073994; Wed, 7 May 2014 16:52:29 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47GqT27073993; Wed, 7 May 2014 16:52:29 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405071652.s47GqT27073993@svn.freebsd.org> From: Jim Harris Date: Wed, 7 May 2014 16:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265567 - stable/10/sbin/nvmecontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 16:52:30 -0000 Author: jimharris Date: Wed May 7 16:52:29 2014 New Revision: 265567 URL: http://svnweb.freebsd.org/changeset/base/265567 Log: MFC r258071: Check for special status code from FIRMWARE_ACTIVATE command signifying that a reboot is required to complete activation of the requested firmware image. Modified: stable/10/sbin/nvmecontrol/firmware.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/nvmecontrol/firmware.c ============================================================================== --- stable/10/sbin/nvmecontrol/firmware.c Wed May 7 16:48:43 2014 (r265566) +++ stable/10/sbin/nvmecontrol/firmware.c Wed May 7 16:52:29 2014 (r265567) @@ -141,7 +141,7 @@ update_firmware(int fd, uint8_t *payload } } -static void +static int activate_firmware(int fd, int slot, int activate_action) { struct nvme_pt_command pt; @@ -154,8 +154,14 @@ activate_firmware(int fd, int slot, int if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) err(1, "firmware activate request failed"); + if (pt.cpl.status.sct == NVME_SCT_COMMAND_SPECIFIC && + pt.cpl.status.sc == NVME_SC_FIRMWARE_REQUIRES_RESET) + return 1; + if (nvme_completion_is_error(&pt.cpl)) errx(1, "firmware activate request returned error"); + + return 0; } static void @@ -171,6 +177,7 @@ firmware(int argc, char *argv[]) { int fd = -1, slot = 0; int a_flag, s_flag, f_flag; + int activate_action, reboot_required; char ch, *p, *image = NULL; char *controller = NULL, prompt[64]; void *buf = NULL; @@ -287,21 +294,27 @@ firmware(int argc, char *argv[]) if (f_flag) { update_firmware(fd, buf, size); if (a_flag) - activate_firmware(fd, slot, - NVME_AA_REPLACE_ACTIVATE); + activate_action = NVME_AA_REPLACE_ACTIVATE; else - activate_firmware(fd, slot, - NVME_AA_REPLACE_NO_ACTIVATE); + activate_action = NVME_AA_REPLACE_NO_ACTIVATE; } else { - activate_firmware(fd, slot, NVME_AA_ACTIVATE); + activate_action = NVME_AA_ACTIVATE; } + reboot_required = activate_firmware(fd, slot, activate_action); + if (a_flag) { - printf("New firmware image activated and will take " - "effect after next controller reset.\n" - "Controller reset can be initiated via " - "'nvmecontrol reset %s'\n", - controller); + if (reboot_required) { + printf("New firmware image activated but requires " + "conventional reset (i.e. reboot) to " + "complete activation.\n"); + } else { + printf("New firmware image activated and will take " + "effect after next controller reset.\n" + "Controller reset can be initiated via " + "'nvmecontrol reset %s'\n", + controller); + } } close(fd); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 16:53:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D952AB3B; Wed, 7 May 2014 16:53: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 C6277CA; Wed, 7 May 2014 16:53: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 s47GrgMK074158; Wed, 7 May 2014 16:53:42 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47GrgY1074157; Wed, 7 May 2014 16:53:42 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405071653.s47GrgY1074157@svn.freebsd.org> From: Jim Harris Date: Wed, 7 May 2014 16:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265568 - stable/10/sbin/nvmecontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 16:53:42 -0000 Author: jimharris Date: Wed May 7 16:53:42 2014 New Revision: 265568 URL: http://svnweb.freebsd.org/changeset/base/265568 Log: MFC r260381: For "nvmecontrol devlist", show namespace sizes in terms of MB instead of GB to improve granularity of the reporting - especially for namespaces that are on the order of 1 or 2 GB. Modified: stable/10/sbin/nvmecontrol/devlist.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/nvmecontrol/devlist.c ============================================================================== --- stable/10/sbin/nvmecontrol/devlist.c Wed May 7 16:52:29 2014 (r265567) +++ stable/10/sbin/nvmecontrol/devlist.c Wed May 7 16:53:42 2014 (r265568) @@ -99,11 +99,11 @@ devlist(int argc, char *argv[]) sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr, NVME_NS_PREFIX, i+1); read_namespace_data(fd, i+1, &nsdata); - printf(" %10s (%lldGB)\n", + printf(" %10s (%lldMB)\n", name, nsdata.nsze * (long long)ns_get_sector_size(&nsdata) / - 1024 / 1024 / 1024); + 1024 / 1024); } close(fd); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 16:55:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B7FE2C7A; Wed, 7 May 2014 16:55:08 +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 8B0E2D2; Wed, 7 May 2014 16:55:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47Gt83D074433; Wed, 7 May 2014 16:55:08 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47Gt8MH074432; Wed, 7 May 2014 16:55:08 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405071655.s47Gt8MH074432@svn.freebsd.org> From: Jim Harris Date: Wed, 7 May 2014 16:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265569 - stable/10/sys/dev/nvme X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 16:55:08 -0000 Author: jimharris Date: Wed May 7 16:55:08 2014 New Revision: 265569 URL: http://svnweb.freebsd.org/changeset/base/265569 Log: MFC r260382: For IDENTIFY passthrough commands to Chatham prototype controllers, copy the spoofed identify data into the user buffer rather than issuing the command to the controller, since Chatham IDENTIFY data is always spoofed. While here, fix a bug in the spoofed data for Chatham submission and completion queue entry sizes. Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_ctrlr.c Wed May 7 16:53:42 2014 (r265568) +++ stable/10/sys/dev/nvme/nvme_ctrlr.c Wed May 7 16:55:08 2014 (r265569) @@ -181,8 +181,8 @@ nvme_chatham_populate_cdata(struct nvme_ cdata->lpa.ns_smart = 1; cdata->sqes.min = 6; cdata->sqes.max = 6; - cdata->sqes.min = 4; - cdata->sqes.max = 4; + cdata->cqes.min = 4; + cdata->cqes.max = 4; cdata->nn = 1; /* Chatham2 doesn't support DSM command */ @@ -1041,6 +1041,27 @@ nvme_ctrlr_ioctl(struct cdev *cdev, u_lo break; case NVME_PASSTHROUGH_CMD: pt = (struct nvme_pt_command *)arg; +#ifdef CHATHAM2 + /* + * Chatham IDENTIFY data is spoofed, so copy the spoofed data + * rather than issuing the command to the Chatham controller. + */ + if (pci_get_devid(ctrlr->dev) == CHATHAM_PCI_ID && + pt->cmd.opc == NVME_OPC_IDENTIFY) { + if (pt->cmd.cdw10 == 1) { + if (pt->len != sizeof(ctrlr->cdata)) + return (EINVAL); + return (copyout(&ctrlr->cdata, pt->buf, + pt->len)); + } else { + if (pt->len != sizeof(ctrlr->ns[0].data) || + pt->cmd.nsid != 1) + return (EINVAL); + return (copyout(&ctrlr->ns[0].data, pt->buf, + pt->len)); + } + } +#endif return (nvme_ctrlr_passthrough_cmd(ctrlr, pt, pt->cmd.nsid, 1 /* is_user_buffer */, 1 /* is_admin_cmd */)); default: From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 16:56:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2DF04DB5; Wed, 7 May 2014 16:56: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 1AADEDF; Wed, 7 May 2014 16:56: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 s47GuKsc074607; Wed, 7 May 2014 16:56:20 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47GuKLo074605; Wed, 7 May 2014 16:56:20 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405071656.s47GuKLo074605@svn.freebsd.org> From: Jim Harris Date: Wed, 7 May 2014 16:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265570 - stable/10/sys/dev/isci/scil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 16:56:21 -0000 Author: jimharris Date: Wed May 7 16:56:20 2014 New Revision: 265570 URL: http://svnweb.freebsd.org/changeset/base/265570 Log: MFC r263275: isci: Ensure ATA passthrough commands with RETURN_RESPONSE bit set translate their response. Modified: stable/10/sys/dev/isci/scil/sati_passthrough.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isci/scil/sati_passthrough.c ============================================================================== --- stable/10/sys/dev/isci/scil/sati_passthrough.c Wed May 7 16:55:08 2014 (r265569) +++ stable/10/sys/dev/isci/scil/sati_passthrough.c Wed May 7 16:56:20 2014 (r265570) @@ -441,6 +441,13 @@ SATI_STATUS sati_passthrough_16_translat sati_set_ata_lba_mid_exp(register_fis, sati_get_cdb_byte(cdb, 9)); sati_set_ata_lba_high_exp(register_fis, sati_get_cdb_byte(cdb, 11)); } + + if (PASSTHROUGH_CDB_CK_COND(cdb) || + PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_RETURN_RESPONSE) + { + sequence->is_translate_response_required = TRUE; + } + sati_set_ata_features(register_fis, sati_get_cdb_byte(cdb, 4)); sati_set_ata_sector_count(register_fis, sati_get_cdb_byte(cdb, 6)); sati_set_ata_lba_low(register_fis, sati_get_cdb_byte(cdb, 8)); @@ -483,6 +490,8 @@ SATI_STATUS sati_passthrough_translate_r return SATI_FAILURE_CHECK_RESPONSE_DATA; } + sequence->state = SATI_SEQUENCE_STATE_FINAL; + // If the user set the check condition bit, fill out the sense data if (PASSTHROUGH_CDB_CK_COND(cdb) || PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_RETURN_RESPONSE) @@ -496,10 +505,9 @@ SATI_STATUS sati_passthrough_translate_r SCSI_ASC_NO_ADDITIONAL_SENSE, SCSI_ASCQ_ATA_PASS_THROUGH_INFORMATION_AVAILABLE ); + return SATI_FAILURE_CHECK_RESPONSE_DATA; } - sequence->state = SATI_SEQUENCE_STATE_FINAL; - return SATI_COMPLETE; } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 16:57:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6A102FCE; Wed, 7 May 2014 16:57: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 568F9EC; Wed, 7 May 2014 16:57: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 s47GvYsC074868; Wed, 7 May 2014 16:57:34 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47GvX7l074863; Wed, 7 May 2014 16:57:33 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405071657.s47GvX7l074863@svn.freebsd.org> From: Jim Harris Date: Wed, 7 May 2014 16:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265571 - stable/10/sys/dev/isci/scil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 16:57:34 -0000 Author: jimharris Date: Wed May 7 16:57:33 2014 New Revision: 265571 URL: http://svnweb.freebsd.org/changeset/base/265571 Log: MFC r263276: Base the max number of SG elements on MAXPHYS. Modified: stable/10/sys/dev/isci/scil/sati_util.h stable/10/sys/dev/isci/scil/sci_controller_constants.h stable/10/sys/dev/isci/scil/sci_util.h stable/10/sys/dev/isci/scil/scic_sds_request.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isci/scil/sati_util.h ============================================================================== --- stable/10/sys/dev/isci/scil/sati_util.h Wed May 7 16:56:20 2014 (r265570) +++ stable/10/sys/dev/isci/scil/sati_util.h Wed May 7 16:57:33 2014 (r265571) @@ -62,6 +62,8 @@ * structure data, fill in sense data, etc. */ +#include + #include #include @@ -144,15 +146,6 @@ #define ATA_MICROCODE_OFFSET_DOWNLOAD 0x03 #define ATA_MICROCODE_DOWNLOAD_SAVE 0x07 -#ifndef MIN -#define MIN(x,y) ((x) < (y) ? (x) : (y)) -#endif - -#ifndef MAX -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif - - void sati_ata_non_data_command( void * ata_io, SATI_TRANSLATOR_SEQUENCE_T * sequence Modified: stable/10/sys/dev/isci/scil/sci_controller_constants.h ============================================================================== --- stable/10/sys/dev/isci/scil/sci_controller_constants.h Wed May 7 16:56:20 2014 (r265570) +++ stable/10/sys/dev/isci/scil/sci_controller_constants.h Wed May 7 16:57:33 2014 (r265571) @@ -54,6 +54,8 @@ #ifndef _SCI_CONTROLLER_CONSTANTS_H_ #define _SCI_CONTROLLER_CONSTANTS_H_ +#include + /** * @file * @@ -148,8 +150,13 @@ extern "C" { /** * This constant defines the maximum number of Scatter-Gather Elements * to be used by any SCI component. + * + * Note: number of elements must be an even number, since descriptors + * posted to hardware always contain pairs of elements (with second + * element set to zeroes if not needed). */ -#define SCI_MAX_SCATTER_GATHER_ELEMENTS 130 +#define __MAXPHYS_ELEMENTS ((MAXPHYS / PAGE_SIZE) + 1) +#define SCI_MAX_SCATTER_GATHER_ELEMENTS ((__MAXPHYS_ELEMENTS + 1) & ~0x1) #endif #ifndef SCI_MIN_SCATTER_GATHER_ELEMENTS Modified: stable/10/sys/dev/isci/scil/sci_util.h ============================================================================== --- stable/10/sys/dev/isci/scil/sci_util.h Wed May 7 16:56:20 2014 (r265570) +++ stable/10/sys/dev/isci/scil/sci_util.h Wed May 7 16:57:33 2014 (r265571) @@ -54,20 +54,14 @@ #ifndef _SCI_UTIL_H_ #define _SCI_UTIL_H_ +#include + #include #ifndef ARRAY_SIZE #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #endif -#ifndef MIN -#define MIN(x,y) ((x) < (y) ? (x) : (y)) -#endif - -#ifndef MAX -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif - /** * Normal byte swap macro */ Modified: stable/10/sys/dev/isci/scil/scic_sds_request.h ============================================================================== --- stable/10/sys/dev/isci/scil/scic_sds_request.h Wed May 7 16:56:20 2014 (r265570) +++ stable/10/sys/dev/isci/scil/scic_sds_request.h Wed May 7 16:57:33 2014 (r265571) @@ -65,6 +65,8 @@ extern "C" { #endif // __cplusplus +#include + #include #include @@ -331,7 +333,6 @@ extern SCIC_SDS_IO_REQUEST_STATE_HANDLER #define scic_sds_request_get_task_context(request) \ ((request)->task_context_buffer) -#define CACHE_LINE_SIZE (64) #define scic_sds_request_align_task_context_buffer(address) \ ((SCU_TASK_CONTEXT_T *)( \ (((POINTER_UINT)(address)) + (CACHE_LINE_SIZE - 1)) \ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 17:00:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BD7CB3BF; Wed, 7 May 2014 17:00: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 AA35F126; Wed, 7 May 2014 17:00: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 s47H0dcU076034; Wed, 7 May 2014 17:00:39 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47H0dRG076033; Wed, 7 May 2014 17:00:39 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405071700.s47H0dRG076033@svn.freebsd.org> From: Jim Harris Date: Wed, 7 May 2014 17:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265572 - stable/10/sys/dev/nvme X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 17:00:39 -0000 Author: jimharris Date: Wed May 7 17:00:39 2014 New Revision: 265572 URL: http://svnweb.freebsd.org/changeset/base/265572 Log: MFC r263277: nvme: Remove the software progress marker SET_FEATURE command during controller initialization. The spec says OS drivers should send this command after controller initialization completes successfully, but other NVMe OS drivers are not sending this command. This change will therefore reduce differences between the FreeBSD and other OS drivers. Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_ctrlr.c Wed May 7 16:57:33 2014 (r265571) +++ stable/10/sys/dev/nvme/nvme_ctrlr.c Wed May 7 17:00:39 2014 (r265572) @@ -842,16 +842,6 @@ nvme_ctrlr_start(void *ctrlr_arg) for (i = 0; i < ctrlr->num_io_queues; i++) nvme_io_qpair_enable(&ctrlr->ioq[i]); - - /* - * Clear software progress marker to 0, to indicate to pre-boot - * software that OS driver load was successful. - * - * Chatham does not support this feature. - */ - if (pci_get_devid(ctrlr->dev) != CHATHAM_PCI_ID) - nvme_ctrlr_cmd_set_feature(ctrlr, - NVME_FEAT_SOFTWARE_PROGRESS_MARKER, 0, NULL, 0, NULL, NULL); } void From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 17:02:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3A30F593; Wed, 7 May 2014 17:02: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 2702B1A8; Wed, 7 May 2014 17:02: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 s47H2GnA078792; Wed, 7 May 2014 17:02:16 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47H2G4n078791; Wed, 7 May 2014 17:02:16 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405071702.s47H2G4n078791@svn.freebsd.org> From: Jim Harris Date: Wed, 7 May 2014 17:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265573 - stable/10/sys/dev/nvme X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 17:02:16 -0000 Author: jimharris Date: Wed May 7 17:02:15 2014 New Revision: 265573 URL: http://svnweb.freebsd.org/changeset/base/265573 Log: MFC r263278: nvme: NVMe specification dictates 4-byte alignment for PRPs (not 8). Modified: stable/10/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_qpair.c Wed May 7 17:00:39 2014 (r265572) +++ stable/10/sys/dev/nvme/nvme_qpair.c Wed May 7 17:02:15 2014 (r265573) @@ -498,8 +498,9 @@ nvme_qpair_construct(struct nvme_qpair * mtx_init(&qpair->lock, "nvme qpair lock", NULL, MTX_DEF); + /* Note: NVMe PRP format is restricted to 4-byte alignment. */ bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), - sizeof(uint64_t), PAGE_SIZE, BUS_SPACE_MAXADDR, + 4, PAGE_SIZE, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, NVME_MAX_XFER_SIZE, (NVME_MAX_XFER_SIZE/PAGE_SIZE)+1, PAGE_SIZE, 0, NULL, NULL, &qpair->dma_tag); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 17:17:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 57D6B294; Wed, 7 May 2014 17:17: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 2BA892F2; Wed, 7 May 2014 17:17: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 s47HHHZp084297; Wed, 7 May 2014 17:17:17 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47HHGts084292; Wed, 7 May 2014 17:17:16 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405071717.s47HHGts084292@svn.freebsd.org> From: Jim Harris Date: Wed, 7 May 2014 17:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265575 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 17:17:17 -0000 Author: jimharris Date: Wed May 7 17:17:16 2014 New Revision: 265575 URL: http://svnweb.freebsd.org/changeset/base/265575 Log: MFC r263303: Update nvme(4) and nvd(4) man pages to clarify the differences between their respective device nodes. Modified: stable/10/share/man/man4/nvd.4 stable/10/share/man/man4/nvme.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/nvd.4 ============================================================================== --- stable/10/share/man/man4/nvd.4 Wed May 7 17:12:15 2014 (r265574) +++ stable/10/share/man/man4/nvd.4 Wed May 7 17:17:16 2014 (r265575) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2012-2013 Intel Corporation +.\" Copyright (c) 2012-2014 Intel Corporation .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2013 +.Dd March 18, 2014 .Dt NVD 4 .Os .Sh NAME @@ -62,8 +62,22 @@ It depends on the .Xr nvme 4 driver for notification of existing NVMe namespaces and submission of NVM I/O commands. +.Pp +Device nodes from the +.Nm +driver will have the format /dev/nvdX and are +.Xr GEOM 4 +disks which can be partitioned by +.Xr geom 8 . +Note that device nodes from the +.Xr nvme 4 +driver are not +.Xr GEOM 4 +disks and cannot be partitioned. .Sh SEE ALSO +.Xr GEOM 4 , .Xr nvme 4 , +.Xr geom 8 , .Xr nvmecontrol 8 , .Xr disk 9 .Sh HISTORY Modified: stable/10/share/man/man4/nvme.4 ============================================================================== --- stable/10/share/man/man4/nvme.4 Wed May 7 17:12:15 2014 (r265574) +++ stable/10/share/man/man4/nvme.4 Wed May 7 17:17:16 2014 (r265575) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2012-2013 Intel Corporation +.\" Copyright (c) 2012-2014 Intel Corporation .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2013 +.Dd March 18, 2014 .Dt NVME 4 .Os .Sh NAME @@ -54,7 +54,8 @@ nvme_load="YES" .Pp Most users will also want to enable .Xr nvd 4 -to surface NVM Express namespaces as disk devices. +to surface NVM Express namespaces as disk devices which can be +partitioned. Note that in NVM Express terms, a namespace is roughly equivalent to a SCSI LUN. .Sh DESCRIPTION @@ -73,11 +74,13 @@ API for registering NVMe namespace consu API for submitting NVM commands to namespaces .It Ioctls for controller and namespace configuration and management +.El .Pp +The .Nm -creates controller devices in the format +driver creates controller device nodes in the format .Pa /dev/nvmeX -and namespace devices in +and namespace device nodes in the format .Pa /dev/nvmeXnsY . Note that the NVM Express specification starts numbering namespaces at 1, From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 17:18:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CAF20652; Wed, 7 May 2014 17: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 ACB7D30D; Wed, 7 May 2014 17: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 s47HIqha084617; Wed, 7 May 2014 17:18:52 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47HIqtP084614; Wed, 7 May 2014 17:18:52 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405071718.s47HIqtP084614@svn.freebsd.org> From: Jim Harris Date: Wed, 7 May 2014 17:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265576 - stable/10/sys/dev/nvme X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 17:18:53 -0000 Author: jimharris Date: Wed May 7 17:18:51 2014 New Revision: 265576 URL: http://svnweb.freebsd.org/changeset/base/265576 Log: MFC r263310: nvme: Close hole where nvd(4) would not be notified of all nvme(4) instances if modules loaded during boot. Modified: stable/10/sys/dev/nvme/nvme.c stable/10/sys/dev/nvme/nvme_ctrlr.c stable/10/sys/dev/nvme/nvme_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nvme/nvme.c ============================================================================== --- stable/10/sys/dev/nvme/nvme.c Wed May 7 17:17:16 2014 (r265575) +++ stable/10/sys/dev/nvme/nvme.c Wed May 7 17:18:51 2014 (r265576) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2014 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -266,39 +266,75 @@ nvme_detach (device_t dev) } static void -nvme_notify_consumer(struct nvme_consumer *cons) +nvme_notify(struct nvme_consumer *cons, + struct nvme_controller *ctrlr) { - device_t *devlist; - struct nvme_controller *ctrlr; struct nvme_namespace *ns; void *ctrlr_cookie; - int dev_idx, ns_idx, devcount; + int cmpset, ns_idx; + + /* + * The consumer may register itself after the nvme devices + * have registered with the kernel, but before the + * driver has completed initialization. In that case, + * return here, and when initialization completes, the + * controller will make sure the consumer gets notified. + */ + if (!ctrlr->is_initialized) + return; + + cmpset = atomic_cmpset_32(&ctrlr->notification_sent, 0, 1); + + if (cmpset == 0) + return; + + if (cons->ctrlr_fn != NULL) + ctrlr_cookie = (*cons->ctrlr_fn)(ctrlr); + else + ctrlr_cookie = NULL; + ctrlr->cons_cookie[cons->id] = ctrlr_cookie; + if (ctrlr->is_failed) { + if (cons->fail_fn != NULL) + (*cons->fail_fn)(ctrlr_cookie); + /* + * Do not notify consumers about the namespaces of a + * failed controller. + */ + return; + } + for (ns_idx = 0; ns_idx < ctrlr->cdata.nn; ns_idx++) { + ns = &ctrlr->ns[ns_idx]; + if (cons->ns_fn != NULL) + ns->cons_cookie[cons->id] = + (*cons->ns_fn)(ns, ctrlr_cookie); + } +} + +void +nvme_notify_new_controller(struct nvme_controller *ctrlr) +{ + int i; + + for (i = 0; i < NVME_MAX_CONSUMERS; i++) { + if (nvme_consumer[i].id != INVALID_CONSUMER_ID) { + nvme_notify(&nvme_consumer[i], ctrlr); + } + } +} + +static void +nvme_notify_new_consumer(struct nvme_consumer *cons) +{ + device_t *devlist; + struct nvme_controller *ctrlr; + int dev_idx, devcount; if (devclass_get_devices(nvme_devclass, &devlist, &devcount)) return; for (dev_idx = 0; dev_idx < devcount; dev_idx++) { ctrlr = DEVICE2SOFTC(devlist[dev_idx]); - if (cons->ctrlr_fn != NULL) - ctrlr_cookie = (*cons->ctrlr_fn)(ctrlr); - else - ctrlr_cookie = NULL; - ctrlr->cons_cookie[cons->id] = ctrlr_cookie; - if (ctrlr->is_failed) { - if (cons->fail_fn != NULL) - (*cons->fail_fn)(ctrlr_cookie); - /* - * Do not notify consumers about the namespaces of a - * failed controller. - */ - continue; - } - for (ns_idx = 0; ns_idx < ctrlr->cdata.nn; ns_idx++) { - ns = &ctrlr->ns[ns_idx]; - if (cons->ns_fn != NULL) - ns->cons_cookie[cons->id] = - (*cons->ns_fn)(ns, ctrlr_cookie); - } + nvme_notify(cons, ctrlr); } free(devlist, M_TEMP); @@ -353,7 +389,7 @@ nvme_register_consumer(nvme_cons_ns_fn_t nvme_consumer[i].async_fn = async_fn; nvme_consumer[i].fail_fn = fail_fn; - nvme_notify_consumer(&nvme_consumer[i]); + nvme_notify_new_consumer(&nvme_consumer[i]); return (&nvme_consumer[i]); } Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_ctrlr.c Wed May 7 17:17:16 2014 (r265575) +++ stable/10/sys/dev/nvme/nvme_ctrlr.c Wed May 7 17:18:51 2014 (r265576) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2014 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -851,6 +851,9 @@ nvme_ctrlr_start_config_hook(void *arg) nvme_ctrlr_start(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); + + ctrlr->is_initialized = 1; + nvme_notify_new_controller(ctrlr); } static void @@ -1174,6 +1177,8 @@ intx: taskqueue_start_threads(&ctrlr->taskqueue, 1, PI_DISK, "nvme taskq"); ctrlr->is_resetting = 0; + ctrlr->is_initialized = 0; + ctrlr->notification_sent = 0; TASK_INIT(&ctrlr->reset_task, 0, nvme_ctrlr_reset_task, ctrlr); TASK_INIT(&ctrlr->fail_req_task, 0, nvme_ctrlr_fail_req_task, ctrlr); Modified: stable/10/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/10/sys/dev/nvme/nvme_private.h Wed May 7 17:17:16 2014 (r265575) +++ stable/10/sys/dev/nvme/nvme_private.h Wed May 7 17:18:51 2014 (r265576) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2014 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -330,7 +330,9 @@ struct nvme_controller { void *cons_cookie[NVME_MAX_CONSUMERS]; - uint32_t is_resetting; + uint32_t is_resetting; + uint32_t is_initialized; + uint32_t notification_sent; boolean_t is_failed; STAILQ_HEAD(, nvme_request) fail_req; @@ -556,5 +558,6 @@ void nvme_notify_async_consumers(struct uint32_t log_page_id, void *log_page_buffer, uint32_t log_page_size); void nvme_notify_fail_consumers(struct nvme_controller *ctrlr); +void nvme_notify_new_controller(struct nvme_controller *ctrlr); #endif /* __NVME_PRIVATE_H__ */ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 17:20:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 725AE7BA; Wed, 7 May 2014 17:20: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 5F097324; Wed, 7 May 2014 17:20: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 s47HKGjO085397; Wed, 7 May 2014 17:20:16 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47HKFrn085394; Wed, 7 May 2014 17:20:15 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405071720.s47HKFrn085394@svn.freebsd.org> From: Jim Harris Date: Wed, 7 May 2014 17:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265577 - stable/10/sys/dev/nvme X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 17:20:16 -0000 Author: jimharris Date: Wed May 7 17:20:15 2014 New Revision: 265577 URL: http://svnweb.freebsd.org/changeset/base/265577 Log: MFC r263311: nvme: Allocate all MSI resources up front so that we can fall back to INTx if necessary. Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c stable/10/sys/dev/nvme/nvme_private.h stable/10/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_ctrlr.c Wed May 7 17:18:51 2014 (r265576) +++ stable/10/sys/dev/nvme/nvme_ctrlr.c Wed May 7 17:20:15 2014 (r265577) @@ -1075,8 +1075,8 @@ nvme_ctrlr_construct(struct nvme_control { union cap_lo_register cap_lo; union cap_hi_register cap_hi; - int num_vectors, per_cpu_io_queues, status = 0; - int timeout_period; + int i, num_vectors, per_cpu_io_queues, rid; + int status, timeout_period; ctrlr->dev = dev; @@ -1149,8 +1149,45 @@ nvme_ctrlr_construct(struct nvme_control goto intx; } - if (pci_alloc_msix(dev, &num_vectors) != 0) + if (pci_alloc_msix(dev, &num_vectors) != 0) { ctrlr->msix_enabled = 0; + goto intx; + } + + /* + * On earlier FreeBSD releases, there are reports that + * pci_alloc_msix() can return successfully with all vectors + * requested, but a subsequent bus_alloc_resource_any() + * for one of those vectors fails. This issue occurs more + * readily with multiple devices using per-CPU vectors. + * To workaround this issue, try to allocate the resources now, + * and fall back to INTx if we cannot allocate all of them. + * This issue cannot be reproduced on more recent versions of + * FreeBSD which have increased the maximum number of MSI-X + * vectors, but adding the workaround makes it easier for + * vendors wishing to import this driver into kernels based on + * older versions of FreeBSD. + */ + for (i = 0; i < num_vectors; i++) { + rid = i + 1; + ctrlr->msi_res[i] = bus_alloc_resource_any(ctrlr->dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); + + if (ctrlr->msi_res[i] == NULL) { + ctrlr->msix_enabled = 0; + while (i > 0) { + i--; + bus_release_resource(ctrlr->dev, + SYS_RES_IRQ, + rman_get_rid(ctrlr->msi_res[i]), + ctrlr->msi_res[i]); + } + pci_release_msi(dev); + nvme_printf(ctrlr, "could not obtain all MSI-X " + "resources, reverting to intx\n"); + break; + } + } intx: Modified: stable/10/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/10/sys/dev/nvme/nvme_private.h Wed May 7 17:18:51 2014 (r265576) +++ stable/10/sys/dev/nvme/nvme_private.h Wed May 7 17:20:15 2014 (r265577) @@ -289,6 +289,8 @@ struct nvme_controller { struct task fail_req_task; struct taskqueue *taskqueue; + struct resource *msi_res[MAXCPU + 1]; + /* For shared legacy interrupt. */ int rid; struct resource *res; Modified: stable/10/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_qpair.c Wed May 7 17:18:51 2014 (r265576) +++ stable/10/sys/dev/nvme/nvme_qpair.c Wed May 7 17:20:15 2014 (r265577) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2014 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -487,9 +487,7 @@ nvme_qpair_construct(struct nvme_qpair * * the queue's vector to get the corresponding rid to use. */ qpair->rid = vector + 1; - - qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, - &qpair->rid, RF_ACTIVE); + qpair->res = ctrlr->msi_res[vector]; bus_setup_intr(ctrlr->dev, qpair->res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 18:49:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CD6CF704; Wed, 7 May 2014 18:49: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 B8EA4E0C; Wed, 7 May 2014 18:49: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 s47InQ1F024801; Wed, 7 May 2014 18:49:26 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47InPvd024795; Wed, 7 May 2014 18:49:25 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201405071849.s47InPvd024795@svn.freebsd.org> From: Alan Somers Date: Wed, 7 May 2014 18:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265586 - in stable/10: etc/mtree tests/sys tests/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 18:49:27 -0000 Author: asomers Date: Wed May 7 18:49:25 2014 New Revision: 265586 URL: http://svnweb.freebsd.org/changeset/base/265586 Log: MFC r263445 and r265385. Note that the change to ObsoleteFiles.inc in r265385 does not need to be MFCed, because the obsolete files in question were never MFCed to any stable branch. r265385 Remove the ifconfig test added in rev 263445. After discussion with melifaro, we agreed that ifconfig's behavior was not a bug. The main motivation for bin/187551 was to partially resolve kern/187549, but we resolved kern/187549 in a different way instead. ObsoleteFiles.inc etc/mtree/BSD.tests.dist sbin/ifconfig/tests/fibs_test.sh sbin/ifconfig/tests/Makefile sbin/ifconfig/Makefile Remove /usr/tests/sbin/ifconfig r263445 Add several ATF tests that deal with multiple fibs. They're described in several different PRs, but the tests share some common code, so I'm committing them together. sbin/ifconfig/tests sbin/ifconfig/tests/fibs_test.sh sbin/ifconfig/tests/Makefile sbin/ifconfig/Makefile Add fibs_test.sh, which regresses bin/187551 tests/sys/netinet tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c tests/sys/netinet/Makefile tests/sys/Makefile Add fibs_test.sh, which regresses kern/167947, kern/187552 kern/187549, kern/187550, and kern/187553 etc/mtree/BSD.tests.dist Add newly created directories Added: stable/10/tests/sys/netinet/ - copied from r263445, head/tests/sys/netinet/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/tests/sys/Makefile stable/10/tests/sys/netinet/fibs_test.sh stable/10/tests/sys/netinet/udp_dontroute.c Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Wed May 7 18:27:12 2014 (r265585) +++ stable/10/etc/mtree/BSD.tests.dist Wed May 7 18:49:25 2014 (r265586) @@ -123,6 +123,8 @@ sys kern .. + netinet + .. .. usr.bin apply Modified: stable/10/tests/sys/Makefile ============================================================================== --- stable/10/tests/sys/Makefile Wed May 7 18:27:12 2014 (r265585) +++ stable/10/tests/sys/Makefile Wed May 7 18:49:25 2014 (r265586) @@ -5,6 +5,7 @@ .PATH: ${.CURDIR}/.. TESTS_SUBDIRS+= kern +TESTS_SUBDIRS+= netinet TESTSDIR= ${TESTSBASE}/sys KYUAFILE= yes Modified: stable/10/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Thu Mar 20 20:39:41 2014 (r263445) +++ stable/10/tests/sys/netinet/fibs_test.sh Wed May 7 18:49:25 2014 (r265586) @@ -1,7 +1,7 @@ # # Copyright (c) 2014 Spectra Logic Corporation # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -13,7 +13,7 @@ # ("Disclaimer") and any redistribution must be conditioned upon # including a substantially similar Disclaimer requirement for further # binary redistribution. -# +# # NO WARRANTY # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -26,7 +26,7 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGES. -# +# # Authors: Alan Somers (Spectra Logic Corporation) # # $FreeBSD$ @@ -43,7 +43,7 @@ # Simulate a crossover cable between them by using net/socat # Use nping (from security/nmap) to send an ICMP echo request from one # interface to the other, spoofing the source IP. The source IP must be -# spoofed, or else it will already have an entry in the arp table. +# spoofed, or else it will already have an entry in the arp table. # Check whether an arp entry exists for the spoofed IP atf_test_case arpresolve_checks_interface_fib cleanup arpresolve_checks_interface_fib_head() @@ -85,7 +85,7 @@ arpresolve_checks_interface_fib_body() socat /dev/${TAP0} /dev/${TAP1} & SOCAT_PID=$! echo ${SOCAT_PID} >> "processes_to_kill" - + # Send an ICMP echo request with a spoofed source IP setfib 2 nping -c 1 -e ${TAP0} -S ${SPOOF_ADDR} \ --source-mac ${SPOOF_MAC} --icmp --icmp-type "echo-request" \ @@ -302,9 +302,9 @@ udp_dontroute_cleanup() atf_init_test_cases() { atf_add_test_case arpresolve_checks_interface_fib - atf_add_test_case loopback_and_network_routes_on_nondefault_fib - atf_add_test_case default_route_with_multiple_fibs_on_same_subnet - atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet + atf_add_test_case loopback_and_network_routes_on_nondefault_fib + atf_add_test_case default_route_with_multiple_fibs_on_same_subnet + atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet atf_add_test_case udp_dontroute } Modified: stable/10/tests/sys/netinet/udp_dontroute.c ============================================================================== --- head/tests/sys/netinet/udp_dontroute.c Thu Mar 20 20:39:41 2014 (r263445) +++ stable/10/tests/sys/netinet/udp_dontroute.c Wed May 7 18:49:25 2014 (r265586) @@ -1,7 +1,7 @@ /* * Copyright (c) 2014 Spectra Logic Corporation * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. - * + * * NO WARRANTY * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -26,7 +26,7 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. - * + * * Authors: Alan Somers (Spectra Logic Corporation) * * $FreeBSD$ @@ -43,11 +43,12 @@ #include #include -/* +/* * Sends a single UDP packet to the provided address, with SO_DONTROUTE set * I couldn't find a way to do this with builtin utilities like nc(1) */ -int main(int argc, char **argv) +int +main(int argc, char **argv) { struct sockaddr_in dst; int s; @@ -80,6 +81,6 @@ int main(int argc, char **argv) dst.sin_len); if (ret == -1) err(errno, "sendto"); - + return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 20:20:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 76F9B972; Wed, 7 May 2014 20:20: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 62A9FA8B; Wed, 7 May 2014 20:20: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 s47KKs8R066257; Wed, 7 May 2014 20:20:54 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47KKqOb066250; Wed, 7 May 2014 20:20:52 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201405072020.s47KKqOb066250@svn.freebsd.org> From: Scott Long Date: Wed, 7 May 2014 20:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265604 - stable/10/usr.sbin/pmcstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:20:54 -0000 Author: scottl Date: Wed May 7 20:20:52 2014 New Revision: 265604 URL: http://svnweb.freebsd.org/changeset/base/265604 Log: Merged r262424-262425,265085 Add the -a option to pmcstat. This produces a full stack track on the sampled points. See the man page for details on how this works. Obtained from: Netflix, Inc. Added: stable/10/usr.sbin/pmcstat/pmcpl_annotate_cg.c - copied, changed from r262424, head/usr.sbin/pmcstat/pmcpl_annotate_cg.c stable/10/usr.sbin/pmcstat/pmcpl_annotate_cg.h - copied, changed from r262424, head/usr.sbin/pmcstat/pmcpl_annotate_cg.h Modified: stable/10/usr.sbin/pmcstat/Makefile stable/10/usr.sbin/pmcstat/pmcstat.8 stable/10/usr.sbin/pmcstat/pmcstat.c stable/10/usr.sbin/pmcstat/pmcstat.h stable/10/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pmcstat/Makefile ============================================================================== --- stable/10/usr.sbin/pmcstat/Makefile Wed May 7 20:18:50 2014 (r265603) +++ stable/10/usr.sbin/pmcstat/Makefile Wed May 7 20:20:52 2014 (r265604) @@ -9,6 +9,7 @@ DPADD= ${LIBELF} ${LIBKVM} ${LIBPMC} ${L LDADD= -lelf -lkvm -lpmc -lm -lncurses SRCS= pmcstat.c pmcstat.h pmcstat_log.c \ -pmcpl_callgraph.c pmcpl_gprof.c pmcpl_annotate.c pmcpl_calltree.c +pmcpl_callgraph.c pmcpl_gprof.c pmcpl_annotate.c \ +pmcpl_annotate_cg.c pmcpl_calltree.c .include Copied and modified: stable/10/usr.sbin/pmcstat/pmcpl_annotate_cg.c (from r262424, head/usr.sbin/pmcstat/pmcpl_annotate_cg.c) ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_annotate_cg.c Mon Feb 24 02:43:58 2014 (r262424, copy source) +++ stable/10/usr.sbin/pmcstat/pmcpl_annotate_cg.c Wed May 7 20:20:52 2014 (r265604) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2005-2007, Joseph Koshy * Copyright (c) 2007 The FreeBSD Foundation + * Copyright (c) 2014, Adrian Chadd, Netflix Inc. * All rights reserved. * * Portions of this software were developed by A. Joseph Koshy under Copied and modified: stable/10/usr.sbin/pmcstat/pmcpl_annotate_cg.h (from r262424, head/usr.sbin/pmcstat/pmcpl_annotate_cg.h) ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_annotate_cg.h Mon Feb 24 02:43:58 2014 (r262424, copy source) +++ stable/10/usr.sbin/pmcstat/pmcpl_annotate_cg.h Wed May 7 20:20:52 2014 (r265604) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2005-2007, Joseph Koshy * Copyright (c) 2007 The FreeBSD Foundation + * Copyright (c) 2014, Adrian Chadd, Netflix Inc. * All rights reserved. * * Portions of this software were developed by A. Joseph Koshy under Modified: stable/10/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat.8 Wed May 7 20:18:50 2014 (r265603) +++ stable/10/usr.sbin/pmcstat/pmcstat.8 Wed May 7 20:20:52 2014 (r265604) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2008 +.Dd April 29, 2014 .Dt PMCSTAT 8 .Os .Sh NAME @@ -46,6 +46,7 @@ .Op Fl S Ar event-spec .Op Fl T .Op Fl W +.Op Fl a Ar pathname .Op Fl c Ar cpu-spec .Op Fl d .Op Fl f Ar pluginopt @@ -221,6 +222,21 @@ This is an experimental feature intended dynamic behaviour of processes in the system. It may incur substantial overhead if enabled. The default is for this feature to be disabled. +.It Fl a Ar pathname +Perform a symbol and file:line lookup for each address in each +callgraph and save the output to +.Ar pathname . +Unlike +.Fl m +that only resolves the first symbol in the graph, this resolves +every node in the callgraph, or prints out addresses if no +lookup information is available. +This option requires the +.Fl R +option to read in samples that were previously collected and +saved with the +.Fl o +option. .It Fl c Ar cpu-spec Set the cpus for subsequent system mode PMCs specified on the command line to Modified: stable/10/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat.c Wed May 7 20:18:50 2014 (r265603) +++ stable/10/usr.sbin/pmcstat/pmcstat.c Wed May 7 20:20:52 2014 (r265604) @@ -503,6 +503,7 @@ pmcstat_show_usage(void) "\t -S spec\t allocate a system-wide sampling PMC\n" "\t -T\t\t start in top mode\n" "\t -W\t\t (toggle) show counts per context switch\n" + "\t -a \t print sampled PCs and callgraph to \"file\"\n" "\t -c cpu-list\t set cpus for subsequent system-wide PMCs\n" "\t -d\t\t (toggle) track descendants\n" "\t -f spec\t pass \"spec\" to as plugin option\n" @@ -617,8 +618,14 @@ main(int argc, char **argv) CPU_SET(hcpu, &cpumask); while ((option = getopt(argc, argv, - "CD:EF:G:M:NO:P:R:S:TWc:df:gk:m:n:o:p:qr:s:t:vw:z:")) != -1) + "CD:EF:G:M:NO:P:R:S:TWa:c:df:gk:m:n:o:p:qr:s:t:vw:z:")) != -1) switch (option) { + case 'a': /* Annotate + callgraph */ + args.pa_flags |= FLAG_DO_ANNOTATE; + args.pa_plugin = PMCSTAT_PL_ANNOTATE_CG; + graphfilename = optarg; + break; + case 'C': /* cumulative values */ use_cumulative_counts = !use_cumulative_counts; args.pa_required |= FLAG_HAS_COUNTING_PMCS; @@ -917,7 +924,8 @@ main(int argc, char **argv) /* -m option is allowed with -R only. */ if (args.pa_flags & FLAG_DO_ANNOTATE && args.pa_inputpath == NULL) - errx(EX_USAGE, "ERROR: option -m requires an input file"); + errx(EX_USAGE, "ERROR: option %s requires an input file", + args.pa_plugin == PMCSTAT_PL_ANNOTATE ? "-m" : "-a"); /* -m option is not allowed combined with -g or -G. */ if (args.pa_flags & FLAG_DO_ANNOTATE && Modified: stable/10/usr.sbin/pmcstat/pmcstat.h ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat.h Wed May 7 20:18:50 2014 (r265603) +++ stable/10/usr.sbin/pmcstat/pmcstat.h Wed May 7 20:20:52 2014 (r265604) @@ -91,6 +91,7 @@ #define PMCSTAT_PL_GPROF 2 #define PMCSTAT_PL_ANNOTATE 3 #define PMCSTAT_PL_CALLTREE 4 +#define PMCSTAT_PL_ANNOTATE_CG 5 #define PMCSTAT_TOP_DELTA 0 #define PMCSTAT_TOP_ACCUM 1 Modified: stable/10/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat_log.c Wed May 7 20:18:50 2014 (r265603) +++ stable/10/usr.sbin/pmcstat/pmcstat_log.c Wed May 7 20:20:52 2014 (r265604) @@ -149,6 +149,7 @@ struct pmcstat_process *pmcstat_kernproc #include "pmcpl_gprof.h" #include "pmcpl_callgraph.h" #include "pmcpl_annotate.h" +#include "pmcpl_annotate_cg.h" #include "pmcpl_calltree.h" static struct pmc_plugins { @@ -214,6 +215,11 @@ static struct pmc_plugins { .pl_topdisplay = pmcpl_ct_topdisplay }, { + .pl_name = "annotate_cg", + .pl_process = pmcpl_annotate_cg_process + }, + + { .pl_name = NULL } }; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 20:28:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D95E3E71; Wed, 7 May 2014 20:28: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 C3B11ADB; Wed, 7 May 2014 20:28: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 s47KSUgT069598; Wed, 7 May 2014 20:28:30 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47KSS7b069582; Wed, 7 May 2014 20:28:28 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201405072028.s47KSS7b069582@svn.freebsd.org> From: Scott Long Date: Wed, 7 May 2014 20:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265606 - in stable/10/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/powerpc sparc64/sparc64 sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:28:30 -0000 Author: scottl Date: Wed May 7 20:28:27 2014 New Revision: 265606 URL: http://svnweb.freebsd.org/changeset/base/265606 Log: Merge r264984 Retire smp_active. It was racey and caused demonstrated problems with the cpufreq code. Replace its use with smp_started. There's at least one userland tool that still looks at the kern.smp.active sysctl, so preserve it but point it to smp_started as well. Obtained from: Netflix, Inc. Modified: stable/10/sys/amd64/amd64/mp_machdep.c stable/10/sys/amd64/amd64/vm_machdep.c stable/10/sys/arm/arm/mp_machdep.c stable/10/sys/i386/i386/mp_machdep.c stable/10/sys/i386/i386/vm_machdep.c stable/10/sys/i386/xen/mp_machdep.c stable/10/sys/ia64/ia64/mp_machdep.c stable/10/sys/kern/kern_cpu.c stable/10/sys/kern/subr_smp.c stable/10/sys/mips/mips/mp_machdep.c stable/10/sys/powerpc/powerpc/mp_machdep.c stable/10/sys/sparc64/sparc64/mp_machdep.c stable/10/sys/sys/smp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_machdep.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/amd64/amd64/mp_machdep.c Wed May 7 20:28:27 2014 (r265606) @@ -771,7 +771,6 @@ init_secondary(void) if (smp_cpus == mp_ncpus) { /* enable IPI's, tlb shootdown, freezes etc */ atomic_store_rel_int(&smp_started, 1); - smp_active = 1; /* historic */ } /* Modified: stable/10/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/vm_machdep.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/amd64/amd64/vm_machdep.c Wed May 7 20:28:27 2014 (r265606) @@ -597,7 +597,7 @@ cpu_reset() cpuset_t map; u_int cnt; - if (smp_active) { + if (smp_started) { map = all_cpus; CPU_CLR(PCPU_GET(cpuid), &map); CPU_NAND(&map, &stopped_cpus); Modified: stable/10/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/10/sys/arm/arm/mp_machdep.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/arm/arm/mp_machdep.c Wed May 7 20:28:27 2014 (r265606) @@ -212,7 +212,6 @@ init_secondary(int cpu) if (smp_cpus == mp_ncpus) { /* enable IPI's, tlb shootdown, freezes etc */ atomic_store_rel_int(&smp_started, 1); - smp_active = 1; } mtx_unlock_spin(&ap_boot_mtx); Modified: stable/10/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/10/sys/i386/i386/mp_machdep.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/i386/i386/mp_machdep.c Wed May 7 20:28:27 2014 (r265606) @@ -805,7 +805,6 @@ init_secondary(void) if (smp_cpus == mp_ncpus) { /* enable IPI's, tlb shootdown, freezes etc */ atomic_store_rel_int(&smp_started, 1); - smp_active = 1; /* historic */ } mtx_unlock_spin(&ap_boot_mtx); Modified: stable/10/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/10/sys/i386/i386/vm_machdep.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/i386/i386/vm_machdep.c Wed May 7 20:28:27 2014 (r265606) @@ -619,7 +619,7 @@ cpu_reset() cpuset_t map; u_int cnt; - if (smp_active) { + if (smp_started) { map = all_cpus; CPU_CLR(PCPU_GET(cpuid), &map); CPU_NAND(&map, &stopped_cpus); Modified: stable/10/sys/i386/xen/mp_machdep.c ============================================================================== --- stable/10/sys/i386/xen/mp_machdep.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/i386/xen/mp_machdep.c Wed May 7 20:28:27 2014 (r265606) @@ -655,7 +655,6 @@ init_secondary(void) if (smp_cpus == mp_ncpus) { /* enable IPI's, tlb shootdown, freezes etc */ atomic_store_rel_int(&smp_started, 1); - smp_active = 1; /* historic */ } mtx_unlock_spin(&ap_boot_mtx); Modified: stable/10/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/mp_machdep.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/ia64/ia64/mp_machdep.c Wed May 7 20:28:27 2014 (r265606) @@ -455,7 +455,7 @@ cpu_mp_unleash(void *dummy) mp_ncpus, cpus, smp_cpus); } - smp_active = 1; + /* XXX Atomic set operation? */ smp_started = 1; /* Modified: stable/10/sys/kern/kern_cpu.c ============================================================================== --- stable/10/sys/kern/kern_cpu.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/kern/kern_cpu.c Wed May 7 20:28:27 2014 (r265606) @@ -268,7 +268,7 @@ cf_set_method(device_t dev, const struct * switching the main CPU. XXXTODO: Need to think more about how to * handle having different CPUs at different frequencies. */ - if (mp_ncpus > 1 && !smp_active) { + if (mp_ncpus > 1 && !smp_started) { device_printf(dev, "rejecting change, SMP not started yet\n"); error = ENXIO; goto out; Modified: stable/10/sys/kern/subr_smp.c ============================================================================== --- stable/10/sys/kern/subr_smp.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/kern/subr_smp.c Wed May 7 20:28:27 2014 (r265606) @@ -59,6 +59,9 @@ cpuset_t logical_cpus_mask; void (*cpustop_restartfunc)(void); #endif + +static int sysctl_kern_smp_active(SYSCTL_HANDLER_ARGS); + /* This is used in modules that need to work in both SMP and UP. */ cpuset_t all_cpus; @@ -78,9 +81,8 @@ SYSCTL_INT(_kern_smp, OID_AUTO, maxid, C SYSCTL_INT(_kern_smp, OID_AUTO, maxcpus, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_maxcpus, 0, "Max number of CPUs that the system was compiled for."); -int smp_active = 0; /* are the APs allowed to run? */ -SYSCTL_INT(_kern_smp, OID_AUTO, active, CTLFLAG_RW, &smp_active, 0, - "Number of Auxillary Processors (APs) that were successfully started"); +SYSCTL_PROC(_kern_smp, OID_AUTO, active, CTLFLAG_RD | CTLTYPE_INT, NULL, 0, + sysctl_kern_smp_active, "I", "Indicates system is running in SMP mode"); int smp_disabled = 0; /* has smp been disabled? */ SYSCTL_INT(_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN|CTLFLAG_CAPRD, @@ -831,3 +833,15 @@ quiesce_all_cpus(const char *wmesg, int return quiesce_cpus(all_cpus, wmesg, prio); } + +/* Extra care is taken with this sysctl because the data type is volatile */ +static int +sysctl_kern_smp_active(SYSCTL_HANDLER_ARGS) +{ + int error, active; + + active = smp_started; + error = SYSCTL_OUT(req, &active, sizeof(active)); + return (error); +} + Modified: stable/10/sys/mips/mips/mp_machdep.c ============================================================================== --- stable/10/sys/mips/mips/mp_machdep.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/mips/mips/mp_machdep.c Wed May 7 20:28:27 2014 (r265606) @@ -317,7 +317,6 @@ smp_init_secondary(u_int32_t cpuid) if (smp_cpus == mp_ncpus) { atomic_store_rel_int(&smp_started, 1); - smp_active = 1; } mtx_unlock_spin(&ap_boot_mtx); Modified: stable/10/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/mp_machdep.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/powerpc/powerpc/mp_machdep.c Wed May 7 20:28:27 2014 (r265606) @@ -267,7 +267,7 @@ cpu_mp_unleash(void *dummy) /* Let the APs get into the scheduler */ DELAY(10000); - smp_active = 1; + /* XXX Atomic set operation? */ smp_started = 1; } Modified: stable/10/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/10/sys/sparc64/sparc64/mp_machdep.c Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/sparc64/sparc64/mp_machdep.c Wed May 7 20:28:27 2014 (r265606) @@ -291,7 +291,6 @@ cpu_mp_start(void) KASSERT(!isjbus || mp_ncpus <= IDR_JALAPENO_MAX_BN_PAIRS, ("%s: can only IPI a maximum of %d JBus-CPUs", __func__, IDR_JALAPENO_MAX_BN_PAIRS)); - smp_active = 1; } static void Modified: stable/10/sys/sys/smp.h ============================================================================== --- stable/10/sys/sys/smp.h Wed May 7 20:27:57 2014 (r265605) +++ stable/10/sys/sys/smp.h Wed May 7 20:28:27 2014 (r265606) @@ -71,7 +71,6 @@ struct cpu_group *smp_topo_2level(int l2 struct cpu_group *smp_topo_find(struct cpu_group *top, int cpu); extern void (*cpustop_restartfunc)(void); -extern int smp_active; extern int smp_cpus; extern volatile cpuset_t started_cpus; extern volatile cpuset_t stopped_cpus; @@ -141,7 +140,7 @@ cpu_next(int i) * cpu_mp_start() will be called so that MP can be enabled. This function * should do things such as startup secondary processors. It should also * setup mp_ncpus, all_cpus, and smp_cpus. It should also ensure that - * smp_active and smp_started are initialized at the appropriate time. + * smp_started is initialized at the appropriate time. * Once cpu_mp_start() returns, machine independent MP startup code will be * executed and a simple message will be output to the console. Finally, * cpu_mp_announce() will be called so that machine dependent messages about From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 20:57:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 02C93ED8; Wed, 7 May 2014 20:57: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 D7F75D80; Wed, 7 May 2014 20:57: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 s47KvGNU082647; Wed, 7 May 2014 20:57:16 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47KvGn3082644; Wed, 7 May 2014 20:57:16 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201405072057.s47KvGn3082644@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 7 May 2014 20:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265610 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:57:17 -0000 Author: gavin Date: Wed May 7 20:57:16 2014 New Revision: 265610 URL: http://svnweb.freebsd.org/changeset/base/265610 Log: Merge r256782 from head: Add 26 new device IDs to uslcom(4). This brings us in sync with Linux v3.12 rc5 Modified: stable/10/sys/dev/usb/serial/uslcom.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uslcom.c Wed May 7 20:50:16 2014 (r265609) +++ stable/10/sys/dev/usb/serial/uslcom.c Wed May 7 20:57:16 2014 (r265610) @@ -252,15 +252,37 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(JABLOTRON, PC60B), USLCOM_DEV(KAMSTRUP, OPTICALEYE), USLCOM_DEV(KAMSTRUP, MBUS_250D), + USLCOM_DEV(LAKESHORE, 121), + USLCOM_DEV(LAKESHORE, 218A), + USLCOM_DEV(LAKESHORE, 219), + USLCOM_DEV(LAKESHORE, 233), + USLCOM_DEV(LAKESHORE, 235), + USLCOM_DEV(LAKESHORE, 335), + USLCOM_DEV(LAKESHORE, 336), + USLCOM_DEV(LAKESHORE, 350), + USLCOM_DEV(LAKESHORE, 371), + USLCOM_DEV(LAKESHORE, 411), + USLCOM_DEV(LAKESHORE, 425), + USLCOM_DEV(LAKESHORE, 455A), + USLCOM_DEV(LAKESHORE, 465), + USLCOM_DEV(LAKESHORE, 475A), + USLCOM_DEV(LAKESHORE, 625A), + USLCOM_DEV(LAKESHORE, 642A), + USLCOM_DEV(LAKESHORE, 648), + USLCOM_DEV(LAKESHORE, 737), + USLCOM_DEV(LAKESHORE, 776), USLCOM_DEV(LINKINSTRUMENTS, MSO19), USLCOM_DEV(LINKINSTRUMENTS, MSO28), USLCOM_DEV(LINKINSTRUMENTS, MSO28_2), USLCOM_DEV(MEI, CASHFLOW_SC), USLCOM_DEV(MEI, S2000), + USLCOM_DEV(NETGEAR, M4100), USLCOM_DEV(OWEN, AC4), + USLCOM_DEV(OWL, CM_160), USLCOM_DEV(PHILIPS, ACE1001), USLCOM_DEV(PLX, CA42), USLCOM_DEV(RENESAS, RX610), + USLCOM_DEV(SEL, C662), USLCOM_DEV(SILABS, AC_SERV_CAN), USLCOM_DEV(SILABS, AC_SERV_CIS), USLCOM_DEV(SILABS, AC_SERV_IBUS), @@ -293,6 +315,7 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, HELICOM), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), + USLCOM_DEV(SILABS, INGENI_ZIGBEE), USLCOM_DEV(SILABS, INSYS_MODEM), USLCOM_DEV(SILABS, IRZ_SG10), USLCOM_DEV(SILABS, KYOCERA_GPS), @@ -300,6 +323,7 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, LIPOWSKY_JTAG), USLCOM_DEV(SILABS, LIPOWSKY_LIN), USLCOM_DEV(SILABS, MC35PU), + USLCOM_DEV(SILABS, MMB_ZIGBEE), USLCOM_DEV(SILABS, MJS_TOSLINK), USLCOM_DEV(SILABS, MSD_DASHHAWK), USLCOM_DEV(SILABS, MULTIPLEX_RC), @@ -316,6 +340,7 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, USBPULSE100), USLCOM_DEV(SILABS, USBSCOPE50), USLCOM_DEV(SILABS, USBWAVE12), + USLCOM_DEV(SILABS, V_PREON32), USLCOM_DEV(SILABS, VSTABI), USLCOM_DEV(SILABS, WAVIT), USLCOM_DEV(SILABS, WMRBATT), @@ -330,6 +355,7 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(VAISALA, CABLE), USLCOM_DEV(WAGO, SERVICECABLE), USLCOM_DEV(WAVESENSE, JAZZ), + USLCOM_DEV(WESTMOUNTAIN, RIGBLASTER_ADVANTAGE), USLCOM_DEV(WIENERPLEINBAUS, PL512), USLCOM_DEV(WIENERPLEINBAUS, RCM), USLCOM_DEV(WIENERPLEINBAUS, MPOD), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Wed May 7 20:50:16 2014 (r265609) +++ stable/10/sys/dev/usb/usbdevs Wed May 7 20:57:16 2014 (r265610) @@ -569,6 +569,7 @@ vendor FALCOM 0x0f94 Falcom Wireless Co vendor RIM 0x0fca Research In Motion vendor DYNASTREAM 0x0fcf Dynastream Innovations vendor LARSENBRUSGAARD 0x0fd8 Larsen and Brusgaard +vendor OWL 0x0fde OWL vendor KONTRON 0x0fe6 Kontron AG vendor QUALCOMM 0x1004 Qualcomm vendor APACER 0x1005 Apacer @@ -697,6 +698,7 @@ vendor QUALCOMMINC 0x19d2 Qualcomm, Inco vendor BAYER 0x1a79 Bayer vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless +vendor SEL 0x1adb Schweitzer Engineering Laboratories vendor CORSAIR 0x1b1c Corsair vendor MATRIXORBITAL 0x1b3d Matrix Orbital vendor OVISLINK 0x1b75 OvisLink @@ -717,6 +719,7 @@ vendor METAGEEK2 0x1dd5 MetaGeek vendor ALINK 0x1e0e Alink vendor AIRTIES 0x1eda AirTies vendor FESTO 0x1e29 Festo +vendor LAKESHORE 0x1fb9 Lake Shore Cryotronics, Inc. vendor VERTEX 0x1fe7 Vertex Wireless Co., Ltd. vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications @@ -732,6 +735,7 @@ vendor VIALABS 0x2109 VIA Labs vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor WETELECOM 0x22de WeTelecom +vendor WESTMOUNTAIN 0x2405 West Mountain Radio vendor TRIPPLITE 0x2478 Tripp-Lite vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ @@ -2546,6 +2550,27 @@ product KYOCERA2 KPC680 0x180a Qualcomm product LACIE HD 0xa601 Hard Disk product LACIE CDRW 0xa602 CD R/W +/* Lake Shore Cryotronics products */ +product LAKESHORE 121 0x0100 121 Current Source +product LAKESHORE 218A 0x0200 218A Temperature Monitor +product LAKESHORE 219 0x0201 219 Temperature Monitor +product LAKESHORE 233 0x0202 233 Temperature Transmitter +product LAKESHORE 235 0x0203 235 Temperature Transmitter +product LAKESHORE 335 0x0300 335 Temperature Controller +product LAKESHORE 336 0x0301 336 Temperature Controller +product LAKESHORE 350 0x0302 350 Temperature Controller +product LAKESHORE 371 0x0303 371 AC Bridge +product LAKESHORE 411 0x0400 411 Handheld Gaussmeter +product LAKESHORE 425 0x0401 425 Gaussmeter +product LAKESHORE 455A 0x0402 455A DSP Gaussmeter +product LAKESHORE 475A 0x0403 475A DSP Gaussmeter +product LAKESHORE 465 0x0404 465 Gaussmeter +product LAKESHORE 625A 0x0600 625A Magnet PSU +product LAKESHORE 642A 0x0601 642A Magnet PSU +product LAKESHORE 648 0x0602 648 Magnet PSU +product LAKESHORE 737 0x0700 737 VSM Controller +product LAKESHORE 776 0x0701 776 Matrix Switch + /* Larsen and Brusgaard products */ product LARSENBRUSGAARD ALTITRACK 0x0001 FTDI compatible adapter @@ -3146,6 +3171,7 @@ product NETGEAR EA101 0x1001 Ethernet product NETGEAR EA101X 0x1002 Ethernet product NETGEAR FA101 0x1020 Ethernet 10/100, USB1.1 product NETGEAR FA120 0x1040 USB 2.0 Ethernet +product NETGEAR M4100 0x1100 M4100/M5300/M7100 series switch product NETGEAR WG111V2_2 0x4240 PrismGT USB 2.0 WLAN product NETGEAR WG111V3 0x4260 WG111v3 product NETGEAR WG111U 0x4300 WG111U @@ -3312,6 +3338,9 @@ product OTI DKU5 0x6858 DKU-5 Serial /* Owen.ru products */ product OWEN AC4 0x0004 AC4 USB-RS485 converter +/* OWL producs */ +product OWL CM_160 0xca05 OWL CM-160 power monitor + /* Palm Computing, Inc. product */ product PALM SERIAL 0x0080 USB Serial product PALM M500 0x0001 Palm m500 @@ -3763,6 +3792,9 @@ product SANYO SCP4900 0x0701 Sanyo SCP product SCANLOGIC SL11R 0x0002 SL11R IDE Adapter product SCANLOGIC 336CX 0x0300 Phantom 336CX - C3 scanner +/* Schweitzer Engineering Laboratories products */ +product SEL C662 0x0001 C662 Cable + /* Sealevel products */ product SEALEVEL 2101 0x2101 FTDI compatible adapter product SEALEVEL 2102 0x2102 FTDI compatible adapter @@ -4003,8 +4035,11 @@ product SILABS BEI_VCP 0x846e BEI USB S product SILABS BALLUFF_RFID 0x8477 Balluff RFID reader product SILABS AC_SERV_IBUS 0x85ea AC-Services IBUS Interface product SILABS AC_SERV_CIS 0x85eb AC-Services CIS-IBUS +product SILABS V_PREON32 0x85f8 Virtenio Preon32 product SILABS AC_SERV_CAN 0x8664 AC-Services CAN Interface product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Interface +product SILABS MMB_ZIGBEE 0x88a4 MMB Networks ZigBee +product SILABS INGENI_ZIGBEE 0x88a5 Planet Innovation Ingeni ZigBee product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial @@ -4394,6 +4429,9 @@ product WCH2 CH341SER_2 0x5523 CH341/CH product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge product WCH2 U2M 0X752d CH345 USB2.0-MIDI +/* West Mountain Radio products */ +product WESTMOUNTAIN RIGBLASTER_ADVANTAGE 0x0003 RIGblaster Advantage + /* Western Digital products */ product WESTERN COMBO 0x0200 Firewire USB Combo product WESTERN EXTHDD 0x0400 External HDD From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 21:38:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4A21EED7; Wed, 7 May 2014 21:38: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 1CD1715F; Wed, 7 May 2014 21:38: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 s47LcXbD000606; Wed, 7 May 2014 21:38:33 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47LcXCG000604; Wed, 7 May 2014 21:38:33 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201405072138.s47LcXCG000604@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 7 May 2014 21:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265614 - stable/10/sys/dev/an X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 21:38:34 -0000 Author: gavin Date: Wed May 7 21:38:33 2014 New Revision: 265614 URL: http://svnweb.freebsd.org/changeset/base/265614 Log: Merge r259393 from head: Fix several panics when initialization of an ISA or PC-CARD device fails: o Assign sc->an_dev in an_probe() (which isn't really a probe function in the standard newbus sense) as we may need it for printing errors. o Use device_printf() rather than if_printf() in an_reset() - this is called from an_probe() long before the ifp structure is initialised in an_attach(). o Initialize the ifp structure early in an_attach() as we use if_printf() in cases where allocation of descriptors etc fails. Modified: stable/10/sys/dev/an/if_an.c stable/10/sys/dev/an/if_an_pccard.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/an/if_an.c ============================================================================== --- stable/10/sys/dev/an/if_an.c Wed May 7 21:16:47 2014 (r265613) +++ stable/10/sys/dev/an/if_an.c Wed May 7 21:38:33 2014 (r265614) @@ -357,6 +357,7 @@ an_probe(device_t dev) CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), 0); CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), 0xFFFF); + sc->an_dev = dev; mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); AN_LOCK(sc); @@ -685,6 +686,9 @@ an_attach(struct an_softc *sc, int flags device_printf(sc->an_dev, "can not if_alloc()\n"); goto fail; } + ifp->if_softc = sc; + if_initname(ifp, device_get_name(sc->an_dev), + device_get_unit(sc->an_dev)); sc->an_gone = 0; sc->an_associated = 0; @@ -758,9 +762,6 @@ an_attach(struct an_softc *sc, int flags #endif AN_UNLOCK(sc); - ifp->if_softc = sc; - if_initname(ifp, device_get_name(sc->an_dev), - device_get_unit(sc->an_dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = an_ioctl; ifp->if_start = an_start; @@ -1387,7 +1388,7 @@ an_reset(struct an_softc *sc) an_cmd(sc, AN_CMD_NOOP2, 0); if (an_cmd(sc, AN_CMD_FORCE_SYNCLOSS, 0) == ETIMEDOUT) - if_printf(sc->an_ifp, "reset failed\n"); + device_printf(sc->an_dev, "reset failed\n"); an_cmd(sc, AN_CMD_DISABLE, 0); Modified: stable/10/sys/dev/an/if_an_pccard.c ============================================================================== --- stable/10/sys/dev/an/if_an_pccard.c Wed May 7 21:16:47 2014 (r265613) +++ stable/10/sys/dev/an/if_an_pccard.c Wed May 7 21:38:33 2014 (r265614) @@ -141,8 +141,6 @@ an_pccard_attach(device_t dev) an_alloc_irq(dev, sc->irq_rid, 0); - sc->an_dev = dev; - error = an_attach(sc, flags); if (error) goto fail; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 22:27:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6025EC47; Wed, 7 May 2014 22:27: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 4CDBB829; Wed, 7 May 2014 22:27: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 s47MR4DI022575; Wed, 7 May 2014 22:27:04 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47MR4sQ022574; Wed, 7 May 2014 22:27:04 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405072227.s47MR4sQ022574@svn.freebsd.org> From: Rick Macklem Date: Wed, 7 May 2014 22:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265620 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 22:27:04 -0000 Author: rmacklem Date: Wed May 7 22:27:03 2014 New Revision: 265620 URL: http://svnweb.freebsd.org/changeset/base/265620 Log: MFC: r264842 Modify the NFSv4 client's Pathconf RPC (actually a Getattr Op.) so that it only does the RPC for names that are answered by the RPC. Doing the RPC for other names is harmless, but unnecessary. Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvnops.c Wed May 7 22:17:16 2014 (r265619) +++ stable/10/sys/fs/nfsclient/nfs_clvnops.c Wed May 7 22:27:03 2014 (r265620) @@ -3430,12 +3430,15 @@ nfs_pathconf(struct vop_pathconf_args *a struct thread *td = curthread; int attrflag, error; - if (NFS_ISV4(vp) || (NFS_ISV3(vp) && (ap->a_name == _PC_LINK_MAX || + if ((NFS_ISV34(vp) && (ap->a_name == _PC_LINK_MAX || ap->a_name == _PC_NAME_MAX || ap->a_name == _PC_CHOWN_RESTRICTED || - ap->a_name == _PC_NO_TRUNC))) { + ap->a_name == _PC_NO_TRUNC)) || + (NFS_ISV4(vp) && ap->a_name == _PC_ACL_NFS4)) { /* * Since only the above 4 a_names are returned by the NFSv3 * Pathconf RPC, there is no point in doing it for others. + * For NFSv4, the Pathconf RPC (actually a Getattr Op.) can + * be used for _PC_NFS4_ACL as well. */ error = nfsrpc_pathconf(vp, &pc, td->td_ucred, td, &nfsva, &attrflag, NULL); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 7 22:33:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 96CEFF6D; Wed, 7 May 2014 22:33: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 697788D5; Wed, 7 May 2014 22:33: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 s47MXbeo026357; Wed, 7 May 2014 22:33:37 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47MXb41026356; Wed, 7 May 2014 22:33:37 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405072233.s47MXb41026356@svn.freebsd.org> From: Rick Macklem Date: Wed, 7 May 2014 22:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265621 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 22:33:37 -0000 Author: rmacklem Date: Wed May 7 22:33:36 2014 New Revision: 265621 URL: http://svnweb.freebsd.org/changeset/base/265621 Log: MFC: r264845 Remove an unnecessary level of indirection for an argument. This simplifies the code and should avoid the clang sparc port from generating an abort() call. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Wed May 7 22:27:03 2014 (r265620) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Wed May 7 22:33:36 2014 (r265621) @@ -79,7 +79,7 @@ static int nfsrv_getstate(struct nfsclie static void nfsrv_getowner(struct nfsstatehead *hp, struct nfsstate *new_stp, struct nfsstate **stpp); static int nfsrv_getlockfh(vnode_t vp, u_short flags, - struct nfslockfile **new_lfpp, fhandle_t *nfhp, NFSPROC_T *p); + struct nfslockfile *new_lfp, fhandle_t *nfhp, NFSPROC_T *p); static int nfsrv_getlockfile(u_short flags, struct nfslockfile **new_lfpp, struct nfslockfile **lfpp, fhandle_t *nfhp, int lockit); static void nfsrv_insertlock(struct nfslock *new_lop, @@ -1985,7 +1985,7 @@ tryagain: MALLOC(new_lfp, struct nfslockfile *, sizeof (struct nfslockfile), M_NFSDLOCKFILE, M_WAITOK); if (vp) - getfhret = nfsrv_getlockfh(vp, new_stp->ls_flags, &new_lfp, + getfhret = nfsrv_getlockfh(vp, new_stp->ls_flags, new_lfp, NULL, p); NFSLOCKSTATE(); /* @@ -2235,7 +2235,7 @@ tryagain: M_NFSDSTATE, M_WAITOK); MALLOC(new_deleg, struct nfsstate *, sizeof (struct nfsstate), M_NFSDSTATE, M_WAITOK); - getfhret = nfsrv_getlockfh(vp, new_stp->ls_flags, &new_lfp, + getfhret = nfsrv_getlockfh(vp, new_stp->ls_flags, new_lfp, NULL, p); NFSLOCKSTATE(); /* @@ -3142,11 +3142,10 @@ out: * Get the file handle for a lock structure. */ static int -nfsrv_getlockfh(vnode_t vp, u_short flags, - struct nfslockfile **new_lfpp, fhandle_t *nfhp, NFSPROC_T *p) +nfsrv_getlockfh(vnode_t vp, u_short flags, struct nfslockfile *new_lfp, + fhandle_t *nfhp, NFSPROC_T *p) { fhandle_t *fhp = NULL; - struct nfslockfile *new_lfp; int error; /* @@ -3154,7 +3153,7 @@ nfsrv_getlockfh(vnode_t vp, u_short flag * a fhandle_t on the stack. */ if (flags & NFSLCK_OPEN) { - new_lfp = *new_lfpp; + KASSERT(new_lfp != NULL, ("nfsrv_getlockfh: new_lfp NULL")); fhp = &new_lfp->lf_fh; } else if (nfhp) { fhp = nfhp; From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 06:55:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A002A8F; Thu, 8 May 2014 06:55: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 80C1764B; Thu, 8 May 2014 06:55: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 s486tne8045366; Thu, 8 May 2014 06:55:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s486tmAK045362; Thu, 8 May 2014 06:55:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080655.s486tmAK045362@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 06:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265632 - in stable/10: sbin/camcontrol sys/cam sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 06:55:49 -0000 Author: mav Date: Thu May 8 06:55:48 2014 New Revision: 265632 URL: http://svnweb.freebsd.org/changeset/base/265632 Log: MFC r260509: Replace several instances of -1 with appropriate CAM_*_WILDCARD and types. It was equal before r259397, but for good or bad, not any more for LUNs. This change fixes at least CAM debugging. Modified: stable/10/sbin/camcontrol/camcontrol.c stable/10/sys/cam/cam_debug.h stable/10/sys/cam/cam_xpt.c stable/10/sys/cam/scsi/scsi_low.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Thu May 8 03:43:18 2014 (r265631) +++ stable/10/sbin/camcontrol/camcontrol.c Thu May 8 06:55:48 2014 (r265632) @@ -264,11 +264,12 @@ static int scsiinquiry(struct cam_device static int scsiserial(struct cam_device *device, int retry_count, int timeout); static int camxferrate(struct cam_device *device); #endif /* MINIMALISTIC */ -static int parse_btl(char *tstr, int *bus, int *target, int *lun, - cam_argmask *arglst); +static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, + lun_id_t *lun, cam_argmask *arglst); static int dorescan_or_reset(int argc, char **argv, int rescan); -static int rescan_or_reset_bus(int bus, int rescan); -static int scanlun_or_reset_dev(int bus, int target, int lun, int scan); +static int rescan_or_reset_bus(path_id_t bus, int rescan); +static int scanlun_or_reset_dev(path_id_t bus, target_id_t target, + lun_id_t lun, int scan); #ifndef MINIMALISTIC static int readdefects(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); @@ -3019,7 +3020,8 @@ atasecurity(struct cam_device *device, i * Returns the number of parsed components, or 0. */ static int -parse_btl(char *tstr, int *bus, int *target, int *lun, cam_argmask *arglst) +parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, + cam_argmask *arglst) { char *tmpstr; int convs = 0; @@ -3055,7 +3057,9 @@ dorescan_or_reset(int argc, char **argv, static const char must[] = "you must specify \"all\", a bus, or a bus:target:lun to %s"; int rv, error = 0; - int bus = -1, target = -1, lun = -1; + path_id_t bus = CAM_BUS_WILDCARD; + target_id_t target = CAM_TARGET_WILDCARD; + lun_id_t lun = CAM_LUN_WILDCARD; char *tstr; if (argc < 3) { @@ -3087,7 +3091,7 @@ dorescan_or_reset(int argc, char **argv, } static int -rescan_or_reset_bus(int bus, int rescan) +rescan_or_reset_bus(path_id_t bus, int rescan) { union ccb ccb, matchccb; int fd, retval; @@ -3101,7 +3105,7 @@ rescan_or_reset_bus(int bus, int rescan) return(1); } - if (bus != -1) { + if (bus != CAM_BUS_WILDCARD) { ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS : XPT_RESET_BUS; ccb.ccb_h.path_id = bus; ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; @@ -3201,7 +3205,7 @@ rescan_or_reset_bus(int bus, int rescan) * We don't want to rescan or reset the xpt bus. * See above. */ - if ((int)bus_result->path_id == -1) + if (bus_result->path_id == CAM_XPT_PATH_ID) continue; ccb.ccb_h.func_code = rescan ? XPT_SCAN_BUS : @@ -3254,7 +3258,7 @@ bailout: } static int -scanlun_or_reset_dev(int bus, int target, int lun, int scan) +scanlun_or_reset_dev(path_id_t bus, target_id_t target, lun_id_t lun, int scan) { union ccb ccb; struct cam_device *device; @@ -3262,18 +3266,18 @@ scanlun_or_reset_dev(int bus, int target device = NULL; - if (bus < 0) { + if (bus == CAM_BUS_WILDCARD) { warnx("invalid bus number %d", bus); return(1); } - if (target < 0) { + if (target == CAM_TARGET_WILDCARD) { warnx("invalid target number %d", target); return(1); } - if (lun < 0) { - warnx("invalid lun number %d", lun); + if (lun == CAM_LUN_WILDCARD) { + warnx("invalid lun number %jx", (uintmax_t)lun); return(1); } @@ -3331,12 +3335,12 @@ scanlun_or_reset_dev(int bus, int target if (((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) || ((!scan) && ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_BDR_SENT))) { - fprintf(stdout, "%s of %d:%d:%d was successful\n", - scan? "Re-scan" : "Reset", bus, target, lun); + fprintf(stdout, "%s of %d:%d:%jx was successful\n", + scan? "Re-scan" : "Reset", bus, target, (uintmax_t)lun); return(0); } else { - fprintf(stdout, "%s of %d:%d:%d returned error %#x\n", - scan? "Re-scan" : "Reset", bus, target, lun, + fprintf(stdout, "%s of %d:%d:%jx returned error %#x\n", + scan? "Re-scan" : "Reset", bus, target, (uintmax_t)lun, ccb.ccb_h.status & CAM_STATUS_MASK); return(1); } @@ -4218,7 +4222,9 @@ static int camdebug(int argc, char **argv, char *combinedopt) { int c, fd; - int bus = -1, target = -1, lun = -1; + path_id_t bus = CAM_BUS_WILDCARD; + target_id_t target = CAM_TARGET_WILDCARD; + lun_id_t lun = CAM_LUN_WILDCARD; char *tstr, *tmpstr = NULL; union ccb ccb; int error = 0; @@ -4338,8 +4344,8 @@ camdebug(int argc, char **argv, char *co } else { fprintf(stderr, "Debugging enabled for " - "%d:%d:%d\n", - bus, target, lun); + "%d:%d:%jx\n", + bus, target, (uintmax_t)lun); } } } @@ -7986,7 +7992,9 @@ main(int argc, char **argv) int error = 0, optstart = 2; int devopen = 1; #ifndef MINIMALISTIC - int bus, target, lun; + path_id_t bus; + target_id_t target; + lun_id_t lun; #endif /* MINIMALISTIC */ cmdlist = CAM_CMD_NONE; Modified: stable/10/sys/cam/cam_debug.h ============================================================================== --- stable/10/sys/cam/cam_debug.h Thu May 8 03:43:18 2014 (r265631) +++ stable/10/sys/cam/cam_debug.h Thu May 8 06:55:48 2014 (r265632) @@ -61,13 +61,13 @@ typedef enum { #endif #ifndef CAM_DEBUG_BUS -#define CAM_DEBUG_BUS (-1) +#define CAM_DEBUG_BUS CAM_BUS_WILDCARD #endif #ifndef CAM_DEBUG_TARGET -#define CAM_DEBUG_TARGET (-1) +#define CAM_DEBUG_TARGET CAM_TARGET_WILDCARD #endif #ifndef CAM_DEBUG_LUN -#define CAM_DEBUG_LUN (-1) +#define CAM_DEBUG_LUN CAM_LUN_WILDCARD #endif #ifndef CAM_DEBUG_DELAY Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Thu May 8 03:43:18 2014 (r265631) +++ stable/10/sys/cam/cam_xpt.c Thu May 8 06:55:48 2014 (r265632) @@ -1992,13 +1992,15 @@ xptplistperiphfunc(struct cam_periph *pe cdm->matches[j].result.periph_result.target_id = periph->path->target->target_id; else - cdm->matches[j].result.periph_result.target_id = -1; + cdm->matches[j].result.periph_result.target_id = + CAM_TARGET_WILDCARD; if (periph->path->device) cdm->matches[j].result.periph_result.target_lun = periph->path->device->lun_id; else - cdm->matches[j].result.periph_result.target_lun = -1; + cdm->matches[j].result.periph_result.target_lun = + CAM_LUN_WILDCARD; cdm->matches[j].result.periph_result.unit_number = periph->unit_number; Modified: stable/10/sys/cam/scsi/scsi_low.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_low.c Thu May 8 03:43:18 2014 (r265631) +++ stable/10/sys/cam/scsi/scsi_low.c Thu May 8 06:55:48 2014 (r265632) @@ -4232,7 +4232,7 @@ scsi_low_print(slp, ti) if (ti != NULL) { u_int flags = 0, maxnqio = 0, nqio = 0; - int lun = -1; + int lun = CAM_LUN_WILDCARD; if (li != NULL) { From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 07:00:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BA37634E; Thu, 8 May 2014 07:00: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 A5C68690; Thu, 8 May 2014 07:00: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 s4870lQW046210; Thu, 8 May 2014 07:00:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4870kOs046200; Thu, 8 May 2014 07:00:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080700.s4870kOs046200@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 07:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265634 - in stable/10/sys/cam: ctl scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:00:47 -0000 Author: mav Date: Thu May 8 07:00:45 2014 New Revision: 265634 URL: http://svnweb.freebsd.org/changeset/base/265634 Log: MFC r264274, r264279, r264283, r264296, r264297: Add support for SCSI UNMAP commands to CTL. This patch adds support for three new SCSI commands: UNMAP, WRITE SAME(10) and WRITE SAME(16). WRITE SAME commands support both normal write mode and UNMAP flag. To properly report UNMAP capabilities this patch also adds support for reporting two new VPD pages: Block limits and Logical Block Provisioning. UNMAP support can be enabled per-LUN by adding "-o unmap=on" to `ctladm create` command line or "option unmap on" to lun sections of /etc/ctl.conf. At this moment UNMAP supported for ramdisks and device-backed block LUNs. It was tested to work great with ZFS ZVOLs. For file-backed LUNs UNMAP support is unfortunately missing due to absence of respective VFS KPI. Sponsored by: iXsystems, Inc Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend.h stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/ctl_ser_table.c stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu May 8 06:56:59 2014 (r265633) +++ stable/10/sys/cam/ctl/ctl.c Thu May 8 07:00:45 2014 (r265634) @@ -331,9 +331,10 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verb &verbose, 0, "Show SCSI errors returned to initiator"); /* - * Serial number (0x80), device id (0x83), and supported pages (0x00) + * Serial number (0x80), device id (0x83), supported pages (0x00), + * Block limits (0xB0) and Logical Block Provisioning (0xB2) */ -#define SCSI_EVPD_NUM_SUPPORTED_PAGES 3 +#define SCSI_EVPD_NUM_SUPPORTED_PAGES 5 static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, int param); @@ -391,6 +392,9 @@ static void ctl_hndl_per_res_out_on_othe static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len); +static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, + int alloc_len); +static int ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio); static int ctl_inquiry_std(struct ctl_scsiio *ctsio); static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint32_t *len); @@ -5787,6 +5791,195 @@ ctl_write_buffer(struct ctl_scsiio *ctsi return (CTL_RETVAL_COMPLETE); } +int +ctl_write_same(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct ctl_lba_len_flags lbalen; + uint64_t lba; + uint32_t num_blocks; + int len, retval; + uint8_t byte2; + + retval = CTL_RETVAL_COMPLETE; + + CTL_DEBUG_PRINT(("ctl_write_same\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + switch (ctsio->cdb[0]) { + case WRITE_SAME_10: { + struct scsi_write_same_10 *cdb; + + cdb = (struct scsi_write_same_10 *)ctsio->cdb; + + lba = scsi_4btoul(cdb->addr); + num_blocks = scsi_2btoul(cdb->length); + byte2 = cdb->byte2; + break; + } + case WRITE_SAME_16: { + struct scsi_write_same_16 *cdb; + + cdb = (struct scsi_write_same_16 *)ctsio->cdb; + + lba = scsi_8btou64(cdb->addr); + num_blocks = scsi_4btoul(cdb->length); + byte2 = cdb->byte2; + break; + } + default: + /* + * We got a command we don't support. This shouldn't + * happen, commands should be filtered out above us. + */ + ctl_set_invalid_opcode(ctsio); + ctl_done((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); + break; /* NOTREACHED */ + } + + /* + * The first check is to make sure we're in bounds, the second + * check is to catch wrap-around problems. If the lba + num blocks + * is less than the lba, then we've wrapped around and the block + * range is invalid anyway. + */ + if (((lba + num_blocks) > (lun->be_lun->maxlba + 1)) + || ((lba + num_blocks) < lba)) { + ctl_set_lba_out_of_range(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + /* Zero number of blocks means "to the last logical block" */ + if (num_blocks == 0) { + if ((lun->be_lun->maxlba + 1) - lba > UINT32_MAX) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 0, + /*command*/ 1, + /*field*/ 0, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + num_blocks = (lun->be_lun->maxlba + 1) - lba; + } + + len = lun->be_lun->blocksize; + + /* + * If we've got a kernel request that hasn't been malloced yet, + * malloc it and tell the caller the data buffer is here. + */ + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { + ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK);; + ctsio->kern_data_len = len; + ctsio->kern_total_len = len; + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); + } + + lbalen.lba = lba; + lbalen.len = num_blocks; + lbalen.flags = byte2; + memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen, + sizeof(lbalen)); + retval = lun->backend->config_write((union ctl_io *)ctsio); + + return (retval); +} + +int +ctl_unmap(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct scsi_unmap *cdb; + struct ctl_ptr_len_flags ptrlen; + struct scsi_unmap_header *hdr; + struct scsi_unmap_desc *buf, *end; + uint64_t lba; + uint32_t num_blocks; + int len, retval; + uint8_t byte2; + + retval = CTL_RETVAL_COMPLETE; + + CTL_DEBUG_PRINT(("ctl_unmap\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + cdb = (struct scsi_unmap *)ctsio->cdb; + + len = scsi_2btoul(cdb->length); + byte2 = cdb->byte2; + + /* + * If we've got a kernel request that hasn't been malloced yet, + * malloc it and tell the caller the data buffer is here. + */ + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { + ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK);; + ctsio->kern_data_len = len; + ctsio->kern_total_len = len; + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); + } + + len = ctsio->kern_total_len - ctsio->kern_data_resid; + hdr = (struct scsi_unmap_header *)ctsio->kern_data_ptr; + if (len < sizeof (*hdr) || + len < (scsi_2btoul(hdr->length) + sizeof(hdr->length)) || + len < (scsi_2btoul(hdr->desc_length) + sizeof (*hdr)) || + scsi_2btoul(hdr->desc_length) % sizeof(*buf) != 0) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 0, + /*command*/ 0, + /*field*/ 0, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + len = scsi_2btoul(hdr->desc_length); + buf = (struct scsi_unmap_desc *)(hdr + 1); + end = buf + len / sizeof(*buf); + + ptrlen.ptr = (void *)buf; + ptrlen.len = len; + ptrlen.flags = byte2; + memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &ptrlen, + sizeof(ptrlen)); + + for (; buf < end; buf++) { + lba = scsi_8btou64(buf->lba); + num_blocks = scsi_4btoul(buf->length); + if (((lba + num_blocks) > (lun->be_lun->maxlba + 1)) + || ((lba + num_blocks) < lba)) { + ctl_set_lba_out_of_range(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + } + + retval = lun->backend->config_write((union ctl_io *)ctsio); + + return (retval); +} + /* * Note that this function currently doesn't actually do anything inside * CTL to enforce things if the DQue bit is turned on. @@ -6909,6 +7102,8 @@ ctl_read_capacity_16(struct ctl_scsiio * scsi_ulto4b(lun->be_lun->blocksize, data->length); data->prot_lbppbe = lun->be_lun->pblockexp & SRC16_LBPPBE; scsi_ulto2b(lun->be_lun->pblockoff & SRC16_LALBA_A, data->lalba_lbp); + if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) + data->lalba_lbp[0] |= SRC16_LBPME; ctsio->scsi_status = SCSI_STATUS_OK; @@ -8995,8 +9190,8 @@ ctl_inquiry_evpd_supported(struct ctl_sc lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - sup_page_size = sizeof(struct scsi_vpd_supported_pages) + - SCSI_EVPD_NUM_SUPPORTED_PAGES; + sup_page_size = sizeof(struct scsi_vpd_supported_pages) * + SCSI_EVPD_NUM_SUPPORTED_PAGES; ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO); pages = (struct scsi_vpd_supported_pages *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -9032,6 +9227,10 @@ ctl_inquiry_evpd_supported(struct ctl_sc pages->page_list[1] = SVPD_UNIT_SERIAL_NUMBER; /* Device Identification */ pages->page_list[2] = SVPD_DEVICE_ID; + /* Block limits */ + pages->page_list[3] = SVPD_BLOCK_LIMITS; + /* Logical Block Provisioning */ + pages->page_list[4] = SVPD_LBP; ctsio->scsi_status = SCSI_STATUS_OK; @@ -9296,11 +9495,117 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio } static int +ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len) +{ + struct scsi_vpd_block_limits *bl_ptr; + struct ctl_lun *lun; + int bs; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + bs = lun->be_lun->blocksize; + + ctsio->kern_data_ptr = malloc(sizeof(*bl_ptr), M_CTL, M_WAITOK | M_ZERO); + bl_ptr = (struct scsi_vpd_block_limits *)ctsio->kern_data_ptr; + ctsio->kern_sg_entries = 0; + + if (sizeof(*bl_ptr) < alloc_len) { + ctsio->residual = alloc_len - sizeof(*bl_ptr); + ctsio->kern_data_len = sizeof(*bl_ptr); + ctsio->kern_total_len = sizeof(*bl_ptr); + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* + * The control device is always connected. The disk device, on the + * other hand, may not be online all the time. Need to change this + * to figure out whether the disk device is actually online or not. + */ + if (lun != NULL) + bl_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | + lun->be_lun->lun_type; + else + bl_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; + + bl_ptr->page_code = SVPD_BLOCK_LIMITS; + scsi_ulto2b(sizeof(*bl_ptr), bl_ptr->page_length); + scsi_ulto4b((16 * 1024 * 1024) / bs, bl_ptr->max_txfer_len); + scsi_ulto4b(MAXPHYS / bs, bl_ptr->opt_txfer_len); + if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { + scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); + scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_blk_cnt); + } + scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length); + + ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); +} + +static int +ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len) +{ + struct scsi_vpd_logical_block_prov *lbp_ptr; + struct ctl_lun *lun; + int bs; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + bs = lun->be_lun->blocksize; + + ctsio->kern_data_ptr = malloc(sizeof(*lbp_ptr), M_CTL, M_WAITOK | M_ZERO); + lbp_ptr = (struct scsi_vpd_logical_block_prov *)ctsio->kern_data_ptr; + ctsio->kern_sg_entries = 0; + + if (sizeof(*lbp_ptr) < alloc_len) { + ctsio->residual = alloc_len - sizeof(*lbp_ptr); + ctsio->kern_data_len = sizeof(*lbp_ptr); + ctsio->kern_total_len = sizeof(*lbp_ptr); + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* + * The control device is always connected. The disk device, on the + * other hand, may not be online all the time. Need to change this + * to figure out whether the disk device is actually online or not. + */ + if (lun != NULL) + lbp_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | + lun->be_lun->lun_type; + else + lbp_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; + + lbp_ptr->page_code = SVPD_LBP; + if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) + lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10; + + ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); +} + +static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio) { struct scsi_inquiry *cdb; + struct ctl_lun *lun; int alloc_len, retval; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_inquiry *)ctsio->cdb; retval = CTL_RETVAL_COMPLETE; @@ -9317,6 +9622,12 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsi case SVPD_DEVICE_ID: retval = ctl_inquiry_evpd_devid(ctsio, alloc_len); break; + case SVPD_BLOCK_LIMITS: + retval = ctl_inquiry_evpd_block_limits(ctsio, alloc_len); + break; + case SVPD_LBP: + retval = ctl_inquiry_evpd_lbp(ctsio, alloc_len); + break; default: ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, @@ -9687,6 +9998,24 @@ ctl_get_lba_len(union ctl_io *io, uint64 *len = scsi_4btoul(cdb->length); break; } + case WRITE_SAME_10: { + struct scsi_write_same_10 *cdb; + + cdb = (struct scsi_write_same_10 *)io->scsiio.cdb; + + *lba = scsi_4btoul(cdb->addr); + *len = scsi_2btoul(cdb->length); + break; + } + case WRITE_SAME_16: { + struct scsi_write_same_16 *cdb; + + cdb = (struct scsi_write_same_16 *)io->scsiio.cdb; + + *lba = scsi_8btou64(cdb->addr); + *len = scsi_4btoul(cdb->length); + break; + } default: return (1); break; /* NOTREACHED */ Modified: stable/10/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.h Thu May 8 06:56:59 2014 (r265633) +++ stable/10/sys/cam/ctl/ctl_backend.h Thu May 8 07:00:45 2014 (r265634) @@ -71,6 +71,8 @@ * valid for use in SCSI INQUIRY VPD page 0x83. * * The DEV_TYPE flag tells us that the device_type field is filled in. + * + * The UNMAP flag tells us that this LUN supports UNMAP. */ typedef enum { CTL_LUN_FLAG_ID_REQ = 0x01, @@ -79,7 +81,8 @@ typedef enum { CTL_LUN_FLAG_PRIMARY = 0x08, CTL_LUN_FLAG_SERIAL_NUM = 0x10, CTL_LUN_FLAG_DEVID = 0x20, - CTL_LUN_FLAG_DEV_TYPE = 0x40 + CTL_LUN_FLAG_DEV_TYPE = 0x40, + CTL_LUN_FLAG_UNMAP = 0x80 } ctl_backend_lun_flags; #ifdef _KERNEL Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Thu May 8 06:56:59 2014 (r265633) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Thu May 8 07:00:45 2014 (r265634) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -152,6 +153,7 @@ struct ctl_be_block_lun { union ctl_be_block_bedata backend; cbb_dispatch_t dispatch; cbb_dispatch_t lun_flush; + cbb_dispatch_t unmap; struct mtx lock; uma_zone_t lun_zone; uint64_t size_blocks; @@ -207,6 +209,7 @@ struct ctl_be_block_io { uint64_t io_offset; struct ctl_be_block_softc *softc; struct ctl_be_block_lun *lun; + void (*beio_cont)(struct ctl_be_block_io *beio); /* to continue processing */ }; static int cbb_num_threads = 14; @@ -227,6 +230,8 @@ static void ctl_be_block_dispatch_file(s struct ctl_be_block_io *beio); static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); +static void ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio); static void ctl_be_block_dispatch_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); static void ctl_be_block_cw_dispatch(struct ctl_be_block_lun *be_lun, @@ -335,8 +340,12 @@ ctl_complete_beio(struct ctl_be_block_io /*now*/ NULL, /*then*/&beio->ds_t0); - ctl_free_beio(beio); - ctl_done(io); + if (beio->beio_cont != NULL) { + beio->beio_cont(beio); + } else { + ctl_free_beio(beio); + ctl_done(io); + } } static int @@ -482,11 +491,12 @@ ctl_be_block_biodone(struct bio *bio) } /* - * If this is a write or a flush, we're all done. + * If this is a write, a flush or a delete, we're all done. * If this is a read, we can now send the data to the user. */ if ((beio->bio_cmd == BIO_WRITE) - || (beio->bio_cmd == BIO_FLUSH)) { + || (beio->bio_cmd == BIO_FLUSH) + || (beio->bio_cmd == BIO_DELETE)) { ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { @@ -752,6 +762,79 @@ ctl_be_block_flush_dev(struct ctl_be_blo } static void +ctl_be_block_unmap_dev_range(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio, + uint64_t off, uint64_t len, int last) +{ + struct bio *bio; + struct ctl_be_block_devdata *dev_data; + uint64_t maxlen; + + dev_data = &be_lun->backend.dev; + maxlen = LONG_MAX - (LONG_MAX % be_lun->blocksize); + while (len > 0) { + bio = g_alloc_bio(); + bio->bio_cmd = BIO_DELETE; + bio->bio_flags |= beio->bio_flags; + bio->bio_dev = dev_data->cdev; + bio->bio_offset = off; + bio->bio_length = MIN(len, maxlen); + bio->bio_data = 0; + bio->bio_done = ctl_be_block_biodone; + bio->bio_caller1 = beio; + bio->bio_pblkno = off / be_lun->blocksize; + + off += bio->bio_length; + len -= bio->bio_length; + + mtx_lock(&be_lun->lock); + beio->num_bios_sent++; + if (last && len == 0) + beio->send_complete = 1; + mtx_unlock(&be_lun->lock); + + (*dev_data->csw->d_strategy)(bio); + } +} + +static void +ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + union ctl_io *io; + struct ctl_be_block_devdata *dev_data; + struct ctl_ptr_len_flags ptrlen; + struct scsi_unmap_desc *buf, *end; + uint64_t len; + + dev_data = &be_lun->backend.dev; + io = beio->io; + + DPRINTF("entered\n"); + + binuptime(&beio->ds_t0); + devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0); + + if (beio->io_offset == -1) { + beio->io_len = 0; + memcpy(&ptrlen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + sizeof(ptrlen)); + buf = (struct scsi_unmap_desc *)ptrlen.ptr; + end = buf + ptrlen.len / sizeof(*buf); + for (; buf < end; buf++) { + len = (uint64_t)scsi_4btoul(buf->length) * + be_lun->blocksize; + beio->io_len += len; + ctl_be_block_unmap_dev_range(be_lun, beio, + scsi_8btou64(buf->lba) * be_lun->blocksize, len, + (end - buf < 2) ? TRUE : FALSE); + } + } else + ctl_be_block_unmap_dev_range(be_lun, beio, + beio->io_offset, beio->io_len, TRUE); +} + +static void ctl_be_block_dispatch_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { @@ -839,6 +922,208 @@ ctl_be_block_dispatch_dev(struct ctl_be_ } static void +ctl_be_block_cw_done_ws(struct ctl_be_block_io *beio) +{ + union ctl_io *io; + + io = beio->io; + ctl_free_beio(beio); + if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) + && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { + ctl_config_write_done(io); + return; + } + + ctl_be_block_config_write(io); +} + +static void +ctl_be_block_cw_dispatch_ws(struct ctl_be_block_lun *be_lun, + union ctl_io *io) +{ + struct ctl_be_block_io *beio; + struct ctl_be_block_softc *softc; + struct ctl_lba_len_flags lbalen; + uint64_t len_left, lba; + int i, seglen; + uint8_t *buf, *end; + + DPRINTF("entered\n"); + + beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; + softc = be_lun->softc; + memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + sizeof(lbalen)); + + if (lbalen.flags & ~(SWS_LBDATA | SWS_UNMAP) || + (lbalen.flags & SWS_UNMAP && be_lun->unmap == NULL)) { + ctl_free_beio(beio); + ctl_set_invalid_field(&io->scsiio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 1, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_config_write_done(io); + return; + } + + /* + * If the I/O came down with an ordered or head of queue tag, set + * the BIO_ORDERED attribute. For head of queue tags, that's + * pretty much the best we can do. + */ + if ((io->scsiio.tag_type == CTL_TAG_ORDERED) + || (io->scsiio.tag_type == CTL_TAG_HEAD_OF_QUEUE)) + beio->bio_flags = BIO_ORDERED; + + switch (io->scsiio.tag_type) { + case CTL_TAG_ORDERED: + beio->ds_tag_type = DEVSTAT_TAG_ORDERED; + break; + case CTL_TAG_HEAD_OF_QUEUE: + beio->ds_tag_type = DEVSTAT_TAG_HEAD; + break; + case CTL_TAG_UNTAGGED: + case CTL_TAG_SIMPLE: + case CTL_TAG_ACA: + default: + beio->ds_tag_type = DEVSTAT_TAG_SIMPLE; + break; + } + + if (lbalen.flags & SWS_UNMAP) { + beio->io_offset = lbalen.lba * be_lun->blocksize; + beio->io_len = (uint64_t)lbalen.len * be_lun->blocksize; + beio->bio_cmd = BIO_DELETE; + beio->ds_trans_type = DEVSTAT_FREE; + + be_lun->unmap(be_lun, beio); + return; + } + + beio->bio_cmd = BIO_WRITE; + beio->ds_trans_type = DEVSTAT_WRITE; + + DPRINTF("WRITE SAME at LBA %jx len %u\n", + (uintmax_t)lbalen.lba, lbalen.len); + + len_left = (uint64_t)lbalen.len * be_lun->blocksize; + for (i = 0, lba = 0; i < CTLBLK_MAX_SEGS && len_left > 0; i++) { + + /* + * Setup the S/G entry for this chunk. + */ + seglen = MIN(MAXPHYS, len_left); + seglen -= seglen % be_lun->blocksize; + beio->sg_segs[i].len = seglen; + beio->sg_segs[i].addr = uma_zalloc(be_lun->lun_zone, M_WAITOK); + + DPRINTF("segment %d addr %p len %zd\n", i, + beio->sg_segs[i].addr, beio->sg_segs[i].len); + + beio->num_segs++; + len_left -= seglen; + + buf = beio->sg_segs[i].addr; + end = buf + seglen; + for (; buf < end; buf += be_lun->blocksize) { + memcpy(buf, io->scsiio.kern_data_ptr, be_lun->blocksize); + if (lbalen.flags & SWS_LBDATA) + scsi_ulto4b(lbalen.lba + lba, buf); + lba++; + } + } + + beio->io_offset = lbalen.lba * be_lun->blocksize; + beio->io_len = lba * be_lun->blocksize; + + /* We can not do all in one run. Correct and schedule rerun. */ + if (len_left > 0) { + lbalen.lba += lba; + lbalen.len -= lba; + memcpy(io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen, + sizeof(lbalen)); + beio->beio_cont = ctl_be_block_cw_done_ws; + } + + be_lun->dispatch(be_lun, beio); +} + +static void +ctl_be_block_cw_dispatch_unmap(struct ctl_be_block_lun *be_lun, + union ctl_io *io) +{ + struct ctl_be_block_io *beio; + struct ctl_be_block_softc *softc; + struct ctl_ptr_len_flags ptrlen; + + DPRINTF("entered\n"); + + beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; + softc = be_lun->softc; + memcpy(&ptrlen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + sizeof(ptrlen)); + + if (ptrlen.flags != 0 || be_lun->unmap == NULL) { + ctl_free_beio(beio); + ctl_set_invalid_field(&io->scsiio, + /*sks_valid*/ 0, + /*command*/ 1, + /*field*/ 0, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_config_write_done(io); + return; + } + + /* + * If the I/O came down with an ordered or head of queue tag, set + * the BIO_ORDERED attribute. For head of queue tags, that's + * pretty much the best we can do. + */ + if ((io->scsiio.tag_type == CTL_TAG_ORDERED) + || (io->scsiio.tag_type == CTL_TAG_HEAD_OF_QUEUE)) + beio->bio_flags = BIO_ORDERED; + + switch (io->scsiio.tag_type) { + case CTL_TAG_ORDERED: + beio->ds_tag_type = DEVSTAT_TAG_ORDERED; + break; + case CTL_TAG_HEAD_OF_QUEUE: + beio->ds_tag_type = DEVSTAT_TAG_HEAD; + break; + case CTL_TAG_UNTAGGED: + case CTL_TAG_SIMPLE: + case CTL_TAG_ACA: + default: + beio->ds_tag_type = DEVSTAT_TAG_SIMPLE; + break; + } + + beio->io_len = 0; + beio->io_offset = -1; + + beio->bio_cmd = BIO_DELETE; + beio->ds_trans_type = DEVSTAT_FREE; + + DPRINTF("WRITE SAME at LBA %jx len %u\n", + (uintmax_t)lbalen.lba, lbalen.len); + + be_lun->unmap(be_lun, beio); +} + +static void +ctl_be_block_cw_done(struct ctl_be_block_io *beio) +{ + union ctl_io *io; + + io = beio->io; + ctl_free_beio(beio); + ctl_config_write_done(io); +} + +static void ctl_be_block_cw_dispatch(struct ctl_be_block_lun *be_lun, union ctl_io *io) { @@ -849,11 +1134,9 @@ ctl_be_block_cw_dispatch(struct ctl_be_b softc = be_lun->softc; beio = ctl_alloc_beio(softc); - KASSERT(beio != NULL, ("ctl_alloc_beio() failed")); - beio->io = io; - beio->softc = softc; beio->lun = be_lun; + beio->beio_cont = ctl_be_block_cw_done; io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr = beio; switch (io->scsiio.cdb[0]) { @@ -865,6 +1148,13 @@ ctl_be_block_cw_dispatch(struct ctl_be_b beio->io_len = 0; be_lun->lun_flush(be_lun, beio); break; + case WRITE_SAME_10: + case WRITE_SAME_16: + ctl_be_block_cw_dispatch_ws(be_lun, io); + break; + case UNMAP: + ctl_be_block_cw_dispatch_unmap(be_lun, io); + break; default: panic("Unhandled CDB type %#x", io->scsiio.cdb[0]); break; @@ -920,10 +1210,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc } beio = ctl_alloc_beio(softc); - KASSERT(beio != NULL, ("ctl_alloc_beio() failed")); - beio->io = io; - beio->softc = softc; beio->lun = be_lun; io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr = beio; @@ -1273,6 +1560,7 @@ ctl_be_block_open_dev(struct ctl_be_bloc 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); @@ -1532,7 +1820,7 @@ ctl_be_block_create(struct ctl_be_block_ struct ctl_lun_create_params *params; struct ctl_be_arg *file_arg; char tmpstr[32]; - int retval, num_threads; + int retval, num_threads, unmap; int i; params = &req->reqdata.create; @@ -1623,6 +1911,7 @@ ctl_be_block_create(struct ctl_be_block_ * XXX This searching loop might be refactored to be combined with * the loop above, */ + unmap = 0; for (i = 0; i < req->num_be_args; i++) { if (strcmp(req->kern_be_args[i].kname, "num_threads") == 0) { struct ctl_be_arg *thread_arg; @@ -1651,6 +1940,9 @@ ctl_be_block_create(struct ctl_be_block_ } num_threads = tmp_num_threads; + } else if (strcmp(req->kern_be_args[i].kname, "unmap") == 0 && + strcmp(req->kern_be_args[i].kvalue, "on") == 0) { + unmap = 1; } else if (strcmp(req->kern_be_args[i].kname, "file") != 0 && strcmp(req->kern_be_args[i].kname, "dev") != 0) { struct ctl_be_lun_option *opt; @@ -1666,6 +1958,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->flags = CTL_BE_BLOCK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; + if (unmap) + be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP; be_lun->ctl_be_lun.be_lun = be_lun; be_lun->ctl_be_lun.blocksize = be_lun->blocksize; be_lun->ctl_be_lun.pblockexp = be_lun->pblockexp; @@ -2141,6 +2435,9 @@ ctl_be_block_config_write(union ctl_io * switch (io->scsiio.cdb[0]) { case SYNCHRONIZE_CACHE: case SYNCHRONIZE_CACHE_16: + case WRITE_SAME_10: + case WRITE_SAME_16: + case UNMAP: /* * The upper level CTL code will filter out any CDBs with * the immediate bit set and return the proper error. Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu May 8 06:56:59 2014 (r265633) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu May 8 07:00:45 2014 (r265634) @@ -491,7 +491,7 @@ ctl_backend_ramdisk_create(struct ctl_be struct ctl_lun_create_params *params; uint32_t blocksize; char tmpstr[32]; - int i, retval; + int i, retval, unmap; retval = 0; params = &req->reqdata.create; @@ -546,19 +546,27 @@ ctl_backend_ramdisk_create(struct ctl_be be_lun->softc = softc; + unmap = 0; for (i = 0; i < req->num_be_args; i++) { - struct ctl_be_lun_option *opt; + if (strcmp(req->kern_be_args[i].kname, "unmap") == 0 && + strcmp(req->kern_be_args[i].kvalue, "on") == 0) { + unmap = 1; + } else { + struct ctl_be_lun_option *opt; - opt = malloc(sizeof(*opt), M_RAMDISK, M_WAITOK); - opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_RAMDISK, M_WAITOK); - strcpy(opt->name, req->kern_be_args[i].kname); - opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_RAMDISK, M_WAITOK); - strcpy(opt->value, req->kern_be_args[i].kvalue); - STAILQ_INSERT_TAIL(&be_lun->ctl_be_lun.options, opt, links); + opt = malloc(sizeof(*opt), M_RAMDISK, M_WAITOK); + opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_RAMDISK, M_WAITOK); + strcpy(opt->name, req->kern_be_args[i].kname); + opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_RAMDISK, M_WAITOK); + strcpy(opt->value, req->kern_be_args[i].kvalue); + STAILQ_INSERT_TAIL(&be_lun->ctl_be_lun.options, opt, links); + } } be_lun->flags = CTL_BE_RAMDISK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; + if (unmap) + be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP; be_lun->ctl_be_lun.be_lun = be_lun; if (params->flags & CTL_LUN_FLAG_ID_REQ) { @@ -882,6 +890,12 @@ ctl_backend_ramdisk_config_write(union c ctl_config_write_done(io); break; } + case WRITE_SAME_10: + case WRITE_SAME_16: + case UNMAP: + ctl_set_success(&io->scsiio); + ctl_config_write_done(io); + break; default: ctl_set_invalid_opcode(&io->scsiio); ctl_config_write_done(io); Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Thu May 8 06:56:59 2014 (r265633) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Thu May 8 07:00:45 2014 (r265634) @@ -331,10 +331,13 @@ struct ctl_cmd_entry ctl_cmd_table[] = {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 41 WRITE SAME(10) */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE}, -/* 42 READ SUB-CHANNEL */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +/* 42 READ SUB-CHANNEL / UNMAP */ +{ctl_unmap, CTL_SERIDX_UNMAP, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_WRITE}, /* 43 READ TOC/PMA/ATIP */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -623,7 +626,9 @@ struct ctl_cmd_entry ctl_cmd_table[] = {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 93 WRITE SAME(16) */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE}, /* 94 */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Thu May 8 06:56:59 2014 (r265633) +++ stable/10/sys/cam/ctl/ctl_io.h Thu May 8 07:00:45 2014 (r265634) @@ -134,6 +134,18 @@ struct ctl_lba_len { uint32_t len; }; +struct ctl_lba_len_flags { + uint64_t lba; + uint32_t len; + uint32_t flags; +}; + +struct ctl_ptr_len_flags { + uint8_t *ptr; + uint32_t len; + uint32_t flags; +}; + union ctl_priv { uint8_t bytes[sizeof(uint64_t) * 2]; uint64_t integer; Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu May 8 06:56:59 2014 (r265633) +++ stable/10/sys/cam/ctl/ctl_private.h Thu May 8 07:00:45 2014 (r265634) @@ -156,6 +156,7 @@ typedef enum { CTL_SERIDX_TUR = 0, CTL_SERIDX_READ, CTL_SERIDX_WRITE, + CTL_SERIDX_UNMAP, CTL_SERIDX_MD_SNS, CTL_SERIDX_MD_SEL, CTL_SERIDX_RQ_SNS, @@ -470,6 +471,8 @@ int ctl_start_stop(struct ctl_scsiio *ct int ctl_sync_cache(struct ctl_scsiio *ctsio); int ctl_format(struct ctl_scsiio *ctsio); int ctl_write_buffer(struct ctl_scsiio *ctsio); +int ctl_write_same(struct ctl_scsiio *ctsio); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 07:01:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B8E6449D; Thu, 8 May 2014 07: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 A5AF975F; Thu, 8 May 2014 07: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 s4871sNI049408; Thu, 8 May 2014 07:01:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4871sLv049407; Thu, 8 May 2014 07:01:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080701.s4871sLv049407@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 07:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265635 - stable/10/sys/cam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:01:54 -0000 Author: mav Date: Thu May 8 07:01:54 2014 New Revision: 265635 URL: http://svnweb.freebsd.org/changeset/base/265635 Log: MFC r264406: Report more readable state "-" for idle CAM scan thread. Modified: stable/10/sys/cam/cam_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Thu May 8 07:00:45 2014 (r265634) +++ stable/10/sys/cam/cam_xpt.c Thu May 8 07:01:54 2014 (r265635) @@ -768,7 +768,7 @@ xpt_scanner_thread(void *dummy) for (;;) { if (TAILQ_EMPTY(&xsoftc.ccb_scanq)) msleep(&xsoftc.ccb_scanq, &xsoftc.xpt_topo_lock, PRIBIO, - "ccb_scanq", 0); + "-", 0); if ((ccb = (union ccb *)TAILQ_FIRST(&xsoftc.ccb_scanq)) != NULL) { TAILQ_REMOVE(&xsoftc.ccb_scanq, &ccb->ccb_h, sim_links.tqe); xpt_unlock_buses(); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 07:04:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E1A7C716; Thu, 8 May 2014 07:04: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 CDF05775; Thu, 8 May 2014 07:04: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 s4874DGF049846; Thu, 8 May 2014 07:04:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4874DN2049845; Thu, 8 May 2014 07:04:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080704.s4874DN2049845@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 07:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265637 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:04:14 -0000 Author: mav Date: Thu May 8 07:04:13 2014 New Revision: 265637 URL: http://svnweb.freebsd.org/changeset/base/265637 Log: MFC r264407: Join CTL worker threads into one process for convenience. Report their idle state as "-". Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu May 8 07:02:46 2014 (r265636) +++ stable/10/sys/cam/ctl/ctl.c Thu May 8 07:04:13 2014 (r265637) @@ -1112,8 +1112,8 @@ ctl_init(void) } for (i = 0; i < worker_threads; i++) { - error = kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, - "ctl_thrd%d", i); + error = kproc_kthread_add(ctl_work_thread, softc, + &softc->work_thread, NULL, 0, 0, "ctl", "work%d", i); if (error != 0) { printf("error creating CTL work thread!\n"); mtx_lock(&softc->ctl_lock); @@ -13380,7 +13380,7 @@ ctl_work_thread(void *arg) /* XXX KDM use the PDROP flag?? */ /* Sleep until we have something to do. */ - mtx_sleep(softc, &softc->ctl_lock, PRIBIO, "ctl_work", 0); + mtx_sleep(softc, &softc->ctl_lock, PRIBIO, "-", 0); /* Back to the top of the loop to see what woke us up. */ continue; From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 07:05:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D9FD8844; Thu, 8 May 2014 07:05: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 AD46077D; Thu, 8 May 2014 07:05: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 s4875Jri050082; Thu, 8 May 2014 07:05:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4875J7J050081; Thu, 8 May 2014 07:05:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080705.s4875J7J050081@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 07:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265638 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:05:20 -0000 Author: mav Date: Thu May 8 07:05:19 2014 New Revision: 265638 URL: http://svnweb.freebsd.org/changeset/base/265638 Log: MFC r264834: Disable UNMAP support for STEC 842 SSDs. In some unknown cases UNMAP commands make device firmware stuck. Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Thu May 8 07:04:13 2014 (r265637) +++ stable/10/sys/cam/scsi/scsi_da.c Thu May 8 07:05:19 2014 (r265638) @@ -99,7 +99,8 @@ typedef enum { DA_Q_NO_6_BYTE = 0x02, DA_Q_NO_PREVENT = 0x04, DA_Q_4K = 0x08, - DA_Q_NO_RC16 = 0x10 + DA_Q_NO_RC16 = 0x10, + DA_Q_NO_UNMAP = 0x20 } da_quirks; #define DA_Q_BIT_STRING \ @@ -349,6 +350,13 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_FIXED, "COMPAQ", "RAID*", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, + { + /* + * The STEC 842 sometimes hang on UNMAP. + */ + {T_DIRECT, SIP_MEDIA_FIXED, "STEC", "S842E800M2", "*"}, + /*quirks*/ DA_Q_NO_UNMAP + }, /* USB mass storage devices supported by umass(4) */ { /* @@ -3205,7 +3213,7 @@ dadone(struct cam_periph *periph, union /* Ensure re-probe doesn't see old delete. */ softc->delete_available = 0; - if (lbp) { + if (lbp && (softc->quirks & DA_Q_NO_UNMAP) == 0) { /* * Based on older SBC-3 spec revisions * any of the UNMAP methods "may" be @@ -3404,7 +3412,8 @@ dadone(struct cam_periph *periph, union if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { for (i = 0; i < sizeof(*ata_params) / 2; i++) ptr[i] = le16toh(ptr[i]); - if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM) { + if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM && + (softc->quirks & DA_Q_NO_UNMAP) == 0) { dadeleteflag(softc, DA_DELETE_ATA_TRIM, 1); if (ata_params->max_dsm_blocks != 0) softc->trim_max_ranges = min( From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 07:07:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 24546AD7; Thu, 8 May 2014 07:07: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 102CC7A9; Thu, 8 May 2014 07:07: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 s4877pfq050527; Thu, 8 May 2014 07:07:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4877pQM050526; Thu, 8 May 2014 07:07:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080707.s4877pQM050526@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 07:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265640 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:07:52 -0000 Author: mav Date: Thu May 8 07:07:51 2014 New Revision: 265640 URL: http://svnweb.freebsd.org/changeset/base/265640 Log: MFC r264880 (by trasz): Modify CTL iSCSI frontend to properly handle situations where datamove routine is called multiple times per SCSI task. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu May 8 07:06:15 2014 (r265639) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu May 8 07:07:51 2014 (r265640) @@ -709,7 +709,7 @@ cfiscsi_handle_data_segment(struct icl_p ("bad opcode 0x%x", request->ip_bhs->bhs_opcode)); /* - * We're only using fields common for Data Out and SCSI Command PDUs. + * We're only using fields common for Data-Out and SCSI Command PDUs. */ bhsdo = (struct iscsi_bhs_data_out *)request->ip_bhs; @@ -742,10 +742,13 @@ cfiscsi_handle_data_segment(struct icl_p * Make sure the offset, as sent by the initiator, matches the offset * we're supposed to be at in the scatter-gather list. */ - if (buffer_offset != io->scsiio.ext_data_filled) { + if (buffer_offset != + io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled) { CFISCSI_SESSION_WARN(cs, "received bad buffer offset %zd, " - "expected %zd", buffer_offset, + "expected %zd; dropping connection", buffer_offset, + (size_t)io->scsiio.kern_rel_offset + (size_t)io->scsiio.ext_data_filled); + ctl_set_data_phase_error(&io->scsiio); cfiscsi_session_terminate(cs); return (true); } @@ -804,40 +807,62 @@ cfiscsi_handle_data_segment(struct icl_p } if (len > off) { + /* + * In case of unsolicited data, it's possible that the buffer + * provided by CTL is smaller than negotiated FirstBurstLength. + * Just ignore the superfluous data; will ask for them with R2T + * on next call to cfiscsi_datamove(). + * + * This obviously can only happen with SCSI Command PDU. + */ + if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == + ISCSI_BHS_OPCODE_SCSI_COMMAND) { + CFISCSI_SESSION_DEBUG(cs, "received too much immediate " + "data: got %zd bytes, expected %zd", + icl_pdu_data_segment_length(request), off); + return (true); + } + CFISCSI_SESSION_WARN(cs, "received too much data: got %zd bytes, " - "expected %zd", icl_pdu_data_segment_length(request), off); + "expected %zd; dropping connection", + icl_pdu_data_segment_length(request), off); + ctl_set_data_phase_error(&io->scsiio); cfiscsi_session_terminate(cs); return (true); } - if (bhsdo->bhsdo_flags & BHSDO_FLAGS_F || - io->scsiio.ext_data_filled == io->scsiio.kern_total_len) { - if ((bhsdo->bhsdo_flags & BHSDO_FLAGS_F) == 0) { - CFISCSI_SESSION_WARN(cs, "got the final packet without " - "the F flag; flags = 0x%x; dropping connection", - bhsdo->bhsdo_flags); + if (io->scsiio.ext_data_filled == io->scsiio.kern_data_len && + (bhsdo->bhsdo_flags & BHSDO_FLAGS_F) == 0) { + CFISCSI_SESSION_WARN(cs, "got the final packet without " + "the F flag; flags = 0x%x; dropping connection", + bhsdo->bhsdo_flags); + ctl_set_data_phase_error(&io->scsiio); + cfiscsi_session_terminate(cs); + return (true); + } + + if (io->scsiio.ext_data_filled != io->scsiio.kern_data_len && + (bhsdo->bhsdo_flags & BHSDO_FLAGS_F) != 0) { + if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == + ISCSI_BHS_OPCODE_SCSI_DATA_OUT) { + CFISCSI_SESSION_WARN(cs, "got the final packet, but the " + "transmitted size was %zd bytes instead of %d; " + "dropping connection", + (size_t)io->scsiio.ext_data_filled, + io->scsiio.kern_data_len); + ctl_set_data_phase_error(&io->scsiio); cfiscsi_session_terminate(cs); return (true); + } else { + /* + * For SCSI Command PDU, this just means we need to + * solicit more data by sending R2T. + */ + return (false); } + } - if (io->scsiio.ext_data_filled != io->scsiio.kern_total_len) { - if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == - ISCSI_BHS_OPCODE_SCSI_DATA_OUT) { - CFISCSI_SESSION_WARN(cs, "got the final packet, but the " - "transmitted size was %zd bytes instead of %d; " - "dropping connection", - (size_t)io->scsiio.ext_data_filled, - io->scsiio.kern_total_len); - cfiscsi_session_terminate(cs); - return (true); - } else { - /* - * For SCSI Command PDU, this just means we need to - * solicit more data by sending R2T. - */ - return (false); - } - } + if (io->scsiio.ext_data_filled == io->scsiio.kern_data_len) { #if 0 CFISCSI_SESSION_DEBUG(cs, "no longer expecting Data-Out with target " "transfer tag 0x%x", cdw->cdw_target_transfer_tag); @@ -2390,8 +2415,7 @@ cfiscsi_datamove_in(union ctl_io *io) /* * This is the offset within the current SCSI command; for the first * call to cfiscsi_datamove() it will be 0, and for subsequent ones - * it will be the sum of lengths of previous ones. It's being - * incremented as we append data to the data segment. + * it will be the sum of lengths of previous ones. */ buffer_offset = io->scsiio.kern_rel_offset; @@ -2402,10 +2426,11 @@ cfiscsi_datamove_in(union ctl_io *io) */ expected_len = ntohl(bhssc->bhssc_expected_data_transfer_length); #if 0 - if (expected_len != io->scsiio.kern_total_len) - CFISCSI_SESSION_DEBUG(cs, "expected transfer length = %zd, " - "actual length = %zd", expected_len, - io->scsiio.kern_total_len); + if (expected_len != io->scsiio.kern_total_len) { + CFISCSI_SESSION_DEBUG(cs, "expected transfer length %zd, " + "actual length %zd", expected_len, + (size_t)io->scsiio.kern_total_len); + } #endif if (buffer_offset >= expected_len) { @@ -2413,7 +2438,6 @@ cfiscsi_datamove_in(union ctl_io *io) CFISCSI_SESSION_DEBUG(cs, "buffer_offset = %zd, " "already sent the expected len", buffer_offset); #endif - io->scsiio.ext_data_filled = io->scsiio.kern_total_len; io->scsiio.be_move_done(io); return; } @@ -2456,26 +2480,31 @@ cfiscsi_datamove_in(union ctl_io *io) * Truncate to maximum data segment length. */ KASSERT(response->ip_data_len < cs->cs_max_data_segment_length, - ("max_data_segment_length %zd >= ip_data_len %zd", + ("ip_data_len %zd >= max_data_segment_length %zd", response->ip_data_len, cs->cs_max_data_segment_length)); if (response->ip_data_len + len > - cs->cs_max_data_segment_length) + cs->cs_max_data_segment_length) { len = cs->cs_max_data_segment_length - response->ip_data_len; + KASSERT(len <= sg_len, ("len %zd > sg_len %zd", + len, sg_len)); + } /* * Truncate to expected data transfer length. */ KASSERT(buffer_offset + response->ip_data_len < expected_len, - ("%zd >= %zd", buffer_offset + response->ip_data_len, expected_len)); + ("buffer_offset %zd + ip_data_len %zd >= expected_len %zd", + buffer_offset, response->ip_data_len, expected_len)); if (buffer_offset + response->ip_data_len + len > expected_len) { CFISCSI_SESSION_DEBUG(cs, "truncating from %zd " "to expected data transfer length %zd", buffer_offset + response->ip_data_len + len, expected_len); len = expected_len - (buffer_offset + response->ip_data_len); + KASSERT(len <= sg_len, ("len %zd > sg_len %zd", + len, sg_len)); } - KASSERT(len <= sg_len, ("len > sg_len")); error = icl_pdu_append_data(response, sg_addr, len, M_NOWAIT); if (error != 0) { CFISCSI_SESSION_WARN(cs, "failed to " @@ -2488,10 +2517,11 @@ cfiscsi_datamove_in(union ctl_io *io) } sg_addr += len; sg_len -= len; - buffer_offset += len; - io->scsiio.ext_data_filled += len; - if (buffer_offset == expected_len) { + KASSERT(buffer_offset + request->ip_data_len <= expected_len, + ("buffer_offset %zd + ip_data_len %zd > expected_len %zd", + buffer_offset, request->ip_data_len, expected_len)); + if (buffer_offset + request->ip_data_len == expected_len) { /* * Already have the amount of data the initiator wanted. */ @@ -2521,6 +2551,7 @@ cfiscsi_datamove_in(union ctl_io *io) * call to cfiscsi_datamove(), and we want * to set the F flag only on the last of them. */ + buffer_offset += response->ip_data_len; if (buffer_offset == io->scsiio.kern_total_len || buffer_offset == expected_len) bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; @@ -2530,6 +2561,7 @@ cfiscsi_datamove_in(union ctl_io *io) } } if (response != NULL) { + buffer_offset += response->ip_data_len; if (buffer_offset == io->scsiio.kern_total_len || buffer_offset == expected_len) bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; @@ -2565,6 +2597,11 @@ cfiscsi_datamove_out(union ctl_io *io) */ PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; + /* + * We hadn't received anything during this datamove yet. + */ + io->scsiio.ext_data_filled = 0; + target_transfer_tag = atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1); @@ -2586,19 +2623,14 @@ cfiscsi_datamove_out(union ctl_io *io) cdw->cdw_target_transfer_tag = target_transfer_tag; cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; - if (cs->cs_immediate_data && icl_pdu_data_segment_length(request) > 0) { + if (cs->cs_immediate_data && io->scsiio.kern_rel_offset == 0 && + icl_pdu_data_segment_length(request) > 0) { done = cfiscsi_handle_data_segment(request, cdw); if (done) { uma_zfree(cfiscsi_data_wait_zone, cdw); io->scsiio.be_move_done(io); return; } - -#if 0 - if (io->scsiio.ext_data_filled != 0) - CFISCSI_SESSION_DEBUG(cs, "got %zd bytes of immediate data, need %zd", - io->scsiio.ext_data_filled, io->scsiio.kern_data_len); -#endif } CFISCSI_SESSION_LOCK(cs); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 07:08:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 45391C24; Thu, 8 May 2014 07:08: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 261FB7B3; Thu, 8 May 2014 07:08: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 s4878mNC050708; Thu, 8 May 2014 07:08:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4878mCj050707; Thu, 8 May 2014 07:08:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080708.s4878mCj050707@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 07:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265641 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:08:48 -0000 Author: mav Date: Thu May 8 07:08:47 2014 New Revision: 265641 URL: http://svnweb.freebsd.org/changeset/base/265641 Log: MFC r264884: Make CAM target CTL frontend respect SIM I/O size limitations. If datamove size is bigger then SIM can handle, or it has more segments then this code can handle -- split it into several CTIO requests. Modified: stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Thu May 8 07:07:51 2014 (r265640) +++ stable/10/sys/cam/ctl/scsi_ctl.c Thu May 8 07:08:47 2014 (r265641) @@ -79,6 +79,7 @@ typedef enum { struct ctlfe_softc { struct ctl_frontend fe; path_id_t path_id; + u_int maxio; struct cam_sim *sim; char port_name[DEV_IDLEN]; struct mtx lun_softc_mtx; @@ -129,13 +130,15 @@ typedef enum { */ struct ctlfe_lun_cmd_info { int cur_transfer_index; + size_t cur_transfer_off; ctlfe_cmd_flags flags; /* * XXX KDM struct bus_dma_segment is 8 bytes on i386, and 16 * bytes on amd64. So with 32 elements, this is 256 bytes on * i386 and 512 bytes on amd64. */ - bus_dma_segment_t cam_sglist[32]; +#define CTLFE_MAX_SEGS 32 + bus_dma_segment_t cam_sglist[CTLFE_MAX_SEGS]; }; /* @@ -375,6 +378,10 @@ ctlfeasync(void *callback_arg, uint32_t bus_softc->path_id = cpi->ccb_h.path_id; bus_softc->sim = xpt_path_sim(path); + if (cpi->maxio != 0) + bus_softc->maxio = cpi->maxio; + else + bus_softc->maxio = DFLTPHYS; mtx_init(&bus_softc->lun_softc_mtx, "LUN softc mtx", NULL, MTX_DEF); STAILQ_INIT(&bus_softc->lun_softc_list); @@ -693,6 +700,90 @@ ctlfecleanup(struct cam_periph *periph) } static void +ctlfedata(struct ctlfe_lun_softc *softc, union ctl_io *io, + ccb_flags *flags, uint8_t **data_ptr, uint32_t *dxfer_len, + u_int16_t *sglist_cnt) +{ + struct ctlfe_softc *bus_softc; + struct ctlfe_lun_cmd_info *cmd_info; + struct ctl_sg_entry *ctl_sglist; + bus_dma_segment_t *cam_sglist; + size_t off; + int i, idx; + + cmd_info = (struct ctlfe_lun_cmd_info *)io->io_hdr.port_priv; + bus_softc = softc->parent_softc; + + /* + * Set the direction, relative to the initiator. + */ + *flags &= ~CAM_DIR_MASK; + if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) + *flags |= CAM_DIR_IN; + else + *flags |= CAM_DIR_OUT; + + *flags &= ~CAM_DATA_MASK; + idx = cmd_info->cur_transfer_index; + off = cmd_info->cur_transfer_off; + cmd_info->flags &= ~CTLFE_CMD_PIECEWISE; + if (io->scsiio.kern_sg_entries == 0) { + /* No S/G list. */ + *data_ptr = io->scsiio.kern_data_ptr + off; + if (io->scsiio.kern_data_len - off <= bus_softc->maxio) { + *dxfer_len = io->scsiio.kern_data_len - off; + } else { + *dxfer_len = bus_softc->maxio; + cmd_info->cur_transfer_index = -1; + cmd_info->cur_transfer_off = bus_softc->maxio; + cmd_info->flags |= CTLFE_CMD_PIECEWISE; + } + *sglist_cnt = 0; + + if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) + *flags |= CAM_DATA_PADDR; + else + *flags |= CAM_DATA_VADDR; + } else { + /* S/G list with physical or virtual pointers. */ + ctl_sglist = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; + cam_sglist = cmd_info->cam_sglist; + *dxfer_len = 0; + for (i = 0; i < io->scsiio.kern_sg_entries - idx; i++) { + cam_sglist[i].ds_addr = (bus_addr_t)ctl_sglist[i + idx].addr + off; + if (ctl_sglist[i + idx].len - off <= bus_softc->maxio - *dxfer_len) { + cam_sglist[i].ds_len = ctl_sglist[idx + i].len - off; + *dxfer_len += cam_sglist[i].ds_len; + } else { + cam_sglist[i].ds_len = bus_softc->maxio - *dxfer_len; + cmd_info->cur_transfer_index = idx + i; + cmd_info->cur_transfer_off = cam_sglist[i].ds_len + off; + cmd_info->flags |= CTLFE_CMD_PIECEWISE; + *dxfer_len += cam_sglist[i].ds_len; + if (ctl_sglist[i].len != 0) + i++; + break; + } + if (i == (CTLFE_MAX_SEGS - 1) && + idx + i < (io->scsiio.kern_sg_entries - 1)) { + cmd_info->cur_transfer_index = idx + i + 1; + cmd_info->cur_transfer_off = 0; + cmd_info->flags |= CTLFE_CMD_PIECEWISE; + i++; + break; + } + off = 0; + } + *sglist_cnt = i; + if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) + *flags |= CAM_DATA_SG_PADDR; + else + *flags |= CAM_DATA_SG; + *data_ptr = (uint8_t *)cam_sglist; + } +} + +static void ctlfestart(struct cam_periph *periph, union ccb *start_ccb) { struct ctlfe_lun_softc *softc; @@ -854,84 +945,10 @@ ctlfestart(struct cam_periph *periph, un bzero(cmd_info, sizeof(*cmd_info)); scsi_status = 0; - /* - * Set the direction, relative to the initiator. - */ - flags &= ~CAM_DIR_MASK; - if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == - CTL_FLAG_DATA_IN) - flags |= CAM_DIR_IN; - else - flags |= CAM_DIR_OUT; - csio->cdb_len = atio->cdb_len; - flags &= ~CAM_DATA_MASK; - if (io->scsiio.kern_sg_entries == 0) { - /* No S/G list */ - data_ptr = io->scsiio.kern_data_ptr; - dxfer_len = io->scsiio.kern_data_len; - csio->sglist_cnt = 0; - - if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) - flags |= CAM_DATA_PADDR; - else - flags |= CAM_DATA_VADDR; - } else if (io->scsiio.kern_sg_entries <= - (sizeof(cmd_info->cam_sglist)/ - sizeof(cmd_info->cam_sglist[0]))) { - /* - * S/G list with physical or virtual pointers. - * Just populate the CAM S/G list with the - * pointers. - */ - int i; - struct ctl_sg_entry *ctl_sglist; - bus_dma_segment_t *cam_sglist; - - ctl_sglist = (struct ctl_sg_entry *) - io->scsiio.kern_data_ptr; - cam_sglist = cmd_info->cam_sglist; - - for (i = 0; i < io->scsiio.kern_sg_entries;i++){ - cam_sglist[i].ds_addr = - (bus_addr_t)ctl_sglist[i].addr; - cam_sglist[i].ds_len = - ctl_sglist[i].len; - } - csio->sglist_cnt = io->scsiio.kern_sg_entries; - if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) - flags |= CAM_DATA_SG_PADDR; - else - flags |= CAM_DATA_SG; - data_ptr = (uint8_t *)cam_sglist; - dxfer_len = io->scsiio.kern_data_len; - } else { - /* S/G list with virtual pointers */ - struct ctl_sg_entry *sglist; - int *ti; - - /* - * If we have more S/G list pointers than - * will fit in the available storage in the - * cmd_info structure inside the ctl_io header, - * then we need to send down the pointers - * one element at a time. - */ - - sglist = (struct ctl_sg_entry *) - io->scsiio.kern_data_ptr; - ti = &cmd_info->cur_transfer_index; - data_ptr = sglist[*ti].addr; - dxfer_len = sglist[*ti].len; - csio->sglist_cnt = 0; - if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) - flags |= CAM_DATA_PADDR; - else - flags |= CAM_DATA_VADDR; - cmd_info->flags |= CTLFE_CMD_PIECEWISE; - (*ti)++; - } + ctlfedata(softc, io, &flags, &data_ptr, &dxfer_len, + &csio->sglist_cnt); io->scsiio.ext_data_filled += dxfer_len; @@ -1416,37 +1433,18 @@ ctlfedone(struct cam_periph *periph, uni * continue sending pieces if necessary. */ if ((cmd_info->flags & CTLFE_CMD_PIECEWISE) - && (io->io_hdr.port_status == 0) - && (cmd_info->cur_transfer_index < - io->scsiio.kern_sg_entries)) { - struct ctl_sg_entry *sglist; + && (io->io_hdr.port_status == 0)) { ccb_flags flags; uint8_t scsi_status; uint8_t *data_ptr; uint32_t dxfer_len; - int *ti; - sglist = (struct ctl_sg_entry *) - io->scsiio.kern_data_ptr; - ti = &cmd_info->cur_transfer_index; flags = atio->ccb_h.flags & (CAM_DIS_DISCONNECT| - CAM_TAG_ACTION_VALID| - CAM_DIR_MASK); - - /* - * Set the direction, relative to the initiator. - */ - flags &= ~CAM_DIR_MASK; - if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == - CTL_FLAG_DATA_IN) - flags |= CAM_DIR_IN; - else - flags |= CAM_DIR_OUT; + CAM_TAG_ACTION_VALID); - data_ptr = sglist[*ti].addr; - dxfer_len = sglist[*ti].len; - (*ti)++; + ctlfedata(softc, io, &flags, &data_ptr, + &dxfer_len, &csio->sglist_cnt); scsi_status = 0; From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 07:10:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3F77AD6B; Thu, 8 May 2014 07:10: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 2183F828; Thu, 8 May 2014 07:10: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 s487AdFO053545; Thu, 8 May 2014 07:10:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s487Acrw053540; Thu, 8 May 2014 07:10:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080710.s487Acrw053540@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 07:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265642 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:10:39 -0000 Author: mav Date: Thu May 8 07:10:38 2014 New Revision: 265642 URL: http://svnweb.freebsd.org/changeset/base/265642 Log: MFC r264886: Remove limits on size of READ/WRITE operations. Instead of allocating up to 16MB or RAM at once to handle whole I/O, allocate up to 1MB at a time, but do multiple ctl_datamove() and storage I/Os if needed. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu May 8 07:08:47 2014 (r265641) +++ stable/10/sys/cam/ctl/ctl.c Thu May 8 07:10:38 2014 (r265642) @@ -9534,7 +9534,7 @@ ctl_inquiry_evpd_block_limits(struct ctl bl_ptr->page_code = SVPD_BLOCK_LIMITS; scsi_ulto2b(sizeof(*bl_ptr), bl_ptr->page_length); - scsi_ulto4b((16 * 1024 * 1024) / bs, bl_ptr->max_txfer_len); + scsi_ulto4b(0xffffffff, bl_ptr->max_txfer_len); scsi_ulto4b(MAXPHYS / bs, bl_ptr->opt_txfer_len); if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Thu May 8 07:08:47 2014 (r265641) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Thu May 8 07:10:38 2014 (r265642) @@ -91,11 +91,12 @@ __FBSDID("$FreeBSD$"); #include /* - * The idea here is that we'll allocate enough S/G space to hold a 16MB - * I/O. If we get an I/O larger than that, we'll reject it. + * The idea here is that we'll allocate enough S/G space to hold a 1MB + * I/O. If we get an I/O larger than that, we'll split it. */ -#define CTLBLK_MAX_IO_SIZE (16 * 1024 * 1024) -#define CTLBLK_MAX_SEGS (CTLBLK_MAX_IO_SIZE / MAXPHYS) + 1 +#define CTLBLK_MAX_IO_SIZE (1024 * 1024) +#define CTLBLK_MAX_SEG MAXPHYS +#define CTLBLK_MAX_SEGS MAX(CTLBLK_MAX_IO_SIZE / CTLBLK_MAX_SEG, 1) #ifdef CTLBLK_DEBUG #define DPRINTF(fmt, args...) \ @@ -500,14 +501,6 @@ ctl_be_block_biodone(struct bio *bio) ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { - io->scsiio.be_move_done = ctl_be_block_move_done; - io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; - io->scsiio.kern_data_len = beio->io_len; - io->scsiio.kern_total_len = beio->io_len; - io->scsiio.kern_rel_offset = 0; - io->scsiio.kern_data_resid = 0; - io->scsiio.kern_sg_entries = beio->num_segs; - io->io_hdr.flags |= CTL_FLAG_ALLOCATED | CTL_FLAG_KDPTR_SGLIST; #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -707,14 +700,6 @@ ctl_be_block_dispatch_file(struct ctl_be ctl_complete_beio(beio); } else { SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0); - io->scsiio.be_move_done = ctl_be_block_move_done; - io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; - io->scsiio.kern_data_len = beio->io_len; - io->scsiio.kern_total_len = beio->io_len; - io->scsiio.kern_rel_offset = 0; - io->scsiio.kern_data_resid = 0; - io->scsiio.kern_sg_entries = beio->num_segs; - io->io_hdr.flags |= CTL_FLAG_ALLOCATED | CTL_FLAG_KDPTR_SGLIST; #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -1014,7 +999,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b /* * Setup the S/G entry for this chunk. */ - seglen = MIN(MAXPHYS, len_left); + seglen = MIN(CTLBLK_MAX_SEG, len_left); seglen -= seglen % be_lun->blocksize; beio->sg_segs[i].len = seglen; beio->sg_segs[i].addr = uma_zalloc(be_lun->lun_zone, M_WAITOK); @@ -1167,13 +1152,44 @@ SDT_PROBE_DEFINE1(cbb, kernel, read, all SDT_PROBE_DEFINE1(cbb, kernel, write, alloc_done, "uint64_t"); static void +ctl_be_block_next(struct ctl_be_block_io *beio) +{ + struct ctl_be_block_lun *be_lun; + union ctl_io *io; + + io = beio->io; + be_lun = beio->lun; + ctl_free_beio(beio); + if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) + && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { + ctl_done(io); + return; + } + + io->scsiio.kern_rel_offset += io->scsiio.kern_data_len; + io->io_hdr.status &= ~CTL_STATUS_MASK; + io->io_hdr.status |= CTL_STATUS_NONE; + + mtx_lock(&be_lun->lock); + /* + * XXX KDM make sure that links is okay to use at this point. + * Otherwise, we either need to add another field to ctl_io_hdr, + * or deal with resource allocation here. + */ + STAILQ_INSERT_TAIL(&be_lun->input_queue, &io->io_hdr, links); + mtx_unlock(&be_lun->lock); + + taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task); +} + +static void ctl_be_block_dispatch(struct ctl_be_block_lun *be_lun, union ctl_io *io) { struct ctl_be_block_io *beio; struct ctl_be_block_softc *softc; struct ctl_lba_len lbalen; - uint64_t len_left, io_size_bytes; + uint64_t len_left, lbaoff; int i; softc = be_lun->softc; @@ -1186,29 +1202,6 @@ ctl_be_block_dispatch(struct ctl_be_bloc SDT_PROBE(cbb, kernel, write, start, 0, 0, 0, 0, 0); } - memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(lbalen)); - - io_size_bytes = lbalen.len * be_lun->blocksize; - - /* - * XXX KDM this is temporary, until we implement chaining of beio - * structures and multiple datamove calls to move all the data in - * or out. - */ - if (io_size_bytes > CTLBLK_MAX_IO_SIZE) { - printf("%s: IO length %ju > max io size %u\n", __func__, - io_size_bytes, CTLBLK_MAX_IO_SIZE); - ctl_set_invalid_field(&io->scsiio, - /*sks_valid*/ 0, - /*command*/ 1, - /*field*/ 0, - /*bit_valid*/ 0, - /*bit*/ 0); - ctl_done(io); - return; - } - beio = ctl_alloc_beio(softc); beio->io = io; beio->lun = be_lun; @@ -1255,20 +1248,25 @@ ctl_be_block_dispatch(struct ctl_be_bloc beio->ds_trans_type = DEVSTAT_WRITE; } - beio->io_len = lbalen.len * be_lun->blocksize; - beio->io_offset = lbalen.lba * be_lun->blocksize; - - DPRINTF("%s at LBA %jx len %u\n", + memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + sizeof(lbalen)); + DPRINTF("%s at LBA %jx len %u @%ju\n", (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", - (uintmax_t)lbalen.lba, lbalen.len); - - for (i = 0, len_left = io_size_bytes; i < CTLBLK_MAX_SEGS && - len_left > 0; i++) { + (uintmax_t)lbalen.lba, lbalen.len, lbaoff); + lbaoff = io->scsiio.kern_rel_offset / be_lun->blocksize; + beio->io_offset = (lbalen.lba + lbaoff) * be_lun->blocksize; + beio->io_len = MIN((lbalen.len - lbaoff) * be_lun->blocksize, + CTLBLK_MAX_IO_SIZE); + beio->io_len -= beio->io_len % be_lun->blocksize; + + for (i = 0, len_left = beio->io_len; len_left > 0; i++) { + KASSERT(i < CTLBLK_MAX_SEGS, ("Too many segs (%d >= %d)", + i, CTLBLK_MAX_SEGS)); /* * Setup the S/G entry for this chunk. */ - beio->sg_segs[i].len = min(MAXPHYS, len_left); + beio->sg_segs[i].len = min(CTLBLK_MAX_SEG, len_left); beio->sg_segs[i].addr = uma_zalloc(be_lun->lun_zone, M_WAITOK); DPRINTF("segment %d addr %p len %zd\n", i, @@ -1277,6 +1275,15 @@ ctl_be_block_dispatch(struct ctl_be_bloc beio->num_segs++; len_left -= beio->sg_segs[i].len; } + if (io->scsiio.kern_rel_offset + beio->io_len < + io->scsiio.kern_total_len) + beio->beio_cont = ctl_be_block_next; + io->scsiio.be_move_done = ctl_be_block_move_done; + io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; + io->scsiio.kern_data_len = beio->io_len; + io->scsiio.kern_data_resid = 0; + io->scsiio.kern_sg_entries = beio->num_segs; + io->io_hdr.flags |= CTL_FLAG_ALLOCATED | CTL_FLAG_KDPTR_SGLIST; /* * For the read case, we need to read the data into our buffers and @@ -1288,14 +1295,6 @@ ctl_be_block_dispatch(struct ctl_be_bloc be_lun->dispatch(be_lun, beio); } else { SDT_PROBE(cbb, kernel, write, alloc_done, 0, 0, 0, 0, 0); - io->scsiio.be_move_done = ctl_be_block_move_done; - io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; - io->scsiio.kern_data_len = beio->io_len; - io->scsiio.kern_total_len = beio->io_len; - io->scsiio.kern_rel_offset = 0; - io->scsiio.kern_data_resid = 0; - io->scsiio.kern_sg_entries = beio->num_segs; - io->io_hdr.flags |= CTL_FLAG_ALLOCATED | CTL_FLAG_KDPTR_SGLIST; #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -1386,6 +1385,7 @@ ctl_be_block_worker(void *context, int p static int ctl_be_block_submit(union ctl_io *io) { + struct ctl_lba_len lbalen; struct ctl_be_block_lun *be_lun; struct ctl_be_lun *ctl_be_lun; int retval; @@ -1404,6 +1404,11 @@ ctl_be_block_submit(union ctl_io *io) KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Non-SCSI I/O (type " "%#x) encountered", io->io_hdr.io_type)); + memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + sizeof(lbalen)); + io->scsiio.kern_total_len = lbalen.len * be_lun->blocksize; + io->scsiio.kern_rel_offset = 0; + mtx_lock(&be_lun->lock); /* * XXX KDM make sure that links is okay to use at this point. @@ -1840,7 +1845,7 @@ ctl_be_block_create(struct ctl_be_block_ sprintf(be_lun->lunname, "cblk%d", softc->num_luns); mtx_init(&be_lun->lock, be_lun->lunname, NULL, MTX_DEF); - be_lun->lun_zone = uma_zcreate(be_lun->lunname, MAXPHYS, + be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG, NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); if (be_lun->lun_zone == NULL) { Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu May 8 07:08:47 2014 (r265641) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Thu May 8 07:10:38 2014 (r265642) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -73,12 +74,17 @@ typedef enum { } ctl_be_ramdisk_lun_flags; struct ctl_be_ramdisk_lun { + char lunname[32]; uint64_t size_bytes; uint64_t size_blocks; struct ctl_be_ramdisk_softc *softc; ctl_be_ramdisk_lun_flags flags; STAILQ_ENTRY(ctl_be_ramdisk_lun) links; struct ctl_be_lun ctl_be_lun; + struct taskqueue *io_taskqueue; + struct task io_task; + STAILQ_HEAD(, ctl_io_hdr) cont_queue; + struct mtx lock; }; struct ctl_be_ramdisk_softc { @@ -100,6 +106,7 @@ int ctl_backend_ramdisk_init(void); void ctl_backend_ramdisk_shutdown(void); static int ctl_backend_ramdisk_move_done(union ctl_io *io); static int ctl_backend_ramdisk_submit(union ctl_io *io); +static void ctl_backend_ramdisk_continue(union ctl_io *io); static int ctl_backend_ramdisk_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); static int ctl_backend_ramdisk_rm(struct ctl_be_ramdisk_softc *softc, @@ -108,6 +115,7 @@ static int ctl_backend_ramdisk_create(st struct ctl_lun_req *req, int do_wait); static int ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, struct ctl_lun_req *req); +static void ctl_backend_ramdisk_worker(void *context, int pending); static void ctl_backend_ramdisk_lun_shutdown(void *be_lun); static void ctl_backend_ramdisk_lun_config_status(void *be_lun, ctl_lun_config_status status); @@ -145,7 +153,7 @@ ctl_backend_ramdisk_init(void) mtx_init(&softc->lock, "ramdisk", NULL, MTX_DEF); STAILQ_INIT(&softc->lun_list); - softc->rd_size = 4 * 1024 * 1024; + softc->rd_size = 1024 * 1024; #ifdef CTL_RAMDISK_PAGES softc->num_pages = softc->rd_size / PAGE_SIZE; softc->ramdisk_pages = (uint8_t **)malloc(sizeof(uint8_t *) * @@ -211,16 +219,39 @@ ctl_backend_ramdisk_shutdown(void) static int ctl_backend_ramdisk_move_done(union ctl_io *io) { + struct ctl_be_lun *ctl_be_lun; + struct ctl_be_ramdisk_lun *be_lun; #ifdef CTL_TIME_IO struct bintime cur_bt; #endif CTL_DEBUG_PRINT(("ctl_backend_ramdisk_move_done\n")); + ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ + CTL_PRIV_BACKEND_LUN].ptr; + be_lun = (struct ctl_be_ramdisk_lun *)ctl_be_lun->be_lun; +#ifdef CTL_TIME_IO + getbintime(&cur_bt); + bintime_sub(&cur_bt, &io->io_hdr.dma_start_bt); + bintime_add(&io->io_hdr.dma_bt, &cur_bt); + io->io_hdr.num_dmas++; +#endif + if (io->scsiio.kern_sg_entries > 0) + free(io->scsiio.kern_data_ptr, M_RAMDISK); + io->scsiio.kern_rel_offset += io->scsiio.kern_data_len; if ((io->io_hdr.port_status == 0) && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) + && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { + if (io->scsiio.kern_rel_offset < io->scsiio.kern_total_len) { + mtx_lock(&be_lun->lock); + STAILQ_INSERT_TAIL(&be_lun->cont_queue, + &io->io_hdr, links); + mtx_unlock(&be_lun->lock); + taskqueue_enqueue(be_lun->io_taskqueue, + &be_lun->io_task); + return (0); + } io->io_hdr.status = CTL_SUCCESS; - else if ((io->io_hdr.port_status != 0) + } else if ((io->io_hdr.port_status != 0) && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)){ /* @@ -236,15 +267,6 @@ ctl_backend_ramdisk_move_done(union ctl_ /*retry_count*/ io->io_hdr.port_status); } -#ifdef CTL_TIME_IO - getbintime(&cur_bt); - bintime_sub(&cur_bt, &io->io_hdr.dma_start_bt); - bintime_add(&io->io_hdr.dma_bt, &cur_bt); - io->io_hdr.num_dmas++; -#endif - - if (io->scsiio.kern_sg_entries > 0) - free(io->scsiio.kern_data_ptr, M_RAMDISK); ctl_done(io); return(0); } @@ -253,93 +275,100 @@ static int ctl_backend_ramdisk_submit(union ctl_io *io) { struct ctl_lba_len lbalen; -#ifdef CTL_RAMDISK_PAGES - struct ctl_sg_entry *sg_entries; - int len_filled; - int i; -#endif - int num_sg_entries, len; - struct ctl_be_ramdisk_softc *softc; struct ctl_be_lun *ctl_be_lun; - struct ctl_be_ramdisk_lun *be_lun; - softc = &rd_softc; - ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ CTL_PRIV_BACKEND_LUN].ptr; - be_lun = (struct ctl_be_ramdisk_lun *)ctl_be_lun->be_lun; memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, sizeof(lbalen)); + io->scsiio.be_move_done = ctl_backend_ramdisk_move_done; + io->scsiio.kern_total_len = lbalen.len * ctl_be_lun->blocksize; + io->scsiio.kern_rel_offset = 0; + io->scsiio.kern_data_resid = 0; + ctl_backend_ramdisk_continue(io); - len = lbalen.len * ctl_be_lun->blocksize; - - /* - * Kick out the request if it's bigger than we can handle. - */ - if (len > softc->rd_size) { - ctl_set_internal_failure(&io->scsiio, - /*sks_valid*/ 0, - /*retry_count*/ 0); - ctl_done(io); - return (CTL_RETVAL_COMPLETE); - } - - /* - * Kick out the request if it's larger than the device size that - * the user requested. - */ - if (((lbalen.lba * ctl_be_lun->blocksize) + len) > be_lun->size_bytes) { - ctl_set_lba_out_of_range(&io->scsiio); - ctl_done(io); - return (CTL_RETVAL_COMPLETE); - } + return (CTL_RETVAL_COMPLETE); +} +static void +ctl_backend_ramdisk_continue(union ctl_io *io) +{ + struct ctl_be_ramdisk_softc *softc; + int len, len_filled, sg_filled; #ifdef CTL_RAMDISK_PAGES - num_sg_entries = len >> PAGE_SHIFT; - if ((len & (PAGE_SIZE - 1)) != 0) - num_sg_entries++; + struct ctl_sg_entry *sg_entries; + int i; +#endif - if (num_sg_entries > 1) { + softc = &rd_softc; + len = io->scsiio.kern_total_len - io->scsiio.kern_rel_offset; +#ifdef CTL_RAMDISK_PAGES + sg_filled = min(btoc(len), softc->num_pages); + if (sg_filled > 1) { io->scsiio.kern_data_ptr = malloc(sizeof(struct ctl_sg_entry) * - num_sg_entries, M_RAMDISK, + sg_filled, M_RAMDISK, M_WAITOK); sg_entries = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; - for (i = 0, len_filled = 0; i < num_sg_entries; - i++, len_filled += PAGE_SIZE) { + for (i = 0, len_filled = 0; i < sg_filled; i++) { sg_entries[i].addr = softc->ramdisk_pages[i]; sg_entries[i].len = ctl_min(PAGE_SIZE, len - len_filled); + len_filled += sg_entries[i].len; } + io->io_hdr.flags |= CTL_FLAG_KDPTR_SGLIST; } else { -#endif /* CTL_RAMDISK_PAGES */ - /* - * If this is less than 1 page, don't bother allocating a - * scatter/gather list for it. This saves time/overhead. - */ - num_sg_entries = 0; -#ifdef CTL_RAMDISK_PAGES + sg_filled = 0; + len_filled = len; io->scsiio.kern_data_ptr = softc->ramdisk_pages[0]; -#else - io->scsiio.kern_data_ptr = softc->ramdisk_buffer; -#endif -#ifdef CTL_RAMDISK_PAGES } -#endif +#else + sg_filled = 0; + len_filled = min(len, softc->rd_size); + io->scsiio.kern_data_ptr = softc->ramdisk_buffer; +#endif /* CTL_RAMDISK_PAGES */ - io->scsiio.be_move_done = ctl_backend_ramdisk_move_done; - io->scsiio.kern_data_len = len; - io->scsiio.kern_total_len = len; - io->scsiio.kern_rel_offset = 0; - io->scsiio.kern_data_resid = 0; - io->scsiio.kern_sg_entries = num_sg_entries; - io->io_hdr.flags |= CTL_FLAG_ALLOCATED | CTL_FLAG_KDPTR_SGLIST; + io->scsiio.kern_data_len = len_filled; + io->scsiio.kern_sg_entries = sg_filled; + io->io_hdr.flags |= CTL_FLAG_ALLOCATED; #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif ctl_datamove(io); +} - return (CTL_RETVAL_COMPLETE); +static void +ctl_backend_ramdisk_worker(void *context, int pending) +{ + struct ctl_be_ramdisk_softc *softc; + struct ctl_be_ramdisk_lun *be_lun; + union ctl_io *io; + + be_lun = (struct ctl_be_ramdisk_lun *)context; + softc = be_lun->softc; + + mtx_lock(&be_lun->lock); + for (;;) { + io = (union ctl_io *)STAILQ_FIRST(&be_lun->cont_queue); + if (io != NULL) { + STAILQ_REMOVE(&be_lun->cont_queue, &io->io_hdr, + ctl_io_hdr, links); + + mtx_unlock(&be_lun->lock); + + ctl_backend_ramdisk_continue(io); + + mtx_lock(&be_lun->lock); + continue; + } + + /* + * If we get here, there is no work left in the queues, so + * just break out and let the task queue go to sleep. + */ + break; + } + mtx_unlock(&be_lun->lock); } static int @@ -470,8 +499,12 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram mtx_unlock(&softc->lock); - if (retval == 0) + if (retval == 0) { + taskqueue_drain(be_lun->io_taskqueue, &be_lun->io_task); + taskqueue_free(be_lun->io_taskqueue); + mtx_destroy(&be_lun->lock); free(be_lun, M_RAMDISK); + } req->status = CTL_LUN_OK; @@ -509,6 +542,7 @@ ctl_backend_ramdisk_create(struct ctl_be sizeof(*be_lun)); goto bailout_error; } + sprintf(be_lun->lunname, "cram%d", softc->num_luns); STAILQ_INIT(&be_lun->ctl_be_lun.options); if (params->flags & CTL_LUN_FLAG_DEV_TYPE) @@ -611,6 +645,27 @@ ctl_backend_ramdisk_create(struct ctl_be sizeof(params->device_id))); } + STAILQ_INIT(&be_lun->cont_queue); + mtx_init(&be_lun->lock, "CTL ramdisk", NULL, MTX_DEF); + TASK_INIT(&be_lun->io_task, /*priority*/0, ctl_backend_ramdisk_worker, + be_lun); + + be_lun->io_taskqueue = taskqueue_create(be_lun->lunname, M_WAITOK, + taskqueue_thread_enqueue, /*context*/&be_lun->io_taskqueue); + if (be_lun->io_taskqueue == NULL) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: Unable to create taskqueue", __func__); + goto bailout_error; + } + + retval = taskqueue_start_threads(&be_lun->io_taskqueue, + /*num threads*/1, + /*priority*/PWAIT, + /*thread name*/ + "%s taskq", be_lun->lunname); + if (retval != 0) + goto bailout_error; + mtx_lock(&softc->lock); softc->num_luns++; STAILQ_INSERT_TAIL(&softc->lun_list, be_lun, links); @@ -669,7 +724,13 @@ ctl_backend_ramdisk_create(struct ctl_be bailout_error: req->status = CTL_LUN_ERROR; - free(be_lun, M_RAMDISK); + if (be_lun != NULL) { + if (be_lun->io_taskqueue != NULL) { + taskqueue_free(be_lun->io_taskqueue); + } + mtx_destroy(&be_lun->lock); + free(be_lun, M_RAMDISK); + } return (retval); } From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 07:12:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1B23EEC0; Thu, 8 May 2014 07:12:07 +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 07DF783C; Thu, 8 May 2014 07:12:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s487C6MN054361; Thu, 8 May 2014 07:12:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s487C6dv054360; Thu, 8 May 2014 07:12:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080712.s487C6dv054360@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 07:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265643 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:12:07 -0000 Author: mav Date: Thu May 8 07:12:06 2014 New Revision: 265643 URL: http://svnweb.freebsd.org/changeset/base/265643 Log: MFC r265150: Do not reread SCSI disk VPD pages on every device open. Instead of rereading VPD pages on every device open, do it only on initial device probe, and in cases when device reported via UNIT ATTENTIONs that something has changed. Capacity is still rereaded on every open because it is more critical for operation and more probable to change in run time. On my tests with Intel 530 SSDs on mps(4) HBA this change reduces time GEOM needs to retaste the device (that includes few open/close cycles) from ~150ms to ~30ms. Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Thu May 8 07:10:38 2014 (r265642) +++ stable/10/sys/cam/scsi/scsi_da.c Thu May 8 07:12:06 2014 (r265643) @@ -90,7 +90,8 @@ typedef enum { DA_FLAG_SCTX_INIT = 0x200, DA_FLAG_CAN_RC16 = 0x400, DA_FLAG_PROBED = 0x800, - DA_FLAG_DIRTY = 0x1000 + DA_FLAG_DIRTY = 0x1000, + DA_FLAG_ANNOUNCED = 0x2000 } da_flags; typedef enum { @@ -1658,10 +1659,18 @@ daasync(void *callback_arg, u_int32_t co &error_code, &sense_key, &asc, &ascq)) { if (asc == 0x2A && ascq == 0x09) { xpt_print(ccb->ccb_h.path, - "capacity data has changed\n"); + "Capacity data has changed\n"); + softc->flags &= ~DA_FLAG_PROBED; dareprobe(periph); - } else if (asc == 0x28 && ascq == 0x00) + } else if (asc == 0x28 && ascq == 0x00) { + softc->flags &= ~DA_FLAG_PROBED; disk_media_changed(softc->disk, M_NOWAIT); + } else if (asc == 0x3F && ascq == 0x03) { + xpt_print(ccb->ccb_h.path, + "INQUIRY data has changed\n"); + softc->flags &= ~DA_FLAG_PROBED; + dareprobe(periph); + } } cam_periph_async(periph, code, path, arg); break; @@ -1891,7 +1900,7 @@ daprobedone(struct cam_periph *periph, u dadeletemethodchoose(softc, DA_DELETE_NONE); - if (bootverbose && (softc->flags & DA_FLAG_PROBED) == 0) { + if (bootverbose && (softc->flags & DA_FLAG_ANNOUNCED) == 0) { char buf[80]; int i, sep; @@ -1932,10 +1941,11 @@ daprobedone(struct cam_periph *periph, u */ xpt_release_ccb(ccb); softc->state = DA_STATE_NORMAL; + softc->flags |= DA_FLAG_PROBED; daschedule(periph); wakeup(&softc->disk->d_mediasize); - if ((softc->flags & DA_FLAG_PROBED) == 0) { - softc->flags |= DA_FLAG_PROBED; + if ((softc->flags & DA_FLAG_ANNOUNCED) == 0) { + softc->flags |= DA_FLAG_ANNOUNCED; cam_periph_unhold(periph); } else cam_periph_release_locked(periph); @@ -3193,7 +3203,8 @@ dadone(struct cam_periph *periph, union } } free(csio->data_ptr, M_SCSIDA); - if (announce_buf[0] != '\0' && ((softc->flags & DA_FLAG_PROBED) == 0)) { + if (announce_buf[0] != '\0' && + ((softc->flags & DA_FLAG_ANNOUNCED) == 0)) { /* * Create our sysctl variables, now that we know * we have successfully attached. @@ -3211,6 +3222,12 @@ dadone(struct cam_periph *periph, union } } + /* We already probed the device. */ + if (softc->flags & DA_FLAG_PROBED) { + daprobedone(periph, done_ccb); + return; + } + /* Ensure re-probe doesn't see old delete. */ softc->delete_available = 0; if (lbp && (softc->quirks & DA_Q_NO_UNMAP) == 0) { @@ -3528,13 +3545,21 @@ daerror(union ccb *ccb, u_int32_t cam_fl */ else if (sense_key == SSD_KEY_UNIT_ATTENTION && asc == 0x2A && ascq == 0x09) { - xpt_print(periph->path, "capacity data has changed\n"); + xpt_print(periph->path, "Capacity data has changed\n"); + softc->flags &= ~DA_FLAG_PROBED; dareprobe(periph); sense_flags |= SF_NO_PRINT; } else if (sense_key == SSD_KEY_UNIT_ATTENTION && - asc == 0x28 && ascq == 0x00) + asc == 0x28 && ascq == 0x00) { + softc->flags &= ~DA_FLAG_PROBED; disk_media_changed(softc->disk, M_NOWAIT); - else if (sense_key == SSD_KEY_NOT_READY && + } else if (sense_key == SSD_KEY_UNIT_ATTENTION && + asc == 0x3F && ascq == 0x03) { + xpt_print(periph->path, "INQUIRY data has changed\n"); + softc->flags &= ~DA_FLAG_PROBED; + dareprobe(periph); + sense_flags |= SF_NO_PRINT; + } else if (sense_key == SSD_KEY_NOT_READY && asc == 0x3a && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { softc->flags |= DA_FLAG_PACK_INVALID; disk_media_gone(softc->disk, M_NOWAIT); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 07:13:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4CAE48F; Thu, 8 May 2014 07:13: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 2E5F2848; Thu, 8 May 2014 07:13: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 s487DNZD054573; Thu, 8 May 2014 07:13:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s487DN3A054572; Thu, 8 May 2014 07:13:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080713.s487DN3A054572@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 07:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265644 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:13:23 -0000 Author: mav Date: Thu May 8 07:13:22 2014 New Revision: 265644 URL: http://svnweb.freebsd.org/changeset/base/265644 Log: MFC r265159: Respect MAXIMUM TRANSFER LENGTH field of Block Limits VPD page. Nobody yet reported disk supporting I/Os less then our MAXPHYS value, but since we any way have code to read Block Limits VPD page, that is easy. Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Thu May 8 07:12:06 2014 (r265643) +++ stable/10/sys/cam/scsi/scsi_da.c Thu May 8 07:13:22 2014 (r265644) @@ -212,6 +212,7 @@ struct da_softc { int trim_max_ranges; int delete_running; int delete_available; /* Delete methods possibly available */ + u_int maxio; uint32_t unmap_max_ranges; uint32_t unmap_max_lba; /* Max LBAs in UNMAP req */ uint64_t ws_max_blks; @@ -2135,11 +2136,12 @@ daregister(struct cam_periph *periph, vo softc->disk->d_name = "da"; softc->disk->d_drv1 = periph; if (cpi.maxio == 0) - softc->disk->d_maxsize = DFLTPHYS; /* traditional default */ + softc->maxio = DFLTPHYS; /* traditional default */ else if (cpi.maxio > MAXPHYS) - softc->disk->d_maxsize = MAXPHYS; /* for safety */ + softc->maxio = MAXPHYS; /* for safety */ else - softc->disk->d_maxsize = cpi.maxio; + softc->maxio = cpi.maxio; + softc->disk->d_maxsize = softc->maxio; softc->disk->d_unit = periph->unit_number; softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION; if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) @@ -3279,14 +3281,6 @@ dadone(struct cam_periph *periph, union (lbp->flags & SVPD_LBP_WS10)); dadeleteflag(softc, DA_DELETE_UNMAP, (lbp->flags & SVPD_LBP_UNMAP)); - - if (lbp->flags & SVPD_LBP_UNMAP) { - free(lbp, M_SCSIDA); - xpt_release_ccb(done_ccb); - softc->state = DA_STATE_PROBE_BLK_LIMITS; - xpt_schedule(periph, priority); - return; - } } else { int error; error = daerror(done_ccb, CAM_RETRY_SELTO, @@ -3312,7 +3306,7 @@ dadone(struct cam_periph *periph, union free(lbp, M_SCSIDA); xpt_release_ccb(done_ccb); - softc->state = DA_STATE_PROBE_BDC; + softc->state = DA_STATE_PROBE_BLK_LIMITS; xpt_schedule(periph, priority); return; } @@ -3323,12 +3317,20 @@ dadone(struct cam_periph *periph, union block_limits = (struct scsi_vpd_block_limits *)csio->data_ptr; if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + uint32_t max_txfer_len = scsi_4btoul( + block_limits->max_txfer_len); uint32_t max_unmap_lba_cnt = scsi_4btoul( block_limits->max_unmap_lba_cnt); uint32_t max_unmap_blk_cnt = scsi_4btoul( block_limits->max_unmap_blk_cnt); uint64_t ws_max_blks = scsi_8btou64( block_limits->max_write_same_length); + + if (max_txfer_len != 0) { + softc->disk->d_maxsize = MIN(softc->maxio, + (off_t)max_txfer_len * softc->params.secsize); + } + /* * We should already support UNMAP but we check lba * and block count to be sure From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 08:17:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A5640851; Thu, 8 May 2014 08:17: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 91D29D67; Thu, 8 May 2014 08:17: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 s488HCT9081632; Thu, 8 May 2014 08:17:12 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s488HCTU081631; Thu, 8 May 2014 08:17:12 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405080817.s488HCTU081631@svn.freebsd.org> From: Steven Hartland Date: Thu, 8 May 2014 08:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265650 - stable/10/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 08:17:12 -0000 Author: smh Date: Thu May 8 08:17:12 2014 New Revision: 265650 URL: http://svnweb.freebsd.org/changeset/base/265650 Log: MFC r264851 Eliminated optarg global being used outside of the function which called getopt Sponsored by: Multiplay Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu May 8 08:17:04 2014 (r265649) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu May 8 08:17:12 2014 (r265650) @@ -495,9 +495,8 @@ usage(boolean_t requested) } static int -parseprop(nvlist_t *props) +parseprop(nvlist_t *props, char *propname) { - char *propname = optarg; char *propval, *strval; if ((propval = strchr(propname, '=')) == NULL) { @@ -526,7 +525,7 @@ parse_depth(char *opt, int *flags) depth = (int)strtol(opt, &tmp, 0); if (*tmp) { (void) fprintf(stderr, - gettext("%s is not an integer\n"), optarg); + gettext("%s is not an integer\n"), opt); usage(B_FALSE); } if (depth < 0) { @@ -617,7 +616,7 @@ zfs_do_clone(int argc, char **argv) while ((c = getopt(argc, argv, "o:p")) != -1) { switch (c) { case 'o': - if (parseprop(props)) + if (parseprop(props, optarg)) return (1); break; case 'p': @@ -767,7 +766,7 @@ zfs_do_create(int argc, char **argv) nomem(); break; case 'o': - if (parseprop(props)) + if (parseprop(props, optarg)) goto error; break; case 's': @@ -3636,7 +3635,7 @@ zfs_do_snapshot(int argc, char **argv) while ((c = getopt(argc, argv, "ro:")) != -1) { switch (c) { case 'o': - if (parseprop(props)) + if (parseprop(props, optarg)) return (1); break; case 'r': From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 08:18:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 08BF4992; Thu, 8 May 2014 08:18: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 CF722D75; Thu, 8 May 2014 08:18: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 s488ImMc081966; Thu, 8 May 2014 08:18:48 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s488Im9Y081965; Thu, 8 May 2014 08:18:48 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405080818.s488Im9Y081965@svn.freebsd.org> From: Steven Hartland Date: Thu, 8 May 2014 08:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265652 - stable/10/sbin/camcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 08:18:49 -0000 Author: smh Date: Thu May 8 08:18:48 2014 New Revision: 265652 URL: http://svnweb.freebsd.org/changeset/base/265652 Log: MFC r264863 Add information about supported NCQ functionality to camcontrol identify. Sponsored by: Multiplay Modified: stable/10/sbin/camcontrol/camcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Thu May 8 08:18:46 2014 (r265651) +++ stable/10/sbin/camcontrol/camcontrol.c Thu May 8 08:18:48 2014 (r265652) @@ -1214,6 +1214,18 @@ atahpa_print(struct ata_params *parm, u_ } } +static int +atasata(struct ata_params *parm) +{ + + + if (parm->satacapabilities != 0xffff && + parm->satacapabilities != 0x0000) + return 1; + + return 0; +} + static void atacapprint(struct ata_params *parm) { @@ -1370,6 +1382,17 @@ atacapprint(struct ata_params *parm) ATA_QUEUE_LEN(parm->queue) + 1); } else printf("no\n"); + + printf("NCQ Queue Management %s\n", atasata(parm) && + parm->satacapabilities2 & ATA_SUPPORT_NCQ_QMANAGEMENT ? + "yes" : "no"); + printf("NCQ Streaming %s\n", atasata(parm) && + parm->satacapabilities2 & ATA_SUPPORT_NCQ_STREAM ? + "yes" : "no"); + printf("Receive & Send FPDMA Queued %s\n", atasata(parm) && + parm->satacapabilities2 & ATA_SUPPORT_RCVSND_FPDMA_QUEUED ? + "yes" : "no"); + printf("SMART %s %s\n", parm->support.command1 & ATA_SUPPORT_SMART ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_SMART ? "yes" : "no"); @@ -1418,6 +1441,9 @@ atacapprint(struct ata_params *parm) printf("unload %s %s\n", parm->support.extension & ATA_SUPPORT_UNLOAD ? "yes" : "no", parm->enabled.extension & ATA_SUPPORT_UNLOAD ? "yes" : "no"); + printf("general purpose logging %s %s\n", + parm->support.extension & ATA_SUPPORT_GENLOG ? "yes" : "no", + parm->enabled.extension & ATA_SUPPORT_GENLOG ? "yes" : "no"); printf("free-fall %s %s\n", parm->support2 & ATA_SUPPORT_FREEFALL ? "yes" : "no", parm->enabled2 & ATA_SUPPORT_FREEFALL ? "yes" : "no"); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 08:20:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C3EAEC07; Thu, 8 May 2014 08:20: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 B07F0D88; Thu, 8 May 2014 08:20: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 s488KNJb082275; Thu, 8 May 2014 08:20:23 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s488KNgC082274; Thu, 8 May 2014 08:20:23 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405080820.s488KNgC082274@svn.freebsd.org> From: Steven Hartland Date: Thu, 8 May 2014 08:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265653 - stable/10/sys/dev/acpica X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 08:20:23 -0000 Author: smh Date: Thu May 8 08:20:23 2014 New Revision: 265653 URL: http://svnweb.freebsd.org/changeset/base/265653 Log: MFC r264878 Increase ACPI_MAX_TASKS to be 4 x the number of CPU's as 2 x was still insufficient on some machines Sponsored by: Multiplay Modified: stable/10/sys/dev/acpica/acpivar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/acpica/acpivar.h ============================================================================== --- stable/10/sys/dev/acpica/acpivar.h Thu May 8 08:18:48 2014 (r265652) +++ stable/10/sys/dev/acpica/acpivar.h Thu May 8 08:20:23 2014 (r265653) @@ -476,7 +476,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL /* Default maximum number of tasks to enqueue. */ #ifndef ACPI_MAX_TASKS -#define ACPI_MAX_TASKS MAX(32, MAXCPU * 2) +#define ACPI_MAX_TASKS MAX(32, MAXCPU * 4) #endif /* Default number of task queue threads to start. */ From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 08:23:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 26FC5EB5; Thu, 8 May 2014 08:23: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 1384BE20; Thu, 8 May 2014 08:23: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 s488NONa085710; Thu, 8 May 2014 08:23:24 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s488NOfu085709; Thu, 8 May 2014 08:23:24 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405080823.s488NOfu085709@svn.freebsd.org> From: Steven Hartland Date: Thu, 8 May 2014 08:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265655 - stable/10/sys/dev/acpica/Osd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 08:23:25 -0000 Author: smh Date: Thu May 8 08:23:24 2014 New Revision: 265655 URL: http://svnweb.freebsd.org/changeset/base/265655 Log: MFC r264849 & r264883 Exposed debug.acpi.max_tasks and debug.acpi.max_threads via sysctls so their values can be viewed. Sponsored by: Multiplay Modified: stable/10/sys/dev/acpica/Osd/OsdSchedule.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- stable/10/sys/dev/acpica/Osd/OsdSchedule.c Thu May 8 08:21:52 2014 (r265654) +++ stable/10/sys/dev/acpica/Osd/OsdSchedule.c Thu May 8 08:23:24 2014 (r265655) @@ -57,6 +57,8 @@ ACPI_MODULE_NAME("SCHEDULE") */ static int acpi_max_tasks = ACPI_MAX_TASKS; TUNABLE_INT("debug.acpi.max_tasks", &acpi_max_tasks); +SYSCTL_INT(_debug_acpi, OID_AUTO, max_tasks, CTLFLAG_RDTUN, &acpi_max_tasks, + 0, "Maximum acpi tasks"); /* * Allow the user to tune the number of task threads we start. It seems @@ -64,6 +66,8 @@ TUNABLE_INT("debug.acpi.max_tasks", &acp */ static int acpi_max_threads = ACPI_MAX_THREADS; TUNABLE_INT("debug.acpi.max_threads", &acpi_max_threads); +SYSCTL_INT(_debug_acpi, OID_AUTO, max_threads, CTLFLAG_RDTUN, &acpi_max_threads, + 0, "Maximum acpi threads"); static MALLOC_DEFINE(M_ACPITASK, "acpitask", "ACPI deferred task"); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 08:30:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DE6ED603; Thu, 8 May 2014 08:30: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 B1486E85; Thu, 8 May 2014 08:30: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 s488UI0N086844; Thu, 8 May 2014 08:30:18 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s488UIwO086843; Thu, 8 May 2014 08:30:18 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405080830.s488UIwO086843@svn.freebsd.org> From: Steven Hartland Date: Thu, 8 May 2014 08:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265659 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 08:30:19 -0000 Author: smh Date: Thu May 8 08:30:18 2014 New Revision: 265659 URL: http://svnweb.freebsd.org/changeset/base/265659 Log: MFC r264853 Add some new ATA defines for SATA 3.1 spec Sponsored by: Multiplay Modified: stable/10/sys/sys/ata.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/ata.h ============================================================================== --- stable/10/sys/sys/ata.h Thu May 8 08:26:20 2014 (r265658) +++ stable/10/sys/sys/ata.h Thu May 8 08:30:18 2014 (r265659) @@ -130,6 +130,7 @@ struct ata_params { #define ATA_SATA_CURR_GEN_MASK 0x0006 #define ATA_SUPPORT_NCQ_STREAM 0x0010 #define ATA_SUPPORT_NCQ_QMANAGEMENT 0x0020 +#define ATA_SUPPORT_RCVSND_FPDMA_QUEUED 0x0040 /*78*/ u_int16_t satasupport; #define ATA_SUPPORT_NONZERO 0x0002 #define ATA_SUPPORT_AUTOACTIVATE 0x0004 @@ -349,6 +350,7 @@ struct ata_params { #define ATA_READ_NATIVE_MAX_ADDRESS48 0x27 /* read native max addr 48bit */ #define ATA_READ_MUL48 0x29 /* read multi 48bit LBA */ #define ATA_READ_STREAM_DMA48 0x2a /* read DMA stream 48bit LBA */ +#define ATA_READ_LOG_EXT 0x2f /* read log ext - PIO Data-In */ #define ATA_READ_STREAM48 0x2b /* read stream 48bit LBA */ #define ATA_WRITE 0x30 /* write */ #define ATA_WRITE48 0x34 /* write 48bit LBA */ @@ -363,8 +365,11 @@ struct ata_params { #define ATA_WRITE_LOG_EXT 0x3f #define ATA_READ_VERIFY 0x40 #define ATA_READ_VERIFY48 0x42 +#define ATA_READ_LOG_DMA_EXT 0x47 /* read log DMA ext - PIO Data-In */ #define ATA_READ_FPDMA_QUEUED 0x60 /* read DMA NCQ */ #define ATA_WRITE_FPDMA_QUEUED 0x61 /* write DMA NCQ */ +#define ATA_SEND_FPDMA_QUEUED 0x64 /* send DMA NCQ */ +#define ATA_RECV_FPDMA_QUEUED 0x65 /* recieve DMA NCQ */ #define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ #define ATA_PACKET_CMD 0xa0 /* packet command */ From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 11:59:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 180217C2; Thu, 8 May 2014 11:59: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 04DB15ED; Thu, 8 May 2014 11:59: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 s48BxNYe076935; Thu, 8 May 2014 11:59:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48BxNnu076933; Thu, 8 May 2014 11:59:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405081159.s48BxNnu076933@svn.freebsd.org> From: Rick Macklem Date: Thu, 8 May 2014 11:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265667 - in stable/10/sys: fs/nfsserver nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 11:59:24 -0000 Author: rmacklem Date: Thu May 8 11:59:23 2014 New Revision: 265667 URL: http://svnweb.freebsd.org/changeset/base/265667 Log: MFC: r264888 The PR reported that the old NFS server did not set uio_td == NULL for the VOP_READ() call. This patch fixes both the old and new server for this case. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c stable/10/sys/nfsserver/nfs_serv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdport.c Thu May 8 11:56:06 2014 (r265666) +++ stable/10/sys/fs/nfsserver/nfs_nfsdport.c Thu May 8 11:59:23 2014 (r265667) @@ -673,6 +673,7 @@ nfsvno_read(struct vnode *vp, off_t off, uiop->uio_resid = len; uiop->uio_rw = UIO_READ; uiop->uio_segflg = UIO_SYSSPACE; + uiop->uio_td = NULL; nh = nfsrv_sequential_heuristic(uiop, vp); ioflag |= nh->nh_seqcount << IO_SEQSHIFT; error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred); Modified: stable/10/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/10/sys/nfsserver/nfs_serv.c Thu May 8 11:56:06 2014 (r265666) +++ stable/10/sys/nfsserver/nfs_serv.c Thu May 8 11:59:23 2014 (r265667) @@ -911,6 +911,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, uiop->uio_resid = len; uiop->uio_rw = UIO_READ; uiop->uio_segflg = UIO_SYSSPACE; + uiop->uio_td = NULL; nh = nfsrv_sequential_heuristic(uiop, vp); ioflag |= nh->nh_seqcount << IO_SEQSHIFT; error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 12:04:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0E565E07; Thu, 8 May 2014 12:04: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 EF7DE755; Thu, 8 May 2014 12:04: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 s48C4eFE080909; Thu, 8 May 2014 12:04:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48C4eo7080908; Thu, 8 May 2014 12:04:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405081204.s48C4eo7080908@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 12:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265668 - stable/10/sys/geom/stripe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 12:04:41 -0000 Author: mav Date: Thu May 8 12:04:40 2014 New Revision: 265668 URL: http://svnweb.freebsd.org/changeset/base/265668 Log: MFC r264313: Do not increment bio_data in case of BIO_DELETE. This fixes KASSERT() panic in g_io_request(). Modified: stable/10/sys/geom/stripe/g_stripe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/stripe/g_stripe.c ============================================================================== --- stable/10/sys/geom/stripe/g_stripe.c Thu May 8 11:59:23 2014 (r265667) +++ stable/10/sys/geom/stripe/g_stripe.c Thu May 8 12:04:40 2014 (r265668) @@ -472,9 +472,10 @@ g_stripe_start_economic(struct bio *bp, /* offset -= offset % stripesize; */ offset -= offset & (stripesize - 1); - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; length = bp->bio_length - length; - for (no++; length > 0; no++, length -= stripesize, addr += stripesize) { + for (no++; length > 0; no++, length -= stripesize) { if (no > sc->sc_ndisks - 1) { no = 0; offset += stripesize; @@ -506,6 +507,9 @@ g_stripe_start_economic(struct bio *bp, cbp->bio_data = addr; cbp->bio_caller2 = sc->sc_disks[no]; + + if (bp->bio_cmd != BIO_DELETE) + addr += stripesize; } /* * Fire off all allocated requests! @@ -632,10 +636,13 @@ g_stripe_start(struct bio *bp) * a provider, so there is nothing to optmize. * and * 4. Request is not unmapped. + * and + * 5. It is not a BIO_DELETE. */ if (g_stripe_fast && bp->bio_length <= MAXPHYS && bp->bio_length >= stripesize * sc->sc_ndisks && - (bp->bio_flags & BIO_UNMAPPED) == 0) { + (bp->bio_flags & BIO_UNMAPPED) == 0 && + bp->bio_cmd != BIO_DELETE) { fast = 1; } error = 0; From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 12:07:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C2B95FC0; Thu, 8 May 2014 12:07: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 A3D587A0; Thu, 8 May 2014 12:07: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 s48C7gkU081440; Thu, 8 May 2014 12:07:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48C7f0x081430; Thu, 8 May 2014 12:07:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405081207.s48C7f0x081430@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 12:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265669 - stable/10/sys/geom/raid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 12:07:42 -0000 Author: mav Date: Thu May 8 12:07:40 2014 New Revision: 265669 URL: http://svnweb.freebsd.org/changeset/base/265669 Log: MFC r265054: Reduce number of opens by REOM RAID during provider taste. Instead opening/closing provider by each of metadata classes, do it only once in core code. Since for SCSI disks open/close means sending some SCSI commands to the device, this change reduces taste time. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/geom/raid/g_raid.c stable/10/sys/geom/raid/md_ddf.c stable/10/sys/geom/raid/md_intel.c stable/10/sys/geom/raid/md_jmicron.c stable/10/sys/geom/raid/md_nvidia.c stable/10/sys/geom/raid/md_promise.c stable/10/sys/geom/raid/md_sii.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/raid/g_raid.c ============================================================================== --- stable/10/sys/geom/raid/g_raid.c Thu May 8 12:04:40 2014 (r265668) +++ stable/10/sys/geom/raid/g_raid.c Thu May 8 12:07:40 2014 (r265669) @@ -2251,6 +2251,8 @@ g_raid_taste(struct g_class *mp, struct return (NULL); G_RAID_DEBUG(2, "Tasting provider %s.", pp->name); + geom = NULL; + status = G_RAID_MD_TASTE_FAIL; gp = g_new_geomf(mp, "raid:taste"); /* * This orphan function should be never called. @@ -2259,8 +2261,9 @@ g_raid_taste(struct g_class *mp, struct cp = g_new_consumer(gp); cp->flags |= G_CF_DIRECT_RECEIVE; g_attach(cp, pp); + if (g_access(cp, 1, 0, 0) != 0) + goto ofail; - geom = NULL; LIST_FOREACH(class, &g_raid_md_classes, mdc_list) { if (!class->mdc_enable) continue; @@ -2276,6 +2279,9 @@ g_raid_taste(struct g_class *mp, struct break; } + if (status == G_RAID_MD_TASTE_FAIL) + (void)g_access(cp, -1, 0, 0); +ofail: g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); Modified: stable/10/sys/geom/raid/md_ddf.c ============================================================================== --- stable/10/sys/geom/raid/md_ddf.c Thu May 8 12:04:40 2014 (r265668) +++ stable/10/sys/geom/raid/md_ddf.c Thu May 8 12:07:40 2014 (r265669) @@ -2120,13 +2120,10 @@ g_raid_md_taste_ddf(struct g_raid_md_obj pp = cp->provider; /* Read metadata from device. */ - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); bzero(&meta, sizeof(meta)); error = ddf_meta_read(cp, &meta); g_topology_lock(); - g_access(cp, -1, 0, 0); if (error != 0) return (G_RAID_MD_TASTE_FAIL); be = meta.bigendian; @@ -2164,6 +2161,9 @@ g_raid_md_taste_ddf(struct g_raid_md_obj geom = sc->sc_geom; } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); Modified: stable/10/sys/geom/raid/md_intel.c ============================================================================== --- stable/10/sys/geom/raid/md_intel.c Thu May 8 12:04:40 2014 (r265668) +++ stable/10/sys/geom/raid/md_intel.c Thu May 8 12:07:40 2014 (r265669) @@ -1382,8 +1382,6 @@ g_raid_md_taste_intel(struct g_raid_md_o meta = NULL; vendor = 0xffff; disk_pos = 0; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); error = g_raid_md_get_label(cp, serial, sizeof(serial)); if (error != 0) { @@ -1396,7 +1394,6 @@ g_raid_md_taste_intel(struct g_raid_md_o g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = intel_meta_read(cp); g_topology_lock(); - g_access(cp, -1, 0, 0); if (meta == NULL) { if (g_raid_aggressive_spare) { if (vendor != 0x8086) { @@ -1476,6 +1473,9 @@ search: G_RAID_DEBUG1(1, sc, "root_mount_hold %p", mdi->mdio_rootmount); } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); @@ -1512,7 +1512,6 @@ search: return (result); fail2: g_topology_lock(); - g_access(cp, -1, 0, 0); fail1: free(meta, M_MD_INTEL); return (G_RAID_MD_TASTE_FAIL); Modified: stable/10/sys/geom/raid/md_jmicron.c ============================================================================== --- stable/10/sys/geom/raid/md_jmicron.c Thu May 8 12:04:40 2014 (r265668) +++ stable/10/sys/geom/raid/md_jmicron.c Thu May 8 12:07:40 2014 (r265669) @@ -837,15 +837,12 @@ g_raid_md_taste_jmicron(struct g_raid_md /* Read metadata from device. */ meta = NULL; vendor = 0xffff; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); len = 2; if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = jmicron_meta_read(cp); g_topology_lock(); - g_access(cp, -1, 0, 0); if (meta == NULL) { if (g_raid_aggressive_spare) { if (vendor == 0x197b) { @@ -922,6 +919,9 @@ search: G_RAID_DEBUG1(1, sc, "root_mount_hold %p", mdi->mdio_rootmount); } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); Modified: stable/10/sys/geom/raid/md_nvidia.c ============================================================================== --- stable/10/sys/geom/raid/md_nvidia.c Thu May 8 12:04:40 2014 (r265668) +++ stable/10/sys/geom/raid/md_nvidia.c Thu May 8 12:07:40 2014 (r265669) @@ -841,15 +841,12 @@ g_raid_md_taste_nvidia(struct g_raid_md_ /* Read metadata from device. */ meta = NULL; vendor = 0xffff; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); len = 2; if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = nvidia_meta_read(cp); g_topology_lock(); - g_access(cp, -1, 0, 0); if (meta == NULL) { if (g_raid_aggressive_spare) { if (vendor == 0x10de) { @@ -918,6 +915,9 @@ search: G_RAID_DEBUG1(1, sc, "root_mount_hold %p", mdi->mdio_rootmount); } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); Modified: stable/10/sys/geom/raid/md_promise.c ============================================================================== --- stable/10/sys/geom/raid/md_promise.c Thu May 8 12:04:40 2014 (r265668) +++ stable/10/sys/geom/raid/md_promise.c Thu May 8 12:07:40 2014 (r265669) @@ -1106,15 +1106,12 @@ g_raid_md_taste_promise(struct g_raid_md /* Read metadata from device. */ meta = NULL; vendor = 0xffff; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); len = 2; if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); subdisks = promise_meta_read(cp, metaarr); g_topology_lock(); - g_access(cp, -1, 0, 0); if (subdisks == 0) { if (g_raid_aggressive_spare) { if (vendor == 0x105a || vendor == 0x1002) { @@ -1175,6 +1172,9 @@ search: geom = sc->sc_geom; } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); Modified: stable/10/sys/geom/raid/md_sii.c ============================================================================== --- stable/10/sys/geom/raid/md_sii.c Thu May 8 12:04:40 2014 (r265668) +++ stable/10/sys/geom/raid/md_sii.c Thu May 8 12:07:40 2014 (r265669) @@ -923,15 +923,12 @@ g_raid_md_taste_sii(struct g_raid_md_obj /* Read metadata from device. */ meta = NULL; vendor = 0xffff; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); len = 2; if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = sii_meta_read(cp); g_topology_lock(); - g_access(cp, -1, 0, 0); if (meta == NULL) { if (g_raid_aggressive_spare) { if (vendor == 0x1095) { @@ -1011,6 +1008,9 @@ search: G_RAID_DEBUG1(1, sc, "root_mount_hold %p", mdi->mdio_rootmount); } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 13:10:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6F7EECF8; Thu, 8 May 2014 13:10: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 5C1CAD80; Thu, 8 May 2014 13:10: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 s48DAevj009764; Thu, 8 May 2014 13:10:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48DAe4d009763; Thu, 8 May 2014 13:10:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405081310.s48DAe4d009763@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 13:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265677 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 13:10:40 -0000 Author: mav Date: Thu May 8 13:10:39 2014 New Revision: 265677 URL: http://svnweb.freebsd.org/changeset/base/265677 Log: MFC r264086: 3580 Want zvols to return volblocksize when queried for physical block size illumos/illumos-gate@a0b60564dfc644f4bfaef1ce26d343b44cf68bc5 It is irrelevant for FreeBSD, just reducing diff. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu May 8 12:50:31 2014 (r265676) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu May 8 13:10:39 2014 (r265677) @@ -1723,8 +1723,6 @@ int zvol_ioctl(dev_t dev, int cmd, intptr_t arg, int flag, cred_t *cr, int *rvalp) { zvol_state_t *zv; - struct dk_cinfo dki; - struct dk_minfo dkm; struct dk_callback *dkc; int error = 0; rl_t *rl; @@ -1742,6 +1740,9 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t switch (cmd) { case DKIOCINFO: + { + struct dk_cinfo dki; + bzero(&dki, sizeof (dki)); (void) strcpy(dki.dki_cname, "zvol"); (void) strcpy(dki.dki_dname, "zvol"); @@ -1752,8 +1753,12 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t if (ddi_copyout(&dki, (void *)arg, sizeof (dki), flag)) error = SET_ERROR(EFAULT); return (error); + } case DKIOCGMEDIAINFO: + { + struct dk_minfo dkm; + bzero(&dkm, sizeof (dkm)); dkm.dki_lbsize = 1U << zv->zv_min_bs; dkm.dki_capacity = zv->zv_volsize >> zv->zv_min_bs; @@ -1762,16 +1767,32 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t if (ddi_copyout(&dkm, (void *)arg, sizeof (dkm), flag)) error = SET_ERROR(EFAULT); return (error); + } + + case DKIOCGMEDIAINFOEXT: + { + struct dk_minfo_ext dkmext; + + bzero(&dkmext, sizeof (dkmext)); + dkmext.dki_lbsize = 1U << zv->zv_min_bs; + dkmext.dki_pbsize = zv->zv_volblocksize; + dkmext.dki_capacity = zv->zv_volsize >> zv->zv_min_bs; + dkmext.dki_media_type = DK_UNKNOWN; + mutex_exit(&spa_namespace_lock); + if (ddi_copyout(&dkmext, (void *)arg, sizeof (dkmext), flag)) + error = SET_ERROR(EFAULT); + return (error); + } case DKIOCGETEFI: - { - uint64_t vs = zv->zv_volsize; - uint8_t bs = zv->zv_min_bs; + { + uint64_t vs = zv->zv_volsize; + uint8_t bs = zv->zv_min_bs; - mutex_exit(&spa_namespace_lock); - error = zvol_getefi((void *)arg, flag, vs, bs); - return (error); - } + mutex_exit(&spa_namespace_lock); + error = zvol_getefi((void *)arg, flag, vs, bs); + return (error); + } case DKIOCFLUSHWRITECACHE: dkc = (struct dk_callback *)arg; @@ -1784,31 +1805,31 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t return (error); case DKIOCGETWCE: - { - int wce = (zv->zv_flags & ZVOL_WCE) ? 1 : 0; - if (ddi_copyout(&wce, (void *)arg, sizeof (int), - flag)) - error = SET_ERROR(EFAULT); + { + int wce = (zv->zv_flags & ZVOL_WCE) ? 1 : 0; + if (ddi_copyout(&wce, (void *)arg, sizeof (int), + flag)) + error = SET_ERROR(EFAULT); + break; + } + case DKIOCSETWCE: + { + int wce; + if (ddi_copyin((void *)arg, &wce, sizeof (int), + flag)) { + error = SET_ERROR(EFAULT); break; } - case DKIOCSETWCE: - { - int wce; - if (ddi_copyin((void *)arg, &wce, sizeof (int), - flag)) { - error = SET_ERROR(EFAULT); - break; - } - if (wce) { - zv->zv_flags |= ZVOL_WCE; - mutex_exit(&spa_namespace_lock); - } else { - zv->zv_flags &= ~ZVOL_WCE; - mutex_exit(&spa_namespace_lock); - zil_commit(zv->zv_zilog, ZVOL_OBJ); - } - return (0); + if (wce) { + zv->zv_flags |= ZVOL_WCE; + mutex_exit(&spa_namespace_lock); + } else { + zv->zv_flags &= ~ZVOL_WCE; + mutex_exit(&spa_namespace_lock); + zil_commit(zv->zv_zilog, ZVOL_OBJ); } + return (0); + } case DKIOCGGEOM: case DKIOCGVTOC: From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 13:12:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 74EEFE6B; Thu, 8 May 2014 13:12: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 5EDECDFE; Thu, 8 May 2014 13:12: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 s48DCPHv012350; Thu, 8 May 2014 13:12:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48DCOKr012345; Thu, 8 May 2014 13:12:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405081312.s48DCOKr012345@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 13:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265678 - in stable/10: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/s... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 13:12:25 -0000 Author: mav Date: Thu May 8 13:12:24 2014 New Revision: 265678 URL: http://svnweb.freebsd.org/changeset/base/265678 Log: MFC r264145: Add property and sysctl to control how ZVOLs are exposed to OS. New ZFS property volmode and sysctl vfs.zfs.vol.mode allow switching ZVOL between three modes: geom -- existing fully functional behavior (default); dev -- exposing volumes only as raw disk device file in devfs; none -- not exposing volumes outside ZFS. The "dev" mode is less functional (can't be partitioned, mounted, etc), but it is faster, and in some scenarios with untrusted consumers safer. It can be useful for NAS, VM block storages, etc. The "none" mode may be convenient for backup servers, etc. that don't need direct data access. Due to the way ZVOL is integrated with main ZFS code, those property and sysctl are checked only during pool import and volume creation. Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu May 8 13:10:39 2014 (r265677) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu May 8 13:12:24 2014 (r265678) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2014 +.Dd April 5, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -1306,6 +1306,38 @@ Consequently, writes to a sparse volume when the pool is low on space. For a sparse volume, changes to .Sy volsize are not reflected in the reservation. +.It Sy volmode Ns = Ns Cm default | geom | dev | none +This property specifies how volumes should be exposed to the OS. +Setting it to +.Sy geom +exposes volumes as +.Xr geom 4 +providers, providing maximal functionality. +Setting it to +.Sy dev +exposes volumes only as cdev device in devfs. +Such volumes can be accessed only as raw disk device files, i.e. they +can not be partitioned, mounted, participate in RAIDs, etc, but they +are faster, and in some use scenarios with untrusted consumer, such as +NAS or VM storage, can be more safe. +Volumes with property set to +.Sy none +are not exposed outside ZFS, but can be snapshoted, cloned, replicated, etc, +that can be suitable for backup purposes. +Value +.Sy default +means that volumes exposition is controlled by system-wide sysctl/tunable +.Va vfs.zfs.vol.mode , +where +.Sy geom , +.Sy dev +and +.Sy none +are encoded as 1, 2 and 3 respectively. +The default values is +.Sy geom . +This property can be changed any time, but so far it is processed only +during volume creation and pool import. .It Sy vscan Ns = Ns Cm off | on The .Sy vscan Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Thu May 8 13:10:39 2014 (r265677) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Thu May 8 13:12:24 2014 (r265678) @@ -198,6 +198,14 @@ zfs_prop_init(void) { NULL } }; + static zprop_index_t volmode_table[] = { + { "default", ZFS_VOLMODE_DEFAULT }, + { "geom", ZFS_VOLMODE_GEOM }, + { "dev", ZFS_VOLMODE_DEV }, + { "none", ZFS_VOLMODE_NONE }, + { NULL } + }; + /* inherit index properties */ zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, @@ -242,6 +250,10 @@ zfs_prop_init(void) zprop_register_index(ZFS_PROP_LOGBIAS, "logbias", ZFS_LOGBIAS_LATENCY, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "latency | throughput", "LOGBIAS", logbias_table); + zprop_register_index(ZFS_PROP_VOLMODE, "volmode", + ZFS_VOLMODE_DEFAULT, PROP_INHERIT, + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME, + "default | geom | dev | none", "VOLMODE", volmode_table); /* inherit index (boolean) properties */ zprop_register_index(ZFS_PROP_ATIME, "atime", 1, PROP_INHERIT, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu May 8 13:10:39 2014 (r265677) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu May 8 13:12:24 2014 (r265678) @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -75,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +116,13 @@ static char *zvol_tag = "zvol_tag"; */ static uint32_t zvol_minors; +SYSCTL_DECL(_vfs_zfs); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTLFLAG_RW, 0, "ZFS VOLUME"); +static int volmode = ZFS_VOLMODE_GEOM; +TUNABLE_INT("vfs.zfs.vol.mode", &volmode); +SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, mode, CTLFLAG_RWTUN, &volmode, 0, + "Expose as GEOM providers (1), device files (2) or neither"); + typedef struct zvol_extent { list_node_t ze_node; dva_t ze_dva; /* dva associated with this extent */ @@ -124,9 +133,11 @@ typedef struct zvol_extent { * The in-core state of each volume. */ typedef struct zvol_state { + LIST_ENTRY(zvol_state) zv_links; char zv_name[MAXPATHLEN]; /* pool/dd name */ uint64_t zv_volsize; /* amount of space we advertise */ uint64_t zv_volblocksize; /* volume block size */ + struct cdev *zv_dev; /* non-GEOM device */ struct g_provider *zv_provider; /* GEOM provider */ uint8_t zv_min_bs; /* minimum addressable block shift */ uint8_t zv_flags; /* readonly, dumpified, etc. */ @@ -137,10 +148,13 @@ typedef struct zvol_state { znode_t zv_znode; /* for range locking */ dmu_buf_t *zv_dbuf; /* bonus handle */ int zv_state; + int zv_volmode; /* Provide GEOM or cdev */ struct bio_queue_head zv_queue; struct mtx zv_queue_mtx; /* zv_queue mutex */ } zvol_state_t; +static LIST_HEAD(, zvol_state) all_zvols; + /* * zvol specific flags */ @@ -154,6 +168,25 @@ typedef struct zvol_state { */ int zvol_maxphys = DMU_MAX_ACCESS/2; +static d_open_t zvol_d_open; +static d_close_t zvol_d_close; +static d_read_t zvol_read; +static d_write_t zvol_write; +static d_ioctl_t zvol_d_ioctl; +static d_strategy_t zvol_strategy; + +static struct cdevsw zvol_cdevsw = { + .d_version = D_VERSION, + .d_open = zvol_d_open, + .d_close = zvol_d_close, + .d_read = zvol_read, + .d_write = zvol_write, + .d_ioctl = zvol_d_ioctl, + .d_strategy = zvol_strategy, + .d_name = "zvol", + .d_flags = D_DISK | D_TRACKCLOSE, +}; + extern int zfs_set_prop_nvlist(const char *, zprop_source_t, nvlist_t *, nvlist_t *); static void zvol_log_truncate(zvol_state_t *zv, dmu_tx_t *tx, uint64_t off, @@ -164,7 +197,6 @@ static int zvol_dumpify(zvol_state_t *zv static int zvol_dump_fini(zvol_state_t *zv); static int zvol_dump_init(zvol_state_t *zv, boolean_t resize); -static zvol_state_t *zvol_geom_create(const char *name); static void zvol_geom_run(zvol_state_t *zv); static void zvol_geom_destroy(zvol_state_t *zv); static int zvol_geom_access(struct g_provider *pp, int acr, int acw, int ace); @@ -186,14 +218,16 @@ zvol_size_changed(zvol_state_t *zv) spec_size_invalidate(dev, VBLK); spec_size_invalidate(dev, VCHR); #else /* !sun */ - struct g_provider *pp; + if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { + struct g_provider *pp; - pp = zv->zv_provider; - if (pp == NULL) - return; - g_topology_lock(); - g_resize_provider(pp, zv->zv_volsize); - g_topology_unlock(); + pp = zv->zv_provider; + if (pp == NULL) + return; + g_topology_lock(); + g_resize_provider(pp, zv->zv_volsize); + g_topology_unlock(); + } #endif /* !sun */ } @@ -250,26 +284,16 @@ zvol_get_stats(objset_t *os, nvlist_t *n static zvol_state_t * zvol_minor_lookup(const char *name) { - struct g_provider *pp; - struct g_geom *gp; - zvol_state_t *zv = NULL; + zvol_state_t *zv; ASSERT(MUTEX_HELD(&spa_namespace_lock)); - g_topology_lock(); - LIST_FOREACH(gp, &zfs_zvol_class.geom, geom) { - pp = LIST_FIRST(&gp->provider); - if (pp == NULL) - continue; - zv = pp->private; - if (zv == NULL) - continue; + LIST_FOREACH(zv, &all_zvols, zv_links) { if (strcmp(zv->zv_name, name) == 0) break; } - g_topology_unlock(); - return (gp != NULL ? zv : NULL); + return (zv); } /* extent mapping arg */ @@ -507,8 +531,11 @@ zvol_create_minor(const char *name) zfs_soft_state_t *zs; zvol_state_t *zv; objset_t *os; + struct cdev *dev; + struct g_provider *pp; + struct g_geom *gp; dmu_object_info_t doi; - uint64_t volsize; + uint64_t volsize, mode; int error; ZFS_LOG(1, "Creating ZVOL %s...", name); @@ -569,20 +596,51 @@ zvol_create_minor(const char *name) zv = zs->zss_data = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP); #else /* !sun */ + zv = kmem_zalloc(sizeof(*zv), KM_SLEEP); + zv->zv_state = 0; error = zap_lookup(os, ZVOL_ZAP_OBJ, "size", 8, 1, &volsize); if (error) { - ASSERT(error == 0); + kmem_free(zv, sizeof(*zv)); dmu_objset_disown(os, zvol_tag); mutex_exit(&spa_namespace_lock); return (error); } + error = dsl_prop_get_integer(name, + zfs_prop_to_name(ZFS_PROP_VOLMODE), &mode, NULL); + if (error != 0 || mode == ZFS_VOLMODE_DEFAULT) + mode = volmode; DROP_GIANT(); - g_topology_lock(); - zv = zvol_geom_create(name); zv->zv_volsize = volsize; - zv->zv_provider->mediasize = zv->zv_volsize; + zv->zv_volmode = mode; + if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { + g_topology_lock(); + gp = g_new_geomf(&zfs_zvol_class, "zfs::zvol::%s", name); + gp->start = zvol_geom_start; + gp->access = zvol_geom_access; + pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, name); + pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND; + pp->sectorsize = DEV_BSIZE; + pp->mediasize = zv->zv_volsize; + pp->private = zv; + zv->zv_provider = pp; + bioq_init(&zv->zv_queue); + mtx_init(&zv->zv_queue_mtx, "zvol", NULL, MTX_DEF); + } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) { + if (make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, + &dev, &zvol_cdevsw, NULL, UID_ROOT, GID_OPERATOR, + 0640, "%s/%s", ZVOL_DRIVER, name) != 0) { + kmem_free(zv, sizeof(*zv)); + dmu_objset_disown(os, FTAG); + mutex_exit(&spa_namespace_lock); + return (SET_ERROR(ENXIO)); + } + zv->zv_dev = dev; + dev->si_iosize_max = MAXPHYS; + dev->si_drv2 = zv; + } + LIST_INSERT_HEAD(&all_zvols, zv, zv_links); #endif /* !sun */ (void) strlcpy(zv->zv_name, name, MAXPATHLEN); @@ -613,10 +671,13 @@ zvol_create_minor(const char *name) mutex_exit(&spa_namespace_lock); - zvol_geom_run(zv); - - g_topology_unlock(); +#ifndef sun + if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { + zvol_geom_run(zv); + g_topology_unlock(); + } PICKUP_GIANT(); +#endif ZFS_LOG(1, "ZVOL %s created.", name); @@ -642,12 +703,20 @@ zvol_remove_zv(zvol_state_t *zv) #ifdef sun (void) snprintf(nmbuf, sizeof (nmbuf), "%u,raw", minor); ddi_remove_minor_node(zfs_dip, nmbuf); +#else + LIST_REMOVE(zv, zv_links); + if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { + g_topology_lock(); + zvol_geom_destroy(zv); + g_topology_unlock(); + } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) + destroy_dev(zv->zv_dev); #endif /* sun */ avl_destroy(&zv->zv_znode.z_range_avl); mutex_destroy(&zv->zv_znode.z_range_lock); - zvol_geom_destroy(zv); + kmem_free(zv, sizeof(*zv)); zvol_minors--; return (0); @@ -664,9 +733,7 @@ zvol_remove_minor(const char *name) mutex_exit(&spa_namespace_lock); return (SET_ERROR(ENXIO)); } - g_topology_lock(); rc = zvol_remove_zv(zv); - g_topology_unlock(); mutex_exit(&spa_namespace_lock); return (rc); } @@ -802,24 +869,15 @@ zvol_update_volsize(objset_t *os, uint64 void zvol_remove_minors(const char *name) { - struct g_geom *gp, *gptmp; - struct g_provider *pp; - zvol_state_t *zv; + zvol_state_t *zv, *tzv; size_t namelen; namelen = strlen(name); DROP_GIANT(); mutex_enter(&spa_namespace_lock); - g_topology_lock(); - LIST_FOREACH_SAFE(gp, &zfs_zvol_class.geom, geom, gptmp) { - pp = LIST_FIRST(&gp->provider); - if (pp == NULL) - continue; - zv = pp->private; - if (zv == NULL) - continue; + LIST_FOREACH_SAFE(zv, &all_zvols, zv_links, tzv) { if (strcmp(zv->zv_name, name) == 0 || (strncmp(zv->zv_name, name, namelen) == 0 && zv->zv_name[namelen] == '/')) { @@ -827,7 +885,6 @@ zvol_remove_minors(const char *name) } } - g_topology_unlock(); mutex_exit(&spa_namespace_lock); PICKUP_GIANT(); } @@ -1286,28 +1343,46 @@ zvol_dumpio(zvol_state_t *zv, void *addr } #endif /* sun */ -int +void zvol_strategy(struct bio *bp) { - zvol_state_t *zv = bp->bio_to->private; + zvol_state_t *zv; uint64_t off, volsize; size_t resid; char *addr; objset_t *os; rl_t *rl; int error = 0; - boolean_t doread = (bp->bio_cmd == BIO_READ); + boolean_t doread = 0; boolean_t is_dumpified; boolean_t sync; + if (bp->bio_to) + zv = bp->bio_to->private; + else + zv = bp->bio_dev->si_drv2; + if (zv == NULL) { - g_io_deliver(bp, ENXIO); - return (0); + error = ENXIO; + goto out; } if (bp->bio_cmd != BIO_READ && (zv->zv_flags & ZVOL_RDONLY)) { - g_io_deliver(bp, EROFS); - return (0); + error = EROFS; + goto out; + } + + switch (bp->bio_cmd) { + case BIO_FLUSH: + goto sync; + case BIO_READ: + doread = 1; + case BIO_WRITE: + case BIO_DELETE: + break; + default: + error = EOPNOTSUPP; + goto out; } off = bp->bio_offset; @@ -1320,8 +1395,8 @@ zvol_strategy(struct bio *bp) resid = bp->bio_length; if (resid > 0 && (off < 0 || off >= volsize)) { - g_io_deliver(bp, EIO); - return (0); + error = EIO; + goto out; } #ifdef illumos @@ -1393,14 +1468,18 @@ unlock: zfs_range_unlock(rl); bp->bio_completed = bp->bio_length - resid; - if (bp->bio_completed < bp->bio_length) - bp->bio_error = (off > volsize ? EINVAL : error); + if (bp->bio_completed < bp->bio_length && off > volsize) + error = EINVAL; - if (sync) + if (sync) { +sync: zil_commit(zv->zv_zilog, ZVOL_OBJ); - g_io_deliver(bp, 0); - - return (0); + } +out: + if (bp->bio_to) + g_io_deliver(bp, error); + else + biofinish(bp, NULL, error); } #ifdef sun @@ -1459,25 +1538,36 @@ int zvol_read(dev_t dev, uio_t *uio, cred_t *cr) { minor_t minor = getminor(dev); +#else +int +zvol_read(struct cdev *dev, struct uio *uio, int ioflag) +{ +#endif zvol_state_t *zv; uint64_t volsize; rl_t *rl; int error = 0; +#ifdef sun zv = zfsdev_get_soft_state(minor, ZSST_ZVOL); if (zv == NULL) return (SET_ERROR(ENXIO)); +#else + zv = dev->si_drv2; +#endif volsize = zv->zv_volsize; if (uio->uio_resid > 0 && - (uio->uio_loffset < 0 || uio->uio_loffset >= volsize)) + (uio->uio_loffset < 0 || uio->uio_loffset > volsize)) return (SET_ERROR(EIO)); +#ifdef illumos if (zv->zv_flags & ZVOL_DUMPIFIED) { error = physio(zvol_strategy, NULL, dev, B_READ, zvol_minphys, uio); return (error); } +#endif rl = zfs_range_lock(&zv->zv_znode, uio->uio_loffset, uio->uio_resid, RL_READER); @@ -1500,31 +1590,43 @@ zvol_read(dev_t dev, uio_t *uio, cred_t return (error); } +#ifdef sun /*ARGSUSED*/ int zvol_write(dev_t dev, uio_t *uio, cred_t *cr) { minor_t minor = getminor(dev); +#else +int +zvol_write(struct cdev *dev, struct uio *uio, int ioflag) +{ +#endif zvol_state_t *zv; uint64_t volsize; rl_t *rl; int error = 0; boolean_t sync; +#ifdef sun zv = zfsdev_get_soft_state(minor, ZSST_ZVOL); if (zv == NULL) return (SET_ERROR(ENXIO)); +#else + zv = dev->si_drv2; +#endif volsize = zv->zv_volsize; if (uio->uio_resid > 0 && - (uio->uio_loffset < 0 || uio->uio_loffset >= volsize)) + (uio->uio_loffset < 0 || uio->uio_loffset > volsize)) return (SET_ERROR(EIO)); +#ifdef illumos if (zv->zv_flags & ZVOL_DUMPIFIED) { error = physio(zvol_strategy, NULL, dev, B_WRITE, zvol_minphys, uio); return (error); } +#endif sync = !(zv->zv_flags & ZVOL_WCE) || (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS); @@ -1559,6 +1661,7 @@ zvol_write(dev_t dev, uio_t *uio, cred_t return (error); } +#ifdef sun int zvol_getefi(void *arg, int flag, uint64_t vs, uint8_t bs) { @@ -2232,31 +2335,6 @@ zvol_dump_fini(zvol_state_t *zv) } #endif /* sun */ -static zvol_state_t * -zvol_geom_create(const char *name) -{ - struct g_provider *pp; - struct g_geom *gp; - zvol_state_t *zv; - - gp = g_new_geomf(&zfs_zvol_class, "zfs::zvol::%s", name); - gp->start = zvol_geom_start; - gp->access = zvol_geom_access; - pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, name); - pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND; - pp->sectorsize = DEV_BSIZE; - - zv = kmem_zalloc(sizeof(*zv), KM_SLEEP); - zv->zv_provider = pp; - zv->zv_state = 0; - bioq_init(&zv->zv_queue); - mtx_init(&zv->zv_queue_mtx, "zvol", NULL, MTX_DEF); - - pp->private = zv; - - return (zv); -} - static void zvol_geom_run(zvol_state_t *zv) { @@ -2287,8 +2365,6 @@ zvol_geom_destroy(zvol_state_t *zv) zv->zv_provider = NULL; pp->private = NULL; g_wither_geom(pp->geom, ENXIO); - - kmem_free(zv, sizeof(*zv)); } static int @@ -2537,30 +2613,47 @@ zvol_create_minors(const char *name) } static void -zvol_rename_minor(struct g_geom *gp, const char *newname) +zvol_rename_minor(zvol_state_t *zv, const char *newname) { + struct g_geom *gp; struct g_provider *pp; - zvol_state_t *zv; + struct cdev *dev; ASSERT(MUTEX_HELD(&spa_namespace_lock)); - g_topology_assert(); - - pp = LIST_FIRST(&gp->provider); - ASSERT(pp != NULL); - zv = pp->private; - ASSERT(zv != NULL); - - zv->zv_provider = NULL; - g_wither_provider(pp, ENXIO); - pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, newname); - pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND; - pp->sectorsize = DEV_BSIZE; - pp->mediasize = zv->zv_volsize; - pp->private = zv; - zv->zv_provider = pp; + if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { + g_topology_lock(); + pp = zv->zv_provider; + ASSERT(pp != NULL); + gp = pp->geom; + ASSERT(gp != NULL); + + zv->zv_provider = NULL; + g_wither_provider(pp, ENXIO); + + pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, newname); + pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND; + pp->sectorsize = DEV_BSIZE; + pp->mediasize = zv->zv_volsize; + pp->private = zv; + zv->zv_provider = pp; + g_error_provider(pp, 0); + g_topology_unlock(); + } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) { + dev = zv->zv_dev; + ASSERT(dev != NULL); + zv->zv_dev = NULL; + destroy_dev(dev); + + if (make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, + &dev, &zvol_cdevsw, NULL, UID_ROOT, GID_OPERATOR, + 0640, "%s/%s", ZVOL_DRIVER, newname) == 0) { + zv->zv_dev = dev; + dev->si_iosize_max = MAXPHYS; + dev->si_drv2 = zv; + } + } strlcpy(zv->zv_name, newname, sizeof(zv->zv_name)); - g_error_provider(pp, 0); } void @@ -2578,28 +2671,169 @@ zvol_rename_minors(const char *oldname, DROP_GIANT(); mutex_enter(&spa_namespace_lock); - g_topology_lock(); - LIST_FOREACH(gp, &zfs_zvol_class.geom, geom) { - pp = LIST_FIRST(&gp->provider); - if (pp == NULL) - continue; - zv = pp->private; - if (zv == NULL) - continue; + LIST_FOREACH(zv, &all_zvols, zv_links) { if (strcmp(zv->zv_name, oldname) == 0) { - zvol_rename_minor(gp, newname); + zvol_rename_minor(zv, newname); } else if (strncmp(zv->zv_name, oldname, oldnamelen) == 0 && (zv->zv_name[oldnamelen] == '/' || zv->zv_name[oldnamelen] == '@')) { snprintf(name, sizeof(name), "%s%c%s", newname, zv->zv_name[oldnamelen], zv->zv_name + oldnamelen + 1); - zvol_rename_minor(gp, name); + zvol_rename_minor(zv, name); } } - g_topology_unlock(); mutex_exit(&spa_namespace_lock); PICKUP_GIANT(); } + +static int +zvol_d_open(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + zvol_state_t *zv; + int err = 0; + + mutex_enter(&spa_namespace_lock); + zv = dev->si_drv2; + if (zv == NULL) { + mutex_exit(&spa_namespace_lock); + return(ENXIO); /* zvol_create_minor() not done yet */ + } + + if (zv->zv_total_opens == 0) + err = zvol_first_open(zv); + if (err) { + mutex_exit(&spa_namespace_lock); + return (err); + } + if ((flags & FWRITE) && (zv->zv_flags & ZVOL_RDONLY)) { + err = SET_ERROR(EROFS); + goto out; + } + if (zv->zv_flags & ZVOL_EXCL) { + err = SET_ERROR(EBUSY); + goto out; + } +#ifdef FEXCL + if (flags & FEXCL) { + if (zv->zv_total_opens != 0) { + err = SET_ERROR(EBUSY); + goto out; + } + zv->zv_flags |= ZVOL_EXCL; + } +#endif + + zv->zv_total_opens++; + mutex_exit(&spa_namespace_lock); + return (err); +out: + if (zv->zv_total_opens == 0) + zvol_last_close(zv); + mutex_exit(&spa_namespace_lock); + return (err); +} + +static int +zvol_d_close(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + zvol_state_t *zv; + int err = 0; + + mutex_enter(&spa_namespace_lock); + zv = dev->si_drv2; + if (zv == NULL) { + mutex_exit(&spa_namespace_lock); + return(ENXIO); + } + + if (zv->zv_flags & ZVOL_EXCL) { + ASSERT(zv->zv_total_opens == 1); + zv->zv_flags &= ~ZVOL_EXCL; + } + + /* + * If the open count is zero, this is a spurious close. + * That indicates a bug in the kernel / DDI framework. + */ + ASSERT(zv->zv_total_opens != 0); + + /* + * You may get multiple opens, but only one close. + */ + zv->zv_total_opens--; + + if (zv->zv_total_opens == 0) + zvol_last_close(zv); + + mutex_exit(&spa_namespace_lock); + return (0); +} + +static int +zvol_d_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) +{ + zvol_state_t *zv; + rl_t *rl; + off_t offset, length, chunk; + int i, error; + u_int u; + + zv = dev->si_drv2; + + error = 0; + KASSERT(zv->zv_total_opens > 0, + ("Device with zero access count in zvol_d_ioctl")); + + i = IOCPARM_LEN(cmd); + switch (cmd) { + case DIOCGSECTORSIZE: + *(u_int *)data = DEV_BSIZE; + break; + case DIOCGMEDIASIZE: + *(off_t *)data = zv->zv_volsize; + break; + case DIOCGFLUSH: + zil_commit(zv->zv_zilog, ZVOL_OBJ); + break; + case DIOCGDELETE: + offset = ((off_t *)data)[0]; + length = ((off_t *)data)[1]; + if ((offset % DEV_BSIZE) != 0 || (length % DEV_BSIZE) != 0 || + offset < 0 || offset >= zv->zv_volsize || + length <= 0) { + printf("%s: offset=%jd length=%jd\n", __func__, offset, + length); + error = EINVAL; + break; + } + + rl = zfs_range_lock(&zv->zv_znode, offset, length, RL_WRITER); + dmu_tx_t *tx = dmu_tx_create(zv->zv_objset); + error = dmu_tx_assign(tx, TXG_WAIT); + if (error != 0) { + dmu_tx_abort(tx); + } else { + zvol_log_truncate(zv, tx, offset, length, B_TRUE); + dmu_tx_commit(tx); + error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, + offset, length); + } + zfs_range_unlock(rl); + if (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS) + zil_commit(zv->zv_zilog, ZVOL_OBJ); + break; + case DIOCGSTRIPESIZE: + *(off_t *)data = zv->zv_volblocksize; + break; + case DIOCGSTRIPEOFFSET: + *(off_t *)data = 0; + break; + default: + error = ENOIOCTL; + } + + return (error); +} Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu May 8 13:10:39 2014 (r265677) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu May 8 13:12:24 2014 (r265678) @@ -145,6 +145,7 @@ typedef enum { ZFS_PROP_LOGICALUSED, ZFS_PROP_LOGICALREFERENCED, ZFS_PROP_INCONSISTENT, /* not exposed to the user */ + ZFS_PROP_VOLMODE, ZFS_NUM_PROPS } zfs_prop_t; @@ -337,6 +338,12 @@ typedef enum { ZFS_SYNC_DISABLED = 2 } zfs_sync_type_t; +typedef enum { + ZFS_VOLMODE_DEFAULT = 0, + ZFS_VOLMODE_GEOM = 1, + ZFS_VOLMODE_DEV = 2, + ZFS_VOLMODE_NONE = 3 +} zfs_volmode_t; /* * On-disk version number. From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 13:31:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 64D1158C; Thu, 8 May 2014 13:31: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 51FBDFB1; Thu, 8 May 2014 13:31: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 s48DV2i0019822; Thu, 8 May 2014 13:31:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48DV2FI019821; Thu, 8 May 2014 13:31:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405081331.s48DV2FI019821@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 13:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265679 - stable/10/sys/cddl/compat/opensolaris/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 13:31:02 -0000 Author: mav Date: Thu May 8 13:31:01 2014 New Revision: 265679 URL: http://svnweb.freebsd.org/changeset/base/265679 Log: MFC r260234, r260328: Remove extra conversion to nanoseconds from ddi_get_lbolt64(). As result this uses one multiplication and shifts instead of one division and two multiplications. Modified: stable/10/sys/cddl/compat/opensolaris/sys/time.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/sys/time.h Thu May 8 13:12:24 2014 (r265678) +++ stable/10/sys/cddl/compat/opensolaris/sys/time.h Thu May 8 13:31:01 2014 (r265679) @@ -71,19 +71,9 @@ gethrtime(void) { extern int nsec_per_tick; /* nanoseconds per clock tick */ -static __inline int64_t -ddi_get_lbolt64(void) -{ - - return (gethrtime() / nsec_per_tick); -} - -static __inline clock_t -ddi_get_lbolt(void) -{ - - return (ddi_get_lbolt64()); -} +#define ddi_get_lbolt64() \ + (int64_t)(((getsbinuptime() >> 16) * hz) >> 16) +#define ddi_get_lbolt() (clock_t)ddi_get_lbolt64() #else From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 16:12:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8284C2E7; Thu, 8 May 2014 16:12: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 6F78C29D; Thu, 8 May 2014 16:12: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 s48GCdwC015746; Thu, 8 May 2014 16:12:39 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48GCd5r015745; Thu, 8 May 2014 16:12:39 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201405081612.s48GCd5r015745@svn.freebsd.org> From: Brooks Davis Date: Thu, 8 May 2014 16:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265687 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 16:12:39 -0000 Author: brooks Date: Thu May 8 16:12:38 2014 New Revision: 265687 URL: http://svnweb.freebsd.org/changeset/base/265687 Log: MFC r265201 Fix a 2038 bug. If time_t is 64-bit (i.e. isn't 32-bit) allow any value of year, not just years less than 2038. Don't bother fixing the underflow in the case of years before 1903. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: stable/10/sys/kern/subr_clock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_clock.c ============================================================================== --- stable/10/sys/kern/subr_clock.c Thu May 8 15:58:34 2014 (r265686) +++ stable/10/sys/kern/subr_clock.c Thu May 8 16:12:38 2014 (r265687) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -147,7 +148,7 @@ clock_ct_to_ts(struct clocktime *ct, str if (ct->mon < 1 || ct->mon > 12 || ct->day < 1 || ct->day > days_in_month(year, ct->mon) || ct->hour > 23 || ct->min > 59 || ct->sec > 59 || - ct->year > 2037) { /* time_t overflow */ + (sizeof(time_t) == 4 && year > 2037)) { /* time_t overflow */ if (ct_debug) printf(" = EINVAL\n"); return (EINVAL); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 18:09:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DEA97EA2; Thu, 8 May 2014 18:09: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 CAFE9F73; Thu, 8 May 2014 18:09: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 s48I9Whn083035; Thu, 8 May 2014 18:09:32 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48I9WPs083034; Thu, 8 May 2014 18:09:32 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405081809.s48I9WPs083034@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 8 May 2014 18:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265693 - stable/10/sbin/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 18:09:33 -0000 Author: melifaro Date: Thu May 8 18:09:32 2014 New Revision: 265693 URL: http://svnweb.freebsd.org/changeset/base/265693 Log: Merge r258677. Fix key lookup in ipfw(8) broken since r232865. Print warning for IPv4 address strings which are valid in inet_aton() but not valid in inet_pton(). (1) Found by: Özkan KIRIK Submitted by: Ian Smith (1) Modified: stable/10/sbin/ipfw/ipfw2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ipfw/ipfw2.c ============================================================================== --- stable/10/sbin/ipfw/ipfw2.c Thu May 8 18:06:44 2014 (r265692) +++ stable/10/sbin/ipfw/ipfw2.c Thu May 8 18:09:32 2014 (r265693) @@ -4274,13 +4274,24 @@ table_fill_xentry(char *arg, ipfw_table_ addrlen = sizeof(struct in6_addr); } else { /* Port or any other key */ - key = strtol(arg, &p, 10); /* Skip non-base 10 entries like 'fa1' */ - if (p != arg) { + key = strtol(arg, &p, 10); + if (*p == '\0') { pkey = (uint32_t *)paddr; *pkey = htonl(key); type = IPFW_TABLE_CIDR; + masklen = 32; addrlen = sizeof(uint32_t); + } else if ((p != arg) && (*p == '.')) { + /* + * Warn on IPv4 address strings + * which are "valid" for inet_aton() but not + * in inet_pton(). + * + * Typical examples: '10.5' or '10.0.0.05' + */ + errx(EX_DATAERR, + "Invalid IPv4 address: %s", arg); } } } From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 19:03:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C712A8BF; Thu, 8 May 2014 19:03: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 B37367B8; Thu, 8 May 2014 19:03: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 s48J346O037365; Thu, 8 May 2014 19:03:04 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48J34Nx037363; Thu, 8 May 2014 19:03:04 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405081903.s48J34Nx037363@svn.freebsd.org> From: Christian Brueffer Date: Thu, 8 May 2014 19:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265695 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 19:03:04 -0000 Author: brueffer Date: Thu May 8 19:03:04 2014 New Revision: 265695 URL: http://svnweb.freebsd.org/changeset/base/265695 Log: MFC: r265360 Remove stray comma. Modified: stable/10/share/man/man4/tnt4882.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/tnt4882.4 ============================================================================== --- stable/10/share/man/man4/tnt4882.4 Thu May 8 18:36:42 2014 (r265694) +++ stable/10/share/man/man4/tnt4882.4 Thu May 8 19:03:04 2014 (r265695) @@ -44,7 +44,7 @@ This chip emulates a NEC \(mcPD7210 cont interface between the host computer and the instrument bus. .Sh SEE ALSO .Xr gpib 3 , -.Xr gpib 4 , +.Xr gpib 4 .Sh HISTORY The .Nm From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 19:11:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 94A1CFAB; Thu, 8 May 2014 19:11: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 7FB2F8AC; Thu, 8 May 2014 19:11:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48JBhtG062098; Thu, 8 May 2014 19:11:43 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48JBgg8062034; Thu, 8 May 2014 19:11:42 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405081911.s48JBgg8062034@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 8 May 2014 19:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265700 - in stable/10: sbin/ipfw sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 19:11:43 -0000 Author: melifaro Date: Thu May 8 19:11:41 2014 New Revision: 265700 URL: http://svnweb.freebsd.org/changeset/base/265700 Log: Merge r258708, r258711, r260247, r261117. r258708: Check ipfw table numbers in both user and kernel space before rule addition. Found by: Saychik Pavel r258711: Simplify O_NAT opcode handling. r260247: Use rnh_matchaddr instead of rnh_lookup for longest-prefix match. rnh_lookup is effectively the same as rnh_matchaddr if called with empy network mask. r261117: Reorder struct ip_fw_chain: * move rarely-used fields down * move uh_lock to different cacheline * remove some usused fields Modified: stable/10/sbin/ipfw/ipfw2.c stable/10/sbin/ipfw/ipfw2.h stable/10/sys/netpfil/ipfw/ip_fw2.c stable/10/sys/netpfil/ipfw/ip_fw_private.h stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c stable/10/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ipfw/ipfw2.c ============================================================================== --- stable/10/sbin/ipfw/ipfw2.c Thu May 8 19:11:14 2014 (r265699) +++ stable/10/sbin/ipfw/ipfw2.c Thu May 8 19:11:41 2014 (r265700) @@ -60,6 +60,8 @@ int resvd_set_number = RESVD_SET; int ipfw_socket = -1; +uint32_t ipfw_tables_max = 0; /* Number of tables supported by kernel */ + #ifndef s6_addr32 #define s6_addr32 __u6_addr.__u6_addr32 #endif @@ -2203,6 +2205,7 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int { int len = 0; uint32_t *d = ((ipfw_insn_u32 *)cmd)->d; + uint32_t tables_max; cmd->o.len &= ~F_LEN_MASK; /* zero len */ @@ -2221,6 +2224,10 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int *p++ = '\0'; cmd->o.opcode = O_IP_DST_LOOKUP; cmd->o.arg1 = strtoul(av + 6, NULL, 0); + tables_max = ipfw_get_tables_max(); + if (cmd->o.arg1 > tables_max) + errx(EX_USAGE, "The table number exceeds the maximum " + "allowed value (%u)", tables_max - 1); if (p) { cmd->o.len |= F_INSN_SIZE(ipfw_insn_u32); d[0] = strtoul(p, NULL, 0); @@ -4119,6 +4126,33 @@ static void table_list(uint16_t num, int static void table_fill_xentry(char *arg, ipfw_table_xentry *xent); /* + * Retrieve maximum number of tables supported by ipfw(4) module. + */ +uint32_t +ipfw_get_tables_max() +{ + size_t len; + uint32_t tables_max; + + if (ipfw_tables_max != 0) + return (ipfw_tables_max); + + len = sizeof(tables_max); + if (sysctlbyname("net.inet.ip.fw.tables_max", &tables_max, &len, + NULL, 0) == -1) { + if (co.test_only) + tables_max = 128; /* Old conservative default */ + else + errx(1, "Can't determine maximum number of ipfw tables." + " Perhaps you forgot to load ipfw module?"); + } + + ipfw_tables_max = tables_max; + + return (ipfw_tables_max); +} + +/* * This one handles all table-related commands * ipfw table N add addr[/masklen] [value] * ipfw table N delete addr[/masklen] @@ -4131,19 +4165,10 @@ ipfw_table_handler(int ac, char *av[]) ipfw_table_xentry xent; int do_add; int is_all; - size_t len; uint32_t a; uint32_t tables_max; - len = sizeof(tables_max); - if (sysctlbyname("net.inet.ip.fw.tables_max", &tables_max, &len, - NULL, 0) == -1) { - if (co.test_only) - tables_max = 128; /* Old conservative default */ - else - errx(1, "Can't determine maximum number of ipfw tables." - " Perhaps you forgot to load ipfw module?"); - } + tables_max = ipfw_get_tables_max(); memset(&xent, 0, sizeof(xent)); Modified: stable/10/sbin/ipfw/ipfw2.h ============================================================================== --- stable/10/sbin/ipfw/ipfw2.h Thu May 8 19:11:14 2014 (r265699) +++ stable/10/sbin/ipfw/ipfw2.h Thu May 8 19:11:41 2014 (r265700) @@ -228,6 +228,8 @@ char const *match_value(struct _s_x *p, int do_cmd(int optname, void *optval, uintptr_t optlen); +uint32_t ipfw_get_tables_max(void); + struct in6_addr; void n2mask(struct in6_addr *mask, int n); int contigmask(uint8_t *p, int len); Modified: stable/10/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw2.c Thu May 8 19:11:14 2014 (r265699) +++ stable/10/sys/netpfil/ipfw/ip_fw2.c Thu May 8 19:11:41 2014 (r265700) @@ -2404,38 +2404,35 @@ do { \ } case O_NAT: + l = 0; /* exit inner loop */ + done = 1; /* exit outer loop */ if (!IPFW_NAT_LOADED) { retval = IP_FW_DENY; - } else { - struct cfg_nat *t; - int nat_id; + break; + } - set_match(args, f_pos, chain); - /* Check if this is 'global' nat rule */ - if (cmd->arg1 == 0) { - retval = ipfw_nat_ptr(args, NULL, m); - l = 0; - done = 1; - break; - } - t = ((ipfw_insn_nat *)cmd)->nat; - if (t == NULL) { + struct cfg_nat *t; + int nat_id; + + set_match(args, f_pos, chain); + /* Check if this is 'global' nat rule */ + if (cmd->arg1 == 0) { + retval = ipfw_nat_ptr(args, NULL, m); + break; + } + t = ((ipfw_insn_nat *)cmd)->nat; + if (t == NULL) { nat_id = IP_FW_ARG_TABLEARG(cmd->arg1); t = (*lookup_nat_ptr)(&chain->nat, nat_id); if (t == NULL) { retval = IP_FW_DENY; - l = 0; /* exit inner loop */ - done = 1; /* exit outer loop */ break; } if (cmd->arg1 != IP_FW_TABLEARG) ((ipfw_insn_nat *)cmd)->nat = t; - } - retval = ipfw_nat_ptr(args, t, m); } - l = 0; /* exit inner loop */ - done = 1; /* exit outer loop */ + retval = ipfw_nat_ptr(args, t, m); break; case O_REASS: { @@ -2660,7 +2657,7 @@ vnet_ipfw_init(const void *unused) rule->set = RESVD_SET; rule->cmd[0].len = 1; rule->cmd[0].opcode = default_to_accept ? O_ACCEPT : O_DENY; - chain->rules = chain->default_rule = chain->map[0] = rule; + chain->default_rule = chain->map[0] = rule; chain->id = rule->id = 1; IPFW_LOCK_INIT(chain); Modified: stable/10/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_private.h Thu May 8 19:11:14 2014 (r265699) +++ stable/10/sys/netpfil/ipfw/ip_fw_private.h Thu May 8 19:11:41 2014 (r265700) @@ -213,25 +213,27 @@ VNET_DECLARE(unsigned int, fw_tables_max #define V_fw_tables_max VNET(fw_tables_max) struct ip_fw_chain { - struct ip_fw *rules; /* list of rules */ - struct ip_fw *reap; /* list of rules to reap */ - struct ip_fw *default_rule; - int n_rules; /* number of static rules */ - int static_len; /* total len of static rules */ struct ip_fw **map; /* array of rule ptrs to ease lookup */ + uint32_t id; /* ruleset id */ + int n_rules; /* number of static rules */ LIST_HEAD(nat_list, cfg_nat) nat; /* list of nat entries */ struct radix_node_head **tables; /* IPv4 tables */ struct radix_node_head **xtables; /* extended tables */ uint8_t *tabletype; /* Array of table types */ #if defined( __linux__ ) || defined( _WIN32 ) spinlock_t rwmtx; - spinlock_t uh_lock; #else struct rwlock rwmtx; +#endif + int static_len; /* total len of static rules */ + uint32_t gencnt; /* NAT generation count */ + struct ip_fw *reap; /* list of rules to reap */ + struct ip_fw *default_rule; +#if defined( __linux__ ) || defined( _WIN32 ) + spinlock_t uh_lock; +#else struct rwlock uh_lock; /* lock for upper half */ #endif - uint32_t id; /* ruleset id */ - uint32_t gencnt; /* generation count */ }; struct sockopt; /* used by tcp_var.h */ Modified: stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c Thu May 8 19:11:14 2014 (r265699) +++ stable/10/sys/netpfil/ipfw/ip_fw_sockopt.c Thu May 8 19:11:41 2014 (r265700) @@ -159,7 +159,7 @@ ipfw_add_rule(struct ip_fw_chain *chain, int i, l, insert_before; struct ip_fw **map; /* the new array of pointers */ - if (chain->rules == NULL || input_rule->rulenum > IPFW_DEFAULT_RULE-1) + if (chain->map == NULL || input_rule->rulenum > IPFW_DEFAULT_RULE - 1) return (EINVAL); l = RULESIZE(input_rule); @@ -653,7 +653,7 @@ check_ipfw_struct(struct ip_fw *rule, in case O_IP_SRC_LOOKUP: case O_IP_DST_LOOKUP: - if (cmd->arg1 >= IPFW_TABLES_MAX) { + if (cmd->arg1 >= V_fw_tables_max) { printf("ipfw: invalid table number %d\n", cmd->arg1); return (EINVAL); Modified: stable/10/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_table.c Thu May 8 19:11:14 2014 (r265699) +++ stable/10/sys/netpfil/ipfw/ip_fw_table.c Thu May 8 19:11:41 2014 (r265700) @@ -544,7 +544,7 @@ ipfw_lookup_table(struct ip_fw_chain *ch return (0); KEY_LEN(sa) = KEY_LEN_INET; sa.sin_addr.s_addr = addr; - ent = (struct table_entry *)(rnh->rnh_lookup(&sa, NULL, rnh)); + ent = (struct table_entry *)(rnh->rnh_matchaddr(&sa, rnh)); if (ent != NULL) { *val = ent->value; return (1); @@ -570,7 +570,7 @@ ipfw_lookup_table_extended(struct ip_fw_ case IPFW_TABLE_CIDR: KEY_LEN(sa6) = KEY_LEN_INET6; memcpy(&sa6.sin6_addr, paddr, sizeof(struct in6_addr)); - xent = (struct table_xentry *)(rnh->rnh_lookup(&sa6, NULL, rnh)); + xent = (struct table_xentry *)(rnh->rnh_matchaddr(&sa6, rnh)); break; case IPFW_TABLE_INTERFACE: @@ -578,7 +578,7 @@ ipfw_lookup_table_extended(struct ip_fw_ strlcpy(iface.ifname, (char *)paddr, IF_NAMESIZE) + 1; /* Assume direct match */ /* FIXME: Add interface pattern matching */ - xent = (struct table_xentry *)(rnh->rnh_lookup(&iface, NULL, rnh)); + xent = (struct table_xentry *)(rnh->rnh_matchaddr(&iface, rnh)); break; default: From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 19:35:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A87EE721; Thu, 8 May 2014 19:35: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 89AE6AB0; Thu, 8 May 2014 19:35: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 s48JZDnD029201; Thu, 8 May 2014 19:35:13 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48JZCL9029165; Thu, 8 May 2014 19:35:12 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405081935.s48JZCL9029165@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 8 May 2014 19:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265701 - in stable/10: sbin/route usr.bin/netstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 19:35:13 -0000 Author: melifaro Date: Thu May 8 19:35:12 2014 New Revision: 265701 URL: http://svnweb.freebsd.org/changeset/base/265701 Log: Merge r260524,r260540 r260524: Add -4/-6 shorthand for -finet/-finet6 in route(8) and netstat(8). r260540: Bump dates in nestat(1) and route(8) man pages. Fix several small errors introduced by r260524. Suggested by: glebius Modified: stable/10/sbin/route/keywords stable/10/sbin/route/route.8 stable/10/sbin/route/route.c stable/10/usr.bin/netstat/main.c stable/10/usr.bin/netstat/netstat.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/route/keywords ============================================================================== --- stable/10/sbin/route/keywords Thu May 8 19:11:41 2014 (r265700) +++ stable/10/sbin/route/keywords Thu May 8 19:35:12 2014 (r265701) @@ -1,6 +1,8 @@ # @(#)keywords 8.2 (Berkeley) 3/19/94 # $FreeBSD$ +4 +6 add atalk blackhole Modified: stable/10/sbin/route/route.8 ============================================================================== --- stable/10/sbin/route/route.8 Thu May 8 19:11:41 2014 (r265700) +++ stable/10/sbin/route/route.8 Thu May 8 19:35:12 2014 (r265701) @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd November 17, 2012 +.Dd May 8, 2014 .Dt ROUTE 8 .Os .Sh NAME @@ -62,6 +62,14 @@ programmatic interface discussed in .Pp The following options are available: .Bl -tag -width indent +.It Fl 4 +Specify +.Cm inet +address family as family hint for subcommands. +.It Fl 6 +Specify +.Cm inet +address family as family hint for subcommands. .It Fl d Run in debug-only mode, i.e., do not actually modify the routing table. .It Fl n @@ -142,6 +150,15 @@ or .Fl inet modifiers, only routes having destinations with addresses in the delineated family will be deleted. +Additionally, +.Fl 4 +or +.Fl 6 +can be used as aliases for +.Fl inet +and +.Fl inet6 +modifiers. When a .Fl fib option is specified, the operation will be applied to Modified: stable/10/sbin/route/route.c ============================================================================== --- stable/10/sbin/route/route.c Thu May 8 19:11:41 2014 (r265700) +++ stable/10/sbin/route/route.c Thu May 8 19:35:12 2014 (r265701) @@ -140,7 +140,7 @@ usage(const char *cp) { if (cp != NULL) warnx("bad keyword: %s", cp); - errx(EX_USAGE, "usage: route [-dnqtv] command [[modifiers] args]"); + errx(EX_USAGE, "usage: route [-46dnqtv] command [[modifiers] args]"); /* NOTREACHED */ } @@ -153,8 +153,24 @@ main(int argc, char **argv) if (argc < 2) usage(NULL); - while ((ch = getopt(argc, argv, "nqdtv")) != -1) + while ((ch = getopt(argc, argv, "46nqdtv")) != -1) switch(ch) { + case '4': +#ifdef INET + af = AF_INET; + aflen = sizeof(struct sockaddr_in); +#else + errx(1, "IPv4 support is not compiled in"); +#endif + break; + case '6': +#ifdef INET6 + af = AF_INET6; + aflen = sizeof(struct sockaddr_in6); +#else + errx(1, "IPv6 support is not compiled in"); +#endif + break; case 'n': nflag = 1; break; @@ -368,11 +384,13 @@ flushroutes(int argc, char *argv[]) usage(*argv); switch (keyword(*argv + 1)) { #ifdef INET + case K_4: case K_INET: af = AF_INET; break; #endif #ifdef INET6 + case K_6: case K_INET6: af = AF_INET6; break; @@ -780,12 +798,14 @@ newroute(int argc, char **argv) aflen = sizeof(struct sockaddr_dl); break; #ifdef INET + case K_4: case K_INET: af = AF_INET; aflen = sizeof(struct sockaddr_in); break; #endif #ifdef INET6 + case K_6: case K_INET6: af = AF_INET6; aflen = sizeof(struct sockaddr_in6); Modified: stable/10/usr.bin/netstat/main.c ============================================================================== --- stable/10/usr.bin/netstat/main.c Thu May 8 19:11:41 2014 (r265700) +++ stable/10/usr.bin/netstat/main.c Thu May 8 19:35:12 2014 (r265701) @@ -350,9 +350,23 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "AaBbdF:f:ghI:iLlM:mN:np:Qq:rSTsuWw:xz")) + while ((ch = getopt(argc, argv, "46AaBbdF:f:ghI:iLlM:mN:np:Qq:rSTsuWw:xz")) != -1) switch(ch) { + case '4': +#ifdef INET + af = AF_INET; +#else + errx(1, "IPv4 support is not compiled in"); +#endif + break; + case '6': +#ifdef INET6 + af = AF_INET6; +#else + errx(1, "IPv6 support is not compiled in"); +#endif + break; case 'A': Aflag = 1; break; @@ -850,21 +864,21 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: netstat [-AaLnSTWx] [-f protocol_family | -p protocol]\n" +"usage: netstat [-46AaLnSTWx] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", -" netstat -i | -I interface [-abdhnW] [-f address_family]\n" +" netstat -i | -I interface [-46abdhnW] [-f address_family]\n" " [-M core] [-N system]", -" netstat -w wait [-I interface] [-d] [-M core] [-N system] [-q howmany]", -" netstat -s [-s] [-z] [-f protocol_family | -p protocol]\n" +" netstat -w wait [-I interface] [-46d] [-M core] [-N system] [-q howmany]", +" netstat -s [-s] [-46z] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", -" netstat -i | -I interface -s [-f protocol_family | -p protocol]\n" +" netstat -i | -I interface [-46s] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -m [-M core] [-N system]", " netstat -B [-I interface]", -" netstat -r [-AanW] [-f address_family] [-M core] [-N system]", +" netstat -r [-46AanW] [-f address_family] [-M core] [-N system]", " netstat -rs [-s] [-M core] [-N system]", -" netstat -g [-W] [-f address_family] [-M core] [-N system]", -" netstat -gs [-s] [-f address_family] [-M core] [-N system]", +" netstat -g [-46W] [-f address_family] [-M core] [-N system]", +" netstat -gs [-46s] [-f address_family] [-M core] [-N system]", " netstat -Q"); exit(1); } Modified: stable/10/usr.bin/netstat/netstat.1 ============================================================================== --- stable/10/usr.bin/netstat/netstat.1 Thu May 8 19:11:41 2014 (r265700) +++ stable/10/usr.bin/netstat/netstat.1 Thu May 8 19:35:12 2014 (r265701) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 15, 2013 +.Dd January 11, 2014 .Dt NETSTAT 1 .Os .Sh NAME @@ -45,7 +45,7 @@ depending on the options for the informa .It Xo .Bk -words .Nm -.Op Fl AaLnSTWx +.Op Fl 46AaLnSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -92,7 +92,7 @@ retransmits, out-of-order packets receiv .Bk -words .Nm .Fl i | I Ar interface -.Op Fl abdhnW +.Op Fl 46abdhnW .Op Fl f Ar address_family .Ek .Xc @@ -153,7 +153,7 @@ is also present, show the number of drop .Bk -words .Nm .Fl s Op Fl s -.Op Fl z +.Op Fl 46z .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -174,6 +174,7 @@ is also present, reset statistic counter .Bk -words .Nm .Fl i | I Ar interface Fl s +.Op Fl 46 .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -214,7 +215,7 @@ states. .Bk -words .Nm .Fl r -.Op Fl AanW +.Op Fl 46AanW .Op Fl F Ar fibnum .Op Fl f Ar address_family .Op Fl M Ar core @@ -268,7 +269,7 @@ is repeated, counters with a value of ze .Bk -words .Nm .Fl g -.Op Fl W +.Op Fl 46W .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system @@ -287,7 +288,7 @@ address families. .Bk -words .Nm .Fl gs -.Op Fl s +.Op Fl 46s .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system @@ -316,6 +317,14 @@ The flags field shows available ISR hand .Pp Some options have the general meaning: .Bl -tag -width flag +.It Fl 4 +Is shorthand for +.Fl f +.Ar inet +.It Fl 6 +Is shorthand for +.Fl f +.Ar inet6 .It Fl f Ar address_family , Fl p Ar protocol Limit display to those records of the specified From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 20:27:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EF713421; Thu, 8 May 2014 20:27:07 +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 DAEE2F81; Thu, 8 May 2014 20:27:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48KR7qM072533; Thu, 8 May 2014 20:27:07 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48KR7es072488; Thu, 8 May 2014 20:27:07 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405082027.s48KR7es072488@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 8 May 2014 20:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265708 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:27:08 -0000 Author: melifaro Date: Thu May 8 20:27:06 2014 New Revision: 265708 URL: http://svnweb.freebsd.org/changeset/base/265708 Log: Merge r259528, r259528, r260295. r259528: Simplify contiguous mask checking. Suggested by: glebius r260228: Remove useless register variable modifiers. Do some more style(9). r260295: Change semantics for rnh_lookup() function: now it performs exact match search, regardless of netmask existance. This simplifies most of rnh_lookup() consumers. Fix panic triggered by deleting non-existent host route. PR: kern/185092 Submitted by: Nikolay Denev Modified: stable/10/sys/net/radix.c stable/10/sys/net/radix.h stable/10/sys/net/radix_mpath.c stable/10/sys/net/route.c stable/10/sys/net/rtsock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/radix.c ============================================================================== --- stable/10/sys/net/radix.c Thu May 8 20:24:13 2014 (r265707) +++ stable/10/sys/net/radix.c Thu May 8 20:27:06 2014 (r265708) @@ -156,12 +156,10 @@ static int rn_satisfies_leaf(char *trial * Search a node in the tree matching the key. */ static struct radix_node * -rn_search(v_arg, head) - void *v_arg; - struct radix_node *head; +rn_search(void *v_arg, struct radix_node *head) { - register struct radix_node *x; - register caddr_t v; + struct radix_node *x; + caddr_t v; for (x = head, v = v_arg; x->rn_bit >= 0;) { if (x->rn_bmask & v[x->rn_offset]) @@ -177,12 +175,10 @@ rn_search(v_arg, head) * XXX note this function is used only once. */ static struct radix_node * -rn_search_m(v_arg, head, m_arg) - struct radix_node *head; - void *v_arg, *m_arg; +rn_search_m(void *v_arg, struct radix_node *head, void *m_arg) { - register struct radix_node *x; - register caddr_t v = v_arg, m = m_arg; + struct radix_node *x; + caddr_t v = v_arg, m = m_arg; for (x = head; x->rn_bit >= 0;) { if ((x->rn_bmask & m[x->rn_offset]) && @@ -191,15 +187,14 @@ rn_search_m(v_arg, head, m_arg) else x = x->rn_left; } - return x; + return (x); } int -rn_refines(m_arg, n_arg) - void *m_arg, *n_arg; +rn_refines(void *m_arg, void *n_arg) { - register caddr_t m = m_arg, n = n_arg; - register caddr_t lim, lim2 = lim = n + LEN(n); + caddr_t m = m_arg, n = n_arg; + caddr_t lim, lim2 = lim = n + LEN(n); int longer = LEN(n++) - LEN(m++); int masks_are_equal = 1; @@ -207,50 +202,71 @@ rn_refines(m_arg, n_arg) lim -= longer; while (n < lim) { if (*n & ~(*m)) - return 0; + return (0); if (*n++ != *m++) masks_are_equal = 0; } while (n < lim2) if (*n++) - return 0; + return (0); if (masks_are_equal && (longer < 0)) for (lim2 = m - longer; m < lim2; ) if (*m++) - return 1; + return (1); return (!masks_are_equal); } +/* + * Search for exact match in given @head. + * Assume host bits are cleared in @v_arg if @m_arg is not NULL + * Note that prefixes with /32 or /128 masks are treated differently + * from host routes. + */ struct radix_node * -rn_lookup(v_arg, m_arg, head) - void *v_arg, *m_arg; - struct radix_node_head *head; +rn_lookup(void *v_arg, void *m_arg, struct radix_node_head *head) { - register struct radix_node *x; - caddr_t netmask = 0; + struct radix_node *x; + caddr_t netmask; - if (m_arg) { + if (m_arg != NULL) { + /* + * Most common case: search exact prefix/mask + */ x = rn_addmask_r(m_arg, head->rnh_masks, 1, head->rnh_treetop->rn_offset); - if (x == 0) - return (0); + if (x == NULL) + return (NULL); netmask = x->rn_key; - } - x = rn_match(v_arg, head); - if (x && netmask) { - while (x && x->rn_mask != netmask) + + x = rn_match(v_arg, head); + + while (x != NULL && x->rn_mask != netmask) x = x->rn_dupedkey; + + return (x); } - return x; + + /* + * Search for host address. + */ + if ((x = rn_match(v_arg, head)) == NULL) + return (NULL); + + /* Check if found key is the same */ + if (LEN(x->rn_key) != LEN(v_arg) || bcmp(x->rn_key, v_arg, LEN(v_arg))) + return (NULL); + + /* Check if this is not host route */ + if (x->rn_mask != NULL) + return (NULL); + + return (x); } static int -rn_satisfies_leaf(trial, leaf, skip) - char *trial; - register struct radix_node *leaf; - int skip; +rn_satisfies_leaf(char *trial, struct radix_node *leaf, int skip) { - register char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask; + char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask; char *cplim; int length = min(LEN(cp), LEN(cp2)); @@ -261,22 +277,23 @@ rn_satisfies_leaf(trial, leaf, skip) cplim = cp + length; cp3 += skip; cp2 += skip; for (cp += skip; cp < cplim; cp++, cp2++, cp3++) if ((*cp ^ *cp2) & *cp3) - return 0; - return 1; + return (0); + return (1); } +/* + * Search for longest-prefix match in given @head + */ struct radix_node * -rn_match(v_arg, head) - void *v_arg; - struct radix_node_head *head; +rn_match(void *v_arg, struct radix_node_head *head) { caddr_t v = v_arg; - register struct radix_node *t = head->rnh_treetop, *x; - register caddr_t cp = v, cp2; + struct radix_node *t = head->rnh_treetop, *x; + caddr_t cp = v, cp2; caddr_t cplim; struct radix_node *saved_t, *top = t; int off = t->rn_offset, vlen = LEN(cp), matched_off; - register int test, b, rn_bit; + int test, b, rn_bit; /* * Open code rn_search(v, top) to avoid overhead of extra @@ -314,7 +331,7 @@ rn_match(v_arg, head) */ if (t->rn_flags & RNF_ROOT) t = t->rn_dupedkey; - return t; + return (t); on1: test = (*cp ^ *cp2) & 0xff; /* find first bit that differs */ for (b = 7; (test >>= 1) > 0;) @@ -335,13 +352,13 @@ on1: */ if (t->rn_flags & RNF_NORMAL) { if (rn_bit <= t->rn_bit) - return t; + return (t); } else if (rn_satisfies_leaf(v, t, matched_off)) - return t; + return (t); t = saved_t; /* start searching up the tree */ do { - register struct radix_mask *m; + struct radix_mask *m; t = t->rn_parent; m = t->rn_mklist; /* @@ -360,12 +377,12 @@ on1: while (x && x->rn_mask != m->rm_mask) x = x->rn_dupedkey; if (x && rn_satisfies_leaf(v, x, off)) - return x; + return (x); } m = m->rm_mklist; } } while (t != top); - return 0; + return (0); } #ifdef RN_DEBUG @@ -387,12 +404,9 @@ int rn_debug = 1; */ static struct radix_node * -rn_newpair(v, b, nodes) - void *v; - int b; - struct radix_node nodes[2]; +rn_newpair(void *v, int b, struct radix_node nodes[2]) { - register struct radix_node *tt = nodes, *t = tt + 1; + struct radix_node *tt = nodes, *t = tt + 1; t->rn_bit = b; t->rn_bmask = 0x80 >> (b & 7); t->rn_left = tt; @@ -416,44 +430,39 @@ rn_newpair(v, b, nodes) tt->rn_ybro = rn_clist; rn_clist = tt; #endif - return t; + return (t); } static struct radix_node * -rn_insert(v_arg, head, dupentry, nodes) - void *v_arg; - struct radix_node_head *head; - int *dupentry; - struct radix_node nodes[2]; +rn_insert(void *v_arg, struct radix_node_head *head, int *dupentry, + struct radix_node nodes[2]) { caddr_t v = v_arg; struct radix_node *top = head->rnh_treetop; int head_off = top->rn_offset, vlen = LEN(v); - register struct radix_node *t = rn_search(v_arg, top); - register caddr_t cp = v + head_off; - register int b; - struct radix_node *tt; + struct radix_node *t = rn_search(v_arg, top); + caddr_t cp = v + head_off; + int b; + struct radix_node *p, *tt, *x; /* * Find first bit at which v and t->rn_key differ */ - { - register caddr_t cp2 = t->rn_key + head_off; - register int cmp_res; + caddr_t cp2 = t->rn_key + head_off; + int cmp_res; caddr_t cplim = v + vlen; while (cp < cplim) if (*cp2++ != *cp++) goto on1; *dupentry = 1; - return t; + return (t); on1: *dupentry = 0; cmp_res = (cp[-1] ^ cp2[-1]) & 0xff; for (b = (cp - v) << 3; cmp_res; b--) cmp_res >>= 1; - } - { - register struct radix_node *p, *x = top; + + x = top; cp = v; do { p = x; @@ -485,20 +494,19 @@ on1: if (rn_debug) log(LOG_DEBUG, "rn_insert: Coming Out:\n"), traverse(p); #endif - } return (tt); } struct radix_node * rn_addmask_r(void *arg, struct radix_node_head *maskhead, int search, int skip) { - caddr_t netmask = (caddr_t)arg; - register struct radix_node *x; - register caddr_t cp, cplim; - register int b = 0, mlen, j; + unsigned char *netmask = arg; + unsigned char *cp, *cplim; + struct radix_node *x; + int b = 0, mlen, j; int maskduplicated, isnormal; struct radix_node *saved_x; - char addmask_key[RADIX_MAX_KEY_LEN]; + unsigned char addmask_key[RADIX_MAX_KEY_LEN]; if ((mlen = LEN(netmask)) > RADIX_MAX_KEY_LEN) mlen = RADIX_MAX_KEY_LEN; @@ -540,20 +548,18 @@ rn_addmask_r(void *arg, struct radix_nod * Calculate index of mask, and check for normalcy. * First find the first byte with a 0 bit, then if there are * more bits left (remember we already trimmed the trailing 0's), - * the pattern must be one of those in normal_chars[], or we have + * the bits should be contiguous, otherwise we have got * a non-contiguous mask. */ +#define CONTIG(_c) (((~(_c) + 1) & (_c)) == (unsigned char)(~(_c) + 1)) cplim = netmask + mlen; isnormal = 1; for (cp = netmask + skip; (cp < cplim) && *(u_char *)cp == 0xff;) cp++; if (cp != cplim) { - static char normal_chars[] = { - 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff}; - for (j = 0x80; (j & *cp) != 0; j >>= 1) b++; - if (*cp != normal_chars[b] || cp != (cplim - 1)) + if (!CONTIG(*cp) || cp != (cplim - 1)) isnormal = 0; } b += (cp - netmask) << 3; @@ -581,29 +587,26 @@ rn_addmask(void *n_arg, int search, int } static int /* XXX: arbitrary ordering for non-contiguous masks */ -rn_lexobetter(m_arg, n_arg) - void *m_arg, *n_arg; +rn_lexobetter(void *m_arg, void *n_arg) { - register u_char *mp = m_arg, *np = n_arg, *lim; + u_char *mp = m_arg, *np = n_arg, *lim; if (LEN(mp) > LEN(np)) - return 1; /* not really, but need to check longer one first */ + return (1); /* not really, but need to check longer one first */ if (LEN(mp) == LEN(np)) for (lim = mp + LEN(mp); mp < lim;) if (*mp++ > *np++) - return 1; - return 0; + return (1); + return (0); } static struct radix_mask * -rn_new_radix_mask(tt, next) - register struct radix_node *tt; - register struct radix_mask *next; +rn_new_radix_mask(struct radix_node *tt, struct radix_mask *next) { - register struct radix_mask *m; + struct radix_mask *m; R_Malloc(m, struct radix_mask *, sizeof (struct radix_mask)); - if (m == 0) { + if (m == NULL) { log(LOG_ERR, "Failed to allocate route mask\n"); return (0); } @@ -616,17 +619,15 @@ rn_new_radix_mask(tt, next) m->rm_mask = tt->rn_mask; m->rm_mklist = next; tt->rn_mklist = m; - return m; + return (m); } struct radix_node * -rn_addroute(v_arg, n_arg, head, treenodes) - void *v_arg, *n_arg; - struct radix_node_head *head; - struct radix_node treenodes[2]; +rn_addroute(void *v_arg, void *n_arg, struct radix_node_head *head, + struct radix_node treenodes[2]) { caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg; - register struct radix_node *t, *x = 0, *tt; + struct radix_node *t, *x = 0, *tt; struct radix_node *saved_tt, *top = head->rnh_treetop; short b = 0, b_leaf = 0; int keyduplicated; @@ -754,7 +755,7 @@ rn_addroute(v_arg, n_arg, head, treenode on2: /* Add new route to highest possible ancestor's list */ if ((netmask == 0) || (b > t->rn_bit )) - return tt; /* can't lift at all */ + return (tt); /* can't lift at all */ b_leaf = tt->rn_bit; do { x = t; @@ -778,29 +779,27 @@ on2: log(LOG_ERR, "Non-unique normal route, mask not entered\n"); #endif - return tt; + return (tt); } } else mmask = m->rm_mask; if (mmask == netmask) { m->rm_refs++; tt->rn_mklist = m; - return tt; + return (tt); } if (rn_refines(netmask, mmask) || rn_lexobetter(netmask, mmask)) break; } *mp = rn_new_radix_mask(tt, *mp); - return tt; + return (tt); } struct radix_node * -rn_delete(v_arg, netmask_arg, head) - void *v_arg, *netmask_arg; - struct radix_node_head *head; +rn_delete(void *v_arg, void *netmask_arg, struct radix_node_head *head) { - register struct radix_node *t, *p, *x, *tt; + struct radix_node *t, *p, *x, *tt; struct radix_mask *m, *saved_m, **mp; struct radix_node *dupedkey, *saved_tt, *top; caddr_t v, netmask; @@ -834,7 +833,7 @@ rn_delete(v_arg, netmask_arg, head) if (tt->rn_flags & RNF_NORMAL) { if (m->rm_leaf != tt || m->rm_refs > 0) { log(LOG_ERR, "rn_delete: inconsistent annotation\n"); - return 0; /* dangling ref could cause disaster */ + return (0); /* dangling ref could cause disaster */ } } else { if (m->rm_mask != tt->rn_mask) { @@ -986,17 +985,14 @@ out: * exit. */ static int -rn_walktree_from(h, a, m, f, w) - struct radix_node_head *h; - void *a, *m; - walktree_f_t *f; - void *w; +rn_walktree_from(struct radix_node_head *h, void *a, void *m, + walktree_f_t *f, void *w) { int error; struct radix_node *base, *next; u_char *xa = (u_char *)a; u_char *xm = (u_char *)m; - register struct radix_node *rn, *last = 0 /* shut up gcc */; + struct radix_node *rn, *last = NULL; /* shut up gcc */ int stopping = 0; int lastb; @@ -1089,18 +1085,15 @@ rn_walktree_from(h, a, m, f, w) } } - return 0; + return (0); } static int -rn_walktree(h, f, w) - struct radix_node_head *h; - walktree_f_t *f; - void *w; +rn_walktree(struct radix_node_head *h, walktree_f_t *f, void *w) { int error; struct radix_node *base, *next; - register struct radix_node *rn = h->rnh_treetop; + struct radix_node *rn = h->rnh_treetop; /* * This gets complicated because we may delete the node * while applying the function f to it, so we need to calculate @@ -1145,8 +1138,8 @@ rn_walktree(h, f, w) static int rn_inithead_internal(void **head, int off) { - register struct radix_node_head *rnh; - register struct radix_node *t, *tt, *ttt; + struct radix_node_head *rnh; + struct radix_node *t, *tt, *ttt; if (*head) return (1); R_Zalloc(rnh, struct radix_node_head *, sizeof (*rnh)); Modified: stable/10/sys/net/radix.h ============================================================================== --- stable/10/sys/net/radix.h Thu May 8 20:24:13 2014 (r265707) +++ stable/10/sys/net/radix.h Thu May 8 20:27:06 2014 (r265708) @@ -119,9 +119,9 @@ struct radix_node_head { (void *v, void *mask, struct radix_node_head *head); struct radix_node *(*rnh_delpkt) /* remove based on packet hdr */ (void *v, void *mask, struct radix_node_head *head); - struct radix_node *(*rnh_matchaddr) /* locate based on sockaddr */ + struct radix_node *(*rnh_matchaddr) /* longest match for sockaddr */ (void *v, struct radix_node_head *head); - struct radix_node *(*rnh_lookup) /* locate based on sockaddr */ + struct radix_node *(*rnh_lookup) /*exact match for sockaddr*/ (void *v, void *mask, struct radix_node_head *head); struct radix_node *(*rnh_matchpkt) /* locate based on packet hdr */ (void *v, struct radix_node_head *head); Modified: stable/10/sys/net/radix_mpath.c ============================================================================== --- stable/10/sys/net/radix_mpath.c Thu May 8 20:24:13 2014 (r265707) +++ stable/10/sys/net/radix_mpath.c Thu May 8 20:27:06 2014 (r265708) @@ -151,6 +151,7 @@ rt_mpath_deldup(struct rtentry *headrt, /* * check if we have the same key/mask/gateway on the table already. + * Assume @rt rt_key host bits are cleared according to @netmask */ int rt_mpath_conflict(struct radix_node_head *rnh, struct rtentry *rt, @@ -158,76 +159,13 @@ rt_mpath_conflict(struct radix_node_head { struct radix_node *rn, *rn1; struct rtentry *rt1; - char *p, *q, *eq; - int same, l, skip; rn = (struct radix_node *)rt; rn1 = rnh->rnh_lookup(rt_key(rt), netmask, rnh); if (!rn1 || rn1->rn_flags & RNF_ROOT) - return 0; - - /* - * unlike other functions we have in this file, we have to check - * all key/mask/gateway as rnh_lookup can match less specific entry. - */ - rt1 = (struct rtentry *)rn1; - - /* compare key. */ - if (rt_key(rt1)->sa_len != rt_key(rt)->sa_len || - bcmp(rt_key(rt1), rt_key(rt), rt_key(rt1)->sa_len)) - goto different; - - /* key was the same. compare netmask. hairy... */ - if (rt_mask(rt1) && netmask) { - skip = rnh->rnh_treetop->rn_offset; - if (rt_mask(rt1)->sa_len > netmask->sa_len) { - /* - * as rt_mask(rt1) is made optimal by radix.c, - * there must be some 1-bits on rt_mask(rt1) - * after netmask->sa_len. therefore, in - * this case, the entries are different. - */ - if (rt_mask(rt1)->sa_len > skip) - goto different; - else { - /* no bits to compare, i.e. same*/ - goto maskmatched; - } - } - - l = rt_mask(rt1)->sa_len; - if (skip > l) { - /* no bits to compare, i.e. same */ - goto maskmatched; - } - p = (char *)rt_mask(rt1); - q = (char *)netmask; - if (bcmp(p + skip, q + skip, l - skip)) - goto different; - /* - * need to go through all the bit, as netmask is not - * optimal and can contain trailing 0s - */ - eq = (char *)netmask + netmask->sa_len; - q += l; - same = 1; - while (eq > q) - if (*q++) { - same = 0; - break; - } - if (!same) - goto different; - } else if (!rt_mask(rt1) && !netmask) - ; /* no mask to compare, i.e. same */ - else { - /* one has mask and the other does not, different */ - goto different; - } - -maskmatched: + return (0); - /* key/mask were the same. compare gateway for all multipaths */ + /* key/mask are the same. compare gateway for all multipaths */ do { rt1 = (struct rtentry *)rn1; @@ -248,11 +186,10 @@ maskmatched: } /* all key/mask/gateway are the same. conflicting entry. */ - return EEXIST; + return (EEXIST); } while ((rn1 = rn_mpath_next(rn1)) != NULL); -different: - return 0; + return (0); } void Modified: stable/10/sys/net/route.c ============================================================================== --- stable/10/sys/net/route.c Thu May 8 20:24:13 2014 (r265707) +++ stable/10/sys/net/route.c Thu May 8 20:27:06 2014 (r265708) @@ -979,6 +979,57 @@ bad: return (error); } +#if 0 +int p_sockaddr(char *buf, int buflen, struct sockaddr *s); +int rt_print(char *buf, int buflen, struct rtentry *rt); + +int +p_sockaddr(char *buf, int buflen, struct sockaddr *s) +{ + void *paddr = NULL; + + switch (s->sa_family) { + case AF_INET: + paddr = &((struct sockaddr_in *)s)->sin_addr; + break; + case AF_INET6: + paddr = &((struct sockaddr_in6 *)s)->sin6_addr; + break; + } + + if (paddr == NULL) + return (0); + + if (inet_ntop(s->sa_family, paddr, buf, buflen) == NULL) + return (0); + + return (strlen(buf)); +} + +int +rt_print(char *buf, int buflen, struct rtentry *rt) +{ + struct sockaddr *addr, *mask; + int i = 0; + + addr = rt_key(rt); + mask = rt_mask(rt); + + i = p_sockaddr(buf, buflen, addr); + if (!(rt->rt_flags & RTF_HOST)) { + buf[i++] = '/'; + i += p_sockaddr(buf + i, buflen - i, mask); + } + + if (rt->rt_flags & RTF_GATEWAY) { + buf[i++] = '>'; + i += p_sockaddr(buf + i, buflen - i, rt->rt_gateway); + } + + return (i); +} +#endif + #ifdef RADIX_MPATH static int rn_mpath_update(int req, struct rt_addrinfo *info, @@ -992,10 +1043,11 @@ rn_mpath_update(int req, struct rt_addri register struct radix_node *rn; int error = 0; - rn = rnh->rnh_matchaddr(dst, rnh); + rn = rnh->rnh_lookup(dst, netmask, rnh); if (rn == NULL) return (ESRCH); rto = rt = RNTORT(rn); + rt = rt_mpath_matchgate(rt, gateway); if (rt == NULL) return (ESRCH); @@ -1555,8 +1607,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int rn = rnh->rnh_lookup(dst, netmask, rnh); error = (rn == NULL || (rn->rn_flags & RNF_ROOT) || - RNTORT(rn)->rt_ifa != ifa || - !sa_equal((struct sockaddr *)rn->rn_key, dst)); + RNTORT(rn)->rt_ifa != ifa); RADIX_NODE_HEAD_RUNLOCK(rnh); if (error) { /* this is only an error if bad on ALL tables */ Modified: stable/10/sys/net/rtsock.c ============================================================================== --- stable/10/sys/net/rtsock.c Thu May 8 20:24:13 2014 (r265707) +++ stable/10/sys/net/rtsock.c Thu May 8 20:27:06 2014 (r265708) @@ -725,10 +725,24 @@ route_output(struct mbuf *m, struct sock info.rti_info[RTAX_DST]->sa_family); if (rnh == NULL) senderr(EAFNOSUPPORT); + RADIX_NODE_HEAD_RLOCK(rnh); - rt = (struct rtentry *) rnh->rnh_lookup(info.rti_info[RTAX_DST], - info.rti_info[RTAX_NETMASK], rnh); - if (rt == NULL) { /* XXX looks bogus */ + + if (info.rti_info[RTAX_NETMASK] == NULL && + rtm->rtm_type == RTM_GET) { + /* + * Provide logest prefix match for + * address lookup (no mask). + * 'route -n get addr' + */ + rt = (struct rtentry *) rnh->rnh_matchaddr( + info.rti_info[RTAX_DST], rnh); + } else + rt = (struct rtentry *) rnh->rnh_lookup( + info.rti_info[RTAX_DST], + info.rti_info[RTAX_NETMASK], rnh); + + if (rt == NULL) { RADIX_NODE_HEAD_RUNLOCK(rnh); senderr(ESRCH); } @@ -785,25 +799,6 @@ route_output(struct mbuf *m, struct sock RT_ADDREF(rt); RADIX_NODE_HEAD_RUNLOCK(rnh); - /* - * Fix for PR: 82974 - * - * RTM_CHANGE/LOCK need a perfect match, rn_lookup() - * returns a perfect match in case a netmask is - * specified. For host routes only a longest prefix - * match is returned so it is necessary to compare the - * existence of the netmask. If both have a netmask - * rnh_lookup() did a perfect match and if none of them - * have a netmask both are host routes which is also a - * perfect match. - */ - - if (rtm->rtm_type != RTM_GET && - (!rt_mask(rt) != !info.rti_info[RTAX_NETMASK])) { - RT_UNLOCK(rt); - senderr(ESRCH); - } - switch(rtm->rtm_type) { case RTM_GET: From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 20:41:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EC2E6D51; Thu, 8 May 2014 20:41: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 CC9C8108; Thu, 8 May 2014 20:41: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 s48KfeKQ016205; Thu, 8 May 2014 20:41:40 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48Kfenn016182; Thu, 8 May 2014 20:41:40 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405082041.s48Kfenn016182@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 8 May 2014 20:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265711 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:41:41 -0000 Author: melifaro Date: Thu May 8 20:41:39 2014 New Revision: 265711 URL: http://svnweb.freebsd.org/changeset/base/265711 Log: Merge r260379, r260460. r260379: Partially fix IPv4 interface routes deletion in RADIX_MPATH. Noticed by: Nikolay Denev r260460: Constanly use RT_ALL_FIBS everywhere instead of -1. Modified: stable/10/sys/net/radix_mpath.c stable/10/sys/net/route.c stable/10/sys/net/route.h stable/10/sys/net/rtsock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/radix_mpath.c ============================================================================== --- stable/10/sys/net/radix_mpath.c Thu May 8 20:33:47 2014 (r265710) +++ stable/10/sys/net/radix_mpath.c Thu May 8 20:41:39 2014 (r265711) @@ -112,11 +112,16 @@ rt_mpath_matchgate(struct rtentry *rt, s if (rt->rt_gateway->sa_family == AF_LINK) { if (!memcmp(rt->rt_ifa->ifa_addr, gate, gate->sa_len)) break; - } else { - if (rt->rt_gateway->sa_len == gate->sa_len && - !memcmp(rt->rt_gateway, gate, gate->sa_len)) - break; } + + /* + * Check for other options: + * 1) Routes with 'real' IPv4/IPv6 gateway + * 2) Loopback host routes (another AF_LINK/sockadd_dl check) + * */ + if (rt->rt_gateway->sa_len == gate->sa_len && + !memcmp(rt->rt_gateway, gate, gate->sa_len)) + break; } while ((rn = rn_mpath_next(rn)) != NULL); return (struct rtentry *)rn; Modified: stable/10/sys/net/route.c ============================================================================== --- stable/10/sys/net/route.c Thu May 8 20:33:47 2014 (r265710) +++ stable/10/sys/net/route.c Thu May 8 20:41:39 2014 (r265711) @@ -1532,7 +1532,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int fibnum = RT_DEFAULT_FIB; break; } - if (fibnum == -1) { + if (fibnum == RT_ALL_FIBS) { if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { startfib = endfib = curthread->td_proc->p_fibnum; } else { @@ -1581,10 +1581,10 @@ rtinit1(struct ifaddr *ifa, int cmd, int /* this table doesn't exist but others might */ continue; RADIX_NODE_HEAD_RLOCK(rnh); + rn = rnh->rnh_lookup(dst, netmask, rnh); #ifdef RADIX_MPATH if (rn_mpath_capable(rnh)) { - rn = rnh->rnh_matchaddr(dst, rnh); if (rn == NULL) error = ESRCH; else { @@ -1598,13 +1598,11 @@ rtinit1(struct ifaddr *ifa, int cmd, int */ rt = rt_mpath_matchgate(rt, ifa->ifa_addr); - if (!rt) + if (rt == NULL) error = ESRCH; } } - else #endif - rn = rnh->rnh_lookup(dst, netmask, rnh); error = (rn == NULL || (rn->rn_flags & RNF_ROOT) || RNTORT(rn)->rt_ifa != ifa); @@ -1753,7 +1751,7 @@ rtinit(struct ifaddr *ifa, int cmd, int case AF_INET6: case AF_INET: /* We do support multiple FIBs. */ - fib = -1; + fib = RT_ALL_FIBS; break; } return (rtinit1(ifa, cmd, flags, fib)); Modified: stable/10/sys/net/route.h ============================================================================== --- stable/10/sys/net/route.h Thu May 8 20:33:47 2014 (r265710) +++ stable/10/sys/net/route.h Thu May 8 20:41:39 2014 (r265711) @@ -83,7 +83,8 @@ struct rt_metrics { #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ -extern u_int rt_numfibs; /* number fo usable routing tables */ +#define RT_ALL_FIBS -1 /* Announce event for every fib */ +extern u_int rt_numfibs; /* number of usable routing tables */ /* * We distinguish between routes to hosts and routes to networks, Modified: stable/10/sys/net/rtsock.c ============================================================================== --- stable/10/sys/net/rtsock.c Thu May 8 20:33:47 2014 (r265710) +++ stable/10/sys/net/rtsock.c Thu May 8 20:41:39 2014 (r265711) @@ -161,7 +161,6 @@ int (*carp_get_vhid_p)(struct ifaddr *); * notification to a socket bound to a particular FIB. */ #define RTS_FILTER_FIB M_PROTO8 -#define RTS_ALLFIBS -1 static struct { int ip_count; /* attached w/ AF_INET */ @@ -1281,7 +1280,7 @@ rt_missmsg_fib(int type, struct rt_addri if (m == NULL) return; - if (fibnum != RTS_ALLFIBS) { + if (fibnum != RT_ALL_FIBS) { KASSERT(fibnum >= 0 && fibnum < rt_numfibs, ("%s: fibnum out " "of range 0 <= %d < %d", __func__, fibnum, rt_numfibs)); M_SETFIB(m, fibnum); @@ -1299,7 +1298,7 @@ void rt_missmsg(int type, struct rt_addrinfo *rtinfo, int flags, int error) { - rt_missmsg_fib(type, rtinfo, flags, error, RTS_ALLFIBS); + rt_missmsg_fib(type, rtinfo, flags, error, RT_ALL_FIBS); } /* @@ -1395,7 +1394,7 @@ rt_newaddrmsg_fib(int cmd, struct ifaddr rtm->rtm_errno = error; rtm->rtm_addrs = info.rti_addrs; } - if (fibnum != RTS_ALLFIBS) { + if (fibnum != RT_ALL_FIBS) { KASSERT(fibnum >= 0 && fibnum < rt_numfibs, ("%s: " "fibnum out of range 0 <= %d < %d", __func__, fibnum, rt_numfibs)); @@ -1410,7 +1409,7 @@ void rt_newaddrmsg(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt) { - rt_newaddrmsg_fib(cmd, ifa, error, rt, RTS_ALLFIBS); + rt_newaddrmsg_fib(cmd, ifa, error, rt, RT_ALL_FIBS); } /* @@ -1907,7 +1906,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) if (namelen == 3) fib = req->td->td_proc->p_fibnum; else if (namelen == 4) - fib = (name[3] == -1) ? + fib = (name[3] == RT_ALL_FIBS) ? req->td->td_proc->p_fibnum : name[3]; else return ((namelen < 3) ? EISDIR : ENOTDIR); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 20:52:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DFA1A566; Thu, 8 May 2014 20:52: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 CBEF4257; Thu, 8 May 2014 20:52: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 s48KqPon046045; Thu, 8 May 2014 20:52:25 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48KqPe2046033; Thu, 8 May 2014 20:52:25 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405082052.s48KqPe2046033@svn.freebsd.org> From: Rick Macklem Date: Thu, 8 May 2014 20:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265714 - in stable/10/sys/fs: nfs nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:52:26 -0000 Author: rmacklem Date: Thu May 8 20:52:25 2014 New Revision: 265714 URL: http://svnweb.freebsd.org/changeset/base/265714 Log: MFC: r265252 The new draft specification for NFSv4.0 specifies that a server should either accept owner and owner_group strings that are just the digits of the uid/gid or return NFS4ERR_BADOWNER. This patch adds a sysctl vfs.nfsd.enable_stringtouid, which can be set to enable the server w.r.t. accepting numeric string. It also ensures that NFS4ERR_BADOWNER is returned if numeric uid/gid strings are not enabled. This fixes the server for recent Linux nfs4 clients that use numeric uid/gid strings by default. Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Thu May 8 20:47:54 2014 (r265713) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Thu May 8 20:52:25 2014 (r265714) @@ -65,6 +65,7 @@ uid_t nfsrv_defaultuid; gid_t nfsrv_defaultgid; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; +int nfsd_enable_stringtouid = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; @@ -2640,9 +2641,14 @@ nfsv4_strtouid(struct nfsrv_descript *nd /* If a string of digits and an AUTH_SYS mount, just convert it. */ str0 = str; tuid = (uid_t)strtoul(str0, &endstr, 10); - if ((endstr - str0) == len && - (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { - *uidp = tuid; + if ((endstr - str0) == len) { + /* A numeric string. */ + if ((nd->nd_flag & ND_KERBV) == 0 && + ((nd->nd_flag & ND_NFSCL) != 0 || + nfsd_enable_stringtouid != 0)) + *uidp = tuid; + else + error = NFSERR_BADOWNER; goto out; } /* @@ -2845,9 +2851,14 @@ nfsv4_strtogid(struct nfsrv_descript *nd /* If a string of digits and an AUTH_SYS mount, just convert it. */ str0 = str; tgid = (gid_t)strtoul(str0, &endstr, 10); - if ((endstr - str0) == len && - (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { - *gidp = tgid; + if ((endstr - str0) == len) { + /* A numeric string. */ + if ((nd->nd_flag & ND_KERBV) == 0 && + ((nd->nd_flag & ND_NFSCL) != 0 || + nfsd_enable_stringtouid != 0)) + *gidp = tgid; + else + error = NFSERR_BADOWNER; goto out; } /* Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdport.c Thu May 8 20:47:54 2014 (r265713) +++ stable/10/sys/fs/nfsserver/nfs_nfsdport.c Thu May 8 20:52:25 2014 (r265714) @@ -80,6 +80,7 @@ static int nfs_commit_blks; static int nfs_commit_miss; extern int nfsrv_issuedelegs; extern int nfsrv_dolocallocks; +extern int nfsd_enable_stringtouid; SYSCTL_NODE(_vfs, OID_AUTO, nfsd, CTLFLAG_RW, 0, "New NFS server"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, mirrormnt, CTLFLAG_RW, @@ -92,6 +93,8 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, issue_de &nfsrv_issuedelegs, 0, "Enable nfsd to issue delegations"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_locallocks, CTLFLAG_RW, &nfsrv_dolocallocks, 0, "Enable nfsd to acquire local locks on files"); +SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_stringtouid, CTLFLAG_RW, + &nfsd_enable_stringtouid, 0, "Enable nfsd to accept numeric owner_names"); #define MAX_REORDERED_RPC 16 #define NUM_HEURISTIC 1031 From owner-svn-src-stable-10@FreeBSD.ORG Thu May 8 21:03:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 62162DCA; Thu, 8 May 2014 21:03: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 4D219369; Thu, 8 May 2014 21:03: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 s48L3WAv076703; Thu, 8 May 2014 21:03:32 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48L3Vcw076667; Thu, 8 May 2014 21:03:31 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405082103.s48L3Vcw076667@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 8 May 2014 21:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265717 - in stable/10/sys: net netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 21:03:32 -0000 Author: melifaro Date: Thu May 8 21:03:31 2014 New Revision: 265717 URL: http://svnweb.freebsd.org/changeset/base/265717 Log: Merge 260488, r260508. r260488: Split rt_newaddrmsg_fib() into two different functions. Adding/deleting interface addresses involves access to 3 different subsystems, int different parts of code. Each call can fail, so reporting successful operation by rtsock in the middle of the process error-prone. Further split routing notification API and actual rtsock calls via creating public-available rt_addrmsg() / rt_routemsg() functions with "private" rtsock_* backend. r260508: Simplify inet alias handling code: if we're adding/removing alias which has the same prefix as some other alias on the same interface, use newly-added rt_addrmsg() instead of hand-rolled in_addralias_rtmsg(). This eliminates the following rtsock messages: Pinned RTM_ADD for prefix (for alias addition). Pinned RTM_DELETE for prefix (for alias withdrawal). Example (got 10.0.0.1/24 on vlan4, playing with 10.0.0.2/24): before commit, addition: got message of size 116 on Fri Jan 10 14:13:15 2014 RTM_NEWADDR: address being added to iface: len 116, metric 0, flags: sockaddrs: 255.255.255.0 vlan4:8.0.27.c5.29.d4 10.0.0.2 10.0.0.255 got message of size 192 on Fri Jan 10 14:13:15 2014 RTM_ADD: Add Route: len 192, pid: 0, seq 0, errno 0, flags: locks: inits: sockaddrs: 10.0.0.0 10.0.0.2 (255) ffff ffff ff after commit, addition: got message of size 116 on Fri Jan 10 13:56:26 2014 RTM_NEWADDR: address being added to iface: len 116, metric 0, flags: sockaddrs: 255.255.255.0 vlan4:8.0.27.c5.29.d4 14.0.0.2 14.0.0.255 before commit, wihdrawal: got message of size 192 on Fri Jan 10 13:58:59 2014 RTM_DELETE: Delete Route: len 192, pid: 0, seq 0, errno 0, flags: locks: inits: sockaddrs: 10.0.0.0 10.0.0.2 (255) ffff ffff ff got message of size 116 on Fri Jan 10 13:58:59 2014 RTM_DELADDR: address being removed from iface: len 116, metric 0, flags: sockaddrs: 255.255.255.0 vlan4:8.0.27.c5.29.d4 10.0.0.2 10.0.0.255 adter commit, withdrawal: got message of size 116 on Fri Jan 10 14:14:11 2014 RTM_DELADDR: address being removed from iface: len 116, metric 0, flags: sockaddrs: 255.255.255.0 vlan4:8.0.27.c5.29.d4 10.0.0.2 10.0.0.255 Sending both RTM_ADD/RTM_DELETE messages to rtsock is completely wrong (and requires some hacks to keep prefix in route table on RTM_DELETE). I've tested this change with quagga (no change) and bird (*). bird alias handling is already broken in *BSD sysdep code, so nothing changes here, too. I'm going to MFC this change if there will be no complains about behavior change. While here, fix some style(9) bugs introduced by r260488 (pointed by glebius and bde). Modified: stable/10/sys/net/route.c stable/10/sys/net/route.h stable/10/sys/net/rtsock.c stable/10/sys/netinet/in.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/route.c ============================================================================== --- stable/10/sys/net/route.c Thu May 8 21:02:23 2014 (r265716) +++ stable/10/sys/net/route.c Thu May 8 21:03:31 2014 (r265717) @@ -37,6 +37,7 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_route.h" +#include "opt_sctp.h" #include "opt_mrouting.h" #include "opt_mpath.h" @@ -85,6 +86,13 @@ #define RT_NUMFIBS 1 #endif +#if defined(INET) || defined(INET6) +#ifdef SCTP +extern void sctp_addr_change(struct ifaddr *ifa, int cmd); +#endif /* SCTP */ +#endif + + /* This is read-only.. */ u_int rt_numfibs = RT_NUMFIBS; SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLAG_RD, &rt_numfibs, 0, ""); @@ -117,7 +125,8 @@ VNET_DEFINE(int, rttrash); /* routes no /* compare two sockaddr structures */ -#define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) +#define sa_equal(a1, a2) (((a1)->sa_len == (a2)->sa_len) && \ + (bcmp((a1), (a2), (a1)->sa_len) == 0)) /* * Convert a 'struct radix_node *' to a 'struct rtentry *'. @@ -1756,3 +1765,89 @@ rtinit(struct ifaddr *ifa, int cmd, int } return (rtinit1(ifa, cmd, flags, fib)); } + +/* + * Announce interface address arrival/withdraw + * Returns 0 on success. + */ +int +rt_addrmsg(int cmd, struct ifaddr *ifa, int fibnum) +{ + + KASSERT(cmd == RTM_ADD || cmd == RTM_DELETE, + ("unexpected cmd %d", cmd)); + + KASSERT(fibnum == RT_ALL_FIBS || (fibnum >= 0 && fibnum < rt_numfibs), + ("%s: fib out of range 0 <=%d<%d", __func__, fibnum, rt_numfibs)); + + return (rtsock_addrmsg(cmd, ifa, fibnum)); +} + +/* + * Announce route addition/removal. + * Users of this function MUST validate input data BEFORE calling. + * However we have to be able to handle invalid data: + * if some userland app sends us "invalid" route message (invalid mask, + * no dst, wrong address families, etc...) we need to pass it back + * to app (and any other rtsock consumers) with rtm_errno field set to + * non-zero value. + * Returns 0 on success. + */ +int +rt_routemsg(int cmd, struct ifnet *ifp, int error, struct rtentry *rt, + int fibnum) +{ + + KASSERT(cmd == RTM_ADD || cmd == RTM_DELETE, + ("unexpected cmd %d", cmd)); + + KASSERT(fibnum == RT_ALL_FIBS || (fibnum >= 0 && fibnum < rt_numfibs), + ("%s: fib out of range 0 <=%d<%d", __func__, fibnum, rt_numfibs)); + + KASSERT(rt_key(rt) != NULL, (":%s: rt_key must be supplied", __func__)); + + return (rtsock_routemsg(cmd, ifp, error, rt, fibnum)); +} + +void +rt_newaddrmsg(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt) +{ + + rt_newaddrmsg_fib(cmd, ifa, error, rt, RT_ALL_FIBS); +} + +/* + * This is called to generate messages from the routing socket + * indicating a network interface has had addresses associated with it. + */ +void +rt_newaddrmsg_fib(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt, + int fibnum) +{ + + KASSERT(cmd == RTM_ADD || cmd == RTM_DELETE, + ("unexpected cmd %u", cmd)); + KASSERT(fibnum == RT_ALL_FIBS || (fibnum >= 0 && fibnum < rt_numfibs), + ("%s: fib out of range 0 <=%d<%d", __func__, fibnum, rt_numfibs)); + +#if defined(INET) || defined(INET6) +#ifdef SCTP + /* + * notify the SCTP stack + * this will only get called when an address is added/deleted + * XXX pass the ifaddr struct instead if ifa->ifa_addr... + */ + sctp_addr_change(ifa, cmd); +#endif /* SCTP */ +#endif + if (cmd == RTM_ADD) { + rt_addrmsg(cmd, ifa, fibnum); + if (rt != NULL) + rt_routemsg(cmd, ifa->ifa_ifp, error, rt, fibnum); + } else { + if (rt != NULL) + rt_routemsg(cmd, ifa->ifa_ifp, error, rt, fibnum); + rt_addrmsg(cmd, ifa, fibnum); + } +} + Modified: stable/10/sys/net/route.h ============================================================================== --- stable/10/sys/net/route.h Thu May 8 21:02:23 2014 (r265716) +++ stable/10/sys/net/route.h Thu May 8 21:03:31 2014 (r265717) @@ -85,6 +85,7 @@ struct rt_metrics { #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ #define RT_ALL_FIBS -1 /* Announce event for every fib */ extern u_int rt_numfibs; /* number of usable routing tables */ +extern u_int rt_add_addr_allfibs; /* Announce interfaces to all fibs */ /* * We distinguish between routes to hosts and routes to networks, @@ -343,10 +344,15 @@ void rt_missmsg(int, struct rt_addrinfo void rt_missmsg_fib(int, struct rt_addrinfo *, int, int, int); void rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *); void rt_newaddrmsg_fib(int, struct ifaddr *, int, struct rtentry *, int); +int rt_addrmsg(int, struct ifaddr *, int); +int rt_routemsg(int, struct ifnet *ifp, int, struct rtentry *, int); void rt_newmaddrmsg(int, struct ifmultiaddr *); int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *); void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); +int rtsock_addrmsg(int, struct ifaddr *, int); +int rtsock_routemsg(int, struct ifnet *ifp, int, struct rtentry *, int); + /* * Note the following locking behavior: * Modified: stable/10/sys/net/rtsock.c ============================================================================== --- stable/10/sys/net/rtsock.c Thu May 8 21:02:23 2014 (r265716) +++ stable/10/sys/net/rtsock.c Thu May 8 21:03:31 2014 (r265717) @@ -30,7 +30,6 @@ * $FreeBSD$ */ #include "opt_compat.h" -#include "opt_sctp.h" #include "opt_mpath.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -70,12 +69,6 @@ #include #endif -#if defined(INET) || defined(INET6) -#ifdef SCTP -extern void sctp_addr_change(struct ifaddr *ifa, int cmd); -#endif /* SCTP */ -#endif - #ifdef COMPAT_FREEBSD32 #include #include @@ -1327,89 +1320,92 @@ rt_ifmsg(struct ifnet *ifp) } /* - * This is called to generate messages from the routing socket - * indicating a network interface has had addresses associated with it. - * if we ever reverse the logic and replace messages TO the routing - * socket indicate a request to configure interfaces, then it will - * be unnecessary as the routing socket will automatically generate - * copies of it. + * Announce interface address arrival/withdraw. + * Please do not call directly, use rt_addrmsg(). + * Assume input data to be valid. + * Returns 0 on success. */ -void -rt_newaddrmsg_fib(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt, - int fibnum) +int +rtsock_addrmsg(int cmd, struct ifaddr *ifa, int fibnum) { struct rt_addrinfo info; - struct sockaddr *sa = NULL; - int pass; - struct mbuf *m = NULL; + struct sockaddr *sa; + int ncmd; + struct mbuf *m; + struct ifa_msghdr *ifam; struct ifnet *ifp = ifa->ifa_ifp; - KASSERT(cmd == RTM_ADD || cmd == RTM_DELETE, - ("unexpected cmd %u", cmd)); -#if defined(INET) || defined(INET6) -#ifdef SCTP - /* - * notify the SCTP stack - * this will only get called when an address is added/deleted - * XXX pass the ifaddr struct instead if ifa->ifa_addr... - */ - sctp_addr_change(ifa, cmd); -#endif /* SCTP */ -#endif if (route_cb.any_count == 0) - return; - for (pass = 1; pass < 3; pass++) { - bzero((caddr_t)&info, sizeof(info)); - if ((cmd == RTM_ADD && pass == 1) || - (cmd == RTM_DELETE && pass == 2)) { - struct ifa_msghdr *ifam; - int ncmd = cmd == RTM_ADD ? RTM_NEWADDR : RTM_DELADDR; + return (0); - info.rti_info[RTAX_IFA] = sa = ifa->ifa_addr; - info.rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr; - info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask; - info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr; - if ((m = rt_msg1(ncmd, &info)) == NULL) - continue; - ifam = mtod(m, struct ifa_msghdr *); - ifam->ifam_index = ifp->if_index; - ifam->ifam_metric = ifa->ifa_metric; - ifam->ifam_flags = ifa->ifa_flags; - ifam->ifam_addrs = info.rti_addrs; - } - if ((cmd == RTM_ADD && pass == 2) || - (cmd == RTM_DELETE && pass == 1)) { - struct rt_msghdr *rtm; + ncmd = cmd == RTM_ADD ? RTM_NEWADDR : RTM_DELADDR; - if (rt == NULL) - continue; - info.rti_info[RTAX_NETMASK] = rt_mask(rt); - info.rti_info[RTAX_DST] = sa = rt_key(rt); - info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; - if ((m = rt_msg1(cmd, &info)) == NULL) - continue; - rtm = mtod(m, struct rt_msghdr *); - rtm->rtm_index = ifp->if_index; - rtm->rtm_flags |= rt->rt_flags; - rtm->rtm_errno = error; - rtm->rtm_addrs = info.rti_addrs; - } - if (fibnum != RT_ALL_FIBS) { - KASSERT(fibnum >= 0 && fibnum < rt_numfibs, ("%s: " - "fibnum out of range 0 <= %d < %d", __func__, - fibnum, rt_numfibs)); - M_SETFIB(m, fibnum); - m->m_flags |= RTS_FILTER_FIB; - } - rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); + bzero((caddr_t)&info, sizeof(info)); + info.rti_info[RTAX_IFA] = sa = ifa->ifa_addr; + info.rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr; + info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask; + info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr; + if ((m = rt_msg1(ncmd, &info)) == NULL) + return (ENOBUFS); + ifam = mtod(m, struct ifa_msghdr *); + ifam->ifam_index = ifp->if_index; + ifam->ifam_metric = ifa->ifa_metric; + ifam->ifam_flags = ifa->ifa_flags; + ifam->ifam_addrs = info.rti_addrs; + + if (fibnum != RT_ALL_FIBS) { + M_SETFIB(m, fibnum); + m->m_flags |= RTS_FILTER_FIB; } + + rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); + + return (0); } -void -rt_newaddrmsg(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt) +/* + * Announce route addition/removal. + * Please do not call directly, use rt_routemsg(). + * Note that @rt data MAY be inconsistent/invalid: + * if some userland app sends us "invalid" route message (invalid mask, + * no dst, wrong address families, etc...) we need to pass it back + * to app (and any other rtsock consumers) with rtm_errno field set to + * non-zero value. + * + * Returns 0 on success. + */ +int +rtsock_routemsg(int cmd, struct ifnet *ifp, int error, struct rtentry *rt, + int fibnum) { + struct rt_addrinfo info; + struct sockaddr *sa; + struct mbuf *m; + struct rt_msghdr *rtm; + + if (route_cb.any_count == 0) + return (0); - rt_newaddrmsg_fib(cmd, ifa, error, rt, RT_ALL_FIBS); + bzero((caddr_t)&info, sizeof(info)); + info.rti_info[RTAX_NETMASK] = rt_mask(rt); + info.rti_info[RTAX_DST] = sa = rt_key(rt); + info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; + if ((m = rt_msg1(cmd, &info)) == NULL) + return (ENOBUFS); + rtm = mtod(m, struct rt_msghdr *); + rtm->rtm_index = ifp->if_index; + rtm->rtm_flags |= rt->rt_flags; + rtm->rtm_errno = error; + rtm->rtm_addrs = info.rti_addrs; + + if (fibnum != RT_ALL_FIBS) { + M_SETFIB(m, fibnum); + m->m_flags |= RTS_FILTER_FIB; + } + + rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); + + return (0); } /* Modified: stable/10/sys/netinet/in.c ============================================================================== --- stable/10/sys/netinet/in.c Thu May 8 21:02:23 2014 (r265716) +++ stable/10/sys/netinet/in.c Thu May 8 21:03:31 2014 (r265717) @@ -901,45 +901,6 @@ in_ifinit(struct ifnet *ifp, struct in_i ? RTF_HOST : 0) /* - * Generate a routing message when inserting or deleting - * an interface address alias. - */ -static void in_addralias_rtmsg(int cmd, struct in_addr *prefix, - struct in_ifaddr *target) -{ - struct route pfx_ro; - struct sockaddr_in *pfx_addr; - struct rtentry msg_rt; - - /* QL: XXX - * This is a bit questionable because there is no - * additional route entry added/deleted for an address - * alias. Therefore this route report is inaccurate. - */ - bzero(&pfx_ro, sizeof(pfx_ro)); - pfx_addr = (struct sockaddr_in *)(&pfx_ro.ro_dst); - pfx_addr->sin_len = sizeof(*pfx_addr); - pfx_addr->sin_family = AF_INET; - pfx_addr->sin_addr = *prefix; - rtalloc_ign_fib(&pfx_ro, 0, 0); - if (pfx_ro.ro_rt != NULL) { - msg_rt = *pfx_ro.ro_rt; - - /* QL: XXX - * Point the gateway to the new interface - * address as if a new prefix route entry has - * been added through the new address alias. - * All other parts of the rtentry is accurate, - * e.g., rt_key, rt_mask, rt_ifp etc. - */ - msg_rt.rt_gateway = (struct sockaddr *)&target->ia_addr; - rt_newaddrmsg(cmd, (struct ifaddr *)target, 0, &msg_rt); - RTFREE(pfx_ro.ro_rt); - } - return; -} - -/* * Check if we have a route for the given prefix already or add one accordingly. */ int @@ -947,7 +908,7 @@ in_addprefix(struct in_ifaddr *target, i { struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; - int error; + int error, fibnum; if ((flags & RTF_HOST) != 0) { prefix = target->ia_dstaddr.sin_addr; @@ -958,6 +919,8 @@ in_addprefix(struct in_ifaddr *target, i prefix.s_addr &= mask.s_addr; } + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; + IN_IFADDR_RLOCK(); TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (rtinitflags(ia)) { @@ -992,7 +955,7 @@ in_addprefix(struct in_ifaddr *target, i IN_IFADDR_RUNLOCK(); return (EEXIST); } else { - in_addralias_rtmsg(RTM_ADD, &prefix, target); + rt_addrmsg(RTM_ADD, &target->ia_ifa, fibnum); IN_IFADDR_RUNLOCK(); return (0); } @@ -1019,9 +982,11 @@ in_scrubprefix(struct in_ifaddr *target, { struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; - int error = 0; + int error = 0, fibnum; struct sockaddr_in prefix0, mask0; + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; + /* * Remove the loopback route to the interface address. * The "useloopback" setting is not consulted because if the @@ -1074,7 +1039,7 @@ in_scrubprefix(struct in_ifaddr *target, } if ((target->ia_flags & IFA_ROUTE) == 0) { - in_addralias_rtmsg(RTM_DELETE, &prefix, target); + rt_addrmsg(RTM_DELETE, &target->ia_ifa, fibnum); return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 01:20:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 86457AAB; Fri, 9 May 2014 01:20: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 59517C8C; Fri, 9 May 2014 01:20: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 s491KeJv009243; Fri, 9 May 2014 01:20:40 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s491KeML009238; Fri, 9 May 2014 01:20:40 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405090120.s491KeML009238@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 9 May 2014 01:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265726 - stable/10/lib/libc/regex X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 01:20:40 -0000 Author: pfg Date: Fri May 9 01:20:39 2014 New Revision: 265726 URL: http://svnweb.freebsd.org/changeset/base/265726 Log: MFC r265202: Remove some unreachable breaks in regex. This is based on a much bigger cleanup done in Illumos. Reference: https://www.illumos.org/issues/2077 Modified: stable/10/lib/libc/regex/engine.c stable/10/lib/libc/regex/regcomp.c Modified: stable/10/lib/libc/regex/engine.c ============================================================================== --- stable/10/lib/libc/regex/engine.c Fri May 9 01:13:14 2014 (r265725) +++ stable/10/lib/libc/regex/engine.c Fri May 9 01:20:39 2014 (r265726) @@ -686,19 +686,16 @@ backref(struct match *m, while (m->g->strip[ss] != SOP(O_BACK, i)) ss++; return(backref(m, sp+len, stop, ss+1, stopst, lev, rec)); - break; case OQUEST_: /* to null or not */ dp = backref(m, sp, stop, ss+1, stopst, lev, rec); if (dp != NULL) return(dp); /* not */ return(backref(m, sp, stop, ss+OPND(s)+1, stopst, lev, rec)); - break; case OPLUS_: assert(m->lastpos != NULL); assert(lev+1 <= m->g->nplus); m->lastpos[lev+1] = sp; return(backref(m, sp, stop, ss+1, stopst, lev+1, rec)); - break; case O_PLUS: if (sp == m->lastpos[lev]) /* last pass matched null */ return(backref(m, sp, stop, ss+1, stopst, lev-1, rec)); @@ -709,7 +706,6 @@ backref(struct match *m, return(backref(m, sp, stop, ss+1, stopst, lev-1, rec)); else return(dp); - break; case OCH_: /* find the right one, if any */ ssub = ss + 1; esub = ss + OPND(s) - 1; @@ -730,6 +726,7 @@ backref(struct match *m, else assert(OP(m->g->strip[esub]) == O_CH); } + /* NOTREACHED */ break; case OLPAREN: /* must undo assignment if rest fails */ i = OPND(s); @@ -741,7 +738,6 @@ backref(struct match *m, return(dp); m->pmatch[i].rm_so = offsave; return(NULL); - break; case ORPAREN: /* must undo assignment if rest fails */ i = OPND(s); assert(0 < i && i <= m->g->nsub); @@ -752,7 +748,6 @@ backref(struct match *m, return(dp); m->pmatch[i].rm_eo = offsave; return(NULL); - break; default: /* uh oh */ assert(nope); break; Modified: stable/10/lib/libc/regex/regcomp.c ============================================================================== --- stable/10/lib/libc/regex/regcomp.c Fri May 9 01:13:14 2014 (r265725) +++ stable/10/lib/libc/regex/regcomp.c Fri May 9 01:20:39 2014 (r265726) @@ -746,7 +746,6 @@ p_b_term(struct parse *p, cset *cs) case '-': SETERROR(REG_ERANGE); return; /* NOTE RETURN */ - break; default: c = '\0'; break; From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 01:30:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 19B88E0C; Fri, 9 May 2014 01:30: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 06AD5CDC; Fri, 9 May 2014 01:30: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 s491UFFo032108; Fri, 9 May 2014 01:30:15 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s491UFl7032105; Fri, 9 May 2014 01:30:15 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405090130.s491UFl7032105@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 9 May 2014 01:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265728 - stable/10/contrib/gcc/config/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 01:30:16 -0000 Author: pfg Date: Fri May 9 01:30:15 2014 New Revision: 265728 URL: http://svnweb.freebsd.org/changeset/base/265728 Log: MFC r265231: gcc: fix strict alignment. From the OpenBSD log: x86-64 ABI requires arrays greater than 16 bytes to be aligned to 16byte boundary. However, GCC 16-byte aligns arrays of >=16 BITS, not BYTES. This diff improves bug detectability for code which has local arrays of [16 .. 127] bits: in those cases SSP will now detect even 1-byte overflows. Obtained from: OpenBSD (CVS rev 1.4) Modified: stable/10/contrib/gcc/config/i386/i386.c Modified: stable/10/contrib/gcc/config/i386/i386.c ============================================================================== --- stable/10/contrib/gcc/config/i386/i386.c Fri May 9 01:25:25 2014 (r265727) +++ stable/10/contrib/gcc/config/i386/i386.c Fri May 9 01:30:15 2014 (r265728) @@ -14408,7 +14408,7 @@ ix86_local_alignment (tree type, int ali if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type) && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST - && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 16 + && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128 || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128) return 128; } From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 03:59:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 73EFCB9A; Fri, 9 May 2014 03:59: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 5FC9FD3B; Fri, 9 May 2014 03:59: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 s493xDq2069318; Fri, 9 May 2014 03:59:13 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s493xDS9069313; Fri, 9 May 2014 03:59:13 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405090359.s493xDS9069313@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 9 May 2014 03:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265730 - stable/10/sys/dev/mpr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 03:59:13 -0000 Author: ken Date: Fri May 9 03:59:12 2014 New Revision: 265730 URL: http://svnweb.freebsd.org/changeset/base/265730 Log: MFC mpr(4) driver changes. This includes r265386, r265424, and r265473. ------------------------------------------------------------------------ r265386 | ken | 2014-05-05 13:53:03 -0600 (Mon, 05 May 2014) | 15 lines Adjust #if statements inside mprsas_send_smpcmd() to more accurately reflect when unmapped I/O support was added. For FreeBSD 10, it arrived just prior to __FreeBSD_version 1000028. For FreeBSD 9, it arrived just prior to __FreeBSD_version 902001. Also, fix compiler warnings in mprsas_send_smpcmd() that happen in the i386 PAE build for non-unmapped I/O builds. These were fixed in mps(4) in revision 241145, but didn't make it into the mpr(4) driver. This change should only affect FreeBSD versions outside the above revisions, and thus doesn't affect head. Sponsored by: Spectra Logic Corporation ------------------------------------------------------------------------ ------------------------------------------------------------------------ r265424 | ken | 2014-05-06 00:18:43 -0600 (Tue, 06 May 2014) | 33 lines Fix a problem with async notifications in the mpr(4) driver. This problem only occurs on versions of FreeBSD prior to the recent CAM locking changes. (i.e. stable/9 and older versions of stable/10) This change should be a no-op for head and stable/10. If a path isn't specified, xpt_register_async() will create a fully wildcarded path and acquire a lock (the XPT lock in older versions, and via xpt_path_lock() in newer versions) to call xpt_action() for the XPT_SASYNC_CB CCB. It will then drop the lock and if the requested event includes AC_FOUND_DEVICE or AC_PATH_REGISTERED, it will get the caller up to date with any device arrivals or path registrations. The issue is that before the locking changes, each SIM lock would get acquired in turn during the EDT tree traversal process. If a path is specified for xpt_register_async(), it won't acquire and drop its own lock, but instead expects the caller to hold its own SIM lock. That works for the first part of xpt_register_async(), but causes a recursive lock acquisition once the EDT traversal happens and it comes to the SIM in question. And it isn't possible to call xpt_action() without holding a SIM lock. The locking changes fix this by using the XPT topology lock for EDT traversal, so it is no longer an issue to hold the SIM lock while calling xpt_register_async(). The solution for FreeBSD versions before the locking changes is to request notification of all device arrivals (so we pass a NULL path into xpt_register_async()) and then filter out the arrivals that are not ours. Sponsored by: Spectra Logic Corporation ------------------------------------------------------------------------ ------------------------------------------------------------------------ r265473 | ken | 2014-05-06 16:13:38 -0600 (Tue, 06 May 2014) | 7 lines Change the device name for mpr(4) from /dev/mpr_N to /dev/mprN. This is more consistent with the existing mps(4) behavior. Reviewed by: Steve McConnell ------------------------------------------------------------------------ Sponsored by: LSI, Spectra Logic Modified: stable/10/sys/dev/mpr/mpr_sas.c stable/10/sys/dev/mpr/mpr_user.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mpr/mpr_sas.c ============================================================================== --- stable/10/sys/dev/mpr/mpr_sas.c Fri May 9 03:52:10 2014 (r265729) +++ stable/10/sys/dev/mpr/mpr_sas.c Fri May 9 03:59:12 2014 (r265730) @@ -813,8 +813,49 @@ mpr_attach_sas(struct mpr_softc *sc) #else event = AC_FOUND_DEVICE; #endif + + /* + * Prior to the CAM locking improvements, we can't call + * xpt_register_async() with a particular path specified. + * + * If a path isn't specified, xpt_register_async() will + * generate a wildcard path and acquire the XPT lock while + * it calls xpt_action() to execute the XPT_SASYNC_CB CCB. + * It will then drop the XPT lock once that is done. + * + * If a path is specified for xpt_register_async(), it will + * not acquire and drop the XPT lock around the call to + * xpt_action(). xpt_action() asserts that the caller + * holds the SIM lock, so the SIM lock has to be held when + * calling xpt_register_async() when the path is specified. + * + * But xpt_register_async calls xpt_for_all_devices(), + * which calls xptbustraverse(), which will acquire each + * SIM lock. When it traverses our particular bus, it will + * necessarily acquire the SIM lock, which will lead to a + * recursive lock acquisition. + * + * The CAM locking changes fix this problem by acquiring + * the XPT topology lock around bus traversal in + * xptbustraverse(), so the caller can hold the SIM lock + * and it does not cause a recursive lock acquisition. + * + * These __FreeBSD_version values are approximate, especially + * for stable/10, which is two months later than the actual + * change. + */ + +#if (__FreeBSD_version < 1000703) || \ + ((__FreeBSD_version >= 1100000) && (__FreeBSD_version < 1100002)) + mpr_unlock(sc); + status = xpt_register_async(event, mprsas_async, sc, + NULL); + mpr_lock(sc); +#else status = xpt_register_async(event, mprsas_async, sc, sassc->path); +#endif + if (status != CAM_REQ_CMP) { mpr_dprint(sc, MPR_ERROR, "Error %#x registering async handler for " @@ -2501,7 +2542,8 @@ mprsas_send_smpcmd(struct mprsas_softc * sg = NULL; error = 0; -#if __FreeBSD_version >= 1000029 +#if (__FreeBSD_version >= 1000028) || \ + ((__FreeBSD_version >= 902001) && (__FreeBSD_version < 1000000)) switch (ccb->ccb_h.flags & CAM_DATA_MASK) { case CAM_DATA_PADDR: case CAM_DATA_SG_PADDR: @@ -2561,7 +2603,7 @@ mprsas_send_smpcmd(struct mprsas_softc * xpt_done(ccb); return; } -#else //__FreeBSD_version < 1000029 +#else /* __FreeBSD_version < 1000028 */ /* * XXX We don't yet support physical addresses here. */ @@ -2604,7 +2646,7 @@ mprsas_send_smpcmd(struct mprsas_softc * bus_dma_segment_t *req_sg; req_sg = (bus_dma_segment_t *)ccb->smpio.smp_request; - request = (uint8_t *)req_sg[0].ds_addr; + request = (uint8_t *)(uintptr_t)req_sg[0].ds_addr; } else request = ccb->smpio.smp_request; @@ -2612,14 +2654,14 @@ mprsas_send_smpcmd(struct mprsas_softc * bus_dma_segment_t *rsp_sg; rsp_sg = (bus_dma_segment_t *)ccb->smpio.smp_response; - response = (uint8_t *)rsp_sg[0].ds_addr; + response = (uint8_t *)(uintptr_t)rsp_sg[0].ds_addr; } else response = ccb->smpio.smp_response; } else { request = ccb->smpio.smp_request; response = ccb->smpio.smp_response; } -#endif //__FreeBSD_version >= 1000029 +#endif /* __FreeBSD_version < 1000028 */ cm = mpr_alloc_command(sc); if (cm == NULL) { @@ -2987,6 +3029,18 @@ mprsas_async(void *callback_arg, uint32_ break; /* + * See the comment in mpr_attach_sas() for a detailed + * explanation. In these versions of FreeBSD we register + * for all events and filter out the events that don't + * apply to us. + */ +#if (__FreeBSD_version < 1000703) || \ + ((__FreeBSD_version >= 1100000) && (__FreeBSD_version < 1100002)) + if (xpt_path_path_id(path) != sassc->sim->path_id) + break; +#endif + + /* * We should have a handle for this, but check to make sure. */ KASSERT(xpt_path_target_id(path) < sassc->maxtargets, @@ -3043,8 +3097,21 @@ mprsas_async(void *callback_arg, uint32_ case AC_FOUND_DEVICE: { struct ccb_getdev *cgd; + /* + * See the comment in mpr_attach_sas() for a detailed + * explanation. In these versions of FreeBSD we register + * for all events and filter out the events that don't + * apply to us. + */ +#if (__FreeBSD_version < 1000703) || \ + ((__FreeBSD_version >= 1100000) && (__FreeBSD_version < 1100002)) + if (xpt_path_path_id(path) != sc->sassc->sim->path_id) + break; +#endif + cgd = arg; mprsas_prepare_ssu(sc, path, cgd); + #if (__FreeBSD_version < 901503) || \ ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) mprsas_check_eedp(sc, path, cgd); Modified: stable/10/sys/dev/mpr/mpr_user.c ============================================================================== --- stable/10/sys/dev/mpr/mpr_user.c Fri May 9 03:52:10 2014 (r265729) +++ stable/10/sys/dev/mpr/mpr_user.c Fri May 9 03:59:12 2014 (r265730) @@ -212,7 +212,7 @@ mpr_attach_user(struct mpr_softc *sc) unit = device_get_unit(sc->mpr_dev); sc->mpr_cdev = make_dev(&mpr_cdevsw, unit, UID_ROOT, GID_OPERATOR, - 0640, "mpr_%d", unit); + 0640, "mpr%d", unit); if (sc->mpr_cdev == NULL) { return (ENOMEM); } From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 04:16:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 57F3B5E2; Fri, 9 May 2014 04:16: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 44F08EF2; Fri, 9 May 2014 04:16: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 s494GBOo015725; Fri, 9 May 2014 04:16:11 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s494GBlJ015724; Fri, 9 May 2014 04:16:11 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405090416.s494GBlJ015724@svn.freebsd.org> From: Glen Barber Date: Fri, 9 May 2014 04:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265733 - stable/10/gnu/usr.bin/groff/tmac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 04:16:11 -0000 Author: gjb Date: Fri May 9 04:16:10 2014 New Revision: 265733 URL: http://svnweb.freebsd.org/changeset/base/265733 Log: MFC r265732: Add 9.3 to mdoc.local Sponsored by: The FreeBSD Foundation Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local Directory Properties: stable/10/ (props changed) Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- stable/10/gnu/usr.bin/groff/tmac/mdoc.local Fri May 9 04:14:37 2014 (r265732) +++ stable/10/gnu/usr.bin/groff/tmac/mdoc.local Fri May 9 04:16:10 2014 (r265733) @@ -57,6 +57,7 @@ .ds doc-operating-system-FreeBSD-8.4 8.4 .ds doc-operating-system-FreeBSD-9.1 9.1 .ds doc-operating-system-FreeBSD-9.2 9.2 +.ds doc-operating-system-FreeBSD-9.3 9.3 .ds doc-operating-system-FreeBSD-10.0 10.0 .ds doc-operating-system-FreeBSD-10.1 10.1 .ds doc-operating-system-NetBSD-7.0 7.0 From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 06:56:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9AFCC5CD; Fri, 9 May 2014 06:56: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 84328E44; Fri, 9 May 2014 06:56: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 s496uU0f087725; Fri, 9 May 2014 06:56:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s496uQN3087702; Fri, 9 May 2014 06:56:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405090656.s496uQN3087702@svn.freebsd.org> From: Xin LI Date: Fri, 9 May 2014 06:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265740 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/lib/libzpool/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/c... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 06:56:30 -0000 Author: delphij Date: Fri May 9 06:56:26 2014 New Revision: 265740 URL: http://svnweb.freebsd.org/changeset/base/265740 Log: MFC r264669: MFV r264666: 4374 dn_free_ranges should use range_tree_t illumos/illumos-gate@bf16b11e8deb633dd6c4296d46e92399d1582df4 Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/bitmap.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri May 9 06:56:26 2014 (r265740) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -2741,7 +2741,8 @@ dump_simulated_ddt(spa_t *spa) dds.dds_ref_psize = zdde->zdde_ref_psize; dds.dds_ref_dsize = zdde->zdde_ref_dsize; - ddt_stat_add(&ddh_total.ddh_stat[highbit(refcnt) - 1], &dds, 0); + ddt_stat_add(&ddh_total.ddh_stat[highbit64(refcnt) - 1], + &dds, 0); umem_free(zdde, sizeof (*zdde)); } Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri May 9 06:56:26 2014 (r265740) @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -800,20 +802,17 @@ delay(clock_t ticks) /* * Find highest one bit set. * Returns bit number + 1 of highest bit that is set, otherwise returns 0. - * High order bit is 31 (or 63 in _LP64 kernel). */ int -highbit(ulong_t i) +highbit64(uint64_t i) { - register int h = 1; + int h = 1; if (i == 0) return (0); -#ifdef _LP64 - if (i & 0xffffffff00000000ul) { + if (i & 0xffffffff00000000ULL) { h += 32; i >>= 32; } -#endif if (i & 0xffff0000) { h += 16; i >>= 16; } Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri May 9 05:39:57 2014 (r265739) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri May 9 06:56:26 2014 (r265740) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* @@ -558,7 +558,7 @@ extern void delay(clock_t ticks); extern uint64_t physmem; -extern int highbit(ulong_t i); +extern int highbit64(uint64_t i); extern int random_get_bytes(uint8_t *ptr, size_t len); extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri May 9 06:56:26 2014 (r265740) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -40,6 +40,7 @@ #include #include #include +#include /* * Number of times that zfs_free_range() took the slow path while doing @@ -1177,7 +1178,10 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t if (db->db_level == 0 && db->db_blkid != DMU_BONUS_BLKID && db->db_blkid != DMU_SPILL_BLKID) { mutex_enter(&dn->dn_mtx); - dnode_clear_range(dn, db->db_blkid, 1, tx); + if (dn->dn_free_ranges[txgoff] != NULL) { + range_tree_clear(dn->dn_free_ranges[txgoff], + db->db_blkid, 1); + } mutex_exit(&dn->dn_mtx); db->db_freed_in_flight = FALSE; } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri May 9 06:56:26 2014 (r265740) @@ -21,7 +21,7 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -416,7 +416,7 @@ ddt_stat_update(ddt_t *ddt, ddt_entry_t ddt_stat_generate(ddt, dde, &dds); - bucket = highbit(dds.dds_ref_blocks) - 1; + bucket = highbit64(dds.dds_ref_blocks) - 1; ASSERT(bucket >= 0); ddh = &ddt->ddt_histogram[dde->dde_type][dde->dde_class]; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri May 9 06:56:26 2014 (r265740) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -35,8 +35,7 @@ #include #include #include - -static int free_range_compar(const void *node1, const void *node2); +#include static kmem_cache_t *dnode_cache; /* @@ -92,9 +91,7 @@ dnode_cons(void *arg, void *unused, int for (i = 0; i < TXG_SIZE; i++) { list_link_init(&dn->dn_dirty_link[i]); - avl_create(&dn->dn_ranges[i], free_range_compar, - sizeof (free_range_t), - offsetof(struct free_range, fr_node)); + dn->dn_free_ranges[i] = NULL; list_create(&dn->dn_dirty_records[i], sizeof (dbuf_dirty_record_t), offsetof(dbuf_dirty_record_t, dr_dirty_node)); @@ -143,7 +140,7 @@ dnode_dest(void *arg, void *unused) for (i = 0; i < TXG_SIZE; i++) { ASSERT(!list_link_active(&dn->dn_dirty_link[i])); - avl_destroy(&dn->dn_ranges[i]); + ASSERT3P(dn->dn_free_ranges[i], ==, NULL); list_destroy(&dn->dn_dirty_records[i]); ASSERT0(dn->dn_next_nblkptr[i]); ASSERT0(dn->dn_next_nlevels[i]); @@ -316,19 +313,6 @@ dnode_buf_byteswap(void *vbuf, size_t si } } -static int -free_range_compar(const void *node1, const void *node2) -{ - const free_range_t *rp1 = node1; - const free_range_t *rp2 = node2; - - if (rp1->fr_blkid < rp2->fr_blkid) - return (-1); - else if (rp1->fr_blkid > rp2->fr_blkid) - return (1); - else return (0); -} - void dnode_setbonuslen(dnode_t *dn, int newsize, dmu_tx_t *tx) { @@ -377,7 +361,7 @@ dnode_setdblksz(dnode_t *dn, int size) 1<<(sizeof (dn->dn_phys->dn_datablkszsec) * 8)); dn->dn_datablksz = size; dn->dn_datablkszsec = size >> SPA_MINBLOCKSHIFT; - dn->dn_datablkshift = ISP2(size) ? highbit(size - 1) : 0; + dn->dn_datablkshift = ISP2(size) ? highbit64(size - 1) : 0; } static dnode_t * @@ -533,7 +517,7 @@ dnode_allocate(dnode_t *dn, dmu_object_t ASSERT0(dn->dn_next_blksz[i]); ASSERT(!list_link_active(&dn->dn_dirty_link[i])); ASSERT3P(list_head(&dn->dn_dirty_records[i]), ==, NULL); - ASSERT0(avl_numnodes(&dn->dn_ranges[i])); + ASSERT3P(dn->dn_free_ranges[i], ==, NULL); } dn->dn_type = ot; @@ -697,7 +681,8 @@ dnode_move_impl(dnode_t *odn, dnode_t *n list_move_tail(&ndn->dn_dirty_records[i], &odn->dn_dirty_records[i]); } - bcopy(&odn->dn_ranges[0], &ndn->dn_ranges[0], sizeof (odn->dn_ranges)); + bcopy(&odn->dn_free_ranges[0], &ndn->dn_free_ranges[0], + sizeof (odn->dn_free_ranges)); ndn->dn_allocated_txg = odn->dn_allocated_txg; ndn->dn_free_txg = odn->dn_free_txg; ndn->dn_assigned_txg = odn->dn_assigned_txg; @@ -760,8 +745,7 @@ dnode_move_impl(dnode_t *odn, dnode_t *n list_create(&odn->dn_dirty_records[i], sizeof (dbuf_dirty_record_t), offsetof(dbuf_dirty_record_t, dr_dirty_node)); - odn->dn_ranges[i].avl_root = NULL; - odn->dn_ranges[i].avl_numnodes = 0; + odn->dn_free_ranges[i] = NULL; odn->dn_next_nlevels[i] = 0; odn->dn_next_indblkshift[i] = 0; odn->dn_next_bonustype[i] = 0; @@ -1467,59 +1451,6 @@ out: } void -dnode_clear_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx) -{ - avl_tree_t *tree = &dn->dn_ranges[tx->tx_txg&TXG_MASK]; - avl_index_t where; - free_range_t *rp; - free_range_t rp_tofind; - uint64_t endblk = blkid + nblks; - - ASSERT(MUTEX_HELD(&dn->dn_mtx)); - ASSERT(nblks <= UINT64_MAX - blkid); /* no overflow */ - - dprintf_dnode(dn, "blkid=%llu nblks=%llu txg=%llu\n", - blkid, nblks, tx->tx_txg); - rp_tofind.fr_blkid = blkid; - rp = avl_find(tree, &rp_tofind, &where); - if (rp == NULL) - rp = avl_nearest(tree, where, AVL_BEFORE); - if (rp == NULL) - rp = avl_nearest(tree, where, AVL_AFTER); - - while (rp && (rp->fr_blkid <= blkid + nblks)) { - uint64_t fr_endblk = rp->fr_blkid + rp->fr_nblks; - free_range_t *nrp = AVL_NEXT(tree, rp); - - if (blkid <= rp->fr_blkid && endblk >= fr_endblk) { - /* clear this entire range */ - avl_remove(tree, rp); - kmem_free(rp, sizeof (free_range_t)); - } else if (blkid <= rp->fr_blkid && - endblk > rp->fr_blkid && endblk < fr_endblk) { - /* clear the beginning of this range */ - rp->fr_blkid = endblk; - rp->fr_nblks = fr_endblk - endblk; - } else if (blkid > rp->fr_blkid && blkid < fr_endblk && - endblk >= fr_endblk) { - /* clear the end of this range */ - rp->fr_nblks = blkid - rp->fr_blkid; - } else if (blkid > rp->fr_blkid && endblk < fr_endblk) { - /* clear a chunk out of this range */ - free_range_t *new_rp = - kmem_alloc(sizeof (free_range_t), KM_SLEEP); - - new_rp->fr_blkid = endblk; - new_rp->fr_nblks = fr_endblk - endblk; - avl_insert_here(tree, new_rp, rp, AVL_AFTER); - rp->fr_nblks = blkid - rp->fr_blkid; - } - /* there may be no overlap */ - rp = nrp; - } -} - -void dnode_free_range(dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx) { dmu_buf_impl_t *db; @@ -1669,22 +1600,15 @@ done: * We will finish up this free operation in the syncing phase. */ mutex_enter(&dn->dn_mtx); - dnode_clear_range(dn, blkid, nblks, tx); - { - free_range_t *rp, *found; - avl_index_t where; - avl_tree_t *tree = &dn->dn_ranges[tx->tx_txg&TXG_MASK]; - - /* Add new range to dn_ranges */ - rp = kmem_alloc(sizeof (free_range_t), KM_SLEEP); - rp->fr_blkid = blkid; - rp->fr_nblks = nblks; - found = avl_find(tree, rp, &where); - ASSERT(found == NULL); - avl_insert(tree, rp, where); - dprintf_dnode(dn, "blkid=%llu nblks=%llu txg=%llu\n", - blkid, nblks, tx->tx_txg); + int txgoff = tx->tx_txg & TXG_MASK; + if (dn->dn_free_ranges[txgoff] == NULL) { + dn->dn_free_ranges[txgoff] = + range_tree_create(NULL, NULL, &dn->dn_mtx); } + range_tree_clear(dn->dn_free_ranges[txgoff], blkid, nblks); + range_tree_add(dn->dn_free_ranges[txgoff], blkid, nblks); + dprintf_dnode(dn, "blkid=%llu nblks=%llu txg=%llu\n", + blkid, nblks, tx->tx_txg); mutex_exit(&dn->dn_mtx); dbuf_free_range(dn, blkid, blkid + nblks - 1, tx); @@ -1712,7 +1636,6 @@ dnode_spill_freed(dnode_t *dn) uint64_t dnode_block_freed(dnode_t *dn, uint64_t blkid) { - free_range_t range_tofind; void *dp = spa_get_dsl(dn->dn_objset->os_spa); int i; @@ -1732,20 +1655,10 @@ dnode_block_freed(dnode_t *dn, uint64_t if (blkid == DMU_SPILL_BLKID) return (dnode_spill_freed(dn)); - range_tofind.fr_blkid = blkid; mutex_enter(&dn->dn_mtx); for (i = 0; i < TXG_SIZE; i++) { - free_range_t *range_found; - avl_index_t idx; - - range_found = avl_find(&dn->dn_ranges[i], &range_tofind, &idx); - if (range_found) { - ASSERT(range_found->fr_nblks > 0); - break; - } - range_found = avl_nearest(&dn->dn_ranges[i], idx, AVL_BEFORE); - if (range_found && - range_found->fr_blkid + range_found->fr_nblks > blkid) + if (dn->dn_free_ranges[i] != NULL && + range_tree_contains(dn->dn_free_ranges[i], blkid, 1)) break; } mutex_exit(&dn->dn_mtx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri May 9 06:56:26 2014 (r265740) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -32,6 +32,7 @@ #include #include #include +#include #include static void @@ -318,7 +319,7 @@ free_children(dmu_buf_impl_t *db, uint64 * and "free" all the blocks contained there. */ static void -dnode_sync_free_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, +dnode_sync_free_range_impl(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx) { blkptr_t *bp = dn->dn_phys->dn_blkptr; @@ -376,6 +377,22 @@ dnode_sync_free_range(dnode_t *dn, uint6 } } +typedef struct dnode_sync_free_range_arg { + dnode_t *dsfra_dnode; + dmu_tx_t *dsfra_tx; +} dnode_sync_free_range_arg_t; + +static void +dnode_sync_free_range(void *arg, uint64_t blkid, uint64_t nblks) +{ + dnode_sync_free_range_arg_t *dsfra = arg; + dnode_t *dn = dsfra->dsfra_dnode; + + mutex_exit(&dn->dn_mtx); + dnode_sync_free_range_impl(dn, blkid, nblks, dsfra->dsfra_tx); + mutex_enter(&dn->dn_mtx); +} + /* * Try to kick all the dnode's dbufs out of the cache... */ @@ -536,7 +553,6 @@ dnode_sync_free(dnode_t *dn, dmu_tx_t *t void dnode_sync(dnode_t *dn, dmu_tx_t *tx) { - free_range_t *rp; dnode_phys_t *dnp = dn->dn_phys; int txgoff = tx->tx_txg & TXG_MASK; list_t *list = &dn->dn_dirty_records[txgoff]; @@ -594,9 +610,9 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) SPA_MINBLOCKSIZE) == 0); ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[0]) || dn->dn_maxblkid == 0 || list_head(list) != NULL || - avl_last(&dn->dn_ranges[txgoff]) || dn->dn_next_blksz[txgoff] >> SPA_MINBLOCKSHIFT == - dnp->dn_datablkszsec); + dnp->dn_datablkszsec || + range_tree_space(dn->dn_free_ranges[txgoff]) != 0); dnp->dn_datablkszsec = dn->dn_next_blksz[txgoff] >> SPA_MINBLOCKSHIFT; dn->dn_next_blksz[txgoff] = 0; @@ -655,13 +671,16 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) } /* process all the "freed" ranges in the file */ - while (rp = avl_last(&dn->dn_ranges[txgoff])) { - dnode_sync_free_range(dn, rp->fr_blkid, rp->fr_nblks, tx); - /* grab the mutex so we don't race with dnode_block_freed() */ + if (dn->dn_free_ranges[txgoff] != NULL) { + dnode_sync_free_range_arg_t dsfra; + dsfra.dsfra_dnode = dn; + dsfra.dsfra_tx = tx; mutex_enter(&dn->dn_mtx); - avl_remove(&dn->dn_ranges[txgoff], rp); + range_tree_vacate(dn->dn_free_ranges[txgoff], + dnode_sync_free_range, &dsfra); + range_tree_destroy(dn->dn_free_ranges[txgoff]); + dn->dn_free_ranges[txgoff] = NULL; mutex_exit(&dn->dn_mtx); - kmem_free(rp, sizeof (free_range_t)); } if (freeing_dnode) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri May 9 06:56:26 2014 (r265740) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -789,7 +789,7 @@ metaslab_ff_alloc(metaslab_t *msp, uint6 * may exist in the same region. */ uint64_t align = size & -size; - uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + uint64_t *cursor = &msp->ms_lbas[highbit64(align) - 1]; avl_tree_t *t = &msp->ms_tree->rt_root; return (metaslab_block_picker(t, cursor, size, align)); @@ -826,7 +826,7 @@ metaslab_df_alloc(metaslab_t *msp, uint6 * may exist in the same region. */ uint64_t align = size & -size; - uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + uint64_t *cursor = &msp->ms_lbas[highbit64(align) - 1]; range_tree_t *rt = msp->ms_tree; avl_tree_t *t = &rt->rt_root; uint64_t max_size = metaslab_block_maxsize(msp); @@ -942,7 +942,7 @@ metaslab_ndf_alloc(metaslab_t *msp, uint avl_tree_t *t = &msp->ms_tree->rt_root; avl_index_t where; range_seg_t *rs, rsearch; - uint64_t hbit = highbit(size); + uint64_t hbit = highbit64(size); uint64_t *cursor = &msp->ms_lbas[hbit - 1]; uint64_t max_size = metaslab_block_maxsize(msp); @@ -1185,7 +1185,7 @@ metaslab_weight_factor(metaslab_t *msp) if (msp->ms_sm == NULL) { vdev_t *vd = msp->ms_group->mg_vd; - i = highbit(msp->ms_size) - 1; + i = highbit64(msp->ms_size) - 1; sectors = msp->ms_size >> vd->vdev_ashift; return (sectors * i * vd->vdev_ashift); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Fri May 9 06:56:26 2014 (r265740) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ #include @@ -60,7 +60,7 @@ range_tree_stat_verify(range_tree_t *rt) for (rs = avl_first(&rt->rt_root); rs != NULL; rs = AVL_NEXT(&rt->rt_root, rs)) { uint64_t size = rs->rs_end - rs->rs_start; - int idx = highbit(size) - 1; + int idx = highbit64(size) - 1; hist[idx]++; ASSERT3U(hist[idx], !=, 0); @@ -79,7 +79,7 @@ static void range_tree_stat_incr(range_tree_t *rt, range_seg_t *rs) { uint64_t size = rs->rs_end - rs->rs_start; - int idx = highbit(size) - 1; + int idx = highbit64(size) - 1; ASSERT3U(idx, <, sizeof (rt->rt_histogram) / sizeof (*rt->rt_histogram)); @@ -93,7 +93,7 @@ static void range_tree_stat_decr(range_tree_t *rt, range_seg_t *rs) { uint64_t size = rs->rs_end - rs->rs_start; - int idx = highbit(size) - 1; + int idx = highbit64(size) - 1; ASSERT3U(idx, <, sizeof (rt->rt_histogram) / sizeof (*rt->rt_histogram)); @@ -299,10 +299,10 @@ range_tree_remove(void *arg, uint64_t st } static range_seg_t * -range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size, - avl_index_t *wherep) +range_tree_find_impl(range_tree_t *rt, uint64_t start, uint64_t size) { - range_seg_t rsearch, *rs; + avl_index_t where; + range_seg_t rsearch; uint64_t end = start + size; ASSERT(MUTEX_HELD(rt->rt_lock)); @@ -310,9 +310,14 @@ range_tree_find(range_tree_t *rt, uint64 rsearch.rs_start = start; rsearch.rs_end = end; - rs = avl_find(&rt->rt_root, &rsearch, wherep); + return (avl_find(&rt->rt_root, &rsearch, &where)); +} - if (rs != NULL && rs->rs_start <= start && rs->rs_end >= end) +static range_seg_t * +range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size) +{ + range_seg_t *rs = range_tree_find_impl(rt, start, size); + if (rs != NULL && rs->rs_start <= start && rs->rs_end >= start + size) return (rs); return (NULL); } @@ -321,10 +326,9 @@ void range_tree_verify(range_tree_t *rt, uint64_t off, uint64_t size) { range_seg_t *rs; - avl_index_t where; mutex_enter(rt->rt_lock); - rs = range_tree_find(rt, off, size, &where); + rs = range_tree_find(rt, off, size); if (rs != NULL) panic("freeing free block; rs=%p", (void *)rs); mutex_exit(rt->rt_lock); @@ -333,9 +337,23 @@ range_tree_verify(range_tree_t *rt, uint boolean_t range_tree_contains(range_tree_t *rt, uint64_t start, uint64_t size) { - avl_index_t where; + return (range_tree_find(rt, start, size) != NULL); +} - return (range_tree_find(rt, start, size, &where) != NULL); +/* + * Ensure that this range is not in the tree, regardless of whether + * it is currently in the tree. + */ +void +range_tree_clear(range_tree_t *rt, uint64_t start, uint64_t size) +{ + range_seg_t *rs; + + while ((rs = range_tree_find_impl(rt, start, size)) != NULL) { + uint64_t free_start = MAX(rs->rs_start, start); + uint64_t free_end = MIN(rs->rs_end, start + size); + range_tree_remove(rt, free_start, free_end - free_start); + } } void Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Fri May 9 06:56:26 2014 (r265740) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -267,7 +267,7 @@ space_map_set_blocksize(space_map_t *sm, * adding more blocks. The block size can grow until it * reaches space_map_max_blksz. */ - newsz = ISP2(size) ? size : 1ULL << highbit(size); + newsz = ISP2(size) ? size : 1ULL << highbit64(size); if (newsz > space_map_max_blksz) newsz = space_map_max_blksz; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri May 9 06:56:26 2014 (r265740) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_DNODE_H @@ -198,7 +198,7 @@ typedef struct dnode { /* protected by dn_mtx: */ kmutex_t dn_mtx; list_t dn_dirty_records[TXG_SIZE]; - avl_tree_t dn_ranges[TXG_SIZE]; + struct range_tree *dn_free_ranges[TXG_SIZE]; uint64_t dn_allocated_txg; uint64_t dn_free_txg; uint64_t dn_assigned_txg; @@ -280,8 +280,6 @@ void dnode_buf_byteswap(void *buf, size_ void dnode_verify(dnode_t *dn); int dnode_set_blksz(dnode_t *dn, uint64_t size, int ibs, dmu_tx_t *tx); void dnode_free_range(dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx); -void dnode_clear_range(dnode_t *dn, uint64_t blkid, - uint64_t nblks, dmu_tx_t *tx); void dnode_diduse_space(dnode_t *dn, int64_t space); void dnode_willuse_space(dnode_t *dn, int64_t space, dmu_tx_t *tx); void dnode_new_blkid(dnode_t *dn, uint64_t blkid, dmu_tx_t *tx, boolean_t); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri May 9 06:56:26 2014 (r265740) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_RANGE_TREE_H @@ -85,6 +85,7 @@ void range_tree_stat_verify(range_tree_t void range_tree_add(void *arg, uint64_t start, uint64_t size); void range_tree_remove(void *arg, uint64_t start, uint64_t size); +void range_tree_clear(range_tree_t *rt, uint64_t start, uint64_t size); void range_tree_vacate(range_tree_t *rt, range_tree_func_t *func, void *arg); void range_tree_walk(range_tree_t *rt, range_tree_func_t *func, void *arg); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri May 9 06:56:26 2014 (r265740) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. */ @@ -1626,7 +1626,7 @@ vdev_metaslab_set_size(vdev_t *vd) /* * Aim for roughly 200 metaslabs per vdev. */ - vd->vdev_ms_shift = highbit(vd->vdev_asize / 200); + vd->vdev_ms_shift = highbit64(vd->vdev_asize / 200); vd->vdev_ms_shift = MAX(vd->vdev_ms_shift, SPA_MAXBLOCKSHIFT); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Fri May 9 06:56:26 2014 (r265740) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ @@ -547,7 +547,7 @@ skip_open: pbsize = DEV_BSIZE; } - *ashift = highbit(MAX(pbsize, SPA_MINBLOCKSIZE)) - 1; + *ashift = highbit64(MAX(pbsize, SPA_MINBLOCKSIZE)) - 1; if (vd->vdev_wholedisk == 1) { int wce = 1; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri May 9 06:56:26 2014 (r265740) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ /* @@ -84,7 +84,7 @@ fzap_upgrade(zap_t *zap, dmu_tx_t *tx, z &zap->zap_f.zap_phys, zap_evict); mutex_init(&zap->zap_f.zap_num_entries_mtx, 0, 0, 0); - zap->zap_f.zap_block_shift = highbit(zap->zap_dbuf->db_size) - 1; + zap->zap_f.zap_block_shift = highbit64(zap->zap_dbuf->db_size) - 1; zp = zap->zap_f.zap_phys; /* @@ -458,7 +458,7 @@ zap_open_leaf(uint64_t blkid, dmu_buf_t rw_init(&l->l_rwlock, 0, 0, 0); rw_enter(&l->l_rwlock, RW_WRITER); l->l_blkid = blkid; - l->l_bs = highbit(db->db_size)-1; + l->l_bs = highbit64(db->db_size) - 1; l->l_dbuf = db; l->l_phys = NULL; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c Fri May 9 06:56:26 2014 (r265740) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ /* @@ -105,16 +105,16 @@ zap_leaf_byteswap(zap_leaf_phys_t *buf, { int i; zap_leaf_t l; - l.l_bs = highbit(size)-1; + l.l_bs = highbit64(size) - 1; l.l_phys = buf; - buf->l_hdr.lh_block_type = BSWAP_64(buf->l_hdr.lh_block_type); - buf->l_hdr.lh_prefix = BSWAP_64(buf->l_hdr.lh_prefix); - buf->l_hdr.lh_magic = BSWAP_32(buf->l_hdr.lh_magic); - buf->l_hdr.lh_nfree = BSWAP_16(buf->l_hdr.lh_nfree); - buf->l_hdr.lh_nentries = BSWAP_16(buf->l_hdr.lh_nentries); - buf->l_hdr.lh_prefix_len = BSWAP_16(buf->l_hdr.lh_prefix_len); - buf->l_hdr.lh_freelist = BSWAP_16(buf->l_hdr.lh_freelist); + buf->l_hdr.lh_block_type = BSWAP_64(buf->l_hdr.lh_block_type); + buf->l_hdr.lh_prefix = BSWAP_64(buf->l_hdr.lh_prefix); + buf->l_hdr.lh_magic = BSWAP_32(buf->l_hdr.lh_magic); + buf->l_hdr.lh_nfree = BSWAP_16(buf->l_hdr.lh_nfree); + buf->l_hdr.lh_nentries = BSWAP_16(buf->l_hdr.lh_nentries); + buf->l_hdr.lh_prefix_len = BSWAP_16(buf->l_hdr.lh_prefix_len); + buf->l_hdr.lh_freelist = BSWAP_16(buf->l_hdr.lh_freelist); for (i = 0; i < ZAP_LEAF_HASH_NUMENTRIES(&l); i++) buf->l_hash[i] = BSWAP_16(buf->l_hash[i]); @@ -157,7 +157,7 @@ zap_leaf_init(zap_leaf_t *l, boolean_t s { int i; - l->l_bs = highbit(l->l_dbuf->db_size)-1; + l->l_bs = highbit64(l->l_dbuf->db_size) - 1; zap_memset(&l->l_phys->l_hdr, 0, sizeof (struct zap_leaf_header)); zap_memset(l->l_phys->l_hash, CHAIN_END, 2*ZAP_LEAF_HASH_NUMENTRIES(l)); for (i = 0; i < ZAP_LEAF_NUMCHUNKS(l); i++) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Fri May 9 06:56:26 2014 (r265740) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #include @@ -380,7 +380,7 @@ mzap_open(objset_t *os, uint64_t obj, dm if (*(uint64_t *)db->db_data != ZBT_MICRO) { mutex_init(&zap->zap_f.zap_num_entries_mtx, 0, 0, 0); - zap->zap_f.zap_block_shift = highbit(db->db_size) - 1; + zap->zap_f.zap_block_shift = highbit64(db->db_size) - 1; } else { zap->zap_ismicro = TRUE; } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri May 9 06:56:26 2014 (r265740) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved. */ @@ -1357,7 +1357,7 @@ zio_execute(zio_t *zio) } zio->io_stage = stage; - rv = zio_pipeline[highbit(stage) - 1](&zio); + rv = zio_pipeline[highbit64(stage) - 1](&zio); if (rv == ZIO_PIPELINE_STOP) return; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/bitmap.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/bitmap.h Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/bitmap.h Fri May 9 06:56:26 2014 (r265740) @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2014 by Delphix. All rights reserved. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -31,8 +35,6 @@ #ifndef _SYS_BITMAP_H #define _SYS_BITMAP_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -152,6 +154,7 @@ extern int bt_range(ulong_t *bitmap, siz * Low order bit is 0, high order bit is 31. */ extern int highbit(ulong_t); +extern int highbit64(uint64_t); extern int lowbit(ulong_t); extern int bt_getlowbit(ulong_t *bitmap, size_t start, size_t stop); extern void bt_copy(ulong_t *, ulong_t *, ulong_t); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Fri May 9 05:39:57 2014 (r265739) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Fri May 9 06:56:26 2014 (r265740) @@ -409,6 +409,38 @@ highbit(ulong_t i) return (h); } +/* + * Find highest one bit set. + * Returns bit number + 1 of highest bit that is set, otherwise returns 0. + */ +static __inline int +highbit64(uint64_t i) +{ + int h = 1; + + if (i == 0) + return (0); + if (i & 0xffffffff00000000ULL) { + h += 32; i >>= 32; + } + if (i & 0xffff0000) { + h += 16; i >>= 16; + } + if (i & 0xff00) { + h += 8; i >>= 8; + } + if (i & 0xf0) { + h += 4; i >>= 4; + } + if (i & 0xc) { + h += 2; i >>= 2; + } + if (i & 0x2) { + h += 1; + } + return (h); +} + #ifdef __cplusplus } #endif From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 07:04:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C66758B6; Fri, 9 May 2014 07:04: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 B267AEED; Fri, 9 May 2014 07:04: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 s4974Djp091982; Fri, 9 May 2014 07:04:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4974DFt091979; Fri, 9 May 2014 07:04:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405090704.s4974DFt091979@svn.freebsd.org> From: Xin LI Date: Fri, 9 May 2014 07:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265741 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 07:04:13 -0000 Author: delphij Date: Fri May 9 07:04:12 2014 New Revision: 265741 URL: http://svnweb.freebsd.org/changeset/base/265741 Log: MFC r264671 (MFV r264668): 4754 io issued to near-full luns even after setting noalloc threshold 4755 mg_alloc_failures is no longer needed illumos/illumos@b6240e830b871f59c22a3918aebb3b36c872edba Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri May 9 06:56:26 2014 (r265740) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri May 9 07:04:12 2014 (r265741) @@ -41,7 +41,7 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab * avoid having to load lots of space_maps in a given txg. There are, * however, some cases where we want to avoid "fast" ganging and instead * we want to do an exhaustive search of all metaslabs on this device. - * Currently we don't allow any gang, zil, or dump device related allocations + * Currently we don't allow any gang, slog, or dump device related allocations * to "fast" gang. */ #define CAN_FASTGANG(flags) \ @@ -74,18 +74,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_ " of in-memory counterpart"); /* - * This value defines the number of allowed allocation failures per vdev. - * If a device reaches this threshold in a given txg then we consider skipping - * allocations on that device. The value of zfs_mg_alloc_failures is computed - * in zio_init() unless it has been overridden in /etc/system. - */ -int zfs_mg_alloc_failures = 0; -TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); -SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RWTUN, - &zfs_mg_alloc_failures, 0, - "Number of allowed allocation failures per vdev"); - -/* * 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 @@ -1707,10 +1695,7 @@ metaslab_sync_done(metaslab_t *msp, uint void metaslab_sync_reassess(metaslab_group_t *mg) { - int64_t failures = mg->mg_alloc_failures; - metaslab_group_alloc_update(mg); - atomic_add_64(&mg->mg_alloc_failures, -failures); /* * Preload the next potential metaslabs @@ -1737,7 +1722,7 @@ metaslab_distance(metaslab_t *msp, dva_t static uint64_t metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize, - uint64_t txg, uint64_t min_distance, dva_t *dva, int d, int flags) + uint64_t txg, uint64_t min_distance, dva_t *dva, int d) { spa_t *spa = mg->mg_vd->vdev_spa; metaslab_t *msp = NULL; @@ -1764,10 +1749,9 @@ metaslab_group_alloc(metaslab_group_t *m spa_dbgmsg(spa, "%s: failed to meet weight " "requirement: vdev %llu, txg %llu, mg %p, " "msp %p, psize %llu, asize %llu, " - "failures %llu, weight %llu", - spa_name(spa), mg->mg_vd->vdev_id, txg, - mg, msp, psize, asize, - mg->mg_alloc_failures, msp->ms_weight); + "weight %llu", spa_name(spa), + mg->mg_vd->vdev_id, txg, + mg, msp, psize, asize, msp->ms_weight); mutex_exit(&mg->mg_lock); return (-1ULL); } @@ -1800,27 +1784,6 @@ metaslab_group_alloc(metaslab_group_t *m mutex_enter(&msp->ms_lock); /* - * If we've already reached the allowable number of failed - * allocation attempts on this metaslab group then we - * consider skipping it. We skip it only if we're allowed - * to "fast" gang, the physical size is larger than - * a gang block, and we're attempting to allocate from - * the primary metaslab. - */ - if (mg->mg_alloc_failures > zfs_mg_alloc_failures && - CAN_FASTGANG(flags) && psize > SPA_GANGBLOCKSIZE && - activation_weight == METASLAB_WEIGHT_PRIMARY) { - spa_dbgmsg(spa, "%s: skipping metaslab group: " - "vdev %llu, txg %llu, mg %p, msp[%llu] %p, " - "psize %llu, asize %llu, failures %llu", - spa_name(spa), mg->mg_vd->vdev_id, txg, mg, - msp->ms_id, msp, psize, asize, - mg->mg_alloc_failures); - mutex_exit(&msp->ms_lock); - return (-1ULL); - } - - /* * Ensure that the metaslab we have selected is still * capable of handling our request. It's possible that * another thread may have changed the weight while we @@ -1859,8 +1822,6 @@ metaslab_group_alloc(metaslab_group_t *m if ((offset = metaslab_block_alloc(msp, asize)) != -1ULL) break; - atomic_inc_64(&mg->mg_alloc_failures); - metaslab_passivate(msp, metaslab_block_maxsize(msp)); mutex_exit(&msp->ms_lock); } @@ -2015,7 +1976,7 @@ top: ASSERT(P2PHASE(asize, 1ULL << vd->vdev_ashift) == 0); offset = metaslab_group_alloc(mg, psize, asize, txg, distance, - dva, d, flags); + dva, d); if (offset != -1ULL) { /* * If we've just selected this metaslab group, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Fri May 9 06:56:26 2014 (r265740) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Fri May 9 07:04:12 2014 (r265741) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H @@ -58,7 +58,6 @@ struct metaslab_group { kmutex_t mg_lock; avl_tree_t mg_metaslab_tree; uint64_t mg_aliquot; - uint64_t mg_alloc_failures; boolean_t mg_allocatable; /* can we allocate? */ uint64_t mg_free_capacity; /* percentage free */ int64_t mg_bias; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri May 9 06:56:26 2014 (r265740) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri May 9 07:04:12 2014 (r265741) @@ -90,7 +90,6 @@ kmem_cache_t *zio_data_buf_cache[SPA_MAX #ifdef _KERNEL extern vmem_t *zio_alloc_arena; #endif -extern int zfs_mg_alloc_failures; /* * The following actions directly effect the spa's sync-to-convergence logic. @@ -206,15 +205,6 @@ zio_init(void) } out: - /* - * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs - * to fail 3 times per txg or 8 failures, whichever is greater. - */ - if (zfs_mg_alloc_failures == 0) - zfs_mg_alloc_failures = MAX((3 * max_ncpus / 2), 8); - else if (zfs_mg_alloc_failures < 8) - zfs_mg_alloc_failures = 8; - zio_inject_init(); zio_trim_ksp = kstat_create("zfs", 0, "zio_trim", "misc", From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 07:07:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5A47FA44; Fri, 9 May 2014 07:07: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 479DCF1D; Fri, 9 May 2014 07:07: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 s4977QGH092582; Fri, 9 May 2014 07:07:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4977QWn092581; Fri, 9 May 2014 07:07:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405090707.s4977QWn092581@svn.freebsd.org> From: Xin LI Date: Fri, 9 May 2014 07:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265742 - stable/10/usr.sbin/portsnap/portsnap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 07:07:26 -0000 Author: delphij Date: Fri May 9 07:07:25 2014 New Revision: 265742 URL: http://svnweb.freebsd.org/changeset/base/265742 Log: MFC r264740: Use case insensitive match in portsnap. PR: bin/186510 Submitted by: olli Modified: stable/10/usr.sbin/portsnap/portsnap/portsnap.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/portsnap/portsnap/portsnap.sh ============================================================================== --- stable/10/usr.sbin/portsnap/portsnap/portsnap.sh Fri May 9 07:04:12 2014 (r265741) +++ stable/10/usr.sbin/portsnap/portsnap/portsnap.sh Fri May 9 07:07:25 2014 (r265742) @@ -362,7 +362,7 @@ fetch_pick_server_init() { # "$name server selection ..."; we allow either format. MLIST="_http._tcp.${SERVERNAME}" host -t srv "${MLIST}" | - sed -nE "s/${MLIST} (has SRV record|server selection) //p" | + sed -nE "s/${MLIST} (has SRV record|server selection) //Ip" | cut -f 1,2,4 -d ' ' | sed -e 's/\.$//' | sort > serverlist_full From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 07:12:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D3043CDE; Fri, 9 May 2014 07:12:33 +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 BC5C7FAF; Fri, 9 May 2014 07:12:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s497CXBc096569; Fri, 9 May 2014 07:12:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s497CVPm096548; Fri, 9 May 2014 07:12:31 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405090712.s497CVPm096548@svn.freebsd.org> From: Xin LI Date: Fri, 9 May 2014 07:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265744 - in stable/10: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/c... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 07:12:34 -0000 Author: delphij Date: Fri May 9 07:12:31 2014 New Revision: 265744 URL: http://svnweb.freebsd.org/changeset/base/265744 Log: MFC r264835 (MFV r264829): 3897 zfs filesystem and snapshot limits Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri May 9 07:07:38 2014 (r265743) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri May 9 07:12:31 2014 (r265744) @@ -24,13 +24,13 @@ .\" Copyright (c) 2012, Bryan Drewery .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved. -.\" Copyright (c) 2013, Joyent, Inc. All rights reserved. +.\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright (c) 2013, Steven Hartland .\" Copyright (c) 2014, Xin LI .\" .\" $FreeBSD$ .\" -.Dd April 5, 2014 +.Dd April 23, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -542,6 +542,13 @@ if the snapshot has been marked for defe .Qq Nm Cm destroy -d command. Otherwise, the property is .Cm off . +.It Sy filesystem_count +The total number of filesystems and volumes that exist under this location in the +dataset tree. +This value is only available when a +.Sy filesystem_limit +has +been set somewhere in the tree under which the dataset resides. .It Sy logicalreferenced The amount of space that is .Qq logically @@ -600,6 +607,12 @@ The compression ratio achieved for the space of this dataset, expressed as a multiplier. See also the .Sy compressratio property. +.It Sy snapshot_count +The total number of snapshots that exist under this location in the dataset tree. +This value is only available when a +.Sy snapshot_limit +has been set somewhere +in the tree under which the dataset resides. .It Sy type The type of dataset: .Sy filesystem , volume , No or Sy snapshot . @@ -1020,6 +1033,23 @@ The .Sy mlslabel property is currently not supported on .Fx . +.It Sy filesystem_limit Ns = Ns Ar count | Cm none +Limits the number of filesystems and volumes that can exist under this point in +the dataset tree. +The limit is not enforced if the user is allowed to change +the limit. +Setting a +.Sy filesystem_limit +on a descendent of a filesystem that +already has a +.Sy filesystem_limit +does not override the ancestor's +.Sy filesystem_limit , +but rather imposes an additional limit. +This feature must be enabled to be used +.Po see +.Xr zpool-features 7 +.Pc . .It Sy mountpoint Ns = Ns Ar path | Cm none | legacy Controls the mount point used for this file system. See the .Qq Sx Mount Points @@ -1061,6 +1091,27 @@ the ancestor's quota, but rather imposes Quotas cannot be set on volumes, as the .Sy volsize property acts as an implicit quota. +.It Sy snapshot_limit Ns = Ns Ar count | Cm none +Limits the number of snapshots that can be created on a dataset and its +descendents. +Setting a +.Sy snapshot_limit +on a descendent of a dataset that already +has a +.Sy snapshot_limit +does not override the ancestor's +.Sy snapshot_limit , +but +rather imposes an additional limit. +The limit is not enforced if the user is +allowed to change the limit. +For example, this means that recursive snapshots +taken from the global zone are counted against each delegated dataset within +a jail. +This feature must be enabled to be used +.Po see +.Xr zpool-features 7 +.Pc . .It Sy userquota@ Ns Ar user Ns = Ns Ar size | Cm none Limits the amount of space consumed by the specified user. Similar to the @@ -2738,6 +2789,7 @@ protocol .It dedup Ta property .It devices Ta property .It exec Ta property +.It filesystem_limit Ta property .It logbias Ta property .It jailed Ta property .It mlslabel Ta property @@ -2756,6 +2808,7 @@ protocol .It sharenfs Ta property .It sharesmb Ta property .It snapdir Ta property +.It snapshot_limit Ta property .It sync Ta property .It utf8only Ta property .It version Ta property @@ -3102,10 +3155,12 @@ pool/home/bob compression on pool/home/bob atime on default pool/home/bob devices on default pool/home/bob exec on default +pool/home/bob filesystem_limit none default pool/home/bob setuid on default pool/home/bob readonly off default pool/home/bob jailed off default pool/home/bob snapdir hidden default +pool/home/bob snapshot_limit none default pool/home/bob aclmode discard default pool/home/bob aclinherit restricted default pool/home/bob canmount on default Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Fri May 9 07:07:38 2014 (r265743) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Fri May 9 07:12:31 2014 (r265744) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2014 +.Dd April 23, 2014 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -187,6 +187,23 @@ This feature is .Sy active while there are any filesystems, volumes, or snapshots which were created after enabling this feature. +.It Sy filesystem_limits +.Bl -column "READ\-ONLY COMPATIBLE" "com.joyent:filesystem_limits" +.It GUID Ta com.joyent:filesystem_limits +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta extensible_dataset +.El +.Pp +This feature enables filesystem and snapshot limits. +These limits can be used +to control how many filesystems and/or snapshots can be created at the point in +the tree on which the limits are set. +.Pp +This feature is +.Sy active +once either of the limit properties has been +set on a dataset. +Once activated the feature is never deactivated. .It Sy lz4_compress .Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:lz4_compress" .It GUID Ta org.illumos:lz4_compress Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri May 9 07:07:38 2014 (r265743) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri May 9 07:12:31 2014 (r265744) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . @@ -1910,6 +1911,10 @@ get_numeric_property(zfs_handle_t *zhp, case ZFS_PROP_REFQUOTA: case ZFS_PROP_RESERVATION: case ZFS_PROP_REFRESERVATION: + case ZFS_PROP_FILESYSTEM_LIMIT: + case ZFS_PROP_SNAPSHOT_LIMIT: + case ZFS_PROP_FILESYSTEM_COUNT: + case ZFS_PROP_SNAPSHOT_COUNT: *val = getprop_uint64(zhp, prop, source); if (*source == NULL) { @@ -2315,6 +2320,30 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop } break; + case ZFS_PROP_FILESYSTEM_LIMIT: + case ZFS_PROP_SNAPSHOT_LIMIT: + case ZFS_PROP_FILESYSTEM_COUNT: + case ZFS_PROP_SNAPSHOT_COUNT: + + if (get_numeric_property(zhp, prop, src, &source, &val) != 0) + return (-1); + + /* + * If limit is UINT64_MAX, we translate this into 'none' (unless + * literal is set), and indicate that it's the default value. + * Otherwise, we print the number nicely and indicate that it's + * set locally. + */ + if (literal) { + (void) snprintf(propbuf, proplen, "%llu", + (u_longlong_t)val); + } else if (val == UINT64_MAX) { + (void) strlcpy(propbuf, "none", proplen); + } else { + zfs_nicenum(val, propbuf, proplen); + } + break; + case ZFS_PROP_REFRATIO: case ZFS_PROP_COMPRESSRATIO: if (get_numeric_property(zhp, prop, src, &source, &val) != 0) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri May 9 07:07:38 2014 (r265743) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri May 9 07:12:31 2014 (r265744) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -1268,6 +1269,16 @@ zprop_parse_value(libzfs_handle_t *hdl, "use 'none' to disable quota/refquota")); goto error; } + + /* + * Special handling for "*_limit=none". In this case it's not + * 0 but UINT64_MAX. + */ + if ((type & ZFS_TYPE_DATASET) && isnone && + (prop == ZFS_PROP_FILESYSTEM_LIMIT || + prop == ZFS_PROP_SNAPSHOT_LIMIT)) { + *ivalp = UINT64_MAX; + } break; case PROP_TYPE_INDEX: Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Fri May 9 07:07:38 2014 (r265743) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Fri May 9 07:12:31 2014 (r265744) @@ -205,4 +205,13 @@ zpool_feature_init(void) "com.delphix:bookmarks", "bookmarks", "\"zfs bookmark\" command", B_TRUE, B_FALSE, B_FALSE, bookmarks_deps); + + static const spa_feature_t filesystem_limits_deps[] = { + SPA_FEATURE_EXTENSIBLE_DATASET, + SPA_FEATURE_NONE + }; + zfeature_register(SPA_FEATURE_FS_SS_LIMIT, + "com.joyent:filesystem_limits", "filesystem_limits", + "Filesystem and snapshot limits.", B_TRUE, B_FALSE, B_FALSE, + filesystem_limits_deps); } Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Fri May 9 07:07:38 2014 (r265743) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Fri May 9 07:12:31 2014 (r265744) @@ -48,6 +48,7 @@ typedef enum spa_feature { SPA_FEATURE_HOLE_BIRTH, SPA_FEATURE_EXTENSIBLE_DATASET, SPA_FEATURE_BOOKMARKS, + SPA_FEATURE_FS_SS_LIMIT, SPA_FEATURES } spa_feature_t; Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Fri May 9 07:07:38 2014 (r265743) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Fri May 9 07:12:31 2014 (r265744) @@ -383,6 +383,18 @@ zfs_prop_init(void) zprop_register_number(ZFS_PROP_REFRESERVATION, "refreservation", 0, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, " | none", "REFRESERV"); + zprop_register_number(ZFS_PROP_FILESYSTEM_LIMIT, "filesystem_limit", + UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM, + " | none", "FSLIMIT"); + zprop_register_number(ZFS_PROP_SNAPSHOT_LIMIT, "snapshot_limit", + UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, + " | none", "SSLIMIT"); + zprop_register_number(ZFS_PROP_FILESYSTEM_COUNT, "filesystem_count", + UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM, + "", "FSCOUNT"); + zprop_register_number(ZFS_PROP_SNAPSHOT_COUNT, "snapshot_count", + UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, + "", "SSCOUNT"); /* inherit number properties */ zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize", Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri May 9 07:07:38 2014 (r265743) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri May 9 07:12:31 2014 (r265744) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -758,9 +759,11 @@ dmu_objset_create_check(void *arg, dmu_t dsl_dir_rele(pdd, FTAG); return (SET_ERROR(EEXIST)); } + error = dsl_fs_ss_limit_check(pdd, 1, ZFS_PROP_FILESYSTEM_LIMIT, NULL, + doca->doca_cred); dsl_dir_rele(pdd, FTAG); - return (0); + return (error); } static void @@ -844,6 +847,12 @@ dmu_objset_clone_check(void *arg, dmu_tx dsl_dir_rele(pdd, FTAG); return (SET_ERROR(EXDEV)); } + error = dsl_fs_ss_limit_check(pdd, 1, ZFS_PROP_FILESYSTEM_LIMIT, NULL, + doca->doca_cred); + if (error != 0) { + dsl_dir_rele(pdd, FTAG); + return (SET_ERROR(EDQUOT)); + } dsl_dir_rele(pdd, FTAG); error = dsl_dataset_hold(dp, doca->doca_origin, FTAG, &origin); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri May 9 07:07:38 2014 (r265743) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri May 9 07:12:31 2014 (r265744) @@ -22,7 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. */ @@ -806,6 +806,20 @@ recv_begin_check_existing_impl(dmu_recv_ if (error != ENOENT) return (error == 0 ? EEXIST : error); + /* + * Check snapshot limit before receiving. We'll recheck again at the + * end, but might as well abort before receiving if we're already over + * the limit. + * + * Note that we do not check the file system limit with + * dsl_dir_fscount_check because the temporary %clones don't count + * against that limit. + */ + error = dsl_fs_ss_limit_check(ds->ds_dir, 1, ZFS_PROP_SNAPSHOT_LIMIT, + NULL, drba->drba_cred); + if (error != 0) + return (error); + if (fromguid != 0) { dsl_dataset_t *snap; uint64_t obj = ds->ds_phys->ds_prev_snap_obj; @@ -912,6 +926,25 @@ dmu_recv_begin_check(void *arg, dmu_tx_t if (error != 0) return (error); + /* + * Check filesystem and snapshot limits before receiving. We'll + * recheck snapshot limits again at the end (we create the + * filesystems and increment those counts during begin_sync). + */ + error = dsl_fs_ss_limit_check(ds->ds_dir, 1, + ZFS_PROP_FILESYSTEM_LIMIT, NULL, drba->drba_cred); + if (error != 0) { + dsl_dataset_rele(ds, FTAG); + return (error); + } + + error = dsl_fs_ss_limit_check(ds->ds_dir, 1, + ZFS_PROP_SNAPSHOT_LIMIT, NULL, drba->drba_cred); + if (error != 0) { + dsl_dataset_rele(ds, FTAG); + return (error); + } + if (drba->drba_origin != NULL) { dsl_dataset_t *origin; error = dsl_dataset_hold(dp, drba->drba_origin, @@ -1021,6 +1054,7 @@ dmu_recv_begin(char *tofs, char *tosnap, drc->drc_tosnap = tosnap; drc->drc_tofs = tofs; drc->drc_force = force; + drc->drc_cred = CRED(); if (drrb->drr_magic == BSWAP_64(DMU_BACKUP_MAGIC)) drc->drc_byteswap = B_TRUE; @@ -1740,7 +1774,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * return (error); } error = dsl_dataset_snapshot_check_impl(origin_head, - drc->drc_tosnap, tx, B_TRUE); + drc->drc_tosnap, tx, B_TRUE, 1, drc->drc_cred); dsl_dataset_rele(origin_head, FTAG); if (error != 0) return (error); @@ -1748,7 +1782,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_destroy_head_check_impl(drc->drc_ds, 1); } else { error = dsl_dataset_snapshot_check_impl(drc->drc_ds, - drc->drc_tosnap, tx, B_TRUE); + drc->drc_tosnap, tx, B_TRUE, 1, drc->drc_cred); } return (error); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 9 07:07:38 2014 (r265743) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 9 07:12:31 2014 (r265744) @@ -22,7 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright (c) 2011 Martin Matuska * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2014 RackTop Systems. */ @@ -321,7 +321,8 @@ dsl_dataset_snap_lookup(dsl_dataset_t *d } int -dsl_dataset_snap_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx) +dsl_dataset_snap_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx, + boolean_t adj_cnt) { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; uint64_t snapobj = ds->ds_phys->ds_snapnames_zapobj; @@ -338,6 +339,11 @@ dsl_dataset_snap_remove(dsl_dataset_t *d err = zap_remove_norm(mos, snapobj, name, mt, tx); if (err == ENOTSUP && mt == MT_FIRST) err = zap_remove(mos, snapobj, name, tx); + + if (err == 0 && adj_cnt) + dsl_fs_ss_count_adjust(ds->ds_dir, -1, + DD_FIELD_SNAPSHOT_COUNT, tx); + return (err); } @@ -765,6 +771,21 @@ dsl_dataset_create_sync(dsl_dir_t *pdd, dsl_deleg_set_create_perms(dd, tx, cr); + /* + * Since we're creating a new node we know it's a leaf, so we can + * initialize the counts if the limit feature is active. + */ + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)) { + uint64_t cnt = 0; + objset_t *os = dd->dd_pool->dp_meta_objset; + + dsl_dir_zapify(dd, tx); + VERIFY0(zap_add(os, dd->dd_object, DD_FIELD_FILESYSTEM_COUNT, + sizeof (cnt), 1, &cnt, tx)); + VERIFY0(zap_add(os, dd->dd_object, DD_FIELD_SNAPSHOT_COUNT, + sizeof (cnt), 1, &cnt, tx)); + } + dsl_dir_rele(dd, FTAG); /* @@ -971,11 +992,12 @@ typedef struct dsl_dataset_snapshot_arg nvlist_t *ddsa_snaps; nvlist_t *ddsa_props; nvlist_t *ddsa_errors; + cred_t *ddsa_cr; } dsl_dataset_snapshot_arg_t; int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx, boolean_t recv) + dmu_tx_t *tx, boolean_t recv, uint64_t cnt, cred_t *cr) { int error; uint64_t value; @@ -1013,6 +1035,18 @@ dsl_dataset_snapshot_check_impl(dsl_data if (!recv && DS_IS_INCONSISTENT(ds)) return (SET_ERROR(EBUSY)); + /* + * Skip the check for temporary snapshots or if we have already checked + * the counts in dsl_dataset_snapshot_check. This means we really only + * check the count here when we're receiving a stream. + */ + if (cnt != 0 && cr != NULL) { + error = dsl_fs_ss_limit_check(ds->ds_dir, cnt, + ZFS_PROP_SNAPSHOT_LIMIT, NULL, cr); + if (error != 0) + return (error); + } + error = dsl_dataset_snapshot_reserve_space(ds, tx); if (error != 0) return (error); @@ -1028,6 +1062,99 @@ dsl_dataset_snapshot_check(void *arg, dm nvpair_t *pair; int rv = 0; + /* + * Pre-compute how many total new snapshots will be created for each + * level in the tree and below. This is needed for validating the + * snapshot limit when either taking a recursive snapshot or when + * taking multiple snapshots. + * + * The problem is that the counts are not actually adjusted when + * we are checking, only when we finally sync. For a single snapshot, + * this is easy, the count will increase by 1 at each node up the tree, + * but its more complicated for the recursive/multiple snapshot case. + * + * The dsl_fs_ss_limit_check function does recursively check the count + * at each level up the tree but since it is validating each snapshot + * independently we need to be sure that we are validating the complete + * count for the entire set of snapshots. We do this by rolling up the + * counts for each component of the name into an nvlist and then + * checking each of those cases with the aggregated count. + * + * This approach properly handles not only the recursive snapshot + * case (where we get all of those on the ddsa_snaps list) but also + * the sibling case (e.g. snapshot a/b and a/c so that we will also + * validate the limit on 'a' using a count of 2). + * + * We validate the snapshot names in the third loop and only report + * name errors once. + */ + if (dmu_tx_is_syncing(tx)) { + nvlist_t *cnt_track = NULL; + cnt_track = fnvlist_alloc(); + + /* Rollup aggregated counts into the cnt_track list */ + for (pair = nvlist_next_nvpair(ddsa->ddsa_snaps, NULL); + pair != NULL; + pair = nvlist_next_nvpair(ddsa->ddsa_snaps, pair)) { + char *pdelim; + uint64_t val; + char nm[MAXPATHLEN]; + + (void) strlcpy(nm, nvpair_name(pair), sizeof (nm)); + pdelim = strchr(nm, '@'); + if (pdelim == NULL) + continue; + *pdelim = '\0'; + + do { + if (nvlist_lookup_uint64(cnt_track, nm, + &val) == 0) { + /* update existing entry */ + fnvlist_add_uint64(cnt_track, nm, + val + 1); + } else { + /* add to list */ + fnvlist_add_uint64(cnt_track, nm, 1); + } + + pdelim = strrchr(nm, '/'); + if (pdelim != NULL) + *pdelim = '\0'; + } while (pdelim != NULL); + } + + /* Check aggregated counts at each level */ + for (pair = nvlist_next_nvpair(cnt_track, NULL); + pair != NULL; pair = nvlist_next_nvpair(cnt_track, pair)) { + int error = 0; + char *name; + uint64_t cnt = 0; + dsl_dataset_t *ds; + + name = nvpair_name(pair); + cnt = fnvpair_value_uint64(pair); + ASSERT(cnt > 0); + + error = dsl_dataset_hold(dp, name, FTAG, &ds); + if (error == 0) { + error = dsl_fs_ss_limit_check(ds->ds_dir, cnt, + ZFS_PROP_SNAPSHOT_LIMIT, NULL, + ddsa->ddsa_cr); + dsl_dataset_rele(ds, FTAG); + } + + if (error != 0) { + if (ddsa->ddsa_errors != NULL) + fnvlist_add_int32(ddsa->ddsa_errors, + name, error); + rv = error; + /* only report one error for this check */ + break; + } + } + nvlist_free(cnt_track); + } + for (pair = nvlist_next_nvpair(ddsa->ddsa_snaps, NULL); pair != NULL; pair = nvlist_next_nvpair(ddsa->ddsa_snaps, pair)) { int error = 0; @@ -1048,8 +1175,9 @@ dsl_dataset_snapshot_check(void *arg, dm if (error == 0) error = dsl_dataset_hold(dp, dsname, FTAG, &ds); if (error == 0) { + /* passing 0/NULL skips dsl_fs_ss_limit_check */ error = dsl_dataset_snapshot_check_impl(ds, - atp + 1, tx, B_FALSE); + atp + 1, tx, B_FALSE, 0, NULL); dsl_dataset_rele(ds, FTAG); } @@ -1061,6 +1189,7 @@ dsl_dataset_snapshot_check(void *arg, dm rv = error; } } + return (rv); } @@ -1088,6 +1217,7 @@ dsl_dataset_snapshot_sync_impl(dsl_datas bcmp(&os->os_phys->os_zil_header, &zero_zil, sizeof (zero_zil)) == 0); + dsl_fs_ss_count_adjust(ds->ds_dir, 1, DD_FIELD_SNAPSHOT_COUNT, tx); /* * The origin's ds_creation_txg has to be < TXG_INITIAL @@ -1266,6 +1396,7 @@ dsl_dataset_snapshot(nvlist_t *snaps, nv ddsa.ddsa_snaps = snaps; ddsa.ddsa_props = props; ddsa.ddsa_errors = errors; + ddsa.ddsa_cr = CRED(); if (error == 0) { error = dsl_sync_task(firstname, dsl_dataset_snapshot_check, @@ -1315,8 +1446,9 @@ dsl_dataset_snapshot_tmp_check(void *arg if (error != 0) return (error); + /* NULL cred means no limit check for tmp snapshot */ error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, - tx, B_FALSE); + tx, B_FALSE, 0, NULL); if (error != 0) { dsl_dataset_rele(ds, FTAG); return (error); @@ -1689,7 +1821,8 @@ dsl_dataset_rename_snapshot_sync_impl(ds spa_history_log_internal_ds(ds, "rename", tx, "-> @%s", ddrsa->ddrsa_newsnapname); - VERIFY0(dsl_dataset_snap_remove(hds, ddrsa->ddrsa_oldsnapname, tx)); + VERIFY0(dsl_dataset_snap_remove(hds, ddrsa->ddrsa_oldsnapname, tx, + B_FALSE)); mutex_enter(&ds->ds_lock); (void) strcpy(ds->ds_snapname, ddrsa->ddrsa_newsnapname); mutex_exit(&ds->ds_lock); @@ -1936,6 +2069,7 @@ typedef struct dsl_dataset_promote_arg { dsl_dataset_t *origin_origin; /* origin of the origin */ uint64_t used, comp, uncomp, unique, cloneusedsnap, originusedsnap; char *err_ds; + cred_t *cr; } dsl_dataset_promote_arg_t; static int snaplist_space(list_t *l, uint64_t mintxg, uint64_t *spacep); @@ -1953,6 +2087,7 @@ dsl_dataset_promote_check(void *arg, dmu dsl_dataset_t *origin_ds; int err; uint64_t unused; + uint64_t ss_mv_cnt; err = promote_hold(ddpa, dp, FTAG); if (err != 0) @@ -1999,6 +2134,7 @@ dsl_dataset_promote_check(void *arg, dmu * Note however, if we stop before we reach the ORIGIN we get: * uN + kN + kN-1 + ... + kM - uM-1 */ + ss_mv_cnt = 0; ddpa->used = origin_ds->ds_phys->ds_referenced_bytes; ddpa->comp = origin_ds->ds_phys->ds_compressed_bytes; ddpa->uncomp = origin_ds->ds_phys->ds_uncompressed_bytes; @@ -2007,6 +2143,8 @@ dsl_dataset_promote_check(void *arg, dmu uint64_t val, dlused, dlcomp, dluncomp; dsl_dataset_t *ds = snap->ds; + ss_mv_cnt++; + /* * If there are long holds, we won't be able to evict * the objset. @@ -2049,9 +2187,9 @@ dsl_dataset_promote_check(void *arg, dmu ddpa->origin_origin->ds_phys->ds_uncompressed_bytes; } - /* Check that there is enough space here */ + /* Check that there is enough space and limit headroom here */ err = dsl_dir_transfer_possible(origin_ds->ds_dir, hds->ds_dir, - ddpa->used); + 0, ss_mv_cnt, ddpa->used, ddpa->cr); if (err != 0) goto out; @@ -2191,10 +2329,12 @@ dsl_dataset_promote_sync(void *arg, dmu_ /* move snap name entry */ VERIFY0(dsl_dataset_get_snapname(ds)); VERIFY0(dsl_dataset_snap_remove(origin_head, - ds->ds_snapname, tx)); + ds->ds_snapname, tx, B_TRUE)); VERIFY0(zap_add(dp->dp_meta_objset, hds->ds_phys->ds_snapnames_zapobj, ds->ds_snapname, 8, 1, &ds->ds_object, tx)); + dsl_fs_ss_count_adjust(hds->ds_dir, 1, + DD_FIELD_SNAPSHOT_COUNT, tx); /* change containing dsl_dir */ dmu_buf_will_dirty(ds->ds_dbuf, tx); @@ -2432,6 +2572,7 @@ dsl_dataset_promote(const char *name, ch ddpa.ddpa_clonename = name; ddpa.err_ds = conflsnap; + ddpa.cr = CRED(); return (dsl_sync_task(name, dsl_dataset_promote_check, dsl_dataset_promote_sync, &ddpa, 2 + numsnaps)); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Fri May 9 07:07:38 2014 (r265743) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Fri May 9 07:12:31 2014 (r265744) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright (c) 2013 by Joyent, Inc. All rights reserved. */ #include @@ -430,7 +431,7 @@ dsl_destroy_snapshot_sync_impl(dsl_datas ASSERT3U(val, ==, obj); } #endif - VERIFY0(dsl_dataset_snap_remove(ds_head, ds->ds_snapname, tx)); + VERIFY0(dsl_dataset_snap_remove(ds_head, ds->ds_snapname, tx, B_TRUE)); dsl_dataset_rele(ds_head, FTAG); if (ds_prev != NULL) @@ -657,6 +658,17 @@ dsl_dir_destroy_sync(uint64_t ddobj, dmu ASSERT0(dd->dd_phys->dd_head_dataset_obj); /* + * Decrement the filesystem count for all parent filesystems. + * + * When we receive an incremental stream into a filesystem that already + * exists, a temporary clone is created. We never count this temporary + * clone, whose name begins with a '%'. + */ + if (dd->dd_myname[0] != '%' && dd->dd_parent != NULL) + dsl_fs_ss_count_adjust(dd->dd_parent, -1, + DD_FIELD_FILESYSTEM_COUNT, tx); + + /* * Remove our reservation. The impl() routine avoids setting the * actual property, which would require the (already destroyed) ds. */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Fri May 9 07:07:38 2014 (r265743) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Fri May 9 07:12:31 2014 (r265744) @@ -23,6 +23,7 @@ * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2014 Joyent, Inc. All rights reserved. */ #include @@ -44,7 +45,86 @@ #ifdef _KERNEL #include #endif +#include +#include +#include #include "zfs_namecheck.h" +#include "zfs_prop.h" + +/* + * Filesystem and Snapshot Limits + * ------------------------------ + * + * These limits are used to restrict the number of filesystems and/or snapshots + * that can be created at a given level in the tree or below. A typical + * use-case is with a delegated dataset where the administrator wants to ensure + * that a user within the zone is not creating too many additional filesystems + * or snapshots, even though they're not exceeding their space quota. + * + * The filesystem and snapshot counts are stored as extensible properties. This + * capability is controlled by a feature flag and must be enabled to be used. + * Once enabled, the feature is not active until the first limit is set. At + * that point, future operations to create/destroy filesystems or snapshots + * will validate and update the counts. + * + * Because the count properties will not exist before the feature is active, + * the counts are updated when a limit is first set on an uninitialized + * dsl_dir node in the tree (The filesystem/snapshot count on a node includes + * all of the nested filesystems/snapshots. Thus, a new leaf node has a + * filesystem count of 0 and a snapshot count of 0. Non-existent filesystem and + * snapshot count properties on a node indicate uninitialized counts on that + * node.) When first setting a limit on an uninitialized node, the code starts + * at the filesystem with the new limit and descends into all sub-filesystems + * to add the count properties. + * + * In practice this is lightweight since a limit is typically set when the + * filesystem is created and thus has no children. Once valid, changing the + * limit value won't require a re-traversal since the counts are already valid. + * When recursively fixing the counts, if a node with a limit is encountered + * during the descent, the counts are known to be valid and there is no need to + * descend into that filesystem's children. The counts on filesystems above the + * one with the new limit will still be uninitialized, unless a limit is + * eventually set on one of those filesystems. The counts are always recursively + * updated when a limit is set on a dataset, unless there is already a limit. + * When a new limit value is set on a filesystem with an existing limit, it is + * possible for the new limit to be less than the current count at that level + * since a user who can change the limit is also allowed to exceed the limit. + * + * Once the feature is active, then whenever a filesystem or snapshot is + * created, the code recurses up the tree, validating the new count against the + * limit at each initialized level. In practice, most levels will not have a + * limit set. If there is a limit at any initialized level up the tree, the + * check must pass or the creation will fail. Likewise, when a filesystem or + * snapshot is destroyed, the counts are recursively adjusted all the way up + * the initizized nodes in the tree. Renaming a filesystem into different point + * in the tree will first validate, then update the counts on each branch up to + * the common ancestor. A receive will also validate the counts and then update + * them. + * + * An exception to the above behavior is that the limit is not enforced if the + * user has permission to modify the limit. This is primarily so that + * recursive snapshots in the global zone always work. We want to prevent a + * denial-of-service in which a lower level delegated dataset could max out its + * limit and thus block recursive snapshots from being taken in the global zone. + * Because of this, it is possible for the snapshot count to be over the limit + * and snapshots taken in the global zone could cause a lower level dataset to + * hit or exceed its limit. The administrator taking the global zone recursive + * snapshot should be aware of this side-effect and behave accordingly. + * For consistency, the filesystem limit is also not enforced if the user can + * modify the limit. + * + * The filesystem and snapshot limits are validated by dsl_fs_ss_limit_check() + * and updated by dsl_fs_ss_count_adjust(). A new limit value is setup in + * dsl_dir_activate_fs_ss_limit() and the counts are adjusted, if necessary, by + * dsl_dir_init_fs_ss_count(). + * + * There is a special case when we receive a filesystem that already exists. In + * this case a temporary clone name of %X is created (see dmu_recv_begin). We + * never update the filesystem counts for temporary clones. + * + * Likewise, we do not update the snapshot counts for temporary snapshots, + * such as those created by zfs diff. + */ static uint64_t dsl_dir_space_towrite(dsl_dir_t *dd); @@ -383,6 +463,402 @@ dsl_dir_hold(dsl_pool_t *dp, const char return (err); } +/* + * If the counts are already initialized for this filesystem and its + * descendants then do nothing, otherwise initialize the counts. + * + * The counts on this filesystem, and those below, may be uninitialized due to + * either the use of a pre-existing pool which did not support the + * filesystem/snapshot limit feature, or one in which the feature had not yet + * been enabled. + * + * Recursively descend the filesystem tree and update the filesystem/snapshot + * counts on each filesystem below, then update the cumulative count on the + * current filesystem. If the filesystem already has a count set on it, + * then we know that its counts, and the counts on the filesystems below it, + * are already correct, so we don't have to update this filesystem. + */ +static void +dsl_dir_init_fs_ss_count(dsl_dir_t *dd, dmu_tx_t *tx) +{ + uint64_t my_fs_cnt = 0; + uint64_t my_ss_cnt = 0; + dsl_pool_t *dp = dd->dd_pool; + objset_t *os = dp->dp_meta_objset; + zap_cursor_t *zc; + zap_attribute_t *za; + dsl_dataset_t *ds; + + ASSERT(spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)); + ASSERT(dsl_pool_config_held(dp)); + ASSERT(dmu_tx_is_syncing(tx)); + + dsl_dir_zapify(dd, tx); + + /* + * If the filesystem count has already been initialized then we + * don't need to recurse down any further. + */ + if (zap_contains(os, dd->dd_object, DD_FIELD_FILESYSTEM_COUNT) == 0) + return; + + zc = kmem_alloc(sizeof (zap_cursor_t), KM_SLEEP); + za = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP); + + /* Iterate my child dirs */ + for (zap_cursor_init(zc, os, dd->dd_phys->dd_child_dir_zapobj); + zap_cursor_retrieve(zc, za) == 0; zap_cursor_advance(zc)) { + dsl_dir_t *chld_dd; + uint64_t count; + + VERIFY0(dsl_dir_hold_obj(dp, za->za_first_integer, NULL, FTAG, + &chld_dd)); + + /* + * Ignore hidden ($FREE, $MOS & $ORIGIN) objsets and + * temporary datasets. + */ + if (chld_dd->dd_myname[0] == '$' || + chld_dd->dd_myname[0] == '%') { + dsl_dir_rele(chld_dd, FTAG); + continue; + } + + my_fs_cnt++; /* count this child */ + + dsl_dir_init_fs_ss_count(chld_dd, tx); + + VERIFY0(zap_lookup(os, chld_dd->dd_object, + DD_FIELD_FILESYSTEM_COUNT, sizeof (count), 1, &count)); + my_fs_cnt += count; + VERIFY0(zap_lookup(os, chld_dd->dd_object, + DD_FIELD_SNAPSHOT_COUNT, sizeof (count), 1, &count)); + my_ss_cnt += count; + + dsl_dir_rele(chld_dd, FTAG); + } + zap_cursor_fini(zc); + /* Count my snapshots (we counted children's snapshots above) */ + VERIFY0(dsl_dataset_hold_obj(dd->dd_pool, + dd->dd_phys->dd_head_dataset_obj, FTAG, &ds)); + + for (zap_cursor_init(zc, os, ds->ds_phys->ds_snapnames_zapobj); + zap_cursor_retrieve(zc, za) == 0; + zap_cursor_advance(zc)) { + /* Don't count temporary snapshots */ + if (za->za_name[0] != '%') + my_ss_cnt++; + } + + dsl_dataset_rele(ds, FTAG); + + kmem_free(zc, sizeof (zap_cursor_t)); + kmem_free(za, sizeof (zap_attribute_t)); + + /* we're in a sync task, update counts */ + dmu_buf_will_dirty(dd->dd_dbuf, tx); + VERIFY0(zap_add(os, dd->dd_object, DD_FIELD_FILESYSTEM_COUNT, + sizeof (my_fs_cnt), 1, &my_fs_cnt, tx)); + VERIFY0(zap_add(os, dd->dd_object, DD_FIELD_SNAPSHOT_COUNT, + sizeof (my_ss_cnt), 1, &my_ss_cnt, tx)); +} + +static int +dsl_dir_actv_fs_ss_limit_check(void *arg, dmu_tx_t *tx) +{ + char *ddname = (char *)arg; + dsl_pool_t *dp = dmu_tx_pool(tx); + dsl_dataset_t *ds; + dsl_dir_t *dd; + int error; + + error = dsl_dataset_hold(dp, ddname, FTAG, &ds); + if (error != 0) + return (error); + + if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)) { + dsl_dataset_rele(ds, FTAG); + return (SET_ERROR(ENOTSUP)); + } + + dd = ds->ds_dir; + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT) && + dsl_dir_is_zapified(dd) && + zap_contains(dp->dp_meta_objset, dd->dd_object, + DD_FIELD_FILESYSTEM_COUNT) == 0) { + dsl_dataset_rele(ds, FTAG); + return (SET_ERROR(EALREADY)); + } + + dsl_dataset_rele(ds, FTAG); + return (0); +} + +static void +dsl_dir_actv_fs_ss_limit_sync(void *arg, dmu_tx_t *tx) +{ + char *ddname = (char *)arg; + dsl_pool_t *dp = dmu_tx_pool(tx); + dsl_dataset_t *ds; + spa_t *spa; + + VERIFY0(dsl_dataset_hold(dp, ddname, FTAG, &ds)); + + spa = dsl_dataset_get_spa(ds); + + if (!spa_feature_is_active(spa, SPA_FEATURE_FS_SS_LIMIT)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 07:17:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1AEB3E91; Fri, 9 May 2014 07:17: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 074A7FE0; Fri, 9 May 2014 07:17: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 s497HT7K097363; Fri, 9 May 2014 07:17:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s497HTOB097361; Fri, 9 May 2014 07:17:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405090717.s497HTOB097361@svn.freebsd.org> From: Xin LI Date: Fri, 9 May 2014 07:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265745 - in stable/10/sys/cddl/contrib/opensolaris: common/avl uts/common/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 07:17:30 -0000 Author: delphij Date: Fri May 9 07:17:29 2014 New Revision: 265745 URL: http://svnweb.freebsd.org/changeset/base/265745 Log: MFC r264836 (MFV r264830): 4745 fix AVL code misspellings Modified: stable/10/sys/cddl/contrib/opensolaris/common/avl/avl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/common/avl/avl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/avl/avl.c Fri May 9 07:12:31 2014 (r265744) +++ stable/10/sys/cddl/contrib/opensolaris/common/avl/avl.c Fri May 9 07:17:29 2014 (r265745) @@ -37,7 +37,7 @@ * insertion and deletion relatively efficiently. Searching the tree is * still a fast operation, roughly O(log(N)). * - * The key to insertion and deletion is a set of tree maniuplations called + * The key to insertion and deletion is a set of tree manipulations called * rotations, which bring unbalanced subtrees back into the semi-balanced state. * * This implementation of AVL trees has the following peculiarities: @@ -45,7 +45,7 @@ * - The AVL specific data structures are physically embedded as fields * in the "using" data structures. To maintain generality the code * must constantly translate between "avl_node_t *" and containing - * data structure "void *"s by adding/subracting the avl_offset. + * data structure "void *"s by adding/subtracting the avl_offset. * * - Since the AVL data is always embedded in other structures, there is * no locking or memory allocation in the AVL routines. This must be @@ -94,7 +94,7 @@ #include /* - * Small arrays to translate between balance (or diff) values and child indeces. + * Small arrays to translate between balance (or diff) values and child indices. * * Code that deals with binary tree data structures will randomly use * left and right children when examining a tree. C "if()" statements @@ -114,7 +114,8 @@ static const int avl_balance2child[] = * * - If there is a left child, go to it, then to it's rightmost descendant. * - * - otherwise we return thru parent nodes until we've come from a right child. + * - otherwise we return through parent nodes until we've come from a right + * child. * * Return Value: * NULL - if at the end of the nodes @@ -919,7 +920,7 @@ avl_is_empty(avl_tree_t *tree) /* * Post-order tree walk used to visit all tree nodes and destroy the tree - * in post order. This is used for destroying a tree w/o paying any cost + * in post order. This is used for destroying a tree without paying any cost * for rebalancing it. * * example: Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Fri May 9 07:12:31 2014 (r265744) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Fri May 9 07:17:29 2014 (r265745) @@ -39,7 +39,7 @@ extern "C" { #include /* - * This is a generic implemenatation of AVL trees for use in the Solaris kernel. + * This is a generic implementation of AVL trees for use in the Solaris kernel. * The interfaces provide an efficient way of implementing an ordered set of * data structures. * @@ -175,7 +175,7 @@ extern void avl_insert(avl_tree_t *tree, * Insert "new_data" in "tree" in the given "direction" either after * or before the data "here". * - * This might be usefull for avl clients caching recently accessed + * This might be useful for avl clients caching recently accessed * data to avoid doing avl_find() again for insertion. * * new_data - new data to insert From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 07:21:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7055CFD; Fri, 9 May 2014 07:21:33 +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 5D5D1D5; Fri, 9 May 2014 07:21:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s497LXPn098811; Fri, 9 May 2014 07:21:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s497LXFE098810; Fri, 9 May 2014 07:21:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405090721.s497LXFE098810@svn.freebsd.org> From: Xin LI Date: Fri, 9 May 2014 07:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265746 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 07:21:33 -0000 Author: delphij Date: Fri May 9 07:21:32 2014 New Revision: 265746 URL: http://svnweb.freebsd.org/changeset/base/265746 Log: MFC r265458: Import George Wilson's change for Illumos #4730: 4730 metaslab group taskq should be destroyed in metaslab_group_destroy() Reviewed by: Alex Reece Reviewed by: Matthew Ahrens Reviewed by: Sebastien Roy Original author: George Wilson Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri May 9 07:17:29 2014 (r265745) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri May 9 07:21:32 2014 (r265746) @@ -411,7 +411,7 @@ metaslab_group_create(metaslab_class_t * mg->mg_class = mc; mg->mg_activation_count = 0; - mg->mg_taskq = taskq_create("metaslab_group_tasksq", metaslab_load_pct, + mg->mg_taskq = taskq_create("metaslab_group_taskq", metaslab_load_pct, minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); return (mg); @@ -429,6 +429,7 @@ metaslab_group_destroy(metaslab_group_t */ ASSERT(mg->mg_activation_count <= 0); + taskq_destroy(mg->mg_taskq); avl_destroy(&mg->mg_metaslab_tree); mutex_destroy(&mg->mg_lock); kmem_free(mg, sizeof (metaslab_group_t)); From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 07:24:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8B85126B; Fri, 9 May 2014 07:24: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 7944FEE; Fri, 9 May 2014 07:24: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 s497OdFF001488; Fri, 9 May 2014 07:24:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s497OdDp001487; Fri, 9 May 2014 07:24:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405090724.s497OdDp001487@svn.freebsd.org> From: Xin LI Date: Fri, 9 May 2014 07:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265747 - stable/10/lib/libmagic X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 07:24:39 -0000 Author: delphij Date: Fri May 9 07:24:39 2014 New Revision: 265747 URL: http://svnweb.freebsd.org/changeset/base/265747 Log: MFC r265464: Sort .ALLSRC before concatenating files together. This makes sure that the file are always built the same. (Note that Header and Localstuff must appear first and in that order, the sorting does not affect as a coincident effect). Submitted by: sjg Modified: stable/10/lib/libmagic/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libmagic/Makefile ============================================================================== --- stable/10/lib/libmagic/Makefile Fri May 9 07:21:32 2014 (r265746) +++ stable/10/lib/libmagic/Makefile Fri May 9 07:24:39 2014 (r265747) @@ -32,7 +32,7 @@ MAGFILES= ${CONTRDIR}/Header\ ${CONTRDIR}/Magdir/[a-z]* magic: ${MAGFILES} - cat ${.ALLSRC} > ${.TARGET} + cat ${.ALLSRC:O} > ${.TARGET} magic.mgc: mkmagic magic ./mkmagic magic From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 13:18:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4F6A3D0D; Fri, 9 May 2014 13:18: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 3C3FD32C; Fri, 9 May 2014 13:18: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 s49DIP2N056251; Fri, 9 May 2014 13:18:25 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49DIPbl056250; Fri, 9 May 2014 13:18:25 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405091318.s49DIPbl056250@svn.freebsd.org> From: Christian Brueffer Date: Fri, 9 May 2014 13:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265768 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 13:18:25 -0000 Author: brueffer Date: Fri May 9 13:18:24 2014 New Revision: 265768 URL: http://svnweb.freebsd.org/changeset/base/265768 Log: MFC: r265244 Free resources in an error case. CID: 1018947 Found with: Coverity Prevent(tm) Modified: stable/10/sys/kern/kern_cpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_cpu.c ============================================================================== --- stable/10/sys/kern/kern_cpu.c Fri May 9 13:07:39 2014 (r265767) +++ stable/10/sys/kern/kern_cpu.c Fri May 9 13:18:24 2014 (r265768) @@ -1037,6 +1037,7 @@ cpufreq_unregister(device_t dev) if (cf_dev == NULL) { device_printf(dev, "warning: cpufreq_unregister called with no cpufreq device active\n"); + free(devs, M_TEMP); return (0); } cfcount = 0; From owner-svn-src-stable-10@FreeBSD.ORG Fri May 9 15:55:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9D7C02E7; Fri, 9 May 2014 15:55: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 8A1CE358; Fri, 9 May 2014 15:55: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 s49FtjxC027560; Fri, 9 May 2014 15:55:45 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49FtjPI027558; Fri, 9 May 2014 15:55:45 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201405091555.s49FtjPI027558@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 9 May 2014 15:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265781 - stable/10/usr.sbin/daemon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 15:55:45 -0000 Author: jh Date: Fri May 9 15:55:45 2014 New Revision: 265781 URL: http://svnweb.freebsd.org/changeset/base/265781 Log: MFC r264194: Fork a child process and wait until the process terminates when the -P option is specified. This behavior is documented on the manual page. PR: bin/187265 Modified: stable/10/usr.sbin/daemon/daemon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/daemon/daemon.c ============================================================================== --- stable/10/usr.sbin/daemon/daemon.c Fri May 9 14:35:07 2014 (r265780) +++ stable/10/usr.sbin/daemon/daemon.c Fri May 9 15:55:45 2014 (r265781) @@ -139,7 +139,7 @@ main(int argc, char *argv[]) * get SIGCHLD eventually. */ pid = -1; - if (pidfile != NULL || restart) { + if (pidfile != NULL || ppidfile != NULL || restart) { /* * Restore default action for SIGTERM in case the * parent process decided to ignore it. From owner-svn-src-stable-10@FreeBSD.ORG Sat May 10 02:10:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 85544AB6; Sat, 10 May 2014 02:10: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 6688032E; Sat, 10 May 2014 02:10: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 s4A2Abkg013993; Sat, 10 May 2014 02:10:37 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A2AWb1013963; Sat, 10 May 2014 02:10:32 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201405100210.s4A2AWb1013963@svn.freebsd.org> From: David C Somayajulu Date: Sat, 10 May 2014 02:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265797 - in stable/10/sys: dev/bxe modules/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 02:10:37 -0000 Author: davidcs Date: Sat May 10 02:10:32 2014 New Revision: 265797 URL: http://svnweb.freebsd.org/changeset/base/265797 Log: MFC r265411 Modify Copyright information to reflect Qlogic Corporation's purchase of Broadcom's NetXtreme business Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation Modified: stable/10/sys/dev/bxe/57710_init_values.c stable/10/sys/dev/bxe/57710_int_offsets.h stable/10/sys/dev/bxe/57711_init_values.c stable/10/sys/dev/bxe/57711_int_offsets.h stable/10/sys/dev/bxe/57712_init_values.c stable/10/sys/dev/bxe/57712_int_offsets.h stable/10/sys/dev/bxe/bxe.c stable/10/sys/dev/bxe/bxe.h stable/10/sys/dev/bxe/bxe_dcb.h stable/10/sys/dev/bxe/bxe_debug.c stable/10/sys/dev/bxe/bxe_elink.c stable/10/sys/dev/bxe/bxe_elink.h stable/10/sys/dev/bxe/bxe_stats.c stable/10/sys/dev/bxe/bxe_stats.h stable/10/sys/dev/bxe/ecore_fw_defs.h stable/10/sys/dev/bxe/ecore_hsi.h stable/10/sys/dev/bxe/ecore_init.h stable/10/sys/dev/bxe/ecore_init_ops.h stable/10/sys/dev/bxe/ecore_mfw_req.h stable/10/sys/dev/bxe/ecore_reg.h stable/10/sys/dev/bxe/ecore_sp.c stable/10/sys/dev/bxe/ecore_sp.h stable/10/sys/modules/bxe/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/57710_init_values.c ============================================================================== --- stable/10/sys/dev/bxe/57710_init_values.c Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/57710_init_values.c Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/57710_int_offsets.h ============================================================================== --- stable/10/sys/dev/bxe/57710_int_offsets.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/57710_int_offsets.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/57711_init_values.c ============================================================================== --- stable/10/sys/dev/bxe/57711_init_values.c Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/57711_init_values.c Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/57711_int_offsets.h ============================================================================== --- stable/10/sys/dev/bxe/57711_int_offsets.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/57711_int_offsets.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/57712_init_values.c ============================================================================== --- stable/10/sys/dev/bxe/57712_init_values.c Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/57712_init_values.c Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/57712_int_offsets.h ============================================================================== --- stable/10/sys/dev/bxe/57712_int_offsets.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/57712_int_offsets.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/bxe.c Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/bxe.h ============================================================================== --- stable/10/sys/dev/bxe/bxe.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/bxe.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/bxe_dcb.h ============================================================================== --- stable/10/sys/dev/bxe/bxe_dcb.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/bxe_dcb.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/bxe_debug.c ============================================================================== --- stable/10/sys/dev/bxe/bxe_debug.c Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/bxe_debug.c Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/bxe_elink.c ============================================================================== --- stable/10/sys/dev/bxe/bxe_elink.c Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/bxe_elink.c Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/bxe_elink.h ============================================================================== --- stable/10/sys/dev/bxe/bxe_elink.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/bxe_elink.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/10/sys/dev/bxe/bxe_stats.c Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/bxe_stats.c Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/bxe_stats.h ============================================================================== --- stable/10/sys/dev/bxe/bxe_stats.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/bxe_stats.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/ecore_fw_defs.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_fw_defs.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/ecore_fw_defs.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/ecore_hsi.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_hsi.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/ecore_hsi.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/ecore_init.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_init.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/ecore_init.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/ecore_init_ops.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_init_ops.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/ecore_init_ops.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/ecore_mfw_req.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_mfw_req.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/ecore_mfw_req.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/ecore_reg.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_reg.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/ecore_reg.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/ecore_sp.c ============================================================================== --- stable/10/sys/dev/bxe/ecore_sp.c Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/ecore_sp.c Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/ecore_sp.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_sp.h Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/dev/bxe/ecore_sp.h Sat May 10 02:10:32 2014 (r265797) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/modules/bxe/Makefile ============================================================================== --- stable/10/sys/modules/bxe/Makefile Sat May 10 02:09:09 2014 (r265796) +++ stable/10/sys/modules/bxe/Makefile Sat May 10 02:10:32 2014 (r265797) @@ -15,4 +15,9 @@ SRCS += bxe.c \ CFLAGS += -I${BXE} +clean: + rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms + rm -f *.o *.kld *.ko + rm -f @ machine x86 + .include From owner-svn-src-stable-10@FreeBSD.ORG Sat May 10 07:25:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6EE27330; Sat, 10 May 2014 07:25: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 591F2E46; Sat, 10 May 2014 07:25: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 s4A7PRXa064419; Sat, 10 May 2014 07:25:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A7PRRK064417; Sat, 10 May 2014 07:25:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201405100725.s4A7PRRK064417@svn.freebsd.org> From: Rui Paulo Date: Sat, 10 May 2014 07:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265804 - in stable/10: contrib/unbound/util sys/boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 07:25:27 -0000 Author: rpaulo Date: Sat May 10 07:25:26 2014 New Revision: 265804 URL: http://svnweb.freebsd.org/changeset/base/265804 Log: MFC r252440: Enable the second and the third I2C controllers on Beaglebone-black. Modified: stable/10/contrib/unbound/util/configparser.c stable/10/sys/boot/fdt/dts/am335x.dtsi stable/10/sys/boot/fdt/dts/beaglebone-black.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/unbound/util/configparser.c ============================================================================== --- stable/10/contrib/unbound/util/configparser.c Sat May 10 05:56:10 2014 (r265803) +++ stable/10/contrib/unbound/util/configparser.c Sat May 10 07:25:26 2014 (r265804) @@ -1,6 +1,6 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif +/* original parser id follows */ +/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ +/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ #define YYBYACC 1 #define YYMAJOR 1 @@ -15,7 +15,7 @@ static const char yysccsid[] = "@(#)yacc #define YYPURE 0 -#line 39 "util/configparser.y" +#line 39 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" #include "config.h" #include @@ -40,7 +40,7 @@ extern struct config_parser_state* cfg_p #define OUTYY(s) #endif -#line 64 "util/configparser.y" +#line 64 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" #ifdef YYSTYPE #undef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 @@ -51,7 +51,7 @@ typedef union { char* str; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ -#line 54 "util/configparser.c" +#line 54 "y.tab.c" /* compatibility with bison */ #ifdef YYPARSE_PARAM @@ -839,10 +839,10 @@ typedef struct { } YYSTACKDATA; /* variables for the parser stack */ static YYSTACKDATA yystack; -#line 1277 "util/configparser.y" +#line 1277 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" /* parse helper routines could be here */ -#line 845 "util/configparser.c" +#line 845 "y.tab.c" #if YYDEBUG #include /* needed for printf */ @@ -1049,13 +1049,13 @@ yyreduce: switch (yyn) { case 8: -#line 118 "util/configparser.y" +#line 118 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("\nP(server:)\n")); } break; case 109: -#line 167 "util/configparser.y" +#line 167 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { struct config_stub* s; OUTYY(("\nP(stub_zone:)\n")); @@ -1068,7 +1068,7 @@ case 109: } break; case 117: -#line 183 "util/configparser.y" +#line 183 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { struct config_stub* s; OUTYY(("\nP(forward_zone:)\n")); @@ -1081,7 +1081,7 @@ case 117: } break; case 124: -#line 199 "util/configparser.y" +#line 199 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_num_threads:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1091,7 +1091,7 @@ case 124: } break; case 125: -#line 208 "util/configparser.y" +#line 208 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_verbosity:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1101,7 +1101,7 @@ case 125: } break; case 126: -#line 217 "util/configparser.y" +#line 217 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_statistics_interval:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "") == 0 || strcmp(yystack.l_mark[0].str, "0") == 0) @@ -1113,7 +1113,7 @@ case 126: } break; case 127: -#line 228 "util/configparser.y" +#line 228 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_statistics_cumulative:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1123,7 +1123,7 @@ case 127: } break; case 128: -#line 237 "util/configparser.y" +#line 237 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_extended_statistics:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1133,7 +1133,7 @@ case 128: } break; case 129: -#line 246 "util/configparser.y" +#line 246 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_port:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1143,7 +1143,7 @@ case 129: } break; case 130: -#line 255 "util/configparser.y" +#line 255 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_interface:%s)\n", yystack.l_mark[0].str)); if(cfg_parser->cfg->num_ifs == 0) @@ -1157,7 +1157,7 @@ case 130: } break; case 131: -#line 268 "util/configparser.y" +#line 268 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_outgoing_interface:%s)\n", yystack.l_mark[0].str)); if(cfg_parser->cfg->num_out_ifs == 0) @@ -1173,7 +1173,7 @@ case 131: } break; case 132: -#line 283 "util/configparser.y" +#line 283 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_outgoing_range:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1183,7 +1183,7 @@ case 132: } break; case 133: -#line 292 "util/configparser.y" +#line 292 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_outgoing_port_permit:%s)\n", yystack.l_mark[0].str)); if(!cfg_mark_ports(yystack.l_mark[0].str, 1, @@ -1193,7 +1193,7 @@ case 133: } break; case 134: -#line 301 "util/configparser.y" +#line 301 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_outgoing_port_avoid:%s)\n", yystack.l_mark[0].str)); if(!cfg_mark_ports(yystack.l_mark[0].str, 0, @@ -1203,7 +1203,7 @@ case 134: } break; case 135: -#line 310 "util/configparser.y" +#line 310 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_outgoing_num_tcp:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1213,7 +1213,7 @@ case 135: } break; case 136: -#line 319 "util/configparser.y" +#line 319 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_incoming_num_tcp:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1223,7 +1223,7 @@ case 136: } break; case 137: -#line 328 "util/configparser.y" +#line 328 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_interface_automatic:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1233,7 +1233,7 @@ case 137: } break; case 138: -#line 337 "util/configparser.y" +#line 337 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_do_ip4:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1243,7 +1243,7 @@ case 138: } break; case 139: -#line 346 "util/configparser.y" +#line 346 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_do_ip6:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1253,7 +1253,7 @@ case 139: } break; case 140: -#line 355 "util/configparser.y" +#line 355 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_do_udp:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1263,7 +1263,7 @@ case 140: } break; case 141: -#line 364 "util/configparser.y" +#line 364 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_do_tcp:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1273,7 +1273,7 @@ case 141: } break; case 142: -#line 373 "util/configparser.y" +#line 373 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_tcp_upstream:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1283,7 +1283,7 @@ case 142: } break; case 143: -#line 382 "util/configparser.y" +#line 382 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_ssl_upstream:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1293,7 +1293,7 @@ case 143: } break; case 144: -#line 391 "util/configparser.y" +#line 391 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_ssl_service_key:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->ssl_service_key); @@ -1301,7 +1301,7 @@ case 144: } break; case 145: -#line 398 "util/configparser.y" +#line 398 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_ssl_service_pem:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->ssl_service_pem); @@ -1309,7 +1309,7 @@ case 145: } break; case 146: -#line 405 "util/configparser.y" +#line 405 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_ssl_port:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1319,7 +1319,7 @@ case 146: } break; case 147: -#line 414 "util/configparser.y" +#line 414 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_do_daemonize:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1329,7 +1329,7 @@ case 147: } break; case 148: -#line 423 "util/configparser.y" +#line 423 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_use_syslog:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1344,7 +1344,7 @@ case 148: } break; case 149: -#line 437 "util/configparser.y" +#line 437 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_log_time_ascii:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1354,7 +1354,7 @@ case 149: } break; case 150: -#line 446 "util/configparser.y" +#line 446 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_log_queries:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1364,7 +1364,7 @@ case 150: } break; case 151: -#line 455 "util/configparser.y" +#line 455 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_chroot:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->chrootdir); @@ -1372,7 +1372,7 @@ case 151: } break; case 152: -#line 462 "util/configparser.y" +#line 462 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_username:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->username); @@ -1380,7 +1380,7 @@ case 152: } break; case 153: -#line 469 "util/configparser.y" +#line 469 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_directory:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->directory); @@ -1388,7 +1388,7 @@ case 153: } break; case 154: -#line 476 "util/configparser.y" +#line 476 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_logfile:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->logfile); @@ -1397,7 +1397,7 @@ case 154: } break; case 155: -#line 484 "util/configparser.y" +#line 484 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_pidfile:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->pidfile); @@ -1405,7 +1405,7 @@ case 155: } break; case 156: -#line 491 "util/configparser.y" +#line 491 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_root_hints:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->root_hints, yystack.l_mark[0].str)) @@ -1413,7 +1413,7 @@ case 156: } break; case 157: -#line 498 "util/configparser.y" +#line 498 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_dlv_anchor_file:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->dlv_anchor_file); @@ -1421,7 +1421,7 @@ case 157: } break; case 158: -#line 505 "util/configparser.y" +#line 505 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_dlv_anchor:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->dlv_anchor_list, yystack.l_mark[0].str)) @@ -1429,7 +1429,7 @@ case 158: } break; case 159: -#line 512 "util/configparser.y" +#line 512 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_auto_trust_anchor_file:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg-> @@ -1438,7 +1438,7 @@ case 159: } break; case 160: -#line 520 "util/configparser.y" +#line 520 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_trust_anchor_file:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg-> @@ -1447,7 +1447,7 @@ case 160: } break; case 161: -#line 528 "util/configparser.y" +#line 528 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_trusted_keys_file:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg-> @@ -1456,7 +1456,7 @@ case 161: } break; case 162: -#line 536 "util/configparser.y" +#line 536 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_trust_anchor:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->trust_anchor_list, yystack.l_mark[0].str)) @@ -1464,7 +1464,7 @@ case 162: } break; case 163: -#line 543 "util/configparser.y" +#line 543 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_domain_insecure:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->domain_insecure, yystack.l_mark[0].str)) @@ -1472,7 +1472,7 @@ case 163: } break; case 164: -#line 550 "util/configparser.y" +#line 550 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_hide_identity:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1482,7 +1482,7 @@ case 164: } break; case 165: -#line 559 "util/configparser.y" +#line 559 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_hide_version:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1492,7 +1492,7 @@ case 165: } break; case 166: -#line 568 "util/configparser.y" +#line 568 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_identity:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->identity); @@ -1500,7 +1500,7 @@ case 166: } break; case 167: -#line 575 "util/configparser.y" +#line 575 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_version:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->version); @@ -1508,7 +1508,7 @@ case 167: } break; case 168: -#line 582 "util/configparser.y" +#line 582 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_so_rcvbuf:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->so_rcvbuf)) @@ -1517,7 +1517,7 @@ case 168: } break; case 169: -#line 590 "util/configparser.y" +#line 590 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_so_sndbuf:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->so_sndbuf)) @@ -1526,7 +1526,7 @@ case 169: } break; case 170: -#line 598 "util/configparser.y" +#line 598 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_edns_buffer_size:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1540,7 +1540,7 @@ case 170: } break; case 171: -#line 611 "util/configparser.y" +#line 611 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_msg_buffer_size:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1552,7 +1552,7 @@ case 171: } break; case 172: -#line 622 "util/configparser.y" +#line 622 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_msg_cache_size:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->msg_cache_size)) @@ -1561,7 +1561,7 @@ case 172: } break; case 173: -#line 630 "util/configparser.y" +#line 630 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_msg_cache_slabs:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1575,7 +1575,7 @@ case 173: } break; case 174: -#line 643 "util/configparser.y" +#line 643 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_num_queries_per_thread:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1585,7 +1585,7 @@ case 174: } break; case 175: -#line 652 "util/configparser.y" +#line 652 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_jostle_timeout:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1595,7 +1595,7 @@ case 175: } break; case 176: -#line 661 "util/configparser.y" +#line 661 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_rrset_cache_size:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->rrset_cache_size)) @@ -1604,7 +1604,7 @@ case 176: } break; case 177: -#line 669 "util/configparser.y" +#line 669 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_rrset_cache_slabs:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1618,7 +1618,7 @@ case 177: } break; case 178: -#line 682 "util/configparser.y" +#line 682 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_infra_host_ttl:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1628,7 +1628,7 @@ case 178: } break; case 179: -#line 691 "util/configparser.y" +#line 691 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_infra_lame_ttl:%s)\n", yystack.l_mark[0].str)); verbose(VERB_DETAIL, "ignored infra-lame-ttl: %s (option " @@ -1637,7 +1637,7 @@ case 179: } break; case 180: -#line 699 "util/configparser.y" +#line 699 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_infra_cache_numhosts:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1647,7 +1647,7 @@ case 180: } break; case 181: -#line 708 "util/configparser.y" +#line 708 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_infra_cache_lame_size:%s)\n", yystack.l_mark[0].str)); verbose(VERB_DETAIL, "ignored infra-cache-lame-size: %s " @@ -1656,7 +1656,7 @@ case 181: } break; case 182: -#line 716 "util/configparser.y" +#line 716 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_infra_cache_slabs:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1670,7 +1670,7 @@ case 182: } break; case 183: -#line 729 "util/configparser.y" +#line 729 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_target_fetch_policy:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->target_fetch_policy); @@ -1678,7 +1678,7 @@ case 183: } break; case 184: -#line 736 "util/configparser.y" +#line 736 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_harden_short_bufsize:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1689,7 +1689,7 @@ case 184: } break; case 185: -#line 746 "util/configparser.y" +#line 746 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_harden_large_queries:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1700,7 +1700,7 @@ case 185: } break; case 186: -#line 756 "util/configparser.y" +#line 756 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_harden_glue:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1711,7 +1711,7 @@ case 186: } break; case 187: -#line 766 "util/configparser.y" +#line 766 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_harden_dnssec_stripped:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1722,7 +1722,7 @@ case 187: } break; case 188: -#line 776 "util/configparser.y" +#line 776 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_harden_below_nxdomain:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1733,7 +1733,7 @@ case 188: } break; case 189: -#line 786 "util/configparser.y" +#line 786 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_harden_referral_path:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1744,7 +1744,7 @@ case 189: } break; case 190: -#line 796 "util/configparser.y" +#line 796 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_use_caps_for_id:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1755,7 +1755,7 @@ case 190: } break; case 191: -#line 806 "util/configparser.y" +#line 806 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_private_address:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->private_address, yystack.l_mark[0].str)) @@ -1763,7 +1763,7 @@ case 191: } break; case 192: -#line 813 "util/configparser.y" +#line 813 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_private_domain:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->private_domain, yystack.l_mark[0].str)) @@ -1771,7 +1771,7 @@ case 192: } break; case 193: -#line 820 "util/configparser.y" +#line 820 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_prefetch:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1781,7 +1781,7 @@ case 193: } break; case 194: -#line 829 "util/configparser.y" +#line 829 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_prefetch_key:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1791,7 +1791,7 @@ case 194: } break; case 195: -#line 838 "util/configparser.y" +#line 838 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_unwanted_reply_threshold:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1801,7 +1801,7 @@ case 195: } break; case 196: -#line 847 "util/configparser.y" +#line 847 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_do_not_query_address:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->donotqueryaddrs, yystack.l_mark[0].str)) @@ -1809,7 +1809,7 @@ case 196: } break; case 197: -#line 854 "util/configparser.y" +#line 854 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_do_not_query_localhost:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1820,7 +1820,7 @@ case 197: } break; case 198: -#line 864 "util/configparser.y" +#line 864 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_access_control:%s %s)\n", yystack.l_mark[-1].str, yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "deny")!=0 && strcmp(yystack.l_mark[0].str, "refuse")!=0 && @@ -1835,7 +1835,7 @@ case 198: } break; case 199: -#line 878 "util/configparser.y" +#line 878 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_module_conf:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->module_conf); @@ -1843,7 +1843,7 @@ case 199: } break; case 200: -#line 885 "util/configparser.y" +#line 885 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_val_override_date:%s)\n", yystack.l_mark[0].str)); if(strlen(yystack.l_mark[0].str) == 0 || strcmp(yystack.l_mark[0].str, "0") == 0) { @@ -1862,7 +1862,7 @@ case 200: } break; case 201: -#line 903 "util/configparser.y" +#line 903 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_val_sig_skew_min:%s)\n", yystack.l_mark[0].str)); if(strlen(yystack.l_mark[0].str) == 0 || strcmp(yystack.l_mark[0].str, "0") == 0) { @@ -1876,7 +1876,7 @@ case 201: } break; case 202: -#line 916 "util/configparser.y" +#line 916 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_val_sig_skew_max:%s)\n", yystack.l_mark[0].str)); if(strlen(yystack.l_mark[0].str) == 0 || strcmp(yystack.l_mark[0].str, "0") == 0) { @@ -1890,7 +1890,7 @@ case 202: } break; case 203: -#line 929 "util/configparser.y" +#line 929 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_cache_max_ttl:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1900,7 +1900,7 @@ case 203: } break; case 204: -#line 938 "util/configparser.y" +#line 938 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_cache_min_ttl:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1910,7 +1910,7 @@ case 204: } break; case 205: -#line 947 "util/configparser.y" +#line 947 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_bogus_ttl:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1920,7 +1920,7 @@ case 205: } break; case 206: -#line 956 "util/configparser.y" +#line 956 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_val_clean_additional:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1931,7 +1931,7 @@ case 206: } break; case 207: -#line 966 "util/configparser.y" +#line 966 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_val_permissive_mode:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1942,7 +1942,7 @@ case 207: } break; case 208: -#line 976 "util/configparser.y" +#line 976 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_ignore_cd_flag:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1952,7 +1952,7 @@ case 208: } break; case 209: -#line 985 "util/configparser.y" +#line 985 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_val_log_level:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1962,7 +1962,7 @@ case 209: } break; case 210: -#line 994 "util/configparser.y" +#line 994 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_val_nsec3_keysize_iterations:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->val_nsec3_key_iterations); @@ -1970,7 +1970,7 @@ case 210: } break; case 211: -#line 1001 "util/configparser.y" +#line 1001 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_add_holddown:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1980,7 +1980,7 @@ case 211: } break; case 212: -#line 1010 "util/configparser.y" +#line 1010 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_del_holddown:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1990,7 +1990,7 @@ case 212: } break; case 213: -#line 1019 "util/configparser.y" +#line 1019 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_keep_missing:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -2000,7 +2000,7 @@ case 213: } break; case 214: -#line 1028 "util/configparser.y" +#line 1028 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_key_cache_size:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->key_cache_size)) @@ -2009,7 +2009,7 @@ case 214: } break; case 215: -#line 1036 "util/configparser.y" +#line 1036 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_key_cache_slabs:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -2023,7 +2023,7 @@ case 215: } break; case 216: -#line 1049 "util/configparser.y" +#line 1049 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_neg_cache_size:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->neg_cache_size)) @@ -2032,7 +2032,7 @@ case 216: } break; case 217: -#line 1057 "util/configparser.y" +#line 1057 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_local_zone:%s %s)\n", yystack.l_mark[-1].str, yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "static")!=0 && strcmp(yystack.l_mark[0].str, "deny")!=0 && @@ -2055,7 +2055,7 @@ case 217: } break; case 218: -#line 1079 "util/configparser.y" +#line 1079 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_local_data:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->local_data, yystack.l_mark[0].str)) @@ -2063,7 +2063,7 @@ case 218: } break; case 219: -#line 1086 "util/configparser.y" +#line 1086 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { char* ptr; OUTYY(("P(server_local_data_ptr:%s)\n", yystack.l_mark[0].str)); @@ -2079,7 +2079,7 @@ case 219: } break; case 220: -#line 1101 "util/configparser.y" +#line 1101 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_minimal_responses:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -2090,7 +2090,7 @@ case 220: } break; case 221: -#line 1111 "util/configparser.y" +#line 1111 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(server_rrset_roundrobin:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -2101,7 +2101,7 @@ case 221: } break; case 222: -#line 1121 "util/configparser.y" +#line 1121 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(name:%s)\n", yystack.l_mark[0].str)); if(cfg_parser->cfg->stubs->name) @@ -2112,7 +2112,7 @@ case 222: } break; case 223: -#line 1131 "util/configparser.y" +#line 1131 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(stub-host:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->hosts, yystack.l_mark[0].str)) @@ -2120,7 +2120,7 @@ case 223: } break; case 224: -#line 1138 "util/configparser.y" +#line 1138 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(stub-addr:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->addrs, yystack.l_mark[0].str)) @@ -2128,7 +2128,7 @@ case 224: } break; case 225: -#line 1145 "util/configparser.y" +#line 1145 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" { OUTYY(("P(stub-first:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -2138,7 +2138,7 @@ case 225: } break; case 226: -#line 1154 "util/configparser.y" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 10 07:26:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3FF1F464; Sat, 10 May 2014 07:26: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 2AA45E50; Sat, 10 May 2014 07:26: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 s4A7Qoe0064612; Sat, 10 May 2014 07:26:50 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A7QoDT064611; Sat, 10 May 2014 07:26:50 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201405100726.s4A7QoDT064611@svn.freebsd.org> From: Rui Paulo Date: Sat, 10 May 2014 07:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265805 - stable/10/contrib/unbound/util X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 07:26:50 -0000 Author: rpaulo Date: Sat May 10 07:26:49 2014 New Revision: 265805 URL: http://svnweb.freebsd.org/changeset/base/265805 Log: Revert bogus change in 265804 to configparser.c Modified: stable/10/contrib/unbound/util/configparser.c Modified: stable/10/contrib/unbound/util/configparser.c ============================================================================== --- stable/10/contrib/unbound/util/configparser.c Sat May 10 07:25:26 2014 (r265804) +++ stable/10/contrib/unbound/util/configparser.c Sat May 10 07:26:49 2014 (r265805) @@ -1,6 +1,6 @@ -/* original parser id follows */ -/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ -/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif #define YYBYACC 1 #define YYMAJOR 1 @@ -15,7 +15,7 @@ #define YYPURE 0 -#line 39 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 39 "util/configparser.y" #include "config.h" #include @@ -40,7 +40,7 @@ extern struct config_parser_state* cfg_p #define OUTYY(s) #endif -#line 64 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 64 "util/configparser.y" #ifdef YYSTYPE #undef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 @@ -51,7 +51,7 @@ typedef union { char* str; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ -#line 54 "y.tab.c" +#line 54 "util/configparser.c" /* compatibility with bison */ #ifdef YYPARSE_PARAM @@ -839,10 +839,10 @@ typedef struct { } YYSTACKDATA; /* variables for the parser stack */ static YYSTACKDATA yystack; -#line 1277 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1277 "util/configparser.y" /* parse helper routines could be here */ -#line 845 "y.tab.c" +#line 845 "util/configparser.c" #if YYDEBUG #include /* needed for printf */ @@ -1049,13 +1049,13 @@ yyreduce: switch (yyn) { case 8: -#line 118 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 118 "util/configparser.y" { OUTYY(("\nP(server:)\n")); } break; case 109: -#line 167 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 167 "util/configparser.y" { struct config_stub* s; OUTYY(("\nP(stub_zone:)\n")); @@ -1068,7 +1068,7 @@ case 109: } break; case 117: -#line 183 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 183 "util/configparser.y" { struct config_stub* s; OUTYY(("\nP(forward_zone:)\n")); @@ -1081,7 +1081,7 @@ case 117: } break; case 124: -#line 199 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 199 "util/configparser.y" { OUTYY(("P(server_num_threads:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1091,7 +1091,7 @@ case 124: } break; case 125: -#line 208 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 208 "util/configparser.y" { OUTYY(("P(server_verbosity:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1101,7 +1101,7 @@ case 125: } break; case 126: -#line 217 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 217 "util/configparser.y" { OUTYY(("P(server_statistics_interval:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "") == 0 || strcmp(yystack.l_mark[0].str, "0") == 0) @@ -1113,7 +1113,7 @@ case 126: } break; case 127: -#line 228 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 228 "util/configparser.y" { OUTYY(("P(server_statistics_cumulative:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1123,7 +1123,7 @@ case 127: } break; case 128: -#line 237 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 237 "util/configparser.y" { OUTYY(("P(server_extended_statistics:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1133,7 +1133,7 @@ case 128: } break; case 129: -#line 246 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 246 "util/configparser.y" { OUTYY(("P(server_port:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1143,7 +1143,7 @@ case 129: } break; case 130: -#line 255 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 255 "util/configparser.y" { OUTYY(("P(server_interface:%s)\n", yystack.l_mark[0].str)); if(cfg_parser->cfg->num_ifs == 0) @@ -1157,7 +1157,7 @@ case 130: } break; case 131: -#line 268 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 268 "util/configparser.y" { OUTYY(("P(server_outgoing_interface:%s)\n", yystack.l_mark[0].str)); if(cfg_parser->cfg->num_out_ifs == 0) @@ -1173,7 +1173,7 @@ case 131: } break; case 132: -#line 283 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 283 "util/configparser.y" { OUTYY(("P(server_outgoing_range:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1183,7 +1183,7 @@ case 132: } break; case 133: -#line 292 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 292 "util/configparser.y" { OUTYY(("P(server_outgoing_port_permit:%s)\n", yystack.l_mark[0].str)); if(!cfg_mark_ports(yystack.l_mark[0].str, 1, @@ -1193,7 +1193,7 @@ case 133: } break; case 134: -#line 301 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 301 "util/configparser.y" { OUTYY(("P(server_outgoing_port_avoid:%s)\n", yystack.l_mark[0].str)); if(!cfg_mark_ports(yystack.l_mark[0].str, 0, @@ -1203,7 +1203,7 @@ case 134: } break; case 135: -#line 310 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 310 "util/configparser.y" { OUTYY(("P(server_outgoing_num_tcp:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1213,7 +1213,7 @@ case 135: } break; case 136: -#line 319 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 319 "util/configparser.y" { OUTYY(("P(server_incoming_num_tcp:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1223,7 +1223,7 @@ case 136: } break; case 137: -#line 328 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 328 "util/configparser.y" { OUTYY(("P(server_interface_automatic:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1233,7 +1233,7 @@ case 137: } break; case 138: -#line 337 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 337 "util/configparser.y" { OUTYY(("P(server_do_ip4:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1243,7 +1243,7 @@ case 138: } break; case 139: -#line 346 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 346 "util/configparser.y" { OUTYY(("P(server_do_ip6:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1253,7 +1253,7 @@ case 139: } break; case 140: -#line 355 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 355 "util/configparser.y" { OUTYY(("P(server_do_udp:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1263,7 +1263,7 @@ case 140: } break; case 141: -#line 364 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 364 "util/configparser.y" { OUTYY(("P(server_do_tcp:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1273,7 +1273,7 @@ case 141: } break; case 142: -#line 373 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 373 "util/configparser.y" { OUTYY(("P(server_tcp_upstream:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1283,7 +1283,7 @@ case 142: } break; case 143: -#line 382 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 382 "util/configparser.y" { OUTYY(("P(server_ssl_upstream:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1293,7 +1293,7 @@ case 143: } break; case 144: -#line 391 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 391 "util/configparser.y" { OUTYY(("P(server_ssl_service_key:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->ssl_service_key); @@ -1301,7 +1301,7 @@ case 144: } break; case 145: -#line 398 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 398 "util/configparser.y" { OUTYY(("P(server_ssl_service_pem:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->ssl_service_pem); @@ -1309,7 +1309,7 @@ case 145: } break; case 146: -#line 405 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 405 "util/configparser.y" { OUTYY(("P(server_ssl_port:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1319,7 +1319,7 @@ case 146: } break; case 147: -#line 414 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 414 "util/configparser.y" { OUTYY(("P(server_do_daemonize:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1329,7 +1329,7 @@ case 147: } break; case 148: -#line 423 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 423 "util/configparser.y" { OUTYY(("P(server_use_syslog:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1344,7 +1344,7 @@ case 148: } break; case 149: -#line 437 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 437 "util/configparser.y" { OUTYY(("P(server_log_time_ascii:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1354,7 +1354,7 @@ case 149: } break; case 150: -#line 446 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 446 "util/configparser.y" { OUTYY(("P(server_log_queries:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1364,7 +1364,7 @@ case 150: } break; case 151: -#line 455 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 455 "util/configparser.y" { OUTYY(("P(server_chroot:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->chrootdir); @@ -1372,7 +1372,7 @@ case 151: } break; case 152: -#line 462 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 462 "util/configparser.y" { OUTYY(("P(server_username:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->username); @@ -1380,7 +1380,7 @@ case 152: } break; case 153: -#line 469 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 469 "util/configparser.y" { OUTYY(("P(server_directory:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->directory); @@ -1388,7 +1388,7 @@ case 153: } break; case 154: -#line 476 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 476 "util/configparser.y" { OUTYY(("P(server_logfile:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->logfile); @@ -1397,7 +1397,7 @@ case 154: } break; case 155: -#line 484 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 484 "util/configparser.y" { OUTYY(("P(server_pidfile:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->pidfile); @@ -1405,7 +1405,7 @@ case 155: } break; case 156: -#line 491 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 491 "util/configparser.y" { OUTYY(("P(server_root_hints:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->root_hints, yystack.l_mark[0].str)) @@ -1413,7 +1413,7 @@ case 156: } break; case 157: -#line 498 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 498 "util/configparser.y" { OUTYY(("P(server_dlv_anchor_file:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->dlv_anchor_file); @@ -1421,7 +1421,7 @@ case 157: } break; case 158: -#line 505 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 505 "util/configparser.y" { OUTYY(("P(server_dlv_anchor:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->dlv_anchor_list, yystack.l_mark[0].str)) @@ -1429,7 +1429,7 @@ case 158: } break; case 159: -#line 512 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 512 "util/configparser.y" { OUTYY(("P(server_auto_trust_anchor_file:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg-> @@ -1438,7 +1438,7 @@ case 159: } break; case 160: -#line 520 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 520 "util/configparser.y" { OUTYY(("P(server_trust_anchor_file:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg-> @@ -1447,7 +1447,7 @@ case 160: } break; case 161: -#line 528 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 528 "util/configparser.y" { OUTYY(("P(server_trusted_keys_file:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg-> @@ -1456,7 +1456,7 @@ case 161: } break; case 162: -#line 536 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 536 "util/configparser.y" { OUTYY(("P(server_trust_anchor:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->trust_anchor_list, yystack.l_mark[0].str)) @@ -1464,7 +1464,7 @@ case 162: } break; case 163: -#line 543 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 543 "util/configparser.y" { OUTYY(("P(server_domain_insecure:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->domain_insecure, yystack.l_mark[0].str)) @@ -1472,7 +1472,7 @@ case 163: } break; case 164: -#line 550 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 550 "util/configparser.y" { OUTYY(("P(server_hide_identity:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1482,7 +1482,7 @@ case 164: } break; case 165: -#line 559 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 559 "util/configparser.y" { OUTYY(("P(server_hide_version:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1492,7 +1492,7 @@ case 165: } break; case 166: -#line 568 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 568 "util/configparser.y" { OUTYY(("P(server_identity:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->identity); @@ -1500,7 +1500,7 @@ case 166: } break; case 167: -#line 575 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 575 "util/configparser.y" { OUTYY(("P(server_version:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->version); @@ -1508,7 +1508,7 @@ case 167: } break; case 168: -#line 582 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 582 "util/configparser.y" { OUTYY(("P(server_so_rcvbuf:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->so_rcvbuf)) @@ -1517,7 +1517,7 @@ case 168: } break; case 169: -#line 590 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 590 "util/configparser.y" { OUTYY(("P(server_so_sndbuf:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->so_sndbuf)) @@ -1526,7 +1526,7 @@ case 169: } break; case 170: -#line 598 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 598 "util/configparser.y" { OUTYY(("P(server_edns_buffer_size:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1540,7 +1540,7 @@ case 170: } break; case 171: -#line 611 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 611 "util/configparser.y" { OUTYY(("P(server_msg_buffer_size:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1552,7 +1552,7 @@ case 171: } break; case 172: -#line 622 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 622 "util/configparser.y" { OUTYY(("P(server_msg_cache_size:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->msg_cache_size)) @@ -1561,7 +1561,7 @@ case 172: } break; case 173: -#line 630 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 630 "util/configparser.y" { OUTYY(("P(server_msg_cache_slabs:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1575,7 +1575,7 @@ case 173: } break; case 174: -#line 643 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 643 "util/configparser.y" { OUTYY(("P(server_num_queries_per_thread:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1585,7 +1585,7 @@ case 174: } break; case 175: -#line 652 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 652 "util/configparser.y" { OUTYY(("P(server_jostle_timeout:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1595,7 +1595,7 @@ case 175: } break; case 176: -#line 661 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 661 "util/configparser.y" { OUTYY(("P(server_rrset_cache_size:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->rrset_cache_size)) @@ -1604,7 +1604,7 @@ case 176: } break; case 177: -#line 669 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 669 "util/configparser.y" { OUTYY(("P(server_rrset_cache_slabs:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1618,7 +1618,7 @@ case 177: } break; case 178: -#line 682 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 682 "util/configparser.y" { OUTYY(("P(server_infra_host_ttl:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1628,7 +1628,7 @@ case 178: } break; case 179: -#line 691 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 691 "util/configparser.y" { OUTYY(("P(server_infra_lame_ttl:%s)\n", yystack.l_mark[0].str)); verbose(VERB_DETAIL, "ignored infra-lame-ttl: %s (option " @@ -1637,7 +1637,7 @@ case 179: } break; case 180: -#line 699 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 699 "util/configparser.y" { OUTYY(("P(server_infra_cache_numhosts:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1647,7 +1647,7 @@ case 180: } break; case 181: -#line 708 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 708 "util/configparser.y" { OUTYY(("P(server_infra_cache_lame_size:%s)\n", yystack.l_mark[0].str)); verbose(VERB_DETAIL, "ignored infra-cache-lame-size: %s " @@ -1656,7 +1656,7 @@ case 181: } break; case 182: -#line 716 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 716 "util/configparser.y" { OUTYY(("P(server_infra_cache_slabs:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -1670,7 +1670,7 @@ case 182: } break; case 183: -#line 729 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 729 "util/configparser.y" { OUTYY(("P(server_target_fetch_policy:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->target_fetch_policy); @@ -1678,7 +1678,7 @@ case 183: } break; case 184: -#line 736 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 736 "util/configparser.y" { OUTYY(("P(server_harden_short_bufsize:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1689,7 +1689,7 @@ case 184: } break; case 185: -#line 746 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 746 "util/configparser.y" { OUTYY(("P(server_harden_large_queries:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1700,7 +1700,7 @@ case 185: } break; case 186: -#line 756 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 756 "util/configparser.y" { OUTYY(("P(server_harden_glue:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1711,7 +1711,7 @@ case 186: } break; case 187: -#line 766 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 766 "util/configparser.y" { OUTYY(("P(server_harden_dnssec_stripped:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1722,7 +1722,7 @@ case 187: } break; case 188: -#line 776 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 776 "util/configparser.y" { OUTYY(("P(server_harden_below_nxdomain:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1733,7 +1733,7 @@ case 188: } break; case 189: -#line 786 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 786 "util/configparser.y" { OUTYY(("P(server_harden_referral_path:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1744,7 +1744,7 @@ case 189: } break; case 190: -#line 796 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 796 "util/configparser.y" { OUTYY(("P(server_use_caps_for_id:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1755,7 +1755,7 @@ case 190: } break; case 191: -#line 806 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 806 "util/configparser.y" { OUTYY(("P(server_private_address:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->private_address, yystack.l_mark[0].str)) @@ -1763,7 +1763,7 @@ case 191: } break; case 192: -#line 813 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 813 "util/configparser.y" { OUTYY(("P(server_private_domain:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->private_domain, yystack.l_mark[0].str)) @@ -1771,7 +1771,7 @@ case 192: } break; case 193: -#line 820 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 820 "util/configparser.y" { OUTYY(("P(server_prefetch:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1781,7 +1781,7 @@ case 193: } break; case 194: -#line 829 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 829 "util/configparser.y" { OUTYY(("P(server_prefetch_key:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1791,7 +1791,7 @@ case 194: } break; case 195: -#line 838 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 838 "util/configparser.y" { OUTYY(("P(server_unwanted_reply_threshold:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1801,7 +1801,7 @@ case 195: } break; case 196: -#line 847 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 847 "util/configparser.y" { OUTYY(("P(server_do_not_query_address:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->donotqueryaddrs, yystack.l_mark[0].str)) @@ -1809,7 +1809,7 @@ case 196: } break; case 197: -#line 854 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 854 "util/configparser.y" { OUTYY(("P(server_do_not_query_localhost:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1820,7 +1820,7 @@ case 197: } break; case 198: -#line 864 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 864 "util/configparser.y" { OUTYY(("P(server_access_control:%s %s)\n", yystack.l_mark[-1].str, yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "deny")!=0 && strcmp(yystack.l_mark[0].str, "refuse")!=0 && @@ -1835,7 +1835,7 @@ case 198: } break; case 199: -#line 878 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 878 "util/configparser.y" { OUTYY(("P(server_module_conf:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->module_conf); @@ -1843,7 +1843,7 @@ case 199: } break; case 200: -#line 885 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 885 "util/configparser.y" { OUTYY(("P(server_val_override_date:%s)\n", yystack.l_mark[0].str)); if(strlen(yystack.l_mark[0].str) == 0 || strcmp(yystack.l_mark[0].str, "0") == 0) { @@ -1862,7 +1862,7 @@ case 200: } break; case 201: -#line 903 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 903 "util/configparser.y" { OUTYY(("P(server_val_sig_skew_min:%s)\n", yystack.l_mark[0].str)); if(strlen(yystack.l_mark[0].str) == 0 || strcmp(yystack.l_mark[0].str, "0") == 0) { @@ -1876,7 +1876,7 @@ case 201: } break; case 202: -#line 916 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 916 "util/configparser.y" { OUTYY(("P(server_val_sig_skew_max:%s)\n", yystack.l_mark[0].str)); if(strlen(yystack.l_mark[0].str) == 0 || strcmp(yystack.l_mark[0].str, "0") == 0) { @@ -1890,7 +1890,7 @@ case 202: } break; case 203: -#line 929 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 929 "util/configparser.y" { OUTYY(("P(server_cache_max_ttl:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1900,7 +1900,7 @@ case 203: } break; case 204: -#line 938 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 938 "util/configparser.y" { OUTYY(("P(server_cache_min_ttl:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1910,7 +1910,7 @@ case 204: } break; case 205: -#line 947 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 947 "util/configparser.y" { OUTYY(("P(server_bogus_ttl:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1920,7 +1920,7 @@ case 205: } break; case 206: -#line 956 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 956 "util/configparser.y" { OUTYY(("P(server_val_clean_additional:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1931,7 +1931,7 @@ case 206: } break; case 207: -#line 966 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 966 "util/configparser.y" { OUTYY(("P(server_val_permissive_mode:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1942,7 +1942,7 @@ case 207: } break; case 208: -#line 976 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 976 "util/configparser.y" { OUTYY(("P(server_ignore_cd_flag:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -1952,7 +1952,7 @@ case 208: } break; case 209: -#line 985 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 985 "util/configparser.y" { OUTYY(("P(server_val_log_level:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1962,7 +1962,7 @@ case 209: } break; case 210: -#line 994 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 994 "util/configparser.y" { OUTYY(("P(server_val_nsec3_keysize_iterations:%s)\n", yystack.l_mark[0].str)); free(cfg_parser->cfg->val_nsec3_key_iterations); @@ -1970,7 +1970,7 @@ case 210: } break; case 211: -#line 1001 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1001 "util/configparser.y" { OUTYY(("P(server_add_holddown:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1980,7 +1980,7 @@ case 211: } break; case 212: -#line 1010 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1010 "util/configparser.y" { OUTYY(("P(server_del_holddown:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -1990,7 +1990,7 @@ case 212: } break; case 213: -#line 1019 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1019 "util/configparser.y" { OUTYY(("P(server_keep_missing:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0 && strcmp(yystack.l_mark[0].str, "0") != 0) @@ -2000,7 +2000,7 @@ case 213: } break; case 214: -#line 1028 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1028 "util/configparser.y" { OUTYY(("P(server_key_cache_size:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->key_cache_size)) @@ -2009,7 +2009,7 @@ case 214: } break; case 215: -#line 1036 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1036 "util/configparser.y" { OUTYY(("P(server_key_cache_slabs:%s)\n", yystack.l_mark[0].str)); if(atoi(yystack.l_mark[0].str) == 0) @@ -2023,7 +2023,7 @@ case 215: } break; case 216: -#line 1049 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1049 "util/configparser.y" { OUTYY(("P(server_neg_cache_size:%s)\n", yystack.l_mark[0].str)); if(!cfg_parse_memsize(yystack.l_mark[0].str, &cfg_parser->cfg->neg_cache_size)) @@ -2032,7 +2032,7 @@ case 216: } break; case 217: -#line 1057 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1057 "util/configparser.y" { OUTYY(("P(server_local_zone:%s %s)\n", yystack.l_mark[-1].str, yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "static")!=0 && strcmp(yystack.l_mark[0].str, "deny")!=0 && @@ -2055,7 +2055,7 @@ case 217: } break; case 218: -#line 1079 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1079 "util/configparser.y" { OUTYY(("P(server_local_data:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->local_data, yystack.l_mark[0].str)) @@ -2063,7 +2063,7 @@ case 218: } break; case 219: -#line 1086 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1086 "util/configparser.y" { char* ptr; OUTYY(("P(server_local_data_ptr:%s)\n", yystack.l_mark[0].str)); @@ -2079,7 +2079,7 @@ case 219: } break; case 220: -#line 1101 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1101 "util/configparser.y" { OUTYY(("P(server_minimal_responses:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -2090,7 +2090,7 @@ case 220: } break; case 221: -#line 1111 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1111 "util/configparser.y" { OUTYY(("P(server_rrset_roundrobin:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -2101,7 +2101,7 @@ case 221: } break; case 222: -#line 1121 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1121 "util/configparser.y" { OUTYY(("P(name:%s)\n", yystack.l_mark[0].str)); if(cfg_parser->cfg->stubs->name) @@ -2112,7 +2112,7 @@ case 222: } break; case 223: -#line 1131 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1131 "util/configparser.y" { OUTYY(("P(stub-host:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->hosts, yystack.l_mark[0].str)) @@ -2120,7 +2120,7 @@ case 223: } break; case 224: -#line 1138 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1138 "util/configparser.y" { OUTYY(("P(stub-addr:%s)\n", yystack.l_mark[0].str)); if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->addrs, yystack.l_mark[0].str)) @@ -2128,7 +2128,7 @@ case 224: } break; case 225: -#line 1145 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" +#line 1145 "util/configparser.y" { OUTYY(("P(stub-first:%s)\n", yystack.l_mark[0].str)); if(strcmp(yystack.l_mark[0].str, "yes") != 0 && strcmp(yystack.l_mark[0].str, "no") != 0) @@ -2138,7 +2138,7 @@ case 225: } break; case 226: -#line 1154 "/home/rpaulo/freebsd-svn/stable/10/lib/libunbound/../../contrib/unbound/util/configparser.y" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 10 07:53:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 55DA4987; Sat, 10 May 2014 07:53: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 42AC095; Sat, 10 May 2014 07:53: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 s4A7rbGC077019; Sat, 10 May 2014 07:53:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A7rbc6077018; Sat, 10 May 2014 07:53:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405100753.s4A7rbc6077018@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 May 2014 07:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265807 - stable/10/sys/fs/msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 07:53:37 -0000 Author: kib Date: Sat May 10 07:53:36 2014 New Revision: 265807 URL: http://svnweb.freebsd.org/changeset/base/265807 Log: MFC r265275: Overwrite the de_Name for the directories on rename to correct the dot name. Modified: stable/10/sys/fs/msdosfs/msdosfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_vnops.c Sat May 10 07:37:32 2014 (r265806) +++ stable/10/sys/fs/msdosfs/msdosfs_vnops.c Sat May 10 07:53:36 2014 (r265807) @@ -1240,6 +1240,17 @@ abortit: VOP_UNLOCK(fvp, 0); goto bad; } + /* + * If ip is for a directory, then its name should always + * be "." since it is for the directory entry in the + * directory itself (msdosfs_lookup() always translates + * to the "." entry so as to get a unique denode, except + * for the root directory there are different + * complications). However, we just corrupted its name + * to pass the correct name to createde(). Undo this. + */ + if ((ip->de_Attributes & ATTR_DIRECTORY) != 0) + bcopy(oldname, ip->de_Name, 11); ip->de_refcnt++; zp->de_fndoffset = from_diroffset; error = removede(zp, ip); From owner-svn-src-stable-10@FreeBSD.ORG Sat May 10 08:07:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C4C7ADE8; Sat, 10 May 2014 08:07: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 B177B16A; Sat, 10 May 2014 08:07: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 s4A87fSF082387; Sat, 10 May 2014 08:07:41 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A87fHV082386; Sat, 10 May 2014 08:07:41 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201405100807.s4A87fHV082386@svn.freebsd.org> From: Rui Paulo Date: Sat, 10 May 2014 08:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265809 - stable/10/sys/boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 08:07:41 -0000 Author: rpaulo Date: Sat May 10 08:07:41 2014 New Revision: 265809 URL: http://svnweb.freebsd.org/changeset/base/265809 Log: Manually MFC 262714: Add a missing semicolong, noticed by the gnu dt compiler. In head, the directory layout changed and we can't svn merge correctly. Modified: stable/10/sys/boot/fdt/dts/beaglebone.dts Modified: stable/10/sys/boot/fdt/dts/beaglebone.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/beaglebone.dts Sat May 10 07:56:01 2014 (r265808) +++ stable/10/sys/boot/fdt/dts/beaglebone.dts Sat May 10 08:07:41 2014 (r265809) @@ -135,7 +135,7 @@ compatible = "ti,am335x-pmic"; reg = <0x24>; }; - } + }; }; chosen { From owner-svn-src-stable-10@FreeBSD.ORG Sat May 10 08:10:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3DE7FF65; Sat, 10 May 2014 08:10: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 2B440176; Sat, 10 May 2014 08:10: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 s4A8A2vX082925; Sat, 10 May 2014 08:10:02 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A8A29Q082924; Sat, 10 May 2014 08:10:02 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201405100810.s4A8A29Q082924@svn.freebsd.org> From: Rui Paulo Date: Sat, 10 May 2014 08:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265810 - stable/10/sys/arm/ti X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 08:10:02 -0000 Author: rpaulo Date: Sat May 10 08:10:01 2014 New Revision: 265810 URL: http://svnweb.freebsd.org/changeset/base/265810 Log: MFC r259126: Activate the device before attempt to access any of its registers. Without this change we may end up with a panic (Fatal kernel mode data abort: 'External Non-Linefetch Abort (S)') as described in http://e2e.ti.com/support/arm/sitara_arm/f/791/t/276862.aspx. It is now possible to bring up I2C1 and I2C2 on BBB. Modified: stable/10/sys/arm/ti/ti_i2c.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/ti/ti_i2c.c ============================================================================== --- stable/10/sys/arm/ti/ti_i2c.c Sat May 10 08:07:41 2014 (r265809) +++ stable/10/sys/arm/ti/ti_i2c.c Sat May 10 08:10:01 2014 (r265810) @@ -1076,20 +1076,20 @@ ti_i2c_attach(device_t dev) goto out; } - /* XXXOMAP3: FIXME get proper revision here */ - /* First read the version number of the I2C module */ - sc->sc_rev = ti_i2c_read_2(sc, I2C_REG_REVNB_HI) & 0xff; - - device_printf(dev, "I2C revision %d.%d\n", sc->sc_rev >> 4, - sc->sc_rev & 0xf); - - /* Activate the H/W */ + /* First we _must_ activate the H/W */ err = ti_i2c_activate(dev); if (err) { device_printf(dev, "ti_i2c_activate failed\n"); goto out; } + /* XXXOMAP3: FIXME get proper revision here */ + /* Read the version number of the I2C module */ + sc->sc_rev = ti_i2c_read_2(sc, I2C_REG_REVNB_HI) & 0xff; + + device_printf(dev, "I2C revision %d.%d\n", sc->sc_rev >> 4, + sc->sc_rev & 0xf); + /* activate the interrupt */ err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, ti_i2c_intr, sc, &sc->sc_irq_h); From owner-svn-src-stable-10@FreeBSD.ORG Sat May 10 19:10:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 53C9157D; Sat, 10 May 2014 19:10: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 262CBEF3; Sat, 10 May 2014 19:10: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 s4AJAWpn084815; Sat, 10 May 2014 19:10:32 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AJAWi9084814; Sat, 10 May 2014 19:10:32 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405101910.s4AJAWi9084814@svn.freebsd.org> From: Christian Brueffer Date: Sat, 10 May 2014 19:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265848 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 19:10:32 -0000 Author: brueffer Date: Sat May 10 19:10:31 2014 New Revision: 265848 URL: http://svnweb.freebsd.org/changeset/base/265848 Log: MFC: r265263 Make this manpage ready for hardware notes generation, add more Xrefs and perform general cleanup. In particular, don't claim rsu(4) devices can be configured with hostname(1)... Modified: stable/10/share/man/man4/rsu.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/rsu.4 ============================================================================== --- stable/10/share/man/man4/rsu.4 Sat May 10 19:08:07 2014 (r265847) +++ stable/10/share/man/man4/rsu.4 Sat May 10 19:10:31 2014 (r265848) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd July 29 2013 +.Dd May 3, 2014 .Dt RSU 4 .Os .Sh NAME @@ -40,7 +40,8 @@ place the following line in if_rsu_load="YES" .Ed .Pp -After you have read the license in /usr/share/doc/legal/realtek +After you have read the license in +.Pa /usr/share/doc/legal/realtek you will want to add the following lines to .Xr loader.conf 5 : .Bd -literal -offset indent @@ -93,18 +94,19 @@ due to serious weaknesses in it. The .Nm driver can be configured at runtime with -.Xr ifconfig 8 -or on boot with -.Xr hostname 1 . +.Xr ifconfig 8 . .Sh FILES The driver needs at least version 1.2 of the following firmware file, which is loaded when an interface is attached: .Pp .Bl -tag -width Ds -offset indent -compact -.It /boot/kernel/rsu-rtl8712fw.ko +.It Pa /boot/kernel/rsu-rtl8712fw.ko .El .Sh HARDWARE -The following adapters should work: +The +.Nm +driver provices support for Realtek RTL8188SU/RTL8192SU USB IEEE 802.11b/g/n +wireless network adapters, including: .Pp .Bl -tag -width Ds -offset indent -compact .It ASUS USB-N10 @@ -149,14 +151,15 @@ The driver will reset the hardware. This should not happen. .El .Sh SEE ALSO -.Xr hostname 1 , .Xr intro 1 , -.Xr usb 3 , +.Xr usb 4 , .Xr netintro 4 , .Xr rsufw 4 , .Xr wlan 4 , .Xr arp 8 , -.Xr ifconfig 8 +.Xr hostapd 8 , +.Xr ifconfig 8 , +.Xr wpa_supplicant 8 .Sh HISTORY The .Nm From owner-svn-src-stable-10@FreeBSD.ORG Sat May 10 19:47:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6A8CDF98; Sat, 10 May 2014 19:47: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 4BE48230; Sat, 10 May 2014 19:47: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 s4AJlt7q004806; Sat, 10 May 2014 19:47:55 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AJlsII004798; Sat, 10 May 2014 19:47:54 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405101947.s4AJlsII004798@svn.freebsd.org> From: Christian Brueffer Date: Sat, 10 May 2014 19:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265851 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 19:47:55 -0000 Author: brueffer Date: Sat May 10 19:47:54 2014 New Revision: 265851 URL: http://svnweb.freebsd.org/changeset/base/265851 Log: MFC: r257408 by kevlo Add manpage for urtwnfw, the Realtek RTL8188CU/RTL8192CU firmware module. Also fix a few nits in urtwn.4. Added: stable/10/share/man/man4/urtwnfw.4 - copied unchanged from r257408, head/share/man/man4/urtwnfw.4 Modified: stable/10/share/man/man4/Makefile stable/10/share/man/man4/urtwn.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Sat May 10 19:47:00 2014 (r265850) +++ stable/10/share/man/man4/Makefile Sat May 10 19:47:54 2014 (r265851) @@ -534,6 +534,7 @@ MAN= aac.4 \ urndis.4 \ ${_urtw.4} \ urtwn.4 \ + urtwnfw.4 \ usb.4 \ usb_template.4 \ usb_quirk.4 \ Modified: stable/10/share/man/man4/urtwn.4 ============================================================================== --- stable/10/share/man/man4/urtwn.4 Sat May 10 19:47:00 2014 (r265850) +++ stable/10/share/man/man4/urtwn.4 Sat May 10 19:47:54 2014 (r265851) @@ -1,6 +1,3 @@ -.\" $OpenBSD: urtwn.4,v 1.20 2013/05/16 10:02:59 sthen Exp $ -.\" $FreeBSD$ -.\" .\" Copyright (c) 2010 Damien Bergamini .\" .\" Permission to use, copy, modify, and distribute this software for any @@ -15,7 +12,9 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd October 6, 2013 +.\" $FreeBSD$ +.\" +.Dd October 31, 2013 .Dt URTWN 4 .Os .Sh NAME @@ -40,6 +39,13 @@ module at boot time, place the following .Bd -literal -offset indent if_urtwn_load="YES" .Ed +.Pp +In both cases, place the following line in +.Xr loader.conf 5 +to acknowledge the firmware license (see below): +.Bd -literal -offset indent +legal.realtek.license_ack=1 +.Ed .Sh DESCRIPTION The .Nm @@ -57,6 +63,22 @@ The RTL8192CU is a highly integrated mul 802.11n adapter that combines a MAC, a 2T2R capable baseband and an RF in a single chip. It operates in the 2GHz spectrum only. +.Pp +This driver requires the firmware built with the +.Nm urtwnfw +module to work. +For the loaded firmware to be enabled for use the license at +.Pa /usr/share/doc/legal/realtek +must be agreed by adding the following line to +.Xr loader.conf 5 : +.Pp +.Dl "legal.realtek.license_ack=1" +.Sh FILES +.Bl -tag -width ".Pa /usr/share/doc/legal/realtek" -compact +.It Pa /usr/share/doc/legal/realtek +.Nm +firmware license +.El .Sh HARDWARE The following adapters should work: .Pp @@ -98,6 +120,7 @@ The driver will reset the hardware. This should not happen. .El .Sh SEE ALSO +.Xr urtwnfw 4 , .Xr intro 4 , .Xr netintro 4 , .Xr usb 4 , Copied: stable/10/share/man/man4/urtwnfw.4 (from r257408, head/share/man/man4/urtwnfw.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/urtwnfw.4 Sat May 10 19:47:54 2014 (r265851, copy of r257408, head/share/man/man4/urtwnfw.4) @@ -0,0 +1,75 @@ +.\" Copyright (c) 2013 Kevin Lo +.\" 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. 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 +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 31, 2013 +.Dt URTWNFW 4 +.Os +.Sh NAME +.Nm urtwnfw +.Nd "Firmware Module for Realtek Wireless driver" +.Sh SYNOPSIS +To compile this module into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device urtwnfw" +.Ed +.Pp +This will include three firmware images inside the kernel. +If you want to pick only the firmware image for your network adapter choose one +of the following: +.Bd -ragged -offset indent +.Cd "device urtwn-rtl8192cfwT" +.Cd "device urtwn-rtl8192cfwU" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +urtwn-rtl8192cfwT_load="YES" +urtwn-rtl8192cfwU_load="YES" +.Ed +.Sh DESCRIPTION +This module provides access to firmware sets for the +Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU +chip based USB WiFi adapters. +It may be +statically linked into the kernel, or loaded as a module. +.Pp +For the loaded firmware to be enabled for use the license at +.Pa /usr/share/doc/legal/realtek +must be agreed to by adding the following line to +.Xr loader.conf 5 : +.Pp +.Dl "legal.realtek.license_ack=1" +.Sh FILES +.Bl -tag -width ".Pa /usr/share/doc/legal/realtek" -compact +.It Pa /usr/share/doc/legal/realtek +.Nm +firmware license +.El +.Sh SEE ALSO +.Xr urtwn 4 , +.Xr firmware 9 From owner-svn-src-stable-10@FreeBSD.ORG Sat May 10 20:45:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7C6D6710; Sat, 10 May 2014 20:45: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 684BD8F1; Sat, 10 May 2014 20:45: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 s4AKjO6q032210; Sat, 10 May 2014 20:45:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AKjOqX032208; Sat, 10 May 2014 20:45:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405102045.s4AKjOqX032208@svn.freebsd.org> From: Christian Brueffer Date: Sat, 10 May 2014 20:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265856 - in stable/10/release/doc: en_US.ISO8859-1/hardware share/misc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 20:45:24 -0000 Author: brueffer Date: Sat May 10 20:45:23 2014 New Revision: 265856 URL: http://svnweb.freebsd.org/changeset/base/265856 Log: MFC: r265264, r265270 Add rsu(4) and urtwn(4) to the hardware notes. Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml stable/10/release/doc/share/misc/dev.archlist.txt Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Sat May 10 20:39:57 2014 (r265855) +++ stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Sat May 10 20:45:23 2014 (r265856) @@ -1014,6 +1014,8 @@ &hwlist.ral; + &hwlist.rsu; + &hwlist.rum; &hwlist.run; @@ -1026,6 +1028,8 @@ &hwlist.urtw; + &hwlist.urtwn; + [&arch.amd64;, &arch.i386;, &arch.pc98;] Lucent Technologies WaveLAN/IEEE 802.11b wireless network adapters and workalikes using the Lucent Hermes, Intersil PRISM-II, Modified: stable/10/release/doc/share/misc/dev.archlist.txt ============================================================================== --- stable/10/release/doc/share/misc/dev.archlist.txt Sat May 10 20:39:57 2014 (r265855) +++ stable/10/release/doc/share/misc/dev.archlist.txt Sat May 10 20:45:23 2014 (r265856) @@ -109,6 +109,7 @@ qlxgbe amd64 qlxge amd64 rc i386 ral i386,amd64 +rsu i386,amd64 rue i386,pc98,amd64 rum i386,amd64 run i386,amd64 From owner-svn-src-stable-10@FreeBSD.ORG Sun May 11 09:54:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4DEFD3A3; Sun, 11 May 2014 09:54: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 3A417247F; Sun, 11 May 2014 09:54: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 s4B9sdFh084142; Sun, 11 May 2014 09:54:39 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B9sd25084141; Sun, 11 May 2014 09:54:39 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405110954.s4B9sd25084141@svn.freebsd.org> From: Christian Brueffer Date: Sun, 11 May 2014 09:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265874 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 09:54:39 -0000 Author: brueffer Date: Sun May 11 09:54:38 2014 New Revision: 265874 URL: http://svnweb.freebsd.org/changeset/base/265874 Log: MFC: r265269 Make the HARDWARE section ready for release notes generation; sort SEE ALSO. Compared to the original revision, the list of supported chipsets was changed to reflect those supported in this branch. Modified: stable/10/share/man/man4/urtwn.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/urtwn.4 ============================================================================== --- stable/10/share/man/man4/urtwn.4 Sun May 11 09:14:29 2014 (r265873) +++ stable/10/share/man/man4/urtwn.4 Sun May 11 09:54:38 2014 (r265874) @@ -14,7 +14,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2013 +.Dd May 3, 2014 .Dt URTWN 4 .Os .Sh NAME @@ -80,7 +80,10 @@ must be agreed by adding the following l firmware license .El .Sh HARDWARE -The following adapters should work: +The +.Nm +driver supports Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU based USB +IEEE 802.11b/g/n wireless network adapters, including: .Pp .Bl -tag -width Ds -offset indent -compact .It ASUS USB-N10 NANO @@ -120,9 +123,9 @@ The driver will reset the hardware. This should not happen. .El .Sh SEE ALSO -.Xr urtwnfw 4 , .Xr intro 4 , .Xr netintro 4 , +.Xr urtwnfw 4 , .Xr usb 4 , .Xr wlan 4 , .Xr wlan_ccmp 4 , From owner-svn-src-stable-10@FreeBSD.ORG Sun May 11 14:54:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9F3E9369; Sun, 11 May 2014 14:54: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 8B1602956; Sun, 11 May 2014 14:54: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 s4BEsIHd019332; Sun, 11 May 2014 14:54:18 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BEsImq019330; Sun, 11 May 2014 14:54:18 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405111454.s4BEsImq019330@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 11 May 2014 14:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265879 - stable/10/lib/libcrypt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 14:54:18 -0000 Author: des Date: Sun May 11 14:54:17 2014 New Revision: 265879 URL: http://svnweb.freebsd.org/changeset/base/265879 Log: MFH (r261913): switch default to sha512 MFH (r264964): rewrite so DES still works when not the default MFH (r262945): clean up man page Modified: stable/10/lib/libcrypt/crypt.3 stable/10/lib/libcrypt/crypt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcrypt/crypt.3 ============================================================================== --- stable/10/lib/libcrypt/crypt.3 Sun May 11 13:48:21 2014 (r265878) +++ stable/10/lib/libcrypt/crypt.3 Sun May 11 14:54:17 2014 (r265879) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2011 +.Dd March 9, 2014 .Dt CRYPT 3 .Os .Sh NAME @@ -63,11 +63,16 @@ Currently these include the .Tn MD5 hash, .Tn NT-Hash -(compatible with Microsoft's NT scheme) +.Pq compatible with Microsoft's NT scheme and .Tn Blowfish . -The algorithm used will depend upon the format of the Salt (following -the Modular Crypt Format (MCF)), if +The algorithm used will depend upon the format of the Salt +.Po +following +the Modular Crypt Format +.Pq MCF +.Pc , +if .Tn DES and/or .Tn Blowfish @@ -77,8 +82,10 @@ has been called to change the default. .Pp The first argument to .Nm -is the data to hash (usually a password), in a -.Dv null Ns -terminated +is the data to hash +.Pq usually a password , +in a +.Dv NUL Ns -terminated string. The second is the salt, in one of three forms: .Pp @@ -96,22 +103,19 @@ If it begins with the string then the Modular Crypt Format is used, as outlined below. .It Traditional If neither of the above is true, it assumes the Traditional Format, -using the entire string as the salt (or the first portion). +using the entire string as the salt +.Pq or the first portion . .El .Pp All routines are designed to be time-consuming. -A brief test on a -.Tn Pentium -166/MMX shows the -.Tn DES -crypt to do approximately 2640 crypts -a CPU second and MD5 to do about 62 crypts a CPU second. .Ss DES Extended Format: The .Ar key -is divided into groups of 8 characters (the last group is null-padded) -and the low-order 7 bits of each character (56 bits per group) are -used to form the +is divided into groups of 8 characters +.Pq the last group is NUL-padded +and the low-order 7 bits of each character +.Pq 56 bits per group +are used to form the .Tn DES key as follows: the first group of 56 bits becomes the initial @@ -127,7 +131,8 @@ The salt is a 9-character array consisti by 4 bytes of iteration count and 4 bytes of salt. These are encoded as printable characters, 6 bits per character, least significant character first. -The values 0 to 63 are encoded as ``./0-9A-Za-z''. +The values 0 to 63 are encoded as +.Dq ./0-9A-Za-z . This allows 24 bits for both .Fa count and @@ -138,7 +143,8 @@ The introduces disorder in the .Tn DES algorithm in one of 16777216 or 4096 possible ways -(i.e., with 24 or 12 bits: if bit +.Po +i.e., with 24 or 12 bits: if bit .Em i of the .Ar salt @@ -148,7 +154,8 @@ and .Em i+24 are swapped in the .Tn DES -E-box output). +E-box output +.Pc . .Pp The .Tn DES @@ -157,11 +164,13 @@ key is used to encrypt a 64-bit constant iterations of .Tn DES . The value returned is a -.Dv null Ns -terminated -string, 20 or 13 bytes (plus null) in length, consisting of the +.Dv NUL Ns -terminated +string, 20 or 13 bytes +.Pq plus NUL +in length, consisting of the .Ar salt followed by the encoded 64-bit encryption. -.Ss "Modular" crypt: +.Ss Modular crypt: If the salt begins with the string .Fa $digit$ then the Modular Crypt Format is used. @@ -170,11 +179,10 @@ The represents which algorithm is used in encryption. Following the token is the actual salt to use in the encryption. -The length of the salt is limited -to 8 characters--because the length of the returned output is also limited -(_PASSWORD_LEN). -The salt must be terminated with the end of the string -(NULL) or a dollar sign. +The maximum length of the salt used depends upon the module. +The salt must be terminated with the end of the string character +.Pq NUL +or a dollar sign. Any characters after the dollar sign are ignored. .Pp Currently supported algorithms are: @@ -199,7 +207,7 @@ An example salt would be: .Bl -tag -width 6n -offset indent .It Cm "$4$thesalt$rest" .El -.Ss "Traditional" crypt: +.Ss Traditional crypt: The algorithm used will depend upon whether .Fn crypt_set_format has been called and whether a global default format has been specified. @@ -216,7 +224,7 @@ if it is available, or MD5 if not. .Pp How the salt is used will depend upon the algorithm for the hash. For -best results, specify at least two characters of salt. +best results, specify at least eight characters of salt. .Pp The .Fn crypt_get_format Modified: stable/10/lib/libcrypt/crypt.c ============================================================================== --- stable/10/lib/libcrypt/crypt.c Sun May 11 13:48:21 2014 (r265878) +++ stable/10/lib/libcrypt/crypt.c Sun May 11 14:54:17 2014 (r265879) @@ -1,6 +1,7 @@ -/* - * Copyright (c) 1999 - * Mark Murray. All rights reserved. +/*- + * Copyright (c) 1999 Mark Murray + * Copyright (c) 2014 Dag-Erling Smørgrav + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,114 +29,88 @@ __FBSDID("$FreeBSD$"); #include -#include + #include +#include #include + #include "crypt.h" -static const struct { +/* + * List of supported crypt(3) formats. The first element in the list will + * be the default. + */ +static const struct crypt_format { const char *const name; char *(*const func)(const char *, const char *); const char *const magic; -} crypt_types[] = { -#ifdef HAS_DES - { - "des", - crypt_des, - NULL - }, -#endif - { - "md5", - crypt_md5, - "$1$" - }, +} crypt_formats[] = { + /* default format */ + { "sha512", crypt_sha512, "$6$" }, + + /* other supported formats */ + { "md5", crypt_md5, "$1$" }, #ifdef HAS_BLOWFISH - { - "blf", - crypt_blowfish, - "$2" - }, + { "blf", crypt_blowfish, "$2" }, #endif - { - "nth", - crypt_nthash, - "$3$" - }, - { - "sha256", - crypt_sha256, - "$5$" - }, - { - "sha512", - crypt_sha512, - "$6$" - }, - { - NULL, - NULL, - NULL - } -}; - + { "nth", crypt_nthash, "$3$" }, + { "sha256", crypt_sha256, "$5$" }, #ifdef HAS_DES -#define CRYPT_DEFAULT "des" -#else -#define CRYPT_DEFAULT "md5" + { "des", crypt_des, "_" }, #endif -static int crypt_type = -1; + /* sentinel */ + { NULL, NULL, NULL } +}; -static void -crypt_setdefault(void) -{ - size_t i; +static const struct crypt_format *crypt_format = &crypt_formats[0]; - if (crypt_type != -1) - return; - for (i = 0; i < sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) { - if (strcmp(CRYPT_DEFAULT, crypt_types[i].name) == 0) { - crypt_type = (int)i; - return; - } - } - crypt_type = 0; -} +#define DES_SALT_ALPHABET \ + "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" +/* + * Returns the name of the currently selected format. + */ const char * crypt_get_format(void) { - crypt_setdefault(); - return (crypt_types[crypt_type].name); + return (crypt_format->name); } +/* + * Selects the format to use for subsequent crypt(3) invocations. + */ int -crypt_set_format(const char *type) +crypt_set_format(const char *format) { - size_t i; + const struct crypt_format *cf; - crypt_setdefault(); - for (i = 0; i < sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) { - if (strcmp(type, crypt_types[i].name) == 0) { - crypt_type = (int)i; + for (cf = crypt_formats; cf->name != NULL; ++cf) { + if (strcasecmp(cf->name, format) == 0) { + crypt_format = cf; return (1); } } return (0); } +/* + * Hash the given password with the given salt. If the salt begins with a + * magic string (e.g. "$6$" for sha512), the corresponding format is used; + * otherwise, the currently selected format is used. + */ char * crypt(const char *passwd, const char *salt) { - size_t i; + const struct crypt_format *cf; - crypt_setdefault(); - for (i = 0; i < sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) { - if (crypt_types[i].magic != NULL && strncmp(salt, - crypt_types[i].magic, strlen(crypt_types[i].magic)) == 0) - return (crypt_types[i].func(passwd, salt)); - } - return (crypt_types[crypt_type].func(passwd, salt)); + for (cf = crypt_formats; cf->name != NULL; ++cf) + if (cf->magic != NULL && strstr(salt, cf->magic) == salt) + return (cf->func(passwd, salt)); +#ifdef HAS_DES + if (strlen(salt) == 13 && strspn(salt, DES_SALT_ALPHABET) == 13) + return (crypt_des(passwd, salt)); +#endif + return (crypt_format->func(passwd, salt)); } From owner-svn-src-stable-10@FreeBSD.ORG Sun May 11 17:18:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DD96E23B; Sun, 11 May 2014 17:18: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 C915E2447; Sun, 11 May 2014 17:18: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 s4BHIAps084925; Sun, 11 May 2014 17:18:10 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BHI9eT084919; Sun, 11 May 2014 17:18:09 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201405111718.s4BHI9eT084919@svn.freebsd.org> From: "George V. Neville-Neil" Date: Sun, 11 May 2014 17:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265884 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 17:18:11 -0000 Author: gnn Date: Sun May 11 17:18:09 2014 New Revision: 265884 URL: http://svnweb.freebsd.org/changeset/base/265884 Log: MFC: 263302, 264461, 264772 263302: fix mbuf leak if it does not fit in software queue 264461: Commit various fixes for the SolarFlare drivers, in particular this set of patches fixes support for systems with > 32 cores. Details include sfxge: RXQ index (not label) comes from FW in flush done/failed events Change the second argument name of the efx_rxq_flush_done_ev_t and efx_rxq_flush_failed_ev_t prototypes to highlight that RXQ index (not label) comes from FW in flush done and failed events. sfxge: TXQ index (not label) comes from FW in flush done event Change the second argument name of the efx_txq_flush_done_ev_t prototype to highlight that TXQ index (not label) comes from FW in flush done event. sfxge: use TXQ type as label to support more than 32 TXQs There are 3 TXQs in event queue 0 and 1 TXQ (with TCP/UDP checksum offload) in all other event queues. 264772: Check that port is started when MAC filter is set The MAC filter set may be called without softc_lock held in the case of SIOCADDMULTI and SIOCDELMULTI ioctls. The ioctl handler checks IFF_DRV_RUNNING flag which implies port started, but it is not guaranteed to remain. softc_lock shared lock can't be held in the case of these ioctls processing, since it results in failure where kernel complains that non-sleepable lock is held in sleeping thread. Both problems are repeatable on LAG with LACP proto bring up. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_ev.c stable/10/sys/dev/sfxge/common/efx_tx.c stable/10/sys/dev/sfxge/sfxge_ev.c stable/10/sys/dev/sfxge/sfxge_port.c stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Sun May 11 16:49:31 2014 (r265883) +++ stable/10/sys/dev/sfxge/common/efx.h Sun May 11 17:18:09 2014 (r265884) @@ -1360,17 +1360,17 @@ typedef __checkReturn boolean_t typedef __checkReturn boolean_t (*efx_rxq_flush_done_ev_t)( __in_opt void *arg, - __in uint32_t label); + __in uint32_t rxq_index); typedef __checkReturn boolean_t (*efx_rxq_flush_failed_ev_t)( __in_opt void *arg, - __in uint32_t label); + __in uint32_t rxq_index); typedef __checkReturn boolean_t (*efx_txq_flush_done_ev_t)( __in_opt void *arg, - __in uint32_t label); + __in uint32_t txq_index); typedef __checkReturn boolean_t (*efx_software_ev_t)( Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Sun May 11 16:49:31 2014 (r265883) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Sun May 11 17:18:09 2014 (r265884) @@ -407,24 +407,24 @@ efx_ev_driver( switch (EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_SUBCODE)) { case FSE_AZ_TX_DESCQ_FLS_DONE_EV: { - uint32_t label; + uint32_t txq_index; EFX_EV_QSTAT_INCR(eep, EV_DRIVER_TX_DESCQ_FLS_DONE); - label = EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_SUBDATA); + txq_index = EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_SUBDATA); - EFSYS_PROBE1(tx_descq_fls_done, uint32_t, label); + EFSYS_PROBE1(tx_descq_fls_done, uint32_t, txq_index); EFSYS_ASSERT(eecp->eec_txq_flush_done != NULL); - should_abort = eecp->eec_txq_flush_done(arg, label); + should_abort = eecp->eec_txq_flush_done(arg, txq_index); break; } case FSE_AZ_RX_DESCQ_FLS_DONE_EV: { - uint32_t label; + uint32_t rxq_index; uint32_t failed; - label = EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_RX_DESCQ_ID); + rxq_index = EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_RX_DESCQ_ID); failed = EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_RX_FLUSH_FAIL); EFSYS_ASSERT(eecp->eec_rxq_flush_done != NULL); @@ -433,15 +433,15 @@ efx_ev_driver( if (failed) { EFX_EV_QSTAT_INCR(eep, EV_DRIVER_RX_DESCQ_FLS_FAILED); - EFSYS_PROBE1(rx_descq_fls_failed, uint32_t, label); + EFSYS_PROBE1(rx_descq_fls_failed, uint32_t, rxq_index); - should_abort = eecp->eec_rxq_flush_failed(arg, label); + should_abort = eecp->eec_rxq_flush_failed(arg, rxq_index); } else { EFX_EV_QSTAT_INCR(eep, EV_DRIVER_RX_DESCQ_FLS_DONE); - EFSYS_PROBE1(rx_descq_fls_done, uint32_t, label); + EFSYS_PROBE1(rx_descq_fls_done, uint32_t, rxq_index); - should_abort = eecp->eec_rxq_flush_done(arg, label); + should_abort = eecp->eec_rxq_flush_done(arg, rxq_index); } break; Modified: stable/10/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_tx.c Sun May 11 16:49:31 2014 (r265883) +++ stable/10/sys/dev/sfxge/common/efx_tx.c Sun May 11 17:18:09 2014 (r265884) @@ -290,7 +290,7 @@ efx_tx_qcreate( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX); EFX_STATIC_ASSERT(EFX_EV_TX_NLABELS == (1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH)); - EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS); + /* EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS);*/ EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit); if (!ISP2(n) || !(n & EFX_TXQ_NDESCS_MASK)) { Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Sun May 11 16:49:31 2014 (r265883) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Sun May 11 17:18:09 2014 (r265884) @@ -150,17 +150,18 @@ sfxge_ev_exception(void *arg, uint32_t c } static boolean_t -sfxge_ev_rxq_flush_done(void *arg, uint32_t label) +sfxge_ev_rxq_flush_done(void *arg, uint32_t rxq_index) { struct sfxge_evq *evq; struct sfxge_softc *sc; struct sfxge_rxq *rxq; unsigned int index; + unsigned int label; uint16_t magic; evq = (struct sfxge_evq *)arg; sc = evq->sc; - rxq = sc->rxq[label]; + rxq = sc->rxq[rxq_index]; KASSERT(rxq != NULL, ("rxq == NULL")); @@ -168,6 +169,7 @@ sfxge_ev_rxq_flush_done(void *arg, uint3 index = rxq->index; evq = sc->evq[index]; + label = rxq_index; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); magic = SFXGE_MAGIC_RX_QFLUSH_DONE | label; @@ -180,17 +182,18 @@ sfxge_ev_rxq_flush_done(void *arg, uint3 } static boolean_t -sfxge_ev_rxq_flush_failed(void *arg, uint32_t label) +sfxge_ev_rxq_flush_failed(void *arg, uint32_t rxq_index) { struct sfxge_evq *evq; struct sfxge_softc *sc; struct sfxge_rxq *rxq; unsigned int index; + unsigned int label; uint16_t magic; evq = (struct sfxge_evq *)arg; sc = evq->sc; - rxq = sc->rxq[label]; + rxq = sc->rxq[rxq_index]; KASSERT(rxq != NULL, ("rxq == NULL")); @@ -198,6 +201,7 @@ sfxge_ev_rxq_flush_failed(void *arg, uin index = rxq->index; evq = sc->evq[index]; + label = rxq_index; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); magic = SFXGE_MAGIC_RX_QFLUSH_FAILED | label; @@ -209,18 +213,27 @@ sfxge_ev_rxq_flush_failed(void *arg, uin return (B_FALSE); } +static struct sfxge_txq * +sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfxge_txq_type label) +{ + unsigned int index; + + KASSERT((evq->index == 0 && label < SFXGE_TXQ_NTYPES) || + (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label")); + index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_TXQ_NTYPES); + return evq->sc->txq[index]; +} + static boolean_t sfxge_ev_tx(void *arg, uint32_t label, uint32_t id) { struct sfxge_evq *evq; - struct sfxge_softc *sc; struct sfxge_txq *txq; unsigned int stop; unsigned int delta; evq = (struct sfxge_evq *)arg; - sc = evq->sc; - txq = sc->txq[label]; + txq = sfxge_get_txq_by_label(evq, label); KASSERT(txq != NULL, ("txq == NULL")); KASSERT(evq->index == txq->evq_index, @@ -251,16 +264,17 @@ done: } static boolean_t -sfxge_ev_txq_flush_done(void *arg, uint32_t label) +sfxge_ev_txq_flush_done(void *arg, uint32_t txq_index) { struct sfxge_evq *evq; struct sfxge_softc *sc; struct sfxge_txq *txq; + unsigned int label; uint16_t magic; evq = (struct sfxge_evq *)arg; sc = evq->sc; - txq = sc->txq[label]; + txq = sc->txq[txq_index]; KASSERT(txq != NULL, ("txq == NULL")); KASSERT(txq->init_state == SFXGE_TXQ_INITIALIZED, @@ -269,6 +283,7 @@ sfxge_ev_txq_flush_done(void *arg, uint3 /* Resend a software event on the correct queue */ evq = sc->evq[txq->evq_index]; + label = txq->type; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); magic = SFXGE_MAGIC_TX_QFLUSH_DONE | label; @@ -325,7 +340,7 @@ sfxge_ev_software(void *arg, uint16_t ma break; } case SFXGE_MAGIC_TX_QFLUSH_DONE: { - struct sfxge_txq *txq = sc->txq[label]; + struct sfxge_txq *txq = sfxge_get_txq_by_label(evq, label); KASSERT(txq != NULL, ("txq == NULL")); KASSERT(evq->index == txq->evq_index, Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Sun May 11 16:49:31 2014 (r265883) +++ stable/10/sys/dev/sfxge/sfxge_port.c Sun May 11 17:18:09 2014 (r265884) @@ -320,10 +320,21 @@ sfxge_mac_filter_set(struct sfxge_softc struct sfxge_port *port = &sc->port; int rc; - KASSERT(port->init_state == SFXGE_PORT_STARTED, ("port not started")); - mtx_lock(&port->lock); - rc = sfxge_mac_filter_set_locked(sc); + /* + * The function may be called without softc_lock held in the + * case of SIOCADDMULTI and SIOCDELMULTI ioctls. ioctl handler + * checks IFF_DRV_RUNNING flag which implies port started, but + * it is not guaranteed to remain. softc_lock shared lock can't + * be held in the case of these ioctls processing, since it + * results in failure where kernel complains that non-sleepable + * lock is held in sleeping thread. Both problems are repeatable + * on LAG with LACP proto bring up. + */ + if (port->init_state == SFXGE_PORT_STARTED) + rc = sfxge_mac_filter_set_locked(sc); + else + rc = 0; mtx_unlock(&port->lock); return rc; } Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Sun May 11 16:49:31 2014 (r265883) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Sun May 11 17:18:09 2014 (r265884) @@ -27,6 +27,21 @@ * SUCH DAMAGE. */ +/* Theory of operation: + * + * Tx queues allocation and mapping + * + * One Tx queue with enabled checksum offload is allocated per Rx channel + * (event queue). Also 2 Tx queues (one without checksum offload and one + * with IP checksum offload only) are allocated and bound to event queue 0. + * sfxge_txq_type is used as Tx queue label. + * + * So, event queue plus label mapping to Tx queue index is: + * if event queue index is 0, TxQ-index = TxQ-label * [0..SFXGE_TXQ_NTYPES) + * else TxQ-index = SFXGE_TXQ_NTYPES + EvQ-index - 1 + * See sfxge_get_txq_by_label() sfxge_ev.c + */ + #include __FBSDID("$FreeBSD$"); @@ -536,6 +551,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx return (0); fail: + m_freem(m); return (rc); } @@ -1177,7 +1193,7 @@ sfxge_tx_qstart(struct sfxge_softc *sc, } /* Create the common code transmit queue. */ - if ((rc = efx_tx_qcreate(sc->enp, index, index, esmp, + if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp, SFXGE_NDESCS, txq->buf_base_id, flags, evq->common, &txq->common)) != 0) goto fail; From owner-svn-src-stable-10@FreeBSD.ORG Sun May 11 20:44:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 37250F4D; Sun, 11 May 2014 20: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 22F6D24BF; Sun, 11 May 2014 20: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 s4BKixHh077886; Sun, 11 May 2014 20:44:59 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BKiwL4077884; Sun, 11 May 2014 20:44:58 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405112044.s4BKiwL4077884@svn.freebsd.org> From: Thomas Quinot Date: Sun, 11 May 2014 20:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265894 - in stable: 10 10/tools/tools/nanobsd 9 9/tools/tools/nanobsd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 20:44:59 -0000 Author: thomas Date: Sun May 11 20:44:58 2014 New Revision: 265894 URL: http://svnweb.freebsd.org/changeset/base/265894 Log: MFC rev. 265260: Add appropriate quoting to allow building with a KERNCONFDIR containing spaces. PR: kern/162736 Modified: stable/10/Makefile.inc1 stable/10/tools/tools/nanobsd/nanobsd.sh Changes in other areas also in this revision: Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/tools/tools/nanobsd/nanobsd.sh Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Sun May 11 18:49:18 2014 (r265893) +++ stable/10/Makefile.inc1 Sun May 11 20:44:58 2014 (r265894) @@ -1002,7 +1002,7 @@ buildkernel: cd ${KRNLCONFDIR}; \ PATH=${TMPPATH} \ config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ - -I ${KERNCONFDIR} ${KERNCONFDIR}/${_kernel} + -I '${KERNCONFDIR}' '${KERNCONFDIR}/${_kernel}' .endif .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) @echo @@ -1831,7 +1831,7 @@ DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF} .if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) .if exists(${KERNCONFDIR}/${KERNCONF}) FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \ - ${KERNCONFDIR}/${KERNCONF} ; echo + '${KERNCONFDIR}/${KERNCONF}' ; echo .endif .endif Modified: stable/10/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- stable/10/tools/tools/nanobsd/nanobsd.sh Sun May 11 18:49:18 2014 (r265893) +++ stable/10/tools/tools/nanobsd/nanobsd.sh Sun May 11 20:44:58 2014 (r265894) @@ -233,7 +233,7 @@ build_kernel ( ) ( ( if [ -f ${NANO_KERNEL} ] ; then - extra="KERNCONFDIR=$(realpath $(dirname ${NANO_KERNEL}))" + kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'" kernconf=$(basename ${NANO_KERNEL}) else kernconf=${NANO_KERNEL} @@ -245,10 +245,10 @@ build_kernel ( ) ( unset TARGET_CPUTYPE # Note: We intentionally build all modules, not only the ones in # NANO_MODULES so the built world can be reused by multiple images. - env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ - SRCCONF=${SRCCONF} \ - ${extra} __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ - KERNCONF=${kernconf} + eval "TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ + SRCCONF='${SRCCONF}' \ + __MAKE_CONF='${NANO_MAKE_CONF_BUILD}' \ + ${kernconfdir_arg} KERNCONF=${kernconf}" ) > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 ) @@ -315,19 +315,19 @@ install_kernel ( ) ( ( if [ -f ${NANO_KERNEL} ] ; then - extra="KERNCONFDIR=$(realpath $(dirname ${NANO_KERNEL}))" + kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'" kernconf=$(basename ${NANO_KERNEL}) else kernconf=${NANO_KERNEL} fi cd ${NANO_SRC} - env TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ - DESTDIR=${NANO_WORLDDIR} \ - SRCCONF=${SRCCONF} \ - ${extra} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} \ - KERNCONF=${kernconf} \ - MODULES_OVERRIDE="${NANO_MODULES}" + eval "TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ + DESTDIR='${NANO_WORLDDIR}' \ + SRCCONF='${SRCCONF}' \ + __MAKE_CONF='${NANO_MAKE_CONF_INSTALL}' \ + ${kernconfdir_arg} KERNCONF=${kernconf} \ + MODULES_OVERRIDE='${NANO_MODULES}'" ) > ${NANO_OBJ}/_.ik 2>&1 ) From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 04:27:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D5280B74; Mon, 12 May 2014 04:27: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 A805D25A3; Mon, 12 May 2014 04:27: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 s4C4RAMI093034; Mon, 12 May 2014 04:27:10 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4C4RAZf093033; Mon, 12 May 2014 04:27:10 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201405120427.s4C4RAZf093033@svn.freebsd.org> From: Don Lewis Date: Mon, 12 May 2014 04:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265901 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 04:27:10 -0000 Author: truckman Date: Mon May 12 04:27:10 2014 New Revision: 265901 URL: http://svnweb.freebsd.org/changeset/base/265901 Log: MFC r265363 Avoid unsigned integer overflow which can cause rman_reserve_resource_bound() to return incorrect results. Continue the initial search until the first viable region is found. Add a comment to explain the search termination test. PR: kern/188534 Reviewed by: jhb (previous version) Modified: stable/10/sys/kern/subr_rman.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_rman.c ============================================================================== --- stable/10/sys/kern/subr_rman.c Mon May 12 02:56:27 2014 (r265900) +++ stable/10/sys/kern/subr_rman.c Mon May 12 04:27:10 2014 (r265901) @@ -456,7 +456,7 @@ rman_reserve_resource_bound(struct rman mtx_lock(rm->rm_mtx); for (r = TAILQ_FIRST(&rm->rm_list); - r && r->r_end < start; + r && r->r_end < start + count - 1; r = TAILQ_NEXT(r, r_link)) ; @@ -466,6 +466,11 @@ rman_reserve_resource_bound(struct rman } amask = (1ul << RF_ALIGNMENT(flags)) - 1; + if (start + amask < start) { + DPRINTF(("start+amask wrapped around\n")); + goto out; + } + /* If bound is 0, bmask will also be 0 */ bmask = ~(bound - 1); /* @@ -473,11 +478,20 @@ rman_reserve_resource_bound(struct rman */ for (s = r; s; s = TAILQ_NEXT(s, r_link)) { DPRINTF(("considering [%#lx, %#lx]\n", s->r_start, s->r_end)); - if (s->r_start + count - 1 > end) { + /* + * The resource list is sorted, so there is no point in + * searching further once r_start is too large. + */ + if (s->r_start > end - (count - 1)) { DPRINTF(("s->r_start (%#lx) + count - 1> end (%#lx)\n", s->r_start, end)); break; } + if (s->r_start + amask < s->r_start) { + DPRINTF(("s->r_start (%#lx) + amask (%#lx) wrapped\n", + s->r_start, amask)); + break; + } if (s->r_flags & RF_ALLOCATED) { DPRINTF(("region is allocated\n")); continue; From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 10:19:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EF85DBA4; Mon, 12 May 2014 10:19: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 DBBA92277; Mon, 12 May 2014 10:19: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 s4CAJW7k049825; Mon, 12 May 2014 10:19:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CAJVrQ049820; Mon, 12 May 2014 10:19:31 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405121019.s4CAJVrQ049820@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 12 May 2014 10:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265910 - stable/10/sys/geom/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 10:19:33 -0000 Author: ae Date: Mon May 12 10:19:31 2014 New Revision: 265910 URL: http://svnweb.freebsd.org/changeset/base/265910 Log: MFC r265318: For schemes that do an automatic partition aligning move this code to separate function. MFC r265331: Prevent an unexpected shrinking on resizing due to alignment for MBR, PC98 and VTOC8 schemes. MFC r265333: Add better error description for case when we are doing resize and scheme-specific method returns EBUSY. MFC r265539: It is safe to allow shrinking, when aligned size is bigger than current. Modified: stable/10/sys/geom/part/g_part.c stable/10/sys/geom/part/g_part_ebr.c stable/10/sys/geom/part/g_part_mbr.c stable/10/sys/geom/part/g_part_pc98.c stable/10/sys/geom/part/g_part_vtoc8.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/part/g_part.c ============================================================================== --- stable/10/sys/geom/part/g_part.c Mon May 12 09:46:48 2014 (r265909) +++ stable/10/sys/geom/part/g_part.c Mon May 12 10:19:31 2014 (r265910) @@ -1314,7 +1314,9 @@ g_part_ctl_resize(struct gctl_req *req, error = G_PART_RESIZE(table, entry, gpp); if (error) { - gctl_error(req, "%d", error); + gctl_error(req, "%d%s", error, error != EBUSY ? "": + " resizing will lead to unexpected shrinking" + " due to alignment"); return (error); } Modified: stable/10/sys/geom/part/g_part_ebr.c ============================================================================== --- stable/10/sys/geom/part/g_part_ebr.c Mon May 12 09:46:48 2014 (r265909) +++ stable/10/sys/geom/part/g_part_ebr.c Mon May 12 10:19:31 2014 (r265910) @@ -217,47 +217,54 @@ ebr_set_chs(struct g_part_table *table, } static int +ebr_align(struct g_part_table *basetable, uint32_t *start, uint32_t *size) +{ + uint32_t sectors; + + sectors = basetable->gpt_sectors; + if (*size < 2 * sectors) + return (EINVAL); + if (*start % sectors) { + *size += (*start % sectors) - sectors; + *start -= (*start % sectors) - sectors; + } + if (*size % sectors) + *size -= (*size % sectors); + if (*size < 2 * sectors) + return (EINVAL); + return (0); +} + + +static int g_part_ebr_add(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { - struct g_geom *gp; struct g_provider *pp; struct g_part_ebr_entry *entry; - uint32_t start, size, sectors; + uint32_t start, size; if (gpp->gpp_parms & G_PART_PARM_LABEL) return (EINVAL); - gp = basetable->gpt_gp; - pp = LIST_FIRST(&gp->consumer)->provider; - sectors = basetable->gpt_sectors; - + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; entry = (struct g_part_ebr_entry *)baseentry; - start = gpp->gpp_start; size = gpp->gpp_size; - if (size < 2 * sectors) - return (EINVAL); - if (start % sectors) { - size = size - sectors + (start % sectors); - start = start - (start % sectors) + sectors; - } - if (size % sectors) - size = size - (size % sectors); - if (size < 2 * sectors) + if (ebr_align(basetable, &start, &size) != 0) return (EINVAL); - if (baseentry->gpe_deleted) bzero(&entry->ent, sizeof(entry->ent)); KASSERT(baseentry->gpe_start <= start, ("%s", __func__)); KASSERT(baseentry->gpe_end >= start + size - 1, ("%s", __func__)); - baseentry->gpe_index = (start / sectors) + 1; - baseentry->gpe_offset = (off_t)(start + sectors) * pp->sectorsize; + baseentry->gpe_index = (start / basetable->gpt_sectors) + 1; + baseentry->gpe_offset = + (off_t)(start + basetable->gpt_sectors) * pp->sectorsize; baseentry->gpe_start = start; baseentry->gpe_end = start + size - 1; - entry->ent.dp_start = sectors; - entry->ent.dp_size = size - sectors; + entry->ent.dp_start = basetable->gpt_sectors; + entry->ent.dp_size = size - basetable->gpt_sectors; ebr_set_chs(basetable, entry->ent.dp_start, &entry->ent.dp_scyl, &entry->ent.dp_shd, &entry->ent.dp_ssect); ebr_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl, Modified: stable/10/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/10/sys/geom/part/g_part_mbr.c Mon May 12 09:46:48 2014 (r265909) +++ stable/10/sys/geom/part/g_part_mbr.c Mon May 12 10:19:31 2014 (r265910) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -195,34 +196,39 @@ mbr_set_chs(struct g_part_table *table, } static int +mbr_align(struct g_part_table *basetable, uint32_t *start, uint32_t *size) +{ + uint32_t sectors; + + sectors = basetable->gpt_sectors; + if (*size < sectors) + return (EINVAL); + if (start != NULL && (*start % sectors)) { + *size += (*start % sectors) - sectors; + *start -= (*start % sectors) - sectors; + } + if (*size % sectors) + *size -= (*size % sectors); + if (*size < sectors) + return (EINVAL); + return (0); +} + +static int g_part_mbr_add(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_mbr_entry *entry; - struct g_part_mbr_table *table; - uint32_t start, size, sectors; + uint32_t start, size; if (gpp->gpp_parms & G_PART_PARM_LABEL) return (EINVAL); - sectors = basetable->gpt_sectors; - entry = (struct g_part_mbr_entry *)baseentry; - table = (struct g_part_mbr_table *)basetable; - start = gpp->gpp_start; size = gpp->gpp_size; - if (size < sectors) + if (mbr_align(basetable, &start, &size) != 0) return (EINVAL); - if (start % sectors) { - size = size - sectors + (start % sectors); - start = start - (start % sectors) + sectors; - } - if (size % sectors) - size = size - (size % sectors); - if (size < sectors) - return (EINVAL); - if (baseentry->gpe_deleted) bzero(&entry->ent, sizeof(entry->ent)); @@ -336,18 +342,17 @@ g_part_mbr_resize(struct g_part_table *b struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_mbr_entry *entry; - uint32_t size, sectors; + struct g_provider *pp; + uint32_t size; - sectors = basetable->gpt_sectors; size = gpp->gpp_size; - - if (size < sectors) + if (mbr_align(basetable, NULL, &size) != 0) return (EINVAL); - if (size % sectors) - size = size - (size % sectors); - if (size < sectors) - return (EINVAL); - + /* XXX: prevent unexpected shrinking. */ + pp = baseentry->gpe_pp; + if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size && + pp->mediasize / pp->sectorsize > size) + return (EBUSY); entry = (struct g_part_mbr_entry *)baseentry; baseentry->gpe_end = baseentry->gpe_start + size - 1; entry->ent.dp_size = size; Modified: stable/10/sys/geom/part/g_part_pc98.c ============================================================================== --- stable/10/sys/geom/part/g_part_pc98.c Mon May 12 09:46:48 2014 (r265909) +++ stable/10/sys/geom/part/g_part_pc98.c Mon May 12 10:19:31 2014 (r265910) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -175,32 +176,37 @@ pc98_set_chs(struct g_part_table *table, } static int +pc98_align(struct g_part_table *basetable, uint32_t *start, uint32_t *size) +{ + uint32_t cyl; + + cyl = basetable->gpt_heads * basetable->gpt_sectors; + if (*size < cyl) + return (EINVAL); + if (start != NULL && (*start % cyl)) { + *size += (*start % cyl) - cyl; + *start -= (*start % cyl) - cyl; + } + if (*size % cyl) + *size -= (*size % cyl); + if (*size < cyl) + return (EINVAL); + return (0); +} + +static int g_part_pc98_add(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_pc98_entry *entry; - struct g_part_pc98_table *table; - uint32_t cyl, start, size; + uint32_t start, size; int error; - cyl = basetable->gpt_heads * basetable->gpt_sectors; - entry = (struct g_part_pc98_entry *)baseentry; - table = (struct g_part_pc98_table *)basetable; - start = gpp->gpp_start; size = gpp->gpp_size; - if (size < cyl) + if (pc98_align(basetable, &start, &size) != 0) return (EINVAL); - if (start % cyl) { - size = size - cyl + (start % cyl); - start = start - (start % cyl) + cyl; - } - if (size % cyl) - size = size - (size % cyl); - if (size < cyl) - return (EINVAL); - if (baseentry->gpe_deleted) bzero(&entry->ent, sizeof(entry->ent)); else @@ -343,18 +349,17 @@ g_part_pc98_resize(struct g_part_table * struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_pc98_entry *entry; - uint32_t size, cyl; + struct g_provider *pp; + uint32_t size; - cyl = basetable->gpt_heads * basetable->gpt_sectors; size = gpp->gpp_size; - - if (size < cyl) + if (pc98_align(basetable, NULL, &size) != 0) return (EINVAL); - if (size % cyl) - size = size - (size % cyl); - if (size < cyl) - return (EINVAL); - + /* XXX: prevent unexpected shrinking. */ + pp = baseentry->gpe_pp; + if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size && + pp->mediasize / pp->sectorsize > size) + return (EBUSY); entry = (struct g_part_pc98_entry *)baseentry; baseentry->gpe_end = baseentry->gpe_start + size - 1; pc98_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl, Modified: stable/10/sys/geom/part/g_part_vtoc8.c ============================================================================== --- stable/10/sys/geom/part/g_part_vtoc8.c Mon May 12 09:46:48 2014 (r265909) +++ stable/10/sys/geom/part/g_part_vtoc8.c Mon May 12 10:19:31 2014 (r265910) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -143,6 +144,23 @@ vtoc8_parse_type(const char *type, uint1 } static int +vtoc8_align(struct g_part_vtoc8_table *table, uint64_t *start, uint64_t *size) +{ + + if (*size < table->secpercyl) + return (EINVAL); + if (start != NULL && (*start % table->secpercyl)) { + *size += (*start % table->secpercyl) - table->secpercyl; + *start -= (*start % table->secpercyl) - table->secpercyl; + } + if (*size % table->secpercyl) + *size -= (*size % table->secpercyl); + if (*size < table->secpercyl) + return (EINVAL); + return (0); +} + +static int g_part_vtoc8_add(struct g_part_table *basetable, struct g_part_entry *entry, struct g_part_parms *gpp) { @@ -160,16 +178,9 @@ g_part_vtoc8_add(struct g_part_table *ba table = (struct g_part_vtoc8_table *)basetable; index = entry->gpe_index - 1; - start = gpp->gpp_start; size = gpp->gpp_size; - if (start % table->secpercyl) { - size = size - table->secpercyl + (start % table->secpercyl); - start = start - (start % table->secpercyl) + table->secpercyl; - } - if (size % table->secpercyl) - size = size - (size % table->secpercyl); - if (size < table->secpercyl) + if (vtoc8_align(table, &start, &size) != 0) return (EINVAL); KASSERT(entry->gpe_start <= start, (__func__)); @@ -310,15 +321,18 @@ g_part_vtoc8_resize(struct g_part_table struct g_part_entry *entry, struct g_part_parms *gpp) { struct g_part_vtoc8_table *table; + struct g_provider *pp; uint64_t size; table = (struct g_part_vtoc8_table *)basetable; size = gpp->gpp_size; - if (size % table->secpercyl) - size = size - (size % table->secpercyl); - if (size < table->secpercyl) + if (vtoc8_align(table, NULL, &size) != 0) return (EINVAL); - + /* XXX: prevent unexpected shrinking. */ + pp = entry->gpe_pp; + if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size && + pp->mediasize / pp->sectorsize > size) + return (EBUSY); entry->gpe_end = entry->gpe_start + size - 1; be32enc(&table->vtoc.map[entry->gpe_index - 1].nblks, size); From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 12:04:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DE192A48; Mon, 12 May 2014 12:04: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 BEC472E29; Mon, 12 May 2014 12:04: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 s4CC4kRs099332; Mon, 12 May 2014 12:04:46 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CC4j39099322; Mon, 12 May 2014 12:04:45 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405121204.s4CC4j39099322@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 12 May 2014 12:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265912 - stable/10/sys/geom/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 12:04:47 -0000 Author: ae Date: Mon May 12 12:04:44 2014 New Revision: 265912 URL: http://svnweb.freebsd.org/changeset/base/265912 Log: MFC r256690: Add an automatic resize support to the GEOM_PART class. When parent provider has been resized, the scheme specific G_PART_RESIZE method does an update of scheme's metadata. But all changes are not saved to disk, until `gpart commit` will be called. MFC r265336: Add an advice what to do when partition was automatically resized. Modified: stable/10/sys/geom/part/g_part.c stable/10/sys/geom/part/g_part_apm.c stable/10/sys/geom/part/g_part_bsd.c stable/10/sys/geom/part/g_part_ebr.c stable/10/sys/geom/part/g_part_gpt.c stable/10/sys/geom/part/g_part_mbr.c stable/10/sys/geom/part/g_part_pc98.c stable/10/sys/geom/part/g_part_vtoc8.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/part/g_part.c ============================================================================== --- stable/10/sys/geom/part/g_part.c Mon May 12 11:14:07 2014 (r265911) +++ stable/10/sys/geom/part/g_part.c Mon May 12 12:04:44 2014 (r265912) @@ -133,6 +133,7 @@ static g_dumpconf_t g_part_dumpconf; static g_orphan_t g_part_orphan; static g_spoiled_t g_part_spoiled; static g_start_t g_part_start; +static g_resize_t g_part_resize; static struct g_class g_part_class = { .name = "PART", @@ -149,6 +150,7 @@ static struct g_class g_part_class = { .orphan = g_part_orphan, .spoiled = g_part_spoiled, .start = g_part_start, + .resize = g_part_resize }; DECLARE_GEOM_CLASS(g_part_class, g_part); @@ -2049,6 +2051,32 @@ g_part_dumpconf(struct sbuf *sb, const c } static void +g_part_resize(struct g_consumer *cp) +{ + struct g_part_table *table; + + G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, cp->provider->name)); + g_topology_assert(); + + table = cp->geom->softc; + if (table->gpt_opened == 0) { + if (g_access(cp, 1, 1, 1) != 0) + return; + table->gpt_opened = 1; + } + if (G_PART_RESIZE(table, NULL, NULL) == 0) + printf("GEOM_PART: %s was automatically resized.\n" + " Use `gpart commit %s` to save changes or " + "`gpart undo %s` to revert them.\n", cp->geom->name, + cp->geom->name, cp->geom->name); + if (g_part_check_integrity(table, cp) != 0) { + g_access(cp, -1, -1, -1); + table->gpt_opened = 0; + g_part_wither(table->gpt_gp, ENXIO); + } +} + +static void g_part_orphan(struct g_consumer *cp) { struct g_provider *pp; Modified: stable/10/sys/geom/part/g_part_apm.c ============================================================================== --- stable/10/sys/geom/part/g_part_apm.c Mon May 12 11:14:07 2014 (r265911) +++ stable/10/sys/geom/part/g_part_apm.c Mon May 12 12:04:44 2014 (r265912) @@ -359,6 +359,14 @@ g_part_apm_resize(struct g_part_table *b struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_apm_entry *entry; + struct g_provider *pp; + + if (baseentry == NULL) { + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + basetable->gpt_last = MIN(pp->mediasize / pp->sectorsize, + UINT32_MAX) - 1; + return (0); + } entry = (struct g_part_apm_entry *)baseentry; baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; Modified: stable/10/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/10/sys/geom/part/g_part_bsd.c Mon May 12 11:14:07 2014 (r265911) +++ stable/10/sys/geom/part/g_part_bsd.c Mon May 12 12:04:44 2014 (r265912) @@ -304,12 +304,40 @@ g_part_bsd_modify(struct g_part_table *b return (0); } +static void +bsd_set_rawsize(struct g_part_table *basetable, struct g_provider *pp) +{ + struct g_part_bsd_table *table; + struct g_part_bsd_entry *entry; + struct g_part_entry *baseentry; + uint32_t msize; + + table = (struct g_part_bsd_table *)basetable; + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); + le32enc(table->bbarea + pp->sectorsize + 60, msize); /* d_secperunit */ + basetable->gpt_last = msize - 1; + LIST_FOREACH(baseentry, &basetable->gpt_entry, gpe_entry) { + if (baseentry->gpe_index != RAW_PART + 1) + continue; + baseentry->gpe_end = basetable->gpt_last; + entry = (struct g_part_bsd_entry *)baseentry; + entry->part.p_size = msize; + return; + } +} + static int g_part_bsd_resize(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_bsd_entry *entry; + struct g_provider *pp; + if (baseentry == NULL) { + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + bsd_set_rawsize(basetable, pp); + return (0); + } entry = (struct g_part_bsd_entry *)baseentry; baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; entry->part.p_size = gpp->gpp_size; Modified: stable/10/sys/geom/part/g_part_ebr.c ============================================================================== --- stable/10/sys/geom/part/g_part_ebr.c Mon May 12 11:14:07 2014 (r265911) +++ stable/10/sys/geom/part/g_part_ebr.c Mon May 12 12:04:44 2014 (r265912) @@ -93,6 +93,8 @@ static int g_part_ebr_setunset(struct g_ static const char *g_part_ebr_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_ebr_write(struct g_part_table *, struct g_consumer *); +static int g_part_ebr_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_ebr_methods[] = { KOBJMETHOD(g_part_add, g_part_ebr_add), @@ -108,6 +110,7 @@ static kobj_method_t g_part_ebr_methods[ KOBJMETHOD(g_part_precheck, g_part_ebr_precheck), KOBJMETHOD(g_part_probe, g_part_ebr_probe), KOBJMETHOD(g_part_read, g_part_ebr_read), + KOBJMETHOD(g_part_resize, g_part_ebr_resize), KOBJMETHOD(g_part_setunset, g_part_ebr_setunset), KOBJMETHOD(g_part_type, g_part_ebr_type), KOBJMETHOD(g_part_write, g_part_ebr_write), @@ -384,6 +387,20 @@ g_part_ebr_modify(struct g_part_table *b return (0); } +static int +g_part_ebr_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_provider *pp; + + if (baseentry != NULL) + return (EOPNOTSUPP); + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + basetable->gpt_last = MIN(pp->mediasize / pp->sectorsize, + UINT32_MAX) - 1; + return (0); +} + static const char * g_part_ebr_name(struct g_part_table *table, struct g_part_entry *entry, char *buf, size_t bufsz) Modified: stable/10/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/10/sys/geom/part/g_part_gpt.c Mon May 12 11:14:07 2014 (r265911) +++ stable/10/sys/geom/part/g_part_gpt.c Mon May 12 12:04:44 2014 (r265912) @@ -733,8 +733,11 @@ g_part_gpt_resize(struct g_part_table *b struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_gpt_entry *entry; - entry = (struct g_part_gpt_entry *)baseentry; + if (baseentry == NULL) + return (EOPNOTSUPP); + + entry = (struct g_part_gpt_entry *)baseentry; baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; entry->ent.ent_lba_end = baseentry->gpe_end; Modified: stable/10/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/10/sys/geom/part/g_part_mbr.c Mon May 12 11:14:07 2014 (r265911) +++ stable/10/sys/geom/part/g_part_mbr.c Mon May 12 12:04:44 2014 (r265912) @@ -345,6 +345,12 @@ g_part_mbr_resize(struct g_part_table *b struct g_provider *pp; uint32_t size; + if (baseentry == NULL) { + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + basetable->gpt_last = MIN(pp->mediasize / pp->sectorsize, + UINT32_MAX) - 1; + return (0); + } size = gpp->gpp_size; if (mbr_align(basetable, NULL, &size) != 0) return (EINVAL); Modified: stable/10/sys/geom/part/g_part_pc98.c ============================================================================== --- stable/10/sys/geom/part/g_part_pc98.c Mon May 12 11:14:07 2014 (r265911) +++ stable/10/sys/geom/part/g_part_pc98.c Mon May 12 12:04:44 2014 (r265912) @@ -352,6 +352,12 @@ g_part_pc98_resize(struct g_part_table * struct g_provider *pp; uint32_t size; + if (baseentry == NULL) { + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + basetable->gpt_last = MIN(pp->mediasize / SECSIZE, + UINT32_MAX) - 1; + return (0); + } size = gpp->gpp_size; if (pc98_align(basetable, NULL, &size) != 0) return (EINVAL); Modified: stable/10/sys/geom/part/g_part_vtoc8.c ============================================================================== --- stable/10/sys/geom/part/g_part_vtoc8.c Mon May 12 11:14:07 2014 (r265911) +++ stable/10/sys/geom/part/g_part_vtoc8.c Mon May 12 12:04:44 2014 (r265912) @@ -317,6 +317,42 @@ g_part_vtoc8_modify(struct g_part_table } static int +vtoc8_set_rawsize(struct g_part_table *basetable, struct g_provider *pp) +{ + struct g_part_vtoc8_table *table; + struct g_part_entry *baseentry; + off_t msize; + uint32_t acyls, ncyls, pcyls; + + table = (struct g_part_vtoc8_table *)basetable; + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); + pcyls = msize / table->secpercyl; + if (pcyls > UINT16_MAX) + return (ERANGE); + acyls = be16dec(&table->vtoc.altcyls); + ncyls = pcyls - acyls; + msize = ncyls * table->secpercyl; + basetable->gpt_last = msize - 1; + + bzero(table->vtoc.ascii, sizeof(table->vtoc.ascii)); + sprintf(table->vtoc.ascii, "FreeBSD%lldM cyl %u alt %u hd %u sec %u", + (long long)(msize / 2048), ncyls, acyls, basetable->gpt_heads, + basetable->gpt_sectors); + be16enc(&table->vtoc.physcyls, pcyls); + be16enc(&table->vtoc.ncyls, ncyls); + be32enc(&table->vtoc.map[VTOC_RAW_PART].nblks, msize); + if (be32dec(&table->vtoc.sanity) == VTOC_SANITY) + be16enc(&table->vtoc.part[VTOC_RAW_PART].tag, VTOC_TAG_BACKUP); + LIST_FOREACH(baseentry, &basetable->gpt_entry, gpe_entry) { + if (baseentry->gpe_index == VTOC_RAW_PART + 1) { + baseentry->gpe_end = basetable->gpt_last; + return (0); + } + } + return (ENXIO); +} + +static int g_part_vtoc8_resize(struct g_part_table *basetable, struct g_part_entry *entry, struct g_part_parms *gpp) { @@ -324,6 +360,10 @@ g_part_vtoc8_resize(struct g_part_table struct g_provider *pp; uint64_t size; + if (entry == NULL) { + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + return (vtoc8_set_rawsize(basetable, pp)); + } table = (struct g_part_vtoc8_table *)basetable; size = gpp->gpp_size; if (vtoc8_align(table, NULL, &size) != 0) From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 15:52:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F324CE64; Mon, 12 May 2014 15:52: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 DD72623E6; Mon, 12 May 2014 15:52: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 s4CFqoCd009189; Mon, 12 May 2014 15:52:50 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CFqnbX009177; Mon, 12 May 2014 15:52:49 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201405121552.s4CFqnbX009177@svn.freebsd.org> From: David C Somayajulu Date: Mon, 12 May 2014 15:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265917 - in stable/10: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 15:52:51 -0000 Author: davidcs Date: Mon May 12 15:52:49 2014 New Revision: 265917 URL: http://svnweb.freebsd.org/changeset/base/265917 Log: MFC r265703 Modify Copyright information and other strings to reflect Qlogic Corporation's purchase of Broadcom's NetXtreme business. Added clean option to Makefile Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation Modified: stable/10/share/man/man4/bce.4 stable/10/share/man/man4/bxe.4 stable/10/sys/dev/bce/if_bce.c stable/10/sys/dev/bce/if_bcefw.h stable/10/sys/dev/bce/if_bcereg.h stable/10/sys/dev/bxe/bxe.c stable/10/sys/modules/bce/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/bce.4 ============================================================================== --- stable/10/share/man/man4/bce.4 Mon May 12 14:46:32 2014 (r265916) +++ stable/10/share/man/man4/bce.4 Mon May 12 15:52:49 2014 (r265917) @@ -1,5 +1,4 @@ -.\" Copyright (c) 2006 Broadcom Corporation -.\" David Christensen . All rights reserved. +.\" Copyright (c) 2006-2014 QLogic Corporation .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -10,9 +9,6 @@ .\" 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. Neither the name of Broadcom Corporation nor the name of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written consent. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -33,7 +29,7 @@ .Os .Sh NAME .Nm bce -.Nd "Broadcom NetXtreme II (BCM5706/5708/5709/5716) PCI/PCIe Gigabit Ethernet adapter driver" +.Nd "QLogic NetXtreme II (BCM5706/5708/5709/5716) PCI/PCIe Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -52,7 +48,7 @@ if_bce_load="YES" .Sh DESCRIPTION The .Nm -driver supports Broadcom's NetXtreme II product family, including the +driver supports QLogic's NetXtreme II product family, including the BCM5706, BCM5708, BCM5709 and BCM5716 Ethernet controllers. .Pp The NetXtreme II product family is composed of various Converged NIC (or CNIC) @@ -141,25 +137,25 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver provides support for various NICs based on the Broadcom NetXtreme II +driver provides support for various NICs based on the QLogic NetXtreme II family of Gigabit Ethernet controllers, including the following: .Pp .Bl -bullet -compact .It -Broadcom NetXtreme II BCM5706 1000Base-SX +QLogic NetXtreme II BCM5706 1000Base-SX .It -Broadcom NetXtreme II BCM5706 1000Base-T +QLogic NetXtreme II BCM5706 1000Base-T .It -Broadcom NetXtreme II BCM5708 1000Base-SX +QLogic NetXtreme II BCM5708 1000Base-SX .It -Broadcom NetXtreme II BCM5708 1000Base-T +QLogic NetXtreme II BCM5708 1000Base-T .It -Broadcom NetXtreme II BCM5709 1000Base-SX +QLogic NetXtreme II BCM5709 1000Base-SX .It -Broadcom NetXtreme II BCM5709 1000Base-T +QLogic NetXtreme II BCM5709 1000Base-T .It -Broadcom NetXtreme II BCM5716 1000Base-T +QLogic NetXtreme II BCM5716 1000Base-T .It Dell PowerEdge 1950 integrated BCM5708 NIC .It @@ -411,9 +407,11 @@ A controller hardware failure has occurr If the problem continues replace the controller. .El .Sh SUPPORT -For general information and support, -go to the Broadcom NIC Open Source Developer Resource Site: -.Pa http://www.broadcom.com/support/ethernet_nic/open_source.php . +For support questions please contact your QLogic approved reseller or +QLogic Technical Support at +.Pa http://support.qlogic.com , +or by E-mail at +.Aq support@qlogic.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , Modified: stable/10/share/man/man4/bxe.4 ============================================================================== --- stable/10/share/man/man4/bxe.4 Mon May 12 14:46:32 2014 (r265916) +++ stable/10/share/man/man4/bxe.4 Mon May 12 15:52:49 2014 (r265917) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2013 Broadcom Corporation. All rights reserved. +.\" Copyright (c) 2014 Qlogic Corporation. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -9,9 +9,6 @@ .\" 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. Neither the name of Broadcom Corporation nor the name of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written consent. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -32,7 +29,7 @@ .Os .Sh NAME .Nm bxe -.Nd Broadcom NetXtreme II Ethernet 10Gb PCIe adapter driver +.Nd QLogic NetXtreme II Ethernet 10Gb PCIe adapter driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,7 +47,7 @@ if_bxe_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for PCIe 10Gb Ethernet adapters based on the Broadcom +driver provides support for PCIe 10Gb Ethernet adapters based on the QLogic NetXtreme II family of 10Gb chips. The driver supports Jumbo Frames, VLAN tagging, checksum offload (IPv4, TCP, UDP, IPv6-TCP, IPv6-UDP), MSI-X @@ -59,32 +56,32 @@ Receive Side Scaling (RSS). .Sh HARDWARE The .Nm -driver provides support for various NICs based on the Broadcom NetXtreme II +driver provides support for various NICs based on the QLogic NetXtreme II family of 10Gb Ethernet controller chips, including the following: .Pp .Bl -bullet -compact .It -Broadcom NetXtreme II BCM57710 10Gb +QLogic NetXtreme II BCM57710 10Gb .It -Broadcom NetXtreme II BCM57711 10Gb +QLogic NetXtreme II BCM57711 10Gb .It -Broadcom NetXtreme II BCM57711E 10Gb +QLogic NetXtreme II BCM57711E 10Gb .It -Broadcom NetXtreme II BCM57712 10Gb +QLogic NetXtreme II BCM57712 10Gb .It -Broadcom NetXtreme II BCM57712-MF 10Gb +QLogic NetXtreme II BCM57712-MF 10Gb .It -Broadcom NetXtreme II BCM57800 10Gb +QLogic NetXtreme II BCM57800 10Gb .It -Broadcom NetXtreme II BCM57800-MF 10Gb +QLogic NetXtreme II BCM57800-MF 10Gb .It -Broadcom NetXtreme II BCM57810 10Gb +QLogic NetXtreme II BCM57810 10Gb .It -Broadcom NetXtreme II BCM57810-MF 10Gb +QLogic NetXtreme II BCM57810-MF 10Gb .It -Broadcom NetXtreme II BCM57840 10Gb / 20Gb +QLogic NetXtreme II BCM57840 10Gb / 20Gb .It -Broadcom NetXtreme II BCM57840-MF 10Gb +QLogic NetXtreme II BCM57840-MF 10Gb .El .Sh CONFIGURATION There a number of configuration parameters that can be set to tweak the @@ -318,6 +315,12 @@ When finished turn the logging back off: .Bd -literal -offset indent # sysctl dev.bxe.0.debug=0 .Ed +.Sh SUPPORT +For support questions please contact your QLogic approved reseller or +QLogic Technical Support at +.Pa http://support.qlogic.com , +or by E-mail at +.Aq support@qlogic.com . .Sh SEE ALSO .Xr netstat 1 , .Xr altq 4 , Modified: stable/10/sys/dev/bce/if_bce.c ============================================================================== --- stable/10/sys/dev/bce/if_bce.c Mon May 12 14:46:32 2014 (r265916) +++ stable/10/sys/dev/bce/if_bce.c Mon May 12 15:52:49 2014 (r265917) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2006-2010 Broadcom Corporation - * David Christensen . All rights reserved. + * Copyright (c) 2006-2014 QLogic Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,9 +10,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -106,13 +102,13 @@ static const struct bce_type bce_devs[] { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x1709, "HP NC371i Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5706 1000Base-T" }, + "QLogic NetXtreme II BCM5706 1000Base-T" }, /* BCM5706S controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5706S, HP_VENDORID, 0x3102, "HP NC370F Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706S, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5706 1000Base-SX" }, + "QLogic NetXtreme II BCM5706 1000Base-SX" }, /* BCM5708C controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7037, @@ -122,7 +118,7 @@ static const struct bce_type bce_devs[] { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7045, "HP NC374m PCIe Multifunction Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5708 1000Base-T" }, + "QLogic NetXtreme II BCM5708 1000Base-T" }, /* BCM5708S controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x1706, @@ -132,7 +128,7 @@ static const struct bce_type bce_devs[] { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703d, "HP NC373F PCIe Multifunc Giga Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5708 1000Base-SX" }, + "QLogic NetXtreme II BCM5708 1000Base-SX" }, /* BCM5709C controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7055, @@ -140,7 +136,7 @@ static const struct bce_type bce_devs[] { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7059, "HP NC382T PCIe DP Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5709 1000Base-T" }, + "QLogic NetXtreme II BCM5709 1000Base-T" }, /* BCM5709S controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x171d, @@ -148,11 +144,11 @@ static const struct bce_type bce_devs[] { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x7056, "HP NC382i DP Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5709 1000Base-SX" }, + "QLogic NetXtreme II BCM5709 1000Base-SX" }, /* BCM5716 controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5716, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5716 1000Base-T" }, + "QLogic NetXtreme II BCM5716 1000Base-T" }, { 0, 0, 0, 0, NULL } }; Modified: stable/10/sys/dev/bce/if_bcefw.h ============================================================================== --- stable/10/sys/dev/bce/if_bcefw.h Mon May 12 14:46:32 2014 (r265916) +++ stable/10/sys/dev/bce/if_bcefw.h Mon May 12 15:52:49 2014 (r265917) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2006-2011 Broadcom Corporation - * David Christensen . All rights reserved. + * Copyright (c) 2006-2014 QLogic Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,9 +9,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -31,7 +27,7 @@ /* * This file contains firmware data derived from proprietary unpublished - * source code, Copyright (c) 2004-2011 Broadcom Corporation. + * source code, Copyright (c) 2004-2014 QLogic Corporation. * * Permission is hereby granted for the distribution of this firmware data * in hexadecimal or equivalent format, provided this copyright notice also Modified: stable/10/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/10/sys/dev/bce/if_bcereg.h Mon May 12 14:46:32 2014 (r265916) +++ stable/10/sys/dev/bce/if_bcereg.h Mon May 12 15:52:49 2014 (r265917) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2006-2010 Broadcom Corporation - * David Christensen . All rights reserved. + * Copyright (c) 2006-2014 QLogic Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,9 +9,6 @@ * 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. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Mon May 12 14:46:32 2014 (r265916) +++ stable/10/sys/dev/bxe/bxe.c Mon May 12 15:52:49 2014 (r265917) @@ -98,126 +98,126 @@ static struct bxe_device_type bxe_devs[] BRCM_VENDORID, CHIP_NUM_57710, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57710 10GbE" + "QLogic NetXtreme II BCM57710 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57711, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57711 10GbE" + "QLogic NetXtreme II BCM57711 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57711E, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57711E 10GbE" + "QLogic NetXtreme II BCM57711E 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57712, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57712 10GbE" + "QLogic NetXtreme II BCM57712 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57712_MF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57712 MF 10GbE" + "QLogic NetXtreme II BCM57712 MF 10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57712_VF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57712 VF 10GbE" + "QLogic NetXtreme II BCM57712 VF 10GbE" }, #endif { BRCM_VENDORID, CHIP_NUM_57800, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57800 10GbE" + "QLogic NetXtreme II BCM57800 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57800_MF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57800 MF 10GbE" + "QLogic NetXtreme II BCM57800 MF 10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57800_VF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57800 VF 10GbE" + "QLogic NetXtreme II BCM57800 VF 10GbE" }, #endif { BRCM_VENDORID, CHIP_NUM_57810, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57810 10GbE" + "QLogic NetXtreme II BCM57810 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57810_MF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57810 MF 10GbE" + "QLogic NetXtreme II BCM57810 MF 10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57810_VF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57810 VF 10GbE" + "QLogic NetXtreme II BCM57810 VF 10GbE" }, #endif { BRCM_VENDORID, CHIP_NUM_57811, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57811 10GbE" + "QLogic NetXtreme II BCM57811 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57811_MF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57811 MF 10GbE" + "QLogic NetXtreme II BCM57811 MF 10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57811_VF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57811 VF 10GbE" + "QLogic NetXtreme II BCM57811 VF 10GbE" }, #endif { BRCM_VENDORID, CHIP_NUM_57840_4_10, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57840 4x10GbE" + "QLogic NetXtreme II BCM57840 4x10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57840_2_20, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57840 2x20GbE" + "QLogic NetXtreme II BCM57840 2x20GbE" }, #endif { BRCM_VENDORID, CHIP_NUM_57840_MF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57840 MF 10GbE" + "QLogic NetXtreme II BCM57840 MF 10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57840_VF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57840 VF 10GbE" + "QLogic NetXtreme II BCM57840 VF 10GbE" }, #endif { Modified: stable/10/sys/modules/bce/Makefile ============================================================================== --- stable/10/sys/modules/bce/Makefile Mon May 12 14:46:32 2014 (r265916) +++ stable/10/sys/modules/bce/Makefile Mon May 12 15:52:49 2014 (r265917) @@ -5,4 +5,9 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii #CFLAGS += -DBCE_DEBUG=0 +clean: + rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms + rm -f *.o *.kld *.ko + rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h + .include From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 16:04:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CD8CFA5A for ; Mon, 12 May 2014 16:04:43 +0000 (UTC) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.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 E497224FA for ; Mon, 12 May 2014 16:04:42 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id pn19so2056027lab.6 for ; Mon, 12 May 2014 09:04:34 -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=ePyOGXwqk2Sg6GOVBv6nvLadOso/nzhd7O4Wvl0deP4=; b=j7lN6G3p/H8lwn9PrOFUV6kWo/QBO0oJmuyLjF30H1lEreiZGjL13A2bZjis+CSwu1 2pIAPuPIwRHeXEk7dEpXCQhuRRoQahwxsZq1yzV8NokUuRtN1iswYQrPJFg07cvPV9WK V1aKbxUtIZRYUoy5xBxVzAnelt4aYtldHQv+vxps+xinEgQt1kx4echbwr9t7OXILMI1 AuF7mSeylZuumAtQx6KlfCeG4rf8R1nolmMbIHjRAAtUWoMWFbxD1qoA1btRe3KonHqE 4gq30hoMkfOWCV4cFdLsBKsqfMR9rjE4o0RFIAlurM/DI9Jrac6IpcjUrvy0nEtfsMMP Mufw== X-Gm-Message-State: ALoCoQk/EjoVi5c3SpHrBIyzCWf7LxYU1yHOQ/Aq1wmbUFXeIppOZ8X/l+DCQ05jSkk5MUZWtzJU X-Received: by 10.152.242.164 with SMTP id wr4mr2648861lac.38.1399910674390; Mon, 12 May 2014 09:04:34 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id dl4sm14239640lbc.4.2014.05.12.09.04.33 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 09:04:33 -0700 (PDT) Message-ID: <5370F110.5050502@freebsd.org> Date: Mon, 12 May 2014 20:04:32 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Don Lewis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r265901 - stable/10/sys/kern References: <201405120427.s4C4RAZf093033@svn.freebsd.org> In-Reply-To: <201405120427.s4C4RAZf093033@svn.freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 16:04:44 -0000 On 12.05.2014 8:27, Don Lewis wrote: > + if (start + amask < start) { > + DPRINTF(("start+amask wrapped around\n")); > + goto out; > + } Checking for overflow _after_ it happens is unportable and dangerous, since wrapping around is not only one possible result. They should be rewritten like that: if (start > ULONG_MAX - amask) -- http://ache.vniz.net/ From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 16:18:59 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC6593E3; Mon, 12 May 2014 16:18:48 +0000 (UTC) Date: Mon, 12 May 2014 12:18:17 -0400 From: Glen Barber To: David C Somayajulu Subject: Re: svn commit: r265917 - in stable/10: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce Message-ID: <20140512161817.GK1258@hub.FreeBSD.org> References: <201405121552.s4CFqnbX009177@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8tUgZ4IE8L4vmMyh" Content-Disposition: inline In-Reply-To: <201405121552.s4CFqnbX009177@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 16:18:59 -0000 --8tUgZ4IE8L4vmMyh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 12, 2014 at 03:52:49PM +0000, David C Somayajulu wrote: > Author: davidcs > Date: Mon May 12 15:52:49 2014 > New Revision: 265917 > URL: http://svnweb.freebsd.org/changeset/base/265917 >=20 > Log: > MFC r265703 > Modify Copyright information and other strings to reflect > Qlogic Corporation's purchase of Broadcom's NetXtreme business. > Added clean option to Makefile > =20 > Modified: stable/10/sys/modules/bce/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 > --- stable/10/sys/modules/bce/Makefile Mon May 12 14:46:32 2014 (r265916) > +++ stable/10/sys/modules/bce/Makefile Mon May 12 15:52:49 2014 (r265917) > @@ -5,4 +5,9 @@ SRCS=3D opt_bce.h if_bce.c miibus_if.h mii > =20 > #CFLAGS +=3D -DBCE_DEBUG=3D0 > =20 > +clean: > + rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms > + rm -f *.o *.kld *.ko > + rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h > + > .include Shouldn't these be listed in CLEANFILES ? Glen --8tUgZ4IE8L4vmMyh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTcPRJAAoJELls3eqvi17Q6dkP/Rj30T8A5Lo2rrxNyutmYmcw Gfs2WWMonnl/vcbsXwqLQzf3dlKSshPqCkZJvFNjI+qOWKDJhzGAefr1lihP7OYQ lg1qBjpah1zNKBBk6SjII/2Gx3hnHVl5apZs3Nstj0otk8idpXR1egUw5JIoLg9X kP9l5F6MtQoLXvtq0Hc210BL7vz1VRMafdZ3BJhByvZjHZH3DOY+5QO00eEMgE81 0BoqtScSMc3r21hNHw0qdeIyh1mflSrfC/6qkUjWhIYYPiFdHZkXnG1oZDIVPxsf P/LcYnP4BgieAxVqHMpDK4XSVXGpvfiucTBurF7zgaqPNdyKimTaic4Q6WpVvaLK k7RfdZdOigJyKWIrTEg+RuyhQ/1Mjpx1zmJfKy7+o9Yk1+2rozJIlo+/cy1XXXc8 VeBSoecjLQxO9/KCmenuMHynKh1oXLI5iAtdtEk3lD0gh478+ho+RZ24eD7aP1M2 8QtsKzrrRjlJJBA1ZxwqO9FEOGjgN5i5XqZuv/j3fI38eMVblxea/iJYyHE5iTfV g2rEaA9wqoyLAN7wx9BPT1YzfTDsm67Fztvs16fIR1jEeHKndymMeGc/sxSAbijx 3KbU1CyYayAu8XQmM5WTTPHvhQKC7ozQBrEiek9YY80jqEkESb/ClQRMNTLD3nih WRjYQiwlMsqFbwfhWIQx =/OEE -----END PGP SIGNATURE----- --8tUgZ4IE8L4vmMyh-- From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 17:03:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 19071EC3; Mon, 12 May 2014 17:03:27 +0000 (UTC) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D04882ABE; Mon, 12 May 2014 17:03:26 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 1726C3592DF; Mon, 12 May 2014 19:03:23 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 048B428497; Mon, 12 May 2014 19:03:23 +0200 (CEST) Date: Mon, 12 May 2014 19:03:22 +0200 From: Jilles Tjoelker To: Andrey Chernov Subject: Re: svn commit: r265901 - stable/10/sys/kern Message-ID: <20140512170322.GA2479@stack.nl> References: <201405120427.s4C4RAZf093033@svn.freebsd.org> <5370F110.5050502@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5370F110.5050502@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, Don Lewis , src-committers@freebsd.org, svn-src-stable-10@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 17:03:27 -0000 On Mon, May 12, 2014 at 08:04:32PM +0400, Andrey Chernov wrote: > On 12.05.2014 8:27, Don Lewis wrote: > > + if (start + amask < start) { > > + DPRINTF(("start+amask wrapped around\n")); > > + goto out; > > + } > Checking for overflow _after_ it happens is unportable and dangerous, > since wrapping around is not only one possible result. They should be > rewritten like that: > if (start > ULONG_MAX - amask) Unsigned types wrap around per the C standard. Overflow checking after it happens is fine. You are right for signed types. -- Jilles Tjoelker From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 17:43:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7D41C81E for ; Mon, 12 May 2014 17:43:01 +0000 (UTC) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) (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 F3AA12DFC for ; Mon, 12 May 2014 17:43:00 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id mc6so2167700lab.7 for ; Mon, 12 May 2014 10:42:52 -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 :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=AxH1wgr5tF2mVXLpDtIpVLIdFyS/TR62B5ZCWse1kFw=; b=LC3VacIWKcbCoxXXYvWRVzcYIVVNzv7yDl7TOdnB9wzeQ5/WPvFe+CEBnrPgjxC1nU Pxmp/6Ru18VhuJHvi/wXuN2vNEOoeIay5d7K7IXBv/1g4qU3BQ5WtRKXtZdJjP135KXU O/kv8svCOForODPW1+tmpmy3CVS/JaK4rJlTh5rP5YDESDMavUKBwXKfa7SFmap3iwFB BalOEfxK1gK7IMeNN/Prht7E3hEx+hFxsM31VQsb0o6+nTCTeZz9y/09xZs08n0lft7F ID/YW3t2ArCxdiHx3RSo1PKeGU8rrr3AruiFtyGEjR7jHvECcmjB0rXabgw9+PLW7Fnw JYDw== X-Gm-Message-State: ALoCoQn+qCNeZ3ZXOffbxnbf02q0H8OhASZgXPcxfvQekODor2cqvbIUMA9ShnNZCLN5hOFVlsbj X-Received: by 10.112.189.138 with SMTP id gi10mr14465714lbc.15.1399916572813; Mon, 12 May 2014 10:42:52 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id ob4sm14424792lbc.30.2014.05.12.10.42.51 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 10:42:51 -0700 (PDT) Message-ID: <5371081A.2070703@freebsd.org> Date: Mon, 12 May 2014 21:42:50 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Jilles Tjoelker Subject: Re: svn commit: r265901 - stable/10/sys/kern References: <201405120427.s4C4RAZf093033@svn.freebsd.org> <5370F110.5050502@freebsd.org> <20140512170322.GA2479@stack.nl> In-Reply-To: <20140512170322.GA2479@stack.nl> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, Don Lewis , src-committers@freebsd.org, svn-src-stable-10@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 17:43:01 -0000 On 12.05.2014 21:03, Jilles Tjoelker wrote: > On Mon, May 12, 2014 at 08:04:32PM +0400, Andrey Chernov wrote: >> On 12.05.2014 8:27, Don Lewis wrote: >>> + if (start + amask < start) { >>> + DPRINTF(("start+amask wrapped around\n")); >>> + goto out; >>> + } > >> Checking for overflow _after_ it happens is unportable and dangerous, >> since wrapping around is not only one possible result. They should be >> rewritten like that: > >> if (start > ULONG_MAX - amask) > > Unsigned types wrap around per the C standard. Overflow checking after > it happens is fine. > > You are right for signed types. > You are right. The C Standard, 6.2.5, paragraph 9 [ISO/IEC 9899:2011], states: "A computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type." I was initially confused by "integer overflow" phrase in the commit's comment, mechanically producing example above which supposed to be for signed types. -- http://ache.vniz.net/ From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 17:55:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 127A9FDA; Mon, 12 May 2014 17:55: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 D6ECF2EF2; Mon, 12 May 2014 17: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 s4CHtPEe070008; Mon, 12 May 2014 17:55:25 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CHtPmL070003; Mon, 12 May 2014 17:55:25 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201405121755.s4CHtPmL070003@svn.freebsd.org> From: Doug Ambrisko Date: Mon, 12 May 2014 17:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265922 - in stable/10: share/man/man4 sys/conf sys/dev/mrsas sys/modules sys/modules/mrsas X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 17:55:26 -0000 Author: ambrisko Date: Mon May 12 17:55:24 2014 New Revision: 265922 URL: http://svnweb.freebsd.org/changeset/base/265922 Log: MFC 265555 dd mrsas(4) driver from LSI official support of newer MegaRAID SAS cards. LSI has been maintaining this driver outside of the FreeBSD tree. It overlaps support of ThunderBolt and Invader cards that mfi(4) supports. By default mfi(4) will attach to cards. If the tunable: hw.mfi.mrsas_enable=1 is set then mfi(4) will not probe and attach to these newer cards and allow mrsas(4) to attach. So by default this driver will not effect a FreeBSD system unless mfi(4) is removed from the kernel or the tunable is enabled. mrsas(4) attaches disks to the CAM layer so it depends on CAM and devices show up as /dev/daX. mfiutil(8) does not work with mrsas. The FreeBSD version of MegaCli and StorCli from LSI do work with mrsas. It appears that StorCli only works with mrsas. MegaCli appears to work with mfi(4) and mrsas(4). It would be good to add mfiutil(4) support to mrsas, emulations modes, kernel logging, device aliases to ease the transition between mfi(4) and mrsas(4). Style issues should be resolved by LSI when they get committers approved. The plan is get this driver in FreeBSD 9.3 to improve HW support. Thanks to LSI for developing, testing and working with FreeBSD to make this driver co-exist in FreeBSD. This improves the overall support of MegaRAID SAS. Submitted by: Kashyap Desai Sponsored by: LSI Added: stable/10/share/man/man4/mrsas.4 - copied unchanged from r265555, head/share/man/man4/mrsas.4 stable/10/sys/dev/mrsas/ - copied from r265555, head/sys/dev/mrsas/ stable/10/sys/modules/mrsas/ - copied from r265555, head/sys/modules/mrsas/ Modified: stable/10/share/man/man4/Makefile stable/10/sys/conf/files stable/10/sys/modules/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Mon May 12 17:44:23 2014 (r265921) +++ stable/10/share/man/man4/Makefile Mon May 12 17:55:24 2014 (r265922) @@ -262,6 +262,7 @@ MAN= aac.4 \ mpr.4 \ mps.4 \ mpt.4 \ + mrsas.4 \ msk.4 \ mtio.4 \ multicast.4 \ Copied: stable/10/share/man/man4/mrsas.4 (from r265555, head/share/man/man4/mrsas.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/mrsas.4 Mon May 12 17:55:24 2014 (r265922, copy of r265555, head/share/man/man4/mrsas.4) @@ -0,0 +1,374 @@ +.\" Copyright (c) 2014 LSI Corp +.\" All rights reserved. +.\" Author: Kashyap Desai +.\" Support: freebsdraid@lsi.com +.\" +.\" 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. Neither the name of the nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +.\" COPYRIGHT HOLDER 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. + +.\" The views and conclusions contained in the software and documentation +.\" are those of the authors and should not be interpreted as representing +.\" official policies,either expressed or implied, of the FreeBSD Project +.\" +.\" $FreeBSD$ +.\" + + +.Dd Apr 12, 2013 +.Dt MRSAS 4 +.Os +.Sh NAME +.Nm mrsas +.Nd "LSI MegaRAID 6Gb/s and 12Gb/s SAS+SATA Raid controller driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pci" +.Cd "device mrsas" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mrsas_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver will detect LSI's next generation (6Gb/s and 12Gb/s) PCI Express +SAS/SATA RAID controllers. +See the +.Nm HARDWARE +section for the supported devices list. +A disk (virtual disk/physical disk) attached to the +.Nm +driver will be visible to the user through +.Xr camcontrol 8 as +.Pa /dev/da? +device nodes. +A simple management interface is also provided on a per-controller basis via the +.Pa /dev/mrsas? +device node. +.Pp +The +.Nm +name is derived from the phrase "MegaRAID SAS HBA", which is +substantially different than the old "MegaRAID" Driver +.Xr mfi 4 +which does not connect targets +to the +.Xr cam 4 +layer and thus requires a new driver which attaches targets to the +.Xr cam 4 +layer. Older MegaRAID controllers are supported by +.Xr mfi 4 +and will not work with +.Nm , +but both the +.Xr mfi 4 +and +.Nm +drivers can detect and manage the LSI MegaRAID SAS 2208/2308/3008/3108 series of +controllers. +.Pp +The +.Nm device.hints +option is provided to tune the +.Nm +driver's behavior for LSI MegaRAID SAS 2208/2308/3008/3108 controllers. +By default, the +.Xr mfi 4 +driver will detect these controllers. See the +.Nm PRIORITY +section to know more about driver priority for MR-Fusion devices. +.Pp +.Nm +will provide a priority of (-30) (between BUS_PROBE_DEFAULT and +BUS_PROBE_LOW_PRIORITY) at probe call for device id's 0x005B, 0x005D, and +0x005F so that +.Nm +does not take control of these devices without user intervention. +.Sh HARDWARE +The +.Nm +driver supports the following hardware: +.Pp +.Bl -bullet -compact +[ Thunderbolt 6Gbp/s MR controller ] +.It +LSI MegaRAID SAS 9265 +.It +LSI MegaRAID SAS 9266 +.It +LSI MegaRAID SAS 9267 +.It +LSI MegaRAID SAS 9270 +.It +LSI MegaRAID SAS 9271 +.It +LSI MegaRAID SAS 9272 +.It +LSI MegaRAID SAS 9285 +.It +LSI MegaRAID SAS 9286 +.It +DELL PERC H810 +.It +DELL PERC H710/P +.El +.Pp +.Bl -bullet -compact +[ Invader/Fury 12Gpb/s MR controller ] +.It +LSI MegaRAID SAS 9380 +.It +LSI MegaRAID SAS 9361 +.It +LSI MegaRAID SAS 9341 +.It +DELL PERC H830 +.It +DELL PERC H730/P +.It +DELL PERC H330 +.El +.Sh CONFIGURATION +To disable Online Controller Reset(OCR) for a specific +.Nm +driver instance, set the +following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mrsas.X.disable_ocr=1 +.Ed +.Pp +where X is the adapter number. +.Pp +To change the IO timeout value for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mrsas.X.mrsas_io_timeout=NNNNNN +.Ed +.Pp +where NNNNNN is the timeout value in milli-seconds. +.Pp +To change the firmware fault check timer value for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mrsas.X.mrsas_fw_fault_check_delay=NN +.Ed +.Pp +where NN is the fault check delay value in seconds. +.Pp +The current number of active I/O commands is shown in the +dev.mrsas.X.fw_outstanding +.Xr sysctl 8 +variable. +.Sh DEBUGGING +To enable debugging prints from the +.Nm +driver, set the +.Bd -literal -offset indent +hw.mrsas.X.debug_level +.Ed +.Pp +variable, where X is the adapter number, either in +.Xr loader.conf 5 +or via +.Xr sysctl 8 . +The following bits have the described effects: +.Bl -tag -offset indent +.It 0x01 +Enable informational prints. +.It 0x02 +Enable tracing prints. +.It 0x04 +Enable prints for driver faults. +.It 0x08 +Enable prints for OCR and IO timeout. +.It 0x10 +Enable prints for AEN events. +.El +.Sh PRIORITY +The +.Nm +driver will always set a default (-30) priority in the pci subsystem for +selection of MR-Fusion cards. (It is between BUS_PROBE_DEFAULT and +BUS_PROBE_LOW_PRIORITY). MR-Fusion Controllers include all cards with the +Device IDs - +0x005B, +0x005D, +0x005F. +.Pp +The +.Xr mfi 4 +driver will set a priority of either BUS_PROBE_DEFAULT or +BUS_PROBE_LOW_PRIORITY (depending on the device.hint setting) in the pci +subsystem for selection of MR-Fusion cards. With the above design in place, the +.Xr mfi 4 +driver will attach to a MR-Fusion card given that it has a higher priority than +.Nm . +.Pp +Using /boot/device.hints (as mentioned below), the user can provide a preference +for the +.Nm +driver to detect a MR-Fusion card instead of the +.Xr mfi 4 +driver. +.Bd -ragged -offset indent +.Cd hw.mfi.mrsas_enable="1" +.Ed +.Pp +At boot time, the +.Xr mfi 4 +driver will get priority to detect MR-Fusion controllers by default. Before +changing this default driver selection policy, LSI advises users to understand +how the driver selection policy works. LSI's policy is to provide priority to +the +.Xr mfi 4 +driver to detect MR-Fusion cards, but allow for the ability to choose the +.Nm +driver to detect MR-Fusion cards. +.Pp +LSI recommends setting hw.mfi.mrsas_enable="0" for customers who are using the +older +.Xr mfi 4 +driver and do not want to switch to +.Nm . +For those customers who are using a MR-Fusion controller for the first time, LSI +recommends using the +.Nm +driver and setting hw.mfi.mrsas_enable="1". +.Pp +Changing the default behavior is well tested under most conditions, but +unexpected behavior may pop up if more complex and unrealistic operations are +executed by switching between the +.Xr mfi 4 and +.Nm +drivers for MR-Fusion. +Switching drivers is designed to happen only one time. Although multiple +switching is possible, it is not recommended. The user should decide from +.Nm Start of Day +which driver they want to use for the MR-Fusion card. +.Pp +The user may see different device names when switching from +.Xr mfi 4 +to +.Nm . +This behavior is +.Nm Functions As Designed +and the user needs to change the fstab +entry manually if they are doing any experiments with +.Xr mfi 4 +and +.Nm +interoperability. +.Sh FILES +.Bl -tag -width ".Pa /dev/mrsas?" -compact +.It /dev/da? +array/logical disk interface +.It /dev/mrsas? +management interface +.El +.Sh SEE ALSO +.Xr pci 4 , +.Xr mfi 4 , +.Xr cam 4 , +.Xr device.hints 5 , +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Bd -ragged +.Cd "mfi Driver:" +.Xr mfi 4 +is the old FreeBSD driver which started with support for Gen-1 Controllers and +was extended to support up to MR-Fusion (Device ID = 0x005B, 0x005D, 0x005F). +.Ed +.Bd -ragged +.Cd "mrsas Driver:" +.Nm +is the new driver reworked by LSI which supports Thunderbolt and onward +products. The SAS+SATA RAID controller with device id 0x005b is referred to as +the Thunderbolt controller throughout in this man page. +.Ed +.Bd -ragged +.Nm cam aware HBA drivers: +FreeBSD has a +.Xr cam 4 +layer which attaches storage devices and provides a common access mechanism to +storage controllers and attached devices. The +.Nm +driver is +.Xr cam 4 aware and devices associated with +.Nm +can be seen using +.Xr camcontrol 8 . +The +.Xr mfi 4 +driver does not understand the +.Xr cam 4 +layer and it directly associates storage disks to the block layer. +.Pp +.Nm Thunderbolt Controller: +This is the 6Gb/s MegaRAID HBA card which has device id 0x005B. +.Pp +.Nm Invader Controller: +This is 12Gb/s MegaRAID HBA card which has device id 0x005D. +.Pp +.Nm Fury Controller: +This is the 12Gb/s MegaRAID HBA card which has device id 0x005F. +.Ed +.Sh AUTHORS +The +.Nm +driver and this manual page were written by +.An Kashyap Desai Aq Kashyap.Desai@lsi.com . +.Sh TODO +The driver does not support big-endian architectures at this time. +.Pp +The driver does not support alias for device name (it is required when the user +switches between two drivers and does not want to edit /etc/fstab manually). +.Pp +The +.Nm +driver exposes devices as /dev/da?, whereas +.Xr mfi 4 +exposes deivces as /dev/mfid? +.Pp +.Nm +does not support the Linux Emulator interface. +.Pp +.Nm +will not work with +.Xr mfiutil 8 Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon May 12 17:44:23 2014 (r265921) +++ stable/10/sys/conf/files Mon May 12 17:55:24 2014 (r265922) @@ -1868,6 +1868,10 @@ dev/mpt/mpt_debug.c optional mpt dev/mpt/mpt_pci.c optional mpt pci dev/mpt/mpt_raid.c optional mpt dev/mpt/mpt_user.c optional mpt +dev/mrsas/mrsas.c optional mrsas +dev/mrsas/mrsas_cam.c optional mrsas +dev/mrsas/mrsas_ioctl.c optional mrsas +dev/mrsas/mrsas_fp.c optional mrsas dev/msk/if_msk.c optional msk dev/mvs/mvs.c optional mvs dev/mvs/mvs_if.m optional mvs Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Mon May 12 17:44:23 2014 (r265921) +++ stable/10/sys/modules/Makefile Mon May 12 17:55:24 2014 (r265922) @@ -220,6 +220,7 @@ SUBDIR= \ mps \ mpt \ mqueue \ + mrsas \ msdosfs \ msdosfs_iconv \ ${_mse} \ From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 19:42:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 66702C49; Mon, 12 May 2014 19:42: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 38D0D27EC; Mon, 12 May 2014 19:42: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 s4CJgH9W018638; Mon, 12 May 2014 19:42:17 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CJgGQE018636; Mon, 12 May 2014 19:42:16 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201405121942.s4CJgGQE018636@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 12 May 2014 19:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265928 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 19:42:17 -0000 Author: pluknet Date: Mon May 12 19:42:16 2014 New Revision: 265928 URL: http://svnweb.freebsd.org/changeset/base/265928 Log: MFC r265285,265320: Documented the pget(9) system kernel interface. Added: stable/10/share/man/man9/pget.9 - copied, changed from r265285, head/share/man/man9/pget.9 Modified: stable/10/share/man/man9/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Mon May 12 19:29:38 2014 (r265927) +++ stable/10/share/man/man9/Makefile Mon May 12 19:42:16 2014 (r265928) @@ -191,6 +191,7 @@ MAN= accept_filter.9 \ pci.9 \ pfil.9 \ pfind.9 \ + pget.9 \ pgfind.9 \ physio.9 \ pmap.9 \ Copied and modified: stable/10/share/man/man9/pget.9 (from r265285, head/share/man/man9/pget.9) ============================================================================== --- head/share/man/man9/pget.9 Sat May 3 18:50:47 2014 (r265285, copy source) +++ stable/10/share/man/man9/pget.9 Mon May 12 19:42:16 2014 (r265928) @@ -46,13 +46,13 @@ and fills a pointer to the structure in .Fa *pp . In the latter case, a process owning the specified thread is looked for. -The actual operation is performed by invoking the +The operation is performed by invoking the .Xr pfind 9 function. The found process is returned locked. -Only for +For the .Dv PGET_HOLD -case it is returned unlocked (but held). +case, it is returned unlocked (but held). The .Fn pget function can @@ -65,7 +65,7 @@ The argument is the logical OR of some subset of: .Bl -tag -width ".Dv PGET_NOTINEXEC" .It Dv PGET_HOLD -If set, the found process will be referenced and unlocked. +If set, the found process will be held and unlocked. .It Dv PGET_CANSEE If set, the found process will be checked for its visibility. See @@ -93,6 +93,8 @@ If set, is not assumed as a thread id for values larger than .Dv PID_MAX . .It Dv PGET_WANTREAD +If set, the found process will be checked that the caller may get +a read access to its structure. A shorthand for .Pq Dv PGET_HOLD | PGET_CANDEBUG | PGET_NOTWEXIT . .El From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 20:48:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A39AEA35; Mon, 12 May 2014 20:48: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 75C5B2E63; Mon, 12 May 2014 20:48: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 s4CKm5vJ046619; Mon, 12 May 2014 20:48:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CKm592046618; Mon, 12 May 2014 20:48:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405122048.s4CKm592046618@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 12 May 2014 20:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265932 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 20:48:05 -0000 Author: des Date: Mon May 12 20:48:04 2014 New Revision: 265932 URL: http://svnweb.freebsd.org/changeset/base/265932 Log: MFH (r264966): add sysctl OIDs for actual swap zone size and capacity Modified: stable/10/sys/vm/swap_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/swap_pager.c ============================================================================== --- stable/10/sys/vm/swap_pager.c Mon May 12 20:22:42 2014 (r265931) +++ stable/10/sys/vm/swap_pager.c Mon May 12 20:48:04 2014 (r265932) @@ -164,6 +164,12 @@ static int overcommit = 0; SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0, "Configure virtual memory overcommit behavior. See tuning(7) " "for details."); +static unsigned long swzone; +SYSCTL_ULONG(_vm, OID_AUTO, swzone, CTLFLAG_RD, &swzone, 0, + "Actual size of swap metadata zone"); +static unsigned long swap_maxpages; +SYSCTL_ULONG(_vm, OID_AUTO, swap_maxpages, CTLFLAG_RD, &swap_maxpages, 0, + "Maximum amount of swap supported"); /* bits from overcommit */ #define SWAP_RESERVE_FORCE_ON (1 << 0) @@ -506,7 +512,7 @@ swap_pager_init(void) void swap_pager_swap_init(void) { - int n, n2; + unsigned long n, n2; /* * Number of in-transit swap bp operations. Don't @@ -542,7 +548,7 @@ swap_pager_swap_init(void) /* * Initialize our zone. Right now I'm just guessing on the number * we need based on the number of pages in the system. Each swblock - * can hold 16 pages, so this is probably overkill. This reservation + * can hold 32 pages, so this is probably overkill. This reservation * is typically limited to around 32MB by default. */ n = cnt.v_page_count / 2; @@ -563,7 +569,9 @@ swap_pager_swap_init(void) n -= ((n + 2) / 3); } while (n > 0); if (n2 != n) - printf("Swap zone entries reduced from %d to %d.\n", n2, n); + printf("Swap zone entries reduced from %lu to %lu.\n", n2, n); + swap_maxpages = n * SWAP_META_PAGES; + swzone = n * sizeof(struct swblock); n2 = n; /* From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 21:22:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1608A762; Mon, 12 May 2014 21:22: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 DE861229D; Mon, 12 May 2014 21:22: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 s4CLMr6Z064084; Mon, 12 May 2014 21:22:53 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CLMrQB064083; Mon, 12 May 2014 21:22:53 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405122122.s4CLMrQB064083@svn.freebsd.org> From: Ian Lepore Date: Mon, 12 May 2014 21:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265934 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 21:22:54 -0000 Author: ian Date: Mon May 12 21:22:53 2014 New Revision: 265934 URL: http://svnweb.freebsd.org/changeset/base/265934 Log: MFC r264822: Allow .WAIT to appear in SUBDIR= lists Modified: stable/10/share/mk/bsd.subdir.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.subdir.mk ============================================================================== --- stable/10/share/mk/bsd.subdir.mk Mon May 12 21:21:32 2014 (r265933) +++ stable/10/share/mk/bsd.subdir.mk Mon May 12 21:22:53 2014 (r265934) @@ -45,7 +45,7 @@ distribute: .MAKE _SUBDIR: .USE .MAKE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}set -e; for entry in ${SUBDIR}; do \ + @${_+_}set -e; for entry in ${SUBDIR:N.WAIT}; do \ if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=install})"; \ edir=$${entry}.${MACHINE_ARCH}; \ @@ -60,7 +60,7 @@ _SUBDIR: .USE .MAKE done .endif -${SUBDIR}: .PHONY .MAKE +${SUBDIR:N.WAIT}: .PHONY .MAKE ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ else \ @@ -68,12 +68,18 @@ ${SUBDIR}: .PHONY .MAKE fi; \ ${MAKE} all +# Work around parsing of .if nested in .for by putting .WAIT string into a var. +__wait= .WAIT .for __target in all all-man checkdpadd clean cleandepend cleandir \ cleanilinks depend distribute lint maninstall manlint obj objlink \ realinstall regress tags ${SUBDIR_TARGETS} .ifdef SUBDIR_PARALLEL +__subdir_targets= .for __dir in ${SUBDIR} -${__target}: ${__target}_subdir_${__dir} +.if ${__wait} == ${__dir} +__subdir_targets+= .WAIT +.else +__subdir_targets+= ${__target}_subdir_${__dir} ${__target}_subdir_${__dir}: .MAKE @${_+_}set -e; \ if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ @@ -87,7 +93,9 @@ ${__target}_subdir_${__dir}: .MAKE fi; \ ${MAKE} ${__target:realinstall=install} \ DIRPRFX=${DIRPRFX}$$edir/ +.endif .endfor +${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR .endif From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 21:40:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 239C8D56; Mon, 12 May 2014 21:40: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 105C723F0; Mon, 12 May 2014 21:40: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 s4CLe3iP069389; Mon, 12 May 2014 21:40:03 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CLe3EE069388; Mon, 12 May 2014 21:40:03 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405122140.s4CLe3EE069388@svn.freebsd.org> From: Ian Lepore Date: Mon, 12 May 2014 21:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265935 - stable/10/sys/boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 21:40:04 -0000 Author: ian Date: Mon May 12 21:40:03 2014 New Revision: 265935 URL: http://svnweb.freebsd.org/changeset/base/265935 Log: MFC r260235: fixes to dockstar DTS source. Modified: stable/10/sys/boot/fdt/dts/dockstar.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/dockstar.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/dockstar.dts Mon May 12 21:22:53 2014 (r265934) +++ stable/10/sys/boot/fdt/dts/dockstar.dts Mon May 12 21:40:03 2014 (r265935) @@ -76,44 +76,17 @@ #size-cells = <1>; compatible = "mrvl,lbc"; - /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x0f 0xf9300000 0x00100000 - 0x1 0x1e 0xfa000000 0x00100000 - 0x2 0x1d 0xfa100000 0x02000000 - 0x3 0x1b 0xfc100000 0x00000400>; + /* This reflects CPU decode windows setup for NAND access. */ + ranges = <0x0 0x2f 0xf9300000 0x00100000>; - nor@0,0 { + nand@0,0 { #address-cells = <1>; #size-cells = <1>; - compatible = "cfi-flash"; + compatible = "mrvl,nfc"; reg = <0x0 0x0 0x00100000>; bank-width = <2>; device-width = <1>; }; - - led@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "led"; - reg = <0x1 0x0 0x00100000>; - }; - - nor@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x2 0x0 0x02000000>; - bank-width = <2>; - device-width = <1>; - }; - - nand@3,0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0x3 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; - }; }; SOC: soc88f6281@f1000000 { From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 21:42:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A02CFEA4; Mon, 12 May 2014 21:42:08 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (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 7C1E32467; Mon, 12 May 2014 21:42:01 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s4CLfn43076462; Mon, 12 May 2014 14:41:53 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201405122141.s4CLfn43076462@gw.catspoiler.org> Date: Mon, 12 May 2014 14:41:49 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r265901 - stable/10/sys/kern To: ache@FreeBSD.org In-Reply-To: <5371081A.2070703@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-10@FreeBSD.org, jilles@stack.nl X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 21:42:08 -0000 On 12 May, Andrey Chernov wrote: > On 12.05.2014 21:03, Jilles Tjoelker wrote: >> On Mon, May 12, 2014 at 08:04:32PM +0400, Andrey Chernov wrote: >>> On 12.05.2014 8:27, Don Lewis wrote: >>>> + if (start + amask < start) { >>>> + DPRINTF(("start+amask wrapped around\n")); >>>> + goto out; >>>> + } >> >>> Checking for overflow _after_ it happens is unportable and dangerous, >>> since wrapping around is not only one possible result. They should be >>> rewritten like that: >> >>> if (start > ULONG_MAX - amask) >> >> Unsigned types wrap around per the C standard. Overflow checking after >> it happens is fine. >> >> You are right for signed types. >> > > You are right. The C Standard, 6.2.5, paragraph 9 [ISO/IEC 9899:2011], > states: > > "A computation involving unsigned operands can never overflow, because a > result that cannot be represented by the resulting unsigned integer type > is reduced modulo the number that is one greater than the largest value > that can be represented by the resulting type." > > I was initially confused by "integer overflow" phrase in the commit's > comment, mechanically producing example above which supposed to be for > signed types. I went ahead and changed the code. I think the new version makes the intent of the code clearer. The compiler is also likely to recognize that "ULONG_MAX - amask" is loop invariant. From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 22:15:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5CC1CBA7; Mon, 12 May 2014 22:15:58 +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 4945C296E; Mon, 12 May 2014 22:15:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CMFw66087045; Mon, 12 May 2014 22:15:58 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CMFvU5087043; Mon, 12 May 2014 22:15:57 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405122215.s4CMFvU5087043@svn.freebsd.org> From: Ian Lepore Date: Mon, 12 May 2014 22:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265936 - in stable/10/sys: arm/ti/am335x modules X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 22:15:58 -0000 Author: ian Date: Mon May 12 22:15:57 2014 New Revision: 265936 URL: http://svnweb.freebsd.org/changeset/base/265936 Log: MFC r259099: Fix a small error in calculating length of DELAY(). Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c stable/10/sys/modules/Makefile Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Mon May 12 21:40:03 2014 (r265935) +++ stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Mon May 12 22:15:57 2014 (r265936) @@ -359,7 +359,7 @@ DELAY(int usec) } /* Get the number of times to count */ - counts = usec * ((am335x_dmtimer_tc.tc_frequency / 1000000) + 1); + counts = usec * (am335x_dmtimer_tc.tc_frequency / 1000000) + 1; first = am335x_dmtimer_tc_read_4(DMTIMER_TCRR); Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Mon May 12 21:40:03 2014 (r265935) +++ stable/10/sys/modules/Makefile Mon May 12 22:15:57 2014 (r265936) @@ -2,6 +2,8 @@ .include +SUBDIR_PARALLEL= + # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 22:19:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BE46BD9C; Mon, 12 May 2014 22:19: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 AB3422B07; Mon, 12 May 2014 22:19: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 s4CMJb22087517; Mon, 12 May 2014 22:19:37 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CMJbwa087516; Mon, 12 May 2014 22:19:37 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405122219.s4CMJbwa087516@svn.freebsd.org> From: Ian Lepore Date: Mon, 12 May 2014 22:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265937 - stable/10/sys/modules X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 22:19:37 -0000 Author: ian Date: Mon May 12 22:19:37 2014 New Revision: 265937 URL: http://svnweb.freebsd.org/changeset/base/265937 Log: Revert accidental commit that tagged along with an MFC commit. Modified: stable/10/sys/modules/Makefile Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Mon May 12 22:15:57 2014 (r265936) +++ stable/10/sys/modules/Makefile Mon May 12 22:19:37 2014 (r265937) @@ -2,8 +2,6 @@ .include -SUBDIR_PARALLEL= - # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 22:25:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E6A66FC2; Mon, 12 May 2014 22:25: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 D2FEE2C2F; Mon, 12 May 2014 22:25: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 s4CMPf0N091341; Mon, 12 May 2014 22:25:41 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CMPfnD091340; Mon, 12 May 2014 22:25:41 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405122225.s4CMPfnD091340@svn.freebsd.org> From: Ian Lepore Date: Mon, 12 May 2014 22:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265938 - stable/10/sys/arm/ti/am335x X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 22:25:42 -0000 Author: ian Date: Mon May 12 22:25:41 2014 New Revision: 265938 URL: http://svnweb.freebsd.org/changeset/base/265938 Log: MFC r259739, r259743: Shorten DMTIMER_->DMT_, #define all register constants. Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Mon May 12 22:19:37 2014 (r265937) +++ stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Mon May 12 22:25:41 2014 (r265938) @@ -51,26 +51,49 @@ __FBSDID("$FreeBSD$"); #include -#define AM335X_NUM_TIMERS 8 +#define AM335X_NUM_TIMERS 8 -#define DMTIMER_TIDR 0x00 /* Identification Register */ -#define DMTIMER_TIOCP_CFG 0x10 /* Timer OCP Configuration Reg */ -#define DMTIMER_IQR_EOI 0x20 /* Timer IRQ End-Of-Interrupt Reg */ -#define DMTIMER_IRQSTATUS_RAW 0x24 /* Timer IRQSTATUS Raw Reg */ -#define DMTIMER_IRQSTATUS 0x28 /* Timer IRQSTATUS Reg */ -#define DMTIMER_IRQENABLE_SET 0x2c /* Timer IRQSTATUS Set Reg */ -#define DMTIMER_IRQENABLE_CLR 0x30 /* Timer IRQSTATUS Clear Reg */ -#define DMTIMER_IRQWAKEEN 0x34 /* Timer IRQ Wakeup Enable Reg */ -#define DMTIMER_TCLR 0x38 /* Timer Control Register */ -#define DMTIMER_TCRR 0x3C /* Timer Counter Register */ -#define DMTIMER_TLDR 0x40 /* Timer Load Reg */ -#define DMTIMER_TTGR 0x44 /* Timer Trigger Reg */ -#define DMTIMER_TWPS 0x48 /* Timer Write Posted Status Reg */ -#define DMTIMER_TMAR 0x4C /* Timer Match Reg */ -#define DMTIMER_TCAR1 0x50 /* Timer Capture Reg */ -#define DMTIMER_TSICR 0x54 /* Timer Synchr. Interface Control Reg */ -#define DMTIMER_TCAR2 0x48 /* Timer Capture Reg */ - +#define DMT_TIDR 0x00 /* Identification Register */ +#define DMT_TIOCP_CFG 0x10 /* OCP Configuration Reg */ +#define DMT_TIOCP_RESET (1 << 0) /* TIOCP perform soft reset */ +#define DMT_IQR_EOI 0x20 /* IRQ End-Of-Interrupt Reg */ +#define DMT_IRQSTATUS_RAW 0x24 /* IRQSTATUS Raw Reg */ +#define DMT_IRQSTATUS 0x28 /* IRQSTATUS Reg */ +#define DMT_IRQENABLE_SET 0x2c /* IRQSTATUS Set Reg */ +#define DMT_IRQENABLE_CLR 0x30 /* IRQSTATUS Clear Reg */ +#define DMT_IRQWAKEEN 0x34 /* IRQ Wakeup Enable Reg */ +#define DMT_IRQ_TCAR (1 << 0) /* IRQ: Capture */ +#define DMT_IRQ_OVF (1 << 1) /* IRQ: Overflow */ +#define DMT_IRQ_MAT (1 << 2) /* IRQ: Match */ +#define DMT_IRQ_MASK (DMT_IRQ_TCAR | DMT_IRQ_OVF | DMT_IRQ_MAT) +#define DMT_TCLR 0x38 /* Control Register */ +#define DMT_TCLR_START (1 << 0) /* Start timer */ +#define DMT_TCLR_AUTOLOAD (1 << 1) /* Auto-reload on overflow */ +#define DMT_TCLR_PRES_MASK (7 << 2) /* Prescaler mask */ +#define DMT_TCLR_PRES_ENABLE (1 << 5) /* Prescaler enable */ +#define DMT_TCLR_COMP_ENABLE (1 << 6) /* Compare enable */ +#define DMT_TCLR_PWM_HIGH (1 << 7) /* PWM default output high */ +#define DMT_TCLR_CAPTRAN_MASK (3 << 8) /* Capture transition mask */ +#define DMT_TCLR_CAPTRAN_NONE (0 << 8) /* Capture: none */ +#define DMT_TCLR_CAPTRAN_LOHI (1 << 8) /* Capture lo->hi transition */ +#define DMT_TCLR_CAPTRAN_HILO (2 << 8) /* Capture hi->lo transition */ +#define DMT_TCLR_CAPTRAN_BOTH (3 << 8) /* Capture both transitions */ +#define DMT_TCLR_TRGMODE_MASK (3 << 10) /* Trigger output mode mask */ +#define DMT_TCLR_TRGMODE_NONE (0 << 10) /* Trigger off */ +#define DMT_TCLR_TRGMODE_OVFL (1 << 10) /* Trigger on overflow */ +#define DMT_TCLR_TRGMODE_BOTH (2 << 10) /* Trigger on match + ovflow */ +#define DMT_TCLR_PWM_PTOGGLE (1 << 12) /* PWM toggles */ +#define DMT_TCLR_CAP_MODE_2ND (1 << 13) /* Capture second event mode */ +#define DMT_TCLR_GPO_CFG (1 << 14) /* (no descr in datasheet) */ +#define DMT_TCRR 0x3C /* Counter Register */ +#define DMT_TLDR 0x40 /* Load Reg */ +#define DMT_TTGR 0x44 /* Trigger Reg */ +#define DMT_TWPS 0x48 /* Write Posted Status Reg */ +#define DMT_TMAR 0x4C /* Match Reg */ +#define DMT_TCAR1 0x50 /* Capture Reg */ +#define DMT_TSICR 0x54 /* Synchr. Interface Ctrl Reg */ +#define DMT_TSICR_RESET 0x02 /* TSICR perform soft reset */ +#define DMT_TCAR2 0x48 /* Capture Reg */ struct am335x_dmtimer_softc { struct resource * tmr_mem_res[AM335X_NUM_TIMERS]; @@ -138,7 +161,7 @@ static struct timecounter am335x_dmtimer static unsigned am335x_dmtimer_tc_get_timecount(struct timecounter *tc) { - return am335x_dmtimer_tc_read_4(DMTIMER_TCRR); + return am335x_dmtimer_tc_read_4(DMT_TCRR); } static int @@ -162,23 +185,23 @@ am335x_dmtimer_start(struct eventtimer * count = load; /* Reset Timer */ - am335x_dmtimer_et_write_4(DMTIMER_TSICR, 2); + am335x_dmtimer_et_write_4(DMT_TSICR, 2); /* Wait for reset to complete */ - while (am335x_dmtimer_et_read_4(DMTIMER_TIOCP_CFG) & 1); + while (am335x_dmtimer_et_read_4(DMT_TIOCP_CFG) & 1); /* set load value */ - am335x_dmtimer_et_write_4(DMTIMER_TLDR, 0xFFFFFFFE - load); + am335x_dmtimer_et_write_4(DMT_TLDR, 0xFFFFFFFE - load); /* set counter value */ - am335x_dmtimer_et_write_4(DMTIMER_TCRR, 0xFFFFFFFE - count); + am335x_dmtimer_et_write_4(DMT_TCRR, 0xFFFFFFFE - count); /* enable overflow interrupt */ - am335x_dmtimer_et_write_4(DMTIMER_IRQENABLE_SET, 2); + am335x_dmtimer_et_write_4(DMT_IRQENABLE_SET, 2); /* start timer(ST) */ tclr |= 1; - am335x_dmtimer_et_write_4(DMTIMER_TCLR, tclr); + am335x_dmtimer_et_write_4(DMT_TCLR, tclr); return (0); } @@ -189,10 +212,10 @@ am335x_dmtimer_stop(struct eventtimer *e struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)et->et_priv; /* Disable all interrupts */ - am335x_dmtimer_et_write_4(DMTIMER_IRQENABLE_CLR, 7); + am335x_dmtimer_et_write_4(DMT_IRQENABLE_CLR, 7); /* Stop Timer */ - am335x_dmtimer_et_write_4(DMTIMER_TCLR, 0); + am335x_dmtimer_et_write_4(DMT_TCLR, 0); return (0); } @@ -203,7 +226,7 @@ am335x_dmtimer_intr(void *arg) struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)arg; /* Ack interrupt */ - am335x_dmtimer_et_write_4(DMTIMER_IRQSTATUS, 7); + am335x_dmtimer_et_write_4(DMT_IRQSTATUS, 7); if (tmr->et.et_active) tmr->et.et_event_cb(&tmr->et, tmr->et.et_arg); @@ -277,19 +300,19 @@ am335x_dmtimer_attach(device_t dev) am335x_dmtimer_tc_tmr = &sc->t[2]; /* Reset Timer */ - am335x_dmtimer_tc_write_4(DMTIMER_TSICR, 2); + am335x_dmtimer_tc_write_4(DMT_TSICR, 2); /* Wait for reset to complete */ - while (am335x_dmtimer_tc_read_4(DMTIMER_TIOCP_CFG) & 1); + while (am335x_dmtimer_tc_read_4(DMT_TIOCP_CFG) & 1); /* set load value */ - am335x_dmtimer_tc_write_4(DMTIMER_TLDR, 0); + am335x_dmtimer_tc_write_4(DMT_TLDR, 0); /* set counter value */ - am335x_dmtimer_tc_write_4(DMTIMER_TCRR, 0); + am335x_dmtimer_tc_write_4(DMT_TCRR, 0); /* Set Timer autoreload(AR) and start timer(ST) */ - am335x_dmtimer_tc_write_4(DMTIMER_TCLR, 3); + am335x_dmtimer_tc_write_4(DMT_TCLR, 3); am335x_dmtimer_tc.tc_frequency = sc->sysclk_freq; tc_init(&am335x_dmtimer_tc); @@ -361,10 +384,10 @@ DELAY(int usec) /* Get the number of times to count */ counts = usec * (am335x_dmtimer_tc.tc_frequency / 1000000) + 1; - first = am335x_dmtimer_tc_read_4(DMTIMER_TCRR); + first = am335x_dmtimer_tc_read_4(DMT_TCRR); while (counts > 0) { - last = am335x_dmtimer_tc_read_4(DMTIMER_TCRR); + last = am335x_dmtimer_tc_read_4(DMT_TCRR); if (last>first) { counts -= (int32_t)(last - first); } else { From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 22:30:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A09671C6; Mon, 12 May 2014 22:30: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 8C4E82CA2; Mon, 12 May 2014 22:30: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 s4CMUAwk092343; Mon, 12 May 2014 22:30:10 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CMUA5Z092342; Mon, 12 May 2014 22:30:10 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405122230.s4CMUA5Z092342@svn.freebsd.org> From: Ian Lepore Date: Mon, 12 May 2014 22:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265939 - stable/10/sys/arm/ti/am335x X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 22:30:10 -0000 Author: ian Date: Mon May 12 22:30:10 2014 New Revision: 265939 URL: http://svnweb.freebsd.org/changeset/base/265939 Log: MFC r259744, cleanups to move global vars into softc, use named values, etc. Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Mon May 12 22:25:41 2014 (r265938) +++ stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Mon May 12 22:30:10 2014 (r265939) @@ -99,13 +99,16 @@ struct am335x_dmtimer_softc { struct resource * tmr_mem_res[AM335X_NUM_TIMERS]; struct resource * tmr_irq_res[AM335X_NUM_TIMERS]; uint32_t sysclk_freq; - struct am335x_dmtimer { - bus_space_tag_t bst; - bus_space_handle_t bsh; - struct eventtimer et; - } t[AM335X_NUM_TIMERS]; + uint32_t tc_num; /* Which timer number is tc. */ + uint32_t et_num; /* Which timer number is et. */ + struct resource * tc_memres; /* Resources for tc timer. */ + struct resource * et_memres; /* Resources for et timer. */ + struct timecounter tc; + struct eventtimer et; }; +static struct am335x_dmtimer_softc *am335x_dmtimer_sc; + static struct resource_spec am335x_dmtimer_mem_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_MEMORY, 1, RF_ACTIVE }, @@ -129,51 +132,58 @@ static struct resource_spec am335x_dmtim { -1, 0, 0 } }; -static struct am335x_dmtimer *am335x_dmtimer_tc_tmr = NULL; +static inline uint32_t +am335x_dmtimer_tc_read_4(struct am335x_dmtimer_softc *sc, uint32_t reg) +{ -/* Read/Write macros for Timer used as timecounter */ -#define am335x_dmtimer_tc_read_4(reg) \ - bus_space_read_4(am335x_dmtimer_tc_tmr->bst, \ - am335x_dmtimer_tc_tmr->bsh, reg) - -#define am335x_dmtimer_tc_write_4(reg, val) \ - bus_space_write_4(am335x_dmtimer_tc_tmr->bst, \ - am335x_dmtimer_tc_tmr->bsh, reg, val) - -/* Read/Write macros for Timer used as eventtimer */ -#define am335x_dmtimer_et_read_4(reg) \ - bus_space_read_4(tmr->bst, tmr->bsh, reg) - -#define am335x_dmtimer_et_write_4(reg, val) \ - bus_space_write_4(tmr->bst, tmr->bsh, reg, val) - -static unsigned am335x_dmtimer_tc_get_timecount(struct timecounter *); - -static struct timecounter am335x_dmtimer_tc = { - .tc_name = "AM335x Timecounter", - .tc_get_timecount = am335x_dmtimer_tc_get_timecount, - .tc_poll_pps = NULL, - .tc_counter_mask = ~0u, - .tc_frequency = 0, - .tc_quality = 1000, -}; + return (bus_read_4(sc->tc_memres, reg)); +} + +static inline void +am335x_dmtimer_tc_write_4(struct am335x_dmtimer_softc *sc, uint32_t reg, + uint32_t val) +{ + + bus_write_4(sc->tc_memres, reg, val); +} + +static inline uint32_t +am335x_dmtimer_et_read_4(struct am335x_dmtimer_softc *sc, uint32_t reg) +{ + + return (bus_read_4(sc->et_memres, reg)); +} + +static inline void +am335x_dmtimer_et_write_4(struct am335x_dmtimer_softc *sc, uint32_t reg, + uint32_t val) +{ + + bus_write_4(sc->et_memres, reg, val); +} static unsigned am335x_dmtimer_tc_get_timecount(struct timecounter *tc) { - return am335x_dmtimer_tc_read_4(DMT_TCRR); + struct am335x_dmtimer_softc *sc; + + sc = tc->tc_priv; + + return (am335x_dmtimer_tc_read_4(sc, DMT_TCRR)); } static int am335x_dmtimer_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { - struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)et->et_priv; - uint32_t load, count; - uint32_t tclr = 0; + struct am335x_dmtimer_softc *sc; + uint32_t count, load, tclr; + + sc = et->et_priv; + tclr = 0; if (period != 0) { load = ((uint32_t)et->et_frequency * period) >> 32; - tclr |= 2; /* autoreload bit */ + tclr |= DMT_TCLR_AUTOLOAD; panic("periodic timer not implemented\n"); } else { load = 0; @@ -185,23 +195,24 @@ am335x_dmtimer_start(struct eventtimer * count = load; /* Reset Timer */ - am335x_dmtimer_et_write_4(DMT_TSICR, 2); + am335x_dmtimer_et_write_4(sc, DMT_TSICR, DMT_TSICR_RESET); /* Wait for reset to complete */ - while (am335x_dmtimer_et_read_4(DMT_TIOCP_CFG) & 1); + while (am335x_dmtimer_et_read_4(sc, DMT_TIOCP_CFG) & DMT_TIOCP_RESET) + continue; /* set load value */ - am335x_dmtimer_et_write_4(DMT_TLDR, 0xFFFFFFFE - load); + am335x_dmtimer_et_write_4(sc, DMT_TLDR, 0xFFFFFFFE - load); /* set counter value */ - am335x_dmtimer_et_write_4(DMT_TCRR, 0xFFFFFFFE - count); + am335x_dmtimer_et_write_4(sc, DMT_TCRR, 0xFFFFFFFE - count); /* enable overflow interrupt */ - am335x_dmtimer_et_write_4(DMT_IRQENABLE_SET, 2); + am335x_dmtimer_et_write_4(sc, DMT_IRQENABLE_SET, DMT_IRQ_OVF); /* start timer(ST) */ - tclr |= 1; - am335x_dmtimer_et_write_4(DMT_TCLR, tclr); + tclr |= DMT_TCLR_START; + am335x_dmtimer_et_write_4(sc, DMT_TCLR, tclr); return (0); } @@ -209,13 +220,15 @@ am335x_dmtimer_start(struct eventtimer * static int am335x_dmtimer_stop(struct eventtimer *et) { - struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)et->et_priv; + struct am335x_dmtimer_softc *sc; + + sc = et->et_priv; /* Disable all interrupts */ - am335x_dmtimer_et_write_4(DMT_IRQENABLE_CLR, 7); + am335x_dmtimer_et_write_4(sc, DMT_IRQENABLE_CLR, DMT_IRQ_MASK); /* Stop Timer */ - am335x_dmtimer_et_write_4(DMT_TCLR, 0); + am335x_dmtimer_et_write_4(sc, DMT_TCLR, 0); return (0); } @@ -223,12 +236,13 @@ am335x_dmtimer_stop(struct eventtimer *e static int am335x_dmtimer_intr(void *arg) { - struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)arg; + struct am335x_dmtimer_softc *sc; + sc = arg; /* Ack interrupt */ - am335x_dmtimer_et_write_4(DMT_IRQSTATUS, 7); - if (tmr->et.et_active) - tmr->et.et_event_cb(&tmr->et, tmr->et.et_arg); + am335x_dmtimer_et_write_4(sc, DMT_IRQSTATUS, DMT_IRQ_OVF); + if (sc->et.et_active) + sc->et.et_event_cb(&sc->et, sc->et.et_arg); return (FILTER_HANDLED); } @@ -236,8 +250,6 @@ am335x_dmtimer_intr(void *arg) static int am335x_dmtimer_probe(device_t dev) { - struct am335x_dmtimer_softc *sc; - sc = (struct am335x_dmtimer_softc *)device_get_softc(dev); if (ofw_bus_is_compatible(dev, "ti,am335x-dmtimer")) { device_set_desc(dev, "AM335x DMTimer"); @@ -250,22 +262,29 @@ am335x_dmtimer_probe(device_t dev) static int am335x_dmtimer_attach(device_t dev) { - struct am335x_dmtimer_softc *sc = device_get_softc(dev); + struct am335x_dmtimer_softc *sc; void *ihl; int err; - int i; - if (am335x_dmtimer_tc_tmr != NULL) + /* + * Note that if this routine returns an error status rather than running + * to completion it makes no attempt to clean up allocated resources; + * the system is essentially dead anyway without functional timers. + */ + + sc = device_get_softc(dev); + + if (am335x_dmtimer_sc != NULL) return (EINVAL); - /* Get the base clock frequency */ + /* Get the base clock frequency. */ err = ti_prcm_clk_get_source_freq(SYS_CLK, &sc->sysclk_freq); if (err) { device_printf(dev, "Error: could not get sysclk frequency\n"); return (ENXIO); } - /* Request the memory resources */ + /* Request the memory resources. */ err = bus_alloc_resources(dev, am335x_dmtimer_mem_spec, sc->tmr_mem_res); if (err) { @@ -273,7 +292,7 @@ am335x_dmtimer_attach(device_t dev) return (ENXIO); } - /* Request the IRQ resources */ + /* Request the IRQ resources. */ err = bus_alloc_resources(dev, am335x_dmtimer_irq_spec, sc->tmr_irq_res); if (err) { @@ -281,65 +300,64 @@ am335x_dmtimer_attach(device_t dev) return (ENXIO); } - for(i=0;it[i].bst = rman_get_bustag(sc->tmr_mem_res[i]); - sc->t[i].bsh = rman_get_bushandle(sc->tmr_mem_res[i]); - } - - /* Configure DMTimer2 and DMTimer3 source and enable them */ - err = ti_prcm_clk_set_source(DMTIMER2_CLK, SYSCLK_CLK); - err |= ti_prcm_clk_enable(DMTIMER2_CLK); - err |= ti_prcm_clk_set_source(DMTIMER3_CLK, SYSCLK_CLK); - err |= ti_prcm_clk_enable(DMTIMER3_CLK); + /* Configure DMTimer3 as eventtimer and DMTimer4 as timecounter. */ + sc->et_num = 3; + sc->tc_num = 2; + sc->et_memres = sc->tmr_mem_res[sc->et_num]; + sc->tc_memres = sc->tmr_mem_res[sc->tc_num]; + + err = ti_prcm_clk_set_source(DMTIMER0_CLK + sc->et_num, SYSCLK_CLK); + err |= ti_prcm_clk_enable(DMTIMER0_CLK + sc->et_num); + err |= ti_prcm_clk_set_source(DMTIMER0_CLK + sc->tc_num, SYSCLK_CLK); + err |= ti_prcm_clk_enable(DMTIMER0_CLK + sc->tc_num); if (err) { device_printf(dev, "Error: could not setup timer clock\n"); return (ENXIO); } - /* Take DMTimer2 for TC */ - am335x_dmtimer_tc_tmr = &sc->t[2]; - - /* Reset Timer */ - am335x_dmtimer_tc_write_4(DMT_TSICR, 2); - - /* Wait for reset to complete */ - while (am335x_dmtimer_tc_read_4(DMT_TIOCP_CFG) & 1); - - /* set load value */ - am335x_dmtimer_tc_write_4(DMT_TLDR, 0); - - /* set counter value */ - am335x_dmtimer_tc_write_4(DMT_TCRR, 0); - - /* Set Timer autoreload(AR) and start timer(ST) */ - am335x_dmtimer_tc_write_4(DMT_TCLR, 3); - - am335x_dmtimer_tc.tc_frequency = sc->sysclk_freq; - tc_init(&am335x_dmtimer_tc); - - /* Register DMTimer3 as ET */ - - /* Setup and enable the timer */ - if (bus_setup_intr(dev, sc->tmr_irq_res[3], INTR_TYPE_CLK, - am335x_dmtimer_intr, NULL, &sc->t[3], &ihl) != 0) { + /* Set up timecounter; register tc. */ + am335x_dmtimer_tc_write_4(sc, DMT_TSICR, DMT_TSICR_RESET); + while (am335x_dmtimer_tc_read_4(sc, DMT_TIOCP_CFG) & DMT_TIOCP_RESET) + continue; + + am335x_dmtimer_tc_write_4(sc, DMT_TLDR, 0); + am335x_dmtimer_tc_write_4(sc, DMT_TCRR, 0); + am335x_dmtimer_tc_write_4(sc, DMT_TCLR, + DMT_TCLR_START | DMT_TCLR_AUTOLOAD); + + sc->tc.tc_name = "AM335x Timecounter"; + sc->tc.tc_get_timecount = am335x_dmtimer_tc_get_timecount; + sc->tc.tc_poll_pps = NULL; + sc->tc.tc_counter_mask = ~0u; + sc->tc.tc_frequency = sc->sysclk_freq; + sc->tc.tc_quality = 1000; + sc->tc.tc_priv = sc; + tc_init(&sc->tc); + + /* Setup eventtimer; register et. */ + if (bus_setup_intr(dev, sc->tmr_irq_res[sc->et_num], INTR_TYPE_CLK, + am335x_dmtimer_intr, NULL, sc, &ihl) != 0) { bus_release_resources(dev, am335x_dmtimer_irq_spec, sc->tmr_irq_res); device_printf(dev, "Unable to setup the clock irq handler.\n"); return (ENXIO); } - sc->t[3].et.et_name = "AM335x Eventtimer0"; - sc->t[3].et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT; - sc->t[3].et.et_quality = 1000; - sc->t[3].et.et_frequency = sc->sysclk_freq; - sc->t[3].et.et_min_period = - (0x00000002LLU << 32) / sc->t[3].et.et_frequency; - sc->t[3].et.et_max_period = - (0xfffffffeLLU << 32) / sc->t[3].et.et_frequency; - sc->t[3].et.et_start = am335x_dmtimer_start; - sc->t[3].et.et_stop = am335x_dmtimer_stop; - sc->t[3].et.et_priv = &sc->t[3]; - et_register(&sc->t[3].et); + sc->et.et_name = "AM335x Eventtimer"; + sc->et.et_flags = ET_FLAGS_ONESHOT; + sc->et.et_quality = 1000; + sc->et.et_frequency = sc->sysclk_freq; + sc->et.et_min_period = + ((0x00000005LLU << 32) / sc->et.et_frequency); + sc->et.et_max_period = + (0xfffffffeLLU << 32) / sc->et.et_frequency; + sc->et.et_start = am335x_dmtimer_start; + sc->et.et_stop = am335x_dmtimer_stop; + sc->et.et_priv = sc; + et_register(&sc->et); + + /* Store a pointer to the softc for use in DELAY(). */ + am335x_dmtimer_sc = sc; return (0); } @@ -370,10 +388,13 @@ cpu_initclocks(void) void DELAY(int usec) { - int32_t counts; + struct am335x_dmtimer_softc *sc; + int32_t counts; uint32_t first, last; - if (am335x_dmtimer_tc_tmr == NULL) { + sc = am335x_dmtimer_sc; + + if (sc == NULL) { for (; usec > 0; usec--) for (counts = 200; counts > 0; counts--) /* Prevent gcc from optimizing out the loop */ @@ -382,13 +403,13 @@ DELAY(int usec) } /* Get the number of times to count */ - counts = usec * (am335x_dmtimer_tc.tc_frequency / 1000000) + 1; + counts = (usec + 1) * (sc->sysclk_freq / 1000000); - first = am335x_dmtimer_tc_read_4(DMT_TCRR); + first = am335x_dmtimer_tc_read_4(sc, DMT_TCRR); while (counts > 0) { - last = am335x_dmtimer_tc_read_4(DMT_TCRR); - if (last>first) { + last = am335x_dmtimer_tc_read_4(sc, DMT_TCRR); + if (last > first) { counts -= (int32_t)(last - first); } else { counts -= (int32_t)((0xFFFFFFFF - first) + last); From owner-svn-src-stable-10@FreeBSD.ORG Mon May 12 22:33:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DD7354C5; Mon, 12 May 2014 22:33: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 C8E152D50; Mon, 12 May 2014 22:33: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 s4CMXMlH095411; Mon, 12 May 2014 22:33:22 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CMXMsR095410; Mon, 12 May 2014 22:33:22 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405122233.s4CMXMsR095410@svn.freebsd.org> From: Ian Lepore Date: Mon, 12 May 2014 22:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265940 - stable/10/sys/arm/ti/am335x X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 22:33:23 -0000 Author: ian Date: Mon May 12 22:33:22 2014 New Revision: 265940 URL: http://svnweb.freebsd.org/changeset/base/265940 Log: MFC r259750, r260245: Add PPS support to the am335x timer driver. Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Mon May 12 22:30:10 2014 (r265939) +++ stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Mon May 12 22:33:22 2014 (r265940) @@ -30,17 +30,22 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include +#include #include #include #include #include #include +#include "opt_ntp.h" + #include #include #include @@ -50,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #define AM335X_NUM_TIMERS 8 @@ -62,9 +68,9 @@ __FBSDID("$FreeBSD$"); #define DMT_IRQENABLE_SET 0x2c /* IRQSTATUS Set Reg */ #define DMT_IRQENABLE_CLR 0x30 /* IRQSTATUS Clear Reg */ #define DMT_IRQWAKEEN 0x34 /* IRQ Wakeup Enable Reg */ -#define DMT_IRQ_TCAR (1 << 0) /* IRQ: Capture */ +#define DMT_IRQ_MAT (1 << 0) /* IRQ: Match */ #define DMT_IRQ_OVF (1 << 1) /* IRQ: Overflow */ -#define DMT_IRQ_MAT (1 << 2) /* IRQ: Match */ +#define DMT_IRQ_TCAR (1 << 2) /* IRQ: Capture */ #define DMT_IRQ_MASK (DMT_IRQ_TCAR | DMT_IRQ_OVF | DMT_IRQ_MAT) #define DMT_TCLR 0x38 /* Control Register */ #define DMT_TCLR_START (1 << 0) /* Start timer */ @@ -92,17 +98,32 @@ __FBSDID("$FreeBSD$"); #define DMT_TMAR 0x4C /* Match Reg */ #define DMT_TCAR1 0x50 /* Capture Reg */ #define DMT_TSICR 0x54 /* Synchr. Interface Ctrl Reg */ -#define DMT_TSICR_RESET 0x02 /* TSICR perform soft reset */ +#define DMT_TSICR_RESET (1 << 1) /* TSICR perform soft reset */ #define DMT_TCAR2 0x48 /* Capture Reg */ +/* + * Use timer 2 for the eventtimer. When PPS support is not compiled in, there's + * no need to use a timer that has an associated capture-input pin, so use timer + * 3 for timecounter. When PPS is compiled in we ignore the default and use + * whichever of timers 4-7 have the capture pin configured. + */ +#define DEFAULT_ET_TIMER 2 +#define DEFAULT_TC_TIMER 3 + struct am335x_dmtimer_softc { struct resource * tmr_mem_res[AM335X_NUM_TIMERS]; struct resource * tmr_irq_res[AM335X_NUM_TIMERS]; uint32_t sysclk_freq; uint32_t tc_num; /* Which timer number is tc. */ - uint32_t et_num; /* Which timer number is et. */ + uint32_t tc_tclr; /* Cached tc TCLR register. */ struct resource * tc_memres; /* Resources for tc timer. */ + uint32_t et_num; /* Which timer number is et. */ + uint32_t et_tclr; /* Cached et TCLR register. */ struct resource * et_memres; /* Resources for et timer. */ + int pps_curmode; /* Edge mode now set in hw. */ + struct task pps_task; /* For pps_event handling. */ + struct cdev * pps_cdev; + struct pps_state pps; struct timecounter tc; struct eventtimer et; }; @@ -162,6 +183,255 @@ am335x_dmtimer_et_write_4(struct am335x_ bus_write_4(sc->et_memres, reg, val); } +/* + * PPS driver routines, included when the kernel is built with option PPS_SYNC. + * + * Note that this PPS driver does not use an interrupt. Instead it uses the + * hardware's ability to latch the timer's count register in response to a + * signal on an IO pin. Each of timers 4-7 have an associated pin, and this + * code allows any one of those to be used. + * + * The timecounter routines in kern_tc.c call the pps poll routine periodically + * to see if a new counter value has been latched. When a new value has been + * latched, the only processing done in the poll routine is to capture the + * current set of timecounter timehands (done with pps_capture()) and the + * latched value from the timer. The remaining work (done by pps_event()) is + * scheduled to be done later in a non-interrupt context. + */ +#ifdef PPS_SYNC + +#define PPS_CDEV_NAME "pps" + +static void +am335x_dmtimer_set_capture_mode(struct am335x_dmtimer_softc *sc, bool force_off) +{ + int newmode; + + if (force_off) + newmode = 0; + else + newmode = sc->pps.ppsparam.mode & PPS_CAPTUREBOTH; + + if (newmode == sc->pps_curmode) + return; + + sc->pps_curmode = newmode; + sc->tc_tclr &= ~DMT_TCLR_CAPTRAN_MASK; + switch (newmode) { + case PPS_CAPTUREASSERT: + sc->tc_tclr |= DMT_TCLR_CAPTRAN_LOHI; + break; + case PPS_CAPTURECLEAR: + sc->tc_tclr |= DMT_TCLR_CAPTRAN_HILO; + break; + default: + /* It can't be BOTH, so it's disabled. */ + break; + } + am335x_dmtimer_tc_write_4(sc, DMT_TCLR, sc->tc_tclr); +} + +static void +am335x_dmtimer_tc_poll_pps(struct timecounter *tc) +{ + struct am335x_dmtimer_softc *sc; + + sc = tc->tc_priv; + + /* + * Note that we don't have the TCAR interrupt enabled, but the hardware + * still provides the status bits in the "RAW" status register even when + * they're masked from generating an irq. However, when clearing the + * TCAR status to re-arm the capture for the next second, we have to + * write to the IRQ status register, not the RAW register. Quirky. + */ + if (am335x_dmtimer_tc_read_4(sc, DMT_IRQSTATUS_RAW) & DMT_IRQ_TCAR) { + pps_capture(&sc->pps); + sc->pps.capcount = am335x_dmtimer_tc_read_4(sc, DMT_TCAR1); + am335x_dmtimer_tc_write_4(sc, DMT_IRQSTATUS, DMT_IRQ_TCAR); + taskqueue_enqueue_fast(taskqueue_fast, &sc->pps_task); + } +} + +static void +am335x_dmtimer_process_pps_event(void *arg, int pending) +{ + struct am335x_dmtimer_softc *sc; + + sc = arg; + + /* This is the task function that gets enqueued by poll_pps. Once the + * time has been captured in the hw interrupt context, the remaining + * (more expensive) work to process the event is done later in a + * non-fast-interrupt context. + * + * We only support capture of the rising or falling edge, not both at + * once; tell the kernel to process whichever mode is currently active. + */ + pps_event(&sc->pps, sc->pps.ppsparam.mode & PPS_CAPTUREBOTH); +} + +static int +am335x_dmtimer_pps_open(struct cdev *dev, int flags, int fmt, + struct thread *td) +{ + struct am335x_dmtimer_softc *sc; + + sc = dev->si_drv1; + + /* Enable capture on open. Harmless if already open. */ + am335x_dmtimer_set_capture_mode(sc, 0); + + return 0; +} + +static int +am335x_dmtimer_pps_close(struct cdev *dev, int flags, int fmt, + struct thread *td) +{ + struct am335x_dmtimer_softc *sc; + + sc = dev->si_drv1; + + /* + * Disable capture on last close. Use the force-off flag to override + * the configured mode and turn off the hardware capture. + */ + am335x_dmtimer_set_capture_mode(sc, 1); + + return 0; +} + +static int +am335x_dmtimer_pps_ioctl(struct cdev *dev, u_long cmd, caddr_t data, + int flags, struct thread *td) +{ + struct am335x_dmtimer_softc *sc; + int err; + + sc = dev->si_drv1; + + /* + * The hardware has a "capture both edges" mode, but we can't do + * anything useful with it in terms of PPS capture, so don't even try. + */ + if ((sc->pps.ppsparam.mode & PPS_CAPTUREBOTH) == PPS_CAPTUREBOTH) + return (EINVAL); + + /* Let the kernel do the heavy lifting for ioctl. */ + err = pps_ioctl(cmd, data, &sc->pps); + if (err != 0) + return (err); + + /* + * The capture mode could have changed, set the hardware to whatever + * mode is now current. Effectively a no-op if nothing changed. + */ + am335x_dmtimer_set_capture_mode(sc, 0); + + return (err); +} + +static struct cdevsw am335x_dmtimer_pps_cdevsw = { + .d_version = D_VERSION, + .d_open = am335x_dmtimer_pps_open, + .d_close = am335x_dmtimer_pps_close, + .d_ioctl = am335x_dmtimer_pps_ioctl, + .d_name = PPS_CDEV_NAME, +}; + +/* + * Set up the PPS cdev and the the kernel timepps stuff. + * + * Note that this routine cannot touch the hardware, because bus space resources + * are not fully set up yet when this is called. + */ +static int +am335x_dmtimer_pps_init(device_t dev, struct am335x_dmtimer_softc *sc) +{ + int i, timer_num, unit; + unsigned int padstate; + const char * padmux; + struct padinfo { + char * ballname; + char * muxname; + int timer_num; + } padinfo[] = { + {"GPMC_ADVn_ALE", "timer4", 4}, + {"GPMC_BEn0_CLE", "timer5", 5}, + {"GPMC_WEn", "timer6", 6}, + {"GPMC_OEn_REn", "timer7", 7}, + }; + + /* + * Figure out which pin the user has set up for pps. We'll use the + * first timer that has an external caputure pin configured as input. + * + * XXX The hieroglyphic "(padstate & (0x01 << 5)))" checks that the pin + * is configured for input. The right symbolic values aren't exported + * yet from ti_scm.h. + */ + timer_num = 0; + for (i = 0; i < nitems(padinfo) && timer_num == 0; ++i) { + if (ti_scm_padconf_get(padinfo[i].ballname, &padmux, + &padstate) == 0) { + if (strcasecmp(padinfo[i].muxname, padmux) == 0 && + (padstate & (0x01 << 5))) + timer_num = padinfo[i].timer_num; + } + } + + if (timer_num == 0) { + device_printf(dev, "No DMTimer found with capture pin " + "configured as input; PPS driver disabled.\n"); + return (DEFAULT_TC_TIMER); + } + + /* + * Indicate our capabilities (pretty much just capture of either edge). + * Have the kernel init its part of the pps_state struct and add its + * capabilities. + */ + sc->pps.ppscap = PPS_CAPTUREBOTH; + pps_init(&sc->pps); + + /* + * Set up to capture the PPS via timecounter polling, and init the task + * that does deferred pps_event() processing after capture. + */ + sc->tc.tc_poll_pps = am335x_dmtimer_tc_poll_pps; + TASK_INIT(&sc->pps_task, 0, am335x_dmtimer_process_pps_event, sc); + + /* Create the PPS cdev. */ + unit = device_get_unit(dev); + sc->pps_cdev = make_dev(&am335x_dmtimer_pps_cdevsw, unit, + UID_ROOT, GID_WHEEL, 0600, PPS_CDEV_NAME "%d", unit); + sc->pps_cdev->si_drv1 = sc; + + device_printf(dev, "Using DMTimer%d for PPS device /dev/%s%d\n", + timer_num, PPS_CDEV_NAME, unit); + + return (timer_num); +} + +#else /* PPS_SYNC */ + +static int +am335x_dmtimer_pps_init(device_t dev, struct am335x_dmtimer_softc *sc) +{ + + /* + * When PPS support is not compiled in, there's no need to use a timer + * that has an associated capture-input pin, so use the default. + */ + return (DEFAULT_TC_TIMER); +} + +#endif /* PPS_SYNC */ +/* + * End of PPS driver code. + */ + static unsigned am335x_dmtimer_tc_get_timecount(struct timecounter *tc) { @@ -176,43 +446,50 @@ static int am335x_dmtimer_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { struct am335x_dmtimer_softc *sc; - uint32_t count, load, tclr; + uint32_t initial_count, reload_count; sc = et->et_priv; - tclr = 0; + /* + * Stop the timer before changing it. This routine will often be called + * while the timer is still running, to either lengthen or shorten the + * current event time. We need to ensure the timer doesn't expire while + * we're working with it. + * + * Also clear any pending interrupt status, because it's at least + * theoretically possible that we're running in a primary interrupt + * context now, and a timer interrupt could be pending even before we + * stopped the timer. The more likely case is that we're being called + * from the et_event_cb() routine dispatched from our own handler, but + * it's not clear to me that that's the only case possible. + */ + sc->et_tclr &= ~(DMT_TCLR_START | DMT_TCLR_AUTOLOAD); + am335x_dmtimer_et_write_4(sc, DMT_TCLR, sc->et_tclr); + am335x_dmtimer_et_write_4(sc, DMT_IRQSTATUS, DMT_IRQ_OVF); + if (period != 0) { - load = ((uint32_t)et->et_frequency * period) >> 32; - tclr |= DMT_TCLR_AUTOLOAD; - panic("periodic timer not implemented\n"); + reload_count = ((uint32_t)et->et_frequency * period) >> 32; + sc->et_tclr |= DMT_TCLR_AUTOLOAD; } else { - load = 0; + reload_count = 0; } if (first != 0) - count = ((uint32_t)et->et_frequency * first) >> 32; + initial_count = ((uint32_t)et->et_frequency * first) >> 32; else - count = load; - - /* Reset Timer */ - am335x_dmtimer_et_write_4(sc, DMT_TSICR, DMT_TSICR_RESET); - - /* Wait for reset to complete */ - while (am335x_dmtimer_et_read_4(sc, DMT_TIOCP_CFG) & DMT_TIOCP_RESET) - continue; + initial_count = reload_count; - /* set load value */ - am335x_dmtimer_et_write_4(sc, DMT_TLDR, 0xFFFFFFFE - load); - - /* set counter value */ - am335x_dmtimer_et_write_4(sc, DMT_TCRR, 0xFFFFFFFE - count); + /* + * Set auto-reload and current-count values. This timer hardware counts + * up from the initial/reload value and interrupts on the zero rollover. + */ + am335x_dmtimer_et_write_4(sc, DMT_TLDR, 0xFFFFFFFF - reload_count); + am335x_dmtimer_et_write_4(sc, DMT_TCRR, 0xFFFFFFFF - initial_count); - /* enable overflow interrupt */ + /* Enable overflow interrupt, and start the timer. */ am335x_dmtimer_et_write_4(sc, DMT_IRQENABLE_SET, DMT_IRQ_OVF); - - /* start timer(ST) */ - tclr |= DMT_TCLR_START; - am335x_dmtimer_et_write_4(sc, DMT_TCLR, tclr); + sc->et_tclr |= DMT_TCLR_START; + am335x_dmtimer_et_write_4(sc, DMT_TCLR, sc->et_tclr); return (0); } @@ -224,12 +501,11 @@ am335x_dmtimer_stop(struct eventtimer *e sc = et->et_priv; - /* Disable all interrupts */ - am335x_dmtimer_et_write_4(sc, DMT_IRQENABLE_CLR, DMT_IRQ_MASK); - - /* Stop Timer */ - am335x_dmtimer_et_write_4(sc, DMT_TCLR, 0); - + /* Stop timer, disable and clear interrupt. */ + sc->et_tclr &= ~(DMT_TCLR_START | DMT_TCLR_AUTOLOAD); + am335x_dmtimer_et_write_4(sc, DMT_TCLR, sc->et_tclr); + am335x_dmtimer_et_write_4(sc, DMT_IRQENABLE_CLR, DMT_IRQ_OVF); + am335x_dmtimer_et_write_4(sc, DMT_IRQSTATUS, DMT_IRQ_OVF); return (0); } @@ -239,7 +515,8 @@ am335x_dmtimer_intr(void *arg) struct am335x_dmtimer_softc *sc; sc = arg; - /* Ack interrupt */ + + /* Ack the interrupt, and invoke the callback if it's still enabled. */ am335x_dmtimer_et_write_4(sc, DMT_IRQSTATUS, DMT_IRQ_OVF); if (sc->et.et_active) sc->et.et_event_cb(&sc->et, sc->et.et_arg); @@ -300,51 +577,53 @@ am335x_dmtimer_attach(device_t dev) return (ENXIO); } - /* Configure DMTimer3 as eventtimer and DMTimer4 as timecounter. */ - sc->et_num = 3; - sc->tc_num = 2; + /* + * Use the default eventtimer. Let the PPS init routine decide which + * timer to use for the timecounter. + */ + sc->et_num = DEFAULT_ET_TIMER; + sc->tc_num = am335x_dmtimer_pps_init(dev, sc); + sc->et_memres = sc->tmr_mem_res[sc->et_num]; sc->tc_memres = sc->tmr_mem_res[sc->tc_num]; + /* Enable clocks and power on the chosen devices. */ err = ti_prcm_clk_set_source(DMTIMER0_CLK + sc->et_num, SYSCLK_CLK); err |= ti_prcm_clk_enable(DMTIMER0_CLK + sc->et_num); err |= ti_prcm_clk_set_source(DMTIMER0_CLK + sc->tc_num, SYSCLK_CLK); err |= ti_prcm_clk_enable(DMTIMER0_CLK + sc->tc_num); if (err) { - device_printf(dev, "Error: could not setup timer clock\n"); + device_printf(dev, "Error: could not enable timer clock\n"); return (ENXIO); } - /* Set up timecounter; register tc. */ + /* Setup eventtimer interrupt handler. */ + if (bus_setup_intr(dev, sc->tmr_irq_res[sc->et_num], INTR_TYPE_CLK, + am335x_dmtimer_intr, NULL, sc, &ihl) != 0) { + device_printf(dev, "Unable to setup the clock irq handler.\n"); + return (ENXIO); + } + + /* Set up timecounter, start it, register it. */ am335x_dmtimer_tc_write_4(sc, DMT_TSICR, DMT_TSICR_RESET); while (am335x_dmtimer_tc_read_4(sc, DMT_TIOCP_CFG) & DMT_TIOCP_RESET) continue; + sc->tc_tclr |= DMT_TCLR_START | DMT_TCLR_AUTOLOAD; am335x_dmtimer_tc_write_4(sc, DMT_TLDR, 0); am335x_dmtimer_tc_write_4(sc, DMT_TCRR, 0); - am335x_dmtimer_tc_write_4(sc, DMT_TCLR, - DMT_TCLR_START | DMT_TCLR_AUTOLOAD); + am335x_dmtimer_tc_write_4(sc, DMT_TCLR, sc->tc_tclr); sc->tc.tc_name = "AM335x Timecounter"; sc->tc.tc_get_timecount = am335x_dmtimer_tc_get_timecount; - sc->tc.tc_poll_pps = NULL; sc->tc.tc_counter_mask = ~0u; sc->tc.tc_frequency = sc->sysclk_freq; sc->tc.tc_quality = 1000; sc->tc.tc_priv = sc; tc_init(&sc->tc); - /* Setup eventtimer; register et. */ - if (bus_setup_intr(dev, sc->tmr_irq_res[sc->et_num], INTR_TYPE_CLK, - am335x_dmtimer_intr, NULL, sc, &ihl) != 0) { - bus_release_resources(dev, am335x_dmtimer_irq_spec, - sc->tmr_irq_res); - device_printf(dev, "Unable to setup the clock irq handler.\n"); - return (ENXIO); - } - sc->et.et_name = "AM335x Eventtimer"; - sc->et.et_flags = ET_FLAGS_ONESHOT; + sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT; sc->et.et_quality = 1000; sc->et.et_frequency = sc->sysclk_freq; sc->et.et_min_period = From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 05:21:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 123D4B29; Tue, 13 May 2014 05:21: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 F3B362CA9; Tue, 13 May 2014 05:21: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 s4D5LsLa075164; Tue, 13 May 2014 05:21:54 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4D5LsG8075163; Tue, 13 May 2014 05:21:54 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405130521.s4D5LsG8075163@svn.freebsd.org> From: Alan Cox Date: Tue, 13 May 2014 05:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265944 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 05:21:55 -0000 Author: alc Date: Tue May 13 05:21:54 2014 New Revision: 265944 URL: http://svnweb.freebsd.org/changeset/base/265944 Log: MFC r260567 Correctly update the count of stuck pages, "addl_page_shortage", in vm_pageout_scan(). There were missing increments in two less common cases. Don't conflate the count of stuck pages and the pageout deficit provided by vm_page_alloc{,_contig}(). Handle held pages consistently in the inactive queue scan. In the more common case, we did not move the page to the tail of the queue. Whereas, in the less common case, we did. There's no particular reason to move the page in the less common case, so remove it. Perform the calculation of the page shortage for the active queue scan a little earlier, before the active queue lock is acquired. The correctness of this calculation doesn't depend on the active queue lock being held. Eliminate a redundant variable, "pcount". Use the more descriptive variable, "maxscan", in its place. Apply a few nearby style fixes, e.g., eliminate stray whitespace and excess parentheses. Modified: stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Tue May 13 05:19:29 2014 (r265943) +++ stable/10/sys/vm/vm_pageout.c Tue May 13 05:21:54 2014 (r265944) @@ -909,10 +909,8 @@ vm_pageout_scan(struct vm_domain *vmd, i { vm_page_t m, next; struct vm_pagequeue *pq; - int page_shortage, maxscan, pcount; - int addl_page_shortage; vm_object_t object; - int act_delta; + int act_delta, addl_page_shortage, deficit, maxscan, page_shortage; int vnodes_skipped = 0; int maxlaunder; int lockmode; @@ -942,13 +940,15 @@ vm_pageout_scan(struct vm_domain *vmd, i * number of pages from the inactive count that should be * discounted in setting the target for the active queue scan. */ - addl_page_shortage = atomic_readandclear_int(&vm_pageout_deficit); + addl_page_shortage = 0; + + deficit = atomic_readandclear_int(&vm_pageout_deficit); /* * Calculate the number of pages we want to either free or move * to the cache. */ - page_shortage = vm_paging_target() + addl_page_shortage; + page_shortage = vm_paging_target() + deficit; /* * maxlaunder limits the number of dirty pages we flush per scan. @@ -1245,6 +1245,7 @@ vm_pageout_scan(struct vm_domain *vmd, i */ if (vm_page_busied(m)) { vm_page_unlock(m); + addl_page_shortage++; goto unlock_and_continue; } @@ -1252,9 +1253,9 @@ vm_pageout_scan(struct vm_domain *vmd, i * If the page has become held it might * be undergoing I/O, so skip it */ - if (m->hold_count) { + if (m->hold_count != 0) { vm_page_unlock(m); - vm_page_requeue_locked(m); + addl_page_shortage++; if (object->flags & OBJ_MIGHTBEDIRTY) vnodes_skipped++; goto unlock_and_continue; @@ -1309,19 +1310,20 @@ relock_queues: * Compute the number of pages we want to try to move from the * active queue to the inactive queue. */ + page_shortage = cnt.v_inactive_target - cnt.v_inactive_count + + vm_paging_target() + deficit + addl_page_shortage; + pq = &vmd->vmd_pagequeues[PQ_ACTIVE]; vm_pagequeue_lock(pq); - pcount = pq->pq_cnt; - page_shortage = vm_paging_target() + - cnt.v_inactive_target - cnt.v_inactive_count; - page_shortage += addl_page_shortage; + maxscan = pq->pq_cnt; + /* * If we're just idle polling attempt to visit every * active page within 'update_period' seconds. */ - if (pass == 0 && vm_pageout_update_period != 0) { - pcount /= vm_pageout_update_period; - page_shortage = pcount; + if (pass == 0 && vm_pageout_update_period != 0) { + maxscan /= vm_pageout_update_period; + page_shortage = maxscan; } /* @@ -1330,7 +1332,7 @@ relock_queues: * deactivation candidates. */ m = TAILQ_FIRST(&pq->pq_pl); - while ((m != NULL) && (pcount-- > 0) && (page_shortage > 0)) { + while (m != NULL && maxscan-- > 0 && page_shortage > 0) { KASSERT(m->queue == PQ_ACTIVE, ("vm_pageout_scan: page %p isn't active", m)); From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 05:26:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AAF80D51; Tue, 13 May 2014 05:26: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 7EF382CEF; Tue, 13 May 2014 05:26:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4D5Qhd3075846; Tue, 13 May 2014 05:26:43 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4D5Qh5f075845; Tue, 13 May 2014 05:26:43 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405130526.s4D5Qh5f075845@svn.freebsd.org> From: Alan Cox Date: Tue, 13 May 2014 05:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265945 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 05:26:43 -0000 Author: alc Date: Tue May 13 05:26:43 2014 New Revision: 265945 URL: http://svnweb.freebsd.org/changeset/base/265945 Log: MFC r265418 Prior to r254304, a separate function, vm_pageout_page_stats(), was used to periodically update the reference status of the active pages. This function was called, instead of vm_pageout_scan(), when memory was not scarce. The objective was to provide up to date reference status for active pages in case memory did become scarce and active pages needed to be deactivated. The active page queue scan performed by vm_pageout_page_stats() was virtually identical to that performed by vm_pageout_scan(), and so r254304 eliminated vm_pageout_page_stats(). Instead, vm_pageout_scan() is called with the parameter "pass" set to zero. The intention was that when pass is zero, vm_pageout_scan() would only scan the active queue. However, the variable page_shortage can still be greater than zero when memory is not scarce and vm_pageout_scan() is called with pass equal to zero. Consequently, the inactive queue may be scanned and dirty pages laundered even though that was not intended by r254304. This revision fixes that. Modified: stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Tue May 13 05:21:54 2014 (r265944) +++ stable/10/sys/vm/vm_pageout.c Tue May 13 05:26:43 2014 (r265945) @@ -942,13 +942,15 @@ vm_pageout_scan(struct vm_domain *vmd, i */ addl_page_shortage = 0; - deficit = atomic_readandclear_int(&vm_pageout_deficit); - /* * Calculate the number of pages we want to either free or move * to the cache. */ - page_shortage = vm_paging_target() + deficit; + if (pass > 0) { + deficit = atomic_readandclear_int(&vm_pageout_deficit); + page_shortage = vm_paging_target() + deficit; + } else + page_shortage = deficit = 0; /* * maxlaunder limits the number of dirty pages we flush per scan. From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 05:32:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C8F28EBC; Tue, 13 May 2014 05:32:40 +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 89B912D78; Tue, 13 May 2014 05:32:40 +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 0CAC4783F63; Tue, 13 May 2014 15:32:32 +1000 (EST) Date: Tue, 13 May 2014 15:32:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov Subject: Re: svn commit: r265901 - stable/10/sys/kern In-Reply-To: <5371081A.2070703@freebsd.org> Message-ID: <20140513150452.R2958@besplex.bde.org> References: <201405120427.s4C4RAZf093033@svn.freebsd.org> <5370F110.5050502@freebsd.org> <20140512170322.GA2479@stack.nl> <5371081A.2070703@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=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=syaZHqrdBKwA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=i1eFTGOA1oohQBZ4AMsA:9 a=g5t_JHQO4ZTDTcVu:21 a=hJ3xz1m3iuSP41rW:21 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, svn-src-stable-10@freebsd.org, Jilles Tjoelker , svn-src-stable@freebsd.org, Don Lewis , svn-src-all@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 05:32:40 -0000 On Mon, 12 May 2014, Andrey Chernov wrote: > On 12.05.2014 21:03, Jilles Tjoelker wrote: >> On Mon, May 12, 2014 at 08:04:32PM +0400, Andrey Chernov wrote: >>> On 12.05.2014 8:27, Don Lewis wrote: >>>> + if (start + amask < start) { >>>> + DPRINTF(("start+amask wrapped around\n")); >>>> + goto out; >>>> + } >> >>> Checking for overflow _after_ it happens is unportable and dangerous, >>> since wrapping around is not only one possible result. They should be >>> rewritten like that: >> >>> if (start > ULONG_MAX - amask) >> >> Unsigned types wrap around per the C standard. Overflow checking after >> it happens is fine. >> >> You are right for signed types. > > You are right. The C Standard, 6.2.5, paragraph 9 [ISO/IEC 9899:2011], > states: Actually, there is a problem with promotions. The rman code is correct, since all the types are hard-coded as u_long (even correctly spelled as that), so we know that the promotions don't expand them. (Expansion would allow start + amask to hold a larger value, and would also change the type to signed.) Similar code in vm is technically broken, since the types are are usually vm_offset_t and that can be anything in theory. It might be u_char or u_short. Both normally promote to int. POSIX requires u_char to be 8 bits, so it is always too small for vm_offset_t, but u_short can be large enough (e.g., u_short 64 bits, u_int 65 bits, u_long 130 bits, u_long_long 260 bits, uintmax_t 520 bits for a machine with a 64-bit address space but 65-bit registers :-). > "A computation involving unsigned operands can never overflow, because a > result that cannot be represented by the resulting unsigned integer type > is reduced modulo the number that is one greater than the largest value > that can be represented by the resulting type." This is bad wording, since the "resulting type" isn't always unsigned unless "unsigned operands" is interpreted as "operands, which are unsigned after promotion". Similar code in vm: % int % sys_mmap(td, uap) % ... % vm_offset_t addr; % ... % vm_size_t size, pageoff; % ... % if (addr + size < addr) % return (EINVAL); Here addr and size have logically different types, so they might have quite different promotitions (largest wins). Typedefs are too hard for me. Rewriting this using (__maxof(__typeof(foo)) - foo) (where foo is one of the operands in the addition) works well here too. Bruce From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 06:05:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3C44F36B; Tue, 13 May 2014 06:05: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 273AE2FA4; Tue, 13 May 2014 06:05: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 s4D65t70092989; Tue, 13 May 2014 06:05:55 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4D65rsn092973; Tue, 13 May 2014 06:05:53 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201405130605.s4D65rsn092973@svn.freebsd.org> From: Kevin Lo Date: Tue, 13 May 2014 06:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265946 - in stable/10: lib/libc/net sys/netinet sys/netinet6 sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 06:05:56 -0000 Author: kevlo Date: Tue May 13 06:05:53 2014 New Revision: 265946 URL: http://svnweb.freebsd.org/changeset/base/265946 Log: MFC r264212,r264213,r264248,r265776,r265811,r265909: - Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. Tested with vlc and a test suite [1]. [1] http://www.erg.abdn.ac.uk/~gerrit/udp-lite/files/udplite_linux.tar.gz Reviewed by: jhb, glebius, adrian - Fix a logic bug which prevented the sending of UDP packet with 0 checksum. - Disable TX checksum offload for UDP-Lite completely. It wasn't used for partial checksum coverage, but even for full checksum coverage it doesn't work. Added: stable/10/sys/netinet/udplite.h - copied unchanged from r264212, head/sys/netinet/udplite.h Modified: stable/10/lib/libc/net/getaddrinfo.c stable/10/sys/netinet/in.c stable/10/sys/netinet/in.h stable/10/sys/netinet/in_pcb.c stable/10/sys/netinet/in_proto.c stable/10/sys/netinet/udp_usrreq.c stable/10/sys/netinet/udp_var.h stable/10/sys/netinet6/in6_ifattach.c stable/10/sys/netinet6/in6_proto.c stable/10/sys/netinet6/udp6_usrreq.c stable/10/sys/netinet6/udp6_var.h stable/10/sys/sys/param.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Tue May 13 05:26:43 2014 (r265945) +++ stable/10/lib/libc/net/getaddrinfo.c Tue May 13 06:05:53 2014 (r265946) @@ -170,12 +170,14 @@ static const struct explore explore[] = { PF_INET6, SOCK_STREAM, IPPROTO_TCP, 0x07 }, { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, 0x03 }, { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 }, + { PF_INET6, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 }, { PF_INET6, SOCK_RAW, ANY, 0x05 }, #endif { PF_INET, SOCK_DGRAM, IPPROTO_UDP, 0x07 }, { PF_INET, SOCK_STREAM, IPPROTO_TCP, 0x07 }, { PF_INET, SOCK_STREAM, IPPROTO_SCTP, 0x03 }, { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 }, + { PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 }, { PF_INET, SOCK_RAW, ANY, 0x05 }, { -1, 0, 0, 0 }, }; @@ -1477,6 +1479,9 @@ get_port(struct addrinfo *ai, const char case IPPROTO_SCTP: proto = "sctp"; break; + case IPPROTO_UDPLITE: + proto = "udplite"; + break; default: proto = NULL; break; Modified: stable/10/sys/netinet/in.c ============================================================================== --- stable/10/sys/netinet/in.c Tue May 13 05:26:43 2014 (r265945) +++ stable/10/sys/netinet/in.c Tue May 13 06:05:53 2014 (r265946) @@ -1167,6 +1167,7 @@ in_ifdetach(struct ifnet *ifp) in_pcbpurgeif0(&V_ripcbinfo, ifp); in_pcbpurgeif0(&V_udbinfo, ifp); + in_pcbpurgeif0(&V_ulitecbinfo, ifp); in_purgemaddrs(ifp); } Modified: stable/10/sys/netinet/in.h ============================================================================== --- stable/10/sys/netinet/in.h Tue May 13 05:26:43 2014 (r265945) +++ stable/10/sys/netinet/in.h Tue May 13 06:05:53 2014 (r265946) @@ -237,12 +237,17 @@ __END_DECLS #define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */ #define IPPROTO_SCTP 132 /* SCTP */ #define IPPROTO_MH 135 /* IPv6 Mobility Header */ +#define IPPROTO_UDPLITE 136 /* UDP-Lite */ +#define IPPROTO_HIP 139 /* IP6 Host Identity Protocol */ +#define IPPROTO_SHIM6 140 /* IP6 Shim6 Protocol */ /* 101-254: Partly Unassigned */ #define IPPROTO_PIM 103 /* Protocol Independent Mcast */ #define IPPROTO_CARP 112 /* CARP */ #define IPPROTO_PGM 113 /* PGM */ #define IPPROTO_MPLS 137 /* MPLS-in-IP */ #define IPPROTO_PFSYNC 240 /* PFSYNC */ +#define IPPROTO_RESERVED_253 253 /* Reserved */ +#define IPPROTO_RESERVED_254 254 /* Reserved */ /* 255: Reserved */ /* BSD Private, local use, namespace incursion, no longer used */ #define IPPROTO_OLD_DIVERT 254 /* OLD divert pseudo-proto */ Modified: stable/10/sys/netinet/in_pcb.c ============================================================================== --- stable/10/sys/netinet/in_pcb.c Tue May 13 05:26:43 2014 (r265945) +++ stable/10/sys/netinet/in_pcb.c Tue May 13 06:05:53 2014 (r265946) @@ -386,13 +386,14 @@ in_pcb_lport(struct inpcb *inp, struct i lastport = &pcbinfo->ipi_lastport; } /* - * For UDP, use random port allocation as long as the user + * For UDP(-Lite), use random port allocation as long as the user * allows it. For TCP (and as of yet unknown) connections, * use random port allocation only if the user allows it AND * ipport_tick() allows it. */ if (V_ipport_randomized && - (!V_ipport_stoprandom || pcbinfo == &V_udbinfo)) + (!V_ipport_stoprandom || pcbinfo == &V_udbinfo || + pcbinfo == &V_ulitecbinfo)) dorandom = 1; else dorandom = 0; @@ -402,8 +403,8 @@ in_pcb_lport(struct inpcb *inp, struct i */ if (first == last) dorandom = 0; - /* Make sure to not include UDP packets in the count. */ - if (pcbinfo != &V_udbinfo) + /* Make sure to not include UDP(-Lite) packets in the count. */ + if (pcbinfo != &V_udbinfo || pcbinfo != &V_ulitecbinfo) V_ipport_tcpallocs++; /* * Instead of having two loops further down counting up or down Modified: stable/10/sys/netinet/in_proto.c ============================================================================== --- stable/10/sys/netinet/in_proto.c Tue May 13 05:26:43 2014 (r265945) +++ stable/10/sys/netinet/in_proto.c Tue May 13 06:05:53 2014 (r265946) @@ -184,6 +184,20 @@ struct protosw inetsw[] = { }, #endif /* SCTP */ { + .pr_type = SOCK_DGRAM, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_UDPLITE, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = udp_input, + .pr_ctlinput = udplite_ctlinput, + .pr_ctloutput = udp_ctloutput, + .pr_init = udplite_init, +#ifdef VIMAGE + .pr_destroy = udplite_destroy, +#endif + .pr_usrreqs = &udp_usrreqs +}, +{ .pr_type = SOCK_RAW, .pr_domain = &inetdomain, .pr_protocol = IPPROTO_RAW, Modified: stable/10/sys/netinet/udp_usrreq.c ============================================================================== --- stable/10/sys/netinet/udp_usrreq.c Tue May 13 05:26:43 2014 (r265945) +++ stable/10/sys/netinet/udp_usrreq.c Tue May 13 06:05:53 2014 (r265946) @@ -3,6 +3,7 @@ * The Regents of the University of California. * Copyright (c) 2008 Robert N. M. Watson * Copyright (c) 2010-2011 Juniper Networks, Inc. + * Copyright (c) 2014 Kevin Lo * All rights reserved. * * Portions of this software were developed by Robert N. M. Watson under @@ -87,6 +88,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #ifdef IPSEC #include @@ -98,8 +100,9 @@ __FBSDID("$FreeBSD$"); #include /* - * UDP protocol implementation. + * UDP and UDP-Lite protocols implementation. * Per RFC 768, August, 1980. + * Per RFC 3828, July, 2004. */ /* @@ -139,6 +142,8 @@ SYSCTL_ULONG(_net_inet_udp, UDPCTL_RECVS VNET_DEFINE(struct inpcbhead, udb); /* from udp_var.h */ VNET_DEFINE(struct inpcbinfo, udbinfo); +VNET_DEFINE(struct inpcbhead, ulitecb); +VNET_DEFINE(struct inpcbinfo, ulitecbinfo); static VNET_DEFINE(uma_zone_t, udpcb_zone); #define V_udpcb_zone VNET(udpcb_zone) @@ -187,6 +192,16 @@ udp_inpcb_init(void *mem, int size, int return (0); } +static int +udplite_inpcb_init(void *mem, int size, int flags) +{ + struct inpcb *inp; + + inp = mem; + INP_LOCK_INIT(inp, "inp", "udpliteinp"); + return (0); +} + void udp_init(void) { @@ -202,6 +217,15 @@ udp_init(void) EVENTHANDLER_PRI_ANY); } +void +udplite_init(void) +{ + + in_pcbinfo_init(&V_ulitecbinfo, "udplite", &V_ulitecb, UDBHASHSIZE, + UDBHASHSIZE, "udplite_inpcb", udplite_inpcb_init, NULL, + UMA_ZONE_NOFREE, IPI_HASHFIELDS_2TUPLE); +} + /* * Kernel module interface for updating udpstat. The argument is an index * into udpstat treated as an array of u_long. While this encodes the @@ -243,6 +267,13 @@ udp_destroy(void) in_pcbinfo_destroy(&V_udbinfo); uma_zdestroy(V_udpcb_zone); } + +void +udplite_destroy(void) +{ + + in_pcbinfo_destroy(&V_ulitecbinfo); +} #endif #ifdef INET @@ -346,9 +377,12 @@ udp_input(struct mbuf *m, int off) struct ifnet *ifp; struct inpcb *inp; uint16_t len, ip_len; + struct inpcbinfo *pcbinfo; struct ip save_ip; struct sockaddr_in udp_in; struct m_tag *fwd_tag; + int cscov_partial; + uint8_t pr; ifp = m->m_pkthdr.rcvif; UDPSTAT_INC(udps_ipackets); @@ -368,13 +402,15 @@ udp_input(struct mbuf *m, int off) */ ip = mtod(m, struct ip *); if (m->m_len < iphlen + sizeof(struct udphdr)) { - if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == 0) { + if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == NULL) { UDPSTAT_INC(udps_hdrops); return; } ip = mtod(m, struct ip *); } uh = (struct udphdr *)((caddr_t)ip + iphlen); + pr = ip->ip_p; + cscov_partial = (pr == IPPROTO_UDPLITE) ? 1 : 0; /* * Destination port of 0 is illegal, based on RFC768. @@ -398,12 +434,18 @@ udp_input(struct mbuf *m, int off) */ len = ntohs((u_short)uh->uh_ulen); ip_len = ntohs(ip->ip_len) - iphlen; + if (pr == IPPROTO_UDPLITE && len == 0) { + /* Zero means checksum over the complete packet. */ + len = ip_len; + cscov_partial = 0; + } if (ip_len != len) { if (len > ip_len || len < sizeof(struct udphdr)) { UDPSTAT_INC(udps_badlen); goto badunlocked; } - m_adj(m, len - ip_len); + if (pr == IPPROTO_UDP) + m_adj(m, len - ip_len); } /* @@ -421,20 +463,22 @@ udp_input(struct mbuf *m, int off) if (uh->uh_sum) { u_short uh_sum; - if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if ((m->m_pkthdr.csum_flags & CSUM_DATA_VALID) && + !cscov_partial) { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) uh_sum = m->m_pkthdr.csum_data; else uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htonl((u_short)len + - m->m_pkthdr.csum_data + IPPROTO_UDP)); + m->m_pkthdr.csum_data + pr)); uh_sum ^= 0xffff; } else { char b[9]; bcopy(((struct ipovly *)ip)->ih_x1, b, 9); bzero(((struct ipovly *)ip)->ih_x1, 9); - ((struct ipovly *)ip)->ih_len = uh->uh_ulen; + ((struct ipovly *)ip)->ih_len = (pr == IPPROTO_UDP) ? + uh->uh_ulen : htons(ip_len); uh_sum = in_cksum(m, len + sizeof (struct ip)); bcopy(b, ((struct ipovly *)ip)->ih_x1, 9); } @@ -446,14 +490,17 @@ udp_input(struct mbuf *m, int off) } else UDPSTAT_INC(udps_nosum); + pcbinfo = get_inpcbinfo(pr); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || in_broadcast(ip->ip_dst, ifp)) { struct inpcb *last; + struct inpcbhead *pcblist; struct ip_moptions *imo; - INP_INFO_RLOCK(&V_udbinfo); + INP_INFO_RLOCK(pcbinfo); + pcblist = get_pcblist(pr); last = NULL; - LIST_FOREACH(inp, &V_udb, inp_list) { + LIST_FOREACH(inp, pcblist, inp_list) { if (inp->inp_lport != uh->uh_dport) continue; #ifdef INET6 @@ -539,12 +586,12 @@ udp_input(struct mbuf *m, int off) UDPSTAT_INC(udps_noportbcast); if (inp) INP_RUNLOCK(inp); - INP_INFO_RUNLOCK(&V_udbinfo); + INP_INFO_RUNLOCK(pcbinfo); goto badunlocked; } udp_append(last, ip, m, iphlen, &udp_in); INP_RUNLOCK(last); - INP_INFO_RUNLOCK(&V_udbinfo); + INP_INFO_RUNLOCK(pcbinfo); return; } @@ -565,7 +612,7 @@ udp_input(struct mbuf *m, int off) * Transparently forwarded. Pretend to be the destination. * Already got one like this? */ - inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport, + inp = in_pcblookup_mbuf(pcbinfo, ip->ip_src, uh->uh_sport, ip->ip_dst, uh->uh_dport, INPLOOKUP_RLOCKPCB, ifp, m); if (!inp) { /* @@ -573,7 +620,7 @@ udp_input(struct mbuf *m, int off) * Because we've rewritten the destination address, * any hardware-generated hash is ignored. */ - inp = in_pcblookup(&V_udbinfo, ip->ip_src, + inp = in_pcblookup(pcbinfo, ip->ip_src, uh->uh_sport, next_hop->sin_addr, next_hop->sin_port ? htons(next_hop->sin_port) : uh->uh_dport, INPLOOKUP_WILDCARD | @@ -583,7 +630,7 @@ udp_input(struct mbuf *m, int off) m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; } else - inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport, + inp = in_pcblookup_mbuf(pcbinfo, ip->ip_src, uh->uh_sport, ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, ifp, m); if (inp == NULL) { @@ -619,6 +666,16 @@ udp_input(struct mbuf *m, int off) m_freem(m); return; } + if (cscov_partial) { + struct udpcb *up; + + up = intoudpcb(inp); + if (up->u_rxcslen > len) { + INP_RUNLOCK(inp); + m_freem(m); + return; + } + } UDP_PROBE(receive, NULL, inp, ip, inp, uh); udp_append(inp, ip, m, iphlen, &udp_in); @@ -653,8 +710,9 @@ udp_notify(struct inpcb *inp, int errno) } #ifdef INET -void -udp_ctlinput(int cmd, struct sockaddr *sa, void *vip) +static void +udp_common_ctlinput(int cmd, struct sockaddr *sa, void *vip, + struct inpcbinfo *pcbinfo) { struct ip *ip = vip; struct udphdr *uh; @@ -683,7 +741,7 @@ udp_ctlinput(int cmd, struct sockaddr *s return; if (ip != NULL) { uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2)); - inp = in_pcblookup(&V_udbinfo, faddr, uh->uh_dport, + inp = in_pcblookup(pcbinfo, faddr, uh->uh_dport, ip->ip_src, uh->uh_sport, INPLOOKUP_RLOCKPCB, NULL); if (inp != NULL) { INP_RLOCK_ASSERT(inp); @@ -693,9 +751,22 @@ udp_ctlinput(int cmd, struct sockaddr *s INP_RUNLOCK(inp); } } else - in_pcbnotifyall(&V_udbinfo, faddr, inetctlerrmap[cmd], + in_pcbnotifyall(pcbinfo, faddr, inetctlerrmap[cmd], udp_notify); } +void +udp_ctlinput(int cmd, struct sockaddr *sa, void *vip) +{ + + return (udp_common_ctlinput(cmd, sa, vip, &V_udbinfo)); +} + +void +udplite_ctlinput(int cmd, struct sockaddr *sa, void *vip) +{ + + return (udp_common_ctlinput(cmd, sa, vip, &V_ulitecbinfo)); +} #endif /* INET */ static int @@ -851,16 +922,16 @@ SYSCTL_PROC(_net_inet_udp, OID_AUTO, get int udp_ctloutput(struct socket *so, struct sockopt *sopt) { - int error = 0, optval; struct inpcb *inp; -#ifdef IPSEC_NAT_T struct udpcb *up; -#endif + int isudplite, error, optval; + error = 0; + isudplite = (so->so_proto->pr_protocol == IPPROTO_UDPLITE) ? 1 : 0; inp = sotoinpcb(so); KASSERT(inp != NULL, ("%s: inp == NULL", __func__)); INP_WLOCK(inp); - if (sopt->sopt_level != IPPROTO_UDP) { + if (sopt->sopt_level != so->so_proto->pr_protocol) { #ifdef INET6 if (INP_CHECK_SOCKAF(so, AF_INET6)) { INP_WUNLOCK(inp); @@ -918,6 +989,34 @@ udp_ctloutput(struct socket *so, struct } INP_WUNLOCK(inp); break; + case UDPLITE_SEND_CSCOV: + case UDPLITE_RECV_CSCOV: + if (!isudplite) { + INP_WUNLOCK(inp); + error = ENOPROTOOPT; + break; + } + INP_WUNLOCK(inp); + error = sooptcopyin(sopt, &optval, sizeof(optval), + sizeof(optval)); + if (error != 0) + break; + inp = sotoinpcb(so); + KASSERT(inp != NULL, ("%s: inp == NULL", __func__)); + INP_WLOCK(inp); + up = intoudpcb(inp); + KASSERT(up != NULL, ("%s: up == NULL", __func__)); + if (optval != 0 && optval < 8) { + INP_WUNLOCK(inp); + error = EINVAL; + break; + } + if (sopt->sopt_name == UDPLITE_SEND_CSCOV) + up->u_txcslen = optval; + else + up->u_rxcslen = optval; + INP_WUNLOCK(inp); + break; default: INP_WUNLOCK(inp); error = ENOPROTOOPT; @@ -935,6 +1034,22 @@ udp_ctloutput(struct socket *so, struct error = sooptcopyout(sopt, &optval, sizeof optval); break; #endif + case UDPLITE_SEND_CSCOV: + case UDPLITE_RECV_CSCOV: + if (!isudplite) { + INP_WUNLOCK(inp); + error = ENOPROTOOPT; + break; + } + up = intoudpcb(inp); + KASSERT(up != NULL, ("%s: up == NULL", __func__)); + if (sopt->sopt_name == UDPLITE_SEND_CSCOV) + optval = up->u_txcslen; + else + optval = up->u_rxcslen; + INP_WUNLOCK(inp); + error = sooptcopyout(sopt, &optval, sizeof(optval)); + break; default: INP_WUNLOCK(inp); error = ENOPROTOOPT; @@ -957,12 +1072,16 @@ udp_output(struct inpcb *inp, struct mbu int len = m->m_pkthdr.len; struct in_addr faddr, laddr; struct cmsghdr *cm; + struct inpcbinfo *pcbinfo; struct sockaddr_in *sin, src; + int cscov_partial = 0; int error = 0; int ipflags; u_short fport, lport; int unlock_udbinfo; u_char tos; + uint8_t pr; + uint16_t cscov = 0; /* * udp_output() may need to temporarily bind or connect the current @@ -1057,12 +1176,14 @@ udp_output(struct inpcb *inp, struct mbu * * XXXRW: Check that hash locking update here is correct. */ + pr = inp->inp_socket->so_proto->pr_protocol; + pcbinfo = get_inpcbinfo(pr); sin = (struct sockaddr_in *)addr; if (sin != NULL && (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { INP_RUNLOCK(inp); INP_WLOCK(inp); - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); unlock_udbinfo = UH_WLOCKED; } else if ((sin != NULL && ( (sin->sin_addr.s_addr == INADDR_ANY) || @@ -1070,7 +1191,7 @@ udp_output(struct inpcb *inp, struct mbu (inp->inp_laddr.s_addr == INADDR_ANY) || (inp->inp_lport == 0))) || (src.sin_family == AF_INET)) { - INP_HASH_RLOCK(&V_udbinfo); + INP_HASH_RLOCK(pcbinfo); unlock_udbinfo = UH_RLOCKED; } else unlock_udbinfo = UH_UNLOCKED; @@ -1083,7 +1204,7 @@ udp_output(struct inpcb *inp, struct mbu laddr = inp->inp_laddr; lport = inp->inp_lport; if (src.sin_family == AF_INET) { - INP_HASH_LOCK_ASSERT(&V_udbinfo); + INP_HASH_LOCK_ASSERT(pcbinfo); if ((lport == 0) || (laddr.s_addr == INADDR_ANY && src.sin_addr.s_addr == INADDR_ANY)) { @@ -1134,7 +1255,7 @@ udp_output(struct inpcb *inp, struct mbu inp->inp_lport == 0 || sin->sin_addr.s_addr == INADDR_ANY || sin->sin_addr.s_addr == INADDR_BROADCAST) { - INP_HASH_LOCK_ASSERT(&V_udbinfo); + INP_HASH_LOCK_ASSERT(pcbinfo); error = in_pcbconnect_setup(inp, addr, &laddr.s_addr, &lport, &faddr.s_addr, &fport, NULL, td->td_ucred); @@ -1149,7 +1270,7 @@ udp_output(struct inpcb *inp, struct mbu if (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0) { INP_WLOCK_ASSERT(inp); - INP_HASH_WLOCK_ASSERT(&V_udbinfo); + INP_HASH_WLOCK_ASSERT(pcbinfo); /* * Remember addr if jailed, to prevent * rebinding. @@ -1198,13 +1319,30 @@ udp_output(struct inpcb *inp, struct mbu */ ui = mtod(m, struct udpiphdr *); bzero(ui->ui_x1, sizeof(ui->ui_x1)); /* XXX still needed? */ - ui->ui_v = IPVERSION << 4; - ui->ui_pr = IPPROTO_UDP; + ui->ui_pr = pr; ui->ui_src = laddr; ui->ui_dst = faddr; ui->ui_sport = lport; ui->ui_dport = fport; ui->ui_ulen = htons((u_short)len + sizeof(struct udphdr)); + if (pr == IPPROTO_UDPLITE) { + struct udpcb *up; + uint16_t plen; + + up = intoudpcb(inp); + cscov = up->u_txcslen; + plen = (u_short)len + sizeof(struct udphdr); + if (cscov >= plen) + cscov = 0; + ui->ui_len = htons(plen); + ui->ui_ulen = htons(cscov); + /* + * For UDP-Lite, checksum coverage length of zero means + * the entire UDPLite packet is covered by the checksum. + */ + cscov_partial = (cscov == 0) ? 0 : 1; + } else + ui->ui_v = IPVERSION << 4; /* * Set the Don't Fragment bit in the IP header. @@ -1231,24 +1369,34 @@ udp_output(struct inpcb *inp, struct mbu /* * Set up checksum and output datagram. */ - if (V_udp_cksum) { + ui->ui_sum = 0; + if (pr == IPPROTO_UDPLITE) { + if (inp->inp_flags & INP_ONESBCAST) + faddr.s_addr = INADDR_BROADCAST; + if (cscov_partial) { + if ((ui->ui_sum = in_cksum(m, sizeof(struct ip) + cscov)) == 0) + ui->ui_sum = 0xffff; + } else { + if ((ui->ui_sum = in_cksum(m, sizeof(struct udpiphdr) + len)) == 0) + ui->ui_sum = 0xffff; + } + } else if (V_udp_cksum) { if (inp->inp_flags & INP_ONESBCAST) faddr.s_addr = INADDR_BROADCAST; ui->ui_sum = in_pseudo(ui->ui_src.s_addr, faddr.s_addr, - htons((u_short)len + sizeof(struct udphdr) + IPPROTO_UDP)); + htons((u_short)len + sizeof(struct udphdr) + pr)); m->m_pkthdr.csum_flags = CSUM_UDP; m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); - } else - ui->ui_sum = 0; + } ((struct ip *)ui)->ip_len = htons(sizeof(struct udpiphdr) + len); ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */ ((struct ip *)ui)->ip_tos = tos; /* XXX */ UDPSTAT_INC(udps_opackets); if (unlock_udbinfo == UH_WLOCKED) - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); else if (unlock_udbinfo == UH_RLOCKED) - INP_HASH_RUNLOCK(&V_udbinfo); + INP_HASH_RUNLOCK(pcbinfo); UDP_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u); error = ip_output(m, inp->inp_options, NULL, ipflags, inp->inp_moptions, inp); @@ -1260,10 +1408,10 @@ udp_output(struct inpcb *inp, struct mbu release: if (unlock_udbinfo == UH_WLOCKED) { - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); INP_WUNLOCK(inp); } else if (unlock_udbinfo == UH_RLOCKED) { - INP_HASH_RUNLOCK(&V_udbinfo); + INP_HASH_RUNLOCK(pcbinfo); INP_RUNLOCK(inp); } else INP_RUNLOCK(inp); @@ -1410,15 +1558,17 @@ static void udp_abort(struct socket *so) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_abort: inp == NULL")); INP_WLOCK(inp); if (inp->inp_faddr.s_addr != INADDR_ANY) { - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); in_pcbdisconnect(inp); inp->inp_laddr.s_addr = INADDR_ANY; - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); soisdisconnected(so); } INP_WUNLOCK(inp); @@ -1428,17 +1578,19 @@ static int udp_attach(struct socket *so, int proto, struct thread *td) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; int error; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp == NULL, ("udp_attach: inp != NULL")); error = soreserve(so, udp_sendspace, udp_recvspace); if (error) return (error); - INP_INFO_WLOCK(&V_udbinfo); - error = in_pcballoc(so, &V_udbinfo); + INP_INFO_WLOCK(pcbinfo); + error = in_pcballoc(so, pcbinfo); if (error) { - INP_INFO_WUNLOCK(&V_udbinfo); + INP_INFO_WUNLOCK(pcbinfo); return (error); } @@ -1450,12 +1602,12 @@ udp_attach(struct socket *so, int proto, if (error) { in_pcbdetach(inp); in_pcbfree(inp); - INP_INFO_WUNLOCK(&V_udbinfo); + INP_INFO_WUNLOCK(pcbinfo); return (error); } INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_udbinfo); + INP_INFO_WUNLOCK(pcbinfo); return (0); } #endif /* INET */ @@ -1486,14 +1638,16 @@ static int udp_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; int error; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_bind: inp == NULL")); INP_WLOCK(inp); - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); error = in_pcbbind(inp, nam, td->td_ucred); - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); INP_WUNLOCK(inp); return (error); } @@ -1502,15 +1656,17 @@ static void udp_close(struct socket *so) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_close: inp == NULL")); INP_WLOCK(inp); if (inp->inp_faddr.s_addr != INADDR_ANY) { - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); in_pcbdisconnect(inp); inp->inp_laddr.s_addr = INADDR_ANY; - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); soisdisconnected(so); } INP_WUNLOCK(inp); @@ -1520,9 +1676,11 @@ static int udp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { struct inpcb *inp; - int error; + struct inpcbinfo *pcbinfo; struct sockaddr_in *sin; + int error; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_connect: inp == NULL")); INP_WLOCK(inp); @@ -1536,9 +1694,9 @@ udp_connect(struct socket *so, struct so INP_WUNLOCK(inp); return (error); } - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); error = in_pcbconnect(inp, nam, td->td_ucred); - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); if (error == 0) soisconnected(so); INP_WUNLOCK(inp); @@ -1549,20 +1707,22 @@ static void udp_detach(struct socket *so) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; struct udpcb *up; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_detach: inp == NULL")); KASSERT(inp->inp_faddr.s_addr == INADDR_ANY, ("udp_detach: not disconnected")); - INP_INFO_WLOCK(&V_udbinfo); + INP_INFO_WLOCK(pcbinfo); INP_WLOCK(inp); up = intoudpcb(inp); KASSERT(up != NULL, ("%s: up == NULL", __func__)); inp->inp_ppcb = NULL; in_pcbdetach(inp); in_pcbfree(inp); - INP_INFO_WUNLOCK(&V_udbinfo); + INP_INFO_WUNLOCK(pcbinfo); udp_discardcb(up); } @@ -1570,7 +1730,9 @@ static int udp_disconnect(struct socket *so) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_disconnect: inp == NULL")); INP_WLOCK(inp); @@ -1578,10 +1740,10 @@ udp_disconnect(struct socket *so) INP_WUNLOCK(inp); return (ENOTCONN); } - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); in_pcbdisconnect(inp); inp->inp_laddr.s_addr = INADDR_ANY; - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); SOCK_LOCK(so); so->so_state &= ~SS_ISCONNECTED; /* XXX */ SOCK_UNLOCK(so); Modified: stable/10/sys/netinet/udp_var.h ============================================================================== --- stable/10/sys/netinet/udp_var.h Tue May 13 05:26:43 2014 (r265945) +++ stable/10/sys/netinet/udp_var.h Tue May 13 06:05:53 2014 (r265946) @@ -63,6 +63,8 @@ typedef void(*udp_tun_func_t)(struct mbu struct udpcb { udp_tun_func_t u_tun_func; /* UDP kernel tunneling callback. */ u_int u_flags; /* Generic UDP flags. */ + uint16_t u_rxcslen; /* Coverage for incoming datagrams. */ + uint16_t u_txcslen; /* Coverage for outgoing datagrams. */ }; #define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb) @@ -130,8 +132,12 @@ SYSCTL_DECL(_net_inet_udp); extern struct pr_usrreqs udp_usrreqs; VNET_DECLARE(struct inpcbhead, udb); VNET_DECLARE(struct inpcbinfo, udbinfo); +VNET_DECLARE(struct inpcbhead, ulitecb); +VNET_DECLARE(struct inpcbinfo, ulitecbinfo); #define V_udb VNET(udb) #define V_udbinfo VNET(udbinfo) +#define V_ulitecb VNET(ulitecb) +#define V_ulitecbinfo VNET(ulitecbinfo) extern u_long udp_sendspace; extern u_long udp_recvspace; @@ -141,20 +147,37 @@ VNET_DECLARE(int, udp_blackhole); #define V_udp_blackhole VNET(udp_blackhole) extern int udp_log_in_vain; -int udp_newudpcb(struct inpcb *); -void udp_discardcb(struct udpcb *); - -void udp_ctlinput(int, struct sockaddr *, void *); -int udp_ctloutput(struct socket *, struct sockopt *); -void udp_init(void); +static __inline struct inpcbinfo * +get_inpcbinfo(uint8_t protocol) +{ + return (protocol == IPPROTO_UDP) ? &V_udbinfo : &V_ulitecbinfo; +} + +static __inline struct inpcbhead * +get_pcblist(uint8_t protocol) +{ + return (protocol == IPPROTO_UDP) ? &V_udb : &V_ulitecb; +} + +int udp_newudpcb(struct inpcb *); +void udp_discardcb(struct udpcb *); + +void udp_ctlinput(int, struct sockaddr *, void *); +void udplite_ctlinput(int, struct sockaddr *, void *); +int udp_ctloutput(struct socket *, struct sockopt *); +void udp_init(void); +void udplite_init(void); #ifdef VIMAGE -void udp_destroy(void); +void udp_destroy(void); +void udplite_destroy(void); #endif -void udp_input(struct mbuf *, int); +void udp_input(struct mbuf *, int); +void udplite_input(struct mbuf *, int); struct inpcb *udp_notify(struct inpcb *inp, int errno); -int udp_shutdown(struct socket *so); +int udp_shutdown(struct socket *so); -int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f); -#endif +int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f); -#endif +#endif /* _KERNEL */ + +#endif /* _NETINET_UDP_VAR_H_ */ Copied: stable/10/sys/netinet/udplite.h (from r264212, head/sys/netinet/udplite.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/netinet/udplite.h Tue May 13 06:05:53 2014 (r265946, copy of r264212, head/sys/netinet/udplite.h) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2014, Kevin Lo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETINET_UDPLITE_H_ +#define _NETINET_UDPLITE_H_ + +/* + * User-settable options (used with setsockopt). + */ +#define UDPLITE_SEND_CSCOV 2 /* Sender checksum coverage. */ +#define UDPLITE_RECV_CSCOV 4 /* Receiver checksum coverage. */ + +#endif /* !_NETINET_UDPLITE_H_ */ Modified: stable/10/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/10/sys/netinet6/in6_ifattach.c Tue May 13 05:26:43 2014 (r265945) +++ stable/10/sys/netinet6/in6_ifattach.c Tue May 13 06:05:53 2014 (r265946) @@ -856,6 +856,7 @@ in6_ifdetach(struct ifnet *ifp) } in6_pcbpurgeif0(&V_udbinfo, ifp); + in6_pcbpurgeif0(&V_ulitecbinfo, ifp); in6_pcbpurgeif0(&V_ripcbinfo, ifp); /* leave from all multicast groups joined */ in6_purgemaddrs(ifp); Modified: stable/10/sys/netinet6/in6_proto.c ============================================================================== --- stable/10/sys/netinet6/in6_proto.c Tue May 13 05:26:43 2014 (r265945) +++ stable/10/sys/netinet6/in6_proto.c Tue May 13 06:05:53 2014 (r265946) @@ -207,13 +207,26 @@ struct ip6protosw inet6sw[] = { .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_WANTRCVD, .pr_input = sctp6_input, - .pr_ctlinput = sctp6_ctlinput, + .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_drain = sctp_drain, .pr_usrreqs = &sctp6_usrreqs }, #endif /* SCTP */ { + .pr_type = SOCK_DGRAM, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_UDPLITE, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = udp6_input, + .pr_ctlinput = udplite6_ctlinput, + .pr_ctloutput = udp_ctloutput, +#ifndef INET /* Do not call initialization twice. */ + .pr_init = udplite_init, +#endif + .pr_usrreqs = &udp6_usrreqs, +}, +{ .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_RAW, Modified: stable/10/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/10/sys/netinet6/udp6_usrreq.c Tue May 13 05:26:43 2014 (r265945) +++ stable/10/sys/netinet6/udp6_usrreq.c Tue May 13 06:05:53 2014 (r265946) @@ -1,6 +1,7 @@ /*- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (c) 2010-2011 Juniper Networks, Inc. + * Copyright (c) 2014 Kevin Lo * All rights reserved. * * Portions of this software were developed by Robert N. M. Watson under @@ -109,6 +110,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -181,12 +183,15 @@ udp6_input(struct mbuf **mp, int *offp, struct ip6_hdr *ip6; struct udphdr *uh; struct inpcb *inp; + struct inpcbinfo *pcbinfo; struct udpcb *up; int off = *offp; + int cscov_partial; int plen, ulen; struct sockaddr_in6 fromsa; struct m_tag *fwd_tag; uint16_t uh_sum; + uint8_t nxt; ifp = m->m_pkthdr.rcvif; ip6 = mtod(m, struct ip6_hdr *); @@ -218,6 +223,13 @@ udp6_input(struct mbuf **mp, int *offp, plen = ntohs(ip6->ip6_plen) - off + sizeof(*ip6); ulen = ntohs((u_short)uh->uh_ulen); + nxt = ip6->ip6_nxt; + cscov_partial = (nxt == IPPROTO_UDPLITE) ? 1 : 0; + if (nxt == IPPROTO_UDPLITE && ulen == 0) { + /* Zero means checksum over the complete packet. */ + ulen = plen; + cscov_partial = 0; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 06:09:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 112EA60A; Tue, 13 May 2014 06:09: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 F2F102FD9; Tue, 13 May 2014 06:09: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 s4D691YZ093527; Tue, 13 May 2014 06:09:01 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4D691ni093524; Tue, 13 May 2014 06:09:01 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201405130609.s4D691ni093524@svn.freebsd.org> From: Kevin Lo Date: Tue, 13 May 2014 06:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265947 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 06:09:02 -0000 Author: kevlo Date: Tue May 13 06:09:01 2014 New Revision: 265947 URL: http://svnweb.freebsd.org/changeset/base/265947 Log: MFC r264216, r265817, r265822: Add man page for udplite(4). Added: stable/10/share/man/man4/udplite.4 - copied, changed from r264215, head/share/man/man4/udplite.4 Modified: stable/10/share/man/man4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Tue May 13 06:05:53 2014 (r265946) +++ stable/10/share/man/man4/Makefile Tue May 13 06:09:01 2014 (r265947) @@ -511,6 +511,7 @@ MAN= aac.4 \ udav.4 \ udbp.4 \ udp.4 \ + udplite.4 \ uep.4 \ ufm.4 \ ufoma.4 \ Copied and modified: stable/10/share/man/man4/udplite.4 (from r264215, head/share/man/man4/udplite.4) ============================================================================== --- head/share/man/man4/udplite.4 Mon Apr 7 01:57:51 2014 (r264215, copy source) +++ stable/10/share/man/man4/udplite.4 Tue May 13 06:09:01 2014 (r265947) @@ -35,7 +35,7 @@ .In sys/socket.h .In netinet/udplite.h .Ft int -.Fn socket AF_INET SOCK_STREAM IPPROTO_UDPLITE +.Fn socket AF_INET SOCK_DGRAM IPPROTO_UDPLITE .Sh DESCRIPTION The .Tn UDP-Lite @@ -52,7 +52,7 @@ supports a number of socket options whic .Xr setsockopt 2 and tested with .Xr getsockopt 2 : -.Bl -tag -width ".Dv SCTP_SET_PEER_PRIMARY_ADDR" +.Bl -tag -width ".Dv UDPLITE_SEND_CSCOV" .It Dv UDPLITE_SEND_CSCOV This option sets the sender checksum coverage. A value of zero indicates that the entire packet From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 06:09:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 90353733; Tue, 13 May 2014 06:09:29 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 4E65C2FDC; Tue, 13 May 2014 06:09:28 +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 mail108.syd.optusnet.com.au (Postfix) with ESMTPS id C00C51A330E; Tue, 13 May 2014 16:09:21 +1000 (EST) Date: Tue, 13 May 2014 16:09:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Glen Barber Subject: Re: svn commit: r265917 - in stable/10: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce In-Reply-To: <20140512161817.GK1258@hub.FreeBSD.org> Message-ID: <20140513153541.S3047@besplex.bde.org> References: <201405121552.s4CFqnbX009177@svn.freebsd.org> <20140512161817.GK1258@hub.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=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=s01DRGYkj-EA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=84xCnt9HLjLxYQgaN1YA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org, David C Somayajulu X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 06:09:29 -0000 On Mon, 12 May 2014, Glen Barber wrote: > On Mon, May 12, 2014 at 03:52:49PM +0000, David C Somayajulu wrote: >> Log: >> MFC r265703 >> Modify Copyright information and other strings to reflect >> Qlogic Corporation's purchase of Broadcom's NetXtreme business. >> Added clean option to Makefile >> > >> Modified: stable/10/sys/modules/bce/Makefile >> ============================================================================== >> --- stable/10/sys/modules/bce/Makefile Mon May 12 14:46:32 2014 (r265916) >> +++ stable/10/sys/modules/bce/Makefile Mon May 12 15:52:49 2014 (r265917) >> @@ -5,4 +5,9 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii >> >> #CFLAGS += -DBCE_DEBUG=0 >> >> +clean: >> + rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms >> + rm -f *.o *.kld *.ko >> + rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h >> + >> .include > > Shouldn't these be listed in CLEANFILES ? Most of them already do. Most of them are automatically generated, and a small part of this is to put automatically generated files in CLEANFILES. The existence of the clean target is a larger bug. It defeats the default clean target which handles CLEANFILES and other things, but not all of the above. Some of them belong in the cleandir target. That is not defeated. Before this commit, the clean target did: % rm -f export_syms if_bce.ko if_bce.kld if_bce.o opt_bce.h miibus_if.h pci_if.h bus_if.h device_if.h miidevs.h and the cleandir target did this plus: % rm -f @ machine x86 % rm -f .depend GPATH GRTAGS GSYMS GTAGS % if [ -L /usr/src/sys/modules/bce/obj ]; then rm -f /usr/src/sys/modules/bce/obj; fi The new clean target does exactly the same as the old one plus a strict subset of the cleandir target, except: - it adds opt_budgerigar.h (sic), which apparently still is neither generated nor used by bce. - it removes *.o, *.kld and *.ko instead of if_bce.ko if_bce.kld if_bce.o. The default rule is careful to avoid using wildcards so as to not remove anything not generated by the makefile. Removing @, machine and x86 in clean instead of in cleandir is minor breakage. .depend and obj are still not removed in clean. Handling obj in a home made rule would be very difficult, since the obj dir can be almost anywhere (and not named obj) and it might be a directory instead of a symlink. Bruce From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 16:50:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 509F1E1E; Tue, 13 May 2014 16:50: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 3AB58291F; Tue, 13 May 2014 16:50: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 s4DGoCgc077248; Tue, 13 May 2014 16:50:12 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DGoBJK077239; Tue, 13 May 2014 16:50:11 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131650.s4DGoBJK077239@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 16:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265952 - in stable/10/sys: conf powerpc/aim powerpc/booke powerpc/mpc85xx powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 16:50:12 -0000 Author: ian Date: Tue May 13 16:50:10 2014 New Revision: 265952 URL: http://svnweb.freebsd.org/changeset/base/265952 Log: MFC r256792, r256793, r256799 (by nwhitehorn): Unify AIM and booke code. Added: stable/10/sys/powerpc/powerpc/clock.c - copied unchanged from r256793, head/sys/powerpc/powerpc/clock.c stable/10/sys/powerpc/powerpc/nexus.c - copied unchanged from r256799, head/sys/powerpc/powerpc/nexus.c stable/10/sys/powerpc/powerpc/vm_machdep.c - copied unchanged from r256792, head/sys/powerpc/powerpc/vm_machdep.c Deleted: stable/10/sys/powerpc/aim/clock.c stable/10/sys/powerpc/aim/nexus.c stable/10/sys/powerpc/aim/vm_machdep.c stable/10/sys/powerpc/booke/clock.c stable/10/sys/powerpc/booke/vm_machdep.c stable/10/sys/powerpc/mpc85xx/nexus.c Modified: stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/aim/machdep.c Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Tue May 13 16:40:27 2014 (r265951) +++ stable/10/sys/conf/files.powerpc Tue May 13 16:50:10 2014 (r265952) @@ -88,7 +88,6 @@ libkern/qdivrem.c optional powerpc libkern/ucmpdi2.c optional powerpc libkern/udivdi3.c optional powerpc libkern/umoddi3.c optional powerpc -powerpc/aim/clock.c optional aim powerpc/aim/copyinout.c optional aim powerpc/aim/interrupt.c optional aim powerpc/aim/locore.S optional aim no-obj @@ -98,14 +97,11 @@ powerpc/aim/mmu_oea64.c optional aim powerpc/aim/moea64_if.m optional aim powerpc/aim/moea64_native.c optional aim powerpc/aim/mp_cpudep.c optional aim -powerpc/aim/nexus.c optional aim powerpc/aim/slb.c optional aim powerpc64 powerpc/aim/swtch32.S optional aim powerpc powerpc/aim/swtch64.S optional aim powerpc64 powerpc/aim/trap.c optional aim powerpc/aim/uma_machdep.c optional aim -powerpc/aim/vm_machdep.c optional aim -powerpc/booke/clock.c optional booke powerpc/booke/copyinout.c optional booke powerpc/booke/interrupt.c optional booke powerpc/booke/locore.S optional booke no-obj @@ -116,7 +112,6 @@ powerpc/booke/platform_bare.c optional m powerpc/booke/pmap.c optional booke powerpc/booke/swtch.S optional booke powerpc/booke/trap.c optional booke -powerpc/booke/vm_machdep.c optional booke powerpc/cpufreq/dfs.c optional cpufreq powerpc/cpufreq/pcr.c optional cpufreq aim powerpc/cpufreq/pmufreq.c optional cpufreq aim pmu @@ -141,7 +136,6 @@ powerpc/mpc85xx/i2c.c optional iicbus f powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx -powerpc/mpc85xx/nexus.c optional mpc85xx powerpc/mpc85xx/pci_fdt.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_machdep.c standard @@ -184,6 +178,7 @@ powerpc/powerpc/autoconf.c standard powerpc/powerpc/bcopy.c standard powerpc/powerpc/bus_machdep.c standard powerpc/powerpc/busdma_machdep.c standard +powerpc/powerpc/clock.c standard powerpc/powerpc/copystr.c standard powerpc/powerpc/cpu.c standard powerpc/powerpc/db_disasm.c optional ddb @@ -203,6 +198,7 @@ powerpc/powerpc/iommu_if.m standard powerpc/powerpc/mem.c optional mem powerpc/powerpc/mmu_if.m standard powerpc/powerpc/mp_machdep.c optional smp +powerpc/powerpc/nexus.c standard powerpc/powerpc/openpic.c standard powerpc/powerpc/openpic_fdt.c optional fdt powerpc/powerpc/pic_if.m standard @@ -218,6 +214,7 @@ powerpc/powerpc/suswintr.c standard powerpc/powerpc/syncicache.c standard powerpc/powerpc/sys_machdep.c standard powerpc/powerpc/uio_machdep.c standard +powerpc/powerpc/vm_machdep.c standard powerpc/ps3/ehci_ps3.c optional ps3 ehci powerpc/ps3/ohci_ps3.c optional ps3 ohci powerpc/ps3/if_glc.c optional ps3 glc Modified: stable/10/sys/powerpc/aim/machdep.c ============================================================================== --- stable/10/sys/powerpc/aim/machdep.c Tue May 13 16:40:27 2014 (r265951) +++ stable/10/sys/powerpc/aim/machdep.c Tue May 13 16:50:10 2014 (r265952) @@ -647,14 +647,6 @@ cpu_flush_dcache(void *ptr, size_t len) /* TBD */ } -void -cpu_initclocks(void) -{ - - decr_tc_init(); - cpu_initclocks_bsp(); -} - /* * Shutdown the CPU as much as possible. */ Copied: stable/10/sys/powerpc/powerpc/clock.c (from r256793, head/sys/powerpc/powerpc/clock.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/powerpc/powerpc/clock.c Tue May 13 16:50:10 2014 (r265952, copy of r256793, head/sys/powerpc/powerpc/clock.c) @@ -0,0 +1,308 @@ +/*- + * Copyright (C) 1995, 1996 Wolfgang Solfrank. + * Copyright (C) 1995, 1996 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. + * + * $NetBSD: clock.c,v 1.9 2000/01/19 02:52:19 msaitoh Exp $ + */ +/* + * Copyright (C) 2001 Benno Rice. + * 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 Benno Rice ``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 TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +/* + * Initially we assume a processor with a bus frequency of 12.5 MHz. + */ +static int initialized = 0; +static u_long ns_per_tick = 80; +static u_long ticks_per_sec = 12500000; +static u_long *decr_counts[MAXCPU]; + +static int decr_et_start(struct eventtimer *et, + sbintime_t first, sbintime_t period); +static int decr_et_stop(struct eventtimer *et); +static timecounter_get_t decr_get_timecount; + +struct decr_state { + int mode; /* 0 - off, 1 - periodic, 2 - one-shot. */ + int32_t div; /* Periodic divisor. */ +}; +static DPCPU_DEFINE(struct decr_state, decr_state); + +static struct eventtimer decr_et; +static struct timecounter decr_tc = { + decr_get_timecount, /* get_timecount */ + 0, /* no poll_pps */ + ~0u, /* counter_mask */ + 0, /* frequency */ + "timebase" /* name */ +}; + +/* + * Decrementer interrupt handler. + */ +void +decr_intr(struct trapframe *frame) +{ + struct decr_state *s = DPCPU_PTR(decr_state); + int nticks = 0; + int32_t val; + + if (!initialized) + return; + + (*decr_counts[curcpu])++; + +#ifdef BOOKE + /* + * Interrupt handler must reset DIS to avoid getting another + * interrupt once EE is enabled. + */ + mtspr(SPR_TSR, TSR_DIS); +#endif + + if (s->mode == 1) { + /* + * Based on the actual time delay since the last decrementer + * reload, we arrange for earlier interrupt next time. + */ + __asm ("mfdec %0" : "=r"(val)); + while (val < 0) { + val += s->div; + nticks++; + } + mtdec(val); + } else if (s->mode == 2) { + nticks = 1; + decr_et_stop(NULL); + } + + while (nticks-- > 0) { + if (decr_et.et_active) + decr_et.et_event_cb(&decr_et, decr_et.et_arg); + } +} + +void +cpu_initclocks(void) +{ + + decr_tc_init(); + cpu_initclocks_bsp(); +} + +/* + * BSP early initialization. + */ +void +decr_init(void) +{ + struct cpuref cpu; + char buf[32]; + + /* + * Check the BSP's timebase frequency. Sometimes we can't find the BSP, so fall + * back to the first CPU in this case. + */ + if (platform_smp_get_bsp(&cpu) != 0) + platform_smp_first_cpu(&cpu); + ticks_per_sec = platform_timebase_freq(&cpu); + ns_per_tick = 1000000000 / ticks_per_sec; + + set_cputicker(mftb, ticks_per_sec, 0); + snprintf(buf, sizeof(buf), "cpu%d:decrementer", curcpu); + intrcnt_add(buf, &decr_counts[curcpu]); + decr_et_stop(NULL); + initialized = 1; +} + +#ifdef SMP +/* + * AP early initialization. + */ +void +decr_ap_init(void) +{ + char buf[32]; + + snprintf(buf, sizeof(buf), "cpu%d:decrementer", curcpu); + intrcnt_add(buf, &decr_counts[curcpu]); + decr_et_stop(NULL); +} +#endif + +/* + * Final initialization. + */ +void +decr_tc_init(void) +{ + + decr_tc.tc_frequency = ticks_per_sec; + tc_init(&decr_tc); + decr_et.et_name = "decrementer"; + decr_et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | + ET_FLAGS_PERCPU; + decr_et.et_quality = 1000; + decr_et.et_frequency = ticks_per_sec; + decr_et.et_min_period = (0x00000002LLU << 32) / ticks_per_sec; + decr_et.et_max_period = (0x7fffffffLLU << 32) / ticks_per_sec; + decr_et.et_start = decr_et_start; + decr_et.et_stop = decr_et_stop; + decr_et.et_priv = NULL; + et_register(&decr_et); +} + +/* + * Event timer start method. + */ +static int +decr_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) +{ + struct decr_state *s = DPCPU_PTR(decr_state); + uint32_t fdiv; +#ifdef BOOKE + uint32_t tcr; +#endif + + if (period != 0) { + s->mode = 1; + s->div = (decr_et.et_frequency * period) >> 32; + } else { + s->mode = 2; + s->div = 0; + } + if (first != 0) + fdiv = (decr_et.et_frequency * first) >> 32; + else + fdiv = s->div; + +#ifdef BOOKE + tcr = mfspr(SPR_TCR); + tcr |= TCR_DIE; + if (s->mode == 1) { + mtspr(SPR_DECAR, s->div); + tcr |= TCR_ARE; + } else + tcr &= ~TCR_ARE; + mtdec(fdiv); + mtspr(SPR_TCR, tcr); +#else + mtdec(fdiv); +#endif + + return (0); +} + +/* + * Event timer stop method. + */ +static int +decr_et_stop(struct eventtimer *et) +{ + struct decr_state *s = DPCPU_PTR(decr_state); +#ifdef BOOKE + uint32_t tcr; +#endif + + s->mode = 0; + s->div = 0x7fffffff; +#ifdef BOOKE + tcr = mfspr(SPR_TCR); + tcr &= ~(TCR_DIE | TCR_ARE); + mtspr(SPR_TCR, tcr); +#else + mtdec(s->div); +#endif + return (0); +} + +/* + * Timecounter get method. + */ +static unsigned +decr_get_timecount(struct timecounter *tc) +{ + return (mftb()); +} + +/* + * Wait for about n microseconds (at least!). + */ +void +DELAY(int n) +{ + u_quad_t tb, ttb; + + tb = mftb(); + ttb = tb + (n * 1000 + ns_per_tick - 1) / ns_per_tick; + while (tb < ttb) + tb = mftb(); +} + Copied: stable/10/sys/powerpc/powerpc/nexus.c (from r256799, head/sys/powerpc/powerpc/nexus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/powerpc/powerpc/nexus.c Tue May 13 16:50:10 2014 (r265952, copy of r256799, head/sys/powerpc/powerpc/nexus.c) @@ -0,0 +1,527 @@ +/*- + * Copyright 1998 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby + * granted, provided that both the above copyright notice and this + * permission notice appear in all copies, that both the above + * copyright notice and this permission notice appear in all + * supporting documentation, and that the name of M.I.T. not be used + * in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. M.I.T. makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS + * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + * SHALL M.I.T. 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. + */ +/*- + * Copyright 2001 by Thomas Moestl . 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. + * + * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include "ofw_bus_if.h" +#include "pic_if.h" + +/* + * The nexus (which is a pseudo-bus actually) iterates over the nodes that + * exist in Open Firmware and adds them as devices to this bus so that drivers + * can be attached to them. + * + * Maybe this code should get into dev/ofw to some extent, as some of it should + * work for all Open Firmware based machines... + */ + +static MALLOC_DEFINE(M_NEXUS, "nexus", "nexus device information"); + +enum nexus_ivars { + NEXUS_IVAR_NODE, + NEXUS_IVAR_NAME, + NEXUS_IVAR_DEVICE_TYPE, + NEXUS_IVAR_COMPATIBLE, +}; + +struct nexus_devinfo { + phandle_t ndi_node; + /* Some common properties. */ + const char *ndi_name; + const char *ndi_device_type; + const char *ndi_compatible; +}; + +struct nexus_softc { + struct rman sc_rman; +}; + +/* + * Device interface + */ +static int nexus_probe(device_t); +static int nexus_attach(device_t); + +/* + * Bus interface + */ +static device_t nexus_add_child(device_t, u_int, const char *, int); +static void nexus_probe_nomatch(device_t, device_t); +static int nexus_read_ivar(device_t, device_t, int, uintptr_t *); +static int nexus_write_ivar(device_t, device_t, int, uintptr_t); +#ifdef SMP +static int nexus_bind_intr(device_t dev, device_t child, + struct resource *irq, int cpu); +#endif +static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol); +static int nexus_setup_intr(device_t, device_t, struct resource *, int, + driver_filter_t *, driver_intr_t *, void *, void **); +static int nexus_teardown_intr(device_t, device_t, struct resource *, + void *); +static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, + u_long, u_long, u_long, u_int); +static int nexus_activate_resource(device_t, device_t, int, int, + struct resource *); +static int nexus_deactivate_resource(device_t, device_t, int, int, + struct resource *); +static int nexus_release_resource(device_t, device_t, int, int, + struct resource *); + +/* + * OFW bus interface. + */ +static phandle_t nexus_ofw_get_node(device_t, device_t); +static const char *nexus_ofw_get_name(device_t, device_t); +static const char *nexus_ofw_get_type(device_t, device_t); +static const char *nexus_ofw_get_compat(device_t, device_t); + +/* + * Local routines + */ +static device_t nexus_device_from_node(device_t, phandle_t); + +static device_method_t nexus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nexus_probe), + DEVMETHOD(device_attach, nexus_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface. Resource management is business of the children... */ + DEVMETHOD(bus_add_child, nexus_add_child), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), + DEVMETHOD(bus_read_ivar, nexus_read_ivar), + DEVMETHOD(bus_write_ivar, nexus_write_ivar), + DEVMETHOD(bus_setup_intr, nexus_setup_intr), + DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), +#ifdef SMP + DEVMETHOD(bus_bind_intr, nexus_bind_intr), +#endif + DEVMETHOD(bus_config_intr, nexus_config_intr), + DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_release_resource, nexus_release_resource), + + /* OFW bus interface */ + DEVMETHOD(ofw_bus_get_node, nexus_ofw_get_node), + DEVMETHOD(ofw_bus_get_name, nexus_ofw_get_name), + DEVMETHOD(ofw_bus_get_type, nexus_ofw_get_type), + DEVMETHOD(ofw_bus_get_compat, nexus_ofw_get_compat), + + DEVMETHOD_END +}; + +static driver_t nexus_driver = { + "nexus", + nexus_methods, + sizeof(struct nexus_softc), +}; + +static devclass_t nexus_devclass; + +EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, + BUS_PASS_BUS); + +static int +nexus_probe(device_t dev) +{ + bus_generic_probe(dev); + device_set_desc(dev, "Open Firmware Nexus device"); + return (0); +} + +static int +nexus_attach(device_t dev) +{ + phandle_t root; + phandle_t child; + struct nexus_softc *sc; + u_long start, end; + + sc = device_get_softc(dev); + + start = 0; + end = ~0; + + sc->sc_rman.rm_start = start; + sc->sc_rman.rm_end = end; + sc->sc_rman.rm_type = RMAN_ARRAY; + sc->sc_rman.rm_descr = "Interrupt request lines"; + if (rman_init(&sc->sc_rman) || + rman_manage_region(&sc->sc_rman, start, end)) + panic("nexus_probe IRQ rman"); + + if ((root = OF_peer(0)) == 0) + return (bus_generic_attach(dev)); + + /* + * Now walk the OFW tree to locate top-level devices + */ + for (child = OF_child(root); child != 0; child = OF_peer(child)) { + if (child == -1) + panic("nexus_probe(): OF_child failed."); + (void)nexus_device_from_node(dev, child); + + } + + return (bus_generic_attach(dev)); +} + +static void +nexus_probe_nomatch(device_t dev, device_t child) +{ + char *name, *type; + + if (BUS_READ_IVAR(dev, child, NEXUS_IVAR_NAME, + (uintptr_t *)&name) != 0 || + BUS_READ_IVAR(dev, child, NEXUS_IVAR_DEVICE_TYPE, + (uintptr_t *)&type) != 0) + return; + + if (type == NULL) + type = "(unknown)"; + + if (bootverbose) + device_printf(dev, "<%s>, type %s (no driver attached)\n", + name, type); +} + +static device_t +nexus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + device_t child; + struct nexus_devinfo *dinfo; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (NULL); + + dinfo = malloc(sizeof(struct nexus_devinfo), M_NEXUS, M_NOWAIT|M_ZERO); + if (dinfo == NULL) + return (NULL); + + dinfo->ndi_node = -1; + dinfo->ndi_name = name; + device_set_ivars(child, dinfo); + + return (child); +} + + +static int +nexus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(child)) == 0) + return (ENOENT); + switch (which) { + case NEXUS_IVAR_NODE: + *result = dinfo->ndi_node; + break; + case NEXUS_IVAR_NAME: + *result = (uintptr_t)dinfo->ndi_name; + break; + case NEXUS_IVAR_DEVICE_TYPE: + *result = (uintptr_t)dinfo->ndi_device_type; + break; + case NEXUS_IVAR_COMPATIBLE: + *result = (uintptr_t)dinfo->ndi_compatible; + break; + default: + return (ENOENT); + } + return 0; +} + +static int +nexus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(child)) == 0) + return (ENOENT); + + switch (which) { + case NEXUS_IVAR_NAME: + return (EINVAL); + + /* Identified devices may want to set these */ + case NEXUS_IVAR_NODE: + dinfo->ndi_node = (phandle_t)value; + break; + + case NEXUS_IVAR_DEVICE_TYPE: + dinfo->ndi_device_type = (char *)value; + break; + + default: + return (ENOENT); + } + return 0; +} + +static int +nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, + driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep) +{ + int error; + + /* somebody tried to setup an irq that failed to allocate! */ + if (res == NULL) + panic("nexus_setup_intr: NULL irq resource!"); + + *cookiep = 0; + if ((rman_get_flags(res) & RF_SHAREABLE) == 0) + flags |= INTR_EXCL; + + /* + * We depend here on rman_activate_resource() being idempotent. + */ + error = rman_activate_resource(res); + if (error) + return (error); + + error = powerpc_setup_intr(device_get_nameunit(child), + rman_get_start(res), filter, ihand, arg, flags, cookiep); + + return (error); +} + +static int +nexus_teardown_intr(device_t dev, device_t child, struct resource *res, + void *cookie) +{ + + return (powerpc_teardown_intr(cookie)); +} + +#ifdef SMP +static int +nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) +{ + + return (powerpc_bind_intr(rman_get_start(irq), cpu)); +} +#endif + +static int +nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + + return (powerpc_config_intr(irq, trig, pol)); +} + +/* + * Allocate resources at the behest of a child. This only handles interrupts, + * since I/O resources are handled by child busses. + */ +static struct resource * +nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct nexus_softc *sc; + struct resource *rv; + + if (type != SYS_RES_IRQ) { + device_printf(bus, "unknown resource request from %s\n", + device_get_nameunit(child)); + return (NULL); + } + + if (count == 0 || start + count - 1 != end) { + device_printf(bus, "invalid IRQ allocation from %s\n", + device_get_nameunit(child)); + return (NULL); + } + + sc = device_get_softc(bus); + + rv = rman_reserve_resource(&sc->sc_rman, start, end, count, + flags, child); + if (rv == NULL) { + device_printf(bus, "IRQ allocation failed for %s\n", + device_get_nameunit(child)); + } else + rman_set_rid(rv, *rid); + + return (rv); +} + +static int +nexus_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + /* Not much to be done yet... */ + return (rman_activate_resource(res)); +} + +static int +nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + /* Not much to be done yet... */ + return (rman_deactivate_resource(res)); +} + +static int +nexus_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + if (type != SYS_RES_IRQ) { + device_printf(bus, "unknown resource request from %s\n", + device_get_nameunit(child)); + return (EINVAL); + } + + return (rman_release_resource(res)); +} + +static device_t +nexus_device_from_node(device_t parent, phandle_t node) +{ + device_t cdev; + struct nexus_devinfo *dinfo; + char *name, *type, *compatible; + + OF_getprop_alloc(node, "name", 1, (void **)&name); + OF_getprop_alloc(node, "device_type", 1, (void **)&type); + OF_getprop_alloc(node, "compatible", 1, (void **)&compatible); + cdev = device_add_child(parent, NULL, -1); + if (cdev != NULL) { + dinfo = malloc(sizeof(*dinfo), M_NEXUS, M_WAITOK); + dinfo->ndi_node = node; + dinfo->ndi_name = name; + dinfo->ndi_device_type = type; + dinfo->ndi_compatible = compatible; + device_set_ivars(cdev, dinfo); + } else + free(name, M_OFWPROP); + + return (cdev); +} + +static const char * +nexus_ofw_get_name(device_t bus, device_t dev) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(dev)) == NULL) + return (NULL); + + return (dinfo->ndi_name); +} + +static phandle_t +nexus_ofw_get_node(device_t bus, device_t dev) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(dev)) == NULL) + return (0); + + return (dinfo->ndi_node); +} + +static const char * +nexus_ofw_get_type(device_t bus, device_t dev) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(dev)) == NULL) + return (NULL); + + return (dinfo->ndi_device_type); +} + +static const char * +nexus_ofw_get_compat(device_t bus, device_t dev) +{ + struct nexus_devinfo *dinfo; + + if ((dinfo = device_get_ivars(dev)) == NULL) + return (NULL); + + return (dinfo->ndi_compatible); +} + Copied: stable/10/sys/powerpc/powerpc/vm_machdep.c (from r256792, head/sys/powerpc/powerpc/vm_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/powerpc/powerpc/vm_machdep.c Tue May 13 16:50:10 2014 (r265952, copy of r256792, head/sys/powerpc/powerpc/vm_machdep.c) @@ -0,0 +1,410 @@ +/*- + * Copyright (c) 1982, 1986 The Regents of the University of California. + * Copyright (c) 1989, 1990 William Jolitz + * Copyright (c) 1994 John Dyson + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department, and William Jolitz. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 + * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ + * $FreeBSD$ + */ +/*- + * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#include +#include +#include +#include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 16:52:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 817E5CB; Tue, 13 May 2014 16:52: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 6E72A29C8; Tue, 13 May 2014 16:52: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 s4DGqMja080500; Tue, 13 May 2014 16:52:22 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DGqMEE080499; Tue, 13 May 2014 16:52:22 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131652.s4DGqMEE080499@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 16:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265953 - stable/10/sys/dev/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 16:52:22 -0000 Author: ian Date: Tue May 13 16:52:21 2014 New Revision: 265953 URL: http://svnweb.freebsd.org/changeset/base/265953 Log: MFC r256798: Return BUS_PROBE_NOWILDCARD from fdtbus_probe. Modified: stable/10/sys/dev/fdt/fdtbus.c Modified: stable/10/sys/dev/fdt/fdtbus.c ============================================================================== --- stable/10/sys/dev/fdt/fdtbus.c Tue May 13 16:50:10 2014 (r265952) +++ stable/10/sys/dev/fdt/fdtbus.c Tue May 13 16:52:21 2014 (r265953) @@ -161,7 +161,7 @@ fdtbus_probe(device_t dev) device_set_desc(dev, "FDT main bus"); if (!bootverbose) device_quiet(dev); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 16:59:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D56FA30A; Tue, 13 May 2014 16:59: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 C01EC2A17; Tue, 13 May 2014 16:59: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 s4DGxq58081548; Tue, 13 May 2014 16:59:52 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DGxp4O081466; Tue, 13 May 2014 16:59:51 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131659.s4DGxp4O081466@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 16:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265954 - in stable/10/sys: dev/ofw powerpc/booke powerpc/ofw powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 16:59:52 -0000 Author: ian Date: Tue May 13 16:59:50 2014 New Revision: 265954 URL: http://svnweb.freebsd.org/changeset/base/265954 Log: MFC r256814, r256816, r256818, r256846, r256855, r256864 (by nwhitehorn): - Handle 2GB of ram - Allow the OFW interrupt mapping code to work with PCI devices not enumerated by Open Firmware, as in the case of FDT. - Provide an interface for PCI bus drivers that need some of ofw_pci's metadata during attach. - Use standard ofw_bus helpers instead of reinventing the wheel. - Make hard-wired TLB allocations be at minimum one page. Modified: stable/10/sys/dev/ofw/ofw_bus_subr.c stable/10/sys/powerpc/booke/machdep.c stable/10/sys/powerpc/booke/pmap.c stable/10/sys/powerpc/ofw/ofw_pci.c stable/10/sys/powerpc/ofw/ofw_pci.h stable/10/sys/powerpc/ofw/ofw_pcib_pci.c stable/10/sys/powerpc/ofw/ofw_pcibus.c stable/10/sys/powerpc/powerpc/clock.c stable/10/sys/powerpc/powerpc/nexus.c Modified: stable/10/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.c Tue May 13 16:52:21 2014 (r265953) +++ stable/10/sys/dev/ofw/ofw_bus_subr.c Tue May 13 16:59:50 2014 (r265954) @@ -223,7 +223,6 @@ ofw_bus_has_prop(device_t dev, const cha return (OF_hasprop(node, propname)); } -#ifndef FDT void ofw_bus_setup_iinfo(phandle_t node, struct ofw_bus_iinfo *ii, int intrsz) { @@ -261,9 +260,11 @@ ofw_bus_lookup_imap(phandle_t node, stru KASSERT(regsz >= ii->opi_addrc, ("ofw_bus_lookup_imap: register size too small: %d < %d", regsz, ii->opi_addrc)); - rv = OF_getprop(node, "reg", reg, regsz); - if (rv < regsz) - panic("ofw_bus_lookup_imap: could not get reg property"); + if (node != -1) { + rv = OF_getprop(node, "reg", reg, regsz); + if (rv < regsz) + panic("ofw_bus_lookup_imap: cannot get reg property"); + } return (ofw_bus_search_intrmap(pintr, pintrsz, reg, ii->opi_addrc, ii->opi_imap, ii->opi_imapsz, ii->opi_imapmsk, maskbuf, mintr, mintrsz, iparent)); @@ -343,4 +344,4 @@ ofw_bus_search_intrmap(void *intr, int i } return (0); } -#endif /* !FDT */ + Modified: stable/10/sys/powerpc/booke/machdep.c ============================================================================== --- stable/10/sys/powerpc/booke/machdep.c Tue May 13 16:52:21 2014 (r265953) +++ stable/10/sys/powerpc/booke/machdep.c Tue May 13 16:59:50 2014 (r265954) @@ -192,7 +192,8 @@ extern int elf32_nxstack; static void cpu_booke_startup(void *dummy) { - int indx, size; + int indx; + unsigned long size; /* Initialise the decrementer-based clock. */ decr_init(); @@ -200,7 +201,7 @@ cpu_booke_startup(void *dummy) /* Good {morning,afternoon,evening,night}. */ cpu_setup(PCPU_GET(cpuid)); - printf("real memory = %ld (%ld MB)\n", ptoa(physmem), + printf("real memory = %lu (%ld MB)\n", ptoa(physmem), ptoa(physmem) / 1048576); realmem = physmem; @@ -210,7 +211,7 @@ cpu_booke_startup(void *dummy) for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { size = phys_avail[indx + 1] - phys_avail[indx]; - printf("0x%08x - 0x%08x, %d bytes (%ld pages)\n", + printf("0x%08x - 0x%08x, %lu bytes (%lu pages)\n", phys_avail[indx], phys_avail[indx + 1] - 1, size, size / PAGE_SIZE); } @@ -218,7 +219,7 @@ cpu_booke_startup(void *dummy) vm_ksubmap_init(&kmi); - printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count), + printf("avail memory = %lu (%ld MB)\n", ptoa(cnt.v_free_count), ptoa(cnt.v_free_count) / 1048576); /* Set up buffers, so they can be used to read disk labels. */ Modified: stable/10/sys/powerpc/booke/pmap.c ============================================================================== --- stable/10/sys/powerpc/booke/pmap.c Tue May 13 16:52:21 2014 (r265953) +++ stable/10/sys/powerpc/booke/pmap.c Tue May 13 16:59:50 2014 (r265954) @@ -2613,6 +2613,8 @@ mmu_booke_mapdev(mmu_t mmu, vm_paddr_t p va = (pa >= 0x80000000) ? pa : (0xe2000000 + pa); res = (void *)va; + if (size < PAGE_SIZE) + size = PAGE_SIZE; do { sz = 1 << (ilog2(size) & ~1); Modified: stable/10/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_pci.c Tue May 13 16:52:21 2014 (r265953) +++ stable/10/sys/powerpc/ofw/ofw_pci.c Tue May 13 16:59:50 2014 (r265954) @@ -124,7 +124,7 @@ static device_method_t ofw_pci_methods[] DEFINE_CLASS_0(ofw_pci, ofw_pci_driver, ofw_pci_methods, 0); int -ofw_pci_attach(device_t dev) +ofw_pci_init(device_t dev) { struct ofw_pci_softc *sc; phandle_t node; @@ -134,6 +134,7 @@ ofw_pci_attach(device_t dev) node = ofw_bus_get_node(dev); sc = device_get_softc(dev); + sc->sc_initialized = 1; if (OF_getprop(node, "reg", &sc->sc_pcir, sizeof(sc->sc_pcir)) == -1) return (ENXIO); @@ -217,13 +218,28 @@ ofw_pci_attach(device_t dev) "error = %d\n", rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK, rp->pci, rp->pci + rp->size - 1, error); - panic("AHOY"); return (error); } } ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(cell_t)); + return (error); +} + +int +ofw_pci_attach(device_t dev) +{ + struct ofw_pci_softc *sc; + int error; + + sc = device_get_softc(dev); + if (!sc->sc_initialized) { + error = ofw_pci_init(dev); + if (error) + return (error); + } + device_add_child(dev, "pci", device_get_unit(dev)); return (bus_generic_attach(dev)); } @@ -246,6 +262,13 @@ ofw_pci_route_interrupt(device_t bus, de sc = device_get_softc(bus); pintr = pin; + + /* Fabricate imap information in case this isn't an OFW device */ + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), &iparent, maskbuf)) Modified: stable/10/sys/powerpc/ofw/ofw_pci.h ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_pci.h Tue May 13 16:52:21 2014 (r265953) +++ stable/10/sys/powerpc/ofw/ofw_pci.h Tue May 13 16:59:50 2014 (r265954) @@ -52,6 +52,7 @@ struct ofw_pci_softc { device_t sc_dev; phandle_t sc_node; int sc_bus; + int sc_initialized; int sc_quirks; @@ -68,6 +69,7 @@ struct ofw_pci_softc { struct ofw_bus_iinfo sc_pci_iinfo; }; +int ofw_pci_init(device_t dev); int ofw_pci_attach(device_t dev); #endif // POWERPC_OFW_OFW_PCI_H Modified: stable/10/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_pcib_pci.c Tue May 13 16:52:21 2014 (r265953) +++ stable/10/sys/powerpc/ofw/ofw_pcib_pci.c Tue May 13 16:59:50 2014 (r265954) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -141,6 +142,13 @@ ofw_pcib_pci_route_interrupt(device_t br ii = &sc->ops_iinfo; if (ii->opi_imapsz > 0) { pintr = intpin; + + /* Fabricate imap information if this isn't an OFW device */ + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), &iparent, maskbuf)) { Modified: stable/10/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_pcibus.c Tue May 13 16:52:21 2014 (r265953) +++ stable/10/sys/powerpc/ofw/ofw_pcibus.c Tue May 13 16:59:50 2014 (r265954) @@ -320,20 +320,9 @@ ofw_pcibus_assign_interrupt(device_t dev if (node == -1) { /* Non-firmware enumerated child, use standard routing */ - /* - * XXX: Right now we don't have anything sensible to do here, - * since the ofw_imap stuff relies on nodes having a reg - * property. There exist ways around this, so the ePAPR - * spec will need to be studied. - */ - - return (PCI_INVALID_IRQ); - -#ifdef NOTYET intr = pci_get_intpin(child); return (PCIB_ROUTE_INTERRUPT(device_get_parent(dev), child, intr)); -#endif } /* Modified: stable/10/sys/powerpc/powerpc/clock.c ============================================================================== --- stable/10/sys/powerpc/powerpc/clock.c Tue May 13 16:52:21 2014 (r265953) +++ stable/10/sys/powerpc/powerpc/clock.c Tue May 13 16:59:50 2014 (r265954) @@ -167,8 +167,8 @@ decr_init(void) char buf[32]; /* - * Check the BSP's timebase frequency. Sometimes we can't find the BSP, so fall - * back to the first CPU in this case. + * Check the BSP's timebase frequency. Sometimes we can't find the BSP, + * so fall back to the first CPU in this case. */ if (platform_smp_get_bsp(&cpu) != 0) platform_smp_first_cpu(&cpu); Modified: stable/10/sys/powerpc/powerpc/nexus.c ============================================================================== --- stable/10/sys/powerpc/powerpc/nexus.c Tue May 13 16:52:21 2014 (r265953) +++ stable/10/sys/powerpc/powerpc/nexus.c Tue May 13 16:59:50 2014 (r265954) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -88,19 +89,8 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_NEXUS, "nexus", "nexus device information"); -enum nexus_ivars { - NEXUS_IVAR_NODE, - NEXUS_IVAR_NAME, - NEXUS_IVAR_DEVICE_TYPE, - NEXUS_IVAR_COMPATIBLE, -}; - struct nexus_devinfo { - phandle_t ndi_node; - /* Some common properties. */ - const char *ndi_name; - const char *ndi_device_type; - const char *ndi_compatible; + struct ofw_bus_devinfo ndi_ofwinfo; }; struct nexus_softc { @@ -118,8 +108,6 @@ static int nexus_attach(device_t); */ static device_t nexus_add_child(device_t, u_int, const char *, int); static void nexus_probe_nomatch(device_t, device_t); -static int nexus_read_ivar(device_t, device_t, int, uintptr_t *); -static int nexus_write_ivar(device_t, device_t, int, uintptr_t); #ifdef SMP static int nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu); @@ -138,14 +126,8 @@ static int nexus_deactivate_resource(dev struct resource *); static int nexus_release_resource(device_t, device_t, int, int, struct resource *); - -/* - * OFW bus interface. - */ -static phandle_t nexus_ofw_get_node(device_t, device_t); -static const char *nexus_ofw_get_name(device_t, device_t); -static const char *nexus_ofw_get_type(device_t, device_t); -static const char *nexus_ofw_get_compat(device_t, device_t); +static const struct ofw_bus_devinfo *nexus_get_devinfo(device_t dev, + device_t child); /* * Local routines @@ -165,8 +147,6 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), - DEVMETHOD(bus_read_ivar, nexus_read_ivar), - DEVMETHOD(bus_write_ivar, nexus_write_ivar), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), #ifdef SMP @@ -179,10 +159,12 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_release_resource, nexus_release_resource), /* OFW bus interface */ - DEVMETHOD(ofw_bus_get_node, nexus_ofw_get_node), - DEVMETHOD(ofw_bus_get_name, nexus_ofw_get_name), - DEVMETHOD(ofw_bus_get_type, nexus_ofw_get_type), - DEVMETHOD(ofw_bus_get_compat, nexus_ofw_get_compat), + DEVMETHOD(ofw_bus_get_devinfo, nexus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), DEVMETHOD_END }; @@ -246,14 +228,13 @@ nexus_attach(device_t dev) static void nexus_probe_nomatch(device_t dev, device_t child) { - char *name, *type; + const char *name, *type; - if (BUS_READ_IVAR(dev, child, NEXUS_IVAR_NAME, - (uintptr_t *)&name) != 0 || - BUS_READ_IVAR(dev, child, NEXUS_IVAR_DEVICE_TYPE, - (uintptr_t *)&type) != 0) - return; + name = ofw_bus_get_name(child); + type = ofw_bus_get_type(child); + if (name == NULL) + name = "unknown"; if (type == NULL) type = "(unknown)"; @@ -276,67 +257,17 @@ nexus_add_child(device_t dev, u_int orde if (dinfo == NULL) return (NULL); - dinfo->ndi_node = -1; - dinfo->ndi_name = name; + dinfo->ndi_ofwinfo.obd_node = -1; + dinfo->ndi_ofwinfo.obd_name = NULL; + dinfo->ndi_ofwinfo.obd_compat = NULL; + dinfo->ndi_ofwinfo.obd_type = NULL; + dinfo->ndi_ofwinfo.obd_model = NULL; + device_set_ivars(child, dinfo); return (child); } - -static int -nexus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) -{ - struct nexus_devinfo *dinfo; - - if ((dinfo = device_get_ivars(child)) == 0) - return (ENOENT); - switch (which) { - case NEXUS_IVAR_NODE: - *result = dinfo->ndi_node; - break; - case NEXUS_IVAR_NAME: - *result = (uintptr_t)dinfo->ndi_name; - break; - case NEXUS_IVAR_DEVICE_TYPE: - *result = (uintptr_t)dinfo->ndi_device_type; - break; - case NEXUS_IVAR_COMPATIBLE: - *result = (uintptr_t)dinfo->ndi_compatible; - break; - default: - return (ENOENT); - } - return 0; -} - -static int -nexus_write_ivar(device_t dev, device_t child, int which, uintptr_t value) -{ - struct nexus_devinfo *dinfo; - - if ((dinfo = device_get_ivars(child)) == 0) - return (ENOENT); - - switch (which) { - case NEXUS_IVAR_NAME: - return (EINVAL); - - /* Identified devices may want to set these */ - case NEXUS_IVAR_NODE: - dinfo->ndi_node = (phandle_t)value; - break; - - case NEXUS_IVAR_DEVICE_TYPE: - dinfo->ndi_device_type = (char *)value; - break; - - default: - return (ENOENT); - } - return 0; -} - static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep) @@ -462,66 +393,23 @@ nexus_device_from_node(device_t parent, { device_t cdev; struct nexus_devinfo *dinfo; - char *name, *type, *compatible; - OF_getprop_alloc(node, "name", 1, (void **)&name); - OF_getprop_alloc(node, "device_type", 1, (void **)&type); - OF_getprop_alloc(node, "compatible", 1, (void **)&compatible); cdev = device_add_child(parent, NULL, -1); if (cdev != NULL) { dinfo = malloc(sizeof(*dinfo), M_NEXUS, M_WAITOK); - dinfo->ndi_node = node; - dinfo->ndi_name = name; - dinfo->ndi_device_type = type; - dinfo->ndi_compatible = compatible; + ofw_bus_gen_setup_devinfo(&dinfo->ndi_ofwinfo, node); device_set_ivars(cdev, dinfo); - } else - free(name, M_OFWPROP); + } return (cdev); } -static const char * -nexus_ofw_get_name(device_t bus, device_t dev) -{ - struct nexus_devinfo *dinfo; - - if ((dinfo = device_get_ivars(dev)) == NULL) - return (NULL); - - return (dinfo->ndi_name); -} - -static phandle_t -nexus_ofw_get_node(device_t bus, device_t dev) -{ - struct nexus_devinfo *dinfo; - - if ((dinfo = device_get_ivars(dev)) == NULL) - return (0); - - return (dinfo->ndi_node); -} - -static const char * -nexus_ofw_get_type(device_t bus, device_t dev) +static const struct ofw_bus_devinfo * +nexus_get_devinfo(device_t dev, device_t child) { struct nexus_devinfo *dinfo; - if ((dinfo = device_get_ivars(dev)) == NULL) - return (NULL); - - return (dinfo->ndi_device_type); -} - -static const char * -nexus_ofw_get_compat(device_t bus, device_t dev) -{ - struct nexus_devinfo *dinfo; - - if ((dinfo = device_get_ivars(dev)) == NULL) - return (NULL); - - return (dinfo->ndi_compatible); + dinfo = device_get_ivars(child); + return (&dinfo->ndi_ofwinfo); } From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 17:12:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 48FE4E88; Tue, 13 May 2014 17:12: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 2AB332BA1; Tue, 13 May 2014 17:12: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 s4DHC9VH090166; Tue, 13 May 2014 17:12:09 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DHC7Qn090157; Tue, 13 May 2014 17:12:07 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131712.s4DHC7Qn090157@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 17:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265959 - in stable/10/sys: conf dev/cfi dev/fdt dev/ofw powerpc/mambo powerpc/ofw powerpc/powermac powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 17:12:09 -0000 Author: ian Date: Tue May 13 17:12:07 2014 New Revision: 265959 URL: http://svnweb.freebsd.org/changeset/base/265959 Log: MFC r256870, r256898, r256899, r256900 (by nwhitehorn): Standards-conformance and code deduplication: - Use bus reference phandles in place of FDT offsets as IRQ domain keys - Unify the identical macio/fdt/mambo OpenPIC drivers into one - Be more forgiving (following ePAPR) about what we need from the device tree to identify an OpenPIC - Correctly map all IRQs into an interrupt domain - Set IRQ_*_CONFORM for interrupts on an unknown PIC type instead of failing attachment for that device. Allow lots of interrupts (useful on multi-domain platforms) and do not set device_quiet() on all devices attached under nexus(4). Added: stable/10/sys/powerpc/ofw/openpic_ofw.c - copied unchanged from r256898, head/sys/powerpc/ofw/openpic_ofw.c Deleted: stable/10/sys/powerpc/mambo/mambo_openpic.c stable/10/sys/powerpc/powermac/openpic_macio.c stable/10/sys/powerpc/powerpc/openpic_fdt.c Modified: stable/10/sys/conf/files.powerpc stable/10/sys/dev/cfi/cfi_bus_nexus.c stable/10/sys/dev/fdt/fdt_common.c stable/10/sys/dev/fdt/fdt_pci.c stable/10/sys/dev/fdt/fdt_powerpc.c stable/10/sys/dev/fdt/fdtbus.c stable/10/sys/dev/ofw/ofw_fdt.c Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Tue May 13 17:09:50 2014 (r265958) +++ stable/10/sys/conf/files.powerpc Tue May 13 17:12:07 2014 (r265959) @@ -128,7 +128,6 @@ powerpc/mambo/mambocall.S optional mambo powerpc/mambo/mambo.c optional mambo powerpc/mambo/mambo_console.c optional mambo powerpc/mambo/mambo_disk.c optional mambo -powerpc/mambo/mambo_openpic.c optional mambo powerpc/mpc85xx/atpic.c optional mpc85xx isa powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt powerpc/mpc85xx/ds1553_core.c optional ds1553 @@ -147,6 +146,7 @@ powerpc/ofw/ofw_syscons.c optional sc ai powerpc/ofw/ofwcall32.S optional aim powerpc powerpc/ofw/ofwcall64.S optional aim powerpc64 powerpc/ofw/ofwmagic.S optional aim +powerpc/ofw/openpic_ofw.c optional aim | fdt powerpc/ofw/rtas.c optional aim powerpc/powermac/ata_kauai.c optional powermac ata | powermac atamacio powerpc/powermac/ata_macio.c optional powermac ata | powermac atamacio @@ -162,7 +162,6 @@ powerpc/powermac/kiic.c optional powerm powerpc/powermac/macgpio.c optional powermac pci powerpc/powermac/macio.c optional powermac pci powerpc/powermac/nvbl.c optional powermac nvbl -powerpc/powermac/openpic_macio.c optional powermac pci powerpc/powermac/platform_powermac.c optional powermac powerpc/powermac/powermac_thermal.c optional powermac powerpc/powermac/pswitch.c optional powermac pswitch @@ -200,7 +199,6 @@ powerpc/powerpc/mmu_if.m standard powerpc/powerpc/mp_machdep.c optional smp powerpc/powerpc/nexus.c standard powerpc/powerpc/openpic.c standard -powerpc/powerpc/openpic_fdt.c optional fdt powerpc/powerpc/pic_if.m standard powerpc/powerpc/pmap_dispatch.c standard powerpc/powerpc/platform.c standard Modified: stable/10/sys/dev/cfi/cfi_bus_nexus.c ============================================================================== --- stable/10/sys/dev/cfi/cfi_bus_nexus.c Tue May 13 17:09:50 2014 (r265958) +++ stable/10/sys/dev/cfi/cfi_bus_nexus.c Tue May 13 17:12:07 2014 (r265959) @@ -50,14 +50,25 @@ __FBSDID("$FreeBSD$"); static int cfi_nexus_probe(device_t dev) { + return (BUS_PROBE_NOWILDCARD); +} + +static int +cfi_nexus_attach(device_t dev) +{ + int error; + + error = cfi_probe(dev); + if (error != 0) + return (error); - return cfi_probe(dev); + return cfi_attach(dev); } static device_method_t cfi_nexus_methods[] = { /* device interface */ DEVMETHOD(device_probe, cfi_nexus_probe), - DEVMETHOD(device_attach, cfi_attach), + DEVMETHOD(device_attach, cfi_nexus_attach), DEVMETHOD(device_detach, cfi_detach), {0, 0} Modified: stable/10/sys/dev/fdt/fdt_common.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.c Tue May 13 17:09:50 2014 (r265958) +++ stable/10/sys/dev/fdt/fdt_common.c Tue May 13 17:12:07 2014 (r265959) @@ -478,21 +478,31 @@ fdt_intr_decode(phandle_t intr_parent, p int *trig, int *pol) { fdt_pic_decode_t intr_decode; + phandle_t intr_offset; int i, rv; + intr_offset = OF_xref_phandle(intr_parent); + for (i = 0; fdt_pic_table[i] != NULL; i++) { /* XXX check if pic_handle has interrupt-controller prop? */ intr_decode = fdt_pic_table[i]; - rv = intr_decode(intr_parent, intr, interrupt, trig, pol); + rv = intr_decode(intr_offset, intr, interrupt, trig, pol); - if (rv == 0) + if (rv == 0) { /* This was recognized as our PIC and decoded. */ + *interrupt = FDT_MAP_IRQ(intr_parent, *interrupt); return (0); + } } - return (ENXIO); + /* Not in table, so guess */ + *interrupt = FDT_MAP_IRQ(intr_parent, fdt32_to_cpu(*intr)); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); } int @@ -500,7 +510,7 @@ fdt_intr_to_rl(phandle_t node, struct re struct fdt_sense_level *intr_sl) { phandle_t intr_par; - ihandle_t iph; + phandle_t iph; pcell_t *intr; pcell_t intr_cells; int interrupt, trig, pol; @@ -517,8 +527,7 @@ fdt_intr_to_rl(phandle_t node, struct re debugf("no intr-parent phandle\n"); intr_par = OF_parent(node); } else { - iph = fdt32_to_cpu(iph); - intr_par = OF_instance_to_package(iph); + intr_par = OF_xref_phandle(iph); } if (OF_getprop(intr_par, "#interrupt-cells", &intr_cells, @@ -540,7 +549,7 @@ fdt_intr_to_rl(phandle_t node, struct re interrupt = -1; trig = pol = 0; - if (fdt_intr_decode(intr_par, &intr[i * intr_cells], + if (fdt_intr_decode(iph, &intr[i * intr_cells], &interrupt, &trig, &pol) != 0) { rv = ENXIO; goto out; @@ -557,7 +566,7 @@ fdt_intr_to_rl(phandle_t node, struct re intr_sl[i].trig = trig; intr_sl[i].pol = pol; - irq = FDT_MAP_IRQ(intr_par, interrupt); + irq = FDT_MAP_IRQ(iph, interrupt); resource_list_add(rl, SYS_RES_IRQ, i, irq, irq, 1); } @@ -570,7 +579,6 @@ int fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) { phandle_t phy_node; - ihandle_t phy_ihandle; pcell_t phy_handle, phy_reg; uint32_t i; device_t parent, child; @@ -579,9 +587,7 @@ fdt_get_phyaddr(phandle_t node, device_t sizeof(phy_handle)) <= 0) return (ENXIO); - phy_ihandle = (ihandle_t)phy_handle; - phy_ihandle = fdt32_to_cpu(phy_ihandle); - phy_node = OF_instance_to_package(phy_ihandle); + phy_node = OF_xref_phandle(phy_handle); if (OF_getprop(phy_node, "reg", (void *)&phy_reg, sizeof(phy_reg)) <= 0) Modified: stable/10/sys/dev/fdt/fdt_pci.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_pci.c Tue May 13 17:09:50 2014 (r265958) +++ stable/10/sys/dev/fdt/fdt_pci.c Tue May 13 17:12:07 2014 (r265959) @@ -320,7 +320,7 @@ fdt_pci_route_intr(int bus, int slot, in trig, pol); #if defined(__powerpc__) - powerpc_config_intr(FDT_MAP_IRQ(intr_par, *interrupt), trig, + powerpc_config_intr(FDT_MAP_IRQ(iph, *interrupt), trig, pol); #endif return (0); Modified: stable/10/sys/dev/fdt/fdt_powerpc.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_powerpc.c Tue May 13 17:09:50 2014 (r265958) +++ stable/10/sys/dev/fdt/fdt_powerpc.c Tue May 13 17:12:07 2014 (r265959) @@ -123,7 +123,8 @@ fdt_pic_decode_openpic(phandle_t node, p int *trig, int *pol) { - if (!fdt_is_compatible(node, "chrp,open-pic")) + if (!fdt_is_compatible(node, "chrp,open-pic") && + !fdt_is_type(node, "open-pic")) return (ENXIO); /* Modified: stable/10/sys/dev/fdt/fdtbus.c ============================================================================== --- stable/10/sys/dev/fdt/fdtbus.c Tue May 13 17:09:50 2014 (r265958) +++ stable/10/sys/dev/fdt/fdtbus.c Tue May 13 17:12:07 2014 (r265959) @@ -158,9 +158,7 @@ fdtbus_probe(device_t dev) debugf("%s(dev=%p); pass=%u\n", __func__, dev, bus_current_pass); - device_set_desc(dev, "FDT main bus"); - if (!bootverbose) - device_quiet(dev); + device_set_desc(dev, "Flattened Device Tree"); return (BUS_PROBE_NOWILDCARD); } @@ -182,7 +180,7 @@ fdtbus_attach(device_t dev) * IRQ rman. */ start = 0; - end = FDT_INTR_MAX - 1; + end = ~0; sc->sc_irq.rm_start = start; sc->sc_irq.rm_end = end; sc->sc_irq.rm_type = RMAN_ARRAY; Modified: stable/10/sys/dev/ofw/ofw_fdt.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_fdt.c Tue May 13 17:09:50 2014 (r265958) +++ stable/10/sys/dev/ofw/ofw_fdt.c Tue May 13 17:12:07 2014 (r265959) @@ -329,7 +329,7 @@ fdt_nextprop(int offset, char *buf, size depth = -1; } while (depth >= 0); - return (-1); + return (0); } /* Copied: stable/10/sys/powerpc/ofw/openpic_ofw.c (from r256898, head/sys/powerpc/ofw/openpic_ofw.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/powerpc/ofw/openpic_ofw.c Tue May 13 17:12:07 2014 (r265959, copy of r256898, head/sys/powerpc/ofw/openpic_ofw.c) @@ -0,0 +1,129 @@ +/*- + * Copyright 2003 by Peter Grehan. 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include "pic_if.h" + +/* + * OFW interface + */ +static int openpic_ofw_probe(device_t); +static int openpic_ofw_attach(device_t); + +static device_method_t openpic_ofw_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, openpic_ofw_probe), + DEVMETHOD(device_attach, openpic_ofw_attach), + + /* PIC interface */ + DEVMETHOD(pic_bind, openpic_bind), + DEVMETHOD(pic_config, openpic_config), + DEVMETHOD(pic_dispatch, openpic_dispatch), + DEVMETHOD(pic_enable, openpic_enable), + DEVMETHOD(pic_eoi, openpic_eoi), + DEVMETHOD(pic_ipi, openpic_ipi), + DEVMETHOD(pic_mask, openpic_mask), + DEVMETHOD(pic_unmask, openpic_unmask), + + DEVMETHOD_END +}; + +static driver_t openpic_ofw_driver = { + "openpic", + openpic_ofw_methods, + sizeof(struct openpic_softc), +}; + +DRIVER_MODULE(openpic, nexus, openpic_ofw_driver, openpic_devclass, 0, 0); +DRIVER_MODULE(openpic, simplebus, openpic_ofw_driver, openpic_devclass, 0, 0); +DRIVER_MODULE(openpic, macio, openpic_ofw_driver, openpic_devclass, 0, 0); + +static int +openpic_ofw_probe(device_t dev) +{ + const char *type = ofw_bus_get_type(dev); + + if (type == NULL) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "chrp,open-pic") && + strcmp(type, "open-pic") != 0) + return (ENXIO); + + /* + * On some U4 systems, there is a phantom MPIC in the mac-io cell. + * The uninorth driver will pick up the real PIC, so ignore it here. + */ + if (OF_finddevice("/u4") != (phandle_t)-1) + return (ENXIO); + + device_set_desc(dev, OPENPIC_DEVSTR); + return (0); +} + +static int +openpic_ofw_attach(device_t dev) +{ + phandle_t xref, node; + + node = ofw_bus_get_node(dev); + + if (OF_getprop(node, "phandle", &xref, sizeof(xref)) == -1 && + OF_getprop(node, "ibm,phandle", &xref, sizeof(xref)) == -1 && + OF_getprop(node, "linux,phandle", &xref, sizeof(xref)) == -1) + xref = node; + + return (openpic_common_attach(dev, xref)); +} + From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 17:18:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 35BCFF1; Tue, 13 May 2014 17:18: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 217D72BF5; Tue, 13 May 2014 17:18: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 s4DHIn5n091172; Tue, 13 May 2014 17:18:49 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DHInwj091171; Tue, 13 May 2014 17:18:49 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131718.s4DHInwj091171@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 17:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265960 - stable/10/sys/powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 17:18:49 -0000 Author: ian Date: Tue May 13 17:18:48 2014 New Revision: 265960 URL: http://svnweb.freebsd.org/changeset/base/265960 Log: MFC r256901, r256914 (by nwhitehorn): Catch up on 6 years of improvements in Open Firmware nexus devices by importing the sparc64 one. At least 90% of this code is MI and will be moved into /sys/dev/ofw at some point in the future. Ignore registers on devices where the reg property is malformed. Issue a warning if this happens under bootverbose. This prevents some strange-looking entries in dmesg for SMU devices on Apple G5 systems. Modified: stable/10/sys/powerpc/powerpc/nexus.c Modified: stable/10/sys/powerpc/powerpc/nexus.c ============================================================================== --- stable/10/sys/powerpc/powerpc/nexus.c Tue May 13 17:12:07 2014 (r265959) +++ stable/10/sys/powerpc/powerpc/nexus.c Tue May 13 17:18:48 2014 (r265960) @@ -1,5 +1,8 @@ /*- * Copyright 1998 Massachusetts Institute of Technology + * Copyright 2001 by Thomas Moestl . + * Copyright 2006 by Marius Strobl . + * All rights reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -25,30 +28,6 @@ * 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. - */ -/*- - * Copyright 2001 by Thomas Moestl . 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. * * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09 */ @@ -58,81 +37,71 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include #include #include +#include +#include +#include + +#include +#include #include #include #include #include -#include #include #include -#include - -#include "ofw_bus_if.h" -#include "pic_if.h" - /* * The nexus (which is a pseudo-bus actually) iterates over the nodes that - * exist in Open Firmware and adds them as devices to this bus so that drivers - * can be attached to them. + * hang from the Open Firmware root node and adds them as devices to this bus + * (except some special nodes which are excluded) so that drivers can be + * attached to them. + * + * Additionally, interrupt setup/teardown and some resource management are + * done at this level. * * Maybe this code should get into dev/ofw to some extent, as some of it should * work for all Open Firmware based machines... */ -static MALLOC_DEFINE(M_NEXUS, "nexus", "nexus device information"); - struct nexus_devinfo { - struct ofw_bus_devinfo ndi_ofwinfo; + struct ofw_bus_devinfo ndi_obdinfo; + struct resource_list ndi_rl; }; struct nexus_softc { - struct rman sc_rman; + uint32_t acells, scells; + struct rman sc_intr_rman; + struct rman sc_mem_rman; }; -/* - * Device interface - */ -static int nexus_probe(device_t); -static int nexus_attach(device_t); - -/* - * Bus interface - */ -static device_t nexus_add_child(device_t, u_int, const char *, int); -static void nexus_probe_nomatch(device_t, device_t); +static device_probe_t nexus_probe; +static device_attach_t nexus_attach; +static bus_print_child_t nexus_print_child; +static bus_add_child_t nexus_add_child; +static bus_probe_nomatch_t nexus_probe_nomatch; +static bus_setup_intr_t nexus_setup_intr; +static bus_teardown_intr_t nexus_teardown_intr; +static bus_alloc_resource_t nexus_alloc_resource; +static bus_activate_resource_t nexus_activate_resource; +static bus_deactivate_resource_t nexus_deactivate_resource; +static bus_adjust_resource_t nexus_adjust_resource; +static bus_release_resource_t nexus_release_resource; +static bus_get_resource_list_t nexus_get_resource_list; #ifdef SMP -static int nexus_bind_intr(device_t dev, device_t child, - struct resource *irq, int cpu); +static bus_bind_intr_t nexus_bind_intr; #endif -static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, - enum intr_polarity pol); -static int nexus_setup_intr(device_t, device_t, struct resource *, int, - driver_filter_t *, driver_intr_t *, void *, void **); -static int nexus_teardown_intr(device_t, device_t, struct resource *, - void *); -static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, - u_long, u_long, u_long, u_int); -static int nexus_activate_resource(device_t, device_t, int, int, - struct resource *); -static int nexus_deactivate_resource(device_t, device_t, int, int, - struct resource *); -static int nexus_release_resource(device_t, device_t, int, int, - struct resource *); -static const struct ofw_bus_devinfo *nexus_get_devinfo(device_t dev, - device_t child); +static bus_config_intr_t nexus_config_intr; +static ofw_bus_get_devinfo_t nexus_get_devinfo; -/* - * Local routines - */ -static device_t nexus_device_from_node(device_t, phandle_t); +static int nexus_inlist(const char *, const char *const *); +static struct nexus_devinfo * nexus_setup_dinfo(device_t, phandle_t); +static void nexus_destroy_dinfo(struct nexus_devinfo *); +static int nexus_print_res(struct nexus_devinfo *); static device_method_t nexus_methods[] = { /* Device interface */ @@ -143,22 +112,29 @@ static device_method_t nexus_methods[] = DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), - /* Bus interface. Resource management is business of the children... */ + /* Bus interface */ + DEVMETHOD(bus_print_child, nexus_print_child), + DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), + DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), + DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), - DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), + DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), + DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, nexus_get_resource_list), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif DEVMETHOD(bus_config_intr, nexus_config_intr), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_activate_resource, nexus_activate_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), - /* OFW bus interface */ + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, nexus_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), @@ -169,21 +145,64 @@ static device_method_t nexus_methods[] = DEVMETHOD_END }; -static driver_t nexus_driver = { - "nexus", - nexus_methods, - sizeof(struct nexus_softc), -}; - static devclass_t nexus_devclass; +DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, sizeof(struct nexus_softc)); EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, BUS_PASS_BUS); +MODULE_VERSION(nexus, 1); + +static const char *const nexus_excl_name[] = { + "FJSV,system", + "aliases", + "associations", + "chosen", + "cmp", + "counter-timer", /* No separate device; handled by psycho/sbus */ + "failsafe", + "memory", + "openprom", + "options", + "packages", + "physical-memory", + "rsc", + "sgcn", + "todsg", + "virtual-memory", + NULL +}; + +static const char *const nexus_excl_type[] = { + "core", + "cpu", + NULL +}; + +extern struct bus_space_tag nexus_bustag; +extern struct bus_dma_tag nexus_dmatag; + +static int +nexus_inlist(const char *name, const char *const *list) +{ + int i; + + if (name == NULL) + return (0); + for (i = 0; list[i] != NULL; i++) + if (strcmp(name, list[i]) == 0) + return (1); + return (0); +} + +#define NEXUS_EXCLUDED(name, type) \ + (nexus_inlist((name), nexus_excl_name) || \ + ((type) != NULL && nexus_inlist((type), nexus_excl_type))) static int nexus_probe(device_t dev) { - bus_generic_probe(dev); + + /* Nexus does always match. */ device_set_desc(dev, "Open Firmware Nexus device"); return (0); } @@ -191,225 +210,430 @@ nexus_probe(device_t dev) static int nexus_attach(device_t dev) { - phandle_t root; - phandle_t child; - struct nexus_softc *sc; - u_long start, end; + struct nexus_devinfo *ndi; + struct nexus_softc *sc; + device_t cdev; + phandle_t node; sc = device_get_softc(dev); - start = 0; - end = ~0; + if (strcmp(device_get_name(device_get_parent(dev)), "root") == 0) { + node = OF_peer(0); - sc->sc_rman.rm_start = start; - sc->sc_rman.rm_end = end; - sc->sc_rman.rm_type = RMAN_ARRAY; - sc->sc_rman.rm_descr = "Interrupt request lines"; - if (rman_init(&sc->sc_rman) || - rman_manage_region(&sc->sc_rman, start, end)) - panic("nexus_probe IRQ rman"); + sc->sc_intr_rman.rm_type = RMAN_ARRAY; + sc->sc_intr_rman.rm_descr = "Interrupts"; + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "Device Memory"; + if (rman_init(&sc->sc_intr_rman) != 0 || + rman_init(&sc->sc_mem_rman) != 0 || + rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0 || + rman_manage_region(&sc->sc_mem_rman, 0, BUS_SPACE_MAXADDR) + != 0) + panic("%s: failed to set up rmans.", __func__); + } else + node = ofw_bus_get_node(dev); + + /* + * Allow devices to identify. + */ + bus_generic_probe(dev); - if ((root = OF_peer(0)) == 0) + /* + * If no Open Firmware, bail early + */ + if (node == -1) return (bus_generic_attach(dev)); - + /* - * Now walk the OFW tree to locate top-level devices + * Some important numbers */ - for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (child == -1) - panic("nexus_probe(): OF_child failed."); - (void)nexus_device_from_node(dev, child); + sc->acells = 2; + OF_getprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); + sc->scells = 1; + OF_getprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); + /* + * Now walk the OFW tree and attach top-level devices. + */ + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + if ((ndi = nexus_setup_dinfo(dev, node)) == NULL) + continue; + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + ndi->ndi_obdinfo.obd_name); + nexus_destroy_dinfo(ndi); + continue; + } + device_set_ivars(cdev, ndi); } - return (bus_generic_attach(dev)); } -static void -nexus_probe_nomatch(device_t dev, device_t child) +static device_t +nexus_add_child(device_t dev, u_int order, const char *name, int unit) { - const char *name, *type; + device_t cdev; + struct nexus_devinfo *ndi; - name = ofw_bus_get_name(child); - type = ofw_bus_get_type(child); + cdev = device_add_child_ordered(dev, order, name, unit); + if (cdev == NULL) + return (NULL); - if (name == NULL) - name = "unknown"; - if (type == NULL) - type = "(unknown)"; - - if (bootverbose) - device_printf(dev, "<%s>, type %s (no driver attached)\n", - name, type); + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + ndi->ndi_obdinfo.obd_node = -1; + resource_list_init(&ndi->ndi_rl); + device_set_ivars(cdev, ndi); + + return (cdev); } -static device_t -nexus_add_child(device_t dev, u_int order, const char *name, int unit) +static int +nexus_print_child(device_t bus, device_t child) { - device_t child; - struct nexus_devinfo *dinfo; + int rv; - child = device_add_child_ordered(dev, order, name, unit); - if (child == NULL) - return (NULL); + rv = bus_print_child_header(bus, child); + rv += nexus_print_res(device_get_ivars(child)); + rv += bus_print_child_footer(bus, child); + return (rv); +} - dinfo = malloc(sizeof(struct nexus_devinfo), M_NEXUS, M_NOWAIT|M_ZERO); - if (dinfo == NULL) - return (NULL); +static void +nexus_probe_nomatch(device_t bus, device_t child) +{ + const char *name, *type; - dinfo->ndi_ofwinfo.obd_node = -1; - dinfo->ndi_ofwinfo.obd_name = NULL; - dinfo->ndi_ofwinfo.obd_compat = NULL; - dinfo->ndi_ofwinfo.obd_type = NULL; - dinfo->ndi_ofwinfo.obd_model = NULL; + if (!bootverbose) + return; - device_set_ivars(child, dinfo); + name = ofw_bus_get_name(child); + type = ofw_bus_get_type(child); - return (child); + device_printf(bus, "<%s>", + name != NULL ? name : "unknown"); + nexus_print_res(device_get_ivars(child)); + printf(" type %s (no driver attached)\n", + type != NULL ? type : "unknown"); } static int -nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep) +nexus_setup_intr(device_t bus __unused, device_t child, struct resource *r, + int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, + void **cookiep) { - int error; + int error; - /* somebody tried to setup an irq that failed to allocate! */ - if (res == NULL) - panic("nexus_setup_intr: NULL irq resource!"); + if (r == NULL) + panic("%s: NULL interrupt resource!", __func__); - *cookiep = 0; - if ((rman_get_flags(res) & RF_SHAREABLE) == 0) + if ((rman_get_flags(r) & RF_SHAREABLE) == 0) flags |= INTR_EXCL; - /* - * We depend here on rman_activate_resource() being idempotent. - */ - error = rman_activate_resource(res); + /* We depend here on rman_activate_resource() being idempotent. */ + error = rman_activate_resource(r); if (error) return (error); error = powerpc_setup_intr(device_get_nameunit(child), - rman_get_start(res), filter, ihand, arg, flags, cookiep); + rman_get_start(r), filt, intr, arg, flags, cookiep); return (error); } static int -nexus_teardown_intr(device_t dev, device_t child, struct resource *res, - void *cookie) +nexus_teardown_intr(device_t bus __unused, device_t child __unused, + struct resource *r, void *ih) { + + if (r == NULL) + return (EINVAL); - return (powerpc_teardown_intr(cookie)); + return (powerpc_teardown_intr(ih)); } #ifdef SMP static int -nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) +nexus_bind_intr(device_t bus __unused, device_t child __unused, + struct resource *r, int cpu) { - return (powerpc_bind_intr(rman_get_start(irq), cpu)); + return (powerpc_bind_intr(rman_get_start(r), cpu)); } #endif - + static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol) { + + return (powerpc_config_intr(irq, trig, pol)); +} - return (powerpc_config_intr(irq, trig, pol)); -} - -/* - * Allocate resources at the behest of a child. This only handles interrupts, - * since I/O resources are handled by child busses. - */ static struct resource * nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { struct nexus_softc *sc; + struct rman *rm; struct resource *rv; + struct resource_list_entry *rle; + device_t nexus; + int isdefault, passthrough; + + isdefault = (start == 0UL && end == ~0UL); + passthrough = (device_get_parent(child) != bus); + nexus = bus; + while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) + nexus = device_get_parent(nexus); + sc = device_get_softc(nexus); + rle = NULL; + + if (!passthrough && isdefault) { + rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), + type, *rid); + if (rle == NULL) + return (NULL); + if (rle->res != NULL) + panic("%s: resource entry is busy", __func__); + start = rle->start; + count = ulmax(count, rle->count); + end = ulmax(rle->end, start + count - 1); + } - if (type != SYS_RES_IRQ) { - device_printf(bus, "unknown resource request from %s\n", - device_get_nameunit(child)); + switch (type) { + case SYS_RES_IRQ: + rm = &sc->sc_intr_rman; + break; + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + default: return (NULL); } - if (count == 0 || start + count - 1 != end) { - device_printf(bus, "invalid IRQ allocation from %s\n", - device_get_nameunit(child)); + rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, + child); + if (rv == NULL) return (NULL); - } + rman_set_rid(rv, *rid); - sc = device_get_softc(bus); + if ((flags & RF_ACTIVE) != 0 && bus_activate_resource(child, type, + *rid, rv) != 0) { + rman_release_resource(rv); + return (NULL); + } - rv = rman_reserve_resource(&sc->sc_rman, start, end, count, - flags, child); - if (rv == NULL) { - device_printf(bus, "IRQ allocation failed for %s\n", - device_get_nameunit(child)); - } else - rman_set_rid(rv, *rid); + if (!passthrough && rle != NULL) { + rle->res = rv; + rle->start = rman_get_start(rv); + rle->end = rman_get_end(rv); + rle->count = rle->end - rle->start + 1; + } return (rv); } static int -nexus_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) +nexus_activate_resource(device_t bus __unused, device_t child __unused, + int type, int rid __unused, struct resource *r) { - /* Not much to be done yet... */ - return (rman_activate_resource(res)); + if (type == SYS_RES_MEMORY) { + vm_offset_t start; + void *p; + + start = (vm_offset_t) rman_get_start(r); + if (bootverbose) + printf("nexus mapdev: start %zx, len %ld\n", start, + rman_get_size(r)); + + p = pmap_mapdev(start, (vm_size_t) rman_get_size(r)); + if (p == NULL) + return (ENOMEM); + rman_set_virtual(r, p); + rman_set_bustag(r, &bs_be_tag); + rman_set_bushandle(r, (u_long)p); + } + return (rman_activate_resource(r)); } static int -nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) +nexus_deactivate_resource(device_t bus __unused, device_t child __unused, + int type __unused, int rid __unused, struct resource *r) { - /* Not much to be done yet... */ - return (rman_deactivate_resource(res)); + /* + * If this is a memory resource, unmap it. + */ + if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { + bus_size_t psize; + + psize = rman_get_size(r); + pmap_unmapdev((vm_offset_t)rman_get_virtual(r), psize); + } + + return (rman_deactivate_resource(r)); } static int -nexus_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) +nexus_adjust_resource(device_t bus, device_t child __unused, int type, + struct resource *r, u_long start, u_long end) { + struct nexus_softc *sc; + struct rman *rm; + device_t nexus; - if (type != SYS_RES_IRQ) { - device_printf(bus, "unknown resource request from %s\n", - device_get_nameunit(child)); + nexus = bus; + while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) + nexus = device_get_parent(nexus); + sc = device_get_softc(nexus); + switch (type) { + case SYS_RES_IRQ: + rm = &sc->sc_intr_rman; + break; + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + default: return (EINVAL); } - - return (rman_release_resource(res)); + if (rm == NULL) + return (ENXIO); + if (rman_is_region_manager(r, rm) == 0) + return (EINVAL); + return (rman_adjust_resource(r, start, end)); } -static device_t -nexus_device_from_node(device_t parent, phandle_t node) +static int +nexus_release_resource(device_t bus __unused, device_t child, int type, + int rid, struct resource *r) { - device_t cdev; - struct nexus_devinfo *dinfo; + int error; - cdev = device_add_child(parent, NULL, -1); - if (cdev != NULL) { - dinfo = malloc(sizeof(*dinfo), M_NEXUS, M_WAITOK); - ofw_bus_gen_setup_devinfo(&dinfo->ndi_ofwinfo, node); - device_set_ivars(cdev, dinfo); + if ((rman_get_flags(r) & RF_ACTIVE) != 0) { + error = bus_deactivate_resource(child, type, rid, r); + if (error) + return (error); } + return (rman_release_resource(r)); +} - return (cdev); +static struct resource_list * +nexus_get_resource_list(device_t bus __unused, device_t child) +{ + struct nexus_devinfo *ndi; + + ndi = device_get_ivars(child); + return (&ndi->ndi_rl); } static const struct ofw_bus_devinfo * -nexus_get_devinfo(device_t dev, device_t child) +nexus_get_devinfo(device_t bus __unused, device_t child) +{ + struct nexus_devinfo *ndi; + + ndi = device_get_ivars(child); + return (&ndi->ndi_obdinfo); +} + +static struct nexus_devinfo * +nexus_setup_dinfo(device_t dev, phandle_t node) { - struct nexus_devinfo *dinfo; + struct nexus_softc *sc; + struct nexus_devinfo *ndi; + uint32_t *reg, *intr, icells; + uint64_t phys, size; + phandle_t iparent; + int i, j; + int nintr; + int nreg; + + sc = device_get_softc(dev); + + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&ndi->ndi_obdinfo, node) != 0) { + free(ndi, M_DEVBUF); + return (NULL); + } + if (NEXUS_EXCLUDED(ndi->ndi_obdinfo.obd_name, + ndi->ndi_obdinfo.obd_type)) { + ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); + free(ndi, M_DEVBUF); + return (NULL); + } - dinfo = device_get_ivars(child); - return (&dinfo->ndi_ofwinfo); + resource_list_init(&ndi->ndi_rl); + nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + if (nreg == -1) + nreg = 0; + if (nreg % (sc->acells + sc->scells) != 0) { + if (bootverbose) + device_printf(dev, "Malformed reg property on <%s>\n", + ndi->ndi_obdinfo.obd_name); + nreg = 0; + } + + for (i = 0; i < nreg; i += sc->acells + sc->scells) { + phys = size = 0; + for (j = 0; j < sc->acells; j++) { + phys <<= 32; + phys |= reg[i + j]; + } + for (j = 0; j < sc->scells; j++) { + size <<= 32; + size |= reg[i + sc->acells + j]; + } + /* Skip the dummy reg property of glue devices like ssm(4). */ + if (size != 0) + resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, + phys, phys + size - 1, size); + } + free(reg, M_OFWPROP); + + nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), + (void **)&intr); + if (nintr > 0) { + iparent = 0; + OF_searchprop(node, "interrupt-parent", &iparent, + sizeof(iparent)); + OF_searchprop(iparent, "#interrupt-cells", &icells, + sizeof(icells)); + for (i = 0; i < nintr; i+= icells) { + intr[i] = MAP_IRQ(iparent, intr[i]); + resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i], + intr[i], 1); + if (icells > 1) { + powerpc_config_intr(intr[i], (intr[i+1] & 1) ? + INTR_TRIGGER_LEVEL : INTR_TRIGGER_EDGE, + INTR_POLARITY_LOW); + } + } + free(intr, M_OFWPROP); + } + + return (ndi); +} + +static void +nexus_destroy_dinfo(struct nexus_devinfo *ndi) +{ + + resource_list_free(&ndi->ndi_rl); + ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); + free(ndi, M_DEVBUF); +} + +static int +nexus_print_res(struct nexus_devinfo *ndi) +{ + int rv; + + rv = 0; + rv += resource_list_print_type(&ndi->ndi_rl, "mem", SYS_RES_MEMORY, + "%#lx"); + rv += resource_list_print_type(&ndi->ndi_rl, "irq", SYS_RES_IRQ, + "%ld"); + return (rv); } From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 17:59:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6EE441B6; Tue, 13 May 2014 17:59: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 5A6632F8F; Tue, 13 May 2014 17:59: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 s4DHxKNd008727; Tue, 13 May 2014 17:59:20 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DHxIqw008713; Tue, 13 May 2014 17:59:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131759.s4DHxIqw008713@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 17:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265967 - in stable/10/sys: arm/mv dev/fdt dev/ofw powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 17:59:20 -0000 Author: ian Date: Tue May 13 17:59:17 2014 New Revision: 265967 URL: http://svnweb.freebsd.org/changeset/base/265967 Log: MFC r256932, r256938, r256966, r256953, r256967, r256969, r257015: Add a new function (OF_getencprop()) that undoes the transformation applied by encode-int. Specifically, it takes a set of 32-bit cell values and changes them to host byte order. Most non-string instances of OF_getprop() should be using this function, which is a no-op on big-endian platforms. Use the new function all over the place. Modified: stable/10/sys/arm/mv/gpio.c stable/10/sys/dev/fdt/fdt_common.c stable/10/sys/dev/fdt/fdt_pci.c stable/10/sys/dev/fdt/simplebus.c stable/10/sys/dev/ofw/ofw_bus_subr.c stable/10/sys/dev/ofw/ofw_console.c stable/10/sys/dev/ofw/ofw_fdt.c stable/10/sys/dev/ofw/ofw_iicbus.c stable/10/sys/dev/ofw/openfirm.c stable/10/sys/powerpc/powerpc/nexus.c Modified: stable/10/sys/arm/mv/gpio.c ============================================================================== --- stable/10/sys/arm/mv/gpio.c Tue May 13 17:51:15 2014 (r265966) +++ stable/10/sys/arm/mv/gpio.c Tue May 13 17:59:17 2014 (r265967) @@ -605,7 +605,6 @@ int platform_gpio_init(void) { phandle_t child, parent, root, ctrl; - ihandle_t ctrl_ihandle; pcell_t gpios[MAX_PINS_PER_NODE * GPIOS_PROP_CELLS]; struct gpio_ctrl_entry *e; int len, rv; @@ -639,9 +638,7 @@ platform_gpio_init(void) * contain a ref. to a node defining GPIO * controller. */ - ctrl_ihandle = (ihandle_t)gpios[0]; - ctrl_ihandle = fdt32_to_cpu(ctrl_ihandle); - ctrl = OF_instance_to_package(ctrl_ihandle); + ctrl = OF_xref_phandle(fdt32_to_cpu(gpios[0])); if (fdt_is_compatible(ctrl, e->compat)) /* Call a handler. */ Modified: stable/10/sys/dev/fdt/fdt_common.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.c Tue May 13 17:51:15 2014 (r265966) +++ stable/10/sys/dev/fdt/fdt_common.c Tue May 13 17:59:17 2014 (r265967) @@ -523,7 +523,7 @@ fdt_intr_to_rl(phandle_t node, struct re /* * Find #interrupt-cells of the interrupt domain. */ - if (OF_getprop(node, "interrupt-parent", &iph, sizeof(iph)) <= 0) { + if (OF_getencprop(node, "interrupt-parent", &iph, sizeof(iph)) <= 0) { debugf("no intr-parent phandle\n"); intr_par = OF_parent(node); } else { @@ -583,7 +583,7 @@ fdt_get_phyaddr(phandle_t node, device_t uint32_t i; device_t parent, child; - if (OF_getprop(node, "phy-handle", (void *)&phy_handle, + if (OF_getencprop(node, "phy-handle", (void *)&phy_handle, sizeof(phy_handle)) <= 0) return (ENXIO); Modified: stable/10/sys/dev/fdt/fdt_pci.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_pci.c Tue May 13 17:51:15 2014 (r265966) +++ stable/10/sys/dev/fdt/fdt_pci.c Tue May 13 17:59:17 2014 (r265967) @@ -258,7 +258,7 @@ fdt_pci_route_intr(int bus, int slot, in struct fdt_pci_intr *intr_info, int *interrupt) { pcell_t child_spec[4], masked[4]; - ihandle_t iph; + phandle_t iph; pcell_t intr_par; pcell_t *map_ptr; uint32_t addr; @@ -283,7 +283,7 @@ fdt_pci_route_intr(int bus, int slot, in i = 0; while (i < map_len) { iph = fdt32_to_cpu(map_ptr[par_idx]); - intr_par = OF_instance_to_package(iph); + intr_par = OF_xref_phandle(iph); err = fdt_addr_cells(intr_par, &par_addr_cells); if (err != 0) { Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Tue May 13 17:51:15 2014 (r265966) +++ stable/10/sys/dev/fdt/simplebus.c Tue May 13 17:59:17 2014 (r265967) @@ -339,8 +339,7 @@ simplebus_get_interrupt_parent(device_t struct simplebus_devinfo *di; struct fdt_ic *ic; device_t ip; - ihandle_t iph; - phandle_t ph; + phandle_t ph, iph; ip = NULL; @@ -348,10 +347,9 @@ simplebus_get_interrupt_parent(device_t if (di == NULL) return (NULL); - if (OF_getprop(di->di_ofw.obd_node, "interrupt-parent", &iph, + if (OF_getencprop(di->di_ofw.obd_node, "interrupt-parent", &iph, sizeof(iph)) > 0) { - iph = fdt32_to_cpu(iph); - ph = OF_instance_to_package(iph); + ph = OF_xref_phandle(iph); SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { if (ic->iph == ph) { ip = ic->dev; Modified: stable/10/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.c Tue May 13 17:51:15 2014 (r265966) +++ stable/10/sys/dev/ofw/ofw_bus_subr.c Tue May 13 17:59:17 2014 (r265967) @@ -229,14 +229,14 @@ ofw_bus_setup_iinfo(phandle_t node, stru pcell_t addrc; int msksz; - if (OF_getprop(node, "#address-cells", &addrc, sizeof(addrc)) == -1) + if (OF_getencprop(node, "#address-cells", &addrc, sizeof(addrc)) == -1) addrc = 2; ii->opi_addrc = addrc * sizeof(pcell_t); - ii->opi_imapsz = OF_getprop_alloc(node, "interrupt-map", 1, + ii->opi_imapsz = OF_getencprop_alloc(node, "interrupt-map", 1, (void **)&ii->opi_imap); if (ii->opi_imapsz > 0) { - msksz = OF_getprop_alloc(node, "interrupt-map-mask", 1, + msksz = OF_getencprop_alloc(node, "interrupt-map-mask", 1, (void **)&ii->opi_imapmsk); /* * Failure to get the mask is ignored; a full mask is used @@ -261,7 +261,7 @@ ofw_bus_lookup_imap(phandle_t node, stru ("ofw_bus_lookup_imap: register size too small: %d < %d", regsz, ii->opi_addrc)); if (node != -1) { - rv = OF_getprop(node, "reg", reg, regsz); + rv = OF_getencprop(node, "reg", reg, regsz); if (rv < regsz) panic("ofw_bus_lookup_imap: cannot get reg property"); } @@ -316,8 +316,8 @@ ofw_bus_search_intrmap(void *intr, int i i = imapsz; while (i > 0) { bcopy(mptr + physsz + intrsz, &parent, sizeof(parent)); - if (OF_searchprop(OF_xref_phandle(parent), "#interrupt-cells", - &pintrsz, sizeof(pintrsz)) == -1) + if (OF_searchencprop(OF_xref_phandle(parent), + "#interrupt-cells", &pintrsz, sizeof(pintrsz)) == -1) pintrsz = 1; /* default */ pintrsz *= sizeof(pcell_t); Modified: stable/10/sys/dev/ofw/ofw_console.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_console.c Tue May 13 17:51:15 2014 (r265966) +++ stable/10/sys/dev/ofw/ofw_console.c Tue May 13 17:59:17 2014 (r265967) @@ -106,8 +106,8 @@ cn_drvinit(void *unused) SYSINIT(cndev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, cn_drvinit, NULL); -static int stdin; -static int stdout; +static pcell_t stdin; +static pcell_t stdout; static int ofwtty_open(struct tty *tp) @@ -170,12 +170,12 @@ ofw_cnprobe(struct consdev *cp) return; } - if (OF_getprop(chosen, "stdin", &stdin, sizeof(stdin)) == -1) { + if (OF_getencprop(chosen, "stdin", &stdin, sizeof(stdin)) == -1) { cp->cn_pri = CN_DEAD; return; } - if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) { + if (OF_getencprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) { cp->cn_pri = CN_DEAD; return; } Modified: stable/10/sys/dev/ofw/ofw_fdt.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_fdt.c Tue May 13 17:51:15 2014 (r265966) +++ stable/10/sys/dev/ofw/ofw_fdt.c Tue May 13 17:59:17 2014 (r265967) @@ -226,20 +226,8 @@ ofw_fdt_parent(ofw_t ofw, phandle_t node static phandle_t ofw_fdt_instance_to_package(ofw_t ofw, ihandle_t instance) { - int offset; - - /* - * Note: FDT does not have the notion of instances, but we somewhat - * abuse the semantics and let treat as 'instance' the internal - * 'phandle' prop, so that ofw I/F consumers have a uniform way of - * translation between internal representation (which appear in some - * contexts as property values) and effective phandles. - */ - offset = fdt_node_offset_by_phandle(fdtp, instance); - if (offset < 0) - return (-1); - return (fdt_offset_phandle(offset)); + return (-1); } /* Get the length of a property of a package. */ Modified: stable/10/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_iicbus.c Tue May 13 17:51:15 2014 (r265966) +++ stable/10/sys/dev/ofw/ofw_iicbus.c Tue May 13 17:59:17 2014 (r265967) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -104,7 +103,6 @@ ofw_iicbus_attach(device_t dev) phandle_t child; pcell_t paddr; device_t childdev; - uint32_t addr; sc->dev = dev; mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF); @@ -123,11 +121,12 @@ ofw_iicbus_attach(device_t dev) * property, then try the reg property. It moves around * on different systems. */ - if (OF_getprop(child, "i2c-address", &paddr, sizeof(paddr)) == -1) - if (OF_getprop(child, "reg", &paddr, sizeof(paddr)) == -1) + if (OF_getencprop(child, "i2c-address", &paddr, + sizeof(paddr)) == -1) + if (OF_getencprop(child, "reg", &paddr, + sizeof(paddr)) == -1) continue; - addr = fdt32_to_cpu(paddr); /* * Now set up the I2C and OFW bus layer devinfo and add it * to the bus. @@ -136,7 +135,7 @@ ofw_iicbus_attach(device_t dev) M_NOWAIT | M_ZERO); if (dinfo == NULL) continue; - dinfo->opd_dinfo.addr = addr; + dinfo->opd_dinfo.addr = paddr; if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) != 0) { free(dinfo, M_DEVBUF); Modified: stable/10/sys/dev/ofw/openfirm.c ============================================================================== --- stable/10/sys/dev/ofw/openfirm.c Tue May 13 17:51:15 2014 (r265966) +++ stable/10/sys/dev/ofw/openfirm.c Tue May 13 17:59:17 2014 (r265967) @@ -135,7 +135,8 @@ OF_init(void *cookie) rv = OFW_INIT(ofw_obj, cookie); if ((chosen = OF_finddevice("/chosen")) != -1) - if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) + if (OF_getencprop(chosen, "stdout", &stdout, + sizeof(stdout)) == -1) stdout = -1; return (rv); @@ -354,11 +355,9 @@ OF_getencprop_alloc(phandle_t package, c pcell_t *cell; int i; - KASSERT(elsz % 4 == 0, ("Need a multiple of 4 bytes")); - retval = OF_getprop_alloc(package, name, elsz, buf); - if (retval == -1) - return (retval); + if (retval == -1 || retval*elsz % 4 != 0) + return (-1); cell = *buf; for (i = 0; i < retval*elsz/4; i++) @@ -450,9 +449,9 @@ OF_child_xref_phandle(phandle_t parent, if (rxref != -1) return (rxref); - if (OF_getprop(child, "phandle", &rxref, sizeof(rxref)) == -1 && - OF_getprop(child, "ibm,phandle", &rxref, - sizeof(rxref)) == -1 && OF_getprop(child, + if (OF_getencprop(child, "phandle", &rxref, sizeof(rxref)) == + -1 && OF_getencprop(child, "ibm,phandle", &rxref, + sizeof(rxref)) == -1 && OF_getencprop(child, "linux,phandle", &rxref, sizeof(rxref)) == -1) continue; Modified: stable/10/sys/powerpc/powerpc/nexus.c ============================================================================== --- stable/10/sys/powerpc/powerpc/nexus.c Tue May 13 17:51:15 2014 (r265966) +++ stable/10/sys/powerpc/powerpc/nexus.c Tue May 13 17:59:17 2014 (r265967) @@ -248,9 +248,9 @@ nexus_attach(device_t dev) * Some important numbers */ sc->acells = 2; - OF_getprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); + OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); sc->scells = 1; - OF_getprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); + OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); /* * Now walk the OFW tree and attach top-level devices. @@ -564,7 +564,7 @@ nexus_setup_dinfo(device_t dev, phandle_ } resource_list_init(&ndi->ndi_rl); - nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + nreg = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®); if (nreg == -1) nreg = 0; if (nreg % (sc->acells + sc->scells) != 0) { @@ -591,7 +591,7 @@ nexus_setup_dinfo(device_t dev, phandle_ } free(reg, M_OFWPROP); - nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), + nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { iparent = 0; From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 18:00:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EC724342; Tue, 13 May 2014 18:00: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 D96932FAE; Tue, 13 May 2014 18:00: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 s4DI0fCv011751; Tue, 13 May 2014 18:00:41 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DI0fGk011750; Tue, 13 May 2014 18:00:41 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131800.s4DI0fGk011750@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 18:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265968 - stable/10/sys/powerpc/booke X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 18:00:42 -0000 Author: ian Date: Tue May 13 18:00:41 2014 New Revision: 265968 URL: http://svnweb.freebsd.org/changeset/base/265968 Log: MFC r256973, r256974 If the device tree directly contains the timebase frequency, use it. This property is required by ePAPR, but maintain the fallback to bus-frequency for compatibility. Allow 32 or 64 bits. Modified: stable/10/sys/powerpc/booke/platform_bare.c Modified: stable/10/sys/powerpc/booke/platform_bare.c ============================================================================== --- stable/10/sys/powerpc/booke/platform_bare.c Tue May 13 17:59:17 2014 (r265967) +++ stable/10/sys/powerpc/booke/platform_bare.c Tue May 13 18:00:41 2014 (r265968) @@ -188,6 +188,25 @@ bare_timebase_freq(platform_t plat, stru if ((child = OF_child(cpus)) == 0) goto out; + switch (OF_getproplen(child, "timebase-frequency")) { + case 4: + { + uint32_t tbase; + OF_getprop(child, "timebase-frequency", &tbase, sizeof(tbase)); + ticks = tbase; + return (ticks); + } + case 8: + { + uint64_t tbase; + OF_getprop(child, "timebase-frequency", &tbase, sizeof(tbase)); + ticks = tbase; + return (ticks); + } + default: + break; + } + freq = 0; if (OF_getprop(child, "bus-frequency", (void *)&freq, sizeof(freq)) <= 0) From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 18:06:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CB71F57D; Tue, 13 May 2014 18:06: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 B5A86205A; Tue, 13 May 2014 18:06: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 s4DI6Tnl013303; Tue, 13 May 2014 18:06:29 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DI6QS4013286; Tue, 13 May 2014 18:06:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131806.s4DI6QS4013286@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 18:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265969 - in stable/10/sys: conf dev/fdt dev/ofw powerpc/include powerpc/mpc85xx powerpc/ofw powerpc/powerpc powerpc/pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 18:06:29 -0000 Author: ian Date: Tue May 13 18:06:26 2014 New Revision: 265969 URL: http://svnweb.freebsd.org/changeset/base/265969 Log: MFC r256994, r257016, r257055, r257059, r257060, r257075 Add two new interfaces to ofw_bus: - ofw_bus_map_intr() Maps an (iparent, IRQ) tuple to a system-global interrupt number in some platform dependent way. This is meant to be implemented as a replacement for [FDT_]MAP_IRQ() that is an MI interface that knows about the bus hierarchy. - ofw_bus_config_intr() Configures an interrupt (previously mapped) based on firmware sense flags. This replaces manual interpretation of the sense field in bus drivers and will, in a follow-up, allow that interpretation to be redirected to the PIC drivers where it belongs. This will eventually replace the tables in /sys/dev/fdt/fdt_ARCH.c The PowerPC/AIM code has been converted to use these globally, with an implementation in terms of MAP_IRQ() and powerpc_config_intr(), assuming OpenPIC, at the bus root in nexus(4). The ofw_bus_config_intr() will shortly be integrated into pic_if.m and bounced through nexus into the PIC tree. Factor out MI portions of the PowerPC nexus device into /sys/dev/ofw. The sparc64 driver will be modified to use this shortly. Allow PIC drivers to translate firmware sense codes for themselves. This is designed to replace the tables in dev/fdt/fdt_ARCH.c, but will not happen quite yet. Do not map IRQs twice. This fixes PowerPC/FDT systems with multiple PICs, which would try to treat the previously-mapped interrupts from fdt_decode_intr() as interrupt line numbers on the same parent PIC. Remove some of the code required for supporting ssm(4) on SPARC in favor of a more PowerPC/FDT-focused design. Whenever SPARC64 is integrated into this rework, this should be (trivially) revisited. Added: stable/10/sys/dev/ofw/ofw_nexus.c - copied, changed from r257016, head/sys/dev/ofw/ofw_nexus.c stable/10/sys/dev/ofw/ofw_nexus.h - copied unchanged from r257016, head/sys/dev/ofw/ofw_nexus.h Modified: stable/10/sys/conf/files.powerpc stable/10/sys/dev/fdt/fdt_common.c stable/10/sys/dev/ofw/ofw_bus.h stable/10/sys/dev/ofw/ofw_bus_if.m stable/10/sys/powerpc/include/intr_machdep.h stable/10/sys/powerpc/mpc85xx/atpic.c stable/10/sys/powerpc/ofw/ofw_pci.c stable/10/sys/powerpc/ofw/ofw_pcib_pci.c stable/10/sys/powerpc/ofw/ofw_pcibus.c stable/10/sys/powerpc/ofw/openpic_ofw.c stable/10/sys/powerpc/powerpc/intr_machdep.c stable/10/sys/powerpc/powerpc/nexus.c stable/10/sys/powerpc/powerpc/pic_if.m stable/10/sys/powerpc/pseries/vdevice.c Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/conf/files.powerpc Tue May 13 18:06:26 2014 (r265969) @@ -48,6 +48,7 @@ dev/ofw/ofw_bus_subr.c optional aim dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim dev/ofw/ofw_iicbus.c optional iicbus aim +dev/ofw/ofw_nexus.c optional aim | fdt dev/ofw/ofw_standard.c optional aim powerpc dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx Modified: stable/10/sys/dev/fdt/fdt_common.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.c Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/dev/fdt/fdt_common.c Tue May 13 18:06:26 2014 (r265969) @@ -514,7 +514,7 @@ fdt_intr_to_rl(phandle_t node, struct re pcell_t *intr; pcell_t intr_cells; int interrupt, trig, pol; - int i, intr_num, irq, rv; + int i, intr_num, rv; if (OF_getproplen(node, "interrupts") <= 0) /* Node does not have 'interrupts' property. */ @@ -566,8 +566,7 @@ fdt_intr_to_rl(phandle_t node, struct re intr_sl[i].trig = trig; intr_sl[i].pol = pol; - irq = FDT_MAP_IRQ(iph, interrupt); - resource_list_add(rl, SYS_RES_IRQ, i, irq, irq, 1); + resource_list_add(rl, SYS_RES_IRQ, i, interrupt, interrupt, 1); } out: Modified: stable/10/sys/dev/ofw/ofw_bus.h ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus.h Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/dev/ofw/ofw_bus.h Tue May 13 18:06:26 2014 (r265969) @@ -70,4 +70,16 @@ ofw_bus_get_type(device_t dev) return (OFW_BUS_GET_TYPE(device_get_parent(dev), dev)); } +static __inline int +ofw_bus_map_intr(device_t dev, phandle_t iparent, int irq) +{ + return (OFW_BUS_MAP_INTR(dev, dev, iparent, irq)); +} + +static __inline int +ofw_bus_config_intr(device_t dev, int irq, int sense) +{ + return (OFW_BUS_CONFIG_INTR(dev, dev, irq, sense)); +} + #endif /* !_DEV_OFW_OFW_BUS_H_ */ Modified: stable/10/sys/dev/ofw/ofw_bus_if.m ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_if.m Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/dev/ofw/ofw_bus_if.m Tue May 13 18:06:26 2014 (r265969) @@ -56,6 +56,8 @@ CODE { static ofw_bus_get_name_t ofw_bus_default_get_name; static ofw_bus_get_node_t ofw_bus_default_get_node; static ofw_bus_get_type_t ofw_bus_default_get_type; + static ofw_bus_map_intr_t ofw_bus_default_map_intr; + static ofw_bus_config_intr_t ofw_bus_default_config_intr; static const struct ofw_bus_devinfo * ofw_bus_default_get_devinfo(device_t bus, device_t dev) @@ -98,6 +100,31 @@ CODE { return (NULL); } + + int + ofw_bus_default_map_intr(device_t bus, device_t dev, phandle_t iparent, + int irq) + { + /* Propagate up the bus hierarchy until someone handles it. */ + if (device_get_parent(bus) != NULL) + return OFW_BUS_MAP_INTR(device_get_parent(bus), dev, + iparent, irq); + + /* If that fails, then assume a one-domain system */ + return (irq); + } + + int + ofw_bus_default_config_intr(device_t bus, device_t dev, int irq, + int sense) + { + /* Propagate up the bus hierarchy until someone handles it. */ + if (device_get_parent(bus) != NULL) + return OFW_BUS_CONFIG_INTR(device_get_parent(bus), dev, + irq, sense); + + return (ENXIO); + } }; # Get the ofw_bus_devinfo struct for the device dev on the bus. Used for bus @@ -143,3 +170,22 @@ METHOD const char * get_type { device_t bus; device_t dev; } DEFAULT ofw_bus_default_get_type; + +# Map an (interrupt parent, IRQ) pair to a unique system-wide interrupt number. +METHOD int map_intr { + device_t bus; + device_t dev; + phandle_t iparent; + int irq; +} DEFAULT ofw_bus_default_map_intr; + +# Configure an interrupt using the device-tree encoded sense key (the second +# value in the interrupts property if interrupt-cells is 2). IRQ should be +# encoded as from ofw_bus_map_intr(). +METHOD int config_intr { + device_t bus; + device_t dev; + int irq; + int sense; +} DEFAULT ofw_bus_default_config_intr; + Copied and modified: stable/10/sys/dev/ofw/ofw_nexus.c (from r257016, head/sys/dev/ofw/ofw_nexus.c) ============================================================================== --- head/sys/dev/ofw/ofw_nexus.c Wed Oct 23 20:00:14 2013 (r257016, copy source) +++ stable/10/sys/dev/ofw/ofw_nexus.c Tue May 13 18:06:26 2014 (r265969) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include /* @@ -188,21 +187,17 @@ nexus_attach(device_t dev) sc = device_get_softc(dev); - if (strcmp(device_get_name(device_get_parent(dev)), "root") == 0) { - node = OF_peer(0); + node = OF_peer(0); - sc->sc_intr_rman.rm_type = RMAN_ARRAY; - sc->sc_intr_rman.rm_descr = "Interrupts"; - sc->sc_mem_rman.rm_type = RMAN_ARRAY; - sc->sc_mem_rman.rm_descr = "Device Memory"; - if (rman_init(&sc->sc_intr_rman) != 0 || - rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0 || - rman_manage_region(&sc->sc_mem_rman, 0, BUS_SPACE_MAXADDR) - != 0) - panic("%s: failed to set up rmans.", __func__); - } else - node = ofw_bus_get_node(dev); + sc->sc_intr_rman.rm_type = RMAN_ARRAY; + sc->sc_intr_rman.rm_descr = "Interrupts"; + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "Device Memory"; + if (rman_init(&sc->sc_intr_rman) != 0 || + rman_init(&sc->sc_mem_rman) != 0 || + rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0 || + rman_manage_region(&sc->sc_mem_rman, 0, BUS_SPACE_MAXADDR) != 0) + panic("%s: failed to set up rmans.", __func__); /* * Allow devices to identify. @@ -296,15 +291,11 @@ nexus_alloc_resource(device_t bus, devic struct rman *rm; struct resource *rv; struct resource_list_entry *rle; - device_t nexus; int isdefault, passthrough; isdefault = (start == 0UL && end == ~0UL); passthrough = (device_get_parent(child) != bus); - nexus = bus; - while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) - nexus = device_get_parent(nexus); - sc = device_get_softc(nexus); + sc = device_get_softc(bus); rle = NULL; if (!passthrough && isdefault) { @@ -471,9 +462,9 @@ nexus_setup_dinfo(device_t dev, phandle_ (void **)&intr); if (nintr > 0) { iparent = 0; - OF_searchprop(node, "interrupt-parent", &iparent, + OF_searchencprop(node, "interrupt-parent", &iparent, sizeof(iparent)); - OF_searchprop(iparent, "#interrupt-cells", &icells, + OF_searchencprop(iparent, "#interrupt-cells", &icells, sizeof(icells)); for (i = 0; i < nintr; i+= icells) { intr[i] = ofw_bus_map_intr(dev, iparent, intr[i]); Copied: stable/10/sys/dev/ofw/ofw_nexus.h (from r257016, head/sys/dev/ofw/ofw_nexus.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/ofw/ofw_nexus.h Tue May 13 18:06:26 2014 (r265969, copy of r257016, head/sys/dev/ofw/ofw_nexus.h) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OFW_NEXUS_H_ +#define _OFW_NEXUS_H_ + +struct ofw_nexus_softc { + uint32_t acells, scells; + struct rman sc_intr_rman; + struct rman sc_mem_rman; +}; + +DECLARE_CLASS(ofw_nexus_driver); + +#endif /* _OFW_NEXUS_H_ */ Modified: stable/10/sys/powerpc/include/intr_machdep.h ============================================================================== --- stable/10/sys/powerpc/include/intr_machdep.h Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/powerpc/include/intr_machdep.h Tue May 13 18:06:26 2014 (r265969) @@ -56,5 +56,6 @@ int powerpc_setup_intr(const char *, u_i int powerpc_teardown_intr(void *); int powerpc_bind_intr(u_int irq, u_char cpu); int powerpc_config_intr(int, enum intr_trigger, enum intr_polarity); +int powerpc_fw_config_intr(int irq, int sense_code); #endif /* _MACHINE_INTR_MACHDEP_H_ */ Modified: stable/10/sys/powerpc/mpc85xx/atpic.c ============================================================================== --- stable/10/sys/powerpc/mpc85xx/atpic.c Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/powerpc/mpc85xx/atpic.c Tue May 13 18:06:26 2014 (r265969) @@ -79,6 +79,9 @@ static void atpic_ipi(device_t, u_int); static void atpic_mask(device_t, u_int); static void atpic_unmask(device_t, u_int); +static void atpic_ofw_translate_code(device_t, u_int irq, int code, + enum intr_trigger *trig, enum intr_polarity *pol); + static device_method_t atpic_isa_methods[] = { /* Device interface */ DEVMETHOD(device_identify, atpic_isa_identify), @@ -94,6 +97,8 @@ static device_method_t atpic_isa_methods DEVMETHOD(pic_mask, atpic_mask), DEVMETHOD(pic_unmask, atpic_unmask), + DEVMETHOD(pic_translate_code, atpic_ofw_translate_code), + { 0, 0 }, }; @@ -325,3 +330,35 @@ atpic_unmask(device_t dev, u_int irq) atpic_write(sc, ATPIC_MASTER, 1, sc->sc_mask[ATPIC_MASTER]); } } + +static void +atpic_ofw_translate_code(device_t dev, u_int irq, int code, + enum intr_trigger *trig, enum intr_polarity *pol) +{ + switch (code) { + case 0: + /* Active L level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_LOW; + break; + case 1: + /* Active H level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_HIGH; + break; + case 2: + /* H to L edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_LOW; + break; + case 3: + /* L to H edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_HIGH; + break; + default: + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + } +} + Modified: stable/10/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_pci.c Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/powerpc/ofw/ofw_pci.c Tue May 13 18:06:26 2014 (r265969) @@ -272,7 +272,7 @@ ofw_pci_route_interrupt(device_t bus, de if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), &iparent, maskbuf)) - return (MAP_IRQ(iparent, mintr)); + return (ofw_bus_map_intr(dev, iparent, mintr)); /* Maybe it's a real interrupt, not an intpin */ if (pin > 4) Modified: stable/10/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_pcib_pci.c Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/powerpc/ofw/ofw_pcib_pci.c Tue May 13 18:06:26 2014 (r265969) @@ -157,7 +157,7 @@ ofw_pcib_pci_route_interrupt(device_t br * it again on higher levels - that causes problems * in some cases, and never seems to be required. */ - return (MAP_IRQ(iparent, mintr)); + return (ofw_bus_map_intr(dev, iparent, mintr)); } } else if (intpin >= 1 && intpin <= 4) { /* Modified: stable/10/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_pcibus.c Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/powerpc/ofw/ofw_pcibus.c Tue May 13 18:06:26 2014 (r265969) @@ -215,15 +215,13 @@ ofw_pcibus_enum_devtree(device_t dev, u_ OF_getprop(OF_xref_phandle(iparent), "#interrupt-cells", &icells, sizeof(icells)); - intr[0] = MAP_IRQ(iparent, intr[0]); + intr[0] = ofw_bus_map_intr(dev, iparent, + intr[0]); } - if (iparent != 0 && icells > 1) { - powerpc_config_intr(intr[0], - (intr[1] & 1) ? INTR_TRIGGER_LEVEL : - INTR_TRIGGER_EDGE, - INTR_POLARITY_LOW); - } + if (iparent != 0 && icells > 1) + ofw_bus_config_intr(dev, intr[0], + intr[1]); resource_list_add(&dinfo->opd_dinfo.resources, SYS_RES_IRQ, 0, intr[0], intr[0], 1); @@ -341,12 +339,13 @@ ofw_pcibus_assign_interrupt(device_t dev isz = OF_getprop(node, "AAPL,interrupts", &intr, sizeof(intr)); if (isz == sizeof(intr)) - return ((iparent == -1) ? intr : MAP_IRQ(iparent, intr)); + return ((iparent == -1) ? intr : ofw_bus_map_intr(dev, iparent, + intr)); isz = OF_getprop(node, "interrupts", &intr, sizeof(intr)); if (isz == sizeof(intr)) { if (iparent != -1) - intr = MAP_IRQ(iparent, intr); + intr = ofw_bus_map_intr(dev, iparent, intr); } else { /* No property: our best guess is the intpin. */ intr = pci_get_intpin(child); Modified: stable/10/sys/powerpc/ofw/openpic_ofw.c ============================================================================== --- stable/10/sys/powerpc/ofw/openpic_ofw.c Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/powerpc/ofw/openpic_ofw.c Tue May 13 18:06:26 2014 (r265969) @@ -61,6 +61,9 @@ __FBSDID("$FreeBSD$"); static int openpic_ofw_probe(device_t); static int openpic_ofw_attach(device_t); +static void openpic_ofw_translate_code(device_t, u_int irq, int code, + enum intr_trigger *trig, enum intr_polarity *pol); + static device_method_t openpic_ofw_methods[] = { /* Device interface */ DEVMETHOD(device_probe, openpic_ofw_probe), @@ -76,6 +79,8 @@ static device_method_t openpic_ofw_meth DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_unmask), + DEVMETHOD(pic_translate_code, openpic_ofw_translate_code), + DEVMETHOD_END }; @@ -127,3 +132,34 @@ openpic_ofw_attach(device_t dev) return (openpic_common_attach(dev, xref)); } +static void +openpic_ofw_translate_code(device_t dev, u_int irq, int code, + enum intr_trigger *trig, enum intr_polarity *pol) +{ + switch (code) { + case 0: + /* L to H edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_HIGH; + break; + case 1: + /* Active L level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_LOW; + break; + case 2: + /* Active H level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_HIGH; + break; + case 3: + /* H to L edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_LOW; + break; + default: + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + } +} + Modified: stable/10/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/intr_machdep.c Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/powerpc/powerpc/intr_machdep.c Tue May 13 18:06:26 2014 (r265969) @@ -102,6 +102,7 @@ struct powerpc_intr { cpuset_t cpu; enum intr_trigger trig; enum intr_polarity pol; + int fwcode; }; struct pic { @@ -427,6 +428,9 @@ powerpc_enable_intr(void) if (error) continue; + if (i->trig == -1) + PIC_TRANSLATE_CODE(i->pic, i->intline, i->fwcode, + &i->trig, &i->pol); if (i->trig != INTR_TRIGGER_CONFORM || i->pol != INTR_POLARITY_CONFORM) PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); @@ -469,15 +473,21 @@ powerpc_setup_intr(const char *name, u_i if (!cold) { error = powerpc_map_irq(i); - if (!error && (i->trig != INTR_TRIGGER_CONFORM || - i->pol != INTR_POLARITY_CONFORM)) - PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); + if (!error) { + if (i->trig == -1) + PIC_TRANSLATE_CODE(i->pic, i->intline, + i->fwcode, &i->trig, &i->pol); + + if (i->trig != INTR_TRIGGER_CONFORM || + i->pol != INTR_POLARITY_CONFORM) + PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); - if (!error && i->pic == root_pic) - PIC_BIND(i->pic, i->intline, i->cpu); + if (i->pic == root_pic) + PIC_BIND(i->pic, i->intline, i->cpu); - if (!error && enable) - PIC_ENABLE(i->pic, i->intline, i->vector); + if (enable) + PIC_ENABLE(i->pic, i->intline, i->vector); + } } return (error); } @@ -504,6 +514,28 @@ powerpc_bind_intr(u_int irq, u_char cpu) #endif int +powerpc_fw_config_intr(int irq, int sense_code) +{ + struct powerpc_intr *i; + + i = intr_lookup(irq); + if (i == NULL) + return (ENOMEM); + + i->trig = -1; + i->pol = INTR_POLARITY_CONFORM; + i->fwcode = sense_code; + + if (!cold && i->pic != NULL) { + PIC_TRANSLATE_CODE(i->pic, i->intline, i->fwcode, &i->trig, + &i->pol); + PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); + } + + return (0); +} + +int powerpc_config_intr(int irq, enum intr_trigger trig, enum intr_polarity pol) { struct powerpc_intr *i; Modified: stable/10/sys/powerpc/powerpc/nexus.c ============================================================================== --- stable/10/sys/powerpc/powerpc/nexus.c Tue May 13 18:00:41 2014 (r265968) +++ stable/10/sys/powerpc/powerpc/nexus.c Tue May 13 18:06:26 2014 (r265969) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -63,260 +64,45 @@ __FBSDID("$FreeBSD$"); * * Additionally, interrupt setup/teardown and some resource management are * done at this level. - * - * Maybe this code should get into dev/ofw to some extent, as some of it should - * work for all Open Firmware based machines... */ -struct nexus_devinfo { - struct ofw_bus_devinfo ndi_obdinfo; - struct resource_list ndi_rl; -}; - -struct nexus_softc { - uint32_t acells, scells; - struct rman sc_intr_rman; - struct rman sc_mem_rman; -}; - -static device_probe_t nexus_probe; -static device_attach_t nexus_attach; -static bus_print_child_t nexus_print_child; -static bus_add_child_t nexus_add_child; -static bus_probe_nomatch_t nexus_probe_nomatch; static bus_setup_intr_t nexus_setup_intr; static bus_teardown_intr_t nexus_teardown_intr; -static bus_alloc_resource_t nexus_alloc_resource; static bus_activate_resource_t nexus_activate_resource; static bus_deactivate_resource_t nexus_deactivate_resource; -static bus_adjust_resource_t nexus_adjust_resource; -static bus_release_resource_t nexus_release_resource; -static bus_get_resource_list_t nexus_get_resource_list; #ifdef SMP static bus_bind_intr_t nexus_bind_intr; #endif static bus_config_intr_t nexus_config_intr; -static ofw_bus_get_devinfo_t nexus_get_devinfo; - -static int nexus_inlist(const char *, const char *const *); -static struct nexus_devinfo * nexus_setup_dinfo(device_t, phandle_t); -static void nexus_destroy_dinfo(struct nexus_devinfo *); -static int nexus_print_res(struct nexus_devinfo *); +static ofw_bus_map_intr_t nexus_ofw_map_intr; +static ofw_bus_config_intr_t nexus_ofw_config_intr; static device_method_t nexus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, nexus_probe), - DEVMETHOD(device_attach, nexus_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - /* Bus interface */ - DEVMETHOD(bus_print_child, nexus_print_child), - DEVMETHOD(bus_probe_nomatch, nexus_probe_nomatch), - DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), - DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), - DEVMETHOD(bus_add_child, nexus_add_child), - DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), - DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), - DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), - DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), - DEVMETHOD(bus_get_resource_list, nexus_get_resource_list), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif DEVMETHOD(bus_config_intr, nexus_config_intr), /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_devinfo, nexus_get_devinfo), - DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), - DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), - DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), - DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), - DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr), + DEVMETHOD(ofw_bus_config_intr, nexus_ofw_config_intr), DEVMETHOD_END }; static devclass_t nexus_devclass; -DEFINE_CLASS_0(nexus, nexus_driver, nexus_methods, sizeof(struct nexus_softc)); +DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods, + sizeof(struct ofw_nexus_softc), ofw_nexus_driver); EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, BUS_PASS_BUS); MODULE_VERSION(nexus, 1); -static const char *const nexus_excl_name[] = { - "FJSV,system", - "aliases", - "associations", - "chosen", - "cmp", - "counter-timer", /* No separate device; handled by psycho/sbus */ - "failsafe", - "memory", - "openprom", - "options", - "packages", - "physical-memory", - "rsc", - "sgcn", - "todsg", - "virtual-memory", - NULL -}; - -static const char *const nexus_excl_type[] = { - "core", - "cpu", - NULL -}; - -extern struct bus_space_tag nexus_bustag; -extern struct bus_dma_tag nexus_dmatag; - -static int -nexus_inlist(const char *name, const char *const *list) -{ - int i; - - if (name == NULL) - return (0); - for (i = 0; list[i] != NULL; i++) - if (strcmp(name, list[i]) == 0) - return (1); - return (0); -} - -#define NEXUS_EXCLUDED(name, type) \ - (nexus_inlist((name), nexus_excl_name) || \ - ((type) != NULL && nexus_inlist((type), nexus_excl_type))) - -static int -nexus_probe(device_t dev) -{ - - /* Nexus does always match. */ - device_set_desc(dev, "Open Firmware Nexus device"); - return (0); -} - -static int -nexus_attach(device_t dev) -{ - struct nexus_devinfo *ndi; - struct nexus_softc *sc; - device_t cdev; - phandle_t node; - - sc = device_get_softc(dev); - - if (strcmp(device_get_name(device_get_parent(dev)), "root") == 0) { - node = OF_peer(0); - - sc->sc_intr_rman.rm_type = RMAN_ARRAY; - sc->sc_intr_rman.rm_descr = "Interrupts"; - sc->sc_mem_rman.rm_type = RMAN_ARRAY; - sc->sc_mem_rman.rm_descr = "Device Memory"; - if (rman_init(&sc->sc_intr_rman) != 0 || - rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0 || - rman_manage_region(&sc->sc_mem_rman, 0, BUS_SPACE_MAXADDR) - != 0) - panic("%s: failed to set up rmans.", __func__); - } else - node = ofw_bus_get_node(dev); - - /* - * Allow devices to identify. - */ - bus_generic_probe(dev); - - /* - * If no Open Firmware, bail early - */ - if (node == -1) - return (bus_generic_attach(dev)); - - /* - * Some important numbers - */ - sc->acells = 2; - OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); - sc->scells = 1; - OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); - - /* - * Now walk the OFW tree and attach top-level devices. - */ - for (node = OF_child(node); node > 0; node = OF_peer(node)) { - if ((ndi = nexus_setup_dinfo(dev, node)) == NULL) - continue; - cdev = device_add_child(dev, NULL, -1); - if (cdev == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - ndi->ndi_obdinfo.obd_name); - nexus_destroy_dinfo(ndi); - continue; - } - device_set_ivars(cdev, ndi); - } - return (bus_generic_attach(dev)); -} - -static device_t -nexus_add_child(device_t dev, u_int order, const char *name, int unit) -{ - device_t cdev; - struct nexus_devinfo *ndi; - - cdev = device_add_child_ordered(dev, order, name, unit); - if (cdev == NULL) - return (NULL); - - ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); - ndi->ndi_obdinfo.obd_node = -1; - resource_list_init(&ndi->ndi_rl); - device_set_ivars(cdev, ndi); - - return (cdev); -} - -static int -nexus_print_child(device_t bus, device_t child) -{ - int rv; - - rv = bus_print_child_header(bus, child); - rv += nexus_print_res(device_get_ivars(child)); - rv += bus_print_child_footer(bus, child); - return (rv); -} - -static void -nexus_probe_nomatch(device_t bus, device_t child) -{ - const char *name, *type; - - if (!bootverbose) - return; - - name = ofw_bus_get_name(child); - type = ofw_bus_get_type(child); - - device_printf(bus, "<%s>", - name != NULL ? name : "unknown"); - nexus_print_res(device_get_ivars(child)); - printf(" type %s (no driver attached)\n", - type != NULL ? type : "unknown"); -} - static int nexus_setup_intr(device_t bus __unused, device_t child, struct resource *r, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, @@ -370,71 +156,20 @@ nexus_config_intr(device_t dev, int irq, return (powerpc_config_intr(irq, trig, pol)); } -static struct resource * -nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) +static int +nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int irq) { - struct nexus_softc *sc; - struct rman *rm; - struct resource *rv; - struct resource_list_entry *rle; - device_t nexus; - int isdefault, passthrough; - - isdefault = (start == 0UL && end == ~0UL); - passthrough = (device_get_parent(child) != bus); - nexus = bus; - while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) - nexus = device_get_parent(nexus); - sc = device_get_softc(nexus); - rle = NULL; - - if (!passthrough && isdefault) { - rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), - type, *rid); - if (rle == NULL) - return (NULL); - if (rle->res != NULL) - panic("%s: resource entry is busy", __func__); - start = rle->start; - count = ulmax(count, rle->count); - end = ulmax(rle->end, start + count - 1); - } - - switch (type) { - case SYS_RES_IRQ: - rm = &sc->sc_intr_rman; - break; - case SYS_RES_MEMORY: - rm = &sc->sc_mem_rman; - break; - default: - return (NULL); - } - - rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, - child); - if (rv == NULL) - return (NULL); - rman_set_rid(rv, *rid); - - if ((flags & RF_ACTIVE) != 0 && bus_activate_resource(child, type, - *rid, rv) != 0) { - rman_release_resource(rv); - return (NULL); - } - - if (!passthrough && rle != NULL) { - rle->res = rv; - rle->start = rman_get_start(rv); - rle->end = rman_get_end(rv); - rle->count = rle->end - rle->start + 1; - } - - return (rv); + return (MAP_IRQ(iparent, irq)); } static int +nexus_ofw_config_intr(device_t dev, device_t child, int irq, int sense) +{ + + return (powerpc_fw_config_intr(irq, sense)); +} + +static int nexus_activate_resource(device_t bus __unused, device_t child __unused, int type, int rid __unused, struct resource *r) { @@ -476,164 +211,3 @@ nexus_deactivate_resource(device_t bus _ return (rman_deactivate_resource(r)); } -static int -nexus_adjust_resource(device_t bus, device_t child __unused, int type, - struct resource *r, u_long start, u_long end) -{ - struct nexus_softc *sc; - struct rman *rm; - device_t nexus; - - nexus = bus; - while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) - nexus = device_get_parent(nexus); - sc = device_get_softc(nexus); - switch (type) { - case SYS_RES_IRQ: - rm = &sc->sc_intr_rman; - break; - case SYS_RES_MEMORY: - rm = &sc->sc_mem_rman; - break; - default: - return (EINVAL); - } - if (rm == NULL) - return (ENXIO); - if (rman_is_region_manager(r, rm) == 0) - return (EINVAL); - return (rman_adjust_resource(r, start, end)); -} - -static int -nexus_release_resource(device_t bus __unused, device_t child, int type, - int rid, struct resource *r) -{ - int error; - - if ((rman_get_flags(r) & RF_ACTIVE) != 0) { - error = bus_deactivate_resource(child, type, rid, r); - if (error) - return (error); - } - return (rman_release_resource(r)); -} - -static struct resource_list * -nexus_get_resource_list(device_t bus __unused, device_t child) -{ - struct nexus_devinfo *ndi; - - ndi = device_get_ivars(child); - return (&ndi->ndi_rl); -} - -static const struct ofw_bus_devinfo * -nexus_get_devinfo(device_t bus __unused, device_t child) -{ - struct nexus_devinfo *ndi; - - ndi = device_get_ivars(child); - return (&ndi->ndi_obdinfo); -} - -static struct nexus_devinfo * -nexus_setup_dinfo(device_t dev, phandle_t node) -{ - struct nexus_softc *sc; - struct nexus_devinfo *ndi; - uint32_t *reg, *intr, icells; - uint64_t phys, size; - phandle_t iparent; - int i, j; - int nintr; - int nreg; - - sc = device_get_softc(dev); - - ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(&ndi->ndi_obdinfo, node) != 0) { - free(ndi, M_DEVBUF); - return (NULL); - } - if (NEXUS_EXCLUDED(ndi->ndi_obdinfo.obd_name, - ndi->ndi_obdinfo.obd_type)) { - ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); - free(ndi, M_DEVBUF); - return (NULL); - } - - resource_list_init(&ndi->ndi_rl); - nreg = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®); - if (nreg == -1) - nreg = 0; - if (nreg % (sc->acells + sc->scells) != 0) { - if (bootverbose) - device_printf(dev, "Malformed reg property on <%s>\n", - ndi->ndi_obdinfo.obd_name); - nreg = 0; - } - - for (i = 0; i < nreg; i += sc->acells + sc->scells) { - phys = size = 0; - for (j = 0; j < sc->acells; j++) { - phys <<= 32; - phys |= reg[i + j]; - } - for (j = 0; j < sc->scells; j++) { - size <<= 32; - size |= reg[i + sc->acells + j]; - } - /* Skip the dummy reg property of glue devices like ssm(4). */ - if (size != 0) - resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, - phys, phys + size - 1, size); - } - free(reg, M_OFWPROP); - - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - iparent = 0; - OF_searchprop(node, "interrupt-parent", &iparent, - sizeof(iparent)); - OF_searchprop(iparent, "#interrupt-cells", &icells, - sizeof(icells)); - for (i = 0; i < nintr; i+= icells) { - intr[i] = MAP_IRQ(iparent, intr[i]); - resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i], - intr[i], 1); - if (icells > 1) { - powerpc_config_intr(intr[i], (intr[i+1] & 1) ? - INTR_TRIGGER_LEVEL : INTR_TRIGGER_EDGE, - INTR_POLARITY_LOW); - } - } - free(intr, M_OFWPROP); - } - - return (ndi); -} - -static void -nexus_destroy_dinfo(struct nexus_devinfo *ndi) -{ - - resource_list_free(&ndi->ndi_rl); - ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); - free(ndi, M_DEVBUF); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 18:08:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C85D66D1; Tue, 13 May 2014 18:08: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 9C07F2074; Tue, 13 May 2014 18:08: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 s4DI8FJl013644; Tue, 13 May 2014 18:08:15 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DI8FTP013643; Tue, 13 May 2014 18:08:15 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131808.s4DI8FTP013643@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 18:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265970 - stable/10/sys/powerpc/powermac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 18:08:15 -0000 Author: ian Date: Tue May 13 18:08:15 2014 New Revision: 265970 URL: http://svnweb.freebsd.org/changeset/base/265970 Log: MFC r257093: Be a little more suspicious of thermal sensors, which can have single crazy readings occasionally. One wild reading should not be enough to trigger a shutdown, so instead wait for several concerning readings in a row. Modified: stable/10/sys/powerpc/powermac/powermac_thermal.c Modified: stable/10/sys/powerpc/powermac/powermac_thermal.c ============================================================================== --- stable/10/sys/powerpc/powermac/powermac_thermal.c Tue May 13 18:06:26 2014 (r265969) +++ stable/10/sys/powerpc/powermac/powermac_thermal.c Tue May 13 18:08:15 2014 (r265970) @@ -68,6 +68,8 @@ struct pmac_fan_le { struct pmac_sens_le { struct pmac_therm *sensor; int last_val; +#define MAX_CRITICAL_COUNT 6 + int critical_count; SLIST_ENTRY(pmac_sens_le) entries; }; static SLIST_HEAD(pmac_fans, pmac_fan_le) fans = SLIST_HEAD_INITIALIZER(fans); @@ -106,14 +108,27 @@ pmac_therm_manage_fans(void) sensor->last_val = temp; if (sensor->last_val > sensor->sensor->max_temp) { + sensor->critical_count++; printf("WARNING: Current temperature (%s: %d.%d C) " - "exceeds critical temperature (%d.%d C)! " - "Shutting down!\n", sensor->sensor->name, - (sensor->last_val - ZERO_C_TO_K) / 10, - (sensor->last_val - ZERO_C_TO_K) % 10, - (sensor->sensor->max_temp - ZERO_C_TO_K) / 10, - (sensor->sensor->max_temp - ZERO_C_TO_K) % 10); - shutdown_nice(RB_POWEROFF); + "exceeds critical temperature (%d.%d C); " + "count=%d\n", + sensor->sensor->name, + (sensor->last_val - ZERO_C_TO_K) / 10, + (sensor->last_val - ZERO_C_TO_K) % 10, + (sensor->sensor->max_temp - ZERO_C_TO_K) / 10, + (sensor->sensor->max_temp - ZERO_C_TO_K) % 10, + sensor->critical_count); + if (sensor->critical_count >= MAX_CRITICAL_COUNT) { + printf("WARNING: %s temperature exceeded " + "critical temperature %d times in a row; " + "shutting down!\n", + sensor->sensor->name, + sensor->critical_count); + shutdown_nice(RB_POWEROFF); + } + } else { + if (sensor->critical_count > 0) + sensor->critical_count--; } } @@ -177,6 +192,8 @@ pmac_thermal_sensor_register(struct pmac list_entry = malloc(sizeof(struct pmac_sens_le), M_PMACTHERM, M_ZERO | M_WAITOK); list_entry->sensor = sensor; + list_entry->last_val = 0; + list_entry->critical_count = 0; SLIST_INSERT_HEAD(&sensors, list_entry, entries); } From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 18:14:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2399694D; Tue, 13 May 2014 18:14: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 0DE9F2137; Tue, 13 May 2014 18:14: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 s4DIEWKv017795; Tue, 13 May 2014 18:14:32 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DIEVsQ017792; Tue, 13 May 2014 18:14:31 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131814.s4DIEVsQ017792@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 18:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265971 - in stable/10/sys: conf dev/fdt dev/ofw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 18:14:32 -0000 Author: ian Date: Tue May 13 18:14:31 2014 New Revision: 265971 URL: http://svnweb.freebsd.org/changeset/base/265971 Log: MFC r257114, r257118 Use common OFW root code to set up fdtbus. This is an almost purely negative diff that should improve reliability somewhat. There should be no differences in behavior -- please report any that crop up. This has been tested on ARM and PPC systems. Make sure to get the right node when looking up #interrupt-cells. Modified: stable/10/sys/conf/files stable/10/sys/dev/fdt/fdtbus.c stable/10/sys/dev/ofw/ofw_nexus.c Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Tue May 13 18:08:15 2014 (r265970) +++ stable/10/sys/conf/files Tue May 13 18:14:31 2014 (r265971) @@ -1969,6 +1969,7 @@ dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_fdt.c optional fdt dev/ofw/ofw_if.m optional fdt dev/ofw/ofw_iicbus.c optional fdt iicbus +dev/ofw/ofw_nexus.c optional fdt dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt dev/patm/if_patm.c optional patm pci Modified: stable/10/sys/dev/fdt/fdtbus.c ============================================================================== --- stable/10/sys/dev/fdt/fdtbus.c Tue May 13 18:08:15 2014 (r265970) +++ stable/10/sys/dev/fdt/fdtbus.c Tue May 13 18:14:31 2014 (r265971) @@ -42,63 +42,20 @@ __FBSDID("$FreeBSD$"); #include #include +#include -#include "fdt_common.h" #include "ofw_bus_if.h" -#ifdef DEBUG -#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ - printf(fmt,##args); } while (0) -#else -#define debugf(fmt, args...) -#endif - -static MALLOC_DEFINE(M_FDTBUS, "fdtbus", "FDTbus devices information"); - -struct fdtbus_devinfo { - phandle_t di_node; - char *di_name; - char *di_type; - char *di_compat; - struct resource_list di_res; - - /* Interrupts sense-level info for this device */ - struct fdt_sense_level di_intr_sl[DI_MAX_INTR_NUM]; -}; - -struct fdtbus_softc { - struct rman sc_irq; - struct rman sc_mem; -}; - /* * Prototypes. */ static void fdtbus_identify(driver_t *, device_t); static int fdtbus_probe(device_t); -static int fdtbus_attach(device_t); -static int fdtbus_print_child(device_t, device_t); -static struct resource *fdtbus_alloc_resource(device_t, device_t, int, - int *, u_long, u_long, u_long, u_int); -static int fdtbus_release_resource(device_t, device_t, int, int, - struct resource *); static int fdtbus_activate_resource(device_t, device_t, int, int, struct resource *); static int fdtbus_deactivate_resource(device_t, device_t, int, int, struct resource *); -static int fdtbus_setup_intr(device_t, device_t, struct resource *, int, - driver_filter_t *, driver_intr_t *, void *, void **); - -static const char *fdtbus_ofw_get_name(device_t, device_t); -static phandle_t fdtbus_ofw_get_node(device_t, device_t); -static const char *fdtbus_ofw_get_type(device_t, device_t); -static const char *fdtbus_ofw_get_compat(device_t, device_t); - -/* - * Local routines. - */ -static void newbus_device_from_fdt_node(device_t, phandle_t); /* * Bus interface definition. @@ -107,47 +64,26 @@ static device_method_t fdtbus_methods[] /* Device interface */ DEVMETHOD(device_identify, fdtbus_identify), DEVMETHOD(device_probe, fdtbus_probe), - DEVMETHOD(device_attach, fdtbus_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, fdtbus_print_child), - DEVMETHOD(bus_alloc_resource, fdtbus_alloc_resource), - DEVMETHOD(bus_release_resource, fdtbus_release_resource), DEVMETHOD(bus_activate_resource, fdtbus_activate_resource), DEVMETHOD(bus_deactivate_resource, fdtbus_deactivate_resource), DEVMETHOD(bus_config_intr, bus_generic_config_intr), - DEVMETHOD(bus_setup_intr, fdtbus_setup_intr), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - /* OFW bus interface */ - DEVMETHOD(ofw_bus_get_node, fdtbus_ofw_get_node), - DEVMETHOD(ofw_bus_get_name, fdtbus_ofw_get_name), - DEVMETHOD(ofw_bus_get_type, fdtbus_ofw_get_type), - DEVMETHOD(ofw_bus_get_compat, fdtbus_ofw_get_compat), - - { 0, 0 } -}; - -static driver_t fdtbus_driver = { - "fdtbus", - fdtbus_methods, - sizeof(struct fdtbus_softc) + DEVMETHOD_END }; devclass_t fdtbus_devclass; - +DEFINE_CLASS_1(fdtbus, fdtbus_driver, fdtbus_methods, + sizeof(struct ofw_nexus_softc), ofw_nexus_driver); DRIVER_MODULE(fdtbus, nexus, fdtbus_driver, fdtbus_devclass, 0, 0); static void fdtbus_identify(driver_t *driver, device_t parent) { - debugf("%s(driver=%p, parent=%p)\n", __func__, driver, parent); - if (device_find_child(parent, "fdtbus", -1) == NULL) BUS_ADD_CHILD(parent, 0, "fdtbus", -1); } @@ -156,462 +92,11 @@ static int fdtbus_probe(device_t dev) { - debugf("%s(dev=%p); pass=%u\n", __func__, dev, bus_current_pass); - device_set_desc(dev, "Flattened Device Tree"); return (BUS_PROBE_NOWILDCARD); } static int -fdtbus_attach(device_t dev) -{ - phandle_t root; - phandle_t child; - struct fdtbus_softc *sc; - u_long start, end; - int error; - - if ((root = OF_finddevice("/")) == -1) - panic("fdtbus_attach: no root node."); - - sc = device_get_softc(dev); - - /* - * IRQ rman. - */ - start = 0; - end = ~0; - sc->sc_irq.rm_start = start; - sc->sc_irq.rm_end = end; - sc->sc_irq.rm_type = RMAN_ARRAY; - sc->sc_irq.rm_descr = "Interrupt request lines"; - if ((error = rman_init(&sc->sc_irq)) != 0) { - device_printf(dev, "could not init IRQ rman, error = %d\n", - error); - return (error); - } - if ((error = rman_manage_region(&sc->sc_irq, start, end)) != 0) { - device_printf(dev, "could not manage IRQ region, error = %d\n", - error); - return (error); - } - - /* - * Mem-mapped I/O space rman. - */ - start = 0; - end = ~0ul; - sc->sc_mem.rm_start = start; - sc->sc_mem.rm_end = end; - sc->sc_mem.rm_type = RMAN_ARRAY; - sc->sc_mem.rm_descr = "I/O memory"; - if ((error = rman_init(&sc->sc_mem)) != 0) { - device_printf(dev, "could not init I/O mem rman, error = %d\n", - error); - return (error); - } - if ((error = rman_manage_region(&sc->sc_mem, start, end)) != 0) { - device_printf(dev, "could not manage I/O mem region, " - "error = %d\n", error); - return (error); - } - - /* - * Walk the FDT root node and add top-level devices as our children. - */ - for (child = OF_child(root); child != 0; child = OF_peer(child)) { - /* Check and process 'status' property. */ - if (!(fdt_is_enabled(child))) - continue; - - newbus_device_from_fdt_node(dev, child); - } - - return (bus_generic_attach(dev)); -} - -static int -fdtbus_print_child(device_t dev, device_t child) -{ - struct fdtbus_devinfo *di; - struct resource_list *rl; - int rv; - - di = device_get_ivars(child); - rl = &di->di_res; - - rv = 0; - rv += bus_print_child_header(dev, child); - rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); - rv += bus_print_child_footer(dev, child); - - return (rv); -} - -static void -newbus_device_destroy(device_t dev) -{ - struct fdtbus_devinfo *di; - - di = device_get_ivars(dev); - if (di == NULL) - return; - - free(di->di_name, M_OFWPROP); - free(di->di_type, M_OFWPROP); - free(di->di_compat, M_OFWPROP); - - resource_list_free(&di->di_res); - free(di, M_FDTBUS); -} - -static device_t -newbus_device_create(device_t dev_par, phandle_t node, char *name, char *type, - char *compat) -{ - device_t child; - struct fdtbus_devinfo *di; - - child = device_add_child(dev_par, NULL, -1); - if (child == NULL) { - free(name, M_OFWPROP); - free(type, M_OFWPROP); - free(compat, M_OFWPROP); - return (NULL); - } - - di = malloc(sizeof(*di), M_FDTBUS, M_WAITOK); - di->di_node = node; - di->di_name = name; - di->di_type = type; - di->di_compat = compat; - - resource_list_init(&di->di_res); - - if (fdt_reg_to_rl(node, &di->di_res)) { - device_printf(child, "could not process 'reg' property\n"); - newbus_device_destroy(child); - child = NULL; - goto out; - } - - if (fdt_intr_to_rl(node, &di->di_res, di->di_intr_sl)) { - device_printf(child, "could not process 'interrupts' " - "property\n"); - newbus_device_destroy(child); - child = NULL; - goto out; - } - - device_set_ivars(child, di); - debugf("added child name='%s', node=%p\n", name, (void *)node); - -out: - return (child); -} - -static device_t -newbus_pci_create(device_t dev_par, phandle_t dt_node, u_long par_base, - u_long par_size) -{ - pcell_t reg[3 + 2]; - device_t dev_child; - u_long start, end, count; - struct fdtbus_devinfo *di; - char *name, *type, *compat; - int len; - - OF_getprop_alloc(dt_node, "device_type", 1, (void **)&type); - if (!(type != NULL && strcmp(type, "pci") == 0)) { - /* Only process 'pci' subnodes. */ - free(type, M_OFWPROP); - return (NULL); - } - - OF_getprop_alloc(dt_node, "name", 1, (void **)&name); - OF_getprop_alloc(OF_parent(dt_node), "compatible", 1, - (void **)&compat); - - dev_child = device_add_child(dev_par, NULL, -1); - if (dev_child == NULL) { - free(name, M_OFWPROP); - free(type, M_OFWPROP); - free(compat, M_OFWPROP); - return (NULL); - } - - di = malloc(sizeof(*di), M_FDTBUS, M_WAITOK); - di->di_node = dt_node; - di->di_name = name; - di->di_type = type; - di->di_compat = compat; - - resource_list_init(&di->di_res); - - /* - * Produce and set SYS_RES_MEMORY resources. - */ - start = 0; - count = 0; - - len = OF_getprop(dt_node, "reg", ®, sizeof(reg)); - if (len > 0) { - if (fdt_data_verify((void *)®[1], 2) != 0) { - device_printf(dev_child, "'reg' address value out of " - "range\n"); - newbus_device_destroy(dev_child); - dev_child = NULL; - goto out; - } - start = fdt_data_get((void *)®[1], 2); - - if (fdt_data_verify((void *)®[3], 2) != 0) { - device_printf(dev_child, "'reg' size value out of " - "range\n"); - newbus_device_destroy(dev_child); - dev_child = NULL; - goto out; - } - count = fdt_data_get((void *)®[3], 2); - } - - /* Calculate address range relative to base. */ - par_base &= 0x000ffffful; - start &= 0x000ffffful; - start += par_base + fdt_immr_va; - if (count == 0) - count = par_size; - end = start + count - 1; - - debugf("start = 0x%08lx, end = 0x%08lx, count = 0x%08lx\n", - start, end, count); - - if (count > par_size) { - device_printf(dev_child, "'reg' size value out of range\n"); - newbus_device_destroy(dev_child); - dev_child = NULL; - goto out; - } - - resource_list_add(&di->di_res, SYS_RES_MEMORY, 0, start, end, count); - - /* - * Set SYS_RES_IRQ resources. - */ - if (fdt_intr_to_rl(OF_parent(dt_node), &di->di_res, di->di_intr_sl)) { - device_printf(dev_child, "could not process 'interrupts' " - "property\n"); - newbus_device_destroy(dev_child); - dev_child = NULL; - goto out; - } - - device_set_ivars(dev_child, di); - debugf("added child name='%s', node=%p\n", name, - (void *)dt_node); - -out: - return (dev_child); -} - -static void -pci_from_fdt_node(device_t dev_par, phandle_t dt_node, char *name, - char *type, char *compat) -{ - u_long reg_base, reg_size; - phandle_t dt_child; - - /* - * Retrieve 'reg' property. - */ - if (fdt_regsize(dt_node, ®_base, ®_size) != 0) { - device_printf(dev_par, "could not retrieve 'reg' prop\n"); - return; - } - - /* - * Walk the PCI node and instantiate newbus devices representing - * logical resources (bridges / ports). - */ - for (dt_child = OF_child(dt_node); dt_child != 0; - dt_child = OF_peer(dt_child)) { - - if (!(fdt_is_enabled(dt_child))) - continue; - - newbus_pci_create(dev_par, dt_child, reg_base, reg_size); - } -} - -/* - * These FDT nodes do not need a corresponding newbus device object. - */ -static char *fdt_devices_skip[] = { - "aliases", - "chosen", - "memory", - NULL -}; - -static void -newbus_device_from_fdt_node(device_t dev_par, phandle_t node) -{ - char *name, *type, *compat; - device_t child; - int i; - - OF_getprop_alloc(node, "name", 1, (void **)&name); - OF_getprop_alloc(node, "device_type", 1, (void **)&type); - OF_getprop_alloc(node, "compatible", 1, (void **)&compat); - - for (i = 0; fdt_devices_skip[i] != NULL; i++) - if (name != NULL && strcmp(name, fdt_devices_skip[i]) == 0) { - debugf("skipping instantiating FDT device='%s'\n", - name); - return; - } - - child = newbus_device_create(dev_par, node, name, type, compat); - if (type != NULL && strcmp(type, "pci") == 0) - pci_from_fdt_node(child, node, name, type, compat); -} - -static struct resource * -fdtbus_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) -{ - struct fdtbus_softc *sc; - struct resource *res; - struct rman *rm; - struct fdtbus_devinfo *di; - struct resource_list_entry *rle; - int needactivate; - - /* - * Request for the default allocation with a given rid: use resource - * list stored in the local device info. - */ - if ((start == 0UL) && (end == ~0UL)) { - if ((di = device_get_ivars(child)) == NULL) - return (NULL); - - if (type == SYS_RES_IOPORT) - type = SYS_RES_MEMORY; - - rle = resource_list_find(&di->di_res, type, *rid); - if (rle == NULL) { - device_printf(bus, "no default resources for " - "rid = %d, type = %d\n", *rid, type); - return (NULL); - } - start = rle->start; - end = rle->end; - count = rle->count; - } - - sc = device_get_softc(bus); - - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; - - switch (type) { - case SYS_RES_IRQ: - rm = &sc->sc_irq; - break; - - case SYS_RES_IOPORT: - case SYS_RES_MEMORY: - rm = &sc->sc_mem; - break; - - default: - return (NULL); - } - - res = rman_reserve_resource(rm, start, end, count, flags, child); - if (res == NULL) { - device_printf(bus, "failed to reserve resource %#lx - %#lx " - "(%#lx)\n", start, end, count); - return (NULL); - } - - rman_set_rid(res, *rid); - - if (type == SYS_RES_IOPORT || type == SYS_RES_MEMORY) { - /* XXX endianess should be set based on SOC node */ - rman_set_bustag(res, fdtbus_bs_tag); - rman_set_bushandle(res, rman_get_start(res)); - } - - if (needactivate) - if (bus_activate_resource(child, type, *rid, res)) { - device_printf(child, "resource activation failed\n"); - rman_release_resource(res); - return (NULL); - } - - return (res); -} - -static int -fdtbus_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - int err; - - if (rman_get_flags(res) & RF_ACTIVE) { - err = bus_deactivate_resource(child, type, rid, res); - if (err) - return (err); - } - - return (rman_release_resource(res)); -} - -static int -fdtbus_setup_intr(device_t bus, device_t child, struct resource *res, - int flags, driver_filter_t *filter, driver_intr_t *ihand, void *arg, - void **cookiep) -{ - struct fdtbus_devinfo *di; - enum intr_trigger trig; - enum intr_polarity pol; - int error, rid; - - if (res == NULL) - return (EINVAL); - - /* - * We are responsible for configuring the interrupts of our direct - * children. - */ - if (device_get_parent(child) == bus) { - di = device_get_ivars(child); - if (di == NULL) - return (ENXIO); - - rid = rman_get_rid(res); - if (rid >= DI_MAX_INTR_NUM) - return (ENOENT); - - trig = di->di_intr_sl[rid].trig; - pol = di->di_intr_sl[rid].pol; - if (trig != INTR_TRIGGER_CONFORM || - pol != INTR_POLARITY_CONFORM) { - error = bus_generic_config_intr(bus, - rman_get_start(res), trig, pol); - if (error) - return (error); - } - } - - error = bus_generic_setup_intr(bus, child, res, flags, filter, ihand, - arg, cookiep); - return (error); -} - -static int fdtbus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { @@ -619,6 +104,10 @@ fdtbus_activate_resource(device_t bus, d int error; if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + /* XXX endianess should be set based on SOC node */ + rman_set_bustag(res, fdtbus_bs_tag); + rman_set_bushandle(res, rman_get_start(res)); + error = bus_space_map(rman_get_bustag(res), rman_get_bushandle(res), rman_get_size(res), 0, &p); if (error) @@ -637,36 +126,3 @@ fdtbus_deactivate_resource(device_t bus, return (rman_deactivate_resource(res)); } -static const char * -fdtbus_ofw_get_name(device_t bus, device_t dev) -{ - struct fdtbus_devinfo *di; - - return ((di = device_get_ivars(dev)) == NULL ? NULL : di->di_name); -} - -static phandle_t -fdtbus_ofw_get_node(device_t bus, device_t dev) -{ - struct fdtbus_devinfo *di; - - return ((di = device_get_ivars(dev)) == NULL ? 0 : di->di_node); -} - -static const char * -fdtbus_ofw_get_type(device_t bus, device_t dev) -{ - struct fdtbus_devinfo *di; - - return ((di = device_get_ivars(dev)) == NULL ? NULL : di->di_type); -} - -static const char * -fdtbus_ofw_get_compat(device_t bus, device_t dev) -{ - struct fdtbus_devinfo *di; - - return ((di = device_get_ivars(dev)) == NULL ? NULL : di->di_compat); -} - - Modified: stable/10/sys/dev/ofw/ofw_nexus.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_nexus.c Tue May 13 18:08:15 2014 (r265970) +++ stable/10/sys/dev/ofw/ofw_nexus.c Tue May 13 18:14:31 2014 (r265971) @@ -464,8 +464,8 @@ nexus_setup_dinfo(device_t dev, phandle_ iparent = 0; OF_searchencprop(node, "interrupt-parent", &iparent, sizeof(iparent)); - OF_searchencprop(iparent, "#interrupt-cells", &icells, - sizeof(icells)); + OF_searchencprop(OF_xref_phandle(iparent), "#interrupt-cells", + &icells, sizeof(icells)); for (i = 0; i < nintr; i+= icells) { intr[i] = ofw_bus_map_intr(dev, iparent, intr[i]); resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i], From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 18:24:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1045BCFE; Tue, 13 May 2014 18:24: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 EFD45220A; Tue, 13 May 2014 18:24: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 s4DIO3rS022114; Tue, 13 May 2014 18:24:03 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DIO3J2022108; Tue, 13 May 2014 18:24:03 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131824.s4DIO3J2022108@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 18:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265972 - in stable/10/sys: conf powerpc/include powerpc/mpc85xx powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 18:24:04 -0000 Author: ian Date: Tue May 13 18:24:02 2014 New Revision: 265972 URL: http://svnweb.freebsd.org/changeset/base/265972 Log: MFC r257115, r257116, r257117 Remove dead and duplicated code. Added: stable/10/sys/powerpc/mpc85xx/pci_mpc85xx.c - copied unchanged from r257117, head/sys/powerpc/mpc85xx/pci_mpc85xx.c Deleted: stable/10/sys/powerpc/mpc85xx/pci_fdt.c Modified: stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/include/psl.h stable/10/sys/powerpc/powerpc/exec_machdep.c stable/10/sys/powerpc/powerpc/genassym.c Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Tue May 13 18:14:31 2014 (r265971) +++ stable/10/sys/conf/files.powerpc Tue May 13 18:24:02 2014 (r265972) @@ -136,12 +136,12 @@ powerpc/mpc85xx/i2c.c optional iicbus f powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx -powerpc/mpc85xx/pci_fdt.c optional pci mpc85xx +powerpc/mpc85xx/pci_mpc85xx.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_machdep.c standard -powerpc/ofw/ofw_pci.c optional pci aim -powerpc/ofw/ofw_pcibus.c optional pci aim -powerpc/ofw/ofw_pcib_pci.c optional pci aim +powerpc/ofw/ofw_pci.c optional pci +powerpc/ofw/ofw_pcibus.c optional pci +powerpc/ofw/ofw_pcib_pci.c optional pci powerpc/ofw/ofw_real.c optional aim powerpc/ofw/ofw_syscons.c optional sc aim powerpc/ofw/ofwcall32.S optional aim powerpc Modified: stable/10/sys/powerpc/include/psl.h ============================================================================== --- stable/10/sys/powerpc/include/psl.h Tue May 13 18:14:31 2014 (r265971) +++ stable/10/sys/powerpc/include/psl.h Tue May 13 18:24:02 2014 (r265972) @@ -35,96 +35,44 @@ #ifndef _MACHINE_PSL_H_ #define _MACHINE_PSL_H_ -#if defined(BOOKE_E500) /* - * Machine State Register (MSR) - e500 core - * - * The PowerPC e500 does not implement the following bits: - * - * FP, FE0, FE1 - reserved, always cleared, setting has no effect. - * + * Machine State Register (MSR) - All cores */ +#define PSL_VEC 0x02000000UL /* AltiVec/SPE vector unit available */ +#define PSL_EE 0x00008000UL /* external interrupt enable */ +#define PSL_PR 0x00004000UL /* privilege mode (1 == user) */ +#define PSL_FP 0x00002000UL /* floating point enable */ +#define PSL_ME 0x00001000UL /* machine check enable */ +#define PSL_FE0 0x00000800UL /* floating point interrupt mode 0 */ +#define PSL_BE 0x00000200UL /* branch trace enable */ +#define PSL_FE1 0x00000100UL /* floating point interrupt mode 1 */ +#define PSL_PMM 0x00000004UL /* performance monitor mark */ + +/* Machine State Register - Book-E cores */ #define PSL_UCLE 0x04000000UL /* User mode cache lock enable */ -#define PSL_SPE 0x02000000UL /* SPE enable */ #define PSL_WE 0x00040000UL /* Wait state enable */ #define PSL_CE 0x00020000UL /* Critical interrupt enable */ -#define PSL_EE 0x00008000UL /* External interrupt enable */ -#define PSL_PR 0x00004000UL /* User mode */ -#define PSL_FP 0x00002000UL /* Floating point available */ -#define PSL_ME 0x00001000UL /* Machine check interrupt enable */ -#define PSL_FE0 0x00000800UL /* Floating point exception mode 0 */ -#define PSL_UBLE 0x00000400UL /* BTB lock enable */ +#define PSL_UBLE 0x00000400UL /* BTB lock enable - e500 only */ +#define PSL_DWE 0x00000400UL /* Debug Wait Enable - 440 only*/ #define PSL_DE 0x00000200UL /* Debug interrupt enable */ -#define PSL_FE1 0x00000100UL /* Floating point exception mode 1 */ #define PSL_IS 0x00000020UL /* Instruction address space */ #define PSL_DS 0x00000010UL /* Data address space */ -#define PSL_PMM 0x00000004UL /* Performance monitor mark */ - -#define PSL_FE_DFLT 0x00000000UL /* default == none */ - -/* Initial kernel MSR, use IS=1 ad DS=1. */ -#define PSL_KERNSET_INIT (PSL_IS | PSL_DS) -#define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE) -#define PSL_USERSET (PSL_KERNSET | PSL_PR) - -#elif defined(BOOKE_PPC4XX) -/* - * Machine State Register (MSR) - PPC4xx core - */ -#define PSL_WE (0x80000000 >> 13) /* Wait State Enable */ -#define PSL_CE (0x80000000 >> 14) /* Critical Interrupt Enable */ -#define PSL_EE (0x80000000 >> 16) /* External Interrupt Enable */ -#define PSL_PR (0x80000000 >> 17) /* Problem State */ -#define PSL_FP (0x80000000 >> 18) /* Floating Point Available */ -#define PSL_ME (0x80000000 >> 19) /* Machine Check Enable */ -#define PSL_FE0 (0x80000000 >> 20) /* Floating-point exception mode 0 */ -#define PSL_DWE (0x80000000 >> 21) /* Debug Wait Enable */ -#define PSL_DE (0x80000000 >> 22) /* Debug interrupt Enable */ -#define PSL_FE1 (0x80000000 >> 23) /* Floating-point exception mode 1 */ -#define PSL_IS (0x80000000 >> 26) /* Instruction Address Space */ -#define PSL_DS (0x80000000 >> 27) /* Data Address Space */ - -#define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE | PSL_FP) -#define PSL_USERSET (PSL_KERNSET | PSL_PR) - -#define PSL_FE_DFLT 0x00000000UL /* default == none */ - -#else /* if defined(BOOKE_*) */ -/* - * Machine State Register (MSR) - * - * The PowerPC 601 does not implement the following bits: - * - * VEC, POW, ILE, BE, RI, LE[*] - * - * [*] Little-endian mode on the 601 is implemented in the HID0 register. - */ +/* Machine State Register (MSR) - AIM cores */ #ifdef __powerpc64__ #define PSL_SF 0x8000000000000000UL /* 64-bit addressing */ #define PSL_HV 0x1000000000000000UL /* hyper-privileged mode */ #endif -#define PSL_VEC 0x02000000UL /* AltiVec vector unit available */ #define PSL_POW 0x00040000UL /* power management */ #define PSL_ILE 0x00010000UL /* interrupt endian mode (1 == le) */ -#define PSL_EE 0x00008000UL /* external interrupt enable */ -#define PSL_PR 0x00004000UL /* privilege mode (1 == user) */ -#define PSL_FP 0x00002000UL /* floating point enable */ -#define PSL_ME 0x00001000UL /* machine check enable */ -#define PSL_FE0 0x00000800UL /* floating point interrupt mode 0 */ #define PSL_SE 0x00000400UL /* single-step trace enable */ -#define PSL_BE 0x00000200UL /* branch trace enable */ -#define PSL_FE1 0x00000100UL /* floating point interrupt mode 1 */ -#define PSL_IP 0x00000040UL /* interrupt prefix */ +#define PSL_IP 0x00000040UL /* interrupt prefix - 601 only */ #define PSL_IR 0x00000020UL /* instruction address relocation */ #define PSL_DR 0x00000010UL /* data address relocation */ -#define PSL_PMM 0x00000004UL /* performance monitor mark */ #define PSL_RI 0x00000002UL /* recoverable interrupt */ #define PSL_LE 0x00000001UL /* endian mode (1 == le) */ -#define PSL_601_MASK ~(PSL_POW|PSL_ILE|PSL_BE|PSL_RI|PSL_LE) - /* * Floating-point exception modes: */ @@ -134,20 +82,21 @@ #define PSL_FE_PREC (PSL_FE0 | PSL_FE1) /* precise */ #define PSL_FE_DFLT PSL_FE_DIS /* default == none */ -/* - * Note that PSL_POW and PSL_ILE are not in the saved copy of the MSR - */ -#define PSL_MBO 0 -#define PSL_MBZ 0 - +#if defined(BOOKE_E500) +/* Initial kernel MSR, use IS=1 ad DS=1. */ +#define PSL_KERNSET_INIT (PSL_IS | PSL_DS) +#define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE) +#elif defined(BOOKE_PPC4XX) +#define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE | PSL_FP) +#elif defined(AIM) #ifdef __powerpc64__ #define PSL_KERNSET (PSL_SF | PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI) #else #define PSL_KERNSET (PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI) #endif -#define PSL_USERSET (PSL_KERNSET | PSL_PR) +#endif -#define PSL_USERSTATIC (PSL_USERSET | PSL_IP | 0x87c0008c) +#define PSL_USERSET (PSL_KERNSET | PSL_PR) +#define PSL_USERSTATIC ~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1) -#endif /* if defined(BOOKE_E500) */ #endif /* _MACHINE_PSL_H_ */ Copied: stable/10/sys/powerpc/mpc85xx/pci_mpc85xx.c (from r257117, head/sys/powerpc/mpc85xx/pci_mpc85xx.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/powerpc/mpc85xx/pci_mpc85xx.c Tue May 13 18:24:02 2014 (r265972, copy of r257117, head/sys/powerpc/mpc85xx/pci_mpc85xx.c) @@ -0,0 +1,827 @@ +/*- + * Copyright 2006-2007 by Juniper Networks. + * Copyright 2008 Semihalf. + * Copyright 2010 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Semihalf + * 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. + * 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 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * From: FreeBSD: src/sys/powerpc/mpc85xx/pci_ocp.c,v 1.9 2010/03/23 23:46:28 marcel + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "ofw_bus_if.h" +#include "pcib_if.h" + +#include +#include +#include + +#include + +#define REG_CFG_ADDR 0x0000 +#define CONFIG_ACCESS_ENABLE 0x80000000 + +#define REG_CFG_DATA 0x0004 +#define REG_INT_ACK 0x0008 + +#define REG_POTAR(n) (0x0c00 + 0x20 * (n)) +#define REG_POTEAR(n) (0x0c04 + 0x20 * (n)) +#define REG_POWBAR(n) (0x0c08 + 0x20 * (n)) +#define REG_POWAR(n) (0x0c10 + 0x20 * (n)) + +#define REG_PITAR(n) (0x0e00 - 0x20 * (n)) +#define REG_PIWBAR(n) (0x0e08 - 0x20 * (n)) +#define REG_PIWBEAR(n) (0x0e0c - 0x20 * (n)) +#define REG_PIWAR(n) (0x0e10 - 0x20 * (n)) + +#define REG_PEX_MES_DR 0x0020 +#define REG_PEX_MES_IER 0x0028 +#define REG_PEX_ERR_DR 0x0e00 +#define REG_PEX_ERR_EN 0x0e08 + +#define PCIR_LTSSM 0x404 +#define LTSSM_STAT_L0 0x16 + +#define DEVFN(b, s, f) ((b << 16) | (s << 8) | f) + +struct fsl_pcib_softc { + struct ofw_pci_softc pci_sc; + device_t sc_dev; + + int sc_iomem_target; + bus_addr_t sc_iomem_alloc, sc_iomem_start, sc_iomem_end; + int sc_ioport_target; + bus_addr_t sc_ioport_alloc, sc_ioport_start, sc_ioport_end; + + struct resource *sc_res; + bus_space_handle_t sc_bsh; + bus_space_tag_t sc_bst; + int sc_rid; + + int sc_busnr; + int sc_pcie; + uint8_t sc_pcie_capreg; /* PCI-E Capability Reg Set */ + + /* Devices that need special attention. */ + int sc_devfn_tundra; + int sc_devfn_via_ide; +}; + +/* Local forward declerations. */ +static uint32_t fsl_pcib_cfgread(struct fsl_pcib_softc *, u_int, u_int, u_int, + u_int, int); +static void fsl_pcib_cfgwrite(struct fsl_pcib_softc *, u_int, u_int, u_int, + u_int, uint32_t, int); +static int fsl_pcib_decode_win(phandle_t, struct fsl_pcib_softc *); +static void fsl_pcib_err_init(device_t); +static void fsl_pcib_inbound(struct fsl_pcib_softc *, int, int, u_long, + u_long, u_long); +static int fsl_pcib_init(struct fsl_pcib_softc *, int, int); +static void fsl_pcib_outbound(struct fsl_pcib_softc *, int, int, u_long, + u_long, u_long); + +/* Forward declerations. */ +static int fsl_pcib_attach(device_t); +static int fsl_pcib_detach(device_t); +static int fsl_pcib_probe(device_t); + +static int fsl_pcib_maxslots(device_t); +static uint32_t fsl_pcib_read_config(device_t, u_int, u_int, u_int, u_int, int); +static void fsl_pcib_write_config(device_t, u_int, u_int, u_int, u_int, + uint32_t, int); + +/* Configuration r/w mutex. */ +struct mtx pcicfg_mtx; +static int mtx_initialized = 0; + +/* + * Bus interface definitions. + */ +static device_method_t fsl_pcib_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fsl_pcib_probe), + DEVMETHOD(device_attach, fsl_pcib_attach), + DEVMETHOD(device_detach, fsl_pcib_detach), + + /* pcib interface */ + DEVMETHOD(pcib_maxslots, fsl_pcib_maxslots), + DEVMETHOD(pcib_read_config, fsl_pcib_read_config), + DEVMETHOD(pcib_write_config, fsl_pcib_write_config), + + DEVMETHOD_END +}; + +static devclass_t fsl_pcib_devclass; + +DEFINE_CLASS_1(pcib, fsl_pcib_driver, fsl_pcib_methods, + sizeof(struct fsl_pcib_softc), ofw_pci_driver); +DRIVER_MODULE(pcib, fdtbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0); + +static int +fsl_pcib_probe(device_t dev) +{ + + if (ofw_bus_get_type(dev) == NULL || + strcmp(ofw_bus_get_type(dev), "pci") != 0) + return (ENXIO); + + if (!(ofw_bus_is_compatible(dev, "fsl,mpc8540-pci") || + ofw_bus_is_compatible(dev, "fsl,mpc8548-pcie"))) + return (ENXIO); + + device_set_desc(dev, "Freescale Integrated PCI/PCI-E Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +fsl_pcib_attach(device_t dev) +{ + struct fsl_pcib_softc *sc; + phandle_t node; + uint32_t cfgreg; + int maxslot, error; + uint8_t ltssm, capptr; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + sc->sc_rid = 0; + sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, + RF_ACTIVE); + if (sc->sc_res == NULL) { + device_printf(dev, "could not map I/O memory\n"); + return (ENXIO); + } + sc->sc_bst = rman_get_bustag(sc->sc_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_res); + sc->sc_busnr = 0; + + if (!mtx_initialized) { + mtx_init(&pcicfg_mtx, "pcicfg", NULL, MTX_SPIN); + mtx_initialized = 1; + } + + cfgreg = fsl_pcib_cfgread(sc, 0, 0, 0, PCIR_VENDOR, 2); + if (cfgreg != 0x1057 && cfgreg != 0x1957) + goto err; + + capptr = fsl_pcib_cfgread(sc, 0, 0, 0, PCIR_CAP_PTR, 1); + while (capptr != 0) { + cfgreg = fsl_pcib_cfgread(sc, 0, 0, 0, capptr, 2); + switch (cfgreg & 0xff) { + case PCIY_PCIX: + break; + case PCIY_EXPRESS: + sc->sc_pcie = 1; + sc->sc_pcie_capreg = capptr; + break; + } + capptr = (cfgreg >> 8) & 0xff; + } + + node = ofw_bus_get_node(dev); + + /* + * Initialize generic OF PCI interface (ranges, etc.) + */ + + error = ofw_pci_init(dev); + if (error) + return (error); + + /* + * Configure decode windows for PCI(E) access. + */ + if (fsl_pcib_decode_win(node, sc) != 0) + goto err; + + cfgreg = fsl_pcib_cfgread(sc, 0, 0, 0, PCIR_COMMAND, 2); + cfgreg |= PCIM_CMD_SERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN | + PCIM_CMD_PORTEN; + fsl_pcib_cfgwrite(sc, 0, 0, 0, PCIR_COMMAND, cfgreg, 2); + + sc->sc_devfn_tundra = -1; + sc->sc_devfn_via_ide = -1; + + + /* + * Scan bus using firmware configured, 0 based bus numbering. + */ + sc->sc_busnr = 0; + maxslot = (sc->sc_pcie) ? 0 : PCI_SLOTMAX; + fsl_pcib_init(sc, sc->sc_busnr, maxslot); + + if (sc->sc_pcie) { + ltssm = fsl_pcib_cfgread(sc, 0, 0, 0, PCIR_LTSSM, 1); + if (ltssm < LTSSM_STAT_L0) { + if (bootverbose) + printf("PCI %d: no PCIE link, skipping\n", + device_get_unit(dev)); + return (0); + } + } + + fsl_pcib_err_init(dev); + + return (ofw_pci_attach(dev)); + +err: + return (ENXIO); +} + +static uint32_t +fsl_pcib_cfgread(struct fsl_pcib_softc *sc, u_int bus, u_int slot, u_int func, + u_int reg, int bytes) +{ + uint32_t addr, data; + + if (bus == sc->sc_busnr - 1) + bus = 0; + + addr = CONFIG_ACCESS_ENABLE; + addr |= (bus & 0xff) << 16; + addr |= (slot & 0x1f) << 11; + addr |= (func & 0x7) << 8; + addr |= reg & 0xfc; + if (sc->sc_pcie) + addr |= (reg & 0xf00) << 16; + + mtx_lock_spin(&pcicfg_mtx); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_CFG_ADDR, addr); + + switch (bytes) { + case 1: + data = bus_space_read_1(sc->sc_bst, sc->sc_bsh, + REG_CFG_DATA + (reg & 3)); + break; + case 2: + data = le16toh(bus_space_read_2(sc->sc_bst, sc->sc_bsh, + REG_CFG_DATA + (reg & 2))); + break; + case 4: + data = le32toh(bus_space_read_4(sc->sc_bst, sc->sc_bsh, + REG_CFG_DATA)); + break; + default: + data = ~0; + break; + } + mtx_unlock_spin(&pcicfg_mtx); + return (data); +} + +static void +fsl_pcib_cfgwrite(struct fsl_pcib_softc *sc, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t data, int bytes) +{ + uint32_t addr; + + if (bus == sc->sc_busnr - 1) + bus = 0; + + addr = CONFIG_ACCESS_ENABLE; + addr |= (bus & 0xff) << 16; + addr |= (slot & 0x1f) << 11; + addr |= (func & 0x7) << 8; + addr |= reg & 0xfc; + if (sc->sc_pcie) + addr |= (reg & 0xf00) << 16; + + mtx_lock_spin(&pcicfg_mtx); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_CFG_ADDR, addr); + + switch (bytes) { + case 1: + bus_space_write_1(sc->sc_bst, sc->sc_bsh, + REG_CFG_DATA + (reg & 3), data); + break; + case 2: + bus_space_write_2(sc->sc_bst, sc->sc_bsh, + REG_CFG_DATA + (reg & 2), htole16(data)); + break; + case 4: + bus_space_write_4(sc->sc_bst, sc->sc_bsh, + REG_CFG_DATA, htole32(data)); + break; + } + mtx_unlock_spin(&pcicfg_mtx); +} + +#if 0 +static void +dump(struct fsl_pcib_softc *sc) +{ + unsigned int i; + +#define RD(o) bus_space_read_4(sc->sc_bst, sc->sc_bsh, o) + for (i = 0; i < 5; i++) { + printf("POTAR%u =0x%08x\n", i, RD(REG_POTAR(i))); + printf("POTEAR%u =0x%08x\n", i, RD(REG_POTEAR(i))); + printf("POWBAR%u =0x%08x\n", i, RD(REG_POWBAR(i))); + printf("POWAR%u =0x%08x\n", i, RD(REG_POWAR(i))); + } + printf("\n"); + for (i = 1; i < 4; i++) { + printf("PITAR%u =0x%08x\n", i, RD(REG_PITAR(i))); + printf("PIWBAR%u =0x%08x\n", i, RD(REG_PIWBAR(i))); + printf("PIWBEAR%u=0x%08x\n", i, RD(REG_PIWBEAR(i))); + printf("PIWAR%u =0x%08x\n", i, RD(REG_PIWAR(i))); + } + printf("\n"); +#undef RD + + for (i = 0; i < 0x48; i += 4) { + printf("cfg%02x=0x%08x\n", i, fsl_pcib_cfgread(sc, 0, 0, 0, + i, 4)); + } +} +#endif + +static int +fsl_pcib_maxslots(device_t dev) +{ + struct fsl_pcib_softc *sc = device_get_softc(dev); + + return ((sc->sc_pcie) ? 0 : PCI_SLOTMAX); +} + +static uint32_t +fsl_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, int bytes) +{ + struct fsl_pcib_softc *sc = device_get_softc(dev); + u_int devfn; + + if (bus == sc->sc_busnr && !sc->sc_pcie && slot < 10) + return (~0); + devfn = DEVFN(bus, slot, func); + if (devfn == sc->sc_devfn_tundra) + return (~0); + if (devfn == sc->sc_devfn_via_ide && reg == PCIR_INTPIN) + return (1); + return (fsl_pcib_cfgread(sc, bus, slot, func, reg, bytes)); +} + +static void +fsl_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t val, int bytes) +{ + struct fsl_pcib_softc *sc = device_get_softc(dev); + + if (bus == sc->sc_busnr && !sc->sc_pcie && slot < 10) + return; + fsl_pcib_cfgwrite(sc, bus, slot, func, reg, val, bytes); +} + +static void +fsl_pcib_init_via(struct fsl_pcib_softc *sc, uint16_t device, int bus, + int slot, int fn) +{ + + if (device == 0x0686) { + fsl_pcib_write_config(sc->sc_dev, bus, slot, fn, 0x52, 0x34, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, fn, 0x77, 0x00, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, fn, 0x83, 0x98, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, fn, 0x85, 0x03, 1); + } else if (device == 0x0571) { + sc->sc_devfn_via_ide = DEVFN(bus, slot, fn); + fsl_pcib_write_config(sc->sc_dev, bus, slot, fn, 0x40, 0x0b, 1); + } +} + +static int +fsl_pcib_init_bar(struct fsl_pcib_softc *sc, int bus, int slot, int func, + int barno) +{ + bus_addr_t *allocp; + uint32_t addr, mask, size; + int reg, width; + + reg = PCIR_BAR(barno); + + if (DEVFN(bus, slot, func) == sc->sc_devfn_via_ide) { + switch (barno) { + case 0: addr = 0x1f0; break; + case 1: addr = 0x3f4; break; + case 2: addr = 0x170; break; + case 3: addr = 0x374; break; + case 4: addr = 0xcc0; break; + default: return (1); + } + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, reg, addr, 4); + return (1); + } + + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, reg, ~0, 4); + size = fsl_pcib_read_config(sc->sc_dev, bus, slot, func, reg, 4); + if (size == 0) + return (1); + width = ((size & 7) == 4) ? 2 : 1; + + if (size & 1) { /* I/O port */ + allocp = &sc->sc_ioport_alloc; + size &= ~3; + if ((size & 0xffff0000) == 0) + size |= 0xffff0000; + } else { /* memory */ + allocp = &sc->sc_iomem_alloc; + size &= ~15; + } + mask = ~size; + size = mask + 1; + /* Sanity check (must be a power of 2). */ + if (size & mask) + return (width); + + addr = (*allocp + mask) & ~mask; + *allocp = addr + size; + + if (bootverbose) + printf("PCI %u:%u:%u:%u: reg %x: size=%08x: addr=%08x\n", + device_get_unit(sc->sc_dev), bus, slot, func, reg, + size, addr); + + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, reg, addr, 4); + if (width == 2) + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, reg + 4, + 0, 4); + return (width); +} + +static int +fsl_pcib_init(struct fsl_pcib_softc *sc, int bus, int maxslot) +{ + int secbus; + int old_pribus, old_secbus, old_subbus; + int new_pribus, new_secbus, new_subbus; + int slot, func, maxfunc; + int bar, maxbar; + uint16_t vendor, device; + uint8_t command, hdrtype, class, subclass; + + secbus = bus; + for (slot = 0; slot <= maxslot; slot++) { + maxfunc = 0; + for (func = 0; func <= maxfunc; func++) { + hdrtype = fsl_pcib_read_config(sc->sc_dev, bus, slot, + func, PCIR_HDRTYPE, 1); + + if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) + continue; + + if (func == 0 && (hdrtype & PCIM_MFDEV)) + maxfunc = PCI_FUNCMAX; + + vendor = fsl_pcib_read_config(sc->sc_dev, bus, slot, + func, PCIR_VENDOR, 2); + device = fsl_pcib_read_config(sc->sc_dev, bus, slot, + func, PCIR_DEVICE, 2); + + if (vendor == 0x1957 && device == 0x3fff) { + sc->sc_devfn_tundra = DEVFN(bus, slot, func); + continue; + } + + command = fsl_pcib_read_config(sc->sc_dev, bus, slot, + func, PCIR_COMMAND, 1); + command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_COMMAND, command, 1); + + if (vendor == 0x1106) + fsl_pcib_init_via(sc, device, bus, slot, func); + + /* Program the base address registers. */ + maxbar = (hdrtype & PCIM_HDRTYPE) ? 1 : 6; + bar = 0; + while (bar < maxbar) + bar += fsl_pcib_init_bar(sc, bus, slot, func, + bar); + + /* Put a placeholder interrupt value */ + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_INTLINE, PCI_INVALID_IRQ, 1); + + command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_COMMAND, command, 1); + + /* + * Handle PCI-PCI bridges + */ + class = fsl_pcib_read_config(sc->sc_dev, bus, slot, + func, PCIR_CLASS, 1); + subclass = fsl_pcib_read_config(sc->sc_dev, bus, slot, + func, PCIR_SUBCLASS, 1); + + /* Allow only proper PCI-PCI briges */ + if (class != PCIC_BRIDGE) + continue; + if (subclass != PCIS_BRIDGE_PCI) + continue; + + secbus++; + + /* Program I/O decoder. */ + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_IOBASEL_1, sc->sc_ioport_start >> 8, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_IOLIMITL_1, sc->sc_ioport_end >> 8, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_IOBASEH_1, sc->sc_ioport_start >> 16, 2); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_IOLIMITH_1, sc->sc_ioport_end >> 16, 2); + + /* Program (non-prefetchable) memory decoder. */ + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_MEMBASE_1, sc->sc_iomem_start >> 16, 2); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_MEMLIMIT_1, sc->sc_iomem_end >> 16, 2); + + /* Program prefetchable memory decoder. */ + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_PMBASEL_1, 0x0010, 2); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_PMLIMITL_1, 0x000f, 2); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_PMBASEH_1, 0x00000000, 4); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_PMLIMITH_1, 0x00000000, 4); + + /* Read currect bus register configuration */ + old_pribus = fsl_pcib_read_config(sc->sc_dev, bus, + slot, func, PCIR_PRIBUS_1, 1); + old_secbus = fsl_pcib_read_config(sc->sc_dev, bus, + slot, func, PCIR_SECBUS_1, 1); + old_subbus = fsl_pcib_read_config(sc->sc_dev, bus, + slot, func, PCIR_SUBBUS_1, 1); + + if (bootverbose) + printf("PCI: reading firmware bus numbers for " + "secbus = %d (bus/sec/sub) = (%d/%d/%d)\n", + secbus, old_pribus, old_secbus, old_subbus); + + new_pribus = bus; + new_secbus = secbus; + + secbus = fsl_pcib_init(sc, secbus, + (subclass == PCIS_BRIDGE_PCI) ? PCI_SLOTMAX : 0); + + new_subbus = secbus; + + if (bootverbose) + printf("PCI: translate firmware bus numbers " + "for secbus %d (%d/%d/%d) -> (%d/%d/%d)\n", + secbus, old_pribus, old_secbus, old_subbus, + new_pribus, new_secbus, new_subbus); + + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_PRIBUS_1, new_pribus, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_SECBUS_1, new_secbus, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_SUBBUS_1, new_subbus, 1); + } + } + + return (secbus); +} + +static void +fsl_pcib_inbound(struct fsl_pcib_softc *sc, int wnd, int tgt, u_long start, + u_long size, u_long pci_start) +{ + uint32_t attr, bar, tar; + + KASSERT(wnd > 0, ("%s: inbound window 0 is invalid", __func__)); + + switch (tgt) { + /* XXX OCP85XX_TGTIF_RAM2, OCP85XX_TGTIF_RAM_INTL should be handled */ + case OCP85XX_TGTIF_RAM1: + attr = 0xa0f55000 | (ffsl(size) - 2); + break; + default: + attr = 0; + break; + } + tar = start >> 12; + bar = pci_start >> 12; + + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_PITAR(wnd), tar); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_PIWBEAR(wnd), 0); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_PIWBAR(wnd), bar); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_PIWAR(wnd), attr); +} + +static void +fsl_pcib_outbound(struct fsl_pcib_softc *sc, int wnd, int res, u_long start, + u_long size, u_long pci_start) +{ + uint32_t attr, bar, tar; + + switch (res) { + case SYS_RES_MEMORY: + attr = 0x80044000 | (ffsl(size) - 2); + break; + case SYS_RES_IOPORT: + attr = 0x80088000 | (ffsl(size) - 2); + break; + default: + attr = 0x0004401f; + break; + } + bar = start >> 12; + tar = pci_start >> 12; + + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_POTAR(wnd), tar); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_POTEAR(wnd), 0); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_POWBAR(wnd), bar); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_POWAR(wnd), attr); +} + + +static void +fsl_pcib_err_init(device_t dev) +{ + struct fsl_pcib_softc *sc; + uint16_t sec_stat, dsr; + uint32_t dcr, err_en; + + sc = device_get_softc(dev); + + sec_stat = fsl_pcib_cfgread(sc, 0, 0, 0, PCIR_SECSTAT_1, 2); + if (sec_stat) + fsl_pcib_cfgwrite(sc, 0, 0, 0, PCIR_SECSTAT_1, 0xffff, 2); + if (sc->sc_pcie) { + /* Clear error bits */ + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_PEX_MES_IER, + 0xffffffff); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_PEX_MES_DR, + 0xffffffff); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_PEX_ERR_DR, + 0xffffffff); + + dsr = fsl_pcib_cfgread(sc, 0, 0, 0, + sc->sc_pcie_capreg + PCIER_DEVICE_STA, 2); + if (dsr) + fsl_pcib_cfgwrite(sc, 0, 0, 0, + sc->sc_pcie_capreg + PCIER_DEVICE_STA, + 0xffff, 2); + + /* Enable all errors reporting */ + err_en = 0x00bfff00; + bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_PEX_ERR_EN, + err_en); + + /* Enable error reporting: URR, FER, NFER */ + dcr = fsl_pcib_cfgread(sc, 0, 0, 0, + sc->sc_pcie_capreg + PCIER_DEVICE_CTL, 4); + dcr |= PCIEM_CTL_URR_ENABLE | PCIEM_CTL_FER_ENABLE | + PCIEM_CTL_NFER_ENABLE; + fsl_pcib_cfgwrite(sc, 0, 0, 0, + sc->sc_pcie_capreg + PCIER_DEVICE_CTL, dcr, 4); + } +} + +static int +fsl_pcib_detach(device_t dev) +{ + + if (mtx_initialized) { + mtx_destroy(&pcicfg_mtx); + mtx_initialized = 0; + } + return (bus_generic_detach(dev)); +} + +static int +fsl_pcib_decode_win(phandle_t node, struct fsl_pcib_softc *sc) +{ + device_t dev; + int error, i, trgt; + + dev = sc->sc_dev; + + fsl_pcib_outbound(sc, 0, -1, 0, 0, 0); + + /* + * Configure LAW decode windows. + */ + error = law_pci_target(sc->sc_res, &sc->sc_iomem_target, + &sc->sc_ioport_target); + if (error != 0) { + device_printf(dev, "could not retrieve PCI LAW target info\n"); + return (error); + } + + for (i = 0; i < sc->pci_sc.sc_nrange; i++) { + switch (sc->pci_sc.sc_range[i].pci_hi & + OFW_PCI_PHYS_HI_SPACEMASK) { + case OFW_PCI_PHYS_HI_SPACE_CONFIG: + continue; + case OFW_PCI_PHYS_HI_SPACE_IO: + trgt = sc->sc_ioport_target; + fsl_pcib_outbound(sc, 2, SYS_RES_IOPORT, + sc->pci_sc.sc_range[i].host, + sc->pci_sc.sc_range[i].size, + sc->pci_sc.sc_range[i].pci); + sc->sc_ioport_start = sc->pci_sc.sc_range[i].host; + sc->sc_ioport_end = sc->pci_sc.sc_range[i].host + + sc->pci_sc.sc_range[i].size; + sc->sc_ioport_alloc = 0x1000 + sc->pci_sc.sc_range[i].pci; + break; + case OFW_PCI_PHYS_HI_SPACE_MEM32: + case OFW_PCI_PHYS_HI_SPACE_MEM64: + trgt = sc->sc_iomem_target; + fsl_pcib_outbound(sc, 1, SYS_RES_MEMORY, + sc->pci_sc.sc_range[i].host, + sc->pci_sc.sc_range[i].size, + sc->pci_sc.sc_range[i].pci); + sc->sc_iomem_start = sc->pci_sc.sc_range[i].host; + sc->sc_iomem_end = sc->pci_sc.sc_range[i].host + + sc->pci_sc.sc_range[i].size; + sc->sc_iomem_alloc = sc->pci_sc.sc_range[i].pci; + break; + default: + panic("Unknown range type %#x\n", + sc->pci_sc.sc_range[i].pci_hi & + OFW_PCI_PHYS_HI_SPACEMASK); + } + error = law_enable(trgt, sc->pci_sc.sc_range[i].host, + sc->pci_sc.sc_range[i].size); + if (error != 0) { + device_printf(dev, "could not program LAW for range " + "%d\n", i); + return (error); + } + } + + /* + * Set outbout and inbound windows. + */ + fsl_pcib_outbound(sc, 3, -1, 0, 0, 0); + fsl_pcib_outbound(sc, 4, -1, 0, 0, 0); + + fsl_pcib_inbound(sc, 1, -1, 0, 0, 0); + fsl_pcib_inbound(sc, 2, -1, 0, 0, 0); + fsl_pcib_inbound(sc, 3, OCP85XX_TGTIF_RAM1, 0, + 2U * 1024U * 1024U * 1024U, 0); + + return (0); +} + Modified: stable/10/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/exec_machdep.c Tue May 13 18:14:31 2014 (r265971) +++ stable/10/sys/powerpc/powerpc/exec_machdep.c Tue May 13 18:24:02 2014 (r265972) @@ -449,14 +449,12 @@ set_mcontext(struct thread *td, const mc if (mcp->mc_vers != _MC_VERSION || mcp->mc_len != sizeof(*mcp)) return (EINVAL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 19:09:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DC0D99B6; Tue, 13 May 2014 19:09: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 BD2DD2597; Tue, 13 May 2014 19:09: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 s4DJ90SN040530; Tue, 13 May 2014 19:09:00 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DJ90Cc040529; Tue, 13 May 2014 19:09:00 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131909.s4DJ90Cc040529@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 19:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265973 - stable/10/sys/dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 19:09:01 -0000 Author: ian Date: Tue May 13 19:09:00 2014 New Revision: 265973 URL: http://svnweb.freebsd.org/changeset/base/265973 Log: MFC r257111, r257144, r257157, r257183 Test UARTs physical address instead of virtual. Be a bit more flexible in how we find the console from the properties on /chosen, following the list of allowed console properties in ePAPR. Also do not require that stdin be defined and equal to stdout: stdin is nonstandard (for ePAPR) and console in an unexpected place is after all better than no console. Modified: stable/10/sys/dev/uart/uart_cpu_fdt.c Modified: stable/10/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- stable/10/sys/dev/uart/uart_cpu_fdt.c Tue May 13 18:24:02 2014 (r265972) +++ stable/10/sys/dev/uart/uart_cpu_fdt.c Tue May 13 19:09:00 2014 (r265973) @@ -36,6 +36,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include +#include #include #include @@ -88,13 +92,34 @@ int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) { - return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0); + if (b1->bst != b2->bst) + return (0); + if (pmap_kextract(b1->bsh) == 0) + return (0); + if (pmap_kextract(b2->bsh) == 0) + return (0); + return ((pmap_kextract(b1->bsh) == pmap_kextract(b2->bsh)) ? 1 : 0); +} + +static int +phandle_chosen_propdev(phandle_t chosen, const char *name, phandle_t *node) +{ + char buf[64]; + + if (OF_getprop(chosen, name, buf, sizeof(buf)) <= 0) + return (ENXIO); + if ((*node = OF_finddevice(buf)) == -1) + return (ENXIO); + + return (0); } int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { - char buf[64]; + const char *propnames[] = {"stdout-path", "linux,stdout-path", "stdout", + "stdin-path", "stdin", NULL}; + const char **name; const struct ofw_compat_data *cd; struct uart_class *class; phandle_t node, chosen; @@ -105,7 +130,7 @@ uart_cpu_getdev(int devtype, struct uart uart_bus_space_mem = fdtbus_bs_tag; uart_bus_space_io = NULL; - /* Allow overriding the FDT uning the environment. */ + /* Allow overriding the FDT using the environment. */ class = &uart_ns8250_class; err = uart_getenv(devtype, di, class); if (!err) @@ -119,14 +144,11 @@ uart_cpu_getdev(int devtype, struct uart */ if ((chosen = OF_finddevice("/chosen")) == -1) return (ENXIO); - if (OF_getprop(chosen, "stdin", buf, sizeof(buf)) <= 0) - return (ENXIO); - if ((node = OF_finddevice(buf)) == -1) - return (ENXIO); - if (OF_getprop(chosen, "stdout", buf, sizeof(buf)) <= 0) - return (ENXIO); - if (OF_finddevice(buf) != node) - /* Only stdin == stdout is supported. */ + for (name = propnames; *name != NULL; name++) { + if (phandle_chosen_propdev(chosen, *name, &node) == 0) + break; + } + if (*name == NULL) return (ENXIO); /* * Retrieve serial attributes. From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 19:12:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1AB52B64; Tue, 13 May 2014 19:12: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 EF8CF262B; Tue, 13 May 2014 19:12: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 s4DJCsEj044238; Tue, 13 May 2014 19:12:54 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DJCsk8044233; Tue, 13 May 2014 19:12:54 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405131912.s4DJCsk8044233@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 19:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265974 - in stable/10/sys/powerpc: aim include pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 19:12:55 -0000 Author: ian Date: Tue May 13 19:12:53 2014 New Revision: 265974 URL: http://svnweb.freebsd.org/changeset/base/265974 Log: MFC r257162, r257175 The old trap.h (then trap_aim.h) actually had trap ID codes for Book-E CPUs. Use it universally. Book-E traps may also need revisiting due to the introduction of fixed-offset traps and the deprecation of IVORs in POWER ISA 2.06, but that's very much an issue for another day. Deleted: stable/10/sys/powerpc/include/trap_aim.h stable/10/sys/powerpc/include/trap_booke.h Modified: stable/10/sys/powerpc/aim/mmu_oea.c stable/10/sys/powerpc/aim/mp_cpudep.c stable/10/sys/powerpc/include/trap.h stable/10/sys/powerpc/pseries/platform_chrp.c Modified: stable/10/sys/powerpc/aim/mmu_oea.c ============================================================================== --- stable/10/sys/powerpc/aim/mmu_oea.c Tue May 13 19:09:00 2014 (r265973) +++ stable/10/sys/powerpc/aim/mmu_oea.c Tue May 13 19:12:53 2014 (r265974) @@ -141,7 +141,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include "mmu_if.h" Modified: stable/10/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- stable/10/sys/powerpc/aim/mp_cpudep.c Tue May 13 19:09:00 2014 (r265973) +++ stable/10/sys/powerpc/aim/mp_cpudep.c Tue May 13 19:12:53 2014 (r265974) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: stable/10/sys/powerpc/include/trap.h ============================================================================== --- stable/10/sys/powerpc/include/trap.h Tue May 13 19:09:00 2014 (r265973) +++ stable/10/sys/powerpc/include/trap.h Tue May 13 19:12:53 2014 (r265974) @@ -1,8 +1,128 @@ -/* $FreeBSD$ */ +/*- + * Copyright (C) 1995, 1996 Wolfgang Solfrank. + * Copyright (C) 1995, 1996 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. + * + * $NetBSD: trap.h,v 1.7 2002/02/22 13:51:40 kleink Exp $ + * $FreeBSD$ + */ -#if defined(AIM) -#include -#elif defined(BOOKE) -#include +#ifndef _POWERPC_TRAP_H_ +#define _POWERPC_TRAP_H_ + +#define EXC_RSVD 0x0000 /* Reserved */ +#define EXC_RST 0x0100 /* Reset; all but IBM4xx */ +#define EXC_MCHK 0x0200 /* Machine Check */ +#define EXC_DSI 0x0300 /* Data Storage Interrupt */ +#define EXC_DSE 0x0380 /* Data Segment Interrupt */ +#define EXC_ISI 0x0400 /* Instruction Storage Interrupt */ +#define EXC_ISE 0x0480 /* Instruction Segment Interrupt */ +#define EXC_EXI 0x0500 /* External Interrupt */ +#define EXC_ALI 0x0600 /* Alignment Interrupt */ +#define EXC_PGM 0x0700 /* Program Interrupt */ +#define EXC_FPU 0x0800 /* Floating-point Unavailable */ +#define EXC_DECR 0x0900 /* Decrementer Interrupt */ +#define EXC_SC 0x0c00 /* System Call */ +#define EXC_TRC 0x0d00 /* Trace */ +#define EXC_FPA 0x0e00 /* Floating-point Assist */ + +/* The following is only available on the 601: */ +#define EXC_RUNMODETRC 0x2000 /* Run Mode/Trace Exception */ + +/* The following are only available on 970(G5): */ +#define EXC_VECAST_G5 0x1700 /* AltiVec Assist */ + +/* The following are only available on 7400(G4): */ +#define EXC_VEC 0x0f20 /* AltiVec Unavailable */ +#define EXC_VECAST_G4 0x1600 /* AltiVec Assist */ + +/* The following are only available on 604/750/7400: */ +#define EXC_PERF 0x0f00 /* Performance Monitoring */ +#define EXC_BPT 0x1300 /* Instruction Breakpoint */ +#define EXC_SMI 0x1400 /* System Managment Interrupt */ + +/* The following are only available on 750/7400: */ +#define EXC_THRM 0x1700 /* Thermal Management Interrupt */ + +/* And these are only on the 603: */ +#define EXC_IMISS 0x1000 /* Instruction translation miss */ +#define EXC_DLMISS 0x1100 /* Data load translation miss */ +#define EXC_DSMISS 0x1200 /* Data store translation miss */ + +/* The following are available on 4xx and 85xx */ +#define EXC_CRIT 0x0100 /* Critical Input Interrupt */ +#define EXC_PIT 0x1000 /* Programmable Interval Timer */ +#define EXC_FIT 0x1010 /* Fixed Interval Timer */ +#define EXC_WDOG 0x1020 /* Watchdog Timer */ +#define EXC_DTMISS 0x1100 /* Data TLB Miss */ +#define EXC_ITMISS 0x1200 /* Instruction TLB Miss */ +#define EXC_APU 0x1300 /* Auxiliary Processing Unit */ +#define EXC_DEBUG 0x2000 /* Debug trap */ + +#define EXC_LAST 0x2f00 /* Last possible exception vector */ + +#define EXC_AST 0x3000 /* Fake AST vector */ + +/* Trap was in user mode */ +#define EXC_USER 0x10000 + + +/* + * EXC_ALI sets bits in the DSISR and DAR to provide enough + * information to recover from the unaligned access without needing to + * parse the offending instruction. This includes certain bits of the + * opcode, and information about what registers are used. The opcode + * indicator values below come from Appendix F of Book III of "The + * PowerPC Architecture". + */ + +#define EXC_ALI_OPCODE_INDICATOR(dsisr) ((dsisr >> 10) & 0x7f) +#define EXC_ALI_LFD 0x09 +#define EXC_ALI_STFD 0x0b + +/* Macros to extract register information */ +#define EXC_ALI_RST(dsisr) ((dsisr >> 5) & 0x1f) /* source or target */ +#define EXC_ALI_RA(dsisr) (dsisr & 0x1f) + +/* + * SRR1 bits for program exception traps. These identify what caused + * the program exception. See section 6.5.9 of the Power ISA Version + * 2.05. + */ + +#define EXC_PGM_FPENABLED (1UL << 20) +#define EXC_PGM_ILLEGAL (1UL << 19) +#define EXC_PGM_PRIV (1UL << 18) +#define EXC_PGM_TRAP (1UL << 17) + +#ifndef LOCORE +struct trapframe; +void trap(struct trapframe *); #endif +#endif /* _POWERPC_TRAP_H_ */ Modified: stable/10/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- stable/10/sys/powerpc/pseries/platform_chrp.c Tue May 13 19:09:00 2014 (r265973) +++ stable/10/sys/powerpc/pseries/platform_chrp.c Tue May 13 19:12:53 2014 (r265974) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 19:35:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5EB83DB; Tue, 13 May 2014 19:35:31 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (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 5E69327CE; Tue, 13 May 2014 19:35:30 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id m15so865811wgh.4 for ; Tue, 13 May 2014 12:35:28 -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=wjtdaeVlxIe9aQgICv+Bcv2h5HICWZcAyUpR7ooDjsE=; b=BFW8D9O9p9phneijnN+rTL0xkCPFRP4KnpGq5Qmnixk5bECQ85KIheHktYhGwBBHlB ZSLBQU8WmpzSdDgiBS2C8/pa/4S/BP7U3czqQx4EqhZ5zfhQb+WxICByL4hoKvri7w4d P+iXocaQiDT3cRMdKNv0uONIc1/+ENU7WI0xEJMUT2jMBYHJQF7on+Fw36NLOcK51SYz K3ii0bTShouHWpQzG2U4Z/td5mBvVjEDtD9pIvUzOyhA6I58d7B1o/SeBVaZ1TVTaY8R JXIJVZSYMw0wNWQnNY6wT1c3kQXycHWKI5b0wReXF9/51W12ftfbBYrAGhICcoU2hypX TekA== MIME-Version: 1.0 X-Received: by 10.180.24.68 with SMTP id s4mr1662219wif.12.1400009728749; Tue, 13 May 2014 12:35:28 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.216.169.193 with HTTP; Tue, 13 May 2014 12:35:28 -0700 (PDT) In-Reply-To: <201405131909.s4DJ90Cc040529@svn.freebsd.org> References: <201405131909.s4DJ90Cc040529@svn.freebsd.org> Date: Tue, 13 May 2014 23:35:28 +0400 X-Google-Sender-Auth: WLG_5nxsZ-qC_lYcSnKU6KAakXA Message-ID: Subject: Re: svn commit: r265973 - stable/10/sys/dev/uart From: Sergey Kandaurov To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 19:35:31 -0000 On 13 May 2014 23:09, Ian Lepore wrote: > Author: ian > Date: Tue May 13 19:09:00 2014 > New Revision: 265973 > URL: http://svnweb.freebsd.org/changeset/base/265973 > > Log: > MFC r257111, r257144, r257157, r257183 > > Test UARTs physical address instead of virtual. > > Be a bit more flexible in how we find the console from the properties on > /chosen, following the list of allowed console properties in ePAPR. Also > do not require that stdin be defined and equal to stdout: stdin is > nonstandard (for ePAPR) and console in an unexpected place is after all > better than no console. > > Modified: > stable/10/sys/dev/uart/uart_cpu_fdt.c > Taking random commit of your merge series: all of them miss svn:mergeinfo. -- wbr, pluknet From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 22:35:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6C171968; Tue, 13 May 2014 22:35:07 +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 4D707261C; Tue, 13 May 2014 22:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4DMZ7wl036625; Tue, 13 May 2014 22:35:07 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DMZ6ln036621; Tue, 13 May 2014 22:35:06 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201405132235.s4DMZ6ln036621@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 13 May 2014 22:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265983 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 22:35:07 -0000 Author: edwin Date: Tue May 13 22:35:06 2014 New Revision: 265983 URL: http://svnweb.freebsd.org/changeset/base/265983 Log: MFC of tzdata2014c - Egypt will go into DST in 15 May 2014 Modified: stable/10/contrib/tzdata/africa stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/europe Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/africa ============================================================================== --- stable/10/contrib/tzdata/africa Tue May 13 21:31:13 2014 (r265982) +++ stable/10/contrib/tzdata/africa Tue May 13 22:35:06 2014 (r265983) @@ -335,11 +335,54 @@ Rule Egypt 2007 only - Sep Thu>=1 23:00s # http://www.worldtimezone.com/dst_news/dst_news_egypt02.html # +# From Ahmad El-Dardiry (2014-05-07): +# Egypt is to change back to Daylight system on May 15 +# http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx + +# From Gunther Vermier (2015-05-13): +# our Egypt office confirms that the change will be at 15 May "midnight" (24:00) + +# From Paul Eggert (2014-05-13): +# Sarah El Deeb and Lee Keath of AP report that the Egyptian government says +# the change is because of blackouts in Cairo, even though Ahram Online (cited +# above) says DST had no affect on electricity consumption. The AP story says +# DST will not be observed during Ramadan. There is no information about when +# DST will end. See: +# http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833 +# +# For now, guess that later transitions will use 2010's rules, and that +# Egypt will agree with Morocco (see below) about the date Ramadan starts and +# ends, though (unlike Morocco) it will switch at 00:00 standard time. In +# Egypt the spring-forward transitions are removed for 2020-2022, when the +# guessed spring-forward date falls during the estimated Ramadan, and all +# transitions removed for 2023-2038, where the estimated Ramadan falls entirely +# outside the guessed daylight-saving time. Ramadan intrudes on the guessed +# DST starting in 2039, but that's beyond our somewhat-arbitrary cutoff. + Rule Egypt 2008 only - Aug lastThu 23:00s 0 - Rule Egypt 2009 only - Aug 20 23:00s 0 - Rule Egypt 2010 only - Aug 11 0:00 0 - Rule Egypt 2010 only - Sep 10 0:00 1:00 S Rule Egypt 2010 only - Sep lastThu 23:00s 0 - +Rule Egypt 2014 only - May 15 24:00 1:00 S +Rule Egypt 2014 only - Jun 29 0:00s 0 - +Rule Egypt 2014 only - Jul 29 0:00s 1:00 S +Rule Egypt 2014 max - Sep lastThu 23:00s 0 - +Rule Egypt 2015 2019 - Apr lastFri 0:00s 1:00 S +Rule Egypt 2015 only - Jun 18 0:00s 0 - +Rule Egypt 2015 only - Jul 18 0:00s 1:00 S +Rule Egypt 2016 only - Jun 7 0:00s 0 - +Rule Egypt 2016 only - Jul 7 0:00s 1:00 S +Rule Egypt 2017 only - May 27 0:00s 0 - +Rule Egypt 2017 only - Jun 26 0:00s 1:00 S +Rule Egypt 2018 only - May 16 0:00s 0 - +Rule Egypt 2018 only - Jun 15 0:00s 1:00 S +Rule Egypt 2019 only - May 6 0:00s 0 - +Rule Egypt 2019 only - Jun 5 0:00s 1:00 S +Rule Egypt 2020 only - May 24 0:00s 1:00 S +Rule Egypt 2021 only - May 13 0:00s 1:00 S +Rule Egypt 2022 only - May 3 0:00s 1:00 S +Rule Egypt 2023 max - Apr lastFri 0:00s 1:00 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Cairo 2:05:09 - LMT 1900 Oct Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Tue May 13 21:31:13 2014 (r265982) +++ stable/10/contrib/tzdata/asia Tue May 13 22:35:06 2014 (r265983) @@ -1347,22 +1347,6 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # "Jordan will switch to winter time on Friday, October 27". # -# From Phil Pizzey (2009-04-02): -# ...I think I may have spotted an error in the timezone data for -# Jordan. -# The current (2009d) asia file shows Jordan going to daylight -# saving -# time on the last Thursday in March. -# -# Rule Jordan 2000 max - Mar lastThu 0:00s 1:00 S -# -# However timeanddate.com, which I usually find reliable, shows Jordan -# going to daylight saving time on the last Friday in March since 2002. -# Please see -# -# http://www.timeanddate.com/worldclock/timezone.html?n=11 -# - # From Steffen Thorsen (2009-04-02): # This single one might be good enough, (2009-03-24, Arabic): # Modified: stable/10/contrib/tzdata/europe ============================================================================== --- stable/10/contrib/tzdata/europe Tue May 13 21:31:13 2014 (r265982) +++ stable/10/contrib/tzdata/europe Tue May 13 22:35:06 2014 (r265983) @@ -2966,6 +2966,10 @@ Zone Europe/Simferopol 2:16:24 - LMT 188 # From Alexander Krivenyshev (2014-03-17): # time change at 2:00 (2am) on March 30, 2014 # http://vz.ru/news/2014/3/17/677464.html +# From Paul Eggert (2014-03-30): +# Simferopol and Sevastopol reportedly changed their central town clocks +# late the previous day, but this appears to have been ceremonial +# and the discrepancies are small enough to not worry about. 2:00 EU EE%sT 2014 Mar 30 2:00 4:00 - MSK From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 22:43:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B8988B1B; Tue, 13 May 2014 22:43: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 A524426D1; Tue, 13 May 2014 22:43: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 s4DMh2it040599; Tue, 13 May 2014 22:43:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DMh2pg040598; Tue, 13 May 2014 22:43:02 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405132243.s4DMh2pg040598@svn.freebsd.org> From: Glen Barber Date: Tue, 13 May 2014 22:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265984 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 22:43:02 -0000 Author: gjb Date: Tue May 13 22:43:02 2014 New Revision: 265984 URL: http://svnweb.freebsd.org/changeset/base/265984 Log: Document r265922, mrsas(4) merge. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 13 22:35:06 2014 (r265983) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 13 22:43:02 2014 (r265984) @@ -138,6 +138,22 @@ providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA controllers. + The &man.mrsas.4; driver has been added, + providing support for LSI MegaRAID SAS controllers. The + &man.mfi.4; driver will attach to the controller, by default. + To enable &man.mrsas.4; add + hw.mfi.mrsas_enable=1 to + /boot/loader.conf, which turns off + &man.mfi.4; device probing. + + + At this time, the &man.mfiutil.8; utility and + the &os; version of + MegaCLI and + StorCli do not work with + &man.mrsas.4;. + + Virtualization support From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 23:19:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 881935C2; Tue, 13 May 2014 23:19: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 758022941; Tue, 13 May 2014 23:19: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 s4DNJHuR055014; Tue, 13 May 2014 23:19:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DNJH7T055013; Tue, 13 May 2014 23:19:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405132319.s4DNJH7T055013@svn.freebsd.org> From: Xin LI Date: Tue, 13 May 2014 23:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265986 - stable/10/crypto/openssl/ssl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 23:19:17 -0000 Author: delphij Date: Tue May 13 23:19:16 2014 New Revision: 265986 URL: http://svnweb.freebsd.org/changeset/base/265986 Log: Fix OpenSSL NULL pointer deference vulnerability. Obtained from: OpenBSD Security: FreeBSD-SA-14:09.openssl Security: CVE-2014-0198 Modified: stable/10/crypto/openssl/ssl/s3_pkt.c Modified: stable/10/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- stable/10/crypto/openssl/ssl/s3_pkt.c Tue May 13 23:17:24 2014 (r265985) +++ stable/10/crypto/openssl/ssl/s3_pkt.c Tue May 13 23:19:16 2014 (r265986) @@ -657,6 +657,10 @@ static int do_ssl3_write(SSL *s, int typ if (i <= 0) return(i); /* if it went, fall through and send more stuff */ + /* we may have released our buffer, so get it again */ + if (wb->buf == NULL) + if (!ssl3_setup_write_buffer(s)) + return -1; } if (len == 0 && !create_empty_fragment) From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 23:36:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6151FDA6 for ; Tue, 13 May 2014 23:36:56 +0000 (UTC) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) (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 DAF3B2ACC for ; Tue, 13 May 2014 23:36:55 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id q8so821594lbi.41 for ; Tue, 13 May 2014 16:36:47 -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=EZNUp0y6eiXhLbMe2J1yDDpwniy+tCc/y8/eF9gAVIc=; b=ceCfp39Ebr4Bfd8VA0Bf4bnPy4AnmrsSb9DfE+Y1snXxAf+F6a8sL9mJXP5KwO9NnU QpUGcKbKffQEOXHOow0ZB4HzUt2m5BKb2/NvTlpFPnLIkRHjKyzUZyuKCQgQybMzweoj +DKFRhRz3VjqyYL+m31e+tWT+epdIYmV/49NokBdTW/EOQN560cSMY4f/y99g7gPk3yn mX6IUIfM2gLZb669v7hLXG5SpPhiLg9BzC8rtiZtmO4n2SxAmEc+TijsfJuCFUxiIgD4 ZDaqNASNHKlPXFlcU9996kdjFdu1WtgHcRoAsVn36lM2lwvv7AvJhP1ZF7esTxEH3Q1l ztuw== X-Gm-Message-State: ALoCoQl1A8FU5okk3TtCQBO6G56raOwqzdhetFPIP/fq9vC0xbiKO1lhQxy3+Mqk+uhGsMoWR2f/ X-Received: by 10.112.35.14 with SMTP id d14mr94826lbj.43.1400024207238; Tue, 13 May 2014 16:36:47 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id oc3sm49842lbb.18.2014.05.13.16.36.46 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 May 2014 16:36:46 -0700 (PDT) Message-ID: <5372AC8E.1070507@freebsd.org> Date: Wed, 14 May 2014 03:36:46 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r265986 - stable/10/crypto/openssl/ssl References: <201405132319.s4DNJH7T055013@svn.freebsd.org> In-Reply-To: <201405132319.s4DNJH7T055013@svn.freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 23:36:56 -0000 On 14.05.2014 3:19, Xin LI wrote: > Author: delphij > Date: Tue May 13 23:19:16 2014 > New Revision: 265986 > URL: http://svnweb.freebsd.org/changeset/base/265986 > > Log: > Fix OpenSSL NULL pointer deference vulnerability. > > Obtained from: OpenBSD > Security: FreeBSD-SA-14:09.openssl > Security: CVE-2014-0198 Official fix is a bit different: https://github.com/openssl/openssl/commit/b107586c0c3447ea22dba8698ebbcd81bb29d48c from https://rt.openssl.org/Ticket/Display.html?user=guest&pass=guest&id=3321 Do we follow official branch or OpenBSD fixes? > > Modified: > stable/10/crypto/openssl/ssl/s3_pkt.c > > Modified: stable/10/crypto/openssl/ssl/s3_pkt.c > ============================================================================== > --- stable/10/crypto/openssl/ssl/s3_pkt.c Tue May 13 23:17:24 2014 (r265985) > +++ stable/10/crypto/openssl/ssl/s3_pkt.c Tue May 13 23:19:16 2014 (r265986) > @@ -657,6 +657,10 @@ static int do_ssl3_write(SSL *s, int typ > if (i <= 0) > return(i); > /* if it went, fall through and send more stuff */ > + /* we may have released our buffer, so get it again */ > + if (wb->buf == NULL) > + if (!ssl3_setup_write_buffer(s)) > + return -1; > } > > if (len == 0 && !create_empty_fragment) > -- http://ache.vniz.net/ From owner-svn-src-stable-10@FreeBSD.ORG Tue May 13 23:56:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8A163FA; Tue, 13 May 2014 23:56: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 5D7EA2C56; Tue, 13 May 2014 23:56: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 s4DNuqpd074147; Tue, 13 May 2014 23:56:52 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DNuq7G074146; Tue, 13 May 2014 23:56:52 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405132356.s4DNuq7G074146@svn.freebsd.org> From: Ian Lepore Date: Tue, 13 May 2014 23:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265991 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 23:56:52 -0000 Author: ian Date: Tue May 13 23:56:51 2014 New Revision: 265991 URL: http://svnweb.freebsd.org/changeset/base/265991 Log: Record missing merge info caused by an erroneous "helper" script I wrote. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 00:05:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 615ADF39; Wed, 14 May 2014 00:05: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 32FC62EF8; Wed, 14 May 2014 00:05: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 s4E05ae3079596; Wed, 14 May 2014 00:05:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E05aQc079595; Wed, 14 May 2014 00:05:36 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405140005.s4E05aQc079595@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 00:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265992 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 00:05:36 -0000 Author: ian Date: Wed May 14 00:05:35 2014 New Revision: 265992 URL: http://svnweb.freebsd.org/changeset/base/265992 Log: Record mergeinfo that was eaten by the dog. Yeah, that's my story and I'm sticking to it. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 00:07:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C41F8134; Wed, 14 May 2014 00:07:58 +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 969552F2C; Wed, 14 May 2014 00:07:58 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WkMjl-000Oel-4S; Wed, 14 May 2014 00:07:57 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s4E07sTf035719; Tue, 13 May 2014 18:07:54 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19mD768Tjg8d3CJH0NTYbTw Subject: Re: svn commit: r265973 - stable/10/sys/dev/uart From: Ian Lepore To: Sergey Kandaurov In-Reply-To: References: <201405131909.s4DJ90Cc040529@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 13 May 2014 18:07:54 -0600 Message-ID: <1400026074.56626.18.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-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-10@FreeBSD.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 00:07:58 -0000 On Tue, 2014-05-13 at 23:35 +0400, Sergey Kandaurov wrote: > On 13 May 2014 23:09, Ian Lepore wrote: > > Author: ian > > Date: Tue May 13 19:09:00 2014 > > New Revision: 265973 > > URL: http://svnweb.freebsd.org/changeset/base/265973 > > > > Log: > > MFC r257111, r257144, r257157, r257183 > > > > Test UARTs physical address instead of virtual. > > > > Be a bit more flexible in how we find the console from the properties on > > /chosen, following the list of allowed console properties in ePAPR. Also > > do not require that stdin be defined and equal to stdout: stdin is > > nonstandard (for ePAPR) and console in an unexpected place is after all > > better than no console. > > > > Modified: > > stable/10/sys/dev/uart/uart_cpu_fdt.c > > > > Taking random commit of your merge series: all of them miss svn:mergeinfo. > Thanks. A combo of a misunderstanding on my part and a poorly written helper script caused this. (I wrote another script to help me fix it, I sure hope I got that one right) At least you let me know before it got too out of hand... I have over 400 ARM-related changesets to merge still. -- Ian From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 00:51:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C7F9EB06; Wed, 14 May 2014 00:51: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 B356B2252; Wed, 14 May 2014 00:51: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 s4E0pSR0000639; Wed, 14 May 2014 00:51:28 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E0pQJ2000627; Wed, 14 May 2014 00:51:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405140051.s4E0pQJ2000627@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 00:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265996 - in stable/10/sys/powerpc: aim booke include mpc85xx powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 00:51:28 -0000 Author: ian Date: Wed May 14 00:51:26 2014 New Revision: 265996 URL: http://svnweb.freebsd.org/changeset/base/265996 Log: MFC r257161, r257169, r257178, r257190, r257191 Add pmap_mapdev_attr() and pmap_kenter_attr() interfaces. Fix concurrency issues with TLB1 updates and make pmap_kextract() search TLB1 mappings as well Interrelated improvements to early boot mappings: - Remove explicit requirement that the SOC registers be found except as an optimization (although the MPC85XX LAW drivers still require they be found externally, which should change). - Remove magic CCSRBAR_VA value. - Allow bus_machdep.c's early-boot code to handle non 1:1 mappings and systems not in real-mode or global 1:1 maps in early boot. - Allow pmap_mapdev() on Book-E to reissue previous addresses if the area is already mapped. Additionally have it check all mappings, not just the CCSR area. Add some extra sanity checking and checks to printf format specifiers. Bump initial TLB size. The kernel is not necessarily less than 16 MB Handle (in a slightly ugly way) ePAPR-type loaders that just place a device tree into r3. Modified: stable/10/sys/powerpc/aim/machdep.c stable/10/sys/powerpc/booke/locore.S stable/10/sys/powerpc/booke/machdep.c stable/10/sys/powerpc/booke/machdep_e500.c stable/10/sys/powerpc/booke/pmap.c stable/10/sys/powerpc/include/pmap.h stable/10/sys/powerpc/include/tlb.h stable/10/sys/powerpc/include/vmparam.h stable/10/sys/powerpc/mpc85xx/mpc85xx.c stable/10/sys/powerpc/mpc85xx/mpc85xx.h stable/10/sys/powerpc/powerpc/bus_machdep.c Modified: stable/10/sys/powerpc/aim/machdep.c ============================================================================== --- stable/10/sys/powerpc/aim/machdep.c Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/aim/machdep.c Wed May 14 00:51:26 2014 (r265996) @@ -777,6 +777,13 @@ va_to_vsid(pmap_t pm, vm_offset_t va) #endif +vm_offset_t +pmap_early_io_map(vm_paddr_t pa, vm_size_t size) +{ + + return (pa); +} + /* From p3-53 of the MPC7450 RISC Microprocessor Family Reference Manual */ void flush_disable_caches(void) @@ -944,4 +951,4 @@ cpu_sleep() if (vectd == curthread) enable_vec(curthread); powerpc_sync(); -} +} \ No newline at end of file Modified: stable/10/sys/powerpc/booke/locore.S ============================================================================== --- stable/10/sys/powerpc/booke/locore.S Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/booke/locore.S Wed May 14 00:51:26 2014 (r265996) @@ -158,7 +158,7 @@ __start: mtspr SPR_MAS0, %r3 isync - li %r3, (TLB_SIZE_16M << MAS1_TSIZE_SHIFT)@l + li %r3, (TLB_SIZE_64M << MAS1_TSIZE_SHIFT)@l oris %r3, %r3, (MAS1_VALID | MAS1_IPROT)@h mtspr SPR_MAS1, %r3 /* note TS was not filled, so it's TS=0 */ isync Modified: stable/10/sys/powerpc/booke/machdep.c ============================================================================== --- stable/10/sys/powerpc/booke/machdep.c Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/booke/machdep.c Wed May 14 00:51:26 2014 (r265996) @@ -137,6 +137,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -276,6 +277,23 @@ print_kernel_section_addr(void) debugf(" _end = 0x%08x\n", (uint32_t)_end); } +static int +booke_check_for_fdt(uint32_t arg1, vm_offset_t *dtbp) +{ + void *ptr; + + if (arg1 % 8 != 0) + return (-1); + + ptr = (void *)pmap_early_io_map(arg1, PAGE_SIZE); + if (fdt_check_header(ptr) != 0) + return (-1); + + *dtbp = (vm_offset_t)ptr; + + return (0); +} + u_int booke_init(uint32_t arg1, uint32_t arg2) { @@ -288,6 +306,10 @@ booke_init(uint32_t arg1, uint32_t arg2) end = (uintptr_t)_end; dtbp = (vm_offset_t)NULL; + /* Set up TLB initially */ + bootinfo = NULL; + tlb1_init(); + /* * Handle the various ways we can get loaded and started: * - FreeBSD's loader passes the pointer to the metadata @@ -302,11 +324,21 @@ booke_init(uint32_t arg1, uint32_t arg2) * in arg1 and arg2 (resp). arg1 is between 1 and some * relatively small number, such as 64K. arg2 is the * physical address of the argv vector. + * - ePAPR loaders pass an FDT blob in r3 (arg1) and the magic hex + * string 0x45504150 ('ePAP') in r6 (which has been lost by now). + * r4 (arg2) is supposed to be set to zero, but is not always. */ - if (arg1 > (uintptr_t)kernel_text) /* FreeBSD loader */ - mdp = (void *)arg1; - else if (arg1 == 0) /* Juniper loader */ + + if (arg1 == 0) /* Juniper loader */ mdp = (void *)arg2; + else if (booke_check_for_fdt(arg1, &dtbp) == 0) { /* ePAPR */ + end = roundup(end, 8); + memmove((void *)end, (void *)dtbp, fdt_totalsize((void *)dtbp)); + dtbp = end; + end += fdt_totalsize((void *)dtbp); + mdp = NULL; + } else if (arg1 > (uintptr_t)kernel_text) /* FreeBSD loader */ + mdp = (void *)arg1; else /* U-Boot */ mdp = NULL; @@ -350,13 +382,18 @@ booke_init(uint32_t arg1, uint32_t arg2) if (OF_init((void *)dtbp) != 0) while (1); - if (fdt_immr_addr(CCSRBAR_VA) != 0) - while (1); - OF_interpret("perform-fixup", 0); - /* Set up TLB initially */ - booke_init_tlb(fdt_immr_pa); + /* Reset TLB1 to get rid of temporary mappings */ + tlb1_init(); + + /* Set up IMMR */ + if (fdt_immr_addr(0) == 0) { + fdt_immr_va = pmap_early_io_map(fdt_immr_pa, fdt_immr_size); + } else { + printf("Warning: SOC base registers could not be found!\n"); + fdt_immr_va = 0; + } /* Reset Time Base */ mttb(0); Modified: stable/10/sys/powerpc/booke/machdep_e500.c ============================================================================== --- stable/10/sys/powerpc/booke/machdep_e500.c Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/booke/machdep_e500.c Wed May 14 00:51:26 2014 (r265996) @@ -47,8 +47,6 @@ void booke_init_tlb(vm_paddr_t fdt_immr_pa) { - /* Initialize TLB1 handling */ - tlb1_init(fdt_immr_pa); } void Modified: stable/10/sys/powerpc/booke/pmap.c ============================================================================== --- stable/10/sys/powerpc/booke/pmap.c Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/booke/pmap.c Wed May 14 00:51:26 2014 (r265996) @@ -113,7 +113,6 @@ extern uint32_t *bootinfo; extern uint32_t bp_ntlb1s; #endif -vm_paddr_t ccsrbar_pa; vm_paddr_t kernload; vm_offset_t kernstart; vm_size_t kernsize; @@ -315,9 +314,11 @@ static void mmu_booke_activate(mmu_t, s static void mmu_booke_deactivate(mmu_t, struct thread *); static void mmu_booke_bootstrap(mmu_t, vm_offset_t, vm_offset_t); static void *mmu_booke_mapdev(mmu_t, vm_paddr_t, vm_size_t); +static void *mmu_booke_mapdev_attr(mmu_t, vm_paddr_t, vm_size_t, vm_memattr_t); static void mmu_booke_unmapdev(mmu_t, vm_offset_t, vm_size_t); static vm_paddr_t mmu_booke_kextract(mmu_t, vm_offset_t); static void mmu_booke_kenter(mmu_t, vm_offset_t, vm_paddr_t); +static void mmu_booke_kenter_attr(mmu_t, vm_offset_t, vm_paddr_t, vm_memattr_t); static void mmu_booke_kremove(mmu_t, vm_offset_t); static boolean_t mmu_booke_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void mmu_booke_sync_icache(mmu_t, pmap_t, vm_offset_t, @@ -371,7 +372,9 @@ static mmu_method_t mmu_booke_methods[] MMUMETHOD(mmu_bootstrap, mmu_booke_bootstrap), MMUMETHOD(mmu_dev_direct_mapped,mmu_booke_dev_direct_mapped), MMUMETHOD(mmu_mapdev, mmu_booke_mapdev), + MMUMETHOD(mmu_mapdev_attr, mmu_booke_mapdev_attr), MMUMETHOD(mmu_kenter, mmu_booke_kenter), + MMUMETHOD(mmu_kenter_attr, mmu_booke_kenter_attr), MMUMETHOD(mmu_kextract, mmu_booke_kextract), /* MMUMETHOD(mmu_kremove, mmu_booke_kremove), */ MMUMETHOD(mmu_unmapdev, mmu_booke_unmapdev), @@ -386,6 +389,42 @@ static mmu_method_t mmu_booke_methods[] MMU_DEF(booke_mmu, MMU_TYPE_BOOKE, mmu_booke_methods, 0); +static __inline uint32_t +tlb_calc_wimg(vm_offset_t pa, vm_memattr_t ma) +{ + uint32_t attrib; + int i; + + if (ma != VM_MEMATTR_DEFAULT) { + switch (ma) { + case VM_MEMATTR_UNCACHEABLE: + return (PTE_I | PTE_G); + case VM_MEMATTR_WRITE_COMBINING: + case VM_MEMATTR_WRITE_BACK: + case VM_MEMATTR_PREFETCHABLE: + return (PTE_I); + case VM_MEMATTR_WRITE_THROUGH: + return (PTE_W | PTE_M); + } + } + + /* + * Assume the page is cache inhibited and access is guarded unless + * it's in our available memory array. + */ + attrib = _TLB_ENTRY_IO; + for (i = 0; i < physmem_regions_sz; i++) { + if ((pa >= physmem_regions[i].mr_start) && + (pa < (physmem_regions[i].mr_start + + physmem_regions[i].mr_size))) { + attrib = _TLB_ENTRY_MEM; + break; + } + } + + return (attrib); +} + static inline void tlb_miss_lock(void) { @@ -1315,6 +1354,15 @@ mmu_booke_extract(mmu_t mmu, pmap_t pmap static vm_paddr_t mmu_booke_kextract(mmu_t mmu, vm_offset_t va) { + int i; + + /* Check TLB1 mappings */ + for (i = 0; i < tlb1_idx; i++) { + if (!(tlb1[i].mas1 & MAS1_VALID)) + continue; + if (va >= tlb1[i].virt && va < tlb1[i].virt + tlb1[i].size) + return (tlb1[i].phys + (va - tlb1[i].virt)); + } return (pte_vatopa(mmu, kernel_pmap, va)); } @@ -1392,6 +1440,13 @@ mmu_booke_qremove(mmu_t mmu, vm_offset_t static void mmu_booke_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa) { + + mmu_booke_kenter_attr(mmu, va, pa, VM_MEMATTR_DEFAULT); +} + +static void +mmu_booke_kenter_attr(mmu_t mmu, vm_offset_t va, vm_paddr_t pa, vm_memattr_t ma) +{ unsigned int pdir_idx = PDIR_IDX(va); unsigned int ptbl_idx = PTBL_IDX(va); uint32_t flags; @@ -1400,7 +1455,8 @@ mmu_booke_kenter(mmu_t mmu, vm_offset_t KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && (va <= VM_MAX_KERNEL_ADDRESS)), ("mmu_booke_kenter: invalid va")); - flags = PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; + flags = PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; + flags |= tlb_calc_wimg(pa, ma); pte = &(kernel_pmap->pm_pdir[pdir_idx][ptbl_idx]); @@ -2595,33 +2651,49 @@ mmu_booke_scan_md(mmu_t mmu, struct pmap static void * mmu_booke_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { + + return (mmu_booke_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT)); +} + +static void * +mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_size_t size, vm_memattr_t ma) +{ void *res; uintptr_t va; vm_size_t sz; + int i; /* - * CCSR is premapped. Note that (pa + size - 1) is there to make sure - * we don't wrap around. Devices on the local bus typically extend all - * the way up to and including 0xffffffff. In that case (pa + size) - * would be 0. This creates a false positive (i.e. we think it's - * within the CCSR) and not create a mapping. - */ - if (pa >= ccsrbar_pa && (pa + size - 1) < (ccsrbar_pa + CCSRBAR_SIZE)) { - va = CCSRBAR_VA + (pa - ccsrbar_pa); - return ((void *)va); + * Check if this is premapped in TLB1. Note: this should probably also + * check whether a sequence of TLB1 entries exist that match the + * requirement, but now only checks the easy case. + */ + if (ma == VM_MEMATTR_DEFAULT) { + for (i = 0; i < tlb1_idx; i++) { + if (!(tlb1[i].mas1 & MAS1_VALID)) + continue; + if (pa >= tlb1[i].phys && + (pa + size) <= (tlb1[i].phys + tlb1[i].size)) + return (void *)(tlb1[i].virt + + (pa - tlb1[i].phys)); + } } - va = (pa >= 0x80000000) ? pa : (0xe2000000 + pa); + size = roundup(size, PAGE_SIZE); + + if (pa >= (VM_MAXUSER_ADDRESS + PAGE_SIZE) && + (pa + size - 1) < VM_MIN_KERNEL_ADDRESS) + va = pa; + else + va = kva_alloc(size); res = (void *)va; - if (size < PAGE_SIZE) - size = PAGE_SIZE; do { sz = 1 << (ilog2(size) & ~1); if (bootverbose) printf("Wiring VA=%x to PA=%x (size=%x), " "using TLB1[%d]\n", va, pa, sz, tlb1_idx); - tlb1_set_entry(va, pa, sz, _TLB_ENTRY_IO); + tlb1_set_entry(va, pa, sz, tlb_calc_wimg(pa, ma)); size -= sz; pa += sz; va += sz; @@ -2636,6 +2708,7 @@ mmu_booke_mapdev(mmu_t mmu, vm_paddr_t p static void mmu_booke_unmapdev(mmu_t mmu, vm_offset_t va, vm_size_t size) { +#ifdef SUPPORTS_SHRINKING_TLB1 vm_offset_t base, offset; /* @@ -2647,6 +2720,7 @@ mmu_booke_unmapdev(mmu_t mmu, vm_offset_ size = roundup(offset + size, PAGE_SIZE); kva_free(base, size); } +#endif } /* @@ -2827,9 +2901,8 @@ tlb0_print_tlbentries(void) /* * TLB1 mapping notes: * - * TLB1[0] CCSRBAR - * TLB1[1] Kernel text and data. - * TLB1[2-15] Additional kernel text and data mappings (if required), PCI + * TLB1[0] Kernel text and data. + * TLB1[1-15] Additional kernel text and data mappings (if required), PCI * windows, other devices mappings. */ @@ -2913,9 +2986,10 @@ tlb1_set_entry(vm_offset_t va, vm_offset uint32_t flags) { uint32_t ts, tid; - int tsize; - - if (tlb1_idx >= TLB1_ENTRIES) { + int tsize, index; + + index = atomic_fetchadd_int(&tlb1_idx, 1); + if (index >= TLB1_ENTRIES) { printf("tlb1_set_entry: TLB1 full!\n"); return (-1); } @@ -2927,18 +3001,22 @@ tlb1_set_entry(vm_offset_t va, vm_offset /* XXX TS is hard coded to 0 for now as we only use single address space */ ts = (0 << MAS1_TS_SHIFT) & MAS1_TS_MASK; - /* XXX LOCK tlb1[] */ + /* + * Atomicity is preserved by the atomic increment above since nothing + * is ever removed from tlb1. + */ - tlb1[tlb1_idx].mas1 = MAS1_VALID | MAS1_IPROT | ts | tid; - tlb1[tlb1_idx].mas1 |= ((tsize << MAS1_TSIZE_SHIFT) & MAS1_TSIZE_MASK); - tlb1[tlb1_idx].mas2 = (va & MAS2_EPN_MASK) | flags; + tlb1[index].phys = pa; + tlb1[index].virt = va; + tlb1[index].size = size; + tlb1[index].mas1 = MAS1_VALID | MAS1_IPROT | ts | tid; + tlb1[index].mas1 |= ((tsize << MAS1_TSIZE_SHIFT) & MAS1_TSIZE_MASK); + tlb1[index].mas2 = (va & MAS2_EPN_MASK) | flags; /* Set supervisor RWX permission bits */ - tlb1[tlb1_idx].mas3 = (pa & MAS3_RPN) | MAS3_SR | MAS3_SW | MAS3_SX; + tlb1[index].mas3 = (pa & MAS3_RPN) | MAS3_SR | MAS3_SW | MAS3_SX; - tlb1_write_entry(tlb1_idx++); - - /* XXX UNLOCK tlb1[] */ + tlb1_write_entry(index); /* * XXX in general TLB1 updates should be propagated between CPUs, @@ -3017,14 +3095,12 @@ tlb1_mapin_region(vm_offset_t va, vm_pad * assembler level setup done in locore.S. */ void -tlb1_init(vm_offset_t ccsrbar) +tlb1_init() { - uint32_t mas0, mas1, mas3; + uint32_t mas0, mas1, mas2, mas3; uint32_t tsz; u_int i; - ccsrbar_pa = ccsrbar; - if (bootinfo != NULL && bootinfo[0] != 1) { tlb1_idx = *((uint16_t *)(bootinfo + 8)); } else @@ -3040,22 +3116,23 @@ tlb1_init(vm_offset_t ccsrbar) if ((mas1 & MAS1_VALID) == 0) continue; + mas2 = mfspr(SPR_MAS2); mas3 = mfspr(SPR_MAS3); tlb1[i].mas1 = mas1; tlb1[i].mas2 = mfspr(SPR_MAS2); tlb1[i].mas3 = mas3; + tlb1[i].virt = mas2 & MAS2_EPN_MASK; + tlb1[i].phys = mas3 & MAS3_RPN; if (i == 0) kernload = mas3 & MAS3_RPN; tsz = (mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; - kernsize += (tsz > 0) ? tsize2size(tsz) : 0; + tlb1[i].size = (tsz > 0) ? tsize2size(tsz) : 0; + kernsize += tlb1[i].size; } - /* Map in CCSRBAR. */ - tlb1_set_entry(CCSRBAR_VA, ccsrbar, CCSRBAR_SIZE, _TLB_ENTRY_IO); - #ifdef SMP bp_ntlb1s = tlb1_idx; #endif @@ -3068,6 +3145,43 @@ tlb1_init(vm_offset_t ccsrbar) set_mas4_defaults(); } +vm_offset_t +pmap_early_io_map(vm_paddr_t pa, vm_size_t size) +{ + static vm_offset_t early_io_map_base = VM_MAX_KERNEL_ADDRESS; + vm_paddr_t pa_base; + vm_offset_t va, sz; + int i; + + KASSERT(!pmap_bootstrapped, ("Do not use after PMAP is up!")); + + for (i = 0; i < tlb1_idx; i++) { + if (!(tlb1[i].mas1 & MAS1_VALID)) + continue; + if (pa >= tlb1[i].phys && (pa + size) <= + (tlb1[i].phys + tlb1[i].size)) + return (tlb1[i].virt + (pa - tlb1[i].phys)); + } + + pa_base = trunc_page(pa); + size = roundup(size + (pa - pa_base), PAGE_SIZE); + va = early_io_map_base + (pa - pa_base); + + do { + sz = 1 << (ilog2(size) & ~1); + tlb1_set_entry(early_io_map_base, pa_base, sz, _TLB_ENTRY_IO); + size -= sz; + pa_base += sz; + early_io_map_base += sz; + } while (size > 0); + +#ifdef SMP + bp_ntlb1s = tlb1_idx; +#endif + + return (va); +} + /* * Setup MAS4 defaults. * These values are loaded to MAS0-2 on a TLB miss. Modified: stable/10/sys/powerpc/include/pmap.h ============================================================================== --- stable/10/sys/powerpc/include/pmap.h Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/include/pmap.h Wed May 14 00:51:26 2014 (r265996) @@ -258,6 +258,8 @@ extern void pmap_dumpsys_unmap(struct pm extern struct pmap_md *pmap_scan_md(struct pmap_md *); +vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t size); + #endif #endif /* !_MACHINE_PMAP_H_ */ Modified: stable/10/sys/powerpc/include/tlb.h ============================================================================== --- stable/10/sys/powerpc/include/tlb.h Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/include/tlb.h Wed May 14 00:51:26 2014 (r265996) @@ -126,6 +126,9 @@ #if !defined(LOCORE) typedef struct tlb_entry { + vm_paddr_t phys; + vm_offset_t virt; + vm_size_t size; uint32_t mas1; uint32_t mas2; uint32_t mas3; @@ -134,7 +137,7 @@ typedef struct tlb_entry { void tlb0_print_tlbentries(void); void tlb1_inval_entry(unsigned int); -void tlb1_init(vm_offset_t); +void tlb1_init(void); void tlb1_print_entries(void); void tlb1_print_tlbentries(void); #endif /* !LOCORE */ Modified: stable/10/sys/powerpc/include/vmparam.h ============================================================================== --- stable/10/sys/powerpc/include/vmparam.h Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/include/vmparam.h Wed May 14 00:51:26 2014 (r265996) @@ -108,12 +108,6 @@ #else /* Book-E */ -/* - * Kernel CCSRBAR location. We make this the reset location. - */ -#define CCSRBAR_VA 0xfef00000 -#define CCSRBAR_SIZE 0x00100000 - #define KERNBASE 0xc0000000 /* start of kernel virtual */ #define VM_MIN_KERNEL_ADDRESS KERNBASE Modified: stable/10/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- stable/10/sys/powerpc/mpc85xx/mpc85xx.c Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/mpc85xx/mpc85xx.c Wed May 14 00:51:26 2014 (r265996) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include /* Modified: stable/10/sys/powerpc/mpc85xx/mpc85xx.h ============================================================================== --- stable/10/sys/powerpc/mpc85xx/mpc85xx.h Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/mpc85xx/mpc85xx.h Wed May 14 00:51:26 2014 (r265996) @@ -33,6 +33,7 @@ /* * Configuration control and status registers */ +#define CCSRBAR_VA fdt_immr_va #define OCP85XX_CCSRBAR (CCSRBAR_VA + 0x0) #define OCP85XX_BPTR (CCSRBAR_VA + 0x20) Modified: stable/10/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/bus_machdep.c Wed May 14 00:50:31 2014 (r265995) +++ stable/10/sys/powerpc/powerpc/bus_machdep.c Wed May 14 00:51:26 2014 (r265996) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #define MAX_EARLYBOOT_MAPPINGS 6 static struct { + vm_offset_t virt; bus_addr_t addr; bus_size_t size; int flags; @@ -86,10 +87,12 @@ bs_gen_map(bus_addr_t addr, bus_size_t s KASSERT(earlyboot_map_idx < MAX_EARLYBOOT_MAPPINGS, ("%s: too many early boot mapping requests", __func__)); earlyboot_mappings[earlyboot_map_idx].addr = addr; + earlyboot_mappings[earlyboot_map_idx].virt = + pmap_early_io_map(addr, size); earlyboot_mappings[earlyboot_map_idx].size = size; earlyboot_mappings[earlyboot_map_idx].flags = flags; + *bshp = earlyboot_mappings[earlyboot_map_idx].virt; earlyboot_map_idx++; - *bshp = addr; } else { ma = VM_MEMATTR_DEFAULT; switch (flags) { @@ -110,13 +113,13 @@ void bs_remap_earlyboot(void) { int i; - vm_offset_t pa, spa; + vm_offset_t pa, spa, va; vm_memattr_t ma; for (i = 0; i < earlyboot_map_idx; i++) { spa = earlyboot_mappings[i].addr; - if (pmap_dev_direct_mapped(spa, earlyboot_mappings[i].size) - == 0) + if (spa == earlyboot_mappings[i].virt && + pmap_dev_direct_mapped(spa, earlyboot_mappings[i].size) == 0) continue; ma = VM_MEMATTR_DEFAULT; @@ -130,8 +133,10 @@ bs_remap_earlyboot(void) } pa = trunc_page(spa); + va = trunc_page(earlyboot_mappings[i].virt); while (pa < spa + earlyboot_mappings[i].size) { - pmap_kenter_attr(pa, pa, ma); + pmap_kenter_attr(va, pa, ma); + va += PAGE_SIZE; pa += PAGE_SIZE; } } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 00:54:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 21715C6E; Wed, 14 May 2014 00:54:48 +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 04CC622E3; Wed, 14 May 2014 00:54:47 +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 C4D0423587; Tue, 13 May 2014 17:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1400028881; bh=8lG9xizMxsVwhqrn56KAD48cva66tm1FshEU9VI1bDs=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=JhPtLeSyc/teA3ptAO0os6yygF2odu5ifjuVNV203WeCRnDgSKScr4FgPtrr25lcY lymMnVDmB+hisrZ96lRzKcQOUol/yWZCTPYHBC9cIHDy6zsx8tHhhkV51J1mwA9LlB 9ssTeVzfpsTSI5O+uyEToZb3pHl/X0HSvRtOc7us= Message-ID: <5372BED0.7010907@delphij.net> Date: Tue, 13 May 2014 17:54:40 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Andrey Chernov , Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r265986 - stable/10/crypto/openssl/ssl References: <201405132319.s4DNJH7T055013@svn.freebsd.org> <5372AC8E.1070507@freebsd.org> In-Reply-To: <5372AC8E.1070507@freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: "secteam@FreeBSD.org" X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 00:54:48 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 05/13/14 16:36, Andrey Chernov wrote: > On 14.05.2014 3:19, Xin LI wrote: >> Author: delphij Date: Tue May 13 23:19:16 2014 New Revision: >> 265986 URL: http://svnweb.freebsd.org/changeset/base/265986 >> >> Log: Fix OpenSSL NULL pointer deference vulnerability. >> >> Obtained from: OpenBSD Security: FreeBSD-SA-14:09.openssl >> Security: CVE-2014-0198 > > Official fix is a bit different: > https://github.com/openssl/openssl/commit/b107586c0c3447ea22dba8698ebbcd81bb29d48c > > from > https://rt.openssl.org/Ticket/Display.html?user=guest&pass=guest&id=3321 > > Do we follow official branch or OpenBSD fixes? Principally we follow the official branch whenever applicable, we didn't do it for this one because the advisory was prepared about two weeks ago. For -HEAD and -STABLE we should probably adopt the upstream version to ease future maintenance. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCgAGBQJTcr7QAAoJEJW2GBstM+nsZSkQAKxb/l+s7TEJadXf3a2pMR1/ DbNBW2WKTCS8QqGRyIqd2z9VPpsa5ECIVpaiekMLUxG85m+mBqV3sTQUXjFTwaU7 HQIGkiCbwnw8/u0+xoFByGzQW822qVvW/+OoylEw90JnDqtrWsoDfLND80H1/IUj LKPJu2lU4rI6EFQ2b6ps01XqaoWKK16MkyB47CiRcDlonqWJ5SvB9TsDsyFJjb5u gnq6RYuZfSFzt8NGL1/9wLXjR9QPtmd/ekp+NOkGRQHPoGjIQ7/Z/mKfEpm11UVs lHm3c89O0+JxNfVzZrlx70xMYrbZCI7oGPlIROjF8jel/RfpypVnDB4L162Nhslw oMlEtD88Kzlb0OWdBmyo811p9wqQ7l2xer774oQzWmfSjo1eZzuNcniYEBwGZ37y hif8tOLEnc4yXZmdKFb5qwpYftyBRfA76bKXEUGXz91b0zdK2M09SuPkgtUiks6Y 6Ame2UHpIwaMULzUA8r98o6C21YuirKM2mD3BGe1zZtWJQ6U2l6a0MCe4d9//6yq aciKsnLgZbaxa1aza3b1gO8fW3Da/9bQ06eeLhcM/F6wEx9dMSo+TAtrjWK95Q9L eNynRxAw3udWAqV+AdVB9U9SGckqe0lLDjMeJq2IV8GCwQb34oAfX5qklyRj2OaI LB21EyspUSw1/hjFrYYI =8DUK -----END PGP SIGNATURE----- From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 00:55:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E5E6AE89; Wed, 14 May 2014 00:55: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 B966722EC; Wed, 14 May 2014 00:55: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 s4E0tLts003513; Wed, 14 May 2014 00:55:21 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E0tL3u003512; Wed, 14 May 2014 00:55:21 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405140055.s4E0tL3u003512@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 00:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265997 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 00:55:22 -0000 Author: ian Date: Wed May 14 00:55:21 2014 New Revision: 265997 URL: http://svnweb.freebsd.org/changeset/base/265997 Log: Record mergeinfo that got run over by a bus. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 01:16:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 821A330C; Wed, 14 May 2014 01:16:07 +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 62C82246F; Wed, 14 May 2014 01:16:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4E1G7i3012773; Wed, 14 May 2014 01:16:07 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E1G6YI012767; Wed, 14 May 2014 01:16:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405140116.s4E1G6YI012767@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 01:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265998 - in stable/10/sys: boot/powerpc/ps3 dev/adb dev/uart powerpc/aim powerpc/booke powerpc/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 01:16:07 -0000 Author: ian Date: Wed May 14 01:16:05 2014 New Revision: 265998 URL: http://svnweb.freebsd.org/changeset/base/265998 Log: MFC r257180, r257195, r257196, r257198, r257209, r257295 Add some extra sanity checking and checks to printf format specifiers. Try even harder to find a console before giving up. Make devices with registers into the KVA region work reliably. Turn on VM_KMEM_SIZE_SCALE on 32-bit as well as 64-bit PowerPC. Return NOKEY instead of 0 if there are no more key presses queued. Modified: stable/10/sys/boot/powerpc/ps3/start.S stable/10/sys/dev/adb/adb_kbd.c stable/10/sys/dev/uart/uart_cpu_fdt.c stable/10/sys/powerpc/aim/mmu_oea64.c stable/10/sys/powerpc/booke/pmap.c stable/10/sys/powerpc/include/vmparam.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/powerpc/ps3/start.S ============================================================================== --- stable/10/sys/boot/powerpc/ps3/start.S Wed May 14 00:55:21 2014 (r265997) +++ stable/10/sys/boot/powerpc/ps3/start.S Wed May 14 01:16:05 2014 (r265998) @@ -27,7 +27,7 @@ #define LOCORE -#include +#include /* * KBoot and simulators will start this program from the _start symbol, with Modified: stable/10/sys/dev/adb/adb_kbd.c ============================================================================== --- stable/10/sys/dev/adb/adb_kbd.c Wed May 14 00:55:21 2014 (r265997) +++ stable/10/sys/dev/adb/adb_kbd.c Wed May 14 01:16:05 2014 (r265998) @@ -621,7 +621,7 @@ akbd_read_char(keyboard_t *kbd, int wait if (!sc->buffers) { mtx_unlock(&sc->sc_mutex); - return (0); + return (NOKEY); } adb_code = sc->buffer[0]; Modified: stable/10/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- stable/10/sys/dev/uart/uart_cpu_fdt.c Wed May 14 00:55:21 2014 (r265997) +++ stable/10/sys/dev/uart/uart_cpu_fdt.c Wed May 14 01:16:05 2014 (r265998) @@ -142,14 +142,19 @@ uart_cpu_getdev(int devtype, struct uart /* * Retrieve /chosen/std{in,out}. */ - if ((chosen = OF_finddevice("/chosen")) == -1) - return (ENXIO); - for (name = propnames; *name != NULL; name++) { - if (phandle_chosen_propdev(chosen, *name, &node) == 0) - break; + node = -1; + if ((chosen = OF_finddevice("/chosen")) != -1) { + for (name = propnames; *name != NULL; name++) { + if (phandle_chosen_propdev(chosen, *name, &node) == 0) + break; + } } - if (*name == NULL) + if (chosen == -1 || *name == NULL) + node = OF_finddevice("serial0"); /* Last ditch */ + + if (node == -1) /* Can't find anything */ return (ENXIO); + /* * Retrieve serial attributes. */ Modified: stable/10/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/10/sys/powerpc/aim/mmu_oea64.c Wed May 14 00:55:21 2014 (r265997) +++ stable/10/sys/powerpc/aim/mmu_oea64.c Wed May 14 01:16:05 2014 (r265998) @@ -501,15 +501,7 @@ moea64_add_ofw_mappings(mmu_t mmup, phan qsort(translations, sz, sizeof (*translations), om_cmp); for (i = 0; i < sz; i++) { - CTR3(KTR_PMAP, "translation: pa=%#x va=%#x len=%#x", - (uint32_t)(translations[i].om_pa_lo), translations[i].om_va, - translations[i].om_len); - - if (translations[i].om_pa_lo % PAGE_SIZE) - panic("OFW translation not page-aligned!"); - pa_base = translations[i].om_pa_lo; - #ifdef __powerpc64__ pa_base += (vm_offset_t)translations[i].om_pa_hi << 32; #else @@ -517,6 +509,14 @@ moea64_add_ofw_mappings(mmu_t mmup, phan panic("OFW translations above 32-bit boundary!"); #endif + if (pa_base % PAGE_SIZE) + panic("OFW translation not page-aligned (phys)!"); + if (translations[i].om_va % PAGE_SIZE) + panic("OFW translation not page-aligned (virt)!"); + + CTR3(KTR_PMAP, "translation: pa=%#zx va=%#x len=%#x", + pa_base, translations[i].om_va, translations[i].om_len); + /* Now enter the pages for this mapping */ DISABLE_TRANS(msr); @@ -693,9 +693,9 @@ moea64_early_bootstrap(mmu_t mmup, vm_of hwphyssz = 0; TUNABLE_ULONG_FETCH("hw.physmem", (u_long *) &hwphyssz); for (i = 0, j = 0; i < regions_sz; i++, j += 2) { - CTR3(KTR_PMAP, "region: %#x - %#x (%#x)", regions[i].mr_start, - regions[i].mr_start + regions[i].mr_size, - regions[i].mr_size); + CTR3(KTR_PMAP, "region: %#zx - %#zx (%#zx)", + regions[i].mr_start, regions[i].mr_start + + regions[i].mr_size, regions[i].mr_size); if (hwphyssz != 0 && (physsz + regions[i].mr_size) >= hwphyssz) { if (physsz < hwphyssz) { Modified: stable/10/sys/powerpc/booke/pmap.c ============================================================================== --- stable/10/sys/powerpc/booke/pmap.c Wed May 14 00:55:21 2014 (r265997) +++ stable/10/sys/powerpc/booke/pmap.c Wed May 14 01:16:05 2014 (r265998) @@ -189,6 +189,7 @@ static tlb_entry_t tlb1[TLB1_ENTRIES]; /* Next free entry in the TLB1 */ static unsigned int tlb1_idx; +static vm_offset_t tlb1_map_base = VM_MAX_KERNEL_ADDRESS; static tlbtid_t tid_alloc(struct pmap *); @@ -2681,11 +2682,23 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd size = roundup(size, PAGE_SIZE); + /* + * We leave a hole for device direct mapping between the maximum user + * address (0x8000000) and the minimum KVA address (0xc0000000). If + * devices are in there, just map them 1:1. If not, map them to the + * device mapping area about VM_MAX_KERNEL_ADDRESS. These mapped + * addresses should be pulled from an allocator, but since we do not + * ever free TLB1 entries, it is safe just to increment a counter. + * Note that there isn't a lot of address space here (128 MB) and it + * is not at all difficult to imagine running out, since that is a 4:1 + * compression from the 0xc0000000 - 0xf0000000 address space that gets + * mapped there. + */ if (pa >= (VM_MAXUSER_ADDRESS + PAGE_SIZE) && (pa + size - 1) < VM_MIN_KERNEL_ADDRESS) va = pa; else - va = kva_alloc(size); + va = atomic_fetchadd_int(&tlb1_map_base, size); res = (void *)va; do { @@ -3085,7 +3098,7 @@ tlb1_mapin_region(vm_offset_t va, vm_pad } mapped = (va - base); - debugf("mapped size 0x%08x (wasted space 0x%08x)\n", + printf("mapped size 0x%08x (wasted space 0x%08x)\n", mapped, mapped - size); return (mapped); } @@ -3148,7 +3161,6 @@ tlb1_init() vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t size) { - static vm_offset_t early_io_map_base = VM_MAX_KERNEL_ADDRESS; vm_paddr_t pa_base; vm_offset_t va, sz; int i; @@ -3165,14 +3177,14 @@ pmap_early_io_map(vm_paddr_t pa, vm_size pa_base = trunc_page(pa); size = roundup(size + (pa - pa_base), PAGE_SIZE); - va = early_io_map_base + (pa - pa_base); + va = tlb1_map_base + (pa - pa_base); do { sz = 1 << (ilog2(size) & ~1); - tlb1_set_entry(early_io_map_base, pa_base, sz, _TLB_ENTRY_IO); + tlb1_set_entry(tlb1_map_base, pa_base, sz, _TLB_ENTRY_IO); size -= sz; pa_base += sz; - early_io_map_base += sz; + tlb1_map_base += sz; } while (size > 0); #ifdef SMP Modified: stable/10/sys/powerpc/include/vmparam.h ============================================================================== --- stable/10/sys/powerpc/include/vmparam.h Wed May 14 00:55:21 2014 (r265997) +++ stable/10/sys/powerpc/include/vmparam.h Wed May 14 01:16:05 2014 (r265998) @@ -112,6 +112,7 @@ #define VM_MIN_KERNEL_ADDRESS KERNBASE #define VM_MAX_KERNEL_ADDRESS 0xf8000000 +#define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif /* AIM/E500 */ @@ -175,14 +176,21 @@ struct pmap_physseg { #define VM_KMEM_SIZE (12 * 1024 * 1024) #endif -#ifdef __powerpc64__ +/* + * How many physical pages per KVA page allocated. + * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX) + * is the total KVA space allocated for kmem_map. + */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (3) +#define VM_KMEM_SIZE_SCALE (3) #endif +/* + * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA space. + */ #ifndef VM_KMEM_SIZE_MAX -#define VM_KMEM_SIZE_MAX 0x1c0000000 /* 7 GB */ -#endif +#define VM_KMEM_SIZE_MAX ((VM_MAX_SAFE_KERNEL_ADDRESS - \ + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) #endif #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 01:35:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 04985C44; Wed, 14 May 2014 01:35: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 E23C2263B; Wed, 14 May 2014 01:35: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 s4E1ZrXT021353; Wed, 14 May 2014 01:35:53 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E1ZiFF021291; Wed, 14 May 2014 01:35:44 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405140135.s4E1ZiFF021291@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 01:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265999 - in stable/10/sys: arm/at91 arm/econa arm/s3c2xx0 arm/sa11x0 arm/xscale/i80321 arm/xscale/pxa dev/acpica dev/altera/atse dev/altera/avgen dev/altera/jtag_uart dev/altera/sdcard... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 01:35:54 -0000 Author: ian Date: Wed May 14 01:35:43 2014 New Revision: 265999 URL: http://svnweb.freebsd.org/changeset/base/265999 Log: MFC r257334, r257336, r257337, r257338, r257341, r257342, r257343, r257370, r257368, r257416 Hints-only devices should return BUS_PROBE_NOWILDCARD from their probe methods. Modified: stable/10/sys/arm/at91/at91.c stable/10/sys/arm/econa/econa.c stable/10/sys/arm/s3c2xx0/s3c24x0.c stable/10/sys/arm/sa11x0/sa11x0.c stable/10/sys/arm/xscale/i80321/iq80321.c stable/10/sys/arm/xscale/pxa/pxa_obio.c stable/10/sys/dev/acpica/acpi.c stable/10/sys/dev/altera/atse/if_atse_nexus.c stable/10/sys/dev/altera/avgen/altera_avgen_nexus.c stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c stable/10/sys/dev/altera/sdcard/altera_sdcard_nexus.c stable/10/sys/dev/cfe/cfe_resource.c stable/10/sys/dev/gxemul/disk/gxemul_disk.c stable/10/sys/dev/gxemul/ether/if_gx.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c stable/10/sys/dev/rt/if_rt.c stable/10/sys/dev/terasic/de4led/terasic_de4led_nexus.c stable/10/sys/dev/terasic/mtl/terasic_mtl_nexus.c stable/10/sys/dev/xen/console/console.c stable/10/sys/dev/xen/pcifront/pcifront.c stable/10/sys/dev/xen/timer/timer.c stable/10/sys/mips/adm5120/obio.c stable/10/sys/mips/alchemy/obio.c stable/10/sys/mips/atheros/apb.c stable/10/sys/mips/atheros/ar71xx_ehci.c stable/10/sys/mips/atheros/ar71xx_pci.c stable/10/sys/mips/atheros/ar71xx_spi.c stable/10/sys/mips/atheros/ar71xx_wdog.c stable/10/sys/mips/atheros/ar724x_pci.c stable/10/sys/mips/atheros/if_arge.c stable/10/sys/mips/cavium/ciu.c stable/10/sys/mips/cavium/octeon_ebt3000_cf.c stable/10/sys/mips/cavium/octeon_pmc.c stable/10/sys/mips/cavium/octeon_rnd.c stable/10/sys/mips/cavium/octeon_rtc.c stable/10/sys/mips/idt/obio.c stable/10/sys/mips/malta/gt.c stable/10/sys/mips/mips/tick.c stable/10/sys/mips/nlm/tick.c stable/10/sys/mips/nlm/xlp_pci.c stable/10/sys/mips/rmi/iodi.c stable/10/sys/mips/rmi/tick.c stable/10/sys/mips/rt305x/obio.c stable/10/sys/mips/sibyte/sb_zbbus.c stable/10/sys/modules/Makefile stable/10/sys/powerpc/pseries/plpar_iommu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/at91.c ============================================================================== --- stable/10/sys/arm/at91/at91.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/arm/at91/at91.c Wed May 14 01:35:43 2014 (r265999) @@ -232,8 +232,7 @@ at91_probe(device_t dev) { device_set_desc(dev, "AT91 device bus"); - arm_post_filter = at91_eoi; - return (0); + return (BUS_PROBE_NOWILDCARD); } static void @@ -262,6 +261,8 @@ at91_attach(device_t dev) const struct arm_devmap_entry *pdevmap; int i; + arm_post_filter = at91_eoi; + at91_softc = sc; sc->sc_st = &at91_bs_tag; sc->sc_sh = AT91_BASE; Modified: stable/10/sys/arm/econa/econa.c ============================================================================== --- stable/10/sys/arm/econa/econa.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/arm/econa/econa.c Wed May 14 01:35:43 2014 (r265999) @@ -172,7 +172,7 @@ econa_probe(device_t dev) { device_set_desc(dev, "ECONA device bus"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: stable/10/sys/arm/s3c2xx0/s3c24x0.c ============================================================================== --- stable/10/sys/arm/s3c2xx0/s3c24x0.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/arm/s3c2xx0/s3c24x0.c Wed May 14 01:35:43 2014 (r265999) @@ -429,7 +429,7 @@ s3c24x0_identify(driver_t *driver, devic int s3c24x0_probe(device_t dev) { - return 0; + return (BUS_PROBE_NOWILDCARD); } int Modified: stable/10/sys/arm/sa11x0/sa11x0.c ============================================================================== --- stable/10/sys/arm/sa11x0/sa11x0.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/arm/sa11x0/sa11x0.c Wed May 14 01:35:43 2014 (r265999) @@ -139,7 +139,7 @@ extern vm_offset_t saipic_base; int sa11x0_probe(device_t dev) { - return 0; + return (BUS_PROBE_NOWILDCARD); } void Modified: stable/10/sys/arm/xscale/i80321/iq80321.c ============================================================================== --- stable/10/sys/arm/xscale/i80321/iq80321.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/arm/xscale/i80321/iq80321.c Wed May 14 01:35:43 2014 (r265999) @@ -72,7 +72,7 @@ int iq80321_probe(device_t dev) { device_set_desc(dev, "Intel 80321"); - return (0); + return (BUS_PROBE_NOWILDCARD); } void Modified: stable/10/sys/arm/xscale/pxa/pxa_obio.c ============================================================================== --- stable/10/sys/arm/xscale/pxa/pxa_obio.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/arm/xscale/pxa/pxa_obio.c Wed May 14 01:35:43 2014 (r265999) @@ -92,7 +92,7 @@ pxa_probe(device_t dev) { device_set_desc(dev, "XScale PXA On-board IO"); - return (0); + return (BUS_PROBE_NOWILDCARD); } int Modified: stable/10/sys/dev/acpica/acpi.c ============================================================================== --- stable/10/sys/dev/acpica/acpi.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/acpica/acpi.c Wed May 14 01:35:43 2014 (r265999) @@ -431,7 +431,7 @@ acpi_probe(device_t dev) device_set_desc(dev, acpi_desc); - return_VALUE (0); + return_VALUE (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/dev/altera/atse/if_atse_nexus.c ============================================================================== --- stable/10/sys/dev/altera/atse/if_atse_nexus.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/altera/atse/if_atse_nexus.c Wed May 14 01:35:43 2014 (r265999) @@ -129,7 +129,7 @@ atse_probe_nexus(device_t dev) /* Success. */ device_set_desc(dev, "Altera Triple-Speed Ethernet MegaCore"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/dev/altera/avgen/altera_avgen_nexus.c ============================================================================== --- stable/10/sys/dev/altera/avgen/altera_avgen_nexus.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/altera/avgen/altera_avgen_nexus.c Wed May 14 01:35:43 2014 (r265999) @@ -58,7 +58,7 @@ altera_avgen_nexus_probe(device_t dev) { device_set_desc(dev, "Generic Altera Avalon device attachment"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c ============================================================================== --- stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c Wed May 14 01:35:43 2014 (r265999) @@ -62,7 +62,7 @@ altera_jtag_uart_nexus_probe(device_t de { device_set_desc(dev, "Altera JTAG UART"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/dev/altera/sdcard/altera_sdcard_nexus.c ============================================================================== --- stable/10/sys/dev/altera/sdcard/altera_sdcard_nexus.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/altera/sdcard/altera_sdcard_nexus.c Wed May 14 01:35:43 2014 (r265999) @@ -62,7 +62,7 @@ altera_sdcard_nexus_probe(device_t dev) { device_set_desc(dev, "Altera Secure Data Card IP Core"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/dev/cfe/cfe_resource.c ============================================================================== --- stable/10/sys/dev/cfe/cfe_resource.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/cfe/cfe_resource.c Wed May 14 01:35:43 2014 (r265999) @@ -61,7 +61,7 @@ static int cferes_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/dev/gxemul/disk/gxemul_disk.c ============================================================================== --- stable/10/sys/dev/gxemul/disk/gxemul_disk.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/gxemul/disk/gxemul_disk.c Wed May 14 01:35:43 2014 (r265999) @@ -158,7 +158,7 @@ gxemul_disk_probe(device_t dev) { device_set_desc(dev, "GXemul test disk"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: stable/10/sys/dev/gxemul/ether/if_gx.c ============================================================================== --- stable/10/sys/dev/gxemul/ether/if_gx.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/gxemul/ether/if_gx.c Wed May 14 01:35:43 2014 (r265999) @@ -125,7 +125,7 @@ gx_probe(device_t dev) device_set_desc(dev, "GXemul test Ethernet"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed May 14 01:35:43 2014 (r265999) @@ -313,7 +313,7 @@ vmbus_probe(device_t dev) { device_set_desc(dev, "Vmbus Devices"); - return (0); + return (BUS_PROBE_NOWILDCARD); } /** Modified: stable/10/sys/dev/rt/if_rt.c ============================================================================== --- stable/10/sys/dev/rt/if_rt.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/rt/if_rt.c Wed May 14 01:35:43 2014 (r265999) @@ -148,7 +148,7 @@ static int rt_probe(device_t dev) { device_set_desc(dev, "Ralink RT305XF onChip Ethernet MAC"); - return (0); + return (BUS_PROBE_NOWILDCARD); } /* Modified: stable/10/sys/dev/terasic/de4led/terasic_de4led_nexus.c ============================================================================== --- stable/10/sys/dev/terasic/de4led/terasic_de4led_nexus.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/terasic/de4led/terasic_de4led_nexus.c Wed May 14 01:35:43 2014 (r265999) @@ -58,7 +58,7 @@ terasic_de4led_nexus_probe(device_t dev) { device_set_desc(dev, "Terasic DE4 8-element LED"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/dev/terasic/mtl/terasic_mtl_nexus.c ============================================================================== --- stable/10/sys/dev/terasic/mtl/terasic_mtl_nexus.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/terasic/mtl/terasic_mtl_nexus.c Wed May 14 01:35:43 2014 (r265999) @@ -55,7 +55,7 @@ terasic_mtl_nexus_probe(device_t dev) { device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/dev/xen/console/console.c ============================================================================== --- stable/10/sys/dev/xen/console/console.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/xen/console/console.c Wed May 14 01:35:43 2014 (r265999) @@ -226,7 +226,7 @@ static int xc_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/dev/xen/pcifront/pcifront.c ============================================================================== --- stable/10/sys/dev/xen/pcifront/pcifront.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/xen/pcifront/pcifront.c Wed May 14 01:35:43 2014 (r265999) @@ -441,7 +441,7 @@ xpcife_probe(device_t dev) struct pcifront_device *pdev = (struct pcifront_device *)device_get_ivars(dev); DPRINTF("xpcife probe (unit=%d)\n", pdev->unit); #endif - return 0; + return (BUS_PROBE_NOWILDCARD); } /* Newbus xpcife device driver attach */ Modified: stable/10/sys/dev/xen/timer/timer.c ============================================================================== --- stable/10/sys/dev/xen/timer/timer.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/dev/xen/timer/timer.c Wed May 14 01:35:43 2014 (r265999) @@ -142,7 +142,7 @@ xentimer_probe(device_t dev) "VCPUOPs interface unavailable\n"); #undef XTREQUIRES device_set_desc(dev, "Xen PV Clock"); - return (0); + return (BUS_PROBE_NOWILDCARD); } /* Modified: stable/10/sys/mips/adm5120/obio.c ============================================================================== --- stable/10/sys/mips/adm5120/obio.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/adm5120/obio.c Wed May 14 01:35:43 2014 (r265999) @@ -157,7 +157,7 @@ static int obio_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/alchemy/obio.c ============================================================================== --- stable/10/sys/mips/alchemy/obio.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/alchemy/obio.c Wed May 14 01:35:43 2014 (r265999) @@ -158,7 +158,7 @@ static int obio_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/atheros/apb.c ============================================================================== --- stable/10/sys/mips/atheros/apb.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/atheros/apb.c Wed May 14 01:35:43 2014 (r265999) @@ -103,7 +103,7 @@ static int apb_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/atheros/ar71xx_ehci.c ============================================================================== --- stable/10/sys/mips/atheros/ar71xx_ehci.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/atheros/ar71xx_ehci.c Wed May 14 01:35:43 2014 (r265999) @@ -75,7 +75,7 @@ ar71xx_ehci_probe(device_t self) device_set_desc(self, EHCI_HC_DEVSTR); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- stable/10/sys/mips/atheros/ar71xx_pci.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/atheros/ar71xx_pci.c Wed May 14 01:35:43 2014 (r265999) @@ -371,7 +371,7 @@ static int ar71xx_pci_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/atheros/ar71xx_spi.c ============================================================================== --- stable/10/sys/mips/atheros/ar71xx_spi.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/atheros/ar71xx_spi.c Wed May 14 01:35:43 2014 (r265999) @@ -84,7 +84,7 @@ static int ar71xx_spi_probe(device_t dev) { device_set_desc(dev, "AR71XX SPI"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/atheros/ar71xx_wdog.c ============================================================================== --- stable/10/sys/mips/atheros/ar71xx_wdog.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/atheros/ar71xx_wdog.c Wed May 14 01:35:43 2014 (r265999) @@ -92,7 +92,7 @@ ar71xx_wdog_probe(device_t dev) { device_set_desc(dev, "Atheros AR71XX watchdog timer"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: stable/10/sys/mips/atheros/ar724x_pci.c ============================================================================== --- stable/10/sys/mips/atheros/ar724x_pci.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/atheros/ar724x_pci.c Wed May 14 01:35:43 2014 (r265999) @@ -349,7 +349,7 @@ static int ar724x_pci_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/atheros/if_arge.c ============================================================================== --- stable/10/sys/mips/atheros/if_arge.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/atheros/if_arge.c Wed May 14 01:35:43 2014 (r265999) @@ -260,7 +260,7 @@ arge_probe(device_t dev) { device_set_desc(dev, "Atheros AR71xx built-in ethernet interface"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: stable/10/sys/mips/cavium/ciu.c ============================================================================== --- stable/10/sys/mips/cavium/ciu.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/cavium/ciu.c Wed May 14 01:35:43 2014 (r265999) @@ -109,7 +109,7 @@ ciu_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Cavium Octeon Central Interrupt Unit"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- stable/10/sys/mips/cavium/octeon_ebt3000_cf.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/cavium/octeon_ebt3000_cf.c Wed May 14 01:35:43 2014 (r265999) @@ -599,7 +599,7 @@ static int cf_probe (device_t dev) device_set_desc(dev, "Octeon Compact Flash Driver"); - return (0); + return (BUS_PROBE_NOWILDCARD); } /* ------------------------------------------------------------------- * Modified: stable/10/sys/mips/cavium/octeon_pmc.c ============================================================================== --- stable/10/sys/mips/cavium/octeon_pmc.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/cavium/octeon_pmc.c Wed May 14 01:35:43 2014 (r265999) @@ -71,7 +71,7 @@ octeon_pmc_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Cavium Octeon Performance Counters"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/cavium/octeon_rnd.c ============================================================================== --- stable/10/sys/mips/cavium/octeon_rnd.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/cavium/octeon_rnd.c Wed May 14 01:35:43 2014 (r265999) @@ -86,7 +86,7 @@ octeon_rnd_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Cavium Octeon Random Number Generator"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/cavium/octeon_rtc.c ============================================================================== --- stable/10/sys/mips/cavium/octeon_rtc.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/cavium/octeon_rtc.c Wed May 14 01:35:43 2014 (r265999) @@ -81,7 +81,7 @@ octeon_rtc_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Cavium Octeon Realtime Clock"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/idt/obio.c ============================================================================== --- stable/10/sys/mips/idt/obio.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/idt/obio.c Wed May 14 01:35:43 2014 (r265999) @@ -108,7 +108,7 @@ static int obio_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/malta/gt.c ============================================================================== --- stable/10/sys/mips/malta/gt.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/malta/gt.c Wed May 14 01:35:43 2014 (r265999) @@ -51,7 +51,7 @@ static int gt_probe(device_t dev) { device_set_desc(dev, "GT64120 chip"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: stable/10/sys/mips/mips/tick.c ============================================================================== --- stable/10/sys/mips/mips/tick.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/mips/tick.c Wed May 14 01:35:43 2014 (r265999) @@ -313,7 +313,7 @@ clock_probe(device_t dev) panic("can't attach more clocks"); device_set_desc(dev, "Generic MIPS32 ticker"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: stable/10/sys/mips/nlm/tick.c ============================================================================== --- stable/10/sys/mips/nlm/tick.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/nlm/tick.c Wed May 14 01:35:43 2014 (r265999) @@ -318,7 +318,7 @@ clock_probe(device_t dev) panic("can't attach more clocks"); device_set_desc(dev, "Generic MIPS32 ticker"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: stable/10/sys/mips/nlm/xlp_pci.c ============================================================================== --- stable/10/sys/mips/nlm/xlp_pci.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/nlm/xlp_pci.c Wed May 14 01:35:43 2014 (r265999) @@ -383,8 +383,7 @@ xlp_pcib_probe(device_t dev) { device_set_desc(dev, "XLP PCI bus"); - xlp_pcib_init_resources(); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int @@ -524,6 +523,8 @@ xlp_pcib_attach(device_t dev) { int node, link; + xlp_pcib_init_resources(); + /* enable hardware swap on all nodes/links */ for (node = 0; node < XLP_MAX_NODES; node++) for (link = 0; link < 4; link++) Modified: stable/10/sys/mips/rmi/iodi.c ============================================================================== --- stable/10/sys/mips/rmi/iodi.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/rmi/iodi.c Wed May 14 01:35:43 2014 (r265999) @@ -190,7 +190,7 @@ static void iodi_identify(driver_t *, de int iodi_probe(device_t dev) { - return 0; + return (BUS_PROBE_NOWILDCARD); } void Modified: stable/10/sys/mips/rmi/tick.c ============================================================================== --- stable/10/sys/mips/rmi/tick.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/rmi/tick.c Wed May 14 01:35:43 2014 (r265999) @@ -315,7 +315,7 @@ clock_probe(device_t dev) panic("can't attach more clocks"); device_set_desc(dev, "Generic MIPS32 ticker"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: stable/10/sys/mips/rt305x/obio.c ============================================================================== --- stable/10/sys/mips/rt305x/obio.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/rt305x/obio.c Wed May 14 01:35:43 2014 (r265999) @@ -148,7 +148,7 @@ static int obio_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/mips/sibyte/sb_zbbus.c ============================================================================== --- stable/10/sys/mips/sibyte/sb_zbbus.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/mips/sibyte/sb_zbbus.c Wed May 14 01:35:43 2014 (r265999) @@ -207,7 +207,7 @@ zbbus_probe(device_t dev) { device_set_desc(dev, "Broadcom/Sibyte ZBbus"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/modules/Makefile Wed May 14 01:35:43 2014 (r265999) @@ -2,6 +2,8 @@ .include +SUBDIR_PARALLEL= + # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). Modified: stable/10/sys/powerpc/pseries/plpar_iommu.c ============================================================================== --- stable/10/sys/powerpc/pseries/plpar_iommu.c Wed May 14 01:16:05 2014 (r265998) +++ stable/10/sys/powerpc/pseries/plpar_iommu.c Wed May 14 01:35:43 2014 (r265999) @@ -69,7 +69,7 @@ struct dma_window { }; int -phyp_iommu_set_dma_tag(device_t dev, device_t child, bus_dma_tag_t tag) +phyp_iommu_set_dma_tag(device_t bus, device_t dev, bus_dma_tag_t tag) { device_t p; phandle_t node; @@ -77,7 +77,7 @@ phyp_iommu_set_dma_tag(device_t dev, dev struct iommu_map *i; int cell; - for (p = child; p != NULL; p = device_get_parent(p)) { + for (p = dev; device_get_parent(p) != NULL; p = device_get_parent(p)) { if (ofw_bus_has_prop(p, "ibm,my-dma-window")) break; if (ofw_bus_has_prop(p, "ibm,dma-window")) @@ -150,7 +150,7 @@ phyp_iommu_set_dma_tag(device_t dev, dev papr_supports_stuff_tce = !(phyp_hcall(H_STUFF_TCE, window->map->iobn, 0, 0, 0) == H_FUNCTION); - bus_dma_tag_set_iommu(tag, dev, window); + bus_dma_tag_set_iommu(tag, bus, window); return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 01:53:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4A276151; Wed, 14 May 2014 01:53: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 343BA2798; Wed, 14 May 2014 01:53: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 s4E1rO05029580; Wed, 14 May 2014 01:53:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E1rLEI029563; Wed, 14 May 2014 01:53:21 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405140153.s4E1rLEI029563@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 01:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266000 - in stable/10/sys: arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv conf dev/fdt dev/mii dev/ofw mips/mips powerpc/booke powerpc/mpc85xx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 01:53:24 -0000 Author: ian Date: Wed May 14 01:53:20 2014 New Revision: 266000 URL: http://svnweb.freebsd.org/changeset/base/266000 Log: MFC r257702, r257745, r257746, r257747, r257751, r257791, r257793, r257794, r257795, r257992 Teach nexus(4) about Open Firmware (e.g. FDT) on ARM and MIPS, retiring fdtbus in most cases. Make OF_nextprop() work correctly for FDT by using the libfdt fdt_next_property_offset() API. Do not panic if pmap_mincore() is called. An addendum: it is possible, though of questionable utility, for a node to have no properties at all. Add definition for the Atheros 8021 gigabit PHY. Consolidate Apple firmware hacks and improve them by switching on the presence of mac-io devices in the tree, which uniquely identifies Apple hardware. Allow OF_decode_addr() to also be able to map resources on big-endian devices. Make tsec work with the device tree present on the RB800. Be more flexible about which compatible strings to accept. This brings up the PCI Express bus on the RB800 using the firmware device tree. Rename the "bare" platform "mpc85xx", which is what it actually is, and add actual platform probing based on PVR. Modified: stable/10/sys/arm/arm/nexus.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c stable/10/sys/arm/freescale/imx/tzic.c stable/10/sys/arm/mv/mv_localbus.c stable/10/sys/arm/mv/mv_pci.c stable/10/sys/conf/files stable/10/sys/dev/fdt/simplebus.c stable/10/sys/dev/mii/atphy.c stable/10/sys/dev/mii/miidevs stable/10/sys/dev/ofw/ofw_fdt.c stable/10/sys/mips/mips/nexus.c stable/10/sys/powerpc/booke/pmap.c stable/10/sys/powerpc/mpc85xx/lbc.c stable/10/sys/powerpc/mpc85xx/pci_mpc85xx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/nexus.c ============================================================================== --- stable/10/sys/arm/arm/nexus.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/arm/arm/nexus.c Wed May 14 01:53:20 2014 (r266000) @@ -60,6 +60,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_platform.h" + +#ifdef FDT +#include +#include +#else static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { @@ -76,13 +82,18 @@ static int nexus_print_child(device_t, d static device_t nexus_add_child(device_t, u_int, const char *, int); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); +#endif static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_deactivate_resource(device_t, device_t, int, int, + struct resource *); + static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); static device_method_t nexus_methods[] = { +#ifndef FDT /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), @@ -90,19 +101,28 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), +#endif DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), { 0, 0 } }; +static devclass_t nexus_devclass; +#ifndef FDT static driver_t nexus_driver = { "nexus", nexus_methods, 1 /* no softc */ }; -static devclass_t nexus_devclass; +#else +DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods, + sizeof(struct ofw_nexus_softc), ofw_nexus_driver); +#endif +DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +#ifndef FDT static int nexus_probe(device_t dev) { @@ -113,30 +133,6 @@ nexus_probe(device_t dev) } static int -nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) -{ - int irq; - - if ((rman_get_flags(res) & RF_SHAREABLE) == 0) - flags |= INTR_EXCL; - - for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) { - arm_setup_irqhandler(device_get_nameunit(child), - filt, intr, arg, irq, flags, cookiep); - arm_unmask_irq(irq); - } - return (0); -} - -static int -nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) -{ - - return (arm_remove_irqhandler(rman_get_start(r), ih)); -} - -static int nexus_attach(device_t dev) { @@ -156,7 +152,6 @@ nexus_attach(device_t dev) return (0); } - static int nexus_print_child(device_t bus, device_t child) { @@ -193,7 +188,6 @@ nexus_add_child(device_t bus, u_int orde * child of one of our descendants, not a direct child of nexus0. * (Exceptions include footbridge.) */ -#define ARM_BUS_SPACE_MEM 1 static struct resource * nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -204,6 +198,7 @@ nexus_alloc_resource(device_t bus, devic switch (type) { case SYS_RES_MEMORY: + case SYS_RES_IOPORT: rm = &mem_rman; break; @@ -216,7 +211,6 @@ nexus_alloc_resource(device_t bus, devic return (0); rman_set_rid(rv, *rid); - rman_set_bustag(rv, (void*)ARM_BUS_SPACE_MEM); rman_set_bushandle(rv, rman_get_start(rv)); if (needactivate) { @@ -228,6 +222,31 @@ nexus_alloc_resource(device_t bus, devic return (rv); } +#endif + +static int +nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, + driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) +{ + int irq; + + if ((rman_get_flags(res) & RF_SHAREABLE) == 0) + flags |= INTR_EXCL; + + for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) { + arm_setup_irqhandler(device_get_nameunit(child), + filt, intr, arg, irq, flags, cookiep); + arm_unmask_irq(irq); + } + return (0); +} + +static int +nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) +{ + + return (arm_remove_irqhandler(rman_get_start(r), ih)); +} static int @@ -237,7 +256,7 @@ nexus_activate_resource(device_t bus, de /* * If this is a memory resource, map it into the kernel. */ - if (rman_get_bustag(r) == (void*)ARM_BUS_SPACE_MEM) { + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { caddr_t vaddr = 0; u_int32_t paddr; u_int32_t psize; @@ -248,9 +267,21 @@ nexus_activate_resource(device_t bus, de poffs = paddr - trunc_page(paddr); vaddr = (caddr_t) pmap_mapdev(paddr-poffs, psize+poffs) + poffs; rman_set_virtual(r, vaddr); +#ifdef FDT + rman_set_bustag(r, fdtbus_bs_tag); +#else + rman_set_bustag(r, (void *)1); +#endif rman_set_bushandle(r, (bus_space_handle_t) vaddr); } return (rman_activate_resource(r)); } -DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +static int +nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + + return (rman_deactivate_resource(res)); +} + Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c Wed May 14 01:53:20 2014 (r266000) @@ -361,7 +361,7 @@ static driver_t bcm_fb_driver = { sizeof(struct bcmsc_softc), }; -DRIVER_MODULE(bcm2835fb, fdtbus, bcm_fb_driver, bcm_fb_devclass, 0, 0); +DRIVER_MODULE(bcm2835fb, nexus, bcm_fb_driver, bcm_fb_devclass, 0, 0); /* * Video driver routines and glue. Modified: stable/10/sys/arm/freescale/imx/tzic.c ============================================================================== --- stable/10/sys/arm/freescale/imx/tzic.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/arm/freescale/imx/tzic.c Wed May 14 01:53:20 2014 (r266000) @@ -142,9 +142,9 @@ static devclass_t tzic_devclass; /* * Memory space of controller located outside of device range, so let him to - * attach not only to simplebus, but fdtbus also. + * attach not only to simplebus, but nexus also. */ -EARLY_DRIVER_MODULE(tzic, fdtbus, tzic_driver, tzic_devclass, 0, 0, +EARLY_DRIVER_MODULE(tzic, nexus, tzic_driver, tzic_devclass, 0, 0, BUS_PASS_INTERRUPT); EARLY_DRIVER_MODULE(tzic, simplebus, tzic_driver, tzic_devclass, 0, 0, BUS_PASS_INTERRUPT); Modified: stable/10/sys/arm/mv/mv_localbus.c ============================================================================== --- stable/10/sys/arm/mv/mv_localbus.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/arm/mv/mv_localbus.c Wed May 14 01:53:20 2014 (r266000) @@ -156,7 +156,7 @@ static struct localbus_bank localbus_ban devclass_t localbus_devclass; -DRIVER_MODULE(localbus, fdtbus, localbus_driver, localbus_devclass, 0, 0); +DRIVER_MODULE(localbus, nexus, localbus_driver, localbus_devclass, 0, 0); static int fdt_localbus_reg_decode(phandle_t node, struct localbus_softc *sc, Modified: stable/10/sys/arm/mv/mv_pci.c ============================================================================== --- stable/10/sys/arm/mv/mv_pci.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/arm/mv/mv_pci.c Wed May 14 01:53:20 2014 (r266000) @@ -230,7 +230,7 @@ static driver_t mv_pcib_driver = { devclass_t pcib_devclass; -DRIVER_MODULE(pcib, fdtbus, mv_pcib_driver, pcib_devclass, 0, 0); +DRIVER_MODULE(pcib, nexus, mv_pcib_driver, pcib_devclass, 0, 0); static struct mtx pcicfg_mtx; Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/conf/files Wed May 14 01:53:20 2014 (r266000) @@ -1409,7 +1409,7 @@ dev/fdt/fdt_pci.c optional fdt pci dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "$S/boot/fdt/dts/${FDT_DTS_FILE}" -dev/fdt/fdtbus.c optional fdt +dev/fdt/fdtbus.c optional fdtbus dev/fdt/simplebus.c optional fdt dev/fe/if_fe.c optional fe dev/fe/if_fe_pccard.c optional fe pccard Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/dev/fdt/simplebus.c Wed May 14 01:53:20 2014 (r266000) @@ -138,7 +138,7 @@ static driver_t simplebus_driver = { devclass_t simplebus_devclass; -DRIVER_MODULE(simplebus, fdtbus, simplebus_driver, simplebus_devclass, 0, 0); +DRIVER_MODULE(simplebus, nexus, simplebus_driver, simplebus_devclass, 0, 0); DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0, 0); Modified: stable/10/sys/dev/mii/atphy.c ============================================================================== --- stable/10/sys/dev/mii/atphy.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/dev/mii/atphy.c Wed May 14 01:53:20 2014 (r266000) @@ -80,6 +80,7 @@ static int atphy_setmedia(struct mii_sof static const struct mii_phydesc atphys[] = { MII_PHY_DESC(xxATHEROS, F1), MII_PHY_DESC(xxATHEROS, F1_7), + MII_PHY_DESC(xxATHEROS, AR8021), MII_PHY_DESC(xxATHEROS, F2), MII_PHY_END }; Modified: stable/10/sys/dev/mii/miidevs ============================================================================== --- stable/10/sys/dev/mii/miidevs Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/dev/mii/miidevs Wed May 14 01:53:20 2014 (r266000) @@ -136,6 +136,7 @@ model yyAMD 79c901home 0x0039 Am79C901 /* Atheros Communications/Attansic PHYs */ model xxATHEROS F1 0x0001 Atheros F1 10/100/1000 PHY model xxATHEROS F2 0x0002 Atheros F2 10/100 PHY +model xxATHEROS AR8021 0x0004 Atheros AR8021 10/100/1000 PHY model xxATHEROS F1_7 0x0007 Atheros F1 10/100/1000 PHY /* Asix semiconductor PHYs */ Modified: stable/10/sys/dev/ofw/ofw_fdt.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_fdt.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/dev/ofw/ofw_fdt.c Wed May 14 01:53:20 2014 (r266000) @@ -137,26 +137,6 @@ fdt_phandle_offset(phandle_t p) return (pint - dtoff); } -static int -fdt_pointer_offset(const void *ptr) -{ - uintptr_t dt_struct, p; - int offset; - - p = (uintptr_t)ptr; - dt_struct = (uintptr_t)fdtp + fdt_off_dt_struct(fdtp); - - if ((p < dt_struct) || - p > (dt_struct + fdt_size_dt_struct(fdtp))) - return (-1); - - offset = p - dt_struct; - if (offset < 0) - return (-1); - - return (offset); -} - /* Return the next sibling of this node or 0. */ static phandle_t ofw_fdt_peer(ofw_t ofw, phandle_t node) @@ -285,41 +265,6 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac return (len); } -static int -fdt_nextprop(int offset, char *buf, size_t size) -{ - const struct fdt_property *prop; - const char *name; - uint32_t tag; - int nextoffset, depth; - - depth = 0; - tag = fdt_next_tag(fdtp, offset, &nextoffset); - - /* Find the next prop */ - do { - offset = nextoffset; - tag = fdt_next_tag(fdtp, offset, &nextoffset); - - if (tag == FDT_BEGIN_NODE) - depth++; - else if (tag == FDT_END_NODE) - depth--; - else if ((tag == FDT_PROP) && (depth == 0)) { - prop = - (const struct fdt_property *)fdt_offset_ptr(fdtp, - offset, sizeof(*prop)); - name = fdt_string(fdtp, - fdt32_to_cpu(prop->nameoff)); - strncpy(buf, name, size); - return (strlen(name)); - } else - depth = -1; - } while (depth >= 0); - - return (0); -} - /* * Get the next property of a package. Return the actual len of retrieved * prop name. @@ -329,26 +274,42 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa size_t size) { const struct fdt_property *prop; - int offset, rv; + const char *name; + int offset; offset = fdt_phandle_offset(package); if (offset < 0) return (-1); - if (previous == NULL) - /* Find the first prop in the node */ - return (fdt_nextprop(offset, buf, size)); + /* Find the first prop in the node */ + offset = fdt_first_property_offset(fdtp, offset); + if (offset < 0) + return (0); /* No properties */ - /* - * Advance to the previous prop - */ - prop = fdt_get_property(fdtp, offset, previous, NULL); + if (previous != NULL) { + while (offset >= 0) { + prop = fdt_get_property_by_offset(fdtp, offset, NULL); + if (prop == NULL) + return (-1); /* Internal error */ + + offset = fdt_next_property_offset(fdtp, offset); + if (offset < 0) + return (0); /* No more properties */ + + /* Check if the last one was the one we wanted */ + name = fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)); + if (strcmp(name, previous) == 0) + break; + } + } + + prop = fdt_get_property_by_offset(fdtp, offset, &offset); if (prop == NULL) - return (-1); + return (-1); /* Internal error */ - offset = fdt_pointer_offset(prop); - rv = fdt_nextprop(offset, buf, size); - return (rv); + strncpy(buf, fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)), size); + + return (strlen(buf)); } /* Set the value of a property of a package. */ Modified: stable/10/sys/mips/mips/nexus.c ============================================================================== --- stable/10/sys/mips/mips/nexus.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/mips/mips/nexus.c Wed May 14 01:53:20 2014 (r266000) @@ -58,6 +58,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_platform.h" + +#ifdef FDT +#include +#endif + #undef NEXUS_DEBUG #ifdef NEXUS_DEBUG #define dprintf printf @@ -65,6 +71,9 @@ __FBSDID("$FreeBSD$"); #define dprintf(x, arg...) #endif /* NEXUS_DEBUG */ +#define NUM_MIPS_IRQS 6 + +#ifndef FDT static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { @@ -72,7 +81,6 @@ struct nexus_device { }; #define DEVTONX(dev) ((struct nexus_device *)device_get_ivars(dev)) -#define NUM_MIPS_IRQS 6 static struct rman irq_rman; static struct rman mem_rman; @@ -80,18 +88,13 @@ static struct rman mem_rman; static struct resource * nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); -static int nexus_activate_resource(device_t, device_t, int, int, - struct resource *); static device_t nexus_add_child(device_t, u_int, const char *, int); static int nexus_attach(device_t); -static int nexus_deactivate_resource(device_t, device_t, int, int, - struct resource *); static void nexus_delete_resource(device_t, device_t, int, int); static struct resource_list * nexus_get_reslist(device_t, device_t); static int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *); -static void nexus_hinted_child(device_t, const char *, int); static int nexus_print_child(device_t, device_t); static int nexus_print_all_resources(device_t dev); static int nexus_probe(device_t); @@ -99,6 +102,12 @@ static int nexus_release_resource(device struct resource *); static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long); +#endif +static int nexus_activate_resource(device_t, device_t, int, int, + struct resource *); +static int nexus_deactivate_resource(device_t, device_t, int, int, + struct resource *); +static void nexus_hinted_child(device_t, const char *, int); static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); @@ -106,35 +115,43 @@ static int nexus_teardown_intr(device_t, void *); static device_method_t nexus_methods[] = { +#ifndef FDT /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), /* Bus interface */ DEVMETHOD(bus_add_child, nexus_add_child), - DEVMETHOD(bus_activate_resource,nexus_activate_resource), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_delete_resource, nexus_delete_resource), DEVMETHOD(bus_get_resource, nexus_get_resource), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), - DEVMETHOD(bus_hinted_child, nexus_hinted_child), DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_set_resource, nexus_set_resource), +#endif DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), + DEVMETHOD(bus_activate_resource,nexus_activate_resource), + DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_hinted_child, nexus_hinted_child), { 0, 0 } }; +#ifndef FDT static driver_t nexus_driver = { "nexus", nexus_methods, 1 /* no softc */ }; +#else +DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods, + sizeof(struct ofw_nexus_softc), ofw_nexus_driver); +#endif static devclass_t nexus_devclass; +#ifndef FDT static int nexus_probe(device_t dev) { @@ -163,34 +180,6 @@ nexus_probe(device_t dev) } static int -nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, - driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) -{ - register_t s; - int irq; - - s = intr_disable(); - irq = rman_get_start(res); - if (irq >= NUM_MIPS_IRQS) { - intr_restore(s); - return (0); - } - - cpu_establish_hardintr(device_get_nameunit(child), filt, intr, arg, - irq, flags, cookiep); - intr_restore(s); - return (0); -} - -static int -nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) -{ - - printf("Unimplemented %s at %s:%d\n", __func__, __FILE__, __LINE__); - return (0); -} - -static int nexus_attach(device_t dev) { @@ -231,59 +220,6 @@ nexus_print_all_resources(device_t dev) return (retval); } -static void -nexus_hinted_child(device_t bus, const char *dname, int dunit) -{ - device_t child; - long maddr; - int msize; - int order; - int result; - int irq; - int mem_hints_count; - - if ((resource_int_value(dname, dunit, "order", &order)) != 0) - order = 1000; - child = BUS_ADD_CHILD(bus, order, dname, dunit); - if (child == NULL) - return; - - /* - * Set hard-wired resources for hinted child using - * specific RIDs. - */ - mem_hints_count = 0; - if (resource_long_value(dname, dunit, "maddr", &maddr) == 0) - mem_hints_count++; - if (resource_int_value(dname, dunit, "msize", &msize) == 0) - mem_hints_count++; - - /* check if all info for mem resource has been provided */ - if ((mem_hints_count > 0) && (mem_hints_count < 2)) { - printf("Either maddr or msize hint is missing for %s%d\n", - dname, dunit); - } - else if (mem_hints_count) { - dprintf("%s: discovered hinted child %s at maddr %p(%d)\n", - __func__, device_get_nameunit(child), - (void *)(intptr_t)maddr, msize); - - result = bus_set_resource(child, SYS_RES_MEMORY, 0, maddr, - msize); - if (result != 0) { - device_printf(bus, - "warning: bus_set_resource() failed\n"); - } - } - - if (resource_int_value(dname, dunit, "irq", &irq) == 0) { - result = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1); - if (result != 0) - device_printf(bus, - "warning: bus_set_resource() failed\n"); - } -} - static device_t nexus_add_child(device_t bus, u_int order, const char *name, int unit) { @@ -381,30 +317,6 @@ nexus_alloc_resource(device_t bus, devic return (rv); } -static int -nexus_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) -{ - void *vaddr; - vm_paddr_t paddr; - vm_size_t psize; - - /* - * If this is a memory resource, use pmap_mapdev to map it. - */ - if (type == SYS_RES_MEMORY) { - paddr = rman_get_start(r); - psize = rman_get_size(r); - vaddr = pmap_mapdev(paddr, psize); - - rman_set_virtual(r, vaddr); - rman_set_bustag(r, mips_bus_space_generic); - rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr); - } - - return (rman_activate_resource(r)); -} - static struct resource_list * nexus_get_reslist(device_t dev, device_t child) { @@ -475,6 +387,31 @@ nexus_release_resource(device_t bus, dev return (rman_release_resource(r)); } +#endif + +static int +nexus_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + void *vaddr; + vm_paddr_t paddr; + vm_size_t psize; + + /* + * If this is a memory resource, use pmap_mapdev to map it. + */ + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + paddr = rman_get_start(r); + psize = rman_get_size(r); + vaddr = pmap_mapdev(paddr, psize); + + rman_set_virtual(r, vaddr); + rman_set_bustag(r, mips_bus_space_generic); + rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr); + } + + return (rman_activate_resource(r)); +} static int nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, @@ -490,4 +427,85 @@ nexus_deactivate_resource(device_t bus, return (rman_deactivate_resource(r)); } +static int +nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, + driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) +{ + register_t s; + int irq; + + s = intr_disable(); + irq = rman_get_start(res); + if (irq >= NUM_MIPS_IRQS) { + intr_restore(s); + return (0); + } + + cpu_establish_hardintr(device_get_nameunit(child), filt, intr, arg, + irq, flags, cookiep); + intr_restore(s); + return (0); +} + +static int +nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) +{ + + printf("Unimplemented %s at %s:%d\n", __func__, __FILE__, __LINE__); + return (0); +} + +static void +nexus_hinted_child(device_t bus, const char *dname, int dunit) +{ + device_t child; + long maddr; + int msize; + int order; + int result; + int irq; + int mem_hints_count; + + if ((resource_int_value(dname, dunit, "order", &order)) != 0) + order = 1000; + child = BUS_ADD_CHILD(bus, order, dname, dunit); + if (child == NULL) + return; + + /* + * Set hard-wired resources for hinted child using + * specific RIDs. + */ + mem_hints_count = 0; + if (resource_long_value(dname, dunit, "maddr", &maddr) == 0) + mem_hints_count++; + if (resource_int_value(dname, dunit, "msize", &msize) == 0) + mem_hints_count++; + + /* check if all info for mem resource has been provided */ + if ((mem_hints_count > 0) && (mem_hints_count < 2)) { + printf("Either maddr or msize hint is missing for %s%d\n", + dname, dunit); + } + else if (mem_hints_count) { + dprintf("%s: discovered hinted child %s at maddr %p(%d)\n", + __func__, device_get_nameunit(child), + (void *)(intptr_t)maddr, msize); + + result = bus_set_resource(child, SYS_RES_MEMORY, 0, maddr, + msize); + if (result != 0) { + device_printf(bus, + "warning: bus_set_resource() failed\n"); + } + } + + if (resource_int_value(dname, dunit, "irq", &irq) == 0) { + result = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1); + if (result != 0) + device_printf(bus, + "warning: bus_set_resource() failed\n"); + } +} + DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); Modified: stable/10/sys/powerpc/booke/pmap.c ============================================================================== --- stable/10/sys/powerpc/booke/pmap.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/powerpc/booke/pmap.c Wed May 14 01:53:20 2014 (r266000) @@ -2759,7 +2759,7 @@ mmu_booke_mincore(mmu_t mmu, pmap_t pmap vm_paddr_t *locked_pa) { - TODO; + /* XXX: this should be implemented at some point */ return (0); } Modified: stable/10/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- stable/10/sys/powerpc/mpc85xx/lbc.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/powerpc/mpc85xx/lbc.c Wed May 14 01:53:20 2014 (r266000) @@ -113,7 +113,7 @@ static driver_t lbc_driver = { devclass_t lbc_devclass; -DRIVER_MODULE(lbc, fdtbus, lbc_driver, lbc_devclass, 0, 0); +DRIVER_MODULE(lbc, nexus, lbc_driver, lbc_devclass, 0, 0); /* * Calculate address mask used by OR(n) registers. Use memory region size to Modified: stable/10/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- stable/10/sys/powerpc/mpc85xx/pci_mpc85xx.c Wed May 14 01:35:43 2014 (r265999) +++ stable/10/sys/powerpc/mpc85xx/pci_mpc85xx.c Wed May 14 01:53:20 2014 (r266000) @@ -170,7 +170,7 @@ static devclass_t fsl_pcib_devclass; DEFINE_CLASS_1(pcib, fsl_pcib_driver, fsl_pcib_methods, sizeof(struct fsl_pcib_softc), ofw_pci_driver); -DRIVER_MODULE(pcib, fdtbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0); +DRIVER_MODULE(pcib, nexus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0); static int fsl_pcib_probe(device_t dev) From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 03:09:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 11215F87; Wed, 14 May 2014 03:09: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 EFE822E51; Wed, 14 May 2014 03:09: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 s4E39dlH062504; Wed, 14 May 2014 03:09:39 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E39bxJ062491; Wed, 14 May 2014 03:09:37 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405140309.s4E39bxJ062491@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 03:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266001 - in stable/10/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 03:09:40 -0000 Author: ian Date: Wed May 14 03:09:37 2014 New Revision: 266001 URL: http://svnweb.freebsd.org/changeset/base/266001 Log: MFC r258002, r258024, r258027, r258051, r258052, r258243, r258244, r258002, r258024, r258027, r258051, r258052, r258243, Follow up r223485, which made AIM use the ABI thread pointer instead of PCPU fields for curthread, by doing the same to Book-E. Use the same implementation of copyinout.c for both AIM and Book-E. Actually add IOMMU domain to the list of known mappings. Following the approach with ACPI DMAR on x86, split IOMMU handling into a variant PCI bus instead of trying to shoehorn it into the PCI host bridge adapter. Make sure that TLB1 mappings are aligned correctly. Added: stable/10/sys/powerpc/powerpc/copyinout.c - copied, changed from r258024, head/sys/powerpc/powerpc/copyinout.c stable/10/sys/powerpc/powerpc/swtch32.S - copied unchanged from r258002, head/sys/powerpc/powerpc/swtch32.S stable/10/sys/powerpc/powerpc/swtch64.S - copied unchanged from r258002, head/sys/powerpc/powerpc/swtch64.S Deleted: stable/10/sys/powerpc/aim/copyinout.c stable/10/sys/powerpc/aim/swtch32.S stable/10/sys/powerpc/aim/swtch64.S stable/10/sys/powerpc/booke/copyinout.c stable/10/sys/powerpc/booke/swtch.S Modified: stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/booke/locore.S stable/10/sys/powerpc/booke/machdep.c stable/10/sys/powerpc/booke/mp_cpudep.c stable/10/sys/powerpc/booke/pmap.c stable/10/sys/powerpc/booke/trap_subr.S stable/10/sys/powerpc/include/pcpu.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Wed May 14 01:53:20 2014 (r266000) +++ stable/10/sys/conf/files.powerpc Wed May 14 03:09:37 2014 (r266001) @@ -89,7 +89,6 @@ libkern/qdivrem.c optional powerpc libkern/ucmpdi2.c optional powerpc libkern/udivdi3.c optional powerpc libkern/umoddi3.c optional powerpc -powerpc/aim/copyinout.c optional aim powerpc/aim/interrupt.c optional aim powerpc/aim/locore.S optional aim no-obj powerpc/aim/machdep.c optional aim @@ -99,11 +98,8 @@ powerpc/aim/moea64_if.m optional aim powerpc/aim/moea64_native.c optional aim powerpc/aim/mp_cpudep.c optional aim powerpc/aim/slb.c optional aim powerpc64 -powerpc/aim/swtch32.S optional aim powerpc -powerpc/aim/swtch64.S optional aim powerpc64 powerpc/aim/trap.c optional aim powerpc/aim/uma_machdep.c optional aim -powerpc/booke/copyinout.c optional booke powerpc/booke/interrupt.c optional booke powerpc/booke/locore.S optional booke no-obj powerpc/booke/machdep.c optional booke @@ -111,7 +107,6 @@ powerpc/booke/machdep_e500.c optional bo powerpc/booke/mp_cpudep.c optional booke smp powerpc/booke/platform_bare.c optional mpc85xx powerpc/booke/pmap.c optional booke -powerpc/booke/swtch.S optional booke powerpc/booke/trap.c optional booke powerpc/cpufreq/dfs.c optional cpufreq powerpc/cpufreq/pcr.c optional cpufreq aim @@ -179,6 +174,7 @@ powerpc/powerpc/bcopy.c standard powerpc/powerpc/bus_machdep.c standard powerpc/powerpc/busdma_machdep.c standard powerpc/powerpc/clock.c standard +powerpc/powerpc/copyinout.c standard powerpc/powerpc/copystr.c standard powerpc/powerpc/cpu.c standard powerpc/powerpc/db_disasm.c optional ddb @@ -208,6 +204,8 @@ powerpc/powerpc/sc_machdep.c optional sc powerpc/powerpc/setjmp.S standard powerpc/powerpc/sigcode32.S optional powerpc | compat_freebsd32 powerpc/powerpc/sigcode64.S optional powerpc64 +powerpc/powerpc/swtch32.S optional powerpc +powerpc/powerpc/swtch64.S optional powerpc64 powerpc/powerpc/stack_machdep.c optional ddb | stack powerpc/powerpc/suswintr.c standard powerpc/powerpc/syncicache.c standard Modified: stable/10/sys/powerpc/booke/locore.S ============================================================================== --- stable/10/sys/powerpc/booke/locore.S Wed May 14 01:53:20 2014 (r266000) +++ stable/10/sys/powerpc/booke/locore.S Wed May 14 03:09:37 2014 (r266001) @@ -738,8 +738,7 @@ ENTRY(icache_enable) setfault: mflr %r0 mfsprg0 %r4 - lwz %r4, PC_CURTHREAD(%r4) - lwz %r4, TD_PCB(%r4) + lwz %r4, TD_PCB(%r2) stw %r3, PCB_ONFAULT(%r4) mfcr %r10 mfctr %r11 Modified: stable/10/sys/powerpc/booke/machdep.c ============================================================================== --- stable/10/sys/powerpc/booke/machdep.c Wed May 14 01:53:20 2014 (r266000) +++ stable/10/sys/powerpc/booke/machdep.c Wed May 14 03:09:37 2014 (r266001) @@ -409,6 +409,11 @@ booke_init(uint32_t arg1, uint32_t arg2) pc = &__pcpu[0]; pcpu_init(pc, 0, sizeof(struct pcpu)); pc->pc_curthread = &thread0; +#ifdef __powerpc64__ + __asm __volatile("mr 13,%0" :: "r"(pc->pc_curthread)); +#else + __asm __volatile("mr 2,%0" :: "r"(pc->pc_curthread)); +#endif __asm __volatile("mtsprg 0, %0" :: "r"(pc)); /* Initialize system mutexes. */ Modified: stable/10/sys/powerpc/booke/mp_cpudep.c ============================================================================== --- stable/10/sys/powerpc/booke/mp_cpudep.c Wed May 14 01:53:20 2014 (r266000) +++ stable/10/sys/powerpc/booke/mp_cpudep.c Wed May 14 03:09:37 2014 (r266001) @@ -71,6 +71,11 @@ cpudep_ap_bootstrap() /* Assign pcpu fields, return ptr to this AP's idle thread kstack */ pcpup->pc_curthread = pcpup->pc_idlethread; +#ifdef __powerpc64__ + __asm __volatile("mr 13,%0" :: "r"(pcpup->pc_curthread)); +#else + __asm __volatile("mr 2,%0" :: "r"(pcpup->pc_curthread)); +#endif pcpup->pc_curpcb = pcpup->pc_curthread->td_pcb; sp = pcpup->pc_curpcb->pcb_sp; Modified: stable/10/sys/powerpc/booke/pmap.c ============================================================================== --- stable/10/sys/powerpc/booke/pmap.c Wed May 14 01:53:20 2014 (r266000) +++ stable/10/sys/powerpc/booke/pmap.c Wed May 14 03:09:37 2014 (r266001) @@ -100,8 +100,6 @@ __FBSDID("$FreeBSD$"); #define TODO panic("%s: not implemented", __func__); -extern struct mtx sched_lock; - extern int dumpsys_minidump; extern unsigned char _etext[]; @@ -1906,7 +1904,7 @@ mmu_booke_activate(mmu_t mmu, struct thr KASSERT((pmap != kernel_pmap), ("mmu_booke_activate: kernel_pmap!")); - mtx_lock_spin(&sched_lock); + sched_pin(); cpuid = PCPU_GET(cpuid); CPU_SET_ATOMIC(cpuid, &pmap->pm_active); @@ -1919,7 +1917,7 @@ mmu_booke_activate(mmu_t mmu, struct thr mtspr(SPR_PID0, pmap->pm_tid[cpuid]); __asm __volatile("isync"); - mtx_unlock_spin(&sched_lock); + sched_unpin(); CTR3(KTR_PMAP, "%s: e (tid = %d for '%s')", __func__, pmap->pm_tid[PCPU_GET(cpuid)], td->td_proc->p_comm); @@ -3177,6 +3175,7 @@ pmap_early_io_map(vm_paddr_t pa, vm_size pa_base = trunc_page(pa); size = roundup(size + (pa - pa_base), PAGE_SIZE); + tlb1_map_base = roundup2(tlb1_map_base, 1 << (ilog2(size) & ~1)); va = tlb1_map_base + (pa - pa_base); do { Modified: stable/10/sys/powerpc/booke/trap_subr.S ============================================================================== --- stable/10/sys/powerpc/booke/trap_subr.S Wed May 14 01:53:20 2014 (r266000) +++ stable/10/sys/powerpc/booke/trap_subr.S Wed May 14 03:09:37 2014 (r266001) @@ -219,7 +219,8 @@ lwz %r30, (savearea+CPUSAVE_SRR0)(%r2); \ lwz %r31, (savearea+CPUSAVE_SRR1)(%r2); \ stw %r30, FRAME_SRR0+8(%r1); \ - stw %r31, FRAME_SRR1+8(%r1) + stw %r31, FRAME_SRR1+8(%r1); \ + lwz %r2,PC_CURTHREAD(%r2) /* set curthread pointer */ /* * @@ -734,7 +735,8 @@ interrupt_vector_top: INTERRUPT(int_debug) STANDARD_CRIT_PROLOG(SPR_SPRG2, PC_BOOKE_CRITSAVE, SPR_CSRR0, SPR_CSRR1) FRAME_SETUP(SPR_SPRG2, PC_BOOKE_CRITSAVE, EXC_DEBUG) - lwz %r3, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR0)(%r2); + GET_CPUINFO(%r3) + lwz %r3, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR0)(%r3) lis %r4, interrupt_vector_base@ha addi %r4, %r4, interrupt_vector_base@l cmplw cr0, %r3, %r4 @@ -748,9 +750,10 @@ INTERRUPT(int_debug) rlwinm %r3, %r3, 0, 23, 21 stw %r3, FRAME_SRR1+8(%r1); /* Restore srr0 and srr1 as they could have been clobbered. */ - lwz %r3, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR0+8)(%r2); + GET_CPUINFO(%r4) + lwz %r3, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR0+8)(%r4); mtspr SPR_SRR0, %r3 - lwz %r4, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR1+8)(%r2); + lwz %r4, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR1+8)(%r4); mtspr SPR_SRR1, %r4 b 9f 1: Modified: stable/10/sys/powerpc/include/pcpu.h ============================================================================== --- stable/10/sys/powerpc/include/pcpu.h Wed May 14 01:53:20 2014 (r266000) +++ stable/10/sys/powerpc/include/pcpu.h Wed May 14 03:09:37 2014 (r266001) @@ -136,7 +136,6 @@ struct pmap; #define pcpup ((struct pcpu *) powerpc_get_pcpup()) -#ifdef AIM /* Book-E not yet adapted */ static __inline __pure2 struct thread * __curthread(void) { @@ -149,7 +148,6 @@ __curthread(void) return (td); } #define curthread (__curthread()) -#endif #define PCPU_GET(member) (pcpup->pc_ ## member) Copied and modified: stable/10/sys/powerpc/powerpc/copyinout.c (from r258024, head/sys/powerpc/powerpc/copyinout.c) ============================================================================== --- head/sys/powerpc/powerpc/copyinout.c Mon Nov 11 23:37:16 2013 (r258024, copy source) +++ stable/10/sys/powerpc/powerpc/copyinout.c Wed May 14 03:09:37 2014 (r266001) @@ -195,7 +195,7 @@ copyout(const void *kaddr, void *udaddr, while (len > 0) { if (map_user_ptr(pm, udaddr, (void **)&p, len, &l)) { td->td_pcb->pcb_onfault = NULL; - return (-1); + return (EFAULT); } bcopy(kp, p, l); @@ -233,7 +233,7 @@ copyin(const void *udaddr, void *kaddr, while (len > 0) { if (map_user_ptr(pm, udaddr, (void **)&p, len, &l)) { td->td_pcb->pcb_onfault = NULL; - return (-1); + return (EFAULT); } bcopy(p, kp, l); Copied: stable/10/sys/powerpc/powerpc/swtch32.S (from r258002, head/sys/powerpc/powerpc/swtch32.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/powerpc/powerpc/swtch32.S Wed May 14 03:09:37 2014 (r266001, copy of r258002, head/sys/powerpc/powerpc/swtch32.S) @@ -0,0 +1,221 @@ +/* $FreeBSD$ */ +/* $NetBSD: locore.S,v 1.24 2000/05/31 05:09:17 thorpej Exp $ */ + +/*- + * Copyright (C) 2001 Benno Rice + * 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 Benno Rice ``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 TOOLS GMBH 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. +*/ +/*- + * Copyright (C) 1995, 1996 Wolfgang Solfrank. + * Copyright (C) 1995, 1996 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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 "assym.s" +#include "opt_sched.h" + +#include + +#include +#include +#include +#include + +/* + * void cpu_throw(struct thread *old, struct thread *new) + */ +ENTRY(cpu_throw) + mr %r2, %r4 + b cpu_switchin + +/* + * void cpu_switch(struct thread *old, + * struct thread *new, + * struct mutex *mtx); + * + * Switch to a new thread saving the current state in the old thread. + */ +ENTRY(cpu_switch) + lwz %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ + stmw %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. + These can now be used for scratch */ + + mfcr %r16 /* Save the condition register */ + stw %r16,PCB_CR(%r6) + mflr %r16 /* Save the link register */ + stw %r16,PCB_LR(%r6) +#ifdef BOOKE + mfctr %r16 + stw %r16,PCB_BOOKE_CTR(%r6) + mfxer %r16 + stw %r16,PCB_BOOKE_XER(%r6) + mfspr %r16,SPR_DBCR0 + stw %r16,PCB_BOOKE_DBCR0(%r6) +#endif + stw %r1,PCB_SP(%r6) /* Save the stack pointer */ + + mr %r14,%r3 /* Copy the old thread ptr... */ + mr %r2,%r4 /* and the new thread ptr in curthread */ + mr %r16,%r5 /* and the new lock */ + mr %r17,%r6 /* and the PCB */ + +#ifdef AIM + lwz %r7,PCB_FLAGS(%r17) + /* Save FPU context if needed */ + andi. %r7, %r7, PCB_FPU + beq .L1 + bl save_fpu + +.L1: + mr %r3,%r14 /* restore old thread ptr */ + lwz %r7,PCB_FLAGS(%r17) + /* Save Altivec context if needed */ + andi. %r7, %r7, PCB_VEC + beq .L2 + bl save_vec + +.L2: +#endif + mr %r3,%r14 /* restore old thread ptr */ + bl pmap_deactivate /* Deactivate the current pmap */ + + sync /* Make sure all of that finished */ + stw %r16,TD_LOCK(%r14) /* ULE: update old thread's lock */ + +cpu_switchin: +#if defined(SMP) && defined(SCHED_ULE) + /* Wait for the new thread to become unblocked */ + lis %r6,blocked_lock@ha + addi %r6,%r6,blocked_lock@l +blocked_loop: + lwz %r7,TD_LOCK(%r2) + cmpw %r6,%r7 + beq- blocked_loop + isync +#endif + + mfsprg %r7,0 /* Get the pcpu pointer */ + stw %r2,PC_CURTHREAD(%r7) /* Store new current thread */ + lwz %r17,TD_PCB(%r2) /* Store new current PCB */ + stw %r17,PC_CURPCB(%r7) + + mr %r3,%r2 /* Get new thread ptr */ + bl pmap_activate /* Activate the new address space */ + +#ifdef AIM + lwz %r6, PCB_FLAGS(%r17) + /* Restore FPU context if needed */ + andi. %r6, %r6, PCB_FPU + beq .L3 + mr %r3,%r2 /* Pass curthread to enable_fpu */ + bl enable_fpu + +.L3: + lwz %r6, PCB_FLAGS(%r17) + /* Restore Altivec context if needed */ + andi. %r6, %r6, PCB_VEC + beq .L4 + mr %r3,%r2 /* Pass curthread to enable_vec */ + bl enable_vec + +.L4: +#endif + /* thread to restore is in r3 */ + mr %r3,%r17 /* Recover PCB ptr */ + lmw %r12,PCB_CONTEXT(%r3) /* Load the non-volatile GP regs */ + lwz %r5,PCB_CR(%r3) /* Load the condition register */ + mtcr %r5 + lwz %r5,PCB_LR(%r3) /* Load the link register */ + mtlr %r5 +#ifdef AIM + lwz %r5,PCB_AIM_USR_VSID(%r3) /* Load the USER_SR segment reg */ + isync + mtsr USER_SR,%r5 + isync +#endif +#ifdef BOOKE + lwz %r5,PCB_BOOKE_CTR(%r3) + mtctr %r5 + lwz %r5,PCB_BOOKE_XER(%r3) + mtctr %r5 + lwz %r5,PCB_BOOKE_DBCR0(%r3) + mtspr SPR_DBCR0,%r5 +#endif + lwz %r1,PCB_SP(%r3) /* Load the stack pointer */ + /* + * Perform a dummy stwcx. to clear any reservations we may have + * inherited from the previous thread. It doesn't matter if the + * stwcx succeeds or not. pcb_context[0] can be clobbered. + */ + stwcx. %r1, 0, %r3 + blr + +/* + * savectx(pcb) + * Update pcb, saving current processor state + */ +ENTRY(savectx) + stmw %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs */ + mfcr %r4 /* Save the condition register */ + stw %r4,PCB_CR(%r3) + blr + +/* + * fork_trampoline() + * Set up the return from cpu_fork() + */ +ENTRY(fork_trampoline) + lwz %r3,CF_FUNC(%r1) + lwz %r4,CF_ARG0(%r1) + lwz %r5,CF_ARG1(%r1) + bl fork_exit + addi %r1,%r1,CF_SIZE-FSP /* Allow 8 bytes in front of + trapframe to simulate FRAME_SETUP + does when allocating space for + a frame pointer/saved LR */ + b trapexit Copied: stable/10/sys/powerpc/powerpc/swtch64.S (from r258002, head/sys/powerpc/powerpc/swtch64.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/powerpc/powerpc/swtch64.S Wed May 14 03:09:37 2014 (r266001, copy of r258002, head/sys/powerpc/powerpc/swtch64.S) @@ -0,0 +1,287 @@ +/* $FreeBSD$ */ +/* $NetBSD: locore.S,v 1.24 2000/05/31 05:09:17 thorpej Exp $ */ + +/*- + * Copyright (C) 2001 Benno Rice + * 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 Benno Rice ``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 TOOLS GMBH 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. +*/ +/*- + * Copyright (C) 1995, 1996 Wolfgang Solfrank. + * Copyright (C) 1995, 1996 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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 "assym.s" +#include "opt_sched.h" + +#include + +#include +#include +#include + +/* + * void cpu_throw(struct thread *old, struct thread *new) + */ +ENTRY(cpu_throw) + mr %r13, %r4 + b cpu_switchin + +/* + * void cpu_switch(struct thread *old, + * struct thread *new, + * struct mutex *mtx); + * + * Switch to a new thread saving the current state in the old thread. + */ +ENTRY(cpu_switch) + ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ + std %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. + These can now be used for scratch */ + std %r14,PCB_CONTEXT+2*8(%r6) + std %r15,PCB_CONTEXT+3*8(%r6) + std %r16,PCB_CONTEXT+4*8(%r6) + std %r17,PCB_CONTEXT+5*8(%r6) + std %r18,PCB_CONTEXT+6*8(%r6) + std %r19,PCB_CONTEXT+7*8(%r6) + std %r20,PCB_CONTEXT+8*8(%r6) + std %r21,PCB_CONTEXT+9*8(%r6) + std %r22,PCB_CONTEXT+10*8(%r6) + std %r23,PCB_CONTEXT+11*8(%r6) + std %r24,PCB_CONTEXT+12*8(%r6) + std %r25,PCB_CONTEXT+13*8(%r6) + std %r26,PCB_CONTEXT+14*8(%r6) + std %r27,PCB_CONTEXT+15*8(%r6) + std %r28,PCB_CONTEXT+16*8(%r6) + std %r29,PCB_CONTEXT+17*8(%r6) + std %r30,PCB_CONTEXT+18*8(%r6) + std %r31,PCB_CONTEXT+19*8(%r6) + + mfcr %r16 /* Save the condition register */ + std %r16,PCB_CR(%r6) + mflr %r16 /* Save the link register */ + std %r16,PCB_LR(%r6) + std %r1,PCB_SP(%r6) /* Save the stack pointer */ + std %r2,PCB_TOC(%r6) /* Save the TOC pointer */ + + mr %r14,%r3 /* Copy the old thread ptr... */ + mr %r13,%r4 /* and the new thread ptr in curthread*/ + mr %r16,%r5 /* and the new lock */ + mr %r17,%r6 /* and the PCB */ + + stdu %r1,-48(%r1) + + lwz %r7,PCB_FLAGS(%r17) + /* Save FPU context if needed */ + andi. %r7, %r7, PCB_FPU + beq .L1 + bl save_fpu + nop + +.L1: + mr %r3,%r14 /* restore old thread ptr */ + lwz %r7,PCB_FLAGS(%r17) + /* Save Altivec context if needed */ + andi. %r7, %r7, PCB_VEC + beq .L2 + bl save_vec + nop + +.L2: + mr %r3,%r14 /* restore old thread ptr */ + bl pmap_deactivate /* Deactivate the current pmap */ + nop + + addi %r1,%r1,48 + + sync /* Make sure all of that finished */ + std %r16,TD_LOCK(%r14) /* ULE: update old thread's lock */ + +cpu_switchin: +#if defined(SMP) && defined(SCHED_ULE) + /* Wait for the new thread to become unblocked */ + lis %r6,blocked_lock@ha + addi %r6,%r6,blocked_lock@l +blocked_loop: + ld %r7,TD_LOCK(%r13) + cmpd %r6,%r7 + beq- blocked_loop + isync +#endif + + mfsprg %r7,0 /* Get the pcpu pointer */ + std %r13,PC_CURTHREAD(%r7) /* Store new current thread */ + ld %r17,TD_PCB(%r13) /* Store new current PCB */ + std %r17,PC_CURPCB(%r7) + + stdu %r1,-48(%r1) + + mr %r3,%r13 /* Get new thread ptr */ + bl pmap_activate /* Activate the new address space */ + nop + + lwz %r6, PCB_FLAGS(%r17) + /* Restore FPU context if needed */ + andi. %r6, %r6, PCB_FPU + beq .L3 + mr %r3,%r13 /* Pass curthread to enable_fpu */ + bl enable_fpu + nop + +.L3: + lwz %r6, PCB_FLAGS(%r17) + /* Restore Altivec context if needed */ + andi. %r6, %r6, PCB_VEC + beq .L4 + mr %r3,%r13 /* Pass curthread to enable_vec */ + bl enable_vec + nop + + /* thread to restore is in r3 */ +.L4: + addi %r1,%r1,48 + mr %r3,%r17 /* Recover PCB ptr */ + ld %r12,PCB_CONTEXT(%r3) /* Load the non-volatile GP regs. */ + ld %r14,PCB_CONTEXT+2*8(%r3) + ld %r15,PCB_CONTEXT+3*8(%r3) + ld %r16,PCB_CONTEXT+4*8(%r3) + ld %r17,PCB_CONTEXT+5*8(%r3) + ld %r18,PCB_CONTEXT+6*8(%r3) + ld %r19,PCB_CONTEXT+7*8(%r3) + ld %r20,PCB_CONTEXT+8*8(%r3) + ld %r21,PCB_CONTEXT+9*8(%r3) + ld %r22,PCB_CONTEXT+10*8(%r3) + ld %r23,PCB_CONTEXT+11*8(%r3) + ld %r24,PCB_CONTEXT+12*8(%r3) + ld %r25,PCB_CONTEXT+13*8(%r3) + ld %r26,PCB_CONTEXT+14*8(%r3) + ld %r27,PCB_CONTEXT+15*8(%r3) + ld %r28,PCB_CONTEXT+16*8(%r3) + ld %r29,PCB_CONTEXT+17*8(%r3) + ld %r30,PCB_CONTEXT+18*8(%r3) + ld %r31,PCB_CONTEXT+19*8(%r3) + ld %r5,PCB_CR(%r3) /* Load the condition register */ + mtcr %r5 + ld %r5,PCB_LR(%r3) /* Load the link register */ + mtlr %r5 + ld %r1,PCB_SP(%r3) /* Load the stack pointer */ + ld %r2,PCB_TOC(%r3) /* Load the TOC pointer */ + + lis %r5,USER_ADDR@highesta /* Load the copyin/out segment reg */ + ori %r5,%r5,USER_ADDR@highera + sldi %r5,%r5,32 + oris %r5,%r5,USER_ADDR@ha + isync + slbie %r5 + lis %r6,USER_SLB_SLBE@highesta + ori %r6,%r6,USER_SLB_SLBE@highera + sldi %r6,%r6,32 + oris %r6,%r6,USER_SLB_SLBE@ha + ori %r6,%r6,USER_SLB_SLBE@l + ld %r5,PCB_AIM_USR_VSID(%r3) + slbmte %r5,%r6 + isync + + /* + * Perform a dummy stdcx. to clear any reservations we may have + * inherited from the previous thread. It doesn't matter if the + * stdcx succeeds or not. pcb_context[0] can be clobbered. + */ + stdcx. %r1, 0, %r3 + blr + +/* + * savectx(pcb) + * Update pcb, saving current processor state + */ +ENTRY(savectx) + std %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs. */ + std %r13,PCB_CONTEXT+1*8(%r3) + std %r14,PCB_CONTEXT+2*8(%r3) + std %r15,PCB_CONTEXT+3*8(%r3) + std %r16,PCB_CONTEXT+4*8(%r3) + std %r17,PCB_CONTEXT+5*8(%r3) + std %r18,PCB_CONTEXT+6*8(%r3) + std %r19,PCB_CONTEXT+7*8(%r3) + std %r20,PCB_CONTEXT+8*8(%r3) + std %r21,PCB_CONTEXT+9*8(%r3) + std %r22,PCB_CONTEXT+10*8(%r3) + std %r23,PCB_CONTEXT+11*8(%r3) + std %r24,PCB_CONTEXT+12*8(%r3) + std %r25,PCB_CONTEXT+13*8(%r3) + std %r26,PCB_CONTEXT+14*8(%r3) + std %r27,PCB_CONTEXT+15*8(%r3) + std %r28,PCB_CONTEXT+16*8(%r3) + std %r29,PCB_CONTEXT+17*8(%r3) + std %r30,PCB_CONTEXT+18*8(%r3) + std %r31,PCB_CONTEXT+19*8(%r3) + + mfcr %r4 /* Save the condition register */ + std %r4,PCB_CR(%r3) + std %r2,PCB_TOC(%r3) /* Save the TOC pointer */ + blr + +/* + * fork_trampoline() + * Set up the return from cpu_fork() + */ + +ENTRY_NOPROF(fork_trampoline) + ld %r3,CF_FUNC(%r1) + ld %r4,CF_ARG0(%r1) + ld %r5,CF_ARG1(%r1) + + stdu %r1,-48(%r1) + bl fork_exit + nop + addi %r1,%r1,48+CF_SIZE-FSP /* Allow 8 bytes in front of + trapframe to simulate FRAME_SETUP + does when allocating space for + a frame pointer/saved LR */ + b trapexit + nop From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 04:15:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E545C462; Wed, 14 May 2014 04:15: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 B681B2391; Wed, 14 May 2014 04:15: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 s4E4F0b4093658; Wed, 14 May 2014 04:15:00 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E4ExDC093616; Wed, 14 May 2014 04:14:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405140414.s4E4ExDC093616@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 04:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266003 - in stable/10/sys: conf powerpc/booke powerpc/include powerpc/mpc85xx powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 04:15:01 -0000 Author: ian Date: Wed May 14 04:14:58 2014 New Revision: 266003 URL: http://svnweb.freebsd.org/changeset/base/266003 Log: MFC r257995, r258244, r258246, Rename the "bare" platform "mpc85xx" Also turn "bare" into a truly bare platform Move CCSR discovery into the platform module There is no reason Book-E needs to save XER and CTR on context switches. Added: stable/10/sys/powerpc/mpc85xx/platform_mpc85xx.c - copied, changed from r257995, head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/booke/machdep.c stable/10/sys/powerpc/booke/platform_bare.c stable/10/sys/powerpc/include/pcb.h stable/10/sys/powerpc/mpc85xx/mpc85xx.h stable/10/sys/powerpc/powerpc/genassym.c stable/10/sys/powerpc/powerpc/swtch32.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Wed May 14 04:02:59 2014 (r266002) +++ stable/10/sys/conf/files.powerpc Wed May 14 04:14:58 2014 (r266003) @@ -105,7 +105,7 @@ powerpc/booke/locore.S optional booke n powerpc/booke/machdep.c optional booke powerpc/booke/machdep_e500.c optional booke_e500 powerpc/booke/mp_cpudep.c optional booke smp -powerpc/booke/platform_bare.c optional mpc85xx +powerpc/booke/platform_bare.c optional booke powerpc/booke/pmap.c optional booke powerpc/booke/trap.c optional booke powerpc/cpufreq/dfs.c optional cpufreq @@ -131,6 +131,7 @@ powerpc/mpc85xx/i2c.c optional iicbus f powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx +powerpc/mpc85xx/platform_mpc85xx.c optional mpc85xx powerpc/mpc85xx/pci_mpc85xx.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_machdep.c standard Modified: stable/10/sys/powerpc/booke/machdep.c ============================================================================== --- stable/10/sys/powerpc/booke/machdep.c Wed May 14 04:02:59 2014 (r266002) +++ stable/10/sys/powerpc/booke/machdep.c Wed May 14 04:14:58 2014 (r266003) @@ -387,14 +387,6 @@ booke_init(uint32_t arg1, uint32_t arg2) /* Reset TLB1 to get rid of temporary mappings */ tlb1_init(); - /* Set up IMMR */ - if (fdt_immr_addr(0) == 0) { - fdt_immr_va = pmap_early_io_map(fdt_immr_pa, fdt_immr_size); - } else { - printf("Warning: SOC base registers could not be found!\n"); - fdt_immr_va = 0; - } - /* Reset Time Base */ mttb(0); Modified: stable/10/sys/powerpc/booke/platform_bare.c ============================================================================== --- stable/10/sys/powerpc/booke/platform_bare.c Wed May 14 04:02:59 2014 (r266002) +++ stable/10/sys/powerpc/booke/platform_bare.c Wed May 14 04:14:58 2014 (r266003) @@ -35,65 +35,34 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include #include -#include +#include +#include #include "platform_if.h" -#ifdef SMP -extern void *ap_pcpu; -extern vm_paddr_t kernload; /* Kernel physical load address */ -extern uint8_t __boot_page[]; /* Boot page body */ -extern uint32_t bp_ntlb1s; -extern uint32_t bp_tlb1[]; -extern uint32_t bp_tlb1_end[]; -#endif - extern uint32_t *bootinfo; -static int cpu, maxcpu; - static int bare_probe(platform_t); static void bare_mem_regions(platform_t, struct mem_region **phys, int *physsz, struct mem_region **avail, int *availsz); static u_long bare_timebase_freq(platform_t, struct cpuref *cpuref); -static int bare_smp_first_cpu(platform_t, struct cpuref *cpuref); -static int bare_smp_next_cpu(platform_t, struct cpuref *cpuref); -static int bare_smp_get_bsp(platform_t, struct cpuref *cpuref); -static int bare_smp_start_cpu(platform_t, struct pcpu *cpu); -static void booke_reset(platform_t); +static void bare_reset(platform_t); static platform_method_t bare_methods[] = { PLATFORMMETHOD(platform_probe, bare_probe), PLATFORMMETHOD(platform_mem_regions, bare_mem_regions), PLATFORMMETHOD(platform_timebase_freq, bare_timebase_freq), - PLATFORMMETHOD(platform_smp_first_cpu, bare_smp_first_cpu), - PLATFORMMETHOD(platform_smp_next_cpu, bare_smp_next_cpu), - PLATFORMMETHOD(platform_smp_get_bsp, bare_smp_get_bsp), - PLATFORMMETHOD(platform_smp_start_cpu, bare_smp_start_cpu), - - PLATFORMMETHOD(platform_reset, booke_reset), + PLATFORMMETHOD(platform_reset, bare_reset), PLATFORMMETHOD_END }; static platform_def_t bare_platform = { - "bare metal", + "bare", bare_methods, 0 }; @@ -103,65 +72,19 @@ PLATFORM_DEF(bare_platform); static int bare_probe(platform_t plat) { - phandle_t cpus, child; - uint32_t sr; - int i, law_max, tgt; - if ((cpus = OF_finddevice("/cpus")) != 0) { - for (maxcpu = 0, child = OF_child(cpus); child != 0; - child = OF_peer(child), maxcpu++) - ; - } else - maxcpu = 1; - - /* - * Clear local access windows. Skip DRAM entries, so we don't shoot - * ourselves in the foot. - */ - law_max = law_getmax(); - for (i = 0; i < law_max; i++) { - sr = ccsr_read4(OCP85XX_LAWSR(i)); - if ((sr & 0x80000000) == 0) - continue; - tgt = (sr & 0x01f00000) >> 20; - if (tgt == OCP85XX_TGTIF_RAM1 || tgt == OCP85XX_TGTIF_RAM2 || - tgt == OCP85XX_TGTIF_RAM_INTL) - continue; - - ccsr_write4(OCP85XX_LAWSR(i), sr & 0x7fffffff); - } + if (OF_peer(0) == -1) /* Needs device tree to work */ + return (ENXIO); return (BUS_PROBE_GENERIC); } -#define MEM_REGIONS 8 -static struct mem_region avail_regions[MEM_REGIONS]; - void bare_mem_regions(platform_t plat, struct mem_region **phys, int *physsz, struct mem_region **avail, int *availsz) { - uint32_t memsize; - int i, rv; - rv = fdt_get_mem_regions(avail_regions, availsz, &memsize); - if (rv != 0) - panic("%s: could not retrieve mem regions from the 'memory' " - "node, error: %d", __func__, rv); - - for (i = 0; i < *availsz; i++) { - if (avail_regions[i].mr_start < 1048576) { - avail_regions[i].mr_size = - avail_regions[i].mr_size - - (1048576 - avail_regions[i].mr_start); - avail_regions[i].mr_start = 1048576; - } - } - *avail = avail_regions; - - /* On the bare metal platform phys == avail memory */ - *physsz = *availsz; - *phys = *avail; + ofw_mem_regions(phys, physsz, avail, availsz); } static u_long @@ -226,138 +149,10 @@ out: return (ticks); } -static int -bare_smp_first_cpu(platform_t plat, struct cpuref *cpuref) -{ - - cpu = 0; - cpuref->cr_cpuid = cpu; - cpuref->cr_hwref = cpuref->cr_cpuid; - if (bootverbose) - printf("powerpc_smp_first_cpu: cpuid %d\n", cpuref->cr_cpuid); - cpu++; - - return (0); -} - -static int -bare_smp_next_cpu(platform_t plat, struct cpuref *cpuref) -{ - - if (cpu >= maxcpu) - return (ENOENT); - - cpuref->cr_cpuid = cpu++; - cpuref->cr_hwref = cpuref->cr_cpuid; - if (bootverbose) - printf("powerpc_smp_next_cpu: cpuid %d\n", cpuref->cr_cpuid); - - return (0); -} - -static int -bare_smp_get_bsp(platform_t plat, struct cpuref *cpuref) -{ - - cpuref->cr_cpuid = mfspr(SPR_PIR); - cpuref->cr_hwref = cpuref->cr_cpuid; - - return (0); -} - -static int -bare_smp_start_cpu(platform_t plat, struct pcpu *pc) -{ -#ifdef SMP - uint32_t *tlb1; - uint32_t bptr, eebpcr; - int i, timeout; - - eebpcr = ccsr_read4(OCP85XX_EEBPCR); - if ((eebpcr & (1 << (pc->pc_cpuid + 24))) != 0) { - printf("SMP: CPU %d already out of hold-off state!\n", - pc->pc_cpuid); - return (ENXIO); - } - - ap_pcpu = pc; - - i = 0; - tlb1 = bp_tlb1; - while (i < bp_ntlb1s && tlb1 < bp_tlb1_end) { - mtspr(SPR_MAS0, MAS0_TLBSEL(1) | MAS0_ESEL(i)); - __asm __volatile("isync; tlbre"); - tlb1[0] = mfspr(SPR_MAS1); - tlb1[1] = mfspr(SPR_MAS2); - tlb1[2] = mfspr(SPR_MAS3); - i++; - tlb1 += 3; - } - if (i < bp_ntlb1s) - bp_ntlb1s = i; - - /* - * Set BPTR to the physical address of the boot page - */ - bptr = ((uint32_t)__boot_page - KERNBASE) + kernload; - KASSERT((bptr & 0xfff) == 0, - ("%s: boot page is not aligned (%#x)", __func__, bptr)); - bptr = (bptr >> 12) | 0x80000000u; - ccsr_write4(OCP85XX_BPTR, bptr); - __asm __volatile("isync; msync"); - - /* Flush caches to have our changes hit DRAM. */ - cpu_flush_dcache(__boot_page, 4096); - - /* - * Release AP from hold-off state - */ - eebpcr |= (1 << (pc->pc_cpuid + 24)); - ccsr_write4(OCP85XX_EEBPCR, eebpcr); - __asm __volatile("isync; msync"); - - timeout = 500; - while (!pc->pc_awake && timeout--) - DELAY(1000); /* wait 1ms */ - - /* - * Disable boot page translation so that the 4K page at the default - * address (= 0xfffff000) isn't permanently remapped and thus not - * usable otherwise. - */ - ccsr_write4(OCP85XX_BPTR, 0); - __asm __volatile("isync; msync"); - - if (!pc->pc_awake) - printf("SMP: CPU %d didn't wake up.\n", pc->pc_cpuid); - return ((pc->pc_awake) ? 0 : EBUSY); -#else - /* No SMP support */ - return (ENXIO); -#endif -} - static void -booke_reset(platform_t plat) +bare_reset(platform_t plat) { - /* - * Try the dedicated reset register first. - * If the SoC doesn't have one, we'll fall - * back to using the debug control register. - */ - ccsr_write4(OCP85XX_RSTCR, 2); - - /* Clear DBCR0, disables debug interrupts and events. */ - mtspr(SPR_DBCR0, 0); - __asm __volatile("isync"); - - /* Enable Debug Interrupts in MSR. */ - mtmsr(mfmsr() | PSL_DE); - - /* Enable debug interrupts and issue reset. */ - mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM | DBCR0_RST_SYSTEM); - printf("Reset failed...\n"); while (1) ; Modified: stable/10/sys/powerpc/include/pcb.h ============================================================================== --- stable/10/sys/powerpc/include/pcb.h Wed May 14 04:02:59 2014 (r266002) +++ stable/10/sys/powerpc/include/pcb.h Wed May 14 04:14:58 2014 (r266003) @@ -70,8 +70,6 @@ struct pcb { register_t usr_vsid; /* USER_SR segment */ } aim; struct { - register_t ctr; - register_t xer; register_t dbcr0; } booke; } pcb_cpu; Modified: stable/10/sys/powerpc/mpc85xx/mpc85xx.h ============================================================================== --- stable/10/sys/powerpc/mpc85xx/mpc85xx.h Wed May 14 04:02:59 2014 (r266002) +++ stable/10/sys/powerpc/mpc85xx/mpc85xx.h Wed May 14 04:14:58 2014 (r266003) @@ -33,7 +33,8 @@ /* * Configuration control and status registers */ -#define CCSRBAR_VA fdt_immr_va +extern vm_offset_t ccsrbar_va; +#define CCSRBAR_VA ccsrbar_va #define OCP85XX_CCSRBAR (CCSRBAR_VA + 0x0) #define OCP85XX_BPTR (CCSRBAR_VA + 0x20) Copied and modified: stable/10/sys/powerpc/mpc85xx/platform_mpc85xx.c (from r257995, head/sys/powerpc/mpc85xx/platform_mpc85xx.c) ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Mon Nov 11 16:14:25 2013 (r257995, copy source) +++ stable/10/sys/powerpc/mpc85xx/platform_mpc85xx.c Wed May 14 04:14:58 2014 (r266003) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include "platform_if.h" @@ -63,6 +66,7 @@ extern uint32_t bp_tlb1_end[]; #endif extern uint32_t *bootinfo; +vm_offset_t ccsrbar_va; static int cpu, maxcpu; @@ -116,8 +120,12 @@ mpc85xx_probe(platform_t plat) static int mpc85xx_attach(platform_t plat) { - phandle_t cpus, child; + phandle_t cpus, child, ccsr; + const char *soc_name_guesses[] = {"/soc", "soc", NULL}; + const char **name; + pcell_t ranges[6], acells, pacells, scells; uint32_t sr; + uint64_t ccsrbar, ccsrsize; int i, law_max, tgt; if ((cpus = OF_finddevice("/cpus")) != -1) { @@ -128,6 +136,51 @@ mpc85xx_attach(platform_t plat) maxcpu = 1; /* + * Locate CCSR region. Irritatingly, there is no way to find it + * unless you already know where it is. Try to infer its location + * from the device tree. + */ + + ccsr = -1; + for (name = soc_name_guesses; *name != NULL && ccsr == -1; name++) + ccsr = OF_finddevice(*name); + if (ccsr == -1) { + char type[64]; + + /* That didn't work. Search for devices of type "soc" */ + child = OF_child(OF_peer(0)); + for (OF_child(child); child != 0; child = OF_peer(child)) { + if (OF_getprop(child, "device_type", type, sizeof(type)) + <= 0) + continue; + + if (strcmp(type, "soc") == 0) { + ccsr = child; + break; + } + } + } + + if (ccsr == -1) + panic("Could not locate CCSR window!"); + + OF_getprop(ccsr, "#size-cells", &scells, sizeof(scells)); + OF_getprop(ccsr, "#address-cells", &acells, sizeof(acells)); + OF_searchprop(OF_parent(ccsr), "#address-cells", &pacells, + sizeof(pacells)); + OF_getprop(ccsr, "ranges", ranges, sizeof(ranges)); + ccsrbar = ccsrsize = 0; + for (i = acells; i < acells + pacells; i++) { + ccsrbar <<= 32; + ccsrbar |= ranges[i]; + } + for (i = acells + pacells; i < acells + pacells + scells; i++) { + ccsrsize <<= 32; + ccsrsize |= ranges[i]; + } + ccsrbar_va = pmap_early_io_map(ccsrbar, ccsrsize); + + /* * Clear local access windows. Skip DRAM entries, so we don't shoot * ourselves in the foot. */ Modified: stable/10/sys/powerpc/powerpc/genassym.c ============================================================================== --- stable/10/sys/powerpc/powerpc/genassym.c Wed May 14 04:02:59 2014 (r266002) +++ stable/10/sys/powerpc/powerpc/genassym.c Wed May 14 04:14:58 2014 (r266003) @@ -193,8 +193,6 @@ ASSYM(PCB_FPU, PCB_FPU); ASSYM(PCB_VEC, PCB_VEC); ASSYM(PCB_AIM_USR_VSID, offsetof(struct pcb, pcb_cpu.aim.usr_vsid)); -ASSYM(PCB_BOOKE_CTR, offsetof(struct pcb, pcb_cpu.booke.ctr)); -ASSYM(PCB_BOOKE_XER, offsetof(struct pcb, pcb_cpu.booke.xer)); ASSYM(PCB_BOOKE_DBCR0, offsetof(struct pcb, pcb_cpu.booke.dbcr0)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); Modified: stable/10/sys/powerpc/powerpc/swtch32.S ============================================================================== --- stable/10/sys/powerpc/powerpc/swtch32.S Wed May 14 04:02:59 2014 (r266002) +++ stable/10/sys/powerpc/powerpc/swtch32.S Wed May 14 04:14:58 2014 (r266003) @@ -90,10 +90,6 @@ ENTRY(cpu_switch) mflr %r16 /* Save the link register */ stw %r16,PCB_LR(%r6) #ifdef BOOKE - mfctr %r16 - stw %r16,PCB_BOOKE_CTR(%r6) - mfxer %r16 - stw %r16,PCB_BOOKE_XER(%r6) mfspr %r16,SPR_DBCR0 stw %r16,PCB_BOOKE_DBCR0(%r6) #endif @@ -179,10 +175,6 @@ blocked_loop: isync #endif #ifdef BOOKE - lwz %r5,PCB_BOOKE_CTR(%r3) - mtctr %r5 - lwz %r5,PCB_BOOKE_XER(%r3) - mtctr %r5 lwz %r5,PCB_BOOKE_DBCR0(%r3) mtspr SPR_DBCR0,%r5 #endif From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 04:42:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8316D7E7; Wed, 14 May 2014 04:42: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 6523E26CE; Wed, 14 May 2014 04:42: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 s4E4geUZ006261; Wed, 14 May 2014 04:42:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E4gc8G006249; Wed, 14 May 2014 04:42:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405140442.s4E4gc8G006249@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 04:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266004 - in stable/10/sys: conf powerpc/booke powerpc/fpu powerpc/include powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 04:42:40 -0000 Author: ian Date: Wed May 14 04:42:38 2014 New Revision: 266004 URL: http://svnweb.freebsd.org/changeset/base/266004 Log: MFC r258247, r258250, r258257 Remove a pointless #ifdef AIM. This is just PPC64 specific, including 64-bit Book-E. Make single precision floating point arithmetic actually work Split the function of the PCB_FPU flags into two: PCB_FPU now indicates that the actual FPU is enabled, while PCB_FPREGS indicates that the FPU state structure in the PCB is valid. Modified: stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/booke/trap.c stable/10/sys/powerpc/fpu/fpu_emu.c stable/10/sys/powerpc/fpu/fpu_explode.c stable/10/sys/powerpc/include/counter.h stable/10/sys/powerpc/include/pcb.h stable/10/sys/powerpc/powerpc/exec_machdep.c stable/10/sys/powerpc/powerpc/fpu.c stable/10/sys/powerpc/powerpc/swtch32.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Wed May 14 04:14:58 2014 (r266003) +++ stable/10/sys/conf/files.powerpc Wed May 14 04:42:38 2014 (r266004) @@ -169,7 +169,7 @@ powerpc/powermac/uninorth.c optional pow powerpc/powermac/uninorthpci.c optional powermac pci powerpc/powermac/vcoregpio.c optional powermac powerpc/powermac/windtunnel.c optional powermac windtunnel -powerpc/powerpc/altivec.c optional aim +powerpc/powerpc/altivec.c standard powerpc/powerpc/autoconf.c standard powerpc/powerpc/bcopy.c standard powerpc/powerpc/bus_machdep.c standard @@ -186,7 +186,7 @@ powerpc/powerpc/dump_machdep.c standard powerpc/powerpc/elf32_machdep.c optional powerpc | compat_freebsd32 powerpc/powerpc/elf64_machdep.c optional powerpc64 powerpc/powerpc/exec_machdep.c standard -powerpc/powerpc/fpu.c optional aim +powerpc/powerpc/fpu.c standard powerpc/powerpc/fuswintr.c standard powerpc/powerpc/gdb_machdep.c optional gdb powerpc/powerpc/in_cksum.c optional inet | inet6 Modified: stable/10/sys/powerpc/booke/trap.c ============================================================================== --- stable/10/sys/powerpc/booke/trap.c Wed May 14 04:14:58 2014 (r266003) +++ stable/10/sys/powerpc/booke/trap.c Wed May 14 04:42:38 2014 (r266004) @@ -194,6 +194,11 @@ trap(struct trapframe *frame) case EXC_PGM: /* Program exception */ #ifdef FPU_EMU + if (!(td->td_pcb->pcb_flags & PCB_FPREGS)) { + bzero(&td->td_pcb->pcb_fpu, + sizeof(td->td_pcb->pcb_fpu)); + td->td_pcb->pcb_flags |= PCB_FPREGS; + } sig = fpu_emulate(frame, (struct fpreg *)&td->td_pcb->pcb_fpu); #else Modified: stable/10/sys/powerpc/fpu/fpu_emu.c ============================================================================== --- stable/10/sys/powerpc/fpu/fpu_emu.c Wed May 14 04:14:58 2014 (r266003) +++ stable/10/sys/powerpc/fpu/fpu_emu.c Wed May 14 04:42:38 2014 (r266004) @@ -606,9 +606,11 @@ fpu_execute(struct trapframe *tf, struct rb = instr.i_a.i_frb; rc = instr.i_a.i_frc; - type = FTYPE_SNG; - if (instr.i_any.i_opcd & 0x4) - type = FTYPE_DBL; + /* + * All arithmetic operations work on registers, which + * are stored as doubles. + */ + type = FTYPE_DBL; switch ((unsigned int)instr.i_a.i_xo) { case OPC59_FDIVS: FPU_EMU_EVCNT_INCR(fdiv); @@ -725,6 +727,13 @@ fpu_execute(struct trapframe *tf, struct return (NOTFPU); break; } + + /* If the instruction was single precision, round */ + if (!(instr.i_any.i_opcd & 0x4)) { + fpu_implode(fe, fp, FTYPE_SNG, + (u_int *)&fs->fpreg[rt]); + fpu_explode(fe, fp = &fe->fe_f1, FTYPE_SNG, rt); + } } } else { return (NOTFPU); Modified: stable/10/sys/powerpc/fpu/fpu_explode.c ============================================================================== --- stable/10/sys/powerpc/fpu/fpu_explode.c Wed May 14 04:14:58 2014 (r266003) +++ stable/10/sys/powerpc/fpu/fpu_explode.c Wed May 14 04:42:38 2014 (r266004) @@ -235,6 +235,7 @@ fpu_explode(struct fpemu *fe, struct fpn s = fpu_dtof(fp, s, space[1]); break; + default: panic("fpu_explode"); panic("fpu_explode: invalid type %d", type); } Modified: stable/10/sys/powerpc/include/counter.h ============================================================================== --- stable/10/sys/powerpc/include/counter.h Wed May 14 04:14:58 2014 (r266003) +++ stable/10/sys/powerpc/include/counter.h Wed May 14 04:42:38 2014 (r266004) @@ -34,7 +34,7 @@ #include #endif -#if defined(AIM) && defined(__powerpc64__) +#ifdef __powerpc64__ #define counter_enter() do {} while (0) #define counter_exit() do {} while (0) @@ -98,7 +98,7 @@ counter_u64_add(counter_u64_t c, int64_t : "cc", "memory"); } -#else /* !AIM || !64bit */ +#else /* !64bit */ #define counter_enter() critical_enter() #define counter_exit() critical_exit() @@ -157,6 +157,6 @@ counter_u64_add(counter_u64_t c, int64_t counter_exit(); } -#endif /* AIM 64bit */ +#endif /* 64bit */ #endif /* ! __MACHINE_COUNTER_H__ */ Modified: stable/10/sys/powerpc/include/pcb.h ============================================================================== --- stable/10/sys/powerpc/include/pcb.h Wed May 14 04:14:58 2014 (r266003) +++ stable/10/sys/powerpc/include/pcb.h Wed May 14 04:42:38 2014 (r266004) @@ -47,8 +47,9 @@ struct pcb { faultbuf *pcb_onfault; /* For use during copyin/copyout */ int pcb_flags; -#define PCB_FPU 1 /* Process had FPU initialized */ -#define PCB_VEC 2 /* Process had Altivec initialized */ +#define PCB_FPU 1 /* Process uses FPU */ +#define PCB_FPREGS 2 /* Process had FPU registers initialized */ +#define PCB_VEC 4 /* Process had Altivec initialized */ struct fpu { double fpr[32]; double fpscr; /* FPSCR stored as double for easier access */ Modified: stable/10/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/exec_machdep.c Wed May 14 04:14:58 2014 (r266003) +++ stable/10/sys/powerpc/powerpc/exec_machdep.c Wed May 14 04:42:38 2014 (r266004) @@ -381,19 +381,20 @@ grab_mcontext(struct thread *td, mcontex mcp->mc_gpr[4] = 0; } -#ifdef AIM /* * This assumes that floating-point context is *not* lazy, * so if the thread has used FP there would have been a * FP-unavailable exception that would have set things up * correctly. */ - if (pcb->pcb_flags & PCB_FPU) { - KASSERT(td == curthread, - ("get_mcontext: fp save not curthread")); - critical_enter(); - save_fpu(td); - critical_exit(); + if (pcb->pcb_flags & PCB_FPREGS) { + if (pcb->pcb_flags & PCB_FPU) { + KASSERT(td == curthread, + ("get_mcontext: fp save not curthread")); + critical_enter(); + save_fpu(td); + critical_exit(); + } mcp->mc_flags |= _MC_FP_VALID; memcpy(&mcp->mc_fpscr, &pcb->pcb_fpu.fpscr, sizeof(double)); memcpy(mcp->mc_fpreg, pcb->pcb_fpu.fpr, 32*sizeof(double)); @@ -414,7 +415,6 @@ grab_mcontext(struct thread *td, mcontex mcp->mc_vrsave = pcb->pcb_vec.vrsave; memcpy(mcp->mc_avec, pcb->pcb_vec.vr, sizeof(mcp->mc_avec)); } -#endif mcp->mc_len = sizeof(*mcp); @@ -467,13 +467,9 @@ set_mcontext(struct thread *td, const mc else tf->fixreg[2] = tls; -#ifdef AIM if (mcp->mc_flags & _MC_FP_VALID) { - if ((pcb->pcb_flags & PCB_FPU) != PCB_FPU) { - critical_enter(); - enable_fpu(td); - critical_exit(); - } + /* enable_fpu() will happen lazily on a fault */ + pcb->pcb_flags |= PCB_FPREGS; memcpy(&pcb->pcb_fpu.fpscr, &mcp->mc_fpscr, sizeof(double)); memcpy(pcb->pcb_fpu.fpr, mcp->mc_fpreg, 32*sizeof(double)); } @@ -488,7 +484,6 @@ set_mcontext(struct thread *td, const mc pcb->pcb_vec.vrsave = mcp->mc_vrsave; memcpy(pcb->pcb_vec.vr, mcp->mc_avec, sizeof(mcp->mc_avec)); } -#endif return (0); } @@ -625,7 +620,7 @@ fill_fpregs(struct thread *td, struct fp pcb = td->td_pcb; - if ((pcb->pcb_flags & PCB_FPU) == 0) + if ((pcb->pcb_flags & PCB_FPREGS) == 0) memset(fpregs, 0, sizeof(struct fpreg)); else memcpy(fpregs, &pcb->pcb_fpu, sizeof(struct fpreg)); @@ -654,14 +649,11 @@ set_dbregs(struct thread *td, struct dbr int set_fpregs(struct thread *td, struct fpreg *fpregs) { -#ifdef AIM struct pcb *pcb; pcb = td->td_pcb; - if ((pcb->pcb_flags & PCB_FPU) == 0) - enable_fpu(td); + pcb->pcb_flags |= PCB_FPREGS; memcpy(&pcb->pcb_fpu, fpregs, sizeof(struct fpreg)); -#endif return (0); } @@ -1021,14 +1013,10 @@ cpu_set_upcall_kse(struct thread *td, vo tf->fixreg[3] = (register_t)arg; if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { tf->srr0 = (register_t)entry; - #ifdef AIM tf->srr1 = PSL_USERSET | PSL_FE_DFLT; #ifdef __powerpc64__ tf->srr1 &= ~PSL_SF; #endif - #else - tf->srr1 = PSL_USERSET; - #endif } else { #ifdef __powerpc64__ register_t entry_desc[3]; Modified: stable/10/sys/powerpc/powerpc/fpu.c ============================================================================== --- stable/10/sys/powerpc/powerpc/fpu.c Wed May 14 04:14:58 2014 (r266003) +++ stable/10/sys/powerpc/powerpc/fpu.c Wed May 14 04:42:38 2014 (r266004) @@ -66,10 +66,11 @@ enable_fpu(struct thread *td) * initialise the FPU registers and FPSCR to 0, and set the flag * to indicate that the FPU is in use. */ + pcb->pcb_flags |= PCB_FPU; tf->srr1 |= PSL_FP; - if (!(pcb->pcb_flags & PCB_FPU)) { + if (!(pcb->pcb_flags & PCB_FPREGS)) { memset(&pcb->pcb_fpu, 0, sizeof pcb->pcb_fpu); - pcb->pcb_flags |= PCB_FPU; + pcb->pcb_flags |= PCB_FPREGS; } /* Modified: stable/10/sys/powerpc/powerpc/swtch32.S ============================================================================== --- stable/10/sys/powerpc/powerpc/swtch32.S Wed May 14 04:14:58 2014 (r266003) +++ stable/10/sys/powerpc/powerpc/swtch32.S Wed May 14 04:42:38 2014 (r266004) @@ -100,7 +100,6 @@ ENTRY(cpu_switch) mr %r16,%r5 /* and the new lock */ mr %r17,%r6 /* and the PCB */ -#ifdef AIM lwz %r7,PCB_FLAGS(%r17) /* Save FPU context if needed */ andi. %r7, %r7, PCB_FPU @@ -116,7 +115,6 @@ ENTRY(cpu_switch) bl save_vec .L2: -#endif mr %r3,%r14 /* restore old thread ptr */ bl pmap_deactivate /* Deactivate the current pmap */ @@ -143,7 +141,6 @@ blocked_loop: mr %r3,%r2 /* Get new thread ptr */ bl pmap_activate /* Activate the new address space */ -#ifdef AIM lwz %r6, PCB_FLAGS(%r17) /* Restore FPU context if needed */ andi. %r6, %r6, PCB_FPU @@ -160,7 +157,6 @@ blocked_loop: bl enable_vec .L4: -#endif /* thread to restore is in r3 */ mr %r3,%r17 /* Recover PCB ptr */ lmw %r12,PCB_CONTEXT(%r3) /* Load the non-volatile GP regs */ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 04:57:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6B90AEEA; Wed, 14 May 2014 04:57: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 4D6CC27B1; Wed, 14 May 2014 04:57: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 s4E4vv87011385; Wed, 14 May 2014 04:57:57 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E4vt5T011373; Wed, 14 May 2014 04:57:55 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405140457.s4E4vt5T011373@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 04:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266005 - in stable/10/sys: conf dev/uart powerpc/aim powerpc/booke powerpc/fpu powerpc/include powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 04:57:57 -0000 Author: ian Date: Wed May 14 04:57:55 2014 New Revision: 266005 URL: http://svnweb.freebsd.org/changeset/base/266005 Log: MFC r258259, r258798, r259010 Unify handling of illegal instruction faults between AIM and Book-E. Make uart_cpu_powerpc work on both FDT and OFW systems. Fix debug printfs in FPU_EMU to compile on powerpc64 and enable it for powerpc64. Modified: stable/10/sys/conf/files.powerpc stable/10/sys/dev/uart/uart_cpu_powerpc.c stable/10/sys/powerpc/aim/trap.c stable/10/sys/powerpc/booke/trap.c stable/10/sys/powerpc/fpu/fpu_emu.c stable/10/sys/powerpc/include/trap.h stable/10/sys/powerpc/powerpc/exec_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Wed May 14 04:42:38 2014 (r266004) +++ stable/10/sys/conf/files.powerpc Wed May 14 04:57:55 2014 (r266005) @@ -65,8 +65,7 @@ dev/syscons/scterm-teken.c optional sc dev/syscons/scvtb.c optional sc dev/tsec/if_tsec.c optional tsec dev/tsec/if_tsec_fdt.c optional tsec fdt -dev/uart/uart_cpu_fdt.c optional uart fdt -dev/uart/uart_cpu_powerpc.c optional uart aim +dev/uart/uart_cpu_powerpc.c optional uart dev/usb/controller/ehci_fsl.c optional ehci mpc85xx dev/vt/hw/ofwfb/ofwfb.c optional vt aim kern/kern_clocksource.c standard @@ -111,15 +110,15 @@ powerpc/booke/trap.c optional booke powerpc/cpufreq/dfs.c optional cpufreq powerpc/cpufreq/pcr.c optional cpufreq aim powerpc/cpufreq/pmufreq.c optional cpufreq aim pmu -powerpc/fpu/fpu_add.c optional fpu_emu powerpc -powerpc/fpu/fpu_compare.c optional fpu_emu powerpc -powerpc/fpu/fpu_div.c optional fpu_emu powerpc -powerpc/fpu/fpu_emu.c optional fpu_emu powerpc -powerpc/fpu/fpu_explode.c optional fpu_emu powerpc -powerpc/fpu/fpu_implode.c optional fpu_emu powerpc -powerpc/fpu/fpu_mul.c optional fpu_emu powerpc -powerpc/fpu/fpu_sqrt.c optional fpu_emu powerpc -powerpc/fpu/fpu_subr.c optional fpu_emu powerpc +powerpc/fpu/fpu_add.c optional fpu_emu +powerpc/fpu/fpu_compare.c optional fpu_emu +powerpc/fpu/fpu_div.c optional fpu_emu +powerpc/fpu/fpu_emu.c optional fpu_emu +powerpc/fpu/fpu_explode.c optional fpu_emu +powerpc/fpu/fpu_implode.c optional fpu_emu +powerpc/fpu/fpu_mul.c optional fpu_emu +powerpc/fpu/fpu_sqrt.c optional fpu_emu +powerpc/fpu/fpu_subr.c optional fpu_emu powerpc/mambo/mambocall.S optional mambo powerpc/mambo/mambo.c optional mambo powerpc/mambo/mambo_console.c optional mambo Modified: stable/10/sys/dev/uart/uart_cpu_powerpc.c ============================================================================== --- stable/10/sys/dev/uart/uart_cpu_powerpc.c Wed May 14 04:42:38 2014 (r266004) +++ stable/10/sys/dev/uart/uart_cpu_powerpc.c Wed May 14 04:57:55 2014 (r266005) @@ -61,42 +61,96 @@ ofw_get_uart_console(phandle_t opts, pha input = OF_finddevice(buf); if (input == -1) return (ENXIO); - if (OF_getprop(opts, outputdev, buf, sizeof(buf)) == -1) - return (ENXIO); - if (OF_finddevice(buf) != input) - return (ENXIO); + + if (outputdev != NULL) { + if (OF_getprop(opts, outputdev, buf, sizeof(buf)) == -1) + return (ENXIO); + if (OF_finddevice(buf) != input) + return (ENXIO); + } *result = input; return (0); } +static int +ofw_get_console_phandle_path(phandle_t node, phandle_t *result, + const char *prop) +{ + union { + char buf[64]; + phandle_t ref; + } field; + phandle_t output; + ssize_t size; + + size = OF_getproplen(node, prop); + if (size == -1) + return (ENXIO); + OF_getprop(node, prop, &field, sizeof(field)); + + /* This property might be a phandle or might be a path. Hooray. */ + + output = -1; + if (field.buf[size - 1] == 0) + output = OF_finddevice(field.buf); + if (output == -1 && size == 4) + output = OF_xref_phandle(field.ref); + + if (output != -1) { + *result = output; + return (0); + } + + return (ENXIO); +} + int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { char buf[64]; struct uart_class *class; - phandle_t input, opts; + phandle_t input, opts, chosen; int error; class = &uart_z8530_class; if (class == NULL) return (ENXIO); - if ((opts = OF_finddevice("/options")) == -1) - return (ENXIO); + opts = OF_finddevice("/options"); + chosen = OF_finddevice("/chosen"); switch (devtype) { case UART_DEV_CONSOLE: - if (ofw_get_uart_console(opts, &input, "input-device", - "output-device")) { - /* - * At least some G5 Xserves require that we - * probe input-device-1 as well - */ - - if (ofw_get_uart_console(opts, &input, "input-device-1", - "output-device-1")) - return (ENXIO); + error = ENXIO; + if (chosen != -1 && error != 0) + error = ofw_get_uart_console(chosen, &input, + "stdout-path", NULL); + if (chosen != -1 && error != 0) + error = ofw_get_uart_console(chosen, &input, + "linux,stdout-path", NULL); + if (chosen != -1 && error != 0) + error = ofw_get_console_phandle_path(chosen, &input, + "stdout"); + if (chosen != -1 && error != 0) + error = ofw_get_uart_console(chosen, &input, + "stdin-path", NULL); + if (chosen != -1 && error != 0) + error = ofw_get_console_phandle_path(chosen, &input, + "stdin"); + if (opts != -1 && error != 0) + error = ofw_get_uart_console(opts, &input, + "input-device", "output-device"); + if (opts != -1 && error != 0) + error = ofw_get_uart_console(opts, &input, + "input-device-1", "output-device-1"); + if (error != 0) { + input = OF_finddevice("serial0"); /* Last ditch */ + if (input == -1) + error = (ENXIO); } + + if (error != 0) + return (error); break; case UART_DEV_DBGPORT: if (!getenv_string("hw.uart.dbgport", buf, sizeof(buf))) @@ -113,14 +167,14 @@ uart_cpu_getdev(int devtype, struct uart return (ENXIO); if (strcmp(buf, "serial") != 0) return (ENXIO); - if (OF_getprop(input, "name", buf, sizeof(buf)) == -1) + if (OF_getprop(input, "compatible", buf, sizeof(buf)) == -1) return (ENXIO); - if (strcmp(buf, "ch-a") == 0) { + if (strncmp(buf, "chrp,es", 7) == 0) { class = &uart_z8530_class; di->bas.regshft = 4; di->bas.chan = 1; - } else if (strcmp(buf,"serial") == 0) { + } else if (strcmp(buf,"ns16550") == 0 || strcmp(buf,"ns8250") == 0) { class = &uart_ns8250_class; di->bas.regshft = 0; di->bas.chan = 0; @@ -139,9 +193,12 @@ uart_cpu_getdev(int devtype, struct uart if (OF_getprop(input, "current-speed", &di->baudrate, sizeof(di->baudrate)) == -1) di->baudrate = 0; + OF_getprop(input, "reg-shift", &di->bas.regshft, + sizeof(di->bas.regshft)); di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; return (0); } + Modified: stable/10/sys/powerpc/aim/trap.c ============================================================================== --- stable/10/sys/powerpc/aim/trap.c Wed May 14 04:42:38 2014 (r266004) +++ stable/10/sys/powerpc/aim/trap.c Wed May 14 04:57:55 2014 (r266005) @@ -80,7 +80,6 @@ static void printtrap(u_int vector, stru int user); static int trap_pfault(struct trapframe *frame, int user); static int fix_unaligned(struct thread *td, struct trapframe *frame); -static int ppc_instr_emulate(struct trapframe *frame); static int handle_onfault(struct trapframe *frame); static void syscall(struct trapframe *frame); @@ -292,10 +291,9 @@ trap(struct trapframe *frame) } #endif sig = SIGTRAP; - } else if (ppc_instr_emulate(frame) == 0) - frame->srr0 += 4; - else - sig = SIGILL; + } else { + sig = ppc_instr_emulate(frame, td->td_pcb); + } break; default: @@ -800,20 +798,3 @@ fix_unaligned(struct thread *td, struct return -1; } -static int -ppc_instr_emulate(struct trapframe *frame) -{ - uint32_t instr; - int reg; - - instr = fuword32((void *)frame->srr0); - - if ((instr & 0xfc1fffff) == 0x7c1f42a6) { /* mfpvr */ - reg = (instr & ~0xfc1fffff) >> 21; - frame->fixreg[reg] = mfpvr(); - return (0); - } - - return (-1); -} - Modified: stable/10/sys/powerpc/booke/trap.c ============================================================================== --- stable/10/sys/powerpc/booke/trap.c Wed May 14 04:42:38 2014 (r266004) +++ stable/10/sys/powerpc/booke/trap.c Wed May 14 04:57:55 2014 (r266005) @@ -71,10 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef FPU_EMU -#include -#endif - #define FAULTBUF_LR 0 #define FAULTBUF_R1 1 #define FAULTBUF_R2 2 @@ -193,18 +189,7 @@ trap(struct trapframe *frame) break; case EXC_PGM: /* Program exception */ -#ifdef FPU_EMU - if (!(td->td_pcb->pcb_flags & PCB_FPREGS)) { - bzero(&td->td_pcb->pcb_fpu, - sizeof(td->td_pcb->pcb_fpu)); - td->td_pcb->pcb_flags |= PCB_FPREGS; - } - sig = fpu_emulate(frame, - (struct fpreg *)&td->td_pcb->pcb_fpu); -#else - /* XXX SIGILL for non-trap instructions. */ - sig = SIGTRAP; -#endif + sig = ppc_instr_emulate(frame, td->td_pcb); break; default: Modified: stable/10/sys/powerpc/fpu/fpu_emu.c ============================================================================== --- stable/10/sys/powerpc/fpu/fpu_emu.c Wed May 14 04:42:38 2014 (r266004) +++ stable/10/sys/powerpc/fpu/fpu_emu.c Wed May 14 04:57:55 2014 (r266005) @@ -326,8 +326,10 @@ fpu_execute(struct trapframe *tf, struct /* Store as integer */ ra = instr.i_x.i_ra; rb = instr.i_x.i_rb; - DPRINTF(FPE_INSN, ("reg %d has %x reg %d has %x\n", - ra, tf->fixreg[ra], rb, tf->fixreg[rb])); + DPRINTF(FPE_INSN, + ("reg %d has %jx reg %d has %jx\n", + ra, (uintmax_t)tf->fixreg[ra], rb, + (uintmax_t)tf->fixreg[rb])); addr = tf->fixreg[rb]; if (ra != 0) @@ -356,8 +358,9 @@ fpu_execute(struct trapframe *tf, struct /* calculate EA of load/store */ ra = instr.i_x.i_ra; rb = instr.i_x.i_rb; - DPRINTF(FPE_INSN, ("reg %d has %x reg %d has %x\n", - ra, tf->fixreg[ra], rb, tf->fixreg[rb])); + DPRINTF(FPE_INSN, ("reg %d has %jx reg %d has %jx\n", + ra, (uintmax_t)tf->fixreg[ra], rb, + (uintmax_t)tf->fixreg[rb])); addr = tf->fixreg[rb]; if (ra != 0) addr += tf->fixreg[ra]; @@ -373,8 +376,9 @@ fpu_execute(struct trapframe *tf, struct /* calculate EA of load/store */ ra = instr.i_d.i_ra; addr = instr.i_d.i_d; - DPRINTF(FPE_INSN, ("reg %d has %x displ %x\n", - ra, tf->fixreg[ra], addr)); + DPRINTF(FPE_INSN, ("reg %d has %jx displ %jx\n", + ra, (uintmax_t)tf->fixreg[ra], + (uintmax_t)addr)); if (ra != 0) addr += tf->fixreg[ra]; rt = instr.i_d.i_rt; @@ -420,7 +424,7 @@ fpu_execute(struct trapframe *tf, struct return (0); #ifdef notyet } else if (instr.i_any.i_opcd == OPC_load_st_62) { - /* These are 64-bit extenstions */ + /* These are 64-bit extensions */ return (NOTFPU); #endif } else if (instr.i_any.i_opcd == OPC_sp_fp_59 || @@ -784,7 +788,8 @@ fpu_execute(struct trapframe *tf, struct /* Move fpu condition codes to cr[1] */ tf->cr &= ~(0xf0000000>>bf); tf->cr |= (cond>>bf); - DPRINTF(FPE_INSN, ("fpu_execute: cr[%d] (cr=%x) <= %x\n", bf/4, tf->cr, cond)); + DPRINTF(FPE_INSN, ("fpu_execute: cr[%d] (cr=%jx) <= %x\n", + bf/4, (uintmax_t)tf->cr, cond)); } ((int *)&fs->fpscr)[1] = fsr; Modified: stable/10/sys/powerpc/include/trap.h ============================================================================== --- stable/10/sys/powerpc/include/trap.h Wed May 14 04:42:38 2014 (r266004) +++ stable/10/sys/powerpc/include/trap.h Wed May 14 04:57:55 2014 (r266005) @@ -122,7 +122,9 @@ #ifndef LOCORE struct trapframe; +struct pcb; void trap(struct trapframe *); +int ppc_instr_emulate(struct trapframe *, struct pcb *); #endif #endif /* _POWERPC_TRAP_H_ */ Modified: stable/10/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/exec_machdep.c Wed May 14 04:42:38 2014 (r266004) +++ stable/10/sys/powerpc/powerpc/exec_machdep.c Wed May 14 04:57:55 2014 (r266005) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#include "opt_fpu_emu.h" #include #include @@ -92,6 +93,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FPU_EMU +#include +#endif + #ifdef COMPAT_FREEBSD32 #include #include @@ -1038,3 +1043,36 @@ cpu_set_upcall_kse(struct thread *td, vo td->td_retval[1] = 0; } +int +ppc_instr_emulate(struct trapframe *frame, struct pcb *pcb) +{ + uint32_t instr; + int reg, sig; + + instr = fuword32((void *)frame->srr0); + sig = SIGILL; + + if ((instr & 0xfc1fffff) == 0x7c1f42a6) { /* mfpvr */ + reg = (instr & ~0xfc1fffff) >> 21; + frame->fixreg[reg] = mfpvr(); + frame->srr0 += 4; + return (0); + } + + if ((instr & 0xfc000ffe) == 0x7c0004ac) { /* various sync */ + powerpc_sync(); /* Do a heavy-weight sync */ + frame->srr0 += 4; + return (0); + } + +#ifdef FPU_EMU + if (!(pcb->pcb_flags & PCB_FPREGS)) { + bzero(&pcb->pcb_fpu, sizeof(pcb->pcb_fpu)); + pcb->pcb_flags |= PCB_FPREGS; + } + sig = fpu_emulate(frame, (struct fpreg *)&pcb->pcb_fpu); +#endif + + return (sig); +} + From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 09:12:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 616CE624; Wed, 14 May 2014 09:12: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 433D12B52; Wed, 14 May 2014 09:12: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 s4E9C2iQ025347; Wed, 14 May 2014 09:12:02 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E9C2Fj025346; Wed, 14 May 2014 09:12:02 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405140912.s4E9C2Fj025346@svn.freebsd.org> From: Steven Hartland Date: Wed, 14 May 2014 09:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266008 - stable/10/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 09:12:02 -0000 Author: smh Date: Wed May 14 09:12:01 2014 New Revision: 266008 URL: http://svnweb.freebsd.org/changeset/base/266008 Log: MFC r265149 Make uninteresting PCI devices with no attached drivers only print out on a verbose boot. Sponsored by: Multiplay Modified: stable/10/sys/dev/pci/pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Wed May 14 09:03:02 2014 (r266007) +++ stable/10/sys/dev/pci/pci.c Wed May 14 09:12:01 2014 (r266008) @@ -3726,105 +3726,107 @@ static const struct { int class; int subclass; + int report; /* 0 = bootverbose, 1 = always */ const char *desc; } pci_nomatch_tab[] = { - {PCIC_OLD, -1, "old"}, - {PCIC_OLD, PCIS_OLD_NONVGA, "non-VGA display device"}, - {PCIC_OLD, PCIS_OLD_VGA, "VGA-compatible display device"}, - {PCIC_STORAGE, -1, "mass storage"}, - {PCIC_STORAGE, PCIS_STORAGE_SCSI, "SCSI"}, - {PCIC_STORAGE, PCIS_STORAGE_IDE, "ATA"}, - {PCIC_STORAGE, PCIS_STORAGE_FLOPPY, "floppy disk"}, - {PCIC_STORAGE, PCIS_STORAGE_IPI, "IPI"}, - {PCIC_STORAGE, PCIS_STORAGE_RAID, "RAID"}, - {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, - {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, - {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, - {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM"}, - {PCIC_NETWORK, -1, "network"}, - {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, - {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, - {PCIC_NETWORK, PCIS_NETWORK_FDDI, "fddi"}, - {PCIC_NETWORK, PCIS_NETWORK_ATM, "ATM"}, - {PCIC_NETWORK, PCIS_NETWORK_ISDN, "ISDN"}, - {PCIC_DISPLAY, -1, "display"}, - {PCIC_DISPLAY, PCIS_DISPLAY_VGA, "VGA"}, - {PCIC_DISPLAY, PCIS_DISPLAY_XGA, "XGA"}, - {PCIC_DISPLAY, PCIS_DISPLAY_3D, "3D"}, - {PCIC_MULTIMEDIA, -1, "multimedia"}, - {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_VIDEO, "video"}, - {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_AUDIO, "audio"}, - {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_TELE, "telephony"}, - {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_HDA, "HDA"}, - {PCIC_MEMORY, -1, "memory"}, - {PCIC_MEMORY, PCIS_MEMORY_RAM, "RAM"}, - {PCIC_MEMORY, PCIS_MEMORY_FLASH, "flash"}, - {PCIC_BRIDGE, -1, "bridge"}, - {PCIC_BRIDGE, PCIS_BRIDGE_HOST, "HOST-PCI"}, - {PCIC_BRIDGE, PCIS_BRIDGE_ISA, "PCI-ISA"}, - {PCIC_BRIDGE, PCIS_BRIDGE_EISA, "PCI-EISA"}, - {PCIC_BRIDGE, PCIS_BRIDGE_MCA, "PCI-MCA"}, - {PCIC_BRIDGE, PCIS_BRIDGE_PCI, "PCI-PCI"}, - {PCIC_BRIDGE, PCIS_BRIDGE_PCMCIA, "PCI-PCMCIA"}, - {PCIC_BRIDGE, PCIS_BRIDGE_NUBUS, "PCI-NuBus"}, - {PCIC_BRIDGE, PCIS_BRIDGE_CARDBUS, "PCI-CardBus"}, - {PCIC_BRIDGE, PCIS_BRIDGE_RACEWAY, "PCI-RACEway"}, - {PCIC_SIMPLECOMM, -1, "simple comms"}, - {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_UART, "UART"}, /* could detect 16550 */ - {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_PAR, "parallel port"}, - {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_MULSER, "multiport serial"}, - {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_MODEM, "generic modem"}, - {PCIC_BASEPERIPH, -1, "base peripheral"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PIC, "interrupt controller"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_DMA, "DMA controller"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_TIMER, "timer"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, "realtime clock"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, "SD host controller"}, - {PCIC_INPUTDEV, -1, "input device"}, - {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"}, - {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"}, - {PCIC_INPUTDEV, PCIS_INPUTDEV_MOUSE, "mouse"}, - {PCIC_INPUTDEV, PCIS_INPUTDEV_SCANNER, "scanner"}, - {PCIC_INPUTDEV, PCIS_INPUTDEV_GAMEPORT, "gameport"}, - {PCIC_DOCKING, -1, "docking station"}, - {PCIC_PROCESSOR, -1, "processor"}, - {PCIC_SERIALBUS, -1, "serial bus"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_FW, "FireWire"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_ACCESS, "AccessBus"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_SSA, "SSA"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_USB, "USB"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_FC, "Fibre Channel"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_SMBUS, "SMBus"}, - {PCIC_WIRELESS, -1, "wireless controller"}, - {PCIC_WIRELESS, PCIS_WIRELESS_IRDA, "iRDA"}, - {PCIC_WIRELESS, PCIS_WIRELESS_IR, "IR"}, - {PCIC_WIRELESS, PCIS_WIRELESS_RF, "RF"}, - {PCIC_INTELLIIO, -1, "intelligent I/O controller"}, - {PCIC_INTELLIIO, PCIS_INTELLIIO_I2O, "I2O"}, - {PCIC_SATCOM, -1, "satellite communication"}, - {PCIC_SATCOM, PCIS_SATCOM_TV, "sat TV"}, - {PCIC_SATCOM, PCIS_SATCOM_AUDIO, "sat audio"}, - {PCIC_SATCOM, PCIS_SATCOM_VOICE, "sat voice"}, - {PCIC_SATCOM, PCIS_SATCOM_DATA, "sat data"}, - {PCIC_CRYPTO, -1, "encrypt/decrypt"}, - {PCIC_CRYPTO, PCIS_CRYPTO_NETCOMP, "network/computer crypto"}, - {PCIC_CRYPTO, PCIS_CRYPTO_ENTERTAIN, "entertainment crypto"}, - {PCIC_DASP, -1, "dasp"}, - {PCIC_DASP, PCIS_DASP_DPIO, "DPIO module"}, - {0, 0, NULL} + {PCIC_OLD, -1, 1, "old"}, + {PCIC_OLD, PCIS_OLD_NONVGA, 1, "non-VGA display device"}, + {PCIC_OLD, PCIS_OLD_VGA, 1, "VGA-compatible display device"}, + {PCIC_STORAGE, -1, 1, "mass storage"}, + {PCIC_STORAGE, PCIS_STORAGE_SCSI, 1, "SCSI"}, + {PCIC_STORAGE, PCIS_STORAGE_IDE, 1, "ATA"}, + {PCIC_STORAGE, PCIS_STORAGE_FLOPPY, 1, "floppy disk"}, + {PCIC_STORAGE, PCIS_STORAGE_IPI, 1, "IPI"}, + {PCIC_STORAGE, PCIS_STORAGE_RAID, 1, "RAID"}, + {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, 1, "ATA (ADMA)"}, + {PCIC_STORAGE, PCIS_STORAGE_SATA, 1, "SATA"}, + {PCIC_STORAGE, PCIS_STORAGE_SAS, 1, "SAS"}, + {PCIC_STORAGE, PCIS_STORAGE_NVM, 1, "NVM"}, + {PCIC_NETWORK, -1, 1, "network"}, + {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, 1, "ethernet"}, + {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, 1, "token ring"}, + {PCIC_NETWORK, PCIS_NETWORK_FDDI, 1, "fddi"}, + {PCIC_NETWORK, PCIS_NETWORK_ATM, 1, "ATM"}, + {PCIC_NETWORK, PCIS_NETWORK_ISDN, 1, "ISDN"}, + {PCIC_DISPLAY, -1, 1, "display"}, + {PCIC_DISPLAY, PCIS_DISPLAY_VGA, 1, "VGA"}, + {PCIC_DISPLAY, PCIS_DISPLAY_XGA, 1, "XGA"}, + {PCIC_DISPLAY, PCIS_DISPLAY_3D, 1, "3D"}, + {PCIC_MULTIMEDIA, -1, 1, "multimedia"}, + {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_VIDEO, 1, "video"}, + {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_AUDIO, 1, "audio"}, + {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_TELE, 1, "telephony"}, + {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_HDA, 1, "HDA"}, + {PCIC_MEMORY, -1, 1, "memory"}, + {PCIC_MEMORY, PCIS_MEMORY_RAM, 1, "RAM"}, + {PCIC_MEMORY, PCIS_MEMORY_FLASH, 1, "flash"}, + {PCIC_BRIDGE, -1, 1, "bridge"}, + {PCIC_BRIDGE, PCIS_BRIDGE_HOST, 1, "HOST-PCI"}, + {PCIC_BRIDGE, PCIS_BRIDGE_ISA, 1, "PCI-ISA"}, + {PCIC_BRIDGE, PCIS_BRIDGE_EISA, 1, "PCI-EISA"}, + {PCIC_BRIDGE, PCIS_BRIDGE_MCA, 1, "PCI-MCA"}, + {PCIC_BRIDGE, PCIS_BRIDGE_PCI, 1, "PCI-PCI"}, + {PCIC_BRIDGE, PCIS_BRIDGE_PCMCIA, 1, "PCI-PCMCIA"}, + {PCIC_BRIDGE, PCIS_BRIDGE_NUBUS, 1, "PCI-NuBus"}, + {PCIC_BRIDGE, PCIS_BRIDGE_CARDBUS, 1, "PCI-CardBus"}, + {PCIC_BRIDGE, PCIS_BRIDGE_RACEWAY, 1, "PCI-RACEway"}, + {PCIC_SIMPLECOMM, -1, 1, "simple comms"}, + {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_UART, 1, "UART"}, /* could detect 16550 */ + {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_PAR, 1, "parallel port"}, + {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_MULSER, 1, "multiport serial"}, + {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_MODEM, 1, "generic modem"}, + {PCIC_BASEPERIPH, -1, 0, "base peripheral"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PIC, 1, "interrupt controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_DMA, 1, "DMA controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_TIMER, 1, "timer"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, 1, "realtime clock"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, 1, "PCI hot-plug controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, 1, "SD host controller"}, + {PCIC_INPUTDEV, -1, 1, "input device"}, + {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, 1, "keyboard"}, + {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,1, "digitizer"}, + {PCIC_INPUTDEV, PCIS_INPUTDEV_MOUSE, 1, "mouse"}, + {PCIC_INPUTDEV, PCIS_INPUTDEV_SCANNER, 1, "scanner"}, + {PCIC_INPUTDEV, PCIS_INPUTDEV_GAMEPORT, 1, "gameport"}, + {PCIC_DOCKING, -1, 1, "docking station"}, + {PCIC_PROCESSOR, -1, 1, "processor"}, + {PCIC_SERIALBUS, -1, 1, "serial bus"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_FW, 1, "FireWire"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_ACCESS, 1, "AccessBus"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_SSA, 1, "SSA"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_USB, 1, "USB"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_FC, 1, "Fibre Channel"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_SMBUS, 0, "SMBus"}, + {PCIC_WIRELESS, -1, 1, "wireless controller"}, + {PCIC_WIRELESS, PCIS_WIRELESS_IRDA, 1, "iRDA"}, + {PCIC_WIRELESS, PCIS_WIRELESS_IR, 1, "IR"}, + {PCIC_WIRELESS, PCIS_WIRELESS_RF, 1, "RF"}, + {PCIC_INTELLIIO, -1, 1, "intelligent I/O controller"}, + {PCIC_INTELLIIO, PCIS_INTELLIIO_I2O, 1, "I2O"}, + {PCIC_SATCOM, -1, 1, "satellite communication"}, + {PCIC_SATCOM, PCIS_SATCOM_TV, 1, "sat TV"}, + {PCIC_SATCOM, PCIS_SATCOM_AUDIO, 1, "sat audio"}, + {PCIC_SATCOM, PCIS_SATCOM_VOICE, 1, "sat voice"}, + {PCIC_SATCOM, PCIS_SATCOM_DATA, 1, "sat data"}, + {PCIC_CRYPTO, -1, 1, "encrypt/decrypt"}, + {PCIC_CRYPTO, PCIS_CRYPTO_NETCOMP, 1, "network/computer crypto"}, + {PCIC_CRYPTO, PCIS_CRYPTO_ENTERTAIN, 1, "entertainment crypto"}, + {PCIC_DASP, -1, 0, "dasp"}, + {PCIC_DASP, PCIS_DASP_DPIO, 1, "DPIO module"}, + {0, 0, 0, NULL} }; void pci_probe_nomatch(device_t dev, device_t child) { - int i; + int i, report; const char *cp, *scp; char *device; /* * Look for a listing for this device in a loaded device database. */ + report = 1; if ((device = pci_describe_device(child)) != NULL) { device_printf(dev, "<%s>", device); free(device, M_DEVBUF); @@ -3839,19 +3841,25 @@ pci_probe_nomatch(device_t dev, device_t if (pci_nomatch_tab[i].class == pci_get_class(child)) { if (pci_nomatch_tab[i].subclass == -1) { cp = pci_nomatch_tab[i].desc; + report = pci_nomatch_tab[i].report; } else if (pci_nomatch_tab[i].subclass == pci_get_subclass(child)) { scp = pci_nomatch_tab[i].desc; + report = pci_nomatch_tab[i].report; } } } - device_printf(dev, "<%s%s%s>", - cp ? cp : "", - ((cp != NULL) && (scp != NULL)) ? ", " : "", - scp ? scp : ""); + if (report || bootverbose) { + device_printf(dev, "<%s%s%s>", + cp ? cp : "", + ((cp != NULL) && (scp != NULL)) ? ", " : "", + scp ? scp : ""); + } + } + if (report || bootverbose) { + printf(" at device %d.%d (no driver attached)\n", + pci_get_slot(child), pci_get_function(child)); } - printf(" at device %d.%d (no driver attached)\n", - pci_get_slot(child), pci_get_function(child)); pci_cfg_save(child, device_get_ivars(child), 1); } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 13:47:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5B6CE6CB; Wed, 14 May 2014 13:47: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 4700C2132; Wed, 14 May 2014 13:47: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 s4EDlp0X046486; Wed, 14 May 2014 13:47:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EDlotT046483; Wed, 14 May 2014 13:47:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405141347.s4EDlotT046483@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 May 2014 13:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266014 - stable/10/sbin/gvinum X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 13:47:51 -0000 Author: marius Date: Wed May 14 13:47:50 2014 New Revision: 266014 URL: http://svnweb.freebsd.org/changeset/base/266014 Log: MFC: r265454 - Allow foot shooting with the resetconfig command via the -f option. - Fix typos preventing -f to actually work with the create command. - Initialize flags to zero rather than using stack garbage when handling the grow command. Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sbin/gvinum/gvinum.8 stable/10/sbin/gvinum/gvinum.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/gvinum/gvinum.8 ============================================================================== --- stable/10/sbin/gvinum/gvinum.8 Wed May 14 13:45:51 2014 (r266013) +++ stable/10/sbin/gvinum/gvinum.8 Wed May 14 13:47:50 2014 (r266014) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2013 +.Dd May 6, 2014 .Dt GVINUM 8 .Os .Sh NAME @@ -168,7 +168,7 @@ the beginning of the plex if the .Fl f flag is specified, or otherwise at the location of the parity check pointer. All subdisks in the plex must be up for a parity check. -.It Ic resetconfig +.It Ic resetconfig Oo Fl f Oc Reset the complete .Nm configuration. Modified: stable/10/sbin/gvinum/gvinum.c ============================================================================== --- stable/10/sbin/gvinum/gvinum.c Wed May 14 13:45:51 2014 (r266013) +++ stable/10/sbin/gvinum/gvinum.c Wed May 14 13:47:50 2014 (r266014) @@ -71,7 +71,7 @@ void gvinum_parityop(int, char **, int); void gvinum_printconfig(int, char **); void gvinum_raid5(int, char **); void gvinum_rename(int, char **); -void gvinum_resetconfig(void); +void gvinum_resetconfig(int, char **); void gvinum_rm(int, char **); void gvinum_saveconfig(void); void gvinum_setstate(int, char **); @@ -193,8 +193,8 @@ gvinum_create(int argc, char **argv) flags |= GV_FLAG_F; /* Else it must be a file. */ } else { - if ((tmp = fopen(argv[1], "r")) == NULL) { - warn("can't open '%s' for reading", argv[1]); + if ((tmp = fopen(argv[i], "r")) == NULL) { + warn("can't open '%s' for reading", argv[i]); return; } } @@ -720,7 +720,7 @@ gvinum_help(void) " Change the name of the specified object.\n" "rebuildparity plex [-f]\n" " Rebuild the parity blocks of a RAID-5 plex.\n" - "resetconfig\n" + "resetconfig [-f]\n" " Reset the complete gvinum configuration\n" "rm [-r] [-f] volume | plex | subdisk | drive\n" " Remove an object.\n" @@ -1099,26 +1099,40 @@ gvinum_rm(int argc, char **argv) } void -gvinum_resetconfig(void) +gvinum_resetconfig(int argc, char **argv) { struct gctl_req *req; const char *errstr; char reply[32]; + int flags, i; - if (!isatty(STDIN_FILENO)) { - warn("Please enter this command from a tty device\n"); - return; + flags = 0; + while ((i = getopt(argc, argv, "f")) != -1) { + switch (i) { + case 'f': + flags |= GV_FLAG_F; + break; + default: + warn("invalid flag: %c", i); + return; + } } - printf(" WARNING! This command will completely wipe out your gvinum" - "configuration.\n" - " All data will be lost. If you really want to do this," - " enter the text\n\n" - " NO FUTURE\n" - " Enter text -> "); - fgets(reply, sizeof(reply), stdin); - if (strcmp(reply, "NO FUTURE\n")) { - printf("\n No change\n"); - return; + if ((flags & GV_FLAG_F) == 0) { + if (!isatty(STDIN_FILENO)) { + warn("Please enter this command from a tty device\n"); + return; + } + printf(" WARNING! This command will completely wipe out" + " your gvinum configuration.\n" + " All data will be lost. If you really want to do this," + " enter the text\n\n" + " NO FUTURE\n" + " Enter text -> "); + fgets(reply, sizeof(reply), stdin); + if (strcmp(reply, "NO FUTURE\n")) { + printf("\n No change\n"); + return; + } } req = gctl_get_handle(); gctl_ro_param(req, "class", -1, "VINUM"); @@ -1259,6 +1273,7 @@ gvinum_grow(int argc, char **argv) const char *errstr; int drives, volumes, plexes, subdisks, flags; + flags = 0; drives = volumes = plexes = subdisks = 0; if (argc < 3) { warnx("usage:\tgrow plex drive\n"); @@ -1369,7 +1384,7 @@ parseline(int argc, char **argv) else if (!strcmp(argv[0], "rename")) gvinum_rename(argc, argv); else if (!strcmp(argv[0], "resetconfig")) - gvinum_resetconfig(); + gvinum_resetconfig(argc, argv); else if (!strcmp(argv[0], "rm")) gvinum_rm(argc, argv); else if (!strcmp(argv[0], "saveconfig")) From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 13:54:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4372ED6D; Wed, 14 May 2014 13:54:08 +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 2F0A321FA; Wed, 14 May 2014 13:54:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EDs8LW050537; Wed, 14 May 2014 13:54:08 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EDs8tH050536; Wed, 14 May 2014 13:54:08 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405141354.s4EDs8tH050536@svn.freebsd.org> From: Christian Brueffer Date: Wed, 14 May 2014 13:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266017 - stable/10/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 13:54:08 -0000 Author: brueffer Date: Wed May 14 13:54:07 2014 New Revision: 266017 URL: http://svnweb.freebsd.org/changeset/base/266017 Log: MFC: r265362 Mention the axge(4) driver in the hardware notes. Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Wed May 14 13:48:29 2014 (r266016) +++ stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Wed May 14 13:54:07 2014 (r266017) @@ -821,6 +821,9 @@ &hwlist.axe; + ASIX Electronics AX88178A/AX88179 USB Gigabit Ethernet + adapters (&man.axge.4; driver) + &hwlist.bce; [&arch.amd64;, &arch.i386;] Broadcom BCM4401 based Fast From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 14:08:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 336895E0; Wed, 14 May 2014 14:08: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 1DE5B237A; Wed, 14 May 2014 14:08: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 s4EE8mAl056070; Wed, 14 May 2014 14:08:48 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EE8joX056047; Wed, 14 May 2014 14:08:45 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141408.s4EE8joX056047@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 14:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266019 - in stable/10/sys/powerpc: aim booke ofw powermac pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 14:08:48 -0000 Author: ian Date: Wed May 14 14:08:45 2014 New Revision: 266019 URL: http://svnweb.freebsd.org/changeset/base/266019 Log: MFC r258268, r258271, r258272, r258274, r258275, r258427, r258694, r258696, r258697, r258757 Do not assume a value for #address-cells when parsing the OF translations map. This allows the kernel to get farther with OpenBIOS on 64-bit CPUs. Actually look up #address-cells instead of assuming it is correlated with the Uninorth version number. #interrupt-cells belongs to the iparent, not the device parent. Add a sysctl to allow disabling resetting the OF syscons. For PCI<->PCI bridges, #address-cells may be 3. Make RTAS calls, which call setfault() to recover from machine checks, preserve any existing fault buffer. badaddr() is used only in the grackle PCI driver, so move its definition there. Clean up a spurious setfault() declaration as well. This [phyp_console] driver doesn't need the /options node, so don't check for it. Use the Open Firmware-based CPU frequency determination as a generic fallback if we can't measure CPU frequency. This is also useful on a variety of embedded systems using FDT. Modified: stable/10/sys/powerpc/aim/machdep.c stable/10/sys/powerpc/aim/mmu_oea64.c stable/10/sys/powerpc/aim/trap.c stable/10/sys/powerpc/booke/trap.c stable/10/sys/powerpc/ofw/ofw_syscons.c stable/10/sys/powerpc/powermac/grackle.c stable/10/sys/powerpc/powermac/macio.c stable/10/sys/powerpc/powermac/uninorth.c stable/10/sys/powerpc/powermac/uninorthpci.c stable/10/sys/powerpc/powermac/uninorthvar.h stable/10/sys/powerpc/pseries/phyp_console.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/aim/machdep.c ============================================================================== --- stable/10/sys/powerpc/aim/machdep.c Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/aim/machdep.c Wed May 14 14:08:45 2014 (r266019) @@ -159,8 +159,6 @@ SYSCTL_INT(_machdep, CPU_CACHELINE, cach uintptr_t powerpc_init(vm_offset_t, vm_offset_t, vm_offset_t, void *); -int setfault(faultbuf); /* defined in locore.S */ - long Maxmem = 0; long realmem = 0; Modified: stable/10/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/10/sys/powerpc/aim/mmu_oea64.c Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/aim/mmu_oea64.c Wed May 14 14:08:45 2014 (r266019) @@ -180,8 +180,7 @@ uintptr_t moea64_get_unique_vsid(void); struct ofw_map { cell_t om_va; cell_t om_len; - cell_t om_pa_hi; - cell_t om_pa_lo; + uint64_t om_pa; cell_t om_mode; }; @@ -471,13 +470,9 @@ om_cmp(const void *a, const void *b) mapa = a; mapb = b; - if (mapa->om_pa_hi < mapb->om_pa_hi) + if (mapa->om_pa < mapb->om_pa) return (-1); - else if (mapa->om_pa_hi > mapb->om_pa_hi) - return (1); - else if (mapa->om_pa_lo < mapb->om_pa_lo) - return (-1); - else if (mapa->om_pa_lo > mapb->om_pa_lo) + else if (mapa->om_pa > mapb->om_pa) return (1); else return (0); @@ -486,26 +481,41 @@ om_cmp(const void *a, const void *b) static void moea64_add_ofw_mappings(mmu_t mmup, phandle_t mmu, size_t sz) { - struct ofw_map translations[sz/sizeof(struct ofw_map)]; + struct ofw_map translations[sz/(4*sizeof(cell_t))]; /*>= 4 cells per */ + pcell_t acells, trans_cells[sz/sizeof(cell_t)]; register_t msr; vm_offset_t off; vm_paddr_t pa_base; - int i; + int i, j; bzero(translations, sz); - if (OF_getprop(mmu, "translations", translations, sz) == -1) + OF_getprop(OF_finddevice("/"), "#address-cells", &acells, + sizeof(acells)); + if (OF_getprop(mmu, "translations", trans_cells, sz) == -1) panic("moea64_bootstrap: can't get ofw translations"); CTR0(KTR_PMAP, "moea64_add_ofw_mappings: translations"); - sz /= sizeof(*translations); + sz /= sizeof(cell_t); + for (i = 0, j = 0; i < sz; j++) { + translations[j].om_va = trans_cells[i++]; + translations[j].om_len = trans_cells[i++]; + translations[j].om_pa = trans_cells[i++]; + if (acells == 2) { + translations[j].om_pa <<= 32; + translations[j].om_pa |= trans_cells[i++]; + } + translations[j].om_mode = trans_cells[i++]; + } + KASSERT(i == sz, ("Translations map has incorrect cell count (%d/%zd)", + i, sz)); + + sz = j; qsort(translations, sz, sizeof (*translations), om_cmp); for (i = 0; i < sz; i++) { - pa_base = translations[i].om_pa_lo; - #ifdef __powerpc64__ - pa_base += (vm_offset_t)translations[i].om_pa_hi << 32; - #else - if (translations[i].om_pa_hi) + pa_base = translations[i].om_pa; + #ifndef __powerpc64__ + if ((translations[i].om_pa >> 32) != 0) panic("OFW translations above 32-bit boundary!"); #endif Modified: stable/10/sys/powerpc/aim/trap.c ============================================================================== --- stable/10/sys/powerpc/aim/trap.c Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/aim/trap.c Wed May 14 14:08:45 2014 (r266019) @@ -89,12 +89,6 @@ static int handle_user_slb_spill(pmap_t extern int n_slbs; #endif -int setfault(faultbuf); /* defined in locore.S */ - -/* Why are these not defined in a header? */ -int badaddr(void *, size_t); -int badaddr_read(void *, size_t, int *); - struct powerpc_exception { u_int vector; char *name; @@ -695,59 +689,6 @@ trap_pfault(struct trapframe *frame, int return (SIGSEGV); } -int -badaddr(void *addr, size_t size) -{ - return (badaddr_read(addr, size, NULL)); -} - -int -badaddr_read(void *addr, size_t size, int *rptr) -{ - struct thread *td; - faultbuf env; - int x; - - /* Get rid of any stale machine checks that have been waiting. */ - __asm __volatile ("sync; isync"); - - td = curthread; - - if (setfault(env)) { - td->td_pcb->pcb_onfault = 0; - __asm __volatile ("sync"); - return 1; - } - - __asm __volatile ("sync"); - - switch (size) { - case 1: - x = *(volatile int8_t *)addr; - break; - case 2: - x = *(volatile int16_t *)addr; - break; - case 4: - x = *(volatile int32_t *)addr; - break; - default: - panic("badaddr: invalid size (%zd)", size); - } - - /* Make sure we took the machine check, if we caused one. */ - __asm __volatile ("sync; isync"); - - td->td_pcb->pcb_onfault = 0; - __asm __volatile ("sync"); /* To be sure. */ - - /* Use the value to avoid reorder. */ - if (rptr) - *rptr = x; - - return (0); -} - /* * For now, this only deals with the particular unaligned access case * that gcc tends to generate. Eventually it should handle all of the Modified: stable/10/sys/powerpc/booke/trap.c ============================================================================== --- stable/10/sys/powerpc/booke/trap.c Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/booke/trap.c Wed May 14 14:08:45 2014 (r266019) @@ -87,12 +87,6 @@ static int fix_unaligned(struct thread * static int handle_onfault(struct trapframe *frame); static void syscall(struct trapframe *frame); -int setfault(faultbuf); /* defined in locore.S */ - -/* Why are these not defined in a header? */ -int badaddr(void *, size_t); -int badaddr_read(void *, size_t, int *); - struct powerpc_exception { u_int vector; char *name; @@ -461,60 +455,6 @@ trap_pfault(struct trapframe *frame, int return ((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); } -int -badaddr(void *addr, size_t size) -{ - - return (badaddr_read(addr, size, NULL)); -} - -int -badaddr_read(void *addr, size_t size, int *rptr) -{ - struct thread *td; - faultbuf env; - int x; - - /* Get rid of any stale machine checks that have been waiting. */ - __asm __volatile ("sync; isync"); - - td = curthread; - - if (setfault(env)) { - td->td_pcb->pcb_onfault = 0; - __asm __volatile ("sync"); - return (1); - } - - __asm __volatile ("sync"); - - switch (size) { - case 1: - x = *(volatile int8_t *)addr; - break; - case 2: - x = *(volatile int16_t *)addr; - break; - case 4: - x = *(volatile int32_t *)addr; - break; - default: - panic("badaddr: invalid size (%d)", size); - } - - /* Make sure we took the machine check, if we caused one. */ - __asm __volatile ("sync; isync"); - - td->td_pcb->pcb_onfault = 0; - __asm __volatile ("sync"); /* To be sure. */ - - /* Use the value to avoid reorder. */ - if (rptr) - *rptr = x; - - return (0); -} - /* * For now, this only deals with the particular unaligned access case * that gcc tends to generate. Eventually it should handle all of the Modified: stable/10/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_syscons.c Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/ofw/ofw_syscons.c Wed May 14 14:08:45 2014 (r266019) @@ -57,9 +57,12 @@ __FBSDID("$FreeBSD$"); #include static int ofwfb_ignore_mmap_checks = 1; +static int ofwfb_reset_on_switch = 1; static SYSCTL_NODE(_hw, OID_AUTO, ofwfb, CTLFLAG_RD, 0, "ofwfb"); SYSCTL_INT(_hw_ofwfb, OID_AUTO, relax_mmap, CTLFLAG_RW, &ofwfb_ignore_mmap_checks, 0, "relaxed mmap bounds checking"); +SYSCTL_INT(_hw_ofwfb, OID_AUTO, reset_on_mode_switch, CTLFLAG_RW, + &ofwfb_reset_on_switch, 0, "reset the framebuffer driver on mode switch"); extern u_char dflt_font_16[]; extern u_char dflt_font_14[]; @@ -447,26 +450,28 @@ ofwfb_set_mode(video_adapter_t *adp, int sc = (struct ofwfb_softc *)adp; - /* - * Open the display device, which will initialize it. - */ - - memset(name, 0, sizeof(name)); - OF_package_to_path(sc->sc_node, name, sizeof(name)); - ih = OF_open(name); - - if (sc->sc_depth == 8) { + if (ofwfb_reset_on_switch) { /* - * Install the ISO6429 colormap - older OFW systems - * don't do this by default + * Open the display device, which will initialize it. */ - for (i = 0; i < 16; i++) { - OF_call_method("color!", ih, 4, 1, - ofwfb_cmap[i].red, - ofwfb_cmap[i].green, - ofwfb_cmap[i].blue, - i, - &retval); + + memset(name, 0, sizeof(name)); + OF_package_to_path(sc->sc_node, name, sizeof(name)); + ih = OF_open(name); + + if (sc->sc_depth == 8) { + /* + * Install the ISO6429 colormap - older OFW systems + * don't do this by default + */ + for (i = 0; i < 16; i++) { + OF_call_method("color!", ih, 4, 1, + ofwfb_cmap[i].red, + ofwfb_cmap[i].green, + ofwfb_cmap[i].blue, + i, + &retval); + } } } Modified: stable/10/sys/powerpc/powermac/grackle.c ============================================================================== --- stable/10/sys/powerpc/powermac/grackle.c Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/powermac/grackle.c Wed May 14 14:08:45 2014 (r266019) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -59,8 +60,6 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" -int badaddr(void *, size_t); /* XXX */ - /* * Device interface. */ @@ -81,6 +80,9 @@ static void grackle_write_config(device static int grackle_enable_config(struct grackle_softc *, u_int, u_int, u_int, u_int); static void grackle_disable_config(struct grackle_softc *); +static int badaddr(void *, size_t); + +int setfault(faultbuf); /* defined in locore.S */ /* * Driver methods. @@ -238,6 +240,50 @@ grackle_disable_config(struct grackle_so out32rb(sc->sc_addr, 0); } +static int +badaddr(void *addr, size_t size) +{ + struct thread *td; + faultbuf env, *oldfaultbuf; + int x; + + /* Get rid of any stale machine checks that have been waiting. */ + __asm __volatile ("sync; isync"); + + td = curthread; + + oldfaultbuf = td->td_pcb->pcb_onfault; + if (setfault(env)) { + td->td_pcb->pcb_onfault = oldfaultbuf; + __asm __volatile ("sync"); + return 1; + } + + __asm __volatile ("sync"); + + switch (size) { + case 1: + x = *(volatile int8_t *)addr; + break; + case 2: + x = *(volatile int16_t *)addr; + break; + case 4: + x = *(volatile int32_t *)addr; + break; + default: + panic("badaddr: invalid size (%zd)", size); + } + + /* Make sure we took the machine check, if we caused one. */ + __asm __volatile ("sync; isync"); + + td->td_pcb->pcb_onfault = oldfaultbuf; + __asm __volatile ("sync"); /* To be sure. */ + + return (0); +} + /* * Driver to swallow Grackle host bridges from the PCI bus side. */ Modified: stable/10/sys/powerpc/powermac/macio.c ============================================================================== --- stable/10/sys/powerpc/powermac/macio.c Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/powermac/macio.c Wed May 14 14:08:45 2014 (r266019) @@ -201,10 +201,6 @@ macio_add_intr(phandle_t devnode, struct return; } - if (OF_searchprop(devnode, "#interrupt-cells", &icells, sizeof(icells)) - <= 0) - icells = 1; - nintr = OF_getprop_alloc(devnode, "interrupts", sizeof(*intr), (void **)&intr); if (nintr == -1) { @@ -221,6 +217,10 @@ macio_add_intr(phandle_t devnode, struct <= 0) panic("Interrupt but no interrupt parent!\n"); + if (OF_getprop(OF_xref_phandle(iparent), "#interrupt-cells", &icells, + sizeof(icells)) <= 0) + icells = 1; + for (i = 0; i < nintr; i+=icells) { u_int irq = MAP_IRQ(iparent, intr[i]); Modified: stable/10/sys/powerpc/powermac/uninorth.c ============================================================================== --- stable/10/sys/powerpc/powermac/uninorth.c Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/powermac/uninorth.c Wed May 14 14:08:45 2014 (r266019) @@ -270,6 +270,7 @@ unin_chip_attach(device_t dev) phandle_t child; phandle_t iparent; device_t cdev; + cell_t acells, scells; char compat[32]; char name[32]; u_int irq, reg[3]; @@ -281,12 +282,21 @@ unin_chip_attach(device_t dev) if (OF_getprop(root, "reg", reg, sizeof(reg)) < 8) return (ENXIO); - if (strcmp(ofw_bus_get_name(dev), "u3") == 0 - || strcmp(ofw_bus_get_name(dev), "u4") == 0) - i = 1; /* #address-cells lies */ - - sc->sc_physaddr = reg[i]; - sc->sc_size = reg[i+1]; + acells = scells = 1; + OF_getprop(OF_parent(root), "#address-cells", &acells, sizeof(acells)); + OF_getprop(OF_parent(root), "#size-cells", &scells, sizeof(scells)); + + i = 0; + sc->sc_physaddr = reg[i++]; + if (acells == 2) { + sc->sc_physaddr <<= 32; + sc->sc_physaddr |= reg[i++]; + } + sc->sc_size = reg[i++]; + if (scells == 2) { + sc->sc_size <<= 32; + sc->sc_size |= reg[i++]; + } sc->sc_mem_rman.rm_type = RMAN_ARRAY; sc->sc_mem_rman.rm_descr = "UniNorth Device Memory"; Modified: stable/10/sys/powerpc/powermac/uninorthpci.c ============================================================================== --- stable/10/sys/powerpc/powermac/uninorthpci.c Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/powermac/uninorthpci.c Wed May 14 14:08:45 2014 (r266019) @@ -134,7 +134,9 @@ uninorth_attach(device_t dev) struct uninorth_softc *sc; const char *compatible; phandle_t node; - u_int32_t reg[3]; + uint32_t reg[3]; + uint64_t regbase; + cell_t acells; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); @@ -149,14 +151,18 @@ uninorth_attach(device_t dev) if (strcmp(compatible, "u4-pcie") == 0) sc->sc_ver = 4; - if (sc->sc_ver >= 3) { - sc->sc_addr = (vm_offset_t)pmap_mapdev(reg[1] + 0x800000, PAGE_SIZE); - sc->sc_data = (vm_offset_t)pmap_mapdev(reg[1] + 0xc00000, PAGE_SIZE); - } else { - sc->sc_addr = (vm_offset_t)pmap_mapdev(reg[0] + 0x800000, PAGE_SIZE); - sc->sc_data = (vm_offset_t)pmap_mapdev(reg[0] + 0xc00000, PAGE_SIZE); + acells = 1; + OF_getprop(OF_parent(node), "#address-cells", &acells, sizeof(acells)); + + regbase = reg[0]; + if (acells == 2) { + regbase <<= 32; + regbase |= reg[1]; } + sc->sc_addr = (vm_offset_t)pmap_mapdev(regbase + 0x800000, PAGE_SIZE); + sc->sc_data = (vm_offset_t)pmap_mapdev(regbase + 0xc00000, PAGE_SIZE); + return (ofw_pci_attach(dev)); } Modified: stable/10/sys/powerpc/powermac/uninorthvar.h ============================================================================== --- stable/10/sys/powerpc/powermac/uninorthvar.h Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/powermac/uninorthvar.h Wed May 14 14:08:45 2014 (r266019) @@ -40,9 +40,9 @@ struct uninorth_softc { }; struct unin_chip_softc { - u_int32_t sc_physaddr; + uint64_t sc_physaddr; + uint64_t sc_size; vm_offset_t sc_addr; - u_int32_t sc_size; struct rman sc_mem_rman; int sc_version; }; Modified: stable/10/sys/powerpc/pseries/phyp_console.c ============================================================================== --- stable/10/sys/powerpc/pseries/phyp_console.c Wed May 14 13:55:14 2014 (r266018) +++ stable/10/sys/powerpc/pseries/phyp_console.c Wed May 14 14:08:45 2014 (r266019) @@ -192,11 +192,9 @@ uart_phyp_cnprobe(struct consdev *cp) { char buf[64]; ihandle_t stdout; - phandle_t input, opts, chosen; + phandle_t input, chosen; static struct uart_phyp_softc sc; - if ((opts = OF_finddevice("/options")) == -1) - goto fail; if ((chosen = OF_finddevice("/chosen")) == -1) goto fail; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 14:17:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1A534830; Wed, 14 May 2014 14:17: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 030EA2430; Wed, 14 May 2014 14:17: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 s4EEHsKZ060553; Wed, 14 May 2014 14:17:54 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EEHqW2060536; Wed, 14 May 2014 14:17:52 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141417.s4EEHqW2060536@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 14:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266020 - in stable/10/sys: arm/mv dev/fdt dev/ofw dev/uart powerpc/aim powerpc/booke powerpc/include powerpc/mpc85xx powerpc/ofw powerpc/powermac powerpc/powerpc powerpc/ps3 powerpc/ps... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 14:17:55 -0000 Author: ian Date: Wed May 14 14:17:51 2014 New Revision: 266020 URL: http://svnweb.freebsd.org/changeset/base/266020 Log: MFC r258800, r258802, r258805, r258806, r258807, r258851, r258857, r259199, r259484, r259513, r259514, r259516 The kernel stack guard pages are only below the stack pointer, not above. Remove unnecessary double-setting of the thread's onfault state in copyinstr(). Open Firmware mandates that certain cross-references, in particular those in /chosen, be ihandles. The ePAPR spec makes those cross-reference phandles, since FDT has no concept of ihandles. Have the OF FDT CI module interpret queries about ihandles as cross-reference phandles. Real OF systems have an ihandle under /chosen/stdout, not a phandle. Use the right type. Rearchitect platform memory map parsing to make it less Open Firmware-centric. Remove fdtbus_bs_tag definition, which is now obsolete. The remainder of this file is also slated for future demolition. Return the correct IEEE 1275 code for "nextprop". Use the common Open Firmware PCI interrupt routing code instead of the duplicate version in dev/fdt. Configure interrupt sense based on device tree information. Simplify the ofw_bus_lookup_imap() API slightly: make it allocate maskbuf internally instead of requiring the caller to allocate it. Modified: stable/10/sys/arm/mv/mv_pci.c stable/10/sys/dev/fdt/fdt_common.h stable/10/sys/dev/fdt/fdt_pci.c stable/10/sys/dev/ofw/ofw_bus_subr.c stable/10/sys/dev/ofw/ofw_bus_subr.h stable/10/sys/dev/ofw/ofw_fdt.c stable/10/sys/dev/uart/uart_cpu_powerpc.c stable/10/sys/powerpc/aim/trap_subr32.S stable/10/sys/powerpc/aim/trap_subr64.S stable/10/sys/powerpc/booke/platform_bare.c stable/10/sys/powerpc/include/fdt.h stable/10/sys/powerpc/include/ofw_machdep.h stable/10/sys/powerpc/mpc85xx/platform_mpc85xx.c stable/10/sys/powerpc/ofw/ofw_machdep.c stable/10/sys/powerpc/ofw/ofw_pci.c stable/10/sys/powerpc/ofw/ofw_pcib_pci.c stable/10/sys/powerpc/powermac/platform_powermac.c stable/10/sys/powerpc/powerpc/copyinout.c stable/10/sys/powerpc/powerpc/platform.c stable/10/sys/powerpc/powerpc/platform_if.m stable/10/sys/powerpc/ps3/platform_ps3.c stable/10/sys/powerpc/pseries/platform_chrp.c stable/10/sys/powerpc/wii/platform_wii.c stable/10/sys/sparc64/ebus/ebus.c stable/10/sys/sparc64/isa/ofw_isa.c stable/10/sys/sparc64/pci/fire.c stable/10/sys/sparc64/pci/ofw_pcib_subr.c stable/10/sys/sparc64/pci/psycho.c stable/10/sys/sparc64/pci/schizo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/mv/mv_pci.c ============================================================================== --- stable/10/sys/arm/mv/mv_pci.c Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/arm/mv/mv_pci.c Wed May 14 14:17:51 2014 (r266020) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -142,7 +143,7 @@ struct mv_pcib_softc { int sc_type; int sc_mode; /* Endpoint / Root Complex */ - struct fdt_pci_intr sc_intr_info; + struct ofw_bus_iinfo sc_pci_iinfo; }; /* Local forward prototypes */ @@ -155,7 +156,6 @@ static void mv_pcib_hw_cfgwrite(struct m static int mv_pcib_init(struct mv_pcib_softc *, int, int); static int mv_pcib_init_all_bars(struct mv_pcib_softc *, int, int, int, int); static void mv_pcib_init_bridge(struct mv_pcib_softc *, int, int, int); -static int mv_pcib_intr_info(phandle_t, struct mv_pcib_softc *); static inline void pcib_write_irq_mask(struct mv_pcib_softc *, uint32_t); static void mv_pcib_enable(struct mv_pcib_softc *, uint32_t); static int mv_pcib_mem_init(struct mv_pcib_softc *); @@ -243,8 +243,8 @@ mv_pcib_probe(device_t self) if (!fdt_is_type(node, "pci")) return (ENXIO); - if (!(fdt_is_compatible(node, "mrvl,pcie") || - fdt_is_compatible(node, "mrvl,pci"))) + if (!(ofw_bus_is_compatible(self, "mrvl,pcie") || + ofw_bus_is_compatible(self, "mrvl,pci"))) return (ENXIO); device_set_desc(self, "Marvell Integrated PCI/PCI-E Controller"); @@ -299,11 +299,8 @@ mv_pcib_attach(device_t self) /* * Get PCI interrupt info. */ - if ((sc->sc_mode == MV_MODE_ROOT) && - (mv_pcib_intr_info(node, sc) != 0)) { - device_printf(self, "could not retrieve interrupt info\n"); - return (ENXIO); - } + if (sc->sc_mode == MV_MODE_ROOT) + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(pcell_t)); /* * Configure decode windows for PCI(E) access. @@ -881,19 +878,32 @@ mv_pcib_write_config(device_t dev, u_int } static int -mv_pcib_route_interrupt(device_t pcib, device_t dev, int pin) +mv_pcib_route_interrupt(device_t bus, device_t dev, int pin) { struct mv_pcib_softc *sc; - int err, interrupt; - - sc = device_get_softc(pcib); - - err = fdt_pci_route_intr(pci_get_bus(dev), pci_get_slot(dev), - pci_get_function(dev), pin, &sc->sc_intr_info, &interrupt); - if (err == 0) - return (interrupt); + struct ofw_pci_register reg; + uint32_t pintr, mintr; + phandle_t iparent; + + sc = device_get_softc(bus); + pintr = pin; + + /* Fabricate imap information in case this isn't an OFW device */ + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, + sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + &iparent)) + return (ofw_bus_map_intr(dev, iparent, mintr)); + + /* Maybe it's a real interrupt, not an intpin */ + if (pin > 4) + return (pin); - device_printf(pcib, "could not route pin %d for device %d.%d\n", + device_printf(bus, "could not route pin %d for device %d.%d\n", pin, pci_get_slot(dev), pci_get_function(dev)); return (PCI_INVALID_IRQ); } @@ -938,17 +948,6 @@ mv_pcib_decode_win(phandle_t node, struc return (0); } -static int -mv_pcib_intr_info(phandle_t node, struct mv_pcib_softc *sc) -{ - int error; - - if ((error = fdt_pci_intr_info(node, &sc->sc_intr_info)) != 0) - return (error); - - return (0); -} - #if defined(SOC_MV_ARMADAXP) static int mv_pcib_map_msi(device_t dev, device_t child, int irq, uint64_t *addr, Modified: stable/10/sys/dev/fdt/fdt_common.h ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.h Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/dev/fdt/fdt_common.h Wed May 14 14:17:51 2014 (r266020) @@ -47,14 +47,6 @@ struct fdt_pci_range { u_long len; }; -struct fdt_pci_intr { - int addr_cells; - int intr_cells; - int map_len; - pcell_t *map; - pcell_t *mask; -}; - struct fdt_sense_level { enum intr_trigger trig; enum intr_polarity pol; @@ -110,11 +102,9 @@ int fdt_is_enabled(phandle_t); int fdt_pm_is_enabled(phandle_t); int fdt_is_type(phandle_t, const char *); int fdt_parent_addr_cells(phandle_t); -int fdt_pci_intr_info(phandle_t, struct fdt_pci_intr *); int fdt_pci_ranges(phandle_t, struct fdt_pci_range *, struct fdt_pci_range *); int fdt_pci_ranges_decode(phandle_t, struct fdt_pci_range *, struct fdt_pci_range *); -int fdt_pci_route_intr(int, int, int, int, struct fdt_pci_intr *, int *); int fdt_ranges_verify(pcell_t *, int, int, int, int); int fdt_reg_to_rl(phandle_t, struct resource_list *); int fdt_pm(phandle_t); Modified: stable/10/sys/dev/fdt/fdt_pci.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_pci.c Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/dev/fdt/fdt_pci.c Wed May 14 14:17:51 2014 (r266020) @@ -180,159 +180,6 @@ fdt_pci_ranges(phandle_t node, struct fd return (0); } -static int -fdt_addr_cells(phandle_t node, int *addr_cells) -{ - pcell_t cell; - int cell_size; - - cell_size = sizeof(cell); - if (OF_getprop(node, "#address-cells", &cell, cell_size) < cell_size) - return (EINVAL); - *addr_cells = fdt32_to_cpu((int)cell); - - if (*addr_cells > 3) - return (ERANGE); - return (0); -} - -static int -fdt_interrupt_cells(phandle_t node) -{ - pcell_t intr_cells; - - if (OF_getprop(node, "#interrupt-cells", &intr_cells, - sizeof(intr_cells)) <= 0) { - debugf("no intr-cells defined, defaulting to 1\n"); - intr_cells = 1; - } - intr_cells = fdt32_to_cpu(intr_cells); - - return ((int)intr_cells); -} - -int -fdt_pci_intr_info(phandle_t node, struct fdt_pci_intr *intr_info) -{ - void *map, *mask; - int acells, icells; - int error, len; - - error = fdt_addr_cells(node, &acells); - if (error) - return (error); - - icells = fdt_interrupt_cells(node); - - /* - * Retrieve the interrupt map and mask properties. - */ - len = OF_getprop_alloc(node, "interrupt-map-mask", 1, &mask); - if (len / sizeof(pcell_t) != (acells + icells)) { - debugf("bad mask len = %d\n", len); - goto err; - } - - len = OF_getprop_alloc(node, "interrupt-map", 1, &map); - if (len <= 0) { - debugf("bad map len = %d\n", len); - goto err; - } - - intr_info->map_len = len; - intr_info->map = map; - intr_info->mask = mask; - intr_info->addr_cells = acells; - intr_info->intr_cells = icells; - - debugf("acells=%u, icells=%u, map_len=%u\n", acells, icells, len); - return (0); - -err: - free(mask, M_OFWPROP); - return (ENXIO); -} - -int -fdt_pci_route_intr(int bus, int slot, int func, int pin, - struct fdt_pci_intr *intr_info, int *interrupt) -{ - pcell_t child_spec[4], masked[4]; - phandle_t iph; - pcell_t intr_par; - pcell_t *map_ptr; - uint32_t addr; - int i, j, map_len; - int par_intr_cells, par_addr_cells, child_spec_cells, row_cells; - int par_idx, spec_idx, err, trig, pol; - - child_spec_cells = intr_info->addr_cells + intr_info->intr_cells; - if (child_spec_cells > sizeof(child_spec) / sizeof(pcell_t)) - return (ENOMEM); - - addr = (bus << 16) | (slot << 11) | (func << 8); - child_spec[0] = addr; - child_spec[1] = 0; - child_spec[2] = 0; - child_spec[3] = pin; - - map_len = intr_info->map_len; - map_ptr = intr_info->map; - - par_idx = child_spec_cells; - i = 0; - while (i < map_len) { - iph = fdt32_to_cpu(map_ptr[par_idx]); - intr_par = OF_xref_phandle(iph); - - err = fdt_addr_cells(intr_par, &par_addr_cells); - if (err != 0) { - debugf("could not retrieve intr parent #addr-cells\n"); - return (err); - } - par_intr_cells = fdt_interrupt_cells(intr_par); - - row_cells = child_spec_cells + 1 + par_addr_cells + - par_intr_cells; - - /* - * Apply mask and look up the entry in interrupt map. - */ - for (j = 0; j < child_spec_cells; j++) { - masked[j] = child_spec[j] & - fdt32_to_cpu(intr_info->mask[j]); - - if (masked[j] != fdt32_to_cpu(map_ptr[j])) - goto next; - } - - /* - * Decode interrupt of the parent intr controller. - */ - spec_idx = child_spec_cells + 1 + par_addr_cells; - err = fdt_intr_decode(intr_par, &map_ptr[spec_idx], - interrupt, &trig, &pol); - if (err != 0) { - debugf("could not decode interrupt\n"); - return (err); - } - debugf("decoded intr = %d, trig = %d, pol = %d\n", *interrupt, - trig, pol); - -#if defined(__powerpc__) - powerpc_config_intr(FDT_MAP_IRQ(iph, *interrupt), trig, - pol); -#endif - return (0); - -next: - map_ptr += row_cells; - i += (row_cells * sizeof(pcell_t)); - } - - return (ENXIO); -} - #if defined(__arm__) int fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, vm_offset_t io_va, @@ -360,217 +207,3 @@ fdt_pci_devmap(phandle_t node, struct ar } #endif -#if 0 -static int -fdt_pci_config_bar(device_t dev, int bus, int slot, int func, int bar) -{ -} - -static int -fdt_pci_config_normal(device_t dev, int bus, int slot, int func) -{ - int bar; - uint8_t command, intline, intpin; - - command = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_COMMAND, 1); - command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); - - /* Program the base address registers. */ - bar = 0; - while (bar <= PCIR_MAX_BAR_0) - bar += fdt_pci_config_bar(dev, bus, slot, func, bar); - - /* Perform interrupt routing. */ - intpin = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_INTPIN, 1); - intline = fsl_pcib_route_int(dev, bus, slot, func, intpin); - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_INTLINE, intline, 1); - - command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); -} - -static int -fdt_pci_config_bridge(device_t dev, int bus, int secbus, int slot, int func) -{ - int maxbar; - uint8_t command; - - command = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_COMMAND, 1); - command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); - - /* Program the base address registers. */ - maxbar = (hdrtype & PCIM_HDRTYPE) ? 1 : 6; - bar = 0; - while (bar < maxbar) - bar += fsl_pcib_init_bar(sc, bus, slot, func, - bar); - - /* Perform interrupt routing. */ - intpin = fsl_pcib_read_config(sc->sc_dev, bus, slot, - func, PCIR_INTPIN, 1); - intline = fsl_pcib_route_int(sc, bus, slot, func, - intpin); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_INTLINE, intline, 1); - - command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_COMMAND, command, 1); - - /* - * Handle PCI-PCI bridges - */ - class = fsl_pcib_read_config(sc->sc_dev, bus, slot, - func, PCIR_CLASS, 1); - subclass = fsl_pcib_read_config(sc->sc_dev, bus, slot, - func, PCIR_SUBCLASS, 1); - - /* Allow only proper PCI-PCI briges */ - if (class != PCIC_BRIDGE) - continue; - if (subclass != PCIS_BRIDGE_PCI) - continue; - - secbus++; - - /* Program I/O decoder. */ - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOBASEL_1, sc->sc_ioport.rm_start >> 8, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOLIMITL_1, sc->sc_ioport.rm_end >> 8, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOBASEH_1, sc->sc_ioport.rm_start >> 16, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOLIMITH_1, sc->sc_ioport.rm_end >> 16, 2); - - /* Program (non-prefetchable) memory decoder. */ - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_MEMBASE_1, sc->sc_iomem.rm_start >> 16, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_MEMLIMIT_1, sc->sc_iomem.rm_end >> 16, 2); - - /* Program prefetchable memory decoder. */ - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMBASEL_1, 0x0010, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMLIMITL_1, 0x000f, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMBASEH_1, 0x00000000, 4); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMLIMITH_1, 0x00000000, 4); - - /* Read currect bus register configuration */ - old_pribus = fsl_pcib_read_config(sc->sc_dev, bus, - slot, func, PCIR_PRIBUS_1, 1); - old_secbus = fsl_pcib_read_config(sc->sc_dev, bus, - slot, func, PCIR_SECBUS_1, 1); - old_subbus = fsl_pcib_read_config(sc->sc_dev, bus, - slot, func, PCIR_SUBBUS_1, 1); - - if (bootverbose) - printf("PCI: reading firmware bus numbers for " - "secbus = %d (bus/sec/sub) = (%d/%d/%d)\n", - secbus, old_pribus, old_secbus, old_subbus); - - new_pribus = bus; - new_secbus = secbus; - - secbus = fsl_pcib_init(sc, secbus, - (subclass == PCIS_BRIDGE_PCI) ? PCI_SLOTMAX : 0); - - new_subbus = secbus; - - if (bootverbose) - printf("PCI: translate firmware bus numbers " - "for secbus %d (%d/%d/%d) -> (%d/%d/%d)\n", - secbus, old_pribus, old_secbus, old_subbus, - new_pribus, new_secbus, new_subbus); - - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PRIBUS_1, new_pribus, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_SECBUS_1, new_secbus, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_SUBBUS_1, new_subbus, 1); - -} - -static int -fdt_pci_config_slot(device_t dev, int bus, int secbus, int slot) -{ - int func, maxfunc; - uint16_t vendor; - uint8_t hdrtype; - - maxfunc = 0; - for (func = 0; func <= maxfunc; func++) { - hdrtype = PCIB_READ_CONFIG(dev, bus, slot, func, - PCIR_HDRTYPE, 1); - if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) - continue; - if (func == 0 && (hdrtype & PCIM_MFDEV)) - maxfunc = PCI_FUNCMAX; - - vendor = PCIB_READ_CONFIG(dev, bus, slot, func, - PCIR_VENDOR, 2); - if (vendor == 0xffff) - continue; - - if ((hdrtype & PCIM_HDRTYPE) == PCIM_HDRTYPE_NORMAL) - fdt_pci_config_normal(dev, bus, slot, func); - else - secbus = fdt_pci_config_bridge(dev, bus, secbus, - slot, func); - } - - return (secbus); -} - -static int -fdt_pci_config_bus(device_t dev, int bus, int maxslot) -{ - int func, maxfunc, secbus, slot; - - secbus = bus; - for (slot = 0; slot <= maxslot; slot++) - secbus = fdt_pci_config_slot(dev, bus, secbus, slot); - - return (secbus); -} - -int -fdt_pci_config_domain(device_t dev) -{ - pcell_t bus_range[2]; - phandle_t root; - int bus, error, maxslot; - - root = ofw_bus_get_node(dev); - if (root == 0) - return (EINVAL); - if (!fdt_is_type(root, "pci")) - return (EINVAL); - - /* - * Determine the bus number of the root in this domain. - * Lacking any information, this will be bus 0. - * Write the bus number to the bus device, using the IVAR. - */ - if ((OF_getprop(root, "bus-range", bus_range, sizeof(bus_range)) <= 0) - bus = 0; - else - bus = fdt32_to_cpu(bus_range[0]); - - error = BUS_WRITE_IVAR(dev, NULL, PCIB_IVAR_BUS, bus); - if (error) - return (error); - - /* Get the maximum slot number for bus-enumeration. */ - maxslot = PCIB_MAXSLOTS(dev); - - bus = fdt_pci_config_bus(dev, bus, maxslot); - return (0); -} -#endif Modified: stable/10/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.c Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/dev/ofw/ofw_bus_subr.c Wed May 14 14:17:51 2014 (r266020) @@ -251,8 +251,9 @@ ofw_bus_setup_iinfo(phandle_t node, stru int ofw_bus_lookup_imap(phandle_t node, struct ofw_bus_iinfo *ii, void *reg, int regsz, void *pintr, int pintrsz, void *mintr, int mintrsz, - phandle_t *iparent, void *maskbuf) + phandle_t *iparent) { + uint8_t maskbuf[regsz + pintrsz]; int rv; if (ii->opi_imapsz <= 0) @@ -285,7 +286,7 @@ ofw_bus_lookup_imap(phandle_t node, stru * maskbuf must point to a buffer of length physsz + intrsz. * The interrupt is returned in result, which must point to a buffer of length * rintrsz (which gives the expected size of the mapped interrupt). - * Returns 1 if a mapping was found, 0 otherwise. + * Returns number of cells in the interrupt if a mapping was found, 0 otherwise. */ int ofw_bus_search_intrmap(void *intr, int intrsz, void *regs, int physsz, @@ -325,19 +326,13 @@ ofw_bus_search_intrmap(void *intr, int i tsz = physsz + intrsz + sizeof(phandle_t) + pintrsz; KASSERT(i >= tsz, ("ofw_bus_search_intrmap: truncated map")); - /* - * XXX: Apple hardware uses a second cell to set information - * on the interrupt trigger type. This information should - * be used somewhere to program the PIC. - */ - if (bcmp(ref, mptr, physsz + intrsz) == 0) { bcopy(mptr + physsz + intrsz + sizeof(parent), - result, rintrsz); + result, MIN(rintrsz, pintrsz)); if (iparent != NULL) *iparent = parent; - return (1); + return (pintrsz/sizeof(pcell_t)); } mptr += tsz; i -= tsz; Modified: stable/10/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.h Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/dev/ofw/ofw_bus_subr.h Wed May 14 14:17:51 2014 (r266020) @@ -68,7 +68,7 @@ bus_child_pnpinfo_str_t ofw_bus_gen_chil /* Routines for processing firmware interrupt maps */ void ofw_bus_setup_iinfo(phandle_t, struct ofw_bus_iinfo *, int); int ofw_bus_lookup_imap(phandle_t, struct ofw_bus_iinfo *, void *, int, - void *, int, void *, int, phandle_t *, void *); + void *, int, void *, int, phandle_t *); int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int, phandle_t *); Modified: stable/10/sys/dev/ofw/ofw_fdt.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_fdt.c Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/dev/ofw/ofw_fdt.c Wed May 14 14:17:51 2014 (r266020) @@ -207,7 +207,8 @@ static phandle_t ofw_fdt_instance_to_package(ofw_t ofw, ihandle_t instance) { - return (-1); + /* Where real OF uses ihandles in the tree, FDT uses xref phandles */ + return (OF_xref_phandle(instance)); } /* Get the length of a property of a package. */ @@ -266,8 +267,10 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac } /* - * Get the next property of a package. Return the actual len of retrieved - * prop name. + * Get the next property of a package. Return values: + * -1: package or previous property does not exist + * 0: no more properties + * 1: success */ static int ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, @@ -309,7 +312,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa strncpy(buf, fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)), size); - return (strlen(buf)); + return (1); } /* Set the value of a property of a package. */ @@ -350,8 +353,13 @@ ofw_fdt_finddevice(ofw_t ofw, const char static ssize_t ofw_fdt_instance_to_path(ofw_t ofw, ihandle_t instance, char *buf, size_t len) { + phandle_t phandle; - return (-1); + phandle = OF_instance_to_package(instance); + if (phandle == -1) + return (-1); + + return (OF_package_to_path(phandle, buf, len)); } /* Return the fully qualified pathname corresponding to a package. */ Modified: stable/10/sys/dev/uart/uart_cpu_powerpc.c ============================================================================== --- stable/10/sys/dev/uart/uart_cpu_powerpc.c Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/dev/uart/uart_cpu_powerpc.c Wed May 14 14:17:51 2014 (r266020) @@ -89,13 +89,13 @@ ofw_get_console_phandle_path(phandle_t n return (ENXIO); OF_getprop(node, prop, &field, sizeof(field)); - /* This property might be a phandle or might be a path. Hooray. */ + /* This property might be either a ihandle or path. Hooray. */ output = -1; if (field.buf[size - 1] == 0) output = OF_finddevice(field.buf); if (output == -1 && size == 4) - output = OF_xref_phandle(field.ref); + output = OF_instance_to_package(field.ref); if (output != -1) { *result = output; Modified: stable/10/sys/powerpc/aim/trap_subr32.S ============================================================================== --- stable/10/sys/powerpc/aim/trap_subr32.S Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/powerpc/aim/trap_subr32.S Wed May 14 14:17:51 2014 (r266020) @@ -672,11 +672,12 @@ disitrap: stw %r31,(PC_TEMPSAVE+CPUSAVE_AIM_DSISR)(%r1) #ifdef KDB - /* Try and detect a kernel stack overflow */ + /* Try to detect a kernel stack overflow */ mfsrr1 %r31 mtcr %r31 bt 17,realtrap /* branch is user mode */ mfsprg1 %r31 /* get old SP */ + clrrwi %r31,%r31,11 /* Round SP down to nearest page */ sub. %r30,%r31,%r30 /* SP - DAR */ bge 1f neg %r30,%r30 /* modulo value */ Modified: stable/10/sys/powerpc/aim/trap_subr64.S ============================================================================== --- stable/10/sys/powerpc/aim/trap_subr64.S Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/powerpc/aim/trap_subr64.S Wed May 14 14:17:51 2014 (r266020) @@ -580,11 +580,12 @@ disitrap: std %r31,(PC_TEMPSAVE+CPUSAVE_AIM_DSISR)(%r1) #ifdef KDB - /* Try and detect a kernel stack overflow */ + /* Try to detect a kernel stack overflow */ mfsrr1 %r31 mtcr %r31 bt 17,realtrap /* branch is user mode */ mfsprg1 %r31 /* get old SP */ + clrrdi %r31,%r31,11 /* Round SP down to nearest page */ sub. %r30,%r31,%r30 /* SP - DAR */ bge 1f neg %r30,%r30 /* modulo value */ Modified: stable/10/sys/powerpc/booke/platform_bare.c ============================================================================== --- stable/10/sys/powerpc/booke/platform_bare.c Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/powerpc/booke/platform_bare.c Wed May 14 14:17:51 2014 (r266020) @@ -45,8 +45,8 @@ __FBSDID("$FreeBSD$"); extern uint32_t *bootinfo; static int bare_probe(platform_t); -static void bare_mem_regions(platform_t, struct mem_region **phys, int *physsz, - struct mem_region **avail, int *availsz); +static void bare_mem_regions(platform_t, struct mem_region *phys, int *physsz, + struct mem_region *avail, int *availsz); static u_long bare_timebase_freq(platform_t, struct cpuref *cpuref); static void bare_reset(platform_t); @@ -80,8 +80,8 @@ bare_probe(platform_t plat) } void -bare_mem_regions(platform_t plat, struct mem_region **phys, int *physsz, - struct mem_region **avail, int *availsz) +bare_mem_regions(platform_t plat, struct mem_region *phys, int *physsz, + struct mem_region *avail, int *availsz) { ofw_mem_regions(phys, physsz, avail, availsz); Modified: stable/10/sys/powerpc/include/fdt.h ============================================================================== --- stable/10/sys/powerpc/include/fdt.h Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/powerpc/include/fdt.h Wed May 14 14:17:51 2014 (r266020) @@ -35,15 +35,7 @@ #include #include -/* Max interrupt number */ -#define FDT_INTR_MAX INTR_VECTORS - /* Map phandle/intpin pair to global IRQ number */ #define FDT_MAP_IRQ(node, pin) powerpc_get_irq(node, pin) -/* - * Bus space tag. XXX endianess info needs to be derived from the blob. - */ -#define fdtbus_bs_tag (&bs_be_tag) - #endif /* _MACHINE_FDT_H_ */ Modified: stable/10/sys/powerpc/include/ofw_machdep.h ============================================================================== --- stable/10/sys/powerpc/include/ofw_machdep.h Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/powerpc/include/ofw_machdep.h Wed May 14 14:17:51 2014 (r266020) @@ -45,7 +45,7 @@ boolean_t OF_bootstrap(void); void OF_reboot(void); -void ofw_mem_regions(struct mem_region **, int *, struct mem_region **, int *); +void ofw_mem_regions(struct mem_region *, int *, struct mem_region *, int *); void ofw_quiesce(void); /* Must be called before VM is up! */ void ofw_save_trap_vec(char *); Modified: stable/10/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- stable/10/sys/powerpc/mpc85xx/platform_mpc85xx.c Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/powerpc/mpc85xx/platform_mpc85xx.c Wed May 14 14:17:51 2014 (r266020) @@ -72,8 +72,8 @@ static int cpu, maxcpu; static int mpc85xx_probe(platform_t); static int mpc85xx_attach(platform_t); -static void mpc85xx_mem_regions(platform_t, struct mem_region **phys, - int *physsz, struct mem_region **avail, int *availsz); +static void mpc85xx_mem_regions(platform_t, struct mem_region *phys, + int *physsz, struct mem_region *avail, int *availsz); static u_long mpc85xx_timebase_freq(platform_t, struct cpuref *cpuref); static int mpc85xx_smp_first_cpu(platform_t, struct cpuref *cpuref); static int mpc85xx_smp_next_cpu(platform_t, struct cpuref *cpuref); @@ -201,8 +201,8 @@ mpc85xx_attach(platform_t plat) } void -mpc85xx_mem_regions(platform_t plat, struct mem_region **phys, int *physsz, - struct mem_region **avail, int *availsz) +mpc85xx_mem_regions(platform_t plat, struct mem_region *phys, int *physsz, + struct mem_region *avail, int *availsz) { ofw_mem_regions(phys, physsz, avail, availsz); Modified: stable/10/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_machdep.c Wed May 14 14:08:45 2014 (r266019) +++ stable/10/sys/powerpc/ofw/ofw_machdep.c Wed May 14 14:17:51 2014 (r266020) @@ -61,11 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include -static struct mem_region OFmem[PHYS_AVAIL_SZ], OFavail[PHYS_AVAIL_SZ]; -static struct mem_region OFfree[PHYS_AVAIL_SZ]; - -static int apple_hacks; - #ifdef AIM extern register_t ofmsr[5]; extern void *openfirmware_entry; @@ -80,7 +75,7 @@ static int openfirmware(void *args); __inline void ofw_save_trap_vec(char *save_trap_vec) { - if (apple_hacks) + if (!ofw_real_mode) return; bcopy((void *)EXC_RST, save_trap_vec, EXC_LAST - EXC_RST); @@ -89,7 +84,7 @@ ofw_save_trap_vec(char *save_trap_vec) static __inline void ofw_restore_trap_vec(char *restore_trap_vec) { - if (apple_hacks) + if (!ofw_real_mode) return; bcopy(restore_trap_vec, (void *)EXC_RST, EXC_LAST - EXC_RST); @@ -104,7 +99,7 @@ register_t ofw_sprg0_save; static __inline void ofw_sprg_prepare(void) { - if (!apple_hacks) + if (ofw_real_mode) return; /* @@ -126,8 +121,10 @@ ofw_sprg_prepare(void) static __inline void ofw_sprg_restore(void) { - if (!apple_hacks) +#if 0 + if (ofw_real_mode) return; +#endif /* * Note that SPRG1-3 contents are irrelevant. They are scratch @@ -140,50 +137,6 @@ ofw_sprg_restore(void) } #endif -/* - * Memory region utilities: determine if two regions overlap, - * and merge two overlapping regions into one - */ -static int -memr_overlap(struct mem_region *r1, struct mem_region *r2) -{ - if ((r1->mr_start + r1->mr_size) < r2->mr_start || - (r2->mr_start + r2->mr_size) < r1->mr_start) - return (FALSE); - - return (TRUE); -} - -static void -memr_merge(struct mem_region *from, struct mem_region *to) -{ - vm_offset_t end; - end = ulmax(to->mr_start + to->mr_size, from->mr_start + from->mr_size); - to->mr_start = ulmin(from->mr_start, to->mr_start); - to->mr_size = end - to->mr_start; -} - -/* - * Quick sort callout for comparing memory regions. - */ -static int mr_cmp(const void *a, const void *b); - -static int -mr_cmp(const void *a, const void *b) -{ - const struct mem_region *regiona; - const struct mem_region *regionb; - - regiona = a; - regionb = b; - if (regiona->mr_start < regionb->mr_start) - return (-1); - else if (regiona->mr_start > regionb->mr_start) - return (1); - else - return (0); -} - static int parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output) { @@ -209,14 +162,6 @@ parse_ofw_memory(phandle_t node, const c size_cells = 1; /* - * On Apple hardware, address_cells is always 1 for "available", - * even when it is explicitly set to 2. All memory above 4 GB - * also needs to be added by hand to the available list. - */ - if (strcmp(prop, "available") == 0 && apple_hacks) - address_cells = 1; - - /* * Get memory. */ if (node == -1 || (sz = OF_getprop(node, prop, @@ -267,103 +212,9 @@ parse_ofw_memory(phandle_t node, const c } sz = j*sizeof(output[0]); - #ifdef __powerpc64__ - if (strcmp(prop, "available") == 0 && apple_hacks) { - /* Add in regions above 4 GB to the available list */ - struct mem_region himem[16]; - int hisz; - - hisz = parse_ofw_memory(node, "reg", himem); - for (i = 0; i < hisz/sizeof(himem[0]); i++) { - if (himem[i].mr_start > BUS_SPACE_MAXADDR_32BIT) { - output[j].mr_start = himem[i].mr_start; - output[j].mr_size = himem[i].mr_size; - j++; - } - } - sz = j*sizeof(output[0]); - } - #endif - return (sz); } -static int -parse_drconf_memory(int *msz, int *asz, struct mem_region *ofmem, - struct mem_region *ofavail) -{ - phandle_t phandle; - vm_offset_t base; - int i, idx, len, lasz, lmsz, res; - uint32_t lmb_size[2]; - unsigned long *dmem, flags; - - lmsz = *msz; - lasz = *asz; - - phandle = OF_finddevice("/ibm,dynamic-reconfiguration-memory"); - if (phandle == -1) - /* No drconf node, return. */ - return (0); - - res = OF_getprop(phandle, "ibm,lmb-size", lmb_size, sizeof(lmb_size)); - if (res == -1) - return (0); - printf("Logical Memory Block size: %d MB\n", lmb_size[1] >> 20); - - /* Parse the /ibm,dynamic-memory. - The first position gives the # of entries. The next two words - reflect the address of the memory block. The next four words are - the DRC index, reserved, list index and flags. - (see PAPR C.6.6.2 ibm,dynamic-reconfiguration-memory) - - #el Addr DRC-idx res list-idx flags - ------------------------------------------------- - | 4 | 8 | 4 | 4 | 4 | 4 |.... - ------------------------------------------------- - */ - - len = OF_getproplen(phandle, "ibm,dynamic-memory"); - if (len > 0) { - - /* We have to use a variable length array on the stack - since we have very limited stack space. - */ - cell_t arr[len/sizeof(cell_t)]; - - res = OF_getprop(phandle, "ibm,dynamic-memory", &arr, - sizeof(arr)); - if (res == -1) - return (0); - - /* Number of elements */ - idx = arr[0]; - - /* First address. */ - dmem = (void*)&arr[1]; - - for (i = 0; i < idx; i++) { - base = *dmem; - dmem += 2; - flags = *dmem; - /* Use region only if available and not reserved. */ - if ((flags & 0x8) && !(flags & 0x80)) { - ofmem[lmsz].mr_start = base; - ofmem[lmsz].mr_size = (vm_size_t)lmb_size[1]; - ofavail[lasz].mr_start = base; - ofavail[lasz].mr_size = (vm_size_t)lmb_size[1]; - lmsz++; - lasz++; - } - dmem++; - } - } - - *msz = lmsz; - *asz = lasz; - - return (1); -} /* * This is called during powerpc_init, before the system is really initialized. * It shall provide the total and the available regions of RAM. @@ -372,14 +223,12 @@ parse_drconf_memory(int *msz, int *asz, * to provide space for two additional entry beyond the terminating one. */ void -ofw_mem_regions(struct mem_region **memp, int *memsz, - struct mem_region **availp, int *availsz) +ofw_mem_regions(struct mem_region *memp, int *memsz, + struct mem_region *availp, int *availsz) { phandle_t phandle; - vm_offset_t maxphysaddr; - int asz, msz, fsz; - int i, j, res; - int still_merging; + int asz, msz; + int res; char name[31]; asz = msz = 0; @@ -394,72 +243,18 @@ ofw_mem_regions(struct mem_region **memp if (strncmp(name, "memory", sizeof(name)) != 0) continue; - res = parse_ofw_memory(phandle, "reg", &OFmem[msz]); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 14:37:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B46BF2F5; Wed, 14 May 2014 14:37: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 95005263A; Wed, 14 May 2014 14:37: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 s4EEbS6Z069818; Wed, 14 May 2014 14:37:28 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EEbS1K069815; Wed, 14 May 2014 14:37:28 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141437.s4EEbS1K069815@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 14:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266022 - in stable/10/sys/arm: broadcom/bcm2835 conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 14:37:28 -0000 Author: ian Date: Wed May 14 14:37:27 2014 New Revision: 266022 URL: http://svnweb.freebsd.org/changeset/base/266022 Log: MFC r259517, r259518 Add vt support for RPi. (No early stage yet.) Added: stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c - copied, changed from r259517, head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Modified: stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 stable/10/sys/arm/conf/RPI-B Directory Properties: stable/10/ (props changed) Copied and modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c (from r259517, head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c) ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Tue Dec 17 15:23:47 2013 (r259517, copy source) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed May 14 14:37:27 2014 (r266022) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2012 Oleksandr Tymoshenko + * 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: @@ -99,13 +103,14 @@ struct bcmsc_softc { static int bcm_fb_probe(device_t); static int bcm_fb_attach(device_t); -static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err); +static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, + int err); static void bcm_fb_init(void *arg) { - struct bcmsc_softc *sc = arg; - volatile struct bcm_fb_config* fb_config = sc->fb_config; + volatile struct bcm_fb_config *fb_config; + struct bcmsc_softc *sc; struct fb_info *info; phandle_t node; pcell_t cell; @@ -113,6 +118,8 @@ bcm_fb_init(void *arg) device_t fbd; int err = 0; + sc = arg; + fb_config = sc->fb_config; node = ofw_bus_get_node(sc->dev); fb_config->xres = 0; @@ -153,23 +160,25 @@ bcm_fb_init(void *arg) BUS_DMASYNC_POSTREAD); if (fb_config->base != 0) { - device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", + device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", fb_config->xres, fb_config->yres, fb_config->vxres, fb_config->vyres, fb_config->xoffset, fb_config->yoffset, fb_config->bpp); - device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n", + device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n", fb_config->pitch, fb_config->base, fb_config->screen_size); - info = malloc(sizeof(struct fb_info), M_DEVBUF, M_WAITOK | M_ZERO); + info = malloc(sizeof(struct fb_info), M_DEVBUF, + M_WAITOK | M_ZERO); info->fb_name = device_get_nameunit(sc->dev); - info->fb_vbase = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); + info->fb_vbase = (intptr_t)pmap_mapdev(fb_config->base, + fb_config->screen_size); info->fb_pbase = fb_config->base; info->fb_size = fb_config->screen_size; info->fb_bpp = info->fb_depth = fb_config->bpp; @@ -179,7 +188,8 @@ bcm_fb_init(void *arg) sc->info = info; - fbd = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev)); + fbd = device_add_child(sc->dev, "fbd", + device_get_unit(sc->dev)); if (fbd == NULL) { device_printf(sc->dev, "Failed to add fbd child\n"); return; @@ -244,8 +254,8 @@ bcm_fb_attach(device_t dev) goto fail; } - /* - * We have to wait until interrupts are enabled. + /* + * We have to wait until interrupts are enabled. * Mailbox relies on it to get data from VideoCore */ sc->init_hook.ich_func = bcm_fb_init; Modified: stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 Wed May 14 14:19:57 2014 (r266021) +++ stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 Wed May 14 14:37:27 2014 (r266022) @@ -3,6 +3,7 @@ arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc arm/broadcom/bcm2835/bcm2835_dma.c standard arm/broadcom/bcm2835/bcm2835_fb.c optional sc +arm/broadcom/bcm2835/bcm2835_fbd.c optional vt arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio arm/broadcom/bcm2835/bcm2835_intr.c standard arm/broadcom/bcm2835/bcm2835_machdep.c standard Modified: stable/10/sys/arm/conf/RPI-B ============================================================================== --- stable/10/sys/arm/conf/RPI-B Wed May 14 14:19:57 2014 (r266021) +++ stable/10/sys/arm/conf/RPI-B Wed May 14 14:37:27 2014 (r266022) @@ -66,7 +66,7 @@ device pl011 device pty # Comment following lines for boot console on serial port -device sc +device vt device kbdmux options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp437 From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 15:16:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F2974A18; Wed, 14 May 2014 15:16: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 DEE5F29CD; Wed, 14 May 2014 15:16: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 s4EFG2iX087378; Wed, 14 May 2014 15:16:02 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EFG2N2087377; Wed, 14 May 2014 15:16:02 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405141516.s4EFG2N2087377@svn.freebsd.org> From: Bryan Drewery Date: Wed, 14 May 2014 15:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266023 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 15:16:03 -0000 Author: bdrewery Date: Wed May 14 15:16:02 2014 New Revision: 266023 URL: http://svnweb.freebsd.org/changeset/base/266023 Log: MFC r264385: Use proper MFSNAMELEN for fs type. Modified: stable/10/sys/kern/vfs_mount.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_mount.c ============================================================================== --- stable/10/sys/kern/vfs_mount.c Wed May 14 14:37:27 2014 (r266022) +++ stable/10/sys/kern/vfs_mount.c Wed May 14 15:16:02 2014 (r266023) @@ -748,7 +748,7 @@ sys_mount(td, uap) return (EOPNOTSUPP); } - ma = mount_argsu(ma, "fstype", uap->type, MNAMELEN); + ma = mount_argsu(ma, "fstype", uap->type, MFSNAMELEN); ma = mount_argsu(ma, "fspath", uap->path, MNAMELEN); ma = mount_argb(ma, flags & MNT_RDONLY, "noro"); ma = mount_argb(ma, !(flags & MNT_NOSUID), "nosuid"); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 15:21:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0E21CFC3; Wed, 14 May 2014 15:21: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 EEB072A8C; Wed, 14 May 2014 15:21: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 s4EFLR7w090626; Wed, 14 May 2014 15:21:27 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EFLRHb090625; Wed, 14 May 2014 15:21:27 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405141521.s4EFLRHb090625@svn.freebsd.org> From: Bryan Drewery Date: Wed, 14 May 2014 15:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266026 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 15:21:28 -0000 Author: bdrewery Date: Wed May 14 15:21:27 2014 New Revision: 266026 URL: http://svnweb.freebsd.org/changeset/base/266026 Log: MFC r264795: Fix grammar error and trailing newline. Modified: stable/10/sys/kern/subr_prf.c Modified: stable/10/sys/kern/subr_prf.c ============================================================================== --- stable/10/sys/kern/subr_prf.c Wed May 14 15:19:52 2014 (r266025) +++ stable/10/sys/kern/subr_prf.c Wed May 14 15:21:27 2014 (r266026) @@ -914,7 +914,7 @@ number: while (percent < fmt) PCHAR(*percent++); /* - * Since we ignore an formatting argument it is no + * Since we ignore a formatting argument it is no * longer safe to obey the remaining formatting * arguments as the arguments will no longer match * the format specs. @@ -1122,4 +1122,3 @@ hexdump(const void *ptr, int length, con printf("\n"); } } - From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 15:22:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9389F196; Wed, 14 May 2014 15:22: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 6703D2A9F; Wed, 14 May 2014 15:22: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 s4EFM9UA091538; Wed, 14 May 2014 15:22:09 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EFM9Hs091537; Wed, 14 May 2014 15:22:09 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405141522.s4EFM9Hs091537@svn.freebsd.org> From: Bryan Drewery Date: Wed, 14 May 2014 15:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266027 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 15:22:09 -0000 Author: bdrewery Date: Wed May 14 15:22:08 2014 New Revision: 266027 URL: http://svnweb.freebsd.org/changeset/base/266027 Log: Add missing mergeinfo for r266026 Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 15:23:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 50D81416; Wed, 14 May 2014 15:23:07 +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 23BFD2AB2; Wed, 14 May 2014 15:23:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EFN74O091746; Wed, 14 May 2014 15:23:07 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EFN6lh091744; Wed, 14 May 2014 15:23:06 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405141523.s4EFN6lh091744@svn.freebsd.org> From: Bryan Drewery Date: Wed, 14 May 2014 15:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266029 - stable/10/share/skel X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 15:23:07 -0000 Author: bdrewery Date: Wed May 14 15:23:06 2014 New Revision: 266029 URL: http://svnweb.freebsd.org/changeset/base/266029 Log: MFC r264465: Prefer /etc/login.conf for some of these environment values. Modified: stable/10/share/skel/dot.cshrc stable/10/share/skel/dot.profile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/skel/dot.cshrc ============================================================================== --- stable/10/share/skel/dot.cshrc Wed May 14 15:22:42 2014 (r266028) +++ stable/10/share/skel/dot.cshrc Wed May 14 15:23:06 2014 (r266029) @@ -12,14 +12,15 @@ alias la ls -aF alias lf ls -FA alias ll ls -lAF +# These are normally set through /etc/login.conf. You may override them here +# if wanted. +# set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) +# setenv BLOCKSIZE K # A righteous umask -umask 22 - -set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) +# umask 22 setenv EDITOR vi setenv PAGER more -setenv BLOCKSIZE K if ($?prompt) then # An interactive shell -- set some stuff up Modified: stable/10/share/skel/dot.profile ============================================================================== --- stable/10/share/skel/dot.profile Wed May 14 15:22:42 2014 (r266028) +++ stable/10/share/skel/dot.profile Wed May 14 15:23:06 2014 (r266029) @@ -5,15 +5,16 @@ # see also sh(1), environ(7). # -# remove /usr/games if you want -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH +# These are normally set through /etc/login.conf. You may override them here +# if wanted. +# PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH +# BLOCKSIZE=K; export BLOCKSIZE # Setting TERM is normally done through /etc/ttys. Do only override # if you're sure that you'll never log in via telnet or xterm or a # serial line. # TERM=xterm; export TERM -BLOCKSIZE=K; export BLOCKSIZE EDITOR=vi; export EDITOR PAGER=more; export PAGER From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 15:24:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B0419554; Wed, 14 May 2014 15:24: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 9D0432ABF; Wed, 14 May 2014 15:24: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 s4EFOPUr091971; Wed, 14 May 2014 15:24:25 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EFOPIm091970; Wed, 14 May 2014 15:24:25 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405141524.s4EFOPIm091970@svn.freebsd.org> From: Bryan Drewery Date: Wed, 14 May 2014 15:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266030 - stable/10/usr.bin/sort X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 15:24:25 -0000 Author: bdrewery Date: Wed May 14 15:24:25 2014 New Revision: 266030 URL: http://svnweb.freebsd.org/changeset/base/266030 Log: MFC r264918: Fix spelling error. Modified: stable/10/usr.bin/sort/sort.1.in Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sort/sort.1.in ============================================================================== --- stable/10/usr.bin/sort/sort.1.in Wed May 14 15:23:06 2014 (r266029) +++ stable/10/usr.bin/sort/sort.1.in Wed May 14 15:24:25 2014 (r266030) @@ -147,7 +147,7 @@ specifications, they apply globally to a When attached to a specific key (see .Fl k ) , the ordering options override all global ordering options for -the key they are attahced to. +the key they are attached to. .Bl -tag -width indent .It Fl b, Fl Fl ignore-leading-blanks Ignore leading blank characters when comparing lines. From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 15:30:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 19313D44; Wed, 14 May 2014 15:30: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 05D682B34; Wed, 14 May 2014 15:30: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 s4EFUnQs094309; Wed, 14 May 2014 15:30:49 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EFUnQ1094308; Wed, 14 May 2014 15:30:49 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405141530.s4EFUnQ1094308@svn.freebsd.org> From: Bryan Drewery Date: Wed, 14 May 2014 15:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266031 - stable/10/sys/geom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 15:30:50 -0000 Author: bdrewery Date: Wed May 14 15:30:49 2014 New Revision: 266031 URL: http://svnweb.freebsd.org/changeset/base/266031 Log: MFC r264499: Make g_access() KASSERT() more useful. Modified: stable/10/sys/geom/geom_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_subr.c ============================================================================== --- stable/10/sys/geom/geom_subr.c Wed May 14 15:24:25 2014 (r266030) +++ stable/10/sys/geom/geom_subr.c Wed May 14 15:30:49 2014 (r266031) @@ -912,8 +912,9 @@ g_access(struct g_consumer *cp, int dcr, error = pp->geom->access(pp, dcr, dcw, dce); KASSERT(dcr > 0 || dcw > 0 || dce > 0 || error == 0, - ("Geom provider %s::%s failed closing ->access()", - pp->geom->class->name, pp->name)); + ("Geom provider %s::%s dcr=%d dcw=%d dce=%d error=%d failed " + "closing ->access()", pp->geom->class->name, pp->name, dcr, dcw, + dce, error)); if (!error) { /* * If we open first write, spoil any partner consumers. From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 15:35:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 55C0E4F2; Wed, 14 May 2014 15:35: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 41FC12BCD; Wed, 14 May 2014 15:35: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 s4EFZ2ta097351; Wed, 14 May 2014 15:35:02 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EFZ2wm097350; Wed, 14 May 2014 15:35:02 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405141535.s4EFZ2wm097350@svn.freebsd.org> From: Bryan Drewery Date: Wed, 14 May 2014 15:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266036 - stable/10/sys/geom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 15:35:02 -0000 Author: bdrewery Date: Wed May 14 15:35:01 2014 New Revision: 266036 URL: http://svnweb.freebsd.org/changeset/base/266036 Log: MFC r265072: Remove redundant include Modified: stable/10/sys/geom/geom_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Wed May 14 15:33:51 2014 (r266035) +++ stable/10/sys/geom/geom_disk.c Wed May 14 15:35:01 2014 (r266036) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 16:16:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9FEAB5C8; Wed, 14 May 2014 16:16: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 8C6D22F7A; Wed, 14 May 2014 16:16: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 s4EGGNMJ015738; Wed, 14 May 2014 16:16:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EGGNot015737; Wed, 14 May 2014 16:16:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405141616.s4EGGNot015737@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 May 2014 16:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266042 - stable/10/sbin/gvinum X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 16:16:23 -0000 Author: marius Date: Wed May 14 16:16:23 2014 New Revision: 266042 URL: http://svnweb.freebsd.org/changeset/base/266042 Log: MFC: r256561 Prevent an unlikely, but real double free issue in gvinum(8). Coverity ID: 1018965 Modified: stable/10/sbin/gvinum/gvinum.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/gvinum/gvinum.c ============================================================================== --- stable/10/sbin/gvinum/gvinum.c Wed May 14 15:52:36 2014 (r266041) +++ stable/10/sbin/gvinum/gvinum.c Wed May 14 16:16:23 2014 (r266042) @@ -423,6 +423,7 @@ create_drive(char *device) const char *errstr; char *drivename, *dname; int drives, i, flags, volumes, subdisks, plexes; + int found = 0; flags = plexes = subdisks = volumes = 0; drives = 1; @@ -450,10 +451,8 @@ create_drive(char *device) errstr = gctl_issue(req); if (errstr != NULL) { warnx("error creating drive: %s", errstr); - gctl_free(req); - return (NULL); + drivename = NULL; } else { - gctl_free(req); /* XXX: This is needed because we have to make sure the drives * are created before we return. */ /* Loop until it's in the config. */ @@ -463,14 +462,18 @@ create_drive(char *device) /* If we got a different name, quit. */ if (dname == NULL) continue; - if (strcmp(dname, drivename)) { - free(dname); - return (drivename); - } + if (strcmp(dname, drivename)) + found = 1; free(dname); dname = NULL; + if (found) + break; usleep(100000); /* Sleep for 0.1s */ } + if (found == 0) { + warnx("error creating drive"); + drivename = NULL; + } } gctl_free(req); return (drivename); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 16:18:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A312E738; Wed, 14 May 2014 16:18:08 +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 8E77C2F8E; Wed, 14 May 2014 16:18:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EGI8bs016008; Wed, 14 May 2014 16:18:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EGI86k016007; Wed, 14 May 2014 16:18:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405141618.s4EGI86k016007@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 May 2014 16:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266043 - stable/10/sbin/gvinum X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 16:18:08 -0000 Author: marius Date: Wed May 14 16:18:08 2014 New Revision: 266043 URL: http://svnweb.freebsd.org/changeset/base/266043 Log: MFC: r265535 - Sprinkle const and static as appropriate. - Fix whitespace bugs. - Remove pointless returns in void functions. - Nuke pointless switch cases mirroring the default. Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sbin/gvinum/gvinum.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/gvinum/gvinum.c ============================================================================== --- stable/10/sbin/gvinum/gvinum.c Wed May 14 16:16:23 2014 (r266042) +++ stable/10/sbin/gvinum/gvinum.c Wed May 14 16:18:08 2014 (r266043) @@ -58,35 +58,36 @@ #include "gvinum.h" -void gvinum_attach(int, char **); -void gvinum_concat(int, char **); -void gvinum_create(int, char **); -void gvinum_detach(int, char **); -void gvinum_grow(int, char **); -void gvinum_help(void); -void gvinum_list(int, char **); -void gvinum_move(int, char **); -void gvinum_mirror(int, char **); -void gvinum_parityop(int, char **, int); -void gvinum_printconfig(int, char **); -void gvinum_raid5(int, char **); -void gvinum_rename(int, char **); -void gvinum_resetconfig(int, char **); -void gvinum_rm(int, char **); -void gvinum_saveconfig(void); -void gvinum_setstate(int, char **); -void gvinum_start(int, char **); -void gvinum_stop(int, char **); -void gvinum_stripe(int, char **); -void parseline(int, char **); -void printconfig(FILE *, char *); - -char *create_drive(char *); -void create_volume(int, char **, char *); -char *find_name(const char *, int, int); -char *find_pattern(char *, char *); -void copy_device(struct gv_drive *, const char *); -#define find_drive() find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME) +static void gvinum_attach(int, char * const *); +static void gvinum_concat(int, char * const *); +static void gvinum_create(int, char * const *); +static void gvinum_detach(int, char * const *); +static void gvinum_grow(int, char * const *); +static void gvinum_help(void); +static void gvinum_list(int, char * const *); +static void gvinum_move(int, char * const *); +static void gvinum_mirror(int, char * const *); +static void gvinum_parityop(int, char * const * , int); +static void gvinum_printconfig(int, char * const *); +static void gvinum_raid5(int, char * const *); +static void gvinum_rename(int, char * const *); +static void gvinum_resetconfig(int, char * const *); +static void gvinum_rm(int, char * const *); +static void gvinum_saveconfig(void); +static void gvinum_setstate(int, char * const *); +static void gvinum_start(int, char * const *); +static void gvinum_stop(int, char * const *); +static void gvinum_stripe(int, char * const *); +static void parseline(int, char * const *); +static void printconfig(FILE *, const char *); + +static char *create_drive(const char *); +static void create_volume(int, char * const * , const char *); +static char *find_name(const char *, int, int); +static const char *find_pattern(char *, const char *); +static void copy_device(struct gv_drive *, const char *); +#define find_drive() \ + find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME) int main(int argc, char **argv) @@ -132,8 +133,8 @@ main(int argc, char **argv) } /* Attach a plex to a volume or a subdisk to a plex. */ -void -gvinum_attach(int argc, char **argv) +static void +gvinum_attach(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -169,8 +170,8 @@ gvinum_attach(int argc, char **argv) gctl_free(req); } -void -gvinum_create(int argc, char **argv) +static void +gvinum_create(int argc, char * const *argv) { struct gctl_req *req; struct gv_drive *d; @@ -402,8 +403,8 @@ gvinum_create(int argc, char **argv) } /* Create a concatenated volume. */ -void -gvinum_concat(int argc, char **argv) +static void +gvinum_concat(int argc, char * const *argv) { if (argc < 2) { @@ -413,10 +414,9 @@ gvinum_concat(int argc, char **argv) create_volume(argc, argv, "concat"); } - /* Create a drive quick and dirty. */ -char * -create_drive(char *device) +static char * +create_drive(const char *device) { struct gv_drive *d; struct gctl_req *req; @@ -479,12 +479,12 @@ create_drive(char *device) return (drivename); } -/* +/* * General routine for creating a volume. Mainly for use by concat, mirror, * raid5 and stripe commands. */ -void -create_volume(int argc, char **argv, char *verb) +static void +create_volume(int argc, char * const *argv, const char *verb) { struct gctl_req *req; const char *errstr; @@ -518,7 +518,7 @@ create_volume(int argc, char **argv, cha snprintf(buf, sizeof(buf), "drive%d", drives++); /* First we create the drive. */ - drivename = create_drive(argv[i]); + drivename = create_drive(argv[i]); if (drivename == NULL) goto bad; /* Then we add it to the request. */ @@ -534,7 +534,7 @@ create_volume(int argc, char **argv, cha /* Then we send a request to actually create the volumes. */ gctl_ro_param(req, "verb", -1, verb); - gctl_ro_param(req, "flags", sizeof(int), &flags); + gctl_ro_param(req, "flags", sizeof(int), &flags); gctl_ro_param(req, "drives", sizeof(int), &drives); gctl_ro_param(req, "name", -1, volname); errstr = gctl_issue(req); @@ -545,8 +545,8 @@ bad: } /* Parse a line of the config, return the word after . */ -char * -find_pattern(char *line, char *pattern) +static const char * +find_pattern(char *line, const char *pattern) { char *ptr; @@ -563,12 +563,12 @@ find_pattern(char *line, char *pattern) } /* Find a free name for an object given a prefix. */ -char * +static char * find_name(const char *prefix, int type, int namelen) { struct gctl_req *req; - char comment[1], buf[GV_CFG_LEN - 1], *name, *sname, *ptr; - const char *errstr; + char comment[1], buf[GV_CFG_LEN - 1], *sname, *ptr; + const char *errstr, *name; int i, n, begin, len, conflict; char line[1024]; @@ -633,9 +633,10 @@ find_name(const char *prefix, int type, return (NULL); } -void +static void copy_device(struct gv_drive *d, const char *device) { + if (strncmp(device, "/dev/", 5) == 0) strlcpy(d->device, (device + 5), sizeof(d->device)); else @@ -643,8 +644,8 @@ copy_device(struct gv_drive *d, const ch } /* Detach a plex or subdisk from its parent. */ -void -gvinum_detach(int argc, char **argv) +static void +gvinum_detach(int argc, char * const *argv) { const char *errstr; struct gctl_req *req; @@ -654,7 +655,7 @@ gvinum_detach(int argc, char **argv) optreset = 1; optind = 1; while ((i = getopt(argc, argv, "f")) != -1) { - switch(i) { + switch (i) { case 'f': flags |= GV_FLAG_F; break; @@ -682,9 +683,10 @@ gvinum_detach(int argc, char **argv) gctl_free(req); } -void +static void gvinum_help(void) { + printf("COMMANDS\n" "checkparity [-f] plex\n" " Check the parity blocks of a RAID-5 plex.\n" @@ -739,12 +741,10 @@ gvinum_help(void) "stripe [-fv] [-n name] drives\n" " Create a striped volume from the specified drives.\n" ); - - return; } -void -gvinum_setstate(int argc, char **argv) +static void +gvinum_setstate(int argc, char * const *argv) { struct gctl_req *req; int flags, i; @@ -798,8 +798,8 @@ gvinum_setstate(int argc, char **argv) gctl_free(req); } -void -gvinum_list(int argc, char **argv) +static void +gvinum_list(int argc, char * const *argv) { struct gctl_req *req; int flags, i, j; @@ -860,12 +860,11 @@ gvinum_list(int argc, char **argv) printf("%s", config); gctl_free(req); - return; } /* Create a mirrored volume. */ -void -gvinum_mirror(int argc, char **argv) +static void +gvinum_mirror(int argc, char * const *argv) { if (argc < 2) { @@ -876,8 +875,8 @@ gvinum_mirror(int argc, char **argv) } /* Note that move is currently of form '[-r] target object [...]' */ -void -gvinum_move(int argc, char **argv) +static void +gvinum_move(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -927,17 +926,17 @@ gvinum_move(int argc, char **argv) if (errstr != NULL) warnx("can't move object(s): %s", errstr); gctl_free(req); - return; } -void -gvinum_printconfig(int argc, char **argv) +static void +gvinum_printconfig(int argc, char * const *argv) { + printconfig(stdout, ""); } -void -gvinum_parityop(int argc, char **argv, int rebuild) +static void +gvinum_parityop(int argc, char * const *argv, int rebuild) { struct gctl_req *req; int flags, i; @@ -961,7 +960,6 @@ gvinum_parityop(int argc, char **argv, i case 'v': flags |= GV_FLAG_V; break; - case '?': default: warnx("invalid flag '%c'", i); return; @@ -989,8 +987,8 @@ gvinum_parityop(int argc, char **argv, i } /* Create a RAID-5 volume. */ -void -gvinum_raid5(int argc, char **argv) +static void +gvinum_raid5(int argc, char * const *argv) { if (argc < 2) { @@ -1000,9 +998,8 @@ gvinum_raid5(int argc, char **argv) create_volume(argc, argv, "raid5"); } - -void -gvinum_rename(int argc, char **argv) +static void +gvinum_rename(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -1018,7 +1015,6 @@ gvinum_rename(int argc, char **argv) case 'r': flags |= GV_FLAG_R; break; - case '?': default: return; } @@ -1051,11 +1047,10 @@ gvinum_rename(int argc, char **argv) if (errstr != NULL) warnx("can't rename object: %s", errstr); gctl_free(req); - return; } -void -gvinum_rm(int argc, char **argv) +static void +gvinum_rm(int argc, char * const *argv) { struct gctl_req *req; int flags, i, j; @@ -1073,7 +1068,6 @@ gvinum_rm(int argc, char **argv) case 'r': flags |= GV_FLAG_R; break; - case '?': default: return; } @@ -1101,8 +1095,8 @@ gvinum_rm(int argc, char **argv) gctl_free(req); } -void -gvinum_resetconfig(int argc, char **argv) +static void +gvinum_resetconfig(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -1150,7 +1144,7 @@ gvinum_resetconfig(int argc, char **argv printf("gvinum configuration obliterated\n"); } -void +static void gvinum_saveconfig(void) { struct gctl_req *req; @@ -1165,8 +1159,8 @@ gvinum_saveconfig(void) gctl_free(req); } -void -gvinum_start(int argc, char **argv) +static void +gvinum_start(int argc, char * const *argv) { struct gctl_req *req; int i, initsize, j; @@ -1186,7 +1180,6 @@ gvinum_start(int argc, char **argv) case 'S': initsize = atoi(optarg); break; - case '?': default: return; } @@ -1218,8 +1211,8 @@ gvinum_start(int argc, char **argv) gctl_free(req); } -void -gvinum_stop(int argc, char **argv) +static void +gvinum_stop(int argc, char * const *argv) { int err, fileid; @@ -1253,8 +1246,8 @@ gvinum_stop(int argc, char **argv) } /* Create a striped volume. */ -void -gvinum_stripe(int argc, char **argv) +static void +gvinum_stripe(int argc, char * const *argv) { if (argc < 2) { @@ -1265,8 +1258,8 @@ gvinum_stripe(int argc, char **argv) } /* Grow a subdisk by adding disk backed by provider. */ -void -gvinum_grow(int argc, char **argv) +static void +gvinum_grow(int argc, char * const *argv) { struct gctl_req *req; char *drive, *sdname; @@ -1344,9 +1337,10 @@ gvinum_grow(int argc, char **argv) gctl_free(req); } -void -parseline(int argc, char **argv) +static void +parseline(int argc, char * const *argv) { + if (argc <= 0) return; @@ -1406,8 +1400,6 @@ parseline(int argc, char **argv) gvinum_parityop(argc, argv, 1); else printf("unknown command '%s'\n", argv[0]); - - return; } /* @@ -1415,8 +1407,8 @@ parseline(int argc, char **argv) * gvinum_create when called without an argument, in order to give the user * something to edit. */ -void -printconfig(FILE *of, char *comment) +static void +printconfig(FILE *of, const char *comment) { struct gctl_req *req; struct utsname uname_s; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 16:32:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5BCE0E7B; Wed, 14 May 2014 16:32: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 4602D2106; Wed, 14 May 2014 16:32:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EGWVIf024269; Wed, 14 May 2014 16:32:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EGWR3n024251; Wed, 14 May 2014 16:32:27 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141632.s4EGWR3n024251@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 16:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266046 - in stable/10/sys: arm/arm arm/conf arm/include arm/mv arm/mv/armadaxp boot/fdt/dts conf dev/ic dev/mvs dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 16:32:31 -0000 Author: ian Date: Wed May 14 16:32:27 2014 New Revision: 266046 URL: http://svnweb.freebsd.org/changeset/base/266046 Log: MFC r257170, r257171, r257172, r257240, r257278, r257279, r257280, r257281, r257282, r257332 Wait for DesignWare UART transfers completion before accessing line control Enable UART busy detection handling for Armada XP - based board Enable SATA interface on Armada XP Run mvs SATA driver on Armada XP instead of old mv_sata Retire arm_remap_nocache() and the data and constants associated with it. Remove hard-coded mappings related to Armada XP support Fix-up DTB for Armada XP registers' base according to the actual settings Change Armada XP kernel load address to the u-boot's end address Remove not working and deprecated PJ4Bv6 support Switch off explicit broadcasting of the TLB flush operations for PJ4B CPU Add missing ARMv6 CPU functions to ARM Makefile Modified: stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/cpufunc_asm_pj4b.S stable/10/sys/arm/arm/identcpu.c stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/mp_machdep.c stable/10/sys/arm/conf/ARMADAXP stable/10/sys/arm/include/armreg.h stable/10/sys/arm/include/cpufunc.h stable/10/sys/arm/mv/armadaxp/std.armadaxp stable/10/sys/arm/mv/common.c stable/10/sys/arm/mv/mv_machdep.c stable/10/sys/arm/mv/mv_sata.c stable/10/sys/boot/fdt/dts/db78460.dts stable/10/sys/conf/Makefile.arm stable/10/sys/dev/ic/ns16550.h stable/10/sys/dev/mvs/mvs_soc.c stable/10/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc.c ============================================================================== --- stable/10/sys/arm/arm/cpufunc.c Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/arm/cpufunc.c Wed May 14 16:32:27 2014 (r266046) @@ -541,65 +541,6 @@ struct cpu_functions pj4bv7_cpufuncs = { pj4bv7_setup /* cpu setup */ }; - -struct cpu_functions pj4bv6_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - arm11_drain_writebuf, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* Domain */ - pj4b_setttb, /* Setttb */ - cpufunc_faultstatus, /* Faultstatus */ - cpufunc_faultaddress, /* Faultaddress */ - - /* TLB functions */ - - arm11_tlb_flushID, /* tlb_flushID */ - arm11_tlb_flushID_SE, /* tlb_flushID_SE */ - arm11_tlb_flushI, /* tlb_flushI */ - arm11_tlb_flushI_SE, /* tlb_flushI_SE */ - arm11_tlb_flushD, /* tlb_flushD */ - arm11_tlb_flushD_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - armv6_icache_sync_all, /* icache_sync_all */ - pj4b_icache_sync_range, /* icache_sync_range */ - - armv6_dcache_wbinv_all, /* dcache_wbinv_all */ - pj4b_dcache_wbinv_range, /* dcache_wbinv_range */ - pj4b_dcache_inv_range, /* dcache_inv_range */ - pj4b_dcache_wb_range, /* dcache_wb_range */ - - armv6_idcache_wbinv_all, /* idcache_wbinv_all */ - pj4b_idcache_wbinv_range, /* idcache_wbinv_all */ - - (void *)cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - pj4b_drain_readbuf, /* flush_prefetchbuf */ - arm11_drain_writebuf, /* drain_writebuf */ - pj4b_flush_brnchtgt_all, /* flush_brnchtgt_C */ - pj4b_flush_brnchtgt_va, /* flush_brnchtgt_E */ - - (void *)cpufunc_nullop, /* sleep */ - - /* Soft functions */ - - cpufunc_null_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - arm11_context_switch, /* context_switch */ - - pj4bv6_setup /* cpu setup */ -}; #endif /* CPU_MV_PJ4B */ #ifdef CPU_SA110 @@ -1496,27 +1437,14 @@ set_cpufuncs() #endif /* CPU_CORTEXA */ #if defined(CPU_MV_PJ4B) - if (cputype == CPU_ID_MV88SV581X_V6 || - cputype == CPU_ID_MV88SV581X_V7 || + if (cputype == CPU_ID_MV88SV581X_V7 || cputype == CPU_ID_MV88SV584X_V7 || - cputype == CPU_ID_ARM_88SV581X_V6 || cputype == CPU_ID_ARM_88SV581X_V7) { - if (cpu_pfr(0) & ARM_PFR0_THUMBEE_MASK) - cpufuncs = pj4bv7_cpufuncs; - else - cpufuncs = pj4bv6_cpufuncs; - - get_cachetype_cp15(); - pmap_pte_init_mmu_v6(); - goto out; - } else if (cputype == CPU_ID_ARM_88SV584X_V6 || - cputype == CPU_ID_MV88SV584X_V6) { - cpufuncs = pj4bv6_cpufuncs; + cpufuncs = pj4bv7_cpufuncs; get_cachetype_cp15(); pmap_pte_init_mmu_v6(); goto out; } - #endif /* CPU_MV_PJ4B */ #ifdef CPU_SA110 if (cputype == CPU_ID_SA110) { @@ -2446,44 +2374,6 @@ arm11x6_setup(char *args) #ifdef CPU_MV_PJ4B void -pj4bv6_setup(char *args) -{ - int cpuctrl; - - pj4b_config(); - - cpuctrl = CPU_CONTROL_MMU_ENABLE; -#ifndef ARM32_DISABLE_ALIGNMENT_FAULTS - cpuctrl |= CPU_CONTROL_AFLT_ENABLE; -#endif - cpuctrl |= CPU_CONTROL_DC_ENABLE; - cpuctrl |= (0xf << 3); -#ifdef __ARMEB__ - cpuctrl |= CPU_CONTROL_BEND_ENABLE; -#endif - cpuctrl |= CPU_CONTROL_SYST_ENABLE; - cpuctrl |= CPU_CONTROL_BPRD_ENABLE; - cpuctrl |= CPU_CONTROL_IC_ENABLE; - if (vector_page == ARM_VECTORS_HIGH) - cpuctrl |= CPU_CONTROL_VECRELOC; - cpuctrl |= (0x5 << 16); - cpuctrl |= CPU_CONTROL_V6_EXTPAGE; - /* XXX not yet */ - /* cpuctrl |= CPU_CONTROL_L2_ENABLE; */ - - /* Make sure caches are clean. */ - cpu_idcache_wbinv_all(); - cpu_l2cache_wbinv_all(); - - /* Set the control register */ - ctrl = cpuctrl; - cpu_control(0xffffffff, cpuctrl); - - cpu_idcache_wbinv_all(); - cpu_l2cache_wbinv_all(); -} - -void pj4bv7_setup(args) char *args; { Modified: stable/10/sys/arm/arm/cpufunc_asm_pj4b.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_pj4b.S Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/arm/cpufunc_asm_pj4b.S Wed May 14 16:32:27 2014 (r266046) @@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$"); #include -.Lpj4b_cache_line_size: - .word _C_LABEL(arm_pdcache_line_size) - .Lpj4b_sf_ctrl_reg: .word 0xf1021820 @@ -52,135 +49,6 @@ ENTRY(pj4b_setttb) RET END(pj4b_setttb) -ENTRY_NP(armv6_icache_sync_all) - /* - * We assume that the code here can never be out of sync with the - * dcache, so that we can safely flush the Icache and fall through - * into the Dcache cleaning code. - */ - mov r0, #0 - mcr p15, 0, r0, c7, c5, 0 /* Invalidate ICache */ - mcr p15, 0, r0, c7, c10, 0 /* Clean (don't invalidate) DCache */ - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(armv6_icache_sync_all) - -ENTRY(pj4b_icache_sync_range) - sub r1, r1, #1 - add r1, r0, r1 - mcrr p15, 0, r1, r0, c5 /* invalidate IC range */ - mcrr p15, 0, r1, r0, c12 /* clean DC range */ - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(pj4b_icache_sync_range) - -ENTRY(pj4b_dcache_inv_range) - ldr ip, .Lpj4b_cache_line_size - ldr ip, [ip] - sub r1, r1, #1 /* Don't overrun */ - sub r3, ip, #1 - and r2, r0, r3 - add r1, r1, r2 - bic r0, r0, r3 - - mcr p15, 0, r0, c7, c10, 5 /* Data Memory Barrier err:4413 */ -1: - mcr p15, 0, r0, c7, c6, 1 - add r0, r0, ip - subs r1, r1, ip - bpl 1b - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(pj4b_dcache_inv_range) - -ENTRY(armv6_idcache_wbinv_all) - mov r0, #0 - mcr p15, 0, r0, c7, c5, 0 /* invalidate ICache */ - mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate DCache */ - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(armv6_idcache_wbinv_all) - -ENTRY(armv6_dcache_wbinv_all) - mov r0, #0 - mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate DCache */ - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(armv6_dcache_wbinv_all) - -ENTRY(pj4b_idcache_wbinv_range) - ldr ip, .Lpj4b_cache_line_size - ldr ip, [ip] - sub r1, r1, #1 /* Don't overrun */ - sub r3, ip, #1 - and r2, r0, r3 - add r1, r1, r2 - bic r0, r0, r3 - - mcr p15, 0, r0, c7, c10, 5 /* Data Memory Barrier err:4611 */ -1: -#ifdef SMP - /* Request for ownership */ - ldr r2, [r0] - str r2, [r0] -#endif - mcr p15, 0, r0, c7, c5, 1 - mcr p15, 0, r0, c7, c14, 1 /* L2C clean and invalidate entry */ - add r0, r0, ip - subs r1, r1, ip - bpl 1b - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(pj4b_idcache_wbinv_range) - -ENTRY(pj4b_dcache_wbinv_range) - ldr ip, .Lpj4b_cache_line_size - ldr ip, [ip] - sub r1, r1, #1 /* Don't overrun */ - sub r3, ip, #1 - and r2, r0, r3 - add r1, r1, r2 - bic r0, r0, r3 - - mcr p15, 0, r0, c7, c10, 5 /* Data Memory Barrier err:4611 */ -1: -#ifdef SMP - /* Request for ownership */ - ldr r2, [r0] - str r2, [r0] -#endif - mcr p15, 0, r0, c7, c14, 1 - add r0, r0, ip - subs r1, r1, ip - bpl 1b - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(pj4b_dcache_wbinv_range) - -ENTRY(pj4b_dcache_wb_range) - ldr ip, .Lpj4b_cache_line_size - ldr ip, [ip] - sub r1, r1, #1 /* Don't overrun */ - sub r3, ip, #1 - and r2, r0, r3 - add r1, r1, r2 - bic r0, r0, r3 - - mcr p15, 0, r0, c7, c10, 5 /* Data Memory Barrier err:4611 */ -1: -#ifdef SMP - /* Request for ownership */ - ldr r2, [r0] - str r2, [r0] -#endif - mcr p15, 0, r0, c7, c10, 1 /* L2C clean single entry by MVA */ - add r0, r0, ip - subs r1, r1, ip - bpl 1b - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(pj4b_dcache_wb_range) - ENTRY(pj4b_drain_readbuf) mcr p15, 0, r0, c7, c5, 4 /* flush prefetch buffers */ RET Modified: stable/10/sys/arm/arm/identcpu.c ============================================================================== --- stable/10/sys/arm/arm/identcpu.c Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/arm/identcpu.c Wed May 14 16:32:27 2014 (r266046) @@ -321,18 +321,10 @@ const struct cpuidtab cpuids[] = { { CPU_ID_MV88FR571_VD, CPU_CLASS_MARVELL, "Feroceon 88FR571-VD", generic_steppings }, - { CPU_ID_MV88SV581X_V6, CPU_CLASS_MARVELL, "Sheeva 88SV581x", - generic_steppings }, - { CPU_ID_ARM_88SV581X_V6, CPU_CLASS_MARVELL, "Sheeva 88SV581x", - generic_steppings }, { CPU_ID_MV88SV581X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV581x", generic_steppings }, { CPU_ID_ARM_88SV581X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV581x", generic_steppings }, - { CPU_ID_MV88SV584X_V6, CPU_CLASS_MARVELL, "Sheeva 88SV584x", - generic_steppings }, - { CPU_ID_ARM_88SV584X_V6, CPU_CLASS_MARVELL, "Sheeva 88SV584x", - generic_steppings }, { CPU_ID_MV88SV584X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV584x", generic_steppings }, Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/arm/locore.S Wed May 14 16:32:27 2014 (r266046) @@ -266,10 +266,6 @@ mmu_init_table: /* map VA 0xc0000000..0xc3ffffff to PA */ MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) MMU_INIT(0x48000000, 0x48000000, 1, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) -#if defined(CPU_MV_PJ4B) - /* map VA 0xf1000000..0xf1100000 to PA 0xd0000000 */ - MMU_INIT(0xf1000000, 0xd0000000, 1, L1_TYPE_S|L1_SHARED|L1_S_B|L1_S_AP(AP_KRW)) -#endif /* CPU_MV_PJ4B */ #endif /* SMP */ .word 0 /* end of table */ #endif Modified: stable/10/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/10/sys/arm/arm/mp_machdep.c Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/arm/mp_machdep.c Wed May 14 16:32:27 2014 (r266046) @@ -52,6 +52,10 @@ __FBSDID("$FreeBSD$"); #ifdef VFP #include #endif +#ifdef CPU_MV_PJ4B +#include +#include +#endif #include "opt_smp.h" @@ -131,8 +135,8 @@ cpu_mp_start(void) #if defined(CPU_MV_PJ4B) /* Add ARMADAXP registers required for snoop filter initialization */ - ((int *)(temp_pagetable_va))[0xf1000000 >> L1_S_SHIFT] = - L1_TYPE_S|L1_SHARED|L1_S_B|L1_S_AP(AP_KRW)|0xd0000000; + ((int *)(temp_pagetable_va))[MV_BASE >> L1_S_SHIFT] = + L1_TYPE_S|L1_SHARED|L1_S_B|L1_S_AP(AP_KRW)|fdt_immr_pa; #endif temp_pagetable = (void*)(vtophys(temp_pagetable_va)); Modified: stable/10/sys/arm/conf/ARMADAXP ============================================================================== --- stable/10/sys/arm/conf/ARMADAXP Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/conf/ARMADAXP Wed May 14 16:32:27 2014 (r266046) @@ -76,8 +76,7 @@ device pass device da # SATA -device ata -#device mvs +device mvs # Serial ports device uart Modified: stable/10/sys/arm/include/armreg.h ============================================================================== --- stable/10/sys/arm/include/armreg.h Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/include/armreg.h Wed May 14 16:32:27 2014 (r266046) @@ -172,14 +172,10 @@ #define CPU_ID_MV88FR571_41 0x41159260 /* Marvell Feroceon 88FR571-VD Core (actual ID from CPU reg) */ #endif -#define CPU_ID_MV88SV581X_V6 0x560F5810 /* Marvell Sheeva 88SV581x v6 Core */ #define CPU_ID_MV88SV581X_V7 0x561F5810 /* Marvell Sheeva 88SV581x v7 Core */ -#define CPU_ID_MV88SV584X_V6 0x561F5840 /* Marvell Sheeva 88SV584x v6 Core */ #define CPU_ID_MV88SV584X_V7 0x562F5840 /* Marvell Sheeva 88SV584x v7 Core */ /* Marvell's CPUIDs with ARM ID in implementor field */ -#define CPU_ID_ARM_88SV581X_V6 0x410fb760 /* Marvell Sheeva 88SV581x v6 Core */ #define CPU_ID_ARM_88SV581X_V7 0x413FC080 /* Marvell Sheeva 88SV581x v7 Core */ -#define CPU_ID_ARM_88SV584X_V6 0x410FB020 /* Marvell Sheeva 88SV584x v6 Core */ #define CPU_ID_FA526 0x66015260 #define CPU_ID_FA626TE 0x66056260 Modified: stable/10/sys/arm/include/cpufunc.h ============================================================================== --- stable/10/sys/arm/include/cpufunc.h Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/include/cpufunc.h Wed May 14 16:32:27 2014 (r266046) @@ -188,7 +188,7 @@ extern u_int cputype; #else void tlb_broadcast(int); -#ifdef CPU_CORTEXA +#if defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) #define TLB_BROADCAST /* No need to explicitely send an IPI */ #else #define TLB_BROADCAST tlb_broadcast(7) @@ -482,14 +482,6 @@ void arm11_drain_writebuf (void); void pj4b_setttb (u_int); -void pj4b_icache_sync_range (vm_offset_t, vm_size_t); - -void pj4b_dcache_wbinv_range (vm_offset_t, vm_size_t); -void pj4b_dcache_inv_range (vm_offset_t, vm_size_t); -void pj4b_dcache_wb_range (vm_offset_t, vm_size_t); - -void pj4b_idcache_wbinv_range (vm_offset_t, vm_size_t); - void pj4b_drain_readbuf (void); void pj4b_flush_brnchtgt_all (void); void pj4b_flush_brnchtgt_va (u_int); @@ -523,7 +515,6 @@ void armv7_drain_writebuf (void); void armv7_sev (void); u_int armv7_auxctrl (u_int, u_int); void pj4bv7_setup (char *string); -void pj4bv6_setup (char *string); void pj4b_config (void); int get_core_id (void); Modified: stable/10/sys/arm/mv/armadaxp/std.armadaxp ============================================================================== --- stable/10/sys/arm/mv/armadaxp/std.armadaxp Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/mv/armadaxp/std.armadaxp Wed May 14 16:32:27 2014 (r266046) @@ -1,16 +1,16 @@ # $FreeBSD$ -# kernel gets loaded at 0x00f00000 by the loader, but runs at virtual address -# 0xc0f00000. RAM starts at 0. We put the pagetable at a reasonable place +# kernel gets loaded at 0x00200000 by the loader, but runs at virtual address +# 0xc0200000. RAM starts at 0. We put the pagetable at a reasonable place # in memory, but may need to bounce it higher if there's a problem with this. # We could paper over this by loading the kernel at 0xc0000000 virtual, but # that leads to other complications, so we'll just reclaim the lower region of # ram after we're loaded. Put the page tables for startup at 1MB. -makeoptions KERNPHYSADDR=0x00f00000 -makeoptions KERNVIRTADDR=0xc0f00000 +makeoptions KERNPHYSADDR=0x00200000 +makeoptions KERNVIRTADDR=0xc0200000 -options KERNPHYSADDR=0x00f00000 -options KERNVIRTADDR=0xc0f00000 +options KERNPHYSADDR=0x00200000 +options KERNVIRTADDR=0xc0200000 options PHYSADDR=0x00000000 options STARTUP_PAGETABLE_ADDR=0x00100000 Modified: stable/10/sys/arm/mv/common.c ============================================================================== --- stable/10/sys/arm/mv/common.c Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/mv/common.c Wed May 14 16:32:27 2014 (r266046) @@ -2078,9 +2078,79 @@ fdt_fixup_busfreq(phandle_t root) OF_setprop(sb, "bus-frequency", (void *)&freq, sizeof(freq)); } +static void +fdt_fixup_ranges(phandle_t root) +{ + phandle_t node; + pcell_t par_addr_cells, addr_cells, size_cells; + pcell_t ranges[3], reg[2], *rangesptr; + int len, tuple_size, tuples_count; + uint32_t base; + + /* Fix-up SoC ranges according to real fdt_immr_pa */ + if ((node = fdt_find_compatible(root, "simple-bus", 1)) != 0) { + if (fdt_addrsize_cells(node, &addr_cells, &size_cells) == 0 && + (par_addr_cells = fdt_parent_addr_cells(node) <= 2)) { + tuple_size = sizeof(pcell_t) * (par_addr_cells + + addr_cells + size_cells); + len = OF_getprop(node, "ranges", ranges, + sizeof(ranges)); + tuples_count = len / tuple_size; + /* Unexpected settings are not supported */ + if (tuples_count != 1) + goto fixup_failed; + + rangesptr = &ranges[0]; + rangesptr += par_addr_cells; + base = fdt_data_get((void *)rangesptr, addr_cells); + *rangesptr = cpu_to_fdt32(fdt_immr_pa); + if (OF_setprop(node, "ranges", (void *)&ranges[0], + sizeof(ranges)) < 0) + goto fixup_failed; + } + } + + /* Fix-up PCIe reg according to real PCIe registers' PA */ + if ((node = fdt_find_compatible(root, "mrvl,pcie", 1)) != 0) { + if (fdt_addrsize_cells(OF_parent(node), &par_addr_cells, + &size_cells) == 0) { + tuple_size = sizeof(pcell_t) * (par_addr_cells + + size_cells); + len = OF_getprop(node, "reg", reg, sizeof(reg)); + tuples_count = len / tuple_size; + /* Unexpected settings are not supported */ + if (tuples_count != 1) + goto fixup_failed; + + base = fdt_data_get((void *)®[0], par_addr_cells); + base &= ~0xFF000000; + base |= fdt_immr_pa; + reg[0] = cpu_to_fdt32(base); + if (OF_setprop(node, "reg", (void *)®[0], + sizeof(reg)) < 0) + goto fixup_failed; + } + } + /* Fix-up succeeded. May return and continue */ + return; + +fixup_failed: + while (1) { + /* + * In case of any error while fixing ranges just hang. + * 1. No message can be displayed yet since console + * is not initialized. + * 2. Going further will cause failure on bus_space_map() + * relying on the wrong ranges or data abort when + * accessing PCIe registers. + */ + } +} + struct fdt_fixup_entry fdt_fixup_table[] = { { "mrvl,DB-88F6281", &fdt_fixup_busfreq }, { "mrvl,DB-78460", &fdt_fixup_busfreq }, + { "mrvl,DB-78460", &fdt_fixup_ranges }, { NULL, NULL } }; Modified: stable/10/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/10/sys/arm/mv/mv_machdep.c Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/mv/mv_machdep.c Wed May 14 16:32:27 2014 (r266046) @@ -329,6 +329,19 @@ initarm_devmap_init(void) i = 0; arm_devmap_register_table(&fdt_devmap[0]); +#ifdef SOC_MV_ARMADAXP + vm_paddr_t cur_immr_pa; + + /* + * Acquire SoC registers' base passed by u-boot and fill devmap + * accordingly. DTB is going to be modified basing on this data + * later. + */ + __asm __volatile("mrc p15, 4, %0, c15, c0, 0" : "=r" (cur_immr_pa)); + cur_immr_pa = (cur_immr_pa << 13) & 0xff000000; + if (cur_immr_pa != 0) + fdt_immr_pa = cur_immr_pa; +#endif /* * IMMR range. */ Modified: stable/10/sys/arm/mv/mv_sata.c ============================================================================== --- stable/10/sys/arm/mv/mv_sata.c Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/arm/mv/mv_sata.c Wed May 14 16:32:27 2014 (r266046) @@ -200,6 +200,7 @@ sata_probe(device_t dev) case MV_DEV_88F6282: case MV_DEV_MV78100: case MV_DEV_MV78100_Z0: + case MV_DEV_MV78460: sc->sc_version = 2; sc->sc_edma_qlen = 32; break; Modified: stable/10/sys/boot/fdt/dts/db78460.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/db78460.dts Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/boot/fdt/dts/db78460.dts Wed May 14 16:32:27 2014 (r266046) @@ -116,6 +116,7 @@ reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; + busy-detect = <1>; interrupts = <41>; interrupt-parent = <&MPIC>; }; @@ -126,6 +127,7 @@ reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; + busy-detect = <1>; interrupts = <42>; interrupt-parent = <&MPIC>; }; @@ -136,6 +138,7 @@ reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; + busy-detect = <1>; interrupts = <43>; interrupt-parent = <&MPIC>; }; @@ -146,6 +149,7 @@ reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; + busy-detect = <1>; interrupts = <44>; interrupt-parent = <&MPIC>; }; @@ -279,6 +283,13 @@ }; }; }; + + sata@A0000 { + compatible = "mrvl,sata"; + reg = <0xA0000 0x6000>; + interrupts = <55>; + interrupt-parent = <&MPIC>; + }; }; pci0: pcie@d0040000 { Modified: stable/10/sys/conf/Makefile.arm ============================================================================== --- stable/10/sys/conf/Makefile.arm Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/conf/Makefile.arm Wed May 14 16:32:27 2014 (r266046) @@ -75,7 +75,8 @@ FILES_CPU_FUNC = $S/$M/$M/cpufunc_asm_ar $S/$M/$M/cpufunc_asm_xscale.S $S/$M/$M/cpufunc_asm.S \ $S/$M/$M/cpufunc_asm_xscale_c3.S $S/$M/$M/cpufunc_asm_armv5_ec.S \ $S/$M/$M/cpufunc_asm_fa526.S $S/$M/$M/cpufunc_asm_sheeva.S \ - $S/$M/$M/cpufunc_asm_pj4b.S $S/$M/$M/cpufunc_asm_armv7.S + $S/$M/$M/cpufunc_asm_pj4b.S $S/$M/$M/cpufunc_asm_armv6.S \ + $S/$M/$M/cpufunc_asm_armv7.S KERNEL_EXTRA=trampoline KERNEL_EXTRA_INSTALL=kernel.gz.tramp Modified: stable/10/sys/dev/ic/ns16550.h ============================================================================== --- stable/10/sys/dev/ic/ns16550.h Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/dev/ic/ns16550.h Wed May 14 16:32:27 2014 (r266046) @@ -185,6 +185,7 @@ #define DW_REG_USR 31 /* DesignWare derived Uart Status Reg */ #define com_usr 39 /* Octeon 16750/16550 Uart Status Reg */ #define REG_USR com_usr +#define USR_BUSY 1 /* Uart Busy. Serial transfer in progress */ #define USR_TXFIFO_NOTFULL 2 /* Uart TX FIFO Not full */ /* 16950 register #1. Access enabled by ACR[7]. Also requires !LCR[7]. */ Modified: stable/10/sys/dev/mvs/mvs_soc.c ============================================================================== --- stable/10/sys/dev/mvs/mvs_soc.c Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/dev/mvs/mvs_soc.c Wed May 14 16:32:27 2014 (r266046) @@ -66,6 +66,8 @@ static struct { {MV_DEV_88F6282, 0x00, "Marvell 88F6282", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_MV78100, 0x00, "Marvell MV78100", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_MV78100_Z0, 0x00,"Marvell MV78100", 2, MVS_Q_GENIIE|MVS_Q_SOC}, + {MV_DEV_MV78260, 0x00, "Marvell MV78260", 2, MVS_Q_GENIIE|MVS_Q_SOC}, + {MV_DEV_MV78460, 0x00, "Marvell MV78460", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {0, 0x00, NULL, 0, 0} }; Modified: stable/10/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_ns8250.c Wed May 14 16:18:26 2014 (r266045) +++ stable/10/sys/dev/uart/uart_dev_ns8250.c Wed May 14 16:32:27 2014 (r266046) @@ -649,11 +649,35 @@ int ns8250_bus_param(struct uart_softc *sc, int baudrate, int databits, int stopbits, int parity) { + struct ns8250_softc *ns8250; struct uart_bas *bas; - int error; + int error, limit; + ns8250 = (struct ns8250_softc*)sc; bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); + /* + * When using DW UART with BUSY detection it is necessary to wait + * until all serial transfers are finished before manipulating the + * line control. LCR will not be affected when UART is busy. + */ + if (ns8250->busy_detect != 0) { + /* + * Pick an arbitrary high limit to avoid getting stuck in + * an infinite loop in case when the hardware is broken. + */ + limit = 10 * 1024; + while (((uart_getreg(bas, DW_REG_USR) & USR_BUSY) != 0) && + --limit) + DELAY(4); + + if (limit <= 0) { + /* UART appears to be stuck */ + uart_unlock(sc->sc_hwmtx); + return (EIO); + } + } + error = ns8250_param(bas, baudrate, databits, stopbits, parity); uart_unlock(sc->sc_hwmtx); return (error); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 17:01:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2381BCBB; Wed, 14 May 2014 17:01: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 05E5023C1; Wed, 14 May 2014 17:01: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 s4EH1ZwS037432; Wed, 14 May 2014 17:01:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EH1ZaV037429; Wed, 14 May 2014 17:01:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141701.s4EH1ZaV037429@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 17:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266050 - in stable/10/sys/arm: arm include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 17:01:36 -0000 Author: ian Date: Wed May 14 17:01:35 2014 New Revision: 266050 URL: http://svnweb.freebsd.org/changeset/base/266050 Log: MFC r256707, r256708, r257291, r258358 Switch to use WBWA mappings for page tables on armv6, this is needed for SMP. Fix PTE_SYNC() for PIPT L2 caches, using the virtual address wasn't so useful. Use PTE_SYNC() for >= armv6 Spell cpu_l2cache_wb_range correctly. Fix condition that determines PMAP_NEEDS_PTE_SYNC value for ARM Use values of the correct defines to determine statement's result. ARM_ARCH_ symbols are always defined, hence only values are relevant. Avoid clearing EXEC permission bit when setting the page RW on ARMv6/v7 When emulating modified bit the executable attribute was cleared by mistake when calling pmap_set_prot(). Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/pmap-v6.c stable/10/sys/arm/include/pmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Wed May 14 17:01:31 2014 (r266049) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Wed May 14 17:01:35 2014 (r266050) @@ -57,9 +57,9 @@ __FBSDID("$FreeBSD$"); #define PT_OUTER_WBWA (1 << 3) #ifdef SMP -#define PT_ATTR (PT_S|PT_INNER_WT|PT_OUTER_WT|PT_NOS) +#define PT_ATTR (PT_S|PT_INNER_WBWA|PT_OUTER_WBWA|PT_NOS) #else -#define PT_ATTR (PT_INNER_WT|PT_OUTER_WT) +#define PT_ATTR (PT_INNER_WBWA|PT_OUTER_WBWA) #endif ENTRY(armv7_setttb) @@ -98,7 +98,7 @@ ENTRY(armv7_tlb_flushID_SE) ldr r1, .Lpage_mask bic r0, r0, r1 #ifdef SMP - mcr p15, 0, r0, c8, c3, 1 /* flush D tlb single entry Inner Shareable*/ + mcr p15, 0, r0, c8, c3, 3 /* flush D tlb single entry Inner Shareable*/ mcr p15, 0, r0, c7, c1, 6 /* flush BTB Inner Shareable */ #else mcr p15, 0, r0, c8, c7, 1 /* flush D tlb single entry */ Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Wed May 14 17:01:31 2014 (r266049) +++ stable/10/sys/arm/arm/pmap-v6.c Wed May 14 17:01:35 2014 (r266050) @@ -1519,10 +1519,10 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_ vm_page_dirty(m); /* Re-enable write permissions for the page */ - pmap_set_prot(ptep, VM_PROT_WRITE, *ptep & L2_S_PROT_U); - CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", pte); + *ptep = (pte & ~L2_APX); PTE_SYNC(ptep); rv = 1; + CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", *ptep); } else if (!L2_S_REFERENCED(pte)) { /* * This looks like a good candidate for "page referenced" @@ -1545,6 +1545,7 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_ *ptep = pte | L2_S_REF; PTE_SYNC(ptep); rv = 1; + CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", *ptep); } /* @@ -2453,6 +2454,8 @@ vm_paddr_t pmap_kextract(vm_offset_t va) { + if (kernel_vm_end == 0) + return (0); return (pmap_extract_locked(kernel_pmap, va)); } @@ -3302,9 +3305,11 @@ pmap_extract(pmap_t pmap, vm_offset_t va { vm_paddr_t pa; - PMAP_LOCK(pmap); + if (kernel_vm_end != 0) + PMAP_LOCK(pmap); pa = pmap_extract_locked(pmap, va); - PMAP_UNLOCK(pmap); + if (kernel_vm_end != 0) + PMAP_UNLOCK(pmap); return (pa); } @@ -3317,7 +3322,7 @@ pmap_extract_locked(pmap_t pmap, vm_offs vm_paddr_t pa; u_int l1idx; - if (pmap != kernel_pmap) + if (kernel_vm_end != 0 && pmap != kernel_pmap) PMAP_ASSERT_LOCKED(pmap); l1idx = L1_IDX(va); l1pd = pmap->pm_l1->l1_kva[l1idx]; Modified: stable/10/sys/arm/include/pmap.h ============================================================================== --- stable/10/sys/arm/include/pmap.h Wed May 14 17:01:31 2014 (r266049) +++ stable/10/sys/arm/include/pmap.h Wed May 14 17:01:35 2014 (r266050) @@ -63,7 +63,7 @@ #endif #define PTE_CACHE 6 #define PTE_DEVICE 2 -#define PTE_PAGETABLE 4 +#define PTE_PAGETABLE 6 #else #define PTE_NOCACHE 1 #define PTE_CACHE 2 @@ -491,7 +491,7 @@ extern int pmap_needs_pte_sync; #if (ARM_MMU_SA1 == 1) && (ARM_NMMUS == 1) #define PMAP_NEEDS_PTE_SYNC 1 #define PMAP_INCLUDE_PTE_SYNC -#elif defined(CPU_XSCALE_81342) +#elif defined(CPU_XSCALE_81342) || ARM_ARCH_6 || ARM_ARCH_7A #define PMAP_NEEDS_PTE_SYNC 1 #define PMAP_INCLUDE_PTE_SYNC #elif (ARM_MMU_SA1 == 0) @@ -561,11 +561,18 @@ extern int pmap_needs_pte_sync; #define PMAP_INCLUDE_PTE_SYNC #endif +#ifdef ARM_L2_PIPT +#define _sync_l2(pte, size) cpu_l2cache_wb_range(vtophys(pte), size) +#else +#define _sync_l2(pte, size) cpu_l2cache_wb_range(pte, size) +#endif + #define PTE_SYNC(pte) \ do { \ if (PMAP_NEEDS_PTE_SYNC) { \ cpu_dcache_wb_range((vm_offset_t)(pte), sizeof(pt_entry_t));\ - cpu_l2cache_wb_range((vm_offset_t)(pte), sizeof(pt_entry_t));\ + cpu_drain_writebuf(); \ + _sync_l2((vm_offset_t)(pte), sizeof(pt_entry_t));\ } else \ cpu_drain_writebuf(); \ } while (/*CONSTCOND*/0) @@ -575,7 +582,8 @@ do { \ if (PMAP_NEEDS_PTE_SYNC) { \ cpu_dcache_wb_range((vm_offset_t)(pte), \ (cnt) << 2); /* * sizeof(pt_entry_t) */ \ - cpu_l2cache_wb_range((vm_offset_t)(pte), \ + cpu_drain_writebuf(); \ + _sync_l2((vm_offset_t)(pte), \ (cnt) << 2); /* * sizeof(pt_entry_t) */ \ } else \ cpu_drain_writebuf(); \ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 17:40:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1F51666E; Wed, 14 May 2014 17:40: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 011E12739; Wed, 14 May 2014 17:40: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 s4EHeLgD052999; Wed, 14 May 2014 17:40:21 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EHeJnd052981; Wed, 14 May 2014 17:40:19 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141740.s4EHeJnd052981@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 17:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266058 - in stable/10/sys: arm/arm arm/include conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 17:40:22 -0000 Author: ian Date: Wed May 14 17:40:18 2014 New Revision: 266058 URL: http://svnweb.freebsd.org/changeset/base/266058 Log: MFC r258359, r258742, r258845, r259936, r259640 Apply access flags for managed and unmanaged pages properly on ARMv6/v7 Set the PGA_WRITEABLE flag when the protections indicate write access, not just when the current access is a write. Enable missing Access Flag for secondary cores on ARMv6/v7 Add identification and necessary type checks for Krait CPU cores. Modified: stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/elf_trampoline.c stable/10/sys/arm/arm/identcpu.c stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/pmap-v6.c stable/10/sys/arm/arm/swtch.S stable/10/sys/arm/include/armreg.h stable/10/sys/arm/include/cpuconf.h stable/10/sys/arm/include/cpufunc.h stable/10/sys/arm/include/intr.h stable/10/sys/arm/include/md_var.h stable/10/sys/conf/files.arm stable/10/sys/conf/options.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc.c ============================================================================== --- stable/10/sys/arm/arm/cpufunc.c Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/arm/cpufunc.c Wed May 14 17:40:18 2014 (r266058) @@ -1038,7 +1038,7 @@ struct cpu_functions arm1176_cpufuncs = }; #endif /*CPU_ARM1176 */ -#if defined(CPU_CORTEXA) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) struct cpu_functions cortexa_cpufuncs = { /* CPU functions */ @@ -1118,7 +1118,7 @@ u_int cpu_reset_needs_v4_MMU_disable; /* defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_FA526) || defined(CPU_FA626TE) || defined(CPU_MV_PJ4B) || \ defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ - defined(CPU_CORTEXA) + defined(CPU_CORTEXA) || defined(CPU_KRAIT) static void get_cachetype_cp15(void); @@ -1416,7 +1416,7 @@ set_cpufuncs() goto out; } #endif /* CPU_ARM1136 || CPU_ARM1176 */ -#ifdef CPU_CORTEXA +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) if (cputype == CPU_ID_CORTEXA7 || cputype == CPU_ID_CORTEXA8R1 || cputype == CPU_ID_CORTEXA8R2 || @@ -1424,7 +1424,8 @@ set_cpufuncs() cputype == CPU_ID_CORTEXA9R1 || cputype == CPU_ID_CORTEXA9R2 || cputype == CPU_ID_CORTEXA9R3 || - cputype == CPU_ID_CORTEXA15 ) { + cputype == CPU_ID_CORTEXA15 || + cputype == CPU_ID_KRAIT ) { cpufuncs = cortexa_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); @@ -2406,7 +2407,7 @@ pj4bv7_setup(args) } #endif /* CPU_MV_PJ4B */ -#ifdef CPU_CORTEXA +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) void cortexa_setup(char *args) Modified: stable/10/sys/arm/arm/elf_trampoline.c ============================================================================== --- stable/10/sys/arm/arm/elf_trampoline.c Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/arm/elf_trampoline.c Wed May 14 17:40:18 2014 (r266058) @@ -102,7 +102,7 @@ extern void xscalec3_l2cache_purge(void) #elif defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) #define cpu_l2cache_wbinv_all sheeva_l2cache_wbinv_all extern void sheeva_l2cache_wbinv_all(void); -#elif defined(CPU_CORTEXA) +#elif defined(CPU_CORTEXA) || defined(CPU_KRAIT) #define cpu_idcache_wbinv_all armv7_idcache_wbinv_all #define cpu_l2cache_wbinv_all() #else Modified: stable/10/sys/arm/arm/identcpu.c ============================================================================== --- stable/10/sys/arm/arm/identcpu.c Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/arm/identcpu.c Wed May 14 17:40:18 2014 (r266058) @@ -252,6 +252,8 @@ const struct cpuidtab cpuids[] = { generic_steppings }, { CPU_ID_CORTEXA15, CPU_CLASS_CORTEXA, "Cortex A15", generic_steppings }, + { CPU_ID_KRAIT, CPU_CLASS_KRAIT, "Krait", + generic_steppings }, { CPU_ID_SA110, CPU_CLASS_SA1, "SA-110", sa110_steppings }, @@ -351,6 +353,7 @@ const struct cpu_classtab cpu_classes[] { "ARM10E", "CPU_ARM10" }, /* CPU_CLASS_ARM10E */ { "ARM10EJ", "CPU_ARM10" }, /* CPU_CLASS_ARM10EJ */ { "Cortex-A", "CPU_CORTEXA" }, /* CPU_CLASS_CORTEXA */ + { "Krait", "CPU_KRAIT" }, /* CPU_CLASS_KRAIT */ { "SA-1", "CPU_SA110" }, /* CPU_CLASS_SA1 */ { "XScale", "CPU_XSCALE_..." }, /* CPU_CLASS_XSCALE */ { "ARM11J", "CPU_ARM11" }, /* CPU_CLASS_ARM11J */ Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/arm/locore.S Wed May 14 17:40:18 2014 (r266058) @@ -170,7 +170,7 @@ Lunmapped: mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) || defined(CPU_KRAIT) mov r0, #0 mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ #endif @@ -377,7 +377,7 @@ Ltag: mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) mov r0, #0 mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ #endif @@ -389,8 +389,9 @@ Ltag: mcr p15, 0, r0, c3, c0, 0 /* Enable MMU */ mrc p15, 0, r0, c1, c0, 0 -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) orr r0, r0, #CPU_CONTROL_V6_EXTPAGE + orr r0, r0, #CPU_CONTROL_AF_ENABLE #endif orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE) mcr p15, 0, r0, c1, c0, 0 Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/arm/pmap-v6.c Wed May 14 17:40:18 2014 (r266058) @@ -3079,31 +3079,33 @@ validate: * then continue setting mapping parameters */ if (m != NULL) { - if (prot & (VM_PROT_ALL)) { - if ((m->oflags & VPO_UNMANAGED) == 0) + if ((m->oflags & VPO_UNMANAGED) == 0) { + if (prot & (VM_PROT_ALL)) { vm_page_aflag_set(m, PGA_REFERENCED); - } else { - /* - * Need to do page referenced emulation. - */ - npte &= ~L2_S_REF; + } else { + /* + * Need to do page referenced emulation. + */ + npte &= ~L2_S_REF; + } } if (prot & VM_PROT_WRITE) { - /* Write enable */ - npte &= ~(L2_APX); - if ((m->oflags & VPO_UNMANAGED) == 0) { vm_page_aflag_set(m, PGA_WRITEABLE); /* - * The access type and permissions indicate - * that the page will be written as soon as - * returned from fault service. - * Mark it dirty from the outset. + * XXX: Skip modified bit emulation for now. + * The emulation reveals problems + * that result in random failures + * during memory allocation on some + * platforms. + * Therefore, the page is marked RW + * immediately. */ - if ((access & VM_PROT_WRITE) != 0) - vm_page_dirty(m); - } + npte &= ~(L2_APX); + vm_page_dirty(m); + } else + npte &= ~(L2_APX); } if (!(prot & VM_PROT_EXECUTE)) npte |= L2_XN; Modified: stable/10/sys/arm/arm/swtch.S ============================================================================== --- stable/10/sys/arm/arm/swtch.S Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/arm/swtch.S Wed May 14 17:40:18 2014 (r266058) @@ -131,7 +131,7 @@ ENTRY(cpu_throw) /* Switch to lwp0 context */ ldr r9, .Lcpufuncs -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) +#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) mov lr, pc ldr pc, [r9, #CF_IDCACHE_WBINV_ALL] #endif @@ -361,7 +361,7 @@ ENTRY(cpu_switch) cmpeq r0, r5 /* Same DACR? */ beq .Lcs_context_switched /* yes! */ -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) +#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) /* * Definately need to flush the cache. */ Modified: stable/10/sys/arm/include/armreg.h ============================================================================== --- stable/10/sys/arm/include/armreg.h Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/include/armreg.h Wed May 14 17:40:18 2014 (r266058) @@ -157,6 +157,7 @@ #define CPU_ID_CORTEXA15 0x410fc0f0 #define CPU_ID_SA110 0x4401a100 #define CPU_ID_SA1100 0x4401a110 +#define CPU_ID_KRAIT 0x510f06f0 /* Snapdragon S4 Pro/APQ8064 */ #define CPU_ID_TI925T 0x54029250 #define CPU_ID_MV88FR131 0x56251310 /* Marvell Feroceon 88FR131 Core */ #define CPU_ID_MV88FR331 0x56153310 /* Marvell Feroceon 88FR331 Core */ Modified: stable/10/sys/arm/include/cpuconf.h ============================================================================== --- stable/10/sys/arm/include/cpuconf.h Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/include/cpuconf.h Wed May 14 17:40:18 2014 (r266058) @@ -66,6 +66,7 @@ defined(CPU_FA626TE) + \ defined(CPU_XSCALE_IXP425)) + \ defined(CPU_CORTEXA) + \ + defined(CPU_KRAIT) + \ defined(CPU_MV_PJ4B) /* @@ -97,7 +98,7 @@ #endif #endif -#if defined(CPU_CORTEXA) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) #define ARM_ARCH_7A 1 #else #define ARM_ARCH_7A 0 @@ -156,7 +157,7 @@ #define ARM_MMU_V6 0 #endif -#if defined(CPU_CORTEXA) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) #define ARM_MMU_V7 1 #else #define ARM_MMU_V7 0 Modified: stable/10/sys/arm/include/cpufunc.h ============================================================================== --- stable/10/sys/arm/include/cpufunc.h Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/include/cpufunc.h Wed May 14 17:40:18 2014 (r266058) @@ -188,7 +188,7 @@ extern u_int cputype; #else void tlb_broadcast(int); -#if defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) +#if defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) || defined(CPU_KRAIT) #define TLB_BROADCAST /* No need to explicitely send an IPI */ #else #define TLB_BROADCAST tlb_broadcast(7) @@ -463,7 +463,7 @@ void sheeva_l2cache_wbinv_all (void); #endif #if defined(CPU_ARM1136) || defined(CPU_ARM1176) || \ - defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) + defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) void arm11_setttb (u_int); void arm11_sleep (int); Modified: stable/10/sys/arm/include/intr.h ============================================================================== --- stable/10/sys/arm/include/intr.h Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/include/intr.h Wed May 14 17:40:18 2014 (r266058) @@ -52,6 +52,8 @@ #define NIRQ 64 #elif defined(CPU_CORTEXA) #define NIRQ 160 +#elif defined(CPU_KRAIT) +#define NIRQ 288 #elif defined(CPU_ARM1136) || defined(CPU_ARM1176) #define NIRQ 128 #elif defined(SOC_MV_ARMADAXP) Modified: stable/10/sys/arm/include/md_var.h ============================================================================== --- stable/10/sys/arm/include/md_var.h Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/arm/include/md_var.h Wed May 14 17:40:18 2014 (r266058) @@ -63,6 +63,7 @@ enum cpu_class { CPU_CLASS_ARM10E, CPU_CLASS_ARM10EJ, CPU_CLASS_CORTEXA, + CPU_CLASS_KRAIT, CPU_CLASS_SA1, CPU_CLASS_XSCALE, CPU_CLASS_ARM11J, Modified: stable/10/sys/conf/files.arm ============================================================================== --- stable/10/sys/conf/files.arm Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/conf/files.arm Wed May 14 17:40:18 2014 (r266058) @@ -6,7 +6,7 @@ arm/arm/blockio.S standard arm/arm/bootconfig.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/busdma_machdep.c optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_sa1100 | cpu_sa1110 | cpu_xscale_80219 | cpu_xscale_80321 | cpu_xscale_81342 | cpu_xscale_ixp425 | cpu_xscale_ixp435 | cpu_xscale_pxa2x0 -arm/arm/busdma_machdep-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b +arm/arm/busdma_machdep-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b | cpu_krait arm/arm/copystr.S standard arm/arm/cpufunc.c standard arm/arm/cpufunc_asm.S standard @@ -36,7 +36,7 @@ arm/arm/nexus.c standard arm/arm/pl190.c optional pl190 arm/arm/pl310.c optional pl310 arm/arm/pmap.c optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_sa1100 | cpu_sa1110 | cpu_xscale_80219 | cpu_xscale_80321 | cpu_xscale_81342 | cpu_xscale_ixp425 | cpu_xscale_ixp435 | cpu_xscale_pxa2x0 -arm/arm/pmap-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b +arm/arm/pmap-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b | cpu_krait arm/arm/sc_machdep.c optional sc arm/arm/setcpsr.S standard arm/arm/setstack.s standard Modified: stable/10/sys/conf/options.arm ============================================================================== --- stable/10/sys/conf/options.arm Wed May 14 17:28:49 2014 (r266057) +++ stable/10/sys/conf/options.arm Wed May 14 17:40:18 2014 (r266058) @@ -13,6 +13,7 @@ CPU_ARM9E opt_global.h CPU_ARM1136 opt_global.h CPU_ARM1176 opt_global.h CPU_CORTEXA opt_global.h +CPU_KRAIT opt_global.h CPU_FA526 opt_global.h CPU_FA626TE opt_global.h CPU_MV_PJ4B opt_global.h From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 17:43:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5A2C07C1; Wed, 14 May 2014 17:43: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 46C1927B5; Wed, 14 May 2014 17:43: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 s4EHhoMY056396; Wed, 14 May 2014 17:43:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EHhoL5056395; Wed, 14 May 2014 17:43:50 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141743.s4EHhoL5056395@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 17:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266059 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 17:43:50 -0000 Author: ian Date: Wed May 14 17:43:49 2014 New Revision: 266059 URL: http://svnweb.freebsd.org/changeset/base/266059 Log: MFC r260118 Delete echoed doesn't rub out the previous character, so always use instead. This fixes hitting DELETE instead of BACKSPACE at mountroot> prompt. Modified: stable/10/sys/kern/kern_cons.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_cons.c ============================================================================== --- stable/10/sys/kern/kern_cons.c Wed May 14 17:40:18 2014 (r266058) +++ stable/10/sys/kern/kern_cons.c Wed May 14 17:43:49 2014 (r266059) @@ -432,10 +432,8 @@ cngets(char *cp, size_t size, int visibl case '\b': case '\177': if (lp > cp) { - if (visible) { - cnputc(c); - cnputs(" \b"); - } + if (visible) + cnputs("\b \b"); lp--; } continue; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 18:16:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 17E9865F; Wed, 14 May 2014 18:16: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 DEA1C2AC6; Wed, 14 May 2014 18:16:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EIGXF1070891; Wed, 14 May 2014 18:16:33 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EIGXEF070887; Wed, 14 May 2014 18:16:33 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141816.s4EIGXEF070887@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 18:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266065 - in stable/10/sys: arm/at91 conf dev/nand X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 18:16:34 -0000 Author: ian Date: Wed May 14 18:16:32 2014 New Revision: 266065 URL: http://svnweb.freebsd.org/changeset/base/266065 Log: MFC r260092, r260093, r260121, r260180, Allow AT91_MCI_ALLOW_OVERCLOCK to be an option in kernel config files. Set the SoC name for the atmelbus name. Add support for Samsung K9F2G08U0A (256MiB SLC) NAND Comment updates. Modified: stable/10/sys/arm/at91/at91.c stable/10/sys/conf/options.arm stable/10/sys/dev/nand/nand_id.c stable/10/sys/dev/nand/nandbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/at91.c ============================================================================== --- stable/10/sys/arm/at91/at91.c Wed May 14 18:15:55 2014 (r266064) +++ stable/10/sys/arm/at91/at91.c Wed May 14 18:16:32 2014 (r266065) @@ -231,7 +231,7 @@ static int at91_probe(device_t dev) { - device_set_desc(dev, "AT91 device bus"); + device_set_desc(dev, soc_info.name); return (BUS_PROBE_NOWILDCARD); } Modified: stable/10/sys/conf/options.arm ============================================================================== --- stable/10/sys/conf/options.arm Wed May 14 18:15:55 2014 (r266064) +++ stable/10/sys/conf/options.arm Wed May 14 18:16:32 2014 (r266065) @@ -55,6 +55,7 @@ XSACLE_DISABLE_CCNT opt_timer.h VERBOSE_INIT_ARM opt_global.h VM_MAXUSER_ADDRESS opt_global.h AT91_ATE_USE_RMII opt_at91.h +AT91_MCI_ALLOW_OVERCLOCK opt_at91.h AT91_MCI_HAS_4WIRE opt_at91.h AT91_MCI_SLOT_B opt_at91.h GFB_DEBUG opt_gfb.h Modified: stable/10/sys/dev/nand/nand_id.c ============================================================================== --- stable/10/sys/dev/nand/nand_id.c Wed May 14 18:15:55 2014 (r266064) +++ stable/10/sys/dev/nand/nand_id.c Wed May 14 18:16:32 2014 (r266065) @@ -39,6 +39,8 @@ struct nand_params nand_ids[] = { 0x400, 0x800, 0x40, 0x40, 0 }, { { NAND_MAN_SAMSUNG, 0xdc }, "Samsung NAND 512MiB 3,3V 8-bit", 0x200, 0x800, 0x40, 0x40, 0 }, + { { NAND_MAN_SAMSUNG, 0xda }, "Samsung NAND 256MiB 3,3V 8-bit", + 0x100, 0x800, 0x40, 0x40, 0 }, { { NAND_MAN_HYNIX, 0x76 }, "Hynix NAND 64MiB 3,3V 8-bit", 0x40, 0x200, 0x10, 0x20, 0 }, { { NAND_MAN_HYNIX, 0xdc }, "Hynix NAND 512MiB 3,3V 8-bit", Modified: stable/10/sys/dev/nand/nandbus.c ============================================================================== --- stable/10/sys/dev/nand/nandbus.c Wed May 14 18:15:55 2014 (r266064) +++ stable/10/sys/dev/nand/nandbus.c Wed May 14 18:16:32 2014 (r266065) @@ -503,7 +503,7 @@ nandbus_wait_ready(device_t dev, uint8_t struct timeval tv, tv2; tv2.tv_sec = 0; - tv2.tv_usec = 50 * 5000; /* 10ms */ + tv2.tv_usec = 50 * 5000; /* 250ms */ getmicrotime(&tv); timevaladd(&tv, &tv2); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 18:25:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0C319D2B; Wed, 14 May 2014 18:25: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 E14382BB5; Wed, 14 May 2014 18:25: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 s4EIPEwI075329; Wed, 14 May 2014 18:25:14 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EIPDFb075319; Wed, 14 May 2014 18:25:13 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141825.s4EIPDFb075319@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 18:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266070 - in stable/10/sys: arm/arm arm/include arm/versatile dev/ahci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 18:25:15 -0000 Author: ian Date: Wed May 14 18:25:13 2014 New Revision: 266070 URL: http://svnweb.freebsd.org/changeset/base/266070 Log: MFC r260161, r260163, r260165, r260166, r260189 Add polarity and level support to ARM GIC Do not attach to PCI bridges in AHCI driver Use only mapped BIOs on ARM Fix race condition in DELAY for SP804 timer. Modified: stable/10/sys/arm/arm/gic.c stable/10/sys/arm/arm/intr.c stable/10/sys/arm/arm/nexus.c stable/10/sys/arm/include/intr.h stable/10/sys/arm/versatile/sp804.c stable/10/sys/dev/ahci/ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/gic.c ============================================================================== --- stable/10/sys/arm/arm/gic.c Wed May 14 18:23:57 2014 (r266069) +++ stable/10/sys/arm/arm/gic.c Wed May 14 18:25:13 2014 (r266070) @@ -83,6 +83,15 @@ __FBSDID("$FreeBSD$"); #define GICC_ABPR 0x001C /* v1 ICCABPR */ #define GICC_IIDR 0x00FC /* v1 ICCIIDR*/ +/* First bit is a polarity bit (0 - low, 1 - high) */ +#define GICD_ICFGR_POL_LOW (0 << 0) +#define GICD_ICFGR_POL_HIGH (1 << 0) +#define GICD_ICFGR_POL_MASK 0x1 +/* Second bit is a trigger bit (0 - level, 1 - edge) */ +#define GICD_ICFGR_TRIG_LVL (0 << 1) +#define GICD_ICFGR_TRIG_EDGE (1 << 1) +#define GICD_ICFGR_TRIG_MASK 0x2 + struct arm_gic_softc { struct resource * gic_res[3]; bus_space_tag_t gic_c_bst; @@ -90,6 +99,9 @@ struct arm_gic_softc { bus_space_handle_t gic_c_bsh; bus_space_handle_t gic_d_bsh; uint8_t ver; + device_t dev; + struct mtx mutex; + uint32_t nirqs; }; static struct resource_spec arm_gic_spec[] = { @@ -109,6 +121,8 @@ static struct arm_gic_softc *arm_gic_sc #define gic_d_write_4(reg, val) \ bus_space_write_4(arm_gic_sc->gic_d_bst, arm_gic_sc->gic_d_bsh, reg, val) +static int gic_config_irq(int irq, enum intr_trigger trig, + enum intr_polarity pol); static void gic_post_filter(void *); static int @@ -157,19 +171,20 @@ arm_gic_attach(device_t dev) struct arm_gic_softc *sc; int i; uint32_t icciidr; - uint32_t nirqs; if (arm_gic_sc) return (ENXIO); sc = device_get_softc(dev); + sc->dev = dev; if (bus_alloc_resources(dev, arm_gic_spec, sc->gic_res)) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); } - arm_post_filter = gic_post_filter; + /* Initialize mutex */ + mtx_init(&sc->mutex, "GIC lock", "", MTX_SPIN); /* Distributor Interface */ sc->gic_d_bst = rman_get_bustag(sc->gic_res[0]); @@ -185,31 +200,35 @@ arm_gic_attach(device_t dev) gic_d_write_4(GICD_CTLR, 0x00); /* Get the number of interrupts */ - nirqs = gic_d_read_4(GICD_TYPER); - nirqs = 32 * ((nirqs & 0x1f) + 1); + sc->nirqs = gic_d_read_4(GICD_TYPER); + sc->nirqs = 32 * ((sc->nirqs & 0x1f) + 1); + + /* Set up function pointers */ + arm_post_filter = gic_post_filter; + arm_config_irq = gic_config_irq; icciidr = gic_c_read_4(GICC_IIDR); - device_printf(dev,"pn 0x%x, arch 0x%x, rev 0x%x, implementer 0x%x nirqs %u\n", + device_printf(dev,"pn 0x%x, arch 0x%x, rev 0x%x, implementer 0x%x sc->nirqs %u\n", icciidr>>20, (icciidr>>16) & 0xF, (icciidr>>12) & 0xf, - (icciidr & 0xfff), nirqs); + (icciidr & 0xfff), sc->nirqs); /* Set all global interrupts to be level triggered, active low. */ - for (i = 32; i < nirqs; i += 32) { - gic_d_write_4(GICD_ICFGR(i >> 5), 0x00000000); + for (i = 32; i < sc->nirqs; i += 16) { + gic_d_write_4(GICD_ICFGR(i >> 4), 0x00000000); } /* Disable all interrupts. */ - for (i = 32; i < nirqs; i += 32) { + for (i = 32; i < sc->nirqs; i += 32) { gic_d_write_4(GICD_ICENABLER(i >> 5), 0xFFFFFFFF); } - for (i = 0; i < nirqs; i += 4) { + for (i = 0; i < sc->nirqs; i += 4) { gic_d_write_4(GICD_IPRIORITYR(i >> 2), 0); gic_d_write_4(GICD_ITARGETSR(i >> 2), 1 << 0 | 1 << 8 | 1 << 16 | 1 << 24); } /* Set all the interrupts to be in Group 0 (secure) */ - for (i = 0; i < nirqs; i += 32) { + for (i = 0; i < sc->nirqs; i += 32) { gic_d_write_4(GICD_IGROUPR(i >> 5), 0); } @@ -290,6 +309,58 @@ arm_unmask_irq(uintptr_t nb) gic_d_write_4(GICD_ISENABLER(nb >> 5), (1UL << (nb & 0x1F))); } +static int +gic_config_irq(int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + uint32_t reg; + uint32_t mask; + + /* Function is public-accessible, so validate input arguments */ + if ((irq < 0) || (irq >= arm_gic_sc->nirqs)) + goto invalid_args; + if ((trig != INTR_TRIGGER_EDGE) && (trig != INTR_TRIGGER_LEVEL) && + (trig != INTR_TRIGGER_CONFORM)) + goto invalid_args; + if ((pol != INTR_POLARITY_HIGH) && (pol != INTR_POLARITY_LOW) && + (pol != INTR_POLARITY_CONFORM)) + goto invalid_args; + + mtx_lock_spin(&arm_gic_sc->mutex); + + reg = gic_d_read_4(GICD_ICFGR(irq >> 4)); + mask = (reg >> 2*(irq % 16)) & 0x3; + + if (pol == INTR_POLARITY_LOW) { + mask &= ~GICD_ICFGR_POL_MASK; + mask |= GICD_ICFGR_POL_LOW; + } else if (pol == INTR_POLARITY_HIGH) { + mask &= ~GICD_ICFGR_POL_MASK; + mask |= GICD_ICFGR_POL_HIGH; + } + + if (trig == INTR_TRIGGER_LEVEL) { + mask &= ~GICD_ICFGR_TRIG_MASK; + mask |= GICD_ICFGR_TRIG_LVL; + } else if (trig == INTR_TRIGGER_EDGE) { + mask &= ~GICD_ICFGR_TRIG_MASK; + mask |= GICD_ICFGR_TRIG_EDGE; + } + + /* Set mask */ + reg = reg & ~(0x3 << 2*(irq % 16)); + reg = reg | (mask << 2*(irq % 16)); + gic_d_write_4(GICD_ICFGR(irq >> 4), reg); + + mtx_unlock_spin(&arm_gic_sc->mutex); + + return (0); + +invalid_args: + device_printf(arm_gic_sc->dev, "gic_config_irg, invalid parameters\n"); + return (EINVAL); +} + #ifdef SMP void pic_ipi_send(cpuset_t cpus, u_int ipi) Modified: stable/10/sys/arm/arm/intr.c ============================================================================== --- stable/10/sys/arm/arm/intr.c Wed May 14 18:23:57 2014 (r266069) +++ stable/10/sys/arm/arm/intr.c Wed May 14 18:25:13 2014 (r266070) @@ -59,6 +59,8 @@ static struct intr_event *intr_events[NI void arm_handler_execute(struct trapframe *, int); void (*arm_post_filter)(void *) = NULL; +int (*arm_config_irq)(int irq, enum intr_trigger trig, + enum intr_polarity pol) = NULL; /* * Pre-format intrnames into an array of fixed-size strings containing spaces. Modified: stable/10/sys/arm/arm/nexus.c ============================================================================== --- stable/10/sys/arm/arm/nexus.c Wed May 14 18:23:57 2014 (r266069) +++ stable/10/sys/arm/arm/nexus.c Wed May 14 18:25:13 2014 (r266070) @@ -85,6 +85,8 @@ static struct resource *nexus_alloc_reso #endif static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol); static int nexus_deactivate_resource(device_t, device_t, int, int, struct resource *); @@ -103,6 +105,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), #endif DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), @@ -225,6 +228,18 @@ nexus_alloc_resource(device_t bus, devic #endif static int +nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + int ret = ENODEV; + + if (arm_config_irq) + ret = (*arm_config_irq)(irq, trig, pol); + + return (ret); +} + +static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { Modified: stable/10/sys/arm/include/intr.h ============================================================================== --- stable/10/sys/arm/include/intr.h Wed May 14 18:23:57 2014 (r266069) +++ stable/10/sys/arm/include/intr.h Wed May 14 18:25:13 2014 (r266070) @@ -68,6 +68,7 @@ #endif #include +#include int arm_get_next_irq(int); void arm_mask_irq(uintptr_t); @@ -77,6 +78,8 @@ void arm_setup_irqhandler(const char *, void *, int, int, void **); int arm_remove_irqhandler(int, void *); extern void (*arm_post_filter)(void *); +extern int (*arm_config_irq)(int irq, enum intr_trigger trig, + enum intr_polarity pol); void gic_init_secondary(void); Modified: stable/10/sys/arm/versatile/sp804.c ============================================================================== --- stable/10/sys/arm/versatile/sp804.c Wed May 14 18:23:57 2014 (r266069) +++ stable/10/sys/arm/versatile/sp804.c Wed May 14 18:25:13 2014 (r266070) @@ -100,6 +100,7 @@ struct sp804_timer_softc { struct timecounter tc; bool et_enabled; struct eventtimer et; + int timer_initialized; }; /* Read/Write macros for Timer used as timecounter */ @@ -198,6 +199,8 @@ sp804_timer_attach(device_t dev) int rid = 0; int i; uint32_t id, reg; + phandle_t node; + pcell_t clock; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->mem_res == NULL) { @@ -215,8 +218,12 @@ sp804_timer_attach(device_t dev) return (ENXIO); } - /* TODO: get frequency from FDT */ sc->sysclk_freq = DEFAULT_FREQUENCY; + /* Get the base clock frequency */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "clock-frequency", &clock, sizeof(clock))) > 0) { + sc->sysclk_freq = fdt32_to_cpu(clock); + } /* Setup and enable the timer */ if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CLK, @@ -234,8 +241,8 @@ sp804_timer_attach(device_t dev) /* * Timer 1, timecounter */ - sc->tc.tc_frequency = DEFAULT_FREQUENCY; - sc->tc.tc_name = "SP804 Timecouter"; + sc->tc.tc_frequency = sc->sysclk_freq; + sc->tc.tc_name = "SP804 Time Counter"; sc->tc.tc_get_timecount = sp804_timer_tc_get_timecount; sc->tc.tc_poll_pps = NULL; sc->tc.tc_counter_mask = ~0u; @@ -283,6 +290,8 @@ sp804_timer_attach(device_t dev) device_printf(dev, "PrimeCell ID: %08x\n", id); + sc->timer_initialized = 1; + return (0); } @@ -309,10 +318,18 @@ DELAY(int usec) uint32_t first, last; device_t timer_dev; struct sp804_timer_softc *sc; + int timer_initialized = 0; timer_dev = devclass_get_device(sp804_timer_devclass, 0); - if (timer_dev == NULL) { + if (timer_dev) { + sc = device_get_softc(timer_dev); + + if (sc) + timer_initialized = sc->timer_initialized; + } + + if (!timer_initialized) { /* * Timer is not initialized yet */ @@ -323,8 +340,6 @@ DELAY(int usec) return; } - sc = device_get_softc(timer_dev); - /* Get the number of times to count */ counts = usec * ((sc->tc.tc_frequency / 1000000) + 1); Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Wed May 14 18:23:57 2014 (r266069) +++ stable/10/sys/dev/ahci/ahci.c Wed May 14 18:25:13 2014 (r266070) @@ -376,6 +376,13 @@ ahci_probe(device_t dev) uint32_t devid = pci_get_devid(dev); uint8_t revid = pci_get_revid(dev); + /* + * Ensure it is not a PCI bridge (some vendors use + * the same PID and VID in PCI bridge and AHCI cards). + */ + if (pci_get_class(dev) == PCIC_BRIDGE) + return (ENXIO); + /* Is this a possible AHCI candidate? */ if (pci_get_class(dev) == PCIC_STORAGE && pci_get_subclass(dev) == PCIS_STORAGE_SATA && From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 18:54:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5967DE14; Wed, 14 May 2014 18:54: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 39E682E7F; Wed, 14 May 2014 18:54: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 s4EIsamA088807; Wed, 14 May 2014 18:54:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EIsYj4088799; Wed, 14 May 2014 18:54:34 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141854.s4EIsYj4088799@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 18:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266079 - in stable/10/sys: arm/arm dev/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 18:54:36 -0000 Author: ian Date: Wed May 14 18:54:34 2014 New Revision: 266079 URL: http://svnweb.freebsd.org/changeset/base/266079 Log: MFC r260281, r260282, r260283, r260285 Implement OFW_BUS_MAP_INTR() in terms of the FDT PIC table Reimplement fdt_intr_to_rl() in terms of OFW_BUS_MAP_INTR() and OFW_BUS_CONFIG_INTR(). Use bus_space_map() rather than pmap_mapdev() in nexus_activate_resource(), when running on FDT systems. Unmap memory in nexus_deactivate_resource(). Remove fdt_pic_table code from MIPS, PowerPC, and x86, as it is no longer used by anything. Modified: stable/10/sys/arm/arm/nexus.c stable/10/sys/dev/fdt/fdt_common.c stable/10/sys/dev/fdt/fdt_common.h stable/10/sys/dev/fdt/fdt_mips.c stable/10/sys/dev/fdt/fdt_powerpc.c stable/10/sys/dev/fdt/fdt_x86.c stable/10/sys/dev/fdt/simplebus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/nexus.c ============================================================================== --- stable/10/sys/arm/arm/nexus.c Wed May 14 18:44:38 2014 (r266078) +++ stable/10/sys/arm/arm/nexus.c Wed May 14 18:54:34 2014 (r266079) @@ -64,7 +64,9 @@ __FBSDID("$FreeBSD$"); #ifdef FDT #include +#include #include +#include "ofw_bus_if.h" #else static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); @@ -94,6 +96,11 @@ static int nexus_setup_intr(device_t dev int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); +#ifdef FDT +static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, + int irq); +#endif + static device_method_t nexus_methods[] = { #ifndef FDT /* Device interface */ @@ -109,6 +116,9 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), +#ifdef FDT + DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr), +#endif { 0, 0 } }; @@ -268,35 +278,92 @@ static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + int err; + bus_addr_t paddr; + bus_size_t psize; + bus_space_handle_t vaddr; + + if ((err = rman_activate_resource(r)) != 0) + return (err); + /* * If this is a memory resource, map it into the kernel. */ if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - caddr_t vaddr = 0; - u_int32_t paddr; - u_int32_t psize; - u_int32_t poffs; - - paddr = rman_get_start(r); - psize = rman_get_size(r); - poffs = paddr - trunc_page(paddr); - vaddr = (caddr_t) pmap_mapdev(paddr-poffs, psize+poffs) + poffs; - rman_set_virtual(r, vaddr); + paddr = (bus_addr_t)rman_get_start(r); + psize = (bus_size_t)rman_get_size(r); #ifdef FDT + err = bus_space_map(fdtbus_bs_tag, paddr, psize, 0, &vaddr); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } rman_set_bustag(r, fdtbus_bs_tag); #else + vaddr = (bus_space_handle_t)pmap_mapdev((vm_offset_t)paddr, + (vm_size_t)psize); + if (vaddr == 0) { + rman_deactivate_resource(r); + return (ENOMEM); + } rman_set_bustag(r, (void *)1); #endif - rman_set_bushandle(r, (bus_space_handle_t) vaddr); + rman_set_virtual(r, (void *)vaddr); + rman_set_bushandle(r, vaddr); } - return (rman_activate_resource(r)); + return (0); } static int nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) + struct resource *r) { + bus_size_t psize; + bus_space_handle_t vaddr; + + psize = (bus_size_t)rman_get_size(r); + vaddr = rman_get_bushandle(r); + + if (vaddr != 0) { +#ifdef FDT + bus_space_unmap(fdtbus_bs_tag, vaddr, psize); +#else + pmap_unmapdev((vm_offset_t)vaddr, (vm_size_t)psize); +#endif + rman_set_virtual(r, NULL); + rman_set_bushandle(r, 0); + } - return (rman_deactivate_resource(res)); + return (rman_deactivate_resource(r)); } +#ifdef FDT +static int +nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int irq) +{ + pcell_t intr[2]; + fdt_pic_decode_t intr_decode; + phandle_t intr_offset; + int i, rv, interrupt, trig, pol; + + intr_offset = OF_xref_phandle(iparent); + intr[0] = cpu_to_fdt32(irq); + + for (i = 0; fdt_pic_table[i] != NULL; i++) { + intr_decode = fdt_pic_table[i]; + rv = intr_decode(intr_offset, intr, &interrupt, &trig, &pol); + + if (rv == 0) { + /* This was recognized as our PIC and decoded. */ + interrupt = FDT_MAP_IRQ(intr_parent, interrupt); + return (interrupt); + } + } + + /* Not in table, so guess */ + interrupt = FDT_MAP_IRQ(intr_parent, fdt32_to_cpu(*intr)); + + return (interrupt); +} +#endif + Modified: stable/10/sys/dev/fdt/fdt_common.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.c Wed May 14 18:44:38 2014 (r266078) +++ stable/10/sys/dev/fdt/fdt_common.c Wed May 14 18:54:34 2014 (r266079) @@ -474,104 +474,32 @@ out: } int -fdt_intr_decode(phandle_t intr_parent, pcell_t *intr, int *interrupt, - int *trig, int *pol) -{ - fdt_pic_decode_t intr_decode; - phandle_t intr_offset; - int i, rv; - - intr_offset = OF_xref_phandle(intr_parent); - - for (i = 0; fdt_pic_table[i] != NULL; i++) { - - /* XXX check if pic_handle has interrupt-controller prop? */ - - intr_decode = fdt_pic_table[i]; - rv = intr_decode(intr_offset, intr, interrupt, trig, pol); - - if (rv == 0) { - /* This was recognized as our PIC and decoded. */ - *interrupt = FDT_MAP_IRQ(intr_parent, *interrupt); - return (0); - } - } - - /* Not in table, so guess */ - *interrupt = FDT_MAP_IRQ(intr_parent, fdt32_to_cpu(*intr)); - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - - return (0); -} - -int -fdt_intr_to_rl(phandle_t node, struct resource_list *rl, +fdt_intr_to_rl(device_t dev, phandle_t node, struct resource_list *rl, struct fdt_sense_level *intr_sl) { - phandle_t intr_par; - phandle_t iph; - pcell_t *intr; - pcell_t intr_cells; - int interrupt, trig, pol; - int i, intr_num, rv; - - if (OF_getproplen(node, "interrupts") <= 0) - /* Node does not have 'interrupts' property. */ - return (0); - - /* - * Find #interrupt-cells of the interrupt domain. - */ - if (OF_getencprop(node, "interrupt-parent", &iph, sizeof(iph)) <= 0) { - debugf("no intr-parent phandle\n"); - intr_par = OF_parent(node); - } else { - intr_par = OF_xref_phandle(iph); - } - - if (OF_getprop(intr_par, "#interrupt-cells", &intr_cells, - sizeof(intr_cells)) <= 0) { - debugf("no intr-cells defined, defaulting to 1\n"); - intr_cells = 1; - } - else - intr_cells = fdt32_to_cpu(intr_cells); - - intr_num = OF_getprop_alloc(node, "interrupts", - intr_cells * sizeof(pcell_t), (void **)&intr); - if (intr_num <= 0 || intr_num > DI_MAX_INTR_NUM) - return (ERANGE); - - rv = 0; - for (i = 0; i < intr_num; i++) { - - interrupt = -1; - trig = pol = 0; - - if (fdt_intr_decode(iph, &intr[i * intr_cells], - &interrupt, &trig, &pol) != 0) { - rv = ENXIO; - goto out; + phandle_t iparent; + uint32_t *intr, icells; + int nintr, i, k; + + nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + (void **)&intr); + if (nintr > 0) { + iparent = 0; + OF_searchencprop(node, "interrupt-parent", &iparent, + sizeof(iparent)); + OF_searchencprop(OF_xref_phandle(iparent), "#interrupt-cells", + &icells, sizeof(icells)); + for (i = 0, k = 0; i < nintr; i += icells, k++) { + intr[i] = ofw_bus_map_intr(dev, iparent, intr[i]); + resource_list_add(rl, SYS_RES_IRQ, k, intr[i], intr[i], + 1); + if (icells > 1) + ofw_bus_config_intr(dev, intr[i], intr[i+1]); } - - if (interrupt < 0) { - rv = ERANGE; - goto out; - } - - debugf("decoded intr = %d, trig = %d, pol = %d\n", interrupt, - trig, pol); - - intr_sl[i].trig = trig; - intr_sl[i].pol = pol; - - resource_list_add(rl, SYS_RES_IRQ, i, interrupt, interrupt, 1); + free(intr, M_OFWPROP); } -out: - free(intr, M_OFWPROP); - return (rv); + return (0); } int Modified: stable/10/sys/dev/fdt/fdt_common.h ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.h Wed May 14 18:44:38 2014 (r266078) +++ stable/10/sys/dev/fdt/fdt_common.h Wed May 14 18:54:34 2014 (r266079) @@ -94,8 +94,7 @@ int fdt_get_phyaddr(phandle_t, device_t, int fdt_get_range(phandle_t, int, u_long *, u_long *); int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); -int fdt_intr_decode(phandle_t, pcell_t *, int *, int *, int *); -int fdt_intr_to_rl(phandle_t, struct resource_list *, struct fdt_sense_level *); +int fdt_intr_to_rl(device_t, phandle_t, struct resource_list *, struct fdt_sense_level *); int fdt_is_compatible(phandle_t, const char *); int fdt_is_compatible_strict(phandle_t, const char *); int fdt_is_enabled(phandle_t); Modified: stable/10/sys/dev/fdt/fdt_mips.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_mips.c Wed May 14 18:44:38 2014 (r266078) +++ stable/10/sys/dev/fdt/fdt_mips.c Wed May 14 18:54:34 2014 (r266079) @@ -49,45 +49,3 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; -/* - * For PIC-free boards, provide a PIC decoder to be used with mips4k CP0 - * interrupt control directly. - */ -static int -fdt_pic_decode_mips4k_cp0(phandle_t node, pcell_t *intr, int *interrupt, - int *trig, int *pol) -{ - - if (!fdt_is_compatible(node, "mips,mips4k")) - return (ENXIO); - - *interrupt = fdt32_to_cpu(intr[0]); - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - - return (0); -} - -/* - * CHERI PIC decoder. - */ -static int -fdt_pic_decode_beri(phandle_t node, pcell_t *intr, int *interrupt, - int *trig, int *pol) -{ - - if (!fdt_is_compatible(node, "sri-cambridge,beri-pic")) - return (ENXIO); - - *interrupt = fdt32_to_cpu(intr[0]); - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - - return (0); -} - -fdt_pic_decode_t fdt_pic_table[] = { - &fdt_pic_decode_mips4k_cp0, - &fdt_pic_decode_beri, - NULL -}; Modified: stable/10/sys/dev/fdt/fdt_powerpc.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_powerpc.c Wed May 14 18:44:38 2014 (r266078) +++ stable/10/sys/dev/fdt/fdt_powerpc.c Wed May 14 18:54:34 2014 (r266079) @@ -81,89 +81,3 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; -static int -fdt_pic_decode_iic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, - int *pol) -{ - if (!fdt_is_compatible(node, "chrp,iic")) - return (ENXIO); - - *interrupt = intr[0]; - - switch (intr[1]) { - case 0: - /* Active L level */ - *trig = INTR_TRIGGER_LEVEL; - *pol = INTR_POLARITY_LOW; - break; - case 1: - /* Active H level */ - *trig = INTR_TRIGGER_LEVEL; - *pol = INTR_POLARITY_HIGH; - break; - case 2: - /* H to L edge */ - *trig = INTR_TRIGGER_EDGE; - *pol = INTR_POLARITY_LOW; - break; - case 3: - /* L to H edge */ - *trig = INTR_TRIGGER_EDGE; - *pol = INTR_POLARITY_HIGH; - break; - default: - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - } - return (0); -} - -static int -fdt_pic_decode_openpic(phandle_t node, pcell_t *intr, int *interrupt, - int *trig, int *pol) -{ - - if (!fdt_is_compatible(node, "chrp,open-pic") && - !fdt_is_type(node, "open-pic")) - return (ENXIO); - - /* - * XXX The interrupt number read out from the MPC85XX device tree is - * already offset by 16 to reflect the 'internal' IRQ range shift on - * the OpenPIC. - */ - *interrupt = intr[0]; - - switch (intr[1]) { - case 0: - /* L to H edge */ - *trig = INTR_TRIGGER_EDGE; - *pol = INTR_POLARITY_HIGH; - break; - case 1: - /* Active L level */ - *trig = INTR_TRIGGER_LEVEL; - *pol = INTR_POLARITY_LOW; - break; - case 2: - /* Active H level */ - *trig = INTR_TRIGGER_LEVEL; - *pol = INTR_POLARITY_HIGH; - break; - case 3: - /* H to L edge */ - *trig = INTR_TRIGGER_EDGE; - *pol = INTR_POLARITY_LOW; - break; - default: - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - } - return (0); -} - -fdt_pic_decode_t fdt_pic_table[] = { - &fdt_pic_decode_iic, - &fdt_pic_decode_openpic, - NULL -}; Modified: stable/10/sys/dev/fdt/fdt_x86.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_x86.c Wed May 14 18:44:38 2014 (r266078) +++ stable/10/sys/dev/fdt/fdt_x86.c Wed May 14 18:54:34 2014 (r266079) @@ -46,6 +46,3 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; -fdt_pic_decode_t fdt_pic_table[] = { - NULL -}; Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Wed May 14 18:44:38 2014 (r266078) +++ stable/10/sys/dev/fdt/simplebus.c Wed May 14 18:54:34 2014 (r266079) @@ -196,7 +196,7 @@ simplebus_attach(device_t dev) continue; } - if (fdt_intr_to_rl(dt_child, &di->di_res, di->di_intr_sl)) { + if (fdt_intr_to_rl(dev, dt_child, &di->di_res, di->di_intr_sl)) { device_printf(dev, "%s: could not process " "'interrupts' property\n", di->di_ofw.obd_name); resource_list_free(&di->di_res); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 19:19:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4179A813; Wed, 14 May 2014 19:19: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 2A42F20C4; Wed, 14 May 2014 19:19: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 s4EJJ3U0003542; Wed, 14 May 2014 19:19:03 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EJIxOC003489; Wed, 14 May 2014 19:18:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405141918.s4EJIxOC003489@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 19:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266084 - in stable/10/sys: arm/allwinner arm/arm arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/include arm/lpc arm/mv arm/tegra arm/ti arm/versatile arm/xilinx boot/fdt/dts conf ... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 19:19:03 -0000 Author: ian Date: Wed May 14 19:18:58 2014 New Revision: 266084 URL: http://svnweb.freebsd.org/changeset/base/266084 Log: MFC r257738, r259202, r258410, r260288, r260292, r260294, r260320, r260323, r260326, r260327, r260331, r260333, r260340, r260371, r260372, r260373, r260374, r260375 Add common bus_space tag definition shared for most supported ARMv6/v7 SoCs. Correct license statements to reflect the fact that these files were all derived from sys/arm/mv/bus_space.c. In pmap_unmapdev(), remember the size, and use that as an argument to kva_free(), or we'd end up always passing it a size of 0 In pmap_mapdev(), first check whether a static mapping exists, Convert TI static device mapping to use the new arm_devmap_add_entry(), Use the common armv6 fdt_bus_tag defintion for tegra instead of a local copy. Eliminate use of fdt_immr_addr(), it's not needed for tegra Convert lpc from using fdt_immr style to arm_devmap_add_entry() to make static device mappings. Retire machine/fdt.h as a header used by MI code, as its function is now obsolete. This involves the following pieces: - Remove it entirely on PowerPC, where it is not used by MD code either - Remove all references to machine/fdt.h in non-architecture-specific code (aside from uart_cpu_fdt.c, shared by ARM and MIPS, and so is somewhat non-arch-specific). - Fix code relying on header pollution from machine/fdt.h includes - Legacy fdtbus.c (still used on x86 FDT systems) now passes resource requests to its parent (nexus). This allows x86 FDT devices to allocate both memory and IO requests and removes the last notionally MI use of fdtbus_bs_tag. - On those architectures that retain a machine/fdt.h, unused bits like FDT_MAP_IRQ and FDT_INTR_MAX have been removed. Add #include to a few files that used to get it via pollution Enable the mv cesa security/crypto device by providing the required property in the dts source, and adding the right devices to the kernel config. Remove dev/fdt/fdt_pci.c, which was code specific to Marvell ARM SoCs, related to setting up static device mappings. Since it was only used by arm/mv/mv_pci.c, it's now just static functions within that file, plus one public function that gets called only from arm/mv/mv_machdep.c. Switch RPi to using arm_devmap_add_entry() to set up static device mapping. Allow 'no static device mappings' to potentially work. Don't try to find a static mapping before calling pmap_mapdev(), that logic is now part of pmap_mapdev() and doesn't need to be duplicated here. Switch a10 to using arm_devmap_add_entry() to set up static device mapping. Added: stable/10/sys/arm/arm/bus_space-v6.c - copied, changed from r257738, head/sys/arm/arm/bus_space-v6.c Deleted: stable/10/sys/arm/tegra/bus_space.c stable/10/sys/dev/fdt/fdt_pci.c stable/10/sys/powerpc/include/fdt.h Modified: stable/10/sys/arm/allwinner/a10_machdep.c stable/10/sys/arm/arm/bus_space_generic.c stable/10/sys/arm/arm/devmap.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/trap.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c stable/10/sys/arm/conf/DOCKSTAR stable/10/sys/arm/freescale/imx/imx51_ipuv3.c stable/10/sys/arm/include/fdt.h stable/10/sys/arm/include/intr.h stable/10/sys/arm/include/ofw_machdep.h stable/10/sys/arm/include/psl.h stable/10/sys/arm/lpc/lpc_gpio.c stable/10/sys/arm/lpc/lpc_machdep.c stable/10/sys/arm/lpc/lpc_mmc.c stable/10/sys/arm/lpc/lpcreg.h stable/10/sys/arm/mv/mv_machdep.c stable/10/sys/arm/mv/mv_pci.c stable/10/sys/arm/mv/mvvar.h stable/10/sys/arm/tegra/files.tegra2 stable/10/sys/arm/tegra/tegra2_machdep.c stable/10/sys/arm/ti/ti_machdep.c stable/10/sys/arm/versatile/bus_space.c stable/10/sys/arm/xilinx/zy7_bus_space.c stable/10/sys/boot/fdt/dts/dockstar.dts stable/10/sys/conf/files stable/10/sys/dev/fdt/fdt_common.c stable/10/sys/dev/fdt/fdt_common.h stable/10/sys/dev/fdt/fdtbus.c stable/10/sys/dev/fdt/simplebus.c stable/10/sys/dev/uart/uart_bus_fdt.c stable/10/sys/dev/uart/uart_dev_lpc.c stable/10/sys/mips/include/fdt.h stable/10/sys/x86/include/fdt.h stable/10/sys/x86/include/ofw_machdep.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/allwinner/a10_machdep.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_machdep.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/allwinner/a10_machdep.c Wed May 14 19:18:58 2014 (r266084) @@ -50,21 +50,16 @@ __FBSDID("$FreeBSD$"); #include -/* Start of address space used for bootstrap map */ -#define DEVMAP_BOOTSTRAP_MAP_START 0xE0000000 - - vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START); + return (arm_devmap_lastaddr()); } void initarm_early_init(void) { - } void @@ -77,28 +72,21 @@ initarm_late_init(void) { } -#define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, } -}; - /* - * Construct pmap_devmap[] with DT-derived config data. + * Set up static device mappings. + * + * This covers all the on-chip device with 1MB section mappings, which is good + * for performance (uses fewer TLB entries for device access). + * + * XXX It also covers a block of SRAM and some GPU (mali400) stuff that maybe + * shouldn't be device-mapped. The original code mapped a 4MB block, but + * perhaps a 1MB block would be more appropriate. */ int initarm_devmap_init(void) { - int i = 0; - - fdt_devmap[i].pd_va = 0xE1C00000; - fdt_devmap[i].pd_pa = 0x01C00000; - fdt_devmap[i].pd_size = 0x00400000; /* 4 MB */ - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - - i++; - arm_devmap_register_table(&fdt_devmap[0]); + arm_devmap_add_entry(0x01C00000, 0x00400000); /* 4MB */ return (0); } Copied and modified: stable/10/sys/arm/arm/bus_space-v6.c (from r257738, head/sys/arm/arm/bus_space-v6.c) ============================================================================== --- head/sys/arm/arm/bus_space-v6.c Wed Nov 6 09:41:19 2013 (r257738, copy source) +++ stable/10/sys/arm/arm/bus_space-v6.c Wed May 14 19:18:58 2014 (r266084) @@ -1,7 +1,9 @@ /*- - * Copyright (c) 2012 Damjan Marion + * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. * All rights reserved. * + * Developed by Semihalf. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -10,11 +12,14 @@ * 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. Neither the name of MARVELL nor the names of contributors + * may 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 + * 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 THE AUTHOR OR CONTRIBUTORS BE LIABLE + * 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) Modified: stable/10/sys/arm/arm/bus_space_generic.c ============================================================================== --- stable/10/sys/arm/arm/bus_space_generic.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/arm/bus_space_generic.c Wed May 14 19:18:58 2014 (r266084) @@ -62,16 +62,12 @@ generic_bs_map(void *t, bus_addr_t bpa, void *va; /* - * Look up the address in the static device mappings. If it's not - * there, establish a new dynamic mapping. - * * We don't even examine the passed-in flags. For ARM, the CACHEABLE * flag doesn't make sense (we create PTE_DEVICE mappings), and the * LINEAR flag is just implied because we use kva_alloc(size). */ - if ((va = arm_devmap_ptov(bpa, size)) == NULL) - if ((va = pmap_mapdev(bpa, size)) == NULL) - return (ENOMEM); + if ((va = pmap_mapdev(bpa, size)) == NULL) + return (ENOMEM); *bshp = (bus_space_handle_t)va; return (0); } @@ -90,12 +86,7 @@ void generic_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) { - /* - * If the region is static-mapped do nothing, otherwise remove the - * dynamic mapping. - */ - if (arm_devmap_vtop((void*)h, size) == DEVMAP_PADDR_NOTFOUND) - pmap_unmapdev((vm_offset_t)h, size); + pmap_unmapdev((vm_offset_t)h, size); } void Modified: stable/10/sys/arm/arm/devmap.c ============================================================================== --- stable/10/sys/arm/arm/devmap.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/arm/devmap.c Wed May 14 19:18:58 2014 (r266084) @@ -67,11 +67,8 @@ arm_devmap_lastaddr() if (akva_devmap_idx > 0) return (akva_devmap_vaddr); - if (devmap_table == NULL) - panic("arm_devmap_lastaddr(): No devmap table registered."); - lowaddr = ARM_VECTORS_HIGH; - for (pd = devmap_table; pd->pd_size != 0; ++pd) { + for (pd = devmap_table; pd != NULL && pd->pd_size != 0; ++pd) { if (lowaddr > pd->pd_va) lowaddr = pd->pd_va; } @@ -145,22 +142,21 @@ arm_devmap_bootstrap(vm_offset_t l1pt, c { const struct arm_devmap_entry *pd; + devmap_bootstrap_done = true; + /* - * If given a table pointer, use it, else ensure a table was previously - * registered. This happens early in boot, and there's a good chance - * the panic message won't be seen, but there's not much we can do. + * If given a table pointer, use it. Otherwise, if a table was + * previously registered, use it. Otherwise, no work to do. */ if (table != NULL) devmap_table = table; else if (devmap_table == NULL) - panic("arm_devmap_bootstrap(): No devmap table registered"); + return; for (pd = devmap_table; pd->pd_size != 0; ++pd) { pmap_map_chunk(l1pt, pd->pd_va, pd->pd_pa, pd->pd_size, pd->pd_prot,pd->pd_cache); } - - devmap_bootstrap_done = true; } /* @@ -207,13 +203,23 @@ arm_devmap_vtop(void * vpva, vm_size_t s /* * Map a set of physical memory pages into the kernel virtual address space. - * Return a pointer to where it is mapped. This routine is intended to be used - * for mapping device memory, NOT real memory. + * Return a pointer to where it is mapped. + * + * This uses a pre-established static mapping if one exists for the requested + * range, otherwise it allocates kva space and maps the physical pages into it. + * + * This routine is intended to be used for mapping device memory, NOT real + * memory; the mapping type is inherently PTE_DEVICE in pmap_kenter_device(). */ void * pmap_mapdev(vm_offset_t pa, vm_size_t size) { vm_offset_t va, tmpva, offset; + void * rva; + + /* First look in the static mapping table. */ + if ((rva = arm_devmap_ptov(pa, size)) != NULL) + return (rva); offset = pa & PAGE_MASK; pa = trunc_page(pa); @@ -240,7 +246,13 @@ void pmap_unmapdev(vm_offset_t va, vm_size_t size) { vm_offset_t tmpva, offset; - + vm_size_t origsize; + + /* Nothing to do if we find the mapping in the static table. */ + if (arm_devmap_vtop((void*)va, size) != DEVMAP_PADDR_NOTFOUND) + return; + + origsize = size; offset = va & PAGE_MASK; va = trunc_page(va); size = round_page(size + offset); @@ -251,6 +263,6 @@ pmap_unmapdev(vm_offset_t va, vm_size_t tmpva += PAGE_SIZE; } - kva_free(va, size); + kva_free(va, origsize); } Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/arm/machdep.c Wed May 14 19:18:58 2014 (r266084) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/10/sys/arm/arm/trap.c ============================================================================== --- stable/10/sys/arm/arm/trap.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/arm/trap.c Wed May 14 19:18:58 2014 (r266084) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed May 14 19:18:58 2014 (r266084) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Wed May 14 19:18:58 2014 (r266084) @@ -59,14 +59,11 @@ __FBSDID("$FreeBSD$"); #include -/* Start of address space used for bootstrap map */ -#define DEVMAP_BOOTSTRAP_MAP_START 0xE0000000 - vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START); + return (arm_devmap_lastaddr()); } void @@ -99,28 +96,16 @@ initarm_late_init(void) } } -#define FDT_DEVMAP_MAX (2) // FIXME -static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, } -}; - - /* - * Construct pmap_devmap[] with DT-derived config data. + * Set up static device mappings. + * All on-chip peripherals exist in a 16MB range starting at 0x20000000. + * Map the entire range using 1MB section mappings. */ int initarm_devmap_init(void) { - int i = 0; - - fdt_devmap[i].pd_va = 0xf2000000; - fdt_devmap[i].pd_pa = 0x20000000; - fdt_devmap[i].pd_size = 0x01000000; /* 1 MB */ - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - i++; - arm_devmap_register_table(&fdt_devmap[0]); + arm_devmap_add_entry(0x20000000, 0x01000000); return (0); } Modified: stable/10/sys/arm/conf/DOCKSTAR ============================================================================== --- stable/10/sys/arm/conf/DOCKSTAR Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/conf/DOCKSTAR Wed May 14 19:18:58 2014 (r266084) @@ -3,73 +3,165 @@ # # $FreeBSD$ # +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ +# ident DOCKSTAR + include "../mv/kirkwood/std.db88f6xxx" -options SOC_MV_KIRKWOOD +makeoptions FDT_DTS_FILE=dockstar.dts + makeoptions MODULES_OVERRIDE="" -#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror" +options SOC_MV_KIRKWOOD options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols +options SOFTUPDATES +options CD9660 #ISO 9660 filesystem options FFS #Berkeley Fast Filesystem -options NFSCL #New Network Filesystem Client -options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCL -options BOOTP -options BOOTP_NFSROOT -options BOOTP_NFSV3 -options BOOTP_COMPAT -options BOOTP_WIRED_TO=mge0 - -# Root fs on USB device -#options ROOTDEVNAME=\"ufs:/dev/da0a\" - +options MSDOSFS #MS DOS File System (FAT, FAT32) +options NULLFS #NULL filesystem +options TMPFS #Efficient memory filesystem options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING +options GEOM_ELI # Disk encryption. +options GEOM_LABEL # Providers labelization. +options GEOM_PART_GPT # GPT partitioning -# Debugging -options ALT_BREAK_TO_DEBUGGER -options DDB -options KDB +# Flattened Device Tree +device fdt +options FDT +options FDT_DTB_STATIC + +# Misc pseudo devices +device bpf #Required for DHCP +device faith #IPv6-to-IPv4 relaying (translation) +device firmware #firmware(9) required for USB wlan +device gif #IPv6 and IPv4 tunneling +device loop #Network loopback +device md #Memory/malloc disk +device pty #BSD-style compatibility pseudo ttys +device random #Entropy device +device tun #Packet tunnel. +device ether #Required for all ethernet devices +device vlan #802.1Q VLAN support +device wlan #802.11 WLAN support -# Pseudo devices -device md -device random -device loop +# cam support for umass and ahci +device scbus +device pass +device da # Serial ports device uart # Networking -device ether device mge # Marvell Gigabit Ethernet controller device mii -device bpf -options HZ=1000 -options DEVICE_POLLING -device vlan +device e1000phy # USB -options USB_DEBUG # enable debug msgs -device usb -device ehci -device umass -device scbus -device pass -device da +options USB_HOST_ALIGN=32 # Align DMA to cacheline +#options USB_DEBUG # Compile in USB debug support +device usb # Basic usb support +device ehci # USB host controller +device umass # Mass storage +device uhid # Human-interface devices +device rum # Ralink Technology RT2501USB wireless NICs +device uath # Atheros AR5523 wireless NICs +device ural # Ralink Technology RT2500USB wireless NICs +device zyd # ZyDAS zb1211/zb1211b wireless NICs +device urtw # Realtek RTL8187B/L USB +device upgt # Conexant/Intersil PrismGT SoftMAC USB +device u3g # USB-based 3G modems (Option, Huawei, Sierra) + +# I2C (TWSI) +device iic +device iicbus + +# Sound +device sound +device snd_uaudio + +#crypto +device cesa # Marvell security engine +device crypto +device cryptodev + +# IPSec +device enc +options IPSEC +options IPSEC_NAT_T +options TCP_SIGNATURE #include support for RFC 2385 + +# IPFW +options IPFIREWALL +options IPFIREWALL_DEFAULT_TO_ACCEPT +options IPFIREWALL_VERBOSE +options IPFIREWALL_VERBOSE_LIMIT=100 +options IPFIREWALL_NAT +options LIBALIAS +options DUMMYNET +options IPDIVERT + +#PF +device pf +device pflog +device pfsync + +# ALTQ, required for PF +options ALTQ # Basic ALTQ support +options ALTQ_CBQ # Class Based Queueing +options ALTQ_RED # Random Early Detection +options ALTQ_RIO # RED In/Out +options ALTQ_HFSC # Hierarchical Packet Scheduler +options ALTQ_CDNR # Traffic conditioner +options ALTQ_PRIQ # Priority Queueing +options ALTQ_NOPCC # Required if the TSC is unusable +#options ALTQ_DEBUG + +# Debugging +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER +options DDB +options KDB +options DIAGNOSTIC +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options WITNESS_KDB + +# Enable these options for nfs root configured via BOOTP. +options NFSCL #Network Filesystem Client +options NFSLOCKD #Network Lock Manager +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=mge0 + +# If not using BOOTP, use something like one of these... +#options ROOTDEVNAME=\"ufs:/dev/da0a\" +options ROOTDEVNAME=\"ufs:/dev/da0s1a\" +#options ROOTDEVNAME=\"ufs:/dev/da0p10\" +#options ROOTDEVNAME=\"nfs:192.168.0.254/dreamplug\" -# Flattened Device Tree -options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=dockstar.dts Modified: stable/10/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ipuv3.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/freescale/imx/imx51_ipuv3.c Wed May 14 19:18:58 2014 (r266084) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: stable/10/sys/arm/include/fdt.h ============================================================================== --- stable/10/sys/arm/include/fdt.h Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/include/fdt.h Wed May 14 19:18:58 2014 (r266084) @@ -51,15 +51,8 @@ */ extern bus_space_tag_t fdtbus_bs_tag; -struct mem_region { - vm_offset_t mr_start; - vm_size_t mr_size; -}; - struct arm_devmap_entry; int fdt_localbus_devmap(phandle_t, struct arm_devmap_entry *, int, int *); -int fdt_pci_devmap(phandle_t, struct arm_devmap_entry *devmap, vm_offset_t, - vm_offset_t); #endif /* _MACHINE_FDT_H_ */ Modified: stable/10/sys/arm/include/intr.h ============================================================================== --- stable/10/sys/arm/include/intr.h Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/include/intr.h Wed May 14 19:18:58 2014 (r266084) @@ -67,8 +67,6 @@ #define NIRQ 32 #endif -#include -#include int arm_get_next_irq(int); void arm_mask_irq(uintptr_t); Modified: stable/10/sys/arm/include/ofw_machdep.h ============================================================================== --- stable/10/sys/arm/include/ofw_machdep.h Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/include/ofw_machdep.h Wed May 14 19:18:58 2014 (r266084) @@ -32,6 +32,13 @@ #ifndef _MACHINE_OFW_MACHDEP_H_ #define _MACHINE_OFW_MACHDEP_H_ +#include + typedef uint32_t cell_t; +struct mem_region { + vm_offset_t mr_start; + vm_size_t mr_size; +}; + #endif /* _MACHINE_OFW_MACHDEP_H_ */ Modified: stable/10/sys/arm/include/psl.h ============================================================================== --- stable/10/sys/arm/include/psl.h Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/include/psl.h Wed May 14 19:18:58 2014 (r266084) @@ -46,7 +46,6 @@ #ifndef _MACHINE_PSL_H_ #define _MACHINE_PSL_H_ -#include /* * These are the different SPL states Modified: stable/10/sys/arm/lpc/lpc_gpio.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_gpio.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/lpc/lpc_gpio.c Wed May 14 19:18:58 2014 (r266084) @@ -502,12 +502,18 @@ lpc_gpio_get_state(device_t dev, int pin void platform_gpio_init() { + bus_space_tag_t bst; + bus_space_handle_t bsh; + + bst = fdtbus_bs_tag; + /* Preset SPI devices CS pins to one */ - bus_space_write_4(fdtbus_bs_tag, - LPC_GPIO_BASE, LPC_GPIO_P3_OUTP_SET, + bus_space_map(bst, LPC_GPIO_PHYS_BASE, LPC_GPIO_SIZE, 0, &bsh); + bus_space_write_4(bst, bsh, LPC_GPIO_P3_OUTP_SET, 1 << (SSD1289_CS_PIN - LPC_GPIO_GPO_00(0)) | 1 << (SSD1289_DC_PIN - LPC_GPIO_GPO_00(0)) | 1 << (ADS7846_CS_PIN - LPC_GPIO_GPO_00(0))); + bus_space_unmap(bst, bsh, LPC_GPIO_SIZE); } static device_method_t lpc_gpio_methods[] = { Modified: stable/10/sys/arm/lpc/lpc_machdep.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_machdep.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/lpc/lpc_machdep.c Wed May 14 19:18:58 2014 (r266084) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -57,21 +58,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include vm_offset_t initarm_lastaddr(void) { - return (fdt_immr_va); + return (arm_devmap_lastaddr()); } void initarm_early_init(void) { - - if (fdt_immr_addr(LPC_DEV_BASE) != 0) - while (1); } void @@ -89,28 +86,16 @@ initarm_late_init(void) { } -#define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, } -}; - /* - * Construct pmap_devmap[] with DT-derived config data. + * Add a single static device mapping. + * The values used were taken from the ranges property of the SoC node in the + * dts file when this code was converted to arm_devmap_add_entry(). */ int initarm_devmap_init(void) { - /* - * IMMR range. - */ - fdt_devmap[0].pd_va = fdt_immr_va; - fdt_devmap[0].pd_pa = fdt_immr_pa; - fdt_devmap[0].pd_size = fdt_immr_size; - fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[0].pd_cache = PTE_NOCACHE; - - arm_devmap_register_table(&fdt_devmap[0]); + arm_devmap_add_entry(LPC_DEV_PHYS_BASE, LPC_DEV_SIZE); return (0); } @@ -131,15 +116,24 @@ bus_dma_get_range_nb(void) void cpu_reset(void) { + bus_space_tag_t bst; + bus_space_handle_t bsh; + + bst = fdtbus_bs_tag; + /* Enable WDT */ - bus_space_write_4(fdtbus_bs_tag, - LPC_CLKPWR_BASE, LPC_CLKPWR_TIMCLK_CTRL, + bus_space_map(bst, LPC_CLKPWR_PHYS_BASE, LPC_CLKPWR_SIZE, 0, &bsh); + bus_space_write_4(bst, bsh, LPC_CLKPWR_TIMCLK_CTRL, LPC_CLKPWR_TIMCLK_CTRL_WATCHDOG); + bus_space_unmap(bst, bsh, LPC_CLKPWR_SIZE); /* Instant assert of RESETOUT_N with pulse length 1ms */ - bus_space_write_4(fdtbus_bs_tag, LPC_WDTIM_BASE, LPC_WDTIM_PULSE, 13000); - bus_space_write_4(fdtbus_bs_tag, LPC_WDTIM_BASE, LPC_WDTIM_MCTRL, 0x70); + bus_space_map(bst, LPC_WDTIM_PHYS_BASE, LPC_WDTIM_SIZE, 0, &bsh); + bus_space_write_4(bst, bsh, LPC_WDTIM_PULSE, 13000); + bus_space_write_4(bst, bsh, LPC_WDTIM_MCTRL, 0x70); + bus_space_unmap(bst, bsh, LPC_WDTIM_SIZE); - for (;;); + for (;;) + continue; } Modified: stable/10/sys/arm/lpc/lpc_mmc.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_mmc.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/lpc/lpc_mmc.c Wed May 14 19:18:58 2014 (r266084) @@ -507,14 +507,14 @@ lpc_mmc_setup_xfer(struct lpc_mmc_softc if (data->flags & MMC_DATA_READ) { sc->lm_xfer_direction = DIRECTION_READ; lpc_dmac_setup_transfer(sc->lm_dev, LPC_MMC_DMACH_READ, - LPC_SD_BASE + LPC_SD_FIFO, sc->lm_buffer_phys, + LPC_SD_PHYS_BASE + LPC_SD_FIFO, sc->lm_buffer_phys, data_words, 0); } if (data->flags & MMC_DATA_WRITE) { sc->lm_xfer_direction = DIRECTION_WRITE; lpc_dmac_setup_transfer(sc->lm_dev, LPC_MMC_DMACH_WRITE, - sc->lm_buffer_phys, LPC_SD_BASE + LPC_SD_FIFO, + sc->lm_buffer_phys, LPC_SD_PHYS_BASE + LPC_SD_FIFO, data_words, 0); } Modified: stable/10/sys/arm/lpc/lpcreg.h ============================================================================== --- stable/10/sys/arm/lpc/lpcreg.h Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/lpc/lpcreg.h Wed May 14 19:18:58 2014 (r266084) @@ -32,7 +32,6 @@ #define LPC_DEV_PHYS_BASE 0x40000000 #define LPC_DEV_P5_PHYS_BASE 0x20000000 #define LPC_DEV_P6_PHYS_BASE 0x30000000 -#define LPC_DEV_BASE 0xd0000000 #define LPC_DEV_SIZE 0x10000000 /* @@ -88,7 +87,7 @@ /* * Watchdog timer. (from UM10326: LPC32x0 User manual, page 572) */ -#define LPC_WDTIM_BASE (LPC_DEV_BASE + 0x3c000) +#define LPC_WDTIM_PHYS_BASE (LPC_DEV_PHYS_BASE + 0x3c000) #define LPC_WDTIM_INT 0x00 #define LPC_WDTIM_CTRL 0x04 #define LPC_WDTIM_COUNTER 0x08 @@ -97,11 +96,12 @@ #define LPC_WDTIM_EMR 0x14 #define LPC_WDTIM_PULSE 0x18 #define LPC_WDTIM_RES 0x1c +#define LPC_WDTIM_SIZE 0x20 /* * Clocking and power control. (from UM10326: LPC32x0 User manual, page 58) */ -#define LPC_CLKPWR_BASE (LPC_DEV_BASE + 0x4000) +#define LPC_CLKPWR_PHYS_BASE (LPC_DEV_PHYS_BASE + 0x4000) #define LPC_CLKPWR_PWR_CTRL 0x44 #define LPC_CLKPWR_OSC_CTRL 0x4c #define LPC_CLKPWR_SYSCLK_CTRL 0x50 @@ -189,6 +189,7 @@ #define LPC_CLKPWR_UARTCLK_CTRL 0xe4 #define LPC_CLKPWR_POS0_IRAM_CTRL 0x110 #define LPC_CLKPWR_POS1_IRAM_CTRL 0x114 +#define LPC_CLKPWR_SIZE 0x118 /* Additional UART registers in CLKPWR address space. */ #define LPC_CLKPWR_UART_U3CLK 0xd0 @@ -201,9 +202,9 @@ #define LPC_CLKPWR_UART_IRDACLK 0xe0 /* Additional UART registers */ -#define LPC_UART_BASE (LPC_DEV_BASE + 0x80000) -#define LPC_UART_CONTROL_BASE (LPC_DEV_BASE + 0x54000) -#define LPC_UART5_BASE (LPC_DEV_BASE + 0x90000) +#define LPC_UART_BASE 0x80000 +#define LPC_UART_CONTROL_BASE 0x54000 +#define LPC_UART5_BASE 0x90000 #define LPC_UART_CTRL 0x00 #define LPC_UART_CLKMODE 0x04 #define LPC_UART_CLKMODE_UART3(_n) (((_n) & 0x3) << 4) @@ -211,6 +212,7 @@ #define LPC_UART_CLKMODE_UART5(_n) (((_n) & 0x3) << 8) #define LPC_UART_CLKMODE_UART6(_n) (((_n) & 0x3) << 10) #define LPC_UART_LOOP 0x08 +#define LPC_UART_CONTROL_SIZE 0x0c #define LPC_UART_FIFOSIZE 64 /* @@ -236,7 +238,7 @@ /* * MMC/SD controller. (from UM10326: LPC32x0 User manual, page 436) */ -#define LPC_SD_BASE (LPC_DEV_P5_PHYS_BASE + 0x98000) +#define LPC_SD_PHYS_BASE (LPC_DEV_P5_PHYS_BASE + 0x98000) #define LPC_SD_CLK (13 * 1000 * 1000) // 13Mhz #define LPC_SD_POWER 0x00 #define LPC_SD_POWER_OPENDRAIN (1 << 6) @@ -535,7 +537,7 @@ /* * GPIO (from UM10326: LPC32x0 User manual, page 606) */ -#define LPC_GPIO_BASE (LPC_DEV_BASE + 0x28000) +#define LPC_GPIO_PHYS_BASE (LPC_DEV_PHYS_BASE + 0x28000) #define LPC_GPIO_P0_COUNT 8 #define LPC_GPIO_P1_COUNT 24 #define LPC_GPIO_P2_COUNT 13 @@ -564,6 +566,8 @@ #define LPC_GPIO_P3_OUTP_SET 0x04 #define LPC_GPIO_P3_OUTP_CLR 0x08 #define LPC_GPIO_P3_OUTP_STATE 0x0c +#define LPC_GPIO_SIZE 0x80 + /* Aliases for logical pin numbers: */ #define LPC_GPIO_GPI_00(_n) (0 + _n) #define LPC_GPIO_GPI_15(_n) (10 + _n) Modified: stable/10/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/10/sys/arm/mv/mv_machdep.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/mv/mv_machdep.c Wed May 14 19:18:58 2014 (r266084) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include /* XXX */ @@ -293,11 +294,11 @@ out: } /* - * Supply a default do-nothing implementation of fdt_pci_devmap() via a weak + * Supply a default do-nothing implementation of mv_pci_devmap() via a weak * alias. Many Marvell platforms don't support a PCI interface, but to support * those that do, we end up with a reference to this function below, in * platform_devmap_init(). If "device pci" appears in the kernel config, the - * real implementation of this function in dev/fdt/fdt_pci.c overrides the weak + * real implementation of this function in arm/mv/mv_pci.c overrides the weak * alias defined here. */ int mv_default_fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, @@ -309,7 +310,7 @@ mv_default_fdt_pci_devmap(phandle_t node return (0); } -__weak_reference(mv_default_fdt_pci_devmap, fdt_pci_devmap); +__weak_reference(mv_default_fdt_pci_devmap, mv_pci_devmap); /* * XXX: When device entry in devmap has pd_size smaller than section size, @@ -378,7 +379,7 @@ initarm_devmap_init(void) * XXX this should account for PCI and multiple ranges * of a given kind. */ - if (fdt_pci_devmap(child, &fdt_devmap[i], MV_PCI_VA_IO_BASE, + if (mv_pci_devmap(child, &fdt_devmap[i], MV_PCI_VA_IO_BASE, MV_PCI_VA_MEM_BASE) != 0) return (ENXIO); i += 2; Modified: stable/10/sys/arm/mv/mv_pci.c ============================================================================== --- stable/10/sys/arm/mv/mv_pci.c Wed May 14 19:11:15 2014 (r266083) +++ stable/10/sys/arm/mv/mv_pci.c Wed May 14 19:18:58 2014 (r266084) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -69,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include "ofw_bus_if.h" #include "pcib_if.h" +#include #include #include @@ -82,6 +84,172 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif +/* + * Code and data related to fdt-based PCI configuration. + * + * This stuff used to be in dev/fdt/fdt_pci.c and fdt_common.h, but it was + * always Marvell-specific so that was deleted and the code now lives here. + */ + +struct mv_pci_range { + u_long base_pci; + u_long base_parent; + u_long len; +}; + +#define FDT_RANGES_CELLS ((3 + 3 + 2) * 2) + +static void +mv_pci_range_dump(struct mv_pci_range *range) +{ +#ifdef DEBUG + printf("\n"); + printf(" base_pci = 0x%08lx\n", range->base_pci); + printf(" base_par = 0x%08lx\n", range->base_parent); + printf(" len = 0x%08lx\n", range->len); +#endif +} + +static int +mv_pci_ranges_decode(phandle_t node, struct mv_pci_range *io_space, + struct mv_pci_range *mem_space) +{ + pcell_t ranges[FDT_RANGES_CELLS]; + struct mv_pci_range *pci_space; + pcell_t addr_cells, size_cells, par_addr_cells; + pcell_t *rangesptr; + pcell_t cell0, cell1, cell2; + int tuple_size, tuples, i, rv, offset_cells, len; + + /* + * Retrieve 'ranges' property. + */ + if ((fdt_addrsize_cells(node, &addr_cells, &size_cells)) != 0) + return (EINVAL); + if (addr_cells != 3 || size_cells != 2) + return (ERANGE); + + par_addr_cells = fdt_parent_addr_cells(node); + if (par_addr_cells > 3) + return (ERANGE); + + len = OF_getproplen(node, "ranges"); + if (len > sizeof(ranges)) + return (ENOMEM); + + if (OF_getprop(node, "ranges", ranges, sizeof(ranges)) <= 0) + return (EINVAL); + + tuple_size = sizeof(pcell_t) * (addr_cells + par_addr_cells + + size_cells); + tuples = len / tuple_size; + + /* + * Initialize the ranges so that we don't have to worry about + * having them all defined in the FDT. In particular, it is + * perfectly fine not to want I/O space on PCI busses. + */ + bzero(io_space, sizeof(*io_space)); + bzero(mem_space, sizeof(*mem_space)); + + rangesptr = &ranges[0]; + offset_cells = 0; + for (i = 0; i < tuples; i++) { + cell0 = fdt_data_get((void *)rangesptr, 1); + rangesptr++; + cell1 = fdt_data_get((void *)rangesptr, 1); + rangesptr++; + cell2 = fdt_data_get((void *)rangesptr, 1); + rangesptr++; + + if (cell0 & 0x02000000) { + pci_space = mem_space; + } else if (cell0 & 0x01000000) { + pci_space = io_space; + } else { + rv = ERANGE; + goto out; + } + + if (par_addr_cells == 3) { + /* + * This is a PCI subnode 'ranges'. Skip cell0 and + * cell1 of this entry and only use cell2. + */ + offset_cells = 2; + rangesptr += offset_cells; + } + + if (fdt_data_verify((void *)rangesptr, par_addr_cells - + offset_cells)) { + rv = ERANGE; + goto out; + } + pci_space->base_parent = fdt_data_get((void *)rangesptr, + par_addr_cells - offset_cells); + rangesptr += par_addr_cells - offset_cells; + + if (fdt_data_verify((void *)rangesptr, size_cells)) { + rv = ERANGE; + goto out; + } + pci_space->len = fdt_data_get((void *)rangesptr, size_cells); + rangesptr += size_cells; + + pci_space->base_pci = cell2; + } + rv = 0; +out: + return (rv); +} + +static int +mv_pci_ranges(phandle_t node, struct mv_pci_range *io_space, + struct mv_pci_range *mem_space) +{ + int err; + + debugf("Processing PCI node: %x\n", node); + if ((err = mv_pci_ranges_decode(node, io_space, mem_space)) != 0) { + debugf("could not decode parent PCI node 'ranges'\n"); + return (err); + } + + debugf("Post fixup dump:\n"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 20:11:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 15E844CB; Wed, 14 May 2014 20:11: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 005202543; Wed, 14 May 2014 20:11: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 s4EKBM3U032419; Wed, 14 May 2014 20:11:22 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EKBKpM032405; Wed, 14 May 2014 20:11:20 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405142011.s4EKBKpM032405@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 20:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266085 - in stable/10/sys: arm/broadcom/bcm2835 arm/conf arm/freescale/vybrid boot/fdt/dts dev/uart dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 20:11:23 -0000 Author: ian Date: Wed May 14 20:11:20 2014 New Revision: 266085 URL: http://svnweb.freebsd.org/changeset/base/266085 Log: MFC r256839, r256948, r256950, r257299, r257414, r258057, r259090 Add configuration for the Freescale i.MX53 Quick Start Board. Add the Raspberry Pi BSC (I2C compliant) controller driver. Add Radxa Rock board (by radxa.com) support. Digi-CCWMX53: enable ffec and uart, USB. Add support for Freescale Vybrid Family VF600 Move and rename dwc otg driver to more generic one as it appears to work for rk3188 SoC based board too. Added: stable/10/sys/arm/conf/COSMIC - copied unchanged from r258057, head/sys/arm/conf/COSMIC stable/10/sys/arm/conf/RADXA - copied unchanged from r256950, head/sys/arm/conf/RADXA stable/10/sys/arm/freescale/vybrid/ - copied from r258057, head/sys/arm/freescale/vybrid/ stable/10/sys/boot/fdt/dts/rk3188-radxa.dts - copied unchanged from r256948, head/sys/boot/fdt/dts/rk3188-radxa.dts stable/10/sys/boot/fdt/dts/rk3188.dtsi - copied unchanged from r256948, head/sys/boot/fdt/dts/rk3188.dtsi stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts - copied unchanged from r258057, head/sys/boot/fdt/dts/vybrid-cosmic.dts stable/10/sys/boot/fdt/dts/vybrid.dtsi - copied unchanged from r258057, head/sys/boot/fdt/dts/vybrid.dtsi stable/10/sys/dev/usb/controller/dwc_otg_fdt.c - copied unchanged from r256839, head/sys/dev/usb/controller/dwc_otg_fdt.c Deleted: stable/10/sys/arm/broadcom/bcm2835/dwc_otg_brcm.c Modified: stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 stable/10/sys/arm/conf/DIGI-CCWMX53 stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts stable/10/sys/dev/uart/uart.h stable/10/sys/dev/uart/uart_bus_fdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 Wed May 14 19:18:58 2014 (r266084) +++ stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 Wed May 14 20:11:20 2014 (r266085) @@ -14,7 +14,7 @@ arm/broadcom/bcm2835/bcm2835_systimer.c arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bus_space.c optional fdt arm/broadcom/bcm2835/common.c optional fdt -arm/broadcom/bcm2835/dwc_otg_brcm.c optional dwcotg +dev/usb/controller/dwc_otg_fdt.c optional dwcotg arm/arm/bus_space_generic.c standard arm/arm/bus_space_asm_generic.S standard Copied: stable/10/sys/arm/conf/COSMIC (from r258057, head/sys/arm/conf/COSMIC) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/COSMIC Wed May 14 20:11:20 2014 (r266085, copy of r258057, head/sys/arm/conf/COSMIC) @@ -0,0 +1,139 @@ +# Kernel configuration for Cosmic Board (Freescale Vybrid Family development board). +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident COSMIC + +include "../freescale/vybrid/std.vybrid" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options HZ=100 ## +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +options MSDOSFS #MSDOS Filesystem +options CD9660 #ISO 9660 Filesystem +options PROCFS #Process filesystem (requires PSEUDOFS) +options PSEUDOFS #Pseudo-filesystem framework +#options NANDFS #NAND Filesystem +options TMPFS +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT #Enable verbose sysinit messages +options KDB +options DDB #Enable the kernel debugger +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DIAGNOSTIC + +# NFS support +options NFSCL #Network Filesystem Client +options NFSLOCKD #Network Lock Manager +options NFS_ROOT #NFS usable as /, requires NFSCLIENT + +# Uncomment this for NFS root +#options NFS_ROOT #NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ffec0 + +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci + +#options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" +#options ROOTDEVNAME=\"nandfs:/dev/gnand0s.root\" +options ROOTDEVNAME=\"ufs:/dev/da0\" + +#options SMP + +# Pseudo devices + +device loop +device random +device pty +device md +device gpio + +# USB support +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +#device musb +device ehci +#device ohci + +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# SATA +#device ata +#device atadisk +#device mvs + +device nand + +# Serial ports +device uart + +# I2C (TWSI) +#device iic +#device iicbus + +# Ethernet +device ether +device ffec + +# USB ethernet support, requires miibus +device miibus +device axe # ASIX Electronics USB Ethernet +device bpf # Berkeley packet filter + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=vybrid-cosmic.dts Modified: stable/10/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- stable/10/sys/arm/conf/DIGI-CCWMX53 Wed May 14 19:18:58 2014 (r266084) +++ stable/10/sys/arm/conf/DIGI-CCWMX53 Wed May 14 20:11:20 2014 (r266085) @@ -65,7 +65,7 @@ options VFP # vfp/neon #options BOOTP_COMPAT #options BOOTP_NFSROOT #options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ue0 +#options BOOTP_WIRED_TO=ffec0 #options ROOTDEVNAME=\"ufs:ada0s2a\" @@ -105,8 +105,12 @@ device ether # Ethernet support #device faith # IPv6-to-IPv4 relaying (translation) #device firmware # firmware assist module +# Ethernet +device ffec # Freescale Fast Ethernet Controller +device miibus # Standard mii bus + # Serial (COM) ports -#device uart # Multi-uart driver +device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER device ata @@ -130,13 +134,13 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -#options USB_DEBUG # enable debug msgs -#device ehci # OHCI USB interface -#device usb # USB Bus (required) -#device umass # Disks/Mass storage - Requires scbus and da -#device uhid # "Human Interface Devices" +options USB_DEBUG # enable debug msgs +device ehci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +device uhid # "Human Interface Devices" #device ukbd # Allow keyboard like HIDs to control console -#device ums +device ums # USB Ethernet, requires miibus #device miibus Copied: stable/10/sys/arm/conf/RADXA (from r256950, head/sys/arm/conf/RADXA) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/RADXA Wed May 14 20:11:20 2014 (r266085, copy of r256950, head/sys/arm/conf/RADXA) @@ -0,0 +1,119 @@ +# RADXA -- Custom configuration for the RADXA ARM development +# platform, check out http://www.radxa.com +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident RADXA + +include "../rockchip/std.rk30xx" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +options HZ=100 +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +options MSDOSFS #MSDOS Filesystem +options CD9660 #ISO 9660 Filesystem +options PROCFS #Process filesystem (requires PSEUDOFS) +options PSEUDOFS #Pseudo-filesystem framework +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT #Enable verbose sysinit messages +options KDB +options DDB #Enable the kernel debugger +#options INVARIANTS #Enable calls of extra sanity checking +#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS #Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DIAGNOSTIC + +# NFS support +#options NFSCL +#options NFSSERVER #Network Filesystem Server +#options NFSCLIENT #Network Filesystem Client + +# MMC/SD/SDIO card slot support +#device mmc # mmc/sd bus +#device mmcsd # mmc/sd flash cards + +# Boot device is 2nd slice on MMC/SD card +options ROOTDEVNAME=\"ufs:/dev/da0s2\" + +# Console and misc +device uart +device uart_ns8250 +device pty +device snp +device md +device random # Entropy device + +# I2C support +#device iicbus +#device iic + +# GPIO +device gpio + +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# USB support +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +device dwcotg #DWC OTG controller + +device umass + +# Ethernet +device loop +device ether +device mii +device smscphy +device bpf + +# USB ethernet support, requires miibus +device miibus +device udav + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=rk3188-radxa.dts + Modified: stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts Wed May 14 19:18:58 2014 (r266084) +++ stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts Wed May 14 20:11:20 2014 (r266085) @@ -101,6 +101,10 @@ }; }; aips@60000000 { + ethernet@63fec000 { + status = "okay"; + phy-mode = "rmii"; + }; i2c@63fc4000 { status = "okay"; }; Copied: stable/10/sys/boot/fdt/dts/rk3188-radxa.dts (from r256948, head/sys/boot/fdt/dts/rk3188-radxa.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/rk3188-radxa.dts Wed May 14 20:11:20 2014 (r266085, copy of r256948, head/sys/boot/fdt/dts/rk3188-radxa.dts) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * 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$ + */ + +/dts-v1/; + +/include/ "rk3188.dtsi" + +/ { + model = "Radxa RadxaRock"; + + memory { + device_type = "memory"; + reg = < 0x60000000 0x80000000 >; /* 2GB RAM */ + }; + + aliases { + soc = &SOC; + }; + + SOC: rk3188 { + + uart2: serial@20064000 { + status = "okay"; + }; + + }; + + chosen { + bootargs = "-v"; + stdin = &uart2; + stdout = &uart2; + }; +}; + Copied: stable/10/sys/boot/fdt/dts/rk3188.dtsi (from r256948, head/sys/boot/fdt/dts/rk3188.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/rk3188.dtsi Wed May 14 20:11:20 2014 (r266085, copy of r256948, head/sys/boot/fdt/dts/rk3188.dtsi) @@ -0,0 +1,251 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * 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$ + */ + +/ { + compatible = "rockchip,rk3188"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + soc = &SOC; + }; + + SOC: rk3188 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + GIC: interrupt-controller@1013d000 { + compatible = "arm,gic"; + reg = <0x1013d000 0x1000>, /* Distributor Registers */ + <0x1013c100 0x0100>; /* CPU Interface Registers */ + interrupt-controller; + #interrupt-cells = <1>; + }; + + pmu@20004000 { + compatible = "rockchip,rk30xx-pmu"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x20004000 0x100>; + }; + + grf@20008000 { + compatible = "rockchip,rk30xx-grf"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x20008000 0x2000 >; + }; + + mp_tmr@1013c600 { + compatible = "arm,mpcore-timers"; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = < 148500000 >; + reg = <0x1013c200 0x100>, /* Global Timer Regs */ + <0x1013c600 0x20>; /* Private Timer Regs */ + interrupts = < 27 29 >; + interrupt-parent = <&GIC>; + }; + + timer@20038000 { + compatible = "rockchip,rk30xx-timer"; + compatible = "rockchip,rk3188-dw-apb-timer-osc"; + reg = <0x20038000 0x20>; + interrupts = <76>; + clocks = <24000000>; + status = "disabled"; + }; + + timer@20038020 { + compatible = "rockchip,rk30xx-timer"; + reg = <0x20038020 0x20>; + interrupts = <77>; + clocks = <24000000>; + status = "disabled"; + }; + + timer@20038060 { + compatible = "rockchip,rk30xx-timer"; + reg = <0x20038060 0x20>; + interrupts = <91>; + clocks = <24000000>; + status = "disabled"; + }; + + timer@20038080 { + compatible = "rockchip,rk30xx-timer"; + reg = <0x20038080 0x20>; + interrupts = <92>; + clocks = <24000000>; + status = "disabled"; + }; + + timer@200380a0 { + compatible = "rockchip,rk30xx-timer"; + reg = <0x200380a0 0x20>; + interrupts = <96>; + clocks = <24000000>; + status = "disabled"; + }; + + watchdog@2004c000 { + compatible = "rockchip,rk30xx-wdt"; + reg = <0x2004c000 0x100>; + }; + + gpio0: gpio@2000a000 { + compatible = "rockchip,rk30xx-gpio"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x2000a000 0x100>; + interrupts = <86>; + interrupt-parent = <&GIC>; + }; + + gpio1: gpio@2003c000 { + compatible = "rockchip,rk30xx-gpio"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x2003c000 0x100>; + interrupts = <87>; + interrupt-parent = <&GIC>; + }; + + gpio2: gpio@2003e000 { + compatible = "rockchip,rk30xx-gpio"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x2003e000 0x100>; + interrupts = <88>; + interrupt-parent = <&GIC>; + }; + + gpio3: gpio@20080000 { + compatible = "rockchip,rk30xx-gpio"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x20080000 0x100>; + interrupts = <89>; + interrupt-parent = <&GIC>; + }; + + usb0: usb@10180000 { + compatible = "synopsys,designware-hs-otg2"; + reg = <0x10180000 0x40000>; + interrupts = <48>; + interrupt-parent = <&GIC>; + #address-cells = <1>; + #size-cells = <0>; + }; + + usb1: usb@101c0000 { + compatible = "synopsys,designware-hs-otg2"; + reg = <0x101c0000 0x40000>; + interrupts = < 49 >; + interrupt-parent = <&GIC>; + #address-cells = <1>; + #size-cells = <0>; + }; + + uart0: serial@10124000 { + compatible = "ns16550"; + reg = <0x10124000 0x400>; + reg-shift = <2>; + interrupts = <66>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + status = "disabled"; + }; + + uart1: serial@10126000 { + compatible = "ns16550"; + reg = <0x10126000 0x400>; + reg-shift = <2>; + interrupts = <67>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + status = "disabled"; + }; + + uart2: serial@20064000 { + compatible = "ns16550"; + reg = <0x20064000 0x400>; + reg-shift = <2>; + interrupts = <68>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + status = "disabled"; + }; + + uart3: serial@20068000 { + compatible = "ns16550"; + reg = <0x20068000 0x400>; + reg-shift = <2>; + interrupts = <69>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + status = "disabled"; + }; + + mmc@10214000 { + compatible = "rockchip,rk30xx-mmc"; + reg = <0x10214000 0x1000>; + interrupts = <55>; + #address-cells = <1>; + #size-cells = <0>; + clocks = <24000000>; /* TODO: verify freq */ + status = "disabled"; + }; + + mmc@10218000 { + compatible = "rockchip,rk30xx-mmc"; + reg = <0x10218000 0x1000>; + interrupts = <56>; + #address-cells = <1>; + #size-cells = <0>; + clocks = <24000000>; /* TODO: verify freq */ + status = "disabled"; + }; + }; +}; + Copied: stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts (from r258057, head/sys/boot/fdt/dts/vybrid-cosmic.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts Wed May 14 20:11:20 2014 (r266085, copy of r258057, head/sys/boot/fdt/dts/vybrid-cosmic.dts) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2013 Ruslan Bukin + * 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$ + */ + +/dts-v1/; + +/include/ "vybrid.dtsi" + +/ { + model = "Cosmic Board"; + + memory { + device_type = "memory"; + reg = < 0x80000000 0x10000000 >; /* 256MB RAM */ + }; + + SOC: vybrid { + serial0: serial@40027000 { + status = "disabled"; + }; + + fec0: ethernet@400D0000 { + status = "disabled"; + }; + }; + + chosen { + bootargs = "-v"; + stdin = "serial1"; + stdout = "serial1"; + }; +}; Copied: stable/10/sys/boot/fdt/dts/vybrid.dtsi (from r258057, head/sys/boot/fdt/dts/vybrid.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/vybrid.dtsi Wed May 14 20:11:20 2014 (r266085, copy of r258057, head/sys/boot/fdt/dts/vybrid.dtsi) @@ -0,0 +1,223 @@ +/*- + * Copyright (c) 2013 Ruslan Bukin + * 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$ + */ + +/ { + model = "Freescale Vybrid Family"; + compatible = "freescale,vybrid", "fsl,vf"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-parent = <&GIC>; + + aliases { + soc = &SOC; + serial0 = &serial0; + serial1 = &serial1; + src = &SRC; + }; + + SOC: vybrid { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + SRC: src@4006E000 { + compatible = "fsl,mvf600-src"; + reg = <0x4006E000 0x100>; + }; + + mscm@40001000 { + compatible = "fsl,mvf600-mscm"; + reg = <0x40001000 0x1000>; + }; + + GIC: interrupt-controller@01c81000 { + compatible = "arm,gic"; + reg = <0x40003000 0x1000>, /* Distributor Registers */ + <0x40002100 0x100>; /* CPU Interface Registers */ + interrupt-controller; + #interrupt-cells = <1>; + }; + + anadig@40050000 { + compatible = "fsl,mvf600-anadig"; + reg = <0x40050000 0x300>; + }; + + ccm@4006b000 { + compatible = "fsl,mvf600-ccm"; + reg = <0x4006b000 0x1000>; + }; + + mp_tmr@40002100 { + compatible = "arm,mpcore-timers"; + clock-frequency = <133000000>; + #address-cells = <1>; + #size-cells = <0>; + reg = < 0x40002200 0x100 >, /* Global Timer Registers */ + < 0x40002600 0x100 >; /* Private Timer Registers */ + interrupts = < 27 29 >; + interrupt-parent = < &GIC >; + }; + + pit@40037000 { + compatible = "fsl,mvf600-pit"; + reg = <0x40037000 0x1000>; + interrupts = < 71 >; + interrupt-parent = <&GIC>; + clock-frequency = < 24000000 >; + }; + + lptmr@40040000 { + compatible = "fsl,mvf600-lptmr"; + reg = <0x40040000 0x1000>; + interrupts = < 72 >; + interrupt-parent = <&GIC>; + clock-frequency = < 24000000 >; + }; + + iomuxc@40048000 { + compatible = "fsl,mvf600-iomuxc"; + reg = <0x40048000 0x1000>; + }; + + gpio@400FF000 { + compatible = "fsl,mvf600-gpio"; + reg = <0x400FF000 0x200>; + #gpio-cells = <3>; + gpio-controller; + interrupts = < 139 140 141 142 143 >; + interrupt-parent = <&GIC>; + + }; + + nand@400E0000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,mvf600-nand"; + reg = <0x400E0000 0x10000>; + interrupts = < 115 >; + interrupt-parent = <&GIC>; + + partition@40000 { + reg = <0x40000 0x200000>; /* 2MB */ + label = "u-boot"; + read-only; + }; + + partition@240000 { + reg = <0x240000 0x200000>; /* 2MB */ + label = "test"; + }; + + partition@440000 { + reg = <0x440000 0xa00000>; /* 10MB */ + label = "kernel"; + }; + + partition@e40000 { + reg = <0xe40000 0x1e000000>; /* 480MB */ + label = "root"; + }; + + }; + + sdhci0: sdhci@400B1000 { + compatible = "fsl,mvf600-sdhci"; + reg = <0x400B1000 0x1000>; + interrupts = < 59 >; + interrupt-parent = <&GIC>; + clock-frequency = <50000000>; + }; + + sdhci1: sdhci@400B2000 { + compatible = "fsl,mvf600-sdhci"; + reg = <0x400B2000 0x1000>; + interrupts = < 60 >; + interrupt-parent = <&GIC>; + clock-frequency = <50000000>; + }; + + serial0: serial@40027000 { + compatible = "fsl,mvf600-uart"; + reg = <0x40027000 0x1000>; + interrupts = <93>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + }; + + serial1: serial@40028000 { + compatible = "fsl,mvf600-uart"; + reg = <0x40028000 0x1000>; + interrupts = <94>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + }; + + usb@40034000 { + compatible = "fsl,mvf600-usb-ehci", "usb-ehci"; + reg = < 0x40034000 0x1000 >, /* ehci */ + < 0x40035000 0x1000 >, /* usbc */ + < 0x40050800 0x100 >; /* phy */ + interrupts = < 107 >; + interrupt-parent = <&GIC>; + }; + + usb@400b4000 { + compatible = "fsl,mvf600-usb-ehci", "usb-ehci"; + reg = < 0x400b4000 0x1000 >, /* ehci */ + < 0x400b5000 0x1000 >, /* usbc */ + < 0x40050C00 0x100 >; /* phy */ + interrupts = < 108 >; + interrupt-parent = <&GIC>; + }; + + fec0: ethernet@400D0000 { + compatible = "fsl,mvf600-fec"; + reg = <0x400D0000 0x1000>; + interrupts = < 110 >; + interrupt-parent = <&GIC>; + phy-mode = "rmii"; + phy-disable-preamble; + }; + + fec1: ethernet@400D1000 { + compatible = "fsl,mvf600-fec"; + reg = <0x400D1000 0x1000>; + interrupts = < 111 >; + interrupt-parent = <&GIC>; + phy-mode = "rmii"; + phy-disable-preamble; + }; + + }; +}; Modified: stable/10/sys/dev/uart/uart.h ============================================================================== --- stable/10/sys/dev/uart/uart.h Wed May 14 19:18:58 2014 (r266084) +++ stable/10/sys/dev/uart/uart.h Wed May 14 20:11:20 2014 (r266085) @@ -75,6 +75,7 @@ extern struct uart_class uart_lpc_class extern struct uart_class uart_pl011_class __attribute__((weak)); extern struct uart_class uart_cdnc_class __attribute__((weak)); extern struct uart_class uart_ti8250_class __attribute__((weak)); +extern struct uart_class uart_vybrid_class __attribute__((weak)); #ifdef FDT struct ofw_compat_data; Modified: stable/10/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_fdt.c Wed May 14 19:18:58 2014 (r266084) +++ stable/10/sys/dev/uart/uart_bus_fdt.c Wed May 14 20:11:20 2014 (r266085) @@ -80,6 +80,7 @@ static struct ofw_compat_data compat_dat {"fsl,imx27-uart", (uintptr_t)&uart_imx_class}, {"fsl,imx25-uart", (uintptr_t)&uart_imx_class}, {"fsl,imx21-uart", (uintptr_t)&uart_imx_class}, + {"fsl,mvf600-uart", (uintptr_t)&uart_vybrid_class}, {"lpc,uart", (uintptr_t)&uart_lpc_class}, {"ti,ns16550", (uintptr_t)&uart_ti8250_class}, {"ns16550", (uintptr_t)&uart_ns8250_class}, Copied: stable/10/sys/dev/usb/controller/dwc_otg_fdt.c (from r256839, head/sys/dev/usb/controller/dwc_otg_fdt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/usb/controller/dwc_otg_fdt.c Wed May 14 20:11:20 2014 (r266085, copy of r256839, head/sys/dev/usb/controller/dwc_otg_fdt.c) @@ -0,0 +1,211 @@ +/*- + * Copyright (c) 2012 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 20:17:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 77562864; Wed, 14 May 2014 20:17: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 6341B25F9; Wed, 14 May 2014 20:17: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 s4EKHeUA033414; Wed, 14 May 2014 20:17:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EKHVcQ033361; Wed, 14 May 2014 20:17:31 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405142017.s4EKHVcQ033361@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 20:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266086 - in stable/10/sys: arm/arm arm/conf arm/include boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 20:17:40 -0000 Author: ian Date: Wed May 14 20:17:31 2014 New Revision: 266086 URL: http://svnweb.freebsd.org/changeset/base/266086 Log: MFC r260440, r260441, r260447, r260490, r260493 Add option USB_HOST_ALIGN to configs that contain 'device usb'. Update dts files of Cubieboard1,2 to use 1GB memory. Add a function to print the contents of the static device mapping table, Modified: stable/10/sys/arm/arm/devmap.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/conf/AC100 stable/10/sys/arm/conf/ARMADAXP stable/10/sys/arm/conf/ARNDALE stable/10/sys/arm/conf/ATMEL stable/10/sys/arm/conf/AVILA stable/10/sys/arm/conf/BWCT stable/10/sys/arm/conf/CAMBRIA stable/10/sys/arm/conf/CNS11XXNAS stable/10/sys/arm/conf/COSMIC stable/10/sys/arm/conf/CUBIEBOARD stable/10/sys/arm/conf/CUBIEBOARD2 stable/10/sys/arm/conf/DB-78XXX stable/10/sys/arm/conf/DB-88F5XXX stable/10/sys/arm/conf/DB-88F6XXX stable/10/sys/arm/conf/DIGI-CCWMX53 stable/10/sys/arm/conf/EA3250 stable/10/sys/arm/conf/EB9200 stable/10/sys/arm/conf/EFIKA_MX stable/10/sys/arm/conf/ETHERNUT5 stable/10/sys/arm/conf/HL200 stable/10/sys/arm/conf/HL201 stable/10/sys/arm/conf/IMX53-QSB stable/10/sys/arm/conf/KB920X stable/10/sys/arm/conf/LN2410SBC stable/10/sys/arm/conf/NSLU stable/10/sys/arm/conf/PANDABOARD stable/10/sys/arm/conf/QILA9G20 stable/10/sys/arm/conf/RADXA stable/10/sys/arm/conf/RPI-B stable/10/sys/arm/conf/SAM9260EK stable/10/sys/arm/conf/SAM9G20EK stable/10/sys/arm/conf/SAM9X25EK stable/10/sys/arm/conf/SHEEVAPLUG stable/10/sys/arm/conf/SN9G45 stable/10/sys/arm/conf/TS7800 stable/10/sys/arm/conf/ZEDBOARD stable/10/sys/arm/include/devmap.h stable/10/sys/boot/fdt/dts/cubieboard.dts stable/10/sys/boot/fdt/dts/cubieboard2.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/devmap.c ============================================================================== --- stable/10/sys/arm/arm/devmap.c Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/arm/devmap.c Wed May 14 20:17:31 2014 (r266086) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); * Routines for mapping device memory. */ +#include "opt_ddb.h" + #include #include #include @@ -54,6 +56,36 @@ static u_int akva_devmap_idx; static vm_offset_t akva_devmap_vaddr = ARM_VECTORS_HIGH; /* + * Print the contents of the static mapping table using the provided printf-like + * output function (which will be either printf or db_printf). + */ +static void +devmap_dump_table(int (*prfunc)(const char *, ...)) +{ + const struct arm_devmap_entry *pd; + + if (devmap_table == NULL || devmap_table[0].pd_size == 0) { + prfunc("No static device mappings.\n"); + return; + } + + prfunc("Static device mappings:\n"); + for (pd = devmap_table; pd->pd_size != 0; ++pd) { + prfunc(" 0x%08x - 0x%08x mapped at VA 0x%08x\n", + pd->pd_pa, pd->pd_pa + pd->pd_size - 1, pd->pd_va); + } +} + +/* + * Print the contents of the static mapping table. Used for bootverbose. + */ +void +arm_devmap_print_table() +{ + devmap_dump_table(printf); +} + +/* * Return the "last" kva address used by the registered devmap table. It's * actually the lowest address used by the static mappings, i.e., the address of * the first unusable byte of KVA. @@ -266,3 +298,13 @@ pmap_unmapdev(vm_offset_t va, vm_size_t kva_free(va, origsize); } +#ifdef DDB +#include + +DB_SHOW_COMMAND(devmap, db_show_devmap) +{ + devmap_dump_table(db_printf); +} + +#endif /* DDB */ + Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/arm/machdep.c Wed May 14 20:17:31 2014 (r266086) @@ -379,10 +379,10 @@ cpu_startup(void *dummy) vm_paddr_t size; size = phys_avail[indx + 1] - phys_avail[indx]; - printf("%#08jx - %#08jx, %ju bytes (%ju pages)\n", + printf(" 0x%08jx - 0x%08jx, %ju KBytes (%ju pages)\n", (uintmax_t)phys_avail[indx], (uintmax_t)phys_avail[indx + 1] - 1, - (uintmax_t)size, (uintmax_t)size / PAGE_SIZE); + (uintmax_t)size / 1024, (uintmax_t)size / PAGE_SIZE); } } @@ -392,6 +392,9 @@ cpu_startup(void *dummy) (uintmax_t)ptoa(cnt.v_free_count), (uintmax_t)ptoa(cnt.v_free_count) / 1048576); + if (bootverbose) + arm_devmap_print_table(); + bufinit(); vm_pager_bufferinit(); pcb->un_32.pcb32_und_sp = (u_int)thread0.td_kstack + Modified: stable/10/sys/arm/conf/AC100 ============================================================================== --- stable/10/sys/arm/conf/AC100 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/AC100 Wed May 14 20:17:31 2014 (r266086) @@ -66,6 +66,7 @@ device loop device md # USB +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs #device usb #device ehci Modified: stable/10/sys/arm/conf/ARMADAXP ============================================================================== --- stable/10/sys/arm/conf/ARMADAXP Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/ARMADAXP Wed May 14 20:17:31 2014 (r266086) @@ -67,6 +67,7 @@ device loop device md # USB +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: stable/10/sys/arm/conf/ARNDALE ============================================================================== --- stable/10/sys/arm/conf/ARNDALE Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/ARNDALE Wed May 14 20:17:31 2014 (r266086) @@ -94,6 +94,7 @@ device md device gpio # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: stable/10/sys/arm/conf/ATMEL ============================================================================== --- stable/10/sys/arm/conf/ATMEL Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/ATMEL Wed May 14 20:17:31 2014 (r266086) @@ -157,6 +157,7 @@ device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/AVILA ============================================================================== --- stable/10/sys/arm/conf/AVILA Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/AVILA Wed May 14 20:17:31 2014 (r266086) @@ -143,6 +143,7 @@ device ath_ar9160 device ath_ar9280 device usb +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG device ohci device ehci Modified: stable/10/sys/arm/conf/BWCT ============================================================================== --- stable/10/sys/arm/conf/BWCT Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/BWCT Wed May 14 20:17:31 2014 (r266086) @@ -104,6 +104,7 @@ device spibus device bpf # Berkeley packet filter #options USB_DEBUG +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #device ohci #device usb #device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/CAMBRIA ============================================================================== --- stable/10/sys/arm/conf/CAMBRIA Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/CAMBRIA Wed May 14 20:17:31 2014 (r266086) @@ -136,6 +136,7 @@ options AH_SUPPORT_AR5416 # NB: for 11n device ath_hal # NB: 2 USB 2.0 ports standard +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order #options USB_DEBUG Modified: stable/10/sys/arm/conf/CNS11XXNAS ============================================================================== --- stable/10/sys/arm/conf/CNS11XXNAS Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/CNS11XXNAS Wed May 14 20:17:31 2014 (r266086) @@ -106,6 +106,7 @@ device random # Entrop #options ARM_USE_SMALL_ALLOC device usb +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG device ohci device ehci Modified: stable/10/sys/arm/conf/COSMIC ============================================================================== --- stable/10/sys/arm/conf/COSMIC Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/COSMIC Wed May 14 20:17:31 2014 (r266086) @@ -97,6 +97,7 @@ device md device gpio # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: stable/10/sys/arm/conf/CUBIEBOARD ============================================================================== --- stable/10/sys/arm/conf/CUBIEBOARD Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/CUBIEBOARD Wed May 14 20:17:31 2014 (r266086) @@ -106,6 +106,7 @@ device da # Direct Access (disks) device pass # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: stable/10/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- stable/10/sys/arm/conf/CUBIEBOARD2 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/CUBIEBOARD2 Wed May 14 20:17:31 2014 (r266086) @@ -106,6 +106,7 @@ device da # Direct Access (disks) device pass # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: stable/10/sys/arm/conf/DB-78XXX ============================================================================== --- stable/10/sys/arm/conf/DB-78XXX Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/DB-78XXX Wed May 14 20:17:31 2014 (r266086) @@ -67,6 +67,7 @@ device e1000phy device bpf # USB +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: stable/10/sys/arm/conf/DB-88F5XXX ============================================================================== --- stable/10/sys/arm/conf/DB-88F5XXX Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/DB-88F5XXX Wed May 14 20:17:31 2014 (r266086) @@ -73,6 +73,7 @@ device iicbus device ds133x # USB +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: stable/10/sys/arm/conf/DB-88F6XXX ============================================================================== --- stable/10/sys/arm/conf/DB-88F6XXX Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/DB-88F6XXX Wed May 14 20:17:31 2014 (r266086) @@ -71,6 +71,7 @@ device crypto device cryptodev # USB +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: stable/10/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- stable/10/sys/arm/conf/DIGI-CCWMX53 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/DIGI-CCWMX53 Wed May 14 20:17:31 2014 (r266086) @@ -134,6 +134,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/EA3250 ============================================================================== --- stable/10/sys/arm/conf/EA3250 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/EA3250 Wed May 14 20:17:31 2014 (r266086) @@ -65,6 +65,7 @@ device bpf device lpe # USB +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG device usb device ohci Modified: stable/10/sys/arm/conf/EB9200 ============================================================================== --- stable/10/sys/arm/conf/EB9200 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/EB9200 Wed May 14 20:17:31 2014 (r266086) @@ -92,6 +92,7 @@ device icee device bpf # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/EFIKA_MX ============================================================================== --- stable/10/sys/arm/conf/EFIKA_MX Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/EFIKA_MX Wed May 14 20:17:31 2014 (r266086) @@ -130,6 +130,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/ETHERNUT5 ============================================================================== --- stable/10/sys/arm/conf/ETHERNUT5 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/ETHERNUT5 Wed May 14 20:17:31 2014 (r266086) @@ -149,6 +149,7 @@ device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/HL200 ============================================================================== --- stable/10/sys/arm/conf/HL200 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/HL200 Wed May 14 20:17:31 2014 (r266086) @@ -94,6 +94,7 @@ device icee device bpf # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/HL201 ============================================================================== --- stable/10/sys/arm/conf/HL201 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/HL201 Wed May 14 20:17:31 2014 (r266086) @@ -96,6 +96,7 @@ device icee device bpf # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #device ohci # OHCI localbus->USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices Modified: stable/10/sys/arm/conf/IMX53-QSB ============================================================================== --- stable/10/sys/arm/conf/IMX53-QSB Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/IMX53-QSB Wed May 14 20:17:31 2014 (r266086) @@ -133,6 +133,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/KB920X ============================================================================== --- stable/10/sys/arm/conf/KB920X Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/KB920X Wed May 14 20:17:31 2014 (r266086) @@ -95,6 +95,7 @@ device icee device bpf # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/LN2410SBC ============================================================================== --- stable/10/sys/arm/conf/LN2410SBC Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/LN2410SBC Wed May 14 20:17:31 2014 (r266086) @@ -77,6 +77,7 @@ options WITNESS_SKIPSPIN #Don't run wit device md +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ohci Modified: stable/10/sys/arm/conf/NSLU ============================================================================== --- stable/10/sys/arm/conf/NSLU Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/NSLU Wed May 14 20:17:31 2014 (r266086) @@ -109,6 +109,7 @@ device random # Entropy device #options ARM_USE_SMALL_ALLOC device usb +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG device ohci device ehci Modified: stable/10/sys/arm/conf/PANDABOARD ============================================================================== --- stable/10/sys/arm/conf/PANDABOARD Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/PANDABOARD Wed May 14 20:17:31 2014 (r266086) @@ -112,6 +112,7 @@ device md device random # Entropy device # USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: stable/10/sys/arm/conf/QILA9G20 ============================================================================== --- stable/10/sys/arm/conf/QILA9G20 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/QILA9G20 Wed May 14 20:17:31 2014 (r266086) @@ -119,6 +119,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/RADXA ============================================================================== --- stable/10/sys/arm/conf/RADXA Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/RADXA Wed May 14 20:17:31 2014 (r266086) @@ -93,6 +93,7 @@ device da # Direct Access (disks) device pass # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: stable/10/sys/arm/conf/RPI-B ============================================================================== --- stable/10/sys/arm/conf/RPI-B Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/RPI-B Wed May 14 20:17:31 2014 (r266086) @@ -93,6 +93,7 @@ device md device random # Entropy device # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_DEBUG device dwcotg #DWC OTG controller Modified: stable/10/sys/arm/conf/SAM9260EK ============================================================================== --- stable/10/sys/arm/conf/SAM9260EK Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/SAM9260EK Wed May 14 20:17:31 2014 (r266086) @@ -157,6 +157,7 @@ device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/SAM9G20EK ============================================================================== --- stable/10/sys/arm/conf/SAM9G20EK Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/SAM9G20EK Wed May 14 20:17:31 2014 (r266086) @@ -119,6 +119,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/SAM9X25EK ============================================================================== --- stable/10/sys/arm/conf/SAM9X25EK Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/SAM9X25EK Wed May 14 20:17:31 2014 (r266086) @@ -121,6 +121,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #device ohci # OHCI localbus->USB interface #device usb # USB Bus (required) #device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/SHEEVAPLUG ============================================================================== --- stable/10/sys/arm/conf/SHEEVAPLUG Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/SHEEVAPLUG Wed May 14 20:17:31 2014 (r266086) @@ -65,6 +65,7 @@ device crypto device cryptodev # USB +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: stable/10/sys/arm/conf/SN9G45 ============================================================================== --- stable/10/sys/arm/conf/SN9G45 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/SN9G45 Wed May 14 20:17:31 2014 (r266086) @@ -97,6 +97,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/TS7800 ============================================================================== --- stable/10/sys/arm/conf/TS7800 Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/TS7800 Wed May 14 20:17:31 2014 (r266086) @@ -61,6 +61,7 @@ device bpf options HZ=1000 # USB +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb device ehci device umass Modified: stable/10/sys/arm/conf/ZEDBOARD ============================================================================== --- stable/10/sys/arm/conf/ZEDBOARD Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/conf/ZEDBOARD Wed May 14 20:17:31 2014 (r266086) @@ -81,6 +81,7 @@ device sdhci # generic sdhci device bpf # Berkeley packet filter # USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG Modified: stable/10/sys/arm/include/devmap.h ============================================================================== --- stable/10/sys/arm/include/devmap.h Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/arm/include/devmap.h Wed May 14 20:17:31 2014 (r266086) @@ -87,4 +87,7 @@ void arm_devmap_bootstrap(vm_offset_t _l void * arm_devmap_ptov(vm_paddr_t _pa, vm_size_t _sz); vm_paddr_t arm_devmap_vtop(void * _va, vm_size_t _sz); +/* Print the static mapping table; used for bootverbose output. */ +void arm_devmap_print_table(void); + #endif Modified: stable/10/sys/boot/fdt/dts/cubieboard.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/cubieboard.dts Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/boot/fdt/dts/cubieboard.dts Wed May 14 20:17:31 2014 (r266086) @@ -38,7 +38,7 @@ memory { device_type = "memory"; - reg = < 0x40000000 0x20000000 >; /* 512MB RAM */ + reg = < 0x40000000 0x40000000 >; /* 1GB RAM */ }; aliases { Modified: stable/10/sys/boot/fdt/dts/cubieboard2.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/cubieboard2.dts Wed May 14 20:11:20 2014 (r266085) +++ stable/10/sys/boot/fdt/dts/cubieboard2.dts Wed May 14 20:17:31 2014 (r266086) @@ -38,7 +38,7 @@ memory { device_type = "memory"; - reg = < 0x40000000 0x20000000 >; /* 512MB RAM */ + reg = < 0x40000000 0x40000000 >; /* 1GB RAM */ }; aliases { @@ -61,7 +61,7 @@ #interrupt-cells = <1>; }; - cpu-cfg@01c20000 { + cpu-cfg@01c25c00 { compatible = "allwinner,sun7i-cpu-cfg"; #address-cells = <1>; #size-cells = <1>; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 20:31:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C3C15BB8; Wed, 14 May 2014 20: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 AF7632785; Wed, 14 May 2014 20: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 s4EKVv5s040936; Wed, 14 May 2014 20:31:57 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EKVsgi040549; Wed, 14 May 2014 20:31:54 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405142031.s4EKVsgi040549@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 20:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266087 - in stable/10/sys: arm/at91 arm/conf dev/nand X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 20:31:58 -0000 Author: ian Date: Wed May 14 20:31:54 2014 New Revision: 266087 URL: http://svnweb.freebsd.org/changeset/base/266087 Log: MFC r260695, r260696, r260884, r260885, r260886, r260887 Provide a simplified way to specify GPIO pins for the Atmel port. Add at91 data so we can convert a PIO unit number into a base address. Add at91 standard memory controller helper functions. Generalize AT91 NAND support a bit. Connect NAND for the SAM9260EK eval board, as well as the HotE HL-201. Add nand device and NANDFS into the mix for those at91 boards that have support for it at the moment. Added: stable/10/sys/arm/at91/at91_gpio.h - copied unchanged from r260695, head/sys/arm/at91/at91_gpio.h stable/10/sys/arm/at91/at91_smc.c - copied unchanged from r260884, head/sys/arm/at91/at91_smc.c stable/10/sys/arm/at91/at91_smc.h - copied unchanged from r260884, head/sys/arm/at91/at91_smc.h stable/10/sys/dev/nand/nfc_at91.h - copied unchanged from r260885, head/sys/dev/nand/nfc_at91.h Modified: stable/10/sys/arm/at91/at91rm9200.c stable/10/sys/arm/at91/at91sam9260.c stable/10/sys/arm/at91/at91sam9g20.c stable/10/sys/arm/at91/at91sam9g45.c stable/10/sys/arm/at91/at91sam9x5.c stable/10/sys/arm/at91/at91var.h stable/10/sys/arm/at91/files.at91 stable/10/sys/arm/conf/ATMEL stable/10/sys/arm/conf/HL201 stable/10/sys/arm/conf/SAM9260EK stable/10/sys/dev/nand/nfc_at91.c Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/at91/at91_gpio.h (from r260695, head/sys/arm/at91/at91_gpio.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/at91/at91_gpio.h Wed May 14 20:31:54 2014 (r266087, copy of r260695, head/sys/arm/at91/at91_gpio.h) @@ -0,0 +1,296 @@ +/*- + * Copyright (c) 2014 M. Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef ARM_AT91_AT91_GPIO_H +#define ARM_AT91_AT91_GPIO_H + +typedef uint32_t at91_pin_t; + +#define AT91_PIN_NONE 0xfffffffful /* No pin / Not GPIO controlled */ + +/* + * Map Atmel PIO pins to a unique number. They are just numbered sequentially. + */ + +#define AT91_PIN_PA0 (at91_pin_t)0 +#define AT91_PIN_PA1 (at91_pin_t)1 +#define AT91_PIN_PA2 (at91_pin_t)2 +#define AT91_PIN_PA3 (at91_pin_t)3 +#define AT91_PIN_PA4 (at91_pin_t)4 +#define AT91_PIN_PA5 (at91_pin_t)5 +#define AT91_PIN_PA6 (at91_pin_t)6 +#define AT91_PIN_PA7 (at91_pin_t)7 +#define AT91_PIN_PA8 (at91_pin_t)8 +#define AT91_PIN_PA9 (at91_pin_t)9 +#define AT91_PIN_PA10 (at91_pin_t)10 +#define AT91_PIN_PA11 (at91_pin_t)11 +#define AT91_PIN_PA12 (at91_pin_t)12 +#define AT91_PIN_PA13 (at91_pin_t)13 +#define AT91_PIN_PA14 (at91_pin_t)14 +#define AT91_PIN_PA15 (at91_pin_t)15 +#define AT91_PIN_PA16 (at91_pin_t)16 +#define AT91_PIN_PA17 (at91_pin_t)17 +#define AT91_PIN_PA18 (at91_pin_t)18 +#define AT91_PIN_PA19 (at91_pin_t)19 +#define AT91_PIN_PA20 (at91_pin_t)20 +#define AT91_PIN_PA21 (at91_pin_t)21 +#define AT91_PIN_PA22 (at91_pin_t)22 +#define AT91_PIN_PA23 (at91_pin_t)23 +#define AT91_PIN_PA24 (at91_pin_t)24 +#define AT91_PIN_PA25 (at91_pin_t)25 +#define AT91_PIN_PA26 (at91_pin_t)26 +#define AT91_PIN_PA27 (at91_pin_t)27 +#define AT91_PIN_PA28 (at91_pin_t)28 +#define AT91_PIN_PA29 (at91_pin_t)29 +#define AT91_PIN_PA30 (at91_pin_t)30 +#define AT91_PIN_PA31 (at91_pin_t)31 +#define AT91_PIN_PB0 (at91_pin_t)32 +#define AT91_PIN_PB1 (at91_pin_t)33 +#define AT91_PIN_PB2 (at91_pin_t)34 +#define AT91_PIN_PB3 (at91_pin_t)35 +#define AT91_PIN_PB4 (at91_pin_t)36 +#define AT91_PIN_PB5 (at91_pin_t)37 +#define AT91_PIN_PB6 (at91_pin_t)38 +#define AT91_PIN_PB7 (at91_pin_t)39 +#define AT91_PIN_PB8 (at91_pin_t)40 +#define AT91_PIN_PB9 (at91_pin_t)41 +#define AT91_PIN_PB10 (at91_pin_t)42 +#define AT91_PIN_PB11 (at91_pin_t)43 +#define AT91_PIN_PB12 (at91_pin_t)44 +#define AT91_PIN_PB13 (at91_pin_t)45 +#define AT91_PIN_PB14 (at91_pin_t)46 +#define AT91_PIN_PB15 (at91_pin_t)47 +#define AT91_PIN_PB16 (at91_pin_t)48 +#define AT91_PIN_PB17 (at91_pin_t)49 +#define AT91_PIN_PB18 (at91_pin_t)50 +#define AT91_PIN_PB19 (at91_pin_t)51 +#define AT91_PIN_PB20 (at91_pin_t)52 +#define AT91_PIN_PB21 (at91_pin_t)53 +#define AT91_PIN_PB22 (at91_pin_t)54 +#define AT91_PIN_PB23 (at91_pin_t)55 +#define AT91_PIN_PB24 (at91_pin_t)56 +#define AT91_PIN_PB25 (at91_pin_t)57 +#define AT91_PIN_PB26 (at91_pin_t)58 +#define AT91_PIN_PB27 (at91_pin_t)59 +#define AT91_PIN_PB28 (at91_pin_t)60 +#define AT91_PIN_PB29 (at91_pin_t)61 +#define AT91_PIN_PB30 (at91_pin_t)62 +#define AT91_PIN_PB31 (at91_pin_t)63 +#define AT91_PIN_PC0 (at91_pin_t)64 +#define AT91_PIN_PC1 (at91_pin_t)65 +#define AT91_PIN_PC2 (at91_pin_t)66 +#define AT91_PIN_PC3 (at91_pin_t)67 +#define AT91_PIN_PC4 (at91_pin_t)68 +#define AT91_PIN_PC5 (at91_pin_t)69 +#define AT91_PIN_PC6 (at91_pin_t)70 +#define AT91_PIN_PC7 (at91_pin_t)71 +#define AT91_PIN_PC8 (at91_pin_t)72 +#define AT91_PIN_PC9 (at91_pin_t)73 +#define AT91_PIN_PC10 (at91_pin_t)74 +#define AT91_PIN_PC11 (at91_pin_t)75 +#define AT91_PIN_PC12 (at91_pin_t)76 +#define AT91_PIN_PC13 (at91_pin_t)77 +#define AT91_PIN_PC14 (at91_pin_t)78 +#define AT91_PIN_PC15 (at91_pin_t)79 +#define AT91_PIN_PC16 (at91_pin_t)80 +#define AT91_PIN_PC17 (at91_pin_t)81 +#define AT91_PIN_PC18 (at91_pin_t)82 +#define AT91_PIN_PC19 (at91_pin_t)83 +#define AT91_PIN_PC20 (at91_pin_t)84 +#define AT91_PIN_PC21 (at91_pin_t)85 +#define AT91_PIN_PC22 (at91_pin_t)86 +#define AT91_PIN_PC23 (at91_pin_t)87 +#define AT91_PIN_PC24 (at91_pin_t)88 +#define AT91_PIN_PC25 (at91_pin_t)89 +#define AT91_PIN_PC26 (at91_pin_t)90 +#define AT91_PIN_PC27 (at91_pin_t)91 +#define AT91_PIN_PC28 (at91_pin_t)92 +#define AT91_PIN_PC29 (at91_pin_t)93 +#define AT91_PIN_PC30 (at91_pin_t)94 +#define AT91_PIN_PC31 (at91_pin_t)95 +#define AT91_PIN_PD0 (at91_pin_t)96 +#define AT91_PIN_PD1 (at91_pin_t)97 +#define AT91_PIN_PD2 (at91_pin_t)98 +#define AT91_PIN_PD3 (at91_pin_t)99 +#define AT91_PIN_PD4 (at91_pin_t)100 +#define AT91_PIN_PD5 (at91_pin_t)101 +#define AT91_PIN_PD6 (at91_pin_t)102 +#define AT91_PIN_PD7 (at91_pin_t)103 +#define AT91_PIN_PD8 (at91_pin_t)104 +#define AT91_PIN_PD9 (at91_pin_t)105 +#define AT91_PIN_PD10 (at91_pin_t)106 +#define AT91_PIN_PD11 (at91_pin_t)107 +#define AT91_PIN_PD12 (at91_pin_t)108 +#define AT91_PIN_PD13 (at91_pin_t)109 +#define AT91_PIN_PD14 (at91_pin_t)110 +#define AT91_PIN_PD15 (at91_pin_t)111 +#define AT91_PIN_PD16 (at91_pin_t)112 +#define AT91_PIN_PD17 (at91_pin_t)113 +#define AT91_PIN_PD18 (at91_pin_t)114 +#define AT91_PIN_PD19 (at91_pin_t)115 +#define AT91_PIN_PD20 (at91_pin_t)116 +#define AT91_PIN_PD21 (at91_pin_t)117 +#define AT91_PIN_PD22 (at91_pin_t)118 +#define AT91_PIN_PD23 (at91_pin_t)119 +#define AT91_PIN_PD24 (at91_pin_t)120 +#define AT91_PIN_PD25 (at91_pin_t)121 +#define AT91_PIN_PD26 (at91_pin_t)122 +#define AT91_PIN_PD27 (at91_pin_t)123 +#define AT91_PIN_PD28 (at91_pin_t)124 +#define AT91_PIN_PD29 (at91_pin_t)125 +#define AT91_PIN_PD30 (at91_pin_t)126 +#define AT91_PIN_PD31 (at91_pin_t)127 +#define AT91_PIN_PE0 (at91_pin_t)128 +#define AT91_PIN_PE1 (at91_pin_t)129 +#define AT91_PIN_PE2 (at91_pin_t)130 +#define AT91_PIN_PE3 (at91_pin_t)131 +#define AT91_PIN_PE4 (at91_pin_t)132 +#define AT91_PIN_PE5 (at91_pin_t)133 +#define AT91_PIN_PE6 (at91_pin_t)134 +#define AT91_PIN_PE7 (at91_pin_t)135 +#define AT91_PIN_PE8 (at91_pin_t)136 +#define AT91_PIN_PE9 (at91_pin_t)137 +#define AT91_PIN_PE10 (at91_pin_t)138 +#define AT91_PIN_PE11 (at91_pin_t)139 +#define AT91_PIN_PE12 (at91_pin_t)140 +#define AT91_PIN_PE13 (at91_pin_t)141 +#define AT91_PIN_PE14 (at91_pin_t)142 +#define AT91_PIN_PE15 (at91_pin_t)143 +#define AT91_PIN_PE16 (at91_pin_t)144 +#define AT91_PIN_PE17 (at91_pin_t)145 +#define AT91_PIN_PE18 (at91_pin_t)146 +#define AT91_PIN_PE19 (at91_pin_t)147 +#define AT91_PIN_PE20 (at91_pin_t)148 +#define AT91_PIN_PE21 (at91_pin_t)149 +#define AT91_PIN_PE22 (at91_pin_t)150 +#define AT91_PIN_PE23 (at91_pin_t)151 +#define AT91_PIN_PE24 (at91_pin_t)152 +#define AT91_PIN_PE25 (at91_pin_t)153 +#define AT91_PIN_PE26 (at91_pin_t)154 +#define AT91_PIN_PE27 (at91_pin_t)155 +#define AT91_PIN_PE28 (at91_pin_t)156 +#define AT91_PIN_PE29 (at91_pin_t)157 +#define AT91_PIN_PE30 (at91_pin_t)158 +#define AT91_PIN_PE31 (at91_pin_t)159 +#define AT91_PIN_PF0 (at91_pin_t)160 +#define AT91_PIN_PF1 (at91_pin_t)161 +#define AT91_PIN_PF2 (at91_pin_t)162 +#define AT91_PIN_PF3 (at91_pin_t)163 +#define AT91_PIN_PF4 (at91_pin_t)164 +#define AT91_PIN_PF5 (at91_pin_t)165 +#define AT91_PIN_PF6 (at91_pin_t)166 +#define AT91_PIN_PF7 (at91_pin_t)167 +#define AT91_PIN_PF8 (at91_pin_t)168 +#define AT91_PIN_PF9 (at91_pin_t)169 +#define AT91_PIN_PF10 (at91_pin_t)170 +#define AT91_PIN_PF11 (at91_pin_t)171 +#define AT91_PIN_PF12 (at91_pin_t)172 +#define AT91_PIN_PF13 (at91_pin_t)173 +#define AT91_PIN_PF14 (at91_pin_t)174 +#define AT91_PIN_PF15 (at91_pin_t)175 +#define AT91_PIN_PF16 (at91_pin_t)176 +#define AT91_PIN_PF17 (at91_pin_t)177 +#define AT91_PIN_PF18 (at91_pin_t)178 +#define AT91_PIN_PF19 (at91_pin_t)179 +#define AT91_PIN_PF20 (at91_pin_t)180 +#define AT91_PIN_PF21 (at91_pin_t)181 +#define AT91_PIN_PF22 (at91_pin_t)182 +#define AT91_PIN_PF23 (at91_pin_t)183 +#define AT91_PIN_PF24 (at91_pin_t)184 +#define AT91_PIN_PF25 (at91_pin_t)185 +#define AT91_PIN_PF26 (at91_pin_t)186 +#define AT91_PIN_PF27 (at91_pin_t)187 +#define AT91_PIN_PF28 (at91_pin_t)188 +#define AT91_PIN_PF29 (at91_pin_t)189 +#define AT91_PIN_PF30 (at91_pin_t)190 +#define AT91_PIN_PF31 (at91_pin_t)191 +#define AT91_PIN_PG0 (at91_pin_t)192 +#define AT91_PIN_PG1 (at91_pin_t)193 +#define AT91_PIN_PG2 (at91_pin_t)194 +#define AT91_PIN_PG3 (at91_pin_t)195 +#define AT91_PIN_PG4 (at91_pin_t)196 +#define AT91_PIN_PG5 (at91_pin_t)197 +#define AT91_PIN_PG6 (at91_pin_t)198 +#define AT91_PIN_PG7 (at91_pin_t)199 +#define AT91_PIN_PG8 (at91_pin_t)200 +#define AT91_PIN_PG9 (at91_pin_t)201 +#define AT91_PIN_PG10 (at91_pin_t)202 +#define AT91_PIN_PG11 (at91_pin_t)203 +#define AT91_PIN_PG12 (at91_pin_t)204 +#define AT91_PIN_PG13 (at91_pin_t)205 +#define AT91_PIN_PG14 (at91_pin_t)206 +#define AT91_PIN_PG15 (at91_pin_t)207 +#define AT91_PIN_PG16 (at91_pin_t)208 +#define AT91_PIN_PG17 (at91_pin_t)209 +#define AT91_PIN_PG18 (at91_pin_t)210 +#define AT91_PIN_PG19 (at91_pin_t)211 +#define AT91_PIN_PG20 (at91_pin_t)212 +#define AT91_PIN_PG21 (at91_pin_t)213 +#define AT91_PIN_PG22 (at91_pin_t)214 +#define AT91_PIN_PG23 (at91_pin_t)215 +#define AT91_PIN_PG24 (at91_pin_t)216 +#define AT91_PIN_PG25 (at91_pin_t)217 +#define AT91_PIN_PG26 (at91_pin_t)218 +#define AT91_PIN_PG27 (at91_pin_t)219 +#define AT91_PIN_PG28 (at91_pin_t)220 +#define AT91_PIN_PG29 (at91_pin_t)221 +#define AT91_PIN_PG30 (at91_pin_t)222 +#define AT91_PIN_PG31 (at91_pin_t)223 +#define AT91_PIN_PH0 (at91_pin_t)224 +#define AT91_PIN_PH1 (at91_pin_t)225 +#define AT91_PIN_PH2 (at91_pin_t)226 +#define AT91_PIN_PH3 (at91_pin_t)227 +#define AT91_PIN_PH4 (at91_pin_t)228 +#define AT91_PIN_PH5 (at91_pin_t)229 +#define AT91_PIN_PH6 (at91_pin_t)230 +#define AT91_PIN_PH7 (at91_pin_t)231 +#define AT91_PIN_PH8 (at91_pin_t)232 +#define AT91_PIN_PH9 (at91_pin_t)233 +#define AT91_PIN_PH10 (at91_pin_t)234 +#define AT91_PIN_PH11 (at91_pin_t)235 +#define AT91_PIN_PH12 (at91_pin_t)236 +#define AT91_PIN_PH13 (at91_pin_t)237 +#define AT91_PIN_PH14 (at91_pin_t)238 +#define AT91_PIN_PH15 (at91_pin_t)239 +#define AT91_PIN_PH16 (at91_pin_t)240 +#define AT91_PIN_PH17 (at91_pin_t)241 +#define AT91_PIN_PH18 (at91_pin_t)242 +#define AT91_PIN_PH19 (at91_pin_t)243 +#define AT91_PIN_PH20 (at91_pin_t)244 +#define AT91_PIN_PH21 (at91_pin_t)245 +#define AT91_PIN_PH22 (at91_pin_t)246 +#define AT91_PIN_PH23 (at91_pin_t)247 +#define AT91_PIN_PH24 (at91_pin_t)248 +#define AT91_PIN_PH25 (at91_pin_t)249 +#define AT91_PIN_PH26 (at91_pin_t)250 +#define AT91_PIN_PH27 (at91_pin_t)251 +#define AT91_PIN_PH28 (at91_pin_t)252 +#define AT91_PIN_PH29 (at91_pin_t)253 +#define AT91_PIN_PH30 (at91_pin_t)254 +#define AT91_PIN_PH31 (at91_pin_t)255 + +#endif /* ARM_AT91_AT91_GPIO_H */ Copied: stable/10/sys/arm/at91/at91_smc.c (from r260884, head/sys/arm/at91/at91_smc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/at91/at91_smc.c Wed May 14 20:31:54 2014 (r266087, copy of r260884, head/sys/arm/at91/at91_smc.c) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2014 M. Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include + +/* + * RD4HW()/WR4HW() read and write at91 hardware register space directly. They + * serve the same purpose as the RD4()/WR4() idiom you see in many drivers, + * except that those translate to bus_space calls, but in this code we need to + * access some devices before bus_space is ready to use. Of course for this to + * work the appropriate static device mappings need to be made in machdep.c. + */ +static inline uint32_t +RD4HW(uint32_t devbase, uint32_t regoff) +{ + + return *(volatile uint32_t *)(AT91_BASE + devbase + regoff); +} + + +static inline void +WR4HW(uint32_t devbase, uint32_t regoff, uint32_t val) +{ + + *(volatile uint32_t *)(AT91_BASE + devbase + regoff) = val; +} + + +void +at91_smc_setup(int id, int cs, const struct at91_smc_init *smc) +{ + // Need a generic way to get this address for all SoCs... Assume 9260 for now... + uint32_t base = AT91SAM9260_SMC_BASE + SMC_CS_OFF(cs); + + WR4HW(base, SMC_SETUP, SMC_SETUP_NCS_RD_SETUP(smc->ncs_rd_setup) | + SMC_SETUP_NRD_SETUP(smc->nrd_setup) | + SMC_SETUP_NCS_WR_SETUP(smc->ncs_wr_setup) | + SMC_SETUP_NWE_SETUP(smc->nwe_setup)); + WR4HW(base, SMC_PULSE, SMC_PULSE_NCS_RD_PULSE(smc->ncs_rd_pulse) | + SMC_PULSE_NRD_PULSE(smc->nrd_pulse) | + SMC_PULSE_NCS_WR_PULSE(smc->ncs_wr_pulse) | + SMC_PULSE_NWE_PULSE(smc->nwe_pulse)); + WR4HW(base, SMC_CYCLE, SMC_CYCLE_NRD_CYCLE(smc->nrd_cycle) | + SMC_CYCLE_NWE_CYCLE(smc->nwe_cycle)); + WR4HW(base, SMC_MODE, smc->mode | SMC_MODE_TDF_CYCLES(smc->tdf_cycles)); +} + +void +at91_ebi_enable(int bank) +{ + + WR4HW(AT91SAM9260_MATRIX_BASE, AT91SAM9260_EBICSA, (1 << bank) | + RD4HW(AT91SAM9260_MATRIX_BASE, AT91SAM9260_EBICSA)); +} + +void +at91_ebi_disable(int bank) +{ + + WR4HW(AT91SAM9260_MATRIX_BASE, AT91SAM9260_EBICSA, ~(1 << bank) & + RD4HW(AT91SAM9260_MATRIX_BASE, AT91SAM9260_EBICSA)); +} Copied: stable/10/sys/arm/at91/at91_smc.h (from r260884, head/sys/arm/at91/at91_smc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/at91/at91_smc.h Wed May 14 20:31:54 2014 (r266087, copy of r260884, head/sys/arm/at91/at91_smc.h) @@ -0,0 +1,116 @@ +/*- + * Copyright (c) 2014 M. Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef ARM_AT91_AT91_SMC_H +#define ARM_AT91_AT91_SMC_H + +/* Registers */ +#define SMC_SETUP 0x00 +#define SMC_PULSE 0x04 +#define SMC_CYCLE 0x08 +#define SMC_MODE 0x0C + +#define SMC_CS_OFF(cs) (0x10 * (cs)) + +/* Setup */ +#define SMC_SETUP_NCS_RD_SETUP(x) ((x) << 24) +#define SMC_SETUP_NRD_SETUP(x) ((x) << 16) +#define SMC_SETUP_NCS_WR_SETUP(x) ((x) << 8) +#define SMC_SETUP_NWE_SETUP(x) (x) + +/* Pulse */ +#define SMC_PULSE_NCS_RD_PULSE(x) ((x) << 24) +#define SMC_PULSE_NRD_PULSE(x) ((x) << 16) +#define SMC_PULSE_NCS_WR_PULSE(x) ((x) << 8) +#define SMC_PULSE_NWE_PULSE(x) (x) + +/* Cycle */ +#define SMC_CYCLE_NRD_CYCLE(x) ((x) << 16) +#define SMC_CYCLE_NWE_CYCLE(x) (x) + +/* Mode */ +#define SMC_MODE_READ (1 << 0) +#define SMC_MODE_WRITE (1 << 1) +#define SMC_MODE_EXNW_DISABLED (0 << 4) +#define SMC_MODE_EXNW_FROZEN_MODE (2 << 4) +#define SMC_MODE_EXNW_READY_MODE (3 << 4) +#define SMC_MODE_BAT (1 << 8) +#define SMC_MODE_DBW_8BIT (0 << 12) +#define SMC_MODE_DBW_16BIT (1 << 12) +#define SMC_MODE_DBW_32_BIT (2 << 12) +#define SMC_MODE_TDF_CYCLES(x) ((x) << 16) +#define SMC_MODE_TDF_MODE (1 << 20) +#define SMC_MODE_PMEN (1 << 24) +#define SMC_PS_4BYTE (0 << 28) +#define SMC_PS_8BYTE (1 << 28) +#define SMC_PS_16BYTE (2 << 28) +#define SMC_PS_32BYTE (3 << 28) + +/* + * structure to ease init. See the SMC chapter in the datasheet for + * the appropriate SoC you are using for details. + */ +struct at91_smc_init +{ + /* Setup register */ + uint8_t ncs_rd_setup; + uint8_t nrd_setup; + uint8_t ncs_wr_setup; + uint8_t nwe_setup; + + /* Pulse register */ + uint8_t ncs_rd_pulse; + uint8_t nrd_pulse; + uint8_t ncs_wr_pulse; + uint8_t nwe_pulse; + + /* Cycle register */ + uint16_t nrd_cycle; + uint16_t nwe_cycle; + + /* Mode register */ + uint8_t mode; /* Combo of READ/WRITE/EXNW fields */ + uint8_t bat; + uint8_t dwb; + uint8_t tdf_cycles; + uint8_t tdf_mode; + uint8_t pmen; + uint8_t ps; +}; + +/* + * Convenience routine to fill in SMC registers for a given chip select. + */ +void at91_smc_setup(int id, int cs, const struct at91_smc_init *smc); + +/* + * Disable/Enable different External Bus Interfaces (EBI) + */ +void at91_ebi_enable(int cs); +void at91_ebi_disable(int cs); + +#endif /* ARM_AT91_AT91_SMC_H */ Modified: stable/10/sys/arm/at91/at91rm9200.c ============================================================================== --- stable/10/sys/arm/at91/at91rm9200.c Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/arm/at91/at91rm9200.c Wed May 14 20:31:54 2014 (r266087) @@ -88,6 +88,13 @@ static const int at91_irq_prio[32] = 0 /* Advanced Interrupt Controller (IRQ6) */ }; +static const uint32_t at91_pio_base[] = { + AT91RM92_PIOA_BASE, + AT91RM92_PIOB_BASE, + AT91RM92_PIOC_BASE, + AT91RM92_PIOD_BASE, +}; + #define DEVICE(_name, _id, _unit) \ { \ _name, _unit, \ @@ -195,6 +202,8 @@ static struct at91_soc_data soc_data = { .soc_clock_init = at91_clock_init, .soc_irq_prio = at91_irq_prio, .soc_children = at91_devs, + .soc_pio_base = at91_pio_base, + .soc_pio_count = nitems(at91_pio_base), }; AT91_SOC(AT91_T_RM9200, &soc_data); Modified: stable/10/sys/arm/at91/at91sam9260.c ============================================================================== --- stable/10/sys/arm/at91/at91sam9260.c Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/arm/at91/at91sam9260.c Wed May 14 20:31:54 2014 (r266087) @@ -87,6 +87,12 @@ static const int at91_irq_prio[32] = 0, /* Advanced Interrupt Controller IRQ2 */ }; +static const uint32_t at91_pio_base[] = { + AT91SAM9260_PIOA_BASE, + AT91SAM9260_PIOB_BASE, + AT91SAM9260_PIOC_BASE, +}; + #define DEVICE(_name, _id, _unit) \ { \ _name, _unit, \ @@ -204,6 +210,8 @@ static struct at91_soc_data soc_data = { .soc_clock_init = at91_clock_init, .soc_irq_prio = at91_irq_prio, .soc_children = at91_devs, + .soc_pio_base = at91_pio_base, + .soc_pio_count = nitems(at91_pio_base), }; AT91_SOC(AT91_T_SAM9260, &soc_data); Modified: stable/10/sys/arm/at91/at91sam9g20.c ============================================================================== --- stable/10/sys/arm/at91/at91sam9g20.c Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/arm/at91/at91sam9g20.c Wed May 14 20:31:54 2014 (r266087) @@ -87,6 +87,12 @@ static const int at91_irq_prio[32] = 0, /* Advanced Interrupt Controller IRQ2 */ }; +static const uint32_t at91_pio_base[] = { + AT91SAM9G20_PIOA_BASE, + AT91SAM9G20_PIOB_BASE, + AT91SAM9G20_PIOC_BASE, +}; + #define DEVICE(_name, _id, _unit) \ { \ _name, _unit, \ @@ -169,6 +175,8 @@ static struct at91_soc_data soc_data = { .soc_clock_init = at91_clock_init, .soc_irq_prio = at91_irq_prio, .soc_children = at91_devs, + .soc_pio_base = at91_pio_base, + .soc_pio_count = nitems(at91_pio_base), }; AT91_SOC(AT91_T_SAM9G20, &soc_data); Modified: stable/10/sys/arm/at91/at91sam9g45.c ============================================================================== --- stable/10/sys/arm/at91/at91sam9g45.c Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/arm/at91/at91sam9g45.c Wed May 14 20:31:54 2014 (r266087) @@ -88,6 +88,14 @@ static const int at91_irq_prio[32] = 0, /* Advanced Interrupt Controller IRQ0 */ }; +static const uint32_t at91_pio_base[] = { + AT91SAM9G45_PIOA_BASE, + AT91SAM9G45_PIOB_BASE, + AT91SAM9G45_PIOC_BASE, + AT91SAM9G45_PIOD_BASE, + AT91SAM9G45_PIOE_BASE, +}; + #define DEVICE(_name, _id, _unit) \ { \ _name, _unit, \ @@ -155,6 +163,8 @@ static struct at91_soc_data soc_data = { .soc_clock_init = at91_clock_init, .soc_irq_prio = at91_irq_prio, .soc_children = at91_devs, + .soc_pio_base = at91_pio_base, + .soc_pio_count = nitems(at91_pio_base), }; AT91_SOC(AT91_T_SAM9G45, &soc_data); Modified: stable/10/sys/arm/at91/at91sam9x5.c ============================================================================== --- stable/10/sys/arm/at91/at91sam9x5.c Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/arm/at91/at91sam9x5.c Wed May 14 20:31:54 2014 (r266087) @@ -87,6 +87,13 @@ static const int at91_irq_prio[32] = 0, /* Advanced Interrupt Controller (IRQ0) */ }; +static const uint32_t at91_pio_base[] = { + AT91SAM9X25_PIOA_BASE, + AT91SAM9X25_PIOB_BASE, + AT91SAM9X25_PIOC_BASE, + AT91SAM9X25_PIOD_BASE, +}; + #define DEVICE(_name, _id, _unit) \ { \ _name, _unit, \ @@ -172,6 +179,8 @@ static struct at91_soc_data soc_data = { .soc_clock_init = at91_clock_init, .soc_irq_prio = at91_irq_prio, .soc_children = at91_devs, + .soc_pio_base = at91_pio_base, + .soc_pio_count = nitems(at91_pio_base), }; AT91_SOC_SUB(AT91_T_SAM9X5, AT91_ST_SAM9X25, &soc_data); Modified: stable/10/sys/arm/at91/at91var.h ============================================================================== --- stable/10/sys/arm/at91/at91var.h Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/arm/at91/at91var.h Wed May 14 20:31:54 2014 (r266087) @@ -107,11 +107,13 @@ typedef void (*cpu_reset_t)(void); typedef void (*clk_init_t)(void); struct at91_soc_data { - DELAY_t soc_delay; - cpu_reset_t soc_reset; - clk_init_t soc_clock_init; - const int *soc_irq_prio; - const struct cpu_devs *soc_children; + DELAY_t soc_delay; /* SoC specific delay function */ + cpu_reset_t soc_reset; /* SoC specific reset function */ + clk_init_t soc_clock_init; /* SoC specific clock init function */ + const int *soc_irq_prio; /* SoC specific IRQ priorities */ + const struct cpu_devs *soc_children; /* SoC specific children list */ + const uint32_t *soc_pio_base; /* SoC specific PIO base registers */ + size_t soc_pio_count; /* Count of PIO units (not pins) in SoC */ }; struct at91_soc_info { Modified: stable/10/sys/arm/at91/files.at91 ============================================================================== --- stable/10/sys/arm/at91/files.at91 Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/arm/at91/files.at91 Wed May 14 20:31:54 2014 (r266087) @@ -12,6 +12,7 @@ arm/at91/at91_pit.c optional at91sam9 arm/at91/at91_reset.S optional at91sam9 arm/at91/at91_rst.c optional at91sam9 arm/at91/at91_rtc.c optional at91_rtc +arm/at91/at91_smc.c standard arm/at91/at91_spi.c optional at91_spi \ dependency "spibus_if.h" arm/at91/at91_ssc.c optional at91_ssc Modified: stable/10/sys/arm/conf/ATMEL ============================================================================== --- stable/10/sys/arm/conf/ATMEL Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/arm/conf/ATMEL Wed May 14 20:31:54 2014 (r266087) @@ -175,3 +175,6 @@ device at91_wdt # Atmel AT91 Watchdog T device at91_rtc device at91_ssc #device at91_tc # missing? + +# NAND Flash - Reference design has Samsung 256MB but others possible +device nand # NAND interface on CS3 Modified: stable/10/sys/arm/conf/HL201 ============================================================================== --- stable/10/sys/arm/conf/HL201 Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/arm/conf/HL201 Wed May 14 20:31:54 2014 (r266087) @@ -37,7 +37,8 @@ options FFS #Berkeley Fast Filesystem #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device -#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options MD_ROOT_SIZE=4096 # 4MB ram disk +options NANDFS # NAND file system #options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options NFSCL #New Network Filesystem Client #options NFSD #New Network Filesystem Server @@ -131,3 +132,5 @@ device pass # Passthrough device (dire #device wlan_amrr # AMRR transmit rate control algorithm options ROOTDEVNAME=\"ufs:da0s1a\" +# NAND Flash - my board as 128MB Samsung part +device nand # NAND interface on CS3 Modified: stable/10/sys/arm/conf/SAM9260EK ============================================================================== --- stable/10/sys/arm/conf/SAM9260EK Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/arm/conf/SAM9260EK Wed May 14 20:31:54 2014 (r266087) @@ -1,4 +1,4 @@ -# Kernel configuration for Ethernut 5 boards +# Kernel configuration for Atmel SAM9260-EK eval board # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -37,6 +37,7 @@ options SOFTUPDATES # Enable FFS soft options UFS_DIRHASH # Improve performance on big directories #options UFS_GJOURNAL # Enable gjournal-based UFS journaling #options MD_ROOT # MD is a potential root device +options NANDFS # NAND file system options NFSCL # New Network Filesystem Client #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager @@ -165,3 +166,6 @@ device umass # Disks/Mass storage - Re # watchdog device at91_wdt # Atmel AT91 Watchdog Timer + +# NAND Flash - Reference design has Samsung 256MB but others possible +device nand # NAND interface on CS3 Modified: stable/10/sys/dev/nand/nfc_at91.c ============================================================================== --- stable/10/sys/dev/nand/nfc_at91.c Wed May 14 20:17:31 2014 (r266086) +++ stable/10/sys/dev/nand/nfc_at91.c Wed May 14 20:31:54 2014 (r266087) @@ -54,23 +54,29 @@ __FBSDID("$FreeBSD$"); #include #include "nfc_if.h" +#include +#include + /* * Data cycles are triggered by access to any address within the EBI CS3 region * that has A21 and A22 clear. Command cycles are any access with bit A21 - * asserted. Address cycles are any access with bit A22 asserted. - * - * XXX The atmel docs say that any address bits can be used instead of A21 and - * A22; these values should be configurable. + * asserted. Address cycles are any access with bit A22 asserted. Or vice versa. + * We get these parameters from the nand_param that the board is required to + * call at91_enable_nand, and enable the GPIO lines properly (that will be moved + * into at91_enable_nand when the great GPIO pin renumbering happens). We use + * ale (Address Latch Enable) and cle (Comand Latch Enable) to match the hardware + * names used in NAND. */ #define AT91_NAND_DATA 0 -#define AT91_NAND_COMMAND (1 << 21) -#define AT91_NAND_ADDRESS (1 << 22) struct at91_nand_softc { struct nand_softc nand_sc; struct resource *res; + struct at91_nand_params *nand_param; }; +static struct at91_nand_params nand_param; + static int at91_nand_attach(device_t); static int at91_nand_probe(device_t); static uint8_t at91_nand_read_byte(device_t); @@ -81,6 +87,12 @@ static int at91_nand_send_command(device static int at91_nand_send_address(device_t, uint8_t); static void at91_nand_write_buf(device_t, void *, uint32_t); +void +at91_enable_nand(const struct at91_nand_params *np) +{ + nand_param = *np; +} + static inline u_int8_t dev_read_1(struct at91_nand_softc *sc, bus_size_t offset) { @@ -108,6 +120,14 @@ at91_nand_attach(device_t dev) int err, rid; sc = device_get_softc(dev); + sc->nand_param = &nand_param; + if (sc->nand_param->width != 8 && sc->nand_param->width != 16) { + device_printf(dev, "Bad bus width (%d) defaulting to 8 bits\n", + sc->nand_param->width); + sc->nand_param->width = 8; + } + at91_ebi_enable(sc->nand_param->cs); + rid = 0; sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -128,10 +148,10 @@ at91_nand_send_command(device_t dev, uin { struct at91_nand_softc *sc; - /* nand_debug(NDBG_DRV,"at91_nand_send_command: 0x%02x", command); */ + nand_debug(NDBG_DRV,"at91_nand_send_command: 0x%02x", command); sc = device_get_softc(dev); - dev_write_1(sc, AT91_NAND_COMMAND, command); + dev_write_1(sc, sc->nand_param->cle, command); return (0); } @@ -140,10 +160,10 @@ at91_nand_send_address(device_t dev, uin { struct at91_nand_softc *sc; - /* nand_debug(NDBG_DRV,"at91_nand_send_address: x%02x", addr); */ + nand_debug(NDBG_DRV,"at91_nand_send_address: x%02x", addr); sc = device_get_softc(dev); - dev_write_1(sc, AT91_NAND_ADDRESS, addr); + dev_write_1(sc, sc->nand_param->ale, addr); return (0); } @@ -156,7 +176,7 @@ at91_nand_read_byte(device_t dev) sc = device_get_softc(dev); data = dev_read_1(sc, AT91_NAND_DATA); - /* nand_debug(NDBG_DRV,"at91_nand_read_byte: 0x%02x", data); */ + nand_debug(NDBG_DRV,"at91_nand_read_byte: 0x%02x", data); return (data); } Copied: stable/10/sys/dev/nand/nfc_at91.h (from r260885, head/sys/dev/nand/nfc_at91.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/nand/nfc_at91.h Wed May 14 20:31:54 2014 (r266087, copy of r260885, head/sys/dev/nand/nfc_at91.h) @@ -0,0 +1,50 @@ +/*- + * Copyright (C) 2014 Warner Losh. + * 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$ + */ + +/* + * Atmel at91-family integrated NAND controller driver. + * + * Interface to board setup code to set parameters. + */ + +#ifndef DEV_NAND_NFC_AT91_H +#define DEV_NAND_NFC_AT91_H 1 + +struct at91_nand_params +{ + uint32_t ale; /* Address for ALE (address) NAND cycles */ + uint32_t cle; /* Address for CLE (command) NAND cycles */ + uint32_t width; /* 8 or 16 bits (specify in bits) */ + uint32_t cs; /* Chip Select NAND is connected to */ + uint32_t rnb_pin; /* GPIO pin # for Read/notBusy */ + uint32_t nce_pin; /* GPIO pin # for CE (active low) */ +}; + +void at91_enable_nand(const struct at91_nand_params *); + +#endif /* DEV_NAND_NFC_AT91_H */ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 20:38:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 223BCE90; Wed, 14 May 2014 20: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 0F24427C8; Wed, 14 May 2014 20: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 s4EKc50t042345; Wed, 14 May 2014 20:38:05 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EKc5so042343; Wed, 14 May 2014 20:38:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405142038.s4EKc5so042343@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 20:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266088 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 20:38:06 -0000 Author: ian Date: Wed May 14 20:38:05 2014 New Revision: 266088 URL: http://svnweb.freebsd.org/changeset/base/266088 Log: MFC r259728, r260752 Add Freescale i.MX515 vt(9) driver. Added: stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c - copied, changed from r259728, head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Modified: stable/10/sys/arm/freescale/imx/files.imx51 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/files.imx51 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx51 Wed May 14 20:31:54 2014 (r266087) +++ stable/10/sys/arm/freescale/imx/files.imx51 Wed May 14 20:38:05 2014 (r266088) @@ -50,4 +50,5 @@ dev/ofw/ofw_iicbus.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc - +arm/freescale/imx/imx51_ipuv3_fbd.c optional vt +dev/vt/hw/fb/vt_early_fb.c optional vt Copied and modified: stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c (from r259728, head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c) ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Sun Dec 22 16:09:29 2013 (r259728, copy source) +++ stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Wed May 14 20:38:05 2014 (r266088) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 20:47:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3C694140; Wed, 14 May 2014 20:47: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 299632897; Wed, 14 May 2014 20:47: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 s4EKlqGr046616; Wed, 14 May 2014 20:47:52 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EKlq1H046614; Wed, 14 May 2014 20:47:52 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405142047.s4EKlq1H046614@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 20:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266089 - stable/10/sys/dev/aha X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 20:47:52 -0000 Author: ian Date: Wed May 14 20:47:51 2014 New Revision: 266089 URL: http://svnweb.freebsd.org/changeset/base/266089 Log: MFC r260893: Free dma memory from the dma map before destroying the map. Modified: stable/10/sys/dev/aha/aha.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/aha/aha.c ============================================================================== --- stable/10/sys/dev/aha/aha.c Wed May 14 20:38:05 2014 (r266088) +++ stable/10/sys/dev/aha/aha.c Wed May 14 20:47:51 2014 (r266089) @@ -207,9 +207,9 @@ aha_free(struct aha_softc *aha) case 7: bus_dmamap_unload(aha->ccb_dmat, aha->ccb_dmamap); case 6: - bus_dmamap_destroy(aha->ccb_dmat, aha->ccb_dmamap); bus_dmamem_free(aha->ccb_dmat, aha->aha_ccb_array, aha->ccb_dmamap); + bus_dmamap_destroy(aha->ccb_dmat, aha->ccb_dmamap); case 5: bus_dma_tag_destroy(aha->ccb_dmat); case 4: From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 20:49:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E28BE28C; Wed, 14 May 2014 20:49: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 CF92928A6; Wed, 14 May 2014 20:49: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 s4EKnA9s046835; Wed, 14 May 2014 20:49:10 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EKnA0M046834; Wed, 14 May 2014 20:49:10 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405142049.s4EKnA0M046834@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 20:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266090 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 20:49:11 -0000 Author: ian Date: Wed May 14 20:49:10 2014 New Revision: 266090 URL: http://svnweb.freebsd.org/changeset/base/266090 Log: MFC r260921: Add nand to arm NOTES Modified: stable/10/sys/arm/conf/NOTES Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/NOTES ============================================================================== --- stable/10/sys/arm/conf/NOTES Wed May 14 20:47:51 2014 (r266089) +++ stable/10/sys/arm/conf/NOTES Wed May 14 20:49:10 2014 (r266090) @@ -60,6 +60,7 @@ device at91_board_sam9g20ek device at91_board_sam9x25ek device at91_board_tsc4370 device at91rm9200 +device nand device board_ln2410sbc nooptions SMP From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 22:52:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 313A410E; Wed, 14 May 2014 22:52: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 11A70234C; Wed, 14 May 2014 22:52: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 s4EMqH9Z003931; Wed, 14 May 2014 22:52:17 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EMqGma003919; Wed, 14 May 2014 22:52:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405142252.s4EMqGma003919@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 22:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266094 - in stable/10/sys: arm/arm arm/at91 arm/conf conf kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 22:52:18 -0000 Author: ian Date: Wed May 14 22:52:16 2014 New Revision: 266094 URL: http://svnweb.freebsd.org/changeset/base/266094 Log: MFC r261038, r261039, r261040, r261041 Implement generic support for early printf. Modified: stable/10/sys/arm/arm/locore.S stable/10/sys/arm/at91/uart_dev_at91usart.c stable/10/sys/arm/conf/HL201 stable/10/sys/conf/options stable/10/sys/conf/options.arm stable/10/sys/kern/subr_prf.c stable/10/sys/sys/systm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Wed May 14 22:24:09 2014 (r266093) +++ stable/10/sys/arm/arm/locore.S Wed May 14 22:52:16 2014 (r266094) @@ -258,9 +258,13 @@ mmu_init_table: /* fill all table VA==PA */ /* map SDRAM VA==PA, WT cacheable */ #if !defined(SMP) - MMU_INIT(PHYSADDR, PHYSADDR , 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) + MMU_INIT(PHYSADDR, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) /* map VA 0xc0000000..0xc3ffffff to PA */ MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) +#if defined(SOCDEV_PA) && defined(SOCKDEV_VA) + /* Map in 0x04000000 worth of the SoC's devices for bootstrap debugging */ + MMU_INIT(SOCKDEV_VA, SOCDEV_PA, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) +#endif #else MMU_INIT(PHYSADDR, PHYSADDR , 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) /* map VA 0xc0000000..0xc3ffffff to PA */ Modified: stable/10/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- stable/10/sys/arm/at91/uart_dev_at91usart.c Wed May 14 22:24:09 2014 (r266093) +++ stable/10/sys/arm/at91/uart_dev_at91usart.c Wed May 14 22:52:16 2014 (r266094) @@ -276,6 +276,24 @@ at91_usart_putc(struct uart_bas *bas, in WR4(bas, USART_THR, c); } +#ifdef EARLY_PRINTF +/* + * Early printf support. This assumes that we have the SoC "system" devices + * mapped into AT91_BASE. To use this before we adjust the boostrap tables, + * You'll need to define SOCDEV_VA to be 0xdc000000 and SOCDEV_PA to be + * 0xfc000000 in your config file where you define EARLY_PRINTF + */ +volatile uint32_t *at91_dbgu = (volatile uint32_t *)(AT91_BASE + AT91_DBGU0); + +void +eputc(int c) +{ + while (!(at91_dbgu[USART_CSR / 4] & USART_CSR_TXRDY)) + continue; + at91_dbgu[USART_THR / 4] = c; +} +#endif + /* * Check for a character available. */ Modified: stable/10/sys/arm/conf/HL201 ============================================================================== --- stable/10/sys/arm/conf/HL201 Wed May 14 22:24:09 2014 (r266093) +++ stable/10/sys/arm/conf/HL201 Wed May 14 22:52:16 2014 (r266094) @@ -1,4 +1,4 @@ -# Kernel configuration for the AT91SAM9 based Hot-e configuration file +# Kernel configuration for the AT91SAM9G20 based Hot-e configuration file # # For more information on this file, please read the handbook section on # Kernel Configuration Files: @@ -39,16 +39,16 @@ options FFS #Berkeley Fast Filesystem #options MD_ROOT #MD is a potential root device #options MD_ROOT_SIZE=4096 # 4MB ram disk options NANDFS # NAND file system -#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options NFSCL #New Network Filesystem Client #options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCL -options BOOTP_NFSROOT -options BOOTP -options BOOTP_NFSV3 +#options BOOTP_NFSROOT +#options BOOTP +#options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ate0 -options BOOTP_COMPAT +#options BOOTP_COMPAT options ALT_BREAK_TO_DEBUGGER @@ -62,7 +62,6 @@ options SYSVSHM #SYSV-style shared me options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -#options SYSCTL_OMIT_DESCR options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT @@ -83,22 +82,11 @@ device mii #options DIAGNOSTIC device md -#device at91_twi # TWI: Two Wire Interface -#device at91_spi # SPI: -device spibus -# MMC/SD -#device at91_mci -#device mmc -#device mmcsd -# iic -device iic -device iicbus -device icee - device bpf + # USB support options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. -#device ohci # OHCI localbus->USB interface +device ohci # OHCI localbus->USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices device uhid # "Human Interface Devices" @@ -132,5 +120,14 @@ device pass # Passthrough device (dire #device wlan_amrr # AMRR transmit rate control algorithm options ROOTDEVNAME=\"ufs:da0s1a\" -# NAND Flash - my board as 128MB Samsung part -device nand # NAND interface on CS3 +# NAND Flash - my board as 128MB Samsung part, YMMV. +device nand # NAND interface on CS3 + +# Coming soon, but not yet +#options FDT +#options FDT_DTB_STATIC +#makeoptions FDT_DTS_FILE=at91sam9g20ek.dts + +options EARLY_PRINTF +options SOCDEV_PA=0xfc000000 +options SOCDEV_VA=0xdc000000 Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Wed May 14 22:24:09 2014 (r266093) +++ stable/10/sys/conf/options Wed May 14 22:52:16 2014 (r266094) @@ -62,6 +62,7 @@ KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h KLD_DEBUG opt_kld.h SYSCTL_DEBUG opt_sysctl.h +EARLY_PRINTF opt_global.h TEXTDUMP_PREFERRED opt_ddb.h TEXTDUMP_VERBOSE opt_ddb.h Modified: stable/10/sys/conf/options.arm ============================================================================== --- stable/10/sys/conf/options.arm Wed May 14 22:24:09 2014 (r266093) +++ stable/10/sys/conf/options.arm Wed May 14 22:52:16 2014 (r266094) @@ -36,6 +36,8 @@ LINUX_BOOT_ABI opt_global.h LOADERRAMADDR opt_global.h NO_EVENTTIMERS opt_timer.h PHYSADDR opt_global.h +SOCDEV_PA opt_global.h +SOCDEV_VA opt_global.h PV_STATS opt_pmap.h QEMU_WORKAROUNDS opt_global.h SOC_MV_ARMADAXP opt_global.h Modified: stable/10/sys/kern/subr_prf.c ============================================================================== --- stable/10/sys/kern/subr_prf.c Wed May 14 22:24:09 2014 (r266093) +++ stable/10/sys/kern/subr_prf.c Wed May 14 22:52:16 2014 (r266094) @@ -1122,3 +1122,25 @@ hexdump(const void *ptr, int length, con printf("\n"); } } +#ifdef EARLY_PRINTF +/* + * Support for calling an alternate printf early in boot (like before + * cn_init() can be called). Platforms need to define eputc that want + * to use this. + */ +static void +early_putc_func(int ch, void *arg __unused) +{ + eputc(ch); +} + +void +eprintf(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + kvprintf(fmt, early_putc_func, NULL, 10, ap); + va_end(ap); +} +#endif Modified: stable/10/sys/sys/systm.h ============================================================================== --- stable/10/sys/sys/systm.h Wed May 14 22:24:09 2014 (r266093) +++ stable/10/sys/sys/systm.h Wed May 14 22:52:16 2014 (r266094) @@ -196,6 +196,10 @@ void init_param1(void); void init_param2(long physpages); void init_static_kenv(char *, size_t); void tablefull(const char *); +#ifdef EARLY_PRINTF +void eprintf(const char *, ...) __printflike(1, 2); +void eputc(int ch); +#endif int kvprintf(char const *, void (*)(int, void*), void *, int, __va_list) __printflike(1, 0); void log(int, const char *, ...) __printflike(2, 3); From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 23:17:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 64D284D3; Wed, 14 May 2014 23:17: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 44EC524E1; Wed, 14 May 2014 23:17: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 s4ENHa4a013775; Wed, 14 May 2014 23:17:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ENHYmj013761; Wed, 14 May 2014 23:17:34 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405142317.s4ENHYmj013761@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 23:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266095 - in stable/10/sys: arm/at91 arm/conf dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 23:17:36 -0000 Author: ian Date: Wed May 14 23:17:33 2014 New Revision: 266095 URL: http://svnweb.freebsd.org/changeset/base/266095 Log: MFC r261083, r261092, r261126, r261127, r261128, r261129, r261130, r261131 Add Atmel serial drivers. uart clock-frequency is a FreeBSD-specific extention. Make it optional and allow the client uart drivers to decide if a frequency is required. Remove redundant declaration for uart devclass. Commit some unrelated, but harmless, FDT ifdefs. Add at91 NAND support, Fix comment. Remove obsolete options and fix comments Modified: stable/10/sys/arm/at91/uart_bus_at91usart.c stable/10/sys/arm/at91/uart_cpu_at91usart.c stable/10/sys/arm/conf/BWCT stable/10/sys/arm/conf/HL200 stable/10/sys/arm/conf/QILA9G20 stable/10/sys/arm/conf/SAM9G20EK stable/10/sys/arm/conf/SAM9X25EK stable/10/sys/arm/conf/SN9G45 stable/10/sys/dev/uart/uart.h stable/10/sys/dev/uart/uart_bus_fdt.c stable/10/sys/dev/uart/uart_cpu_fdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/uart_bus_at91usart.c ============================================================================== --- stable/10/sys/arm/at91/uart_bus_at91usart.c Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/arm/at91/uart_bus_at91usart.c Wed May 14 23:17:33 2014 (r266095) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); static int usart_at91_probe(device_t dev); -extern struct uart_class at91_usart_class; - static device_method_t usart_at91_methods[] = { /* Device interface */ DEVMETHOD(device_probe, usart_at91_probe), Modified: stable/10/sys/arm/at91/uart_cpu_at91usart.c ============================================================================== --- stable/10/sys/arm/at91/uart_cpu_at91usart.c Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/arm/at91/uart_cpu_at91usart.c Wed May 14 23:17:33 2014 (r266095) @@ -26,8 +26,10 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" #include "opt_uart.h" +#ifndef FDT #include __FBSDID("$FreeBSD$"); @@ -48,7 +50,6 @@ __FBSDID("$FreeBSD$"); bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; -extern struct uart_class at91_usart_class; extern struct bus_space at91_bs_tag; int @@ -86,3 +87,4 @@ uart_cpu_getdev(int devtype, struct uart uart_getenv(devtype, di, class); return (0); } +#endif Modified: stable/10/sys/arm/conf/BWCT ============================================================================== --- stable/10/sys/arm/conf/BWCT Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/arm/conf/BWCT Wed May 14 23:17:33 2014 (r266095) @@ -41,7 +41,7 @@ options SOFTUPDATES #Enable FFS soft u #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device -#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options MD_ROOT_SIZE=4096 # 4MB ram disk #options ROOTDEVNAME=\"ufs:md0\" #options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options NFSCL #New Network Filesystem Client Modified: stable/10/sys/arm/conf/HL200 ============================================================================== --- stable/10/sys/arm/conf/HL200 Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/arm/conf/HL200 Wed May 14 23:17:33 2014 (r266095) @@ -37,7 +37,7 @@ options FFS #Berkeley Fast Filesystem #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device -#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options MD_ROOT_SIZE=4096 # 4MB ram disk #options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options NFSCL #New Network Filesystem Client #options NFSD #New Network Filesystem Server Modified: stable/10/sys/arm/conf/QILA9G20 ============================================================================== --- stable/10/sys/arm/conf/QILA9G20 Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/arm/conf/QILA9G20 Wed May 14 23:17:33 2014 (r266095) @@ -38,7 +38,7 @@ options FFS #Berkeley Fast Filesystem #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device -#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options MD_ROOT_SIZE=4096 # 4MB ram disk options NFSCL #New Network Filesystem Client #options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager @@ -63,7 +63,6 @@ options SYSVSHM #SYSV-style shared me options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -#options SYSCTL_OMIT_DESCR options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT Modified: stable/10/sys/arm/conf/SAM9G20EK ============================================================================== --- stable/10/sys/arm/conf/SAM9G20EK Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/arm/conf/SAM9G20EK Wed May 14 23:17:33 2014 (r266095) @@ -37,7 +37,8 @@ options FFS #Berkeley Fast Filesystem #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device -#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options MD_ROOT_SIZE=4096 # 4MB ram disk +options NANDFS #NAND file system options NFSCL #New Network Filesystem Client #options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager @@ -62,7 +63,6 @@ options SYSVSHM #SYSV-style shared me options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -#options SYSCTL_OMIT_DESCR options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT @@ -91,6 +91,9 @@ option AT91_ATE_USE_RMII device at91_twi # TWI: Two Wire Interface (EEPROM) device at91_wdt # WDT: Watchdog timer +# NAND Flash - Reference design has Samsung 256MB but others possible +device nand # NAND interface on CS3 + # NOTE: SPI DataFlash and mci/mmc/mmcsd have hardware # confilict on this card. Use one or the other. # see board_sam9g20ek.c @@ -105,7 +108,7 @@ device at91_mci device mmc device mmcsd option AT91_MCI_SLOT_B -#option AT91_MCI_HAS_4WIRE +option AT91_MCI_HAS_4WIRE # iic device iic @@ -128,14 +131,14 @@ device uhid # "Human Interface Devices #device udbp # USB Double Bulk Pipe devices # USB Ethernet, requires miibus -device miibus +#device miibus #device aue # ADMtek USB Ethernet #device axe # ASIX Electronics USB Ethernet #device cdce # Generic USB over Ethernet #device cue # CATC USB Ethernet #device kue # Kawasaki LSI USB Ethernet #device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB +#device udav # Davicom DM9601E USB # USB Wireless #device rum # Ralink Technology RT2501USB wireless NICs @@ -149,4 +152,3 @@ device udav # Davicom DM9601E USB #device wlan_ccmp # 802.11 CCMP support #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm - Modified: stable/10/sys/arm/conf/SAM9X25EK ============================================================================== --- stable/10/sys/arm/conf/SAM9X25EK Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/arm/conf/SAM9X25EK Wed May 14 23:17:33 2014 (r266095) @@ -38,7 +38,7 @@ options FFS #Berkeley Fast Filesystem #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device -#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options MD_ROOT_SIZE=4096 # 4MB ram disk options NFSCL #New Network Filesystem Client #options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager @@ -63,7 +63,6 @@ options SYSVSHM #SYSV-style shared me options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -#options SYSCTL_OMIT_DESCR options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT Modified: stable/10/sys/arm/conf/SN9G45 ============================================================================== --- stable/10/sys/arm/conf/SN9G45 Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/arm/conf/SN9G45 Wed May 14 23:17:33 2014 (r266095) @@ -37,7 +37,7 @@ options FFS #Berkeley Fast Filesystem #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device -#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options MD_ROOT_SIZE=4096 # 4MB ram disk options NFSCL #New Network Filesystem Client #options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager @@ -62,7 +62,6 @@ options SYSVSHM #SYSV-style shared me options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -#options SYSCTL_OMIT_DESCR options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT Modified: stable/10/sys/dev/uart/uart.h ============================================================================== --- stable/10/sys/dev/uart/uart.h Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/dev/uart/uart.h Wed May 14 23:17:33 2014 (r266095) @@ -76,6 +76,7 @@ extern struct uart_class uart_pl011_clas extern struct uart_class uart_cdnc_class __attribute__((weak)); extern struct uart_class uart_ti8250_class __attribute__((weak)); extern struct uart_class uart_vybrid_class __attribute__((weak)); +extern struct uart_class at91_usart_class __attribute__((weak)); #ifdef FDT struct ofw_compat_data; Modified: stable/10/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_fdt.c Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/dev/uart/uart_bus_fdt.c Wed May 14 23:17:33 2014 (r266095) @@ -71,6 +71,8 @@ static driver_t uart_fdt_driver = { */ static struct ofw_compat_data compat_data[] = { {"arm,pl011", (uintptr_t)&uart_pl011_class}, + {"atmel,at91rm9200-usart",(uintptr_t)&at91_usart_class}, + {"atmel,at91sam9260-usart",(uintptr_t)&at91_usart_class}, {"cadence,uart", (uintptr_t)&uart_cdnc_class}, {"exynos", (uintptr_t)&uart_s3c2410_class}, {"fsl,imx6q-uart", (uintptr_t)&uart_imx_class}, Modified: stable/10/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- stable/10/sys/dev/uart/uart_cpu_fdt.c Wed May 14 22:52:16 2014 (r266094) +++ stable/10/sys/dev/uart/uart_cpu_fdt.c Wed May 14 23:17:33 2014 (r266095) @@ -62,9 +62,10 @@ uart_fdt_get_clock(phandle_t node, pcell { pcell_t clock; + /* clock-frequency is a FreeBSD-only extention. */ if ((OF_getprop(node, "clock-frequency", &clock, sizeof(clock))) <= 0) - return (ENXIO); + clock = 0; if (clock == 0) /* Try to retrieve parent 'bus-frequency' */ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 23:33:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8D0978C8; Wed, 14 May 2014 23:33: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 773C2263F; Wed, 14 May 2014 23:33: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 s4ENXd12022009; Wed, 14 May 2014 23:33:39 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ENXcGD022004; Wed, 14 May 2014 23:33:38 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405142333.s4ENXcGD022004@svn.freebsd.org> From: Luiz Otavio O Souza Date: Wed, 14 May 2014 23:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266096 - in stable/10: share/man/man4 usr.sbin/gpioctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 23:33:39 -0000 Author: loos Date: Wed May 14 23:33:38 2014 New Revision: 266096 URL: http://svnweb.freebsd.org/changeset/base/266096 Log: MFC r258044, r258679, r263990 Adds gpioiic.4 and gpioled.4 man pages. Moves some of the information that was previously available on gpio.4 to their respectives pages. Add the cross references on gpioctl.8. Add gpiobus(4) as a link to gpio(4). Added: stable/10/share/man/man4/gpioiic.4 - copied unchanged from r258044, head/share/man/man4/gpioiic.4 stable/10/share/man/man4/gpioled.4 - copied unchanged from r258044, head/share/man/man4/gpioled.4 Modified: stable/10/share/man/man4/Makefile stable/10/share/man/man4/gpio.4 stable/10/usr.sbin/gpioctl/gpioctl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Wed May 14 23:17:33 2014 (r266095) +++ stable/10/share/man/man4/Makefile Wed May 14 23:33:38 2014 (r266096) @@ -157,6 +157,8 @@ MAN= aac.4 \ gif.4 \ gpib.4 \ gpio.4 \ + gpioiic.4 \ + gpioled.4 \ gre.4 \ h_ertt.4 \ hatm.4 \ @@ -635,6 +637,7 @@ MLINKS+=fxp.4 if_fxp.4 MLINKS+=gem.4 if_gem.4 MLINKS+=geom.4 GEOM.4 MLINKS+=gif.4 if_gif.4 +MLINKS+=gpio.4 gpiobus.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hatm.4 if_hatm.4 MLINKS+=hme.4 if_hme.4 Modified: stable/10/share/man/man4/gpio.4 ============================================================================== --- stable/10/share/man/man4/gpio.4 Wed May 14 23:17:33 2014 (r266095) +++ stable/10/share/man/man4/gpio.4 Wed May 14 23:33:38 2014 (r266096) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2013 +.Dd November 5, 2013 .Dt GPIO 4 .Os .Sh NAME @@ -34,10 +34,9 @@ To compile these devices into your kernel and use the device hints, place the following lines in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device gpiobus" -.Cd "device gpioiic" .Cd "device gpio" .Cd "device gpioc" +.Cd "device gpioiic" .Cd "device gpioled" .Ed .Pp @@ -76,8 +75,9 @@ architecure include: .Sh DESCRIPTION The .Em gpiobus -system provides a simple interface to the bit banging style GPIO bus -found on embedded architectures. +system provides a simple interface to the GPIO pins that are usually +available on embedded architectures and can provide bit banging style +devices to the system. .Pp The acronym .Li GPIO @@ -88,36 +88,20 @@ The BUS physically consists of multiple for input/output, IRQ delivery, SDA/SCL .Em iicbus use, etc. -On most embedded architechtures (mips/arm), discovery of the bus and +.Pp +On some embedded architechtures (like MIPS), discovery of the bus and configuration of the pins is done via .Xr device.hints 5 in the platform's kernel .Xr config 5 file. .Pp -Assignment of -.Xr gpioiic 4 -bus variables is done via: -.Bl -tag -width ".Va hint.gpioiic.%d.atXXX" -.It Va hint.gpioiic.%d.at -Normally just gpiobus0. -.It Va hint.gpioiic.%d.pins -This is a bitmask of the pins on the gpio board that are to be used for -SCLOCK and SDATA from the IIC bus. -To configure pin 0 and 7, use the bitmask of -10000001 and convert it to a hexadecimal value of 0x0081. -Should only ever have two bits set in mask. -.It Va hint.gpioiic.%d.scl -Indicates which bit in the -.Va hint.gpioiic.%d.pins -should be used as the SCLOCK -source. -.It Va hint.gpioiic.%d.sda -Indicates which bit in the -.Va hint.gpioiic.%d.pins -should be used as the SDATA -source. -.El +On some others (like ARM), where +.Xr FDT 4 +is used to describe the device tree, the bus discovery is done via the DTS +passed to the kernel, being either statically compiled in, or by a variety +of ways where the boot loader (or Open Firmware enabled system) passes the +DTS blob to kernel at boot. .Pp The following are only provided by the .Cd ar71xx_gpio @@ -141,28 +125,11 @@ This is mainly used to set/clear functio not setup by uBoot. .El .Pp -These values are configureable from the -.Xr gpioled 4 -interface and help create -.Xr led 4 -compatible devices in -.Pa /dev/led/ . -.Bl -tag -width ".Va hint.gpioiic.%d.atXXX" -.It Va hint.gpioled.%d.at -Normally assigned to gpiobus0. -.It Va hint.gpioled.%d.name -Arbitrary name of device in -.Pa /dev/led/ -to create for -.Xr led 4 -interfaces. -.It Va hint.gpioled.%d.pins -Which pin on the GPIO interface to map to this instance. -.El -.Pp Simply put, each pin of the GPIO interface is connected to an input/output of some device in a system. .Sh SEE ALSO +.Xr gpioiic 4 , +.Xr gpioled 4 , .Xr iicbus 4 , .Xr gpioctl 8 .Sh HISTORY Copied: stable/10/share/man/man4/gpioiic.4 (from r258044, head/share/man/man4/gpioiic.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/gpioiic.4 Wed May 14 23:33:38 2014 (r266096, copy of r258044, head/share/man/man4/gpioiic.4) @@ -0,0 +1,96 @@ +.\" Copyright (c) 2013, Luiz Otavio O Souza +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 5, 2013 +.Dt GPIOIIC 4 +.Os +.Sh NAME +.Nm gpioiic +.Nd GPIO I2C bit-banging device driver +.Sh SYNOPSIS +.Cd "device gpio" +.Cd "device gpioiic" +.Cd "device iic" +.Cd "device iicbb" +.Cd "device iicbus" +.Sh DESCRIPTION +The +.Em gpioiic +driver provides an IIC bit-banging interface using two GPIO pins for the +SCL and SDA on the +.Em gpiobus . +.Nm +implements an open colector kind of output, as recommended by the standard, +when driving the pins on the +.Em gpiobus , +i.e, they are never switched to the logical value of '1', +or they are '0' or simply open (Hi-Z/tri-state). +So the pullup resistors are required so +.Nm +can work. +.Pp +On a hint based system, like +.Li MIPS , these values are configureable for the +.Nm gpioiic : +.Bl -tag -width ".Va hint.gpioiic.%d.atXXX" +.It Va hint.gpioiic.%d.at +The gpiobus you are attaching to. +Normally just gpiobus0. +.It Va hint.gpioiic.%d.pins +This is a bitmask of the pins on the +.Em gpiobus +that are to be used for SCLOCK and SDATA from the GPIO IIC +bit-banging bus. +To configure pin 0 and 7, use the bitmask of +10000001 and convert it to a hexadecimal value of 0x0081. +Please note that this mask should only ever have two bits set +(any others bits - i.e., pins - will be ignored). +.It Va hint.gpioiic.%d.scl +Indicates which bit in the +.Va hint.gpioiic.%d.pins +should be used as the SCLOCK +source. +.It Va hint.gpioiic.%d.sda +Indicates which bit in the +.Va hint.gpioiic.%d.pins +should be used as the SDATA +source. +.El +.Sh SEE ALSO +.Xr gpio 4 , +.Xr gpioled 4 , +.Xr iic 4 , +.Xr iicbb 4 , +.Xr iicbus 4 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 11.0 . +.Sh AUTHORS +This +manual page was written by +.An Luiz Otavio O Souza . Copied: stable/10/share/man/man4/gpioled.4 (from r258044, head/share/man/man4/gpioled.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/gpioled.4 Wed May 14 23:33:38 2014 (r266096, copy of r258044, head/share/man/man4/gpioled.4) @@ -0,0 +1,83 @@ +.\" Copyright (c) 2013, Luiz Otavio O Souza +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 5, 2013 +.Dt GPIOLED 4 +.Os +.Sh NAME +.Nm gpioled +.Nd GPIO led generic device driver +.Sh SYNOPSIS +.Cd "device gpio" +.Cd "device gpioled" +.Pp +This driver attaches a +.Xr led 4 +device to a GPIO pin. +.Sh DESCRIPTION +The +.Em gpioled +driver provides a glue to attach a +.Xr led 4 +compatible device to a GPIO pin. +Each led on the system has a +.Pa name +which is used to export a device in +.Pa /dev/led/ . +The GPIO pin can then be controlled by writing to this device as described +on +.Xr led 4 . +.Pp +On a hint based system, like +.Li MIPS , these values are configureable for +.Nm : +.Bl -tag -width ".Va hint.gpioiic.%d.atXXX" +.It Va hint.gpioled.%d.at +The gpiobus you are attaching to. +Normally assigned to gpiobus0. +.It Va hint.gpioled.%d.name +Arbitrary name of device in +.Pa /dev/led/ +to create for +.Xr led 4 . +.It Va hint.gpioled.%d.pins +Which pin on the GPIO interface to map to this instance. +Please note that this mask should only ever have one bit set +(any others bits - i.e., pins - will be ignored). +.El +.Sh SEE ALSO +.Xr gpio 4 , +.Xr led 4 , +.Xr gpioiic 4 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 11.0 . +.Sh AUTHORS +This +manual page was written by +.An Luiz Otavio O Souza . Modified: stable/10/usr.sbin/gpioctl/gpioctl.8 ============================================================================== --- stable/10/usr.sbin/gpioctl/gpioctl.8 Wed May 14 23:17:33 2014 (r266095) +++ stable/10/usr.sbin/gpioctl/gpioctl.8 Wed May 14 23:33:38 2014 (r266096) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2013 +.Dd November 7, 2013 .Dt GPIOCTL 1 .Os .Sh NAME @@ -109,6 +109,8 @@ gpioctl -f /dev/gpioc0 -c 12 IN .El .Sh SEE ALSO .Xr gpio 4 +.Xr gpioiic 4 +.Xr gpioled 4 .Sh HISTORY The .Nm From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 23:51:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9E282D43; Wed, 14 May 2014 23:51:08 +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 8A01D27B5; Wed, 14 May 2014 23:51:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ENp8Qt029569; Wed, 14 May 2014 23:51:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ENp7Ek029565; Wed, 14 May 2014 23:51:07 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405142351.s4ENp7Ek029565@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 23:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266097 - in stable/10/sys/arm: arm at91 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 23:51:08 -0000 Author: ian Date: Wed May 14 23:51:07 2014 New Revision: 266097 URL: http://svnweb.freebsd.org/changeset/base/266097 Log: MFC r260886, r261165, r261171, r261172, r261214 Fix gcc with -Wstrict-prototypes by telling it bi_emac takes no parameters. Bus space handles need to be the VA of the requested resource, not the rounded page VA. Correct so the DBGU device can be mapped for FDT console since it isn't on a page boundary. Make early printf output nicer by inserting a carriage return before any linefeeds that are output. Before resetting the USART, delay a bit to allow the transmitter to finish the current character to drain to avoid glitching. Also, simplify the code a smidge. Remove extra parens to silence clang warning. Modified: stable/10/sys/arm/arm/db_trace.c stable/10/sys/arm/at91/at91.c stable/10/sys/arm/at91/board_sam9260ek.c stable/10/sys/arm/at91/uart_dev_at91usart.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/db_trace.c ============================================================================== --- stable/10/sys/arm/arm/db_trace.c Wed May 14 23:33:38 2014 (r266096) +++ stable/10/sys/arm/arm/db_trace.c Wed May 14 23:51:07 2014 (r266097) @@ -269,7 +269,7 @@ db_unwind_exec_insn(struct unwind_state /* Stop processing */ state->entries = 0; - } else if ((insn == INSN_POP_REGS)) { + } else if (insn == INSN_POP_REGS) { unsigned int mask, reg; mask = db_unwind_exec_read_byte(state); Modified: stable/10/sys/arm/at91/at91.c ============================================================================== --- stable/10/sys/arm/at91/at91.c Wed May 14 23:33:38 2014 (r266096) +++ stable/10/sys/arm/at91/at91.c Wed May 14 23:51:07 2014 (r266097) @@ -65,11 +65,13 @@ at91_bs_map(void *t, bus_addr_t bpa, bus pa = trunc_page(bpa); if (pa >= AT91_PA_BASE + 0xff00000) { - *bshp = pa - AT91_PA_BASE + AT91_BASE; + *bshp = bpa - AT91_PA_BASE + AT91_BASE; return (0); } - if (pa >= AT91_BASE + 0xff00000) + if (pa >= AT91_BASE + 0xff00000) { + *bshp = bpa; return (0); + } endpa = round_page(bpa + size); *bshp = (vm_offset_t)pmap_mapdev(pa, endpa - pa); Modified: stable/10/sys/arm/at91/board_sam9260ek.c ============================================================================== --- stable/10/sys/arm/at91/board_sam9260ek.c Wed May 14 23:33:38 2014 (r266096) +++ stable/10/sys/arm/at91/board_sam9260ek.c Wed May 14 23:51:07 2014 (r266097) @@ -38,9 +38,39 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include + +static struct at91_smc_init nand_smc = { + .ncs_rd_setup = 0, + .nrd_setup = 1, + .ncs_wr_setup = 0, + .nwe_setup = 1, + + .ncs_rd_pulse = 3, + .nrd_pulse = 3, + .ncs_wr_pulse = 3, + .nwe_pulse = 3, + + .nrd_cycle = 5, + .nwe_cycle = 5, + + .mode = SMC_MODE_READ | SMC_MODE_WRITE | SMC_MODE_EXNW_DISABLED, + .tdf_cycles = 2, +}; + +static struct at91_nand_params nand_param = { + .ale = 1u << 21, + .cle = 1u << 22, + .width = 8, + .rnb_pin = AT91_PIN_PC13, + .nce_pin = AT91_PIN_PC14, + .cs = 3, +}; -BOARD_INIT long -board_init(void) +static void +bi_dbgu(void) { /* @@ -50,6 +80,11 @@ board_init(void) at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB14, 0); /* DTXD */ at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB15, 1); +} + +static void +bi_emac(void) +{ /* * EMAC @@ -91,7 +126,11 @@ board_init(void) at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA28, 0); /* ECOL */ at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA29, 0); +} +static void +bi_mmc(void) +{ /* * MMC, wired to socket B. @@ -114,11 +153,11 @@ board_init(void) * don't support the dataflash. But if you did, you'd have to * use CS0 and CS1. */ +} - /* - * SPI1 is wired to a audio CODEC that we don't support, so - * give it a pass. - */ +static void +bi_iic(void) +{ /* * TWI. Only one child on the iic bus, which we take care of @@ -128,6 +167,11 @@ board_init(void) at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA23, 1); /* TWCK */ at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA24, 1); +} + +static void +bi_usart0(void) +{ /* * USART0 @@ -148,7 +192,11 @@ board_init(void) at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB26, 1); /* CTS0 */ at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB27, 0); +} +static void +bi_usart1(void) +{ /* * USART1 */ @@ -160,9 +208,54 @@ board_init(void) at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB6, 1); /* RXD1 */ at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB7, 0); +} + +static void +bi_nand(void) +{ + /* Samsung 256MB SLC Flash */ + + /* Setup Static Memory Controller */ + at91_smc_setup(0, 3, &nand_smc); + at91_enable_nand(&nand_param); + + /* + * This assumes + * - RNB is on pin PC13 + * - CE is on pin PC14 + * + * Nothing actually uses RNB right now. + * + * For CE, this currently asserts it during board setup and leaves it + * that way forever. + * + * All this can go away when the gpio pin-renumbering happens... + */ + at91_pio_use_gpio(AT91SAM9260_PIOC_BASE, AT91C_PIO_PC13 | AT91C_PIO_PC14); + at91_pio_gpio_input(AT91SAM9260_PIOC_BASE, AT91C_PIO_PC13); /* RNB */ + at91_pio_gpio_output(AT91SAM9260_PIOC_BASE, AT91C_PIO_PC14, 0); /* nCS */ + at91_pio_gpio_clear(AT91SAM9260_PIOC_BASE, AT91C_PIO_PC14); /* Assert nCS */ +} + +BOARD_INIT long +board_init(void) +{ + bi_dbgu(); + bi_emac(); + bi_mmc(); + + /* + * SPI1 is wired to a audio CODEC that we don't support, so + * give it a pass. + */ + bi_iic(); + bi_usart0(); + bi_usart1(); /* USART2 - USART5 aren't wired up, except via PIO pins, ignore them. */ + bi_nand(); + return (at91_ramsize()); } Modified: stable/10/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- stable/10/sys/arm/at91/uart_dev_at91usart.c Wed May 14 23:33:38 2014 (r266096) +++ stable/10/sys/arm/at91/uart_dev_at91usart.c Wed May 14 23:51:07 2014 (r266097) @@ -288,6 +288,10 @@ volatile uint32_t *at91_dbgu = (volatile void eputc(int c) { + + if (c == '\n') + eputc('\r'); + while (!(at91_dbgu[USART_CSR / 4] & USART_CSR_TXRDY)) continue; at91_dbgu[USART_THR / 4] = c; From owner-svn-src-stable-10@FreeBSD.ORG Wed May 14 23:57:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 24793EAC; Wed, 14 May 2014 23:57: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 108B927E3; Wed, 14 May 2014 23:57: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 s4ENv8Gt031223; Wed, 14 May 2014 23:57:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ENv8sh031217; Wed, 14 May 2014 23:57:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405142357.s4ENv8sh031217@svn.freebsd.org> From: Ian Lepore Date: Wed, 14 May 2014 23:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266098 - stable/10/sys/arm/ti X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 23:57:09 -0000 Author: ian Date: Wed May 14 23:57:07 2014 New Revision: 266098 URL: http://svnweb.freebsd.org/changeset/base/266098 Log: MFC r258209, r258210, r261211, Add a driver for the Texas Instruments Mailbox hardware. Add a driver for the TI Programmable Realtime Unit Subsystem. fix args to mtx_init Added: stable/10/sys/arm/ti/ti_mbox.c - copied, changed from r258209, head/sys/arm/ti/ti_mbox.c stable/10/sys/arm/ti/ti_mbox.h - copied unchanged from r258209, head/sys/arm/ti/ti_mbox.h stable/10/sys/arm/ti/ti_pruss.c - copied, changed from r258210, head/sys/arm/ti/ti_pruss.c stable/10/sys/arm/ti/ti_pruss.h - copied unchanged from r258210, head/sys/arm/ti/ti_pruss.h Modified: Directory Properties: stable/10/ (props changed) Copied and modified: stable/10/sys/arm/ti/ti_mbox.c (from r258209, head/sys/arm/ti/ti_mbox.c) ============================================================================== --- head/sys/arm/ti/ti_mbox.c Sat Nov 16 08:20:50 2013 (r258209, copy source) +++ stable/10/sys/arm/ti/ti_mbox.c Wed May 14 23:57:07 2014 (r266098) @@ -140,7 +140,7 @@ ti_mbox_attach(device_t dev) } sc = device_get_softc(dev); rid = 0; - mtx_init(&sc->sc_mtx, "TI mbox", MTX_DEF, 0); + mtx_init(&sc->sc_mtx, "TI mbox", NULL, MTX_DEF); sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) { Copied: stable/10/sys/arm/ti/ti_mbox.h (from r258209, head/sys/arm/ti/ti_mbox.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/ti/ti_mbox.h Wed May 14 23:57:07 2014 (r266098, copy of r258209, head/sys/arm/ti/ti_mbox.h) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2013 Rui Paulo + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TI_MBOX_H_ +#define _TI_MBOX_H_ + +#define TI_MBOX_REVISION 0x00 +#define TI_MBOX_SYSCONFIG 0x10 +#define TI_MBOX_SYSCONFIG_SOFTRST 0x01 +#define TI_MBOX_SYSCONFIG_SMARTIDLE (0x02 << 2) +#define TI_MBOX_MESSAGE(n) (0x40 + (n) * 0x4) +#define TI_MBOX_FIFOSTATUS(n) (0x80 + (n) * 0x4) +#define TI_MBOX_MSGSTATUS(n) (0xc0 + (n) * 0x4) +#define TI_MBOX_IRQSTATUS_RAW(n) (0x100 + (n) * 0x10) +#define TI_MBOX_IRQSTATUS_CLR(n) (0x104 + (n) * 0x10) +#define TI_MBOX_IRQENABLE_SET(n) (0x108 + (n) * 0x10) +#define TI_MBOX_IRQENABLE_CLR(n) (0x10c + (n) * 0x10) + +#endif /* _TI_MBOX_H_ */ Copied and modified: stable/10/sys/arm/ti/ti_pruss.c (from r258210, head/sys/arm/ti/ti_pruss.c) ============================================================================== --- head/sys/arm/ti/ti_pruss.c Sat Nov 16 08:23:15 2013 (r258210, copy source) +++ stable/10/sys/arm/ti/ti_pruss.c Wed May 14 23:57:07 2014 (r266098) @@ -166,7 +166,7 @@ ti_pruss_attach(device_t dev) } sc = device_get_softc(dev); rid = 0; - mtx_init(&sc->sc_mtx, "TI PRUSS", MTX_DEF, 0); + mtx_init(&sc->sc_mtx, "TI PRUSS", NULL, MTX_DEF); sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) { Copied: stable/10/sys/arm/ti/ti_pruss.h (from r258210, head/sys/arm/ti/ti_pruss.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/ti/ti_pruss.h Wed May 14 23:57:07 2014 (r266098, copy of r258210, head/sys/arm/ti/ti_pruss.h) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2013 Rui Paulo + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _TI_PRUSS_H_ +#define _TI_PRUSS_H_ + +#define PRUSS_AM18XX_INTC 0x04000 +#define PRUSS_AM18XX_REV 0x4e825900 +#define PRUSS_AM33XX_REV 0x4e82A900 +#define PRUSS_AM33XX_INTC 0x20000 + +#endif /* _TI_PRUSS_H_ */ From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 00:11:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4A6633C6 for ; Thu, 15 May 2014 00:11:54 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15EF72933 for ; Thu, 15 May 2014 00:11:54 +0000 (UTC) Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 5390F20D4B for ; Wed, 14 May 2014 20:11:50 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Wed, 14 May 2014 20:11:50 -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=l4j5tywIG66/CNiGInKoFppfcQo=; b=Yxqe1kEsGQDgSUQGJtsmYqYMjbBJ XWTPDEerq3UGroEJzEKOOWdnnXNX9ZaKrsMPH2Iy0+1V72oPoZauPYnLj/osIP/3 M0pgfi0pnTVlImv74J6YiO5yNprFkxSdTgbbtsbx3fRTo3MAsedv7os/sDafCYtx mT8atTiqtAcopvs= 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=l4j5tywIG66/CNiGInKoFp pfcQo=; b=OGfG7ifR8AYHiondeMC4iI7IQVKBRxlhP8oBuUG/jrAGFpW+vh5XcZ eqnxRbyqCAzTgR9ilAZmgH+rViJy9hN/jAexAxwh00YzmtFSW/139vrplu9N9Gc+ xvqhOvCUCb0gEfgFx/Il78geCqXXlPVJx/aUbZneQlChhVxbTy0k8= X-Sasl-enc: AlDHcJvLnrxM3/tATSO8EzTMbFwkx5eGWkPNRym0YCZI 1400112710 Received: from [206.87.178.155] (unknown [206.87.178.155]) by mail.messagingengine.com (Postfix) with ESMTPA id B82DDC00003; Wed, 14 May 2014 20:11:49 -0400 (EDT) Message-ID: <53740645.7060003@fastmail.net> Date: Wed, 14 May 2014 17:11:49 -0700 From: Bruce Simpson User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r266098 - stable/10/sys/arm/ti References: <201405142357.s4ENv8sh031217@svn.freebsd.org> In-Reply-To: <201405142357.s4ENv8sh031217@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 00:11:54 -0000 On 14/05/2014 16:57, Ian Lepore wrote: > TI Programmable Realtime Unit Subsystem. OK, so PRUSS is one vowel change away from the name of a killer android in a work by Philip K. Dick. Are there applications for this driver? I'm just curious having skimmed this document [1]: "The PRU subsystem on the OMAP-L1x processors, C674x DSPs, and AM1x Sitara ARM MPUs allows the application developer to implement soft peripherals; peripherals implemented using a combination of on-chip hardware and software." [1] http://www.ti.com/lit/wp/spry136a/spry136a.pdf From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 00:52:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D6056496; Thu, 15 May 2014 00:52: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 B48AC2D56; Thu, 15 May 2014 00:52: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 s4F0qI2S058202; Thu, 15 May 2014 00:52:18 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F0qI8U058199; Thu, 15 May 2014 00:52:18 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405150052.s4F0qI8U058199@svn.freebsd.org> From: Mark Johnston Date: Thu, 15 May 2014 00:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266102 - in stable/10/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 00:52:19 -0000 Author: markj Date: Thu May 15 00:52:17 2014 New Revision: 266102 URL: http://svnweb.freebsd.org/changeset/base/266102 Log: MFC r262665: Expose a few DTrace parameters as sysctls under kern.dtrace and add descriptions for several existing sysctls. PR: 187027 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/10/sys/cddl/dev/dtrace/dtrace_ioctl.c stable/10/sys/cddl/dev/dtrace/dtrace_sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu May 15 00:50:57 2014 (r266101) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu May 15 00:52:17 2014 (r266102) @@ -300,7 +300,8 @@ static kmutex_t dtrace_meta_lock; /* me #define PRIV_PROC_ZONE (1 << 5) #define PRIV_ALL ~0 -SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace Information"); +SYSCTL_DECL(_debug_dtrace); +SYSCTL_DECL(_kern_dtrace); #endif #if defined(sun) Modified: stable/10/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/dtrace_ioctl.c Thu May 15 00:50:57 2014 (r266101) +++ stable/10/sys/cddl/dev/dtrace/dtrace_ioctl.c Thu May 15 00:52:17 2014 (r266102) @@ -23,7 +23,8 @@ */ static int dtrace_verbose_ioctl; -SYSCTL_INT(_debug_dtrace, OID_AUTO, verbose_ioctl, CTLFLAG_RW, &dtrace_verbose_ioctl, 0, ""); +SYSCTL_INT(_debug_dtrace, OID_AUTO, verbose_ioctl, CTLFLAG_RW, + &dtrace_verbose_ioctl, 0, "log DTrace ioctls"); #define DTRACE_IOCTL_PRINTF(fmt, ...) if (dtrace_verbose_ioctl) printf(fmt, ## __VA_ARGS__ ) Modified: stable/10/sys/cddl/dev/dtrace/dtrace_sysctl.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/dtrace_sysctl.c Thu May 15 00:50:57 2014 (r266101) +++ stable/10/sys/cddl/dev/dtrace/dtrace_sysctl.c Thu May 15 00:52:17 2014 (r266102) @@ -22,6 +22,8 @@ * */ +SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace debug parameters"); + int dtrace_debug = 0; TUNABLE_INT("debug.dtrace.debug", &dtrace_debug); SYSCTL_INT(_debug_dtrace, OID_AUTO, debug, CTLFLAG_RW, &dtrace_debug, 0, ""); @@ -78,5 +80,12 @@ sysctl_dtrace_providers(SYSCTL_HANDLER_A } SYSCTL_PROC(_debug_dtrace, OID_AUTO, providers, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, sysctl_dtrace_providers, "A", ""); + 0, 0, sysctl_dtrace_providers, "A", "available DTrace providers"); + +SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace parameters"); + +SYSCTL_LONG(_kern_dtrace, OID_AUTO, dof_maxsize, CTLFLAG_RW, + &dtrace_dof_maxsize, 0, "largest allowed DOF table"); +SYSCTL_LONG(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW, + &dtrace_helper_actions_max, 0, "maximum number of allowed helper actions"); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 01:27:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8D83923D; Thu, 15 May 2014 01:27:58 +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 765FF210E; Thu, 15 May 2014 01:27:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F1Rwwi072887; Thu, 15 May 2014 01:27:58 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F1Rsbx072863; Thu, 15 May 2014 01:27:54 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405150127.s4F1Rsbx072863@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 15 May 2014 01:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266105 - in stable/10: share/man/man4 sys/arm/broadcom/bcm2835 sys/arm/conf sys/arm/ti sys/boot/fdt/dts sys/conf sys/dev/gpio sys/dev/iicbus sys/dev/ofw sys/modules/gpio/gpiobus sys/mo... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 01:27:58 -0000 Author: loos Date: Thu May 15 01:27:53 2014 New Revision: 266105 URL: http://svnweb.freebsd.org/changeset/base/266105 Log: MFC r258046, r258047, r258050, r259035, r259036, r259037, r261842, r261843, r261844, r261845, r261846, r262194, r262522, r262559 r258046: Fix a typo on a comment in ofw_bus_if.m, the default method will return -1 when a node doesn't exist. r258047: Move the KASSERT() check to the point before the increase of number of pins. r258050: Fix gpiobus to return BUS_PROBE_GENERIC insted of BUS_PROBE_SPECIFIC (0) so it can be overriden by its OFW/FDT version. Give a chance for GPIO devices that implement the device_identify method to attach. r259035: Remove unnecessary includes and an unused softc variable. While here apply two minor style(9) fixes. r259036: Move the GPIOBUS_SET_PINFLAGS(..., ..., pin, GPIO_PIN_OUTPUT) to led(4) control callback function. This makes gpioled(4) works even if the pin is accidentally set to an input. r259037: Fix the pin value reading on AM335x. Because of the inverted logic it was always returning '0' for all the reads, even for the outputs. It is now known to work with gpioiic(4) and gpioled(4). r261842: Add an OFW GPIO compatible bus. This allows the use of the DTS files to describe GPIO bindings in the system. Move the GPIOBUS lock macros to gpiobusvar.h as they are now shared between the OFW and the non OFW versions of GPIO bus. Export gpiobus_print_pins() so it can also be used on the OFW GPIO bus. r261843: Add OFW support to the in tree gpio compatible devices: gpioiic(4) and gpioled(4). Tested on RPi and BBB (using the hardware I2C controller and gpioiic(4) for the I2C tests). It was also verified for regressions on RSPRO (MIPS/ar71xx) used as reference for a non OFW-based system. Update the gpioled(4) and gpioiic(4) man pages with some details and examples about the FDT/OFW support. Some compatibility details pointed out by imp@ will follow in subsequent commits. r261844: Allow the use of OFW I2C bus together with iicbb(4) on OFW-based systems. This change makes ofw_iicbus attach to iicbb(4) controllers in addition to the already supported i2c host bridges (iichb). On iicbb(4) allow the direct access of the OFW parent node by its children, so they can be directly attached to iicbb(4) node on the DTS without the need of describing the i2c bus. r261845: Allow the use of the OFW GPIO bus for ti_gpio and bcm2835_gpio. With this change the gpio children can be described as directly connected to the GPIO controller without the need of describing the OFW GPIO bus itself on the DTS file. With this commit the OFW GPIO bus is fully functional on BBB and RPi. GPIO controllers which want to use the OFW GPIO bus will need similar changes. r261846: Make the gpioled(4) work out of the box on BBB. Add gpioled(4) to BEAGLEBONE kernel and add the description of the four on-board leds of beaglebone-black to its DTS file. r262194: Remove an unnecessary header. r262522: Fix make depend for iicbus. r262559: Inspired by r262522, fix make depend. This fixes the build of gpio modules. Added: stable/10/sys/dev/gpio/ofw_gpiobus.c - copied, changed from r261842, head/sys/dev/gpio/ofw_gpiobus.c Modified: stable/10/share/man/man4/gpioiic.4 stable/10/share/man/man4/gpioled.4 stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c stable/10/sys/arm/conf/BEAGLEBONE stable/10/sys/arm/ti/ti_gpio.c stable/10/sys/boot/fdt/dts/beaglebone-black.dts stable/10/sys/boot/fdt/dts/bindings-gpio.txt stable/10/sys/conf/files stable/10/sys/dev/gpio/gpiobus.c stable/10/sys/dev/gpio/gpiobusvar.h stable/10/sys/dev/gpio/gpioiic.c stable/10/sys/dev/gpio/gpioled.c stable/10/sys/dev/iicbus/iicbb.c stable/10/sys/dev/ofw/ofw_bus_if.m stable/10/sys/dev/ofw/ofw_iicbus.c stable/10/sys/modules/gpio/gpiobus/Makefile stable/10/sys/modules/gpio/gpioiic/Makefile stable/10/sys/modules/gpio/gpioled/Makefile stable/10/sys/modules/i2c/iicbb/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/gpioiic.4 ============================================================================== --- stable/10/share/man/man4/gpioiic.4 Thu May 15 01:27:24 2014 (r266104) +++ stable/10/share/man/man4/gpioiic.4 Thu May 15 01:27:53 2014 (r266105) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2013 +.Dd February 13, 2014 .Dt GPIOIIC 4 .Os .Sh NAME @@ -65,7 +65,7 @@ This is a bitmask of the pins on the that are to be used for SCLOCK and SDATA from the GPIO IIC bit-banging bus. To configure pin 0 and 7, use the bitmask of -10000001 and convert it to a hexadecimal value of 0x0081. +0b10000001 and convert it to a hexadecimal value of 0x0081. Please note that this mask should only ever have two bits set (any others bits - i.e., pins - will be ignored). .It Va hint.gpioiic.%d.scl @@ -73,13 +73,77 @@ Indicates which bit in the .Va hint.gpioiic.%d.pins should be used as the SCLOCK source. +Optional, defaults to 0. .It Va hint.gpioiic.%d.sda Indicates which bit in the .Va hint.gpioiic.%d.pins should be used as the SDATA source. +Optional, defaults to 1. +.El +.Pp +On a +.Xr FDT 4 +based system, like +.Li ARM , the dts part for a +.Nm gpioiic +device usually looks like: +.Bd -literal +gpio: gpio { + + gpio-controller; + ... + + gpioiic0 { + compatible = "gpioiic"; + /* + * Attach to GPIO pins 21 and 22. Set them + * initially as inputs. + */ + gpios = <&gpio 21 1 0 + &gpio 22 1 0>; + scl = <0>; /* GPIO pin 21 - optional */ + sda = <1>; /* GPIO pin 22 - optional */ + + /* This is an example of a gpioiic child. */ + gpioiic-child0 { + compatible = "lm75"; + i2c-address = <0x4f>; + }; + }; +}; +.Ed +.Pp +Where: +.Bl -tag -width ".Va compatible" +.It Va compatible +Should always be set to "gpioiic". +.It Va gpios +The +.Va gpios +property indicates which GPIO pins should be used for SCLOCK and SDATA +on the GPIO IIC bit-banging bus. +For more details about the +.Va gpios +property, please consult +.Pa /usr/src/sys/boot/fdt/dts/bindings-gpio.txt . +.It Va scl +The +.Va scl +option indicates which bit in the +.Va gpios +should be used as the SCLOCK source. +Optional, defaults to 0. +.It Va sda +The +.Va sda +option indicates which bit in the +.Va gpios +should be used as the SDATA source. +Optional, defaults to 1. .El .Sh SEE ALSO +.Xr fdt 4 , .Xr gpio 4 , .Xr gpioled 4 , .Xr iic 4 , Modified: stable/10/share/man/man4/gpioled.4 ============================================================================== --- stable/10/share/man/man4/gpioled.4 Thu May 15 01:27:24 2014 (r266104) +++ stable/10/share/man/man4/gpioled.4 Thu May 15 01:27:53 2014 (r266105) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2013 +.Dd February 13, 2014 .Dt GPIOLED 4 .Os .Sh NAME @@ -68,7 +68,75 @@ Which pin on the GPIO interface to map t Please note that this mask should only ever have one bit set (any others bits - i.e., pins - will be ignored). .El +.Pp +On a +.Xr FDT 4 +based system, like +.Li ARM , the dts part for a +.Nm gpioled +device usually looks like: +.Bd -literal +gpio: gpio { + + gpio-controller; + ... + + led0 { + compatible = "gpioled"; + gpios = <&gpio 16 2 0>; /* GPIO pin 16. */ + name = "ok"; + }; + + led1 { + compatible = "gpioled"; + gpios = <&gpio 17 2 0>; /* GPIO pin 17. */ + name = "user-led1"; + }; +}; +.Ed +.Pp +And optionally, you can choose combine all the leds under a single +.Dq gpio-leds +compatible node: +.Bd -literal +simplebus0 { + + ... + + leds { + compatible = "gpio-leds"; + + led0 { + gpios = <&gpio 16 2 0>; + name = "ok" + }; + + led1 { + gpios = <&gpio 17 2 0>; + name = "user-led1" + }; + }; +}; +.Ed +.Pp +Both methods are equally supported and it is possible to have the leds +defined with any sort of mix between the methods. +The only restriction is that a GPIO pin cannot be mapped by two different +(gpio)leds. +.Pp +For more details about the +.Va gpios +property, please consult +.Pa /usr/src/sys/boot/fdt/dts/bindings-gpio.txt . +.Pp +The property +.Va name +is the arbitrary name of device in +.Pa /dev/led/ +to create for +.Xr led 4 . .Sh SEE ALSO +.Xr fdt 4 , .Xr gpio 4 , .Xr led 4 , .Xr gpioiic 4 Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Thu May 15 01:27:53 2014 (r266105) @@ -762,6 +762,14 @@ bcm_gpio_detach(device_t dev) return (EBUSY); } +static phandle_t +bcm_gpio_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the GPIO bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} + static device_method_t bcm_gpio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bcm_gpio_probe), @@ -778,6 +786,9 @@ static device_method_t bcm_gpio_methods[ DEVMETHOD(gpio_pin_set, bcm_gpio_pin_set), DEVMETHOD(gpio_pin_toggle, bcm_gpio_pin_toggle), + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, bcm_gpio_get_node), + DEVMETHOD_END }; Modified: stable/10/sys/arm/conf/BEAGLEBONE ============================================================================== --- stable/10/sys/arm/conf/BEAGLEBONE Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/arm/conf/BEAGLEBONE Thu May 15 01:27:53 2014 (r266105) @@ -101,6 +101,7 @@ device am335x_pmic # AM335x Power Mana # GPIO device gpio +device gpioled # USB support device usb Modified: stable/10/sys/arm/ti/ti_gpio.c ============================================================================== --- stable/10/sys/arm/ti/ti_gpio.c Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/arm/ti/ti_gpio.c Thu May 15 01:27:53 2014 (r266105) @@ -543,9 +543,9 @@ ti_gpio_pin_get(device_t dev, uint32_t p /* Read the value on the pin */ if (val & mask) - *value = (ti_gpio_read_4(sc, bank, TI_GPIO_DATAOUT) & mask) ? 1 : 0; - else *value = (ti_gpio_read_4(sc, bank, TI_GPIO_DATAIN) & mask) ? 1 : 0; + else + *value = (ti_gpio_read_4(sc, bank, TI_GPIO_DATAOUT) & mask) ? 1 : 0; TI_GPIO_UNLOCK(sc); @@ -788,6 +788,14 @@ ti_gpio_detach(device_t dev) return(0); } +static phandle_t +ti_gpio_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the GPIO bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} + static device_method_t ti_gpio_methods[] = { DEVMETHOD(device_probe, ti_gpio_probe), DEVMETHOD(device_attach, ti_gpio_attach), @@ -802,6 +810,10 @@ static device_method_t ti_gpio_methods[] DEVMETHOD(gpio_pin_get, ti_gpio_pin_get), DEVMETHOD(gpio_pin_set, ti_gpio_pin_set), DEVMETHOD(gpio_pin_toggle, ti_gpio_pin_toggle), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, ti_gpio_get_node), + {0, 0}, }; Modified: stable/10/sys/boot/fdt/dts/beaglebone-black.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/beaglebone-black.dts Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/boot/fdt/dts/beaglebone-black.dts Thu May 15 01:27:53 2014 (r266105) @@ -153,6 +153,30 @@ } }; + leds { + compatible = "gpio-leds"; + + led1 { + gpios = <&GPIO 53 2 0>; + name = "led1"; + }; + + led2 { + gpios = <&GPIO 54 2 0>; + name = "led2"; + }; + + led3 { + gpios = <&GPIO 55 2 0>; + name = "led3"; + }; + + led4 { + gpios = <&GPIO 56 2 0>; + name = "led4"; + }; + }; + chosen { stdin = "uart0"; stdout = "uart0"; Modified: stable/10/sys/boot/fdt/dts/bindings-gpio.txt ============================================================================== --- stable/10/sys/boot/fdt/dts/bindings-gpio.txt Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/boot/fdt/dts/bindings-gpio.txt Thu May 15 01:27:53 2014 (r266105) @@ -82,7 +82,7 @@ dir: flags: 0x0000---- IN_NONE - 0x0001---- IN_POL_LOW Polarity low (inverted input value. + 0x0001---- IN_POL_LOW Polarity low (active-low). 0x0002---- IN_IRQ_EDGE Interrupt, edge triggered. 0x0004---- IN_IRQ_LEVEL Interrupt, level triggered. Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/conf/files Thu May 15 01:27:53 2014 (r266105) @@ -1439,6 +1439,7 @@ dev/gpio/gpioiic.c optional gpioiic dev/gpio/gpioled.c optional gpioled dev/gpio/gpio_if.m optional gpio dev/gpio/gpiobus_if.m optional gpio +dev/gpio/ofw_gpiobus.c optional fdt gpio dev/hatm/if_hatm.c optional hatm pci dev/hatm/if_hatm_intr.c optional hatm pci dev/hatm/if_hatm_ioctl.c optional hatm pci Modified: stable/10/sys/dev/gpio/gpiobus.c ============================================================================== --- stable/10/sys/dev/gpio/gpiobus.c Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/dev/gpio/gpiobus.c Thu May 15 01:27:53 2014 (r266105) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" #include "gpiobus_if.h" -static void gpiobus_print_pins(struct gpiobus_ivar *); static int gpiobus_parse_pins(struct gpiobus_softc *, device_t, int); static int gpiobus_probe(device_t); static int gpiobus_attach(device_t); @@ -73,17 +72,7 @@ static int gpiobus_pin_set(device_t, dev static int gpiobus_pin_get(device_t, device_t, uint32_t, unsigned int*); static int gpiobus_pin_toggle(device_t, device_t, uint32_t); -#define GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define GPIOBUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define GPIOBUS_LOCK_INIT(_sc) \ - mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ - "gpiobus", MTX_DEF) -#define GPIOBUS_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define GPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define GPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); - - -static void +void gpiobus_print_pins(struct gpiobus_ivar *devi) { int range_start, range_stop, need_coma; @@ -175,7 +164,8 @@ static int gpiobus_probe(device_t dev) { device_set_desc(dev, "GPIO bus"); - return (0); + + return (BUS_PROBE_GENERIC); } static int @@ -190,13 +180,13 @@ gpiobus_attach(device_t dev) if (res) return (ENXIO); + KASSERT(sc->sc_npins != 0, ("GPIO device with no pins")); + /* * Increase to get number of pins */ sc->sc_npins++; - KASSERT(sc->sc_npins != 0, ("GPIO device with no pins")); - sc->sc_pins_mapped = malloc(sizeof(int) * sc->sc_npins, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -209,7 +199,9 @@ gpiobus_attach(device_t dev) /* * Get parent's pins and mark them as unmapped */ + bus_generic_probe(dev); bus_enumerate_hinted_children(dev); + return (bus_generic_attach(dev)); } Modified: stable/10/sys/dev/gpio/gpiobusvar.h ============================================================================== --- stable/10/sys/dev/gpio/gpiobusvar.h Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/dev/gpio/gpiobusvar.h Thu May 15 01:27:53 2014 (r266105) @@ -30,12 +30,25 @@ #ifndef __GPIOBUS_H__ #define __GPIOBUS_H__ +#include "opt_platform.h" + #include #include #include -#define GPIOBUS_IVAR(d) (struct gpiobus_ivar *) device_get_ivars(d) -#define GPIOBUS_SOFTC(d) (struct gpiobus_softc *) device_get_softc(d) +#ifdef FDT +#include +#endif + +#define GPIOBUS_IVAR(d) (struct gpiobus_ivar *) device_get_ivars(d) +#define GPIOBUS_SOFTC(d) (struct gpiobus_softc *) device_get_softc(d) +#define GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define GPIOBUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define GPIOBUS_LOCK_INIT(_sc) mtx_init(&_sc->sc_mtx, \ + device_get_nameunit(_sc->sc_dev), "gpiobus", MTX_DEF) +#define GPIOBUS_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx) +#define GPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) +#define GPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED) struct gpiobus_softc { @@ -54,4 +67,11 @@ struct gpiobus_ivar uint32_t *pins; /* pins map */ }; +void gpiobus_print_pins(struct gpiobus_ivar *); +#ifdef FDT +device_t ofw_gpiobus_add_fdt_child(device_t, phandle_t); +#endif + +extern driver_t gpiobus_driver; + #endif /* __GPIOBUS_H__ */ Modified: stable/10/sys/dev/gpio/gpioiic.c ============================================================================== --- stable/10/sys/dev/gpio/gpioiic.c Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/dev/gpio/gpioiic.c Thu May 15 01:27:53 2014 (r266105) @@ -28,21 +28,24 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include -#include #include #include #include -#include -#include -#include #include -#include #include #include "gpiobus_if.h" +#ifdef FDT +#include +#include +#include +#endif + #include #include @@ -55,7 +58,6 @@ struct gpioiic_softc { device_t sc_dev; device_t sc_busdev; - struct cdev *sc_leddev; int scl_pin; int sda_pin; }; @@ -77,7 +79,12 @@ static int gpioiic_probe(device_t dev) { +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "gpioiic")) + return (ENXIO); +#endif device_set_desc(dev, "GPIO I2C bit-banging driver"); + return (0); } @@ -86,6 +93,10 @@ gpioiic_attach(device_t dev) { struct gpioiic_softc *sc = device_get_softc(dev); device_t bitbang; +#ifdef FDT + phandle_t node; + pcell_t pin; +#endif sc->sc_dev = dev; sc->sc_busdev = device_get_parent(dev); @@ -96,6 +107,15 @@ gpioiic_attach(device_t dev) device_get_unit(dev), "sda", &sc->sda_pin)) sc->sda_pin = SDA_PIN_DEFAULT; +#ifdef FDT + if ((node = ofw_bus_get_node(dev)) == -1) + return (ENXIO); + if (OF_getencprop(node, "scl", &pin, sizeof(pin)) > 0) + sc->scl_pin = (int)pin; + if (OF_getencprop(node, "sda", &pin, sizeof(pin)) > 0) + sc->sda_pin = (int)pin; +#endif + /* add generic bit-banging code */ bitbang = device_add_child(dev, "iicbb", -1); device_probe_and_attach(bitbang); @@ -139,7 +159,7 @@ gpioiic_callback(device_t dev, int index error = EINVAL; } - return(error); + return (error); } static void @@ -214,6 +234,16 @@ gpioiic_reset(device_t dev, u_char speed return (IIC_ENOADDR); } +#ifdef FDT +static phandle_t +gpioiic_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the iicbb, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} +#endif + static devclass_t gpioiic_devclass; static device_method_t gpioiic_methods[] = { @@ -230,6 +260,11 @@ static device_method_t gpioiic_methods[] DEVMETHOD(iicbb_getscl, gpioiic_getscl), DEVMETHOD(iicbb_reset, gpioiic_reset), +#ifdef FDT + /* OFW bus interface */ + DEVMETHOD(ofw_bus_get_node, gpioiic_get_node), +#endif + { 0, 0 } }; Modified: stable/10/sys/dev/gpio/gpioled.c ============================================================================== --- stable/10/sys/dev/gpio/gpioled.c Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/dev/gpio/gpioled.c Thu May 15 01:27:53 2014 (r266105) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -39,6 +41,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + #include #include #include "gpiobus_if.h" @@ -75,6 +83,8 @@ gpioled_control(void *priv, int onoff) GPIOLED_LOCK(sc); GPIOBUS_LOCK_BUS(sc->sc_busdev); GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev); + GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, + GPIO_PIN_OUTPUT); GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, onoff ? GPIO_PIN_HIGH : GPIO_PIN_LOW); GPIOBUS_RELEASE_BUS(sc->sc_busdev, sc->sc_dev); @@ -82,10 +92,65 @@ gpioled_control(void *priv, int onoff) GPIOLED_UNLOCK(sc); } +#ifdef FDT +static void +gpioled_identify(driver_t *driver, device_t bus) +{ + phandle_t child, leds, root; + + root = OF_finddevice("/"); + if (root == 0) + return; + leds = fdt_find_compatible(root, "gpio-leds", 1); + if (leds == 0) + return; + + /* Traverse the 'gpio-leds' node and add its children. */ + for (child = OF_child(leds); child != 0; child = OF_peer(child)) + if (ofw_gpiobus_add_fdt_child(bus, child) == NULL) + continue; +} +#endif + static int gpioled_probe(device_t dev) { +#ifdef FDT + int match; + phandle_t node; + char *compat; + + /* + * We can match against our own node compatible string and also against + * our parent node compatible string. The first is normally used to + * describe leds on a gpiobus and the later when there is a common node + * compatible with 'gpio-leds' which is used to concentrate all the + * leds nodes on the dts. + */ + match = 0; + if (ofw_bus_is_compatible(dev, "gpioled")) + match = 1; + + if (match == 0) { + if ((node = ofw_bus_get_node(dev)) == -1) + return (ENXIO); + if ((node = OF_parent(node)) == -1) + return (ENXIO); + if (OF_getprop_alloc(node, "compatible", 1, + (void **)&compat) == -1) + return (ENXIO); + + if (strcasecmp(compat, "gpio-leds") == 0) + match = 1; + + free(compat, M_OFWPROP); + } + + if (match == 0) + return (ENXIO); +#endif device_set_desc(dev, "GPIO led"); + return (0); } @@ -93,21 +158,35 @@ static int gpioled_attach(device_t dev) { struct gpioled_softc *sc; +#ifdef FDT + phandle_t node; + char *name; +#else const char *name; +#endif sc = device_get_softc(dev); sc->sc_dev = dev; sc->sc_busdev = device_get_parent(dev); GPIOLED_LOCK_INIT(sc); +#ifdef FDT + name = NULL; + if ((node = ofw_bus_get_node(dev)) == -1) + return (ENXIO); + if (OF_getprop_alloc(node, "label", 1, (void **)&name) == -1) + OF_getprop_alloc(node, "name", 1, (void **)&name); +#else if (resource_string_value(device_get_name(dev), device_get_unit(dev), "name", &name)) name = NULL; - - GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, - GPIO_PIN_OUTPUT); +#endif sc->sc_leddev = led_create(gpioled_control, sc, name ? name : device_get_nameunit(dev)); +#ifdef FDT + if (name != NULL) + free(name, M_OFWPROP); +#endif return (0); } @@ -130,6 +209,9 @@ static devclass_t gpioled_devclass; static device_method_t gpioled_methods[] = { /* Device interface */ +#ifdef FDT + DEVMETHOD(device_identify, gpioled_identify), +#endif DEVMETHOD(device_probe, gpioled_probe), DEVMETHOD(device_attach, gpioled_attach), DEVMETHOD(device_detach, gpioled_detach), Copied and modified: stable/10/sys/dev/gpio/ofw_gpiobus.c (from r261842, head/sys/dev/gpio/ofw_gpiobus.c) ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu Feb 13 17:08:29 2014 (r261842, copy source) +++ stable/10/sys/dev/gpio/ofw_gpiobus.c Thu May 15 01:27:53 2014 (r266105) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: stable/10/sys/dev/iicbus/iicbb.c ============================================================================== --- stable/10/sys/dev/iicbus/iicbb.c Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/dev/iicbus/iicbb.c Thu May 15 01:27:53 2014 (r266105) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); * */ +#include "opt_platform.h" + #include #include #include @@ -50,6 +52,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif #include #include @@ -77,6 +84,9 @@ static int iicbb_write(device_t, const c static int iicbb_read(device_t, char *, int, int *, int, int); static int iicbb_reset(device_t, u_char, u_char, u_char *); static int iicbb_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs); +#ifdef FDT +static phandle_t iicbb_get_node(device_t, device_t); +#endif static device_method_t iicbb_methods[] = { /* device interface */ @@ -98,6 +108,11 @@ static device_method_t iicbb_methods[] = DEVMETHOD(iicbus_reset, iicbb_reset), DEVMETHOD(iicbus_transfer, iicbb_transfer), +#ifdef FDT + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, iicbb_get_node), +#endif + { 0, 0 } }; @@ -154,6 +169,16 @@ iicbb_detach(device_t dev) return (0); } +#ifdef FDT +static phandle_t +iicbb_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the I2C bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} +#endif + static void iicbb_child_detached( device_t dev, device_t child ) { Modified: stable/10/sys/dev/ofw/ofw_bus_if.m ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_if.m Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/dev/ofw/ofw_bus_if.m Thu May 15 01:27:53 2014 (r266105) @@ -158,7 +158,7 @@ METHOD const char * get_name { } DEFAULT ofw_bus_default_get_name; # Get the firmware node for the device dev on the bus. The default method will -# return 0, which signals that there is no such node. +# return -1, which signals that there is no such node. METHOD phandle_t get_node { device_t bus; device_t dev; Modified: stable/10/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_iicbus.c Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/dev/ofw/ofw_iicbus.c Thu May 15 01:27:53 2014 (r266105) @@ -80,6 +80,7 @@ static devclass_t ofwiicbus_devclass; DEFINE_CLASS_1(iicbus, ofw_iicbus_driver, ofw_iicbus_methods, sizeof(struct iicbus_softc), iicbus_driver); +DRIVER_MODULE(ofw_iicbus, iicbb, ofw_iicbus_driver, ofwiicbus_devclass, 0, 0); DRIVER_MODULE(ofw_iicbus, iichb, ofw_iicbus_driver, ofwiicbus_devclass, 0, 0); MODULE_VERSION(ofw_iicbus, 1); MODULE_DEPEND(ofw_iicbus, iicbus, 1, 1, 1); Modified: stable/10/sys/modules/gpio/gpiobus/Makefile ============================================================================== --- stable/10/sys/modules/gpio/gpiobus/Makefile Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/modules/gpio/gpiobus/Makefile Thu May 15 01:27:53 2014 (r266105) @@ -33,7 +33,7 @@ KMOD= gpiobus SRCS= gpiobus.c -SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ Modified: stable/10/sys/modules/gpio/gpioiic/Makefile ============================================================================== --- stable/10/sys/modules/gpio/gpioiic/Makefile Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/modules/gpio/gpioiic/Makefile Thu May 15 01:27:53 2014 (r266105) @@ -34,6 +34,7 @@ KMOD= gpioiic SRCS= gpioiic.c SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h iicbus_if.h iicbb_if.h +SRCS+= opt_platform.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ Modified: stable/10/sys/modules/gpio/gpioled/Makefile ============================================================================== --- stable/10/sys/modules/gpio/gpioled/Makefile Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/modules/gpio/gpioled/Makefile Thu May 15 01:27:53 2014 (r266105) @@ -33,7 +33,7 @@ KMOD= gpioled SRCS= gpioled.c -SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ Modified: stable/10/sys/modules/i2c/iicbb/Makefile ============================================================================== --- stable/10/sys/modules/i2c/iicbb/Makefile Thu May 15 01:27:24 2014 (r266104) +++ stable/10/sys/modules/i2c/iicbb/Makefile Thu May 15 01:27:53 2014 (r266105) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../../dev/iicbus KMOD = iicbb SRCS = device_if.h bus_if.h iicbus_if.h \ - iicbb_if.h iicbb_if.c iicbb.c + iicbb_if.h iicbb_if.c iicbb.c opt_platform.h .include From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 01:37:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E772341F; Thu, 15 May 2014 01:37: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 D479C21C7; Thu, 15 May 2014 01:37: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 s4F1bHSH077145; Thu, 15 May 2014 01:37:17 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F1bHI6077142; Thu, 15 May 2014 01:37:17 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405150137.s4F1bHI6077142@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 15 May 2014 01:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266106 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 01:37:18 -0000 Author: loos Date: Thu May 15 01:37:17 2014 New Revision: 266106 URL: http://svnweb.freebsd.org/changeset/base/266106 Log: MFC r266092 gpioiic.4 and gpioled.4 will first appear in 10.1-RELEASE. Modified: stable/10/share/man/man4/gpioiic.4 stable/10/share/man/man4/gpioled.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/gpioiic.4 ============================================================================== --- stable/10/share/man/man4/gpioiic.4 Thu May 15 01:27:53 2014 (r266105) +++ stable/10/share/man/man4/gpioiic.4 Thu May 15 01:37:17 2014 (r266106) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2014 +.Dd May 14, 2014 .Dt GPIOIIC 4 .Os .Sh NAME @@ -153,7 +153,7 @@ Optional, defaults to 1. The .Nm manual page first appeared in -.Fx 11.0 . +.Fx 10.1 . .Sh AUTHORS This manual page was written by Modified: stable/10/share/man/man4/gpioled.4 ============================================================================== --- stable/10/share/man/man4/gpioled.4 Thu May 15 01:27:53 2014 (r266105) +++ stable/10/share/man/man4/gpioled.4 Thu May 15 01:37:17 2014 (r266106) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2014 +.Dd May 14, 2014 .Dt GPIOLED 4 .Os .Sh NAME @@ -144,7 +144,7 @@ to create for The .Nm manual page first appeared in -.Fx 11.0 . +.Fx 10.1 . .Sh AUTHORS This manual page was written by From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 01:58:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C6F6B68F; Thu, 15 May 2014 01:58:54 +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 9A24D2323; Thu, 15 May 2014 01:58:54 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Wkkwf-000GSH-9r; Thu, 15 May 2014 01:58:53 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s4F1wpTG037306; Wed, 14 May 2014 19:58:51 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 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+KN7kyyh8TN3vLanPoy0sm Subject: Re: svn commit: r266098 - stable/10/sys/arm/ti From: Ian Lepore To: Bruce Simpson In-Reply-To: <53740645.7060003@fastmail.net> References: <201405142357.s4ENv8sh031217@svn.freebsd.org> <53740645.7060003@fastmail.net> Content-Type: text/plain; charset="us-ascii" Date: Wed, 14 May 2014 19:58:50 -0600 Message-ID: <1400119130.56626.28.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-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-10@FreeBSD.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 01:58:54 -0000 On Wed, 2014-05-14 at 17:11 -0700, Bruce Simpson wrote: > On 14/05/2014 16:57, Ian Lepore wrote: > > TI Programmable Realtime Unit Subsystem. > OK, so PRUSS is one vowel change away from the name of a killer android > in a work by Philip K. Dick. > > Are there applications for this driver? I'm just curious having skimmed > this document [1]: > > "The PRU subsystem on the OMAP-L1x processors, C674x DSPs, and AM1x > Sitara ARM MPUs allows the application developer to implement soft > peripherals; peripherals implemented using a combination of on-chip > hardware and software." > > [1] http://www.ti.com/lit/wp/spry136a/spry136a.pdf > I don't know anything about it myself, I'm just syncing up all the ARM changes from the past few months into 10-stable. -- Ian From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 02:41:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DCEF9F59; Thu, 15 May 2014 02:41: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 C645125DD; Thu, 15 May 2014 02:41: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 s4F2fYhm005309; Thu, 15 May 2014 02:41:34 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F2fNTq005242; Thu, 15 May 2014 02:41:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405150241.s4F2fNTq005242@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 02:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266110 - in stable/10/sys: arm/allwinner arm/allwinner/a20 arm/arm arm/at91 arm/broadcom/bcm2835 arm/conf arm/econa arm/freescale/imx arm/freescale/vybrid arm/lpc arm/mv/armadaxp arm/m... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 02:41:35 -0000 Author: ian Date: Thu May 15 02:41:23 2014 New Revision: 266110 URL: http://svnweb.freebsd.org/changeset/base/266110 Log: MFC r261252, r261279, r261304, r261305, r261322, r261336, r261337, r261338, r261353 Fix the name of the dts file for the HL201... When mapping an address, the bsh needs the same offset we do for other things. Add explicit depends on bus_if.h and device_if.h to avoid a chicken and egg problem in some compilation environments. Switch to using PAs rather than VAs for the addresses we map for devices. This is a nop, except for what's reported by atmelbus for the resources. Comment cleanups. Move things around for diff reduction against FDT work. Modified: stable/10/sys/arm/allwinner/a20/std.a20 stable/10/sys/arm/allwinner/std.a10 stable/10/sys/arm/arm/genassym.c stable/10/sys/arm/arm/locore.S stable/10/sys/arm/at91/at91.c stable/10/sys/arm/at91/at91_machdep.c stable/10/sys/arm/at91/at91rm92reg.h stable/10/sys/arm/at91/at91sam9260reg.h stable/10/sys/arm/at91/at91sam9g20reg.h stable/10/sys/arm/at91/at91sam9g45reg.h stable/10/sys/arm/at91/std.bwct stable/10/sys/arm/at91/std.eb9200 stable/10/sys/arm/at91/std.ethernut5 stable/10/sys/arm/at91/std.hl200 stable/10/sys/arm/at91/std.hl201 stable/10/sys/arm/at91/std.kb920x stable/10/sys/arm/at91/std.qila9g20 stable/10/sys/arm/at91/std.sam9260ek stable/10/sys/arm/at91/std.sam9g20ek stable/10/sys/arm/at91/std.sam9x25ek stable/10/sys/arm/at91/std.sn9g45 stable/10/sys/arm/at91/std.tsc4370 stable/10/sys/arm/broadcom/bcm2835/std.rpi stable/10/sys/arm/conf/ATMEL stable/10/sys/arm/conf/CNS11XXNAS stable/10/sys/arm/conf/CRB stable/10/sys/arm/conf/EP80219 stable/10/sys/arm/conf/GUMSTIX stable/10/sys/arm/conf/HL201 stable/10/sys/arm/conf/IQ31244 stable/10/sys/arm/conf/NSLU stable/10/sys/arm/conf/VERSATILEPB stable/10/sys/arm/econa/std.econa stable/10/sys/arm/freescale/imx/std.imx51 stable/10/sys/arm/freescale/imx/std.imx53 stable/10/sys/arm/freescale/imx/std.imx6 stable/10/sys/arm/freescale/vybrid/std.vybrid stable/10/sys/arm/lpc/std.lpc stable/10/sys/arm/mv/armadaxp/std.armadaxp stable/10/sys/arm/mv/discovery/std.db78xxx stable/10/sys/arm/mv/kirkwood/std.kirkwood stable/10/sys/arm/mv/orion/std.db88f5xxx stable/10/sys/arm/mv/orion/std.ts7800 stable/10/sys/arm/rockchip/std.rk30xx stable/10/sys/arm/s3c2xx0/std.ln2410sbc stable/10/sys/arm/samsung/exynos/std.exynos5 stable/10/sys/arm/tegra/std.tegra2 stable/10/sys/arm/ti/am335x/std.am335x stable/10/sys/arm/ti/omap4/std.omap4 stable/10/sys/arm/xilinx/std.zynq7 stable/10/sys/arm/xscale/ixp425/std.avila stable/10/sys/conf/Makefile.arm stable/10/sys/conf/ldscript.arm stable/10/sys/conf/options.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/allwinner/a20/std.a20 ============================================================================== --- stable/10/sys/arm/allwinner/a20/std.a20 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/allwinner/a20/std.a20 Thu May 15 02:41:23 2014 (r266110) @@ -16,8 +16,6 @@ options KERNPHYSADDR=0x40200000 makeoptions KERNVIRTADDR=0xc0200000 options KERNVIRTADDR=0xc0200000 -options STARTUP_PAGETABLE_ADDR=0x48000000 - options ARM_L2_PIPT options IPI_IRQ_START=0 Modified: stable/10/sys/arm/allwinner/std.a10 ============================================================================== --- stable/10/sys/arm/allwinner/std.a10 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/allwinner/std.a10 Thu May 15 02:41:23 2014 (r266110) @@ -16,6 +16,4 @@ options KERNPHYSADDR=0x40200000 makeoptions KERNVIRTADDR=0xc0200000 options KERNVIRTADDR=0xc0200000 -options STARTUP_PAGETABLE_ADDR=0x48000000 - files "../allwinner/files.a10" Modified: stable/10/sys/arm/arm/genassym.c ============================================================================== --- stable/10/sys/arm/arm/genassym.c Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/arm/genassym.c Thu May 15 02:41:23 2014 (r266110) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/arm/locore.S Thu May 15 02:41:23 2014 (r266110) @@ -144,9 +144,15 @@ disable_mmu: nop mov pc, r7 Lunmapped: -#ifdef STARTUP_PAGETABLE_ADDR - /* build page table from scratch */ - ldr r0, Lstartup_pagetable + /* + * Build page table from scratch. + */ + + /* Load the page tables physical address */ + ldr r1, Lstartup_pagetable + ldr r2, =(KERNVIRTADDR - KERNPHYSADDR) + sub r0, r1, r2 + adr r4, mmu_init_table b 3f @@ -197,7 +203,6 @@ Lunmapped: nop CPWAIT(r0) -#endif mmu_done: nop adr r1, .Lstart @@ -231,7 +236,6 @@ virt_done: adr r0, .Lmainreturned b _C_LABEL(panic) /* NOTREACHED */ -#ifdef STARTUP_PAGETABLE_ADDR #define MMU_INIT(va,pa,n_sec,attr) \ .word n_sec ; \ .word 4*((va)>>L1_S_SHIFT) ; \ @@ -246,7 +250,7 @@ Lreal_start: Lend: .word _edata Lstartup_pagetable: - .word STARTUP_PAGETABLE_ADDR + .word pagetable #ifdef SMP Lstartup_pagetable_secondary: .word temp_pagetable @@ -261,9 +265,9 @@ mmu_init_table: MMU_INIT(PHYSADDR, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) /* map VA 0xc0000000..0xc3ffffff to PA */ MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#if defined(SOCDEV_PA) && defined(SOCKDEV_VA) +#if defined(SOCDEV_PA) && defined(SOCDEV_VA) /* Map in 0x04000000 worth of the SoC's devices for bootstrap debugging */ - MMU_INIT(SOCKDEV_VA, SOCDEV_PA, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) + MMU_INIT(SOCDEV_VA, SOCDEV_PA, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) #endif #else MMU_INIT(PHYSADDR, PHYSADDR , 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) @@ -272,10 +276,9 @@ mmu_init_table: MMU_INIT(0x48000000, 0x48000000, 1, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) #endif /* SMP */ .word 0 /* end of table */ -#endif .Lstart: .word _edata - .word _end + .word _ebss .word svcstk + INIT_ARM_STACK_SIZE .Lvirt_done: @@ -293,6 +296,15 @@ mmu_init_table: svcstk: .space INIT_ARM_STACK_SIZE +/* + * Memory for the initial pagetable. We are unable to place this in + * the bss as this will be cleared after the table is loaded. + */ + .section ".init_pagetable" + .align 14 /* 16KiB aligned */ +pagetable: + .space L1_TABLE_SIZE + .text .align 0 Modified: stable/10/sys/arm/at91/at91.c ============================================================================== --- stable/10/sys/arm/at91/at91.c Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/at91.c Thu May 15 02:41:23 2014 (r266110) @@ -74,7 +74,7 @@ at91_bs_map(void *t, bus_addr_t bpa, bus } endpa = round_page(bpa + size); - *bshp = (vm_offset_t)pmap_mapdev(pa, endpa - pa); + *bshp = (vm_offset_t)pmap_mapdev(pa, endpa - pa) + (bpa - pa); return (0); } @@ -260,7 +260,6 @@ static int at91_attach(device_t dev) { struct at91_softc *sc = device_get_softc(dev); - const struct arm_devmap_entry *pdevmap; int i; arm_post_filter = at91_eoi; @@ -281,11 +280,15 @@ at91_attach(device_t dev) sc->sc_mem_rman.rm_descr = "AT91 Memory"; if (rman_init(&sc->sc_mem_rman) != 0) panic("at91_attach: failed to set up memory rman"); - for (pdevmap = at91_devmap; pdevmap->pd_va != 0; pdevmap++) { - if (rman_manage_region(&sc->sc_mem_rman, pdevmap->pd_va, - pdevmap->pd_va + pdevmap->pd_size - 1) != 0) - panic("at91_attach: failed to set up memory rman"); - } + /* + * Manage the physical space, defined as being everything that isn't + * DRAM. + */ + if (rman_manage_region(&sc->sc_mem_rman, 0, PHYSADDR - 1) != 0) + panic("at91_attach: failed to set up memory rman"); + if (rman_manage_region(&sc->sc_mem_rman, PHYSADDR + (256 << 20), + 0xfffffffful) != 0) + panic("at91_attach: failed to set up memory rman"); /* * Setup the interrupt table. @@ -330,6 +333,7 @@ at91_alloc_resource(device_t dev, device struct resource_list_entry *rle; struct at91_ivar *ivar = device_get_ivars(child); struct resource_list *rl = &ivar->resources; + bus_space_handle_t bsh; if (device_get_parent(child) != dev) return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, @@ -355,8 +359,10 @@ at91_alloc_resource(device_t dev, device rle->res = rman_reserve_resource(&sc->sc_mem_rman, start, end, count, flags, child); if (rle->res != NULL) { + bus_space_map(&at91_bs_tag, start, + rman_get_size(rle->res), 0, &bsh); rman_set_bustag(rle->res, &at91_bs_tag); - rman_set_bushandle(rle->res, start); + rman_set_bushandle(rle->res, bsh); } break; } @@ -538,8 +544,14 @@ at91_add_child(device_t dev, int prio, c bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); if (irq2 != 0) bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91_BASE) - addr += AT91_BASE; + /* + * Special case for on-board devices. These have their address + * defined relative to AT91_PA_BASE in all the register files we + * have. We could change this, but that's a lot of effort which + * will be obsoleted when FDT arrives. + */ + if (addr != 0 && addr < 0x10000000 && addr >= 0x0f000000) + addr += AT91_PA_BASE; if (addr != 0) bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); } Modified: stable/10/sys/arm/at91/at91_machdep.c ============================================================================== --- stable/10/sys/arm/at91/at91_machdep.c Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/at91_machdep.c Thu May 15 02:41:23 2014 (r266110) @@ -116,36 +116,22 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -/* Physical and virtual addresses for some global pages */ - -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; - -struct pv_addr systempage; -struct pv_addr msgbufpv; -struct pv_addr irqstack; -struct pv_addr undstack; -struct pv_addr abtstack; -struct pv_addr kernelstack; - /* Static device mappings. */ const struct arm_devmap_entry at91_devmap[] = { /* - * Map the on-board devices VA == PA so that we can access them - * with the MMU on or off. + * Map the critical on-board devices. The interrupt vector at + * 0xffff0000 makes it impossible to map them PA == VA, so we map all + * 0xfffxxxxx addresses to 0xdffxxxxx. This covers all critical devices + * on all members of the AT91SAM9 and AT91RM9200 families. */ { - /* - * This at least maps the interrupt controller, the UART - * and the timer. Other devices should use newbus to - * map their memory anyway. - */ 0xdff00000, 0xfff00000, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* There's a notion that we should do the rest of these lazily. */ /* * We can't just map the OHCI registers VA == PA, because * AT91xx_xxx_BASE belongs to the userland address space. @@ -163,16 +149,16 @@ const struct arm_devmap_entry at91_devma * on this chip select for a VA/PA mapping. */ /* Internal Memory 1MB */ + AT91RM92_OHCI_VA_BASE, AT91RM92_OHCI_BASE, - AT91RM92_OHCI_PA_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, { /* CompactFlash controller. Portion of EBI CS4 1MB */ + AT91RM92_CF_VA_BASE, AT91RM92_CF_BASE, - AT91RM92_CF_PA_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, @@ -183,16 +169,16 @@ const struct arm_devmap_entry at91_devma */ { /* Internal Memory 1MB */ + AT91SAM9G20_OHCI_VA_BASE, AT91SAM9G20_OHCI_BASE, - AT91SAM9G20_OHCI_PA_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, { /* EBI CS3 256MB */ + AT91SAM9G20_NAND_VA_BASE, AT91SAM9G20_NAND_BASE, - AT91SAM9G20_NAND_PA_BASE, AT91SAM9G20_NAND_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, @@ -202,8 +188,8 @@ const struct arm_devmap_entry at91_devma */ { /* Internal Memory 1MB */ + AT91SAM9G45_OHCI_VA_BASE, AT91SAM9G45_OHCI_BASE, - AT91SAM9G45_OHCI_PA_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, @@ -211,6 +197,18 @@ const struct arm_devmap_entry at91_devma { 0, 0, 0, 0, 0, } }; +/* Physical and virtual addresses for some global pages */ + +vm_paddr_t phys_avail[10]; +vm_paddr_t dump_avail[4]; + +struct pv_addr systempage; +struct pv_addr msgbufpv; +struct pv_addr irqstack; +struct pv_addr undstack; +struct pv_addr abtstack; +struct pv_addr kernelstack; + #ifdef LINUX_BOOT_ABI extern int membanks; extern int memstart[]; Modified: stable/10/sys/arm/at91/at91rm92reg.h ============================================================================== --- stable/10/sys/arm/at91/at91rm92reg.h Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/at91rm92reg.h Thu May 15 02:41:23 2014 (r266110) @@ -255,12 +255,12 @@ * other * soc's so phyical and vm address * mapping are unique. XXX */ -#define AT91RM92_OHCI_BASE 0xdfe00000 -#define AT91RM92_OHCI_PA_BASE 0x00300000 +#define AT91RM92_OHCI_VA_BASE 0xdfe00000 +#define AT91RM92_OHCI_BASE 0x00300000 #define AT91RM92_OHCI_SIZE 0x00100000 -#define AT91RM92_CF_BASE 0xdfd00000 -#define AT91RM92_CF_PA_BASE 0x51400000 +#define AT91RM92_CF_VA_BASE 0xdfd00000 +#define AT91RM92_CF_BASE 0x51400000 #define AT91RM92_CF_SIZE 0x00100000 /* SDRAMC */ Modified: stable/10/sys/arm/at91/at91sam9260reg.h ============================================================================== --- stable/10/sys/arm/at91/at91sam9260reg.h Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/at91sam9260reg.h Thu May 15 02:41:23 2014 (r266110) @@ -251,12 +251,12 @@ * other * soc's so phyical and vm address * mapping are unique. XXX */ -#define AT91SAM9260_OHCI_BASE 0xdfc00000 -#define AT91SAM9260_OHCI_PA_BASE 0x00500000 +#define AT91SAM9260_OHCI_VA_BASE 0xdfc00000 +#define AT91SAM9260_OHCI_BASE 0x00500000 #define AT91SAM9260_OHCI_SIZE 0x00100000 -#define AT91SAM9260_NAND_BASE 0xe0000000 -#define AT91SAM9260_NAND_PA_BASE 0x40000000 +#define AT91SAM9260_NAND_VA_BASE 0xe0000000 +#define AT91SAM9260_NAND_BASE 0x40000000 #define AT91SAM9260_NAND_SIZE 0x10000000 Modified: stable/10/sys/arm/at91/at91sam9g20reg.h ============================================================================== --- stable/10/sys/arm/at91/at91sam9g20reg.h Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/at91sam9g20reg.h Thu May 15 02:41:23 2014 (r266110) @@ -252,14 +252,13 @@ * other * soc's so phyical and vm address * mapping are unique. XXX */ -#define AT91SAM9G20_OHCI_BASE 0xdfc00000 -#define AT91SAM9G20_OHCI_PA_BASE 0x00500000 -#define AT91SAM9G20_OHCI_SIZE 0x00100000 - -#define AT91SAM9G20_NAND_BASE 0xe0000000 -#define AT91SAM9G20_NAND_PA_BASE 0x40000000 -#define AT91SAM9G20_NAND_SIZE 0x10000000 +#define AT91SAM9G20_OHCI_VA_BASE 0xdfc00000 +#define AT91SAM9G20_OHCI_BASE 0x00500000 +#define AT91SAM9G20_OHCI_SIZE 0x00100000 +#define AT91SAM9G20_NAND_VA_BASE 0xe0000000 +#define AT91SAM9G20_NAND_BASE 0x40000000 +#define AT91SAM9G20_NAND_SIZE 0x10000000 /* SDRAMC */ #define AT91SAM9G20_SDRAMC_BASE 0xfffea00 Modified: stable/10/sys/arm/at91/at91sam9g45reg.h ============================================================================== --- stable/10/sys/arm/at91/at91sam9g45reg.h Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/at91sam9g45reg.h Thu May 15 02:41:23 2014 (r266110) @@ -243,13 +243,13 @@ * other * soc's so phyical and vm address * mapping are unique. XXX */ -#define AT91SAM9G45_OHCI_BASE 0xdfb00000 -#define AT91SAM9G45_OHCI_PA_BASE 0x00700000 -#define AT91SAM9G45_OHCI_SIZE 0x00100000 +#define AT91SAM9G45_OHCI_VA_BASE 0xdfb00000 +#define AT91SAM9G45_OHCI_BASE 0x00700000 +#define AT91SAM9G45_OHCI_SIZE 0x00100000 -#define AT91SAM9G45_NAND_BASE 0xe0000000 -#define AT91SAM9G45_NAND_PA_BASE 0x40000000 -#define AT91SAM9G45_NAND_SIZE 0x10000000 +#define AT91SAM9G45_NAND_VA_BASE 0xe0000000 +#define AT91SAM9G45_NAND_BASE 0x40000000 +#define AT91SAM9G45_NAND_SIZE 0x10000000 /* DDRSDRC */ Modified: stable/10/sys/arm/at91/std.bwct ============================================================================== --- stable/10/sys/arm/at91/std.bwct Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.bwct Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ #$FreeBSD$ include "../at91/std.at91" -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 options KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 Modified: stable/10/sys/arm/at91/std.eb9200 ============================================================================== --- stable/10/sys/arm/at91/std.eb9200 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.eb9200 Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ #$FreeBSD$ include "../at91/std.at91" -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 options KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 Modified: stable/10/sys/arm/at91/std.ethernut5 ============================================================================== --- stable/10/sys/arm/at91/std.ethernut5 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.ethernut5 Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ # $FreeBSD$ include "../at91/std.at91sam9" -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 Modified: stable/10/sys/arm/at91/std.hl200 ============================================================================== --- stable/10/sys/arm/at91/std.hl200 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.hl200 Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ #$FreeBSD$ include "../at91/std.at91" -options STARTUP_PAGETABLE_ADDR=0x20000000 makeoptions KERNPHYSADDR=0x20100000 options KERNPHYSADDR=0x20100000 makeoptions KERNVIRTADDR=0xc0100000 Modified: stable/10/sys/arm/at91/std.hl201 ============================================================================== --- stable/10/sys/arm/at91/std.hl201 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.hl201 Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ #$FreeBSD$ include "../at91/std.at91sam9" -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 Modified: stable/10/sys/arm/at91/std.kb920x ============================================================================== --- stable/10/sys/arm/at91/std.kb920x Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.kb920x Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ #$FreeBSD$ include "../at91/std.at91" -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 options KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 Modified: stable/10/sys/arm/at91/std.qila9g20 ============================================================================== --- stable/10/sys/arm/at91/std.qila9g20 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.qila9g20 Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ #$FreeBSD$ include "../at91/std.at91sam9" -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 Modified: stable/10/sys/arm/at91/std.sam9260ek ============================================================================== --- stable/10/sys/arm/at91/std.sam9260ek Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.sam9260ek Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ # $FreeBSD$ include "../at91/std.at91sam9" -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 Modified: stable/10/sys/arm/at91/std.sam9g20ek ============================================================================== --- stable/10/sys/arm/at91/std.sam9g20ek Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.sam9g20ek Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ #$FreeBSD$ include "../at91/std.at91sam9" -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 Modified: stable/10/sys/arm/at91/std.sam9x25ek ============================================================================== --- stable/10/sys/arm/at91/std.sam9x25ek Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.sam9x25ek Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ #$FreeBSD$ include "../at91/std.at91sam9" -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 Modified: stable/10/sys/arm/at91/std.sn9g45 ============================================================================== --- stable/10/sys/arm/at91/std.sn9g45 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.sn9g45 Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ #$FreeBSD$ include "../at91/std.at91sam9g45" -options STARTUP_PAGETABLE_ADDR=0x70800000 makeoptions KERNPHYSADDR=0x70008000 options KERNPHYSADDR=0x70008000 makeoptions KERNVIRTADDR=0xc0008000 Modified: stable/10/sys/arm/at91/std.tsc4370 ============================================================================== --- stable/10/sys/arm/at91/std.tsc4370 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/at91/std.tsc4370 Thu May 15 02:41:23 2014 (r266110) @@ -1,7 +1,6 @@ #$FreeBSD$ include "../at91/std.at91" -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 Modified: stable/10/sys/arm/broadcom/bcm2835/std.rpi ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/std.rpi Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/broadcom/bcm2835/std.rpi Thu May 15 02:41:23 2014 (r266110) @@ -7,6 +7,5 @@ makeoptions KERNVIRTADDR=0xc0100000 options KERNPHYSADDR=0x00100000 makeoptions KERNPHYSADDR=0x00100000 options PHYSADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x01000000 options FREEBSD_BOOT_LOADER options LINUX_BOOT_ABI Modified: stable/10/sys/arm/conf/ATMEL ============================================================================== --- stable/10/sys/arm/conf/ATMEL Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/conf/ATMEL Thu May 15 02:41:23 2014 (r266110) @@ -10,7 +10,6 @@ include "../at91/std.atmel" # Typical values for most SoCs and board configurations. Will not work for # at91sam9g45 or on some boards with non u-boot boot loaders. -options STARTUP_PAGETABLE_ADDR=0x20800000 makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 Modified: stable/10/sys/arm/conf/CNS11XXNAS ============================================================================== --- stable/10/sys/arm/conf/CNS11XXNAS Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/conf/CNS11XXNAS Thu May 15 02:41:23 2014 (r266110) @@ -25,7 +25,6 @@ ident CNS11XXNAS #options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 -#options STARTUP_PAGETABLE_ADDR=0x10000000 include "../econa/std.econa" Modified: stable/10/sys/arm/conf/CRB ============================================================================== --- stable/10/sys/arm/conf/CRB Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/conf/CRB Thu May 15 02:41:23 2014 (r266110) @@ -24,7 +24,6 @@ options KERNPHYSADDR=0x00200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm options COUNTS_PER_SEC=400000000 -options STARTUP_PAGETABLE_ADDR=0x00000000 include "../xscale/i8134x/std.crb" makeoptions MODULES_OVERRIDE="" Modified: stable/10/sys/arm/conf/EP80219 ============================================================================== --- stable/10/sys/arm/conf/EP80219 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/conf/EP80219 Thu May 15 02:41:23 2014 (r266110) @@ -23,7 +23,6 @@ options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm -options STARTUP_PAGETABLE_ADDR=0xa0000000 #options ARM32_NEW_VM_LAYOUT include "../xscale/i80321/std.ep80219" makeoptions MODULES_OVERRIDE="" Modified: stable/10/sys/arm/conf/GUMSTIX ============================================================================== --- stable/10/sys/arm/conf/GUMSTIX Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/conf/GUMSTIX Thu May 15 02:41:23 2014 (r266110) @@ -30,7 +30,6 @@ options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm -options STARTUP_PAGETABLE_ADDR=0xa0000000 include "../xscale/pxa/std.pxa" makeoptions MODULES_OVERRIDE="" Modified: stable/10/sys/arm/conf/HL201 ============================================================================== --- stable/10/sys/arm/conf/HL201 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/conf/HL201 Thu May 15 02:41:23 2014 (r266110) @@ -126,7 +126,7 @@ device nand # NAND interface on CS3 # Coming soon, but not yet #options FDT #options FDT_DTB_STATIC -#makeoptions FDT_DTS_FILE=at91sam9g20ek.dts +#makeoptions FDT_DTS_FILE=hl201.dts options EARLY_PRINTF options SOCDEV_PA=0xfc000000 Modified: stable/10/sys/arm/conf/IQ31244 ============================================================================== --- stable/10/sys/arm/conf/IQ31244 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/conf/IQ31244 Thu May 15 02:41:23 2014 (r266110) @@ -25,7 +25,6 @@ options KERNVIRTADDR=0xc0200000 # Used options FLASHADDR=0xf0000000 options LOADERRAMADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0xa0000000 include "../xscale/i80321/std.iq31244" makeoptions MODULES_OVERRIDE="" Modified: stable/10/sys/arm/conf/NSLU ============================================================================== --- stable/10/sys/arm/conf/NSLU Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/conf/NSLU Thu May 15 02:41:23 2014 (r266110) @@ -25,7 +25,6 @@ ident NSLU #options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 -#options STARTUP_PAGETABLE_ADDR=0x10000000 include "../xscale/ixp425/std.ixp425" # NB: memory mapping is defined in std.avila (see also comment above) Modified: stable/10/sys/arm/conf/VERSATILEPB ============================================================================== --- stable/10/sys/arm/conf/VERSATILEPB Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/conf/VERSATILEPB Thu May 15 02:41:23 2014 (r266110) @@ -29,7 +29,6 @@ makeoptions KERNVIRTADDR=0xc0100000 options KERNPHYSADDR=0x00100000 makeoptions KERNPHYSADDR=0x00100000 options PHYSADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x01000000 options FREEBSD_BOOT_LOADER options LINUX_BOOT_ABI Modified: stable/10/sys/arm/econa/std.econa ============================================================================== --- stable/10/sys/arm/econa/std.econa Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/econa/std.econa Thu May 15 02:41:23 2014 (r266110) @@ -12,6 +12,5 @@ options KERNPHYSADDR=0x01000000 options KERNVIRTADDR=0xc1000000 # Used in ldscript.arm options FLASHADDR=0xD0000000 options LOADERRAMADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x00100000 options NO_EVENTTIMERS Modified: stable/10/sys/arm/freescale/imx/std.imx51 ============================================================================== --- stable/10/sys/arm/freescale/imx/std.imx51 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/freescale/imx/std.imx51 Thu May 15 02:41:23 2014 (r266110) @@ -9,7 +9,6 @@ makeoptions KERNVIRTADDR=0xc0100000 options KERNPHYSADDR=0x90100000 makeoptions KERNPHYSADDR=0x90100000 options PHYSADDR=0x90000000 -options STARTUP_PAGETABLE_ADDR=0x91000000 files "../freescale/imx/files.imx51" Modified: stable/10/sys/arm/freescale/imx/std.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/std.imx53 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/freescale/imx/std.imx53 Thu May 15 02:41:23 2014 (r266110) @@ -9,7 +9,6 @@ makeoptions KERNVIRTADDR=0xc0100000 options KERNPHYSADDR=0x70100000 makeoptions KERNPHYSADDR=0x70100000 options PHYSADDR=0x70000000 -options STARTUP_PAGETABLE_ADDR=0x71000000 files "../freescale/imx/files.imx53" Modified: stable/10/sys/arm/freescale/imx/std.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/std.imx6 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/freescale/imx/std.imx6 Thu May 15 02:41:23 2014 (r266110) @@ -9,7 +9,6 @@ makeoptions KERNVIRTADDR = 0xc2000000 options KERNPHYSADDR = 0x12000000 makeoptions KERNPHYSADDR = 0x12000000 options PHYSADDR = 0x10000000 -options STARTUP_PAGETABLE_ADDR = 0x11f00000 files "../freescale/imx/files.imx6" Modified: stable/10/sys/arm/freescale/vybrid/std.vybrid ============================================================================== --- stable/10/sys/arm/freescale/vybrid/std.vybrid Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/freescale/vybrid/std.vybrid Thu May 15 02:41:23 2014 (r266110) @@ -13,8 +13,6 @@ options KERNPHYSADDR=0x80100000 makeoptions KERNVIRTADDR=0xc0100000 options KERNVIRTADDR=0xc0100000 -options STARTUP_PAGETABLE_ADDR=0x81000000 - options ARM_L2_PIPT files "../freescale/vybrid/files.vybrid" Modified: stable/10/sys/arm/lpc/std.lpc ============================================================================== --- stable/10/sys/arm/lpc/std.lpc Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/lpc/std.lpc Thu May 15 02:41:23 2014 (r266110) @@ -8,7 +8,6 @@ cpu CPU_ARM9 machine arm makeoptions CONF_CFLAGS="-march=armv5te" options PHYSADDR=0x80000000 -options STARTUP_PAGETABLE_ADDR=0x80000000 makeoptions KERNPHYSADDR=0x80100000 options KERNPHYSADDR=0x80100000 makeoptions KERNVIRTADDR=0xc0100000 Modified: stable/10/sys/arm/mv/armadaxp/std.armadaxp ============================================================================== --- stable/10/sys/arm/mv/armadaxp/std.armadaxp Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/mv/armadaxp/std.armadaxp Thu May 15 02:41:23 2014 (r266110) @@ -12,6 +12,5 @@ makeoptions KERNVIRTADDR=0xc0200000 options KERNPHYSADDR=0x00200000 options KERNVIRTADDR=0xc0200000 options PHYSADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x00100000 options ARM_L2_PIPT Modified: stable/10/sys/arm/mv/discovery/std.db78xxx ============================================================================== --- stable/10/sys/arm/mv/discovery/std.db78xxx Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/mv/discovery/std.db78xxx Thu May 15 02:41:23 2014 (r266110) @@ -9,4 +9,3 @@ makeoptions KERNVIRTADDR=0xc0900000 options KERNPHYSADDR=0x00900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x00100000 Modified: stable/10/sys/arm/mv/kirkwood/std.kirkwood ============================================================================== --- stable/10/sys/arm/mv/kirkwood/std.kirkwood Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/mv/kirkwood/std.kirkwood Thu May 15 02:41:23 2014 (r266110) @@ -12,4 +12,3 @@ makeoptions KERNVIRTADDR=0xc0900000 options KERNPHYSADDR=0x00900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x00100000 Modified: stable/10/sys/arm/mv/orion/std.db88f5xxx ============================================================================== --- stable/10/sys/arm/mv/orion/std.db88f5xxx Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/mv/orion/std.db88f5xxx Thu May 15 02:41:23 2014 (r266110) @@ -9,4 +9,3 @@ makeoptions KERNVIRTADDR=0xc0900000 options KERNPHYSADDR=0x00900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x00100000 Modified: stable/10/sys/arm/mv/orion/std.ts7800 ============================================================================== --- stable/10/sys/arm/mv/orion/std.ts7800 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/mv/orion/std.ts7800 Thu May 15 02:41:23 2014 (r266110) @@ -9,7 +9,6 @@ makeoptions KERNVIRTADDR=0xc0900000 options KERNPHYSADDR=0x00900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x00100000 options LOADERRAMADDR=0x00000000 options FLASHADDR=0x00008000 Modified: stable/10/sys/arm/rockchip/std.rk30xx ============================================================================== --- stable/10/sys/arm/rockchip/std.rk30xx Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/rockchip/std.rk30xx Thu May 15 02:41:23 2014 (r266110) @@ -17,8 +17,6 @@ options KERNPHYSADDR=0x60400000 makeoptions KERNVIRTADDR=0xc0400000 options KERNVIRTADDR=0xc0400000 -options STARTUP_PAGETABLE_ADDR=0x60200000 - options ARM_L2_PIPT options IPI_IRQ_START=0 Modified: stable/10/sys/arm/s3c2xx0/std.ln2410sbc ============================================================================== --- stable/10/sys/arm/s3c2xx0/std.ln2410sbc Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/s3c2xx0/std.ln2410sbc Thu May 15 02:41:23 2014 (r266110) @@ -6,6 +6,5 @@ makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x30000000 options KERNVIRTADDR=0xc0000000 options PHYSADDR=0x30000000 -options STARTUP_PAGETABLE_ADDR=0x30800000 options NO_EVENTTIMERS Modified: stable/10/sys/arm/samsung/exynos/std.exynos5 ============================================================================== --- stable/10/sys/arm/samsung/exynos/std.exynos5 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/samsung/exynos/std.exynos5 Thu May 15 02:41:23 2014 (r266110) @@ -13,8 +13,6 @@ options KERNPHYSADDR=0x40f00000 makeoptions KERNVIRTADDR=0xc0f00000 options KERNVIRTADDR=0xc0f00000 -options STARTUP_PAGETABLE_ADDR=0x40100000 - options ARM_L2_PIPT options IPI_IRQ_START=0 Modified: stable/10/sys/arm/tegra/std.tegra2 ============================================================================== --- stable/10/sys/arm/tegra/std.tegra2 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/tegra/std.tegra2 Thu May 15 02:41:23 2014 (r266110) @@ -11,6 +11,4 @@ options KERNPHYSADDR=0x00200000 makeoptions KERNVIRTADDR=0xc0200000 options KERNVIRTADDR=0xc0200000 -options STARTUP_PAGETABLE_ADDR=0x00100000 - files "../tegra/files.tegra2" Modified: stable/10/sys/arm/ti/am335x/std.am335x ============================================================================== --- stable/10/sys/arm/ti/am335x/std.am335x Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/ti/am335x/std.am335x Thu May 15 02:41:23 2014 (r266110) @@ -14,8 +14,6 @@ makeoptions KERNPHYSADDR=0x80200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm makeoptions KERNVIRTADDR=0xc0200000 -options STARTUP_PAGETABLE_ADDR=0x80000000 - options SOC_TI_AM335X options ARM_L2_PIPT Modified: stable/10/sys/arm/ti/omap4/std.omap4 ============================================================================== --- stable/10/sys/arm/ti/omap4/std.omap4 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/ti/omap4/std.omap4 Thu May 15 02:41:23 2014 (r266110) @@ -14,8 +14,6 @@ makeoptions KERNPHYSADDR=0x80200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm makeoptions KERNVIRTADDR=0xc0200000 -options STARTUP_PAGETABLE_ADDR=0x80000000 - options SOC_OMAP4 options ARM_L2_PIPT Modified: stable/10/sys/arm/xilinx/std.zynq7 ============================================================================== --- stable/10/sys/arm/xilinx/std.zynq7 Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/xilinx/std.zynq7 Thu May 15 02:41:23 2014 (r266110) @@ -18,6 +18,5 @@ makeoptions KERNPHYSADDR=0x00100000 options KERNVIRTADDR=0xc0100000 # Used in ldscript.arm makeoptions KERNVIRTADDR=0xc0100000 -options STARTUP_PAGETABLE_ADDR=0x000f0000 options ARM_L2_PIPT Modified: stable/10/sys/arm/xscale/ixp425/std.avila ============================================================================== --- stable/10/sys/arm/xscale/ixp425/std.avila Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/arm/xscale/ixp425/std.avila Thu May 15 02:41:23 2014 (r266110) @@ -19,4 +19,3 @@ options KERNVIRTADDR=0xc0200000 # Used makeoptions KERNVIRTADDR=0xc0200000 options FLASHADDR=0x50000000 options LOADERRAMADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x00000000 Modified: stable/10/sys/conf/Makefile.arm ============================================================================== --- stable/10/sys/conf/Makefile.arm Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/conf/Makefile.arm Thu May 15 02:41:23 2014 (r266110) @@ -55,6 +55,9 @@ CFLAGS += -mllvm -arm-enable-ehabi .endif .endif +# 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} \ -warn-common -export-dynamic -dynamic-linker /red/herring -o \ ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o Modified: stable/10/sys/conf/ldscript.arm ============================================================================== --- stable/10/sys/conf/ldscript.arm Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/conf/ldscript.arm Thu May 15 02:41:23 2014 (r266110) @@ -107,6 +107,12 @@ SECTIONS *(.dynbss) *(.bss) *(COMMON) + . = ALIGN(32 / 8); + _ebss = .; + /* A section for the initial page table, it doesn't need to be in the + kernel file, however unlike normal .bss entries should not be zeroed + out as we use it before the .bss section is cleared. */ + *(.init_pagetable) } . = ALIGN(32 / 8); _end = . ; Modified: stable/10/sys/conf/options.arm ============================================================================== --- stable/10/sys/conf/options.arm Thu May 15 02:37:59 2014 (r266109) +++ stable/10/sys/conf/options.arm Thu May 15 02:41:23 2014 (r266110) @@ -51,7 +51,6 @@ SOC_OMAP3 opt_global.h SOC_OMAP4 opt_global.h SOC_TI_AM335X opt_global.h SOC_TEGRA2 opt_global.h -STARTUP_PAGETABLE_ADDR opt_global.h XSCALE_CACHE_READ_WRITE_ALLOCATE opt_global.h XSACLE_DISABLE_CCNT opt_timer.h VERBOSE_INIT_ARM opt_global.h From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 03:22:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F3BAE998; Thu, 15 May 2014 03:22:58 +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 D4F4329EB; Thu, 15 May 2014 03:22:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F3MwLK026174; Thu, 15 May 2014 03:22:58 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F3Mw1C026171; Thu, 15 May 2014 03:22:58 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405150322.s4F3Mw1C026171@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 03:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266113 - stable/10/sys/arm/rockchip X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 03:22:59 -0000 Author: ian Date: Thu May 15 03:22:57 2014 New Revision: 266113 URL: http://svnweb.freebsd.org/changeset/base/266113 Log: MFC r258546: Add watchdog driver for rk3188. Added: stable/10/sys/arm/rockchip/rk30xx_wdog.c - copied unchanged from r258546, head/sys/arm/rockchip/rk30xx_wdog.c stable/10/sys/arm/rockchip/rk30xx_wdog.h - copied unchanged from r258546, head/sys/arm/rockchip/rk30xx_wdog.h Modified: stable/10/sys/arm/rockchip/files.rk30xx Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/rockchip/files.rk30xx ============================================================================== --- stable/10/sys/arm/rockchip/files.rk30xx Thu May 15 03:18:22 2014 (r266112) +++ stable/10/sys/arm/rockchip/files.rk30xx Thu May 15 03:22:57 2014 (r266113) @@ -17,5 +17,6 @@ arm/rockchip/common.c standard arm/rockchip/rk30xx_machdep.c standard arm/rockchip/rk30xx_pmu.c standard arm/rockchip/rk30xx_grf.c standard +arm/rockchip/rk30xx_wdog.c standard arm/rockchip/rk30xx_gpio.c optional gpio dev/usb/controller/dwc_otg_fdt.c optional dwcotg Copied: stable/10/sys/arm/rockchip/rk30xx_wdog.c (from r258546, head/sys/arm/rockchip/rk30xx_wdog.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/rockchip/rk30xx_wdog.c Thu May 15 03:22:57 2014 (r266113, copy of r258546, head/sys/arm/rockchip/rk30xx_wdog.c) @@ -0,0 +1,198 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#ifndef RK30_WDT_BASE +#define RK30_WDT_BASE 0x2004c000 +#define RK30_WDT_PSIZE 0x100 +#endif + +#define RK30_WDT_READ(_sc, _r) bus_read_4((_sc)->res, (_r)) +#define RK30_WDT_WRITE(_sc, _r, _v) bus_write_4((_sc)->res, (_r), (_v)) + +#define WDOG_CTRL 0x00 +#define WDOG_CTRL_EN (1 << 0) +#define WDOG_CTRL_RSP_MODE (1 << 1) +#define WDOG_CTRL_RST_PULSE (4 << 2) +#define WDOG_CTRL_RST 0xa +#define WDOG_TORR 0x04 +#define WDOG_TORR_INTVL_SHIFT 0 +#define WDOG_CCVR 0x08 +#define WDOG_CRR 0x0c +#define WDOG_CRR_PWD 0x76 +#define WDOG_STAT 0x10 +#define WDOG_EOI 0x14 + +static struct rk30_wd_softc *rk30_wd_sc = NULL; + +struct rk30_wd_softc { + device_t dev; + struct resource *res; + struct mtx mtx; + int freq; +}; + +static void rk30_wd_watchdog_fn(void *private, u_int cmd, int *error); + +static int +rk30_wd_probe(device_t dev) +{ + + if (ofw_bus_is_compatible(dev, "rockchip,rk30xx-wdt")) { + device_set_desc(dev, "Rockchip RK30XX Watchdog"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +rk30_wd_attach(device_t dev) +{ + struct rk30_wd_softc *sc; + int rid; + phandle_t node; + pcell_t cell; + + if (rk30_wd_sc != NULL) + return (ENXIO); + + sc = device_get_softc(dev); + sc->dev = dev; + + node = ofw_bus_get_node(sc->dev); + if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) > 0) + sc->freq = cell / 1000000; + else + return (ENXIO); + + rid = 0; + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "could not allocate memory resource\n"); + return (ENXIO); + } + + rk30_wd_sc = sc; + mtx_init(&sc->mtx, "RK30XX Watchdog", "rk30_wd", MTX_DEF); + EVENTHANDLER_REGISTER(watchdog_list, rk30_wd_watchdog_fn, sc, 0); + + return (0); +} + +static void +rk30_wd_watchdog_fn(void *private, u_int cmd, int *error) +{ + struct rk30_wd_softc *sc; + uint64_t ms, m, max; + int i; + + sc = private; + mtx_lock(&sc->mtx); + + cmd &= WD_INTERVAL; + + if (cmd > 0) { + ms = ((uint64_t)1 << (cmd & WD_INTERVAL)) / 1000000; + m = 0xffff / sc->freq; + max = 0x7fffffff / sc->freq + 1; + i = 0; + while (m < max && m < ms) { + m <<= 1; + i++; + } + if (m < max) { + RK30_WDT_WRITE(sc, WDOG_TORR, + i << WDOG_TORR_INTVL_SHIFT); + RK30_WDT_WRITE(sc, WDOG_CTRL, + WDOG_CTRL_EN | WDOG_CTRL_RSP_MODE | + WDOG_CTRL_RST_PULSE); + RK30_WDT_WRITE(sc, WDOG_CRR, WDOG_CRR_PWD); + *error = 0; + } else { + device_printf(sc->dev, "Can not be disabled\n"); + mtx_unlock(&sc->mtx); + RK30_WDT_WRITE(sc, WDOG_CTRL, WDOG_CTRL_RST); + return; + } + } + else + RK30_WDT_WRITE(sc, WDOG_CTRL, WDOG_CTRL_RST); + + mtx_unlock(&sc->mtx); +} + +void +rk30_wd_watchdog_reset() +{ + bus_space_handle_t bsh; + + bus_space_map(fdtbus_bs_tag, RK30_WDT_BASE, RK30_WDT_PSIZE, 0, &bsh); + bus_space_write_4(fdtbus_bs_tag, bsh, WDOG_TORR, 0); + bus_space_write_4(fdtbus_bs_tag, bsh, WDOG_CTRL, + WDOG_CTRL_EN | WDOG_CTRL_RSP_MODE | WDOG_CTRL_RST_PULSE); + + while (1); +} + +static device_method_t rk30_wd_methods[] = { + DEVMETHOD(device_probe, rk30_wd_probe), + DEVMETHOD(device_attach, rk30_wd_attach), + + DEVMETHOD_END +}; + +static driver_t rk30_wd_driver = { + "rk30_wd", + rk30_wd_methods, + sizeof(struct rk30_wd_softc), +}; +static devclass_t rk30_wd_devclass; + +DRIVER_MODULE(rk30_wd, simplebus, rk30_wd_driver, rk30_wd_devclass, 0, 0); Copied: stable/10/sys/arm/rockchip/rk30xx_wdog.h (from r258546, head/sys/arm/rockchip/rk30xx_wdog.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/rockchip/rk30xx_wdog.h Thu May 15 03:22:57 2014 (r266113, copy of r258546, head/sys/arm/rockchip/rk30xx_wdog.h) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ +#ifndef __RK30XX_WDOG_H__ +#define __RK30XX_WDOG_H__ + +void rk30_wd_watchdog_reset(void); + +#endif /*__RK30XX_WDOG_H__*/ + From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 12:39:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DE84522E; Thu, 15 May 2014 12:39: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 CA623236D; Thu, 15 May 2014 12:39: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 s4FCdSbc068405; Thu, 15 May 2014 12:39:28 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FCdSOD068403; Thu, 15 May 2014 12:39:28 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405151239.s4FCdSOD068403@svn.freebsd.org> From: Steven Hartland Date: Thu, 15 May 2014 12:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266122 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 12:39:29 -0000 Author: smh Date: Thu May 15 12:39:28 2014 New Revision: 266122 URL: http://svnweb.freebsd.org/changeset/base/266122 Log: MFC r264850 Add the ability to set a minimum ashift size for ZFS pool creation or root level vdev addition. Change max_auto_ashift sysctl to error when an invalid value is requested instead of silently limiting it. Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Thu May 15 11:30:17 2014 (r266121) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Thu May 15 12:39:28 2014 (r266122) @@ -106,7 +106,7 @@ _NOTE(CONSTCOND) } while (0) #define SPA_BLOCKSIZES (SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1) /* - * Maximum supported logical ashift. + * Default maximum supported logical ashift. * * The current 8k allocation block size limit is due to the 8k * aligned/sized operations performed by vdev_probe() on @@ -117,6 +117,11 @@ _NOTE(CONSTCOND) } while (0) #define SPA_MAXASHIFT 13 /* + * Default minimum supported logical ashift. + */ +#define SPA_MINASHIFT SPA_MINBLOCKSHIFT + +/* * Size of block to hold the configuration data (a packed nvlist) */ #define SPA_CONFIG_BLOCKSIZE (1ULL << 14) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu May 15 11:30:17 2014 (r266121) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu May 15 12:39:28 2014 (r266122) @@ -53,7 +53,7 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vdev, CT * Virtual device management. */ -/** +/* * The limit for ZFS to automatically increase a top-level vdev's ashift * from logical ashift to physical ashift. * @@ -61,19 +61,34 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vdev, CT * child->vdev_ashift = 9 (512 bytes) * child->vdev_physical_ashift = 12 (4096 bytes) * zfs_max_auto_ashift = 11 (2048 bytes) + * zfs_min_auto_ashift = 9 (512 bytes) * - * On pool creation or the addition of a new top-leve vdev, ZFS will - * bump the ashift of the top-level vdev to 2048. + * On pool creation or the addition of a new top-level vdev, ZFS will + * increase the ashift of the top-level vdev to 2048 as limited by + * zfs_max_auto_ashift. * * Example: one or more 512B emulation child vdevs * child->vdev_ashift = 9 (512 bytes) * child->vdev_physical_ashift = 12 (4096 bytes) * zfs_max_auto_ashift = 13 (8192 bytes) + * zfs_min_auto_ashift = 9 (512 bytes) + * + * On pool creation or the addition of a new top-level vdev, ZFS will + * increase the ashift of the top-level vdev to 4096 to match the + * max vdev_physical_ashift. * - * On pool creation or the addition of a new top-leve vdev, ZFS will - * bump the ashift of the top-level vdev to 4096. + * Example: one or more 512B emulation child vdevs + * child->vdev_ashift = 9 (512 bytes) + * child->vdev_physical_ashift = 9 (512 bytes) + * zfs_max_auto_ashift = 13 (8192 bytes) + * zfs_min_auto_ashift = 12 (4096 bytes) + * + * On pool creation or the addition of a new top-level vdev, ZFS will + * increase the ashift of the top-level vdev to 4096 to match the + * zfs_min_auto_ashift. */ static uint64_t zfs_max_auto_ashift = SPA_MAXASHIFT; +static uint64_t zfs_min_auto_ashift = SPA_MINASHIFT; static int sysctl_vfs_zfs_max_auto_ashift(SYSCTL_HANDLER_ARGS) @@ -86,8 +101,8 @@ sysctl_vfs_zfs_max_auto_ashift(SYSCTL_HA if (err != 0 || req->newptr == NULL) return (err); - if (val > SPA_MAXASHIFT) - val = SPA_MAXASHIFT; + if (val > SPA_MAXASHIFT || val < zfs_min_auto_ashift) + return (EINVAL); zfs_max_auto_ashift = val; @@ -96,7 +111,31 @@ sysctl_vfs_zfs_max_auto_ashift(SYSCTL_HA SYSCTL_PROC(_vfs_zfs, OID_AUTO, max_auto_ashift, CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(uint64_t), sysctl_vfs_zfs_max_auto_ashift, "QU", - "Cap on logical -> physical ashift adjustment on new top-level vdevs."); + "Max ashift used when optimising for logical -> physical sectors size on " + "new top-level vdevs."); + +static int +sysctl_vfs_zfs_min_auto_ashift(SYSCTL_HANDLER_ARGS) +{ + uint64_t val; + int err; + + val = zfs_min_auto_ashift; + err = sysctl_handle_64(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val < SPA_MINASHIFT || val > zfs_max_auto_ashift) + return (EINVAL); + + zfs_min_auto_ashift = val; + + return (0); +} +SYSCTL_PROC(_vfs_zfs, OID_AUTO, min_auto_ashift, + CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(uint64_t), + sysctl_vfs_zfs_min_auto_ashift, "QU", + "Min ashift used when creating new top-level vdevs."); static vdev_ops_t *vdev_ops_table[] = { &vdev_root_ops, @@ -1631,19 +1670,30 @@ vdev_metaslab_set_size(vdev_t *vd) } /* - * Maximize performance by inflating the configured ashift for - * top level vdevs to be as close to the physical ashift as - * possible without exceeding the administrator specified - * limit. + * Maximize performance by inflating the configured ashift for top level + * vdevs to be as close to the physical ashift as possible while maintaining + * administrator defined limits and ensuring it doesn't go below the + * logical ashift. */ void vdev_ashift_optimize(vdev_t *vd) { - if (vd == vd->vdev_top && - (vd->vdev_ashift < vd->vdev_physical_ashift) && - (vd->vdev_ashift < zfs_max_auto_ashift)) { - vd->vdev_ashift = MIN(zfs_max_auto_ashift, - vd->vdev_physical_ashift); + if (vd == vd->vdev_top) { + if (vd->vdev_ashift < vd->vdev_physical_ashift) { + vd->vdev_ashift = MIN( + MAX(zfs_max_auto_ashift, vd->vdev_ashift), + MAX(zfs_min_auto_ashift, vd->vdev_physical_ashift)); + } else { + /* + * Unusual case where logical ashift > physical ashift + * so we can't cap the calculated ashift based on max + * ashift as that would cause failures. + * We still check if we need to increase it to match + * the min ashift. + */ + vd->vdev_ashift = MAX(zfs_min_auto_ashift, + vd->vdev_ashift); + } } } From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 14:26:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 83F2CD3E; Thu, 15 May 2014 14:26: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 6E7772D90; Thu, 15 May 2014 14:26: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 s4FEQEuI018851; Thu, 15 May 2014 14:26:14 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FEQCio018830; Thu, 15 May 2014 14:26:12 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151426.s4FEQCio018830@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 14:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266128 - in stable/10/sys: arm/arm arm/mv conf dev/fdt dev/ofw mips/beri powerpc/ofw powerpc/powerpc powerpc/pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 14:26:14 -0000 Author: ian Date: Thu May 15 14:26:11 2014 New Revision: 266128 URL: http://svnweb.freebsd.org/changeset/base/266128 Log: MFC r261351, r261352, r261355, r261396, r261397, r261398, r261403, r261404, r261405 Open Firmware interrupt specifiers can consist of arbitrary-length byte strings and include arbitrary information (IRQ line/domain/sense). When the ofw_bus_map_intr() API was introduced, it assumed that, as on most systems, these were either 1 cell, containing an interrupt line, or 2, containing a line number plus a sense code. It turns out a non-negligible number of ARM systems use 3 (or even 4!) cells for interrupts, so make this more general. Provide a simpler and more standards-compliant simplebus implementation to get the Routerboard 800 up and running with the vendor device tree. This does not implement some BERI-specific features (which hopefully won't be necessary soon), so move the old code to mips/beri, with a higher attach priority when built, until MIPS interrupt domain support is rearranged. Allow nesting of simplebuses. Add a set of helpers (ofw_bus_get_status() and ofw_bus_status_okay()) to process "status" properties of OF nodes. Fix one remnant endian flaw in nexus. Added: stable/10/sys/mips/beri/beri_simplebus.c - copied unchanged from r261352, head/sys/mips/beri/beri_simplebus.c - copied unchanged from r261352, head/sys/mips/beri/fdt_ic_if.m Directory Properties: stable/10/sys/mips/beri/fdt_ic_if.m (props changed) Deleted: stable/10/sys/dev/fdt/fdt_ic_if.m Modified: stable/10/sys/arm/arm/nexus.c stable/10/sys/arm/mv/mv_pci.c stable/10/sys/conf/files stable/10/sys/dev/fdt/fdt_common.c stable/10/sys/dev/fdt/simplebus.c stable/10/sys/dev/ofw/ofw_bus.h stable/10/sys/dev/ofw/ofw_bus_if.m stable/10/sys/dev/ofw/ofw_bus_subr.c stable/10/sys/dev/ofw/ofw_bus_subr.h stable/10/sys/dev/ofw/ofw_nexus.c stable/10/sys/mips/beri/files.beri stable/10/sys/powerpc/ofw/ofw_pci.c stable/10/sys/powerpc/ofw/ofw_pcib_pci.c stable/10/sys/powerpc/ofw/ofw_pcibus.c stable/10/sys/powerpc/powerpc/nexus.c stable/10/sys/powerpc/pseries/vdevice.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/nexus.c ============================================================================== --- stable/10/sys/arm/arm/nexus.c Thu May 15 14:23:36 2014 (r266127) +++ stable/10/sys/arm/arm/nexus.c Thu May 15 14:26:11 2014 (r266128) @@ -98,7 +98,7 @@ static int nexus_teardown_intr(device_t, #ifdef FDT static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, - int irq); + int icells, pcell_t *intr); #endif static device_method_t nexus_methods[] = { @@ -339,15 +339,16 @@ nexus_deactivate_resource(device_t bus, #ifdef FDT static int -nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int irq) +nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, + pcell_t *intr) { - pcell_t intr[2]; fdt_pic_decode_t intr_decode; phandle_t intr_offset; int i, rv, interrupt, trig, pol; intr_offset = OF_xref_phandle(iparent); - intr[0] = cpu_to_fdt32(irq); + for (i = 0; i < icells; i++) + intr[i] = cpu_to_fdt32(intr[i]); for (i = 0; fdt_pic_table[i] != NULL; i++) { intr_decode = fdt_pic_table[i]; @@ -361,7 +362,7 @@ nexus_ofw_map_intr(device_t dev, device_ } /* Not in table, so guess */ - interrupt = FDT_MAP_IRQ(intr_parent, fdt32_to_cpu(*intr)); + interrupt = FDT_MAP_IRQ(intr_parent, fdt32_to_cpu(intr[0])); return (interrupt); } Modified: stable/10/sys/arm/mv/mv_pci.c ============================================================================== --- stable/10/sys/arm/mv/mv_pci.c Thu May 15 14:23:36 2014 (r266127) +++ stable/10/sys/arm/mv/mv_pci.c Thu May 15 14:26:11 2014 (r266128) @@ -1050,7 +1050,8 @@ mv_pcib_route_interrupt(device_t bus, de { struct mv_pcib_softc *sc; struct ofw_pci_register reg; - uint32_t pintr, mintr; + uint32_t pintr, mintr[4]; + int icells; phandle_t iparent; sc = device_get_softc(bus); @@ -1062,10 +1063,11 @@ mv_pcib_route_interrupt(device_t bus, de (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - &iparent)) - return (ofw_bus_map_intr(dev, iparent, mintr)); + icells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, + ®, sizeof(reg), &pintr, sizeof(pintr), mintr, sizeof(mintr), + &iparent); + if (icells > 0) + return (ofw_bus_map_intr(dev, iparent, icells, mintr)); /* Maybe it's a real interrupt, not an intpin */ if (pin > 4) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu May 15 14:23:36 2014 (r266127) +++ stable/10/sys/conf/files Thu May 15 14:26:11 2014 (r266128) @@ -1404,7 +1404,6 @@ dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard dev/fb/splash.c optional sc splash dev/fdt/fdt_common.c optional fdt -dev/fdt/fdt_ic_if.m optional fdt dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "$S/boot/fdt/dts/${FDT_DTS_FILE}" Modified: stable/10/sys/dev/fdt/fdt_common.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.c Thu May 15 14:23:36 2014 (r266127) +++ stable/10/sys/dev/fdt/fdt_common.c Thu May 15 14:26:11 2014 (r266128) @@ -489,11 +489,10 @@ fdt_intr_to_rl(device_t dev, phandle_t n OF_searchencprop(OF_xref_phandle(iparent), "#interrupt-cells", &icells, sizeof(icells)); for (i = 0, k = 0; i < nintr; i += icells, k++) { - intr[i] = ofw_bus_map_intr(dev, iparent, intr[i]); + intr[i] = ofw_bus_map_intr(dev, iparent, icells, + &intr[i]); resource_list_add(rl, SYS_RES_IRQ, k, intr[i], intr[i], 1); - if (icells > 1) - ofw_bus_config_intr(dev, intr[i], intr[i+1]); } free(intr, M_OFWPROP); } Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Thu May 15 14:23:36 2014 (r266127) +++ stable/10/sys/dev/fdt/simplebus.c Thu May 15 14:26:11 2014 (r266128) @@ -1,10 +1,7 @@ /*- - * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2013 Nathan Whitehorn * All rights reserved. * - * This software was developed by Semihalf 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: @@ -17,7 +14,7 @@ * 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 + * 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) @@ -29,95 +26,85 @@ #include __FBSDID("$FreeBSD$"); - -#include "opt_platform.h" #include #include -#include -#include #include #include +#include +#include #include -#include +#include #include #include -#include -#include "fdt_common.h" -#include "fdt_ic_if.h" -#include "ofw_bus_if.h" - -#ifdef DEBUG -#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ - printf(fmt,##args); } while (0) -#else -#define debugf(fmt, args...) -#endif - -static MALLOC_DEFINE(M_SIMPLEBUS, "simplebus", "simplebus devices information"); +struct simplebus_range { + uint64_t bus; + uint64_t host; + uint64_t size; +}; struct simplebus_softc { - int sc_addr_cells; - int sc_size_cells; + device_t dev; + phandle_t node; + + struct simplebus_range *ranges; + int nranges; + + pcell_t acells, scells; }; struct simplebus_devinfo { - struct ofw_bus_devinfo di_ofw; - struct resource_list di_res; - - /* Interrupts sense-level info for this device */ - struct fdt_sense_level di_intr_sl[DI_MAX_INTR_NUM]; + struct ofw_bus_devinfo obdinfo; + struct resource_list rl; }; /* - * Prototypes. + * Bus interface. */ -static int simplebus_probe(device_t); -static int simplebus_attach(device_t); - -static int simplebus_print_child(device_t, device_t); -static int simplebus_setup_intr(device_t, device_t, struct resource *, int, - driver_filter_t *, driver_intr_t *, void *, void **); -static int simplebus_teardown_intr(device_t, device_t, struct resource *, - void *); - -static int simplebus_activate_resource(device_t, device_t, int, int, - struct resource *); +static int simplebus_probe(device_t dev); +static int simplebus_attach(device_t dev); static struct resource *simplebus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); -static int simplebus_deactivate_resource(device_t, device_t, int, int, - struct resource *); -static int simplebus_release_resource(device_t, device_t, int, int, - struct resource *); -static device_t simplebus_get_interrupt_parent(device_t); -static struct resource_list *simplebus_get_resource_list(device_t, device_t); +static void simplebus_probe_nomatch(device_t bus, device_t child); +static int simplebus_print_child(device_t bus, device_t child); + +/* + * ofw_bus interface + */ +static const struct ofw_bus_devinfo *simplebus_get_devinfo(device_t bus, + device_t child); -static ofw_bus_get_devinfo_t simplebus_get_devinfo; +/* + * local methods + */ + +static int simplebus_fill_ranges(phandle_t node, + struct simplebus_softc *sc); +static struct simplebus_devinfo *simplebus_setup_dinfo(device_t dev, + phandle_t node); /* - * Bus interface definition. + * Driver methods. */ -static device_method_t simplebus_methods[] = { +static device_method_t simplebus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, simplebus_probe), DEVMETHOD(device_attach, simplebus_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ DEVMETHOD(bus_print_child, simplebus_print_child), + DEVMETHOD(bus_probe_nomatch, simplebus_probe_nomatch), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, simplebus_alloc_resource), - DEVMETHOD(bus_release_resource, simplebus_release_resource), - DEVMETHOD(bus_activate_resource, simplebus_activate_resource), - DEVMETHOD(bus_deactivate_resource, simplebus_deactivate_resource), - DEVMETHOD(bus_setup_intr, simplebus_setup_intr), - DEVMETHOD(bus_teardown_intr, simplebus_teardown_intr), - DEVMETHOD(bus_get_resource_list, simplebus_get_resource_list), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), - /* OFW bus interface */ + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, simplebus_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), @@ -125,7 +112,7 @@ static device_method_t simplebus_methods DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } + DEVMETHOD_END }; static driver_t simplebus_driver = { @@ -133,18 +120,17 @@ static driver_t simplebus_driver = { simplebus_methods, sizeof(struct simplebus_softc) }; - -devclass_t simplebus_devclass; - +static devclass_t simplebus_devclass; DRIVER_MODULE(simplebus, nexus, simplebus_driver, simplebus_devclass, 0, 0); -DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0, - 0); +DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0, 0); static int simplebus_probe(device_t dev) { - - if (!ofw_bus_is_compatible(dev, "simple-bus")) + + if (!ofw_bus_is_compatible(dev, "simple-bus") && + (ofw_bus_get_type(dev) == NULL || strcmp(ofw_bus_get_type(dev), + "soc") != 0)) return (ENXIO); device_set_desc(dev, "Flattened device tree simple bus"); @@ -155,102 +141,200 @@ simplebus_probe(device_t dev) static int simplebus_attach(device_t dev) { - device_t dev_child; - struct simplebus_devinfo *di; - struct simplebus_softc *sc; - phandle_t dt_node, dt_child; + struct simplebus_softc *sc; + struct simplebus_devinfo *di; + phandle_t node; + device_t cdev; + node = ofw_bus_get_node(dev); sc = device_get_softc(dev); + sc->dev = dev; + sc->node = node; + /* - * Walk simple-bus and add direct subordinates as our children. + * Some important numbers */ - dt_node = ofw_bus_get_node(dev); - for (dt_child = OF_child(dt_node); dt_child != 0; - dt_child = OF_peer(dt_child)) { - - /* Check and process 'status' property. */ - if (!(fdt_is_enabled(dt_child))) - continue; + sc->acells = 2; + OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); + sc->scells = 1; + OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); - if (!(fdt_pm_is_enabled(dt_child))) - continue; + if (simplebus_fill_ranges(node, sc) < 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } - di = malloc(sizeof(*di), M_SIMPLEBUS, M_WAITOK | M_ZERO); + /* + * In principle, simplebus could have an interrupt map, but ignore that + * for now + */ - if (ofw_bus_gen_setup_devinfo(&di->di_ofw, dt_child) != 0) { - free(di, M_SIMPLEBUS); - device_printf(dev, "could not set up devinfo\n"); + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + if ((di = simplebus_setup_dinfo(dev, node)) == NULL) continue; - } - - resource_list_init(&di->di_res); - if (fdt_reg_to_rl(dt_child, &di->di_res)) { - device_printf(dev, - "%s: could not process 'reg' " - "property\n", di->di_ofw.obd_name); - ofw_bus_gen_destroy_devinfo(&di->di_ofw); - free(di, M_SIMPLEBUS); + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + di->obdinfo.obd_name); + resource_list_free(&di->rl); + ofw_bus_gen_destroy_devinfo(&di->obdinfo); + free(di, M_DEVBUF); continue; } + device_set_ivars(cdev, di); + } - if (fdt_intr_to_rl(dev, dt_child, &di->di_res, di->di_intr_sl)) { - device_printf(dev, "%s: could not process " - "'interrupts' property\n", di->di_ofw.obd_name); - resource_list_free(&di->di_res); - ofw_bus_gen_destroy_devinfo(&di->di_ofw); - free(di, M_SIMPLEBUS); - continue; - } + return (bus_generic_attach(dev)); +} - /* Add newbus device for this FDT node */ - dev_child = device_add_child(dev, NULL, -1); - if (dev_child == NULL) { - device_printf(dev, "could not add child: %s\n", - di->di_ofw.obd_name); - resource_list_free(&di->di_res); - ofw_bus_gen_destroy_devinfo(&di->di_ofw); - free(di, M_SIMPLEBUS); - continue; +static int +simplebus_fill_ranges(phandle_t node, struct simplebus_softc *sc) +{ + int host_address_cells; + cell_t *base_ranges; + ssize_t nbase_ranges; + int err; + int i, j, k; + + err = OF_searchencprop(OF_parent(node), "#address-cells", + &host_address_cells, sizeof(host_address_cells)); + if (err <= 0) + return (-1); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges < 0) + return (-1); + sc->nranges = nbase_ranges / sizeof(cell_t) / + (sc->acells + host_address_cells + sc->scells); + if (sc->nranges == 0) + return (0); + + sc->ranges = malloc(sc->nranges * sizeof(sc->ranges[0]), + M_DEVBUF, M_WAITOK); + base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); + + for (i = 0, j = 0; i < sc->nranges; i++) { + sc->ranges[i].bus = 0; + for (k = 0; k < sc->acells; k++) { + sc->ranges[i].bus <<= 32; + sc->ranges[i].bus |= base_ranges[j++]; + } + sc->ranges[i].host = 0; + for (k = 0; k < host_address_cells; k++) { + sc->ranges[i].host <<= 32; + sc->ranges[i].host |= base_ranges[j++]; + } + sc->ranges[i].size = 0; + for (k = 0; k < sc->scells; k++) { + sc->ranges[i].size <<= 32; + sc->ranges[i].size |= base_ranges[j++]; } -#ifdef DEBUG - device_printf(dev, "added child: %s\n\n", di->di_ofw.obd_name); -#endif - device_set_ivars(dev_child, di); } - return (bus_generic_attach(dev)); + free(base_ranges, M_DEVBUF); + return (sc->nranges); } -static int -simplebus_print_child(device_t dev, device_t child) +static struct simplebus_devinfo * +simplebus_setup_dinfo(device_t dev, phandle_t node) { - device_t ip; - struct simplebus_devinfo *di; - struct resource_list *rl; - int rv; + struct simplebus_softc *sc; + struct simplebus_devinfo *ndi; + uint32_t *reg, *intr, icells; + uint64_t phys, size; + phandle_t iparent; + int i, j, k; + int nintr; + int nreg; - di = device_get_ivars(child); - rl = &di->di_res; + sc = device_get_softc(dev); - rv = 0; - rv += bus_print_child_header(dev, child); - rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); - if ((ip = simplebus_get_interrupt_parent(child)) != NULL) - rv += printf(" (%s)", device_get_nameunit(ip)); - rv += bus_print_child_footer(dev, child); + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&ndi->obdinfo, node) != 0) { + free(ndi, M_DEVBUF); + return (NULL); + } - return (rv); + resource_list_init(&ndi->rl); + nreg = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®); + if (nreg == -1) + nreg = 0; + if (nreg % (sc->acells + sc->scells) != 0) { + if (bootverbose) + device_printf(dev, "Malformed reg property on <%s>\n", + ndi->obdinfo.obd_name); + nreg = 0; + } + + for (i = 0, k = 0; i < nreg; i += sc->acells + sc->scells, k++) { + phys = size = 0; + for (j = 0; j < sc->acells; j++) { + phys <<= 32; + phys |= reg[i + j]; + } + for (j = 0; j < sc->scells; j++) { + size <<= 32; + size |= reg[i + sc->acells + j]; + } + + resource_list_add(&ndi->rl, SYS_RES_MEMORY, k, + phys, phys + size - 1, size); + } + free(reg, M_OFWPROP); + + nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + (void **)&intr); + if (nintr > 0) { + if (OF_searchencprop(node, "interrupt-parent", &iparent, + sizeof(iparent)) == -1) { + device_printf(dev, "No interrupt-parent found, " + "assuming direct parent\n"); + iparent = OF_parent(node); + } + if (OF_searchencprop(OF_xref_phandle(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells property, " + "assuming <1>\n"); + icells = 1; + } + if (icells < 1 || icells > nintr) { + device_printf(dev, "Invalid #interrupt-cells property " + "value <%d>, assuming <1>\n", icells); + icells = 1; + } + for (i = 0, k = 0; i < nintr; i += icells, k++) { + intr[i] = ofw_bus_map_intr(dev, iparent, icells, + &intr[i]); + resource_list_add(&ndi->rl, SYS_RES_IRQ, k, intr[i], + intr[i], 1); + } + free(intr, M_OFWPROP); + } + + return (ndi); +} + +static const struct ofw_bus_devinfo * +simplebus_get_devinfo(device_t bus __unused, device_t child) +{ + struct simplebus_devinfo *ndi; + + ndi = device_get_ivars(child); + return (&ndi->obdinfo); } static struct resource * simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - device_t ic; + struct simplebus_softc *sc; struct simplebus_devinfo *di; struct resource_list_entry *rle; + int j; + + sc = device_get_softc(bus); /* * Request for the default allocation with a given rid: use resource @@ -263,7 +347,7 @@ simplebus_alloc_resource(device_t bus, d if (type == SYS_RES_IOPORT) type = SYS_RES_MEMORY; - rle = resource_list_find(&di->di_res, type, *rid); + rle = resource_list_find(&di->rl, type, *rid); if (rle == NULL) { if (bootverbose) device_printf(bus, "no default resources for " @@ -273,153 +357,69 @@ simplebus_alloc_resource(device_t bus, d start = rle->start; end = rle->end; count = rle->count; - } + } + + if (type == SYS_RES_MEMORY) { + /* Remap through ranges property */ + for (j = 0; j < sc->nranges; j++) { + if (start >= sc->ranges[j].bus && end < + sc->ranges[j].bus + sc->ranges[j].size) { + start -= sc->ranges[j].bus; + start += sc->ranges[j].host; + end -= sc->ranges[j].bus; + end += sc->ranges[j].host; + break; + } + } + if (j == sc->nranges && sc->nranges != 0) { + if (bootverbose) + device_printf(bus, "Could not map resource " + "%#lx-%#lx\n", start, end); - if (type == SYS_RES_IRQ && - (ic = simplebus_get_interrupt_parent(child)) != NULL) - return(FDT_IC_ALLOC_INTR(ic, child, rid, start, flags)); + return (NULL); + } + } return (bus_generic_alloc_resource(bus, child, type, rid, start, end, count, flags)); } static int -simplebus_activate_resource(device_t dev, device_t child, int type, int rid, - struct resource *r) -{ - device_t ic; - - if (type == SYS_RES_IRQ && - (ic = simplebus_get_interrupt_parent(child)) != NULL) - return (FDT_IC_ACTIVATE_INTR(ic, r)); - - return (bus_generic_activate_resource(dev, child, type, rid, r)); -} - -static int -simplebus_deactivate_resource(device_t dev, device_t child, int type, int rid, - struct resource *r) -{ - device_t ic; - - if (type == SYS_RES_IRQ && - (ic = simplebus_get_interrupt_parent(child)) != NULL) - return (FDT_IC_DEACTIVATE_INTR(ic, r)); - - return (bus_generic_deactivate_resource(dev, child, type, rid, r)); -} - -static int -simplebus_release_resource(device_t dev, device_t child, int type, int rid, - struct resource *r) +simplebus_print_res(struct simplebus_devinfo *di) { - device_t ic; - - if (type == SYS_RES_IRQ && - (ic = simplebus_get_interrupt_parent(child)) != NULL) - return (FDT_IC_RELEASE_INTR(ic, r)); - - return (bus_generic_release_resource(dev, child, type, rid, r)); -} - -static struct resource_list * -simplebus_get_resource_list(device_t bus, device_t child) -{ - struct simplebus_devinfo *di; - - di = device_get_ivars(child); - return (&di->di_res); -} - -static device_t -simplebus_get_interrupt_parent(device_t dev) -{ - struct simplebus_devinfo *di; - struct fdt_ic *ic; - device_t ip; - phandle_t ph, iph; - - ip = NULL; - - di = device_get_ivars(dev); - if (di == NULL) - return (NULL); + int rv; - if (OF_getencprop(di->di_ofw.obd_node, "interrupt-parent", &iph, - sizeof(iph)) > 0) { - ph = OF_xref_phandle(iph); - SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { - if (ic->iph == ph) { - ip = ic->dev; - break; - } - } - } - return (ip); + rv = 0; + rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#lx"); + rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%ld"); + return (rv); } -static int -simplebus_setup_intr(device_t bus, device_t child, struct resource *res, - int flags, driver_filter_t *filter, driver_intr_t *ihand, void *arg, - void **cookiep) +static void +simplebus_probe_nomatch(device_t bus, device_t child) { - struct simplebus_devinfo *di; - device_t ic; - enum intr_trigger trig; - enum intr_polarity pol; - int error, irq, rid; + const char *name, *type; - di = device_get_ivars(child); - if (di == NULL) - return (ENXIO); - - if (res == NULL) - return (EINVAL); + if (!bootverbose) + return; - rid = rman_get_rid(res); - if (rid >= DI_MAX_INTR_NUM) - return (ENOENT); - - ic = simplebus_get_interrupt_parent(child); - - trig = di->di_intr_sl[rid].trig; - pol = di->di_intr_sl[rid].pol; - if (trig != INTR_TRIGGER_CONFORM || pol != INTR_POLARITY_CONFORM) { - irq = rman_get_start(res); - if (ic != NULL) - error = FDT_IC_CONFIG_INTR(ic, irq, trig, pol); - else - error = bus_generic_config_intr(bus, irq, trig, pol); - if (error) - return (error); - } + name = ofw_bus_get_name(child); + type = ofw_bus_get_type(child); - if (ic != NULL) - error = FDT_IC_SETUP_INTR(ic, child, res, flags, filter, - ihand, arg, cookiep); - else - error = bus_generic_setup_intr(bus, child, res, flags, filter, - ihand, arg, cookiep); - return (error); + device_printf(bus, "<%s>", name != NULL ? name : "unknown"); + simplebus_print_res(device_get_ivars(child)); + printf(" type %s (no driver attached)\n", + type != NULL ? type : "unknown"); } static int -simplebus_teardown_intr(device_t bus, device_t child, struct resource *res, - void *cookie) +simplebus_print_child(device_t bus, device_t child) { - device_t ic; - - if ((ic = simplebus_get_interrupt_parent(child)) != NULL) - return (FDT_IC_TEARDOWN_INTR(ic, child, res, cookie)); + int rv; - return (bus_generic_teardown_intr(bus, child, res, cookie)); + rv = bus_print_child_header(bus, child); + rv += simplebus_print_res(device_get_ivars(child)); + rv += bus_print_child_footer(bus, child); + return (rv); } -static const struct ofw_bus_devinfo * -simplebus_get_devinfo(device_t bus, device_t child) -{ - struct simplebus_devinfo *di; - - di = device_get_ivars(child); - return (&di->di_ofw); -} Modified: stable/10/sys/dev/ofw/ofw_bus.h ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus.h Thu May 15 14:23:36 2014 (r266127) +++ stable/10/sys/dev/ofw/ofw_bus.h Thu May 15 14:26:11 2014 (r266128) @@ -71,15 +71,9 @@ ofw_bus_get_type(device_t dev) } static __inline int -ofw_bus_map_intr(device_t dev, phandle_t iparent, int irq) +ofw_bus_map_intr(device_t dev, phandle_t iparent, int icells, pcell_t *intr) { - return (OFW_BUS_MAP_INTR(dev, dev, iparent, irq)); -} - -static __inline int -ofw_bus_config_intr(device_t dev, int irq, int sense) -{ - return (OFW_BUS_CONFIG_INTR(dev, dev, irq, sense)); + return (OFW_BUS_MAP_INTR(dev, dev, iparent, icells, intr)); } #endif /* !_DEV_OFW_OFW_BUS_H_ */ Modified: stable/10/sys/dev/ofw/ofw_bus_if.m ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_if.m Thu May 15 14:23:36 2014 (r266127) +++ stable/10/sys/dev/ofw/ofw_bus_if.m Thu May 15 14:26:11 2014 (r266128) @@ -46,6 +46,7 @@ HEADER { char *obd_model; char *obd_name; char *obd_type; + char *obd_status; }; }; @@ -57,7 +58,6 @@ CODE { static ofw_bus_get_node_t ofw_bus_default_get_node; static ofw_bus_get_type_t ofw_bus_default_get_type; static ofw_bus_map_intr_t ofw_bus_default_map_intr; - static ofw_bus_config_intr_t ofw_bus_default_config_intr; static const struct ofw_bus_devinfo * ofw_bus_default_get_devinfo(device_t bus, device_t dev) @@ -103,27 +103,15 @@ CODE { int ofw_bus_default_map_intr(device_t bus, device_t dev, phandle_t iparent, - int irq) + int icells, pcell_t *interrupt) { /* Propagate up the bus hierarchy until someone handles it. */ if (device_get_parent(bus) != NULL) return OFW_BUS_MAP_INTR(device_get_parent(bus), dev, - iparent, irq); + iparent, icells, interrupt); /* If that fails, then assume a one-domain system */ - return (irq); - } - - int - ofw_bus_default_config_intr(device_t bus, device_t dev, int irq, - int sense) - { - /* Propagate up the bus hierarchy until someone handles it. */ - if (device_get_parent(bus) != NULL) - return OFW_BUS_CONFIG_INTR(device_get_parent(bus), dev, - irq, sense); - - return (ENXIO); + return (interrupt[0]); } }; @@ -172,20 +160,14 @@ METHOD const char * get_type { } DEFAULT ofw_bus_default_get_type; # Map an (interrupt parent, IRQ) pair to a unique system-wide interrupt number. +# If the interrupt encoding includes a sense field, the interrupt sense will +# also be configured. METHOD int map_intr { device_t bus; device_t dev; phandle_t iparent; - int irq; + int icells; + pcell_t *interrupt; } DEFAULT ofw_bus_default_map_intr; -# Configure an interrupt using the device-tree encoded sense key (the second -# value in the interrupts property if interrupt-cells is 2). IRQ should be -# encoded as from ofw_bus_map_intr(). -METHOD int config_intr { - device_t bus; - device_t dev; - int irq; - int sense; -} DEFAULT ofw_bus_default_config_intr; Modified: stable/10/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.c Thu May 15 14:23:36 2014 (r266127) +++ stable/10/sys/dev/ofw/ofw_bus_subr.c Thu May 15 14:26:11 2014 (r266128) @@ -55,6 +55,7 @@ ofw_bus_gen_setup_devinfo(struct ofw_bus OF_getprop_alloc(node, "compatible", 1, (void **)&obd->obd_compat); OF_getprop_alloc(node, "device_type", 1, (void **)&obd->obd_type); OF_getprop_alloc(node, "model", 1, (void **)&obd->obd_model); + OF_getprop_alloc(node, "status", 1, (void **)&obd->obd_status); obd->obd_node = node; return (0); } @@ -73,6 +74,8 @@ ofw_bus_gen_destroy_devinfo(struct ofw_b free(obd->obd_name, M_OFWPROP); if (obd->obd_type != NULL) free(obd->obd_type, M_OFWPROP); + if (obd->obd_status != NULL) + free(obd->obd_status, M_OFWPROP); } int @@ -147,6 +150,30 @@ ofw_bus_gen_get_type(device_t bus, devic return (obd->obd_type); } +const char * +ofw_bus_get_status(device_t dev) +{ + const struct ofw_bus_devinfo *obd; + + obd = OFW_BUS_GET_DEVINFO(device_get_parent(dev), dev); + if (obd == NULL) + return (NULL); + + return (obd->obd_status); +} + +int +ofw_bus_status_okay(device_t dev) +{ + const char *status; + + status = ofw_bus_get_status(dev); + if (status == NULL || strcmp(status, "okay") == 0) + return (1); + + return (0); +} + int ofw_bus_is_compatible(device_t dev, const char *onecompat) { Modified: stable/10/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.h Thu May 15 14:23:36 2014 (r266127) +++ stable/10/sys/dev/ofw/ofw_bus_subr.h Thu May 15 14:26:11 2014 (r266128) @@ -72,6 +72,10 @@ int ofw_bus_lookup_imap(phandle_t, struc int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int, phandle_t *); +/* Helper to get device status property */ +const char *ofw_bus_get_status(device_t dev); +int ofw_bus_status_okay(device_t dev); + /* Helper to get node's interrupt parent */ void ofw_bus_find_iparent(phandle_t); Modified: stable/10/sys/dev/ofw/ofw_nexus.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_nexus.c Thu May 15 14:23:36 2014 (r266127) +++ stable/10/sys/dev/ofw/ofw_nexus.c Thu May 15 14:26:11 2014 (r266128) @@ -467,11 +467,10 @@ nexus_setup_dinfo(device_t dev, phandle_ OF_searchencprop(OF_xref_phandle(iparent), "#interrupt-cells", &icells, sizeof(icells)); for (i = 0; i < nintr; i+= icells) { - intr[i] = ofw_bus_map_intr(dev, iparent, intr[i]); + intr[i] = ofw_bus_map_intr(dev, iparent, icells, + &intr[i]); resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i], intr[i], 1); - if (icells > 1) - ofw_bus_config_intr(dev, intr[i], intr[i+1]); } free(intr, M_OFWPROP); } Copied: stable/10/sys/mips/beri/beri_simplebus.c (from r261352, head/sys/mips/beri/beri_simplebus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/mips/beri/beri_simplebus.c Thu May 15 14:26:11 2014 (r266128, copy of r261352, head/sys/mips/beri/beri_simplebus.c) @@ -0,0 +1,425 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf 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 THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include "fdt_ic_if.h" +#include "ofw_bus_if.h" + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 14:37:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DEF4C236; Thu, 15 May 2014 14:37: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 BFB822E8C; Thu, 15 May 2014 14:37: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 s4FEbsq0023588; Thu, 15 May 2014 14:37:54 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FEbqVs023572; Thu, 15 May 2014 14:37:52 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151437.s4FEbqVs023572@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 14:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266130 - in stable/10: contrib/dtc contrib/dtc/Documentation contrib/dtc/libfdt usr.bin X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 14:37:55 -0000 Author: ian Date: Thu May 15 14:37:52 2014 New Revision: 266130 URL: http://svnweb.freebsd.org/changeset/base/266130 Log: MFC r261215, r261257 Merge from vendor branch importing dtc git rev 6a15eb2350426d285130e4c9d84c0bdb6575547a Don't build BSDL dtc if the GPL dtc is enabled. Modified: stable/10/contrib/dtc/Documentation/manual.txt stable/10/contrib/dtc/Makefile stable/10/contrib/dtc/checks.c stable/10/contrib/dtc/data.c stable/10/contrib/dtc/dtc-lexer.l stable/10/contrib/dtc/dtc-parser.y stable/10/contrib/dtc/dtc.c stable/10/contrib/dtc/dtc.h stable/10/contrib/dtc/fdtdump.c stable/10/contrib/dtc/fdtget.c stable/10/contrib/dtc/fdtput.c stable/10/contrib/dtc/flattree.c stable/10/contrib/dtc/libfdt/Makefile.libfdt stable/10/contrib/dtc/libfdt/fdt.c stable/10/contrib/dtc/libfdt/fdt.h stable/10/contrib/dtc/libfdt/fdt_ro.c stable/10/contrib/dtc/libfdt/fdt_rw.c stable/10/contrib/dtc/libfdt/fdt_sw.c stable/10/contrib/dtc/libfdt/fdt_wip.c stable/10/contrib/dtc/libfdt/libfdt.h stable/10/contrib/dtc/libfdt/libfdt_env.h stable/10/contrib/dtc/libfdt/version.lds stable/10/contrib/dtc/livetree.c stable/10/contrib/dtc/srcpos.c stable/10/contrib/dtc/srcpos.h stable/10/contrib/dtc/treesource.c stable/10/contrib/dtc/util.c stable/10/contrib/dtc/util.h stable/10/usr.bin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/dtc/Documentation/manual.txt ============================================================================== --- stable/10/contrib/dtc/Documentation/manual.txt Thu May 15 14:37:35 2014 (r266129) +++ stable/10/contrib/dtc/Documentation/manual.txt Thu May 15 14:37:52 2014 (r266130) @@ -3,6 +3,7 @@ Device Tree Compiler Manual I - "dtc", the device tree compiler 1) Obtaining Sources + 1.1) Submitting Patches 2) Description 3) Command Line 4) Source File @@ -44,6 +45,10 @@ Tarballs of the 1.0.0 and latest release http://www.jdl.com/software/dtc-v1.2.0.tgz http://www.jdl.com/software/dtc-latest.tgz +1.1) Submitting Patches + +Patches should be sent to jdl@jdl.com, and CC'ed to +devicetree-discuss@lists.ozlabs.org. 2) Description Modified: stable/10/contrib/dtc/Makefile ============================================================================== --- stable/10/contrib/dtc/Makefile Thu May 15 14:37:35 2014 (r266129) +++ stable/10/contrib/dtc/Makefile Thu May 15 14:37:52 2014 (r266130) @@ -9,7 +9,7 @@ # CONFIG_LOCALVERSION from some future config system. # VERSION = 1 -PATCHLEVEL = 3 +PATCHLEVEL = 4 SUBLEVEL = 0 EXTRAVERSION = LOCAL_VERSION = @@ -160,18 +160,26 @@ endif # intermediate target and building them again "for real" .SECONDARY: $(DTC_GEN_SRCS) $(CONVERT_GEN_SRCS) -install: all $(SCRIPTS) - @$(VECHO) INSTALL +install-bin: all $(SCRIPTS) + @$(VECHO) INSTALL-BIN $(INSTALL) -d $(DESTDIR)$(BINDIR) $(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR) + +install-lib: all + @$(VECHO) INSTALL-LIB $(INSTALL) -d $(DESTDIR)$(LIBDIR) $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR) ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname) ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT) $(INSTALL) -m 644 $(LIBFDT_archive) $(DESTDIR)$(LIBDIR) + +install-includes: + @$(VECHO) INSTALL-INC $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR) $(INSTALL) -m 644 $(LIBFDT_include) $(DESTDIR)$(INCLUDEDIR) +install: install-bin install-lib install-includes + $(VERSION_FILE): Makefile FORCE $(call filechk,version) Modified: stable/10/contrib/dtc/checks.c ============================================================================== --- stable/10/contrib/dtc/checks.c Thu May 15 14:37:35 2014 (r266129) +++ stable/10/contrib/dtc/checks.c Thu May 15 14:37:52 2014 (r266130) @@ -53,7 +53,7 @@ struct check { void *data; bool warn, error; enum checkstatus status; - int inprogress; + bool inprogress; int num_prereqs; struct check **prereq; }; @@ -141,9 +141,9 @@ static void check_nodes_props(struct che check_nodes_props(c, dt, child); } -static int run_check(struct check *c, struct node *dt) +static bool run_check(struct check *c, struct node *dt) { - int error = 0; + bool error = false; int i; assert(!c->inprogress); @@ -151,11 +151,11 @@ static int run_check(struct check *c, st if (c->status != UNCHECKED) goto out; - c->inprogress = 1; + c->inprogress = true; for (i = 0; i < c->num_prereqs; i++) { struct check *prq = c->prereq[i]; - error |= run_check(prq, dt); + error = error || run_check(prq, dt); if (prq->status != PASSED) { c->status = PREREQ; check_msg(c, "Failed prerequisite '%s'", @@ -177,9 +177,9 @@ static int run_check(struct check *c, st TRACE(c, "\tCompleted, status %d", c->status); out: - c->inprogress = 0; + c->inprogress = false; if ((c->status != PASSED) && (c->error)) - error = 1; + error = true; return error; } @@ -256,11 +256,15 @@ static void check_duplicate_property_nam { struct property *prop, *prop2; - for_each_property(node, prop) - for (prop2 = prop->next; prop2; prop2 = prop2->next) + for_each_property(node, prop) { + for (prop2 = prop->next; prop2; prop2 = prop2->next) { + if (prop2->deleted) + continue; if (streq(prop->name, prop2->name)) FAIL(c, "Duplicate property name %s in %s", prop->name, node->fullpath); + } + } } NODE_ERROR(duplicate_property_names, NULL); @@ -729,7 +733,7 @@ void parse_checks_option(bool warn, bool die("Unrecognized check name \"%s\"\n", name); } -void process_checks(int force, struct boot_info *bi) +void process_checks(bool force, struct boot_info *bi) { struct node *dt = bi->dt; int i; Modified: stable/10/contrib/dtc/data.c ============================================================================== --- stable/10/contrib/dtc/data.c Thu May 15 14:37:35 2014 (r266129) +++ stable/10/contrib/dtc/data.c Thu May 15 14:37:52 2014 (r266130) @@ -250,20 +250,20 @@ struct data data_add_marker(struct data return data_append_markers(d, m); } -int data_is_one_string(struct data d) +bool data_is_one_string(struct data d) { int i; int len = d.len; if (len == 0) - return 0; + return false; for (i = 0; i < len-1; i++) if (d.val[i] == '\0') - return 0; + return false; if (d.val[len-1] != '\0') - return 0; + return false; - return 1; + return true; } Modified: stable/10/contrib/dtc/dtc-lexer.l ============================================================================== --- stable/10/contrib/dtc/dtc-lexer.l Thu May 15 14:37:35 2014 (r266129) +++ stable/10/contrib/dtc/dtc-lexer.l Thu May 15 14:37:52 2014 (r266130) @@ -44,6 +44,7 @@ YY_BUFFER_STATE include_stack[MAX_INCLUD int include_stack_pointer = 0; YYLTYPE yylloc; +extern bool treesource_error; /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ #define YY_USER_ACTION \ @@ -65,7 +66,8 @@ static int dts_version = 1; BEGIN(V1); \ static void push_input_file(const char *filename); -static int pop_input_file(void); +static bool pop_input_file(void); +static void lexical_error(const char *fmt, ...); %} %% @@ -75,6 +77,27 @@ static int pop_input_file(void); push_input_file(name); } +<*>^"#"(line)?[ \t]+[0-9]+[ \t]+{STRING}([ \t]+[0-9]+)? { + char *line, *tmp, *fn; + /* skip text before line # */ + line = yytext; + while (!isdigit((unsigned char)*line)) + line++; + /* skip digits in line # */ + tmp = line; + while (!isspace((unsigned char)*tmp)) + tmp++; + /* "NULL"-terminate line # */ + *tmp = '\0'; + /* start of filename */ + fn = strchr(tmp + 1, '"') + 1; + /* strip trailing " from filename */ + tmp = strchr(fn, '"'); + *tmp = 0; + /* -1 since #line is the number of the next line */ + srcpos_set_line(xstrdup(fn), atoi(line) - 1); + } + <*><> { if (!pop_input_file()) { yyterminate(); @@ -107,6 +130,20 @@ static int pop_input_file(void); return DT_BITS; } +<*>"/delete-property/" { + DPRINT("Keyword: /delete-property/\n"); + DPRINT("\n"); + BEGIN(PROPNODENAME); + return DT_DEL_PROP; + } + +<*>"/delete-node/" { + DPRINT("Keyword: /delete-node/\n"); + DPRINT("\n"); + BEGIN(PROPNODENAME); + return DT_DEL_NODE; + } + <*>{LABEL}: { DPRINT("Label: %s\n", yytext); yylval.labelref = xstrdup(yytext); @@ -115,15 +152,42 @@ static int pop_input_file(void); } ([0-9]+|0[xX][0-9a-fA-F]+)(U|L|UL|LL|ULL)? { - yylval.literal = xstrdup(yytext); - DPRINT("Literal: '%s'\n", yylval.literal); + char *e; + DPRINT("Integer Literal: '%s'\n", yytext); + + errno = 0; + yylval.integer = strtoull(yytext, &e, 0); + + assert(!(*e) || !e[strspn(e, "UL")]); + + if (errno == ERANGE) + lexical_error("Integer literal '%s' out of range", + yytext); + else + /* ERANGE is the only strtoull error triggerable + * by strings matching the pattern */ + assert(errno == 0); return DT_LITERAL; } <*>{CHAR_LITERAL} { - yytext[yyleng-1] = '\0'; - yylval.literal = xstrdup(yytext+1); - DPRINT("Character literal: %s\n", yylval.literal); + struct data d; + DPRINT("Character literal: %s\n", yytext); + + d = data_copy_escape_string(yytext+1, yyleng-2); + if (d.len == 1) { + lexical_error("Empty character literal"); + yylval.integer = 0; + return DT_CHAR_LITERAL; + } + + yylval.integer = (unsigned char)d.val[0]; + + if (d.len > 2) + lexical_error("Character literal has %d" + " characters instead of 1", + d.len - 1); + return DT_CHAR_LITERAL; } @@ -152,9 +216,10 @@ static int pop_input_file(void); return ']'; } -{PROPNODECHAR}+ { +\\?{PROPNODECHAR}+ { DPRINT("PropNodeName: %s\n", yytext); - yylval.propnodename = xstrdup(yytext); + yylval.propnodename = xstrdup((yytext[0] == '\\') ? + yytext + 1 : yytext); BEGIN_DEFAULT(); return DT_PROPNODENAME; } @@ -210,10 +275,10 @@ static void push_input_file(const char * } -static int pop_input_file(void) +static bool pop_input_file(void) { if (srcfile_pop() == 0) - return 0; + return false; assert(include_stack_pointer > 0); @@ -223,5 +288,16 @@ static int pop_input_file(void) yyin = current_srcfile->f; - return 1; + return true; +} + +static void lexical_error(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + srcpos_verror(&yylloc, "Lexical error", fmt, ap); + va_end(ap); + + treesource_error = true; } Modified: stable/10/contrib/dtc/dtc-parser.y ============================================================================== --- stable/10/contrib/dtc/dtc-parser.y Thu May 15 14:37:35 2014 (r266129) +++ stable/10/contrib/dtc/dtc-parser.y Thu May 15 14:37:52 2014 (r266130) @@ -31,15 +31,11 @@ extern void print_error(char const *fmt, extern void yyerror(char const *s); extern struct boot_info *the_boot_info; -extern int treesource_error; - -static unsigned long long eval_literal(const char *s, int base, int bits); -static unsigned char eval_char_literal(const char *s); +extern bool treesource_error; %} %union { char *propnodename; - char *literal; char *labelref; unsigned int cbase; uint8_t byte; @@ -62,9 +58,11 @@ static unsigned char eval_char_literal(c %token DT_MEMRESERVE %token DT_LSHIFT DT_RSHIFT DT_LE DT_GE DT_EQ DT_NE DT_AND DT_OR %token DT_BITS +%token DT_DEL_PROP +%token DT_DEL_NODE %token DT_PROPNODENAME -%token DT_LITERAL -%token DT_CHAR_LITERAL +%token DT_LITERAL +%token DT_CHAR_LITERAL %token DT_BASE %token DT_BYTE %token DT_STRING @@ -153,6 +151,17 @@ devicetree: print_error("label or path, '%s', not found", $2); $$ = $1; } + | devicetree DT_DEL_NODE DT_REF ';' + { + struct node *target = get_node_by_ref($1, $3); + + if (!target) + print_error("label or path, '%s', not found", $3); + else + delete_node(target); + + $$ = $1; + } ; nodedef: @@ -182,6 +191,10 @@ propdef: { $$ = build_property($1, empty_data); } + | DT_DEL_PROP DT_PROPNODENAME ';' + { + $$ = build_property_delete($2); + } | DT_LABEL propdef { add_label(&$2->labels, $1); @@ -213,10 +226,9 @@ propdata: if ($6 != 0) if (fseek(f, $6, SEEK_SET) != 0) - print_error("Couldn't seek to offset %llu in \"%s\": %s", - (unsigned long long)$6, - $4.val, - strerror(errno)); + die("Couldn't seek to offset %llu in \"%s\": %s", + (unsigned long long)$6, $4.val, + strerror(errno)); d = data_copy_file(f, $8); @@ -257,18 +269,20 @@ propdataprefix: arrayprefix: DT_BITS DT_LITERAL '<' { - $$.data = empty_data; - $$.bits = eval_literal($2, 0, 7); + unsigned long long bits; - if (($$.bits != 8) && - ($$.bits != 16) && - ($$.bits != 32) && - ($$.bits != 64)) + bits = $2; + + if ((bits != 8) && (bits != 16) && + (bits != 32) && (bits != 64)) { print_error("Only 8, 16, 32 and 64-bit elements" " are currently supported"); - $$.bits = 32; + bits = 32; } + + $$.data = empty_data; + $$.bits = bits; } | '<' { @@ -317,13 +331,7 @@ arrayprefix: integer_prim: DT_LITERAL - { - $$ = eval_literal($1, 0, 64); - } | DT_CHAR_LITERAL - { - $$ = eval_char_literal($1); - } | '(' integer_expr ')' { $$ = $2; @@ -440,6 +448,10 @@ subnode: { $$ = name_node($2, $1); } + | DT_DEL_NODE DT_PROPNODENAME ';' + { + $$ = name_node(build_node_delete(), $2); + } | DT_LABEL subnode { add_label(&$2->labels, $1); @@ -454,58 +466,12 @@ void print_error(char const *fmt, ...) va_list va; va_start(va, fmt); - srcpos_verror(&yylloc, fmt, va); + srcpos_verror(&yylloc, "Error", fmt, va); va_end(va); - treesource_error = 1; + treesource_error = true; } void yyerror(char const *s) { print_error("%s", s); } - -static unsigned long long eval_literal(const char *s, int base, int bits) -{ - unsigned long long val; - char *e; - - errno = 0; - val = strtoull(s, &e, base); - if (*e) { - size_t uls = strspn(e, "UL"); - if (e[uls]) - print_error("bad characters in literal"); - } - if ((errno == ERANGE) - || ((bits < 64) && (val >= (1ULL << bits)))) - print_error("literal out of range"); - else if (errno != 0) - print_error("bad literal"); - return val; -} - -static unsigned char eval_char_literal(const char *s) -{ - int i = 1; - char c = s[0]; - - if (c == '\0') - { - print_error("empty character literal"); - return 0; - } - - /* - * If the first character in the character literal is a \ then process - * the remaining characters as an escape encoding. If the first - * character is neither an escape or a terminator it should be the only - * character in the literal and will be returned. - */ - if (c == '\\') - c = get_escape_char(s, &i); - - if (s[i] != '\0') - print_error("malformed character literal"); - - return c; -} Modified: stable/10/contrib/dtc/dtc.c ============================================================================== --- stable/10/contrib/dtc/dtc.c Thu May 15 14:37:35 2014 (r266129) +++ stable/10/contrib/dtc/dtc.c Thu May 15 14:37:52 2014 (r266130) @@ -21,8 +21,6 @@ #include "dtc.h" #include "srcpos.h" -#include "version_gen.h" - /* * Command line options */ @@ -49,55 +47,60 @@ static void fill_fullpaths(struct node * fill_fullpaths(child, tree->fullpath); } -static void __attribute__ ((noreturn)) usage(void) -{ - fprintf(stderr, "Usage:\n"); - fprintf(stderr, "\tdtc [options] \n"); - fprintf(stderr, "\nOptions:\n"); - fprintf(stderr, "\t-h\n"); - fprintf(stderr, "\t\tThis help text\n"); - fprintf(stderr, "\t-q\n"); - fprintf(stderr, "\t\tQuiet: -q suppress warnings, -qq errors, -qqq all\n"); - fprintf(stderr, "\t-I \n"); - fprintf(stderr, "\t\tInput formats are:\n"); - fprintf(stderr, "\t\t\tdts - device tree source text\n"); - fprintf(stderr, "\t\t\tdtb - device tree blob\n"); - fprintf(stderr, "\t\t\tfs - /proc/device-tree style directory\n"); - fprintf(stderr, "\t-o \n"); - fprintf(stderr, "\t-O \n"); - fprintf(stderr, "\t\tOutput formats are:\n"); - fprintf(stderr, "\t\t\tdts - device tree source text\n"); - fprintf(stderr, "\t\t\tdtb - device tree blob\n"); - fprintf(stderr, "\t\t\tasm - assembler source\n"); - fprintf(stderr, "\t-V \n"); - fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", DEFAULT_FDT_VERSION); - fprintf(stderr, "\t-d \n"); - fprintf(stderr, "\t-R \n"); - fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); - fprintf(stderr, "\t-S \n"); - fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); - fprintf(stderr, "\t-p \n"); - fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); - fprintf(stderr, "\t-b \n"); - fprintf(stderr, "\t\tSet the physical boot cpu\n"); - fprintf(stderr, "\t-f\n"); - fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n"); - fprintf(stderr, "\t-i\n"); - fprintf(stderr, "\t\tAdd a path to search for include files\n"); - fprintf(stderr, "\t-s\n"); - fprintf(stderr, "\t\tSort nodes and properties before outputting (only useful for\n\t\tcomparing trees)\n"); - fprintf(stderr, "\t-v\n"); - fprintf(stderr, "\t\tPrint DTC version and exit\n"); - fprintf(stderr, "\t-H \n"); - fprintf(stderr, "\t\tphandle formats are:\n"); - fprintf(stderr, "\t\t\tlegacy - \"linux,phandle\" properties only\n"); - fprintf(stderr, "\t\t\tepapr - \"phandle\" properties only\n"); - fprintf(stderr, "\t\t\tboth - Both \"linux,phandle\" and \"phandle\" properties\n"); - fprintf(stderr, "\t-W [no-]\n"); - fprintf(stderr, "\t-E [no-]\n"); - fprintf(stderr, "\t\t\tenable or disable warnings and errors\n"); - exit(3); -} +/* Usage related data. */ +static const char usage_synopsis[] = "dtc [options] "; +static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv"; +static struct option const usage_long_opts[] = { + {"quiet", no_argument, NULL, 'q'}, + {"in-format", a_argument, NULL, 'I'}, + {"out", a_argument, NULL, 'o'}, + {"out-format", a_argument, NULL, 'O'}, + {"out-version", a_argument, NULL, 'V'}, + {"out-dependency", a_argument, NULL, 'd'}, + {"reserve", a_argument, NULL, 'R'}, + {"space", a_argument, NULL, 'S'}, + {"pad", a_argument, NULL, 'p'}, + {"boot-cpu", a_argument, NULL, 'b'}, + {"force", no_argument, NULL, 'f'}, + {"include", a_argument, NULL, 'i'}, + {"sort", no_argument, NULL, 's'}, + {"phandle", a_argument, NULL, 'H'}, + {"warning", a_argument, NULL, 'W'}, + {"error", a_argument, NULL, 'E'}, + {"help", no_argument, NULL, 'h'}, + {"version", no_argument, NULL, 'v'}, + {NULL, no_argument, NULL, 0x0}, +}; +static const char * const usage_opts_help[] = { + "\n\tQuiet: -q suppress warnings, -qq errors, -qqq all", + "\n\tInput formats are:\n" + "\t\tdts - device tree source text\n" + "\t\tdtb - device tree blob\n" + "\t\tfs - /proc/device-tree style directory", + "\n\tOutput file", + "\n\tOutput formats are:\n" + "\t\tdts - device tree source text\n" + "\t\tdtb - device tree blob\n" + "\t\tasm - assembler source", + "\n\tBlob version to produce, defaults to %d (for dtb and asm output)", //, DEFAULT_FDT_VERSION); + "\n\tOutput dependency file", + "\n\ttMake space for reserve map entries (for dtb and asm output)", + "\n\tMake the blob at least long (extra space)", + "\n\tAdd padding to the blob of long (extra space)", + "\n\tSet the physical boot cpu", + "\n\tTry to produce output even if the input tree has errors", + "\n\tAdd a path to search for include files", + "\n\tSort nodes and properties before outputting (useful for comparing trees)", + "\n\tValid phandle formats are:\n" + "\t\tlegacy - \"linux,phandle\" properties only\n" + "\t\tepapr - \"phandle\" properties only\n" + "\t\tboth - Both \"linux,phandle\" and \"phandle\" properties", + "\n\tEnable/disable warnings (prefix with \"no-\")", + "\n\tEnable/disable errors (prefix with \"no-\")", + "\n\tPrint this help and exit", + "\n\tPrint version and exit", + NULL, +}; int main(int argc, char *argv[]) { @@ -106,7 +109,7 @@ int main(int argc, char *argv[]) const char *outform = "dts"; const char *outname = "-"; const char *depname = NULL; - int force = 0, sort = 0; + bool force = false, sort = false; const char *arg; int opt; FILE *outf = NULL; @@ -118,8 +121,7 @@ int main(int argc, char *argv[]) minsize = 0; padsize = 0; - while ((opt = getopt(argc, argv, "hI:O:o:V:d:R:S:p:fqb:i:vH:sW:E:")) - != EOF) { + while ((opt = util_getopt_long()) != EOF) { switch (opt) { case 'I': inform = optarg; @@ -146,7 +148,7 @@ int main(int argc, char *argv[]) padsize = strtol(optarg, NULL, 0); break; case 'f': - force = 1; + force = true; break; case 'q': quiet++; @@ -158,8 +160,7 @@ int main(int argc, char *argv[]) srcfile_add_search_path(optarg); break; case 'v': - printf("Version: %s\n", DTC_VERSION); - exit(0); + util_version(); case 'H': if (streq(optarg, "legacy")) phandle_format = PHANDLE_LEGACY; @@ -173,7 +174,7 @@ int main(int argc, char *argv[]) break; case 's': - sort = 1; + sort = true; break; case 'W': @@ -185,13 +186,14 @@ int main(int argc, char *argv[]) break; case 'h': + usage(NULL); default: - usage(); + usage("unknown option"); } } if (argc > (optind+1)) - usage(); + usage("missing files"); else if (argc < (optind+1)) arg = "-"; else @@ -201,9 +203,6 @@ int main(int argc, char *argv[]) if (minsize && padsize) die("Can't set both -p and -S\n"); - if (minsize) - fprintf(stderr, "DTC: Use of \"-S\" is deprecated; it will be removed soon, use \"-p\" instead\n"); - if (depname) { depfile = fopen(depname, "w"); if (!depfile) Modified: stable/10/contrib/dtc/dtc.h ============================================================================== --- stable/10/contrib/dtc/dtc.h Thu May 15 14:37:35 2014 (r266129) +++ stable/10/contrib/dtc/dtc.h Thu May 15 14:37:52 2014 (r266130) @@ -66,7 +66,6 @@ typedef uint32_t cell_t; #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) #define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) /* Data blobs */ enum markertype { @@ -119,7 +118,7 @@ struct data data_append_align(struct dat struct data data_add_marker(struct data d, enum markertype type, char *ref); -int data_is_one_string(struct data d); +bool data_is_one_string(struct data d); /* DT constraints */ @@ -128,11 +127,13 @@ int data_is_one_string(struct data d); /* Live trees */ struct label { + bool deleted; char *label; struct label *next; }; struct property { + bool deleted; char *name; struct data val; @@ -142,6 +143,7 @@ struct property { }; struct node { + bool deleted; char *name; struct property *proplist; struct node *children; @@ -158,28 +160,47 @@ struct node { struct label *labels; }; -#define for_each_label(l0, l) \ +#define for_each_label_withdel(l0, l) \ for ((l) = (l0); (l); (l) = (l)->next) -#define for_each_property(n, p) \ +#define for_each_label(l0, l) \ + for_each_label_withdel(l0, l) \ + if (!(l)->deleted) + +#define for_each_property_withdel(n, p) \ for ((p) = (n)->proplist; (p); (p) = (p)->next) -#define for_each_child(n, c) \ +#define for_each_property(n, p) \ + for_each_property_withdel(n, p) \ + if (!(p)->deleted) + +#define for_each_child_withdel(n, c) \ for ((c) = (n)->children; (c); (c) = (c)->next_sibling) +#define for_each_child(n, c) \ + for_each_child_withdel(n, c) \ + if (!(c)->deleted) + void add_label(struct label **labels, char *label); +void delete_labels(struct label **labels); struct property *build_property(char *name, struct data val); +struct property *build_property_delete(char *name); struct property *chain_property(struct property *first, struct property *list); struct property *reverse_properties(struct property *first); struct node *build_node(struct property *proplist, struct node *children); +struct node *build_node_delete(void); struct node *name_node(struct node *node, char *name); struct node *chain_node(struct node *first, struct node *list); struct node *merge_nodes(struct node *old_node, struct node *new_node); void add_property(struct node *node, struct property *prop); +void delete_property_by_name(struct node *node, char *name); +void delete_property(struct property *prop); void add_child(struct node *parent, struct node *child); +void delete_node_by_name(struct node *parent, char *name); +void delete_node(struct node *node); const char *get_unitname(struct node *node); struct property *get_property(struct node *node, const char *propname); @@ -227,7 +248,7 @@ void sort_tree(struct boot_info *bi); /* Checks */ void parse_checks_option(bool warn, bool error, const char *optarg); -void process_checks(int force, struct boot_info *bi); +void process_checks(bool force, struct boot_info *bi); /* Flattened trees */ Modified: stable/10/contrib/dtc/fdtdump.c ============================================================================== --- stable/10/contrib/dtc/fdtdump.c Thu May 15 14:37:35 2014 (r266129) +++ stable/10/contrib/dtc/fdtdump.c Thu May 15 14:37:52 2014 (r266130) @@ -2,14 +2,16 @@ * fdtdump.c - Contributed by Pantelis Antoniou */ +#include #include #include #include #include #include -#include +#include #include +#include #include "util.h" @@ -17,33 +19,29 @@ #define PALIGN(p, a) ((void *)(ALIGN((unsigned long)(p), (a)))) #define GET_CELL(p) (p += 4, *((const uint32_t *)(p-4))) -static void print_data(const char *data, int len) +static const char *tagname(uint32_t tag) { - int i; - const char *p = data; - - /* no data, don't print */ - if (len == 0) - return; - - if (util_is_printable_string(data, len)) { - printf(" = \"%s\"", (const char *)data); - } else if ((len % 4) == 0) { - printf(" = <"); - for (i = 0; i < len; i += 4) - printf("0x%08x%s", fdt32_to_cpu(GET_CELL(p)), - i < (len - 4) ? " " : ""); - printf(">"); - } else { - printf(" = ["); - for (i = 0; i < len; i++) - printf("%02x%s", *p++, i < len - 1 ? " " : ""); - printf("]"); - } + static const char * const names[] = { +#define TN(t) [t] #t + TN(FDT_BEGIN_NODE), + TN(FDT_END_NODE), + TN(FDT_PROP), + TN(FDT_NOP), + TN(FDT_END), +#undef TN + }; + if (tag < ARRAY_SIZE(names)) + if (names[tag]) + return names[tag]; + return "FDT_???"; } -static void dump_blob(void *blob) +#define dumpf(fmt, args...) \ + do { if (debug) printf("// " fmt, ## args); } while (0) + +static void dump_blob(void *blob, bool debug) { + uintptr_t blob_off = (uintptr_t)blob; struct fdt_header *bph = blob; uint32_t off_mem_rsvmap = fdt32_to_cpu(bph->off_mem_rsvmap); uint32_t off_dt = fdt32_to_cpu(bph->off_dt_struct); @@ -97,7 +95,8 @@ static void dump_blob(void *blob) p = p_struct; while ((tag = fdt32_to_cpu(GET_CELL(p))) != FDT_END) { - /* printf("tag: 0x%08x (%d)\n", tag, p - p_struct); */ + dumpf("%04zx: tag: 0x%08x (%s)\n", + (uintptr_t)p - blob_off - 4, tag, tagname(tag)); if (tag == FDT_BEGIN_NODE) { s = p; @@ -136,27 +135,93 @@ static void dump_blob(void *blob) p = PALIGN(p + sz, 4); + dumpf("%04zx: string: %s\n", (uintptr_t)s - blob_off, s); + dumpf("%04zx: value\n", (uintptr_t)t - blob_off); printf("%*s%s", depth * shift, "", s); - print_data(t, sz); + utilfdt_print_data(t, sz); printf(";\n"); } } +/* Usage related data. */ +static const char usage_synopsis[] = "fdtdump [options] "; +static const char usage_short_opts[] = "ds" USAGE_COMMON_SHORT_OPTS; +static struct option const usage_long_opts[] = { + {"debug", no_argument, NULL, 'd'}, + {"scan", no_argument, NULL, 's'}, + USAGE_COMMON_LONG_OPTS +}; +static const char * const usage_opts_help[] = { + "Dump debug information while decoding the file", + "Scan for an embedded fdt in file", + USAGE_COMMON_OPTS_HELP +}; int main(int argc, char *argv[]) { + int opt; + const char *file; char *buf; + bool debug = false; + bool scan = false; + off_t len; + + while ((opt = util_getopt_long()) != EOF) { + switch (opt) { + case_USAGE_COMMON_FLAGS - if (argc < 2) { - fprintf(stderr, "supply input filename\n"); - return 5; + case 'd': + debug = true; + break; + case 's': + scan = true; + break; + } + } + if (optind != argc - 1) + usage("missing input filename"); + file = argv[optind]; + + buf = utilfdt_read_len(file, &len); + if (!buf) + die("could not read: %s\n", file); + + /* try and locate an embedded fdt in a bigger blob */ + if (scan) { + unsigned char smagic[4]; + char *p = buf; + char *endp = buf + len; + + fdt_set_magic(smagic, FDT_MAGIC); + + /* poor man's memmem */ + while (true) { + p = memchr(p, smagic[0], endp - p - 4); + if (!p) + break; + if (fdt_magic(p) == FDT_MAGIC) { + /* try and validate the main struct */ + off_t this_len = endp - p; + fdt32_t max_version = 17; + if (fdt_version(p) <= max_version && + fdt_last_comp_version(p) < max_version && + fdt_totalsize(p) < this_len && + fdt_off_dt_struct(p) < this_len && + fdt_off_dt_strings(p) < this_len) + break; + if (debug) + printf("%s: skipping fdt magic at offset %#zx\n", + file, p - buf); + } + ++p; + } + if (!p) + die("%s: could not locate fdt magic\n", file); + printf("%s: found fdt at offset %#zx\n", file, p - buf); + buf = p; } - buf = utilfdt_read(argv[1]); - if (buf) - dump_blob(buf); - else - return 10; + dump_blob(buf, debug); return 0; } Modified: stable/10/contrib/dtc/fdtget.c ============================================================================== --- stable/10/contrib/dtc/fdtget.c Thu May 15 14:37:35 2014 (r266129) +++ stable/10/contrib/dtc/fdtget.c Thu May 15 14:37:52 2014 (r266130) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 15:02:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A1544D4C; Thu, 15 May 2014 15:02: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 8D6BF2136; Thu, 15 May 2014 15:02: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 s4FF2nOH038772; Thu, 15 May 2014 15:02:49 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FF2nIB038769; Thu, 15 May 2014 15:02:49 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151502.s4FF2nIB038769@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 15:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266133 - in stable/10/lib/msun: arm src X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:02:49 -0000 Author: ian Date: Thu May 15 15:02:48 2014 New Revision: 266133 URL: http://svnweb.freebsd.org/changeset/base/266133 Log: MFC r257207, r261161, r261163: Update the hard-float version of the fenv functions to use the VFP unit. Any other floating-point unit is unsupported on ARM. Use __fenv_static for all static inline functions. Correctly shift the mask when masking/unmasking exceptions. Modified: stable/10/lib/msun/arm/fenv.h stable/10/lib/msun/src/fenv-softfloat.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/arm/fenv.h ============================================================================== --- stable/10/lib/msun/arm/fenv.h Thu May 15 14:48:25 2014 (r266132) +++ stable/10/lib/msun/arm/fenv.h Thu May 15 15:02:48 2014 (r266133) @@ -44,14 +44,27 @@ typedef __uint32_t fexcept_t; #define FE_OVERFLOW 0x0004 #define FE_UNDERFLOW 0x0008 #define FE_INEXACT 0x0010 +#ifdef __ARM_PCS_VFP +#define FE_DENORMAL 0x0080 +#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | \ + FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW | FE_DENORMAL) +#else #define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | \ FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW) +#endif /* Rounding modes */ +#ifdef __ARM_PCS_VFP +#define FE_TONEAREST 0x00000000 +#define FE_UPWARD 0x00400000 +#define FE_DOWNWARD 0x00800000 +#define FE_TOWARDZERO 0x00c00000 +#else #define FE_TONEAREST 0x0000 #define FE_TOWARDZERO 0x0001 #define FE_UPWARD 0x0002 #define FE_DOWNWARD 0x0003 +#endif #define _ROUND_MASK (FE_TONEAREST | FE_DOWNWARD | \ FE_UPWARD | FE_TOWARDZERO) __BEGIN_DECLS @@ -61,10 +74,12 @@ extern const fenv_t __fe_dfl_env; #define FE_DFL_ENV (&__fe_dfl_env) /* We need to be able to map status flag positions to mask flag positions */ -#define _FPUSW_SHIFT 16 +#ifndef __ARM_PCS_VFP +#define _FPUSW_SHIFT 16 #define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT) +#endif -#ifndef ARM_HARD_FLOAT +#ifndef __ARM_PCS_VFP int feclearexcept(int __excepts); int fegetexceptflag(fexcept_t *__flagp, int __excepts); @@ -78,19 +93,21 @@ int feholdexcept(fenv_t *__envp); int fesetenv(const fenv_t *__envp); int feupdateenv(const fenv_t *__envp); -#else /* ARM_HARD_FLOAT */ +#else /* __ARM_PCS_VFP */ + +#define vmrs_fpscr(__r) __asm __volatile("vmrs %0, fpscr" : "=&r"(__r)) +#define vmsr_fpscr(__r) __asm __volatile("vmsr fpscr, %0" : : "r"(__r)) -#define __rfs(__fpsr) __asm __volatile("rfs %0" : "=r" (*(__fpsr))) -#define __wfs(__fpsr) __asm __volatile("wfs %0" : : "r" (__fpsr)) +#define _FPU_MASK_SHIFT 8 __fenv_static inline int feclearexcept(int __excepts) { fexcept_t __fpsr; - __rfs(&__fpsr); + vmrs_fpscr(__fpsr); __fpsr &= ~__excepts; - __wfs(__fpsr); + vmsr_fpscr(__fpsr); return (0); } @@ -99,7 +116,7 @@ fegetexceptflag(fexcept_t *__flagp, int { fexcept_t __fpsr; - __rfs(&__fpsr); + vmrs_fpscr(__fpsr); *__flagp = __fpsr & __excepts; return (0); } @@ -109,10 +126,10 @@ fesetexceptflag(const fexcept_t *__flagp { fexcept_t __fpsr; - __rfs(&__fpsr); + vmrs_fpscr(__fpsr); __fpsr &= ~__excepts; __fpsr |= *__flagp & __excepts; - __wfs(__fpsr); + vmsr_fpscr(__fpsr); return (0); } @@ -130,34 +147,36 @@ fetestexcept(int __excepts) { fexcept_t __fpsr; - __rfs(&__fpsr); + vmrs_fpscr(__fpsr); return (__fpsr & __excepts); } __fenv_static inline int fegetround(void) { + fenv_t __fpsr; - /* - * Apparently, the rounding mode is specified as part of the - * instruction format on ARM, so the dynamic rounding mode is - * indeterminate. Some FPUs may differ. - */ - return (-1); + vmrs_fpscr(__fpsr); + return (__fpsr & _ROUND_MASK); } __fenv_static inline int fesetround(int __round) { + fenv_t __fpsr; - return (-1); + vmrs_fpscr(__fpsr); + __fpsr &= ~(_ROUND_MASK); + __fpsr |= __round; + vmsr_fpscr(__fpsr); + return (0); } __fenv_static inline int fegetenv(fenv_t *__envp) { - __rfs(__envp); + vmrs_fpscr(*__envp); return (0); } @@ -166,10 +185,10 @@ feholdexcept(fenv_t *__envp) { fenv_t __env; - __rfs(&__env); + vmrs_fpscr(__env); *__envp = __env; - __env &= ~(FE_ALL_EXCEPT | _ENABLE_MASK); - __wfs(__env); + __env &= ~(FE_ALL_EXCEPT); + vmsr_fpscr(__env); return (0); } @@ -177,7 +196,7 @@ __fenv_static inline int fesetenv(const fenv_t *__envp) { - __wfs(*__envp); + vmsr_fpscr(*__envp); return (0); } @@ -186,8 +205,8 @@ feupdateenv(const fenv_t *__envp) { fexcept_t __fpsr; - __rfs(&__fpsr); - __wfs(*__envp); + vmrs_fpscr(__fpsr); + vmsr_fpscr(*__envp); feraiseexcept(__fpsr & FE_ALL_EXCEPT); return (0); } @@ -196,40 +215,42 @@ feupdateenv(const fenv_t *__envp) /* We currently provide no external definitions of the functions below. */ -static inline int +__fenv_static inline int feenableexcept(int __mask) { fenv_t __old_fpsr, __new_fpsr; - __rfs(&__old_fpsr); - __new_fpsr = __old_fpsr | (__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT; - __wfs(__new_fpsr); - return ((__old_fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT); + vmrs_fpscr(__old_fpsr); + __new_fpsr = __old_fpsr | + ((__mask & FE_ALL_EXCEPT) << _FPU_MASK_SHIFT); + vmsr_fpscr(__new_fpsr); + return ((__old_fpsr >> _FPU_MASK_SHIFT) & FE_ALL_EXCEPT); } -static inline int +__fenv_static inline int fedisableexcept(int __mask) { fenv_t __old_fpsr, __new_fpsr; - __rfs(&__old_fpsr); - __new_fpsr = __old_fpsr & ~((__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT); - __wfs(__new_fpsr); - return ((__old_fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT); + vmrs_fpscr(__old_fpsr); + __new_fpsr = __old_fpsr & + ~((__mask & FE_ALL_EXCEPT) << _FPU_MASK_SHIFT); + vmsr_fpscr(__new_fpsr); + return ((__old_fpsr >> _FPU_MASK_SHIFT) & FE_ALL_EXCEPT); } -static inline int +__fenv_static inline int fegetexcept(void) { fenv_t __fpsr; - __rfs(&__fpsr); - return ((__fpsr & _ENABLE_MASK) >> _FPUSW_SHIFT); + vmrs_fpscr(__fpsr); + return (__fpsr & FE_ALL_EXCEPT); } #endif /* __BSD_VISIBLE */ -#endif /* ARM_HARD_FLOAT */ +#endif /* __ARM_PCS_VFP */ __END_DECLS Modified: stable/10/lib/msun/src/fenv-softfloat.h ============================================================================== --- stable/10/lib/msun/src/fenv-softfloat.h Thu May 15 14:48:25 2014 (r266132) +++ stable/10/lib/msun/src/fenv-softfloat.h Thu May 15 15:02:48 2014 (r266133) @@ -156,7 +156,7 @@ feupdateenv(const fenv_t *__envp) /* We currently provide no external definitions of the functions below. */ -static inline int +__fenv_static inline int feenableexcept(int __mask) { int __omask = __softfloat_float_exception_mask; @@ -165,7 +165,7 @@ feenableexcept(int __mask) return (__omask); } -static inline int +__fenv_static inline int fedisableexcept(int __mask) { int __omask = __softfloat_float_exception_mask; @@ -174,7 +174,7 @@ fedisableexcept(int __mask) return (__omask); } -static inline int +__fenv_static inline int fegetexcept(void) { From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 15:15:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D4E082EE; Thu, 15 May 2014 15:15: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 B7AE12254; Thu, 15 May 2014 15:15: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 s4FFFOFE044042; Thu, 15 May 2014 15:15:24 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFFNW9044037; Thu, 15 May 2014 15:15:23 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405151515.s4FFFNW9044037@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 15 May 2014 15:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266135 - in stable/10/sys/dev: gpio ofw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:15:25 -0000 Author: loos Date: Thu May 15 15:15:23 2014 New Revision: 266135 URL: http://svnweb.freebsd.org/changeset/base/266135 Log: MFC r265012, r265191, r265289, r265310 r265012: Fix the gpio-specifier decoding by respecting the GPIO controller's #gpio-cells property. Add a new ofw_bus method (OFW_BUS_MAP_GPIOS()) that allows the GPIO controller to implement its own mapping to deal with gpio-specifiers, allowing the decoding of gpio-specifiers to be controller specific. The default ofw_bus_map_gpios() decodes the linux standard (#gpio-cells = <2>) and the FreeBSD standard (#gpio-cells = <3>). It pass the gpio-specifier flag field to the children as an ivar variable so they can act upon. r265191: Remove unnecessary headers. Sort out the headers. Add a missing header on ofw_gpiobus.c (it was working because of sys/libkern.h). r265289: eally sort out the headers. sys/systm.h must always come after sys/param.h. Remove sys/types.h which should never be included together with sys/param.h. Add sys/malloc.h for correctness even if it seems to don't be needed. Remove more unused headers found by unusedinc (from bde@). r265310: Move gpiobus routines to dev/gpio. Avoid polluting ofw_bus with bus specific parts. Modified: stable/10/sys/dev/gpio/gpio_if.m stable/10/sys/dev/gpio/gpiobus.c stable/10/sys/dev/gpio/gpiobusvar.h stable/10/sys/dev/gpio/ofw_gpiobus.c stable/10/sys/dev/ofw/ofw_bus_if.m Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/gpio/gpio_if.m ============================================================================== --- stable/10/sys/dev/gpio/gpio_if.m Thu May 15 15:14:37 2014 (r266134) +++ stable/10/sys/dev/gpio/gpio_if.m Thu May 15 15:15:23 2014 (r266135) @@ -31,6 +31,32 @@ INTERFACE gpio; +CODE { + static gpio_map_gpios_t gpio_default_map_gpios; + + int + gpio_default_map_gpios(device_t bus, phandle_t dev, + phandle_t gparent, int gcells, pcell_t *gpios, uint32_t *pin, + uint32_t *flags) + { + /* Propagate up the bus hierarchy until someone handles it. */ + if (device_get_parent(bus) != NULL) + return (GPIO_MAP_GPIOS(device_get_parent(bus), dev, + gparent, gcells, gpios, pin, flags)); + + /* If that fails, then assume the FreeBSD defaults. */ + *pin = gpios[0]; + if (gcells == 2 || gcells == 3) + *flags = gpios[gcells - 1]; + + return (0); + } +}; + +HEADER { + #include +}; + # # Get total number of pins # @@ -100,3 +126,16 @@ METHOD int pin_setflags { uint32_t pin_num; uint32_t flags; }; + +# +# Allow the GPIO controller to map the gpio-specifier on its own. +# +METHOD int map_gpios { + device_t bus; + phandle_t dev; + phandle_t gparent; + int gcells; + pcell_t *gpios; + uint32_t *pin; + uint32_t *flags; +} DEFAULT gpio_default_map_gpios; Modified: stable/10/sys/dev/gpio/gpiobus.c ============================================================================== --- stable/10/sys/dev/gpio/gpiobus.c Thu May 15 15:14:37 2014 (r266134) +++ stable/10/sys/dev/gpio/gpiobus.c Thu May 15 15:15:23 2014 (r266135) @@ -29,21 +29,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include #include -#include "gpio_if.h" + #include "gpiobus_if.h" static int gpiobus_parse_pins(struct gpiobus_softc *, device_t, int); Modified: stable/10/sys/dev/gpio/gpiobusvar.h ============================================================================== --- stable/10/sys/dev/gpio/gpiobusvar.h Thu May 15 15:14:37 2014 (r266134) +++ stable/10/sys/dev/gpio/gpiobusvar.h Thu May 15 15:15:23 2014 (r266135) @@ -32,7 +32,6 @@ #include "opt_platform.h" -#include #include #include @@ -40,6 +39,8 @@ #include #endif +#include "gpio_if.h" + #define GPIOBUS_IVAR(d) (struct gpiobus_ivar *) device_get_ivars(d) #define GPIOBUS_SOFTC(d) (struct gpiobus_softc *) device_get_softc(d) #define GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -60,17 +61,29 @@ struct gpiobus_softc int *sc_pins_mapped; /* mark mapped pins */ }; - struct gpiobus_ivar { uint32_t npins; /* pins total */ + uint32_t *flags; /* pins flags */ uint32_t *pins; /* pins map */ }; -void gpiobus_print_pins(struct gpiobus_ivar *); #ifdef FDT +struct ofw_gpiobus_devinfo { + struct gpiobus_ivar opd_dinfo; + struct ofw_bus_devinfo opd_obdinfo; +}; + +static __inline int +gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, + pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + return (GPIO_MAP_GPIOS(bus, dev, gparent, gcells, gpios, pin, flags)); +} + device_t ofw_gpiobus_add_fdt_child(device_t, phandle_t); #endif +void gpiobus_print_pins(struct gpiobus_ivar *); extern driver_t gpiobus_driver; Modified: stable/10/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- stable/10/sys/dev/gpio/ofw_gpiobus.c Thu May 15 15:14:37 2014 (r266134) +++ stable/10/sys/dev/gpio/ofw_gpiobus.c Thu May 15 15:15:23 2014 (r266135) @@ -30,27 +30,14 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include #include -#include -#include +#include #include -#include #include #include -#include - -#include - -#include "gpio_if.h" -#include "gpiobus_if.h" - -struct ofw_gpiobus_devinfo { - struct gpiobus_ivar opd_dinfo; - struct ofw_bus_devinfo opd_obdinfo; -}; static int ofw_gpiobus_parse_gpios(struct gpiobus_softc *, struct gpiobus_ivar *, phandle_t); @@ -83,10 +70,37 @@ ofw_gpiobus_add_fdt_child(device_t bus, } static int +ofw_gpiobus_alloc_ivars(struct gpiobus_ivar *dinfo) +{ + + /* Allocate pins and flags memory. */ + dinfo->pins = malloc(sizeof(uint32_t) * dinfo->npins, M_DEVBUF, + M_NOWAIT | M_ZERO); + if (dinfo->pins == NULL) + return (ENOMEM); + dinfo->flags = malloc(sizeof(uint32_t) * dinfo->npins, M_DEVBUF, + M_NOWAIT | M_ZERO); + if (dinfo->flags == NULL) { + free(dinfo->pins, M_DEVBUF); + return (ENOMEM); + } + + return (0); +} + +static void +ofw_gpiobus_free_ivars(struct gpiobus_ivar *dinfo) +{ + + free(dinfo->flags, M_DEVBUF); + free(dinfo->pins, M_DEVBUF); +} + +static int ofw_gpiobus_parse_gpios(struct gpiobus_softc *sc, struct gpiobus_ivar *dinfo, phandle_t child) { - int i, len; + int cells, i, j, len; pcell_t *gpios; phandle_t gpio; @@ -102,44 +116,81 @@ ofw_gpiobus_parse_gpios(struct gpiobus_s } /* - * Each 'gpios' entry must contain 4 pcells. - * The first one is the GPIO controller phandler. - * Then the last three are the GPIO pin, the GPIO pin direction and - * the GPIO pin flags. + * The gpio-specifier is controller independent, but the first pcell + * has the reference to the GPIO controller phandler. + * One the first pass we count the number of encoded gpio-specifiers. */ - if ((len / sizeof(pcell_t)) % 4) { + i = 0; + len /= sizeof(pcell_t); + while (i < len) { + /* Allow NULL specifiers. */ + if (gpios[i] == 0) { + dinfo->npins++; + i++; + continue; + } + gpio = OF_xref_phandle(gpios[i]); + /* Verify if we're attaching to the correct GPIO controller. */ + if (!OF_hasprop(gpio, "gpio-controller") || + gpio != ofw_bus_get_node(sc->sc_dev)) { + free(gpios, M_DEVBUF); + return (EINVAL); + } + /* Read gpio-cells property for this GPIO controller. */ + if (OF_getencprop(gpio, "#gpio-cells", &cells, + sizeof(cells)) < 0) { + free(gpios, M_DEVBUF); + return (EINVAL); + } + dinfo->npins++; + i += cells + 1; + } + + if (dinfo->npins == 0) { free(gpios, M_DEVBUF); return (EINVAL); } - dinfo->npins = len / (sizeof(pcell_t) * 4); - dinfo->pins = malloc(sizeof(uint32_t) * dinfo->npins, M_DEVBUF, - M_NOWAIT | M_ZERO); - if (dinfo->pins == NULL) { + + /* Allocate the child resources. */ + if (ofw_gpiobus_alloc_ivars(dinfo) != 0) { free(gpios, M_DEVBUF); return (ENOMEM); } - for (i = 0; i < dinfo->npins; i++) { + /* Decode the gpio specifier on the second pass. */ + i = 0; + j = 0; + while (i < len) { + /* Allow NULL specifiers. */ + if (gpios[i] == 0) { + i++; + j++; + continue; + } - /* Verify if we're attaching to the correct gpio controller. */ - gpio = OF_xref_phandle(gpios[i * 4 + 0]); - if (!OF_hasprop(gpio, "gpio-controller") || - gpio != ofw_bus_get_node(sc->sc_dev)) { - free(dinfo->pins, M_DEVBUF); + gpio = OF_xref_phandle(gpios[i]); + /* Read gpio-cells property for this GPIO controller. */ + if (OF_getencprop(gpio, "#gpio-cells", &cells, + sizeof(cells)) < 0) { + ofw_gpiobus_free_ivars(dinfo); free(gpios, M_DEVBUF); return (EINVAL); } - /* Get the GPIO pin number. */ - dinfo->pins[i] = gpios[i * 4 + 1]; - /* gpios[i * 4 + 2] - GPIO pin direction */ - /* gpios[i * 4 + 3] - GPIO pin flags */ + /* Get the GPIO pin number and flags. */ + if (gpio_map_gpios(sc->sc_dev, child, gpio, cells, + &gpios[i + 1], &dinfo->pins[j], &dinfo->flags[j]) != 0) { + ofw_gpiobus_free_ivars(dinfo); + free(gpios, M_DEVBUF); + return (EINVAL); + } - if (dinfo->pins[i] > sc->sc_npins) { + /* Consistency check. */ + if (dinfo->pins[j] > sc->sc_npins) { device_printf(sc->sc_busdev, "invalid pin %d, max: %d\n", - dinfo->pins[i], sc->sc_npins - 1); - free(dinfo->pins, M_DEVBUF); + dinfo->pins[j], sc->sc_npins - 1); + ofw_gpiobus_free_ivars(dinfo); free(gpios, M_DEVBUF); return (EINVAL); } @@ -147,15 +198,18 @@ ofw_gpiobus_parse_gpios(struct gpiobus_s /* * Mark pin as mapped and give warning if it's already mapped. */ - if (sc->sc_pins_mapped[dinfo->pins[i]]) { + if (sc->sc_pins_mapped[dinfo->pins[j]]) { device_printf(sc->sc_busdev, "warning: pin %d is already mapped\n", - dinfo->pins[i]); - free(dinfo->pins, M_DEVBUF); + dinfo->pins[j]); + ofw_gpiobus_free_ivars(dinfo); free(gpios, M_DEVBUF); return (EINVAL); } - sc->sc_pins_mapped[dinfo->pins[i]] = 1; + sc->sc_pins_mapped[dinfo->pins[j]] = 1; + + i += cells + 1; + j++; } free(gpios, M_DEVBUF); Modified: stable/10/sys/dev/ofw/ofw_bus_if.m ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_if.m Thu May 15 15:14:37 2014 (r266134) +++ stable/10/sys/dev/ofw/ofw_bus_if.m Thu May 15 15:15:23 2014 (r266135) @@ -169,5 +169,3 @@ METHOD int map_intr { int icells; pcell_t *interrupt; } DEFAULT ofw_bus_default_map_intr; - - From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 15:40:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0D4ED509; Thu, 15 May 2014 15:40:08 +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 ED3622475; Thu, 15 May 2014 15:40:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FFe7Wi054190; Thu, 15 May 2014 15:40:07 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFe5Aj054173; Thu, 15 May 2014 15:40:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151540.s4FFe5Aj054173@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 15:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266144 - in stable/10/sys/arm: arm include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:40:08 -0000 Author: ian Date: Thu May 15 15:40:05 2014 New Revision: 266144 URL: http://svnweb.freebsd.org/changeset/base/266144 Log: MFC r261137, r261393 Correct the alignment of sp through functions that use UNWINDSVCFRAME. Update all arm code that manipulates the PSR registers to use modern syntax. Modified: stable/10/sys/arm/arm/cpufunc_asm_arm8.S stable/10/sys/arm/arm/cpufunc_asm_sa1.S stable/10/sys/arm/arm/cpufunc_asm_sa11x0.S stable/10/sys/arm/arm/cpufunc_asm_xscale.S stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S stable/10/sys/arm/arm/exception.S stable/10/sys/arm/arm/fiq_subr.S stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/setcpsr.S stable/10/sys/arm/arm/setstack.s stable/10/sys/arm/include/asmacros.h stable/10/sys/arm/include/atomic.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc_asm_arm8.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_arm8.S Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/arm/cpufunc_asm_arm8.S Thu May 15 15:40:05 2014 (r266144) @@ -67,9 +67,9 @@ END(arm8_clock_config) * addresses that are about to change. */ ENTRY(arm8_setttb) - mrs r3, cpsr_all + mrs r3, cpsr orr r1, r3, #(I32_bit | F32_bit) - msr cpsr_all, r1 + msr cpsr_fsxc, r1 stmfd sp!, {r0-r3, lr} bl _C_LABEL(arm8_cache_cleanID) @@ -88,7 +88,7 @@ ENTRY(arm8_setttb) /* Make sure that pipeline is emptied */ mov r0, r0 mov r0, r0 - msr cpsr_all, r3 + msr cpsr_fsxc, r3 RET END(arm8_setttb) @@ -182,9 +182,9 @@ ENTRY(arm8_cache_purgeID) mov r0, #0x00000000 - mrs r3, cpsr_all + mrs r3, cpsr orr r2, r3, #(I32_bit | F32_bit) - msr cpsr_all, r2 + msr cpsr_fsxc, r2 1: mov r2, r0 mcr p15, 0, r2, c7, c11, 1 @@ -238,7 +238,7 @@ ENTRY(arm8_cache_purgeID) adds r0, r0, #0x04000000 bne 1b - msr cpsr_all, r3 + msr cpsr_fsxc, r3 RET END(arm8_cache_purgeID) @@ -255,12 +255,12 @@ ENTRY(arm8_cache_purgeID_E) * mcr p15, 0, rd, c7, c11, 1 * mcr p15, 0, rd, c7, c7, 1 */ - mrs r3, cpsr_all + mrs r3, cpsr orr r2, r3, #(I32_bit | F32_bit) - msr cpsr_all, r2 + msr cpsr_fsxc, r2 mcr p15, 0, r0, c7, c11, 1 /* clean I+D single entry */ mcr p15, 0, r0, c7, c7, 1 /* flush I+D single entry */ - msr cpsr_all, r3 + msr cpsr_fsxc, r3 RET END(arm8_cache_purgeID_E) Modified: stable/10/sys/arm/arm/cpufunc_asm_sa1.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_sa1.S Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/arm/cpufunc_asm_sa1.S Thu May 15 15:40:05 2014 (r266144) @@ -52,9 +52,9 @@ ENTRY(getttb) mrc p15, 0, r0, c2, c0, 0 ENTRY(sa1_setttb) #ifdef CACHE_CLEAN_BLOCK_INTR - mrs r3, cpsr_all + mrs r3, cpsr orr r1, r3, #(I32_bit | F32_bit) - msr cpsr_all, r1 + msr cpsr_fsxc, r1 #else ldr r3, .Lblock_userspace_access ldr r2, [r3] @@ -80,7 +80,7 @@ ENTRY(sa1_setttb) mov r0, r0 mov r0, r0 #ifdef CACHE_CLEAN_BLOCK_INTR - msr cpsr_all, r3 + msr cpsr_fsxc, r3 #else str r2, [r3] #endif @@ -154,12 +154,12 @@ _C_LABEL(sa1_cache_clean_size): #ifdef CACHE_CLEAN_BLOCK_INTR #define SA1_CACHE_CLEAN_BLOCK \ - mrs r3, cpsr_all ; \ + mrs r3, cpsr ; \ orr r0, r3, #(I32_bit | F32_bit) ; \ - msr cpsr_all, r0 + msr cpsr_fsxc, r0 #define SA1_CACHE_CLEAN_UNBLOCK \ - msr cpsr_all, r3 + msr cpsr_fsxc, r3 #else #define SA1_CACHE_CLEAN_BLOCK \ ldr r3, .Lblock_userspace_access ; \ Modified: stable/10/sys/arm/arm/cpufunc_asm_sa11x0.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_sa11x0.S Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/arm/cpufunc_asm_sa11x0.S Thu May 15 15:40:05 2014 (r266144) @@ -80,9 +80,9 @@ ENTRY(sa11x0_cpu_sleep) * re-enable clock switching before servicing interrupts. */ - mrs r3, cpsr_all /* 6 */ + mrs r3, cpsr /* 6 */ orr r2, r3, #(I32_bit|F32_bit) /* 7 */ - msr cpsr_all, r2 /* 8 */ + msr cpsr_fsxc, r2 /* 8 */ /* We're now 32-byte aligned */ @@ -93,7 +93,7 @@ ENTRY(sa11x0_cpu_sleep) mcr p15, 0, r0, c15, c1, 2 /* re-enable clock switching */ /* Restore interrupts (which will cause them to be serviced). */ - msr cpsr_all, r3 + msr cpsr_fsxc, r3 RET END(sa11x0_cpu_sleep) Modified: stable/10/sys/arm/arm/cpufunc_asm_xscale.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_xscale.S Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/arm/cpufunc_asm_xscale.S Thu May 15 15:40:05 2014 (r266144) @@ -134,9 +134,9 @@ END(xscale_control) */ ENTRY(xscale_setttb) #ifdef CACHE_CLEAN_BLOCK_INTR - mrs r3, cpsr_all + mrs r3, cpsr orr r1, r3, #(I32_bit | F32_bit) - msr cpsr_all, r1 + msr cpsr_fsxc, r1 #else ldr r3, .Lblock_userspace_access ldr r2, [r3] @@ -164,7 +164,7 @@ ENTRY(xscale_setttb) CPWAIT(r0) #ifdef CACHE_CLEAN_BLOCK_INTR - msr cpsr_all, r3 + msr cpsr_fsxc, r3 #else str r2, [r3] #endif @@ -266,12 +266,12 @@ _C_LABEL(xscale_minidata_clean_size): #ifdef CACHE_CLEAN_BLOCK_INTR #define XSCALE_CACHE_CLEAN_BLOCK \ - mrs r3, cpsr_all ; \ + mrs r3, cpsr ; \ orr r0, r3, #(I32_bit | F32_bit) ; \ - msr cpsr_all, r0 + msr cpsr_fsxc, r0 #define XSCALE_CACHE_CLEAN_UNBLOCK \ - msr cpsr_all, r3 + msr cpsr_fsxc, r3 #else #define XSCALE_CACHE_CLEAN_BLOCK \ ldr r3, .Lblock_userspace_access ; \ Modified: stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S Thu May 15 15:40:05 2014 (r266144) @@ -121,12 +121,12 @@ __FBSDID("$FreeBSD$"); #ifdef CACHE_CLEAN_BLOCK_INTR #define XSCALE_CACHE_CLEAN_BLOCK \ stmfd sp!, {r4} ; \ - mrs r4, cpsr_all ; \ + mrs r4, cpsr ; \ orr r0, r4, #(I32_bit | F32_bit) ; \ - msr cpsr_all, r0 + msr cpsr_fsxc, r0 #define XSCALE_CACHE_CLEAN_UNBLOCK \ - msr cpsr_all, r4 ; \ + msr cpsr_fsxc, r4 ; \ ldmfd sp!, {r4} #else #define XSCALE_CACHE_CLEAN_BLOCK \ @@ -348,9 +348,9 @@ END(xscalec3_l2cache_flush_rng) */ ENTRY(xscalec3_setttb) #ifdef CACHE_CLEAN_BLOCK_INTR - mrs r3, cpsr_all + mrs r3, cpsr orr r1, r3, #(I32_bit | F32_bit) - msr cpsr_all, r1 + msr cpsr_fsxc, r1 #else ldr r3, .Lblock_userspace_access ldr r2, [r3] @@ -378,7 +378,7 @@ ENTRY(xscalec3_setttb) CPWAIT(r0) #ifdef CACHE_CLEAN_BLOCK_INTR - msr cpsr_all, r3 + msr cpsr_fsxc, r3 #else str r2, [r3] #endif Modified: stable/10/sys/arm/arm/exception.S ============================================================================== --- stable/10/sys/arm/arm/exception.S Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/arm/exception.S Thu May 15 15:40:05 2014 (r266144) @@ -173,8 +173,8 @@ END(data_abort_entry) * it like a Data Abort. */ ASENTRY_NP(address_exception_entry) - mrs r1, cpsr_all - mrs r2, spsr_all + mrs r1, cpsr + mrs r2, spsr mov r3, lr adr r0, Laddress_exception_msg bl _C_LABEL(printf) /* XXX CLOBBERS LR!! */ Modified: stable/10/sys/arm/arm/fiq_subr.S ============================================================================== --- stable/10/sys/arm/arm/fiq_subr.S Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/arm/fiq_subr.S Thu May 15 15:40:05 2014 (r266144) @@ -52,14 +52,14 @@ __FBSDID("$FreeBSD$"); #endif #define SWITCH_TO_FIQ_MODE \ - mrs r2, cpsr_all ; \ + mrs r2, cpsr ; \ mov r3, r2 ; \ bic r2, r2, #(PSR_MODE) ; \ orr r2, r2, #(PSR_FIQ32_MODE) ; \ - msr cpsr_all, r2 + msr cpsr_fsxc, r2 #define BACK_TO_SVC_MODE \ - msr cpsr_all, r3 + msr cpsr_fsxc, r3 /* * fiq_getregs: Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/arm/locore.S Thu May 15 15:40:05 2014 (r266144) @@ -333,10 +333,10 @@ ASENTRY_NP(mptramp) AP_DEBUG(#1) - mrs r3, cpsr_all + mrs r3, cpsr bic r3, r3, #(PSR_MODE) orr r3, r3, #(PSR_SVC32_MODE) - msr cpsr_all, r3 + msr cpsr_fsxc, r3 mrc p15, 0, r0, c0, c0, 5 and r0, #0x0f /* Get CPU ID */ @@ -446,7 +446,7 @@ ENTRY_NP(cpu_halt) bic r2, r2, #(PSR_MODE) orr r2, r2, #(PSR_SVC32_MODE) orr r2, r2, #(I32_bit | F32_bit) - msr cpsr_all, r2 + msr cpsr_fsxc, r2 ldr r4, .Lcpu_reset_address ldr r4, [r4] Modified: stable/10/sys/arm/arm/setcpsr.S ============================================================================== --- stable/10/sys/arm/arm/setcpsr.S Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/arm/setcpsr.S Thu May 15 15:40:05 2014 (r266144) @@ -61,7 +61,7 @@ ENTRY_NP(SetCPSR) mrs r3, cpsr /* Set the CPSR */ bic r2, r3, r0 eor r2, r2, r1 - msr cpsr_all, r2 + msr cpsr_fsxc, r2 mov r0, r3 /* Return the old CPSR */ Modified: stable/10/sys/arm/arm/setstack.s ============================================================================== --- stable/10/sys/arm/arm/setstack.s Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/arm/setstack.s Thu May 15 15:40:05 2014 (r266144) @@ -61,14 +61,14 @@ __FBSDID("$FreeBSD$"); */ ENTRY(set_stackptr) - mrs r3, cpsr_all /* Switch to the appropriate mode */ + mrs r3, cpsr /* Switch to the appropriate mode */ bic r2, r3, #(PSR_MODE) orr r2, r2, r0 - msr cpsr_all, r2 + msr cpsr_fsxc, r2 mov sp, r1 /* Set the stack pointer */ - msr cpsr_all, r3 /* Restore the old mode */ + msr cpsr_fsxc, r3 /* Restore the old mode */ mov pc, lr /* Exit */ @@ -80,14 +80,14 @@ ENTRY(set_stackptr) */ ENTRY(get_stackptr) - mrs r3, cpsr_all /* Switch to the appropriate mode */ + mrs r3, cpsr /* Switch to the appropriate mode */ bic r2, r3, #(PSR_MODE) orr r2, r2, r0 - msr cpsr_all, r2 + msr cpsr_fsxc, r2 mov r0, sp /* Set the stack pointer */ - msr cpsr_all, r3 /* Restore the old mode */ + msr cpsr_fsxc, r3 /* Restore the old mode */ mov pc, lr /* Exit */ Modified: stable/10/sys/arm/include/asmacros.h ============================================================================== --- stable/10/sys/arm/include/asmacros.h Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/include/asmacros.h Thu May 15 15:40:05 2014 (r266144) @@ -70,7 +70,7 @@ add r0, sp, #(4*13); /* Adjust the stack pointer */ \ stmia r0, {r13-r14}^; /* Push the user mode registers */ \ mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr_all; /* Put the SPSR on the stack */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ str r0, [sp, #-4]!; \ ldr r0, =ARM_RAS_START; \ mov r1, #0; \ @@ -86,7 +86,7 @@ add r0, sp, #(4*13); /* Adjust the stack pointer */ \ stmia r0, {r13-r14}^; /* Push the user mode registers */ \ mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr_all; /* Put the SPSR on the stack */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ str r0, [sp, #-4]!; #endif @@ -98,7 +98,7 @@ #ifdef ARM_TP_ADDRESS #define PULLFRAME \ ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_all, r0; \ + msr spsr_fsxc, r0; \ ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ mov r0, r0; /* NOP for previous instruction */ \ add sp, sp, #(4*17); /* Adjust the stack pointer */ \ @@ -107,7 +107,7 @@ #else #define PULLFRAME \ ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_all, r0; \ + msr spsr_fsxc, r0; \ clrex; \ ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ mov r0, r0; /* NOP for previous instruction */ \ @@ -142,7 +142,7 @@ str r0, [sp, #-4]!; /* Push return address */ \ str lr, [sp, #-4]!; /* Push SVC lr */ \ str r2, [sp, #-4]!; /* Push SVC sp */ \ - msr spsr_all, r3; /* Restore correct spsr */ \ + msr spsr_fsxc, r3; /* Restore correct spsr */ \ ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ \ sub sp, sp, #(4*15); /* Adjust the stack pointer */ \ stmia sp, {r0-r12}; /* Push the user mode registers */ \ @@ -161,7 +161,7 @@ ldrne r1, [r0, #16]; /* adjust the saved PC so that */ \ cmpne r4, r1; /* execution later resumes at */ \ strhi r3, [r0, #16]; /* the RAS_START location. */ \ - mrs r0, spsr_all; \ + mrs r0, spsr; \ str r0, [sp, #-4]! #else #define PUSHFRAMEINSVC \ @@ -179,14 +179,14 @@ str r0, [sp, #-4]!; /* Push return address */ \ str lr, [sp, #-4]!; /* Push SVC lr */ \ str r2, [sp, #-4]!; /* Push SVC sp */ \ - msr spsr_all, r3; /* Restore correct spsr */ \ + msr spsr_fsxc, r3; /* Restore correct spsr */ \ ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ \ sub sp, sp, #(4*15); /* Adjust the stack pointer */ \ stmia sp, {r0-r12}; /* Push the user mode registers */ \ add r0, sp, #(4*13); /* Adjust the stack pointer */ \ stmia r0, {r13-r14}^; /* Push the user mode registers */ \ mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr_all; /* Put the SPSR on the stack */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ str r0, [sp, #-4]! #endif @@ -200,7 +200,7 @@ #ifdef ARM_TP_ADDRESS #define PULLFRAMEFROMSVCANDEXIT \ ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_all, r0; /* restore SPSR */ \ + msr spsr_fsxc, r0; /* restore SPSR */ \ ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ mov r0, r0; /* NOP for previous instruction */ \ add sp, sp, #(4*15); /* Adjust the stack pointer */ \ @@ -208,7 +208,7 @@ #else #define PULLFRAMEFROMSVCANDEXIT \ ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_all, r0; /* restore SPSR */ \ + msr spsr_fsxc, r0; /* restore SPSR */ \ clrex; \ ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ mov r0, r0; /* NOP for previous instruction */ \ @@ -216,8 +216,13 @@ ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */ #endif #if defined(__ARM_EABI__) +/* + * Unwind hints so we can unwind past functions that use + * PULLFRAMEFROMSVCANDEXIT. They are run in reverse order. + * As the last thing we do is restore the stack pointer + * we can ignore the padding at the end of struct trapframe. + */ #define UNWINDSVCFRAME \ - .pad #(4); /* Skip stack alignment */ \ .save {r13-r15}; /* Restore sp, lr, pc */ \ .pad #(2*4); /* Skip user sp and lr */ \ .save {r0-r12}; /* Restore r0-r12 */ \ Modified: stable/10/sys/arm/include/atomic.h ============================================================================== --- stable/10/sys/arm/include/atomic.h Thu May 15 15:38:39 2014 (r266143) +++ stable/10/sys/arm/include/atomic.h Thu May 15 15:40:05 2014 (r266144) @@ -450,13 +450,13 @@ atomic_store_rel_long(volatile u_long *p __asm __volatile( \ "mrs %0, cpsr;" \ "orr %1, %0, %2;" \ - "msr cpsr_all, %1;" \ + "msr cpsr_fsxc, %1;" \ : "=r" (cpsr_save), "=r" (tmp) \ : "I" (I32_bit | F32_bit) \ : "cc" ); \ (expr); \ __asm __volatile( \ - "msr cpsr_all, %0" \ + "msr cpsr_fsxc, %0" \ : /* no output */ \ : "r" (cpsr_save) \ : "cc" ); \ From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 15:43:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A12359D0; Thu, 15 May 2014 15:43: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 819DD2515; Thu, 15 May 2014 15:43: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 s4FFhYJW057996; Thu, 15 May 2014 15:43:34 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFhXgV057990; Thu, 15 May 2014 15:43:33 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151543.s4FFhXgV057990@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 15:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266146 - in stable/10/sys: arm/conf arm/freescale/vybrid boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:43:34 -0000 Author: ian Date: Thu May 15 15:43:33 2014 New Revision: 266146 URL: http://svnweb.freebsd.org/changeset/base/266146 Log: MFC r261406, r261409: enhance Vybrid support... o Expand device tree information o Export iomuxc (pins) configuration to DTS o Allow devices to assign clocks in DTS o Split kernel configuration to chip common and board specific parts. Added: stable/10/sys/arm/conf/VYBRID.common - copied unchanged from r261409, head/sys/arm/conf/VYBRID.common Modified: stable/10/sys/arm/conf/COSMIC stable/10/sys/arm/freescale/vybrid/vf_ccm.c stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts stable/10/sys/boot/fdt/dts/vybrid.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/COSMIC ============================================================================== --- stable/10/sys/arm/conf/COSMIC Thu May 15 15:41:42 2014 (r266145) +++ stable/10/sys/arm/conf/COSMIC Thu May 15 15:43:33 2014 (r266146) @@ -17,123 +17,9 @@ # # $FreeBSD$ +include "VYBRID.common" ident COSMIC -include "../freescale/vybrid/std.vybrid" - -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror" - -options HZ=100 ## -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories -options MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -#options NANDFS #NAND Filesystem -options TMPFS -options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER -options VFP # vfp/neon - -# Debugging -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT #Enable verbose sysinit messages -options KDB -options DDB #Enable the kernel debugger -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -options DIAGNOSTIC - -# NFS support -options NFSCL #Network Filesystem Client -options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT - -# Uncomment this for NFS root -#options NFS_ROOT #NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ffec0 - -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards -device sdhci # generic sdhci - -#options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" -#options ROOTDEVNAME=\"nandfs:/dev/gnand0s.root\" -options ROOTDEVNAME=\"ufs:/dev/da0\" - -#options SMP - -# Pseudo devices - -device loop -device random -device pty -device md -device gpio - -# USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. -device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE -#device musb -device ehci -#device ohci - -device umass -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) -device pass - -# SATA -#device ata -#device atadisk -#device mvs - -device nand - -# Serial ports -device uart - -# I2C (TWSI) -#device iic -#device iicbus - -# Ethernet -device ether -device ffec - -# USB ethernet support, requires miibus -device miibus -device axe # ASIX Electronics USB Ethernet -device bpf # Berkeley packet filter - #FDT options FDT options FDT_DTB_STATIC Copied: stable/10/sys/arm/conf/VYBRID.common (from r261409, head/sys/arm/conf/VYBRID.common) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/VYBRID.common Thu May 15 15:43:33 2014 (r266146, copy of r261409, head/sys/arm/conf/VYBRID.common) @@ -0,0 +1,139 @@ +# Kernel configuration for Vybrid Family boards. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "../freescale/vybrid/std.vybrid" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options HZ=100 ## +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +options MSDOSFS #MSDOS Filesystem +options CD9660 #ISO 9660 Filesystem +options PROCFS #Process filesystem (requires PSEUDOFS) +options PSEUDOFS #Pseudo-filesystem framework +#options NANDFS #NAND Filesystem +options TMPFS +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT #Enable verbose sysinit messages +options KDB +options DDB #Enable the kernel debugger +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DIAGNOSTIC + +# NFS support +options NFSCL #Network Filesystem Client +options NFSLOCKD #Network Lock Manager +options NFS_ROOT #NFS usable as /, requires NFSCLIENT + +# Uncomment this for NFS root +#options NFS_ROOT #NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ffec0 + +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci + +#options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" +#options ROOTDEVNAME=\"nandfs:/dev/gnand0s.root\" +options ROOTDEVNAME=\"ufs:/dev/da0\" + +#options SMP + +# Pseudo devices + +device loop +device random +device pty +device md +device gpio + +# USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +#device musb +device ehci +#device ohci + +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# SATA +#device ata +#device atadisk +#device mvs + +device nand + +# Serial ports +device uart + +# I2C (TWSI) +#device iic +#device iicbus + +# Ethernet +device ether +device ffec + +# USB ethernet support, requires miibus +device miibus +device axe # ASIX Electronics USB Ethernet +device bpf # Berkeley packet filter + +device sound Modified: stable/10/sys/arm/freescale/vybrid/vf_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_ccm.c Thu May 15 15:41:42 2014 (r266145) +++ stable/10/sys/arm/freescale/vybrid/vf_ccm.c Thu May 15 15:43:33 2014 (r266146) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,8 +73,8 @@ __FBSDID("$FreeBSD$"); #define CCM_CCGRN 12 #define CCM_CCGR(n) (0x40 + (n * 0x04)) /* Clock Gating Register */ -#define CCM_CMEOR(n) (0x70 + (n * 0x70)) /* Module Enable Override Reg */ -#define CCM_CCPGR(n) (0x90 + (n * 0x04)) /* Platform Clock Gating Reg */ +#define CCM_CMEOR(n) (0x70 + (n * 0x70)) /* Module Enable Override */ +#define CCM_CCPGR(n) (0x90 + (n * 0x04)) /* Platform Clock Gating */ #define CCM_CPPDSR 0x88 /* PLL PFD Disable Status Register */ #define CCM_CCOWR 0x8C /* CORE Wakeup Register */ @@ -100,6 +100,228 @@ __FBSDID("$FreeBSD$"); /* CCM_CSCDR1 */ #define ENET_TS_EN (1 << 23) #define RMII_CLK_EN (1 << 24) +#define SAI3_EN (1 << 19) + +/* CCM_CSCDR2 */ +#define ESAI_EN (1 << 30) +#define ESDHC1_EN (1 << 29) +#define ESDHC0_EN (1 << 28) +#define NFC_EN (1 << 9) +#define ESDHC1_DIV_S 20 +#define ESDHC1_DIV_M 0xf +#define ESDHC0_DIV_S 16 +#define ESDHC0_DIV_M 0xf + +/* CCM_CSCDR3 */ +#define DCU0_EN (1 << 19) + +#define QSPI1_EN (1 << 12) +#define QSPI1_DIV (1 << 11) +#define QSPI1_X2_DIV (1 << 10) +#define QSPI1_X4_DIV_M 0x3 +#define QSPI1_X4_DIV_S 8 + +#define QSPI0_EN (1 << 4) +#define QSPI0_DIV (1 << 3) +#define QSPI0_X2_DIV (1 << 2) +#define QSPI0_X4_DIV_M 0x3 +#define QSPI0_X4_DIV_S 0 + +#define SAI3_DIV_SHIFT 12 +#define SAI3_DIV_MASK 0xf +#define ESAI_DIV_SHIFT 24 +#define ESAI_DIV_MASK 0xf + +#define PLL4_CLK_DIV_SHIFT 6 +#define PLL4_CLK_DIV_MASK 0x7 + +#define IPG_CLK_DIV_SHIFT 11 +#define IPG_CLK_DIV_MASK 0x3 + +#define ESAI_CLK_SEL_SHIFT 20 +#define ESAI_CLK_SEL_MASK 0x3 + +#define SAI3_CLK_SEL_SHIFT 6 +#define SAI3_CLK_SEL_MASK 0x3 + +#define CKO1_EN (1 << 10) +#define CKO1_DIV_MASK 0xf +#define CKO1_DIV_SHIFT 6 +#define CKO1_SEL_MASK 0x3f +#define CKO1_SEL_SHIFT 0 +#define CKO1_PLL4_MAIN 0x6 +#define CKO1_PLL4_DIVD 0x7 + +struct clk { + uint32_t reg; + uint32_t enable_reg; + uint32_t div_mask; + uint32_t div_shift; + uint32_t div_val; + uint32_t sel_reg; + uint32_t sel_mask; + uint32_t sel_shift; + uint32_t sel_val; +}; + +/* + PLL4 clock divider (before switching the clocks should be gated) + 000 Divide by 1 (only if PLL frequency less than or equal to 650 MHz) + 001 Divide by 4 + 010 Divide by 6 + 011 Divide by 8 + 100 Divide by 10 + 101 Divide by 12 + 110 Divide by 14 + 111 Divide by 16 +*/ + +static struct clk pll4_clk = { + .reg = CCM_CACRR, + .enable_reg = 0, + .div_mask = PLL4_CLK_DIV_MASK, + .div_shift = PLL4_CLK_DIV_SHIFT, + .div_val = 5, /* Divide by 12 */ + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk sai3_clk = { + .reg = CCM_CSCDR1, + .enable_reg = SAI3_EN, + .div_mask = SAI3_DIV_MASK, + .div_shift = SAI3_DIV_SHIFT, + .div_val = 1, + .sel_reg = CCM_CSCMR1, + .sel_mask = SAI3_CLK_SEL_MASK, + .sel_shift = SAI3_CLK_SEL_SHIFT, + .sel_val = 0x3, /* Divided PLL4 main clock */ +}; + +static struct clk cko1_clk = { + .reg = CCM_CCOSR, + .enable_reg = CKO1_EN, + .div_mask = CKO1_DIV_MASK, + .div_shift = CKO1_DIV_SHIFT, + .div_val = 1, + .sel_reg = CCM_CCOSR, + .sel_mask = CKO1_SEL_MASK, + .sel_shift = CKO1_SEL_SHIFT, + .sel_val = CKO1_PLL4_DIVD, +}; + +static struct clk esdhc0_clk = { + .reg = CCM_CSCDR2, + .enable_reg = ESDHC0_EN, + .div_mask = ESDHC0_DIV_M, + .div_shift = ESDHC0_DIV_S, + .div_val = 0x9, + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk esdhc1_clk = { + .reg = CCM_CSCDR2, + .enable_reg = ESDHC1_EN, + .div_mask = ESDHC1_DIV_M, + .div_shift = ESDHC1_DIV_S, + .div_val = 0x9, + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk qspi0_clk = { + .reg = CCM_CSCDR3, + .enable_reg = QSPI0_EN, + .div_mask = 0, + .div_shift = 0, + .div_val = 0, + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk dcu0_clk = { + .reg = CCM_CSCDR3, + .enable_reg = DCU0_EN, + .div_mask = 0x7, + .div_shift = 16, /* DCU0_DIV */ + .div_val = 0, /* divide by 1 */ + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk enet_clk = { + .reg = CCM_CSCDR1, + .enable_reg = (ENET_TS_EN | RMII_CLK_EN), + .div_mask = 0, + .div_shift = 0, + .div_val = 0, + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +static struct clk nand_clk = { + .reg = CCM_CSCDR2, + .enable_reg = NFC_EN, + .div_mask = 0, + .div_shift = 0, + .div_val = 0, + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + +/* + Divider to generate ESAI clock + 0000 Divide by 1 + 0001 Divide by 2 + ... ... + 1111 Divide by 16 +*/ + +static struct clk esai_clk = { + .reg = CCM_CSCDR2, + .enable_reg = ESAI_EN, + .div_mask = ESAI_DIV_MASK, + .div_shift = ESAI_DIV_SHIFT, + .div_val = 3, /* Divide by 4 */ + .sel_reg = CCM_CSCMR1, + .sel_mask = ESAI_CLK_SEL_MASK, + .sel_shift = ESAI_CLK_SEL_SHIFT, + .sel_val = 0x3, /* Divided PLL4 main clock */ +}; + +struct clock_entry { + char *name; + struct clk *clk; +}; + +static struct clock_entry clock_map[] = { + {"pll4", &pll4_clk}, + {"sai3", &sai3_clk}, + {"cko1", &cko1_clk}, + {"esdhc0", &esdhc0_clk}, + {"esdhc1", &esdhc1_clk}, + {"qspi0", &qspi0_clk}, + {"dcu0", &dcu0_clk}, + {"enet", &enet_clk}, + {"nand", &nand_clk}, + {"esai", &esai_clk}, + {NULL, NULL} +}; struct ccm_softc { struct resource *res[1]; @@ -125,6 +347,83 @@ ccm_probe(device_t dev) } static int +set_clock(struct ccm_softc *sc, char *name) +{ + struct clk *clk; + int reg; + int i; + + for (i = 0; clock_map[i].name != NULL; i++) { + if (strcmp(clock_map[i].name, name) == 0) { +#if 0 + device_printf(sc->dev, "Configuring %s clk\n", name); +#endif + clk = clock_map[i].clk; + if (clk->sel_reg != 0) { + reg = READ4(sc, clk->sel_reg); + reg &= ~(clk->sel_mask << clk->sel_shift); + reg |= (clk->sel_val << clk->sel_shift); + WRITE4(sc, clk->sel_reg, reg); + }; + + reg = READ4(sc, clk->reg); + reg |= clk->enable_reg; + reg &= ~(clk->div_mask << clk->div_shift); + reg |= (clk->div_val << clk->div_shift); + WRITE4(sc, clk->reg, reg); + }; + }; + + return (0); +} + +static int +ccm_fdt_set(struct ccm_softc *sc) +{ + phandle_t child, parent, root; + int len; + char *fdt_config, *name; + + root = OF_finddevice("/"); + len = 0; + parent = root; + + /* Find 'clock_names' prop in the tree */ + for (child = OF_child(parent); child != 0; child = OF_peer(child)) { + + /* Find a 'leaf'. Start the search from this node. */ + while (OF_child(child)) { + parent = child; + child = OF_child(child); + } + + if (!fdt_is_enabled(child)) + continue; + + if ((len = OF_getproplen(child, "clock_names")) > 0) { + len = OF_getproplen(child, "clock_names"); + OF_getprop_alloc(child, "clock_names", 1, + (void **)&fdt_config); + + while (len > 0) { + name = fdt_config; + fdt_config += strlen(name) + 1; + len -= strlen(name) + 1; + set_clock(sc, name); + }; + }; + + if (OF_peer(child) == 0) { + /* No more siblings. */ + child = parent; + parent = OF_parent(child); + } + } + + return (0); +} + +static int ccm_attach(device_t dev) { struct ccm_softc *sc; @@ -163,10 +462,8 @@ ccm_attach(device_t dev) WRITE4(sc, CCM_CCGR(i), 0xffffffff); } - /* Enable ENET clocks */ - reg = READ4(sc, CCM_CSCDR1); - reg |= (ENET_TS_EN | RMII_CLK_EN); - WRITE4(sc, CCM_CSCDR1, reg); + /* Take and apply FDT clocks */ + ccm_fdt_set(sc); return (0); } Modified: stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c Thu May 15 15:41:42 2014 (r266145) +++ stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c Thu May 15 15:43:33 2014 (r266146) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,16 +67,12 @@ __FBSDID("$FreeBSD$"); #define MUX_MODE_MASK 7 #define MUX_MODE_SHIFT 20 #define MUX_MODE_GPIO 0 -#define MUX_MODE_RMII 1 -#define MUX_MODE_RMII_CLKIN 2 #define MUX_MODE_VBUS_EN_OTG 2 #define PUS_22_KOHM_PULL_UP (3 << 4) #define DSE_25_OHM (6 << 6) -#define NET0_PAD_START 45 -#define NET1_PAD_START 54 -#define NET_PAD_N 9 +#define MAX_MUX_LEN 1024 struct iomuxc_softc { struct resource *tmr_res[1]; @@ -115,11 +111,62 @@ configure_pad(struct iomuxc_softc *sc, i } static int +pinmux_set(struct iomuxc_softc *sc) +{ + phandle_t child, parent, root; + pcell_t iomux_config[MAX_MUX_LEN]; + int len; + int values; + int pin; + int mux_mode; + int i; + + root = OF_finddevice("/"); + len = 0; + parent = root; + + /* Find 'iomux_config' prop in the nodes */ + for (child = OF_child(parent); child != 0; child = OF_peer(child)) { + + /* Find a 'leaf'. Start the search from this node. */ + while (OF_child(child)) { + parent = child; + child = OF_child(child); + } + + if (!fdt_is_enabled(child)) + continue; + + if ((len = OF_getproplen(child, "iomux_config")) > 0) { + OF_getprop(child, "iomux_config", &iomux_config, len); + + values = len / (sizeof(uint32_t)); + for (i = 0; i < values; i += 2) { + pin = fdt32_to_cpu(iomux_config[i]); + mux_mode = fdt32_to_cpu(iomux_config[i+1]); +#if 0 + device_printf(sc->dev, "Set pin %d to ALT%d\n", + pin, mux_mode); +#endif + configure_pad(sc, IOMUXC(pin), mux_mode); + } + } + + if (OF_peer(child) == 0) { + /* No more siblings. */ + child = parent; + parent = OF_parent(child); + } + } + + return (0); +} + +static int iomuxc_attach(device_t dev) { struct iomuxc_softc *sc; int reg; - int i; sc = device_get_softc(dev); sc->dev = dev; @@ -138,18 +185,7 @@ iomuxc_attach(device_t dev) reg = (PKE | PUE | PUS_22_KOHM_PULL_UP | DSE_25_OHM | OBE); WRITE4(sc, IOMUXC_PTA7, reg); - /* NET */ - configure_pad(sc, IOMUXC_PTA6, MUX_MODE_RMII_CLKIN); - - /* NET0 */ - for (i = NET0_PAD_START; i <= (NET0_PAD_START + NET_PAD_N); i++) { - configure_pad(sc, IOMUXC(i), MUX_MODE_RMII); - } - - /* NET1 */ - for (i = NET1_PAD_START; i <= (NET1_PAD_START + NET_PAD_N); i++) { - configure_pad(sc, IOMUXC(i), MUX_MODE_RMII); - } + pinmux_set(sc); return (0); } Modified: stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts Thu May 15 15:41:42 2014 (r266145) +++ stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts Thu May 15 15:43:33 2014 (r266146) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,12 +39,37 @@ }; SOC: vybrid { - serial0: serial@40027000 { - status = "disabled"; + serial1: serial@40028000 { + status = "okay"; }; - fec0: ethernet@400D0000 { - status = "disabled"; + fec1: ethernet@400D1000 { + status = "okay"; + iomux_config = < 54 0x1 55 0x1 + 56 0x1 57 0x1 + 58 0x1 59 0x1 + 60 0x1 61 0x1 + 62 0x1 0 0x2 >; + }; + + esai: esai@40062000 { + status = "okay"; + }; + + edma1: edma@40098000 { + status = "okay"; + }; + + tcon0: tcon@4003D000 { + status = "okay"; + }; + + dcu0: dcu4@40058000 { + status = "okay"; + }; + + adc0: adc@4003B000 { + status = "okay"; }; }; Modified: stable/10/sys/boot/fdt/dts/vybrid.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/vybrid.dtsi Thu May 15 15:41:42 2014 (r266145) +++ stable/10/sys/boot/fdt/dts/vybrid.dtsi Thu May 15 15:43:33 2014 (r266146) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ / { model = "Freescale Vybrid Family"; - compatible = "freescale,vybrid", "fsl,vf"; + compatible = "freescale,vybrid", "fsl,mvf"; #address-cells = <1>; #size-cells = <1>; @@ -38,6 +38,15 @@ soc = &SOC; serial0 = &serial0; serial1 = &serial1; + sai0 = &sai0; + sai1 = &sai1; + sai2 = &sai2; + sai3 = &sai3; + esai = &esai; + adc0 = &adc0; + adc1 = &adc1; + edma0 = &edma0; + edma1 = &edma1; src = &SRC; }; @@ -74,6 +83,7 @@ ccm@4006b000 { compatible = "fsl,mvf600-ccm"; reg = <0x4006b000 0x1000>; + clock_names = "pll4"; }; mp_tmr@40002100 { @@ -87,6 +97,32 @@ interrupt-parent = < &GIC >; }; + dmamux@40024000 { + compatible = "fsl,mvf600-dmamux"; + reg = <0x40024000 0x100>, + <0x40025000 0x100>, + <0x400A1000 0x100>, + <0x400A2000 0x100>; + }; + + edma0: edma@40018000 { + compatible = "fsl,mvf600-edma"; + reg = <0x40018000 0x1000>, + <0x40019000 0x1000>; /* TCD */ + interrupts = < 40 41 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + edma1: edma@40098000 { + compatible = "fsl,mvf600-edma"; + reg = <0x40098000 0x1000>, + <0x40099000 0x1000>; /* TCD */ + interrupts = < 42 43 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + pit@40037000 { compatible = "fsl,mvf600-pit"; reg = <0x40037000 0x1000>; @@ -115,7 +151,6 @@ gpio-controller; interrupts = < 139 140 141 142 143 >; interrupt-parent = <&GIC>; - }; nand@400E0000 { @@ -125,6 +160,8 @@ reg = <0x400E0000 0x10000>; interrupts = < 115 >; interrupt-parent = <&GIC>; + clock_names = "nand"; + status = "disabled"; partition@40000 { reg = <0x40000 0x200000>; /* 2MB */ @@ -146,7 +183,6 @@ reg = <0xe40000 0x1e000000>; /* 480MB */ label = "root"; }; - }; sdhci0: sdhci@400B1000 { @@ -155,6 +191,8 @@ interrupts = < 59 >; interrupt-parent = <&GIC>; clock-frequency = <50000000>; + status = "disabled"; + clock_names = "esdhc0"; }; sdhci1: sdhci@400B2000 { @@ -163,6 +201,11 @@ interrupts = < 60 >; interrupt-parent = <&GIC>; clock-frequency = <50000000>; + status = "disabled"; + clock_names = "esdhc1"; + iomux_config = < 14 0x5 15 0x5 + 16 0x5 17 0x5 + 18 0x5 19 0x5 >; }; serial0: serial@40027000 { @@ -172,6 +215,7 @@ interrupt-parent = <&GIC>; current-speed = <115200>; clock-frequency = < 24000000 >; + status = "disabled"; }; serial1: serial@40028000 { @@ -181,6 +225,7 @@ interrupt-parent = <&GIC>; current-speed = <115200>; clock-frequency = < 24000000 >; + status = "disabled"; }; usb@40034000 { @@ -208,6 +253,13 @@ interrupt-parent = <&GIC>; phy-mode = "rmii"; phy-disable-preamble; + status = "disabled"; + clock_names = "enet"; + iomux_config = < 45 0x1 46 0x1 + 47 0x1 48 0x1 + 49 0x1 50 0x1 + 51 0x1 52 0x1 + 53 0x1 >; }; fec1: ethernet@400D1000 { @@ -217,7 +269,145 @@ interrupt-parent = <&GIC>; phy-mode = "rmii"; phy-disable-preamble; + status = "disabled"; + clock_names = "enet"; + iomux_config = < 54 0x1 55 0x1 + 56 0x1 57 0x1 + 58 0x1 59 0x1 + 60 0x1 61 0x1 + 62 0x1 >; + }; + + sai0: sai@4002F000 { + compatible = "fsl,mvf600-sai"; + reg = <0x4002F000 0x1000>; + interrupts = < 116 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + sai1: sai@40030000 { + compatible = "fsl,mvf600-sai"; + reg = <0x40030000 0x1000>; + interrupts = < 117 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + sai2: sai@40031000 { + compatible = "fsl,mvf600-sai"; + reg = <0x40031000 0x1000>; + interrupts = < 118 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + sai3: sai@40032000 { + compatible = "fsl,mvf600-sai"; + reg = <0x40032000 0x1000>; + interrupts = < 119 >; + interrupt-parent = <&GIC>; + status = "disabled"; + clock_names = "sai3", "cko1"; + iomux_config = < 16 0x2 + 19 0x2 + 21 0x2 + 40 0x4 >; /* CKO1 */ + }; + + esai: esai@40062000 { + compatible = "fsl,mvf600-esai"; + reg = <0x40062000 0x1000>; + interrupts = < 120 >; + interrupt-parent = <&GIC>; + status = "disabled"; + clock_names = "esai"; + iomux_config = < 45 0x4 46 0x4 + 47 0x4 48 0x4 + 49 0x4 50 0x4 + 51 0x4 52 0x4 + 78 0x3 40 0x4>; + }; + + spi0: spi@4002C000 { + compatible = "fsl,mvf600-spi"; + reg = <0x4002C000 0x1000>; + interrupts = < 99 >; + interrupt-parent = <&GIC>; + status = "disabled"; + iomux_config = < 40 0x1 41 0x1 + 42 0x1 43 0x1 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 15:47:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2D9C5E88; Thu, 15 May 2014 15:47: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 19883254B; Thu, 15 May 2014 15:47: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 s4FFlrAZ059187; Thu, 15 May 2014 15:47:53 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFlqY7059185; Thu, 15 May 2014 15:47:52 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405151547.s4FFlqY7059185@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 15 May 2014 15:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266148 - in stable/10/sys/arm/ti: . am335x X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:47:53 -0000 Author: loos Date: Thu May 15 15:47:52 2014 New Revision: 266148 URL: http://svnweb.freebsd.org/changeset/base/266148 Log: MFC r259125, r264019, r264083, r264153, r264197 r259125: Fix a few typos on the scm (control module) pin mux definitions. r264019: Fix some of the style(9) problems on ti_gpio. Remove redundant code and declarations. r264083: Move the GPIO bank initialization to a new function to make easier to detect errors. Reset the GPIO module during the initialization. This is guaranteed to be the same as a hardware reset. Tested on AM335x (BBB) and checked against the omap3 and omap4 TRM. Do a better job freeing resources when there are errors and on ti_gpio_detach(). r264153: - Fix the setup of interrupts for banks 2 and 3 on AM335x. On AM335x each one of the four GPIO banks has two physical interrupt lines, so we now allocate resources and setup our interrupt handler for all the (8) available interrupts. On OMAP3 and OMAP4 there is only one interrupt for each GPIO bank (6 banks, 6 interrupts), but there are two set of registers where the first one is used to setup the delivery of interrupts to the MPU and the second set, setup the delivery of interrupts to the DSP. On AM335x, each set of registers controls each one of the interrupt lines. - Remove nonexistent registers for OMAP4 and AM335x, replace their use with the correct ones for these SoCs. - Remove stray whitespace. r264197: Partially revert r264083. While it is the recommended initialization procedure, it hangs on the reset of the second GPIO module on pandaboard. Removes the module reset for now as more investigation is needed. Modified: stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c stable/10/sys/arm/ti/ti_gpio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c Thu May 15 15:45:45 2014 (r266147) +++ stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c Thu May 15 15:47:52 2014 (r266148) @@ -170,8 +170,8 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0x948, "MDIO", 0, 7, "mdio_data", "timer6", "uart5_rxd", "uart3_ctsn", "mmc0_sdcd","mmc1_cmd", "mmc2_cmd","gpio0_0"), _PIN(0x94c, "MDC", 1, 7, "mdio_clk", "timer5", "uart5_txd", "uart3_rtsn", "mmc0_sdwp", "mmc1_clk", "mmc2_clk", "gpio0_1"), _PIN(0x950, "SPI0_SCLK", 2, 7, "spi0_sclk", "uart2_rxd", "I2C2_SDA", "ehrpwm0A", "pr1_uart0_cts_n", "pr1_edio_sof", "EMU2", "gpio0_2"), - _PIN(0x954, "SPI0_D0", 3, 7, "spi0_d0", "uart2_txd", "i2C2_SCL", "ehrpwm0B", "pr1_uart0_rts_n", "pr1_edio_latch_in", "EMU3", "gpio0_3"), - _PIN(0x958, "SPIO_D1", 4, 7, "spi0_d1", "mmc1_sdwp", "I2C1_SDA", "ehrpwm0_tripzone_input", "pr1_uart0_rxd", "pr1_edio_data_in0", "pr1_edio_data_out0", "gpio0_4"), + _PIN(0x954, "SPI0_D0", 3, 7, "spi0_d0", "uart2_txd", "I2C2_SCL", "ehrpwm0B", "pr1_uart0_rts_n", "pr1_edio_latch_in", "EMU3", "gpio0_3"), + _PIN(0x958, "SPI0_D1", 4, 7, "spi0_d1", "mmc1_sdwp", "I2C1_SDA", "ehrpwm0_tripzone_input", "pr1_uart0_rxd", "pr1_edio_data_in0", "pr1_edio_data_out0", "gpio0_4"), _PIN(0x95c, "SPI0_CS0", 5, 7, "spi0_cs0", "mmc2_sdwp", "I2C1_SCL", "ehrpwm0_synci", "pr1_uart0_txd", "pr1_edio_data_in1", "pr1_edio_data_out1", "gpio0_5"), _PIN(0x960, "SPI0_CS1", 6, 7, "spi0_cs1", "uart3_rxd", "eCAP1_in_PWM1_out", "mcc0_pow", "xdm_event_intr2", "mmc0_sdcd", "EMU4", "gpio0_6"), _PIN(0x964, "ECAP0_IN_PWM0_OUT",7, 7, "eCAP0_in_PWM0_out", "uart3_txd", "spi1_cs1", "pr1_ecap0_ecap_capin_apwm_o", "spi1_sclk", "mmc0_sdwp", "xdma_event_intr2", "gpio0_7"), @@ -180,7 +180,7 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0x970, "UART0_rxd", 42, 7, "uart0_rxd", "spi1_cs0", "dcan0_tx", "I2C2_SDA", "eCAP2_in_PWM2_out", "pr1_pru1_pru_r30_14", "pr1_pru1_pru_r31_14", "gpio1_10"), _PIN(0x974, "UART0_txd", 43, 7, "uart0_txd", "spi1_cs1", "dcan0_rx", "I2C2_SCL", "eCAP1_in_PWM1_out", "pr1_pru1_pru_r30_15", "pr1_pru1_pru_r31_15", "gpio1_11"), _PIN(0x978, "UART1_CTSn", 12, 7, "uart1_ctsn", "timer6_mux1", "dcan0_tx", "I2C2_SDA", "spi1_cs0", "pr1_uart0_cts_n", "pr1_edc_latch0_in", "gpio0_12"), - _PIN(0x97c, "UART1_RTSn", 13, 7, "uart1_rtsn", "timer5_mux1", "dcan0_rx", "I2C2_SCL", "spi1_cs1", "pr1_uart0_rts_n ", "pr1_edc_latch1_in", "gpio0_13"), + _PIN(0x97c, "UART1_RTSn", 13, 7, "uart1_rtsn", "timer5_mux1", "dcan0_rx", "I2C2_SCL", "spi1_cs1", "pr1_uart0_rts_n", "pr1_edc_latch1_in", "gpio0_13"), _PIN(0x980, "UART1_RXD", 14, 7, "uart1_rxd", "mmc1_sdwp", "dcan1_tx", "I2C1_SDA", NULL, "pr1_uart0_rxd", "pr1_pru1_pru_r31_16", "gpio0_14"), _PIN(0x984, "UART1_TXD", 15, 7, "uart1_txd", "mmc2_sdwp", "dcan1_rx", "I2C1_SCL", NULL, "pr1_uart0_txd", "pr1_pru0_pru_r31_16", "gpio0_15"), _PIN(0x988, "I2C0_SDA", 101, 7, "I2C0_SDA", "timer4", "uart2_ctsn", "eCAP2_in_PWM2_out", NULL, NULL, NULL, "gpio3_5"), Modified: stable/10/sys/arm/ti/ti_gpio.c ============================================================================== --- stable/10/sys/arm/ti/ti_gpio.c Thu May 15 15:45:45 2014 (r266147) +++ stable/10/sys/arm/ti/ti_gpio.c Thu May 15 15:47:52 2014 (r266148) @@ -66,92 +66,88 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" - /* Register definitions */ -#define TI_GPIO_REVISION 0x0000 -#define TI_GPIO_SYSCONFIG 0x0010 +/* Register definitions */ +#define TI_GPIO_REVISION 0x0000 +#define TI_GPIO_SYSCONFIG 0x0010 #if defined(SOC_OMAP3) -#define TI_GPIO_REVISION 0x0000 -#define TI_GPIO_SYSCONFIG 0x0010 -#define TI_GPIO_SYSSTATUS 0x0014 -#define TI_GPIO_IRQSTATUS1 0x0018 -#define TI_GPIO_IRQENABLE1 0x001C -#define TI_GPIO_WAKEUPENABLE 0x0020 -#define TI_GPIO_IRQSTATUS2 0x0028 -#define TI_GPIO_IRQENABLE2 0x002C -#define TI_GPIO_CTRL 0x0030 -#define TI_GPIO_OE 0x0034 -#define TI_GPIO_DATAIN 0x0038 -#define TI_GPIO_DATAOUT 0x003C -#define TI_GPIO_LEVELDETECT0 0x0040 -#define TI_GPIO_LEVELDETECT1 0x0044 -#define TI_GPIO_RISINGDETECT 0x0048 -#define TI_GPIO_FALLINGDETECT 0x004C -#define TI_GPIO_DEBOUNCENABLE 0x0050 -#define TI_GPIO_DEBOUNCINGTIME 0x0054 -#define TI_GPIO_CLEARIRQENABLE1 0x0060 -#define TI_GPIO_SETIRQENABLE1 0x0064 -#define TI_GPIO_CLEARIRQENABLE2 0x0070 -#define TI_GPIO_SETIRQENABLE2 0x0074 -#define TI_GPIO_CLEARWKUENA 0x0080 -#define TI_GPIO_SETWKUENA 0x0084 -#define TI_GPIO_CLEARDATAOUT 0x0090 -#define TI_GPIO_SETDATAOUT 0x0094 +#define TI_GPIO_SYSSTATUS 0x0014 +#define TI_GPIO_IRQSTATUS1 0x0018 +#define TI_GPIO_IRQENABLE1 0x001C +#define TI_GPIO_WAKEUPENABLE 0x0020 +#define TI_GPIO_IRQSTATUS2 0x0028 +#define TI_GPIO_IRQENABLE2 0x002C +#define TI_GPIO_CTRL 0x0030 +#define TI_GPIO_OE 0x0034 +#define TI_GPIO_DATAIN 0x0038 +#define TI_GPIO_DATAOUT 0x003C +#define TI_GPIO_LEVELDETECT0 0x0040 +#define TI_GPIO_LEVELDETECT1 0x0044 +#define TI_GPIO_RISINGDETECT 0x0048 +#define TI_GPIO_FALLINGDETECT 0x004C +#define TI_GPIO_DEBOUNCENABLE 0x0050 +#define TI_GPIO_DEBOUNCINGTIME 0x0054 +#define TI_GPIO_CLEARIRQENABLE1 0x0060 +#define TI_GPIO_SETIRQENABLE1 0x0064 +#define TI_GPIO_CLEARIRQENABLE2 0x0070 +#define TI_GPIO_SETIRQENABLE2 0x0074 +#define TI_GPIO_CLEARWKUENA 0x0080 +#define TI_GPIO_SETWKUENA 0x0084 +#define TI_GPIO_CLEARDATAOUT 0x0090 +#define TI_GPIO_SETDATAOUT 0x0094 #elif defined(SOC_OMAP4) || defined(SOC_TI_AM335X) -#define TI_GPIO_IRQSTATUS_RAW_0 0x0024 -#define TI_GPIO_IRQSTATUS_RAW_1 0x0028 -#define TI_GPIO_IRQSTATUS_0 0x002C -#define TI_GPIO_IRQSTATUS_1 0x0030 -#define TI_GPIO_IRQSTATUS_SET_0 0x0034 -#define TI_GPIO_IRQSTATUS_SET_1 0x0038 -#define TI_GPIO_IRQSTATUS_CLR_0 0x003C -#define TI_GPIO_IRQSTATUS_CLR_1 0x0040 -#define TI_GPIO_IRQWAKEN_0 0x0044 -#define TI_GPIO_IRQWAKEN_1 0x0048 -#define TI_GPIO_SYSSTATUS 0x0114 -#define TI_GPIO_IRQSTATUS1 0x0118 -#define TI_GPIO_IRQENABLE1 0x011C -#define TI_GPIO_WAKEUPENABLE 0x0120 -#define TI_GPIO_IRQSTATUS2 0x0128 -#define TI_GPIO_IRQENABLE2 0x012C -#define TI_GPIO_CTRL 0x0130 -#define TI_GPIO_OE 0x0134 -#define TI_GPIO_DATAIN 0x0138 -#define TI_GPIO_DATAOUT 0x013C -#define TI_GPIO_LEVELDETECT0 0x0140 -#define TI_GPIO_LEVELDETECT1 0x0144 -#define TI_GPIO_RISINGDETECT 0x0148 -#define TI_GPIO_FALLINGDETECT 0x014C -#define TI_GPIO_DEBOUNCENABLE 0x0150 -#define TI_GPIO_DEBOUNCINGTIME 0x0154 -#define TI_GPIO_CLEARIRQENABLE1 0x0160 -#define TI_GPIO_SETIRQENABLE1 0x0164 -#define TI_GPIO_CLEARIRQENABLE2 0x0170 -#define TI_GPIO_SETIRQENABLE2 0x0174 -#define TI_GPIO_CLEARWKUPENA 0x0180 -#define TI_GPIO_SETWKUENA 0x0184 -#define TI_GPIO_CLEARDATAOUT 0x0190 -#define TI_GPIO_SETDATAOUT 0x0194 +#define TI_GPIO_IRQSTATUS_RAW_0 0x0024 +#define TI_GPIO_IRQSTATUS_RAW_1 0x0028 +#define TI_GPIO_IRQSTATUS_0 0x002C +#define TI_GPIO_IRQSTATUS_1 0x0030 +#define TI_GPIO_IRQSTATUS_SET_0 0x0034 +#define TI_GPIO_IRQSTATUS_SET_1 0x0038 +#define TI_GPIO_IRQSTATUS_CLR_0 0x003C +#define TI_GPIO_IRQSTATUS_CLR_1 0x0040 +#define TI_GPIO_IRQWAKEN_0 0x0044 +#define TI_GPIO_IRQWAKEN_1 0x0048 +#define TI_GPIO_SYSSTATUS 0x0114 +#define TI_GPIO_IRQSTATUS1 0x0118 +#define TI_GPIO_IRQENABLE1 0x011C +#define TI_GPIO_WAKEUPENABLE 0x0120 +#define TI_GPIO_IRQSTATUS2 0x0128 +#define TI_GPIO_IRQENABLE2 0x012C +#define TI_GPIO_CTRL 0x0130 +#define TI_GPIO_OE 0x0134 +#define TI_GPIO_DATAIN 0x0138 +#define TI_GPIO_DATAOUT 0x013C +#define TI_GPIO_LEVELDETECT0 0x0140 +#define TI_GPIO_LEVELDETECT1 0x0144 +#define TI_GPIO_RISINGDETECT 0x0148 +#define TI_GPIO_FALLINGDETECT 0x014C +#define TI_GPIO_DEBOUNCENABLE 0x0150 +#define TI_GPIO_DEBOUNCINGTIME 0x0154 +#define TI_GPIO_CLEARWKUPENA 0x0180 +#define TI_GPIO_SETWKUENA 0x0184 +#define TI_GPIO_CLEARDATAOUT 0x0190 +#define TI_GPIO_SETDATAOUT 0x0194 #else #error "Unknown SoC" #endif - /*Other SoC Specific definitions*/ +/* Other SoC Specific definitions */ #if defined(SOC_OMAP3) -#define MAX_GPIO_BANKS 6 -#define FIRST_GPIO_BANK 1 -#define PINS_PER_BANK 32 -#define TI_GPIO_REV 0x00000025 +#define MAX_GPIO_BANKS 6 +#define FIRST_GPIO_BANK 1 +#define INTR_PER_BANK 1 +#define TI_GPIO_REV 0x00000025 #elif defined(SOC_OMAP4) -#define MAX_GPIO_BANKS 6 -#define FIRST_GPIO_BANK 1 -#define PINS_PER_BANK 32 -#define TI_GPIO_REV 0x50600801 +#define MAX_GPIO_BANKS 6 +#define FIRST_GPIO_BANK 1 +#define INTR_PER_BANK 1 +#define TI_GPIO_REV 0x50600801 #elif defined(SOC_TI_AM335X) -#define MAX_GPIO_BANKS 4 -#define FIRST_GPIO_BANK 0 -#define PINS_PER_BANK 32 -#define TI_GPIO_REV 0x50600801 +#define MAX_GPIO_BANKS 4 +#define FIRST_GPIO_BANK 0 +#define INTR_PER_BANK 2 +#define TI_GPIO_REV 0x50600801 #endif +#define PINS_PER_BANK 32 +#define MAX_GPIO_INTRS MAX_GPIO_BANKS * INTR_PER_BANK /** * ti_gpio_mem_spec - Resource specification used when allocating resources @@ -159,6 +155,15 @@ __FBSDID("$FreeBSD$"); * * This driver module can have up to six independent memory regions, each * region typically controls 32 GPIO pins. + * + * On OMAP3 and OMAP4 there is only one physical interrupt line per bank, + * but there are two set of registers which control the interrupt delivery + * to internal subsystems. The first set of registers control the + * interrupts delivery to the MPU and the second set control the + * interrupts delivery to the DSP. + * + * On AM335x there are two physical interrupt lines for each GPIO module. + * Each interrupt line is controlled by a set of registers. */ static struct resource_spec ti_gpio_mem_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -176,9 +181,11 @@ static struct resource_spec ti_gpio_irq_ { SYS_RES_IRQ, 1, RF_ACTIVE | RF_OPTIONAL }, { SYS_RES_IRQ, 2, RF_ACTIVE | RF_OPTIONAL }, { SYS_RES_IRQ, 3, RF_ACTIVE | RF_OPTIONAL }, -#if !defined(SOC_TI_AM335X) { SYS_RES_IRQ, 4, RF_ACTIVE | RF_OPTIONAL }, { SYS_RES_IRQ, 5, RF_ACTIVE | RF_OPTIONAL }, +#if defined(SOC_TI_AM335X) + { SYS_RES_IRQ, 6, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 7, RF_ACTIVE | RF_OPTIONAL }, #endif { -1, 0, 0 } }; @@ -189,34 +196,38 @@ static struct resource_spec ti_gpio_irq_ * This structure is allocated during driver attach. */ struct ti_gpio_softc { - device_t sc_dev; + device_t sc_dev; - /* The memory resource(s) for the PRCM register set, when the device is - * created the caller can assign up to 4 memory regions. + /* + * The memory resource(s) for the PRCM register set, when the device is + * created the caller can assign up to 6 memory regions depending on + * the SoC type. */ - struct resource* sc_mem_res[MAX_GPIO_BANKS]; - struct resource* sc_irq_res[MAX_GPIO_BANKS]; + struct resource *sc_mem_res[MAX_GPIO_BANKS]; + struct resource *sc_irq_res[MAX_GPIO_INTRS]; - /* The handle for the register IRQ handlers */ - void* sc_irq_hdl[MAX_GPIO_BANKS]; + /* The handle for the register IRQ handlers. */ + void *sc_irq_hdl[MAX_GPIO_INTRS]; - /* The following describes the H/W revision of each of the GPIO banks */ - uint32_t sc_revision[MAX_GPIO_BANKS]; + /* + * The following describes the H/W revision of each of the GPIO banks. + */ + uint32_t sc_revision[MAX_GPIO_BANKS]; - struct mtx sc_mtx; + struct mtx sc_mtx; }; /** * Macros for driver mutex locking */ -#define TI_GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define TI_GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define TI_GPIO_LOCK_INIT(_sc) \ +#define TI_GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define TI_GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define TI_GPIO_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ - "ti_gpio", MTX_DEF) -#define TI_GPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define TI_GPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define TI_GPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + "ti_gpio", MTX_DEF) +#define TI_GPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx) +#define TI_GPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) +#define TI_GPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED) /** * ti_gpio_read_4 - reads a 16-bit value from one of the PADCONFS registers @@ -251,6 +262,20 @@ ti_gpio_write_4(struct ti_gpio_softc *sc bus_write_4(sc->sc_mem_res[bank], off, val); } +static inline void +ti_gpio_intr_clr(struct ti_gpio_softc *sc, unsigned int bank, uint32_t mask) +{ + + /* We clear both set of registers. */ +#if defined(SOC_OMAP4) || defined(SOC_TI_AM335X) + ti_gpio_write_4(sc, bank, TI_GPIO_IRQSTATUS_CLR_0, mask); + ti_gpio_write_4(sc, bank, TI_GPIO_IRQSTATUS_CLR_1, mask); +#else + ti_gpio_write_4(sc, bank, TI_GPIO_CLEARIRQENABLE1, mask); + ti_gpio_write_4(sc, bank, TI_GPIO_CLEARIRQENABLE2, mask); +#endif +} + /** * ti_gpio_pin_max - Returns the maximum number of GPIO pins * @dev: gpio device handle @@ -441,7 +466,6 @@ ti_gpio_pin_setflags(device_t dev, uint3 (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) return (EINVAL); - TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ @@ -464,7 +488,6 @@ ti_gpio_pin_setflags(device_t dev, uint3 reg_val &= ~mask; ti_gpio_write_4(sc, bank, TI_GPIO_OE, reg_val); - TI_GPIO_UNLOCK(sc); return (0); @@ -631,6 +654,97 @@ ti_gpio_probe(device_t dev) return (ENXIO); device_set_desc(dev, "TI General Purpose I/O (GPIO)"); + + return (0); +} + +static int +ti_gpio_attach_intr(device_t dev) +{ + int i; + struct ti_gpio_softc *sc; + + sc = device_get_softc(dev); + for (i = 0; i < MAX_GPIO_INTRS; i++) { + if (sc->sc_irq_res[i] == NULL) + break; + + /* + * Register our interrupt handler for each of the IRQ resources. + */ + if (bus_setup_intr(dev, sc->sc_irq_res[i], + INTR_TYPE_MISC | INTR_MPSAFE, NULL, ti_gpio_intr, sc, + &sc->sc_irq_hdl[i]) != 0) { + device_printf(dev, + "WARNING: unable to register interrupt handler\n"); + return (-1); + } + } + + return (0); +} + +static int +ti_gpio_detach_intr(device_t dev) +{ + int i; + struct ti_gpio_softc *sc; + + /* Teardown our interrupt handlers. */ + sc = device_get_softc(dev); + for (i = 0; i < MAX_GPIO_INTRS; i++) { + if (sc->sc_irq_res[i] == NULL) + break; + + if (sc->sc_irq_hdl[i]) { + bus_teardown_intr(dev, sc->sc_irq_res[i], + sc->sc_irq_hdl[i]); + } + } + + return (0); +} + +static int +ti_gpio_bank_init(device_t dev, int bank) +{ + int pin; + struct ti_gpio_softc *sc; + uint32_t flags, reg_oe; + + sc = device_get_softc(dev); + + /* Enable the interface and functional clocks for the module. */ + ti_prcm_clk_enable(GPIO0_CLK + FIRST_GPIO_BANK + bank); + + /* + * Read the revision number of the module. TI don't publish the + * actual revision numbers, so instead the values have been + * determined by experimentation. + */ + sc->sc_revision[bank] = ti_gpio_read_4(sc, bank, TI_GPIO_REVISION); + + /* Check the revision. */ + if (sc->sc_revision[bank] != TI_GPIO_REV) { + device_printf(dev, "Warning: could not determine the revision " + "of %u GPIO module (revision:0x%08x)\n", + bank, sc->sc_revision[bank]); + return (EINVAL); + } + + /* Disable interrupts for all pins. */ + ti_gpio_intr_clr(sc, bank, 0xffffffff); + + /* Init OE register based on pads configuration. */ + reg_oe = 0xffffffff; + for (pin = 0; pin < PINS_PER_BANK; pin++) { + ti_scm_padconf_get_gpioflags(PINS_PER_BANK * bank + pin, + &flags); + if (flags & GPIO_PIN_OUTPUT) + reg_oe &= ~(1UL << pin); + } + ti_gpio_write_4(sc, bank, TI_GPIO_OE, reg_oe); + return (0); } @@ -650,90 +764,56 @@ ti_gpio_probe(device_t dev) static int ti_gpio_attach(device_t dev) { - struct ti_gpio_softc *sc = device_get_softc(dev); + struct ti_gpio_softc *sc; unsigned int i; - int err = 0; - int pin; - uint32_t flags; - uint32_t reg_oe; + int err; + sc = device_get_softc(dev); sc->sc_dev = dev; TI_GPIO_LOCK_INIT(sc); - /* There are up to 6 different GPIO register sets located in different * memory areas on the chip. The memory range should have been set for * the driver when it was added as a child. */ - err = bus_alloc_resources(dev, ti_gpio_mem_spec, sc->sc_mem_res); - if (err) { + if (bus_alloc_resources(dev, ti_gpio_mem_spec, sc->sc_mem_res) != 0) { device_printf(dev, "Error: could not allocate mem resources\n"); return (ENXIO); } /* Request the IRQ resources */ - err = bus_alloc_resources(dev, ti_gpio_irq_spec, sc->sc_irq_res); - if (err) { + if (bus_alloc_resources(dev, ti_gpio_irq_spec, sc->sc_irq_res) != 0) { + bus_release_resources(dev, ti_gpio_mem_spec, sc->sc_mem_res); device_printf(dev, "Error: could not allocate irq resources\n"); return (ENXIO); } /* Setup the IRQ resources */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { - if (sc->sc_irq_res[i] == NULL) - break; - - /* Register an interrupt handler for each of the IRQ resources */ - if ((bus_setup_intr(dev, sc->sc_irq_res[i], INTR_TYPE_MISC | INTR_MPSAFE, - NULL, ti_gpio_intr, sc, &(sc->sc_irq_hdl[i])))) { - device_printf(dev, "WARNING: unable to register interrupt handler\n"); - return (ENXIO); - } + if (ti_gpio_attach_intr(dev) != 0) { + ti_gpio_detach_intr(dev); + bus_release_resources(dev, ti_gpio_irq_spec, sc->sc_irq_res); + bus_release_resources(dev, ti_gpio_mem_spec, sc->sc_mem_res); + return (ENXIO); } - /* Store the device handle back in the sc */ - sc->sc_dev = dev; - /* We need to go through each block and ensure the clocks are running and * the module is enabled. It might be better to do this only when the * pins are configured which would result in less power used if the GPIO * pins weren't used ... */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { + for (i = 0; i < MAX_GPIO_BANKS; i++) { if (sc->sc_mem_res[i] != NULL) { - - /* Enable the interface and functional clocks for the module */ - ti_prcm_clk_enable(GPIO0_CLK + FIRST_GPIO_BANK + i); - - /* Read the revision number of the module. TI don't publish the - * actual revision numbers, so instead the values have been - * determined by experimentation. - */ - sc->sc_revision[i] = ti_gpio_read_4(sc, i, TI_GPIO_REVISION); - - /* Check the revision */ - if (sc->sc_revision[i] != TI_GPIO_REV) { - device_printf(dev, "Warning: could not determine the revision" - "of %u GPIO module (revision:0x%08x)\n", - i, sc->sc_revision[i]); - continue; + /* Initialize the GPIO module. */ + err = ti_gpio_bank_init(dev, i); + if (err != 0) { + ti_gpio_detach_intr(dev); + bus_release_resources(dev, ti_gpio_irq_spec, + sc->sc_irq_res); + bus_release_resources(dev, ti_gpio_mem_spec, + sc->sc_mem_res); + return (err); } - - /* Disable interrupts for all pins */ - ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE1, 0xffffffff); - ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE2, 0xffffffff); - - /* Init OE register based on pads configuration */ - reg_oe = 0xffffffff; - for (pin = 0; pin < 32; pin++) { - ti_scm_padconf_get_gpioflags( - PINS_PER_BANK*i + pin, &flags); - if (flags & GPIO_PIN_OUTPUT) - reg_oe &= ~(1U << pin); - } - - ti_gpio_write_4(sc, i, TI_GPIO_OE, reg_oe); } } @@ -766,26 +846,21 @@ ti_gpio_detach(device_t dev) KASSERT(mtx_initialized(&sc->sc_mtx), ("gpio mutex not initialized")); /* Disable all interrupts */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { - if (sc->sc_mem_res[i] != NULL) { - ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE1, 0xffffffff); - ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE2, 0xffffffff); - } + for (i = 0; i < MAX_GPIO_BANKS; i++) { + if (sc->sc_mem_res[i] != NULL) + ti_gpio_intr_clr(sc, i, 0xffffffff); } bus_generic_detach(dev); - /* Release the memory and IRQ resources */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { - if (sc->sc_mem_res[i] != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, i, sc->sc_mem_res[i]); - if (sc->sc_irq_res[i] != NULL) - bus_release_resource(dev, SYS_RES_IRQ, i, sc->sc_irq_res[i]); - } + /* Release the memory and IRQ resources. */ + ti_gpio_detach_intr(dev); + bus_release_resources(dev, ti_gpio_irq_spec, sc->sc_irq_res); + bus_release_resources(dev, ti_gpio_mem_spec, sc->sc_mem_res); TI_GPIO_LOCK_DESTROY(sc); - return(0); + return (0); } static phandle_t From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 16:11:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 87EA0CD7; Thu, 15 May 2014 16:11: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 70A1427C0; Thu, 15 May 2014 16:11: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 s4FGBNva070031; Thu, 15 May 2014 16:11:23 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FGB6E1069906; Thu, 15 May 2014 16:11:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151611.s4FGB6E1069906@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 16:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266152 - in stable/10/sys: arm/allwinner arm/allwinner/a20 arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/lpc arm/mv arm/rockchip arm/samsung/exynos arm/ti arm... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 16:11:23 -0000 Author: ian Date: Thu May 15 16:11:06 2014 New Revision: 266152 URL: http://svnweb.freebsd.org/changeset/base/266152 Log: MFC r261410 Follow r261352 by updating all drivers which are children of simplebus to check the status property in their probe routines. Modified: stable/10/sys/arm/allwinner/a10_clk.c stable/10/sys/arm/allwinner/a10_ehci.c stable/10/sys/arm/allwinner/a10_gpio.c stable/10/sys/arm/allwinner/a10_wdog.c stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c stable/10/sys/arm/allwinner/aintc.c stable/10/sys/arm/arm/generic_timer.c stable/10/sys/arm/arm/gic.c stable/10/sys/arm/arm/mpcore_timer.c stable/10/sys/arm/arm/pl190.c stable/10/sys/arm/arm/pl310.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_bsc.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_dma.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_intr.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_wdog.c stable/10/sys/arm/freescale/imx/i2c.c stable/10/sys/arm/freescale/imx/imx51_ccm.c stable/10/sys/arm/freescale/imx/imx51_gpio.c stable/10/sys/arm/freescale/imx/imx51_iomux.c stable/10/sys/arm/freescale/imx/imx51_ipuv3.c stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c stable/10/sys/arm/freescale/imx/imx6_anatop.c stable/10/sys/arm/freescale/imx/imx6_ccm.c stable/10/sys/arm/freescale/imx/imx6_usbphy.c stable/10/sys/arm/freescale/imx/imx_gpt.c stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c stable/10/sys/arm/freescale/imx/imx_sdhci.c stable/10/sys/arm/freescale/imx/imx_wdog.c stable/10/sys/arm/freescale/imx/tzic.c stable/10/sys/arm/freescale/vybrid/vf_anadig.c stable/10/sys/arm/freescale/vybrid/vf_ccm.c stable/10/sys/arm/freescale/vybrid/vf_ehci.c stable/10/sys/arm/freescale/vybrid/vf_gpio.c stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c stable/10/sys/arm/freescale/vybrid/vf_mscm.c stable/10/sys/arm/freescale/vybrid/vf_nfc.c stable/10/sys/arm/freescale/vybrid/vf_src.c stable/10/sys/arm/lpc/if_lpe.c stable/10/sys/arm/lpc/lpc_dmac.c stable/10/sys/arm/lpc/lpc_fb.c stable/10/sys/arm/lpc/lpc_gpio.c stable/10/sys/arm/lpc/lpc_intc.c stable/10/sys/arm/lpc/lpc_mmc.c stable/10/sys/arm/lpc/lpc_ohci.c stable/10/sys/arm/lpc/lpc_pwr.c stable/10/sys/arm/lpc/lpc_rtc.c stable/10/sys/arm/lpc/lpc_spi.c stable/10/sys/arm/lpc/lpc_timer.c stable/10/sys/arm/mv/gpio.c stable/10/sys/arm/mv/ic.c stable/10/sys/arm/mv/mpic.c stable/10/sys/arm/mv/mv_sata.c stable/10/sys/arm/mv/mv_ts.c stable/10/sys/arm/mv/rtc.c stable/10/sys/arm/mv/timer.c stable/10/sys/arm/mv/twsi.c stable/10/sys/arm/rockchip/rk30xx_gpio.c stable/10/sys/arm/rockchip/rk30xx_grf.c stable/10/sys/arm/rockchip/rk30xx_pmu.c stable/10/sys/arm/rockchip/rk30xx_wdog.c stable/10/sys/arm/samsung/exynos/arch_timer.c stable/10/sys/arm/samsung/exynos/ehci_exynos5.c stable/10/sys/arm/ti/aintc.c stable/10/sys/arm/ti/am335x/am335x_dmtimer.c stable/10/sys/arm/ti/am335x/am335x_lcd.c stable/10/sys/arm/ti/am335x/am335x_prcm.c stable/10/sys/arm/ti/am335x/am335x_pwm.c stable/10/sys/arm/ti/am335x/am335x_usbss.c stable/10/sys/arm/ti/cpsw/if_cpsw.c stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c stable/10/sys/arm/ti/ti_edma3.c stable/10/sys/arm/ti/ti_gpio.c stable/10/sys/arm/ti/ti_i2c.c stable/10/sys/arm/ti/ti_mbox.c stable/10/sys/arm/ti/ti_mmchs.c stable/10/sys/arm/ti/ti_pruss.c stable/10/sys/arm/ti/ti_scm.c stable/10/sys/arm/ti/ti_sdhci.c stable/10/sys/arm/ti/ti_sdma.c stable/10/sys/arm/ti/usb/omap_ehci.c stable/10/sys/arm/versatile/if_smc_fdt.c stable/10/sys/arm/versatile/pl050.c stable/10/sys/arm/versatile/sp804.c stable/10/sys/arm/versatile/versatile_clcd.c stable/10/sys/arm/versatile/versatile_pci.c stable/10/sys/arm/versatile/versatile_sic.c stable/10/sys/arm/xilinx/zy7_devcfg.c stable/10/sys/arm/xilinx/zy7_ehci.c stable/10/sys/arm/xilinx/zy7_gpio.c stable/10/sys/arm/xilinx/zy7_slcr.c stable/10/sys/dev/altera/atse/if_atse_fdt.c stable/10/sys/dev/altera/avgen/altera_avgen_fdt.c stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c stable/10/sys/dev/altera/sdcard/altera_sdcard_fdt.c stable/10/sys/dev/ata/chipsets/ata-fsl.c stable/10/sys/dev/cesa/cesa.c stable/10/sys/dev/cfi/cfi_bus_fdt.c stable/10/sys/dev/fdt/simplebus.c stable/10/sys/dev/ffec/if_ffec.c stable/10/sys/dev/mge/if_mge.c stable/10/sys/dev/mvs/mvs_soc.c stable/10/sys/dev/quicc/quicc_bfe_fdt.c stable/10/sys/dev/sdhci/sdhci_fdt.c stable/10/sys/dev/sec/sec.c stable/10/sys/dev/terasic/de4led/terasic_de4led_fdt.c stable/10/sys/dev/terasic/mtl/terasic_mtl_fdt.c stable/10/sys/dev/tsec/if_tsec_fdt.c stable/10/sys/dev/uart/uart_bus_fdt.c stable/10/sys/dev/usb/controller/dwc_otg_fdt.c stable/10/sys/dev/usb/controller/ehci_fsl.c stable/10/sys/dev/usb/controller/ehci_imx.c stable/10/sys/dev/usb/controller/ehci_mv.c stable/10/sys/mips/beri/beri_pic.c stable/10/sys/mips/beri/beri_simplebus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/allwinner/a10_clk.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_clk.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/allwinner/a10_clk.c Thu May 15 16:11:06 2014 (r266152) @@ -69,6 +69,10 @@ static struct a10_ccm_softc *a10_ccm_sc static int a10_ccm_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "allwinner,sun4i-ccm")) { device_set_desc(dev, "Allwinner Clock Control Module"); return(BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/allwinner/a10_ehci.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_ehci.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/allwinner/a10_ehci.c Thu May 15 16:11:06 2014 (r266152) @@ -93,6 +93,10 @@ bs_w_1_proto(reversed); static int a10_ehci_probe(device_t self) { + + if (!ofw_bus_status_okay(self)) + return (ENXIO); + if (!ofw_bus_is_compatible(self, "allwinner,usb-ehci")) return (ENXIO); Modified: stable/10/sys/arm/allwinner/a10_gpio.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_gpio.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/allwinner/a10_gpio.c Thu May 15 16:11:06 2014 (r266152) @@ -410,6 +410,10 @@ a10_gpio_pin_toggle(device_t dev, uint32 static int a10_gpio_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-gpio")) return (ENXIO); Modified: stable/10/sys/arm/allwinner/a10_wdog.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_wdog.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/allwinner/a10_wdog.c Thu May 15 16:11:06 2014 (r266152) @@ -93,6 +93,9 @@ static int a10wd_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "allwinner,sun4i-wdt")) { device_set_desc(dev, "Allwinner A10 Watchdog"); return (BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c ============================================================================== --- stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c Thu May 15 16:11:06 2014 (r266152) @@ -70,6 +70,9 @@ static int a20_cpu_cfg_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "allwinner,sun7i-cpu-cfg")) { device_set_desc(dev, "A20 CPU Configuration Module"); return(BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/allwinner/aintc.c ============================================================================== --- stable/10/sys/arm/allwinner/aintc.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/allwinner/aintc.c Thu May 15 16:11:06 2014 (r266152) @@ -97,6 +97,10 @@ static struct a10_aintc_softc *a10_aintc static int a10_aintc_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-ic")) return (ENXIO); device_set_desc(dev, "A10 AINTC Interrupt Controller"); Modified: stable/10/sys/arm/arm/generic_timer.c ============================================================================== --- stable/10/sys/arm/arm/generic_timer.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/arm/generic_timer.c Thu May 15 16:11:06 2014 (r266152) @@ -244,6 +244,9 @@ static int arm_tmr_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "arm,armv7-timer")) return (ENXIO); Modified: stable/10/sys/arm/arm/gic.c ============================================================================== --- stable/10/sys/arm/arm/gic.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/arm/gic.c Thu May 15 16:11:06 2014 (r266152) @@ -129,6 +129,9 @@ static int arm_gic_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "arm,gic")) return (ENXIO); device_set_desc(dev, "ARM Generic Interrupt Controller"); Modified: stable/10/sys/arm/arm/mpcore_timer.c ============================================================================== --- stable/10/sys/arm/arm/mpcore_timer.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/arm/mpcore_timer.c Thu May 15 16:11:06 2014 (r266152) @@ -247,6 +247,10 @@ arm_tmr_intr(void *arg) static int arm_tmr_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "arm,mpcore-timers")) return (ENXIO); Modified: stable/10/sys/arm/arm/pl190.c ============================================================================== --- stable/10/sys/arm/arm/pl190.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/arm/pl190.c Thu May 15 16:11:06 2014 (r266152) @@ -78,6 +78,10 @@ static struct pl190_intc_softc *pl190_in static int pl190_intc_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "arm,versatile-vic")) return (ENXIO); device_set_desc(dev, "ARM PL190 VIC"); Modified: stable/10/sys/arm/arm/pl310.c ============================================================================== --- stable/10/sys/arm/arm/pl310.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/arm/pl310.c Thu May 15 16:11:06 2014 (r266152) @@ -281,6 +281,9 @@ static int pl310_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "arm,pl310")) return (ENXIO); device_set_desc(dev, "PL310 L2 cache controller"); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Thu May 15 16:11:06 2014 (r266152) @@ -222,6 +222,9 @@ static int bcm_bsc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-bsc")) return (ENXIO); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_dma.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_dma.c Thu May 15 16:11:06 2014 (r266152) @@ -637,6 +637,9 @@ static int bcm_dma_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-dma")) return (ENXIO); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Thu May 15 16:11:06 2014 (r266152) @@ -674,6 +674,10 @@ bcm_gpio_get_reserved_pins(struct bcm_gp static int bcm_gpio_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-gpio")) return (ENXIO); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_intr.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_intr.c Thu May 15 16:11:06 2014 (r266152) @@ -90,6 +90,10 @@ static struct bcm_intc_softc *bcm_intc_s static int bcm_intc_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-armctrl-ic")) return (ENXIO); device_set_desc(dev, "BCM2835 Interrupt Controller"); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Thu May 15 16:11:06 2014 (r266152) @@ -128,6 +128,9 @@ static int bcm_mbox_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "broadcom,bcm2835-mbox")) { device_set_desc(dev, "BCM2835 VideoCore Mailbox"); return(BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Thu May 15 16:11:06 2014 (r266152) @@ -151,6 +151,10 @@ bcm_dmamap_cb(void *arg, bus_dma_segment static int bcm_sdhci_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-sdhci")) return (ENXIO); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c Thu May 15 16:11:06 2014 (r266152) @@ -231,6 +231,9 @@ static int bcm_spi_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-spi")) return (ENXIO); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Thu May 15 16:11:06 2014 (r266152) @@ -186,6 +186,9 @@ static int bcm_systimer_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "broadcom,bcm2835-system-timer")) { device_set_desc(dev, "BCM2835 System Timer"); return (BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_wdog.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Thu May 15 16:11:06 2014 (r266152) @@ -86,6 +86,9 @@ static int bcmwd_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "broadcom,bcm2835-wdt")) { device_set_desc(dev, "BCM2708/2835 Watchdog"); return (BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/freescale/imx/i2c.c ============================================================================== --- stable/10/sys/arm/freescale/imx/i2c.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/i2c.c Thu May 15 16:11:06 2014 (r266152) @@ -224,6 +224,9 @@ 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); Modified: stable/10/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ccm.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx51_ccm.c Thu May 15 16:11:06 2014 (r266152) @@ -141,6 +141,9 @@ static int imxccm_match(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,imx51-ccm") && !ofw_bus_is_compatible(dev, "fsl,imx53-ccm")) return (ENXIO); Modified: stable/10/sys/arm/freescale/imx/imx51_gpio.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_gpio.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx51_gpio.c Thu May 15 16:11:06 2014 (r266152) @@ -370,6 +370,9 @@ static int imx51_gpio_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,imx51-gpio") || ofw_bus_is_compatible(dev, "fsl,imx53-gpio")) { device_set_desc(dev, "i.MX515 GPIO Controller"); Modified: stable/10/sys/arm/freescale/imx/imx51_iomux.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_iomux.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx51_iomux.c Thu May 15 16:11:06 2014 (r266152) @@ -106,6 +106,9 @@ static int iomux_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,imx51-iomux") && !ofw_bus_is_compatible(dev, "fsl,imx53-iomux")) return (ENXIO); Modified: stable/10/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ipuv3.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx51_ipuv3.c Thu May 15 16:11:06 2014 (r266152) @@ -254,6 +254,9 @@ ipu3_fb_probe(device_t dev) { int error; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,ipu3")) return (ENXIO); Modified: stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Thu May 15 16:11:06 2014 (r266152) @@ -184,6 +184,9 @@ static int ipu3_fb_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,ipu3")) return (ENXIO); Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Thu May 15 16:11:06 2014 (r266152) @@ -126,6 +126,9 @@ static int imx6_anatop_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,imx6q-anatop") == 0) return (ENXIO); Modified: stable/10/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_ccm.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx6_ccm.c Thu May 15 16:11:06 2014 (r266152) @@ -121,6 +121,9 @@ static int ccm_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,imx6q-ccm") == 0) return (ENXIO); Modified: stable/10/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_usbphy.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx6_usbphy.c Thu May 15 16:11:06 2014 (r266152) @@ -160,6 +160,9 @@ static int usbphy_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,imx6q-usbphy") == 0) return (ENXIO); Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_gpt.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx_gpt.c Thu May 15 16:11:06 2014 (r266152) @@ -121,6 +121,9 @@ static int imx_gpt_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { device_set_desc(dev, "Freescale i.MX GPT timer"); return (BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c Thu May 15 16:11:06 2014 (r266152) @@ -89,6 +89,9 @@ static int usbphy_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { device_set_desc(dev, "Freescale USB PHY"); return (BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_sdhci.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx_sdhci.c Thu May 15 16:11:06 2014 (r266152) @@ -643,6 +643,9 @@ static int imx_sdhci_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { case HWTYPE_ESDHC: device_set_desc(dev, "Freescale eSDHC controller"); Modified: stable/10/sys/arm/freescale/imx/imx_wdog.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_wdog.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/imx_wdog.c Thu May 15 16:11:06 2014 (r266152) @@ -130,6 +130,9 @@ static int imx_wdog_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,imx51-wdt") && !ofw_bus_is_compatible(dev, "fsl,imx53-wdt")) return (ENXIO); Modified: stable/10/sys/arm/freescale/imx/tzic.c ============================================================================== --- stable/10/sys/arm/freescale/imx/tzic.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/imx/tzic.c Thu May 15 16:11:06 2014 (r266152) @@ -76,6 +76,10 @@ static void tzic_post_filter(void *); static int tzic_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,tzic")) { device_set_desc(dev, "TrustZone Interrupt Controller"); return (BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/freescale/vybrid/vf_anadig.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_anadig.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/vybrid/vf_anadig.c Thu May 15 16:11:06 2014 (r266152) @@ -114,6 +114,9 @@ static int anadig_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-anadig")) return (ENXIO); Modified: stable/10/sys/arm/freescale/vybrid/vf_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_ccm.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/vybrid/vf_ccm.c Thu May 15 16:11:06 2014 (r266152) @@ -339,6 +339,9 @@ static int ccm_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-ccm")) return (ENXIO); Modified: stable/10/sys/arm/freescale/vybrid/vf_ehci.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_ehci.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/vybrid/vf_ehci.c Thu May 15 16:11:06 2014 (r266152) @@ -176,6 +176,9 @@ static int vybrid_ehci_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "fsl,mvf600-usb-ehci") == 0) return (ENXIO); Modified: stable/10/sys/arm/freescale/vybrid/vf_gpio.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_gpio.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/vybrid/vf_gpio.c Thu May 15 16:11:06 2014 (r266152) @@ -123,6 +123,9 @@ static int vf_gpio_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-gpio")) return (ENXIO); Modified: stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c Thu May 15 16:11:06 2014 (r266152) @@ -90,6 +90,9 @@ static int iomuxc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-iomuxc")) return (ENXIO); Modified: stable/10/sys/arm/freescale/vybrid/vf_mscm.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_mscm.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/vybrid/vf_mscm.c Thu May 15 16:11:06 2014 (r266152) @@ -75,6 +75,9 @@ static int mscm_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-mscm")) return (ENXIO); Modified: stable/10/sys/arm/freescale/vybrid/vf_nfc.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_nfc.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/vybrid/vf_nfc.c Thu May 15 16:11:06 2014 (r266152) @@ -171,6 +171,9 @@ static int vf_nand_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-nand")) return (ENXIO); Modified: stable/10/sys/arm/freescale/vybrid/vf_src.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_src.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/freescale/vybrid/vf_src.c Thu May 15 16:11:06 2014 (r266152) @@ -102,6 +102,9 @@ static int src_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-src")) return (ENXIO); Modified: stable/10/sys/arm/lpc/if_lpe.c ============================================================================== --- stable/10/sys/arm/lpc/if_lpe.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/if_lpe.c Thu May 15 16:11:06 2014 (r266152) @@ -190,6 +190,9 @@ static int lpe_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,ethernet")) return (ENXIO); Modified: stable/10/sys/arm/lpc/lpc_dmac.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_dmac.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/lpc_dmac.c Thu May 15 16:11:06 2014 (r266152) @@ -90,6 +90,10 @@ static void lpc_dmac_intr(void *); static int lpc_dmac_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,dmac")) return (ENXIO); Modified: stable/10/sys/arm/lpc/lpc_fb.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_fb.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/lpc_fb.c Thu May 15 16:11:06 2014 (r266152) @@ -138,6 +138,10 @@ static struct cdevsw lpc_fb_cdevsw = { static int lpc_fb_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,fb")) return (ENXIO); Modified: stable/10/sys/arm/lpc/lpc_gpio.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_gpio.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/lpc_gpio.c Thu May 15 16:11:06 2014 (r266152) @@ -160,6 +160,10 @@ static struct lpc_gpio_softc *lpc_gpio_s static int lpc_gpio_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,gpio")) return (ENXIO); Modified: stable/10/sys/arm/lpc/lpc_intc.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_intc.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/lpc_intc.c Thu May 15 16:11:06 2014 (r266152) @@ -68,6 +68,9 @@ static int lpc_intc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,pic")) return (ENXIO); Modified: stable/10/sys/arm/lpc/lpc_mmc.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_mmc.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/lpc_mmc.c Thu May 15 16:11:06 2014 (r266152) @@ -166,6 +166,10 @@ static struct lpc_dmac_channel_config lp static int lpc_mmc_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,mmc")) return (ENXIO); Modified: stable/10/sys/arm/lpc/lpc_ohci.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_ohci.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/lpc_ohci.c Thu May 15 16:11:06 2014 (r266152) @@ -98,6 +98,10 @@ static void lpc_isp3101_configure(device static int lpc_ohci_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,usb-ohci")) return (ENXIO); Modified: stable/10/sys/arm/lpc/lpc_pwr.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_pwr.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/lpc_pwr.c Thu May 15 16:11:06 2014 (r266152) @@ -65,6 +65,9 @@ static int lpc_pwr_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,pwr")) return (ENXIO); Modified: stable/10/sys/arm/lpc/lpc_rtc.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_rtc.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/lpc_rtc.c Thu May 15 16:11:06 2014 (r266152) @@ -63,6 +63,9 @@ static int lpc_rtc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,rtc")) return (ENXIO); Modified: stable/10/sys/arm/lpc/lpc_spi.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_spi.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/lpc_spi.c Thu May 15 16:11:06 2014 (r266152) @@ -85,6 +85,10 @@ static int lpc_spi_transfer(device_t, de static int lpc_spi_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,spi")) return (ENXIO); Modified: stable/10/sys/arm/lpc/lpc_timer.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_timer.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/lpc/lpc_timer.c Thu May 15 16:11:06 2014 (r266152) @@ -111,6 +111,9 @@ static int lpc_timer_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "lpc,timer")) return (ENXIO); Modified: stable/10/sys/arm/mv/gpio.c ============================================================================== --- stable/10/sys/arm/mv/gpio.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/mv/gpio.c Thu May 15 16:11:06 2014 (r266152) @@ -125,6 +125,9 @@ static int mv_gpio_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,gpio")) return (ENXIO); Modified: stable/10/sys/arm/mv/ic.c ============================================================================== --- stable/10/sys/arm/mv/ic.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/mv/ic.c Thu May 15 16:11:06 2014 (r266152) @@ -80,6 +80,9 @@ static int mv_ic_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,pic")) return (ENXIO); Modified: stable/10/sys/arm/mv/mpic.c ============================================================================== --- stable/10/sys/arm/mv/mpic.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/mv/mpic.c Thu May 15 16:11:06 2014 (r266152) @@ -127,6 +127,9 @@ static int mv_mpic_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,mpic")) return (ENXIO); Modified: stable/10/sys/arm/mv/mv_sata.c ============================================================================== --- stable/10/sys/arm/mv/mv_sata.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/mv/mv_sata.c Thu May 15 16:11:06 2014 (r266152) @@ -185,6 +185,9 @@ sata_probe(device_t dev) struct sata_softc *sc; uint32_t d, r; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,sata")) return (ENXIO); Modified: stable/10/sys/arm/mv/mv_ts.c ============================================================================== --- stable/10/sys/arm/mv/mv_ts.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/mv/mv_ts.c Thu May 15 16:11:06 2014 (r266152) @@ -59,6 +59,9 @@ ts_probe(device_t dev) { uint32_t d, r; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,ts")) return (ENXIO); soc_id(&d, &r); Modified: stable/10/sys/arm/mv/rtc.c ============================================================================== --- stable/10/sys/arm/mv/rtc.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/mv/rtc.c Thu May 15 16:11:06 2014 (r266152) @@ -97,6 +97,9 @@ static int mv_rtc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,rtc")) return (ENXIO); Modified: stable/10/sys/arm/mv/timer.c ============================================================================== --- stable/10/sys/arm/mv/timer.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/mv/timer.c Thu May 15 16:11:06 2014 (r266152) @@ -108,6 +108,9 @@ static int mv_timer_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,timer")) return (ENXIO); Modified: stable/10/sys/arm/mv/twsi.c ============================================================================== --- stable/10/sys/arm/mv/twsi.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/mv/twsi.c Thu May 15 16:11:06 2014 (r266152) @@ -305,6 +305,9 @@ static int mv_twsi_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "mrvl,twsi")) return (ENXIO); Modified: stable/10/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_gpio.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/rockchip/rk30xx_gpio.c Thu May 15 16:11:06 2014 (r266152) @@ -421,6 +421,9 @@ static int rk30_gpio_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "rockchip,rk30xx-gpio")) return (ENXIO); Modified: stable/10/sys/arm/rockchip/rk30xx_grf.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_grf.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/rockchip/rk30xx_grf.c Thu May 15 16:11:06 2014 (r266152) @@ -70,6 +70,9 @@ static int rk30_grf_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "rockchip,rk30xx-grf")) { device_set_desc(dev, "RK30XX General Register File"); return(BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/rockchip/rk30xx_pmu.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_pmu.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/rockchip/rk30xx_pmu.c Thu May 15 16:11:06 2014 (r266152) @@ -70,6 +70,9 @@ static int rk30_pmu_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "rockchip,rk30xx-pmu")) { device_set_desc(dev, "RK30XX PMU"); return(BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/rockchip/rk30xx_wdog.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_wdog.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/rockchip/rk30xx_wdog.c Thu May 15 16:11:06 2014 (r266152) @@ -84,6 +84,9 @@ static int rk30_wd_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "rockchip,rk30xx-wdt")) { device_set_desc(dev, "Rockchip RK30XX Watchdog"); return (BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/samsung/exynos/arch_timer.c ============================================================================== --- stable/10/sys/arm/samsung/exynos/arch_timer.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/samsung/exynos/arch_timer.c Thu May 15 16:11:06 2014 (r266152) @@ -71,6 +71,10 @@ static struct resource_spec arm_tmr_spec static int arm_tmr_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "exynos,mct")) return (ENXIO); Modified: stable/10/sys/arm/samsung/exynos/ehci_exynos5.c ============================================================================== --- stable/10/sys/arm/samsung/exynos/ehci_exynos5.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/samsung/exynos/ehci_exynos5.c Thu May 15 16:11:06 2014 (r266152) @@ -147,6 +147,9 @@ static int exynos_ehci_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "exynos,usb-ehci") == 0) return (ENXIO); Modified: stable/10/sys/arm/ti/aintc.c ============================================================================== --- stable/10/sys/arm/ti/aintc.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/aintc.c Thu May 15 16:11:06 2014 (r266152) @@ -81,6 +81,10 @@ static struct ti_aintc_softc *ti_aintc_s static int ti_aintc_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "ti,aintc")) return (ENXIO); device_set_desc(dev, "TI AINTC Interrupt Controller"); Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Thu May 15 16:11:06 2014 (r266152) @@ -528,6 +528,9 @@ static int am335x_dmtimer_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "ti,am335x-dmtimer")) { device_set_desc(dev, "AM335x DMTimer"); return(BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_lcd.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/am335x/am335x_lcd.c Thu May 15 16:11:06 2014 (r266152) @@ -404,6 +404,9 @@ am335x_lcd_probe(device_t dev) { int err; + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,am335x-lcd")) return (ENXIO); Modified: stable/10/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_prcm.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/am335x/am335x_prcm.c Thu May 15 16:11:06 2014 (r266152) @@ -370,6 +370,10 @@ void am335x_prcm_setup_dmtimer(int); static int am335x_prcm_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "am335x,prcm")) { device_set_desc(dev, "AM335x Power and Clock Management"); return(BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/ti/am335x/am335x_pwm.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_pwm.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/am335x/am335x_pwm.c Thu May 15 16:11:06 2014 (r266152) @@ -309,6 +309,10 @@ am335x_pwm_sysctl_period(SYSCTL_HANDLER_ static int am335x_pwm_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,am335x-pwm")) return (ENXIO); Modified: stable/10/sys/arm/ti/am335x/am335x_usbss.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_usbss.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/am335x/am335x_usbss.c Thu May 15 16:11:06 2014 (r266152) @@ -250,6 +250,10 @@ musbotg_wrapper_interrupt(void *arg) static int musbotg_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,musb-am33xx")) return (ENXIO); Modified: stable/10/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/10/sys/arm/ti/cpsw/if_cpsw.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/cpsw/if_cpsw.c Thu May 15 16:11:06 2014 (r266152) @@ -445,6 +445,9 @@ static int cpsw_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,cpsw")) return (ENXIO); Modified: stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c Thu May 15 16:11:06 2014 (r266152) @@ -1363,6 +1363,10 @@ omap4_prcm_reset(void) static int omap4_prcm_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,omap4_prcm")) return (ENXIO); Modified: stable/10/sys/arm/ti/ti_edma3.c ============================================================================== --- stable/10/sys/arm/ti/ti_edma3.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/ti_edma3.c Thu May 15 16:11:06 2014 (r266152) @@ -142,6 +142,10 @@ static struct { static int ti_edma3_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,edma3")) return (ENXIO); Modified: stable/10/sys/arm/ti/ti_gpio.c ============================================================================== --- stable/10/sys/arm/ti/ti_gpio.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/ti_gpio.c Thu May 15 16:11:06 2014 (r266152) @@ -650,6 +650,10 @@ ti_gpio_intr(void *arg) static int ti_gpio_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,gpio")) return (ENXIO); Modified: stable/10/sys/arm/ti/ti_i2c.c ============================================================================== --- stable/10/sys/arm/ti/ti_i2c.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/ti_i2c.c Thu May 15 16:11:06 2014 (r266152) @@ -1020,6 +1020,10 @@ ti_i2c_deactivate(device_t dev) static int ti_i2c_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,i2c")) return (ENXIO); Modified: stable/10/sys/arm/ti/ti_mbox.c ============================================================================== --- stable/10/sys/arm/ti/ti_mbox.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/ti_mbox.c Thu May 15 16:11:06 2014 (r266152) @@ -119,6 +119,10 @@ ti_mbox_reg_write(struct ti_mbox_softc * static int ti_mbox_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "ti,system-mbox")) { device_set_desc(dev, "TI System Mailbox"); return (BUS_PROBE_DEFAULT); Modified: stable/10/sys/arm/ti/ti_mmchs.c ============================================================================== --- stable/10/sys/arm/ti/ti_mmchs.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/ti_mmchs.c Thu May 15 16:11:06 2014 (r266152) @@ -1656,6 +1656,10 @@ errout: static int ti_mmchs_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "ti,mmchs")) return (ENXIO); Modified: stable/10/sys/arm/ti/ti_pruss.c ============================================================================== --- stable/10/sys/arm/ti/ti_pruss.c Thu May 15 15:50:37 2014 (r266151) +++ stable/10/sys/arm/ti/ti_pruss.c Thu May 15 16:11:06 2014 (r266152) @@ -145,6 +145,10 @@ ti_pruss_reg_write(struct ti_pruss_softc static int ti_pruss_probe(device_t dev) { + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "ti,pruss-v1") || ofw_bus_is_compatible(dev, "ti,pruss-v2")) { device_set_desc(dev, "TI Programmable Realtime Unit Subsystem"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 16:23:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 23FEB214; Thu, 15 May 2014 16:23: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 04AA328A8; Thu, 15 May 2014 16:23: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 s4FGNP4Q077512; Thu, 15 May 2014 16:23:25 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FGNOrt077505; Thu, 15 May 2014 16:23:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151623.s4FGNOrt077505@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 16:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266155 - in stable/10/sys: arm/conf arm/freescale/vybrid boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 16:23:26 -0000 Author: ian Date: Thu May 15 16:23:24 2014 New Revision: 266155 URL: http://svnweb.freebsd.org/changeset/base/266155 Log: MFC r261411, r261413, r261416: Add support for Colibri VF50 Evaluation Board. Add driver for Display Control Unit (DCU4). Add prototype for tcon_bypass() used by dcu4. Add register definition. Added: stable/10/sys/arm/conf/COLIBRI-VF50 - copied unchanged from r261411, head/sys/arm/conf/COLIBRI-VF50 stable/10/sys/arm/freescale/vybrid/vf_dcu4.c - copied unchanged from r261413, head/sys/arm/freescale/vybrid/vf_dcu4.c stable/10/sys/arm/freescale/vybrid/vf_tcon.c - copied, changed from r261413, head/sys/arm/freescale/vybrid/vf_tcon.c stable/10/sys/boot/fdt/dts/vybrid-colibri-vf50.dts - copied unchanged from r261411, head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts Modified: stable/10/sys/arm/conf/VYBRID.common stable/10/sys/arm/freescale/vybrid/files.vybrid stable/10/sys/arm/freescale/vybrid/vf_common.h Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/conf/COLIBRI-VF50 (from r261411, head/sys/arm/conf/COLIBRI-VF50) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/COLIBRI-VF50 Thu May 15 16:23:24 2014 (r266155, copy of r261411, head/sys/arm/conf/COLIBRI-VF50) @@ -0,0 +1,26 @@ +# Kernel configuration for Toradex Colibri VF50 Evaluation Board. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "VYBRID.common" +ident COLIBRI-VF50 + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=vybrid-colibri-vf50.dts Modified: stable/10/sys/arm/conf/VYBRID.common ============================================================================== --- stable/10/sys/arm/conf/VYBRID.common Thu May 15 16:22:09 2014 (r266154) +++ stable/10/sys/arm/conf/VYBRID.common Thu May 15 16:23:24 2014 (r266155) @@ -137,3 +137,10 @@ device axe # ASIX Electronics USB Eth device bpf # Berkeley packet filter device sound + +# Framebuffer +device vt +device kbdmux +options SC_DFLT_FONT # compile font in +makeoptions SC_DFLT_FONT=cp437 +device ukbd Modified: stable/10/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- stable/10/sys/arm/freescale/vybrid/files.vybrid Thu May 15 16:22:09 2014 (r266154) +++ stable/10/sys/arm/freescale/vybrid/files.vybrid Thu May 15 16:23:24 2014 (r266155) @@ -21,6 +21,8 @@ arm/freescale/vybrid/vf_anadig.c standa arm/freescale/vybrid/vf_iomuxc.c standard arm/freescale/vybrid/vf_mscm.c standard arm/freescale/vybrid/vf_src.c standard +arm/freescale/vybrid/vf_tcon.c optional vt +arm/freescale/vybrid/vf_dcu4.c optional vt arm/freescale/vybrid/vf_nfc.c optional nand arm/freescale/vybrid/vf_ehci.c optional ehci arm/freescale/vybrid/vf_gpio.c optional gpio Modified: stable/10/sys/arm/freescale/vybrid/vf_common.h ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_common.h Thu May 15 16:22:09 2014 (r266154) +++ stable/10/sys/arm/freescale/vybrid/vf_common.h Thu May 15 16:23:24 2014 (r266155) @@ -38,3 +38,5 @@ bus_space_read_1(_sc->bst, _sc->bsh, _reg) #define WRITE1(_sc, _reg, _val) \ bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) + +uint32_t tcon_bypass(void); Copied: stable/10/sys/arm/freescale/vybrid/vf_dcu4.c (from r261413, head/sys/arm/freescale/vybrid/vf_dcu4.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/vybrid/vf_dcu4.c Thu May 15 16:23:24 2014 (r266155, copy of r261413, head/sys/arm/freescale/vybrid/vf_dcu4.c) @@ -0,0 +1,359 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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. + */ + +/* + * Vybrid Family Display Control Unit (DCU4) + * Chapter 55, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "fb_if.h" + +#include + +#define DCU_CTRLDESCCURSOR1 0x000 /* Control Descriptor Cursor 1 */ +#define DCU_CTRLDESCCURSOR2 0x004 /* Control Descriptor Cursor 2 */ +#define DCU_CTRLDESCCURSOR3 0x008 /* Control Descriptor Cursor 3 */ +#define DCU_CTRLDESCCURSOR4 0x00C /* Control Descriptor Cursor 4 */ +#define DCU_DCU_MODE 0x010 /* DCU4 Mode */ +#define DCU_MODE_M 0x3 +#define DCU_MODE_S 0 +#define DCU_MODE_NORMAL 0x1 +#define DCU_MODE_TEST 0x2 +#define DCU_MODE_COLBAR 0x3 +#define RASTER_EN (1 << 14) /* Raster scan of pixel data */ +#define DCU_BGND 0x014 /* Background */ +#define DCU_DISP_SIZE 0x018 /* Display Size */ +#define DELTA_M 0x7ff +#define DELTA_Y_S 16 +#define DELTA_X_S 0 +#define DCU_HSYN_PARA 0x01C /* Horizontal Sync Parameter */ +#define BP_H_SHIFT 22 +#define PW_H_SHIFT 11 +#define FP_H_SHIFT 0 +#define DCU_VSYN_PARA 0x020 /* Vertical Sync Parameter */ +#define BP_V_SHIFT 22 +#define PW_V_SHIFT 11 +#define FP_V_SHIFT 0 +#define DCU_SYNPOL 0x024 /* Synchronize Polarity */ +#define INV_HS (1 << 0) +#define INV_VS (1 << 1) +#define DCU_THRESHOLD 0x028 /* Threshold */ +#define LS_BF_VS_SHIFT 16 +#define OUT_BUF_HIGH_SHIFT 8 +#define OUT_BUF_LOW_SHIFT 0 +#define DCU_INT_STATUS 0x02C /* Interrupt Status */ +#define DCU_INT_MASK 0x030 /* Interrupt Mask */ +#define DCU_COLBAR_1 0x034 /* COLBAR_1 */ +#define DCU_COLBAR_2 0x038 /* COLBAR_2 */ +#define DCU_COLBAR_3 0x03C /* COLBAR_3 */ +#define DCU_COLBAR_4 0x040 /* COLBAR_4 */ +#define DCU_COLBAR_5 0x044 /* COLBAR_5 */ +#define DCU_COLBAR_6 0x048 /* COLBAR_6 */ +#define DCU_COLBAR_7 0x04C /* COLBAR_7 */ +#define DCU_COLBAR_8 0x050 /* COLBAR_8 */ +#define DCU_DIV_RATIO 0x054 /* Divide Ratio */ +#define DCU_SIGN_CALC_1 0x058 /* Sign Calculation 1 */ +#define DCU_SIGN_CALC_2 0x05C /* Sign Calculation 2 */ +#define DCU_CRC_VAL 0x060 /* CRC Value */ +#define DCU_PDI_STATUS 0x064 /* PDI Status */ +#define DCU_PDI_STA_MSK 0x068 /* PDI Status Mask */ +#define DCU_PARR_ERR_STATUS1 0x06C /* Parameter Error Status 1 */ +#define DCU_PARR_ERR_STATUS2 0x070 /* Parameter Error Status 2 */ +#define DCU_PARR_ERR_STATUS3 0x07C /* Parameter Error Status 3 */ +#define DCU_MASK_PARR_ERR_ST1 0x080 /* Mask Parameter Error Status 1 */ +#define DCU_MASK_PARR_ERR_ST2 0x084 /* Mask Parameter Error Status 2 */ +#define DCU_MASK_PARR_ERR_ST3 0x090 /* Mask Parameter Error Status 3 */ +#define DCU_THRESHOLD_INP_BUF_1 0x094 /* Threshold Input 1 */ +#define DCU_THRESHOLD_INP_BUF_2 0x098 /* Threshold Input 2 */ +#define DCU_THRESHOLD_INP_BUF_3 0x09C /* Threshold Input 3 */ +#define DCU_LUMA_COMP 0x0A0 /* LUMA Component */ +#define DCU_CHROMA_RED 0x0A4 /* Red Chroma Components */ +#define DCU_CHROMA_GREEN 0x0A8 /* Green Chroma Components */ +#define DCU_CHROMA_BLUE 0x0AC /* Blue Chroma Components */ +#define DCU_CRC_POS 0x0B0 /* CRC Position */ +#define DCU_LYR_INTPOL_EN 0x0B4 /* Layer Interpolation Enable */ +#define DCU_LYR_LUMA_COMP 0x0B8 /* Layer Luminance Component */ +#define DCU_LYR_CHRM_RED 0x0BC /* Layer Chroma Red */ +#define DCU_LYR_CHRM_GRN 0x0C0 /* Layer Chroma Green */ +#define DCU_LYR_CHRM_BLUE 0x0C4 /* Layer Chroma Blue */ +#define DCU_COMP_IMSIZE 0x0C8 /* Compression Image Size */ +#define DCU_UPDATE_MODE 0x0CC /* Update Mode */ +#define READREG (1 << 30) +#define MODE (1 << 31) +#define DCU_UNDERRUN 0x0D0 /* Underrun */ +#define DCU_GLBL_PROTECT 0x100 /* Global Protection */ +#define DCU_SFT_LCK_BIT_L0 0x104 /* Soft Lock Bit Layer 0 */ +#define DCU_SFT_LCK_BIT_L1 0x108 /* Soft Lock Bit Layer 1 */ +#define DCU_SFT_LCK_DISP_SIZE 0x10C /* Soft Lock Display Size */ +#define DCU_SFT_LCK_HS_VS_PARA 0x110 /* Soft Lock Hsync/Vsync Parameter */ +#define DCU_SFT_LCK_POL 0x114 /* Soft Lock POL */ +#define DCU_SFT_LCK_L0_TRANSP 0x118 /* Soft Lock L0 Transparency */ +#define DCU_SFT_LCK_L1_TRANSP 0x11C /* Soft Lock L1 Transparency */ + +/* Control Descriptor */ +#define DCU_CTRLDESCL(n, m) 0x200 + (0x40 * n) + 0x4 * (m - 1) +#define DCU_CTRLDESCLn_1(n) DCU_CTRLDESCL(n, 1) +#define DCU_CTRLDESCLn_2(n) DCU_CTRLDESCL(n, 2) +#define DCU_CTRLDESCLn_3(n) DCU_CTRLDESCL(n, 3) +#define TRANS_SHIFT 20 +#define DCU_CTRLDESCLn_4(n) DCU_CTRLDESCL(n, 4) +#define BPP_MASK 0xf /* Bit per pixel Mask */ +#define BPP_SHIFT 16 /* Bit per pixel Shift */ +#define BPP24 0x5 +#define EN_LAYER (1 << 31) /* Enable the layer */ +#define DCU_CTRLDESCLn_5(n) DCU_CTRLDESCL(n, 5) +#define DCU_CTRLDESCLn_6(n) DCU_CTRLDESCL(n, 6) +#define DCU_CTRLDESCLn_7(n) DCU_CTRLDESCL(n, 7) +#define DCU_CTRLDESCLn_8(n) DCU_CTRLDESCL(n, 8) +#define DCU_CTRLDESCLn_9(n) DCU_CTRLDESCL(n, 9) + +#define DISPLAY_WIDTH 480 +#define DISPLAY_HEIGHT 272 + +struct dcu_softc { + struct resource *res[2]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *ih; + device_t dev; + device_t sc_fbd; /* fbd child */ + struct fb_info sc_info; +}; + +static struct resource_spec dcu_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +dcu_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-dcu4")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family Display Control Unit (DCU4)"); + return (BUS_PROBE_DEFAULT); +} + +static void +dcu_intr(void *arg) +{ + struct dcu_softc *sc; + int reg; + + sc = arg; + + /* Ack interrupts */ + reg = READ4(sc, DCU_INT_STATUS); + WRITE4(sc, DCU_INT_STATUS, reg); + + /* TODO interrupt handler */ +} + +static int +dcu_init(struct dcu_softc *sc) +{ + int reg; + + /* Configure DCU */ + reg = ((sc->sc_info.fb_height) << DELTA_Y_S); + reg |= (sc->sc_info.fb_width / 16); + WRITE4(sc, DCU_DISP_SIZE, reg); + + /* TODO: export panel info to FDT */ + + reg = (2 << BP_H_SHIFT); + reg |= (41 << PW_H_SHIFT); + reg |= (2 << FP_H_SHIFT); + WRITE4(sc, DCU_HSYN_PARA, reg); + + reg = (2 << BP_V_SHIFT); + reg |= (10 << PW_V_SHIFT); + reg |= (2 << FP_V_SHIFT); + WRITE4(sc, DCU_VSYN_PARA, reg); + + WRITE4(sc, DCU_BGND, 0); + WRITE4(sc, DCU_DIV_RATIO, 30); + + reg = (INV_VS | INV_HS); + WRITE4(sc, DCU_SYNPOL, reg); + + reg = (0x3 << LS_BF_VS_SHIFT); + reg |= (0x78 << OUT_BUF_HIGH_SHIFT); + reg |= (0 << OUT_BUF_LOW_SHIFT); + WRITE4(sc, DCU_THRESHOLD, reg); + + /* Mask all the interrupts */ + WRITE4(sc, DCU_INT_MASK, 0xffffffff); + + /* Setup first layer */ + reg = (sc->sc_info.fb_width | (sc->sc_info.fb_height << 16)); + WRITE4(sc, DCU_CTRLDESCLn_1(0), reg); + WRITE4(sc, DCU_CTRLDESCLn_2(0), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_3(0), sc->sc_info.fb_pbase); + reg = (BPP24 << BPP_SHIFT); + reg |= EN_LAYER; + reg |= (0xFF << TRANS_SHIFT); /* completely opaque */ + WRITE4(sc, DCU_CTRLDESCLn_4(0), reg); + WRITE4(sc, DCU_CTRLDESCLn_5(0), 0xffffff); + WRITE4(sc, DCU_CTRLDESCLn_6(0), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_7(0), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_8(0), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_9(0), 0x0); + + /* Enable DCU in normal mode */ + reg = READ4(sc, DCU_DCU_MODE); + reg &= ~(DCU_MODE_M << DCU_MODE_S); + reg |= (DCU_MODE_NORMAL << DCU_MODE_S); + reg |= (RASTER_EN); + WRITE4(sc, DCU_DCU_MODE, reg); + WRITE4(sc, DCU_UPDATE_MODE, READREG); + + return (0); +} + +static int +dcu_attach(device_t dev) +{ + struct dcu_softc *sc; + int err; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, dcu_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, dcu_intr, sc, &sc->ih); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + /* Bypass timing control (used for raw lcd panels) */ + tcon_bypass(); + + sc->sc_info.fb_width = DISPLAY_WIDTH; + sc->sc_info.fb_height = DISPLAY_HEIGHT; + sc->sc_info.fb_stride = sc->sc_info.fb_width * 3; + sc->sc_info.fb_bpp = sc->sc_info.fb_depth = 24; + sc->sc_info.fb_size = sc->sc_info.fb_height * sc->sc_info.fb_stride; + sc->sc_info.fb_vbase = (intptr_t)contigmalloc(sc->sc_info.fb_size, + M_DEVBUF, M_ZERO, 0, ~0, PAGE_SIZE, 0); + sc->sc_info.fb_pbase = (intptr_t)vtophys(sc->sc_info.fb_vbase); + +#if 0 + printf("%dx%d [%d]\n", sc->sc_info.fb_width, sc->sc_info.fb_height, + sc->sc_info.fb_stride); + printf("pbase == 0x%08x\n", sc->sc_info.fb_pbase); +#endif + + memset((int8_t *)sc->sc_info.fb_vbase, 0x0, sc->sc_info.fb_size); + + dcu_init(sc); + + sc->sc_info.fb_name = device_get_nameunit(dev); + + /* Ask newbus to attach framebuffer device to me. */ + sc->sc_fbd = device_add_child(dev, "fbd", device_get_unit(dev)); + if (sc->sc_fbd == NULL) + device_printf(dev, "Can't attach fbd device\n"); + + if (device_probe_and_attach(sc->sc_fbd) != 0) { + device_printf(sc->dev, "Failed to attach fbd device\n"); + } + + return (0); +} + +static struct fb_info * +dcu4_fb_getinfo(device_t dev) +{ + struct dcu_softc *sc = device_get_softc(dev); + + return (&sc->sc_info); +} + +static device_method_t dcu_methods[] = { + DEVMETHOD(device_probe, dcu_probe), + DEVMETHOD(device_attach, dcu_attach), + + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, dcu4_fb_getinfo), + { 0, 0 } +}; + +static driver_t dcu_driver = { + "fb", + dcu_methods, + sizeof(struct dcu_softc), +}; + +static devclass_t dcu_devclass; + +DRIVER_MODULE(fb, simplebus, dcu_driver, dcu_devclass, 0, 0); Copied and modified: stable/10/sys/arm/freescale/vybrid/vf_tcon.c (from r261413, head/sys/arm/freescale/vybrid/vf_tcon.c) ============================================================================== --- head/sys/arm/freescale/vybrid/vf_tcon.c Sun Feb 2 20:25:27 2014 (r261413, copy source) +++ stable/10/sys/arm/freescale/vybrid/vf_tcon.c Thu May 15 16:23:24 2014 (r266155) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #define TCON0_CTRL1 0x00 +#define TCON_BYPASS (1 << 29) struct tcon_softc { struct resource *res[1]; @@ -80,7 +81,7 @@ tcon_bypass(void) sc = tcon_sc; - WRITE4(tcon_sc, TCON0_CTRL1, (1 << 29)); + WRITE4(tcon_sc, TCON0_CTRL1, TCON_BYPASS); return (0); } Copied: stable/10/sys/boot/fdt/dts/vybrid-colibri-vf50.dts (from r261411, head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/vybrid-colibri-vf50.dts Thu May 15 16:23:24 2014 (r266155, copy of r261411, head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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$ + */ + +/dts-v1/; + +/include/ "vybrid.dtsi" + +/ { + model = "Toradex Colibri VF50"; + + memory { + device_type = "memory"; + reg = < 0x80000000 0x08000000 >; /* 128MB RAM */ + }; + + SOC: vybrid { + serial0: serial@40027000 { + status = "okay"; + }; + + fec1: ethernet@400D1000 { + status = "okay"; + iomux_config = < 54 0x1 55 0x1 + 56 0x1 57 0x1 + 58 0x1 59 0x1 + 60 0x1 61 0x1 + 62 0x1 0 0x1 >; + }; + + sai3: sai@40032000 { + status = "okay"; + }; + + adc0: adc@4003B000 { + status = "okay"; + }; + + edma1: edma@40098000 { + status = "okay"; + }; + }; + + chosen { + bootargs = "-v"; + stdin = "serial0"; + stdout = "serial0"; + }; +}; From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 16:59:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 19270EDD; Thu, 15 May 2014 16:59: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 EECA72BF7; Thu, 15 May 2014 16:59: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 s4FGxoj9091412; Thu, 15 May 2014 16:59:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FGxmqA091398; Thu, 15 May 2014 16:59:48 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151659.s4FGxmqA091398@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 16:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266159 - in stable/10/sys/arm: arm include ti X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 16:59:51 -0000 Author: ian Date: Thu May 15 16:59:47 2014 New Revision: 266159 URL: http://svnweb.freebsd.org/changeset/base/266159 Log: MFC r261414, r261415, r261417, r261418, r261419 Don't call device_set_ivars() for the mmchs Change the way pcpu and curthread are stored per-core Invalidate cachelines for bounce pages on PREREAD too, there may still be stale entries from a previous transfer. Only use the CPU ID register if SMP is defined. Some non-MPCore armv6 cpu, such as the one found in the RPi, don't have it, and just hang when we try to access it. Modified: stable/10/sys/arm/arm/bcopyinout.S stable/10/sys/arm/arm/bcopyinout_xscale.S stable/10/sys/arm/arm/busdma_machdep-v6.c stable/10/sys/arm/arm/copystr.S stable/10/sys/arm/arm/fusu.S stable/10/sys/arm/arm/genassym.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/mp_machdep.c stable/10/sys/arm/arm/swtch.S stable/10/sys/arm/arm/vfp.c stable/10/sys/arm/include/asmacros.h stable/10/sys/arm/include/pcpu.h stable/10/sys/arm/ti/ti_mmchs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/bcopyinout.S ============================================================================== --- stable/10/sys/arm/arm/bcopyinout.S Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/arm/bcopyinout.S Thu May 15 16:59:47 2014 (r266159) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ - add tmp, tmp, #(PC_CURPCB) + add tmp, tmp, #(TD_PCB) #else .Lcurpcb: .word _C_LABEL(__pcpu) + PC_CURPCB Modified: stable/10/sys/arm/arm/bcopyinout_xscale.S ============================================================================== --- stable/10/sys/arm/arm/bcopyinout_xscale.S Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/arm/bcopyinout_xscale.S Thu May 15 16:59:47 2014 (r266159) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ - add tmp, tmp, #(PC_CURPCB) + add tmp, tmp, #(TD_PCB) #else .Lcurpcb: .word _C_LABEL(__pcpu) + PC_CURPCB Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep-v6.c Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/arm/busdma_machdep-v6.c Thu May 15 16:59:47 2014 (r266159) @@ -1220,6 +1220,17 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus dmat->bounce_zone->total_bounced++; } + if (op & BUS_DMASYNC_PREREAD) { + bpage = STAILQ_FIRST(&map->bpages); + while (bpage != NULL) { + cpu_dcache_inv_range((vm_offset_t)bpage->vaddr, + bpage->datacount); + l2cache_inv_range((vm_offset_t)bpage->vaddr, + (vm_offset_t)bpage->busaddr, + bpage->datacount); + bpage = STAILQ_NEXT(bpage, links); + } + } if (op & BUS_DMASYNC_POSTREAD) { while (bpage != NULL) { vm_offset_t startv; Modified: stable/10/sys/arm/arm/copystr.S ============================================================================== --- stable/10/sys/arm/arm/copystr.S Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/arm/copystr.S Thu May 15 16:59:47 2014 (r266159) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ - add tmp, tmp, #(PC_CURPCB) + add tmp, tmp, #(TD_PCB) #else .Lpcb: .word _C_LABEL(__pcpu) + PC_CURPCB Modified: stable/10/sys/arm/arm/fusu.S ============================================================================== --- stable/10/sys/arm/arm/fusu.S Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/arm/fusu.S Thu May 15 16:59:47 2014 (r266159) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ - add tmp, tmp, #(PC_CURPCB) + add tmp, tmp, #(TD_PCB) #else .Lcurpcb: .word _C_LABEL(__pcpu) + PC_CURPCB Modified: stable/10/sys/arm/arm/genassym.c ============================================================================== --- stable/10/sys/arm/arm/genassym.c Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/arm/genassym.c Thu May 15 16:59:47 2014 (r266159) @@ -140,3 +140,4 @@ ASSYM(TRAPFRAMESIZE, sizeof(struct trapf ASSYM(MAXCOMLEN, MAXCOMLEN); ASSYM(NIRQ, NIRQ); +ASSYM(PCPU_SIZE, sizeof(struct pcpu)); Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/arm/machdep.c Thu May 15 16:59:47 2014 (r266159) @@ -874,7 +874,7 @@ void pcpu0_init(void) { #if ARM_ARCH_6 || ARM_ARCH_7A || defined(CPU_MV_PJ4B) - set_pcpu(pcpup); + set_curthread(&thread0); #endif pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); Modified: stable/10/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/10/sys/arm/arm/mp_machdep.c Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/arm/mp_machdep.c Thu May 15 16:59:47 2014 (r266159) @@ -177,7 +177,6 @@ init_secondary(int cpu) cpu_tlb_flushID(); pc = &__pcpu[cpu]; - set_pcpu(pc); /* * pcpu_init() updates queue, so it should not be executed in parallel @@ -203,6 +202,7 @@ init_secondary(int cpu) KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread")); pc->pc_curthread = pc->pc_idlethread; pc->pc_curpcb = pc->pc_idlethread->td_pcb; + set_curthread(pc->pc_idlethread); #ifdef VFP pc->pc_cpu = cpu; Modified: stable/10/sys/arm/arm/swtch.S ============================================================================== --- stable/10/sys/arm/arm/swtch.S Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/arm/swtch.S Thu May 15 16:59:47 2014 (r266159) @@ -88,17 +88,23 @@ __FBSDID("$FreeBSD$"); #define DOMAIN_CLIENT 0x01 -#ifdef _ARM_ARCH_6 -#define GET_PCPU(tmp) \ - mrc p15, 0, tmp, c13, c0, 4; +#if defined(_ARM_ARCH_6) && defined(SMP) +#define GET_PCPU(tmp, tmp2) \ + mrc p15, 0, tmp, c0, c0, 5; \ + and tmp, tmp, #0xf; \ + ldr tmp2, .Lcurpcpu+4; \ + mul tmp, tmp, tmp2; \ + ldr tmp2, .Lcurpcpu; \ + add tmp, tmp, tmp2; #else -.Lcurpcpu: - .word _C_LABEL(__pcpu) -#define GET_PCPU(tmp) \ +#define GET_PCPU(tmp, tmp2) \ ldr tmp, .Lcurpcpu #endif +.Lcurpcpu: + .word _C_LABEL(__pcpu) + .word PCPU_SIZE .Lcpufuncs: .word _C_LABEL(cpufuncs) .Lblocked_lock: @@ -112,7 +118,7 @@ ENTRY(cpu_throw) * r5 = newtd */ - GET_PCPU(r7) + GET_PCPU(r7, r9) #ifdef VFP /* @@ -191,10 +197,15 @@ ENTRY(cpu_throw) ldr r13, [r7, #(PCB_SP)] #endif + GET_PCPU(r6, r4) + /* Hook in a new pcb */ + str r7, [r6, #PC_CURPCB] /* We have a new curthread now so make a note it */ - GET_CURTHREAD_PTR(r6) + add r6, r6, #PC_CURTHREAD str r5, [r6] - +#ifndef ARM_TP_ADDRESS + mcr p15, 0, r5, c13, c0, 4 +#endif /* Set the new tp */ ldr r6, [r5, #(TD_MD + MD_TP)] #ifdef ARM_TP_ADDRESS @@ -207,9 +218,6 @@ ENTRY(cpu_throw) #else mcr p15, 0, r6, c13, c0, 3 #endif - /* Hook in a new pcb */ - GET_PCPU(r6) - str r7, [r6, #PC_CURPCB] add sp, sp, #4; ldmfd sp!, {r4-r7, pc} @@ -231,11 +239,13 @@ ENTRY(cpu_switch) /* Process is now on a processor. */ /* We have a new curthread now so make a note it */ - GET_CURTHREAD_PTR(r7) - str r1, [r7] + GET_PCPU(r7, r2) + str r1, [r7, #PC_CURTHREAD] +#ifndef ARM_TP_ADDRESS + mcr p15, 0, r1, c13, c0, 4 +#endif /* Hook in a new pcb */ - GET_PCPU(r7) ldr r2, [r1, #TD_PCB] str r2, [r7, #PC_CURPCB] @@ -315,7 +325,7 @@ ENTRY(cpu_switch) * a future exception will bounce the backup settings in the fp unit. * XXX vfp_store can't change r4 */ - GET_PCPU(r7) + GET_PCPU(r7, r8) ldr r8, [r7, #(PC_VFPCTHREAD)] cmp r4, r8 /* old thread used vfp? */ bne 1f /* no, don't save */ @@ -440,7 +450,6 @@ ENTRY(cpu_switch) #if defined(SCHED_ULE) && defined(SMP) ldr r6, .Lblocked_lock GET_CURTHREAD_PTR(r3) - 1: ldr r4, [r3, #TD_LOCK] cmp r4, r6 @@ -516,7 +525,7 @@ ENTRY(savectx) * registers and state, and modify the control as needed. * a future exception will bounce the backup settings in the fp unit. */ - GET_PCPU(r7) + GET_PCPU(r7, r4) ldr r4, [r7, #(PC_VFPCTHREAD)] /* vfp thread */ ldr r2, [r7, #(PC_CURTHREAD)] /* current thread */ cmp r4, r2 Modified: stable/10/sys/arm/arm/vfp.c ============================================================================== --- stable/10/sys/arm/arm/vfp.c Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/arm/vfp.c Thu May 15 16:59:47 2014 (r266159) @@ -140,9 +140,11 @@ vfp_bounce(u_int addr, u_int insn, struc u_int fpexc; struct pcb *curpcb; struct thread *vfptd; + int i; if (!vfp_exists) return 1; /* vfp does not exist */ + i = disable_interrupts(I32_bit|F32_bit); fpexc = fmrx(VFPEXC); /* read the vfp exception reg */ if (fpexc & VFPEXC_EN) { vfptd = PCPU_GET(vfpcthread); @@ -164,6 +166,7 @@ vfp_bounce(u_int addr, u_int insn, struc fmxr(VFPEXC, fpexc); /* turn vfp hardware off */ if (vfptd == curthread) { /* kill the process - we do not handle emulation */ + restore_interrupts(i); killproc(curthread->td_proc, "vfp emulation"); return 1; } @@ -173,7 +176,7 @@ vfp_bounce(u_int addr, u_int insn, struc } fpexc |= VFPEXC_EN; fmxr(VFPEXC, fpexc); /* enable the vfp and repeat command */ - curpcb = PCPU_GET(curpcb); + curpcb = curthread->td_pcb; /* If we were the last process to use the VFP, the process did not * use a VFP on another processor, then the registers in the VFP * will still be ours and are current. Eventually, we will make the @@ -183,7 +186,8 @@ vfp_bounce(u_int addr, u_int insn, struc #ifdef SMP curpcb->pcb_vfpcpu = PCPU_GET(cpu); #endif - PCPU_SET(vfpcthread, PCPU_GET(curthread)); + PCPU_SET(vfpcthread, curthread); + restore_interrupts(i); return 0; } @@ -218,7 +222,6 @@ vfp_restore(struct vfp_state *vfpsave) "ldr %0, [%1]\n" /* set old vfpscr */ "mcr p10, 7, %0, cr1, c0, 0\n" : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); - PCPU_SET(vfpcthread, PCPU_GET(curthread)); } } @@ -237,7 +240,7 @@ vfp_store(struct vfp_state *vfpsave) u_int tmp, vfpscr = 0; tmp = fmrx(VFPEXC); /* Is the vfp enabled? */ - if (vfpsave && tmp & VFPEXC_EN) { + if (vfpsave && (tmp & VFPEXC_EN)) { __asm __volatile("stc p11, c0, [%1], #128\n" /* d0-d15 */ "cmp %2, #0\n" /* -D16 or -D32? */ stclne" p11, c0, [%1], #128\n" /* d16-d31 */ @@ -265,6 +268,12 @@ vfp_discard() { u_int tmp = 0; + /* + * No need to protect the access to vfpcthread by disabling + * interrupts, since it's called from cpu_throw(), who is called + * with interrupts disabled. + */ + PCPU_SET(vfpcthread, 0); /* permanent forget about reg */ tmp = fmrx(VFPEXC); tmp &= ~VFPEXC_EN; /* turn off VFP hardware */ Modified: stable/10/sys/arm/include/asmacros.h ============================================================================== --- stable/10/sys/arm/include/asmacros.h Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/include/asmacros.h Thu May 15 16:59:47 2014 (r266159) @@ -241,15 +241,15 @@ name: #ifdef _ARM_ARCH_6 #define AST_LOCALS #define GET_CURTHREAD_PTR(tmp) \ - mrc p15, 0, tmp, c13, c0, 4; \ - add tmp, tmp, #(PC_CURTHREAD) + mrc p15, 0, tmp, c13, c0, 4 #else #define AST_LOCALS ;\ .Lcurthread: ;\ .word _C_LABEL(__pcpu) + PC_CURTHREAD #define GET_CURTHREAD_PTR(tmp) \ - ldr tmp, .Lcurthread + ldr tmp, .Lcurthread; \ + ldr tmp, [tmp] #endif #define DO_AST \ @@ -262,7 +262,6 @@ name: bne 2f /* Nope, get out now */ ;\ bic r4, r4, #(I32_bit|F32_bit) ;\ 1: GET_CURTHREAD_PTR(r5) ;\ - ldr r5, [r5] ;\ ldr r1, [r5, #(TD_FLAGS)] ;\ and r1, r1, #(TDF_ASTPENDING|TDF_NEEDRESCHED) ;\ teq r1, #0x00000000 ;\ Modified: stable/10/sys/arm/include/pcpu.h ============================================================================== --- stable/10/sys/arm/include/pcpu.h Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/include/pcpu.h Thu May 15 16:59:47 2014 (r266159) @@ -62,22 +62,36 @@ struct pcpu; extern struct pcpu *pcpup; #if ARM_ARCH_6 || ARM_ARCH_7A /* or ARM_TP_ADDRESS mark REMOVE ME NOTE */ -static inline struct pcpu * -get_pcpu(void) + +#define CPU_MASK (0xf) + +#ifndef SMP +#define get_pcpu() (pcpup) +#else +#define get_pcpu() __extension__ ({ \ + int id; \ + __asm __volatile("mrc p15, 0, %0, c0, c0, 5" : "=r" (id)); \ + (pcpup + (id & CPU_MASK)); \ + }) +#endif + +static inline struct thread * +get_curthread(void) { - void *pcpu; + void *ret; - __asm __volatile("mrc p15, 0, %0, c13, c0, 4" : "=r" (pcpu)); - return (pcpu); + __asm __volatile("mrc p15, 0, %0, c13, c0, 4" : "=r" (ret)); + return (ret); } static inline void -set_pcpu(void *pcpu) +set_curthread(struct thread *td) { - __asm __volatile("mcr p15, 0, %0, c13, c0, 4" : : "r" (pcpu)); + __asm __volatile("mcr p15, 0, %0, c13, c0, 4" : : "r" (td)); } + static inline void * get_tls(void) { @@ -93,6 +107,9 @@ set_tls(void *tls) __asm __volatile("mcr p15, 0, %0, c13, c0, 3" : : "r" (tls)); } + +#define curthread get_curthread() + #else #define get_pcpu() pcpup #endif Modified: stable/10/sys/arm/ti/ti_mmchs.c ============================================================================== --- stable/10/sys/arm/ti/ti_mmchs.c Thu May 15 16:51:45 2014 (r266158) +++ stable/10/sys/arm/ti/ti_mmchs.c Thu May 15 16:59:47 2014 (r266159) @@ -1755,7 +1755,6 @@ ti_mmchs_attach(device_t dev) device_add_child(dev, "mmc", 0); - device_set_ivars(dev, &sc->host); err = bus_generic_attach(dev); out: From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 17:30:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EFAC3794; Thu, 15 May 2014 17:30: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 D8AFC2EEC; Thu, 15 May 2014 17:30: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 s4FHULME005759; Thu, 15 May 2014 17:30:21 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FHUGw3005353; Thu, 15 May 2014 17:30:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151730.s4FHUGw3005353@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 17:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266160 - in stable/10/sys: arm/arm arm/at91 arm/broadcom/bcm2835 arm/econa arm/freescale/imx arm/include arm/mv arm/s3c2xx0 arm/xscale/ixp425 conf dev/fdt dev/mmc dev/ofw dev/powermac_... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 17:30:22 -0000 Author: ian Date: Thu May 15 17:30:16 2014 New Revision: 266160 URL: http://svnweb.freebsd.org/changeset/base/266160 Log: MFC r261423, r261424, r261516, r261513, r261562, r261563, r261564, r261565, r261596, r261606 Add the imx sdhci controller. Move Open Firmware device root on PowerPC, ARM, and MIPS systems to a sub-node of nexus (ofwbus) rather than direct attach under nexus. This fixes FDT on x86 and will make coexistence with ACPI on ARM systems easier. SPARC is unchanged. Add the missing ')' at end of sentence. Reword it to use a more common idiom. Pass the kernel physical address to initarm through the boot param struct. Make functions only used in vfp.c static, and remove vfp_enable. Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place 32-bit data in r1, not r0. 64-bit data is already packed correctly. Use abp_physaddr for the physical address over KERNPHYSADDR. This helps us remove the need to load the kernel at a fixed address. Remove references to PHYSADDR where it's used only in debugging output. Dynamically generate the page table. This will allow us to detect the physical address we are loaded at to change the mapping. Added: stable/10/sys/dev/ofw/ofwbus.c - copied unchanged from r261513, head/sys/dev/ofw/ofwbus.c Deleted: stable/10/sys/dev/fdt/fdtbus.c stable/10/sys/dev/ofw/ofw_nexus.c stable/10/sys/dev/ofw/ofw_nexus.h Modified: stable/10/sys/arm/arm/elf_trampoline.c stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/nexus.c stable/10/sys/arm/arm/pmap-v6.c stable/10/sys/arm/arm/pmap.c stable/10/sys/arm/arm/support.S stable/10/sys/arm/arm/vfp.c stable/10/sys/arm/arm/vm_machdep.c stable/10/sys/arm/at91/at91_machdep.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c stable/10/sys/arm/econa/econa_machdep.c stable/10/sys/arm/freescale/imx/tzic.c stable/10/sys/arm/include/cpu.h stable/10/sys/arm/include/machdep.h stable/10/sys/arm/mv/mv_localbus.c stable/10/sys/arm/mv/mv_pci.c stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c stable/10/sys/arm/xscale/ixp425/avila_machdep.c stable/10/sys/conf/files stable/10/sys/conf/files.powerpc stable/10/sys/dev/fdt/simplebus.c stable/10/sys/dev/mmc/mmc.c stable/10/sys/dev/powermac_nvram/powermac_nvram.c stable/10/sys/mips/beri/beri_simplebus.c stable/10/sys/mips/mips/nexus.c stable/10/sys/powerpc/mambo/mambo.c stable/10/sys/powerpc/mpc85xx/lbc.c stable/10/sys/powerpc/mpc85xx/pci_mpc85xx.c stable/10/sys/powerpc/ofw/ofw_cpu.c stable/10/sys/powerpc/ofw/openpic_ofw.c stable/10/sys/powerpc/powermac/cpcht.c stable/10/sys/powerpc/powermac/grackle.c stable/10/sys/powerpc/powermac/smu.c stable/10/sys/powerpc/powermac/uninorth.c stable/10/sys/powerpc/powermac/uninorthpci.c stable/10/sys/powerpc/powerpc/nexus.c stable/10/sys/powerpc/pseries/rtas_dev.c stable/10/sys/powerpc/pseries/rtas_pci.c stable/10/sys/powerpc/pseries/vdevice.c stable/10/sys/powerpc/pseries/xics.c stable/10/sys/powerpc/psim/iobus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/elf_trampoline.c ============================================================================== --- stable/10/sys/arm/arm/elf_trampoline.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/arm/elf_trampoline.c Thu May 15 17:30:16 2014 (r266160) @@ -189,7 +189,7 @@ _startC(void) int physaddr = KERNPHYSADDR; int tmp1; unsigned int sp = ((unsigned int)&_end & ~3) + 4; -#if defined(FLASHADDR) && defined(LOADERRAMADDR) +#if defined(FLASHADDR) && defined(PHYSADDR) && defined(LOADERRAMADDR) unsigned int pc; __asm __volatile("mov %0, pc\n" Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/arm/locore.S Thu May 15 17:30:16 2014 (r266160) @@ -153,22 +153,27 @@ Lunmapped: ldr r2, =(KERNVIRTADDR - KERNPHYSADDR) sub r0, r1, r2 - adr r4, mmu_init_table - b 3f - -2: - str r3, [r0, r2] - add r2, r2, #4 - add r3, r3, #(L1_S_SIZE) - adds r1, r1, #-1 - bhi 2b -3: - ldmia r4!, {r1,r2,r3} /* # of sections, VA, PA|attr */ - cmp r1, #0 - adrne r5, 2b - bicne r5, r5, #0xf0000000 - orrne r5, r5, #PHYSADDR - movne pc, r5 + /* + * Map PA == VA + */ + ldr r5, =(PHYSADDR) + mov r1, r5 + mov r2, r5 + /* Map 64MiB, preserved over calls to build_pagetables */ + mov r3, #64 + bl build_pagetables + + /* Create the kernel map to jump to */ + mov r1, r5 + ldr r2, =(KERNBASE) + bl build_pagetables + +#if defined(SOCDEV_PA) && defined(SOCDEV_VA) + /* Create the custom map */ + ldr r1, =SOCDEV_VA + ldr r2, =SOCDEV_PA + bl build_pagetables +#endif #if defined(SMP) orr r0, r0, #2 /* Set TTB shared memory flag */ @@ -216,7 +221,7 @@ mmu_done: ldr pc, .Lvirt_done virt_done: - mov r1, #20 /* loader info size is 20 bytes also second arg */ + mov r1, #24 /* loader info size is 24 bytes also second arg */ subs sp, sp, r1 /* allocate arm_boot_params struct on stack */ bic sp, sp, #7 /* align stack to 8 bytes */ mov r0, sp /* loader info pointer is first arg */ @@ -225,6 +230,8 @@ virt_done: str r8, [r0, #8] /* Store r1 from boot loader */ str ip, [r0, #12] /* store r2 from boot loader */ str fp, [r0, #16] /* store r3 from boot loader */ + ldr r5, =KERNPHYSADDR /* load KERNPHYSADDR as the physical address */ + str r5, [r0, #20] /* store the physical address */ mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ @@ -236,6 +243,40 @@ virt_done: adr r0, .Lmainreturned b _C_LABEL(panic) /* NOTREACHED */ +END(btext) +END(_start) + +/* + * Builds the page table + * r0 - The table base address + * r1 - The physical address (trashed) + * r2 - The virtual address (trashed) + * r3 - The number of 1MiB sections + * r4 - Trashed + * + * Addresses must be 1MiB aligned + */ +build_pagetables: + /* Set the required page attributed */ + ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) +#if defined(SMP) + orr r4, #(L1_SHARED) +#endif + orr r1, r4 + + /* Move the virtual address to the correct bit location */ + lsr r2, #(L1_S_SHIFT - 2) + + mov r4, r3 +1: + str r1, [r0, r2] + add r2, r2, #4 + add r1, r1, #(L1_S_SIZE) + adds r4, r4, #-1 + bhi 1b + + RET + #define MMU_INIT(va,pa,n_sec,attr) \ .word n_sec ; \ .word 4*((va)>>L1_S_SHIFT) ; \ @@ -255,27 +296,7 @@ Lstartup_pagetable: Lstartup_pagetable_secondary: .word temp_pagetable #endif -END(btext) -END(_start) -mmu_init_table: - /* fill all table VA==PA */ - /* map SDRAM VA==PA, WT cacheable */ -#if !defined(SMP) - MMU_INIT(PHYSADDR, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) - /* map VA 0xc0000000..0xc3ffffff to PA */ - MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#if defined(SOCDEV_PA) && defined(SOCDEV_VA) - /* Map in 0x04000000 worth of the SoC's devices for bootstrap debugging */ - MMU_INIT(SOCDEV_VA, SOCDEV_PA, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#endif -#else - MMU_INIT(PHYSADDR, PHYSADDR , 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) - /* map VA 0xc0000000..0xc3ffffff to PA */ - MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) - MMU_INIT(0x48000000, 0x48000000, 1, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) -#endif /* SMP */ - .word 0 /* end of table */ .Lstart: .word _edata .word _ebss Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/arm/machdep.c Thu May 15 17:30:16 2014 (r266160) @@ -788,7 +788,7 @@ makectx(struct trapframe *tf, struct pcb * calling pmap_bootstrap. */ void -arm_dump_avail_init(vm_offset_t ramsize, size_t max) +arm_dump_avail_init(vm_paddr_t physaddr, vm_offset_t ramsize, size_t max) { #ifdef LINUX_BOOT_ABI /* @@ -814,8 +814,8 @@ arm_dump_avail_init(vm_offset_t ramsize, if (max < 4) panic("dump_avail too small\n"); - dump_avail[0] = round_page(PHYSADDR); - dump_avail[1] = trunc_page(PHYSADDR + ramsize); + dump_avail[0] = round_page(physaddr); + dump_avail[1] = trunc_page(physaddr + ramsize); dump_avail[2] = 0; dump_avail[3] = 0; } @@ -901,7 +901,7 @@ linux_parse_boot_param(struct arm_boot_p board_id = abp->abp_r1; walker = (struct arm_lbabi_tag *) - (abp->abp_r2 + KERNVIRTADDR - KERNPHYSADDR); + (abp->abp_r2 + KERNVIRTADDR - abp->abp_physaddr); /* xxx - Need to also look for binary device tree */ if (ATAG_TAG(walker) != ATAG_CORE) @@ -979,7 +979,7 @@ freebsd_parse_boot_param(struct arm_boot ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); #endif - preload_addr_relocate = KERNVIRTADDR - KERNPHYSADDR; + preload_addr_relocate = KERNVIRTADDR - abp->abp_physaddr; return lastaddr; } #endif @@ -1081,15 +1081,15 @@ print_kenv(void) } static void -physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz) +physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz, + vm_offset_t kernload) { int i, j, cnt; - vm_offset_t phys_kernelend, kernload; + vm_offset_t phys_kernelend; uint32_t s, e, sz; struct mem_region *mp, *mp1; - phys_kernelend = KERNPHYSADDR + (virtual_avail - KERNVIRTADDR); - kernload = KERNPHYSADDR; + phys_kernelend = kernload + (virtual_avail - KERNVIRTADDR); /* * Remove kernel physical address range from avail @@ -1327,7 +1327,7 @@ initarm(struct arm_boot_params *abp) /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ alloc_pages((var).pv_va, (np)); \ - (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); + (var).pv_pa = (var).pv_va + (abp->abp_physaddr - KERNVIRTADDR); #define alloc_pages(var, np) \ (var) = freemempos; \ @@ -1348,7 +1348,7 @@ initarm(struct arm_boot_params *abp) L2_TABLE_SIZE_REAL * (i - j); kernel_pt_table[i].pv_pa = kernel_pt_table[i].pv_va - KERNVIRTADDR + - KERNPHYSADDR; + abp->abp_physaddr; } } @@ -1393,7 +1393,7 @@ initarm(struct arm_boot_params *abp) pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; /* Map kernel code and data */ - pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, + pmap_map_chunk(l1pagetable, KERNVIRTADDR, abp->abp_physaddr, (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); @@ -1497,7 +1497,8 @@ initarm(struct arm_boot_params *abp) arm_intrnames_init(); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + arm_dump_avail_init(abp->abp_physaddr, memsize, + sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); @@ -1506,7 +1507,7 @@ initarm(struct arm_boot_params *abp) /* * Prepare map of physical memory regions available to vm subsystem. */ - physmap_init(availmem_regions, availmem_regions_sz); + physmap_init(availmem_regions, availmem_regions_sz, abp->abp_physaddr); init_param2(physmem); kdb_init(); Modified: stable/10/sys/arm/arm/nexus.c ============================================================================== --- stable/10/sys/arm/arm/nexus.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/arm/nexus.c Thu May 15 17:30:16 2014 (r266160) @@ -63,11 +63,11 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" #ifdef FDT -#include #include #include #include "ofw_bus_if.h" -#else +#endif + static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { @@ -84,7 +84,6 @@ static int nexus_print_child(device_t, d static device_t nexus_add_child(device_t, u_int, const char *, int); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); -#endif static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, @@ -102,7 +101,6 @@ static int nexus_ofw_map_intr(device_t d #endif static device_method_t nexus_methods[] = { -#ifndef FDT /* Device interface */ DEVMETHOD(device_probe, nexus_probe), DEVMETHOD(device_attach, nexus_attach), @@ -110,7 +108,6 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), -#endif DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), @@ -123,19 +120,13 @@ static device_method_t nexus_methods[] = }; static devclass_t nexus_devclass; -#ifndef FDT static driver_t nexus_driver = { "nexus", nexus_methods, 1 /* no softc */ }; -#else -DEFINE_CLASS_1(nexus, nexus_driver, nexus_methods, - sizeof(struct ofw_nexus_softc), ofw_nexus_driver); -#endif DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); -#ifndef FDT static int nexus_probe(device_t dev) { @@ -235,7 +226,6 @@ nexus_alloc_resource(device_t bus, devic return (rv); } -#endif static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/arm/pmap-v6.c Thu May 15 17:30:16 2014 (r266160) @@ -1312,8 +1312,6 @@ pmap_init(void) vm_size_t s; int i, pv_npg; - PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); - l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), NULL, Modified: stable/10/sys/arm/arm/pmap.c ============================================================================== --- stable/10/sys/arm/arm/pmap.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/arm/pmap.c Thu May 15 17:30:16 2014 (r266160) @@ -1826,8 +1826,6 @@ pmap_init(void) { int shpgperproc = PMAP_SHPGPERPROC; - PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); - l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), NULL, Modified: stable/10/sys/arm/arm/support.S ============================================================================== --- stable/10/sys/arm/arm/support.S Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/arm/support.S Thu May 15 17:30:16 2014 (r266160) @@ -939,7 +939,7 @@ END(memmove) ENTRY(memcpy) /* save leaf functions having to store this away */ /* Do not check arm_memcpy if we're running from flash */ -#ifdef FLASHADDR +#if defined(FLASHADDR) && defined(PHYSADDR) #if FLASHADDR > PHYSADDR ldr r3, =FLASHADDR cmp r3, pc Modified: stable/10/sys/arm/arm/vfp.c ============================================================================== --- stable/10/sys/arm/arm/vfp.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/arm/vfp.c Thu May 15 17:30:16 2014 (r266160) @@ -42,10 +42,9 @@ __FBSDID("$FreeBSD$"); /* function prototypes */ unsigned int get_coprocessorACR(void); -int vfp_bounce(u_int, u_int, struct trapframe *, int); +static int vfp_bounce(u_int, u_int, struct trapframe *, int); +static void vfp_restore(struct vfp_state *); void vfp_discard(void); -void vfp_enable(void); -void vfp_restore(struct vfp_state *); void vfp_store(struct vfp_state *); void set_coprocessorACR(u_int); @@ -134,7 +133,7 @@ SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, v /* start VFP unit, restore the vfp registers from the PCB and retry * the instruction */ -int +static int vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code) { u_int fpexc; @@ -196,7 +195,7 @@ vfp_bounce(u_int addr, u_int insn, struc * Eventually we will use the information that this process was the last * to use the VFP hardware and bypass the restore, just turn on the hardware. */ -void +static void vfp_restore(struct vfp_state *vfpsave) { u_int vfpscr = 0; @@ -280,17 +279,5 @@ vfp_discard() fmxr(VFPEXC, tmp); } -/* Enable the VFP hardware without restoring registers. - * Called when the registers are still in the VFP unit - */ -void -vfp_enable() -{ - u_int tmp = 0; - - tmp = fmrx(VFPEXC); - tmp |= VFPEXC_EN; - fmxr(VFPEXC, tmp); -} #endif Modified: stable/10/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/10/sys/arm/arm/vm_machdep.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/arm/vm_machdep.c Thu May 15 17:30:16 2014 (r266160) @@ -298,15 +298,25 @@ cpu_set_syscall_retval(struct thread *td struct trapframe *frame; int fixup; #ifdef __ARMEB__ - uint32_t insn; + u_int call; #endif frame = td->td_frame; fixup = 0; #ifdef __ARMEB__ - insn = *(u_int32_t *)(frame->tf_pc - INSN_SIZE); - if ((insn & 0x000fffff) == SYS___syscall) { + /* + * __syscall returns an off_t while most other syscalls return an + * int. As an off_t is 64-bits and an int is 32-bits we need to + * place the returned data into r1. As the lseek and frerebsd6_lseek + * syscalls also return an off_t they do not need this fixup. + */ +#ifdef __ARM_EABI__ + call = frame->tf_r7; +#else + call = *(u_int32_t *)(frame->tf_pc - INSN_SIZE) & 0x000fffff; +#endif + if (call == SYS___syscall) { register_t *ap = &frame->tf_r0; register_t code = ap[_QUAD_LOWWORD]; if (td->td_proc->p_sysent->sv_mask) Modified: stable/10/sys/arm/at91/at91_machdep.c ============================================================================== --- stable/10/sys/arm/at91/at91_machdep.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/at91/at91_machdep.c Thu May 15 17:30:16 2014 (r266160) @@ -630,7 +630,8 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + L1_S_SIZE * (KERNEL_PT_KERN_NUM - 1); - arm_dump_avail_init(memsize, sizeof(dump_avail)/sizeof(dump_avail[0])); + arm_dump_avail_init(abp->abp_physaddr, memsize, + sizeof(dump_avail)/sizeof(dump_avail[0])); /* Always use the 256MB of KVA we have available between the kernel and devices */ vm_max_kernel_address = KERNVIRTADDR + (256 << 20); pmap_bootstrap(freemempos, &kernel_l1pt); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c Thu May 15 17:30:16 2014 (r266160) @@ -361,7 +361,7 @@ static driver_t bcm_fb_driver = { sizeof(struct bcmsc_softc), }; -DRIVER_MODULE(bcm2835fb, nexus, bcm_fb_driver, bcm_fb_devclass, 0, 0); +DRIVER_MODULE(bcm2835fb, ofwbus, bcm_fb_driver, bcm_fb_devclass, 0, 0); /* * Video driver routines and glue. Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Thu May 15 17:30:16 2014 (r266160) @@ -315,4 +315,4 @@ static driver_t bcm_fb_driver = { sizeof(struct bcmsc_softc), }; -DRIVER_MODULE(bcm2835fb, nexus, bcm_fb_driver, bcm_fb_devclass, 0, 0); +DRIVER_MODULE(bcm2835fb, ofwbus, bcm_fb_driver, bcm_fb_devclass, 0, 0); Modified: stable/10/sys/arm/econa/econa_machdep.c ============================================================================== --- stable/10/sys/arm/econa/econa_machdep.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/econa/econa_machdep.c Thu May 15 17:30:16 2014 (r266160) @@ -322,7 +322,8 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + L1_S_SIZE * (KERNEL_PT_KERN_NUM - 1); - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + arm_dump_avail_init(abp->abp_physaddr, memsize, + sizeof(dump_avail) / sizeof(dump_avail[0])); vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; pmap_bootstrap(freemempos, &kernel_l1pt); Modified: stable/10/sys/arm/freescale/imx/tzic.c ============================================================================== --- stable/10/sys/arm/freescale/imx/tzic.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/freescale/imx/tzic.c Thu May 15 17:30:16 2014 (r266160) @@ -146,9 +146,9 @@ static devclass_t tzic_devclass; /* * Memory space of controller located outside of device range, so let him to - * attach not only to simplebus, but nexus also. + * attach not only to simplebus, but ofwbus also. */ -EARLY_DRIVER_MODULE(tzic, nexus, tzic_driver, tzic_devclass, 0, 0, +EARLY_DRIVER_MODULE(tzic, ofwbus, tzic_driver, tzic_devclass, 0, 0, BUS_PASS_INTERRUPT); EARLY_DRIVER_MODULE(tzic, simplebus, tzic_driver, tzic_devclass, 0, 0, BUS_PASS_INTERRUPT); Modified: stable/10/sys/arm/include/cpu.h ============================================================================== --- stable/10/sys/arm/include/cpu.h Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/include/cpu.h Thu May 15 17:30:16 2014 (r266160) @@ -41,6 +41,7 @@ struct arm_boot_params { register_t abp_r1; /* r1 from the boot loader */ register_t abp_r2; /* r2 from the boot loader */ register_t abp_r3; /* r3 from the boot loader */ + vm_offset_t abp_physaddr; /* The kernel physical address */ }; void arm_vector_init(vm_offset_t, int); Modified: stable/10/sys/arm/include/machdep.h ============================================================================== --- stable/10/sys/arm/include/machdep.h Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/include/machdep.h Thu May 15 17:30:16 2014 (r266160) @@ -72,6 +72,6 @@ void board_set_serial(uint64_t); void board_set_revision(uint32_t); /* Setup standard arrays */ -void arm_dump_avail_init( vm_offset_t memsize, size_t max); +void arm_dump_avail_init(vm_paddr_t, vm_offset_t, size_t); #endif /* !_MACHINE_MACHDEP_H_ */ Modified: stable/10/sys/arm/mv/mv_localbus.c ============================================================================== --- stable/10/sys/arm/mv/mv_localbus.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/mv/mv_localbus.c Thu May 15 17:30:16 2014 (r266160) @@ -156,7 +156,7 @@ static struct localbus_bank localbus_ban devclass_t localbus_devclass; -DRIVER_MODULE(localbus, nexus, localbus_driver, localbus_devclass, 0, 0); +DRIVER_MODULE(localbus, ofwbus, localbus_driver, localbus_devclass, 0, 0); static int fdt_localbus_reg_decode(phandle_t node, struct localbus_softc *sc, Modified: stable/10/sys/arm/mv/mv_pci.c ============================================================================== --- stable/10/sys/arm/mv/mv_pci.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/mv/mv_pci.c Thu May 15 17:30:16 2014 (r266160) @@ -398,7 +398,7 @@ static driver_t mv_pcib_driver = { devclass_t pcib_devclass; -DRIVER_MODULE(pcib, nexus, mv_pcib_driver, pcib_devclass, 0, 0); +DRIVER_MODULE(pcib, ofwbus, mv_pcib_driver, pcib_devclass, 0, 0); static struct mtx pcicfg_mtx; Modified: stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Thu May 15 17:30:16 2014 (r266160) @@ -384,7 +384,8 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + 0x100000 * (KERNEL_PT_KERN_NUM - 1); - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + arm_dump_avail_init(abp->abp_physaddr, memsize, + sizeof(dump_avail) / sizeof(dump_avail[0])); vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; Modified: stable/10/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/avila_machdep.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/arm/xscale/ixp425/avila_machdep.c Thu May 15 17:30:16 2014 (r266160) @@ -433,7 +433,8 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + arm_dump_avail_init(abp->abp_physaddr, memsize, + sizeof(dump_avail) / sizeof(dump_avail[0])); vm_max_kernel_address = 0xd0000000; pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/conf/files Thu May 15 17:30:16 2014 (r266160) @@ -1407,7 +1407,6 @@ dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "$S/boot/fdt/dts/${FDT_DTS_FILE}" -dev/fdt/fdtbus.c optional fdtbus dev/fdt/simplebus.c optional fdt dev/fe/if_fe.c optional fe dev/fe/if_fe_pccard.c optional fe pccard @@ -1968,7 +1967,7 @@ dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_fdt.c optional fdt dev/ofw/ofw_if.m optional fdt dev/ofw/ofw_iicbus.c optional fdt iicbus -dev/ofw/ofw_nexus.c optional fdt +dev/ofw/ofwbus.c optional fdt dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt dev/patm/if_patm.c optional patm pci Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/conf/files.powerpc Thu May 15 17:30:16 2014 (r266160) @@ -48,7 +48,7 @@ dev/ofw/ofw_bus_subr.c optional aim dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim dev/ofw/ofw_iicbus.c optional iicbus aim -dev/ofw/ofw_nexus.c optional aim | fdt +dev/ofw/ofwbus.c optional aim | fdt dev/ofw/ofw_standard.c optional aim powerpc dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/dev/fdt/simplebus.c Thu May 15 17:30:16 2014 (r266160) @@ -121,7 +121,7 @@ static driver_t simplebus_driver = { sizeof(struct simplebus_softc) }; static devclass_t simplebus_devclass; -DRIVER_MODULE(simplebus, nexus, simplebus_driver, simplebus_devclass, 0, 0); +DRIVER_MODULE(simplebus, ofwbus, simplebus_driver, simplebus_devclass, 0, 0); DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0, 0); static int Modified: stable/10/sys/dev/mmc/mmc.c ============================================================================== --- stable/10/sys/dev/mmc/mmc.c Thu May 15 16:59:47 2014 (r266159) +++ stable/10/sys/dev/mmc/mmc.c Thu May 15 17:30:16 2014 (r266160) @@ -1756,9 +1756,11 @@ static driver_t mmc_driver = { }; static devclass_t mmc_devclass; -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); + Copied: stable/10/sys/dev/ofw/ofwbus.c (from r261513, head/sys/dev/ofw/ofwbus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/ofw/ofwbus.c Thu May 15 17:30:16 2014 (r266160, copy of r261513, head/sys/dev/ofw/ofwbus.c) @@ -0,0 +1,527 @@ +/*- + * Copyright 1998 Massachusetts Institute of Technology + * Copyright 2001 by Thomas Moestl . + * Copyright 2006 by Marius Strobl . + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby + * granted, provided that both the above copyright notice and this + * permission notice appear in all copies, that both the above + * copyright notice and this permission notice appear in all + * supporting documentation, and that the name of M.I.T. not be used + * in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. M.I.T. makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS + * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + * SHALL M.I.T. 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. + * + * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +/* + * The ofwbus (which is a pseudo-bus actually) iterates over the nodes that + * hang from the Open Firmware root node and adds them as devices to this bus + * (except some special nodes which are excluded) so that drivers can be + * attached to them. + * + */ + +struct ofwbus_devinfo { + struct ofw_bus_devinfo ndi_obdinfo; + struct resource_list ndi_rl; +}; + +struct ofwbus_softc { + uint32_t acells, scells; + struct rman sc_intr_rman; + struct rman sc_mem_rman; +}; + +static device_identify_t ofwbus_identify; +static device_probe_t ofwbus_probe; +static device_attach_t ofwbus_attach; +static bus_print_child_t ofwbus_print_child; +static bus_add_child_t ofwbus_add_child; +static bus_probe_nomatch_t ofwbus_probe_nomatch; +static bus_alloc_resource_t ofwbus_alloc_resource; +static bus_adjust_resource_t ofwbus_adjust_resource; +static bus_release_resource_t ofwbus_release_resource; +static bus_get_resource_list_t ofwbus_get_resource_list; +static ofw_bus_get_devinfo_t ofwbus_get_devinfo; + +static int ofwbus_inlist(const char *, const char *const *); +static struct ofwbus_devinfo * ofwbus_setup_dinfo(device_t, phandle_t); +static void ofwbus_destroy_dinfo(struct ofwbus_devinfo *); +static int ofwbus_print_res(struct ofwbus_devinfo *); + +static device_method_t ofwbus_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, ofwbus_identify), + DEVMETHOD(device_probe, ofwbus_probe), + DEVMETHOD(device_attach, ofwbus_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, ofwbus_print_child), + DEVMETHOD(bus_probe_nomatch, ofwbus_probe_nomatch), + DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), + DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), + DEVMETHOD(bus_add_child, ofwbus_add_child), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_alloc_resource, ofwbus_alloc_resource), + DEVMETHOD(bus_adjust_resource, ofwbus_adjust_resource), + DEVMETHOD(bus_release_resource, ofwbus_release_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, ofwbus_get_resource_list), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_config_intr, bus_generic_config_intr), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, ofwbus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +static driver_t ofwbus_driver = { + "ofwbus", + ofwbus_methods, + sizeof(struct ofwbus_softc) +}; +static devclass_t ofwbus_devclass; +DRIVER_MODULE(ofwbus, nexus, ofwbus_driver, ofwbus_devclass, 0, 0); +MODULE_VERSION(ofwbus, 1); + +static const char *const ofwbus_excl_name[] = { + "FJSV,system", + "aliases", + "associations", + "chosen", + "cmp", + "counter-timer", /* No separate device; handled by psycho/sbus */ + "failsafe", + "memory", + "openprom", + "options", + "packages", + "physical-memory", + "rsc", + "sgcn", + "todsg", + "virtual-memory", + NULL +}; + +static const char *const ofwbus_excl_type[] = { + "core", + "cpu", + NULL +}; + +static int +ofwbus_inlist(const char *name, const char *const *list) +{ + int i; + + if (name == NULL) + return (0); + for (i = 0; list[i] != NULL; i++) + if (strcmp(name, list[i]) == 0) + return (1); + return (0); +} + +#define OFWBUS_EXCLUDED(name, type) \ + (ofwbus_inlist((name), ofwbus_excl_name) || \ + ((type) != NULL && ofwbus_inlist((type), ofwbus_excl_type))) + +static void +ofwbus_identify(driver_t *driver, device_t parent) +{ + + /* Check if Open Firmware has been instantiated */ + if (OF_peer(0) == -1) + return; + + if (device_find_child(parent, "ofwbus", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "ofwbus", -1); +} + +static int +ofwbus_probe(device_t dev) +{ + + device_set_desc(dev, "Open Firmware Device Tree"); + return (BUS_PROBE_NOWILDCARD); +} + +static int +ofwbus_attach(device_t dev) +{ + struct ofwbus_devinfo *ndi; + struct ofwbus_softc *sc; + device_t cdev; + phandle_t node; + + sc = device_get_softc(dev); + + node = OF_peer(0); + + /* + * If no Open Firmware, bail early + */ + if (node == -1) + return (ENXIO); + + sc->sc_intr_rman.rm_type = RMAN_ARRAY; + sc->sc_intr_rman.rm_descr = "Interrupts"; + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "Device Memory"; + if (rman_init(&sc->sc_intr_rman) != 0 || + rman_init(&sc->sc_mem_rman) != 0 || + rman_manage_region(&sc->sc_intr_rman, 0, ~0) != 0 || + rman_manage_region(&sc->sc_mem_rman, 0, BUS_SPACE_MAXADDR) != 0) + panic("%s: failed to set up rmans.", __func__); + + /* + * Allow devices to identify. + */ + bus_generic_probe(dev); + + /* + * Some important numbers + */ + sc->acells = 2; + OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); + sc->scells = 1; + OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); + + /* + * Now walk the OFW tree and attach top-level devices. + */ + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + if ((ndi = ofwbus_setup_dinfo(dev, node)) == NULL) + continue; + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + ndi->ndi_obdinfo.obd_name); + ofwbus_destroy_dinfo(ndi); + continue; + } + device_set_ivars(cdev, ndi); + } + return (bus_generic_attach(dev)); +} + +static device_t +ofwbus_add_child(device_t dev, u_int order, const char *name, int unit) +{ + device_t cdev; + struct ofwbus_devinfo *ndi; + + cdev = device_add_child_ordered(dev, order, name, unit); + if (cdev == NULL) + return (NULL); + + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + ndi->ndi_obdinfo.obd_node = -1; + resource_list_init(&ndi->ndi_rl); + device_set_ivars(cdev, ndi); + + return (cdev); +} + +static int +ofwbus_print_child(device_t bus, device_t child) +{ + int rv; + + rv = bus_print_child_header(bus, child); + rv += ofwbus_print_res(device_get_ivars(child)); + rv += bus_print_child_footer(bus, child); + return (rv); +} + +static void +ofwbus_probe_nomatch(device_t bus, device_t child) +{ + const char *name, *type; + + if (!bootverbose) + return; + + name = ofw_bus_get_name(child); + type = ofw_bus_get_type(child); + + device_printf(bus, "<%s>", + name != NULL ? name : "unknown"); + ofwbus_print_res(device_get_ivars(child)); + printf(" type %s (no driver attached)\n", + type != NULL ? type : "unknown"); +} + +static struct resource * +ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct ofwbus_softc *sc; + struct rman *rm; + struct resource *rv; + struct resource_list_entry *rle; + int isdefault, passthrough; + + isdefault = (start == 0UL && end == ~0UL); + passthrough = (device_get_parent(child) != bus); + sc = device_get_softc(bus); + rle = NULL; + + if (!passthrough && isdefault) { + rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), + type, *rid); + if (rle == NULL) + return (NULL); + if (rle->res != NULL) + panic("%s: resource entry is busy", __func__); + start = rle->start; + count = ulmax(count, rle->count); + end = ulmax(rle->end, start + count - 1); + } + + switch (type) { + case SYS_RES_IRQ: + rm = &sc->sc_intr_rman; + break; + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + default: + return (NULL); + } + + rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, + child); + if (rv == NULL) + return (NULL); + rman_set_rid(rv, *rid); + + if ((flags & RF_ACTIVE) != 0 && bus_activate_resource(child, type, + *rid, rv) != 0) { + rman_release_resource(rv); + return (NULL); + } + + if (!passthrough && rle != NULL) { + rle->res = rv; + rle->start = rman_get_start(rv); + rle->end = rman_get_end(rv); + rle->count = rle->end - rle->start + 1; + } + + return (rv); +} + +static int +ofwbus_adjust_resource(device_t bus, device_t child __unused, int type, + struct resource *r, u_long start, u_long end) +{ + struct ofwbus_softc *sc; + struct rman *rm; + device_t ofwbus; + + ofwbus = bus; + while (strcmp(device_get_name(device_get_parent(ofwbus)), "root") != 0) + ofwbus = device_get_parent(ofwbus); + sc = device_get_softc(ofwbus); + switch (type) { + case SYS_RES_IRQ: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 17:53:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 29AA348A; Thu, 15 May 2014 17:53: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 16B372159; Thu, 15 May 2014 17:53: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 s4FHrn29018137; Thu, 15 May 2014 17:53:49 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FHrgAs018095; Thu, 15 May 2014 17:53:42 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151753.s4FHrgAs018095@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 17:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266162 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 17:53:49 -0000 Author: ian Date: Thu May 15 17:53:42 2014 New Revision: 266162 URL: http://svnweb.freebsd.org/changeset/base/266162 Log: MFC r261570, r261572 Revert r260440 (add USB_HOST_ALIGN to all configs, it's only needed for platforms with a 64-byte cacheline size). Add option USB_HOST_ALIGN=64 for all SoCs that have 64 byte cache lines. Modified: stable/10/sys/arm/conf/AC100 stable/10/sys/arm/conf/ARMADAXP stable/10/sys/arm/conf/ATMEL stable/10/sys/arm/conf/AVILA stable/10/sys/arm/conf/BWCT stable/10/sys/arm/conf/CAMBRIA stable/10/sys/arm/conf/CNS11XXNAS stable/10/sys/arm/conf/DB-78XXX stable/10/sys/arm/conf/DB-88F5XXX stable/10/sys/arm/conf/DB-88F6XXX stable/10/sys/arm/conf/DIGI-CCWMX53 stable/10/sys/arm/conf/EA3250 stable/10/sys/arm/conf/EB9200 stable/10/sys/arm/conf/EFIKA_MX stable/10/sys/arm/conf/ETHERNUT5 stable/10/sys/arm/conf/HL200 stable/10/sys/arm/conf/HL201 stable/10/sys/arm/conf/IMX53-QSB stable/10/sys/arm/conf/KB920X stable/10/sys/arm/conf/LN2410SBC stable/10/sys/arm/conf/NSLU stable/10/sys/arm/conf/QILA9G20 stable/10/sys/arm/conf/RPI-B stable/10/sys/arm/conf/SAM9260EK stable/10/sys/arm/conf/SAM9G20EK stable/10/sys/arm/conf/SAM9X25EK stable/10/sys/arm/conf/SHEEVAPLUG stable/10/sys/arm/conf/SN9G45 stable/10/sys/arm/conf/TS7800 stable/10/sys/arm/conf/ZEDBOARD Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/AC100 ============================================================================== --- stable/10/sys/arm/conf/AC100 Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/AC100 Thu May 15 17:53:42 2014 (r266162) @@ -66,7 +66,6 @@ device loop device md # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs #device usb #device ehci Modified: stable/10/sys/arm/conf/ARMADAXP ============================================================================== --- stable/10/sys/arm/conf/ARMADAXP Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/ARMADAXP Thu May 15 17:53:42 2014 (r266162) @@ -67,7 +67,6 @@ device loop device md # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: stable/10/sys/arm/conf/ATMEL ============================================================================== --- stable/10/sys/arm/conf/ATMEL Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/ATMEL Thu May 15 17:53:42 2014 (r266162) @@ -156,7 +156,6 @@ device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/AVILA ============================================================================== --- stable/10/sys/arm/conf/AVILA Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/AVILA Thu May 15 17:53:42 2014 (r266162) @@ -143,7 +143,6 @@ device ath_ar9160 device ath_ar9280 device usb -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG device ohci device ehci Modified: stable/10/sys/arm/conf/BWCT ============================================================================== --- stable/10/sys/arm/conf/BWCT Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/BWCT Thu May 15 17:53:42 2014 (r266162) @@ -104,7 +104,6 @@ device spibus device bpf # Berkeley packet filter #options USB_DEBUG -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #device ohci #device usb #device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/CAMBRIA ============================================================================== --- stable/10/sys/arm/conf/CAMBRIA Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/CAMBRIA Thu May 15 17:53:42 2014 (r266162) @@ -136,7 +136,6 @@ options AH_SUPPORT_AR5416 # NB: for 11n device ath_hal # NB: 2 USB 2.0 ports standard -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order #options USB_DEBUG Modified: stable/10/sys/arm/conf/CNS11XXNAS ============================================================================== --- stable/10/sys/arm/conf/CNS11XXNAS Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/CNS11XXNAS Thu May 15 17:53:42 2014 (r266162) @@ -105,7 +105,6 @@ device random # Entrop #options ARM_USE_SMALL_ALLOC device usb -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG device ohci device ehci Modified: stable/10/sys/arm/conf/DB-78XXX ============================================================================== --- stable/10/sys/arm/conf/DB-78XXX Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/DB-78XXX Thu May 15 17:53:42 2014 (r266162) @@ -67,7 +67,6 @@ device e1000phy device bpf # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: stable/10/sys/arm/conf/DB-88F5XXX ============================================================================== --- stable/10/sys/arm/conf/DB-88F5XXX Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/DB-88F5XXX Thu May 15 17:53:42 2014 (r266162) @@ -73,7 +73,6 @@ device iicbus device ds133x # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: stable/10/sys/arm/conf/DB-88F6XXX ============================================================================== --- stable/10/sys/arm/conf/DB-88F6XXX Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/DB-88F6XXX Thu May 15 17:53:42 2014 (r266162) @@ -71,7 +71,6 @@ device crypto device cryptodev # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: stable/10/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- stable/10/sys/arm/conf/DIGI-CCWMX53 Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/DIGI-CCWMX53 Thu May 15 17:53:42 2014 (r266162) @@ -134,7 +134,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/EA3250 ============================================================================== --- stable/10/sys/arm/conf/EA3250 Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/EA3250 Thu May 15 17:53:42 2014 (r266162) @@ -65,7 +65,6 @@ device bpf device lpe # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG device usb device ohci Modified: stable/10/sys/arm/conf/EB9200 ============================================================================== --- stable/10/sys/arm/conf/EB9200 Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/EB9200 Thu May 15 17:53:42 2014 (r266162) @@ -92,7 +92,6 @@ device icee device bpf # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/EFIKA_MX ============================================================================== --- stable/10/sys/arm/conf/EFIKA_MX Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/EFIKA_MX Thu May 15 17:53:42 2014 (r266162) @@ -130,7 +130,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/ETHERNUT5 ============================================================================== --- stable/10/sys/arm/conf/ETHERNUT5 Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/ETHERNUT5 Thu May 15 17:53:42 2014 (r266162) @@ -149,7 +149,6 @@ device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/HL200 ============================================================================== --- stable/10/sys/arm/conf/HL200 Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/HL200 Thu May 15 17:53:42 2014 (r266162) @@ -94,7 +94,6 @@ device icee device bpf # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/HL201 ============================================================================== --- stable/10/sys/arm/conf/HL201 Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/HL201 Thu May 15 17:53:42 2014 (r266162) @@ -85,7 +85,6 @@ device md device bpf # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices Modified: stable/10/sys/arm/conf/IMX53-QSB ============================================================================== --- stable/10/sys/arm/conf/IMX53-QSB Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/IMX53-QSB Thu May 15 17:53:42 2014 (r266162) @@ -133,7 +133,7 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/KB920X ============================================================================== --- stable/10/sys/arm/conf/KB920X Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/KB920X Thu May 15 17:53:42 2014 (r266162) @@ -95,7 +95,6 @@ device icee device bpf # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/LN2410SBC ============================================================================== --- stable/10/sys/arm/conf/LN2410SBC Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/LN2410SBC Thu May 15 17:53:42 2014 (r266162) @@ -77,7 +77,6 @@ options WITNESS_SKIPSPIN #Don't run wit device md -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ohci Modified: stable/10/sys/arm/conf/NSLU ============================================================================== --- stable/10/sys/arm/conf/NSLU Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/NSLU Thu May 15 17:53:42 2014 (r266162) @@ -108,7 +108,6 @@ device random # Entropy device #options ARM_USE_SMALL_ALLOC device usb -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG device ohci device ehci Modified: stable/10/sys/arm/conf/QILA9G20 ============================================================================== --- stable/10/sys/arm/conf/QILA9G20 Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/QILA9G20 Thu May 15 17:53:42 2014 (r266162) @@ -118,7 +118,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/RPI-B ============================================================================== --- stable/10/sys/arm/conf/RPI-B Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/RPI-B Thu May 15 17:53:42 2014 (r266162) @@ -93,7 +93,6 @@ device md device random # Entropy device # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_DEBUG device dwcotg #DWC OTG controller Modified: stable/10/sys/arm/conf/SAM9260EK ============================================================================== --- stable/10/sys/arm/conf/SAM9260EK Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/SAM9260EK Thu May 15 17:53:42 2014 (r266162) @@ -158,7 +158,6 @@ device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) Modified: stable/10/sys/arm/conf/SAM9G20EK ============================================================================== --- stable/10/sys/arm/conf/SAM9G20EK Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/SAM9G20EK Thu May 15 17:53:42 2014 (r266162) @@ -122,7 +122,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/SAM9X25EK ============================================================================== --- stable/10/sys/arm/conf/SAM9X25EK Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/SAM9X25EK Thu May 15 17:53:42 2014 (r266162) @@ -120,7 +120,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. #device ohci # OHCI localbus->USB interface #device usb # USB Bus (required) #device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/SHEEVAPLUG ============================================================================== --- stable/10/sys/arm/conf/SHEEVAPLUG Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/SHEEVAPLUG Thu May 15 17:53:42 2014 (r266162) @@ -65,7 +65,6 @@ device crypto device cryptodev # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. options USB_DEBUG # enable debug msgs device usb device ehci Modified: stable/10/sys/arm/conf/SN9G45 ============================================================================== --- stable/10/sys/arm/conf/SN9G45 Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/SN9G45 Thu May 15 17:53:42 2014 (r266162) @@ -96,7 +96,6 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device ohci # OHCI localbus->USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/TS7800 ============================================================================== --- stable/10/sys/arm/conf/TS7800 Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/TS7800 Thu May 15 17:53:42 2014 (r266162) @@ -61,7 +61,6 @@ device bpf options HZ=1000 # USB -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb device ehci device umass Modified: stable/10/sys/arm/conf/ZEDBOARD ============================================================================== --- stable/10/sys/arm/conf/ZEDBOARD Thu May 15 17:52:28 2014 (r266161) +++ stable/10/sys/arm/conf/ZEDBOARD Thu May 15 17:53:42 2014 (r266162) @@ -81,7 +81,6 @@ device sdhci # generic sdhci device bpf # Berkeley packet filter # USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb options USB_DEBUG #options USB_REQ_DEBUG From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 18:05:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A10878C7; Thu, 15 May 2014 18:05: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 8D478224D; Thu, 15 May 2014 18:05: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 s4FI5qKE023371; Thu, 15 May 2014 18:05:52 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FI5qqA023367; Thu, 15 May 2014 18:05:52 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405151805.s4FI5qqA023367@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 15 May 2014 18:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266164 - stable/10/sys/arm/broadcom/bcm2835 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 18:05:52 -0000 Author: loos Date: Thu May 15 18:05:51 2014 New Revision: 266164 URL: http://svnweb.freebsd.org/changeset/base/266164 Log: MFC r256871, r259034, r266010 r256871: Implement watchdog function and register it with watchdog list. r259034: Make the sysctl node read-only. r266010: Remove extra newlines. No functional changes. Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Thu May 15 18:02:08 2014 (r266163) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Thu May 15 18:05:51 2014 (r266164) @@ -99,7 +99,6 @@ struct bcmsc_softc { struct bcm_fb_config* fb_config; bus_addr_t fb_config_phys; struct intr_config_hook init_hook; - }; static int bcm_fb_probe(device_t); @@ -167,14 +166,10 @@ bcm_fb_init(void *arg) fb_config->xoffset, fb_config->yoffset, fb_config->bpp); - device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n", fb_config->pitch, fb_config->base, fb_config->screen_size); - - - info = malloc(sizeof(struct fb_info), M_DEVBUF, M_WAITOK | M_ZERO); info->fb_name = device_get_nameunit(sc->dev); @@ -199,8 +194,6 @@ bcm_fb_init(void *arg) device_printf(sc->dev, "Failed to attach fbd device\n"); return; } - - } else { device_printf(sc->dev, "Failed to set framebuffer info\n"); return; @@ -273,7 +266,6 @@ fail: return (ENXIO); } - static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) { Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Thu May 15 18:02:08 2014 (r266163) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Thu May 15 18:05:51 2014 (r266164) @@ -589,7 +589,7 @@ bcm_gpio_sysctl_init(struct bcm_gpio_sof tree_node = device_get_sysctl_tree(sc->sc_dev); tree = SYSCTL_CHILDREN(tree_node); pin_node = SYSCTL_ADD_NODE(ctx, tree, OID_AUTO, "pin", - CTLFLAG_RW, NULL, "GPIO Pins"); + CTLFLAG_RD, NULL, "GPIO Pins"); pin_tree = SYSCTL_CHILDREN(pin_node); for (i = 0; i < sc->sc_gpio_npins; i++) { Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_wdog.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Thu May 15 18:02:08 2014 (r266163) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Thu May 15 18:05:51 2014 (r266164) @@ -76,11 +76,10 @@ struct bcmwd_softc { int wdog_armed; int wdog_period; char wdog_passwd; + struct mtx mtx; }; -#ifdef notyet static void bcmwd_watchdog_fn(void *private, u_int cmd, int *error); -#endif static int bcmwd_probe(device_t dev) @@ -123,19 +122,59 @@ bcmwd_attach(device_t dev) sc->bsh = rman_get_bushandle(sc->res); bcmwd_lsc = sc; -#ifdef notyet + mtx_init(&sc->mtx, "BCM2835 Watchdog", "bcmwd", MTX_DEF); EVENTHANDLER_REGISTER(watchdog_list, bcmwd_watchdog_fn, sc, 0); -#endif + return (0); } -#ifdef notyet static void bcmwd_watchdog_fn(void *private, u_int cmd, int *error) { - /* XXX: not yet */ + struct bcmwd_softc *sc; + uint64_t sec; + uint32_t ticks, reg; + + sc = private; + mtx_lock(&sc->mtx); + + cmd &= WD_INTERVAL; + + if (cmd > 0) { + sec = ((uint64_t)1 << (cmd & WD_INTERVAL)) / 1000000000; + ticks = (sec << 16) & BCM2835_WDOG_TIME_MASK; + if (ticks == 0) { + /* + * Can't arm + * disable watchdog as watchdog(9) requires + */ + device_printf(sc->dev, + "Can't arm, timeout is less than 1 second\n"); + WRITE(sc, BCM2835_RSTC_REG, + (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT) | + BCM2835_RSTC_RESET); + mtx_unlock(&sc->mtx); + return; + } + + reg = (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT) | ticks; + WRITE(sc, BCM2835_WDOG_REG, reg); + + reg = READ(sc, BCM2835_RSTC_REG); + reg &= BCM2835_RSTC_WRCFG_CLR; + reg |= BCM2835_RSTC_WRCFG_FULL_RESET; + reg |= (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT); + WRITE(sc, BCM2835_RSTC_REG, reg); + + *error = 0; + } + else + WRITE(sc, BCM2835_RSTC_REG, + (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT) | + BCM2835_RSTC_RESET); + + mtx_unlock(&sc->mtx); } -#endif void bcmwd_watchdog_reset() From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 18:07:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 07C4BA19; Thu, 15 May 2014 18:07: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 E8998226E; Thu, 15 May 2014 18:07: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 s4FI7Z8d023707; Thu, 15 May 2014 18:07:35 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FI7ZHg023706; Thu, 15 May 2014 18:07:35 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201405151807.s4FI7ZHg023706@svn.freebsd.org> From: Colin Percival Date: Thu, 15 May 2014 18:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266165 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 18:07:36 -0000 Author: cperciva Date: Thu May 15 18:07:35 2014 New Revision: 266165 URL: http://svnweb.freebsd.org/changeset/base/266165 Log: MFC r265876: In cf_get_method, when we don't already know what clock speed the CPU is running at, guess the nearest value instead of looking for a value within 25 MHz of the observed frequency. Prior to this change, if a system booted with Intel Turbo Boost enabled, the dev.cpu.0.freq sysctl is nonfunctional, since the ACPI-reported frequency for Turbo Boost states does not match the actual clock frequency (and thus no levels are within 25 MHz of the observed frequency) and the current performance level is read before a new level is set. Relnotes: Bug fix in power management on CPUs with Intel Turbo Boost Modified: stable/10/sys/kern/kern_cpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_cpu.c ============================================================================== --- stable/10/sys/kern/kern_cpu.c Thu May 15 18:05:51 2014 (r266164) +++ stable/10/sys/kern/kern_cpu.c Thu May 15 18:07:35 2014 (r266165) @@ -418,7 +418,7 @@ cf_get_method(device_t dev, struct cf_le struct cf_setting *curr_set, set; struct pcpu *pc; device_t *devs; - int count, error, i, n, numdevs; + int bdiff, count, diff, error, i, n, numdevs; uint64_t rate; sc = device_get_softc(dev); @@ -494,14 +494,15 @@ cf_get_method(device_t dev, struct cf_le } cpu_est_clockrate(pc->pc_cpuid, &rate); rate /= 1000000; + bdiff = 1 << 30; for (i = 0; i < count; i++) { - if (CPUFREQ_CMP(rate, levels[i].total_set.freq)) { + diff = abs(levels[i].total_set.freq - rate); + if (diff < bdiff) { + bdiff = diff; sc->curr_level = levels[i]; - CF_DEBUG("get estimated freq %d\n", curr_set->freq); - goto out; } } - error = ENXIO; + CF_DEBUG("get estimated freq %d\n", curr_set->freq); out: if (error == 0) From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 18:18:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 980B2FAD; Thu, 15 May 2014 18:18: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 6A230237E; Thu, 15 May 2014 18: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 s4FIIsLL028720; Thu, 15 May 2014 18:18:54 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FIIrQ6028714; Thu, 15 May 2014 18:18:53 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405151818.s4FIIrQ6028714@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 15 May 2014 18:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266168 - in stable/10/sys/arm: freescale/imx ti X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 18:18:54 -0000 Author: loos Date: Thu May 15 18:18:53 2014 New Revision: 266168 URL: http://svnweb.freebsd.org/changeset/base/266168 Log: MFC r259270 After r266105 ofw_iicbuc.c will be built by default for any kernel which includes options 'iicbus' and 'fdt'. Remove the (now) unnecessary entries. Modified: stable/10/sys/arm/freescale/imx/files.imx51 stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/ti/files.ti Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/files.imx51 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx51 Thu May 15 18:14:19 2014 (r266167) +++ stable/10/sys/arm/freescale/imx/files.imx51 Thu May 15 18:18:53 2014 (r266168) @@ -46,7 +46,6 @@ arm/freescale/imx/imx_wdog.c optional i # i2c arm/freescale/imx/i2c.c optional fsliic -dev/ofw/ofw_iicbus.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Thu May 15 18:14:19 2014 (r266167) +++ stable/10/sys/arm/freescale/imx/files.imx53 Thu May 15 18:18:53 2014 (r266168) @@ -46,7 +46,6 @@ arm/freescale/imx/imx_wdog.c optional i # i2c arm/freescale/imx/i2c.c optional fsliic -dev/ofw/ofw_iicbus.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc Modified: stable/10/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx6 Thu May 15 18:14:19 2014 (r266167) +++ stable/10/sys/arm/freescale/imx/files.imx6 Thu May 15 18:18:53 2014 (r266168) @@ -51,6 +51,5 @@ arm/freescale/imx/imx6_usbphy.c optiona #arm/freescale/imx/imx51_gpio.c optional gpio #dev/ata/chipsets/ata-fsl.c optional imxata #arm/freescale/imx/i2c.c optional fsliic -#dev/ofw/ofw_iicbus.c optional fsliic #arm/freescale/imx/imx51_ipuv3.c optional sc Modified: stable/10/sys/arm/ti/files.ti ============================================================================== --- stable/10/sys/arm/ti/files.ti Thu May 15 18:14:19 2014 (r266167) +++ stable/10/sys/arm/ti/files.ti Thu May 15 18:18:53 2014 (r266168) @@ -19,7 +19,6 @@ arm/ti/ti_scm.c standard arm/ti/ti_gpio.c optional gpio arm/ti/ti_i2c.c optional ti_i2c -dev/ofw/ofw_iicbus.c optional iicbus dev/uart/uart_dev_ti8250.c optional uart dev/uart/uart_dev_ns8250.c optional uart From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 18:38:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E567070A; Thu, 15 May 2014 18:38: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 CFC8F25E9; Thu, 15 May 2014 18:38: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 s4FIcL0C037303; Thu, 15 May 2014 18:38:21 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FIcKHD037294; Thu, 15 May 2014 18:38:20 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151838.s4FIcKHD037294@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 18:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266170 - in stable/10/sys: arm/freescale/vybrid boot/fdt/dts dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 18:38:22 -0000 Author: ian Date: Thu May 15 18:38:19 2014 New Revision: 266170 URL: http://svnweb.freebsd.org/changeset/base/266170 Log: MFC r261616, r261639 Remove FreeBSD 6 support from atmel usb controllers. Add Vybrid drivers for: - Enhanced Direct Memory Access Controller (eDMA) - Direct Memory Access Multiplexer (DMAMUX) Added: stable/10/sys/arm/freescale/vybrid/vf_dmamux.c - copied unchanged from r261639, head/sys/arm/freescale/vybrid/vf_dmamux.c stable/10/sys/arm/freescale/vybrid/vf_dmamux.h - copied unchanged from r261639, head/sys/arm/freescale/vybrid/vf_dmamux.h stable/10/sys/arm/freescale/vybrid/vf_edma.c - copied unchanged from r261639, head/sys/arm/freescale/vybrid/vf_edma.c stable/10/sys/arm/freescale/vybrid/vf_edma.h - copied unchanged from r261639, head/sys/arm/freescale/vybrid/vf_edma.h Modified: stable/10/sys/arm/freescale/vybrid/files.vybrid stable/10/sys/boot/fdt/dts/vybrid.dtsi stable/10/sys/dev/usb/controller/at91dci_atmelarm.c stable/10/sys/dev/usb/controller/ohci_atmelarm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- stable/10/sys/arm/freescale/vybrid/files.vybrid Thu May 15 18:34:31 2014 (r266169) +++ stable/10/sys/arm/freescale/vybrid/files.vybrid Thu May 15 18:38:19 2014 (r266170) @@ -21,6 +21,8 @@ arm/freescale/vybrid/vf_anadig.c standa arm/freescale/vybrid/vf_iomuxc.c standard arm/freescale/vybrid/vf_mscm.c standard arm/freescale/vybrid/vf_src.c standard +arm/freescale/vybrid/vf_edma.c standard +arm/freescale/vybrid/vf_dmamux.c standard arm/freescale/vybrid/vf_tcon.c optional vt arm/freescale/vybrid/vf_dcu4.c optional vt arm/freescale/vybrid/vf_nfc.c optional nand Copied: stable/10/sys/arm/freescale/vybrid/vf_dmamux.c (from r261639, head/sys/arm/freescale/vybrid/vf_dmamux.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/vybrid/vf_dmamux.c Thu May 15 18:38:19 2014 (r266170, copy of r261639, head/sys/arm/freescale/vybrid/vf_dmamux.c) @@ -0,0 +1,155 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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. + */ + +/* + * Vybrid Family Direct Memory Access Multiplexer (DMAMUX) + * Chapter 22, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#define DMAMUX_CHCFG(n) (0x1 * n) /* Channels 0-15 Cfg Reg */ +#define CHCFG_ENBL (1 << 7) /* Channel Enable */ +#define CHCFG_TRIG (1 << 6) /* Channel Trigger Enable */ +#define CHCFG_SOURCE_MASK 0x3f /* Channel Source (Slot) */ +#define CHCFG_SOURCE_SHIFT 0 + +struct dmamux_softc { + struct resource *res[4]; + bus_space_tag_t bst[4]; + bus_space_handle_t bsh[4]; +}; + +struct dmamux_softc *dmamux_sc; + +static struct resource_spec dmamux_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* DMAMUX0 */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* DMAMUX1 */ + { SYS_RES_MEMORY, 2, RF_ACTIVE }, /* DMAMUX2 */ + { SYS_RES_MEMORY, 3, RF_ACTIVE }, /* DMAMUX3 */ + { -1, 0 } +}; + +static int +dmamux_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-dmamux")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family Direct Memory Access Multiplexer"); + return (BUS_PROBE_DEFAULT); +} + +int +dmamux_configure(int mux, int source, int channel, int enable) +{ + struct dmamux_softc *sc; + int reg; + + sc = dmamux_sc; + + MUX_WRITE1(sc, mux, DMAMUX_CHCFG(channel), 0x0); + + reg = 0; + if (enable) + reg |= (CHCFG_ENBL); + + reg &= ~(CHCFG_SOURCE_MASK << CHCFG_SOURCE_SHIFT); + reg |= (source << CHCFG_SOURCE_SHIFT); + + MUX_WRITE1(sc, mux, DMAMUX_CHCFG(channel), reg); + + return (0); +} + +static int +dmamux_attach(device_t dev) +{ + struct dmamux_softc *sc; + int i; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, dmamux_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + for (i = 0; i < 4; i++) { + sc->bst[i] = rman_get_bustag(sc->res[i]); + sc->bsh[i] = rman_get_bushandle(sc->res[i]); + } + + dmamux_sc = sc; + + return (0); +} + +static device_method_t dmamux_methods[] = { + DEVMETHOD(device_probe, dmamux_probe), + DEVMETHOD(device_attach, dmamux_attach), + { 0, 0 } +}; + +static driver_t dmamux_driver = { + "dmamux", + dmamux_methods, + sizeof(struct dmamux_softc), +}; + +static devclass_t dmamux_devclass; + +DRIVER_MODULE(dmamux, simplebus, dmamux_driver, dmamux_devclass, 0, 0); Copied: stable/10/sys/arm/freescale/vybrid/vf_dmamux.h (from r261639, head/sys/arm/freescale/vybrid/vf_dmamux.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/vybrid/vf_dmamux.h Thu May 15 18:38:19 2014 (r266170, copy of r261639, head/sys/arm/freescale/vybrid/vf_dmamux.h) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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$ + */ + +int dmamux_configure(int mux, int source, int channel, int enable); + +enum mux_num { + MUX0, + MUX1, + MUX2, + MUX3, +}; + +enum mux_grp { + MUXGRP0, /* MUX[0,3] */ + MUXGRP1, /* MUX[1,2] */ +}; + +/* DMAMUX */ +#define MUX_READ1(_sc, _mux, _reg) \ + bus_space_read_1(_sc->bst[_mux], _sc->bsh[_mux], _reg) + +#define MUX_WRITE1(_sc, _mux, _reg, _val) \ + bus_space_write_1(_sc->bst[_mux], _sc->bsh[_mux], _reg, _val) Copied: stable/10/sys/arm/freescale/vybrid/vf_edma.c (from r261639, head/sys/arm/freescale/vybrid/vf_edma.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/vybrid/vf_edma.c Thu May 15 18:38:19 2014 (r266170, copy of r261639, head/sys/arm/freescale/vybrid/vf_edma.c) @@ -0,0 +1,338 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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. + */ + +/* + * Vybrid Family Enhanced Direct Memory Access Controller (eDMA) + * Chapter 21, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +struct edma_channel { + uint32_t enabled; + uint32_t mux_num; + uint32_t mux_src; + uint32_t mux_chn; + uint32_t (*ih) (void *, int); + void *ih_user; +}; + +static struct edma_channel edma_map[EDMA_NUM_CHANNELS]; + +static struct resource_spec edma_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* TCD */ + { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Transfer complete */ + { SYS_RES_IRQ, 1, RF_ACTIVE }, /* Error Interrupt */ + { -1, 0 } +}; + +static int +edma_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-edma")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family eDMA Controller"); + return (BUS_PROBE_DEFAULT); +} + +static void +edma_transfer_complete_intr(void *arg) +{ + struct edma_channel *ch; + struct edma_softc *sc; + int interrupts; + int i; + + sc = arg; + + interrupts = READ4(sc, DMA_INT); + WRITE1(sc, DMA_CINT, CINT_CAIR); + + for (i = 0; i < EDMA_NUM_CHANNELS; i++) { + if (interrupts & (0x1 << i)) { + ch = &edma_map[i]; + if (ch->enabled == 1) { + if (ch->ih != NULL) { + ch->ih(ch->ih_user, i); + } + } + } + } +} + +static void +edma_err_intr(void *arg) +{ + struct edma_softc *sc; + int reg; + + sc = arg; + + reg = READ4(sc, DMA_ERR); + +#if 0 + device_printf(sc->dev, "DMA_ERR 0x%08x, ES 0x%08x\n", + reg, READ4(sc, DMA_ES)); +#endif + + WRITE1(sc, DMA_CERR, CERR_CAEI); +} + +static int +channel_free(struct edma_softc *sc, int chnum) +{ + struct edma_channel *ch; + + ch = &edma_map[chnum]; + ch->enabled = 0; + + dmamux_configure(ch->mux_num, ch->mux_src, ch->mux_chn, 0); + + return (0); +} + +static int +channel_configure(struct edma_softc *sc, int mux_grp, int mux_src) +{ + struct edma_channel *ch; + int channel_first; + int mux_num; + int chnum; + int i; + + if ((sc->device_id == 0 && mux_grp == 1) || \ + (sc->device_id == 1 && mux_grp == 0)) { + channel_first = NCHAN_PER_MUX; + mux_num = (sc->device_id * 2) + 1; + } else { + channel_first = 0; + mux_num = sc->device_id * 2; + }; + + /* Take first unused eDMA channel */ + ch = NULL; + for (i = channel_first; i < (channel_first + NCHAN_PER_MUX); i++) { + ch = &edma_map[i]; + if (ch->enabled == 0) { + break; + } + ch = NULL; + }; + + if (ch == NULL) { + /* Can't find free channel */ + return (-1); + }; + + chnum = i; + + ch->enabled = 1; + ch->mux_num = mux_num; + ch->mux_src = mux_src; + ch->mux_chn = (chnum - channel_first); /* 0 to 15 */ + + dmamux_configure(ch->mux_num, ch->mux_src, ch->mux_chn, 1); + + return (chnum); +} + +static int +dma_stop(struct edma_softc *sc, int chnum) +{ + int reg; + + reg = READ4(sc, DMA_ERQ); + reg &= ~(0x1 << chnum); + WRITE4(sc, DMA_ERQ, reg); + + return (0); +} + +static int +dma_setup(struct edma_softc *sc, struct tcd_conf *tcd) +{ + struct edma_channel *ch; + int chnum; + int reg; + + chnum = tcd->channel; + + ch = &edma_map[chnum]; + ch->ih = tcd->ih; + ch->ih_user = tcd->ih_user; + + TCD_WRITE4(sc, DMA_TCDn_SADDR(chnum), tcd->saddr); + TCD_WRITE4(sc, DMA_TCDn_DADDR(chnum), tcd->daddr); + + reg = (tcd->smod << TCD_ATTR_SMOD_SHIFT); + reg |= (tcd->dmod << TCD_ATTR_DMOD_SHIFT); + reg |= (tcd->ssize << TCD_ATTR_SSIZE_SHIFT); + reg |= (tcd->dsize << TCD_ATTR_DSIZE_SHIFT); + TCD_WRITE2(sc, DMA_TCDn_ATTR(chnum), reg); + + TCD_WRITE2(sc, DMA_TCDn_SOFF(chnum), tcd->soff); + TCD_WRITE2(sc, DMA_TCDn_DOFF(chnum), tcd->doff); + TCD_WRITE4(sc, DMA_TCDn_SLAST(chnum), tcd->slast); + TCD_WRITE4(sc, DMA_TCDn_DLASTSGA(chnum), tcd->dlast_sga); + TCD_WRITE4(sc, DMA_TCDn_NBYTES_MLOFFYES(chnum), tcd->nbytes); + + reg = tcd->nmajor; /* Current Major Iteration Count */ + TCD_WRITE2(sc, DMA_TCDn_CITER_ELINKNO(chnum), reg); + TCD_WRITE2(sc, DMA_TCDn_BITER_ELINKNO(chnum), reg); + + reg = (TCD_CSR_INTMAJOR); + if(tcd->majorelink == 1) { + reg |= TCD_CSR_MAJORELINK; + reg |= (tcd->majorelinkch << TCD_CSR_MAJORELINKCH_SHIFT); + } + TCD_WRITE2(sc, DMA_TCDn_CSR(chnum), reg); + + /* Enable requests */ + reg = READ4(sc, DMA_ERQ); + reg |= (0x1 << chnum); + WRITE4(sc, DMA_ERQ, reg); + + /* Enable error interrupts */ + reg = READ4(sc, DMA_EEI); + reg |= (0x1 << chnum); + WRITE4(sc, DMA_EEI, reg); + + return (0); +} + +static int +dma_request(struct edma_softc *sc, int chnum) +{ + int reg; + + /* Start */ + reg = TCD_READ2(sc, DMA_TCDn_CSR(chnum)); + reg |= TCD_CSR_START; + TCD_WRITE2(sc, DMA_TCDn_CSR(chnum), reg); + + return (0); +} + +static int +edma_attach(device_t dev) +{ + struct edma_softc *sc; + phandle_t node; + int dts_value; + int len; + + sc = device_get_softc(dev); + sc->dev = dev; + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + if ((len = OF_getproplen(node, "device-id")) <= 0) + return (ENXIO); + + OF_getprop(node, "device-id", &dts_value, len); + sc->device_id = fdt32_to_cpu(dts_value); + + sc->dma_stop = dma_stop; + sc->dma_setup = dma_setup; + sc->dma_request = dma_request; + sc->channel_configure = channel_configure; + sc->channel_free = channel_free; + + if (bus_alloc_resources(dev, edma_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + sc->bst_tcd = rman_get_bustag(sc->res[1]); + sc->bsh_tcd = rman_get_bushandle(sc->res[1]); + + /* Setup interrupt handlers */ + if (bus_setup_intr(dev, sc->res[2], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, edma_transfer_complete_intr, sc, &sc->tc_ih)) { + device_printf(dev, "Unable to alloc DMA intr resource.\n"); + return (ENXIO); + } + + if (bus_setup_intr(dev, sc->res[3], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, edma_err_intr, sc, &sc->err_ih)) { + device_printf(dev, "Unable to alloc DMA Err intr resource.\n"); + return (ENXIO); + } + + return (0); +} + +static device_method_t edma_methods[] = { + DEVMETHOD(device_probe, edma_probe), + DEVMETHOD(device_attach, edma_attach), + { 0, 0 } +}; + +static driver_t edma_driver = { + "edma", + edma_methods, + sizeof(struct edma_softc), +}; + +static devclass_t edma_devclass; + +DRIVER_MODULE(edma, simplebus, edma_driver, edma_devclass, 0, 0); Copied: stable/10/sys/arm/freescale/vybrid/vf_edma.h (from r261639, head/sys/arm/freescale/vybrid/vf_edma.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/vybrid/vf_edma.h Thu May 15 18:38:19 2014 (r266170, copy of r261639, head/sys/arm/freescale/vybrid/vf_edma.h) @@ -0,0 +1,186 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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$ + */ + +#define DMA_CR 0x000 /* Control */ +#define DMA_ES 0x004 /* Error Status */ +#define DMA_ERQ 0x00C /* Enable Request */ +#define DMA_EEI 0x014 /* Enable Error Interrupt */ +#define DMA_CEEI 0x018 /* Clear Enable Error Interrupt */ +#define DMA_SEEI 0x019 /* Set Enable Error Interrupt */ +#define DMA_CERQ 0x01A /* Clear Enable Request */ +#define DMA_SERQ 0x01B /* Set Enable Request */ +#define DMA_CDNE 0x01C /* Clear DONE Status Bit */ +#define DMA_SSRT 0x01D /* Set START Bit */ +#define DMA_CERR 0x01E /* Clear Error */ +#define CERR_CAEI (1 << 6) /* Clear All Error Indicators */ +#define DMA_CINT 0x01F /* Clear Interrupt Request */ +#define CINT_CAIR (1 << 6) /* Clear All Interrupt Requests */ +#define DMA_INT 0x024 /* Interrupt Request */ +#define DMA_ERR 0x02C /* Error */ +#define DMA_HRS 0x034 /* Hardware Request Status */ +#define DMA_EARS 0x044 /* Enable Asynchronous Request in Stop */ +#define DMA_DCHPRI3 0x100 /* Channel n Priority */ +#define DMA_DCHPRI2 0x101 /* Channel n Priority */ +#define DMA_DCHPRI1 0x102 /* Channel n Priority */ +#define DMA_DCHPRI0 0x103 /* Channel n Priority */ +#define DMA_DCHPRI7 0x104 /* Channel n Priority */ +#define DMA_DCHPRI6 0x105 /* Channel n Priority */ +#define DMA_DCHPRI5 0x106 /* Channel n Priority */ +#define DMA_DCHPRI4 0x107 /* Channel n Priority */ +#define DMA_DCHPRI11 0x108 /* Channel n Priority */ +#define DMA_DCHPRI10 0x109 /* Channel n Priority */ +#define DMA_DCHPRI9 0x10A /* Channel n Priority */ +#define DMA_DCHPRI8 0x10B /* Channel n Priority */ +#define DMA_DCHPRI15 0x10C /* Channel n Priority */ +#define DMA_DCHPRI14 0x10D /* Channel n Priority */ +#define DMA_DCHPRI13 0x10E /* Channel n Priority */ +#define DMA_DCHPRI12 0x10F /* Channel n Priority */ +#define DMA_DCHPRI19 0x110 /* Channel n Priority */ +#define DMA_DCHPRI18 0x111 /* Channel n Priority */ +#define DMA_DCHPRI17 0x112 /* Channel n Priority */ +#define DMA_DCHPRI16 0x113 /* Channel n Priority */ +#define DMA_DCHPRI23 0x114 /* Channel n Priority */ +#define DMA_DCHPRI22 0x115 /* Channel n Priority */ +#define DMA_DCHPRI21 0x116 /* Channel n Priority */ +#define DMA_DCHPRI20 0x117 /* Channel n Priority */ +#define DMA_DCHPRI27 0x118 /* Channel n Priority */ +#define DMA_DCHPRI26 0x119 /* Channel n Priority */ +#define DMA_DCHPRI25 0x11A /* Channel n Priority */ +#define DMA_DCHPRI24 0x11B /* Channel n Priority */ +#define DMA_DCHPRI31 0x11C /* Channel n Priority */ +#define DMA_DCHPRI30 0x11D /* Channel n Priority */ +#define DMA_DCHPRI29 0x11E /* Channel n Priority */ +#define DMA_DCHPRI28 0x11F /* Channel n Priority */ + +#define DMA_TCDn_SADDR(n) (0x00 + 0x20 * n) /* Source Address */ +#define DMA_TCDn_SOFF(n) (0x04 + 0x20 * n) /* Signed Source Address Offset */ +#define DMA_TCDn_ATTR(n) (0x06 + 0x20 * n) /* Transfer Attributes */ +#define DMA_TCDn_NBYTES_MLNO(n) (0x08 + 0x20 * n) /* Minor Byte Count */ +#define DMA_TCDn_NBYTES_MLOFFNO(n) (0x08 + 0x20 * n) /* Signed Minor Loop Offset */ +#define DMA_TCDn_NBYTES_MLOFFYES(n) (0x08 + 0x20 * n) /* Signed Minor Loop Offset */ +#define DMA_TCDn_SLAST(n) (0x0C + 0x20 * n) /* Last Source Address Adjustment */ +#define DMA_TCDn_DADDR(n) (0x10 + 0x20 * n) /* Destination Address */ +#define DMA_TCDn_DOFF(n) (0x14 + 0x20 * n) /* Signed Destination Address Offset */ +#define DMA_TCDn_CITER_ELINKYES(n) (0x16 + 0x20 * n) /* Current Minor Loop Link, Major Loop Count */ +#define DMA_TCDn_CITER_ELINKNO(n) (0x16 + 0x20 * n) +#define DMA_TCDn_DLASTSGA(n) (0x18 + 0x20 * n) /* Last Dst Addr Adjustment/Scatter Gather Address */ +#define DMA_TCDn_CSR(n) (0x1C + 0x20 * n) /* Control and Status */ +#define DMA_TCDn_BITER_ELINKYES(n) (0x1E + 0x20 * n) /* Beginning Minor Loop Link, Major Loop Count */ +#define DMA_TCDn_BITER_ELINKNO(n) (0x1E + 0x20 * n) /* Beginning Minor Loop Link, Major Loop Count */ + +#define TCD_CSR_START (1 << 0) +#define TCD_CSR_INTMAJOR (1 << 1) +#define TCD_CSR_INTHALF (1 << 2) +#define TCD_CSR_DREQ (1 << 3) +#define TCD_CSR_ESG (1 << 4) +#define TCD_CSR_MAJORELINK (1 << 5) +#define TCD_CSR_ACTIVE (1 << 6) +#define TCD_CSR_DONE (1 << 7) +#define TCD_CSR_MAJORELINKCH_SHIFT 8 + +#define TCD_ATTR_SMOD_SHIFT 11 /* Source Address Modulo */ +#define TCD_ATTR_SSIZE_SHIFT 8 /* Source Data Transfer Size */ +#define TCD_ATTR_DMOD_SHIFT 3 /* Dst Address Modulo */ +#define TCD_ATTR_DSIZE_SHIFT 0 /* Dst Data Transfer Size */ + +#define TCD_READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst_tcd, _sc->bsh_tcd, _reg) +#define TCD_WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst_tcd, _sc->bsh_tcd, _reg, _val) +#define TCD_READ2(_sc, _reg) \ + bus_space_read_2(_sc->bst_tcd, _sc->bsh_tcd, _reg) +#define TCD_WRITE2(_sc, _reg, _val) \ + bus_space_write_2(_sc->bst_tcd, _sc->bsh_tcd, _reg, _val) +#define TCD_READ1(_sc, _reg) \ + bus_space_read_1(_sc->bst_tcd, _sc->bsh_tcd, _reg) +#define TCD_WRITE1(_sc, _reg, _val) \ + bus_space_write_1(_sc->bst_tcd, _sc->bsh_tcd, _reg, _val) + +#define EDMA_NUM_DEVICES 2 +#define EDMA_NUM_CHANNELS 32 +#define NCHAN_PER_MUX 16 + +struct tcd_conf { + bus_addr_t saddr; + bus_addr_t daddr; + uint32_t nbytes; + uint32_t nmajor; + uint32_t majorelink; + uint32_t majorelinkch; + uint32_t esg; + uint32_t smod; + uint32_t dmod; + uint32_t soff; + uint32_t doff; + uint32_t ssize; + uint32_t dsize; + uint32_t slast; + uint32_t dlast_sga; + uint32_t channel; + uint32_t (*ih)(void *, int); + void *ih_user; +}; + +/* + * TCD struct is described at + * Vybrid Reference Manual, Rev. 5, 07/2013 + * + * Should be used for Scatter/Gathering feature. + */ + +struct TCD { + uint32_t saddr; + uint16_t attr; + uint16_t soff; + uint32_t nbytes; + uint32_t slast; + uint32_t daddr; + uint16_t citer; + uint16_t doff; + uint32_t dlast_sga; + uint16_t biter; + uint16_t csr; +} __packed; + +struct edma_softc { + device_t dev; + struct resource *res[4]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + bus_space_tag_t bst_tcd; + bus_space_handle_t bsh_tcd; + void *tc_ih; + void *err_ih; + uint32_t device_id; + + int (*channel_configure) (struct edma_softc *, int, int); + int (*channel_free) (struct edma_softc *, int); + int (*dma_request) (struct edma_softc *, int); + int (*dma_setup) (struct edma_softc *, struct tcd_conf *); + int (*dma_stop) (struct edma_softc *, int); +}; Modified: stable/10/sys/boot/fdt/dts/vybrid.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/vybrid.dtsi Thu May 15 18:34:31 2014 (r266169) +++ stable/10/sys/boot/fdt/dts/vybrid.dtsi Thu May 15 18:38:19 2014 (r266170) @@ -111,6 +111,7 @@ <0x40019000 0x1000>; /* TCD */ interrupts = < 40 41 >; interrupt-parent = <&GIC>; + device-id = < 0 >; status = "disabled"; }; @@ -120,6 +121,7 @@ <0x40099000 0x1000>; /* TCD */ interrupts = < 42 43 >; interrupt-parent = <&GIC>; + device-id = < 1 >; status = "disabled"; }; @@ -308,6 +310,7 @@ interrupts = < 119 >; interrupt-parent = <&GIC>; status = "disabled"; + edma-controller = <&edma1>; clock_names = "sai3", "cko1"; iomux_config = < 16 0x2 19 0x2 Modified: stable/10/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- stable/10/sys/dev/usb/controller/at91dci_atmelarm.c Thu May 15 18:34:31 2014 (r266169) +++ stable/10/sys/dev/usb/controller/at91dci_atmelarm.c Thu May 15 18:38:19 2014 (r266170) @@ -212,13 +212,8 @@ at91_udp_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); -#if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#endif if (err) { sc->sc_dci.sc_intr_hdl = NULL; goto error; Modified: stable/10/sys/dev/usb/controller/ohci_atmelarm.c ============================================================================== --- stable/10/sys/dev/usb/controller/ohci_atmelarm.c Thu May 15 18:34:31 2014 (r266169) +++ stable/10/sys/dev/usb/controller/ohci_atmelarm.c Thu May 15 18:38:19 2014 (r266170) @@ -131,13 +131,8 @@ ohci_atmelarm_attach(device_t dev) strlcpy(sc->sc_ohci.sc_vendor, "Atmel", sizeof(sc->sc_ohci.sc_vendor)); -#if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl); -#endif if (err) { sc->sc_ohci.sc_intr_hdl = NULL; goto error; From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 19:09:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6B9306DA; Thu, 15 May 2014 19:09: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 55C4628F8; Thu, 15 May 2014 19:09: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 s4FJ9ZhP051508; Thu, 15 May 2014 19:09:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FJ9Vek051483; Thu, 15 May 2014 19:09:31 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151909.s4FJ9Vek051483@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 19:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266175 - in stable/10/sys: arm/arm arm/conf arm/include arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 19:09:35 -0000 Author: ian Date: Thu May 15 19:09:31 2014 New Revision: 266175 URL: http://svnweb.freebsd.org/changeset/base/266175 Log: MFC r257549, r261642 Don't create a distinct free page pool for segregating allocations that are accessed through the direct map unless the kernel configuration actually includes a direct map. Only a few configurations do, and for the rest the unnecessary free page pool is a small pessimization. Remove the ARM_USE_SMALL_ALLOC option and code related to it. Modified: stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/mem.c stable/10/sys/arm/arm/pmap.c stable/10/sys/arm/arm/vm_machdep.c stable/10/sys/arm/conf/AVILA stable/10/sys/arm/conf/CAMBRIA stable/10/sys/arm/conf/CNS11XXNAS stable/10/sys/arm/conf/CRB stable/10/sys/arm/conf/EP80219 stable/10/sys/arm/conf/IQ31244 stable/10/sys/arm/conf/NSLU stable/10/sys/arm/include/pmap.h stable/10/sys/arm/include/sf_buf.h stable/10/sys/arm/include/vmparam.h stable/10/sys/arm/xscale/i80321/ep80219_machdep.c stable/10/sys/arm/xscale/i80321/iq31244_machdep.c stable/10/sys/arm/xscale/i8134x/crb_machdep.c stable/10/sys/arm/xscale/ixp425/avila_machdep.c stable/10/sys/arm/xscale/pxa/pxa_machdep.c stable/10/sys/arm/xscale/pxa/std.pxa stable/10/sys/conf/options.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/arm/machdep.c Thu May 15 19:09:31 2014 (r266175) @@ -783,9 +783,6 @@ makectx(struct trapframe *tf, struct pcb * Make a standard dump_avail array. Can't make the phys_avail * since we need to do that after we call pmap_bootstrap, but this * is needed before pmap_boostrap. - * - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. */ void arm_dump_avail_init(vm_paddr_t physaddr, vm_offset_t ramsize, size_t max) Modified: stable/10/sys/arm/arm/mem.c ============================================================================== --- stable/10/sys/arm/arm/mem.c Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/arm/mem.c Thu May 15 19:09:31 2014 (r266175) @@ -135,10 +135,6 @@ memrw(struct cdev *dev, struct uio *uio, if (!kernacc((caddr_t)(int)uio->uio_offset, c, uio->uio_rw == UIO_READ ? VM_PROT_READ : VM_PROT_WRITE)) -#ifdef ARM_USE_SMALL_ALLOC - if (addr <= VM_MAXUSER_ADDRESS || - addr >= KERNBASE) -#endif return (EFAULT); error = uiomove((caddr_t)(int)uio->uio_offset, (int)c, uio); continue; Modified: stable/10/sys/arm/arm/pmap.c ============================================================================== --- stable/10/sys/arm/arm/pmap.c Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/arm/pmap.c Thu May 15 19:09:31 2014 (r266175) @@ -1069,9 +1069,7 @@ pmap_l2ptp_ctor(void *mem, int size, voi #ifndef PMAP_INCLUDE_PTE_SYNC struct l2_bucket *l2b; pt_entry_t *ptep, pte; -#ifdef ARM_USE_SMALL_ALLOC - pd_entry_t *pde; -#endif + vm_offset_t va = (vm_offset_t)mem & ~PAGE_MASK; /* @@ -1082,10 +1080,6 @@ pmap_l2ptp_ctor(void *mem, int size, voi * page tables, we simply fix up the cache-mode here if it's not * correct. */ -#ifdef ARM_USE_SMALL_ALLOC - pde = &kernel_pmap->pm_l1->l1_kva[L1_IDX(va)]; - if (!l1pte_section_p(*pde)) { -#endif l2b = pmap_get_l2_bucket(pmap_kernel(), va); ptep = &l2b->l2b_kva[l2pte_index(va)]; pte = *ptep; @@ -1100,9 +1094,6 @@ pmap_l2ptp_ctor(void *mem, int size, voi cpu_tlb_flushD_SE(va); cpu_cpwait(); } -#ifdef ARM_USE_SMALL_ALLOC - } -#endif #endif memset(mem, 0, L2_TABLE_SIZE_REAL); PTE_SYNC_RANGE(mem, L2_TABLE_SIZE_REAL / sizeof(pt_entry_t)); @@ -2259,10 +2250,6 @@ pmap_alloc_specials(vm_offset_t *availp, * (physical) address starting relative to 0] */ #define PMAP_STATIC_L2_SIZE 16 -#ifdef ARM_USE_SMALL_ALLOC -extern struct mtx smallalloc_mtx; -#endif - void pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt) { @@ -2425,10 +2412,6 @@ pmap_bootstrap(vm_offset_t firstaddr, st kernel_vm_end = pmap_curmaxkvaddr; mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); -#ifdef ARM_USE_SMALL_ALLOC - mtx_init(&smallalloc_mtx, "Small alloc page list", NULL, MTX_DEF); - arm_init_smallalloc(); -#endif pmap_set_pcb_pagedir(kernel_pmap, thread0.td_pcb); } @@ -2672,11 +2655,7 @@ pmap_remove_pages(pmap_t pmap) KASSERT(l2b != NULL, ("No L2 bucket in pmap_remove_pages")); pt = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; m = PHYS_TO_VM_PAGE(*pt & L2_ADDR_MASK); -#ifdef ARM_USE_SMALL_ALLOC - KASSERT((vm_offset_t)m >= alloc_firstaddr, ("Trying to access non-existent page va %x pte %x", pv->pv_va, *pt)); -#else KASSERT((vm_offset_t)m >= KERNBASE, ("Trying to access non-existent page va %x pte %x", pv->pv_va, *pt)); -#endif *pt = 0; PTE_SYNC(pt); npv = TAILQ_NEXT(pv, pv_plist); @@ -2935,9 +2914,6 @@ pmap_kremove(vm_offset_t va) vm_offset_t pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot) { -#ifdef ARM_USE_SMALL_ALLOC - return (arm_ptovirt(start)); -#else vm_offset_t sva = *virt; vm_offset_t va = sva; @@ -2952,7 +2928,6 @@ pmap_map(vm_offset_t *virt, vm_offset_t } *virt = va; return (sva); -#endif } static void @@ -4010,27 +3985,11 @@ pmap_remove(pmap_t pm, vm_offset_t sva, void pmap_zero_page_generic(vm_paddr_t phys, int off, int size) { -#ifdef ARM_USE_SMALL_ALLOC - char *dstpg; -#endif if (_arm_bzero && size >= _min_bzero_size && _arm_bzero((void *)(phys + off), size, IS_PHYSICAL) == 0) return; -#ifdef ARM_USE_SMALL_ALLOC - dstpg = (char *)arm_ptovirt(phys); - if (off || size != PAGE_SIZE) { - bzero(dstpg + off, size); - cpu_dcache_wbinv_range((vm_offset_t)(dstpg + off), size); - cpu_l2cache_wbinv_range((vm_offset_t)(dstpg + off), size); - } else { - bzero_page((vm_offset_t)dstpg); - cpu_dcache_wbinv_range((vm_offset_t)dstpg, PAGE_SIZE); - cpu_l2cache_wbinv_range((vm_offset_t)dstpg, PAGE_SIZE); - } -#else - mtx_lock(&cmtx); /* * Hook in the page, zero it, invalidate the TLB as needed. @@ -4048,7 +4007,6 @@ pmap_zero_page_generic(vm_paddr_t phys, bzero_page(cdstp); mtx_unlock(&cmtx); -#endif } #endif /* (ARM_MMU_GENERIC + ARM_MMU_SA1) != 0 */ @@ -4056,23 +4014,11 @@ pmap_zero_page_generic(vm_paddr_t phys, void pmap_zero_page_xscale(vm_paddr_t phys, int off, int size) { -#ifdef ARM_USE_SMALL_ALLOC - char *dstpg; -#endif if (_arm_bzero && size >= _min_bzero_size && _arm_bzero((void *)(phys + off), size, IS_PHYSICAL) == 0) return; -#ifdef ARM_USE_SMALL_ALLOC - dstpg = (char *)arm_ptovirt(phys); - if (off || size != PAGE_SIZE) { - bzero(dstpg + off, size); - cpu_dcache_wbinv_range((vm_offset_t)(dstpg + off), size); - } else { - bzero_page((vm_offset_t)dstpg); - cpu_dcache_wbinv_range((vm_offset_t)dstpg, PAGE_SIZE); - } -#else + mtx_lock(&cmtx); /* * Hook in the page, zero it, and purge the cache for that @@ -4090,7 +4036,6 @@ pmap_zero_page_xscale(vm_paddr_t phys, i bzero_page(cdstp); mtx_unlock(&cmtx); xscale_cache_clean_minidata(); -#endif } /* @@ -4415,9 +4360,6 @@ pmap_copy_page_offs_xscale(vm_paddr_t a_ void pmap_copy_page(vm_page_t src, vm_page_t dst) { -#ifdef ARM_USE_SMALL_ALLOC - vm_offset_t srcpg, dstpg; -#endif cpu_dcache_wbinv_all(); cpu_l2cache_wbinv_all(); @@ -4425,15 +4367,7 @@ pmap_copy_page(vm_page_t src, vm_page_t _arm_memcpy((void *)VM_PAGE_TO_PHYS(dst), (void *)VM_PAGE_TO_PHYS(src), PAGE_SIZE, IS_PHYSICAL) == 0) return; -#ifdef ARM_USE_SMALL_ALLOC - srcpg = arm_ptovirt(VM_PAGE_TO_PHYS(src)); - dstpg = arm_ptovirt(VM_PAGE_TO_PHYS(dst)); - bcopy_page(srcpg, dstpg); - cpu_dcache_wbinv_range(dstpg, PAGE_SIZE); - cpu_l2cache_wbinv_range(dstpg, PAGE_SIZE); -#else pmap_copy_page_func(VM_PAGE_TO_PHYS(src), VM_PAGE_TO_PHYS(dst)); -#endif } int unmapped_buf_allowed = 1; @@ -4445,9 +4379,6 @@ pmap_copy_pages(vm_page_t ma[], vm_offse vm_page_t a_pg, b_pg; vm_offset_t a_pg_offset, b_pg_offset; int cnt; -#ifdef ARM_USE_SMALL_ALLOC - vm_offset_t a_va, b_va; -#endif cpu_dcache_wbinv_all(); cpu_l2cache_wbinv_all(); @@ -4458,16 +4389,8 @@ pmap_copy_pages(vm_page_t ma[], vm_offse b_pg = mb[b_offset >> PAGE_SHIFT]; b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); -#ifdef ARM_USE_SMALL_ALLOC - a_va = arm_ptovirt(VM_PAGE_TO_PHYS(a_pg)) + a_pg_offset; - b_va = arm_ptovirt(VM_PAGE_TO_PHYS(b_pg)) + b_pg_offset; - bcopy((char *)a_va, (char *)b_va, cnt); - cpu_dcache_wbinv_range(b_va, cnt); - cpu_l2cache_wbinv_range(b_va, cnt); -#else pmap_copy_page_offs_func(VM_PAGE_TO_PHYS(a_pg), a_pg_offset, VM_PAGE_TO_PHYS(b_pg), b_pg_offset, cnt); -#endif xfersize -= cnt; a_offset += cnt; b_offset += cnt; Modified: stable/10/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/10/sys/arm/arm/vm_machdep.c Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/arm/vm_machdep.c Thu May 15 19:09:31 2014 (r266175) @@ -82,8 +82,6 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct switchframe) == 24); CTASSERT(sizeof(struct trapframe) == 80); -#ifndef ARM_USE_SMALL_ALLOC - #ifndef NSFBUFS #define NSFBUFS (512 + maxusers * 16) #endif @@ -119,7 +117,6 @@ static u_int sf_buf_alloc_want; * A lock used to synchronize access to the hash table and free list */ static struct mtx sf_buf_lock; -#endif /* !ARM_USE_SMALL_ALLOC */ /* * Finish a fork operation, with process p2 nearly set up. @@ -191,7 +188,7 @@ cpu_thread_swapout(struct thread *td) void sf_buf_free(struct sf_buf *sf) { -#ifndef ARM_USE_SMALL_ALLOC + mtx_lock(&sf_buf_lock); sf->ref_count--; if (sf->ref_count == 0) { @@ -204,10 +201,8 @@ sf_buf_free(struct sf_buf *sf) wakeup(&sf_buf_freelist); } mtx_unlock(&sf_buf_lock); -#endif } -#ifndef ARM_USE_SMALL_ALLOC /* * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) */ @@ -233,7 +228,6 @@ sf_buf_init(void *arg) sf_buf_alloc_want = 0; mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); } -#endif /* * Get an sf_buf from the freelist. Will block if none are available. @@ -241,9 +235,6 @@ sf_buf_init(void *arg) struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags) { -#ifdef ARM_USE_SMALL_ALLOC - return ((struct sf_buf *)m); -#else struct sf_head *hash_list; struct sf_buf *sf; int error; @@ -289,7 +280,6 @@ sf_buf_alloc(struct vm_page *m, int flag done: mtx_unlock(&sf_buf_lock); return (sf); -#endif } void @@ -492,194 +482,3 @@ cpu_exit(struct thread *td) { } -#ifdef ARM_USE_SMALL_ALLOC - -static TAILQ_HEAD(,arm_small_page) pages_normal = - TAILQ_HEAD_INITIALIZER(pages_normal); -static TAILQ_HEAD(,arm_small_page) pages_wt = - TAILQ_HEAD_INITIALIZER(pages_wt); -static TAILQ_HEAD(,arm_small_page) free_pgdesc = - TAILQ_HEAD_INITIALIZER(free_pgdesc); - -extern uma_zone_t l2zone; - -struct mtx smallalloc_mtx; - -vm_offset_t alloc_firstaddr; - -#ifdef ARM_HAVE_SUPERSECTIONS -#define S_FRAME L1_SUP_FRAME -#define S_SIZE L1_SUP_SIZE -#else -#define S_FRAME L1_S_FRAME -#define S_SIZE L1_S_SIZE -#endif - -vm_offset_t -arm_ptovirt(vm_paddr_t pa) -{ - int i; - vm_offset_t addr = alloc_firstaddr; - - KASSERT(alloc_firstaddr != 0, ("arm_ptovirt called too early ?")); - for (i = 0; dump_avail[i + 1]; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) - break; - addr += (dump_avail[i + 1] & S_FRAME) + S_SIZE - - (dump_avail[i] & S_FRAME); - } - KASSERT(dump_avail[i + 1] != 0, ("Trying to access invalid physical address")); - return (addr + (pa - (dump_avail[i] & S_FRAME))); -} - -void -arm_init_smallalloc(void) -{ - vm_offset_t to_map = 0, mapaddr; - int i; - - /* - * We need to use dump_avail and not phys_avail, since we want to - * map the whole memory and not just the memory available to the VM - * to be able to do a pa => va association for any address. - */ - - for (i = 0; dump_avail[i + 1]; i+= 2) { - to_map += (dump_avail[i + 1] & S_FRAME) + S_SIZE - - (dump_avail[i] & S_FRAME); - } - alloc_firstaddr = mapaddr = KERNBASE - to_map; - for (i = 0; dump_avail[i + 1]; i+= 2) { - vm_offset_t size = (dump_avail[i + 1] & S_FRAME) + - S_SIZE - (dump_avail[i] & S_FRAME); - vm_offset_t did = 0; - while (size > 0) { -#ifdef ARM_HAVE_SUPERSECTIONS - pmap_kenter_supersection(mapaddr, - (dump_avail[i] & L1_SUP_FRAME) + did, - SECTION_CACHE); -#else - pmap_kenter_section(mapaddr, - (dump_avail[i] & L1_S_FRAME) + did, SECTION_CACHE); -#endif - mapaddr += S_SIZE; - did += S_SIZE; - size -= S_SIZE; - } - } -} - -void -arm_add_smallalloc_pages(void *list, void *mem, int bytes, int pagetable) -{ - struct arm_small_page *pg; - - bytes &= ~PAGE_MASK; - while (bytes > 0) { - pg = (struct arm_small_page *)list; - pg->addr = mem; - if (pagetable) - TAILQ_INSERT_HEAD(&pages_wt, pg, pg_list); - else - TAILQ_INSERT_HEAD(&pages_normal, pg, pg_list); - list = (char *)list + sizeof(*pg); - mem = (char *)mem + PAGE_SIZE; - bytes -= PAGE_SIZE; - } -} - -void * -uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) -{ - void *ret; - struct arm_small_page *sp; - TAILQ_HEAD(,arm_small_page) *head; - vm_page_t m; - - *flags = UMA_SLAB_PRIV; - /* - * For CPUs where we setup page tables as write back, there's no - * need to maintain two separate pools. - */ - if (zone == l2zone && pte_l1_s_cache_mode != pte_l1_s_cache_mode_pt) - head = (void *)&pages_wt; - else - head = (void *)&pages_normal; - - mtx_lock(&smallalloc_mtx); - sp = TAILQ_FIRST(head); - - if (!sp) { - int pflags; - - mtx_unlock(&smallalloc_mtx); - if (zone == l2zone && - pte_l1_s_cache_mode != pte_l1_s_cache_mode_pt) { - *flags = UMA_SLAB_KMEM; - ret = ((void *)kmem_malloc(kmem_arena, bytes, - M_NOWAIT)); - return (ret); - } - pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - VM_WAIT; - } else - break; - } - ret = (void *)arm_ptovirt(VM_PAGE_TO_PHYS(m)); - if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) - bzero(ret, PAGE_SIZE); - return (ret); - } - TAILQ_REMOVE(head, sp, pg_list); - TAILQ_INSERT_HEAD(&free_pgdesc, sp, pg_list); - ret = sp->addr; - mtx_unlock(&smallalloc_mtx); - if ((wait & M_ZERO)) - bzero(ret, bytes); - return (ret); -} - -void -uma_small_free(void *mem, int size, u_int8_t flags) -{ - pd_entry_t *pd; - pt_entry_t *pt; - - if (flags & UMA_SLAB_KMEM) - kmem_free(kmem_arena, (vm_offset_t)mem, size); - else { - struct arm_small_page *sp; - - if ((vm_offset_t)mem >= KERNBASE) { - mtx_lock(&smallalloc_mtx); - sp = TAILQ_FIRST(&free_pgdesc); - KASSERT(sp != NULL, ("No more free page descriptor ?")); - TAILQ_REMOVE(&free_pgdesc, sp, pg_list); - sp->addr = mem; - pmap_get_pde_pte(kernel_pmap, (vm_offset_t)mem, &pd, - &pt); - if ((*pd & pte_l1_s_cache_mask) == - pte_l1_s_cache_mode_pt && - pte_l1_s_cache_mode_pt != pte_l1_s_cache_mode) - TAILQ_INSERT_HEAD(&pages_wt, sp, pg_list); - else - TAILQ_INSERT_HEAD(&pages_normal, sp, pg_list); - mtx_unlock(&smallalloc_mtx); - } else { - vm_page_t m; - vm_paddr_t pa = vtophys((vm_offset_t)mem); - - m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; - vm_page_free(m); - atomic_subtract_int(&cnt.v_wire_count, 1); - } - } -} - -#endif Modified: stable/10/sys/arm/conf/AVILA ============================================================================== --- stable/10/sys/arm/conf/AVILA Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/conf/AVILA Thu May 15 19:09:31 2014 (r266175) @@ -24,7 +24,6 @@ include "../xscale/ixp425/std.ixp425" # NB: memory mapping is defined in std.avila include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE -#options ARM_USE_SMALL_ALLOC #To statically compile in device wiring instead of /boot/device.hints hints "AVILA.hints" #Default places to look for devices. makeoptions MODULES_OVERRIDE="" Modified: stable/10/sys/arm/conf/CAMBRIA ============================================================================== --- stable/10/sys/arm/conf/CAMBRIA Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/conf/CAMBRIA Thu May 15 19:09:31 2014 (r266175) @@ -24,7 +24,6 @@ include "../xscale/ixp425/std.ixp435" # NB: memory mapping is defined in std.avila include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE -#options ARM_USE_SMALL_ALLOC #To statically compile in device wiring instead of /boot/device.hints hints "CAMBRIA.hints" # Default places to look for devices. Modified: stable/10/sys/arm/conf/CNS11XXNAS ============================================================================== --- stable/10/sys/arm/conf/CNS11XXNAS Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/conf/CNS11XXNAS Thu May 15 19:09:31 2014 (r266175) @@ -102,7 +102,6 @@ device loop device md device random # Entropy device -#options ARM_USE_SMALL_ALLOC device usb #options USB_DEBUG Modified: stable/10/sys/arm/conf/CRB ============================================================================== --- stable/10/sys/arm/conf/CRB Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/conf/CRB Thu May 15 19:09:31 2014 (r266175) @@ -106,6 +106,5 @@ device md device random # Entropy device device iopwdog -options ARM_USE_SMALL_ALLOC # Floppy drives Modified: stable/10/sys/arm/conf/EP80219 ============================================================================== --- stable/10/sys/arm/conf/EP80219 Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/conf/EP80219 Thu May 15 19:09:31 2014 (r266175) @@ -101,7 +101,6 @@ options XSCALE_CACHE_READ_WRITE_ALLOCAT device md device random # Entropy device -options ARM_USE_SMALL_ALLOC # Floppy drives options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/10/sys/arm/conf/IQ31244 ============================================================================== --- stable/10/sys/arm/conf/IQ31244 Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/conf/IQ31244 Thu May 15 19:09:31 2014 (r266175) @@ -106,6 +106,5 @@ options XSCALE_CACHE_READ_WRITE_ALLOCAT device md device random # Entropy device -options ARM_USE_SMALL_ALLOC # Floppy drives Modified: stable/10/sys/arm/conf/NSLU ============================================================================== --- stable/10/sys/arm/conf/NSLU Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/conf/NSLU Thu May 15 19:09:31 2014 (r266175) @@ -105,8 +105,6 @@ device loop device md device random # Entropy device -#options ARM_USE_SMALL_ALLOC - device usb options USB_DEBUG device ohci Modified: stable/10/sys/arm/include/pmap.h ============================================================================== --- stable/10/sys/arm/include/pmap.h Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/include/pmap.h Thu May 15 19:09:31 2014 (r266175) @@ -708,17 +708,6 @@ extern char *_tmppt; void pmap_postinit(void); -#ifdef ARM_USE_SMALL_ALLOC -void arm_add_smallalloc_pages(void *, void *, int, int); -vm_offset_t arm_ptovirt(vm_paddr_t); -void arm_init_smallalloc(void); -struct arm_small_page { - void *addr; - TAILQ_ENTRY(arm_small_page) pg_list; -}; - -#endif - extern vm_paddr_t dump_avail[]; #endif /* _KERNEL */ Modified: stable/10/sys/arm/include/sf_buf.h ============================================================================== --- stable/10/sys/arm/include/sf_buf.h Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/include/sf_buf.h Thu May 15 19:09:31 2014 (r266175) @@ -29,33 +29,10 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ +#include struct vm_page; -#ifdef ARM_USE_SMALL_ALLOC - -#include -#include -#include - -struct sf_buf; - -static __inline vm_offset_t -sf_buf_kva(struct sf_buf *sf) -{ - return arm_ptovirt(VM_PAGE_TO_PHYS((vm_page_t)sf)); -} - -static __inline vm_page_t -sf_buf_page(struct sf_buf *sf) -{ - return ((vm_page_t)sf); -} - -#else - -#include - struct sf_buf { LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ @@ -78,8 +55,6 @@ sf_buf_page(struct sf_buf *sf) return (sf->m); } -#endif - struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); void sf_buf_free(struct sf_buf *sf); Modified: stable/10/sys/arm/include/vmparam.h ============================================================================== --- stable/10/sys/arm/include/vmparam.h Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/include/vmparam.h Thu May 15 19:09:31 2014 (r266175) @@ -82,15 +82,15 @@ #define VM_PHYSSEG_DENSE /* - * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool - * from which physical pages are allocated and VM_FREEPOOL_DIRECT is - * the pool from which physical pages for small UMA objects are - * allocated. + * Create two free page pools. Since the ARM kernel virtual address + * space does not include a mapping onto the machine's entire physical + * memory, VM_FREEPOOL_DIRECT is defined as an alias for the default + * pool, VM_FREEPOOL_DEFAULT. */ -#define VM_NFREEPOOL 3 -#define VM_FREEPOOL_CACHE 2 +#define VM_NFREEPOOL 2 +#define VM_FREEPOOL_CACHE 1 #define VM_FREEPOOL_DEFAULT 0 -#define VM_FREEPOOL_DIRECT 1 +#define VM_FREEPOOL_DIRECT 0 /* * we support 2 free lists: @@ -126,23 +126,9 @@ #define UPT_MIN_ADDRESS VADDR(UPTPTDI, 0) #define VM_MIN_ADDRESS (0x00001000) -#ifdef ARM_USE_SMALL_ALLOC -/* - * ARM_KERN_DIRECTMAP is used to make sure there's enough space between - * VM_MAXUSER_ADDRESS and KERNBASE to map the whole memory. - * It has to be a compile-time constant, even if arm_init_smallalloc(), - * which will do the mapping, gets the real amount of memory at runtime, - * because VM_MAXUSER_ADDRESS is a constant. - */ -#ifndef ARM_KERN_DIRECTMAP -#define ARM_KERN_DIRECTMAP 512 * 1024 * 1024 /* 512 MB */ -#endif -#define VM_MAXUSER_ADDRESS KERNBASE - ARM_KERN_DIRECTMAP -#else /* ARM_USE_SMALL_ALLOC */ #ifndef VM_MAXUSER_ADDRESS #define VM_MAXUSER_ADDRESS KERNBASE #endif /* VM_MAXUSER_ADDRESS */ -#endif /* ARM_USE_SMALL_ALLOC */ #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS #define USRSTACK VM_MAXUSER_ADDRESS @@ -176,10 +162,6 @@ VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) #endif -#ifdef ARM_USE_SMALL_ALLOC -#define UMA_MD_SMALL_ALLOC -#endif /* ARM_USE_SMALL_ALLOC */ - extern vm_offset_t vm_max_kernel_address; #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ Modified: stable/10/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i80321/ep80219_machdep.c Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/xscale/i80321/ep80219_machdep.c Thu May 15 19:09:31 2014 (r266175) @@ -231,21 +231,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0xa0100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0100000, freemem_pt - 0xa0100000, 1); - freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0); - - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Allocate memory for the l1 and l2 page tables. The scheme to avoid * wasting memory by allocating the l1pt on the first 16k memory was @@ -285,15 +270,6 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif - /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, minidataclean.pv_pa); @@ -359,10 +335,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ dump_avail[0] = 0xa0000000; dump_avail[1] = 0xa0000000 + memsize; dump_avail[2] = 0; @@ -375,13 +347,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0xa0000000; - phys_avail[i++] = 0xa0001000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + IQ80321_SDRAM_START); phys_avail[i++] = trunc_page(0xa0000000 + memsize - 1); phys_avail[i++] = 0; Modified: stable/10/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i80321/iq31244_machdep.c Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/xscale/i80321/iq31244_machdep.c Thu May 15 19:09:31 2014 (r266175) @@ -232,21 +232,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0xa0100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0100000, freemem_pt - 0xa0100000, 1); - freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0); - - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Allocate memory for the l1 and l2 page tables. The scheme to avoid * wasting memory by allocating the l1pt on the first 16k memory was @@ -286,15 +271,6 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif - /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, minidataclean.pv_pa); @@ -360,10 +336,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ dump_avail[0] = 0xa0000000; dump_avail[1] = 0xa0000000 + memsize; dump_avail[2] = 0; @@ -376,13 +348,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0xa0000000; - phys_avail[i++] = 0xa0001000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + SDRAM_START); phys_avail[i++] = trunc_page(0xa0000000 + memsize - 1); phys_avail[i++] = 0; Modified: stable/10/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i8134x/crb_machdep.c Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/xscale/i8134x/crb_machdep.c Thu May 15 19:09:31 2014 (r266175) @@ -230,22 +230,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0x00100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0xc0000000) - , (void *)0xc0100000, freemem_pt - 0x00100000, 1); - freemem_after -= ((freemem_after - 0x00001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); -#if 0 - arm_add_smallalloc_pages((void *)(freemem_after + 0xc0000000) - , (void *)0xc0001000, trunc_page(freemem_after) - 0x00001000, 0); -#endif - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Now we start construction of the L1 page table * We start by mapping the L2 page tables into the L1. @@ -274,15 +258,6 @@ initarm(struct arm_boot_params *abp) } -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif - /* Map the vector page. */ pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); @@ -338,10 +313,7 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ + dump_avail[0] = 0x00000000; dump_avail[1] = 0x00000000 + memsize; dump_avail[2] = 0; @@ -354,13 +326,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0x00001000; - phys_avail[i++] = 0x00002000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + SDRAM_START); phys_avail[i++] = trunc_page(0x00000000 + memsize - 1); phys_avail[i++] = 0; Modified: stable/10/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/avila_machdep.c Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/xscale/ixp425/avila_machdep.c Thu May 15 19:09:31 2014 (r266175) @@ -301,24 +301,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - (PHYSADDR + 0x100000)) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages( - (void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR)), - (void *)0xc0100000, - freemem_pt - (PHYSADDR + 0x100000), 1); - freemem_after -= ((freemem_after - (PHYSADDR + 0x1000)) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages( - (void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR)), - (void *)0xc0001000, - trunc_page(freemem_after) - (PHYSADDR + 0x1000), 0); - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Now construct the L1 page table. First map the L2 @@ -354,14 +336,6 @@ initarm(struct arm_boot_params *abp) pmap_map_entry(l1pagetable, afterkern, minidataclean.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, @@ -442,13 +416,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = PHYSADDR; - phys_avail[i++] = PHYSADDR + PAGE_SIZE; /* - *XXX: Gross hack to get our - * pages in the vm_page_array. - */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + PHYSADDR); phys_avail[i++] = trunc_page(PHYSADDR + memsize - 1); phys_avail[i++] = 0; Modified: stable/10/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/pxa/pxa_machdep.c Thu May 15 18:53:02 2014 (r266174) +++ stable/10/sys/arm/xscale/pxa/pxa_machdep.c Thu May 15 19:09:31 2014 (r266175) @@ -213,20 +213,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0xa0100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000) - , (void *)0xc0100000, freemem_pt - 0xa0100000, 1); - freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000) - , (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0); - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Allocate memory for the l1 and l2 page tables. The scheme to avoid * wasting memory by allocating the l1pt on the first 16k memory was @@ -267,13 +253,6 @@ initarm(struct arm_boot_params *abp) pmap_map_entry(l1pagetable, afterkern, minidataclean.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - } -#endif /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, @@ -350,10 +329,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ i = 0; for (j = 0; j < PXA2X0_SDRAM_BANKS; j++) { if (memsize[j] > 0) { @@ -371,13 +346,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0xa0000000; - phys_avail[i++] = 0xa0001000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 19:28:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C7EE8117; Thu, 15 May 2014 19:28: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 B4E322AEE; Thu, 15 May 2014 19:28: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 s4FJSqsh060676; Thu, 15 May 2014 19:28:52 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FJSqF5060675; Thu, 15 May 2014 19:28:52 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405151928.s4FJSqF5060675@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 19:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266178 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 19:28:52 -0000 Author: ian Date: Thu May 15 19:28:52 2014 New Revision: 266178 URL: http://svnweb.freebsd.org/changeset/base/266178 Log: MFC r256672 If we avoid to use the page at addr 0, we should adjust the size to reflect it. Modified: stable/10/sys/arm/arm/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Thu May 15 19:26:20 2014 (r266177) +++ stable/10/sys/arm/arm/machdep.c Thu May 15 19:28:52 2014 (r266178) @@ -1169,11 +1169,15 @@ physmap_init(struct mem_region *availmem */ if (availmem_regions[i].mr_start > 0 || availmem_regions[i].mr_size > PAGE_SIZE) { + vm_size_t size; phys_avail[j] = availmem_regions[i].mr_start; - if (phys_avail[j] == 0) + + size = availmem_regions[i].mr_size; + if (phys_avail[j] == 0) { phys_avail[j] += PAGE_SIZE; - phys_avail[j + 1] = availmem_regions[i].mr_start + - availmem_regions[i].mr_size; + size -= PAGE_SIZE; + } + phys_avail[j + 1] = availmem_regions[i].mr_start + size; } else j -= 2; } From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 20:58:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4E059928; Thu, 15 May 2014 20:58: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 374B92305; Thu, 15 May 2014 20:58: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 s4FKwQxM001371; Thu, 15 May 2014 20:58:26 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FKwNUh001355; Thu, 15 May 2014 20:58:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405152058.s4FKwNUh001355@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 20:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266194 - in stable/10/sys: arm/arm arm/at91 arm/conf arm/econa arm/include arm/s3c2xx0 arm/sa11x0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 20:58:26 -0000 Author: ian Date: Thu May 15 20:58:23 2014 New Revision: 266194 URL: http://svnweb.freebsd.org/changeset/base/266194 Log: MFC r261643, r261646, r261648, r261649, r261651, r261656, r261657, r261663, r261676, r261677, r261698, r261778 Consolidate code related to setting up physical memory configuration into a new physmem.c file. Replace compile-time constant KERNPHYSADDR with abp_physaddr Calculate the kernel's load address from the PC in the elf / gzip trampoline instead of relying on KERNPHYSADDR as a compile-time constant. It turns out a global variable is the only straightforward way to communicate the kernel's physical load address from where it's known in initarm() into cpu_mp_start() which is called from non-arm code and takes no parameters. Remove the now unused MMU_INIT macro. Use vm_paddr_t, not vm_offset_t, when dealing with physical addresses. No need to set physmem in each initarm() instance anymore, it's handled in common code now. Pass the pagetable used from locore.S to initarm to allow it to map data in as required. Fix the physmem exclude-region clipping logic for the edge-trim case. Add some extra debugging output when DEBUG is defined. Update legacy platforms to use new arm_physmem helper routines. Added: stable/10/sys/arm/arm/physmem.c - copied, changed from r261643, head/sys/arm/arm/physmem.c stable/10/sys/arm/include/physmem.h - copied, changed from r261643, head/sys/arm/include/physmem.h Modified: stable/10/sys/arm/arm/elf_trampoline.c stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/mp_machdep.c stable/10/sys/arm/at91/at91_machdep.c stable/10/sys/arm/conf/VYBRID.common stable/10/sys/arm/econa/econa_machdep.c stable/10/sys/arm/include/cpu.h stable/10/sys/arm/include/machdep.h stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c stable/10/sys/arm/sa11x0/assabet_machdep.c stable/10/sys/arm/xscale/i80321/ep80219_machdep.c stable/10/sys/arm/xscale/i80321/iq31244_machdep.c stable/10/sys/arm/xscale/i8134x/crb_machdep.c stable/10/sys/arm/xscale/ixp425/avila_machdep.c stable/10/sys/arm/xscale/pxa/pxa_machdep.c stable/10/sys/conf/files.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/elf_trampoline.c ============================================================================== --- stable/10/sys/arm/arm/elf_trampoline.c Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/arm/elf_trampoline.c Thu May 15 20:58:23 2014 (r266194) @@ -186,14 +186,20 @@ static void arm9_setup(void); void _startC(void) { - int physaddr = KERNPHYSADDR; int tmp1; unsigned int sp = ((unsigned int)&_end & ~3) + 4; -#if defined(FLASHADDR) && defined(PHYSADDR) && defined(LOADERRAMADDR) - unsigned int pc; + unsigned int pc, kernphysaddr; + /* + * Figure out the physical address the kernel was loaded at. This + * assumes the entry point (this code right here) is in the first page, + * which will always be the case for this trampoline code. + */ __asm __volatile("mov %0, pc\n" : "=r" (pc)); + kernphysaddr = pc & ~PAGE_MASK; + +#if defined(FLASHADDR) && defined(PHYSADDR) && defined(LOADERRAMADDR) if ((FLASHADDR > LOADERRAMADDR && pc >= FLASHADDR) || (FLASHADDR < LOADERRAMADDR && pc < LOADERRAMADDR)) { /* @@ -247,7 +253,7 @@ _startC(void) "mov pc, %0\n" "2: nop\n" "mov sp, %2\n" - : "=r" (tmp1), "+r" (physaddr), "+r" (sp)); + : "=r" (tmp1), "+r" (kernphysaddr), "+r" (sp)); #ifndef KZIP #ifdef CPU_ARM9 /* So that idcache_wbinv works; */ Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/arm/locore.S Thu May 15 20:58:23 2014 (r266194) @@ -221,7 +221,7 @@ mmu_done: ldr pc, .Lvirt_done virt_done: - mov r1, #24 /* loader info size is 24 bytes also second arg */ + mov r1, #28 /* loader info size is 28 bytes also second arg */ subs sp, sp, r1 /* allocate arm_boot_params struct on stack */ bic sp, sp, #7 /* align stack to 8 bytes */ mov r0, sp /* loader info pointer is first arg */ @@ -232,6 +232,8 @@ virt_done: str fp, [r0, #16] /* store r3 from boot loader */ ldr r5, =KERNPHYSADDR /* load KERNPHYSADDR as the physical address */ str r5, [r0, #20] /* store the physical address */ + ldr r5, Lstartup_pagetable + str r5, [r0, #24] /* store the pagetable address */ mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ @@ -277,11 +279,6 @@ build_pagetables: RET -#define MMU_INIT(va,pa,n_sec,attr) \ - .word n_sec ; \ - .word 4*((va)>>L1_S_SHIFT) ; \ - .word (pa)|(attr) ; - Lvirtaddr: .word KERNVIRTADDR Lphysaddr: Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/arm/machdep.c Thu May 15 20:58:23 2014 (r266194) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -122,8 +123,6 @@ uint32_t cpu_reset_address = 0; int cold = 1; vm_offset_t vector_page; -long realmem = 0; - int (*_arm_memcpy)(void *, void *, int, int) = NULL; int (*_arm_bzero)(void *, int, int) = NULL; int _min_memcpy_size = 0; @@ -144,9 +143,6 @@ extern vm_offset_t ksym_start, ksym_end; static struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -356,6 +352,7 @@ static void cpu_startup(void *dummy) { struct pcb *pcb = thread0.td_pcb; + const unsigned int mbyte = 1024 * 1024; #ifdef ARM_TP_ADDRESS #ifndef ARM_CACHE_LOCK_ENABLE vm_page_t m; @@ -364,36 +361,21 @@ cpu_startup(void *dummy) identify_arm_cpu(); - printf("real memory = %ju (%ju MB)\n", (uintmax_t)ptoa(physmem), - (uintmax_t)ptoa(physmem) / 1048576); - realmem = physmem; + vm_ksubmap_init(&kmi); /* * Display the RAM layout. */ - if (bootverbose) { - int indx; - - printf("Physical memory chunk(s):\n"); - for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { - vm_paddr_t size; - - size = phys_avail[indx + 1] - phys_avail[indx]; - printf(" 0x%08jx - 0x%08jx, %ju KBytes (%ju pages)\n", - (uintmax_t)phys_avail[indx], - (uintmax_t)phys_avail[indx + 1] - 1, - (uintmax_t)size / 1024, (uintmax_t)size / PAGE_SIZE); - } - } - - vm_ksubmap_init(&kmi); - + printf("real memory = %ju (%ju MB)\n", + (uintmax_t)arm32_ptob(realmem), + (uintmax_t)arm32_ptob(realmem) / mbyte); printf("avail memory = %ju (%ju MB)\n", - (uintmax_t)ptoa(cnt.v_free_count), - (uintmax_t)ptoa(cnt.v_free_count) / 1048576); - - if (bootverbose) + (uintmax_t)arm32_ptob(cnt.v_free_count), + (uintmax_t)arm32_ptob(cnt.v_free_count) / mbyte); + if (bootverbose) { + arm_physmem_print_tables(); arm_devmap_print_table(); + } bufinit(); vm_pager_bufferinit(); @@ -780,44 +762,6 @@ makectx(struct trapframe *tf, struct pcb } /* - * Make a standard dump_avail array. Can't make the phys_avail - * since we need to do that after we call pmap_bootstrap, but this - * is needed before pmap_boostrap. - */ -void -arm_dump_avail_init(vm_paddr_t physaddr, vm_offset_t ramsize, size_t max) -{ -#ifdef LINUX_BOOT_ABI - /* - * Linux boot loader passes us the actual banks of memory, so use them - * to construct the dump_avail array. - */ - if (membanks > 0) - { - int i, j; - - if (max < (membanks + 1) * 2) - panic("dump_avail[%d] too small for %d banks\n", - max, membanks); - for (j = 0, i = 0; i < membanks; i++) { - dump_avail[j++] = round_page(memstart[i]); - dump_avail[j++] = trunc_page(memstart[i] + memsize[i]); - } - dump_avail[j++] = 0; - dump_avail[j++] = 0; - return; - } -#endif - if (max < 4) - panic("dump_avail too small\n"); - - dump_avail[0] = round_page(physaddr); - dump_avail[1] = trunc_page(physaddr + ramsize); - dump_avail[2] = 0; - dump_avail[3] = 0; -} - -/* * Fake up a boot descriptor table */ vm_offset_t @@ -910,11 +854,8 @@ linux_parse_boot_param(struct arm_boot_p case ATAG_CORE: break; case ATAG_MEM: - if (membanks < LBABI_MAX_BANKS) { - memstart[membanks] = walker->u.tag_mem.start; - memsize[membanks] = walker->u.tag_mem.size; - } - membanks++; + arm_physmem_hardware_region(walker->u.tag_mem.start, + walker->u.tag_mem.size); break; case ATAG_INITRD2: break; @@ -1077,120 +1018,10 @@ print_kenv(void) debugf(" %x %s\n", (uint32_t)cp, cp); } -static void -physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz, - vm_offset_t kernload) -{ - int i, j, cnt; - vm_offset_t phys_kernelend; - uint32_t s, e, sz; - struct mem_region *mp, *mp1; - - phys_kernelend = kernload + (virtual_avail - KERNVIRTADDR); - - /* - * Remove kernel physical address range from avail - * regions list. Page align all regions. - * Non-page aligned memory isn't very interesting to us. - * Also, sort the entries for ascending addresses. - */ - sz = 0; - cnt = availmem_regions_sz; - debugf("processing avail regions:\n"); - for (mp = availmem_regions; mp->mr_size; mp++) { - s = mp->mr_start; - e = mp->mr_start + mp->mr_size; - debugf(" %08x-%08x -> ", s, e); - /* Check whether this region holds all of the kernel. */ - if (s < kernload && e > phys_kernelend) { - availmem_regions[cnt].mr_start = phys_kernelend; - availmem_regions[cnt++].mr_size = e - phys_kernelend; - e = kernload; - } - /* Look whether this regions starts within the kernel. */ - if (s >= kernload && s < phys_kernelend) { - if (e <= phys_kernelend) - goto empty; - s = phys_kernelend; - } - /* Now look whether this region ends within the kernel. */ - if (e > kernload && e <= phys_kernelend) { - if (s >= kernload) { - goto empty; - } - e = kernload; - } - /* Now page align the start and size of the region. */ - s = round_page(s); - e = trunc_page(e); - if (e < s) - e = s; - sz = e - s; - debugf("%08x-%08x = %x\n", s, e, sz); - - /* Check whether some memory is left here. */ - if (sz == 0) { - empty: - printf("skipping\n"); - bcopy(mp + 1, mp, - (cnt - (mp - availmem_regions)) * sizeof(*mp)); - cnt--; - mp--; - continue; - } - - /* Do an insertion sort. */ - for (mp1 = availmem_regions; mp1 < mp; mp1++) - if (s < mp1->mr_start) - break; - if (mp1 < mp) { - bcopy(mp1, mp1 + 1, (char *)mp - (char *)mp1); - mp1->mr_start = s; - mp1->mr_size = sz; - } else { - mp->mr_start = s; - mp->mr_size = sz; - } - } - availmem_regions_sz = cnt; - - /* Fill in phys_avail table, based on availmem_regions */ - debugf("fill in phys_avail:\n"); - for (i = 0, j = 0; i < availmem_regions_sz; i++, j += 2) { - - debugf(" region: 0x%08x - 0x%08x (0x%08x)\n", - availmem_regions[i].mr_start, - availmem_regions[i].mr_start + availmem_regions[i].mr_size, - availmem_regions[i].mr_size); - - /* - * We should not map the page at PA 0x0000000, the VM can't - * handle it, as pmap_extract() == 0 means failure. - */ - if (availmem_regions[i].mr_start > 0 || - availmem_regions[i].mr_size > PAGE_SIZE) { - vm_size_t size; - phys_avail[j] = availmem_regions[i].mr_start; - - size = availmem_regions[i].mr_size; - if (phys_avail[j] == 0) { - phys_avail[j] += PAGE_SIZE; - size -= PAGE_SIZE; - } - phys_avail[j + 1] = availmem_regions[i].mr_start + size; - } else - j -= 2; - } - phys_avail[j] = 0; - phys_avail[j + 1] = 0; -} - void * initarm(struct arm_boot_params *abp) { - struct mem_region memory_regions[FDT_MEM_REGIONS]; - struct mem_region availmem_regions[FDT_MEM_REGIONS]; - struct mem_region reserved_regions[FDT_MEM_REGIONS]; + struct mem_region mem_regions[FDT_MEM_REGIONS]; struct pv_addr kernel_l1pt; struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; @@ -1198,15 +1029,11 @@ initarm(struct arm_boot_params *abp) char *env; void *kmdp; u_int l1pagetable; - int i = 0, j = 0, err_devmap = 0; - int memory_regions_sz; - int availmem_regions_sz; - int reserved_regions_sz; - vm_offset_t start, end; - vm_offset_t rstart, rend; - int curr; + int i, j, err_devmap, mem_regions_sz; lastaddr = parse_boot_param(abp); + arm_physmem_kernaddr = abp->abp_physaddr; + memsize = 0; set_cpufuncs(); @@ -1235,72 +1062,14 @@ initarm(struct arm_boot_params *abp) while (1); /* Grab physical memory regions information from device tree. */ - if (fdt_get_mem_regions(memory_regions, &memory_regions_sz, - &memsize) != 0) - while(1); - - /* Grab physical memory regions information from device tree. */ - if (fdt_get_reserved_regions(reserved_regions, &reserved_regions_sz) != 0) - reserved_regions_sz = 0; - - /* - * Now exclude all the reserved regions - */ - curr = 0; - for (i = 0; i < memory_regions_sz; i++) { - start = memory_regions[i].mr_start; - end = start + memory_regions[i].mr_size; - for (j = 0; j < reserved_regions_sz; j++) { - rstart = reserved_regions[j].mr_start; - rend = rstart + reserved_regions[j].mr_size; - /* - * Restricted region is before available - * Skip restricted region - */ - if (rend <= start) - continue; - /* - * Restricted region is behind available - * No further processing required - */ - if (rstart >= end) - break; - /* - * Restricted region includes memory region - * skip available region - */ - if ((start >= rstart) && (rend >= end)) { - start = rend; - end = rend; - break; - } - /* - * Memory region includes restricted region - */ - if ((rstart > start) && (end > rend)) { - availmem_regions[curr].mr_start = start; - availmem_regions[curr++].mr_size = rstart - start; - start = rend; - break; - } - /* - * Memory region partially overlaps with restricted - */ - if ((rstart >= start) && (rstart <= end)) { - end = rstart; - } - else if ((rend >= start) && (rend <= end)) { - start = rend; - } - } - - if (end > start) { - availmem_regions[curr].mr_start = start; - availmem_regions[curr++].mr_size = end - start; - } - } - - availmem_regions_sz = curr; + if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, &memsize) != 0) + panic("Cannot get physical memory regions"); + arm_physmem_hardware_regions(mem_regions, mem_regions_sz); + + /* Grab reserved memory regions information from device tree. */ + if (fdt_get_reserved_regions(mem_regions, &mem_regions_sz) == 0) + arm_physmem_exclude_regions(mem_regions, mem_regions_sz, + EXFLAG_NODUMP | EXFLAG_NOALLOC); /* Platform-specific initialisation */ initarm_early_init(); @@ -1339,7 +1108,7 @@ initarm(struct arm_boot_params *abp) freemempos += PAGE_SIZE; valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); - for (i = 0; i < l2size; ++i) { + for (i = 0, j = 0; i < l2size; ++i) { if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { valloc_pages(kernel_pt_table[i], L2_TABLE_SIZE / PAGE_SIZE); @@ -1446,8 +1215,6 @@ initarm(struct arm_boot_params *abp) cninit(); - physmem = memsize / PAGE_SIZE; - debugf("initarm: console initialized\n"); debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp); debugf(" boothowto = 0x%08x\n", boothowto); @@ -1498,17 +1265,22 @@ initarm(struct arm_boot_params *abp) arm_intrnames_init(); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - arm_dump_avail_init(abp->abp_physaddr, memsize, - sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); /* - * Prepare map of physical memory regions available to vm subsystem. + * Exclude the kernel (and all the things we allocated which immediately + * follow the kernel) from the VM allocation pool but not from crash + * dumps. virtual_avail is a global variable which tracks the kva we've + * "allocated" while setting up pmaps. + * + * Prepare the list of physical memory available to the vm subsystem. */ - physmap_init(availmem_regions, availmem_regions_sz, abp->abp_physaddr); + arm_physmem_exclude_region(abp->abp_physaddr, + (virtual_avail - KERNVIRTADDR), EXFLAG_NOALLOC); + arm_physmem_init_kernel_globals(); init_param2(physmem); kdb_init(); Modified: stable/10/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/10/sys/arm/arm/mp_machdep.c Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/arm/mp_machdep.c Thu May 15 20:58:23 2014 (r266194) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef VFP @@ -120,16 +121,16 @@ cpu_mp_start(void) M_WAITOK | M_ZERO); temp_pagetable_va = (vm_offset_t)contigmalloc(L1_TABLE_SIZE, M_TEMP, 0, 0x0, 0xffffffff, L1_TABLE_SIZE, 0); - addr = KERNPHYSADDR; - addr_end = (vm_offset_t)&_end - KERNVIRTADDR + KERNPHYSADDR; + addr = arm_physmem_kernaddr; + addr_end = (vm_offset_t)&_end - KERNVIRTADDR + arm_physmem_kernaddr; addr_end &= ~L1_S_OFFSET; addr_end += L1_S_SIZE; bzero((void *)temp_pagetable_va, L1_TABLE_SIZE); - for (addr = KERNPHYSADDR; addr <= addr_end; addr += L1_S_SIZE) { + for (addr = arm_physmem_kernaddr; addr <= addr_end; addr += L1_S_SIZE) { ((int *)(temp_pagetable_va))[addr >> L1_S_SHIFT] = L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; ((int *)(temp_pagetable_va))[(addr - - KERNPHYSADDR + KERNVIRTADDR) >> L1_S_SHIFT] = + arm_physmem_kernaddr + KERNVIRTADDR) >> L1_S_SHIFT] = L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; } Copied and modified: stable/10/sys/arm/arm/physmem.c (from r261643, head/sys/arm/arm/physmem.c) ============================================================================== --- head/sys/arm/arm/physmem.c Sat Feb 8 23:54:16 2014 (r261643, copy source) +++ stable/10/sys/arm/arm/physmem.c Thu May 15 20:58:23 2014 (r266194) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #define MAX_EXCNT 10 struct region { - vm_offset_t addr; + vm_paddr_t addr; vm_size_t size; uint32_t flags; }; @@ -89,6 +89,9 @@ vm_paddr_t dump_avail[MAX_AVAIL_ENTRIES /* This is the total number of hardware pages, excluded or not. */ long realmem; +/* The address at which the kernel was loaded. Set early in initarm(). */ +vm_paddr_t arm_physmem_kernaddr; + /* * Print the contents of the physical and excluded region tables using the * provided printf-like output function (which will be either printf or @@ -119,6 +122,16 @@ physmem_dump_tables(int (*prfunc)(const (flags & EXFLAG_NOALLOC) ? "NoAlloc" : "", (flags & EXFLAG_NODUMP) ? "NoDump" : ""); } + +#ifdef DEBUG + prfunc("Avail lists:\n"); + for (i = 0; phys_avail[i] != 0; ++i) { + prfunc(" phys_avail[%d] 0x%08x\n", i, phys_avail[i]); + } + for (i = 0; dump_avail[i] != 0; ++i) { + prfunc(" dump_avail[%d] 0x%08x\n", i, dump_avail[i]); + } +#endif } /* @@ -195,14 +208,14 @@ regions_to_avail(vm_paddr_t *avail, uint continue; } /* - * If excluded region partially overlaps this region, - * trim the excluded portion off the appropriate end. + * We know the excluded region overlaps either the start + * or end of this hardware region (but not both), trim + * the excluded portion off the appropriate end. */ - if ((xstart >= start) && (xstart <= end)) { - end = xstart; - } else if ((xend >= start) && (xend <= end)) { + if (xstart <= start) start = xend; - } + else + end = xstart; } /* * If the trimming actions above left a non-zero size, create an @@ -224,7 +237,7 @@ regions_to_avail(vm_paddr_t *avail, uint * Insertion-sort a new entry into a regions list; sorted by start address. */ static void -insert_region(struct region *regions, size_t rcnt, vm_offset_t addr, +insert_region(struct region *regions, size_t rcnt, vm_paddr_t addr, vm_size_t size, uint32_t flags) { size_t i; @@ -246,7 +259,7 @@ insert_region(struct region *regions, si * Add a hardware memory region. */ void -arm_physmem_hardware_region(vm_offset_t pa, vm_size_t sz) +arm_physmem_hardware_region(vm_paddr_t pa, vm_size_t sz) { vm_offset_t adj; @@ -274,7 +287,7 @@ arm_physmem_hardware_region(vm_offset_t /* * Add an exclusion region. */ -void arm_physmem_exclude_region(vm_offset_t pa, vm_size_t sz, uint32_t exflags) +void arm_physmem_exclude_region(vm_paddr_t pa, vm_size_t sz, uint32_t exflags) { vm_offset_t adj; Modified: stable/10/sys/arm/at91/at91_machdep.c ============================================================================== --- stable/10/sys/arm/at91/at91_machdep.c Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/at91/at91_machdep.c Thu May 15 20:58:23 2014 (r266194) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -199,9 +200,6 @@ const struct arm_devmap_entry at91_devma /* Physical and virtual addresses for some global pages */ -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; - struct pv_addr systempage; struct pv_addr msgbufpv; struct pv_addr irqstack; @@ -463,6 +461,7 @@ initarm(struct arm_boot_params *abp) vm_offset_t lastaddr; lastaddr = parse_boot_param(abp); + arm_physmem_kernaddr = abp->abp_physaddr; set_cpufuncs(); pcpu0_init(); @@ -473,7 +472,7 @@ initarm(struct arm_boot_params *abp) /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ alloc_pages((var).pv_va, (np)); \ - (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); + (var).pv_pa = (var).pv_va + (abp->abp_physaddr - KERNVIRTADDR); #define alloc_pages(var, np) \ (var) = freemempos; \ @@ -493,7 +492,7 @@ initarm(struct arm_boot_params *abp) L2_TABLE_SIZE_REAL; kernel_pt_table[i].pv_pa = kernel_pt_table[i].pv_va - KERNVIRTADDR + - KERNPHYSADDR; + abp->abp_physaddr; } } /* @@ -591,7 +590,6 @@ initarm(struct arm_boot_params *abp) printf("Warning: No soc support for %s found.\n", soc_info.name); memsize = board_init(); - physmem = memsize / PAGE_SIZE; /* * Pages were allocated during the secondary bootstrap for the @@ -630,8 +628,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + L1_S_SIZE * (KERNEL_PT_KERN_NUM - 1); - arm_dump_avail_init(abp->abp_physaddr, memsize, - sizeof(dump_avail)/sizeof(dump_avail[0])); /* Always use the 256MB of KVA we have available between the kernel and devices */ vm_max_kernel_address = KERNVIRTADDR + (256 << 20); pmap_bootstrap(freemempos, &kernel_l1pt); @@ -639,15 +635,21 @@ initarm(struct arm_boot_params *abp) msgbufinit(msgbufp, msgbufsize); mutex_init(); - i = 0; -#if PHYSADDR != KERNPHYSADDR - phys_avail[i++] = PHYSADDR; - phys_avail[i++] = KERNPHYSADDR; -#endif - phys_avail[i++] = virtual_avail - KERNVIRTADDR + KERNPHYSADDR; - phys_avail[i++] = PHYSADDR + memsize; - phys_avail[i++] = 0; - phys_avail[i++] = 0; + /* + * Add the physical ram we have available. + * + * Exclude the kernel, and all the things we allocated which immediately + * follow the kernel, from the VM allocation pool but not from crash + * dumps. virtual_avail is a global variable which tracks the kva we've + * "allocated" while setting up pmaps. + * + * Prepare the list of physical memory available to the vm subsystem. + */ + arm_physmem_hardware_region(PHYSADDR, memsize); + arm_physmem_exclude_region(abp->abp_physaddr, + virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); + arm_physmem_init_kernel_globals(); + init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - Modified: stable/10/sys/arm/conf/VYBRID.common ============================================================================== --- stable/10/sys/arm/conf/VYBRID.common Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/conf/VYBRID.common Thu May 15 20:58:23 2014 (r266194) @@ -61,11 +61,11 @@ options BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT #Enable verbose sysinit messages options KDB options DDB #Enable the kernel debugger -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options INVARIANTS #Enable calls of extra sanity checking +#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -options DIAGNOSTIC +#options DIAGNOSTIC # NFS support options NFSCL #Network Filesystem Client Modified: stable/10/sys/arm/econa/econa_machdep.c ============================================================================== --- stable/10/sys/arm/econa/econa_machdep.c Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/econa/econa_machdep.c Thu May 15 20:58:23 2014 (r266194) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -98,9 +99,6 @@ struct pv_addr kernel_pt_table[NUM_KERNE /* Physical and virtual addresses for some global pages */ -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; - struct pv_addr systempage; struct pv_addr msgbufpv; struct pv_addr irqstack; @@ -180,6 +178,7 @@ initarm(struct arm_boot_params *abp) boothowto = RB_VERBOSE; lastaddr = parse_boot_param(abp); + arm_physmem_kernaddr = abp->abp_physaddr; set_cpufuncs(); pcpu0_init(); @@ -191,7 +190,7 @@ initarm(struct arm_boot_params *abp) /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ alloc_pages((var).pv_va, (np)); \ - (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); + (var).pv_pa = (var).pv_va + (abp->abp_physaddr - KERNVIRTADDR); #define alloc_pages(var, np) \ (var) = freemempos; \ @@ -211,7 +210,7 @@ initarm(struct arm_boot_params *abp) L2_TABLE_SIZE_REAL; kernel_pt_table[loop].pv_pa = kernel_pt_table[loop].pv_va - KERNVIRTADDR + - KERNPHYSADDR; + abp->abp_physaddr; } } /* @@ -284,7 +283,6 @@ initarm(struct arm_boot_params *abp) cninit(); mem_info = ((*ddr) >> 4) & 0x3; memsize = (8<abp_physaddr, memsize, - sizeof(dump_avail) / sizeof(dump_avail[0])); vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; pmap_bootstrap(freemempos, &kernel_l1pt); @@ -332,16 +328,21 @@ initarm(struct arm_boot_params *abp) mutex_init(); - i = 0; -#if PHYSADDR != KERNPHYSADDR - phys_avail[i++] = PHYSADDR; - phys_avail[i++] = KERNPHYSADDR; -#endif - phys_avail[i++] = virtual_avail - KERNVIRTADDR + KERNPHYSADDR; - - phys_avail[i++] = PHYSADDR + memsize; - phys_avail[i++] = 0; - phys_avail[i++] = 0; + /* + * Add the physical ram we have available. + * + * Exclude the kernel, and all the things we allocated which immediately + * follow the kernel, from the VM allocation pool but not from crash + * dumps. virtual_avail is a global variable which tracks the kva we've + * "allocated" while setting up pmaps. + * + * Prepare the list of physical memory available to the vm subsystem. + */ + arm_physmem_hardware_region(PHYSADDR, memsize); + arm_physmem_exclude_region(abp->abp_physaddr, + virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); + arm_physmem_init_kernel_globals(); + init_param2(physmem); kdb_init(); Modified: stable/10/sys/arm/include/cpu.h ============================================================================== --- stable/10/sys/arm/include/cpu.h Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/include/cpu.h Thu May 15 20:58:23 2014 (r266194) @@ -35,6 +35,11 @@ get_cyclecount(void) extern vm_offset_t vector_page; +/* + * Params passed into initarm. If you change the size of this you will + * need to update locore.S to allocate more memory on the stack before + * it calls initarm. + */ struct arm_boot_params { register_t abp_size; /* Size of this structure */ register_t abp_r0; /* r0 from the boot loader */ @@ -42,6 +47,7 @@ struct arm_boot_params { register_t abp_r2; /* r2 from the boot loader */ register_t abp_r3; /* r3 from the boot loader */ vm_offset_t abp_physaddr; /* The kernel physical address */ + vm_offset_t abp_pagetable; /* The early page table */ }; void arm_vector_init(vm_offset_t, int); Modified: stable/10/sys/arm/include/machdep.h ============================================================================== --- stable/10/sys/arm/include/machdep.h Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/include/machdep.h Thu May 15 20:58:23 2014 (r266194) @@ -71,7 +71,4 @@ void initarm_late_init(void); void board_set_serial(uint64_t); void board_set_revision(uint32_t); -/* Setup standard arrays */ -void arm_dump_avail_init(vm_paddr_t, vm_offset_t, size_t); - #endif /* !_MACHINE_MACHDEP_H_ */ Copied and modified: stable/10/sys/arm/include/physmem.h (from r261643, head/sys/arm/include/physmem.h) ============================================================================== --- head/sys/arm/include/physmem.h Sat Feb 8 23:54:16 2014 (r261643, copy source) +++ stable/10/sys/arm/include/physmem.h Thu May 15 20:58:23 2014 (r266194) @@ -30,6 +30,11 @@ #define _MACHINE_PHYSMEM_H_ /* + * The physical address at which the kernel was loaded. + */ +extern vm_paddr_t arm_physmem_kernaddr; + +/* * Routines to help configure physical ram. * * Multiple regions of contiguous physical ram can be added (in any order). @@ -47,8 +52,8 @@ #define EXFLAG_NODUMP 0x01 #define EXFLAG_NOALLOC 0x02 -void arm_physmem_hardware_region(vm_offset_t pa, vm_size_t sz); -void arm_physmem_exclude_region(vm_offset_t pa, vm_size_t sz, uint32_t flags); +void arm_physmem_hardware_region(vm_paddr_t pa, vm_size_t sz); +void arm_physmem_exclude_region(vm_paddr_t pa, vm_size_t sz, uint32_t flags); void arm_physmem_init_kernel_globals(void); void arm_physmem_print_tables(void); Modified: stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Thu May 15 20:58:23 2014 (r266194) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -113,9 +114,6 @@ struct pv_addr kernel_pt_table[NUM_KERNE /* Physical and virtual addresses for some global pages */ -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; - struct pv_addr systempage; struct pv_addr msgbufpv; struct pv_addr irqstack; @@ -227,6 +225,7 @@ initarm(struct arm_boot_params *abp) boothowto = 0; /* Likely not needed */ lastaddr = parse_boot_param(abp); + arm_physmem_kernaddr = abp->abp_physaddr; i = 0; set_cpufuncs(); cpufuncs.cf_sleep = s3c24x0_sleep; @@ -241,7 +240,7 @@ initarm(struct arm_boot_params *abp) /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ alloc_pages((var).pv_va, (np)); \ - (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); + (var).pv_pa = (var).pv_va + (abp->abp_physaddr - KERNVIRTADDR); #define alloc_pages(var, np) \ (var) = freemempos; \ @@ -261,7 +260,7 @@ initarm(struct arm_boot_params *abp) L2_TABLE_SIZE_REAL; kernel_pt_table[loop].pv_pa = kernel_pt_table[loop].pv_va - KERNVIRTADDR + - KERNPHYSADDR; + abp->abp_physaddr; } } /* @@ -384,20 +383,26 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + 0x100000 * (KERNEL_PT_KERN_NUM - 1); - arm_dump_avail_init(abp->abp_physaddr, memsize, - sizeof(dump_avail) / sizeof(dump_avail[0])); vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); - physmem = memsize / PAGE_SIZE; - - phys_avail[0] = virtual_avail - KERNVIRTADDR + KERNPHYSADDR; - phys_avail[1] = PHYSADDR + memsize; - phys_avail[2] = 0; - phys_avail[3] = 0; + /* + * Add the physical ram we have available. + * + * Exclude the kernel, and all the things we allocated which immediately + * follow the kernel, from the VM allocation pool but not from crash + * dumps. virtual_avail is a global variable which tracks the kva we've + * "allocated" while setting up pmaps. + * + * Prepare the list of physical memory available to the vm subsystem. + */ + arm_physmem_hardware_region(PHYSADDR, memsize); + arm_physmem_exclude_region(abp->abp_physaddr, + virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); + arm_physmem_init_kernel_globals(); init_param2(physmem); kdb_init(); Modified: stable/10/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- stable/10/sys/arm/sa11x0/assabet_machdep.c Thu May 15 20:41:16 2014 (r266193) +++ stable/10/sys/arm/sa11x0/assabet_machdep.c Thu May 15 20:58:23 2014 (r266194) @@ -87,6 +87,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + #include #include @@ -122,8 +124,6 @@ extern vm_offset_t sa1_cache_clean_addr; #endif /* Physical and virtual addresses for some global pages */ -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; vm_paddr_t physical_start; vm_paddr_t physical_end; vm_paddr_t physical_freestart; @@ -202,9 +202,9 @@ initarm(struct arm_boot_params *abp) boothowto = RB_VERBOSE | RB_SINGLE; /* Default value */ lastaddr = parse_boot_param(abp); + arm_physmem_kernaddr = abp->abp_physaddr; cninit(); set_cpufuncs(); - physmem = memsize / PAGE_SIZE; pcpu0_init(); /* Do basic tuning, hz etc */ @@ -374,16 +374,25 @@ initarm(struct arm_boot_params *abp) cpu_setup(""); pmap_curmaxkvaddr = freemempos + KERNEL_PT_VMDATA_NUM * 0x400000; - - dump_avail[0] = phys_avail[0] = round_page(virtual_avail); - dump_avail[1] = phys_avail[1] = 0xc0000000 + 0x02000000 - 1; - dump_avail[2] = phys_avail[2] = 0; - dump_avail[3] = phys_avail[3] = 0; - mutex_init(); vm_max_kernel_address = 0xd0000000; pmap_bootstrap(freemempos, &kernel_l1pt); + /* + * Add the physical ram we have available. + * + * Exclude the kernel (and all the things we allocated which immediately + * follow the kernel) from the VM allocation pool but not from crash + * dumps. virtual_avail is a global variable which tracks the kva we've + * "allocated" while setting up pmaps. + * + * Prepare the list of physical memory available to the vm subsystem. + */ + arm_physmem_hardware_region(physical_start, memsize); + arm_physmem_exclude_region(abp->abp_physaddr, + virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); + arm_physmem_init_kernel_globals(); + init_param2(physmem); kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 21:21:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7A75DDB8; Thu, 15 May 2014 21:21: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 658FB24C8; Thu, 15 May 2014 21:21: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 s4FLLoBV014246; Thu, 15 May 2014 21:21:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FLLl4o014230; Thu, 15 May 2014 21:21:47 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405152121.s4FLLl4o014230@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 21:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266196 - in stable/10/sys: arm/arm arm/at91 dev/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 21:21:50 -0000 Author: ian Date: Thu May 15 21:21:47 2014 New Revision: 266196 URL: http://svnweb.freebsd.org/changeset/base/266196 Log: MFC r261681, r261682, r261683, r261684, r261685, r261686, r261687, r261688, r261689, r261690, r261783, r261791, r261836, r261837, r261841, Add FDT matching code to AT91 device drivers. Better nomatch messages: include compat string. Also, flag devices as disabled in the successful probe message, but leave what that means to the actual driver (no semantic changes). Fix Embest board name and id. Honor the disabled status by only grabbing resources and returning when running under FDT in the AT91 SPI driver. Modified: stable/10/sys/arm/arm/locore.S stable/10/sys/arm/at91/at91_machdep.c stable/10/sys/arm/at91/at91_mci.c stable/10/sys/arm/at91/at91_pio.c stable/10/sys/arm/at91/at91_pit.c stable/10/sys/arm/at91/at91_pmc.c stable/10/sys/arm/at91/at91_rst.c stable/10/sys/arm/at91/at91_spi.c stable/10/sys/arm/at91/at91_twi.c stable/10/sys/arm/at91/at91_wdt.c stable/10/sys/arm/at91/board_eb9200.c stable/10/sys/arm/at91/if_ate.c stable/10/sys/dev/fdt/simplebus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/arm/locore.S Thu May 15 21:21:47 2014 (r266196) @@ -170,8 +170,8 @@ Lunmapped: #if defined(SOCDEV_PA) && defined(SOCDEV_VA) /* Create the custom map */ - ldr r1, =SOCDEV_VA - ldr r2, =SOCDEV_PA + ldr r1, =SOCDEV_PA + ldr r2, =SOCDEV_VA bl build_pagetables #endif Modified: stable/10/sys/arm/at91/at91_machdep.c ============================================================================== --- stable/10/sys/arm/at91/at91_machdep.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/at91_machdep.c Thu May 15 21:21:47 2014 (r266196) @@ -590,6 +590,11 @@ initarm(struct arm_boot_params *abp) printf("Warning: No soc support for %s found.\n", soc_info.name); memsize = board_init(); + if (memsize == -1) { + printf("board_init() failed, cannot determine ram size; " + "assuming 16MB\n"); + memsize = 16 * 1024 * 1024; + } /* * Pages were allocated during the secondary bootstrap for the Modified: stable/10/sys/arm/at91/at91_mci.c ============================================================================== --- stable/10/sys/arm/at91/at91_mci.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/at91_mci.c Thu May 15 21:21:47 2014 (r266196) @@ -25,6 +25,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -62,6 +64,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + #include "mmcbr_if.h" #include "opt_at91.h" @@ -342,7 +350,10 @@ at91_mci_fini(device_t dev) static int at91_mci_probe(device_t dev) { - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,hsmci")) + return (ENXIO); +#endif device_set_desc(dev, "MCI mmc/sd host bridge"); return (0); } @@ -1393,5 +1404,10 @@ static driver_t at91_mci_driver = { static devclass_t at91_mci_devclass; +#ifdef FDT +DRIVER_MODULE(at91_mci, simplebus, at91_mci_driver, at91_mci_devclass, NULL, + NULL); +#else DRIVER_MODULE(at91_mci, atmelarm, at91_mci_driver, at91_mci_devclass, NULL, NULL); +#endif Modified: stable/10/sys/arm/at91/at91_pio.c ============================================================================== --- stable/10/sys/arm/at91/at91_pio.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/at91_pio.c Thu May 15 21:21:47 2014 (r266196) @@ -24,6 +24,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -48,6 +50,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + #define MAX_CHANGE 64 struct at91_pio_softc @@ -122,7 +130,10 @@ static int at91_pio_probe(device_t dev) { const char *name; - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-gpio")) + return (ENXIO); +#endif switch (device_get_unit(dev)) { case 0: name = "PIOA"; @@ -136,6 +147,12 @@ at91_pio_probe(device_t dev) case 3: name = "PIOD"; break; + case 4: + name = "PIOE"; + break; + case 5: + name = "PIOF"; + break; default: name = "PIO"; break; @@ -609,5 +626,10 @@ static driver_t at91_pio_driver = { sizeof(struct at91_pio_softc), }; +#ifdef FDT +DRIVER_MODULE(at91_pio, simplebus, at91_pio_driver, at91_pio_devclass, NULL, + NULL); +#else DRIVER_MODULE(at91_pio, atmelarm, at91_pio_driver, at91_pio_devclass, NULL, NULL); +#endif Modified: stable/10/sys/arm/at91/at91_pit.c ============================================================================== --- stable/10/sys/arm/at91/at91_pit.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/at91_pit.c Thu May 15 21:21:47 2014 (r266196) @@ -24,6 +24,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -48,6 +50,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + #ifndef PIT_PRESCALE #define PIT_PRESCALE (16) #endif @@ -83,6 +91,9 @@ at91_pit_delay(int us) uint64_t pit_freq; const uint64_t mhz = 1E6; + if (sc == NULL) + return; + last = PIT_PIV(RD4(sc, PIT_PIIR)); /* Max delay ~= 260s. @ 133Mhz */ @@ -111,7 +122,10 @@ static struct timecounter at91_pit_timec static int at91_pit_probe(device_t dev) { - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91sam9260-pit")) + return (ENXIO); +#endif device_set_desc(dev, "AT91SAM9 PIT"); return (0); } @@ -121,10 +135,8 @@ at91_pit_attach(device_t dev) { void *ih; int rid, err = 0; - struct at91_softc *at91_sc; struct resource *irq; - at91_sc = device_get_softc(device_get_parent(dev)); sc = device_get_softc(dev); sc->sc_dev = dev; @@ -158,22 +170,6 @@ out: return (err); } -static device_method_t at91_pit_methods[] = { - DEVMETHOD(device_probe, at91_pit_probe), - DEVMETHOD(device_attach, at91_pit_attach), - DEVMETHOD_END -}; - -static driver_t at91_pit_driver = { - "at91_pit", - at91_pit_methods, - sizeof(struct pit_softc), -}; - -static devclass_t at91_pit_devclass; - -DRIVER_MODULE(at91_pit, atmelarm, at91_pit_driver, at91_pit_devclass, NULL, - NULL); static int pit_intr(void *arg) @@ -202,3 +198,25 @@ at91_pit_get_timecount(struct timecounte icnt = piir >> 20; /* Overflows */ return (timecount + PIT_PIV(piir) + PIT_PIV(RD4(sc, PIT_MR)) * icnt); } + +static device_method_t at91_pit_methods[] = { + DEVMETHOD(device_probe, at91_pit_probe), + DEVMETHOD(device_attach, at91_pit_attach), + DEVMETHOD_END +}; + +static driver_t at91_pit_driver = { + "at91_pit", + at91_pit_methods, + sizeof(struct pit_softc), +}; + +static devclass_t at91_pit_devclass; + +#ifdef FDT +DRIVER_MODULE(at91_pit, simplebus, at91_pit_driver, at91_pit_devclass, NULL, + NULL); +#else +DRIVER_MODULE(at91_pit, atmelarm, at91_pit_driver, at91_pit_devclass, NULL, + NULL); +#endif Modified: stable/10/sys/arm/at91/at91_pmc.c ============================================================================== --- stable/10/sys/arm/at91/at91_pmc.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/at91_pmc.c Thu May 15 21:21:47 2014 (r266196) @@ -24,6 +24,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -49,6 +51,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + static struct at91_pmc_softc { bus_space_tag_t sc_st; bus_space_handle_t sc_sh; @@ -526,6 +534,8 @@ at91_pmc_init_clock(void) uint32_t mckr; uint32_t mdiv; + soc_info.soc_data->soc_clock_init(); + main_clock = at91_pmc_sense_main_clock(); if (at91_is_sam9() || at91_is_sam9xe()) { @@ -650,7 +660,10 @@ errout: static int at91_pmc_probe(device_t dev) { - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-pmc")) + return (ENXIO); +#endif device_set_desc(dev, "PMC"); return (0); } @@ -695,5 +708,10 @@ static driver_t at91_pmc_driver = { }; static devclass_t at91_pmc_devclass; +#ifdef FDT +DRIVER_MODULE(at91_pmc, simplebus, at91_pmc_driver, at91_pmc_devclass, NULL, + NULL); +#else DRIVER_MODULE(at91_pmc, atmelarm, at91_pmc_driver, at91_pmc_devclass, NULL, NULL); +#endif Modified: stable/10/sys/arm/at91/at91_rst.c ============================================================================== --- stable/10/sys/arm/at91/at91_rst.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/at91_rst.c Thu May 15 21:21:47 2014 (r266196) @@ -23,6 +23,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -39,10 +41,19 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#define FDT_HACKS 1 +#endif + #define RST_TIMEOUT (5) /* Seconds to hold NRST for hard reset */ #define RST_TICK (20) /* sample NRST at hz/RST_TICK intervals */ +#ifndef FDT static int at91_rst_intr(void *arg); +#endif static struct at91_rst_softc { struct resource *mem_res; /* Memory resource */ @@ -93,6 +104,10 @@ at91_rst_cpu_reset(void) static int at91_rst_probe(device_t dev) { +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91sam9260-rstc")) + return (ENXIO); +#endif device_set_desc(dev, "AT91SAM9 Reset Controller"); return (0); @@ -103,7 +118,7 @@ at91_rst_attach(device_t dev) { struct at91_rst_softc *sc; const char *cause; - int rid, err; + int rid, err = 0; at91_rst_sc = sc = device_get_softc(dev); sc->sc_dev = dev; @@ -118,6 +133,8 @@ at91_rst_attach(device_t dev) err = ENOMEM; goto out; } + +#ifndef FDT_HACKS rid = 0; sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | RF_SHAREABLE); @@ -132,6 +149,7 @@ at91_rst_attach(device_t dev) at91_rst_intr, NULL, sc, &sc->intrhand); if (err) device_printf(dev, "could not establish interrupt handler.\n"); +#endif WR4(at91_rst_sc, RST_MR, RST_MR_ERSTL(0xd) | RST_MR_URSIEN | RST_MR_KEY); @@ -161,6 +179,7 @@ out: return (err); } +#ifndef FDT_HACKS static void at91_rst_tick(void *argp) { @@ -191,6 +210,7 @@ at91_rst_intr(void *argp) } return (FILTER_STRAY); } +#endif static device_method_t at91_rst_methods[] = { DEVMETHOD(device_probe, at91_rst_probe), @@ -206,5 +226,10 @@ static driver_t at91_rst_driver = { static devclass_t at91_rst_devclass; +#ifdef FDT +DRIVER_MODULE(at91_rst, simplebus, at91_rst_driver, at91_rst_devclass, NULL, + NULL); +#else DRIVER_MODULE(at91_rst, atmelarm, at91_rst_driver, at91_rst_devclass, NULL, NULL); +#endif Modified: stable/10/sys/arm/at91/at91_spi.c ============================================================================== --- stable/10/sys/arm/at91/at91_spi.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/at91_spi.c Thu May 15 21:21:47 2014 (r266196) @@ -25,6 +25,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -49,6 +51,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + #include "spibus_if.h" struct at91_spi_softc @@ -96,7 +104,10 @@ static void at91_spi_intr(void *arg); static int at91_spi_probe(device_t dev) { - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-spi")) + return (ENXIO); +#endif device_set_desc(dev, "AT91 SPI"); return (0); } @@ -120,6 +131,15 @@ at91_spi_attach(device_t dev) if (err) goto out; +#ifdef FDT + /* + * Disable devices need to hold their resources, so return now and not attach + * the spibus, setup interrupt handlers, etc. + */ + if (!ofw_bus_status_okay(dev)) + return 0; +#endif + /* * Set up the hardware. */ @@ -428,5 +448,10 @@ static driver_t at91_spi_driver = { sizeof(struct at91_spi_softc), }; +#ifdef FDT +DRIVER_MODULE(at91_spi, simplebus, at91_spi_driver, at91_spi_devclass, NULL, + NULL); +#else DRIVER_MODULE(at91_spi, atmelarm, at91_spi_driver, at91_spi_devclass, NULL, NULL); +#endif Modified: stable/10/sys/arm/at91/at91_twi.c ============================================================================== --- stable/10/sys/arm/at91/at91_twi.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/at91_twi.c Thu May 15 21:21:47 2014 (r266196) @@ -23,6 +23,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -46,6 +48,12 @@ __FBSDID("$FreeBSD$"); #include #include "iicbus_if.h" +#ifdef FDT +#include +#include +#include +#endif + #define TWI_SLOW_CLOCK 1500 #define TWI_FAST_CLOCK 45000 #define TWI_FASTEST_CLOCK 90000 @@ -104,7 +112,11 @@ static void at91_twi_deactivate(device_t static int at91_twi_probe(device_t dev) { - +#ifdef FDT + /* XXXX need a whole list, since there's at least 4 different ones */ + if (!ofw_bus_is_compatible(dev, "atmel,at91sam9g20-i2c")) + return (ENXIO); +#endif device_set_desc(dev, "TWI"); return (0); } @@ -122,6 +134,15 @@ at91_twi_attach(device_t dev) AT91_TWI_LOCK_INIT(sc); +#ifdef FDT + /* + * Disable devices need to hold their resources, so return now and not attach + * the iicbus, setup interrupt handlers, etc. + */ + if (!ofw_bus_status_okay(dev)) + return 0; +#endif + /* * Activate the interrupt */ @@ -397,7 +418,12 @@ static driver_t at91_twi_driver = { sizeof(struct at91_twi_softc), }; +#ifdef FDT +DRIVER_MODULE(at91_twi, simplebus, at91_twi_driver, at91_twi_devclass, NULL, + NULL); +#else DRIVER_MODULE(at91_twi, atmelarm, at91_twi_driver, at91_twi_devclass, NULL, NULL); +#endif DRIVER_MODULE(iicbus, at91_twi, iicbus_driver, iicbus_devclass, NULL, NULL); MODULE_DEPEND(at91_twi, iicbus, 1, 1, 1); Modified: stable/10/sys/arm/at91/at91_wdt.c ============================================================================== --- stable/10/sys/arm/at91/at91_wdt.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/at91_wdt.c Thu May 15 21:21:47 2014 (r266196) @@ -29,6 +29,8 @@ * handler. The watchdog is halted in processor debug mode. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -45,6 +47,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + struct wdt_softc { struct mtx sc_mtx; device_t sc_dev; @@ -131,12 +139,12 @@ wdt_tick(void *argp) static int wdt_probe(device_t dev) { - - if (at91_is_sam9() || at91_is_sam9xe()) { - device_set_desc(dev, "WDT"); - return (0); - } - return (ENXIO); +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91sam9260-wdt")) + return (ENXIO); +#endif + device_set_desc(dev, "WDT"); + return (0); } static int @@ -223,4 +231,8 @@ static driver_t wdt_driver = { static devclass_t wdt_devclass; +#ifdef FDT +DRIVER_MODULE(at91_wdt, simplebus, wdt_driver, wdt_devclass, NULL, NULL); +#else DRIVER_MODULE(at91_wdt, atmelarm, wdt_driver, wdt_devclass, NULL, NULL); +#endif Modified: stable/10/sys/arm/at91/board_eb9200.c ============================================================================== --- stable/10/sys/arm/at91/board_eb9200.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/board_eb9200.c Thu May 15 21:21:47 2014 (r266196) @@ -65,4 +65,4 @@ board_init(void) return (at91_ramsize()); } -ARM_BOARD(KB9200, "Kwikbyte KB920x") +ARM_BOARD(ATEB9200, "Embest ATEB9200") Modified: stable/10/sys/arm/at91/if_ate.c ============================================================================== --- stable/10/sys/arm/at91/if_ate.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/arm/at91/if_ate.c Thu May 15 21:21:47 2014 (r266196) @@ -30,6 +30,8 @@ * 2) GPIO initializtion in board setup code. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -74,6 +76,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + #include "miibus_if.h" /* @@ -229,7 +237,10 @@ static int ate_miibus_writereg(device_t static int ate_probe(device_t dev) { - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "cdns,at32ap7000-macb")) + return (ENXIO); +#endif device_set_desc(dev, "EMAC"); return (0); } @@ -1458,7 +1469,11 @@ static driver_t ate_driver = { sizeof(struct ate_softc), }; +#ifdef FDT +DRIVER_MODULE(ate, simplebus, ate_driver, ate_devclass, NULL, NULL); +#else DRIVER_MODULE(ate, atmelarm, ate_driver, ate_devclass, NULL, NULL); +#endif DRIVER_MODULE(miibus, ate, miibus_driver, miibus_devclass, NULL, NULL); MODULE_DEPEND(ate, miibus, 1, 1, 1); MODULE_DEPEND(ate, ether, 1, 1, 1); Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Thu May 15 21:19:13 2014 (r266195) +++ stable/10/sys/dev/fdt/simplebus.c Thu May 15 21:21:47 2014 (r266196) @@ -401,18 +401,24 @@ simplebus_print_res(struct simplebus_dev static void simplebus_probe_nomatch(device_t bus, device_t child) { - const char *name, *type; + const char *name, *type, *compat; if (!bootverbose) return; name = ofw_bus_get_name(child); type = ofw_bus_get_type(child); + compat = ofw_bus_get_compat(child); device_printf(bus, "<%s>", name != NULL ? name : "unknown"); simplebus_print_res(device_get_ivars(child)); - printf(" type %s (no driver attached)\n", - type != NULL ? type : "unknown"); + if (!ofw_bus_status_okay(child)) + printf(" disabled"); + if (type) + printf(" type %s", type); + if (compat) + printf(" compat %s", compat); + printf(" (no driver attached)\n"); } static int @@ -422,7 +428,8 @@ simplebus_print_child(device_t bus, devi rv = bus_print_child_header(bus, child); rv += simplebus_print_res(device_get_ivars(child)); + if (!ofw_bus_status_okay(child)) + rv += printf(" disabled"); rv += bus_print_child_footer(bus, child); return (rv); } - From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 21:41:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C911C4B3; Thu, 15 May 2014 21:41:33 +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 A8AAA26C6; Thu, 15 May 2014 21:41:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FLfXa2023035; Thu, 15 May 2014 21:41:33 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FLfWVI023030; Thu, 15 May 2014 21:41:32 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405152141.s4FLfWVI023030@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 21:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266197 - in stable/10/sys: arm/arm arm/at91 kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 21:41:34 -0000 Author: ian Date: Thu May 15 21:41:32 2014 New Revision: 266197 URL: http://svnweb.freebsd.org/changeset/base/266197 Log: MFC r261786, r261789 Rework the EARLY_PRINTF mechanism. Instead of defining a special eprintf() routine, now a platform can provide a pointer to an early_putc() routine which is used instead of cn_putc(). Control can be handed off from early printf support to standard console support by NULLing out the pointer during standard console init. Convert two while(1); statements into proper panics. Modified: stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/at91/uart_dev_at91usart.c stable/10/sys/kern/kern_cons.c stable/10/sys/kern/subr_prf.c stable/10/sys/sys/systm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Thu May 15 21:21:47 2014 (r266196) +++ stable/10/sys/arm/arm/machdep.c Thu May 15 21:41:32 2014 (r266197) @@ -1056,10 +1056,10 @@ initarm(struct arm_boot_params *abp) #endif if (OF_install(OFW_FDT, 0) == FALSE) - while (1); + panic("Cannot install FDT"); if (OF_init((void *)dtbp) != 0) - while (1); + panic("OF_init failed with the found device tree"); /* Grab physical memory regions information from device tree. */ if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, &memsize) != 0) Modified: stable/10/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- stable/10/sys/arm/at91/uart_dev_at91usart.c Thu May 15 21:21:47 2014 (r266196) +++ stable/10/sys/arm/at91/uart_dev_at91usart.c Thu May 15 21:41:32 2014 (r266197) @@ -228,6 +228,27 @@ static struct uart_ops at91_usart_ops = .getc = at91_usart_getc, }; +#ifdef EARLY_PRINTF +/* + * Early printf support. This assumes that we have the SoC "system" devices + * mapped into AT91_BASE. To use this before we adjust the boostrap tables, + * you'll need to define SOCDEV_VA to be 0xdc000000 and SOCDEV_PA to be + * 0xfc000000 in your config file where you define EARLY_PRINTF + */ +volatile uint32_t *at91_dbgu = (volatile uint32_t *)(AT91_BASE + AT91_DBGU0); + +static void +eputc(int c) +{ + + while (!(at91_dbgu[USART_CSR / 4] & USART_CSR_TXRDY)) + continue; + at91_dbgu[USART_THR / 4] = c; +} + +early_putc_t * early_putc = eputc; +#endif + static int at91_usart_probe(struct uart_bas *bas) { @@ -244,6 +265,22 @@ at91_usart_init(struct uart_bas *bas, in int parity) { +#ifdef EARLY_PRINTF + if (early_putc != NULL) { + printf("Early printf yielding control to the real console.\n"); + early_putc = NULL; + } +#endif + + /* + * This routine is called multiple times, sometimes right after writing + * some output, and the last byte is still shifting out. If that's the + * case delay briefly before resetting, but don't loop on TXRDY because + * we don't want to hang here forever if the hardware is in a bad state. + */ + if (!(RD4(bas, USART_CSR) & USART_CSR_TXRDY)) + DELAY(1000); + at91_usart_param(bas, baudrate, databits, stopbits, parity); /* Reset the rx and tx buffers and turn on rx and tx */ @@ -276,28 +313,6 @@ at91_usart_putc(struct uart_bas *bas, in WR4(bas, USART_THR, c); } -#ifdef EARLY_PRINTF -/* - * Early printf support. This assumes that we have the SoC "system" devices - * mapped into AT91_BASE. To use this before we adjust the boostrap tables, - * You'll need to define SOCDEV_VA to be 0xdc000000 and SOCDEV_PA to be - * 0xfc000000 in your config file where you define EARLY_PRINTF - */ -volatile uint32_t *at91_dbgu = (volatile uint32_t *)(AT91_BASE + AT91_DBGU0); - -void -eputc(int c) -{ - - if (c == '\n') - eputc('\r'); - - while (!(at91_dbgu[USART_CSR / 4] & USART_CSR_TXRDY)) - continue; - at91_dbgu[USART_THR / 4] = c; -} -#endif - /* * Check for a character available. */ Modified: stable/10/sys/kern/kern_cons.c ============================================================================== --- stable/10/sys/kern/kern_cons.c Thu May 15 21:21:47 2014 (r266196) +++ stable/10/sys/kern/kern_cons.c Thu May 15 21:41:32 2014 (r266197) @@ -464,6 +464,15 @@ cnputc(int c) struct consdev *cn; char *cp; +#ifdef EARLY_PRINTF + if (early_putc != NULL) { + if (c == '\n') + early_putc('\r'); + early_putc(c); + return; + } +#endif + if (cn_mute || c == '\0') return; STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) { Modified: stable/10/sys/kern/subr_prf.c ============================================================================== --- stable/10/sys/kern/subr_prf.c Thu May 15 21:21:47 2014 (r266196) +++ stable/10/sys/kern/subr_prf.c Thu May 15 21:41:32 2014 (r266197) @@ -1122,25 +1122,3 @@ hexdump(const void *ptr, int length, con printf("\n"); } } -#ifdef EARLY_PRINTF -/* - * Support for calling an alternate printf early in boot (like before - * cn_init() can be called). Platforms need to define eputc that want - * to use this. - */ -static void -early_putc_func(int ch, void *arg __unused) -{ - eputc(ch); -} - -void -eprintf(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - kvprintf(fmt, early_putc_func, NULL, 10, ap); - va_end(ap); -} -#endif Modified: stable/10/sys/sys/systm.h ============================================================================== --- stable/10/sys/sys/systm.h Thu May 15 21:21:47 2014 (r266196) +++ stable/10/sys/sys/systm.h Thu May 15 21:41:32 2014 (r266197) @@ -197,8 +197,8 @@ void init_param2(long physpages); void init_static_kenv(char *, size_t); void tablefull(const char *); #ifdef EARLY_PRINTF -void eprintf(const char *, ...) __printflike(1, 2); -void eputc(int ch); +typedef void early_putc_t(int ch); +extern early_putc_t *early_putc; #endif int kvprintf(char const *, void (*)(int, void*), void *, int, __va_list) __printflike(1, 0); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 22:03:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8E729830; Thu, 15 May 2014 22:03: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 78D572872; Thu, 15 May 2014 22:03: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 s4FM3Rv9032078; Thu, 15 May 2014 22:03:27 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FM3PbP032056; Thu, 15 May 2014 22:03:25 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405152203.s4FM3PbP032056@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 22:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266198 - in stable/10/sys: arm/arm arm/freescale/imx arm/freescale/vybrid arm/include boot/fdt/dts dev/sdhci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 22:03:27 -0000 Author: ian Date: Thu May 15 22:03:24 2014 New Revision: 266198 URL: http://svnweb.freebsd.org/changeset/base/266198 Log: MFC r261803, r261808, r261814, r261815, r261816, r261817, r261818, r261826, r261848, r261855 On armv6 and later, use the WriteNotRead bit of the fault status register to decide what protections are required by the faulting access. Use the right symbols for determining arm architecture. Include the necessary header file which has the new FAULT_WNR symbol defined in it. Allow the kernel to be loaded at any 1MiB address. This requirement is because we use the 1MiB section maps as they only need a single pagetable. Add function for configuring Vybrid PLL4 (Audio) clock frequency output. imx6 changes ... - Fix the definition of the SDHCI_STATE_DAT and SDHCI_STATE_CMD fields, and add SDHCI_RETUNE_REQUEST. None of these are actually used in the code yet. - Write translation code for the SDHCI_PRESENT_STATE register. Freescale moved some bits around in their version of the register, adjust things so that the sdhci code sees the standard layout. - Add standard non-removable and cd-gpios properties to the usdhc devices. That generates references to gpio devices, so uncomment them even though there isn't a gpio driver to do anything with them yet. - Add handling of standard "non-removable" property, and also some workaround code so that if card detect is wired to a gpio pin, for now we just treat it the same as non-removable (because there isn't a gpio driver yet). - Enable both sdcard slots, but not the sdio-based wifi that we don't yet have a driver for. - Remove a couple obsolete function declarations. Modified: stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/trap.c stable/10/sys/arm/freescale/imx/imx_machdep.h stable/10/sys/arm/freescale/imx/imx_sdhci.c stable/10/sys/arm/freescale/vybrid/vf_anadig.c stable/10/sys/arm/freescale/vybrid/vf_common.h stable/10/sys/arm/include/armreg.h stable/10/sys/boot/fdt/dts/imx6.dtsi stable/10/sys/boot/fdt/dts/wandboard-dual.dts stable/10/sys/boot/fdt/dts/wandboard-quad.dts stable/10/sys/boot/fdt/dts/wandboard-solo.dts stable/10/sys/dev/sdhci/sdhci.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/arm/arm/locore.S Thu May 15 22:03:24 2014 (r266198) @@ -148,15 +148,31 @@ Lunmapped: * Build page table from scratch. */ - /* Load the page tables physical address */ - ldr r1, Lstartup_pagetable - ldr r2, =(KERNVIRTADDR - KERNPHYSADDR) + /* Find the delta between VA and PA */ + adr r0, Lpagetable + ldr r1, [r0] + sub r2, r1, r0 + /* At this point: r2 = VA - PA */ + + /* + * Find the physical address of the table. After these two + * instructions: + * r1 = va(pagetable) + * + * r0 = va(pagetable) - (VA - PA) + * = va(pagetable) - VA + PA + * = pa(pagetable) + */ + ldr r1, [r0, #4] sub r0, r1, r2 /* * Map PA == VA */ - ldr r5, =(PHYSADDR) + /* Find the start kernels load address */ + adr r5, _start + ldr r2, =(L1_S_OFFSET) + bic r5, r2 mov r1, r5 mov r2, r5 /* Map 64MiB, preserved over calls to build_pagetables */ @@ -165,7 +181,7 @@ Lunmapped: /* Create the kernel map to jump to */ mov r1, r5 - ldr r2, =(KERNBASE) + ldr r2, =(KERNVIRTADDR) bl build_pagetables #if defined(SOCDEV_PA) && defined(SOCDEV_VA) @@ -223,16 +239,16 @@ mmu_done: virt_done: mov r1, #28 /* loader info size is 28 bytes also second arg */ subs sp, sp, r1 /* allocate arm_boot_params struct on stack */ - bic sp, sp, #7 /* align stack to 8 bytes */ mov r0, sp /* loader info pointer is first arg */ + bic sp, sp, #7 /* align stack to 8 bytes */ str r1, [r0] /* Store length of loader info */ str r9, [r0, #4] /* Store r0 from boot loader */ str r8, [r0, #8] /* Store r1 from boot loader */ str ip, [r0, #12] /* store r2 from boot loader */ str fp, [r0, #16] /* store r3 from boot loader */ - ldr r5, =KERNPHYSADDR /* load KERNPHYSADDR as the physical address */ str r5, [r0, #20] /* store the physical address */ - ldr r5, Lstartup_pagetable + adr r4, Lpagetable /* load the pagetable address */ + ldr r5, [r4, #4] str r5, [r0, #24] /* store the pagetable address */ mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ @@ -279,16 +295,19 @@ build_pagetables: RET +Lpagetable: + .word . + .word pagetable + Lvirtaddr: .word KERNVIRTADDR Lphysaddr: .word KERNPHYSADDR Lreal_start: .word _start -Lend: +Lend: .word _edata -Lstartup_pagetable: - .word pagetable + #ifdef SMP Lstartup_pagetable_secondary: .word temp_pagetable Modified: stable/10/sys/arm/arm/trap.c ============================================================================== --- stable/10/sys/arm/arm/trap.c Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/arm/arm/trap.c Thu May 15 22:03:24 2014 (r266198) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -386,17 +387,16 @@ data_abort_handler(struct trapframe *tf) } /* - * We need to know whether the page should be mapped - * as R or R/W. The MMU does not give us the info as - * to whether the fault was caused by a read or a write. - * - * However, we know that a permission fault can only be - * the result of a write to a read-only location, so - * we can deal with those quickly. - * - * Otherwise we need to disassemble the instruction - * responsible to determine if it was a write. + * We need to know whether the page should be mapped as R or R/W. On + * armv6 and later the fault status register indicates whether the + * access was a read or write. Prior to armv6, we know that a + * permission fault can only be the result of a write to a read-only + * location, so we can deal with those quickly. Otherwise we need to + * disassemble the faulting instruction to determine if it was a write. */ +#if ARM_ARCH_6 || ARM_ARCH_7A + ftype = (fsr & FAULT_WNR) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ; +#else if (IS_PERMISSION_FAULT(fsr)) ftype = VM_PROT_WRITE; else { @@ -413,6 +413,7 @@ data_abort_handler(struct trapframe *tf) ftype = VM_PROT_READ; } } +#endif /* * See if the fault is as a result of ref/mod emulation, Modified: stable/10/sys/arm/freescale/imx/imx_machdep.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.h Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/arm/freescale/imx/imx_machdep.h Thu May 15 22:03:24 2014 (r266198) @@ -33,7 +33,6 @@ /* Common functions, implemented in imx_machdep.c. */ -void imx_devmap_addentry(vm_paddr_t _pa, vm_size_t _sz); void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys) __attribute__((__noreturn__)); /* From here down, routines are implemented in imxNN_machdep.c. */ @@ -57,8 +56,6 @@ void imx_wdog_cpu_reset(vm_offset_t _wdc u_int imx_soc_type(void); u_int imx_soc_family(void); -void imx_devmap_init(void); - /* * We need a clock management system that works across unrelated SoCs and * devices. For now, to keep imx development moving, define some barebones Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_sdhci.c Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/arm/freescale/imx/imx_sdhci.c Thu May 15 22:03:24 2014 (r266198) @@ -71,6 +71,7 @@ struct imx_sdhci_softc { uint32_t r1bfix_intmask; uint8_t r1bfix_type; uint8_t hwtype; + boolean_t force_card_present; }; #define R1BFIX_NONE 0 /* No fix needed at next interrupt. */ @@ -89,6 +90,27 @@ struct imx_sdhci_softc { #define SDHC_VEND_HCKEN (1 << 12) #define SDHC_VEND_PEREN (1 << 13) +#define SDHC_PRES_STATE 0x24 +#define SDHC_PRES_CIHB (1 << 0) +#define SDHC_PRES_CDIHB (1 << 1) +#define SDHC_PRES_DLA (1 << 2) +#define SDHC_PRES_SDSTB (1 << 3) +#define SDHC_PRES_IPGOFF (1 << 4) +#define SDHC_PRES_HCKOFF (1 << 5) +#define SDHC_PRES_PEROFF (1 << 6) +#define SDHC_PRES_SDOFF (1 << 7) +#define SDHC_PRES_WTA (1 << 8) +#define SDHC_PRES_RTA (1 << 9) +#define SDHC_PRES_BWEN (1 << 10) +#define SDHC_PRES_BREN (1 << 11) +#define SDHC_PRES_RTR (1 << 12) +#define SDHC_PRES_CINST (1 << 16) +#define SDHC_PRES_CDPL (1 << 18) +#define SDHC_PRES_WPSPL (1 << 19) +#define SDHC_PRES_CLSL (1 << 23) +#define SDHC_PRES_DLSL_SHIFT 24 +#define SDHC_PRES_DLSL_MASK (0xffU << SDHC_PRES_DLSL_SHIFT) + #define SDHC_PROT_CTRL 0x28 #define SDHC_PROT_LED (1 << 0) #define SDHC_PROT_WIDTH_1BIT (0 << 1) @@ -254,8 +276,8 @@ imx_sdhci_read_2(device_t dev, struct sd wrk32 = RD4(sc, SDHC_VEND_SPEC); if (wrk32 & SDHC_VEND_FRC_SDCLK_ON) val32 |= SDHCI_CLOCK_INT_EN | SDHCI_CLOCK_CARD_EN; - wrk32 = RD4(sc, SDHCI_PRESENT_STATE); - if (wrk32 & 0x08) + wrk32 = RD4(sc, SDHC_PRES_STATE); + if (wrk32 & SDHC_PRES_SDSTB) val32 |= SDHCI_CLOCK_INT_STABLE; val32 |= sc->sdclockreg_freq_bits; return (val32); @@ -268,7 +290,9 @@ static uint32_t imx_sdhci_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct imx_sdhci_softc *sc = device_get_softc(dev); - uint32_t val32; + uint32_t val32, wrk32; + + val32 = RD4(sc, off); /* * The hardware leaves the base clock frequency out of the capabilities @@ -280,7 +304,6 @@ imx_sdhci_read_4(device_t dev, struct sd * doesn't yet handle (1.8v, suspend/resume, etc). */ if (off == SDHCI_CAPABILITIES) { - val32 = RD4(sc, off); val32 &= ~SDHCI_CAN_VDD_180; val32 &= ~SDHCI_CAN_DO_SUSPEND; val32 |= SDHCI_CAN_DO_8BITBUS; @@ -288,14 +311,30 @@ imx_sdhci_read_4(device_t dev, struct sd return (val32); } - val32 = RD4(sc, off); + /* + * The hardware moves bits around in the present state register to make + * room for all 8 data line state bits. To translate, mask out all the + * bits which are not in the same position in both registers (this also + * masks out some freescale-specific bits in locations defined as + * reserved by sdhci), then shift the data line and retune request bits + * down to their standard locations. + */ + if (off == SDHCI_PRESENT_STATE) { + wrk32 = val32; + val32 &= 0x000F0F07; + val32 |= (wrk32 >> 4) & SDHCI_STATE_DAT_MASK; + val32 |= (wrk32 >> 9) & SDHCI_RETUNE_REQUEST; + if (sc->force_card_present) + val32 |= SDHCI_CARD_PRESENT; + return (val32); + } /* * imx_sdhci_intr() can synthesize a DATA_END interrupt following a * command with an R1B response, mix it into the hardware status. */ if (off == SDHCI_INT_STATUS) { - val32 |= sc->r1bfix_intmask; + return (val32 | sc->r1bfix_intmask); } return val32; @@ -522,7 +561,7 @@ imx_sdhci_intr(void *arg) count = 0; /* XXX use a callout or something instead of busy-waiting. */ while (count < 250000 && - (RD4(sc, SDHCI_PRESENT_STATE) & SDHCI_DAT_ACTIVE)) { + (RD4(sc, SDHC_PRES_STATE) & SDHC_PRES_DLA)) { ++count; DELAY(1); } @@ -555,6 +594,7 @@ imx_sdhci_attach(device_t dev) { struct imx_sdhci_softc *sc = device_get_softc(dev); int rid, err; + phandle_t node; sc->dev = dev; @@ -621,6 +661,25 @@ imx_sdhci_attach(device_t dev) sdhci_init_slot(dev, &sc->slot, 0); + /* + * If the slot is flagged with the non-removable property, set our flag + * to always force the SDHCI_CARD_PRESENT bit on. + * + * XXX Workaround for gpio-based card detect... + * + * We don't have gpio support yet. If there's a cd-gpios property just + * force the SDHCI_CARD_PRESENT bit on for now. If there isn't really a + * card there it will fail to probe at the mmc layer and nothing bad + * happens except instantiating a /dev/mmcN device for an empty slot. + */ + node = ofw_bus_get_node(dev); + if (OF_hasprop(node, "non-removable")) + sc->force_card_present = true; + else if (OF_hasprop(node, "cd-gpios")) { + /* XXX put real gpio hookup here. */ + sc->force_card_present = true; + } + bus_generic_probe(dev); bus_generic_attach(dev); Modified: stable/10/sys/arm/freescale/vybrid/vf_anadig.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_anadig.c Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/arm/freescale/vybrid/vf_anadig.c Thu May 15 22:03:24 2014 (r266198) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,14 +99,19 @@ __FBSDID("$FreeBSD$"); #define CTRL_PLL_EN (1 << 13) #define EN_USB_CLKS (1 << 6) +#define PLL4_CTRL_DIV_SEL_S 0 +#define PLL4_CTRL_DIV_SEL_M 0x7f + struct anadig_softc { struct resource *res[1]; bus_space_tag_t bst; bus_space_handle_t bsh; }; +struct anadig_softc *anadig_sc; + static struct resource_spec anadig_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 0, RF_ACTIVE }, { -1, 0 } }; @@ -148,6 +153,28 @@ enable_pll(struct anadig_softc *sc, int return (0); } +uint32_t +pll4_configure_output(uint32_t mfi, uint32_t mfn, uint32_t mfd) +{ + struct anadig_softc *sc; + int reg; + + sc = anadig_sc; + + /* + * PLLout = Fsys * (MFI+(MFN/MFD)) + */ + + reg = READ4(sc, ANADIG_PLL4_CTRL); + reg &= ~(PLL4_CTRL_DIV_SEL_M << PLL4_CTRL_DIV_SEL_S); + reg |= (mfi << PLL4_CTRL_DIV_SEL_S); + WRITE4(sc, ANADIG_PLL4_CTRL, reg); + WRITE4(sc, ANADIG_PLL4_NUM, mfn); + WRITE4(sc, ANADIG_PLL4_DENOM, mfd); + + return (0); +} + static int anadig_attach(device_t dev) { @@ -165,11 +192,13 @@ anadig_attach(device_t dev) sc->bst = rman_get_bustag(sc->res[0]); sc->bsh = rman_get_bushandle(sc->res[0]); + anadig_sc = sc; + /* Enable USB PLLs */ enable_pll(sc, ANADIG_PLL3_CTRL); enable_pll(sc, ANADIG_PLL7_CTRL); - /* Enable other */ + /* Enable other PLLs */ enable_pll(sc, ANADIG_PLL1_CTRL); enable_pll(sc, ANADIG_PLL2_CTRL); enable_pll(sc, ANADIG_PLL4_CTRL); Modified: stable/10/sys/arm/freescale/vybrid/vf_common.h ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_common.h Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/arm/freescale/vybrid/vf_common.h Thu May 15 22:03:24 2014 (r266198) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,4 +39,5 @@ #define WRITE1(_sc, _reg, _val) \ bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) +uint32_t pll4_configure_output(uint32_t mfi, uint32_t mfn, uint32_t mfd); uint32_t tcon_bypass(void); Modified: stable/10/sys/arm/include/armreg.h ============================================================================== --- stable/10/sys/arm/include/armreg.h Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/arm/include/armreg.h Thu May 15 22:03:24 2014 (r266198) @@ -403,6 +403,8 @@ #define FAULT_PERM_P 0x0f /* Permission -- Page */ #define FAULT_IMPRECISE 0x400 /* Imprecise exception (XSCALE) */ +#define FAULT_EXTERNAL 0x400 /* External abort (armv6+) */ +#define FAULT_WNR 0x800 /* Write-not-Read access (armv6+) */ /* * Address of the vector page, low and high versions. Modified: stable/10/sys/boot/fdt/dts/imx6.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/imx6.dtsi Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/boot/fdt/dts/imx6.dtsi Thu May 15 22:03:24 2014 (r266198) @@ -112,58 +112,75 @@ // status = "disabled"; // }; -// /* -// * GPIO modules moved up - to have it attached for -// * drivers which rely on GPIO -// */ -// gpio1: gpio@0209C000 { -// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; -// reg = <0x0209C000 0x4000>; -// interrupt-parent = <&gic>; -// interrupts = <50 51 42 43 44 45 46 47 48 49>; -// /* TODO: use <> also */ -// gpio-controller; -// #gpio-cells = <2>; -// interrupt-controller; -// #interrupt-cells = <1>; -// status = "disabled"; -// }; -// -// gpio2: gpio@020A0000 { -// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; -// reg = <0x020A0000 0x4000>; -// interrupt-parent = <&gic>; -// interrupts = <52 53>; -// gpio-controller; -// #gpio-cells = <2>; -// interrupt-controller; -// #interrupt-cells = <1>; -// status = "disabled"; -// }; -// -// gpio3: gpio@020A4000 { -// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; -// reg = <0x020A4000 0x4000>; -// interrupt-parent = <&gic>; -// interrupts = <54 55>; -// gpio-controller; -// #gpio-cells = <2>; -// interrupt-controller; -// #interrupt-cells = <1>; -// status = "disabled"; -// }; -// -// gpio4: gpio@020A8000 { -// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; -// reg = <0x020A8000 0x4000>; -// interrupt-parent = <&gic>; -// interrupts = <56 57>; -// gpio-controller; -// #gpio-cells = <2>; -// interrupt-controller; -// #interrupt-cells = <1>; -// status = "disabled"; -// }; + gpio1: gpio@0209c000 { + compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; + reg = <0x0209c000 0x4000>; + interrupts = <0 66 0x04 0 67 0x04>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio2: gpio@020a0000 { + compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; + reg = <0x020a0000 0x4000>; + interrupts = <0 68 0x04 0 69 0x04>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio3: gpio@020a4000 { + compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; + reg = <0x020a4000 0x4000>; + interrupts = <0 70 0x04 0 71 0x04>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio4: gpio@020a8000 { + compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; + reg = <0x020a8000 0x4000>; + interrupts = <0 72 0x04 0 73 0x04>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio5: gpio@020ac000 { + compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; + reg = <0x020ac000 0x4000>; + interrupts = <0 74 0x04 0 75 0x04>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio6: gpio@020b0000 { + compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; + reg = <0x020b0000 0x4000>; + interrupts = <0 76 0x04 0 77 0x04>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio7: gpio@020b4000 { + compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; + reg = <0x020b4000 0x4000>; + interrupts = <0 78 0x04 0 79 0x04>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; uart1: serial@02020000 { compatible = "fsl,imx6q-uart"; @@ -287,6 +304,7 @@ reg = <0x02190000 0x4000>; interrupt-parent = <&gic>; interrupts = <54>; + cd-gpios = <&gpio1 2 0>; bus-width = <0x4>; status ="disabled"; }; @@ -296,6 +314,7 @@ reg = <0x02194000 0x4000>; interrupt-parent = <&gic>; interrupts = <55>; + non-removable; bus-width = <0x4>; status ="disabled"; }; @@ -305,6 +324,7 @@ reg = <0x02198000 0x4000>; interrupt-parent = <&gic>; interrupts = <56>; + cd-gpios = <&gpio3 9 0>; bus-width = <0x4>; status ="disabled"; }; Modified: stable/10/sys/boot/fdt/dts/wandboard-dual.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/wandboard-dual.dts Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/boot/fdt/dts/wandboard-dual.dts Thu May 15 22:03:24 2014 (r266198) @@ -67,8 +67,8 @@ usb@02184200 { status = "okay"; }; usb@02184400 { status = "disabled"; }; usb@02184600 { status = "disabled"; }; - usdhc@02190000 { status = "disabled"; }; - usdhc@02194000 { status = "okay"; }; + usdhc@02190000 { status = "okay"; }; + usdhc@02194000 { status = "disabled"; }; usdhc@02198000 { status = "okay"; }; usdhc@0219c000 { status = "disabled"; }; }; Modified: stable/10/sys/boot/fdt/dts/wandboard-quad.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/wandboard-quad.dts Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/boot/fdt/dts/wandboard-quad.dts Thu May 15 22:03:24 2014 (r266198) @@ -67,8 +67,8 @@ usb@02184200 { status = "okay"; }; usb@02184400 { status = "disabled"; }; usb@02184600 { status = "disabled"; }; - usdhc@02190000 { status = "disabled"; }; - usdhc@02194000 { status = "okay"; }; + usdhc@02190000 { status = "okay"; }; + usdhc@02194000 { status = "disabled"; }; usdhc@02198000 { status = "okay"; }; usdhc@0219c000 { status = "disabled"; }; }; Modified: stable/10/sys/boot/fdt/dts/wandboard-solo.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/wandboard-solo.dts Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/boot/fdt/dts/wandboard-solo.dts Thu May 15 22:03:24 2014 (r266198) @@ -67,8 +67,8 @@ usb@02184200 { status = "okay"; }; usb@02184400 { status = "disabled"; }; usb@02184600 { status = "disabled"; }; - usdhc@02190000 { status = "disabled"; }; - usdhc@02194000 { status = "okay"; }; + usdhc@02190000 { status = "okay"; }; + usdhc@02194000 { status = "disabled"; }; usdhc@02198000 { status = "okay"; }; usdhc@0219c000 { status = "disabled"; }; }; Modified: stable/10/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.h Thu May 15 21:41:32 2014 (r266197) +++ stable/10/sys/dev/sdhci/sdhci.h Thu May 15 22:03:24 2014 (r266198) @@ -104,6 +104,7 @@ #define SDHCI_CMD_INHIBIT 0x00000001 #define SDHCI_DAT_INHIBIT 0x00000002 #define SDHCI_DAT_ACTIVE 0x00000004 +#define SDHCI_RETUNE_REQUEST 0x00000008 #define SDHCI_DOING_WRITE 0x00000100 #define SDHCI_DOING_READ 0x00000200 #define SDHCI_SPACE_AVAILABLE 0x00000400 @@ -112,8 +113,8 @@ #define SDHCI_CARD_STABLE 0x00020000 #define SDHCI_CARD_PIN 0x00040000 #define SDHCI_WRITE_PROTECT 0x00080000 -#define SDHCI_STATE_DAT 0x00700000 -#define SDHCI_STATE_CMD 0x00800000 +#define SDHCI_STATE_DAT_MASK 0x00f00000 +#define SDHCI_STATE_CMD 0x01000000 #define SDHCI_HOST_CONTROL 0x28 #define SDHCI_CTRL_LED 0x01 From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 22:11:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC901C20; Thu, 15 May 2014 22:11: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 A8CD0296E; Thu, 15 May 2014 22:11: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 s4FMBnA6036719; Thu, 15 May 2014 22:11:49 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FMBnKm036539; Thu, 15 May 2014 22:11:49 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405152211.s4FMBnKm036539@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 22:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266199 - in stable/10/sys/arm: arm include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 22:11:49 -0000 Author: ian Date: Thu May 15 22:11:48 2014 New Revision: 266199 URL: http://svnweb.freebsd.org/changeset/base/266199 Log: MFC r261917, r261918, r261919, r261920, r261921, r261922 Always clear L1 PTE descriptor when removing superpage on ARM Invalidate L1 PTE regardles of existance of the corresponding l2_bucket. Ensure proper TLB invalidation on superpage promotion and demotion on ARM Base pages within newly created superpage need to be invalidated so that new mapping is "visible" immediately after creation. Fix superpage promotion on ARM with respect to RO/RW and wired attributes Avoid redundant superpage promotion attempts on ARM Remove spurious assertion from pmap_extract_locked() on ARM Handle pmap_enter() on already promoted mappings for ARMv6/v7 Modified: stable/10/sys/arm/arm/pmap-v6.c stable/10/sys/arm/include/pmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Thu May 15 22:03:24 2014 (r266198) +++ stable/10/sys/arm/arm/pmap-v6.c Thu May 15 22:11:48 2014 (r266199) @@ -2924,10 +2924,21 @@ void pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, vm_prot_t prot, boolean_t wired) { + struct l2_bucket *l2b; rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); pmap_enter_locked(pmap, va, access, m, prot, wired, M_WAITOK); + /* + * If both the l2b_occupancy and the reservation are fully + * populated, then attempt promotion. + */ + l2b = pmap_get_l2_bucket(pmap, va); + if ((l2b != NULL) && (l2b->l2b_occupancy == L2_PTE_NUM_TOTAL) && + sp_enabled && (m->flags & PG_FICTITIOUS) == 0 && + vm_reserv_level_iffullpop(m) == 0) + pmap_promote_section(pmap, va); + PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); } @@ -2962,8 +2973,10 @@ pmap_enter_locked(pmap_t pmap, vm_offset } pl1pd = &pmap->pm_l1->l1_kva[L1_IDX(va)]; - if ((*pl1pd & L1_TYPE_MASK) == L1_S_PROTO) - panic("pmap_enter_locked: attempt pmap_enter_on 1MB page"); + if ((va < VM_MAXUSER_ADDRESS) && + (*pl1pd & L1_TYPE_MASK) == L1_S_PROTO) { + (void)pmap_demote_section(pmap, va); + } user = 0; /* @@ -3003,6 +3016,10 @@ do_l2b_alloc: } } + pl1pd = &pmap->pm_l1->l1_kva[L1_IDX(va)]; + if ((*pl1pd & L1_TYPE_MASK) == L1_S_PROTO) + panic("pmap_enter: attempt to enter on 1MB page, va: %#x", va); + ptep = &l2b->l2b_kva[l2pte_index(va)]; opte = *ptep; @@ -3153,14 +3170,6 @@ validate: if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) cpu_icache_sync_range(va, PAGE_SIZE); - /* - * If both the l2b_occupancy and the reservation are fully - * populated, then attempt promotion. - */ - if ((l2b->l2b_occupancy == L2_PTE_NUM_TOTAL) && - sp_enabled && (m->flags & PG_FICTITIOUS) == 0 && - vm_reserv_level_iffullpop(m) == 0) - pmap_promote_section(pmap, va); } /* @@ -3327,10 +3336,6 @@ pmap_extract_locked(pmap_t pmap, vm_offs l1idx = L1_IDX(va); l1pd = pmap->pm_l1->l1_kva[l1idx]; if (l1pte_section_p(l1pd)) { - /* - * These should only happen for the kernel pmap. - */ - KASSERT(pmap == kernel_pmap, ("unexpected section")); /* XXX: what to do about the bits > 32 ? */ if (l1pd & L1_S_SUPERSEC) pa = (l1pd & L1_SUP_FRAME) | (va & L1_SUP_OFFSET); @@ -3702,13 +3707,14 @@ pmap_remove_section(pmap_t pmap, vm_offs KASSERT(l2b->l2b_occupancy == L2_PTE_NUM_TOTAL, ("pmap_remove_section: l2_bucket occupancy error")); pmap_free_l2_bucket(pmap, l2b, L2_PTE_NUM_TOTAL); - /* - * Now invalidate L1 slot as it was not invalidated in - * pmap_free_l2_bucket() due to L1_TYPE mismatch. - */ - *pl1pd = 0; - PTE_SYNC(pl1pd); } + /* Now invalidate L1 slot */ + *pl1pd = 0; + PTE_SYNC(pl1pd); + if (L1_S_EXECUTABLE(l1pd)) + cpu_tlb_flushID_SE(sva); + else + cpu_tlb_flushD_SE(sva); } /* @@ -3795,10 +3801,13 @@ pmap_promote_section(pmap_t pmap, vm_off * we just configure protections for the section mapping * that is going to be created. */ - if (!L2_S_WRITABLE(firstpte) && (first_pve->pv_flags & PVF_WRITE)) { - first_pve->pv_flags &= ~PVF_WRITE; + if ((first_pve->pv_flags & PVF_WRITE) != 0) { + if (!L2_S_WRITABLE(firstpte)) { + first_pve->pv_flags &= ~PVF_WRITE; + prot &= ~VM_PROT_WRITE; + } + } else prot &= ~VM_PROT_WRITE; - } if (!L2_S_EXECUTABLE(firstpte)) prot &= ~VM_PROT_EXECUTE; @@ -3843,6 +3852,12 @@ pmap_promote_section(pmap_t pmap, vm_off if (!L2_S_WRITABLE(oldpte) && (pve->pv_flags & PVF_WRITE)) pve->pv_flags &= ~PVF_WRITE; + if (pve->pv_flags != first_pve->pv_flags) { + pmap_section_p_failures++; + CTR2(KTR_PMAP, "pmap_promote_section: failure for " + "va %#x in pmap %p", va, pmap); + return; + } old_va -= PAGE_SIZE; pa -= PAGE_SIZE; @@ -3855,6 +3870,24 @@ pmap_promote_section(pmap_t pmap, vm_off * Map the superpage. */ pmap_map_section(pmap, first_va, l2pte_pa(firstpte), prot, TRUE); + /* + * Invalidate all possible TLB mappings for small + * pages within the newly created superpage. + * Rely on the first PTE's attributes since they + * have to be consistent across all of the base pages + * within the superpage. If page is not executable it + * is at least referenced. + * The fastest way to do that is to invalidate whole + * TLB at once instead of executing 256 CP15 TLB + * invalidations by single entry. TLBs usually maintain + * several dozen entries so loss of unrelated entries is + * still a less agresive approach. + */ + if (L2_S_EXECUTABLE(firstpte)) + cpu_tlb_flushID(); + else + cpu_tlb_flushD(); + pmap_section_promotions++; CTR2(KTR_PMAP, "pmap_promote_section: success for va %#x" " in pmap %p", first_va, pmap); @@ -3890,7 +3923,7 @@ pmap_demote_section(pmap_t pmap, vm_offs struct l2_bucket *l2b; struct pv_entry *l1pdpve; struct md_page *pvh; - pd_entry_t *pl1pd, l1pd; + pd_entry_t *pl1pd, l1pd, newl1pd; pt_entry_t *firstptep, newpte; vm_offset_t pa; vm_page_t m; @@ -3970,9 +4003,14 @@ pmap_demote_section(pmap_t pmap, vm_offs pmap_pv_demote_section(pmap, va, pa); /* Now fix-up L1 */ - l1pd = l2b->l2b_phys | L1_C_DOM(pmap->pm_domain) | L1_C_PROTO; - *pl1pd = l1pd; + newl1pd = l2b->l2b_phys | L1_C_DOM(pmap->pm_domain) | L1_C_PROTO; + *pl1pd = newl1pd; PTE_SYNC(pl1pd); + /* Invalidate old TLB mapping */ + if (L1_S_EXECUTABLE(l1pd)) + cpu_tlb_flushID_SE(va); + else if (L1_S_REFERENCED(l1pd)) + cpu_tlb_flushD_SE(va); pmap_section_demotions++; CTR2(KTR_PMAP, "pmap_demote_section: success for va %#x" Modified: stable/10/sys/arm/include/pmap.h ============================================================================== --- stable/10/sys/arm/include/pmap.h Thu May 15 22:03:24 2014 (r266198) +++ stable/10/sys/arm/include/pmap.h Thu May 15 22:11:48 2014 (r266199) @@ -527,6 +527,7 @@ extern int pmap_needs_pte_sync; #define L1_S_PROT_MASK (L1_S_PROT_W|L1_S_PROT_U) #define L1_S_REF (L1_S_AP(AP_REF)) /* Reference flag */ #define L1_S_WRITABLE(pd) (!((pd) & L1_S_PROT_W)) +#define L1_S_EXECUTABLE(pd) (!((pd) & L1_S_XN)) #define L1_S_REFERENCED(pd) ((pd) & L1_S_REF) #define L1_S_PROT(ku, pr) (((((ku) == PTE_KERNEL) ? 0 : L1_S_PROT_U) | \ From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 22:35:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8E5FED7; Thu, 15 May 2014 22:35:07 +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 794DB2B01; Thu, 15 May 2014 22:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FMZ7Cp045999; Thu, 15 May 2014 22:35:07 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FMZ5l0045983; Thu, 15 May 2014 22:35:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405152235.s4FMZ5l0045983@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 22:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266200 - in stable/10/sys: arm/freescale arm/freescale/imx boot/fdt/dts dev/fdt dev/mmc dev/sdhci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 22:35:07 -0000 Author: ian Date: Thu May 15 22:35:04 2014 New Revision: 266200 URL: http://svnweb.freebsd.org/changeset/base/266200 Log: MFC r261938, r261939, r261940, r261944, r261945, r261946, r261947, r261956, r261957, r261983, r261094, r261955, r261958, Add a driver to provide access to imx6 on-chip one-time-programmble data. Make it possible to access the ocotp registers before the ocotp device is attached, by establishing a temporary mapping of the registers when necessary. It turns out Freescale cleverly made the ocotp device compatible across several different families of SoCs, so move it to the freescale directory and prefix everything with fsl rather than imx6. Convert the imx6 sdhci "R1B fix" from a busy-loop in the interrupt handler to a callout. Increase the wait time for acquiring the SD bus from 10 to 250ms. If no compatible cards were found after probing the SD bus, say so. Add timeout logic to sdhci, separate from the timeouts done by the hardware. After a timeout, reset the controller using SDHCI_RESET_CMD|SDHCI_RESET_DATA rather than SDHCI_RESET_ALL; the latter turns off clocks and power, removing any possibility of recovering from the error. Add a helper routine to depth-search the device tree for a node with a matching 'compatible' property. Added: stable/10/sys/arm/freescale/fsl_ocotp.c - copied, changed from r261946, head/sys/arm/freescale/fsl_ocotp.c stable/10/sys/arm/freescale/fsl_ocotpreg.h - copied, changed from r261946, head/sys/arm/freescale/fsl_ocotpreg.h stable/10/sys/arm/freescale/fsl_ocotpvar.h - copied unchanged from r261946, head/sys/arm/freescale/fsl_ocotpvar.h Modified: stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/freescale/imx/imx_sdhci.c stable/10/sys/boot/fdt/dts/imx6.dtsi stable/10/sys/dev/fdt/fdt_common.c stable/10/sys/dev/fdt/fdt_common.h stable/10/sys/dev/mmc/mmc.c stable/10/sys/dev/sdhci/sdhci.c stable/10/sys/dev/sdhci/sdhci.h Directory Properties: stable/10/ (props changed) Copied and modified: stable/10/sys/arm/freescale/fsl_ocotp.c (from r261946, head/sys/arm/freescale/fsl_ocotp.c) ============================================================================== --- head/sys/arm/freescale/fsl_ocotp.c Sat Feb 15 21:21:57 2014 (r261946, copy source) +++ stable/10/sys/arm/freescale/fsl_ocotp.c Thu May 15 22:35:04 2014 (r266200) @@ -46,6 +46,48 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * Find the physical address and size of the ocotp registers and devmap them, + * returning a pointer to the virtual address of the base. + * + * XXX This is temporary until we've worked out all the details of controlling + * the load order of devices. In an ideal world this device would be up and + * running before anything that needs it. When we're at a point to make that + * happen, this little block of code, and the few lines in fsl_ocotp_read_4() + * that refer to it can be deleted. + */ +#include +#include +#include +#include + +static uint32_t *ocotp_regs; +static vm_size_t ocotp_size; + +static void +fsl_ocotp_devmap(void) +{ + phandle_t child, root; + u_long base, size; + + if ((root = OF_finddevice("/")) == 0) + goto fatal; + if ((child = fdt_depth_search_compatible(root, "fsl,imx6q-ocotp", 0)) == 0) + goto fatal; + if (fdt_regsize(child, &base, &size) != 0) + goto fatal; + + ocotp_size = (vm_size_t)size; + + if ((ocotp_regs = pmap_mapdev((vm_offset_t)base, ocotp_size)) == NULL) + goto fatal; + + return; +fatal: + panic("cannot find/map the ocotp registers"); +} +/* XXX end of temporary code */ + struct ocotp_softc { device_t dev; struct resource *mem_res; @@ -56,23 +98,16 @@ static struct ocotp_softc *ocotp_sc; static inline uint32_t RD4(struct ocotp_softc *sc, bus_size_t off) { + return (bus_read_4(sc->mem_res, off)); } - static int ocotp_detach(device_t dev) { - struct ocotp_softc *sc; - sc = device_get_softc(dev); - - if (sc->mem_res != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); - - ocotp_sc = NULL; - - return (0); + /* The ocotp registers are always accessible. */ + return (EBUSY); } static int @@ -95,6 +130,11 @@ ocotp_attach(device_t dev) } ocotp_sc = sc; + + /* We're done with the temporary mapping now. */ + if (ocotp_regs != NULL) + pmap_unmapdev((vm_offset_t)ocotp_regs, ocotp_size); + err = 0; out: @@ -111,11 +151,11 @@ ocotp_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "fsl,fslq-ocotp") == 0) + if (ofw_bus_is_compatible(dev, "fsl,imx6q-ocotp") == 0) return (ENXIO); device_set_desc(dev, - "Freescale i.MX6 On-Chip One-Time-Programmable Memory"); + "Freescale On-Chip One-Time-Programmable Memory"); return (BUS_PROBE_DEFAULT); } @@ -124,13 +164,23 @@ uint32_t fsl_ocotp_read_4(bus_size_t off) { - if (ocotp_sc == NULL) - panic("fsl_ocotp_read_4: softc not set!"); - if (off > FSL_OCOTP_LAST_REG) panic("fsl_ocotp_read_4: offset out of range"); - return (RD4(ocotp_sc, off)); + /* If we have a softcontext use the regular bus_space read. */ + if (ocotp_sc != NULL) + return (RD4(ocotp_sc, off)); + + /* + * Otherwise establish a tempory device mapping if necessary, and read + * the device without any help from bus_space. + * + * XXX Eventually the code from there down can be deleted. + */ + if (ocotp_regs == NULL) + fsl_ocotp_devmap(); + + return (ocotp_regs[off / 4]); } static device_method_t ocotp_methods[] = { Copied and modified: stable/10/sys/arm/freescale/fsl_ocotpreg.h (from r261946, head/sys/arm/freescale/fsl_ocotpreg.h) ============================================================================== --- head/sys/arm/freescale/fsl_ocotpreg.h Sat Feb 15 21:21:57 2014 (r261946, copy source) +++ stable/10/sys/arm/freescale/fsl_ocotpreg.h Thu May 15 22:35:04 2014 (r266200) @@ -48,6 +48,13 @@ #define FSL_OCOTP_CFG1 0x420 #define FSL_OCOTP_CFG2 0x430 #define FSL_OCOTP_CFG3 0x440 +#define FSL_OCOTP_CFG3_SPEED_SHIFT 16 +#define FSL_OCOTP_CFG3_SPEED_MASK \ + (0x03 << FSL_OCOTP_CFG3_SPEED_SHIFT) +#define FSL_OCOTP_CFG3_SPEED_792MHZ 0 +#define FSL_OCOTP_CFG3_SPEED_852MHZ 1 +#define FSL_OCOTP_CFG3_SPEED_996MHZ 2 +#define FSL_OCOTP_CFG3_SPEED_1200MHZ 3 #define FSL_OCOTP_CFG4 0x450 #define FSL_OCOTP_CFG5 0x460 #define FSL_OCOTP_CFG6 0x470 Copied: stable/10/sys/arm/freescale/fsl_ocotpvar.h (from r261946, head/sys/arm/freescale/fsl_ocotpvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/fsl_ocotpvar.h Thu May 15 22:35:04 2014 (r266200, copy of r261946, head/sys/arm/freescale/fsl_ocotpvar.h) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2014 Steven Lawrance + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef FSL_OCOTPVAR_H +#define FSL_OCOTPVAR_H + +uint32_t fsl_ocotp_read_4(bus_size_t _offset); + +#endif Modified: stable/10/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx6 Thu May 15 22:11:48 2014 (r266199) +++ stable/10/sys/arm/freescale/imx/files.imx6 Thu May 15 22:35:04 2014 (r266200) @@ -17,6 +17,7 @@ kern/kern_clocksource.c standard arm/arm/gic.c standard arm/arm/pl310.c standard arm/freescale/imx/bus_space.c standard +arm/freescale/fsl_ocotp.c standard arm/freescale/imx/common.c standard arm/freescale/imx/imx6_anatop.c standard arm/freescale/imx/imx6_ccm.c standard Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_sdhci.c Thu May 15 22:11:48 2014 (r266199) +++ stable/10/sys/arm/freescale/imx/imx_sdhci.c Thu May 15 22:35:04 2014 (r266200) @@ -35,13 +35,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include +#include #include #include +#include #include #include #include +#include #include #include @@ -65,6 +70,8 @@ struct imx_sdhci_softc { struct resource * irq_res; void * intr_cookie; struct sdhci_slot slot; + struct callout r1bfix_callout; + sbintime_t r1bfix_timeout_at; uint32_t baseclk_hz; uint32_t sdclockreg_freq_bits; uint32_t cmd_and_mode; @@ -130,6 +137,8 @@ struct imx_sdhci_softc { #define SDHC_PROT_CDTL (1 << 6) #define SDHC_PROT_CDSS (1 << 7) +#define SDHC_INT_STATUS 0x30 + #define SDHC_CLK_IPGEN (1 << 0) #define SDHC_CLK_HCKEN (1 << 1) #define SDHC_CLK_PEREN (1 << 2) @@ -147,6 +156,7 @@ static struct ofw_compat_data compat_dat };; static void imx_sdhc_set_clock(struct imx_sdhci_softc *sc, int enable); +static void imx_sdhci_r1bfix_func(void *arg); static inline uint32_t RD4(struct imx_sdhci_softc *sc, bus_size_t off) @@ -532,46 +542,107 @@ imx_sdhc_set_clock(struct imx_sdhci_soft RD4(sc, SDHC_VEND_SPEC) | SDHC_VEND_FRC_SDCLK_ON); } +static boolean_t +imx_sdhci_r1bfix_is_wait_done(struct imx_sdhci_softc *sc) +{ + uint32_t inhibit; + + mtx_assert(&sc->slot.mtx, MA_OWNED); + + /* + * Check the DAT0 line status using both the DLA (data line active) and + * CDIHB (data inhibit) bits in the present state register. In theory + * just DLA should do the trick, but in practice it takes both. If the + * DAT0 line is still being held and we're not yet beyond the timeout + * point, just schedule another callout to check again later. + */ + inhibit = RD4(sc, SDHC_PRES_STATE) & (SDHC_PRES_DLA | SDHC_PRES_CDIHB); + + if (inhibit && getsbinuptime() < sc->r1bfix_timeout_at) { + callout_reset_sbt(&sc->r1bfix_callout, SBT_1MS, 0, + imx_sdhci_r1bfix_func, sc, 0); + return (false); + } + + /* + * If we reach this point with the inhibit bits still set, we've got a + * timeout, synthesize a DATA_TIMEOUT interrupt. Otherwise the DAT0 + * line has been released, and we synthesize a DATA_END, and if the type + * of fix needed was on a command-without-data we also now add in the + * original INT_RESPONSE that we suppressed earlier. + */ + if (inhibit) + sc->r1bfix_intmask |= SDHCI_INT_DATA_TIMEOUT; + else { + sc->r1bfix_intmask |= SDHCI_INT_DATA_END; + if (sc->r1bfix_type == R1BFIX_NODATA) + sc->r1bfix_intmask |= SDHCI_INT_RESPONSE; + } + + sc->r1bfix_type = R1BFIX_NONE; + return (true); +} + +static void +imx_sdhci_r1bfix_func(void * arg) +{ + struct imx_sdhci_softc *sc = arg; + boolean_t r1bwait_done; + + mtx_lock(&sc->slot.mtx); + r1bwait_done = imx_sdhci_r1bfix_is_wait_done(sc); + mtx_unlock(&sc->slot.mtx); + if (r1bwait_done) + sdhci_generic_intr(&sc->slot); +} + static void imx_sdhci_intr(void *arg) { struct imx_sdhci_softc *sc = arg; uint32_t intmask; - intmask = RD4(sc, SDHCI_INT_STATUS); + mtx_lock(&sc->slot.mtx); /* * Manually check the DAT0 line for R1B response types that the - * controller fails to handle properly. + * controller fails to handle properly. The controller asserts the done + * interrupt while the card is still asserting busy with the DAT0 line. * - * To do the NODATA fix, when the RESPONSE (COMMAND_COMPLETE) interrupt - * occurs, we have to wait for the DAT0 line to be released, then - * synthesize a DATA_END (TRANSFER_COMPLETE) interrupt, which we do by - * storing SDHCI_INT_DATA_END into a variable that gets ORed into the - * return value when the SDHCI_INT_STATUS register is read. + * We check DAT0 immediately because most of the time, especially on a + * read, the card will actually be done by time we get here. If it's + * not, then the wait_done routine will schedule a callout to re-check + * periodically until it is done. In that case we clear the interrupt + * out of the hardware now so that we can present it later when the DAT0 + * line is released. * - * For the AC12 fix, when the DATA_END interrupt occurs we wait for the - * DAT0 line to be released, and the waiting is all the fix we need. - */ - if ((sc->r1bfix_type == R1BFIX_NODATA && - (intmask & SDHCI_INT_RESPONSE)) || - (sc->r1bfix_type == R1BFIX_AC12 && - (intmask & SDHCI_INT_DATA_END))) { - uint32_t count; - count = 0; - /* XXX use a callout or something instead of busy-waiting. */ - while (count < 250000 && - (RD4(sc, SDHC_PRES_STATE) & SDHC_PRES_DLA)) { - ++count; - DELAY(1); + * If we need to wait for the the DAT0 line to be released, we set up a + * timeout point 250ms in the future. This number comes from the SD + * spec, which allows a command to take that long. In the real world, + * cards tend to take 10-20ms for a long-running command such as a write + * or erase that spans two pages. + */ + switch (sc->r1bfix_type) { + case R1BFIX_NODATA: + intmask = RD4(sc, SDHC_INT_STATUS) & SDHCI_INT_RESPONSE; + break; + case R1BFIX_AC12: + intmask = RD4(sc, SDHC_INT_STATUS) & SDHCI_INT_DATA_END; + break; + default: + intmask = 0; + break; + } + if (intmask) { + sc->r1bfix_timeout_at = getsbinuptime() + 250 * SBT_1MS; + if (!imx_sdhci_r1bfix_is_wait_done(sc)) { + WR4(sc, SDHC_INT_STATUS, intmask); + bus_barrier(sc->mem_res, SDHC_INT_STATUS, 4, + BUS_SPACE_BARRIER_WRITE); } - if (count >= 250000) - sc->r1bfix_intmask = SDHCI_INT_DATA_TIMEOUT; - else if (sc->r1bfix_type == R1BFIX_NODATA) - sc->r1bfix_intmask = SDHCI_INT_DATA_END; - sc->r1bfix_type = R1BFIX_NONE; } + mtx_unlock(&sc->slot.mtx); sdhci_generic_intr(&sc->slot); } @@ -660,6 +731,7 @@ imx_sdhci_attach(device_t dev) } sdhci_init_slot(dev, &sc->slot, 0); + callout_init(&sc->r1bfix_callout, true); /* * If the slot is flagged with the non-removable property, set our flag @@ -670,7 +742,7 @@ imx_sdhci_attach(device_t dev) * We don't have gpio support yet. If there's a cd-gpios property just * force the SDHCI_CARD_PRESENT bit on for now. If there isn't really a * card there it will fail to probe at the mmc layer and nothing bad - * happens except instantiating a /dev/mmcN device for an empty slot. + * happens except instantiating an mmcN device for an empty slot. */ node = ofw_bus_get_node(dev); if (OF_hasprop(node, "non-removable")) Modified: stable/10/sys/boot/fdt/dts/imx6.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/imx6.dtsi Thu May 15 22:11:48 2014 (r266199) +++ stable/10/sys/boot/fdt/dts/imx6.dtsi Thu May 15 22:35:04 2014 (r266200) @@ -337,6 +337,11 @@ bus-width = <0x4>; status ="disabled"; }; + + ocotp0: ocotp@021bc000 { + compatible = "fsl,imx6q-ocotp"; + reg = <0x021bc000 0x4000>; + } }; }; }; Modified: stable/10/sys/dev/fdt/fdt_common.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.c Thu May 15 22:11:48 2014 (r266199) +++ stable/10/sys/dev/fdt/fdt_common.c Thu May 15 22:35:04 2014 (r266200) @@ -223,6 +223,27 @@ fdt_find_compatible(phandle_t start, con return (0); } +phandle_t +fdt_depth_search_compatible(phandle_t start, const char *compat, int strict) +{ + phandle_t child, node; + + /* + * Depth-search all descendants of 'start' node, and find first with + * matching 'compatible' property. + */ + for (node = OF_child(start); node != 0; node = OF_peer(node)) { + if (fdt_is_compatible(node, compat) && + (strict == 0 || fdt_is_compatible_strict(node, compat))) { + return (node); + } + child = fdt_depth_search_compatible(node, compat, strict); + if (child != 0) + return (child); + } + return (0); +} + int fdt_is_enabled(phandle_t node) { @@ -483,11 +504,23 @@ fdt_intr_to_rl(device_t dev, phandle_t n nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { - iparent = 0; - OF_searchencprop(node, "interrupt-parent", &iparent, - sizeof(iparent)); - OF_searchencprop(OF_xref_phandle(iparent), "#interrupt-cells", - &icells, sizeof(icells)); + if (OF_searchencprop(node, "interrupt-parent", &iparent, + sizeof(iparent)) == -1) { + device_printf(dev, "No interrupt-parent found, " + "assuming direct parent\n"); + iparent = OF_parent(node); + } + if (OF_searchencprop(OF_xref_phandle(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells property, " + "assuming <1>\n"); + icells = 1; + } + if (icells < 1 || icells > nintr) { + device_printf(dev, "Invalid #interrupt-cells property " + "value <%d>, assuming <1>\n", icells); + icells = 1; + } for (i = 0, k = 0; i < nintr; i += icells, k++) { intr[i] = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); Modified: stable/10/sys/dev/fdt/fdt_common.h ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.h Thu May 15 22:11:48 2014 (r266199) +++ stable/10/sys/dev/fdt/fdt_common.h Thu May 15 22:35:04 2014 (r266200) @@ -81,6 +81,7 @@ u_long fdt_data_get(void *, int); int fdt_data_to_res(pcell_t *, int, int, u_long *, u_long *); int fdt_data_verify(void *, int); phandle_t fdt_find_compatible(phandle_t, const char *, int); +phandle_t fdt_depth_search_compatible(phandle_t, const char *, int); int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *); int fdt_get_reserved_regions(struct mem_region *, int *); int fdt_get_phyaddr(phandle_t, device_t, int *, void **); Modified: stable/10/sys/dev/mmc/mmc.c ============================================================================== --- stable/10/sys/dev/mmc/mmc.c Thu May 15 22:11:48 2014 (r266199) +++ stable/10/sys/dev/mmc/mmc.c Thu May 15 22:35:04 2014 (r266200) @@ -1572,6 +1572,7 @@ mmc_go_discovery(struct mmc_softc *sc) if (bootverbose || mmc_debug) device_printf(sc->dev, "Current OCR: 0x%08x\n", mmcbr_get_ocr(dev)); if (mmcbr_get_ocr(dev) == 0) { + device_printf(sc->dev, "No compatible cards found on bus\n"); mmc_delete_cards(sc); mmc_power_down(sc); return; Modified: stable/10/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.c Thu May 15 22:11:48 2014 (r266199) +++ stable/10/sys/dev/sdhci/sdhci.c Thu May 15 22:35:04 2014 (r266200) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -609,6 +610,7 @@ sdhci_init_slot(device_t dev, struct sdh TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); callout_init(&slot->card_callout, 1); + callout_init_mtx(&slot->timeout_callout, &slot->mtx, 0); return (0); } @@ -623,6 +625,7 @@ sdhci_cleanup_slot(struct sdhci_slot *sl { device_t d; + callout_drain(&slot->timeout_callout); callout_drain(&slot->card_callout); taskqueue_drain(taskqueue_swi_giant, &slot->card_task); @@ -702,6 +705,32 @@ sdhci_generic_update_ios(device_t brdev, return (0); } +static void +sdhci_req_done(struct sdhci_slot *slot) +{ + struct mmc_request *req; + + if (slot->req != NULL && slot->curcmd != NULL) { + callout_stop(&slot->timeout_callout); + req = slot->req; + slot->req = NULL; + slot->curcmd = NULL; + req->done(req); + } +} + +static void +sdhci_timeout(void *arg) +{ + struct sdhci_slot *slot = arg; + + if (slot->curcmd != NULL) { + sdhci_reset(slot, SDHCI_RESET_CMD|SDHCI_RESET_DATA); + slot->curcmd->error = MMC_ERR_TIMEOUT; + sdhci_req_done(slot); + } +} + static void sdhci_set_transfer_mode(struct sdhci_slot *slot, struct mmc_data *data) @@ -727,7 +756,6 @@ sdhci_set_transfer_mode(struct sdhci_slo static void sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) { - struct mmc_request *req = slot->req; int flags, timeout; uint32_t mask, state; @@ -740,9 +768,7 @@ sdhci_start_command(struct sdhci_slot *s if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) { slot_printf(slot, "Unsupported response type!\n"); cmd->error = MMC_ERR_FAILED; - slot->req = NULL; - slot->curcmd = NULL; - req->done(req); + sdhci_req_done(slot); return; } @@ -754,9 +780,7 @@ sdhci_start_command(struct sdhci_slot *s slot->power == 0 || slot->clock == 0) { cmd->error = MMC_ERR_FAILED; - slot->req = NULL; - slot->curcmd = NULL; - req->done(req); + sdhci_req_done(slot); return; } /* Always wait for free CMD bus. */ @@ -767,17 +791,24 @@ sdhci_start_command(struct sdhci_slot *s /* We shouldn't wait for DAT for stop commands. */ if (cmd == slot->req->stop) mask &= ~SDHCI_DAT_INHIBIT; - /* Wait for bus no more then 10 ms. */ - timeout = 10; + /* + * Wait for bus no more then 250 ms. Typically there will be no wait + * here at all, but when writing a crash dump we may be bypassing the + * host platform's interrupt handler, and in some cases that handler + * may be working around hardware quirks such as not respecting r1b + * busy indications. In those cases, this wait-loop serves the purpose + * of waiting for the prior command and data transfers to be done, and + * SD cards are allowed to take up to 250ms for write and erase ops. + * (It's usually more like 20-30ms in the real world.) + */ + timeout = 250; while (state & mask) { if (timeout == 0) { slot_printf(slot, "Controller never released " "inhibit bit(s).\n"); sdhci_dumpregs(slot); cmd->error = MMC_ERR_FAILED; - slot->req = NULL; - slot->curcmd = NULL; - req->done(req); + sdhci_req_done(slot); return; } timeout--; @@ -819,6 +850,8 @@ sdhci_start_command(struct sdhci_slot *s sdhci_set_transfer_mode(slot, cmd->data); /* Start command. */ WR2(slot, SDHCI_COMMAND_FLAGS, (cmd->opcode << 8) | (flags & 0xff)); + /* Start timeout callout. */ + callout_reset(&slot->timeout_callout, 2*hz, sdhci_timeout, slot); } static void @@ -1004,10 +1037,7 @@ sdhci_start(struct sdhci_slot *slot) sdhci_reset(slot, SDHCI_RESET_DATA); } - /* We must be done -- bad idea to do this while locked? */ - slot->req = NULL; - slot->curcmd = NULL; - req->done(req); + sdhci_req_done(slot); } int Modified: stable/10/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.h Thu May 15 22:11:48 2014 (r266199) +++ stable/10/sys/dev/sdhci/sdhci.h Thu May 15 22:35:04 2014 (r266200) @@ -241,6 +241,7 @@ struct sdhci_slot { bus_addr_t paddr; /* DMA buffer address */ struct task card_task; /* Card presence check task */ struct callout card_callout; /* Card insert delay callout */ + struct callout timeout_callout;/* Card command/data response timeout */ struct mmc_host host; /* Host parameters */ struct mmc_request *req; /* Current request */ struct mmc_command *curcmd; /* Current command of current request */ From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 22:50:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D2A4A380; Thu, 15 May 2014 22:50:08 +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 BCFFF2BEB; Thu, 15 May 2014 22:50:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FMo8X0051318; Thu, 15 May 2014 22:50:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FMo6tG051305; Thu, 15 May 2014 22:50:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405152250.s4FMo6tG051305@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 22:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266201 - in stable/10/sys: arm/arm arm/conf arm/freescale/imx arm/freescale/vybrid arm/include boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 22:50:08 -0000 Author: ian Date: Thu May 15 22:50:06 2014 New Revision: 266201 URL: http://svnweb.freebsd.org/changeset/base/266201 Log: MFC r261982, r261987, r262123, r262244, r262278, r262280, r262353, r262354, r262355, r262419, Add Vybrid driver for Synchronous Audio Interface (SAI). Decrease SAI buffer size. Handle eDMA interrupt on running channel only. Give the physmem fdt helper routines static linkage since no global definition of them is provided anywhere. Add imx6 early printf support, wrapped in #if 0 because it's rarely needed. Add basic cpu frequency control and temperature monitoring to imx6_anatop. Add the FREEBSD_BOOT_LOADER option so that a loaded DTB passed in from ubldr will actually get used. Create a generic IMX6 kernel config, then fix it to have an ident line. Don't force imx6 bootverbose on anymore, it can be set from ubldr now. Added: stable/10/sys/arm/conf/IMX6 - copied, changed from r262354, head/sys/arm/conf/IMX6 stable/10/sys/arm/freescale/vybrid/vf_sai.c - copied, changed from r261982, head/sys/arm/freescale/vybrid/vf_sai.c Modified: stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/conf/WANDBOARD.common stable/10/sys/arm/freescale/imx/imx6_anatop.c stable/10/sys/arm/freescale/imx/imx6_anatopreg.h stable/10/sys/arm/freescale/imx/imx6_anatopvar.h stable/10/sys/arm/freescale/imx/imx6_machdep.c stable/10/sys/arm/freescale/vybrid/files.vybrid stable/10/sys/arm/include/physmem.h stable/10/sys/boot/fdt/dts/imx6.dtsi stable/10/sys/boot/fdt/dts/vybrid.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Thu May 15 22:35:04 2014 (r266200) +++ stable/10/sys/arm/arm/machdep.c Thu May 15 22:50:06 2014 (r266201) @@ -1167,7 +1167,6 @@ initarm(struct arm_boot_params *abp) (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - /* Map L1 directory and allocated L2 page tables */ pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); Copied and modified: stable/10/sys/arm/conf/IMX6 (from r262354, head/sys/arm/conf/IMX6) ============================================================================== --- head/sys/arm/conf/IMX6 Sun Feb 23 01:48:07 2014 (r262354, copy source) +++ stable/10/sys/arm/conf/IMX6 Thu May 15 22:50:06 2014 (r266201) @@ -17,6 +17,7 @@ # # $FreeBSD$ +ident IMX6 include "../freescale/imx/std.imx6" options HZ=250 # Scheduling quantum is 4 milliseconds. Modified: stable/10/sys/arm/conf/WANDBOARD.common ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD.common Thu May 15 22:35:04 2014 (r266200) +++ stable/10/sys/arm/conf/WANDBOARD.common Thu May 15 22:50:06 2014 (r266201) @@ -153,3 +153,5 @@ device mmcsd # SDCard disk device device ffec # Freescale Fast Ethernet Controller +options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) + Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Thu May 15 22:35:04 2014 (r266200) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Thu May 15 22:50:06 2014 (r266201) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Ian Lepore + * Copyright (c) 2014 Steven Lawrance * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,6 +30,8 @@ __FBSDID("$FreeBSD$"); /* * Analog PLL and power regulator driver for Freescale i.MX6 family of SoCs. + * Also, temperature montoring and cpu frequency control. It was Freescale who + * kitchen-sinked this device, not us. :) * * We don't really do anything with analog PLLs, but the registers for * controlling them belong to the same block as the power regulator registers. @@ -42,11 +45,19 @@ __FBSDID("$FreeBSD$"); * I have no idea where the "anatop" name comes from. It's in the standard DTS * source describing i.MX6 SoCs, and in the linux and u-boot code which comes * from Freescale, but it's not in the SoC manual. + * + * Note that temperature values throughout this code are handled in two types of + * units. Items with '_cnt' in the name use the hardware temperature count + * units (higher counts are lower temperatures). Items with '_val' in the name + * are deci-Celcius, which are converted to/from deci-Kelvins in the sysctl + * handlers (dK is the standard unit for temperature in sysctl). */ #include #include +#include #include +#include #include #include #include @@ -56,68 +67,410 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include +static struct resource_spec imx6_anatop_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; +#define MEMRES 0 +#define IRQRES 1 + struct imx6_anatop_softc { device_t dev; - struct resource *mem_res; + struct resource *res[2]; + uint32_t cpu_curhz; + uint32_t cpu_curmhz; + uint32_t cpu_minhz; + uint32_t cpu_maxhz; + uint32_t refosc_hz; + void *temp_intrhand; + uint32_t temp_high_val; + uint32_t temp_high_cnt; + uint32_t temp_last_cnt; + uint32_t temp_room_cnt; + struct callout temp_throttle_callout; + sbintime_t temp_throttle_delay; + uint32_t temp_throttle_reset_cnt; + uint32_t temp_throttle_trigger_cnt; + uint32_t temp_throttle_val; }; static struct imx6_anatop_softc *imx6_anatop_sc; +/* + * Table of CPU max frequencies. This is indexed by the max frequency value + * (0-3) from the ocotp CFG3 register. + */ +static uint32_t imx6_cpu_maxhz_tab[] = { + 792000000, 852000000, 996000000, 1200000000 +}; + +#define TZ_ZEROC 2732 /* deci-Kelvin <-> deci-Celcius offset. */ + uint32_t imx6_anatop_read_4(bus_size_t offset) { - return (bus_read_4(imx6_anatop_sc->mem_res, offset)); + KASSERT(imx6_anatop_sc != NULL, ("imx6_anatop_read_4 sc NULL")); + + return (bus_read_4(imx6_anatop_sc->res[MEMRES], offset)); } void imx6_anatop_write_4(bus_size_t offset, uint32_t value) { - bus_write_4(imx6_anatop_sc->mem_res, offset, value); + KASSERT(imx6_anatop_sc != NULL, ("imx6_anatop_write_4 sc NULL")); + + bus_write_4(imx6_anatop_sc->res[MEMRES], offset, value); +} + +static inline uint32_t +cpufreq_hz_from_div(struct imx6_anatop_softc *sc, uint32_t div) +{ + + return (sc->refosc_hz * (div / 2)); +} + +static inline uint32_t +cpufreq_hz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_hz) +{ + + return (cpu_hz / (sc->refosc_hz / 2)); +} + +static inline uint32_t +cpufreq_actual_hz(struct imx6_anatop_softc *sc, uint32_t cpu_hz) +{ + + return (cpufreq_hz_from_div(sc, cpufreq_hz_to_div(sc, cpu_hz))); +} + +static void +cpufreq_set_clock(struct imx6_anatop_softc * sc, uint32_t cpu_newhz) +{ + uint32_t div, timeout, wrk32; + const uint32_t mindiv = 54; + const uint32_t maxdiv = 108; + + /* + * Clip the requested frequency to the configured max, then clip the + * resulting divisor to the documented min/max values. + */ + cpu_newhz = min(cpu_newhz, sc->cpu_maxhz); + div = cpufreq_hz_to_div(sc, cpu_newhz); + if (div < mindiv) + div = mindiv; + else if (div > maxdiv) + div = maxdiv; + sc->cpu_curhz = cpufreq_hz_from_div(sc, div); + sc->cpu_curmhz = sc->cpu_curhz / 1000000; + + /* + * I can't find a documented procedure for changing the ARM PLL divisor, + * but some trial and error came up with this: + * - Set the bypass clock source to REF_CLK_24M (source #0). + * - Set the PLL into bypass mode; cpu should now be running at 24mhz. + * - Change the divisor. + * - Wait for the LOCK bit to come on; it takes ~50 loop iterations. + * - Turn off bypass mode; cpu should now be running at cpu_newhz. + */ + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, + IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK); + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_SET, + IMX6_ANALOG_CCM_PLL_ARM_BYPASS); + + wrk32 = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM); + wrk32 &= ~IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; + wrk32 |= div; + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM, wrk32); + + timeout = 10000; + while ((imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & + IMX6_ANALOG_CCM_PLL_ARM_LOCK) == 0) + if (--timeout == 0) + panic("imx6_set_cpu_clock(): PLL never locked"); + + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, + IMX6_ANALOG_CCM_PLL_ARM_BYPASS); +} + +static void +cpufreq_initialize(struct imx6_anatop_softc *sc) +{ + uint32_t cfg3speed; + struct sysctl_ctx_list *ctx; + + ctx = device_get_sysctl_ctx(sc->dev); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "cpu_mhz", CTLFLAG_RD, &sc->cpu_curmhz, 0, + "CPU frequency in MHz"); + + /* + * XXX 24mhz shouldn't be hard-coded, should get this from imx6_ccm + * (even though in the real world it will always be 24mhz). Oh wait a + * sec, I never wrote imx6_ccm. + */ + sc->refosc_hz = 24000000; + + /* + * Get the maximum speed this cpu can be set to. The values in the + * OCOTP CFG3 register are not documented in the reference manual. + * The following info was in an archived email found via web search: + * - 2b'11: 1200000000Hz; + * - 2b'10: 996000000Hz; + * - 2b'01: 852000000Hz; -- i.MX6Q Only, exclusive with 996MHz. + * - 2b'00: 792000000Hz; + */ + cfg3speed = (fsl_ocotp_read_4(FSL_OCOTP_CFG3) & + FSL_OCOTP_CFG3_SPEED_MASK) >> FSL_OCOTP_CFG3_SPEED_SHIFT; + + sc->cpu_minhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[0]); + sc->cpu_maxhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[cfg3speed]); + + /* + * Set the CPU to maximum speed. + * + * We won't have thermal throttling until interrupts are enabled, but we + * want to run at full speed through all the device init stuff. This + * basically assumes that a single core can't overheat before interrupts + * are enabled; empirical testing shows that to be a safe assumption. + */ + cpufreq_set_clock(sc, sc->cpu_maxhz); + device_printf(sc->dev, "CPU frequency %uMHz\n", sc->cpu_curmhz); +} + +static inline uint32_t +temp_from_count(struct imx6_anatop_softc *sc, uint32_t count) +{ + + return (((sc->temp_high_val - (count - sc->temp_high_cnt) * + (sc->temp_high_val - 250) / + (sc->temp_room_cnt - sc->temp_high_cnt)))); +} + +static inline uint32_t +temp_to_count(struct imx6_anatop_softc *sc, uint32_t temp) +{ + + return ((sc->temp_room_cnt - sc->temp_high_cnt) * + (sc->temp_high_val - temp) / (sc->temp_high_val - 250) + + sc->temp_high_cnt); +} + +static void +temp_update_count(struct imx6_anatop_softc *sc) +{ + uint32_t val; + + val = imx6_anatop_read_4(IMX6_ANALOG_TEMPMON_TEMPSENSE0); + if (!(val & IMX6_ANALOG_TEMPMON_TEMPSENSE0_VALID)) + return; + sc->temp_last_cnt = + (val & IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_MASK) >> + IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT; } static int -imx6_anatop_detach(device_t dev) +temp_sysctl_handler(SYSCTL_HANDLER_ARGS) { - struct imx6_anatop_softc *sc; + struct imx6_anatop_softc *sc = arg1; + uint32_t t; - sc = device_get_softc(dev); + temp_update_count(sc); - if (sc->mem_res != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + t = temp_from_count(sc, sc->temp_last_cnt) + TZ_ZEROC; - return (0); + return (sysctl_handle_int(oidp, &t, 0, req)); +} + +static int +temp_throttle_sysctl_handler(SYSCTL_HANDLER_ARGS) +{ + struct imx6_anatop_softc *sc = arg1; + int err; + uint32_t temp; + + temp = sc->temp_throttle_val + TZ_ZEROC; + err = sysctl_handle_int(oidp, &temp, 0, req); + if (temp < TZ_ZEROC) + return (ERANGE); + temp -= TZ_ZEROC; + if (err != 0 || req->newptr == NULL || temp == sc->temp_throttle_val) + return (err); + + /* Value changed, update counts in softc and hardware. */ + sc->temp_throttle_val = temp; + sc->temp_throttle_trigger_cnt = temp_to_count(sc, sc->temp_throttle_val); + sc->temp_throttle_reset_cnt = temp_to_count(sc, sc->temp_throttle_val - 100); + imx6_anatop_write_4(IMX6_ANALOG_TEMPMON_TEMPSENSE0_CLR, + IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_MASK); + imx6_anatop_write_4(IMX6_ANALOG_TEMPMON_TEMPSENSE0_SET, + (sc->temp_throttle_trigger_cnt << + IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT)); + return (err); +} + +static void +tempmon_gofast(struct imx6_anatop_softc *sc) +{ + + if (sc->cpu_curhz < sc->cpu_maxhz) { + cpufreq_set_clock(sc, sc->cpu_maxhz); + } +} + +static void +tempmon_goslow(struct imx6_anatop_softc *sc) +{ + + if (sc->cpu_curhz > sc->cpu_minhz) { + cpufreq_set_clock(sc, sc->cpu_minhz); + } +} + +static int +tempmon_intr(void *arg) +{ + struct imx6_anatop_softc *sc = arg; + + /* + * XXX Note that this code doesn't currently run (for some mysterious + * reason we just never get an interrupt), so the real monitoring is + * done by tempmon_throttle_check(). + */ + tempmon_goslow(sc); + /* XXX Schedule callout to speed back up eventually. */ + return (FILTER_HANDLED); +} + +static void +tempmon_throttle_check(void *arg) +{ + struct imx6_anatop_softc *sc = arg; + + /* Lower counts are higher temperatures. */ + if (sc->temp_last_cnt < sc->temp_throttle_trigger_cnt) + tempmon_goslow(sc); + else if (sc->temp_last_cnt > (sc->temp_throttle_reset_cnt)) + tempmon_gofast(sc); + + callout_reset_sbt(&sc->temp_throttle_callout, sc->temp_throttle_delay, + 0, tempmon_throttle_check, sc, 0); + +} + +static void +initialize_tempmon(struct imx6_anatop_softc *sc) +{ + uint32_t cal; + struct sysctl_ctx_list *ctx; + + /* + * Fetch calibration data: a sensor count at room temperature (25C), + * a sensor count at a high temperature, and that temperature + */ + cal = fsl_ocotp_read_4(FSL_OCOTP_ANA1); + sc->temp_room_cnt = (cal & 0xFFF00000) >> 20; + sc->temp_high_cnt = (cal & 0x000FFF00) >> 8; + sc->temp_high_val = (cal & 0x000000FF) * 10; + + /* + * Throttle to a lower cpu freq at 10C below the "hot" temperature, and + * reset back to max cpu freq at 5C below the trigger. + */ + sc->temp_throttle_val = sc->temp_high_val - 100; + sc->temp_throttle_trigger_cnt = + temp_to_count(sc, sc->temp_throttle_val); + sc->temp_throttle_reset_cnt = + temp_to_count(sc, sc->temp_throttle_val - 50); + + /* + * Set the sensor to sample automatically at 16Hz (32.768KHz/0x800), set + * the throttle count, and begin making measurements. + */ + imx6_anatop_write_4(IMX6_ANALOG_TEMPMON_TEMPSENSE1, 0x0800); + imx6_anatop_write_4(IMX6_ANALOG_TEMPMON_TEMPSENSE0, + (sc->temp_throttle_trigger_cnt << + IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT) | + IMX6_ANALOG_TEMPMON_TEMPSENSE0_MEASURE); + + /* + * XXX Note that the alarm-interrupt feature isn't working yet, so + * we'll use a callout handler to check at 10Hz. Make sure we have an + * initial temperature reading before starting up the callouts so we + * don't get a bogus reading of zero. + */ + while (sc->temp_last_cnt == 0) + temp_update_count(sc); + sc->temp_throttle_delay = 100 * SBT_1MS; + callout_init(&sc->temp_throttle_callout, 0); + callout_reset_sbt(&sc->temp_throttle_callout, sc->temp_throttle_delay, + 0, tempmon_throttle_check, sc, 0); + + ctx = device_get_sysctl_ctx(sc->dev); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + temp_sysctl_handler, "IK", "Current die temperature"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "throttle_temperature", CTLTYPE_INT | CTLFLAG_RW, sc, + 0, temp_throttle_sysctl_handler, "IK", + "Throttle CPU when exceeding this temperature"); +} + +static int +imx6_anatop_detach(device_t dev) +{ + + return (EBUSY); } static int imx6_anatop_attach(device_t dev) { struct imx6_anatop_softc *sc; - int err, rid; + int err; sc = device_get_softc(dev); + sc->dev = dev; /* Allocate bus_space resources. */ - rid = 0; - sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (sc->mem_res == NULL) { - device_printf(dev, "Cannot allocate memory resources\n"); + if (bus_alloc_resources(dev, imx6_anatop_spec, sc->res)) { + device_printf(dev, "Cannot allocate resources\n"); err = ENXIO; goto out; } + err = bus_setup_intr(dev, sc->res[IRQRES], INTR_TYPE_MISC | INTR_MPSAFE, + tempmon_intr, NULL, sc, &sc->temp_intrhand); + if (err != 0) + goto out; + imx6_anatop_sc = sc; + + /* + * Other code seen on the net sets this SELFBIASOFF flag around the same + * time the temperature sensor is set up, although it's unclear how the + * two are related (if at all). + */ + imx6_anatop_write_4(IMX6_ANALOG_PMU_MISC0_SET, + IMX6_ANALOG_PMU_MISC0_SELFBIASOFF); + + cpufreq_initialize(sc); + initialize_tempmon(sc); + err = 0; out: - if (err != 0) - imx6_anatop_detach(dev); + if (err != 0) { + bus_release_resources(dev, imx6_anatop_spec, sc->res); + } return (err); } @@ -129,7 +482,7 @@ imx6_anatop_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "fsl,imx6q-anatop") == 0) + if (ofw_bus_is_compatible(dev, "fsl,imx6q-anatop") == 0) return (ENXIO); device_set_desc(dev, "Freescale i.MX6 Analog PLLs and Power"); @@ -137,6 +490,16 @@ imx6_anatop_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +uint32_t +imx6_get_cpu_clock() +{ + uint32_t div; + + div = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & + IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; + return (cpufreq_hz_from_div(imx6_anatop_sc, div)); +} + static device_method_t imx6_anatop_methods[] = { /* Device interface */ DEVMETHOD(device_probe, imx6_anatop_probe), Modified: stable/10/sys/arm/freescale/imx/imx6_anatopreg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatopreg.h Thu May 15 22:35:04 2014 (r266200) +++ stable/10/sys/arm/freescale/imx/imx6_anatopreg.h Thu May 15 22:50:06 2014 (r266201) @@ -33,6 +33,10 @@ #define IMX6_ANALOG_CCM_PLL_ARM_SET 0x004 #define IMX6_ANALOG_CCM_PLL_ARM_CLR 0x008 #define IMX6_ANALOG_CCM_PLL_ARM_TOG 0x00C +#define IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK 0x7F +#define IMX6_ANALOG_CCM_PLL_ARM_LOCK (1U << 31) +#define IMX6_ANALOG_CCM_PLL_ARM_BYPASS (1 << 16) +#define IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK (0x03 << 16) #define IMX6_ANALOG_CCM_PLL_USB1 0x010 #define IMX6_ANALOG_CCM_PLL_USB1_SET 0x014 #define IMX6_ANALOG_CCM_PLL_USB1_CLR 0x018 @@ -81,6 +85,7 @@ #define IMX6_ANALOG_CCM_PFD_528_SET 0x104 #define IMX6_ANALOG_CCM_PFD_528_CLR 0x108 #define IMX6_ANALOG_CCM_PFD_528_TOG 0x10C + #define IMX6_ANALOG_PMU_REG_CORE 0x140 #define IMX6_ANALOG_PMU_REG2_TARG_SHIFT 18 #define IMX6_ANALOG_PMU_REG2_TARG_MASK \ @@ -92,14 +97,56 @@ #define IMX6_ANALOG_PMU_REG0_TARG_MASK \ (0x1f << IMX6_ANALOG_PMU_REG0_TARG_SHIFT) -#define IMX6_ANALOG_CCM_MISC0 0x150 -#define IMX6_ANALOG_CCM_MISC0_SET 0x154 -#define IMX6_ANALOG_CCM_MISC0_CLR 0x158 -#define IMX6_ANALOG_CCM_MISC0_TOG 0x15C -#define IMX6_ANALOG_CCM_MISC2 0x170 -#define IMX6_ANALOG_CCM_MISC2_SET 0x174 -#define IMX6_ANALOG_CCM_MISC2_CLR 0x178 -#define IMX6_ANALOG_CCM_MISC2_TOG 0x17C +#define IMX6_ANALOG_PMU_MISC0 0x150 +#define IMX6_ANALOG_PMU_MISC0_SET 0x154 +#define IMX6_ANALOG_PMU_MISC0_CLR 0x158 +#define IMX6_ANALOG_PMU_MISC0_TOG 0x15C +#define IMX6_ANALOG_PMU_MISC0_SELFBIASOFF (1 << 3) + +#define IMX6_ANALOG_PMU_MISC1 0x160 +#define IMX6_ANALOG_PMU_MISC1_SET 0x164 +#define IMX6_ANALOG_PMU_MISC1_CLR 0x168 +#define IMX6_ANALOG_PMU_MISC1_TOG 0x16C +#define IMX6_ANALOG_PMU_MISC1_IRQ_TEMPSENSE (1 << 29) + +#define IMX6_ANALOG_PMU_MISC2 0x170 +#define IMX6_ANALOG_PMU_MISC2_SET 0x174 +#define IMX6_ANALOG_PMU_MISC2_CLR 0x178 +#define IMX6_ANALOG_PMU_MISC2_TOG 0x17C + +/* + * Note that the ANALOG_CCM_MISCn registers are the same as the PMU_MISCn + * registers; some bits conceptually belong to the PMU and some to the CCM. + */ +#define IMX6_ANALOG_CCM_MISC0 IMX6_ANALOG_PMU_MISC0 +#define IMX6_ANALOG_CCM_MISC0_SET IMX6_ANALOG_PMU_MISC0_SET +#define IMX6_ANALOG_CCM_MISC0_CLR IMX6_ANALOG_PMU_MISC0_CLR +#define IMX6_ANALOG_CCM_MISC0_TOG IMX6_ANALOG_PMU_MISC0_TOG + +#define IMX6_ANALOG_CCM_MISC2 IMX6_ANALOG_PMU_MISC2 +#define IMX6_ANALOG_CCM_MISC2_SET IMX6_ANALOG_PMU_MISC2_SET +#define IMX6_ANALOG_CCM_MISC2_CLR IMX6_ANALOG_PMU_MISC2_CLR +#define IMX6_ANALOG_CCM_MISC2_TOG IMX6_ANALOG_PMU_MISC2_TOG + +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0 0x180 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_SET 0x184 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_CLR 0x188 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TOG 0x18C +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TOG 0x18C +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT 20 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_MASK \ + (0xfff << IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT) +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT 8 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_MASK \ + (0xfff << IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT) +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_VALID 0x4 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_MEASURE 0x2 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_POWER_DOWN 0x1 + +#define IMX6_ANALOG_TEMPMON_TEMPSENSE1 0x190 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE1_SET 0x194 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE1_CLR 0x198 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE1_TOG 0x19C #define IMX6_ANALOG_USB1_VBUS_DETECT 0x1A0 #define IMX6_ANALOG_USB1_VBUS_DETECT_SET 0x1A4 Modified: stable/10/sys/arm/freescale/imx/imx6_anatopvar.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatopvar.h Thu May 15 22:35:04 2014 (r266200) +++ stable/10/sys/arm/freescale/imx/imx6_anatopvar.h Thu May 15 22:50:06 2014 (r266201) @@ -40,4 +40,6 @@ uint32_t imx6_anatop_read_4(bus_size_t _offset); void imx6_anatop_write_4(bus_size_t _offset, uint32_t _value); +uint32_t imx6_get_cpu_clock(void); + #endif Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_machdep.c Thu May 15 22:35:04 2014 (r266200) +++ stable/10/sys/arm/freescale/imx/imx6_machdep.c Thu May 15 22:50:06 2014 (r266201) @@ -55,9 +55,6 @@ void initarm_early_init(void) { - /* XXX - Get rid of this stuff soon. */ - boothowto |= RB_VERBOSE|RB_MULTIPLE; - bootverbose = 1; } void @@ -190,3 +187,27 @@ u_int imx_soc_type() return (IMXSOC_6Q); } +/* + * Early putc routine for EARLY_PRINTF support. To use, add to kernel config: + * option SOCDEV_PA=0x02000000 + * option SOCDEV_VA=0x02000000 + * option EARLY_PRINTF + * Resist the temptation to change the #if 0 to #ifdef EARLY_PRINTF here. It + * makes sense now, but if multiple SOCs do that it will make early_putc another + * duplicate symbol to be eliminated on the path to a generic kernel. + */ +#if 0 +static void +imx6_early_putc(int c) +{ + volatile uint32_t * UART_STAT_REG = (uint32_t *)0x02020098; + volatile uint32_t * UART_TX_REG = (uint32_t *)0x02020040; + const uint32_t UART_TXRDY = (1 << 3); + + while ((*UART_STAT_REG & UART_TXRDY) == 0) + continue; + *UART_TX_REG = c; +} +early_putc_t *early_putc = imx6_early_putc; +#endif + Modified: stable/10/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- stable/10/sys/arm/freescale/vybrid/files.vybrid Thu May 15 22:35:04 2014 (r266200) +++ stable/10/sys/arm/freescale/vybrid/files.vybrid Thu May 15 22:50:06 2014 (r266201) @@ -29,4 +29,5 @@ arm/freescale/vybrid/vf_nfc.c optional arm/freescale/vybrid/vf_ehci.c optional ehci arm/freescale/vybrid/vf_gpio.c optional gpio arm/freescale/vybrid/vf_uart.c optional uart +arm/freescale/vybrid/vf_sai.c optional sound dev/ffec/if_ffec.c optional ffec Copied and modified: stable/10/sys/arm/freescale/vybrid/vf_sai.c (from r261982, head/sys/arm/freescale/vybrid/vf_sai.c) ============================================================================== --- head/sys/arm/freescale/vybrid/vf_sai.c Sun Feb 16 16:49:54 2014 (r261982, copy source) +++ stable/10/sys/arm/freescale/vybrid/vf_sai.c Thu May 15 22:50:06 2014 (r266201) @@ -396,7 +396,8 @@ sai_dma_intr(void *arg, int chn) if (sc->pos >= sc->dma_size) sc->pos -= sc->dma_size; - chn_intr(ch->channel); + if (ch->run) + chn_intr(ch->channel); return (0); } @@ -492,7 +493,7 @@ setup_dma(struct sc_pcminfo *scp) tcd->nbytes = 64; tcd->nmajor = 512; - tcd->smod = 18; /* dma_size range */ + tcd->smod = 17; /* dma_size range */ tcd->dmod = 0; tcd->esg = 0; tcd->soff = 0x4; @@ -523,6 +524,7 @@ saichan_trigger(kobj_t obj, void *data, #if 0 device_printf(scp->dev, "trigger start\n"); #endif + ch->run = 1; break; case PCMTRIG_STOP: @@ -530,6 +532,7 @@ saichan_trigger(kobj_t obj, void *data, #if 0 device_printf(scp->dev, "trigger stop or abort\n"); #endif + ch->run = 0; break; } @@ -720,7 +723,7 @@ sai_attach(device_t dev) scp->dev = dev; /* DMA */ - sc->dma_size = 262144; + sc->dma_size = 131072; /* * Must use dma_size boundary as modulo feature required. Modified: stable/10/sys/arm/include/physmem.h ============================================================================== --- stable/10/sys/arm/include/physmem.h Thu May 15 22:35:04 2014 (r266200) +++ stable/10/sys/arm/include/physmem.h Thu May 15 22:50:06 2014 (r266201) @@ -65,7 +65,7 @@ void arm_physmem_print_tables(void); #include -inline void +static inline void arm_physmem_hardware_regions(struct mem_region * mrptr, int mrcount) { while (mrcount--) { @@ -74,7 +74,7 @@ arm_physmem_hardware_regions(struct mem_ } } -inline void +static inline void arm_physmem_exclude_regions(struct mem_region * mrptr, int mrcount, uint32_t exflags) { Modified: stable/10/sys/boot/fdt/dts/imx6.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/imx6.dtsi Thu May 15 22:35:04 2014 (r266200) +++ stable/10/sys/boot/fdt/dts/imx6.dtsi Thu May 15 22:50:06 2014 (r266201) @@ -97,6 +97,8 @@ anatop: anatop@020c8000 { compatible = "fsl,imx6q-anatop"; reg = <0x020c8000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <49>; } gpt: timer@02098000 { Modified: stable/10/sys/boot/fdt/dts/vybrid.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/vybrid.dtsi Thu May 15 22:35:04 2014 (r266200) +++ stable/10/sys/boot/fdt/dts/vybrid.dtsi Thu May 15 22:50:06 2014 (r266201) @@ -311,6 +311,9 @@ interrupt-parent = <&GIC>; status = "disabled"; edma-controller = <&edma1>; + edma-src-receive = < 8 >; + edma-src-transmit = < 9 >; + edma-mux-group = < 1 >; clock_names = "sai3", "cko1"; iomux_config = < 16 0x2 19 0x2 From owner-svn-src-stable-10@FreeBSD.ORG Thu May 15 22:51:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D86174FE; Thu, 15 May 2014 22:51: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 C59062C04; Thu, 15 May 2014 22:51: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 s4FMpEPG054091; Thu, 15 May 2014 22:51:14 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FMpE23054090; Thu, 15 May 2014 22:51:14 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405152251.s4FMpE23054090@svn.freebsd.org> From: Ian Lepore Date: Thu, 15 May 2014 22:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266202 - stable/10/usr.bin/dtc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 22:51:14 -0000 Author: ian Date: Thu May 15 22:51:14 2014 New Revision: 266202 URL: http://svnweb.freebsd.org/changeset/base/266202 Log: MFC r262394: Fix parsing multiple roots with whitespace between them. Modified: stable/10/usr.bin/dtc/fdt.cc Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/dtc/fdt.cc ============================================================================== --- stable/10/usr.bin/dtc/fdt.cc Thu May 15 22:50:06 2014 (r266201) +++ stable/10/usr.bin/dtc/fdt.cc Thu May 15 22:51:14 2014 (r266202) @@ -1054,6 +1054,7 @@ device_tree::parse_roots(input_buffer &i { valid = false; } + input.next_token(); } } From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 00:14:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B76E5645; Fri, 16 May 2014 00:14: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 A14B821EC; Fri, 16 May 2014 00:14: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 s4G0Et42091671; Fri, 16 May 2014 00:14:55 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4G0Eo6v091643; Fri, 16 May 2014 00:14:50 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405160014.s4G0Eo6v091643@svn.freebsd.org> From: Ian Lepore Date: Fri, 16 May 2014 00:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266203 - in stable/10/sys: arm/arm arm/conf arm/freescale/imx arm/freescale/vybrid arm/include arm/mv/armadaxp arm/samsung/exynos arm/ti/omap4 boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 00:14:55 -0000 Author: ian Date: Fri May 16 00:14:50 2014 New Revision: 266203 URL: http://svnweb.freebsd.org/changeset/base/266203 Log: MFC r262409, r262411, r262413, r262420, r262426, r262427, r262440, r262456, r262482, r262483, r262531, Move the declaration for mpentry() into a header file instead of pasting it into a bunch of different .c files. If the L2 cache type is PIPT, pass a physical address for a flush. Actually set the proper bit to indicate TTB shared memory. Add a new cache maintenance function, idcache_inv_all, to the table, and implementations for each of the chips we support. Invalidate caches immediately upon entry to init_secondary(). Also set the Bufferable bit in the PDE entries of the secondary processor startup pagetables. Add the bits needed to run SMP on imx6. Invalidate the SCU cache tag ram on all 4 cores, not just 1-3. Minor tweaks to the imx GPT timer Vybrid enhancements... - Pin configuration is a complete iomux register now and includes drive strength, pull mode, mux mode, speed, etc. - Add i2c devices to the tree - Add IPG clock - Add support for Quartz Module. - Pin configuration is a complete iomux register now and includes drive strength, pull mode, mux mode, speed, etc. - Add i2c devices to the tree - Add IPG clock Added: stable/10/sys/arm/conf/QUARTZ - copied unchanged from r262456, head/sys/arm/conf/QUARTZ stable/10/sys/arm/freescale/imx/imx6_mp.c - copied, changed from r262427, head/sys/arm/freescale/imx/imx6_mp.c stable/10/sys/boot/fdt/dts/vybrid-quartz.dts - copied, changed from r262456, head/sys/boot/fdt/dts/vybrid-quartz.dts Modified: stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/cpufunc_asm_armv4.S stable/10/sys/arm/arm/cpufunc_asm_armv6.S stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/mp_machdep.c stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/freescale/imx/imx_gpt.c stable/10/sys/arm/freescale/imx/std.imx6 stable/10/sys/arm/freescale/vybrid/vf_ccm.c stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c stable/10/sys/arm/include/cpufunc.h stable/10/sys/arm/include/smp.h stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c stable/10/sys/arm/samsung/exynos/exynos5_mp.c stable/10/sys/arm/ti/omap4/omap4_mp.c stable/10/sys/boot/fdt/dts/vybrid-colibri-vf50.dts stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts stable/10/sys/boot/fdt/dts/vybrid.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc.c ============================================================================== --- stable/10/sys/arm/arm/cpufunc.c Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/arm/cpufunc.c Fri May 16 00:14:50 2014 (r266203) @@ -146,6 +146,7 @@ struct cpu_functions arm7tdmi_cpufuncs = (void *)arm7tdmi_cache_flushID, /* dcache_inv_range */ (void *)cpufunc_nullop, /* dcache_wb_range */ + cpufunc_nullop, /* idcache_inv_all */ arm7tdmi_cache_flushID, /* idcache_wbinv_all */ (void *)arm7tdmi_cache_flushID, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -208,6 +209,7 @@ struct cpu_functions arm8_cpufuncs = { /*XXX*/ (void *)arm8_cache_purgeID, /* dcache_inv_range */ (void *)arm8_cache_cleanID, /* dcache_wb_range */ + cpufunc_nullop, /* idcache_inv_all */ arm8_cache_purgeID, /* idcache_wbinv_all */ (void *)arm8_cache_purgeID, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -269,6 +271,7 @@ struct cpu_functions arm9_cpufuncs = { arm9_dcache_inv_range, /* dcache_inv_range */ arm9_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ arm9_idcache_wbinv_all, /* idcache_wbinv_all */ arm9_idcache_wbinv_range, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -331,6 +334,7 @@ struct cpu_functions armv5_ec_cpufuncs = armv5_ec_dcache_inv_range, /* dcache_inv_range */ armv5_ec_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ armv5_ec_idcache_wbinv_all, /* idcache_wbinv_all */ armv5_ec_idcache_wbinv_range, /* idcache_wbinv_range */ @@ -392,6 +396,7 @@ struct cpu_functions sheeva_cpufuncs = { sheeva_dcache_inv_range, /* dcache_inv_range */ sheeva_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ armv5_ec_idcache_wbinv_all, /* idcache_wbinv_all */ sheeva_idcache_wbinv_range, /* idcache_wbinv_all */ @@ -454,6 +459,7 @@ struct cpu_functions arm10_cpufuncs = { arm10_dcache_inv_range, /* dcache_inv_range */ arm10_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ arm10_idcache_wbinv_all, /* idcache_wbinv_all */ arm10_idcache_wbinv_range, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -515,6 +521,7 @@ struct cpu_functions pj4bv7_cpufuncs = { armv7_dcache_inv_range, /* dcache_inv_range */ armv7_dcache_wb_range, /* dcache_wb_range */ + armv7_idcache_inv_all, /* idcache_inv_all */ armv7_idcache_wbinv_all, /* idcache_wbinv_all */ armv7_idcache_wbinv_range, /* idcache_wbinv_all */ @@ -577,6 +584,7 @@ struct cpu_functions sa110_cpufuncs = { /*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ sa1_cache_cleanD_rng, /* dcache_wb_range */ + sa1_cache_flushID, /* idcache_inv_all */ sa1_cache_purgeID, /* idcache_wbinv_all */ sa1_cache_purgeID_rng, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -638,6 +646,7 @@ struct cpu_functions sa11x0_cpufuncs = { /*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ sa1_cache_cleanD_rng, /* dcache_wb_range */ + sa1_cache_flushID, /* idcache_inv_all */ sa1_cache_purgeID, /* idcache_wbinv_all */ sa1_cache_purgeID_rng, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -699,6 +708,7 @@ struct cpu_functions ixp12x0_cpufuncs = /*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ sa1_cache_cleanD_rng, /* dcache_wb_range */ + sa1_cache_flushID, /* idcache_inv_all */ sa1_cache_purgeID, /* idcache_wbinv_all */ sa1_cache_purgeID_rng, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -763,6 +773,7 @@ struct cpu_functions xscale_cpufuncs = { xscale_cache_flushD_rng, /* dcache_inv_range */ xscale_cache_cleanD_rng, /* dcache_wb_range */ + xscale_cache_flushID, /* idcache_inv_all */ xscale_cache_purgeID, /* idcache_wbinv_all */ xscale_cache_purgeID_rng, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -826,6 +837,7 @@ struct cpu_functions xscalec3_cpufuncs = xscale_cache_flushD_rng, /* dcache_inv_range */ xscalec3_cache_cleanD_rng, /* dcache_wb_range */ + xscale_cache_flushID, /* idcache_inv_all */ xscalec3_cache_purgeID, /* idcache_wbinv_all */ xscalec3_cache_purgeID_rng, /* idcache_wbinv_range */ xscalec3_l2cache_purge, /* l2cache_wbinv_all */ @@ -888,6 +900,7 @@ struct cpu_functions fa526_cpufuncs = { fa526_dcache_inv_range, /* dcache_inv_range */ fa526_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ fa526_idcache_wbinv_all, /* idcache_wbinv_all */ fa526_idcache_wbinv_range, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -949,6 +962,7 @@ struct cpu_functions arm1136_cpufuncs = armv6_dcache_inv_range, /* dcache_inv_range */ armv6_dcache_wb_range, /* dcache_wb_range */ + armv6_idcache_inv_all, /* idcache_inv_all */ arm11x6_idcache_wbinv_all, /* idcache_wbinv_all */ arm11x6_idcache_wbinv_range, /* idcache_wbinv_range */ @@ -1010,6 +1024,7 @@ struct cpu_functions arm1176_cpufuncs = armv6_dcache_inv_range, /* dcache_inv_range */ armv6_dcache_wb_range, /* dcache_wb_range */ + armv6_idcache_inv_all, /* idcache_inv_all */ arm11x6_idcache_wbinv_all, /* idcache_wbinv_all */ arm11x6_idcache_wbinv_range, /* idcache_wbinv_range */ @@ -1072,6 +1087,7 @@ struct cpu_functions cortexa_cpufuncs = armv7_dcache_inv_range, /* dcache_inv_range */ armv7_dcache_wb_range, /* dcache_wb_range */ + armv7_idcache_inv_all, /* idcache_inv_all */ armv7_idcache_wbinv_all, /* idcache_wbinv_all */ armv7_idcache_wbinv_range, /* idcache_wbinv_range */ Modified: stable/10/sys/arm/arm/cpufunc_asm_armv4.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv4.S Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/arm/cpufunc_asm_armv4.S Fri May 16 00:14:50 2014 (r266203) @@ -71,3 +71,9 @@ ENTRY(armv4_drain_writebuf) RET END(armv4_drain_writebuf) +ENTRY(armv4_idcache_inv_all) + mov r0, #0 + mcr p15, 0, r0, c7, c7, 0 /* invalidate all I+D cache */ + RET +END(armv4_drain_writebuf) + Modified: stable/10/sys/arm/arm/cpufunc_asm_armv6.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv6.S Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/arm/cpufunc_asm_armv6.S Fri May 16 00:14:50 2014 (r266203) @@ -148,3 +148,9 @@ ENTRY(armv6_dcache_wbinv_all) END(armv6_idcache_wbinv_all) END(armv6_dcache_wbinv_all) +ENTRY(armv6_idcache_inv_all) + mov r0, #0 + mcr p15, 0, r0, c7, c7, 0 /* invalidate all I+D cache */ + RET +END(armv6_idcache_inv_all) + Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Fri May 16 00:14:50 2014 (r266203) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2010 Per Odlund * Copyright (C) 2011 MARVELL INTERNATIONAL LTD. * All rights reserved. * @@ -305,3 +306,40 @@ ENTRY(armv7_auxctrl) RET END(armv7_auxctrl) +ENTRY(armv7_idcache_inv_all) + mov r0, #0 + mcr p15, 2, r0, c0, c0, 0 @ set cache level to L1 + mrc p15, 1, r0, c0, c0, 0 @ read CCSIDR + + ubfx r2, r0, #13, #15 @ get num sets - 1 from CCSIDR + ubfx r3, r0, #3, #10 @ get numways - 1 from CCSIDR + clz r1, r3 @ number of bits to MSB of way + lsl r3, r3, r1 @ shift into position + mov ip, #1 @ + lsl ip, ip, r1 @ ip now contains the way decr + + ubfx r0, r0, #0, #3 @ get linesize from CCSIDR + add r0, r0, #4 @ apply bias + lsl r2, r2, r0 @ shift sets by log2(linesize) + add r3, r3, r2 @ merge numsets - 1 with numways - 1 + sub ip, ip, r2 @ subtract numsets - 1 from way decr + mov r1, #1 + lsl r1, r1, r0 @ r1 now contains the set decr + mov r2, ip @ r2 now contains set way decr + + /* r3 = ways/sets, r2 = way decr, r1 = set decr, r0 and ip are free */ +1: mcr p15, 0, r3, c7, c6, 2 @ invalidate line + movs r0, r3 @ get current way/set + beq 2f @ at 0 means we are done. + movs r0, r0, lsl #10 @ clear way bits leaving only set bits + subne r3, r3, r1 @ non-zero?, decrement set # + subeq r3, r3, r2 @ zero?, decrement way # and restore set count + b 1b + +2: dsb @ wait for stores to finish + mov r0, #0 @ and ... + mcr p15, 0, r0, c7, c5, 0 @ invalidate instruction+branch cache + isb @ instruction sync barrier + bx lr @ return +END(armv7_l1cache_inv_all) + Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/arm/locore.S Fri May 16 00:14:50 2014 (r266203) @@ -425,7 +425,7 @@ Ltag: orr r0, r0, #PHYSADDR ldr r0, [r0] #if defined(SMP) - orr r0, r0, #0 /* Set TTB shared memory flag */ + orr r0, r0, #2 /* Set TTB shared memory flag */ #endif mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/arm/machdep.c Fri May 16 00:14:50 2014 (r266203) @@ -410,7 +410,11 @@ cpu_flush_dcache(void *ptr, size_t len) { cpu_dcache_wb_range((uintptr_t)ptr, len); +#ifdef ARM_L2_PIPT + cpu_l2cache_wb_range((uintptr_t)vtophys(ptr), len); +#else cpu_l2cache_wb_range((uintptr_t)ptr, len); +#endif } /* Get current clock frequency for the given cpu id. */ Modified: stable/10/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/10/sys/arm/arm/mp_machdep.c Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/arm/mp_machdep.c Fri May 16 00:14:50 2014 (r266203) @@ -128,10 +128,10 @@ cpu_mp_start(void) bzero((void *)temp_pagetable_va, L1_TABLE_SIZE); for (addr = arm_physmem_kernaddr; addr <= addr_end; addr += L1_S_SIZE) { ((int *)(temp_pagetable_va))[addr >> L1_S_SHIFT] = - L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; + L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_B|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; ((int *)(temp_pagetable_va))[(addr - arm_physmem_kernaddr + KERNVIRTADDR) >> L1_S_SHIFT] = - L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; + L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_B|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; } #if defined(CPU_MV_PJ4B) @@ -173,6 +173,8 @@ init_secondary(int cpu) uint32_t loop_counter; int start = 0, end = 0; + cpu_idcache_inv_all(); + cpu_setup(NULL); setttb(pmap_pa); cpu_tlb_flushID(); Copied: stable/10/sys/arm/conf/QUARTZ (from r262456, head/sys/arm/conf/QUARTZ) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/QUARTZ Fri May 16 00:14:50 2014 (r266203, copy of r262456, head/sys/arm/conf/QUARTZ) @@ -0,0 +1,26 @@ +# Kernel configuration for Device Solutions Quartz Module. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "VYBRID.common" +ident QUARTZ + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=vybrid-quartz.dts Modified: stable/10/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx6 Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/freescale/imx/files.imx6 Fri May 16 00:14:50 2014 (r266203) @@ -22,6 +22,7 @@ arm/freescale/imx/common.c standard arm/freescale/imx/imx6_anatop.c standard arm/freescale/imx/imx6_ccm.c standard arm/freescale/imx/imx6_machdep.c standard +arm/freescale/imx/imx6_mp.c optional smp arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard Copied and modified: stable/10/sys/arm/freescale/imx/imx6_mp.c (from r262427, head/sys/arm/freescale/imx/imx6_mp.c) ============================================================================== --- head/sys/arm/freescale/imx/imx6_mp.c Mon Feb 24 03:51:31 2014 (r262427, copy source) +++ stable/10/sys/arm/freescale/imx/imx6_mp.c Fri May 16 00:14:50 2014 (r266203) @@ -113,11 +113,11 @@ platform_mp_start_ap(void) panic("Couldn't map the system reset controller (SRC)\n"); /* - * Invalidate SCU cache tags. The 0x0000fff0 constant invalidates all - * ways on all cores 1-3 (leaving core 0 alone). Per the ARM docs, it's - * harmless to write to the bits for cores that are not present. + * Invalidate SCU cache tags. The 0x0000ffff constant invalidates all + * ways on all cores 0-3. Per the ARM docs, it's harmless to write to + * the bits for cores that are not present. */ - bus_space_write_4(fdtbus_bs_tag, scu, SCU_INV_TAGS_REG, 0x0000fff0); + bus_space_write_4(fdtbus_bs_tag, scu, SCU_INV_TAGS_REG, 0x0000ffff); /* * Erratum ARM/MP: 764369 (problems with cache maintenance). @@ -128,13 +128,17 @@ platform_mp_start_ap(void) bus_space_write_4(fdtbus_bs_tag, scu, SCU_DIAG_CONTROL, val | SCU_DIAG_DISABLE_MIGBIT); - /* Enable the SCU. */ + /* + * Enable the SCU, then clean the cache on this core. After these two + * operations the cache tag ram in the SCU is coherent with the contents + * of the cache on this core. The other cores aren't running yet so + * their caches can't contain valid data yet, but we've initialized + * their SCU tag ram above, so they will be coherent from startup. + */ val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG); bus_space_write_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG, val | SCU_CONTROL_ENABLE); - cpu_idcache_wbinv_all(); - cpu_l2cache_wbinv_all(); /* * For each AP core, set the entry point address and argument registers, Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_gpt.c Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/freescale/imx/imx_gpt.c Fri May 16 00:14:50 2014 (r266203) @@ -75,7 +75,7 @@ static int imx_gpt_probe(device_t); static int imx_gpt_attach(device_t); static struct timecounter imx_gpt_timecounter = { - .tc_name = "i.MX GPT Timecounter", + .tc_name = "iMXGPT", .tc_get_timecount = imx_gpt_get_timecount, .tc_counter_mask = ~0u, .tc_frequency = 0, @@ -244,9 +244,9 @@ imx_gpt_attach(device_t dev) } /* Register as an eventtimer. */ - sc->et.et_name = "i.MXxxx GPT Eventtimer"; + sc->et.et_name = "iMXGPT"; sc->et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERIODIC; - sc->et.et_quality = 1000; + sc->et.et_quality = 800; sc->et.et_frequency = sc->clkfreq; sc->et.et_min_period = (MIN_ET_PERIOD << 32) / sc->et.et_frequency; sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency; @@ -286,9 +286,9 @@ imx_gpt_timer_start(struct eventtimer *e /* Do not disturb, otherwise event will be lost */ spinlock_enter(); /* Set expected value */ - WRITE4(sc, IMX_GPT_OCR1, READ4(sc, IMX_GPT_CNT) + ticks); + WRITE4(sc, IMX_GPT_OCR3, READ4(sc, IMX_GPT_CNT) + ticks); /* Enable compare register 1 Interrupt */ - SET4(sc, IMX_GPT_IR, GPT_IR_OF1); + SET4(sc, IMX_GPT_IR, GPT_IR_OF3); /* Now everybody can relax */ spinlock_exit(); return (0); @@ -349,7 +349,7 @@ imx_gpt_intr(void *arg) WRITE4(sc, IMX_GPT_SR, status); /* Handle one-shot timer events. */ - if (status & GPT_IR_OF1) { + if (status & GPT_IR_OF3) { if (sc->et.et_active) { sc->et.et_event_cb(&sc->et, sc->et.et_arg); } Modified: stable/10/sys/arm/freescale/imx/std.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/std.imx6 Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/freescale/imx/std.imx6 Fri May 16 00:14:50 2014 (r266203) @@ -10,5 +10,8 @@ options KERNPHYSADDR = 0x12000000 makeoptions KERNPHYSADDR = 0x12000000 options PHYSADDR = 0x10000000 +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + files "../freescale/imx/files.imx6" Modified: stable/10/sys/arm/freescale/vybrid/vf_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_ccm.c Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/freescale/vybrid/vf_ccm.c Fri May 16 00:14:50 2014 (r266203) @@ -164,6 +164,18 @@ struct clk { uint32_t sel_val; }; +static struct clk ipg_clk = { + .reg = CCM_CACRR, + .enable_reg = 0, + .div_mask = IPG_CLK_DIV_MASK, + .div_shift = IPG_CLK_DIV_SHIFT, + .div_val = 1, /* Divide by 2 */ + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + /* PLL4 clock divider (before switching the clocks should be gated) 000 Divide by 1 (only if PLL frequency less than or equal to 650 MHz) @@ -310,6 +322,7 @@ struct clock_entry { }; static struct clock_entry clock_map[] = { + {"ipg", &ipg_clk}, {"pll4", &pll4_clk}, {"sai3", &sai3_clk}, {"cko1", &cko1_clk}, Modified: stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c ============================================================================== --- stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/freescale/vybrid/vf_iomuxc.c Fri May 16 00:14:50 2014 (r266203) @@ -56,21 +56,42 @@ __FBSDID("$FreeBSD$"); #include #include -#define IBE (1 << 0) /* Input Buffer Enable Field */ -#define OBE (1 << 1) /* Output Buffer Enable Field. */ -#define PUE (1 << 2) /* Pull / Keep Select Field. */ -#define PKE (1 << 3) /* Pull / Keep Enable Field. */ -#define PUS_MASK (3 << 4) /* Pull Up / Down Config Field. */ -#define DSE_MASK (7 << 6) /* Drive Strength Field. */ -#define HYS (1 << 9) /* Hysteresis Enable Field */ - #define MUX_MODE_MASK 7 #define MUX_MODE_SHIFT 20 #define MUX_MODE_GPIO 0 #define MUX_MODE_VBUS_EN_OTG 2 -#define PUS_22_KOHM_PULL_UP (3 << 4) -#define DSE_25_OHM (6 << 6) +#define IBE (1 << 0) /* Input Buffer Enable Field */ +#define OBE (1 << 1) /* Output Buffer Enable Field. */ +#define PUE (1 << 2) /* Pull / Keep Select Field. */ +#define PKE (1 << 3) /* Pull / Keep Enable Field. */ +#define HYS (1 << 9) /* Hysteresis Enable Field */ +#define ODE (1 << 10) /* Open Drain Enable Field. */ +#define SRE (1 << 11) /* Slew Rate Field. */ + +#define SPEED_SHIFT 12 +#define SPEED_MASK 0x3 +#define SPEED_LOW 0 /* 50 MHz */ +#define SPEED_MEDIUM 0x1 /* 100 MHz */ +#define SPEED_HIGH 0x3 /* 200 MHz */ + +#define PUS_SHIFT 4 /* Pull Up / Down Config Field Shift */ +#define PUS_MASK 0x3 +#define PUS_100_KOHM_PULL_DOWN 0 +#define PUS_47_KOHM_PULL_UP 0x1 +#define PUS_100_KOHM_PULL_UP 0x2 +#define PUS_22_KOHM_PULL_UP 0x3 + +#define DSE_SHIFT 6 /* Drive Strength Field Shift */ +#define DSE_MASK 0x7 +#define DSE_DISABLED 0 /* Output driver disabled */ +#define DSE_150_OHM 0x1 +#define DSE_75_OHM 0x2 +#define DSE_50_OHM 0x3 +#define DSE_37_OHM 0x4 +#define DSE_30_OHM 0x5 +#define DSE_25_OHM 0x6 +#define DSE_20_OHM 0x7 #define MAX_MUX_LEN 1024 @@ -101,19 +122,6 @@ iomuxc_probe(device_t dev) } static int -configure_pad(struct iomuxc_softc *sc, int pad, int mux_mode) -{ - int reg; - - reg = READ4(sc, pad); - reg &= ~(MUX_MODE_MASK << MUX_MODE_SHIFT); - reg |= (mux_mode << MUX_MODE_SHIFT); - WRITE4(sc, pad, reg); - - return (0); -} - -static int pinmux_set(struct iomuxc_softc *sc) { phandle_t child, parent, root; @@ -121,7 +129,7 @@ pinmux_set(struct iomuxc_softc *sc) int len; int values; int pin; - int mux_mode; + int pin_cfg; int i; root = OF_finddevice("/"); @@ -146,12 +154,12 @@ pinmux_set(struct iomuxc_softc *sc) values = len / (sizeof(uint32_t)); for (i = 0; i < values; i += 2) { pin = fdt32_to_cpu(iomux_config[i]); - mux_mode = fdt32_to_cpu(iomux_config[i+1]); + pin_cfg = fdt32_to_cpu(iomux_config[i+1]); #if 0 - device_printf(sc->dev, "Set pin %d to ALT%d\n", - pin, mux_mode); + device_printf(sc->dev, "Set pin %d to 0x%08x\n", + pin, pin_cfg); #endif - configure_pad(sc, IOMUXC(pin), mux_mode); + WRITE4(sc, IOMUXC(pin), pin_cfg); } } @@ -169,7 +177,6 @@ static int iomuxc_attach(device_t dev) { struct iomuxc_softc *sc; - int reg; sc = device_get_softc(dev); sc->dev = dev; @@ -183,11 +190,6 @@ iomuxc_attach(device_t dev) sc->bst = rman_get_bustag(sc->tmr_res[0]); sc->bsh = rman_get_bushandle(sc->tmr_res[0]); - /* USB */ - configure_pad(sc, IOMUXC_PTA17, MUX_MODE_VBUS_EN_OTG); - reg = (PKE | PUE | PUS_22_KOHM_PULL_UP | DSE_25_OHM | OBE); - WRITE4(sc, IOMUXC_PTA7, reg); - pinmux_set(sc); return (0); Modified: stable/10/sys/arm/include/cpufunc.h ============================================================================== --- stable/10/sys/arm/include/cpufunc.h Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/include/cpufunc.h Fri May 16 00:14:50 2014 (r266203) @@ -104,6 +104,12 @@ struct cpu_functions { * * There are some rules that must be followed: * + * ID-cache Invalidate All: + * Unlike other functions, this one must never write back. + * It is used to intialize the MMU when it is in an unknown + * state (such as when it may have lines tagged as valid + * that belong to a previous set of mappings). + * * I-cache Synch (all or range): * The goal is to synchronize the instruction stream, * so you may beed to write-back dirty D-cache blocks @@ -138,6 +144,7 @@ struct cpu_functions { void (*cf_dcache_inv_range) (vm_offset_t, vm_size_t); void (*cf_dcache_wb_range) (vm_offset_t, vm_size_t); + void (*cf_idcache_inv_all) (void); void (*cf_idcache_wbinv_all) (void); void (*cf_idcache_wbinv_range) (vm_offset_t, vm_size_t); void (*cf_l2cache_wbinv_all) (void); @@ -238,6 +245,7 @@ void tlb_broadcast(int); #define cpu_dcache_inv_range(a, s) cpufuncs.cf_dcache_inv_range((a), (s)) #define cpu_dcache_wb_range(a, s) cpufuncs.cf_dcache_wb_range((a), (s)) +#define cpu_idcache_inv_all() cpufuncs.cf_idcache_inv_all() #define cpu_idcache_wbinv_all() cpufuncs.cf_idcache_wbinv_all() #define cpu_idcache_wbinv_range(a, s) cpufuncs.cf_idcache_wbinv_range((a), (s)) #define cpu_l2cache_wbinv_all() cpufuncs.cf_l2cache_wbinv_all() @@ -495,6 +503,7 @@ void armv6_dcache_wbinv_range (vm_offset void armv6_dcache_inv_range (vm_offset_t, vm_size_t); void armv6_dcache_wb_range (vm_offset_t, vm_size_t); +void armv6_idcache_inv_all (void); void armv6_idcache_wbinv_all (void); void armv6_idcache_wbinv_range (vm_offset_t, vm_size_t); @@ -503,6 +512,7 @@ void armv7_tlb_flushID (void); void armv7_tlb_flushID_SE (u_int); void armv7_icache_sync_range (vm_offset_t, vm_size_t); void armv7_idcache_wbinv_range (vm_offset_t, vm_size_t); +void armv7_idcache_inv_all (void); void armv7_dcache_wbinv_all (void); void armv7_idcache_wbinv_all (void); void armv7_dcache_wbinv_range (vm_offset_t, vm_size_t); @@ -587,6 +597,7 @@ void armv4_tlb_flushD (void); void armv4_tlb_flushD_SE (u_int va); void armv4_drain_writebuf (void); +void armv4_idcache_inv_all (void); #endif #if defined(CPU_IXP12X0) Modified: stable/10/sys/arm/include/smp.h ============================================================================== --- stable/10/sys/arm/include/smp.h Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/include/smp.h Fri May 16 00:14:50 2014 (r266203) @@ -15,6 +15,7 @@ #define IPI_TLB 7 void init_secondary(int cpu); +void mpentry(void); void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); Modified: stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c Fri May 16 00:14:50 2014 (r266203) @@ -96,7 +96,6 @@ platform_mp_init_secondary(void) { } -void mpentry(void); void mptramp(void); Modified: stable/10/sys/arm/samsung/exynos/exynos5_mp.c ============================================================================== --- stable/10/sys/arm/samsung/exynos/exynos5_mp.c Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/samsung/exynos/exynos5_mp.c Fri May 16 00:14:50 2014 (r266203) @@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$"); #define EXYNOS_SYSRAM 0x02020000 -void mpentry(void); -void mptramp(void); - void platform_mp_init_secondary(void) { Modified: stable/10/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- stable/10/sys/arm/ti/omap4/omap4_mp.c Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/arm/ti/omap4/omap4_mp.c Fri May 16 00:14:50 2014 (r266203) @@ -38,9 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -void mpentry(void); -void mptramp(void); - void platform_mp_init_secondary(void) { Modified: stable/10/sys/boot/fdt/dts/vybrid-colibri-vf50.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/vybrid-colibri-vf50.dts Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/boot/fdt/dts/vybrid-colibri-vf50.dts Fri May 16 00:14:50 2014 (r266203) @@ -45,17 +45,26 @@ fec1: ethernet@400D1000 { status = "okay"; - iomux_config = < 54 0x1 55 0x1 - 56 0x1 57 0x1 - 58 0x1 59 0x1 - 60 0x1 61 0x1 - 62 0x1 0 0x1 >; + iomux_config = < 54 0x103192 + 55 0x103193 + 56 0x103191 + 57 0x103191 + 58 0x103191 + 59 0x103191 + 60 0x103192 + 61 0x103192 + 62 0x103192 + 0 0x103191 >; }; sai3: sai@40032000 { status = "okay"; }; + i2c0: i2c@40066000 { + status = "okay"; + }; + adc0: adc@4003B000 { status = "okay"; }; Modified: stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts Fri May 16 00:14:50 2014 (r266203) @@ -45,11 +45,16 @@ fec1: ethernet@400D1000 { status = "okay"; - iomux_config = < 54 0x1 55 0x1 - 56 0x1 57 0x1 - 58 0x1 59 0x1 - 60 0x1 61 0x1 - 62 0x1 0 0x2 >; + iomux_config = < 54 0x103192 + 55 0x103193 + 56 0x103191 + 57 0x103191 + 58 0x103191 + 59 0x103191 + 60 0x103192 + 61 0x103192 + 62 0x103192 + 0 0x203191 >; }; esai: esai@40062000 { Copied and modified: stable/10/sys/boot/fdt/dts/vybrid-quartz.dts (from r262456, head/sys/boot/fdt/dts/vybrid-quartz.dts) ============================================================================== --- head/sys/boot/fdt/dts/vybrid-quartz.dts Mon Feb 24 19:32:15 2014 (r262456, copy source) +++ stable/10/sys/boot/fdt/dts/vybrid-quartz.dts Fri May 16 00:14:50 2014 (r266203) @@ -45,11 +45,16 @@ fec1: ethernet@400D1000 { status = "okay"; - iomux_config = < 54 0x1 55 0x1 - 56 0x1 57 0x1 - 58 0x1 59 0x1 - 60 0x1 61 0x1 - 62 0x1 0 0x2 >; + iomux_config = < 54 0x103192 + 55 0x103193 + 56 0x103191 + 57 0x103191 + 58 0x103191 + 59 0x103191 + 60 0x103192 + 61 0x103192 + 62 0x103192 + 0 0x203191 >; }; edma1: edma@40098000 { Modified: stable/10/sys/boot/fdt/dts/vybrid.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/vybrid.dtsi Thu May 15 22:51:14 2014 (r266202) +++ stable/10/sys/boot/fdt/dts/vybrid.dtsi Fri May 16 00:14:50 2014 (r266203) @@ -205,9 +205,12 @@ clock-frequency = <50000000>; status = "disabled"; clock_names = "esdhc1"; - iomux_config = < 14 0x5 15 0x5 - 16 0x5 17 0x5 - 18 0x5 19 0x5 >; + iomux_config = < 14 0x500060 + 15 0x500060 + 16 0x500060 + 17 0x500060 + 18 0x500060 + 19 0x500060 >; }; serial0: serial@40027000 { @@ -237,6 +240,8 @@ < 0x40050800 0x100 >; /* phy */ interrupts = < 107 >; interrupt-parent = <&GIC>; + iomux_config = < 134 0x0001be + 7 0x200060 >; }; usb@400b4000 { @@ -246,6 +251,8 @@ < 0x40050C00 0x100 >; /* phy */ interrupts = < 108 >; interrupt-parent = <&GIC>; + iomux_config = < 134 0x0001be + 7 0x200060 >; }; fec0: ethernet@400D0000 { @@ -257,11 +264,15 @@ phy-disable-preamble; status = "disabled"; clock_names = "enet"; - iomux_config = < 45 0x1 46 0x1 - 47 0x1 48 0x1 - 49 0x1 50 0x1 - 51 0x1 52 0x1 - 53 0x1 >; + iomux_config = < 45 0x100061 + 46 0x100061 + 47 0x100061 + 48 0x100060 + 49 0x100060 + 50 0x100060 + 51 0x100060 + 52 0x100060 + 53 0x100060 >; }; fec1: ethernet@400D1000 { @@ -273,11 +284,15 @@ phy-disable-preamble; status = "disabled"; clock_names = "enet"; - iomux_config = < 54 0x1 55 0x1 - 56 0x1 57 0x1 - 58 0x1 59 0x1 - 60 0x1 61 0x1 - 62 0x1 >; + iomux_config = < 54 0x103192 + 55 0x103193 + 56 0x103191 + 57 0x103191 + 58 0x103191 + 59 0x103191 + 60 0x103192 + 61 0x103192 + 62 0x103192 >; }; sai0: sai@4002F000 { @@ -315,10 +330,10 @@ edma-src-transmit = < 9 >; edma-mux-group = < 1 >; clock_names = "sai3", "cko1"; - iomux_config = < 16 0x2 - 19 0x2 - 21 0x2 - 40 0x4 >; /* CKO1 */ + iomux_config = < 16 0x200060 + 19 0x200060 + 21 0x200060 + 40 0x400061 >; /* CKO1 */ }; esai: esai@40062000 { @@ -328,11 +343,16 @@ interrupt-parent = <&GIC>; status = "disabled"; clock_names = "esai"; - iomux_config = < 45 0x4 46 0x4 - 47 0x4 48 0x4 - 49 0x4 50 0x4 - 51 0x4 52 0x4 - 78 0x3 40 0x4>; + iomux_config = < 45 0x400061 + 46 0x400061 + 47 0x400061 + 48 0x400060 + 49 0x400060 + 50 0x400060 + 51 0x400060 + 52 0x400060 + 78 0x3038df + 40 0x400061 >; }; spi0: spi@4002C000 { @@ -341,9 +361,11 @@ interrupts = < 99 >; interrupt-parent = <&GIC>; status = "disabled"; - iomux_config = < 40 0x1 41 0x1 - 42 0x1 43 0x1 - 44 0x1 >; + iomux_config = < 40 0x100061 + 41 0x100061 + 42 0x100060 + 43 0x100060 + 44 0x100061 >; }; spi1: spi@4002D000 { @@ -370,6 +392,43 @@ status = "disabled"; }; + i2c0: i2c@40066000 { + compatible = "fsl,mvf600-i2c"; + reg = <0x40066000 0x1000>; + interrupts = < 103 >; + interrupt-parent = <&GIC>; + status = "disabled"; + clock_names = "ipg"; + iomux_config = < 36 0x2034d3 + 37 0x2034d3 + 207 0x1 + 208 0x1 >; + }; + + i2c1: i2c@40067000 { + compatible = "fsl,mvf600-i2c"; + reg = <0x40067000 0x1000>; + interrupts = < 104 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + i2c2: i2c@400E6000 { + compatible = "fsl,mvf600-i2c"; + reg = <0x400E6000 0x1000>; + interrupts = < 105 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + i2c3: i2c@400E7000 { + compatible = "fsl,mvf600-i2c"; + reg = <0x400E7000 0x1000>; + interrupts = < 106 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + adc0: adc@4003B000 { compatible = "fsl,mvf600-adc"; reg = <0x4003B000 0x1000>; @@ -399,21 +458,35 @@ interrupt-parent = <&GIC>; status = "disabled"; clock_names = "dcu0"; - iomux_config = < 105 0x1 106 0x1 - 107 0x1 108 0x1 - 109 0x1 110 0x1 - 111 0x1 112 0x1 - 113 0x1 114 0x1 - 115 0x1 116 0x1 - 117 0x1 118 0x1 - 119 0x1 120 0x1 - 121 0x1 122 0x1 - 123 0x1 124 0x1 - 125 0x1 126 0x1 - 127 0x1 128 0x1 - 129 0x1 130 0x1 - 131 0x1 132 0x1 - 133 0x1 >; + iomux_config = < 105 0x100044 + 106 0x100044 + 107 0x100060 + 108 0x100060 + 109 0x100060 + 110 0x100060 + 111 0x100060 + 112 0x100060 + 113 0x100060 + 114 0x100060 + 115 0x100060 + 116 0x100060 + 117 0x100060 + 118 0x100060 + 119 0x100060 + 120 0x100060 + 121 0x100060 + 122 0x100060 + 123 0x100060 + 124 0x100060 + 125 0x100060 + 126 0x100060 + 127 0x100060 + 128 0x100060 + 129 0x100060 + 130 0x100060 + 131 0x100060 + 132 0x100060 + 133 0x100060 >; }; }; }; From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 01:30:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3483C389; Fri, 16 May 2014 01:30: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 1ECA326D4; Fri, 16 May 2014 01:30: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 s4G1UVmA025664; Fri, 16 May 2014 01:30:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4G1UUl4025373; Fri, 16 May 2014 01:30:30 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405160130.s4G1UUl4025373@svn.freebsd.org> From: Ian Lepore Date: Fri, 16 May 2014 01:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266204 - in stable/10/sys: amd64/include arm/include i386/include ia64/include kern mips/include powerpc/include sparc64/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 01:30:32 -0000 Author: ian Date: Fri May 16 01:30:30 2014 New Revision: 266204 URL: http://svnweb.freebsd.org/changeset/base/266204 Log: MFC r257854 (discussed with alc@) As of r257209, all architectures have defined VM_KMEM_SIZE_SCALE. In other words, every architecture is now auto-sizing the kmem arena. This revision changes kmeminit() so that the definition of VM_KMEM_SIZE_SCALE becomes mandatory and the definition of VM_KMEM_SIZE becomes optional. Replace or eliminate all existing definitions of VM_KMEM_SIZE. With auto-sizing enabled, VM_KMEM_SIZE effectively became an alternate spelling for VM_KMEM_SIZE_MIN on most architectures. Use VM_KMEM_SIZE_MIN for clarity. Modified: stable/10/sys/amd64/include/vmparam.h stable/10/sys/arm/include/vmparam.h stable/10/sys/i386/include/vmparam.h stable/10/sys/ia64/include/vmparam.h stable/10/sys/kern/kern_malloc.c stable/10/sys/mips/include/vmparam.h stable/10/sys/powerpc/include/vmparam.h stable/10/sys/sparc64/include/vmparam.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/vmparam.h ============================================================================== --- stable/10/sys/amd64/include/vmparam.h Fri May 16 00:14:50 2014 (r266203) +++ stable/10/sys/amd64/include/vmparam.h Fri May 16 01:30:30 2014 (r266204) @@ -178,23 +178,16 @@ #define PHYS_TO_DMAP(x) ((x) | DMAP_MIN_ADDRESS) #define DMAP_TO_PHYS(x) ((x) & ~DMAP_MIN_ADDRESS) -/* virtual sizes (bytes) for various kernel submaps */ -#ifndef VM_KMEM_SIZE -#define VM_KMEM_SIZE (12 * 1024 * 1024) -#endif - /* - * How many physical pages per KVA page allocated. - * min(max(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), - * VM_KMEM_SIZE_MIN), VM_KMEM_SIZE_MAX) - * is the total KVA space allocated for kmem_map. + * How many physical pages per kmem arena virtual page. */ #ifndef VM_KMEM_SIZE_SCALE #define VM_KMEM_SIZE_SCALE (1) #endif /* - * Ceiling on amount of kmem_map kva space. + * Optional ceiling (in bytes) on the size of the kmem arena: 60% of the + * kernel map. */ #ifndef VM_KMEM_SIZE_MAX #define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ Modified: stable/10/sys/arm/include/vmparam.h ============================================================================== --- stable/10/sys/arm/include/vmparam.h Fri May 16 00:14:50 2014 (r266203) +++ stable/10/sys/arm/include/vmparam.h Fri May 16 01:30:30 2014 (r266204) @@ -145,17 +145,22 @@ #define VM_MAX_KERNEL_ADDRESS (vm_max_kernel_address) /* - * Virtual size (bytes) for various kernel submaps. + * How many physical pages per kmem arena virtual page. */ -#ifndef VM_KMEM_SIZE -#define VM_KMEM_SIZE (12*1024*1024) -#endif #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (3) +#define VM_KMEM_SIZE_SCALE (3) +#endif + +/* + * Optional floor (in bytes) on the size of the kmem arena. + */ +#ifndef VM_KMEM_SIZE_MIN +#define VM_KMEM_SIZE_MIN (12 * 1024 * 1024) #endif /* - * Ceiling on the size of the kmem submap: 40% of the kernel map. + * Optional ceiling (in bytes) on the size of the kmem arena: 40% of the + * kernel map. */ #ifndef VM_KMEM_SIZE_MAX #define VM_KMEM_SIZE_MAX ((vm_max_kernel_address - \ Modified: stable/10/sys/i386/include/vmparam.h ============================================================================== --- stable/10/sys/i386/include/vmparam.h Fri May 16 00:14:50 2014 (r266203) +++ stable/10/sys/i386/include/vmparam.h Fri May 16 01:30:30 2014 (r266204) @@ -164,24 +164,23 @@ #define VM_MAX_ADDRESS VADDR(PTDPTDI, PTDPTDI) #define VM_MIN_ADDRESS ((vm_offset_t)0) -/* virtual sizes (bytes) for various kernel submaps */ -#ifndef VM_KMEM_SIZE -#define VM_KMEM_SIZE (12 * 1024 * 1024) -#endif - /* - * How many physical pages per KVA page allocated. - * min(max(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), - * VM_KMEM_SIZE_MIN), VM_KMEM_SIZE_MAX) - * is the total KVA space allocated for kmem_map. + * How many physical pages per kmem arena virtual page. */ #ifndef VM_KMEM_SIZE_SCALE #define VM_KMEM_SIZE_SCALE (3) #endif /* - * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA space - * rounded to the nearest multiple of the superpage size. + * Optional floor (in bytes) on the size of the kmem arena. + */ +#ifndef VM_KMEM_SIZE_MIN +#define VM_KMEM_SIZE_MIN (12 * 1024 * 1024) +#endif + +/* + * Optional ceiling (in bytes) on the size of the kmem arena: 40% of the + * kernel map rounded to the nearest multiple of the superpage size. */ #ifndef VM_KMEM_SIZE_MAX #define VM_KMEM_SIZE_MAX (((((VM_MAX_KERNEL_ADDRESS - \ Modified: stable/10/sys/ia64/include/vmparam.h ============================================================================== --- stable/10/sys/ia64/include/vmparam.h Fri May 16 00:14:50 2014 (r266203) +++ stable/10/sys/ia64/include/vmparam.h Fri May 16 01:30:30 2014 (r266204) @@ -189,19 +189,11 @@ #define USRSTACK VM_MAXUSER_ADDRESS #define IA64_BACKINGSTORE (USRSTACK - (2 * MAXSSIZ) - PAGE_SIZE) -/* virtual sizes (bytes) for various kernel submaps */ -#ifndef VM_KMEM_SIZE -#define VM_KMEM_SIZE (12 * 1024 * 1024) -#endif - /* - * How many physical pages per KVA page allocated. - * min(max(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), - * VM_KMEM_SIZE_MIN), VM_KMEM_SIZE_MAX) - * is the total KVA space allocated for kmem_map. + * How many physical pages per kmem arena virtual page. */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (4) /* XXX 8192 byte pages */ +#define VM_KMEM_SIZE_SCALE (4) #endif /* initial pagein size of beginning of executable file */ Modified: stable/10/sys/kern/kern_malloc.c ============================================================================== --- stable/10/sys/kern/kern_malloc.c Fri May 16 00:14:50 2014 (r266203) +++ stable/10/sys/kern/kern_malloc.c Fri May 16 01:30:30 2014 (r266204) @@ -684,41 +684,47 @@ kmem_reclaim(vmem_t *vm, int flags) pagedaemon_wakeup(); } +CTASSERT(VM_KMEM_SIZE_SCALE >= 1); + /* - * Initialize the kernel memory arena. + * Initialize the kernel memory (kmem) arena. */ void kmeminit(void) { u_long mem_size, tmp; - + /* - * Try to auto-tune the kernel memory size, so that it is - * more applicable for a wider range of machine sizes. The - * VM_KMEM_SIZE_MAX is dependent on the maximum KVA space - * available. + * Calculate the amount of kernel virtual address (KVA) space that is + * preallocated to the kmem arena. In order to support a wide range + * of machines, it is a function of the physical memory size, + * specifically, + * + * min(max(physical memory size / VM_KMEM_SIZE_SCALE, + * VM_KMEM_SIZE_MIN), VM_KMEM_SIZE_MAX) * - * Note that the kmem arena is also used by the zone allocator, - * so make sure that there is enough space. + * Every architecture must define an integral value for + * VM_KMEM_SIZE_SCALE. However, the definitions of VM_KMEM_SIZE_MIN + * and VM_KMEM_SIZE_MAX, which represent respectively the floor and + * ceiling on this preallocation, are optional. Typically, + * VM_KMEM_SIZE_MAX is itself a function of the available KVA space on + * a given architecture. */ - vm_kmem_size = VM_KMEM_SIZE; mem_size = cnt.v_page_count; -#if defined(VM_KMEM_SIZE_SCALE) vm_kmem_size_scale = VM_KMEM_SIZE_SCALE; -#endif TUNABLE_INT_FETCH("vm.kmem_size_scale", &vm_kmem_size_scale); - if (vm_kmem_size_scale > 0 && - (mem_size / vm_kmem_size_scale) > (vm_kmem_size / PAGE_SIZE)) - vm_kmem_size = (mem_size / vm_kmem_size_scale) * PAGE_SIZE; + if (vm_kmem_size_scale < 1) + vm_kmem_size_scale = VM_KMEM_SIZE_SCALE; + + vm_kmem_size = (mem_size / vm_kmem_size_scale) * PAGE_SIZE; #if defined(VM_KMEM_SIZE_MIN) vm_kmem_size_min = VM_KMEM_SIZE_MIN; #endif TUNABLE_ULONG_FETCH("vm.kmem_size_min", &vm_kmem_size_min); - if (vm_kmem_size_min > 0 && vm_kmem_size < vm_kmem_size_min) { + if (vm_kmem_size_min > 0 && vm_kmem_size < vm_kmem_size_min) vm_kmem_size = vm_kmem_size_min; - } #if defined(VM_KMEM_SIZE_MAX) vm_kmem_size_max = VM_KMEM_SIZE_MAX; @@ -727,15 +733,17 @@ kmeminit(void) if (vm_kmem_size_max > 0 && vm_kmem_size >= vm_kmem_size_max) vm_kmem_size = vm_kmem_size_max; - /* Allow final override from the kernel environment */ - TUNABLE_ULONG_FETCH("vm.kmem_size", &vm_kmem_size); - /* - * Limit kmem virtual size to twice the physical memory. - * This allows for kmem map sparseness, but limits the size - * to something sane. Be careful to not overflow the 32bit - * ints while doing the check or the adjustment. + * Alternatively, the amount of KVA space that is preallocated to the + * kmem arena can be set statically at compile-time or manually + * through the kernel environment. However, it is still limited to + * twice the physical memory size, which has been sufficient to handle + * the most severe cases of external fragmentation in the kmem arena. */ +#if defined(VM_KMEM_SIZE) + vm_kmem_size = VM_KMEM_SIZE; +#endif + TUNABLE_ULONG_FETCH("vm.kmem_size", &vm_kmem_size); if (vm_kmem_size / 2 / PAGE_SIZE > mem_size) vm_kmem_size = 2 * mem_size * PAGE_SIZE; Modified: stable/10/sys/mips/include/vmparam.h ============================================================================== --- stable/10/sys/mips/include/vmparam.h Fri May 16 00:14:50 2014 (r266203) +++ stable/10/sys/mips/include/vmparam.h Fri May 16 01:30:30 2014 (r266204) @@ -108,22 +108,23 @@ #define VM_NRESERVLEVEL 0 #endif -/* virtual sizes (bytes) for various kernel submaps */ -#ifndef VM_KMEM_SIZE -#define VM_KMEM_SIZE (12 * 1024 * 1024) -#endif - /* - * How many physical pages per KVA page allocated. - * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX) - * is the total KVA space allocated for kmem_map. + * How many physical pages per kmem arena virtual page. */ #ifndef VM_KMEM_SIZE_SCALE #define VM_KMEM_SIZE_SCALE (3) #endif /* - * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA space. + * Optional floor (in bytes) on the size of the kmem arena. + */ +#ifndef VM_KMEM_SIZE_MIN +#define VM_KMEM_SIZE_MIN (12 * 1024 * 1024) +#endif + +/* + * Optional ceiling (in bytes) on the size of the kmem arena: 40% of the + * kernel map. */ #ifndef VM_KMEM_SIZE_MAX #define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ Modified: stable/10/sys/powerpc/include/vmparam.h ============================================================================== --- stable/10/sys/powerpc/include/vmparam.h Fri May 16 00:14:50 2014 (r266203) +++ stable/10/sys/powerpc/include/vmparam.h Fri May 16 01:30:30 2014 (r266204) @@ -172,21 +172,23 @@ struct pmap_physseg { #define SGROWSIZ (128UL*1024) /* amount to grow stack */ #endif -#ifndef VM_KMEM_SIZE -#define VM_KMEM_SIZE (12 * 1024 * 1024) +/* + * How many physical pages per kmem arena virtual page. + */ +#ifndef VM_KMEM_SIZE_SCALE +#define VM_KMEM_SIZE_SCALE (3) #endif /* - * How many physical pages per KVA page allocated. - * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX) - * is the total KVA space allocated for kmem_map. + * Optional floor (in bytes) on the size of the kmem arena. */ -#ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (3) +#ifndef VM_KMEM_SIZE_MIN +#define VM_KMEM_SIZE_MIN (12 * 1024 * 1024) #endif /* - * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA space. + * Optional ceiling (in bytes) on the size of the kmem arena: 40% of the + * usable KVA space. */ #ifndef VM_KMEM_SIZE_MAX #define VM_KMEM_SIZE_MAX ((VM_MAX_SAFE_KERNEL_ADDRESS - \ Modified: stable/10/sys/sparc64/include/vmparam.h ============================================================================== --- stable/10/sys/sparc64/include/vmparam.h Fri May 16 00:14:50 2014 (r266203) +++ stable/10/sys/sparc64/include/vmparam.h Fri May 16 01:30:30 2014 (r266204) @@ -198,24 +198,22 @@ #define USRSTACK (VM_MAX_USER_ADDRESS) /* - * Virtual size (bytes) for various kernel submaps. + * How many physical pages per kmem arena virtual page. */ -#ifndef VM_KMEM_SIZE -#define VM_KMEM_SIZE (16*1024*1024) +#ifndef VM_KMEM_SIZE_SCALE +#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 2) #endif /* - * How many physical pages per KVA page allocated. - * min(max(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), - * VM_KMEM_SIZE_MIN), VM_KMEM_SIZE_MAX) - * is the total KVA space allocated for kmem_map. + * Optional floor (in bytes) on the size of the kmem arena. */ -#ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 2) +#ifndef VM_KMEM_SIZE_MIN +#define VM_KMEM_SIZE_MIN (16 * 1024 * 1024) #endif /* - * Ceiling on amount of kmem_map kva space. + * Optional ceiling (in bytes) on the size of the kmem arena: 60% of the + * kernel map. */ #ifndef VM_KMEM_SIZE_MAX #define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 02:21:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 503F71A0; Fri, 16 May 2014 02:21: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 399AE2B0A; Fri, 16 May 2014 02:21: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 s4G2Lu4E048344; Fri, 16 May 2014 02:21:56 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4G2Lpqk048314; Fri, 16 May 2014 02:21:51 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405160221.s4G2Lpqk048314@svn.freebsd.org> From: Ian Lepore Date: Fri, 16 May 2014 02:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266207 - in stable/10/sys: arm/allwinner arm/arm arm/at91 arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/include arm/lpc arm/mv arm/ti/am335x dev/aic7xxx/aicasm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 02:21:56 -0000 Author: ian Date: Fri May 16 02:21:51 2014 New Revision: 266207 URL: http://svnweb.freebsd.org/changeset/base/266207 Log: MFC r262534, r262548, r262549, r262552, r262568, r262581, r262583, r262584, r262585, r262587, r262696, r262712 Replace many pasted identical definitions of cpu_initclocks() with a common implementation in arm/machdep.c. aicasm: Don't complain about missing prototypes to ease bootstrap issues. Vybrid: Add driver for Inter-Integrated Circuit (I2C). imx6: Initialize the Low Power Mode bits to keep the ARM cores running during WFI. All our current ARM multi-core systems have all cores in one package with a shared L2 cache, reflect that in the common cpu_topo() routine. mpcore timer: Supply a DELAY() implementation via weak linkage, so that SoC-specific code can supply a better implementation. imx6: Add some rudimentary voltage control. Add an armv7 implementation of cpu_sleep(). Add __used attribute so that the DELAY implementation doesn't get optimized away as unreferenced, causing linker errors when trying to resolve the weak reference to the missing function. Added: stable/10/sys/arm/freescale/vybrid/vf_i2c.c - copied, changed from r262552, head/sys/arm/freescale/vybrid/vf_i2c.c Modified: stable/10/sys/arm/allwinner/timer.c stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/generic_timer.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/mp_machdep.c stable/10/sys/arm/arm/mpcore_timer.c stable/10/sys/arm/at91/uart_dev_at91usart.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c stable/10/sys/arm/conf/VYBRID.common stable/10/sys/arm/freescale/imx/imx6_anatop.c stable/10/sys/arm/freescale/imx/imx6_ccm.c stable/10/sys/arm/freescale/imx/imx6_ccmreg.h stable/10/sys/arm/freescale/imx/imx_gpt.c stable/10/sys/arm/freescale/vybrid/files.vybrid stable/10/sys/arm/include/cpufunc.h stable/10/sys/arm/include/machdep.h stable/10/sys/arm/lpc/lpc_timer.c stable/10/sys/arm/mv/timer.c stable/10/sys/arm/ti/am335x/am335x_dmtimer.c stable/10/sys/dev/aic7xxx/aicasm/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/allwinner/timer.c ============================================================================== --- stable/10/sys/arm/allwinner/timer.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/allwinner/timer.c Fri May 16 02:21:51 2014 (r266207) @@ -295,12 +295,6 @@ a10_timer_get_timerfreq(struct a10_timer return (sc->timer0_freq); } -void -cpu_initclocks(void) -{ - cpu_initclocks_bsp(); -} - static int a10_timer_hardclock(void *arg) { Modified: stable/10/sys/arm/arm/cpufunc.c ============================================================================== --- stable/10/sys/arm/arm/cpufunc.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/arm/cpufunc.c Fri May 16 02:21:51 2014 (r266207) @@ -1107,7 +1107,7 @@ struct cpu_functions cortexa_cpufuncs = cpufunc_nullop, /* flush_brnchtgt_C */ (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - arm11_sleep, /* sleep */ + armv7_sleep, /* sleep */ /* Soft functions */ Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Fri May 16 02:21:51 2014 (r266207) @@ -343,3 +343,9 @@ ENTRY(armv7_idcache_inv_all) bx lr @ return END(armv7_l1cache_inv_all) +ENTRY_NP(armv7_sleep) + dsb + wfi + bx lr +END(armv7_sleep) + Modified: stable/10/sys/arm/arm/generic_timer.c ============================================================================== --- stable/10/sys/arm/arm/generic_timer.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/arm/generic_timer.c Fri May 16 02:21:51 2014 (r266207) @@ -332,16 +332,6 @@ static devclass_t arm_tmr_devclass; DRIVER_MODULE(timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); void -cpu_initclocks(void) -{ - - if (PCPU_GET(cpuid) == 0) - cpu_initclocks_bsp(); - else - cpu_initclocks_ap(); -} - -void DELAY(int usec) { int32_t counts, counts_per_usec; Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/arm/machdep.c Fri May 16 02:21:51 2014 (r266207) @@ -456,6 +456,30 @@ cpu_idle_wakeup(int cpu) return (0); } +/* + * Most ARM platforms don't need to do anything special to init their clocks + * (they get intialized during normal device attachment), and by not defining a + * cpu_initclocks() function they get this generic one. Any platform that needs + * to do something special can just provide their own implementation, which will + * override this one due to the weak linkage. + */ +void +arm_generic_initclocks(void) +{ + +#ifndef NO_EVENTTIMERS +#ifdef SMP + if (PCPU_GET(cpuid) == 0) + cpu_initclocks_bsp(); + else + cpu_initclocks_ap(); +#else + cpu_initclocks_bsp(); +#endif +#endif +} +__weak_reference(arm_generic_initclocks, cpu_initclocks); + int fill_regs(struct thread *td, struct reg *regs) { Modified: stable/10/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/10/sys/arm/arm/mp_machdep.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/arm/mp_machdep.c Fri May 16 02:21:51 2014 (r266207) @@ -371,7 +371,7 @@ struct cpu_group * cpu_topo(void) { - return (smp_topo_1level(CG_SHARE_L2, 1, 0)); + return (smp_topo_1level(CG_SHARE_L2, mp_ncpus, 0)); } void Modified: stable/10/sys/arm/arm/mpcore_timer.c ============================================================================== --- stable/10/sys/arm/arm/mpcore_timer.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/arm/mpcore_timer.c Fri May 16 02:21:51 2014 (r266207) @@ -129,12 +129,12 @@ uint32_t platform_arm_tmr_freq = 0; static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { - .tc_name = "ARM MPCore Timecounter", + .tc_name = "MPCore", .tc_get_timecount = arm_tmr_get_timecount, .tc_poll_pps = NULL, .tc_counter_mask = ~0u, .tc_frequency = 0, - .tc_quality = 1000, + .tc_quality = 800, }; /** @@ -254,7 +254,7 @@ arm_tmr_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "arm,mpcore-timers")) return (ENXIO); - device_set_desc(dev, "ARM Generic MPCore Timers"); + device_set_desc(dev, "ARM MPCore Timers"); return (BUS_PROBE_DEFAULT); } @@ -327,7 +327,7 @@ arm_tmr_attach(device_t dev) return (ENXIO); } - sc->et.et_name = "ARM MPCore Eventtimer"; + sc->et.et_name = "MPCore"; sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; sc->et.et_quality = 1000; @@ -359,25 +359,6 @@ static devclass_t arm_tmr_devclass; DRIVER_MODULE(mp_tmr, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); /** - * cpu_initclocks - called by system to initialise the cpu clocks - * - * This is a boilerplat function, most of the setup has already been done - * when the driver was attached. Therefore this function must only be called - * after the driver is attached. - * - * RETURNS - * nothing - */ -void -cpu_initclocks(void) -{ - if (PCPU_GET(cpuid) == 0) - cpu_initclocks_bsp(); - else - cpu_initclocks_ap(); -} - -/** * DELAY - Delay for at least usec microseconds. * @usec: number of microseconds to delay by * @@ -388,8 +369,8 @@ cpu_initclocks(void) * RETURNS: * nothing */ -void -DELAY(int usec) +static void __used /* Must emit function code for the weak ref below. */ +arm_tmr_DELAY(int usec) { int32_t counts_per_usec; int32_t counts; @@ -427,3 +408,11 @@ DELAY(int usec) first = last; } } + +/* + * Supply a DELAY() implementation via weak linkage. A platform may want to use + * the mpcore per-cpu eventtimers but provide its own DELAY() routine, + * especially when the core frequency can change on the fly. + */ +__weak_reference(arm_tmr_DELAY, DELAY); + Modified: stable/10/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- stable/10/sys/arm/at91/uart_dev_at91usart.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/at91/uart_dev_at91usart.c Fri May 16 02:21:51 2014 (r266207) @@ -279,7 +279,7 @@ at91_usart_init(struct uart_bas *bas, in * we don't want to hang here forever if the hardware is in a bad state. */ if (!(RD4(bas, USART_CSR) & USART_CSR_TXRDY)) - DELAY(1000); + DELAY(10000); at91_usart_param(bas, baudrate, databits, stopbits, parity); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Fri May 16 02:21:51 2014 (r266207) @@ -278,12 +278,6 @@ static devclass_t bcm_systimer_devclass; DRIVER_MODULE(bcm_systimer, simplebus, bcm_systimer_driver, bcm_systimer_devclass, 0, 0); void -cpu_initclocks(void) -{ - cpu_initclocks_bsp(); -} - -void DELAY(int usec) { int32_t counts; Modified: stable/10/sys/arm/conf/VYBRID.common ============================================================================== --- stable/10/sys/arm/conf/VYBRID.common Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/conf/VYBRID.common Fri May 16 02:21:51 2014 (r266207) @@ -124,8 +124,8 @@ device nand device uart # I2C (TWSI) -#device iic -#device iicbus +device iic +device iicbus # Ethernet device ether Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Fri May 16 02:21:51 2014 (r266207) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -85,8 +86,11 @@ struct imx6_anatop_softc { struct resource *res[2]; uint32_t cpu_curhz; uint32_t cpu_curmhz; + uint32_t cpu_curmv; uint32_t cpu_minhz; + uint32_t cpu_minmv; uint32_t cpu_maxhz; + uint32_t cpu_maxmv; uint32_t refosc_hz; void *temp_intrhand; uint32_t temp_high_val; @@ -103,12 +107,15 @@ struct imx6_anatop_softc { static struct imx6_anatop_softc *imx6_anatop_sc; /* - * Table of CPU max frequencies. This is indexed by the max frequency value - * (0-3) from the ocotp CFG3 register. + * Tables of CPU max frequencies and corresponding voltages. This is indexed by + * the max frequency value (0-3) from the ocotp CFG3 register. */ static uint32_t imx6_cpu_maxhz_tab[] = { 792000000, 852000000, 996000000, 1200000000 }; +static uint32_t imx6_cpu_millivolt_tab[] = { + 1150, 1225, 1225, 1275 +}; #define TZ_ZEROC 2732 /* deci-Kelvin <-> deci-Celcius offset. */ @@ -130,6 +137,64 @@ imx6_anatop_write_4(bus_size_t offset, u bus_write_4(imx6_anatop_sc->res[MEMRES], offset, value); } +static void +vdd_set(struct imx6_anatop_softc *sc, int mv) +{ + int newtarg, oldtarg; + uint32_t delay, pmureg; + static boolean_t init_done = false; + + /* + * The datasheet says VDD_PU and VDD_SOC must be equal, and VDD_ARM + * can't be more than 50mV above or 200mV below them. For now to keep + * things simple we set all three to the same value. + */ + + pmureg = imx6_anatop_read_4(IMX6_ANALOG_PMU_REG_CORE); + oldtarg = pmureg & IMX6_ANALOG_PMU_REG0_TARG_MASK; + + /* Convert mV to target value. Clamp target to valid range. */ + if (mv < 725) + newtarg = 0x00; + else if (mv > 1450) + newtarg = 0x1F; + else + newtarg = (mv - 700) / 25; + + /* + * The first time through the 3 voltages might not be equal so use a + * long conservative delay. After that we need to delay 3uS for every + * 25mV step upward. No need to delay at all when lowering. + */ + if (init_done) { + if (newtarg == oldtarg) + return; + else if (newtarg > oldtarg) + delay = (newtarg - oldtarg) * 3; + else + delay = 0; + } else { + delay = 700 / 25 * 3; + init_done = true; + } + + /* + * Make the change and wait for it to take effect. + */ + pmureg &= ~(IMX6_ANALOG_PMU_REG0_TARG_MASK | + IMX6_ANALOG_PMU_REG1_TARG_MASK | + IMX6_ANALOG_PMU_REG2_TARG_MASK); + + pmureg |= newtarg << IMX6_ANALOG_PMU_REG0_TARG_SHIFT; + pmureg |= newtarg << IMX6_ANALOG_PMU_REG1_TARG_SHIFT; + pmureg |= newtarg << IMX6_ANALOG_PMU_REG2_TARG_SHIFT; + + imx6_anatop_write_4(IMX6_ANALOG_PMU_REG_CORE, pmureg); + DELAY(delay); + sc->cpu_curmv = newtarg * 25 + 700; + device_printf(sc->dev, "voltage set to %u\n", sc->cpu_curmv); +} + static inline uint32_t cpufreq_hz_from_div(struct imx6_anatop_softc *sc, uint32_t div) { @@ -231,7 +296,9 @@ cpufreq_initialize(struct imx6_anatop_so FSL_OCOTP_CFG3_SPEED_MASK) >> FSL_OCOTP_CFG3_SPEED_SHIFT; sc->cpu_minhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[0]); + sc->cpu_minmv = imx6_cpu_millivolt_tab[0]; sc->cpu_maxhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[cfg3speed]); + sc->cpu_maxmv = imx6_cpu_millivolt_tab[cfg3speed]; /* * Set the CPU to maximum speed. @@ -241,6 +308,7 @@ cpufreq_initialize(struct imx6_anatop_so * basically assumes that a single core can't overheat before interrupts * are enabled; empirical testing shows that to be a safe assumption. */ + vdd_set(sc, sc->cpu_maxmv); cpufreq_set_clock(sc, sc->cpu_maxhz); device_printf(sc->dev, "CPU frequency %uMHz\n", sc->cpu_curmhz); } @@ -321,6 +389,7 @@ tempmon_gofast(struct imx6_anatop_softc { if (sc->cpu_curhz < sc->cpu_maxhz) { + vdd_set(sc, sc->cpu_maxmv); cpufreq_set_clock(sc, sc->cpu_maxhz); } } @@ -331,6 +400,7 @@ tempmon_goslow(struct imx6_anatop_softc if (sc->cpu_curhz > sc->cpu_minhz) { cpufreq_set_clock(sc, sc->cpu_minhz); + vdd_set(sc, sc->cpu_minmv); } } @@ -451,6 +521,11 @@ imx6_anatop_attach(device_t dev) if (err != 0) goto out; + SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "cpu_voltage", CTLFLAG_RD, + &sc->cpu_curmv, 0, "Current CPU voltage in millivolts"); + imx6_anatop_sc = sc; /* Modified: stable/10/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_ccm.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/freescale/imx/imx6_ccm.c Fri May 16 02:21:51 2014 (r266207) @@ -92,6 +92,7 @@ ccm_attach(device_t dev) { struct ccm_softc *sc; int err, rid; + uint32_t reg; sc = device_get_softc(dev); err = 0; @@ -107,6 +108,26 @@ ccm_attach(device_t dev) } ccm_sc = sc; + + /* + * Configure the Low Power Mode setting to leave the ARM core power on + * when a WFI instruction is executed. This lets the MPCore timers and + * GIC continue to run, which is helpful when the only thing that can + * wake you up is an MPCore Private Timer interrupt delivered via GIC. + * + * XXX Based on the docs, setting CCM_CGPR_INT_MEM_CLK_LPM shouldn't be + * required when the LPM bits are set to LPM_RUN. But experimentally + * I've experienced a fairly rare lockup when not setting it. I was + * unable to prove conclusively that the lockup was related to power + * management or that this definitively fixes it. Revisit this. + */ + reg = RD4(sc, CCM_CGPR); + reg |= CCM_CGPR_INT_MEM_CLK_LPM; + WR4(sc, CCM_CGPR, reg); + reg = RD4(sc, CCM_CLPCR); + reg = (reg & ~CCM_CLPCR_LPM_MASK) | CCM_CLPCR_LPM_RUN; + WR4(sc, CCM_CLPCR, reg); + err = 0; out: Modified: stable/10/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_ccmreg.h Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/freescale/imx/imx6_ccmreg.h Fri May 16 02:21:51 2014 (r266207) @@ -29,13 +29,20 @@ #ifndef IMX6_CCMREG_H #define IMX6_CCMREG_H -#define CCM_CCGR1 0x06C -#define CCM_CCGR2 0x070 -#define CCM_CCGR3 0x074 -#define CCM_CCGR4 0x078 -#define CCM_CCGR5 0x07C -#define CCM_CCGR6 0x080 -#define CCM_CMEOR 0x088 +#define CCM_CLPCR 0x054 +#define CCM_CLPCR_LPM_MASK 0x03 +#define CCM_CLPCR_LPM_RUN 0x00 +#define CCM_CLPCR_LPM_WAIT 0x01 +#define CCM_CLPCR_LPM_STOP 0x02 +#define CCM_CGPR 0x064 +#define CCM_CGPR_INT_MEM_CLK_LPM (1 << 17) +#define CCM_CCGR1 0x06C +#define CCM_CCGR2 0x070 +#define CCM_CCGR3 0x074 +#define CCM_CCGR4 0x078 +#define CCM_CCGR5 0x07C +#define CCM_CCGR6 0x080 +#define CCM_CMEOR 0x088 #endif Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_gpt.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/freescale/imx/imx_gpt.c Fri May 16 02:21:51 2014 (r266207) @@ -319,17 +319,6 @@ imx_gpt_get_timerfreq(struct imx_gpt_sof return (sc->clkfreq); } -void -cpu_initclocks(void) -{ - - if (imx_gpt_sc == NULL) { - panic("%s: i.MX GPT driver has not been initialized!", __func__); - } - - cpu_initclocks_bsp(); -} - static int imx_gpt_intr(void *arg) { Modified: stable/10/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- stable/10/sys/arm/freescale/vybrid/files.vybrid Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/freescale/vybrid/files.vybrid Fri May 16 02:21:51 2014 (r266207) @@ -23,6 +23,7 @@ arm/freescale/vybrid/vf_mscm.c standar arm/freescale/vybrid/vf_src.c standard arm/freescale/vybrid/vf_edma.c standard arm/freescale/vybrid/vf_dmamux.c standard +arm/freescale/vybrid/vf_i2c.c optional iicbus arm/freescale/vybrid/vf_tcon.c optional vt arm/freescale/vybrid/vf_dcu4.c optional vt arm/freescale/vybrid/vf_nfc.c optional nand Copied and modified: stable/10/sys/arm/freescale/vybrid/vf_i2c.c (from r262552, head/sys/arm/freescale/vybrid/vf_i2c.c) ============================================================================== --- head/sys/arm/freescale/vybrid/vf_i2c.c Thu Feb 27 09:59:15 2014 (r262552, copy source) +++ stable/10/sys/arm/freescale/vybrid/vf_i2c.c Fri May 16 02:21:51 2014 (r266207) @@ -104,11 +104,9 @@ struct i2c_softc { struct resource *res[2]; bus_space_tag_t bst; bus_space_handle_t bsh; - void *ih; device_t dev; device_t iicbus; struct mtx mutex; - int ibif; }; static struct resource_spec i2c_spec[] = { @@ -117,19 +115,6 @@ static struct resource_spec i2c_spec[] = { -1, 0 } }; -static void -i2c_intr(void *arg) -{ - struct i2c_softc *sc; - - sc = arg; - - if (READ1(sc, I2C_IBSR) & IBSR_IBIF) { - WRITE1(sc, I2C_IBSR, IBSR_IBIF); - sc->ibif = 1; - } -} - static int i2c_probe(device_t dev) { @@ -148,7 +133,6 @@ static int i2c_attach(device_t dev) { struct i2c_softc *sc; - int err; sc = device_get_softc(dev); sc->dev = dev; @@ -164,14 +148,6 @@ i2c_attach(device_t dev) sc->bst = rman_get_bustag(sc->res[0]); sc->bsh = rman_get_bushandle(sc->res[0]); - /* Setup interrupt handler */ - err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_BIO | INTR_MPSAFE, - NULL, i2c_intr, sc, &sc->ih); - if (err) { - device_printf(dev, "Unable to alloc interrupt resource.\n"); - return (ENXIO); - } - WRITE1(sc, I2C_IBIC, IBIC_BIIE); sc->iicbus = device_add_child(dev, "iicbus", -1); @@ -194,8 +170,10 @@ wait_for_iif(struct i2c_softc *sc) retry = 1000; while (retry --) { - if (sc->ibif == 1) + if (READ1(sc, I2C_IBSR) & IBSR_IBIF) { + WRITE1(sc, I2C_IBSR, IBSR_IBIF); return (IIC_NOERR); + } DELAY(10); } @@ -227,8 +205,10 @@ wait_for_icf(struct i2c_softc *sc) retry = 1000; while (retry --) { if (READ1(sc, I2C_IBSR) & IBSR_TCF) { - if (sc->ibif == 1) + if (READ1(sc, I2C_IBSR) & IBSR_IBIF) { + WRITE1(sc, I2C_IBSR, IBSR_IBIF); return (IIC_NOERR); + } } DELAY(10); } @@ -265,8 +245,6 @@ i2c_repeated_start(device_t dev, u_char DELAY(10); - sc->ibif = 0; - /* Write target address - LSB is R/W bit */ WRITE1(sc, I2C_IBDR, slave); @@ -310,8 +288,6 @@ i2c_start(device_t dev, u_char slave, in reg |= (IBCR_TXRX); WRITE1(sc, I2C_IBCR, reg); - sc->ibif = 0; - /* Write target address - LSB is R/W bit */ WRITE1(sc, I2C_IBDR, slave); @@ -407,7 +383,6 @@ i2c_read(device_t dev, char *buf, int le WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_MSSL); /* dummy read */ - sc->ibif = 0; READ1(sc, I2C_IBDR); DELAY(1000); } @@ -430,7 +405,6 @@ i2c_read(device_t dev, char *buf, int le WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_NOACK); } - sc->ibif = 0; *buf++ = READ1(sc, I2C_IBDR); (*read)++; } @@ -453,7 +427,6 @@ i2c_write(device_t dev, const char *buf, mtx_lock(&sc->mutex); while (*sent < len) { - sc->ibif = 0; WRITE1(sc, I2C_IBDR, *buf++); Modified: stable/10/sys/arm/include/cpufunc.h ============================================================================== --- stable/10/sys/arm/include/cpufunc.h Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/include/cpufunc.h Fri May 16 02:21:51 2014 (r266207) @@ -523,6 +523,7 @@ void armv7_setup (char *string); void armv7_context_switch (void); void armv7_drain_writebuf (void); void armv7_sev (void); +void armv7_sleep (int unused); u_int armv7_auxctrl (u_int, u_int); void pj4bv7_setup (char *string); void pj4b_config (void); Modified: stable/10/sys/arm/include/machdep.h ============================================================================== --- stable/10/sys/arm/include/machdep.h Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/include/machdep.h Fri May 16 02:21:51 2014 (r266207) @@ -32,6 +32,7 @@ vm_offset_t freebsd_parse_boot_param(str vm_offset_t linux_parse_boot_param(struct arm_boot_params *abp); vm_offset_t fake_preload_metadata(struct arm_boot_params *abp); vm_offset_t parse_boot_param(struct arm_boot_params *abp); +void arm_generic_initclocks(void); /* * Initialization functions called by the common initarm() function in Modified: stable/10/sys/arm/lpc/lpc_timer.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_timer.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/lpc/lpc_timer.c Fri May 16 02:21:51 2014 (r266207) @@ -280,12 +280,6 @@ lpc_get_timecount(struct timecounter *tc } void -cpu_initclocks(void) -{ - cpu_initclocks_bsp(); -} - -void DELAY(int usec) { uint32_t counter; Modified: stable/10/sys/arm/mv/timer.c ============================================================================== --- stable/10/sys/arm/mv/timer.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/mv/timer.c Fri May 16 02:21:51 2014 (r266207) @@ -224,13 +224,6 @@ mv_timer_get_timecount(struct timecounte } void -cpu_initclocks(void) -{ - - cpu_initclocks_bsp(); -} - -void DELAY(int usec) { uint32_t val, val_temp; Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Fri May 16 02:21:51 2014 (r266207) @@ -662,12 +662,6 @@ DRIVER_MODULE(am335x_dmtimer, simplebus, MODULE_DEPEND(am335x_dmtimer, am335x_prcm, 1, 1, 1); void -cpu_initclocks(void) -{ - cpu_initclocks_bsp(); -} - -void DELAY(int usec) { struct am335x_dmtimer_softc *sc; Modified: stable/10/sys/dev/aic7xxx/aicasm/Makefile ============================================================================== --- stable/10/sys/dev/aic7xxx/aicasm/Makefile Fri May 16 01:50:04 2014 (r266206) +++ stable/10/sys/dev/aic7xxx/aicasm/Makefile Fri May 16 02:21:51 2014 (r266207) @@ -39,3 +39,4 @@ LFLAGS+= -d .endif .include +CFLAGS+= -Wno-missing-prototypes From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 05:05:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 63952980; Fri, 16 May 2014 05:05: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 5012627C4; Fri, 16 May 2014 05:05: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 s4G55sUo020651; Fri, 16 May 2014 05:05:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4G55sj9020650; Fri, 16 May 2014 05:05:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201405160505.s4G55sj9020650@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 16 May 2014 05:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266210 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 05:05:54 -0000 Author: yongari Date: Fri May 16 05:05:53 2014 New Revision: 266210 URL: http://svnweb.freebsd.org/changeset/base/266210 Log: MFC r265942: Fix checksum computation. Previously it didn't include carry. Modified: stable/10/sys/netinet/ip_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_input.c ============================================================================== --- stable/10/sys/netinet/ip_input.c Fri May 16 03:18:09 2014 (r266209) +++ stable/10/sys/netinet/ip_input.c Fri May 16 05:05:53 2014 (r266210) @@ -1085,8 +1085,9 @@ found: * (and not in for{} loop), though it implies we are not going to * reassemble more than 64k fragments. */ - m->m_pkthdr.csum_data = - (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16); + while (m->m_pkthdr.csum_data & 0xffff0000) + m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + + (m->m_pkthdr.csum_data >> 16); #ifdef MAC mac_ipq_reassemble(fp, m); mac_ipq_destroy(fp); From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 05:10:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8655DCFE; Fri, 16 May 2014 05:10: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 5B82F2813; Fri, 16 May 2014 05:10: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 s4G5AHmt021591; Fri, 16 May 2014 05:10:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4G5AHdD021590; Fri, 16 May 2014 05:10:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201405160510.s4G5AHdD021590@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 16 May 2014 05:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266212 - stable/10/sys/dev/re X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 05:10:17 -0000 Author: yongari Date: Fri May 16 05:10:16 2014 New Revision: 266212 URL: http://svnweb.freebsd.org/changeset/base/266212 Log: MFC r265943: Disable TX IP/TCP/UDP checksum offloading for RTL8168C/RTL8168CP. Previously only TX IP checksum offloading was disabled but it's reported that TX checksum offloading for UDP datagrams with IP options also generates corrupted frames. Reporter's controller is RTL8168CP but I guess RTL8168C also have the same issue since it shall share the same core. Modified: stable/10/sys/dev/re/if_re.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/re/if_re.c ============================================================================== --- stable/10/sys/dev/re/if_re.c Fri May 16 05:06:46 2014 (r266211) +++ stable/10/sys/dev/re/if_re.c Fri May 16 05:10:16 2014 (r266212) @@ -1618,16 +1618,18 @@ re_attach(device_t dev) ifp->if_start = re_start; /* * RTL8168/8111C generates wrong IP checksummed frame if the - * packet has IP options so disable TX IP checksum offloading. + * packet has IP options so disable TX checksum offloading. */ if (sc->rl_hwrev->rl_rev == RL_HWREV_8168C || sc->rl_hwrev->rl_rev == RL_HWREV_8168C_SPIN2 || - sc->rl_hwrev->rl_rev == RL_HWREV_8168CP) - ifp->if_hwassist = CSUM_TCP | CSUM_UDP; - else + sc->rl_hwrev->rl_rev == RL_HWREV_8168CP) { + ifp->if_hwassist = 0; + ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TSO4; + } else { ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_TSO4; + } ifp->if_hwassist |= CSUM_TSO; - ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_TSO4; ifp->if_capenable = ifp->if_capabilities; ifp->if_init = re_init; IFQ_SET_MAXLEN(&ifp->if_snd, RL_IFQ_MAXLEN); @@ -3363,7 +3365,6 @@ re_ioctl(struct ifnet *ifp, u_long comma struct rl_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - uint32_t rev; int error = 0; switch (command) { @@ -3452,15 +3453,9 @@ re_ioctl(struct ifnet *ifp, u_long comma if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { ifp->if_capenable ^= IFCAP_TXCSUM; - if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) { - rev = sc->rl_hwrev->rl_rev; - if (rev == RL_HWREV_8168C || - rev == RL_HWREV_8168C_SPIN2 || - rev == RL_HWREV_8168CP) - ifp->if_hwassist |= CSUM_TCP | CSUM_UDP; - else - ifp->if_hwassist |= RE_CSUM_FEATURES; - } else + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= RE_CSUM_FEATURES; + else ifp->if_hwassist &= ~RE_CSUM_FEATURES; reinit = 1; } From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 12:43:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C0F4885A; Fri, 16 May 2014 12:43: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 A727C2A76; Fri, 16 May 2014 12:43: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 s4GChlNn022144; Fri, 16 May 2014 12:43:47 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GChjkb022131; Fri, 16 May 2014 12:43:45 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405161243.s4GChjkb022131@svn.freebsd.org> From: Ian Lepore Date: Fri, 16 May 2014 12:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266217 - in stable/10/sys: arm/at91 contrib/dts contrib/dts/arm dev/nand dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 12:43:47 -0000 Author: ian Date: Fri May 16 12:43:45 2014 New Revision: 266217 URL: http://svnweb.freebsd.org/changeset/base/266217 Log: MFC r262591, r262592, r262593, r262597, r262598, r262599, r262600, r262601, r262606 Initial import of Linux/Vendor DTS files for various embedded boards. Initial import of DTS files from Linux Correct initial import script New AT91 devices or fdt probe added to existing devices. Some of these are just stubs for testing the new dts. - nand - SDRAMC - shdwc - tcb - usb host and gadget Added: stable/10/sys/arm/at91/at91_sdramc.c - copied unchanged from r262598, head/sys/arm/at91/at91_sdramc.c stable/10/sys/arm/at91/at91_shdwc.c - copied unchanged from r262599, head/sys/arm/at91/at91_shdwc.c stable/10/sys/arm/at91/at91_tcb.c - copied unchanged from r262600, head/sys/arm/at91/at91_tcb.c stable/10/sys/contrib/dts/ - copied from r262591, head/sys/contrib/dts/ stable/10/sys/contrib/dts/arm/animeo_ip.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/animeo_ip.dts stable/10/sys/contrib/dts/arm/at91-ariag25.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91-ariag25.dts stable/10/sys/contrib/dts/arm/at91-cosino.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91-cosino.dtsi stable/10/sys/contrib/dts/arm/at91-cosino_mega2560.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91-cosino_mega2560.dts stable/10/sys/contrib/dts/arm/at91-foxg20.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91-foxg20.dts stable/10/sys/contrib/dts/arm/at91-qil_a9260.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91-qil_a9260.dts stable/10/sys/contrib/dts/arm/at91-sama5d3_xplained.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91-sama5d3_xplained.dts stable/10/sys/contrib/dts/arm/at91rm9200.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91rm9200.dtsi stable/10/sys/contrib/dts/arm/at91rm9200_pqfp.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91rm9200_pqfp.dtsi stable/10/sys/contrib/dts/arm/at91rm9200ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91rm9200ek.dts stable/10/sys/contrib/dts/arm/at91sam9260.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9260.dtsi stable/10/sys/contrib/dts/arm/at91sam9263.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9263.dtsi stable/10/sys/contrib/dts/arm/at91sam9263ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9263ek.dts stable/10/sys/contrib/dts/arm/at91sam9g15.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g15.dtsi stable/10/sys/contrib/dts/arm/at91sam9g15ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g15ek.dts stable/10/sys/contrib/dts/arm/at91sam9g20.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g20.dtsi stable/10/sys/contrib/dts/arm/at91sam9g20ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g20ek.dts stable/10/sys/contrib/dts/arm/at91sam9g20ek_2mmc.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g20ek_2mmc.dts stable/10/sys/contrib/dts/arm/at91sam9g20ek_common.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g20ek_common.dtsi stable/10/sys/contrib/dts/arm/at91sam9g25.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g25.dtsi stable/10/sys/contrib/dts/arm/at91sam9g25ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g25ek.dts stable/10/sys/contrib/dts/arm/at91sam9g35.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g35.dtsi stable/10/sys/contrib/dts/arm/at91sam9g35ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g35ek.dts stable/10/sys/contrib/dts/arm/at91sam9g45.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9g45.dtsi stable/10/sys/contrib/dts/arm/at91sam9m10g45ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9m10g45ek.dts stable/10/sys/contrib/dts/arm/at91sam9n12.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9n12.dtsi stable/10/sys/contrib/dts/arm/at91sam9n12ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9n12ek.dts stable/10/sys/contrib/dts/arm/at91sam9x25.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9x25.dtsi stable/10/sys/contrib/dts/arm/at91sam9x25ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9x25ek.dts stable/10/sys/contrib/dts/arm/at91sam9x35.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9x35.dtsi stable/10/sys/contrib/dts/arm/at91sam9x35ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9x35ek.dts stable/10/sys/contrib/dts/arm/at91sam9x5.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9x5.dtsi stable/10/sys/contrib/dts/arm/at91sam9x5_macb0.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9x5_macb0.dtsi stable/10/sys/contrib/dts/arm/at91sam9x5_macb1.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9x5_macb1.dtsi stable/10/sys/contrib/dts/arm/at91sam9x5_usart3.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9x5_usart3.dtsi stable/10/sys/contrib/dts/arm/at91sam9x5cm.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9x5cm.dtsi stable/10/sys/contrib/dts/arm/at91sam9x5ek.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/at91sam9x5ek.dtsi stable/10/sys/contrib/dts/arm/ethernut5.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/ethernut5.dts stable/10/sys/contrib/dts/arm/evk-pro3.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/evk-pro3.dts stable/10/sys/contrib/dts/arm/ge863-pro3.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/ge863-pro3.dtsi stable/10/sys/contrib/dts/arm/kizbox.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/kizbox.dts stable/10/sys/contrib/dts/arm/mpa1600.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/mpa1600.dts stable/10/sys/contrib/dts/arm/pm9g45.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/pm9g45.dts stable/10/sys/contrib/dts/arm/sama5d3.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3.dtsi stable/10/sys/contrib/dts/arm/sama5d31.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d31.dtsi stable/10/sys/contrib/dts/arm/sama5d31ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d31ek.dts stable/10/sys/contrib/dts/arm/sama5d33.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d33.dtsi stable/10/sys/contrib/dts/arm/sama5d33ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d33ek.dts stable/10/sys/contrib/dts/arm/sama5d34.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d34.dtsi stable/10/sys/contrib/dts/arm/sama5d34ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d34ek.dts stable/10/sys/contrib/dts/arm/sama5d35.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d35.dtsi stable/10/sys/contrib/dts/arm/sama5d35ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d35ek.dts stable/10/sys/contrib/dts/arm/sama5d36.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d36.dtsi stable/10/sys/contrib/dts/arm/sama5d36ek.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d36ek.dts stable/10/sys/contrib/dts/arm/sama5d3_can.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3_can.dtsi stable/10/sys/contrib/dts/arm/sama5d3_emac.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3_emac.dtsi stable/10/sys/contrib/dts/arm/sama5d3_gmac.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3_gmac.dtsi stable/10/sys/contrib/dts/arm/sama5d3_lcd.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3_lcd.dtsi stable/10/sys/contrib/dts/arm/sama5d3_mci2.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3_mci2.dtsi stable/10/sys/contrib/dts/arm/sama5d3_tcb1.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3_tcb1.dtsi stable/10/sys/contrib/dts/arm/sama5d3_uart.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3_uart.dtsi stable/10/sys/contrib/dts/arm/sama5d3xcm.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3xcm.dtsi stable/10/sys/contrib/dts/arm/sama5d3xdm.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3xdm.dtsi stable/10/sys/contrib/dts/arm/sama5d3xmb.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/sama5d3xmb.dtsi stable/10/sys/contrib/dts/arm/tny_a9260.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/tny_a9260.dts stable/10/sys/contrib/dts/arm/tny_a9260_common.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/tny_a9260_common.dtsi stable/10/sys/contrib/dts/arm/tny_a9263.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/tny_a9263.dts stable/10/sys/contrib/dts/arm/tny_a9g20.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/tny_a9g20.dts stable/10/sys/contrib/dts/arm/usb_a9260.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/usb_a9260.dts stable/10/sys/contrib/dts/arm/usb_a9260_common.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/usb_a9260_common.dtsi stable/10/sys/contrib/dts/arm/usb_a9263.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/usb_a9263.dts stable/10/sys/contrib/dts/arm/usb_a9g20.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/usb_a9g20.dts stable/10/sys/contrib/dts/arm/usb_a9g20_common.dtsi - copied unchanged from r262592, head/sys/contrib/dts/arm/usb_a9g20_common.dtsi stable/10/sys/contrib/dts/arm/usb_a9g20_lpw.dts - copied unchanged from r262592, head/sys/contrib/dts/arm/usb_a9g20_lpw.dts stable/10/sys/dev/usb/controller/at91dci_fdt.c - copied unchanged from r262601, head/sys/dev/usb/controller/at91dci_fdt.c stable/10/sys/dev/usb/controller/ohci_fdt.c - copied unchanged from r262601, head/sys/dev/usb/controller/ohci_fdt.c Modified: stable/10/sys/contrib/dts/FreeBSD-upgrade stable/10/sys/dev/nand/nfc_at91.c Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/at91/at91_sdramc.c (from r262598, head/sys/arm/at91/at91_sdramc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/at91/at91_sdramc.c Fri May 16 12:43:45 2014 (r266217, copy of r262598, head/sys/arm/at91/at91_sdramc.c) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2014 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +struct sdramc_softc { + struct resource *mem_res; /* Memory resource */ + device_t sc_dev; +}; + +static int +at91_sdramc_probe(device_t dev) +{ +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91sam9260-sdramc")) + return (ENXIO); +#endif + device_set_desc(dev, "SDRAMC"); + return (0); +} + +static int +at91_sdramc_attach(device_t dev) +{ + int rid, err = 0; + struct sdramc_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + + if (sc->mem_res == NULL) + panic("couldn't allocate register resources"); + + return (err); +} + +static device_method_t at91_sdramc_methods[] = { + DEVMETHOD(device_probe, at91_sdramc_probe), + DEVMETHOD(device_attach, at91_sdramc_attach), + DEVMETHOD_END +}; + +static driver_t at91_sdramc_driver = { + "at91_sdramc", + at91_sdramc_methods, + sizeof(struct sdramc_softc), +}; + +static devclass_t at91_sdramc_devclass; + +#ifdef FDT +DRIVER_MODULE(at91_sdramc, simplebus, at91_sdramc_driver, at91_sdramc_devclass, NULL, + NULL); +#else +DRIVER_MODULE(at91_sdramc, atmelarm, at91_sdramc_driver, at91_sdramc_devclass, NULL, + NULL); +#endif Copied: stable/10/sys/arm/at91/at91_shdwc.c (from r262599, head/sys/arm/at91/at91_shdwc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/at91/at91_shdwc.c Fri May 16 12:43:45 2014 (r266217, copy of r262599, head/sys/arm/at91/at91_shdwc.c) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2014 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +struct shdwc_softc { + struct resource *mem_res; /* Memory resource */ + device_t sc_dev; +}; + +static int +at91_shdwc_probe(device_t dev) +{ +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91sam9260-shdwc")) + return (ENXIO); +#endif + device_set_desc(dev, "SHDWC"); + return (0); +} + +static int +at91_shdwc_attach(device_t dev) +{ + int rid, err = 0; + struct shdwc_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + + if (sc->mem_res == NULL) + panic("couldn't allocate register resources"); + + return (err); +} + +static device_method_t at91_shdwc_methods[] = { + DEVMETHOD(device_probe, at91_shdwc_probe), + DEVMETHOD(device_attach, at91_shdwc_attach), + DEVMETHOD_END +}; + +static driver_t at91_shdwc_driver = { + "at91_shdwc", + at91_shdwc_methods, + sizeof(struct shdwc_softc), +}; + +static devclass_t at91_shdwc_devclass; + +#ifdef FDT +DRIVER_MODULE(at91_shdwc, simplebus, at91_shdwc_driver, at91_shdwc_devclass, NULL, + NULL); +#else +DRIVER_MODULE(at91_shdwc, atmelarm, at91_shdwc_driver, at91_shdwc_devclass, NULL, + NULL); +#endif Copied: stable/10/sys/arm/at91/at91_tcb.c (from r262600, head/sys/arm/at91/at91_tcb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/at91/at91_tcb.c Fri May 16 12:43:45 2014 (r266217, copy of r262600, head/sys/arm/at91/at91_tcb.c) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2014 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +struct tcb_softc { + struct resource *mem_res; /* Memory resource */ + device_t sc_dev; +}; + +static int +at91_tcb_probe(device_t dev) +{ +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-tcb")) + return (ENXIO); +#endif + device_set_desc(dev, "TCB"); + return (0); +} + +static int +at91_tcb_attach(device_t dev) +{ + int rid, err = 0; + struct tcb_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + + if (sc->mem_res == NULL) + panic("couldn't allocate register resources"); + + return (err); +} + +static device_method_t at91_tcb_methods[] = { + DEVMETHOD(device_probe, at91_tcb_probe), + DEVMETHOD(device_attach, at91_tcb_attach), + DEVMETHOD_END +}; + +static driver_t at91_tcb_driver = { + "at91_tcb", + at91_tcb_methods, + sizeof(struct tcb_softc), +}; + +static devclass_t at91_tcb_devclass; + +#ifdef FDT +DRIVER_MODULE(at91_tcb, simplebus, at91_tcb_driver, at91_tcb_devclass, NULL, + NULL); +#else +DRIVER_MODULE(at91_tcb, atmelarm, at91_tcb_driver, at91_tcb_devclass, NULL, + NULL); +#endif Modified: stable/10/sys/contrib/dts/FreeBSD-upgrade ============================================================================== --- head/sys/contrib/dts/FreeBSD-upgrade Fri Feb 28 01:31:35 2014 (r262591) +++ stable/10/sys/contrib/dts/FreeBSD-upgrade Fri May 16 12:43:45 2014 (r266217) @@ -18,7 +18,7 @@ # # This script should take care of all that the first time... -s=svn+ssh://svn.freebsd.org/base/vendor/device-tree/ +s=svn+ssh://svn.freebsd.org/base/vendor/device-tree/dist/ args=$(grep -v ^# FreeBSD-list | sed -e"s=^=$s=") svn cp -m "Initial import of DTS files from Linux" ${args} svn+ssh://svn.freebsd.org/base/head/sys/contrib/dts/arm Copied: stable/10/sys/contrib/dts/arm/animeo_ip.dts (from r262592, head/sys/contrib/dts/arm/animeo_ip.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/contrib/dts/arm/animeo_ip.dts Fri May 16 12:43:45 2014 (r266217, copy of r262592, head/sys/contrib/dts/arm/animeo_ip.dts) @@ -0,0 +1,167 @@ +/* + * animeo_ip.dts - Device Tree file for Somfy Animeo IP Boards + * + * Copyright (C) 2011-2012 Jean-Christophe PLAGNIOL-VILLARD + * + * Licensed under GPLv2 only. + */ + +/dts-v1/; +#include "at91sam9260.dtsi" + +/ { + model = "Somfy Animeo IP"; + compatible = "somfy,animeo-ip", "atmel,at91sam9260", "atmel,at91sam9"; + + aliases { + serial0 = &usart1; + serial1 = &usart2; + serial2 = &usart0; + serial3 = &dbgu; + serial4 = &usart3; + serial5 = &uart0; + serial6 = &uart1; + }; + + chosen { + linux,stdout-path = &usart2; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <18432000>; + }; + }; + + ahb { + apb { + usart0: serial@fffb0000 { + pinctrl-0 = <&pinctrl_usart0 &pinctrl_usart0_rts>; + linux,rs485-enabled-at-boot-time; + status = "okay"; + }; + + usart1: serial@fffb4000 { + pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts>; + linux,rs485-enabled-at-boot-time; + status = "okay"; + }; + + usart2: serial@fffb8000 { + pinctrl-0 = <&pinctrl_usart2>; + status = "okay"; + }; + + macb0: ethernet@fffc4000 { + pinctrl-0 = <&pinctrl_macb_rmii &pinctrl_macb_rmii_mii>; + phy-mode = "mii"; + status = "okay"; + }; + + mmc0: mmc@fffa8000 { + pinctrl-0 = <&pinctrl_mmc0_clk + &pinctrl_mmc0_slot1_cmd_dat0 + &pinctrl_mmc0_slot1_dat1_3>; + status = "okay"; + + slot@1 { + reg = <1>; + bus-width = <4>; + }; + }; + + watchdog@fffffd40 { + status = "okay"; + }; + }; + + nand0: nand@40000000 { + nand-bus-width = <8>; + nand-ecc-mode = "soft"; + nand-on-flash-bbt; + status = "okay"; + + barebox@0 { + label = "barebox"; + reg = <0x0 0x58000>; + }; + + u_boot_env@58000 { + label = "u_boot_env"; + reg = <0x58000 0x8000>; + }; + + ubi@60000 { + label = "ubi"; + reg = <0x60000 0x1FA0000>; + }; + }; + + usb0: ohci@00500000 { + num-ports = <2>; + atmel,vbus-gpio = <&pioB 15 GPIO_ACTIVE_LOW>; + status = "okay"; + }; + }; + + leds { + compatible = "gpio-leds"; + + power_green { + label = "power_green"; + gpios = <&pioC 17 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + }; + + power_red { + label = "power_red"; + gpios = <&pioA 2 GPIO_ACTIVE_HIGH>; + }; + + tx_green { + label = "tx_green"; + gpios = <&pioC 19 GPIO_ACTIVE_HIGH>; + }; + + tx_red { + label = "tx_red"; + gpios = <&pioC 18 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + + keyswitch_in { + label = "keyswitch_in"; + gpios = <&pioB 1 GPIO_ACTIVE_HIGH>; + linux,code = <28>; + gpio-key,wakeup; + }; + + error_in { + label = "error_in"; + gpios = <&pioB 2 GPIO_ACTIVE_HIGH>; + linux,code = <29>; + gpio-key,wakeup; + }; + + btn { + label = "btn"; + gpios = <&pioC 23 GPIO_ACTIVE_HIGH>; + linux,code = <31>; + gpio-key,wakeup; + }; + }; +}; Copied: stable/10/sys/contrib/dts/arm/at91-ariag25.dts (from r262592, head/sys/contrib/dts/arm/at91-ariag25.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/contrib/dts/arm/at91-ariag25.dts Fri May 16 12:43:45 2014 (r266217, copy of r262592, head/sys/contrib/dts/arm/at91-ariag25.dts) @@ -0,0 +1,180 @@ +/* + * at91-ariag25.dts - Device Tree file for Acme Systems Aria G25 (AT91SAM9G25 based) + * + * Copyright (C) 2013 Douglas Gilbert , + * Robert Nelson + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +#include "at91sam9g25.dtsi" + +/ { + model = "Acme Systems Aria G25"; + compatible = "acme,ariag25", "atmel,at91sam9x5ek", + "atmel,at91sam9x5", "atmel,at91sam9"; + + aliases { + serial0 = &dbgu; + serial1 = &usart0; + serial2 = &usart1; + serial3 = &usart2; + serial4 = &usart3; + serial5 = &uart0; + serial6 = &uart1; + }; + + chosen { + bootargs = "console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait"; + }; + + memory { + /* 128 MB, change this for 256 MB revision */ + reg = <0x20000000 0x8000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <12000000>; + }; + }; + + ahb { + apb { + mmc0: mmc@f0008000 { + /* N.B. Aria has no SD card detect (CD), assumed present */ + + pinctrl-0 = < + &pinctrl_mmc0_slot0_clk_cmd_dat0 + &pinctrl_mmc0_slot0_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + }; + }; + + i2c0: i2c@f8010000 { + status = "okay"; + }; + + i2c1: i2c@f8014000 { + status = "okay"; + }; + + /* TWD2+TCLK2 hidden behind ethernet, so no i2c2 */ + + usart0: serial@f801c000 { + pinctrl-0 = <&pinctrl_usart0 + &pinctrl_usart0_rts + &pinctrl_usart0_cts>; + status = "okay"; + }; + + usart1: serial@f8020000 { + pinctrl-0 = <&pinctrl_usart1 + /* &pinctrl_usart1_rts */ + /* &pinctrl_usart1_cts */ + >; + status = "okay"; + }; + + usart2: serial@f8024000 { + /* cannot activate RTS2+CTS2, clash with + * ethernet on PB0 and PB1 */ + pinctrl-0 = <&pinctrl_usart2>; + status = "okay"; + }; + + usart3: serial@f8028000 { + compatible = "atmel,at91sam9260-usart"; + reg = <0xf8028000 0x200>; + interrupts = <8 4 5>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usart3 + /* &pinctrl_usart3_rts */ + /* &pinctrl_usart3_cts */ + >; + status = "okay"; + }; + + macb0: ethernet@f802c000 { + phy-mode = "rmii"; + /* + * following can be overwritten by bootloader: + * for example u-boot 'ftd set' command + */ + local-mac-address = [00 00 00 00 00 00]; + status = "okay"; + }; + + /* + * UART0/1 pins are marked as GPIO on + * Aria documentation. + * Change to "okay" if you need additional serial ports + */ + uart0: serial@f8040000 { + status = "disabled"; + }; + + uart1: serial@f8044000 { + status = "disabled"; + }; + + adc0: adc@f804c000 { + status = "okay"; + atmel,adc-channels-used = <0xf>; + atmel,adc-num-channels = <4>; + }; + + dbgu: serial@fffff200 { + status = "okay"; + }; + + pinctrl@fffff400 { + w1_0 { + pinctrl_w1_0: w1_0-0 { + atmel,pins = <0 21 0x0 0x1>; /* PA21 PIO, pull-up */ + }; + }; + }; + + rtc@fffffeb0 { + status = "okay"; + }; + }; + + usb0: ohci@00600000 { + status = "okay"; + num-ports = <3>; + }; + + usb1: ehci@00700000 { + status = "okay"; + }; + }; + + leds { + compatible = "gpio-leds"; + + /* little green LED in middle of Aria G25 module */ + aria_led { + label = "aria_led"; + gpios = <&pioB 8 GPIO_ACTIVE_HIGH>; /* PB8 */ + linux,default-trigger = "heartbeat"; + }; + + }; + + onewire@0 { + compatible = "w1-gpio"; + gpios = <&pioA 21 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_w1_0>; + }; +}; Copied: stable/10/sys/contrib/dts/arm/at91-cosino.dtsi (from r262592, head/sys/contrib/dts/arm/at91-cosino.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/contrib/dts/arm/at91-cosino.dtsi Fri May 16 12:43:45 2014 (r266217, copy of r262592, head/sys/contrib/dts/arm/at91-cosino.dtsi) @@ -0,0 +1,122 @@ +/* + * at91-cosino.dtsi - Device Tree file for Cosino core module + * + * Copyright (C) 2013 - Rodolfo Giometti + * HCE Engineering + * + * Derived from at91sam9x5ek.dtsi by: + * Copyright (C) 2012 Atmel, + * 2012 Nicolas Ferre + * + * Licensed under GPLv2 or later. + */ + +#include "at91sam9g35.dtsi" + +/ { + model = "HCE Cosino core module"; + compatible = "hce,cosino", "atmel,at91sam9x5", "atmel,at91sam9"; + + chosen { + bootargs = "console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait"; + }; + + memory { + reg = <0x20000000 0x8000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <12000000>; + }; + }; + + ahb { + apb { + mmc0: mmc@f0008000 { + pinctrl-0 = < + &pinctrl_board_mmc0 + &pinctrl_mmc0_slot0_clk_cmd_dat0 + &pinctrl_mmc0_slot0_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioD 15 GPIO_ACTIVE_HIGH>; + }; + }; + + dbgu: serial@fffff200 { + status = "okay"; + }; + + usart0: serial@f801c000 { + status = "okay"; + }; + + i2c0: i2c@f8010000 { + status = "okay"; + }; + + adc0: adc@f804c000 { + atmel,adc-clock-rate = <1000000>; + atmel,adc-ts-wires = <4>; + atmel,adc-ts-pressure-threshold = <10000>; + status = "okay"; + }; + + pinctrl@fffff400 { + mmc0 { + pinctrl_board_mmc0: mmc0-board { + atmel,pins = + ; /* PD15 gpio CD pin pull up and deglitch */ + }; + }; + }; + + watchdog@fffffe40 { + status = "okay"; + }; + }; + + nand0: nand@40000000 { + nand-bus-width = <8>; + nand-ecc-mode = "hw"; + atmel,has-pmecc; /* Enable PMECC */ + atmel,pmecc-cap = <4>; + atmel,pmecc-sector-size = <512>; + nand-on-flash-bbt; + status = "okay"; + + at91bootstrap@0 { + label = "at91bootstrap"; + reg = <0x0 0x40000>; + }; + + uboot@40000 { + label = "u-boot"; + reg = <0x40000 0x80000>; + }; + + ubootenv@c0000 { + label = "U-Boot Env"; + reg = <0xc0000 0x140000>; + }; + + kernel@200000 { + label = "kernel"; + reg = <0x200000 0x600000>; + }; + + rootfs@800000 { + label = "rootfs"; + reg = <0x800000 0x0f800000>; + }; + }; + }; +}; Copied: stable/10/sys/contrib/dts/arm/at91-cosino_mega2560.dts (from r262592, head/sys/contrib/dts/arm/at91-cosino_mega2560.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/contrib/dts/arm/at91-cosino_mega2560.dts Fri May 16 12:43:45 2014 (r266217, copy of r262592, head/sys/contrib/dts/arm/at91-cosino_mega2560.dts) @@ -0,0 +1,84 @@ +/* + * at91-cosino_mega2560.dts - Device Tree file for Cosino board with + * Mega 2560 extension + * + * Copyright (C) 2013 - Rodolfo Giometti + * HCE Engineering + * + * Derived from at91sam9g35ek.dts by: + * Copyright (C) 2012 Atmel, + * 2012 Nicolas Ferre + * + * Licensed under GPLv2 or later. + */ + +/dts-v1/; +#include "at91-cosino.dtsi" + +/ { + model = "HCE Cosino Mega 2560"; + compatible = "hce,cosino_mega2560", "atmel,at91sam9x5", "atmel,at91sam9"; + + ahb { + apb { + macb0: ethernet@f802c000 { + phy-mode = "rmii"; + status = "okay"; + }; + + adc0: adc@f804c000 { + atmel,adc-clock-rate = <1000000>; + atmel,adc-ts-wires = <4>; + atmel,adc-ts-pressure-threshold = <10000>; + status = "okay"; + }; + + + tsadcc: tsadcc@f804c000 { + status = "okay"; + }; + + rtc@fffffeb0 { + status = "okay"; + }; + + usart1: serial@f8020000 { + status = "okay"; + }; + + usart2: serial@f8024000 { + status = "okay"; + }; + + usb2: gadget@f803c000 { + atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + mmc1: mmc@f000c000 { + pinctrl-0 = < + &pinctrl_mmc1_slot0_clk_cmd_dat0 + &pinctrl_mmc1_slot0_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + non-removable; + }; + }; + }; + + usb0: ohci@00600000 { + status = "okay"; + num-ports = <3>; + atmel,vbus-gpio = <0 /* &pioD 18 GPIO_ACTIVE_LOW */ + &pioD 19 GPIO_ACTIVE_LOW + &pioD 20 GPIO_ACTIVE_LOW + >; + }; + + usb1: ehci@00700000 { + status = "okay"; + }; + }; +}; Copied: stable/10/sys/contrib/dts/arm/at91-foxg20.dts (from r262592, head/sys/contrib/dts/arm/at91-foxg20.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/contrib/dts/arm/at91-foxg20.dts Fri May 16 12:43:45 2014 (r266217, copy of r262592, head/sys/contrib/dts/arm/at91-foxg20.dts) @@ -0,0 +1,157 @@ +/* + * at91-foxg20.dts - Device Tree file for Acme Systems FoxG20 board + * + * Based on DT files for at91sam9g20ek evaluation board (AT91SAM9G20 SoC) + * + * Copyright (C) 2013 Douglas Gilbert + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +#include "at91sam9g20.dtsi" + +/ { + model = "Acme Systems FoxG20"; + compatible = "acme,foxg20", "atmel,at91sam9g20", "atmel,at91sam9"; + + chosen { + bootargs = "console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait"; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <18432000>; + }; + }; + + ahb { + apb { + usb1: gadget@fffa4000 { + atmel,vbus-gpio = <&pioC 6 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + mmc0: mmc@fffa8000 { + pinctrl-0 = < + &pinctrl_mmc0_clk + &pinctrl_mmc0_slot1_cmd_dat0 + &pinctrl_mmc0_slot1_dat1_3>; + status = "okay"; + + slot@1 { + reg = <1>; + bus-width = <4>; + }; + }; + + usart0: serial@fffb0000 { + pinctrl-0 = + <&pinctrl_usart0 + &pinctrl_usart0_rts + &pinctrl_usart0_cts + >; + status = "okay"; + }; + + usart1: serial@fffb4000 { + status = "okay"; + }; + + usart2: serial@fffb8000 { + status = "okay"; + }; + + macb0: ethernet@fffc4000 { + phy-mode = "rmii"; + status = "okay"; + }; + + usart3: serial@fffd0000 { + status = "okay"; + }; + + uart0: serial@fffd4000 { + status = "okay"; + }; + + uart1: serial@fffd8000 { + status = "okay"; + }; + + dbgu: serial@fffff200 { + status = "okay"; + }; + + pinctrl@fffff400 { + board { + pinctrl_pck0_as_mck: pck0_as_mck { + atmel,pins = *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 14:28:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 591D7610; Fri, 16 May 2014 14:28: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 42CB724B4; Fri, 16 May 2014 14:28: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 s4GESvRe069534; Fri, 16 May 2014 14:28:57 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GESudO069528; Fri, 16 May 2014 14:28:56 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405161428.s4GESudO069528@svn.freebsd.org> From: Luiz Otavio O Souza Date: Fri, 16 May 2014 14:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266220 - in stable/10: share/man/man4 sys/geom/uncompress sys/geom/uzip sys/modules/geom sys/modules/geom/geom_uncompress X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 14:28:57 -0000 Author: loos Date: Fri May 16 14:28:55 2014 New Revision: 266220 URL: http://svnweb.freebsd.org/changeset/base/266220 Log: MFC r260522, r260523, r261439, r261440, r261586, r264504, r264769, r265193, r265194, r265197 r260522: Add the manual page for geom_uncompress(4). r260523: Build the geom_uncompress(4) module by default. Fix geom_uncompress(4) module loading. Don't link zlib.c (which is a module itself) directly. r261439: Remove some unnecessary code. The offsets read from the first block are overwritten a few lines bellow. r261440: Fix a logic error. Because of this inflateReset() wasn't being called and the output buffer wasn't being cleared between the inflate() calls, producing zeroed output after the first inflate() call. This fixes the read of mkuzip(8) images with geom_uncompress(4). r261586: Fix the build with DEBUG enabled. Where possible, fix style(9) issues. r264504: Make sure not to do I/O for more than MAXPHYS bytes. Doing so can cause problems in our providers, such as a KASSERT in md(4). We can initiate I/O for more than MAXPHYS bytes if we've been given a BIO for MAXPHYS bytes, the blocks from which we're reading couldn't be compressed and we had compression in preceeding blocks resulting in misalignment of the blocks we're trying to read relative to the sector. We're forced to round up the I/O length to make it an multiple of the sector size. When we detect the condition, we'll reduce the block count and perform a "short" read. In g_uzip_done() we need to consider the original I/O length and stop early if we're about to deflate a block that we didn't read. By using bio_completed in the cloned BIO and not bio_length to check for this, we automatically and gracefully handle short reads that our providers may be doing on top of the short reads we may initiate ourselves. r264769: Keep geom_uncompress(4) in line with geom_uzip(4), bring in the r264504 fix. Make sure not to start I/O bigger than MAXPHYS bytes. r265193: Some style and whitespace fixes. Reduce the difference between geom_uzip(4) and geom_uncompress(4). Now, they produce an almost clean diff(1) output. Remove a duplicated variable from g_uncompress.c and an unnecessary header from g_uzip.c. r265194: Actually the FEATURE() macro is defined on sys/sysctl.h. r265197: Fix a leak in g_uzip_taste(). After retrieve all the block offsets from the uzip image, free the last data read. Added: stable/10/share/man/man4/geom_uncompress.4 - copied unchanged from r260522, head/share/man/man4/geom_uncompress.4 Modified: stable/10/share/man/man4/Makefile stable/10/sys/geom/uncompress/g_uncompress.c stable/10/sys/geom/uzip/g_uzip.c stable/10/sys/modules/geom/Makefile stable/10/sys/modules/geom/geom_uncompress/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Fri May 16 14:09:51 2014 (r266219) +++ stable/10/share/man/man4/Makefile Fri May 16 14:28:55 2014 (r266220) @@ -153,6 +153,7 @@ MAN= aac.4 \ geom_fox.4 \ geom_linux_lvm.4 \ geom_map.4 \ + geom_uncompress.4 \ geom_uzip.4 \ gif.4 \ gpib.4 \ Copied: stable/10/share/man/man4/geom_uncompress.4 (from r260522, head/share/man/man4/geom_uncompress.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/geom_uncompress.4 Fri May 16 14:28:55 2014 (r266220, copy of r260522, head/share/man/man4/geom_uncompress.4) @@ -0,0 +1,107 @@ +.\" Copyright (c) 2014, Luiz Otavio O Souza +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 9, 2014 +.Dt GEOM_UNCOMPRESS 4 +.Os +.Sh NAME +.Nm geom_uncompress +.Nd "GEOM based compressed disk images" +.Sh SYNOPSIS +To compile this driver into the kernel, place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "options GEOM_UNCOMPRESS" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +geom_uncompress_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +framework provides support for compressed read only disk images. +This allows significant storage savings at the expense of a little CPU +time on each read. +Data written in the GEOM label area allows +.Nm +to detect compressed images which have been created with +.Xr mkulzma 8 +or +.Xr mkuzip 8 +and presented to the kernel as a logical disk device via +.Xr md 4 . +.Nm +creates a unique +.Pa md#.uncompress +device for each image. +.Pp +The +.Nm +device is subsequently used by the +.Fx +kernel to access the disk images. +The +.Nm +driver does not allow write operations to the underlying disk image. +To check which +.Xr md 4 +devices match a given +.Nm +device: +.Bd -literal -offset indent +# geom uncompress list +Geom name: md0.uncompress +Providers: +1. Name: md0.uncompress + Mediasize: 52428800 (50M) + Sectorsize: 512 + Mode: r1w0e0 +Consumers: +1. Name: md0 + Mediasize: 20864000 (20M) + Sectorsize: 512 + Mode: r1w0e0 +.Ed +.Sh SEE ALSO +.Xr GEOM 4 , +.Xr md 4 , +.Xr geom 8 , +.Xr mkulzma 8 , +.Xr mkuzip 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An "Maxim Sobolev" Aq sobomax@FreeBSD.org +and +.An "Aleksandr Rybalko" Aq ray@FreeBSD.org . +This manual page was written by +.An "Luiz Otavio O Souza" Aq loos@FreeBSD.org . Modified: stable/10/sys/geom/uncompress/g_uncompress.c ============================================================================== --- stable/10/sys/geom/uncompress/g_uncompress.c Fri May 16 14:09:51 2014 (r266219) +++ stable/10/sys/geom/uncompress/g_uncompress.c Fri May 16 14:28:55 2014 (r266220) @@ -116,7 +116,7 @@ g_uncompress_softc_free(struct g_uncompr } if (sc->offsets != NULL) { free(sc->offsets, M_GEOM_UNCOMPRESS); - sc->offsets = 0; + sc->offsets = NULL; } switch (sc->type) { @@ -150,6 +150,7 @@ z_alloc(void *nil, u_int type, u_int siz void *ptr; ptr = malloc(type * size, M_GEOM_UNCOMPRESS, M_NOWAIT); + return (ptr); } @@ -169,7 +170,7 @@ g_uncompress_done(struct bio *bp) struct g_geom *gp; struct bio *bp2; uint32_t start_blk, i; - off_t pos, upos; + off_t iolen, pos, upos; size_t bsize; int err; @@ -210,24 +211,27 @@ g_uncompress_done(struct bio *bp) */ 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: bio_length %lld bio_completed %lld start_blk %d, " - "pos %lld, upos %lld (%lld, %d, %d)\n", - gp->name, bp->bio_length, bp->bio_completed, start_blk, pos, upos, - bp2->bio_offset, sc->blksz, bsize)); + DPRINTF(("%s: done: bio_length %jd bio_completed %jd start_blk %d, " + "pos %jd, upos %jd (%jd, %d, %zu)\n", + gp->name, (intmax_t)bp->bio_length, (intmax_t)bp->bio_completed, + start_blk, (intmax_t)pos, (intmax_t)upos, + (intmax_t)bp2->bio_offset, sc->blksz, bsize)); for (i = start_blk; upos < bp2->bio_length; i++) { - off_t len, dlen, ulen, uoff; + off_t len, ulen, uoff; uoff = i == start_blk ? bp2->bio_offset % sc->blksz : 0; ulen = MIN(sc->blksz - uoff, bp2->bio_length - upos); - dlen = len = sc->offsets[i + 1] - sc->offsets[i]; + len = sc->offsets[i + 1] - sc->offsets[i]; - DPRINTF(("%s: done: inflate block %d, start %lld, end %lld " - "len %lld\n", - gp->name, i, sc->offsets[i], sc->offsets[i + 1], len)); + DPRINTF(( + "%s: done: inflate block %d, start %ju, end %ju len %jd\n", + gp->name, i, (uintmax_t)sc->offsets[i], + (uintmax_t)sc->offsets[i + 1], (intmax_t)len)); if (len == 0) { /* All zero block: no cache update */ @@ -236,12 +240,17 @@ g_uncompress_done(struct bio *bp) 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; + } mtx_lock(&sc->last_mtx); #ifdef GEOM_UNCOMPRESS_DEBUG if (g_debugflags & 32) - hexdump(bp->bio_data + pos, dlen, 0, 0); + hexdump(bp->bio_data + pos, len, 0, 0); #endif switch (sc->type) { @@ -249,7 +258,7 @@ g_uncompress_done(struct bio *bp) sc->b->in = bp->bio_data + pos; sc->b->out = sc->last_buf; sc->b->in_pos = sc->b->out_pos = 0; - sc->b->in_size = dlen; + sc->b->in_size = len; sc->b->out_size = (size_t)-1; err = (xz_dec_run(sc->s, sc->b) != XZ_STREAM_END) ? @@ -258,13 +267,13 @@ g_uncompress_done(struct bio *bp) break; case GEOM_UZIP: sc->zs->next_in = bp->bio_data + pos; - sc->zs->avail_in = dlen; + sc->zs->avail_in = len; sc->zs->next_out = sc->last_buf; sc->zs->avail_out = sc->blksz; err = (inflate(sc->zs, Z_FINISH) != Z_STREAM_END) ? 1 : 0; - if ((err) && (inflateReset(sc->zs) != Z_OK)) + if ((err) || (inflateReset(sc->zs) != Z_OK)) printf("%s: UZIP decoder reset failed\n", gp->name); break; @@ -290,6 +299,7 @@ g_uncompress_done(struct bio *bp) mtx_unlock(&sc->last_mtx); pos += len; + iolen -= len; upos += ulen; bp2->bio_completed += ulen; } @@ -298,8 +308,9 @@ done: /* * Finish processing the request. */ - DPRINTF(("%s: done: (%d, %lld, %ld)\n", - gp->name, bp2->bio_error, bp2->bio_completed, bp2->bio_resid)); + DPRINTF(("%s: done: (%d, %jd, %ld)\n", + gp->name, bp2->bio_error, (intmax_t)bp2->bio_completed, + bp2->bio_resid)); free(bp->bio_data, M_GEOM_UNCOMPRESS); g_destroy_bio(bp); g_io_deliver(bp2, bp2->bio_error); @@ -316,12 +327,12 @@ g_uncompress_start(struct bio *bp) uint32_t start_blk, end_blk; size_t bsize; - pp = bp->bio_to; gp = pp->geom; - DPRINTF(("%s: start (%s) to %s off=%lld len=%lld\n", gp->name, - (bp->bio_cmd==BIO_READ) ? "BIO_READ" : "BIO_WRITE*", - pp->name, bp->bio_offset, bp->bio_length)); + DPRINTF(("%s: start (%d:%s) to %s off=%jd len=%jd\n", + gp->name, bp->bio_cmd, + (bp->bio_cmd == BIO_READ) ? "BIO_READ" : "NOTSUPPORTED", + pp->name, (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length)); if (bp->bio_cmd != BIO_READ) { g_io_deliver(bp, EOPNOTSUPP); @@ -334,10 +345,8 @@ g_uncompress_start(struct bio *bp) start_blk = bp->bio_offset / sc->blksz; end_blk = howmany(bp->bio_offset + bp->bio_length, sc->blksz); - KASSERT(start_blk < sc->nblocks, - ("start_blk out of range")); - KASSERT(end_blk <= sc->nblocks, - ("end_blk out of range")); + 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) { @@ -353,9 +362,9 @@ g_uncompress_start(struct bio *bp) sc->req_cached++; mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: start: cached 0 + %lld, " - "%lld + 0 + %lld\n", - gp->name, bp->bio_length, uoff, bp->bio_length)); + 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; @@ -368,26 +377,31 @@ g_uncompress_start(struct bio *bp) g_io_deliver(bp, ENOMEM); return; } - DPRINTF(("%s: start (%d..%d), %s: %d + %llu, %s: %d + %llu\n", + DPRINTF(("%s: start (%d..%d), %s: %d + %jd, %s: %d + %jd\n", gp->name, start_blk, end_blk, - pp->name, pp->sectorsize, pp->mediasize, - pp2->name, pp2->sectorsize, pp2->mediasize)); - + pp->name, pp->sectorsize, (intmax_t)pp->mediasize, + pp2->name, pp2->sectorsize, (intmax_t)pp2->mediasize)); bsize = pp2->sectorsize; - bp2->bio_done = g_uncompress_done; - bp2->bio_offset = rounddown(sc->offsets[start_blk],bsize); - bp2->bio_length = roundup(sc->offsets[end_blk],bsize) - - bp2->bio_offset; - bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UNCOMPRESS, M_NOWAIT); + bp2->bio_offset = rounddown(sc->offsets[start_blk], bsize); + while (1) { + bp2->bio_length = roundup(sc->offsets[end_blk], bsize) - + bp2->bio_offset; + if (bp2->bio_length < MAXPHYS) + break; - DPRINTF(("%s: start %lld + %lld -> %lld + %lld -> %lld + %lld\n", + 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, - bp->bio_offset, bp->bio_length, - sc->offsets[start_blk], - sc->offsets[end_blk] - sc->offsets[start_blk], - bp2->bio_offset, bp2->bio_length)); - + (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_UNCOMPRESS, M_NOWAIT); if (bp2->bio_data == NULL) { g_destroy_bio(bp2); g_io_deliver(bp, ENOMEM); @@ -403,8 +417,7 @@ g_uncompress_orphan(struct g_consumer *c { struct g_geom *gp; - g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, - cp->provider->name); + g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, cp->provider->name); g_topology_assert(); gp = cp->geom; @@ -451,7 +464,7 @@ g_uncompress_taste(struct g_class *mp, s struct g_provider *pp2; struct g_consumer *cp; struct g_geom *gp; - uint32_t i, total_offsets, offsets_read, type; + uint32_t i, total_offsets, type; uint8_t *buf; int error; @@ -484,17 +497,15 @@ g_uncompress_taste(struct g_class *mp, s * Read cloop header, look for CLOOP magic, perform * other validity checks. */ - DPRINTF(("%s: media sectorsize %u, mediasize %lld\n", - gp->name, pp->sectorsize, pp->mediasize)); - + DPRINTF(("%s: media sectorsize %u, mediasize %jd\n", + gp->name, pp->sectorsize, (intmax_t)pp->mediasize)); i = roundup(sizeof(struct cloop_header), pp->sectorsize); buf = g_read_data(cp, 0, i, NULL); if (buf == NULL) goto err; - header = (struct cloop_header *) buf; if (strncmp(header->magic, CLOOP_MAGIC_START, - sizeof(CLOOP_MAGIC_START) - 1) != 0) { + sizeof(CLOOP_MAGIC_START) - 1) != 0) { DPRINTF(("%s: no CLOOP magic\n", gp->name)); goto err; } @@ -546,25 +557,20 @@ g_uncompress_taste(struct g_class *mp, s gp->name, sc->nblocks); goto err; } - sc->offsets = malloc( - total_offsets * sizeof(uint64_t), M_GEOM_UNCOMPRESS, M_WAITOK); - offsets_read = MIN(total_offsets, - (pp->sectorsize - sizeof(*header)) / sizeof(uint64_t)); - for (i = 0; i < offsets_read; i++) - sc->offsets[i] = be64toh(((uint64_t *) (header + 1))[i]); - DPRINTF(("%s: %u offsets in the first sector\n", - gp->name, offsets_read)); - free(buf, M_GEOM); + i = roundup((sizeof(struct cloop_header) + - total_offsets * sizeof(uint64_t)),pp->sectorsize); + total_offsets * sizeof(uint64_t)), pp->sectorsize); buf = g_read_data(cp, 0, i, NULL); if (buf == NULL) goto err; + sc->offsets = malloc(total_offsets * sizeof(uint64_t), + M_GEOM_UNCOMPRESS, M_WAITOK); for (i = 0; i <= total_offsets; i++) { sc->offsets[i] = be64toh(((uint64_t *) (buf+sizeof(struct cloop_header)))[i]); } + free(buf, M_GEOM); DPRINTF(("%s: done reading offsets\n", gp->name)); mtx_init(&sc->last_mtx, "geom_uncompress cache", NULL, MTX_DEF); sc->last_blk = -1; @@ -599,15 +605,13 @@ g_uncompress_taste(struct g_class *mp, s pp2->stripeoffset = pp->stripeoffset; } g_error_provider(pp2, 0); - free(buf, M_GEOM); g_access(cp, -1, 0, 0); - DPRINTF(("%s: taste ok (%d, %lld), (%d, %d), %x\n", + DPRINTF(("%s: taste ok (%d, %jd), (%d, %d), %x\n", gp->name, - pp2->sectorsize, pp2->mediasize, + pp2->sectorsize, (intmax_t)pp2->mediasize, pp2->stripeoffset, pp2->stripesize, pp2->flags)); - printf("%s: %u x %u blocks\n", - gp->name, sc->nblocks, sc->blksz); + printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz); return (gp); err: @@ -622,6 +626,7 @@ err: g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); + return (NULL); } @@ -648,6 +653,7 @@ g_uncompress_destroy_geom(struct gctl_re g_uncompress_softc_free(gp->softc, gp); gp->softc = NULL; g_wither_geom(gp, ENXIO); + return (0); } @@ -664,4 +670,4 @@ static struct g_class g_uncompress_class }; DECLARE_GEOM_CLASS(g_uncompress_class, g_uncompress); - +MODULE_DEPEND(g_uncompress, zlib, 1, 1, 1); Modified: stable/10/sys/geom/uzip/g_uzip.c ============================================================================== --- stable/10/sys/geom/uzip/g_uzip.c Fri May 16 14:09:51 2014 (r266219) +++ stable/10/sys/geom/uzip/g_uzip.c Fri May 16 14:28:55 2014 (r266220) @@ -35,8 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include @@ -45,19 +45,19 @@ FEATURE(geom_uzip, "GEOM uzip read-only #undef GEOM_UZIP_DEBUG #ifdef GEOM_UZIP_DEBUG -#define DPRINTF(a) printf a +#define DPRINTF(a) printf a #else -#define DPRINTF(a) +#define DPRINTF(a) #endif static MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); -#define UZIP_CLASS_NAME "UZIP" +#define UZIP_CLASS_NAME "UZIP" /* * Maximum allowed valid block size (to prevent foot-shooting) */ -#define MAX_BLKSZ (MAXPHYS - MAXPHYS / 1000 - 12) +#define MAX_BLKSZ (MAXPHYS - MAXPHYS / 1000 - 12) /* * Integer values (block size, number of blocks, offsets) @@ -65,7 +65,7 @@ static MALLOC_DEFINE(M_GEOM_UZIP, "geom_ * and in native order in struct g_uzip_softc */ -#define CLOOP_MAGIC_LEN 128 +#define CLOOP_MAGIC_LEN 128 static char CLOOP_MAGIC_START[] = "#!/bin/sh\n"; struct cloop_header { @@ -89,12 +89,15 @@ struct g_uzip_softc { static void g_uzip_softc_free(struct g_uzip_softc *sc, struct g_geom *gp) { + if (gp != NULL) { printf("%s: %d requests, %d cached\n", gp->name, sc->req_total, sc->req_cached); } - if (sc->offsets != NULL) + if (sc->offsets != NULL) { free(sc->offsets, M_GEOM_UZIP); + sc->offsets = NULL; + } mtx_destroy(&sc->last_mtx); free(sc->last_buf, M_GEOM_UZIP); free(sc, M_GEOM_UZIP); @@ -106,12 +109,14 @@ z_alloc(void *nil, u_int type, u_int siz void *ptr; ptr = malloc(type * size, M_GEOM_UZIP, M_NOWAIT); - return ptr; + + return (ptr); } static void z_free(void *nil, void *ptr) { + free(ptr, M_GEOM_UZIP); } @@ -125,7 +130,7 @@ g_uzip_done(struct bio *bp) struct g_consumer *cp; struct g_geom *gp; struct g_uzip_softc *sc; - off_t pos, upos; + off_t iolen, pos, upos; uint32_t start_blk, i; size_t bsize; @@ -153,11 +158,13 @@ g_uzip_done(struct bio *bp) } 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 %lld, upos %lld (%lld, %d, %d)\n", - gp->name, start_blk, pos, upos, - bp2->bio_offset, sc->blksz, bsize)); + 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; @@ -172,6 +179,12 @@ g_uzip_done(struct bio *bp) 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; @@ -181,21 +194,22 @@ g_uzip_done(struct bio *bp) if (err != Z_STREAM_END) { sc->last_blk = -1; mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: done: inflate failed (%lld + %lld -> %lld + %lld + %lld)\n", - gp->name, pos, len, uoff, upos, ulen)); + 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 %lld + %lld -> %lld + %lld + %lld\n", - gp->name, - pos, len, - uoff, upos, ulen)); + 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); pos += len; + iolen -= len; upos += ulen; bp2->bio_completed += ulen; err = inflateReset(&zs); @@ -215,8 +229,9 @@ done: /* * Finish processing the request. */ - DPRINTF(("%s: done: (%d, %lld, %ld)\n", - gp->name, bp2->bio_error, bp2->bio_completed, bp2->bio_resid)); + DPRINTF(("%s: done: (%d, %jd, %ld)\n", + gp->name, bp2->bio_error, (intmax_t)bp2->bio_completed, + bp2->bio_resid)); free(bp->bio_data, M_GEOM_UZIP); g_destroy_bio(bp); g_io_deliver(bp2, bp2->bio_error); @@ -248,10 +263,8 @@ g_uzip_start(struct bio *bp) 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")); + 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) { @@ -267,8 +280,9 @@ g_uzip_start(struct bio *bp) sc->req_cached++; mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: start: cached 0 + %lld, %lld + 0 + %lld\n", - gp->name, bp->bio_length, uoff, bp->bio_length)); + 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; @@ -282,19 +296,28 @@ g_uzip_start(struct bio *bp) return; } bp2->bio_done = g_uzip_done; - DPRINTF(("%s: start (%d..%d), %s: %d + %lld, %s: %d + %lld\n", + DPRINTF(("%s: start (%d..%d), %s: %d + %jd, %s: %d + %jd\n", gp->name, start_blk, end_blk, - pp->name, pp->sectorsize, pp->mediasize, - pp2->name, pp2->sectorsize, pp2->mediasize)); + 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; - bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; - bp2->bio_length = (bp2->bio_length + bsize - 1) / bsize * bsize; - DPRINTF(("%s: start %lld + %lld -> %lld + %lld -> %lld + %lld\n", + 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, - bp->bio_offset, bp->bio_length, - sc->offsets[start_blk], sc->offsets[end_blk] - sc->offsets[start_blk], - bp2->bio_offset, bp2->bio_length)); + (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); @@ -311,7 +334,7 @@ g_uzip_orphan(struct g_consumer *cp) { struct g_geom *gp; - g_trace(G_T_TOPOLOGY, "g_uzip_orphan(%p/%s)", cp, cp->provider->name); + g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, cp->provider->name); g_topology_assert(); gp = cp->geom; @@ -331,7 +354,7 @@ g_uzip_access(struct g_provider *pp, int KASSERT (cp != NULL, ("g_uzip_access but no consumer")); if (cp->acw + dw > 0) - return EROFS; + return (EROFS); return (g_access(cp, dr, dw, de)); } @@ -342,7 +365,7 @@ g_uzip_spoiled(struct g_consumer *cp) struct g_geom *gp; gp = cp->geom; - g_trace(G_T_TOPOLOGY, "g_uzip_spoiled(%p/%s)", cp, gp->name); + g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, gp->name); g_topology_assert(); g_uzip_softc_free(gp->softc, gp); @@ -362,7 +385,7 @@ g_uzip_taste(struct g_class *mp, struct struct g_provider *pp2; struct g_uzip_softc *sc; - g_trace(G_T_TOPOLOGY, "g_uzip_taste(%s,%s)", mp->name, pp->name); + g_trace(G_T_TOPOLOGY, "%s(%s,%s)", __func__, mp->name, pp->name); g_topology_assert(); /* Skip providers that are already open for writing. */ @@ -391,14 +414,14 @@ g_uzip_taste(struct g_class *mp, struct * Read cloop header, look for CLOOP magic, perform * other validity checks. */ - DPRINTF(("%s: media sectorsize %u, mediasize %lld\n", - gp->name, pp->sectorsize, pp->mediasize)); + DPRINTF(("%s: media sectorsize %u, mediasize %jd\n", + gp->name, pp->sectorsize, (intmax_t)pp->mediasize)); buf = g_read_data(cp, 0, pp->sectorsize, NULL); if (buf == NULL) goto err; header = (struct cloop_header *) buf; if (strncmp(header->magic, CLOOP_MAGIC_START, - sizeof(CLOOP_MAGIC_START) - 1) != 0) { + sizeof(CLOOP_MAGIC_START) - 1) != 0) { DPRINTF(("%s: no CLOOP magic\n", gp->name)); goto err; } @@ -427,7 +450,7 @@ g_uzip_taste(struct g_class *mp, struct if (sizeof(struct cloop_header) + total_offsets * sizeof(uint64_t) > pp->mediasize) { printf("%s: media too small for %u blocks\n", - gp->name, sc->nblocks); + gp->name, sc->nblocks); goto err; } sc->offsets = malloc( @@ -456,6 +479,7 @@ g_uzip_taste(struct g_class *mp, struct } offsets_read += nread; } + free(buf, M_GEOM); DPRINTF(("%s: done reading offsets\n", gp->name)); mtx_init(&sc->last_mtx, "geom_uzip cache", NULL, MTX_DEF); sc->last_blk = -1; @@ -467,17 +491,16 @@ g_uzip_taste(struct g_class *mp, struct pp2 = g_new_providerf(gp, "%s", gp->name); pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; - pp2->stripesize = pp->stripesize; - pp2->stripeoffset = pp->stripeoffset; + pp2->stripesize = pp->stripesize; + pp2->stripeoffset = pp->stripeoffset; g_error_provider(pp2, 0); g_access(cp, -1, 0, 0); - DPRINTF(("%s: taste ok (%d, %lld), (%d, %d), %x\n", + DPRINTF(("%s: taste ok (%d, %jd), (%d, %d), %x\n", gp->name, - pp2->sectorsize, pp2->mediasize, + pp2->sectorsize, (intmax_t)pp2->mediasize, pp2->stripeoffset, pp2->stripesize, pp2->flags)); - printf("%s: %u x %u blocks\n", - gp->name, sc->nblocks, sc->blksz); + printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz); return (gp); err: @@ -492,6 +515,7 @@ err: g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); + return (NULL); } @@ -500,7 +524,7 @@ g_uzip_destroy_geom(struct gctl_req *req { struct g_provider *pp; - g_trace(G_T_TOPOLOGY, "g_uzip_destroy_geom(%s, %s)", mp->name, gp->name); + g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name); g_topology_assert(); if (gp->softc == NULL) { @@ -517,6 +541,7 @@ g_uzip_destroy_geom(struct gctl_req *req g_uzip_softc_free(gp->softc, gp); gp->softc = NULL; g_wither_geom(gp, ENXIO); + return (0); } Modified: stable/10/sys/modules/geom/Makefile ============================================================================== --- stable/10/sys/modules/geom/Makefile Fri May 16 14:09:51 2014 (r266219) +++ stable/10/sys/modules/geom/Makefile Fri May 16 14:28:55 2014 (r266220) @@ -24,6 +24,7 @@ SUBDIR= geom_bde \ geom_shsec \ geom_stripe \ geom_sunlabel \ + geom_uncompress \ geom_uzip \ geom_vinum \ geom_virstor \ Modified: stable/10/sys/modules/geom/geom_uncompress/Makefile ============================================================================== --- stable/10/sys/modules/geom/geom_uncompress/Makefile Fri May 16 14:09:51 2014 (r266219) +++ stable/10/sys/modules/geom/geom_uncompress/Makefile Fri May 16 14:28:55 2014 (r266220) @@ -7,11 +7,11 @@ ${.CURDIR}/../../../net KMOD= geom_uncompress -CFLAGS= -I${.CURDIR}/../../../geom/uncompress/ \ +CFLAGS+= -I${.CURDIR}/../../../geom/uncompress/ \ -I${.CURDIR}/../../../contrib/xz-embedded/freebsd \ -I${.CURDIR}/../../../contrib/xz-embedded/linux/lib/xz/ SRCS= g_uncompress.c xz_crc32.c xz_dec_bcj.c xz_dec_lzma2.c xz_dec_stream.c \ - xz_malloc.c zlib.c + xz_malloc.c SRCS+= xz.h xz_config.h xz_lzma2.h xz_malloc.h xz_private.h xz_stream.h zlib.h .include From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 15:34:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D2904F1E; Fri, 16 May 2014 15:34: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 A63882B73; Fri, 16 May 2014 15:34: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 s4GFYNRs006874; Fri, 16 May 2014 15:34:23 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GFYNGR006873; Fri, 16 May 2014 15:34:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405161534.s4GFYNGR006873@svn.freebsd.org> From: Ian Lepore Date: Fri, 16 May 2014 15:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266239 - stable/10/sys/boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 15:34:23 -0000 Author: ian Date: Fri May 16 15:34:23 2014 New Revision: 266239 URL: http://svnweb.freebsd.org/changeset/base/266239 Log: MFC 258547, 259122 Add clock frequency for rk3188 watchdog. Replace "clocks" to "clock-frequency". Add gpio config for usb1 in dts. Modified: stable/10/sys/boot/fdt/dts/rk3188.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/rk3188.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/rk3188.dtsi Fri May 16 15:32:16 2014 (r266238) +++ stable/10/sys/boot/fdt/dts/rk3188.dtsi Fri May 16 15:34:23 2014 (r266239) @@ -80,7 +80,7 @@ compatible = "rockchip,rk3188-dw-apb-timer-osc"; reg = <0x20038000 0x20>; interrupts = <76>; - clocks = <24000000>; + clock-frequency = <24000000>; status = "disabled"; }; @@ -88,7 +88,7 @@ compatible = "rockchip,rk30xx-timer"; reg = <0x20038020 0x20>; interrupts = <77>; - clocks = <24000000>; + clock-frequency = <24000000>; status = "disabled"; }; @@ -96,7 +96,7 @@ compatible = "rockchip,rk30xx-timer"; reg = <0x20038060 0x20>; interrupts = <91>; - clocks = <24000000>; + clock-frequency = <24000000>; status = "disabled"; }; @@ -104,7 +104,7 @@ compatible = "rockchip,rk30xx-timer"; reg = <0x20038080 0x20>; interrupts = <92>; - clocks = <24000000>; + clock-frequency = <24000000>; status = "disabled"; }; @@ -112,13 +112,14 @@ compatible = "rockchip,rk30xx-timer"; reg = <0x200380a0 0x20>; interrupts = <96>; - clocks = <24000000>; + clock-frequency = <24000000>; status = "disabled"; }; watchdog@2004c000 { compatible = "rockchip,rk30xx-wdt"; reg = <0x2004c000 0x100>; + clock-frequency = < 66000000 >; }; gpio0: gpio@2000a000 { @@ -173,6 +174,7 @@ interrupt-parent = <&GIC>; #address-cells = <1>; #size-cells = <0>; + gpios = <&gpio0 3 2 2>; }; uart0: serial@10124000 { @@ -233,7 +235,7 @@ interrupts = <55>; #address-cells = <1>; #size-cells = <0>; - clocks = <24000000>; /* TODO: verify freq */ + clock-frequency = <24000000>; /* TODO: verify freq */ status = "disabled"; }; @@ -243,7 +245,7 @@ interrupts = <56>; #address-cells = <1>; #size-cells = <0>; - clocks = <24000000>; /* TODO: verify freq */ + clock-frequency = <24000000>; /* TODO: verify freq */ status = "disabled"; }; }; From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 15:39:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1C6DD15C; Fri, 16 May 2014 15: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 095342BC1; Fri, 16 May 2014 15:39: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 s4GFdB3u007531; Fri, 16 May 2014 15:39:11 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GFdBZ6007530; Fri, 16 May 2014 15:39:11 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405161539.s4GFdBZ6007530@svn.freebsd.org> From: Ian Lepore Date: Fri, 16 May 2014 15:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266240 - stable/10/sys/boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 15:39:12 -0000 Author: ian Date: Fri May 16 15:39:11 2014 New Revision: 266240 URL: http://svnweb.freebsd.org/changeset/base/266240 Log: MFC 252439: Fix the led 'gpios' definition to match the documented binding Modified: stable/10/sys/boot/fdt/dts/rpi.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/rpi.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/rpi.dts Fri May 16 15:34:23 2014 (r266239) +++ stable/10/sys/boot/fdt/dts/rpi.dts Fri May 16 15:39:11 2014 (r266240) @@ -316,7 +316,7 @@ ok { label = "ok"; - gpios = <&gpio 16 1>; + gpios = <&gpio 16 2 0>; /* Don't change this - it configures * how the led driver determines if From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 15:48:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E4E2B71E; Fri, 16 May 2014 15:48: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 D16F92CB0; Fri, 16 May 2014 15:48: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 s4GFmjPb013660; Fri, 16 May 2014 15:48:45 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GFmjY0013656; Fri, 16 May 2014 15:48:45 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405161548.s4GFmjY0013656@svn.freebsd.org> From: Christian Brueffer Date: Fri, 16 May 2014 15:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266243 - in stable/10: lib/libc/rpc sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 15:48:46 -0000 Author: brueffer Date: Fri May 16 15:48:45 2014 New Revision: 266243 URL: http://svnweb.freebsd.org/changeset/base/266243 Log: MFC: r265238, r265240 Properly free resources in case of error. CID: 1007032 Found with: Coverity Prevent(tm) Modified: stable/10/lib/libc/rpc/clnt_vc.c stable/10/sys/rpc/clnt_vc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/clnt_vc.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_vc.c Fri May 16 15:46:28 2014 (r266242) +++ stable/10/lib/libc/rpc/clnt_vc.c Fri May 16 15:48:45 2014 (r266243) @@ -301,15 +301,13 @@ clnt_vc_create(fd, raddr, prog, vers, se return (cl); err: - if (cl) { - if (ct) { - if (ct->ct_addr.len) - mem_free(ct->ct_addr.buf, ct->ct_addr.len); - mem_free(ct, sizeof (struct ct_data)); - } - if (cl) - mem_free(cl, sizeof (CLIENT)); + if (ct) { + if (ct->ct_addr.len) + mem_free(ct->ct_addr.buf, ct->ct_addr.len); + mem_free(ct, sizeof (struct ct_data)); } + if (cl) + mem_free(cl, sizeof (CLIENT)); return ((CLIENT *)NULL); } Modified: stable/10/sys/rpc/clnt_vc.c ============================================================================== --- stable/10/sys/rpc/clnt_vc.c Fri May 16 15:46:28 2014 (r266242) +++ stable/10/sys/rpc/clnt_vc.c Fri May 16 15:48:45 2014 (r266243) @@ -270,14 +270,12 @@ clnt_vc_create( return (cl); err: - if (cl) { - if (ct) { - mtx_destroy(&ct->ct_lock); - mem_free(ct, sizeof (struct ct_data)); - } - if (cl) - mem_free(cl, sizeof (CLIENT)); + if (ct) { + mtx_destroy(&ct->ct_lock); + mem_free(ct, sizeof (struct ct_data)); } + if (cl) + mem_free(cl, sizeof (CLIENT)); return ((CLIENT *)NULL); } From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 15:56:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 79B8262C; Fri, 16 May 2014 15:56: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 49CDF2DD3; Fri, 16 May 2014 15:56: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 s4GFucPi020149; Fri, 16 May 2014 15:56:38 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GFuZke020131; Fri, 16 May 2014 15:56:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405161556.s4GFuZke020131@svn.freebsd.org> From: Ian Lepore Date: Fri, 16 May 2014 15:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266251 - in stable/10: . share/mk sys/boot/fdt/dts sys/boot/fdt/dts/arm sys/boot/fdt/dts/mips sys/boot/fdt/dts/powerpc sys/conf sys/tools/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 15:56:38 -0000 Author: ian Date: Fri May 16 15:56:34 2014 New Revision: 266251 URL: http://svnweb.freebsd.org/changeset/base/266251 Log: MFC 262614, 262625, 262626, 262627, 262682, 262714, 262725, 262736 Integrate device-tree upstream files into the build process: (1) Invoke cpp to bring in files via #include (although the old /include/ stuff is supported still). (2) bring in files from either vendor tree or freebsd-custom files when building. (3) move all dts* files from sys/boot/fdt/dts to sys/boot/fdt/dts/${MACHINE} as appropriate. (4) encode all the magic to do the build in sys/tools/fdt/make_dtb.sh so that the different places in the tree use the exact same logic. (5) switch back to gpl dtc by default. the bsdl one in the tree has significant issues not easily addressed by those unfamiliar with the code. Only try to build the static dtb when we're building a static dtb. Use proper include path for dtc as well as cpp. Fix syntax errors (missing ; other minor glitches) in existing dts files. Added: stable/10/sys/boot/fdt/dts/arm/ - copied from r262614, head/sys/boot/fdt/dts/arm/ stable/10/sys/boot/fdt/dts/mips/ - copied from r262614, head/sys/boot/fdt/dts/mips/ stable/10/sys/boot/fdt/dts/powerpc/ - copied from r262614, head/sys/boot/fdt/dts/powerpc/ stable/10/sys/tools/fdt/make_dtb.sh (contents, props changed) - copied, changed from r262614, head/sys/tools/fdt/make_dtb.sh Deleted: stable/10/sys/boot/fdt/dts/am335x-evm.dts stable/10/sys/boot/fdt/dts/am335x.dtsi stable/10/sys/boot/fdt/dts/bcm2835.dtsi stable/10/sys/boot/fdt/dts/beaglebone-black.dts stable/10/sys/boot/fdt/dts/beaglebone.dts stable/10/sys/boot/fdt/dts/beri-netfpga.dts stable/10/sys/boot/fdt/dts/beri-sim.dts stable/10/sys/boot/fdt/dts/beripad-de4.dts stable/10/sys/boot/fdt/dts/cubieboard.dts stable/10/sys/boot/fdt/dts/cubieboard2.dts stable/10/sys/boot/fdt/dts/db78100.dts stable/10/sys/boot/fdt/dts/db78460.dts stable/10/sys/boot/fdt/dts/db88f5182.dts stable/10/sys/boot/fdt/dts/db88f5281.dts stable/10/sys/boot/fdt/dts/db88f6281.dts stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts stable/10/sys/boot/fdt/dts/dockstar.dts stable/10/sys/boot/fdt/dts/dreamplug-1001.dts stable/10/sys/boot/fdt/dts/dreamplug-1001N.dts stable/10/sys/boot/fdt/dts/ea3250.dts stable/10/sys/boot/fdt/dts/efikamx.dts stable/10/sys/boot/fdt/dts/exynos5250-arndale.dts stable/10/sys/boot/fdt/dts/exynos5250.dtsi stable/10/sys/boot/fdt/dts/imx51x.dtsi stable/10/sys/boot/fdt/dts/imx53-qsb.dts stable/10/sys/boot/fdt/dts/imx53x.dtsi stable/10/sys/boot/fdt/dts/imx6.dtsi stable/10/sys/boot/fdt/dts/mpc8555cds.dts stable/10/sys/boot/fdt/dts/mpc8572ds.dts stable/10/sys/boot/fdt/dts/p1020rdb.dts stable/10/sys/boot/fdt/dts/p2020ds.dts stable/10/sys/boot/fdt/dts/p2041rdb.dts stable/10/sys/boot/fdt/dts/p2041si.dtsi stable/10/sys/boot/fdt/dts/p3041ds.dts stable/10/sys/boot/fdt/dts/p3041si.dtsi stable/10/sys/boot/fdt/dts/p5020ds.dts stable/10/sys/boot/fdt/dts/p5020si.dtsi stable/10/sys/boot/fdt/dts/pandaboard.dts stable/10/sys/boot/fdt/dts/rk3188-radxa.dts stable/10/sys/boot/fdt/dts/rk3188.dtsi stable/10/sys/boot/fdt/dts/rpi.dts stable/10/sys/boot/fdt/dts/sheevaplug.dts stable/10/sys/boot/fdt/dts/tegra20-paz00.dts stable/10/sys/boot/fdt/dts/tegra20.dtsi stable/10/sys/boot/fdt/dts/trimslice.dts stable/10/sys/boot/fdt/dts/ts7800.dts stable/10/sys/boot/fdt/dts/versatilepb.dts stable/10/sys/boot/fdt/dts/vybrid-colibri-vf50.dts stable/10/sys/boot/fdt/dts/vybrid-cosmic.dts stable/10/sys/boot/fdt/dts/vybrid-quartz.dts stable/10/sys/boot/fdt/dts/vybrid.dtsi stable/10/sys/boot/fdt/dts/wandboard-dual.dts stable/10/sys/boot/fdt/dts/wandboard-quad.dts stable/10/sys/boot/fdt/dts/wandboard-solo.dts stable/10/sys/boot/fdt/dts/xlp-basic.dts stable/10/sys/boot/fdt/dts/zedboard.dts Modified: stable/10/Makefile.inc1 stable/10/share/mk/bsd.own.mk stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts stable/10/sys/boot/fdt/dts/arm/beaglebone.dts stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi stable/10/sys/boot/fdt/dts/arm/imx6.dtsi stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi stable/10/sys/boot/fdt/dts/arm/rpi.dts stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts stable/10/sys/boot/fdt/dts/mips/beri-sim.dts stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Fri May 16 15:56:07 2014 (r266250) +++ stable/10/Makefile.inc1 Fri May 16 15:56:34 2014 (r266251) @@ -1266,7 +1266,7 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge .endif -# Default to building the BSDL DTC, but build the GPL one if users explicitly +# Default to building the GPL DTC, but build the BSDL one if users explicitly # request it. _dtc= usr.bin/dtc .if ${MK_GPL_DTC} != "no" @@ -1849,7 +1849,7 @@ builddtb: echo "ERROR: FDT_DTS_FILE must be specified!"; \ exit 1; \ fi; \ - if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ]; then \ + if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE} ]; then \ echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ exist!"; \ exit 1; \ @@ -1859,9 +1859,9 @@ builddtb: directory"; \ fi @PATH=${TMPPATH} \ - dtc -O dtb -o \ - ${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 \ - -p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} + ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ + ${FDT_DTS_FILE} \ + ${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts` ############### Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Fri May 16 15:56:07 2014 (r266250) +++ stable/10/share/mk/bsd.own.mk Fri May 16 15:56:34 2014 (r266251) @@ -285,6 +285,7 @@ __DEFAULT_YES_OPTIONS = \ GNU \ GPIB \ GPIO \ + GPL_DTC \ GROFF \ HTML \ ICONV \ @@ -367,7 +368,6 @@ __DEFAULT_NO_OPTIONS = \ CLANG_EXTRAS \ CTF \ DEBUG_FILES \ - GPL_DTC \ HESIOD \ INSTALL_AS_USER \ LLDB \ Modified: stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone-black.dts Fri Feb 28 18:29:09 2014 (r262614) +++ stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts Fri May 16 15:56:34 2014 (r266251) @@ -150,7 +150,7 @@ compatible = "ti,am335x-pmic"; reg = <0x24>; }; - } + }; }; leds { Modified: stable/10/sys/boot/fdt/dts/arm/beaglebone.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone.dts Fri Feb 28 18:29:09 2014 (r262614) +++ stable/10/sys/boot/fdt/dts/arm/beaglebone.dts Fri May 16 15:56:34 2014 (r266251) @@ -135,7 +135,7 @@ compatible = "ti,am335x-pmic"; reg = <0x24>; }; - } + }; }; chosen { Modified: stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/imx53-qsb.dts Fri Feb 28 18:29:09 2014 (r262614) +++ stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts Fri May 16 15:56:34 2014 (r266251) @@ -105,7 +105,7 @@ ethernet@63fec000 { status = "okay"; phy-mode = "rmii"; - } + }; i2c@63fc4000 { status = "okay"; }; Modified: stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx53x.dtsi Fri Feb 28 18:29:09 2014 (r262614) +++ stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi Fri May 16 15:56:34 2014 (r266251) @@ -95,7 +95,7 @@ #address-cells = <1>; #size-cells = <1>; interrupt-parent = <&tzic>; - ranges = <0x50000000 0x14000000>; + ranges; aips@50000000 { /* AIPS1 */ compatible = "fsl,aips-bus", "simple-bus"; Modified: stable/10/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx6.dtsi Fri Feb 28 18:29:09 2014 (r262614) +++ stable/10/sys/boot/fdt/dts/arm/imx6.dtsi Fri May 16 15:56:34 2014 (r266251) @@ -99,7 +99,7 @@ reg = <0x020c8000 0x1000>; interrupt-parent = <&gic>; interrupts = <49>; - } + }; gpt: timer@02098000 { compatible = "fsl,imx6q-gpt", "fsl,imx51-gpt"; @@ -343,7 +343,7 @@ ocotp0: ocotp@021bc000 { compatible = "fsl,imx6q-ocotp"; reg = <0x021bc000 0x4000>; - } + }; }; }; }; Modified: stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/rk3188.dtsi Fri Feb 28 18:29:09 2014 (r262614) +++ stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi Fri May 16 15:56:34 2014 (r266251) @@ -77,7 +77,6 @@ timer@20038000 { compatible = "rockchip,rk30xx-timer"; - compatible = "rockchip,rk3188-dw-apb-timer-osc"; reg = <0x20038000 0x20>; interrupts = <76>; clock-frequency = <24000000>; Modified: stable/10/sys/boot/fdt/dts/arm/rpi.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/rpi.dts Fri Feb 28 18:29:09 2014 (r262614) +++ stable/10/sys/boot/fdt/dts/arm/rpi.dts Fri May 16 15:56:34 2014 (r266251) @@ -28,13 +28,13 @@ /include/ "bcm2835.dtsi" -/memreserve/ 0x08000000 0x08000000; /* Set by VideoCore */ - / { model = "Raspberry Pi (BCM2835)"; compatible = "raspberrypi,model-a", "raspberrypi,model-b", "broadcom,bcm2835-vc", "broadcom,bcm2708-vc"; + memreserve = <0x08000000 0x08000000>; /* Set by VideoCore */ + memory { device_type = "memory"; reg = <0 0x8000000>; /* 128MB, Set by VideoCore */ Modified: stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-netfpga.dts Fri Feb 28 18:29:09 2014 (r262614) +++ stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts Fri May 16 15:56:34 2014 (r266251) @@ -66,7 +66,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <0>; + reg = <0 1>; status = "okay"; }; @@ -75,7 +75,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <1>; + reg = <1 1>; // XXX: should we need cached prefix? cpu-release-addr = <0xffffffff 0x800fffe0>; }; Modified: stable/10/sys/boot/fdt/dts/mips/beri-sim.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-sim.dts Fri Feb 28 18:29:09 2014 (r262614) +++ stable/10/sys/boot/fdt/dts/mips/beri-sim.dts Fri May 16 15:56:34 2014 (r266251) @@ -64,7 +64,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <0>; + reg = <0 1>; status = "okay"; }; @@ -73,7 +73,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <1>; + reg = <1 1>; // XXX: should we need cached prefix? cpu-release-addr = <0xffffffff 0x800fffe0>; }; Modified: stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beripad-de4.dts Fri Feb 28 18:29:09 2014 (r262614) +++ stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts Fri May 16 15:56:34 2014 (r266251) @@ -64,7 +64,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <0>; + reg = <0 1>; status = "okay"; }; @@ -73,7 +73,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <1>; + reg = <1 1>; // XXX: should we need cached prefix? cpu-release-addr = <0xffffffff 0x800fffe0>; }; Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Fri May 16 15:56:07 2014 (r266250) +++ stable/10/sys/conf/files Fri May 16 15:56:34 2014 (r266251) @@ -54,12 +54,13 @@ aic79xx_reg_print.o optional ahd pci ah # The 'fdt_dtb_file' target covers an actual DTB file name, which is derived # from the specified source (DTS) file: .dts -> .dtb # -fdt_dtb_file optional fdt \ - compile-with "if [ -f $S/boot/fdt/dts/${FDT_DTS_FILE} ]; then dtc -O dtb -o ${FDT_DTS_FILE:R}.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}; fi" \ +fdt_dtb_file optional fdt fdt_dtb_static \ + compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}/${FDT_DTS_FILE:R}.dtb" \ no-obj no-implicit-rule before-depend \ clean "${FDT_DTS_FILE:R}.dtb" fdt_static_dtb.h optional fdt fdt_dtb_static \ - compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ." \ + compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}" \ + dependency "fdt_dtb_file" \ no-obj no-implicit-rule before-depend \ clean "fdt_static_dtb.h" feeder_eq_gen.h optional sound \ @@ -1406,7 +1407,7 @@ dev/fb/splash.c optional sc splash dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ - dependency "$S/boot/fdt/dts/${FDT_DTS_FILE}" + dependency "$S/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE}" dev/fdt/simplebus.c optional fdt dev/fe/if_fe.c optional fe dev/fe/if_fe_pccard.c optional fe pccard Copied and modified: stable/10/sys/tools/fdt/make_dtb.sh (from r262614, head/sys/tools/fdt/make_dtb.sh) ============================================================================== --- head/sys/tools/fdt/make_dtb.sh Fri Feb 28 18:29:09 2014 (r262614, copy source) +++ stable/10/sys/tools/fdt/make_dtb.sh Fri May 16 15:56:34 2014 (r266251) @@ -8,4 +8,4 @@ dts=$2 dtb=$3 cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $dts /dev/null | - dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts -i $S/gnu/dts/${MACHINE} + dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 16:03:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6728FA5F; Fri, 16 May 2014 16:03: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 52B852E91; Fri, 16 May 2014 16:03: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 s4GG3RCk026163; Fri, 16 May 2014 16:03:27 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GG3Rbk026162; Fri, 16 May 2014 16:03:27 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405161603.s4GG3Rbk026162@svn.freebsd.org> From: Christian Brueffer Date: Fri, 16 May 2014 16:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266253 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 16:03:27 -0000 Author: brueffer Date: Fri May 16 16:03:26 2014 New Revision: 266253 URL: http://svnweb.freebsd.org/changeset/base/266253 Log: MFC: r265583, r265716 First cleanup pass: new sentence -> new line, mdoc, typos and style. Fix two more typos. (1) Submitted by: Trond Endrestol (1) Modified: stable/10/share/man/man4/mrsas.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/mrsas.4 ============================================================================== --- stable/10/share/man/man4/mrsas.4 Fri May 16 15:57:20 2014 (r266252) +++ stable/10/share/man/man4/mrsas.4 Fri May 16 16:03:26 2014 (r266253) @@ -27,21 +27,19 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. - +.\" .\" The views and conclusions contained in the software and documentation .\" are those of the authors and should not be interpreted as representing -.\" official policies,either expressed or implied, of the FreeBSD Project +.\" official policies, either expressed or implied, of the FreeBSD Project. .\" .\" $FreeBSD$ .\" - - -.Dd Apr 12, 2013 +.Dd May 8, 2014 .Dt MRSAS 4 .Os .Sh NAME .Nm mrsas -.Nd "LSI MegaRAID 6Gb/s and 12Gb/s SAS+SATA Raid controller driver" +.Nd "LSI MegaRAID 6Gb/s and 12Gb/s SAS+SATA RAID controller driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -68,7 +66,8 @@ section for the supported devices list. A disk (virtual disk/physical disk) attached to the .Nm driver will be visible to the user through -.Xr camcontrol 8 as +.Xr camcontrol 8 +as .Pa /dev/da? device nodes. A simple management interface is also provided on a per-controller basis via the @@ -85,7 +84,8 @@ to the .Xr cam 4 layer and thus requires a new driver which attaches targets to the .Xr cam 4 -layer. Older MegaRAID controllers are supported by +layer. +Older MegaRAID controllers are supported by .Xr mfi 4 and will not work with .Nm , @@ -97,19 +97,23 @@ drivers can detect and manage the LSI Me controllers. .Pp The -.Nm device.hints +.Xr device.hints 5 option is provided to tune the .Nm driver's behavior for LSI MegaRAID SAS 2208/2308/3008/3108 controllers. By default, the .Xr mfi 4 -driver will detect these controllers. See the +driver will detect these controllers. +See the .Nm PRIORITY section to know more about driver priority for MR-Fusion devices. .Pp .Nm -will provide a priority of (-30) (between BUS_PROBE_DEFAULT and -BUS_PROBE_LOW_PRIORITY) at probe call for device id's 0x005B, 0x005D, and +will provide a priority of (-30) (between +.Dv BUS_PROBE_DEFAULT +and +.Dv BUS_PROBE_LOW_PRIORITY ) +at probe call for device id's 0x005B, 0x005D, and 0x005F so that .Nm does not take control of these devices without user intervention. @@ -118,8 +122,8 @@ The .Nm driver supports the following hardware: .Pp +[ Thunderbolt 6Gb/s MR controller ] .Bl -bullet -compact -[ Thunderbolt 6Gbp/s MR controller ] .It LSI MegaRAID SAS 9265 .It @@ -142,8 +146,8 @@ DELL PERC H810 DELL PERC H710/P .El .Pp +[ Invader/Fury 12Gb/s MR controller ] .Bl -bullet -compact -[ Invader/Fury 12Gpb/s MR controller ] .It LSI MegaRAID SAS 9380 .It @@ -169,7 +173,7 @@ dev.mrsas.X.disable_ocr=1 .Pp where X is the adapter number. .Pp -To change the IO timeout value for a specific +To change the I/O timeout value for a specific .Nm driver instance, set the following tunable value in .Xr loader.conf 5 : @@ -190,17 +194,14 @@ dev.mrsas.X.mrsas_fw_fault_check_delay=N where NN is the fault check delay value in seconds. .Pp The current number of active I/O commands is shown in the -dev.mrsas.X.fw_outstanding +.Va dev.mrsas.X.fw_outstanding .Xr sysctl 8 variable. .Sh DEBUGGING To enable debugging prints from the .Nm driver, set the -.Bd -literal -offset indent -hw.mrsas.X.debug_level -.Ed -.Pp +.Va hw.mrsas.X.debug_level variable, where X is the adapter number, either in .Xr loader.conf 5 or via @@ -214,16 +215,20 @@ Enable tracing prints. .It 0x04 Enable prints for driver faults. .It 0x08 -Enable prints for OCR and IO timeout. +Enable prints for OCR and I/O timeout. .It 0x10 Enable prints for AEN events. .El .Sh PRIORITY The .Nm -driver will always set a default (-30) priority in the pci subsystem for -selection of MR-Fusion cards. (It is between BUS_PROBE_DEFAULT and -BUS_PROBE_LOW_PRIORITY). MR-Fusion Controllers include all cards with the +driver will always set a default (-30) priority in the PCI subsystem for +selection of MR-Fusion cards. +(It is between +.Dv BUS_PROBE_DEFAULT +and +.Dv BUS_PROBE_LOW_PRIORITY ) . +MR-Fusion Controllers include all cards with the Device IDs - 0x005B, 0x005D, @@ -231,14 +236,20 @@ Device IDs - .Pp The .Xr mfi 4 -driver will set a priority of either BUS_PROBE_DEFAULT or -BUS_PROBE_LOW_PRIORITY (depending on the device.hint setting) in the pci -subsystem for selection of MR-Fusion cards. With the above design in place, the +driver will set a priority of either +.Dv BUS_PROBE_DEFAULT +or +.Dv BUS_PROBE_LOW_PRIORITY +(depending on the device.hints setting) in the PCI +subsystem for selection of MR-Fusion cards. +With the above design in place, the .Xr mfi 4 driver will attach to a MR-Fusion card given that it has a higher priority than .Nm . .Pp -Using /boot/device.hints (as mentioned below), the user can provide a preference +Using +.Pa /boot/device.hints +(as mentioned below), the user can provide a preference for the .Nm driver to detect a MR-Fusion card instead of the @@ -250,9 +261,11 @@ driver. .Pp At boot time, the .Xr mfi 4 -driver will get priority to detect MR-Fusion controllers by default. Before +driver will get priority to detect MR-Fusion controllers by default. +Before changing this default driver selection policy, LSI advises users to understand -how the driver selection policy works. LSI's policy is to provide priority to +how the driver selection policy works. +LSI's policy is to provide priority to the .Xr mfi 4 driver to detect MR-Fusion cards, but allow for the ability to choose the @@ -272,11 +285,14 @@ driver and setting hw.mfi.mrsas_enable=" Changing the default behavior is well tested under most conditions, but unexpected behavior may pop up if more complex and unrealistic operations are executed by switching between the -.Xr mfi 4 and +.Xr mfi 4 +and .Nm drivers for MR-Fusion. -Switching drivers is designed to happen only one time. Although multiple -switching is possible, it is not recommended. The user should decide from +Switching drivers is designed to happen only one time. +Although multiple +switching is possible, it is not recommended. +The user should decide from .Nm Start of Day which driver they want to use for the MR-Fusion card. .Pp @@ -286,7 +302,8 @@ to .Nm . This behavior is .Nm Functions As Designed -and the user needs to change the fstab +and the user needs to change the +.Xr fstab 5 entry manually if they are doing any experiments with .Xr mfi 4 and @@ -294,43 +311,50 @@ and interoperability. .Sh FILES .Bl -tag -width ".Pa /dev/mrsas?" -compact -.It /dev/da? +.It Pa /dev/da? array/logical disk interface -.It /dev/mrsas? +.It Pa /dev/mrsas? management interface .El .Sh SEE ALSO -.Xr pci 4 , -.Xr mfi 4 , .Xr cam 4 , +.Xr mfi 4 , +.Xr pci 4 , .Xr device.hints 5 , +.Xt camcontrol 8 .Sh HISTORY The .Nm driver first appeared in -.Fx 10.0 . +.Fx 10.1 . .Bd -ragged .Cd "mfi Driver:" .Xr mfi 4 -is the old FreeBSD driver which started with support for Gen-1 Controllers and +is the old +.Fx +driver which started with support for Gen-1 Controllers and was extended to support up to MR-Fusion (Device ID = 0x005B, 0x005D, 0x005F). .Ed .Bd -ragged .Cd "mrsas Driver:" .Nm is the new driver reworked by LSI which supports Thunderbolt and onward -products. The SAS+SATA RAID controller with device id 0x005b is referred to as -the Thunderbolt controller throughout in this man page. +products. +The SAS+SATA RAID controller with device id 0x005b is referred to as +the Thunderbolt controller throughout this man page. .Ed .Bd -ragged .Nm cam aware HBA drivers: -FreeBSD has a +.Fx +has a .Xr cam 4 layer which attaches storage devices and provides a common access mechanism to -storage controllers and attached devices. The +storage controllers and attached devices. +The .Nm driver is -.Xr cam 4 aware and devices associated with +.Xr cam 4 +aware and devices associated with .Nm can be seen using .Xr camcontrol 8 . @@ -358,17 +382,22 @@ driver and this manual page were written The driver does not support big-endian architectures at this time. .Pp The driver does not support alias for device name (it is required when the user -switches between two drivers and does not want to edit /etc/fstab manually). +switches between two drivers and does not want to edit +.Pa /etc/fstab +manually). .Pp The .Nm -driver exposes devices as /dev/da?, whereas +driver exposes devices as +.Pa /dev/da? , +whereas .Xr mfi 4 -exposes deivces as /dev/mfid? +exposes devices as +.Pa /dev/mfid? . .Pp .Nm does not support the Linux Emulator interface. .Pp .Nm will not work with -.Xr mfiutil 8 +.Xr mfiutil 8 . From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 16:06:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A5261D50; Fri, 16 May 2014 16:06: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 91BD72EC6; Fri, 16 May 2014 16:06:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GG6V1Z026812; Fri, 16 May 2014 16:06:31 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GG6VRp026811; Fri, 16 May 2014 16:06:31 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405161606.s4GG6VRp026811@svn.freebsd.org> From: Christian Brueffer Date: Fri, 16 May 2014 16:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266255 - stable/10/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 16:06:31 -0000 Author: brueffer Date: Fri May 16 16:06:31 2014 New Revision: 266255 URL: http://svnweb.freebsd.org/changeset/base/266255 Log: MFC: r265585 Generate hardware notes for mrsas(4). Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Fri May 16 16:04:32 2014 (r266254) +++ stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Fri May 16 16:06:31 2014 (r266255) @@ -739,6 +739,8 @@ &hwlist.mpt; + &hwlist.mrsas; + &hwlist.mvs; &hwlist.ncr; From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 16:11:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9F3DC10B; Fri, 16 May 2014 16:11: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 8C4542F75; Fri, 16 May 2014 16:11: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 s4GGBE0H031661; Fri, 16 May 2014 16:11:14 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GGBEwN031660; Fri, 16 May 2014 16:11:14 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405161611.s4GGBEwN031660@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 16 May 2014 16:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266257 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 16:11:14 -0000 Author: hselasky Date: Fri May 16 16:11:14 2014 New Revision: 266257 URL: http://svnweb.freebsd.org/changeset/base/266257 Log: MFC r265779: Fix for NULL pointer. Modified: stable/10/sys/dev/usb/usb_pf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_pf.c ============================================================================== --- stable/10/sys/dev/usb/usb_pf.c Fri May 16 16:07:21 2014 (r266256) +++ stable/10/sys/dev/usb/usb_pf.c Fri May 16 16:11:14 2014 (r266257) @@ -394,7 +394,7 @@ usbpf_xfertap(struct usb_xfer *xfer, int bus = xfer->xroot->bus; /* sanity checks */ - if (bus->ifp == NULL) + if (bus->ifp == NULL || bus->ifp->if_bpf == NULL) return; if (!bpf_peers_present(bus->ifp->if_bpf)) return; From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 21:56:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B0CCEF0; Fri, 16 May 2014 21:56: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 9B4B32D45; Fri, 16 May 2014 21:56: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 s4GLuZ5f041470; Fri, 16 May 2014 21:56:35 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GLuXC5041458; Fri, 16 May 2014 21:56:33 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201405162156.s4GLuXC5041458@svn.freebsd.org> From: Sean Bruno Date: Fri, 16 May 2014 21:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266272 - in stable/10: sys/conf sys/kern sys/modules sys/modules/imgact_binmisc sys/sys usr.sbin usr.sbin/binmiscctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 21:56:35 -0000 Author: sbruno Date: Fri May 16 21:56:33 2014 New Revision: 266272 URL: http://svnweb.freebsd.org/changeset/base/266272 Log: MFC r264269, r264282, r264280, r264291, r264276, r264314 Merge sson's binmiscctl and image activator features to stable/10 Submitted by: sson@freebsd.org Added: stable/10/sys/kern/imgact_binmisc.c - copied, changed from r264269, head/sys/kern/imgact_binmisc.c stable/10/sys/modules/imgact_binmisc/ - copied from r264269, head/sys/modules/imgact_binmisc/ stable/10/sys/sys/imgact_binmisc.h - copied, changed from r264269, head/sys/sys/imgact_binmisc.h stable/10/usr.sbin/binmiscctl/ - copied from r264269, head/usr.sbin/binmiscctl/ Modified: stable/10/sys/conf/NOTES stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/conf/options.amd64 stable/10/sys/conf/options.i386 stable/10/sys/modules/Makefile stable/10/usr.sbin/Makefile stable/10/usr.sbin/binmiscctl/binmiscctl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Fri May 16 21:20:13 2014 (r266271) +++ stable/10/sys/conf/NOTES Fri May 16 21:56:33 2014 (r266272) @@ -2973,3 +2973,6 @@ options RANDOM_YARROW # Yarrow RNG ##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented options RANDOM_DEBUG # Debugging messages options RANDOM_RWFILE # Read and write entropy cache + +# Module to enable execution of application via emulators like QEMU +options IMAGACT_BINMISC Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Fri May 16 21:20:13 2014 (r266271) +++ stable/10/sys/conf/files.amd64 Fri May 16 21:56:33 2014 (r266272) @@ -450,6 +450,7 @@ dev/virtio/balloon/virtio_balloon.c opti dev/virtio/scsi/virtio_scsi.c optional virtio_scsi isa/syscons_isa.c optional sc isa/vga_isa.c optional vga +kern/imgact_binmisc.c optional imagact_binmisc kern/kern_clocksource.c standard kern/link_elf_obj.c standard # Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Fri May 16 21:20:13 2014 (r266271) +++ stable/10/sys/conf/files.i386 Fri May 16 21:56:33 2014 (r266272) @@ -533,6 +533,7 @@ isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/kern_clocksource.c standard kern/imgact_aout.c optional compat_aout +kern/imgact_binmisc.c optional imagact_binmisc kern/imgact_gzip.c optional gzip libkern/divdi3.c standard libkern/ffsl.c standard Modified: stable/10/sys/conf/options.amd64 ============================================================================== --- stable/10/sys/conf/options.amd64 Fri May 16 21:20:13 2014 (r266271) +++ stable/10/sys/conf/options.amd64 Fri May 16 21:56:33 2014 (r266272) @@ -21,6 +21,7 @@ COMPAT_FREEBSD32 opt_compat.h COMPAT_LINUX32 opt_compat.h #COMPAT_SVR4 opt_dontuse.h #DEBUG_SVR4 opt_svr4.h +IMAGACT_BINMISC opt_dontuse.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h NDISAPI opt_dontuse.h Modified: stable/10/sys/conf/options.i386 ============================================================================== --- stable/10/sys/conf/options.i386 Fri May 16 21:20:13 2014 (r266271) +++ stable/10/sys/conf/options.i386 Fri May 16 21:56:33 2014 (r266272) @@ -26,6 +26,7 @@ IBCS2 opt_dontuse.h COMPAT_LINUX opt_dontuse.h COMPAT_SVR4 opt_dontuse.h DEBUG_SVR4 opt_svr4.h +IMAGACT_BINMISC opt_binmisc.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h NDISAPI opt_dontuse.h Copied and modified: stable/10/sys/kern/imgact_binmisc.c (from r264269, head/sys/kern/imgact_binmisc.c) ============================================================================== --- head/sys/kern/imgact_binmisc.c Tue Apr 8 20:10:22 2014 (r264269, copy source) +++ stable/10/sys/kern/imgact_binmisc.c Fri May 16 21:56:33 2014 (r266272) @@ -182,7 +182,7 @@ imgact_binmisc_destroy_entry(imgact_binm { if (!ibe) return; - if (ibe->ibe_mask) + if (ibe->ibe_magic) free(ibe->ibe_magic, M_BINMISC); if (ibe->ibe_mask) free(ibe->ibe_mask, M_BINMISC); Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Fri May 16 21:20:13 2014 (r266271) +++ stable/10/sys/modules/Makefile Fri May 16 21:56:33 2014 (r266272) @@ -151,6 +151,7 @@ SUBDIR= \ if_vlan \ ${_igb} \ ${_iir} \ + ${_imgact_binmisc} \ ${_io} \ ${_ipoib} \ ${_ipdivert} \ @@ -377,6 +378,7 @@ SUBDIR= \ .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _filemon= filemon +_imgact_binmisc= imgact_binmisc _vmware= vmware .endif Copied and modified: stable/10/sys/sys/imgact_binmisc.h (from r264269, head/sys/sys/imgact_binmisc.h) ============================================================================== --- head/sys/sys/imgact_binmisc.h Tue Apr 8 20:10:22 2014 (r264269, copy source) +++ stable/10/sys/sys/imgact_binmisc.h Fri May 16 21:56:33 2014 (r266272) @@ -40,7 +40,7 @@ #define IBE_VERSION 1 /* struct ximgact_binmisc_entry version. */ #define IBE_NAME_MAX 32 /* Max size for entry name. */ #define IBE_MAGIC_MAX 256 /* Max size for header magic and mask. */ -#define IBE_ARG_LEN_MAX 256 /* Max space for optional interpreter command- +#define IBE_ARG_LEN_MAX 256 /* Max space for optional interpreter command- line argruments seperated by white space */ #define IBE_INTERP_LEN_MAX (MAXPATHLEN + IBE_ARG_LEN_MAX) #define IBE_MAX_ENTRIES 64 /* Max number of interpreter entries. */ @@ -70,7 +70,7 @@ typedef struct ximgact_binmisc_entry { /* * sysctl() command names. */ -#define IBE_SYSCTL_NAME "kern.binmisc" +#define IBE_SYSCTL_NAME "kern.binmisc" #define IBE_SYSCTL_NAME_ADD IBE_SYSCTL_NAME ".add" #define IBE_SYSCTL_NAME_REMOVE IBE_SYSCTL_NAME ".remove" @@ -82,7 +82,7 @@ typedef struct ximgact_binmisc_entry { #define KMOD_NAME "imgact_binmisc" /* - * Examples of manipulating he interpreter table using sysctlbyname(3): + * Examples of manipulating the interpreter table using sysctlbyname(3): * * #include * @@ -127,7 +127,7 @@ typedef struct ximgact_binmisc_entry { * xbe.xbe_version = IBE_VERSION; * strlcpy(xbe.xbe_name, "llvm_bc", IBE_NAME_MAX); * error = sysctlbyname(IBE_SYSCTL_NAME_DISABLE, NULL, NULL, &xbe, sizeof(xbe)); - * // OR sysctlbyname(IBE_SYSCTL_NAME_ENABLE", NULL, NULL, &xbe, sizeof(xbe)); + * // OR sysctlbyname(IBE_SYSCTL_NAME_ENABLE, NULL, NULL, &xbe, sizeof(xbe)); * // OR sysctlbyname(IBE_SYSCTL_NAME_REMOVE, NULL, NULL, &xbe, sizeof(xbe)); * * // Lookup image activator "llvm_bc" Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Fri May 16 21:20:13 2014 (r266271) +++ stable/10/usr.sbin/Makefile Fri May 16 21:56:33 2014 (r266272) @@ -5,6 +5,7 @@ SUBDIR= adduser \ arp \ + binmiscctl \ bootparamd \ bsdconfig \ bsdinstall \ Modified: stable/10/usr.sbin/binmiscctl/binmiscctl.8 ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.8 Tue Apr 8 20:10:22 2014 (r264269) +++ stable/10/usr.sbin/binmiscctl/binmiscctl.8 Fri May 16 21:56:33 2014 (r266272) @@ -27,8 +27,8 @@ .\" .\" Support for miscellaneous binary image activators .\" -.Dd May 14, 2013 -.Dt 8 +.Dd April 10, 2014 +.Dt BINMISCCTL 8 .Os .Sh NAME .Nm binmiscctl @@ -37,15 +37,15 @@ .Nm .Cm add .Ar name -.Cm --interpreter +.Cm --interpreter .Ar path -.Cm --magic +.Cm --magic .Ar magic .Cm --size .Ar size -.Op --mask Ar mask -.Op --offset Ar offset -.Op --set-enabled +.Op Cm --mask Ar mask +.Op Cm --offset Ar offset +.Op Cm --set-enabled .Nm .Cm remove .Ar name @@ -65,9 +65,11 @@ The .Nm utility is the management utility for configuring miscellaneous binaries image -activators in the kernel. It allows the adding, deleting, disabling, -enabling, and looking up interpreters. Also, all the interpreters can -be listed as well. +activators in the kernel. +It allows adding, deleting, disabling, +enabling, and looking up interpreters. +Also, all the interpreters can +be listed. .Pp The first argument on the command line indicates the operation to be performed. @@ -76,24 +78,25 @@ Operation must be one of the following: .It Xo .Cm add .Ar name -.Cm --interpreter +.Cm --interpreter .Ar path .Cm --magic .Ar magic .Cm --size .Ar size -.Op --mask Ar mask -.Op --offset Ar offset -.Op --set-enabled +.Op Cm --mask Ar mask +.Op Cm --offset Ar offset +.Op Cm --set-enabled .Xc -Add a new activator entry in the kernel. You must specify an +Add a new activator entry in the kernel. +You must specify a unique .Ar name, -interpreter path and its arguments +interpreter path and its arguments .Ar path, header .Ar magic -bytes that uniquely identifies a suitable binary for the activator, +bytes that uniquely identify a suitable binary for the activator, and the .Ar size of the @@ -103,27 +106,30 @@ in bytes. Optionally you may specify a .Ar mask to do a bitwise AND with the header bytes. - This effectively allows you to ignore fields in the binary header that -do not uniquely indentfy binary file's type. +do not uniquely indentify the binary file's type. .Pp An .Ar offset may be specified for the magic bytes using the -.Ar --offset -argument. By default the +.Cm --offset +option. +By default the .Ar offset is zero. .Pp -To set the activator entry enabled the -.Ar --set-enabled -option is used. The activator default state is disabled. +To enable the activator entry the +.Cm --set-enabled +option is used. +The activator default state is disabled. .Pp The interpreter .Ar path -may also arguments for the interpreter including +may also contain arguments for the interpreter including .Ar #a -which gets replaced by the old argv0 value in the interpreter string. +which gets replaced by the old +.Dv argv0 +value in the interpreter string. .It Cm remove Ar name Remove the activator entry identified with .Ar name . @@ -134,53 +140,57 @@ Disable the activator entry identified w Enable the activator entry identified with .Ar name . .It Cm lookup Ar name -Lookup and print out the activator entry identified with +Look up and print out the activator entry identified with .Ar name . .It Cm list Take a snapshot and print all the activator entries currently configured. .El .Sh EXAMPLES -.Dl binmiscctl add llvmbc --interpreter ''/usr/bin/lli --fake-argv0=#a'' ---magic ''BC\\xc0\\xde'' ---size 4 --set-enabled +.Bl +# binmiscctl add llvmbc --interpreter ''/usr/bin/lli --fake-argv0=#a'' \\ + --magic ''BC\\xc0\\xde'' --size 4 --set-enabled +.El .Pp -Add an image activator to run the the llvm interpreter (lli) on bitcode +Add an image activator to run the LLVM interpreter (lli) on bitcode compiled files. .Ar #a -gets replaced with the old argv0 value so that 'lli' can fake its argv0. +gets replaced with the old +.Dv argv0 +value so that 'lli' can fake its +.Dv argv0 . Set its state to enabled. .Pp -.Dl binmiscctl disable llvmbc +.Dl # binmiscctl disable llvmbc .Pp Set the state of the .Ar llvmbc image activator to disabled. .Pp -.Dl binmiscctl enable llvmbc +.Dl # binmiscctl enable llvmbc .Pp Set the state of the .Ar llvmbc image activator to enabled. .Pp -.Dl binmiscctl remove llvmbc +.Dl # binmiscctl remove llvmbc .Pp Delete the .Ar llvmbc image activator. .Pp -.Dl binmiscctl lookup llvmbc +.Dl # binmiscctl lookup llvmbc .Pp -Lookup and list the record for the +Look up and list the record for the .Ar llvmbc image activator. .Sh SEE ALSO +.Xr lli 1 , .Xr execve 2 -.Xr lli 1 .Sh HISTORY The .Cm binmiscctl command was added in -.Fx 10.0 . +.Fx 10.1 . It was developed to support the imgact_binmisc kernel module. .Sh AUTHORS Stacey D Son From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 22:55:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 100D1CFC; Fri, 16 May 2014 22:55: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 F0EC621C0; Fri, 16 May 2014 22:55: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 s4GMt1JV077647; Fri, 16 May 2014 22:55:01 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GMt1GR077643; Fri, 16 May 2014 22:55:01 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405162255.s4GMt1GR077643@svn.freebsd.org> From: Ian Lepore Date: Fri, 16 May 2014 22:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266273 - in stable/10/sys: amd64/conf conf i386/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 22:55:02 -0000 Author: ian Date: Fri May 16 22:55:01 2014 New Revision: 266273 URL: http://svnweb.freebsd.org/changeset/base/266273 Log: MFC 264304: Really only allow IMGACT_BINMISC for amd64/i386 builds. Modified: stable/10/sys/amd64/conf/NOTES stable/10/sys/conf/NOTES stable/10/sys/i386/conf/NOTES Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/conf/NOTES ============================================================================== --- stable/10/sys/amd64/conf/NOTES Fri May 16 21:56:33 2014 (r266272) +++ stable/10/sys/amd64/conf/NOTES Fri May 16 22:55:01 2014 (r266273) @@ -650,3 +650,6 @@ device ndis # Linux-specific pseudo devices support device lindev + +# Module to enable execution of application via emulators like QEMU +options IMAGACT_BINMISC Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Fri May 16 21:56:33 2014 (r266272) +++ stable/10/sys/conf/NOTES Fri May 16 22:55:01 2014 (r266273) @@ -2973,6 +2973,3 @@ options RANDOM_YARROW # Yarrow RNG ##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented options RANDOM_DEBUG # Debugging messages options RANDOM_RWFILE # Read and write entropy cache - -# Module to enable execution of application via emulators like QEMU -options IMAGACT_BINMISC Modified: stable/10/sys/i386/conf/NOTES ============================================================================== --- stable/10/sys/i386/conf/NOTES Fri May 16 21:56:33 2014 (r266272) +++ stable/10/sys/i386/conf/NOTES Fri May 16 22:55:01 2014 (r266273) @@ -1060,3 +1060,6 @@ options VM_KMEM_SIZE_SCALE # asr old ioctls support, needed by raidutils options ASR_COMPAT + +# Module to enable execution of application via emulators like QEMU +options IMAGACT_BINMISC From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 23:27:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CF42E270; Fri, 16 May 2014 23:27: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 B80172417; Fri, 16 May 2014 23:27: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 s4GNRKKt096245; Fri, 16 May 2014 23:27:20 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GNRIsh096230; Fri, 16 May 2014 23:27:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405162327.s4GNRIsh096230@svn.freebsd.org> From: Ian Lepore Date: Fri, 16 May 2014 23:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266274 - in stable/10: sbin/newfs_nandfs sys/arm/allwinner sys/arm/allwinner/a20 sys/arm/arm sys/arm/conf sys/arm/freescale/imx sys/arm/freescale/vybrid sys/arm/ti/omap4 sys/boot/fdt/d... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 23:27:20 -0000 Author: ian Date: Fri May 16 23:27:18 2014 New Revision: 266274 URL: http://svnweb.freebsd.org/changeset/base/266274 Log: MFC 262695, 262708, 262709, 262710, 262711, 262728, 262870, 262877, 262880, 262885, 262891, 262903, imx6: Add a tunable to set the number of active cores, enable SMP by default. ffec: Fix multicast filtering. Allwinner a10/a20... - Add gpio and clock bits for A10/A20's EMAC ethernet controller driver - EMAC gpio configuration - EMAC clock activation - Add Static Random Access Memory controller driver for A10/A20. A10/A20's SRAM is used by devices, such as CPU, EMAC, for extra fast memory or as cache. - Add EMAC 10/100 Ethernet controller driver for A10/A20. It is available mostly in A10 devices like Hackberry, Marsboard, Mele A1000, A2000, A100 HTPC, cubieboard1 and A20 device like cubieboard2. TX performance can be improved using both channels 0 and 1. RX performance is poor and needs improvement with the assistance of external DMA controller in case there - Add EMAC and SRAM controller entries to FDT. - Add EMAC device to kernel config files and enable EMAC, SRAM drivers. OMAP: When calculating the MPU freq, make sure not to overflow. Vybrid: - Add driver for Port control and interrupts (PORT). - Export panel info to DTS - Reset all the layers before setup first one - Enable display nandfs: Slight code reordering to make error branch last. Add option TMPFS to arm/conf/DEFAULTS, remove it from the few configs that have it individually. Concensus on freebsd-arm@ is that it should be included in all ARM kernels. Fix the arm sys_sigreturn(): its argument is a struct ucontext, not a struct sigframe containing the struct ucontext. Added: stable/10/sys/arm/allwinner/a10_gpio.h - copied unchanged from r262708, head/sys/arm/allwinner/a10_gpio.h stable/10/sys/arm/allwinner/a10_sramc.c - copied unchanged from r262709, head/sys/arm/allwinner/a10_sramc.c stable/10/sys/arm/allwinner/a10_sramc.h - copied unchanged from r262709, head/sys/arm/allwinner/a10_sramc.h stable/10/sys/arm/allwinner/if_emac.c - copied unchanged from r262710, head/sys/arm/allwinner/if_emac.c stable/10/sys/arm/allwinner/if_emacreg.h - copied unchanged from r262710, head/sys/arm/allwinner/if_emacreg.h stable/10/sys/arm/freescale/vybrid/vf_port.c - copied unchanged from r262885, head/sys/arm/freescale/vybrid/vf_port.c stable/10/sys/arm/freescale/vybrid/vf_port.h - copied unchanged from r262885, head/sys/arm/freescale/vybrid/vf_port.h Modified: stable/10/sbin/newfs_nandfs/newfs_nandfs.c stable/10/sys/arm/allwinner/a10_clk.c stable/10/sys/arm/allwinner/a10_clk.h stable/10/sys/arm/allwinner/a10_gpio.c stable/10/sys/arm/allwinner/a20/files.a20 stable/10/sys/arm/allwinner/files.a10 stable/10/sys/arm/arm/genassym.c stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/conf/ARNDALE stable/10/sys/arm/conf/BEAGLEBONE stable/10/sys/arm/conf/CUBIEBOARD stable/10/sys/arm/conf/CUBIEBOARD2 stable/10/sys/arm/conf/DEFAULTS stable/10/sys/arm/conf/DIGI-CCWMX53 stable/10/sys/arm/conf/DOCKSTAR stable/10/sys/arm/conf/DREAMPLUG-1001 stable/10/sys/arm/conf/EFIKA_MX stable/10/sys/arm/conf/IMX53-QSB stable/10/sys/arm/conf/IMX6 stable/10/sys/arm/conf/VYBRID.common stable/10/sys/arm/conf/WANDBOARD.common stable/10/sys/arm/freescale/imx/imx6_mp.c stable/10/sys/arm/freescale/vybrid/files.vybrid stable/10/sys/arm/freescale/vybrid/vf_dcu4.c stable/10/sys/arm/freescale/vybrid/vf_gpio.c stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c stable/10/sys/boot/fdt/dts/arm/cubieboard.dts stable/10/sys/boot/fdt/dts/arm/cubieboard2.dts stable/10/sys/boot/fdt/dts/arm/vybrid-quartz.dts stable/10/sys/boot/fdt/dts/arm/vybrid.dtsi stable/10/sys/dev/ffec/if_ffec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/newfs_nandfs/newfs_nandfs.c ============================================================================== --- stable/10/sbin/newfs_nandfs/newfs_nandfs.c Fri May 16 22:55:01 2014 (r266273) +++ stable/10/sbin/newfs_nandfs/newfs_nandfs.c Fri May 16 23:27:18 2014 (r266274) @@ -988,10 +988,10 @@ calculate_geometry(int fd) /* Get storage erase unit size */ if (!is_nand) erasesize = NANDFS_DEF_ERASESIZE; - else if (ioctl(fd, NAND_IO_GET_CHIP_PARAM, &chip_params) == -1) - errx(1, "Cannot ioctl(NAND_IO_GET_CHIP_PARAM)"); - else + else if (ioctl(fd, NAND_IO_GET_CHIP_PARAM, &chip_params) != -1) erasesize = chip_params.page_size * chip_params.pages_per_block; + else + errx(1, "Cannot ioctl(NAND_IO_GET_CHIP_PARAM)"); debug("erasesize: %#jx", (uintmax_t)erasesize); Modified: stable/10/sys/arm/allwinner/a10_clk.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_clk.c Fri May 16 22:55:01 2014 (r266273) +++ stable/10/sys/arm/allwinner/a10_clk.c Fri May 16 23:27:18 2014 (r266274) @@ -127,7 +127,7 @@ a10_clk_usb_activate(void) uint32_t reg_value; if (sc == NULL) - return ENXIO; + return (ENXIO); /* Gating AHB clock for USB */ reg_value = ccm_read_4(sc, CCM_AHB_GATING0); @@ -154,7 +154,7 @@ a10_clk_usb_deactivate(void) uint32_t reg_value; if (sc == NULL) - return ENXIO; + return (ENXIO); /* Disable clock for USB */ reg_value = ccm_read_4(sc, CCM_USB_CLK); @@ -173,3 +173,19 @@ a10_clk_usb_deactivate(void) return (0); } +int +a10_clk_emac_activate(void) { + struct a10_ccm_softc *sc = a10_ccm_sc; + uint32_t reg_value; + + if (sc == NULL) + return (ENXIO); + + /* Gating AHB clock for EMAC */ + reg_value = ccm_read_4(sc, CCM_AHB_GATING0); + reg_value |= CCM_AHB_GATING_EMAC; + ccm_write_4(sc, CCM_AHB_GATING0, reg_value); + + return (0); +} + Modified: stable/10/sys/arm/allwinner/a10_clk.h ============================================================================== --- stable/10/sys/arm/allwinner/a10_clk.h Fri May 16 22:55:01 2014 (r266273) +++ stable/10/sys/arm/allwinner/a10_clk.h Fri May 16 23:27:18 2014 (r266274) @@ -103,6 +103,7 @@ #define CCM_AHB_GATING_USB0 (1 << 0) #define CCM_AHB_GATING_EHCI0 (1 << 1) #define CCM_AHB_GATING_EHCI1 (1 << 3) +#define CCM_AHB_GATING_EMAC (1 << 17) #define CCM_USB_PHY (1 << 8) #define CCM_USB0_RESET (1 << 0) @@ -111,5 +112,6 @@ int a10_clk_usb_activate(void); int a10_clk_usb_deactivate(void); +int a10_clk_emac_activate(void); #endif /* _A10_CLK_H_ */ Modified: stable/10/sys/arm/allwinner/a10_gpio.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_gpio.c Fri May 16 22:55:01 2014 (r266273) +++ stable/10/sys/arm/allwinner/a10_gpio.c Fri May 16 23:27:18 2014 (r266274) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include "gpio_if.h" +#include "a10_gpio.h" /* * A10 have 9 banks of gpio. @@ -102,6 +103,8 @@ struct a10_gpio_softc { #define A10_GPIO_GP_INT_STA 0x214 #define A10_GPIO_GP_INT_DEB 0x218 +static struct a10_gpio_softc *a10_gpio_sc; + #define A10_GPIO_WRITE(_sc, _off, _val) \ bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) #define A10_GPIO_READ(_sc, _off) \ @@ -473,6 +476,9 @@ a10_gpio_attach(device_t dev) device_add_child(dev, "gpioc", device_get_unit(dev)); device_add_child(dev, "gpiobus", device_get_unit(dev)); + + a10_gpio_sc = sc; + return (bus_generic_attach(dev)); fail: @@ -518,3 +524,19 @@ static driver_t a10_gpio_driver = { }; DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0); + +int +a10_emac_gpio_config(uint32_t pin) +{ + struct a10_gpio_softc *sc = a10_gpio_sc; + + if (sc == NULL) + return (ENXIO); + + /* Configure pin mux settings for MII. */ + A10_GPIO_LOCK(sc); + a10_gpio_set_function(sc, pin, A10_GPIO_PULLDOWN); + A10_GPIO_UNLOCK(sc); + + return (0); +} Copied: stable/10/sys/arm/allwinner/a10_gpio.h (from r262708, head/sys/arm/allwinner/a10_gpio.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/allwinner/a10_gpio.h Fri May 16 23:27:18 2014 (r266274, copy of r262708, head/sys/arm/allwinner/a10_gpio.h) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _A10_GPIO_H_ +#define _A10_GPIO_H_ + +int a10_emac_gpio_config(uint32_t pin); + +#endif Copied: stable/10/sys/arm/allwinner/a10_sramc.c (from r262709, head/sys/arm/allwinner/a10_sramc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/allwinner/a10_sramc.c Fri May 16 23:27:18 2014 (r266274, copy of r262709, head/sys/arm/allwinner/a10_sramc.c) @@ -0,0 +1,134 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * 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$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "a10_sramc.h" + +#define SRAM_CTL1_CFG 0x04 + +struct a10_sramc_softc { + struct resource *res; + bus_space_tag_t bst; + bus_space_handle_t bsh; +}; + +static struct a10_sramc_softc *a10_sramc_sc; + +#define sramc_read_4(sc, reg) \ + bus_space_read_4((sc)->bst, (sc)->bsh, (reg)) +#define sramc_write_4(sc, reg, val) \ + bus_space_write_4((sc)->bst, (sc)->bsh, (reg), (val)) + + +static int +a10_sramc_probe(device_t dev) +{ + + if (ofw_bus_is_compatible(dev, "allwinner,sun4i-sramc")) { + device_set_desc(dev, "Allwinner sramc module"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +a10_sramc_attach(device_t dev) +{ + struct a10_sramc_softc *sc = device_get_softc(dev); + int rid = 0; + + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!sc->res) { + device_printf(dev, "could not allocate resource\n"); + return (ENXIO); + } + + sc->bst = rman_get_bustag(sc->res); + sc->bsh = rman_get_bushandle(sc->res); + + a10_sramc_sc = sc; + + return (0); +} + +static device_method_t a10_sramc_methods[] = { + DEVMETHOD(device_probe, a10_sramc_probe), + DEVMETHOD(device_attach, a10_sramc_attach), + { 0, 0 } +}; + +static driver_t a10_sramc_driver = { + "a10_sramc", + a10_sramc_methods, + sizeof(struct a10_sramc_softc), +}; + +static devclass_t a10_sramc_devclass; + +DRIVER_MODULE(a10_sramc, simplebus, a10_sramc_driver, a10_sramc_devclass, 0, 0); + +int +a10_map_to_emac(void) +{ + struct a10_sramc_softc *sc = a10_sramc_sc; + uint32_t reg_value; + + if (sc == NULL) + return (ENXIO); + + /* Map SRAM to EMAC, set bit 2 and 4. */ + reg_value = sramc_read_4(sc, SRAM_CTL1_CFG); + reg_value |= 0x5 << 2; + sramc_write_4(sc, SRAM_CTL1_CFG, reg_value); + + return (0); +} Copied: stable/10/sys/arm/allwinner/a10_sramc.h (from r262709, head/sys/arm/allwinner/a10_sramc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/allwinner/a10_sramc.h Fri May 16 23:27:18 2014 (r266274, copy of r262709, head/sys/arm/allwinner/a10_sramc.h) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _A10_SRAMC_H_ +#define _A10_SRAMC_H_ + +int a10_map_to_emac(void); + +#endif Modified: stable/10/sys/arm/allwinner/a20/files.a20 ============================================================================== --- stable/10/sys/arm/allwinner/a20/files.a20 Fri May 16 22:55:01 2014 (r266273) +++ stable/10/sys/arm/allwinner/a20/files.a20 Fri May 16 23:27:18 2014 (r266274) @@ -12,8 +12,10 @@ arm/arm/gic.c standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/a10_clk.c standard +arm/allwinner/a10_sramc.c standard arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_ehci.c optional ehci +arm/allwinner/if_emac.c optional emac arm/allwinner/a10_wdog.c standard arm/allwinner/timer.c standard arm/allwinner/bus_space.c standard Modified: stable/10/sys/arm/allwinner/files.a10 ============================================================================== --- stable/10/sys/arm/allwinner/files.a10 Fri May 16 22:55:01 2014 (r266273) +++ stable/10/sys/arm/allwinner/files.a10 Fri May 16 23:27:18 2014 (r266274) @@ -11,8 +11,10 @@ arm/arm/irq_dispatch.S standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/a10_clk.c standard +arm/allwinner/a10_sramc.c standard arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_ehci.c optional ehci +arm/allwinner/if_emac.c optional emac arm/allwinner/a10_wdog.c standard arm/allwinner/timer.c standard arm/allwinner/aintc.c standard Copied: stable/10/sys/arm/allwinner/if_emac.c (from r262710, head/sys/arm/allwinner/if_emac.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/allwinner/if_emac.c Fri May 16 23:27:18 2014 (r266274, copy of r262710, head/sys/arm/allwinner/if_emac.c) @@ -0,0 +1,1152 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * 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$ + */ + +/* A10/A20 EMAC driver */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef INET +#include +#include +#include +#include +#endif + +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include "miibus_if.h" + +#include "gpio_if.h" + +#include "a10_clk.h" +#include "a10_sramc.h" +#include "a10_gpio.h" + +struct emac_softc { + struct ifnet *emac_ifp; + device_t emac_dev; + device_t emac_miibus; + bus_space_handle_t emac_handle; + bus_space_tag_t emac_tag; + struct resource *emac_res; + struct resource *emac_irq; + void *emac_intrhand; + int emac_if_flags; + struct mtx emac_mtx; + struct callout emac_tick_ch; + int emac_watchdog_timer; + int emac_rx_process_limit; + int emac_link; +}; + +static int emac_probe(device_t); +static int emac_attach(device_t); +static int emac_detach(device_t); +static int emac_shutdown(device_t); +static int emac_suspend(device_t); +static int emac_resume(device_t); + +static void emac_sys_setup(void); +static void emac_reset(struct emac_softc *); + +static void emac_init_locked(struct emac_softc *); +static void emac_start_locked(struct ifnet *); +static void emac_init(void *); +static void emac_stop_locked(struct emac_softc *); +static void emac_intr(void *); +static int emac_ioctl(struct ifnet *, u_long, caddr_t); + +static void emac_rxeof(struct emac_softc *, int); +static void emac_txeof(struct emac_softc *); + +static int emac_miibus_readreg(device_t, int, int); +static int emac_miibus_writereg(device_t, int, int, int); +static void emac_miibus_statchg(device_t); + +static int emac_ifmedia_upd(struct ifnet *); +static void emac_ifmedia_sts(struct ifnet *, struct ifmediareq *); + +static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_emac_proc_limit(SYSCTL_HANDLER_ARGS); + +#define EMAC_READ_REG(sc, reg) \ + bus_space_read_4(sc->emac_tag, sc->emac_handle, reg) +#define EMAC_WRITE_REG(sc, reg, val) \ + bus_space_write_4(sc->emac_tag, sc->emac_handle, reg, val) + +static void +emac_sys_setup(void) +{ + int i; + + a10_clk_emac_activate(); + + /* + * Configure pin mux settings for MII. + * Pins PA0 from PA17. + */ + for (i = 0; i <= 17; i++) + a10_emac_gpio_config(i); + /* Map sram */ + a10_map_to_emac(); +} + +static void +emac_get_hwaddr(struct emac_softc *sc, uint8_t *hwaddr) +{ + uint32_t val0, val1, rnd; + + /* + * Try to get MAC address from running hardware. + * If there is something non-zero there just use it. + * + * Otherwise set the address to a convenient locally assigned address, + * 'bsd' + random 24 low-order bits. 'b' is 0x62, which has the locally + * assigned bit set, and the broadcast/multicast bit clear. + */ + val0 = EMAC_READ_REG(sc, EMAC_MAC_A0); + val1 = EMAC_READ_REG(sc, EMAC_MAC_A1); + if ((val0 | val1) != 0 && (val0 | val1) != 0xffffff) { + hwaddr[0] = (val1 >> 16) & 0xff; + hwaddr[1] = (val1 >> 8) & 0xff; + hwaddr[2] = (val1 >> 0) & 0xff; + hwaddr[3] = (val0 >> 16) & 0xff; + hwaddr[4] = (val0 >> 8) & 0xff; + hwaddr[5] = (val0 >> 0) & 0xff; + } else { + rnd = arc4random() & 0x00ffffff; + hwaddr[0] = 'b'; + hwaddr[1] = 's'; + hwaddr[2] = 'd'; + hwaddr[3] = (rnd >> 16) & 0xff; + hwaddr[4] = (rnd >> 8) & 0xff; + hwaddr[5] = (rnd >> 0) & 0xff; + } + if (bootverbose) + printf("MAC address: %s\n", ether_sprintf(hwaddr)); +} + +static void +emac_set_rx_mode(struct emac_softc *sc) +{ + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t h, hashes[2]; + uint32_t rcr = 0; + + EMAC_ASSERT_LOCKED(sc); + + ifp = sc->emac_ifp; + + rcr = EMAC_READ_REG(sc, EMAC_RX_CTL); + + /* Unicast packet and DA filtering */ + rcr |= EMAC_RX_UCAD; + rcr |= EMAC_RX_DAF; + + hashes[0] = 0; + hashes[1] = 0; + if (ifp->if_flags & IFF_ALLMULTI) { + hashes[0] = 0xffffffff; + hashes[1] = 0xffffffff; + } else { + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &sc->emac_ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; + hashes[h >> 5] |= 1 << (h & 0x1f); + } + if_maddr_runlock(ifp); + } + rcr |= EMAC_RX_MCO; + rcr |= EMAC_RX_MHF; + EMAC_WRITE_REG(sc, EMAC_RX_HASH0, hashes[0]); + EMAC_WRITE_REG(sc, EMAC_RX_HASH1, hashes[1]); + + if (ifp->if_flags & IFF_BROADCAST) { + rcr |= EMAC_RX_BCO; + rcr |= EMAC_RX_MCO; + } + + if (ifp->if_flags & IFF_PROMISC) + rcr |= EMAC_RX_PA; + else + rcr |= EMAC_RX_UCAD; + + EMAC_WRITE_REG(sc, EMAC_RX_CTL, rcr); +} + +static void +emac_reset(struct emac_softc *sc) +{ + + EMAC_WRITE_REG(sc, EMAC_CTL, 0); + DELAY(200); + EMAC_WRITE_REG(sc, EMAC_CTL, 1); + DELAY(200); +} + +static void +emac_txeof(struct emac_softc *sc) +{ + struct ifnet *ifp; + + EMAC_ASSERT_LOCKED(sc); + + ifp = sc->emac_ifp; + ifp->if_opackets++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + /* Unarm watchdog timer if no TX */ + sc->emac_watchdog_timer = 0; +} + +static void +emac_rxeof(struct emac_softc *sc, int count) +{ + struct ifnet *ifp; + struct mbuf *m, *m0; + uint32_t reg_val, rxcount; + int16_t len; + uint16_t status; + int good_packet, i; + + ifp = sc->emac_ifp; + for (; count > 0 && + (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; count--) { + /* + * Race warning: The first packet might arrive with + * the interrupts disabled, but the second will fix + */ + rxcount = EMAC_READ_REG(sc, EMAC_RX_FBC); + if (!rxcount) { + /* Had one stuck? */ + rxcount = EMAC_READ_REG(sc, EMAC_RX_FBC); + if (!rxcount) + return; + } + /* Check packet header */ + reg_val = EMAC_READ_REG(sc, EMAC_RX_IO_DATA); + if (reg_val != EMAC_PACKET_HEADER) { + /* Packet header is wrong */ + if (bootverbose) + if_printf(ifp, "wrong packet header\n"); + /* Disable RX */ + reg_val = EMAC_READ_REG(sc, EMAC_CTL); + reg_val &= ~EMAC_CTL_RX_EN; + EMAC_WRITE_REG(sc, EMAC_CTL, reg_val); + + /* Flush RX FIFO */ + reg_val = EMAC_READ_REG(sc, EMAC_RX_CTL); + reg_val |= EMAC_RX_FLUSH_FIFO; + EMAC_WRITE_REG(sc, EMAC_RX_CTL, reg_val); + for (i = 100; i > 0; i--) { + DELAY(100); + if ((EMAC_READ_REG(sc, EMAC_RX_CTL) & + EMAC_RX_FLUSH_FIFO) == 0) + break; + } + if (i == 0) { + device_printf(sc->emac_dev, + "flush FIFO timeout\n"); + /* Reinitialize controller */ + emac_init_locked(sc); + return; + } + /* Enable RX */ + reg_val = EMAC_READ_REG(sc, EMAC_CTL); + reg_val |= EMAC_CTL_RX_EN; + EMAC_WRITE_REG(sc, EMAC_CTL, reg_val); + + return; + } + + good_packet = 1; + + /* Get packet size and status */ + reg_val = EMAC_READ_REG(sc, EMAC_RX_IO_DATA); + len = reg_val & 0xffff; + status = (reg_val >> 16) & 0xffff; + + if (len < 64) { + good_packet = 0; + if (bootverbose) + if_printf(ifp, + "bad packet: len = %i status = %i\n", + len, status); + ifp->if_ierrors++; + } +#if 0 + if (status & (EMAC_CRCERR | EMAC_LENERR)) { + good_packet = 0; + ifp->if_ierrors++; + if (status & EMAC_CRCERR) + if_printf(ifp, "crc error\n"); + if (status & EMAC_LENERR) + if_printf(ifp, "length error\n"); + } +#endif + if (good_packet) { + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return; + m->m_len = m->m_pkthdr.len = MCLBYTES; + + len -= ETHER_CRC_LEN; + + /* Copy entire frame to mbuf first. */ + bus_space_read_multi_4(sc->emac_tag, sc->emac_handle, + EMAC_RX_IO_DATA, mtod(m, uint32_t *), + roundup2(len, 4) / 4); + + m->m_pkthdr.rcvif = ifp; + m->m_len = m->m_pkthdr.len = len; + + /* + * Emac controller needs strict aligment, so to avoid + * copying over an entire frame to align, we allocate + * a new mbuf and copy ethernet header + IP header to + * the new mbuf. The new mbuf is prepended into the + * existing mbuf chain. + */ + if (m->m_len <= (MHLEN - ETHER_HDR_LEN)) { + bcopy(m->m_data, m->m_data + ETHER_HDR_LEN, + m->m_len); + m->m_data += ETHER_HDR_LEN; + } else if (m->m_len <= (MCLBYTES - ETHER_HDR_LEN) && + m->m_len > (MHLEN - ETHER_HDR_LEN)) { + MGETHDR(m0, M_NOWAIT, MT_DATA); + if (m0 != NULL) { + len = ETHER_HDR_LEN + + m->m_pkthdr.l2hlen; + bcopy(m->m_data, m0->m_data, len); + m->m_data += len; + m->m_len -= len; + m0->m_len = len; + M_MOVE_PKTHDR(m0, m); + m0->m_next = m; + m = m0; + } else { + ifp->if_ierrors++; + m_freem(m); + m = NULL; + continue; + } + } else if (m->m_len > EMAC_MAC_MAXF) { + ifp->if_ierrors++; + m_freem(m); + m = NULL; + continue; + } + ifp->if_ipackets++; + EMAC_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + EMAC_LOCK(sc); + } + } +} + +static void +emac_watchdog(struct emac_softc *sc) +{ + struct ifnet *ifp; + + EMAC_ASSERT_LOCKED(sc); + + if (sc->emac_watchdog_timer == 0 || --sc->emac_watchdog_timer) + return; + + ifp = sc->emac_ifp; + + if (sc->emac_link == 0) { + if (bootverbose) + if_printf(sc->emac_ifp, "watchdog timeout " + "(missed link)\n"); + } else + if_printf(sc->emac_ifp, "watchdog timeout -- resetting\n"); + + ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + emac_init_locked(sc); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + emac_start_locked(ifp); +} + +static void +emac_tick(void *arg) +{ + struct emac_softc *sc; + struct mii_data *mii; + + sc = (struct emac_softc *)arg; + mii = device_get_softc(sc->emac_miibus); + mii_tick(mii); + + emac_watchdog(sc); + callout_reset(&sc->emac_tick_ch, hz, emac_tick, sc); +} + +static void +emac_init(void *xcs) +{ + struct emac_softc *sc; + + sc = (struct emac_softc *)xcs; + EMAC_LOCK(sc); + emac_init_locked(sc); + EMAC_UNLOCK(sc); +} + +static void +emac_init_locked(struct emac_softc *sc) +{ + struct ifnet *ifp; + struct mii_data *mii; + uint32_t reg_val; + uint8_t *eaddr; + + EMAC_ASSERT_LOCKED(sc); + + ifp = sc->emac_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + + /* Flush RX FIFO */ + reg_val = EMAC_READ_REG(sc, EMAC_RX_CTL); + reg_val |= EMAC_RX_FLUSH_FIFO; + EMAC_WRITE_REG(sc, EMAC_RX_CTL, reg_val); + DELAY(1); + + /* Soft reset MAC */ + reg_val = EMAC_READ_REG(sc, EMAC_MAC_CTL0); + reg_val &= (~EMAC_MAC_CTL0_SOFT_RST); + EMAC_WRITE_REG(sc, EMAC_MAC_CTL0, reg_val); + + /* Set MII clock */ + reg_val = EMAC_READ_REG(sc, EMAC_MAC_MCFG); + reg_val &= (~(0xf << 2)); + reg_val |= (0xd << 2); + EMAC_WRITE_REG(sc, EMAC_MAC_MCFG, reg_val); + + /* Clear RX counter */ + EMAC_WRITE_REG(sc, EMAC_RX_FBC, 0); + + /* Disable all interrupt and clear interrupt status */ + EMAC_WRITE_REG(sc, EMAC_INT_CTL, 0); + reg_val = EMAC_READ_REG(sc, EMAC_INT_STA); + EMAC_WRITE_REG(sc, EMAC_INT_STA, reg_val); + DELAY(1); + + /* Set up TX */ + reg_val = EMAC_READ_REG(sc, EMAC_TX_MODE); + reg_val |= EMAC_TX_AB_M; + reg_val &= EMAC_TX_TM; + EMAC_WRITE_REG(sc, EMAC_TX_MODE, reg_val); + + /* Set up RX */ + reg_val = EMAC_READ_REG(sc, EMAC_RX_CTL); + reg_val |= EMAC_RX_SETUP; + reg_val &= EMAC_RX_TM; + EMAC_WRITE_REG(sc, EMAC_RX_CTL, reg_val); + + /* Set up MAC CTL0. */ + reg_val = EMAC_READ_REG(sc, EMAC_MAC_CTL0); + reg_val |= EMAC_MAC_CTL0_SETUP; + EMAC_WRITE_REG(sc, EMAC_MAC_CTL0, reg_val); + + /* Set up MAC CTL1. */ + reg_val = EMAC_READ_REG(sc, EMAC_MAC_CTL1); + reg_val |= EMAC_MAC_CTL1_SETUP; + EMAC_WRITE_REG(sc, EMAC_MAC_CTL1, reg_val); + + /* Set up IPGT */ + EMAC_WRITE_REG(sc, EMAC_MAC_IPGT, EMAC_MAC_IPGT_FD); + + /* Set up IPGR */ + EMAC_WRITE_REG(sc, EMAC_MAC_IPGR, EMAC_MAC_NBTB_IPG2 | + (EMAC_MAC_NBTB_IPG1 << 8)); + + /* Set up Collison window */ + EMAC_WRITE_REG(sc, EMAC_MAC_CLRT, EMAC_MAC_RM | (EMAC_MAC_CW << 8)); + + /* Set up Max Frame Length */ + EMAC_WRITE_REG(sc, EMAC_MAC_MAXF, EMAC_MAC_MFL); + + /* Setup ethernet address */ + eaddr = IF_LLADDR(ifp); + EMAC_WRITE_REG(sc, EMAC_MAC_A1, eaddr[0] << 16 | + eaddr[1] << 8 | eaddr[2]); + EMAC_WRITE_REG(sc, EMAC_MAC_A0, eaddr[3] << 16 | + eaddr[4] << 8 | eaddr[5]); + + /* Setup rx filter */ + emac_set_rx_mode(sc); + + /* Enable RX/TX0/RX Hlevel interrupt */ + reg_val = EMAC_READ_REG(sc, EMAC_INT_CTL); + reg_val |= EMAC_INT_EN; + EMAC_WRITE_REG(sc, EMAC_INT_CTL, reg_val); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + sc->emac_link = 0; + + /* Switch to the current media. */ + mii = device_get_softc(sc->emac_miibus); + mii_mediachg(mii); + + callout_reset(&sc->emac_tick_ch, hz, emac_tick, sc); +} + + +static void +emac_start(struct ifnet *ifp) +{ + struct emac_softc *sc; + + sc = ifp->if_softc; + EMAC_LOCK(sc); + emac_start_locked(ifp); + EMAC_UNLOCK(sc); +} + +static void +emac_start_locked(struct ifnet *ifp) +{ + struct emac_softc *sc; + struct mbuf *m, *m0; + uint32_t reg_val; + + sc = ifp->if_softc; + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) + return; + if (sc->emac_link == 0) + return; + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + return; + + /* Select channel */ + EMAC_WRITE_REG(sc, EMAC_TX_INS, 0); + + /* + * Emac controller wants 4 byte aligned TX buffers. + * We have to copy pretty much all the time. + */ + if (m->m_next != NULL || (mtod(m, uintptr_t) & 3) != 0) { + m0 = m_defrag(m, M_NOWAIT); + if (m0 == NULL) { + m_freem(m); + m = NULL; + return; + } + m = m0; + } + /* Write data */ + bus_space_write_multi_4(sc->emac_tag, sc->emac_handle, + EMAC_TX_IO_DATA, mtod(m, uint32_t *), + roundup2(m->m_len, 4) / 4); + + /* Send the data lengh. */ + EMAC_WRITE_REG(sc, EMAC_TX_PL0, m->m_len); + + /* Start translate from fifo to phy. */ + reg_val = EMAC_READ_REG(sc, EMAC_TX_CTL0); + reg_val |= 1; + EMAC_WRITE_REG(sc, EMAC_TX_CTL0, reg_val); + + /* Set timeout */ + sc->emac_watchdog_timer = 5; + + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + BPF_MTAP(ifp, m); + m_freem(m); +} + +static void +emac_stop_locked(struct emac_softc *sc) +{ + struct ifnet *ifp; + uint32_t reg_val; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri May 16 23:49:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 23BEA956; Fri, 16 May 2014 23:49: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 0F95C25CA; Fri, 16 May 2014 23:49: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 s4GNnevG008609; Fri, 16 May 2014 23:49:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GNneLp008606; Fri, 16 May 2014 23:49:40 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405162349.s4GNneLp008606@svn.freebsd.org> From: Ian Lepore Date: Fri, 16 May 2014 23:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266275 - in stable/10/sys/arm: samsung/exynos ti X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 23:49:41 -0000 Author: ian Date: Fri May 16 23:49:40 2014 New Revision: 266275 URL: http://svnweb.freebsd.org/changeset/base/266275 Log: MFC 258211, 257775, 258096, Add mbox and pruss drivers to ti build. Use common bus_space-v6 instead of local copies. Deleted: stable/10/sys/arm/samsung/exynos/bus_space.c stable/10/sys/arm/ti/bus_space.c Modified: stable/10/sys/arm/samsung/exynos/exynos5_machdep.c stable/10/sys/arm/samsung/exynos/files.exynos5 stable/10/sys/arm/ti/files.ti Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- stable/10/sys/arm/samsung/exynos/exynos5_machdep.c Fri May 16 23:27:18 2014 (r266274) +++ stable/10/sys/arm/samsung/exynos/exynos5_machdep.c Fri May 16 23:49:40 2014 (r266275) @@ -30,27 +30,25 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE +#define _ARM32_BUS_DMA_PRIVATE #include #include #include #include -#include +#include #include #include #include #include -#define DEVMAP_BOOTSTRAP_MAP_START 0xF0000000 - vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START); + return (arm_devmap_lastaddr()); } void @@ -62,35 +60,22 @@ initarm_early_init(void) void initarm_gpio_init(void) { + } void initarm_late_init(void) { + } -#define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) /* FIXME */ -static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, } -}; - -/* - * Construct pmap_devmap[] with DT-derived config data. - */ int initarm_devmap_init(void) { - int i; - i = 0; - fdt_devmap[i].pd_va = 0xf2C00000; - fdt_devmap[i].pd_pa = 0x12C00000; - fdt_devmap[i].pd_size = 0x100000; - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_NOCACHE; - i++; + /* UART */ + arm_devmap_add_entry(0x12C00000, 0x100000); - arm_devmap_register_table(&fdt_devmap[0]); return (0); } Modified: stable/10/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- stable/10/sys/arm/samsung/exynos/files.exynos5 Fri May 16 23:27:18 2014 (r266274) +++ stable/10/sys/arm/samsung/exynos/files.exynos5 Fri May 16 23:49:40 2014 (r266275) @@ -10,12 +10,12 @@ arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard arm/arm/irq_dispatch.S standard +arm/arm/bus_space-v6.c standard arm/arm/gic.c standard arm/arm/generic_timer.c standard arm/samsung/exynos/arch_timer.c standard arm/samsung/exynos/exynos5_mp.c optional smp -arm/samsung/exynos/bus_space.c standard arm/samsung/exynos/common.c standard arm/samsung/exynos/exynos5_machdep.c standard arm/samsung/exynos/uart.c optional uart Modified: stable/10/sys/arm/ti/files.ti ============================================================================== --- stable/10/sys/arm/ti/files.ti Fri May 16 23:27:18 2014 (r266274) +++ stable/10/sys/arm/ti/files.ti Fri May 16 23:49:40 2014 (r266275) @@ -2,6 +2,7 @@ kern/kern_clocksource.c standard +arm/arm/bus_space-v6.c standard arm/arm/bus_space_generic.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/cpufunc_asm_armv5.S standard @@ -10,12 +11,14 @@ arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard arm/arm/irq_dispatch.S standard -arm/ti/bus_space.c standard arm/ti/common.c standard arm/ti/ti_cpuid.c standard arm/ti/ti_machdep.c standard arm/ti/ti_prcm.c standard arm/ti/ti_scm.c standard +dev/mbox/mbox_if.m standard +arm/ti/ti_mbox.c standard +arm/ti/ti_pruss.c standard arm/ti/ti_gpio.c optional gpio arm/ti/ti_i2c.c optional ti_i2c From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 00:53:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BEA4F8F7; Sat, 17 May 2014 00:53: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 A6E7F2AD8; Sat, 17 May 2014 00:53: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 s4H0rFke050845; Sat, 17 May 2014 00:53:15 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H0rD0f050831; Sat, 17 May 2014 00:53:13 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405170053.s4H0rD0f050831@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 00:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266277 - in stable/10/sys: arm/allwinner arm/allwinner/a20 arm/arm arm/at91 arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/include arm/mv arm/rockchip arm/samsung/exynos arm/tegra... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 00:53:15 -0000 Author: ian Date: Sat May 17 00:53:12 2014 New Revision: 266277 URL: http://svnweb.freebsd.org/changeset/base/266277 Log: MFC 257774, 256760, 262916, 262905, 262918, 262919, 262920, 262921, 262924, 262925, 262929, 262932, 262935, 262940, 262941, 262942, 262948, 262949, 262950 Strip arm/conf/DEFAULTS down to just items that are mandatory for running the architecture. Move all the files named foo/common.c to foo/foo_common.c Initial cut for DTS on the hl201 board. Add commented out dts for sam9260ek as well as early printf support. Make clock optional on uart nodes, then back it out ("I don't know what I was thinking, but it is lame.") Set the baud rate if it isn't 0 Make at91_soc_id() public. Properly round at91 resource on unmapping. Move AT91 AIC related stuff to own file. Fix another bug in multicast filtering. i.MX uses 6 bits from MSB in LE CRC32 for the hash value, not the lowest 6 bits in BE CRC32. Follow r262916 with one more config file that references a renamed common.c Remove bogus AT91 define that causes compile errors. Most of the defines for SAM9X are going away soonish anyway (once FDT works), but until then... Remove all dregs of a per-thread undefined-exception-mode stack. Rework the VFP code that handles demand-based save and restore of state. Always call vfp_discard() on thread death. When a thread begins life it doesn't own the VFP hardware state on any cpu. Make undefined exception entry MP-safe. Added: stable/10/sys/arm/allwinner/a10_common.c - copied unchanged from r262916, head/sys/arm/allwinner/a10_common.c stable/10/sys/arm/at91/at91_aic.c - copied unchanged from r262925, head/sys/arm/at91/at91_aic.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_common.c - copied unchanged from r262916, head/sys/arm/broadcom/bcm2835/bcm2835_common.c stable/10/sys/arm/freescale/imx/imx_common.c - copied unchanged from r262916, head/sys/arm/freescale/imx/imx_common.c stable/10/sys/arm/mv/mv_common.c - copied unchanged from r262916, head/sys/arm/mv/mv_common.c stable/10/sys/arm/rockchip/rk30xx_common.c - copied unchanged from r262916, head/sys/arm/rockchip/rk30xx_common.c stable/10/sys/arm/samsung/exynos/exynos5_common.c - copied unchanged from r262916, head/sys/arm/samsung/exynos/exynos5_common.c stable/10/sys/arm/tegra/tegra2_common.c - copied unchanged from r262916, head/sys/arm/tegra/tegra2_common.c stable/10/sys/arm/ti/ti_common.c - copied unchanged from r262916, head/sys/arm/ti/ti_common.c stable/10/sys/arm/versatile/versatile_common.c - copied unchanged from r262916, head/sys/arm/versatile/versatile_common.c stable/10/sys/boot/fdt/dts/arm/hl201.dts - copied unchanged from r262918, head/sys/boot/fdt/dts/arm/hl201.dts Deleted: stable/10/sys/arm/allwinner/common.c stable/10/sys/arm/broadcom/bcm2835/bus_space.c stable/10/sys/arm/broadcom/bcm2835/common.c stable/10/sys/arm/freescale/imx/common.c stable/10/sys/arm/mv/common.c stable/10/sys/arm/rockchip/common.c stable/10/sys/arm/samsung/exynos/common.c stable/10/sys/arm/tegra/common.c stable/10/sys/arm/ti/common.c stable/10/sys/arm/versatile/common.c Modified: stable/10/sys/arm/allwinner/a20/files.a20 stable/10/sys/arm/allwinner/files.a10 stable/10/sys/arm/arm/exception.S stable/10/sys/arm/arm/genassym.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/swtch.S stable/10/sys/arm/arm/undefined.c stable/10/sys/arm/arm/vfp.c stable/10/sys/arm/arm/vm_machdep.c stable/10/sys/arm/at91/at91.c stable/10/sys/arm/at91/at91rm9200.c stable/10/sys/arm/at91/at91sam9g20.c stable/10/sys/arm/at91/at91sam9g20reg.h stable/10/sys/arm/at91/at91sam9x5.c stable/10/sys/arm/at91/files.at91 stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 stable/10/sys/arm/conf/AC100 stable/10/sys/arm/conf/ARMADAXP stable/10/sys/arm/conf/ARNDALE stable/10/sys/arm/conf/ATMEL stable/10/sys/arm/conf/AVILA stable/10/sys/arm/conf/BEAGLEBONE stable/10/sys/arm/conf/BWCT stable/10/sys/arm/conf/CAMBRIA stable/10/sys/arm/conf/CNS11XXNAS stable/10/sys/arm/conf/CRB stable/10/sys/arm/conf/CUBIEBOARD stable/10/sys/arm/conf/CUBIEBOARD2 stable/10/sys/arm/conf/DB-78XXX stable/10/sys/arm/conf/DB-88F5XXX stable/10/sys/arm/conf/DB-88F6XXX stable/10/sys/arm/conf/DEFAULTS stable/10/sys/arm/conf/DIGI-CCWMX53 stable/10/sys/arm/conf/DOCKSTAR stable/10/sys/arm/conf/DREAMPLUG-1001 stable/10/sys/arm/conf/EA3250 stable/10/sys/arm/conf/EB9200 stable/10/sys/arm/conf/EFIKA_MX stable/10/sys/arm/conf/EP80219 stable/10/sys/arm/conf/ETHERNUT5 stable/10/sys/arm/conf/GUMSTIX stable/10/sys/arm/conf/HL200 stable/10/sys/arm/conf/HL201 stable/10/sys/arm/conf/IMX53-QSB stable/10/sys/arm/conf/IMX6 stable/10/sys/arm/conf/IQ31244 stable/10/sys/arm/conf/KB920X stable/10/sys/arm/conf/LN2410SBC stable/10/sys/arm/conf/NSLU stable/10/sys/arm/conf/PANDABOARD stable/10/sys/arm/conf/QILA9G20 stable/10/sys/arm/conf/RADXA stable/10/sys/arm/conf/RPI-B stable/10/sys/arm/conf/SAM9260EK stable/10/sys/arm/conf/SAM9G20EK stable/10/sys/arm/conf/SAM9X25EK stable/10/sys/arm/conf/SHEEVAPLUG stable/10/sys/arm/conf/SIMICS stable/10/sys/arm/conf/SN9G45 stable/10/sys/arm/conf/TS7800 stable/10/sys/arm/conf/VERSATILEPB stable/10/sys/arm/conf/VYBRID.common stable/10/sys/arm/conf/ZEDBOARD stable/10/sys/arm/freescale/imx/files.imx51 stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/include/param.h stable/10/sys/arm/include/pcb.h stable/10/sys/arm/include/pcpu.h stable/10/sys/arm/include/vfp.h stable/10/sys/arm/mv/files.mv stable/10/sys/arm/mv/mvreg.h stable/10/sys/arm/rockchip/files.rk30xx stable/10/sys/arm/samsung/exynos/files.exynos5 stable/10/sys/arm/tegra/files.tegra2 stable/10/sys/arm/ti/files.ti stable/10/sys/arm/versatile/files.versatile stable/10/sys/dev/ffec/if_ffec.c stable/10/sys/dev/uart/uart_bus_fdt.c Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/allwinner/a10_common.c (from r262916, head/sys/arm/allwinner/a10_common.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/allwinner/a10_common.c Sat May 17 00:53:12 2014 (r266277, copy of r262916, head/sys/arm/allwinner/a10_common.c) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2012 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +static int +fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, + int *pol) +{ + int offset; + + if (fdt_is_compatible(node, "allwinner,sun4i-ic")) + offset = 0; + else if (fdt_is_compatible(node, "arm,gic")) + offset = 32; + else + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]) + offset; + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + +fdt_pic_decode_t fdt_pic_table[] = { + &fdt_aintc_decode_ic, + NULL +}; Modified: stable/10/sys/arm/allwinner/a20/files.a20 ============================================================================== --- stable/10/sys/arm/allwinner/a20/files.a20 Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/allwinner/a20/files.a20 Sat May 17 00:53:12 2014 (r266277) @@ -19,5 +19,5 @@ arm/allwinner/if_emac.c optional emac arm/allwinner/a10_wdog.c standard arm/allwinner/timer.c standard arm/allwinner/bus_space.c standard -arm/allwinner/common.c standard +arm/allwinner/a10_common.c standard arm/allwinner/a10_machdep.c standard Modified: stable/10/sys/arm/allwinner/files.a10 ============================================================================== --- stable/10/sys/arm/allwinner/files.a10 Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/allwinner/files.a10 Sat May 17 00:53:12 2014 (r266277) @@ -9,16 +9,16 @@ arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard arm/arm/irq_dispatch.S standard -arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/a10_clk.c standard -arm/allwinner/a10_sramc.c standard +arm/allwinner/a10_common.c standard arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_ehci.c optional ehci -arm/allwinner/if_emac.c optional emac +arm/allwinner/a10_machdep.c standard +arm/allwinner/a10_sramc.c standard arm/allwinner/a10_wdog.c standard -arm/allwinner/timer.c standard +arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/aintc.c standard +arm/allwinner/if_emac.c optional emac +arm/allwinner/timer.c standard arm/allwinner/bus_space.c standard -arm/allwinner/common.c standard #arm/allwinner/console.c standard -arm/allwinner/a10_machdep.c standard Modified: stable/10/sys/arm/arm/exception.S ============================================================================== --- stable/10/sys/arm/arm/exception.S Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/arm/exception.S Sat May 17 00:53:12 2014 (r266277) @@ -218,46 +218,25 @@ END(exception_exit) * look like direct entry from the vector. */ ASENTRY_NP(undefined_entry) - stmfd sp!, {r0, r1} - ldr r0, Lundefined_handler_indirection - ldr r1, [sp], #0x0004 - str r1, [r0, #0x0000] - ldr r1, [sp], #0x0004 - str r1, [r0, #0x0004] - ldmia r0, {r0, r1, pc} - -Lundefined_handler_indirection: - .word Lundefined_handler_indirection_data + sub lr, lr, #0x00000004 /* Adjust the lr */ + PUSHFRAMEINSVC /* Push trap frame and switch */ + /* to SVC32 mode */ + ldr r1, Lundefined_handler_address + adr lr, exception_exit + mov r0, sp /* pass the stack pointer as r0 */ + ldr pc, [r1] END(undefined_entry) -/* - * assembly bounce code for calling the kernel - * undefined instruction handler. This uses - * a standard trap frame and is called in SVC mode. - */ - -ENTRY_NP(undefinedinstruction_bounce) - PUSHFRAMEINSVC +ASENTRY_NP(undefinedinstruction_bounce) + b undefinedinstruction +END(undefinedinstruction_bounce) - mov r0, sp - adr lr, exception_exit - b _C_LABEL(undefinedinstruction) +Lundefined_handler_address: + .word _C_LABEL(undefined_handler_address) .data - .align 0 - -/* - * Indirection data - * 2 words use for preserving r0 and r1 - * 3rd word contains the undefined handler address. - */ - -Lundefined_handler_indirection_data: - .word 0 - .word 0 - .global _C_LABEL(undefined_handler_address) _C_LABEL(undefined_handler_address): - .word _C_LABEL(undefinedinstruction_bounce) -END(undefinedinstruction_bounce) + .word undefinedinstruction_bounce + Modified: stable/10/sys/arm/arm/genassym.c ============================================================================== --- stable/10/sys/arm/arm/genassym.c Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/arm/genassym.c Sat May 17 00:53:12 2014 (r266277) @@ -60,7 +60,6 @@ ASSYM(PCB_NOALIGNFLT, PCB_NOALIGNFLT); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); -ASSYM(PCB_UND_SP, offsetof(struct pcb, un_32.pcb32_und_sp)); ASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir)); ASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec)); ASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec)); @@ -119,9 +118,7 @@ ASSYM(ARM_RAS_END, ARM_RAS_END); #ifdef VFP ASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate)); -ASSYM(PCB_VFPCPU, offsetof(struct pcb, pcb_vfpcpu)); -ASSYM(PC_VFPCTHREAD, offsetof(struct pcpu, pc_vfpcthread)); ASSYM(PC_CPU, offsetof(struct pcpu, pc_cpu)); ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap)); Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/arm/machdep.c Sat May 17 00:53:12 2014 (r266277) @@ -379,8 +379,6 @@ cpu_startup(void *dummy) bufinit(); vm_pager_bufferinit(); - pcb->un_32.pcb32_und_sp = (u_int)thread0.td_kstack + - USPACE_UNDEF_STACK_TOP; pcb->un_32.pcb32_sp = (u_int)thread0.td_kstack + USPACE_SVC_STACK_TOP; vector_page_setprot(VM_PROT_READ); @@ -995,6 +993,7 @@ init_proc0(vm_offset_t kstack) thread0.td_pcb = (struct pcb *) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; thread0.td_pcb->pcb_flags = 0; + thread0.td_pcb->pcb_vfpcpu = -1; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; } Modified: stable/10/sys/arm/arm/swtch.S ============================================================================== --- stable/10/sys/arm/arm/swtch.S Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/arm/swtch.S Sat May 17 00:53:12 2014 (r266277) @@ -84,6 +84,8 @@ #include #include #include +#include + __FBSDID("$FreeBSD$"); #define DOMAIN_CLIENT 0x01 @@ -102,6 +104,10 @@ __FBSDID("$FreeBSD$"); ldr tmp, .Lcurpcpu #endif +#ifdef VFP + .fpu vfp /* allow VFP instructions */ +#endif + .Lcurpcpu: .word _C_LABEL(__pcpu) .word PCPU_SIZE @@ -118,20 +124,11 @@ ENTRY(cpu_throw) * r5 = newtd */ - GET_PCPU(r7, r9) - -#ifdef VFP - /* - * vfp_discard will clear pcpu->pc_vfpcthread, and modify - * and modify the control as needed. - */ - ldr r4, [r7, #(PC_VFPCTHREAD)] /* this thread using vfp? */ - cmp r0, r4 - bne 3f - bl _C_LABEL(vfp_discard) /* yes, shut down vfp */ -3: -#endif /* VFP */ +#ifdef VFP /* This thread is dying, disable */ + bl _C_LABEL(vfp_discard) /* VFP without preserving state. */ +#endif + GET_PCPU(r7, r9) ldr r7, [r5, #(TD_PCB)] /* r7 = new thread's PCB */ /* Switch to lwp0 context */ @@ -303,46 +300,19 @@ ENTRY(cpu_switch) /* Get the user structure for the new process in r9 */ ldr r9, [r1, #(TD_PCB)] - mrs r3, cpsr - /* - * We can do that, since - * PSR_SVC32_MODE|PSR_UND32_MODE == MSR_UND32_MODE - */ - orr r8, r3, #(PSR_UND32_MODE) - msr cpsr_c, r8 - - str sp, [r2, #(PCB_UND_SP)] - - msr cpsr_c, r3 /* Restore the old mode */ /* rem: r2 = old PCB */ /* rem: r9 = new PCB */ /* rem: interrupts are enabled */ #ifdef VFP - /* - * vfp_store will clear pcpu->pc_vfpcthread, save - * registers and state, and modify the control as needed. - * a future exception will bounce the backup settings in the fp unit. - * XXX vfp_store can't change r4 - */ - GET_PCPU(r7, r8) - ldr r8, [r7, #(PC_VFPCTHREAD)] - cmp r4, r8 /* old thread used vfp? */ - bne 1f /* no, don't save */ - cmp r1, r4 /* same thread ? */ - beq 1f /* yes, skip vfp store */ -#ifdef SMP - ldr r8, [r7, #(PC_CPU)] /* last used on this cpu? */ - ldr r3, [r2, #(PCB_VFPCPU)] - cmp r8, r3 /* last cpu to use these registers? */ - bne 1f /* no. these values are stale */ + fmrx r0, fpexc /* If the VFP is enabled */ + tst r0, #(VFPEXC_EN) /* the current thread has */ + movne r1, #1 /* used it, so go save */ + addne r0, r2, #(PCB_VFPSTATE) /* the state into the PCB */ + blne _C_LABEL(vfp_store) /* and disable the VFP. */ #endif - add r0, r2, #(PCB_VFPSTATE) - bl _C_LABEL(vfp_store) -1: -#endif /* VFP */ - /* r1 now free! */ + /* r0-r3 now free! */ /* Third phase : restore saved context */ @@ -438,10 +408,6 @@ ENTRY(cpu_switch) movne r0, #0 /* We *know* vector_page's VA is 0x0 */ movne lr, pc ldrne pc, [r10, #CF_TLB_FLUSHID_SE] - /* - * We can do that, since - * PSR_SVC32_MODE|PSR_UND32_MODE == MSR_UND32_MODE - */ .Lcs_context_switched: @@ -460,17 +426,6 @@ ENTRY(cpu_switch) /* rem: r9 = new PCB */ - mrs r3, cpsr - /* - * We can do that, since - * PSR_SVC32_MODE|PSR_UND32_MODE == MSR_UND32_MODE - */ - orr r2, r3, #(PSR_UND32_MODE) - msr cpsr_c, r2 - - ldr sp, [r9, #(PCB_UND_SP)] - - msr cpsr_c, r3 /* Restore the old mode */ /* Restore all the save registers */ #ifndef _ARM_ARCH_5E add r7, r9, #PCB_R8 @@ -520,26 +475,12 @@ ENTRY(savectx) add r2, r0, #(PCB_R8) stmia r2, {r8-r13} #ifdef VFP - /* - * vfp_store will clear pcpu->pc_vfpcthread, save - * registers and state, and modify the control as needed. - * a future exception will bounce the backup settings in the fp unit. - */ - GET_PCPU(r7, r4) - ldr r4, [r7, #(PC_VFPCTHREAD)] /* vfp thread */ - ldr r2, [r7, #(PC_CURTHREAD)] /* current thread */ - cmp r4, r2 - bne 1f -#ifdef SMP - ldr r2, [r7, #(PC_CPU)] /* last used on this cpu? */ - ldr r3, [r0, #(PCB_VFPCPU)] - cmp r2, r3 - bne 1f /* no. these values are stale */ + fmrx r2, fpexc /* If the VFP is enabled */ + tst r2, #(VFPEXC_EN) /* the current thread has */ + movne r1, #1 /* used it, so go save */ + addne r0, r0, #(PCB_VFPSTATE) /* the state into the PCB */ + blne _C_LABEL(vfp_store) /* and disable the VFP. */ #endif - add r0, r0, #(PCB_VFPSTATE) - bl _C_LABEL(vfp_store) -1: -#endif /* VFP */ add sp, sp, #4; ldmfd sp!, {r4-r7, pc} END(savectx) Modified: stable/10/sys/arm/arm/undefined.c ============================================================================== --- stable/10/sys/arm/arm/undefined.c Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/arm/undefined.c Sat May 17 00:53:12 2014 (r266277) @@ -183,7 +183,6 @@ undefinedinstruction(struct trapframe *f if (!(frame->tf_spsr & I32_bit)) enable_interrupts(I32_bit|F32_bit); - frame->tf_pc -= INSN_SIZE; PCPU_INC(cnt.v_trap); fault_pc = frame->tf_pc; Modified: stable/10/sys/arm/arm/vfp.c ============================================================================== --- stable/10/sys/arm/arm/vfp.c Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/arm/vfp.c Sat May 17 00:53:12 2014 (r266277) @@ -1,4 +1,5 @@ -/* +/*- + * Copyright (c) 2014 Ian Lepore * Copyright (c) 2012 Mark Tinguely * * All rights reserved. @@ -34,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -41,12 +43,8 @@ __FBSDID("$FreeBSD$"); #include /* function prototypes */ -unsigned int get_coprocessorACR(void); static int vfp_bounce(u_int, u_int, struct trapframe *, int); static void vfp_restore(struct vfp_state *); -void vfp_discard(void); -void vfp_store(struct vfp_state *); -void set_coprocessorACR(u_int); extern int vfp_exists; static struct undefined_handler vfp10_uh, vfp11_uh; @@ -64,7 +62,20 @@ static int is_d32; val; \ }) -u_int +/* + * Work around an issue with GCC where the asm it generates is not unified + * syntax and fails to assemble because it expects the ldcleq instruction in the + * form ldcl, not in the UAL form ldcl, and similar for stcleq. + */ +#ifdef __clang__ +#define LDCLNE "ldclne " +#define STCLNE "stclne " +#else +#define LDCLNE "ldcnel " +#define STCLNE "stcnel " +#endif + +static u_int get_coprocessorACR(void) { u_int val; @@ -72,7 +83,7 @@ get_coprocessorACR(void) return val; } -void +static void set_coprocessorACR(u_int val) { __asm __volatile("mcr p15, 0, %0, c1, c0, 2\n\t" @@ -136,147 +147,105 @@ SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, v static int vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code) { - u_int fpexc; + u_int cpu, fpexc; struct pcb *curpcb; - struct thread *vfptd; - int i; - if (!vfp_exists) - return 1; /* vfp does not exist */ - i = disable_interrupts(I32_bit|F32_bit); - fpexc = fmrx(VFPEXC); /* read the vfp exception reg */ - if (fpexc & VFPEXC_EN) { - vfptd = PCPU_GET(vfpcthread); - /* did the kernel call the vfp or exception that expect us - * to emulate the command. Newer hardware does not require - * emulation, so we don't emulate yet. - */ -#ifdef SMP - /* don't save if newer registers are on another processor */ - if (vfptd /* && (vfptd == curthread) */ && - (vfptd->td_pcb->pcb_vfpcpu == PCPU_GET(cpu))) -#else - /* someone did not save their registers, */ - if (vfptd /* && (vfptd == curthread) */) -#endif - vfp_store(&vfptd->td_pcb->pcb_vfpstate); + if ((code & FAULT_USER) == 0) + panic("undefined floating point instruction in supervisor mode"); - fpexc &= ~VFPEXC_EN; - fmxr(VFPEXC, fpexc); /* turn vfp hardware off */ - if (vfptd == curthread) { - /* kill the process - we do not handle emulation */ - restore_interrupts(i); - killproc(curthread->td_proc, "vfp emulation"); - return 1; - } - /* should not happen. someone did not save their context */ - printf("vfp_bounce: vfpcthread: %p curthread: %p\n", - vfptd, curthread); + critical_enter(); + + /* + * If the VFP is already on and we got an undefined instruction, then + * something tried to executate a truly invalid instruction that maps to + * the VFP. + */ + fpexc = fmrx(VFPEXC); + if (fpexc & VFPEXC_EN) { + /* kill the process - we do not handle emulation */ + critical_exit(); + killproc(curthread->td_proc, "vfp emulation"); + return 1; } - fpexc |= VFPEXC_EN; - fmxr(VFPEXC, fpexc); /* enable the vfp and repeat command */ - curpcb = curthread->td_pcb; - /* If we were the last process to use the VFP, the process did not - * use a VFP on another processor, then the registers in the VFP - * will still be ours and are current. Eventually, we will make the - * restore smarter. + + /* + * If the last time this thread used the VFP it was on this core, and + * the last thread to use the VFP on this core was this thread, then the + * VFP state is valid, otherwise restore this thread's state to the VFP. */ - vfp_restore(&curpcb->pcb_vfpstate); -#ifdef SMP - curpcb->pcb_vfpcpu = PCPU_GET(cpu); -#endif - PCPU_SET(vfpcthread, curthread); - restore_interrupts(i); - return 0; + fmxr(VFPEXC, fpexc | VFPEXC_EN); + curpcb = curthread->td_pcb; + cpu = PCPU_GET(cpu); + if (curpcb->pcb_vfpcpu != cpu || curthread != PCPU_GET(fpcurthread)) { + vfp_restore(&curpcb->pcb_vfpstate); + curpcb->pcb_vfpcpu = cpu; + PCPU_SET(fpcurthread, curthread); + } + + critical_exit(); + return (0); } -/* vfs_store is called from from a VFP command to restore the registers and - * turn on the VFP hardware. - * Eventually we will use the information that this process was the last - * to use the VFP hardware and bypass the restore, just turn on the hardware. +/* + * Restore the given state to the VFP hardware. */ static void vfp_restore(struct vfp_state *vfpsave) { u_int vfpscr = 0; - /* - * Work around an issue with GCC where the asm it generates is - * not unified syntax and fails to assemble because it expects - * the ldcleq instruction in the form ldcl, not in the UAL - * form ldcl, and similar for stcleq. - */ -#ifdef __clang__ -#define ldclne "ldclne" -#define stclne "stclne" -#else -#define ldclne "ldcnel" -#define stclne "stcnel" -#endif - if (vfpsave) { - __asm __volatile("ldc p10, c0, [%1], #128\n" /* d0-d15 */ + __asm __volatile("ldc p10, c0, [%1], #128\n" /* d0-d15 */ "cmp %2, #0\n" /* -D16 or -D32? */ - ldclne" p11, c0, [%1], #128\n" /* d16-d31 */ + LDCLNE "p11, c0, [%1], #128\n" /* d16-d31 */ "addeq %1, %1, #128\n" /* skip missing regs */ "ldr %0, [%1]\n" /* set old vfpscr */ "mcr p10, 7, %0, cr1, c0, 0\n" : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); - } } -/* vfs_store is called from switch to save the vfp hardware registers - * into the pcb before switching to another process. - * we already know that the new process is different from this old - * process and that this process last used the VFP registers. - * Below we check to see if the VFP has been enabled since the last - * register save. - * This routine will exit with the VFP turned off. The next VFP user - * will trap to restore its registers and turn on the VFP hardware. +/* + * If the VFP is on, save its current state and turn it off if requested to do + * so. If the VFP is not on, does not change the values at *vfpsave. Caller is + * responsible for preventing a context switch while this is running. */ void -vfp_store(struct vfp_state *vfpsave) +vfp_store(struct vfp_state *vfpsave, boolean_t disable_vfp) { - u_int tmp, vfpscr = 0; + u_int tmp, vfpscr; tmp = fmrx(VFPEXC); /* Is the vfp enabled? */ - if (vfpsave && (tmp & VFPEXC_EN)) { - __asm __volatile("stc p11, c0, [%1], #128\n" /* d0-d15 */ + if (tmp & VFPEXC_EN) { + __asm __volatile( + "stc p11, c0, [%1], #128\n" /* d0-d15 */ "cmp %2, #0\n" /* -D16 or -D32? */ - stclne" p11, c0, [%1], #128\n" /* d16-d31 */ + STCLNE "p11, c0, [%1], #128\n" /* d16-d31 */ "addeq %1, %1, #128\n" /* skip missing regs */ "mrc p10, 7, %0, cr1, c0, 0\n" /* fmxr(VFPSCR) */ "str %0, [%1]\n" /* save vfpscr */ : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); + if (disable_vfp) + fmxr(VFPEXC , tmp & ~VFPEXC_EN); } -#undef ldcleq -#undef stcleq - -#ifndef SMP - /* eventually we will use this information for UP also */ - PCPU_SET(vfpcthread, 0); -#endif - tmp &= ~VFPEXC_EN; /* disable the vfp hardware */ - fmxr(VFPEXC , tmp); } -/* discard the registers at cpu_thread_free() when fpcurthread == td. - * Turn off the VFP hardware. +/* + * The current thread is dying. If the state currently in the hardware belongs + * to the current thread, set fpcurthread to NULL to indicate that the VFP + * hardware state does not belong to any thread. If the VFP is on, turn it off. + * Called only from cpu_throw(), so we don't have to worry about a context + * switch here. */ void -vfp_discard() +vfp_discard(struct thread *td) { - u_int tmp = 0; + u_int tmp; + + if (PCPU_GET(fpcurthread) == td) + PCPU_SET(fpcurthread, NULL); - /* - * No need to protect the access to vfpcthread by disabling - * interrupts, since it's called from cpu_throw(), who is called - * with interrupts disabled. - */ - - PCPU_SET(vfpcthread, 0); /* permanent forget about reg */ tmp = fmrx(VFPEXC); - tmp &= ~VFPEXC_EN; /* turn off VFP hardware */ - fmxr(VFPEXC, tmp); + if (tmp & VFPEXC_EN) + fmxr(VFPEXC, tmp & ~VFPEXC_EN); } #endif Modified: stable/10/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/10/sys/arm/arm/vm_machdep.c Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/arm/vm_machdep.c Sat May 17 00:53:12 2014 (r266277) @@ -144,9 +144,9 @@ cpu_fork(register struct thread *td1, re bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); mdp2 = &p2->p_md; bcopy(&td1->td_proc->p_md, mdp2, sizeof(*mdp2)); - pcb2->un_32.pcb32_und_sp = td2->td_kstack + USPACE_UNDEF_STACK_TOP; pcb2->un_32.pcb32_sp = td2->td_kstack + USPACE_SVC_STACK_TOP - sizeof(*pcb2); + pcb2->pcb_vfpcpu = -1; pmap_activate(td2); td2->td_frame = tf = (struct trapframe *)STACKALIGN( pcb2->un_32.pcb32_sp - sizeof(struct trapframe)); @@ -366,7 +366,6 @@ cpu_set_upcall(struct thread *td, struct tf->tf_spsr &= ~PSR_C_bit; tf->tf_r0 = 0; td->td_pcb->un_32.pcb32_sp = (u_int)sf; - td->td_pcb->un_32.pcb32_und_sp = td->td_kstack + USPACE_UNDEF_STACK_TOP; KASSERT((td->td_pcb->un_32.pcb32_sp & 7) == 0, ("cpu_set_upcall: Incorrect stack alignment")); Modified: stable/10/sys/arm/at91/at91.c ============================================================================== --- stable/10/sys/arm/at91/at91.c Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/at91/at91.c Sat May 17 00:53:12 2014 (r266277) @@ -24,6 +24,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -49,12 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -static struct at91_softc *at91_softc; - -static void at91_eoi(void *); - -extern const struct arm_devmap_entry at91_devmap[]; - uint32_t at91_master_clock; static int @@ -84,8 +80,12 @@ at91_bs_unmap(void *t, bus_space_handle_ { vm_offset_t va, endva; + if (t == 0) + return; va = trunc_page((vm_offset_t)t); - endva = va + round_page(size); + if (va >= AT91_BASE && va <= AT91_BASE + 0xff00000) + return; + endva = round_page((vm_offset_t)t + size); /* Free the kernel virtual mapping. */ kva_free(va, endva - va); @@ -229,6 +229,12 @@ struct bus_space at91_bs_tag = { NULL, }; +#ifndef FDT + +static struct at91_softc *at91_softc; + +static void at91_eoi(void *); + static int at91_probe(device_t dev) { @@ -260,7 +266,6 @@ static int at91_attach(device_t dev) { struct at91_softc *sc = device_get_softc(dev); - int i; arm_post_filter = at91_eoi; @@ -290,29 +295,6 @@ at91_attach(device_t dev) 0xfffffffful) != 0) panic("at91_attach: failed to set up memory rman"); - /* - * Setup the interrupt table. - */ - if (soc_info.soc_data == NULL || soc_info.soc_data->soc_irq_prio == NULL) - panic("Interrupt priority table missing\n"); - for (i = 0; i < 32; i++) { - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + - i * 4, i); - /* Priority. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, - soc_info.soc_data->soc_irq_prio[i]); - if (i < 8) - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, - 1); - } - - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); - /* No debug. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); - /* Disable and clear all interrupts. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* * Add this device's children... */ @@ -472,42 +454,6 @@ at91_print_child(device_t dev, device_t return (retval); } -void -arm_mask_irq(uintptr_t nb) -{ - - bus_space_write_4(at91_softc->sc_st, - at91_softc->sc_aic_sh, IC_IDCR, 1 << nb); -} - -int -arm_get_next_irq(int last __unused) -{ - int status; - int irq; - - irq = bus_space_read_4(at91_softc->sc_st, - at91_softc->sc_aic_sh, IC_IVR); - status = bus_space_read_4(at91_softc->sc_st, - at91_softc->sc_aic_sh, IC_ISR); - if (status == 0) { - bus_space_write_4(at91_softc->sc_st, - at91_softc->sc_aic_sh, IC_EOICR, 1); - return (-1); - } - return (irq); -} - -void -arm_unmask_irq(uintptr_t nb) -{ - - bus_space_write_4(at91_softc->sc_st, - at91_softc->sc_aic_sh, IC_IECR, 1 << nb); - bus_space_write_4(at91_softc->sc_st, at91_softc->sc_aic_sh, - IC_EOICR, 0); -} - static void at91_eoi(void *unused) { @@ -584,3 +530,4 @@ static driver_t at91_driver = { static devclass_t at91_devclass; DRIVER_MODULE(atmelarm, nexus, at91_driver, at91_devclass, 0, 0); +#endif Copied: stable/10/sys/arm/at91/at91_aic.c (from r262925, head/sys/arm/at91/at91_aic.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/at91/at91_aic.c Sat May 17 00:53:12 2014 (r266277, copy of r262925, head/sys/arm/at91/at91_aic.c) @@ -0,0 +1,188 @@ +/*- + * Copyright (c) 2014 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +static struct aic_softc { + struct resource *mem_res; /* Memory resource */ + void *intrhand; /* Interrupt handle */ + device_t sc_dev; +} *sc; + +static inline uint32_t +RD4(struct aic_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->mem_res, off)); +} + +static inline void +WR4(struct aic_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->mem_res, off, val); +} + +void +arm_mask_irq(uintptr_t nb) +{ + + WR4(sc, IC_IDCR, 1 << nb); +} + +int +arm_get_next_irq(int last __unused) +{ + int status; + int irq; + + irq = RD4(sc, IC_IVR); + status = RD4(sc, IC_ISR); + if (status == 0) { + WR4(sc, IC_EOICR, 1); + return (-1); + } + return (irq); +} + +void +arm_unmask_irq(uintptr_t nb) +{ + + WR4(sc, IC_IECR, 1 << nb); + WR4(sc, IC_EOICR, 0); +} + +static int +at91_aic_probe(device_t dev) +{ +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-aic")) + return (ENXIO); +#endif + device_set_desc(dev, "AIC"); + return (0); +} + +static int +at91_aic_attach(device_t dev) +{ + int i, rid, err = 0; + + device_printf(dev, "Attach %d\n", bus_current_pass); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + + if (sc->mem_res == NULL) + panic("couldn't allocate register resources"); + + /* + * Setup the interrupt table. + */ + if (soc_info.soc_data == NULL || soc_info.soc_data->soc_irq_prio == NULL) + panic("Interrupt priority table missing\n"); + for (i = 0; i < 32; i++) { + WR4(sc, IC_SVR + i * 4, i); + /* Priority. */ + WR4(sc, IC_SMR + i * 4, soc_info.soc_data->soc_irq_prio[i]); + if (i < 8) + WR4(sc, IC_EOICR, 1); + } + + WR4(sc, IC_SPU, 32); + /* No debug. */ + WR4(sc, IC_DCR, 0); + /* Disable and clear all interrupts. */ + WR4(sc, IC_IDCR, 0xffffffff); + WR4(sc, IC_ICCR, 0xffffffff); + enable_interrupts(I32_bit | F32_bit); + + return (err); +} + +static void +at91_aic_new_pass(device_t dev) +{ + device_printf(dev, "Pass %d\n", bus_current_pass); +} + +static device_method_t at91_aic_methods[] = { + DEVMETHOD(device_probe, at91_aic_probe), + DEVMETHOD(device_attach, at91_aic_attach), + DEVMETHOD(bus_new_pass, at91_aic_new_pass), + DEVMETHOD_END +}; + +static driver_t at91_aic_driver = { + "at91_aic", + at91_aic_methods, + sizeof(struct aic_softc), +}; + +static devclass_t at91_aic_devclass; + +#ifdef FDT +DRIVER_MODULE(at91_aic, simplebus, at91_aic_driver, at91_aic_devclass, NULL, + NULL); +#else +DRIVER_MODULE(at91_aic, atmelarm, at91_aic_driver, at91_aic_devclass, NULL, + NULL); +#endif +/* not yet +EARLY_DRIVER_MODULE(at91_aic, simplebus, at91_aic_driver, at91_aic_devclass, + NULL, NULL, BUS_PASS_INTERRUPT); +*/ Modified: stable/10/sys/arm/at91/at91rm9200.c ============================================================================== --- stable/10/sys/arm/at91/at91rm9200.c Sat May 17 00:09:12 2014 (r266276) +++ stable/10/sys/arm/at91/at91rm9200.c Sat May 17 00:53:12 2014 (r266277) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 00:55:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AA62DA52; Sat, 17 May 2014 00:55:05 +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 91D132AE7; Sat, 17 May 2014 00:55:05 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-26.AirBears2.Berkeley.EDU [136.152.142.26]) (authenticated bits=0) by d.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s4H0eQ7c024826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 16 May 2014 17:40:26 -0700 Message-ID: <5376AFFA.3010902@freebsd.org> Date: Fri, 16 May 2014 17:40:26 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r266273 - in stable/10/sys: amd64/conf conf i386/conf References: <201405162255.s4GMt1GR077643@svn.freebsd.org> In-Reply-To: <201405162255.s4GMt1GR077643@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;FryD1lvd4xG4vFMaeQW9yA== M;wtir1lvd4xG4vFMaeQW9yA== X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 00:55:05 -0000 I missed the original commit of this, but why doesn't this code work on non-x86 systems? QEMU works perfectly fine on other architectures. -Nathan On 05/16/14 15:55, Ian Lepore wrote: > Author: ian > Date: Fri May 16 22:55:01 2014 > New Revision: 266273 > URL: http://svnweb.freebsd.org/changeset/base/266273 > > Log: > MFC 264304: Really only allow IMGACT_BINMISC for amd64/i386 builds. > > Modified: > stable/10/sys/amd64/conf/NOTES > stable/10/sys/conf/NOTES > stable/10/sys/i386/conf/NOTES > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/amd64/conf/NOTES > ============================================================================== > --- stable/10/sys/amd64/conf/NOTES Fri May 16 21:56:33 2014 (r266272) > +++ stable/10/sys/amd64/conf/NOTES Fri May 16 22:55:01 2014 (r266273) > @@ -650,3 +650,6 @@ device ndis > > # Linux-specific pseudo devices support > device lindev > + > +# Module to enable execution of application via emulators like QEMU > +options IMAGACT_BINMISC > > Modified: stable/10/sys/conf/NOTES > ============================================================================== > --- stable/10/sys/conf/NOTES Fri May 16 21:56:33 2014 (r266272) > +++ stable/10/sys/conf/NOTES Fri May 16 22:55:01 2014 (r266273) > @@ -2973,6 +2973,3 @@ options RANDOM_YARROW # Yarrow RNG > ##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented > options RANDOM_DEBUG # Debugging messages > options RANDOM_RWFILE # Read and write entropy cache > - > -# Module to enable execution of application via emulators like QEMU > -options IMAGACT_BINMISC > > Modified: stable/10/sys/i386/conf/NOTES > ============================================================================== > --- stable/10/sys/i386/conf/NOTES Fri May 16 21:56:33 2014 (r266272) > +++ stable/10/sys/i386/conf/NOTES Fri May 16 22:55:01 2014 (r266273) > @@ -1060,3 +1060,6 @@ options VM_KMEM_SIZE_SCALE > # asr old ioctls support, needed by raidutils > > options ASR_COMPAT > + > +# Module to enable execution of application via emulators like QEMU > +options IMAGACT_BINMISC > From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 01:00:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4C875BCB; Sat, 17 May 2014 01:00:01 +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 1F5412B07; Sat, 17 May 2014 01:00:00 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WlSye-000CNO-Jh; Sat, 17 May 2014 00:59:52 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s4H0xovj039866; Fri, 16 May 2014 18:59:50 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19S3Uh7qOC70gBMjlbLEgdg Subject: Re: svn commit: r266273 - in stable/10/sys: amd64/conf conf i386/conf From: Ian Lepore To: Nathan Whitehorn In-Reply-To: <5376AFFA.3010902@freebsd.org> References: <201405162255.s4GMt1GR077643@svn.freebsd.org> <5376AFFA.3010902@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 16 May 2014 18:59:49 -0600 Message-ID: <1400288389.1152.1.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-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-10@FreeBSD.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 01:00:01 -0000 We need to ask Sean Bruno about that. I just noticed that this change hadn't been merged along with the others it was related to when it caused me a build error. -- Ian On Fri, 2014-05-16 at 17:40 -0700, Nathan Whitehorn wrote: > I missed the original commit of this, but why doesn't this code work on > non-x86 systems? QEMU works perfectly fine on other architectures. > -Nathan > > On 05/16/14 15:55, Ian Lepore wrote: > > Author: ian > > Date: Fri May 16 22:55:01 2014 > > New Revision: 266273 > > URL: http://svnweb.freebsd.org/changeset/base/266273 > > > > Log: > > MFC 264304: Really only allow IMGACT_BINMISC for amd64/i386 builds. > > > > Modified: > > stable/10/sys/amd64/conf/NOTES > > stable/10/sys/conf/NOTES > > stable/10/sys/i386/conf/NOTES > > Directory Properties: > > stable/10/ (props changed) > > > > Modified: stable/10/sys/amd64/conf/NOTES > > ============================================================================== > > --- stable/10/sys/amd64/conf/NOTES Fri May 16 21:56:33 2014 (r266272) > > +++ stable/10/sys/amd64/conf/NOTES Fri May 16 22:55:01 2014 (r266273) > > @@ -650,3 +650,6 @@ device ndis > > > > # Linux-specific pseudo devices support > > device lindev > > + > > +# Module to enable execution of application via emulators like QEMU > > +options IMAGACT_BINMISC > > > > Modified: stable/10/sys/conf/NOTES > > ============================================================================== > > --- stable/10/sys/conf/NOTES Fri May 16 21:56:33 2014 (r266272) > > +++ stable/10/sys/conf/NOTES Fri May 16 22:55:01 2014 (r266273) > > @@ -2973,6 +2973,3 @@ options RANDOM_YARROW # Yarrow RNG > > ##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented > > options RANDOM_DEBUG # Debugging messages > > options RANDOM_RWFILE # Read and write entropy cache > > - > > -# Module to enable execution of application via emulators like QEMU > > -options IMAGACT_BINMISC > > > > Modified: stable/10/sys/i386/conf/NOTES > > ============================================================================== > > --- stable/10/sys/i386/conf/NOTES Fri May 16 21:56:33 2014 (r266272) > > +++ stable/10/sys/i386/conf/NOTES Fri May 16 22:55:01 2014 (r266273) > > @@ -1060,3 +1060,6 @@ options VM_KMEM_SIZE_SCALE > > # asr old ioctls support, needed by raidutils > > > > options ASR_COMPAT > > + > > +# Module to enable execution of application via emulators like QEMU > > +options IMAGACT_BINMISC > > > > From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 01:17:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A7123FB2; Sat, 17 May 2014 01:17:13 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 857B92C6D; Sat, 17 May 2014 01:17:12 +0000 (UTC) Received: from [10.2.254.235] (unknown [137.122.78.9]) (using SSLv3 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 1494C194107; Sat, 17 May 2014 01:17:11 +0000 (UTC) Subject: Re: svn commit: r266273 - in stable/10/sys: amd64/conf conf i386/conf From: Sean Bruno Reply-To: sbruno@freebsd.org To: Ian Lepore In-Reply-To: <201405162255.s4GMt1GR077643@svn.freebsd.org> References: <201405162255.s4GMt1GR077643@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 16 May 2014 21:17:09 -0400 Message-ID: <1400289429.1535.0.camel@bruno> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 01:17:13 -0000 On Fri, 2014-05-16 at 22:55 +0000, Ian Lepore wrote: > Author: ian > Date: Fri May 16 22:55:01 2014 > New Revision: 266273 > URL: http://svnweb.freebsd.org/changeset/base/266273 > > Log: > MFC 264304: Really only allow IMGACT_BINMISC for amd64/i386 builds. Bah, thanks! sean From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 01:18:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 00FC0190; Sat, 17 May 2014 01:18:08 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1CEA2C75; Sat, 17 May 2014 01:18:07 +0000 (UTC) Received: from [10.2.254.235] (unknown [137.122.78.9]) (using SSLv3 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id D3900194107; Sat, 17 May 2014 01:18:06 +0000 (UTC) Subject: Re: svn commit: r266273 - in stable/10/sys: amd64/conf conf i386/conf From: Sean Bruno Reply-To: sbruno@freebsd.org To: Nathan Whitehorn In-Reply-To: <5376AFFA.3010902@freebsd.org> References: <201405162255.s4GMt1GR077643@svn.freebsd.org> <5376AFFA.3010902@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 16 May 2014 21:18:06 -0400 Message-ID: <1400289486.1535.1.camel@bruno> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org, Ian Lepore X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 01:18:08 -0000 On Fri, 2014-05-16 at 17:40 -0700, Nathan Whitehorn wrote: > I missed the original commit of this, but why doesn't this code work on > non-x86 systems? QEMU works perfectly fine on other architectures. > -Nathan I am only supporting this on x86 systems, if there is someone who is using this actively on ${ARCH} then I see no reason to enable it there. sean From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 02:32:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 957FD98; Sat, 17 May 2014 02:32: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 812CC21E4; Sat, 17 May 2014 02:32: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 s4H2WmCZ011460; Sat, 17 May 2014 02:32:48 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H2Wlxx011451; Sat, 17 May 2014 02:32:47 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405170232.s4H2Wlxx011451@svn.freebsd.org> From: Bryan Drewery Date: Sat, 17 May 2014 02:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266279 - in stable/10: bin/ps rescue/rescue X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 02:32:48 -0000 Author: bdrewery Date: Sat May 17 02:32:47 2014 New Revision: 266279 URL: http://svnweb.freebsd.org/changeset/base/266279 Log: MFC r265229,r265239: Add -J to filter by matching jail IDs and names. Modified: stable/10/bin/ps/Makefile stable/10/bin/ps/ps.1 stable/10/bin/ps/ps.c stable/10/rescue/rescue/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ps/Makefile ============================================================================== --- stable/10/bin/ps/Makefile Sat May 17 01:47:06 2014 (r266278) +++ stable/10/bin/ps/Makefile Sat May 17 02:32:47 2014 (r266279) @@ -11,7 +11,7 @@ SRCS= fmt.c keyword.c nlist.c print.c ps # on large systems. # CFLAGS+=-DLAZY_PS -DPADD= ${LIBM} ${LIBKVM} -LDADD= -lm -lkvm +DPADD= ${LIBM} ${LIBKVM} ${LIBJAIL} +LDADD= -lm -lkvm -ljail .include Modified: stable/10/bin/ps/ps.1 ============================================================================== --- stable/10/bin/ps/ps.1 Sat May 17 01:47:06 2014 (r266278) +++ stable/10/bin/ps/ps.1 Sat May 17 02:32:47 2014 (r266279) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 15, 2013 +.Dd May 2, 2014 .Dt PS 1 .Os .Sh NAME @@ -40,6 +40,7 @@ .Op Fl aCcdefHhjlmrSTuvwXxZ .Op Fl O Ar fmt | Fl o Ar fmt .Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ... +.Op Fl J Ar jid Ns Op , Ns Ar jid Ns Ar ... .Op Fl M Ar core .Op Fl N Ar system .Op Fl p Ar pid Ns Op , Ns Ar pid Ns Ar ... @@ -62,7 +63,7 @@ will also display processes that do not .Pp A different set of processes can be selected for display by using any combination of the -.Fl a , G , p , T , t , +.Fl a , G , J , p , T , t , and .Fl U options. @@ -152,6 +153,20 @@ Print information associated with the fo .Cm user , pid , ppid , pgid , sid , jobc , state , tt , time , and .Cm command . +.It Fl J +Display information about processes which match the specified jail IDs. +This may be either the +.Cm jid +or +.Cm name +of the jail. +Use +.Fl J +.Sy 0 +to display only host processes. +This flag implies +.Fl x +by default. .It Fl L List the set of keywords available for the .Fl O Modified: stable/10/bin/ps/ps.c ============================================================================== --- stable/10/bin/ps/ps.c Sat May 17 01:47:06 2014 (r266278) +++ stable/10/bin/ps/ps.c Sat May 17 02:32:47 2014 (r266279) @@ -50,6 +50,7 @@ static char sccsid[] = "@(#)ps.c 8.4 (Be __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -124,6 +126,7 @@ struct listinfo { const char *lname; union { gid_t *gids; + int *jids; pid_t *pids; dev_t *ttys; uid_t *uids; @@ -132,6 +135,7 @@ struct listinfo { }; static int addelem_gid(struct listinfo *, const char *); +static int addelem_jid(struct listinfo *, const char *); static int addelem_pid(struct listinfo *, const char *); static int addelem_tty(struct listinfo *, const char *); static int addelem_uid(struct listinfo *, const char *); @@ -163,12 +167,12 @@ static char vfmt[] = "pid,state,time,sl, "%cpu,%mem,command"; static char Zfmt[] = "label"; -#define PS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ" +#define PS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ" int main(int argc, char *argv[]) { - struct listinfo gidlist, pgrplist, pidlist; + struct listinfo gidlist, jidlist, pgrplist, pidlist; struct listinfo ruidlist, sesslist, ttylist, uidlist; struct kinfo_proc *kp; KINFO *kinfo = NULL, *next_KINFO; @@ -208,6 +212,7 @@ main(int argc, char *argv[]) prtheader = showthreads = wflag = xkeep_implied = 0; xkeep = -1; /* Neither -x nor -X. */ init_list(&gidlist, addelem_gid, sizeof(gid_t), "group"); + init_list(&jidlist, addelem_jid, sizeof(int), "jail id"); init_list(&pgrplist, addelem_pid, sizeof(pid_t), "process group"); init_list(&pidlist, addelem_pid, sizeof(pid_t), "process id"); init_list(&ruidlist, addelem_uid, sizeof(uid_t), "ruser"); @@ -275,6 +280,11 @@ main(int argc, char *argv[]) case 'h': prtheader = ws.ws_row > 5 ? ws.ws_row : 22; break; + case 'J': + add_list(&jidlist, optarg); + xkeep_implied = 1; + nselectors++; + break; case 'j': parsefmt(jfmt, 0); _fmt = 1; @@ -538,6 +548,11 @@ main(int argc, char *argv[]) if (kp->ki_rgid == gidlist.l.gids[elem]) goto keepit; } + if (jidlist.count > 0) { + for (elem = 0; elem < jidlist.count; elem++) + if (kp->ki_jid == jidlist.l.jids[elem]) + goto keepit; + } if (pgrplist.count > 0) { for (elem = 0; elem < pgrplist.count; elem++) if (kp->ki_pgid == @@ -666,6 +681,7 @@ main(int argc, char *argv[]) } } free_list(&gidlist); + free_list(&jidlist); free_list(&pidlist); free_list(&pgrplist); free_list(&ruidlist); @@ -727,6 +743,30 @@ addelem_gid(struct listinfo *inf, const } static int +addelem_jid(struct listinfo *inf, const char *elem) +{ + int tempid; + + if (*elem == '\0') { + warnx("Invalid (zero-length) jail id"); + optfatal = 1; + return (0); /* Do not add this value. */ + } + + tempid = jail_getid(elem); + if (tempid < 0) { + warnx("Invalid %s: %s", inf->lname, elem); + optfatal = 1; + return (0); + } + + if (inf->count >= inf->maxcount) + expand_list(inf); + inf->l.jids[(inf->count)++] = tempid; + return (1); +} + +static int addelem_pid(struct listinfo *inf, const char *elem) { char *endp; @@ -1373,7 +1413,7 @@ usage(void) (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]", - " [-M core] [-N system]", + " [-J jid[,jid...]] [-M core] [-N system]", " [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]", " ps [-L]"); exit(1); Modified: stable/10/rescue/rescue/Makefile ============================================================================== --- stable/10/rescue/rescue/Makefile Sat May 17 01:47:06 2014 (r266278) +++ stable/10/rescue/rescue/Makefile Sat May 17 02:32:47 2014 (r266279) @@ -52,7 +52,7 @@ CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv \ pkill ps pwd realpath rm rmdir setfacl sh stty sync test -CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil +CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcap -lutil CRUNCH_BUILDTOOLS+= bin/sh # Additional options for specific programs @@ -123,7 +123,7 @@ CRUNCH_LIBS+= -lalias -lcam -lcurses -ld CRUNCH_LIBS+= -lipx .endif .if ${MK_ZFS} != "no" -CRUNCH_LIBS+= -lavl -ljail -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem +CRUNCH_LIBS+= -lavl -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem .endif CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 02:39:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 89168287; Sat, 17 May 2014 02:39: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 69DBB2226; Sat, 17 May 2014 02:39: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 s4H2dMib012336; Sat, 17 May 2014 02:39:22 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H2dLCe012327; Sat, 17 May 2014 02:39:21 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405170239.s4H2dLCe012327@svn.freebsd.org> From: Bryan Drewery Date: Sat, 17 May 2014 02:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266280 - in stable/10: contrib/top usr.bin/top X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 02:39:22 -0000 Author: bdrewery Date: Sat May 17 02:39:20 2014 New Revision: 266280 URL: http://svnweb.freebsd.org/changeset/base/266280 Log: MFC r265249,r265250,r265251: - Add -J command/flag to filter by jail name/jid. This will automatically display the JID as well (the -j command/flag). - Add a hint for 'u' and 'J' command that '+' displays all. - Add J command to help. Modified: stable/10/contrib/top/commands.c stable/10/contrib/top/machine.h stable/10/contrib/top/top.X stable/10/contrib/top/top.c stable/10/usr.bin/top/Makefile stable/10/usr.bin/top/machine.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/top/commands.c ============================================================================== --- stable/10/contrib/top/commands.c Sat May 17 02:32:47 2014 (r266279) +++ stable/10/contrib/top/commands.c Sat May 17 02:39:20 2014 (r266280) @@ -74,6 +74,7 @@ e - list errors generated by last H - toggle the displaying of threads\n\ i or I - toggle the displaying of idle processes\n\ j - toggle the displaying of jail ID\n\ +J - display processes for only one jail (+ selects all jails)\n\ k - kill processes; send a signal to a list of processes\n\ m - toggle the display between 'cpu' and 'io' modes\n\ n or # - change number of processes to display\n", stdout); Modified: stable/10/contrib/top/machine.h ============================================================================== --- stable/10/contrib/top/machine.h Sat May 17 02:32:47 2014 (r266279) +++ stable/10/contrib/top/machine.h Sat May 17 02:39:20 2014 (r266280) @@ -66,6 +66,7 @@ struct process_select int thread; /* show threads */ int uid; /* only this uid (unless uid == -1) */ int wcpu; /* show weighted cpu */ + int jid; /* only this jid (unless jid == -1) */ int jail; /* show jail ID */ int kidle; /* show per-CPU idle threads */ char *command; /* only this command (unless == NULL) */ Modified: stable/10/contrib/top/top.X ============================================================================== --- stable/10/contrib/top/top.X Sat May 17 02:32:47 2014 (r266279) +++ stable/10/contrib/top/top.X Sat May 17 02:39:20 2014 (r266280) @@ -20,6 +20,8 @@ top \- display and update information ab ] [ .BI \-s time ] [ +.BI \-J jail +] [ .BI \-U username ] [ .I number @@ -171,6 +173,21 @@ values are \*(lqcpu\*(rq, \*(lqsize\*(rq but may vary on different operating systems. Note that not all operating systems support this option. .TP +.BI \-J jail +Show only those processes owned by +.IR jail . +This may be either the +.B jid +or +.B name +of the jail. +Use +.B 0 +to limit to host processes. +Using this option implies the +.B \-j +flag. +.PP .BI \-U username Show only those processes owned by .IR username . @@ -315,6 +332,12 @@ Toggle the display of .IR jail (8) ID. .TP +.B J +Display only processes owned by a specific jail (prompt for jail). +If the jail specified is simply \*(lq+\*(rq, then processes belonging +to all jails and the host will be displayed. +This will also enable the display of JID. +.TP .B P Toggle the display of per-CPU statistics. .TP Modified: stable/10/contrib/top/top.c ============================================================================== --- stable/10/contrib/top/top.c Sat May 17 02:32:47 2014 (r266279) +++ stable/10/contrib/top/top.c Sat May 17 02:39:20 2014 (r266280) @@ -38,7 +38,9 @@ char *copyright = #include #include #include +#include #include +#include /* includes specific to top */ #include "display.h" /* interface to display package */ @@ -198,9 +200,9 @@ char *argv[]; fd_set readfds; #ifdef ORDER - static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPo"; + static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJo"; #else - static char command_chars[] = "\f qh?en#sdkriIutHmSCajzP"; + static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJ"; #endif /* these defines enumerate the "strchr"s of the commands in command_chars */ #define CMD_redraw 0 @@ -228,8 +230,9 @@ char *argv[]; #define CMD_jidtog 21 #define CMD_kidletog 22 #define CMD_pcputog 23 +#define CMD_jail 24 #ifdef ORDER -#define CMD_order 24 +#define CMD_order 25 #endif /* set the buffer for stdout */ @@ -261,6 +264,7 @@ char *argv[]; ps.uid = -1; ps.thread = No; ps.wcpu = 1; + ps.jid = -1; ps.jail = No; ps.kidle = Yes; ps.command = NULL; @@ -288,7 +292,7 @@ char *argv[]; optind = 1; } - while ((i = getopt(ac, av, "CSIHPabijnquvzs:d:U:m:o:t")) != EOF) + while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:t")) != EOF) { switch(i) { @@ -413,6 +417,15 @@ char *argv[]; ps.jail = !ps.jail; break; + case 'J': /* display only jail's processes */ + if ((ps.jid = jail_getid(optarg)) == -1) + { + fprintf(stderr, "%s: unknown jail\n", optarg); + exit(1); + } + ps.jail = 1; + break; + case 'P': pcpu_stats = !pcpu_stats; break; @@ -425,7 +438,7 @@ char *argv[]; fprintf(stderr, "Top version %s\n" "Usage: %s [-abCHIijnPqStuvz] [-d count] [-m io | cpu] [-o field] [-s time]\n" -" [-U username] [number]\n", +" [-J jail] [-U username] [number]\n", version_string(), myname); exit(1); } @@ -994,7 +1007,7 @@ restart: case CMD_user: new_message(MT_standout, - "Username to show: "); + "Username to show (+ for all): "); if (readline(tempbuf2, sizeof(tempbuf2), No) > 0) { if (tempbuf2[0] == '+' && @@ -1085,6 +1098,44 @@ restart: reset_display(); putchar('\r'); break; + + case CMD_jail: + new_message(MT_standout, + "Jail to show (+ for all): "); + if (readline(tempbuf2, sizeof(tempbuf2), No) > 0) + { + if (tempbuf2[0] == '+' && + tempbuf2[1] == '\0') + { + ps.jid = -1; + } + else if ((i = jail_getid(tempbuf2)) == -1) + { + new_message(MT_standout, + " %s: unknown jail", tempbuf2); + no_command = Yes; + } + else + { + ps.jid = i; + } + if (ps.jail == 0) { + ps.jail = 1; + new_message(MT_standout | + MT_delayed, " Displaying jail " + "ID."); + header_text = + format_header(uname_field); + reset_display(); + } + putchar('\r'); + } + else + { + clear_message(); + } + break; + case CMD_kidletog: ps.kidle = !ps.kidle; new_message(MT_standout | MT_delayed, Modified: stable/10/usr.bin/top/Makefile ============================================================================== --- stable/10/usr.bin/top/Makefile Sat May 17 02:32:47 2014 (r266279) +++ stable/10/usr.bin/top/Makefile Sat May 17 02:39:20 2014 (r266280) @@ -21,8 +21,8 @@ WARNS?= 0 CFLAGS+= -D"Table_size=${TOP_TABLE_SIZE}" .endif -DPADD= ${LIBTERMCAP} ${LIBM} ${LIBKVM} -LDADD= -ltermcap -lm -lkvm +DPADD= ${LIBTERMCAP} ${LIBM} ${LIBKVM} ${LIBJAIL} +LDADD= -ltermcap -lm -lkvm -ljail CLEANFILES= sigdesc.h SIGCONV_AWK= ${.CURDIR}/../../contrib/top/sigconv.awk Modified: stable/10/usr.bin/top/machine.c ============================================================================== --- stable/10/usr.bin/top/machine.c Sat May 17 02:32:47 2014 (r266279) +++ stable/10/usr.bin/top/machine.c Sat May 17 02:39:20 2014 (r266280) @@ -668,6 +668,7 @@ get_process_info(struct system_info *si, /* these are copied out of sel for speed */ int show_idle; + int show_jid; int show_self; int show_system; int show_uid; @@ -710,6 +711,7 @@ get_process_info(struct system_info *si, /* set up flags which define what we are going to select */ show_idle = sel->idle; + show_jid = sel->jid != -1; show_self = sel->self == -1; show_system = sel->system; show_uid = sel->uid != -1; @@ -764,6 +766,10 @@ get_process_info(struct system_info *si, /* skip processes that aren't doing I/O */ continue; + if (show_jid && pp->ki_jid != sel->jid) + /* skip proc. that don't belong to the selected JID */ + continue; + if (show_uid && pp->ki_ruid != (uid_t)sel->uid) /* skip proc. that don't belong to the selected UID */ continue; From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 02:45:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C2B40759; Sat, 17 May 2014 02:45: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 AEFD422CB; Sat, 17 May 2014 02:45: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 s4H2jxjs018190; Sat, 17 May 2014 02:45:59 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H2jxLw018189; Sat, 17 May 2014 02:45:59 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405170245.s4H2jxLw018189@svn.freebsd.org> From: Bryan Drewery Date: Sat, 17 May 2014 02:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266282 - stable/10/usr.bin/top X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 02:45:59 -0000 Author: bdrewery Date: Sat May 17 02:45:59 2014 New Revision: 266282 URL: http://svnweb.freebsd.org/changeset/base/266282 Log: MFC r265267: Fix width/alignment of JID column. Make it support up to the maximum 7-wide JIDs. On a system using jails for common tasks the JID can quickly increase. Modified: stable/10/usr.bin/top/machine.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/top/machine.c ============================================================================== --- stable/10/usr.bin/top/machine.c Sat May 17 02:45:04 2014 (r266281) +++ stable/10/usr.bin/top/machine.c Sat May 17 02:45:59 2014 (r266282) @@ -67,6 +67,9 @@ static int namelength = TOP_USERNAME_LEN #else static int namelength = 8; #endif +/* TOP_JID_LEN based on max of 999999 */ +#define TOP_JID_LEN 7 +static int jidlength; static int cmdlengthdelta; /* Prototypes for top internals */ @@ -101,26 +104,26 @@ struct handle { */ static char io_header[] = - " PID%s %-*.*s VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND"; + " PID%*s %-*.*s VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND"; #define io_Proc_format \ - "%5d%s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s" + "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s" static char smp_header_thr[] = - " PID%s %-*.*s THR PRI NICE SIZE RES STATE C TIME %7s COMMAND"; + " PID%*s %-*.*s THR PRI NICE SIZE RES STATE C TIME %7s COMMAND"; static char smp_header[] = - " PID%s %-*.*s " "PRI NICE SIZE RES STATE C TIME %7s COMMAND"; + " PID%*s %-*.*s " "PRI NICE SIZE RES STATE C TIME %7s COMMAND"; #define smp_Proc_format \ - "%5d%s %-*.*s %s%3d %4s%7s %6s %-6.6s %2d%7s %6.2f%% %.*s" + "%5d%*s %-*.*s %s%3d %4s%7s %6s %-6.6s %2d%7s %6.2f%% %.*s" static char up_header_thr[] = - " PID%s %-*.*s THR PRI NICE SIZE RES STATE TIME %7s COMMAND"; + " PID%*s %-*.*s THR PRI NICE SIZE RES STATE TIME %7s COMMAND"; static char up_header[] = - " PID%s %-*.*s " "PRI NICE SIZE RES STATE TIME %7s COMMAND"; + " PID%*s %-*.*s " "PRI NICE SIZE RES STATE TIME %7s COMMAND"; #define up_Proc_format \ - "%5d%s %-*.*s %s%3d %4s%7s %6s %-6.6s%.0d%7s %6.2f%% %.*s" + "%5d%*s %-*.*s %s%3d %4s%7s %6s %-6.6s%.0d%7s %6.2f%% %.*s" /* process state names for the "STATE" column of the display */ @@ -393,6 +396,11 @@ format_header(char *uname_field) { static char Header[128]; const char *prehead; + + if (ps.jail) + jidlength = TOP_JID_LEN + 1; /* +1 for extra left space. */ + else + jidlength = 0; switch (displaymode) { case DISP_CPU: @@ -406,14 +414,14 @@ format_header(char *uname_field) (ps.thread ? smp_header : smp_header_thr) : (ps.thread ? up_header : up_header_thr); snprintf(Header, sizeof(Header), prehead, - ps.jail ? " JID" : "", + jidlength, ps.jail ? " JID" : "", namelength, namelength, uname_field, ps.wcpu ? "WCPU" : "CPU"); break; case DISP_IO: prehead = io_header; snprintf(Header, sizeof(Header), prehead, - ps.jail ? " JID" : "", + jidlength, ps.jail ? " JID" : "", namelength, namelength, uname_field); break; } @@ -806,7 +814,7 @@ format_next_process(caddr_t handle, char int cpu, state; struct rusage ru, *rup; long p_tot, s_tot; - char *proc_fmt, thr_buf[6], jid_buf[6]; + char *proc_fmt, thr_buf[6], jid_buf[TOP_JID_LEN + 1]; char *cmdbuf = NULL; char **args; const int cmdlen = 128; @@ -962,8 +970,8 @@ format_next_process(caddr_t handle, char if (ps.jail == 0) jid_buf[0] = '\0'; else - snprintf(jid_buf, sizeof(jid_buf), " %*d", - sizeof(jid_buf) - 3, pp->ki_jid); + snprintf(jid_buf, sizeof(jid_buf), "%*d", + jidlength - 1, pp->ki_jid); if (displaymode == DISP_IO) { oldp = get_old_proc(pp); @@ -984,7 +992,7 @@ format_next_process(caddr_t handle, char snprintf(fmt, sizeof(fmt), io_Proc_format, pp->ki_pid, - jid_buf, + jidlength, jid_buf, namelength, namelength, (*get_userid)(pp->ki_ruid), rup->ru_nvcsw, rup->ru_nivcsw, @@ -1019,7 +1027,7 @@ format_next_process(caddr_t handle, char snprintf(fmt, sizeof(fmt), proc_fmt, pp->ki_pid, - jid_buf, + jidlength, jid_buf, namelength, namelength, (*get_userid)(pp->ki_ruid), thr_buf, pp->ki_pri.pri_level - PZERO, From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 03:28:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6A0B59D9; Sat, 17 May 2014 03:28: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 54F9526C4; Sat, 17 May 2014 03:28: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 s4H3SjAP044720; Sat, 17 May 2014 03:28:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H3SiWe044702; Sat, 17 May 2014 03:28:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201405170328.s4H3SiWe044702@svn.freebsd.org> From: Devin Teske Date: Sat, 17 May 2014 03:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266290 - in stable/10/usr.sbin/bsdconfig: dot examples networking/share share share/media share/packages X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 03:28:45 -0000 Author: dteske Date: Sat May 17 03:28:43 2014 New Revision: 266290 URL: http://svnweb.freebsd.org/changeset/base/266290 Log: MFC r264840: Implement GEOM based media device classification. Added: stable/10/usr.sbin/bsdconfig/share/geom.subr - copied unchanged from r264840, head/usr.sbin/bsdconfig/share/geom.subr Modified: stable/10/usr.sbin/bsdconfig/dot/dot stable/10/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh stable/10/usr.sbin/bsdconfig/examples/browse_packages_http.sh stable/10/usr.sbin/bsdconfig/networking/share/device.subr stable/10/usr.sbin/bsdconfig/share/Makefile stable/10/usr.sbin/bsdconfig/share/common.subr stable/10/usr.sbin/bsdconfig/share/device.subr stable/10/usr.sbin/bsdconfig/share/media/cdrom.subr stable/10/usr.sbin/bsdconfig/share/media/common.subr stable/10/usr.sbin/bsdconfig/share/media/directory.subr stable/10/usr.sbin/bsdconfig/share/media/dos.subr stable/10/usr.sbin/bsdconfig/share/media/floppy.subr stable/10/usr.sbin/bsdconfig/share/media/ftp.subr stable/10/usr.sbin/bsdconfig/share/media/http.subr stable/10/usr.sbin/bsdconfig/share/media/nfs.subr stable/10/usr.sbin/bsdconfig/share/media/tcpip.subr stable/10/usr.sbin/bsdconfig/share/media/ufs.subr stable/10/usr.sbin/bsdconfig/share/media/usb.subr stable/10/usr.sbin/bsdconfig/share/packages/index.subr stable/10/usr.sbin/bsdconfig/share/packages/packages.subr stable/10/usr.sbin/bsdconfig/share/struct.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/dot/dot ============================================================================== --- stable/10/usr.sbin/bsdconfig/dot/dot Sat May 17 03:28:27 2014 (r266289) +++ stable/10/usr.sbin/bsdconfig/dot/dot Sat May 17 03:28:43 2014 (r266290) @@ -29,7 +29,7 @@ ############################################################ INCLUDES # Prevent common.subr from auto initializing debugging (this is not an inter- -# active utility that requires debugging; also `-d' has been repurposed). +# active utility so does not require debugging; also `-d' has been repurposed). # DEBUG_SELF_INITIALIZE=NO Modified: stable/10/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh ============================================================================== --- stable/10/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh Sat May 17 03:28:27 2014 (r266289) +++ stable/10/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh Sat May 17 03:28:43 2014 (r266290) @@ -18,7 +18,7 @@ if [ ! -e "$TMPDIR/packages/INDEX" ]; th mediaSetFTP mediaOpen f_show_info "Downloading packages/INDEX from\n %s" "$_ftpPath" - f_device_get media packages/INDEX > $TMPDIR/packages/INDEX + f_device_get device_media packages/INDEX > $TMPDIR/packages/INDEX fi _directoryPath=$TMPDIR mediaSetDirectory Modified: stable/10/usr.sbin/bsdconfig/examples/browse_packages_http.sh ============================================================================== --- stable/10/usr.sbin/bsdconfig/examples/browse_packages_http.sh Sat May 17 03:28:27 2014 (r266289) +++ stable/10/usr.sbin/bsdconfig/examples/browse_packages_http.sh Sat May 17 03:28:43 2014 (r266290) @@ -18,7 +18,7 @@ if [ ! -e "$TMPDIR/packages/INDEX" ]; th mediaSetHTTP mediaOpen f_show_info "Downloading packages/INDEX from\n %s" "$_httpPath" - f_device_get media packages/INDEX > $TMPDIR/packages/INDEX + f_device_get device_media packages/INDEX > $TMPDIR/packages/INDEX fi _directoryPath=$TMPDIR mediaSetDirectory Modified: stable/10/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/networking/share/device.subr Sat May 17 03:28:27 2014 (r266289) +++ stable/10/usr.sbin/bsdconfig/networking/share/device.subr Sat May 17 03:28:43 2014 (r266290) @@ -75,10 +75,11 @@ f_dialog_menu_netdev() # # Get list of usable network interfaces # - local devs if iflist= # Calculated below + local dev devs if iflist= # Calculated below f_device_rescan_network f_device_find "" $DEVICE_TYPE_NETWORK devs - for if in $devs; do + for dev in $devs; do + f_struct "$dev" get name if || continue # Skip unsavory interfaces case "$if" in lo[0-9]*|ppp[0-9]*|sl[0-9]*|faith[0-9]*) continue ;; Modified: stable/10/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/Makefile Sat May 17 03:28:27 2014 (r266289) +++ stable/10/usr.sbin/bsdconfig/share/Makefile Sat May 17 03:28:43 2014 (r266290) @@ -5,7 +5,7 @@ NO_OBJ= SUBDIR= media packages FILESDIR= ${SHAREDIR}/bsdconfig -FILES= common.subr device.subr dialog.subr keymap.subr \ +FILES= common.subr device.subr dialog.subr geom.subr keymap.subr \ mustberoot.subr script.subr strings.subr struct.subr \ sysrc.subr variable.subr Modified: stable/10/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/common.subr Sat May 17 03:28:27 2014 (r266289) +++ stable/10/usr.sbin/bsdconfig/share/common.subr Sat May 17 03:28:43 2014 (r266290) @@ -153,7 +153,7 @@ f_debug_init() # Process stored command-line arguments # set -- $ARGV - local OPTIND flag + local OPTIND OPTARG flag f_dprintf "f_debug_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \ "$ARGV" "$GETOPTS_STDARGS" while getopts "$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" flag \ @@ -798,14 +798,30 @@ f_running_as_init() } # f_mounted $local_directory +# f_mounted -b $device # -# Return success if a filesystem is mounted on a particular directory. +# Return success if a filesystem is mounted on a particular directory. If `-b' +# is present, instead check that the block device (or a partition thereof) is +# mounted. # f_mounted() { - local dir="$1" - [ -d "$dir" ] || return $FAILURE - mount | grep -Eq " on $dir \([^)]+\)$" + local OPTIND OPTARG flag use_device= + while getopts b flag; do + case "$flag" in + b) use_device=1 ;; + esac + done + shift $(( $OPTIND - 1 )) + if [ "$use_device" ]; then + local device="$1" + mount | grep -Eq \ + "^$device([[:space:]]|p[0-9]|s[0-9]|\.nop|\.eli)" + else + [ -d "$dir" ] || return $FAILURE + mount | grep -Eq " on $dir \([^)]+\)$" + fi + # Return status is that of last grep(1) } # f_eval_catch [-de] [-k $var_to_set] $funcname $utility \ @@ -890,7 +906,7 @@ f_eval_catch() # # Process local function arguments # - local OPTIND __flag + local OPTIND OPTARG __flag while getopts "dek:" __flag > /dev/null; do case "$__flag" in d) __no_dialog=1 ;; Modified: stable/10/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/device.subr Sat May 17 03:28:27 2014 (r266289) +++ stable/10/usr.sbin/bsdconfig/share/device.subr Sat May 17 03:28:43 2014 (r266290) @@ -32,6 +32,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." device.subr f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/geom.subr f_include $BSDCFG_SHARE/strings.subr f_include $BSDCFG_SHARE/struct.subr @@ -40,42 +41,53 @@ f_include_lang $BSDCFG_LIBE/include/mess ############################################################ GLOBALS -DEVICES= -DEVICE_NAMES= -NDEVICES=0 +NDEVICES=0 # Set by f_device_register(), used by f_device_*() -# A "device" from sysinstall's point of view +# +# A "device" from legacy sysinstall's point of view (mostly) +# +# NB: Disk devices have their `private' property set to GEOM ident +# NB: USB devices have their `private' property set to USB disk device name +# f_struct_define DEVICE \ - name \ + capacity \ desc \ devname \ - type \ - capacity \ enabled \ - init \ - get \ - shutdown \ flags \ + get \ + init \ + name \ private \ + shutdown \ + type \ volume # Network devices have their `private' property set to this f_struct_define DEVICE_INFO \ - use_rtsol use_dhcp ipaddr ipv6addr netmask extras - -setvar DEVICE_TYPE_NONE 1 -setvar DEVICE_TYPE_DISK 2 -setvar DEVICE_TYPE_FLOPPY 3 -setvar DEVICE_TYPE_FTP 4 -setvar DEVICE_TYPE_NETWORK 5 -setvar DEVICE_TYPE_CDROM 6 -setvar DEVICE_TYPE_USB 7 -setvar DEVICE_TYPE_DOS 8 -setvar DEVICE_TYPE_UFS 9 -setvar DEVICE_TYPE_NFS 10 -setvar DEVICE_TYPE_ANY 11 -setvar DEVICE_TYPE_HTTP_PROXY 12 -setvar DEVICE_TYPE_HTTP 13 + extras \ + ipaddr \ + ipv6addr \ + netmask \ + use_dhcp \ + use_rtsol + +# +# Device types for f_device_register(), f_device_find(), et al. +# +setvar DEVICE_TYPE_ANY "any" # Any +setvar DEVICE_TYPE_NONE "NONE" # Unknown +setvar DEVICE_TYPE_DISK "DISK" # GEOM `DISK' +setvar DEVICE_TYPE_FLOPPY "FD" # GEOM `FD' +setvar DEVICE_TYPE_FTP "FTP" # Dynamic network device +setvar DEVICE_TYPE_NETWORK "NETWORK" # See f_device_get_all_network +setvar DEVICE_TYPE_CDROM "CDROM" # GEOM `DISK' +setvar DEVICE_TYPE_USB "USB" # GEOM `PART' +setvar DEVICE_TYPE_DOS "DOS" # GEOM `DISK' `PART' or `LABEL' +setvar DEVICE_TYPE_UFS "UFS" # GEOM `DISK' `PART' or `LABEL' +setvar DEVICE_TYPE_NFS "NFS" # Dynamic network device +setvar DEVICE_TYPE_HTTP_PROXY "HTTP_PROXY" # Dynamic network device +setvar DEVICE_TYPE_HTTP "HTTP" # Dynamic network device # Network devices have the following flags available setvar IF_ETHERNET 1 @@ -87,76 +99,70 @@ setvar IF_ACTIVE 4 # : ${DEVICE_SELF_SCAN_ALL=1} -############################################################ FUNCTIONS - -# f_device_try $name [$i [$var_path]] -# -# Test a particular device. If $i is given, then $name is expected to contain a -# single "%d" where $i will be inserted using printf. If $var_path is given, -# it is used as a variable name to provide the caller the device pathname. # -# Returns success if the device path exists and is a cdev. +# Device Catalog variables # -f_device_try() -{ - local name="$1" i="$2" var_path="$3" unit - if [ "$i" ]; then - f_sprintf unit "$name" "$i" - else - unit="$name" - fi - case "$unit" in - /dev/*) : good ;; # already qualified - *) unit="/dev/$unit" ;; - esac - [ "$var_path" ] && setvar "$var_path" "$unit" - f_dprintf "f_device_try: making sure %s is a device node" "$unit" - if [ -c "$unit" ]; then - f_dprintf "f_device_try: %s is a cdev [good]" "$unit" - return $SUCCESS - else - f_dprintf "f_device_try: %s is not a cdev [skip]" "$unit" - return $FAILURE - fi -} +DEVICE_CATALOG_APPEND_ONLY= # Used by f_device_catalog_set() +NCATALOG_DEVICES=0 # Used by f_device_catalog_*() and MAIN -# f_device_register $name $desc $devname $type $enabled $init_function \ -# $get_function $shutdown_function $private $capacity # -# Register a device. A `structure' (see struct.subr) is created with the name -# device_$name (so make sure $name contains only alpha-numeric characters or -# the underscore, `_'). The remaining arguments after $name correspond to the -# properties of the `DEVICE' structure-type (defined above). +# A ``catalog'' device is for mapping GEOM devices to media devices (for +# example, determining if a $GEOM_CLASS_DISK geom is $DEVICE_TYPE_CDROM or +# $DEVICE_TYPE_DISK) and also getting default descriptions for devices that +# either lack a GEOM provided description or lack a presence in GEOM) # -# If not already registered, the device is then appended to the DEVICES -# environment variable, a space-separated list of all registered devices. +f_struct_define CATALOG_DEVICE \ + desc \ + name \ + type + +############################################################ FUNCTIONS + +# f_device_register $var_to_set $name $desc $devname $type $enabled +# $init_function $get_function $shutdown_function +# $private $capacity +# +# Register a device. A `structure' (see struct.subr) is created and if +# $var_to_set is non-NULL, upon success holds the name of the struct created. +# The remaining positional arguments correspond to the properties of the +# `DEVICE' structure-type to be assigned (defined above). +# +# If not already registered (based on $name and $type), a new device is created +# and $NDEVICES is incremented. # f_device_register() { - local name="$1" desc="$2" devname="$3" type="$4" enabled="$5" - local init_func="$6" get_func="$7" shutdown_func="$8" private="$9" - local capacity="${10}" - - f_struct_new DEVICE "device_$name" || return $FAILURE - device_$name set name "$name" - device_$name set desc "$desc" - device_$name set devname "$devname" - device_$name set type "$type" - device_$name set enabled "$enabled" - device_$name set init "$init_func" - device_$name set get "$get_func" - device_$name set shutdown "$shutdown_func" - device_$name set private "$private" - device_$name set capacity "$capacity" - - # Scan our global register to see if it needs ammending - local dev found= - for dev in $DEVICES; do - [ "$dev" = "$name" ] || continue - found=1 && break - done - [ "$found" ] || DEVICES="$DEVICES $name" + local __var_to_set="$1" __name="$2" __desc="$3" __devname="$4" + local __type="$5" __enabled="$6" __init_func="$7" __get_func="$8" + local __shutdown_func="$9" __private="${10}" __capacity="${11}" + # Required parameter(s) + [ "$__name" ] || return $FAILURE + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" "" || return $FAILURE + fi + + local __device + if f_device_find -1 "$__name" "$__type" __device; then + f_struct_free "$__device" + f_struct_new DEVICE "$__device" || return $FAILURE + else + __device=device_$(( NDEVICES + 1 )) + f_struct_new DEVICE "$__device" || return $FAILURE + NDEVICES=$(( $NDEVICES + 1 )) + fi + $__device set name "$__name" + $__device set desc "$__desc" + $__device set devname "$__devname" + $__device set type "$__type" + $__device set enabled "$__enabled" + $__device set init "$__init_func" + $__device set get "$__get_func" + $__device set shutdown "$__shutdown_func" + $__device set private "$__private" + $__device set capacity "$__capacity" + + [ "$__var_to_set" ] && setvar "$__var_to_set" "$__device" return $SUCCESS } @@ -166,18 +172,21 @@ f_device_register() # f_device_reset() { - local dev - for dev in $DEVICES; do - f_device_shutdown $dev + local n=1 + while [ $n -le $NDEVICES ]; do + f_device_shutdown device_$n + # # XXX This potentially leaks $dev->private if it's being # used to point to something dynamic, but you're not supposed # to call this routine at such times that some open instance # has its private member pointing somewhere anyway. # - f_struct_free device_$dev + f_struct_free device_$n + + n=$(( $n + 1 )) done - DEVICES= + NDEVICES=0 } # f_device_reset_network @@ -186,34 +195,45 @@ f_device_reset() # f_device_reset_network() { - local dev type private pruned_list= - for dev in $DEVICES; do - device_$dev get type type - if [ "$type" != "$DEVICE_TYPE_NETWORK" ]; then - pruned_list="$pruned_list $dev" - continue - fi + local n=1 device type private i + while [ $n -le $NDEVICES ]; do + device=device_$n + f_struct $device || continue + $device get type type + [ "$type" = "$DEVICE_TYPE_NETWORK" ] || continue # # Leave the device up (don't call shutdown routine) # # Network devices may have DEVICE_INFO private member - device_$dev get private private + $device get private private [ "$private" ] && f_struct_free "$private" - f_struct_free device_$dev + # Free the network device + f_struct_free $device + + # Fill the gap we just created + i=$n + while [ $i -lt $NDEVICES ]; do + f_struct_copy device_$(( $i + 1 )) device_$i + done + f_struct_free device_$NDEVICES + + # Finally decrement the number of devices + NDEVICES=$(( $NDEVICES - 1 )) + + n=$(( $n + 1 )) done - DEVICES="${pruned_list# }" } # f_device_get_all # -# Get all device information for devices we have attached. +# Get all device information for all devices. # f_device_get_all() { - local devname desc capacity + local devname type desc capacity f_dprintf "f_device_get_all: Probing devices..." f_dialog_info "$msg_probing_devices_please_wait_this_can_take_a_while" @@ -221,180 +241,16 @@ f_device_get_all() # First go for the network interfaces f_device_get_all_network - # Next, try to find all the types of devices one might use - # as a media source for content - # - - local dev type max n=0 - for dev in $DEVICE_NAMES; do - n=$(( $n + 1 )) - # Get the desc, type, and max (with debugging disabled) - # NOTE: Bypassing f_device_name_get() for efficiency - # ASIDE: This would be equivalent to the following: - # debug= f_device_name_get $dev desc - # debug= f_device_name_get $dev type - # debug= f_device_name_get $dev max - debug= f_getvar _device_desc$n desc - debug= f_getvar _device_type$n type - debug= f_getvar _device_max$n max - - local k=0 - while [ $k -lt ${max:-0} ]; do - i=$k k=$(( $k + 1 )) - devname="" - case "$type" in - $DEVICE_TYPE_CDROM) - f_device_try "$dev" "$i" devname || continue - f_device_capacity "$devname" capacity - f_device_register "${devname##*/}" "$desc" \ - "$devname" $DEVICE_TYPE_CDROM 1 \ - f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" "$capacity" - f_dprintf "Found a CDROM device for %s" \ - "$devname" - ;; - $DEVICE_TYPE_FLOPPY) - f_device_try "$dev" "$i" devname || continue - f_device_capacity "$devname" capacity - f_device_register "${devname##*/}" "$desc" \ - "$devname" $DEVICE_TYPE_FLOPPY 1 \ - f_media_init_floppy \ - f_media_get_floppy \ - f_media_shutdown_floppy "" "$capacity" - f_dprintf "Found a floppy device for %s" \ - "$devname" - ;; - $DEVICE_TYPE_USB) - f_device_try "$dev" "$i" devname || continue - f_device_capacity "$devname" capacity - f_device_register "${devname##*/}" "$desc" \ - "$devname" $DEVICE_TYPE_USB 1 \ - f_media_init_usb f_media_get_usb \ - f_media_shutdown_usb "" "$capacity" - f_dprintf "Found a USB disk for %s" "$devname" - ;; - esac - done - done - - # Register ISO9660 providers as CDROM devices - for devname in /dev/iso9660/*; do - f_device_try "$devname" || continue - f_device_capacity "$devname" capacity - f_device_register "${devname##*/}" "ISO9660 file system" \ - "$devname" $DEVICE_TYPE_CDROM 1 \ - f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" "$capacity" - f_dprintf "Found a CDROM device for %s" "$devname" - done - - # Scan for mdconfig(8)-created md(4) devices - local filename - for devname in /dev/md[0-9] /dev/md[0-9][0-9]; do - f_device_try "$devname" || continue - - # See if the md(4) device is a vnode type backed by a file - filename=$( sysctl kern.geom.conftxt | - awk -v devname="${devname##*/}" \ - ' - ( $2 == "MD" ) && \ - ( $3 == devname ) && \ - ( $(NF-2) == "vnode" ) && \ - ( $(NF-1) == "file" ) \ - { - print $NF - } - ' ) - case "$filename" in - *.iso) # Register the device as an ISO9660 provider - f_device_capacity "$devname" capacity - f_device_register "${devname##*/}" \ - "md(4) vnode file system" \ - "$devname" $DEVICE_TYPE_CDROM 1 \ - f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" "$capacity" - f_dprintf "Found a CDROM device for %s" "$devname" - ;; - esac - done - - # Finally go get the disks and look for partitions to register - local diskname slices index type rest slice part - for diskname in $( sysctl -n kern.disks ); do - - case "$diskname" in - cd*) - # XXX Due to unknown reasons, kern.disks returns SCSI - # CDROM as a valid disk. This will prevent bsdconfig - # from presenting SCSI CDROMs as available disks in - # various menus. Why GEOM treats SCSI CDROM as a disk - # is beyond me and that should be investigated. - # For temporary workaround, ignore SCSI CDROM device. - # - continue ;; - esac - - # Try to create a list of partitions and their types, - # consisting of "N,typeN ..." (e.g., "1,0xa5 2,0x06"). - if ! slices=$( fdisk -p "$diskname" 2> /dev/null | - awk '( $1 == "p" ) { print $2","$3 }' ) - then - f_dprintf "Unable to open disk %s" "$diskname" - continue + # Next, go for the GEOM devices we might want to use as media + local geom geoms geom_name + debug= f_geom_find "" $GEOM_CLASS_DEV geoms + for geom in $geoms; do + if ! f_device_probe_geom $geom; then + debug= $geom get name geom_name + f_dprintf "WARNING! Unable to classify %s as %s" \ + "GEOM device $geom_name" "media source" fi - - # Try and find its description - f_device_desc "$diskname" $DEVICE_TYPE_DISK desc - - f_device_capacity "$diskname" capacity - f_device_register "$diskname" "$desc" \ - "/dev/$diskname" $DEVICE_TYPE_DISK 0 \ - "" "" "" "" "$capacity" - f_dprintf "Found a disk device named %s" "$diskname" - - # Look for existing partitions to register - for slice in $slices; do - index="${slice%%,*}" type="${slice#*,}" - slice=${diskname}s$index - case "$type" in - 0x01|0x04|0x06|0x0b|0x0c|0x0e|0xef) - # DOS partitions to add as "DOS media devices" - f_device_capacity "/dev/$slice" capacity - f_device_register "$slice" "" \ - "/dev/$slice" $DEVICE_TYPE_DOS 1 \ - f_media_init_dos f_media_get_dos \ - f_media_shutdown_dos "" "$capacity" - f_dprintf "Found a DOS partition %s" "$slice" - ;; - 0xa5) # FreeBSD partition - for part in $( - bsdlabel -r $slice 2> /dev/null | - awk -v slice="$slice" ' - ( $1 ~ /[abdefgh]:/ ) { - printf "%s%s\n", - slice, - substr($1,1,1) - }' - ); do - f_quietly dumpfs -m /dev/$part || - continue - f_device_capacity \ - "$/dev/$part" capacity - f_device_register \ - "$part" "" "/dev/$part" \ - $DEVICE_TYPE_UFS 1 \ - f_media_init_ufs \ - f_media_get_ufs \ - f_media_shutdown_ufs "" \ - "$capacity" - f_dprintf "Found a UFS partition %s" \ - "$part" - done # parts - ;; - esac - done # slices - - done # disks + done } # f_device_get_all_network @@ -403,7 +259,7 @@ f_device_get_all() # f_device_get_all_network() { - local devname desc flags + local devname desc device flags for devname in $( ifconfig -l ); do # Eliminate network devices that don't make sense case "$devname" in @@ -413,9 +269,9 @@ f_device_get_all_network() # Try and find its description f_device_desc "$devname" $DEVICE_TYPE_NETWORK desc - f_dprintf "Found a network device named %s" "$devname" - f_device_register $devname \ - "$desc" "$devname" $DEVICE_TYPE_NETWORK 1 \ + f_dprintf "Found network device named %s" "$devname" + debug= f_device_register device $devname "$desc" \ + "$devname" $DEVICE_TYPE_NETWORK 1 \ f_media_init_network "" f_media_shutdown_network "" -1 # Set flags based on media and status @@ -435,37 +291,532 @@ f_device_get_all_network() if (value ~ /^active/) _or(var, "IF_ACTIVE") } }' )" - device_$devname set flags $flags + $device set flags $flags done } -# f_device_name_get $type $name type|desc|max [$var_to_set] +# f_device_rescan +# +# Rescan all devices, after closing previous set - convenience function. # -# Fetch the device type (type), description (desc), or maximum number of -# devices to scan for (max) associated with device $name and $type. If $type is -# either NULL, missing, or set to $DEVICE_TYPE_ANY then only $name is used. +f_device_rescan() +{ + f_device_reset + f_geom_rescan + f_device_get_all +} + +# f_device_rescan_network +# +# Rescan all network devices, after closing previous set - for convenience. +# +f_device_rescan_network() +{ + f_device_reset_network + f_device_get_all_network +} + +# f_device_probe_geom $geom +# +# Probe a single GEOM device and if it can be classified as a media source, +# register it using f_device_register() with known type-specific arguments. +# +f_device_probe_geom() +{ + local geom="$1" + + f_struct "$geom" || return $FAILURE + + # geom associated variables + local geom_name geom_consumer provider_ref geom_provider= + local provider_geom provider_config provider_class= + local provider_config_type catalog_struct catalog_type + local disk_ident + + # gnop(8)/geli(8) associated variables (p for `parent device') + local p_devname p_geom p_consumer p_provider_ref p_provider + local p_provider_config p_provider_geom p_provider_class + + # md(4) associated variables + local config config_type config_file magic= + + # Temporarily disable debugging to keep debug output light + local old_debug="$debug" debug= + + # + # Get the GEOM name (for use below in device registration) + # + $geom get name devname || continue + + # + # Attempt to get the consumer, provider, provider config, and + # provider class for this geom (errors ignored). + # + # NB: Each GEOM in the `DEV' class should have one consumer. + # That consumer should have a reference to its provider. + # + $geom get consumer1 geom_consumer + f_struct "$geom_consumer" get provider_ref provider_ref && + f_geom_find_by id "$provider_ref" provider geom_provider + if f_struct "$geom_provider"; then + $geom_provider get config provider_config + f_geom_parent $geom_provider provider_geom && + f_geom_parent $provider_geom provider_class + fi + + # + # Get values for device registration (errors ignored) + # + f_struct "$provider_class" get name type + f_struct "$geom_provider" get mediasize capacity + f_struct "$provider_config" get descr desc + + # + # For gnop(8), geli(8), or combination thereof, change device type to + # that of the consumer + # + p_devname= p_geom= p_provider= p_provider_config= + case "$devname" in + *.nop.eli) p_devname="${devname%.nop.eli}" ;; + *.eli.nop) p_devname="${devname%.eli.nop}" ;; + *.eli) p_devname="${devname%.eli}" ;; + *.nop) p_devname="${devname%.nop}" ;; + esac + [ "$p_devname" ] && f_geom_find "$p_devname" $GEOM_CLASS_DEV p_geom + if [ "${p_geom:-$geom}" != "$geom" ]; then + f_struct "$p_geom" get consumer1 p_consumer + f_struct "$p_consumer" get provider_ref p_provider_ref && + f_geom_find_by id "$p_provider_ref" provider p_provider + if f_struct "$p_provider"; then + $p_provider get config p_provider_config + f_geom_parent $p_provider p_provider_geom && + f_geom_parent $p_provider_geom p_provider_class + fi + f_struct "$p_provider_class" get name type + fi + + # Look up geom device in device catalog for default description + f_device_catalog_get \ + $DEVICE_TYPE_ANY "${p_devname:-$devname}" catalog_struct + [ "$desc" ] || f_struct "catalog_device_$catalog_struct" get desc desc + + # Use device catalog entry for potential re-classification(s) + f_struct "catalog_device_$catalog_struct" get type catalog_type + + # Restore debugging for this next part (device registration) + debug="$old_debug" + + # + # Register the device + # + local retval device + case "$type" in + $GEOM_CLASS_DISK) + # First attempt to classify by device catalog (see MAIN) + case "$catalog_type" in + $DEVICE_TYPE_CDROM) + f_dprintf "Found CDROM device for disk %s" "$devname" + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_CDROM 1 \ + f_media_init_cdrom f_media_get_cdrom \ + f_media_shutdown_cdrom "" "$capacity" && + return $SUCCESS + ;; + esac + + # Fall back to register label device as a disk and taste it + f_dprintf "Found disk device named %s" "$devname" + debug= f_struct "$p_provider_config" get \ + ident disk_ident || + debug= f_struct "$provider_config" get \ + ident disk_ident + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_DISK 1 \ + "" "" "" "$disk_ident" "$capacity" + retval=$? + + # Detect ``dangerously dedicated'' filesystems (errors ignored) + f_device_probe_disk_fs device "$devname" "$capacity" && + retval=$SUCCESS + + return $retval + ;; + $GEOM_CLASS_FD) + f_dprintf "Found floppy device named %s" "$devname" + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_FLOPPY 1 \ + f_media_init_floppy f_media_get_floppy \ + f_media_shutdown_floppy "" "$capacity" + return $? + ;; + $GEOM_CLASS_LABEL) + : fall through to below section # reduces indentation level + ;; + $GEOM_CLASS_MD) + f_dprintf "Found disk device named %s" "$devname" + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_DISK 1 \ + "" "" "" "" "$capacity" + retval=$? + + # + # Attempt to get file(1) magic to potentially classify as + # alternate media type. If unable to get magic, fall back to + # md(4) characteristics (such as vnode filename). + # + [ -r "/dev/$devname" ] && + magic=$( file -bs "/dev/$devname" 2> /dev/null ) + if [ ! "$magic" ]; then + # Fall back to md(4) characteristics + if f_struct "$p_provider_config"; then + config="$p_provider_config" + else + config="$provider_config" + fi + debug= f_struct "$config" get type config_type + debug= f_struct "$config" get file config_file + + # Substitute magic for below based on type and file + case "$config_type=$config_file" in + vnode=*.iso) magic="ISO 9660" ;; + esac + fi + f_device_probe_disk_fs device \ + "$devname" "$capacity" "$magic" && + retval=$SUCCESS # Errors ignored + + return $retval + ;; + $GEOM_CLASS_PART) + if f_struct "$p_provider_config"; then + config="$p_provider_config" + else + config="$provider_config" + fi + debug= f_struct "$config" get type provider_config_type + f_device_probe_geom_part device \ + "$provider_config_type" "$devname" "$capacity" + retval=$? + device_type=$DEVICE_TYPE_NONE + [ $retval -eq $SUCCESS ] && + debug= f_struct "$device" get type device_type + + # Potentially re-classify as USB device + if [ "$device_type" = "$DEVICE_TYPE_UFS" -a \ + "$catalog_type" = "$DEVICE_TYPE_USB" ] + then + f_dprintf "Found USB device for partition %s" \ + "$devname" + debug= f_struct "$p_provider_geom" get \ + name disk_name || + debug= f_struct "$provider_geom" get \ + name disk_name + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_USB 1 \ + f_media_init_usb f_media_get_usb \ + f_media_shutdown_usb "$disk_name" "$capacity" + retval=$? + fi + + return $retval + ;; + $GEOM_CLASS_RAID) + # Use the provider geom name as the description + if [ ! "$desc" ]; then + f_struct "$p_provider_geom" get name desc || + f_struct "$provider_geom" get name desc + fi + + f_dprintf "Found disk device named %s" "$devname" + debug= f_device_register device \ + "$devname" "${desc:-GEOM RAID device}" \ + "/dev/$devname" $DEVICE_TYPE_DISK 1 \ + "" "" "" "" "$capacity" + retval=$? + + # Detect ``dangerously dedicated'' filesystems + f_device_probe_disk_fs device "$devname" "$capacity" && + retval=$SUCCESS # Errors ignored + + return $retval + ;; + $GEOM_CLASS_ZFS_ZVOL) + f_dprintf "Found disk device named %s" "$devname" + debug= f_device_register device \ + "$devname" "${desc:-GEOM ZFS::ZVOL device}" \ + "/dev/$devname" $DEVICE_TYPE_DISK 1 \ + "" "" "" "" "$capacity" + retval=$? + + # Detect ``dangerously dedicated'' filesystems + f_device_probe_disk_fs device "$devname" "$capacity" && + retval=$SUCCESS # Errors ignored + + return $retval + ;; + *) + return $FAILURE # Unknown GEOM class + esac + + # + # Still here? Must be $GEOM_CLASS_LABEL + # + + local label_geom label_devname label_devgeom= label_devconsumer + local label_devprovider= label_devprovider_ref label_devprovider_config + local label_gpart_type + + if f_struct "$p_provider"; then + label_geom="$p_provider_geom" + else + label_geom="$provider_geom" + fi + + case "$devname" in + gpt/*|gptid/*) + # + # Attempt to get the partition type by getting the `config' + # member of the provider for our device (which is named in the + # parent geom of our current provider). + # + debug= f_struct "$label_geom" get name label_devname && + debug= f_geom_find "$label_devname" $GEOM_CLASS_DEV \ + label_devgeom + debug= f_struct "$label_devgeom" get \ + consumer1 label_devconsumer + debug= f_struct "$label_devconsumer" get \ + provider_ref label_devprovider_ref && + debug= f_geom_find_by id "$label_devprovider_ref" \ + provider label_devprovider + debug= f_struct "$label_devprovider" get \ + config label_devprovider_config + debug= f_struct "$label_devprovider_config" get \ + type label_gpart_type + + # + # Register device label based on partition type + # + f_device_probe_geom_part device \ + "$label_gpart_type" "$devname" "$capacity" + return $? + ;; + iso9660/*) + f_dprintf "Found CDROM device labeled %s" "$devname" + debug= f_device_register device \ + "$devname" "ISO9660 file system" \ + "/dev/$devname" $DEVICE_TYPE_CDROM 1 \ + f_media_init_cdrom f_media_get_cdrom \ + f_media_shutdown_cdrom "" "$capacity" + return $? + ;; + label/*) + # For generic labels, use provider geom name as real device + debug= f_struct "$label_geom" get name label_devname + + # Look up label geom device in device catalog for default desc + debug= f_device_catalog_get \ + $DEVICE_TYPE_ANY "$label_devname" catalog_struct + [ "$desc" ] || debug= f_struct \ + "catalog_device_$catalog_struct" get desc desc + + # Use device catalog entry for potential re-classification(s) + debug= f_struct "catalog_device_$catalog_struct" get \ + type catalog_type + + # First attempt to classify by device catalog (see MAIN) + case "$catalog_type" in + $DEVICE_TYPE_CDROM) + f_dprintf "Found CDROM device for disk %s" "$devname" + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_CDROM 1 \ + f_media_init_cdrom f_media_get_cdrom \ + f_media_shutdown_cdrom "" "$capacity" && + return $SUCCESS + ;; + esac + + # Fall back to register label device as a disk and taste it + f_dprintf "Found disk device labeled %s" "$devname" + debug= f_device_register device \ + "$devname" "GEOM LABEL device" \ + "/dev/$devname" $DEVICE_TYPE_DISK 1 \ + "" "" "" "" "$capacity" + retval=$? + + # Detect ``dangerously dedicated'' filesystems (errors ignored) + f_device_probe_disk_fs device "$devname" "$capacity" && + retval=$SUCCESS + + return $retval + ;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 03:59:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 844F5576; Sat, 17 May 2014 03:59: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 656C3291C; Sat, 17 May 2014 03:59: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 s4H3x2Yk062975; Sat, 17 May 2014 03:59:02 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H3x2Gk062974; Sat, 17 May 2014 03:59:02 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201405170359.s4H3x2Gk062974@svn.freebsd.org> From: Devin Teske Date: Sat, 17 May 2014 03:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266294 - stable/10/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 03:59:02 -0000 Author: dteske Date: Sat May 17 03:59:01 2014 New Revision: 266294 URL: http://svnweb.freebsd.org/changeset/base/266294 Log: MFC r264841: Update zfsboot to coincide with MFC of r264840 adding GEOM support. Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Sat May 17 03:54:51 2014 (r266293) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Sat May 17 03:59:01 2014 (r266294) @@ -189,6 +189,7 @@ ZFS_CREATE_WITH_OPTIONS='zfs create %s " ZFS_SET='zfs set "%s" "%s"' ZFS_UNMOUNT='zfs unmount "%s"' ZPOOL_CREATE_WITH_OPTIONS='zpool create %s "%s" %s %s' +ZPOOL_DESTROY='zpool destroy "%s"' ZPOOL_EXPORT='zpool export "%s"' ZPOOL_IMPORT_WITH_OPTIONS='zpool import %s "%s"' ZPOOL_LABELCLEAR_F='zpool labelclear -f "%s"' @@ -286,7 +287,8 @@ dialog_menu_main() local usegeli="$msg_no" [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && force4k="$msg_yes" [ "$ZFSBOOT_GELI_ENCRYPTION" ] && usegeli="$msg_yes" - local disks n=$( set -- $ZFSBOOT_DISKS; echo $# ) + local disks n + f_count n $ZFSBOOT_DISKS { [ $n -eq 1 ] && disks=disk; } || disks=disks # grammar local menu_list=" '>>> $msg_install' '$msg_install_desc' @@ -451,8 +453,29 @@ dialog_menu_layout() # Get a list of probed disk devices local disks= - f_device_find "" $DEVICE_TYPE_DISK disks - f_dprintf "$funcname: disks=[%s]" "$disks" + debug= f_device_find "" $DEVICE_TYPE_DISK disks + + # Prune out mounted md(4) devices that may be part of the boot process + local disk name new_list= + for disk in $disks; do + debug= $disk get name name + case "$name" in + md[0-9]*) f_mounted -b "/dev/$name" && continue ;; + esac + new_list="$new_list $disk" + done + disks="${new_list# }" + + # Debugging + if [ "$debug" ]; then + local disk_names= + for disk in $disks; do + debug= $disk get name name + disk_names="$disk_names $name" + done + f_dprintf "$funcname: disks=[%s]" "${disk_names# }" + fi + if [ ! "$disks" ]; then f_dprintf "No disk(s) present to configure" f_show_err "$msg_no_disks_present_to_configure" @@ -460,14 +483,15 @@ dialog_menu_layout() fi # Lets sort the disks array to be more user friendly - disks=$( echo "$disks" | tr ' ' '\n' | sort | tr '\n' ' ' ) + f_device_sort_by name disks disks # # Operate in a loop so we can (if interactive) repeat if not enough # disks are selected to satisfy the chosen vdev type or user wants to # back-up to the previous menu. # - local vardisk ndisks onoff selections vdev_choice + local vardisk ndisks onoff selections vdev_choice breakout device + local valid_disks all_valid want_disks desc height width rows while :; do # # Confirm the vdev type that was selected @@ -495,7 +519,7 @@ dialog_menu_layout() fi # Determine the number of disks needed for this vdev type - local want_disks=0 + want_disks=0 case "$ZFSBOOT_VDEV_TYPE" in stripe) want_disks=1 ;; mirror) want_disks=2 ;; @@ -504,11 +528,14 @@ dialog_menu_layout() raidz3) want_disks=5 ;; esac + # # Warn the user if any scripted disks are invalid - local disk valid_disks= - local all_valid=${ZFSBOOT_DISKS:+1} # optimism + # + valid_disks= all_valid=${ZFSBOOT_DISKS:+1} # optimism for disk in $ZFSBOOT_DISKS; do - if f_struct device_$disk; then + if debug= f_device_find -1 \ + $disk $DEVICE_TYPE_DISK device + then valid_disks="$valid_disks $disk" continue fi @@ -532,7 +559,7 @@ dialog_menu_layout() # Short-circuit if we're running non-interactively # if ! f_interactive || [ ! "$ZFSBOOT_CONFIRM_LAYOUT" ]; then - ndisks=$( set -- $ZFSBOOT_DISKS; echo $# ) + f_count ndisks $ZFSBOOT_DISKS [ $ndisks -ge $want_disks ] && break # to success # Not enough disks selected @@ -551,29 +578,35 @@ dialog_menu_layout() # Confirm the disks that were selected # Loop until the user cancels or selects enough disks # - local breakout= + breakout= while :; do # Loop over list of available disks, resetting state - for disk in $disks; do unset _${disk}_status; done + for disk in $disks; do + f_isset _${disk}_status && _${disk}_status= + done # Loop over list of selected disks and create temporary # locals to map statuses onto up-to-date list of disks for disk in $ZFSBOOT_DISKS; do - local _${disk}_status=on + debug= f_device_find -1 \ + $disk $DEVICE_TYPE_DISK disk + f_isset _${disk}_status || + local _${disk}_status + _${disk}_status=on done # Create the checklist menu of discovered disk devices disk_check_list= for disk in $disks; do - local desc= - device_$disk get desc desc + desc= + $disk get name name + $disk get desc desc f_shell_escape "$desc" desc f_getvar _${disk}_status:-off onoff disk_check_list="$disk_check_list - $disk '$desc' $onoff" + $name '$desc' $onoff" done - local height width rows eval f_dialog_checklist_size height width rows \ \"\$title\" \"\$btitle\" \"\$prompt\" \ \"\$hline\" $disk_check_list @@ -597,7 +630,7 @@ dialog_menu_layout() f_dprintf "$funcname: ZFSBOOT_DISKS=[%s]" \ "$ZFSBOOT_DISKS" - ndisks=$( set -- $ZFSBOOT_DISKS; echo $# ) + f_count ndisks $ZFSBOOT_DISKS [ $ndisks -ge $want_disks ] && breakout=break && break @@ -917,6 +950,16 @@ zfs_create_boot() "$ZFSBOOT_BOOT_POOL_SIZE" "$bootsize" # + # Destroy the pool in-case this is our second time 'round (case of + # failure and installer presented ``Retry'' option to come back). + # + # NB: If we don't destroy the pool, later gpart(8) destroy commands + # that try to clear existing partitions (see zfs_create_diskpart()) + # will fail with a `Device Busy' error, leading to `GEOM exists'. + # + f_eval_catch -d $funcname zpool "$ZPOOL_DESTROY" "$zroot_name" + + # # Prepare the disks and build pool device list(s) # f_dprintf "$funcname: Preparing disk partitions for ZFS pool..." @@ -973,8 +1016,9 @@ zfs_create_boot() $BSDINSTALL_CHROOT || return $FAILURE # Create mirror across the boot partition on all disks - [ $( set -- $boot_vdevs; echo $# ) -gt 1 ] && - bootpool_vdevtype=mirror + local nvdevs + f_count nvdevs $boot_vdevs + [ $nvdevs -gt 1 ] && bootpool_vdevtype=mirror bootpool_options="-o altroot=$BSDINSTALL_CHROOT" bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f" @@ -1229,15 +1273,16 @@ zfs_create_boot() # dialog_menu_diskinfo() { - local disk + local device disk # # Break from loop when user cancels disk selection # while :; do - disk=$( msg_cancel="$msg_back" f_device_menu \ + device=$( msg_cancel="$msg_back" f_device_menu \ "$DIALOG_TITLE" "$msg_select_a_disk_device" "" \ $DEVICE_TYPE_DISK 2>&1 ) || break + $device get name disk # Show gpart(8) `show' and camcontrol(8) `inquiry' data f_show_msg "$msg_detailed_disk_info" \ @@ -1309,7 +1354,10 @@ while :; do [ "$ZFSBOOT_BOOT_POOL" ] && minsize=$(( $minsize + $bootsize )) for disk in $ZFSBOOT_DISKS; do - device_$disk get capacity disksize || continue + debug= f_device_find -1 \ + $disk $DEVICE_TYPE_DISK device + $device get capacity disksize || continue + [ ${disksize:-0} -ge 0 ] || disksize=0 disksize=$(( $disksize - $minsize )) [ $disksize -lt $minsize ] && teeny_disks="$teeny_disks $disk" From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 11:24:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 20C99549; Sat, 17 May 2014 11: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 0D99127B7; Sat, 17 May 2014 11: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 s4HBOTdw034729; Sat, 17 May 2014 11:24:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HBOTR0034728; Sat, 17 May 2014 11:24:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405171124.s4HBOTR0034728@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 May 2014 11:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266299 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 11:24:30 -0000 Author: kib Date: Sat May 17 11:24:29 2014 New Revision: 266299 URL: http://svnweb.freebsd.org/changeset/base/266299 Log: MFC r265824: Print the entry address in addition to the object. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Sat May 17 04:49:29 2014 (r266298) +++ stable/10/sys/vm/vm_map.c Sat May 17 11:24:29 2014 (r266299) @@ -1949,7 +1949,8 @@ vm_map_protect(vm_map_t map, vm_offset_t * charged clipped mapping of the same object later. */ KASSERT(obj->charge == 0, - ("vm_map_protect: object %p overcharged\n", obj)); + ("vm_map_protect: object %p overcharged (entry %p)", + obj, current)); if (!swap_reserve(ptoa(obj->size))) { VM_OBJECT_WUNLOCK(obj); vm_map_unlock(map); From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 11:29:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EAE34910; Sat, 17 May 2014 11:29: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 D815B27D8; Sat, 17 May 2014 11:29: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 s4HBTWl1035575; Sat, 17 May 2014 11:29:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HBTWNL035574; Sat, 17 May 2014 11:29:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405171129.s4HBTWNL035574@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 May 2014 11:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266302 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 11:29:33 -0000 Author: kib Date: Sat May 17 11:29:32 2014 New Revision: 266302 URL: http://svnweb.freebsd.org/changeset/base/266302 Log: MFC r265825: When printing the map with the ddb 'show procvm' command, do not dump page queues for the backing objects. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Sat May 17 11:27:36 2014 (r266301) +++ stable/10/sys/vm/vm_map.c Sat May 17 11:29:32 2014 (r266302) @@ -4154,7 +4154,7 @@ vm_map_print(vm_map_t map) db_indent += 2; vm_object_print((db_expr_t)(intptr_t) entry->object.vm_object, - 1, 0, (char *)0); + 0, 0, (char *)0); db_indent -= 2; } } From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 11:36:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A3BE7E65; Sat, 17 May 2014 11:36: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 84EB42888; Sat, 17 May 2014 11:36:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HBaVvt041490; Sat, 17 May 2014 11:36:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HBaVxZ041489; Sat, 17 May 2014 11:36:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405171136.s4HBaVxZ041489@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 May 2014 11:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266304 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 11:36:31 -0000 Author: kib Date: Sat May 17 11:36:31 2014 New Revision: 266304 URL: http://svnweb.freebsd.org/changeset/base/266304 Log: MFC r265843: For the upgrade case in vm_fault_copy_entry(), when the entry does not need COW and is writeable, do not create a new backing object for the entry. MFC r265887: Fix locking. Modified: stable/10/sys/vm/vm_fault.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Sat May 17 11:29:44 2014 (r266303) +++ stable/10/sys/vm/vm_fault.c Sat May 17 11:36:31 2014 (r266304) @@ -1236,38 +1236,48 @@ vm_fault_copy_entry(vm_map_t dst_map, vm #endif /* lint */ upgrade = src_entry == dst_entry; + access = prot = dst_entry->protection; src_object = src_entry->object.vm_object; src_pindex = OFF_TO_IDX(src_entry->offset); - /* - * Create the top-level object for the destination entry. (Doesn't - * actually shadow anything - we copy the pages directly.) - */ - dst_object = vm_object_allocate(OBJT_DEFAULT, - OFF_TO_IDX(dst_entry->end - dst_entry->start)); + if (upgrade && (dst_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) { + dst_object = src_object; + vm_object_reference(dst_object); + } else { + /* + * Create the top-level object for the destination entry. (Doesn't + * actually shadow anything - we copy the pages directly.) + */ + dst_object = vm_object_allocate(OBJT_DEFAULT, + OFF_TO_IDX(dst_entry->end - dst_entry->start)); #if VM_NRESERVLEVEL > 0 - dst_object->flags |= OBJ_COLORED; - dst_object->pg_color = atop(dst_entry->start); + dst_object->flags |= OBJ_COLORED; + dst_object->pg_color = atop(dst_entry->start); #endif + } VM_OBJECT_WLOCK(dst_object); KASSERT(upgrade || dst_entry->object.vm_object == NULL, ("vm_fault_copy_entry: vm_object not NULL")); - dst_entry->object.vm_object = dst_object; - dst_entry->offset = 0; - dst_object->charge = dst_entry->end - dst_entry->start; + if (src_object != dst_object) { + dst_entry->object.vm_object = dst_object; + dst_entry->offset = 0; + dst_object->charge = dst_entry->end - dst_entry->start; + } if (fork_charge != NULL) { KASSERT(dst_entry->cred == NULL, ("vm_fault_copy_entry: leaked swp charge")); dst_object->cred = curthread->td_ucred; crhold(dst_object->cred); *fork_charge += dst_object->charge; - } else { + } else if (dst_object->cred == NULL) { + KASSERT(dst_entry->cred != NULL, ("no cred for entry %p", + dst_entry)); dst_object->cred = dst_entry->cred; dst_entry->cred = NULL; } - access = prot = dst_entry->protection; + /* * If not an upgrade, then enter the mappings in the pmap as * read and/or execute accesses. Otherwise, enter them as @@ -1293,26 +1303,14 @@ vm_fault_copy_entry(vm_map_t dst_map, vm for (vaddr = dst_entry->start, dst_pindex = 0; vaddr < dst_entry->end; vaddr += PAGE_SIZE, dst_pindex++) { - - /* - * Allocate a page in the destination object. - */ - do { - dst_m = vm_page_alloc(dst_object, dst_pindex, - VM_ALLOC_NORMAL); - if (dst_m == NULL) { - VM_OBJECT_WUNLOCK(dst_object); - VM_WAIT; - VM_OBJECT_WLOCK(dst_object); - } - } while (dst_m == NULL); - +again: /* * Find the page in the source object, and copy it in. * Because the source is wired down, the page will be * in memory. */ - VM_OBJECT_RLOCK(src_object); + if (src_object != dst_object) + VM_OBJECT_RLOCK(src_object); object = src_object; pindex = src_pindex + dst_pindex; while ((src_m = vm_page_lookup(object, pindex)) == NULL && @@ -1332,14 +1330,40 @@ vm_fault_copy_entry(vm_map_t dst_map, vm VM_OBJECT_RLOCK(backing_object); pindex += OFF_TO_IDX(object->backing_object_offset); - VM_OBJECT_RUNLOCK(object); + if (object != dst_object) + VM_OBJECT_RUNLOCK(object); object = backing_object; } KASSERT(src_m != NULL, ("vm_fault_copy_entry: page missing")); - pmap_copy_page(src_m, dst_m); - VM_OBJECT_RUNLOCK(object); - dst_m->valid = VM_PAGE_BITS_ALL; - dst_m->dirty = VM_PAGE_BITS_ALL; + + if (object != dst_object) { + /* + * Allocate a page in the destination object. + */ + do { + dst_m = vm_page_alloc(dst_object, + (src_object == dst_object ? src_pindex : + 0) + dst_pindex, VM_ALLOC_NORMAL); + if (dst_m == NULL) { + VM_OBJECT_WUNLOCK(dst_object); + VM_OBJECT_RUNLOCK(object); + VM_WAIT; + VM_OBJECT_WLOCK(dst_object); + goto again; + } + } while (dst_m == NULL); + pmap_copy_page(src_m, dst_m); + VM_OBJECT_RUNLOCK(object); + dst_m->valid = VM_PAGE_BITS_ALL; + dst_m->dirty = VM_PAGE_BITS_ALL; + } else { + dst_m = src_m; + if (vm_page_sleep_if_busy(dst_m, "fltupg")) + goto again; + vm_page_xbusy(dst_m); + KASSERT(dst_m->valid == VM_PAGE_BITS_ALL, + ("invalid dst page %p", dst_m)); + } VM_OBJECT_WUNLOCK(dst_object); /* @@ -1355,13 +1379,17 @@ vm_fault_copy_entry(vm_map_t dst_map, vm VM_OBJECT_WLOCK(dst_object); if (upgrade) { - vm_page_lock(src_m); - vm_page_unwire(src_m, 0); - vm_page_unlock(src_m); - - vm_page_lock(dst_m); - vm_page_wire(dst_m); - vm_page_unlock(dst_m); + if (src_m != dst_m) { + vm_page_lock(src_m); + vm_page_unwire(src_m, 0); + vm_page_unlock(src_m); + vm_page_lock(dst_m); + vm_page_wire(dst_m); + vm_page_unlock(dst_m); + } else { + KASSERT(dst_m->wire_count > 0, + ("dst_m %p is not wired", dst_m)); + } } else { vm_page_lock(dst_m); vm_page_activate(dst_m); From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 11:38:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5DECEFA8; Sat, 17 May 2014 11:38: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 4B645289B; Sat, 17 May 2014 11:38: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 s4HBcRBI041770; Sat, 17 May 2014 11:38:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HBcRRw041769; Sat, 17 May 2014 11:38:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405171138.s4HBcRRw041769@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 May 2014 11:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266305 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 11:38:27 -0000 Author: kib Date: Sat May 17 11:38:26 2014 New Revision: 266305 URL: http://svnweb.freebsd.org/changeset/base/266305 Log: MFC r265845: Style. Modified: stable/10/lib/libc/gen/sem_new.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/sem_new.c ============================================================================== --- stable/10/lib/libc/gen/sem_new.c Sat May 17 11:36:31 2014 (r266304) +++ stable/10/lib/libc/gen/sem_new.c Sat May 17 11:38:26 2014 (r266305) @@ -294,13 +294,13 @@ _sem_unlink(const char *name) return -1; } name++; - strcpy(path, SEM_PREFIX); if (strlcat(path, name, sizeof(path)) >= sizeof(path)) { errno = ENAMETOOLONG; return (-1); } - return unlink(path); + + return (unlink(path)); } int From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 11:43:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F389D193; Sat, 17 May 2014 11:43: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 D5CC62922; Sat, 17 May 2014 11:43: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 s4HBhEoU047033; Sat, 17 May 2014 11:43:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HBhEAN047032; Sat, 17 May 2014 11:43:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405171143.s4HBhEAN047032@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 May 2014 11:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266306 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 11:43:15 -0000 Author: kib Date: Sat May 17 11:43:14 2014 New Revision: 266306 URL: http://svnweb.freebsd.org/changeset/base/266306 Log: MFC r265847: Fix sem_unlink(3) to properly invalidate the semaphores name cache. PR: standards/189353 Modified: stable/10/lib/libc/gen/sem_new.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/sem_new.c ============================================================================== --- stable/10/lib/libc/gen/sem_new.c Sat May 17 11:38:26 2014 (r266305) +++ stable/10/lib/libc/gen/sem_new.c Sat May 17 11:43:14 2014 (r266306) @@ -66,6 +66,8 @@ __weak_reference(_sem_wait, sem_wait); struct sem_nameinfo { int open_count; char *name; + dev_t dev; + ino_t ino; sem_t *sem; LIST_ENTRY(sem_nameinfo) next; }; @@ -151,37 +153,46 @@ _sem_open(const char *name, int flags, . return (SEM_FAILED); } name++; - + strcpy(path, SEM_PREFIX); + if (strlcat(path, name, sizeof(path)) >= sizeof(path)) { + errno = ENAMETOOLONG; + return (SEM_FAILED); + } if (flags & ~(O_CREAT|O_EXCL)) { errno = EINVAL; return (SEM_FAILED); } - + if ((flags & O_CREAT) != 0) { + va_start(ap, flags); + mode = va_arg(ap, int); + value = va_arg(ap, int); + va_end(ap); + } + fd = -1; _pthread_once(&once, sem_module_init); _pthread_mutex_lock(&sem_llock); LIST_FOREACH(ni, &sem_list, next) { - if (strcmp(name, ni->name) == 0) { - if ((flags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL)) { - _pthread_mutex_unlock(&sem_llock); - errno = EEXIST; - return (SEM_FAILED); - } else { - ni->open_count++; - sem = ni->sem; - _pthread_mutex_unlock(&sem_llock); - return (sem); + if (ni->name != NULL && strcmp(name, ni->name) == 0) { + fd = _open(path, flags | O_RDWR | O_CLOEXEC | + O_EXLOCK, mode); + if (fd == -1 || _fstat(fd, &sb) == -1) + goto error; + if ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | + O_EXCL) || ni->dev != sb.st_dev || + ni->ino != sb.st_ino) { + ni->name = NULL; + ni = NULL; + break; } + ni->open_count++; + sem = ni->sem; + _pthread_mutex_unlock(&sem_llock); + _close(fd); + return (sem); } } - if (flags & O_CREAT) { - va_start(ap, flags); - mode = va_arg(ap, int); - value = va_arg(ap, int); - va_end(ap); - } - len = sizeof(*ni) + strlen(name) + 1; ni = (struct sem_nameinfo *)malloc(len); if (ni == NULL) { @@ -192,17 +203,11 @@ _sem_open(const char *name, int flags, . ni->name = (char *)(ni+1); strcpy(ni->name, name); - strcpy(path, SEM_PREFIX); - if (strlcat(path, name, sizeof(path)) >= sizeof(path)) { - errno = ENAMETOOLONG; - goto error; + if (fd == -1) { + fd = _open(path, flags | O_RDWR | O_CLOEXEC | O_EXLOCK, mode); + if (fd == -1 || _fstat(fd, &sb) == -1) + goto error; } - - fd = _open(path, flags|O_RDWR|O_CLOEXEC|O_EXLOCK, mode); - if (fd == -1) - goto error; - if (_fstat(fd, &sb)) - goto error; if (sb.st_size < sizeof(sem_t)) { sem_t tmp; @@ -228,6 +233,8 @@ _sem_open(const char *name, int flags, . } ni->open_count = 1; ni->sem = sem; + ni->dev = sb.st_dev; + ni->ino = sb.st_ino; LIST_INSERT_HEAD(&sem_list, ni, next); _close(fd); _pthread_mutex_unlock(&sem_llock); From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 12:47:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 144FA70F; Sat, 17 May 2014 12:47: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 F17AF2E1B; Sat, 17 May 2014 12:47: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 s4HClBmP083777; Sat, 17 May 2014 12:47:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HClBIX083776; Sat, 17 May 2014 12:47:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201405171247.s4HClBIX083776@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 May 2014 12:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266309 - in stable: 10/lib/clang 9/lib/clang X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 12:47:12 -0000 Author: dim Date: Sat May 17 12:47:11 2014 New Revision: 266309 URL: http://svnweb.freebsd.org/changeset/base/266309 Log: MFC r266053: Use the new -d option that was added to tblgen between llvm/clang 3.3 and 3.4 to generate dependency files for the '.inc.h' files generated from .td files, and .sinclude those dependency files in clang.build.mk. This will make future incremental builds of lib/clang and usr.bin/clang work correctly, whenever any of the .td files get modified. Note that this will not fix any problems with incremental builds from *before* this revision, since there will not yet be any generated dependency files. A quick workaround is to run the following: find /usr/obj -type f -name '*.inc.h' | xargs rm and then a regular incremental buildworld (e.g. with -DNO_CLEAN). Modified: stable/10/lib/clang/clang.build.mk Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/lib/clang/clang.build.mk Directory Properties: stable/9/lib/clang/ (props changed) Modified: stable/10/lib/clang/clang.build.mk ============================================================================== --- stable/10/lib/clang/clang.build.mk Sat May 17 12:33:27 2014 (r266308) +++ stable/10/lib/clang/clang.build.mk Sat May 17 12:47:11 2014 (r266309) @@ -39,17 +39,9 @@ CXXFLAGS+= -fno-exceptions -fno-rtti TBLGEN?= tblgen CLANG_TBLGEN?= clang-tblgen -Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsARM.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsHexagon.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsMips.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsNVVM.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsPowerPC.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsR600.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsX86.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsXCore.td - ${TBLGEN} -I ${LLVM_SRCS}/include \ - -gen-intrinsic -o ${.TARGET} \ +Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td + ${TBLGEN} -gen-intrinsic \ + -I ${LLVM_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td .for arch in \ ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86 @@ -68,144 +60,167 @@ Intrinsics.inc.h: ${LLVM_SRCS}/include/l RegisterInfo/-gen-register-info \ SubtargetInfo/-gen-subtarget ${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td - ${TBLGEN} -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target/${arch:H} \ - ${hdr:T:C/,/ /g} -o ${.TARGET} \ + ${TBLGEN} ${hdr:T:C/,/ /g} \ + -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target/${arch:H} \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td . endfor .endfor Attrs.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-classes -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-classes \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrDump.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-dump -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-dump \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrIdentifierArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-identifier-arg-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-identifier-arg-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-impl -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-impl \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-late-parsed-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-late-parsed-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrParsedAttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-parsed-attr-impl -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-impl \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrParsedAttrKinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-parsed-attr-kinds -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-kinds \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-parsed-attr-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-pch-read -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-pch-read \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-pch-write -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-pch-write \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-spelling-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-spelling-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrSpellingListIndex.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-spelling-index -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-spelling-index \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-template-instantiate -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-template-instantiate \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrTypeArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-type-arg-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-type-arg-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} CommentCommandInfo.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-command-info -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-command-info \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CommentCommandList.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-command-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-command-list \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CommentHTMLNamedCharacterReferences.inc.h: \ ${CLANG_SRCS}/include/clang/AST/CommentHTMLNamedCharacterReferences.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-html-named-character-references -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-html-named-character-references \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CommentHTMLTags.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-html-tags -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-html-tags \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CommentHTMLTagsProperties.inc.h: \ ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-html-tags-properties -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-html-tags-properties \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CommentNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-nodes -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-nodes \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} DeclNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td - ${CLANG_TBLGEN} \ - -gen-clang-decl-nodes -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-decl-nodes \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} StmtNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td - ${CLANG_TBLGEN} \ - -gen-clang-stmt-nodes -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-stmt-nodes \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} arm_neon.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td - ${CLANG_TBLGEN} \ - -gen-arm-neon -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-arm-neon \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} arm_neon.inc.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td - ${CLANG_TBLGEN} \ - -gen-arm-neon-sema -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-arm-neon-sema \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} DiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic \ - -gen-clang-diag-groups -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-diag-groups \ + -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ + -o ${.TARGET} ${.ALLSRC} DiagnosticIndexName.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic \ - -gen-clang-diags-index-name -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-diags-index-name \ + -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ + -o ${.TARGET} ${.ALLSRC} .for hdr in AST Analysis Comment Common Driver Frontend Lex Parse Sema Serialization Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic \ - -gen-clang-diags-defs -clang-component=${hdr} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-diags-defs -clang-component=${hdr} \ + -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ + -o ${.TARGET} ${.ALLSRC} .endfor Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td - ${TBLGEN} -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ - -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC} + ${TBLGEN} -gen-opt-parser-defs \ + -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td - ${TBLGEN} -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ - -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC} + ${TBLGEN} -gen-opt-parser-defs \ + -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td \ ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/CheckerBase.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-sa-checkers -o ${.TARGET} \ + ${CLANG_TBLGEN} -gen-clang-sa-checkers \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td +.for dep in ${TGHDRS:C/$/.inc.d/} +. sinclude "${dep}" +.endfor + SRCS+= ${TGHDRS:C/$/.inc.h/} DPADD+= ${TGHDRS:C/$/.inc.h/} -CLEANFILES+= ${TGHDRS:C/$/.inc.h/} +CLEANFILES+= ${TGHDRS:C/$/.inc.h/} ${TGHDRS:C/$/.inc.d/} From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 13:53:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 80636957; Sat, 17 May 2014 13:53: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 6572D23BA; Sat, 17 May 2014 13:53: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 s4HDrdJP026100; Sat, 17 May 2014 13:53:39 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HDrcOX026096; Sat, 17 May 2014 13:53:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171353.s4HDrcOX026096@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 13:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266311 - in stable/10/sys: arm/allwinner arm/allwinner/a20 arm/arm arm/at91 arm/broadcom/bcm2835 arm/conf arm/econa arm/freescale/imx arm/freescale/vybrid arm/include arm/lpc arm/mv ar... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 13:53:39 -0000 Author: ian Date: Sat May 17 13:53:38 2014 New Revision: 266311 URL: http://svnweb.freebsd.org/changeset/base/266311 Log: MFC 262952, 262958, 262966, 262979, 262980, 262986, 262987, 262995, 262997, 263030, 263033, 263034, 263056, 263057, Remove all the redundant external declarations of exception vectors and runtime setting of the pointers that's scattered around various places. Remove all traces of support for ARM chips prior to the arm9 series. Make the default exception handler vectors point to where I thought they were already pointing: the default handlers (not a panic that says there is no default handler). Eliminate irq_dispatch.S. Move the data items it contained into arm/intr.c and the functionality it provided into arm/exception.S. Move the exception vector table (so-called "page0" data) into exception.S and eliminate vectors.S. Change the way the asm GET_CURTHREAD_PTR() macro is defined so that code using it doesn't have to have an "AST_LOCALS" macro somewhere in the file. Arrange for arm fork_trampoline() to return to userland via the standard swi_exit code in exception.S instead of having its own inline expansion of the DO_AST and PULLFRAME macros. Now that the PUSHFRAME and PULLFRAME macros are used only in the swi entry/exit code, they don't need to be macros. Except that didn't work and the whole change was reverted. Remove some unnecessary indirection and jump right to the handler functions. Use panic rather than printf to "handle" an arm26 address exception (should never happen on arm32). Remove the unreferenced DATA() macro. Remove #include from files that don't need it. Deleted: stable/10/sys/arm/arm/cpufunc_asm_arm7tdmi.S stable/10/sys/arm/arm/cpufunc_asm_arm8.S stable/10/sys/arm/arm/cpufunc_asm_ixp12x0.S stable/10/sys/arm/arm/cpufunc_asm_sa1.S stable/10/sys/arm/arm/cpufunc_asm_sa11x0.S stable/10/sys/arm/arm/irq_dispatch.S stable/10/sys/arm/arm/vectors.S stable/10/sys/arm/conf/SIMICS stable/10/sys/arm/sa11x0/ Modified: stable/10/sys/arm/allwinner/a20/files.a20 stable/10/sys/arm/allwinner/files.a10 stable/10/sys/arm/arm/copystr.S stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/elf_trampoline.c stable/10/sys/arm/arm/exception.S stable/10/sys/arm/arm/fiq.c stable/10/sys/arm/arm/fiq_subr.S stable/10/sys/arm/arm/fusu.S stable/10/sys/arm/arm/identcpu.c stable/10/sys/arm/arm/intr.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/pmap.c stable/10/sys/arm/arm/support.S stable/10/sys/arm/arm/swtch.S stable/10/sys/arm/arm/trap.c stable/10/sys/arm/at91/at91_machdep.c stable/10/sys/arm/at91/files.at91 stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 stable/10/sys/arm/conf/NOTES stable/10/sys/arm/econa/econa_machdep.c stable/10/sys/arm/econa/files.econa stable/10/sys/arm/freescale/imx/files.imx51 stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/freescale/vybrid/files.vybrid stable/10/sys/arm/include/armreg.h stable/10/sys/arm/include/asmacros.h stable/10/sys/arm/include/cpuconf.h stable/10/sys/arm/include/cpufunc.h stable/10/sys/arm/include/md_var.h stable/10/sys/arm/include/param.h stable/10/sys/arm/include/pmap.h stable/10/sys/arm/include/sysarch.h stable/10/sys/arm/lpc/files.lpc stable/10/sys/arm/mv/files.mv stable/10/sys/arm/rockchip/files.rk30xx stable/10/sys/arm/s3c2xx0/files.s3c2xx0 stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c stable/10/sys/arm/samsung/exynos/files.exynos5 stable/10/sys/arm/tegra/files.tegra2 stable/10/sys/arm/ti/files.ti stable/10/sys/arm/versatile/files.versatile stable/10/sys/arm/xilinx/files.zynq7 stable/10/sys/arm/xscale/i80321/ep80219_machdep.c stable/10/sys/arm/xscale/i80321/files.i80219 stable/10/sys/arm/xscale/i80321/files.i80321 stable/10/sys/arm/xscale/i80321/iq31244_machdep.c stable/10/sys/arm/xscale/i8134x/crb_machdep.c stable/10/sys/arm/xscale/i8134x/files.i81342 stable/10/sys/arm/xscale/ixp425/avila_machdep.c stable/10/sys/arm/xscale/ixp425/files.ixp425 stable/10/sys/arm/xscale/pxa/files.pxa stable/10/sys/arm/xscale/pxa/pxa_machdep.c stable/10/sys/arm/xscale/pxa/pxareg.h stable/10/sys/conf/Makefile.arm stable/10/sys/conf/files.arm stable/10/sys/conf/options.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/allwinner/a20/files.a20 ============================================================================== --- stable/10/sys/arm/allwinner/a20/files.a20 Sat May 17 13:45:03 2014 (r266310) +++ stable/10/sys/arm/allwinner/a20/files.a20 Sat May 17 13:53:38 2014 (r266311) @@ -7,7 +7,6 @@ arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard arm/arm/gic.c standard arm/allwinner/a20/a20_cpu_cfg.c standard Modified: stable/10/sys/arm/allwinner/files.a10 ============================================================================== --- stable/10/sys/arm/allwinner/files.a10 Sat May 17 13:45:03 2014 (r266310) +++ stable/10/sys/arm/allwinner/files.a10 Sat May 17 13:53:38 2014 (r266311) @@ -7,7 +7,6 @@ arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard arm/allwinner/a10_clk.c standard arm/allwinner/a10_common.c standard Modified: stable/10/sys/arm/arm/copystr.S ============================================================================== --- stable/10/sys/arm/arm/copystr.S Sat May 17 13:45:03 2014 (r266310) +++ stable/10/sys/arm/arm/copystr.S Sat May 17 13:53:38 2014 (r266311) @@ -42,7 +42,6 @@ #include "assym.s" #include #include -#include __FBSDID("$FreeBSD$"); #include Modified: stable/10/sys/arm/arm/cpufunc.c ============================================================================== --- stable/10/sys/arm/arm/cpufunc.c Sat May 17 13:45:03 2014 (r266310) +++ stable/10/sys/arm/arm/cpufunc.c Sat May 17 13:53:38 2014 (r266311) @@ -1,9 +1,6 @@ /* $NetBSD: cpufunc.c,v 1.65 2003/11/05 12:53:15 scw Exp $ */ /*- - * arm7tdmi support code Copyright (c) 2001 John Fremlin - * arm8 support code Copyright (c) 1997 ARM Limited - * arm8 support code Copyright (c) 1997 Causality Limited * arm9 support code Copyright (C) 2001 ARM Ltd * Copyright (c) 1997 Mark Brinicombe. * Copyright (c) 1997 Causality Limited @@ -112,131 +109,6 @@ u_int arm_cache_loc; int cpu_do_powersave; int ctrl; -#ifdef CPU_ARM7TDMI -struct cpu_functions arm7tdmi_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - cpufunc_nullop, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* domain */ - arm7tdmi_setttb, /* setttb */ - cpufunc_faultstatus, /* faultstatus */ - cpufunc_faultaddress, /* faultaddress */ - - /* TLB functions */ - - arm7tdmi_tlb_flushID, /* tlb_flushID */ - arm7tdmi_tlb_flushID_SE, /* tlb_flushID_SE */ - arm7tdmi_tlb_flushID, /* tlb_flushI */ - arm7tdmi_tlb_flushID_SE, /* tlb_flushI_SE */ - arm7tdmi_tlb_flushID, /* tlb_flushD */ - arm7tdmi_tlb_flushID_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - - cpufunc_nullop, /* icache_sync_all */ - (void *)cpufunc_nullop, /* icache_sync_range */ - - arm7tdmi_cache_flushID, /* dcache_wbinv_all */ - (void *)arm7tdmi_cache_flushID, /* dcache_wbinv_range */ - (void *)arm7tdmi_cache_flushID, /* dcache_inv_range */ - (void *)cpufunc_nullop, /* dcache_wb_range */ - - cpufunc_nullop, /* idcache_inv_all */ - arm7tdmi_cache_flushID, /* idcache_wbinv_all */ - (void *)arm7tdmi_cache_flushID, /* idcache_wbinv_range */ - cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - cpufunc_nullop, /* flush_prefetchbuf */ - cpufunc_nullop, /* drain_writebuf */ - cpufunc_nullop, /* flush_brnchtgt_C */ - (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - - (void *)cpufunc_nullop, /* sleep */ - - /* Soft functions */ - - late_abort_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - arm7tdmi_context_switch, /* context_switch */ - - arm7tdmi_setup /* cpu setup */ - -}; -#endif /* CPU_ARM7TDMI */ - -#ifdef CPU_ARM8 -struct cpu_functions arm8_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - cpufunc_nullop, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* domain */ - arm8_setttb, /* setttb */ - cpufunc_faultstatus, /* faultstatus */ - cpufunc_faultaddress, /* faultaddress */ - - /* TLB functions */ - - arm8_tlb_flushID, /* tlb_flushID */ - arm8_tlb_flushID_SE, /* tlb_flushID_SE */ - arm8_tlb_flushID, /* tlb_flushI */ - arm8_tlb_flushID_SE, /* tlb_flushI_SE */ - arm8_tlb_flushID, /* tlb_flushD */ - arm8_tlb_flushID_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - - cpufunc_nullop, /* icache_sync_all */ - (void *)cpufunc_nullop, /* icache_sync_range */ - - arm8_cache_purgeID, /* dcache_wbinv_all */ - (void *)arm8_cache_purgeID, /* dcache_wbinv_range */ -/*XXX*/ (void *)arm8_cache_purgeID, /* dcache_inv_range */ - (void *)arm8_cache_cleanID, /* dcache_wb_range */ - - cpufunc_nullop, /* idcache_inv_all */ - arm8_cache_purgeID, /* idcache_wbinv_all */ - (void *)arm8_cache_purgeID, /* idcache_wbinv_range */ - cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - cpufunc_nullop, /* flush_prefetchbuf */ - cpufunc_nullop, /* drain_writebuf */ - cpufunc_nullop, /* flush_brnchtgt_C */ - (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - - (void *)cpufunc_nullop, /* sleep */ - - /* Soft functions */ - - cpufunc_null_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - arm8_context_switch, /* context_switch */ - - arm8_setup /* cpu setup */ -}; -#endif /* CPU_ARM8 */ - #ifdef CPU_ARM9 struct cpu_functions arm9_cpufuncs = { /* CPU functions */ @@ -550,192 +422,6 @@ struct cpu_functions pj4bv7_cpufuncs = { }; #endif /* CPU_MV_PJ4B */ -#ifdef CPU_SA110 -struct cpu_functions sa110_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - cpufunc_nullop, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* domain */ - sa1_setttb, /* setttb */ - cpufunc_faultstatus, /* faultstatus */ - cpufunc_faultaddress, /* faultaddress */ - - /* TLB functions */ - - armv4_tlb_flushID, /* tlb_flushID */ - sa1_tlb_flushID_SE, /* tlb_flushID_SE */ - armv4_tlb_flushI, /* tlb_flushI */ - (void *)armv4_tlb_flushI, /* tlb_flushI_SE */ - armv4_tlb_flushD, /* tlb_flushD */ - armv4_tlb_flushD_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - - sa1_cache_syncI, /* icache_sync_all */ - sa1_cache_syncI_rng, /* icache_sync_range */ - - sa1_cache_purgeD, /* dcache_wbinv_all */ - sa1_cache_purgeD_rng, /* dcache_wbinv_range */ -/*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ - sa1_cache_cleanD_rng, /* dcache_wb_range */ - - sa1_cache_flushID, /* idcache_inv_all */ - sa1_cache_purgeID, /* idcache_wbinv_all */ - sa1_cache_purgeID_rng, /* idcache_wbinv_range */ - cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - cpufunc_nullop, /* flush_prefetchbuf */ - armv4_drain_writebuf, /* drain_writebuf */ - cpufunc_nullop, /* flush_brnchtgt_C */ - (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - - (void *)cpufunc_nullop, /* sleep */ - - /* Soft functions */ - - cpufunc_null_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - sa110_context_switch, /* context_switch */ - - sa110_setup /* cpu setup */ -}; -#endif /* CPU_SA110 */ - -#if defined(CPU_SA1100) || defined(CPU_SA1110) -struct cpu_functions sa11x0_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - cpufunc_nullop, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* domain */ - sa1_setttb, /* setttb */ - cpufunc_faultstatus, /* faultstatus */ - cpufunc_faultaddress, /* faultaddress */ - - /* TLB functions */ - - armv4_tlb_flushID, /* tlb_flushID */ - sa1_tlb_flushID_SE, /* tlb_flushID_SE */ - armv4_tlb_flushI, /* tlb_flushI */ - (void *)armv4_tlb_flushI, /* tlb_flushI_SE */ - armv4_tlb_flushD, /* tlb_flushD */ - armv4_tlb_flushD_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - - sa1_cache_syncI, /* icache_sync_all */ - sa1_cache_syncI_rng, /* icache_sync_range */ - - sa1_cache_purgeD, /* dcache_wbinv_all */ - sa1_cache_purgeD_rng, /* dcache_wbinv_range */ -/*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ - sa1_cache_cleanD_rng, /* dcache_wb_range */ - - sa1_cache_flushID, /* idcache_inv_all */ - sa1_cache_purgeID, /* idcache_wbinv_all */ - sa1_cache_purgeID_rng, /* idcache_wbinv_range */ - cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - sa11x0_drain_readbuf, /* flush_prefetchbuf */ - armv4_drain_writebuf, /* drain_writebuf */ - cpufunc_nullop, /* flush_brnchtgt_C */ - (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - - sa11x0_cpu_sleep, /* sleep */ - - /* Soft functions */ - - cpufunc_null_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - sa11x0_context_switch, /* context_switch */ - - sa11x0_setup /* cpu setup */ -}; -#endif /* CPU_SA1100 || CPU_SA1110 */ - -#ifdef CPU_IXP12X0 -struct cpu_functions ixp12x0_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - cpufunc_nullop, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* domain */ - sa1_setttb, /* setttb */ - cpufunc_faultstatus, /* faultstatus */ - cpufunc_faultaddress, /* faultaddress */ - - /* TLB functions */ - - armv4_tlb_flushID, /* tlb_flushID */ - sa1_tlb_flushID_SE, /* tlb_flushID_SE */ - armv4_tlb_flushI, /* tlb_flushI */ - (void *)armv4_tlb_flushI, /* tlb_flushI_SE */ - armv4_tlb_flushD, /* tlb_flushD */ - armv4_tlb_flushD_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - - sa1_cache_syncI, /* icache_sync_all */ - sa1_cache_syncI_rng, /* icache_sync_range */ - - sa1_cache_purgeD, /* dcache_wbinv_all */ - sa1_cache_purgeD_rng, /* dcache_wbinv_range */ -/*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ - sa1_cache_cleanD_rng, /* dcache_wb_range */ - - sa1_cache_flushID, /* idcache_inv_all */ - sa1_cache_purgeID, /* idcache_wbinv_all */ - sa1_cache_purgeID_rng, /* idcache_wbinv_range */ - cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - ixp12x0_drain_readbuf, /* flush_prefetchbuf */ - armv4_drain_writebuf, /* drain_writebuf */ - cpufunc_nullop, /* flush_brnchtgt_C */ - (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - - (void *)cpufunc_nullop, /* sleep */ - - /* Soft functions */ - - cpufunc_null_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - ixp12x0_context_switch, /* context_switch */ - - ixp12x0_setup /* cpu setup */ -}; -#endif /* CPU_IXP12X0 */ - #if defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_XSCALE_80219) @@ -1128,7 +814,7 @@ struct cpu_functions cpufuncs; u_int cputype; u_int cpu_reset_needs_v4_MMU_disable; /* flag used in locore.s */ -#if defined(CPU_ARM7TDMI) || defined(CPU_ARM8) || defined(CPU_ARM9) || \ +#if defined(CPU_ARM9) || \ defined (CPU_ARM9E) || defined (CPU_ARM10) || defined (CPU_ARM1136) || \ defined(CPU_ARM1176) || defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ @@ -1247,61 +933,7 @@ get_cachetype_cp15() arm_dcache_align_mask = arm_dcache_align - 1; } } -#endif /* ARM7TDMI || ARM8 || ARM9 || XSCALE */ - -#if defined(CPU_SA110) || defined(CPU_SA1100) || defined(CPU_SA1110) || \ - defined(CPU_IXP12X0) -/* Cache information for CPUs without cache type registers. */ -struct cachetab { - u_int32_t ct_cpuid; - int ct_pcache_type; - int ct_pcache_unified; - int ct_pdcache_size; - int ct_pdcache_line_size; - int ct_pdcache_ways; - int ct_picache_size; - int ct_picache_line_size; - int ct_picache_ways; -}; - -struct cachetab cachetab[] = { - /* cpuid, cache type, u, dsiz, ls, wy, isiz, ls, wy */ - /* XXX is this type right for SA-1? */ - { CPU_ID_SA110, CPU_CT_CTYPE_WB1, 0, 16384, 32, 32, 16384, 32, 32 }, - { CPU_ID_SA1100, CPU_CT_CTYPE_WB1, 0, 8192, 32, 32, 16384, 32, 32 }, - { CPU_ID_SA1110, CPU_CT_CTYPE_WB1, 0, 8192, 32, 32, 16384, 32, 32 }, - { CPU_ID_IXP1200, CPU_CT_CTYPE_WB1, 0, 16384, 32, 32, 16384, 32, 32 }, /* XXX */ - { 0, 0, 0, 0, 0, 0, 0, 0} -}; - -static void get_cachetype_table(void); - -static void -get_cachetype_table() -{ - int i; - u_int32_t cpuid = cpufunc_id(); - - for (i = 0; cachetab[i].ct_cpuid != 0; i++) { - if (cachetab[i].ct_cpuid == (cpuid & CPU_ID_CPU_MASK)) { - arm_pcache_type = cachetab[i].ct_pcache_type; - arm_pcache_unified = cachetab[i].ct_pcache_unified; - arm_pdcache_size = cachetab[i].ct_pdcache_size; - arm_pdcache_line_size = - cachetab[i].ct_pdcache_line_size; - arm_pdcache_ways = cachetab[i].ct_pdcache_ways; - arm_picache_size = cachetab[i].ct_picache_size; - arm_picache_line_size = - cachetab[i].ct_picache_line_size; - arm_picache_ways = cachetab[i].ct_picache_ways; - } - } - arm_dcache_align = arm_pdcache_line_size; - - arm_dcache_align_mask = arm_dcache_align - 1; -} - -#endif /* SA110 || SA1100 || SA1111 || IXP12X0 */ +#endif /* ARM9 || XSCALE */ /* * Cannot panic here as we may not have a console yet ... @@ -1318,27 +950,6 @@ set_cpufuncs() * CPU type where we want to use it by default, then we set it. */ -#ifdef CPU_ARM7TDMI - if ((cputype & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD && - CPU_ID_IS7(cputype) && - (cputype & CPU_ID_7ARCH_MASK) == CPU_ID_7ARCH_V4T) { - cpufuncs = arm7tdmi_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 0; - get_cachetype_cp15(); - pmap_pte_init_generic(); - goto out; - } -#endif -#ifdef CPU_ARM8 - if ((cputype & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD && - (cputype & 0x0000f000) == 0x00008000) { - cpufuncs = arm8_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 0; /* XXX correct? */ - get_cachetype_cp15(); - pmap_pte_init_arm8(); - goto out; - } -#endif /* CPU_ARM8 */ #ifdef CPU_ARM9 if (((cputype & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD || (cputype & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_TI) && @@ -1463,39 +1074,7 @@ set_cpufuncs() goto out; } #endif /* CPU_MV_PJ4B */ -#ifdef CPU_SA110 - if (cputype == CPU_ID_SA110) { - cpufuncs = sa110_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 1; /* SA needs it */ - get_cachetype_table(); - pmap_pte_init_sa1(); - goto out; - } -#endif /* CPU_SA110 */ -#ifdef CPU_SA1100 - if (cputype == CPU_ID_SA1100) { - cpufuncs = sa11x0_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 1; /* SA needs it */ - get_cachetype_table(); - pmap_pte_init_sa1(); - /* Use powersave on this CPU. */ - cpu_do_powersave = 1; - - goto out; - } -#endif /* CPU_SA1100 */ -#ifdef CPU_SA1110 - if (cputype == CPU_ID_SA1110) { - cpufuncs = sa11x0_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 1; /* SA needs it */ - get_cachetype_table(); - pmap_pte_init_sa1(); - /* Use powersave on this CPU. */ - cpu_do_powersave = 1; - goto out; - } -#endif /* CPU_SA1110 */ #if defined(CPU_FA526) || defined(CPU_FA626TE) if (cputype == CPU_ID_FA526 || cputype == CPU_ID_FA626TE) { cpufuncs = fa526_cpufuncs; @@ -1509,15 +1088,7 @@ set_cpufuncs() goto out; } #endif /* CPU_FA526 || CPU_FA626TE */ -#ifdef CPU_IXP12X0 - if (cputype == CPU_ID_IXP1200) { - cpufuncs = ixp12x0_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 1; - get_cachetype_table(); - pmap_pte_init_sa1(); - goto out; - } -#endif /* CPU_IXP12X0 */ + #ifdef CPU_XSCALE_80200 if (cputype == CPU_ID_80200) { int rev = cpufunc_id() & CPU_ID_REVISION_MASK; @@ -1626,8 +1197,6 @@ out: * * DEBUG_FAULT_CORRECTION - Print debugging information during the * correction of registers after a fault. - * ARM6_LATE_ABORT - ARM6 supports both early and late aborts - * when defined should use late aborts */ @@ -1642,344 +1211,12 @@ cpufunc_null_fixup(arg) return(ABORT_FIXUP_OK); } - -#if defined(CPU_ARM7TDMI) - -#ifdef DEBUG_FAULT_CORRECTION -#define DFC_PRINTF(x) printf x -#define DFC_DISASSEMBLE(x) disassemble(x) -#else -#define DFC_PRINTF(x) /* nothing */ -#define DFC_DISASSEMBLE(x) /* nothing */ -#endif - /* - * "Early" data abort fixup. - * - * For ARM2, ARM2as, ARM3 and ARM6 (in early-abort mode). Also used - * indirectly by ARM6 (in late-abort mode) and ARM7[TDMI]. - * - * In early aborts, we may have to fix up LDM, STM, LDC and STC. + * CPU Setup code */ -int -early_abort_fixup(arg) - void *arg; -{ - struct trapframe *frame = arg; - u_int fault_pc; - u_int fault_instruction; - int saved_lr = 0; - - if ((frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) { - - /* Ok an abort in SVC mode */ - - /* - * Copy the SVC r14 into the usr r14 - The usr r14 is garbage - * as the fault happened in svc mode but we need it in the - * usr slot so we can treat the registers as an array of ints - * during fixing. - * NOTE: This PC is in the position but writeback is not - * allowed on r15. - * Doing it like this is more efficient than trapping this - * case in all possible locations in the following fixup code. - */ - - saved_lr = frame->tf_usr_lr; - frame->tf_usr_lr = frame->tf_svc_lr; - - /* - * Note the trapframe does not have the SVC r13 so a fault - * from an instruction with writeback to r13 in SVC mode is - * not allowed. This should not happen as the kstack is - * always valid. - */ - } - - /* Get fault address and status from the CPU */ - - fault_pc = frame->tf_pc; - fault_instruction = *((volatile unsigned int *)fault_pc); - - /* Decode the fault instruction and fix the registers as needed */ - - if ((fault_instruction & 0x0e000000) == 0x08000000) { - int base; - int loop; - int count; - int *registers = &frame->tf_r0; - - DFC_PRINTF(("LDM/STM\n")); - DFC_DISASSEMBLE(fault_pc); - if (fault_instruction & (1 << 21)) { - DFC_PRINTF(("This instruction must be corrected\n")); - base = (fault_instruction >> 16) & 0x0f; - if (base == 15) - return ABORT_FIXUP_FAILED; - /* Count registers transferred */ - count = 0; - for (loop = 0; loop < 16; ++loop) { - if (fault_instruction & (1<tf_r0; - - /* REGISTER CORRECTION IS REQUIRED FOR THESE INSTRUCTIONS */ - - DFC_DISASSEMBLE(fault_pc); - - /* Only need to fix registers if write back is turned on */ - - if ((fault_instruction & (1 << 21)) != 0) { - base = (fault_instruction >> 16) & 0x0f; - if (base == 13 && - (frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) - return ABORT_FIXUP_FAILED; - if (base == 15) - return ABORT_FIXUP_FAILED; - - offset = (fault_instruction & 0xff) << 2; - DFC_PRINTF(("r%d=%08x\n", base, registers[base])); - if ((fault_instruction & (1 << 23)) != 0) - offset = -offset; - registers[base] += offset; - DFC_PRINTF(("r%d=%08x\n", base, registers[base])); - } - } else if ((fault_instruction & 0x0e000000) == 0x0c000000) - return ABORT_FIXUP_FAILED; - - if ((frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) { - - /* Ok an abort in SVC mode */ - - /* - * Copy the SVC r14 into the usr r14 - The usr r14 is garbage - * as the fault happened in svc mode but we need it in the - * usr slot so we can treat the registers as an array of ints - * during fixing. - * NOTE: This PC is in the position but writeback is not - * allowed on r15. - * Doing it like this is more efficient than trapping this - * case in all possible locations in the prior fixup code. - */ - - frame->tf_svc_lr = frame->tf_usr_lr; - frame->tf_usr_lr = saved_lr; - - /* - * Note the trapframe does not have the SVC r13 so a fault - * from an instruction with writeback to r13 in SVC mode is - * not allowed. This should not happen as the kstack is - * always valid. - */ - } - - return(ABORT_FIXUP_OK); -} -#endif /* CPU_ARM2/250/3/6/7 */ - - -#if defined(CPU_ARM7TDMI) -/* - * "Late" (base updated) data abort fixup - * - * For ARM6 (in late-abort mode) and ARM7. - * - * In this model, all data-transfer instructions need fixing up. We defer - * LDM, STM, LDC and STC fixup to the early-abort handler. - */ -int -late_abort_fixup(arg) - void *arg; -{ - struct trapframe *frame = arg; - u_int fault_pc; - u_int fault_instruction; - int saved_lr = 0; - - if ((frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) { - - /* Ok an abort in SVC mode */ - - /* - * Copy the SVC r14 into the usr r14 - The usr r14 is garbage - * as the fault happened in svc mode but we need it in the - * usr slot so we can treat the registers as an array of ints - * during fixing. - * NOTE: This PC is in the position but writeback is not - * allowed on r15. - * Doing it like this is more efficient than trapping this - * case in all possible locations in the following fixup code. - */ - - saved_lr = frame->tf_usr_lr; - frame->tf_usr_lr = frame->tf_svc_lr; - - /* - * Note the trapframe does not have the SVC r13 so a fault - * from an instruction with writeback to r13 in SVC mode is - * not allowed. This should not happen as the kstack is - * always valid. - */ - } - - /* Get fault address and status from the CPU */ - - fault_pc = frame->tf_pc; - fault_instruction = *((volatile unsigned int *)fault_pc); - - /* Decode the fault instruction and fix the registers as needed */ - - /* Was is a swap instruction ? */ - if ((fault_instruction & 0x0fb00ff0) == 0x01000090) { - DFC_DISASSEMBLE(fault_pc); - } else if ((fault_instruction & 0x0c000000) == 0x04000000) { - - /* Was is a ldr/str instruction */ - /* This is for late abort only */ - - int base; - int offset; - int *registers = &frame->tf_r0; - - DFC_DISASSEMBLE(fault_pc); - - /* This is for late abort only */ - - if ((fault_instruction & (1 << 24)) == 0 - || (fault_instruction & (1 << 21)) != 0) { - /* postindexed ldr/str with no writeback */ - - base = (fault_instruction >> 16) & 0x0f; - if (base == 13 && - (frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) - return ABORT_FIXUP_FAILED; - if (base == 15) - return ABORT_FIXUP_FAILED; - DFC_PRINTF(("late abt fix: r%d=%08x : ", - base, registers[base])); - if ((fault_instruction & (1 << 25)) == 0) { - /* Immediate offset - easy */ - - offset = fault_instruction & 0xfff; - if ((fault_instruction & (1 << 23))) - offset = -offset; - registers[base] += offset; - DFC_PRINTF(("imm=%08x ", offset)); - } else { - /* offset is a shifted register */ - int shift; - - offset = fault_instruction & 0x0f; - if (offset == base) - return ABORT_FIXUP_FAILED; - - /* - * Register offset - hard we have to - * cope with shifts ! - */ - offset = registers[offset]; - - if ((fault_instruction & (1 << 4)) == 0) - /* shift with amount */ - shift = (fault_instruction >> 7) & 0x1f; - else { - /* shift with register */ - if ((fault_instruction & (1 << 7)) != 0) - /* undefined for now so bail out */ - return ABORT_FIXUP_FAILED; - shift = ((fault_instruction >> 8) & 0xf); - if (base == shift) - return ABORT_FIXUP_FAILED; - DFC_PRINTF(("shift reg=%d ", shift)); - shift = registers[shift]; - } - DFC_PRINTF(("shift=%08x ", shift)); - switch (((fault_instruction >> 5) & 0x3)) { - case 0 : /* Logical left */ - offset = (int)(((u_int)offset) << shift); - break; - case 1 : /* Logical Right */ - if (shift == 0) shift = 32; - offset = (int)(((u_int)offset) >> shift); - break; - case 2 : /* Arithmetic Right */ - if (shift == 0) shift = 32; - offset = (int)(((int)offset) >> shift); - break; - case 3 : /* Rotate right (rol or rxx) */ - return ABORT_FIXUP_FAILED; - break; - } - - DFC_PRINTF(("abt: fixed LDR/STR with " - "register offset\n")); - if ((fault_instruction & (1 << 23))) - offset = -offset; - DFC_PRINTF(("offset=%08x ", offset)); - registers[base] += offset; - } - DFC_PRINTF(("r%d=%08x\n", base, registers[base])); - } - } - - if ((frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) { - - /* Ok an abort in SVC mode */ - - /* - * Copy the SVC r14 into the usr r14 - The usr r14 is garbage - * as the fault happened in svc mode but we need it in the - * usr slot so we can treat the registers as an array of ints - * during fixing. - * NOTE: This PC is in the position but writeback is not - * allowed on r15. - * Doing it like this is more efficient than trapping this - * case in all possible locations in the prior fixup code. - */ - - frame->tf_svc_lr = frame->tf_usr_lr; - frame->tf_usr_lr = saved_lr; - - /* - * Note the trapframe does not have the SVC r13 so a fault - * from an instruction with writeback to r13 in SVC mode is - * not allowed. This should not happen as the kstack is - * always valid. - */ - } - - /* - * Now let the early-abort fixup routine have a go, in case it - * was an LDM, STM, LDC or STC that faulted. - */ - - return early_abort_fixup(arg); -} -#endif /* CPU_ARM7TDMI */ - -/* - * CPU Setup code - */ - -#if defined(CPU_ARM7TDMI) || defined(CPU_ARM8) || defined (CPU_ARM9) || \ +#if defined (CPU_ARM9) || \ defined(CPU_ARM9E) || \ - defined(CPU_SA110) || defined(CPU_SA1100) || defined(CPU_SA1110) || \ defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ @@ -2029,148 +1266,7 @@ parse_cpu_options(args, optlist, cpuctrl } return(cpuctrl); } -#endif /* CPU_ARM7TDMI || CPU_ARM8 || CPU_SA110 || XSCALE*/ - -#if defined(CPU_ARM7TDMI) || defined(CPU_ARM8) -struct cpu_option arm678_options[] = { -#ifdef COMPAT_12 - { "nocache", IGN, BIC, CPU_CONTROL_IDC_ENABLE }, - { "nowritebuf", IGN, BIC, CPU_CONTROL_WBUF_ENABLE }, -#endif /* COMPAT_12 */ - { "cpu.cache", BIC, OR, CPU_CONTROL_IDC_ENABLE }, - { "cpu.nocache", OR, BIC, CPU_CONTROL_IDC_ENABLE }, - { "cpu.writebuf", BIC, OR, CPU_CONTROL_WBUF_ENABLE }, - { "cpu.nowritebuf", OR, BIC, CPU_CONTROL_WBUF_ENABLE }, - { NULL, IGN, IGN, 0 } -}; - -#endif /* CPU_ARM6 || CPU_ARM7 || CPU_ARM7TDMI || CPU_ARM8 */ - -#ifdef CPU_ARM7TDMI -struct cpu_option arm7tdmi_options[] = { - { "arm7.cache", BIC, OR, CPU_CONTROL_IDC_ENABLE }, - { "arm7.nocache", OR, BIC, CPU_CONTROL_IDC_ENABLE }, - { "arm7.writebuf", BIC, OR, CPU_CONTROL_WBUF_ENABLE }, - { "arm7.nowritebuf", OR, BIC, CPU_CONTROL_WBUF_ENABLE }, -#ifdef COMPAT_12 - { "fpaclk2", BIC, OR, CPU_CONTROL_CPCLK }, -#endif /* COMPAT_12 */ - { "arm700.fpaclk", BIC, OR, CPU_CONTROL_CPCLK }, - { NULL, IGN, IGN, 0 } -}; - -void -arm7tdmi_setup(args) - char *args; -{ - int cpuctrl; - - cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE - | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IDC_ENABLE | CPU_CONTROL_WBUF_ENABLE; - - cpuctrl = parse_cpu_options(args, arm678_options, cpuctrl); - cpuctrl = parse_cpu_options(args, arm7tdmi_options, cpuctrl); - -#ifdef __ARMEB__ - cpuctrl |= CPU_CONTROL_BEND_ENABLE; -#endif - - /* Clear out the cache */ - cpu_idcache_wbinv_all(); - - /* Set the control register */ - ctrl = cpuctrl; - cpu_control(0xffffffff, cpuctrl); -} -#endif /* CPU_ARM7TDMI */ - -#ifdef CPU_ARM8 -struct cpu_option arm8_options[] = { - { "arm8.cache", BIC, OR, CPU_CONTROL_IDC_ENABLE }, - { "arm8.nocache", OR, BIC, CPU_CONTROL_IDC_ENABLE }, - { "arm8.writebuf", BIC, OR, CPU_CONTROL_WBUF_ENABLE }, - { "arm8.nowritebuf", OR, BIC, CPU_CONTROL_WBUF_ENABLE }, -#ifdef COMPAT_12 - { "branchpredict", BIC, OR, CPU_CONTROL_BPRD_ENABLE }, -#endif /* COMPAT_12 */ - { "cpu.branchpredict", BIC, OR, CPU_CONTROL_BPRD_ENABLE }, - { "arm8.branchpredict", BIC, OR, CPU_CONTROL_BPRD_ENABLE }, - { NULL, IGN, IGN, 0 } -}; - -void -arm8_setup(args) - char *args; -{ - int integer; - int cpuctrl, cpuctrlmask; - int clocktest; - int setclock = 0; - - cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE - | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IDC_ENABLE | CPU_CONTROL_WBUF_ENABLE; - cpuctrlmask = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE - | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IDC_ENABLE | CPU_CONTROL_WBUF_ENABLE - | CPU_CONTROL_BPRD_ENABLE | CPU_CONTROL_ROM_ENABLE - | CPU_CONTROL_BEND_ENABLE | CPU_CONTROL_AFLT_ENABLE; - -#ifndef ARM32_DISABLE_ALIGNMENT_FAULTS - cpuctrl |= CPU_CONTROL_AFLT_ENABLE; -#endif - - cpuctrl = parse_cpu_options(args, arm678_options, cpuctrl); - cpuctrl = parse_cpu_options(args, arm8_options, cpuctrl); - -#ifdef __ARMEB__ - cpuctrl |= CPU_CONTROL_BEND_ENABLE; -#endif - - /* Get clock configuration */ - clocktest = arm8_clock_config(0, 0) & 0x0f; - - /* Special ARM8 clock and test configuration */ - if (get_bootconf_option(args, "arm8.clock.reset", BOOTOPT_TYPE_BOOLEAN, &integer)) { - clocktest = 0; - setclock = 1; - } - if (get_bootconf_option(args, "arm8.clock.dynamic", BOOTOPT_TYPE_BOOLEAN, &integer)) { - if (integer) - clocktest |= 0x01; - else - clocktest &= ~(0x01); - setclock = 1; - } - if (get_bootconf_option(args, "arm8.clock.sync", BOOTOPT_TYPE_BOOLEAN, &integer)) { - if (integer) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 13:59:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 87B1ADF6; Sat, 17 May 2014 13:59: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 68B452404; Sat, 17 May 2014 13:59: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 s4HDxDVF026994; Sat, 17 May 2014 13:59:13 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HDxB3A026980; Sat, 17 May 2014 13:59:11 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171359.s4HDxB3A026980@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 13:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266312 - in stable/10/sys: amd64/amd64 arm/arm i386/i386 ia64/ia64 mips/mips powerpc/powerpc sparc64/sparc64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 13:59:13 -0000 Author: ian Date: Sat May 17 13:59:11 2014 New Revision: 266312 URL: http://svnweb.freebsd.org/changeset/base/266312 Log: MFC 263036, 263059: delete advertising clause in licenses, renumber. Modified: stable/10/sys/amd64/amd64/uio_machdep.c stable/10/sys/arm/arm/sys_machdep.c stable/10/sys/arm/arm/uio_machdep.c stable/10/sys/i386/i386/uio_machdep.c stable/10/sys/ia64/ia64/uio_machdep.c stable/10/sys/mips/mips/uio_machdep.c stable/10/sys/powerpc/powerpc/uio_machdep.c stable/10/sys/sparc64/sparc64/uio_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/uio_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/uio_machdep.c Sat May 17 13:53:38 2014 (r266311) +++ stable/10/sys/amd64/amd64/uio_machdep.c Sat May 17 13:59:11 2014 (r266312) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/sys/arm/arm/sys_machdep.c ============================================================================== --- stable/10/sys/arm/arm/sys_machdep.c Sat May 17 13:53:38 2014 (r266311) +++ stable/10/sys/arm/arm/sys_machdep.c Sat May 17 13:59:11 2014 (r266312) @@ -10,11 +10,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/sys/arm/arm/uio_machdep.c ============================================================================== --- stable/10/sys/arm/arm/uio_machdep.c Sat May 17 13:53:38 2014 (r266311) +++ stable/10/sys/arm/arm/uio_machdep.c Sat May 17 13:59:11 2014 (r266312) @@ -16,11 +16,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 by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/sys/i386/i386/uio_machdep.c ============================================================================== --- stable/10/sys/i386/i386/uio_machdep.c Sat May 17 13:53:38 2014 (r266311) +++ stable/10/sys/i386/i386/uio_machdep.c Sat May 17 13:59:11 2014 (r266312) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/sys/ia64/ia64/uio_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/uio_machdep.c Sat May 17 13:53:38 2014 (r266311) +++ stable/10/sys/ia64/ia64/uio_machdep.c Sat May 17 13:59:11 2014 (r266312) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/sys/mips/mips/uio_machdep.c ============================================================================== --- stable/10/sys/mips/mips/uio_machdep.c Sat May 17 13:53:38 2014 (r266311) +++ stable/10/sys/mips/mips/uio_machdep.c Sat May 17 13:59:11 2014 (r266312) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/sys/powerpc/powerpc/uio_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/uio_machdep.c Sat May 17 13:53:38 2014 (r266311) +++ stable/10/sys/powerpc/powerpc/uio_machdep.c Sat May 17 13:59:11 2014 (r266312) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: stable/10/sys/sparc64/sparc64/uio_machdep.c ============================================================================== --- stable/10/sys/sparc64/sparc64/uio_machdep.c Sat May 17 13:53:38 2014 (r266311) +++ stable/10/sys/sparc64/sparc64/uio_machdep.c Sat May 17 13:59:11 2014 (r266312) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 14:03:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1B64816A; Sat, 17 May 2014 14:03: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 0814F24A2; Sat, 17 May 2014 14:03: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 s4HE3kuh032562; Sat, 17 May 2014 14:03:46 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HE3kap032560; Sat, 17 May 2014 14:03:46 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171403.s4HE3kap032560@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 14:03:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266313 - in stable/10: sys/arm/conf usr.bin/dtc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 14:03:47 -0000 Author: ian Date: Sat May 17 14:03:46 2014 New Revision: 266313 URL: http://svnweb.freebsd.org/changeset/base/266313 Log: MFC 263199, 263207 Fix error mesasge in dtc. Add tmpfs, mbr, and bsdlabel options back to wandboard kernel config. Modified: stable/10/sys/arm/conf/WANDBOARD.common stable/10/usr.bin/dtc/fdt.cc Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/WANDBOARD.common ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD.common Sat May 17 13:59:11 2014 (r266312) +++ stable/10/sys/arm/conf/WANDBOARD.common Sat May 17 14:03:46 2014 (r266313) @@ -35,10 +35,13 @@ options NFSCL # New Network Filesyst #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options KTRACE # ktrace(1) support Modified: stable/10/usr.bin/dtc/fdt.cc ============================================================================== --- stable/10/usr.bin/dtc/fdt.cc Sat May 17 13:59:11 2014 (r266312) +++ stable/10/usr.bin/dtc/fdt.cc Sat May 17 14:03:46 2014 (r266313) @@ -1374,7 +1374,7 @@ device_tree::parse_dts(const char *fn, F (input.next_token(), input.consume_integer(len)))) { - input.parse_error("Expected /dts-v1/; version string"); + input.parse_error("Expected size on /memreserve/ node."); } input.next_token(); input.consume(';'); From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 14:22:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 069D1567; Sat, 17 May 2014 14:22: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 E58962646; Sat, 17 May 2014 14:22: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 s4HEMdX8044964; Sat, 17 May 2014 14:22:39 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HEMbNR044944; Sat, 17 May 2014 14:22:37 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171422.s4HEMbNR044944@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 14:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266314 - in stable/10/lib: libc/arm libc/arm/aeabi msun/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 14:22:40 -0000 Author: ian Date: Sat May 17 14:22:37 2014 New Revision: 266314 URL: http://svnweb.freebsd.org/changeset/base/266314 Log: MFC 262989, 263210, 263230, 263231, 263239, 263242, 263243, Export _libc_arm_fpu_present as a private symbol to be used by other system libraries, for example libm. On armv6 access both the softfloat and, when available, the vfp to get and set the floating-point environment. Build fenv-vfp.c with the softfp float abi. Without this gcc generates an incorrect assembly file that doesn't allow for vfp instructions. Only build the vfp/softfp switching code on armv6 as we don't support vfp on anything earlier than this. This should fix the armeb and arm builds when using gcc. Add an optimised version of the float and double helper functions. Added: stable/10/lib/libc/arm/aeabi/aeabi_vfp.h - copied, changed from r263239, head/lib/libc/arm/aeabi/aeabi_vfp.h stable/10/lib/libc/arm/aeabi/aeabi_vfp_double.S - copied unchanged from r263239, head/lib/libc/arm/aeabi/aeabi_vfp_double.S stable/10/lib/libc/arm/aeabi/aeabi_vfp_float.S - copied unchanged from r263239, head/lib/libc/arm/aeabi/aeabi_vfp_float.S stable/10/lib/msun/arm/fenv-mangle.h - copied unchanged from r263210, head/lib/msun/arm/fenv-mangle.h stable/10/lib/msun/arm/fenv-softfp.c - copied unchanged from r263210, head/lib/msun/arm/fenv-softfp.c stable/10/lib/msun/arm/fenv-vfp.c - copied unchanged from r263210, head/lib/msun/arm/fenv-vfp.c Modified: stable/10/lib/libc/arm/Symbol.map stable/10/lib/libc/arm/aeabi/Makefile.inc stable/10/lib/libc/arm/aeabi/aeabi_double.c stable/10/lib/libc/arm/aeabi/aeabi_float.c stable/10/lib/msun/arm/Makefile.inc stable/10/lib/msun/arm/Symbol.map stable/10/lib/msun/arm/fenv.c stable/10/lib/msun/arm/fenv.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/arm/Symbol.map ============================================================================== --- stable/10/lib/libc/arm/Symbol.map Sat May 17 14:03:46 2014 (r266313) +++ stable/10/lib/libc/arm/Symbol.map Sat May 17 14:22:37 2014 (r266314) @@ -76,4 +76,6 @@ FBSDprivate_1.0 { __fixunsdfsi; __extendsfdf2; __truncdfsf2; + + _libc_arm_fpu_present; }; Modified: stable/10/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- stable/10/lib/libc/arm/aeabi/Makefile.inc Sat May 17 14:03:46 2014 (r266313) +++ stable/10/lib/libc/arm/aeabi/Makefile.inc Sat May 17 14:22:37 2014 (r266314) @@ -6,6 +6,10 @@ SRCS+= aeabi_atexit.c \ aeabi_double.c \ aeabi_float.c \ aeabi_unwind_cpp.c +.if ${MACHINE_ARCH:Marmv6*} +SRCS+= aeabi_vfp_double.S \ + aeabi_vfp_float.S +.endif # Add the aeabi_mem* functions. While they live in compiler-rt they call into # libc. This causes issues when other parts of libc call these functions. Modified: stable/10/lib/libc/arm/aeabi/aeabi_double.c ============================================================================== --- stable/10/lib/libc/arm/aeabi/aeabi_double.c Sat May 17 14:03:46 2014 (r266313) +++ stable/10/lib/libc/arm/aeabi/aeabi_double.c Sat May 17 14:22:37 2014 (r266314) @@ -32,70 +32,45 @@ __FBSDID("$FreeBSD$"); #include "milieu.h" #include "softfloat.h" +#include "aeabi_vfp.h" + +extern int _libc_arm_fpu_present; + flag __unorddf2(float64, float64); -int __aeabi_dcmpeq(float64 a, float64 b) -{ - return float64_eq(a, b); -} - -int __aeabi_dcmplt(float64 a, float64 b) -{ - return float64_lt(a, b); -} - -int __aeabi_dcmple(float64 a, float64 b) -{ - return float64_le(a, b); -} - -int __aeabi_dcmpge(float64 a, float64 b) -{ - return float64_le(b, a); -} - -int __aeabi_dcmpgt(float64 a, float64 b) -{ - return float64_lt(b, a); -} - -int __aeabi_dcmpun(float64 a, float64 b) -{ - return __unorddf2(a, b); -} - -int __aeabi_d2iz(float64 a) -{ - return float64_to_int32_round_to_zero(a); -} - -float32 __aeabi_d2f(float64 a) -{ - return float64_to_float32(a); -} - -float64 __aeabi_i2d(int a) -{ - return int32_to_float64(a); -} - -float64 __aeabi_dadd(float64 a, float64 b) -{ - return float64_add(a, b); -} - -float64 __aeabi_ddiv(float64 a, float64 b) -{ - return float64_div(a, b); -} - -float64 __aeabi_dmul(float64 a, float64 b) -{ - return float64_mul(a, b); -} - -float64 __aeabi_dsub(float64 a, float64 b) -{ - return float64_sub(a, b); -} +/* These are written in asm and are only called from this file */ +int __aeabi_dcmpeq_vfp(float64, float64); +int __aeabi_dcmplt_vfp(float64, float64); +int __aeabi_dcmple_vfp(float64, float64); +int __aeabi_dcmpgt_vfp(float64, float64); +int __aeabi_dcmpge_vfp(float64, float64); +int __aeabi_dcmpun_vfp(float64, float64); +int __aeabi_d2iz_vfp(float64); +float32 __aeabi_d2f_vfp(float64); +float64 __aeabi_i2d_vfp(int); +float64 __aeabi_dadd_vfp(float64, float64); +float64 __aeabi_ddiv_vfp(float64, float64); +float64 __aeabi_dmul_vfp(float64, float64); +float64 __aeabi_dsub_vfp(float64, float64); + +/* + * Depending on the target these will: + * On armv6 with a vfp call the above function, or + * Call the softfloat function in the 3rd argument. + */ +int AEABI_FUNC2(dcmpeq, float64, float64_eq) +int AEABI_FUNC2(dcmplt, float64, float64_lt) +int AEABI_FUNC2(dcmple, float64, float64_le) +int AEABI_FUNC2_REV(dcmpge, float64, float64_le) +int AEABI_FUNC2_REV(dcmpgt, float64, float64_lt) +int AEABI_FUNC2(dcmpun, float64, __unorddf2) + +int AEABI_FUNC(d2iz, float64, float64_to_int32_round_to_zero) +float32 AEABI_FUNC(d2f, float64, float64_to_float32) +float64 AEABI_FUNC(i2d, int, int32_to_float64) + +float64 AEABI_FUNC2(dadd, float64, float64_add) +float64 AEABI_FUNC2(ddiv, float64, float64_div) +float64 AEABI_FUNC2(dmul, float64, float64_mul) +float64 AEABI_FUNC2(dsub, float64, float64_sub) Modified: stable/10/lib/libc/arm/aeabi/aeabi_float.c ============================================================================== --- stable/10/lib/libc/arm/aeabi/aeabi_float.c Sat May 17 14:03:46 2014 (r266313) +++ stable/10/lib/libc/arm/aeabi/aeabi_float.c Sat May 17 14:22:37 2014 (r266314) @@ -32,70 +32,45 @@ __FBSDID("$FreeBSD$"); #include "milieu.h" #include "softfloat.h" +#include "aeabi_vfp.h" + +extern int _libc_arm_fpu_present; + flag __unordsf2(float32, float32); -int __aeabi_fcmpeq(float32 a, float32 b) -{ - return float32_eq(a, b); -} - -int __aeabi_fcmplt(float32 a, float32 b) -{ - return float32_lt(a, b); -} - -int __aeabi_fcmple(float32 a, float32 b) -{ - return float32_le(a, b); -} - -int __aeabi_fcmpge(float32 a, float32 b) -{ - return float32_le(b, a); -} - -int __aeabi_fcmpgt(float32 a, float32 b) -{ - return float32_lt(b, a); -} - -int __aeabi_fcmpun(float32 a, float32 b) -{ - return __unordsf2(a, b); -} - -int __aeabi_f2iz(float32 a) -{ - return float32_to_int32_round_to_zero(a); -} - -float32 __aeabi_f2d(float32 a) -{ - return float32_to_float64(a); -} - -float32 __aeabi_i2f(int a) -{ - return int32_to_float32(a); -} - -float32 __aeabi_fadd(float32 a, float32 b) -{ - return float32_add(a, b); -} - -float32 __aeabi_fdiv(float32 a, float32 b) -{ - return float32_div(a, b); -} - -float32 __aeabi_fmul(float32 a, float32 b) -{ - return float32_mul(a, b); -} - -float32 __aeabi_fsub(float32 a, float32 b) -{ - return float32_sub(a, b); -} +/* These are written in asm and are only called from this file */ +int __aeabi_fcmpeq_vfp(float32, float32); +int __aeabi_fcmplt_vfp(float32, float32); +int __aeabi_fcmple_vfp(float32, float32); +int __aeabi_fcmpgt_vfp(float32, float32); +int __aeabi_fcmpge_vfp(float32, float32); +int __aeabi_fcmpun_vfp(float32, float32); +int __aeabi_f2iz_vfp(float32); +float64 __aeabi_f2d_vfp(float32); +float32 __aeabi_i2f_vfp(int); +float32 __aeabi_fadd_vfp(float32, float32); +float32 __aeabi_fdiv_vfp(float32, float32); +float32 __aeabi_fmul_vfp(float32, float32); +float32 __aeabi_fsub_vfp(float32, float32); + +/* + * Depending on the target these will: + * On armv6 with a vfp call the above function, or + * Call the softfloat function in the 3rd argument. + */ +int AEABI_FUNC2(fcmpeq, float32, float32_eq) +int AEABI_FUNC2(fcmplt, float32, float32_lt) +int AEABI_FUNC2(fcmple, float32, float32_le) +int AEABI_FUNC2_REV(fcmpge, float32, float32_le) +int AEABI_FUNC2_REV(fcmpgt, float32, float32_lt) +int AEABI_FUNC2(fcmpun, float32, __unordsf2) + +int AEABI_FUNC(f2iz, float32, float32_to_int32_round_to_zero) +float64 AEABI_FUNC(f2d, float32, float32_to_float64) +float32 AEABI_FUNC(i2f, int, int32_to_float32) + +float32 AEABI_FUNC2(fadd, float32, float32_add) +float32 AEABI_FUNC2(fdiv, float32, float32_div) +float32 AEABI_FUNC2(fmul, float32, float32_mul) +float32 AEABI_FUNC2(fsub, float32, float32_sub) Copied and modified: stable/10/lib/libc/arm/aeabi/aeabi_vfp.h (from r263239, head/lib/libc/arm/aeabi/aeabi_vfp.h) ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_vfp.h Sun Mar 16 13:16:30 2014 (r263239, copy source) +++ stable/10/lib/libc/arm/aeabi/aeabi_vfp.h Sat May 17 14:22:37 2014 (r266314) @@ -65,7 +65,7 @@ * C Helper macros */ -#if 1 && defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) /* * Generate a function that will either call into the VFP implementation, * or the soft float version for a given __aeabi_* helper. The function Copied: stable/10/lib/libc/arm/aeabi/aeabi_vfp_double.S (from r263239, head/lib/libc/arm/aeabi/aeabi_vfp_double.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/arm/aeabi/aeabi_vfp_double.S Sat May 17 14:22:37 2014 (r266314, copy of r263239, head/lib/libc/arm/aeabi/aeabi_vfp_double.S) @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2013 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "aeabi_vfp.h" + +.fpu vfp +.syntax unified + +/* int __aeabi_dcmpeq(double, double) */ +AEABI_ENTRY(dcmpeq) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movne r0, #0 + moveq r0, #1 + RET +AEABI_END(dcmpeq) + +/* int __aeabi_dcmplt(double, double) */ +AEABI_ENTRY(dcmplt) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movcs r0, #0 + movlt r0, #1 + RET +AEABI_END(dcmplt) + +/* int __aeabi_dcmple(double, double) */ +AEABI_ENTRY(dcmple) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movhi r0, #0 + movls r0, #1 + RET +AEABI_END(dcmple) + +/* int __aeabi_dcmpge(double, double) */ +AEABI_ENTRY(dcmpge) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movlt r0, #0 + movge r0, #1 + RET +AEABI_END(dcmpge) + +/* int __aeabi_dcmpgt(double, double) */ +AEABI_ENTRY(dcmpgt) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movle r0, #0 + movgt r0, #1 + RET +AEABI_END(dcmpgt) + +/* int __aeabi_dcmpun(double, double) */ +AEABI_ENTRY(dcmpun) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movvc r0, #0 + movvs r0, #1 + RET +AEABI_END(dcmpun) + +/* int __aeabi_d2iz(double) */ +AEABI_ENTRY(d2iz) + LOAD_DREG(d0, r0, r1) +#if 0 + /* + * This should be the correct instruction, but binutils incorrectly + * encodes it as the version that used FPSCR to determine the rounding. + * When binutils is fixed we can use this again. + */ + vcvt.s32.f64 s0, d0 +#else + ftosizd s0, d0 +#endif + vmov r0, s0 + RET +AEABI_END(d2iz) + +/* float __aeabi_d2f(double) */ +AEABI_ENTRY(d2f) + LOAD_DREG(d0, r0, r1) + vcvt.f32.f64 s0, d0 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(d2f) + +/* double __aeabi_i2d(int) */ +AEABI_ENTRY(i2d) + vmov s0, r0 + vcvt.f64.s32 d0, s0 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(i2d) + +/* double __aeabi_dadd(double, double) */ +AEABI_ENTRY(dadd) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vadd.f64 d0, d0, d1 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(dadd) + +/* double __aeabi_ddiv(double, double) */ +AEABI_ENTRY(ddiv) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vdiv.f64 d0, d0, d1 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(ddiv) + +/* double __aeabi_dmul(double, double) */ +AEABI_ENTRY(dmul) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vmul.f64 d0, d0, d1 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(dmul) + +/* double __aeabi_dsub(double, double) */ +AEABI_ENTRY(dsub) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vsub.f64 d0, d0, d1 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(dsub) + Copied: stable/10/lib/libc/arm/aeabi/aeabi_vfp_float.S (from r263239, head/lib/libc/arm/aeabi/aeabi_vfp_float.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/arm/aeabi/aeabi_vfp_float.S Sat May 17 14:22:37 2014 (r266314, copy of r263239, head/lib/libc/arm/aeabi/aeabi_vfp_float.S) @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2013 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "aeabi_vfp.h" + +.fpu vfp +.syntax unified + +/* int __aeabi_fcmpeq(float, float) */ +AEABI_ENTRY(fcmpeq) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movne r0, #0 + moveq r0, #1 + RET +AEABI_END(fcmpeq) + +/* int __aeabi_fcmplt(float, float) */ +AEABI_ENTRY(fcmplt) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movcs r0, #0 + movlt r0, #1 + RET +AEABI_END(fcmplt) + +/* int __aeabi_fcmple(float, float) */ +AEABI_ENTRY(fcmple) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movhi r0, #0 + movls r0, #1 + RET +AEABI_END(fcmple) + +/* int __aeabi_fcmpge(float, float) */ +AEABI_ENTRY(fcmpge) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movlt r0, #0 + movge r0, #1 + RET +AEABI_END(fcmpge) + +/* int __aeabi_fcmpgt(float, float) */ +AEABI_ENTRY(fcmpgt) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movle r0, #0 + movgt r0, #1 + RET +AEABI_END(fcmpgt) + +/* int __aeabi_fcmpun(float, float) */ +AEABI_ENTRY(fcmpun) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movvc r0, #0 + movvs r0, #1 + RET +AEABI_END(fcmpun) + +/* int __aeabi_f2iz(float) */ +AEABI_ENTRY(f2iz) + LOAD_SREG(s0, r0) +#if 0 + /* + * This should be the correct instruction, but binutils incorrectly + * encodes it as the version that used FPSCR to determine the rounding. + * When binutils is fixed we can use this again. + */ + vcvt.s32.f32 s0, s0 +#else + ftosizs s0, s0 +#endif + vmov r0, s0 + RET +AEABI_END(f2iz) + +/* double __aeabi_f2d(float) */ +AEABI_ENTRY(f2d) + LOAD_SREG(s0, r0) + vcvt.f64.f32 d0, s0 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(f2d) + +/* float __aeabi_i2f(int) */ +AEABI_ENTRY(i2f) + vmov s0, r0 + vcvt.f32.s32 s0, s0 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(i2f) + +/* float __aeabi_fadd(float, float) */ +AEABI_ENTRY(fadd) + LOAD_SREGS(s0, s1, r0, r1) + vadd.f32 s0, s0, s1 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(fadd) + +/* float __aeabi_fmul(float, float) */ +AEABI_ENTRY(fdiv) + LOAD_SREGS(s0, s1, r0, r1) + vdiv.f32 s0, s0, s1 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(fdiv) + +/* float __aeabi_fmul(float, float) */ +AEABI_ENTRY(fmul) + LOAD_SREGS(s0, s1, r0, r1) + vmul.f32 s0, s0, s1 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(fmul) + +/* float __aeabi_fsub(float, float) */ +AEABI_ENTRY(fsub) + LOAD_SREGS(s0, s1, r0, r1) + vsub.f32 s0, s0, s1 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(fsub) + Modified: stable/10/lib/msun/arm/Makefile.inc ============================================================================== --- stable/10/lib/msun/arm/Makefile.inc Sat May 17 14:03:46 2014 (r266313) +++ stable/10/lib/msun/arm/Makefile.inc Sat May 17 14:22:37 2014 (r266314) @@ -2,3 +2,11 @@ LDBL_PREC = 53 SYM_MAPS += ${.CURDIR}/arm/Symbol.map + +.if ${TARGET_ARCH} == "armv6" +ARCH_SRCS = fenv-softfp.c fenv-vfp.c +.endif + +CFLAGS.fenv-vfp.c= -mfloat-abi=softfp +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} + Modified: stable/10/lib/msun/arm/Symbol.map ============================================================================== --- stable/10/lib/msun/arm/Symbol.map Sat May 17 14:03:46 2014 (r266313) +++ stable/10/lib/msun/arm/Symbol.map Sat May 17 14:22:37 2014 (r266314) @@ -15,4 +15,7 @@ FBSD_1.3 { fegetenv; feholdexcept; feupdateenv; + feenableexcept; + fedisableexcept; + fegetexcept; }; Copied: stable/10/lib/msun/arm/fenv-mangle.h (from r263210, head/lib/msun/arm/fenv-mangle.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/arm/fenv-mangle.h Sat May 17 14:22:37 2014 (r266314, copy of r263210, head/lib/msun/arm/fenv-mangle.h) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2013 Andrew Turner + * 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$ + */ + +#ifdef _FENV_MANGLE_H_ +#error Only include fenv-mangle.h once +#endif + +#define _FENV_MANGLE_H_ + +#ifndef FENV_MANGLE +#error FENV_MANGLE is undefined +#endif + +#define feclearexcept FENV_MANGLE(feclearexcept) +#define fegetexceptflag FENV_MANGLE(fegetexceptflag) +#define fesetexceptflag FENV_MANGLE(fesetexceptflag) +#define feraiseexcept FENV_MANGLE(feraiseexcept) +#define fetestexcept FENV_MANGLE(fetestexcept) +#define fegetround FENV_MANGLE(fegetround) +#define fesetround FENV_MANGLE(fesetround) +#define fegetenv FENV_MANGLE(fegetenv) +#define feholdexcept FENV_MANGLE(feholdexcept) +#define fesetenv FENV_MANGLE(fesetenv) +#define feupdateenv FENV_MANGLE(feupdateenv) +#define feenableexcept FENV_MANGLE(feenableexcept) +#define fedisableexcept FENV_MANGLE(fedisableexcept) +#define fegetexcept FENV_MANGLE(fegetexcept) + Copied: stable/10/lib/msun/arm/fenv-softfp.c (from r263210, head/lib/msun/arm/fenv-softfp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/arm/fenv-softfp.c Sat May 17 14:22:37 2014 (r266314, copy of r263210, head/lib/msun/arm/fenv-softfp.c) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2013 Andrew Turner + * 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$ + */ + +#define FENV_MANGLE(x) __softfp_ ##x +#include "fenv-mangle.h" +#include "fenv.c" + Copied: stable/10/lib/msun/arm/fenv-vfp.c (from r263210, head/lib/msun/arm/fenv-vfp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/arm/fenv-vfp.c Sat May 17 14:22:37 2014 (r266314, copy of r263210, head/lib/msun/arm/fenv-vfp.c) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2013 Andrew Turner + * 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$ + */ + +#define FENV_MANGLE(x) __vfp_ ##x +#include "fenv-mangle.h" +#define __ARM_PCS_VFP +#include "fenv.c" + Modified: stable/10/lib/msun/arm/fenv.c ============================================================================== --- stable/10/lib/msun/arm/fenv.c Sat May 17 14:03:46 2014 (r266313) +++ stable/10/lib/msun/arm/fenv.c Sat May 17 14:22:37 2014 (r266314) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2004 David Schultz + * Copyright (c) 2013 Andrew Turner * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,11 +30,34 @@ #define __fenv_static #include "fenv.h" +#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#define FENV_ARMv6 +#endif + +/* When SOFTFP_ABI is defined we are using the softfp ABI. */ +#if defined(__VFP_FP__) && !defined(__ARM_PCS_VFP) +#define SOFTFP_ABI +#endif + + +#ifndef FENV_MANGLE +/* + * Hopefully the system ID byte is immutable, so it's valid to use + * this as a default environment. + */ +const fenv_t __fe_dfl_env = 0; +#endif + + +/* If this is a non-mangled softfp version special processing is required */ +#if defined(FENV_MANGLE) || !defined(SOFTFP_ABI) || !defined(FENV_ARMv6) + /* * The following macros map between the softfloat emulator's flags and * the hardware's FPSR. The hardware this file was written for doesn't * have rounding control bits, so we stick those in the system ID byte. */ +#ifndef __ARM_PCS_VFP #define __set_env(env, flags, mask, rnd) env = ((flags) \ | (mask)<<_FPUSW_SHIFT \ | (rnd) << 24) @@ -42,17 +66,12 @@ & FE_ALL_EXCEPT) #define __env_round(env) (((env) >> 24) & _ROUND_MASK) #include "fenv-softfloat.h" +#endif #ifdef __GNUC_GNU_INLINE__ #error "This file must be compiled with C99 'inline' semantics" #endif -/* - * Hopefully the system ID byte is immutable, so it's valid to use - * this as a default environment. - */ -const fenv_t __fe_dfl_env = 0; - extern inline int feclearexcept(int __excepts); extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts); extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts); @@ -64,3 +83,233 @@ extern inline int fegetenv(fenv_t *__env extern inline int feholdexcept(fenv_t *__envp); extern inline int fesetenv(const fenv_t *__envp); extern inline int feupdateenv(const fenv_t *__envp); +extern inline int feenableexcept(int __mask); +extern inline int fedisableexcept(int __mask); +extern inline int fegetexcept(void); + +#else /* !FENV_MANGLE && SOFTFP_ABI */ +/* Set by libc when the VFP unit is enabled */ +extern int _libc_arm_fpu_present; + +int __softfp_feclearexcept(int __excepts); +int __softfp_fegetexceptflag(fexcept_t *__flagp, int __excepts); +int __softfp_fesetexceptflag(const fexcept_t *__flagp, int __excepts); +int __softfp_feraiseexcept(int __excepts); +int __softfp_fetestexcept(int __excepts); +int __softfp_fegetround(void); +int __softfp_fesetround(int __round); +int __softfp_fegetenv(fenv_t *__envp); +int __softfp_feholdexcept(fenv_t *__envp); +int __softfp_fesetenv(const fenv_t *__envp); +int __softfp_feupdateenv(const fenv_t *__envp); +int __softfp_feenableexcept(int __mask); +int __softfp_fedisableexcept(int __mask); +int __softfp_fegetexcept(void); + +int __vfp_feclearexcept(int __excepts); +int __vfp_fegetexceptflag(fexcept_t *__flagp, int __excepts); +int __vfp_fesetexceptflag(const fexcept_t *__flagp, int __excepts); +int __vfp_feraiseexcept(int __excepts); +int __vfp_fetestexcept(int __excepts); +int __vfp_fegetround(void); +int __vfp_fesetround(int __round); +int __vfp_fegetenv(fenv_t *__envp); +int __vfp_feholdexcept(fenv_t *__envp); +int __vfp_fesetenv(const fenv_t *__envp); +int __vfp_feupdateenv(const fenv_t *__envp); +int __vfp_feenableexcept(int __mask); +int __vfp_fedisableexcept(int __mask); +int __vfp_fegetexcept(void); + +static int +__softfp_round_to_vfp(int round) +{ + + switch (round) { + case FE_TONEAREST: + default: + return VFP_FE_TONEAREST; + case FE_TOWARDZERO: + return VFP_FE_TOWARDZERO; + case FE_UPWARD: + return VFP_FE_UPWARD; + case FE_DOWNWARD: + return VFP_FE_DOWNWARD; + } +} + +static int +__softfp_round_from_vfp(int round) +{ + + switch (round) { + case VFP_FE_TONEAREST: + default: + return FE_TONEAREST; + case VFP_FE_TOWARDZERO: + return FE_TOWARDZERO; + case VFP_FE_UPWARD: + return FE_UPWARD; + case VFP_FE_DOWNWARD: + return FE_DOWNWARD; + } +} + +int feclearexcept(int __excepts) +{ + + if (_libc_arm_fpu_present) + __vfp_feclearexcept(__excepts); + __softfp_feclearexcept(__excepts); + + return (0); +} + +int fegetexceptflag(fexcept_t *__flagp, int __excepts) +{ + fexcept_t __vfp_flagp; + + __vfp_flagp = 0; + if (_libc_arm_fpu_present) + __vfp_fegetexceptflag(&__vfp_flagp, __excepts); + __softfp_fegetexceptflag(__flagp, __excepts); + + *__flagp |= __vfp_flagp; + + return (0); +} + +int fesetexceptflag(const fexcept_t *__flagp, int __excepts) +{ + + if (_libc_arm_fpu_present) + __vfp_fesetexceptflag(__flagp, __excepts); + __softfp_fesetexceptflag(__flagp, __excepts); + + return (0); +} + +int feraiseexcept(int __excepts) +{ + + if (_libc_arm_fpu_present) + __vfp_feraiseexcept(__excepts); + __softfp_feraiseexcept(__excepts); + + return (0); +} + +int fetestexcept(int __excepts) +{ + int __got_excepts; + + __got_excepts = 0; + if (_libc_arm_fpu_present) + __got_excepts = __vfp_fetestexcept(__excepts); + __got_excepts |= __softfp_fetestexcept(__excepts); + + return (__got_excepts); +} + +int fegetround(void) +{ + + if (_libc_arm_fpu_present) + return __softfp_round_from_vfp(__vfp_fegetround()); + return __softfp_fegetround(); +} + +int fesetround(int __round) +{ + + if (_libc_arm_fpu_present) + __vfp_fesetround(__softfp_round_to_vfp(__round)); + __softfp_fesetround(__round); + + return (0); +} + +int fegetenv(fenv_t *__envp) +{ + fenv_t __vfp_envp; + + __vfp_envp = 0; + if (_libc_arm_fpu_present) + __vfp_fegetenv(&__vfp_envp); + __softfp_fegetenv(__envp); + *__envp |= __vfp_envp; + + return (0); +} + +int feholdexcept(fenv_t *__envp) +{ + fenv_t __vfp_envp; + + __vfp_envp = 0; + if (_libc_arm_fpu_present) + __vfp_feholdexcept(&__vfp_envp); + __softfp_feholdexcept(__envp); + *__envp |= __vfp_envp; + + return (0); +} + +int fesetenv(const fenv_t *__envp) +{ + + if (_libc_arm_fpu_present) + __vfp_fesetenv(__envp); + __softfp_fesetenv(__envp); + + return (0); +} + +int feupdateenv(const fenv_t *__envp) +{ + + if (_libc_arm_fpu_present) + __vfp_feupdateenv(__envp); + __softfp_feupdateenv(__envp); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 14:35:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 91D2B986; Sat, 17 May 2014 14:35: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 7F037275C; Sat, 17 May 2014 14:35: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 s4HEZI35051311; Sat, 17 May 2014 14:35:18 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HEZIHp051310; Sat, 17 May 2014 14:35:18 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405171435.s4HEZIHp051310@svn.freebsd.org> From: Alan Cox Date: Sat, 17 May 2014 14:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266315 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 14:35:18 -0000 Author: alc Date: Sat May 17 14:35:18 2014 New Revision: 266315 URL: http://svnweb.freebsd.org/changeset/base/266315 Log: MFC r265850 About 9% of the pmap_protect() calls being performed by vm_map_copy_entry() are unnecessary. Eliminate the unnecessary calls. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Sat May 17 14:22:37 2014 (r266314) +++ stable/10/sys/vm/vm_map.c Sat May 17 14:35:18 2014 (r266315) @@ -3023,7 +3023,8 @@ vm_map_copy_entry( * If the source entry is marked needs_copy, it is already * write-protected. */ - if ((src_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) { + if ((src_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0 && + (src_entry->protection & VM_PROT_WRITE) != 0) { pmap_protect(src_map->pmap, src_entry->start, src_entry->end, From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 16:10:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1A4D9C0D; Sat, 17 May 2014 16:10:56 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id E0505204A; Sat, 17 May 2014 16:10:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 57FE538069; Sat, 17 May 2014 11:10:49 -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 duck8PH81Bof; Sat, 17 May 2014 11:10:49 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 9243338046; Sat, 17 May 2014 11:10:48 -0500 (CDT) Message-ID: <53778A07.7000003@freebsd.org> Date: Sat, 17 May 2014 09:10:47 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: sbruno@freebsd.org Subject: Re: svn commit: r266273 - in stable/10/sys: amd64/conf conf i386/conf References: <201405162255.s4GMt1GR077643@svn.freebsd.org> <5376AFFA.3010902@freebsd.org> <1400289486.1535.1.camel@bruno> In-Reply-To: <1400289486.1535.1.camel@bruno> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org, Ian Lepore X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 16:10:56 -0000 On 05/16/14 18:18, Sean Bruno wrote: > On Fri, 2014-05-16 at 17:40 -0700, Nathan Whitehorn wrote: >> I missed the original commit of this, but why doesn't this code work on >> non-x86 systems? QEMU works perfectly fine on other architectures. >> -Nathan > > I am only supporting this on x86 systems, if there is someone who is > using this actively on ${ARCH} then I see no reason to enable it there. > > sean > But why restrict it? Tier-2 systems basically mean "no guarantees" and that's fine. But there doesn't seem to be any reason to make code platform-specific that is not inherently so. -Nathan From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 16:46:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EE90917E; Sat, 17 May 2014 16:46: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 DACFC23AC; Sat, 17 May 2014 16:46: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 s4HGkHMC032280; Sat, 17 May 2014 16:46:17 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HGkGjM032266; Sat, 17 May 2014 16:46:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171646.s4HGkGjM032266@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 16:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266328 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 16:46:18 -0000 Author: ian Date: Sat May 17 16:46:15 2014 New Revision: 266328 URL: http://svnweb.freebsd.org/changeset/base/266328 Log: MFC 263245: Make all the comments '# ' and align to same column. Modified: stable/10/sys/arm/conf/AC100 stable/10/sys/arm/conf/ARMADAXP stable/10/sys/arm/conf/ARNDALE stable/10/sys/arm/conf/ATMEL stable/10/sys/arm/conf/AVILA stable/10/sys/arm/conf/BEAGLEBONE stable/10/sys/arm/conf/BWCT stable/10/sys/arm/conf/CAMBRIA stable/10/sys/arm/conf/CNS11XXNAS stable/10/sys/arm/conf/CRB stable/10/sys/arm/conf/CUBIEBOARD stable/10/sys/arm/conf/CUBIEBOARD2 stable/10/sys/arm/conf/DB-78XXX stable/10/sys/arm/conf/DB-88F5XXX stable/10/sys/arm/conf/DB-88F6XXX stable/10/sys/arm/conf/DIGI-CCWMX53 stable/10/sys/arm/conf/DOCKSTAR stable/10/sys/arm/conf/DREAMPLUG-1001 stable/10/sys/arm/conf/EA3250 stable/10/sys/arm/conf/EB9200 stable/10/sys/arm/conf/EFIKA_MX stable/10/sys/arm/conf/EP80219 stable/10/sys/arm/conf/ETHERNUT5 stable/10/sys/arm/conf/GUMSTIX stable/10/sys/arm/conf/HL200 stable/10/sys/arm/conf/HL201 stable/10/sys/arm/conf/IMX53-QSB stable/10/sys/arm/conf/IMX6 stable/10/sys/arm/conf/IQ31244 stable/10/sys/arm/conf/KB920X stable/10/sys/arm/conf/LN2410SBC stable/10/sys/arm/conf/NSLU stable/10/sys/arm/conf/PANDABOARD stable/10/sys/arm/conf/QILA9G20 stable/10/sys/arm/conf/RADXA stable/10/sys/arm/conf/RPI-B stable/10/sys/arm/conf/SAM9260EK stable/10/sys/arm/conf/SAM9G20EK stable/10/sys/arm/conf/SAM9X25EK stable/10/sys/arm/conf/SHEEVAPLUG stable/10/sys/arm/conf/SN9G45 stable/10/sys/arm/conf/TS7800 stable/10/sys/arm/conf/VERSATILEPB stable/10/sys/arm/conf/VYBRID.common stable/10/sys/arm/conf/WANDBOARD.common stable/10/sys/arm/conf/ZEDBOARD Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/AC100 ============================================================================== --- stable/10/sys/arm/conf/AC100 Sat May 17 16:29:39 2014 (r266327) +++ stable/10/sys/arm/conf/AC100 Sat May 17 16:46:15 2014 (r266328) @@ -9,32 +9,32 @@ include "../tegra/std.tegra2" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" -#options SCHED_ULE #ULE scheduler -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -#options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -#options NFSCL #Network Filesystem Client -#options NFSLOCKD #Network Lock Manager -#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options SCHED_ULE # ULE scheduler +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +#options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +#options NFSCL # Network Filesystem Client +#options NFSLOCKD # Network Lock Manager +#options NFS_ROOT # NFS usable as /, requires NFSCLIENT #options BOOTP #options BOOTP_NFSROOT #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=mge0 -options TMPFS #Efficient memory filesystem -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme +options TMPFS # Efficient memory filesystem +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT options ROOTDEVNAME=\"ufs:/dev/da0p1\" -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT @@ -48,8 +48,8 @@ options VERBOSE_SYSINIT options DDB options GDB options DIAGNOSTIC -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options KDB options KDB_TRACE #options KTR @@ -57,8 +57,8 @@ options KDB_TRACE #options KTR_ENTRIES=16384 #options KTR_MASK=(KTR_SPARE2) #options KTR_COMPILE=KTR_ALL -options WITNESS #Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options WITNESS_KDB options MUTEX_DEBUG Modified: stable/10/sys/arm/conf/ARMADAXP ============================================================================== --- stable/10/sys/arm/conf/ARMADAXP Sat May 17 16:29:39 2014 (r266327) +++ stable/10/sys/arm/conf/ARMADAXP Sat May 17 16:46:15 2014 (r266328) @@ -10,32 +10,32 @@ include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" -#options SCHED_ULE #ULE scheduler -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options NFSCL #Network Filesystem Client -options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options SCHED_ULE # ULE scheduler +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 options BOOTP_WIRED_TO=mge0 -options TMPFS #Efficient memory filesystem -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme +options TMPFS # Efficient memory filesystem +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT options ROOTDEVNAME=\"ufs:/dev/da0p1\" -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT @@ -50,8 +50,8 @@ options ALT_BREAK_TO_DEBUGGER options DDB options GDB #options DIAGNOSTIC -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options KDB options KDB_TRACE #options KTR @@ -59,8 +59,8 @@ options KDB_TRACE #options KTR_ENTRIES=16384 #options KTR_MASK=(KTR_SPARE2) #options KTR_COMPILE=KTR_ALL -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options WITNESS_KDB # Pseudo devices Modified: stable/10/sys/arm/conf/ARNDALE ============================================================================== --- stable/10/sys/arm/conf/ARNDALE Sat May 17 16:29:39 2014 (r266327) +++ stable/10/sys/arm/conf/ARNDALE Sat May 17 16:46:15 2014 (r266328) @@ -24,55 +24,55 @@ include "../samsung/exynos/std.exynos5" makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" -options HZ=100 ## -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme -options TMPFS #Efficient memory filesystem -options FFS #Berkeley Fast Filesystem +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem options SOFTUPDATES -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories -options MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV options PREEMPTION options FREEBSD_BOOT_LOADER -options VFP # vfp/neon +options VFP # vfp/neon # Debugging -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT #Enable verbose sysinit messages +#options VERBOSE_SYSINIT # Enable verbose sysinit messages options KDB -options DDB #Enable the kernel debugger -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options DIAGNOSTIC # NFS support -options NFSCL #Network Filesystem Client -options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT # Uncomment this for NFS root -#options NFS_ROOT #NFS usable as /, requires NFSCL +#options NFS_ROOT # NFS usable as /, requires NFSCL #options BOOTP_NFSROOT #options BOOTP_COMPAT #options BOOTP Modified: stable/10/sys/arm/conf/ATMEL ============================================================================== --- stable/10/sys/arm/conf/ATMEL Sat May 17 16:29:39 2014 (r266327) +++ stable/10/sys/arm/conf/ATMEL Sat May 17 16:46:15 2014 (r266328) @@ -48,13 +48,13 @@ options NFSCL # New Network Filesyste options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS #Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD5 # Compatible with FreeBSD5 @@ -109,73 +109,73 @@ options GDB # Support remote GDB. # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter # Ethernet -device mii # Minimal MII support -device ate # Atmel AT91 Ethernet friver +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet friver # I2C -device at91_twi # Atmel AT91 Two-wire Interface -device iic # I2C generic I/O device driver -device iicbus # I2C bus system -device pcf8563 # NXP PCF8563 clock/calendar +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system +device pcf8563 # NXP PCF8563 clock/calendar # MMC/SD -device at91_mci # Atmel AT91 Multimedia Card Interface +device at91_mci # Atmel AT91 Multimedia Card Interface options AT91_MCI_HAS_4WIRE -device mmc # MMC/SD bus -device mmcsd # MMC/SD memory card +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card # DataFlash -device at91_spi # Atmel AT91 Serial Peripheral Interface -device spibus # SPI bus -device at45d # Atmel AT45D -device geom_map # GEOM partition mapping +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus +device at45d # Atmel AT45D +device geom_map # GEOM partition mapping # Pseudo devices. -device loop # Network loopback -device random # Entropy device -device ether # Ethernet support -device vlan # 802.1Q VLAN support -device tun # Packet tunnel. -device md # Memory "disks" -device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) -#device firmware # firmware assist module +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +#device firmware # firmware assist module # SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device ch # SCSI media changers -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) -device ses # Enclosure Services (SES and SAF-TE) -#device ctl # CAM Target Layer +device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # Serial (COM) ports -device uart # Multi-uart driver +device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support -options USB_DEBUG # enable debug msgs -device ohci # OHCI USB interface -device usb # USB Bus (required) -device umass # Disks/Mass storage - Requires scbus and da +options USB_DEBUG # enable debug msgs +device ohci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da # USB device (gadget) support -device at91_dci # Atmel's usb device -device usfs # emulate a flash -device cdce # emulate an ethernet -device usb_template # Control of the gadget +device at91_dci # Atmel's usb device +device usfs # emulate a flash +device cdce # emulate an ethernet +device usb_template # Control of the gadget # watchdog -device at91_wdt # Atmel AT91 Watchdog Timer +device at91_wdt # Atmel AT91 Watchdog Timer device at91_rtc device at91_ssc -#device at91_tc # missing? +#device at91_tc # missing? # NAND Flash - Reference design has Samsung 256MB but others possible device nand # NAND interface on CS3 Modified: stable/10/sys/arm/conf/AVILA ============================================================================== --- stable/10/sys/arm/conf/AVILA Sat May 17 16:29:39 2014 (r266327) +++ stable/10/sys/arm/conf/AVILA Sat May 17 16:46:15 2014 (r266328) @@ -25,10 +25,10 @@ include "../xscale/ixp425/std.ixp425" include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE #To statically compile in device wiring instead of /boot/device.hints -hints "AVILA.hints" #Default places to look for devices. +hints "AVILA.hints" # Default places to look for devices. makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale #options HZ=1000 options HZ=100 @@ -37,23 +37,23 @@ options DEVICE_POLLING # Debugging for use in -current options KDB #options GDB -options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +#options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme -options TMPFS #Efficient memory filesystem -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options NFSCL #New Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCL +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options NFSCL # New Network Filesystem Client +options NFS_ROOT # NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 @@ -73,34 +73,34 @@ device hwpmc device pci device uart -device ixpwdog # watchdog timer -device cfi # flash support -device cfid # flash disk support -device geom_redboot # redboot fis parser +device ixpwdog # watchdog timer +device cfi # flash support +device cfid # flash disk support +device geom_redboot # redboot fis parser # I2C Bus device iicbus device iicbb device iic -device ixpiic # I2C bus glue -device ds1672 # DS1672 on I2C bus -device ad7418 # AD7418 on I2C bus +device ixpiic # I2C bus glue +device ds1672 # DS1672 on I2C bus +device ad7418 # AD7418 on I2C bus device avila_led device gpio device gpioled -device avila_gpio # GPIO pins on J8 +device avila_gpio # GPIO pins on J8 device ata -device avila_ata # Gateworks CF/IDE support +device avila_ata # Gateworks CF/IDE support -device npe # Network Processing Engine +device npe # Network Processing Engine device npe_fw device firmware -device qmgr # Q Manager (required by npe) -device mii # NB: required by npe +device qmgr # Q Manager (required by npe) +device mii # NB: required by npe device ether device bpf @@ -108,24 +108,24 @@ device loop device if_bridge device md -device random # Entropy device +device random # Entropy device # Wireless NIC cards -device wlan # 802.11 support +device wlan # 802.11 support options IEEE80211_DEBUG options IEEE80211_SUPPORT_TDMA options IEEE80211_SUPPORT_MESH -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros NICs -device ath_pci # Atheros pci/cardbus glue +device ath # Atheros NICs +device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI #options ATH_TX99_DIAG -device ath_rate_sample # SampleRate tx rate control for ath +device ath_rate_sample # SampleRate tx rate control for ath #options AH_DEBUG #options AH_ASSERT @@ -149,9 +149,9 @@ device usb device ohci device ehci device umass -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device pass # Passthrough device (direct ATA/SCSI access) +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) #device ural #device zyd Modified: stable/10/sys/arm/conf/BEAGLEBONE ============================================================================== --- stable/10/sys/arm/conf/BEAGLEBONE Sat May 17 16:29:39 2014 (r266327) +++ stable/10/sys/arm/conf/BEAGLEBONE Sat May 17 16:46:15 2014 (r266328) @@ -27,42 +27,42 @@ include "../ti/am335x/std.beaglebone" makeoptions WITHOUT_MODULES="ahc" options HZ=100 -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme -options TMPFS #Efficient memory filesystem -options MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -options KTRACE #ktrace(1) support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PREEMPTION options FREEBSD_BOOT_LOADER options VFP # vfp/neon # Debugging -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT #Enable verbose sysinit messages +#options VERBOSE_SYSINIT # Enable verbose sysinit messages options KDB -options DDB #Enable the kernel debugger -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS #Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC # NFS support @@ -71,7 +71,7 @@ options NFSCL options NFSLOCKD # Uncomment this for NFS root -#options NFS_ROOT #NFS usable as /, requires NFSCL +#options NFS_ROOT # NFS usable as /, requires NFSCL #options BOOTP_NFSROOT #options BOOTP_COMPAT #options BOOTP @@ -129,7 +129,7 @@ device miibus device axe # ASIX Electronics USB Ethernet # Device mode support and USFS template -device usb_template # Control of the gadget +device usb_template # Control of the gadget device usfs # Flattened Device Tree Modified: stable/10/sys/arm/conf/BWCT ============================================================================== --- stable/10/sys/arm/conf/BWCT Sat May 17 16:29:39 2014 (r266327) +++ stable/10/sys/arm/conf/BWCT Sat May 17 16:46:15 2014 (r266328) @@ -27,42 +27,42 @@ include "../at91/std.bwct" hints "BWCT.hints" makeoptions MODULES_OVERRIDE="" -#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options DDB options KDB options BREAK_TO_DEBUGGER options ALT_BREAK_TO_DEBUGGER -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -#options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -#options UFS_ACL #Support for access control lists -#options UFS_DIRHASH #Improve performance on big directories -#options MD_ROOT #MD is a potential root device +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +#options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +#options UFS_ACL # Support for access control lists +#options UFS_DIRHASH # Improve performance on big directories +#options MD_ROOT # MD is a potential root device #options MD_ROOT_SIZE=4096 # 4MB ram disk #options ROOTDEVNAME=\"ufs:md0\" #options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options NFSCL #New Network Filesystem Client -#options NFSD #New Network Filesystem Server -#options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCL +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +#options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL options BOOTP_NFSROOT options BOOTP -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme -options TMPFS #Efficient memory filesystem -#options MSDOSFS #MSDOS Filesystem -#options CD9660 #ISO 9660 Filesystem -#options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -#options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -#options KTRACE #ktrace(1) support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +#options MSDOSFS # MSDOS Filesystem +#options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +#options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +#options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions #options NO_SYSCTL_DESCR options MUTEX_NOINLINE @@ -79,11 +79,11 @@ device mii device rlswitch # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC device md @@ -96,17 +96,17 @@ device mmcsd # mmc/sd flash cards # iic device iic device iicbus -device ds1672 # DS1672 on I2C bus +device ds1672 # DS1672 on I2C bus #device iicsmb # smb over i2c bridge #device smbus # Bus support, required for smb below. #device smb # SPI bus device spibus -#device at45d # at45db642 and maybe others +#device at45d # at45db642 and maybe others -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter #options USB_DEBUG #device ohci #device usb -#device umass # Disks/Mass storage - Requires scbus and da +#device umass # Disks/Mass storage - Requires scbus and da Modified: stable/10/sys/arm/conf/CAMBRIA ============================================================================== --- stable/10/sys/arm/conf/CAMBRIA Sat May 17 16:29:39 2014 (r266327) +++ stable/10/sys/arm/conf/CAMBRIA Sat May 17 16:46:15 2014 (r266328) @@ -27,7 +27,7 @@ options XSCALE_CACHE_READ_WRITE_ALLOCAT #To statically compile in device wiring instead of /boot/device.hints hints "CAMBRIA.hints" # Default places to look for devices. -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale makeoptions MODULES_OVERRIDE="" #options HZ=1000 @@ -37,24 +37,24 @@ options DEVICE_POLLING # Debugging for use in -current options KDB #options GDB -options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +#options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC -options SCHED_4BSD #4BSD scheduler +options SCHED_4BSD # 4BSD scheduler #options PREEMPTION -options INET #InterNETworking -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme -options TMPFS #Efficient memory filesystem -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options NFSCL #New Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCL +options INET # InterNETworking +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options NFSCL # New Network Filesystem Client +options NFS_ROOT # NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 @@ -73,37 +73,37 @@ options VERBOSE_INIT_ARM device pci device uart -device ixpwdog # watchdog timer +device ixpwdog # watchdog timer -options IXP4XX_FLASH_SIZE=0x02000000 # stock 2358 comes w/ 32M -device cfi # flash support -device cfid # flash disk support -device geom_redboot # redboot fis parser +options IXP4XX_FLASH_SIZE=0x02000000 # stock 2358 comes w/ 32M +device cfi # flash support +device cfid # flash disk support +device geom_redboot # redboot fis parser # I2C Bus device iicbus device iicbb device iic -device ixpiic # I2C bus glue -device ds1672 # DS1672 on I2C bus -device ad7418 # AD7418 on I2C bus +device ixpiic # I2C bus glue +device ds1672 # DS1672 on I2C bus +device ad7418 # AD7418 on I2C bus -device cambria_fled # Font Panel LED on I2C bus -device cambria_led # 8-LED latch +device cambria_fled # Font Panel LED on I2C bus +device cambria_led # 8-LED latch device gpio device gpioled -device cambria_gpio # GPIO pins on J11 +device cambria_gpio # GPIO pins on J11 device ata -device avila_ata # Gateworks CF/IDE support +device avila_ata # Gateworks CF/IDE support -device npe # Network Processing Engine +device npe # Network Processing Engine device npe_fw device firmware -device qmgr # Q Manager (required by npe) -device mii # NB: required by npe +device qmgr # Q Manager (required by npe) +device mii # NB: required by npe device ether device bpf @@ -111,26 +111,26 @@ device loop device if_bridge device md -device random # Entropy device +device random # Entropy device # Wireless NIC cards -device wlan # 802.11 support +device wlan # 802.11 support options IEEE80211_DEBUG options IEEE80211_SUPPORT_TDMA options IEEE80211_SUPPORT_MESH -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros NICs -device ath_pci # Atheros pci/cardbus glue +device ath # Atheros NICs +device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI options ATH_ENABLE_DFS options ATH_ENABLE_11N #options ATH_TX99_DIAG -device ath_rate_sample # SampleRate tx rate control for ath +device ath_rate_sample # SampleRate tx rate control for ath options AH_DEBUG options AH_PRIVATE_DIAG @@ -139,13 +139,13 @@ device ath_hal # NB: 2 USB 2.0 ports standard device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order #options USB_DEBUG device ehci device umass -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device pass # Passthrough device (direct ATA/SCSI access) +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) #device ural #device zyd Modified: stable/10/sys/arm/conf/CNS11XXNAS ============================================================================== --- stable/10/sys/arm/conf/CNS11XXNAS Sat May 17 16:29:39 2014 (r266327) +++ stable/10/sys/arm/conf/CNS11XXNAS Sat May 17 16:46:15 2014 (r266328) @@ -22,7 +22,7 @@ ident CNS11XXNAS #options PHYSADDR=0x10000000 #options KERNPHYSADDR=0x10200000 -#options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm +#options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 @@ -30,61 +30,61 @@ include "../econa/std.econa" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options HZ=100 options DEVICE_POLLING # Debugging for use in -current options KDB #options GDB -options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -##options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +##options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC #options COMPAT_FREEBSD5 #options COMPAT_FREEBSD6 -#options COMPAT_FREEBSD7 +#options COMPAT_FREEBSD7n -options SCHED_ULE #ULE scheduler -#options SCHED_4BSD #4BSD scheduler -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme +options SCHED_ULE # ULE scheduler +#options SCHED_4BSD # 4BSD scheduler +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. #options GEOM_PART_EBR #options GEOM_PART_EBR_COMPAT options GEOM_LABEL # Provides labelization -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories -options NFSCL #New Network Filesystem Client -#options NFSD #New Network Filesystem Server -#options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCL -options TMPFS #Efficient memory filesystem -options MSDOSFS #MSDOS Filesystem -#options CD9660 #ISO 9660 Filesystem -#options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -options KTRACE #ktrace(1) support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +#options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options TMPFS # Efficient memory filesystem +options MSDOSFS # MSDOS Filesystem +#options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options MUTEX_NOINLINE #Mutex inlines are space hogs -options RWLOCK_NOINLINE #rwlock inlines are space hogs -options SX_NOINLINE #sx inliens are space hogs +options MUTEX_NOINLINE # Mutex inlines are space hogs +options RWLOCK_NOINLINE # rwlock inlines are space hogs +options SX_NOINLINE # sx inliens are space hogs #options BOOTP #options BOOTP_NFSROOT #options BOOTP_NFSV3 @@ -96,14 +96,14 @@ device uart device firmware -device mii # Minimal mii routines +device mii # Minimal mii routines device ether device bpf device loop device md -device random # Entropy device +device random # Entropy device *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 16:57:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5E9C8480; Sat, 17 May 2014 16:57: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 4AC97246A; Sat, 17 May 2014 16:57: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 s4HGvIdx039701; Sat, 17 May 2014 16:57:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HGvIZZ039698; Sat, 17 May 2014 16:57:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171657.s4HGvIZZ039698@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 16:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266329 - in stable/10/sys: amd64/conf i386/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 16:57:18 -0000 Author: ian Date: Sat May 17 16:57:17 2014 New Revision: 266329 URL: http://svnweb.freebsd.org/changeset/base/266329 Log: MFC 263246: Align all comments in config files on same column. Modified: stable/10/sys/amd64/conf/GENERIC stable/10/sys/i386/conf/GENERIC Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/conf/GENERIC ============================================================================== --- stable/10/sys/amd64/conf/GENERIC Sat May 17 16:46:15 2014 (r266328) +++ stable/10/sys/amd64/conf/GENERIC Sat May 17 16:57:17 2014 (r266329) @@ -71,7 +71,7 @@ options MAC # TrustedBSD MAC Framewor options KDTRACE_FRAME # Ensure frames are compiled in options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data -options INCLUDE_CONFIG_FILE # Include this file in kernel +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging support. Always need this: options KDB # Enable kernel debugger support. @@ -92,255 +92,255 @@ device pci device fdc # ATA controllers -device ahci # AHCI-compatible SATA controllers -device ata # Legacy ATA/SATA controllers -options ATA_STATIC_ID # Static device numbering -device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA -device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_STATIC_ID # Static device numbering +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers -device ahc # AHA2940 and onboard AIC7xxx devices +device ahc # AHA2940 and onboard AIC7xxx devices options AHC_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~128k to driver. -device ahd # AHA39320/29320 and onboard AIC79xx devices +device ahd # AHA39320/29320 and onboard AIC79xx devices options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device esp # AMD Am53C974 (Tekram DC-390(T)) -device hptiop # Highpoint RocketRaid 3xxx series -device isp # Qlogic family -#device ispfw # Firmware for QLogic HBAs- normally a module -device mpt # LSI-Logic MPT-Fusion -device mps # LSI-Logic MPT-Fusion 2 -device mpr # LSI-Logic MPT-Fusion 3 -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') -device trm # Tekram DC395U/UW/F DC315U adapters - -device adv # Advansys SCSI adapters -device adw # Advansys wide SCSI adapters -device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. -device bt # Buslogic/Mylex MultiMaster SCSI adapters -device isci # Intel C600 SAS controller +device esp # AMD Am53C974 (Tekram DC-390(T)) +device hptiop # Highpoint RocketRaid 3xxx series +device isp # Qlogic family +#device ispfw # Firmware for QLogic HBAs- normally a module +device mpt # LSI-Logic MPT-Fusion +device mps # LSI-Logic MPT-Fusion 2 +device mpr # LSI-Logic MPT-Fusion 3 +#device ncr # NCR/Symbios Logic +device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device trm # Tekram DC395U/UW/F DC315U adapters + +device adv # Advansys SCSI adapters +device adw # Advansys wide SCSI adapters +device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. +device bt # Buslogic/Mylex MultiMaster SCSI adapters +device isci # Intel C600 SAS controller # ATA/SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device ch # SCSI media changers -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) -device ses # Enclosure Services (SES and SAF-TE) -#device ctl # CAM Target Layer +device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # RAID controllers interfaced to the SCSI subsystem -device amr # AMI MegaRAID -device arcmsr # Areca SATA II RAID +device amr # AMI MegaRAID +device arcmsr # Areca SATA II RAID #XXX it is not 64-bit clean, -scottl -#device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID -device ciss # Compaq Smart RAID 5* -device dpt # DPT Smartcache III, IV - See NOTES for options -device hptmv # Highpoint RocketRAID 182x -device hptnr # Highpoint DC7280, R750 -device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx -device hpt27xx # Highpoint RocketRAID 27xx -device iir # Intel Integrated RAID -device ips # IBM (Adaptec) ServeRAID -device mly # Mylex AcceleRAID/eXtremeRAID -device twa # 3ware 9000 series PATA/SATA RAID -device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller +#device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID +device ciss # Compaq Smart RAID 5* +device dpt # DPT Smartcache III, IV - See NOTES for options +device hptmv # Highpoint RocketRAID 182x +device hptnr # Highpoint DC7280, R750 +device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx +device hpt27xx # Highpoint RocketRAID 27xx +device iir # Intel Integrated RAID +device ips # IBM (Adaptec) ServeRAID +device mly # Mylex AcceleRAID/eXtremeRAID +device twa # 3ware 9000 series PATA/SATA RAID +device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller # RAID controllers -device aac # Adaptec FSA RAID -device aacp # SCSI passthrough for aac (requires CAM) -device aacraid # Adaptec by PMC RAID -device ida # Compaq Smart RAID -device mfi # LSI MegaRAID SAS -device mlx # Mylex DAC960 family +device aac # Adaptec FSA RAID +device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID +device ida # Compaq Smart RAID +device mfi # LSI MegaRAID SAS +device mlx # Mylex DAC960 family #XXX pointer/int warnings -#device pst # Promise Supertrak SX6000 -device twe # 3ware ATA RAID +#device pst # Promise Supertrak SX6000 +device twe # 3ware ATA RAID # atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc # AT keyboard controller -device atkbd # AT keyboard -device psm # PS/2 mouse +device atkbdc # AT keyboard controller +device atkbd # AT keyboard +device psm # PS/2 mouse -device kbdmux # keyboard multiplexer +device kbdmux # keyboard multiplexer -device vga # VGA video card driver -options VESA # Add support for VESA BIOS Extensions (VBE) +device vga # VGA video card driver +options VESA # Add support for VESA BIOS Extensions (VBE) -device splash # Splash screen and screen saver support +device splash # Splash screen and screen saver support # syscons is the default console driver, resembling an SCO console device sc -options SC_PIXEL_MODE # add support for the raster text mode +options SC_PIXEL_MODE # add support for the raster text mode -device agp # support several AGP chipsets +device agp # support several AGP chipsets # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support -device cbb # cardbus (yenta) bridge -device pccard # PC Card (16-bit) bus -device cardbus # CardBus (32-bit) bus +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus # Serial (COM) ports -device uart # Generic UART driver +device uart # Generic UART driver # Parallel port device ppc -device ppbus # Parallel port bus (required) -device lpt # Printer -device ppi # Parallel port interface device -#device vpo # Requires scbus and da +device ppbus # Parallel port bus (required) +device lpt # Printer +device ppi # Parallel port interface device +#device vpo # Requires scbus and da -device puc # Multi I/O cards and multi-channel UARTs +device puc # Multi I/O cards and multi-channel UARTs # PCI Ethernet NICs. -device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE -device de # DEC/Intel DC21x4x (``Tulip'') -device em # Intel PRO/1000 Gigabit Ethernet Family -device igb # Intel PRO/1000 PCIE Server Gigabit Family -device ixgbe # Intel PRO/10GbE PCIE Ethernet Family -device le # AMD Am7900 LANCE and Am79C9xx PCnet -device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') -device vx # 3Com 3c590, 3c595 (``Vortex'') +device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE +device de # DEC/Intel DC21x4x (``Tulip'') +device em # Intel PRO/1000 Gigabit Ethernet Family +device igb # Intel PRO/1000 PCIE Server Gigabit Family +device ixgbe # Intel PRO/10GbE PCIE Ethernet Family +device le # AMD Am7900 LANCE and Am79C9xx PCnet +device ti # Alteon Networks Tigon I/II gigabit Ethernet +device txp # 3Com 3cR990 (``Typhoon'') +device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! -device miibus # MII bus support -device ae # Attansic/Atheros L2 FastEthernet -device age # Attansic/Atheros L1 Gigabit Ethernet -device alc # Atheros AR8131/AR8132 Ethernet -device ale # Atheros AR8121/AR8113/AR8114 Ethernet -device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet -device bfe # Broadcom BCM440x 10/100 Ethernet -device bge # Broadcom BCM570xx Gigabit Ethernet -device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn -device dc # DEC/Intel 21143 and various workalikes -device et # Agere ET1310 10/100/Gigabit Ethernet -device fxp # Intel EtherExpress PRO/100B (82557, 82558) -device gem # Sun GEM/Sun ERI/Apple GMAC -device hme # Sun HME (Happy Meal Ethernet) -device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet -device lge # Level 1 LXT1001 gigabit Ethernet -device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet -device nfe # nVidia nForce MCP on-board Ethernet -device nge # NatSemi DP83820 gigabit Ethernet -#device nve # nVidia nForce MCP on-board Ethernet Networking -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') -device re # RealTek 8139C+/8169/8169S/8110S -device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') -device sge # Silicon Integrated Systems SiS190/191 -device sis # Silicon Integrated Systems SiS 900/SiS 7016 -device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -device ste # Sundance ST201 (D-Link DFE-550TX) -device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tl # Texas Instruments ThunderLAN -device tx # SMC EtherPower II (83c170 ``EPIC'') -device vge # VIA VT612x gigabit Ethernet -device vr # VIA Rhine, Rhine II -device wb # Winbond W89C840F -device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') +device miibus # MII bus support +device ae # Attansic/Atheros L2 FastEthernet +device age # Attansic/Atheros L1 Gigabit Ethernet +device alc # Atheros AR8131/AR8132 Ethernet +device ale # Atheros AR8121/AR8113/AR8114 Ethernet +device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet +device bfe # Broadcom BCM440x 10/100 Ethernet +device bge # Broadcom BCM570xx Gigabit Ethernet +device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn +device dc # DEC/Intel 21143 and various workalikes +device et # Agere ET1310 10/100/Gigabit Ethernet +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device gem # Sun GEM/Sun ERI/Apple GMAC +device hme # Sun HME (Happy Meal Ethernet) +device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet +device lge # Level 1 LXT1001 gigabit Ethernet +device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet +device nfe # nVidia nForce MCP on-board Ethernet +device nge # NatSemi DP83820 gigabit Ethernet +#device nve # nVidia nForce MCP on-board Ethernet Networking +device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') +device re # RealTek 8139C+/8169/8169S/8110S +device rl # RealTek 8129/8139 +device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 +device sis # Silicon Integrated Systems SiS 900/SiS 7016 +device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet +device ste # Sundance ST201 (D-Link DFE-550TX) +device stge # Sundance/Tamarack TC9021 gigabit Ethernet +device tl # Texas Instruments ThunderLAN +device tx # SMC EtherPower II (83c170 ``EPIC'') +device vge # VIA VT612x gigabit Ethernet +device vr # VIA Rhine, Rhine II +device wb # Winbond W89C840F +device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. -device cs # Crystal Semiconductor CS89x0 NIC +device cs # Crystal Semiconductor CS89x0 NIC # 'device ed' requires 'device miibus' -device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards -device ex # Intel EtherExpress Pro/10 and Pro/10+ -device ep # Etherlink III based cards -device fe # Fujitsu MB8696x based cards -device sn # SMC's 9000 series of Ethernet chips -device xe # Xircom pccard Ethernet +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards +device ex # Intel EtherExpress Pro/10 and Pro/10+ +device ep # Etherlink III based cards +device fe # Fujitsu MB8696x based cards +device sn # SMC's 9000 series of Ethernet chips +device xe # Xircom pccard Ethernet # Wireless NIC cards -device wlan # 802.11 support -options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +device wlan # 802.11 support +options IEEE80211_DEBUG # enable debug msgs +options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_amrr # AMRR transmit rate control algorithm -device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros NICs -device ath_pci # Atheros pci/cardbus glue -device ath_hal # pci/cardbus chip support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_amrr # AMRR transmit rate control algorithm +device an # Aironet 4500/4800 802.11 wireless NICs. +device ath # Atheros NICs +device ath_pci # Atheros pci/cardbus glue +device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation -options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later -device ath_rate_sample # SampleRate tx rate control for ath -#device bwi # Broadcom BCM430x/BCM431x wireless NICs. -#device bwn # Broadcom BCM43xx wireless NICs. -device ipw # Intel 2100 wireless NICs. -device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. -device iwn # Intel 4965/1000/5000/6000 wireless NICs. -device malo # Marvell Libertas wireless NICs. -device mwl # Marvell 88W8363 802.11n wireless NICs. -device ral # Ralink Technology RT2500 wireless NICs. -device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. -device wpi # Intel 3945ABG wireless NICs. +options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation +options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later +device ath_rate_sample # SampleRate tx rate control for ath +#device bwi # Broadcom BCM430x/BCM431x wireless NICs. +#device bwn # Broadcom BCM43xx wireless NICs. +device ipw # Intel 2100 wireless NICs. +device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. +device iwn # Intel 4965/1000/5000/6000 wireless NICs. +device malo # Marvell Libertas wireless NICs. +device mwl # Marvell 88W8363 802.11n wireless NICs. +device ral # Ralink Technology RT2500 wireless NICs. +device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. +device wpi # Intel 3945ABG wireless NICs. # Pseudo devices. -device loop # Network loopback -device random # Entropy device -device padlock_rng # VIA Padlock RNG -device rdrand_rng # Intel Bull Mountain RNG -device ether # Ethernet support -device vlan # 802.1Q VLAN support -device tun # Packet tunnel. -device md # Memory "disks" -device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) -device firmware # firmware assist module +device loop # Network loopback +device random # Entropy device +device padlock_rng # VIA Padlock RNG +device rdrand_rng # Intel Bull Mountain RNG +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter # USB support -options USB_DEBUG # enable debug msgs -device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) -device xhci # XHCI PCI->USB interface (USB 3.0) -device usb # USB Bus (required) -device ukbd # Keyboard -device umass # Disks/Mass storage - Requires scbus and da +options USB_DEBUG # enable debug msgs +device uhci # UHCI PCI->USB interface +device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device xhci # XHCI PCI->USB interface (USB 3.0) +device usb # USB Bus (required) +device ukbd # Keyboard +device umass # Disks/Mass storage - Requires scbus and da # Sound support -device sound # Generic sound driver (required) -device snd_cmi # CMedia CMI8338/CMI8738 -device snd_csa # Crystal Semiconductor CS461x/428x -device snd_emu10kx # Creative SoundBlaster Live! and Audigy -device snd_es137x # Ensoniq AudioPCI ES137x -device snd_hda # Intel High Definition Audio -device snd_ich # Intel, NVidia and other ICH AC'97 Audio -device snd_via8233 # VIA VT8233x Audio +device sound # Generic sound driver (required) +device snd_cmi # CMedia CMI8338/CMI8738 +device snd_csa # Crystal Semiconductor CS461x/428x +device snd_emu10kx # Creative SoundBlaster Live! and Audigy +device snd_es137x # Ensoniq AudioPCI ES137x +device snd_hda # Intel High Definition Audio +device snd_ich # Intel, NVidia and other ICH AC'97 Audio +device snd_via8233 # VIA VT8233x Audio # MMC/SD -device mmc # MMC/SD bus -device mmcsd # MMC/SD memory card -device sdhci # Generic PCI SD Host Controller +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card +device sdhci # Generic PCI SD Host Controller # VirtIO support -device virtio # Generic VirtIO bus (required) -device virtio_pci # VirtIO PCI device -device vtnet # VirtIO Ethernet device -device virtio_blk # VirtIO Block device -device virtio_scsi # VirtIO SCSI device -device virtio_balloon # VirtIO Memory Balloon device +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers -device hyperv # HyperV drivers +device hyperv # HyperV drivers # Xen HVM Guest Optimizations # NOTE: XENHVM depends on xenpci. They must be added or removed together. -options XENHVM # Xen HVM kernel infrastructure -device xenpci # Xen HVM Hypervisor services driver +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver # VMware support -device vmx # VMware VMXNET3 Ethernet +device vmx # VMware VMXNET3 Ethernet Modified: stable/10/sys/i386/conf/GENERIC ============================================================================== --- stable/10/sys/i386/conf/GENERIC Sat May 17 16:46:15 2014 (r266328) +++ stable/10/sys/i386/conf/GENERIC Sat May 17 16:57:17 2014 (r266329) @@ -71,7 +71,7 @@ options PROCDESC # Support for process options MAC # TrustedBSD MAC Framework options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data -options INCLUDE_CONFIG_FILE # Include this file in kernel +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging support. Always need this: options KDB # Enable kernel debugger support. @@ -93,95 +93,95 @@ device pci device fdc # ATA controllers -device ahci # AHCI-compatible SATA controllers -device ata # Legacy ATA/SATA controllers -options ATA_STATIC_ID # Static device numbering -device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA -device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_STATIC_ID # Static device numbering +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers -device ahb # EISA AHA1742 family -device ahc # AHA2940 and onboard AIC7xxx devices +device ahb # EISA AHA1742 family +device ahc # AHA2940 and onboard AIC7xxx devices options AHC_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~128k to driver. -device ahd # AHA39320/29320 and onboard AIC79xx devices +device ahd # AHA39320/29320 and onboard AIC79xx devices options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device esp # AMD Am53C974 (Tekram DC-390(T)) -device hptiop # Highpoint RocketRaid 3xxx series -device isp # Qlogic family -#device ispfw # Firmware for QLogic HBAs- normally a module -device mpt # LSI-Logic MPT-Fusion -device mps # LSI-Logic MPT-Fusion 2 -device mpr # LSI-Logic MPT-Fusion 3 -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') -device trm # Tekram DC395U/UW/F DC315U adapters - -device adv # Advansys SCSI adapters -device adw # Advansys wide SCSI adapters -device aha # Adaptec 154x SCSI adapters -device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. -device bt # Buslogic/Mylex MultiMaster SCSI adapters - -device ncv # NCR 53C500 -device nsp # Workbit Ninja SCSI-3 -device stg # TMC 18C30/18C50 -device isci # Intel C600 SAS controller +device esp # AMD Am53C974 (Tekram DC-390(T)) +device hptiop # Highpoint RocketRaid 3xxx series +device isp # Qlogic family +#device ispfw # Firmware for QLogic HBAs- normally a module +device mpt # LSI-Logic MPT-Fusion +device mps # LSI-Logic MPT-Fusion 2 +device mpr # LSI-Logic MPT-Fusion 3 +#device ncr # NCR/Symbios Logic +device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device trm # Tekram DC395U/UW/F DC315U adapters + +device adv # Advansys SCSI adapters +device adw # Advansys wide SCSI adapters +device aha # Adaptec 154x SCSI adapters +device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. +device bt # Buslogic/Mylex MultiMaster SCSI adapters + +device ncv # NCR 53C500 +device nsp # Workbit Ninja SCSI-3 +device stg # TMC 18C30/18C50 +device isci # Intel C600 SAS controller # ATA/SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device ch # SCSI media changers -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) -device ses # Enclosure Services (SES and SAF-TE) -#device ctl # CAM Target Layer +device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # RAID controllers interfaced to the SCSI subsystem -device amr # AMI MegaRAID -device arcmsr # Areca SATA II RAID -device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID -device ciss # Compaq Smart RAID 5* -device dpt # DPT Smartcache III, IV - See NOTES for options -device hptmv # Highpoint RocketRAID 182x -device hptnr # Highpoint DC7280, R750 -device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx -device hpt27xx # Highpoint RocketRAID 27xx -device iir # Intel Integrated RAID -device ips # IBM (Adaptec) ServeRAID -device mly # Mylex AcceleRAID/eXtremeRAID -device twa # 3ware 9000 series PATA/SATA RAID -device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller +device amr # AMI MegaRAID +device arcmsr # Areca SATA II RAID +device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID +device ciss # Compaq Smart RAID 5* +device dpt # DPT Smartcache III, IV - See NOTES for options +device hptmv # Highpoint RocketRAID 182x +device hptnr # Highpoint DC7280, R750 +device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx +device hpt27xx # Highpoint RocketRAID 27xx +device iir # Intel Integrated RAID +device ips # IBM (Adaptec) ServeRAID +device mly # Mylex AcceleRAID/eXtremeRAID +device twa # 3ware 9000 series PATA/SATA RAID +device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller # RAID controllers -device aac # Adaptec FSA RAID -device aacp # SCSI passthrough for aac (requires CAM) -device aacraid # Adaptec by PMC RAID -device ida # Compaq Smart RAID -device mfi # LSI MegaRAID SAS -device mlx # Mylex DAC960 family -device pst # Promise Supertrak SX6000 -device twe # 3ware ATA RAID +device aac # Adaptec FSA RAID +device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID +device ida # Compaq Smart RAID +device mfi # LSI MegaRAID SAS +device mlx # Mylex DAC960 family +device pst # Promise Supertrak SX6000 +device twe # 3ware ATA RAID # atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc # AT keyboard controller -device atkbd # AT keyboard -device psm # PS/2 mouse +device atkbdc # AT keyboard controller +device atkbd # AT keyboard +device psm # PS/2 mouse -device kbdmux # keyboard multiplexer +device kbdmux # keyboard multiplexer -device vga # VGA video card driver -options VESA # Add support for VESA BIOS Extensions (VBE) +device vga # VGA video card driver +options VESA # Add support for VESA BIOS Extensions (VBE) -device splash # Splash screen and screen saver support +device splash # Splash screen and screen saver support # syscons is the default console driver, resembling an SCO console device sc -options SC_PIXEL_MODE # add support for the raster text mode +options SC_PIXEL_MODE # add support for the raster text mode -device agp # support several AGP chipsets +device agp # support several AGP chipsets # Power management support (see NOTES for more options) #device apm @@ -190,170 +190,170 @@ device pmtimer # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support -device cbb # cardbus (yenta) bridge -device pccard # PC Card (16-bit) bus -device cardbus # CardBus (32-bit) bus +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus # Serial (COM) ports -device uart # Generic UART driver +device uart # Generic UART driver # Parallel port device ppc -device ppbus # Parallel port bus (required) -device lpt # Printer -device ppi # Parallel port interface device -#device vpo # Requires scbus and da +device ppbus # Parallel port bus (required) +device lpt # Printer +device ppi # Parallel port interface device +#device vpo # Requires scbus and da -device puc # Multi I/O cards and multi-channel UARTs +device puc # Multi I/O cards and multi-channel UARTs # PCI Ethernet NICs. -device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE -device de # DEC/Intel DC21x4x (``Tulip'') -device em # Intel PRO/1000 Gigabit Ethernet Family -device igb # Intel PRO/1000 PCIE Server Gigabit Family -device ixgb # Intel PRO/10GbE Ethernet Card -device le # AMD Am7900 LANCE and Am79C9xx PCnet -device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') -device vx # 3Com 3c590, 3c595 (``Vortex'') +device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE +device de # DEC/Intel DC21x4x (``Tulip'') +device em # Intel PRO/1000 Gigabit Ethernet Family +device igb # Intel PRO/1000 PCIE Server Gigabit Family +device ixgb # Intel PRO/10GbE Ethernet Card +device le # AMD Am7900 LANCE and Am79C9xx PCnet +device ti # Alteon Networks Tigon I/II gigabit Ethernet +device txp # 3Com 3cR990 (``Typhoon'') +device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! -device miibus # MII bus support -device ae # Attansic/Atheros L2 FastEthernet -device age # Attansic/Atheros L1 Gigabit Ethernet -device alc # Atheros AR8131/AR8132 Ethernet -device ale # Atheros AR8121/AR8113/AR8114 Ethernet -device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet -device bfe # Broadcom BCM440x 10/100 Ethernet -device bge # Broadcom BCM570xx Gigabit Ethernet -device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn -device dc # DEC/Intel 21143 and various workalikes -device et # Agere ET1310 10/100/Gigabit Ethernet -device fxp # Intel EtherExpress PRO/100B (82557, 82558) -device gem # Sun GEM/Sun ERI/Apple GMAC -device hme # Sun HME (Happy Meal Ethernet) -device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet -device lge # Level 1 LXT1001 gigabit Ethernet -device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet -device nfe # nVidia nForce MCP on-board Ethernet -device nge # NatSemi DP83820 gigabit Ethernet -#device nve # nVidia nForce MCP on-board Ethernet Networking -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') -device re # RealTek 8139C+/8169/8169S/8110S -device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') -device sge # Silicon Integrated Systems SiS190/191 -device sis # Silicon Integrated Systems SiS 900/SiS 7016 -device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -device ste # Sundance ST201 (D-Link DFE-550TX) -device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tl # Texas Instruments ThunderLAN -device tx # SMC EtherPower II (83c170 ``EPIC'') -device vge # VIA VT612x gigabit Ethernet -device vr # VIA Rhine, Rhine II -device vte # DM&P Vortex86 RDC R6040 Fast Ethernet -device wb # Winbond W89C840F -device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') +device miibus # MII bus support +device ae # Attansic/Atheros L2 FastEthernet +device age # Attansic/Atheros L1 Gigabit Ethernet +device alc # Atheros AR8131/AR8132 Ethernet +device ale # Atheros AR8121/AR8113/AR8114 Ethernet +device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet +device bfe # Broadcom BCM440x 10/100 Ethernet +device bge # Broadcom BCM570xx Gigabit Ethernet +device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn +device dc # DEC/Intel 21143 and various workalikes +device et # Agere ET1310 10/100/Gigabit Ethernet +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device gem # Sun GEM/Sun ERI/Apple GMAC +device hme # Sun HME (Happy Meal Ethernet) +device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet +device lge # Level 1 LXT1001 gigabit Ethernet +device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet +device nfe # nVidia nForce MCP on-board Ethernet +device nge # NatSemi DP83820 gigabit Ethernet +#device nve # nVidia nForce MCP on-board Ethernet Networking +device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') +device re # RealTek 8139C+/8169/8169S/8110S +device rl # RealTek 8129/8139 +device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 +device sis # Silicon Integrated Systems SiS 900/SiS 7016 +device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet +device ste # Sundance ST201 (D-Link DFE-550TX) +device stge # Sundance/Tamarack TC9021 gigabit Ethernet +device tl # Texas Instruments ThunderLAN +device tx # SMC EtherPower II (83c170 ``EPIC'') +device vge # VIA VT612x gigabit Ethernet +device vr # VIA Rhine, Rhine II +device vte # DM&P Vortex86 RDC R6040 Fast Ethernet +device wb # Winbond W89C840F +device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. -device cs # Crystal Semiconductor CS89x0 NIC +device cs # Crystal Semiconductor CS89x0 NIC # 'device ed' requires 'device miibus' -device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards -device ex # Intel EtherExpress Pro/10 and Pro/10+ -device ep # Etherlink III based cards -device fe # Fujitsu MB8696x based cards -device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc. -device sn # SMC's 9000 series of Ethernet chips -device xe # Xircom pccard Ethernet +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards +device ex # Intel EtherExpress Pro/10 and Pro/10+ +device ep # Etherlink III based cards +device fe # Fujitsu MB8696x based cards +device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc. +device sn # SMC's 9000 series of Ethernet chips +device xe # Xircom pccard Ethernet # Wireless NIC cards -device wlan # 802.11 support -options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +device wlan # 802.11 support +options IEEE80211_DEBUG # enable debug msgs +options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_amrr # AMRR transmit rate control algorithm -device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros NICs -device ath_pci # Atheros pci/cardbus glue -device ath_hal # pci/cardbus chip support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_amrr # AMRR transmit rate control algorithm +device an # Aironet 4500/4800 802.11 wireless NICs. +device ath # Atheros NICs +device ath_pci # Atheros pci/cardbus glue +device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation -options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later -device ath_rate_sample # SampleRate tx rate control for ath -#device bwi # Broadcom BCM430x/BCM431x wireless NICs. -#device bwn # Broadcom BCM43xx wireless NICs. -device ipw # Intel 2100 wireless NICs. -device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. -device iwn # Intel 4965/1000/5000/6000 wireless NICs. -device malo # Marvell Libertas wireless NICs. -device mwl # Marvell 88W8363 802.11n wireless NICs. -device ral # Ralink Technology RT2500 wireless NICs. -device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. -#device wl # Older non 802.11 Wavelan wireless NIC. -device wpi # Intel 3945ABG wireless NICs. +options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation +options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later +device ath_rate_sample # SampleRate tx rate control for ath +#device bwi # Broadcom BCM430x/BCM431x wireless NICs. +#device bwn # Broadcom BCM43xx wireless NICs. +device ipw # Intel 2100 wireless NICs. +device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. +device iwn # Intel 4965/1000/5000/6000 wireless NICs. +device malo # Marvell Libertas wireless NICs. +device mwl # Marvell 88W8363 802.11n wireless NICs. +device ral # Ralink Technology RT2500 wireless NICs. +device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. +#device wl # Older non 802.11 Wavelan wireless NIC. +device wpi # Intel 3945ABG wireless NICs. # Pseudo devices. -device loop # Network loopback -device random # Entropy device -device padlock_rng # VIA Padlock RNG -device rdrand_rng # Intel Bull Mountain RNG -device ether # Ethernet support -device vlan # 802.1Q VLAN support -device tun # Packet tunnel. -device md # Memory "disks" -device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) -device firmware # firmware assist module +device loop # Network loopback +device random # Entropy device +device padlock_rng # VIA Padlock RNG +device rdrand_rng # Intel Bull Mountain RNG +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter # USB support -options USB_DEBUG # enable debug msgs -device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) -device xhci # XHCI PCI->USB interface (USB 3.0) -device usb # USB Bus (required) -device ukbd # Keyboard -device umass # Disks/Mass storage - Requires scbus and da +options USB_DEBUG # enable debug msgs +device uhci # UHCI PCI->USB interface +device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device xhci # XHCI PCI->USB interface (USB 3.0) +device usb # USB Bus (required) +device ukbd # Keyboard +device umass # Disks/Mass storage - Requires scbus and da # Sound support -device sound # Generic sound driver (required) -device snd_cmi # CMedia CMI8338/CMI8738 -device snd_csa # Crystal Semiconductor CS461x/428x -device snd_emu10kx # Creative SoundBlaster Live! and Audigy -device snd_es137x # Ensoniq AudioPCI ES137x -device snd_hda # Intel High Definition Audio -device snd_ich # Intel, NVidia and other ICH AC'97 Audio -device snd_via8233 # VIA VT8233x Audio +device sound # Generic sound driver (required) +device snd_cmi # CMedia CMI8338/CMI8738 +device snd_csa # Crystal Semiconductor CS461x/428x +device snd_emu10kx # Creative SoundBlaster Live! and Audigy +device snd_es137x # Ensoniq AudioPCI ES137x +device snd_hda # Intel High Definition Audio +device snd_ich # Intel, NVidia and other ICH AC'97 Audio +device snd_via8233 # VIA VT8233x Audio # MMC/SD -device mmc # MMC/SD bus -device mmcsd # MMC/SD memory card -device sdhci # Generic PCI SD Host Controller +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card +device sdhci # Generic PCI SD Host Controller # VirtIO support -device virtio # Generic VirtIO bus (required) -device virtio_pci # VirtIO PCI device -device vtnet # VirtIO Ethernet device -device virtio_blk # VirtIO Block device -device virtio_scsi # VirtIO SCSI device -device virtio_balloon # VirtIO Memory Balloon device +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers -device hyperv # HyperV drivers +device hyperv # HyperV drivers # Xen HVM Guest Optimizations # NOTE: XENHVM depends on xenpci. They must be added or removed together. -options XENHVM # Xen HVM kernel infrastructure -device xenpci # Xen HVM Hypervisor services driver +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver # VMware support -device vmx # VMware VMXNET3 Ethernet +device vmx # VMware VMXNET3 Ethernet From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 17:18:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 615E7EB8; Sat, 17 May 2014 17:18: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 3462A2607; Sat, 17 May 2014 17:18: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 s4HHIaT1053073; Sat, 17 May 2014 17:18:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HHIZSB053069; Sat, 17 May 2014 17:18:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171718.s4HHIZSB053069@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 17:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266330 - in stable/10/sys: kern powerpc/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 17:18:36 -0000 Author: ian Date: Sat May 17 17:18:35 2014 New Revision: 266330 URL: http://svnweb.freebsd.org/changeset/base/266330 Log: MFC 261357, 261358, 261421: Enable SCHED_ULE for ppc book-e. Add driver for the ADT7460/ADT7467 fan controller found in later PowerBooks and iBooks. Modified: stable/10/sys/kern/sched_ule.c stable/10/sys/powerpc/conf/GENERIC stable/10/sys/powerpc/conf/MPC85XX Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sched_ule.c ============================================================================== --- stable/10/sys/kern/sched_ule.c Sat May 17 16:57:17 2014 (r266329) +++ stable/10/sys/kern/sched_ule.c Sat May 17 17:18:35 2014 (r266330) @@ -77,10 +77,6 @@ dtrace_vtime_switch_func_t dtrace_vtime_ #include #include -#if defined(__powerpc__) && defined(BOOKE_E500) -#error "This architecture is not currently compatible with ULE" -#endif - #define KTR_ULE 0 #define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) Modified: stable/10/sys/powerpc/conf/GENERIC ============================================================================== --- stable/10/sys/powerpc/conf/GENERIC Sat May 17 16:57:17 2014 (r266329) +++ stable/10/sys/powerpc/conf/GENERIC Sat May 17 17:18:35 2014 (r266330) @@ -126,6 +126,11 @@ device scc device uart device uart_z8530 +# FireWire support +device firewire # FireWire bus code +device sbp # SCSI over FireWire (Requires scbus and da) +device fwe # Ethernet over FireWire (non-standard!) + # PCI Ethernet NICs that use the common MII bus controller code. device miibus # MII bus support device bge # Broadcom BCM570xx Gigabit Ethernet Modified: stable/10/sys/powerpc/conf/MPC85XX ============================================================================== --- stable/10/sys/powerpc/conf/MPC85XX Sat May 17 16:57:17 2014 (r266329) +++ stable/10/sys/powerpc/conf/MPC85XX Sat May 17 17:18:35 2014 (r266330) @@ -48,7 +48,9 @@ options NFSCL options NFSLOCKD options PROCFS options PSEUDOFS -options SCHED_4BSD +options SCHED_ULE +options CAPABILITIES +options CAPABILITY_MODE options SMP options SYSVMSG options SYSVSEM @@ -64,6 +66,7 @@ device cryptodev device da device ds1553 device em +device alc device ether device fxp device iic From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 17:34:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C815C270; Sat, 17 May 2014 17:34: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 B34BE2779; Sat, 17 May 2014 17:34: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 s4HHYnjN064686; Sat, 17 May 2014 17:34:49 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HHYchx064603; Sat, 17 May 2014 17:34:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171734.s4HHYchx064603@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 17:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266331 - in stable/10/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf powerpc/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 17:34:49 -0000 Author: ian Date: Sat May 17 17:34:37 2014 New Revision: 266331 URL: http://svnweb.freebsd.org/changeset/base/266331 Log: MFC 263301 In kernel config files, it is supposed to be 'options' not 'options', per long standing (but recently not so strictly enforced) convention. Modified: stable/10/sys/amd64/conf/NOTES stable/10/sys/arm/conf/AC100 stable/10/sys/arm/conf/ARMADAXP stable/10/sys/arm/conf/ARNDALE stable/10/sys/arm/conf/ATMEL stable/10/sys/arm/conf/AVILA stable/10/sys/arm/conf/BEAGLEBONE stable/10/sys/arm/conf/BWCT stable/10/sys/arm/conf/CAMBRIA stable/10/sys/arm/conf/CNS11XXNAS stable/10/sys/arm/conf/COLIBRI-VF50 stable/10/sys/arm/conf/COSMIC stable/10/sys/arm/conf/CRB stable/10/sys/arm/conf/CUBIEBOARD stable/10/sys/arm/conf/CUBIEBOARD2 stable/10/sys/arm/conf/DB-78XXX stable/10/sys/arm/conf/DB-88F5XXX stable/10/sys/arm/conf/DB-88F6XXX stable/10/sys/arm/conf/DIGI-CCWMX53 stable/10/sys/arm/conf/DOCKSTAR stable/10/sys/arm/conf/DREAMPLUG-1001 stable/10/sys/arm/conf/EA3250 stable/10/sys/arm/conf/EB9200 stable/10/sys/arm/conf/EFIKA_MX stable/10/sys/arm/conf/EP80219 stable/10/sys/arm/conf/ETHERNUT5 stable/10/sys/arm/conf/GUMSTIX stable/10/sys/arm/conf/HL200 stable/10/sys/arm/conf/HL201 stable/10/sys/arm/conf/IMX53-QSB stable/10/sys/arm/conf/IMX6 stable/10/sys/arm/conf/IQ31244 stable/10/sys/arm/conf/KB920X stable/10/sys/arm/conf/LN2410SBC stable/10/sys/arm/conf/NSLU stable/10/sys/arm/conf/PANDABOARD stable/10/sys/arm/conf/QILA9G20 stable/10/sys/arm/conf/QUARTZ stable/10/sys/arm/conf/RADXA stable/10/sys/arm/conf/RPI-B stable/10/sys/arm/conf/SAM9260EK stable/10/sys/arm/conf/SAM9G20EK stable/10/sys/arm/conf/SAM9X25EK stable/10/sys/arm/conf/SHEEVAPLUG stable/10/sys/arm/conf/SN9G45 stable/10/sys/arm/conf/TS7800 stable/10/sys/arm/conf/VERSATILEPB stable/10/sys/arm/conf/VYBRID.common stable/10/sys/arm/conf/WANDBOARD.common stable/10/sys/arm/conf/ZEDBOARD stable/10/sys/i386/conf/NOTES stable/10/sys/i386/conf/XEN stable/10/sys/ia64/conf/GENERIC stable/10/sys/mips/conf/ALCHEMY stable/10/sys/mips/conf/AP121 stable/10/sys/mips/conf/AP91 stable/10/sys/mips/conf/AP93 stable/10/sys/mips/conf/AP94 stable/10/sys/mips/conf/AP96 stable/10/sys/mips/conf/AR71XX_BASE stable/10/sys/mips/conf/AR724X_BASE stable/10/sys/mips/conf/AR91XX_BASE stable/10/sys/mips/conf/AR933X_BASE stable/10/sys/mips/conf/AR934X_BASE stable/10/sys/mips/conf/CARAMBOLA2 stable/10/sys/mips/conf/ENH200 stable/10/sys/mips/conf/PB47 stable/10/sys/mips/conf/PB92 stable/10/sys/mips/conf/PICOSTATION_M2HP stable/10/sys/mips/conf/ROUTERSTATION stable/10/sys/mips/conf/ROUTERSTATION_MFS stable/10/sys/mips/conf/RSPRO stable/10/sys/mips/conf/RSPRO_MFS stable/10/sys/mips/conf/RSPRO_STANDALONE stable/10/sys/mips/conf/RT305X stable/10/sys/mips/conf/SENTRY5 stable/10/sys/mips/conf/SWARM64_SMP stable/10/sys/mips/conf/SWARM_SMP stable/10/sys/mips/conf/TP-WN1043ND stable/10/sys/mips/conf/WZR-300HP stable/10/sys/mips/conf/XLRN32 stable/10/sys/mips/conf/std.SWARM stable/10/sys/mips/conf/std.XLP stable/10/sys/powerpc/conf/GENERIC stable/10/sys/powerpc/conf/GENERIC64 stable/10/sys/powerpc/conf/MPC85XX stable/10/sys/powerpc/conf/NOTES Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/conf/NOTES ============================================================================== --- stable/10/sys/amd64/conf/NOTES Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/amd64/conf/NOTES Sat May 17 17:34:37 2014 (r266331) @@ -187,7 +187,7 @@ options VESA_DEBUG device dpms # DPMS suspend & resume via VESA BIOS # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa -options X86BIOS +options X86BIOS # # Optional devices: @@ -442,7 +442,7 @@ device ips # # Intel C600 (Patsburg) integrated SAS controller device isci -options ISCI_LOGGING # enable debugging in isci HAL +options ISCI_LOGGING # enable debugging in isci HAL # # NVM Express (NVMe) support Modified: stable/10/sys/arm/conf/AC100 ============================================================================== --- stable/10/sys/arm/conf/AC100 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/AC100 Sat May 17 17:34:37 2014 (r266331) @@ -25,7 +25,7 @@ options FFS # Berkeley Fast Filesyste #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=mge0 -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT Modified: stable/10/sys/arm/conf/ARMADAXP ============================================================================== --- stable/10/sys/arm/conf/ARMADAXP Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/ARMADAXP Sat May 17 17:34:37 2014 (r266331) @@ -26,7 +26,7 @@ options BOOTP_NFSROOT options BOOTP_NFSV3 options BOOTP_WIRED_TO=mge0 -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT Modified: stable/10/sys/arm/conf/ARNDALE ============================================================================== --- stable/10/sys/arm/conf/ARNDALE Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/ARNDALE Sat May 17 17:34:37 2014 (r266331) @@ -27,49 +27,49 @@ makeoptions WITHOUT_MODULES="ahc" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER options VFP # vfp/neon # Debugging makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER +options BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options KDB +options DDB # Enable the kernel debugger +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options DIAGNOSTIC +options DIAGNOSTIC # NFS support -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT # Uncomment this for NFS root #options NFS_ROOT # NFS usable as /, requires NFSCL @@ -83,7 +83,7 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards device sdhci # generic sdhci -options ROOTDEVNAME=\"ufs:/dev/da0\" +options ROOTDEVNAME=\"ufs:/dev/da0\" #options SMP @@ -98,7 +98,7 @@ device gpio # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb -options USB_DEBUG +options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE #device musb @@ -134,6 +134,6 @@ device axe # ASIX Electronics USB Eth device bpf # Berkeley packet filter #FDT -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=exynos5250-arndale.dts Modified: stable/10/sys/arm/conf/ATMEL ============================================================================== --- stable/10/sys/arm/conf/ATMEL Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/ATMEL Sat May 17 17:34:37 2014 (r266331) @@ -48,7 +48,7 @@ options NFSCL # New Network Filesyste options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/AVILA ============================================================================== --- stable/10/sys/arm/conf/AVILA Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/AVILA Sat May 17 17:34:37 2014 (r266331) @@ -49,7 +49,7 @@ options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options NFSCL # New Network Filesystem Client Modified: stable/10/sys/arm/conf/BEAGLEBONE ============================================================================== --- stable/10/sys/arm/conf/BEAGLEBONE Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/BEAGLEBONE Sat May 17 17:34:37 2014 (r266331) @@ -36,7 +36,7 @@ options UFS_ACL # Support for access options UFS_DIRHASH # Improve performance on big directories options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/BWCT ============================================================================== --- stable/10/sys/arm/conf/BWCT Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/BWCT Sat May 17 17:34:37 2014 (r266331) @@ -53,7 +53,7 @@ options BOOTP options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/CAMBRIA ============================================================================== --- stable/10/sys/arm/conf/CAMBRIA Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/CAMBRIA Sat May 17 17:34:37 2014 (r266331) @@ -50,7 +50,7 @@ options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options NFSCL # New Network Filesystem Client Modified: stable/10/sys/arm/conf/CNS11XXNAS ============================================================================== --- stable/10/sys/arm/conf/CNS11XXNAS Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/CNS11XXNAS Sat May 17 17:34:37 2014 (r266331) @@ -71,7 +71,7 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server #options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/COLIBRI-VF50 ============================================================================== --- stable/10/sys/arm/conf/COLIBRI-VF50 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/COLIBRI-VF50 Sat May 17 17:34:37 2014 (r266331) @@ -21,6 +21,6 @@ include "VYBRID.common" ident COLIBRI-VF50 #FDT -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=vybrid-colibri-vf50.dts Modified: stable/10/sys/arm/conf/COSMIC ============================================================================== --- stable/10/sys/arm/conf/COSMIC Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/COSMIC Sat May 17 17:34:37 2014 (r266331) @@ -21,6 +21,6 @@ include "VYBRID.common" ident COSMIC #FDT -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=vybrid-cosmic.dts Modified: stable/10/sys/arm/conf/CRB ============================================================================== --- stable/10/sys/arm/conf/CRB Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/CRB Sat May 17 17:34:37 2014 (r266331) @@ -47,7 +47,7 @@ options NFS_ROOT # NFS usable as /, re #options MSDOSFS # MSDOS Filesystem options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework Modified: stable/10/sys/arm/conf/CUBIEBOARD ============================================================================== --- stable/10/sys/arm/conf/CUBIEBOARD Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/CUBIEBOARD Sat May 17 17:34:37 2014 (r266331) @@ -31,7 +31,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists @@ -82,7 +82,7 @@ options WITNESS_SKIPSPIN # Don't run wi #device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -options ROOTDEVNAME=\"ufs:/dev/da0s2\" +options ROOTDEVNAME=\"ufs:/dev/da0s2\" # ATA controllers #device ahci # AHCI-compatible SATA controllers @@ -134,7 +134,7 @@ device emac device miibus # Flattened Device Tree -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=cubieboard.dts Modified: stable/10/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- stable/10/sys/arm/conf/CUBIEBOARD2 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/CUBIEBOARD2 Sat May 17 17:34:37 2014 (r266331) @@ -31,7 +31,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: stable/10/sys/arm/conf/DB-78XXX ============================================================================== --- stable/10/sys/arm/conf/DB-78XXX Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/DB-78XXX Sat May 17 17:34:37 2014 (r266331) @@ -18,7 +18,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options NANDFS # NAND Filesystem options NFSCL # New Network Filesystem Client Modified: stable/10/sys/arm/conf/DB-88F5XXX ============================================================================== --- stable/10/sys/arm/conf/DB-88F5XXX Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/DB-88F5XXX Sat May 17 17:34:37 2014 (r266331) @@ -18,7 +18,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options NFSCL # New Network Filesystem Client options NFSLOCKD # Network Lock Manager Modified: stable/10/sys/arm/conf/DB-88F6XXX ============================================================================== --- stable/10/sys/arm/conf/DB-88F6XXX Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/DB-88F6XXX Sat May 17 17:34:37 2014 (r266331) @@ -18,7 +18,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options NANDFS # NAND Filesystem options NFSCL # New Network Filesystem Client Modified: stable/10/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- stable/10/sys/arm/conf/DIGI-CCWMX53 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/DIGI-CCWMX53 Sat May 17 17:34:37 2014 (r266331) @@ -41,7 +41,7 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/DOCKSTAR ============================================================================== --- stable/10/sys/arm/conf/DOCKSTAR Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/DOCKSTAR Sat May 17 17:34:37 2014 (r266331) @@ -34,7 +34,7 @@ options INET6 # IPv6 communications p options SOFTUPDATES options CD9660 # ISO 9660 filesystem options FFS # Berkeley Fast Filesystem -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MS DOS File System (FAT, FAT32) options NULLFS # NULL filesystem options SYSVSHM # SYSV-style shared memory Modified: stable/10/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- stable/10/sys/arm/conf/DREAMPLUG-1001 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/DREAMPLUG-1001 Sat May 17 17:34:37 2014 (r266331) @@ -35,7 +35,7 @@ options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols options SOFTUPDATES -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options CD9660 # ISO 9660 filesystem options FFS # Berkeley Fast Filesystem options MSDOSFS # MS DOS File System (FAT, FAT32) Modified: stable/10/sys/arm/conf/EA3250 ============================================================================== --- stable/10/sys/arm/conf/EA3250 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/EA3250 Sat May 17 17:34:37 2014 (r266331) @@ -22,7 +22,7 @@ options NFSLOCKD # Network Lock Manage options NFS_ROOT # NFS usable as /, requires NFSCLIENT options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS options BOOTP options BOOTP_NFSROOT Modified: stable/10/sys/arm/conf/EB9200 ============================================================================== --- stable/10/sys/arm/conf/EB9200 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/EB9200 Sat May 17 17:34:37 2014 (r266331) @@ -43,7 +43,7 @@ options BOOTP options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/EFIKA_MX ============================================================================== --- stable/10/sys/arm/conf/EFIKA_MX Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/EFIKA_MX Sat May 17 17:34:37 2014 (r266331) @@ -41,7 +41,7 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/EP80219 ============================================================================== --- stable/10/sys/arm/conf/EP80219 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/EP80219 Sat May 17 17:34:37 2014 (r266331) @@ -43,7 +43,7 @@ options NFSCL # New Network Filesyste options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/ETHERNUT5 ============================================================================== --- stable/10/sys/arm/conf/ETHERNUT5 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/ETHERNUT5 Sat May 17 17:34:37 2014 (r266331) @@ -43,7 +43,7 @@ options NFSLOCKD # Network Lock Manage options NFS_ROOT # NFS usable as /, requires NFSCL options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/GUMSTIX ============================================================================== --- stable/10/sys/arm/conf/GUMSTIX Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/GUMSTIX Sat May 17 17:34:37 2014 (r266331) @@ -49,7 +49,7 @@ options NFSCL # New Network Filesyste options NFS_ROOT # NFS usable as /, requires NFSCL options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/HL200 ============================================================================== --- stable/10/sys/arm/conf/HL200 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/HL200 Sat May 17 17:34:37 2014 (r266331) @@ -51,7 +51,7 @@ options BOOTP_COMPAT options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/HL201 ============================================================================== --- stable/10/sys/arm/conf/HL201 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/HL201 Sat May 17 17:34:37 2014 (r266331) @@ -54,7 +54,7 @@ options ALT_BREAK_TO_DEBUGGER options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/IMX53-QSB ============================================================================== --- stable/10/sys/arm/conf/IMX53-QSB Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/IMX53-QSB Sat May 17 17:34:37 2014 (r266331) @@ -40,7 +40,7 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/IMX6 ============================================================================== --- stable/10/sys/arm/conf/IMX6 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/IMX6 Sat May 17 17:34:37 2014 (r266331) @@ -36,7 +36,7 @@ options NFSCL # New Network Filesyst #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/IQ31244 ============================================================================== --- stable/10/sys/arm/conf/IQ31244 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/IQ31244 Sat May 17 17:34:37 2014 (r266331) @@ -46,7 +46,7 @@ options NFSLOCKD # Network Lock Manage options NFS_ROOT # NFS usable as /, requires NFSCL options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/KB920X ============================================================================== --- stable/10/sys/arm/conf/KB920X Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/KB920X Sat May 17 17:34:37 2014 (r266331) @@ -49,7 +49,7 @@ options NFSCL # New Network Filesyste options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/LN2410SBC ============================================================================== --- stable/10/sys/arm/conf/LN2410SBC Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/LN2410SBC Sat May 17 17:34:37 2014 (r266331) @@ -49,7 +49,7 @@ options ROOTDEVNAME=\"ufs:da0s1\" options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options PSEUDOFS # Pseudo-filesystem framework #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support Modified: stable/10/sys/arm/conf/NSLU ============================================================================== --- stable/10/sys/arm/conf/NSLU Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/NSLU Sat May 17 17:34:37 2014 (r266331) @@ -63,7 +63,7 @@ options NFSLOCKD # Network Lock Manage options NFS_ROOT # NFS usable as /, requires NFSCL options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/PANDABOARD ============================================================================== --- stable/10/sys/arm/conf/PANDABOARD Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/PANDABOARD Sat May 17 17:34:37 2014 (r266331) @@ -56,7 +56,7 @@ options NFS_ROOT # NFS usable as /, re #options BOOTP_WIRED_TO=ue0 options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/QILA9G20 ============================================================================== --- stable/10/sys/arm/conf/QILA9G20 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/QILA9G20 Sat May 17 17:34:37 2014 (r266331) @@ -55,7 +55,7 @@ options ALT_BREAK_TO_DEBUGGER options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/QUARTZ ============================================================================== --- stable/10/sys/arm/conf/QUARTZ Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/QUARTZ Sat May 17 17:34:37 2014 (r266331) @@ -21,6 +21,6 @@ include "VYBRID.common" ident QUARTZ #FDT -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=vybrid-quartz.dts Modified: stable/10/sys/arm/conf/RADXA ============================================================================== --- stable/10/sys/arm/conf/RADXA Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/RADXA Sat May 17 17:34:37 2014 (r266331) @@ -25,44 +25,44 @@ include "../rockchip/std.rk30xx" makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options PREEMPTION -options FREEBSD_BOOT_LOADER -options VFP # vfp/neon +options TMPFS # Efficient memory filesystem +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon # Debugging makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER +options BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger +options KDB +options DDB # Enable the kernel debugger #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options DIAGNOSTIC +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options DIAGNOSTIC # NFS support #options NFSCL @@ -74,7 +74,7 @@ options DIAGNOSTIC #device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -options ROOTDEVNAME=\"ufs:/dev/da0s2\" +options ROOTDEVNAME=\"ufs:/dev/da0s2\" # Console and misc device uart @@ -98,7 +98,7 @@ device pass # USB support options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb -options USB_DEBUG +options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE device dwcotg # DWC OTG controller @@ -117,7 +117,7 @@ device miibus device udav # Flattened Device Tree -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=rk3188-radxa.dts Modified: stable/10/sys/arm/conf/RPI-B ============================================================================== --- stable/10/sys/arm/conf/RPI-B Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/RPI-B Sat May 17 17:34:37 2014 (r266331) @@ -27,14 +27,14 @@ options HZ=100 options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol +options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem device snp Modified: stable/10/sys/arm/conf/SAM9260EK ============================================================================== --- stable/10/sys/arm/conf/SAM9260EK Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/SAM9260EK Sat May 17 17:34:37 2014 (r266331) @@ -43,7 +43,7 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/SAM9G20EK ============================================================================== --- stable/10/sys/arm/conf/SAM9G20EK Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/SAM9G20EK Sat May 17 17:34:37 2014 (r266331) @@ -34,7 +34,7 @@ options INET # InterNETworking #options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: stable/10/sys/arm/conf/SAM9X25EK ============================================================================== --- stable/10/sys/arm/conf/SAM9X25EK Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/SAM9X25EK Sat May 17 17:34:37 2014 (r266331) @@ -35,7 +35,7 @@ options INET # InterNETworking #options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: stable/10/sys/arm/conf/SHEEVAPLUG ============================================================================== --- stable/10/sys/arm/conf/SHEEVAPLUG Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/SHEEVAPLUG Sat May 17 17:34:37 2014 (r266331) @@ -18,7 +18,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options NANDFS # NAND Filesystem options NFSCL # New Network Filesystem Client Modified: stable/10/sys/arm/conf/SN9G45 ============================================================================== --- stable/10/sys/arm/conf/SN9G45 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/SN9G45 Sat May 17 17:34:37 2014 (r266331) @@ -54,7 +54,7 @@ options ALT_BREAK_TO_DEBUGGER options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/TS7800 ============================================================================== --- stable/10/sys/arm/conf/TS7800 Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/TS7800 Sat May 17 17:34:37 2014 (r266331) @@ -28,7 +28,7 @@ options BOOTP_WIRED_TO=mge0 options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues Modified: stable/10/sys/arm/conf/VERSATILEPB ============================================================================== --- stable/10/sys/arm/conf/VERSATILEPB Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/VERSATILEPB Sat May 17 17:34:37 2014 (r266331) @@ -29,8 +29,8 @@ makeoptions KERNVIRTADDR=0xc0100000 options KERNPHYSADDR=0x00100000 makeoptions KERNPHYSADDR=0x00100000 options PHYSADDR=0x00000000 -options FREEBSD_BOOT_LOADER -options LINUX_BOOT_ABI +options FREEBSD_BOOT_LOADER +options LINUX_BOOT_ABI makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options HZ=100 @@ -45,7 +45,7 @@ device snp options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options PSEUDOFS # Pseudo-filesystem framework options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI Modified: stable/10/sys/arm/conf/VYBRID.common ============================================================================== --- stable/10/sys/arm/conf/VYBRID.common Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/VYBRID.common Sat May 17 17:34:37 2014 (r266331) @@ -25,32 +25,32 @@ makeoptions WITHOUT_MODULES="ahc" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # Efficient memory filesystem +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework #options NANDFS # NAND Filesystem -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT @@ -59,10 +59,10 @@ options VFP # vfp/neon # Debugging makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER +options BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger +options KDB +options DDB # Enable the kernel debugger #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles @@ -70,9 +70,9 @@ options DDB # Enable the kernel debug #options DIAGNOSTIC # NFS support -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT # Uncomment this for NFS root #options NFS_ROOT # NFS usable as /, requires NFSCL @@ -86,9 +86,9 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards device sdhci # generic sdhci -#options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" -#options ROOTDEVNAME=\"nandfs:/dev/gnand0s.root\" -options ROOTDEVNAME=\"ufs:/dev/da0\" +#options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" +#options ROOTDEVNAME=\"nandfs:/dev/gnand0s.root\" +options ROOTDEVNAME=\"ufs:/dev/da0\" #options SMP @@ -103,7 +103,7 @@ device gpio # USB support options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb -options USB_DEBUG +options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE #device musb @@ -143,6 +143,6 @@ device sound # Framebuffer device vt device kbdmux -options SC_DFLT_FONT # compile font in +options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp437 device ukbd Modified: stable/10/sys/arm/conf/WANDBOARD.common ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD.common Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/WANDBOARD.common Sat May 17 17:34:37 2014 (r266331) @@ -35,7 +35,7 @@ options NFSCL # New Network Filesyst #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: stable/10/sys/arm/conf/ZEDBOARD ============================================================================== --- stable/10/sys/arm/conf/ZEDBOARD Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/arm/conf/ZEDBOARD Sat May 17 17:34:37 2014 (r266331) @@ -43,7 +43,7 @@ options NFSCL # Network Filesystem Cl options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) @@ -54,7 +54,7 @@ options SYSVSHM # SYSV-style shared m options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options FREEBSD_BOOT_LOADER +options FREEBSD_BOOT_LOADER options VFP # vfp/neon # Debugging Modified: stable/10/sys/i386/conf/NOTES ============================================================================== --- stable/10/sys/i386/conf/NOTES Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/i386/conf/NOTES Sat May 17 17:34:37 2014 (r266331) @@ -381,7 +381,7 @@ options VESA_DEBUG device dpms # DPMS suspend & resume via VESA BIOS # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa -options X86BIOS +options X86BIOS # # The Numeric Processing eXtension driver. This is non-optional. @@ -758,7 +758,7 @@ device ips # # Intel C600 (Patsburg) integrated SAS controller device isci -options ISCI_LOGGING # enable debugging in isci HAL +options ISCI_LOGGING # enable debugging in isci HAL # # NVM Express (NVMe) support Modified: stable/10/sys/i386/conf/XEN ============================================================================== --- stable/10/sys/i386/conf/XEN Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/i386/conf/XEN Sat May 17 17:34:37 2014 (r266331) @@ -83,8 +83,8 @@ device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) # Wireless cards -options IEEE80211_SUPPORT_MESH -options AH_SUPPORT_AR5416 +options IEEE80211_SUPPORT_MESH +options AH_SUPPORT_AR5416 # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! Modified: stable/10/sys/ia64/conf/GENERIC ============================================================================== --- stable/10/sys/ia64/conf/GENERIC Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/ia64/conf/GENERIC Sat May 17 17:34:37 2014 (r266331) @@ -177,11 +177,11 @@ device uvscom # USB serial support for # Wireless NIC cards. # The wlan(4) module assumes this, so just define it so it # at least correctly loads. -options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_MESH # The ath(4) and ath_hal(4) code requires this. The module currently # builds everything including AR5416 (and later 11n NIC) support. -options AH_SUPPORT_AR5416 +options AH_SUPPORT_AR5416 # Various (pseudo) devices device ether # Ethernet support Modified: stable/10/sys/mips/conf/ALCHEMY ============================================================================== --- stable/10/sys/mips/conf/ALCHEMY Sat May 17 17:18:35 2014 (r266330) +++ stable/10/sys/mips/conf/ALCHEMY Sat May 17 17:34:37 2014 (r266331) @@ -28,15 +28,15 @@ include "../alchemy/std.alchemy" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -options DDB -options KDB +options DDB +options KDB -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options NFSCL #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCL -options PSEUDOFS #Pseudo-filesystem framework -# options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL +options PSEUDOFS #Pseudo-filesystem framework +# options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options BOOTP options BOOTP_NFSROOT @@ -48,15 +48,15 @@ options BOOTP_COMPAT # options SOFTUPDATES #Enable FFS soft updates support # options UFS_ACL #Support for access control lists # options UFS_DIRHASH #Improve performance on big directories -options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\" +options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\" # Debugging for use in -current #options DEADLKRES #Enable the deadlock resolver -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed device loop device ether *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 17:54:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C9DFA6D8; Sat, 17 May 2014 17:54: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 B441B28F1; Sat, 17 May 2014 17:54: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 s4HHsevr076690; Sat, 17 May 2014 17:54:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HHscdm076669; Sat, 17 May 2014 17:54:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171754.s4HHscdm076669@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 17:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266332 - in stable/10/sys: arm/arm arm/conf arm/samsung/exynos boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 17:54:40 -0000 Author: ian Date: Sat May 17 17:54:38 2014 New Revision: 266332 URL: http://svnweb.freebsd.org/changeset/base/266332 Log: MFC 263250, 263251, 263424, 263425, 263426, 263427, 263430, 263431 Use the same cache terminology as the ARM docs in comments. No functional changes. Use armv7 TLB flush code, not arm11, for cortex-a processors. Exynos/ Arndale... - Disable debugging by default. - Add display-related and clk devices to the tree - Prevent resources intersection with EHCI driver - Add display-related and clk devices to the tree - Prevent resources intersection with EHCI driver - Add driver for Display Controller. - Add support for Samsung Chromebook (ARM Cortex A15 machine). - Rename mct and ehci drivers files to match common naming. Added: stable/10/sys/arm/conf/CHROMEBOOK - copied unchanged from r263427, head/sys/arm/conf/CHROMEBOOK stable/10/sys/arm/samsung/exynos/exynos5_common.h - copied unchanged from r263426, head/sys/arm/samsung/exynos/exynos5_common.h stable/10/sys/arm/samsung/exynos/exynos5_ehci.c - copied unchanged from r263431, head/sys/arm/samsung/exynos/exynos5_ehci.c stable/10/sys/arm/samsung/exynos/exynos5_fimd.c - copied, changed from r263426, head/sys/arm/samsung/exynos/exynos5_fimd.c stable/10/sys/arm/samsung/exynos/exynos5_mct.c - copied unchanged from r263431, head/sys/arm/samsung/exynos/exynos5_mct.c stable/10/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts - copied unchanged from r263427, head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts Deleted: stable/10/sys/arm/samsung/exynos/arch_timer.c stable/10/sys/arm/samsung/exynos/ehci_exynos5.c Modified: stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/conf/ARNDALE stable/10/sys/arm/samsung/exynos/files.exynos5 stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc.c ============================================================================== --- stable/10/sys/arm/arm/cpufunc.c Sat May 17 17:34:37 2014 (r266331) +++ stable/10/sys/arm/arm/cpufunc.c Sat May 17 17:54:38 2014 (r266332) @@ -754,14 +754,18 @@ struct cpu_functions cortexa_cpufuncs = cpufunc_faultstatus, /* Faultstatus */ cpufunc_faultaddress, /* Faultaddress */ - /* TLB functions */ + /* + * TLB functions. ARMv7 does all TLB ops based on a unified TLB model + * whether the hardware implements separate I+D or not, so we use the + * same 'ID' functions for all 3 variations. + */ armv7_tlb_flushID, /* tlb_flushID */ armv7_tlb_flushID_SE, /* tlb_flushID_SE */ - arm11_tlb_flushI, /* tlb_flushI */ - arm11_tlb_flushI_SE, /* tlb_flushI_SE */ - arm11_tlb_flushD, /* tlb_flushD */ - arm11_tlb_flushD_SE, /* tlb_flushD_SE */ + armv7_tlb_flushID, /* tlb_flushI */ + armv7_tlb_flushID_SE, /* tlb_flushI_SE */ + armv7_tlb_flushID, /* tlb_flushD */ + armv7_tlb_flushID_SE, /* tlb_flushD_SE */ /* Cache operations */ Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 17 17:34:37 2014 (r266331) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 17 17:54:38 2014 (r266332) @@ -84,10 +84,10 @@ END(armv7_setttb) ENTRY(armv7_tlb_flushID) dsb #ifdef SMP - mcr p15, 0, r0, c8, c3, 0 /* flush I+D tlb */ - mcr p15, 0, r0, c7, c1, 6 /* flush BTB */ + mcr p15, 0, r0, c8, c3, 0 /* flush Unified TLB all entries Inner Shareable */ + mcr p15, 0, r0, c7, c1, 6 /* flush BTB Inner Shareable */ #else - mcr p15, 0, r0, c8, c7, 0 /* flush I+D tlb */ + mcr p15, 0, r0, c8, c7, 0 /* flush Unified TLB all entries */ mcr p15, 0, r0, c7, c5, 6 /* flush BTB */ #endif dsb @@ -99,10 +99,10 @@ ENTRY(armv7_tlb_flushID_SE) ldr r1, .Lpage_mask bic r0, r0, r1 #ifdef SMP - mcr p15, 0, r0, c8, c3, 3 /* flush D tlb single entry Inner Shareable*/ + mcr p15, 0, r0, c8, c3, 3 /* flush Unified TLB single entry Inner Shareable */ mcr p15, 0, r0, c7, c1, 6 /* flush BTB Inner Shareable */ #else - mcr p15, 0, r0, c8, c7, 1 /* flush D tlb single entry */ + mcr p15, 0, r0, c8, c7, 1 /* flush Unified TLB single entry */ mcr p15, 0, r0, c7, c5, 6 /* flush BTB */ #endif dsb Modified: stable/10/sys/arm/conf/ARNDALE ============================================================================== --- stable/10/sys/arm/conf/ARNDALE Sat May 17 17:34:37 2014 (r266331) +++ stable/10/sys/arm/conf/ARNDALE Sat May 17 17:54:38 2014 (r266332) @@ -60,11 +60,11 @@ options BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT # Enable verbose sysinit messages options KDB options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options DIAGNOSTIC +#options DIAGNOSTIC # NFS support options NFSCL # Network Filesystem Client Copied: stable/10/sys/arm/conf/CHROMEBOOK (from r263427, head/sys/arm/conf/CHROMEBOOK) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/CHROMEBOOK Sat May 17 17:54:38 2014 (r266332, copy of r263427, head/sys/arm/conf/CHROMEBOOK) @@ -0,0 +1,146 @@ +# Kernel configuration for Samsung Chromebook (Exynos5 Dual machine). +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident CHROMEBOOK + +include "../samsung/exynos/std.exynos5" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB +options DDB # Enable the kernel debugger +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +# NFS support +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT + +# Uncomment this for NFS root +#options NFS_ROOT # NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=cpsw0 + +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci + +options ROOTDEVNAME=\"ufs:/dev/da0\" + +#options SMP + +# Pseudo devices + +device loop +device random +device pty +device md +device gpio + +# USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +#device musb +device ehci +#device ohci + +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# SATA +#device ata +#device atadisk +#device mvs + +# Serial ports +device uart + +# Framebuffer +device vt +device kbdmux +options SC_DFLT_FONT # compile font in +makeoptions SC_DFLT_FONT=cp437 +device ukbd + +# I2C (TWSI) +#device iic +#device iicbus + +# Ethernet +device ether +device mii +device smsc +device smscphy + +# USB ethernet support, requires miibus +device miibus +device axe # ASIX Electronics USB Ethernet +device bpf # Berkeley packet filter + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=exynos5250-chromebook.dts Copied: stable/10/sys/arm/samsung/exynos/exynos5_common.h (from r263426, head/sys/arm/samsung/exynos/exynos5_common.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/samsung/exynos/exynos5_common.h Sat May 17 17:54:38 2014 (r266332, copy of r263426, head/sys/arm/samsung/exynos/exynos5_common.h) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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$ + */ + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) +#define READ2(_sc, _reg) \ + bus_space_read_2(_sc->bst, _sc->bsh, _reg) +#define WRITE2(_sc, _reg, _val) \ + bus_space_write_2(_sc->bst, _sc->bsh, _reg, _val) +#define READ1(_sc, _reg) \ + bus_space_read_1(_sc->bst, _sc->bsh, _reg) +#define WRITE1(_sc, _reg, _val) \ + bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) Copied: stable/10/sys/arm/samsung/exynos/exynos5_ehci.c (from r263431, head/sys/arm/samsung/exynos/exynos5_ehci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/samsung/exynos/exynos5_ehci.c Sat May 17 17:54:38 2014 (r266332, copy of r263431, head/sys/arm/samsung/exynos/exynos5_ehci.c) @@ -0,0 +1,370 @@ +/*- + * Copyright (c) 2013 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "opt_platform.h" + +/* GPIO control */ +#define GPIO_CON(x, v) ((v) << ((x) * 4)) +#define GPIO_MASK 0xf +#define GPIO_OUTPUT 1 +#define GPIO_INPUT 0 +#define GPX3CON 0x0 +#define GPX3DAT 0x4 +#define PIN_USB 5 + +/* PWR control */ +#define EXYNOS5_PWR_USBHOST_PHY 0x708 +#define PHY_POWER_ON 1 +#define PHY_POWER_OFF 0 + +/* SYSREG */ +#define EXYNOS5_SYSREG_USB2_PHY 0x0 +#define USB2_MODE_HOST 0x1 + +/* USB HOST */ +#define HOST_CTRL_CLK_24MHZ (5 << 16) +#define HOST_CTRL_CLK_MASK (7 << 16) +#define HOST_CTRL_SIDDQ (1 << 6) +#define HOST_CTRL_SLEEP (1 << 5) +#define HOST_CTRL_SUSPEND (1 << 4) +#define HOST_CTRL_RESET_LINK (1 << 1) +#define HOST_CTRL_RESET_PHY (1 << 0) +#define HOST_CTRL_RESET_PHY_ALL (1U << 31) + +/* Forward declarations */ +static int exynos_ehci_attach(device_t dev); +static int exynos_ehci_detach(device_t dev); +static int exynos_ehci_probe(device_t dev); + +struct exynos_ehci_softc { + ehci_softc_t base; + struct resource *res[6]; + bus_space_tag_t host_bst; + bus_space_tag_t pwr_bst; + bus_space_tag_t sysreg_bst; + bus_space_tag_t gpio_bst; + bus_space_handle_t host_bsh; + bus_space_handle_t pwr_bsh; + bus_space_handle_t sysreg_bsh; + bus_space_handle_t gpio_bsh; + +}; + +static struct resource_spec exynos_ehci_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, + { SYS_RES_MEMORY, 2, RF_ACTIVE }, + { SYS_RES_MEMORY, 3, RF_ACTIVE }, + { SYS_RES_MEMORY, 4, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, exynos_ehci_probe), + DEVMETHOD(device_attach, exynos_ehci_attach), + DEVMETHOD(device_detach, exynos_ehci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + { 0, 0 } +}; + +/* kobj_class definition */ +static driver_t ehci_driver = { + "ehci", + ehci_methods, + sizeof(ehci_softc_t) +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); + +/* + * Public methods + */ +static int +exynos_ehci_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "exynos,usb-ehci") == 0) + return (ENXIO); + + device_set_desc(dev, "Exynos integrated USB controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +gpio_ctrl(struct exynos_ehci_softc *esc, int dir, int power) +{ + int reg; + + /* Power control */ + reg = bus_space_read_4(esc->gpio_bst, esc->gpio_bsh, GPX3DAT); + reg &= ~(1 << PIN_USB); + reg |= (power << PIN_USB); + bus_space_write_4(esc->gpio_bst, esc->gpio_bsh, GPX3DAT, reg); + + /* Input/Output control */ + reg = bus_space_read_4(esc->gpio_bst, esc->gpio_bsh, GPX3CON); + reg &= ~GPIO_CON(PIN_USB, GPIO_MASK); + reg |= GPIO_CON(PIN_USB, dir); + bus_space_write_4(esc->gpio_bst, esc->gpio_bsh, GPX3CON, reg); + + return (0); +} + +static int +phy_init(struct exynos_ehci_softc *esc) +{ + int reg; + + gpio_ctrl(esc, GPIO_INPUT, 1); + + /* set USB HOST mode */ + bus_space_write_4(esc->sysreg_bst, esc->sysreg_bsh, + EXYNOS5_SYSREG_USB2_PHY, USB2_MODE_HOST); + + /* Power ON phy */ + bus_space_write_4(esc->pwr_bst, esc->pwr_bsh, + EXYNOS5_PWR_USBHOST_PHY, PHY_POWER_ON); + + reg = bus_space_read_4(esc->host_bst, esc->host_bsh, 0x0); + reg &= ~(HOST_CTRL_CLK_MASK | + HOST_CTRL_RESET_PHY | + HOST_CTRL_RESET_PHY_ALL | + HOST_CTRL_SIDDQ | + HOST_CTRL_SUSPEND | + HOST_CTRL_SLEEP); + + reg |= (HOST_CTRL_CLK_24MHZ | + HOST_CTRL_RESET_LINK); + bus_space_write_4(esc->host_bst, esc->host_bsh, 0x0, reg); + + DELAY(10); + + reg = bus_space_read_4(esc->host_bst, esc->host_bsh, 0x0); + reg &= ~(HOST_CTRL_RESET_LINK); + bus_space_write_4(esc->host_bst, esc->host_bsh, 0x0, reg); + + gpio_ctrl(esc, GPIO_OUTPUT, 1); + + return (0); +} + +static int +exynos_ehci_attach(device_t dev) +{ + struct exynos_ehci_softc *esc; + ehci_softc_t *sc; + bus_space_handle_t bsh; + int err; + + esc = device_get_softc(dev); + sc = &esc->base; + sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + + if (bus_alloc_resources(dev, exynos_ehci_spec, esc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* EHCI registers */ + sc->sc_io_tag = rman_get_bustag(esc->res[0]); + bsh = rman_get_bushandle(esc->res[0]); + sc->sc_io_size = rman_get_size(esc->res[0]); + + /* EHCI HOST ctrl registers */ + esc->host_bst = rman_get_bustag(esc->res[1]); + esc->host_bsh = rman_get_bushandle(esc->res[1]); + + /* PWR registers */ + esc->pwr_bst = rman_get_bustag(esc->res[2]); + esc->pwr_bsh = rman_get_bushandle(esc->res[2]); + + /* SYSREG */ + esc->sysreg_bst = rman_get_bustag(esc->res[3]); + esc->sysreg_bsh = rman_get_bushandle(esc->res[3]); + + /* GPIO */ + esc->gpio_bst = rman_get_bustag(esc->res[4]); + esc->gpio_bsh = rman_get_bushandle(esc->res[4]); + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(dev), + &ehci_iterate_hw_softc)) + return (ENXIO); + + /* + * Set handle to USB related registers subregion used by + * generic EHCI driver. + */ + err = bus_space_subregion(sc->sc_io_tag, bsh, 0x0, + sc->sc_io_size, &sc->sc_io_hdl); + if (err != 0) + return (ENXIO); + + phy_init(esc); + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, esc->res[5], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)ehci_interrupt, sc, + &sc->sc_intr_hdl); + if (err) { + device_printf(dev, "Could not setup irq, " + "%d\n", err); + return (1); + } + + /* Add USB device */ + sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (!sc->sc_bus.bdev) { + device_printf(dev, "Could not add USB device\n"); + err = bus_teardown_intr(dev, esc->res[5], + sc->sc_intr_hdl); + if (err) + device_printf(dev, "Could not tear down irq," + " %d\n", err); + return (1); + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + + strlcpy(sc->sc_vendor, "Samsung", sizeof(sc->sc_vendor)); + + err = ehci_init(sc); + if (!err) { + sc->sc_flags |= EHCI_SCFLG_DONEINIT; + err = device_probe_and_attach(sc->sc_bus.bdev); + } else { + device_printf(dev, "USB init failed err=%d\n", err); + + device_delete_child(dev, sc->sc_bus.bdev); + sc->sc_bus.bdev = NULL; + + err = bus_teardown_intr(dev, esc->res[5], + sc->sc_intr_hdl); + if (err) + device_printf(dev, "Could not tear down irq," + " %d\n", err); + return (1); + } + return (0); +} + +static int +exynos_ehci_detach(device_t dev) +{ + struct exynos_ehci_softc *esc; + ehci_softc_t *sc; + int err; + + esc = device_get_softc(dev); + sc = &esc->base; + + if (sc->sc_flags & EHCI_SCFLG_DONEINIT) + return (0); + + /* + * only call ehci_detach() after ehci_init() + */ + if (sc->sc_flags & EHCI_SCFLG_DONEINIT) { + ehci_detach(sc); + sc->sc_flags &= ~EHCI_SCFLG_DONEINIT; + } + + /* + * Disable interrupts that might have been switched on in + * ehci_init. + */ + if (sc->sc_io_tag && sc->sc_io_hdl) + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, + EHCI_USBINTR, 0); + + if (esc->res[5] && sc->sc_intr_hdl) { + err = bus_teardown_intr(dev, esc->res[5], + sc->sc_intr_hdl); + if (err) { + device_printf(dev, "Could not tear down irq," + " %d\n", err); + return (err); + } + sc->sc_intr_hdl = NULL; + } + + if (sc->sc_bus.bdev) { + device_delete_child(dev, sc->sc_bus.bdev); + sc->sc_bus.bdev = NULL; + } + + /* During module unload there are lots of children leftover */ + device_delete_children(dev); + + bus_release_resources(dev, exynos_ehci_spec, esc->res); + + return (0); +} Copied and modified: stable/10/sys/arm/samsung/exynos/exynos5_fimd.c (from r263426, head/sys/arm/samsung/exynos/exynos5_fimd.c) ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_fimd.c Thu Mar 20 17:07:14 2014 (r263426, copy source) +++ stable/10/sys/arm/samsung/exynos/exynos5_fimd.c Sat May 17 17:54:38 2014 (r266332) @@ -256,12 +256,10 @@ fimd_init(struct fimd_softc *sc) reg = panel->ivclk | panel->fixvclk; DWRITE4(sc,VIDCON1,reg); - printf("print to VIDCON0\n"); reg = (VIDCON0_ENVID | VIDCON0_ENVID_F); reg |= (panel->clkval_f << CLKVAL_F_OFFSET); WRITE4(sc,VIDCON0,reg); - printf("print to VIDCON0 2nd\n"); reg = (panel->v_pulse_width << VSYNC_PULSE_WIDTH_OFFSET); reg |= (panel->v_front_porch << V_FRONT_PORCH_OFFSET); reg |= (panel->v_back_porch << V_BACK_PORCH_OFFSET); @@ -276,10 +274,6 @@ fimd_init(struct fimd_softc *sc) reg |= ((panel->height - 1) << LINEVAL_OFFSET); DWRITE4(sc,VIDTCON2,reg); - printf("set pbase\n"); - printf("vbase is 0x%08x\n", sc->sc_info.fb_vbase); - printf("pbase is 0x%08x\n", sc->sc_info.fb_pbase); - WRITE4(sc,VIDW00ADD0B0, sc->sc_info.fb_pbase); WRITE4(sc,VIDW00ADD1B0, sc->sc_info.fb_pbase + sc->sc_info.fb_size); WRITE4(sc,VIDW00ADD2, panel->width * 2); Copied: stable/10/sys/arm/samsung/exynos/exynos5_mct.c (from r263431, head/sys/arm/samsung/exynos/exynos5_mct.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/samsung/exynos/exynos5_mct.c Sat May 17 17:54:38 2014 (r266332, copy of r263431, head/sys/arm/samsung/exynos/exynos5_mct.c) @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 2013 Ruslan Bukin + * 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. + */ + +/* + * This module just enables Exynos MCT, so ARMv7 Generic Timer will works + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#define MCT_CTRL_START (1 << 8) +#define MCT_CTRL (0x240) +#define MCT_WRITE_STAT (0x24C) + +struct arm_tmr_softc { + struct resource *tmr_res[1]; + bus_space_tag_t bst; + bus_space_handle_t bsh; +}; + +static struct resource_spec arm_tmr_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Timer registers */ + { -1, 0 } +}; + +static int +arm_tmr_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "exynos,mct")) + return (ENXIO); + + device_set_desc(dev, "Exynos MPCore Timer"); + return (BUS_PROBE_DEFAULT); +} + +static int +arm_tmr_attach(device_t dev) +{ + struct arm_tmr_softc *sc; + int reg, i; + int mask; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, arm_tmr_spec, sc->tmr_res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Timer interface */ + sc->bst = rman_get_bustag(sc->tmr_res[0]); + sc->bsh = rman_get_bushandle(sc->tmr_res[0]); + + reg = bus_space_read_4(sc->bst, sc->bsh, MCT_CTRL); + reg |= MCT_CTRL_START; + bus_space_write_4(sc->bst, sc->bsh, MCT_CTRL, reg); + + mask = (1 << 16); + + /* Wait 10 times until written value is applied */ + for (i = 0; i < 10; i++) { + reg = bus_space_read_4(sc->bst, sc->bsh, MCT_WRITE_STAT); + if (reg & mask) { + bus_space_write_4(sc->bst, sc->bsh, + MCT_WRITE_STAT, mask); + return (0); + } + cpufunc_nullop(); + } + + /* NOTREACHED */ + + panic("Can't enable timer\n"); +} + +static device_method_t arm_tmr_methods[] = { + DEVMETHOD(device_probe, arm_tmr_probe), + DEVMETHOD(device_attach, arm_tmr_attach), + { 0, 0 } +}; + +static driver_t arm_tmr_driver = { + "mct", + arm_tmr_methods, + sizeof(struct arm_tmr_softc), +}; + +static devclass_t arm_tmr_devclass; + +DRIVER_MODULE(mct, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); Modified: stable/10/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- stable/10/sys/arm/samsung/exynos/files.exynos5 Sat May 17 17:34:37 2014 (r266331) +++ stable/10/sys/arm/samsung/exynos/files.exynos5 Sat May 17 17:54:38 2014 (r266332) @@ -13,11 +13,12 @@ arm/arm/bus_space-v6.c standard arm/arm/gic.c standard arm/arm/generic_timer.c standard -arm/samsung/exynos/arch_timer.c standard +arm/samsung/exynos/exynos5_mct.c standard arm/samsung/exynos/exynos5_mp.c optional smp arm/samsung/exynos/exynos5_common.c standard arm/samsung/exynos/exynos5_machdep.c standard arm/samsung/exynos/uart.c optional uart -arm/samsung/exynos/ehci_exynos5.c optional ehci +arm/samsung/exynos/exynos5_ehci.c optional ehci +arm/samsung/exynos/exynos5_fimd.c optional vt #dev/sdhci/sdhci_fdt.c optional sdhci Copied: stable/10/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts (from r263427, head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts Sat May 17 17:54:38 2014 (r266332, copy of r263427, head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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$ + */ + +/dts-v1/; + +/include/ "exynos5250.dtsi" + +/ { + model = "Samsung Chromebook"; + + memory { + device_type = "memory"; + reg = < 0x40000000 0x80000000 >; /* 2G */ + }; + + SOC: Exynos5@0 { + + fimd0: fimd@14400000 { + status = "okay"; + + panel-size = < 1366 768 >; + panel-hsync = < 80 32 48 >; + panel-vsync = < 14 5 3 >; + panel-clk-div = < 17 >; + panel-backlight-pin = < 25 >; + }; + + }; + + chosen { + stdin = &serial2; + stdout = &serial2; + }; +}; Modified: stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi Sat May 17 17:34:37 2014 (r266331) +++ stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi Sat May 17 17:54:38 2014 (r266332) @@ -32,7 +32,16 @@ #size-cells = <1>; interrupt-parent = <&GIC>; - Exynos5@0 { + aliases { + soc = &SOC; + serial0 = &serial0; + serial1 = &serial1; + clk0 = &clk0; + dp0 = &dp0; + fimd0 = &fimd0; + }; + + SOC: Exynos5@0 { #address-cells = <1>; #size-cells = <1>; compatible = "simple-bus"; @@ -48,6 +57,11 @@ #interrupt-cells = <1>; }; + clk0: clk@10010000 { + compatible = "exynos,clk"; + reg = < 0x10020000 0x20000 >; + }; + mct { compatible = "exynos,mct"; reg = < 0x101C0000 0x1000 >; @@ -72,8 +86,8 @@ reg = <0x12110000 0x1000>, /* EHCI */ <0x12130000 0x1000>, /* EHCI host ctrl */ <0x10040000 0x1000>, /* Power */ - <0x10050000 0x1000>, /* Sysreg */ - <0x11400000 0x1000>; /* GPIO left */ + <0x10050230 0x10>, /* Sysreg */ + <0x11400C60 0x10>; /* GPIO left */ interrupts = < 103 >; interrupt-parent = <&GIC>; }; @@ -153,5 +167,21 @@ current-speed = <115200>; }; + fimd0: fimd@14400000 { + compatible = "exynos,fimd"; + status = "disabled"; + reg = < 0x14400000 0x10000 >, /* fimd */ + < 0x14420000 0x10000 >, /* disp */ + < 0x10050000 0x220 >; /* sysreg */ + interrupt-parent = <&GIC>; + }; + + dp0: dp@145B0000 { + compatible = "exynos,dp"; + status = "disabled"; + reg = < 0x145B0000 0x10000 >, + < 0x10040720 0x10 >; /* PHY */ + interrupt-parent = <&GIC>; + }; }; }; From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 18:53:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C70F2B7E; Sat, 17 May 2014 18:53: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 B00B32D81; Sat, 17 May 2014 18:53: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 s4HIriT3014146; Sat, 17 May 2014 18:53:44 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HIrbG7014102; Sat, 17 May 2014 18:53:37 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171853.s4HIrbG7014102@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 18:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266337 - in stable/10: contrib/llvm/patches lib/libc/arm/gen sys/arm/allwinner sys/arm/allwinner/a20 sys/arm/conf sys/arm/include sys/arm/rockchip sys/boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 18:53:44 -0000 Author: ian Date: Sat May 17 18:53:36 2014 New Revision: 266337 URL: http://svnweb.freebsd.org/changeset/base/266337 Log: MFC 263631, 263637, 263664, 263676, 263679, 263698, 263711, Implement __flt_rounds for ARMv6 hard-float. The fpscr register stores the current rounding mode used by the VFP unit. Simplify how we build MACHINE_ARCH. There are 3 options that may be set however only arm, armeb, armv6, and soon armv6hf will be used. Add the llvm/clang patch for r263619. Reorder the pmap macros so "ARM_MMU_V6 + ARM_MMU_V7" is first. As they are identical this allows us to build for both v6 and v7 together. Add code for enabling second CPU core for A20 SoC. Enable SMP on Cubieboard2. Switch to freebsd.org emal address in copyright. Added: stable/10/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff - copied unchanged from r263664, head/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff stable/10/sys/arm/allwinner/a20/a20_mp.c - copied unchanged from r263698, head/sys/arm/allwinner/a20/a20_mp.c Modified: stable/10/lib/libc/arm/gen/flt_rounds.c stable/10/sys/arm/allwinner/a10_clk.c stable/10/sys/arm/allwinner/a10_clk.h stable/10/sys/arm/allwinner/a10_common.c stable/10/sys/arm/allwinner/a10_ehci.c stable/10/sys/arm/allwinner/a10_gpio.c stable/10/sys/arm/allwinner/a10_gpio.h stable/10/sys/arm/allwinner/a10_machdep.c stable/10/sys/arm/allwinner/a10_sramc.c stable/10/sys/arm/allwinner/a10_sramc.h stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.h stable/10/sys/arm/allwinner/a20/files.a20 stable/10/sys/arm/allwinner/aintc.c stable/10/sys/arm/allwinner/console.c stable/10/sys/arm/allwinner/if_emac.c stable/10/sys/arm/allwinner/if_emacreg.h stable/10/sys/arm/allwinner/timer.c stable/10/sys/arm/conf/CUBIEBOARD2 stable/10/sys/arm/include/param.h stable/10/sys/arm/include/pmap.h stable/10/sys/arm/rockchip/rk30xx_common.c stable/10/sys/arm/rockchip/rk30xx_gpio.c stable/10/sys/arm/rockchip/rk30xx_grf.c stable/10/sys/arm/rockchip/rk30xx_grf.h stable/10/sys/arm/rockchip/rk30xx_machdep.c stable/10/sys/arm/rockchip/rk30xx_pmu.c stable/10/sys/arm/rockchip/rk30xx_pmu.h stable/10/sys/arm/rockchip/rk30xx_wdog.c stable/10/sys/arm/rockchip/rk30xx_wdog.h stable/10/sys/boot/fdt/dts/arm/cubieboard.dts stable/10/sys/boot/fdt/dts/arm/cubieboard2.dts stable/10/sys/boot/fdt/dts/arm/rk3188-radxa.dts stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff (from r263664, head/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff Sat May 17 18:53:36 2014 (r266337, copy of r263664, head/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff) @@ -0,0 +1,81 @@ +Index: tools/clang/lib/Driver/ToolChains.cpp +=================================================================== +--- tools/clang/lib/Driver/ToolChains.cpp ++++ tools/clang/lib/Driver/ToolChains.cpp +@@ -2034,6 +2034,7 @@ + bool FreeBSD::UseSjLjExceptions() const { + // FreeBSD uses SjLj exceptions on ARM oabi. + switch (getTriple().getEnvironment()) { ++ case llvm::Triple::GNUEABIHF: + case llvm::Triple::GNUEABI: + case llvm::Triple::EABI: + return false; +Index: tools/clang/lib/Driver/Tools.cpp +=================================================================== +--- tools/clang/lib/Driver/Tools.cpp ++++ tools/clang/lib/Driver/Tools.cpp +@@ -737,8 +737,15 @@ + } + + case llvm::Triple::FreeBSD: +- // FreeBSD defaults to soft float +- FloatABI = "soft"; ++ switch(Triple.getEnvironment()) { ++ case llvm::Triple::GNUEABIHF: ++ FloatABI = "hard"; ++ break; ++ default: ++ // FreeBSD defaults to soft float ++ FloatABI = "soft"; ++ break; ++ } + break; + + default: +@@ -5776,8 +5783,18 @@ + } + } else if (getToolChain().getArch() == llvm::Triple::arm || + getToolChain().getArch() == llvm::Triple::thumb) { +- CmdArgs.push_back("-mfpu=softvfp"); ++ const Driver &D = getToolChain().getDriver(); ++ llvm::Triple Triple = getToolChain().getTriple(); ++ StringRef FloatABI = getARMFloatABI(D, Args, Triple); ++ ++ if (FloatABI == "hard") { ++ CmdArgs.push_back("-mfpu=vfp"); ++ } else { ++ CmdArgs.push_back("-mfpu=softvfp"); ++ } ++ + switch(getToolChain().getTriple().getEnvironment()) { ++ case llvm::Triple::GNUEABIHF: + case llvm::Triple::GNUEABI: + case llvm::Triple::EABI: + CmdArgs.push_back("-meabi=5"); +Index: tools/clang/test/Driver/freebsd.c +=================================================================== +--- tools/clang/test/Driver/freebsd.c ++++ tools/clang/test/Driver/freebsd.c +@@ -101,13 +101,22 @@ + // RUN: | FileCheck --check-prefix=CHECK-ARM %s + // CHECK-ARM: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions" + // CHECK-ARM: as{{.*}}" "-mfpu=softvfp"{{.*}}"-matpcs" ++// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp" + + // RUN: %clang %s -### -target arm-gnueabi-freebsd10.0 2>&1 \ + // RUN: | FileCheck --check-prefix=CHECK-ARM-EABI %s + // CHECK-ARM-EABI-NOT: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions" + // CHECK-ARM-EABI: as{{.*}}" "-mfpu=softvfp" "-meabi=5" ++// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp" + // CHECK-ARM-EABI-NOT: as{{.*}}" "-matpcs" + ++// RUN: %clang %s -### -o %t.o -target arm-gnueabihf-freebsd10.0 -no-integrated-as 2>&1 \ ++// RUN: | FileCheck --check-prefix=CHECK-ARM-EABIHF %s ++// CHECK-ARM-EABIHF-NOT: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions" ++// CHECK-ARM-EABIHF: as{{.*}}" "-mfpu=vfp" "-meabi=5" ++// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-mfpu=softvfp" ++// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-matpcs" ++ + // RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto -o %t.o 2>&1 \ + // RUN: | FileCheck --check-prefix=CHECK-LTO %s + // CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so Modified: stable/10/lib/libc/arm/gen/flt_rounds.c ============================================================================== --- stable/10/lib/libc/arm/gen/flt_rounds.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/lib/libc/arm/gen/flt_rounds.c Sat May 17 18:53:36 2014 (r266337) @@ -30,20 +30,32 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef __ARM_PCS_VFP #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" +#endif int __flt_rounds(void) { + int mode; -#ifndef ARM_HARD_FLOAT +#ifndef __ARM_PCS_VFP /* * Translate our rounding modes to the unnamed * manifest constants required by C99 et. al. */ - switch (__softfloat_float_rounding_mode) { + mode = __softfloat_float_rounding_mode; +#else /* __ARM_PCS_VFP */ + /* + * Read the floating-point status and control register + */ + __asm __volatile("vmrs %0, fpscr" : "=&r"(mode)); + mode &= _ROUND_MASK; +#endif /* __ARM_PCS_VFP */ + + switch (mode) { case FE_TOWARDZERO: return (0); case FE_TONEAREST: @@ -54,12 +66,4 @@ __flt_rounds(void) return (3); } return (-1); -#else /* ARM_HARD_FLOAT */ - /* - * Apparently, the rounding mode is specified as part of the - * instruction format on ARM, so the dynamic rounding mode is - * indeterminate. Some FPUs may differ. - */ - return (-1); -#endif /* ARM_HARD_FLOAT */ } Modified: stable/10/sys/arm/allwinner/a10_clk.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_clk.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a10_clk.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/a10_clk.h ============================================================================== --- stable/10/sys/arm/allwinner/a10_clk.h Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a10_clk.h Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/a10_common.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_common.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a10_common.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/a10_ehci.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_ehci.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a10_ehci.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/a10_gpio.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_gpio.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a10_gpio.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * Copyright (c) 2012 Oleksandr Tymoshenko * Copyright (c) 2012 Luiz Otavio O Souza. * All rights reserved. Modified: stable/10/sys/arm/allwinner/a10_gpio.h ============================================================================== --- stable/10/sys/arm/allwinner/a10_gpio.h Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a10_gpio.h Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/a10_machdep.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_machdep.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a10_machdep.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * This code is derived from software written for Brini by Mark Brinicombe Modified: stable/10/sys/arm/allwinner/a10_sramc.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_sramc.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a10_sramc.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/a10_sramc.h ============================================================================== --- stable/10/sys/arm/allwinner/a10_sramc.h Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a10_sramc.h Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c ============================================================================== --- stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.h ============================================================================== --- stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.h Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.h Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Copied: stable/10/sys/arm/allwinner/a20/a20_mp.c (from r263698, head/sys/arm/allwinner/a20/a20_mp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/allwinner/a20/a20_mp.c Sat May 17 18:53:36 2014 (r266337, copy of r263698, head/sys/arm/allwinner/a20/a20_mp.c) @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define CPUCFG_BASE 0x01c25c00 +#define CPUCFG_SIZE 0x400 + +#define CPU0_RST_CTL 0x40 +#define CPU0_CTL 0x44 +#define CPU0_STATUS 0x48 +#define CPU1_RST_CTL 0x80 +#define CPU1_CTL 0x84 +#define CPU1_STATUS 0x88 +#define CPUCFG_GENCTL 0x184 +#define CPUCFG_P_REG0 0x1a4 +#define CPU1_PWR_CLAMP 0x1b0 +#define CPU1_PWROFF_REG 0x1b4 +#define CPUCFG_DBGCTL0 0x1e0 +#define CPUCFG_DBGCTL1 0x1e4 + +void +platform_mp_init_secondary(void) +{ + + gic_init_secondary(); +} + +void +platform_mp_setmaxid(void) +{ + int ncpu; + + if (mp_ncpus != 0) + return; + + /* Read current CP15 Cache Size ID Register */ + __asm __volatile("mrc p15, 1, %0, c9, c0, 2" : "=r" (ncpu)); + ncpu = ((ncpu >> 24) & 0x3) + 1; + + mp_ncpus = ncpu; + mp_maxid = ncpu - 1; +} + +int +platform_mp_probe(void) +{ + + if (mp_ncpus == 0) + platform_mp_setmaxid(); + + return (mp_ncpus > 1); +} + +void +platform_mp_start_ap(void) +{ + bus_space_handle_t cpucfg; + + uint32_t val; + + if (bus_space_map(fdtbus_bs_tag, CPUCFG_BASE, CPUCFG_SIZE, 0, + &cpucfg) != 0) + panic("Couldn't map the CPUCFG\n"); + + cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); + + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPUCFG_P_REG0, + pmap_kextract((vm_offset_t)mpentry)); + + /* + * Assert nCOREPORESET low and set L1RSTDISABLE low. + * Ensure DBGPWRDUP is set to LOW to prevent any external + * debug access to the processor. + */ + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_RST_CTL, 0); + + /* Set L1RSTDISABLE low */ + val = bus_space_read_4(fdtbus_bs_tag, cpucfg, CPUCFG_GENCTL); + val &= ~(1 << 1); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPUCFG_GENCTL, val); + + /* Set DBGPWRDUP low */ + val = bus_space_read_4(fdtbus_bs_tag, cpucfg, CPUCFG_DBGCTL1); + val &= ~(1 << 1); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPUCFG_DBGCTL1, val); + + /* Release power clamp */ + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0xff); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x7f); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x3f); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x1f); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x0f); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x07); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x03); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x01); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x00); + DELAY(10000); + + /* Clear power-off gating */ + val = bus_space_read_4(fdtbus_bs_tag, cpucfg, CPU1_PWROFF_REG); + val &= ~(1 << 0); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWROFF_REG, val); + DELAY(1000); + + /* De-assert cpu core reset */ + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_RST_CTL, 3); + + /* Assert DBGPWRDUP signal */ + val = bus_space_read_4(fdtbus_bs_tag, cpucfg, CPUCFG_DBGCTL1); + val |= (1 << 1); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPUCFG_DBGCTL1, val); + + armv7_sev(); + bus_space_unmap(fdtbus_bs_tag, cpucfg, CPUCFG_SIZE); +} + +void +platform_ipi_send(cpuset_t cpus, u_int ipi) +{ + + pic_ipi_send(cpus, ipi); +} Modified: stable/10/sys/arm/allwinner/a20/files.a20 ============================================================================== --- stable/10/sys/arm/allwinner/a20/files.a20 Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/a20/files.a20 Sat May 17 18:53:36 2014 (r266337) @@ -20,3 +20,4 @@ arm/allwinner/timer.c standard arm/allwinner/bus_space.c standard arm/allwinner/a10_common.c standard arm/allwinner/a10_machdep.c standard +arm/allwinner/a20/a20_mp.c optional smp Modified: stable/10/sys/arm/allwinner/aintc.c ============================================================================== --- stable/10/sys/arm/allwinner/aintc.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/aintc.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/console.c ============================================================================== --- stable/10/sys/arm/allwinner/console.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/console.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/if_emac.c ============================================================================== --- stable/10/sys/arm/allwinner/if_emac.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/if_emac.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/if_emacreg.h ============================================================================== --- stable/10/sys/arm/allwinner/if_emacreg.h Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/if_emacreg.h Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Ganbold Tsagaankhuu + * Copyright (C) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/allwinner/timer.c ============================================================================== --- stable/10/sys/arm/allwinner/timer.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/allwinner/timer.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- stable/10/sys/arm/conf/CUBIEBOARD2 Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/conf/CUBIEBOARD2 Sat May 17 18:53:36 2014 (r266337) @@ -138,3 +138,4 @@ options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=cubieboard2.dts +options SMP # Enable multiple cores Modified: stable/10/sys/arm/include/param.h ============================================================================== --- stable/10/sys/arm/include/param.h Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/include/param.h Sat May 17 18:53:36 2014 (r266337) @@ -52,23 +52,29 @@ #define __PCI_REROUTE_INTERRUPT -#ifndef MACHINE -#define MACHINE "arm" -#endif -#ifndef MACHINE_ARCH #if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) -#ifdef __ARMEB__ -#define MACHINE_ARCH "armv6eb" +#define _V6_SUFFIX "v6" #else -#define MACHINE_ARCH "armv6" +#define _V6_SUFFIX "" #endif + +#ifdef __ARM_PCS_VFP +#define _HF_SUFFIX "hf" #else +#define _HF_SUFFIX "" +#endif + #ifdef __ARMEB__ -#define MACHINE_ARCH "armeb" +#define _EB_SUFFIX "eb" #else -#define MACHINE_ARCH "arm" +#define _EB_SUFFIX "" #endif + +#ifndef MACHINE +#define MACHINE "arm" #endif +#ifndef MACHINE_ARCH +#define MACHINE_ARCH "arm" _V6_SUFFIX _HF_SUFFIX _EB_SUFFIX #endif #if defined(SMP) || defined(KLD_MODULE) Modified: stable/10/sys/arm/include/pmap.h ============================================================================== --- stable/10/sys/arm/include/pmap.h Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/include/pmap.h Sat May 17 18:53:36 2014 (r266337) @@ -341,47 +341,7 @@ extern int pmap_needs_pte_sync; #define L2_AP(x) (L2_AP0(x) | L2_AP1(x) | L2_AP2(x) | L2_AP3(x)) #endif -#if ARM_NMMUS > 1 -/* More than one MMU class configured; use variables. */ -#define L2_S_PROT_U pte_l2_s_prot_u -#define L2_S_PROT_W pte_l2_s_prot_w -#define L2_S_PROT_MASK pte_l2_s_prot_mask - -#define L1_S_CACHE_MASK pte_l1_s_cache_mask -#define L2_L_CACHE_MASK pte_l2_l_cache_mask -#define L2_S_CACHE_MASK pte_l2_s_cache_mask - -#define L1_S_PROTO pte_l1_s_proto -#define L1_C_PROTO pte_l1_c_proto -#define L2_S_PROTO pte_l2_s_proto - -#elif ARM_MMU_GENERIC != 0 -#define L2_S_PROT_U L2_S_PROT_U_generic -#define L2_S_PROT_W L2_S_PROT_W_generic -#define L2_S_PROT_MASK L2_S_PROT_MASK_generic - -#define L1_S_CACHE_MASK L1_S_CACHE_MASK_generic -#define L2_L_CACHE_MASK L2_L_CACHE_MASK_generic -#define L2_S_CACHE_MASK L2_S_CACHE_MASK_generic - -#define L1_S_PROTO L1_S_PROTO_generic -#define L1_C_PROTO L1_C_PROTO_generic -#define L2_S_PROTO L2_S_PROTO_generic - -#elif ARM_MMU_XSCALE == 1 -#define L2_S_PROT_U L2_S_PROT_U_xscale -#define L2_S_PROT_W L2_S_PROT_W_xscale -#define L2_S_PROT_MASK L2_S_PROT_MASK_xscale - -#define L1_S_CACHE_MASK L1_S_CACHE_MASK_xscale -#define L2_L_CACHE_MASK L2_L_CACHE_MASK_xscale -#define L2_S_CACHE_MASK L2_S_CACHE_MASK_xscale - -#define L1_S_PROTO L1_S_PROTO_xscale -#define L1_C_PROTO L1_C_PROTO_xscale -#define L2_S_PROTO L2_S_PROTO_xscale - -#elif (ARM_MMU_V6 + ARM_MMU_V7) != 0 +#if (ARM_MMU_V6 + ARM_MMU_V7) != 0 /* * AP[2:1] access permissions model: * @@ -486,6 +446,47 @@ extern int pmap_needs_pte_sync; #define ARM_L2S_NRML_IWB_OWB (L2_C|L2_B|L2_SHARED) #define ARM_L2S_NRML_IWBA_OWBA (L2_S_TEX(1)|L2_C|L2_B|L2_SHARED) #endif /* SMP */ + +#elif ARM_NMMUS > 1 +/* More than one MMU class configured; use variables. */ +#define L2_S_PROT_U pte_l2_s_prot_u +#define L2_S_PROT_W pte_l2_s_prot_w +#define L2_S_PROT_MASK pte_l2_s_prot_mask + +#define L1_S_CACHE_MASK pte_l1_s_cache_mask +#define L2_L_CACHE_MASK pte_l2_l_cache_mask +#define L2_S_CACHE_MASK pte_l2_s_cache_mask + +#define L1_S_PROTO pte_l1_s_proto +#define L1_C_PROTO pte_l1_c_proto +#define L2_S_PROTO pte_l2_s_proto + +#elif ARM_MMU_GENERIC != 0 +#define L2_S_PROT_U L2_S_PROT_U_generic +#define L2_S_PROT_W L2_S_PROT_W_generic +#define L2_S_PROT_MASK L2_S_PROT_MASK_generic + +#define L1_S_CACHE_MASK L1_S_CACHE_MASK_generic +#define L2_L_CACHE_MASK L2_L_CACHE_MASK_generic +#define L2_S_CACHE_MASK L2_S_CACHE_MASK_generic + +#define L1_S_PROTO L1_S_PROTO_generic +#define L1_C_PROTO L1_C_PROTO_generic +#define L2_S_PROTO L2_S_PROTO_generic + +#elif ARM_MMU_XSCALE == 1 +#define L2_S_PROT_U L2_S_PROT_U_xscale +#define L2_S_PROT_W L2_S_PROT_W_xscale +#define L2_S_PROT_MASK L2_S_PROT_MASK_xscale + +#define L1_S_CACHE_MASK L1_S_CACHE_MASK_xscale +#define L2_L_CACHE_MASK L2_L_CACHE_MASK_xscale +#define L2_S_CACHE_MASK L2_S_CACHE_MASK_xscale + +#define L1_S_PROTO L1_S_PROTO_xscale +#define L1_C_PROTO L1_C_PROTO_xscale +#define L2_S_PROTO L2_S_PROTO_xscale + #endif /* ARM_NMMUS > 1 */ #if defined(CPU_XSCALE_81342) || ARM_ARCH_6 || ARM_ARCH_7A Modified: stable/10/sys/arm/rockchip/rk30xx_common.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_common.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/rockchip/rk30xx_common.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_gpio.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/rockchip/rk30xx_gpio.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * Copyright (c) 2012 Oleksandr Tymoshenko * Copyright (c) 2012 Luiz Otavio O Souza. * All rights reserved. Modified: stable/10/sys/arm/rockchip/rk30xx_grf.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_grf.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/rockchip/rk30xx_grf.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/rockchip/rk30xx_grf.h ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_grf.h Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/rockchip/rk30xx_grf.h Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_machdep.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/rockchip/rk30xx_machdep.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * This code is derived from software written for Brini by Mark Brinicombe Modified: stable/10/sys/arm/rockchip/rk30xx_pmu.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_pmu.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/rockchip/rk30xx_pmu.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/rockchip/rk30xx_pmu.h ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_pmu.h Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/rockchip/rk30xx_pmu.h Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/rockchip/rk30xx_wdog.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_wdog.c Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/rockchip/rk30xx_wdog.c Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/arm/rockchip/rk30xx_wdog.h ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_wdog.h Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/arm/rockchip/rk30xx_wdog.h Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/boot/fdt/dts/arm/cubieboard.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/cubieboard.dts Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/boot/fdt/dts/arm/cubieboard.dts Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/boot/fdt/dts/arm/cubieboard2.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/cubieboard2.dts Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/boot/fdt/dts/arm/cubieboard2.dts Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/boot/fdt/dts/arm/rk3188-radxa.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/rk3188-radxa.dts Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/boot/fdt/dts/arm/rk3188-radxa.dts Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi Sat May 17 18:52:20 2014 (r266336) +++ stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi Sat May 17 18:53:36 2014 (r266337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 19:06:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7D21EEC0; Sat, 17 May 2014 19:06: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 6659D2E76; Sat, 17 May 2014 19:06: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 s4HJ6mmB020883; Sat, 17 May 2014 19:06:48 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HJ6kxE020872; Sat, 17 May 2014 19:06:46 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405171906.s4HJ6kxE020872@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 17 May 2014 19:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266338 - in stable/10: share/man/man4/man4.arm sys/arm/conf sys/arm/ti sys/arm/ti/am335x sys/boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 19:06:48 -0000 Author: loos Date: Sat May 17 19:06:46 2014 New Revision: 266338 URL: http://svnweb.freebsd.org/changeset/base/266338 Log: Adds the ADC driver for TI AM3xxx SoC family. The ADC has a 12bit resolution and its raw output can be read via sysctl(8) interface. The driver allows the setup of ADC clock, samples average and open delay (the number of clock cycles to wait before start the conversion). The TSC_ADC module is set in the general purpose mode (no touchscreen support). Tested on Beaglebone-black. Written based on AM335x TRM. Added: stable/10/share/man/man4/man4.arm/ti_adc.4 - copied unchanged from r263693, head/share/man/man4/man4.arm/ti_adc.4 stable/10/sys/arm/ti/ti_adc.c - copied unchanged from r263693, head/sys/arm/ti/ti_adc.c stable/10/sys/arm/ti/ti_adcreg.h - copied unchanged from r263693, head/sys/arm/ti/ti_adcreg.h stable/10/sys/arm/ti/ti_adcvar.h - copied unchanged from r263693, head/sys/arm/ti/ti_adcvar.h Modified: stable/10/share/man/man4/man4.arm/Makefile stable/10/sys/arm/conf/BEAGLEBONE stable/10/sys/arm/ti/am335x/am335x_prcm.c stable/10/sys/arm/ti/files.ti stable/10/sys/arm/ti/ti_prcm.h stable/10/sys/boot/fdt/dts/arm/am335x.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/man4.arm/Makefile ============================================================================== --- stable/10/share/man/man4/man4.arm/Makefile Sat May 17 18:53:36 2014 (r266337) +++ stable/10/share/man/man4/man4.arm/Makefile Sat May 17 19:06:46 2014 (r266338) @@ -1,6 +1,9 @@ # $FreeBSD$ -MAN= mge.4 npe.4 devcfg.4 +MAN= devcfg.4 \ + mge.4 \ + npe.4 \ + ti_adc.4 MLINKS= mge.4 if_mge.4 MLINKS+=npe.4 if_npe.4 Copied: stable/10/share/man/man4/man4.arm/ti_adc.4 (from r263693, head/share/man/man4/man4.arm/ti_adc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/man4.arm/ti_adc.4 Sat May 17 19:06:46 2014 (r266338, copy of r263693, head/share/man/man4/man4.arm/ti_adc.4) @@ -0,0 +1,119 @@ +.\" +.\" Copyright (c) 2014 Luiz Otavio O Souza +.\" 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 ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 21, 2014 +.Dt TI_ADC 4 +.Os +.Sh NAME +.Nm ti_adc +.Nd TI AM3XXX analog to digital converter driver +.Sh SYNOPSIS +.Cd "device ti_adc" +.Sh DESCRIPTION +The +.Nm +driver provides access to the AIN (analog inputs) on am3xxx SoCs. +.Pp +It provides raw readings of the converted values for each analog inputs. +.Pp +The access to +.Nm +data is made via the +.Xr sysctl 8 +interface: +.Bd -literal +dev.ti_adc.0.%desc: TI ADC controller +dev.ti_adc.0.%driver: ti_adc +dev.ti_adc.0.%pnpinfo: name=adc@44E0D000 compat=ti,adc +dev.ti_adc.0.%parent: simplebus0 +dev.ti_adc.0.clockdiv: 2400 +dev.ti_adc.0.ain.0.enable: 0 +dev.ti_adc.0.ain.0.open_delay: 0 +dev.ti_adc.0.ain.0.samples_avg: 0 +dev.ti_adc.0.ain.0.input: 0 +dev.ti_adc.0.ain.1.enable: 0 +dev.ti_adc.0.ain.1.open_delay: 0 +dev.ti_adc.0.ain.1.samples_avg: 0 +dev.ti_adc.0.ain.1.input: 0 +dev.ti_adc.0.ain.2.enable: 0 +dev.ti_adc.0.ain.2.open_delay: 0 +dev.ti_adc.0.ain.2.samples_avg: 0 +dev.ti_adc.0.ain.2.input: 0 +dev.ti_adc.0.ain.3.enable: 0 +dev.ti_adc.0.ain.3.open_delay: 0 +dev.ti_adc.0.ain.3.samples_avg: 0 +dev.ti_adc.0.ain.3.input: 0 +dev.ti_adc.0.ain.4.enable: 0 +dev.ti_adc.0.ain.4.open_delay: 0 +dev.ti_adc.0.ain.4.samples_avg: 0 +dev.ti_adc.0.ain.4.input: 0 +dev.ti_adc.0.ain.5.enable: 0 +dev.ti_adc.0.ain.5.open_delay: 0 +dev.ti_adc.0.ain.5.samples_avg: 0 +dev.ti_adc.0.ain.5.input: 0 +dev.ti_adc.0.ain.6.enable: 1 +dev.ti_adc.0.ain.6.open_delay: 0 +dev.ti_adc.0.ain.6.samples_avg: 4 +dev.ti_adc.0.ain.6.input: 2308 +.Ed +.Pp +Global settings: +.Bl -tag -width ".Va dev.ti_adc.0.clockdiv" +.It Va dev.ti_adc.0.clockdiv +Sets the ADC clock prescaler. +The minimum value is 10 and the maximum is 65535. +The ADC clock is based on CLK_M_OSC (24Mhz) / clockdiv. +This gives a maximum of ~2.4Mhz for the ADC clock and ~10Khz for the default +setting (clockdiv = 2400). +.El +.Pp +Settings per input: +.Bl -tag -width ".Va dev.ti_adc.0.ain.%d.samples_avg" +.It Va dev.ti_adc.0.ain.%d.enable +Enable the conversion for the input. +Each input should be individually enabled before it can be used. +When all the inputs are disabled, the ADC is turned off. +.It Va dev.ti_adc.0.ain.%d.open_delay +Sets the number of ADC clock cycles to wait after applying the input +configuration and before start the ADC conversion. +.It Va dev.ti_adc.0.ain.%d.samples_avg +Sets the number of samples average used on each input, it can be set to 0 +(no samples average), 2, 4, 8, or 16. +.It Va dev.ti_adc.0.ain.%d.input +Is the converted raw value of the voltage applied on the analog input. +It is made of a 12 bit value (0 ~ 4095). +.El +.Sh SEE ALSO +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +.An -nosplit +The driver and this manual page was written by +.An Luiz Otavio O Souza Aq loos@FreeBSD.org Modified: stable/10/sys/arm/conf/BEAGLEBONE ============================================================================== --- stable/10/sys/arm/conf/BEAGLEBONE Sat May 17 18:53:36 2014 (r266337) +++ stable/10/sys/arm/conf/BEAGLEBONE Sat May 17 19:06:46 2014 (r266338) @@ -105,6 +105,9 @@ device am335x_pmic # AM335x Power Mana device gpio device gpioled +# ADC support +device ti_adc + # USB support device usb options USB_HOST_ALIGN=64 # Cacheline size is 64 on AM335x. Modified: stable/10/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_prcm.c Sat May 17 18:53:36 2014 (r266337) +++ stable/10/sys/arm/ti/am335x/am335x_prcm.c Sat May 17 19:06:46 2014 (r266338) @@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$"); #define CM_WKUP_CM_CLKDCOLDO_DPLL_PER (CM_WKUP + 0x07C) #define CM_WKUP_CM_CLKMODE_DPLL_DISP (CM_WKUP + 0x098) #define CM_WKUP_I2C0_CLKCTRL (CM_WKUP + 0x0B8) +#define CM_WKUP_ADC_TSC_CLKCTRL (CM_WKUP + 0x0BC) #define CM_DPLL 0x500 #define CLKSEL_TIMER7_CLK (CM_DPLL + 0x004) @@ -260,6 +261,9 @@ struct ti_clock_dev ti_clk_devmap[] = { AM335X_GENERIC_CLOCK_DEV(I2C1_CLK), AM335X_GENERIC_CLOCK_DEV(I2C2_CLK), + /* TSC_ADC */ + AM335X_GENERIC_CLOCK_DEV(TSC_ADC_CLK), + /* EDMA */ AM335X_GENERIC_CLOCK_DEV(EDMA_TPCC_CLK), AM335X_GENERIC_CLOCK_DEV(EDMA_TPTC0_CLK), @@ -337,6 +341,9 @@ static struct am335x_clk_details g_am335 _CLK_DETAIL(I2C1_CLK, CM_PER_I2C1_CLKCTRL, 0), _CLK_DETAIL(I2C2_CLK, CM_PER_I2C2_CLKCTRL, 0), + /* TSC_ADC module */ + _CLK_DETAIL(TSC_ADC_CLK, CM_WKUP_ADC_TSC_CLKCTRL, 0), + /* EDMA modules */ _CLK_DETAIL(EDMA_TPCC_CLK, CM_PER_TPCC_CLKCTRL, 0), _CLK_DETAIL(EDMA_TPTC0_CLK, CM_PER_TPTC0_CLKCTRL, 0), Modified: stable/10/sys/arm/ti/files.ti ============================================================================== --- stable/10/sys/arm/ti/files.ti Sat May 17 18:53:36 2014 (r266337) +++ stable/10/sys/arm/ti/files.ti Sat May 17 19:06:46 2014 (r266338) @@ -19,6 +19,7 @@ dev/mbox/mbox_if.m standard arm/ti/ti_mbox.c standard arm/ti/ti_pruss.c standard +arm/ti/ti_adc.c optional ti_adc arm/ti/ti_gpio.c optional gpio arm/ti/ti_i2c.c optional ti_i2c Copied: stable/10/sys/arm/ti/ti_adc.c (from r263693, head/sys/arm/ti/ti_adc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/ti/ti_adc.c Sat May 17 19:06:46 2014 (r266338, copy of r263693, head/sys/arm/ti/ti_adc.c) @@ -0,0 +1,593 @@ +/*- + * Copyright 2014 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +/* Define our 7 steps, one for each input channel. */ +static struct ti_adc_input ti_adc_inputs[TI_ADC_NPINS] = { + { .stepconfig = ADC_STEPCFG1, .stepdelay = ADC_STEPDLY1 }, + { .stepconfig = ADC_STEPCFG2, .stepdelay = ADC_STEPDLY2 }, + { .stepconfig = ADC_STEPCFG3, .stepdelay = ADC_STEPDLY3 }, + { .stepconfig = ADC_STEPCFG4, .stepdelay = ADC_STEPDLY4 }, + { .stepconfig = ADC_STEPCFG5, .stepdelay = ADC_STEPDLY5 }, + { .stepconfig = ADC_STEPCFG6, .stepdelay = ADC_STEPDLY6 }, + { .stepconfig = ADC_STEPCFG7, .stepdelay = ADC_STEPDLY7 }, +}; + +static int ti_adc_samples[5] = { 0, 2, 4, 8, 16 }; + +static void +ti_adc_enable(struct ti_adc_softc *sc) +{ + + TI_ADC_LOCK_ASSERT(sc); + + if (sc->sc_last_state == 1) + return; + + /* Enable the FIFO0 threshold and the end of sequence interrupt. */ + ADC_WRITE4(sc, ADC_IRQENABLE_SET, + ADC_IRQ_FIFO0_THRES | ADC_IRQ_END_OF_SEQ); + + /* Enable the ADC. Run thru enabled steps, start the conversions. */ + ADC_WRITE4(sc, ADC_CTRL, ADC_READ4(sc, ADC_CTRL) | ADC_CTRL_ENABLE); + + sc->sc_last_state = 1; +} + +static void +ti_adc_disable(struct ti_adc_softc *sc) +{ + int count; + uint32_t data; + + TI_ADC_LOCK_ASSERT(sc); + + if (sc->sc_last_state == 0) + return; + + /* Disable all the enabled steps. */ + ADC_WRITE4(sc, ADC_STEPENABLE, 0); + + /* Disable the ADC. */ + ADC_WRITE4(sc, ADC_CTRL, ADC_READ4(sc, ADC_CTRL) & ~ADC_CTRL_ENABLE); + + /* Disable the FIFO0 threshold and the end of sequence interrupt. */ + ADC_WRITE4(sc, ADC_IRQENABLE_CLR, + ADC_IRQ_FIFO0_THRES | ADC_IRQ_END_OF_SEQ); + + /* ACK any pending interrupt. */ + ADC_WRITE4(sc, ADC_IRQSTATUS, ADC_READ4(sc, ADC_IRQSTATUS)); + + /* Drain the FIFO data. */ + count = ADC_READ4(sc, ADC_FIFO0COUNT) & ADC_FIFO_COUNT_MSK; + while (count > 0) { + data = ADC_READ4(sc, ADC_FIFO0DATA); + count = ADC_READ4(sc, ADC_FIFO0COUNT) & ADC_FIFO_COUNT_MSK; + } + + sc->sc_last_state = 0; +} + +static int +ti_adc_setup(struct ti_adc_softc *sc) +{ + int ain; + uint32_t enabled; + + TI_ADC_LOCK_ASSERT(sc); + + /* Check for enabled inputs. */ + enabled = 0; + for (ain = 0; ain < TI_ADC_NPINS; ain++) { + if (ti_adc_inputs[ain].enable) + enabled |= (1U << (ain + 1)); + } + + /* Set the ADC global status. */ + if (enabled != 0) { + ti_adc_enable(sc); + /* Update the enabled steps. */ + if (enabled != ADC_READ4(sc, ADC_STEPENABLE)) + ADC_WRITE4(sc, ADC_STEPENABLE, enabled); + } else + ti_adc_disable(sc); + + return (0); +} + +static void +ti_adc_input_setup(struct ti_adc_softc *sc, int32_t ain) +{ + struct ti_adc_input *input; + uint32_t reg, val; + + TI_ADC_LOCK_ASSERT(sc); + + input = &ti_adc_inputs[ain]; + reg = input->stepconfig; + val = ADC_READ4(sc, reg); + + /* Set single ended operation. */ + val &= ~ADC_STEP_DIFF_CNTRL; + + /* Set the negative voltage reference. */ + val &= ~ADC_STEP_RFM_MSK; + val |= ADC_STEP_RFM_VREFN << ADC_STEP_RFM_SHIFT; + + /* Set the positive voltage reference. */ + val &= ~ADC_STEP_RFP_MSK; + val |= ADC_STEP_RFP_VREFP << ADC_STEP_RFP_SHIFT; + + /* Set the samples average. */ + val &= ~ADC_STEP_AVG_MSK; + val |= input->samples << ADC_STEP_AVG_SHIFT; + + /* Select the desired input. */ + val &= ~ADC_STEP_INP_MSK; + val |= ain << ADC_STEP_INP_SHIFT; + + /* Set the ADC to one-shot mode. */ + val &= ~ADC_STEP_MODE_MSK; + + ADC_WRITE4(sc, reg, val); +} + +static void +ti_adc_reset(struct ti_adc_softc *sc) +{ + int ain; + + TI_ADC_LOCK_ASSERT(sc); + + /* Disable all the inputs. */ + for (ain = 0; ain < TI_ADC_NPINS; ain++) + ti_adc_inputs[ain].enable = 0; +} + +static int +ti_adc_clockdiv_proc(SYSCTL_HANDLER_ARGS) +{ + int error, reg; + struct ti_adc_softc *sc; + + sc = (struct ti_adc_softc *)arg1; + + TI_ADC_LOCK(sc); + reg = (int)ADC_READ4(sc, ADC_CLKDIV) + 1; + TI_ADC_UNLOCK(sc); + + error = sysctl_handle_int(oidp, ®, sizeof(reg), req); + if (error != 0 || req->newptr == NULL) + return (error); + + /* + * The actual written value is the prescaler setting - 1. + * Enforce a minimum value of 10 (i.e. 9) which limits the maximum + * ADC clock to ~2.4Mhz (CLK_M_OSC / 10). + */ + reg--; + if (reg < 9) + reg = 9; + if (reg > USHRT_MAX) + reg = USHRT_MAX; + + TI_ADC_LOCK(sc); + /* Disable the ADC. */ + ti_adc_disable(sc); + /* Update the ADC prescaler setting. */ + ADC_WRITE4(sc, ADC_CLKDIV, reg); + /* Enable the ADC again. */ + ti_adc_setup(sc); + TI_ADC_UNLOCK(sc); + + return (0); +} + +static int +ti_adc_enable_proc(SYSCTL_HANDLER_ARGS) +{ + int error; + int32_t enable; + struct ti_adc_softc *sc; + struct ti_adc_input *input; + + input = (struct ti_adc_input *)arg1; + sc = input->sc; + + enable = input->enable; + error = sysctl_handle_int(oidp, &enable, sizeof(enable), + req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (enable) + enable = 1; + + TI_ADC_LOCK(sc); + /* Setup the ADC as needed. */ + if (input->enable != enable) { + input->enable = enable; + ti_adc_setup(sc); + if (input->enable == 0) + input->value = 0; + } + TI_ADC_UNLOCK(sc); + + return (0); +} + +static int +ti_adc_open_delay_proc(SYSCTL_HANDLER_ARGS) +{ + int error, reg; + struct ti_adc_softc *sc; + struct ti_adc_input *input; + + input = (struct ti_adc_input *)arg1; + sc = input->sc; + + TI_ADC_LOCK(sc); + reg = (int)ADC_READ4(sc, input->stepdelay) & ADC_STEP_OPEN_DELAY; + TI_ADC_UNLOCK(sc); + + error = sysctl_handle_int(oidp, ®, sizeof(reg), req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (reg < 0) + reg = 0; + + TI_ADC_LOCK(sc); + ADC_WRITE4(sc, input->stepdelay, reg & ADC_STEP_OPEN_DELAY); + TI_ADC_UNLOCK(sc); + + return (0); +} + +static int +ti_adc_samples_avg_proc(SYSCTL_HANDLER_ARGS) +{ + int error, samples, i; + struct ti_adc_softc *sc; + struct ti_adc_input *input; + + input = (struct ti_adc_input *)arg1; + sc = input->sc; + + if (input->samples > nitems(ti_adc_samples)) + input->samples = nitems(ti_adc_samples); + samples = ti_adc_samples[input->samples]; + + error = sysctl_handle_int(oidp, &samples, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + TI_ADC_LOCK(sc); + if (samples != ti_adc_samples[input->samples]) { + input->samples = 0; + for (i = 0; i < nitems(ti_adc_samples); i++) + if (samples >= ti_adc_samples[i]) + input->samples = i; + ti_adc_input_setup(sc, input->input); + } + TI_ADC_UNLOCK(sc); + + return (error); +} + +static void +ti_adc_read_data(struct ti_adc_softc *sc) +{ + int count, ain; + struct ti_adc_input *input; + uint32_t data; + + TI_ADC_LOCK_ASSERT(sc); + + /* Read the available data. */ + count = ADC_READ4(sc, ADC_FIFO0COUNT) & ADC_FIFO_COUNT_MSK; + while (count > 0) { + data = ADC_READ4(sc, ADC_FIFO0DATA); + ain = (data & ADC_FIFO_STEP_ID_MSK) >> ADC_FIFO_STEP_ID_SHIFT; + input = &ti_adc_inputs[ain]; + if (input->enable == 0) + input->value = 0; + else + input->value = (int32_t)(data & ADC_FIFO_DATA_MSK); + count = ADC_READ4(sc, ADC_FIFO0COUNT) & ADC_FIFO_COUNT_MSK; + } +} + +static void +ti_adc_intr(void *arg) +{ + struct ti_adc_softc *sc; + uint32_t status; + + sc = (struct ti_adc_softc *)arg; + + status = ADC_READ4(sc, ADC_IRQSTATUS); + if (status == 0) + return; + if (status & ~(ADC_IRQ_FIFO0_THRES | ADC_IRQ_END_OF_SEQ)) + device_printf(sc->sc_dev, "stray interrupt: %#x\n", status); + + TI_ADC_LOCK(sc); + /* ACK the interrupt. */ + ADC_WRITE4(sc, ADC_IRQSTATUS, status); + + /* Read the available data. */ + if (status & ADC_IRQ_FIFO0_THRES) + ti_adc_read_data(sc); + + /* Start the next conversion ? */ + if (status & ADC_IRQ_END_OF_SEQ) + ti_adc_setup(sc); + TI_ADC_UNLOCK(sc); +} + +static void +ti_adc_sysctl_init(struct ti_adc_softc *sc) +{ + char pinbuf[3]; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node, *inp_node, *inpN_node; + struct sysctl_oid_list *tree, *inp_tree, *inpN_tree; + int ain; + + /* + * Add per-pin sysctl tree/handlers. + */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree_node = device_get_sysctl_tree(sc->sc_dev); + tree = SYSCTL_CHILDREN(tree_node); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "clockdiv", + CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + ti_adc_clockdiv_proc, "IU", "ADC clock prescaler"); + inp_node = SYSCTL_ADD_NODE(ctx, tree, OID_AUTO, "ain", + CTLFLAG_RD, NULL, "ADC inputs"); + inp_tree = SYSCTL_CHILDREN(inp_node); + + for (ain = 0; ain < TI_ADC_NPINS; ain++) { + + snprintf(pinbuf, sizeof(pinbuf), "%d", ain); + inpN_node = SYSCTL_ADD_NODE(ctx, inp_tree, OID_AUTO, pinbuf, + CTLFLAG_RD, NULL, "ADC input"); + inpN_tree = SYSCTL_CHILDREN(inpN_node); + + SYSCTL_ADD_PROC(ctx, inpN_tree, OID_AUTO, "enable", + CTLFLAG_RW | CTLTYPE_UINT, &ti_adc_inputs[ain], 0, + ti_adc_enable_proc, "IU", "Enable ADC input"); + SYSCTL_ADD_PROC(ctx, inpN_tree, OID_AUTO, "open_delay", + CTLFLAG_RW | CTLTYPE_UINT, &ti_adc_inputs[ain], 0, + ti_adc_open_delay_proc, "IU", "ADC open delay"); + SYSCTL_ADD_PROC(ctx, inpN_tree, OID_AUTO, "samples_avg", + CTLFLAG_RW | CTLTYPE_UINT, &ti_adc_inputs[ain], 0, + ti_adc_samples_avg_proc, "IU", "ADC samples average"); + SYSCTL_ADD_INT(ctx, inpN_tree, OID_AUTO, "input", + CTLFLAG_RD, &ti_adc_inputs[ain].value, 0, + "Converted raw value for the ADC input"); + } +} + +static void +ti_adc_inputs_init(struct ti_adc_softc *sc) +{ + int ain; + struct ti_adc_input *input; + + TI_ADC_LOCK(sc); + for (ain = 0; ain < TI_ADC_NPINS; ain++) { + input = &ti_adc_inputs[ain]; + input->sc = sc; + input->input = ain; + input->value = 0; + input->enable = 0; + input->samples = 0; + ti_adc_input_setup(sc, ain); + } + TI_ADC_UNLOCK(sc); +} + +static void +ti_adc_idlestep_init(struct ti_adc_softc *sc) +{ + uint32_t val; + + val = ADC_READ4(sc, ADC_IDLECONFIG); + + /* Set single ended operation. */ + val &= ~ADC_STEP_DIFF_CNTRL; + + /* Set the negative voltage reference. */ + val &= ~ADC_STEP_RFM_MSK; + val |= ADC_STEP_RFM_VREFN << ADC_STEP_RFM_SHIFT; + + /* Set the positive voltage reference. */ + val &= ~ADC_STEP_RFP_MSK; + val |= ADC_STEP_RFP_VREFP << ADC_STEP_RFP_SHIFT; + + /* Connect the input to VREFN. */ + val &= ~ADC_STEP_INP_MSK; + val |= ADC_STEP_IN_VREFN << ADC_STEP_INP_SHIFT; + + ADC_WRITE4(sc, ADC_IDLECONFIG, val); +} + +static int +ti_adc_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "ti,adc")) + return (ENXIO); + device_set_desc(dev, "TI ADC controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +ti_adc_attach(device_t dev) +{ + int err, rid; + struct ti_adc_softc *sc; + uint32_t reg, rev; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, ti_adc_intr, sc, &sc->sc_intrhand) != 0) { + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "Unable to setup the irq handler.\n"); + return (ENXIO); + } + + /* Activate the ADC_TSC module. */ + err = ti_prcm_clk_enable(TSC_ADC_CLK); + if (err) + return (err); + + /* Check the ADC revision. */ + rev = ADC_READ4(sc, ADC_REVISION); + device_printf(dev, + "scheme: %#x func: %#x rtl: %d rev: %d.%d custom rev: %d\n", + (rev & ADC_REV_SCHEME_MSK) >> ADC_REV_SCHEME_SHIFT, + (rev & ADC_REV_FUNC_MSK) >> ADC_REV_FUNC_SHIFT, + (rev & ADC_REV_RTL_MSK) >> ADC_REV_RTL_SHIFT, + (rev & ADC_REV_MAJOR_MSK) >> ADC_REV_MAJOR_SHIFT, + rev & ADC_REV_MINOR_MSK, + (rev & ADC_REV_CUSTOM_MSK) >> ADC_REV_CUSTOM_SHIFT); + + /* + * Disable the step write protect and make it store the step ID for + * the captured data on FIFO. + */ + reg = ADC_READ4(sc, ADC_CTRL); + ADC_WRITE4(sc, ADC_CTRL, reg | ADC_CTRL_STEP_WP | ADC_CTRL_STEP_ID); + + /* + * Set the ADC prescaler to 2400 (yes, the actual value written here + * is 2400 - 1). + * This sets the ADC clock to ~10Khz (CLK_M_OSC / 2400). + */ + ADC_WRITE4(sc, ADC_CLKDIV, 2399); + + TI_ADC_LOCK_INIT(sc); + + ti_adc_idlestep_init(sc); + ti_adc_inputs_init(sc); + ti_adc_sysctl_init(sc); + + return (0); +} + +static int +ti_adc_detach(device_t dev) +{ + struct ti_adc_softc *sc; + + sc = device_get_softc(dev); + + /* Turn off the ADC. */ + TI_ADC_LOCK(sc); + ti_adc_reset(sc); + ti_adc_setup(sc); + TI_ADC_UNLOCK(sc); + + TI_ADC_LOCK_DESTROY(sc); + + if (sc->sc_intrhand) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (bus_generic_detach(dev)); +} + +static device_method_t ti_adc_methods[] = { + DEVMETHOD(device_probe, ti_adc_probe), + DEVMETHOD(device_attach, ti_adc_attach), + DEVMETHOD(device_detach, ti_adc_detach), + + DEVMETHOD_END +}; + +static driver_t ti_adc_driver = { + "ti_adc", + ti_adc_methods, + sizeof(struct ti_adc_softc), +}; + +static devclass_t ti_adc_devclass; + +DRIVER_MODULE(ti_adc, simplebus, ti_adc_driver, ti_adc_devclass, 0, 0); +MODULE_VERSION(ti_adc, 1); +MODULE_DEPEND(ti_adc, simplebus, 1, 1, 1); Copied: stable/10/sys/arm/ti/ti_adcreg.h (from r263693, head/sys/arm/ti/ti_adcreg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/ti/ti_adcreg.h Sat May 17 19:06:46 2014 (r266338, copy of r263693, head/sys/arm/ti/ti_adcreg.h) @@ -0,0 +1,118 @@ +/*- + * Copyright 2014 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TI_ADCREG_H_ +#define _TI_ADCREG_H_ + +#define ADC_REVISION 0x000 +#define ADC_REV_SCHEME_MSK 0xc0000000 +#define ADC_REV_SCHEME_SHIFT 30 +#define ADC_REV_FUNC_MSK 0x0fff0000 +#define ADC_REV_FUNC_SHIFT 16 +#define ADC_REV_RTL_MSK 0x0000f800 +#define ADC_REV_RTL_SHIFT 11 +#define ADC_REV_MAJOR_MSK 0x00000700 +#define ADC_REV_MAJOR_SHIFT 8 +#define ADC_REV_CUSTOM_MSK 0x000000c0 +#define ADC_REV_CUSTOM_SHIFT 6 +#define ADC_REV_MINOR_MSK 0x0000003f +#define ADC_SYSCFG 0x010 +#define ADC_SYSCFG_IDLE_MSK 0x000000c0 +#define ADC_SYSCFG_IDLE_SHIFT 2 +#define ADC_IRQSTATUS_RAW 0x024 +#define ADC_IRQSTATUS 0x028 +#define ADC_IRQENABLE_SET 0x02c +#define ADC_IRQENABLE_CLR 0x030 +#define ADC_IRQ_HW_PEN_SYNC (1 << 10) +#define ADC_IRQ_PEN_UP (1 << 9) +#define ADC_IRQ_OUT_RANGE (1 << 8) +#define ADC_IRQ_FIFO1_UNDR (1 << 7) +#define ADC_IRQ_FIFO1_OVERR (1 << 6) +#define ADC_IRQ_FIFO1_THRES (1 << 5) +#define ADC_IRQ_FIFO0_UNDR (1 << 4) +#define ADC_IRQ_FIFO0_OVERR (1 << 3) +#define ADC_IRQ_FIFO0_THRES (1 << 2) +#define ADC_IRQ_END_OF_SEQ (1 << 1) +#define ADC_IRQ_HW_PEN_ASYNC (1 << 0) +#define ADC_CTRL 0x040 +#define ADC_CTRL_STEP_WP (1 << 2) +#define ADC_CTRL_STEP_ID (1 << 1) +#define ADC_CTRL_ENABLE (1 << 0) +#define ADC_STAT 0x044 +#define ADC_CLKDIV 0x04c +#define ADC_STEPENABLE 0x054 +#define ADC_IDLECONFIG 0x058 +#define ADC_STEPCFG1 0x064 +#define ADC_STEPDLY1 0x068 +#define ADC_STEPCFG2 0x06c +#define ADC_STEPDLY2 0x070 +#define ADC_STEPCFG3 0x074 +#define ADC_STEPDLY3 0x078 +#define ADC_STEPCFG4 0x07c +#define ADC_STEPDLY4 0x080 +#define ADC_STEPCFG5 0x084 +#define ADC_STEPDLY5 0x088 +#define ADC_STEPCFG6 0x08c +#define ADC_STEPDLY6 0x090 +#define ADC_STEPCFG7 0x094 +#define ADC_STEPDLY7 0x098 +#define ADC_STEP_DIFF_CNTRL (1 << 25) +#define ADC_STEP_RFM_MSK 0x01800000 +#define ADC_STEP_RFM_SHIFT 23 +#define ADC_STEP_RFM_VSSA 0 +#define ADC_STEP_RFM_XNUR 1 +#define ADC_STEP_RFM_YNLR 2 +#define ADC_STEP_RFM_VREFN 3 +#define ADC_STEP_INP_MSK 0x00780000 +#define ADC_STEP_INP_SHIFT 19 +#define ADC_STEP_INM_MSK 0x00078000 +#define ADC_STEP_INM_SHIFT 15 +#define ADC_STEP_IN_VREFN 8 +#define ADC_STEP_RFP_MSK 0x00007000 +#define ADC_STEP_RFP_SHIFT 12 +#define ADC_STEP_RFP_VDDA 0 +#define ADC_STEP_RFP_XPUL 1 +#define ADC_STEP_RFP_YPLL 2 +#define ADC_STEP_RFP_VREFP 3 +#define ADC_STEP_RFP_INTREF 4 +#define ADC_STEP_AVG_MSK 0x0000001c +#define ADC_STEP_AVG_SHIFT 2 +#define ADC_STEP_MODE_MSK 0x00000003 +#define ADC_STEP_MODE_ONESHOT 0x00000000 +#define ADC_STEP_MODE_CONTINUOUS 0x00000001 +#define ADC_STEP_SAMPLE_DELAY 0xff000000 +#define ADC_STEP_OPEN_DELAY 0x0003ffff +#define ADC_FIFO0COUNT 0x0e4 +#define ADC_FIFO0THRESHOLD 0x0e8 +#define ADC_FIFO0DATA 0x100 +#define ADC_FIFO_COUNT_MSK 0x0000007f +#define ADC_FIFO_STEP_ID_MSK 0x000f0000 +#define ADC_FIFO_STEP_ID_SHIFT 16 +#define ADC_FIFO_DATA_MSK 0x00000fff + +#endif /* _TI_ADCREG_H_ */ Copied: stable/10/sys/arm/ti/ti_adcvar.h (from r263693, head/sys/arm/ti/ti_adcvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/ti/ti_adcvar.h Sat May 17 19:06:46 2014 (r266338, copy of r263693, head/sys/arm/ti/ti_adcvar.h) @@ -0,0 +1,69 @@ +/*- + * Copyright 2014 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TI_ADCVAR_H_ +#define _TI_ADCVAR_H_ + +#define TI_ADC_NPINS 7 + +#define ADC_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res, reg) +#define ADC_WRITE4(_sc, reg, value) \ + bus_write_4((_sc)->sc_mem_res, reg, value) + +struct ti_adc_softc { + device_t sc_dev; + int sc_last_state; + struct mtx sc_mtx; + struct resource *sc_mem_res; + struct resource *sc_irq_res; + void *sc_intrhand; +}; + +struct ti_adc_input { + int32_t enable; /* input enabled */ + int32_t samples; /* samples average */ + int32_t input; /* input number */ + int32_t value; /* raw converted value */ + uint32_t stepconfig; /* step config register */ + uint32_t stepdelay; /* step delay register */ + struct ti_adc_softc *sc; /* pointer to adc softc */ +}; + +#define TI_ADC_LOCK(_sc) \ + mtx_lock(&(_sc)->sc_mtx) +#define TI_ADC_UNLOCK(_sc) \ + mtx_unlock(&(_sc)->sc_mtx) +#define TI_ADC_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ + "ti_adc", MTX_DEF) +#define TI_ADC_LOCK_DESTROY(_sc) \ + mtx_destroy(&_sc->sc_mtx); +#define TI_ADC_LOCK_ASSERT(_sc) \ + mtx_assert(&(_sc)->sc_mtx, MA_OWNED) + +#endif /* _TI_ADCVAR_H_ */ Modified: stable/10/sys/arm/ti/ti_prcm.h ============================================================================== --- stable/10/sys/arm/ti/ti_prcm.h Sat May 17 18:53:36 2014 (r266337) +++ stable/10/sys/arm/ti/ti_prcm.h Sat May 17 19:06:46 2014 (r266338) @@ -162,6 +162,8 @@ typedef enum { PRUSS_CLK = 1700, + TSC_ADC_CLK = 1800, + INVALID_CLK_IDENT } clk_ident_t; Modified: stable/10/sys/boot/fdt/dts/arm/am335x.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/am335x.dtsi Sat May 17 18:53:36 2014 (r266337) +++ stable/10/sys/boot/fdt/dts/arm/am335x.dtsi Sat May 17 19:06:46 2014 (r266338) @@ -75,6 +75,13 @@ interrupt-parent = <&AINTC>; }; + adc0: adc@44E0D000 { + compatible = "ti,adc"; + reg = <0x44E0D000 0x2000>; + interrupts = < 16 >; + interrupt-parent = <&AINTC>; + }; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 19:11:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EAE2120E; Sat, 17 May 2014 19:11: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 D48562F16; Sat, 17 May 2014 19:11: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 s4HJBAAG023214; Sat, 17 May 2014 19:11:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HJB96t023197; Sat, 17 May 2014 19:11:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405171911.s4HJB96t023197@svn.freebsd.org> From: John Baldwin Date: Sat, 17 May 2014 19:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266339 - in stable/10: sys/amd64/amd64 sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io usr.sbin/bhyvectl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 19:11:11 -0000 Author: jhb Date: Sat May 17 19:11:08 2014 New Revision: 266339 URL: http://svnweb.freebsd.org/changeset/base/266339 Log: MFC 259641,259863,259924,259937,259961,259978,260380,260383,260410,260466, 260531,260532,260550,260619,261170,261453,261621,263280,263290,264516: Add support for local APIC hardware-assist. - Restructure vlapic access and register handling to support hardware-assist for the local APIC. - Use the 'Virtual Interrupt Delivery' and 'Posted Interrupt Processing' feature of Intel VT-x if supported by hardware. - Add an API to rendezvous all active vcpus in a virtual machine and use it to support level triggered interrupts with VT-x 'Virtual Interrupt Delivery'. - Use a cheaper IPI handler than IPI_AST for nested page table shootdowns and avoid doing unnecessary nested TLB invalidations. Reviewed by: neel Added: stable/10/sys/amd64/vmm/io/vlapic_priv.h - copied, changed from r259863, head/sys/amd64/vmm/io/vlapic_priv.h Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/amd64/include/pmap.h stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/vmm/amd/amdv.c stable/10/sys/amd64/vmm/intel/ept.c stable/10/sys/amd64/vmm/intel/ept.h stable/10/sys/amd64/vmm/intel/vmcs.c stable/10/sys/amd64/vmm/intel/vmcs.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/intel/vmx.h stable/10/sys/amd64/vmm/intel/vmx_controls.h stable/10/sys/amd64/vmm/intel/vmx_genassym.c stable/10/sys/amd64/vmm/intel/vmx_support.S stable/10/sys/amd64/vmm/io/vioapic.c stable/10/sys/amd64/vmm/io/vlapic.c stable/10/sys/amd64/vmm/io/vlapic.h stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_ipi.c stable/10/sys/amd64/vmm/vmm_ipi.h stable/10/sys/amd64/vmm/vmm_lapic.c stable/10/sys/amd64/vmm/vmm_lapic.h stable/10/sys/amd64/vmm/vmm_stat.c stable/10/sys/amd64/vmm/vmm_stat.h stable/10/usr.sbin/bhyvectl/bhyvectl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Sat May 17 19:06:46 2014 (r266338) +++ stable/10/sys/amd64/amd64/pmap.c Sat May 17 19:11:08 2014 (r266339) @@ -1304,6 +1304,7 @@ pmap_invalidate_page_pcid(pmap_t pmap, v static __inline void pmap_invalidate_ept(pmap_t pmap) { + int ipinum; sched_pin(); KASSERT(!CPU_ISSET(curcpu, &pmap->pm_active), @@ -1328,11 +1329,9 @@ pmap_invalidate_ept(pmap_t pmap) /* * Force the vcpu to exit and trap back into the hypervisor. - * - * XXX this is not optimal because IPI_AST builds a trapframe - * whereas all we need is an 'eoi' followed by 'iret'. */ - ipi_selected(pmap->pm_active, IPI_AST); + ipinum = pmap->pm_flags & PMAP_NESTED_IPIMASK; + ipi_selected(pmap->pm_active, ipinum); sched_unpin(); } Modified: stable/10/sys/amd64/include/pmap.h ============================================================================== --- stable/10/sys/amd64/include/pmap.h Sat May 17 19:06:46 2014 (r266338) +++ stable/10/sys/amd64/include/pmap.h Sat May 17 19:11:08 2014 (r266339) @@ -312,9 +312,10 @@ struct pmap { }; /* flags */ -#define PMAP_PDE_SUPERPAGE (1 << 0) /* supports 2MB superpages */ -#define PMAP_EMULATE_AD_BITS (1 << 1) /* needs A/D bits emulation */ -#define PMAP_SUPPORTS_EXEC_ONLY (1 << 2) /* execute only mappings ok */ +#define PMAP_NESTED_IPIMASK 0xff +#define PMAP_PDE_SUPERPAGE (1 << 8) /* supports 2MB superpages */ +#define PMAP_EMULATE_AD_BITS (1 << 9) /* needs A/D bits emulation */ +#define PMAP_SUPPORTS_EXEC_ONLY (1 << 10) /* execute only mappings ok */ typedef struct pmap *pmap_t; Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Sat May 17 19:06:46 2014 (r266338) +++ stable/10/sys/amd64/include/vmm.h Sat May 17 19:11:08 2014 (r266339) @@ -47,12 +47,12 @@ struct pmap; enum x2apic_state; -typedef int (*vmm_init_func_t)(void); +typedef int (*vmm_init_func_t)(int ipinum); typedef int (*vmm_cleanup_func_t)(void); typedef void (*vmm_resume_func_t)(void); typedef void * (*vmi_init_func_t)(struct vm *vm, struct pmap *pmap); typedef int (*vmi_run_func_t)(void *vmi, int vcpu, register_t rip, - struct pmap *pmap); + struct pmap *pmap, void *rendezvous_cookie); typedef void (*vmi_cleanup_func_t)(void *vmi); typedef int (*vmi_get_register_t)(void *vmi, int vcpu, int num, uint64_t *retval); @@ -69,6 +69,8 @@ typedef int (*vmi_get_cap_t)(void *vmi, typedef int (*vmi_set_cap_t)(void *vmi, int vcpu, int num, int val); typedef struct vmspace * (*vmi_vmspace_alloc)(vm_offset_t min, vm_offset_t max); typedef void (*vmi_vmspace_free)(struct vmspace *vmspace); +typedef struct vlapic * (*vmi_vlapic_init)(void *vmi, int vcpu); +typedef void (*vmi_vlapic_cleanup)(void *vmi, struct vlapic *vlapic); struct vmm_ops { vmm_init_func_t init; /* module wide initialization */ @@ -87,6 +89,8 @@ struct vmm_ops { vmi_set_cap_t vmsetcap; vmi_vmspace_alloc vmspace_alloc; vmi_vmspace_free vmspace_free; + vmi_vlapic_init vlapic_init; + vmi_vlapic_cleanup vlapic_cleanup; }; extern struct vmm_ops vmm_ops_intel; @@ -132,6 +136,31 @@ cpuset_t vm_active_cpus(struct vm *vm); struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid); /* + * Rendezvous all vcpus specified in 'dest' and execute 'func(arg)'. + * The rendezvous 'func(arg)' is not allowed to do anything that will + * cause the thread to be put to sleep. + * + * If the rendezvous is being initiated from a vcpu context then the + * 'vcpuid' must refer to that vcpu, otherwise it should be set to -1. + * + * The caller cannot hold any locks when initiating the rendezvous. + * + * The implementation of this API may cause vcpus other than those specified + * by 'dest' to be stalled. The caller should not rely on any vcpus making + * forward progress when the rendezvous is in progress. + */ +typedef void (*vm_rendezvous_func_t)(struct vm *vm, int vcpuid, void *arg); +void vm_smp_rendezvous(struct vm *vm, int vcpuid, cpuset_t dest, + vm_rendezvous_func_t func, void *arg); + +static __inline int +vcpu_rendezvous_pending(void *rendezvous_cookie) +{ + + return (*(uintptr_t *)rendezvous_cookie != 0); +} + +/* * Return 1 if device indicated by bus/slot/func is supposed to be a * pci passthrough device. * @@ -158,7 +187,7 @@ vcpu_is_running(struct vm *vm, int vcpu, } void *vcpu_stats(struct vm *vm, int vcpu); -void vcpu_notify_event(struct vm *vm, int vcpuid); +void vcpu_notify_event(struct vm *vm, int vcpuid, bool lapic_intr); struct vmspace *vm_get_vmspace(struct vm *vm); int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); @@ -267,6 +296,8 @@ enum vm_exitcode { VM_EXITCODE_INST_EMUL, VM_EXITCODE_SPINUP_AP, VM_EXITCODE_SPINDOWN_CPU, + VM_EXITCODE_RENDEZVOUS, + VM_EXITCODE_IOAPIC_EOI, VM_EXITCODE_MAX }; @@ -323,6 +354,9 @@ struct vm_exit { struct { uint64_t rflags; } hlt; + struct { + int vector; + } ioapic_eoi; } u; }; Modified: stable/10/sys/amd64/vmm/amd/amdv.c ============================================================================== --- stable/10/sys/amd64/vmm/amd/amdv.c Sat May 17 19:06:46 2014 (r266338) +++ stable/10/sys/amd64/vmm/amd/amdv.c Sat May 17 19:11:08 2014 (r266339) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include "io/iommu.h" static int -amdv_init(void) +amdv_init(int ipinum) { printf("amdv_init: not implemented\n"); @@ -67,7 +67,7 @@ amdv_vminit(struct vm *vm, struct pmap * } static int -amdv_vmrun(void *arg, int vcpu, register_t rip, struct pmap *pmap) +amdv_vmrun(void *arg, int vcpu, register_t rip, struct pmap *pmap, void *cookie) { printf("amdv_vmrun: not implemented\n"); @@ -155,6 +155,20 @@ amdv_vmspace_free(struct vmspace *vmspac return; } +static struct vlapic * +amdv_vlapic_init(void *arg, int vcpuid) +{ + + panic("amdv_vlapic_init: not implmented"); +} + +static void +amdv_vlapic_cleanup(void *arg, struct vlapic *vlapic) +{ + + panic("amdv_vlapic_cleanup: not implemented"); +} + struct vmm_ops vmm_ops_amd = { amdv_init, amdv_cleanup, @@ -171,6 +185,8 @@ struct vmm_ops vmm_ops_amd = { amdv_setcap, amdv_vmspace_alloc, amdv_vmspace_free, + amdv_vlapic_init, + amdv_vlapic_cleanup, }; static int Modified: stable/10/sys/amd64/vmm/intel/ept.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/ept.c Sat May 17 19:06:46 2014 (r266338) +++ stable/10/sys/amd64/vmm/intel/ept.c Sat May 17 19:11:08 2014 (r266339) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include "vmx_cpufunc.h" +#include "vmm_ipi.h" #include "vmx_msr.h" #include "ept.h" @@ -76,7 +77,7 @@ SYSCTL_INT(_hw_vmm_ept, OID_AUTO, pmap_f &ept_pmap_flags, 0, NULL); int -ept_init(void) +ept_init(int ipinum) { int use_hw_ad_bits, use_superpages, use_exec_only; uint64_t cap; @@ -98,6 +99,8 @@ ept_init(void) !INVEPT_ALL_TYPES_SUPPORTED(cap)) return (EINVAL); + ept_pmap_flags = ipinum & PMAP_NESTED_IPIMASK; + use_superpages = 1; TUNABLE_INT_FETCH("hw.vmm.ept.use_superpages", &use_superpages); if (use_superpages && EPT_PDE_SUPERPAGE(cap)) Modified: stable/10/sys/amd64/vmm/intel/ept.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/ept.h Sat May 17 19:06:46 2014 (r266338) +++ stable/10/sys/amd64/vmm/intel/ept.h Sat May 17 19:11:08 2014 (r266339) @@ -31,7 +31,7 @@ struct vmx; -int ept_init(void); +int ept_init(int ipinum); void ept_invalidate_mappings(u_long eptp); struct vmspace *ept_vmspace_alloc(vm_offset_t min, vm_offset_t max); void ept_vmspace_free(struct vmspace *vmspace); Modified: stable/10/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.c Sat May 17 19:06:46 2014 (r266338) +++ stable/10/sys/amd64/vmm/intel/vmcs.c Sat May 17 19:11:08 2014 (r266339) @@ -315,11 +315,7 @@ done: } int -vmcs_set_defaults(struct vmcs *vmcs, - u_long host_rip, u_long host_rsp, uint64_t eptp, - uint32_t pinbased_ctls, uint32_t procbased_ctls, - uint32_t procbased_ctls2, uint32_t exit_ctls, - uint32_t entry_ctls, u_long msr_bitmap, uint16_t vpid) +vmcs_init(struct vmcs *vmcs) { int error, codesel, datasel, tsssel; u_long cr0, cr4, efer; @@ -335,22 +331,6 @@ vmcs_set_defaults(struct vmcs *vmcs, */ VMPTRLD(vmcs); - /* - * Load the VMX controls - */ - if ((error = vmwrite(VMCS_PIN_BASED_CTLS, pinbased_ctls)) != 0) - goto done; - if ((error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, procbased_ctls)) != 0) - goto done; - if ((error = vmwrite(VMCS_SEC_PROC_BASED_CTLS, procbased_ctls2)) != 0) - goto done; - if ((error = vmwrite(VMCS_EXIT_CTLS, exit_ctls)) != 0) - goto done; - if ((error = vmwrite(VMCS_ENTRY_CTLS, entry_ctls)) != 0) - goto done; - - /* Guest state */ - /* Initialize guest IA32_PAT MSR with the default value */ pat = PAT_VALUE(0, PAT_WRITE_BACK) | PAT_VALUE(1, PAT_WRITE_THROUGH) | @@ -422,23 +402,7 @@ vmcs_set_defaults(struct vmcs *vmcs, goto done; /* instruction pointer */ - if ((error = vmwrite(VMCS_HOST_RIP, host_rip)) != 0) - goto done; - - /* stack pointer */ - if ((error = vmwrite(VMCS_HOST_RSP, host_rsp)) != 0) - goto done; - - /* eptp */ - if ((error = vmwrite(VMCS_EPTP, eptp)) != 0) - goto done; - - /* vpid */ - if ((error = vmwrite(VMCS_VPID, vpid)) != 0) - goto done; - - /* msr bitmap */ - if ((error = vmwrite(VMCS_MSR_BITMAP, msr_bitmap)) != 0) + if ((error = vmwrite(VMCS_HOST_RIP, (u_long)vmx_exit_guest)) != 0) goto done; /* exception bitmap */ @@ -509,7 +473,7 @@ DB_SHOW_COMMAND(vmcs, db_show_vmcs) switch (exit & 0x8000ffff) { case EXIT_REASON_EXCEPTION: case EXIT_REASON_EXT_INTR: - val = vmcs_read(VMCS_EXIT_INTERRUPTION_INFO); + val = vmcs_read(VMCS_EXIT_INTR_INFO); db_printf("Interrupt Type: "); switch (val >> 8 & 0x7) { case 0: @@ -531,7 +495,7 @@ DB_SHOW_COMMAND(vmcs, db_show_vmcs) db_printf(" Vector: %lu", val & 0xff); if (val & 0x800) db_printf(" Error Code: %lx", - vmcs_read(VMCS_EXIT_INTERRUPTION_ERROR)); + vmcs_read(VMCS_EXIT_INTR_ERRCODE)); db_printf("\n"); break; case EXIT_REASON_EPT_FAULT: Modified: stable/10/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.h Sat May 17 19:06:46 2014 (r266338) +++ stable/10/sys/amd64/vmm/intel/vmcs.h Sat May 17 19:11:08 2014 (r266339) @@ -46,12 +46,7 @@ struct msr_entry { }; int vmcs_set_msr_save(struct vmcs *vmcs, u_long g_area, u_int g_count); -int vmcs_set_defaults(struct vmcs *vmcs, u_long host_rip, u_long host_rsp, - uint64_t eptp, - uint32_t pinbased_ctls, uint32_t procbased_ctls, - uint32_t procbased_ctls2, uint32_t exit_ctls, - uint32_t entry_ctls, u_long msr_bitmap, - uint16_t vpid); +int vmcs_init(struct vmcs *vmcs); int vmcs_getreg(struct vmcs *vmcs, int running, int ident, uint64_t *rv); int vmcs_setreg(struct vmcs *vmcs, int running, int ident, uint64_t val); int vmcs_getdesc(struct vmcs *vmcs, int ident, @@ -102,6 +97,7 @@ vmcs_write(uint32_t encoding, uint64_t v /* 16-bit control fields */ #define VMCS_VPID 0x00000000 +#define VMCS_PIR_VECTOR 0x00000002 /* 16-bit guest-state fields */ #define VMCS_GUEST_ES_SELECTOR 0x00000800 @@ -112,6 +108,7 @@ vmcs_write(uint32_t encoding, uint64_t v #define VMCS_GUEST_GS_SELECTOR 0x0000080A #define VMCS_GUEST_LDTR_SELECTOR 0x0000080C #define VMCS_GUEST_TR_SELECTOR 0x0000080E +#define VMCS_GUEST_INTR_STATUS 0x00000810 /* 16-bit host-state fields */ #define VMCS_HOST_ES_SELECTOR 0x00000C00 @@ -133,7 +130,13 @@ vmcs_write(uint32_t encoding, uint64_t v #define VMCS_TSC_OFFSET 0x00002010 #define VMCS_VIRTUAL_APIC 0x00002012 #define VMCS_APIC_ACCESS 0x00002014 +#define VMCS_PIR_DESC 0x00002016 #define VMCS_EPTP 0x0000201A +#define VMCS_EOI_EXIT0 0x0000201C +#define VMCS_EOI_EXIT1 0x0000201E +#define VMCS_EOI_EXIT2 0x00002020 +#define VMCS_EOI_EXIT3 0x00002022 +#define VMCS_EOI_EXIT(vector) (VMCS_EOI_EXIT0 + ((vector) / 64) * 2) /* 64-bit read-only fields */ #define VMCS_GUEST_PHYSICAL_ADDRESS 0x00002400 @@ -177,8 +180,8 @@ vmcs_write(uint32_t encoding, uint64_t v /* 32-bit read-only data fields */ #define VMCS_INSTRUCTION_ERROR 0x00004400 #define VMCS_EXIT_REASON 0x00004402 -#define VMCS_EXIT_INTERRUPTION_INFO 0x00004404 -#define VMCS_EXIT_INTERRUPTION_ERROR 0x00004406 +#define VMCS_EXIT_INTR_INFO 0x00004404 +#define VMCS_EXIT_INTR_ERRCODE 0x00004406 #define VMCS_IDT_VECTORING_INFO 0x00004408 #define VMCS_IDT_VECTORING_ERROR 0x0000440A #define VMCS_EXIT_INSTRUCTION_LENGTH 0x0000440C @@ -315,7 +318,8 @@ vmcs_write(uint32_t encoding, uint64_t v #define EXIT_REASON_PAUSE 40 #define EXIT_REASON_MCE 41 #define EXIT_REASON_TPR 43 -#define EXIT_REASON_APIC 44 +#define EXIT_REASON_APIC_ACCESS 44 +#define EXIT_REASON_VIRTUALIZED_EOI 45 #define EXIT_REASON_GDTR_IDTR 46 #define EXIT_REASON_LDTR_TR 47 #define EXIT_REASON_EPT_FAULT 48 @@ -326,13 +330,15 @@ vmcs_write(uint32_t encoding, uint64_t v #define EXIT_REASON_INVVPID 53 #define EXIT_REASON_WBINVD 54 #define EXIT_REASON_XSETBV 55 +#define EXIT_REASON_APIC_WRITE 56 /* * VMCS interrupt information fields */ -#define VMCS_INTERRUPTION_INFO_VALID (1U << 31) -#define VMCS_INTERRUPTION_INFO_HW_INTR (0 << 8) -#define VMCS_INTERRUPTION_INFO_NMI (2 << 8) +#define VMCS_INTR_INFO_VALID (1U << 31) +#define VMCS_INTR_INFO_TYPE(info) (((info) >> 8) & 0x7) +#define VMCS_INTR_INFO_HW_INTR (0 << 8) +#define VMCS_INTR_INFO_NMI (2 << 8) /* * VMCS IDT-Vectoring information fields @@ -365,4 +371,15 @@ vmcs_write(uint32_t encoding, uint64_t v #define EPT_VIOLATION_GLA_VALID (1UL << 7) #define EPT_VIOLATION_XLAT_VALID (1UL << 8) +/* + * Exit qualification for APIC-access VM exit + */ +#define APIC_ACCESS_OFFSET(qual) ((qual) & 0xFFF) +#define APIC_ACCESS_TYPE(qual) (((qual) >> 12) & 0xF) + +/* + * Exit qualification for APIC-write VM exit + */ +#define APIC_WRITE_OFFSET(qual) ((qual) & 0xFFF) + #endif Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Sat May 17 19:06:46 2014 (r266338) +++ stable/10/sys/amd64/vmm/intel/vmx.c Sat May 17 19:11:08 2014 (r266339) @@ -45,15 +45,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include "vmm_host.h" -#include "vmm_lapic.h" +#include "vmm_ipi.h" #include "vmm_msr.h" #include "vmm_ktr.h" #include "vmm_stat.h" +#include "vlapic.h" +#include "vlapic_priv.h" #include "vmx_msr.h" #include "ept.h" @@ -92,6 +95,7 @@ __FBSDID("$FreeBSD$"); #define VM_EXIT_CTLS_ONE_SETTING \ (VM_EXIT_CTLS_ONE_SETTING_NO_PAT | \ + VM_EXIT_ACKNOWLEDGE_INTERRUPT | \ VM_EXIT_SAVE_PAT | \ VM_EXIT_LOAD_PAT) #define VM_EXIT_CTLS_ZERO_SETTING VM_EXIT_SAVE_DEBUG_CONTROLS @@ -112,7 +116,8 @@ __FBSDID("$FreeBSD$"); #define HANDLED 1 #define UNHANDLED 0 -MALLOC_DEFINE(M_VMX, "vmx", "vmx"); +static MALLOC_DEFINE(M_VMX, "vmx", "vmx"); +static MALLOC_DEFINE(M_VLAPIC, "vlapic", "vlapic"); SYSCTL_DECL(_hw_vmm); SYSCTL_NODE(_hw_vmm, OID_AUTO, vmx, CTLFLAG_RW, NULL, NULL); @@ -164,12 +169,33 @@ static int cap_pause_exit; static int cap_unrestricted_guest; static int cap_monitor_trap; static int cap_invpcid; - + +static int virtual_interrupt_delivery; +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, virtual_interrupt_delivery, CTLFLAG_RD, + &virtual_interrupt_delivery, 0, "APICv virtual interrupt delivery support"); + +static int posted_interrupts; +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, posted_interrupts, CTLFLAG_RD, + &posted_interrupts, 0, "APICv posted interrupt support"); + +static int pirvec; +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, posted_interrupt_vector, CTLFLAG_RD, + &pirvec, 0, "APICv posted interrupt vector"); + static struct unrhdr *vpid_unr; static u_int vpid_alloc_failed; SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_alloc_failed, CTLFLAG_RD, &vpid_alloc_failed, 0, NULL); +/* + * Use the last page below 4GB as the APIC access address. This address is + * occupied by the boot firmware so it is guaranteed that it will not conflict + * with a page in system memory. + */ +#define APIC_ACCESS_ADDRESS 0xFFFFF000 + +static void vmx_inject_pir(struct vlapic *vlapic); + #ifdef KTR static const char * exit_reason_to_str(int reason) @@ -259,8 +285,8 @@ exit_reason_to_str(int reason) return "mce"; case EXIT_REASON_TPR: return "tpr"; - case EXIT_REASON_APIC: - return "apic"; + case EXIT_REASON_APIC_ACCESS: + return "apic-access"; case EXIT_REASON_GDTR_IDTR: return "gdtridtr"; case EXIT_REASON_LDTR_TR: @@ -281,6 +307,8 @@ exit_reason_to_str(int reason) return "wbinvd"; case EXIT_REASON_XSETBV: return "xsetbv"; + case EXIT_REASON_APIC_WRITE: + return "apic-write"; default: snprintf(reasonbuf, sizeof(reasonbuf), "%d", reason); return (reasonbuf); @@ -424,6 +452,9 @@ vmx_disable(void *arg __unused) static int vmx_cleanup(void) { + + if (pirvec != 0) + vmm_ipi_free(pirvec); if (vpid_unr != NULL) { delete_unrhdr(vpid_unr); @@ -457,11 +488,11 @@ vmx_restore(void) } static int -vmx_init(void) +vmx_init(int ipinum) { - int error; + int error, use_tpr_shadow; uint64_t fixed0, fixed1, feature_control; - uint32_t tmp; + uint32_t tmp, procbased2_vid_bits; /* CPUID.1:ECX[bit 5] must be 1 for processor to support VMX */ if (!(cpu_feature2 & CPUID2_VMX)) { @@ -595,9 +626,58 @@ vmx_init(void) MSR_VMX_PROCBASED_CTLS2, PROCBASED2_ENABLE_INVPCID, 0, &tmp) == 0); + /* + * Check support for virtual interrupt delivery. + */ + procbased2_vid_bits = (PROCBASED2_VIRTUALIZE_APIC_ACCESSES | + PROCBASED2_VIRTUALIZE_X2APIC_MODE | + PROCBASED2_APIC_REGISTER_VIRTUALIZATION | + PROCBASED2_VIRTUAL_INTERRUPT_DELIVERY); + + use_tpr_shadow = (vmx_set_ctlreg(MSR_VMX_PROCBASED_CTLS, + MSR_VMX_TRUE_PROCBASED_CTLS, PROCBASED_USE_TPR_SHADOW, 0, + &tmp) == 0); + + error = vmx_set_ctlreg(MSR_VMX_PROCBASED_CTLS2, MSR_VMX_PROCBASED_CTLS2, + procbased2_vid_bits, 0, &tmp); + if (error == 0 && use_tpr_shadow) { + virtual_interrupt_delivery = 1; + TUNABLE_INT_FETCH("hw.vmm.vmx.use_apic_vid", + &virtual_interrupt_delivery); + } + + if (virtual_interrupt_delivery) { + procbased_ctls |= PROCBASED_USE_TPR_SHADOW; + procbased_ctls2 |= procbased2_vid_bits; + procbased_ctls2 &= ~PROCBASED2_VIRTUALIZE_X2APIC_MODE; + + /* + * Check for Posted Interrupts only if Virtual Interrupt + * Delivery is enabled. + */ + error = vmx_set_ctlreg(MSR_VMX_PINBASED_CTLS, + MSR_VMX_TRUE_PINBASED_CTLS, PINBASED_POSTED_INTERRUPT, 0, + &tmp); + if (error == 0) { + pirvec = vmm_ipi_alloc(); + if (pirvec == 0) { + if (bootverbose) { + printf("vmx_init: unable to allocate " + "posted interrupt vector\n"); + } + } else { + posted_interrupts = 1; + TUNABLE_INT_FETCH("hw.vmm.vmx.use_apic_pir", + &posted_interrupts); + } + } + } + + if (posted_interrupts) + pinbased_ctls |= PINBASED_POSTED_INTERRUPT; /* Initialize EPT */ - error = ept_init(); + error = ept_init(ipinum); if (error) { printf("vmx_init: ept initialization failed (%d)\n", error); return (error); @@ -638,6 +718,31 @@ vmx_init(void) return (0); } +static void +vmx_trigger_hostintr(int vector) +{ + uintptr_t func; + struct gate_descriptor *gd; + + gd = &idt[vector]; + + KASSERT(vector >= 32 && vector <= 255, ("vmx_trigger_hostintr: " + "invalid vector %d", vector)); + KASSERT(gd->gd_p == 1, ("gate descriptor for vector %d not present", + vector)); + KASSERT(gd->gd_type == SDT_SYSIGT, ("gate descriptor for vector %d " + "has invalid type %d", vector, gd->gd_type)); + KASSERT(gd->gd_dpl == SEL_KPL, ("gate descriptor for vector %d " + "has invalid dpl %d", vector, gd->gd_dpl)); + KASSERT(gd->gd_selector == GSEL(GCODE_SEL, SEL_KPL), ("gate descriptor " + "for vector %d has invalid selector %d", vector, gd->gd_selector)); + KASSERT(gd->gd_ist == 0, ("gate descriptor for vector %d has invalid " + "IST %d", vector, gd->gd_ist)); + + func = ((long)gd->gd_hioffset << 16 | gd->gd_looffset); + vmx_call_isr(func); +} + static int vmx_setup_cr_shadow(int which, struct vmcs *vmcs, uint32_t initial) { @@ -676,6 +781,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) uint16_t vpid[VM_MAXCPU]; int i, error, guest_msr_count; struct vmx *vmx; + struct vmcs *vmcs; vmx = malloc(sizeof(struct vmx), M_VMX, M_WAITOK | M_ZERO); if ((uintptr_t)vmx & PAGE_MASK) { @@ -740,27 +846,52 @@ vmx_vminit(struct vm *vm, pmap_t pmap) vpid_alloc(vpid, VM_MAXCPU); + if (virtual_interrupt_delivery) { + error = vm_map_mmio(vm, DEFAULT_APIC_BASE, PAGE_SIZE, + APIC_ACCESS_ADDRESS); + /* XXX this should really return an error to the caller */ + KASSERT(error == 0, ("vm_map_mmio(apicbase) error %d", error)); + } + for (i = 0; i < VM_MAXCPU; i++) { - vmx->vmcs[i].identifier = vmx_revision(); - error = vmclear(&vmx->vmcs[i]); + vmcs = &vmx->vmcs[i]; + vmcs->identifier = vmx_revision(); + error = vmclear(vmcs); if (error != 0) { panic("vmx_vminit: vmclear error %d on vcpu %d\n", error, i); } - error = vmcs_set_defaults(&vmx->vmcs[i], - (u_long)vmx_exit_guest, - (u_long)&vmx->ctx[i], - vmx->eptp, - pinbased_ctls, - procbased_ctls, - procbased_ctls2, - exit_ctls, entry_ctls, - vtophys(vmx->msr_bitmap), - vpid[i]); + error = vmcs_init(vmcs); + KASSERT(error == 0, ("vmcs_init error %d", error)); - if (error != 0) - panic("vmx_vminit: vmcs_set_defaults error %d", error); + VMPTRLD(vmcs); + error = 0; + error += vmwrite(VMCS_HOST_RSP, (u_long)&vmx->ctx[i]); + error += vmwrite(VMCS_EPTP, vmx->eptp); + error += vmwrite(VMCS_PIN_BASED_CTLS, pinbased_ctls); + error += vmwrite(VMCS_PRI_PROC_BASED_CTLS, procbased_ctls); + error += vmwrite(VMCS_SEC_PROC_BASED_CTLS, procbased_ctls2); + error += vmwrite(VMCS_EXIT_CTLS, exit_ctls); + error += vmwrite(VMCS_ENTRY_CTLS, entry_ctls); + error += vmwrite(VMCS_MSR_BITMAP, vtophys(vmx->msr_bitmap)); + error += vmwrite(VMCS_VPID, vpid[i]); + if (virtual_interrupt_delivery) { + error += vmwrite(VMCS_APIC_ACCESS, APIC_ACCESS_ADDRESS); + error += vmwrite(VMCS_VIRTUAL_APIC, + vtophys(&vmx->apic_page[i])); + error += vmwrite(VMCS_EOI_EXIT0, 0); + error += vmwrite(VMCS_EOI_EXIT1, 0); + error += vmwrite(VMCS_EOI_EXIT2, 0); + error += vmwrite(VMCS_EOI_EXIT3, 0); + } + if (posted_interrupts) { + error += vmwrite(VMCS_PIR_VECTOR, pirvec); + error += vmwrite(VMCS_PIR_DESC, + vtophys(&vmx->pir_desc[i])); + } + VMCLEAR(vmcs); + KASSERT(error == 0, ("vmx_vminit: error customizing the vmcs")); vmx->cap[i].set = 0; vmx->cap[i].proc_ctls = procbased_ctls; @@ -771,9 +902,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) msr_save_area_init(vmx->guest_msrs[i], &guest_msr_count); - error = vmcs_set_msr_save(&vmx->vmcs[i], - vtophys(vmx->guest_msrs[i]), - guest_msr_count); + error = vmcs_set_msr_save(vmcs, vtophys(vmx->guest_msrs[i]), + guest_msr_count); if (error != 0) panic("vmcs_set_msr_save error %d", error); @@ -783,16 +913,15 @@ vmx_vminit(struct vm *vm, pmap_t pmap) * CR0 - 0x60000010 * CR4 - 0 */ - error = vmx_setup_cr0_shadow(&vmx->vmcs[i], 0x60000010); + error = vmx_setup_cr0_shadow(vmcs, 0x60000010); if (error != 0) panic("vmx_setup_cr0_shadow %d", error); - error = vmx_setup_cr4_shadow(&vmx->vmcs[i], 0); + error = vmx_setup_cr4_shadow(vmcs, 0); if (error != 0) panic("vmx_setup_cr4_shadow %d", error); vmx->ctx[i].pmap = pmap; - vmx->ctx[i].eptp = vmx->eptp; } return (vmx); @@ -840,20 +969,20 @@ vmx_astpending_trace(struct vmx *vmx, in #endif } +static VMM_STAT_INTEL(VCPU_INVVPID_SAVED, "Number of vpid invalidations saved"); + static void -vmx_set_pcpu_defaults(struct vmx *vmx, int vcpu) +vmx_set_pcpu_defaults(struct vmx *vmx, int vcpu, pmap_t pmap) { - int lastcpu; struct vmxstate *vmxstate; - struct invvpid_desc invvpid_desc = { 0 }; + struct invvpid_desc invvpid_desc; vmxstate = &vmx->state[vcpu]; - lastcpu = vmxstate->lastcpu; - vmxstate->lastcpu = curcpu; - - if (lastcpu == curcpu) + if (vmxstate->lastcpu == curcpu) return; + vmxstate->lastcpu = curcpu; + vmm_stat_incr(vmx->vm, vcpu, VCPU_MIGRATIONS, 1); vmcs_write(VMCS_HOST_TR_BASE, vmm_get_host_trbase()); @@ -876,8 +1005,20 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i * for "all" EP4TAs. */ if (vmxstate->vpid != 0) { - invvpid_desc.vpid = vmxstate->vpid; - invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc); + if (pmap->pm_eptgen == vmx->eptgen[curcpu]) { + invvpid_desc._res1 = 0; + invvpid_desc._res2 = 0; + invvpid_desc.vpid = vmxstate->vpid; + invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc); + } else { + /* + * The invvpid can be skipped if an invept is going to + * be performed before entering the guest. The invept + * will invalidate combined mappings tagged with + * 'vmx->eptp' for all vpids. + */ + vmm_stat_incr(vmx->vm, vcpu, VCPU_INVVPID_SAVED, 1); + } } } @@ -935,7 +1076,7 @@ vmx_inject_nmi(struct vmx *vmx, int vcpu * Inject the virtual NMI. The vector must be the NMI IDT entry * or the VMCS entry check will fail. */ - info = VMCS_INTERRUPTION_INFO_NMI | VMCS_INTERRUPTION_INFO_VALID; + info = VMCS_INTR_INFO_NMI | VMCS_INTR_INFO_VALID; info |= IDT_NMI; vmcs_write(VMCS_ENTRY_INTR_INFO, info); @@ -957,7 +1098,7 @@ nmiblocked: } static void -vmx_inject_interrupts(struct vmx *vmx, int vcpu) +vmx_inject_interrupts(struct vmx *vmx, int vcpu, struct vlapic *vlapic) { int vector; uint64_t info, rflags, interruptibility; @@ -973,7 +1114,7 @@ vmx_inject_interrupts(struct vmx *vmx, i * because of a pending AST. */ info = vmcs_read(VMCS_ENTRY_INTR_INFO); - if (info & VMCS_INTERRUPTION_INFO_VALID) + if (info & VMCS_INTR_INFO_VALID) return; /* @@ -982,9 +1123,13 @@ vmx_inject_interrupts(struct vmx *vmx, i if (vmx_inject_nmi(vmx, vcpu)) return; + if (virtual_interrupt_delivery) { + vmx_inject_pir(vlapic); + return; + } + /* Ask the local apic for a vector to inject */ - vector = lapic_pending_intr(vmx->vm, vcpu); - if (vector < 0) + if (!vlapic_pending_intr(vlapic, &vector)) return; if (vector < 32 || vector > 255) @@ -1000,12 +1145,12 @@ vmx_inject_interrupts(struct vmx *vmx, i goto cantinject; /* Inject the interrupt */ - info = VMCS_INTERRUPTION_INFO_HW_INTR | VMCS_INTERRUPTION_INFO_VALID; + info = VMCS_INTR_INFO_HW_INTR | VMCS_INTR_INFO_VALID; info |= vector; vmcs_write(VMCS_ENTRY_INTR_INFO, info); /* Update the Local APIC ISR */ - lapic_intr_accepted(vmx->vm, vcpu, vector); + vlapic_intr_accepted(vlapic, vector); VCPU_CTR1(vmx->vm, vcpu, "Injecting hwintr at vector %d", vector); @@ -1175,11 +1320,141 @@ ept_emulation_fault(uint64_t ept_qual) } static int +vmx_handle_apic_write(struct vlapic *vlapic, uint64_t qual) +{ + int error, handled, offset; + bool retu; + + if (!virtual_interrupt_delivery) + return (UNHANDLED); + + handled = 1; + offset = APIC_WRITE_OFFSET(qual); + switch (offset) { + case APIC_OFFSET_ID: + vlapic_id_write_handler(vlapic); + break; + case APIC_OFFSET_LDR: + vlapic_ldr_write_handler(vlapic); + break; + case APIC_OFFSET_DFR: + vlapic_dfr_write_handler(vlapic); + break; + case APIC_OFFSET_SVR: + vlapic_svr_write_handler(vlapic); + break; + case APIC_OFFSET_ESR: + vlapic_esr_write_handler(vlapic); + break; + case APIC_OFFSET_ICR_LOW: + retu = false; + error = vlapic_icrlo_write_handler(vlapic, &retu); + if (error != 0 || retu) + handled = 0; + break; + case APIC_OFFSET_CMCI_LVT: + case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: + vlapic_lvt_write_handler(vlapic, offset); + break; + case APIC_OFFSET_TIMER_ICR: + vlapic_icrtmr_write_handler(vlapic); + break; + case APIC_OFFSET_TIMER_DCR: + vlapic_dcr_write_handler(vlapic); + break; + default: + handled = 0; + break; + } + return (handled); +} + +static bool +apic_access_fault(uint64_t gpa) +{ + + if (virtual_interrupt_delivery && + (gpa >= DEFAULT_APIC_BASE && gpa < DEFAULT_APIC_BASE + PAGE_SIZE)) + return (true); + else + return (false); +} + +static int +vmx_handle_apic_access(struct vmx *vmx, int vcpuid, struct vm_exit *vmexit) +{ + uint64_t qual; + int access_type, offset, allowed; + + if (!virtual_interrupt_delivery) + return (UNHANDLED); + + qual = vmexit->u.vmx.exit_qualification; + access_type = APIC_ACCESS_TYPE(qual); + offset = APIC_ACCESS_OFFSET(qual); + + allowed = 0; + if (access_type == 0) { + /* + * Read data access to the following registers is expected. + */ + switch (offset) { + case APIC_OFFSET_APR: + case APIC_OFFSET_PPR: + case APIC_OFFSET_RRR: + case APIC_OFFSET_CMCI_LVT: + case APIC_OFFSET_TIMER_CCR: + allowed = 1; + break; + default: + break; + } + } else if (access_type == 1) { + /* + * Write data access to the following registers is expected. + */ + switch (offset) { + case APIC_OFFSET_VER: + case APIC_OFFSET_APR: + case APIC_OFFSET_PPR: + case APIC_OFFSET_RRR: + case APIC_OFFSET_ISR0 ... APIC_OFFSET_ISR7: + case APIC_OFFSET_TMR0 ... APIC_OFFSET_TMR7: + case APIC_OFFSET_IRR0 ... APIC_OFFSET_IRR7: + case APIC_OFFSET_CMCI_LVT: + case APIC_OFFSET_TIMER_CCR: + allowed = 1; + break; + default: + break; + } + } + + if (allowed) { + vmexit->exitcode = VM_EXITCODE_INST_EMUL; + vmexit->u.inst_emul.gpa = DEFAULT_APIC_BASE + offset; + vmexit->u.inst_emul.gla = VIE_INVALID_GLA; + vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); + } + + /* + * Regardless of whether the APIC-access is allowed this handler + * always returns UNHANDLED: + * - if the access is allowed then it is handled by emulating the + * instruction that caused the VM-exit (outside the critical section) + * - if the access is not allowed then it will be converted to an + * exitcode of VM_EXITCODE_VMX and will be dealt with in userland. + */ + return (UNHANDLED); +} + +static int vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) { int error, handled; struct vmxctx *vmxctx; - uint32_t eax, ecx, edx, idtvec_info, idtvec_err, reason; + struct vlapic *vlapic; + uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, reason; uint64_t qual, gpa; bool retu; @@ -1203,7 +1478,7 @@ vmx_exit_process(struct vmx *vmx, int vc switch (reason) { case EXIT_REASON_EPT_FAULT: case EXIT_REASON_EPT_MISCONFIG: - case EXIT_REASON_APIC: + case EXIT_REASON_APIC_ACCESS: case EXIT_REASON_TASK_SWITCH: case EXIT_REASON_EXCEPTION: idtvec_info = vmcs_idt_vectoring_info(); @@ -1290,6 +1565,11 @@ vmx_exit_process(struct vmx *vmx, int vc * host interrupt handler in the VM's softc. We will inject * this virtual interrupt during the subsequent VM enter. */ + intr_info = vmcs_read(VMCS_EXIT_INTR_INFO); + KASSERT((intr_info & VMCS_INTR_INFO_VALID) != 0 && + VMCS_INTR_INFO_TYPE(intr_info) == 0, + ("VM exit interruption info invalid: %#x", intr_info)); + vmx_trigger_hostintr(intr_info & 0xff); /* * This is special. We want to treat this as an 'handled' @@ -1318,24 +1598,42 @@ vmx_exit_process(struct vmx *vmx, int vc handled = vmx_handle_cpuid(vmx->vm, vcpu, vmxctx); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 19:16:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AEFDA37B; Sat, 17 May 2014 19:16: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 9BC1A2F3B; Sat, 17 May 2014 19:16: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 s4HJGjiR027350; Sat, 17 May 2014 19:16:45 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HJGjGg027349; Sat, 17 May 2014 19:16:45 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405171916.s4HJGjGg027349@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 17 May 2014 19:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266340 - stable/10/sys/boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 19:16:45 -0000 Author: loos Date: Sat May 17 19:16:45 2014 New Revision: 266340 URL: http://svnweb.freebsd.org/changeset/base/266340 Log: MFC r265013 Revert r258678. Make the led gpio-specifier match again the #gpio-cells settings from the GPIO controller, which i had broken in r258678. Restore the active-low flag. Modified: stable/10/sys/boot/fdt/dts/arm/rpi.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/arm/rpi.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/rpi.dts Sat May 17 19:11:08 2014 (r266339) +++ stable/10/sys/boot/fdt/dts/arm/rpi.dts Sat May 17 19:16:45 2014 (r266340) @@ -316,7 +316,7 @@ ok { label = "ok"; - gpios = <&gpio 16 2 0>; + gpios = <&gpio 16 1>; /* Don't change this - it configures * how the led driver determines if From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 19:37:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 40814802; Sat, 17 May 2014 19:37:08 +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 2944E20A8; Sat, 17 May 2014 19:37:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HJb8Uf039560; Sat, 17 May 2014 19:37:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HJb5HD039538; Sat, 17 May 2014 19:37:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405171937.s4HJb5HD039538@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 19:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266341 - in stable/10/sys: arm/arm arm/conf arm/include arm/samsung/exynos boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 19:37:08 -0000 Author: ian Date: Sat May 17 19:37:04 2014 New Revision: 266341 URL: http://svnweb.freebsd.org/changeset/base/266341 Log: MFC 263910, 263913, 263914, 263933, 263934, 263935, 263936, 263981, 263982, Add more flags for the fpexc register from the ARM1176JZF-S Manual Initialise fpscr to a sane value when we create the pcb. This sets NaNs to be the default NaN and for denormalised numbers to be flushed to zero. VFP fixes/cleanups for ARM11: * Save the required VFP registers on context switch. If the exception bit is set we need to save and restore the FPINST register, and if the fp2v bit is also set we need to save and restore FPINST2. * Move saving and restoring the floating point control registers to C. * Clear the fpexc exception and fp2v flags on a floating-point exception. * Signal a SIGFPE if the fpexc exception flag is set on an undefined instruction. This is how the ARM core signals to software there is a floating-point exception. Add Cortex-A15 cpu id revisions. Exynos/Arndale... - Merge SoC-common parts - Enable iicbus device - Directly call kmem_alloc_contig to allocate framebuffer memory and pass VM_MEMATTR_UNCACHEABLE (no-cache, no-buffer). This fixes screen refreshing problem when data is updated too slowly. - Add support for keyboard used in Samsung Chromebook (ARM machine) Support covers device drivers for: - Interrupt Combiner - gpio/pad, External Interrupts Controller (pad) - I2C Interface - Chrome Embedded Controller - Chrome Keyboard - Use new gpio dev class in EHCI driver - Expand device tree information - Release i2c bus on detach. Added: stable/10/sys/arm/conf/CHROMEBOOK.hints - copied unchanged from r263936, head/sys/arm/conf/CHROMEBOOK.hints stable/10/sys/arm/conf/EXYNOS5250.common - copied unchanged from r263935, head/sys/arm/conf/EXYNOS5250.common stable/10/sys/arm/samsung/exynos/chrome_ec.c - copied, changed from r263936, head/sys/arm/samsung/exynos/chrome_ec.c stable/10/sys/arm/samsung/exynos/chrome_ec.h - copied unchanged from r263936, head/sys/arm/samsung/exynos/chrome_ec.h stable/10/sys/arm/samsung/exynos/chrome_kb.c - copied unchanged from r263936, head/sys/arm/samsung/exynos/chrome_kb.c stable/10/sys/arm/samsung/exynos/chrome_kb.h - copied unchanged from r263936, head/sys/arm/samsung/exynos/chrome_kb.h stable/10/sys/arm/samsung/exynos/exynos5_combiner.c - copied unchanged from r263936, head/sys/arm/samsung/exynos/exynos5_combiner.c stable/10/sys/arm/samsung/exynos/exynos5_combiner.h - copied unchanged from r263936, head/sys/arm/samsung/exynos/exynos5_combiner.h stable/10/sys/arm/samsung/exynos/exynos5_i2c.c - copied unchanged from r263936, head/sys/arm/samsung/exynos/exynos5_i2c.c stable/10/sys/arm/samsung/exynos/exynos5_pad.c - copied unchanged from r263936, head/sys/arm/samsung/exynos/exynos5_pad.c stable/10/sys/arm/samsung/exynos/exynos5_pad.h - copied unchanged from r263936, head/sys/arm/samsung/exynos/exynos5_pad.h Modified: stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/identcpu.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/vfp.c stable/10/sys/arm/arm/vm_machdep.c stable/10/sys/arm/conf/ARNDALE stable/10/sys/arm/conf/CHROMEBOOK stable/10/sys/arm/include/armreg.h stable/10/sys/arm/include/fp.h stable/10/sys/arm/include/vfp.h stable/10/sys/arm/samsung/exynos/exynos5_ehci.c stable/10/sys/arm/samsung/exynos/exynos5_fimd.c stable/10/sys/arm/samsung/exynos/files.exynos5 stable/10/sys/boot/fdt/dts/arm/exynos5250-arndale.dts stable/10/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc.c ============================================================================== --- stable/10/sys/arm/arm/cpufunc.c Sat May 17 19:16:45 2014 (r266340) +++ stable/10/sys/arm/arm/cpufunc.c Sat May 17 19:37:04 2014 (r266341) @@ -1055,7 +1055,10 @@ set_cpufuncs() cputype == CPU_ID_CORTEXA9R1 || cputype == CPU_ID_CORTEXA9R2 || cputype == CPU_ID_CORTEXA9R3 || - cputype == CPU_ID_CORTEXA15 || + cputype == CPU_ID_CORTEXA15R0 || + cputype == CPU_ID_CORTEXA15R1 || + cputype == CPU_ID_CORTEXA15R2 || + cputype == CPU_ID_CORTEXA15R3 || cputype == CPU_ID_KRAIT ) { cpufuncs = cortexa_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ Modified: stable/10/sys/arm/arm/identcpu.c ============================================================================== --- stable/10/sys/arm/arm/identcpu.c Sat May 17 19:16:45 2014 (r266340) +++ stable/10/sys/arm/arm/identcpu.c Sat May 17 19:37:04 2014 (r266341) @@ -183,7 +183,13 @@ const struct cpuidtab cpuids[] = { generic_steppings }, { CPU_ID_CORTEXA9R3, CPU_CLASS_CORTEXA, "Cortex A9-r3", generic_steppings }, - { CPU_ID_CORTEXA15, CPU_CLASS_CORTEXA, "Cortex A15", + { CPU_ID_CORTEXA15R0, CPU_CLASS_CORTEXA, "Cortex A15-r0", + generic_steppings }, + { CPU_ID_CORTEXA15R1, CPU_CLASS_CORTEXA, "Cortex A15-r1", + generic_steppings }, + { CPU_ID_CORTEXA15R2, CPU_CLASS_CORTEXA, "Cortex A15-r2", + generic_steppings }, + { CPU_ID_CORTEXA15R3, CPU_CLASS_CORTEXA, "Cortex A15-r3", generic_steppings }, { CPU_ID_KRAIT, CPU_CLASS_KRAIT, "Krait", generic_steppings }, Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Sat May 17 19:16:45 2014 (r266340) +++ stable/10/sys/arm/arm/machdep.c Sat May 17 19:37:04 2014 (r266341) @@ -101,6 +101,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -990,6 +991,7 @@ init_proc0(vm_offset_t kstack) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; thread0.td_pcb->pcb_flags = 0; thread0.td_pcb->pcb_vfpcpu = -1; + thread0.td_pcb->pcb_vfpstate.fpscr = VFPSCR_DN | VFPSCR_FZ; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; } Modified: stable/10/sys/arm/arm/vfp.c ============================================================================== --- stable/10/sys/arm/arm/vfp.c Sat May 17 19:16:45 2014 (r266340) +++ stable/10/sys/arm/arm/vfp.c Sat May 17 19:37:04 2014 (r266341) @@ -149,6 +149,7 @@ vfp_bounce(u_int addr, u_int insn, struc { u_int cpu, fpexc; struct pcb *curpcb; + ksiginfo_t ksi; if ((code & FAULT_USER) == 0) panic("undefined floating point instruction in supervisor mode"); @@ -162,9 +163,27 @@ vfp_bounce(u_int addr, u_int insn, struc */ fpexc = fmrx(VFPEXC); if (fpexc & VFPEXC_EN) { + /* Clear any exceptions */ + fmxr(VFPEXC, fpexc & ~(VFPEXC_EX | VFPEXC_FP2V)); + /* kill the process - we do not handle emulation */ critical_exit(); - killproc(curthread->td_proc, "vfp emulation"); + + if (fpexc & VFPEXC_EX) { + /* We have an exception, signal a SIGFPE */ + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGFPE; + if (fpexc & VFPEXC_UFC) + ksi.ksi_code = FPE_FLTUND; + else if (fpexc & VFPEXC_OFC) + ksi.ksi_code = FPE_FLTOVF; + else if (fpexc & VFPEXC_IOC) + ksi.ksi_code = FPE_FLTINV; + ksi.ksi_addr = (void *)addr; + trapsignal(curthread, &ksi); + return 0; + } + return 1; } @@ -192,15 +211,24 @@ vfp_bounce(u_int addr, u_int insn, struc static void vfp_restore(struct vfp_state *vfpsave) { - u_int vfpscr = 0; + uint32_t fpexc; + + /* On VFPv2 we may need to restore FPINST and FPINST2 */ + fpexc = vfpsave->fpexec; + if (fpexc & VFPEXC_EX) { + fmxr(VFPINST, vfpsave->fpinst); + if (fpexc & VFPEXC_FP2V) + fmxr(VFPINST2, vfpsave->fpinst2); + } + fmxr(VFPSCR, vfpsave->fpscr); - __asm __volatile("ldc p10, c0, [%1], #128\n" /* d0-d15 */ - "cmp %2, #0\n" /* -D16 or -D32? */ - LDCLNE "p11, c0, [%1], #128\n" /* d16-d31 */ - "addeq %1, %1, #128\n" /* skip missing regs */ - "ldr %0, [%1]\n" /* set old vfpscr */ - "mcr p10, 7, %0, cr1, c0, 0\n" - : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); + __asm __volatile("ldc p10, c0, [%0], #128\n" /* d0-d15 */ + "cmp %1, #0\n" /* -D16 or -D32? */ + LDCLNE "p11, c0, [%0], #128\n" /* d16-d31 */ + "addeq %0, %0, #128\n" /* skip missing regs */ + : : "r" (vfpsave), "r" (is_d32) : "cc"); + + fmxr(VFPEXC, fpexc); } /* @@ -211,20 +239,30 @@ vfp_restore(struct vfp_state *vfpsave) void vfp_store(struct vfp_state *vfpsave, boolean_t disable_vfp) { - u_int tmp, vfpscr; + uint32_t fpexc; + + fpexc = fmrx(VFPEXC); /* Is the vfp enabled? */ + if (fpexc & VFPEXC_EN) { + vfpsave->fpexec = fpexc; + vfpsave->fpscr = fmrx(VFPSCR); + + /* On VFPv2 we may need to save FPINST and FPINST2 */ + if (fpexc & VFPEXC_EX) { + vfpsave->fpinst = fmrx(VFPINST); + if (fpexc & VFPEXC_FP2V) + vfpsave->fpinst2 = fmrx(VFPINST2); + fpexc &= ~VFPEXC_EX; + } - tmp = fmrx(VFPEXC); /* Is the vfp enabled? */ - if (tmp & VFPEXC_EN) { __asm __volatile( - "stc p11, c0, [%1], #128\n" /* d0-d15 */ - "cmp %2, #0\n" /* -D16 or -D32? */ - STCLNE "p11, c0, [%1], #128\n" /* d16-d31 */ - "addeq %1, %1, #128\n" /* skip missing regs */ - "mrc p10, 7, %0, cr1, c0, 0\n" /* fmxr(VFPSCR) */ - "str %0, [%1]\n" /* save vfpscr */ - : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); + "stc p11, c0, [%0], #128\n" /* d0-d15 */ + "cmp %1, #0\n" /* -D16 or -D32? */ + STCLNE "p11, c0, [%0], #128\n" /* d16-d31 */ + "addeq %0, %0, #128\n" /* skip missing regs */ + : : "r" (vfpsave), "r" (is_d32) : "cc"); + if (disable_vfp) - fmxr(VFPEXC , tmp & ~VFPEXC_EN); + fmxr(VFPEXC , fpexc & ~VFPEXC_EN); } } Modified: stable/10/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/10/sys/arm/arm/vm_machdep.c Sat May 17 19:16:45 2014 (r266340) +++ stable/10/sys/arm/arm/vm_machdep.c Sat May 17 19:37:04 2014 (r266341) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* * struct switchframe and trapframe must both be a multiple of 8 @@ -147,6 +148,7 @@ cpu_fork(register struct thread *td1, re pcb2->un_32.pcb32_sp = td2->td_kstack + USPACE_SVC_STACK_TOP - sizeof(*pcb2); pcb2->pcb_vfpcpu = -1; + pcb2->pcb_vfpstate.fpscr = VFPSCR_DN | VFPSCR_FZ; pmap_activate(td2); td2->td_frame = tf = (struct trapframe *)STACKALIGN( pcb2->un_32.pcb32_sp - sizeof(struct trapframe)); Modified: stable/10/sys/arm/conf/ARNDALE ============================================================================== --- stable/10/sys/arm/conf/ARNDALE Sat May 17 19:16:45 2014 (r266340) +++ stable/10/sys/arm/conf/ARNDALE Sat May 17 19:37:04 2014 (r266341) @@ -17,122 +17,9 @@ # # $FreeBSD$ +include "EXYNOS5250.common" ident ARNDALE -include "../samsung/exynos/std.exynos5" - -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror" - -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER -options VFP # vfp/neon - -# Debugging -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - -# NFS support -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT - -# Uncomment this for NFS root -#options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=cpsw0 - -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards -device sdhci # generic sdhci - -options ROOTDEVNAME=\"ufs:/dev/da0\" - -#options SMP - -# Pseudo devices - -device loop -device random -device pty -device md -device gpio - -# USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE -#device musb -device ehci -#device ohci - -device umass -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) -device pass - -# SATA -#device ata -#device atadisk -#device mvs - -# Serial ports -device uart - -# I2C (TWSI) -#device iic -#device iicbus - -# Ethernet -device ether -device mii -device smsc -device smscphy - -# USB ethernet support, requires miibus -device miibus -device axe # ASIX Electronics USB Ethernet -device bpf # Berkeley packet filter - #FDT options FDT options FDT_DTB_STATIC Modified: stable/10/sys/arm/conf/CHROMEBOOK ============================================================================== --- stable/10/sys/arm/conf/CHROMEBOOK Sat May 17 19:16:45 2014 (r266340) +++ stable/10/sys/arm/conf/CHROMEBOOK Sat May 17 19:37:04 2014 (r266341) @@ -17,106 +17,13 @@ # # $FreeBSD$ +include "EXYNOS5250.common" ident CHROMEBOOK -include "../samsung/exynos/std.exynos5" +hints "CHROMEBOOK.hints" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror" - -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER -options VFP # vfp/neon - -# Debugging -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - -# NFS support -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT - -# Uncomment this for NFS root -#options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=cpsw0 - -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards -device sdhci # generic sdhci - -options ROOTDEVNAME=\"ufs:/dev/da0\" - -#options SMP - -# Pseudo devices - -device loop -device random -device pty -device md -device gpio - -# USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE -#device musb -device ehci -#device ohci - -device umass -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) -device pass - -# SATA -#device ata -#device atadisk -#device mvs - -# Serial ports -device uart +device chrome_ec # Chrome Embedded Controller +device chrome_kb # Chrome Keyboard # Framebuffer device vt @@ -125,21 +32,6 @@ options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp437 device ukbd -# I2C (TWSI) -#device iic -#device iicbus - -# Ethernet -device ether -device mii -device smsc -device smscphy - -# USB ethernet support, requires miibus -device miibus -device axe # ASIX Electronics USB Ethernet -device bpf # Berkeley packet filter - #FDT options FDT options FDT_DTB_STATIC Copied: stable/10/sys/arm/conf/CHROMEBOOK.hints (from r263936, head/sys/arm/conf/CHROMEBOOK.hints) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/CHROMEBOOK.hints Sat May 17 19:37:04 2014 (r266341, copy of r263936, head/sys/arm/conf/CHROMEBOOK.hints) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# Chrome Embedded Controller +hint.chrome_ec.0.at="iicbus0" +hint.chrome_ec.0.addr=0x1e Copied: stable/10/sys/arm/conf/EXYNOS5250.common (from r263935, head/sys/arm/conf/EXYNOS5250.common) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/EXYNOS5250.common Sat May 17 19:37:04 2014 (r266341, copy of r263935, head/sys/arm/conf/EXYNOS5250.common) @@ -0,0 +1,132 @@ +# Kernel configuration for Samsung Exynos 5250 boards. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "../samsung/exynos/std.exynos5" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB +options DDB # Enable the kernel debugger +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +# NFS support +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT + +# Uncomment this for NFS root +#options NFS_ROOT # NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ue0 + +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci + +options ROOTDEVNAME=\"ufs:/dev/da0\" + +#options SMP + +# Pseudo devices + +device loop +device random +device pty +device md +device gpio + +# USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +#device musb +device ehci +#device ohci + +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# SATA +#device ata +#device atadisk +#device mvs + +# Serial ports +device uart + +# I2C (TWSI) +device iic +device iicbus + +# Ethernet +device ether +device mii +device smsc +device smscphy + +# USB ethernet support, requires miibus +device miibus +device axe # ASIX Electronics USB Ethernet +device bpf # Berkeley packet filter Modified: stable/10/sys/arm/include/armreg.h ============================================================================== --- stable/10/sys/arm/include/armreg.h Sat May 17 19:16:45 2014 (r266340) +++ stable/10/sys/arm/include/armreg.h Sat May 17 19:37:04 2014 (r266341) @@ -122,7 +122,10 @@ #define CPU_ID_CORTEXA9R1 0x411fc090 #define CPU_ID_CORTEXA9R2 0x412fc090 #define CPU_ID_CORTEXA9R3 0x413fc090 -#define CPU_ID_CORTEXA15 0x410fc0f0 +#define CPU_ID_CORTEXA15R0 0x410fc0f0 +#define CPU_ID_CORTEXA15R1 0x411fc0f0 +#define CPU_ID_CORTEXA15R2 0x412fc0f0 +#define CPU_ID_CORTEXA15R3 0x413fc0f0 #define CPU_ID_KRAIT 0x510f06f0 /* Snapdragon S4 Pro/APQ8064 */ #define CPU_ID_TI925T 0x54029250 #define CPU_ID_MV88FR131 0x56251310 /* Marvell Feroceon 88FR131 Core */ Modified: stable/10/sys/arm/include/fp.h ============================================================================== --- stable/10/sys/arm/include/fp.h Sat May 17 19:16:45 2014 (r266340) +++ stable/10/sys/arm/include/fp.h Sat May 17 19:37:04 2014 (r266341) @@ -69,6 +69,9 @@ typedef struct fp_extended_precision fp_ struct vfp_state { u_int64_t reg[32]; u_int32_t fpscr; + u_int32_t fpexec; + u_int32_t fpinst; + u_int32_t fpinst2; }; /* Modified: stable/10/sys/arm/include/vfp.h ============================================================================== --- stable/10/sys/arm/include/vfp.h Sat May 17 19:16:45 2014 (r266340) +++ stable/10/sys/arm/include/vfp.h Sat May 17 19:37:04 2014 (r266341) @@ -92,6 +92,11 @@ /* VFPEXC */ #define VFPEXC_EX (0x80000000) /* exception v1 v2 */ #define VFPEXC_EN (0x40000000) /* vfp enable */ +#define VFPEXC_FP2V (0x10000000) /* FPINST2 valid */ +#define VFPEXC_INV (0x00000080) /* Input exception */ +#define VFPEXC_UFC (0x00000008) /* Underflow exception */ +#define VFPEXC_OFC (0x00000004) /* Overflow exception */ +#define VFPEXC_IOC (0x00000001) /* Invlaid operation */ /* version 3 registers */ /* VMVFR0 */ Copied and modified: stable/10/sys/arm/samsung/exynos/chrome_ec.c (from r263936, head/sys/arm/samsung/exynos/chrome_ec.c) ============================================================================== --- head/sys/arm/samsung/exynos/chrome_ec.c Sun Mar 30 15:22:36 2014 (r263936, copy source) +++ stable/10/sys/arm/samsung/exynos/chrome_ec.c Sat May 17 19:37:04 2014 (r266341) @@ -234,9 +234,22 @@ ec_attach(device_t dev) return (0); } +static int +ec_detach(device_t dev) +{ + struct ec_softc *sc; + + sc = device_get_softc(dev); + + bus_release(sc); + + return (0); +} + static device_method_t ec_methods[] = { DEVMETHOD(device_probe, ec_probe), DEVMETHOD(device_attach, ec_attach), + DEVMETHOD(device_detach, ec_detach), { 0, 0 } }; Copied: stable/10/sys/arm/samsung/exynos/chrome_ec.h (from r263936, head/sys/arm/samsung/exynos/chrome_ec.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/samsung/exynos/chrome_ec.h Sat May 17 19:37:04 2014 (r266341, copy of r263936, head/sys/arm/samsung/exynos/chrome_ec.h) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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$ + */ + +#define EC_CMD_HELLO 0x01 +#define EC_CMD_GET_VERSION 0x02 +#define EC_CMD_MKBP_STATE 0x60 +#define EC_CMD_VERSION0 0xdc + +int ec_command(uint8_t cmd, uint8_t *dout, uint8_t dout_len, + uint8_t *dinp, uint8_t dinp_len); +int ec_hello(void); Copied: stable/10/sys/arm/samsung/exynos/chrome_kb.c (from r263936, head/sys/arm/samsung/exynos/chrome_kb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/samsung/exynos/chrome_kb.c Sat May 17 19:37:04 2014 (r266341, copy of r263936, head/sys/arm/samsung/exynos/chrome_kb.c) @@ -0,0 +1,792 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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. + */ + +/* + * Samsung Chromebook Keyboard + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "gpio_if.h" + +#include +#include + +#include +#include + +#define CKB_LOCK() mtx_lock(&Giant) +#define CKB_UNLOCK() mtx_unlock(&Giant) + +#ifdef INVARIANTS +/* + * Assert that the lock is held in all contexts + * where the code can be executed. + */ +#define CKB_LOCK_ASSERT() mtx_assert(&Giant, MA_OWNED) +/* + * Assert that the lock is held in the contexts + * where it really has to be so. + */ +#define CKB_CTX_LOCK_ASSERT() \ + do { \ + if (!kdb_active && panicstr == NULL) \ + mtx_assert(&Giant, MA_OWNED); \ + } while (0) +#else +#define CKB_LOCK_ASSERT() (void)0 +#define CKB_CTX_LOCK_ASSERT() (void)0 +#endif + +/* + * Define a stub keyboard driver in case one hasn't been + * compiled into the kernel + */ +#include +#include +#include + +#define CKB_NFKEY 12 +#define CKB_FLAG_COMPOSE 0x1 +#define CKB_FLAG_POLLING 0x2 +#define KBD_DRIVER_NAME "ckbd" + +/* TODO: take interrupt from DTS */ +#define KB_GPIO_INT 146 + +struct ckb_softc { + keyboard_t sc_kbd; + keymap_t sc_keymap; + accentmap_t sc_accmap; + fkeytab_t sc_fkeymap[CKB_NFKEY]; + + struct resource* sc_mem_res; + struct resource* sc_irq_res; + void* sc_intr_hl; + + int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ + int sc_state; /* shift/lock key state */ + int sc_accents; /* accent key index (> 0) */ + int sc_flags; /* flags */ + + struct callout sc_repeat_callout; + int sc_repeat_key; + int sc_repeating; + + int flag; + int rows; + int cols; + device_t dev; + struct thread *sc_poll_thread; + + uint8_t *scan_local; + uint8_t *scan; +}; + +/* prototypes */ +static void ckb_set_leds(struct ckb_softc *, uint8_t); +static int ckb_set_typematic(keyboard_t *, int); +static uint32_t ckb_read_char(keyboard_t *, int); +static void ckb_clear_state(keyboard_t *); +static int ckb_ioctl(keyboard_t *, u_long, caddr_t); +static int ckb_enable(keyboard_t *); +static int ckb_disable(keyboard_t *); + +static void +ckb_repeat(void *arg) +{ + struct ckb_softc *sc; + + sc = arg; + + if (KBD_IS_ACTIVE(&sc->sc_kbd) && KBD_IS_BUSY(&sc->sc_kbd)) { + if (sc->sc_repeat_key != -1) { + sc->sc_repeating = 1; + sc->sc_kbd.kb_callback.kc_func(&sc->sc_kbd, + KBDIO_KEYINPUT, sc->sc_kbd.kb_callback.kc_arg); + } + } +} + +/* detect a keyboard, not used */ +static int +ckb__probe(int unit, void *arg, int flags) +{ + + return (ENXIO); +} + +/* reset and initialize the device, not used */ +static int +ckb_init(int unit, keyboard_t **kbdp, void *arg, int flags) +{ + + return (ENXIO); +} + +/* test the interface to the device, not used */ +static int +ckb_test_if(keyboard_t *kbd) +{ + + return (0); +} + +/* finish using this keyboard, not used */ +static int +ckb_term(keyboard_t *kbd) +{ + + return (ENXIO); +} + +/* keyboard interrupt routine, not used */ +static int +ckb_intr(keyboard_t *kbd, void *arg) +{ + + return (0); +} + +/* lock the access to the keyboard, not used */ +static int +ckb_lock(keyboard_t *kbd, int lock) +{ + + return (1); +} + +/* clear the internal state of the keyboard */ +static void +ckb_clear_state(keyboard_t *kbd) +{ + struct ckb_softc *sc; + + sc = kbd->kb_data; + + CKB_CTX_LOCK_ASSERT(); + + sc->sc_flags &= ~(CKB_FLAG_COMPOSE | CKB_FLAG_POLLING); + sc->sc_state &= LOCK_MASK; /* preserve locking key state */ + sc->sc_accents = 0; +} + +/* save the internal state, not used */ +static int +ckb_get_state(keyboard_t *kbd, void *buf, size_t len) +{ + + return (len == 0) ? 1 : -1; +} + +/* set the internal state, not used */ +static int +ckb_set_state(keyboard_t *kbd, void *buf, size_t len) +{ + + return (EINVAL); +} + + +/* check if data is waiting */ +static int +ckb_check(keyboard_t *kbd) +{ + struct ckb_softc *sc; + int i; + + sc = kbd->kb_data; + + CKB_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + if (sc->sc_flags & CKB_FLAG_POLLING) { + return (1); + }; + + for (i = 0; i < sc->cols; i++) + if (sc->scan_local[i] != sc->scan[i]) { + return (1); + }; + + if (sc->sc_repeating) + return (1); + + return (0); +} + +/* check if char is waiting */ +static int +ckb_check_char_locked(keyboard_t *kbd) +{ + CKB_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + return (ckb_check(kbd)); +} + +static int +ckb_check_char(keyboard_t *kbd) +{ + int result; + + CKB_LOCK(); + result = ckb_check_char_locked(kbd); + CKB_UNLOCK(); + + return (result); +} + +/* read one byte from the keyboard if it's allowed */ +/* Currently unused. */ +static int +ckb_read(keyboard_t *kbd, int wait) +{ + CKB_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (-1); + + printf("Implement ME: %s\n", __func__); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 19:45:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C40D9D45; Sat, 17 May 2014 19:45: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 B097A214C; Sat, 17 May 2014 19:45: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 s4HJje2w045601; Sat, 17 May 2014 19:45:40 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HJje8L045600; Sat, 17 May 2014 19:45:40 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405171945.s4HJje8L045600@svn.freebsd.org> From: Glen Barber Date: Sat, 17 May 2014 19:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266343 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 19:45:40 -0000 Author: gjb Date: Sat May 17 19:45:40 2014 New Revision: 266343 URL: http://svnweb.freebsd.org/changeset/base/266343 Log: Document r266165, power management bug with Intel Turbo Boost. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat May 17 19:45:23 2014 (r266342) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat May 17 19:45:40 2014 (r266343) @@ -154,6 +154,11 @@ &man.mrsas.4;. + A kernel bug that inhibited proper + functionality of the dev.cpu.0.freq + &man.sysctl.8; on &intel; processors with Turbo + Boost ™ enabled has been fixed. + Virtualization support From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 20:10:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7B9B8858; Sat, 17 May 2014 20: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 662FE2303; Sat, 17 May 2014 20: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 s4HKAEN7059236; Sat, 17 May 2014 20:10:14 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HKACvq059227; Sat, 17 May 2014 20:10:12 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172010.s4HKACvq059227@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 20:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266347 - in stable/10: share/man/man9 sys/arm/arm sys/arm/ti/omap4 sys/kern sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 20:10:14 -0000 Author: ian Date: Sat May 17 20:10:12 2014 New Revision: 266347 URL: http://svnweb.freebsd.org/changeset/base/266347 Log: MFC 264019, 264041, 264048, 264049, 264050, 264051 Add support for event timers whose clock frequency can change while running. Apparently all ARM configs build kern_et.c, but only a few of them also build kern_clocksource.c, un-break the build by not referencing functions in kern_clocksource if NO_EVENTTIMERS is defined. Add variable-frequency support to the arm mpcore eventtimer driver. mpcore_timer: Disable the timer and clear any pending bit, then setup the new counter register values, then restart the timer. Also re-nest the parens properly for casting the result of converting time and frequency to a count. Added: stable/10/sys/arm/arm/mpcore_timervar.h - copied, changed from r264050, head/sys/arm/arm/mpcore_timervar.h Modified: stable/10/share/man/man9/eventtimers.9 stable/10/sys/arm/arm/mpcore_timer.c stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c stable/10/sys/kern/kern_clocksource.c stable/10/sys/kern/kern_et.c stable/10/sys/sys/systm.h stable/10/sys/sys/timeet.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/eventtimers.9 ============================================================================== --- stable/10/share/man/man9/eventtimers.9 Sat May 17 19:59:46 2014 (r266346) +++ stable/10/share/man/man9/eventtimers.9 Sat May 17 20:10:12 2014 (r266347) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2013 +.Dd April 2, 2014 .Dt EVENTTIMERS 9 .Os .Sh NAME @@ -68,6 +68,8 @@ struct eventtimer { .Fn et_register "struct eventtimer *et" .Ft int .Fn et_deregister "struct eventtimer *et" +.Ft void +.Fn et_change_frequency "struct eventtimer *et" "uint64_t newfreq" .Fn ET_LOCK .Fn ET_UNLOCK .Ft struct eventtimer * @@ -176,6 +178,21 @@ methods control timers associated with t .Pp Driver may deregister its functionality by calling .Fn et_deregister . +.Pp +If the frequency of the clock hardware can change while it is +running (for example, during power-saving modes), the driver must call +.Fn et_change_frequency +on each change. +If the given event timer is the active timer, +.Fn et_change_frequency +stops the timer on all CPUs, updates +.Va et->frequency , +then restarts the timer on all CPUs so that all +current events are rescheduled using the new frequency. +If the given timer is not currently active, +.Fn et_change_frequency +simply updates +.Va et->frequency . .Sh CONSUMER API .Fn et_find allows consumer to find available event timer, optionally matching specific Modified: stable/10/sys/arm/arm/mpcore_timer.c ============================================================================== --- stable/10/sys/arm/arm/mpcore_timer.c Sat May 17 19:59:46 2014 (r266346) +++ stable/10/sys/arm/arm/mpcore_timer.c Sat May 17 20:10:12 2014 (r266347) @@ -30,16 +30,16 @@ */ /** - * The ARM Cortex-A9 core can support a global timer plus a private and - * watchdog timer per core. This driver reserves memory and interrupt - * resources for accessing both timer register sets, these resources are - * stored globally and used to setup the timecount and eventtimer. + * The ARM Cortex-A9 core can support a global timer plus a private and + * watchdog timer per core. This driver reserves memory and interrupt + * resources for accessing both timer register sets, these resources are + * stored globally and used to setup the timecount and eventtimer. * - * The timecount timer uses the global 64-bit counter, whereas the - * per-CPU eventtimer uses the private 32-bit counters. + * The timecount timer uses the global 64-bit counter, whereas the + * per-CPU eventtimer uses the private 32-bit counters. * * - * REF: ARM Cortex-A9 MPCore, Technical Reference Manual (rev. r2p2) + * REF: ARM Cortex-A9 MPCore, Technical Reference Manual (rev. r2p2) */ #include @@ -67,6 +67,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + /* Private (per-CPU) timer register map */ #define PRV_TIMER_LOAD 0x0000 #define PRV_TIMER_COUNT 0x0004 @@ -100,7 +102,7 @@ struct arm_tmr_softc { bus_space_tag_t gbl_bst; bus_space_handle_t prv_bsh; bus_space_handle_t gbl_bsh; - uint32_t clkfreq; + uint64_t clkfreq; struct eventtimer et; }; @@ -114,7 +116,7 @@ static struct resource_spec arm_tmr_spec static struct arm_tmr_softc *arm_tmr_sc = NULL; -uint32_t platform_arm_tmr_freq = 0; +static uint64_t platform_arm_tmr_freq = 0; #define tmr_prv_read_4(reg) \ bus_space_read_4(arm_tmr_sc->prv_bst, arm_tmr_sc->prv_bsh, reg) @@ -173,6 +175,9 @@ arm_tmr_start(struct eventtimer *et, sbi uint32_t load, count; uint32_t ctrl; + tmr_prv_write_4(PRV_TIMER_CTRL, 0); + tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); + ctrl = PRV_TIMER_CTRL_IRQ_ENABLE | PRV_TIMER_CTRL_TIMER_ENABLE; if (period != 0) { @@ -182,14 +187,14 @@ arm_tmr_start(struct eventtimer *et, sbi load = 0; if (first != 0) - count = ((uint32_t)et->et_frequency * first) >> 32; + count = (uint32_t)((et->et_frequency * first) >> 32); else count = load; tmr_prv_write_4(PRV_TIMER_LOAD, load); tmr_prv_write_4(PRV_TIMER_COUNT, count); - tmr_prv_write_4(PRV_TIMER_CTRL, ctrl); + return (0); } @@ -206,6 +211,7 @@ static int arm_tmr_stop(struct eventtimer *et) { tmr_prv_write_4(PRV_TIMER_CTRL, 0); + tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); return (0); } @@ -275,24 +281,29 @@ arm_tmr_attach(device_t dev) phandle_t node; pcell_t clock; void *ihl; + boolean_t fixed_freq; if (arm_tmr_sc) return (ENXIO); - if (platform_arm_tmr_freq != 0) - sc->clkfreq = platform_arm_tmr_freq; - else { - /* Get the base clock frequency */ - node = ofw_bus_get_node(dev); - if ((OF_getprop(node, "clock-frequency", &clock, - sizeof(clock))) <= 0) { - device_printf(dev, "missing clock-frequency attribute in FDT\n"); - return (ENXIO); + if (platform_arm_tmr_freq == ARM_TMR_FREQUENCY_VARIES) { + fixed_freq = false; + } else { + fixed_freq = true; + if (platform_arm_tmr_freq != 0) { + sc->clkfreq = platform_arm_tmr_freq; + } else { + /* Get the base clock frequency */ + node = ofw_bus_get_node(dev); + if ((OF_getencprop(node, "clock-frequency", &clock, + sizeof(clock))) <= 0) { + device_printf(dev, "missing clock-frequency " + "attribute in FDT\n"); + return (ENXIO); + } } - sc->clkfreq = fdt32_to_cpu(clock); } - if (bus_alloc_resources(dev, arm_tmr_spec, sc->tmr_res)) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); @@ -312,14 +323,6 @@ arm_tmr_attach(device_t dev) tmr_prv_write_4(PRV_TIMER_CTRL, 0x00000000); tmr_gbl_write_4(GBL_TIMER_CTRL, 0x00000000); - /* Setup and enable the global timer to use as the timecounter */ - tmr_gbl_write_4(GBL_TIMER_CTRL, (0x00 << GBL_TIMER_CTR_PRESCALER_SHIFT) | - GBL_TIMER_CTRL_TIMER_ENABLE); - - arm_tmr_timecount.tc_frequency = sc->clkfreq; - tc_init(&arm_tmr_timecount); - - /* Setup and enable the timer */ if (bus_setup_intr(dev, sc->tmr_res[3], INTR_TYPE_CLK, arm_tmr_intr, NULL, sc, &ihl) != 0) { bus_release_resources(dev, arm_tmr_spec, sc->tmr_res); @@ -327,13 +330,35 @@ arm_tmr_attach(device_t dev) return (ENXIO); } + /* + * If the clock is fixed-frequency, setup and enable the global timer to + * use as the timecounter. If it's variable frequency it won't work as + * a timecounter. We also can't use it for DELAY(), so hopefully the + * platform provides its own implementation. If it doesn't, ours will + * get used, but since the frequency isn't set, it will only use the + * bogus loop counter. + */ + if (fixed_freq) { + tmr_gbl_write_4(GBL_TIMER_CTRL, GBL_TIMER_CTRL_TIMER_ENABLE); + arm_tmr_timecount.tc_frequency = sc->clkfreq; + tc_init(&arm_tmr_timecount); + } + + /* + * Setup and register the eventtimer. Most event timers set their min + * and max period values to some value calculated from the clock + * frequency. We might not know yet what our runtime clock frequency + * will be, so we just use some safe values. A max of 2 seconds ensures + * that even if our base clock frequency is 2GHz (meaning a 4GHz CPU), + * we won't overflow our 32-bit timer count register. A min of 20 + * nanoseconds is pretty much completely arbitrary. + */ sc->et.et_name = "MPCore"; sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; sc->et.et_quality = 1000; - sc->et.et_frequency = sc->clkfreq; - sc->et.et_min_period = (0x00000002LLU << 32) / sc->et.et_frequency; - sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency; + sc->et.et_min_period = 20 * SBT_1NS; + sc->et.et_max_period = 2 * SBT_1S; sc->et.et_start = arm_tmr_start; sc->et.et_stop = arm_tmr_stop; sc->et.et_priv = sc; @@ -358,6 +383,31 @@ static devclass_t arm_tmr_devclass; DRIVER_MODULE(mp_tmr, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); +/* + * Handle a change in clock frequency. The mpcore timer runs at half the CPU + * frequency. When the CPU frequency changes due to power-saving or thermal + * managment, the platform-specific code that causes the frequency change calls + * this routine to inform the clock driver, and we in turn inform the event + * timer system, which actually updates the value in et->frequency for us and + * reschedules the current event(s) in a way that's atomic with respect to + * start/stop/intr code that may be running on various CPUs at the time of the + * call. + * + * This routine can also be called by a platform's early init code. If the + * value passed is ARM_TMR_FREQUENCY_VARIES, that will cause the attach() code + * to register as an eventtimer, but not a timecounter. If the value passed in + * is any other non-zero value it is used as the fixed frequency for the timer. + */ +void +arm_tmr_change_frequency(uint64_t newfreq) +{ + + if (arm_tmr_sc == NULL) + platform_arm_tmr_freq = newfreq; + else + et_change_frequency(&arm_tmr_sc->et, newfreq); +} + /** * DELAY - Delay for at least usec microseconds. * @usec: number of microseconds to delay by @@ -377,7 +427,7 @@ arm_tmr_DELAY(int usec) uint32_t first, last; /* Check the timers are setup, if not just use a for loop for the meantime */ - if (arm_tmr_sc == NULL) { + if (arm_tmr_sc == NULL || arm_tmr_timecount.tc_frequency == 0) { for (; usec > 0; usec--) for (counts = 200; counts > 0; counts--) cpufunc_nullop(); /* Prevent gcc from optimizing Copied and modified: stable/10/sys/arm/arm/mpcore_timervar.h (from r264050, head/sys/arm/arm/mpcore_timervar.h) ============================================================================== --- head/sys/arm/arm/mpcore_timervar.h Wed Apr 2 18:43:56 2014 (r264050, copy source) +++ stable/10/sys/arm/arm/mpcore_timervar.h Sat May 17 20:10:12 2014 (r266347) @@ -42,6 +42,6 @@ * Inform the mpcore timer driver of a new clock frequency. This can be called * both before and after the mpcore timer driver attaches. */ -void arm_tmr_change_frequency(uint64_t newfreq); +void arm_tmr_change_frequency(uint64_t newfreq); #endif Modified: stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c Sat May 17 19:59:46 2014 (r266346) +++ stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c Sat May 17 20:10:12 2014 (r266347) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -85,7 +86,6 @@ __FBSDID("$FreeBSD$"); * OMAP4 devices are different from the previous OMAP3 devices in that there * is no longer a separate functional and interface clock for each module, * instead there is typically an interface clock that spans many modules. - * */ #define FREQ_96MHZ 96000000 @@ -1404,7 +1404,7 @@ omap4_prcm_attach(device_t dev) omap4_prcm_sc = sc; ti_cpu_reset = omap4_prcm_reset; omap4_clk_get_arm_fclk_freq(NULL, &freq); - platform_arm_tmr_freq = freq / 2; + arm_tmr_change_frequency(freq / 2); return (0); } Modified: stable/10/sys/kern/kern_clocksource.c ============================================================================== --- stable/10/sys/kern/kern_clocksource.c Sat May 17 19:59:46 2014 (r266346) +++ stable/10/sys/kern/kern_clocksource.c Sat May 17 20:10:12 2014 (r266347) @@ -800,6 +800,25 @@ cpu_activeclock(void) spinlock_exit(); } +/* + * Change the frequency of the given timer. This changes et->et_frequency and + * if et is the active timer it reconfigures the timer on all CPUs. This is + * intended to be a private interface for the use of et_change_frequency() only. + */ +void +cpu_et_frequency(struct eventtimer *et, uint64_t newfreq) +{ + + ET_LOCK(); + if (et == timer) { + configtimer(0); + et->et_frequency = newfreq; + configtimer(1); + } else + et->et_frequency = newfreq; + ET_UNLOCK(); +} + #ifdef KDTRACE_HOOKS void clocksource_cyc_set(const struct bintime *bt) Modified: stable/10/sys/kern/kern_et.c ============================================================================== --- stable/10/sys/kern/kern_et.c Sat May 17 19:59:46 2014 (r266346) +++ stable/10/sys/kern/kern_et.c Sat May 17 20:10:12 2014 (r266347) @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_timer.h" + SLIST_HEAD(et_eventtimers_list, eventtimer); static struct et_eventtimers_list eventtimers = SLIST_HEAD_INITIALIZER(et_eventtimers); @@ -113,6 +115,20 @@ et_deregister(struct eventtimer *et) } /* + * Change the frequency of the given timer. If it is the active timer, + * reconfigure it on all CPUs (reschedules all current events based on the new + * timer frequency). + */ +void +et_change_frequency(struct eventtimer *et, uint64_t newfreq) +{ + +#ifndef NO_EVENTTIMERS + cpu_et_frequency(et, newfreq); +#endif +} + +/* * Find free event timer hardware with specified parameters. */ struct eventtimer * Modified: stable/10/sys/sys/systm.h ============================================================================== --- stable/10/sys/sys/systm.h Sat May 17 19:59:46 2014 (r266346) +++ stable/10/sys/sys/systm.h Sat May 17 20:10:12 2014 (r266347) @@ -168,6 +168,7 @@ struct ucred; struct uio; struct _jmp_buf; struct trapframe; +struct eventtimer; int setjmp(struct _jmp_buf *) __returns_twice; void longjmp(struct _jmp_buf *, int) __dead2; @@ -286,6 +287,7 @@ void cpu_stopprofclock(void); sbintime_t cpu_idleclock(void); void cpu_activeclock(void); void cpu_new_callout(int cpu, sbintime_t bt, sbintime_t bt_opt); +void cpu_et_frequency(struct eventtimer *et, uint64_t newfreq); extern int cpu_can_deep_sleep; extern int cpu_disable_deep_sleep; Modified: stable/10/sys/sys/timeet.h ============================================================================== --- stable/10/sys/sys/timeet.h Sat May 17 19:59:46 2014 (r266346) +++ stable/10/sys/sys/timeet.h Sat May 17 20:10:12 2014 (r266347) @@ -89,6 +89,7 @@ extern struct mtx et_eventtimers_mtx; /* Driver API */ int et_register(struct eventtimer *et); int et_deregister(struct eventtimer *et); +void et_change_frequency(struct eventtimer *et, uint64_t newfreq); /* Consumer API */ struct eventtimer *et_find(const char *name, int check, int want); int et_init(struct eventtimer *et, et_event_cb_t *event, From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 20:22:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9D6E0D67; Sat, 17 May 2014 20:22: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 894C92433; Sat, 17 May 2014 20:22: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 s4HKMOH0070900; Sat, 17 May 2014 20:22:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HKMNgh070891; Sat, 17 May 2014 20:22:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172022.s4HKMNgh070891@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 20:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266348 - in stable/10/sys: arm/freescale/imx boot/fdt/dts/arm conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 20:22:24 -0000 Author: ian Date: Sat May 17 20:22:22 2014 New Revision: 266348 URL: http://svnweb.freebsd.org/changeset/base/266348 Log: MFC 264054, 264056 Switch imx6 to using the mpcore per-cpu event timers, but continue to use the GPT timer, which is fixed-frequency, as a timecounter. Change NO_EVENTTIMERS from an arm-specific to an MI option, so that it can be used in MI code. Modified: stable/10/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/freescale/imx/imx6_anatop.c stable/10/sys/arm/freescale/imx/imx6_machdep.c stable/10/sys/boot/fdt/dts/arm/imx6.dtsi stable/10/sys/conf/options stable/10/sys/conf/options.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx6 Sat May 17 20:10:12 2014 (r266347) +++ stable/10/sys/arm/freescale/imx/files.imx6 Sat May 17 20:22:22 2014 (r266348) @@ -16,6 +16,7 @@ kern/kern_clocksource.c standard arm/arm/gic.c standard arm/arm/pl310.c standard arm/freescale/imx/bus_space.c standard +arm/arm/mpcore_timer.c standard arm/freescale/fsl_ocotp.c standard arm/freescale/imx/imx6_anatop.c standard arm/freescale/imx/imx_common.c standard Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Sat May 17 20:10:12 2014 (r266347) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Sat May 17 20:22:22 2014 (r266348) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -263,6 +264,8 @@ cpufreq_set_clock(struct imx6_anatop_sof imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_BYPASS); + + arm_tmr_change_frequency(sc->cpu_curhz / 2); } static void Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_machdep.c Sat May 17 20:10:12 2014 (r266347) +++ stable/10/sys/arm/freescale/imx/imx6_machdep.c Sat May 17 20:22:22 2014 (r266348) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -55,6 +56,8 @@ void initarm_early_init(void) { + /* Inform the MPCore timer driver that its clock is variable. */ + arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES); } void Modified: stable/10/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/imx6.dtsi Sat May 17 20:10:12 2014 (r266347) +++ stable/10/sys/boot/fdt/dts/arm/imx6.dtsi Sat May 17 20:22:22 2014 (r266348) @@ -71,6 +71,14 @@ 0x00a00100 0x00000100>; }; + mp_tmr0@00a00200 { + compatible = "arm,mpcore-timers"; + reg = <0x00a00200 0x100 + 0x00a00600 0x100>; + interrupts = <27 29>; + interrupt-parent = <&gic>; + }; + l2-cache@00a02000 { compatible = "arm,pl310-cache", "arm,pl310"; reg = <0xa02000 0x1000>; Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Sat May 17 20:10:12 2014 (r266347) +++ stable/10/sys/conf/options Sat May 17 20:22:22 2014 (r266348) @@ -158,6 +158,7 @@ NEW_PCIB opt_global.h NO_ADAPTIVE_MUTEXES opt_adaptive_mutexes.h NO_ADAPTIVE_RWLOCKS NO_ADAPTIVE_SX +NO_EVENTTIMERS opt_timer.h NO_SYSCTL_DESCR opt_global.h NSWBUF_MIN opt_swap.h MBUF_PACKET_ZONE_DISABLE opt_global.h Modified: stable/10/sys/conf/options.arm ============================================================================== --- stable/10/sys/conf/options.arm Sat May 17 20:10:12 2014 (r266347) +++ stable/10/sys/conf/options.arm Sat May 17 20:22:22 2014 (r266348) @@ -31,7 +31,6 @@ KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h LINUX_BOOT_ABI opt_global.h LOADERRAMADDR opt_global.h -NO_EVENTTIMERS opt_timer.h PHYSADDR opt_global.h SOCDEV_PA opt_global.h SOCDEV_VA opt_global.h From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 20:52:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C37B4941; Sat, 17 May 2014 20:52: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 AE7D52657; Sat, 17 May 2014 20:52: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 s4HKqBv9089574; Sat, 17 May 2014 20:52:11 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HKqAbe089568; Sat, 17 May 2014 20:52:10 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172052.s4HKqAbe089568@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 20:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266352 - in stable/10/sys: arm/arm arm/freescale/imx arm/samsung/exynos boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 20:52:11 -0000 Author: ian Date: Sat May 17 20:52:10 2014 New Revision: 266352 URL: http://svnweb.freebsd.org/changeset/base/266352 Log: MFC 264052, 264057, 264065, 264094, 264103, 264120 Actually save the mpcore clock frequency retrieved from fdt data. imx6.. - Don't call sdhci_init_slot() until after handling the FDT properties related to detecting card presence. - Flag several sysctl variables as tunables. - Rework the cpu frequency management code for imx6 to add "operating points" and min/max frequency controls. generic timer... - Setup both secure and non-secure timer IRQs. We don't know our ARM security state, so one of them will operate. - Don't set frequency, since it's unpossible in non-secure state. Only rely on DTS clock-frequency value or get clock from timer. Modified: stable/10/sys/arm/arm/generic_timer.c stable/10/sys/arm/arm/mpcore_timer.c stable/10/sys/arm/freescale/imx/imx6_anatop.c stable/10/sys/arm/freescale/imx/imx_sdhci.c stable/10/sys/arm/samsung/exynos/chrome_kb.c stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/generic_timer.c ============================================================================== --- stable/10/sys/arm/arm/generic_timer.c Sat May 17 20:39:39 2014 (r266351) +++ stable/10/sys/arm/arm/generic_timer.c Sat May 17 20:52:10 2014 (r266352) @@ -73,16 +73,23 @@ __FBSDID("$FreeBSD$"); #define GT_CNTKCTL_PL0VCTEN (1 << 1) /* PL0 CNTVCT and CNTFRQ access */ #define GT_CNTKCTL_PL0PCTEN (1 << 0) /* PL0 CNTPCT and CNTFRQ access */ -#define GT_CNTPSIRQ 29 - struct arm_tmr_softc { - struct resource *irq_res; + struct resource *res[4]; + void *ihl[4]; uint32_t clkfreq; struct eventtimer et; }; static struct arm_tmr_softc *arm_tmr_sc = NULL; +static struct resource_spec timer_spec[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Secure */ + { SYS_RES_IRQ, 1, RF_ACTIVE }, /* Non-secure */ + { SYS_RES_IRQ, 2, RF_ACTIVE }, /* Virt */ + { SYS_RES_IRQ, 3, RF_ACTIVE }, /* Hyp */ + { -1, 0 } +}; + static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { @@ -261,9 +268,8 @@ arm_tmr_attach(device_t dev) struct arm_tmr_softc *sc; phandle_t node; pcell_t clock; - void *ihl; - int rid; int error; + int i; sc = device_get_softc(dev); if (arm_tmr_sc) @@ -272,29 +278,37 @@ arm_tmr_attach(device_t dev) /* Get the base clock frequency */ node = ofw_bus_get_node(dev); error = OF_getprop(node, "clock-frequency", &clock, sizeof(clock)); - if (error <= 0) { - device_printf(dev, "missing clock-frequency " - "attribute in FDT\n"); + if (error > 0) { + sc->clkfreq = fdt32_to_cpu(clock); + } + + if (sc->clkfreq == 0) { + /* Try to get clock frequency from timer */ + sc->clkfreq = get_freq(); + } + + if (sc->clkfreq == 0) { + device_printf(dev, "No clock frequency specified\n"); return (ENXIO); } - sc->clkfreq = fdt32_to_cpu(clock); - rid = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - GT_CNTPSIRQ, GT_CNTPSIRQ, - 1, RF_SHAREABLE | RF_ACTIVE); + if (bus_alloc_resources(dev, timer_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + }; arm_tmr_sc = sc; - /* Setup and enable the timer */ - if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CLK, arm_tmr_intr, - NULL, sc, &ihl) != 0) { - bus_release_resource(dev, SYS_RES_IRQ, rid, sc->irq_res); - device_printf(dev, "Unable to setup the CLK irq handler.\n"); - return (ENXIO); + /* Setup secure and non-secure IRQs handler */ + for (i = 0; i < 2; i++) { + error = bus_setup_intr(dev, sc->res[i], INTR_TYPE_CLK, + arm_tmr_intr, NULL, sc, &sc->ihl[i]); + if (error) { + device_printf(dev, "Unable to alloc int resource.\n"); + return (ENXIO); + } } - set_freq(sc->clkfreq); disable_user_access(); arm_tmr_timecount.tc_frequency = sc->clkfreq; Modified: stable/10/sys/arm/arm/mpcore_timer.c ============================================================================== --- stable/10/sys/arm/arm/mpcore_timer.c Sat May 17 20:39:39 2014 (r266351) +++ stable/10/sys/arm/arm/mpcore_timer.c Sat May 17 20:52:10 2014 (r266352) @@ -301,6 +301,7 @@ arm_tmr_attach(device_t dev) "attribute in FDT\n"); return (ENXIO); } + sc->clkfreq = clock; } } Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Sat May 17 20:39:39 2014 (r266351) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Sat May 17 20:52:10 2014 (r266352) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -74,6 +75,8 @@ __FBSDID("$FreeBSD$"); #include #include +static SYSCTL_NODE(_hw, OID_AUTO, imx6, CTLFLAG_RW, NULL, "i.MX6 container"); + static struct resource_spec imx6_anatop_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, @@ -85,14 +88,15 @@ static struct resource_spec imx6_anatop_ struct imx6_anatop_softc { device_t dev; struct resource *res[2]; - uint32_t cpu_curhz; uint32_t cpu_curmhz; uint32_t cpu_curmv; - uint32_t cpu_minhz; + uint32_t cpu_minmhz; uint32_t cpu_minmv; - uint32_t cpu_maxhz; + uint32_t cpu_maxmhz; uint32_t cpu_maxmv; - uint32_t refosc_hz; + uint32_t cpu_maxmhz_hw; + boolean_t cpu_overclock_enable; + uint32_t refosc_mhz; void *temp_intrhand; uint32_t temp_high_val; uint32_t temp_high_cnt; @@ -108,16 +112,27 @@ struct imx6_anatop_softc { static struct imx6_anatop_softc *imx6_anatop_sc; /* - * Tables of CPU max frequencies and corresponding voltages. This is indexed by - * the max frequency value (0-3) from the ocotp CFG3 register. + * Table of "operating points". + * These are combinations of frequency and voltage blessed by Freescale. */ -static uint32_t imx6_cpu_maxhz_tab[] = { - 792000000, 852000000, 996000000, 1200000000 -}; -static uint32_t imx6_cpu_millivolt_tab[] = { - 1150, 1225, 1225, 1275 +static struct oppt { + uint32_t mhz; + uint32_t mv; +} imx6_oppt_table[] = { +/* { 396, 925}, XXX: need functional ccm code for this speed */ + { 792, 1150}, + { 852, 1225}, + { 996, 1225}, + {1200, 1275}, }; +/* + * Table of CPU max frequencies. This is used to translate the max frequency + * value (0-3) from the ocotp CFG3 register into a mhz value that can be looked + * up in the operating points table. + */ +static uint32_t imx6_ocotp_mhz_tab[] = {792, 852, 996, 1200}; + #define TZ_ZEROC 2732 /* deci-Kelvin <-> deci-Celcius offset. */ uint32_t @@ -193,49 +208,58 @@ vdd_set(struct imx6_anatop_softc *sc, in imx6_anatop_write_4(IMX6_ANALOG_PMU_REG_CORE, pmureg); DELAY(delay); sc->cpu_curmv = newtarg * 25 + 700; - device_printf(sc->dev, "voltage set to %u\n", sc->cpu_curmv); } static inline uint32_t -cpufreq_hz_from_div(struct imx6_anatop_softc *sc, uint32_t div) +cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t div) { - return (sc->refosc_hz * (div / 2)); + return (sc->refosc_mhz * (div / 2)); } static inline uint32_t -cpufreq_hz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_hz) +cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) { - return (cpu_hz / (sc->refosc_hz / 2)); + return (cpu_mhz / (sc->refosc_mhz / 2)); } static inline uint32_t -cpufreq_actual_hz(struct imx6_anatop_softc *sc, uint32_t cpu_hz) +cpufreq_actual_mhz(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) +{ + + return (cpufreq_mhz_from_div(sc, cpufreq_mhz_to_div(sc, cpu_mhz))); +} + +static struct oppt * +cpufreq_nearest_oppt(struct imx6_anatop_softc *sc, uint32_t cpu_newmhz) { + int d, diff, i, nearest; - return (cpufreq_hz_from_div(sc, cpufreq_hz_to_div(sc, cpu_hz))); + if (cpu_newmhz > sc->cpu_maxmhz_hw && !sc->cpu_overclock_enable) + cpu_newmhz = sc->cpu_maxmhz_hw; + + diff = INT_MAX; + nearest = 0; + for (i = 0; i < nitems(imx6_oppt_table); ++i) { + d = abs((int)cpu_newmhz - (int)imx6_oppt_table[i].mhz); + if (diff > d) { + diff = d; + nearest = i; + } + } + return (&imx6_oppt_table[nearest]); } static void -cpufreq_set_clock(struct imx6_anatop_softc * sc, uint32_t cpu_newhz) +cpufreq_set_clock(struct imx6_anatop_softc * sc, struct oppt *op) { - uint32_t div, timeout, wrk32; - const uint32_t mindiv = 54; - const uint32_t maxdiv = 108; - - /* - * Clip the requested frequency to the configured max, then clip the - * resulting divisor to the documented min/max values. - */ - cpu_newhz = min(cpu_newhz, sc->cpu_maxhz); - div = cpufreq_hz_to_div(sc, cpu_newhz); - if (div < mindiv) - div = mindiv; - else if (div > maxdiv) - div = maxdiv; - sc->cpu_curhz = cpufreq_hz_from_div(sc, div); - sc->cpu_curmhz = sc->cpu_curhz / 1000000; + uint32_t timeout, wrk32; + + /* If increasing the frequency, we must first increase the voltage. */ + if (op->mhz > sc->cpu_curmhz) { + vdd_set(sc, op->mv); + } /* * I can't find a documented procedure for changing the ARM PLL divisor, @@ -244,7 +268,7 @@ cpufreq_set_clock(struct imx6_anatop_sof * - Set the PLL into bypass mode; cpu should now be running at 24mhz. * - Change the divisor. * - Wait for the LOCK bit to come on; it takes ~50 loop iterations. - * - Turn off bypass mode; cpu should now be running at cpu_newhz. + * - Turn off bypass mode; cpu should now be running at the new speed. */ imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK); @@ -253,7 +277,7 @@ cpufreq_set_clock(struct imx6_anatop_sof wrk32 = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM); wrk32 &= ~IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - wrk32 |= div; + wrk32 |= cpufreq_mhz_to_div(sc, op->mhz); imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM, wrk32); timeout = 10000; @@ -265,26 +289,114 @@ cpufreq_set_clock(struct imx6_anatop_sof imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_BYPASS); - arm_tmr_change_frequency(sc->cpu_curhz / 2); + /* If lowering the frequency, it is now safe to lower the voltage. */ + if (op->mhz < sc->cpu_curmhz) + vdd_set(sc, op->mv); + sc->cpu_curmhz = op->mhz; + + /* Tell the mpcore timer that its frequency has changed. */ + arm_tmr_change_frequency( + cpufreq_actual_mhz(sc, sc->cpu_curmhz) * 1000000 / 2); +} + +static int +cpufreq_sysctl_minmhz(SYSCTL_HANDLER_ARGS) +{ + struct imx6_anatop_softc *sc; + struct oppt * op; + uint32_t temp; + int err; + + sc = arg1; + + temp = sc->cpu_minmhz; + err = sysctl_handle_int(oidp, &temp, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + op = cpufreq_nearest_oppt(sc, temp); + if (op->mhz > sc->cpu_maxmhz) + return (ERANGE); + else if (op->mhz == sc->cpu_minmhz) + return (0); + + /* + * Value changed, update softc. If the new min is higher than the + * current speed, raise the current speed to match. + */ + sc->cpu_minmhz = op->mhz; + if (sc->cpu_minmhz > sc->cpu_curmhz) { + cpufreq_set_clock(sc, op); + } + return (err); +} + +static int +cpufreq_sysctl_maxmhz(SYSCTL_HANDLER_ARGS) +{ + struct imx6_anatop_softc *sc; + struct oppt * op; + uint32_t temp; + int err; + + sc = arg1; + + temp = sc->cpu_maxmhz; + err = sysctl_handle_int(oidp, &temp, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + op = cpufreq_nearest_oppt(sc, temp); + if (op->mhz < sc->cpu_minmhz) + return (ERANGE); + else if (op->mhz == sc->cpu_maxmhz) + return (0); + + /* + * Value changed, update softc and hardware. The hardware update is + * unconditional. We always try to run at max speed, so any change of + * the max means we need to change the current speed too, regardless of + * whether it is higher or lower than the old max. + */ + sc->cpu_maxmhz = op->mhz; + cpufreq_set_clock(sc, op); + + return (err); } static void cpufreq_initialize(struct imx6_anatop_softc *sc) { uint32_t cfg3speed; - struct sysctl_ctx_list *ctx; + struct oppt * op; - ctx = device_get_sysctl_ctx(sc->dev); - SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), OID_AUTO, "cpu_mhz", CTLFLAG_RD, &sc->cpu_curmhz, 0, - "CPU frequency in MHz"); + "CPU frequency"); + + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, + cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency"); + + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, + cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency"); + + SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + OID_AUTO, "cpu_maxmhz_hw", CTLFLAG_RD, &sc->cpu_maxmhz_hw, 0, + "Maximum CPU frequency allowed by hardware"); + + SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + OID_AUTO, "cpu_overclock_enable", CTLFLAG_RWTUN, + &sc->cpu_overclock_enable, 0, + "Allow setting CPU frequency higher than cpu_maxmhz_hw"); /* * XXX 24mhz shouldn't be hard-coded, should get this from imx6_ccm * (even though in the real world it will always be 24mhz). Oh wait a * sec, I never wrote imx6_ccm. */ - sc->refosc_hz = 24000000; + sc->refosc_mhz = 24; /* * Get the maximum speed this cpu can be set to. The values in the @@ -294,14 +406,25 @@ cpufreq_initialize(struct imx6_anatop_so * - 2b'10: 996000000Hz; * - 2b'01: 852000000Hz; -- i.MX6Q Only, exclusive with 996MHz. * - 2b'00: 792000000Hz; + * The default hardware max speed can be overridden by a tunable. */ cfg3speed = (fsl_ocotp_read_4(FSL_OCOTP_CFG3) & FSL_OCOTP_CFG3_SPEED_MASK) >> FSL_OCOTP_CFG3_SPEED_SHIFT; + sc->cpu_maxmhz_hw = imx6_ocotp_mhz_tab[cfg3speed]; + sc->cpu_maxmhz = sc->cpu_maxmhz_hw; + + TUNABLE_INT_FETCH("hw.imx6.cpu_overclock_enable", + &sc->cpu_overclock_enable); - sc->cpu_minhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[0]); - sc->cpu_minmv = imx6_cpu_millivolt_tab[0]; - sc->cpu_maxhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[cfg3speed]); - sc->cpu_maxmv = imx6_cpu_millivolt_tab[cfg3speed]; + TUNABLE_INT_FETCH("hw.imx6.cpu_minmhz", &sc->cpu_minmhz); + op = cpufreq_nearest_oppt(sc, sc->cpu_minmhz); + sc->cpu_minmhz = op->mhz; + sc->cpu_minmv = op->mv; + + TUNABLE_INT_FETCH("hw.imx6.cpu_maxmhz", &sc->cpu_maxmhz); + op = cpufreq_nearest_oppt(sc, sc->cpu_maxmhz); + sc->cpu_maxmhz = op->mhz; + sc->cpu_maxmv = op->mv; /* * Set the CPU to maximum speed. @@ -311,9 +434,7 @@ cpufreq_initialize(struct imx6_anatop_so * basically assumes that a single core can't overheat before interrupts * are enabled; empirical testing shows that to be a safe assumption. */ - vdd_set(sc, sc->cpu_maxmv); - cpufreq_set_clock(sc, sc->cpu_maxhz); - device_printf(sc->dev, "CPU frequency %uMHz\n", sc->cpu_curmhz); + cpufreq_set_clock(sc, op); } static inline uint32_t @@ -391,9 +512,8 @@ static void tempmon_gofast(struct imx6_anatop_softc *sc) { - if (sc->cpu_curhz < sc->cpu_maxhz) { - vdd_set(sc, sc->cpu_maxmv); - cpufreq_set_clock(sc, sc->cpu_maxhz); + if (sc->cpu_curmhz < sc->cpu_maxmhz) { + cpufreq_set_clock(sc, cpufreq_nearest_oppt(sc, sc->cpu_maxmhz)); } } @@ -401,9 +521,8 @@ static void tempmon_goslow(struct imx6_anatop_softc *sc) { - if (sc->cpu_curhz > sc->cpu_minhz) { - cpufreq_set_clock(sc, sc->cpu_minhz); - vdd_set(sc, sc->cpu_minmv); + if (sc->cpu_curmhz > sc->cpu_minmhz) { + cpufreq_set_clock(sc, cpufreq_nearest_oppt(sc, sc->cpu_minmhz)); } } @@ -542,6 +661,10 @@ imx6_anatop_attach(device_t dev) cpufreq_initialize(sc); initialize_tempmon(sc); + if (bootverbose) { + device_printf(sc->dev, "CPU %uMHz @ %umV\n", sc->cpu_curmhz, + sc->cpu_curmv); + } err = 0; out: @@ -575,7 +698,7 @@ imx6_get_cpu_clock() div = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - return (cpufreq_hz_from_div(imx6_anatop_sc, div)); + return (cpufreq_mhz_from_div(imx6_anatop_sc, div)); } static device_method_t imx6_anatop_methods[] = { Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_sdhci.c Sat May 17 20:39:39 2014 (r266351) +++ stable/10/sys/arm/freescale/imx/imx_sdhci.c Sat May 17 20:52:10 2014 (r266352) @@ -730,9 +730,6 @@ imx_sdhci_attach(device_t dev) sc->baseclk_hz = imx51_get_clock(IMX51CLK_PERCLK_ROOT); } - sdhci_init_slot(dev, &sc->slot, 0); - callout_init(&sc->r1bfix_callout, true); - /* * If the slot is flagged with the non-removable property, set our flag * to always force the SDHCI_CARD_PRESENT bit on. @@ -752,6 +749,9 @@ imx_sdhci_attach(device_t dev) sc->force_card_present = true; } + callout_init(&sc->r1bfix_callout, true); + sdhci_init_slot(dev, &sc->slot, 0); + bus_generic_probe(dev); bus_generic_attach(dev); Modified: stable/10/sys/arm/samsung/exynos/chrome_kb.c ============================================================================== --- stable/10/sys/arm/samsung/exynos/chrome_kb.c Sat May 17 20:39:39 2014 (r266351) +++ stable/10/sys/arm/samsung/exynos/chrome_kb.c Sat May 17 20:52:10 2014 (r266352) @@ -138,7 +138,6 @@ struct ckb_softc { }; /* prototypes */ -static void ckb_set_leds(struct ckb_softc *, uint8_t); static int ckb_set_typematic(keyboard_t *, int); static uint32_t ckb_read_char(keyboard_t *, int); static void ckb_clear_state(keyboard_t *); Modified: stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi Sat May 17 20:39:39 2014 (r266351) +++ stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi Sat May 17 20:52:10 2014 (r266352) @@ -81,6 +81,8 @@ generic_timer { compatible = "arm,armv7-timer"; clock-frequency = <24000000>; + interrupts = < 29 30 27 26 >; + interrupt-parent = <&GIC>; }; pwm { From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:07:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D2C80EE6; Sat, 17 May 2014 21:07: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 BE8632730; Sat, 17 May 2014 21:07: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 s4HL7tTL096837; Sat, 17 May 2014 21:07:55 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HL7tHk096834; Sat, 17 May 2014 21:07:55 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172107.s4HL7tHk096834@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266353 - in stable/10/sys/arm: arm include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:07:55 -0000 Author: ian Date: Sat May 17 21:07:54 2014 New Revision: 266353 URL: http://svnweb.freebsd.org/changeset/base/266353 Log: MFC 264128, 264129, 264130, 264135, Fix TTB set operation for armv7. Perform sychronization (by "isb" barrier) after TTB is set. Fix TLB maintenance issues for armv6 and armv7. - Add cpu_cpwait to comply with the convention. - Add missing TLB invalidations, especially in pmap_kenter & pmap_kremove with distinguishing between D and ID pages. - Modify pmap init/bootstrap invalidations to ID, just to be safe. - Fix TLB-inv and PTE_SYNC ordering. Allocate per-cpu resources for doing pmap_zero_page() and pmap_copy_page(). This is performance enhancement rather than bugfix. We don't support any ARM systems with an ISA bus and don't need a freelist of memory to support ISA addressing limitations. Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/pmap-v6.c stable/10/sys/arm/include/vmparam.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 17 20:52:10 2014 (r266352) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 17 21:07:54 2014 (r266353) @@ -71,6 +71,7 @@ ENTRY(armv7_setttb) orr r0, r0, #PT_ATTR mcr p15, 0, r0, c2, c0, 0 /* Translation Table Base Register 0 (TTBR0) */ + isb #ifdef SMP mcr p15, 0, r0, c8, c3, 0 /* invalidate I+D TLBs Inner Shareable*/ #else @@ -273,6 +274,7 @@ ENTRY(armv7_context_switch) orr r0, r0, #PT_ATTR mcr p15, 0, r0, c2, c0, 0 /* set the new TTB */ + isb #ifdef SMP mcr p15, 0, r0, c8, c3, 0 /* and flush the I+D tlbs Inner Sharable */ #else Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Sat May 17 20:52:10 2014 (r266352) +++ stable/10/sys/arm/arm/pmap-v6.c Sat May 17 21:07:54 2014 (r266353) @@ -265,9 +265,18 @@ vm_offset_t vm_max_kernel_address; struct pmap kernel_pmap_store; -static pt_entry_t *csrc_pte, *cdst_pte; -static vm_offset_t csrcp, cdstp; -static struct mtx cmtx; +/* + * Resources for quickly copying and zeroing pages using virtual address space + * and page table entries that are pre-allocated per-CPU by pmap_init(). + */ +struct czpages { + struct mtx lock; + pt_entry_t *srcptep; + pt_entry_t *dstptep; + vm_offset_t srcva; + vm_offset_t dstva; +}; +static struct czpages cpu_czpages[MAXCPU]; static void pmap_init_l1(struct l1_ttable *, pd_entry_t *); /* @@ -1047,6 +1056,7 @@ small_mappings: cpu_tlb_flushID_SE(pv->pv_va); else if (PTE_BEEN_REFD(opte)) cpu_tlb_flushD_SE(pv->pv_va); + cpu_cpwait(); } PMAP_UNLOCK(pmap); @@ -1134,8 +1144,8 @@ vector_page_setprot(int prot) *ptep |= L2_S_REF; pmap_set_prot(ptep, prot|VM_PROT_EXECUTE, 0); - - cpu_tlb_flushD_SE(vector_page); + PTE_SYNC(ptep); + cpu_tlb_flushID_SE(vector_page); cpu_cpwait(); } @@ -1643,8 +1653,8 @@ pmap_postinit(void) pte = (pte & ~L2_S_CACHE_MASK) | pte_l2_s_cache_mode_pt; *ptep = pte; PTE_SYNC(ptep); - cpu_tlb_flushD_SE(va); - + cpu_tlb_flushID_SE(va); + cpu_cpwait(); va += PAGE_SIZE; } pmap_init_l1(l1, pl1pt); @@ -1802,13 +1812,14 @@ pmap_bootstrap(vm_offset_t firstaddr, st struct l1_ttable *l1 = &static_l1; struct l2_dtable *l2; struct l2_bucket *l2b; + struct czpages *czp; pd_entry_t pde; pd_entry_t *kernel_l1pt = (pd_entry_t *)l1pt->pv_va; pt_entry_t *ptep; vm_paddr_t pa; vm_offset_t va; vm_size_t size; - int l1idx, l2idx, l2next = 0; + int i, l1idx, l2idx, l2next = 0; PDEBUG(1, printf("firstaddr = %08x, lastaddr = %08x\n", firstaddr, vm_max_kernel_address)); @@ -1920,13 +1931,16 @@ pmap_bootstrap(vm_offset_t firstaddr, st /* * Reserve some special page table entries/VA space for temporary - * mapping of pages. + * mapping of pages that are being copied or zeroed. */ + for (czp = cpu_czpages, i = 0; i < MAXCPU; ++i, ++czp) { + mtx_init(&czp->lock, "czpages", NULL, MTX_DEF); + pmap_alloc_specials(&virtual_avail, 1, &czp->srcva, &czp->srcptep); + pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)czp->srcptep); + pmap_alloc_specials(&virtual_avail, 1, &czp->dstva, &czp->dstptep); + pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)czp->dstptep); + } - pmap_alloc_specials(&virtual_avail, 1, &csrcp, &csrc_pte); - pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)csrc_pte); - pmap_alloc_specials(&virtual_avail, 1, &cdstp, &cdst_pte); - pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)cdst_pte); size = ((vm_max_kernel_address - pmap_curmaxkvaddr) + L1_S_OFFSET) / L1_S_SIZE; pmap_alloc_specials(&virtual_avail, @@ -1948,11 +1962,12 @@ pmap_bootstrap(vm_offset_t firstaddr, st pmap_init_l1(l1, kernel_l1pt); cpu_dcache_wbinv_all(); cpu_l2cache_wbinv_all(); + cpu_tlb_flushID(); + cpu_cpwait(); virtual_avail = round_page(virtual_avail); virtual_end = vm_max_kernel_address; kernel_vm_end = pmap_curmaxkvaddr; - mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); pmap_set_pcb_pagedir(kernel_pmap, thread0.td_pcb); } @@ -2034,6 +2049,8 @@ pmap_grow_map(vm_offset_t va, pt_entry_t *ptep = L2_S_PROTO | pa | cache_mode | L2_S_REF; pmap_set_prot(ptep, VM_PROT_READ | VM_PROT_WRITE, 0); PTE_SYNC(ptep); + cpu_tlb_flushD_SE(va); + cpu_cpwait(); return (0); } @@ -2348,6 +2365,8 @@ pmap_kenter_section(vm_offset_t va, vm_o l1->l1_kva[L1_IDX(va)] = pd; PTE_SYNC(&l1->l1_kva[L1_IDX(va)]); } + cpu_tlb_flushID_SE(va); + cpu_cpwait(); } /* @@ -2387,13 +2406,6 @@ pmap_kenter_internal(vm_offset_t va, vm_ ptep = &l2b->l2b_kva[l2pte_index(va)]; opte = *ptep; - if (l2pte_valid(opte)) { - cpu_tlb_flushD_SE(va); - cpu_cpwait(); - } else { - if (opte == 0) - l2b->l2b_occupancy++; - } if (flags & KENTER_CACHE) { *ptep = L2_S_PROTO | pa | pte_l2_s_cache_mode | L2_S_REF; @@ -2405,10 +2417,19 @@ pmap_kenter_internal(vm_offset_t va, vm_ 0); } + PTE_SYNC(ptep); + if (l2pte_valid(opte)) { + if (L2_S_EXECUTABLE(opte) || L2_S_EXECUTABLE(*ptep)) + cpu_tlb_flushID_SE(va); + else + cpu_tlb_flushD_SE(va); + } else { + if (opte == 0) + l2b->l2b_occupancy++; + } + PDEBUG(1, printf("pmap_kenter: pte = %08x, opte = %08x, npte = %08x\n", (uint32_t) ptep, opte, *ptep)); - PTE_SYNC(ptep); - cpu_cpwait(); } void @@ -2474,10 +2495,13 @@ pmap_kremove(vm_offset_t va) opte = *ptep; if (l2pte_valid(opte)) { va = va & ~PAGE_MASK; - cpu_tlb_flushD_SE(va); - cpu_cpwait(); *ptep = 0; PTE_SYNC(ptep); + if (L2_S_EXECUTABLE(opte)) + cpu_tlb_flushID_SE(va); + else + cpu_tlb_flushD_SE(va); + cpu_cpwait(); } } @@ -2710,6 +2734,7 @@ small_mappings: cpu_tlb_flushID(); else cpu_tlb_flushD(); + cpu_cpwait(); } vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(&pvh_global_lock); @@ -2763,6 +2788,7 @@ pmap_change_attr(vm_offset_t sva, vm_siz pmap_l2cache_wbinv_range(tmpva, pte & L2_S_FRAME, PAGE_SIZE); *ptep = pte; cpu_tlb_flushID_SE(tmpva); + cpu_cpwait(); dprintf("%s: for va:%x ptep:%x pte:%x\n", __func__, tmpva, (uint32_t)ptep, pte); @@ -2900,6 +2926,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv else if (is_refd) cpu_tlb_flushD(); + cpu_cpwait(); } rw_wunlock(&pvh_global_lock); @@ -3166,6 +3193,7 @@ validate: cpu_tlb_flushID_SE(va); else if (is_refd) cpu_tlb_flushD_SE(va); + cpu_cpwait(); } if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) @@ -3715,6 +3743,7 @@ pmap_remove_section(pmap_t pmap, vm_offs cpu_tlb_flushID_SE(sva); else cpu_tlb_flushD_SE(sva); + cpu_cpwait(); } /* @@ -3887,6 +3916,7 @@ pmap_promote_section(pmap_t pmap, vm_off cpu_tlb_flushID(); else cpu_tlb_flushD(); + cpu_cpwait(); pmap_section_promotions++; CTR2(KTR_PMAP, "pmap_promote_section: success for va %#x" @@ -4011,6 +4041,7 @@ pmap_demote_section(pmap_t pmap, vm_offs cpu_tlb_flushID_SE(va); else if (L1_S_REFERENCED(l1pd)) cpu_tlb_flushD_SE(va); + cpu_cpwait(); pmap_section_demotions++; CTR2(KTR_PMAP, "pmap_demote_section: success for va %#x" @@ -4382,6 +4413,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva } } + *ptep = 0; + PTE_SYNC(ptep); if (pmap_is_current(pmap)) { total++; if (total < PMAP_REMOVE_CLEAN_LIST_SIZE) { @@ -4392,8 +4425,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva } else if (total == PMAP_REMOVE_CLEAN_LIST_SIZE) flushall = 1; } - *ptep = 0; - PTE_SYNC(ptep); sva += PAGE_SIZE; ptep++; @@ -4406,6 +4437,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva rw_wunlock(&pvh_global_lock); if (flushall) cpu_tlb_flushID(); + cpu_cpwait(); + PMAP_UNLOCK(pmap); } @@ -4420,39 +4453,42 @@ pmap_remove(pmap_t pmap, vm_offset_t sva static void pmap_zero_page_gen(vm_page_t m, int off, int size) { + struct czpages *czp; + + KASSERT(TAILQ_EMPTY(&m->md.pv_list), + ("pmap_zero_page_gen: page has mappings")); vm_paddr_t phys = VM_PAGE_TO_PHYS(m); - if (!TAILQ_EMPTY(&m->md.pv_list)) - panic("pmap_zero_page: page has mappings"); - mtx_lock(&cmtx); + sched_pin(); + czp = &cpu_czpages[PCPU_GET(cpuid)]; + mtx_lock(&czp->lock); + /* - * Hook in the page, zero it, invalidate the TLB as needed. - * - * Note the temporary zero-page mapping must be a non-cached page in - * order to work without corruption when write-allocate is enabled. + * Hook in the page, zero it. */ - *cdst_pte = L2_S_PROTO | phys | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(cdst_pte, VM_PROT_WRITE, 0); - PTE_SYNC(cdst_pte); - cpu_tlb_flushD_SE(cdstp); + *czp->dstptep = L2_S_PROTO | phys | pte_l2_s_cache_mode | L2_S_REF; + pmap_set_prot(czp->dstptep, VM_PROT_WRITE, 0); + PTE_SYNC(czp->dstptep); + cpu_tlb_flushD_SE(czp->dstva); cpu_cpwait(); + if (off || size != PAGE_SIZE) - bzero((void *)(cdstp + off), size); + bzero((void *)(czp->dstva + off), size); else - bzero_page(cdstp); + bzero_page(czp->dstva); /* - * Although aliasing is not possible if we use - * cdstp temporary mappings with memory that - * will be mapped later as non-cached or with write-through - * caches we might end up overwriting it when calling wbinv_all - * So make sure caches are clean after copy operation + * Although aliasing is not possible, if we use temporary mappings with + * memory that will be mapped later as non-cached or with write-through + * caches, we might end up overwriting it when calling wbinv_all. So + * make sure caches are clean after the operation. */ - cpu_idcache_wbinv_range(cdstp, size); - pmap_l2cache_wbinv_range(cdstp, phys, size); + cpu_idcache_wbinv_range(czp->dstva, size); + pmap_l2cache_wbinv_range(czp->dstva, phys, size); - mtx_unlock(&cmtx); + mtx_unlock(&czp->lock); + sched_unpin(); } /* @@ -4510,45 +4546,39 @@ pmap_zero_page_idle(vm_page_t m) void pmap_copy_page_generic(vm_paddr_t src, vm_paddr_t dst) { - /* - * Hold the source page's lock for the duration of the copy - * so that no other mappings can be created while we have a - * potentially aliased mapping. - * Map the pages into the page hook points, copy them, and purge - * the cache for the appropriate page. Invalidate the TLB - * as required. - */ - mtx_lock(&cmtx); - - /* For ARMv6 using System bit is deprecated and mapping with AP - * bits set to 0x0 makes page not accessible. csrc_pte is mapped - * read/write until proper mapping defines are created for ARMv6. - */ - *csrc_pte = L2_S_PROTO | src | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(csrc_pte, VM_PROT_READ, 0); - PTE_SYNC(csrc_pte); - - *cdst_pte = L2_S_PROTO | dst | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(cdst_pte, VM_PROT_READ | VM_PROT_WRITE, 0); - PTE_SYNC(cdst_pte); + struct czpages *czp; - cpu_tlb_flushD_SE(csrcp); - cpu_tlb_flushD_SE(cdstp); + sched_pin(); + czp = &cpu_czpages[PCPU_GET(cpuid)]; + mtx_lock(&czp->lock); + + /* + * Map the pages into the page hook points, copy them, and purge the + * cache for the appropriate page. + */ + *czp->srcptep = L2_S_PROTO | src | pte_l2_s_cache_mode | L2_S_REF; + pmap_set_prot(czp->srcptep, VM_PROT_READ, 0); + PTE_SYNC(czp->srcptep); + cpu_tlb_flushD_SE(czp->srcva); + *czp->dstptep = L2_S_PROTO | dst | pte_l2_s_cache_mode | L2_S_REF; + pmap_set_prot(czp->dstptep, VM_PROT_READ | VM_PROT_WRITE, 0); + PTE_SYNC(czp->dstptep); + cpu_tlb_flushD_SE(czp->dstva); cpu_cpwait(); + bcopy_page(czp->srcva, czp->dstva); + /* - * Although aliasing is not possible if we use - * cdstp temporary mappings with memory that - * will be mapped later as non-cached or with write-through - * caches we might end up overwriting it when calling wbinv_all - * So make sure caches are clean after copy operation + * Although aliasing is not possible, if we use temporary mappings with + * memory that will be mapped later as non-cached or with write-through + * caches, we might end up overwriting it when calling wbinv_all. So + * make sure caches are clean after the operation. */ - bcopy_page(csrcp, cdstp); + cpu_idcache_wbinv_range(czp->dstva, PAGE_SIZE); + pmap_l2cache_wbinv_range(czp->dstva, dst, PAGE_SIZE); - cpu_idcache_wbinv_range(cdstp, PAGE_SIZE); - pmap_l2cache_wbinv_range(cdstp, dst, PAGE_SIZE); - - mtx_unlock(&cmtx); + mtx_unlock(&czp->lock); + sched_unpin(); } int unmapped_buf_allowed = 1; @@ -4560,8 +4590,12 @@ pmap_copy_pages(vm_page_t ma[], vm_offse vm_page_t a_pg, b_pg; vm_offset_t a_pg_offset, b_pg_offset; int cnt; + struct czpages *czp; + + sched_pin(); + czp = &cpu_czpages[PCPU_GET(cpuid)]; + mtx_lock(&czp->lock); - mtx_lock(&cmtx); while (xfersize > 0) { a_pg = ma[a_offset >> PAGE_SHIFT]; a_pg_offset = a_offset & PAGE_MASK; @@ -4569,27 +4603,29 @@ pmap_copy_pages(vm_page_t ma[], vm_offse b_pg = mb[b_offset >> PAGE_SHIFT]; b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); - *csrc_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(a_pg) | + *czp->srcptep = L2_S_PROTO | VM_PAGE_TO_PHYS(a_pg) | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(csrc_pte, VM_PROT_READ, 0); - PTE_SYNC(csrc_pte); - *cdst_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(b_pg) | + pmap_set_prot(czp->srcptep, VM_PROT_READ, 0); + PTE_SYNC(czp->srcptep); + cpu_tlb_flushD_SE(czp->srcva); + *czp->dstptep = L2_S_PROTO | VM_PAGE_TO_PHYS(b_pg) | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(cdst_pte, VM_PROT_READ | VM_PROT_WRITE, 0); - PTE_SYNC(cdst_pte); - cpu_tlb_flushD_SE(csrcp); - cpu_tlb_flushD_SE(cdstp); + pmap_set_prot(czp->dstptep, VM_PROT_READ | VM_PROT_WRITE, 0); + PTE_SYNC(czp->dstptep); + cpu_tlb_flushD_SE(czp->dstva); cpu_cpwait(); - bcopy((char *)csrcp + a_pg_offset, (char *)cdstp + b_pg_offset, + bcopy((char *)czp->srcva + a_pg_offset, (char *)czp->dstva + b_pg_offset, cnt); - cpu_idcache_wbinv_range(cdstp + b_pg_offset, cnt); - pmap_l2cache_wbinv_range(cdstp + b_pg_offset, + cpu_idcache_wbinv_range(czp->dstva + b_pg_offset, cnt); + pmap_l2cache_wbinv_range(czp->dstva + b_pg_offset, VM_PAGE_TO_PHYS(b_pg) + b_pg_offset, cnt); xfersize -= cnt; a_offset += cnt; b_offset += cnt; } - mtx_unlock(&cmtx); + + mtx_unlock(&czp->lock); + sched_unpin(); } void @@ -4922,6 +4958,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva cpu_tlb_flushID_SE(sva); else if (PTE_BEEN_REFD(opte)) cpu_tlb_flushD_SE(sva); + cpu_cpwait(); } } } Modified: stable/10/sys/arm/include/vmparam.h ============================================================================== --- stable/10/sys/arm/include/vmparam.h Sat May 17 20:52:10 2014 (r266352) +++ stable/10/sys/arm/include/vmparam.h Sat May 17 21:07:54 2014 (r266353) @@ -93,15 +93,10 @@ #define VM_FREEPOOL_DIRECT 0 /* - * we support 2 free lists: - * - * - DEFAULT for all systems - * - ISADMA for the ISA DMA range on Sharks only + * We need just one free list: DEFAULT. */ - -#define VM_NFREELIST 2 +#define VM_NFREELIST 1 #define VM_FREELIST_DEFAULT 0 -#define VM_FREELIST_ISADMA 1 /* * The largest allocation size is 1MB. From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:18:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4EC75263; Sat, 17 May 2014 21:18: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 21D7227EA; Sat, 17 May 2014 21:18: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 s4HLI92e003326; Sat, 17 May 2014 21:18:09 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLI8MX003322; Sat, 17 May 2014 21:18:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172118.s4HLI8MX003322@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266355 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:18:09 -0000 Author: ian Date: Sat May 17 21:18:08 2014 New Revision: 266355 URL: http://svnweb.freebsd.org/changeset/base/266355 Log: MFC 264137: Switch wandboards over to the common IMX6 kernel config, which has SMP enabled. Also switch IMX6 to use SCHED_ULE. Modified: stable/10/sys/arm/conf/IMX6 stable/10/sys/arm/conf/WANDBOARD-DUAL stable/10/sys/arm/conf/WANDBOARD-QUAD stable/10/sys/arm/conf/WANDBOARD-SOLO Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/IMX6 ============================================================================== --- stable/10/sys/arm/conf/IMX6 Sat May 17 21:10:03 2014 (r266354) +++ stable/10/sys/arm/conf/IMX6 Sat May 17 21:18:08 2014 (r266355) @@ -1,4 +1,4 @@ -# Kernel configuration for Wandboard +# Kernel configuration for Freescale i.MX6 systems. # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -20,8 +20,8 @@ ident IMX6 include "../freescale/imx/std.imx6" -options HZ=250 # Scheduling quantum is 4 milliseconds. -options SCHED_4BSD # 4BSD scheduler +options HZ=500 # Scheduling quantum is 2 milliseconds. +options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: stable/10/sys/arm/conf/WANDBOARD-DUAL ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD-DUAL Sat May 17 21:10:03 2014 (r266354) +++ stable/10/sys/arm/conf/WANDBOARD-DUAL Sat May 17 21:18:08 2014 (r266355) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "WANDBOARD.common" +include "IMX6" ident WANDBOARD-DUAL # Flattened Device Tree Modified: stable/10/sys/arm/conf/WANDBOARD-QUAD ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD-QUAD Sat May 17 21:10:03 2014 (r266354) +++ stable/10/sys/arm/conf/WANDBOARD-QUAD Sat May 17 21:18:08 2014 (r266355) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "WANDBOARD.common" +include "IMX6" ident WANDBOARD-QUAD # Flattened Device Tree Modified: stable/10/sys/arm/conf/WANDBOARD-SOLO ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD-SOLO Sat May 17 21:10:03 2014 (r266354) +++ stable/10/sys/arm/conf/WANDBOARD-SOLO Sat May 17 21:18:08 2014 (r266355) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "WANDBOARD.common" +include "IMX6" ident WANDBOARD-SOLO # Flattened Device Tree From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:19:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EF6A13A6; Sat, 17 May 2014 21: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 DC3C027FA; Sat, 17 May 2014 21: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 s4HLJi02003552; Sat, 17 May 2014 21: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 s4HLJi1a003551; Sat, 17 May 2014 21:19:44 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172119.s4HLJi1a003551@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266356 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:19:45 -0000 Author: ian Date: Sat May 17 21:19:44 2014 New Revision: 266356 URL: http://svnweb.freebsd.org/changeset/base/266356 Log: MFC 264137: Switch wandboards over to the common IMX6 kernel config, which has SMP enabled. Also switch IMX6 to use SCHED_ULE. Modified: stable/10/sys/arm/conf/PANDABOARD Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/PANDABOARD ============================================================================== --- stable/10/sys/arm/conf/PANDABOARD Sat May 17 21:18:08 2014 (r266355) +++ stable/10/sys/arm/conf/PANDABOARD Sat May 17 21:19:44 2014 (r266356) @@ -145,3 +145,4 @@ options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=pandaboard.dts options VFP # vfp/neon +options SMP # Enable multiple cores From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:23:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 85D345DA; Sat, 17 May 2014 21:23: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 72D0F2890; Sat, 17 May 2014 21:23: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 s4HLNlh8009150; Sat, 17 May 2014 21:23:47 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLNll8009149; Sat, 17 May 2014 21:23:47 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172123.s4HLNll8009149@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266357 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:23:47 -0000 Author: ian Date: Sat May 17 21:23:46 2014 New Revision: 266357 URL: http://svnweb.freebsd.org/changeset/base/266357 Log: MFC 264183: Add a couple more required TLB flushes. Modified: stable/10/sys/arm/arm/pmap-v6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Sat May 17 21:19:44 2014 (r266356) +++ stable/10/sys/arm/arm/pmap-v6.c Sat May 17 21:23:46 2014 (r266357) @@ -853,6 +853,8 @@ pmap_free_l2_bucket(pmap_t pmap, struct if (l1pd == (L1_C_DOM(pmap->pm_domain) | L1_TYPE_C)) { *pl1pd = 0; PTE_SYNC(pl1pd); + cpu_tlb_flushD_SE((vm_offset_t)ptep); + cpu_cpwait(); } /* @@ -2147,6 +2149,8 @@ pmap_grow_l2_bucket(pmap_t pmap, vm_offs L1_C_PROTO; PTE_SYNC(pl1pd); } + cpu_tlb_flushID_SE(va); + cpu_cpwait(); return (l2b); } @@ -2427,6 +2431,7 @@ pmap_kenter_internal(vm_offset_t va, vm_ if (opte == 0) l2b->l2b_occupancy++; } + cpu_cpwait(); PDEBUG(1, printf("pmap_kenter: pte = %08x, opte = %08x, npte = %08x\n", (uint32_t) ptep, opte, *ptep)); @@ -4958,10 +4963,10 @@ pmap_advise(pmap_t pmap, vm_offset_t sva cpu_tlb_flushID_SE(sva); else if (PTE_BEEN_REFD(opte)) cpu_tlb_flushD_SE(sva); - cpu_cpwait(); } } } + cpu_cpwait(); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:26:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1C0CF724; Sat, 17 May 2014 21:26: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 08E2C28A4; Sat, 17 May 2014 21:26: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 s4HLQXWh009551; Sat, 17 May 2014 21:26:33 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLQXfG009550; Sat, 17 May 2014 21:26:33 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172126.s4HLQXfG009550@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266358 - stable/10/sys/arm/samsung/exynos X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:26:34 -0000 Author: ian Date: Sat May 17 21:26:33 2014 New Revision: 266358 URL: http://svnweb.freebsd.org/changeset/base/266358 Log: MFC 264150: Exynos: Correct the end address of the video frame buffer. Modified: stable/10/sys/arm/samsung/exynos/exynos5_fimd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/samsung/exynos/exynos5_fimd.c ============================================================================== --- stable/10/sys/arm/samsung/exynos/exynos5_fimd.c Sat May 17 21:23:46 2014 (r266357) +++ stable/10/sys/arm/samsung/exynos/exynos5_fimd.c Sat May 17 21:26:33 2014 (r266358) @@ -278,9 +278,11 @@ fimd_init(struct fimd_softc *sc) reg |= ((panel->height - 1) << LINEVAL_OFFSET); DWRITE4(sc,VIDTCON2,reg); - WRITE4(sc,VIDW00ADD0B0, sc->sc_info.fb_pbase); - WRITE4(sc,VIDW00ADD1B0, sc->sc_info.fb_pbase + sc->sc_info.fb_size); - WRITE4(sc,VIDW00ADD2, panel->width * 2); + reg = sc->sc_info.fb_pbase; + WRITE4(sc, VIDW00ADD0B0, reg); + reg += (sc->sc_info.fb_stride * (sc->sc_info.fb_height + 1)); + WRITE4(sc, VIDW00ADD1B0, reg); + WRITE4(sc, VIDW00ADD2, sc->sc_info.fb_stride); reg = ((panel->width - 1) << OSD_RIGHTBOTX_F_OFFSET); reg |= ((panel->height - 1) << OSD_RIGHTBOTY_F_OFFSET); From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:28:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6BFE2858; Sat, 17 May 2014 21:28: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 3EE8028AB; Sat, 17 May 2014 21:28: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 s4HLSoF7009873; Sat, 17 May 2014 21:28:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLSnMS009870; Sat, 17 May 2014 21:28:49 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172128.s4HLSnMS009870@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266359 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:28:50 -0000 Author: ian Date: Sat May 17 21:28:49 2014 New Revision: 266359 URL: http://svnweb.freebsd.org/changeset/base/266359 Log: MFC 264160: Remove code under PMAP_CACHE_VIVT, not compiled on armv6. Modified: stable/10/sys/arm/arm/cpufunc_asm_arm11.S stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S stable/10/sys/arm/arm/cpufunc_asm_armv6.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc_asm_arm11.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_arm11.S Sat May 17 21:26:33 2014 (r266358) +++ stable/10/sys/arm/arm/cpufunc_asm_arm11.S Sat May 17 21:28:49 2014 (r266359) @@ -44,12 +44,6 @@ __FBSDID("$FreeBSD$"); * addresses that are about to change. */ ENTRY(arm11_setttb) -#ifdef PMAP_CACHE_VIVT - stmfd sp!, {r0, lr} - bl _C_LABEL(armv5_idcache_wbinv_all) - ldmfd sp!, {r0, lr} -#endif - mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */ Modified: stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S Sat May 17 21:26:33 2014 (r266358) +++ stable/10/sys/arm/arm/cpufunc_asm_arm11x6.S Sat May 17 21:28:49 2014 (r266359) @@ -114,12 +114,7 @@ __FBSDID("$FreeBSD$"); #endif ENTRY(arm11x6_setttb) -#ifdef PMAP_CACHE_VIVT - Flush_D_cache(r1) - Invalidate_I_cache(r1, r2) -#else mov r1, #0 -#endif mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ mcr p15, 0, r1, c8, c7, 0 /* invalidate I+D TLBs */ mcr p15, 0, r1, c7, c10, 4 /* drain write buffer */ Modified: stable/10/sys/arm/arm/cpufunc_asm_armv6.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv6.S Sat May 17 21:26:33 2014 (r266358) +++ stable/10/sys/arm/arm/cpufunc_asm_armv6.S Sat May 17 21:28:49 2014 (r266359) @@ -49,10 +49,6 @@ * addresses that are about to change. */ ENTRY(armv6_setttb) -#ifdef PMAP_CACHE_VIVT - mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ - mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate D cache */ -#endif mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:31:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 803A1B96; Sat, 17 May 2014 21:31: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 52B74294B; Sat, 17 May 2014 21:31: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 s4HLVxP8015333; Sat, 17 May 2014 21:31:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLVwgu015327; Sat, 17 May 2014 21:31:58 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172131.s4HLVwgu015327@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266360 - in stable/10/sys: arm/freescale/imx dev/ata/chipsets dev/vt/hw/fb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:31:59 -0000 Author: ian Date: Sat May 17 21:31:58 2014 New Revision: 266360 URL: http://svnweb.freebsd.org/changeset/base/266360 Log: MFC 264180, 264181, 264182: Follow files.imx51 and add vt support for imx53. Add fsl,imx53 compatible string. Need to include machine/fdt.h in vt_early_fb.c Modified: stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/dev/ata/chipsets/ata-fsl.c stable/10/sys/dev/vt/hw/fb/vt_early_fb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Sat May 17 21:28:49 2014 (r266359) +++ stable/10/sys/arm/freescale/imx/files.imx53 Sat May 17 21:31:58 2014 (r266360) @@ -48,6 +48,8 @@ arm/freescale/imx/i2c.c optional fslii # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc +arm/freescale/imx/imx51_ipuv3_fbd.c optional vt +dev/vt/hw/fb/vt_early_fb.c optional vt # Fast Ethernet Controller dev/ffec/if_ffec.c optional ffec Modified: stable/10/sys/dev/ata/chipsets/ata-fsl.c ============================================================================== --- stable/10/sys/dev/ata/chipsets/ata-fsl.c Sat May 17 21:28:49 2014 (r266359) +++ stable/10/sys/dev/ata/chipsets/ata-fsl.c Sat May 17 21:31:58 2014 (r266360) @@ -72,7 +72,8 @@ imx_ata_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "fsl,imx51-ata")) + if (!ofw_bus_is_compatible(dev, "fsl,imx51-ata") && + !ofw_bus_is_compatible(dev, "fsl,imx53-ata")) return (ENXIO); ctrl = device_get_softc(dev); Modified: stable/10/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_early_fb.c Sat May 17 21:28:49 2014 (r266359) +++ stable/10/sys/dev/vt/hw/fb/vt_early_fb.c Sat May 17 21:31:58 2014 (r266360) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #endif #include From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:35:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E66CBDC4; Sat, 17 May 2014 21:35: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 D35202966; Sat, 17 May 2014 21:35: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 s4HLZQrE016020; Sat, 17 May 2014 21:35:26 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLZQBO016019; Sat, 17 May 2014 21:35:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172135.s4HLZQBO016019@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266361 - stable/10/contrib/compiler-rt/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:35:27 -0000 Author: ian Date: Sat May 17 21:35:26 2014 New Revision: 266361 URL: http://svnweb.freebsd.org/changeset/base/266361 Log: MFC 264190: Mark __fixdfdi/__aeabi_d2lz with COMPILER_RT_ABI so it uses the correct calling convention for __aeabi_* functions. Modified: stable/10/contrib/compiler-rt/lib/fixdfdi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/compiler-rt/lib/fixdfdi.c ============================================================================== --- stable/10/contrib/compiler-rt/lib/fixdfdi.c Sat May 17 21:31:58 2014 (r266360) +++ stable/10/contrib/compiler-rt/lib/fixdfdi.c Sat May 17 21:35:26 2014 (r266361) @@ -25,7 +25,7 @@ ARM_EABI_FNALIAS(d2lz, fixdfdi) -di_int +COMPILER_RT_ABI di_int __fixdfdi(double a) { double_bits fb; From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:39:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BEA49A1; Sat, 17 May 2014 21:39:07 +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 92A782998; Sat, 17 May 2014 21:39:06 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WlmJt-0003k3-8t; Sat, 17 May 2014 21:39:05 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s4HLd2Z2040941; Sat, 17 May 2014 15:39:02 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18p/hK2x2f4saUhunfN5Q32 Subject: Re: svn commit: r266356 - stable/10/sys/arm/conf From: Ian Lepore To: src-committers@FreeBSD.org In-Reply-To: <201405172119.s4HLJi1a003551@svn.freebsd.org> References: <201405172119.s4HLJi1a003551@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 17 May 2014 15:39:01 -0600 Message-ID: <1400362741.1152.8.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-stable@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable-10@FreeBSD.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:39:07 -0000 On Sat, 2014-05-17 at 21:19 +0000, Ian Lepore wrote: > Author: ian > Date: Sat May 17 21:19:44 2014 > New Revision: 266356 > URL: http://svnweb.freebsd.org/changeset/base/266356 > > Log: > MFC 264137: Switch wandboards over to the common IMX6 kernel config, which > has SMP enabled. Also switch IMX6 to use SCHED_ULE. > > Modified: > stable/10/sys/arm/conf/PANDABOARD > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/arm/conf/PANDABOARD > ============================================================================== > --- stable/10/sys/arm/conf/PANDABOARD Sat May 17 21:18:08 2014 (r266355) > +++ stable/10/sys/arm/conf/PANDABOARD Sat May 17 21:19:44 2014 (r266356) > @@ -145,3 +145,4 @@ options FDT_DTB_STATIC > makeoptions FDT_DTS_FILE=pandaboard.dts > > options VFP # vfp/neon > +options SMP # Enable multiple cores > Ooops, paste-o. This should have read "Enable SMP on PANDABOARD". -- Ian From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:46:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F3844564; Sat, 17 May 2014 21:46: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 C5BB92A4A; Sat, 17 May 2014 21:46: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 s4HLkQR5022696; Sat, 17 May 2014 21:46:26 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLkQAH022692; Sat, 17 May 2014 21:46:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172146.s4HLkQAH022692@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266362 - in stable/10/sys: arm/include boot/fdt/dts/arm dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:46:27 -0000 Author: ian Date: Sat May 17 21:46:25 2014 New Revision: 266362 URL: http://svnweb.freebsd.org/changeset/base/266362 Log: MFC 264203, 264204, 264206, 264218: Tell VM we now have ARM platforms with physically discontiguous memory. Define the full 1024M of ram on the imx51 and imx53 boards. Use a more professional uart device description. Modified: stable/10/sys/arm/include/vmparam.h stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts stable/10/sys/dev/uart/uart_dev_imx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/include/vmparam.h ============================================================================== --- stable/10/sys/arm/include/vmparam.h Sat May 17 21:35:26 2014 (r266361) +++ stable/10/sys/arm/include/vmparam.h Sat May 17 21:46:25 2014 (r266362) @@ -77,9 +77,9 @@ #define VM_PHYSSEG_MAX 32 /* - * The physical address space is densely populated. + * The physical address space may be sparsely populated on some ARM systems. */ -#define VM_PHYSSEG_DENSE +#define VM_PHYSSEG_SPARSE /* * Create two free page pools. Since the ARM kernel virtual address Modified: stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sat May 17 21:35:26 2014 (r266361) +++ stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sat May 17 21:46:25 2014 (r266362) @@ -41,7 +41,8 @@ memory { /* RAM 512M */ - reg = <0x70000000 0x20000000>; + reg = <0x70000000 0x10000000 + 0xB0000000 0x10000000>; }; localbus@18000000 { Modified: stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts Sat May 17 21:35:26 2014 (r266361) +++ stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts Sat May 17 21:46:25 2014 (r266362) @@ -41,8 +41,9 @@ compatible = "fsl,imx53-qsb", "fsl,imx53"; memory { - /* RAM 512M */ - reg = <0x70000000 0x20000000>; + /* RAM is 2 banks of 512M each. */ + reg = <0x70000000 0x20000000 + 0xb0000000 0x20000000>; }; localbus@18000000 { Modified: stable/10/sys/dev/uart/uart_dev_imx.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_imx.c Sat May 17 21:35:26 2014 (r266361) +++ stable/10/sys/dev/uart/uart_dev_imx.c Sat May 17 21:46:25 2014 (r266362) @@ -352,7 +352,7 @@ imx_uart_bus_probe(struct uart_softc *sc sc->sc_rxfifosz = 1; sc->sc_txfifosz = 1; - device_set_desc(sc->sc_dev, "imx_uart"); + device_set_desc(sc->sc_dev, "Freescale i.MX UART"); return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:53:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2597E737; Sat, 17 May 2014 21:53: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 125A72AF8; Sat, 17 May 2014 21:53: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 s4HLrY7L028251; Sat, 17 May 2014 21:53:34 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLrYun028249; Sat, 17 May 2014 21:53:34 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172153.s4HLrYun028249@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266363 - in stable/10/sys/arm: cavium conf econa X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:53:35 -0000 Author: ian Date: Sat May 17 21:53:34 2014 New Revision: 266363 URL: http://svnweb.freebsd.org/changeset/base/266363 Log: MFC 264219: Move sys/arm/econa to sys/arm/cavium/cns11xx. Added: stable/10/sys/arm/cavium/ - copied from r264219, head/sys/arm/cavium/ Deleted: stable/10/sys/arm/econa/ Modified: stable/10/sys/arm/conf/CNS11XXNAS stable/10/sys/arm/conf/NOTES Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/CNS11XXNAS ============================================================================== --- stable/10/sys/arm/conf/CNS11XXNAS Sat May 17 21:46:25 2014 (r266362) +++ stable/10/sys/arm/conf/CNS11XXNAS Sat May 17 21:53:34 2014 (r266363) @@ -26,7 +26,7 @@ ident CNS11XXNAS #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 -include "../econa/std.econa" +include "../cavium/cns11xx/std.econa" makeoptions MODULES_OVERRIDE="" Modified: stable/10/sys/arm/conf/NOTES ============================================================================== --- stable/10/sys/arm/conf/NOTES Sat May 17 21:46:25 2014 (r266362) +++ stable/10/sys/arm/conf/NOTES Sat May 17 21:53:34 2014 (r266363) @@ -13,7 +13,7 @@ cpu CPU_XSCALE_IXP435 cpu CPU_XSCALE_PXA2X0 files "../at91/files.at91" -files "../econa/files.econa" +files "../cavium/cns11xx/files.econa" files "../mv/files.mv" files "../mv/discovery/files.db78xxx" files "../mv/kirkwood/files.kirkwood" From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 21:55:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D553B85F; Sat, 17 May 2014 21:55: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 C13502AFC; Sat, 17 May 2014 21:55: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 s4HLt0T7028527; Sat, 17 May 2014 21:55:00 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLt0VM028523; Sat, 17 May 2014 21:55:00 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172155.s4HLt0VM028523@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 21:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266364 - in stable/10/sys/boot/fdt/dts: arm powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:55:00 -0000 Author: ian Date: Sat May 17 21:55:00 2014 New Revision: 266364 URL: http://svnweb.freebsd.org/changeset/base/266364 Log: MFC 264230: Move dts files accidentally placed in arm dir to powerpc dir. Added: stable/10/sys/boot/fdt/dts/powerpc/p1020rdb.dts - copied unchanged from r264230, head/sys/boot/fdt/dts/powerpc/p1020rdb.dts stable/10/sys/boot/fdt/dts/powerpc/p2020ds.dts - copied unchanged from r264230, head/sys/boot/fdt/dts/powerpc/p2020ds.dts stable/10/sys/boot/fdt/dts/powerpc/p2041si.dtsi - copied unchanged from r264230, head/sys/boot/fdt/dts/powerpc/p2041si.dtsi stable/10/sys/boot/fdt/dts/powerpc/p3041si.dtsi - copied unchanged from r264230, head/sys/boot/fdt/dts/powerpc/p3041si.dtsi stable/10/sys/boot/fdt/dts/powerpc/p5020si.dtsi - copied unchanged from r264230, head/sys/boot/fdt/dts/powerpc/p5020si.dtsi Deleted: stable/10/sys/boot/fdt/dts/arm/p1020rdb.dts stable/10/sys/boot/fdt/dts/arm/p2020ds.dts stable/10/sys/boot/fdt/dts/arm/p2041si.dtsi stable/10/sys/boot/fdt/dts/arm/p3041si.dtsi stable/10/sys/boot/fdt/dts/arm/p5020si.dtsi Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/boot/fdt/dts/powerpc/p1020rdb.dts (from r264230, head/sys/boot/fdt/dts/powerpc/p1020rdb.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/powerpc/p1020rdb.dts Sat May 17 21:55:00 2014 (r266364, copy of r264230, head/sys/boot/fdt/dts/powerpc/p1020rdb.dts) @@ -0,0 +1,627 @@ +/* + * P1020 RDB Device Tree Source + * + * Copyright 2009 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``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 Freescale Semiconductor 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$ */ + +/dts-v1/; + +/ { + model = "fsl,P1020"; + compatible = "fsl,P1020RDB"; + #address-cells = <2>; + #size-cells = <2>; + + aliases { + serial0 = &serial0; + serial1 = &serial1; + ethernet0 = &enet0; + ethernet1 = &enet1; + ethernet2 = &enet2; + pci0 = &pci0; + pci1 = &pci1; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,P1020@0 { + device_type = "cpu"; + reg = <0x0>; + next-level-cache = <&L2>; + }; + + PowerPC,P1020@1 { + device_type = "cpu"; + reg = <0x1>; + next-level-cache = <&L2>; + }; + }; + + memory { + device_type = "memory"; + }; + + localbus@ffe05000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "fsl,p1020-elbc", "fsl,elbc", "simple-bus"; + reg = <0 0xffe05000 0 0x1000>; + interrupts = <19 2>; + interrupt-parent = <&mpic>; + + /* NOR, NAND Flashes and Vitesse 5 port L2 switch */ + ranges = <0x0 0x0 0x0 0xef000000 0x01000000 + 0x1 0x0 0x0 0xffa00000 0x00040000 + 0x2 0x0 0x0 0xffb00000 0x00020000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x1000000>; + bank-width = <2>; + device-width = <1>; + + partition@0 { + /* This location must not be altered */ + /* 256KB for Vitesse 7385 Switch firmware */ + reg = <0x0 0x00040000>; + label = "NOR (RO) Vitesse-7385 Firmware"; + read-only; + }; + + partition@40000 { + /* 256KB for DTB Image */ + reg = <0x00040000 0x00040000>; + label = "NOR (RO) DTB Image"; + read-only; + }; + + partition@80000 { + /* 3.5 MB for Linux Kernel Image */ + reg = <0x00080000 0x00380000>; + label = "NOR (RO) Linux Kernel Image"; + read-only; + }; + + partition@400000 { + /* 11MB for JFFS2 based Root file System */ + reg = <0x00400000 0x00b00000>; + label = "NOR (RW) JFFS2 Root File System"; + }; + + partition@f00000 { + /* This location must not be altered */ + /* 512KB for u-boot Bootloader Image */ + /* 512KB for u-boot Environment Variables */ + reg = <0x00f00000 0x00100000>; + label = "NOR (RO) U-Boot Image"; + read-only; + }; + }; + + nand@1,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,p1020-fcm-nand", + "fsl,elbc-fcm-nand"; + reg = <0x1 0x0 0x40000>; + + partition@0 { + /* This location must not be altered */ + /* 1MB for u-boot Bootloader Image */ + reg = <0x0 0x00100000>; + label = "NAND (RO) U-Boot Image"; + read-only; + }; + + partition@100000 { + /* 1MB for DTB Image */ + reg = <0x00100000 0x00100000>; + label = "NAND (RO) DTB Image"; + read-only; + }; + + partition@200000 { + /* 4MB for Linux Kernel Image */ + reg = <0x00200000 0x00400000>; + label = "NAND (RO) Linux Kernel Image"; + read-only; + }; + + partition@600000 { + /* 4MB for Compressed Root file System Image */ + reg = <0x00600000 0x00400000>; + label = "NAND (RO) Compressed RFS Image"; + read-only; + }; + + partition@a00000 { + /* 7MB for JFFS2 based Root file System */ + reg = <0x00a00000 0x00700000>; + label = "NAND (RW) JFFS2 Root File System"; + }; + + partition@1100000 { + /* 15MB for JFFS2 based Root file System */ + reg = <0x01100000 0x00f00000>; + label = "NAND (RW) Writable User area"; + }; + }; + + L2switch@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "vitesse-7385"; + reg = <0x2 0x0 0x20000>; + }; + + }; + + soc@ffe00000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + compatible = "fsl,p1020-immr", "simple-bus"; + ranges = <0x0 0x0 0xffe00000 0x100000>; + bus-frequency = <0>; // Filled out by uboot. + + ecm-law@0 { + compatible = "fsl,ecm-law"; + reg = <0x0 0x1000>; + fsl,num-laws = <12>; + }; + + ecm@1000 { + compatible = "fsl,p1020-ecm", "fsl,ecm"; + reg = <0x1000 0x1000>; + interrupts = <16 2>; + interrupt-parent = <&mpic>; + }; + + memory-controller@2000 { + compatible = "fsl,p1020-memory-controller"; + reg = <0x2000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <16 2>; + }; + + i2c@3000 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <0>; + compatible = "fsl-i2c"; + reg = <0x3000 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + rtc@68 { + compatible = "dallas,ds1339"; + reg = <0x68>; + }; + }; + + i2c@3100 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <1>; + compatible = "fsl-i2c"; + reg = <0x3100 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + }; + + serial0: serial@4500 { + cell-index = <0>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4500 0x100>; + clock-frequency = <0>; + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + serial1: serial@4600 { + cell-index = <1>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4600 0x100>; + clock-frequency = <0>; + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + spi@7000 { + cell-index = <0>; + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,espi"; + reg = <0x7000 0x1000>; + interrupts = <59 0x2>; + interrupt-parent = <&mpic>; + mode = "cpu"; + + fsl_m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,espi-flash"; + reg = <0>; + linux,modalias = "fsl_m25p80"; + modal = "s25sl128b"; + spi-max-frequency = <50000000>; + mode = <0>; + + partition@0 { + /* 512KB for u-boot Bootloader Image */ + reg = <0x0 0x00080000>; + label = "SPI (RO) U-Boot Image"; + read-only; + }; + + partition@80000 { + /* 512KB for DTB Image */ + reg = <0x00080000 0x00080000>; + label = "SPI (RO) DTB Image"; + read-only; + }; + + partition@100000 { + /* 4MB for Linux Kernel Image */ + reg = <0x00100000 0x00400000>; + label = "SPI (RO) Linux Kernel Image"; + read-only; + }; + + partition@500000 { + /* 4MB for Compressed RFS Image */ + reg = <0x00500000 0x00400000>; + label = "SPI (RO) Compressed RFS Image"; + read-only; + }; + + partition@900000 { + /* 7MB for JFFS2 based RFS */ + reg = <0x00900000 0x00700000>; + label = "SPI (RW) JFFS2 RFS"; + }; + }; + }; + + gpio: gpio-controller@f000 { + #gpio-cells = <2>; + compatible = "fsl,mpc8572-gpio"; + reg = <0xf000 0x100>; + interrupts = <47 0x2>; + interrupt-parent = <&mpic>; + gpio-controller; + }; + + L2: l2-cache-controller@20000 { + compatible = "fsl,p1020-l2-cache-controller"; + reg = <0x20000 0x1000>; + cache-line-size = <32>; // 32 bytes + cache-size = <0x40000>; // L2,256K + interrupt-parent = <&mpic>; + interrupts = <16 2>; + }; + + dma@21300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,eloplus-dma"; + reg = <0x21300 0x4>; + ranges = <0x0 0x21100 0x200>; + cell-index = <0>; + dma-channel@0 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&mpic>; + interrupts = <20 2>; + }; + dma-channel@80 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&mpic>; + interrupts = <21 2>; + }; + dma-channel@100 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&mpic>; + interrupts = <22 2>; + }; + dma-channel@180 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupt-parent = <&mpic>; + interrupts = <23 2>; + }; + }; + + mdio@24000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,etsec2-mdio"; + reg = <0x24000 0x1000 0xb0030 0x4>; + + phy0: ethernet-phy@0 { + interrupt-parent = <&mpic>; + interrupts = <3 1>; + reg = <0x0>; + }; + + phy1: ethernet-phy@1 { + interrupt-parent = <&mpic>; + interrupts = <2 1>; + reg = <0x1>; + }; + }; + + mdio@25000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,etsec2-tbi"; + reg = <0x25000 0x1000 0xb1030 0x4>; + + tbi0: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + + enet0: ethernet@b0000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "network"; + model = "eTSEC"; + compatible = "fsl,etsec2"; + fsl,num_rx_queues = <0x8>; + fsl,num_tx_queues = <0x8>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupt-parent = <&mpic>; + fixed-link = <1 1 1000 0 0>; + phy-connection-type = "rgmii-id"; + + queue-group@0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb0000 0x1000>; + interrupts = <29 2 30 2 34 2>; + }; + + queue-group@1 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb4000 0x1000>; + interrupts = <17 2 18 2 24 2>; + }; + }; + + enet1: ethernet@b1000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "network"; + model = "eTSEC"; + compatible = "fsl,etsec2"; + fsl,num_rx_queues = <0x8>; + fsl,num_tx_queues = <0x8>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupt-parent = <&mpic>; + phy-handle = <&phy0>; + tbi-handle = <&tbi0>; + phy-connection-type = "sgmii"; + + queue-group@0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb1000 0x1000>; + interrupts = <35 2 36 2 40 2>; + }; + + queue-group@1 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb5000 0x1000>; + interrupts = <51 2 52 2 67 2>; + }; + }; + + enet2: ethernet@b2000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "network"; + model = "eTSEC"; + compatible = "fsl,etsec2"; + fsl,num_rx_queues = <0x8>; + fsl,num_tx_queues = <0x8>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupt-parent = <&mpic>; + phy-handle = <&phy1>; + phy-connection-type = "rgmii-id"; + + queue-group@0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb2000 0x1000>; + interrupts = <31 2 32 2 33 2>; + }; + + queue-group@1 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb6000 0x1000>; + interrupts = <25 2 26 2 27 2>; + }; + }; + + usb@22000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl-usb2-dr"; + reg = <0x22000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <28 0x2>; + phy_type = "ulpi"; + }; + + /* USB2 is shared with localbus, so it must be disabled + by default. We can't put 'status = "disabled";' here + since U-Boot doesn't clear the status property when + it enables USB2. OTOH, U-Boot does create a new node + when there isn't any. So, just comment it out. + usb@23000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl-usb2-dr"; + reg = <0x23000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <46 0x2>; + phy_type = "ulpi"; + }; + */ + + sdhci@2e000 { + compatible = "fsl,p1020-esdhc", "fsl,esdhc"; + reg = <0x2e000 0x1000>; + interrupts = <72 0x2>; + interrupt-parent = <&mpic>; + /* Filled in by U-Boot */ + clock-frequency = <0>; + }; + + crypto@30000 { + compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4", + "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0"; + reg = <0x30000 0x10000>; + interrupts = <45 2 58 2>; + interrupt-parent = <&mpic>; + fsl,num-channels = <4>; + fsl,channel-fifo-len = <24>; + fsl,exec-units-mask = <0xbfe>; + fsl,descriptor-types-mask = <0x3ab0ebf>; + }; + + mpic: pic@40000 { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <2>; + reg = <0x40000 0x40000>; + compatible = "chrp,open-pic"; + device_type = "open-pic"; + }; + + msi@41600 { + compatible = "fsl,p1020-msi", "fsl,mpic-msi"; + reg = <0x41600 0x80>; + msi-available-ranges = <0 0x100>; + interrupts = < + 0xe0 0 + 0xe1 0 + 0xe2 0 + 0xe3 0 + 0xe4 0 + 0xe5 0 + 0xe6 0 + 0xe7 0>; + interrupt-parent = <&mpic>; + }; + + global-utilities@e0000 { //global utilities block + compatible = "fsl,p1020-guts"; + reg = <0xe0000 0x1000>; + fsl,has-rstcr; + }; + }; + + pci0: pcie@ffe09000 { + compatible = "fsl,mpc8548-pcie"; + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0 0xffe09000 0 0x1000>; + bus-range = <0 255>; + ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0 0xffc30000 0x0 0x10000>; + clock-frequency = <33333333>; + interrupt-parent = <&mpic>; + interrupts = <16 2>; + pcie@0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + ranges = <0x2000000 0x0 0xa0000000 + 0x2000000 0x0 0xa0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x100000>; + }; + }; + + pci1: pcie@ffe0a000 { + compatible = "fsl,mpc8548-pcie"; + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0 0xffe0a000 0 0x1000>; + bus-range = <0 255>; + ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>; + clock-frequency = <33333333>; + interrupt-parent = <&mpic>; + interrupts = <16 2>; + pcie@0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + ranges = <0x2000000 0x0 0xc0000000 + 0x2000000 0x0 0xc0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x100000>; + }; + }; +}; Copied: stable/10/sys/boot/fdt/dts/powerpc/p2020ds.dts (from r264230, head/sys/boot/fdt/dts/powerpc/p2020ds.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/powerpc/p2020ds.dts Sat May 17 21:55:00 2014 (r266364, copy of r264230, head/sys/boot/fdt/dts/powerpc/p2020ds.dts) @@ -0,0 +1,754 @@ +/* + * P2020 DS Device Tree Source + * + * Copyright 2009 Freescale Semiconductor Inc. + * + * Neither the name of Freescale Semiconductor, Inc nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Freescale hereby publishes it under the following licenses: + * + * BSD License + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * GNU General Public License, version 2 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * You may select the license of your choice. + *------------------------------------------------------------------ + */ +/* $FreeBSD$ */ + +/dts-v1/; +/ { + model = "fsl,P2020"; + compatible = "fsl,P2020DS"; + #address-cells = <2>; + #size-cells = <2>; + + aliases { + ethernet0 = &enet0; + ethernet1 = &enet1; + ethernet2 = &enet2; + serial0 = &serial0; + serial1 = &serial1; + pci0 = &pci0; + pci1 = &pci1; + pci2 = &pci2; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,P2020@0 { + device_type = "cpu"; + reg = <0x0>; + next-level-cache = <&L2>; + }; + + PowerPC,P2020@1 { + device_type = "cpu"; + reg = <0x1>; + next-level-cache = <&L2>; + }; + }; + + memory { + device_type = "memory"; + }; + + localbus@ffe05000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "fsl,elbc", "simple-bus"; + reg = <0 0xffe05000 0 0x1000>; + interrupts = <19 2>; + interrupt-parent = <&mpic>; + + ranges = <0x0 0x0 0x0 0xe8000000 0x08000000 + 0x1 0x0 0x0 0xe0000000 0x08000000 + 0x2 0x0 0x0 0xffa00000 0x00040000 + 0x3 0x0 0x0 0xffdf0000 0x00008000 + 0x4 0x0 0x0 0xffa40000 0x00040000 + 0x5 0x0 0x0 0xffa80000 0x00040000 + 0x6 0x0 0x0 0xffac0000 0x00040000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x8000000>; + bank-width = <2>; + device-width = <1>; + + ramdisk@0 { + reg = <0x0 0x03000000>; + read-only; + }; + + diagnostic@3000000 { + reg = <0x03000000 0x00e00000>; + read-only; + }; + + dink@3e00000 { + reg = <0x03e00000 0x00200000>; + read-only; + }; + + kernel@4000000 { + reg = <0x04000000 0x00400000>; + read-only; + }; + + jffs2@4400000 { + reg = <0x04400000 0x03b00000>; + }; + + dtb@7f00000 { + reg = <0x07f00000 0x00080000>; + read-only; + }; + + u-boot@7f80000 { + reg = <0x07f80000 0x00080000>; + read-only; + }; + }; + + nand@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,elbc-fcm-nand"; + reg = <0x2 0x0 0x40000>; + + u-boot@0 { + reg = <0x0 0x02000000>; + read-only; + }; + + jffs2@2000000 { + reg = <0x02000000 0x10000000>; + }; + + ramdisk@12000000 { + reg = <0x12000000 0x08000000>; + read-only; + }; + + kernel@1a000000 { + reg = <0x1a000000 0x04000000>; + }; + + dtb@1e000000 { + reg = <0x1e000000 0x01000000>; + read-only; + }; + + empty@1f000000 { + reg = <0x1f000000 0x21000000>; + }; + }; + + nand@4,0 { + compatible = "fsl,elbc-fcm-nand"; + reg = <0x4 0x0 0x40000>; + }; + + nand@5,0 { + compatible = "fsl,elbc-fcm-nand"; + reg = <0x5 0x0 0x40000>; + }; + + nand@6,0 { + compatible = "fsl,elbc-fcm-nand"; + reg = <0x6 0x0 0x40000>; + }; + }; + + soc@ffe00000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + compatible = "fsl,p2020-immr", "simple-bus"; + ranges = <0x0 0 0xffe00000 0x100000>; + bus-frequency = <0>; // Filled out by uboot. + + ecm-law@0 { + compatible = "fsl,ecm-law"; + reg = <0x0 0x1000>; + fsl,num-laws = <12>; + }; + + ecm@1000 { + compatible = "fsl,p2020-ecm", "fsl,ecm"; + reg = <0x1000 0x1000>; + interrupts = <17 2>; + interrupt-parent = <&mpic>; + }; + + memory-controller@2000 { + compatible = "fsl,p2020-memory-controller"; + reg = <0x2000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <18 2>; + }; + + i2c@3000 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <0>; + compatible = "fsl-i2c"; + reg = <0x3000 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + }; + + i2c@3100 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <1>; + compatible = "fsl-i2c"; + reg = <0x3100 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + }; + + serial0: serial@4500 { + cell-index = <0>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4500 0x100>; + clock-frequency = <0>; + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + serial1: serial@4600 { + cell-index = <1>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4600 0x100>; + clock-frequency = <0>; + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + spi@7000 { + compatible = "fsl,espi"; + reg = <0x7000 0x1000>; + interrupts = <59 0x2>; + interrupt-parent = <&mpic>; + }; + + dma@c300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,eloplus-dma"; + reg = <0xc300 0x4>; + ranges = <0x0 0xc100 0x200>; + cell-index = <1>; + dma-channel@0 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&mpic>; + interrupts = <76 2>; + }; + dma-channel@80 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&mpic>; + interrupts = <77 2>; + }; + dma-channel@100 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&mpic>; + interrupts = <78 2>; + }; + dma-channel@180 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupt-parent = <&mpic>; + interrupts = <79 2>; + }; + }; + + gpio: gpio-controller@f000 { + #gpio-cells = <2>; + compatible = "fsl,mpc8572-gpio"; + reg = <0xf000 0x100>; + interrupts = <47 0x2>; + interrupt-parent = <&mpic>; + gpio-controller; + }; + + L2: l2-cache-controller@20000 { + compatible = "fsl,p2020-l2-cache-controller"; + reg = <0x20000 0x1000>; + cache-line-size = <32>; // 32 bytes + cache-size = <0x80000>; // L2, 512k + interrupt-parent = <&mpic>; + interrupts = <16 2>; + }; + + dma@21300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,eloplus-dma"; + reg = <0x21300 0x4>; + ranges = <0x0 0x21100 0x200>; + cell-index = <0>; + dma-channel@0 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&mpic>; + interrupts = <20 2>; + }; + dma-channel@80 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&mpic>; + interrupts = <21 2>; + }; + dma-channel@100 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&mpic>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 22:00:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 76A879E1; Sat, 17 May 2014 22:00: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 61F522B1C; Sat, 17 May 2014 22:00: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 s4HM0Ci5032286; Sat, 17 May 2014 22:00:12 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HM0ALV032275; Sat, 17 May 2014 22:00:10 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172200.s4HM0ALV032275@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 22:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266365 - in stable/10/sys: arm/conf arm/freescale/imx boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 22:00:12 -0000 Author: ian Date: Sat May 17 22:00:10 2014 New Revision: 266365 URL: http://svnweb.freebsd.org/changeset/base/266365 Log: MFC 264251: Updates to i.MX53: * Define support for the SDHCI driver, although it doesn't work yet * Fix the memory mappings for IPU Modified: stable/10/sys/arm/conf/DIGI-CCWMX53 stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/arm/freescale/imx/imx51_ipuv3.c stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c stable/10/sys/arm/freescale/imx/imx51_ipuv3reg.h stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- stable/10/sys/arm/conf/DIGI-CCWMX53 Sat May 17 21:55:00 2014 (r266364) +++ stable/10/sys/arm/conf/DIGI-CCWMX53 Sat May 17 22:00:10 2014 (r266365) @@ -169,6 +169,12 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm +# MMC +#device sdhci # SD controller +#device mmc # SD/MMC protocol +#device mmcsd # SDCard disk device + + # Flattened Device Tree options FDT options FDT_DTB_STATIC @@ -177,6 +183,7 @@ makeoptions FDT_DTS_FILE=digi-ccwmx5 # NOTE: serial console will be disabled if syscons enabled # Uncomment following lines for framebuffer/syscons support #device sc +#device vt #device kbdmux #options SC_DFLT_FONT # compile font in #makeoptions SC_DFLT_FONT=cp437 Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Sat May 17 21:55:00 2014 (r266364) +++ stable/10/sys/arm/freescale/imx/files.imx53 Sat May 17 22:00:10 2014 (r266365) @@ -36,6 +36,9 @@ arm/freescale/imx/imx51_ccm.c standard # i.MX5xx PATA controller dev/ata/chipsets/ata-fsl.c optional imxata +# SDHCI/MMC +arm/freescale/imx/imx_sdhci.c optional sdhci + # USB OH3 controller (1 OTG, 3 EHCI) arm/freescale/imx/imx_nop_usbphy.c optional ehci dev/usb/controller/ehci_imx.c optional ehci Modified: stable/10/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ipuv3.c Sat May 17 21:55:00 2014 (r266364) +++ stable/10/sys/arm/freescale/imx/imx51_ipuv3.c Sat May 17 22:00:10 2014 (r266365) @@ -260,7 +260,7 @@ ipu3_fb_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "fsl,ipu3")) return (ENXIO); - device_set_desc(dev, "i.MX515 Image Processing Unit (FB)"); + device_set_desc(dev, "i.MX5x Image Processing Unit v3 (FB)"); error = sc_probe_unit(device_get_unit(dev), device_get_flags(dev) | SC_AUTODETECT_KBD); @@ -277,15 +277,19 @@ ipu3_fb_attach(device_t dev) struct ipu3sc_softc *sc = device_get_softc(dev); bus_space_tag_t iot; bus_space_handle_t ioh; + phandle_t node; + pcell_t reg; int err; + uintptr_t base; if (ipu3sc_softc) return (ENXIO); ipu3sc_softc = sc; - device_printf(dev, "\tclock gate status is %d\n", - imx51_get_clk_gating(IMX51CLK_IPU_HSP_CLK_ROOT)); + if (bootverbose) + device_printf(dev, "clock gate status is %d\n", + imx51_get_clk_gating(IMX51CLK_IPU_HSP_CLK_ROOT)); sc->dev = dev; @@ -300,58 +304,71 @@ ipu3_fb_attach(device_t dev) sc = device_get_softc(dev); sc->iot = iot = fdtbus_bs_tag; - device_printf(sc->dev, ": i.MX51 IPUV3 controller\n"); - + /* + * Retrieve the device address based on the start address in the + * DTS. The DTS for i.MX51 specifies 0x5e000000 as the first register + * address, so we just subtract IPU_CM_BASE to get the offset at which + * the IPU device was memory mapped. + * On i.MX53, the offset is 0. + */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "reg", ®, sizeof(reg))) <= 0) + base = 0; + else + base = fdt32_to_cpu(reg) - IPU_CM_BASE(0); /* map controller registers */ - err = bus_space_map(iot, IPU_CM_BASE, IPU_CM_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_CM_BASE(base), IPU_CM_SIZE, 0, &ioh); if (err) goto fail_retarn_cm; sc->cm_ioh = ioh; /* map Display Multi FIFO Controller registers */ - err = bus_space_map(iot, IPU_DMFC_BASE, IPU_DMFC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DMFC_BASE(base), IPU_DMFC_SIZE, 0, &ioh); if (err) goto fail_retarn_dmfc; sc->dmfc_ioh = ioh; /* map Display Interface 0 registers */ - err = bus_space_map(iot, IPU_DI0_BASE, IPU_DI0_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DI0_BASE(base), IPU_DI0_SIZE, 0, &ioh); if (err) goto fail_retarn_di0; sc->di0_ioh = ioh; /* map Display Interface 1 registers */ - err = bus_space_map(iot, IPU_DI1_BASE, IPU_DI0_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DI1_BASE(base), IPU_DI0_SIZE, 0, &ioh); if (err) goto fail_retarn_di1; sc->di1_ioh = ioh; /* map Display Processor registers */ - err = bus_space_map(iot, IPU_DP_BASE, IPU_DP_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DP_BASE(base), IPU_DP_SIZE, 0, &ioh); if (err) goto fail_retarn_dp; sc->dp_ioh = ioh; /* map Display Controller registers */ - err = bus_space_map(iot, IPU_DC_BASE, IPU_DC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DC_BASE(base), IPU_DC_SIZE, 0, &ioh); if (err) goto fail_retarn_dc; sc->dc_ioh = ioh; /* map Image DMA Controller registers */ - err = bus_space_map(iot, IPU_IDMAC_BASE, IPU_IDMAC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_IDMAC_BASE(base), IPU_IDMAC_SIZE, 0, + &ioh); if (err) goto fail_retarn_idmac; sc->idmac_ioh = ioh; /* map CPMEM registers */ - err = bus_space_map(iot, IPU_CPMEM_BASE, IPU_CPMEM_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_CPMEM_BASE(base), IPU_CPMEM_SIZE, 0, + &ioh); if (err) goto fail_retarn_cpmem; sc->cpmem_ioh = ioh; /* map DCTEMPL registers */ - err = bus_space_map(iot, IPU_DCTMPL_BASE, IPU_DCTMPL_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DCTMPL_BASE(base), IPU_DCTMPL_SIZE, 0, + &ioh); if (err) goto fail_retarn_dctmpl; sc->dctmpl_ioh = ioh; Modified: stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Sat May 17 21:55:00 2014 (r266364) +++ stable/10/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Sat May 17 22:00:10 2014 (r266365) @@ -190,7 +190,7 @@ ipu3_fb_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "fsl,ipu3")) return (ENXIO); - device_set_desc(dev, "i.MX515 Image Processing Unit (FB)"); + device_set_desc(dev, "i.MX5x Image Processing Unit v3 (FB)"); return (BUS_PROBE_DEFAULT); } @@ -201,70 +201,87 @@ ipu3_fb_attach(device_t dev) struct ipu3sc_softc *sc = device_get_softc(dev); bus_space_tag_t iot; bus_space_handle_t ioh; - int err; + phandle_t node; + pcell_t reg; + int err; + uintptr_t base; ipu3sc_softc = sc; - device_printf(dev, "\tclock gate status is %d\n", - imx51_get_clk_gating(IMX51CLK_IPU_HSP_CLK_ROOT)); + if (bootverbose) + device_printf(dev, "clock gate status is %d\n", + imx51_get_clk_gating(IMX51CLK_IPU_HSP_CLK_ROOT)); sc->dev = dev; sc = device_get_softc(dev); sc->iot = iot = fdtbus_bs_tag; - device_printf(sc->dev, ": i.MX51 IPUV3 controller\n"); - + /* + * Retrieve the device address based on the start address in the + * DTS. The DTS for i.MX51 specifies 0x5e000000 as the first register + * address, so we just subtract IPU_CM_BASE to get the offset at which + * the IPU device was memory mapped. + * On i.MX53, the offset is 0. + */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "reg", ®, sizeof(reg))) <= 0) + base = 0; + else + base = fdt32_to_cpu(reg) - IPU_CM_BASE(0); /* map controller registers */ - err = bus_space_map(iot, IPU_CM_BASE, IPU_CM_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_CM_BASE(base), IPU_CM_SIZE, 0, &ioh); if (err) goto fail_retarn_cm; sc->cm_ioh = ioh; /* map Display Multi FIFO Controller registers */ - err = bus_space_map(iot, IPU_DMFC_BASE, IPU_DMFC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DMFC_BASE(base), IPU_DMFC_SIZE, 0, &ioh); if (err) goto fail_retarn_dmfc; sc->dmfc_ioh = ioh; /* map Display Interface 0 registers */ - err = bus_space_map(iot, IPU_DI0_BASE, IPU_DI0_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DI0_BASE(base), IPU_DI0_SIZE, 0, &ioh); if (err) goto fail_retarn_di0; sc->di0_ioh = ioh; /* map Display Interface 1 registers */ - err = bus_space_map(iot, IPU_DI1_BASE, IPU_DI0_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DI1_BASE(base), IPU_DI0_SIZE, 0, &ioh); if (err) goto fail_retarn_di1; sc->di1_ioh = ioh; /* map Display Processor registers */ - err = bus_space_map(iot, IPU_DP_BASE, IPU_DP_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DP_BASE(base), IPU_DP_SIZE, 0, &ioh); if (err) goto fail_retarn_dp; sc->dp_ioh = ioh; /* map Display Controller registers */ - err = bus_space_map(iot, IPU_DC_BASE, IPU_DC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DC_BASE(base), IPU_DC_SIZE, 0, &ioh); if (err) goto fail_retarn_dc; sc->dc_ioh = ioh; /* map Image DMA Controller registers */ - err = bus_space_map(iot, IPU_IDMAC_BASE, IPU_IDMAC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_IDMAC_BASE(base), IPU_IDMAC_SIZE, 0, + &ioh); if (err) goto fail_retarn_idmac; sc->idmac_ioh = ioh; /* map CPMEM registers */ - err = bus_space_map(iot, IPU_CPMEM_BASE, IPU_CPMEM_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_CPMEM_BASE(base), IPU_CPMEM_SIZE, 0, + &ioh); if (err) goto fail_retarn_cpmem; sc->cpmem_ioh = ioh; /* map DCTEMPL registers */ - err = bus_space_map(iot, IPU_DCTMPL_BASE, IPU_DCTMPL_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DCTMPL_BASE(base), IPU_DCTMPL_SIZE, 0, + &ioh); if (err) goto fail_retarn_dctmpl; sc->dctmpl_ioh = ioh; Modified: stable/10/sys/arm/freescale/imx/imx51_ipuv3reg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ipuv3reg.h Sat May 17 21:55:00 2014 (r266364) +++ stable/10/sys/arm/freescale/imx/imx51_ipuv3reg.h Sat May 17 22:00:10 2014 (r266365) @@ -877,43 +877,46 @@ #define GPU_BASE 0x30000000 #define GPU_SIZE 0x10000000 -/* Image Prossasing Unit */ -#define IPU_BASE 0x40000000 -#define IPU_CM_BASE (IPU_BASE + 0x1e000000) -#define IPU_CM_SIZE 0x8000 -#define IPU_IDMAC_BASE (IPU_BASE + 0x1e008000) -#define IPU_IDMAC_SIZE 0x8000 -#define IPU_DP_BASE (IPU_BASE + 0x1e018000) -#define IPU_DP_SIZE 0x8000 -#define IPU_IC_BASE (IPU_BASE + 0x1e020000) -#define IPU_IC_SIZE 0x8000 -#define IPU_IRT_BASE (IPU_BASE + 0x1e028000) -#define IPU_IRT_SIZE 0x8000 -#define IPU_CSI0_BASE (IPU_BASE + 0x1e030000) -#define IPU_CSI0_SIZE 0x8000 -#define IPU_CSI1_BASE (IPU_BASE + 0x1e038000) -#define IPU_CSI1_SIZE 0x8000 -#define IPU_DI0_BASE (IPU_BASE + 0x1e040000) -#define IPU_DI0_SIZE 0x8000 -#define IPU_DI1_BASE (IPU_BASE + 0x1e048000) -#define IPU_DI1_SIZE 0x8000 -#define IPU_SMFC_BASE (IPU_BASE + 0x1e050000) -#define IPU_SMFC_SIZE 0x8000 -#define IPU_DC_BASE (IPU_BASE + 0x1e058000) -#define IPU_DC_SIZE 0x8000 -#define IPU_DMFC_BASE (IPU_BASE + 0x1e060000) -#define IPU_DMFC_SIZE 0x8000 -#define IPU_VDI_BASE (IPU_BASE + 0x1e068000) -#define IPU_VDI_SIZE 0x8000 -#define IPU_CPMEM_BASE (IPU_BASE + 0x1f000000) -#define IPU_CPMEM_SIZE 0x20000 -#define IPU_LUT_BASE (IPU_BASE + 0x1f020000) -#define IPU_LUT_SIZE 0x20000 -#define IPU_SRM_BASE (IPU_BASE + 0x1f040000) -#define IPU_SRM_SIZE 0x20000 -#define IPU_TPM_BASE (IPU_BASE + 0x1f060000) -#define IPU_TPM_SIZE 0x20000 -#define IPU_DCTMPL_BASE (IPU_BASE + 0x1f080000) -#define IPU_DCTMPL_SIZE 0x20000 +/* + * Image Processing Unit + * + * All addresses are relative to the base SoC address. + */ +#define IPU_CM_BASE(_base) ((_base) + 0x1e000000) +#define IPU_CM_SIZE 0x8000 +#define IPU_IDMAC_BASE(_base) ((_base) + 0x1e008000) +#define IPU_IDMAC_SIZE 0x8000 +#define IPU_DP_BASE(_base) ((_base) + 0x1e018000) +#define IPU_DP_SIZE 0x8000 +#define IPU_IC_BASE(_base) ((_base) + 0x1e020000) +#define IPU_IC_SIZE 0x8000 +#define IPU_IRT_BASE(_base) ((_base) + 0x1e028000) +#define IPU_IRT_SIZE 0x8000 +#define IPU_CSI0_BASE(_base) ((_base) + 0x1e030000) +#define IPU_CSI0_SIZE 0x8000 +#define IPU_CSI1_BASE(_base) ((_base) + 0x1e038000) +#define IPU_CSI1_SIZE 0x8000 +#define IPU_DI0_BASE(_base) ((_base) + 0x1e040000) +#define IPU_DI0_SIZE 0x8000 +#define IPU_DI1_BASE(_base) ((_base) + 0x1e048000) +#define IPU_DI1_SIZE 0x8000 +#define IPU_SMFC_BASE(_base) ((_base) + 0x1e050000) +#define IPU_SMFC_SIZE 0x8000 +#define IPU_DC_BASE(_base) ((_base) + 0x1e058000) +#define IPU_DC_SIZE 0x8000 +#define IPU_DMFC_BASE(_base) ((_base) + 0x1e060000) +#define IPU_DMFC_SIZE 0x8000 +#define IPU_VDI_BASE(_base) ((_base) + 0x1e068000) +#define IPU_VDI_SIZE 0x8000 +#define IPU_CPMEM_BASE(_base) ((_base) + 0x1f000000) +#define IPU_CPMEM_SIZE 0x20000 +#define IPU_LUT_BASE(_base) ((_base) + 0x1f020000) +#define IPU_LUT_SIZE 0x20000 +#define IPU_SRM_BASE(_base) ((_base) + 0x1f040000) +#define IPU_SRM_SIZE 0x20000 +#define IPU_TPM_BASE(_base) ((_base) + 0x1f060000) +#define IPU_TPM_SIZE 0x20000 +#define IPU_DCTMPL_BASE(_base) ((_base) + 0x1f080000) +#define IPU_DCTMPL_SIZE 0x20000 #endif /* _ARM_IMX_IMX51_IPUV3REG_H */ Modified: stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sat May 17 21:55:00 2014 (r266364) +++ stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sat May 17 22:00:10 2014 (r266365) @@ -46,7 +46,7 @@ }; localbus@18000000 { - ipu3@18000000 { + ipu3@1E000000 { status = "okay"; }; }; Modified: stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts Sat May 17 21:55:00 2014 (r266364) +++ stable/10/sys/boot/fdt/dts/arm/imx53-qsb.dts Sat May 17 22:00:10 2014 (r266365) @@ -47,7 +47,7 @@ }; localbus@18000000 { - ipu3@18000000 { + ipu3@1E000000 { status = "okay"; }; }; Modified: stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi Sat May 17 21:55:00 2014 (r266364) +++ stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi Sat May 17 22:00:10 2014 (r266365) @@ -657,27 +657,27 @@ ranges; - vga: ipu3@18000000 { + vga: ipu3@1E000000 { compatible = "fsl,ipu3"; reg = < - 0x18000000 0x08000 /* CM */ - 0x18008000 0x08000 /* IDMAC */ - 0x18018000 0x08000 /* DP */ - 0x18020000 0x08000 /* IC */ - 0x18028000 0x08000 /* IRT */ - 0x18030000 0x08000 /* CSI0 */ - 0x18038000 0x08000 /* CSI1 */ - 0x18040000 0x08000 /* DI0 */ - 0x18048000 0x08000 /* DI1 */ - 0x18050000 0x08000 /* SMFC */ - 0x18058000 0x08000 /* DC */ - 0x18060000 0x08000 /* DMFC */ - 0x18068000 0x08000 /* VDI */ - 0x19000000 0x20000 /* CPMEM */ - 0x19020000 0x20000 /* LUT */ - 0x19040000 0x20000 /* SRM */ - 0x19060000 0x20000 /* TPM */ - 0x19080000 0x20000 /* DCTMPL */ + 0x1E000000 0x08000 /* CM */ + 0x1E008000 0x08000 /* IDMAC */ + 0x1E018000 0x08000 /* DP */ + 0x1E020000 0x08000 /* IC */ + 0x1E028000 0x08000 /* IRT */ + 0x1E030000 0x08000 /* CSI0 */ + 0x1E038000 0x08000 /* CSI1 */ + 0x1E040000 0x08000 /* DI0 */ + 0x1E048000 0x08000 /* DI1 */ + 0x1E050000 0x08000 /* SMFC */ + 0x1E058000 0x08000 /* DC */ + 0x1E060000 0x08000 /* DMFC */ + 0x1E068000 0x08000 /* VDI */ + 0x1F000000 0x20000 /* CPMEM */ + 0x1F020000 0x20000 /* LUT */ + 0x1F040000 0x20000 /* SRM */ + 0x1F060000 0x20000 /* TPM */ + 0x1F080000 0x20000 /* DCTMPL */ >; interrupt-parent = <&tzic>; interrupts = < From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 22:01:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C54B8B13; Sat, 17 May 2014 22:01: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 B26FE2B27; Sat, 17 May 2014 22:01: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 s4HM1H8T034274; Sat, 17 May 2014 22:01:17 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HM1Ha3034273; Sat, 17 May 2014 22:01:17 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172201.s4HM1Ha3034273@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 22:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266366 - stable/10/sys/dev/ata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 22:01:17 -0000 Author: ian Date: Sat May 17 22:01:17 2014 New Revision: 266366 URL: http://svnweb.freebsd.org/changeset/base/266366 Log: MFC 264389: Fix the style of ata_interrupt_locked(). Modified: stable/10/sys/dev/ata/ata-all.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ata/ata-all.c ============================================================================== --- stable/10/sys/dev/ata/ata-all.c Sat May 17 22:00:10 2014 (r266365) +++ stable/10/sys/dev/ata/ata-all.c Sat May 17 22:01:17 2014 (r266366) @@ -360,24 +360,23 @@ ata_interrupt(void *data) static void ata_interrupt_locked(void *data) { - struct ata_channel *ch = (struct ata_channel *)data; - struct ata_request *request; + struct ata_channel *ch = (struct ata_channel *)data; + struct ata_request *request; - do { /* ignore interrupt if its not for us */ if (ch->hw.status && !ch->hw.status(ch->dev)) - break; + return; /* do we have a running request */ if (!(request = ch->running)) - break; + return; ATA_DEBUG_RQ(request, "interrupt"); /* safetycheck for the right state */ if (ch->state == ATA_IDLE) { - device_printf(request->dev, "interrupt on idle channel ignored\n"); - break; + device_printf(request->dev, "interrupt on idle channel ignored\n"); + return; } /* @@ -385,13 +384,12 @@ ata_interrupt_locked(void *data) * if it finishes immediately otherwise wait for next interrupt */ if (ch->hw.end_transaction(request) == ATA_OP_FINISHED) { - ch->running = NULL; - if (ch->state == ATA_ACTIVE) - ch->state = ATA_IDLE; - ata_cam_end_transaction(ch->dev, request); - return; + ch->running = NULL; + if (ch->state == ATA_ACTIVE) + ch->state = ATA_IDLE; + ata_cam_end_transaction(ch->dev, request); + return; } - } while (0); } static void From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 22:02:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6416DC64; Sat, 17 May 2014 22:02: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 50C4D2B99; Sat, 17 May 2014 22:02: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 s4HM2RDx034506; Sat, 17 May 2014 22:02:27 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HM2Qic034501; Sat, 17 May 2014 22:02:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172202.s4HM2Qic034501@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 22:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266367 - stable/10/sys/boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 22:02:27 -0000 Author: ian Date: Sat May 17 22:02:26 2014 New Revision: 266367 URL: http://svnweb.freebsd.org/changeset/base/266367 Log: MFC 264428: Improve the i.MX53 / Digi DTS: * Fix the IPU address. * Fix the PATA definition. * Add another I2C. * Add more UARTs. * Add SATA. Modified: stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sat May 17 22:01:17 2014 (r266366) +++ stable/10/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sat May 17 22:02:26 2014 (r266367) @@ -45,7 +45,10 @@ 0xB0000000 0x10000000>; }; - localbus@18000000 { + localbus@10000000 { + sata@10000000 { + status = "okay"; + }; ipu3@1E000000 { status = "okay"; }; @@ -69,13 +72,19 @@ timer@53fa0000 { status = "okay"; }; - /* UART1, console */ console: serial@53fbc000 { status = "okay"; clock-frequency = <0>; /* won't load w/o this */ }; - + serial@53fc0000 { + status = "okay"; + clock-frequency = <0>; /* won't load w/o this */ + }; + serial@53ff0000 { + status = "okay"; + clock-frequency = <0>; /* won't load w/o this */ + }; clock@53fd4000 { status = "okay"; }; @@ -100,6 +109,14 @@ wdog@53f98000 { status = "okay"; }; + i2c@53fec000 { + status = "okay"; + rtc@68 { + compatible = "dialog,ds9052"; + reg = <0x48>; + interrupts = <0x1 0x1 0 0>; + }; + }; }; aips@60000000 { ethernet@63fec000 { @@ -118,6 +135,9 @@ ide@63fe0000 { status = "okay"; }; + serial@63f90000 { + status = "okay"; + }; }; }; Modified: stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi Sat May 17 22:01:17 2014 (r266366) +++ stable/10/sys/boot/fdt/dts/arm/imx53x.dtsi Sat May 17 22:02:26 2014 (r266367) @@ -282,7 +282,13 @@ /* 50028000 0x4000 SPDIF */ /* 91 SPDIF */ - /* 50030000 0x4000 PATA (PORT UDMA) irq70 */ + pata@50030000 { + compatible = "fsl,imx53-ata"; + reg = <0x50030000 0x4000>; + interrupt-parent = <&tzic>; + interrupts = <70>; + status = "disabled"; + }; /* 50034000 0x4000 SLM */ /* 50038000 0x4000 HSI2C */ @@ -444,7 +450,7 @@ status = "disabled"; }; - /* 53FC0000 0x4000 UART 4 */ + /* 53FF0000 0x4000 UART 4 */ uart4: serial@53ff0000 { compatible = "fsl,imx53-uart", "fsl,imx-uart"; reg = <0x53ff0000 0x4000>; @@ -469,17 +475,16 @@ interrupts = <73 74>; status = "disabled"; }; - - /* 53FE8000 0x4000 PATA (PORT PIO) */ - /* 70 PATA Parallel ATA host controller interrupt */ - ide@53fe8000 { - compatible = "fsl,imx53-ata"; - reg = <0x83fe0000 0x4000>; + i2c@53fec000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,imx53-i2c", "fsl,imx1-i2c", + "fsl,imx-i2c"; + reg = <0x53fec000 0x4000>; interrupt-parent = <&tzic>; - interrupts = <70>; + interrupts = <64>; status = "disabled"; }; - }; aips@60000000 { /* AIPS2 */ @@ -489,7 +494,7 @@ interrupt-parent = <&tzic>; ranges; - /* 53FC0000 0x4000 UART 5 */ + /* 63F90000 0x4000 UART 5 */ uart5: serial@63f90000 { compatible = "fsl,imx53-uart", "fsl,imx-uart"; reg = <0x63f90000 0x4000>; @@ -650,13 +655,20 @@ }; }; - localbus@18000000 { + localbus@10000000 { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; - ranges; + sata@10000000 { + compatible = "fsl,imx53-ata"; + reg = <0x10000000 0x4000>; + interrupt-parent = <&tzic>; + interrupts = <28>; + status = "disabled"; + }; + vga: ipu3@1E000000 { compatible = "fsl,ipu3"; reg = < From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 22:03:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DF7D5DA0; Sat, 17 May 2014 22:03: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 CCA662BA2; Sat, 17 May 2014 22:03: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 s4HM3iAp034752; Sat, 17 May 2014 22:03:44 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HM3iwZ034751; Sat, 17 May 2014 22:03:44 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172203.s4HM3iwZ034751@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 22:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266368 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 22:03:45 -0000 Author: ian Date: Sat May 17 22:03:44 2014 New Revision: 266368 URL: http://svnweb.freebsd.org/changeset/base/266368 Log: MFC 264694: Fix a comment typo; conversion tables are for leap years. Modified: stable/10/sys/kern/subr_fattime.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_fattime.c ============================================================================== --- stable/10/sys/kern/subr_fattime.c Sat May 17 22:02:26 2014 (r266367) +++ stable/10/sys/kern/subr_fattime.c Sat May 17 22:03:44 2014 (r266368) @@ -51,7 +51,7 @@ * The 'utc' argument determines if the resulting FATTIME timestamp * should be on the UTC or local timezone calendar. * - * The conversion functions below cut time into four-year leap-second + * The conversion functions below cut time into four-year leap-year * cycles rather than single years and uses table lookups inside those * cycles to get the months and years sorted out. * From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 22:05:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3BD88EDD; Sat, 17 May 2014 22:05: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 2942B2BAB; Sat, 17 May 2014 22:05: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 s4HM5WWI035110; Sat, 17 May 2014 22:05:32 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HM5WTL035108; Sat, 17 May 2014 22:05:32 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172205.s4HM5WTL035108@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 22:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266369 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 22:05:32 -0000 Author: ian Date: Sat May 17 22:05:31 2014 New Revision: 266369 URL: http://svnweb.freebsd.org/changeset/base/266369 Log: MFC 264702: Remove uncessary armv6 cache and TLB maintenance ops. Modified: stable/10/sys/arm/arm/pmap-v6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Sat May 17 22:03:44 2014 (r266368) +++ stable/10/sys/arm/arm/pmap-v6.c Sat May 17 22:05:31 2014 (r266369) @@ -1988,8 +1988,6 @@ pmap_release(pmap_t pmap) { struct pcb *pcb; - cpu_idcache_wbinv_all(); - cpu_l2cache_wbinv_all(); cpu_tlb_flushID(); cpu_cpwait(); if (vector_page < KERNBASE) { @@ -2175,14 +2173,6 @@ pmap_growkernel(vm_offset_t addr) for (; pmap_curmaxkvaddr < addr; pmap_curmaxkvaddr += L1_S_SIZE) pmap_grow_l2_bucket(kpmap, pmap_curmaxkvaddr); - /* - * flush out the cache, expensive but growkernel will happen so - * rarely - */ - cpu_dcache_wbinv_all(); - cpu_l2cache_wbinv_all(); - cpu_tlb_flushD(); - cpu_cpwait(); kernel_vm_end = pmap_curmaxkvaddr; } From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 22:19:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E88C323A; Sat, 17 May 2014 22:19: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 B992F2C89; Sat, 17 May 2014 22:19: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 s4HMJIcw041974; Sat, 17 May 2014 22:19:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HMJHAu041966; Sat, 17 May 2014 22:19:17 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172219.s4HMJHAu041966@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 22:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266370 - stable/10/lib/libc/arm/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 22:19:19 -0000 Author: ian Date: Sat May 17 22:19:16 2014 New Revision: 266370 URL: http://svnweb.freebsd.org/changeset/base/266370 Log: MFC 264696, 264721, Add the deprecated fp{get,set}* functions, a few ports use them. Rename the fp{get,set}* files so they no longer conflict with the softfloat version of these files. Added: stable/10/lib/libc/arm/gen/fpgetmask_vfp.c - copied unchanged from r264721, head/lib/libc/arm/gen/fpgetmask_vfp.c stable/10/lib/libc/arm/gen/fpgetround_vfp.c - copied unchanged from r264721, head/lib/libc/arm/gen/fpgetround_vfp.c stable/10/lib/libc/arm/gen/fpgetsticky_vfp.c - copied unchanged from r264721, head/lib/libc/arm/gen/fpgetsticky_vfp.c stable/10/lib/libc/arm/gen/fpsetmask_vfp.c - copied unchanged from r264721, head/lib/libc/arm/gen/fpsetmask_vfp.c stable/10/lib/libc/arm/gen/fpsetround_vfp.c - copied unchanged from r264721, head/lib/libc/arm/gen/fpsetround_vfp.c stable/10/lib/libc/arm/gen/fpsetsticky_vfp.c - copied unchanged from r264721, head/lib/libc/arm/gen/fpsetsticky_vfp.c Modified: stable/10/lib/libc/arm/gen/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/arm/gen/Makefile.inc ============================================================================== --- stable/10/lib/libc/arm/gen/Makefile.inc Sat May 17 22:05:31 2014 (r266369) +++ stable/10/lib/libc/arm/gen/Makefile.inc Sat May 17 22:19:16 2014 (r266370) @@ -9,3 +9,8 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c .if ${MK_ARM_EABI} == "no" SRCS+= divsi3.S .endif + +.if ${MACHINE_ARCH} == "armv6hf" +SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \ + fpsetround_vfp.c fpsetsticky_vfp.c +.endif Copied: stable/10/lib/libc/arm/gen/fpgetmask_vfp.c (from r264721, head/lib/libc/arm/gen/fpgetmask_vfp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/arm/gen/fpgetmask_vfp.c Sat May 17 22:19:16 2014 (r266370, copy of r264721, head/lib/libc/arm/gen/fpgetmask_vfp.c) @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpgetmask,_fpgetmask) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except_t +fpgetmask(void) +{ + fp_except mask; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(mask)); + + return ((mask >> 8) & FP_X_MASK); +} + Copied: stable/10/lib/libc/arm/gen/fpgetround_vfp.c (from r264721, head/lib/libc/arm/gen/fpgetround_vfp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/arm/gen/fpgetround_vfp.c Sat May 17 22:19:16 2014 (r266370, copy of r264721, head/lib/libc/arm/gen/fpgetround_vfp.c) @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpgetround,_fpgetround) +#endif + +fp_rnd_t +fpgetround(void) +{ + uint32_t fpscr; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(fpscr)); + + return ((fpscr >> 22) & 3); +} + Copied: stable/10/lib/libc/arm/gen/fpgetsticky_vfp.c (from r264721, head/lib/libc/arm/gen/fpgetsticky_vfp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/arm/gen/fpgetsticky_vfp.c Sat May 17 22:19:16 2014 (r266370, copy of r264721, head/lib/libc/arm/gen/fpgetsticky_vfp.c) @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpgetsticky,_fpgetsticky) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except +fpgetsticky(void) +{ + fp_except old; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + + return (old & FP_X_MASK); +} + Copied: stable/10/lib/libc/arm/gen/fpsetmask_vfp.c (from r264721, head/lib/libc/arm/gen/fpsetmask_vfp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/arm/gen/fpsetmask_vfp.c Sat May 17 22:19:16 2014 (r266370, copy of r264721, head/lib/libc/arm/gen/fpsetmask_vfp.c) @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpsetmask,_fpsetmask) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except_t +fpsetmask(fp_except_t mask) +{ + fp_except old, new; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + mask = (mask & FP_X_MASK) << 8; + new = (old & ~(FP_X_MASK << 8)) | mask; + __asm __volatile("vmsr fpscr, %0" : : "r"(old)); + + return ((old >> 8) & FP_X_MASK); +} + Copied: stable/10/lib/libc/arm/gen/fpsetround_vfp.c (from r264721, head/lib/libc/arm/gen/fpsetround_vfp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/arm/gen/fpsetround_vfp.c Sat May 17 22:19:16 2014 (r266370, copy of r264721, head/lib/libc/arm/gen/fpsetround_vfp.c) @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpsetround,_fpsetround) +#endif + +fp_rnd_t +fpsetround(fp_rnd_t rnd_dir) +{ + uint32_t old, new; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + new = old & ~(3 << 22); + new |= rnd_dir << 22; + __asm __volatile("vmsr fpscr, %0" : : "r"(new)); + + return ((old >> 22) & 3); +} + Copied: stable/10/lib/libc/arm/gen/fpsetsticky_vfp.c (from r264721, head/lib/libc/arm/gen/fpsetsticky_vfp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/arm/gen/fpsetsticky_vfp.c Sat May 17 22:19:16 2014 (r266370, copy of r264721, head/lib/libc/arm/gen/fpsetsticky_vfp.c) @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpsetsticky,_fpsetsticky) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except +fpsetsticky(fp_except except) +{ + fp_except old, new; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + new = old & ~(FP_X_MASK); + new &= ~except; + __asm __volatile("vmsr fpscr, %0" : : "r"(new)); + + return (old & except); +} + From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 22:29:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7C873693; Sat, 17 May 2014 22:29: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 5D6E82D82; Sat, 17 May 2014 22:29: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 s4HMTQtE047947; Sat, 17 May 2014 22:29:26 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HMTOfc047935; Sat, 17 May 2014 22:29:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172229.s4HMTOfc047935@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 22:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266371 - in stable/10/sys: arm/freescale/imx dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 22:29:26 -0000 Author: ian Date: Sat May 17 22:29:24 2014 New Revision: 266371 URL: http://svnweb.freebsd.org/changeset/base/266371 Log: MFC 264977: Stop calling imx51_ccm_foo() clock functions from imx6 code. Instead define a few imx_ccm_foo() functions that are implemented by the imx51 or imx6 ccm code. Added: stable/10/sys/arm/freescale/imx/imx_ccmvar.h - copied unchanged from r264977, head/sys/arm/freescale/imx/imx_ccmvar.h Modified: stable/10/sys/arm/freescale/imx/imx51_ccm.c stable/10/sys/arm/freescale/imx/imx6_ccm.c stable/10/sys/arm/freescale/imx/imx6_usbphy.c stable/10/sys/arm/freescale/imx/imx_gpt.c stable/10/sys/arm/freescale/imx/imx_machdep.h stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c stable/10/sys/arm/freescale/imx/imx_sdhci.c stable/10/sys/dev/usb/controller/ehci_imx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ccm.c Sat May 17 22:19:16 2014 (r266370) +++ stable/10/sys/arm/freescale/imx/imx51_ccm.c Sat May 17 22:29:24 2014 (r266371) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define IMXCCMDEBUG @@ -552,3 +553,30 @@ imx_ccm_usbphy_enable(device_t dev) } } +uint32_t +imx_ccm_ipg_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_IPG_CLK_ROOT)); +} + +uint32_t +imx_ccm_sdhci_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_ESDHC1_CLK_ROOT)); +} + +uint32_t +imx_ccm_perclk_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_PERCLK_ROOT)); +} + +uint32_t +imx_ccm_uart_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_UART_CLK_ROOT)); +} Modified: stable/10/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_ccm.c Sat May 17 22:19:16 2014 (r266370) +++ stable/10/sys/arm/freescale/imx/imx6_ccm.c Sat May 17 22:29:24 2014 (r266371) @@ -45,13 +45,15 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include +#include - -/* XXX temp kludge for imx51_get_clock. */ -#include -#include +#ifndef CCGR_CLK_MODE_ALWAYS +#define CCGR_CLK_MODE_OFF 0 +#define CCGR_CLK_MODE_RUNMODE 1 +#define CCGR_CLK_MODE_ALWAYS 3 +#endif struct ccm_softc { device_t dev; @@ -208,24 +210,32 @@ imx_ccm_usbphy_enable(device_t _phydev) #endif } +uint32_t +imx_ccm_ipg_hz(void) +{ + return (66000000); +} +uint32_t +imx_ccm_perclk_hz(void) +{ + return (66000000); +} -// XXX Fix this. This has to be here for other code to link, -// but it doesn't have to return anything useful for imx6 right now. -u_int -imx51_get_clock(enum imx51_clock clk) -{ - switch (clk) - { - case IMX51CLK_IPG_CLK_ROOT: - return 66000000; - default: - printf("imx51_get_clock() on imx6 doesn't know about clock %d\n", clk); - break; - } - return 0; +uint32_t +imx_ccm_sdhci_hz(void) +{ + + return (200000000); +} + +uint32_t +imx_ccm_uart_hz(void) +{ + + return (80000000); } static device_method_t ccm_methods[] = { Modified: stable/10/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_usbphy.c Sat May 17 22:19:16 2014 (r266370) +++ stable/10/sys/arm/freescale/imx/imx6_usbphy.c Sat May 17 22:29:24 2014 (r266371) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include Copied: stable/10/sys/arm/freescale/imx/imx_ccmvar.h (from r264977, head/sys/arm/freescale/imx/imx_ccmvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx_ccmvar.h Sat May 17 22:29:24 2014 (r266371, copy of r264977, head/sys/arm/freescale/imx/imx_ccmvar.h) @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef IMX_CCMVAR_H +#define IMX_CCMVAR_H + +/* + * We need a clock management system that works across unrelated SoCs and + * devices. For now, to keep imx development moving, define some barebones + * functionality that can be shared within the imx family by having each SoC + * implement functions with a common name. + * + * The usb enable functions are best-effort. They turn on the usb otg, host, + * and phy clocks in a SoC-specific manner, but it may take a lot more than that + * to make usb work on a given board. In particular, it can require specific + * pinmux setup of gpio pins connected to external phy parts, voltage regulators + * and overcurrent detectors, and so on. On such boards, u-boot or other early + * board setup code has to handle those things. + */ + +uint32_t imx_ccm_ipg_hz(void); +uint32_t imx_ccm_perclk_hz(void); +uint32_t imx_ccm_sdhci_hz(void); +uint32_t imx_ccm_uart_hz(void); + +void imx_ccm_usb_enable(device_t _usbdev); +void imx_ccm_usbphy_enable(device_t _phydev); + +#endif Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_gpt.c Sat May 17 22:19:16 2014 (r266370) +++ stable/10/sys/arm/freescale/imx/imx_gpt.c Sat May 17 22:29:24 2014 (r266371) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #define WRITE4(_sc, _r, _v) \ bus_space_write_4((_sc)->sc_iot, (_sc)->sc_ioh, (_r), (_v)) @@ -164,10 +164,10 @@ imx_gpt_attach(device_t dev) basefreq = 32768; break; case GPT_CR_CLKSRC_IPG: - basefreq = imx51_get_clock(IMX51CLK_IPG_CLK_ROOT); + basefreq = imx_ccm_ipg_hz(); break; case GPT_CR_CLKSRC_IPG_HIGH: - basefreq = imx51_get_clock(IMX51CLK_IPG_CLK_ROOT) * 2; + basefreq = imx_ccm_ipg_hz() * 2; break; case GPT_CR_CLKSRC_24M: ctlreg |= GPT_CR_24MEN; Modified: stable/10/sys/arm/freescale/imx/imx_machdep.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.h Sat May 17 22:19:16 2014 (r266370) +++ stable/10/sys/arm/freescale/imx/imx_machdep.h Sat May 17 22:29:24 2014 (r266371) @@ -56,21 +56,5 @@ void imx_wdog_cpu_reset(vm_offset_t _wdc u_int imx_soc_type(void); u_int imx_soc_family(void); -/* - * We need a clock management system that works across unrelated SoCs and - * devices. For now, to keep imx development moving, define some barebones - * functionality that can be shared within the imx family by having each SoC - * implement functions with a common name. - * - * The usb enable functions are best-effort. They turn on the usb otg, host, - * and phy clocks in a SoC-specific manner, but it may take a lot more than that - * to make usb work on a given board. In particular, it can require specific - * pinmux setup of gpio pins connected to external phy parts, voltage regulators - * and overcurrent detectors, and so on. On such boards, u-boot or other early - * board setup code has to handle those things. - */ -void imx_ccm_usb_enable(device_t _usbdev); -void imx_ccm_usbphy_enable(device_t _phydev); - #endif Modified: stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c Sat May 17 22:19:16 2014 (r266370) +++ stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c Sat May 17 22:29:24 2014 (r266371) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include /* * Table of supported FDT compat strings. Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_sdhci.c Sat May 17 22:19:16 2014 (r266370) +++ stable/10/sys/arm/freescale/imx/imx_sdhci.c Sat May 17 22:29:24 2014 (r266371) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include @@ -723,12 +723,7 @@ imx_sdhci_attach(device_t dev) */ WR4(sc, SDHC_WTMK_LVL, 0x08800880); - /* XXX get imx6 clock frequency from CCM */ - if (sc->hwtype == HWTYPE_USDHC) { - sc->baseclk_hz = 200000000; - } else if (sc->hwtype == HWTYPE_ESDHC) { - sc->baseclk_hz = imx51_get_clock(IMX51CLK_PERCLK_ROOT); - } + sc->baseclk_hz = imx_ccm_sdhci_hz(); /* * If the slot is flagged with the non-removable property, set our flag Modified: stable/10/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- stable/10/sys/dev/usb/controller/ehci_imx.c Sat May 17 22:19:16 2014 (r266370) +++ stable/10/sys/dev/usb/controller/ehci_imx.c Sat May 17 22:29:24 2014 (r266371) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "opt_platform.h" From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 22:31:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0FE4C7C7; Sat, 17 May 2014 22:31: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 E50CA2D8D; Sat, 17 May 2014 22:31: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 s4HMVeB3052971; Sat, 17 May 2014 22:31:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HMVecR052969; Sat, 17 May 2014 22:31:40 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172231.s4HMVecR052969@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 22:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266372 - stable/10/sys/dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 22:31:41 -0000 Author: ian Date: Sat May 17 22:31:40 2014 New Revision: 266372 URL: http://svnweb.freebsd.org/changeset/base/266372 Log: MFC 264981, 264983, 264985: The freescale imx uart driver works for the whole i.MX family, so rename the header file to not have "5xx" in the name. Flesh out imx_uart_init() so that we're not relying on u-boot to init the hardware (meaning uarts other than the console will work). Reword a comment block a bit. Added: stable/10/sys/dev/uart/uart_dev_imx.h - copied unchanged from r264981, head/sys/dev/uart/uart_dev_imx.h Deleted: stable/10/sys/dev/uart/uart_dev_imx5xx.h Modified: stable/10/sys/dev/uart/uart_dev_imx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_dev_imx.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_imx.c Sat May 17 22:29:24 2014 (r266371) +++ stable/10/sys/dev/uart/uart_dev_imx.c Sat May 17 22:31:40 2014 (r266372) @@ -43,10 +43,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include "uart_if.h" -#include +#include -#include "uart_if.h" /* * Low-level UART interface. */ @@ -66,6 +67,22 @@ static struct uart_ops uart_imx_uart_ops .getc = imx_uart_getc, }; +#if 0 /* Handy when debugging. */ +static void +dumpregs(struct uart_bas *bas, const char * msg) +{ + + if (!bootverbose) + return; + printf("%s bsh 0x%08lx UCR1 0x%08x UCR2 0x%08x " + "UCR3 0x%08x UCR4 0x%08x USR1 0x%08x USR2 0x%08x\n", + msg, bas->bsh, + GETREG(bas, REG(UCR1)), GETREG(bas, REG(UCR2)), + GETREG(bas, REG(UCR3)), GETREG(bas, REG(UCR4)), + GETREG(bas, REG(USR1)), GETREG(bas, REG(USR2))); +} +#endif + static int imx_uart_probe(struct uart_bas *bas) { @@ -77,7 +94,60 @@ static void imx_uart_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) { + uint32_t baseclk, reg; + /* Enable the device and the RX/TX channels. */ + SET(bas, REG(UCR1), FLD(UCR1, UARTEN)); + SET(bas, REG(UCR2), FLD(UCR2, RXEN) | FLD(UCR2, TXEN)); + + if (databits == 7) + DIS(bas, UCR2, WS); + else + ENA(bas, UCR2, WS); + + if (stopbits == 2) + ENA(bas, UCR2, STPB); + else + DIS(bas, UCR2, STPB); + + switch (parity) { + case UART_PARITY_ODD: + DIS(bas, UCR2, PROE); + ENA(bas, UCR2, PREN); + break; + case UART_PARITY_EVEN: + ENA(bas, UCR2, PROE); + ENA(bas, UCR2, PREN); + break; + case UART_PARITY_MARK: + case UART_PARITY_SPACE: + /* FALLTHROUGH: Hardware doesn't support mark/space. */ + case UART_PARITY_NONE: + default: + DIS(bas, UCR2, PREN); + break; + } + + /* + * The hardware has an extremely flexible baud clock: it allows setting + * both the numerator and denominator of the divider, as well as a + * separate pre-divider. We simplify the problem of coming up with a + * workable pair of numbers by assuming a pre-divider and numerator of + * one because our base clock is so fast we can reach virtually any + * reasonable speed with a simple divisor. The numerator value actually + * includes the 16x over-sampling (so a value of 16 means divide by 1); + * the register value is the numerator-1, so we have a hard-coded 15. + * Note that a quirk of the hardware requires that both UBIR and UBMR be + * set back to back in order for the change to take effect. + */ + if (baudrate > 0) { + baseclk = imx_ccm_uart_hz(); + reg = GETREG(bas, REG(UFCR)); + reg = (reg & ~IMXUART_UFCR_RFDIV_MASK) | IMXUART_UFCR_RFDIV_DIV1; + SETREG(bas, REG(UFCR), reg); + SETREG(bas, REG(UBIR), 15); + SETREG(bas, REG(UBMR), (baseclk / baudrate) - 1); + } } static void @@ -218,6 +288,8 @@ imx_uart_bus_attach(struct uart_softc *s DIS(bas, UCR3, RI); DIS(bas, UCR3, DCD); DIS(bas, UCR3, DTRDEN); + ENA(bas, UCR2, IRTS); + ENA(bas, UCR3, RXDMUXSEL); /* ACK all interrupts */ SETREG(bas, REG(USR1), 0xffff); Copied: stable/10/sys/dev/uart/uart_dev_imx.h (from r264981, head/sys/dev/uart/uart_dev_imx.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/uart/uart_dev_imx.h Sat May 17 22:31:40 2014 (r266372, copy of r264981, head/sys/dev/uart/uart_dev_imx.h) @@ -0,0 +1,222 @@ +/*- + * Copyright (c) 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was 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 THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _UART_DEV_IMX5XX_H +#define _UART_DEV_IMX5XX_H + +#define IMXUART_URXD_REG 0x0000 /* UART Receiver Register */ +#define IMXUART_URXD_CHARRDY (1 << 15) +#define IMXUART_URXD_ERR (1 << 14) +#define IMXUART_URXD_OVRRUN (1 << 13) +#define IMXUART_URXD_FRMERR (1 << 12) +#define IMXUART_URXD_BRK (1 << 11) +#define IMXUART_URXD_PRERR (1 << 10) +#define IMXUART_URXD_RX_DATA_MASK 0xff + +#define IMXUART_UTXD_REG 0x0040 /* UART Transmitter Register */ +#define IMXUART_UTXD_TX_DATA_MASK 0xff + +#define IMXUART_UCR1_REG 0x0080 /* UART Control Register 1 */ +#define IMXUART_UCR1_ADEN (1 << 15) +#define IMXUART_UCR1_ADBR (1 << 14) +#define IMXUART_UCR1_TRDYEN (1 << 13) +#define IMXUART_UCR1_IDEN (1 << 12) +#define IMXUART_UCR1_ICD_MASK (3 << 10) +#define IMXUART_UCR1_ICD_IDLE4 (0 << 10) +#define IMXUART_UCR1_ICD_IDLE8 (1 << 10) +#define IMXUART_UCR1_ICD_IDLE16 (2 << 10) +#define IMXUART_UCR1_ICD_IDLE32 (3 << 10) +#define IMXUART_UCR1_RRDYEN (1 << 9) +#define IMXUART_UCR1_RXDMAEN (1 << 8) +#define IMXUART_UCR1_IREN (1 << 7) +#define IMXUART_UCR1_TXMPTYEN (1 << 6) +#define IMXUART_UCR1_RTSDEN (1 << 5) +#define IMXUART_UCR1_SNDBRK (1 << 4) +#define IMXUART_UCR1_TXDMAEN (1 << 3) +#define IMXUART_UCR1_ATDMAEN (1 << 2) +#define IMXUART_UCR1_DOZE (1 << 1) +#define IMXUART_UCR1_UARTEN (1 << 0) + +#define IMXUART_UCR2_REG 0x0084 /* UART Control Register 2 */ +#define IMXUART_UCR2_ESCI (1 << 15) +#define IMXUART_UCR2_IRTS (1 << 14) +#define IMXUART_UCR2_CTSC (1 << 13) +#define IMXUART_UCR2_CTS (1 << 12) +#define IMXUART_UCR2_ESCEN (1 << 11) +#define IMXUART_UCR2_RTEC_MASK (3 << 9) +#define IMXUART_UCR2_RTEC_REDGE (0 << 9) +#define IMXUART_UCR2_RTEC_FEDGE (1 << 9) +#define IMXUART_UCR2_RTEC_EDGE (2 << 9) +#define IMXUART_UCR2_PREN (1 << 8) +#define IMXUART_UCR2_PROE (1 << 7) +#define IMXUART_UCR2_STPB (1 << 6) +#define IMXUART_UCR2_WS (1 << 5) +#define IMXUART_UCR2_RTSEN (1 << 4) +#define IMXUART_UCR2_ATEN (1 << 3) +#define IMXUART_UCR2_TXEN (1 << 2) +#define IMXUART_UCR2_RXEN (1 << 1) +#define IMXUART_UCR2_N_SRST (1 << 0) + +#define IMXUART_UCR3_REG 0x0088 /* UART Control Register 3 */ +#define IMXUART_UCR3_DPEC_MASK (3 << 14) +#define IMXUART_UCR3_DPEC_REDGE (0 << 14) +#define IMXUART_UCR3_DPEC_FEDGE (1 << 14) +#define IMXUART_UCR3_DPEC_EDGE (2 << 14) +#define IMXUART_UCR3_DTREN (1 << 13) +#define IMXUART_UCR3_PARERREN (1 << 12) +#define IMXUART_UCR3_FRAERREN (1 << 11) +#define IMXUART_UCR3_DSR (1 << 10) +#define IMXUART_UCR3_DCD (1 << 9) +#define IMXUART_UCR3_RI (1 << 8) +#define IMXUART_UCR3_ADNIMP (1 << 7) +#define IMXUART_UCR3_RXDSEN (1 << 6) +#define IMXUART_UCR3_AIRINTEN (1 << 5) +#define IMXUART_UCR3_AWAKEN (1 << 4) +#define IMXUART_UCR3_DTRDEN (1 << 3) +#define IMXUART_UCR3_RXDMUXSEL (1 << 2) +#define IMXUART_UCR3_INVT (1 << 1) +#define IMXUART_UCR3_ACIEN (1 << 0) + +#define IMXUART_UCR4_REG 0x008c /* UART Control Register 4 */ +#define IMXUART_UCR4_CTSTL_MASK (0x3f << 10) +#define IMXUART_UCR4_CTSTL_SHIFT 10 +#define IMXUART_UCR4_INVR (1 << 9) +#define IMXUART_UCR4_ENIRI (1 << 8) +#define IMXUART_UCR4_WKEN (1 << 7) +#define IMXUART_UCR4_IDDMAEN (1 << 6) +#define IMXUART_UCR4_IRSC (1 << 5) +#define IMXUART_UCR4_LPBYP (1 << 4) +#define IMXUART_UCR4_TCEN (1 << 3) +#define IMXUART_UCR4_BKEN (1 << 2) +#define IMXUART_UCR4_OREN (1 << 1) +#define IMXUART_UCR4_DREN (1 << 0) + +#define IMXUART_UFCR_REG 0x0090 /* UART FIFO Control Register */ +#define IMXUART_UFCR_TXTL_MASK (0x3f << 10) +#define IMXUART_UFCR_TXTL_SHIFT 10 +#define IMXUART_UFCR_RFDIV_MASK (0x07 << 7) +#define IMXUART_UFCR_RFDIV_SHIFT 7 +#define IMXUART_UFCR_RFDIV_SHIFT 7 +#define IMXUART_UFCR_RFDIV_DIV6 (0 << 7) +#define IMXUART_UFCR_RFDIV_DIV5 (1 << 7) +#define IMXUART_UFCR_RFDIV_DIV4 (2 << 7) +#define IMXUART_UFCR_RFDIV_DIV3 (3 << 7) +#define IMXUART_UFCR_RFDIV_DIV2 (4 << 7) +#define IMXUART_UFCR_RFDIV_DIV1 (5 << 7) +#define IMXUART_UFCR_RFDIV_DIV7 (6 << 7) +#define IMXUART_UFCR_DCEDTE (1 << 6) +#define IMXUART_UFCR_RXTL_MASK 0x0000003f +#define IMXUART_UFCR_RXTL_SHIFT 0 + +#define IMXUART_USR1_REG 0x0094 /* UART Status Register 1 */ +#define IMXUART_USR1_PARITYERR (1 << 15) +#define IMXUART_USR1_RTSS (1 << 14) +#define IMXUART_USR1_TRDY (1 << 13) +#define IMXUART_USR1_RTSD (1 << 12) +#define IMXUART_USR1_ESCF (1 << 11) +#define IMXUART_USR1_FRAMERR (1 << 10) +#define IMXUART_USR1_RRDY (1 << 9) +#define IMXUART_USR1_AGTIM (1 << 8) +#define IMXUART_USR1_DTRD (1 << 7) +#define IMXUART_USR1_RXDS (1 << 6) +#define IMXUART_USR1_AIRINT (1 << 5) +#define IMXUART_USR1_AWAKE (1 << 4) +/* 6040 5008 XXX */ + +#define IMXUART_USR2_REG 0x0098 /* UART Status Register 2 */ +#define IMXUART_USR2_ADET (1 << 15) +#define IMXUART_USR2_TXFE (1 << 14) +#define IMXUART_USR2_DTRF (1 << 13) +#define IMXUART_USR2_IDLE (1 << 12) +#define IMXUART_USR2_ACST (1 << 11) +#define IMXUART_USR2_RIDELT (1 << 10) +#define IMXUART_USR2_RIIN (1 << 9) +#define IMXUART_USR2_IRINT (1 << 8) +#define IMXUART_USR2_WAKE (1 << 7) +#define IMXUART_USR2_DCDDELT (1 << 6) +#define IMXUART_USR2_DCDIN (1 << 5) +#define IMXUART_USR2_RTSF (1 << 4) +#define IMXUART_USR2_TXDC (1 << 3) +#define IMXUART_USR2_BRCD (1 << 2) +#define IMXUART_USR2_ORE (1 << 1) +#define IMXUART_USR2_RDR (1 << 0) + +#define IMXUART_UESC_REG 0x009c /* UART Escape Character Register */ +#define IMXUART_UESC_ESC_CHAR_MASK 0x000000ff + +#define IMXUART_UTIM_REG 0x00a0 /* UART Escape Timer Register */ +#define IMXUART_UTIM_TIM_MASK 0x00000fff + +#define IMXUART_UBIR_REG 0x00a4 /* UART BRM Incremental Register */ +#define IMXUART_UBIR_INC_MASK 0x0000ffff + +#define IMXUART_UBMR_REG 0x00a8 /* UART BRM Modulator Register */ +#define IMXUART_UBMR_MOD_MASK 0x0000ffff + +#define IMXUART_UBRC_REG 0x00ac /* UART Baud Rate Count Register */ +#define IMXUART_UBRC_BCNT_MASK 0x0000ffff + +#define IMXUART_ONEMS_REG 0x00b0 /* UART One Millisecond Register */ +#define IMXUART_ONEMS_ONEMS_MASK 0x00ffffff + +#define IMXUART_UTS_REG 0x00b4 /* UART Test Register */ +#define IMXUART_UTS_FRCPERR (1 << 13) +#define IMXUART_UTS_LOOP (1 << 12) +#define IMXUART_UTS_DBGEN (1 << 11) +#define IMXUART_UTS_LOOPIR (1 << 10) +#define IMXUART_UTS_RXDBG (1 << 9) +#define IMXUART_UTS_TXEMPTY (1 << 6) +#define IMXUART_UTS_RXEMPTY (1 << 5) +#define IMXUART_UTS_TXFULL (1 << 4) +#define IMXUART_UTS_RXFULL (1 << 3) +#define IMXUART_UTS_SOFTRST (1 << 0) + +#define REG(_r) IMXUART_ ## _r ## _REG +#define FLD(_r, _v) IMXUART_ ## _r ## _ ## _v + +#define GETREG(bas, reg) \ + bus_space_read_4((bas)->bst, (bas)->bsh, (reg)) +#define SETREG(bas, reg, value) \ + bus_space_write_4((bas)->bst, (bas)->bsh, (reg), (value)) + +#define CLR(_bas, _r, _b) \ + SETREG((_bas), (_r), GETREG((_bas), (_r)) & ~(_b)) +#define SET(_bas, _r, _b) \ + SETREG((_bas), (_r), GETREG((_bas), (_r)) | (_b)) +#define IS_SET(_bas, _r, _b) \ + ((GETREG((_bas), (_r)) & (_b)) ? 1 : 0) + +#define ENA(_bas, _r, _b) SET((_bas), REG(_r), FLD(_r, _b)) +#define DIS(_bas, _r, _b) CLR((_bas), REG(_r), FLD(_r, _b)) +#define IS(_bas, _r, _b) IS_SET((_bas), REG(_r), FLD(_r, _b)) + + +#endif /* _UART_DEV_IMX5XX_H */ From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 22:50:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E19B3B14; Sat, 17 May 2014 22:50: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 C25832F4A; Sat, 17 May 2014 22:50: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 s4HMoHNq060050; Sat, 17 May 2014 22:50:17 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HMoGKq060042; Sat, 17 May 2014 22:50:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172250.s4HMoGKq060042@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 22:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266373 - in stable/10/sys/arm: arm include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 22:50:18 -0000 Author: ian Date: Sat May 17 22:50:16 2014 New Revision: 266373 URL: http://svnweb.freebsd.org/changeset/base/266373 Log: MFC 264990, 264994, 265020, 265025: Call cpu_icache_sync_range() rather than sync_all since we know the range and flushing the entire icache is needlessly expensive. Provide a proper armv7 implementation of icache_sync_all rather than using armv7_idcache_wbinv_all, because wbinv_all doesn't broadcast the operation to other cores. In elf_cpu_load_file() use icache_sync_all() and explain why it's needed (and why other sync operations aren't). Remove cpu_idcache_wbinv_all() from kdb_cpu_trap(), it's no longer needed. Explain why wbinv_all is SMP-safe when dumping, and add a missing l2 cache flush. (Either it was missing here, or it isn't needed in the minidump case. Adding it here seems like the safer path to consistancy.) Modified: stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/dump_machdep.c stable/10/sys/arm/arm/elf_machdep.c stable/10/sys/arm/include/cpufunc.h stable/10/sys/arm/include/kdb.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc.c ============================================================================== --- stable/10/sys/arm/arm/cpufunc.c Sat May 17 22:31:40 2014 (r266372) +++ stable/10/sys/arm/arm/cpufunc.c Sat May 17 22:50:16 2014 (r266373) @@ -769,7 +769,7 @@ struct cpu_functions cortexa_cpufuncs = /* Cache operations */ - armv7_idcache_wbinv_all, /* icache_sync_all */ + armv7_icache_sync_all, /* icache_sync_all */ armv7_icache_sync_range, /* icache_sync_range */ armv7_dcache_wbinv_all, /* dcache_wbinv_all */ Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 17 22:31:40 2014 (r266372) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 17 22:50:16 2014 (r266373) @@ -250,6 +250,13 @@ ENTRY(armv7_idcache_wbinv_range) RET END(armv7_idcache_wbinv_range) +ENTRY_NP(armv7_icache_sync_all) + mcr p15, 0, r0, c7, c1, 0 /* Invalidate all I cache to PoU Inner Shareable */ + isb /* instruction synchronization barrier */ + dsb /* data synchronization barrier */ + RET +END(armv7_icache_sync_all) + ENTRY_NP(armv7_icache_sync_range) ldr ip, .Larmv7_line_size .Larmv7_sync_next: Modified: stable/10/sys/arm/arm/dump_machdep.c ============================================================================== --- stable/10/sys/arm/arm/dump_machdep.c Sat May 17 22:31:40 2014 (r266372) +++ stable/10/sys/arm/arm/dump_machdep.c Sat May 17 22:50:16 2014 (r266373) @@ -174,8 +174,14 @@ cb_dumpdata(struct md_pa *mdp, int seqnr printf(" chunk %d: %dMB (%d pages)", seqnr, pgs * PAGE_SIZE / ( 1024*1024), pgs); - /* Make sure we write coherent datas. */ + /* + * Make sure we write coherent data. Note that in the SMP case this + * only operates on the L1 cache of the current CPU, but all other CPUs + * have already been stopped, and their flush/invalidate was done as + * part of stopping. + */ cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); #ifdef __XSCALE__ xscale_cache_clean_minidata(); #endif Modified: stable/10/sys/arm/arm/elf_machdep.c ============================================================================== --- stable/10/sys/arm/arm/elf_machdep.c Sat May 17 22:31:40 2014 (r266372) +++ stable/10/sys/arm/arm/elf_machdep.c Sat May 17 22:50:16 2014 (r266373) @@ -220,9 +220,19 @@ int elf_cpu_load_file(linker_file_t lf __unused) { - cpu_idcache_wbinv_all(); - cpu_l2cache_wbinv_all(); - cpu_tlb_flushID(); + /* + * The pmap code does not do an icache sync upon establishing executable + * mappings in the kernel pmap. It's an optimization based on the fact + * that kernel memory allocations always have EXECUTABLE protection even + * when the memory isn't going to hold executable code. The only time + * kernel memory holding instructions does need a sync is after loading + * a kernel module, and that's when this function gets called. Normal + * data cache maintenance has already been done by the IO code, and TLB + * maintenance has been done by the pmap code, so all we have to do here + * is invalidate the instruction cache (which also invalidates the + * branch predictor cache on platforms that have one). + */ + cpu_icache_sync_all(); return (0); } Modified: stable/10/sys/arm/include/cpufunc.h ============================================================================== --- stable/10/sys/arm/include/cpufunc.h Sat May 17 22:31:40 2014 (r266372) +++ stable/10/sys/arm/include/cpufunc.h Sat May 17 22:50:16 2014 (r266373) @@ -411,6 +411,7 @@ void armv6_idcache_wbinv_range (vm_offse void armv7_setttb (u_int); void armv7_tlb_flushID (void); void armv7_tlb_flushID_SE (u_int); +void armv7_icache_sync_all (); void armv7_icache_sync_range (vm_offset_t, vm_size_t); void armv7_idcache_wbinv_range (vm_offset_t, vm_size_t); void armv7_idcache_inv_all (void); Modified: stable/10/sys/arm/include/kdb.h ============================================================================== --- stable/10/sys/arm/include/kdb.h Sat May 17 22:31:40 2014 (r266372) +++ stable/10/sys/arm/include/kdb.h Sat May 17 22:50:16 2014 (r266373) @@ -49,14 +49,12 @@ static __inline void kdb_cpu_sync_icache(unsigned char *addr, size_t size) { - cpu_icache_sync_all(); + cpu_icache_sync_range((vm_offset_t)addr, size); } static __inline void kdb_cpu_trap(int type, int code) { - - cpu_idcache_wbinv_all(); } #endif /* _MACHINE_KDB_H_ */ From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 23:03:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A8329CE1; Sat, 17 May 2014 23:03: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 946E52015; Sat, 17 May 2014 23:03: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 s4HN35cF071167; Sat, 17 May 2014 23:03:05 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HN349n071160; Sat, 17 May 2014 23:03:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172303.s4HN349n071160@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 23:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266374 - in stable/10/sys/arm: arm include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 23:03:05 -0000 Author: ian Date: Sat May 17 23:03:04 2014 New Revision: 266374 URL: http://svnweb.freebsd.org/changeset/base/266374 Log: MFC 265023, 265024, 265036: There is no difference between IPI_STOP and IPI_STOP_HARD on ARM, so map them both to the same interrupt number like other arches do. Flush and invalidate caches on each CPU as part of handling IPI_STOP. Don't use multiprocessing-extensions instruction on processors that don't support SMP. Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/minidump_machdep.c stable/10/sys/arm/arm/mp_machdep.c stable/10/sys/arm/include/smp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 17 22:50:16 2014 (r266373) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 17 23:03:04 2014 (r266374) @@ -251,7 +251,11 @@ ENTRY(armv7_idcache_wbinv_range) END(armv7_idcache_wbinv_range) ENTRY_NP(armv7_icache_sync_all) +#ifdef SMP mcr p15, 0, r0, c7, c1, 0 /* Invalidate all I cache to PoU Inner Shareable */ +#else + mcr p15, 0, r0, c7, c5, 0 /* Invalidate all I cache to PoU (ICIALLU) */ +#endif isb /* instruction synchronization barrier */ dsb /* data synchronization barrier */ RET Modified: stable/10/sys/arm/arm/minidump_machdep.c ============================================================================== --- stable/10/sys/arm/arm/minidump_machdep.c Sat May 17 22:50:16 2014 (r266373) +++ stable/10/sys/arm/arm/minidump_machdep.c Sat May 17 23:03:04 2014 (r266374) @@ -210,7 +210,15 @@ minidumpsys(struct dumperinfo *di) int i, k, bit, error; char *addr; - /* Flush cache */ + /* + * Flush caches. Note that in the SMP case this operates only on the + * current CPU's L1 cache. Before we reach this point, code in either + * the system shutdown or kernel debugger has called stop_cpus() to stop + * all cores other than this one. Part of the ARM handling of + * stop_cpus() is to call wbinv_all() on that core's local L1 cache. So + * by time we get to here, all that remains is to flush the L1 for the + * current CPU, then the L2. + */ cpu_idcache_wbinv_all(); cpu_l2cache_wbinv_all(); Modified: stable/10/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/10/sys/arm/arm/mp_machdep.c Sat May 17 22:50:16 2014 (r266373) +++ stable/10/sys/arm/arm/mp_machdep.c Sat May 17 23:03:04 2014 (r266374) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -278,7 +279,6 @@ ipi_handler(void *arg) break; case IPI_STOP: - case IPI_STOP_HARD: /* * IPI_STOP_HARD is mapped to IPI_STOP so it is not * necessary to add it in the switch. @@ -287,6 +287,19 @@ ipi_handler(void *arg) savectx(&stoppcbs[cpu]); + /* + * CPUs are stopped when entering the debugger and at + * system shutdown, both events which can precede a + * panic dump. For the dump to be correct, all caches + * must be flushed and invalidated, but on ARM there's + * no way to broadcast a wbinv_all to other cores. + * Instead, we have each core do the local wbinv_all as + * part of stopping the core. The core requesting the + * stop will do the l2 cache flush after all other cores + * have done their l1 flushes and stopped. + */ + cpu_idcache_wbinv_all(); + /* Indicate we are stopped */ CPU_SET_ATOMIC(cpu, &stopped_cpus); Modified: stable/10/sys/arm/include/smp.h ============================================================================== --- stable/10/sys/arm/include/smp.h Sat May 17 22:50:16 2014 (r266373) +++ stable/10/sys/arm/include/smp.h Sat May 17 23:03:04 2014 (r266374) @@ -10,7 +10,7 @@ #define IPI_PREEMPT 2 #define IPI_RENDEZVOUS 3 #define IPI_STOP 4 -#define IPI_STOP_HARD 5 +#define IPI_STOP_HARD 4 #define IPI_HARDCLOCK 6 #define IPI_TLB 7 From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 23:07:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A2FB6E52; Sat, 17 May 2014 23:07: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 83CF12045; Sat, 17 May 2014 23:07: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 s4HN7R03071942; Sat, 17 May 2014 23:07:27 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HN7RpQ071936; Sat, 17 May 2014 23:07:27 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172307.s4HN7RpQ071936@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 23:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266375 - in stable/10/sys/arm: arm freescale/imx include ti/omap4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 23:07:28 -0000 Author: ian Date: Sat May 17 23:07:26 2014 New Revision: 266375 URL: http://svnweb.freebsd.org/changeset/base/266375 Log: MFC 265035: Move duplicated code to print l2 config into the common code. Modified: stable/10/sys/arm/arm/pl310.c stable/10/sys/arm/freescale/imx/imx6_pl310.c stable/10/sys/arm/include/pl310.h stable/10/sys/arm/ti/omap4/omap4_l2cache.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/pl310.c ============================================================================== --- stable/10/sys/arm/arm/pl310.c Sat May 17 23:03:04 2014 (r266374) +++ stable/10/sys/arm/arm/pl310.c Sat May 17 23:07:26 2014 (r266375) @@ -84,6 +84,47 @@ static uint32_t g_ways_assoc; static struct pl310_softc *pl310_softc; +void +pl310_print_config(struct pl310_softc *sc) +{ + uint32_t aux, prefetch; + const char *dis = "disabled"; + const char *ena = "enabled"; + + aux = pl310_read4(sc, PL310_AUX_CTRL); + prefetch = pl310_read4(sc, PL310_PREFETCH_CTRL); + + device_printf(sc->sc_dev, "Early BRESP response: %s\n", + (aux & AUX_CTRL_EARLY_BRESP) ? ena : dis); + device_printf(sc->sc_dev, "Instruction prefetch: %s\n", + (aux & AUX_CTRL_INSTR_PREFETCH) ? ena : dis); + device_printf(sc->sc_dev, "Data prefetch: %s\n", + (aux & AUX_CTRL_DATA_PREFETCH) ? ena : dis); + device_printf(sc->sc_dev, "Non-secure interrupt control: %s\n", + (aux & AUX_CTRL_NS_INT_CTRL) ? ena : dis); + device_printf(sc->sc_dev, "Non-secure lockdown: %s\n", + (aux & AUX_CTRL_NS_LOCKDOWN) ? ena : dis); + device_printf(sc->sc_dev, "Share override: %s\n", + (aux & AUX_CTRL_SHARE_OVERRIDE) ? ena : dis); + + device_printf(sc->sc_dev, "Double linefill: %s\n", + (prefetch & PREFETCH_CTRL_DL) ? ena : dis); + device_printf(sc->sc_dev, "Instruction prefetch: %s\n", + (prefetch & PREFETCH_CTRL_INSTR_PREFETCH) ? ena : dis); + device_printf(sc->sc_dev, "Data prefetch: %s\n", + (prefetch & PREFETCH_CTRL_DATA_PREFETCH) ? ena : dis); + device_printf(sc->sc_dev, "Double linefill on WRAP request: %s\n", + (prefetch & PREFETCH_CTRL_DL_ON_WRAP) ? ena : dis); + device_printf(sc->sc_dev, "Prefetch drop: %s\n", + (prefetch & PREFETCH_CTRL_PREFETCH_DROP) ? ena : dis); + device_printf(sc->sc_dev, "Incr double Linefill: %s\n", + (prefetch & PREFETCH_CTRL_INCR_DL) ? ena : dis); + device_printf(sc->sc_dev, "Not same ID on exclusive sequence: %s\n", + (prefetch & PREFETCH_CTRL_NOTSAMEID) ? ena : dis); + device_printf(sc->sc_dev, "Prefetch offset: %d\n", + (prefetch & PREFETCH_CTRL_OFFSET_MASK)); +} + static int pl310_filter(void *arg) { @@ -351,6 +392,8 @@ pl310_attach(device_t dev) /* Enable the L2 cache if disabled */ platform_pl310_write_ctrl(sc, CTRL_ENABLED); device_printf(dev, "L2 Cache enabled\n"); + if (bootverbose) + pl310_print_config(sc); } if (!sc->sc_enabled && (ctrl_value & CTRL_ENABLED)) { Modified: stable/10/sys/arm/freescale/imx/imx6_pl310.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_pl310.c Sat May 17 23:03:04 2014 (r266374) +++ stable/10/sys/arm/freescale/imx/imx6_pl310.c Sat May 17 23:07:26 2014 (r266375) @@ -44,42 +44,6 @@ __FBSDID("$FreeBSD$"); void platform_pl310_init(struct pl310_softc *sc) { - uint32_t aux, prefetch; - - aux = pl310_read4(sc, PL310_AUX_CTRL); - prefetch = pl310_read4(sc, PL310_PREFETCH_CTRL); - - if (bootverbose) { - device_printf(sc->sc_dev, "Early BRESP response: %s\n", - (aux & AUX_CTRL_EARLY_BRESP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Instruction prefetch: %s\n", - (aux & AUX_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Data prefetch: %s\n", - (aux & AUX_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Non-secure interrupt control: %s\n", - (aux & AUX_CTRL_NS_INT_CTRL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Non-secure lockdown: %s\n", - (aux & AUX_CTRL_NS_LOCKDOWN) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Share override: %s\n", - (aux & AUX_CTRL_SHARE_OVERRIDE) ? "enabled" : "disabled"); - - device_printf(sc->sc_dev, "Double linefil: %s\n", - (prefetch & PREFETCH_CTRL_DL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Instruction prefetch: %s\n", - (prefetch & PREFETCH_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Data prefetch: %s\n", - (prefetch & PREFETCH_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Double linefill on WRAP request: %s\n", - (prefetch & PREFETCH_CTRL_DL_ON_WRAP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Prefetch drop: %s\n", - (prefetch & PREFETCH_CTRL_PREFETCH_DROP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Incr double Linefill: %s\n", - (prefetch & PREFETCH_CTRL_INCR_DL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Not same ID on exclusive sequence: %s\n", - (prefetch & PREFETCH_CTRL_NOTSAMEID) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Prefetch offset: %d\n", - (prefetch & PREFETCH_CTRL_OFFSET_MASK)); - } } void Modified: stable/10/sys/arm/include/pl310.h ============================================================================== --- stable/10/sys/arm/include/pl310.h Sat May 17 23:03:04 2014 (r266374) +++ stable/10/sys/arm/include/pl310.h Sat May 17 23:07:26 2014 (r266375) @@ -161,6 +161,8 @@ pl310_write4(struct pl310_softc *sc, bus bus_write_4(sc->sc_mem_res, off, val); } +void pl310_print_config(struct pl310_softc *sc); + void platform_pl310_init(struct pl310_softc *); void platform_pl310_write_ctrl(struct pl310_softc *, uint32_t); void platform_pl310_write_debug(struct pl310_softc *, uint32_t); Modified: stable/10/sys/arm/ti/omap4/omap4_l2cache.c ============================================================================== --- stable/10/sys/arm/ti/omap4/omap4_l2cache.c Sat May 17 23:03:04 2014 (r266374) +++ stable/10/sys/arm/ti/omap4/omap4_l2cache.c Sat May 17 23:07:26 2014 (r266375) @@ -45,38 +45,6 @@ platform_pl310_init(struct pl310_softc * aux = pl310_read4(sc, PL310_AUX_CTRL); prefetch = pl310_read4(sc, PL310_PREFETCH_CTRL); - if (bootverbose) { - device_printf(sc->sc_dev, "Early BRESP response: %s\n", - (aux & AUX_CTRL_EARLY_BRESP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Instruction prefetch: %s\n", - (aux & AUX_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Data prefetch: %s\n", - (aux & AUX_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Non-secure interrupt control: %s\n", - (aux & AUX_CTRL_NS_INT_CTRL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Non-secure lockdown: %s\n", - (aux & AUX_CTRL_NS_LOCKDOWN) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Share override: %s\n", - (aux & AUX_CTRL_SHARE_OVERRIDE) ? "enabled" : "disabled"); - - device_printf(sc->sc_dev, "Double linefil: %s\n", - (prefetch & PREFETCH_CTRL_DL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Instruction prefetch: %s\n", - (prefetch & PREFETCH_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Data prefetch: %s\n", - (prefetch & PREFETCH_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Double linefill on WRAP request: %s\n", - (prefetch & PREFETCH_CTRL_DL_ON_WRAP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Prefetch drop: %s\n", - (prefetch & PREFETCH_CTRL_PREFETCH_DROP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Incr double Linefill: %s\n", - (prefetch & PREFETCH_CTRL_INCR_DL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Not same ID on exclusive sequence: %s\n", - (prefetch & PREFETCH_CTRL_NOTSAMEID) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Prefetch offset: %d\n", - (prefetch & PREFETCH_CTRL_OFFSET_MASK)); - } - /* * Disable instruction prefetch */ From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 23:16:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BDCF9FD9; Sat, 17 May 2014 23:16: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 9130F20EA; Sat, 17 May 2014 23:16: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 s4HNGJrD077924; Sat, 17 May 2014 23:16:19 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HNGIZs077920; Sat, 17 May 2014 23:16:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172316.s4HNGIZs077920@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 23:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266376 - stable/10/sys/boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 23:16:19 -0000 Author: ian Date: Sat May 17 23:16:18 2014 New Revision: 266376 URL: http://svnweb.freebsd.org/changeset/base/266376 Log: MFC 265038: Move common device tree informations to separate dtsi files for A10 and A20 SoC. Change cubieboard1 and cubieboard2 dts files accordingly. Added: stable/10/sys/boot/fdt/dts/arm/sun4i-a10.dtsi - copied unchanged from r265038, head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi stable/10/sys/boot/fdt/dts/arm/sun7i-a20.dtsi - copied unchanged from r265038, head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Modified: stable/10/sys/boot/fdt/dts/arm/cubieboard.dts stable/10/sys/boot/fdt/dts/arm/cubieboard2.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/arm/cubieboard.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/cubieboard.dts Sat May 17 23:07:26 2014 (r266375) +++ stable/10/sys/boot/fdt/dts/arm/cubieboard.dts Sat May 17 23:16:18 2014 (r266376) @@ -28,13 +28,10 @@ /dts-v1/; +/include/ "sun4i-a10.dtsi" + / { model = "Cubietech Cubieboard"; - compatible = "cubietech,a10-cubieboard", "allwinner,sun4i-a10"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&AINTC>; memory { device_type = "memory"; @@ -47,96 +44,21 @@ }; SOC: a10 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - AINTC: interrupt-controller@01c20400 { - compatible = "allwinner,sun4i-ic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = < 0x01c20400 0x400 >; - }; - - sramc@01c00000 { - compatible = "allwinner,sun4i-sramc"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c00000 0x1000 >; - }; - - ccm@01c20000 { - compatible = "allwinner,sun4i-ccm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c20000 0x400 >; - }; - - timer@01c20c00 { - compatible = "allwinner,sun4i-timer"; - reg = <0x01c20c00 0x90>; - interrupts = < 22 >; - interrupt-parent = <&AINTC>; - clock-frequency = < 24000000 >; - }; - - watchdog@01c20c90 { - compatible = "allwinner,sun4i-wdt"; - reg = <0x01c20c90 0x08>; - }; - - - GPIO: gpio@01c20800 { - #gpio-cells = <3>; - compatible = "allwinner,sun4i-gpio"; - gpio-controller; - reg =< 0x01c20800 0x400 >; - interrupts = < 28 >; - interrupt-parent = <&AINTC>; - }; usb1: usb@01c14000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; - reg = <0x01c14000 0x1000>; - interrupts = < 39 >; - interrupt-parent = <&AINTC>; + status = "okay"; }; usb2: usb@01c1c000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; - reg = <0x01c1c000 0x1000>; - interrupts = < 40 >; - interrupt-parent = <&AINTC>; - }; - - sata@01c18000 { - compatible = "allwinner,ahci"; - reg = <0x01c18000 0x1000>; - interrupts = <56>; - interrupt-parent = <&AINTC>; + status = "okay"; }; UART0: serial@01c28000 { status = "okay"; - compatible = "ns16550"; - reg = <0x01c28000 0x400>; - reg-shift = <2>; - interrupts = <1>; - interrupt-parent = <&AINTC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - busy-detect = <1>; - broken-txfifo = <1>; }; emac@01c0b000 { - compatible = "allwinner,sun4i-emac"; - reg = <0x01c0b000 0x1000>; - interrupts = <55>; - interrupt-parent = <&AINTC>; + status = "okay"; }; }; Modified: stable/10/sys/boot/fdt/dts/arm/cubieboard2.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/cubieboard2.dts Sat May 17 23:07:26 2014 (r266375) +++ stable/10/sys/boot/fdt/dts/arm/cubieboard2.dts Sat May 17 23:16:18 2014 (r266376) @@ -28,13 +28,10 @@ /dts-v1/; +/include/ "sun7i-a20.dtsi" + / { model = "Cubietech Cubieboard2"; - compatible = "cubietech,a20-cubieboard", "allwinner,sun7i-a20"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&GIC>; memory { device_type = "memory"; @@ -47,102 +44,21 @@ }; SOC: a20 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - GIC: interrupt-controller@01c81000 { - compatible = "arm,gic"; - reg = <0x01c81000 0x1000>, /* Distributor Registers */ - <0x01c82000 0x0100>; /* CPU Interface Registers */ - interrupt-controller; - #interrupt-cells = <1>; - }; - - sramc@01c00000 { - compatible = "allwinner,sun4i-sramc"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c00000 0x1000 >; - }; - - cpu-cfg@01c25c00 { - compatible = "allwinner,sun7i-cpu-cfg"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c25c00 0x400 >; - }; - - ccm@01c20000 { - compatible = "allwinner,sun4i-ccm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c20000 0x400 >; - }; - - timer@01c20c00 { - compatible = "allwinner,sun7i-timer"; - reg = <0x01c20c00 0x90>; - interrupts = < 22 >; - interrupt-parent = <&GIC>; - clock-frequency = < 24000000 >; - }; - - watchdog@01c20c90 { - compatible = "allwinner,sun4i-wdt"; - reg = <0x01c20c90 0x10>; - }; - - GPIO: gpio@01c20800 { - #gpio-cells = <3>; - compatible = "allwinner,sun4i-gpio"; - gpio-controller; - reg =< 0x01c20800 0x400 >; - interrupts = < 28 >; - interrupt-parent = <&GIC>; - }; usb1: usb@01c14000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; - reg = <0x01c14000 0x1000>; - interrupts = < 39 >; - interrupt-parent = <&GIC>; + status = "okay"; }; usb2: usb@01c1c000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; - reg = <0x01c1c000 0x1000>; - interrupts = < 40 >; - interrupt-parent = <&GIC>; - }; - - sata@01c18000 { - compatible = "allwinner,ahci"; - reg = <0x01c18000 0x1000>; - interrupts = <56>; - interrupt-parent = <&GIC>; + status = "okay"; }; UART0: serial@01c28000 { status = "okay"; - compatible = "ns16550"; - reg = <0x01c28000 0x400>; - reg-shift = <2>; - interrupts = <1>; - interrupt-parent = <&GIC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - busy-detect = <1>; - broken-txfifo = <1>; }; emac@01c0b000 { - compatible = "allwinner,sun4i-emac"; - reg = <0x01c0b000 0x1000>; - interrupts = <55>; - interrupt-parent = <&GIC>; + status = "okay"; }; }; Copied: stable/10/sys/boot/fdt/dts/arm/sun4i-a10.dtsi (from r265038, head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/arm/sun4i-a10.dtsi Sat May 17 23:16:18 2014 (r266376, copy of r265038, head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi) @@ -0,0 +1,133 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * 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$ + */ + +/ { + compatible = "allwinner,sun4i-a10"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-parent = <&AINTC>; + + aliases { + soc = &SOC; + }; + + SOC: a10 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + AINTC: interrupt-controller@01c20400 { + compatible = "allwinner,sun4i-ic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = < 0x01c20400 0x400 >; + }; + + sramc@01c00000 { + compatible = "allwinner,sun4i-sramc"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c00000 0x1000 >; + }; + + ccm@01c20000 { + compatible = "allwinner,sun4i-ccm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c20000 0x400 >; + }; + + timer@01c20c00 { + compatible = "allwinner,sun4i-timer"; + reg = <0x01c20c00 0x90>; + interrupts = < 22 >; + interrupt-parent = <&AINTC>; + clock-frequency = < 24000000 >; + }; + + watchdog@01c20c90 { + compatible = "allwinner,sun4i-wdt"; + reg = <0x01c20c90 0x08>; + }; + + + GPIO: gpio@01c20800 { + #gpio-cells = <3>; + compatible = "allwinner,sun4i-gpio"; + gpio-controller; + reg =< 0x01c20800 0x400 >; + interrupts = < 28 >; + interrupt-parent = <&AINTC>; + }; + + usb1: usb@01c14000 { + compatible = "allwinner,usb-ehci", "usb-ehci"; + reg = <0x01c14000 0x1000>; + interrupts = < 39 >; + interrupt-parent = <&AINTC>; + }; + + usb2: usb@01c1c000 { + compatible = "allwinner,usb-ehci", "usb-ehci"; + reg = <0x01c1c000 0x1000>; + interrupts = < 40 >; + interrupt-parent = <&AINTC>; + }; + + sata@01c18000 { + compatible = "allwinner,ahci"; + reg = <0x01c18000 0x1000>; + interrupts = <56>; + interrupt-parent = <&AINTC>; + }; + + UART0: serial@01c28000 { + compatible = "ns16550"; + reg = <0x01c28000 0x400>; + reg-shift = <2>; + interrupts = <1>; + interrupt-parent = <&AINTC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + }; + + emac@01c0b000 { + compatible = "allwinner,sun4i-emac"; + reg = <0x01c0b000 0x1000>; + interrupts = <55>; + interrupt-parent = <&AINTC>; + }; + }; +}; + Copied: stable/10/sys/boot/fdt/dts/arm/sun7i-a20.dtsi (from r265038, head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Sat May 17 23:16:18 2014 (r266376, copy of r265038, head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi) @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * 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$ + */ + +/ { + compatible = "allwinner,sun7i-a20"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-parent = <&GIC>; + + aliases { + soc = &SOC; + }; + + SOC: a20 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + GIC: interrupt-controller@01c81000 { + compatible = "arm,gic"; + reg = <0x01c81000 0x1000>, /* Distributor Registers */ + <0x01c82000 0x0100>; /* CPU Interface Registers */ + interrupt-controller; + #interrupt-cells = <1>; + }; + + sramc@01c00000 { + compatible = "allwinner,sun4i-sramc"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c00000 0x1000 >; + }; + + cpu-cfg@01c25c00 { + compatible = "allwinner,sun7i-cpu-cfg"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c25c00 0x400 >; + }; + + ccm@01c20000 { + compatible = "allwinner,sun4i-ccm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c20000 0x400 >; + }; + + timer@01c20c00 { + compatible = "allwinner,sun7i-timer"; + reg = <0x01c20c00 0x90>; + interrupts = < 22 >; + interrupt-parent = <&GIC>; + clock-frequency = < 24000000 >; + }; + + watchdog@01c20c90 { + compatible = "allwinner,sun4i-wdt"; + reg = <0x01c20c90 0x10>; + }; + + GPIO: gpio@01c20800 { + #gpio-cells = <3>; + compatible = "allwinner,sun4i-gpio"; + gpio-controller; + reg =< 0x01c20800 0x400 >; + interrupts = < 28 >; + interrupt-parent = <&GIC>; + }; + + usb1: usb@01c14000 { + compatible = "allwinner,usb-ehci", "usb-ehci"; + reg = <0x01c14000 0x1000>; + interrupts = < 39 >; + interrupt-parent = <&GIC>; + }; + + usb2: usb@01c1c000 { + compatible = "allwinner,usb-ehci", "usb-ehci"; + reg = <0x01c1c000 0x1000>; + interrupts = < 40 >; + interrupt-parent = <&GIC>; + }; + + sata@01c18000 { + compatible = "allwinner,ahci"; + reg = <0x01c18000 0x1000>; + interrupts = <56>; + interrupt-parent = <&GIC>; + }; + + UART0: serial@01c28000 { + compatible = "ns16550"; + reg = <0x01c28000 0x400>; + reg-shift = <2>; + interrupts = <1>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + }; + + emac@01c0b000 { + compatible = "allwinner,sun4i-emac"; + reg = <0x01c0b000 0x1000>; + interrupts = <55>; + interrupt-parent = <&GIC>; + }; + }; +}; + From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 23:20:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0A521227; Sat, 17 May 2014 23:20: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 EB49120FA; Sat, 17 May 2014 23:20: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 s4HNKTxt079118; Sat, 17 May 2014 23:20:29 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HNKTjS079117; Sat, 17 May 2014 23:20:29 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172320.s4HNKTjS079117@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 23:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266377 - stable/10/lib/libc/arm/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 23:20:30 -0000 Author: ian Date: Sat May 17 23:20:29 2014 New Revision: 266377 URL: http://svnweb.freebsd.org/changeset/base/266377 Log: MFC 265059: Set the new floating point exception mask correctly. Modified: stable/10/lib/libc/arm/gen/fpsetmask_vfp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/arm/gen/fpsetmask_vfp.c ============================================================================== --- stable/10/lib/libc/arm/gen/fpsetmask_vfp.c Sat May 17 23:16:18 2014 (r266376) +++ stable/10/lib/libc/arm/gen/fpsetmask_vfp.c Sat May 17 23:20:29 2014 (r266377) @@ -45,7 +45,7 @@ fpsetmask(fp_except_t mask) __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); mask = (mask & FP_X_MASK) << 8; new = (old & ~(FP_X_MASK << 8)) | mask; - __asm __volatile("vmsr fpscr, %0" : : "r"(old)); + __asm __volatile("vmsr fpscr, %0" : : "r"(new)); return ((old >> 8) & FP_X_MASK); } From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 23:21:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F1B06367; Sat, 17 May 2014 23: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 DE64E2173; Sat, 17 May 2014 23: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 s4HNLr2h080483; Sat, 17 May 2014 23:21:53 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HNLr5T080482; Sat, 17 May 2014 23:21:53 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172321.s4HNLr5T080482@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 23:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266378 - stable/10/sys/arm/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 23:21:54 -0000 Author: ian Date: Sat May 17 23:21:53 2014 New Revision: 266378 URL: http://svnweb.freebsd.org/changeset/base/266378 Log: MFC 265111: Make a declaration into a proper function prototype. Modified: stable/10/sys/arm/include/cpufunc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/include/cpufunc.h ============================================================================== --- stable/10/sys/arm/include/cpufunc.h Sat May 17 23:20:29 2014 (r266377) +++ stable/10/sys/arm/include/cpufunc.h Sat May 17 23:21:53 2014 (r266378) @@ -411,7 +411,7 @@ void armv6_idcache_wbinv_range (vm_offse void armv7_setttb (u_int); void armv7_tlb_flushID (void); void armv7_tlb_flushID_SE (u_int); -void armv7_icache_sync_all (); +void armv7_icache_sync_all (void); void armv7_icache_sync_range (vm_offset_t, vm_size_t); void armv7_idcache_wbinv_range (vm_offset_t, vm_size_t); void armv7_idcache_inv_all (void); From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 23:25:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 945354AA; Sat, 17 May 2014 23:25: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 76B46218B; Sat, 17 May 2014 23:25: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 s4HNPMrF083851; Sat, 17 May 2014 23:25:22 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HNPLhd083844; Sat, 17 May 2014 23:25:21 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172325.s4HNPLhd083844@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 23:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266379 - in stable/10/sys/arm: conf xilinx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 23:25:22 -0000 Author: ian Date: Sat May 17 23:25:20 2014 New Revision: 266379 URL: http://svnweb.freebsd.org/changeset/base/266379 Log: MFC 265099, 265148, 265690: Add SMP support for Zedboard. Use edge-triggered interrupts rather than polling loops to avoid missing transitions of the INIT_B line. Also, release the mutex during uiomove(). Convert the Zynq SoC support to the new routines for static device mapping. Added: stable/10/sys/arm/xilinx/zy7_mp.c - copied unchanged from r265099, head/sys/arm/xilinx/zy7_mp.c Modified: stable/10/sys/arm/conf/ZEDBOARD stable/10/sys/arm/xilinx/files.zynq7 stable/10/sys/arm/xilinx/std.zynq7 stable/10/sys/arm/xilinx/zy7_devcfg.c stable/10/sys/arm/xilinx/zy7_machdep.c stable/10/sys/arm/xilinx/zy7_reg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/ZEDBOARD ============================================================================== --- stable/10/sys/arm/conf/ZEDBOARD Sat May 17 23:21:53 2014 (r266378) +++ stable/10/sys/arm/conf/ZEDBOARD Sat May 17 23:25:20 2014 (r266379) @@ -56,6 +56,7 @@ options SYSVSEM # SYSV-style semaphor options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options FREEBSD_BOOT_LOADER options VFP # vfp/neon +options SMP # Symmetric MultiProcessor Kernel # Debugging makeoptions DEBUG=-g Modified: stable/10/sys/arm/xilinx/files.zynq7 ============================================================================== --- stable/10/sys/arm/xilinx/files.zynq7 Sat May 17 23:21:53 2014 (r266378) +++ stable/10/sys/arm/xilinx/files.zynq7 Sat May 17 23:25:20 2014 (r266379) @@ -21,6 +21,7 @@ arm/xilinx/zy7_l2cache.c standard arm/xilinx/zy7_bus_space.c standard arm/xilinx/zy7_slcr.c standard arm/xilinx/zy7_devcfg.c standard +arm/xilinx/zy7_mp.c optional smp dev/cadence/if_cgem.c optional if_cgem dev/sdhci/sdhci_fdt.c optional sdhci Modified: stable/10/sys/arm/xilinx/std.zynq7 ============================================================================== --- stable/10/sys/arm/xilinx/std.zynq7 Sat May 17 23:21:53 2014 (r266378) +++ stable/10/sys/arm/xilinx/std.zynq7 Sat May 17 23:25:20 2014 (r266379) @@ -20,3 +20,5 @@ makeoptions KERNVIRTADDR=0xc0100000 options ARM_L2_PIPT +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 Modified: stable/10/sys/arm/xilinx/zy7_devcfg.c ============================================================================== --- stable/10/sys/arm/xilinx/zy7_devcfg.c Sat May 17 23:21:53 2014 (r266378) +++ stable/10/sys/arm/xilinx/zy7_devcfg.c Sat May 17 23:25:20 2014 (r266379) @@ -267,24 +267,35 @@ zy7_devcfg_reset_pl(struct zy7_devcfg_so devcfg_ctl = RD4(sc, ZY7_DEVCFG_CTRL); + /* Clear sticky bits and set up INIT signal positive edge interrupt. */ + WR4(sc, ZY7_DEVCFG_INT_STATUS, ZY7_DEVCFG_INT_ALL); + WR4(sc, ZY7_DEVCFG_INT_MASK, ~ZY7_DEVCFG_INT_PCFG_INIT_PE); + /* Deassert PROG_B (active low). */ devcfg_ctl |= ZY7_DEVCFG_CTRL_PCFG_PROG_B; WR4(sc, ZY7_DEVCFG_CTRL, devcfg_ctl); - /* Wait for INIT_B deasserted (active low). */ - tries = 0; - while ((RD4(sc, ZY7_DEVCFG_STATUS) & - ZY7_DEVCFG_STATUS_PCFG_INIT) == 0) { - if (++tries >= 100) - return (EIO); - DELAY(5); + /* + * Wait for INIT to assert. If it is already asserted, we may not get + * an edge interrupt so cancel it and continue. + */ + if ((RD4(sc, ZY7_DEVCFG_STATUS) & + ZY7_DEVCFG_STATUS_PCFG_INIT) != 0) { + /* Already asserted. Cancel interrupt. */ + WR4(sc, ZY7_DEVCFG_INT_MASK, ~0); + } + else { + /* Wait for positive edge interrupt. */ + err = mtx_sleep(sc, &sc->sc_mtx, PCATCH, "zy7i1", hz); + if (err != 0) + return (err); } - - /* Reassert PROG_B. */ + + /* Reassert PROG_B (active low). */ devcfg_ctl &= ~ZY7_DEVCFG_CTRL_PCFG_PROG_B; WR4(sc, ZY7_DEVCFG_CTRL, devcfg_ctl); - /* Wait for INIT_B asserted. */ + /* Wait for INIT deasserted. This happens almost instantly. */ tries = 0; while ((RD4(sc, ZY7_DEVCFG_STATUS) & ZY7_DEVCFG_STATUS_PCFG_INIT) != 0) { @@ -293,7 +304,7 @@ zy7_devcfg_reset_pl(struct zy7_devcfg_so DELAY(5); } - /* Clear sticky bits and set up INIT_B positive edge interrupt. */ + /* Clear sticky bits and set up INIT positive edge interrupt. */ WR4(sc, ZY7_DEVCFG_INT_STATUS, ZY7_DEVCFG_INT_ALL); WR4(sc, ZY7_DEVCFG_INT_MASK, ~ZY7_DEVCFG_INT_PCFG_INIT_PE); @@ -301,11 +312,11 @@ zy7_devcfg_reset_pl(struct zy7_devcfg_so devcfg_ctl |= ZY7_DEVCFG_CTRL_PCFG_PROG_B; WR4(sc, ZY7_DEVCFG_CTRL, devcfg_ctl); - /* Wait for INIT_B deasserted indicating FPGA internal initialization - * is complete. This takes much longer than the previous waits for - * INIT_B transition (on the order of 700us). + /* + * Wait for INIT asserted indicating FPGA internal initialization + * is complete. */ - err = mtx_sleep(sc, &sc->sc_mtx, PCATCH, "zy7in", hz); + err = mtx_sleep(sc, &sc->sc_mtx, PCATCH, "zy7i2", hz); if (err != 0) return (err); @@ -404,7 +415,9 @@ zy7_devcfg_write(struct cdev *dev, struc /* uiomove the data from user buffer to our dma map. */ segsz = MIN(PAGE_SIZE, uio->uio_resid); + DEVCFG_SC_UNLOCK(sc); err = uiomove(dma_mem, segsz, uio); + DEVCFG_SC_LOCK(sc); if (err != 0) break; Modified: stable/10/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- stable/10/sys/arm/xilinx/zy7_machdep.c Sat May 17 23:21:53 2014 (r266378) +++ stable/10/sys/arm/xilinx/zy7_machdep.c Sat May 17 23:25:20 2014 (r266379) @@ -60,7 +60,7 @@ vm_offset_t initarm_lastaddr(void) { - return (ZYNQ7_PSIO_VBASE); + return (arm_devmap_lastaddr()); } void @@ -79,39 +79,18 @@ initarm_late_init(void) { } -#define FDT_DEVMAP_SIZE 3 -static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_SIZE]; - /* - * Construct pmap_devmap[] with DT-derived config data. + * Set up static device mappings. Not strictly necessary -- simplebus will + * dynamically establish mappings as needed -- but doing it this way gets us + * nice efficient 1MB section mappings. */ int initarm_devmap_init(void) { - int i = 0; - fdt_devmap[i].pd_va = ZYNQ7_PSIO_VBASE; - fdt_devmap[i].pd_pa = ZYNQ7_PSIO_HWBASE; - fdt_devmap[i].pd_size = ZYNQ7_PSIO_SIZE; - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - i++; - - fdt_devmap[i].pd_va = ZYNQ7_PSCTL_VBASE; - fdt_devmap[i].pd_pa = ZYNQ7_PSCTL_HWBASE; - fdt_devmap[i].pd_size = ZYNQ7_PSCTL_SIZE; - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - i++; - - /* end of table */ - fdt_devmap[i].pd_va = 0; - fdt_devmap[i].pd_pa = 0; - fdt_devmap[i].pd_size = 0; - fdt_devmap[i].pd_prot = 0; - fdt_devmap[i].pd_cache = 0; + arm_devmap_add_entry(ZYNQ7_PSIO_HWBASE, ZYNQ7_PSIO_SIZE); + arm_devmap_add_entry(ZYNQ7_PSCTL_HWBASE, ZYNQ7_PSCTL_SIZE); - arm_devmap_register_table(&fdt_devmap[0]); return (0); } Copied: stable/10/sys/arm/xilinx/zy7_mp.c (from r265099, head/sys/arm/xilinx/zy7_mp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/xilinx/zy7_mp.c Sat May 17 23:25:20 2014 (r266379, copy of r265099, head/sys/arm/xilinx/zy7_mp.c) @@ -0,0 +1,99 @@ +/*- + * Copyright (c) 2013 Thomas Skibo. 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define ZYNQ7_CPU1_ENTRY 0xfffffff0 + +void +platform_mp_init_secondary(void) +{ + + gic_init_secondary(); +} + +void +platform_mp_setmaxid(void) +{ + + mp_maxid = 1; +} + +int +platform_mp_probe(void) +{ + + mp_ncpus = 2; + return (1); +} + +void +platform_mp_start_ap(void) +{ + bus_space_handle_t ocm_handle; + + /* Map in magic location to give entry address to CPU1. */ + if (bus_space_map(fdtbus_bs_tag, ZYNQ7_CPU1_ENTRY, 4, + 0, &ocm_handle) != 0) + panic("platform_mp_start_ap: Couldn't map OCM\n"); + + /* Write start address for CPU1. */ + bus_space_write_4(fdtbus_bs_tag, ocm_handle, 0, + pmap_kextract((vm_offset_t)mpentry)); + + /* + * The SCU is enabled by the BOOTROM but I think the second CPU doesn't + * turn on filtering until after the wake-up below. I think that's why + * things don't work if I don't put these cache ops here. Also, the + * magic location, 0xfffffff0, isn't in the SCU's filtering range so it + * needs a write-back too. + */ + cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); + + /* Wake up CPU1. */ + armv7_sev(); + + bus_space_unmap(fdtbus_bs_tag, ocm_handle, 4); +} + +void +platform_ipi_send(cpuset_t cpus, u_int ipi) +{ + + pic_ipi_send(cpus, ipi); +} Modified: stable/10/sys/arm/xilinx/zy7_reg.h ============================================================================== --- stable/10/sys/arm/xilinx/zy7_reg.h Sat May 17 23:21:53 2014 (r266378) +++ stable/10/sys/arm/xilinx/zy7_reg.h Sat May 17 23:25:20 2014 (r266379) @@ -44,16 +44,13 @@ #define ZYNQ7_PLGP1_SIZE 0x40000000 /* I/O Peripheral registers. */ -#define ZYNQ7_PSIO_VBASE 0xE0000000 #define ZYNQ7_PSIO_HWBASE 0xE0000000 #define ZYNQ7_PSIO_SIZE 0x00300000 /* UART0 and UART1 */ -#define ZYNQ7_UART0_VBASE (ZYNQ7_PSIO_VBASE) #define ZYNQ7_UART0_HWBASE (ZYNQ7_PSIO_HWBASE) #define ZYNQ7_UART0_SIZE 0x1000 -#define ZYNQ7_UART1_VBASE (ZYNQ7_PSIO_VBASE+0x1000) #define ZYNQ7_UART1_HWBASE (ZYNQ7_PSIO_HWBASE+0x1000) #define ZYNQ7_UART1_SIZE 0x1000 @@ -63,15 +60,12 @@ #define ZYNQ7_SMC_SIZE 0x05000000 /* SLCR, PS system, and CPU private registers combined in this region. */ -#define ZYNQ7_PSCTL_VBASE 0xF8000000 #define ZYNQ7_PSCTL_HWBASE 0xF8000000 #define ZYNQ7_PSCTL_SIZE 0x01000000 -#define ZYNQ7_SLCR_VBASE (ZYNQ7_PSCTL_VBASE) #define ZYNQ7_SLCR_HWBASE (ZYNQ7_PSCTL_HWBASE) #define ZYNQ7_SLCR_SIZE 0x1000 -#define ZYNQ7_DEVCFG_VBASE (ZYNQ7_PSCTL_VBASE+0x7000) #define ZYNQ7_DEVCFG_HWBASE (ZYNQ7_PSCTL_HWBASE+0x7000) #define ZYNQ7_DEVCFG_SIZE 0x1000 From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 23:27:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AB1715DD; Sat, 17 May 2014 23:27: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 7DE992197; Sat, 17 May 2014 23:27: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 s4HNR2QC084085; Sat, 17 May 2014 23:27:02 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HNR2wq084084; Sat, 17 May 2014 23:27:02 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172327.s4HNR2wq084084@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 23:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266380 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 23:27:02 -0000 Author: ian Date: Sat May 17 23:27:02 2014 New Revision: 266380 URL: http://svnweb.freebsd.org/changeset/base/266380 Log: MFC 265156: Remove WANDBOARD.common, it was replaced by IMX6. Deleted: stable/10/sys/arm/conf/WANDBOARD.common Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Sat May 17 23:29:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E586B7A8; Sat, 17 May 2014 23: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 D26FE21AB; Sat, 17 May 2014 23: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 s4HNTjVh084418; Sat, 17 May 2014 23:29:45 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HNTjiv084417; Sat, 17 May 2014 23:29:45 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405172329.s4HNTjiv084417@svn.freebsd.org> From: Ian Lepore Date: Sat, 17 May 2014 23:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266381 - stable/10/sys/arm/rockchip X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 23:29:46 -0000 Author: ian Date: Sat May 17 23:29:45 2014 New Revision: 266381 URL: http://svnweb.freebsd.org/changeset/base/266381 Log: MFC 265207: Use arm_devmap_add_entry() to setup static device mapping. Modified: stable/10/sys/arm/rockchip/rk30xx_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_machdep.c Sat May 17 23:27:02 2014 (r266380) +++ stable/10/sys/arm/rockchip/rk30xx_machdep.c Sat May 17 23:29:45 2014 (r266381) @@ -49,14 +49,11 @@ __FBSDID("$FreeBSD$"); #include -/* Start of address space used for bootstrap map */ -#define DEVMAP_BOOTSTRAP_MAP_START 0xF0000000 - vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START); + return (arm_devmap_lastaddr()); } void @@ -79,27 +76,14 @@ initarm_late_init(void) CPU_CONTROL_DC_ENABLE|CPU_CONTROL_IC_ENABLE); } -#define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, } -}; - /* - * Construct pmap_devmap[] with DT-derived config data. + * Set up static device mappings. */ int initarm_devmap_init(void) { - int i = 0; - - fdt_devmap[i].pd_va = 0xF0000000; - fdt_devmap[i].pd_pa = 0x20000000; - fdt_devmap[i].pd_size = 0x100000; - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - i++; - arm_devmap_register_table(&fdt_devmap[0]); + arm_devmap_add_entry(0x20000000, 0x00100000); return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 00:15:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 621DAE18; Sun, 18 May 2014 00:15: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 4EAA424F3; Sun, 18 May 2014 00:15: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 s4I0FnBo014961; Sun, 18 May 2014 00:15:49 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I0FmRf014958; Sun, 18 May 2014 00:15:48 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405180015.s4I0FmRf014958@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 00:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266382 - in stable/10/sys: boot/fdt/dts/arm dev/sdhci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 00:15:49 -0000 Author: ian Date: Sun May 18 00:15:48 2014 New Revision: 266382 URL: http://svnweb.freebsd.org/changeset/base/266382 Log: MFC 265208: Honor the max-frequency property if it appears in the fdt data. Modified: stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi stable/10/sys/boot/fdt/dts/arm/zedboard.dts stable/10/sys/dev/sdhci/sdhci_fdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi Sat May 17 23:29:45 2014 (r266381) +++ stable/10/sys/boot/fdt/dts/arm/exynos5250.dtsi Sun May 18 00:15:48 2014 (r266382) @@ -126,7 +126,7 @@ reg = <0x12200000 0x1000>; interrupts = <107>; interrupt-parent = <&GIC>; - clock-frequency = <24000000>; /* TODO: verify freq */ + max-frequency = <24000000>; /* TODO: verify freq */ }; sdhci@12210000 { @@ -134,7 +134,7 @@ reg = <0x12210000 0x1000>; interrupts = <108>; interrupt-parent = <&GIC>; - clock-frequency = <24000000>; + max-frequency = <24000000>; }; sdhci@12220000 { @@ -142,7 +142,7 @@ reg = <0x12220000 0x1000>; interrupts = <109>; interrupt-parent = <&GIC>; - clock-frequency = <24000000>; + max-frequency = <24000000>; }; sdhci@12230000 { @@ -150,7 +150,7 @@ reg = <0x12230000 0x1000>; interrupts = <110>; interrupt-parent = <&GIC>; - clock-frequency = <24000000>; + max-frequency = <24000000>; }; serial0: serial@12C00000 { Modified: stable/10/sys/boot/fdt/dts/arm/zedboard.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/zedboard.dts Sat May 17 23:29:45 2014 (r266381) +++ stable/10/sys/boot/fdt/dts/arm/zedboard.dts Sun May 18 00:15:48 2014 (r266382) @@ -183,7 +183,7 @@ reg = <0x100000 0x1000>; interrupts = <56>; interrupt-parent = <&GIC>; - clock-frequency = <50000000>; + max-frequency = <50000000>; }; // QSPI Modified: stable/10/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci_fdt.c Sat May 17 23:29:45 2014 (r266381) +++ stable/10/sys/dev/sdhci/sdhci_fdt.c Sun May 18 00:15:48 2014 (r266382) @@ -66,6 +66,7 @@ struct sdhci_fdt_softc { device_t dev; /* Controller device */ u_int quirks; /* Chip specific quirks */ u_int caps; /* If we override SDHCI_CAPABILITIES */ + uint32_t max_clk; /* Max possible freq */ struct resource *irq_res; /* IRQ resource */ void *intrhand; /* Interrupt handle */ @@ -156,6 +157,7 @@ sdhci_fdt_probe(device_t dev) sc->quirks = 0; sc->num_slots = 1; + sc->max_clk = 0; if (!ofw_bus_status_okay(dev)) return (ENXIO); @@ -170,11 +172,14 @@ sdhci_fdt_probe(device_t dev) node = ofw_bus_get_node(dev); - /* Allow dts to patch quirks and slots. */ - if ((OF_getprop(node, "quirks", &cid, sizeof(cid))) > 0) - sc->quirks = fdt32_to_cpu(cid); - if ((OF_getprop(node, "num-slots", &cid, sizeof(cid))) > 0) - sc->num_slots = fdt32_to_cpu(cid); + /* Allow dts to patch quirks, slots, and max-frequency. */ + if ((OF_getencprop(node, "quirks", &cid, sizeof(cid))) > 0) + sc->quirks = cid; + if ((OF_getencprop(node, "num-slots", &cid, sizeof(cid))) > 0) + sc->num_slots = cid; + if ((OF_getencprop(node, "max-frequency", &cid, sizeof(cid))) > 0) + sc->max_clk = cid; + return (0); } @@ -214,6 +219,7 @@ sdhci_fdt_attach(device_t dev) slot->quirks = sc->quirks; slot->caps = sc->caps; + slot->max_clk = sc->max_clk; if (sdhci_init_slot(dev, slot, i) != 0) continue; From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 00:21:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 31FDEFA9; Sun, 18 May 2014 00:21: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 1E8D32575; Sun, 18 May 2014 00:21: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 s4I0LIfJ016305; Sun, 18 May 2014 00:21:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I0LExE016278; Sun, 18 May 2014 00:21:14 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405180021.s4I0LExE016278@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 00:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266383 - in stable/10: . sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 00:21:19 -0000 Author: ian Date: Sun May 18 00:21:14 2014 New Revision: 266383 URL: http://svnweb.freebsd.org/changeset/base/266383 Log: MFC 265155, 265254: Omit from the universe build all config files tagged with #NO_UNIVERSE. Add FDT to the VYBRID kernel. Added: stable/10/sys/arm/conf/VYBRID - copied, changed from r265155, head/sys/arm/conf/VYBRID Deleted: stable/10/sys/arm/conf/VYBRID.common Modified: stable/10/Makefile stable/10/sys/arm/conf/ARNDALE stable/10/sys/arm/conf/BWCT stable/10/sys/arm/conf/COLIBRI-VF50 stable/10/sys/arm/conf/COSMIC stable/10/sys/arm/conf/EB9200 stable/10/sys/arm/conf/ETHERNUT5 stable/10/sys/arm/conf/HL200 stable/10/sys/arm/conf/HL201 stable/10/sys/arm/conf/KB920X stable/10/sys/arm/conf/NSLU stable/10/sys/arm/conf/QILA9G20 stable/10/sys/arm/conf/QUARTZ stable/10/sys/arm/conf/SAM9260EK stable/10/sys/arm/conf/SAM9X25EK stable/10/sys/arm/conf/SN9G45 stable/10/sys/arm/conf/WANDBOARD-DUAL stable/10/sys/arm/conf/WANDBOARD-QUAD stable/10/sys/arm/conf/WANDBOARD-SOLO Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile ============================================================================== --- stable/10/Makefile Sun May 18 00:15:48 2014 (r266382) +++ stable/10/Makefile Sun May 18 00:21:14 2014 (r266383) @@ -473,9 +473,15 @@ universe_kernels: universe_kernconfs .if !defined(TARGET) TARGET!= uname -m .endif +.if defined(MAKE_ALL_KERNELS) +_THINNER=cat +.else +_THINNER=xargs grep -L "^.NO_UNIVERSE" +.endif KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/conf && \ find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ - ! -name DEFAULTS ! -name NOTES + ! -name DEFAULTS ! -name NOTES | \ + ${_THINNER} universe_kernconfs: .for kernel in ${KERNCONFS} TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/conf && \ Modified: stable/10/sys/arm/conf/ARNDALE ============================================================================== --- stable/10/sys/arm/conf/ARNDALE Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/ARNDALE Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include "EXYNOS5250.common" ident ARNDALE Modified: stable/10/sys/arm/conf/BWCT ============================================================================== --- stable/10/sys/arm/conf/BWCT Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/BWCT Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident BWCT options VERBOSE_INIT_ARM Modified: stable/10/sys/arm/conf/COLIBRI-VF50 ============================================================================== --- stable/10/sys/arm/conf/COLIBRI-VF50 Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/COLIBRI-VF50 Sun May 18 00:21:14 2014 (r266383) @@ -17,7 +17,9 @@ # # $FreeBSD$ -include "VYBRID.common" +#NO_UNIVERSE + +include "VYBRID" ident COLIBRI-VF50 #FDT Modified: stable/10/sys/arm/conf/COSMIC ============================================================================== --- stable/10/sys/arm/conf/COSMIC Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/COSMIC Sun May 18 00:21:14 2014 (r266383) @@ -17,7 +17,9 @@ # # $FreeBSD$ -include "VYBRID.common" +#NO_UNIVERSE + +include "VYBRID" ident COSMIC #FDT Modified: stable/10/sys/arm/conf/EB9200 ============================================================================== --- stable/10/sys/arm/conf/EB9200 Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/EB9200 Sun May 18 00:21:14 2014 (r266383) @@ -12,6 +12,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident EB9200 include "../at91/std.eb9200" Modified: stable/10/sys/arm/conf/ETHERNUT5 ============================================================================== --- stable/10/sys/arm/conf/ETHERNUT5 Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/ETHERNUT5 Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident ETHERNUT5 include "../at91/std.ethernut5" Modified: stable/10/sys/arm/conf/HL200 ============================================================================== --- stable/10/sys/arm/conf/HL200 Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/HL200 Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident HL200 include "../at91/std.hl200" Modified: stable/10/sys/arm/conf/HL201 ============================================================================== --- stable/10/sys/arm/conf/HL201 Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/HL201 Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident HL201 include "../at91/std.hl201" Modified: stable/10/sys/arm/conf/KB920X ============================================================================== --- stable/10/sys/arm/conf/KB920X Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/KB920X Sun May 18 00:21:14 2014 (r266383) @@ -18,6 +18,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident KB920X include "../at91/std.kb920x" Modified: stable/10/sys/arm/conf/NSLU ============================================================================== --- stable/10/sys/arm/conf/NSLU Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/NSLU Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident NSLU # XXX What is defined in std.avila does not exactly match the following: Modified: stable/10/sys/arm/conf/QILA9G20 ============================================================================== --- stable/10/sys/arm/conf/QILA9G20 Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/QILA9G20 Sun May 18 00:21:14 2014 (r266383) @@ -18,6 +18,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident QILA9G20 include "../at91/std.qila9g20" Modified: stable/10/sys/arm/conf/QUARTZ ============================================================================== --- stable/10/sys/arm/conf/QUARTZ Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/QUARTZ Sun May 18 00:21:14 2014 (r266383) @@ -17,7 +17,9 @@ # # $FreeBSD$ -include "VYBRID.common" +#NO_UNIVERSE + +include "VYBRID" ident QUARTZ #FDT Modified: stable/10/sys/arm/conf/SAM9260EK ============================================================================== --- stable/10/sys/arm/conf/SAM9260EK Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/SAM9260EK Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident SAM9260EK include "../at91/std.sam9260ek" Modified: stable/10/sys/arm/conf/SAM9X25EK ============================================================================== --- stable/10/sys/arm/conf/SAM9X25EK Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/SAM9X25EK Sun May 18 00:21:14 2014 (r266383) @@ -17,7 +17,8 @@ # # $FreeBSD$ -# NOUNIVERSE: disable building in make universe +#NO_UNIVERSE + ident SAM9X25EK include "../at91/std.sam9x25ek" Modified: stable/10/sys/arm/conf/SN9G45 ============================================================================== --- stable/10/sys/arm/conf/SN9G45 Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/SN9G45 Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident SN9G45 include "../at91/std.sn9g45" Copied and modified: stable/10/sys/arm/conf/VYBRID (from r265155, head/sys/arm/conf/VYBRID) ============================================================================== --- head/sys/arm/conf/VYBRID Wed Apr 30 18:02:10 2014 (r265155, copy source) +++ stable/10/sys/arm/conf/VYBRID Sun May 18 00:21:14 2014 (r266383) @@ -147,3 +147,5 @@ device kbdmux options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp437 device ukbd + +options FDT Modified: stable/10/sys/arm/conf/WANDBOARD-DUAL ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD-DUAL Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/WANDBOARD-DUAL Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include "IMX6" ident WANDBOARD-DUAL Modified: stable/10/sys/arm/conf/WANDBOARD-QUAD ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD-QUAD Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/WANDBOARD-QUAD Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include "IMX6" ident WANDBOARD-QUAD Modified: stable/10/sys/arm/conf/WANDBOARD-SOLO ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD-SOLO Sun May 18 00:15:48 2014 (r266382) +++ stable/10/sys/arm/conf/WANDBOARD-SOLO Sun May 18 00:21:14 2014 (r266383) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include "IMX6" ident WANDBOARD-SOLO From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 00:26:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 57EA71A9; Sun, 18 May 2014 00:26: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 3A8DD25A5; Sun, 18 May 2014 00:26:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I0QhTK021024; Sun, 18 May 2014 00:26:43 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I0Qgis021019; Sun, 18 May 2014 00:26:42 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405180026.s4I0Qgis021019@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 00:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266384 - in stable/10/sys/arm: arm freescale/imx include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 00:26:43 -0000 Author: ian Date: Sun May 18 00:26:42 2014 New Revision: 266384 URL: http://svnweb.freebsd.org/changeset/base/266384 Log: MFC 265440, 265441, 265444, 265445, 265446, 265447: Move the pl310.enabled tunable to hw.pl310.enabled. Clean up a few minor style(9) nits. Use DEVMETHOD_END. Break out the code that figures out the L2 cache geometry to its own routine, so that it can be called from multiple places in upcoming changes. Call platform_pl310_init() before enabling the controller, and handle the case where the controller is already enabled. Add defines for the bits in the PL310 debug control register. Add a public routine to set the L2 cache ram latencies. This can be called by platform init routines to fine-tune cache performance. Enable PL310 power-saving modes and tune the cache ram latencies for imx6. Modified: stable/10/sys/arm/arm/pl310.c stable/10/sys/arm/freescale/imx/imx6_pl310.c stable/10/sys/arm/include/pl310.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/pl310.c ============================================================================== --- stable/10/sys/arm/arm/pl310.c Sun May 18 00:21:14 2014 (r266383) +++ stable/10/sys/arm/arm/pl310.c Sun May 18 00:26:42 2014 (r266384) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); } while(0); static int pl310_enabled = 1; -TUNABLE_INT("pl310.enabled", &pl310_enabled); +TUNABLE_INT("hw.pl310.enabled", &pl310_enabled); static uint32_t g_l2cache_way_mask; @@ -125,6 +125,35 @@ pl310_print_config(struct pl310_softc *s (prefetch & PREFETCH_CTRL_OFFSET_MASK)); } +void +pl310_set_ram_latency(struct pl310_softc *sc, uint32_t which_reg, + uint32_t read, uint32_t write, uint32_t setup) +{ + uint32_t v; + + KASSERT(which_reg == PL310_TAG_RAM_CTRL || + which_reg == PL310_DATA_RAM_CTRL, + ("bad pl310 ram latency register address")); + + v = pl310_read4(sc, which_reg); + if (setup != 0) { + KASSERT(setup <= 8, ("bad pl310 setup latency: %d", setup)); + v &= ~RAM_CTRL_SETUP_MASK; + v |= (setup - 1) << RAM_CTRL_SETUP_SHIFT; + } + if (read != 0) { + KASSERT(read <= 8, ("bad pl310 read latency: %d", read)); + v &= ~RAM_CTRL_READ_MASK; + v |= (read - 1) << RAM_CTRL_READ_SHIFT; + } + if (write != 0) { + KASSERT(write <= 8, ("bad pl310 write latency: %d", write)); + v &= ~RAM_CTRL_WRITE_MASK; + v |= (write - 1) << RAM_CTRL_WRITE_SHIFT; + } + pl310_write4(sc, which_reg, v); +} + static int pl310_filter(void *arg) { @@ -149,7 +178,8 @@ static __inline void pl310_wait_background_op(uint32_t off, uint32_t mask) { - while (pl310_read4(pl310_softc, off) & mask); + while (pl310_read4(pl310_softc, off) & mask) + continue; } @@ -167,6 +197,7 @@ pl310_wait_background_op(uint32_t off, u static __inline void pl310_cache_sync(void) { + if ((pl310_softc == NULL) || !pl310_softc->sc_enabled) return; @@ -318,6 +349,23 @@ pl310_inv_range(vm_paddr_t start, vm_siz PL310_UNLOCK(pl310_softc); } +static void +pl310_set_way_sizes(struct pl310_softc *sc) +{ + uint32_t aux_value; + + aux_value = pl310_read4(sc, PL310_AUX_CTRL); + g_way_size = (aux_value & AUX_CTRL_WAY_SIZE_MASK) >> + AUX_CTRL_WAY_SIZE_SHIFT; + g_way_size = 1 << (g_way_size + 13); + if (aux_value & (1 << AUX_CTRL_ASSOCIATIVITY_SHIFT)) + g_ways_assoc = 16; + else + g_ways_assoc = 8; + g_l2cache_way_mask = (1 << g_ways_assoc) - 1; + g_l2cache_size = g_way_size * g_ways_assoc; +} + static int pl310_probe(device_t dev) { @@ -335,12 +383,11 @@ static int pl310_attach(device_t dev) { struct pl310_softc *sc = device_get_softc(dev); - int rid = 0; - uint32_t aux_value; - uint32_t ctrl_value; - uint32_t cache_id; + int rid; + uint32_t cache_id, debug_ctrl; sc->sc_dev = dev; + rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) @@ -356,7 +403,6 @@ pl310_attach(device_t dev) pl310_softc = sc; mtx_init(&sc->sc_mtx, "pl310lock", NULL, MTX_SPIN); - sc->sc_enabled = pl310_enabled; /* activate the interrupt */ bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, @@ -368,39 +414,49 @@ pl310_attach(device_t dev) device_printf(dev, "Part number: 0x%x, release: 0x%x\n", (cache_id >> CACHE_ID_PARTNUM_SHIFT) & CACHE_ID_PARTNUM_MASK, (cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK); - aux_value = pl310_read4(sc, PL310_AUX_CTRL); - g_way_size = (aux_value & AUX_CTRL_WAY_SIZE_MASK) >> - AUX_CTRL_WAY_SIZE_SHIFT; - g_way_size = 1 << (g_way_size + 13); - if (aux_value & (1 << AUX_CTRL_ASSOCIATIVITY_SHIFT)) - g_ways_assoc = 16; - else - g_ways_assoc = 8; - g_l2cache_way_mask = (1 << g_ways_assoc) - 1; - g_l2cache_size = g_way_size * g_ways_assoc; - /* Print the information */ - device_printf(dev, "L2 Cache: %uKB/%dB %d ways\n", (g_l2cache_size / 1024), - g_l2cache_line_size, g_ways_assoc); - ctrl_value = pl310_read4(sc, PL310_CTRL); + /* + * If L2 cache is already enabled then something has violated the rules, + * because caches are supposed to be off at kernel entry. The cache + * must be disabled to write the configuration registers without + * triggering an access error (SLVERR), but there's no documented safe + * procedure for disabling the L2 cache in the manual. So we'll try to + * invent one: + * - Use the debug register to force write-through mode and prevent + * linefills (allocation of new lines on read); now anything we do + * will not cause new data to come into the L2 cache. + * - Writeback and invalidate the current contents. + * - Disable the controller. + * - Restore the original debug settings. + */ + if (pl310_read4(sc, PL310_CTRL) & CTRL_ENABLED) { + device_printf(dev, "Warning: L2 Cache should not already be " + "active; trying to de-activate and re-initialize...\n"); + sc->sc_enabled = 1; + debug_ctrl = pl310_read4(sc, PL310_DEBUG_CTRL); + platform_pl310_write_debug(sc, debug_ctrl | + DEBUG_CTRL_DISABLE_WRITEBACK | DEBUG_CTRL_DISABLE_LINEFILL); + pl310_set_way_sizes(sc); + pl310_wbinv_all(); + platform_pl310_write_ctrl(sc, CTRL_DISABLED); + platform_pl310_write_debug(sc, debug_ctrl); + } + sc->sc_enabled = pl310_enabled; - if (sc->sc_enabled && !(ctrl_value & CTRL_ENABLED)) { - /* invalidate current content */ + if (sc->sc_enabled) { + platform_pl310_init(sc); + pl310_set_way_sizes(sc); /* platform init might change these */ pl310_write4(pl310_softc, PL310_INV_WAY, 0xffff); pl310_wait_background_op(PL310_INV_WAY, 0xffff); - - /* Enable the L2 cache if disabled */ platform_pl310_write_ctrl(sc, CTRL_ENABLED); - device_printf(dev, "L2 Cache enabled\n"); + device_printf(dev, "L2 Cache enabled: %uKB/%dB %d ways\n", + (g_l2cache_size / 1024), g_l2cache_line_size, g_ways_assoc); if (bootverbose) pl310_print_config(sc); - } - - if (!sc->sc_enabled && (ctrl_value & CTRL_ENABLED)) { + } else { /* - * Set counters so when cache event happens - * we'll get interrupt and be warned that something - * is off + * Set counters so when cache event happens we'll get interrupt + * and be warned that something is off. */ /* Cache Line Eviction for Counter 0 */ @@ -410,12 +466,6 @@ pl310_attach(device_t dev) pl310_write4(sc, PL310_EVENT_COUNTER1_CONF, EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_DRREQ); - /* Temporary switch on for final flush*/ - sc->sc_enabled = 1; - pl310_wbinv_all(); - sc->sc_enabled = 0; - platform_pl310_write_ctrl(sc, CTRL_DISABLED); - /* Enable and clear pending interrupts */ pl310_write4(sc, PL310_INTR_CLEAR, INTR_MASK_ECNTR); pl310_write4(sc, PL310_INTR_MASK, INTR_MASK_ALL); @@ -429,11 +479,6 @@ pl310_attach(device_t dev) device_printf(dev, "L2 Cache disabled\n"); } - if (sc->sc_enabled) - platform_pl310_init(sc); - - pl310_wbinv_all(); - /* Set the l2 functions in the set of cpufuncs */ cpufuncs.cf_l2cache_wbinv_all = pl310_wbinv_all; cpufuncs.cf_l2cache_wbinv_range = pl310_wbinv_range; @@ -446,7 +491,7 @@ pl310_attach(device_t dev) static device_method_t pl310_methods[] = { DEVMETHOD(device_probe, pl310_probe), DEVMETHOD(device_attach, pl310_attach), - {0, 0}, + DEVMETHOD_END }; static driver_t pl310_driver = { Modified: stable/10/sys/arm/freescale/imx/imx6_pl310.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_pl310.c Sun May 18 00:21:14 2014 (r266383) +++ stable/10/sys/arm/freescale/imx/imx6_pl310.c Sun May 18 00:26:42 2014 (r266384) @@ -44,6 +44,19 @@ __FBSDID("$FreeBSD$"); void platform_pl310_init(struct pl310_softc *sc) { + uint32_t reg; + + /* + * Enable power saving modes: + * - Dynamic Gating stops the clock when the controller is idle. + * - Standby stops the clock when the cores are in WFI mode. + */ + reg = pl310_read4(sc, PL310_POWER_CTRL); + reg |= POWER_CTRL_ENABLE_GATING | POWER_CTRL_ENABLE_STANDBY; + pl310_write4(sc, PL310_POWER_CTRL, reg); + + pl310_set_ram_latency(sc, PL310_TAG_RAM_CTRL, 4, 2, 3); + pl310_set_ram_latency(sc, PL310_DATA_RAM_CTRL, 4, 2, 3); } void Modified: stable/10/sys/arm/include/pl310.h ============================================================================== --- stable/10/sys/arm/include/pl310.h Sun May 18 00:21:14 2014 (r266383) +++ stable/10/sys/arm/include/pl310.h Sun May 18 00:26:42 2014 (r266384) @@ -62,6 +62,14 @@ #define AUX_CTRL_DATA_PREFETCH (1 << 28) #define AUX_CTRL_INSTR_PREFETCH (1 << 29) #define AUX_CTRL_EARLY_BRESP (1 << 30) +#define PL310_TAG_RAM_CTRL 0x108 +#define PL310_DATA_RAM_CTRL 0x10C +#define RAM_CTRL_WRITE_SHIFT 8 +#define RAM_CTRL_WRITE_MASK (0x7 << 8) +#define RAM_CTRL_READ_SHIFT 4 +#define RAM_CTRL_READ_MASK (0x7 << 4) +#define RAM_CTRL_SETUP_SHIFT 0 +#define RAM_CTRL_SETUP_MASK (0x7 << 0) #define PL310_EVENT_COUNTER_CTRL 0x200 #define EVENT_COUNTER_CTRL_ENABLED (1 << 0) #define EVENT_COUNTER_CTRL_C0_RESET (1 << 1) @@ -113,6 +121,9 @@ #define PL310_ADDR_FILTER_STAR 0xC00 #define PL310_ADDR_FILTER_END 0xC04 #define PL310_DEBUG_CTRL 0xF40 +#define DEBUG_CTRL_DISABLE_LINEFILL (1 << 0) +#define DEBUG_CTRL_DISABLE_WRITEBACK (1 << 1) +#define DEBUG_CTRL_SPNIDEN (1 << 2) #define PL310_PREFETCH_CTRL 0xF60 #define PREFETCH_CTRL_OFFSET_MASK (0x1f) #define PREFETCH_CTRL_NOTSAMEID (1 << 21) @@ -123,6 +134,8 @@ #define PREFETCH_CTRL_INSTR_PREFETCH (1 << 29) #define PREFETCH_CTRL_DL (1 << 30) #define PL310_POWER_CTRL 0xF60 +#define POWER_CTRL_ENABLE_GATING (1 << 0) +#define POWER_CTRL_ENABLE_STANDBY (1 << 1) struct pl310_softc { device_t sc_dev; @@ -162,6 +175,8 @@ pl310_write4(struct pl310_softc *sc, bus } void pl310_print_config(struct pl310_softc *sc); +void pl310_set_ram_latency(struct pl310_softc *sc, uint32_t which_reg, + uint32_t read, uint32_t write, uint32_t setup); void platform_pl310_init(struct pl310_softc *); void platform_pl310_write_ctrl(struct pl310_softc *, uint32_t); From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 00:30:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 826BD2EA; Sun, 18 May 2014 00:30: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 6342E25B5; Sun, 18 May 2014 00:30: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 s4I0U5W7021529; Sun, 18 May 2014 00:30:05 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I0U403021524; Sun, 18 May 2014 00:30:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405180030.s4I0U403021524@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 00:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266385 - in stable/10/sys/arm: arm mv/armadaxp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 00:30:05 -0000 Author: ian Date: Sun May 18 00:30:04 2014 New Revision: 266385 URL: http://svnweb.freebsd.org/changeset/base/266385 Log: MFC 265694, 265705, 265784: Move the mptramp code which is specific to the Marvell ArmadaXP SoC out of the common locore.S file and into the mv/armadaxp directory. Consolidate all the AP core startup stuff under a single #ifdef SMP block Call idcache_inv_all from the AP core entry code before turning on the MMU. Also, enable instruction and branch caches, which should be safe now that they're properly initialized/invalidated first. Added: stable/10/sys/arm/mv/armadaxp/mptramp.S - copied unchanged from r265694, head/sys/arm/mv/armadaxp/mptramp.S Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/locore.S stable/10/sys/arm/mv/armadaxp/files.armadaxp Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sun May 18 00:26:42 2014 (r266384) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sun May 18 00:30:04 2014 (r266385) @@ -319,6 +319,10 @@ ENTRY(armv7_auxctrl) RET END(armv7_auxctrl) +/* + * Invalidate all I+D+branch cache. Used by startup code, which counts + * on the fact that only r0-r3,ip are modified and no stack space is used. + */ ENTRY(armv7_idcache_inv_all) mov r0, #0 mcr p15, 2, r0, c0, c0, 0 @ set cache level to L1 Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Sun May 18 00:26:42 2014 (r266384) +++ stable/10/sys/arm/arm/locore.S Sun May 18 00:30:04 2014 (r266385) @@ -308,11 +308,6 @@ Lreal_start: Lend: .word _edata -#ifdef SMP -Lstartup_pagetable_secondary: - .word temp_pagetable -#endif - .Lstart: .word _edata .word _ebss @@ -320,10 +315,6 @@ Lstartup_pagetable_secondary: .Lvirt_done: .word virt_done -#if defined(SMP) -.Lmpvirt_done: - .word mpvirt_done -#endif .Lmainreturned: .asciz "main() returned" @@ -349,104 +340,59 @@ pagetable: .word _C_LABEL(cpufuncs) #if defined(SMP) -Lsramaddr: - .word 0xffff0080 - -#if 0 -#define AP_DEBUG(tmp) \ - mrc p15, 0, r1, c0, c0, 5; \ - ldr r0, Lsramaddr; \ - add r0, r1, lsl #2; \ - mov r1, tmp; \ - str r1, [r0], #0x0000; -#else -#define AP_DEBUG(tmp) -#endif - - -ASENTRY_NP(mptramp) - mov r0, #0 - mcr p15, 0, r0, c7, c7, 0 - - AP_DEBUG(#1) - - mrs r3, cpsr - bic r3, r3, #(PSR_MODE) - orr r3, r3, #(PSR_SVC32_MODE) - msr cpsr_fsxc, r3 - - mrc p15, 0, r0, c0, c0, 5 - and r0, #0x0f /* Get CPU ID */ - /* Read boot address for CPU */ - mov r1, #0x100 - mul r2, r0, r1 - ldr r1, Lpmureg - add r0, r2, r1 - ldr r1, [r0], #0x00 - - mov pc, r1 - -Lpmureg: - .word 0xd0022124 -END(mptramp) +.Lmpvirt_done: + .word mpvirt_done +Lstartup_pagetable_secondary: + .word temp_pagetable ASENTRY_NP(mpentry) - AP_DEBUG(#2) - /* Make sure interrupts are disabled. */ mrs r7, cpsr orr r7, r7, #(I32_bit|F32_bit) msr cpsr_c, r7 - - adr r7, Ltag - bic r7, r7, #0xf0000000 - orr r7, r7, #PHYSADDR - - /* Disable MMU for a while */ + /* Disable MMU. It should be disabled already, but make sure. */ mrc p15, 0, r2, c1, c0, 0 bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ CPU_CONTROL_WBUF_ENABLE) bic r2, r2, #(CPU_CONTROL_IC_ENABLE) bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE) mcr p15, 0, r2, c1, c0, 0 - nop nop nop + CPWAIT(r0) - AP_DEBUG(#3) +#if defined(ARM_MMU_V6) + bl armv6_idcache_inv_all /* Modifies r0 only */ +#elif defined(ARM_MMU_V7) + bl armv7_idcache_inv_all /* Modifies r0-r3, ip */ +#endif -Ltag: ldr r0, Lstartup_pagetable_secondary bic r0, r0, #0xf0000000 orr r0, r0, #PHYSADDR ldr r0, [r0] -#if defined(SMP) orr r0, r0, #2 /* Set TTB shared memory flag */ -#endif mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) mov r0, #0 mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ -#endif - - AP_DEBUG(#4) /* Set the Domain Access register. Very important! */ mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) mcr p15, 0, r0, c3, c0, 0 /* Enable MMU */ mrc p15, 0, r0, c1, c0, 0 -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) orr r0, r0, #CPU_CONTROL_V6_EXTPAGE orr r0, r0, #CPU_CONTROL_AF_ENABLE -#endif - orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE) + orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ + CPU_CONTROL_WBUF_ENABLE) + orr r0, r0, #(CPU_CONTROL_IC_ENABLE) + orr r0, r0, #(CPU_CONTROL_BPRD_ENABLE) mcr p15, 0, r0, c1, c0, 0 nop nop @@ -473,7 +419,7 @@ mpvirt_done: /* NOTREACHED */ .Lmpreturned: - .asciz "main() returned" + .asciz "init_secondary() returned" .align 0 END(mpentry) #endif Modified: stable/10/sys/arm/mv/armadaxp/files.armadaxp ============================================================================== --- stable/10/sys/arm/mv/armadaxp/files.armadaxp Sun May 18 00:26:42 2014 (r266384) +++ stable/10/sys/arm/mv/armadaxp/files.armadaxp Sun May 18 00:30:04 2014 (r266385) @@ -4,3 +4,5 @@ arm/mv/armadaxp/armadaxp.c standard arm/mv/mpic.c standard arm/mv/rtc.c standard arm/mv/armadaxp/armadaxp_mp.c optional smp +arm/mv/armadaxp/mptramp.S optional smp + Copied: stable/10/sys/arm/mv/armadaxp/mptramp.S (from r265694, head/sys/arm/mv/armadaxp/mptramp.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/mv/armadaxp/mptramp.S Sun May 18 00:30:04 2014 (r266385, copy of r265694, head/sys/arm/mv/armadaxp/mptramp.S) @@ -0,0 +1,56 @@ +/*- + * Copyright 2011 Semihalf + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +__FBSDID("$FreeBSD$"); + +ASENTRY_NP(mptramp) + mov r0, #0 + mcr p15, 0, r0, c7, c7, 0 + + mrs r3, cpsr + bic r3, r3, #(PSR_MODE) + orr r3, r3, #(PSR_SVC32_MODE) + msr cpsr_fsxc, r3 + + mrc p15, 0, r0, c0, c0, 5 + and r0, #0x0f /* Get CPU ID */ + + /* Read boot address for CPU */ + mov r1, #0x100 + mul r2, r0, r1 + ldr r1, Lpmureg + add r0, r2, r1 + ldr r1, [r0], #0x00 + + mov pc, r1 + +Lpmureg: + .word 0xd0022124 +END(mptramp) + From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 00:32:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1FF96420; Sun, 18 May 2014 00:32: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 0AD3A262C; Sun, 18 May 2014 00:32: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 s4I0WcqJ026486; Sun, 18 May 2014 00:32:38 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I0WZMe026474; Sun, 18 May 2014 00:32:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405180032.s4I0WZMe026474@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 00:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266386 - in stable/10/sys/arm: at91 cavium/cns11xx mv mv/orion s3c2xx0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 00:32:38 -0000 Author: ian Date: Sun May 18 00:32:35 2014 New Revision: 266386 URL: http://svnweb.freebsd.org/changeset/base/266386 Log: MFC 265852: Map device memory using PTE_DEVICE rather than PTE_NOCACHE. Modified: stable/10/sys/arm/at91/at91_machdep.c stable/10/sys/arm/cavium/cns11xx/econa_machdep.c stable/10/sys/arm/mv/mv_localbus.c stable/10/sys/arm/mv/mv_machdep.c stable/10/sys/arm/mv/mv_pci.c stable/10/sys/arm/mv/orion/db88f5xxx.c stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c stable/10/sys/arm/xscale/i80321/ep80219_machdep.c stable/10/sys/arm/xscale/i80321/iq31244_machdep.c stable/10/sys/arm/xscale/i8134x/crb_machdep.c stable/10/sys/arm/xscale/ixp425/avila_machdep.c stable/10/sys/arm/xscale/pxa/pxa_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/at91_machdep.c ============================================================================== --- stable/10/sys/arm/at91/at91_machdep.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/at91/at91_machdep.c Sun May 18 00:32:35 2014 (r266386) @@ -126,7 +126,7 @@ const struct arm_devmap_entry at91_devma 0xfff00000, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, /* There's a notion that we should do the rest of these lazily. */ /* @@ -150,7 +150,7 @@ const struct arm_devmap_entry at91_devma AT91RM92_OHCI_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* CompactFlash controller. Portion of EBI CS4 1MB */ @@ -158,7 +158,7 @@ const struct arm_devmap_entry at91_devma AT91RM92_CF_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, /* * The next two should be good for the 9260, 9261 and 9G20 since @@ -170,7 +170,7 @@ const struct arm_devmap_entry at91_devma AT91SAM9G20_OHCI_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* EBI CS3 256MB */ @@ -178,7 +178,7 @@ const struct arm_devmap_entry at91_devma AT91SAM9G20_NAND_BASE, AT91SAM9G20_NAND_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, /* * The next should be good for the 9G45. @@ -189,7 +189,7 @@ const struct arm_devmap_entry at91_devma AT91SAM9G45_OHCI_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, 0, 0, 0, 0, } }; Modified: stable/10/sys/arm/cavium/cns11xx/econa_machdep.c ============================================================================== --- stable/10/sys/arm/cavium/cns11xx/econa_machdep.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/cavium/cns11xx/econa_machdep.c Sun May 18 00:32:35 2014 (r266386) @@ -112,7 +112,7 @@ static const struct arm_devmap_entry eco ECONA_SDRAM_BASE, /*physical*/ ECONA_SDRAM_SIZE, /*size*/ VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, /* * Map the on-board devices VA == PA so that we can access them @@ -127,7 +127,7 @@ static const struct arm_devmap_entry eco ECONA_IO_BASE, /*physical*/ ECONA_IO_SIZE, /*size*/ VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* @@ -137,7 +137,7 @@ static const struct arm_devmap_entry eco ECONA_OHCI_PBASE, /*physical*/ ECONA_USB_SIZE, /*size*/ VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* @@ -147,7 +147,7 @@ static const struct arm_devmap_entry eco ECONA_CFI_PBASE, /*physical*/ ECONA_CFI_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, Modified: stable/10/sys/arm/mv/mv_localbus.c ============================================================================== --- stable/10/sys/arm/mv/mv_localbus.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/mv/mv_localbus.c Sun May 18 00:32:35 2014 (r266386) @@ -477,7 +477,7 @@ fdt_localbus_devmap(phandle_t dt_node, s fdt_devmap[j].pd_pa = offset; fdt_devmap[j].pd_size = size; fdt_devmap[j].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[j].pd_cache = PTE_NOCACHE; + fdt_devmap[j].pd_cache = PTE_DEVICE; /* Copy data to structure used by localbus driver */ localbus_banks[bank].va = fdt_devmap[j].pd_va; Modified: stable/10/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/10/sys/arm/mv/mv_machdep.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/mv/mv_machdep.c Sun May 18 00:32:35 2014 (r266386) @@ -284,7 +284,7 @@ moveon: map->pd_pa = base; map->pd_size = size; map->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - map->pd_cache = PTE_NOCACHE; + map->pd_cache = PTE_DEVICE; return (0); out: @@ -350,7 +350,7 @@ initarm_devmap_init(void) fdt_devmap[i].pd_pa = fdt_immr_pa; fdt_devmap[i].pd_size = fdt_immr_size; fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_NOCACHE; + fdt_devmap[i].pd_cache = PTE_DEVICE; i++; /* Modified: stable/10/sys/arm/mv/mv_pci.c ============================================================================== --- stable/10/sys/arm/mv/mv_pci.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/mv/mv_pci.c Sun May 18 00:32:35 2014 (r266386) @@ -235,14 +235,14 @@ mv_pci_devmap(phandle_t node, struct arm devmap->pd_pa = io_space.base_parent; devmap->pd_size = io_space.len; devmap->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - devmap->pd_cache = PTE_NOCACHE; + devmap->pd_cache = PTE_DEVICE; devmap++; devmap->pd_va = (mem_va ? mem_va : mem_space.base_parent); devmap->pd_pa = mem_space.base_parent; devmap->pd_size = mem_space.len; devmap->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - devmap->pd_cache = PTE_NOCACHE; + devmap->pd_cache = PTE_DEVICE; return (0); } Modified: stable/10/sys/arm/mv/orion/db88f5xxx.c ============================================================================== --- stable/10/sys/arm/mv/orion/db88f5xxx.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/mv/orion/db88f5xxx.c Sun May 18 00:32:35 2014 (r266386) @@ -84,42 +84,42 @@ const struct pmap_devmap pmap_devmap[] = MV_PHYS_BASE, MV_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* PCIE I/O */ MV_PCIE_IO_BASE, MV_PCIE_IO_PHYS_BASE, MV_PCIE_IO_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* PCIE Memory */ MV_PCIE_MEM_BASE, MV_PCIE_MEM_PHYS_BASE, MV_PCIE_MEM_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* PCI I/O */ MV_PCI_IO_BASE, MV_PCI_IO_PHYS_BASE, MV_PCI_IO_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* PCI Memory */ MV_PCI_MEM_BASE, MV_PCI_MEM_PHYS_BASE, MV_PCI_MEM_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* 7-seg LED */ MV_DEV_CS0_BASE, MV_DEV_CS0_PHYS_BASE, MV_DEV_CS0_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, 0, 0, 0, 0, } }; Modified: stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Sun May 18 00:32:35 2014 (r266386) @@ -130,42 +130,42 @@ static const struct arm_devmap_entry s3c _A(S3C24X0_CLKMAN_PA_BASE), _S(S3C24X0_CLKMAN_SIZE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { _A(S3C24X0_GPIO_BASE), _A(S3C24X0_GPIO_PA_BASE), _S(S3C2410_GPIO_SIZE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { _A(S3C24X0_INTCTL_BASE), _A(S3C24X0_INTCTL_PA_BASE), _S(S3C24X0_INTCTL_SIZE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { _A(S3C24X0_TIMER_BASE), _A(S3C24X0_TIMER_PA_BASE), _S(S3C24X0_TIMER_SIZE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { _A(S3C24X0_UART0_BASE), _A(S3C24X0_UART0_PA_BASE), _S(S3C24X0_UART_PA_BASE(3) - S3C24X0_UART0_PA_BASE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { _A(S3C24X0_WDT_BASE), _A(S3C24X0_WDT_PA_BASE), _S(S3C24X0_WDT_SIZE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, Modified: stable/10/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i80321/ep80219_machdep.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/xscale/i80321/ep80219_machdep.c Sun May 18 00:32:35 2014 (r266386) @@ -130,21 +130,21 @@ static const struct arm_devmap_entry ep8 IQ80321_OBIO_BASE, IQ80321_OBIO_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { IQ80321_IOW_VBASE, VERDE_OUT_XLATE_IO_WIN0_BASE, VERDE_OUT_XLATE_IO_WIN_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { IQ80321_80321_VBASE, VERDE_PMMR_BASE, VERDE_PMMR_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, Modified: stable/10/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i80321/iq31244_machdep.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/xscale/i80321/iq31244_machdep.c Sun May 18 00:32:35 2014 (r266386) @@ -128,14 +128,14 @@ static const struct arm_devmap_entry iq8 IQ80321_OBIO_BASE, IQ80321_OBIO_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { IQ80321_IOW_VBASE, VERDE_OUT_XLATE_IO_WIN0_BASE, VERDE_OUT_XLATE_IO_WIN_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { @@ -143,7 +143,7 @@ static const struct arm_devmap_entry iq8 VERDE_PMMR_BASE, VERDE_PMMR_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, Modified: stable/10/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i8134x/crb_machdep.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/xscale/i8134x/crb_machdep.c Sun May 18 00:32:35 2014 (r266386) @@ -124,7 +124,7 @@ static const struct arm_devmap_entry iq8 IOP34X_HWADDR, IOP34X_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* @@ -135,14 +135,14 @@ static const struct arm_devmap_entry iq8 IOP34X_PCIX_OIOBAR &~ (0x100000 - 1), 0x100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { IOP34X_PCE1_VADDR, IOP34X_PCE1, IOP34X_PCE1_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, Modified: stable/10/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/avila_machdep.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/xscale/ixp425/avila_machdep.c Sun May 18 00:32:35 2014 (r266386) @@ -118,31 +118,31 @@ struct pv_addr minidataclean; static const struct arm_devmap_entry ixp425_devmap[] = { /* Physical/Virtual address for I/O space */ { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* Expansion Bus */ { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* CFI Flash on the Expansion Bus */ { IXP425_EXP_BUS_CS0_VBASE, IXP425_EXP_BUS_CS0_HWBASE, - IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* IXP425 PCI Configuration */ { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* SDRAM Controller */ { IXP425_MCU_VBASE, IXP425_MCU_HWBASE, IXP425_MCU_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* PCI Memory Space */ { IXP425_PCI_MEM_VBASE, IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* Q-Mgr Memory Space */ { IXP425_QMGR_VBASE, IXP425_QMGR_HWBASE, IXP425_QMGR_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, { 0 }, }; @@ -151,45 +151,45 @@ static const struct arm_devmap_entry ixp static const struct arm_devmap_entry ixp435_devmap[] = { /* Physical/Virtual address for I/O space */ { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* IXP425 PCI Configuration */ { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* DDRII Controller NB: mapped same place as IXP425 */ { IXP425_MCU_VBASE, IXP435_MCU_HWBASE, IXP425_MCU_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* PCI Memory Space */ { IXP425_PCI_MEM_VBASE, IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* Q-Mgr Memory Space */ { IXP425_QMGR_VBASE, IXP425_QMGR_HWBASE, IXP425_QMGR_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* CFI Flash on the Expansion Bus */ { IXP425_EXP_BUS_CS0_VBASE, IXP425_EXP_BUS_CS0_HWBASE, - IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* USB1 Memory Space */ { IXP435_USB1_VBASE, IXP435_USB1_HWBASE, IXP435_USB1_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* USB2 Memory Space */ { IXP435_USB2_VBASE, IXP435_USB2_HWBASE, IXP435_USB2_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* GPS Memory Space */ { CAMBRIA_GPS_VBASE, CAMBRIA_GPS_HWBASE, CAMBRIA_GPS_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* RS485 Memory Space */ { CAMBRIA_RS485_VBASE, CAMBRIA_RS485_HWBASE, CAMBRIA_RS485_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, { 0 } }; Modified: stable/10/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/pxa/pxa_machdep.c Sun May 18 00:30:04 2014 (r266385) +++ stable/10/sys/arm/xscale/pxa/pxa_machdep.c Sun May 18 00:32:35 2014 (r266386) @@ -129,7 +129,7 @@ static const struct arm_devmap_entry pxa PXA2X0_PERIPH_START, PXA250_PERIPH_END - PXA2X0_PERIPH_START, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, 0, 0, 0, 0, } }; From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 00:55:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 88726906; Sun, 18 May 2014 00:55: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 6922828AD; Sun, 18 May 2014 00:55: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 s4I0tRea039316; Sun, 18 May 2014 00:55:27 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I0tQx6039311; Sun, 18 May 2014 00:55:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405180055.s4I0tQx6039311@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 00:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266387 - in stable/10/sys/arm: arm include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 00:55:27 -0000 Author: ian Date: Sun May 18 00:55:26 2014 New Revision: 266387 URL: http://svnweb.freebsd.org/changeset/base/266387 Log: MFC 265861, 265870: Make the hardware memory and instruction barrier functions work on armv4 and armv5 as well. Add cpu_l2cache_drain_writebuf(), use it to implement generic_bs_barrier(). Modified: stable/10/sys/arm/arm/bus_space_generic.c stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/pl310.c stable/10/sys/arm/include/atomic.h stable/10/sys/arm/include/cpufunc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/bus_space_generic.c ============================================================================== --- stable/10/sys/arm/arm/bus_space_generic.c Sun May 18 00:32:35 2014 (r266386) +++ stable/10/sys/arm/arm/bus_space_generic.c Sun May 18 00:55:26 2014 (r266387) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include /* Prototypes for all the bus_space structure functions */ @@ -110,5 +111,16 @@ generic_bs_barrier(void *t, bus_space_ha bus_size_t len, int flags) { - /* Nothing to do. */ + /* + * dsb() will drain the L1 write buffer and establish a memory access + * barrier point on platforms where that has meaning. On a write we + * also need to drain the L2 write buffer, because most on-chip memory + * mapped devices are downstream of the L2 cache. Note that this needs + * to be done even for memory mapped as Device type, because while + * Device memory is not cached, writes to it are still buffered. + */ + dsb(); + if (flags & BUS_SPACE_BARRIER_WRITE) { + cpu_l2cache_drain_writebuf(); + } } Modified: stable/10/sys/arm/arm/cpufunc.c ============================================================================== --- stable/10/sys/arm/arm/cpufunc.c Sun May 18 00:32:35 2014 (r266386) +++ stable/10/sys/arm/arm/cpufunc.c Sun May 18 00:55:26 2014 (r266387) @@ -150,6 +150,7 @@ struct cpu_functions arm9_cpufuncs = { (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -214,6 +215,7 @@ struct cpu_functions armv5_ec_cpufuncs = (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -276,6 +278,7 @@ struct cpu_functions sheeva_cpufuncs = { sheeva_l2cache_wbinv_range, /* l2cache_wbinv_range */ sheeva_l2cache_inv_range, /* l2cache_inv_range */ sheeva_l2cache_wb_range, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -338,6 +341,7 @@ struct cpu_functions arm10_cpufuncs = { (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -401,6 +405,7 @@ struct cpu_functions pj4bv7_cpufuncs = { (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -466,6 +471,7 @@ struct cpu_functions xscale_cpufuncs = { (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -530,6 +536,7 @@ struct cpu_functions xscalec3_cpufuncs = xscalec3_l2cache_purge_rng, /* l2cache_wbinv_range */ xscalec3_l2cache_flush_rng, /* l2cache_inv_range */ xscalec3_l2cache_clean_rng, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -593,6 +600,7 @@ struct cpu_functions fa526_cpufuncs = { (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -656,6 +664,7 @@ struct cpu_functions arm1136_cpufuncs = (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -718,6 +727,7 @@ struct cpu_functions arm1176_cpufuncs = (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -789,6 +799,7 @@ struct cpu_functions cortexa_cpufuncs = (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ Modified: stable/10/sys/arm/arm/pl310.c ============================================================================== --- stable/10/sys/arm/arm/pl310.c Sun May 18 00:32:35 2014 (r266386) +++ stable/10/sys/arm/arm/pl310.c Sun May 18 00:55:26 2014 (r266387) @@ -350,6 +350,18 @@ pl310_inv_range(vm_paddr_t start, vm_siz } static void +pl310_drain_writebuf(void) +{ + + if ((pl310_softc == NULL) || !pl310_softc->sc_enabled) + return; + + PL310_LOCK(pl310_softc); + pl310_cache_sync(); + PL310_UNLOCK(pl310_softc); +} + +static void pl310_set_way_sizes(struct pl310_softc *sc) { uint32_t aux_value; @@ -484,6 +496,7 @@ pl310_attach(device_t dev) cpufuncs.cf_l2cache_wbinv_range = pl310_wbinv_range; cpufuncs.cf_l2cache_inv_range = pl310_inv_range; cpufuncs.cf_l2cache_wb_range = pl310_wb_range; + cpufuncs.cf_l2cache_drain_writebuf = pl310_drain_writebuf; return (0); } Modified: stable/10/sys/arm/include/atomic.h ============================================================================== --- stable/10/sys/arm/include/atomic.h Sun May 18 00:32:35 2014 (r266386) +++ stable/10/sys/arm/include/atomic.h Sun May 18 00:55:26 2014 (r266387) @@ -58,9 +58,9 @@ #define dsb() __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0) : "memory") #define dmb() __asm __volatile("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory") #else -#define isb() -#define dsb() -#define dmb() +#define isb() __asm __volatile("mcr p15, 0, %0, c7, c5, 4" : : "r" (0) : "memory") +#define dsb() __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0) : "memory") +#define dmb() dsb() #endif #define mb() dmb() Modified: stable/10/sys/arm/include/cpufunc.h ============================================================================== --- stable/10/sys/arm/include/cpufunc.h Sun May 18 00:32:35 2014 (r266386) +++ stable/10/sys/arm/include/cpufunc.h Sun May 18 00:55:26 2014 (r266387) @@ -151,6 +151,7 @@ struct cpu_functions { void (*cf_l2cache_wbinv_range) (vm_offset_t, vm_size_t); void (*cf_l2cache_inv_range) (vm_offset_t, vm_size_t); void (*cf_l2cache_wb_range) (vm_offset_t, vm_size_t); + void (*cf_l2cache_drain_writebuf) (void); /* Other functions */ @@ -252,6 +253,7 @@ void tlb_broadcast(int); #define cpu_l2cache_wb_range(a, s) cpufuncs.cf_l2cache_wb_range((a), (s)) #define cpu_l2cache_inv_range(a, s) cpufuncs.cf_l2cache_inv_range((a), (s)) #define cpu_l2cache_wbinv_range(a, s) cpufuncs.cf_l2cache_wbinv_range((a), (s)) +#define cpu_l2cache_drain_writebuf() cpufuncs.cf_l2cache_drain_writebuf() #define cpu_flush_prefetchbuf() cpufuncs.cf_flush_prefetchbuf() #define cpu_drain_writebuf() cpufuncs.cf_drain_writebuf() From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 01:18:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3C495CCD; Sun, 18 May 2014 01:18: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 296632A29; Sun, 18 May 2014 01:18:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I1Ig3P052379; Sun, 18 May 2014 01:18:42 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I1Ig7O052378; Sun, 18 May 2014 01:18:42 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405180118.s4I1Ig7O052378@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 01:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266388 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 01:18:43 -0000 Author: ian Date: Sun May 18 01:18:42 2014 New Revision: 266388 URL: http://svnweb.freebsd.org/changeset/base/266388 Log: MFC 265913, 265914: Interrupts need to be disabled on entry to cpu_sleep() for ARM. Given that and the need to be in a critical section when switching to idleclock mode for event timers, use spinlock_enter()/exit() to achieve both needs. Clean up some style nits. Modified: stable/10/sys/arm/arm/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Sun May 18 00:55:26 2014 (r266387) +++ stable/10/sys/arm/arm/machdep.c Sun May 18 01:18:42 2014 (r266388) @@ -424,24 +424,20 @@ void cpu_idle(int busy) { - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", - busy, curcpu); + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); + spinlock_enter(); #ifndef NO_EVENTTIMERS - if (!busy) { - critical_enter(); + if (!busy) cpu_idleclock(); - } #endif if (!sched_runnable()) cpu_sleep(0); #ifndef NO_EVENTTIMERS - if (!busy) { + if (!busy) cpu_activeclock(); - critical_exit(); - } #endif - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", - busy, curcpu); + spinlock_exit(); + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu); } int From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 01:20:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 65884E4B; Sun, 18 May 2014 01:20: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 39E7E2A37; Sun, 18 May 2014 01:20: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 s4I1KqDQ056948; Sun, 18 May 2014 01:20:52 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I1KqtF056947; Sun, 18 May 2014 01:20:52 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405180120.s4I1KqtF056947@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 01:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266389 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 01:20:52 -0000 Author: ian Date: Sun May 18 01:20:51 2014 New Revision: 266389 URL: http://svnweb.freebsd.org/changeset/base/266389 Log: MFC 265915: Build modules in parallel. This is a record-only merge, because the actual change got merged by accident several days ago along with some other MFC I did. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 04:33:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 195466B5; Sun, 18 May 2014 04:33: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 E7ECB2795; Sun, 18 May 2014 04:33: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 s4I4XPGW074571; Sun, 18 May 2014 04:33:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I4XPXI074567; Sun, 18 May 2014 04:33:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405180433.s4I4XPXI074567@svn.freebsd.org> From: John Baldwin Date: Sun, 18 May 2014 04:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266393 - in stable/10: sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 04:33:26 -0000 Author: jhb Date: Sun May 18 04:33:24 2014 New Revision: 266393 URL: http://svnweb.freebsd.org/changeset/base/266393 Log: MFC 259737, 262646: Fix a couple of issues with vcpu state: - Add a parameter to 'vcpu_set_state()' to enforce that the vcpu is in the IDLE state before the requested state transition. This guarantees that there is exactly one ioctl() operating on a vcpu at any point in time and prevents unintended state transitions. - Fix a race between VMRUN() and vcpu_notify_event() due to 'vcpu->hostcpu' being updated outside of the vcpu_lock(). Modified: stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_dev.c stable/10/usr.sbin/bhyve/bhyverun.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Sun May 18 04:21:12 2014 (r266392) +++ stable/10/sys/amd64/include/vmm.h Sun May 18 04:33:24 2014 (r266393) @@ -177,7 +177,8 @@ enum vcpu_state { VCPU_SLEEPING, }; -int vcpu_set_state(struct vm *vm, int vcpu, enum vcpu_state state); +int vcpu_set_state(struct vm *vm, int vcpu, enum vcpu_state state, + bool from_idle); enum vcpu_state vcpu_get_state(struct vm *vm, int vcpu, int *hostcpu); static int __inline Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Sun May 18 04:21:12 2014 (r266392) +++ stable/10/sys/amd64/vmm/vmm.c Sun May 18 04:33:24 2014 (r266393) @@ -837,13 +837,35 @@ save_guest_fpustate(struct vcpu *vcpu) static VMM_STAT(VCPU_IDLE_TICKS, "number of ticks vcpu was idle"); static int -vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate) +vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate, + bool from_idle) { int error; vcpu_assert_locked(vcpu); /* + * State transitions from the vmmdev_ioctl() must always begin from + * the VCPU_IDLE state. This guarantees that there is only a single + * ioctl() operating on a vcpu at any point. + */ + if (from_idle) { + while (vcpu->state != VCPU_IDLE) + msleep_spin(&vcpu->state, &vcpu->mtx, "vmstat", hz); + } else { + KASSERT(vcpu->state != VCPU_IDLE, ("invalid transition from " + "vcpu idle state")); + } + + if (vcpu->state == VCPU_RUNNING) { + KASSERT(vcpu->hostcpu == curcpu, ("curcpu %d and hostcpu %d " + "mismatch for running vcpu", curcpu, vcpu->hostcpu)); + } else { + KASSERT(vcpu->hostcpu == NOCPU, ("Invalid hostcpu %d for a " + "vcpu that is not running", vcpu->hostcpu)); + } + + /* * The following state transitions are allowed: * IDLE -> FROZEN -> IDLE * FROZEN -> RUNNING -> FROZEN @@ -863,12 +885,19 @@ vcpu_set_state_locked(struct vcpu *vcpu, break; } - if (error == 0) - vcpu->state = newstate; + if (error) + return (EBUSY); + + vcpu->state = newstate; + if (newstate == VCPU_RUNNING) + vcpu->hostcpu = curcpu; else - error = EBUSY; + vcpu->hostcpu = NOCPU; - return (error); + if (newstate == VCPU_IDLE) + wakeup(&vcpu->state); + + return (0); } static void @@ -876,7 +905,7 @@ vcpu_require_state(struct vm *vm, int vc { int error; - if ((error = vcpu_set_state(vm, vcpuid, newstate)) != 0) + if ((error = vcpu_set_state(vm, vcpuid, newstate, false)) != 0) panic("Error %d setting state to %d\n", error, newstate); } @@ -885,7 +914,7 @@ vcpu_require_state_locked(struct vcpu *v { int error; - if ((error = vcpu_set_state_locked(vcpu, newstate)) != 0) + if ((error = vcpu_set_state_locked(vcpu, newstate, false)) != 0) panic("Error %d setting state to %d", error, newstate); } @@ -1131,9 +1160,7 @@ restart: restore_guest_fpustate(vcpu); vcpu_require_state(vm, vcpuid, VCPU_RUNNING); - vcpu->hostcpu = curcpu; error = VMRUN(vm->cookie, vcpuid, rip, pmap, &vm->rendezvous_func); - vcpu->hostcpu = NOCPU; vcpu_require_state(vm, vcpuid, VCPU_FROZEN); save_guest_fpustate(vcpu); @@ -1343,7 +1370,8 @@ vm_iommu_domain(struct vm *vm) } int -vcpu_set_state(struct vm *vm, int vcpuid, enum vcpu_state newstate) +vcpu_set_state(struct vm *vm, int vcpuid, enum vcpu_state newstate, + bool from_idle) { int error; struct vcpu *vcpu; @@ -1354,7 +1382,7 @@ vcpu_set_state(struct vm *vm, int vcpuid vcpu = &vm->vcpu[vcpuid]; vcpu_lock(vcpu); - error = vcpu_set_state_locked(vcpu, newstate); + error = vcpu_set_state_locked(vcpu, newstate, from_idle); vcpu_unlock(vcpu); return (error); @@ -1475,19 +1503,28 @@ vcpu_notify_event(struct vm *vm, int vcp vcpu_lock(vcpu); hostcpu = vcpu->hostcpu; - if (hostcpu == NOCPU) { - if (vcpu->state == VCPU_SLEEPING) - wakeup_one(vcpu); - } else { - if (vcpu->state != VCPU_RUNNING) - panic("invalid vcpu state %d", vcpu->state); + if (vcpu->state == VCPU_RUNNING) { + KASSERT(hostcpu != NOCPU, ("vcpu running on invalid hostcpu")); if (hostcpu != curcpu) { - if (lapic_intr) + if (lapic_intr) { vlapic_post_intr(vcpu->vlapic, hostcpu, vmm_ipinum); - else + } else { ipi_cpu(hostcpu, vmm_ipinum); + } + } else { + /* + * If the 'vcpu' is running on 'curcpu' then it must + * be sending a notification to itself (e.g. SELF_IPI). + * The pending event will be picked up when the vcpu + * transitions back to guest context. + */ } + } else { + KASSERT(hostcpu == NOCPU, ("vcpu state %d not consistent " + "with hostcpu %d", vcpu->state, hostcpu)); + if (vcpu->state == VCPU_SLEEPING) + wakeup_one(vcpu); } vcpu_unlock(vcpu); } Modified: stable/10/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_dev.c Sun May 18 04:21:12 2014 (r266392) +++ stable/10/sys/amd64/vmm/vmm_dev.c Sun May 18 04:33:24 2014 (r266393) @@ -197,7 +197,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c goto done; } - error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN); + error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN, true); if (error) goto done; @@ -214,14 +214,14 @@ vmmdev_ioctl(struct cdev *cdev, u_long c */ error = 0; for (vcpu = 0; vcpu < VM_MAXCPU; vcpu++) { - error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN); + error = vcpu_set_state(sc->vm, vcpu, VCPU_FROZEN, true); if (error) break; } if (error) { while (--vcpu >= 0) - vcpu_set_state(sc->vm, vcpu, VCPU_IDLE); + vcpu_set_state(sc->vm, vcpu, VCPU_IDLE, false); goto done; } @@ -387,10 +387,10 @@ vmmdev_ioctl(struct cdev *cdev, u_long c } if (state_changed == 1) { - vcpu_set_state(sc->vm, vcpu, VCPU_IDLE); + vcpu_set_state(sc->vm, vcpu, VCPU_IDLE, false); } else if (state_changed == 2) { for (vcpu = 0; vcpu < VM_MAXCPU; vcpu++) - vcpu_set_state(sc->vm, vcpu, VCPU_IDLE); + vcpu_set_state(sc->vm, vcpu, VCPU_IDLE, false); } done: Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Sun May 18 04:21:12 2014 (r266392) +++ stable/10/usr.sbin/bhyve/bhyverun.c Sun May 18 04:33:24 2014 (r266393) @@ -493,19 +493,8 @@ vm_loop(struct vmctx *ctx, int vcpu, uin while (1) { error = vm_run(ctx, vcpu, rip, &vmexit[vcpu]); - if (error != 0) { - /* - * It is possible that 'vmmctl' or some other process - * has transitioned the vcpu to CANNOT_RUN state right - * before we tried to transition it to RUNNING. - * - * This is expected to be temporary so just retry. - */ - if (errno == EBUSY) - continue; - else - break; - } + if (error != 0) + break; prevcpu = vcpu; From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 13:05:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 41121958; Sun, 18 May 2014 13:05: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 21A832892; Sun, 18 May 2014 13:05: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 s4ID59T1085566; Sun, 18 May 2014 13:05:09 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ID58Y8085559; Sun, 18 May 2014 13:05:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405181305.s4ID58Y8085559@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 13:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266397 - in stable/10/sys: arm/conf arm/rockchip boot/fdt/dts/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 13:05:09 -0000 Author: ian Date: Sun May 18 13:05:07 2014 New Revision: 266397 URL: http://svnweb.freebsd.org/changeset/base/266397 Log: MFC 265624, 265739: Fix interrupt parent property in dts, add SMP support. Added: stable/10/sys/arm/rockchip/rk30xx_mp.c - copied unchanged from r265739, head/sys/arm/rockchip/rk30xx_mp.c Modified: stable/10/sys/arm/conf/RADXA stable/10/sys/arm/rockchip/files.rk30xx stable/10/sys/arm/rockchip/rk30xx_machdep.c stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/RADXA ============================================================================== --- stable/10/sys/arm/conf/RADXA Sun May 18 09:29:00 2014 (r266396) +++ stable/10/sys/arm/conf/RADXA Sun May 18 13:05:07 2014 (r266397) @@ -121,3 +121,4 @@ options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=rk3188-radxa.dts +options SMP # Enable multiple cores Modified: stable/10/sys/arm/rockchip/files.rk30xx ============================================================================== --- stable/10/sys/arm/rockchip/files.rk30xx Sun May 18 09:29:00 2014 (r266396) +++ stable/10/sys/arm/rockchip/files.rk30xx Sun May 18 13:05:07 2014 (r266397) @@ -19,3 +19,4 @@ arm/rockchip/rk30xx_grf.c standard arm/rockchip/rk30xx_wdog.c standard arm/rockchip/rk30xx_gpio.c optional gpio dev/usb/controller/dwc_otg_fdt.c optional dwcotg +arm/rockchip/rk30xx_mp.c optional smp Modified: stable/10/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_machdep.c Sun May 18 09:29:00 2014 (r266396) +++ stable/10/sys/arm/rockchip/rk30xx_machdep.c Sun May 18 13:05:07 2014 (r266397) @@ -83,6 +83,7 @@ int initarm_devmap_init(void) { + arm_devmap_add_entry(0x10000000, 0x00200000); arm_devmap_add_entry(0x20000000, 0x00100000); return (0); Copied: stable/10/sys/arm/rockchip/rk30xx_mp.c (from r265739, head/sys/arm/rockchip/rk30xx_mp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/rockchip/rk30xx_mp.c Sun May 18 13:05:07 2014 (r266397, copy of r265739, head/sys/arm/rockchip/rk30xx_mp.c) @@ -0,0 +1,192 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define SCU_PHYSBASE 0x1013c000 +#define SCU_SIZE 0x100 + +#define SCU_CONTROL_REG 0x00 +#define SCU_CONTROL_ENABLE (1 << 0) +#define SCU_STANDBY_EN (1 << 5) +#define SCU_CONFIG_REG 0x04 +#define SCU_CONFIG_REG_NCPU_MASK 0x03 +#define SCU_CPUPOWER_REG 0x08 +#define SCU_INV_TAGS_REG 0x0c + +#define SCU_FILTER_START_REG 0x10 +#define SCU_FILTER_END_REG 0x14 +#define SCU_SECURE_ACCESS_REG 0x18 +#define SCU_NONSECURE_ACCESS_REG 0x1c + +#define IMEM_PHYSBASE 0x10080000 +#define IMEM_SIZE 0x20 + +#define PMU_PHYSBASE 0x20004000 +#define PMU_SIZE 0x100 +#define PMU_PWRDN_CON 0x08 +#define PMU_PWRDN_SCU (1 << 4) + +extern char *mpentry_addr; +static void rk30xx_boot2(void); + +static void +rk30xx_boot2(void) +{ + + __asm __volatile( + "ldr pc, 1f\n" + ".globl mpentry_addr\n" + "mpentry_addr:\n" + "1: .space 4\n"); +} + +void +platform_mp_init_secondary(void) +{ + + gic_init_secondary(); +} + +void +platform_mp_setmaxid(void) +{ + bus_space_handle_t scu; + int ncpu; + uint32_t val; + + if (mp_ncpus != 0) + return; + + if (bus_space_map(fdtbus_bs_tag, SCU_PHYSBASE, SCU_SIZE, 0, &scu) != 0) + panic("Could not map the SCU"); + + val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONFIG_REG); + ncpu = (val & SCU_CONFIG_REG_NCPU_MASK) + 1; + bus_space_unmap(fdtbus_bs_tag, scu, SCU_SIZE); + + mp_ncpus = ncpu; + mp_maxid = ncpu - 1; +} + +int +platform_mp_probe(void) +{ + + if (mp_ncpus == 0) + platform_mp_setmaxid(); + + return (mp_ncpus > 1); +} + +void +platform_mp_start_ap(void) +{ + bus_space_handle_t scu; + bus_space_handle_t imem; + bus_space_handle_t pmu; + uint32_t val; + int i; + + if (bus_space_map(fdtbus_bs_tag, SCU_PHYSBASE, SCU_SIZE, 0, &scu) != 0) + panic("Could not map the SCU"); + if (bus_space_map(fdtbus_bs_tag, IMEM_PHYSBASE, + IMEM_SIZE, 0, &imem) != 0) + panic("Could not map the IMEM"); + if (bus_space_map(fdtbus_bs_tag, PMU_PHYSBASE, PMU_SIZE, 0, &pmu) != 0) + panic("Could not map the PMU"); + + /* + * Invalidate SCU cache tags. The 0x0000ffff constant invalidates all + * ways on all cores 0-3. Per the ARM docs, it's harmless to write to + * the bits for cores that are not present. + */ + bus_space_write_4(fdtbus_bs_tag, scu, SCU_INV_TAGS_REG, 0x0000ffff); + + /* Make sure all cores except the first are off */ + val = bus_space_read_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON); + for (i = 1; i < mp_ncpus; i++) + val |= 1 << i; + bus_space_write_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON, val); + + /* Enable SCU power domain */ + val = bus_space_read_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON); + val &= ~PMU_PWRDN_SCU; + bus_space_write_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON, val); + + /* Enable SCU */ + val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG); + bus_space_write_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG, + val | SCU_CONTROL_ENABLE); + + /* + * Cores will execute the code which resides at the start of + * the on-chip bootram/sram after power-on. This sram region + * should be reserved and the trampoline code that directs + * the core to the real startup code in ram should be copied + * into this sram region. + * + * First set boot function for the sram code. + */ + mpentry_addr = (char *)pmap_kextract((vm_offset_t)mpentry); + + /* Copy trampoline to sram, that runs during startup of the core */ + bus_space_write_region_4(fdtbus_bs_tag, imem, 0, + (uint32_t *)&rk30xx_boot2, 8); + + cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); + + /* Start all cores */ + val = bus_space_read_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON); + for (i = 1; i < mp_ncpus; i++) + val &= ~(1 << i); + bus_space_write_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON, val); + + armv7_sev(); + + bus_space_unmap(fdtbus_bs_tag, scu, SCU_SIZE); + bus_space_unmap(fdtbus_bs_tag, imem, IMEM_SIZE); + bus_space_unmap(fdtbus_bs_tag, pmu, PMU_SIZE); +} + +void +platform_ipi_send(cpuset_t cpus, u_int ipi) +{ + + pic_ipi_send(cpus, ipi); +} Modified: stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi Sun May 18 09:29:00 2014 (r266396) +++ stable/10/sys/boot/fdt/dts/arm/rk3188.dtsi Sun May 18 13:05:07 2014 (r266397) @@ -31,6 +31,8 @@ #address-cells = <1>; #size-cells = <1>; + interrupt-parent = <&GIC>; + aliases { soc = &SOC; }; From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 15:28:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4E59B9B1; Sun, 18 May 2014 15:28: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 212752280; Sun, 18 May 2014 15:28: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 s4IFSQ9R077487; Sun, 18 May 2014 15:28:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IFSPmY077485; Sun, 18 May 2014 15:28:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405181528.s4IFSPmY077485@svn.freebsd.org> From: John Baldwin Date: Sun, 18 May 2014 15:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266400 - stable/10/usr.sbin/mfiutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 15:28:26 -0000 Author: jhb Date: Sun May 18 15:28:25 2014 New Revision: 266400 URL: http://svnweb.freebsd.org/changeset/base/266400 Log: MFC 264765,264766: - Don't claim the adapter is idle if it is clearing a drive. - Fix an off by one error when checking for the stop event. This resulted in not showing the most recent event by default. - When the stop even is hit, break out of the outer loop to stop fetching more events. Modified: stable/10/usr.sbin/mfiutil/mfi_evt.c stable/10/usr.sbin/mfiutil/mfi_show.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- stable/10/usr.sbin/mfiutil/mfi_evt.c Sun May 18 14:25:19 2014 (r266399) +++ stable/10/usr.sbin/mfiutil/mfi_evt.c Sun May 18 15:28:25 2014 (r266400) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -534,6 +535,7 @@ show_events(int ac, char **av) struct mfi_evt_log_state info; struct mfi_evt_list *list; union mfi_evt filter; + bool first; long val; char *cp; ssize_t size; @@ -640,7 +642,9 @@ show_events(int ac, char **av) close(fd); return (ENOMEM); } - for (seq = start;;) { + first = true; + seq = start; + for (;;) { if (mfi_get_events(fd, list, num_events, filter, seq, &status) < 0) { error = errno; @@ -650,8 +654,6 @@ show_events(int ac, char **av) return (error); } if (status == MFI_STAT_NOT_FOUND) { - if (seq == start) - warnx("No matching events found"); break; } if (status != MFI_STAT_OK) { @@ -669,13 +671,14 @@ show_events(int ac, char **av) * the case that our stop point is earlier in * the buffer than our start point. */ - if (list->event[i].seq >= stop) { + if (list->event[i].seq > stop) { if (start <= stop) - break; + goto finish; else if (list->event[i].seq < start) - break; + goto finish; } mfi_decode_evt(fd, &list->event[i], verbose); + first = false; } /* @@ -686,6 +689,9 @@ show_events(int ac, char **av) seq = list->event[list->count - 1].seq + 1; } +finish: + if (first) + warnx("No matching events found"); free(list); close(fd); Modified: stable/10/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/10/usr.sbin/mfiutil/mfi_show.c Sun May 18 14:25:19 2014 (r266399) +++ stable/10/usr.sbin/mfiutil/mfi_show.c Sun May 18 15:28:25 2014 (r266400) @@ -766,7 +766,7 @@ show_progress(int ac, char **av __unused printf("drive %s ", mfi_drive_name(NULL, device_id, MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress("Clear", &pinfo.prog_info.clear); - + busy = 1; } } From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 16:02:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8C5D7AAE; Sun, 18 May 2014 16:02: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 797BB2583; Sun, 18 May 2014 16:02: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 s4IG2vDM002652; Sun, 18 May 2014 16:02:57 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IG2vVN002651; Sun, 18 May 2014 16:02:57 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405181602.s4IG2vVN002651@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 16:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266404 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 16:02:57 -0000 Author: ian Date: Sun May 18 16:02:56 2014 New Revision: 266404 URL: http://svnweb.freebsd.org/changeset/base/266404 Log: MFC 256941: make sure the frame is indeed in the kernel memory. Modified: stable/10/sys/arm/arm/stack_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/stack_machdep.c ============================================================================== --- stable/10/sys/arm/arm/stack_machdep.c Sun May 18 15:31:53 2014 (r266403) +++ stable/10/sys/arm/arm/stack_machdep.c Sun May 18 16:02:56 2014 (r266404) @@ -43,13 +43,16 @@ __FBSDID("$FreeBSD$"); * APCS where it lays out the stack incorrectly. Because of this we disable * this when building for ARM EABI or when building with clang. */ + +extern vm_offset_t kernel_vm_end; + static void stack_capture(struct stack *st, u_int32_t *frame) { #if !defined(__ARM_EABI__) && !defined(__clang__) vm_offset_t callpc; - while (INKERNEL(frame)) { + while (INKERNEL(frame) && (vm_offset_t)frame < kernel_vm_end) { callpc = frame[FR_SCP]; if (stack_put(st, callpc) == -1) break; From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 16:03:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6E573BDC; Sun, 18 May 2014 16:03: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 5B6742588; Sun, 18 May 2014 16:03: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 s4IG3ZTx002834; Sun, 18 May 2014 16:03:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IG3Z6B002833; Sun, 18 May 2014 16:03:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405181603.s4IG3Z6B002833@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 16:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266405 - stable/10/sys/arm/allwinner X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 16:03:35 -0000 Author: ian Date: Sun May 18 16:03:34 2014 New Revision: 266405 URL: http://svnweb.freebsd.org/changeset/base/266405 Log: MFC 256873: Make watchdog function conform watchdog(9): Modified: stable/10/sys/arm/allwinner/a10_wdog.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/allwinner/a10_wdog.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_wdog.c Sun May 18 16:02:56 2014 (r266404) +++ stable/10/sys/arm/allwinner/a10_wdog.c Sun May 18 16:03:34 2014 (r266405) @@ -153,6 +153,18 @@ a10wd_watchdog_fn(void *private, u_int c (wd_intervals[i].value << WDOG_MODE_INTVL_SHIFT) | WDOG_MODE_EN | WDOG_MODE_RST_EN); WRITE(sc, WDOG_CTRL, WDOG_CTRL_RESTART); + *error = 0; + } + else { + /* + * Can't arm + * disable watchdog as watchdog(9) requires + */ + device_printf(sc->dev, + "Can't arm, timeout is more than 16 sec\n"); + mtx_unlock(&sc->mtx); + WRITE(sc, WDOG_MODE, 0); + return; } } else From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 16:07:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 255E3D58; Sun, 18 May 2014 16:07: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 122CA25B7; Sun, 18 May 2014 16:07: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 s4IG7ZP5003663; Sun, 18 May 2014 16:07:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IG7Zdc003661; Sun, 18 May 2014 16:07:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405181607.s4IG7Zdc003661@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 16:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266406 - stable/10/sys/arm/xscale/ixp425 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 16:07:36 -0000 Author: ian Date: Sun May 18 16:07:35 2014 New Revision: 266406 URL: http://svnweb.freebsd.org/changeset/base/266406 Log: MFC 256942, 256943: - Fix a typo. - Use bus_dmamap_unload(), it is not optional. - The new allocator won't return coherent memory for any size > PAGE_SIZE, so don't assume we have coherent memory, and explicitely use bus_dmamap_sync(). Modified: stable/10/sys/arm/xscale/ixp425/if_npe.c stable/10/sys/arm/xscale/ixp425/ixp425_mem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/if_npe.c Sun May 18 16:03:34 2014 (r266405) +++ stable/10/sys/arm/xscale/ixp425/if_npe.c Sun May 18 16:07:35 2014 (r266406) @@ -508,7 +508,6 @@ npe_dma_setup(struct npe_softc *sc, stru dma->name, error); return error; } - /* XXX COHERENT for now */ if (bus_dmamem_alloc(dma->buf_tag, (void **)&dma->hwbuf, BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &dma->buf_map) != 0) { @@ -1074,6 +1073,7 @@ npe_rxbuf_init(struct npe_softc *sc, str m->m_pkthdr.len = m->m_len = 1536; /* backload payload and align ip hdr */ m->m_data = m->m_ext.ext_buf + (m->m_ext.ext_size - (1536+ETHER_ALIGN)); + bus_dmamap_unload(dma->mtag, npe->ix_map); error = bus_dmamap_load_mbuf_sg(dma->mtag, npe->ix_map, m, segs, &nseg, 0); if (error != 0) { @@ -1086,6 +1086,8 @@ npe_rxbuf_init(struct npe_softc *sc, str /* NB: buffer length is shifted in word */ hw->ix_ne[0].len = htobe32(segs[0].ds_len << 16); hw->ix_ne[0].next = 0; + bus_dmamap_sync(dma->buf_tag, dma->buf_map, + BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); npe->ix_m = m; /* Flush the memory in the mbuf */ bus_dmamap_sync(dma->mtag, npe->ix_map, BUS_DMASYNC_PREREAD); @@ -1111,6 +1113,8 @@ npe_rxdone(int qid, void *arg) struct npebuf *npe = P2V(NPE_QM_Q_ADDR(entry), dma); struct mbuf *m; + bus_dmamap_sync(dma->buf_tag, dma->buf_map, + BUS_DMASYNC_POSTREAD); DPRINTF(sc, "%s: entry 0x%x neaddr 0x%x ne_len 0x%x\n", __func__, entry, npe->ix_neaddr, npe->ix_hw->ix_ne[0].len); /* @@ -1131,7 +1135,6 @@ npe_rxdone(int qid, void *arg) bus_dmamap_sync(dma->mtag, npe->ix_map, BUS_DMASYNC_POSTREAD); - /* XXX flush hw buffer; works now 'cuz coherent */ /* set m_len etc. per rx frame size */ mrx->m_len = be32toh(hw->ix_ne[0].len) & 0xffff; mrx->m_pkthdr.len = mrx->m_len; @@ -1314,6 +1317,7 @@ npestart_locked(struct ifnet *ifp) return; } npe = sc->tx_free; + bus_dmamap_unload(dma->mtag, npe->ix_map); error = bus_dmamap_load_mbuf_sg(dma->mtag, npe->ix_map, m, segs, &nseg, 0); if (error == EFBIG) { @@ -1356,7 +1360,8 @@ npestart_locked(struct ifnet *ifp) next += sizeof(hw->ix_ne[0]); } hw->ix_ne[i-1].next = 0; /* zero last in chain */ - /* XXX flush descriptor instead of using uncached memory */ + bus_dmamap_sync(dma->buf_tag, dma->buf_map, + BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); DPRINTF(sc, "%s: qwrite(%u, 0x%x) ne_data %x ne_len 0x%x\n", __func__, sc->tx_qid, npe->ix_neaddr, Modified: stable/10/sys/arm/xscale/ixp425/ixp425_mem.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/ixp425_mem.c Sun May 18 16:03:34 2014 (r266405) +++ stable/10/sys/arm/xscale/ixp425/ixp425_mem.c Sun May 18 16:07:35 2014 (r266406) @@ -76,7 +76,7 @@ ixp425_sdram_size(void) size = sdram_other[MCU_SDR_CONFIG_MCONF(sdr_config)]; if (size == 0) { - printf("** SDR_CONFIG retuns unknown value, using 32M\n"); + printf("** SDR_CONFIG returns unknown value, using 32M\n"); size = 32 * 1024 * 1024; } From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 16:17:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E5159326; Sun, 18 May 2014 16:17: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 D23962675; Sun, 18 May 2014 16:17: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 s4IGHDiD010312; Sun, 18 May 2014 16:17:13 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IGHDbl010311; Sun, 18 May 2014 16:17:13 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405181617.s4IGHDbl010311@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 16:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266408 - stable/10/sys/arm/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 16:17:14 -0000 Author: ian Date: Sun May 18 16:17:13 2014 New Revision: 266408 URL: http://svnweb.freebsd.org/changeset/base/266408 Log: MFC 257189: Fix an itt instruction. We need to execute both the mov and b instructions when building for Thumb. Modified: stable/10/sys/arm/include/atomic.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/include/atomic.h ============================================================================== --- stable/10/sys/arm/include/atomic.h Sun May 18 16:08:11 2014 (r266407) +++ stable/10/sys/arm/include/atomic.h Sun May 18 16:17:13 2014 (r266408) @@ -198,7 +198,7 @@ atomic_cmpset_32(volatile u_int32_t *p, __asm __volatile("1: ldrex %0, [%1]\n" "cmp %0, %2\n" - "it ne\n" + "itt ne\n" "movne %0, #0\n" "bne 2f\n" "strex %0, %3, [%1]\n" From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 16:39:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8CCC2833; Sun, 18 May 2014 16:39: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 79F4D27D6; Sun, 18 May 2014 16:39: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 s4IGdmkh023736; Sun, 18 May 2014 16:39:48 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IGdmRB023735; Sun, 18 May 2014 16:39:48 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405181639.s4IGdmRB023735@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 16:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266409 - stable/10/sys/arm/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 16:39:48 -0000 Author: ian Date: Sun May 18 16:39:47 2014 New Revision: 266409 URL: http://svnweb.freebsd.org/changeset/base/266409 Log: MFC 257231: Make sure the PCB is aligned on 8 bytes, we may use ldrd/strd to access it, which may have strong alignment requirements. Modified: stable/10/sys/arm/include/pcb.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/include/pcb.h ============================================================================== --- stable/10/sys/arm/include/pcb.h Sun May 18 16:17:13 2014 (r266408) +++ stable/10/sys/arm/include/pcb.h Sun May 18 16:39:47 2014 (r266409) @@ -80,7 +80,11 @@ struct pcb { struct pcb_arm32 un_32; struct vfp_state pcb_vfpstate; /* VP/NEON state */ u_int pcb_vfpcpu; /* VP/NEON last cpu */ -}; +} __aligned(8); /* + * We need the PCB to be aligned on 8 bytes, as we may + * access it using ldrd/strd, and some CPUs require it + * to by aligned on 8 bytes. + */ /* * No additional data for core dumps. From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 16:43:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BF74E97F; Sun, 18 May 2014 16:43: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 AC9EF285E; Sun, 18 May 2014 16:43: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 s4IGhlVn029056; Sun, 18 May 2014 16:43:47 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IGhlGq029055; Sun, 18 May 2014 16:43:47 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405181643.s4IGhlGq029055@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 16:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266410 - stable/10/lib/csu/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 16:43:47 -0000 Author: ian Date: Sun May 18 16:43:47 2014 New Revision: 266410 URL: http://svnweb.freebsd.org/changeset/base/266410 Log: MFC 257233: Use size of the MACHINE_ARCH string instead of sizeof(uint32_t). Modified: stable/10/lib/csu/arm/crt1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/csu/arm/crt1.c ============================================================================== --- stable/10/lib/csu/arm/crt1.c Sun May 18 16:39:47 2014 (r266409) +++ stable/10/lib/csu/arm/crt1.c Sun May 18 16:43:47 2014 (r266410) @@ -123,7 +123,7 @@ static const struct { char desc[sizeof(MACHINE_ARCH)]; } archtag __attribute__ ((section (NOTE_SECTION), aligned(4))) __used = { .namesz = sizeof(NOTE_FREEBSD_VENDOR), - .descsz = sizeof(int32_t), + .descsz = sizeof(MACHINE_ARCH), .type = ARCH_NOTETYPE, .name = NOTE_FREEBSD_VENDOR, .desc = MACHINE_ARCH From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 17:46:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 26914793; Sun, 18 May 2014 17:46: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 124E62C88; Sun, 18 May 2014 17:46: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 s4IHkmxq068424; Sun, 18 May 2014 17:46:48 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IHkmS0068423; Sun, 18 May 2014 17:46:48 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405181746.s4IHkmS0068423@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 17:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266412 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 17:46:49 -0000 Author: ian Date: Sun May 18 17:46:48 2014 New Revision: 266412 URL: http://svnweb.freebsd.org/changeset/base/266412 Log: MFC 258287: Implement pmap_align_superpage(). Modified: stable/10/sys/arm/arm/pmap-v6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Sun May 18 17:14:08 2014 (r266411) +++ stable/10/sys/arm/arm/pmap-v6.c Sun May 18 17:46:48 2014 (r266412) @@ -5089,6 +5089,20 @@ void pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, vm_size_t size) { + vm_offset_t superpage_offset; + + if (size < NBPDR) + return; + if (object != NULL && (object->flags & OBJ_COLORED) != 0) + offset += ptoa(object->pg_color); + superpage_offset = offset & PDRMASK; + if (size - ((NBPDR - superpage_offset) & PDRMASK) < NBPDR || + (*addr & PDRMASK) == superpage_offset) + return; + if ((*addr & PDRMASK) < superpage_offset) + *addr = (*addr & ~PDRMASK) + superpage_offset; + else + *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } /* From owner-svn-src-stable-10@FreeBSD.ORG Sun May 18 19:28:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 38AF9434; Sun, 18 May 2014 19:28: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 256DC246D; Sun, 18 May 2014 19:28: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 s4IJSGmo034587; Sun, 18 May 2014 19:28:16 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IJSF0j034586; Sun, 18 May 2014 19:28:15 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405181928.s4IJSF0j034586@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 19:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266414 - stable/10/contrib/binutils/gas/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 19:28:16 -0000 Author: ian Date: Sun May 18 19:28:15 2014 New Revision: 266414 URL: http://svnweb.freebsd.org/changeset/base/266414 Log: MFC r256790: Fix the VCVT instruction. It must round towards zero when converting from a floating-point to an integer value. This was not the case causing issues when printing certain values. Modified: stable/10/contrib/binutils/gas/config/tc-arm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-arm.c Sun May 18 17:58:33 2014 (r266413) +++ stable/10/contrib/binutils/gas/config/tc-arm.c Sun May 18 19:28:15 2014 (r266414) @@ -12660,14 +12660,14 @@ do_vfp_nsyn_cvt (enum neon_shape rs, int /* Conversions without bitshift. */ const char *enc[] = { - "ftosis", - "ftouis", + "ftosizs", + "ftouizs", "fsitos", "fuitos", "fcvtsd", "fcvtds", - "ftosid", - "ftouid", + "ftosizd", + "ftouizd", "fsitod", "fuitod" }; From owner-svn-src-stable-10@FreeBSD.ORG Mon May 19 04:53:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D7B7AF14; Mon, 19 May 2014 04:53: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 C49032E82; Mon, 19 May 2014 04:53:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4J4rhO4007579; Mon, 19 May 2014 04:53:43 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4J4rhxr007578; Mon, 19 May 2014 04:53:43 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201405190453.s4J4rhxr007578@svn.freebsd.org> From: Don Lewis Date: Mon, 19 May 2014 04:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266427 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 04:53:43 -0000 Author: truckman Date: Mon May 19 04:53:43 2014 New Revision: 266427 URL: http://svnweb.freebsd.org/changeset/base/266427 Log: Nuke a couple of unnecessary assigments. Nothing uses the values of rstart and rend after this point. Modified: stable/10/sys/kern/subr_rman.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_rman.c ============================================================================== --- stable/10/sys/kern/subr_rman.c Mon May 19 04:44:27 2014 (r266426) +++ stable/10/sys/kern/subr_rman.c Mon May 19 04:53:43 2014 (r266427) @@ -607,8 +607,6 @@ rman_reserve_resource_bound(struct rman break; if ((s->r_flags & flags) != flags) continue; - rstart = ulmax(s->r_start, start); - rend = ulmin(s->r_end, ulmax(start + count - 1, end)); if (s->r_start >= start && s->r_end <= end && (s->r_end - s->r_start + 1) == count && (s->r_start & amask) == 0 && From owner-svn-src-stable-10@FreeBSD.ORG Mon May 19 04:55:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 36F4CD1; Mon, 19 May 2014 04:55: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 23F3B2E88; Mon, 19 May 2014 04:55: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 s4J4tsKn008011; Mon, 19 May 2014 04:55:54 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4J4tsec008010; Mon, 19 May 2014 04:55:54 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201405190455.s4J4tsec008010@svn.freebsd.org> From: Don Lewis Date: Mon, 19 May 2014 04:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266428 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 04:55:54 -0000 Author: truckman Date: Mon May 19 04:55:53 2014 New Revision: 266428 URL: http://svnweb.freebsd.org/changeset/base/266428 Log: Be even more paranoid about overflow. Requested by: ache Modified: stable/10/sys/kern/subr_rman.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_rman.c ============================================================================== --- stable/10/sys/kern/subr_rman.c Mon May 19 04:53:43 2014 (r266427) +++ stable/10/sys/kern/subr_rman.c Mon May 19 04:55:53 2014 (r266428) @@ -466,8 +466,8 @@ rman_reserve_resource_bound(struct rman } amask = (1ul << RF_ALIGNMENT(flags)) - 1; - if (start + amask < start) { - DPRINTF(("start+amask wrapped around\n")); + if (start > ULONG_MAX - amask) { + DPRINTF(("start+amask would wrap around\n")); goto out; } @@ -487,8 +487,8 @@ rman_reserve_resource_bound(struct rman s->r_start, end)); break; } - if (s->r_start + amask < s->r_start) { - DPRINTF(("s->r_start (%#lx) + amask (%#lx) wrapped\n", + if (s->r_start > ULONG_MAX - amask) { + DPRINTF(("s->r_start (%#lx) + amask (%#lx) too large\n", s->r_start, amask)); break; } From owner-svn-src-stable-10@FreeBSD.ORG Mon May 19 08:07:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5C1895E8; Mon, 19 May 2014 08:07:14 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (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 3E1F52D89; Mon, 19 May 2014 08:07:14 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s4J874oP097251; Mon, 19 May 2014 01:07:08 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201405190807.s4J874oP097251@gw.catspoiler.org> Date: Mon, 19 May 2014 01:07:04 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r266427 - stable/10/sys/kern To: src-committers@FreeBSD.org In-Reply-To: <201405190453.s4J4rhxr007578@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable-10@FreeBSD.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 08:07:14 -0000 On 19 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Mon May 19 04:53:43 2014 > New Revision: 266427 > URL: http://svnweb.freebsd.org/changeset/base/266427 > > Log: MFC r265923 > Nuke a couple of unnecessary assigments. Nothing uses the values of rstart > and rend after this point. > > Modified: > stable/10/sys/kern/subr_rman.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/kern/subr_rman.c > ============================================================================== > --- stable/10/sys/kern/subr_rman.c Mon May 19 04:44:27 2014 (r266426) > +++ stable/10/sys/kern/subr_rman.c Mon May 19 04:53:43 2014 (r266427) > @@ -607,8 +607,6 @@ rman_reserve_resource_bound(struct rman > break; > if ((s->r_flags & flags) != flags) > continue; > - rstart = ulmax(s->r_start, start); > - rend = ulmin(s->r_end, ulmax(start + count - 1, end)); > if (s->r_start >= start && s->r_end <= end > && (s->r_end - s->r_start + 1) == count && > (s->r_start & amask) == 0 && > From owner-svn-src-stable-10@FreeBSD.ORG Mon May 19 08:08:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 797FB71D; Mon, 19 May 2014 08:08:00 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (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 5A8252D91; Mon, 19 May 2014 08:08:00 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s4J87oGY097257; Mon, 19 May 2014 01:07:54 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201405190807.s4J87oGY097257@gw.catspoiler.org> Date: Mon, 19 May 2014 01:07:50 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r266428 - stable/10/sys/kern To: src-committers@FreeBSD.org In-Reply-To: <201405190455.s4J4tsec008010@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable-10@FreeBSD.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 08:08:00 -0000 On 19 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Mon May 19 04:55:53 2014 > New Revision: 266428 > URL: http://svnweb.freebsd.org/changeset/base/266428 > > Log: MFC r265931 > Be even more paranoid about overflow. > > Requested by: ache > > Modified: > stable/10/sys/kern/subr_rman.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/kern/subr_rman.c > ============================================================================== > --- stable/10/sys/kern/subr_rman.c Mon May 19 04:53:43 2014 (r266427) > +++ stable/10/sys/kern/subr_rman.c Mon May 19 04:55:53 2014 (r266428) > @@ -466,8 +466,8 @@ rman_reserve_resource_bound(struct rman > } > > amask = (1ul << RF_ALIGNMENT(flags)) - 1; > - if (start + amask < start) { > - DPRINTF(("start+amask wrapped around\n")); > + if (start > ULONG_MAX - amask) { > + DPRINTF(("start+amask would wrap around\n")); > goto out; > } > > @@ -487,8 +487,8 @@ rman_reserve_resource_bound(struct rman > s->r_start, end)); > break; > } > - if (s->r_start + amask < s->r_start) { > - DPRINTF(("s->r_start (%#lx) + amask (%#lx) wrapped\n", > + if (s->r_start > ULONG_MAX - amask) { > + DPRINTF(("s->r_start (%#lx) + amask (%#lx) too large\n", > s->r_start, amask)); > break; > } > From owner-svn-src-stable-10@FreeBSD.ORG Mon May 19 09:30:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5F37C362; Mon, 19 May 2014 09:30: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 4C3FB246B; Mon, 19 May 2014 09:30: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 s4J9U0h8083348; Mon, 19 May 2014 09:30:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4J9U07Y083342; Mon, 19 May 2014 09:30:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405190930.s4J9U07Y083342@svn.freebsd.org> From: Marius Strobl Date: Mon, 19 May 2014 09:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266436 - stable/10/sys/dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 09:30:00 -0000 Author: marius Date: Mon May 19 09:29:59 2014 New Revision: 266436 URL: http://svnweb.freebsd.org/changeset/base/266436 Log: MFC: r257808 Add new AMT serial port PCI ID on Intel Lynx Point chipset Modified: stable/10/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_pci.c Mon May 19 09:26:35 2014 (r266435) +++ stable/10/sys/dev/uart/uart_bus_pci.c Mon May 19 09:29:59 2014 (r266436) @@ -125,6 +125,7 @@ static const struct pci_id pci_ns8250_id { 0x8086, 0x8812, 0xffff, 0, "Intel EG20T Serial Port 1", 0x10 }, { 0x8086, 0x8813, 0xffff, 0, "Intel EG20T Serial Port 2", 0x10 }, { 0x8086, 0x8814, 0xffff, 0, "Intel EG20T Serial Port 3", 0x10 }, +{ 0x8086, 0x8c3d, 0xffff, 0, "Intel Lynx Point KT Controller", 0x10 }, { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, From owner-svn-src-stable-10@FreeBSD.ORG Mon May 19 10:08:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1AAF85CB; Mon, 19 May 2014 10:08: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 072BF2819; Mon, 19 May 2014 10:08: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 s4JA85xH009259; Mon, 19 May 2014 10:08:05 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JA8511009258; Mon, 19 May 2014 10:08:05 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405191008.s4JA8511009258@svn.freebsd.org> From: Thomas Quinot Date: Mon, 19 May 2014 10:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266441 - stable/10/tools/tools/nanobsd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 10:08:06 -0000 Author: thomas Date: Mon May 19 10:08:05 2014 New Revision: 266441 URL: http://svnweb.freebsd.org/changeset/base/266441 Log: MFC rev. 265926: (NANO_CONFIG): New variable containing path of config file, so that the configuration can reference additional files relative to its own location. (NANO_MODULES): If set to "default", install all built modules. Reviewed by: imp Modified: stable/10/tools/tools/nanobsd/nanobsd.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- stable/10/tools/tools/nanobsd/nanobsd.sh Mon May 19 09:31:49 2014 (r266440) +++ stable/10/tools/tools/nanobsd/nanobsd.sh Mon May 19 10:08:05 2014 (r266441) @@ -79,7 +79,8 @@ CONF_WORLD=' ' # Kernel config file to use NANO_KERNEL=GENERIC -# Kernel modules to build; default is none +# Kernel modules to install. If empty, no modules are installed. +# Use "default" to install all built modules. NANO_MODULES= # Customize commands. @@ -321,13 +322,19 @@ install_kernel ( ) ( kernconf=${NANO_KERNEL} fi + # Install all built modules if NANO_MODULES=default, + # else install only listed modules (none if NANO_MODULES is empty). + if [ "${NANO_MODULES}" != "default" ]; then + modules_override_arg="MODULES_OVERRIDE='${NANO_MODULES}'" + fi + cd ${NANO_SRC} eval "TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ DESTDIR='${NANO_WORLDDIR}' \ SRCCONF='${SRCCONF}' \ __MAKE_CONF='${NANO_MAKE_CONF_INSTALL}' \ ${kernconfdir_arg} KERNCONF=${kernconf} \ - MODULES_OVERRIDE='${NANO_MODULES}'" + ${modules_override_arg}" ) > ${NANO_OBJ}/_.ik 2>&1 ) @@ -925,6 +932,10 @@ do shift ;; -c) + # Make config file path available to the config file + # itself so that it can access additional files relative + # to its own location. + NANO_CONFIG=$2 . "$2" shift shift From owner-svn-src-stable-10@FreeBSD.ORG Mon May 19 19:49:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 87A489F1; Mon, 19 May 2014 19:49:07 +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 748F12052; Mon, 19 May 2014 19:49:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4JJn76Y087312; Mon, 19 May 2014 19:49:07 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JJn79Q087310; Mon, 19 May 2014 19:49:07 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405191949.s4JJn79Q087310@svn.freebsd.org> From: Mark Johnston Date: Mon, 19 May 2014 19:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266452 - stable/10/sys/dev/hwpmc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 19:49:07 -0000 Author: markj Date: Mon May 19 19:49:06 2014 New Revision: 266452 URL: http://svnweb.freebsd.org/changeset/base/266452 Log: MFC r266195: Remove some prototypes for undefined functions. Modified: stable/10/sys/dev/hwpmc/hwpmc_core.h stable/10/sys/dev/hwpmc/hwpmc_uncore.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hwpmc/hwpmc_core.h ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_core.h Mon May 19 19:34:44 2014 (r266451) +++ stable/10/sys/dev/hwpmc/hwpmc_core.h Mon May 19 19:49:06 2014 (r266452) @@ -178,8 +178,6 @@ struct pmc_md_iap_pmc { int pmc_core_initialize(struct pmc_mdep *_md, int _maxcpu); void pmc_core_finalize(struct pmc_mdep *_md); -void pmc_core_mark_started(int _cpu, int _pmc); - int pmc_iaf_initialize(struct pmc_mdep *_md, int _maxcpu, int _npmc, int _width); void pmc_iaf_finalize(struct pmc_mdep *_md); Modified: stable/10/sys/dev/hwpmc/hwpmc_uncore.h ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_uncore.h Mon May 19 19:34:44 2014 (r266451) +++ stable/10/sys/dev/hwpmc/hwpmc_uncore.h Mon May 19 19:49:06 2014 (r266452) @@ -115,8 +115,6 @@ struct pmc_md_ucp_pmc { int pmc_uncore_initialize(struct pmc_mdep *_md, int _maxcpu); void pmc_uncore_finalize(struct pmc_mdep *_md); -void pmc_uncore_mark_started(int _cpu, int _pmc); - int pmc_ucf_initialize(struct pmc_mdep *_md, int _maxcpu, int _npmc, int _width); void pmc_ucf_finalize(struct pmc_mdep *_md); From owner-svn-src-stable-10@FreeBSD.ORG Tue May 20 00:57:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0041D351; Tue, 20 May 2014 00:57: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 E0E6B29F5; Tue, 20 May 2014 00:57: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 s4K0v0Lb082571; Tue, 20 May 2014 00:57:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4K0v0XV082570; Tue, 20 May 2014 00:57:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405200057.s4K0v0XV082570@svn.freebsd.org> From: Xin LI Date: Tue, 20 May 2014 00:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266457 - stable/10/contrib/ntp/ntpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 00:57:01 -0000 Author: delphij Date: Tue May 20 00:57:00 2014 New Revision: 266457 URL: http://svnweb.freebsd.org/changeset/base/266457 Log: MFC r265465: Don't reply monlist request when it's not enabled. Modified: stable/10/contrib/ntp/ntpd/ntp_request.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ntp/ntpd/ntp_request.c ============================================================================== --- stable/10/contrib/ntp/ntpd/ntp_request.c Mon May 19 21:55:47 2014 (r266456) +++ stable/10/contrib/ntp/ntpd/ntp_request.c Tue May 20 00:57:00 2014 (r266457) @@ -1920,7 +1920,6 @@ mon_getlist_0( printf("wants monitor 0 list\n"); #endif if (!mon_enabled) { - req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA); return; } im = (struct info_monitor *)prepare_pkt(srcadr, inter, inpkt, @@ -1965,7 +1964,6 @@ mon_getlist_1( extern int mon_enabled; if (!mon_enabled) { - req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA); return; } im = (struct info_monitor_1 *)prepare_pkt(srcadr, inter, inpkt, From owner-svn-src-stable-10@FreeBSD.ORG Tue May 20 01:17:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 26B19883; Tue, 20 May 2014 01:17: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 13BC52B7D; Tue, 20 May 2014 01:17: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 s4K1Hqft095320; Tue, 20 May 2014 01:17:52 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4K1Hq3m095319; Tue, 20 May 2014 01:17:52 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405200117.s4K1Hq3m095319@svn.freebsd.org> From: Glen Barber Date: Tue, 20 May 2014 01:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266460 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 01:17:53 -0000 Author: gjb Date: Tue May 20 01:17:52 2014 New Revision: 266460 URL: http://svnweb.freebsd.org/changeset/base/266460 Log: Document r266279 and r266280, '-J' flag to ps(1), and corresponding top(1) change. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 20 00:57:53 2014 (r266459) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 20 01:17:52 2014 (r266460) @@ -229,6 +229,17 @@ -b, which outputs the existing buses and their parents. + The &man.ps.1; utility has been + updated to include the -J flag, used to + filter output by matching &man.jail.8; IDs and names. + Additionally, argument 0 can be used to + -J to only list processes running on the + host system. + + The &man.top.1; utility has been updated + to filter by &man.jail.8; ID or name, in followup to the + &man.ps.1; change in r265229. + <filename>/etc/rc.d</filename> Scripts From owner-svn-src-stable-10@FreeBSD.ORG Tue May 20 21:05:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 586BD505; Tue, 20 May 2014 21:05: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 439752303; Tue, 20 May 2014 21:05: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 s4KL5bqj090084; Tue, 20 May 2014 21:05:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KL5bLt090083; Tue, 20 May 2014 21:05:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405202105.s4KL5bLt090083@svn.freebsd.org> From: John Baldwin Date: Tue, 20 May 2014 21:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266477 - stable/10/sys/amd64/vmm/io X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 21:05:37 -0000 Author: jhb Date: Tue May 20 21:05:36 2014 New Revision: 266477 URL: http://svnweb.freebsd.org/changeset/base/266477 Log: MFC 260237: Fix a bug in the HPET emulation where a timer interrupt could be lost when the guest disables the HPET. The HPET timer interrupt is triggered from the callout handler associated with the timer. It is possible for the callout handler to be delayed before it gets a chance to execute. If the guest disables the HPET during this window then the handler never gets a chance to execute and the timer interrupt is lost. This is now fixed by injecting a timer interrupt into the guest if the callout time is detected to be in the past when the HPET is disabled. Modified: stable/10/sys/amd64/vmm/io/vhpet.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/io/vhpet.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vhpet.c Tue May 20 20:30:28 2014 (r266476) +++ stable/10/sys/amd64/vmm/io/vhpet.c Tue May 20 21:05:36 2014 (r266477) @@ -77,8 +77,8 @@ struct vhpet { uint64_t config; /* Configuration */ uint64_t isr; /* Interrupt Status */ - uint32_t counter; /* HPET Counter */ - sbintime_t counter_sbt; + uint32_t countbase; /* HPET counter base value */ + sbintime_t countbase_sbt; /* uptime corresponding to base value */ struct { uint64_t cap_config; /* Configuration */ @@ -86,6 +86,7 @@ struct vhpet { uint32_t compval; /* Comparator */ uint32_t comprate; struct callout callout; + sbintime_t callout_sbt; /* time when counter==compval */ struct vhpet_callout_arg arg; } timer[VHPET_NUM_TIMERS]; }; @@ -93,6 +94,9 @@ struct vhpet { #define VHPET_LOCK(vhp) mtx_lock(&((vhp)->mtx)) #define VHPET_UNLOCK(vhp) mtx_unlock(&((vhp)->mtx)) +static void vhpet_start_timer(struct vhpet *vhpet, int n, uint32_t counter, + sbintime_t now); + static uint64_t vhpet_capabilities(void) { @@ -164,30 +168,28 @@ vhpet_timer_ioapic_pin(struct vhpet *vhp } static uint32_t -vhpet_counter(struct vhpet *vhpet, bool latch) +vhpet_counter(struct vhpet *vhpet, sbintime_t *nowptr) { uint32_t val; - sbintime_t cur_sbt, delta_sbt; + sbintime_t now, delta; - val = vhpet->counter; + val = vhpet->countbase; if (vhpet_counter_enabled(vhpet)) { - cur_sbt = sbinuptime(); - delta_sbt = cur_sbt - vhpet->counter_sbt; - KASSERT(delta_sbt >= 0, - ("vhpet counter went backwards: %#lx to %#lx", - vhpet->counter_sbt, cur_sbt)); - val += delta_sbt / vhpet->freq_sbt; - + now = sbinuptime(); + delta = now - vhpet->countbase_sbt; + KASSERT(delta >= 0, ("vhpet_counter: uptime went backwards: " + "%#lx to %#lx", vhpet->countbase_sbt, now)); + val += delta / vhpet->freq_sbt; + if (nowptr != NULL) + *nowptr = now; + } else { /* - * Keep track of the last value of the main counter that - * was read by the guest. + * The sbinuptime corresponding to the 'countbase' is + * meaningless when the counter is disabled. Make sure + * that the the caller doesn't want to use it. */ - if (latch) { - vhpet->counter = val; - vhpet->counter_sbt = cur_sbt; - } + KASSERT(nowptr == NULL, ("vhpet_counter: nowptr must be NULL")); } - return (val); } @@ -305,7 +307,7 @@ vhpet_handler(void *a) { int n; uint32_t counter; - sbintime_t sbt; + sbintime_t now; struct vhpet *vhpet; struct callout *callout; struct vhpet_callout_arg *arg; @@ -330,14 +332,8 @@ vhpet_handler(void *a) if (!vhpet_counter_enabled(vhpet)) panic("vhpet(%p) callout with counter disabled", vhpet); - counter = vhpet_counter(vhpet, false); - - /* Update the accumulator for periodic timers */ - if (vhpet->timer[n].comprate != 0) - vhpet_adjust_compval(vhpet, n, counter); - - sbt = (vhpet->timer[n].compval - counter) * vhpet->freq_sbt; - callout_reset_sbt(callout, sbt, 0, vhpet_handler, arg, 0); + counter = vhpet_counter(vhpet, &now); + vhpet_start_timer(vhpet, n, counter, now); vhpet_timer_interrupt(vhpet, n); done: VHPET_UNLOCK(vhpet); @@ -345,45 +341,47 @@ done: } static void -vhpet_stop_timer(struct vhpet *vhpet, int n) +vhpet_stop_timer(struct vhpet *vhpet, int n, sbintime_t now) { + VM_CTR1(vhpet->vm, "hpet t%d stopped", n); callout_stop(&vhpet->timer[n].callout); - vhpet_timer_clear_isr(vhpet, n); + + /* + * If the callout was scheduled to expire in the past but hasn't + * had a chance to execute yet then trigger the timer interrupt + * here. Failing to do so will result in a missed timer interrupt + * in the guest. This is especially bad in one-shot mode because + * the next interrupt has to wait for the counter to wrap around. + */ + if (vhpet->timer[n].callout_sbt < now) { + VM_CTR1(vhpet->vm, "hpet t%d interrupt triggered after " + "stopping timer", n); + vhpet_timer_interrupt(vhpet, n); + } } static void -vhpet_start_timer(struct vhpet *vhpet, int n) +vhpet_start_timer(struct vhpet *vhpet, int n, uint32_t counter, sbintime_t now) { - uint32_t counter, delta, delta2; - sbintime_t sbt; - - counter = vhpet_counter(vhpet, false); + sbintime_t delta, precision; if (vhpet->timer[n].comprate != 0) vhpet_adjust_compval(vhpet, n, counter); - - delta = vhpet->timer[n].compval - counter; - - /* - * In one-shot mode the guest will typically read the main counter - * before programming the comparator. We can use this heuristic to - * figure out whether the expiration time is in the past. If this - * is the case we schedule the callout to fire immediately. - */ - if (!vhpet_periodic_timer(vhpet, n)) { - delta2 = vhpet->timer[n].compval - vhpet->counter; - if (delta > delta2) { - VM_CTR3(vhpet->vm, "hpet t%d comparator value is in " - "the past: %u/%u/%u", counter, - vhpet->timer[n].compval, vhpet->counter); - delta = 0; - } + else { + /* + * In one-shot mode it is the guest's responsibility to make + * sure that the comparator value is not in the "past". The + * hardware doesn't have any belt-and-suspenders to deal with + * this so we don't either. + */ } - sbt = delta * vhpet->freq_sbt; - callout_reset_sbt(&vhpet->timer[n].callout, sbt, 0, vhpet_handler, - &vhpet->timer[n].arg, 0); + delta = (vhpet->timer[n].compval - counter) * vhpet->freq_sbt; + precision = delta >> tc_precexp; + vhpet->timer[n].callout_sbt = now + delta; + callout_reset_sbt(&vhpet->timer[n].callout, vhpet->timer[n].callout_sbt, + precision, vhpet_handler, &vhpet->timer[n].arg, C_ABSOLUTE); } static void @@ -391,18 +389,25 @@ vhpet_start_counting(struct vhpet *vhpet { int i; - vhpet->counter_sbt = sbinuptime(); - for (i = 0; i < VHPET_NUM_TIMERS; i++) - vhpet_start_timer(vhpet, i); + vhpet->countbase_sbt = sbinuptime(); + for (i = 0; i < VHPET_NUM_TIMERS; i++) { + /* + * Restart the timers based on the value of the main counter + * when it stopped counting. + */ + vhpet_start_timer(vhpet, i, vhpet->countbase, + vhpet->countbase_sbt); + } } static void -vhpet_stop_counting(struct vhpet *vhpet) +vhpet_stop_counting(struct vhpet *vhpet, uint32_t counter, sbintime_t now) { int i; + vhpet->countbase = counter; for (i = 0; i < VHPET_NUM_TIMERS; i++) - vhpet_stop_timer(vhpet, i); + vhpet_stop_timer(vhpet, i, now); } static __inline void @@ -496,7 +501,8 @@ vhpet_mmio_write(void *vm, int vcpuid, u { struct vhpet *vhpet; uint64_t data, mask, oldval, val64; - uint32_t isr_clear_mask, old_compval, old_comprate; + uint32_t isr_clear_mask, old_compval, old_comprate, counter; + sbintime_t now, *nowptr; int i, offset; vhpet = vm_hpet(vm); @@ -532,6 +538,14 @@ vhpet_mmio_write(void *vm, int vcpuid, u } if (offset == HPET_CONFIG || offset == HPET_CONFIG + 4) { + /* + * Get the most recent value of the counter before updating + * the 'config' register. If the HPET is going to be disabled + * then we need to update 'countbase' with the value right + * before it is disabled. + */ + nowptr = vhpet_counter_enabled(vhpet) ? &now : NULL; + counter = vhpet_counter(vhpet, nowptr); oldval = vhpet->config; update_register(&vhpet->config, data, mask); if ((oldval ^ vhpet->config) & HPET_CNF_ENABLE) { @@ -539,7 +553,7 @@ vhpet_mmio_write(void *vm, int vcpuid, u vhpet_start_counting(vhpet); VM_CTR0(vhpet->vm, "hpet enabled"); } else { - vhpet_stop_counting(vhpet); + vhpet_stop_counting(vhpet, counter, now); VM_CTR0(vhpet->vm, "hpet disabled"); } } @@ -559,9 +573,9 @@ vhpet_mmio_write(void *vm, int vcpuid, u if (offset == HPET_MAIN_COUNTER || offset == HPET_MAIN_COUNTER + 4) { /* Zero-extend the counter to 64-bits before updating it */ - val64 = vhpet->counter; + val64 = vhpet_counter(vhpet, NULL); update_register(&val64, data, mask); - vhpet->counter = val64; + vhpet->countbase = val64; if (vhpet_counter_enabled(vhpet)) vhpet_start_counting(vhpet); goto done; @@ -604,8 +618,11 @@ vhpet_mmio_write(void *vm, int vcpuid, u if (vhpet->timer[i].compval != old_compval || vhpet->timer[i].comprate != old_comprate) { - if (vhpet_counter_enabled(vhpet)) - vhpet_start_timer(vhpet, i); + if (vhpet_counter_enabled(vhpet)) { + counter = vhpet_counter(vhpet, &now); + vhpet_start_timer(vhpet, i, counter, + now); + } } break; } @@ -666,7 +683,7 @@ vhpet_mmio_read(void *vm, int vcpuid, ui } if (offset == HPET_MAIN_COUNTER || offset == HPET_MAIN_COUNTER + 4) { - data = vhpet_counter(vhpet, true); + data = vhpet_counter(vhpet, NULL); goto done; } From owner-svn-src-stable-10@FreeBSD.ORG Tue May 20 21:15:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E55A5B8A; Tue, 20 May 2014 21:15: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 D15502414; Tue, 20 May 2014 21:15: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 s4KLFmWZ095003; Tue, 20 May 2014 21:15:48 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KLFm7S095002; Tue, 20 May 2014 21:15:48 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201405202115.s4KLFm7S095002@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 20 May 2014 21:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266478 - stable/10/gnu/usr.bin/groff/tmac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 21:15:50 -0000 Author: pluknet Date: Tue May 20 21:15:47 2014 New Revision: 266478 URL: http://svnweb.freebsd.org/changeset/base/266478 Log: Add FreeBSD version 11.0. This is a direct commit to stable/10. Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- stable/10/gnu/usr.bin/groff/tmac/mdoc.local Tue May 20 21:05:36 2014 (r266477) +++ stable/10/gnu/usr.bin/groff/tmac/mdoc.local Tue May 20 21:15:47 2014 (r266478) @@ -60,6 +60,7 @@ .ds doc-operating-system-FreeBSD-9.3 9.3 .ds doc-operating-system-FreeBSD-10.0 10.0 .ds doc-operating-system-FreeBSD-10.1 10.1 +.ds doc-operating-system-FreeBSD-11.0 11.0 .ds doc-operating-system-NetBSD-7.0 7.0 . .\" Definitions not (yet) in doc-syms From owner-svn-src-stable-10@FreeBSD.ORG Wed May 21 06:29:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 40F0D20C; Wed, 21 May 2014 06:29: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 2D3312F8A; Wed, 21 May 2014 06:29: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 s4L6Trcm031710; Wed, 21 May 2014 06:29:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4L6TqhV031708; Wed, 21 May 2014 06:29:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405210629.s4L6TqhV031708@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 21 May 2014 06:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266485 - in stable/10/sys: dev/sound/usb modules/sound/driver/uaudio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 06:29:53 -0000 Author: hselasky Date: Wed May 21 06:29:52 2014 New Revision: 266485 URL: http://svnweb.freebsd.org/changeset/base/266485 Log: MFC r266006 and r266011: Fix unload of USB audio kernel module. Modified: stable/10/sys/dev/sound/usb/uaudio.c stable/10/sys/modules/sound/driver/uaudio/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/10/sys/dev/sound/usb/uaudio.c Wed May 21 06:23:52 2014 (r266484) +++ stable/10/sys/dev/sound/usb/uaudio.c Wed May 21 06:29:52 2014 (r266485) @@ -5917,7 +5917,7 @@ uaudio_hid_detach(struct uaudio_softc *s usbd_transfer_unsetup(sc->sc_hid.xfer, UAUDIO_HID_N_TRANSFER); } -DRIVER_MODULE(uaudio, uhub, uaudio_driver, uaudio_devclass, NULL, 0); +DRIVER_MODULE_ORDERED(uaudio, uhub, uaudio_driver, uaudio_devclass, NULL, 0, SI_ORDER_ANY); MODULE_DEPEND(uaudio, usb, 1, 1, 1); MODULE_DEPEND(uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(uaudio, 1); Modified: stable/10/sys/modules/sound/driver/uaudio/Makefile ============================================================================== --- stable/10/sys/modules/sound/driver/uaudio/Makefile Wed May 21 06:23:52 2014 (r266484) +++ stable/10/sys/modules/sound/driver/uaudio/Makefile Wed May 21 06:29:52 2014 (r266485) @@ -7,6 +7,6 @@ S= ${.CURDIR}/../../../.. KMOD= snd_uaudio SRCS= bus_if.h device_if.h usb_if.h vnode_if.h SRCS+= opt_usb.h opt_bus.h feeder_if.h channel_if.h usbdevs.h -SRCS+= uaudio.c uaudio_pcm.c +SRCS+= uaudio_pcm.c uaudio.c .include From owner-svn-src-stable-10@FreeBSD.ORG Wed May 21 07:21:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F17BDD35; Wed, 21 May 2014 07:21: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 DE6992555; Wed, 21 May 2014 07:21: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 s4L7Laqm056260; Wed, 21 May 2014 07:21:36 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4L7LaKd056259; Wed, 21 May 2014 07:21:36 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405210721.s4L7LaKd056259@svn.freebsd.org> From: Thomas Quinot Date: Wed, 21 May 2014 07:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266488 - stable/10/bin/dd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 07:21:37 -0000 Author: thomas Date: Wed May 21 07:21:36 2014 New Revision: 266488 URL: http://svnweb.freebsd.org/changeset/base/266488 Log: MFC rev. 265593: (dd_out): Fix handling of all-zeroes block at end of input with conv=sparse. PR: bin/189174 PR: bin/189284 Reviewed by: kib Modified: stable/10/bin/dd/dd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/dd.c ============================================================================== --- stable/10/bin/dd/dd.c Wed May 21 06:33:21 2014 (r266487) +++ stable/10/bin/dd/dd.c Wed May 21 07:21:36 2014 (r266488) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -76,6 +77,7 @@ STAT st; /* statistics */ void (*cfunc)(void); /* conversion function */ uintmax_t cpy_cnt; /* # of blocks to copy */ static off_t pending = 0; /* pending seek if sparse */ +static off_t last_sp = 0; /* size of last added sparse block */ u_int ddflags = 0; /* conversion options */ size_t cbsz; /* conversion block size */ uintmax_t files_cnt = 1; /* # of files to copy */ @@ -173,6 +175,8 @@ setup(void) } else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL || (out.db = malloc(out.dbsz + cbsz)) == NULL) err(1, "output buffer"); + + /* dbp is the first free position in each buffer. */ in.dbp = in.db; out.dbp = out.db; @@ -434,8 +438,15 @@ dd_out(int force) * we play games with the buffer size, and it's usually a partial write. */ outp = out.db; + + /* + * If force, first try to write all pending data, else try to write + * just one block. Subsequently always write data one full block at + * a time at most. + */ for (n = force ? out.dbcnt : out.dbsz;; n = out.dbsz) { - for (cnt = n;; cnt -= nw) { + cnt = n; + do { sparse = 0; if (ddflags & C_SPARSE) { sparse = 1; /* Is buffer sparse? */ @@ -447,18 +458,24 @@ dd_out(int force) } if (sparse && !force) { pending += cnt; + last_sp = cnt; nw = cnt; } else { if (pending != 0) { - if (force) - pending--; + /* If forced to write, and we have no + * data left, we need to write the last + * sparse block explicitly. + */ + if (force && cnt == 0) { + pending -= last_sp; + assert(outp == out.db); + memset(outp, 0, cnt); + } if (lseek(out.fd, pending, SEEK_CUR) == -1) err(2, "%s: seek error creating sparse file", out.name); - if (force) - write(out.fd, outp, 1); - pending = 0; + pending = last_sp = 0; } if (cnt) nw = write(out.fd, outp, cnt); @@ -473,27 +490,29 @@ dd_out(int force) err(1, "%s", out.name); nw = 0; } + outp += nw; st.bytes += nw; - if ((size_t)nw == n) { - if (n != out.dbsz) - ++st.out_part; - else - ++st.out_full; - break; - } - ++st.out_part; - if ((size_t)nw == cnt) - break; - if (out.flags & ISTAPE) - errx(1, "%s: short write on tape device", - out.name); - if (out.flags & ISCHR && !warned) { - warned = 1; - warnx("%s: short write on character device", - out.name); + + if ((size_t)nw == n && n == out.dbsz) + ++st.out_full; + else + ++st.out_part; + + if ((size_t) nw != cnt) { + if (out.flags & ISTAPE) + errx(1, "%s: short write on tape device", + out.name); + if (out.flags & ISCHR && !warned) { + warned = 1; + warnx("%s: short write on character device", + out.name); + } } - } + + cnt -= nw; + } while (cnt != 0); + if ((out.dbcnt -= n) < out.dbsz) break; } From owner-svn-src-stable-10@FreeBSD.ORG Wed May 21 09:19:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4BD1C262; Wed, 21 May 2014 09:19: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 38582227E; Wed, 21 May 2014 09:19: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 s4L9J6SZ006445; Wed, 21 May 2014 09:19:06 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4L9J5lB006443; Wed, 21 May 2014 09:19:05 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201405210919.s4L9J5lB006443@svn.freebsd.org> From: Peter Holm Date: Wed, 21 May 2014 09:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266492 - in stable/10: lib/libc/sys sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 09:19:06 -0000 Author: pho Date: Wed May 21 09:19:05 2014 New Revision: 266492 URL: http://svnweb.freebsd.org/changeset/base/266492 Log: MFC r265534: msync(2) must return ENOMEM and not EINVAL when the address is outside the allowed range or when one or more pages are not mapped. This according to The Open Group Base Specifications Issue 7. Sponsored by: EMC / Isilon storage division Modified: stable/10/lib/libc/sys/msync.2 stable/10/sys/vm/vm_mmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/msync.2 ============================================================================== --- stable/10/lib/libc/sys/msync.2 Wed May 21 08:19:04 2014 (r266491) +++ stable/10/lib/libc/sys/msync.2 Wed May 21 09:19:05 2014 (r266492) @@ -87,11 +87,13 @@ The .Fa addr argument is not a multiple of the hardware page size. -.It Bq Er EINVAL -The +.It Bq Er ENOMEM +The addresses in the range starting at +.Fa addr +and continuing for .Fa len -argument -is too large or negative. +bytes are outside the range allowed for the address space of a +process or specify one or more pages that are not mapped. .It Bq Er EINVAL The .Fa flags @@ -99,7 +101,7 @@ argument was both MS_ASYNC and MS_INVALIDATE. Only one of these flags is allowed. .It Bq Er EIO - An error occurred while writing at least one of the pages in +An error occurred while writing at least one of the pages in the specified region. .El .Sh SEE ALSO Modified: stable/10/sys/vm/vm_mmap.c ============================================================================== --- stable/10/sys/vm/vm_mmap.c Wed May 21 08:19:04 2014 (r266491) +++ stable/10/sys/vm/vm_mmap.c Wed May 21 09:19:05 2014 (r266492) @@ -556,7 +556,7 @@ sys_msync(td, uap) case KERN_SUCCESS: return (0); case KERN_INVALID_ADDRESS: - return (EINVAL); /* Sun returns ENOMEM? */ + return (ENOMEM); case KERN_INVALID_ARGUMENT: return (EBUSY); case KERN_FAILURE: From owner-svn-src-stable-10@FreeBSD.ORG Wed May 21 18:58:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 38F2C1E3; Wed, 21 May 2014 18:58: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 2597624B1; Wed, 21 May 2014 18:58: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 s4LIwWSY055879; Wed, 21 May 2014 18:58:32 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LIwVIM055878; Wed, 21 May 2014 18:58:32 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405211858.s4LIwVIM055878@svn.freebsd.org> From: Glen Barber Date: Wed, 21 May 2014 18:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266516 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 18:58:32 -0000 Author: gjb Date: Wed May 21 18:58:31 2014 New Revision: 266516 URL: http://svnweb.freebsd.org/changeset/base/266516 Log: Fix a typo. Submitted by: Hilko Meyer Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 21 18:02:19 2014 (r266515) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 21 18:58:31 2014 (r266516) @@ -122,7 +122,7 @@ &man.sysctl.8; has been re-enabled. On multi-CPU machines with enough RAM, this can easily double &man.zfs.8; performance or reduce CPU usage in half. It was originally disabled due to - memory and KVA exhastion problem reports, + memory and KVA exhaustion problem reports, which should be resolved due to several change in the VM subsystem. From owner-svn-src-stable-10@FreeBSD.ORG Thu May 22 00:39:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 64433FA0; Thu, 22 May 2014 00:39: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 4F7F521BE; Thu, 22 May 2014 00:39: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 s4M0doCT004746; Thu, 22 May 2014 00:39:50 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M0do3k004745; Thu, 22 May 2014 00:39:50 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201405220039.s4M0do3k004745@svn.freebsd.org> From: Don Lewis Date: Thu, 22 May 2014 00:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266521 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 00:39:50 -0000 Author: truckman Date: Thu May 22 00:39:49 2014 New Revision: 266521 URL: http://svnweb.freebsd.org/changeset/base/266521 Log: MFC r266426 Slightly restructure the final loop in rman_reserve_resource_bound(). Replace with the existing loop termination test with a similar condition from the nested "if" that may terminate the loop a bit sooner, but still not too early. This condition can then be removed from the nested "if". Relocate an operator to be style(9) compliant. Modified: stable/10/sys/kern/subr_rman.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_rman.c ============================================================================== --- stable/10/sys/kern/subr_rman.c Thu May 22 00:01:31 2014 (r266520) +++ stable/10/sys/kern/subr_rman.c Thu May 22 00:39:49 2014 (r266521) @@ -602,13 +602,10 @@ rman_reserve_resource_bound(struct rman if ((flags & (RF_SHAREABLE | RF_TIMESHARE)) == 0) goto out; - for (s = r; s; s = TAILQ_NEXT(s, r_link)) { - if (s->r_start > end) - break; - if ((s->r_flags & flags) != flags) - continue; - if (s->r_start >= start && s->r_end <= end - && (s->r_end - s->r_start + 1) == count && + for (s = r; s && s->r_end <= end; s = TAILQ_NEXT(s, r_link)) { + if ((s->r_flags & flags) == flags && + s->r_start >= start && + (s->r_end - s->r_start + 1) == count && (s->r_start & amask) == 0 && ((s->r_start ^ s->r_end) & bmask) == 0) { rv = int_alloc_resource(M_NOWAIT); From owner-svn-src-stable-10@FreeBSD.ORG Thu May 22 05:20:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E2901BDF; Thu, 22 May 2014 05:20: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 CFDBA26AE; Thu, 22 May 2014 05:20: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 s4M5KLhW029374; Thu, 22 May 2014 05:20:21 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M5KLR1029372; Thu, 22 May 2014 05:20:21 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201405220520.s4M5KLR1029372@svn.freebsd.org> From: Justin Hibbits Date: Thu, 22 May 2014 05:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266532 - stable/10/sys/powerpc/aim X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 05:20:22 -0000 Author: jhibbits Date: Thu May 22 05:20:21 2014 New Revision: 266532 URL: http://svnweb.freebsd.org/changeset/base/266532 Log: MFC r266116,r266136 A page mask size is 12-bits, not 11. Modified: stable/10/sys/powerpc/aim/trap_subr32.S stable/10/sys/powerpc/aim/trap_subr64.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/aim/trap_subr32.S ============================================================================== --- stable/10/sys/powerpc/aim/trap_subr32.S Thu May 22 05:04:40 2014 (r266531) +++ stable/10/sys/powerpc/aim/trap_subr32.S Thu May 22 05:20:21 2014 (r266532) @@ -677,7 +677,7 @@ disitrap: mtcr %r31 bt 17,realtrap /* branch is user mode */ mfsprg1 %r31 /* get old SP */ - clrrwi %r31,%r31,11 /* Round SP down to nearest page */ + clrrwi %r31,%r31,12 /* Round SP down to nearest page */ sub. %r30,%r31,%r30 /* SP - DAR */ bge 1f neg %r30,%r30 /* modulo value */ Modified: stable/10/sys/powerpc/aim/trap_subr64.S ============================================================================== --- stable/10/sys/powerpc/aim/trap_subr64.S Thu May 22 05:04:40 2014 (r266531) +++ stable/10/sys/powerpc/aim/trap_subr64.S Thu May 22 05:20:21 2014 (r266532) @@ -585,7 +585,7 @@ disitrap: mtcr %r31 bt 17,realtrap /* branch is user mode */ mfsprg1 %r31 /* get old SP */ - clrrdi %r31,%r31,11 /* Round SP down to nearest page */ + clrrdi %r31,%r31,12 /* Round SP down to nearest page */ sub. %r30,%r31,%r30 /* SP - DAR */ bge 1f neg %r30,%r30 /* modulo value */ From owner-svn-src-stable-10@FreeBSD.ORG Thu May 22 16:34:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B40B9E15; Thu, 22 May 2014 16:34: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 A013223D2; Thu, 22 May 2014 16:34: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 s4MGY1XU041498; Thu, 22 May 2014 16:34:01 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MGY0Wl041491; Thu, 22 May 2014 16:34:00 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405221634.s4MGY0Wl041491@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 22 May 2014 16:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266548 - in stable/10/sys/dev: mpr mps X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 16:34:01 -0000 Author: ken Date: Thu May 22 16:34:00 2014 New Revision: 266548 URL: http://svnweb.freebsd.org/changeset/base/266548 Log: MFC mpr(4) changes: r265484, r265485, r265709 and r265712 ------------------------------------------------------------------------ r265484 | ken | 2014-05-06 23:11:16 -0600 (Tue, 06 May 2014) | 5 lines Remove some debugging code. Submitted by: Steve McConnell ------------------------------------------------------------------------ ------------------------------------------------------------------------ r265485 | ken | 2014-05-06 23:14:48 -0600 (Tue, 06 May 2014) | 9 lines Hold the SIM lock when calling xpt_create_path() and xpt_action() in mprsas_SSU_to_SATA_devices(). This fixes an assertion on shutdown with INVARIANTS enabled with SATA drives present on an IR firmware controller. Reviewed by: Steve McConnell . ------------------------------------------------------------------------ ------------------------------------------------------------------------ r265709 | ken | 2014-05-08 14:28:22 -0600 (Thu, 08 May 2014) | 15 lines Fix TLR (Transport Layer Retry) support in the mps(4) and mpr(4) drivers. TLR is necessary for reliable communication with SAS tape drives. This was broken by change 246713 in the mps(4) driver. It changed the cm_data field for SCSI I/O requests to point to the CCB instead of the data buffer. So, instead, look at the CCB's data pointer to determine whether or not we're talking to a tape drive. Also, take the residual into account to make sure that we don't go off the end of the request. Sponsored by: Spectra Logic Corporation ------------------------------------------------------------------------ ------------------------------------------------------------------------ r265712 | ken | 2014-05-08 14:46:46 -0600 (Thu, 08 May 2014) | 10 lines Add #ifdefs in the mpr(4) driver so that versions of stable/9 that have implemented the PIM_NOSCAN rescan functionality will have it enabled. This is a no-op for head. Reviewed by: slm Sponsored by: Spectra Logic Corporation ------------------------------------------------------------------------ Sponsored by: Spectra Logic, Avago Modified: stable/10/sys/dev/mpr/mpr.c stable/10/sys/dev/mpr/mpr_sas.c stable/10/sys/dev/mpr/mpr_sas_lsi.c stable/10/sys/dev/mps/mps_sas.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mpr/mpr.c ============================================================================== --- stable/10/sys/dev/mpr/mpr.c Thu May 22 16:30:32 2014 (r266547) +++ stable/10/sys/dev/mpr/mpr.c Thu May 22 16:34:00 2014 (r266548) @@ -2182,8 +2182,6 @@ mpr_add_chain(struct mpr_command *cm, in * code other than 0. */ if (cm->cm_flags & MPR_CM_FLAGS_SGE_SIMPLE) { -//SLM-test -printf("Trying to add a chain element to an MPI SGL\n"); mpr_dprint(sc, MPR_ERROR, "A chain element cannot be added to " "an MPI SGL.\n"); return(ENOBUFS); Modified: stable/10/sys/dev/mpr/mpr_sas.c ============================================================================== --- stable/10/sys/dev/mpr/mpr_sas.c Thu May 22 16:30:32 2014 (r266547) +++ stable/10/sys/dev/mpr/mpr_sas.c Thu May 22 16:34:00 2014 (r266548) @@ -183,7 +183,8 @@ mprsas_startup_increment(struct mprsas_s /* just starting, freeze the simq */ mpr_dprint(sassc->sc, MPR_INIT, "%s freezing simq\n", __func__); -#if __FreeBSD_version >= 1000039 +#if (__FreeBSD_version >= 1000039) || \ + ((__FreeBSD_version < 1000000) && (__FreeBSD_version >= 902502)) xpt_hold_boot(); #endif xpt_freeze_simq(sassc->sim, 1); @@ -217,7 +218,8 @@ mprsas_startup_decrement(struct mprsas_s "%s releasing simq\n", __func__); sassc->flags &= ~MPRSAS_IN_STARTUP; xpt_release_simq(sassc->sim, 1); -#if __FreeBSD_version >= 1000039 +#if (__FreeBSD_version >= 1000039) || \ + ((__FreeBSD_version < 1000000) && (__FreeBSD_version >= 902502)) xpt_release_boot(); #else mprsas_rescan_target(sassc->sc, NULL); @@ -974,7 +976,8 @@ mprsas_action(struct cam_sim *sim, union cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; cpi->target_sprt = 0; -#if __FreeBSD_version >= 1000039 +#if (__FreeBSD_version >= 1000039) || \ + ((__FreeBSD_version < 1000000) && (__FreeBSD_version >= 902502)) cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED | PIM_NOSCAN; #else cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; @@ -2355,8 +2358,9 @@ mprsas_scsiio_complete(struct mpr_softc (csio->cdb_io.cdb_bytes[1] & SI_EVPD) && (csio->cdb_io.cdb_bytes[2] == SVPD_SUPPORTED_PAGE_LIST) && ((csio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) && - (csio->data_ptr != NULL) && (((uint8_t *)cm->cm_data)[0] == - T_SEQUENTIAL) && (sc->control_TLR) && + (csio->data_ptr != NULL) && + ((csio->data_ptr[0] & 0x1f) == T_SEQUENTIAL) && + (sc->control_TLR) && (sc->mapping_table[csio->ccb_h.target_id].device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET)) { vpd_list = (struct scsi_vpd_supported_page_list *) @@ -2367,6 +2371,7 @@ mprsas_scsiio_complete(struct mpr_softc TLR_on = (u8)MPI2_SCSIIO_CONTROL_TLR_ON; alloc_len = ((u16)csio->cdb_io.cdb_bytes[3] << 8) + csio->cdb_io.cdb_bytes[4]; + alloc_len -= csio->resid; for (i = 0; i < MIN(vpd_list->length, alloc_len); i++) { if (vpd_list->list[i] == 0x90) { *TLR_bits = TLR_on; Modified: stable/10/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- stable/10/sys/dev/mpr/mpr_sas_lsi.c Thu May 22 16:30:32 2014 (r266547) +++ stable/10/sys/dev/mpr/mpr_sas_lsi.c Thu May 22 16:34:00 2014 (r266548) @@ -801,7 +801,8 @@ mprsas_add_device(struct mpr_softc *sc, "and connector name (%4s)\n", targ->encl_level, targ->connector_name); } -#if __FreeBSD_version < 1000039 +#if ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000039)) || \ + (__FreeBSD_version < 902502) if ((sassc->flags & MPRSAS_IN_STARTUP) == 0) #endif mprsas_rescan_target(sc, targ); @@ -992,7 +993,8 @@ mprsas_volume_add(struct mpr_softc *sc, free(lun, M_MPR); } SLIST_INIT(&targ->luns); -#if __FreeBSD_version < 1000039 +#if ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000039)) || \ + (__FreeBSD_version < 902502) if ((sassc->flags & MPRSAS_IN_STARTUP) == 0) #endif mprsas_rescan_target(sc, targ); @@ -1026,6 +1028,8 @@ mprsas_SSU_to_SATA_devices(struct mpr_so char path_str[64]; struct timeval cur_time, start_time; + mpr_lock(sc); + /* * For each LUN of each target, issue a StartStopUnit command to stop * the device. @@ -1041,6 +1045,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_so SLIST_FOREACH(lun, &target->luns, lun_link) { ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { + mpr_unlock(sc); mpr_dprint(sc, MPR_FAULT, "Unable to alloc " "CCB to stop unit.\n"); return; @@ -1057,6 +1062,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_so mpr_dprint(sc, MPR_FAULT, "Unable to " "create LUN path to stop unit.\n"); xpt_free_ccb(ccb); + mpr_unlock(sc); return; } xpt_path_string(ccb->ccb_h.path, path_str, @@ -1092,6 +1098,8 @@ mprsas_SSU_to_SATA_devices(struct mpr_so } } + mpr_unlock(sc); + /* * Wait until all of the SSU commands have completed or time has * expired (60 seconds). pause for 100ms each time through. If any Modified: stable/10/sys/dev/mps/mps_sas.c ============================================================================== --- stable/10/sys/dev/mps/mps_sas.c Thu May 22 16:30:32 2014 (r266547) +++ stable/10/sys/dev/mps/mps_sas.c Thu May 22 16:34:00 2014 (r266548) @@ -2316,8 +2316,9 @@ mpssas_scsiio_complete(struct mps_softc (csio->cdb_io.cdb_bytes[1] & SI_EVPD) && (csio->cdb_io.cdb_bytes[2] == SVPD_SUPPORTED_PAGE_LIST) && ((csio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) && - (csio->data_ptr != NULL) && (((uint8_t *)cm->cm_data)[0] == - T_SEQUENTIAL) && (sc->control_TLR) && + (csio->data_ptr != NULL) && + ((csio->data_ptr[0] & 0x1f) == T_SEQUENTIAL) && + (sc->control_TLR) && (sc->mapping_table[csio->ccb_h.target_id].device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET)) { vpd_list = (struct scsi_vpd_supported_page_list *) @@ -2328,6 +2329,7 @@ mpssas_scsiio_complete(struct mps_softc TLR_on = (u8)MPI2_SCSIIO_CONTROL_TLR_ON; alloc_len = ((u16)csio->cdb_io.cdb_bytes[3] << 8) + csio->cdb_io.cdb_bytes[4]; + alloc_len -= csio->resid; for (i = 0; i < MIN(vpd_list->length, alloc_len); i++) { if (vpd_list->list[i] == 0x90) { *TLR_bits = TLR_on; From owner-svn-src-stable-10@FreeBSD.ORG Thu May 22 20:55:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F1B0D169; Thu, 22 May 2014 20:55: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 DE3C12A99; Thu, 22 May 2014 20:55: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 s4MKtvdB079616; Thu, 22 May 2014 20:55:57 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MKtvrh079615; Thu, 22 May 2014 20:55:57 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201405222055.s4MKtvrh079615@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 22 May 2014 20:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266557 - stable/10/contrib/tzcode/stdtime X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 20:55:58 -0000 Author: gavin Date: Thu May 22 20:55:57 2014 New Revision: 266557 URL: http://svnweb.freebsd.org/changeset/base/266557 Log: Merge r266111 from head: Fix typo. Note that although this file is under contrib, it has diverged sufficiently from upstream (including a full whitespace commit and large portions rewritten) that this change does not move us further from the upstream. PR: docs/186608 Submitted by: Jamie Landeg-Jones Modified: stable/10/contrib/tzcode/stdtime/ctime.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzcode/stdtime/ctime.3 ============================================================================== --- stable/10/contrib/tzcode/stdtime/ctime.3 Thu May 22 20:24:30 2014 (r266556) +++ stable/10/contrib/tzcode/stdtime/ctime.3 Thu May 22 20:55:57 2014 (r266557) @@ -342,7 +342,7 @@ Except for and the .Fn \&_r variants of the other functions, -these functions leaves their result in an internal static object and return +these functions leave their result in an internal static object and return a pointer to that object. Subsequent calls to these function will modify the same object. From owner-svn-src-stable-10@FreeBSD.ORG Thu May 22 21:08:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 817BB74A; Thu, 22 May 2014 21:08:33 +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 6DFCB2BBA; Thu, 22 May 2014 21:08:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ML8XHY086490; Thu, 22 May 2014 21:08:33 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ML8XM7086489; Thu, 22 May 2014 21:08:33 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201405222108.s4ML8XM7086489@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 22 May 2014 21:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266559 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 21:08:33 -0000 Author: gavin Date: Thu May 22 21:08:32 2014 New Revision: 266559 URL: http://svnweb.freebsd.org/changeset/base/266559 Log: Merge r266261 from head: USB endpoints are almost always single-digits, fix the path in the man page to be clearer. PR: docs/175560 Submitted by: Andreas Gustafsson Modified: stable/10/share/man/man4/ugen.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ugen.4 ============================================================================== --- stable/10/share/man/man4/ugen.4 Thu May 22 20:59:38 2014 (r266558) +++ stable/10/share/man/man4/ugen.4 Thu May 22 21:08:32 2014 (r266559) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 22, 2012 +.Dd May 16, 2014 .Dt UGEN 4 .Os .Sh NAME @@ -292,10 +292,10 @@ and should be set to .Dv USB_CURRENT_ALT_INDEX . .Sh FILES -.Bl -tag -width ".Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar EE" -compact -.It Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar EE +.Bl -tag -width ".Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E" -compact +.It Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E Endpoint -.Ar EE +.Ar E of device .Ar N . .El From owner-svn-src-stable-10@FreeBSD.ORG Thu May 22 22:10:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 81DB3FD6; Thu, 22 May 2014 22:10: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 6E81520B7; Thu, 22 May 2014 22:10: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 s4MMAHll021683; Thu, 22 May 2014 22:10:17 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MMAHcB021682; Thu, 22 May 2014 22:10:17 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201405222210.s4MMAHcB021682@svn.freebsd.org> From: Devin Teske Date: Thu, 22 May 2014 22:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266562 - stable/10/usr.sbin/bsdconfig/share/media X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 22:10:17 -0000 Author: dteske Date: Thu May 22 22:10:16 2014 New Revision: 266562 URL: http://svnweb.freebsd.org/changeset/base/266562 Log: MFC r266297: Update example portion of comment to coincide with r264840 Modified: stable/10/usr.sbin/bsdconfig/share/media/common.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/share/media/common.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/media/common.subr Thu May 22 22:06:51 2014 (r266561) +++ stable/10/usr.sbin/bsdconfig/share/media/common.subr Thu May 22 22:10:16 2014 (r266562) @@ -44,7 +44,8 @@ MOUNTPOINT=/dist # # Media probe values to use for `f_media_get_TYPE media $file $PROBE' or -# `f_device_get media $file $PROBE' (where $PROBE is one of the below values). +# `f_device_get device_media $file $PROBE' (where $PROBE is one of the below +# values). # PROBE_EXIST=1 PROBE_SIZE=2 From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 06:20:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 273CEDDE; Fri, 23 May 2014 06:20: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 12F342663; Fri, 23 May 2014 06:20: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 s4N6KQUY047216; Fri, 23 May 2014 06:20:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N6KQa3047214; Fri, 23 May 2014 06:20:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405230620.s4N6KQa3047214@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 23 May 2014 06:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266575 - in stable/10/sys/dev/usb: . controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 06:20:26 -0000 Author: hselasky Date: Fri May 23 06:20:25 2014 New Revision: 266575 URL: http://svnweb.freebsd.org/changeset/base/266575 Log: MFC r265358, r265427, r265777, r265783, r265806, r265872, r266012 and r266394: - Multiple DWC OTG host mode related fixes, improvements and optimisations. - Add full support for ISOCHRONOUS transfers to the DWC OTG driver. - Use the interrupt filter to handle basic USB FIFO interrupts. - Fixed unbalanced unlock in case of "dwc_otg_init_fifo()" failure. - Add common spinlock to the USB bus structure. Modified: stable/10/sys/dev/usb/controller/dwc_otg.c stable/10/sys/dev/usb/controller/dwc_otg.h stable/10/sys/dev/usb/controller/dwc_otg_atmelarm.c stable/10/sys/dev/usb/controller/dwc_otg_fdt.c stable/10/sys/dev/usb/controller/dwc_otgreg.h stable/10/sys/dev/usb/controller/usb_controller.c stable/10/sys/dev/usb/usb_bus.h stable/10/sys/dev/usb/usb_core.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- stable/10/sys/dev/usb/controller/dwc_otg.c Fri May 23 05:35:43 2014 (r266574) +++ stable/10/sys/dev/usb/controller/dwc_otg.c Fri May 23 06:20:25 2014 (r266575) @@ -89,19 +89,22 @@ ((struct dwc_otg_softc *)(((uint8_t *)(bus)) - \ ((uint8_t *)&(((struct dwc_otg_softc *)0)->sc_bus)))) -#define DWC_OTG_PC2SC(pc) \ - DWC_OTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) +#define DWC_OTG_PC2UDEV(pc) \ + (USB_DMATAG_TO_XROOT((pc)->tag_parent)->udev) #define DWC_OTG_MSK_GINT_ENABLED \ - (GINTSTS_ENUMDONE | \ - GINTSTS_USBRST | \ - GINTSTS_USBSUSP | \ - GINTSTS_IEPINT | \ - GINTSTS_RXFLVL | \ - GINTSTS_SESSREQINT | \ + (GINTMSK_ENUMDONEMSK | \ + GINTMSK_USBRSTMSK | \ + GINTMSK_USBSUSPMSK | \ + GINTMSK_IEPINTMSK | \ + GINTMSK_SESSREQINTMSK | \ GINTMSK_OTGINTMSK | \ - GINTMSK_HCHINTMSK | \ - GINTSTS_PRTINT) + GINTMSK_PRTINTMSK) + +#define DWC_OTG_MSK_GINT_THREAD_IRQ \ + (GINTSTS_USBRST | GINTSTS_ENUMDONE | GINTSTS_PRTINT | \ + GINTSTS_WKUPINT | GINTSTS_USBSUSP | GINTMSK_OTGINTMSK | \ + GINTSTS_SESSREQINT) static int dwc_otg_use_hsic; @@ -138,8 +141,9 @@ static dwc_otg_cmd_t dwc_otg_host_data_r static void dwc_otg_device_done(struct usb_xfer *, usb_error_t); static void dwc_otg_do_poll(struct usb_bus *); static void dwc_otg_standard_done(struct usb_xfer *); -static void dwc_otg_root_intr(struct dwc_otg_softc *sc); -static void dwc_otg_interrupt_poll(struct dwc_otg_softc *sc); +static void dwc_otg_root_intr(struct dwc_otg_softc *); +static void dwc_otg_interrupt_poll(struct dwc_otg_softc *); +static void dwc_otg_host_channel_disable(struct dwc_otg_softc *, uint8_t); /* * Here is a configuration that the chip supports. @@ -179,59 +183,81 @@ dwc_otg_init_fifo(struct dwc_otg_softc * fifo_size = sc->sc_fifo_size; - fifo_regs = 4 * (sc->sc_dev_ep_max + sc->sc_dev_in_ep_max); + /* + * NOTE: Reserved fixed size area at end of RAM, which must + * not be allocated to the FIFOs: + */ + fifo_regs = 4 * 16; - if (fifo_size >= fifo_regs) - fifo_size -= fifo_regs; - else - fifo_size = 0; + if (fifo_size < fifo_regs) { + DPRINTF("Too little FIFO\n"); + return (EINVAL); + } + + /* subtract FIFO regs from total once */ + fifo_size -= fifo_regs; /* split equally for IN and OUT */ fifo_size /= 2; - DWC_OTG_WRITE_4(sc, DOTG_GRXFSIZ, fifo_size / 4); - - /* align to 4-bytes */ + /* align to 4 bytes boundary */ fifo_size &= ~3; + /* set global receive FIFO size */ + DWC_OTG_WRITE_4(sc, DOTG_GRXFSIZ, fifo_size / 4); + tx_start = fifo_size; - if (fifo_size < 0x40) { + if (fifo_size < 64) { DPRINTFN(-1, "Not enough data space for EP0 FIFO.\n"); - USB_BUS_UNLOCK(&sc->sc_bus); return (EINVAL); } + /* disable any leftover host channels */ + for (x = 0; x != sc->sc_host_ch_max; x++) { + if (sc->sc_chan_state[x].wait_sof == 0) + continue; + dwc_otg_host_channel_disable(sc, x); + } + if (mode == DWC_MODE_HOST) { /* reset active endpoints */ sc->sc_active_rx_ep = 0; + /* split equally for periodic and non-periodic */ fifo_size /= 2; + /* align to 4 bytes boundary */ + fifo_size &= ~3; + DWC_OTG_WRITE_4(sc, DOTG_GNPTXFSIZ, ((fifo_size / 4) << 16) | (tx_start / 4)); tx_start += fifo_size; + for (x = 0; x != sc->sc_host_ch_max; x++) { + /* disable all host interrupts */ + DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), 0); + } + DWC_OTG_WRITE_4(sc, DOTG_HPTXFSIZ, ((fifo_size / 4) << 16) | (tx_start / 4)); - for (x = 0; x != sc->sc_host_ch_max; x++) { - /* enable interrupts */ - DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), - HCINT_STALL | HCINT_BBLERR | - HCINT_XACTERR | - HCINT_NAK | HCINT_ACK | HCINT_NYET | - HCINT_CHHLTD | HCINT_FRMOVRUN | - HCINT_DATATGLERR); - } + /* reset host channel state */ + memset(sc->sc_chan_state, 0, sizeof(sc->sc_chan_state)); + + /* reset FIFO TX levels */ + sc->sc_tx_cur_p_level = 0; + sc->sc_tx_cur_np_level = 0; + + /* store maximum periodic and non-periodic FIFO TX size */ + sc->sc_tx_max_size = fifo_size; - /* enable host channel interrupts */ - DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, - (1U << sc->sc_host_ch_max) - 1U); + /* disable all host channel interrupts */ + DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, 0); } if (mode == DWC_MODE_DEVICE) { @@ -309,11 +335,58 @@ dwc_otg_init_fifo(struct dwc_otg_softc * } else { /* reset active endpoints */ sc->sc_active_rx_ep = 0; + + /* reset periodic and non-periodic FIFO TX size */ + sc->sc_tx_max_size = fifo_size; + + /* reset host channel state */ + memset(sc->sc_chan_state, 0, sizeof(sc->sc_chan_state)); + + /* reset FIFO TX levels */ + sc->sc_tx_cur_p_level = 0; + sc->sc_tx_cur_np_level = 0; } return (0); } static void +dwc_otg_update_host_frame_interval(struct dwc_otg_softc *sc) +{ + + /* + * Disabled until further. Assuming that the register is already + * programmed correctly by the boot loader. + */ +#if 0 + uint32_t temp; + + /* setup HOST frame interval register, based on existing value */ + temp = DWC_OTG_READ_4(sc, DOTG_HFIR) & HFIR_FRINT_MASK; + if (temp >= 10000) + temp /= 1000; + else + temp /= 125; + + /* figure out nearest X-tal value */ + if (temp >= 54) + temp = 60; /* MHz */ + else if (temp >= 39) + temp = 48; /* MHz */ + else + temp = 30; /* MHz */ + + if (sc->sc_flags.status_high_speed) + temp *= 125; + else + temp *= 1000; + + DPRINTF("HFIR=0x%08x\n", temp); + + DWC_OTG_WRITE_4(sc, DOTG_HFIR, temp); +#endif +} + +static void dwc_otg_clocks_on(struct dwc_otg_softc *sc) { if (sc->sc_flags.clocks_off && @@ -376,9 +449,11 @@ dwc_otg_pull_down(struct dwc_otg_softc * static void dwc_otg_enable_sof_irq(struct dwc_otg_softc *sc) { - if (sc->sc_irq_mask & GINTSTS_SOF) + /* In device mode we don't use the SOF interrupt */ + if (sc->sc_flags.status_device_mode != 0 || + (sc->sc_irq_mask & GINTMSK_SOFMSK) != 0) return; - sc->sc_irq_mask |= GINTSTS_SOF; + sc->sc_irq_mask |= GINTMSK_SOFMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); } @@ -395,8 +470,8 @@ dwc_otg_resume_irq(struct dwc_otg_softc * Disable resume interrupt and enable suspend * interrupt: */ - sc->sc_irq_mask &= ~GINTSTS_WKUPINT; - sc->sc_irq_mask |= GINTSTS_USBSUSP; + sc->sc_irq_mask &= ~GINTMSK_WKUPINTMSK; + sc->sc_irq_mask |= GINTMSK_USBSUSPMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); } @@ -418,8 +493,8 @@ dwc_otg_suspend_irq(struct dwc_otg_softc * Disable suspend interrupt and enable resume * interrupt: */ - sc->sc_irq_mask &= ~GINTSTS_USBSUSP; - sc->sc_irq_mask |= GINTSTS_WKUPINT; + sc->sc_irq_mask &= ~GINTMSK_USBSUSPMSK; + sc->sc_irq_mask |= GINTMSK_WKUPINTMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); } @@ -493,9 +568,11 @@ dwc_otg_common_rx_ack(struct dwc_otg_sof { DPRINTFN(5, "RX status clear\n"); - /* enable RX FIFO level interrupt */ - sc->sc_irq_mask |= GINTSTS_RXFLVL; - DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); + if (sc->sc_flags.status_device_mode != 0) { + /* enable RX FIFO level interrupt */ + sc->sc_irq_mask |= GINTMSK_RXFLVLMSK; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); + } /* clear cached status */ sc->sc_last_rx_status = 0; @@ -506,6 +583,7 @@ dwc_otg_clear_hcint(struct dwc_otg_softc { uint32_t hcint; + /* clear all pending interrupts */ hcint = DWC_OTG_READ_4(sc, DOTG_HCINT(x)); DWC_OTG_WRITE_4(sc, DOTG_HCINT(x), hcint); @@ -514,96 +592,61 @@ dwc_otg_clear_hcint(struct dwc_otg_softc } static uint8_t -dwc_otg_host_channel_wait(struct dwc_otg_td *td) -{ - struct dwc_otg_softc *sc; - uint8_t x; - - x = td->channel; - - DPRINTF("CH=%d\n", x); - - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - - if (sc->sc_chan_state[x].wait_sof == 0) { - dwc_otg_clear_hcint(sc, x); - return (1); /* done */ - } - - if (x == 0) - return (0); /* wait */ - - /* find new disabled channel */ - for (x = 1; x != sc->sc_host_ch_max; x++) { - - if (sc->sc_chan_state[x].allocated) - continue; - if (sc->sc_chan_state[x].wait_sof != 0) - continue; - - sc->sc_chan_state[td->channel].allocated = 0; - sc->sc_chan_state[x].allocated = 1; - - if (sc->sc_chan_state[td->channel].suspended) { - sc->sc_chan_state[td->channel].suspended = 0; - sc->sc_chan_state[x].suspended = 1; - } - - /* clear interrupts */ - dwc_otg_clear_hcint(sc, x); - - DPRINTF("CH=%d HCCHAR=0x%08x " - "HCSPLT=0x%08x\n", x, td->hcchar, td->hcsplt); - - /* ack any pending messages */ - if (sc->sc_last_rx_status != 0 && - GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) == td->channel) { - /* get rid of message */ - dwc_otg_common_rx_ack(sc); - } - - /* move active channel */ - sc->sc_active_rx_ep &= ~(1 << td->channel); - sc->sc_active_rx_ep |= (1 << x); - - /* set channel */ - td->channel = x; - - return (1); /* new channel allocated */ - } - return (0); /* wait */ -} - -static uint8_t -dwc_otg_host_channel_alloc(struct dwc_otg_td *td) +dwc_otg_host_channel_alloc(struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t which, uint8_t is_out) { - struct dwc_otg_softc *sc; + uint32_t tx_p_size; + uint32_t tx_np_size; uint8_t x; - uint8_t max_channel; - if (td->channel < DWC_OTG_MAX_CHANNELS) + if (td->channel[which] < DWC_OTG_MAX_CHANNELS) return (0); /* already allocated */ - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - - if ((td->hcchar & HCCHAR_EPNUM_MASK) == 0) { - max_channel = 1; - x = 0; + /* check if device is suspended */ + if (DWC_OTG_PC2UDEV(td->pc)->flags.self_suspended != 0) + return (1); /* busy - cannot transfer data */ + + /* compute needed TX FIFO size */ + if (is_out != 0) { + if (td->ep_type == UE_INTERRUPT || + td->ep_type == UE_ISOCHRONOUS) { + tx_p_size = td->max_packet_size; + tx_np_size = 0; + if (td->hcsplt != 0 && tx_p_size > HCSPLT_XACTLEN_BURST) + tx_p_size = HCSPLT_XACTLEN_BURST; + if ((sc->sc_tx_cur_p_level + tx_p_size) > sc->sc_tx_max_size) { + DPRINTF("Too little FIFO space\n"); + return (1); /* too little FIFO */ + } + } else { + tx_p_size = 0; + tx_np_size = td->max_packet_size; + if (td->hcsplt != 0 && tx_np_size > HCSPLT_XACTLEN_BURST) + tx_np_size = HCSPLT_XACTLEN_BURST; + if ((sc->sc_tx_cur_np_level + tx_np_size) > sc->sc_tx_max_size) { + DPRINTF("Too little FIFO space\n"); + return (1); /* too little FIFO */ + } + } } else { - max_channel = sc->sc_host_ch_max; - x = 1; + /* not a TX transaction */ + tx_p_size = 0; + tx_np_size = 0; } - for (; x != max_channel; x++) { - - if (sc->sc_chan_state[x].allocated) + for (x = 0; x != sc->sc_host_ch_max; x++) { + if (sc->sc_chan_state[x].allocated != 0) continue; + /* check if channel is still enabled */ if (sc->sc_chan_state[x].wait_sof != 0) continue; sc->sc_chan_state[x].allocated = 1; + sc->sc_chan_state[x].tx_p_size = tx_p_size; + sc->sc_chan_state[x].tx_np_size = tx_np_size; + + /* keep track of used TX FIFO, if any */ + sc->sc_tx_cur_p_level += tx_p_size; + sc->sc_tx_cur_np_level += tx_np_size; /* clear interrupts */ dwc_otg_clear_hcint(sc, x); @@ -615,53 +658,44 @@ dwc_otg_host_channel_alloc(struct dwc_ot sc->sc_active_rx_ep |= (1 << x); /* set channel */ - td->channel = x; + td->channel[which] = x; return (0); /* allocated */ } + /* wait a bit */ + dwc_otg_enable_sof_irq(sc); return (1); /* busy */ } static void -dwc_otg_host_channel_disable(struct dwc_otg_softc *sc, uint8_t x) -{ - uint32_t hcchar; - if (sc->sc_chan_state[x].wait_sof != 0) - return; - hcchar = DWC_OTG_READ_4(sc, DOTG_HCCHAR(x)); - if (hcchar & (HCCHAR_CHENA | HCCHAR_CHDIS)) { - /* disable channel */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(x), - HCCHAR_CHENA | HCCHAR_CHDIS); - /* don't re-use channel until next SOF is transmitted */ - sc->sc_chan_state[x].wait_sof = 2; - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); - } -} - -static void -dwc_otg_host_channel_free(struct dwc_otg_td *td) +dwc_otg_host_channel_free(struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t which) { - struct dwc_otg_softc *sc; uint8_t x; - if (td->channel >= DWC_OTG_MAX_CHANNELS) + if (td->channel[which] >= DWC_OTG_MAX_CHANNELS) return; /* already freed */ /* free channel */ - x = td->channel; - td->channel = DWC_OTG_MAX_CHANNELS; + x = td->channel[which]; + td->channel[which] = DWC_OTG_MAX_CHANNELS; DPRINTF("CH=%d\n", x); - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - - dwc_otg_host_channel_disable(sc, x); + /* + * We need to let programmed host channels run till complete + * else the host channel will stop functioning. Assume that + * after a fixed given amount of time the host channel is no + * longer doing any USB traffic: + */ + if (td->ep_type == UE_ISOCHRONOUS || td->ep_type == UE_INTERRUPT) { + /* double buffered */ + sc->sc_chan_state[x].wait_sof = DWC_OTG_SLOT_IDLE_MAX; + } else { + /* single buffered */ + sc->sc_chan_state[x].wait_sof = DWC_OTG_SLOT_IDLE_MIN; + } sc->sc_chan_state[x].allocated = 0; - sc->sc_chan_state[x].suspended = 0; /* ack any pending messages */ if (sc->sc_last_rx_status != 0 && @@ -674,136 +708,131 @@ dwc_otg_host_channel_free(struct dwc_otg } static uint8_t -dwc_otg_host_setup_tx(struct dwc_otg_td *td) +dwc_otg_host_setup_tx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { struct usb_device_request req __aligned(4); - struct dwc_otg_softc *sc; uint32_t hcint; uint32_t hcchar; + uint8_t delta; - if (dwc_otg_host_channel_alloc(td)) - return (1); /* busy */ - - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); + if (td->channel[0] < DWC_OTG_MAX_CHANNELS) { + hcint = sc->sc_chan_state[td->channel[0]].hcint; - hcint = sc->sc_chan_state[td->channel].hcint; - - DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", - td->channel, td->state, hcint, - DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel)), - DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel))); + DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", + td->channel[0], td->state, hcint, + DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel[0])), + DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel[0]))); + } else { + hcint = 0; + goto check_state; + } if (hcint & (HCINT_RETRY | HCINT_ACK | HCINT_NYET)) { /* give success bits priority over failure bits */ } else if (hcint & HCINT_STALL) { - DPRINTF("CH=%d STALL\n", td->channel); + DPRINTF("CH=%d STALL\n", td->channel[0]); td->error_stall = 1; td->error_any = 1; - return (0); /* complete */ + goto complete; } else if (hcint & HCINT_ERRORS) { - DPRINTF("CH=%d ERROR\n", td->channel); + DPRINTF("CH=%d ERROR\n", td->channel[0]); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { td->error_any = 1; - return (0); /* complete */ + goto complete; } } - /* channel must be disabled before we can complete the transfer */ - if (hcint & (HCINT_ERRORS | HCINT_RETRY | HCINT_ACK | HCINT_NYET)) { - - dwc_otg_host_channel_disable(sc, td->channel); - if (!(hcint & HCINT_ERRORS)) td->errcnt = 0; } +check_state: switch (td->state) { case DWC_CHAN_ST_START: goto send_pkt; case DWC_CHAN_ST_WAIT_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - if (!dwc_otg_host_channel_wait(td)) - break; - td->did_nak = 1; + td->did_nak++; + td->tt_scheduled = 0; goto send_pkt; - } - if (hcint & (HCINT_ACK | HCINT_NYET)) { - if (!dwc_otg_host_channel_wait(td)) - break; + } else if (hcint & (HCINT_ACK | HCINT_NYET)) { td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle = 1; - return (0); /* complete */ + td->tt_scheduled = 0; + goto complete; } break; + case DWC_CHAN_ST_WAIT_S_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - if (!dwc_otg_host_channel_wait(td)) - break; - td->did_nak = 1; + td->did_nak++; + td->tt_scheduled = 0; goto send_pkt; - } - if (hcint & (HCINT_ACK | HCINT_NYET)) { - if (!dwc_otg_host_channel_wait(td)) - break; + } else if (hcint & (HCINT_ACK | HCINT_NYET)) { goto send_cpkt; } break; + case DWC_CHAN_ST_WAIT_C_ANE: if (hcint & HCINT_NYET) { - if (!dwc_otg_host_channel_wait(td)) - break; goto send_cpkt; - } - if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - if (!dwc_otg_host_channel_wait(td)) - break; - td->did_nak = 1; + } else if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { + td->did_nak++; + td->tt_scheduled = 0; goto send_pkt; - } - if (hcint & HCINT_ACK) { - if (!dwc_otg_host_channel_wait(td)) - break; + } else if (hcint & HCINT_ACK) { td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle = 1; - return (0); /* complete */ + goto complete; } break; - case DWC_CHAN_ST_TX_PKT_SYNC: - goto send_pkt_sync; + + case DWC_CHAN_ST_WAIT_C_PKT: + goto send_cpkt; + default: break; } - return (1); /* busy */ + goto busy; send_pkt: + /* free existing channel, if any */ + dwc_otg_host_channel_free(sc, td, 0); + if (sizeof(req) != td->remainder) { td->error_any = 1; - return (0); /* complete */ + goto complete; } -send_pkt_sync: if (td->hcsplt != 0) { - uint32_t count; - - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; - /* check for not first microframe */ - if (count != 0) { - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); - /* set state */ - td->state = DWC_CHAN_ST_TX_PKT_SYNC; - dwc_otg_host_channel_free(td); - return (1); /* busy */ + delta = td->tt_start_slot - sc->sc_last_frame_num - 1; + if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { + td->state = DWC_CHAN_ST_START; + goto busy; + } + delta = sc->sc_last_frame_num - td->tt_start_slot; + if (delta > 5) { + /* missed it */ + td->tt_scheduled = 0; + td->state = DWC_CHAN_ST_START; + goto busy; } + } + /* allocate a new channel */ + if (dwc_otg_host_channel_alloc(sc, td, 0, 1)) { + td->state = DWC_CHAN_ST_START; + goto busy; + } + + if (td->hcsplt != 0) { td->hcsplt &= ~HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_S_ANE; } else { @@ -812,57 +841,83 @@ send_pkt_sync: usbd_copy_out(td->pc, 0, &req, sizeof(req)); - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel[0]), (sizeof(req) << HCTSIZ_XFERSIZE_SHIFT) | (1 << HCTSIZ_PKTCNT_SHIFT) | (HCTSIZ_PID_SETUP << HCTSIZ_PID_SHIFT)); - DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); + DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel[0]), td->hcsplt); hcchar = td->hcchar; - hcchar &= ~HCCHAR_EPDIR_IN; + hcchar &= ~(HCCHAR_EPDIR_IN | HCCHAR_EPTYPE_MASK); + hcchar |= UE_CONTROL << HCCHAR_EPTYPE_SHIFT; /* must enable channel before writing data to FIFO */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel[0]), hcchar); /* transfer data into FIFO */ bus_space_write_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DOTG_DFIFO(td->channel), (uint32_t *)&req, sizeof(req) / 4); + DOTG_DFIFO(td->channel[0]), (uint32_t *)&req, sizeof(req) / 4); /* store number of bytes transmitted */ td->tx_bytes = sizeof(req); - - return (1); /* busy */ + goto busy; send_cpkt: + /* free existing channel, if any */ + dwc_otg_host_channel_free(sc, td, 0); + + delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; + if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { + td->state = DWC_CHAN_ST_WAIT_C_PKT; + goto busy; + } + delta = sc->sc_last_frame_num - td->tt_start_slot; + if (delta > DWC_OTG_TT_SLOT_MAX) { + /* we missed the service interval */ + if (td->ep_type != UE_ISOCHRONOUS) + td->error_any = 1; + goto complete; + } + /* allocate a new channel */ + if (dwc_otg_host_channel_alloc(sc, td, 0, 0)) { + td->state = DWC_CHAN_ST_WAIT_C_PKT; + goto busy; + } + + /* wait until next slot before trying again */ + td->tt_complete_slot++; + td->hcsplt |= HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_C_ANE; - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel[0]), (HCTSIZ_PID_SETUP << HCTSIZ_PID_SHIFT)); - DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); + DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel[0]), td->hcsplt); hcchar = td->hcchar; - hcchar &= ~HCCHAR_EPDIR_IN; + hcchar &= ~(HCCHAR_EPDIR_IN | HCCHAR_EPTYPE_MASK); + hcchar |= UE_CONTROL << HCCHAR_EPTYPE_SHIFT; /* must enable channel before writing data to FIFO */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel[0]), hcchar); +busy: return (1); /* busy */ + +complete: + dwc_otg_host_channel_free(sc, td, 0); + return (0); /* complete */ } static uint8_t -dwc_otg_setup_rx(struct dwc_otg_td *td) +dwc_otg_setup_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - struct dwc_otg_softc *sc; struct usb_device_request req __aligned(4); uint32_t temp; uint16_t count; - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - /* check endpoint status */ if (sc->sc_last_rx_status == 0) @@ -984,39 +1039,42 @@ not_complete: } static uint8_t -dwc_otg_host_rate_check(struct dwc_otg_td *td) +dwc_otg_host_rate_check_interrupt(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - struct dwc_otg_softc *sc; - uint8_t ep_type; + uint8_t delta; - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); + delta = sc->sc_tmr_val - td->tmr_val; + if (delta >= 128) + return (1); /* busy */ - ep_type = ((td->hcchar & - HCCHAR_EPTYPE_MASK) >> HCCHAR_EPTYPE_SHIFT); + td->tmr_val = sc->sc_tmr_val + td->tmr_res; - if (sc->sc_chan_state[td->channel].suspended) - goto busy; + /* set toggle, if any */ + if (td->set_toggle) { + td->set_toggle = 0; + td->toggle = 1; + } + return (0); +} - if (ep_type == UE_ISOCHRONOUS) { - if (td->tmr_val & 1) - td->hcchar |= HCCHAR_ODDFRM; - else - td->hcchar &= ~HCCHAR_ODDFRM; - td->tmr_val += td->tmr_res; - } else if (ep_type == UE_INTERRUPT) { - uint8_t delta; +static uint8_t +dwc_otg_host_rate_check(struct dwc_otg_softc *sc, struct dwc_otg_td *td) +{ + if (td->ep_type == UE_ISOCHRONOUS) { + /* non TT isochronous traffic */ + if ((td->tmr_val != 0) || + (sc->sc_last_frame_num & (td->tmr_res - 1))) { + goto busy; + } + td->tmr_val = 1; /* executed */ + td->toggle = 0; - delta = sc->sc_tmr_val - td->tmr_val; - if (delta >= 128) + } else if (td->ep_type == UE_INTERRUPT) { + if (!td->tt_scheduled) goto busy; - td->tmr_val = sc->sc_tmr_val + td->tmr_res; - } else if (td->did_nak != 0) { + td->tt_scheduled = 0; + } else if (td->did_nak >= DWC_OTG_NAK_MAX) { goto busy; - } - - if (ep_type == UE_ISOCHRONOUS) { - td->toggle = 0; } else if (td->set_toggle) { td->set_toggle = 0; td->toggle = 1; @@ -1027,29 +1085,27 @@ busy: } static uint8_t -dwc_otg_host_data_rx(struct dwc_otg_td *td) +dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - struct dwc_otg_softc *sc; uint32_t hcint; uint32_t hcchar; uint32_t count; - uint8_t ep_type; - - if (dwc_otg_host_channel_alloc(td)) - return (1); /* busy */ - - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); + uint8_t delta; + uint8_t channel; - ep_type = ((td->hcchar & - HCCHAR_EPTYPE_MASK) >> HCCHAR_EPTYPE_SHIFT); + channel = td->channel[td->tt_channel_tog]; - hcint = sc->sc_chan_state[td->channel].hcint; + if (channel < DWC_OTG_MAX_CHANNELS) { + hcint = sc->sc_chan_state[channel].hcint; - DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", - td->channel, td->state, hcint, - DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel)), - DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel))); + DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", + channel, td->state, hcint, + DWC_OTG_READ_4(sc, DOTG_HCCHAR(channel)), + DWC_OTG_READ_4(sc, DOTG_HCTSIZ(channel))); + } else { + hcint = 0; + goto check_state; + } /* check interrupt bits */ @@ -1057,35 +1113,26 @@ dwc_otg_host_data_rx(struct dwc_otg_td * HCINT_ACK | HCINT_NYET)) { /* give success bits priority over failure bits */ } else if (hcint & HCINT_STALL) { - DPRINTF("CH=%d STALL\n", td->channel); + DPRINTF("CH=%d STALL\n", channel); td->error_stall = 1; td->error_any = 1; - return (0); /* complete */ + goto complete; } else if (hcint & HCINT_ERRORS) { - DPRINTF("CH=%d ERROR\n", td->channel); + DPRINTF("CH=%d ERROR\n", channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { - td->error_any = 1; - return (0); /* complete */ + if (td->ep_type != UE_ISOCHRONOUS) { + td->error_any = 1; + goto complete; + } } } - /* channel must be disabled before we can complete the transfer */ - - if (hcint & (HCINT_ERRORS | HCINT_RETRY | - HCINT_ACK | HCINT_NYET)) { - - dwc_otg_host_channel_disable(sc, td->channel); - - if (!(hcint & HCINT_ERRORS)) - td->errcnt = 0; - } - /* check endpoint status */ if (sc->sc_last_rx_status == 0) goto check_state; - if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != td->channel) + if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != channel) goto check_state; switch (sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) { @@ -1103,25 +1150,42 @@ dwc_otg_host_data_rx(struct dwc_otg_td * break; } - td->toggle ^= 1; - /* get the packet byte count */ count = GRXSTSRD_BCNT_GET(sc->sc_last_rx_status); - /* verify the packet byte count */ - if (count != td->max_packet_size) { - if (count < td->max_packet_size) { - /* we have a short packet */ - td->short_pkt = 1; - td->got_short = 1; + /* check for isochronous transfer or high-speed bandwidth endpoint */ + if (td->ep_type == UE_ISOCHRONOUS || td->max_packet_count > 1) { + if ((sc->sc_last_rx_status & GRXSTSRD_DPID_MASK) != GRXSTSRD_DPID_DATA0) { + td->tt_xactpos = HCSPLT_XACTPOS_MIDDLE; } else { - /* invalid USB packet */ - td->error_any = 1; + td->tt_xactpos = HCSPLT_XACTPOS_BEGIN; + + /* verify the packet byte count */ + if (count < td->max_packet_size) { + /* we have a short packet */ + td->short_pkt = 1; + td->got_short = 1; + } + } + td->toggle = 0; + } else { + /* verify the packet byte count */ + if (count != td->max_packet_size) { + if (count < td->max_packet_size) { + /* we have a short packet */ + td->short_pkt = 1; + td->got_short = 1; + } else { + /* invalid USB packet */ + td->error_any = 1; - /* release FIFO */ - dwc_otg_common_rx_ack(sc); - return (0); /* we are complete */ + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + goto complete; + } } + td->toggle ^= 1; + td->tt_scheduled = 0; } /* verify the packet byte count */ @@ -1131,7 +1195,7 @@ dwc_otg_host_data_rx(struct dwc_otg_td * /* release FIFO */ dwc_otg_common_rx_ack(sc); - return (0); /* we are complete */ + goto complete; } usbd_copy_in(td->pc, td->offset, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 06:28:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A188E22F; Fri, 23 May 2014 06:28: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 8DFCE271D; Fri, 23 May 2014 06:28:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N6SV7O050967; Fri, 23 May 2014 06:28:31 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N6SVUq050966; Fri, 23 May 2014 06:28:31 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405230628.s4N6SVUq050966@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 23 May 2014 06:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266576 - stable/10/sys/modules/sound/sound X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 06:28:31 -0000 Author: hselasky Date: Fri May 23 06:28:31 2014 New Revision: 266576 URL: http://svnweb.freebsd.org/changeset/base/266576 Log: MFC r265359 and r265780: Remove ISA load dependency for the kernel sound driver module for ARM and MIPS. Modified: stable/10/sys/modules/sound/sound/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/sound/sound/Makefile ============================================================================== --- stable/10/sys/modules/sound/sound/Makefile Fri May 23 06:20:25 2014 (r266575) +++ stable/10/sys/modules/sound/sound/Makefile Fri May 23 06:28:31 2014 (r266576) @@ -44,7 +44,8 @@ CLEANFILES+= feeder_eq_gen.h feeder_rate EXPORT_SYMS= YES # XXX evaluate -.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" +.if ${MACHINE_CPUARCH} != "i386" && ${MACHINE_CPUARCH} != "amd64" && \ + ${MACHINE_CPUARCH} != "ia64" && ${MACHINE_CPUARCH} != "pc98" # Create an empty opt_isa.h in order to keep kmod.mk from linking in an # existing one from KERNBUILDDIR which possibly has DEV_ISA defined so # sound.ko is always built without isadma support. From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 06:35:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 66B9D507; Fri, 23 May 2014 06:35: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 5240627D6; Fri, 23 May 2014 06:35: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 s4N6Zk6p055008; Fri, 23 May 2014 06:35:46 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N6ZjEO055006; Fri, 23 May 2014 06:35:45 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405230635.s4N6ZjEO055006@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 23 May 2014 06:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266577 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 06:35:46 -0000 Author: hselasky Date: Fri May 23 06:35:45 2014 New Revision: 266577 URL: http://svnweb.freebsd.org/changeset/base/266577 Log: MFC r266466, r266471, r266484, r266505, r266535 and r266542: Fix multiple issues in the RSU driver. Modified: stable/10/sys/dev/usb/wlan/if_rsu.c stable/10/sys/dev/usb/wlan/if_rsureg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsu.c Fri May 23 06:28:31 2014 (r266576) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Fri May 23 06:35:45 2014 (r266577) @@ -127,7 +127,10 @@ static const STRUCT_USB_HOST_ID rsu_devs static device_probe_t rsu_match; static device_attach_t rsu_attach; static device_detach_t rsu_detach; -static usb_callback_t rsu_bulk_tx_callback; +static usb_callback_t rsu_bulk_tx_callback_0; +static usb_callback_t rsu_bulk_tx_callback_1; +static usb_callback_t rsu_bulk_tx_callback_2; +static usb_callback_t rsu_bulk_tx_callback_3; static usb_callback_t rsu_bulk_rx_callback; static usb_error_t rsu_do_request(struct rsu_softc *, struct usb_device_request *, void *); @@ -186,7 +189,6 @@ static int rsu_raw_xmit(struct ieee80211 const struct ieee80211_bpf_params *); static void rsu_init(void *); static void rsu_init_locked(struct rsu_softc *); -static void rsu_watchdog(void *); static int rsu_tx_start(struct rsu_softc *, struct ieee80211_node *, struct mbuf *, struct rsu_data *); static void rsu_start(struct ifnet *); @@ -194,6 +196,7 @@ static void rsu_start_locked(struct ifne static int rsu_ioctl(struct ifnet *, u_long, caddr_t); static void rsu_stop(struct ifnet *, int); static void rsu_stop_locked(struct ifnet *, int); +static void rsu_ms_delay(struct rsu_softc *); static device_method_t rsu_methods[] = { DEVMETHOD(device_probe, rsu_match), @@ -239,7 +242,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback, + .callback = rsu_bulk_tx_callback_0, .timeout = RSU_TX_TIMEOUT }, [RSU_BULK_TX_BK] = { @@ -252,7 +255,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback, + .callback = rsu_bulk_tx_callback_1, .timeout = RSU_TX_TIMEOUT }, [RSU_BULK_TX_VI] = { @@ -265,7 +268,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback, + .callback = rsu_bulk_tx_callback_2, .timeout = RSU_TX_TIMEOUT }, [RSU_BULK_TX_VO] = { @@ -278,7 +281,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback, + .callback = rsu_bulk_tx_callback_3, .timeout = RSU_TX_TIMEOUT }, }; @@ -314,7 +317,20 @@ rsu_attach(device_t self) MTX_DEF); TIMEOUT_TASK_INIT(taskqueue_thread, &sc->calib_task, 0, rsu_calib_task, sc); - callout_init(&sc->sc_watchdog_ch, 0); + + /* Allocate Tx/Rx buffers. */ + error = rsu_alloc_rx_list(sc); + if (error != 0) { + device_printf(sc->sc_dev, "could not allocate Rx buffers\n"); + goto fail_usb; + } + + error = rsu_alloc_tx_list(sc); + if (error != 0) { + device_printf(sc->sc_dev, "could not allocate Tx buffers\n"); + rsu_free_rx_list(sc); + goto fail_usb; + } iface_index = 0; error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, @@ -422,13 +438,10 @@ rsu_detach(device_t self) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - if (!device_is_attached(self)) - return (0); rsu_stop(ifp, 1); usbd_transfer_unsetup(sc->sc_xfer, RSU_N_TRANSFER); ieee80211_ifdetach(ic); - callout_drain(&sc->sc_watchdog_ch); taskqueue_drain_timeout(taskqueue_thread, &sc->calib_task); /* Free Tx/Rx buffers. */ @@ -453,7 +466,7 @@ rsu_do_request(struct rsu_softc *sc, str while (ntries--) { err = usbd_do_request_flags(sc->sc_udev, &sc->sc_mtx, req, data, 0, NULL, 250 /* ms */); - if (err == 0 || !device_is_attached(sc->sc_dev)) + if (err == 0 || err == USB_ERR_NOT_CONFIGURED) break; DPRINTFN(1, "Control request failed, %s (retrying)\n", usbd_errstr(err)); @@ -598,9 +611,12 @@ rsu_alloc_tx_list(struct rsu_softc *sc) if (error != 0) return (error); - STAILQ_INIT(&sc->sc_tx_active); STAILQ_INIT(&sc->sc_tx_inactive); - STAILQ_INIT(&sc->sc_tx_pending); + + for (i = 0; i != RSU_MAX_TX_EP; i++) { + STAILQ_INIT(&sc->sc_tx_active[i]); + STAILQ_INIT(&sc->sc_tx_pending[i]); + } for (i = 0; i < RSU_TX_LIST_COUNT; i++) { STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, &sc->sc_tx[i], next); @@ -612,12 +628,26 @@ rsu_alloc_tx_list(struct rsu_softc *sc) static void rsu_free_tx_list(struct rsu_softc *sc) { + int i; + + /* prevent further allocations from TX list(s) */ + STAILQ_INIT(&sc->sc_tx_inactive); + + for (i = 0; i != RSU_MAX_TX_EP; i++) { + STAILQ_INIT(&sc->sc_tx_active[i]); + STAILQ_INIT(&sc->sc_tx_pending[i]); + } + rsu_free_list(sc, sc->sc_tx, RSU_TX_LIST_COUNT); } static void rsu_free_rx_list(struct rsu_softc *sc) { + /* prevent further allocations from RX list(s) */ + STAILQ_INIT(&sc->sc_rx_inactive); + STAILQ_INIT(&sc->sc_rx_active); + rsu_free_list(sc, sc->sc_rx, RSU_RX_LIST_COUNT); } @@ -757,11 +787,11 @@ rsu_fw_iocmd(struct rsu_softc *sc, uint3 int ntries; rsu_write_4(sc, R92S_IOCMD_CTRL, iocmd); - DELAY(100); + rsu_ms_delay(sc); for (ntries = 0; ntries < 50; ntries++) { if (rsu_read_4(sc, R92S_IOCMD_CTRL) == 0) return (0); - DELAY(10); + rsu_ms_delay(sc); } return (ETIMEDOUT); } @@ -781,7 +811,7 @@ rsu_efuse_read_1(struct rsu_softc *sc, u reg = rsu_read_4(sc, R92S_EFUSE_CTRL); if (reg & R92S_EFUSE_CTRL_VALID) return (MS(reg, R92S_EFUSE_CTRL_DATA)); - DELAY(5); + rsu_ms_delay(sc); } device_printf(sc->sc_dev, "could not read efuse byte at address 0x%x\n", addr); @@ -805,7 +835,7 @@ rsu_read_rom(struct rsu_softc *sc) /* Turn on 2.5V to prevent eFuse leakage. */ reg = rsu_read_1(sc, R92S_EFUSE_TEST + 3); rsu_write_1(sc, R92S_EFUSE_TEST + 3, reg | 0x80); - DELAY(1000); + rsu_ms_delay(sc); rsu_write_1(sc, R92S_EFUSE_TEST + 3, reg & ~0x80); /* Read full ROM image. */ @@ -843,10 +873,12 @@ rsu_read_rom(struct rsu_softc *sc) static int rsu_fw_cmd(struct rsu_softc *sc, uint8_t code, void *buf, int len) { + const uint8_t which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; struct rsu_data *data; struct r92s_tx_desc *txd; struct r92s_fw_cmd_hdr *cmd; - int cmdsz, xferlen; + int cmdsz; + int xferlen; data = rsu_getbuf(sc); if (data == NULL) @@ -879,8 +911,8 @@ rsu_fw_cmd(struct rsu_softc *sc, uint8_t DPRINTFN(2, "Tx cmd code=0x%x len=0x%x\n", code, cmdsz); data->buflen = xferlen; - STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); - usbd_transfer_start(sc->sc_xfer[RSU_BULK_TX_VO]); + STAILQ_INSERT_TAIL(&sc->sc_tx_pending[which], data, next); + usbd_transfer_start(sc->sc_xfer[which + RSU_BULK_TX_BE]); return (0); } @@ -1589,13 +1621,13 @@ rsu_txeof(struct usb_xfer *xfer, struct ieee80211_free_node(data->ni); data->ni = NULL; } - sc->sc_tx_timer = 0; ifp->if_opackets++; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } static void -rsu_bulk_tx_callback(struct usb_xfer *xfer, usb_error_t error) +rsu_bulk_tx_callback_sub(struct usb_xfer *xfer, usb_error_t error, + uint8_t which) { struct rsu_softc *sc = usbd_xfer_softc(xfer); struct ifnet *ifp = sc->sc_ifp; @@ -1605,37 +1637,36 @@ rsu_bulk_tx_callback(struct usb_xfer *xf switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - data = STAILQ_FIRST(&sc->sc_tx_active); + data = STAILQ_FIRST(&sc->sc_tx_active[which]); if (data == NULL) goto tr_setup; DPRINTF("transfer done %p\n", data); - STAILQ_REMOVE_HEAD(&sc->sc_tx_active, next); + STAILQ_REMOVE_HEAD(&sc->sc_tx_active[which], next); rsu_txeof(xfer, data); STAILQ_INSERT_TAIL(&sc->sc_tx_inactive, data, next); /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - data = STAILQ_FIRST(&sc->sc_tx_pending); + data = STAILQ_FIRST(&sc->sc_tx_pending[which]); if (data == NULL) { DPRINTF("empty pending queue sc %p\n", sc); return; } - STAILQ_REMOVE_HEAD(&sc->sc_tx_pending, next); - STAILQ_INSERT_TAIL(&sc->sc_tx_active, data, next); + STAILQ_REMOVE_HEAD(&sc->sc_tx_pending[which], next); + STAILQ_INSERT_TAIL(&sc->sc_tx_active[which], data, next); usbd_xfer_set_frame_data(xfer, 0, data->buf, data->buflen); DPRINTF("submitting transfer %p\n", data); usbd_transfer_submit(xfer); - rsu_start_locked(ifp); break; default: - data = STAILQ_FIRST(&sc->sc_tx_active); - if (data == NULL) - goto tr_setup; - if (data->ni != NULL) { - ieee80211_free_node(data->ni); - data->ni = NULL; - ifp->if_oerrors++; + data = STAILQ_FIRST(&sc->sc_tx_active[which]); + if (data != NULL) { + STAILQ_REMOVE_HEAD(&sc->sc_tx_active[which], next); + rsu_txeof(xfer, data); + STAILQ_INSERT_TAIL(&sc->sc_tx_inactive, data, next); } + ifp->if_oerrors++; + if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); goto tr_setup; @@ -1644,6 +1675,30 @@ tr_setup: } } +static void +rsu_bulk_tx_callback_0(struct usb_xfer *xfer, usb_error_t error) +{ + rsu_bulk_tx_callback_sub(xfer, error, 0); +} + +static void +rsu_bulk_tx_callback_1(struct usb_xfer *xfer, usb_error_t error) +{ + rsu_bulk_tx_callback_sub(xfer, error, 1); +} + +static void +rsu_bulk_tx_callback_2(struct usb_xfer *xfer, usb_error_t error) +{ + rsu_bulk_tx_callback_sub(xfer, error, 2); +} + +static void +rsu_bulk_tx_callback_3(struct usb_xfer *xfer, usb_error_t error) +{ + rsu_bulk_tx_callback_sub(xfer, error, 3); +} + static int rsu_tx_start(struct rsu_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, struct rsu_data *data) @@ -1654,15 +1709,11 @@ rsu_tx_start(struct rsu_softc *sc, struc struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; struct r92s_tx_desc *txd; - struct usb_xfer *xfer; - uint8_t type, tid = 0; - int hasqos, xferlen; - struct usb_xfer *rsu_pipes[4] = { - sc->sc_xfer[RSU_BULK_TX_BE], - sc->sc_xfer[RSU_BULK_TX_BK], - sc->sc_xfer[RSU_BULK_TX_VI], - sc->sc_xfer[RSU_BULK_TX_VO] - }; + uint8_t type; + uint8_t tid = 0; + uint8_t which; + int hasqos; + int xferlen; RSU_ASSERT_LOCKED(sc); @@ -1683,12 +1734,12 @@ rsu_tx_start(struct rsu_softc *sc, struc switch (type) { case IEEE80211_FC0_TYPE_CTL: case IEEE80211_FC0_TYPE_MGT: - xfer = sc->sc_xfer[RSU_BULK_TX_VO]; + which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; break; default: - KASSERT(M_WME_GETAC(m0) < 4, - ("unsupported WME pipe %d", M_WME_GETAC(m0))); - xfer = rsu_pipes[M_WME_GETAC(m0)]; + which = M_WME_GETAC(m0); + KASSERT(which < RSU_MAX_TX_EP, + ("unsupported WME pipe %d", which)); break; } hasqos = 0; @@ -1750,9 +1801,10 @@ rsu_tx_start(struct rsu_softc *sc, struc data->buflen = xferlen; data->ni = ni; data->m = m0; - STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); - usbd_transfer_start(xfer); + STAILQ_INSERT_TAIL(&sc->sc_tx_pending[which], data, next); + /* start transfer, if any */ + usbd_transfer_start(sc->sc_xfer[which + RSU_BULK_TX_BE]); return (0); } @@ -1774,8 +1826,8 @@ rsu_start_locked(struct ifnet *ifp) { struct rsu_softc *sc = ifp->if_softc; struct ieee80211_node *ni; - struct mbuf *m; struct rsu_data *bf; + struct mbuf *m; RSU_ASSERT_LOCKED(sc); @@ -1783,39 +1835,19 @@ rsu_start_locked(struct ifnet *ifp) IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; - bf = rsu_getbuf(sc); - if (bf == NULL) { - IFQ_DRV_PREPEND(&ifp->if_snd, m); - break; - } ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; m->m_pkthdr.rcvif = NULL; - if (rsu_tx_start(sc, ni, m, bf) != 0) { + bf = rsu_getbuf(sc); + if (bf == NULL) { + ifp->if_iqdrops++; + m_freem(m); + ieee80211_free_node(ni); + } else if (rsu_tx_start(sc, ni, m, bf) != 0) { ifp->if_oerrors++; STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); ieee80211_free_node(ni); - break; - } - sc->sc_tx_timer = 5; - callout_reset(&sc->sc_watchdog_ch, hz, rsu_watchdog, sc); - } -} - -static void -rsu_watchdog(void *arg) -{ - struct rsu_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; - - if (sc->sc_tx_timer > 0) { - if (--sc->sc_tx_timer == 0) { - device_printf(sc->sc_dev, "device timeout\n"); - /* rsu_init(ifp); XXX needs a process context! */ - ifp->if_oerrors++; - return; } - callout_reset(&sc->sc_watchdog_ch, hz, rsu_watchdog, sc); } } @@ -1947,7 +1979,7 @@ rsu_power_on_bcut(struct rsu_softc *sc) /* Prevent eFuse leakage. */ rsu_write_1(sc, 0x37, 0xb0); - usb_pause_mtx(&sc->sc_mtx, 10); + usb_pause_mtx(&sc->sc_mtx, hz / 100); rsu_write_1(sc, 0x37, 0x30); /* Switch the control path to hardware. */ @@ -1958,7 +1990,7 @@ rsu_power_on_bcut(struct rsu_softc *sc) } rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, rsu_read_1(sc, R92S_SYS_FUNC_EN + 1) & ~0x8c); - DELAY(1000); + rsu_ms_delay(sc); rsu_write_1(sc, R92S_SPS0_CTRL + 1, 0x53); rsu_write_1(sc, R92S_SPS0_CTRL + 0, 0x57); @@ -1991,11 +2023,11 @@ rsu_power_on_bcut(struct rsu_softc *sc) /* Enable AFE PLL macro block. */ reg = rsu_read_1(sc, R92S_AFE_PLL_CTRL); rsu_write_1(sc, R92S_AFE_PLL_CTRL, reg | 0x11); - DELAY(500); + rsu_ms_delay(sc); rsu_write_1(sc, R92S_AFE_PLL_CTRL, reg | 0x51); - DELAY(500); + rsu_ms_delay(sc); rsu_write_1(sc, R92S_AFE_PLL_CTRL, reg | 0x11); - DELAY(500); + rsu_ms_delay(sc); /* Attach AFE PLL to MACTOP/BB. */ rsu_write_1(sc, R92S_SYS_ISO_CTRL, @@ -2042,14 +2074,14 @@ rsu_power_on_bcut(struct rsu_softc *sc) if ((reg & (R92S_TCR_IMEM_CHK_RPT | R92S_TCR_EMEM_CHK_RPT)) == (R92S_TCR_IMEM_CHK_RPT | R92S_TCR_EMEM_CHK_RPT)) break; - DELAY(5); + rsu_ms_delay(sc); } if (ntries == 20) { DPRINTF("TxDMA is not ready\n"); /* Reset TxDMA. */ reg = rsu_read_1(sc, R92S_CR); rsu_write_1(sc, R92S_CR, reg & ~R92S_CR_TXDMA_EN); - DELAY(2); + rsu_ms_delay(sc); rsu_write_1(sc, R92S_CR, reg | R92S_CR_TXDMA_EN); } } @@ -2059,7 +2091,7 @@ rsu_power_off(struct rsu_softc *sc) { /* Turn RF off. */ rsu_write_1(sc, R92S_RF_CTRL, 0x00); - usb_pause_mtx(&sc->sc_mtx, 5); + usb_pause_mtx(&sc->sc_mtx, hz / 200); /* Turn MAC off. */ /* Switch control path. */ @@ -2087,6 +2119,7 @@ rsu_power_off(struct rsu_softc *sc) static int rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t *buf, int len) { + const uint8_t which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; struct rsu_data *data; struct r92s_tx_desc *txd; int mlen; @@ -2107,12 +2140,11 @@ rsu_fw_loadsection(struct rsu_softc *sc, memcpy(&txd[1], buf, mlen); data->buflen = sizeof(*txd) + mlen; DPRINTF("starting transfer %p\n", data); - STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); + STAILQ_INSERT_TAIL(&sc->sc_tx_pending[which], data, next); buf += mlen; len -= mlen; } - usbd_transfer_start(sc->sc_xfer[RSU_BULK_TX_VO]); - + usbd_transfer_start(sc->sc_xfer[RSU_BULK_TX_BE + which]); return (0); } @@ -2182,15 +2214,14 @@ rsu_load_firmware(struct rsu_softc *sc) goto fail; } /* Wait for load to complete. */ - for (ntries = 0; ntries < 10; ntries++) { - usb_pause_mtx(&sc->sc_mtx, 10); + for (ntries = 0; ntries != 50; ntries++) { + usb_pause_mtx(&sc->sc_mtx, hz / 100); reg = rsu_read_2(sc, R92S_TCR); if (reg & R92S_TCR_IMEM_CODE_DONE) break; } - if (ntries == 10 || !(reg & R92S_TCR_IMEM_CHK_RPT)) { - device_printf(sc->sc_dev, "timeout waiting for %s transfer\n", - "IMEM"); + if (ntries == 50) { + device_printf(sc->sc_dev, "timeout waiting for IMEM transfer\n"); error = ETIMEDOUT; goto fail; } @@ -2203,15 +2234,14 @@ rsu_load_firmware(struct rsu_softc *sc) goto fail; } /* Wait for load to complete. */ - for (ntries = 0; ntries < 10; ntries++) { - usb_pause_mtx(&sc->sc_mtx, 10); + for (ntries = 0; ntries != 50; ntries++) { + usb_pause_mtx(&sc->sc_mtx, hz / 100); reg = rsu_read_2(sc, R92S_TCR); if (reg & R92S_TCR_EMEM_CODE_DONE) break; } - if (ntries == 10 || !(reg & R92S_TCR_EMEM_CHK_RPT)) { - device_printf(sc->sc_dev, "timeout waiting for %s transfer\n", - "EMEM"); + if (ntries == 50) { + device_printf(sc->sc_dev, "timeout waiting for EMEM transfer\n"); error = ETIMEDOUT; goto fail; } @@ -2236,7 +2266,7 @@ rsu_load_firmware(struct rsu_softc *sc) for (ntries = 0; ntries < 100; ntries++) { if (rsu_read_2(sc, R92S_TCR) & R92S_TCR_IMEM_RDY) break; - DELAY(1000); + rsu_ms_delay(sc); } if (ntries == 100) { device_printf(sc->sc_dev, @@ -2249,7 +2279,7 @@ rsu_load_firmware(struct rsu_softc *sc) dmem = __DECONST(struct r92s_fw_priv *, &hdr->priv); memset(dmem, 0, sizeof(*dmem)); dmem->hci_sel = R92S_HCI_SEL_USB | R92S_HCI_SEL_8172; - dmem->nendpoints = sc->npipes; + dmem->nendpoints = 0; dmem->rf_config = 0x12; /* 1T2R */ dmem->vcs_type = R92S_VCS_TYPE_AUTO; dmem->vcs_mode = R92S_VCS_MODE_RTS_CTS; @@ -2268,7 +2298,7 @@ rsu_load_firmware(struct rsu_softc *sc) for (ntries = 0; ntries < 100; ntries++) { if (rsu_read_2(sc, R92S_TCR) & R92S_TCR_DMEM_CODE_DONE) break; - DELAY(1000); + rsu_ms_delay(sc); } if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for %s transfer\n", @@ -2280,7 +2310,7 @@ rsu_load_firmware(struct rsu_softc *sc) for (ntries = 0; ntries < 60; ntries++) { if (!(rsu_read_2(sc, R92S_TCR) & R92S_TCR_FWRDY)) break; - DELAY(1000); + rsu_ms_delay(sc); } if (ntries == 60) { device_printf(sc->sc_dev, @@ -2326,7 +2356,6 @@ rsu_raw_xmit(struct ieee80211_node *ni, return (EIO); } RSU_UNLOCK(sc); - sc->sc_tx_timer = 5; return (0); } @@ -2347,22 +2376,11 @@ rsu_init_locked(struct rsu_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct r92s_set_pwr_mode cmd; int error; + int i; /* Init host async commands ring. */ sc->cmdq.cur = sc->cmdq.next = sc->cmdq.queued = 0; - /* Allocate Tx/Rx buffers. */ - error = rsu_alloc_rx_list(sc); - if (error != 0) { - device_printf(sc->sc_dev, "could not allocate Rx buffers\n"); - return; - } - error = rsu_alloc_tx_list(sc); - if (error != 0) { - device_printf(sc->sc_dev, "could not allocate Tx buffers\n"); - rsu_free_rx_list(sc); - return; - } /* Power on adapter. */ if (sc->cut == 1) rsu_power_on_acut(sc); @@ -2401,8 +2419,8 @@ rsu_init_locked(struct rsu_softc *sc) rsu_write_region_1(sc, R92S_MACID, IF_LLADDR(ifp), IEEE80211_ADDR_LEN); - /* NB: it really takes that long for firmware to boot. */ - usb_pause_mtx(&sc->sc_mtx, 1500); + /* It really takes 1.5 seconds for the firmware to boot: */ + usb_pause_mtx(&sc->sc_mtx, (3 * hz) / 2); DPRINTF("setting MAC address to %s\n", ether_sprintf(IF_LLADDR(ifp))); error = rsu_fw_cmd(sc, R92S_CMD_SET_MAC_ADDRESS, IF_LLADDR(ifp), @@ -2447,14 +2465,11 @@ rsu_init_locked(struct rsu_softc *sc) /* We're ready to go. */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_RUNNING; - - callout_reset(&sc->sc_watchdog_ch, hz, rsu_watchdog, sc); - return; fail: - rsu_free_rx_list(sc); - rsu_free_tx_list(sc); - return; + /* Need to stop all failed transfers, if any */ + for (i = 0; i != RSU_N_TRANSFER; i++) + usbd_transfer_stop(sc->sc_xfer[i]); } static void @@ -2474,7 +2489,6 @@ rsu_stop_locked(struct ifnet *ifp, int d int i; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - callout_stop(&sc->sc_watchdog_ch); sc->sc_calibrating = 0; taskqueue_cancel_timeout(taskqueue_thread, &sc->calib_task, NULL); @@ -2485,3 +2499,8 @@ rsu_stop_locked(struct ifnet *ifp, int d usbd_transfer_stop(sc->sc_xfer[i]); } +static void +rsu_ms_delay(struct rsu_softc *sc) +{ + usb_pause_mtx(&sc->sc_mtx, hz / 1000); +} Modified: stable/10/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsureg.h Fri May 23 06:28:31 2014 (r266576) +++ stable/10/sys/dev/usb/wlan/if_rsureg.h Fri May 23 06:35:45 2014 (r266577) @@ -1,4 +1,3 @@ - /*- * Copyright (c) 2010 Damien Bergamini * @@ -18,9 +17,6 @@ * $FreeBSD$ */ -/* Maximum number of pipes is 11. */ -#define R92S_MAX_EP 11 - /* USB Requests. */ #define R92S_REQ_REGS 0x05 @@ -519,7 +515,7 @@ struct r92s_rx_stat { uint32_t rxdw4; uint32_t rxdw5; -} __packed __attribute__((aligned(4))); +} __packed __aligned(4); /* Rx PHY descriptor. */ struct r92s_rx_phystat { @@ -531,7 +527,7 @@ struct r92s_rx_phystat { uint32_t phydw5; uint32_t phydw6; uint32_t phydw7; -} __packed __attribute__((aligned(4))); +} __packed __aligned(4); /* Rx PHY CCK descriptor. */ struct r92s_rx_cck { @@ -595,18 +591,14 @@ struct r92s_tx_desc { uint16_t txbufsize; uint16_t reserved1; -} __packed __attribute__((aligned(4))); +} __packed __aligned(4); /* * Driver definitions. */ #define RSU_RX_LIST_COUNT 1 -#ifdef __OpenBSD__ -#define RSU_TX_LIST_COUNT (8 + 1) /* NB: +1 for FW commands. */ -#else #define RSU_TX_LIST_COUNT 32 -#endif #define RSU_HOST_CMD_RING_COUNT 32 @@ -735,6 +727,8 @@ struct rsu_vap { #define RSU_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) #define RSU_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) +#define RSU_MAX_TX_EP 4 + struct rsu_softc { struct ifnet *sc_ifp; device_t sc_dev; @@ -743,15 +737,11 @@ struct rsu_softc { enum ieee80211_state, int); struct usbd_interface *sc_iface; struct timeout_task calib_task; - struct callout sc_watchdog_ch; - struct usbd_pipe *pipe[R92S_MAX_EP]; - int npipes; const uint8_t *qid2idx; struct mtx sc_mtx; u_int cut; int scan_pass; - int sc_tx_timer; struct rsu_host_cmd_ring cmdq; struct rsu_data sc_rx[RSU_RX_LIST_COUNT]; struct rsu_data sc_tx[RSU_TX_LIST_COUNT]; @@ -764,9 +754,9 @@ struct rsu_softc { STAILQ_HEAD(, rsu_data) sc_rx_active; STAILQ_HEAD(, rsu_data) sc_rx_inactive; - STAILQ_HEAD(, rsu_data) sc_tx_active; + STAILQ_HEAD(, rsu_data) sc_tx_active[RSU_MAX_TX_EP]; STAILQ_HEAD(, rsu_data) sc_tx_inactive; - STAILQ_HEAD(, rsu_data) sc_tx_pending; + STAILQ_HEAD(, rsu_data) sc_tx_pending[RSU_MAX_TX_EP]; union { struct rsu_rx_radiotap_header th; From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 06:47:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0D4F27D0; Fri, 23 May 2014 06:47: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 EA8AB28B3; Fri, 23 May 2014 06:47: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 s4N6lmdN059600; Fri, 23 May 2014 06:47:48 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N6llK2059593; Fri, 23 May 2014 06:47:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405230647.s4N6llK2059593@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 23 May 2014 06:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266578 - in stable/10: share/man/man4 sys/conf sys/contrib/dev/urtwn sys/dev/usb sys/dev/usb/wlan sys/modules/usb/urtwnfw sys/modules/usb/urtwnfw/urtwnrtl8188eu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 06:47:49 -0000 Author: hselasky Date: Fri May 23 06:47:47 2014 New Revision: 266578 URL: http://svnweb.freebsd.org/changeset/base/266578 Log: MFC r257543, r264912, r264972, r264982 and r266472: - Add preliminary support for the Realtek RTL8188EUS and RTL8188ETV chipsets. - Add device ID for 'Sanoxy 802.11N' USB - Initialize rssi variable. - Fix gcc build, initialize off variable. - The DELAY() should not be used in USB drivers. - The usb_pause_mtx() function takes ticks and not milliseconds as last argument. Added: stable/10/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu - copied unchanged from r264912, head/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu stable/10/sys/modules/usb/urtwnfw/urtwnrtl8188eu/ - copied from r264912, head/sys/modules/usb/urtwnfw/urtwnrtl8188eu/ Modified: stable/10/share/man/man4/urtwn.4 stable/10/share/man/man4/urtwnfw.4 stable/10/sys/conf/files stable/10/sys/dev/usb/usbdevs stable/10/sys/dev/usb/wlan/if_urtwn.c stable/10/sys/dev/usb/wlan/if_urtwnreg.h stable/10/sys/modules/usb/urtwnfw/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/urtwn.4 ============================================================================== --- stable/10/share/man/man4/urtwn.4 Fri May 23 06:35:45 2014 (r266577) +++ stable/10/share/man/man4/urtwn.4 Fri May 23 06:47:47 2014 (r266578) @@ -19,7 +19,7 @@ .Os .Sh NAME .Nm urtwn -.Nd Realtek RTL8188CU/RTL8192CU USB IEEE 802.11b/g/n wireless network device +.Nd Realtek RTL8188CU/RTL8188EU/RTL8192CU USB IEEE 802.11b/g/n wireless network device .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,11 +50,11 @@ legal.realtek.license_ack=1 The .Nm driver supports USB 2.0 wireless network devices based on Realtek -RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU chipsets. +RTL8188CUS, RTL8188CE-VAU, RTL8188EUS, RTL8188RU and RTL8192CU chipsets. .Pp -The RTL8188CUS is a highly integrated 802.11n adapter that combines -a MAC, a 1T1R capable baseband and an RF in a single chip. -It operates in the 2GHz spectrum only. +The RTL8188CUS and RTL8188EUS are highly integrated 802.11n adapter that +combine a MAC, a 1T1R capable baseband and an RF in a single chip. +They operate in the 2GHz spectrum only. The RTL8188RU is a high-power variant of the RTL8188CUS. The RTL8188CE-VAU is a PCI Express Mini Card adapter that attaches to the USB interface. @@ -93,6 +93,8 @@ IEEE 802.11b/g/n wireless network adapte .It Netgear WNA1000M .It Realtek RTL8192CU .It Realtek RTL8188CUS +.It TP-LINK TL-WN723N v3 +.It TP-LINK TL-WN725N v2 .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): Modified: stable/10/share/man/man4/urtwnfw.4 ============================================================================== --- stable/10/share/man/man4/urtwnfw.4 Fri May 23 06:35:45 2014 (r266577) +++ stable/10/share/man/man4/urtwnfw.4 Fri May 23 06:47:47 2014 (r266578) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2013 +.Dd April 25, 2014 .Dt URTWNFW 4 .Os .Sh NAME @@ -42,6 +42,7 @@ of the following: .Bd -ragged -offset indent .Cd "device urtwn-rtl8192cfwT" .Cd "device urtwn-rtl8192cfwU" +.Cd "device urtwn-rtl8188eufw" .Ed .Pp Alternatively, to load the driver as a @@ -50,10 +51,11 @@ module at boot time, place the following .Bd -literal -offset indent urtwn-rtl8192cfwT_load="YES" urtwn-rtl8192cfwU_load="YES" +urtwn-rtl8188eufw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the -Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU +Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188EUS, RTL8188RU and RTL8192CU chip based USB WiFi adapters. It may be statically linked into the kernel, or loaded as a module. Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Fri May 23 06:35:45 2014 (r266577) +++ stable/10/sys/conf/files Fri May 23 06:47:47 2014 (r266578) @@ -2421,6 +2421,20 @@ dev/usb/wlan/if_upgt.c optional upgt dev/usb/wlan/if_ural.c optional ural dev/usb/wlan/if_urtw.c optional urtw dev/usb/wlan/if_urtwn.c optional urtwn +urtwn-rtl8188eufw.c optional urtwn-rtl8188eufw | urtwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8188eufw.fw:urtwn-rtl8188eufw:111 -murtwn-rtl8188eufw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "urtwn-rtl8188eufw.c" +urtwn-rtl8188eufw.fwo optional urtwn-rtl8188eufw | urtwnfw \ + dependency "urtwn-rtl8188eufw.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "urtwn-rtl8188eufw.fwo" +urtwn-rtl8188eufw.fw optional urtwn-rtl8188eufw | urtwnfw \ + dependency "$S/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "urtwn-rtl8188eufw.fw" urtwn-rtl8192cfwT.c optional urtwn-rtl8192cfwT | urtwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8192cfwT.fw:urtwn-rtl8192cfwT:111 -murtwn-rtl8192cfwT -c${.TARGET}" \ no-implicit-rule before-depend local \ Copied: stable/10/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu (from r264912, head/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu Fri May 23 06:47:47 2014 (r266578, copy of r264912, head/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu) @@ -0,0 +1,312 @@ +begin 644 urtwn-rtl8188eufw.fw.uu +MX8@0``L``0`!(1$G,#8``"T'```````````````````"14X````````````` +M````````P6\````````````````````````````````````````````````` +M````````````H>8````````"5O<````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````,*O@/XR$D($A=`+==`(JN#"C.6*)&?UBN6,-'GUC-*,["2)^.:\`P)T +M_\.5@;1``$#.>01X@!;F"'`+PJ_F,.$#1!CVTJ\(V>WJB]`BY0S_(R2!^`\( +M"+\$!'\`>('F,.3R`.4,PY]0(`4,=(@E#/CF_::!".:N#+X#`G3_S?CH;6#@ +M".;`X(#VY0S3GT`GY0PDB?CFK@R^`P)T__T8YLWXY8%M8`;0X/88@/7E#"2( +MR/85#(#3Y0PC)('X?P3"K^8PX`,0X@Q_`##A!S#C!'\(5/14?,;2KU2`0@(BF@70#8`;_"';_W_M_!.1X@/8(]@C?^GB!=C"01=YT`9/`X.23P.!#B0%U +MBF!UC'G2C-*O(@/OTY0#0`-__R)T@2\O^.8@Y?3"K^9$,/;2KZX,[L.?4"$. +M=(@N^.;Y".88O@,"=/_][6E@"0GG&1GW"0F`\Q86@-KNTY]`!`6!!8'NTY]` +M(G2(+O@(YOGNM0P"J8$8!@;F_>UI8`D9&><)"?<9@/,>@-GO)(CXY@3X[R\$ +MD$7>D_8([R^3]G\`(N_3E`-``W__(N\C)('XYC#E],*OYE2,]M*OY0RU!PIT +MB"_XYO6!`D)-4"YTB2_XYK\#`G3__1CF^72(+_C[YOSI;&`(J`7G]AT9@/2H +M`Z8%'^4,M0?C?P`B=(DO^.;]&(8!#W2(+_BF`0B&!.4,M0<"K('M;&`(#0FH +M!>;W@/3E#+4'WHF!?P`B[].4`T`#?_\B[R,D@?C"K^8PY04PX`+2Y-+BQM*O +M?P`PX@$/`D),C_#D__[E#",D@/C"J3#W#7\(YF`++?9@,%`N@`23H_CDDZ-``_:``?((W_2`*>23H_A4!R0,R,,SQ%0/1"#(@T`$]%:``4;V +MW^2`"P$"!`@0($"`D$71Y'X!DV"\H_]4/S#E"50?_N23HV`!#L]4P"7@8*A` +MN.23H_KDDZ/XY).CR,6"R,K%@\KPH\C%@LC*Q8/*W^G>YX"^`$&""0!!@@H` +M08(7`%GB7"1>75^AP.#`\,"#P(+`T'70`,``P`'``L`#P`3`!<`&P`>0`<1T +MYO!T1:/PT35TY@20`<3P=$6C\-`'T`;0!=`$T`/0`M`!T`#0T-""T(/0\-#@ +M,I``5.!5-?4YH^!5-O4ZH^!5-_4[H^!5./4\K3E_5!(R'JTZ?U42,AZM.W]6 +M$C(>K3Q_5Q(R'E.1[R+`X,#PP(/`@L#0==``P`#``<`"P`/`!,`%P`;`!Y`! +MQ'1O\'1&H_`2;'CE03#D!'\"D2?E03#F`Q)LU>5#,.`#$E'"Y4,PX0,230SE +M0S#B`Q),P>5#,.,#$FSBY4,PY`,2;03E0S#E`Q)M,^5#,.8"\0_E1##A`Q)1 +M?W1O!)`!Q/!T1J/PT`?0!M`%T`30`]`"T`'0`-#0T(+0@]#PT.`RD(#>X+0! +M$Y"!)^!@#9"!*^!4_O!4!W`"\2HBD($?X)"!*3#@!>#_`G2/X/]]`=,0KP'# +MP-"0@A/M\)"!*N"0@A3PD($DX/[$$Q-4`S#@`P)(H.[$$Q,35`$PX`,"2*"0 +M@A3@_F]P`P)(H.]P`P)(%R3^<`,"2%`D_F!1)/QP`P)(BR3\8`,"2*#NM`X# +M$DE>D((4X'`%?P$229.0@A3@M`8#$DDTD((4X+0$#Y""$^#_8`42]D`6`"`:`1^@&@D((4X+0.!Q&EOP$" +M,5Z0@A3@M`8",320@A3@M`P'$:6_`0(1^I""%.!D!'!<$G+U[V0!<%0QOH!0 +MD((4X+0.!Q&EOP$",5Z0@A3@M`8",320@A3@M`P'$:6_`0(1^I""%.!P!'\! +M,9.0@A3@M`0:$G.[@!60@A3@M`P.D($EX/\3$U0_,.`",;'0T)*O(M&K[V0! +M8`B0`;AT`?"`/9"!).#_$Q,35!\PX`B0`;AT`O"`*._$5`\PX`B0`;AT!/"` +M&9"!*>#3E`1`")`!N'0(\(`(D`&XY/!_`2*0`;ET`O!_`"*0@-[@9`%P,9"! +M)>!4_?"0!2)T;_!_`?$-OP$2D($DX$2`\)"!*G0.\)"!(_`BD`&Y=`'PD`&X +M!/`BD($EX)`&!"#@#.!$0/"0@2IT!/"`#N!4?_"0@2IT#/"0@2/PD`4BY/`B +MD($EX,,3(.`(D($J=`SP@!Z0!@3@1$#PX$2`\)"!*G0$\)`%)^!$@/"0@2-T +M!/"0!2+D\"*0@A7O\!)499""%>!@!9`%(N3PD($J=`3PD($C\"(QXY"!*G0( +M\)"!(_`BD`4B=/_P\3J0`3=T`O#]?P-15S'CY)"!*O"0@2/P(I`%(G3_\/$Z +MD(6[$B#:S/``P'^,?@@2+J*0A;L2(-H````4?W!^#A(NHI"!^1(@V@````#D +M_?\251Q_?'X($BU<[$2`_)""!1(@SI""!1)$V9"%NQ(@SG]\?@@2+J*0`0!T +M/_"CX%3]\)`%4^!$(/`BD`$T=$#P_>3_=#TO^.9-_O9T,"_U@N0T`?6#[O`B +MTQ"O`D($?X/\PX&V0@0@1_@_R#@`F'GD('+=#'P[Q,35#\PX`M13I"! +MR^!$"/"`!GU`Y/^1)I"!'^#]$Q,35!\PX`>0@/"C=`+P?7C_45=] +M`G\#45>0!@K@1`?PD($RH^"0!5CPD(#>X+0!%9"!)>!4^_"0@2K@(.(.?0%_ +M!`)'/9"!)>!$!/`BD($?X/\PX`B0@2/@9`)@.I"!)^!P!.\PX`J0@2K@9`)@ +M*+&#D($EX!,3$U0?,.`4D($MX/^CX&]P"O'-D1R0@2[@%/"0`>;@!/`BD($? +MX##@!I"!(70!\)"!)^!@19"!)>#_$Q,35!\PX!*0`3O@,.0+D1R0@2W@%)`% +M<_"0@@OD=?`!$D2IPY""#."4@)"""^!D@)2`0`N0`9C@5/[PX$0!\!)U^-'6 +MD($_X##@#.3U':/Q^Y`!5W0%\)`!ON`$\"*0@-[@9`%@`L$CD($GX'`"P2.0 +M@2;@Q%0/9`%P(I`&J^"0@2[PD`:JX)"!+?"CX/]P")"!+>#^_X``D($N[_"0 +M@27@1`3PY)"!,/"0@3*CX)`%6/"0`5?D\)`!/'0"\)"!*^!4_?!4[_"0@2;@ +M_\14#R3]4`*`#Y"!'^`PX`42;?*``Q)NR9"!)>`3$Q-4'S#@#I"!+>#_H^"U +M!P3QS9$BD($?X,,3(.`'D($EX$0$\"+1J^]P`M$\(I"!)^!D`7!FD($FX%0/ +M8%&0@2K@<`/_,9.0@2K@9`Q@`Q)F)I`!6^3PD`$\=`3PT:OO9`%@..3U'9"! +M.N##$U1_]1[D^_U_6'X!$E`%D`%;=`7PD`:2=`'PD($DX$0(\"*0@2K@<`=] +M`7\$$D<](I`$&N#T8`-_`"*0!!O@5`=D!W\!8`)_`"(24&"0@2W@%)`%<_!] +M`G\"45>0@4+@,.`MD(#>X+0!)I""%^`$\."T"@N0@43@!/#DD((7\)"!1.#_ +MD(%#X+4'!>2C\/$+(N3_CU.0!!W@8!F0!2+@]59T__#Q.K\!`Q)T^Y`%(N56 +M\(`#$G3[D`0?="#P?P$BY)""#_"C\)`%^.!P#Z/@<`NCX'`'H^!P`W\!(M.0 +M@A#@E.B0@@_@E`-`"I`!P.!$(/!_`")_,GX`$C*JD((/Y'7P`1)$J8"_=!\M +M]8+D-/SU@^!4/_#O8!UT(2WU@N0T_/6#X$00\'0?+?6"Y#3\]8/@1(#P(G0A +M+?6"Y#3\]8/@5._P=!\M]8+D-/SU@^!$0/`B[Q20!7/PD`$_=!#P_7\#=$4O +M^.9-_O9T."_U@N0T`?6#[O`BX$0"\.3U'9"!.>#U'N3[_7]4?@&.&8\:Y1Y4 +M!\0S5."%&8.%&H+PY1U4!\0S5.#_Y1X3$Q-4'T^C\.M4!\0S5.#_Y1T3$Q-4 +M'T^%&H*%&8.CH_"]`0R%&H*.@Z.CHW0#\"*%&H*%&8.CHZ-T`?`BY)"!3?"0 +M@2?@8%B0@-[@9`%P4)"!303PY)"!+O"0@1_@,.`5D($CX+0"!>20@4WP,7/O +M<`20@4WPD(%-X&`DD($KX$00\.3U'9"!+Q)/^Y`!5W0%\)"!*N`@X@=]`7\$ +M$D<](N20@4SPD($GX'`"(7*0@-[@9`%@`B%RD($FX/_$5`]@(B3^8`,$<"&0 +M@2[@%/#@_V`&D($PX&`1[W`(D($MX*/P@`"0@4QT`?"0@1_@,.`5D($CX+0" +M!>20@4SP,7/O<`20@4SPD(%,X&!#D($KX$00\)"!,.!@`[0!">3U'9"!,."` +M#>3U'9"!,.!U\`.D)/[_D($OX"\23_R0`5=T!?"0@2K@(.('?0%_!!)'/2*0 +M!4/@?P`PYP)_`2*0@2?@<`>0@1_@,.`1D($?X##@!S%SOP$%05L23CPBTQ"O +M`199`% +M(N3P(I"!'^#_,.`]D($CX'X`M`("?@&0@2+@?0"T!`)]`>U.<"/OPQ,PX`(A +MGE%%D($CX+0(!N3]?PR`"9"!(^!P!OU_!!)'/2*0@1[@M`$/D($CX&0"8`=] +M`7\"$D<]D($GX&0"8!20@2;@5`]@#!).J^]P!OU_#!)'/2*0@1_@_S#@/Y"! +M(^!^`+0"`GX!D($BX'T`M`0"?0'M3G`E[\,3,.`"(9X2=*R0@2/@M`P&Y/U_ +M"(`*D($CX+0$!N3]_Q)'/2+3$*\!P\#0D('+$D4?$A^D_Y"!'O"_`1*0@ +MT-"2KR+3$*\!P\#0D($BX)""%O!O<`*!!.\48#X48&(4<`)AN!1P`F'?)`1@ +M`H$$D((6X/^T!`2108$$[[0"!)%0@020@A;@_[0#!)%4@03O9`%@`H$$D4.! +M!)""%N#_M`0$D?.!!.^T`@216($$D((6X/^T`P21Z($$[W!]D2N`>9""%N"T +M!`42=&"`;9""%N"T`021(8!BD((6X+0#!1)T<8!6D((6X'!0D1^`3)""%N#_ +MM`0%$G1,@#_OM`$$D32`-^^T`@21WX`OD((6X'`ID3*`)9""%N#_M`,%$G1[ +M@!COM`$$D0N`$.^T`@2Q!H`(D((6X'`"D0G0T)*O(I$KD`4B=&_PD`4GX%2_ +M\)"!(G0$\"*1*Q))W9"!(G0"\"*0@2)T`?`BD2N0!2)T__"0@2)T`_`BD?.0 +M!2?@5+_PY)"!(O`BD5B`[Y'H@.N199`%(N3PD($B!/`BTQ"O`!$ +M`O"0`0!T__"0!K=T"?"0!K1TAO!_?'X($BU<[%1__)""`1(@SI""`1)$V9"% +MNQ(@SG]\?@@2+J*0A;L2(-K,P`#`?XQ^"!(NHI"%NQ(@V@#``!1_<'X.$BZB +MD('Y$B#:``,^8.3]_[$42(,[0!=`'$F#UT-"2KR*0@<@211_O$D4H57$`57H!58," +M58L#590$59P@5:0A5:TC5;4D5;XE5<#^D($DX%3]3O#O5`_$5/#_ +MD($FX%0/3_"0``02'[V0@2GPT<:0`;ET`?"0`;CPD($GX)`!NO"0@2G@D`&[ +M\)"!)N!4#Y`!OO`BD('+$D4?$G*SD($GX/\23#Z0@2?@8!F0@5),.$#$F]YY4DPX@+QI>5),.,#$F^-Y4HPX`,2;\GE +M2C#D`Q)P(N5+,.$"47CE2S#@`C'_Y4LPXP+QX.5,,.$%?P,21"?E3##D`Q). +MQ.5,,.4#$G`XY4PPY@,2<,YT]P20`<3P=%:C\-`'T`;0!=`$T`/0`M`!T`#0 +MT-""T(/0\-#@,I"!)^!@-)`&DN`PX"/D]1V0@3K@PQ-4?_4>Y/O]?UA^`1$% +MD`%;=`7PD`:2=`'P(I"!).!4]_`21RHB(A(?I)"!,?`BD`'(Y/"C\*/P>P%Z +M@7E1?__^$BLGOP$)D(%1X&0#8`,B`:ODD(%6\)"!5N#_PY0"0`(!YL-T_I__ +MY)0`_GL!>H%Y4A(K)^]D`7!WD(%2X/]4P/Y@!>]4#'`6D(%2X/]4,&!G[U0# +M8&*0@5-T`?"`!>20@5/PD(%3X)"!4G`6X/_N$Q-4/Y"!5/#O5`P3$U0_H_"` +M#>#^5#"0@53P[E0#H_"0@53@9#!P5*/@9`)P3I``]>!40)"!5_#@<$&C=`+P +M@!"0@5AT`?"`")"!5N`$\`$1D`'$=.GP=%>C\)"!6."0`K3A_4P(R'G4]$.3U/G4_!W5``I`!,.4]\*/E/O"CY3_PH^5` +M\")U10YU1@%#1A!U1P-U2&*0`3CE1?"CY4;PH^5'\*/E2/`BD`$PY/"C\*/P +MH_"0`3CPH_"C\*/P_7]0$C(>Y/U_41(R'N3]?U(2,A[D_7]3`C(>D`$T=/_P +MH_"C\*/PD`$\\*/PH_"C\/U_5!(R'GW_?U42,AY]_W]6$C(>??]_5P(R'I`` +M@.!$@/U_@!(R'I#]`.!4O_`25^E1=Q(R=U')45Y_`1)#%9"!070"\/\20Q60 +M@4'@!/!_`Q)#%9"!0>`$\#$!43^0`(#@1$#]?X`2,AYU(/]1:%'Y47_D_P)# +MGE%B46]1IW%/48I1E9"!1>!4_O"C=`/PH_#DH_"C\"+D]4TBY)"`WO`B=>@# +M=:B$(N20@-CPH_`BD`&4X$0!\"*0`>1T"_"C=`'P(I"!/^!4_O#DH_`BD(%" +MX%3^\%1_\*-T"O#DH_`BD($?X%3^\%3]\%3[\%3W\%3O\%3?\.2C\*/PH_"C +M=`SP(I`!`>!$!/"0`9QT?O"C=)+PHW2@\*-T)/"0`9MT2?"0`9ITX/"0`9GD +M\)`!F`3P(N20@5'PH_"0`9C@?P`PY`)_`>]D`6`^PY"!4N"4B)"!4>"4$T`( +MD`'!X$00\"*0@5'D=?`!$D2I?Q1^`!(RJM.0@5+@E#*0@5'@E`!`N9`!QN`P +MX[(BY)"!)_"C\)"!)N!4#_!4\/"0@23@5/WP5/?P5._PD($M=`'PH_"0@23@ +M5/OPH^!4^_#DD($P\)"!+W0'\)"!,N3PHW0"\.20@2OPD($DX%3^\)"!*70, +M\)"!).!4W_"0@2IT#/"0@23@5+_P5'_PH^!4_O!4_?!4]_"0@302(-H````` +MD(`\X+0!")"!,729\(`2D(`\X)"!,;0#!720\(`#=$#PD($X=`'PHW0%\*/@ +M5`%$*/"C=`7PY*/PH^!4_?!4^_!4]_!4[_!4W_!4O_#DH_`BY)"!6?"0@5G@ +M9`'P)"20`<3P=%RC\)"!*N#_D($IX&]@`Q)'*M$(OP$"D5^Q\A(RGK\!`K%G +M$D)-@,K3$*\!P\#0D($DX##@))"!'^#_,.`:PQ,PX`>Q^[\!$H`*D($CX/]@ +M`[0(!I&6@`*1IM#0DJ\BTQ"O`7@!/`BL?.0``C@5._]?P@2,A[D_X]0Y)"!6O"C\)`!">!_`##G`G\![V50 +M8#[#D(%;X)2(D(%:X)030`B0`<#@1!#P(I"!6N1U\`$21*E_%'X`$C*JTY"! +M6^"4,I"!6N"4`$"YD`'&X##@LB*0@3'@_7^3$C(>D($HX&`2D`$OX##G!700 +M\(`&D`$O=)#PD``(X$00_7\($C(>?P&1RI``D.!$`?U_D!(R'G\4?@`",JK3 +M$*\!P\#0$BVGY/52$C*>[V!S8U(!Y5(D9Y`!Q/!T7:/PD`"(X/50]5%4#V#? +MY5`PX`L@Y`,2*<534>Z`/^50,.$6(.4.$A&][W`#0U$@D`$&Y/!34?V`).50 +M,.(+(.8#$F<&4U'[@!3E4##C#R#G"1)A;N]P`T-1@%-1]ZU1?X@2,AZ`A]#0 +MDJ\B(I``D.`@X/DBD($BX&0"?P%@`G\`(G\"D(%!X/[OPYY0&.\EX"2!^.8P +MY`N0`;AT"/"C\'\`(@^`WG\!(I`"A^!@")`!N'0!\(`7D`*&X"#A")`!N'0$ +M\(`(D`&XY/!_`2*0`;ET"/!_`"+D^_K]?P$21$Z0@;WO\&#PT7&`[-,0KP'# +MP-"0`!U\`20`=`210K@D(&_\'43`744@745OW46`7L!>H%YP!(K[9"" +M">!U\`20`=$210K@D('!\)""">!U\`20`=(210K@D('"\)""">!U\`20`=,2 +M10K@D('#\)""">!U\`20`?`210K@D('$\)""">!U\`20`?$210K@D('%\)"" +M">!U\`20`?(210K@D('&\)""">!U\`20`?,210K@D(''\)"!ON#_D(()X/YT +M`:@&"(`"PS/8_/1?D(&^\)""">#_=`&H!PB``L,SV/R0`<$253^0@@G@!/#@5`/PP8*0`<#@1`+PT-"2KR+D^_K]?P$21$Z0@=#O\&#P +M$FP9@.N0@=3O\*/M\*,2(-H`````Y)"!XO!_)'X($BU#_Y/S] +M_G@7$B"[J`2I!:H&JP>0@=X21-GM5'_][%2`_!)$S.Q$@/R0@=X2(,Z0@=H2 +M1-GL5'_\D(6[$B#.?R1^"!(NHI"!U.!U\`BD)&+U@N0TA_6#X/ZCX/_`!L`' +MD('>$D39D(6[$B#.T`?0!A(NHI"!VA)$V>Q$@/R0A;L2(,Y_)'X($BZBD('4 +MX'`$?R"`"9"!U."T`19_*'X($BU<>`@2(*CO5`'_Y)"!XN_PD('BX)"!U&`. +MX'7P"*0D9O6"Y#2'@`S@=?`(I"1D]8+D-(?U@^#^H^#_$BU<[50/_>3\D('6 +M$B#.D('6`D39D('C[_"K!9"!Z1(@V@````"O`^3\_?YX%!(@NZ@$J06J!JL' +MD('E$D39[50/_>3\$D3,[%0/_)"!Z1(@SI"!X^!U\`BD)&#U@N0TA_6#X/ZC +MX/_`!L`'D('I$D39D(6[$B#.T`?0!@(NHM,0KP'#P-`27[;0T)*O(G@0=`'R +MD`()X'@`\@AT(/(8XO\PX`4(XB2`\N_#$Y#]$/!X`>(D`/6"Y#3\]8/@>`/R +M9`1@#>+_9`A@!^]D#&`"8=[D>`+R>`/B_QCBPY]0+>+]&.(MD(%:\.#_)`#U +M@N0T_/6#X/YT!"WX[O+OM/\&D/T0X`3P>`+B!/*`R7@$XG@2\O]X!>)X$?)X +M!N)X$_)X!^)X%/)X".)X,_)X">)X-/)X"N)X-?)X"^)X-O)X#.)X-_)X#>)X +M./)X#N)X.?)X#^)X.O+D>!7R[R3X8'4D_&!L)`A@`F'`>!'BM`$%$BG%8<5X +M$>*T`@42$;UAQ7@1XK0#!/$&8<5X$>*T$!=X%.+^&.+][?]X%N[R_@CO\O\2 +M,JIAQ7@1XK01%W@4XOX8XOWM_W@6[O+^"._R_Q(R!F'%>!'B]&`"8<48\F'% +M>!5T`?)X$>)D!V`"8:IX-.+_Y/S]_G@($B"[P`2I!:H&JP=X,^+_Y/S]_M`` +M$D3,P`3`!<`&P`=X->+_Y/S]_G@0$B"[T`/0`M`!T``21,QX&!)$_G@5XG`" +M89,8XO\8XOTQ7W@<$D3^>#CB_^3\_?YX"!(@N\`$J06J!JL'>#?B_^3\_?[0 +M`!)$S,`$P`7`!L`'>#GB_^3\_?YX$!(@N]`#T`+0`=``$D3,>"`21/YX(!)$ +MY1(@FW@<$D3Q$D2_P`3`!<`&P`=X&!)$Y7@@$D3Q$D2_T`/0`M`!T``21,QX +M&!)$_G@8$D3ED('Y$B#.>!/B_0CB_Q)5'(`;>!/B_PCB_7@1XOMX%>*0@;SP +M<>&`!7@0=`+R>!#B_\.4`E`0[V`*>`+B_QCB+_(AD'\!(G\`(JP'[:T$>"3R +M[0CRZ[0$!W@G=`'R@`[K>">T!05T`O*``W0$\M-X)>*4_QCBE`!08^1X)O)X +M)^+_&.+^PY]``J%_=#,N^.)X*/*0@;S@8"UT-R[XXG@R\N[_>"7B+_\8XC0` +MCX+U@^!X*?)X,N+_]/YX*>)>_ACB_>]=3O)X)`CB_PCB+_]X*.+]$C(>>";B +M!/*`H=-X)>*4_QCBE`=0:>1X)O)X)^+_&.+^PY]``J%_=#,N^.)X*/*0@;S@ +M8"UX)N+__1CB+?T8XC0`C8+U@^!X*?)T-R_XXG@R\N+_]/YX*>)>_ACB_>]= +M3O)X*.+_>";B_1CB+?T8XC0`C8+U@^_P>";B!/*`FY"!O.!@#W@DXOX(XO\2 +M+5QX+A)$_N1X)O)X)^+_&.+^PY]0770S+OCB>"CRD(&\X&`K>"X21.5X)N+[ +M=?`(I/GX$B"H>"GO\G0W*_CB>#+RXO[T7_]X*.+][EU/\G@HXO]X)N+]PW0# +MG?WDE`#\>_YT*BWY=(`\^N\2'^KB!/*`F'@J$D3ED(6[$B#.>"3B_@CB_Q(N +MHB(BD('+$D4?D``!$A^]__X2'Z3]PQ,PX!*0@4#B0@_PH^WPK0.L`N20@?7PH_"0`<1T.?!T9J/P[%0__)`!0.WP +MK@3NH_"0@>W@)(%@-"3:8!PD/'!!D('NX,0S,S-4@)"!\O"C=&GPHW2`\(`L +MD('NX%0!D('R\*-TI?"C=`'P@!B0@>[@Q%00D('R\*-T?_"C=!#P@`-_`"*0 +M@?/@D`$&\)"!\N!@#I`!0O"0@?'@D`%#\(`-D`%#Y/"0@?+@D`%"\)"!].#_ +MD`%"X%__D('RX&]@[G0Y!)`!Q/!T9J/PD`%#Y/!_`2+DD(%J\)"'7^"0@6GP +MY)"!=O"0@6;PD(%FX/_#E$!0%71Y+_6"Y#2!]8-T__"0@6;@!/"`X>20@6;P +MD(%IX/^0@6;@_L.?0`,":!)TWR[YY#2&=1,!]12)%746"GL!>H%Y6Q(K[9"! +M7.#_$B\G[P20@7;PD(%;X/^CX/T2,>KO),B0@7CP=?`(I/"0@5S@5`^0@7?P +MY)"!9?"0@6?PD(%GX/_#E`105Y"!=^#^J`<(@`+#$]C\(.`^D(%GX"7@_Y"! +M>.`O)'GYY#2!^GL!P`/``9"!9>!U\`*D)%WY=($U\(L3]12)%746`M`!T`,2 +M*^V0@67@!/"0@6?@!/"`GY"!=N#_D(%FX"_P`F=`Y)"!:O"0@6K@PY1`0`)! +MK^#_)'GU@N0T@?6#X)"!;/#@_E3PQ%0/_9"!:_#N5`_^H_!T>B_U@N0T@?6# +MX)"!;?#\[O[L^^O_D(%R[O"C[_#M$D4H:(L`:,(!:7,":J`#:8X$::\%::\& +M::\'::\(:C,):FD*``!JKY"!:N#])'SU@N0T@?6#X/YT>RWU@N0T@?6#X/WM +M_Y"!=.[P_*/O\)"!;>#_$B^6D(%H=`+P0:"0@6K@)'SU@N0T@?6#X/_D_/W^ +M>`@2(+NH!*D%J@:K!Y"!:N`D>_6"Y#2!]8/@_^3\_?X21,S`!,`%P`;`!Y"! +M:N`D??6"Y#2!]8/@_^3\_?YX$!(@N]`#T`+0`=``$D3,P`3`!<`&P`>0@6K@ +M)'[U@N0T@?6#X/_D_/W^>!@2(+O0`]`"T`'0`!)$S)"!;A(@SI"!;A)$V9"% +MEA(@SI"!_6"Y#2!]8/@^^3_ +M$C#'@!F0@6W@_9"!:N`D>_6"Y#2!]8/@^^3_$C!JD(%H=`'P0:"0@6AT`O"0 +M@6K@)'SU@N0T@?6#X/_D_/W^>`@2(+NH!*D%J@:K!Y"!:N`D>_6"Y#2!]8/@ +M_^3\_?X21,S`!,`%P`;`!Y"!;.#_Y/S]_G@0$B"[T`/0`M`!T``21,R0@6X2 +M(,Z0@6O@)/O_P`>0@6X21-F0@?D2(,Z0@6W@_=`'$E4<@&V0@6AT`?"0@6K@ +M)'OYY#2!=1,!]12)%746`7O^>H!Y,Q(K[9"!;>#_D(%LX/WDD(&\\'L$@#20 +M@6AT!/"0@6K@)'OYY#2!=1,!]12)%746!'O^>H!Y,Q(K[9"!;>#_D(%LX/WD +MD(&\\'L&$F/AD(%HX"0"_Y"!:N`O\`$7(I`"">#]$A^D_J\%[2Z0@#WPD``! +M$A^]_^TOD(`^\)```A(?O?_M+Y"`/_"0``,2'[W_[2^0@$#PD``$$A^]_ZX% +M[2^0@$'P(I```A(?O?\PX"82'Z20@3CPD``!$A^]D($Y\.]4_O^CX%0!3_"0 +M``,2'[V0@3OP(I"!.'0!\*-T!?"CX%0!1"CPHW0%\"(2'Z20@3[PD($^X)`! +MY_`B$A^DD(%*\)```1(?O9"!2_`BTQ"O`[PH^_PY*/PH_"0@?W@ +M_J/@]8*.@^!@+<.0@@#@E.B0@?_@E`-`"Y`!P.!$@/!_`(`5D('_Y'7P`1)$ +MJ7\*?@`2,JJ`Q7\!T-"2KR+3$*\!P\#0D('1$D4?D((*X/\$\)```>\2'_Q_ +MKWX!<6#O8#J0@=$211:+$XH4B160``X2'[TD`O46>P%Z`7F@$BOMD('1$D46 +MD``.$A^]D`&N\*-T__"0`P%QMG\![V`6D(#8 +MX`3PX'\`M`H"?P'O8`7DD(#8\-#0DJ\BCPTBCPXB(I`!-.!5/?5!H^!5/O5" +MH^!5/_5#H^!50/5$D`$TY4'PH^5"\*/E0_"CY43P(I`!/.!51?5)H^!51O5* +MH^!51_5+H^!52/5,D`$\Y4GPH^5*\*/E2_"CY4SP4Y'?(I"!'^`PX`7DH_"C +M\"*0@-[@9`%P&9"!)^!@$Y`!5^3PD`$\=`(23_20`5=T!?`BD(#>X&0!<":0 +M@2?@8""0`5?D\)`!/'0"\)"!).!4^_"0@2O@5/WP5`=P`Q)'*B*0@-[@M`$4 +MD($GX&`.D($FX%0/9`)@`H`#T7\BD`0=X'`3D(`^X/_D_;%ICDZ/3Y`$'W0@ +M\"+3$*\!P\#0D((.[?"0@@WO\.3]_/$W?`"M!Y""#>"0!"7PD((.X&`.=`\O +M]8+D-/SU@^!$@/"O!70(+_6"Y#3\]8/D\'0)+_6"Y#3\]8/@5/#P="$M]8+D +M-/SU@^!4]_"N!*\%T-"2KR*/3O%+OP$8D(!`X/]]`;%IK0>L!J].$D^"D`0? +M="#P(I`&J>"0@4SPX/U4P'`)D($KX%3^\(!R[3#F2Y"!)^!D`G`JD($DX/_# +M$R#@"9"!*^!$`?"`*)"!)N!4#V0!<"V0@2O@1`3P?P&QTH`@D($KX$0!\)"! +M)N!4#V0"8`2Q3X`+T7^`!Y"!*^!4_O"0@4S@D($K,.<1$D_QD`%7=`7PD($D +MX$0$\"+@5/WP(I`!7^3PD`$\=`CPY/4=D($ZX,,35'_U'N3[_7]0@2O@5/[PD(%,X)"!*S#G$1)/\9`!5W0% +M\)"!).!$!/`BX%3]\"+D_N_#$_WO,.`"?H"0_1#M\*\&(M,0KP'#P-"0!!W@ +M8!J0!2+@5)!@!Y`!P.!$"/"0`<;@,.'D?P"``G\!T-"2KR*0@2?@8`,2<^&0 +M@3_@,.`#$DG=(I"!)^!@-9`&DN`PX23D]1V0@3K@PQ-4?_4>Y/O]?UQ^`1)0 +M!9`!7W0%\)`&DG0"\"*0@23@5._P$D_PD($D,.`&X$0!\(`$ +MX%3^\)"!3>`PYA&0`2_@,.<$Y/"`!I`!+W2`\)"!).`PX!J0@3+D\*-T!_"0 +M@3*CX)`%6/"0!.S@5-WP(I`$[.!$(O`BD(%*X&`/Y/"0!5/@1`'PD`7]X`3P +M(I"!).#_Q!,35`,PX"?O5+_PD`3@X)"!)3#@!N!$`?"`$.!4_O"0`;ET`?"0 +M`;AT!/`21RKD_Y"!1>`PX$B0@4G@_6!!=`%^`*@'"(`%PS/.,\[8^?^0!.#@ +M^^];8`;DD(%)\"*0@4?@TYU0$)`!QW00\!&^D(%%X%3^\"(23PN0@4G@!/`B +MD(`\X&0"8`>0!I#@1`'P(I"!).#_Q!,3$U0!,.`L[U1_\)`$X."0@24PX0;@ +M1`+P@`_@5/WPD`&Y=`'PD`&X!/"0@2?@8`,21RI_`0%NP^Z4`4`*#>T3D/T0 +M\.0O_R+#[I0!0"20_1'@;7`:D`$7X+4%#9`!Y'1W\)#]$>3P@`;M!)#]$?#D +M+_\BY)"!3O"C\*/PD`"#X)"!3O"0`(/@_I"!3N#_M08!(L.0@5#@E&20@4_@ +ME`!`#9`!P.!$0/"0@4[@_R*0@4_D=?`!$D2I@,)T12_XYO[M]%[^]G0X+_6" +MY#0!]8/N\"+3$*\!P\#0D((2[?"0@A'O\-.4!U!PX/]T`:@'"(`"PS/8_/3_ +MD`!'X%_]?T<2,AZ0@A'@_W0!J`<(@`+#,]C\_Y``1N!/_7]&$C(>D((2X&`8 +MD((1X/]T`:@'"(`"PS/8_/^0`$7@3X`7D((1X/]T`:@'"(`"PS/8_/3_D`!% +MX%_]?T6`?I""$>`D^/#@)`3_=`&H!PB``L,SV/ST_Y``0^!?_7]#$C(>D((1 +MX/]T`:@'"(`"PS/8_/^0`$/@3_U_0Q(R'I""$N!@'9""$>`D!/]T`:@'"(`" +MPS/8_/^0`$+@3_U_0H`"C\)"!)>!$"/`B$DZK[V0!8`B0`;AT`?"`9Y"! +M*^#_5`-@")`!N'0"\(!6D($IX/[DPYY0")`!N'0$\(!$[S#B")`!N'0(\(`X +MD($KX##D")`!N'00\(`ID($EX!,35#\@X`B0`;AT(/"`%I"!/N!@")`!N'2` +M\(`(D`&XY/!_`2*0`;ET!/!_`"+O8$*0@-[@9`%P.I"!)>!4_O"0!2)T#_"0 +M!@3@5+_PY/\23PV_`1*0@23@1$#PD($J=`;PD($C\"*0`;ET`?"0`;AT"/`B +MD`4B=&_PD`4GX%2_\)"!*G0"\)"!(_`B$E1ED($J=`SPD($C\"*0@23@_Q,3 +M5#\PX!'O5/OPD($KX%3]\%0'<$*`/9"!,.`$\)"!*^!4[_"0@3#@_[0!`H`$ +M[[0"!I`%6.`$\)"!..#_D($PX-.?0`^0@-[@M`$+D($EX%3[\"(21RHB(I`% +M*^!_`##G`G\!(I`%(G3_\)`%)^!$0/"0@2)T`_`BD`4GX$1`\!))W9"!(G0" +M\"(22>.0@2)T`O`BD`4B=&_PD`4GX%2_\)"!(G0$\"*N!Q)1<[\!$I"!(^!D +M`F`*KP9]`1)'/7\!(G\`(I`!5^!@2.3PD`$\=`+PD($DX/\3$U0_,.`,[U3[ +M\)"!*^!4_?`BD($PX`3PD($KX%3O\)"!..#_D($PX-.?0`Z0@-[@M`$'D($E +MX%3[\"*0@#_@_WT!$FUICE2/5:U5K%2O4Q)/@J]5KE20!(#@5`_]K`=T$2SU +M@N0T_/6#X$0!\'01+/6"Y#3\]8/@5/OPK`=T%BSU@N0T_/6#X$3Z\'05+/6" +MY#3\]8/@1!_PK`=T!BSU@N0T_/6#X$0/\)`$4^3PD`12\)`$473_\)`$4'3] +M\'04+/6"Y#3\]8/@5,!-_704+_6"Y#3\]8/M\"*K!ZH&[2O[Y#KZPY"`V^"; +MD(#:X)I0$Z/@)`'_D(#:X#0`_L/KG_OJGOKJD/T1\*\#=``O]8+D-/OU@^#_ +M(A(?I/]4`?Z0@4+@5/Y.\._#$S#@"I```1(?O9"!0_`BD(%%X##@+9"!2.`$ +L\.#_D(%&X+4''I`&DN!4''`+$D\+D(%)X`3P@`:0!I)T'/#DD(%(\"(`NXX` +` +end Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Fri May 23 06:35:45 2014 (r266577) +++ stable/10/sys/dev/usb/usbdevs Fri May 23 06:47:47 2014 (r266578) @@ -3677,6 +3677,7 @@ product RATOC REXUSB60F 0xb020 USB seri /* Green House and CompUSA OEM this part */ product REALTEK DUMMY 0x0000 Dummy product product REALTEK USB20CRW 0x0158 USB20CRW Card Reader +product REALTEK RTL8188ETV 0x0179 RTL8188ETV product REALTEK RTL8188CTV 0x018a RTL8188CTV product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet product REALTEK RTL8188CE_0 0x8170 RTL8188CE Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Fri May 23 06:35:45 2014 (r266577) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Fri May 23 06:47:47 2014 (r266578) @@ -2,6 +2,7 @@ /*- * Copyright (c) 2010 Damien Bergamini + * Copyright (c) 2014 Kevin Lo * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,7 +21,7 @@ __FBSDID("$FreeBSD$"); /* - * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188RU/RTL8192CU. + * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU. */ #include @@ -87,11 +88,13 @@ SYSCTL_INT(_hw_usb_urtwn, OID_AUTO, debu /* various supported device vendors/products */ static const STRUCT_USB_HOST_ID urtwn_devs[] = { #define URTWN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } +#define URTWN_RTL8188E_DEV(v,p) \ + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, URTWN_RTL8188E) } +#define URTWN_RTL8188E 1 URTWN_DEV(ABOCOM, RTL8188CU_1), URTWN_DEV(ABOCOM, RTL8188CU_2), URTWN_DEV(ABOCOM, RTL8192CU), URTWN_DEV(ASUS, RTL8192CU), - URTWN_DEV(ASUS, USBN10NANO), URTWN_DEV(AZUREWAVE, RTL8188CE_1), URTWN_DEV(AZUREWAVE, RTL8188CE_2), URTWN_DEV(AZUREWAVE, RTL8188CU), @@ -139,12 +142,17 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(REALTEK, RTL8191CU), URTWN_DEV(REALTEK, RTL8192CE), URTWN_DEV(REALTEK, RTL8192CU), + URTWN_DEV(REALTEK, RTL8188CU_0), URTWN_DEV(SITECOMEU, RTL8188CU_1), URTWN_DEV(SITECOMEU, RTL8188CU_2), URTWN_DEV(SITECOMEU, RTL8192CU), URTWN_DEV(TRENDNET, RTL8188CU), URTWN_DEV(TRENDNET, RTL8192CU), URTWN_DEV(ZYXEL, RTL8192CU), + /* URTWN_RTL8188E */ + URTWN_RTL8188E_DEV(REALTEK, RTL8188ETV), + URTWN_RTL8188E_DEV(REALTEK, RTL8188EU), +#undef URTWN_RTL8188E_DEV #undef URTWN_DEV }; @@ -189,15 +197,19 @@ static uint16_t urtwn_read_2(struct urt static uint32_t urtwn_read_4(struct urtwn_softc *, uint16_t); static int urtwn_fw_cmd(struct urtwn_softc *, uint8_t, const void *, int); -static void urtwn_rf_write(struct urtwn_softc *, int, uint8_t, - uint32_t); +static void urtwn_r92c_rf_write(struct urtwn_softc *, int, + uint8_t, uint32_t); +static void urtwn_r88e_rf_write(struct urtwn_softc *, int, + uint8_t, uint32_t); static uint32_t urtwn_rf_read(struct urtwn_softc *, int, uint8_t); static int urtwn_llt_write(struct urtwn_softc *, uint32_t, uint32_t); static uint8_t urtwn_efuse_read_1(struct urtwn_softc *, uint16_t); static void urtwn_efuse_read(struct urtwn_softc *); +static void urtwn_efuse_switch_power(struct urtwn_softc *); static int urtwn_read_chipid(struct urtwn_softc *); static void urtwn_read_rom(struct urtwn_softc *); +static void urtwn_r88e_read_rom(struct urtwn_softc *); static int urtwn_ra_init(struct urtwn_softc *); static void urtwn_tsf_sync_enable(struct urtwn_softc *); static void urtwn_set_led(struct urtwn_softc *, int, int); @@ -206,6 +218,7 @@ static int urtwn_newstate(struct ieee80 static void urtwn_watchdog(void *); static void urtwn_update_avgrssi(struct urtwn_softc *, int, int8_t); static int8_t urtwn_get_rssi(struct urtwn_softc *, int, void *); +static int8_t urtwn_r88e_get_rssi(struct urtwn_softc *, int, void *); static int urtwn_tx_start(struct urtwn_softc *, struct ieee80211_node *, struct mbuf *, struct urtwn_data *); @@ -213,13 +226,16 @@ static void urtwn_start(struct ifnet *) static void urtwn_start_locked(struct ifnet *, struct urtwn_softc *); static int urtwn_ioctl(struct ifnet *, u_long, caddr_t); -static int urtwn_power_on(struct urtwn_softc *); +static int urtwn_r92c_power_on(struct urtwn_softc *); +static int urtwn_r88e_power_on(struct urtwn_softc *); static int urtwn_llt_init(struct urtwn_softc *); static void urtwn_fw_reset(struct urtwn_softc *); +static void urtwn_r88e_fw_reset(struct urtwn_softc *); static int urtwn_fw_loadpage(struct urtwn_softc *, int, const uint8_t *, int); static int urtwn_load_firmware(struct urtwn_softc *); -static int urtwn_dma_init(struct urtwn_softc *); +static int urtwn_r92c_dma_init(struct urtwn_softc *); +static int urtwn_r88e_dma_init(struct urtwn_softc *); static void urtwn_mac_init(struct urtwn_softc *); static void urtwn_bb_init(struct urtwn_softc *); static void urtwn_rf_init(struct urtwn_softc *); @@ -232,6 +248,9 @@ static void urtwn_write_txpower(struct static void urtwn_get_txpower(struct urtwn_softc *, int, struct ieee80211_channel *, struct ieee80211_channel *, uint16_t[]); +static void urtwn_r88e_get_txpower(struct urtwn_softc *, int, + struct ieee80211_channel *, + struct ieee80211_channel *, uint16_t[]); static void urtwn_set_txpower(struct urtwn_softc *, struct ieee80211_channel *, struct ieee80211_channel *); @@ -251,6 +270,7 @@ static void urtwn_stop_locked(struct if static void urtwn_abort_xfers(struct urtwn_softc *); static int urtwn_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); +static void urtwn_ms_delay(struct urtwn_softc *); /* Aliases. */ #define urtwn_bb_write urtwn_write_4 @@ -350,6 +370,8 @@ urtwn_attach(device_t self) device_set_usb_desc(self); sc->sc_udev = uaa->device; sc->sc_dev = self; + if (USB_GET_DRIVER_INFO(uaa) == URTWN_RTL8188E) + sc->chip |= URTWN_CHIP_88E; mtx_init(&sc->sc_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, MTX_DEF); @@ -381,10 +403,15 @@ urtwn_attach(device_t self) sc->ntxchains = 1; sc->nrxchains = 1; } - urtwn_read_rom(sc); + + if (sc->chip & URTWN_CHIP_88E) + urtwn_r88e_read_rom(sc); + else + urtwn_read_rom(sc); device_printf(sc->sc_dev, "MAC/BB RTL%s, RF 6052 %dT%dR\n", (sc->chip & URTWN_CHIP_92C) ? "8192CU" : + (sc->chip & URTWN_CHIP_88E) ? "8188EU" : (sc->board_type == R92C_BOARD_TYPE_HIGHPA) ? "8188RU" : (sc->board_type == R92C_BOARD_TYPE_MINICARD) ? "8188CE-VAU" : "8188CUS", sc->ntxchains, sc->nrxchains); @@ -636,7 +663,10 @@ urtwn_rx_frame(struct urtwn_softc *sc, u /* Get RSSI from PHY status descriptor if present. */ if (infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST)) { - rssi = urtwn_get_rssi(sc, rate, &stat[1]); + if (sc->chip & URTWN_CHIP_88E) + rssi = urtwn_r88e_get_rssi(sc, rate, &stat[1]); + else + rssi = urtwn_get_rssi(sc, rate, &stat[1]); /* Update our average RSSI. */ urtwn_update_avgrssi(sc, rate, rssi); /* @@ -1030,7 +1060,7 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin for (ntries = 0; ntries < 100; ntries++) { if (!(urtwn_read_1(sc, R92C_HMETFR) & (1 << sc->fwcur))) break; - DELAY(1); + urtwn_ms_delay(sc); } if (ntries == 100) { device_printf(sc->sc_dev, @@ -1054,14 +1084,31 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin return (0); } -static void +static __inline void urtwn_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, uint32_t val) { + + sc->sc_rf_write(sc, chain, addr, val); +} + +static void +urtwn_r92c_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, + uint32_t val) +{ urtwn_bb_write(sc, R92C_LSSI_PARAM(chain), SM(R92C_LSSI_PARAM_ADDR, addr) | SM(R92C_LSSI_PARAM_DATA, val)); } +static void +urtwn_r88e_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, +uint32_t val) +{ + urtwn_bb_write(sc, R92C_LSSI_PARAM(chain), + SM(R88E_LSSI_PARAM_ADDR, addr) | + SM(R92C_LSSI_PARAM_DATA, val)); +} + static uint32_t urtwn_rf_read(struct urtwn_softc *sc, int chain, uint8_t addr) { @@ -1073,16 +1120,16 @@ urtwn_rf_read(struct urtwn_softc *sc, in urtwn_bb_write(sc, R92C_HSSI_PARAM2(0), reg[0] & ~R92C_HSSI_PARAM2_READ_EDGE); - DELAY(1000); + urtwn_ms_delay(sc); urtwn_bb_write(sc, R92C_HSSI_PARAM2(chain), RW(reg[chain], R92C_HSSI_PARAM2_READ_ADDR, addr) | R92C_HSSI_PARAM2_READ_EDGE); - DELAY(1000); + urtwn_ms_delay(sc); urtwn_bb_write(sc, R92C_HSSI_PARAM2(0), reg[0] | R92C_HSSI_PARAM2_READ_EDGE); - DELAY(1000); + urtwn_ms_delay(sc); if (urtwn_bb_read(sc, R92C_HSSI_PARAM1(chain)) & R92C_HSSI_PARAM1_PI) val = urtwn_bb_read(sc, R92C_HSPI_READBACK(chain)); @@ -1105,7 +1152,7 @@ urtwn_llt_write(struct urtwn_softc *sc, if (MS(urtwn_read_4(sc, R92C_LLT_INIT), R92C_LLT_INIT_OP) == R92C_LLT_INIT_OP_NO_ACTIVE) return (0); - DELAY(5); + urtwn_ms_delay(sc); } return (ETIMEDOUT); } @@ -1125,7 +1172,7 @@ urtwn_efuse_read_1(struct urtwn_softc *s reg = urtwn_read_4(sc, R92C_EFUSE_CTRL); if (reg & R92C_EFUSE_CTRL_VALID) return (MS(reg, R92C_EFUSE_CTRL_DATA)); - DELAY(5); + urtwn_ms_delay(sc); } device_printf(sc->sc_dev, "could not read efuse byte at address 0x%x\n", addr); @@ -1141,22 +1188,8 @@ urtwn_efuse_read(struct urtwn_softc *sc) uint8_t off, msk; int i; - reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL); - if (!(reg & R92C_SYS_ISO_CTRL_PWC_EV12V)) { - urtwn_write_2(sc, R92C_SYS_ISO_CTRL, - reg | R92C_SYS_ISO_CTRL_PWC_EV12V); - } - reg = urtwn_read_2(sc, R92C_SYS_FUNC_EN); - if (!(reg & R92C_SYS_FUNC_EN_ELDR)) { - urtwn_write_2(sc, R92C_SYS_FUNC_EN, - reg | R92C_SYS_FUNC_EN_ELDR); - } - reg = urtwn_read_2(sc, R92C_SYS_CLKR); - if ((reg & (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) != - (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) { - urtwn_write_2(sc, R92C_SYS_CLKR, - reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M); - } + urtwn_efuse_switch_power(sc); + memset(&sc->rom, 0xff, sizeof(sc->rom)); while (addr < 512) { reg = urtwn_efuse_read_1(sc, addr); @@ -1186,12 +1219,37 @@ urtwn_efuse_read(struct urtwn_softc *sc) } #endif } +static void +urtwn_efuse_switch_power(struct urtwn_softc *sc) +{ + uint32_t reg; + + reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL); + if (!(reg & R92C_SYS_ISO_CTRL_PWC_EV12V)) { + urtwn_write_2(sc, R92C_SYS_ISO_CTRL, + reg | R92C_SYS_ISO_CTRL_PWC_EV12V); + } + reg = urtwn_read_2(sc, R92C_SYS_FUNC_EN); + if (!(reg & R92C_SYS_FUNC_EN_ELDR)) { + urtwn_write_2(sc, R92C_SYS_FUNC_EN, + reg | R92C_SYS_FUNC_EN_ELDR); + } + reg = urtwn_read_2(sc, R92C_SYS_CLKR); + if ((reg & (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) != + (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) { + urtwn_write_2(sc, R92C_SYS_CLKR, + reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M); + } +} static int urtwn_read_chipid(struct urtwn_softc *sc) { uint32_t reg; + if (sc->chip & URTWN_CHIP_88E) + return (0); + reg = urtwn_read_4(sc, R92C_SYS_CFG); if (reg & R92C_SYS_CFG_TRP_VAUX_EN) return (EIO); @@ -1228,8 +1286,70 @@ urtwn_read_rom(struct urtwn_softc *sc) sc->regulatory = MS(rom->rf_opt1, R92C_ROM_RF1_REGULATORY); DPRINTF("regulatory type=%d\n", sc->regulatory); - IEEE80211_ADDR_COPY(sc->sc_bssid, rom->macaddr); + + sc->sc_rf_write = urtwn_r92c_rf_write; + sc->sc_power_on = urtwn_r92c_power_on; + sc->sc_dma_init = urtwn_r92c_dma_init; +} + +static void +urtwn_r88e_read_rom(struct urtwn_softc *sc) +{ + uint8_t *rom = sc->r88e_rom; + uint16_t addr = 0; + uint32_t reg; + uint8_t off, msk, tmp; + int i; + + off = 0; + urtwn_efuse_switch_power(sc); + + /* Read full ROM image. */ + memset(&sc->r88e_rom, 0xff, sizeof(sc->r88e_rom)); + while (addr < 1024) { + reg = urtwn_efuse_read_1(sc, addr); + if (reg == 0xff) + break; + addr++; + if ((reg & 0x1f) == 0x0f) { + tmp = (reg & 0xe0) >> 5; + reg = urtwn_efuse_read_1(sc, addr); + if ((reg & 0x0f) != 0x0f) + off = ((reg & 0xf0) >> 1) | tmp; + addr++; + } else + off = reg >> 4; + msk = reg & 0xf; + for (i = 0; i < 4; i++) { + if (msk & (1 << i)) + continue; + rom[off * 8 + i * 2 + 0] = + urtwn_efuse_read_1(sc, addr); + addr++; + rom[off * 8 + i * 2 + 1] = + urtwn_efuse_read_1(sc, addr); + addr++; + } + } + + addr = 0x10; + for (i = 0; i < 6; i++) + sc->cck_tx_pwr[i] = sc->r88e_rom[addr++]; + for (i = 0; i < 5; i++) + sc->ht40_tx_pwr[i] = sc->r88e_rom[addr++]; + sc->bw20_tx_pwr_diff = (sc->r88e_rom[addr] & 0xf0) >> 4; + if (sc->bw20_tx_pwr_diff & 0x08) + sc->bw20_tx_pwr_diff |= 0xf0; + sc->ofdm_tx_pwr_diff = (sc->r88e_rom[addr] & 0xf); + if (sc->ofdm_tx_pwr_diff & 0x08) + sc->ofdm_tx_pwr_diff |= 0xf0; + sc->regulatory = MS(sc->r88e_rom[0xc1], R92C_ROM_RF1_REGULATORY); + IEEE80211_ADDR_COPY(sc->sc_bssid, &sc->r88e_rom[0xd7]); + + sc->sc_rf_write = urtwn_r88e_rf_write; + sc->sc_power_on = urtwn_r88e_power_on; + sc->sc_dma_init = urtwn_r88e_dma_init; } /* @@ -1347,13 +1467,26 @@ static void urtwn_set_led(struct urtwn_softc *sc, int led, int on) { uint8_t reg; - + if (led == URTWN_LED_LINK) { - reg = urtwn_read_1(sc, R92C_LEDCFG0) & 0x70; - if (!on) - reg |= R92C_LEDCFG0_DIS; - urtwn_write_1(sc, R92C_LEDCFG0, reg); - sc->ledlink = on; /* Save LED state. */ + if (sc->chip & URTWN_CHIP_88E) { + reg = urtwn_read_1(sc, R92C_LEDCFG2) & 0xf0; + urtwn_write_1(sc, R92C_LEDCFG2, reg | 0x60); + if (!on) { + reg = urtwn_read_1(sc, R92C_LEDCFG2) & 0x90; + urtwn_write_1(sc, R92C_LEDCFG2, + reg | R92C_LEDCFG0_DIS); + urtwn_write_1(sc, R92C_MAC_PINMUX_CFG, + urtwn_read_1(sc, R92C_MAC_PINMUX_CFG) & + 0xfe); + } + } else { + reg = urtwn_read_1(sc, R92C_LEDCFG0) & 0x70; + if (!on) + reg |= R92C_LEDCFG0_DIS; + urtwn_write_1(sc, R92C_LEDCFG0, reg); + } + sc->ledlink = on; /* Save LED state. */ } } @@ -1419,11 +1552,12 @@ urtwn_newstate(struct ieee80211vap *vap, reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); - reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); - urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); + if (!(sc->chip & URTWN_CHIP_88E)) { + reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); + reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); + urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); + } } - /* Make link LED blink during scan. */ urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink); @@ -1439,10 +1573,11 @@ urtwn_newstate(struct ieee80211vap *vap, reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); - reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); - urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); - + if (!(sc->chip & URTWN_CHIP_88E)) { + reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); + reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); + urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); + } urtwn_set_chan(sc, ic->ic_curchan, NULL); break; case IEEE80211_S_RUN: @@ -1495,7 +1630,11 @@ urtwn_newstate(struct ieee80211vap *vap, urtwn_write_1(sc, R92C_T2T_SIFS + 1, 10); /* Intialize rate adaptation. */ - urtwn_ra_init(sc); + if (sc->chip & URTWN_CHIP_88E) + ni->ni_txrate = + ni->ni_rates.rs_rates[ni->ni_rates.rs_nrates-1]; + else + urtwn_ra_init(sc); /* Turn link LED on. */ urtwn_set_led(sc, URTWN_LED_LINK, 1); @@ -1541,19 +1680,21 @@ urtwn_update_avgrssi(struct urtwn_softc pwdb = 100; else pwdb = 100 + rssi; - if (rate <= 3) { - /* CCK gain is smaller than OFDM/MCS gain. */ - pwdb += 6; - if (pwdb > 100) - pwdb = 100; - if (pwdb <= 14) - pwdb -= 4; - else if (pwdb <= 26) - pwdb -= 8; - else if (pwdb <= 34) - pwdb -= 6; - else if (pwdb <= 42) - pwdb -= 2; + if (!(sc->chip & URTWN_CHIP_88E)) { + if (rate <= 3) { + /* CCK gain is smaller than OFDM/MCS gain. */ + pwdb += 6; + if (pwdb > 100) + pwdb = 100; + if (pwdb <= 14) + pwdb -= 4; + else if (pwdb <= 26) + pwdb -= 8; + else if (pwdb <= 34) + pwdb -= 6; + else if (pwdb <= 42) + pwdb -= 2; + } } if (sc->avg_pwdb == -1) /* Init. */ sc->avg_pwdb = pwdb; @@ -1590,6 +1731,58 @@ urtwn_get_rssi(struct urtwn_softc *sc, i return (rssi); } +static int8_t +urtwn_r88e_get_rssi(struct urtwn_softc *sc, int rate, void *physt) +{ + struct r92c_rx_phystat *phy; + struct r88e_rx_cck *cck; + uint8_t cck_agc_rpt, lna_idx, vga_idx; + int8_t rssi; + + rssi = 0; + if (rate <= 3) { + cck = (struct r88e_rx_cck *)physt; + cck_agc_rpt = cck->agc_rpt; + lna_idx = (cck_agc_rpt & 0xe0) >> 5; + vga_idx = cck_agc_rpt & 0x1f; + switch (lna_idx) { + case 7: + if (vga_idx <= 27) + rssi = -100 + 2* (27 - vga_idx); + else + rssi = -100; + break; + case 6: + rssi = -48 + 2 * (2 - vga_idx); + break; + case 5: + rssi = -42 + 2 * (7 - vga_idx); + break; + case 4: + rssi = -36 + 2 * (7 - vga_idx); + break; + case 3: + rssi = -24 + 2 * (7 - vga_idx); + break; + case 2: + rssi = -12 + 2 * (5 - vga_idx); + break; + case 1: + rssi = 8 - (2 * vga_idx); + break; + case 0: + rssi = 14 - (2 * vga_idx); + break; + } + rssi += 6; + } else { /* OFDM/HT. */ + phy = (struct r92c_rx_phystat *)physt; + rssi = ((le32toh(phy->phydw1) >> 1) & 0x7f) - 110; + } + return (rssi); +} + + static int urtwn_tx_start(struct urtwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, struct urtwn_data *data) @@ -1617,6 +1810,8 @@ urtwn_tx_start(struct urtwn_softc *sc, s * Software crypto. */ wh = mtod(m0, struct ieee80211_frame *); + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { @@ -1631,7 +1826,7 @@ urtwn_tx_start(struct urtwn_softc *sc, s wh = mtod(m0, struct ieee80211_frame *); } - switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) { + switch (type) { case IEEE80211_FC0_TYPE_CTL: case IEEE80211_FC0_TYPE_MGT: xfer = sc->sc_xfer[URTWN_BULK_TX_VO]; @@ -1655,20 +1850,24 @@ urtwn_tx_start(struct urtwn_softc *sc, s R92C_TXDW0_OWN | R92C_TXDW0_FSG | R92C_TXDW0_LSG); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) txd->txdw0 |= htole32(R92C_TXDW0_BMCAST); - - type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; if (!IEEE80211_IS_MULTICAST(wh->i_addr1) && type == IEEE80211_FC0_TYPE_DATA) { if (ic->ic_curmode == IEEE80211_MODE_11B) raid = R92C_RAID_11B; else raid = R92C_RAID_11BG; - txd->txdw1 |= htole32( - SM(R92C_TXDW1_MACID, URTWN_MACID_BSS) | - SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BE) | - SM(R92C_TXDW1_RAID, raid) | - R92C_TXDW1_AGGBK); - + if (sc->chip & URTWN_CHIP_88E) { + txd->txdw1 |= htole32( + SM(R88E_TXDW1_MACID, URTWN_MACID_BSS) | *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 09:29:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BFE6B345; Fri, 23 May 2014 09:29: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 929F42621; Fri, 23 May 2014 09:29: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 s4N9T5Uh033853; Fri, 23 May 2014 09:29:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N9T5UN033850; Fri, 23 May 2014 09:29:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405230929.s4N9T5UN033850@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 23 May 2014 09:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266582 - in stable/10/sys: kern sys vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 09:29:05 -0000 Author: kib Date: Fri May 23 09:29:04 2014 New Revision: 266582 URL: http://svnweb.freebsd.org/changeset/base/266582 Log: MFC r266464: In execve(2), postpone the free of old vmspace until the threads are resumed and exited. Modified: stable/10/sys/kern/kern_exec.c stable/10/sys/sys/proc.h stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Fri May 23 08:46:28 2014 (r266581) +++ stable/10/sys/kern/kern_exec.c Fri May 23 09:29:04 2014 (r266582) @@ -283,6 +283,7 @@ kern_execve(td, args, mac_p) struct mac *mac_p; { struct proc *p = td->td_proc; + struct vmspace *oldvmspace; int error; AUDIT_ARG_ARGV(args->begin_argv, args->argc, @@ -299,6 +300,8 @@ kern_execve(td, args, mac_p) PROC_UNLOCK(p); } + KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve")); + oldvmspace = td->td_proc->p_vmspace; error = do_execve(td, args, mac_p); if (p->p_flag & P_HADTHREADS) { @@ -313,6 +316,12 @@ kern_execve(td, args, mac_p) thread_single_end(); PROC_UNLOCK(p); } + if ((td->td_pflags & TDP_EXECVMSPC) != 0) { + KASSERT(td->td_proc->p_vmspace != oldvmspace, + ("oldvmspace still used")); + vmspace_free(oldvmspace); + td->td_pflags &= ~TDP_EXECVMSPC; + } return (error); } Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Fri May 23 08:46:28 2014 (r266581) +++ stable/10/sys/sys/proc.h Fri May 23 09:29:04 2014 (r266582) @@ -425,6 +425,7 @@ do { \ #define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ #define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ #define TDP_DEVMEMIO 0x20000000 /* Accessing memory for /dev/mem */ +#define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */ /* * Reasons that the current thread can not be run yet. Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Fri May 23 08:46:28 2014 (r266581) +++ stable/10/sys/vm/vm_map.c Fri May 23 09:29:04 2014 (r266582) @@ -3751,6 +3751,8 @@ vmspace_exec(struct proc *p, vm_offset_t struct vmspace *oldvmspace = p->p_vmspace; struct vmspace *newvmspace; + KASSERT((curthread->td_pflags & TDP_EXECVMSPC) == 0, + ("vmspace_exec recursed")); newvmspace = vmspace_alloc(minuser, maxuser, NULL); if (newvmspace == NULL) return (ENOMEM); @@ -3767,7 +3769,7 @@ vmspace_exec(struct proc *p, vm_offset_t PROC_VMSPACE_UNLOCK(p); if (p == curthread->td_proc) pmap_activate(curthread); - vmspace_free(oldvmspace); + curthread->td_pflags |= TDP_EXECVMSPC; return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 16:46:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 69A959B9; Fri, 23 May 2014 16:46: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 4AA212FED; Fri, 23 May 2014 16:46: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 s4NGkpVI033940; Fri, 23 May 2014 16:46:51 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NGkpHk033939; Fri, 23 May 2014 16:46:51 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405231646.s4NGkpHk033939@svn.freebsd.org> From: Alan Cox Date: Fri, 23 May 2014 16:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266589 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 16:46:51 -0000 Author: alc Date: Fri May 23 16:46:50 2014 New Revision: 266589 URL: http://svnweb.freebsd.org/changeset/base/266589 Log: MFC r265886, r265948 With the new-and-improved vm_fault_copy_entry() (r265843), we can always avoid soft page faults when adding write access to user wired entries in vm_map_protect(). Previously, we only avoided the soft page fault when the underlying pages were copy-on-write. In other words, we avoided the pages faults that might sleep on page allocation, but not the trivial page faults to update the physical map. On a fork allow read-only wired pages to be copy-on-write shared between the parent and child processes. Previously, we copied these pages even though they are read only. However, the reason for copying them is historical and no longer exists. In recent times, vm_map_protect() has developed the ability to copy pages when write access is added to wired copy-on-write pages. So, in this case, copy-on-write sharing of wired pages is not to be feared. It is not going to lead to copy-on-write faults on wired memory. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Fri May 23 16:22:36 2014 (r266588) +++ stable/10/sys/vm/vm_map.c Fri May 23 16:46:50 2014 (r266589) @@ -1978,10 +1978,17 @@ vm_map_protect(vm_map_t map, vm_offset_t else current->protection = new_prot; - if ((current->eflags & (MAP_ENTRY_COW | MAP_ENTRY_USER_WIRED)) - == (MAP_ENTRY_COW | MAP_ENTRY_USER_WIRED) && + /* + * For user wired map entries, the normal lazy evaluation of + * write access upgrades through soft page faults is + * undesirable. Instead, immediately copy any pages that are + * copy-on-write and enable write access in the physical map. + */ + if ((current->eflags & MAP_ENTRY_USER_WIRED) != 0 && (current->protection & VM_PROT_WRITE) != 0 && (old_prot & VM_PROT_WRITE) == 0) { + KASSERT(old_prot != VM_PROT_NONE, + ("vm_map_protect: inaccessible wired map entry")); vm_fault_copy_entry(map, map, current, current, NULL); } @@ -3017,8 +3024,8 @@ vm_map_copy_entry( if ((dst_entry->eflags|src_entry->eflags) & MAP_ENTRY_IS_SUB_MAP) return; - if (src_entry->wired_count == 0) { - + if (src_entry->wired_count == 0 || + (src_entry->protection & VM_PROT_WRITE) == 0) { /* * If the source entry is marked needs_copy, it is already * write-protected. @@ -3109,9 +3116,9 @@ vm_map_copy_entry( dst_entry->end - dst_entry->start, src_entry->start); } else { /* - * Of course, wired down pages can't be set copy-on-write. - * Cause wired pages to be copied into the new map by - * simulating faults (the new pages are pageable) + * We don't want to make writeable wired pages copy-on-write. + * Immediately copy these pages into the new map by simulating + * page faults. The new pages are pageable. */ vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry, fork_charge); From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 17:46:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DAC8A7E0; Fri, 23 May 2014 17:46: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 C7ECC2576; Fri, 23 May 2014 17:46: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 s4NHk0TN062035; Fri, 23 May 2014 17:46:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NHk0iJ062034; Fri, 23 May 2014 17:46:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405231746.s4NHk0iJ062034@svn.freebsd.org> From: Ed Maste Date: Fri, 23 May 2014 17:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266590 - stable/10/usr.sbin/pmcstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 17:46:01 -0000 Author: emaste Date: Fri May 23 17:46:00 2014 New Revision: 266590 URL: http://svnweb.freebsd.org/changeset/base/266590 Log: MFC r266208: Speed up pmcstat by improving string hash In one case generating callgraph output from a 24MB system-wide sampling data file took 17.4 seconds on average. Profiling showed pmcstat spending a lot of time in strcmp, due to hash collisions. Replacing the XOR-only hash with FNV-1a reduces the run time for my test by 40%. Modified: stable/10/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat_log.c Fri May 23 16:46:50 2014 (r266589) +++ stable/10/usr.sbin/pmcstat/pmcstat_log.c Fri May 23 17:46:00 2014 (r266590) @@ -307,10 +307,10 @@ pmcstat_stats_reset(int reset_global) static int pmcstat_string_compute_hash(const char *s) { - int hash; + unsigned hash; - for (hash = 0; *s; s++) - hash ^= *s; + for (hash = 2166136261; *s; s++) + hash = (hash ^ *s) * 16777619; return (hash & PMCSTAT_HASH_MASK); } From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 17:47:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2287F9DC; Fri, 23 May 2014 17:47: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 E74FB2592; Fri, 23 May 2014 17:47: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 s4NHlnGS062313; Fri, 23 May 2014 17:47:49 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NHlnKr062310; Fri, 23 May 2014 17:47:49 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405231747.s4NHlnKr062310@svn.freebsd.org> From: Alan Cox Date: Fri, 23 May 2014 17:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266591 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 17:47:50 -0000 Author: alc Date: Fri May 23 17:47:49 2014 New Revision: 266591 URL: http://svnweb.freebsd.org/changeset/base/266591 Log: MFC r259107 Eliminate a redundant parameter to vm_radix_replace(). Improve the wording of the comment describing vm_radix_replace(). Modified: stable/10/sys/vm/vm_page.c stable/10/sys/vm/vm_radix.c stable/10/sys/vm/vm_radix.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_page.c ============================================================================== --- stable/10/sys/vm/vm_page.c Fri May 23 17:46:00 2014 (r266590) +++ stable/10/sys/vm/vm_page.c Fri May 23 17:47:49 2014 (r266591) @@ -1200,7 +1200,7 @@ vm_page_replace(vm_page_t mnew, vm_objec mnew->object = object; mnew->pindex = pindex; - mold = vm_radix_replace(&object->rtree, mnew, pindex); + mold = vm_radix_replace(&object->rtree, mnew); KASSERT(mold->queue == PQ_NONE, ("vm_page_replace: mold is on a paging queue")); Modified: stable/10/sys/vm/vm_radix.c ============================================================================== --- stable/10/sys/vm/vm_radix.c Fri May 23 17:46:00 2014 (r266590) +++ stable/10/sys/vm/vm_radix.c Fri May 23 17:47:49 2014 (r266591) @@ -788,20 +788,18 @@ vm_radix_reclaim_allnodes(struct vm_radi } /* - * Replace an existing page into the trie with another one. - * Panics if the replacing page is not present or if the new page has an - * invalid key. + * Replace an existing page in the trie with another one. + * Panics if there is not an old page in the trie at the new page's index. */ vm_page_t -vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage, vm_pindex_t index) +vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage) { struct vm_radix_node *rnode; vm_page_t m; + vm_pindex_t index; int slot; - KASSERT(newpage->pindex == index, ("%s: newpage index invalid", - __func__)); - + index = newpage->pindex; rnode = vm_radix_getroot(rtree); if (rnode == NULL) panic("%s: replacing page on an empty trie", __func__); Modified: stable/10/sys/vm/vm_radix.h ============================================================================== --- stable/10/sys/vm/vm_radix.h Fri May 23 17:46:00 2014 (r266590) +++ stable/10/sys/vm/vm_radix.h Fri May 23 17:47:49 2014 (r266591) @@ -43,8 +43,7 @@ vm_page_t vm_radix_lookup_ge(struct vm_r vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index); void vm_radix_reclaim_allnodes(struct vm_radix *rtree); void vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index); -vm_page_t vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage, - vm_pindex_t index); +vm_page_t vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage); #endif /* _KERNEL */ #endif /* !_VM_RADIX_H_ */ From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 19:06:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 80161AFD; Fri, 23 May 2014 19:06: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 6CF3B2CD4; Fri, 23 May 2014 19:06: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 s4NJ6aQB098553; Fri, 23 May 2014 19:06:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NJ6a9Z098552; Fri, 23 May 2014 19:06:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405231906.s4NJ6a9Z098552@svn.freebsd.org> From: John Baldwin Date: Fri, 23 May 2014 19:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266592 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 19:06:36 -0000 Author: jhb Date: Fri May 23 19:06:35 2014 New Revision: 266592 URL: http://svnweb.freebsd.org/changeset/base/266592 Log: MFC 260469: Fix issue with the virtio descriptor region being truncated if it was above 4GB. Modified: stable/10/usr.sbin/bhyve/virtio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/virtio.c ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.c Fri May 23 17:47:49 2014 (r266591) +++ stable/10/usr.sbin/bhyve/virtio.c Fri May 23 19:06:35 2014 (r266592) @@ -160,7 +160,7 @@ vi_vq_init(struct virtio_softc *vs, uint vq = &vs->vs_queues[vs->vs_curq]; vq->vq_pfn = pfn; - phys = pfn << VRING_PFN; + phys = (uint64_t)pfn << VRING_PFN; size = vring_size(vq->vq_qsize); base = paddr_guest2host(vs->vs_pi->pi_vmctx, phys, size); From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 19:39:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 990E826C; Fri, 23 May 2014 19:39: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 79FD72F3A; Fri, 23 May 2014 19: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 s4NJdxrY012662; Fri, 23 May 2014 19:39:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NJdwxt012656; Fri, 23 May 2014 19:39:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405231939.s4NJdwxt012656@svn.freebsd.org> From: John Baldwin Date: Fri, 23 May 2014 19:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266593 - in stable/10/sys/amd64/vmm: . intel X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 19:39:59 -0000 Author: jhb Date: Fri May 23 19:39:58 2014 New Revision: 266593 URL: http://svnweb.freebsd.org/changeset/base/266593 Log: MFC 260802,260836,260863,261001,261074,261617: Various fixes for NMI and interrupt injection. - If a VM-exit happens during an NMI injection then clear the "NMI Blocking" bit in the Guest Interruptibility-state VMCS field. - If the guest exits due to a fault while it is executing IRET then restore the state of "Virtual NMI blocking" in the guest's interruptibility-state field before resuming the guest. - Inject a pending NMI only if NMI_BLOCKING, MOVSS_BLOCKING, STI_BLOCKING are all clear. If any of these bits are set then enable "NMI window exiting" and inject the NMI in the VM-exit handler. - Handle a VM-exit due to a NMI properly by vectoring to the host's NMI handler via a software interrupt. - Set "Interrupt Window Exiting" in the case where there is a vector to be injected into the vcpu but the VM-entry interruption information field already has the valid bit set. - For VM-exits due to an NMI, handle the NMI with interrupts disabled in addition to "blocking by NMI" already established by the VM-exit. Modified: stable/10/sys/amd64/vmm/intel/vmcs.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/vmm_stat.c stable/10/sys/amd64/vmm/vmm_stat.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.h Fri May 23 19:06:35 2014 (r266592) +++ stable/10/sys/amd64/vmm/intel/vmcs.h Fri May 23 19:39:58 2014 (r266593) @@ -333,12 +333,18 @@ vmcs_write(uint32_t encoding, uint64_t v #define EXIT_REASON_APIC_WRITE 56 /* + * NMI unblocking due to IRET. + * + * Applies to VM-exits due to hardware exception or EPT fault. + */ +#define EXIT_QUAL_NMIUDTI (1 << 12) +/* * VMCS interrupt information fields */ -#define VMCS_INTR_INFO_VALID (1U << 31) -#define VMCS_INTR_INFO_TYPE(info) (((info) >> 8) & 0x7) -#define VMCS_INTR_INFO_HW_INTR (0 << 8) -#define VMCS_INTR_INFO_NMI (2 << 8) +#define VMCS_INTR_VALID (1U << 31) +#define VMCS_INTR_T_MASK 0x700 /* Interruption-info type */ +#define VMCS_INTR_T_HWINTR (0 << 8) +#define VMCS_INTR_T_NMI (2 << 8) /* * VMCS IDT-Vectoring information fields Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Fri May 23 19:06:35 2014 (r266592) +++ stable/10/sys/amd64/vmm/intel/vmx.c Fri May 23 19:39:58 2014 (r266593) @@ -147,21 +147,6 @@ SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, initia &vmx_initialized, 0, "Intel VMX initialized"); /* - * Virtual NMI blocking conditions. - * - * Some processor implementations also require NMI to be blocked if - * the STI_BLOCKING bit is set. It is possible to detect this at runtime - * based on the (exit_reason,exit_qual) tuple being set to - * (EXIT_REASON_INVAL_VMCS, EXIT_QUAL_NMI_WHILE_STI_BLOCKING). - * - * We take the easy way out and also include STI_BLOCKING as one of the - * gating items for vNMI injection. - */ -static uint64_t nmi_blocking_bits = VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING | - VMCS_INTERRUPTIBILITY_NMI_BLOCKING | - VMCS_INTERRUPTIBILITY_STI_BLOCKING; - -/* * Optional capabilities */ static int cap_halt_exit; @@ -1031,121 +1016,168 @@ static void __inline vmx_set_int_window_exiting(struct vmx *vmx, int vcpu) { - vmx->cap[vcpu].proc_ctls |= PROCBASED_INT_WINDOW_EXITING; - vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + if ((vmx->cap[vcpu].proc_ctls & PROCBASED_INT_WINDOW_EXITING) == 0) { + vmx->cap[vcpu].proc_ctls |= PROCBASED_INT_WINDOW_EXITING; + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + VCPU_CTR0(vmx->vm, vcpu, "Enabling interrupt window exiting"); + } } static void __inline vmx_clear_int_window_exiting(struct vmx *vmx, int vcpu) { + KASSERT((vmx->cap[vcpu].proc_ctls & PROCBASED_INT_WINDOW_EXITING) != 0, + ("intr_window_exiting not set: %#x", vmx->cap[vcpu].proc_ctls)); vmx->cap[vcpu].proc_ctls &= ~PROCBASED_INT_WINDOW_EXITING; vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + VCPU_CTR0(vmx->vm, vcpu, "Disabling interrupt window exiting"); } static void __inline vmx_set_nmi_window_exiting(struct vmx *vmx, int vcpu) { - vmx->cap[vcpu].proc_ctls |= PROCBASED_NMI_WINDOW_EXITING; - vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + if ((vmx->cap[vcpu].proc_ctls & PROCBASED_NMI_WINDOW_EXITING) == 0) { + vmx->cap[vcpu].proc_ctls |= PROCBASED_NMI_WINDOW_EXITING; + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + VCPU_CTR0(vmx->vm, vcpu, "Enabling NMI window exiting"); + } } static void __inline vmx_clear_nmi_window_exiting(struct vmx *vmx, int vcpu) { + KASSERT((vmx->cap[vcpu].proc_ctls & PROCBASED_NMI_WINDOW_EXITING) != 0, + ("nmi_window_exiting not set %#x", vmx->cap[vcpu].proc_ctls)); vmx->cap[vcpu].proc_ctls &= ~PROCBASED_NMI_WINDOW_EXITING; vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); + VCPU_CTR0(vmx->vm, vcpu, "Disabling NMI window exiting"); } -static int +#define NMI_BLOCKING (VMCS_INTERRUPTIBILITY_NMI_BLOCKING | \ + VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING) +#define HWINTR_BLOCKING (VMCS_INTERRUPTIBILITY_STI_BLOCKING | \ + VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING) + +static void vmx_inject_nmi(struct vmx *vmx, int vcpu) { - uint64_t info, interruptibility; + uint32_t gi, info; - /* Bail out if no NMI requested */ - if (!vm_nmi_pending(vmx->vm, vcpu)) - return (0); + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); + KASSERT((gi & NMI_BLOCKING) == 0, ("vmx_inject_nmi: invalid guest " + "interruptibility-state %#x", gi)); - interruptibility = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); - if (interruptibility & nmi_blocking_bits) - goto nmiblocked; + info = vmcs_read(VMCS_ENTRY_INTR_INFO); + KASSERT((info & VMCS_INTR_VALID) == 0, ("vmx_inject_nmi: invalid " + "VM-entry interruption information %#x", info)); /* * Inject the virtual NMI. The vector must be the NMI IDT entry * or the VMCS entry check will fail. */ - info = VMCS_INTR_INFO_NMI | VMCS_INTR_INFO_VALID; - info |= IDT_NMI; + info = IDT_NMI | VMCS_INTR_T_NMI | VMCS_INTR_VALID; vmcs_write(VMCS_ENTRY_INTR_INFO, info); VCPU_CTR0(vmx->vm, vcpu, "Injecting vNMI"); /* Clear the request */ vm_nmi_clear(vmx->vm, vcpu); - return (1); - -nmiblocked: - /* - * Set the NMI Window Exiting execution control so we can inject - * the virtual NMI as soon as blocking condition goes away. - */ - vmx_set_nmi_window_exiting(vmx, vcpu); - - VCPU_CTR0(vmx->vm, vcpu, "Enabling NMI window exiting"); - return (1); } static void vmx_inject_interrupts(struct vmx *vmx, int vcpu, struct vlapic *vlapic) { - int vector; - uint64_t info, rflags, interruptibility; + int vector, need_nmi_exiting; + uint64_t rflags; + uint32_t gi, info; - const int HWINTR_BLOCKED = VMCS_INTERRUPTIBILITY_STI_BLOCKING | - VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING; - - /* - * If there is already an interrupt pending then just return. - * - * This could happen if an interrupt was injected on a prior - * VM entry but the actual entry into guest mode was aborted - * because of a pending AST. - */ - info = vmcs_read(VMCS_ENTRY_INTR_INFO); - if (info & VMCS_INTR_INFO_VALID) - return; + if (vm_nmi_pending(vmx->vm, vcpu)) { + /* + * If there are no conditions blocking NMI injection then + * inject it directly here otherwise enable "NMI window + * exiting" to inject it as soon as we can. + * + * We also check for STI_BLOCKING because some implementations + * don't allow NMI injection in this case. If we are running + * on a processor that doesn't have this restriction it will + * immediately exit and the NMI will be injected in the + * "NMI window exiting" handler. + */ + need_nmi_exiting = 1; + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); + if ((gi & (HWINTR_BLOCKING | NMI_BLOCKING)) == 0) { + info = vmcs_read(VMCS_ENTRY_INTR_INFO); + if ((info & VMCS_INTR_VALID) == 0) { + vmx_inject_nmi(vmx, vcpu); + need_nmi_exiting = 0; + } else { + VCPU_CTR1(vmx->vm, vcpu, "Cannot inject NMI " + "due to VM-entry intr info %#x", info); + } + } else { + VCPU_CTR1(vmx->vm, vcpu, "Cannot inject NMI due to " + "Guest Interruptibility-state %#x", gi); + } - /* - * NMI injection has priority so deal with those first - */ - if (vmx_inject_nmi(vmx, vcpu)) - return; + if (need_nmi_exiting) + vmx_set_nmi_window_exiting(vmx, vcpu); + } if (virtual_interrupt_delivery) { vmx_inject_pir(vlapic); return; } + /* + * If interrupt-window exiting is already in effect then don't bother + * checking for pending interrupts. This is just an optimization and + * not needed for correctness. + */ + if ((vmx->cap[vcpu].proc_ctls & PROCBASED_INT_WINDOW_EXITING) != 0) { + VCPU_CTR0(vmx->vm, vcpu, "Skip interrupt injection due to " + "pending int_window_exiting"); + return; + } + /* Ask the local apic for a vector to inject */ if (!vlapic_pending_intr(vlapic, &vector)) return; - if (vector < 32 || vector > 255) - panic("vmx_inject_interrupts: invalid vector %d\n", vector); + KASSERT(vector >= 32 && vector <= 255, ("invalid vector %d", vector)); /* Check RFLAGS.IF and the interruptibility state of the guest */ rflags = vmcs_read(VMCS_GUEST_RFLAGS); - if ((rflags & PSL_I) == 0) + if ((rflags & PSL_I) == 0) { + VCPU_CTR2(vmx->vm, vcpu, "Cannot inject vector %d due to " + "rflags %#lx", vector, rflags); goto cantinject; + } - interruptibility = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); - if (interruptibility & HWINTR_BLOCKED) + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); + if (gi & HWINTR_BLOCKING) { + VCPU_CTR2(vmx->vm, vcpu, "Cannot inject vector %d due to " + "Guest Interruptibility-state %#x", vector, gi); goto cantinject; + } + + info = vmcs_read(VMCS_ENTRY_INTR_INFO); + if (info & VMCS_INTR_VALID) { + /* + * This is expected and could happen for multiple reasons: + * - A vectoring VM-entry was aborted due to astpending + * - A VM-exit happened during event injection. + * - An NMI was injected above or after "NMI window exiting" + */ + VCPU_CTR2(vmx->vm, vcpu, "Cannot inject vector %d due to " + "VM-entry intr info %#x", vector, info); + goto cantinject; + } /* Inject the interrupt */ - info = VMCS_INTR_INFO_HW_INTR | VMCS_INTR_INFO_VALID; + info = VMCS_INTR_T_HWINTR | VMCS_INTR_VALID; info |= vector; vmcs_write(VMCS_ENTRY_INTR_INFO, info); @@ -1162,8 +1194,37 @@ cantinject: * the interrupt as soon as blocking condition goes away. */ vmx_set_int_window_exiting(vmx, vcpu); +} + +/* + * If the Virtual NMIs execution control is '1' then the logical processor + * tracks virtual-NMI blocking in the Guest Interruptibility-state field of + * the VMCS. An IRET instruction in VMX non-root operation will remove any + * virtual-NMI blocking. + * + * This unblocking occurs even if the IRET causes a fault. In this case the + * hypervisor needs to restore virtual-NMI blocking before resuming the guest. + */ +static void +vmx_restore_nmi_blocking(struct vmx *vmx, int vcpuid) +{ + uint32_t gi; + + VCPU_CTR0(vmx->vm, vcpuid, "Restore Virtual-NMI blocking"); + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); + gi |= VMCS_INTERRUPTIBILITY_NMI_BLOCKING; + vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); +} + +static void +vmx_clear_nmi_blocking(struct vmx *vmx, int vcpuid) +{ + uint32_t gi; - VCPU_CTR0(vmx->vm, vcpu, "Enabling interrupt window exiting"); + VCPU_CTR0(vmx->vm, vcpuid, "Clear Virtual-NMI blocking"); + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); + gi &= ~VMCS_INTERRUPTIBILITY_NMI_BLOCKING; + vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); } static int @@ -1458,6 +1519,9 @@ vmx_exit_process(struct vmx *vmx, int vc uint64_t qual, gpa; bool retu; + CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); + CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_NMI_EXITING) != 0); + handled = 0; vmxctx = &vmx->ctx[vcpu]; @@ -1490,9 +1554,20 @@ vmx_exit_process(struct vmx *vmx, int vc 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); + } vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); } default: + idtvec_info = 0; break; } @@ -1553,7 +1628,6 @@ vmx_exit_process(struct vmx *vmx, int vc case EXIT_REASON_INTR_WINDOW: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INTR_WINDOW, 1); vmx_clear_int_window_exiting(vmx, vcpu); - VCPU_CTR0(vmx->vm, vcpu, "Disabling interrupt window exiting"); return (1); case EXIT_REASON_EXT_INTR: /* @@ -1566,8 +1640,8 @@ vmx_exit_process(struct vmx *vmx, int vc * this virtual interrupt during the subsequent VM enter. */ intr_info = vmcs_read(VMCS_EXIT_INTR_INFO); - KASSERT((intr_info & VMCS_INTR_INFO_VALID) != 0 && - VMCS_INTR_INFO_TYPE(intr_info) == 0, + KASSERT((intr_info & VMCS_INTR_VALID) != 0 && + (intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_HWINTR, ("VM exit interruption info invalid: %#x", intr_info)); vmx_trigger_hostintr(intr_info & 0xff); @@ -1579,9 +1653,10 @@ vmx_exit_process(struct vmx *vmx, int vc return (1); case EXIT_REASON_NMI_WINDOW: /* Exit to allow the pending virtual NMI to be injected */ - vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NMI_WINDOW, 1); + if (vm_nmi_pending(vmx->vm, vcpu)) + vmx_inject_nmi(vmx, vcpu); vmx_clear_nmi_window_exiting(vmx, vcpu); - VCPU_CTR0(vmx->vm, vcpu, "Disabling NMI window exiting"); + vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NMI_WINDOW, 1); return (1); case EXIT_REASON_INOUT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INOUT, 1); @@ -1597,6 +1672,31 @@ vmx_exit_process(struct vmx *vmx, int vc vmm_stat_incr(vmx->vm, vcpu, VMEXIT_CPUID, 1); handled = vmx_handle_cpuid(vmx->vm, vcpu, vmxctx); break; + case EXIT_REASON_EXCEPTION: + vmm_stat_incr(vmx->vm, vcpu, VMEXIT_EXCEPTION, 1); + intr_info = vmcs_read(VMCS_EXIT_INTR_INFO); + KASSERT((intr_info & VMCS_INTR_VALID) != 0, + ("VM exit interruption info invalid: %#x", intr_info)); + + /* + * If Virtual NMIs control is 1 and the VM-exit is due to a + * fault encountered during the execution of IRET then we must + * restore the state of "virtual-NMI blocking" before resuming + * the guest. + * + * See "Resuming Guest Software after Handling an Exception". + */ + if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && + (intr_info & 0xff) != IDT_DF && + (intr_info & EXIT_QUAL_NMIUDTI) != 0) + vmx_restore_nmi_blocking(vmx, vcpu); + + /* + * The NMI has already been handled in vmx_exit_handle_nmi(). + */ + if ((intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_NMI) + return (1); + break; case EXIT_REASON_EPT_FAULT: /* * If 'gpa' lies within the address space allocated to @@ -1616,6 +1716,17 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INST_EMUL, 1); } + /* + * If Virtual NMIs control is 1 and the VM-exit is due to an + * EPT fault during the execution of IRET then we must restore + * the state of "virtual-NMI blocking" before resuming. + * + * See description of "NMI unblocking due to IRET" in + * "Exit Qualification for EPT Violations". + */ + if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && + (qual & EXIT_QUAL_NMIUDTI) != 0) + vmx_restore_nmi_blocking(vmx, vcpu); break; case EXIT_REASON_VIRTUALIZED_EOI: vmexit->exitcode = VM_EXITCODE_IOAPIC_EOI; @@ -1661,6 +1772,8 @@ vmx_exit_process(struct vmx *vmx, int vc */ vmexit->exitcode = VM_EXITCODE_VMX; vmexit->u.vmx.status = VM_SUCCESS; + vmexit->u.vmx.inst_type = 0; + vmexit->u.vmx.inst_error = 0; } else { /* * The exitcode and collateral have been populated. @@ -1724,6 +1837,36 @@ vmx_exit_inst_error(struct vmxctx *vmxct return (UNHANDLED); } +/* + * If the NMI-exiting VM execution control is set to '1' then an NMI in + * non-root operation causes a VM-exit. NMI blocking is in effect so it is + * sufficient to simply vector to the NMI handler via a software interrupt. + * However, this must be done before maskable interrupts are enabled + * otherwise the "iret" issued by an interrupt handler will incorrectly + * clear NMI blocking. + */ +static __inline void +vmx_exit_handle_nmi(struct vmx *vmx, int vcpuid, struct vm_exit *vmexit) +{ + uint32_t intr_info; + + KASSERT((read_rflags() & PSL_I) == 0, ("interrupts enabled")); + + if (vmexit->u.vmx.exit_reason != EXIT_REASON_EXCEPTION) + return; + + intr_info = vmcs_read(VMCS_EXIT_INTR_INFO); + KASSERT((intr_info & VMCS_INTR_VALID) != 0, + ("VM exit interruption info invalid: %#x", intr_info)); + + if ((intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_NMI) { + KASSERT((intr_info & 0xff) == IDT_NMI, ("VM exit due " + "to NMI has invalid vector: %#x", intr_info)); + VCPU_CTR0(vmx->vm, vcpuid, "Vectoring to NMI handler"); + __asm __volatile("int $2"); + } +} + static int vmx_run(void *arg, int vcpu, register_t startrip, pmap_t pmap, void *rendezvous_cookie) @@ -1799,8 +1942,6 @@ vmx_run(void *arg, int vcpu, register_t vmx_run_trace(vmx, vcpu); rc = vmx_enter_guest(vmxctx, vmx, launched); - enable_intr(); - /* Collect some information for VM exit processing */ vmexit->rip = rip = vmcs_guest_rip(); vmexit->inst_length = vmexit_instruction_length(); @@ -1808,12 +1949,14 @@ vmx_run(void *arg, int vcpu, register_t vmexit->u.vmx.exit_qualification = vmcs_exit_qualification(); if (rc == VMX_GUEST_VMEXIT) { - launched = 1; + vmx_exit_handle_nmi(vmx, vcpu, vmexit); + enable_intr(); handled = vmx_exit_process(vmx, vcpu, vmexit); } else { + enable_intr(); handled = vmx_exit_inst_error(vmxctx, rc, vmexit); } - + launched = 1; vmx_exit_trace(vmx, vcpu, rip, exit_reason, handled); } while (handled); @@ -2053,11 +2196,11 @@ vmx_inject(void *arg, int vcpu, int type if (error) return (error); - if (info & VMCS_INTR_INFO_VALID) + if (info & VMCS_INTR_VALID) return (EAGAIN); info = vector | (type_map[type] << 8) | (code_valid ? 1 << 11 : 0); - info |= VMCS_INTR_INFO_VALID; + info |= VMCS_INTR_VALID; error = vmcs_setreg(vmcs, 0, VMCS_IDENT(VMCS_ENTRY_INTR_INFO), info); if (error != 0) return (error); Modified: stable/10/sys/amd64/vmm/vmm_stat.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_stat.c Fri May 23 19:06:35 2014 (r266592) +++ stable/10/sys/amd64/vmm/vmm_stat.c Fri May 23 19:39:58 2014 (r266593) @@ -152,3 +152,4 @@ VMM_STAT(VMEXIT_UNKNOWN, "number of vm e VMM_STAT(VMEXIT_ASTPENDING, "number of times astpending at exit"); VMM_STAT(VMEXIT_USERSPACE, "number of vm exits handled in userspace"); VMM_STAT(VMEXIT_RENDEZVOUS, "number of times rendezvous pending at exit"); +VMM_STAT(VMEXIT_EXCEPTION, "number of vm exits due to exceptions"); Modified: stable/10/sys/amd64/vmm/vmm_stat.h ============================================================================== --- stable/10/sys/amd64/vmm/vmm_stat.h Fri May 23 19:06:35 2014 (r266592) +++ stable/10/sys/amd64/vmm/vmm_stat.h Fri May 23 19:39:58 2014 (r266593) @@ -122,4 +122,5 @@ VMM_STAT_DECLARE(VMEXIT_UNKNOWN); VMM_STAT_DECLARE(VMEXIT_ASTPENDING); VMM_STAT_DECLARE(VMEXIT_USERSPACE); VMM_STAT_DECLARE(VMEXIT_RENDEZVOUS); +VMM_STAT_DECLARE(VMEXIT_EXCEPTION); #endif From owner-svn-src-stable-10@FreeBSD.ORG Fri May 23 19:43:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B60233D7; Fri, 23 May 2014 19:43: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 96BDB2FBD; Fri, 23 May 2014 19:43: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 s4NJhL14016179; Fri, 23 May 2014 19:43:21 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NJhL0M016176; Fri, 23 May 2014 19:43:21 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201405231943.s4NJhL0M016176@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Fri, 23 May 2014 19:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266594 - in stable/10/sys: dev/drm2/radeon modules/drm2/radeonkms X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 19:43:21 -0000 Author: dumbbell Date: Fri May 23 19:43:20 2014 New Revision: 266594 URL: http://svnweb.freebsd.org/changeset/base/266594 Log: drm/radeon: Add 32bit ioctls support This allows to run 32bit applications on a 64bit host. This was tested successfully with Wine (emulators/i386-wine-devel) and StarCraft II. Submitted by: Jan Kokemüller Modified: stable/10/sys/dev/drm2/radeon/radeon_drv.c stable/10/sys/dev/drm2/radeon/radeon_ioc32.c stable/10/sys/modules/drm2/radeonkms/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_drv.c Fri May 23 19:39:58 2014 (r266593) +++ stable/10/sys/dev/drm2/radeon/radeon_drv.c Fri May 23 19:43:20 2014 (r266594) @@ -85,6 +85,10 @@ extern int radeon_get_crtc_scanoutpos(st int *vpos, int *hpos); extern struct drm_ioctl_desc radeon_ioctls_kms[]; extern int radeon_max_kms_ioctl; +#ifdef COMPAT_FREEBSD32 +extern struct drm_ioctl_desc radeon_compat_ioctls[]; +extern int radeon_num_compat_ioctls; +#endif #ifdef DUMBBELL_WIP int radeon_mmap(struct file *filp, struct vm_area_struct *vma); #endif /* DUMBBELL_WIP */ @@ -466,6 +470,10 @@ radeon_attach(device_t kdev) if (radeon_modeset == 1) { kms_driver.driver_features |= DRIVER_MODESET; kms_driver.max_ioctl = radeon_max_kms_ioctl; +#ifdef COMPAT_FREEBSD32 + kms_driver.compat_ioctls = radeon_compat_ioctls; + kms_driver.compat_ioctls_nr = &radeon_num_compat_ioctls; +#endif radeon_register_atpx_handler(); } dev->driver = &kms_driver; Modified: stable/10/sys/dev/drm2/radeon/radeon_ioc32.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_ioc32.c Fri May 23 19:39:58 2014 (r266593) +++ stable/10/sys/dev/drm2/radeon/radeon_ioc32.c Fri May 23 19:43:20 2014 (r266594) @@ -31,10 +31,13 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "opt_compat.h" -#include -#include +#ifdef COMPAT_FREEBSD32 + +#include +#include +#include #include "radeon_drv.h" typedef struct drm_radeon_init32 { @@ -60,42 +63,37 @@ typedef struct drm_radeon_init32 { u32 gart_textures_offset; } drm_radeon_init32_t; -static int compat_radeon_cp_init(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_init(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_init32_t init32; - drm_radeon_init_t __user *init; + drm_radeon_init32_t *init32; + drm_radeon_init_t __user init; - if (copy_from_user(&init32, (void __user *)arg, sizeof(init32))) - return -EFAULT; + init32 = arg; - init = compat_alloc_user_space(sizeof(*init)); - if (!access_ok(VERIFY_WRITE, init, sizeof(*init)) - || __put_user(init32.func, &init->func) - || __put_user(init32.sarea_priv_offset, &init->sarea_priv_offset) - || __put_user(init32.is_pci, &init->is_pci) - || __put_user(init32.cp_mode, &init->cp_mode) - || __put_user(init32.gart_size, &init->gart_size) - || __put_user(init32.ring_size, &init->ring_size) - || __put_user(init32.usec_timeout, &init->usec_timeout) - || __put_user(init32.fb_bpp, &init->fb_bpp) - || __put_user(init32.front_offset, &init->front_offset) - || __put_user(init32.front_pitch, &init->front_pitch) - || __put_user(init32.back_offset, &init->back_offset) - || __put_user(init32.back_pitch, &init->back_pitch) - || __put_user(init32.depth_bpp, &init->depth_bpp) - || __put_user(init32.depth_offset, &init->depth_offset) - || __put_user(init32.depth_pitch, &init->depth_pitch) - || __put_user(init32.fb_offset, &init->fb_offset) - || __put_user(init32.mmio_offset, &init->mmio_offset) - || __put_user(init32.ring_offset, &init->ring_offset) - || __put_user(init32.ring_rptr_offset, &init->ring_rptr_offset) - || __put_user(init32.buffers_offset, &init->buffers_offset) - || __put_user(init32.gart_textures_offset, - &init->gart_textures_offset)) - return -EFAULT; + init.func = init32->func; + init.sarea_priv_offset = (unsigned long)init32->sarea_priv_offset; + init.is_pci = init32->is_pci; + init.cp_mode = init32->cp_mode; + init.gart_size = init32->gart_size; + init.ring_size = init32->ring_size; + init.usec_timeout = init32->usec_timeout; + init.fb_bpp = init32->fb_bpp; + init.front_offset = init32->front_offset; + init.front_pitch = init32->front_pitch; + init.back_offset = init32->back_offset; + init.back_pitch = init32->back_pitch; + init.depth_bpp = init32->depth_bpp; + init.depth_offset = init32->depth_offset; + init.depth_pitch = init32->depth_pitch; + init.fb_offset = (unsigned long)init32->fb_offset; + init.mmio_offset = (unsigned long)init32->mmio_offset; + init.ring_offset = (unsigned long)init32->ring_offset; + init.ring_rptr_offset = (unsigned long)init32->ring_rptr_offset; + init.buffers_offset = (unsigned long)init32->buffers_offset; + init.gart_textures_offset = (unsigned long)init32->gart_textures_offset; - return drm_ioctl(file, DRM_IOCTL_RADEON_CP_INIT, (unsigned long)init); + return radeon_cp_init(dev, &init, file_priv); } typedef struct drm_radeon_clear32 { @@ -107,50 +105,37 @@ typedef struct drm_radeon_clear32 { u32 depth_boxes; } drm_radeon_clear32_t; -static int compat_radeon_cp_clear(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_clear(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_clear32_t clr32; - drm_radeon_clear_t __user *clr; + drm_radeon_clear32_t *clr32; + drm_radeon_clear_t __user clr; - if (copy_from_user(&clr32, (void __user *)arg, sizeof(clr32))) - return -EFAULT; + clr32 = arg; - clr = compat_alloc_user_space(sizeof(*clr)); - if (!access_ok(VERIFY_WRITE, clr, sizeof(*clr)) - || __put_user(clr32.flags, &clr->flags) - || __put_user(clr32.clear_color, &clr->clear_color) - || __put_user(clr32.clear_depth, &clr->clear_depth) - || __put_user(clr32.color_mask, &clr->color_mask) - || __put_user(clr32.depth_mask, &clr->depth_mask) - || __put_user((void __user *)(unsigned long)clr32.depth_boxes, - &clr->depth_boxes)) - return -EFAULT; + clr.flags = clr32->flags; + clr.clear_color = clr32->clear_color; + clr.clear_depth = clr32->clear_depth; + clr.color_mask = clr32->color_mask; + clr.depth_mask = clr32->depth_mask; + clr.depth_boxes = (drm_radeon_clear_rect_t *)(unsigned long)clr32->depth_boxes; - return drm_ioctl(file, DRM_IOCTL_RADEON_CLEAR, (unsigned long)clr); + return radeon_ioctls[DRM_IOCTL_RADEON_CLEAR].func(dev, &clr, file_priv); } typedef struct drm_radeon_stipple32 { u32 mask; } drm_radeon_stipple32_t; -static int compat_radeon_cp_stipple(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_stipple(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { drm_radeon_stipple32_t __user *argp = (void __user *)arg; - drm_radeon_stipple_t __user *request; - u32 mask; + drm_radeon_stipple_t __user request; - if (get_user(mask, &argp->mask)) - return -EFAULT; + request.mask = (unsigned int *)(unsigned long)argp->mask; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user((unsigned int __user *)(unsigned long)mask, - &request->mask)) - return -EFAULT; - - return drm_ioctl(file, DRM_IOCTL_RADEON_STIPPLE, (unsigned long)request); + return radeon_ioctls[DRM_IOCTL_RADEON_STIPPLE].func(dev, &request, file_priv); } typedef struct drm_radeon_tex_image32 { @@ -168,43 +153,32 @@ typedef struct drm_radeon_texture32 { u32 image; } drm_radeon_texture32_t; -static int compat_radeon_cp_texture(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_texture(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_texture32_t req32; - drm_radeon_texture_t __user *request; - drm_radeon_tex_image32_t img32; - drm_radeon_tex_image_t __user *image; - - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; - if (req32.image == 0) + drm_radeon_texture32_t *req32; + drm_radeon_texture_t __user request; + drm_radeon_tex_image32_t *img32; + drm_radeon_tex_image_t __user image; + + req32 = arg; + if (req32->image == 0) return -EINVAL; - if (copy_from_user(&img32, (void __user *)(unsigned long)req32.image, - sizeof(img32))) - return -EFAULT; - - request = compat_alloc_user_space(sizeof(*request) + sizeof(*image)); - if (!access_ok(VERIFY_WRITE, request, - sizeof(*request) + sizeof(*image))) - return -EFAULT; - image = (drm_radeon_tex_image_t __user *) (request + 1); - - if (__put_user(req32.offset, &request->offset) - || __put_user(req32.pitch, &request->pitch) - || __put_user(req32.format, &request->format) - || __put_user(req32.width, &request->width) - || __put_user(req32.height, &request->height) - || __put_user(image, &request->image) - || __put_user(img32.x, &image->x) - || __put_user(img32.y, &image->y) - || __put_user(img32.width, &image->width) - || __put_user(img32.height, &image->height) - || __put_user((const void __user *)(unsigned long)img32.data, - &image->data)) - return -EFAULT; + img32 = (drm_radeon_tex_image32_t *)(unsigned long)req32->image; - return drm_ioctl(file, DRM_IOCTL_RADEON_TEXTURE, (unsigned long)request); + request.offset = req32->offset; + request.pitch = req32->pitch; + request.format = req32->format; + request.width = req32->width; + request.height = req32->height; + request.image = ℑ + image.x = img32->x; + image.y = img32->y; + image.width = img32->width; + image.height = img32->height; + image.data = (void *)(unsigned long)img32->data; + + return radeon_ioctls[DRM_IOCTL_RADEON_TEXTURE].func(dev, &request, file_priv); } typedef struct drm_radeon_vertex2_32 { @@ -216,28 +190,22 @@ typedef struct drm_radeon_vertex2_32 { u32 prim; } drm_radeon_vertex2_32_t; -static int compat_radeon_cp_vertex2(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_vertex2(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_vertex2_32_t req32; - drm_radeon_vertex2_t __user *request; + drm_radeon_vertex2_32_t *req32; + drm_radeon_vertex2_t __user request; - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; + req32 = arg; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.idx, &request->idx) - || __put_user(req32.discard, &request->discard) - || __put_user(req32.nr_states, &request->nr_states) - || __put_user((void __user *)(unsigned long)req32.state, - &request->state) - || __put_user(req32.nr_prims, &request->nr_prims) - || __put_user((void __user *)(unsigned long)req32.prim, - &request->prim)) - return -EFAULT; + request.idx = req32->idx; + request.discard = req32->discard; + request.nr_states = req32->nr_states; + request.state = (drm_radeon_state_t *)(unsigned long)req32->state; + request.nr_prims = req32->nr_prims; + request.prim = (drm_radeon_prim_t *)(unsigned long)req32->prim; - return drm_ioctl(file, DRM_IOCTL_RADEON_VERTEX2, (unsigned long)request); + return radeon_ioctls[DRM_IOCTL_RADEON_VERTEX2].func(dev, &request, file_priv); } typedef struct drm_radeon_cmd_buffer32 { @@ -247,26 +215,20 @@ typedef struct drm_radeon_cmd_buffer32 { u32 boxes; } drm_radeon_cmd_buffer32_t; -static int compat_radeon_cp_cmdbuf(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_cmdbuf(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_cmd_buffer32_t req32; - drm_radeon_cmd_buffer_t __user *request; + drm_radeon_cmd_buffer32_t *req32; + drm_radeon_cmd_buffer_t __user request; - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; + req32 = arg; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.bufsz, &request->bufsz) - || __put_user((void __user *)(unsigned long)req32.buf, - &request->buf) - || __put_user(req32.nbox, &request->nbox) - || __put_user((void __user *)(unsigned long)req32.boxes, - &request->boxes)) - return -EFAULT; + request.bufsz = req32->bufsz; + request.buf = (char *)(unsigned long)req32->buf; + request.nbox = req32->nbox; + request.boxes = (struct drm_clip_rect *)(unsigned long)req32->boxes; - return drm_ioctl(file, DRM_IOCTL_RADEON_CMDBUF, (unsigned long)request); + return radeon_ioctls[DRM_IOCTL_RADEON_CMDBUF].func(dev, &request, file_priv); } typedef struct drm_radeon_getparam32 { @@ -274,23 +236,18 @@ typedef struct drm_radeon_getparam32 { u32 value; } drm_radeon_getparam32_t; -static int compat_radeon_cp_getparam(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_getparam(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_getparam32_t req32; - drm_radeon_getparam_t __user *request; + drm_radeon_getparam32_t *req32; + drm_radeon_getparam_t __user request; - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; + req32 = arg; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.param, &request->param) - || __put_user((void __user *)(unsigned long)req32.value, - &request->value)) - return -EFAULT; + request.param = req32->param; + request.value = (void *)(unsigned long)req32->value; - return drm_ioctl(file, DRM_IOCTL_RADEON_GETPARAM, (unsigned long)request); + return radeon_ioctls[DRM_IOCTL_RADEON_GETPARAM].func(dev, &request, file_priv); } typedef struct drm_radeon_mem_alloc32 { @@ -300,129 +257,71 @@ typedef struct drm_radeon_mem_alloc32 { u32 region_offset; /* offset from start of fb or GART */ } drm_radeon_mem_alloc32_t; -static int compat_radeon_mem_alloc(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_mem_alloc(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_mem_alloc32_t req32; - drm_radeon_mem_alloc_t __user *request; + drm_radeon_mem_alloc32_t *req32; + drm_radeon_mem_alloc_t __user request; - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; + req32 = arg; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.region, &request->region) - || __put_user(req32.alignment, &request->alignment) - || __put_user(req32.size, &request->size) - || __put_user((int __user *)(unsigned long)req32.region_offset, - &request->region_offset)) - return -EFAULT; + request.region = req32->region; + request.alignment = req32->alignment; + request.size = req32->size; + request.region_offset = (int *)(unsigned long)req32->region_offset; - return drm_ioctl(file, DRM_IOCTL_RADEON_ALLOC, (unsigned long)request); + return radeon_mem_alloc(dev, &request, file_priv); } typedef struct drm_radeon_irq_emit32 { u32 irq_seq; } drm_radeon_irq_emit32_t; -static int compat_radeon_irq_emit(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_irq_emit(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_irq_emit32_t req32; - drm_radeon_irq_emit_t __user *request; + drm_radeon_irq_emit32_t *req32; + drm_radeon_irq_emit_t __user request; - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; + req32 = arg; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user((int __user *)(unsigned long)req32.irq_seq, - &request->irq_seq)) - return -EFAULT; + request.irq_seq = (int *)(unsigned long)req32->irq_seq; - return drm_ioctl(file, DRM_IOCTL_RADEON_IRQ_EMIT, (unsigned long)request); + return radeon_irq_emit(dev, &request, file_priv); } /* The two 64-bit arches where alignof(u64)==4 in 32-bit code */ -#if defined (CONFIG_X86_64) || defined(CONFIG_IA64) typedef struct drm_radeon_setparam32 { int param; u64 value; } __attribute__((packed)) drm_radeon_setparam32_t; -static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_setparam(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_setparam32_t req32; - drm_radeon_setparam_t __user *request; - - if (copy_from_user(&req32, (void __user *) arg, sizeof(req32))) - return -EFAULT; + drm_radeon_setparam32_t *req32; + drm_radeon_setparam_t __user request; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.param, &request->param) - || __put_user((void __user *)(unsigned long)req32.value, - &request->value)) - return -EFAULT; + req32 = arg; - return drm_ioctl(file, DRM_IOCTL_RADEON_SETPARAM, (unsigned long) request); -} -#else -#define compat_radeon_cp_setparam NULL -#endif /* X86_64 || IA64 */ - -static drm_ioctl_compat_t *radeon_compat_ioctls[] = { - [DRM_RADEON_CP_INIT] = compat_radeon_cp_init, - [DRM_RADEON_CLEAR] = compat_radeon_cp_clear, - [DRM_RADEON_STIPPLE] = compat_radeon_cp_stipple, - [DRM_RADEON_TEXTURE] = compat_radeon_cp_texture, - [DRM_RADEON_VERTEX2] = compat_radeon_cp_vertex2, - [DRM_RADEON_CMDBUF] = compat_radeon_cp_cmdbuf, - [DRM_RADEON_GETPARAM] = compat_radeon_cp_getparam, - [DRM_RADEON_SETPARAM] = compat_radeon_cp_setparam, - [DRM_RADEON_ALLOC] = compat_radeon_mem_alloc, - [DRM_RADEON_IRQ_EMIT] = compat_radeon_irq_emit, + request.param = req32->param; + request.value = req32->value; + + return radeon_ioctls[DRM_IOCTL_RADEON_SETPARAM].func(dev, &request, file_priv); +} + +struct drm_ioctl_desc radeon_compat_ioctls[] = { + DRM_IOCTL_DEF(DRM_RADEON_CP_INIT, compat_radeon_cp_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_RADEON_CLEAR, compat_radeon_cp_clear, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_STIPPLE, compat_radeon_cp_stipple, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_TEXTURE, compat_radeon_cp_texture, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_VERTEX2, compat_radeon_cp_vertex2, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_CMDBUF, compat_radeon_cp_cmdbuf, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_GETPARAM, compat_radeon_cp_getparam, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_SETPARAM, compat_radeon_cp_setparam, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_ALLOC, compat_radeon_mem_alloc, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_IRQ_EMIT, compat_radeon_irq_emit, DRM_AUTH) }; +int radeon_num_compat_ioctls = DRM_ARRAY_SIZE(radeon_compat_ioctls); -/** - * Called whenever a 32-bit process running under a 64-bit kernel - * performs an ioctl on /dev/dri/card. - * - * \param filp file pointer. - * \param cmd command. - * \param arg user argument. - * \return zero on success or negative number on failure. - */ -long radeon_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) -{ - unsigned int nr = DRM_IOCTL_NR(cmd); - drm_ioctl_compat_t *fn = NULL; - int ret; - - if (nr < DRM_COMMAND_BASE) - return drm_compat_ioctl(filp, cmd, arg); - - if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(radeon_compat_ioctls)) - fn = radeon_compat_ioctls[nr - DRM_COMMAND_BASE]; - - if (fn != NULL) - ret = (*fn) (filp, cmd, arg); - else - ret = drm_ioctl(filp, cmd, arg); - - return ret; -} - -long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) -{ - unsigned int nr = DRM_IOCTL_NR(cmd); - int ret; - - if (nr < DRM_COMMAND_BASE) - return drm_compat_ioctl(filp, cmd, arg); - - ret = drm_ioctl(filp, cmd, arg); - - return ret; -} +#endif Modified: stable/10/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- stable/10/sys/modules/drm2/radeonkms/Makefile Fri May 23 19:39:58 2014 (r266593) +++ stable/10/sys/modules/drm2/radeonkms/Makefile Fri May 23 19:43:20 2014 (r266594) @@ -88,7 +88,10 @@ SRCS += \ si.c \ si_blit_shaders.c -#radeon_ioc32.c +.if ${MACHINE_CPUARCH} == "amd64" +SRCS += radeon_ioc32.c +.endif + #radeon_prime.c #--radeon_trace_points.c From owner-svn-src-stable-10@FreeBSD.ORG Sat May 24 09:50:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 17CC2137; Sat, 24 May 2014 09:50: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 04AEF2C6E; Sat, 24 May 2014 09:50: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 s4O9oAFu098166; Sat, 24 May 2014 09:50:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4O9oAX7098165; Sat, 24 May 2014 09:50:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405240950.s4O9oAX7098165@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 24 May 2014 09:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266607 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 09:50:11 -0000 Author: kib Date: Sat May 24 09:50:10 2014 New Revision: 266607 URL: http://svnweb.freebsd.org/changeset/base/266607 Log: MFC r266491: Remove redundand loop. Modified: stable/10/sys/vm/vm_fault.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Sat May 24 09:29:23 2014 (r266606) +++ stable/10/sys/vm/vm_fault.c Sat May 24 09:50:10 2014 (r266607) @@ -1340,18 +1340,16 @@ again: /* * Allocate a page in the destination object. */ - do { - dst_m = vm_page_alloc(dst_object, - (src_object == dst_object ? src_pindex : - 0) + dst_pindex, VM_ALLOC_NORMAL); - if (dst_m == NULL) { - VM_OBJECT_WUNLOCK(dst_object); - VM_OBJECT_RUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(dst_object); - goto again; - } - } while (dst_m == NULL); + dst_m = vm_page_alloc(dst_object, (src_object == + dst_object ? src_pindex : 0) + dst_pindex, + VM_ALLOC_NORMAL); + if (dst_m == NULL) { + VM_OBJECT_WUNLOCK(dst_object); + VM_OBJECT_RUNLOCK(object); + VM_WAIT; + VM_OBJECT_WLOCK(dst_object); + goto again; + } pmap_copy_page(src_m, dst_m); VM_OBJECT_RUNLOCK(object); dst_m->valid = VM_PAGE_BITS_ALL; From owner-svn-src-stable-10@FreeBSD.ORG Sat May 24 10:20:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 784554B3; Sat, 24 May 2014 10: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 647C32E75; Sat, 24 May 2014 10: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 s4OAKv41011718; Sat, 24 May 2014 10:20:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OAKvq4011717; Sat, 24 May 2014 10:20:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405241020.s4OAKvq4011717@svn.freebsd.org> From: Alexander Motin Date: Sat, 24 May 2014 10:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266608 - stable/10/sys/geom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 10:20:57 -0000 Author: mav Date: Sat May 24 10:20:56 2014 New Revision: 266608 URL: http://svnweb.freebsd.org/changeset/base/266608 Log: MFC r266319: Make GEOM DISK to account also BIO_FLUSH operations. Modified: stable/10/sys/geom/geom_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Sat May 24 09:50:10 2014 (r266607) +++ stable/10/sys/geom/geom_disk.c Sat May 24 10:20:56 2014 (r266608) @@ -243,7 +243,7 @@ g_disk_done(struct bio *bp) if (bp2->bio_error == 0) bp2->bio_error = bp->bio_error; bp2->bio_completed += bp->bio_completed; - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) + if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0) devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now); bp2->bio_inbed++; if (bp2->bio_children == bp2->bio_inbed) { @@ -264,7 +264,7 @@ g_disk_done_single(struct bio *bp) bp->bio_completed = bp->bio_length - bp->bio_resid; bp->bio_done = (void *)bp->bio_to; bp->bio_to = LIST_FIRST(&bp->bio_disk->d_geom->provider); - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) { + if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0) { binuptime(&now); sc = bp->bio_to->private; mtx_lock(&sc->done_mtx); @@ -441,6 +441,9 @@ g_disk_start(struct bio *bp) bp->bio_disk = dp; bp->bio_to = (void *)bp->bio_done; bp->bio_done = g_disk_done_single; + mtx_lock(&sc->start_mtx); + devstat_start_transaction_bio(dp->d_devstat, bp); + mtx_unlock(&sc->start_mtx); g_disk_lock_giant(dp); dp->d_strategy(bp); g_disk_unlock_giant(dp); From owner-svn-src-stable-10@FreeBSD.ORG Sat May 24 10:37:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2D8EF904; Sat, 24 May 2014 10:37: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 1A0582FCC; Sat, 24 May 2014 10:37: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 s4OAbuXA019687; Sat, 24 May 2014 10:37:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OAbuBp019685; Sat, 24 May 2014 10:37:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405241037.s4OAbuBp019685@svn.freebsd.org> From: Alexander Motin Date: Sat, 24 May 2014 10:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266610 - stable/10/usr.sbin/gstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 10:37:57 -0000 Author: mav Date: Sat May 24 10:37:56 2014 New Revision: 266610 URL: http://svnweb.freebsd.org/changeset/base/266610 Log: MFC r266320: Add -o option to gstat to display "other" operatins (e.g. BIO_FLUSH). Modified: stable/10/usr.sbin/gstat/gstat.8 stable/10/usr.sbin/gstat/gstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/gstat/gstat.8 ============================================================================== --- stable/10/usr.sbin/gstat/gstat.8 Sat May 24 10:23:06 2014 (r266609) +++ stable/10/usr.sbin/gstat/gstat.8 Sat May 24 10:37:56 2014 (r266610) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2009 +.Dd May 17, 2014 .Dt GSTAT 8 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd print statistics about GEOM disks .Sh SYNOPSIS .Nm -.Op Fl abcd +.Op Fl abcdo .Op Fl f Ar filter .Op Fl I Ar interval .Sh DESCRIPTION @@ -69,6 +69,9 @@ Only devices with the names matching will be displayed. The format of the regular expression is described in .Xr re_format 7 . +.It Fl o +Enable display of statistics for other operations +.Pq Dv BIO_FLUSH . .It Fl I Ar interval Refresh the .Nm Modified: stable/10/usr.sbin/gstat/gstat.c ============================================================================== --- stable/10/usr.sbin/gstat/gstat.c Sat May 24 10:23:06 2014 (r266609) +++ stable/10/usr.sbin/gstat/gstat.c Sat May 24 10:37:56 2014 (r266610) @@ -51,7 +51,7 @@ #include #include -static int flag_a, flag_b, flag_c, flag_d; +static int flag_a, flag_b, flag_c, flag_d, flag_o; static int flag_I = 1000000; #define PRINTMSG(...) do { \ @@ -88,7 +88,7 @@ main(int argc, char **argv) char *p; char f_s[100], pf_s[100], tmp_f_s[100]; const char *line; - long double ld[11]; + long double ld[13]; uint64_t u64; EditLine *el; History *hist; @@ -104,7 +104,7 @@ main(int argc, char **argv) flag_b = 1; f_s[0] = '\0'; - while ((i = getopt(argc, argv, "adcf:I:b")) != -1) { + while ((i = getopt(argc, argv, "abdcf:oI:")) != -1) { switch (i) { case 'a': flag_a = 1; @@ -126,6 +126,9 @@ main(int argc, char **argv) "Invalid filter - see re_format(7)"); strncpy(f_s, optarg, sizeof(f_s)); break; + case 'o': + flag_o = 1; + break; case 'I': p = NULL; i = strtoul(optarg, &p, 0); @@ -229,6 +232,8 @@ main(int argc, char **argv) PRINTMSG(" w/s kBps ms/w "); if (flag_d) PRINTMSG(" d/s kBps ms/d "); + if (flag_o) + PRINTMSG(" o/s ms/o "); PRINTMSG("%%busy Name\n"); for (;;) { gsp = geom_stats_snapshot_next(sp); @@ -279,9 +284,14 @@ main(int argc, char **argv) DSM_MS_PER_TRANSACTION_WRITE, &ld[6], DSM_BUSY_PCT, &ld[7], + DSM_TRANSFERS_PER_SECOND_FREE, &ld[8], DSM_MB_PER_SECOND_FREE, &ld[9], DSM_MS_PER_TRANSACTION_FREE, &ld[10], + + DSM_TRANSFERS_PER_SECOND_OTHER, &ld[11], + DSM_MS_PER_TRANSACTION_OTHER, &ld[12], + DSM_NONE); if (flag_a && ld[7] < 0.1) { @@ -313,6 +323,14 @@ main(int argc, char **argv) PRINTMSG(" %6.1f", (double)ld[10]); } + if (flag_o) { + PRINTMSG(" %6.0f", (double)ld[11]); + if (ld[12] > 1e3) + PRINTMSG(" %6.0f", (double)ld[12]); + else + PRINTMSG(" %6.1f", (double)ld[12]); + } + if (ld[7] > 80) i = 3; else if (ld[7] > 50) From owner-svn-src-stable-10@FreeBSD.ORG Sat May 24 10:41:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0A15FB44; Sat, 24 May 2014 10:41: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 D16F8204E; Sat, 24 May 2014 10:41: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 s4OAfcJ7022476; Sat, 24 May 2014 10:41:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OAfcLm022472; Sat, 24 May 2014 10:41:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405241041.s4OAfcLm022472@svn.freebsd.org> From: Alexander Motin Date: Sat, 24 May 2014 10:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266611 - in stable/10/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 10:41:39 -0000 Author: mav Date: Sat May 24 10:41:37 2014 New Revision: 266611 URL: http://svnweb.freebsd.org/changeset/base/266611 Log: MFC r265821: Comment out some pointless device open/close around reading device IDs. FreeBSD ZFS port unlike OpenSolaris does not use device IDs, and does not implement respective devid_*() fuctions. It is pointless to open devices just to close them back immediately. Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Sat May 24 10:37:56 2014 (r266610) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Sat May 24 10:41:37 2014 (r266611) @@ -512,6 +512,7 @@ make_leaf_vdev(const char *arg, uint64_t verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK, (uint64_t)wholedisk) == 0); +#ifdef have_devid /* * For a whole disk, defer getting its devid until after labeling it. */ @@ -546,6 +547,7 @@ make_leaf_vdev(const char *arg, uint64_t (void) close(fd); } +#endif return (vdev); } Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Sat May 24 10:37:56 2014 (r266610) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Sat May 24 10:41:37 2014 (r266611) @@ -94,6 +94,7 @@ typedef struct pool_list { static char * get_devid(const char *path) { +#ifdef have_devid int fd; ddi_devid_t devid; char *minor, *ret; @@ -113,6 +114,9 @@ get_devid(const char *path) (void) close(fd); return (ret); +#else + return (NULL); +#endif } Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sat May 24 10:37:56 2014 (r266610) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sat May 24 10:41:37 2014 (r266611) @@ -3324,6 +3324,7 @@ devid_to_path(char *devid_str) static char * path_to_devid(const char *path) { +#ifdef have_devid int fd; ddi_devid_t devid; char *minor, *ret; @@ -3343,6 +3344,9 @@ path_to_devid(const char *path) (void) close(fd); return (ret); +#else + return (NULL); +#endif } /* From owner-svn-src-stable-10@FreeBSD.ORG Sat May 24 10:44:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9C836C84; Sat, 24 May 2014 10:44: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 87A90205C; Sat, 24 May 2014 10:44: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 s4OAifeC023727; Sat, 24 May 2014 10:44:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OAieRM023722; Sat, 24 May 2014 10:44:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405241044.s4OAieRM023722@svn.freebsd.org> From: Alexander Motin Date: Sat, 24 May 2014 10:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266612 - in stable/10/cddl: compat/opensolaris/include compat/opensolaris/misc lib/libzfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 10:44:41 -0000 Author: mav Date: Sat May 24 10:44:40 2014 New Revision: 266612 URL: http://svnweb.freebsd.org/changeset/base/266612 Log: MFC r265689: Import adapted OpenSolaris' thread pool API implementation. The thread pool is used by libzfs to implement parallel disk scanning. Without this change our dummy wrapper made `zpool import ZZZ` command to scan all disks sequentially from the single thread when searching for pools. This change makes it use two threads per CPU, same as in OpenSolaris. On system with 200 HDDs this change reduces ZFS pool import time from 35 to 22 seconds. Added: stable/10/cddl/compat/opensolaris/misc/thread_pool.c - copied unchanged from r265689, head/cddl/compat/opensolaris/misc/thread_pool.c stable/10/cddl/compat/opensolaris/misc/thread_pool_impl.h - copied unchanged from r265689, head/cddl/compat/opensolaris/misc/thread_pool_impl.h Modified: stable/10/cddl/compat/opensolaris/include/thread_pool.h stable/10/cddl/lib/libzfs/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/compat/opensolaris/include/thread_pool.h ============================================================================== --- stable/10/cddl/compat/opensolaris/include/thread_pool.h Sat May 24 10:41:37 2014 (r266611) +++ stable/10/cddl/compat/opensolaris/include/thread_pool.h Sat May 24 10:44:40 2014 (r266612) @@ -1,39 +1,78 @@ -/*- - * Copyright (c) 2010 Pawel Jakub Dawidek - * All rights reserved. +/* + * CDDL HEADER START * - * 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. + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* * $FreeBSD$ */ -#ifndef _OPENSOLARIS_THREAD_POOL_H_ -#define _OPENSOLARIS_THREAD_POOL_H_ +#ifndef _THREAD_POOL_H_ +#define _THREAD_POOL_H_ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct tpool tpool_t; /* opaque thread pool descriptor */ + +#if defined(__STDC__) + +extern tpool_t *tpool_create(uint_t min_threads, uint_t max_threads, + uint_t linger, pthread_attr_t *attr); +extern int tpool_dispatch(tpool_t *tpool, + void (*func)(void *), void *arg); +extern void tpool_destroy(tpool_t *tpool); +extern void tpool_abandon(tpool_t *tpool); +extern void tpool_wait(tpool_t *tpool); +extern void tpool_suspend(tpool_t *tpool); +extern int tpool_suspended(tpool_t *tpool); +extern void tpool_resume(tpool_t *tpool); +extern int tpool_member(tpool_t *tpool); + +#else /* Non ANSI */ + +extern tpool_t *tpool_create(); +extern int tpool_dispatch(); +extern void tpool_destroy(); +extern void tpool_abandon(); +extern void tpool_wait(); +extern void tpool_suspend(); +extern int tpool_suspended(); +extern void tpool_resume(); +extern int tpool_member(); -typedef int tpool_t; +#endif /* __STDC__ */ -#define tpool_create(a, b, c, d) (0) -#define tpool_dispatch(pool, func, arg) func(arg) -#define tpool_wait(pool) do { } while (0) -#define tpool_destroy(pool) do { } while (0) +#ifdef __cplusplus +} +#endif -#endif /* !_OPENSOLARIS_THREAD_POOL_H_ */ +#endif /* _THREAD_POOL_H_ */ Copied: stable/10/cddl/compat/opensolaris/misc/thread_pool.c (from r265689, head/cddl/compat/opensolaris/misc/thread_pool.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/compat/opensolaris/misc/thread_pool.c Sat May 24 10:44:40 2014 (r266612, copy of r265689, head/cddl/compat/opensolaris/misc/thread_pool.c) @@ -0,0 +1,430 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +__FBSDID("$FreeBSD$"); + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include "thread_pool_impl.h" + +typedef void (*_Voidfp)(void*); /* pointer to extern "C" function */ + +static void +delete_pool(tpool_t *tpool) +{ + tpool_job_t *job; + + /* + * There should be no pending jobs, but just in case... + */ + for (job = tpool->tp_head; job != NULL; job = tpool->tp_head) { + tpool->tp_head = job->tpj_next; + free(job); + } + (void) pthread_attr_destroy(&tpool->tp_attr); + free(tpool); +} + +/* + * Worker thread is terminating. + */ +static void +worker_cleanup(void *arg) +{ + tpool_t *tpool = arg; + + if (--tpool->tp_current == 0 && + (tpool->tp_flags & (TP_DESTROY | TP_ABANDON))) { + if (tpool->tp_flags & TP_ABANDON) { + pthread_mutex_unlock(&tpool->tp_mutex); + delete_pool(tpool); + return; + } + if (tpool->tp_flags & TP_DESTROY) + (void) pthread_cond_broadcast(&tpool->tp_busycv); + } + pthread_mutex_unlock(&tpool->tp_mutex); +} + +static void +notify_waiters(tpool_t *tpool) +{ + if (tpool->tp_head == NULL && tpool->tp_active == NULL) { + tpool->tp_flags &= ~TP_WAIT; + (void) pthread_cond_broadcast(&tpool->tp_waitcv); + } +} + +/* + * Called by a worker thread on return from a tpool_dispatch()d job. + */ +static void +job_cleanup(void *arg) +{ + tpool_t *tpool = arg; + pthread_t my_tid = pthread_self(); + tpool_active_t *activep; + tpool_active_t **activepp; + + pthread_mutex_lock(&tpool->tp_mutex); + /* CSTYLED */ + for (activepp = &tpool->tp_active;; activepp = &activep->tpa_next) { + activep = *activepp; + if (activep->tpa_tid == my_tid) { + *activepp = activep->tpa_next; + break; + } + } + if (tpool->tp_flags & TP_WAIT) + notify_waiters(tpool); +} + +static void * +tpool_worker(void *arg) +{ + tpool_t *tpool = (tpool_t *)arg; + int elapsed; + tpool_job_t *job; + void (*func)(void *); + tpool_active_t active; + sigset_t maskset; + + pthread_mutex_lock(&tpool->tp_mutex); + pthread_cleanup_push(worker_cleanup, tpool); + + /* + * This is the worker's main loop. + * It will only be left if a timeout or an error has occured. + */ + active.tpa_tid = pthread_self(); + for (;;) { + elapsed = 0; + tpool->tp_idle++; + if (tpool->tp_flags & TP_WAIT) + notify_waiters(tpool); + while ((tpool->tp_head == NULL || + (tpool->tp_flags & TP_SUSPEND)) && + !(tpool->tp_flags & (TP_DESTROY | TP_ABANDON))) { + if (tpool->tp_current <= tpool->tp_minimum || + tpool->tp_linger == 0) { + (void) pthread_cond_wait(&tpool->tp_workcv, + &tpool->tp_mutex); + } else { + struct timespec timeout; + + clock_gettime(CLOCK_MONOTONIC, &timeout); + timeout.tv_sec += tpool->tp_linger; + if (pthread_cond_timedwait(&tpool->tp_workcv, + &tpool->tp_mutex, &timeout) != 0) { + elapsed = 1; + break; + } + } + } + tpool->tp_idle--; + if (tpool->tp_flags & TP_DESTROY) + break; + if (tpool->tp_flags & TP_ABANDON) { + /* can't abandon a suspended pool */ + if (tpool->tp_flags & TP_SUSPEND) { + tpool->tp_flags &= ~TP_SUSPEND; + (void) pthread_cond_broadcast(&tpool->tp_workcv); + } + if (tpool->tp_head == NULL) + break; + } + if ((job = tpool->tp_head) != NULL && + !(tpool->tp_flags & TP_SUSPEND)) { + elapsed = 0; + func = job->tpj_func; + arg = job->tpj_arg; + tpool->tp_head = job->tpj_next; + if (job == tpool->tp_tail) + tpool->tp_tail = NULL; + tpool->tp_njobs--; + active.tpa_next = tpool->tp_active; + tpool->tp_active = &active; + pthread_mutex_unlock(&tpool->tp_mutex); + pthread_cleanup_push(job_cleanup, tpool); + free(job); + /* + * Call the specified function. + */ + func(arg); + /* + * We don't know what this thread has been doing, + * so we reset its signal mask and cancellation + * state back to the initial values. + */ + sigfillset(&maskset); + (void) pthread_sigmask(SIG_SETMASK, &maskset, NULL); + (void) pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, + NULL); + (void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, + NULL); + pthread_cleanup_pop(1); + } + if (elapsed && tpool->tp_current > tpool->tp_minimum) { + /* + * We timed out and there is no work to be done + * and the number of workers exceeds the minimum. + * Exit now to reduce the size of the pool. + */ + break; + } + } + pthread_cleanup_pop(1); + return (arg); +} + +/* + * Create a worker thread, with all signals blocked. + */ +static int +create_worker(tpool_t *tpool) +{ + sigset_t maskset, oset; + pthread_t thread; + int error; + + sigfillset(&maskset); + (void) pthread_sigmask(SIG_SETMASK, &maskset, &oset); + error = pthread_create(&thread, &tpool->tp_attr, tpool_worker, tpool); + (void) pthread_sigmask(SIG_SETMASK, &oset, NULL); + return (error); +} + +tpool_t * +tpool_create(uint_t min_threads, uint_t max_threads, uint_t linger, + pthread_attr_t *attr) +{ + tpool_t *tpool; + int error; + + if (min_threads > max_threads || max_threads < 1) { + errno = EINVAL; + return (NULL); + } + + tpool = malloc(sizeof (*tpool)); + if (tpool == NULL) { + errno = ENOMEM; + return (NULL); + } + bzero(tpool, sizeof(*tpool)); + (void) pthread_mutex_init(&tpool->tp_mutex, NULL); + (void) pthread_cond_init(&tpool->tp_busycv, NULL); + (void) pthread_cond_init(&tpool->tp_workcv, NULL); + (void) pthread_cond_init(&tpool->tp_waitcv, NULL); + tpool->tp_minimum = min_threads; + tpool->tp_maximum = max_threads; + tpool->tp_linger = linger; + + /* make all pool threads be detached daemon threads */ + (void) pthread_attr_init(&tpool->tp_attr); + (void) pthread_attr_setdetachstate(&tpool->tp_attr, + PTHREAD_CREATE_DETACHED); + + return (tpool); +} + +/* + * Dispatch a work request to the thread pool. + * If there are idle workers, awaken one. + * Else, if the maximum number of workers has + * not been reached, spawn a new worker thread. + * Else just return with the job added to the queue. + */ +int +tpool_dispatch(tpool_t *tpool, void (*func)(void *), void *arg) +{ + tpool_job_t *job; + + if ((job = malloc(sizeof (*job))) == NULL) + return (-1); + bzero(job, sizeof(*job)); + job->tpj_next = NULL; + job->tpj_func = func; + job->tpj_arg = arg; + + pthread_mutex_lock(&tpool->tp_mutex); + + if (tpool->tp_head == NULL) + tpool->tp_head = job; + else + tpool->tp_tail->tpj_next = job; + tpool->tp_tail = job; + tpool->tp_njobs++; + + if (!(tpool->tp_flags & TP_SUSPEND)) { + if (tpool->tp_idle > 0) + (void) pthread_cond_signal(&tpool->tp_workcv); + else if (tpool->tp_current < tpool->tp_maximum && + create_worker(tpool) == 0) + tpool->tp_current++; + } + + pthread_mutex_unlock(&tpool->tp_mutex); + return (0); +} + +/* + * Assumes: by the time tpool_destroy() is called no one will use this + * thread pool in any way and no one will try to dispatch entries to it. + * Calling tpool_destroy() from a job in the pool will cause deadlock. + */ +void +tpool_destroy(tpool_t *tpool) +{ + tpool_active_t *activep; + + pthread_mutex_lock(&tpool->tp_mutex); + pthread_cleanup_push((_Voidfp)pthread_mutex_unlock, &tpool->tp_mutex); + + /* mark the pool as being destroyed; wakeup idle workers */ + tpool->tp_flags |= TP_DESTROY; + tpool->tp_flags &= ~TP_SUSPEND; + (void) pthread_cond_broadcast(&tpool->tp_workcv); + + /* cancel all active workers */ + for (activep = tpool->tp_active; activep; activep = activep->tpa_next) + (void) pthread_cancel(activep->tpa_tid); + + /* wait for all active workers to finish */ + while (tpool->tp_active != NULL) { + tpool->tp_flags |= TP_WAIT; + (void) pthread_cond_wait(&tpool->tp_waitcv, &tpool->tp_mutex); + } + + /* the last worker to terminate will wake us up */ + while (tpool->tp_current != 0) + (void) pthread_cond_wait(&tpool->tp_busycv, &tpool->tp_mutex); + + pthread_cleanup_pop(1); /* pthread_mutex_unlock(&tpool->tp_mutex); */ + delete_pool(tpool); +} + +/* + * Like tpool_destroy(), but don't cancel workers or wait for them to finish. + * The last worker to terminate will delete the pool. + */ +void +tpool_abandon(tpool_t *tpool) +{ + + pthread_mutex_lock(&tpool->tp_mutex); + if (tpool->tp_current == 0) { + /* no workers, just delete the pool */ + pthread_mutex_unlock(&tpool->tp_mutex); + delete_pool(tpool); + } else { + /* wake up all workers, last one will delete the pool */ + tpool->tp_flags |= TP_ABANDON; + tpool->tp_flags &= ~TP_SUSPEND; + (void) pthread_cond_broadcast(&tpool->tp_workcv); + pthread_mutex_unlock(&tpool->tp_mutex); + } +} + +/* + * Wait for all jobs to complete. + * Calling tpool_wait() from a job in the pool will cause deadlock. + */ +void +tpool_wait(tpool_t *tpool) +{ + + pthread_mutex_lock(&tpool->tp_mutex); + pthread_cleanup_push((_Voidfp)pthread_mutex_unlock, &tpool->tp_mutex); + while (tpool->tp_head != NULL || tpool->tp_active != NULL) { + tpool->tp_flags |= TP_WAIT; + (void) pthread_cond_wait(&tpool->tp_waitcv, &tpool->tp_mutex); + } + pthread_cleanup_pop(1); /* pthread_mutex_unlock(&tpool->tp_mutex); */ +} + +void +tpool_suspend(tpool_t *tpool) +{ + + pthread_mutex_lock(&tpool->tp_mutex); + tpool->tp_flags |= TP_SUSPEND; + pthread_mutex_unlock(&tpool->tp_mutex); +} + +int +tpool_suspended(tpool_t *tpool) +{ + int suspended; + + pthread_mutex_lock(&tpool->tp_mutex); + suspended = (tpool->tp_flags & TP_SUSPEND) != 0; + pthread_mutex_unlock(&tpool->tp_mutex); + + return (suspended); +} + +void +tpool_resume(tpool_t *tpool) +{ + int excess; + + pthread_mutex_lock(&tpool->tp_mutex); + if (!(tpool->tp_flags & TP_SUSPEND)) { + pthread_mutex_unlock(&tpool->tp_mutex); + return; + } + tpool->tp_flags &= ~TP_SUSPEND; + (void) pthread_cond_broadcast(&tpool->tp_workcv); + excess = tpool->tp_njobs - tpool->tp_idle; + while (excess-- > 0 && tpool->tp_current < tpool->tp_maximum) { + if (create_worker(tpool) != 0) + break; /* pthread_create() failed */ + tpool->tp_current++; + } + pthread_mutex_unlock(&tpool->tp_mutex); +} + +int +tpool_member(tpool_t *tpool) +{ + pthread_t my_tid = pthread_self(); + tpool_active_t *activep; + + pthread_mutex_lock(&tpool->tp_mutex); + for (activep = tpool->tp_active; activep; activep = activep->tpa_next) { + if (activep->tpa_tid == my_tid) { + pthread_mutex_unlock(&tpool->tp_mutex); + return (1); + } + } + pthread_mutex_unlock(&tpool->tp_mutex); + return (0); +} Copied: stable/10/cddl/compat/opensolaris/misc/thread_pool_impl.h (from r265689, head/cddl/compat/opensolaris/misc/thread_pool_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/compat/opensolaris/misc/thread_pool_impl.h Sat May 24 10:44:40 2014 (r266612, copy of r265689, head/cddl/compat/opensolaris/misc/thread_pool_impl.h) @@ -0,0 +1,99 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * $FreeBSD$ + */ + +#ifndef _THREAD_POOL_IMPL_H +#define _THREAD_POOL_IMPL_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Thread pool implementation definitions. + * See for interface declarations. + */ + +/* + * FIFO queued job + */ +typedef struct tpool_job tpool_job_t; +struct tpool_job { + tpool_job_t *tpj_next; /* list of jobs */ + void (*tpj_func)(void *); /* function to call */ + void *tpj_arg; /* its argument */ +}; + +/* + * List of active threads, linked through their stacks. + */ +typedef struct tpool_active tpool_active_t; +struct tpool_active { + tpool_active_t *tpa_next; /* list of active threads */ + pthread_t tpa_tid; /* active thread id */ +}; + +/* + * The thread pool. + */ +struct tpool { + tpool_t *tp_forw; /* circular list of all thread pools */ + tpool_t *tp_back; + mutex_t tp_mutex; /* protects the pool data */ + cond_t tp_busycv; /* synchronization in tpool_dispatch */ + cond_t tp_workcv; /* synchronization with workers */ + cond_t tp_waitcv; /* synchronization in tpool_wait() */ + tpool_active_t *tp_active; /* threads performing work */ + tpool_job_t *tp_head; /* FIFO job queue */ + tpool_job_t *tp_tail; + pthread_attr_t tp_attr; /* attributes of the workers */ + int tp_flags; /* see below */ + uint_t tp_linger; /* seconds before idle workers exit */ + int tp_njobs; /* number of jobs in job queue */ + int tp_minimum; /* minimum number of worker threads */ + int tp_maximum; /* maximum number of worker threads */ + int tp_current; /* current number of worker threads */ + int tp_idle; /* number of idle workers */ +}; + +/* tp_flags */ +#define TP_WAIT 0x01 /* waiting in tpool_wait() */ +#define TP_SUSPEND 0x02 /* pool is being suspended */ +#define TP_DESTROY 0x04 /* pool is being destroyed */ +#define TP_ABANDON 0x08 /* pool is abandoned (auto-destroy) */ + +#ifdef __cplusplus +} +#endif + +#endif /* _THREAD_POOL_IMPL_H */ Modified: stable/10/cddl/lib/libzfs/Makefile ============================================================================== --- stable/10/cddl/lib/libzfs/Makefile Sat May 24 10:41:37 2014 (r266611) +++ stable/10/cddl/lib/libzfs/Makefile Sat May 24 10:44:40 2014 (r266612) @@ -14,6 +14,7 @@ SRCS= deviceid.c \ fsshare.c \ mkdirp.c \ mnttab.c \ + thread_pool.c \ zmount.c \ zone.c From owner-svn-src-stable-10@FreeBSD.ORG Sat May 24 22:50:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 752519F4; Sat, 24 May 2014 22:50: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 622C92506; Sat, 24 May 2014 22:50: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 s4OMoxAN056872; Sat, 24 May 2014 22:50:59 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OMoxfI056871; Sat, 24 May 2014 22:50:59 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405242250.s4OMoxfI056871@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 24 May 2014 22:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266632 - stable/10/lib/libfetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 22:50:59 -0000 Author: des Date: Sat May 24 22:50:58 2014 New Revision: 266632 URL: http://svnweb.freebsd.org/changeset/base/266632 Log: MFH (r266291): look for root certs in /usr/local first Modified: stable/10/lib/libfetch/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/common.c ============================================================================== --- stable/10/lib/libfetch/common.c Sat May 24 22:46:00 2014 (r266631) +++ stable/10/lib/libfetch/common.c Sat May 24 22:50:58 2014 (r266632) @@ -688,6 +688,8 @@ fetch_ssl_setup_transport_layer(SSL_CTX /* * Configure peer verification based on environment. */ +#define LOCAL_CERT_FILE "/usr/local/etc/ssl/cert.pem" +#define BASE_CERT_FILE "/etc/ssl/cert.pem" static int fetch_ssl_setup_peer_verification(SSL_CTX *ctx, int verbose) { @@ -696,8 +698,12 @@ fetch_ssl_setup_peer_verification(SSL_CT const char *ca_cert_file, *ca_cert_path, *crl_file; if (getenv("SSL_NO_VERIFY_PEER") == NULL) { - ca_cert_file = getenv("SSL_CA_CERT_FILE") != NULL ? - getenv("SSL_CA_CERT_FILE") : "/etc/ssl/cert.pem"; + ca_cert_file = getenv("SSL_CA_CERT_FILE"); + if (ca_cert_file == NULL && + access(LOCAL_CERT_FILE, R_OK) == 0) + ca_cert_file = LOCAL_CERT_FILE; + if (ca_cert_file == NULL) + ca_cert_file = BASE_CERT_FILE; ca_cert_path = getenv("SSL_CA_CERT_PATH"); if (verbose) { fetch_info("Peer verification enabled"); From owner-svn-src-stable-10@FreeBSD.ORG Sun May 25 00:57:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B2D6651B; Sun, 25 May 2014 00:57:07 +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 9FF0F2CCD; Sun, 25 May 2014 00:57:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4P0v7jg011888; Sun, 25 May 2014 00:57:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4P0v7SK011887; Sun, 25 May 2014 00:57:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405250057.s4P0v7SK011887@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 25 May 2014 00:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266640 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 00:57:07 -0000 Author: kib Date: Sun May 25 00:57:07 2014 New Revision: 266640 URL: http://svnweb.freebsd.org/changeset/base/266640 Log: MFC r266411: Fix LD_LIBMAP. Modified: stable/10/libexec/rtld-elf/libmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/libmap.c ============================================================================== --- stable/10/libexec/rtld-elf/libmap.c Sun May 25 00:13:29 2014 (r266639) +++ stable/10/libexec/rtld-elf/libmap.c Sun May 25 00:57:07 2014 (r266640) @@ -80,7 +80,7 @@ lm_init(char *libmap_override) if (libmap_override) { /* - * Do some character replacement to make $LIBMAP look + * Do some character replacement to make $LDLIBMAP look * like a text file, then parse it. */ libmap_override = xstrdup(libmap_override); @@ -94,8 +94,8 @@ lm_init(char *libmap_override) break; } } - lmc_parse(p, strlen(p)); - free(p); + lmc_parse(libmap_override, p - libmap_override); + free(libmap_override); } return (lm_count == 0); From owner-svn-src-stable-10@FreeBSD.ORG Sun May 25 17:00:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D017AF41; Sun, 25 May 2014 17:00: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 A31242F2B; Sun, 25 May 2014 17:00: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 s4PH0NNN054563; Sun, 25 May 2014 17:00:23 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PH0N03054473; Sun, 25 May 2014 17:00:23 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405251700.s4PH0N03054473@svn.freebsd.org> From: Glen Barber Date: Sun, 25 May 2014 17:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266658 - stable/10/release/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 17:00:23 -0000 Author: gjb Date: Sun May 25 17:00:22 2014 New Revision: 266658 URL: http://svnweb.freebsd.org/changeset/base/266658 Log: MFC r266553, r266554: r266553: Add forward-compatibility glue with pkg-1.3: - Use ASSUME_ALWAYS_YES=YES instead of ASSUME_ALWAYS_YES=1 since pkg-1.3 expects "yes" or "true" values. - Before exporting PKG_ABI, strip extra characters from what is parsed from 'pkg -vv'. This causes problems further down when creating the packages directory for inclusion on the dvd1.iso. Previously PKG_ABI would be 'freebsd:9:x86:64', but now is '"freebsd:9:x86:64";' in pkg-1.3. r266554: Disable the main FreeBSD pkg(7) repositories in the dvd repository configuration to avoid fetching from upstream in case there may be conflicts. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/scripts/FreeBSD_install_cdrom.conf stable/10/release/scripts/pkg-stage.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/scripts/FreeBSD_install_cdrom.conf ============================================================================== --- stable/10/release/scripts/FreeBSD_install_cdrom.conf Sun May 25 16:48:12 2014 (r266657) +++ stable/10/release/scripts/FreeBSD_install_cdrom.conf Sun May 25 17:00:22 2014 (r266658) @@ -10,3 +10,7 @@ FreeBSD_install_cdrom: { enabled: yes } +FreeBSD: { + enabled: no +} + Modified: stable/10/release/scripts/pkg-stage.sh ============================================================================== --- stable/10/release/scripts/pkg-stage.sh Sun May 25 16:48:12 2014 (r266657) +++ stable/10/release/scripts/pkg-stage.sh Sun May 25 17:00:22 2014 (r266658) @@ -5,7 +5,7 @@ set -e -export ASSUME_ALWAYS_YES=1 +export ASSUME_ALWAYS_YES="YES" export PKG_DBDIR="/tmp/pkg" export PERMISSIVE="YES" export REPO_AUTOUPDATE="NO" @@ -40,7 +40,10 @@ if [ ! -x /usr/local/sbin/pkg ]; then /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean fi -export PKG_ABI=$(pkg -vv | grep ^ABI | awk '{print $3}') +PKG_ABI=$(pkg -vv | grep ^ABI | awk '{print $3}') +PKG_ABI="${PKG_ABI%\";}" +PKG_ABI="${PKG_ABI#\"}" +export PKG_ABI export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" /bin/mkdir -p ${PKG_CACHEDIR} From owner-svn-src-stable-10@FreeBSD.ORG Sun May 25 17:52:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A3D04E69; Sun, 25 May 2014 17:52: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 905D52342; Sun, 25 May 2014 17:52: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 s4PHqZGA080201; Sun, 25 May 2014 17:52:35 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PHqZeX080199; Sun, 25 May 2014 17:52:35 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201405251752.s4PHqZeX080199@svn.freebsd.org> From: Warren Block Date: Sun, 25 May 2014 17:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266660 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 17:52:35 -0000 Author: wblock (doc committer) Date: Sun May 25 17:52:34 2014 New Revision: 266660 URL: http://svnweb.freebsd.org/changeset/base/266660 Log: MFC r265798, r265815, r266091 Add a man page for the new vt.4 device. Added: stable/10/share/man/man4/vt.4 - copied, changed from r265798, head/share/man/man4/vt.4 Modified: stable/10/share/man/man4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Sun May 25 17:02:40 2014 (r266659) +++ stable/10/share/man/man4/Makefile Sun May 25 17:52:34 2014 (r266660) @@ -561,6 +561,7 @@ MAN= aac.4 \ ${_vmx.4} \ vpo.4 \ vr.4 \ + vt.4 \ vte.4 \ ${_vtnet.4} \ ${_vxge.4} \ Copied and modified: stable/10/share/man/man4/vt.4 (from r265798, head/share/man/man4/vt.4) ============================================================================== --- head/share/man/man4/vt.4 Sat May 10 03:24:45 2014 (r265798, copy source) +++ stable/10/share/man/man4/vt.4 Sun May 25 17:52:34 2014 (r266660) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd May 9, 2014 -.Dt VIRTUAL TERMINALS 4 +.Dt "VIRTUAL TERMINALS" 4 .Os .Sh NAME .Nm vt From owner-svn-src-stable-10@FreeBSD.ORG Sun May 25 18:19:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7D801C8E; Sun, 25 May 2014 18:19:58 +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 5DD812541; Sun, 25 May 2014 18:19:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PIJw8e091160; Sun, 25 May 2014 18:19:58 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PIJvnJ091155; Sun, 25 May 2014 18:19:57 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405251819.s4PIJvnJ091155@svn.freebsd.org> From: Mark Johnston Date: Sun, 25 May 2014 18:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266667 - in stable/10: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/compat/opensolaris/sys sys/cddl/contrib/open... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 18:19:58 -0000 Author: markj Date: Sun May 25 18:19:57 2014 New Revision: 266667 URL: http://svnweb.freebsd.org/changeset/base/266667 Log: MFC r262329: Define the KM_NORMALPRI flag for kmem_alloc(), as it is used in some upstream DTrace code. MFC r262330: 1452 DTrace buffer autoscaling should be less violent illumos/illumos-gate@6fb4854bed54ce82bd8610896b64ddebcd4af706 Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c stable/10/sys/cddl/compat/opensolaris/sys/kmem.h stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d Sun May 25 18:15:37 2014 (r266666) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d Sun May 25 18:19:57 2014 (r266667) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: * Checks that setting "bufresize" to "auto" will cause buffer @@ -34,14 +32,8 @@ * SECTION: Buffers and Buffering/Buffer Resizing Policy; * Options and Tunables/bufsize; * Options and Tunables/bufresize - * - * NOTES: - * We use the undocumented "preallocate" option to make sure dtrace(1M) - * has enough space in its heap to allocate a buffer as large as the - * kernel's trace buffer. */ -#pragma D option preallocate=100t #pragma D option bufresize=auto #pragma D option bufsize=100t Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d Sun May 25 18:15:37 2014 (r266666) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d Sun May 25 18:19:57 2014 (r266667) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: * Checks that setting "bufresize" to "auto" will cause buffer @@ -34,14 +32,8 @@ * SECTION: Buffers and Buffering/Buffer Resizing Policy; * Options and Tunables/aggsize; * Options and Tunables/bufresize - * - * NOTES: - * We use the undocumented "preallocate" option to make sure dtrace(1M) - * has enough space in its heap to allocate a buffer as large as the - * kernel's trace buffer. */ -#pragma D option preallocate=100t #pragma D option bufresize=auto #pragma D option aggsize=100t Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Sun May 25 18:15:37 2014 (r266666) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Sun May 25 18:19:57 2014 (r266667) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -906,30 +904,6 @@ dt_options_load(dtrace_hdl_t *dtp) return (0); } -/*ARGSUSED*/ -static int -dt_opt_preallocate(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) -{ - dtrace_optval_t size; - void *p; - - if (arg == NULL || dt_optval_parse(arg, &size) != 0) - return (dt_set_errno(dtp, EDT_BADOPTVAL)); - - if (size > SIZE_MAX) - size = SIZE_MAX; - - if ((p = dt_zalloc(dtp, size)) == NULL) { - do { - size /= 2; - } while ((p = dt_zalloc(dtp, size)) == NULL); - } - - dt_free(dtp, p); - - return (0); -} - typedef struct dt_option { const char *o_name; int (*o_func)(dtrace_hdl_t *, const char *, uintptr_t); @@ -968,7 +942,6 @@ static const dt_option_t _dtrace_ctoptio { "linktype", dt_opt_linktype }, { "nolibs", dt_opt_cflags, DTRACE_C_NOLIBS }, { "pgmax", dt_opt_pgmax }, - { "preallocate", dt_opt_preallocate }, { "pspec", dt_opt_cflags, DTRACE_C_PSPEC }, { "setenv", dt_opt_setenv, 1 }, { "stdc", dt_opt_stdc }, Modified: stable/10/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/sys/kmem.h Sun May 25 18:15:37 2014 (r266666) +++ stable/10/sys/cddl/compat/opensolaris/sys/kmem.h Sun May 25 18:19:57 2014 (r266667) @@ -47,6 +47,7 @@ MALLOC_DECLARE(M_SOLARIS); #define KM_PUSHPAGE M_WAITOK #define KM_NOSLEEP M_NOWAIT #define KM_NODEBUG M_NODUMP +#define KM_NORMALPRI 0 #define KMC_NODEBUG UMA_ZONE_NODUMP #define KMC_NOTOUCH 0 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun May 25 18:15:37 2014 (r266666) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun May 25 18:19:57 2014 (r266667) @@ -10809,17 +10809,20 @@ dtrace_buffer_activate(dtrace_state_t *s static int dtrace_buffer_alloc(dtrace_buffer_t *bufs, size_t size, int flags, - processorid_t cpu) + processorid_t cpu, int *factor) { #if defined(sun) cpu_t *cp; #endif dtrace_buffer_t *buf; + int allocated = 0, desired = 0; #if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); ASSERT(MUTEX_HELD(&dtrace_lock)); + *factor = 1; + if (size > dtrace_nonroot_maxsize && !PRIV_POLICY_CHOICE(CRED(), PRIV_ALL, B_FALSE)) return (EFBIG); @@ -10843,7 +10846,8 @@ dtrace_buffer_alloc(dtrace_buffer_t *buf ASSERT(buf->dtb_xamot == NULL); - if ((buf->dtb_tomax = kmem_zalloc(size, KM_NOSLEEP)) == NULL) + if ((buf->dtb_tomax = kmem_zalloc(size, + KM_NOSLEEP | KM_NORMALPRI)) == NULL) goto err; buf->dtb_size = size; @@ -10854,7 +10858,8 @@ dtrace_buffer_alloc(dtrace_buffer_t *buf if (flags & DTRACEBUF_NOSWITCH) continue; - if ((buf->dtb_xamot = kmem_zalloc(size, KM_NOSLEEP)) == NULL) + if ((buf->dtb_xamot = kmem_zalloc(size, + KM_NOSLEEP | KM_NORMALPRI)) == NULL) goto err; } while ((cp = cp->cpu_next) != cpu_list); @@ -10868,27 +10873,29 @@ err: continue; buf = &bufs[cp->cpu_id]; + desired += 2; if (buf->dtb_xamot != NULL) { ASSERT(buf->dtb_tomax != NULL); ASSERT(buf->dtb_size == size); kmem_free(buf->dtb_xamot, size); + allocated++; } if (buf->dtb_tomax != NULL) { ASSERT(buf->dtb_size == size); kmem_free(buf->dtb_tomax, size); + allocated++; } buf->dtb_tomax = NULL; buf->dtb_xamot = NULL; buf->dtb_size = 0; } while ((cp = cp->cpu_next) != cpu_list); - - return (ENOMEM); #else int i; + *factor = 1; #if defined(__amd64__) || defined(__mips__) || defined(__powerpc__) /* * FreeBSD isn't good at limiting the amount of memory we @@ -10896,7 +10903,7 @@ err: * to do something that might well end in tears at bedtime. */ if (size > physmem * PAGE_SIZE / (128 * (mp_maxid + 1))) - return(ENOMEM); + return (ENOMEM); #endif ASSERT(MUTEX_HELD(&dtrace_lock)); @@ -10918,7 +10925,8 @@ err: ASSERT(buf->dtb_xamot == NULL); - if ((buf->dtb_tomax = kmem_zalloc(size, KM_NOSLEEP)) == NULL) + if ((buf->dtb_tomax = kmem_zalloc(size, + KM_NOSLEEP | KM_NORMALPRI)) == NULL) goto err; buf->dtb_size = size; @@ -10929,7 +10937,8 @@ err: if (flags & DTRACEBUF_NOSWITCH) continue; - if ((buf->dtb_xamot = kmem_zalloc(size, KM_NOSLEEP)) == NULL) + if ((buf->dtb_xamot = kmem_zalloc(size, + KM_NOSLEEP | KM_NORMALPRI)) == NULL) goto err; } @@ -10945,16 +10954,19 @@ err: continue; buf = &bufs[i]; + desired += 2; if (buf->dtb_xamot != NULL) { ASSERT(buf->dtb_tomax != NULL); ASSERT(buf->dtb_size == size); kmem_free(buf->dtb_xamot, size); + allocated++; } if (buf->dtb_tomax != NULL) { ASSERT(buf->dtb_size == size); kmem_free(buf->dtb_tomax, size); + allocated++; } buf->dtb_tomax = NULL; @@ -10962,9 +10974,10 @@ err: buf->dtb_size = 0; } +#endif + *factor = desired / (allocated > 0 ? allocated : 1); return (ENOMEM); -#endif } /* @@ -12917,7 +12930,7 @@ dtrace_dstate_init(dtrace_dstate_t *dsta if (size < (min = dstate->dtds_chunksize + sizeof (dtrace_dynhash_t))) size = min; - if ((base = kmem_zalloc(size, KM_NOSLEEP)) == NULL) + if ((base = kmem_zalloc(size, KM_NOSLEEP | KM_NORMALPRI)) == NULL) return (ENOMEM); dstate->dtds_size = size; @@ -13369,7 +13382,7 @@ dtrace_state_buffer(dtrace_state_t *stat { dtrace_optval_t *opt = state->dts_options, size; processorid_t cpu = 0;; - int flags = 0, rval; + int flags = 0, rval, factor, divisor = 1; ASSERT(MUTEX_HELD(&dtrace_lock)); ASSERT(MUTEX_HELD(&cpu_lock)); @@ -13399,7 +13412,7 @@ dtrace_state_buffer(dtrace_state_t *stat flags |= DTRACEBUF_INACTIVE; } - for (size = opt[which]; size >= sizeof (uint64_t); size >>= 1) { + for (size = opt[which]; size >= sizeof (uint64_t); size /= divisor) { /* * The size must be 8-byte aligned. If the size is not 8-byte * aligned, drop it down by the difference. @@ -13417,7 +13430,7 @@ dtrace_state_buffer(dtrace_state_t *stat return (E2BIG); } - rval = dtrace_buffer_alloc(buf, size, flags, cpu); + rval = dtrace_buffer_alloc(buf, size, flags, cpu, &factor); if (rval != ENOMEM) { opt[which] = size; @@ -13426,6 +13439,9 @@ dtrace_state_buffer(dtrace_state_t *stat if (opt[DTRACEOPT_BUFRESIZE] == DTRACEOPT_BUFRESIZE_MANUAL) return (rval); + + for (divisor = 2; divisor < factor; divisor <<= 1) + continue; } return (ENOMEM); @@ -13527,7 +13543,8 @@ dtrace_state_go(dtrace_state_t *state, p goto out; } - spec = kmem_zalloc(nspec * sizeof (dtrace_speculation_t), KM_NOSLEEP); + spec = kmem_zalloc(nspec * sizeof (dtrace_speculation_t), + KM_NOSLEEP | KM_NORMALPRI); if (spec == NULL) { rval = ENOMEM; @@ -13538,7 +13555,8 @@ dtrace_state_go(dtrace_state_t *state, p state->dts_nspeculations = (int)nspec; for (i = 0; i < nspec; i++) { - if ((buf = kmem_zalloc(bufsize, KM_NOSLEEP)) == NULL) { + if ((buf = kmem_zalloc(bufsize, + KM_NOSLEEP | KM_NORMALPRI)) == NULL) { rval = ENOMEM; goto err; } From owner-svn-src-stable-10@FreeBSD.ORG Sun May 25 18:24:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EFAB1F89; Sun, 25 May 2014 18:24: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 C23C325E0; Sun, 25 May 2014 18:24: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 s4PIOesE094948; Sun, 25 May 2014 18:24:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PIOejH094947; Sun, 25 May 2014 18:24:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405251824.s4PIOejH094947@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 25 May 2014 18:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266669 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 18:24:41 -0000 Author: hselasky Date: Sun May 25 18:24:40 2014 New Revision: 266669 URL: http://svnweb.freebsd.org/changeset/base/266669 Log: MFC r266541: - Fix a bug where the TLBPC value was forced to being odd for IN direction isochronous transfers. - Remove setting of fields which does not belong to the respective TRBs. These fields are currently set as zero and this is more a cosmetic change. Modified: stable/10/sys/dev/usb/controller/xhci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.c Sun May 25 18:20:50 2014 (r266668) +++ stable/10/sys/dev/usb/controller/xhci.c Sun May 25 18:24:40 2014 (r266669) @@ -1849,31 +1849,25 @@ restart: XHCI_TRB_3_ISO_SIA_BIT; } if (temp->direction == UE_DIR_IN) - dword |= XHCI_TRB_3_DIR_IN | XHCI_TRB_3_ISP_BIT; + dword |= XHCI_TRB_3_ISP_BIT; break; case XHCI_TRB_TYPE_DATA_STAGE: dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | - XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_DATA_STAGE) | - XHCI_TRB_3_TBC_SET(temp->tbc) | - XHCI_TRB_3_TLBPC_SET(temp->tlbpc); + XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_DATA_STAGE); if (temp->direction == UE_DIR_IN) dword |= XHCI_TRB_3_DIR_IN | XHCI_TRB_3_ISP_BIT; break; case XHCI_TRB_TYPE_STATUS_STAGE: dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | - XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_STATUS_STAGE) | - XHCI_TRB_3_TBC_SET(temp->tbc) | - XHCI_TRB_3_TLBPC_SET(temp->tlbpc); + XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_STATUS_STAGE); if (temp->direction == UE_DIR_IN) dword |= XHCI_TRB_3_DIR_IN; break; default: /* XHCI_TRB_TYPE_NORMAL */ dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | - XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL) | - XHCI_TRB_3_TBC_SET(temp->tbc) | - XHCI_TRB_3_TLBPC_SET(temp->tlbpc); + XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL); if (temp->direction == UE_DIR_IN) - dword |= XHCI_TRB_3_DIR_IN | XHCI_TRB_3_ISP_BIT; + dword |= XHCI_TRB_3_ISP_BIT; break; } td->td_trb[x].dwTrb3 = htole32(dword); From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 01:37:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 75C5DDFA; Mon, 26 May 2014 01:37: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 6171F25F6; Mon, 26 May 2014 01:37: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 s4Q1biYE087755; Mon, 26 May 2014 01:37:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4Q1bh0Q087752; Mon, 26 May 2014 01:37:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405260137.s4Q1bh0Q087752@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 26 May 2014 01:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266676 - in stable/10/sys/powerpc: powerpc ps3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 01:37:44 -0000 Author: nwhitehorn Date: Mon May 26 01:37:43 2014 New Revision: 266676 URL: http://svnweb.freebsd.org/changeset/base/266676 Log: MFC r265900: Repair some races in IPI handling: 1. Make sure IPI mask is set before sending the IPI 2. Operate atomically on PS3 PIC outstanding interrupt list 3. Make sure IPIs are EOI'ed before, not after, processing. Without this, a second IPI could be sent partway through processing the first one, get erroneously acknowledge by the EOI to the first, and be lost. In particular in the case of smp_rendezvous(), this can be fatal. In combination, this makes the PS3 boot SMP again. It probably also fixes some latent bugs elsewhere. Modified: stable/10/sys/powerpc/powerpc/intr_machdep.c stable/10/sys/powerpc/powerpc/mp_machdep.c stable/10/sys/powerpc/ps3/ps3pic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/intr_machdep.c Sun May 25 19:28:34 2014 (r266675) +++ stable/10/sys/powerpc/powerpc/intr_machdep.c Mon May 26 01:37:43 2014 (r266676) @@ -103,6 +103,7 @@ struct powerpc_intr { enum intr_trigger trig; enum intr_polarity pol; int fwcode; + int ipi; }; struct pic { @@ -203,6 +204,8 @@ intr_lookup(u_int irq) i->irq = irq; i->pic = NULL; i->vector = -1; + i->fwcode = 0; + i->ipi = 0; #ifdef SMP i->cpu = all_cpus; @@ -415,6 +418,15 @@ powerpc_enable_intr(void) printf("unable to setup IPI handler\n"); return (error); } + + /* + * Some subterfuge: disable late EOI and mark this + * as an IPI to the dispatch layer. + */ + i = intr_lookup(MAP_IRQ(piclist[n].node, + piclist[n].irqs)); + i->event->ie_post_filter = NULL; + i->ipi = 1; } } #endif @@ -568,6 +580,13 @@ powerpc_dispatch_intr(u_int vector, stru ie = i->event; KASSERT(ie != NULL, ("%s: interrupt without an event", __func__)); + /* + * IPIs are magical and need to be EOI'ed before filtering. + * This prevents races in IPI handling. + */ + if (i->ipi) + PIC_EOI(i->pic, i->intline); + if (intr_event_handle(ie, tf) != 0) { goto stray; } Modified: stable/10/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/mp_machdep.c Sun May 25 19:28:34 2014 (r266675) +++ stable/10/sys/powerpc/powerpc/mp_machdep.c Mon May 26 01:37:43 2014 (r266676) @@ -336,6 +336,7 @@ ipi_send(struct pcpu *pc, int ipi) pc, pc->pc_cpuid, ipi); atomic_set_32(&pc->pc_ipimask, (1 << ipi)); + powerpc_sync(); PIC_IPI(root_pic, pc->pc_cpuid); CTR1(KTR_SMP, "%s: sent", __func__); Modified: stable/10/sys/powerpc/ps3/ps3pic.c ============================================================================== --- stable/10/sys/powerpc/ps3/ps3pic.c Sun May 25 19:28:34 2014 (r266675) +++ stable/10/sys/powerpc/ps3/ps3pic.c Mon May 26 01:37:43 2014 (r266676) @@ -166,12 +166,13 @@ ps3pic_dispatch(device_t dev, struct tra sc = device_get_softc(dev); if (PCPU_GET(cpuid) == 0) { - bitmap = sc->bitmap_thread0[0]; + bitmap = atomic_readandclear_64(&sc->bitmap_thread0[0]); mask = sc->mask_thread0[0]; } else { - bitmap = sc->bitmap_thread1[0]; + bitmap = atomic_readandclear_64(&sc->bitmap_thread1[0]); mask = sc->mask_thread1[0]; } + powerpc_sync(); while ((irq = ffsl(bitmap & mask) - 1) != -1) { bitmap &= ~(1UL << irq); From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 07:02:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3DEE977D; Mon, 26 May 2014 07:02: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 2AC122EC1; Mon, 26 May 2014 07:02: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 s4Q723Ac035267; Mon, 26 May 2014 07:02:03 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4Q7233C035266; Mon, 26 May 2014 07:02:03 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405260702.s4Q7233C035266@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 26 May 2014 07:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266678 - stable/10/sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 07:02:04 -0000 Author: ae Date: Mon May 26 07:02:03 2014 New Revision: 266678 URL: http://svnweb.freebsd.org/changeset/base/266678 Log: MFC r266399: Since ipfw nat configures all options in one step, we should set all bits in the mask when calling LibAliasSetMode() to properly clear unneeded options. PR: 189655 Modified: stable/10/sys/netpfil/ipfw/ip_fw_nat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_nat.c Mon May 26 02:19:50 2014 (r266677) +++ stable/10/sys/netpfil/ipfw/ip_fw_nat.c Mon May 26 07:02:03 2014 (r266678) @@ -441,7 +441,7 @@ ipfw_nat_cfg(struct sockopt *sopt) ptr->ip = cfg->ip; ptr->redir_cnt = cfg->redir_cnt; ptr->mode = cfg->mode; - LibAliasSetMode(ptr->lib, cfg->mode, cfg->mode); + LibAliasSetMode(ptr->lib, cfg->mode, ~0); LibAliasSetAddress(ptr->lib, ptr->ip); memcpy(ptr->if_name, cfg->if_name, IF_NAMESIZE); From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 07:04:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AD51C9A5; Mon, 26 May 2014 07:04: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 9AA432ED1; Mon, 26 May 2014 07:04: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 s4Q74UBG035784; Mon, 26 May 2014 07:04:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4Q74UEm035783; Mon, 26 May 2014 07:04:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405260704.s4Q74UEm035783@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 26 May 2014 07:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266679 - stable/10/sys/geom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 07:04:30 -0000 Author: ae Date: Mon May 26 07:04:30 2014 New Revision: 266679 URL: http://svnweb.freebsd.org/changeset/base/266679 Log: MFC r266445: Add a topology trace to the g_spoil_event. Modified: stable/10/sys/geom/geom_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_subr.c ============================================================================== --- stable/10/sys/geom/geom_subr.c Mon May 26 07:02:03 2014 (r266678) +++ stable/10/sys/geom/geom_subr.c Mon May 26 07:04:30 2014 (r266679) @@ -1064,6 +1064,8 @@ g_spoil_event(void *arg, int flag) return; pp = arg; G_VALID_PROVIDER(pp); + g_trace(G_T_TOPOLOGY, "%s %p(%s:%s:%s)", __func__, pp, + pp->geom->class->name, pp->geom->name, pp->name); for (cp = LIST_FIRST(&pp->consumers); cp != NULL; cp = cp2) { cp2 = LIST_NEXT(cp, consumers); if ((cp->flags & G_CF_SPOILED) == 0) From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 11:16:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7257B8A6; Mon, 26 May 2014 11:16: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 5EA512745; Mon, 26 May 2014 11:16: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 s4QBGTgG049778; Mon, 26 May 2014 11:16:29 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QBGTbS049777; Mon, 26 May 2014 11:16:29 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405261116.s4QBGTbS049777@svn.freebsd.org> From: Christian Brueffer Date: Mon, 26 May 2014 11:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266686 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 11:16:29 -0000 Author: brueffer Date: Mon May 26 11:16:28 2014 New Revision: 266686 URL: http://svnweb.freebsd.org/changeset/base/266686 Log: Catch up supported hardware obmitted in r265269, now that this branch has support for it. Modified: stable/10/share/man/man4/urtwn.4 Modified: stable/10/share/man/man4/urtwn.4 ============================================================================== --- stable/10/share/man/man4/urtwn.4 Mon May 26 09:56:09 2014 (r266685) +++ stable/10/share/man/man4/urtwn.4 Mon May 26 11:16:28 2014 (r266686) @@ -82,7 +82,7 @@ firmware license .Sh HARDWARE The .Nm -driver supports Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU based USB +driver supports Realtek RTL8188CU/RTL8188EU/RTL8192CU based USB IEEE 802.11b/g/n wireless network adapters, including: .Pp .Bl -tag -width Ds -offset indent -compact From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 15:28:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 560D97B4; Mon, 26 May 2014 15:28: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 3DDFD2E14; Mon, 26 May 2014 15:28: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 s4QFSlAf091432; Mon, 26 May 2014 15:28:47 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QFSTZH091115; Mon, 26 May 2014 15:28:29 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201405261528.s4QFSTZH091115@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 26 May 2014 15:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266692 - in stable/10/contrib/sendmail: . cf cf/cf cf/domain cf/feature cf/hack cf/m4 cf/mailer cf/ostype cf/sh contrib doc/op editmap include/libmilter include/libsmdb include/sendmai... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 15:28:47 -0000 Author: gshapiro Date: Mon May 26 15:28:28 2014 New Revision: 266692 URL: http://svnweb.freebsd.org/changeset/base/266692 Log: MFC: Merge sendmail 8.14.9 to HEAD Modified: stable/10/contrib/sendmail/CACerts stable/10/contrib/sendmail/FAQ stable/10/contrib/sendmail/INSTALL stable/10/contrib/sendmail/KNOWNBUGS stable/10/contrib/sendmail/LICENSE stable/10/contrib/sendmail/Makefile stable/10/contrib/sendmail/PGPKEYS stable/10/contrib/sendmail/README stable/10/contrib/sendmail/RELEASE_NOTES stable/10/contrib/sendmail/cf/README stable/10/contrib/sendmail/cf/cf/Makefile stable/10/contrib/sendmail/cf/cf/README stable/10/contrib/sendmail/cf/cf/chez.cs.mc stable/10/contrib/sendmail/cf/cf/clientproto.mc stable/10/contrib/sendmail/cf/cf/cs-hpux10.mc stable/10/contrib/sendmail/cf/cf/cs-hpux9.mc stable/10/contrib/sendmail/cf/cf/cs-osf1.mc stable/10/contrib/sendmail/cf/cf/cs-solaris2.mc stable/10/contrib/sendmail/cf/cf/cs-sunos4.1.mc stable/10/contrib/sendmail/cf/cf/cs-ultrix4.mc stable/10/contrib/sendmail/cf/cf/cyrusproto.mc stable/10/contrib/sendmail/cf/cf/generic-bsd4.4.mc stable/10/contrib/sendmail/cf/cf/generic-hpux10.mc stable/10/contrib/sendmail/cf/cf/generic-hpux9.mc stable/10/contrib/sendmail/cf/cf/generic-linux.mc stable/10/contrib/sendmail/cf/cf/generic-mpeix.mc stable/10/contrib/sendmail/cf/cf/generic-nextstep3.3.mc stable/10/contrib/sendmail/cf/cf/generic-osf1.mc stable/10/contrib/sendmail/cf/cf/generic-solaris.mc stable/10/contrib/sendmail/cf/cf/generic-sunos4.1.mc stable/10/contrib/sendmail/cf/cf/generic-ultrix4.mc stable/10/contrib/sendmail/cf/cf/huginn.cs.mc stable/10/contrib/sendmail/cf/cf/knecht.mc stable/10/contrib/sendmail/cf/cf/mail.cs.mc stable/10/contrib/sendmail/cf/cf/mail.eecs.mc stable/10/contrib/sendmail/cf/cf/mailspool.cs.mc stable/10/contrib/sendmail/cf/cf/python.cs.mc stable/10/contrib/sendmail/cf/cf/s2k-osf1.mc stable/10/contrib/sendmail/cf/cf/s2k-ultrix4.mc stable/10/contrib/sendmail/cf/cf/submit.cf stable/10/contrib/sendmail/cf/cf/submit.mc stable/10/contrib/sendmail/cf/cf/tcpproto.mc stable/10/contrib/sendmail/cf/cf/ucbarpa.mc stable/10/contrib/sendmail/cf/cf/ucbvax.mc stable/10/contrib/sendmail/cf/cf/uucpproto.mc stable/10/contrib/sendmail/cf/cf/vangogh.cs.mc stable/10/contrib/sendmail/cf/domain/Berkeley.EDU.m4 stable/10/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4 stable/10/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4 stable/10/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4 stable/10/contrib/sendmail/cf/domain/berkeley-only.m4 stable/10/contrib/sendmail/cf/domain/generic.m4 stable/10/contrib/sendmail/cf/feature/accept_unqualified_senders.m4 stable/10/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4 stable/10/contrib/sendmail/cf/feature/access_db.m4 stable/10/contrib/sendmail/cf/feature/allmasquerade.m4 stable/10/contrib/sendmail/cf/feature/always_add_domain.m4 stable/10/contrib/sendmail/cf/feature/authinfo.m4 stable/10/contrib/sendmail/cf/feature/badmx.m4 stable/10/contrib/sendmail/cf/feature/bestmx_is_local.m4 stable/10/contrib/sendmail/cf/feature/bitdomain.m4 stable/10/contrib/sendmail/cf/feature/blacklist_recipients.m4 stable/10/contrib/sendmail/cf/feature/block_bad_helo.m4 stable/10/contrib/sendmail/cf/feature/compat_check.m4 stable/10/contrib/sendmail/cf/feature/conncontrol.m4 stable/10/contrib/sendmail/cf/feature/delay_checks.m4 stable/10/contrib/sendmail/cf/feature/dnsbl.m4 stable/10/contrib/sendmail/cf/feature/domaintable.m4 stable/10/contrib/sendmail/cf/feature/enhdnsbl.m4 stable/10/contrib/sendmail/cf/feature/generics_entire_domain.m4 stable/10/contrib/sendmail/cf/feature/genericstable.m4 stable/10/contrib/sendmail/cf/feature/greet_pause.m4 stable/10/contrib/sendmail/cf/feature/ldap_routing.m4 stable/10/contrib/sendmail/cf/feature/limited_masquerade.m4 stable/10/contrib/sendmail/cf/feature/local_lmtp.m4 stable/10/contrib/sendmail/cf/feature/local_no_masquerade.m4 stable/10/contrib/sendmail/cf/feature/local_procmail.m4 stable/10/contrib/sendmail/cf/feature/lookupdotdomain.m4 stable/10/contrib/sendmail/cf/feature/loose_relay_check.m4 stable/10/contrib/sendmail/cf/feature/mailertable.m4 stable/10/contrib/sendmail/cf/feature/masquerade_entire_domain.m4 stable/10/contrib/sendmail/cf/feature/masquerade_envelope.m4 stable/10/contrib/sendmail/cf/feature/msp.m4 stable/10/contrib/sendmail/cf/feature/mtamark.m4 stable/10/contrib/sendmail/cf/feature/no_default_msa.m4 stable/10/contrib/sendmail/cf/feature/nocanonify.m4 stable/10/contrib/sendmail/cf/feature/notsticky.m4 stable/10/contrib/sendmail/cf/feature/nouucp.m4 stable/10/contrib/sendmail/cf/feature/nullclient.m4 stable/10/contrib/sendmail/cf/feature/preserve_local_plus_detail.m4 stable/10/contrib/sendmail/cf/feature/preserve_luser_host.m4 stable/10/contrib/sendmail/cf/feature/promiscuous_relay.m4 stable/10/contrib/sendmail/cf/feature/queuegroup.m4 stable/10/contrib/sendmail/cf/feature/ratecontrol.m4 stable/10/contrib/sendmail/cf/feature/redirect.m4 stable/10/contrib/sendmail/cf/feature/relay_based_on_MX.m4 stable/10/contrib/sendmail/cf/feature/relay_entire_domain.m4 stable/10/contrib/sendmail/cf/feature/relay_hosts_only.m4 stable/10/contrib/sendmail/cf/feature/relay_local_from.m4 stable/10/contrib/sendmail/cf/feature/relay_mail_from.m4 stable/10/contrib/sendmail/cf/feature/require_rdns.m4 stable/10/contrib/sendmail/cf/feature/smrsh.m4 stable/10/contrib/sendmail/cf/feature/stickyhost.m4 stable/10/contrib/sendmail/cf/feature/use_client_ptr.m4 stable/10/contrib/sendmail/cf/feature/use_ct_file.m4 stable/10/contrib/sendmail/cf/feature/use_cw_file.m4 stable/10/contrib/sendmail/cf/feature/uucpdomain.m4 stable/10/contrib/sendmail/cf/feature/virtuser_entire_domain.m4 stable/10/contrib/sendmail/cf/feature/virtusertable.m4 stable/10/contrib/sendmail/cf/hack/cssubdomain.m4 stable/10/contrib/sendmail/cf/m4/cf.m4 stable/10/contrib/sendmail/cf/m4/cfhead.m4 stable/10/contrib/sendmail/cf/m4/proto.m4 stable/10/contrib/sendmail/cf/m4/version.m4 stable/10/contrib/sendmail/cf/mailer/cyrus.m4 stable/10/contrib/sendmail/cf/mailer/cyrusv2.m4 stable/10/contrib/sendmail/cf/mailer/fax.m4 stable/10/contrib/sendmail/cf/mailer/local.m4 stable/10/contrib/sendmail/cf/mailer/mail11.m4 stable/10/contrib/sendmail/cf/mailer/phquery.m4 stable/10/contrib/sendmail/cf/mailer/pop.m4 stable/10/contrib/sendmail/cf/mailer/procmail.m4 stable/10/contrib/sendmail/cf/mailer/qpage.m4 stable/10/contrib/sendmail/cf/mailer/smtp.m4 stable/10/contrib/sendmail/cf/mailer/usenet.m4 stable/10/contrib/sendmail/cf/mailer/uucp.m4 stable/10/contrib/sendmail/cf/ostype/a-ux.m4 stable/10/contrib/sendmail/cf/ostype/aix3.m4 stable/10/contrib/sendmail/cf/ostype/aix4.m4 stable/10/contrib/sendmail/cf/ostype/aix5.m4 stable/10/contrib/sendmail/cf/ostype/altos.m4 stable/10/contrib/sendmail/cf/ostype/amdahl-uts.m4 stable/10/contrib/sendmail/cf/ostype/bsd4.3.m4 stable/10/contrib/sendmail/cf/ostype/bsd4.4.m4 stable/10/contrib/sendmail/cf/ostype/bsdi.m4 stable/10/contrib/sendmail/cf/ostype/bsdi1.0.m4 stable/10/contrib/sendmail/cf/ostype/bsdi2.0.m4 stable/10/contrib/sendmail/cf/ostype/darwin.m4 stable/10/contrib/sendmail/cf/ostype/dgux.m4 stable/10/contrib/sendmail/cf/ostype/domainos.m4 stable/10/contrib/sendmail/cf/ostype/dragonfly.m4 stable/10/contrib/sendmail/cf/ostype/dynix3.2.m4 stable/10/contrib/sendmail/cf/ostype/freebsd4.m4 stable/10/contrib/sendmail/cf/ostype/freebsd5.m4 stable/10/contrib/sendmail/cf/ostype/freebsd6.m4 stable/10/contrib/sendmail/cf/ostype/gnu.m4 stable/10/contrib/sendmail/cf/ostype/hpux10.m4 stable/10/contrib/sendmail/cf/ostype/hpux11.m4 stable/10/contrib/sendmail/cf/ostype/hpux9.m4 stable/10/contrib/sendmail/cf/ostype/irix4.m4 stable/10/contrib/sendmail/cf/ostype/irix5.m4 stable/10/contrib/sendmail/cf/ostype/irix6.m4 stable/10/contrib/sendmail/cf/ostype/isc4.1.m4 stable/10/contrib/sendmail/cf/ostype/linux.m4 stable/10/contrib/sendmail/cf/ostype/maxion.m4 stable/10/contrib/sendmail/cf/ostype/mklinux.m4 stable/10/contrib/sendmail/cf/ostype/mpeix.m4 stable/10/contrib/sendmail/cf/ostype/nextstep.m4 stable/10/contrib/sendmail/cf/ostype/openbsd.m4 stable/10/contrib/sendmail/cf/ostype/osf1.m4 stable/10/contrib/sendmail/cf/ostype/powerux.m4 stable/10/contrib/sendmail/cf/ostype/ptx2.m4 stable/10/contrib/sendmail/cf/ostype/qnx.m4 stable/10/contrib/sendmail/cf/ostype/riscos4.5.m4 stable/10/contrib/sendmail/cf/ostype/sco-uw-2.1.m4 stable/10/contrib/sendmail/cf/ostype/sco3.2.m4 stable/10/contrib/sendmail/cf/ostype/sinix.m4 stable/10/contrib/sendmail/cf/ostype/solaris11.m4 stable/10/contrib/sendmail/cf/ostype/solaris2.m4 stable/10/contrib/sendmail/cf/ostype/solaris2.ml.m4 stable/10/contrib/sendmail/cf/ostype/solaris2.pre5.m4 stable/10/contrib/sendmail/cf/ostype/solaris8.m4 stable/10/contrib/sendmail/cf/ostype/sunos3.5.m4 stable/10/contrib/sendmail/cf/ostype/sunos4.1.m4 stable/10/contrib/sendmail/cf/ostype/svr4.m4 stable/10/contrib/sendmail/cf/ostype/ultrix4.m4 stable/10/contrib/sendmail/cf/ostype/unicos.m4 stable/10/contrib/sendmail/cf/ostype/unicosmk.m4 stable/10/contrib/sendmail/cf/ostype/unicosmp.m4 stable/10/contrib/sendmail/cf/ostype/unixware7.m4 stable/10/contrib/sendmail/cf/ostype/unknown.m4 stable/10/contrib/sendmail/cf/ostype/uxpds.m4 stable/10/contrib/sendmail/cf/sendmail.schema stable/10/contrib/sendmail/cf/sh/makeinfo.sh stable/10/contrib/sendmail/contrib/README stable/10/contrib/sendmail/contrib/bsdi.mc stable/10/contrib/sendmail/contrib/buildvirtuser stable/10/contrib/sendmail/contrib/cidrexpand stable/10/contrib/sendmail/contrib/dnsblaccess.m4 stable/10/contrib/sendmail/contrib/link_hash.sh stable/10/contrib/sendmail/contrib/qtool.8 stable/10/contrib/sendmail/contrib/qtool.pl stable/10/contrib/sendmail/contrib/smcontrol.pl stable/10/contrib/sendmail/contrib/socketmapClient.pl stable/10/contrib/sendmail/contrib/socketmapServer.pl stable/10/contrib/sendmail/doc/op/Makefile stable/10/contrib/sendmail/doc/op/README stable/10/contrib/sendmail/doc/op/op.me stable/10/contrib/sendmail/editmap/Makefile stable/10/contrib/sendmail/editmap/Makefile.m4 stable/10/contrib/sendmail/editmap/editmap.8 stable/10/contrib/sendmail/editmap/editmap.c stable/10/contrib/sendmail/include/libmilter/mfapi.h stable/10/contrib/sendmail/include/libmilter/mfdef.h stable/10/contrib/sendmail/include/libmilter/milter.h stable/10/contrib/sendmail/include/libsmdb/smdb.h stable/10/contrib/sendmail/include/sendmail/mailstats.h stable/10/contrib/sendmail/include/sendmail/pathnames.h stable/10/contrib/sendmail/include/sendmail/sendmail.h stable/10/contrib/sendmail/include/sm/assert.h stable/10/contrib/sendmail/include/sm/bdb.h stable/10/contrib/sendmail/include/sm/bitops.h stable/10/contrib/sendmail/include/sm/cdefs.h stable/10/contrib/sendmail/include/sm/cf.h stable/10/contrib/sendmail/include/sm/clock.h stable/10/contrib/sendmail/include/sm/conf.h stable/10/contrib/sendmail/include/sm/config.h stable/10/contrib/sendmail/include/sm/debug.h stable/10/contrib/sendmail/include/sm/errstring.h stable/10/contrib/sendmail/include/sm/exc.h stable/10/contrib/sendmail/include/sm/fdset.h stable/10/contrib/sendmail/include/sm/gen.h stable/10/contrib/sendmail/include/sm/heap.h stable/10/contrib/sendmail/include/sm/io.h stable/10/contrib/sendmail/include/sm/ldap.h stable/10/contrib/sendmail/include/sm/limits.h stable/10/contrib/sendmail/include/sm/mbdb.h stable/10/contrib/sendmail/include/sm/misc.h stable/10/contrib/sendmail/include/sm/os/sm_os_aix.h stable/10/contrib/sendmail/include/sm/os/sm_os_dragonfly.h stable/10/contrib/sendmail/include/sm/os/sm_os_freebsd.h stable/10/contrib/sendmail/include/sm/os/sm_os_hp.h stable/10/contrib/sendmail/include/sm/os/sm_os_irix.h stable/10/contrib/sendmail/include/sm/os/sm_os_linux.h stable/10/contrib/sendmail/include/sm/os/sm_os_mpeix.h stable/10/contrib/sendmail/include/sm/os/sm_os_next.h stable/10/contrib/sendmail/include/sm/os/sm_os_openbsd.h stable/10/contrib/sendmail/include/sm/os/sm_os_openunix.h stable/10/contrib/sendmail/include/sm/os/sm_os_osf1.h stable/10/contrib/sendmail/include/sm/os/sm_os_qnx.h stable/10/contrib/sendmail/include/sm/os/sm_os_sunos.h stable/10/contrib/sendmail/include/sm/os/sm_os_ultrix.h stable/10/contrib/sendmail/include/sm/os/sm_os_unicos.h stable/10/contrib/sendmail/include/sm/os/sm_os_unicosmk.h stable/10/contrib/sendmail/include/sm/os/sm_os_unicosmp.h stable/10/contrib/sendmail/include/sm/os/sm_os_unixware.h stable/10/contrib/sendmail/include/sm/path.h stable/10/contrib/sendmail/include/sm/rpool.h stable/10/contrib/sendmail/include/sm/sem.h stable/10/contrib/sendmail/include/sm/setjmp.h stable/10/contrib/sendmail/include/sm/shm.h stable/10/contrib/sendmail/include/sm/signal.h stable/10/contrib/sendmail/include/sm/string.h stable/10/contrib/sendmail/include/sm/sysexits.h stable/10/contrib/sendmail/include/sm/tailq.h stable/10/contrib/sendmail/include/sm/test.h stable/10/contrib/sendmail/include/sm/time.h stable/10/contrib/sendmail/include/sm/types.h stable/10/contrib/sendmail/include/sm/varargs.h stable/10/contrib/sendmail/include/sm/xtrap.h stable/10/contrib/sendmail/libmilter/Makefile stable/10/contrib/sendmail/libmilter/Makefile.m4 stable/10/contrib/sendmail/libmilter/README stable/10/contrib/sendmail/libmilter/comm.c stable/10/contrib/sendmail/libmilter/docs/api.html stable/10/contrib/sendmail/libmilter/docs/design.html stable/10/contrib/sendmail/libmilter/docs/index.html stable/10/contrib/sendmail/libmilter/docs/installation.html stable/10/contrib/sendmail/libmilter/docs/other.html stable/10/contrib/sendmail/libmilter/docs/overview.html stable/10/contrib/sendmail/libmilter/docs/sample.html stable/10/contrib/sendmail/libmilter/docs/smfi_addheader.html stable/10/contrib/sendmail/libmilter/docs/smfi_addrcpt.html stable/10/contrib/sendmail/libmilter/docs/smfi_addrcpt_par.html stable/10/contrib/sendmail/libmilter/docs/smfi_chgfrom.html stable/10/contrib/sendmail/libmilter/docs/smfi_chgheader.html stable/10/contrib/sendmail/libmilter/docs/smfi_delrcpt.html stable/10/contrib/sendmail/libmilter/docs/smfi_getpriv.html stable/10/contrib/sendmail/libmilter/docs/smfi_getsymval.html stable/10/contrib/sendmail/libmilter/docs/smfi_insheader.html stable/10/contrib/sendmail/libmilter/docs/smfi_main.html stable/10/contrib/sendmail/libmilter/docs/smfi_opensocket.html stable/10/contrib/sendmail/libmilter/docs/smfi_progress.html stable/10/contrib/sendmail/libmilter/docs/smfi_quarantine.html stable/10/contrib/sendmail/libmilter/docs/smfi_register.html stable/10/contrib/sendmail/libmilter/docs/smfi_replacebody.html stable/10/contrib/sendmail/libmilter/docs/smfi_setbacklog.html stable/10/contrib/sendmail/libmilter/docs/smfi_setconn.html stable/10/contrib/sendmail/libmilter/docs/smfi_setdbg.html stable/10/contrib/sendmail/libmilter/docs/smfi_setmlreply.html stable/10/contrib/sendmail/libmilter/docs/smfi_setpriv.html stable/10/contrib/sendmail/libmilter/docs/smfi_setreply.html stable/10/contrib/sendmail/libmilter/docs/smfi_setsymlist.html stable/10/contrib/sendmail/libmilter/docs/smfi_settimeout.html stable/10/contrib/sendmail/libmilter/docs/smfi_stop.html stable/10/contrib/sendmail/libmilter/docs/smfi_version.html stable/10/contrib/sendmail/libmilter/docs/xxfi_abort.html stable/10/contrib/sendmail/libmilter/docs/xxfi_body.html stable/10/contrib/sendmail/libmilter/docs/xxfi_close.html stable/10/contrib/sendmail/libmilter/docs/xxfi_connect.html stable/10/contrib/sendmail/libmilter/docs/xxfi_data.html stable/10/contrib/sendmail/libmilter/docs/xxfi_envfrom.html stable/10/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html stable/10/contrib/sendmail/libmilter/docs/xxfi_eoh.html stable/10/contrib/sendmail/libmilter/docs/xxfi_eom.html stable/10/contrib/sendmail/libmilter/docs/xxfi_header.html stable/10/contrib/sendmail/libmilter/docs/xxfi_helo.html stable/10/contrib/sendmail/libmilter/docs/xxfi_negotiate.html stable/10/contrib/sendmail/libmilter/docs/xxfi_unknown.html stable/10/contrib/sendmail/libmilter/engine.c stable/10/contrib/sendmail/libmilter/example.c stable/10/contrib/sendmail/libmilter/handler.c stable/10/contrib/sendmail/libmilter/libmilter.h stable/10/contrib/sendmail/libmilter/listener.c stable/10/contrib/sendmail/libmilter/main.c stable/10/contrib/sendmail/libmilter/monitor.c stable/10/contrib/sendmail/libmilter/signal.c stable/10/contrib/sendmail/libmilter/sm_gethost.c stable/10/contrib/sendmail/libmilter/smfi.c stable/10/contrib/sendmail/libmilter/worker.c stable/10/contrib/sendmail/libsm/Makefile stable/10/contrib/sendmail/libsm/Makefile.m4 stable/10/contrib/sendmail/libsm/README stable/10/contrib/sendmail/libsm/assert.c stable/10/contrib/sendmail/libsm/assert.html stable/10/contrib/sendmail/libsm/b-strcmp.c stable/10/contrib/sendmail/libsm/b-strl.c stable/10/contrib/sendmail/libsm/cdefs.html stable/10/contrib/sendmail/libsm/cf.c stable/10/contrib/sendmail/libsm/clock.c stable/10/contrib/sendmail/libsm/clrerr.c stable/10/contrib/sendmail/libsm/config.c stable/10/contrib/sendmail/libsm/debug.c stable/10/contrib/sendmail/libsm/debug.html stable/10/contrib/sendmail/libsm/errstring.c stable/10/contrib/sendmail/libsm/exc.c stable/10/contrib/sendmail/libsm/exc.html stable/10/contrib/sendmail/libsm/fclose.c stable/10/contrib/sendmail/libsm/feof.c stable/10/contrib/sendmail/libsm/ferror.c stable/10/contrib/sendmail/libsm/fflush.c stable/10/contrib/sendmail/libsm/fget.c stable/10/contrib/sendmail/libsm/findfp.c stable/10/contrib/sendmail/libsm/flags.c stable/10/contrib/sendmail/libsm/fopen.c stable/10/contrib/sendmail/libsm/fpos.c stable/10/contrib/sendmail/libsm/fprintf.c stable/10/contrib/sendmail/libsm/fpurge.c stable/10/contrib/sendmail/libsm/fput.c stable/10/contrib/sendmail/libsm/fread.c stable/10/contrib/sendmail/libsm/fscanf.c stable/10/contrib/sendmail/libsm/fseek.c stable/10/contrib/sendmail/libsm/fvwrite.c stable/10/contrib/sendmail/libsm/fvwrite.h stable/10/contrib/sendmail/libsm/fwalk.c stable/10/contrib/sendmail/libsm/fwrite.c stable/10/contrib/sendmail/libsm/gen.html stable/10/contrib/sendmail/libsm/get.c stable/10/contrib/sendmail/libsm/glue.h stable/10/contrib/sendmail/libsm/heap.c stable/10/contrib/sendmail/libsm/heap.html stable/10/contrib/sendmail/libsm/index.html stable/10/contrib/sendmail/libsm/inet6_ntop.c stable/10/contrib/sendmail/libsm/io.html stable/10/contrib/sendmail/libsm/ldap.c stable/10/contrib/sendmail/libsm/local.h stable/10/contrib/sendmail/libsm/makebuf.c stable/10/contrib/sendmail/libsm/match.c stable/10/contrib/sendmail/libsm/mbdb.c stable/10/contrib/sendmail/libsm/memstat.c stable/10/contrib/sendmail/libsm/mpeix.c stable/10/contrib/sendmail/libsm/niprop.c stable/10/contrib/sendmail/libsm/path.c stable/10/contrib/sendmail/libsm/put.c stable/10/contrib/sendmail/libsm/refill.c stable/10/contrib/sendmail/libsm/rewind.c stable/10/contrib/sendmail/libsm/rpool.c stable/10/contrib/sendmail/libsm/rpool.html stable/10/contrib/sendmail/libsm/sem.c stable/10/contrib/sendmail/libsm/setvbuf.c stable/10/contrib/sendmail/libsm/shm.c stable/10/contrib/sendmail/libsm/signal.c stable/10/contrib/sendmail/libsm/smstdio.c stable/10/contrib/sendmail/libsm/snprintf.c stable/10/contrib/sendmail/libsm/sscanf.c stable/10/contrib/sendmail/libsm/stdio.c stable/10/contrib/sendmail/libsm/strcasecmp.c stable/10/contrib/sendmail/libsm/strdup.c stable/10/contrib/sendmail/libsm/strerror.c stable/10/contrib/sendmail/libsm/strexit.c stable/10/contrib/sendmail/libsm/string.c stable/10/contrib/sendmail/libsm/stringf.c stable/10/contrib/sendmail/libsm/strio.c stable/10/contrib/sendmail/libsm/strl.c stable/10/contrib/sendmail/libsm/strrevcmp.c stable/10/contrib/sendmail/libsm/strto.c stable/10/contrib/sendmail/libsm/syslogio.c stable/10/contrib/sendmail/libsm/t-cf.c stable/10/contrib/sendmail/libsm/t-event.c stable/10/contrib/sendmail/libsm/t-exc.c stable/10/contrib/sendmail/libsm/t-fget.c stable/10/contrib/sendmail/libsm/t-float.c stable/10/contrib/sendmail/libsm/t-fopen.c stable/10/contrib/sendmail/libsm/t-heap.c stable/10/contrib/sendmail/libsm/t-inet6_ntop.c stable/10/contrib/sendmail/libsm/t-match.c stable/10/contrib/sendmail/libsm/t-memstat.c stable/10/contrib/sendmail/libsm/t-path.c stable/10/contrib/sendmail/libsm/t-qic.c stable/10/contrib/sendmail/libsm/t-rpool.c stable/10/contrib/sendmail/libsm/t-scanf.c stable/10/contrib/sendmail/libsm/t-sem.c stable/10/contrib/sendmail/libsm/t-shm.c stable/10/contrib/sendmail/libsm/t-smstdio.c stable/10/contrib/sendmail/libsm/t-string.c stable/10/contrib/sendmail/libsm/t-strio.c stable/10/contrib/sendmail/libsm/t-strl.c stable/10/contrib/sendmail/libsm/t-strrevcmp.c stable/10/contrib/sendmail/libsm/t-types.c stable/10/contrib/sendmail/libsm/test.c stable/10/contrib/sendmail/libsm/ungetc.c stable/10/contrib/sendmail/libsm/util.c stable/10/contrib/sendmail/libsm/vasprintf.c stable/10/contrib/sendmail/libsm/vfprintf.c stable/10/contrib/sendmail/libsm/vfscanf.c stable/10/contrib/sendmail/libsm/vprintf.c stable/10/contrib/sendmail/libsm/vsnprintf.c stable/10/contrib/sendmail/libsm/wbuf.c stable/10/contrib/sendmail/libsm/wsetup.c stable/10/contrib/sendmail/libsm/xtrap.c stable/10/contrib/sendmail/libsmdb/Makefile stable/10/contrib/sendmail/libsmdb/Makefile.m4 stable/10/contrib/sendmail/libsmdb/smdb.c stable/10/contrib/sendmail/libsmdb/smdb1.c stable/10/contrib/sendmail/libsmdb/smdb2.c stable/10/contrib/sendmail/libsmdb/smndbm.c stable/10/contrib/sendmail/libsmutil/Makefile stable/10/contrib/sendmail/libsmutil/Makefile.m4 stable/10/contrib/sendmail/libsmutil/cf.c stable/10/contrib/sendmail/libsmutil/debug.c stable/10/contrib/sendmail/libsmutil/err.c stable/10/contrib/sendmail/libsmutil/lockfile.c stable/10/contrib/sendmail/libsmutil/safefile.c stable/10/contrib/sendmail/libsmutil/snprintf.c stable/10/contrib/sendmail/mail.local/Makefile stable/10/contrib/sendmail/mail.local/Makefile.m4 stable/10/contrib/sendmail/mail.local/README stable/10/contrib/sendmail/mail.local/mail.local.8 stable/10/contrib/sendmail/mail.local/mail.local.c stable/10/contrib/sendmail/mailstats/Makefile stable/10/contrib/sendmail/mailstats/Makefile.m4 stable/10/contrib/sendmail/mailstats/mailstats.8 stable/10/contrib/sendmail/mailstats/mailstats.c stable/10/contrib/sendmail/makemap/Makefile stable/10/contrib/sendmail/makemap/Makefile.m4 stable/10/contrib/sendmail/makemap/makemap.8 stable/10/contrib/sendmail/makemap/makemap.c stable/10/contrib/sendmail/praliases/Makefile stable/10/contrib/sendmail/praliases/Makefile.m4 stable/10/contrib/sendmail/praliases/praliases.8 stable/10/contrib/sendmail/praliases/praliases.c stable/10/contrib/sendmail/rmail/Makefile stable/10/contrib/sendmail/rmail/Makefile.m4 stable/10/contrib/sendmail/rmail/rmail.8 stable/10/contrib/sendmail/rmail/rmail.c stable/10/contrib/sendmail/smrsh/Makefile stable/10/contrib/sendmail/smrsh/Makefile.m4 stable/10/contrib/sendmail/smrsh/README stable/10/contrib/sendmail/smrsh/smrsh.8 stable/10/contrib/sendmail/smrsh/smrsh.c stable/10/contrib/sendmail/src/Makefile stable/10/contrib/sendmail/src/Makefile.m4 stable/10/contrib/sendmail/src/README stable/10/contrib/sendmail/src/SECURITY stable/10/contrib/sendmail/src/TRACEFLAGS stable/10/contrib/sendmail/src/TUNING stable/10/contrib/sendmail/src/alias.c stable/10/contrib/sendmail/src/aliases stable/10/contrib/sendmail/src/aliases.5 stable/10/contrib/sendmail/src/arpadate.c stable/10/contrib/sendmail/src/bf.c stable/10/contrib/sendmail/src/bf.h stable/10/contrib/sendmail/src/collect.c stable/10/contrib/sendmail/src/conf.c stable/10/contrib/sendmail/src/conf.h stable/10/contrib/sendmail/src/control.c stable/10/contrib/sendmail/src/convtime.c stable/10/contrib/sendmail/src/daemon.c stable/10/contrib/sendmail/src/daemon.h stable/10/contrib/sendmail/src/deliver.c stable/10/contrib/sendmail/src/domain.c stable/10/contrib/sendmail/src/envelope.c stable/10/contrib/sendmail/src/err.c stable/10/contrib/sendmail/src/headers.c stable/10/contrib/sendmail/src/helpfile stable/10/contrib/sendmail/src/macro.c stable/10/contrib/sendmail/src/mailq.1 stable/10/contrib/sendmail/src/main.c stable/10/contrib/sendmail/src/map.c stable/10/contrib/sendmail/src/map.h stable/10/contrib/sendmail/src/mci.c stable/10/contrib/sendmail/src/milter.c stable/10/contrib/sendmail/src/mime.c stable/10/contrib/sendmail/src/newaliases.1 stable/10/contrib/sendmail/src/parseaddr.c stable/10/contrib/sendmail/src/queue.c stable/10/contrib/sendmail/src/ratectrl.c stable/10/contrib/sendmail/src/readcf.c stable/10/contrib/sendmail/src/recipient.c stable/10/contrib/sendmail/src/sasl.c stable/10/contrib/sendmail/src/savemail.c stable/10/contrib/sendmail/src/sendmail.8 stable/10/contrib/sendmail/src/sendmail.h stable/10/contrib/sendmail/src/sfsasl.c stable/10/contrib/sendmail/src/sfsasl.h stable/10/contrib/sendmail/src/shmticklib.c stable/10/contrib/sendmail/src/sm_resolve.c stable/10/contrib/sendmail/src/sm_resolve.h stable/10/contrib/sendmail/src/srvrsmtp.c stable/10/contrib/sendmail/src/stab.c stable/10/contrib/sendmail/src/stats.c stable/10/contrib/sendmail/src/statusd_shm.h stable/10/contrib/sendmail/src/sysexits.c stable/10/contrib/sendmail/src/timers.c stable/10/contrib/sendmail/src/timers.h stable/10/contrib/sendmail/src/tls.c stable/10/contrib/sendmail/src/trace.c stable/10/contrib/sendmail/src/udb.c stable/10/contrib/sendmail/src/usersmtp.c stable/10/contrib/sendmail/src/util.c stable/10/contrib/sendmail/src/version.c stable/10/contrib/sendmail/test/Makefile stable/10/contrib/sendmail/test/Makefile.m4 stable/10/contrib/sendmail/test/README stable/10/contrib/sendmail/test/Results stable/10/contrib/sendmail/test/t_dropgid.c stable/10/contrib/sendmail/test/t_exclopen.c stable/10/contrib/sendmail/test/t_pathconf.c stable/10/contrib/sendmail/test/t_seteuid.c stable/10/contrib/sendmail/test/t_setgid.c stable/10/contrib/sendmail/test/t_setreuid.c stable/10/contrib/sendmail/test/t_setuid.c stable/10/contrib/sendmail/test/t_snprintf.c stable/10/contrib/sendmail/vacation/Makefile stable/10/contrib/sendmail/vacation/Makefile.m4 stable/10/contrib/sendmail/vacation/vacation.1 stable/10/contrib/sendmail/vacation/vacation.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/sendmail/CACerts ============================================================================== --- stable/10/contrib/sendmail/CACerts Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/CACerts Mon May 26 15:28:28 2014 (r266692) @@ -1,4 +1,4 @@ -# $Id: CACerts,v 8.6 2013/01/18 15:14:17 ca Exp $ +# $Id: CACerts,v 8.6 2013-01-18 15:14:17 ca Exp $ # This file contains some CA certificates that are used to sign the # certificates of mail servers of members of the sendmail consortium # who may reply to questions etc sent to sendmail.org. Modified: stable/10/contrib/sendmail/FAQ ============================================================================== --- stable/10/contrib/sendmail/FAQ Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/FAQ Mon May 26 15:28:28 2014 (r266692) @@ -5,4 +5,4 @@ A plain-text version of the questions on the answers, is posted to comp.mail.sendmail on the 10th and 25th of each month. -$Revision: 8.24 $, Last updated $Date: 1999/02/07 03:21:03 $ +$Revision: 8.24 $, Last updated $Date: 1999-02-07 03:21:03 $ Modified: stable/10/contrib/sendmail/INSTALL ============================================================================== --- stable/10/contrib/sendmail/INSTALL Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/INSTALL Mon May 26 15:28:28 2014 (r266692) @@ -43,4 +43,4 @@ sendmail/SECURITY for more installation in case you are now using a different (and thereby incompatible) version of Berkeley DB. -$Revision: 8.16 $, Last updated $Date: 2007/10/03 21:00:28 $ +$Revision: 8.16 $, Last updated $Date: 2007-10-03 21:00:28 $ Modified: stable/10/contrib/sendmail/KNOWNBUGS ============================================================================== --- stable/10/contrib/sendmail/KNOWNBUGS Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/KNOWNBUGS Mon May 26 15:28:28 2014 (r266692) @@ -266,4 +266,4 @@ Kresolve sequence dnsmx canon be used if set instead of LOCAL_RELAY ($R). This will be fixed in a future version. -$Revision: 8.61 $, Last updated $Date: 2011/04/07 17:48:23 $ +$Revision: 8.61 $, Last updated $Date: 2011-04-07 17:48:23 $ Modified: stable/10/contrib/sendmail/LICENSE ============================================================================== --- stable/10/contrib/sendmail/LICENSE Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/LICENSE Mon May 26 15:28:28 2014 (r266692) @@ -35,7 +35,7 @@ each of the following conditions is met: forth as paragraph 6 below, in the documentation and/or other materials provided with the distribution. For the purposes of binary distribution the "Copyright Notice" refers to the following language: - "Copyright (c) 1998-2013 Proofpoint, Inc. All rights reserved." + "Copyright (c) 1998-2014 Proofpoint, Inc. All rights reserved." 4. Neither the name of Proofpoint, Inc. nor the University of California nor names of their contributors may be used to endorse or promote @@ -78,4 +78,4 @@ each of the following conditions is met: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -$Revision: 8.22 $, Last updated $Date: 2013/11/23 04:37:36 $, Document 139848.1 +$Revision: 8.23 $, Last updated $Date: 2014-01-26 20:10:01 $, Document 139848.1 Modified: stable/10/contrib/sendmail/Makefile ============================================================================== --- stable/10/contrib/sendmail/Makefile Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/Makefile Mon May 26 15:28:28 2014 (r266692) @@ -1,4 +1,4 @@ -# $Id: Makefile.dist,v 8.15 2001/08/23 20:44:39 ca Exp $ +# $Id: Makefile.dist,v 8.15 2001-08-23 20:44:39 ca Exp $ SHELL= /bin/sh SUBDIRS= libsm libsmutil libsmdb sendmail editmap mail.local \ Modified: stable/10/contrib/sendmail/PGPKEYS ============================================================================== --- stable/10/contrib/sendmail/PGPKEYS Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/PGPKEYS Mon May 26 15:28:28 2014 (r266692) @@ -2613,4 +2613,4 @@ DnF3FZZEzV7oqPwC2jzv/1dD6GFhtgy0cnyoPGUJ =nES8 -----END PGP PUBLIC KEY BLOCK----- -$Revision: 8.46 $, Last updated $Date: 2014/01/18 00:20:24 $ +$Revision: 8.46 $, Last updated $Date: 2014-01-18 00:20:24 $ Modified: stable/10/contrib/sendmail/README ============================================================================== --- stable/10/contrib/sendmail/README Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/README Mon May 26 15:28:28 2014 (r266692) @@ -465,4 +465,4 @@ sendmail Source for the sendmail program test Some test scripts (currently only for compilation aids). vacation Source for the vacation program. NOT PART OF SENDMAIL! -$Revision: 8.96 $, Last updated $Date: 2013/11/22 20:51:01 $ +$Revision: 8.96 $, Last updated $Date: 2013-11-22 20:51:01 $ Modified: stable/10/contrib/sendmail/RELEASE_NOTES ============================================================================== --- stable/10/contrib/sendmail/RELEASE_NOTES Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/RELEASE_NOTES Mon May 26 15:28:28 2014 (r266692) @@ -1,11 +1,20 @@ SENDMAIL RELEASE NOTES - $Id: RELEASE_NOTES,v 8.2043 2014/01/23 20:27:19 ca Exp $ This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. +8.14.9/8.14.9 2014/05/21 + SECURITY: Properly set the close-on-exec flag for file descriptors + (except stdin, stdout, and stderr) before executing mailers. + Fix a misformed comment in conf.c: "/*" within comment + which may cause a compilation error on some systems. + Problem reported by John Beck of Oracle. + DEVTOOLS: Fix regression in auto-detection of libraries when only + shared libraries are available. Problem reported by + Bryan Costales. + 8.14.8/8.14.8 2014/01/26 Properly initialize all OpenSSL algorithms for versions before OpenSSL 0.9.8o. Without this SHA2 algorithms may not Modified: stable/10/contrib/sendmail/cf/README ============================================================================== --- stable/10/contrib/sendmail/cf/README Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/README Mon May 26 15:28:28 2014 (r266692) @@ -4704,4 +4704,4 @@ M4 DIVERSIONS 8 DNS based blacklists 9 special local rulesets (1 and 2) -$Revision: 8.730 $, Last updated $Date: 2014/01/16 15:55:51 $ +$Revision: 8.730 $, Last updated $Date: 2014-01-16 15:55:51 $ Modified: stable/10/contrib/sendmail/cf/cf/Makefile ============================================================================== --- stable/10/contrib/sendmail/cf/cf/Makefile Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/Makefile Mon May 26 15:28:28 2014 (r266692) @@ -1,7 +1,7 @@ # # Makefile for configuration files. # -# $Id: Makefile,v 8.60 2005/06/14 02:16:34 gshapiro Exp $ +# $Id: Makefile,v 8.60 2005-06-14 02:16:34 gshapiro Exp $ # # Modified: stable/10/contrib/sendmail/cf/cf/README ============================================================================== --- stable/10/contrib/sendmail/cf/cf/README Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/README Mon May 26 15:28:28 2014 (r266692) @@ -31,4 +31,4 @@ The name of the source file for "submit. For more details see Makefile. -$Revision: 1.2 $, Last updated $Date: 2002/02/22 00:33:54 $ +$Revision: 1.2 $, Last updated $Date: 2002-02-22 00:33:54 $ Modified: stable/10/contrib/sendmail/cf/cf/chez.cs.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/chez.cs.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/chez.cs.mc Mon May 26 15:28:28 2014 (r266692) @@ -24,7 +24,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: chez.cs.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: chez.cs.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') OSTYPE(bsd4.4)dnl DOMAIN(CS.Berkeley.EDU)dnl define(`LOCAL_RELAY', vangogh.CS.Berkeley.EDU)dnl Modified: stable/10/contrib/sendmail/cf/cf/clientproto.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/clientproto.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/clientproto.mc Mon May 26 15:28:28 2014 (r266692) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: clientproto.mc,v 8.17 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: clientproto.mc,v 8.17 2013-11-22 20:51:08 ca Exp $') OSTYPE(unknown) FEATURE(nullclient, mailhost.$m) Modified: stable/10/contrib/sendmail/cf/cf/cs-hpux10.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/cs-hpux10.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/cs-hpux10.mc Mon May 26 15:28:28 2014 (r266692) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-hpux10.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-hpux10.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(hpux10)dnl DOMAIN(CS.Berkeley.EDU)dnl define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl Modified: stable/10/contrib/sendmail/cf/cf/cs-hpux9.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/cs-hpux9.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/cs-hpux9.mc Mon May 26 15:28:28 2014 (r266692) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-hpux9.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-hpux9.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') OSTYPE(hpux9)dnl DOMAIN(CS.Berkeley.EDU)dnl define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl Modified: stable/10/contrib/sendmail/cf/cf/cs-osf1.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/cs-osf1.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/cs-osf1.mc Mon May 26 15:28:28 2014 (r266692) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-osf1.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-osf1.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(osf1)dnl DOMAIN(CS.Berkeley.EDU)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/cs-solaris2.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/cs-solaris2.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/cs-solaris2.mc Mon May 26 15:28:28 2014 (r266692) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-solaris2.mc,v 8.13 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-solaris2.mc,v 8.13 2013-11-22 20:51:08 ca Exp $') OSTYPE(solaris2)dnl DOMAIN(CS.Berkeley.EDU)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/cs-sunos4.1.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/cs-sunos4.1.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/cs-sunos4.1.mc Mon May 26 15:28:28 2014 (r266692) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-sunos4.1.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-sunos4.1.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(sunos4.1)dnl DOMAIN(CS.Berkeley.EDU)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/cs-ultrix4.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/cs-ultrix4.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/cs-ultrix4.mc Mon May 26 15:28:28 2014 (r266692) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-ultrix4.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-ultrix4.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(ultrix4)dnl DOMAIN(CS.Berkeley.EDU)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/cyrusproto.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/cyrusproto.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/cyrusproto.mc Mon May 26 15:28:28 2014 (r266692) @@ -27,7 +27,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cyrusproto.mc,v 8.7 1999/09/07 14:57:10 ca Exp $') +VERSIONID(`$Id: cyrusproto.mc,v 8.7 1999-09-07 14:57:10 ca Exp $') define(`confBIND_OPTS',`-DNSRCH -DEFNAMES') define(`confLOCAL_MAILER', `cyrus') FEATURE(`nocanonify') Modified: stable/10/contrib/sendmail/cf/cf/generic-bsd4.4.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/generic-bsd4.4.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/generic-bsd4.4.mc Mon May 26 15:28:28 2014 (r266692) @@ -21,7 +21,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-bsd4.4.mc,v 8.11 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-bsd4.4.mc,v 8.11 2013-11-22 20:51:08 ca Exp $') OSTYPE(bsd4.4)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/generic-hpux10.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/generic-hpux10.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/generic-hpux10.mc Mon May 26 15:28:28 2014 (r266692) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-hpux10.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-hpux10.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(hpux10)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/generic-hpux9.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/generic-hpux9.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/generic-hpux9.mc Mon May 26 15:28:28 2014 (r266692) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-hpux9.mc,v 8.12 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-hpux9.mc,v 8.12 2013-11-22 20:51:08 ca Exp $') OSTYPE(hpux9)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/generic-linux.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/generic-linux.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/generic-linux.mc Mon May 26 15:28:28 2014 (r266692) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-linux.mc,v 8.2 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-linux.mc,v 8.2 2013-11-22 20:51:08 ca Exp $') OSTYPE(linux)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/generic-mpeix.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/generic-mpeix.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/generic-mpeix.mc Mon May 26 15:28:28 2014 (r266692) @@ -17,7 +17,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-mpeix.mc,v 8.2 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-mpeix.mc,v 8.2 2013-11-22 20:51:08 ca Exp $') OSTYPE(mpeix)dnl DOMAIN(generic)dnl define(`confFORWARD_PATH', `$z/.forward')dnl Modified: stable/10/contrib/sendmail/cf/cf/generic-nextstep3.3.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/generic-nextstep3.3.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/generic-nextstep3.3.mc Mon May 26 15:28:28 2014 (r266692) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-nextstep3.3.mc,v 8.11 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-nextstep3.3.mc,v 8.11 2013-11-22 20:51:08 ca Exp $') OSTYPE(nextstep)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/generic-osf1.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/generic-osf1.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/generic-osf1.mc Mon May 26 15:28:28 2014 (r266692) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-osf1.mc,v 8.12 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-osf1.mc,v 8.12 2013-11-22 20:51:08 ca Exp $') OSTYPE(osf1)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/generic-solaris.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/generic-solaris.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/generic-solaris.mc Mon May 26 15:28:28 2014 (r266692) @@ -22,7 +22,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-solaris.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-solaris.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(solaris2)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/generic-sunos4.1.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/generic-sunos4.1.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/generic-sunos4.1.mc Mon May 26 15:28:28 2014 (r266692) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-sunos4.1.mc,v 8.12 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-sunos4.1.mc,v 8.12 2013-11-22 20:51:08 ca Exp $') OSTYPE(sunos4.1)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/generic-ultrix4.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/generic-ultrix4.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/generic-ultrix4.mc Mon May 26 15:28:28 2014 (r266692) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-ultrix4.mc,v 8.12 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-ultrix4.mc,v 8.12 2013-11-22 20:51:08 ca Exp $') OSTYPE(ultrix4)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/huginn.cs.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/huginn.cs.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/huginn.cs.mc Mon May 26 15:28:28 2014 (r266692) @@ -22,7 +22,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: huginn.cs.mc,v 8.16 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: huginn.cs.mc,v 8.16 2013-11-22 20:51:08 ca Exp $') OSTYPE(hpux9)dnl DOMAIN(CS.Berkeley.EDU)dnl MASQUERADE_AS(CS.Berkeley.EDU)dnl Modified: stable/10/contrib/sendmail/cf/cf/knecht.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/knecht.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/knecht.mc Mon May 26 15:28:28 2014 (r266692) @@ -19,7 +19,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: knecht.mc,v 8.63 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: knecht.mc,v 8.63 2013-11-22 20:51:08 ca Exp $') OSTYPE(bsd4.4) DOMAIN(generic) Modified: stable/10/contrib/sendmail/cf/cf/mail.cs.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/mail.cs.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/mail.cs.mc Mon May 26 15:28:28 2014 (r266692) @@ -22,7 +22,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: mail.cs.mc,v 8.19 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: mail.cs.mc,v 8.19 2013-11-22 20:51:08 ca Exp $') OSTYPE(ultrix4)dnl DOMAIN(Berkeley.EDU)dnl MASQUERADE_AS(CS.Berkeley.EDU)dnl Modified: stable/10/contrib/sendmail/cf/cf/mail.eecs.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/mail.eecs.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/mail.eecs.mc Mon May 26 15:28:28 2014 (r266692) @@ -22,7 +22,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: mail.eecs.mc,v 8.19 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: mail.eecs.mc,v 8.19 2013-11-22 20:51:08 ca Exp $') OSTYPE(ultrix4)dnl DOMAIN(EECS.Berkeley.EDU)dnl MASQUERADE_AS(EECS.Berkeley.EDU)dnl Modified: stable/10/contrib/sendmail/cf/cf/mailspool.cs.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/mailspool.cs.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/mailspool.cs.mc Mon May 26 15:28:28 2014 (r266692) @@ -24,7 +24,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: mailspool.cs.mc,v 8.13 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: mailspool.cs.mc,v 8.13 2013-11-22 20:51:08 ca Exp $') OSTYPE(sunos4.1)dnl DOMAIN(CS.Berkeley.EDU)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/python.cs.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/python.cs.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/python.cs.mc Mon May 26 15:28:28 2014 (r266692) @@ -24,7 +24,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: python.cs.mc,v 8.13 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: python.cs.mc,v 8.13 2013-11-22 20:51:08 ca Exp $') OSTYPE(bsd4.4)dnl DOMAIN(CS.Berkeley.EDU)dnl define(`LOCAL_RELAY', vangogh.CS.Berkeley.EDU)dnl Modified: stable/10/contrib/sendmail/cf/cf/s2k-osf1.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/s2k-osf1.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/s2k-osf1.mc Mon May 26 15:28:28 2014 (r266692) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: s2k-osf1.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: s2k-osf1.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(osf1)dnl DOMAIN(S2K.Berkeley.EDU)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/s2k-ultrix4.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/s2k-ultrix4.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/s2k-ultrix4.mc Mon May 26 15:28:28 2014 (r266692) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: s2k-ultrix4.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: s2k-ultrix4.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(ultrix4)dnl DOMAIN(S2K.Berkeley.EDU)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/submit.cf ============================================================================== --- stable/10/contrib/sendmail/cf/cf/submit.cf Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/submit.cf Mon May 26 15:28:28 2014 (r266692) @@ -16,8 +16,8 @@ ##### ##### SENDMAIL CONFIGURATION FILE ##### -##### built by ca@lab.smi.sendmail.com on Thu Jan 23 12:29:13 PST 2014 -##### in /home/ca/sm8-rel/sm-8.14.8/OpenSource/sendmail-8.14.8/cf/cf +##### built by ca@lab.smi.sendmail.com on Tue May 20 12:12:52 PDT 2014 +##### in /home/ca/sm8.git/sendmail/OpenSource/sendmail-8.14.9/cf/cf ##### using ../ as configuration include directory ##### ###################################################################### @@ -27,15 +27,15 @@ ###################################################################### ###################################################################### -##### $Id: cfhead.m4,v 8.122 2013/11/22 20:51:13 ca Exp $ ##### -##### $Id: cf.m4,v 8.33 2013/11/22 20:51:13 ca Exp $ ##### -##### $Id: submit.mc,v 8.15 2013/11/22 20:51:08 ca Exp $ ##### -##### $Id: msp.m4,v 1.34 2013/11/22 20:51:11 ca Exp $ ##### +##### $Id: cfhead.m4,v 8.122 2013-11-22 20:51:13 ca Exp $ ##### +##### $Id: cf.m4,v 8.33 2013-11-22 20:51:13 ca Exp $ ##### +##### $Id: submit.mc,v 8.15 2013-11-22 20:51:08 ca Exp $ ##### +##### $Id: msp.m4,v 1.34 2013-11-22 20:51:11 ca Exp $ ##### -##### $Id: no_default_msa.m4,v 8.3 2013/11/22 20:51:11 ca Exp $ ##### +##### $Id: no_default_msa.m4,v 8.3 2013-11-22 20:51:11 ca Exp $ ##### -##### $Id: proto.m4,v 8.762 2013/11/22 20:51:13 ca Exp $ ##### +##### $Id: proto.m4,v 8.762 2013-11-22 20:51:13 ca Exp $ ##### # level 10 config file format V10/Berkeley @@ -114,7 +114,7 @@ D{MTAHost}[127.0.0.1] # Configuration version number -DZ8.14.8/Submit +DZ8.14.9/Submit ############### @@ -1299,7 +1299,7 @@ R$* $#relay $@ ${MTAHost} $: $1 < @ $j ### Local and Program Mailer specification ### ################################################## -##### $Id: local.m4,v 8.60 2013/11/22 20:51:14 ca Exp $ ##### +##### $Id: local.m4,v 8.60 2013-11-22 20:51:14 ca Exp $ ##### # # Envelope sender rewriting @@ -1351,7 +1351,7 @@ Mprog, P=[IPC], F=lmDFMuXk5, S=EnvFromL ### SMTP Mailer specification ### ##################################### -##### $Id: smtp.m4,v 8.66 2013/11/22 20:51:14 ca Exp $ ##### +##### $Id: smtp.m4,v 8.66 2013-11-22 20:51:14 ca Exp $ ##### # # common sender and masquerading recipient rewriting @@ -1457,7 +1457,7 @@ Mrelay, P=[IPC], F=mDFMuXa8k, S=EnvFrom # # # # divert(0)dnl -# VERSIONID(`$Id: submit.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +# VERSIONID(`$Id: submit.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') # define(`confCF_VERSION', `Submit')dnl # define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining # define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet Modified: stable/10/contrib/sendmail/cf/cf/submit.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/submit.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/submit.mc Mon May 26 15:28:28 2014 (r266692) @@ -15,7 +15,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: submit.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: submit.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') define(`confCF_VERSION', `Submit')dnl define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet Modified: stable/10/contrib/sendmail/cf/cf/tcpproto.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/tcpproto.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/tcpproto.mc Mon May 26 15:28:28 2014 (r266692) @@ -26,7 +26,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: tcpproto.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: tcpproto.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') OSTYPE(`unknown') FEATURE(`nouucp', `reject') MAILER(`local') Modified: stable/10/contrib/sendmail/cf/cf/ucbarpa.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/ucbarpa.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/ucbarpa.mc Mon May 26 15:28:28 2014 (r266692) @@ -21,7 +21,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: ucbarpa.mc,v 8.13 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: ucbarpa.mc,v 8.13 2013-11-22 20:51:08 ca Exp $') DOMAIN(CS.Berkeley.EDU)dnl OSTYPE(bsd4.4)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/cf/ucbvax.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/ucbvax.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/ucbvax.mc Mon May 26 15:28:28 2014 (r266692) @@ -22,7 +22,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: ucbvax.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: ucbvax.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') OSTYPE(bsd4.3) DOMAIN(CS.Berkeley.EDU) MASQUERADE_AS(CS.Berkeley.EDU) Modified: stable/10/contrib/sendmail/cf/cf/uucpproto.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/uucpproto.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/uucpproto.mc Mon May 26 15:28:28 2014 (r266692) @@ -26,7 +26,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: uucpproto.mc,v 8.16 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: uucpproto.mc,v 8.16 2013-11-22 20:51:08 ca Exp $') OSTYPE(unknown) FEATURE(promiscuous_relay)dnl FEATURE(accept_unresolvable_domains)dnl Modified: stable/10/contrib/sendmail/cf/cf/vangogh.cs.mc ============================================================================== --- stable/10/contrib/sendmail/cf/cf/vangogh.cs.mc Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/cf/vangogh.cs.mc Mon May 26 15:28:28 2014 (r266692) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: vangogh.cs.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: vangogh.cs.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') DOMAIN(CS.Berkeley.EDU)dnl OSTYPE(bsd4.4)dnl MAILER(local)dnl Modified: stable/10/contrib/sendmail/cf/domain/Berkeley.EDU.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/domain/Berkeley.EDU.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/domain/Berkeley.EDU.m4 Mon May 26 15:28:28 2014 (r266692) @@ -12,7 +12,7 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: Berkeley.EDU.m4,v 8.18 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: Berkeley.EDU.m4,v 8.18 2013-11-22 20:51:10 ca Exp $') DOMAIN(berkeley-only)dnl define(`BITNET_RELAY', `bitnet-relay.Berkeley.EDU')dnl define(`UUCP_RELAY', `uucp-relay.Berkeley.EDU')dnl Modified: stable/10/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4 Mon May 26 15:28:28 2014 (r266692) @@ -12,7 +12,7 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: CS.Berkeley.EDU.m4,v 8.11 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: CS.Berkeley.EDU.m4,v 8.11 2013-11-22 20:51:10 ca Exp $') DOMAIN(Berkeley.EDU)dnl HACK(cssubdomain)dnl define(`confUSERDB_SPEC', Modified: stable/10/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4 Mon May 26 15:28:28 2014 (r266692) @@ -12,6 +12,6 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: EECS.Berkeley.EDU.m4,v 8.11 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: EECS.Berkeley.EDU.m4,v 8.11 2013-11-22 20:51:10 ca Exp $') DOMAIN(Berkeley.EDU)dnl MASQUERADE_AS(EECS.Berkeley.EDU)dnl Modified: stable/10/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4 Mon May 26 15:28:28 2014 (r266692) @@ -12,6 +12,6 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: S2K.Berkeley.EDU.m4,v 8.11 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: S2K.Berkeley.EDU.m4,v 8.11 2013-11-22 20:51:10 ca Exp $') DOMAIN(CS.Berkeley.EDU)dnl MASQUERADE_AS(postgres.Berkeley.EDU)dnl Modified: stable/10/contrib/sendmail/cf/domain/berkeley-only.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/domain/berkeley-only.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/domain/berkeley-only.m4 Mon May 26 15:28:28 2014 (r266692) @@ -12,7 +12,7 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: unspecified-domain.m4,v 8.11 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: unspecified-domain.m4,v 8.11 2013-11-22 20:51:10 ca Exp $') errprint(`*** ERROR: You are trying to use the Berkeley sample configuration') errprint(` files outside of the Computer Science Division at Berkeley.') errprint(` The configuration (.mc) files must be customized to reference') Modified: stable/10/contrib/sendmail/cf/domain/generic.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/domain/generic.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/domain/generic.m4 Mon May 26 15:28:28 2014 (r266692) @@ -20,7 +20,7 @@ divert(-1) # files. # divert(0) -VERSIONID(`$Id: generic.m4,v 8.16 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: generic.m4,v 8.16 2013-11-22 20:51:10 ca Exp $') define(`confFORWARD_PATH', `$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward')dnl define(`confMAX_HEADERS_LENGTH', `32768')dnl FEATURE(`redirect')dnl Modified: stable/10/contrib/sendmail/cf/feature/accept_unqualified_senders.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/accept_unqualified_senders.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/accept_unqualified_senders.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: accept_unqualified_senders.m4,v 8.7 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: accept_unqualified_senders.m4,v 8.7 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_ACCEPT_UNQUALIFIED_SENDERS_', 1) Modified: stable/10/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: accept_unresolvable_domains.m4,v 8.11 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: accept_unresolvable_domains.m4,v 8.11 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_ACCEPT_UNRESOLVABLE_DOMAINS_', 1) Modified: stable/10/contrib/sendmail/cf/feature/access_db.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/access_db.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/access_db.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: access_db.m4,v 8.28 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: access_db.m4,v 8.28 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_ACCESS_TABLE_', `') Modified: stable/10/contrib/sendmail/cf/feature/allmasquerade.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/allmasquerade.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/allmasquerade.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: allmasquerade.m4,v 8.14 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: allmasquerade.m4,v 8.14 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_MAILER_local_', Modified: stable/10/contrib/sendmail/cf/feature/always_add_domain.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/always_add_domain.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/always_add_domain.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: always_add_domain.m4,v 8.12 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: always_add_domain.m4,v 8.12 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_MAILER_local_', Modified: stable/10/contrib/sendmail/cf/feature/authinfo.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/authinfo.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/authinfo.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: authinfo.m4,v 1.10 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: authinfo.m4,v 1.10 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_AUTHINFO_TABLE_', `') Modified: stable/10/contrib/sendmail/cf/feature/badmx.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/badmx.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/badmx.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: badmx.m4,v 1.2 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: badmx.m4,v 1.2 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_BADMX_CHK_', 1) Modified: stable/10/contrib/sendmail/cf/feature/bestmx_is_local.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/bestmx_is_local.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/bestmx_is_local.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: bestmx_is_local.m4,v 8.27 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: bestmx_is_local.m4,v 8.27 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_BESTMX_IS_LOCAL_', _ARG_) Modified: stable/10/contrib/sendmail/cf/feature/bitdomain.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/bitdomain.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/bitdomain.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: bitdomain.m4,v 8.31 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: bitdomain.m4,v 8.31 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_BITDOMAIN_TABLE_', `') Modified: stable/10/contrib/sendmail/cf/feature/blacklist_recipients.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/blacklist_recipients.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/blacklist_recipients.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: blacklist_recipients.m4,v 8.14 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: blacklist_recipients.m4,v 8.14 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_ACCESS_TABLE_', Modified: stable/10/contrib/sendmail/cf/feature/block_bad_helo.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/block_bad_helo.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/block_bad_helo.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: block_bad_helo.m4,v 1.2 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: block_bad_helo.m4,v 1.2 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_BLOCK_BAD_HELO_', `')dnl Modified: stable/10/contrib/sendmail/cf/feature/compat_check.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/compat_check.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/compat_check.m4 Mon May 26 15:28:28 2014 (r266692) @@ -9,7 +9,7 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: compat_check.m4,v 1.5 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: compat_check.m4,v 1.5 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_ACCESS_TABLE_', `', `errprint(`FEATURE(`compat_check') requires FEATURE(`access_db') Modified: stable/10/contrib/sendmail/cf/feature/conncontrol.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/conncontrol.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/conncontrol.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: conncontrol.m4,v 1.5 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: conncontrol.m4,v 1.5 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_ACCESS_TABLE_', ` Modified: stable/10/contrib/sendmail/cf/feature/delay_checks.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/delay_checks.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/delay_checks.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: delay_checks.m4,v 8.9 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: delay_checks.m4,v 8.9 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_DELAY_CHECKS_', 1) Modified: stable/10/contrib/sendmail/cf/feature/dnsbl.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/dnsbl.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/dnsbl.m4 Mon May 26 15:28:28 2014 (r266692) @@ -12,7 +12,7 @@ divert(-1) ifdef(`DNSBL_MAP', `', `define(`DNSBL_MAP', `dns -R A')') divert(0) ifdef(`_DNSBL_R_',`dnl',`dnl -VERSIONID(`$Id: dnsbl.m4,v 8.34 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: dnsbl.m4,v 8.34 2013-11-22 20:51:11 ca Exp $') define(`_DNSBL_R_',`') ifelse(defn(`_ARG_'), `', `errprint(`*** ERROR: missing argument for FEATURE(`dnsbl')')') Modified: stable/10/contrib/sendmail/cf/feature/domaintable.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/domaintable.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/domaintable.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: domaintable.m4,v 8.25 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: domaintable.m4,v 8.25 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_DOMAIN_TABLE_', `') Modified: stable/10/contrib/sendmail/cf/feature/enhdnsbl.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/enhdnsbl.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/enhdnsbl.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ ifelse(defn(`_ARG_'), `', `errprint(`*** ERROR: missing argument for FEATURE(`enhdnsbl')')') divert(0) ifdef(`_EDNSBL_R_',`dnl',`dnl -VERSIONID(`$Id: enhdnsbl.m4,v 1.13 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: enhdnsbl.m4,v 1.13 2013-11-22 20:51:11 ca Exp $') LOCAL_CONFIG define(`_EDNSBL_R_',`')dnl # map for enhanced DNS based blacklist lookups Modified: stable/10/contrib/sendmail/cf/feature/generics_entire_domain.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/generics_entire_domain.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/generics_entire_domain.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: generics_entire_domain.m4,v 8.2 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: generics_entire_domain.m4,v 8.2 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_GENERICS_ENTIRE_DOMAIN_', 1) Modified: stable/10/contrib/sendmail/cf/feature/genericstable.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/genericstable.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/genericstable.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: genericstable.m4,v 8.24 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: genericstable.m4,v 8.24 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_GENERICS_TABLE_', `') Modified: stable/10/contrib/sendmail/cf/feature/greet_pause.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/greet_pause.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/greet_pause.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: greet_pause.m4,v 1.5 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: greet_pause.m4,v 1.5 2013-11-22 20:51:11 ca Exp $') divert(-1) ifelse(len(X`'_ARG_),`1',`ifdef(`_ACCESS_TABLE_', `', Modified: stable/10/contrib/sendmail/cf/feature/ldap_routing.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/ldap_routing.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/ldap_routing.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: ldap_routing.m4,v 8.21 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: ldap_routing.m4,v 8.21 2013-11-22 20:51:11 ca Exp $') divert(-1) # Check first two arguments. If they aren't set, may need to warn in proto.m4 Modified: stable/10/contrib/sendmail/cf/feature/limited_masquerade.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/limited_masquerade.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/limited_masquerade.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: limited_masquerade.m4,v 8.10 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: limited_masquerade.m4,v 8.10 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_LIMITED_MASQUERADE_', 1) Modified: stable/10/contrib/sendmail/cf/feature/local_lmtp.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/local_lmtp.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/local_lmtp.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: local_lmtp.m4,v 8.18 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: local_lmtp.m4,v 8.18 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_MAILER_local_', Modified: stable/10/contrib/sendmail/cf/feature/local_no_masquerade.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/local_no_masquerade.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/local_no_masquerade.m4 Mon May 26 15:28:28 2014 (r266692) @@ -9,7 +9,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: local_no_masquerade.m4,v 1.3 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: local_no_masquerade.m4,v 1.3 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_MAILER_local_', Modified: stable/10/contrib/sendmail/cf/feature/local_procmail.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/local_procmail.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/local_procmail.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: local_procmail.m4,v 8.23 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: local_procmail.m4,v 8.23 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_MAILER_local_', Modified: stable/10/contrib/sendmail/cf/feature/lookupdotdomain.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/lookupdotdomain.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/lookupdotdomain.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: lookupdotdomain.m4,v 1.2 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: lookupdotdomain.m4,v 1.2 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_ACCESS_TABLE_', Modified: stable/10/contrib/sendmail/cf/feature/loose_relay_check.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/loose_relay_check.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/loose_relay_check.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: loose_relay_check.m4,v 8.7 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: loose_relay_check.m4,v 8.7 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_LOOSE_RELAY_CHECK_', 1) Modified: stable/10/contrib/sendmail/cf/feature/mailertable.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/mailertable.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/mailertable.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: mailertable.m4,v 8.26 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: mailertable.m4,v 8.26 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_MAILER_TABLE_', `') Modified: stable/10/contrib/sendmail/cf/feature/masquerade_entire_domain.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/masquerade_entire_domain.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/masquerade_entire_domain.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: masquerade_entire_domain.m4,v 8.10 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: masquerade_entire_domain.m4,v 8.10 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_MASQUERADE_ENTIRE_DOMAIN_', 1) Modified: stable/10/contrib/sendmail/cf/feature/masquerade_envelope.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/masquerade_envelope.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/masquerade_envelope.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: masquerade_envelope.m4,v 8.10 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: masquerade_envelope.m4,v 8.10 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_MASQUERADE_ENVELOPE_', 1) Modified: stable/10/contrib/sendmail/cf/feature/msp.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/msp.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/msp.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: msp.m4,v 1.34 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: msp.m4,v 1.34 2013-11-22 20:51:11 ca Exp $') divert(-1) undefine(`ALIAS_FILE') define(`confDELIVERY_MODE', `i') Modified: stable/10/contrib/sendmail/cf/feature/mtamark.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/mtamark.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/mtamark.m4 Mon May 26 15:28:28 2014 (r266692) @@ -11,7 +11,7 @@ divert(-1) divert(0) ifdef(`_MTAMARK_R',`dnl',`dnl -VERSIONID(`$Id: mtamark.m4,v 1.3 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: mtamark.m4,v 1.3 2013-11-22 20:51:11 ca Exp $') LOCAL_CONFIG define(`_MTAMARK_R',`')dnl # map for MTA mark Modified: stable/10/contrib/sendmail/cf/feature/no_default_msa.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/no_default_msa.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/no_default_msa.m4 Mon May 26 15:28:28 2014 (r266692) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: no_default_msa.m4,v 8.3 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: no_default_msa.m4,v 8.3 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_NO_MSA_', `1') Modified: stable/10/contrib/sendmail/cf/feature/nocanonify.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/nocanonify.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/nocanonify.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: nocanonify.m4,v 8.13 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: nocanonify.m4,v 8.13 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_NO_CANONIFY_', 1) Modified: stable/10/contrib/sendmail/cf/feature/notsticky.m4 ============================================================================== --- stable/10/contrib/sendmail/cf/feature/notsticky.m4 Mon May 26 15:08:39 2014 (r266691) +++ stable/10/contrib/sendmail/cf/feature/notsticky.m4 Mon May 26 15:28:28 2014 (r266692) @@ -13,7 +13,7 @@ divert(-1) # *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 15:35:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CF569855; Mon, 26 May 2014 15:35: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 BBF082F5A; Mon, 26 May 2014 15:35: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 s4QFZBlP099260; Mon, 26 May 2014 15:35:11 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QFZB2b099259; Mon, 26 May 2014 15:35:11 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201405261535.s4QFZB2b099259@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 26 May 2014 15:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266695 - stable/10/contrib/sendmail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 15:35:11 -0000 Author: gshapiro Date: Mon May 26 15:35:11 2014 New Revision: 266695 URL: http://svnweb.freebsd.org/changeset/base/266695 Log: MFC: Update for sendmail 8.14.9 import Modified: stable/10/contrib/sendmail/FREEBSD-upgrade Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/sendmail/FREEBSD-upgrade ============================================================================== --- stable/10/contrib/sendmail/FREEBSD-upgrade Mon May 26 15:31:26 2014 (r266694) +++ stable/10/contrib/sendmail/FREEBSD-upgrade Mon May 26 15:35:11 2014 (r266695) @@ -1,6 +1,6 @@ $FreeBSD$ -sendmail 8.14.8 +sendmail 8.14.9 originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/ For the import of sendmail, the following directories were renamed: @@ -97,4 +97,4 @@ infrastructure in FreeBSD: usr.sbin/mailwrapper/Makefile gshapiro@FreeBSD.org -26-January-2014 +21-May-2014 From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 15:42:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3C9D3D4; Mon, 26 May 2014 15:42: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 28EE52079; Mon, 26 May 2014 15:42: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 s4QFgeJR004970; Mon, 26 May 2014 15:42:40 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QFgd5g004963; Mon, 26 May 2014 15:42:39 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201405261542.s4QFgd5g004963@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 26 May 2014 15:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266698 - stable/10/etc/sendmail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 15:42:40 -0000 Author: gshapiro Date: Mon May 26 15:42:39 2014 New Revision: 266698 URL: http://svnweb.freebsd.org/changeset/base/266698 Log: MFC: Minor changes to force commit these files so new freebsd*.cf files are built to use the new sendmail-8.14.9/cf tree. Modified: stable/10/etc/sendmail/freebsd.mc stable/10/etc/sendmail/freebsd.submit.mc Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/sendmail/freebsd.mc ============================================================================== --- stable/10/etc/sendmail/freebsd.mc Mon May 26 15:36:57 2014 (r266697) +++ stable/10/etc/sendmail/freebsd.mc Mon May 26 15:42:39 2014 (r266698) @@ -33,7 +33,6 @@ divert(-1) # SUCH DAMAGE. # - # # This is a generic configuration file for FreeBSD 6.X and later systems. # If you want to customize it, copy it to a name appropriate for your Modified: stable/10/etc/sendmail/freebsd.submit.mc ============================================================================== --- stable/10/etc/sendmail/freebsd.submit.mc Mon May 26 15:36:57 2014 (r266697) +++ stable/10/etc/sendmail/freebsd.submit.mc Mon May 26 15:42:39 2014 (r266698) @@ -9,7 +9,6 @@ divert(-1) # # - # # This is the FreeBSD configuration for a set-group-ID sm-msp sendmail # that acts as a initial mail submission program. From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 15:53:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 67E41B8C; Mon, 26 May 2014 15:53: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 4A5BB21A7; Mon, 26 May 2014 15:53: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 s4QFrPYB011204; Mon, 26 May 2014 15:53:25 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QFrPHY011203; Mon, 26 May 2014 15:53:25 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201405261553.s4QFrPHY011203@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 26 May 2014 15:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266701 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 15:53:25 -0000 Author: gshapiro Date: Mon May 26 15:53:24 2014 New Revision: 266701 URL: http://svnweb.freebsd.org/changeset/base/266701 Log: Note merge for sendmail 8.14.9. Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 26 15:47:26 2014 (r266700) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 26 15:53:24 2014 (r266701) @@ -254,6 +254,9 @@ OpenSSH has been updated to version 6.6p1. + Sendmail + has been updated to 8.14.9. + From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 20:45:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5A2B395C; Mon, 26 May 2014 20:45: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 4204529D1; Mon, 26 May 2014 20:45: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 s4QKjobl060975; Mon, 26 May 2014 20:45:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QKjioj060945; Mon, 26 May 2014 20:45:44 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201405262045.s4QKjioj060945@svn.freebsd.org> From: Dimitry Andric Date: Mon, 26 May 2014 20:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266715 - in stable/10: . contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/MC contrib/llvm/lib/Analysis contrib/llvm/lib/CodeGen/AsmPrinter contrib/llvm/lib/CodeGen/SelectionDAG c... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 20:45:50 -0000 Author: dim Date: Mon May 26 20:45:44 2014 New Revision: 266715 URL: http://svnweb.freebsd.org/changeset/base/266715 Log: MFC r265925: Upgrade our copy of llvm/clang to 3.4.1 release. This release contains mostly fixes, for the following upstream bugs: http://llvm.org/PR16365 http://llvm.org/PR17473 http://llvm.org/PR18000 http://llvm.org/PR18068 http://llvm.org/PR18102 http://llvm.org/PR18165 http://llvm.org/PR18260 http://llvm.org/PR18290 http://llvm.org/PR18316 http://llvm.org/PR18460 http://llvm.org/PR18473 http://llvm.org/PR18515 http://llvm.org/PR18526 http://llvm.org/PR18600 http://llvm.org/PR18762 http://llvm.org/PR18773 http://llvm.org/PR18860 http://llvm.org/PR18994 http://llvm.org/PR19007 http://llvm.org/PR19010 http://llvm.org/PR19033 http://llvm.org/PR19059 http://llvm.org/PR19144 http://llvm.org/PR19326 Deleted: stable/10/contrib/llvm/patches/patch-r262809-clang-r203007-destructor-calling-conv.diff Modified: stable/10/ObsoleteFiles.inc stable/10/UPDATING stable/10/contrib/llvm/include/llvm/IR/IntrinsicsX86.td stable/10/contrib/llvm/include/llvm/MC/MCAsmInfo.h stable/10/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp stable/10/contrib/llvm/lib/Analysis/IVUsers.cpp stable/10/contrib/llvm/lib/Analysis/ScalarEvolution.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp stable/10/contrib/llvm/lib/MC/MCAsmInfo.cpp stable/10/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp stable/10/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp stable/10/contrib/llvm/lib/MC/MCDwarf.cpp stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td stable/10/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp stable/10/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h stable/10/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h stable/10/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp stable/10/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td stable/10/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h stable/10/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.cpp stable/10/contrib/llvm/lib/Target/R600/AMDGPUInstructions.td stable/10/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp stable/10/contrib/llvm/lib/Target/R600/R600InstrInfo.cpp stable/10/contrib/llvm/lib/Target/R600/R600Instructions.td stable/10/contrib/llvm/lib/Target/R600/SIFixSGPRCopies.cpp stable/10/contrib/llvm/lib/Target/R600/SIInsertWaits.cpp stable/10/contrib/llvm/lib/Target/R600/SIInstrInfo.td stable/10/contrib/llvm/lib/Target/R600/SIInstructions.td stable/10/contrib/llvm/lib/Target/R600/SIIntrinsics.td stable/10/contrib/llvm/lib/Target/R600/SILowerControlFlow.cpp stable/10/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp stable/10/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c stable/10/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp stable/10/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp stable/10/contrib/llvm/lib/Target/X86/X86InstrCompiler.td stable/10/contrib/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp stable/10/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp stable/10/contrib/llvm/lib/Transforms/Utils/LCSSA.cpp stable/10/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp stable/10/contrib/llvm/tools/clang/include/clang/Driver/Driver.h stable/10/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h stable/10/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp stable/10/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp stable/10/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp stable/10/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/Targets.cpp stable/10/contrib/llvm/tools/clang/lib/Basic/Version.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/Driver.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.h stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp stable/10/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp stable/10/etc/mtree/BSD.include.dist stable/10/lib/clang/include/Makefile stable/10/lib/clang/include/clang/Basic/Version.inc stable/10/lib/clang/include/llvm/Config/config.h stable/10/lib/clang/include/llvm/Config/llvm-config.h stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Mon May 26 20:14:36 2014 (r266714) +++ stable/10/ObsoleteFiles.inc Mon May 26 20:45:44 2014 (r266715) @@ -38,6 +38,43 @@ # xargs -n1 | sort | uniq -d; # done +# 20140512: new clang import which bumps version from 3.4 to 3.4.1. +OLD_FILES+=usr/include/clang/3.4/__wmmintrin_aes.h +OLD_FILES+=usr/include/clang/3.4/__wmmintrin_pclmul.h +OLD_FILES+=usr/include/clang/3.4/altivec.h +OLD_FILES+=usr/include/clang/3.4/ammintrin.h +OLD_FILES+=usr/include/clang/3.4/avx2intrin.h +OLD_FILES+=usr/include/clang/3.4/avxintrin.h +OLD_FILES+=usr/include/clang/3.4/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.4/bmiintrin.h +OLD_FILES+=usr/include/clang/3.4/cpuid.h +OLD_FILES+=usr/include/clang/3.4/emmintrin.h +OLD_FILES+=usr/include/clang/3.4/f16cintrin.h +OLD_FILES+=usr/include/clang/3.4/fma4intrin.h +OLD_FILES+=usr/include/clang/3.4/fmaintrin.h +OLD_FILES+=usr/include/clang/3.4/immintrin.h +OLD_FILES+=usr/include/clang/3.4/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.4/mm3dnow.h +OLD_FILES+=usr/include/clang/3.4/mm_malloc.h +OLD_FILES+=usr/include/clang/3.4/mmintrin.h +OLD_FILES+=usr/include/clang/3.4/module.map +OLD_FILES+=usr/include/clang/3.4/nmmintrin.h +OLD_FILES+=usr/include/clang/3.4/pmmintrin.h +OLD_FILES+=usr/include/clang/3.4/popcntintrin.h +OLD_FILES+=usr/include/clang/3.4/prfchwintrin.h +OLD_FILES+=usr/include/clang/3.4/rdseedintrin.h +OLD_FILES+=usr/include/clang/3.4/rtmintrin.h +OLD_FILES+=usr/include/clang/3.4/shaintrin.h +OLD_FILES+=usr/include/clang/3.4/smmintrin.h +OLD_FILES+=usr/include/clang/3.4/tbmintrin.h +OLD_FILES+=usr/include/clang/3.4/tmmintrin.h +OLD_FILES+=usr/include/clang/3.4/wmmintrin.h +OLD_FILES+=usr/include/clang/3.4/x86intrin.h +OLD_FILES+=usr/include/clang/3.4/xmmintrin.h +OLD_FILES+=usr/include/clang/3.4/xopintrin.h +OLD_FILES+=usr/include/clang/3.4/arm_neon.h +OLD_FILES+=usr/include/clang/3.4/module.map +OLD_DIRS+=usr/include/clang/3.4 # 20140321: new clang import which bumps version from 3.3 to 3.4. OLD_FILES+=usr/bin/llvm-prof OLD_FILES+=usr/bin/llvm-ranlib Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Mon May 26 20:14:36 2014 (r266714) +++ stable/10/UPDATING Mon May 26 20:45:44 2014 (r266715) @@ -16,6 +16,9 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20140512: + Clang and llvm have been upgraded to 3.4.1 release. + 20140321: Clang and llvm have been upgraded to 3.4 release. Modified: stable/10/contrib/llvm/include/llvm/IR/IntrinsicsX86.td ============================================================================== --- stable/10/contrib/llvm/include/llvm/IR/IntrinsicsX86.td Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/include/llvm/IR/IntrinsicsX86.td Mon May 26 20:45:44 2014 (r266715) @@ -1758,68 +1758,68 @@ let TargetPrefix = "x86" in { // All in def int_x86_avx2_gather_d_pd : GCCBuiltin<"__builtin_ia32_gatherd_pd">, Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_pd_256 : GCCBuiltin<"__builtin_ia32_gatherd_pd256">, Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_pd : GCCBuiltin<"__builtin_ia32_gatherq_pd">, Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_pd_256 : GCCBuiltin<"__builtin_ia32_gatherq_pd256">, Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_ps : GCCBuiltin<"__builtin_ia32_gatherd_ps">, Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_ps_256 : GCCBuiltin<"__builtin_ia32_gatherd_ps256">, Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_ps : GCCBuiltin<"__builtin_ia32_gatherq_ps">, Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_ps_256 : GCCBuiltin<"__builtin_ia32_gatherq_ps256">, Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_q : GCCBuiltin<"__builtin_ia32_gatherd_q">, Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_q_256 : GCCBuiltin<"__builtin_ia32_gatherd_q256">, Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_q : GCCBuiltin<"__builtin_ia32_gatherq_q">, Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_q_256 : GCCBuiltin<"__builtin_ia32_gatherq_q256">, Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_d : GCCBuiltin<"__builtin_ia32_gatherd_d">, Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_d_256 : GCCBuiltin<"__builtin_ia32_gatherd_d256">, Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_d : GCCBuiltin<"__builtin_ia32_gatherq_d">, Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_d_256 : GCCBuiltin<"__builtin_ia32_gatherq_d256">, Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; } // Misc. @@ -2909,28 +2909,28 @@ let TargetPrefix = "x86" in { def int_x86_avx512_gather_dpd_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherdpd512">, Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dps_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherdps512">, Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_qpd_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherqpd512">, Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_qps_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherqps512">, Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dpd_512 : GCCBuiltin<"__builtin_ia32_gatherdpd512">, Intrinsic<[llvm_v8f64_ty], [llvm_v8i32_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dps_512 : GCCBuiltin<"__builtin_ia32_gatherdps512">, Intrinsic<[llvm_v16f32_ty], [llvm_v16i32_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_qpd_512 : GCCBuiltin<"__builtin_ia32_gatherqpd512">, Intrinsic<[llvm_v8f64_ty], [llvm_v8i64_ty, llvm_ptr_ty, llvm_i32_ty], @@ -2938,12 +2938,12 @@ let TargetPrefix = "x86" in { def int_x86_avx512_gather_qps_512 : GCCBuiltin<"__builtin_ia32_gatherqps512">, Intrinsic<[llvm_v8f32_ty], [llvm_v8i64_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dpq_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherdpq512">, Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dpi_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherdpi512">, Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty, llvm_i32_ty], @@ -2955,7 +2955,7 @@ let TargetPrefix = "x86" in { def int_x86_avx512_gather_qpi_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherqpi512">, Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dpq_512 : GCCBuiltin<"__builtin_ia32_gatherdpq512">, Intrinsic<[llvm_v8i64_ty], [llvm_v8i32_ty, llvm_ptr_ty, Modified: stable/10/contrib/llvm/include/llvm/MC/MCAsmInfo.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/MC/MCAsmInfo.h Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/include/llvm/MC/MCAsmInfo.h Mon May 26 20:45:44 2014 (r266715) @@ -266,13 +266,16 @@ namespace llvm { /// global as being a weak undefined symbol. const char *WeakRefDirective; // Defaults to NULL. - /// WeakDefDirective - This directive, if non-null, is used to declare a - /// global as being a weak defined symbol. - const char *WeakDefDirective; // Defaults to NULL. - - /// LinkOnceDirective - This directive, if non-null is used to declare a - /// global as being a weak defined symbol. This is used on cygwin/mingw. - const char *LinkOnceDirective; // Defaults to NULL. + /// True if we have a directive to declare a global as being a weak + /// defined symbol. + bool HasWeakDefDirective; // Defaults to false. + + /// True if we have a directive to declare a global as being a weak + /// defined symbol that can be hidden (unexported). + bool HasWeakDefCanBeHiddenDirective; // Defaults to false. + + /// True if we have a .linkonce directive. This is used on cygwin/mingw. + bool HasLinkOnceDirective; // Defaults to false. /// HiddenVisibilityAttr - This attribute, if not MCSA_Invalid, is used to /// declare a symbol as having hidden visibility. @@ -303,6 +306,10 @@ namespace llvm { /// uses relocations for references to other .debug_* sections. bool DwarfUsesRelocationsAcrossSections; + /// DwarfFDESymbolsUseAbsDiff - true if DWARF FDE symbol reference + /// relocations should be replaced by an absolute difference. + bool DwarfFDESymbolsUseAbsDiff; + /// DwarfRegNumForCFI - True if dwarf register numbers are printed /// instead of symbolic register names in .cfi_* directives. bool DwarfRegNumForCFI; // Defaults to false; @@ -497,8 +504,11 @@ namespace llvm { bool hasIdentDirective() const { return HasIdentDirective; } bool hasNoDeadStrip() const { return HasNoDeadStrip; } const char *getWeakRefDirective() const { return WeakRefDirective; } - const char *getWeakDefDirective() const { return WeakDefDirective; } - const char *getLinkOnceDirective() const { return LinkOnceDirective; } + bool hasWeakDefDirective() const { return HasWeakDefDirective; } + bool hasWeakDefCanBeHiddenDirective() const { + return HasWeakDefCanBeHiddenDirective; + } + bool hasLinkOnceDirective() const { return HasLinkOnceDirective; } MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr;} MCSymbolAttr getHiddenDeclarationVisibilityAttr() const { @@ -528,6 +538,9 @@ namespace llvm { bool doesDwarfUseRelocationsAcrossSections() const { return DwarfUsesRelocationsAcrossSections; } + bool doDwarfFDESymbolsUseAbsDiff() const { + return DwarfFDESymbolsUseAbsDiff; + } bool useDwarfRegNumForCFI() const { return DwarfRegNumForCFI; } Modified: stable/10/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp Mon May 26 20:45:44 2014 (r266715) @@ -18,7 +18,10 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/CaptureTracking.h" +#include "llvm/Analysis/CFG.h" +#include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/InstructionSimplify.h" +#include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/Constants.h" @@ -38,6 +41,12 @@ #include using namespace llvm; +/// Cutoff after which to stop analysing a set of phi nodes potentially involved +/// in a cycle. Because we are analysing 'through' phi nodes we need to be +/// careful with value equivalence. We use reachability to make sure a value +/// cannot be involved in a cycle. +const unsigned MaxNumPhiBBsValueReachabilityCheck = 20; + //===----------------------------------------------------------------------===// // Useful predicates //===----------------------------------------------------------------------===// @@ -403,42 +412,6 @@ DecomposeGEPExpression(const Value *V, i return V; } -/// GetIndexDifference - Dest and Src are the variable indices from two -/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base -/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic -/// difference between the two pointers. -static void GetIndexDifference(SmallVectorImpl &Dest, - const SmallVectorImpl &Src) { - if (Src.empty()) return; - - for (unsigned i = 0, e = Src.size(); i != e; ++i) { - const Value *V = Src[i].V; - ExtensionKind Extension = Src[i].Extension; - int64_t Scale = Src[i].Scale; - - // Find V in Dest. This is N^2, but pointer indices almost never have more - // than a few variable indexes. - for (unsigned j = 0, e = Dest.size(); j != e; ++j) { - if (Dest[j].V != V || Dest[j].Extension != Extension) continue; - - // If we found it, subtract off Scale V's from the entry in Dest. If it - // goes to zero, remove the entry. - if (Dest[j].Scale != Scale) - Dest[j].Scale -= Scale; - else - Dest.erase(Dest.begin()+j); - Scale = 0; - break; - } - - // If we didn't consume this entry, add it to the end of the Dest list. - if (Scale) { - VariableGEPIndex Entry = { V, Extension, -Scale }; - Dest.push_back(Entry); - } - } -} - //===----------------------------------------------------------------------===// // BasicAliasAnalysis Pass //===----------------------------------------------------------------------===// @@ -492,6 +465,7 @@ namespace { // SmallDenseMap if it ever grows larger. // FIXME: This should really be shrink_to_inline_capacity_and_clear(). AliasCache.shrink_and_clear(); + VisitedPhiBBs.clear(); return Alias; } @@ -532,9 +506,39 @@ namespace { typedef SmallDenseMap AliasCacheTy; AliasCacheTy AliasCache; + /// \brief Track phi nodes we have visited. When interpret "Value" pointer + /// equality as value equality we need to make sure that the "Value" is not + /// part of a cycle. Otherwise, two uses could come from different + /// "iterations" of a cycle and see different values for the same "Value" + /// pointer. + /// The following example shows the problem: + /// %p = phi(%alloca1, %addr2) + /// %l = load %ptr + /// %addr1 = gep, %alloca2, 0, %l + /// %addr2 = gep %alloca2, 0, (%l + 1) + /// alias(%p, %addr1) -> MayAlias ! + /// store %l, ... + SmallPtrSet VisitedPhiBBs; + // Visited - Track instructions visited by pointsToConstantMemory. SmallPtrSet Visited; + /// \brief Check whether two Values can be considered equivalent. + /// + /// In addition to pointer equivalence of \p V1 and \p V2 this checks + /// whether they can not be part of a cycle in the value graph by looking at + /// all visited phi nodes an making sure that the phis cannot reach the + /// value. We have to do this because we are looking through phi nodes (That + /// is we say noalias(V, phi(VA, VB)) if noalias(V, VA) and noalias(V, VB). + bool isValueEqualInPotentialCycles(const Value *V1, const Value *V2); + + /// \brief Dest and Src are the variable indices from two decomposed + /// GetElementPtr instructions GEP1 and GEP2 which have common base + /// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic + /// difference between the two pointers. + void GetIndexDifference(SmallVectorImpl &Dest, + const SmallVectorImpl &Src); + // aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP // instruction against another. AliasResult aliasGEP(const GEPOperator *V1, uint64_t V1Size, @@ -1005,7 +1009,15 @@ BasicAliasAnalysis::aliasGEP(const GEPOp return NoAlias; } } else { - if (V1Size != UnknownSize) { + // We have the situation where: + // + + + // | BaseOffset | + // ---------------->| + // |-->V1Size |-------> V2Size + // GEP1 V2 + // We need to know that V2Size is not unknown, otherwise we might have + // stripped a gep with negative index ('gep , -1, ...). + if (V1Size != UnknownSize && V2Size != UnknownSize) { if (-(uint64_t)GEP1BaseOffset < V1Size) return PartialAlias; return NoAlias; @@ -1094,6 +1106,10 @@ BasicAliasAnalysis::aliasPHI(const PHINo const MDNode *PNTBAAInfo, const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo) { + // Track phi nodes we have visited. We use this information when we determine + // value equivalence. + VisitedPhiBBs.insert(PN->getParent()); + // If the values are PHIs in the same block, we can do a more precise // as well as efficient check: just check for aliases between the values // on corresponding edges. @@ -1187,7 +1203,13 @@ BasicAliasAnalysis::aliasCheck(const Val V2 = V2->stripPointerCasts(); // Are we checking for alias of the same value? - if (V1 == V2) return MustAlias; + // Because we look 'through' phi nodes we could look at "Value" pointers from + // different iterations. We must therefore make sure that this is not the + // case. The function isValueEqualInPotentialCycles ensures that this cannot + // happen by looking at the visited phi nodes and making sure they cannot + // reach the value. + if (isValueEqualInPotentialCycles(V1, V2)) + return MustAlias; if (!V1->getType()->isPointerTy() || !V2->getType()->isPointerTy()) return NoAlias; // Scalars cannot alias each other @@ -1307,3 +1329,71 @@ BasicAliasAnalysis::aliasCheck(const Val Location(V2, V2Size, V2TBAAInfo)); return AliasCache[Locs] = Result; } + +bool BasicAliasAnalysis::isValueEqualInPotentialCycles(const Value *V, + const Value *V2) { + if (V != V2) + return false; + + const Instruction *Inst = dyn_cast(V); + if (!Inst) + return true; + + if (VisitedPhiBBs.size() > MaxNumPhiBBsValueReachabilityCheck) + return false; + + // Use dominance or loop info if available. + DominatorTree *DT = getAnalysisIfAvailable(); + LoopInfo *LI = getAnalysisIfAvailable(); + + // Make sure that the visited phis cannot reach the Value. This ensures that + // the Values cannot come from different iterations of a potential cycle the + // phi nodes could be involved in. + for (SmallPtrSet::iterator PI = VisitedPhiBBs.begin(), + PE = VisitedPhiBBs.end(); + PI != PE; ++PI) + if (isPotentiallyReachable((*PI)->begin(), Inst, DT, LI)) + return false; + + return true; +} + +/// GetIndexDifference - Dest and Src are the variable indices from two +/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base +/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic +/// difference between the two pointers. +void BasicAliasAnalysis::GetIndexDifference( + SmallVectorImpl &Dest, + const SmallVectorImpl &Src) { + if (Src.empty()) + return; + + for (unsigned i = 0, e = Src.size(); i != e; ++i) { + const Value *V = Src[i].V; + ExtensionKind Extension = Src[i].Extension; + int64_t Scale = Src[i].Scale; + + // Find V in Dest. This is N^2, but pointer indices almost never have more + // than a few variable indexes. + for (unsigned j = 0, e = Dest.size(); j != e; ++j) { + if (!isValueEqualInPotentialCycles(Dest[j].V, V) || + Dest[j].Extension != Extension) + continue; + + // If we found it, subtract off Scale V's from the entry in Dest. If it + // goes to zero, remove the entry. + if (Dest[j].Scale != Scale) + Dest[j].Scale -= Scale; + else + Dest.erase(Dest.begin() + j); + Scale = 0; + break; + } + + // If we didn't consume this entry, add it to the end of the Dest list. + if (Scale) { + VariableGEPIndex Entry = { V, Extension, -Scale }; + Dest.push_back(Entry); + } + } +} Modified: stable/10/contrib/llvm/lib/Analysis/IVUsers.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Analysis/IVUsers.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Analysis/IVUsers.cpp Mon May 26 20:45:44 2014 (r266715) @@ -187,15 +187,34 @@ bool IVUsers::AddUsersImpl(Instruction * if (AddUserToIVUsers) { // Okay, we found a user that we cannot reduce. - IVUses.push_back(new IVStrideUse(this, User, I)); - IVStrideUse &NewUse = IVUses.back(); + IVStrideUse &NewUse = AddUser(User, I); // Autodetect the post-inc loop set, populating NewUse.PostIncLoops. // The regular return value here is discarded; instead of recording // it, we just recompute it when we need it. + const SCEV *OriginalISE = ISE; ISE = TransformForPostIncUse(NormalizeAutodetect, ISE, User, I, NewUse.PostIncLoops, *SE, *DT); + + // PostIncNormalization effectively simplifies the expression under + // pre-increment assumptions. Those assumptions (no wrapping) might not + // hold for the post-inc value. Catch such cases by making sure the + // transformation is invertible. + if (OriginalISE != ISE) { + const SCEV *DenormalizedISE = + TransformForPostIncUse(Denormalize, ISE, User, I, + NewUse.PostIncLoops, *SE, *DT); + + // If we normalized the expression, but denormalization doesn't give the + // original one, discard this user. + if (OriginalISE != DenormalizedISE) { + DEBUG(dbgs() << " DISCARDING (NORMALIZATION ISN'T INVERTIBLE): " + << *ISE << '\n'); + IVUses.pop_back(); + return false; + } + } DEBUG(if (SE->getSCEV(I) != ISE) dbgs() << " NORMALIZED TO: " << *ISE << '\n'); } Modified: stable/10/contrib/llvm/lib/Analysis/ScalarEvolution.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Analysis/ScalarEvolution.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Analysis/ScalarEvolution.cpp Mon May 26 20:45:44 2014 (r266715) @@ -6218,7 +6218,7 @@ bool ScalarEvolution::isImpliedCond(ICmp // LHS' type is checked for above. if (getTypeSizeInBits(LHS->getType()) > getTypeSizeInBits(FoundLHS->getType())) { - if (CmpInst::isSigned(Pred)) { + if (CmpInst::isSigned(FoundPred)) { FoundLHS = getSignExtendExpr(FoundLHS, LHS->getType()); FoundRHS = getSignExtendExpr(FoundRHS, LHS->getType()); } else { Modified: stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon May 26 20:45:44 2014 (r266715) @@ -223,13 +223,14 @@ void AsmPrinter::EmitLinkage(const Globa case GlobalValue::WeakAnyLinkage: case GlobalValue::WeakODRLinkage: case GlobalValue::LinkerPrivateWeakLinkage: - if (MAI->getWeakDefDirective() != 0) { + if (MAI->hasWeakDefDirective()) { // .globl _foo OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global); bool CanBeHidden = false; - if (Linkage == GlobalValue::LinkOnceODRLinkage) { + if (Linkage == GlobalValue::LinkOnceODRLinkage && + MAI->hasWeakDefCanBeHiddenDirective()) { if (GV->hasUnnamedAddr()) { CanBeHidden = true; } else { @@ -244,7 +245,7 @@ void AsmPrinter::EmitLinkage(const Globa OutStreamer.EmitSymbolAttribute(GVSym, MCSA_WeakDefinition); else OutStreamer.EmitSymbolAttribute(GVSym, MCSA_WeakDefAutoPrivate); - } else if (MAI->getLinkOnceDirective() != 0) { + } else if (MAI->hasLinkOnceDirective()) { // .globl _foo OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global); //NOTE: linkonce is handled by the section the symbol was assigned to. Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon May 26 20:45:44 2014 (r266715) @@ -8547,7 +8547,10 @@ struct MemOpLink { // base ptr. struct ConsecutiveMemoryChainSorter { bool operator()(MemOpLink LHS, MemOpLink RHS) { - return LHS.OffsetFromBase < RHS.OffsetFromBase; + return + LHS.OffsetFromBase < RHS.OffsetFromBase || + (LHS.OffsetFromBase == RHS.OffsetFromBase && + LHS.SequenceNum > RHS.SequenceNum); } }; Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp Mon May 26 20:45:44 2014 (r266715) @@ -210,6 +210,7 @@ SDValue VectorLegalizer::LegalizeOp(SDVa case ISD::SRL: case ISD::ROTL: case ISD::ROTR: + case ISD::BSWAP: case ISD::CTLZ: case ISD::CTTZ: case ISD::CTLZ_ZERO_UNDEF: Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Mon May 26 20:45:44 2014 (r266715) @@ -219,8 +219,11 @@ void ScheduleDAGSDNodes::ClusterNeighbor DenseMap O2SMap; // Map from offset to SDNode. bool Cluster = false; SDNode *Base = Node; + // This algorithm requires a reasonably low use count before finding a match + // to avoid uselessly blowing up compile time in large blocks. + unsigned UseCount = 0; for (SDNode::use_iterator I = Chain->use_begin(), E = Chain->use_end(); - I != E; ++I) { + I != E && UseCount < 100; ++I, ++UseCount) { SDNode *User = *I; if (User == Node || !Visited.insert(User)) continue; @@ -237,6 +240,8 @@ void ScheduleDAGSDNodes::ClusterNeighbor if (Offset2 < Offset1) Base = User; Cluster = true; + // Reset UseCount to allow more matches. + UseCount = 0; } if (!Cluster) Modified: stable/10/contrib/llvm/lib/MC/MCAsmInfo.cpp ============================================================================== --- stable/10/contrib/llvm/lib/MC/MCAsmInfo.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/MC/MCAsmInfo.cpp Mon May 26 20:45:44 2014 (r266715) @@ -76,8 +76,9 @@ MCAsmInfo::MCAsmInfo() { HasIdentDirective = false; HasNoDeadStrip = false; WeakRefDirective = 0; - WeakDefDirective = 0; - LinkOnceDirective = 0; + HasWeakDefDirective = false; + HasWeakDefCanBeHiddenDirective = false; + HasLinkOnceDirective = false; HiddenVisibilityAttr = MCSA_Hidden; HiddenDeclarationVisibilityAttr = MCSA_Hidden; ProtectedVisibilityAttr = MCSA_Protected; @@ -85,6 +86,7 @@ MCAsmInfo::MCAsmInfo() { SupportsDebugInformation = false; ExceptionsType = ExceptionHandling::None; DwarfUsesRelocationsAcrossSections = true; + DwarfFDESymbolsUseAbsDiff = false; DwarfRegNumForCFI = false; HasMicrosoftFastStdCallMangling = false; NeedsDwarfSectionOffsetDirective = false; Modified: stable/10/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp ============================================================================== --- stable/10/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp Mon May 26 20:45:44 2014 (r266715) @@ -27,7 +27,7 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() { HasSingleParameterDotFile = false; PrivateGlobalPrefix = "L"; // Prefix for private global symbols WeakRefDirective = "\t.weak\t"; - LinkOnceDirective = "\t.linkonce discard\n"; + HasLinkOnceDirective = true; // Doesn't support visibility: HiddenVisibilityAttr = HiddenDeclarationVisibilityAttr = MCSA_Invalid; Modified: stable/10/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp ============================================================================== --- stable/10/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp Mon May 26 20:45:44 2014 (r266715) @@ -36,7 +36,8 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() { InlineAsmEnd = " InlineAsm End"; // Directives: - WeakDefDirective = "\t.weak_definition "; + HasWeakDefDirective = true; + HasWeakDefCanBeHiddenDirective = true; WeakRefDirective = "\t.weak_reference "; ZeroDirective = "\t.space\t"; // ".space N" emits N zeros. HasMachoZeroFillDirective = true; // Uses .zerofill Modified: stable/10/contrib/llvm/lib/MC/MCDwarf.cpp ============================================================================== --- stable/10/contrib/llvm/lib/MC/MCDwarf.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/MC/MCDwarf.cpp Mon May 26 20:45:44 2014 (r266715) @@ -839,8 +839,9 @@ static unsigned getSizeForEncoding(MCStr } } -static void EmitSymbol(MCStreamer &streamer, const MCSymbol &symbol, - unsigned symbolEncoding, const char *comment = 0) { +static void EmitFDESymbol(MCStreamer &streamer, const MCSymbol &symbol, + unsigned symbolEncoding, bool isEH, + const char *comment = 0) { MCContext &context = streamer.getContext(); const MCAsmInfo *asmInfo = context.getAsmInfo(); const MCExpr *v = asmInfo->getExprForFDESymbol(&symbol, @@ -848,7 +849,10 @@ static void EmitSymbol(MCStreamer &strea streamer); unsigned size = getSizeForEncoding(streamer, symbolEncoding); if (streamer.isVerboseAsm() && comment) streamer.AddComment(comment); - streamer.EmitAbsValue(v, size); + if (asmInfo->doDwarfFDESymbolsUseAbsDiff() && isEH) + streamer.EmitAbsValue(v, size); + else + streamer.EmitValue(v, size); } static void EmitPersonality(MCStreamer &streamer, const MCSymbol &symbol, @@ -1347,7 +1351,7 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCSt unsigned PCEncoding = IsEH ? MOFI->getFDEEncoding(UsingCFI) : (unsigned)dwarf::DW_EH_PE_absptr; unsigned PCSize = getSizeForEncoding(streamer, PCEncoding); - EmitSymbol(streamer, *frame.Begin, PCEncoding, "FDE initial location"); + EmitFDESymbol(streamer, *frame.Begin, PCEncoding, IsEH, "FDE initial location"); // PC Range const MCExpr *Range = MakeStartMinusEndExpr(streamer, *frame.Begin, @@ -1367,8 +1371,8 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCSt // Augmentation Data if (frame.Lsda) - EmitSymbol(streamer, *frame.Lsda, frame.LsdaEncoding, - "Language Specific Data Area"); + EmitFDESymbol(streamer, *frame.Lsda, frame.LsdaEncoding, true, + "Language Specific Data Area"); } // Call Frame Instructions Modified: stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Mon May 26 20:45:44 2014 (r266715) @@ -4297,6 +4297,10 @@ bool AsmParser::parseMSInlineAsm( break; } case AOK_DotOperator: + // Insert the dot if the user omitted it. + OS.flush(); + if (AsmStringIR.at(AsmStringIR.size() - 1) != '.') + OS << '.'; OS << (*I).Val; break; } Modified: stable/10/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Mon May 26 20:45:44 2014 (r266715) @@ -31,12 +31,8 @@ using namespace llvm; static TargetLoweringObjectFile *createTLOF(AArch64TargetMachine &TM) { const AArch64Subtarget *Subtarget = &TM.getSubtarget(); - - if (Subtarget->isTargetLinux()) - return new AArch64LinuxTargetObjectFile(); - if (Subtarget->isTargetELF()) - return new TargetLoweringObjectFileELF(); - llvm_unreachable("unknown subtarget type"); + assert (Subtarget->isTargetELF() && "unknown subtarget type"); + return new AArch64ElfTargetObjectFile(); } AArch64TargetLowering::AArch64TargetLowering(AArch64TargetMachine &TM) @@ -2782,7 +2778,7 @@ AArch64TargetLowering::LowerSETCC(SDValu SDValue AArch64TargetLowering::LowerVACOPY(SDValue Op, SelectionDAG &DAG) const { const Value *DestSV = cast(Op.getOperand(3))->getValue(); - const Value *SrcSV = cast(Op.getOperand(3))->getValue(); + const Value *SrcSV = cast(Op.getOperand(4))->getValue(); // We have to make sure we copy the entire structure: 8+8+8+4+4 = 32 bytes // rather than just 8. Modified: stable/10/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td ============================================================================== --- stable/10/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td Mon May 26 20:45:44 2014 (r266715) @@ -2587,6 +2587,7 @@ class A64I_SRexs_impl size, bits pat, itin> { let mayStore = 1; let PostEncoderMethod = "fixLoadStoreExclusive<1,0>"; + let Constraints = "@earlyclobber $Rs"; } multiclass A64I_SRex opcode, string prefix> { Modified: stable/10/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp Mon May 26 20:45:44 2014 (r266715) @@ -22,3 +22,10 @@ AArch64LinuxTargetObjectFile::Initialize TargetLoweringObjectFileELF::Initialize(Ctx, TM); InitializeELF(TM.Options.UseInitArray); } + +void +AArch64ElfTargetObjectFile::Initialize(MCContext &Ctx, + const TargetMachine &TM) { + TargetLoweringObjectFileELF::Initialize(Ctx, TM); + InitializeELF(TM.Options.UseInitArray); +} Modified: stable/10/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h ============================================================================== --- stable/10/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h Mon May 26 20:45:44 2014 (r266715) @@ -20,8 +20,12 @@ namespace llvm { - /// AArch64LinuxTargetObjectFile - This implementation is used for linux - /// AArch64. + /// AArch64ElfTargetObjectFile - This implementation is used for ELF + /// AArch64 targets. + class AArch64ElfTargetObjectFile : public TargetLoweringObjectFileELF { + virtual void Initialize(MCContext &Ctx, const TargetMachine &TM); + }; + class AArch64LinuxTargetObjectFile : public TargetLoweringObjectFileELF { virtual void Initialize(MCContext &Ctx, const TargetMachine &TM); }; Modified: stable/10/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp Mon May 26 20:45:44 2014 (r266715) @@ -418,7 +418,8 @@ SmallVector A15SDOptimizer: if (!MO.isReg() || !MO.isUse()) continue; if (!usesRegClass(MO, &ARM::DPRRegClass) && - !usesRegClass(MO, &ARM::QPRRegClass)) + !usesRegClass(MO, &ARM::QPRRegClass) && + !usesRegClass(MO, &ARM::DPairRegClass)) // Treat DPair as QPR continue; Defs.push_back(MO.getReg()); @@ -538,7 +539,10 @@ A15SDOptimizer::optimizeAllLanesPattern( InsertPt++; unsigned Out; - if (MRI->getRegClass(Reg)->hasSuperClassEq(&ARM::QPRRegClass)) { + // DPair has the same length as QPR and also has two DPRs as subreg. + // Treat DPair as QPR. + if (MRI->getRegClass(Reg)->hasSuperClassEq(&ARM::QPRRegClass) || + MRI->getRegClass(Reg)->hasSuperClassEq(&ARM::DPairRegClass)) { unsigned DSub0 = createExtractSubreg(MBB, InsertPt, DL, Reg, ARM::dsub_0, &ARM::DPRRegClass); unsigned DSub1 = createExtractSubreg(MBB, InsertPt, DL, Reg, @@ -571,7 +575,9 @@ A15SDOptimizer::optimizeAllLanesPattern( default: llvm_unreachable("Unknown preferred lane!"); } - bool UsesQPR = usesRegClass(MI->getOperand(0), &ARM::QPRRegClass); + // Treat DPair as QPR + bool UsesQPR = usesRegClass(MI->getOperand(0), &ARM::QPRRegClass) || + usesRegClass(MI->getOperand(0), &ARM::DPairRegClass); Out = createImplicitDef(MBB, InsertPt, DL); Out = createInsertSubreg(MBB, InsertPt, DL, Out, PrefLane, Reg); Modified: stable/10/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp Mon May 26 20:45:44 2014 (r266715) @@ -3684,6 +3684,7 @@ ARMBaseInstrInfo::getOperandLatency(cons case ARM::VLD3d16Pseudo: case ARM::VLD3d32Pseudo: case ARM::VLD1d64TPseudo: + case ARM::VLD1d64TPseudoWB_fixed: case ARM::VLD3d8Pseudo_UPD: case ARM::VLD3d16Pseudo_UPD: case ARM::VLD3d32Pseudo_UPD: @@ -3700,6 +3701,7 @@ ARMBaseInstrInfo::getOperandLatency(cons case ARM::VLD4d16Pseudo: case ARM::VLD4d32Pseudo: case ARM::VLD1d64QPseudo: + case ARM::VLD1d64QPseudoWB_fixed: case ARM::VLD4d8Pseudo_UPD: case ARM::VLD4d16Pseudo_UPD: case ARM::VLD4d32Pseudo_UPD: Modified: stable/10/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp Mon May 26 20:45:44 2014 (r266715) @@ -136,7 +136,9 @@ static const NEONLdStTableEntry NEONLdSt { ARM::VLD1LNq8Pseudo_UPD, ARM::VLD1LNd8_UPD, true, true, true, EvenDblSpc, 1, 8 ,true}, { ARM::VLD1d64QPseudo, ARM::VLD1d64Q, true, false, false, SingleSpc, 4, 1 ,false}, +{ ARM::VLD1d64QPseudoWB_fixed, ARM::VLD1d64Qwb_fixed, true, true, false, SingleSpc, 4, 1 ,false}, { ARM::VLD1d64TPseudo, ARM::VLD1d64T, true, false, false, SingleSpc, 3, 1 ,false}, +{ ARM::VLD1d64TPseudoWB_fixed, ARM::VLD1d64Twb_fixed, true, true, false, SingleSpc, 3, 1 ,false}, { ARM::VLD2LNd16Pseudo, ARM::VLD2LNd16, true, false, false, SingleSpc, 2, 4 ,true}, { ARM::VLD2LNd16Pseudo_UPD, ARM::VLD2LNd16_UPD, true, true, true, SingleSpc, 2, 4 ,true}, @@ -1071,6 +1073,7 @@ bool ARMExpandPseudo::ExpandMI(MachineBa case ARM::VLD3d16Pseudo: case ARM::VLD3d32Pseudo: case ARM::VLD1d64TPseudo: + case ARM::VLD1d64TPseudoWB_fixed: case ARM::VLD3d8Pseudo_UPD: case ARM::VLD3d16Pseudo_UPD: case ARM::VLD3d32Pseudo_UPD: @@ -1087,6 +1090,7 @@ bool ARMExpandPseudo::ExpandMI(MachineBa case ARM::VLD4d16Pseudo: case ARM::VLD4d32Pseudo: case ARM::VLD1d64QPseudo: + case ARM::VLD1d64QPseudoWB_fixed: case ARM::VLD4d8Pseudo_UPD: case ARM::VLD4d16Pseudo_UPD: case ARM::VLD4d32Pseudo_UPD: Modified: stable/10/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon May 26 20:14:36 2014 (r266714) +++ stable/10/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon May 26 20:45:44 2014 (r266715) @@ -1673,9 +1673,61 @@ SDValue ARMDAGToDAGISel::GetVLDSTAlign(S return CurDAG->getTargetConstant(Alignment, MVT::i32); } +static bool isVLDfixed(unsigned Opc) +{ + switch (Opc) { + default: return false; + case ARM::VLD1d8wb_fixed : return true; + case ARM::VLD1d16wb_fixed : return true; + case ARM::VLD1d64Qwb_fixed : return true; + case ARM::VLD1d32wb_fixed : return true; + case ARM::VLD1d64wb_fixed : return true; + case ARM::VLD1d64TPseudoWB_fixed : return true; + case ARM::VLD1d64QPseudoWB_fixed : return true; + case ARM::VLD1q8wb_fixed : return true; + case ARM::VLD1q16wb_fixed : return true; + case ARM::VLD1q32wb_fixed : return true; + case ARM::VLD1q64wb_fixed : return true; + case ARM::VLD2d8wb_fixed : return true; + case ARM::VLD2d16wb_fixed : return true; + case ARM::VLD2d32wb_fixed : return true; + case ARM::VLD2q8PseudoWB_fixed : return true; + case ARM::VLD2q16PseudoWB_fixed : return true; + case ARM::VLD2q32PseudoWB_fixed : return true; + case ARM::VLD2DUPd8wb_fixed : return true; + case ARM::VLD2DUPd16wb_fixed : return true; + case ARM::VLD2DUPd32wb_fixed : return true; + } +} + +static bool isVSTfixed(unsigned Opc) +{ + switch (Opc) { + default: return false; + case ARM::VST1d8wb_fixed : return true; + case ARM::VST1d16wb_fixed : return true; + case ARM::VST1d32wb_fixed : return true; + case ARM::VST1d64wb_fixed : return true; + case ARM::VST1q8wb_fixed : return true; + case ARM::VST1q16wb_fixed : return true; + case ARM::VST1q32wb_fixed : return true; + case ARM::VST1q64wb_fixed : return true; + case ARM::VST1d64TPseudoWB_fixed : return true; + case ARM::VST1d64QPseudoWB_fixed : return true; + case ARM::VST2d8wb_fixed : return true; + case ARM::VST2d16wb_fixed : return true; + case ARM::VST2d32wb_fixed : return true; + case ARM::VST2q8PseudoWB_fixed : return true; + case ARM::VST2q16PseudoWB_fixed : return true; + case ARM::VST2q32PseudoWB_fixed : return true; + } +} + // Get the register stride update opcode of a VLD/VST instruction that // is otherwise equivalent to the given fixed stride updating instruction. static unsigned getVLDSTRegisterUpdateOpcode(unsigned Opc) { + assert((isVLDfixed(Opc) || isVSTfixed(Opc)) + && "Incorrect fixed stride updating instruction."); switch (Opc) { default: break; case ARM::VLD1d8wb_fixed: return ARM::VLD1d8wb_register; @@ -1686,6 +1738,10 @@ static unsigned getVLDSTRegisterUpdateOp case ARM::VLD1q16wb_fixed: return ARM::VLD1q16wb_register; case ARM::VLD1q32wb_fixed: return ARM::VLD1q32wb_register; case ARM::VLD1q64wb_fixed: return ARM::VLD1q64wb_register; + case ARM::VLD1d64Twb_fixed: return ARM::VLD1d64Twb_register; + case ARM::VLD1d64Qwb_fixed: return ARM::VLD1d64Qwb_register; + case ARM::VLD1d64TPseudoWB_fixed: return ARM::VLD1d64TPseudoWB_register; + case ARM::VLD1d64QPseudoWB_fixed: return ARM::VLD1d64QPseudoWB_register; case ARM::VST1d8wb_fixed: return ARM::VST1d8wb_register; case ARM::VST1d16wb_fixed: return ARM::VST1d16wb_register; @@ -1785,11 +1841,11 @@ SDNode *ARMDAGToDAGISel::SelectVLD(SDNod SDValue Inc = N->getOperand(AddrOpIdx + 1); // FIXME: VLD1/VLD2 fixed increment doesn't need Reg0. Remove the reg0 // case entirely when the rest are updated to that form, too. - if ((NumVecs == 1 || NumVecs == 2) && !isa(Inc.getNode())) + if ((NumVecs <= 2) && !isa(Inc.getNode())) Opc = getVLDSTRegisterUpdateOpcode(Opc); - // We use a VLD1 for v1i64 even if the pseudo says vld2/3/4, so + // FIXME: We use a VLD1 for v1i64 even if the pseudo says vld2/3/4, so // check for that explicitly too. Horribly hacky, but temporary. - if ((NumVecs != 1 && NumVecs != 2 && Opc != ARM::VLD1q64wb_fixed) || + if ((NumVecs > 2 && !isVLDfixed(Opc)) || !isa(Inc.getNode())) Ops.push_back(isa(Inc.getNode()) ? Reg0 : Inc); } @@ -1937,11 +1993,12 @@ SDNode *ARMDAGToDAGISel::SelectVST(SDNod // case entirely when the rest are updated to that form, too. if (NumVecs <= 2 && !isa(Inc.getNode())) Opc = getVLDSTRegisterUpdateOpcode(Opc); - // We use a VST1 for v1i64 even if the pseudo says vld2/3/4, so + // FIXME: We use a VST1 for v1i64 even if the pseudo says vld2/3/4, so // check for that explicitly too. Horribly hacky, but temporary. - if ((NumVecs > 2 && Opc != ARM::VST1q64wb_fixed) || - !isa(Inc.getNode())) - Ops.push_back(isa(Inc.getNode()) ? Reg0 : Inc); + if (!isa(Inc.getNode())) + Ops.push_back(Inc); + else if (NumVecs > 2 && !isVSTfixed(Opc)) + Ops.push_back(Reg0); } Ops.push_back(SrcReg); Ops.push_back(Pred); @@ -2834,7 +2891,7 @@ SDNode *ARMDAGToDAGISel::Select(SDNode * static const uint16_t DOpcodes[] = { ARM::VLD3d8Pseudo_UPD, ARM::VLD3d16Pseudo_UPD, ARM::VLD3d32Pseudo_UPD, - ARM::VLD1q64wb_fixed}; + ARM::VLD1d64TPseudoWB_fixed}; static const uint16_t QOpcodes0[] = { ARM::VLD3q8Pseudo_UPD, ARM::VLD3q16Pseudo_UPD, ARM::VLD3q32Pseudo_UPD }; @@ -2848,7 +2905,7 @@ SDNode *ARMDAGToDAGISel::Select(SDNode * static const uint16_t DOpcodes[] = { ARM::VLD4d8Pseudo_UPD, ARM::VLD4d16Pseudo_UPD, ARM::VLD4d32Pseudo_UPD, - ARM::VLD1q64wb_fixed}; + ARM::VLD1d64QPseudoWB_fixed}; static const uint16_t QOpcodes0[] = { ARM::VLD4q8Pseudo_UPD, ARM::VLD4q16Pseudo_UPD, ARM::VLD4q32Pseudo_UPD }; Modified: stable/10/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td ============================================================================== --- stable/10/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td Mon May 26 20:14:36 2014 (r266714) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 21:09:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2AB51BF; Mon, 26 May 2014 21:09: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 1773A2B7C; Mon, 26 May 2014 21:09: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 s4QL9YFm070768; Mon, 26 May 2014 21:09:34 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QL9Y67070767; Mon, 26 May 2014 21:09:34 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201405262109.s4QL9Y67070767@svn.freebsd.org> From: Warren Block Date: Mon, 26 May 2014 21:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266716 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 21:09:35 -0000 Author: wblock (doc committer) Date: Mon May 26 21:09:34 2014 New Revision: 266716 URL: http://svnweb.freebsd.org/changeset/base/266716 Log: Remove vt.4.gz from ObsoleteFiles.inc that happily removes our shiny new vt.4 man page. It was in there from the removal of pcvt eight years ago. Approved by: emaste MFC after: 3 days Modified: stable/10/ObsoleteFiles.inc Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Mon May 26 20:45:44 2014 (r266715) +++ stable/10/ObsoleteFiles.inc Mon May 26 21:09:34 2014 (r266716) @@ -2747,7 +2747,6 @@ OLD_DIRS+=usr/share/misc/pcvtfonts OLD_FILES+=usr/share/misc/keycap.pcvt OLD_FILES+=usr/share/man/man8/ispcvt.8.gz OLD_FILES+=usr/share/man/man5/keycap.5.gz -OLD_FILES+=usr/share/man/man4/vt.4.gz OLD_FILES+=usr/share/man/man4/pcvt.4.gz OLD_FILES+=usr/share/man/man3/kgetstr.3.gz OLD_FILES+=usr/share/man/man3/kgetnum.3.gz From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 22:27:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3A76F6BB; Mon, 26 May 2014 22:27: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 273C12160; Mon, 26 May 2014 22:27: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 s4QMRFIq006967; Mon, 26 May 2014 22:27:15 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QMRFXD006966; Mon, 26 May 2014 22:27:15 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405262227.s4QMRFXD006966@svn.freebsd.org> From: Ian Lepore Date: Mon, 26 May 2014 22:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266717 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 22:27:15 -0000 Author: ian Date: Mon May 26 22:27:14 2014 New Revision: 266717 URL: http://svnweb.freebsd.org/changeset/base/266717 Log: MFC 263949, 265063: Add library dependencies for a couple bootstrap libs to fix build failures for high -jN values when building with gcc. Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Mon May 26 21:09:34 2014 (r266716) +++ stable/10/Makefile.inc1 Mon May 26 22:27:14 2014 (r266717) @@ -1500,6 +1500,10 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ ${_secure_lib_libssh} ${_secure_lib_libssl} +.if ${MK_GNUCXX} != no +_prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ +gnu/lib/libstdc++__L: lib/msun__L +.endif .if defined(WITH_ATF) || ${MK_TESTS} != "no" .if !defined(WITH_ATF) From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 22:54:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4C0CFB26; Mon, 26 May 2014 22:54: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 2D2C0236E; Mon, 26 May 2014 22:54: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 s4QMsGtC019440; Mon, 26 May 2014 22:54:16 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QMsFJx019434; Mon, 26 May 2014 22:54:15 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405262254.s4QMsFJx019434@svn.freebsd.org> From: Steven Hartland Date: Mon, 26 May 2014 22:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266718 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 22:54:16 -0000 Author: smh Date: Mon May 26 22:54:15 2014 New Revision: 266718 URL: http://svnweb.freebsd.org/changeset/base/266718 Log: MFC r264879 Fix jailed raw sockets not setting the correct source address by calling in_pcbladdr instead of prison_get_ip4. Sponsored by: Multiplay Modified: stable/10/sys/netinet/in_pcb.c stable/10/sys/netinet/in_pcb.h stable/10/sys/netinet/raw_ip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/in_pcb.c ============================================================================== --- stable/10/sys/netinet/in_pcb.c Mon May 26 22:27:14 2014 (r266717) +++ stable/10/sys/netinet/in_pcb.c Mon May 26 22:54:15 2014 (r266718) @@ -694,7 +694,7 @@ in_pcbconnect(struct inpcb *inp, struct * Do proper source address selection on an unbound socket in case * of connect. Take jails into account as well. */ -static int +int in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr, struct ucred *cred) { Modified: stable/10/sys/netinet/in_pcb.h ============================================================================== --- stable/10/sys/netinet/in_pcb.h Mon May 26 22:27:14 2014 (r266717) +++ stable/10/sys/netinet/in_pcb.h Mon May 26 22:54:15 2014 (r266718) @@ -636,6 +636,8 @@ void in_pcbdrop(struct inpcb *); void in_pcbfree(struct inpcb *); int in_pcbinshash(struct inpcb *); int in_pcbinshash_nopcbgroup(struct inpcb *); +int in_pcbladdr(struct inpcb *, struct in_addr *, struct in_addr *, + struct ucred *); struct inpcb * in_pcblookup_local(struct inpcbinfo *, struct in_addr, u_short, int, struct ucred *); Modified: stable/10/sys/netinet/raw_ip.c ============================================================================== --- stable/10/sys/netinet/raw_ip.c Mon May 26 22:27:14 2014 (r266717) +++ stable/10/sys/netinet/raw_ip.c Mon May 26 22:54:15 2014 (r266718) @@ -453,26 +453,26 @@ rip_output(struct mbuf *m, struct socket ip->ip_p = inp->inp_ip_p; ip->ip_len = htons(m->m_pkthdr.len); ip->ip_src = inp->inp_laddr; + ip->ip_dst.s_addr = dst; if (jailed(inp->inp_cred)) { /* * prison_local_ip4() would be good enough but would * let a source of INADDR_ANY pass, which we do not - * want to see from jails. We do not go through the - * pain of in_pcbladdr() for raw sockets. + * want to see from jails. */ - if (ip->ip_src.s_addr == INADDR_ANY) - error = prison_get_ip4(inp->inp_cred, - &ip->ip_src); - else + if (ip->ip_src.s_addr == INADDR_ANY) { + error = in_pcbladdr(inp, &ip->ip_dst, &ip->ip_src, + inp->inp_cred); + } else { error = prison_local_ip4(inp->inp_cred, &ip->ip_src); + } if (error != 0) { INP_RUNLOCK(inp); m_freem(m); return (error); } } - ip->ip_dst.s_addr = dst; ip->ip_ttl = inp->inp_ip_ttl; } else { if (m->m_pkthdr.len > IP_MAXPACKET) { From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 23:44:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E3D7B59D; Mon, 26 May 2014 23:44: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 CFC822728; Mon, 26 May 2014 23:44: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 s4QNi931041635; Mon, 26 May 2014 23:44:09 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QNi9j2041633; Mon, 26 May 2014 23:44:09 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405262344.s4QNi9j2041633@svn.freebsd.org> From: Steven Hartland Date: Mon, 26 May 2014 23:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266719 - stable/10/usr.bin/truss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 23:44:10 -0000 Author: smh Date: Mon May 26 23:44:09 2014 New Revision: 266719 URL: http://svnweb.freebsd.org/changeset/base/266719 Log: MFC r264881 Add Linux socket call decoding to truss Sponsored by: Multiplay Modified: stable/10/usr.bin/truss/syscall.h stable/10/usr.bin/truss/syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/truss/syscall.h ============================================================================== --- stable/10/usr.bin/truss/syscall.h Mon May 26 22:54:15 2014 (r266718) +++ stable/10/usr.bin/truss/syscall.h Mon May 26 23:44:09 2014 (r266719) @@ -40,7 +40,8 @@ enum Argtype { None = 1, Hex, Octal, Int Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres, Umtx, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open, Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, - Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl }; + Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, + LinuxSockArgs }; #define ARG_MASK 0xff #define OUT 0x100 @@ -64,6 +65,47 @@ struct syscall { struct syscall *get_syscall(const char*); char *print_arg(struct syscall_args *, unsigned long*, long, struct trussinfo *); + +/* + * Linux Socket defines + */ +#define LINUX_SOCKET 1 +#define LINUX_BIND 2 +#define LINUX_CONNECT 3 +#define LINUX_LISTEN 4 +#define LINUX_ACCEPT 5 +#define LINUX_GETSOCKNAME 6 +#define LINUX_GETPEERNAME 7 +#define LINUX_SOCKETPAIR 8 +#define LINUX_SEND 9 +#define LINUX_RECV 10 +#define LINUX_SENDTO 11 +#define LINUX_RECVFROM 12 +#define LINUX_SHUTDOWN 13 +#define LINUX_SETSOCKOPT 14 +#define LINUX_GETSOCKOPT 15 +#define LINUX_SENDMSG 16 +#define LINUX_RECVMSG 17 + +#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ + 0 : sizeof(register_t) - sizeof(t)) + +#if BYTE_ORDER == LITTLE_ENDIAN +#define PADL_(t) 0 +#define PADR_(t) PAD_(t) +#else +#define PADL_(t) PAD_(t) +#define PADR_(t) 0 +#endif + +typedef int l_int; +typedef uint32_t l_ulong; + +struct linux_socketcall_args { + char what_l_[PADL_(l_int)]; l_int what; char what_r_[PADR_(l_int)]; + char args_l_[PADL_(l_ulong)]; l_ulong args; char args_r_[PADR_(l_ulong)]; +}; + void print_syscall(struct trussinfo *, const char *, int, char **); void print_syscall_ret(struct trussinfo *, const char *, int, char **, int, long, struct syscall *); Modified: stable/10/usr.bin/truss/syscalls.c ============================================================================== --- stable/10/usr.bin/truss/syscalls.c Mon May 26 22:54:15 2014 (r266718) +++ stable/10/usr.bin/truss/syscalls.c Mon May 26 23:44:09 2014 (r266719) @@ -100,6 +100,10 @@ static struct syscall syscalls[] = { .args = { { Rforkflags, 0 } } }, { .name = "getegid", .ret_type = 1, .nargs = 0 }, { .name = "geteuid", .ret_type = 1, .nargs = 0 }, + { .name = "linux_readlink", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 } , { Name | OUT, 1 }, { Int, 2 }}}, + { .name = "linux_socketcall", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 } , { LinuxSockArgs, 1 }}}, { .name = "getgid", .ret_type = 1, .nargs = 0 }, { .name = "getpid", .ret_type = 1, .nargs = 0 }, { .name = "getpgid", .ret_type = 1, .nargs = 1, @@ -117,6 +121,8 @@ static struct syscall syscalls[] = { .args = { { Int, 0 }, { Int, 1 }, { Whence, 2 } } }, { .name = "mmap", .ret_type = 2, .nargs = 6, .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 }, { Mmapflags, 3 }, { Int, 4 }, { Quad, 5 + QUAD_ALIGN } } }, + { .name = "linux_mkdir", .ret_type = 1, .nargs = 2, + .args = { { Name | IN, 0} , {Int, 1}}}, { .name = "mprotect", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 } } }, { .name = "open", .ret_type = 1, .nargs = 3, @@ -141,6 +147,8 @@ static struct syscall syscalls[] = { .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "chown", .ret_type = 0, .nargs = 3, .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } }, + { .name = "linux_stat64", .ret_type = 1, .nargs = 3, + .args = { { Name | IN, 0 }, { Ptr | OUT, 1 }, { Ptr | IN, 1 }}}, { .name = "mount", .ret_type = 0, .nargs = 4, .args = { { Name, 0 }, { Name, 1 }, { Int, 2 }, { Ptr, 3 } } }, { .name = "umount", .ret_type = 0, .nargs = 2, @@ -153,6 +161,8 @@ static struct syscall syscalls[] = { .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } }, { .name = "linux_newstat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } }, + { .name = "linux_access", .ret_type = 1, .nargs = 2, + .args = { { Name, 0 }, { Int, 1 }}}, { .name = "linux_newfstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Ptr | OUT, 1 } } }, { .name = "write", .ret_type = 1, .nargs = 3, @@ -776,6 +786,76 @@ print_arg(struct syscall_args *sc, unsig asprintf(&tmp, "0x%lx", args[sc->offset]); break; } + case LinuxSockArgs: + { + struct linux_socketcall_args largs; + if (get_struct(pid, (void *)args[sc->offset], (void *)&largs, + sizeof(largs)) == -1) { + err(1, "get_struct %p", (void *)args[sc->offset]); + } + const char *what; + char buf[30]; + + switch (largs.what) { + case LINUX_SOCKET: + what = "LINUX_SOCKET"; + break; + case LINUX_BIND: + what = "LINUX_BIND"; + break; + case LINUX_CONNECT: + what = "LINUX_CONNECT"; + break; + case LINUX_LISTEN: + what = "LINUX_LISTEN"; + break; + case LINUX_ACCEPT: + what = "LINUX_ACCEPT"; + break; + case LINUX_GETSOCKNAME: + what = "LINUX_GETSOCKNAME"; + break; + case LINUX_GETPEERNAME: + what = "LINUX_GETPEERNAME"; + break; + case LINUX_SOCKETPAIR: + what = "LINUX_SOCKETPAIR"; + break; + case LINUX_SEND: + what = "LINUX_SEND"; + break; + case LINUX_RECV: + what = "LINUX_RECV"; + break; + case LINUX_SENDTO: + what = "LINUX_SENDTO"; + break; + case LINUX_RECVFROM: + what = "LINUX_RECVFROM"; + break; + case LINUX_SHUTDOWN: + what = "LINUX_SHUTDOWN"; + break; + case LINUX_SETSOCKOPT: + what = "LINUX_SETSOCKOPT"; + break; + case LINUX_GETSOCKOPT: + what = "LINUX_GETSOCKOPT"; + break; + case LINUX_SENDMSG: + what = "LINUX_SENDMSG"; + break; + case LINUX_RECVMSG: + what = "LINUX_RECVMSG"; + break; + default: + sprintf(buf, "%d", largs.what); + what = buf; + break; + } + asprintf(&tmp, "(0x%lx)%s, 0x%lx", args[sc->offset], what, (long unsigned int)largs.args); + break; + } case Pollfd: { /* * XXX: A Pollfd argument expects the /next/ syscall argument From owner-svn-src-stable-10@FreeBSD.ORG Mon May 26 23:47:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AE2EC6EF; Mon, 26 May 2014 23:47: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 80A63273D; Mon, 26 May 2014 23:47: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 s4QNlvMa042153; Mon, 26 May 2014 23:47:57 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QNlvBL042152; Mon, 26 May 2014 23:47:57 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405262347.s4QNlvBL042152@svn.freebsd.org> From: Steven Hartland Date: Mon, 26 May 2014 23:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266720 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 23:47:57 -0000 Author: smh Date: Mon May 26 23:47:57 2014 New Revision: 266720 URL: http://svnweb.freebsd.org/changeset/base/266720 Log: MFC r264885 Eliminate duplicate checks in vdev_geom_io_intr error handling Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon May 26 23:44:09 2014 (r266719) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon May 26 23:47:57 2014 (r266720) @@ -717,35 +717,39 @@ vdev_geom_io_intr(struct bio *bp) zio->io_error = bp->bio_error; if (zio->io_error == 0 && bp->bio_resid != 0) zio->io_error = EIO; - if (bp->bio_cmd == BIO_FLUSH && bp->bio_error == ENOTSUP) { - /* - * If we get ENOTSUP, we know that no future - * attempts will ever succeed. In this case we - * set a persistent bit so that we don't bother - * with the ioctl in the future. - */ - vd->vdev_nowritecache = B_TRUE; - } - if (bp->bio_cmd == BIO_DELETE && bp->bio_error == ENOTSUP) { - /* - * If we get ENOTSUP, we know that no future - * attempts will ever succeed. In this case we - * set a persistent bit so that we don't bother - * with the ioctl in the future. - */ - vd->vdev_notrim = B_TRUE; - } - if (zio->io_error == ENXIO && !vd->vdev_remove_wanted) { + + switch(zio->io_error) { + case ENOTSUP: /* - * If provider's error is set we assume it is being - * removed. + * If we get ENOTSUP for BIO_FLUSH or BIO_DELETE we know + * that future attempts will never succeed. In this case + * we set a persistent flag so that we don't bother with + * requests in the future. */ - if (bp->bio_to->error != 0) { - vd->vdev_remove_wanted = B_TRUE; - spa_async_request(zio->io_spa, SPA_ASYNC_REMOVE); - } else if (!vd->vdev_delayed_close) { - vd->vdev_delayed_close = B_TRUE; + switch(bp->bio_cmd) { + case BIO_FLUSH: + vd->vdev_nowritecache = B_TRUE; + break; + case BIO_DELETE: + vd->vdev_notrim = B_TRUE; + break; + } + break; + case ENXIO: + if (!vd->vdev_remove_wanted) { + /* + * If provider's error is set we assume it is being + * removed. + */ + if (bp->bio_to->error != 0) { + vd->vdev_remove_wanted = B_TRUE; + spa_async_request(zio->io_spa, + SPA_ASYNC_REMOVE); + } else if (!vd->vdev_delayed_close) { + vd->vdev_delayed_close = B_TRUE; + } } + break; } g_destroy_bio(bp); zio_interrupt(zio); From owner-svn-src-stable-10@FreeBSD.ORG Tue May 27 01:58:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 09AFD92A; Tue, 27 May 2014 01:58: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 EA96B2007; Tue, 27 May 2014 01:58: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 s4R1w5jh099252; Tue, 27 May 2014 01:58:05 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R1w5AW099251; Tue, 27 May 2014 01:58:05 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201405270158.s4R1w5AW099251@svn.freebsd.org> From: Kevin Lo Date: Tue, 27 May 2014 01:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266722 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 01:58:06 -0000 Author: kevlo Date: Tue May 27 01:58:05 2014 New Revision: 266722 URL: http://svnweb.freebsd.org/changeset/base/266722 Log: MFC 266721: Remove r264317 by accident. Spotted by: Kuan-Chung Chiu Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Tue May 27 01:47:23 2014 (r266721) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Tue May 27 01:58:05 2014 (r266722) @@ -95,6 +95,7 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(ABOCOM, RTL8188CU_2), URTWN_DEV(ABOCOM, RTL8192CU), URTWN_DEV(ASUS, RTL8192CU), + URTWN_DEV(ASUS, USBN10NANO), URTWN_DEV(AZUREWAVE, RTL8188CE_1), URTWN_DEV(AZUREWAVE, RTL8188CE_2), URTWN_DEV(AZUREWAVE, RTL8188CU), From owner-svn-src-stable-10@FreeBSD.ORG Tue May 27 14:55:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 799B9E28; Tue, 27 May 2014 14:55: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 66A48229D; Tue, 27 May 2014 14:55: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 s4REtAc4053198; Tue, 27 May 2014 14:55:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4REtAth053195; Tue, 27 May 2014 14:55:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405271455.s4REtAth053195@svn.freebsd.org> From: Marius Strobl Date: Tue, 27 May 2014 14:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266749 - stable/10/sys/geom/eli X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 14:55:10 -0000 Author: marius Date: Tue May 27 14:55:09 2014 New Revision: 266749 URL: http://svnweb.freebsd.org/changeset/base/266749 Log: MFC: r259428 Clear content of keyfiles loaded by the loader after processing them. MFC: r259429 Clear some more places with potentially sensitive data. Modified: stable/10/sys/geom/eli/g_eli.c stable/10/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/eli/g_eli.c ============================================================================== --- stable/10/sys/geom/eli/g_eli.c Tue May 27 14:54:20 2014 (r266748) +++ stable/10/sys/geom/eli/g_eli.c Tue May 27 14:55:09 2014 (r266749) @@ -990,6 +990,7 @@ g_eli_keyfiles_load(struct hmac_ctx *ctx G_ELI_DEBUG(1, "Loaded keyfile %s for %s (type: %s).", file, provider, name); g_eli_crypto_hmac_update(ctx, data, size); + bzero(data, size); } } Modified: stable/10/sys/geom/eli/g_eli_crypto.c ============================================================================== --- stable/10/sys/geom/eli/g_eli_crypto.c Tue May 27 14:54:20 2014 (r266748) +++ stable/10/sys/geom/eli/g_eli_crypto.c Tue May 27 14:55:09 2014 (r266749) @@ -289,10 +289,12 @@ g_eli_crypto_hmac_final(struct hmac_ctx bzero(ctx, sizeof(*ctx)); SHA512_Update(&lctx, digest, sizeof(digest)); SHA512_Final(digest, &lctx); + bzero(&lctx, sizeof(lctx)); /* mdsize == 0 means "Give me the whole hash!" */ if (mdsize == 0) mdsize = SHA512_MDLEN; bcopy(digest, md, mdsize); + bzero(digest, sizeof(digest)); } void From owner-svn-src-stable-10@FreeBSD.ORG Tue May 27 15:30:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B5ED2A4F; Tue, 27 May 2014 15:30: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 A148125D7; Tue, 27 May 2014 15:30: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 s4RFUPZ1068383; Tue, 27 May 2014 15:30:25 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RFUOKU068374; Tue, 27 May 2014 15:30:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405271530.s4RFUOKU068374@svn.freebsd.org> From: Ian Lepore Date: Tue, 27 May 2014 15:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266751 - in stable/10/sys: arm/conf arm/ti arm/ti/omap4 boot/fdt/dts/arm dev/sdhci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 15:30:25 -0000 Author: ian Date: Tue May 27 15:30:24 2014 New Revision: 266751 URL: http://svnweb.freebsd.org/changeset/base/266751 Log: MFC r264096, r264097, r264099 r264100, r264101, r264102, r264119: Fixes to the ti_sdhci and sdhci drivers (fix clock divisor calcs). Use the ti_sdhci driver instead of ti_mmchs for Pandaboard. Modified: stable/10/sys/arm/conf/PANDABOARD stable/10/sys/arm/ti/omap4/files.omap4 stable/10/sys/arm/ti/ti_sdhci.c stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts stable/10/sys/boot/fdt/dts/arm/pandaboard.dts stable/10/sys/dev/sdhci/sdhci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/PANDABOARD ============================================================================== --- stable/10/sys/arm/conf/PANDABOARD Tue May 27 15:30:06 2014 (r266750) +++ stable/10/sys/arm/conf/PANDABOARD Tue May 27 15:30:24 2014 (r266751) @@ -76,6 +76,7 @@ options PREEMPTION # MMC/SD/SDIO Card slot support device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards +device sdhci # mmc/sd host controller # I2C support device iicbus Modified: stable/10/sys/arm/ti/omap4/files.omap4 ============================================================================== --- stable/10/sys/arm/ti/omap4/files.omap4 Tue May 27 15:30:06 2014 (r266750) +++ stable/10/sys/arm/ti/omap4/files.omap4 Tue May 27 15:30:24 2014 (r266751) @@ -6,7 +6,8 @@ arm/ti/ti_smc.S standard arm/ti/usb/omap_ehci.c optional usb ehci arm/ti/ti_sdma.c optional ti_sdma -arm/ti/ti_mmchs.c optional mmc +arm/ti/ti_sdhci.c optional sdhci +#arm/ti/ti_mmchs.c optional mmc arm/ti/omap4/omap4_l2cache.c optional pl310 arm/ti/omap4/omap4_prcm_clks.c standard Modified: stable/10/sys/arm/ti/ti_sdhci.c ============================================================================== --- stable/10/sys/arm/ti/ti_sdhci.c Tue May 27 15:30:06 2014 (r266750) +++ stable/10/sys/arm/ti/ti_sdhci.c Tue May 27 15:30:24 2014 (r266751) @@ -72,6 +72,8 @@ struct ti_sdhci_softc { uint32_t wp_gpio_pin; uint32_t cmd_and_mode; uint32_t sdhci_clkdiv; + boolean_t disable_highspeed; + boolean_t force_card_present; }; /* @@ -105,9 +107,13 @@ static struct ofw_compat_data compat_dat #define MMCHS_SYSCONFIG 0x010 #define MMCHS_SYSCONFIG_RESET (1 << 1) #define MMCHS_SYSSTATUS 0x014 +#define MMCHS_SYSSTATUS_RESETDONE (1 << 0) #define MMCHS_CON 0x02C #define MMCHS_CON_DW8 (1 << 5) #define MMCHS_CON_DVAL_8_4MS (3 << 9) +#define MMCHS_SYSCTL 0x12C +#define MMCHS_SYSCTL_CLKD_MASK 0x3FF +#define MMCHS_SYSCTL_CLKD_SHIFT 6 #define MMCHS_SD_CAPA 0x140 #define MMCHS_SD_CAPA_VS18 (1 << 26) #define MMCHS_SD_CAPA_VS30 (1 << 25) @@ -161,19 +167,22 @@ ti_sdhci_read_2(device_t dev, struct sdh * but doesn't split them into low:high fields. Instead they're a * single number in the range 0..1023 and the number is exactly the * clock divisor (with 0 and 1 both meaning divide by 1). The SDHCI - * driver code expects a v2.0 divisor (value N is power of two in the - * range 0..128 and clock is divided by 2N). The shifting and masking + * driver code expects a v2.0 or v3.0 divisor. The shifting and masking * here extracts the MMCHS representation from the hardware word, cleans - * those bits out, applies the 2N adjustment, and plugs that into the - * bit positions for the 2.0 divisor in the returned register value. The - * ti_sdhci_write_2() routine performs the opposite transformation when - * the SDHCI driver writes to the register. + * those bits out, applies the 2N adjustment, and plugs the result into + * the bit positions for the 2.0 or 3.0 divisor in the returned register + * value. The ti_sdhci_write_2() routine performs the opposite + * transformation when the SDHCI driver writes to the register. */ if (off == SDHCI_CLOCK_CONTROL) { val32 = RD4(sc, SDHCI_CLOCK_CONTROL); - clkdiv = (val32 >> SDHCI_DIVIDER_HI_SHIFT) & 0xff; - val32 &= ~(0xff << SDHCI_DIVIDER_HI_SHIFT); - val32 |= (clkdiv / 2) << SDHCI_DIVIDER_SHIFT; + clkdiv = ((val32 >> MMCHS_SYSCTL_CLKD_SHIFT) & + MMCHS_SYSCTL_CLKD_MASK) / 2; + val32 &= ~(MMCHS_SYSCTL_CLKD_MASK << MMCHS_SYSCTL_CLKD_SHIFT); + val32 |= (clkdiv & SDHCI_DIVIDER_MASK) << SDHCI_DIVIDER_SHIFT; + if (slot->version >= SDHCI_SPEC_300) + val32 |= ((clkdiv >> SDHCI_DIVIDER_MASK_LEN) & + SDHCI_DIVIDER_HI_MASK) << SDHCI_DIVIDER_HI_SHIFT; return (val32 & 0xffff); } @@ -193,8 +202,24 @@ static uint32_t ti_sdhci_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct ti_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32; + + val32 = RD4(sc, off); + + /* + * If we need to disallow highspeed mode due to the OMAP4 erratum, strip + * that flag from the returned capabilities. + */ + if (off == SDHCI_CAPABILITIES && sc->disable_highspeed) + val32 &= ~SDHCI_CAN_DO_HISPD; + + /* + * Force the card-present state if necessary. + */ + if (off == SDHCI_PRESENT_STATE && sc->force_card_present) + val32 |= SDHCI_CARD_PRESENT; - return (RD4(sc, off)); + return (val32); } static void @@ -228,15 +253,23 @@ ti_sdhci_write_2(device_t dev, struct sd uint32_t clkdiv, val32; /* - * Translate between the hardware and SDHCI 2.0 representations of the - * clock divisor. See the comments in ti_sdhci_read_2() for details. + * Translate between the hardware and SDHCI 2.0 or 3.0 representations + * of the clock divisor. See the comments in ti_sdhci_read_2() for + * details. */ if (off == SDHCI_CLOCK_CONTROL) { clkdiv = (val >> SDHCI_DIVIDER_SHIFT) & SDHCI_DIVIDER_MASK; + if (slot->version >= SDHCI_SPEC_300) + clkdiv |= ((val >> SDHCI_DIVIDER_HI_SHIFT) & + SDHCI_DIVIDER_HI_MASK) << SDHCI_DIVIDER_MASK_LEN; + clkdiv *= 2; + if (clkdiv > MMCHS_SYSCTL_CLKD_MASK) + clkdiv = MMCHS_SYSCTL_CLKD_MASK; val32 = RD4(sc, SDHCI_CLOCK_CONTROL); val32 &= 0xffff0000; - val32 |= val & ~(SDHCI_DIVIDER_MASK << SDHCI_DIVIDER_SHIFT); - val32 |= (clkdiv * 2) << SDHCI_DIVIDER_HI_SHIFT; + val32 |= val & ~(MMCHS_SYSCTL_CLKD_MASK << + MMCHS_SYSCTL_CLKD_SHIFT); + val32 |= clkdiv << MMCHS_SYSCTL_CLKD_SHIFT; WR4(sc, SDHCI_CLOCK_CONTROL, val32); return; } @@ -358,7 +391,7 @@ ti_sdhci_hw_init(device_t dev) /* Issue a softreset to the controller */ ti_mmchs_write_4(sc, MMCHS_SYSCONFIG, MMCHS_SYSCONFIG_RESET); timeout = 1000; - while ((ti_mmchs_read_4(sc, MMCHS_SYSSTATUS) & MMCHS_SYSCONFIG_RESET)) { + while (!(ti_mmchs_read_4(sc, MMCHS_SYSSTATUS) & MMCHS_SYSSTATUS_RESETDONE)) { if (--timeout == 0) { device_printf(dev, "Error: Controller reset operation timed out\n"); break; @@ -458,12 +491,14 @@ ti_sdhci_attach(device_t dev) /* * Set the offset from the device's memory start to the MMCHS registers. + * Also for OMAP4 disable high speed mode due to erratum ID i626. */ if (ti_chip() == CHIP_OMAP_3) sc->mmchs_reg_off = OMAP3_MMCHS_REG_OFFSET; - else if (ti_chip() == CHIP_OMAP_4) + else if (ti_chip() == CHIP_OMAP_4) { sc->mmchs_reg_off = OMAP4_MMCHS_REG_OFFSET; - else if (ti_chip() == CHIP_AM335X) + sc->disable_highspeed = true; + } else if (ti_chip() == CHIP_AM335X) sc->mmchs_reg_off = AM335X_MMCHS_REG_OFFSET; else panic("Unknown OMAP device\n"); @@ -560,6 +595,14 @@ ti_sdhci_attach(device_t dev) } } + /* + * If the slot is flagged with the non-removable property, set our flag + * to always force the SDHCI_CARD_PRESENT bit on. + */ + node = ofw_bus_get_node(dev); + if (OF_hasprop(node, "non-removable")) + sc->force_card_present = true; + bus_generic_probe(dev); bus_generic_attach(dev); Modified: stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts Tue May 27 15:30:06 2014 (r266750) +++ stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts Tue May 27 15:30:24 2014 (r266751) @@ -142,6 +142,7 @@ mmchs1@481D8000 { bus-width = <8>; status = "okay"; + non-removable; }; Modified: stable/10/sys/boot/fdt/dts/arm/pandaboard.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/pandaboard.dts Tue May 27 15:30:06 2014 (r266750) +++ stable/10/sys/boot/fdt/dts/arm/pandaboard.dts Tue May 27 15:30:24 2014 (r266751) @@ -174,6 +174,7 @@ interrupts = <115>; interrupt-parent = <&GIC>; mmchs-device-id = <1>; + non-removable; /* XXX need real solution */ }; }; Modified: stable/10/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.c Tue May 27 15:30:06 2014 (r266750) +++ stable/10/sys/dev/sdhci/sdhci.c Tue May 27 15:30:24 2014 (r266751) @@ -235,7 +235,8 @@ sdhci_set_clock(struct sdhci_slot *slot, slot->clock = clock; /* Turn off the clock. */ - WR2(slot, SDHCI_CLOCK_CONTROL, 0); + clk = RD2(slot, SDHCI_CLOCK_CONTROL); + WR2(slot, SDHCI_CLOCK_CONTROL, clk & ~SDHCI_CLOCK_CARD_EN); /* If no clock requested - left it so. */ if (clock == 0) return; From owner-svn-src-stable-10@FreeBSD.ORG Tue May 27 16:17:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3BB4BAB3; Tue, 27 May 2014 16: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 27BF62A9A; Tue, 27 May 2014 16: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 s4RGHQLH090470; Tue, 27 May 2014 16:17:26 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RGHPN3090463; Tue, 27 May 2014 16:17:25 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405271617.s4RGHPN3090463@svn.freebsd.org> From: Ian Lepore Date: Tue, 27 May 2014 16:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266755 - in stable/10/sys/arm: arm include ti X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 16:17:26 -0000 Author: ian Date: Tue May 27 16:17:25 2014 New Revision: 266755 URL: http://svnweb.freebsd.org/changeset/base/266755 Log: MFC 266621: Eliminte spurious interrupts caused by ARM weak memory ordering. Modified: stable/10/sys/arm/arm/gic.c stable/10/sys/arm/arm/intr.c stable/10/sys/arm/include/intr.h stable/10/sys/arm/ti/aintc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/gic.c ============================================================================== --- stable/10/sys/arm/arm/gic.c Tue May 27 16:13:01 2014 (r266754) +++ stable/10/sys/arm/arm/gic.c Tue May 27 16:17:25 2014 (r266755) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #define GICC_ABPR 0x001C /* v1 ICCABPR */ #define GICC_IIDR 0x00FC /* v1 ICCIIDR*/ +#define GIC_LAST_IPI 15 /* Irqs 0-15 are IPIs. */ + /* First bit is a polarity bit (0 - low, 1 - high) */ #define GICD_ICFGR_POL_LOW (0 << 0) #define GICD_ICFGR_POL_HIGH (1 << 0) @@ -268,6 +270,8 @@ gic_post_filter(void *arg) { uintptr_t irq = (uintptr_t) arg; + if (irq > GIC_LAST_IPI) + arm_irq_memory_barrier(irq); gic_c_write_4(GICC_EOIR, irq); } @@ -284,13 +288,13 @@ arm_get_next_irq(int last_irq) * have this information later. */ - if ((active_irq & 0x3ff) < 16) + if ((active_irq & 0x3ff) <= GIC_LAST_IPI) gic_c_write_4(GICC_EOIR, active_irq); active_irq &= 0x3FF; if (active_irq == 0x3FF) { if (last_irq == -1) - printf("Spurious interrupt detected [0x%08x]\n", active_irq); + printf("Spurious interrupt detected\n"); return -1; } @@ -309,6 +313,8 @@ void arm_unmask_irq(uintptr_t nb) { + if (nb > GIC_LAST_IPI) + arm_irq_memory_barrier(nb); gic_d_write_4(GICD_ISENABLER(nb >> 5), (1UL << (nb & 0x1F))); } Modified: stable/10/sys/arm/arm/intr.c ============================================================================== --- stable/10/sys/arm/arm/intr.c Tue May 27 16:13:01 2014 (r266754) +++ stable/10/sys/arm/arm/intr.c Tue May 27 16:17:25 2014 (r266755) @@ -149,3 +149,67 @@ arm_irq_handler(struct trapframe *frame) } } } + +/* + * arm_irq_memory_barrier() + * + * Ensure all writes to device memory have reached devices before proceeding. + * + * This is intended to be called from the post-filter and post-thread routines + * of an interrupt controller implementation. A peripheral device driver should + * use bus_space_barrier() if it needs to ensure a write has reached the + * hardware for some reason other than clearing interrupt conditions. + * + * The need for this function arises from the ARM weak memory ordering model. + * Writes to locations mapped with the Device attribute bypass any caches, but + * are buffered. Multiple writes to the same device will be observed by that + * device in the order issued by the cpu. Writes to different devices may + * appear at those devices in a different order than issued by the cpu. That + * is, if the cpu writes to device A then device B, the write to device B could + * complete before the write to device A. + * + * Consider a typical device interrupt handler which services the interrupt and + * writes to a device status-acknowledge register to clear the interrupt before + * returning. That write is posted to the L2 controller which "immediately" + * places it in a store buffer and automatically drains that buffer. This can + * be less immediate than you'd think... There may be no free slots in the store + * buffers, so an existing buffer has to be drained first to make room. The + * target bus may be busy with other traffic (such as DMA for various devices), + * delaying the drain of the store buffer for some indeterminate time. While + * all this delay is happening, execution proceeds on the CPU, unwinding its way + * out of the interrupt call stack to the point where the interrupt driver code + * is ready to EOI and unmask the interrupt. The interrupt controller may be + * accessed via a faster bus than the hardware whose handler just ran; the write + * to unmask and EOI the interrupt may complete quickly while the device write + * to ack and clear the interrupt source is still lingering in a store buffer + * waiting for access to a slower bus. With the interrupt unmasked at the + * interrupt controller but still active at the device, as soon as interrupts + * are enabled on the core the device re-interrupts immediately: now you've got + * a spurious interrupt on your hands. + * + * The right way to fix this problem is for every device driver to use the + * proper bus_space_barrier() calls in its interrupt handler. For ARM a single + * barrier call at the end of the handler would work. This would have to be + * done to every driver in the system, not just arm-specific drivers. + * + * Another potential fix is to map all device memory as Strongly-Ordered rather + * than Device memory, which takes the store buffers out of the picture. This + * has a pretty big impact on overall system performance, because each strongly + * ordered memory access causes all L2 store buffers to be drained. + * + * A compromise solution is to have the interrupt controller implementation call + * this function to establish a barrier between writes to the interrupt-source + * device and writes to the interrupt controller device. + * + * This takes the interrupt number as an argument, and currently doesn't use it. + * The plan is that maybe some day there is a way to flag certain interrupts as + * "memory barrier safe" and we can avoid this overhead with them. + */ +void +arm_irq_memory_barrier(uintptr_t irq) +{ + + dsb(); + cpu_l2cache_drain_writebuf(); +} + Modified: stable/10/sys/arm/include/intr.h ============================================================================== --- stable/10/sys/arm/include/intr.h Tue May 27 16:13:01 2014 (r266754) +++ stable/10/sys/arm/include/intr.h Tue May 27 16:17:25 2014 (r266755) @@ -79,6 +79,8 @@ extern void (*arm_post_filter)(void *); extern int (*arm_config_irq)(int irq, enum intr_trigger trig, enum intr_polarity pol); +void arm_irq_memory_barrier(uintptr_t); + void gic_init_secondary(void); #endif /* _MACHINE_INTR_H */ Modified: stable/10/sys/arm/ti/aintc.c ============================================================================== --- stable/10/sys/arm/ti/aintc.c Tue May 27 16:13:01 2014 (r266754) +++ stable/10/sys/arm/ti/aintc.c Tue May 27 16:17:25 2014 (r266755) @@ -180,5 +180,7 @@ arm_mask_irq(uintptr_t nb) void arm_unmask_irq(uintptr_t nb) { + + arm_irq_memory_barrier(nb); aintc_write_4(INTC_MIR_CLEAR(nb >> 5), (1UL << (nb & 0x1F))); } From owner-svn-src-stable-10@FreeBSD.ORG Tue May 27 18:22:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 92264A58; Tue, 27 May 2014 18:22: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 6584E2678; Tue, 27 May 2014 18:22: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 s4RIMrau049082; Tue, 27 May 2014 18:22:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RIMrhl049080; Tue, 27 May 2014 18:22:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405271822.s4RIMrhl049080@svn.freebsd.org> From: Xin LI Date: Tue, 27 May 2014 18:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266758 - in stable/10: . cddl/lib/libzfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 18:22:53 -0000 Author: delphij Date: Tue May 27 18:22:52 2014 New Revision: 266758 URL: http://svnweb.freebsd.org/changeset/base/266758 Log: MFC r266520: Explicitly link libzfs against libavl as it is done in OpenSolaris (4543:12bb2876a62e). Without this, some third party applications may break because the lack of AVL related symbols. FreeBSD base system are not affected because the FreeBSD ZFS command line tools were all linked against libavl and thus hide the underlying issue. PR: bin/183081 Modified: stable/10/Makefile.inc1 stable/10/cddl/lib/libzfs/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue May 27 18:18:41 2014 (r266757) +++ stable/10/Makefile.inc1 Tue May 27 18:22:52 2014 (r266758) @@ -1496,6 +1496,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ + ${_cddl_lib_libavl} \ ${_cddl_lib_libzfs_core} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ @@ -1534,6 +1535,7 @@ lib/libopie__L lib/libtacplus__L: lib/li .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem _cddl_lib_libnvpair= cddl/lib/libnvpair +_cddl_lib_libavl= cddl/lib/libavl _cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib= cddl/lib cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L Modified: stable/10/cddl/lib/libzfs/Makefile ============================================================================== --- stable/10/cddl/lib/libzfs/Makefile Tue May 27 18:18:41 2014 (r266757) +++ stable/10/cddl/lib/libzfs/Makefile Tue May 27 18:22:52 2014 (r266758) @@ -7,8 +7,8 @@ LIB= zfs DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \ - ${LIBZFS_CORE} -LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lzfs_core + ${LIBAVL} ${LIBZFS_CORE} +LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lavl -lzfs_core SRCS= deviceid.c \ fsshare.c \ From owner-svn-src-stable-10@FreeBSD.ORG Wed May 28 06:38:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D395B5BE; Wed, 28 May 2014 06:38: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 C0D3C2178; Wed, 28 May 2014 06:38: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 s4S6cgrn081268; Wed, 28 May 2014 06:38:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S6cgvl081267; Wed, 28 May 2014 06:38:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201405280638.s4S6cgvl081267@svn.freebsd.org> From: Dimitry Andric Date: Wed, 28 May 2014 06:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266789 - stable/10/contrib/llvm/tools/clang/lib/Headers X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 06:38:42 -0000 Author: dim Date: Wed May 28 06:38:42 2014 New Revision: 266789 URL: http://svnweb.freebsd.org/changeset/base/266789 Log: MFC r266674: Pull in r209489 from upstream clang trunk (by Akira Hatanaka): Fix a bug in xmmintrin.h. The last step of _mm_cvtps_pi16 should use _mm_packs_pi32, which is a function that reads two __m64 values and packs four 32-bit values into four 16-bit values. Modified: stable/10/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h Wed May 28 06:17:34 2014 (r266788) +++ stable/10/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h Wed May 28 06:38:42 2014 (r266789) @@ -903,7 +903,7 @@ _mm_cvtps_pi16(__m128 __a) __a = _mm_movehl_ps(__a, __a); __c = _mm_cvtps_pi32(__a); - return _mm_packs_pi16(__b, __c); + return _mm_packs_pi32(__b, __c); } static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) From owner-svn-src-stable-10@FreeBSD.ORG Wed May 28 09:06:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 000168C8; Wed, 28 May 2014 09:06: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 E05002E81; Wed, 28 May 2014 09:06: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 s4S96bAi047839; Wed, 28 May 2014 09:06:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S96bkD047834; Wed, 28 May 2014 09:06:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405280906.s4S96bkD047834@svn.freebsd.org> From: Marius Strobl Date: Wed, 28 May 2014 09:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266794 - in stable/10/sys/dev/hyperv: netvsc storvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 09:06:38 -0000 Author: marius Date: Wed May 28 09:06:36 2014 New Revision: 266794 URL: http://svnweb.freebsd.org/changeset/base/266794 Log: MFC: r264177 Make some unwise casts. On i386 these casts wind up being safe. Rather than disturb the API, go with these casts to shut gcc up. Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed May 28 09:01:35 2014 (r266793) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed May 28 09:06:36 2014 (r266794) @@ -24,6 +24,8 @@ * 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$ */ /** @@ -179,7 +181,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct /* Send the gpadl notification request */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) { @@ -277,7 +279,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru /* Send the gpadl notification request */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) { @@ -331,7 +333,7 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ ret = hv_vmbus_channel_send_packet(net_dev->dev->channel, revoke_pkt, sizeof(nvsp_msg), - (uint64_t)revoke_pkt, + (uint64_t)(uintptr_t)revoke_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); /* @@ -399,7 +401,7 @@ hv_nv_destroy_send_buffer(netvsc_dev *ne ret = hv_vmbus_channel_send_packet(net_dev->dev->channel, revoke_pkt, sizeof(nvsp_msg), - (uint64_t)revoke_pkt, + (uint64_t)(uintptr_t)revoke_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); /* * If we failed here, we might as well return and have a leak @@ -461,7 +463,7 @@ hv_nv_negotiate_nvsp_protocol(struct hv_ /* Send the init request */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) @@ -505,7 +507,7 @@ hv_nv_send_ndis_config(struct hv_device /* Send the configuration packet */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); if (ret != 0) return (-EINVAL); @@ -577,7 +579,7 @@ hv_nv_connect_to_vsp(struct hv_device *d /* Send the init request */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); if (ret != 0) { goto cleanup; @@ -827,10 +829,10 @@ hv_nv_on_send(struct hv_device *device, if (pkt->page_buf_count) { ret = hv_vmbus_channel_send_packet_pagebuffer(device->channel, pkt->page_buffers, pkt->page_buf_count, - &send_msg, sizeof(nvsp_msg), (uint64_t)pkt); + &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt); } else { ret = hv_vmbus_channel_send_packet(device->channel, - &send_msg, sizeof(nvsp_msg), (uint64_t)pkt, + &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); } Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed May 28 09:01:35 2014 (r266793) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed May 28 09:06:36 2014 (r266794) @@ -344,7 +344,7 @@ netvsc_xmit_completion(void *context) struct mbuf *mb; uint8_t *buf; - mb = (struct mbuf *)packet->compl.send.send_completion_tid; + mb = (struct mbuf *)(uintptr_t)packet->compl.send.send_completion_tid; buf = ((uint8_t *)packet) - HV_NV_PACKET_OFFSET_IN_BUF; free(buf, M_DEVBUF); @@ -494,7 +494,7 @@ retry_send: /* Set the completion routine */ packet->compl.send.on_send_completion = netvsc_xmit_completion; packet->compl.send.send_completion_context = packet; - packet->compl.send.send_completion_tid = (uint64_t)m_head; + packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)m_head; /* Removed critical_enter(), does not appear necessary */ ret = hv_rf_on_send(device_ctx, packet); @@ -682,7 +682,7 @@ netvsc_recv(struct hv_device *device_ctx */ for (i=0; i < packet->page_buf_count; i++) { /* Shift virtual page number to form virtual page address */ - uint8_t *vaddr = (uint8_t *) + uint8_t *vaddr = (uint8_t *)(uintptr_t) (packet->page_buffers[i].pfn << PAGE_SHIFT); hv_m_append(m_new, packet->page_buffers[i].length, Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed May 28 09:01:35 2014 (r266793) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed May 28 09:06:36 2014 (r266794) @@ -26,6 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -334,7 +337,7 @@ hv_rf_on_receive(struct hv_device *devic return (EINVAL); /* Shift virtual page number to form virtual page address */ - rndis_hdr = (rndis_msg *)(pkt->page_buffers[0].pfn << PAGE_SHIFT); + rndis_hdr = (rndis_msg *)(uintptr_t)(pkt->page_buffers[0].pfn << PAGE_SHIFT); rndis_hdr = (void *)((unsigned long)rndis_hdr + pkt->page_buffers[0].offset); Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed May 28 09:01:35 2014 (r266793) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed May 28 09:06:36 2014 (r266794) @@ -296,7 +296,7 @@ hv_storvsc_channel_init(struct hv_device dev->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request, + (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -330,7 +330,7 @@ hv_storvsc_channel_init(struct hv_device dev->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request, + (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -361,7 +361,7 @@ hv_storvsc_channel_init(struct hv_device dev->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request, + (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -389,7 +389,7 @@ hv_storvsc_channel_init(struct hv_device dev->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request, + (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -482,7 +482,7 @@ hv_storvsc_host_reset(struct hv_device * ret = hv_vmbus_channel_send_packet(dev->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)&sc->hs_reset_req, + (uint64_t)(uintptr_t)&sc->hs_reset_req, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -547,14 +547,14 @@ hv_storvsc_io_request(struct hv_device * &request->data_buf, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request); + (uint64_t)(uintptr_t)request); } else { ret = hv_vmbus_channel_send_packet( device->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request, + (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); } @@ -634,7 +634,7 @@ hv_storvsc_on_channel_callback(void *con &request_id); while ((ret == 0) && (bytes_recvd > 0)) { - request = (struct hv_storvsc_request *)request_id; + request = (struct hv_storvsc_request *)(uintptr_t)request_id; KASSERT(request, ("request")); if ((request == &sc->hs_init_req) || From owner-svn-src-stable-10@FreeBSD.ORG Wed May 28 15:02:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 74F32431; Wed, 28 May 2014 15:02: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 61CBC206F; Wed, 28 May 2014 15:02:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SF2hqm009711; Wed, 28 May 2014 15:02:43 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SF2hli009710; Wed, 28 May 2014 15:02:43 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201405281502.s4SF2hli009710@svn.freebsd.org> From: Dmitry Morozovsky Date: Wed, 28 May 2014 15:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266809 - stable/10/sbin/geom/class/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 15:02:43 -0000 Author: marck (doc committer) Date: Wed May 28 15:02:42 2014 New Revision: 266809 URL: http://svnweb.freebsd.org/changeset/base/266809 Log: MFC: r266483 Document VMware-related filesystems additions. Reviewed by: jmg Modified: stable/10/sbin/geom/class/part/gpart.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/10/sbin/geom/class/part/gpart.8 Wed May 28 14:26:46 2014 (r266808) +++ stable/10/sbin/geom/class/part/gpart.8 Wed May 28 15:02:42 2014 (r266809) @@ -657,6 +657,30 @@ A partition that contains a NTFS or exFA The scheme-specific type is .Qq Li "!7" for MBR. +.It Cm vmware-vmfs +A partition that contains a VMware File System (VMFS). +The scheme-specific types are +.Qq Li "!251" +for MBR and +.Qq Li "!aa31e02a-400f-11db-9590-000c2911d1b8" +for GPT. +.It Cm vmware-vmkdiag +A partition that contains a VMware diagostic filesystem. +The scheme-specific types are +.Qq Li "!252" +for MBR and +.Qq Li "!9d275380-40ad-11db-bf97-000c2911d1b8" +for GPT. +.It Cm vmware-reserved +A VMware reserved partition. +The scheme-specific type is +.Qq Li "!9198effc-31c0-11db-8f-78-000c2911d1b8" +for GPT. +.It Cm vmware-vsanhdr +A partition claimed by VMware VSAN. +The scheme-specific type is +.Qq Li "!381cfccc-7288-11e0-92ee-000c2911d0b2" +for GPT. .El .Sh ATTRIBUTES The scheme-specific attributes for EBR: From owner-svn-src-stable-10@FreeBSD.ORG Wed May 28 18:51:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 619458D5; Wed, 28 May 2014 18:51: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 4E93F26F9; Wed, 28 May 2014 18:51: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 s4SIpoim011447; Wed, 28 May 2014 18:51:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SIpoP2011446; Wed, 28 May 2014 18:51:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405281851.s4SIpoP2011446@svn.freebsd.org> From: Xin LI Date: Wed, 28 May 2014 18:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266816 - stable/10/secure/lib/libcrypt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 18:51:50 -0000 Author: delphij Date: Wed May 28 18:51:49 2014 New Revision: 266816 URL: http://svnweb.freebsd.org/changeset/base/266816 Log: MFC r265995: Switch using the new $2b$ format by default, when bcrypt is used. Relnotes: default Blowfish crypt(3) format have been changed to $2b$. Modified: stable/10/secure/lib/libcrypt/crypt-blowfish.c Directory Properties: stable/10/ (props changed) Modified: stable/10/secure/lib/libcrypt/crypt-blowfish.c ============================================================================== --- stable/10/secure/lib/libcrypt/crypt-blowfish.c Wed May 28 17:44:37 2014 (r266815) +++ stable/10/secure/lib/libcrypt/crypt-blowfish.c Wed May 28 18:51:49 2014 (r266816) @@ -149,7 +149,7 @@ crypt_blowfish(const char *key, const ch char arounds[3]; /* Defaults */ - minr = 'a'; + minr = 'b'; logr = BCRYPT_MINLOGROUNDS; rounds = 1U << logr; From owner-svn-src-stable-10@FreeBSD.ORG Thu May 29 02:55:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 098A537A; Thu, 29 May 2014 02:55: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 E9790206B; Thu, 29 May 2014 02:55:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4T2t8YR022611; Thu, 29 May 2014 02:55:08 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4T2t73P022605; Thu, 29 May 2014 02:55:07 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201405290255.s4T2t73P022605@svn.freebsd.org> From: Cy Schubert Date: Thu, 29 May 2014 02:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266829 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 02:55:09 -0000 Author: cy Date: Thu May 29 02:55:07 2014 New Revision: 266829 URL: http://svnweb.freebsd.org/changeset/base/266829 Log: MFC r264235: Implement the final missing sysctls by moving ipf_auth_softc_t from ip_auth.c to ip_auth.h. ip_frag_soft_t moves from ip_frag.c to ip_frag.h. mlfk_ipl.c creates sysctl MIBs that reference control blocks that are dynamically created when IP Filter is loaded. This necessitated creating them on-the-fly rather than statically at compile time. Approved by: glebius (mentor) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_auth.c stable/10/sys/contrib/ipfilter/netinet/ip_auth.h stable/10/sys/contrib/ipfilter/netinet/ip_frag.c stable/10/sys/contrib/ipfilter/netinet/ip_frag.h stable/10/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_auth.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_auth.c Thu May 29 02:26:12 2014 (r266828) +++ stable/10/sys/contrib/ipfilter/netinet/ip_auth.c Thu May 29 02:55:07 2014 (r266829) @@ -131,33 +131,6 @@ static const char rcsid[] = "@(#)$FreeBS #endif - -typedef struct ipf_auth_softc_s { -#if SOLARIS && defined(_KERNEL) - kcondvar_t ipf_auth_wait; -#endif /* SOLARIS */ -#if defined(linux) && defined(_KERNEL) - wait_queue_head_t ipf_auth_next_linux; -#endif - ipfrwlock_t ipf_authlk; - ipfmutex_t ipf_auth_mx; - int ipf_auth_size; - int ipf_auth_used; - int ipf_auth_replies; - int ipf_auth_defaultage; - int ipf_auth_lock; - ipf_authstat_t ipf_auth_stats; - frauth_t *ipf_auth; - mb_t **ipf_auth_pkts; - int ipf_auth_start; - int ipf_auth_end; - int ipf_auth_next; - frauthent_t *ipf_auth_entries; - frentry_t *ipf_auth_ip; - frentry_t *ipf_auth_rules; -} ipf_auth_softc_t; - - static void ipf_auth_deref __P((frauthent_t **)); static void ipf_auth_deref_unlocked __P((ipf_auth_softc_t *, frauthent_t **)); static int ipf_auth_geniter __P((ipf_main_softc_t *, ipftoken_t *, Modified: stable/10/sys/contrib/ipfilter/netinet/ip_auth.h ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_auth.h Thu May 29 02:26:12 2014 (r266828) +++ stable/10/sys/contrib/ipfilter/netinet/ip_auth.h Thu May 29 02:55:07 2014 (r266829) @@ -49,6 +49,24 @@ typedef struct ipf_authstat { frauthent_t *fas_faelist; } ipf_authstat_t; +typedef struct ipf_auth_softc_s { + ipfrwlock_t ipf_authlk; + ipfmutex_t ipf_auth_mx; + int ipf_auth_size; + int ipf_auth_used; + int ipf_auth_replies; + int ipf_auth_defaultage; + int ipf_auth_lock; + ipf_authstat_t ipf_auth_stats; + frauth_t *ipf_auth; + mb_t **ipf_auth_pkts; + int ipf_auth_start; + int ipf_auth_end; + int ipf_auth_next; + frauthent_t *ipf_auth_entries; + frentry_t *ipf_auth_ip; + frentry_t *ipf_auth_rules; +} ipf_auth_softc_t; extern frentry_t *ipf_auth_check __P((fr_info_t *, u_32_t *)); extern void ipf_auth_expire __P((ipf_main_softc_t *)); Modified: stable/10/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_frag.c Thu May 29 02:26:12 2014 (r266828) +++ stable/10/sys/contrib/ipfilter/netinet/ip_frag.c Thu May 29 02:55:07 2014 (r266829) @@ -91,27 +91,6 @@ static const char rcsid[] = "@(#)$FreeBS #endif -typedef struct ipf_frag_softc_s { - ipfrwlock_t ipfr_ipidfrag; - ipfrwlock_t ipfr_frag; - ipfrwlock_t ipfr_natfrag; - int ipfr_size; - int ipfr_ttl; - int ipfr_lock; - int ipfr_inited; - ipfr_t *ipfr_list; - ipfr_t **ipfr_tail; - ipfr_t *ipfr_natlist; - ipfr_t **ipfr_nattail; - ipfr_t *ipfr_ipidlist; - ipfr_t **ipfr_ipidtail; - ipfr_t **ipfr_heads; - ipfr_t **ipfr_nattab; - ipfr_t **ipfr_ipidtab; - ipfrstat_t ipfr_stats; -} ipf_frag_softc_t; - - #ifdef USE_MUTEXES static ipfr_t *ipfr_frag_new __P((ipf_main_softc_t *, ipf_frag_softc_t *, fr_info_t *, u_32_t, ipfr_t **, Modified: stable/10/sys/contrib/ipfilter/netinet/ip_frag.h ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_frag.h Thu May 29 02:26:12 2014 (r266828) +++ stable/10/sys/contrib/ipfilter/netinet/ip_frag.h Thu May 29 02:55:07 2014 (r266829) @@ -70,6 +70,26 @@ typedef struct ipfrstat { struct ipfr **ifs_nattab; } ipfrstat_t; +typedef struct ipf_frag_softc_s { + ipfrwlock_t ipfr_ipidfrag; + ipfrwlock_t ipfr_frag; + ipfrwlock_t ipfr_natfrag; + int ipfr_size; + int ipfr_ttl; + int ipfr_lock; + int ipfr_inited; + ipfr_t *ipfr_list; + ipfr_t **ipfr_tail; + ipfr_t *ipfr_natlist; + ipfr_t **ipfr_nattail; + ipfr_t *ipfr_ipidlist; + ipfr_t **ipfr_ipidtail; + ipfr_t **ipfr_heads; + ipfr_t **ipfr_nattab; + ipfr_t **ipfr_ipidtab; + ipfrstat_t ipfr_stats; +} ipf_frag_softc_t; + #define IPFR_CMPSZ (offsetof(ipfr_t, ipfr_pass) - \ offsetof(ipfr_t, ipfr_ifp)) Modified: stable/10/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/mlfk_ipl.c Thu May 29 02:26:12 2014 (r266828) +++ stable/10/sys/contrib/ipfilter/netinet/mlfk_ipl.c Thu May 29 02:55:07 2014 (r266829) @@ -44,6 +44,8 @@ static dev_t ipf_devs[IPL_LOGSIZE]; static int sysctl_ipf_int ( SYSCTL_HANDLER_ARGS ); static int ipf_modload(void); static int ipf_modunload(void); +static int ipf_fbsd_sysctl_create(ipf_main_softc_t*); +static int ipf_fbsd_sysctl_destroy(ipf_main_softc_t*); #if (__FreeBSD_version >= 500024) # if (__FreeBSD_version >= 502116) @@ -70,59 +72,36 @@ SYSCTL_DECL(_net_inet); #define SYSCTL_IPF(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \ ptr, val, sysctl_ipf_int, "I", descr); +#define SYSCTL_DYN_IPF(parent, nbr, name, access,ptr, val, descr) \ + SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \ + CTLFLAG_DYN|CTLTYPE_INT|access, ptr, val, sysctl_ipf_int, "I", descr) +static struct sysctl_ctx_list ipf_clist; #define CTLFLAG_OFF 0x00800000 /* IPFilter must be disabled */ #define CTLFLAG_RWO (CTLFLAG_RW|CTLFLAG_OFF) SYSCTL_NODE(_net_inet, OID_AUTO, ipf, CTLFLAG_RW, 0, "IPF"); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_flags, CTLFLAG_RW, &ipfmain.ipf_flags, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_pass, CTLFLAG_RW, &ipfmain.ipf_pass, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_active, CTLFLAG_RD, &ipfmain.ipf_active, 0, ""); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_flags, CTLFLAG_RW, &ipfmain.ipf_flags, 0, "IPF flags"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_pass, CTLFLAG_RW, &ipfmain.ipf_pass, 0, "default pass/block"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_active, CTLFLAG_RD, &ipfmain.ipf_active, 0, "IPF is active"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcpidletimeout, CTLFLAG_RWO, - &ipfmain.ipf_tcpidletimeout, 0, ""); + &ipfmain.ipf_tcpidletimeout, 0, "TCP idle timeout in seconds"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcphalfclosed, CTLFLAG_RWO, - &ipfmain.ipf_tcphalfclosed, 0, ""); + &ipfmain.ipf_tcphalfclosed, 0, "timeout for half closed TCP sessions"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcpclosewait, CTLFLAG_RWO, - &ipfmain.ipf_tcpclosewait, 0, ""); + &ipfmain.ipf_tcpclosewait, 0, "timeout for TCP sessions in closewait status"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcplastack, CTLFLAG_RWO, - &ipfmain.ipf_tcplastack, 0, ""); + &ipfmain.ipf_tcplastack, 0, "timeout for TCP sessions in last ack status"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcptimeout, CTLFLAG_RWO, &ipfmain.ipf_tcptimeout, 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcpclosed, CTLFLAG_RWO, &ipfmain.ipf_tcpclosed, 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_udptimeout, CTLFLAG_RWO, - &ipfmain.ipf_udptimeout, 0, ""); + &ipfmain.ipf_udptimeout, 0, "UDP timeout"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_udpacktimeout, CTLFLAG_RWO, &ipfmain.ipf_udpacktimeout, 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_icmptimeout, CTLFLAG_RWO, - &ipfmain.ipf_icmptimeout, 0, ""); -#if 0 -/* this needs to be resolved at compile time */ -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_defnatage, CTLFLAG_RWO, - &((ipf_nat_softc_t *)ipfmain.ipf_nat_soft)->ipf_nat_defage, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_ipfrttl, CTLFLAG_RW, - &ipf_ipfrttl, 0, ""); -#endif -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_running, CTLFLAG_RD, - &ipfmain.ipf_running, 0, ""); -#if 0 -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_statesize, CTLFLAG_RWO, - &ipfmain.ipf_state_soft)->ipf_state_size, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_statemax, CTLFLAG_RWO, - &(ipfmain.ipf_state_soft)->ipf_state_max, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_nattable_sz, CTLFLAG_RWO, - &(ipfmain.ipf_nat_soft)->ipf_nat_table_sz, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_natrules_sz, CTLFLAG_RWO, - &(ipfmain.ipf_nat_soft)->ipf_nat_maprules_sz, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_rdrrules_sz, CTLFLAG_RWO, - &(ipfmain.ipf_nat_soft)->ipf_nat_rdrrules_sz, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_hostmap_sz, CTLFLAG_RWO, - &(ipfmain.ipf_nat_soft)->ipf_nat_hostmap_sz, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_authsize, CTLFLAG_RWO, - &ipf_auth_size, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_authused, CTLFLAG_RD, - &ipf_auth_used, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_defaultauthage, CTLFLAG_RW, - &ipf_auth_defaultage, 0, ""); -#endif + &ipfmain.ipf_icmptimeout, 0, "ICMP timeout"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_running, CTLFLAG_RD, + &ipfmain.ipf_running, 0, "IPF is running"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &ipfmain.ipf_chksrc, 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &ipfmain.ipf_minttl, 0, ""); @@ -177,7 +156,6 @@ static struct cdevsw ipf_cdevsw = { static char *ipf_devfiles[] = { IPL_NAME, IPNAT_NAME, IPSTATE_NAME, IPAUTH_NAME, IPSYNC_NAME, IPSCAN_NAME, IPLOOKUP_NAME, NULL }; - static int ipfilter_modevent(module_t mod, int type, void *unused) { @@ -212,6 +190,9 @@ ipf_modload() if (ipf_create_all(&ipfmain) == NULL) return EIO; + if (ipf_fbsd_sysctl_create(&ipfmain) != 0) + return EIO; + error = ipfattach(&ipfmain); if (error) return error; @@ -268,6 +249,9 @@ ipf_modunload() if (ipfmain.ipf_refcnt) return EBUSY; + if (ipf_fbsd_sysctl_destroy(&ipfmain) != 0) + return EIO; + error = ipf_pfil_unhook(); if (error != 0) return error; @@ -277,6 +261,7 @@ ipf_modunload() if (error != 0) return error; + ipf_fbsd_sysctl_destroy(&ipfmain); ipf_destroy_all(&ipfmain); ipf_unload_all(); } else @@ -526,3 +511,58 @@ static int ipfwrite(dev, uio) return ipf_sync_write(&ipfmain, uio); return ENXIO; } + +static int +ipf_fbsd_sysctl_create(main_softc) + ipf_main_softc_t *main_softc; +{ + ipf_nat_softc_t *nat_softc; + ipf_state_softc_t *state_softc; + ipf_auth_softc_t *auth_softc; + ipf_frag_softc_t *frag_softc; + + nat_softc = main_softc->ipf_nat_soft; + state_softc = main_softc->ipf_state_soft; + auth_softc = main_softc->ipf_auth_soft; + frag_softc = main_softc->ipf_frag_soft; + + sysctl_ctx_init(&ipf_clist); + + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_defnatage", CTLFLAG_RWO, + &nat_softc->ipf_nat_defage, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_statesize", CTLFLAG_RWO, + &state_softc->ipf_state_size, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_statemax", CTLFLAG_RWO, + &state_softc->ipf_state_max, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "ipf_nattable_max", CTLFLAG_RWO, + &nat_softc->ipf_nat_table_max, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "ipf_nattable_sz", CTLFLAG_RWO, + &nat_softc->ipf_nat_table_sz, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "ipf_natrules_sz", CTLFLAG_RWO, + &nat_softc->ipf_nat_maprules_sz, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "ipf_rdrrules_sz", CTLFLAG_RWO, + &nat_softc->ipf_nat_rdrrules_sz, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "ipf_hostmap_sz", CTLFLAG_RWO, + &nat_softc->ipf_nat_hostmap_sz, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_authsize", CTLFLAG_RWO, + &auth_softc->ipf_auth_size, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_authused", CTLFLAG_RD, + &auth_softc->ipf_auth_used, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_defaultauthage", CTLFLAG_RW, + &auth_softc->ipf_auth_defaultage, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_ipfrttl", CTLFLAG_RW, + &frag_softc->ipfr_ttl, 0, ""); + return 0; +} + +static int +ipf_fbsd_sysctl_destroy(main_softc) + ipf_main_softc_t *main_softc; +{ + if (sysctl_ctx_free(&ipf_clist)) { + printf("sysctl_ctx_free failed"); + return(ENOTEMPTY); + } + return 0; +} + From owner-svn-src-stable-10@FreeBSD.ORG Fri May 30 14:58:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 60C23D44; Fri, 30 May 2014 14:58:07 +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 4CF9D2E6F; Fri, 30 May 2014 14:58:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UEw7bX004734; Fri, 30 May 2014 14:58:07 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UEw71D004733; Fri, 30 May 2014 14:58:07 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201405301458.s4UEw71D004733@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 30 May 2014 14:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266888 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 14:58:07 -0000 Author: gnn Date: Fri May 30 14:58:06 2014 New Revision: 266888 URL: http://svnweb.freebsd.org/changeset/base/266888 Log: MFC: 266171, 266174 Extend the size of the function or symbol that can be annotated. Update the amount of data we can collect for hwpmc(4) by default to work with modern processors and available memory. Modified: stable/10/sys/sys/pmc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/pmc.h ============================================================================== --- stable/10/sys/sys/pmc.h Fri May 30 14:30:52 2014 (r266887) +++ stable/10/sys/sys/pmc.h Fri May 30 14:58:06 2014 (r266888) @@ -597,12 +597,12 @@ struct pmc_op_getdyneventinfo { #include -#define PMC_HASH_SIZE 16 -#define PMC_MTXPOOL_SIZE 32 +#define PMC_HASH_SIZE 1024 +#define PMC_MTXPOOL_SIZE 2048 #define PMC_LOG_BUFFER_SIZE 4 -#define PMC_NLOGBUFFERS 64 -#define PMC_NSAMPLES 512 -#define PMC_CALLCHAIN_DEPTH 8 +#define PMC_NLOGBUFFERS 1024 +#define PMC_NSAMPLES 1024 +#define PMC_CALLCHAIN_DEPTH 16 #define PMC_SYSCTL_NAME_PREFIX "kern." PMC_MODULE_NAME "." From owner-svn-src-stable-10@FreeBSD.ORG Fri May 30 15:00:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D571AFFC; Fri, 30 May 2014 15:00: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 C1C6B2F0A; Fri, 30 May 2014 15:00: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 s4UF0otU008003; Fri, 30 May 2014 15:00:50 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UF0oh3008002; Fri, 30 May 2014 15:00:50 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201405301500.s4UF0oh3008002@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 30 May 2014 15:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266889 - stable/10/usr.sbin/pmcannotate X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 15:00:50 -0000 Author: gnn Date: Fri May 30 15:00:50 2014 New Revision: 266889 URL: http://svnweb.freebsd.org/changeset/base/266889 Log: MFC: 266166 Extend the size of the function or symbol that can be annotated. Modified: stable/10/usr.sbin/pmcannotate/pmcannotate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pmcannotate/pmcannotate.c ============================================================================== --- stable/10/usr.sbin/pmcannotate/pmcannotate.c Fri May 30 14:58:06 2014 (r266888) +++ stable/10/usr.sbin/pmcannotate/pmcannotate.c Fri May 30 15:00:50 2014 (r266889) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); #include -#define FNBUFF 161 -#define LNBUFF 161 +#define FNBUFF 512 +#define LNBUFF 512 #define TMPPATH "/tmp/pmcannotate.XXXXXX" From owner-svn-src-stable-10@FreeBSD.ORG Fri May 30 15:02:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2A77B1E0; Fri, 30 May 2014 15:02: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 165522F24; Fri, 30 May 2014 15:02: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 s4UF2TvO008696; Fri, 30 May 2014 15:02:29 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UF2Tm2008692; Fri, 30 May 2014 15:02:29 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201405301502.s4UF2Tm2008692@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 30 May 2014 15:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266890 - stable/10/usr.sbin/pmcstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 15:02:30 -0000 Author: gnn Date: Fri May 30 15:02:29 2014 New Revision: 266890 URL: http://svnweb.freebsd.org/changeset/base/266890 Log: MFC: 266209 Add a command line argument (-l) to end event collection after some number of seconds. The number of seconds may be a fraction. Submitted by: Julien Charbon Relnotes: yes Modified: stable/10/usr.sbin/pmcstat/pmcstat.8 stable/10/usr.sbin/pmcstat/pmcstat.c stable/10/usr.sbin/pmcstat/pmcstat.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat.8 Fri May 30 15:00:50 2014 (r266889) +++ stable/10/usr.sbin/pmcstat/pmcstat.8 Fri May 30 15:02:29 2014 (r266890) @@ -52,6 +52,7 @@ .Op Fl f Ar pluginopt .Op Fl g .Op Fl k Ar kerneldir +.Op Fl l Ar secs .Op Fl m Ar pathname .Op Fl n Ar rate .Op Fl o Ar outputfile @@ -274,6 +275,13 @@ This directory specifies where should look for the kernel and its modules. The default is .Pa /boot/kernel . +.It Fl l Ar secs +Set system-wide performance measurement duration for +.Ar secs +seconds. +The argument +.Ar secs +may be a fractional value. .It Fl m Ar pathname Print the sampled PCs with the name, the start and ending addresses of the function within they live. Modified: stable/10/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat.c Fri May 30 15:00:50 2014 (r266889) +++ stable/10/usr.sbin/pmcstat/pmcstat.c Fri May 30 15:02:29 2014 (r266890) @@ -509,6 +509,7 @@ pmcstat_show_usage(void) "\t -f spec\t pass \"spec\" to as plugin option\n" "\t -g\t\t produce gprof(1) compatible profiles\n" "\t -k dir\t\t set the path to the kernel\n" + "\t -l secs\t set duration time\n" "\t -m file\t print sampled PCs to \"file\"\n" "\t -n rate\t set sampling rate\n" "\t -o file\t send print output to \"file\"\n" @@ -551,6 +552,7 @@ main(int argc, char **argv) { cpuset_t cpumask; double interval; + double duration; int hcpu, option, npmc, ncpu; int c, check_driver_stats, current_sampling_count; int do_callchain, do_descendants, do_logproccsw, do_logprocexit; @@ -600,6 +602,7 @@ main(int argc, char **argv) args.pa_toptty = 0; args.pa_topcolor = 0; args.pa_mergepmc = 0; + args.pa_duration = 0.0; STAILQ_INIT(&args.pa_events); SLIST_INIT(&args.pa_targets); bzero(&ds_start, sizeof(ds_start)); @@ -618,7 +621,7 @@ main(int argc, char **argv) CPU_SET(hcpu, &cpumask); while ((option = getopt(argc, argv, - "CD:EF:G:M:NO:P:R:S:TWa:c:df:gk:m:n:o:p:qr:s:t:vw:z:")) != -1) + "CD:EF:G:M:NO:P:R:S:TWa:c:df:gk:l:m:n:o:p:qr:s:t:vw:z:")) != -1) switch (option) { case 'a': /* Annotate + callgraph */ args.pa_flags |= FLAG_DO_ANNOTATE; @@ -692,6 +695,15 @@ main(int argc, char **argv) args.pa_flags |= FLAG_HAS_KERNELPATH; break; + case 'l': /* time duration in seconds */ + duration = strtod(optarg, &end); + if (*end != '\0' || duration <= 0) + errx(EX_USAGE, "ERROR: Illegal duration time " + "value \"%s\".", optarg); + args.pa_flags |= FLAG_HAS_DURATION; + args.pa_duration = duration; + break; + case 'm': args.pa_flags |= FLAG_DO_ANNOTATE; args.pa_plugin = PMCSTAT_PL_ANNOTATE; @@ -922,6 +934,12 @@ main(int argc, char **argv) errx(EX_USAGE, "ERROR: options -O and -R are mutually exclusive."); + /* disallow -T and -l together */ + if ((args.pa_flags & FLAG_HAS_DURATION) && + (args.pa_flags & FLAG_DO_TOP)) + errx(EX_USAGE, "ERROR: options -T and -l are mutually " + "exclusive."); + /* -m option is allowed with -R only. */ if (args.pa_flags & FLAG_DO_ANNOTATE && args.pa_inputpath == NULL) errx(EX_USAGE, "ERROR: option %s requires an input file", @@ -1279,6 +1297,20 @@ main(int argc, char **argv) "ERROR: Cannot register kevent for timer"); } + /* + * Setup a duration timer if we have sampling mode PMCs and + * a duration time is set + */ + if ((args.pa_flags & FLAG_HAS_SAMPLING_PMCS) && + (args.pa_flags & FLAG_HAS_DURATION)) { + EV_SET(&kev, 0, EVFILT_TIMER, EV_ADD, 0, + args.pa_duration * 1000, NULL); + + if (kevent(pmcstat_kq, &kev, 1, NULL, 0, NULL) < 0) + err(EX_OSERR, "ERROR: Cannot register kevent for " + "time duration"); + } + /* attach PMCs to the target process, starting it if specified */ if (args.pa_flags & FLAG_HAS_COMMANDLINE) pmcstat_create_process(); @@ -1355,7 +1387,7 @@ main(int argc, char **argv) /* * loop till either the target process (if any) exits, or we - * are killed by a SIGINT. + * are killed by a SIGINT or we reached the time duration. */ runstate = PMCSTAT_RUNNING; do_print = do_read = 0; @@ -1422,7 +1454,13 @@ main(int argc, char **argv) break; - case EVFILT_TIMER: /* print out counting PMCs */ + case EVFILT_TIMER: + /* time duration reached, exit */ + if (args.pa_flags & FLAG_HAS_DURATION) { + runstate = PMCSTAT_FINISHED; + break; + } + /* print out counting PMCs */ if ((args.pa_flags & FLAG_DO_TOP) && pmc_flush_logfile() == 0) do_read = 1; Modified: stable/10/usr.sbin/pmcstat/pmcstat.h ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat.h Fri May 30 15:00:50 2014 (r266889) +++ stable/10/usr.sbin/pmcstat/pmcstat.h Fri May 30 15:02:29 2014 (r266890) @@ -54,6 +54,7 @@ #define FLAG_DO_TOP 0x00010000 /* -T */ #define FLAG_DO_ANALYSIS 0x00020000 /* -g or -G or -m or -T */ #define FLAGS_HAS_CPUMASK 0x00040000 /* -c */ +#define FLAG_HAS_DURATION 0x00080000 /* -l secs */ #define DEFAULT_SAMPLE_COUNT 65536 #define DEFAULT_WAIT_INTERVAL 5.0 @@ -149,6 +150,7 @@ struct pmcstat_args { int pa_toptty; /* output to tty or file */ int pa_topcolor; /* terminal support color */ int pa_mergepmc; /* merge PMC with same name */ + double pa_duration; /* time duration */ int pa_argc; char **pa_argv; STAILQ_HEAD(, pmcstat_ev) pa_events; From owner-svn-src-stable-10@FreeBSD.ORG Sat May 31 00:40:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7E3F9AF; Sat, 31 May 2014 00:40: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 68CE42016; Sat, 31 May 2014 00:40: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 s4V0eFWI074465; Sat, 31 May 2014 00:40:15 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4V0eEhx074454; Sat, 31 May 2014 00:40:14 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201405310040.s4V0eEhx074454@svn.freebsd.org> From: Hiren Panchasara Date: Sat, 31 May 2014 00:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266911 - in stable/10: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 00:40:15 -0000 Author: hiren Date: Sat May 31 00:40:13 2014 New Revision: 266911 URL: http://svnweb.freebsd.org/changeset/base/266911 Log: MFC r263446 Update hwpmc to support core events for Atom Silvermont microarchitecture. (Model 0x4D as per Intel document 330061-001 01/2014) Added: stable/10/lib/libpmc/pmc.atomsilvermont.3 - copied unchanged from r263446, head/lib/libpmc/pmc.atomsilvermont.3 Modified: stable/10/lib/libpmc/Makefile stable/10/lib/libpmc/libpmc.c stable/10/lib/libpmc/pmc.atom.3 stable/10/sys/dev/hwpmc/hwpmc_core.c stable/10/sys/dev/hwpmc/hwpmc_intel.c stable/10/sys/dev/hwpmc/pmc_events.h stable/10/sys/sys/pmc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpmc/Makefile ============================================================================== --- stable/10/lib/libpmc/Makefile Fri May 30 23:37:31 2014 (r266910) +++ stable/10/lib/libpmc/Makefile Sat May 31 00:40:13 2014 (r266911) @@ -24,6 +24,7 @@ MAN+= pmc.soft.3 # PMC-dependent manual pages MAN+= pmc.atom.3 +MAN+= pmc.atomsilvermont.3 MAN+= pmc.core.3 MAN+= pmc.core2.3 MAN+= pmc.corei7.3 Modified: stable/10/lib/libpmc/libpmc.c ============================================================================== --- stable/10/lib/libpmc/libpmc.c Fri May 30 23:37:31 2014 (r266910) +++ stable/10/lib/libpmc/libpmc.c Sat May 31 00:40:13 2014 (r266911) @@ -169,6 +169,11 @@ static const struct pmc_event_descr atom __PMC_EV_ALIAS_ATOM() }; +static const struct pmc_event_descr atom_silvermont_event_table[] = +{ + __PMC_EV_ALIAS_ATOM_SILVERMONT() +}; + static const struct pmc_event_descr core_event_table[] = { __PMC_EV_ALIAS_CORE() @@ -246,6 +251,7 @@ static const struct pmc_event_descr west } PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); +PMC_MDEP_TABLE(atom_silvermont, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); @@ -288,6 +294,7 @@ static const struct pmc_class_descr NAME #if defined(__i386__) || defined(__amd64__) PMC_CLASS_TABLE_DESC(iaf, IAF, iaf, iaf); PMC_CLASS_TABLE_DESC(atom, IAP, atom, iap); +PMC_CLASS_TABLE_DESC(atom_silvermont, IAP, atom_silvermont, iap); PMC_CLASS_TABLE_DESC(core, IAP, core, iap); PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); @@ -597,6 +604,8 @@ static struct pmc_event_alias core2_alia #define atom_aliases core2_aliases #define atom_aliases_without_iaf core2_aliases_without_iaf +#define atom_silvermont_aliases core2_aliases +#define atom_silvermont_aliases_without_iaf core2_aliases_without_iaf #define corei7_aliases core2_aliases #define corei7_aliases_without_iaf core2_aliases_without_iaf #define haswell_aliases core2_aliases @@ -842,6 +851,7 @@ iap_allocate_pmc(enum pmc_event pe, char if (n != 1) return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_ATOM || + cpu_info.pm_cputype == PMC_CPU_INTEL_ATOM_SILVERMONT || cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2 || cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2EXTREME) { if (KWPREFIXMATCH(p, IAP_KW_SNOOPRESPONSE "=")) { @@ -2733,6 +2743,10 @@ pmc_event_names_of_class(enum pmc_class ev = atom_event_table; count = PMC_EVENT_TABLE_SIZE(atom); break; + case PMC_CPU_INTEL_ATOM_SILVERMONT: + ev = atom_silvermont_event_table; + count = PMC_EVENT_TABLE_SIZE(atom_silvermont); + break; case PMC_CPU_INTEL_CORE: ev = core_event_table; count = PMC_EVENT_TABLE_SIZE(core); @@ -3049,6 +3063,9 @@ pmc_init(void) case PMC_CPU_INTEL_ATOM: PMC_MDEP_INIT_INTEL_V2(atom); break; + case PMC_CPU_INTEL_ATOM_SILVERMONT: + PMC_MDEP_INIT_INTEL_V2(atom_silvermont); + break; case PMC_CPU_INTEL_CORE: PMC_MDEP_INIT(core); pmc_class_table[n] = &core_class_table_descr; @@ -3202,6 +3219,11 @@ _pmc_name_of_event(enum pmc_event pe, en ev = atom_event_table; evfence = atom_event_table + PMC_EVENT_TABLE_SIZE(atom); break; + case PMC_CPU_INTEL_ATOM_SILVERMONT: + ev = atom_silvermont_event_table; + evfence = atom_silvermont_event_table + + PMC_EVENT_TABLE_SIZE(atom_silvermont); + break; case PMC_CPU_INTEL_CORE: ev = core_event_table; evfence = core_event_table + PMC_EVENT_TABLE_SIZE(core); Modified: stable/10/lib/libpmc/pmc.atom.3 ============================================================================== --- stable/10/lib/libpmc/pmc.atom.3 Fri May 30 23:37:31 2014 (r266910) +++ stable/10/lib/libpmc/pmc.atom.3 Sat May 31 00:40:13 2014 (r266911) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2008 +.Dd March 20, 2014 .Dt PMC.ATOM 3 .Os .Sh NAME @@ -1168,6 +1168,7 @@ and the underlying hardware events used .El .Sh SEE ALSO .Xr pmc 3 , +.Xr pmc.atomsilvermont 3 , .Xr pmc.core 3 , .Xr pmc.core2 3 , .Xr pmc.iaf 3 , Copied: stable/10/lib/libpmc/pmc.atomsilvermont.3 (from r263446, head/lib/libpmc/pmc.atomsilvermont.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libpmc/pmc.atomsilvermont.3 Sat May 31 00:40:13 2014 (r266911, copy of r263446, head/lib/libpmc/pmc.atomsilvermont.3) @@ -0,0 +1,535 @@ +.\" Copyright (c) 2014 Hiren Panchasara +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 20, 2014 +.Dt PMC.ATOMSILVERMONT 3 +.Os +.Sh NAME +.Nm pmc.atomsilvermont +.Nd measurement events for +.Tn Intel +.Tn Atom Silvermont +family CPUs +.Sh LIBRARY +.Lb libpmc +.Sh SYNOPSIS +.In pmc.h +.Sh DESCRIPTION +.Tn Intel +.Tn Atom Silvermont +CPUs contain PMCs conforming to version 3 of the +.Tn Intel +performance measurement architecture. +These CPUs contains two classes of PMCs: +.Bl -tag -width "Li PMC_CLASS_IAP" +.It Li PMC_CLASS_IAF +Fixed-function counters that count only one hardware event per counter. +.It Li PMC_CLASS_IAP +Programmable counters that may be configured to count one of a defined +set of hardware events. +.El +.Pp +The number of PMCs available in each class and their widths need to be +determined at run time by calling +.Xr pmc_cpuinfo 3 . +.Pp +Intel Atom Silvermont PMCs are documented in +.Rs +.%B "Intel 64 and IA-32 Intel(R) Architecture Software Developer's Manual" +.%T "Combined Volumes" +.%N "Order Number 325462-050US" +.%D February 2014 +.%Q "Intel Corporation" +.Re +.Ss ATOM SILVERMONT FIXED FUNCTION PMCS +These PMCs and their supported events are documented in +.Xr pmc.iaf 3 . +.Ss ATOM SILVERMONT PROGRAMMABLE PMCS +The programmable PMCs support the following capabilities: +.Bl -column "PMC_CAP_INTERRUPT" "Support" +.It Em Capability Ta Em Support +.It PMC_CAP_CASCADE Ta \&No +.It PMC_CAP_EDGE Ta Yes +.It PMC_CAP_INTERRUPT Ta Yes +.It PMC_CAP_INVERT Ta Yes +.It PMC_CAP_READ Ta Yes +.It PMC_CAP_PRECISE Ta \&No +.It PMC_CAP_SYSTEM Ta Yes +.It PMC_CAP_TAGGING Ta \&No +.It PMC_CAP_THRESHOLD Ta Yes +.It PMC_CAP_USER Ta Yes +.It PMC_CAP_WRITE Ta Yes +.El +.Ss Event Qualifiers +Event specifiers for these PMCs support the following common +qualifiers: +.Bl -tag -width indent +.It Li any +Count matching events seen on any logical processor in a package. +.It Li cmask= Ns Ar value +Configure the PMC to increment only if the number of configured +events measured in a cycle is greater than or equal to +.Ar value . +.It Li edge +Configure the PMC to count the number of de-asserted to asserted +transitions of the conditions expressed by the other qualifiers. +If specified, the counter will increment only once whenever a +condition becomes true, irrespective of the number of clocks during +which the condition remains true. +.It Li inv +Invert the sense of comparison when the +.Dq Li cmask +qualifier is present, making the counter increment when the number of +events per cycle is less than the value specified by the +.Dq Li cmask +qualifier. +.It Li os +Configure the PMC to count events happening at processor privilege +level 0. +.It Li usr +Configure the PMC to count events occurring at privilege levels 1, 2 +or 3. +.El +.Pp +If neither of the +.Dq Li os +or +.Dq Li usr +qualifiers are specified, the default is to enable both. +.Pp +Events that require core-specificity to be specified use a +additional qualifier +.Dq Li core= Ns Ar core , +where argument +.Ar core +is one of: +.Bl -tag -width indent +.It Li all +Measure event conditions on all cores. +.It Li this +Measure event conditions on this core. +.El +.Pp +The default is +.Dq Li this . +.Pp +Events that require an agent qualifier to be specified use an +additional qualifier +.Dq Li agent= Ns agent , +where argument +.Ar agent +is one of: +.Bl -tag -width indent +.It Li this +Measure events associated with this bus agent. +.It Li any +Measure events caused by any bus agent. +.El +.Pp +The default is +.Dq Li this . +.Pp +Events that require a hardware prefetch qualifier to be specified use an +additional qualifier +.Dq Li prefetch= Ns Ar prefetch , +where argument +.Ar prefetch +is one of: +.Bl -tag -width "exclude" +.It Li both +Include all prefetches. +.It Li only +Only count hardware prefetches. +.It Li exclude +Exclude hardware prefetches. +.El +.Pp +The default is +.Dq Li both . +.Pp +Events that require a cache coherence qualifier to be specified use an +additional qualifier +.Dq Li cachestate= Ns Ar state , +where argument +.Ar state +contains one or more of the following letters: +.Bl -tag -width indent +.It Li e +Count cache lines in the exclusive state. +.It Li i +Count cache lines in the invalid state. +.It Li m +Count cache lines in the modified state. +.It Li s +Count cache lines in the shared state. +.El +.Pp +The default is +.Dq Li eims . +.Pp +Events that require a snoop response qualifier to be specified use an +additional qualifier +.Dq Li snoopresponse= Ns Ar response , +where argument +.Ar response +comprises of the following keywords separated by +.Dq + +signs: +.Bl -tag -width indent +.It Li clean +Measure CLEAN responses. +.It Li hit +Measure HIT responses. +.It Li hitm +Measure HITM responses. +.El +.Pp +The default is to measure all the above responses. +.Pp +Events that require a snoop type qualifier use an additional qualifier +.Dq Li snooptype= Ns Ar type , +where argument +.Ar type +comprises the one of the following keywords: +.Bl -tag -width indent +.It Li cmp2i +Measure CMP2I snoops. +.It Li cmp2s +Measure CMP2S snoops. +.El +.Pp +The default is to measure both snoops. +.Ss Event Specifiers (Programmable PMCs) +Atom Silvermont programmable PMCs support the following events: +.Bl -tag -width indent +.It Li REHABQ.LD_BLOCK_ST_FORWARD +.Pq Event 03H , Umask 01H +The number of retired loads that were +prohibited from receiving forwarded data from the store +because of address mismatch. +.It Li REHABQ.LD_BLOCK_STD_NOTREADY +.Pq Event 03H , Umask 02H +The cases where a forward was technically possible, +but did not occur because the store data was not available +at the right time. +.It Li REHABQ.ST_SPLITS +.Pq Event 03H , Umask 04H +The number of retire stores that experienced. +cache line boundary splits. +.It Li REHABQ.LD_SPLITS +.Pq Event 03H , Umask 08H +The number of retire loads that experienced. +cache line boundary splits. +.It Li REHABQ.LOCK +.Pq Event 03H , Umask 10H +The number of retired memory operations with lock semantics. +These are either implicit locked instructions such as the +XCHG instruction or instructions with an explicit LOCK +prefix (0xF0). +.It Li REHABQ.STA_FULL +.Pq Event 03H , Umask 20H +The number of retired stores that are delayed +because there is not a store address buffer available. +.It Li REHABQ.ANY_LD +.Pq Event 03H , Umask 40H +The number of load uops reissued from Rehabq. +.It Li REHABQ.ANY_ST +.Pq Event 03H , Umask 80H +The number of store uops reissued from Rehabq. +.It Li MEM_UOPS_RETIRED.L1_MISS_LOADS +.Pq Event 04H , Umask 01H +The number of load ops retired that miss in L1 +Data cache. Note that prefetch misses will not be counted. +.It Li MEM_UOPS_RETIRED.L2_HIT_LOADS +.Pq Event 04H , Umask 02H +The number of load micro-ops retired that hit L2. +.It Li MEM_UOPS_RETIRED.L2_MISS_LOADS +.Pq Event 04H , Umask 04H +The number of load micro-ops retired that missed L2. +.It Li MEM_UOPS_RETIRED.DTLB_MISS_LOADS +.Pq Event 04H , Umask 08H +The number of load ops retired that had DTLB miss. +.It Li MEM_UOPS_RETIRED.UTLB_MISS +.Pq Event 04H , Umask 10H +The number of load ops retired that had UTLB miss. +.It Li MEM_UOPS_RETIRED.HITM +.Pq Event 04H , Umask 20H +The number of load ops retired that got data +from the other core or from the other module. +.It Li MEM_UOPS_RETIRED.ALL_LOADS +.Pq Event 04H , Umask 40H +The number of load ops retired. +.It Li MEM_UOP_RETIRED.ALL_STORES +.Pq Event 04H , Umask 80H +The number of store ops retired. +.It Li PAGE_WALKS.D_SIDE_CYCLES +.Pq Event 05H , Umask 01H +Every cycle when a D-side (walks due to a load) page walk +is in progress. Page walk duration divided by +number of page walks is the average duration of page-walks. +Edge trigger bit must be cleared. Set Edge to count the number +of page walks. +.It Li PAGE_WALKS.I_SIDE_CYCLES +.Pq Event 05H , Umask 02H +Every cycle when a I-side (walks due to an instruction fetch) +page walk is in progress. Page walk duration divided by number +of page walks is the average duration of page-walks. +.It Li PAGE_WALKS.WALKS +.Pq Event 05H , Umask 03H +The number of times a data (D) page walk or an instruction (I) +page walk is completed or started. Since a page walk implies a +TLB miss, the number of TLB misses can be counted by counting +the number of pagewalks. +.It Li LONGEST_LAT_CACHE.MISS +.Pq Event 2EH , Umask 41H +the total number of L2 cache references and +The number of L2 cache misses respectively. +L3 is not supported in Silvermont microarchitecture. +.It Li LONGEST_LAT_CACHE.REFERENCE +.Pq Event 2EH , Umask 4FH +The number of requests originating from the core that +references a cache line in the L2 cache. +L3 is not supported in Silvermont microarchitecture. +.It Li L2_REJECT_XQ.ALL +.Pq Event 30H , Umask 00H +The number of demand and prefetch +transactions that the L2 XQ rejects due to a full or near full +condition which likely indicates back pressure from the IDI link. +The XQ may reject transactions from the L2Q (non-cacheable +requests), BBS (L2 misses) and WOB (L2 write-back victims) +.It Li CORE_REJECT_L2Q.ALL +.Pq Event 31H , Umask 00H +The number of demand and L1 prefetcher +requests rejected by the L2Q due to a full or nearly full +condition which likely indicates back pressure from L2Q. +It also counts requests that would have gone directly to +the XQ, but are rejected due to a full or nearly full condition, +indicating back pressure from the IDI link. The L2Q may also +reject transactions from a core to insure fairness between +cores, or to delay a core's dirty eviction when the address +conflicts incoming external snoops. (Note that L2 prefetcher +requests that are dropped are not counted by this event.). +.It Li CPU_CLK_UNHALTED.CORE_P +.Pq Event 3CH , Umask 00H +The number of core cycles while the core is not in a halt +state. The core enters the halt state when it is running +the HLT instruction. In mobile systems the core frequency +may change from time to time. For this reason this event +may have a changing ratio with regards to time. +.It Li CPU_CLK_UNHALTED.REF_P +.Pq Event 3CH , Umask 01H +The number of reference cycles that the core is not in a halt +state. The core enters the halt state when it is running +the HLT instruction. +In mobile systems the core frequency may change from time. +This event is not affected by core frequency changes but counts +as if the core is running at the maximum frequency all the time. +.It Li ICACHE.HIT +.Pq Event 80H , Umask 01H +The number of instruction fetches from the instruction cache. +.It Li ICACHE.MISSES +.Pq Event 80H , Umask 02H +The number of instruction fetches that miss the +Instruction cache or produce memory requests. This includes +uncacheable fetches. An instruction fetch miss is counted only +once and not once for every cycle it is outstanding. +.It Li ICACHE.ACCESSES +.Pq Event 80H , Umask 03H +The number of instruction fetches, including uncacheable fetches. +.It Li NIP_STALL.ICACHE_MISS +.Pq Event B6H , Umask 04H +The number of cycles the NIP stalls because of an icache miss. +This is a cumulative count of cycles the NIP stalled for all +icache misses. +.It Li OFFCORE_RESPONSE_0 +.Pq Event B7H , Umask 01H +Requires MSR_OFFCORE_RESP0 to specify request type and response. +.It Li OFFCORE_RESPONSE_1 +.Pq Event B7H , Umask 02H +Requires MSR_OFFCORE_RESP to specify request type and response. +.It Li INST_RETIRED.ANY_P +.Pq Event C0H , Umask 00H +The number of instructions that retire execution. For instructions +that consist of multiple micro-ops, this event counts the +retirement of the last micro-op of the instruction. The counter +continues counting during hardware interrupts, traps, and inside +interrupt handlers. +.It Li UOPS_RETIRED.MS +.Pq Event C2H , Umask 01H +The number of micro-ops retired that were supplied from MSROM. +.It Li UOPS_RETIRED.ALL +.Pq Event C2H , Umask 10H +The number of micro-ops retired. +.It Li MACHINE_CLEARS.SMC +.Pq Event C3H , Umask 01H +The number of times that a program writes to a code section. +Self-modifying code causes a severe penalty in all Intel +architecture processors. +.It Li MACHINE_CLEARS.MEMORY_ORDERING +.Pq Event C3H , Umask 02H +The number of times that pipeline was cleared due to memory +ordering issues. +.It Li MACHINE_CLEARS.FP_ASSIST +.Pq Event C3H , Umask 04H +The number of times that pipeline stalled due to FP operations +needing assists. +.It Li MACHINE_CLEARS.ALL +.Pq Event C3H , Umask 08H +The number of times that pipeline stalled due to due to any causes +(including SMC, MO, FP assist, etc). +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 00H +The number of branch instructions retired. +.It Li BR_INST_RETIRED.JCC +.Pq Event C4H , Umask 7EH +The number of branch instructions retired that were conditional +jumps. +.It Li BR_INST_RETIRED.FAR_BRANCH +.Pq Event C4H , Umask BFH +The number of far branch instructions retired. +.It Li BR_INST_RETIRED.NON_RETURN_IND +.Pq Event C4H , Umask EBH +The number of branch instructions retired that were near indirect +call or near indirect jmp. +.It Li BR_INST_RETIRED.RETURN +.Pq Event C4H , Umask F7H +The number of near RET branch instructions retired. +.It Li BR_INST_RETIRED.CALL +.Pq Event C4H , Umask F9H +The number of near CALL branch instructions retired. +.It Li BR_INST_RETIRED.IND_CALL +.Pq Event C4H , Umask FBH +The number of near indirect CALL branch instructions retired. +.It Li BR_INST_RETIRED.REL_CALL +.Pq Event C4H , Umask FDH +The number of near relative CALL branch instructions retired. +.It Li BR_INST_RETIRED.TAKEN_JCC +.Pq Event C4H , Umask FEH +The number of branch instructions retired that were conditional +jumps and predicted taken. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 00H +The number of mispredicted branch instructions retired. +.It Li BR_MISP_RETIRED.JCC +.Pq Event C5H , Umask 7EH +The number of mispredicted branch instructions retired that were +conditional jumps. +.It Li BR_MISP_RETIRED.FAR +.Pq Event C5H , Umask BFH +The number of mispredicted far branch instructions retired. +.It Li BR_MISP_RETIRED.NON_RETURN_IND +.Pq Event C5H , Umask EBH +The number of mispredicted branch instructions retired that were +near indirect call or near indirect jmp. +.It Li BR_MISP_RETIRED.RETURN +.Pq Event C5H , Umask F7H +The number of mispredicted near RET branch instructions retired. +.It Li BR_MISP_RETIRED.CALL +.Pq Event C5H , Umask F9H +The number of mispredicted near CALL branch instructions retired. +.It Li BR_MISP_RETIRED.IND_CALL +.Pq Event C5H , Umask FBH +The number of mispredicted near indirect CALL branch instructions +retired. +.It Li BR_MISP_RETIRED.REL_CALL +.Pq Event C5H , Umask FDH +The number of mispredicted near relative CALL branch instructions +retired. +.It Li BR_MISP_RETIRED.TAKEN_JCC +.Pq Event C5H , Umask FEH +The number of mispredicted branch instructions retired that were +conditional jumps and predicted taken. +.It Li NO_ALLOC_CYCLES.ROB_FULL +.Pq Event CAH , Umask 01H +The number of cycles when no uops are allocated and the ROB is full +(less than 2 entries available). +.It Li NO_ALLOC_CYCLES.RAT_STALL +.Pq Event CAH , Umask 20H +The number of cycles when no uops are allocated and a RATstall is +asserted. +.It Li NO_ALLOC_CYCLES.ALL +.Pq Event CAH , Umask 3FH +The number of cycles when the front-end does not provide any +instructions to be allocated for any reason. +.It Li NO_ALLOC_CYCLES.NOT_DELIVERED +.Pq Event CAH , Umask 50H +The number of cycles when the front-end does not provide any +instructions to be allocated but the back end is not stalled. +.It Li RS_FULL_STALL.MEC +.Pq Event CBH , Umask 01H +The number of cycles the allocation pipe line stalled due to +the RS for the MEC cluster is full. +.It Li RS_FULL_STALL.ALL +.Pq Event CBH , Umask 1FH +The number of cycles that the allocation pipe line stalled due +to any one of the RS is full. +.It Li CYCLES_DIV_BUSY.ANY +.Pq Event CDH , Umask 01H +The number of cycles the divider is busy. +.It Li BACLEARS.ALL +.Pq Event E6H , Umask 01H +The number of baclears for any type of branch. +.It Li BACLEARS.RETURN +.Pq Event E6H , Umask 08H +The number of baclears for return branches. +.It Li BACLEARS.COND +.Pq Event E6H , Umask 10H +The number of baclears for conditional branches. +.It Li MS_DECODED.MS_ENTRY +.Pq Event E7H , Umask 01H) +The number of times the MSROM starts a flow of UOPS. +.El +.Sh SEE ALSO +.Xr pmc 3 , +.Xr pmc.atom 3 , +.Xr pmc.core 3 , +.Xr pmc.core2 3 , +.Xr pmc.iaf 3 , +.Xr pmc.k7 3 , +.Xr pmc.k8 3 , +.Xr pmc.p4 3 , +.Xr pmc.p5 3 , +.Xr pmc.p6 3 , +.Xr pmc.soft 3 , +.Xr pmc.tsc 3 , +.Xr pmc_cpuinfo 3 , +.Xr pmclog 3 , +.Xr hwpmc 4 +.Sh HISTORY +The +.Nm pmc +library first appeared in +.Fx 6.0 . +.Sh AUTHORS +The +.Lb libpmc +library was written by +.An "Joseph Koshy" +.Aq jkoshy@FreeBSD.org . +The support for the Atom Silvermont +microarchitecture was written by +.An "Hiren Panchasara" +.Aq hiren@FreeBSD.org . Modified: stable/10/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_core.c Fri May 30 23:37:31 2014 (r266910) +++ stable/10/sys/dev/hwpmc/hwpmc_core.c Sat May 31 00:40:13 2014 (r266911) @@ -245,7 +245,8 @@ iaf_allocate_pmc(int cpu, int ri, struct validflags = IAF_MASK; - if (core_cputype != PMC_CPU_INTEL_ATOM) + if (core_cputype != PMC_CPU_INTEL_ATOM && + core_cputype != PMC_CPU_INTEL_ATOM_SILVERMONT) validflags &= ~IAF_ANY; if ((flags & ~validflags) != 0) @@ -434,7 +435,8 @@ iaf_stop_pmc(int cpu, int ri) fc = (IAF_MASK << (ri * 4)); - if (core_cputype != PMC_CPU_INTEL_ATOM) + if (core_cputype != PMC_CPU_INTEL_ATOM && + core_cputype != PMC_CPU_INTEL_ATOM_SILVERMONT) fc &= ~IAF_ANY; iafc->pc_iafctrl &= ~fc; @@ -566,7 +568,8 @@ struct iap_event_descr { #define IAP_F_SBX (1 << 8) /* CPU: Sandy Bridge Xeon */ #define IAP_F_IBX (1 << 9) /* CPU: Ivy Bridge Xeon */ #define IAP_F_HW (1 << 10) /* CPU: Haswell */ -#define IAP_F_FM (1 << 11) /* Fixed mask */ +#define IAP_F_CAS (1 << 11) /* CPU: Atom Silvermont */ +#define IAP_F_FM (1 << 12) /* Fixed mask */ #define IAP_F_ALLCPUSCORE2 \ (IAP_F_CC | IAP_F_CC2 | IAP_F_CC2E | IAP_F_CA) @@ -607,28 +610,38 @@ static struct iap_event_descr iap_events IAPDESCR(03H_00H, 0x03, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(03H_01H, 0x03, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | - IAP_F_SBX), + IAP_F_SBX | IAP_F_CAS), IAPDESCR(03H_02H, 0x03, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(03H_04H, 0x03, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS), + IAPDESCR(03H_04H, 0x03, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O | + IAP_F_CAS), IAPDESCR(03H_08H, 0x03, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | - IAP_F_SBX), + IAP_F_SBX | IAP_F_CAS), IAPDESCR(03H_10H, 0x03, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | - IAP_F_SBX), - IAPDESCR(03H_20H, 0x03, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2), - - IAPDESCR(04H_00H, 0x04, 0x00, IAP_F_FM | IAP_F_CC), - IAPDESCR(04H_01H, 0x04, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), - IAPDESCR(04H_02H, 0x04, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2), + IAP_F_SBX | IAP_F_CAS), + IAPDESCR(03H_20H, 0x03, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), + IAPDESCR(03H_40H, 0x03, 0x40, IAP_F_CAS), + IAPDESCR(03H_80H, 0x03, 0x80, IAP_F_CAS), + + IAPDESCR(04H_00H, 0x04, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CAS), + IAPDESCR(04H_01H, 0x04, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O | + IAP_F_CAS), + IAPDESCR(04H_02H, 0x04, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), + IAPDESCR(04H_04H, 0x04, 0x04, IAP_F_CAS), IAPDESCR(04H_07H, 0x04, 0x07, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(04H_08H, 0x04, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), + IAPDESCR(04H_08H, 0x04, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), + IAPDESCR(04H_10H, 0x04, 0x10, IAP_F_CAS), + IAPDESCR(04H_20H, 0x04, 0x20, IAP_F_CAS), + IAPDESCR(04H_40H, 0x04, 0x40, IAP_F_CAS), + IAPDESCR(04H_80H, 0x04, 0x80, IAP_F_CAS), IAPDESCR(05H_00H, 0x05, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(05H_01H, 0x05, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(05H_02H, 0x05, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_WM | IAP_F_SB | - IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(05H_03H, 0x05, 0x03, IAP_F_FM | IAP_F_I7O), + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAPDESCR(05H_03H, 0x05, 0x03, IAP_F_FM | IAP_F_I7O | IAP_F_CAS), IAPDESCR(06H_00H, 0x06, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2 | IAP_F_CC2E | IAP_F_CA), @@ -864,12 +877,16 @@ static struct iap_event_descr iap_events IAPDESCR(2EH_01H, 0x2E, 0x01, IAP_F_FM | IAP_F_WM), IAPDESCR(2EH_02H, 0x2E, 0x02, IAP_F_FM | IAP_F_WM), IAPDESCR(2EH_41H, 0x2E, 0x41, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | - IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS), IAPDESCR(2EH_4FH, 0x2E, 0x4F, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | - IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS), IAPDESCR(30H, 0x30, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), + IAPDESCR(30H_00H, 0x30, 0x00, IAP_F_CAS), + IAPDESCR(31H_00H, 0x31, 0x00, IAP_F_CAS), IAPDESCR(32H, 0x32, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, IAP_F_CC), IAPDESCR(32H, 0x32, IAP_M_CORE, IAP_F_CA | IAP_F_CC2), @@ -880,10 +897,10 @@ static struct iap_event_descr iap_events IAPDESCR(3CH_00H, 0x3C, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW), + IAP_F_HW | IAP_F_CAS), IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW), + IAP_F_HW | IAP_F_CAS), IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(3DH_01H, 0x3D, 0x01, IAP_F_FM | IAP_F_I7O), @@ -1100,11 +1117,12 @@ static struct iap_event_descr iap_events IAPDESCR(7FH, 0x7F, IAP_M_CORE, IAP_F_CA | IAP_F_CC2), IAPDESCR(80H_00H, 0x80, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), - IAPDESCR(80H_01H, 0x80, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(80H_01H, 0x80, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_CAS), IAPDESCR(80H_02H, 0x80, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS), IAPDESCR(80H_03H, 0x80, 0x03, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM), + IAP_F_WM | IAP_F_CAS), IAPDESCR(80H_04H, 0x80, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(81H_00H, 0x81, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), @@ -1332,9 +1350,11 @@ static struct iap_event_descr iap_events IAPDESCR(B4H_04H, 0xB4, 0x04, IAP_F_FM | IAP_F_WM), IAPDESCR(B6H_01H, 0xB6, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_SBX), + IAPDESCR(B6H_04H, 0xB6, 0x04, IAP_F_CAS), IAPDESCR(B7H_01H, 0xB7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAPDESCR(B7H_02H, 0xB7, 0x02, IAP_F_CAS), IAPDESCR(B8H_01H, 0xB8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B8H_02H, 0xB8, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1363,7 +1383,8 @@ static struct iap_event_descr iap_events IAPDESCR(BFH_05H, 0xBF, 0x05, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(C0H_00H, 0xC0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | - IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS), IAPDESCR(C0H_01H, 0xC0, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), @@ -1388,7 +1409,7 @@ static struct iap_event_descr iap_events IAPDESCR(C2H_00H, 0xC2, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(C2H_01H, 0xC2, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(C2H_02H, 0xC2, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), @@ -1397,23 +1418,24 @@ static struct iap_event_descr iap_events IAPDESCR(C2H_07H, 0xC2, 0x07, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(C2H_08H, 0xC2, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(C2H_0FH, 0xC2, 0x0F, IAP_F_FM | IAP_F_CC2), - IAPDESCR(C2H_10H, 0xC2, 0x10, IAP_F_FM | IAP_F_CA), + IAPDESCR(C2H_10H, 0xC2, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CAS), IAPDESCR(C3H_00H, 0xC3, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(C3H_01H, 0xC3, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM), + IAP_F_I7 | IAP_F_WM | IAP_F_CAS), IAPDESCR(C3H_02H, 0xC3, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(C3H_04H, 0xC3, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAPDESCR(C3H_08H, 0xC3, 0x08, IAP_F_CAS), IAPDESCR(C3H_10H, 0xC3, 0x10, IAP_F_FM | IAP_F_I7O), IAPDESCR(C3H_20H, 0xC3, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(C4H_00H, 0xC4, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(C4H_01H, 0xC4, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), @@ -1433,10 +1455,18 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(C4H_40H, 0xC4, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAPDESCR(C4H_7EH, 0xC4, 0x7E, IAP_F_CAS), + IAPDESCR(C4H_BFH, 0xC4, 0xBF, IAP_F_CAS), + IAPDESCR(C4H_EBH, 0xC4, 0xEB, IAP_F_CAS), + IAPDESCR(C4H_F7H, 0xC4, 0xF7, IAP_F_CAS), + IAPDESCR(C4H_F9H, 0xC4, 0xF9, IAP_F_CAS), + IAPDESCR(C4H_FBH, 0xC4, 0xFB, IAP_F_CAS), + IAPDESCR(C4H_FDH, 0xC4, 0xFD, IAP_F_CAS), + IAPDESCR(C4H_FEH, 0xC4, 0xFE, IAP_F_CAS), IAPDESCR(C5H_00H, 0xC5, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(C5H_01H, 0xC5, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(C5H_02H, 0xC5, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | @@ -1447,6 +1477,14 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX), IAPDESCR(C5H_20H, 0xC5, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(C5H_7EH, 0xC5, 0x7E, IAP_F_CAS), + IAPDESCR(C5H_BFH, 0xC5, 0xBF, IAP_F_CAS), + IAPDESCR(C5H_EBH, 0xC5, 0xEB, IAP_F_CAS), + IAPDESCR(C5H_F7H, 0xC5, 0xF7, IAP_F_CAS), + IAPDESCR(C5H_F9H, 0xC5, 0xF9, IAP_F_CAS), + IAPDESCR(C5H_FBH, 0xC5, 0xFB, IAP_F_CAS), + IAPDESCR(C5H_FDH, 0xC5, 0xFD, IAP_F_CAS), + IAPDESCR(C5H_FEH, 0xC5, 0xFE, IAP_F_CAS), IAPDESCR(C6H_00H, 0xC6, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(C6H_01H, 0xC6, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2), @@ -1471,7 +1509,7 @@ static struct iap_event_descr iap_events IAPDESCR(C9H_00H, 0xC9, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(CAH_00H, 0xCA, 0x00, IAP_F_FM | IAP_F_CC), - IAPDESCR(CAH_01H, 0xCA, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2), + IAPDESCR(CAH_01H, 0xCA, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), IAPDESCR(CAH_02H, 0xCA, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(CAH_04H, 0xCA, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | @@ -1482,9 +1520,12 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(CAH_1EH, 0xCA, 0x1E, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAPDESCR(CAH_20H, 0xCA, 0x20, IAP_F_CAS), + IAPDESCR(CAH_3FH, 0xCA, 0x3F, IAP_F_CAS), + IAPDESCR(CAH_50H, 0xCA, 0x50, IAP_F_CAS), IAPDESCR(CBH_01H, 0xCB, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM), + IAP_F_I7 | IAP_F_WM | IAP_F_CAS), IAPDESCR(CBH_02H, 0xCB, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM), IAPDESCR(CBH_04H, 0xCB, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | @@ -1493,6 +1534,7 @@ static struct iap_event_descr iap_events IAP_F_I7 | IAP_F_WM), IAPDESCR(CBH_10H, 0xCB, 0x10, IAP_F_FM | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM), + IAPDESCR(CBH_1FH, 0xCB, 0x1F, IAP_F_CAS), IAPDESCR(CBH_40H, 0xCB, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(CBH_80H, 0xCB, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1507,7 +1549,7 @@ static struct iap_event_descr iap_events IAPDESCR(CDH_00H, 0xCD, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(CDH_01H, 0xCD, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(CDH_02H, 0xCD, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), @@ -1622,10 +1664,14 @@ static struct iap_event_descr iap_events IAPDESCR(E6H_00H, 0xE6, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), IAPDESCR(E6H_01H, 0xE6, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM | IAP_F_SBX), + IAP_F_WM | IAP_F_SBX | IAP_F_CAS), IAPDESCR(E6H_02H, 0xE6, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(E6H_08H, 0xE6, 0x08, IAP_F_CAS), + IAPDESCR(E6H_10H, 0xE6, 0x10, IAP_F_CAS), IAPDESCR(E6H_1FH, 0xE6, 0x1F, IAP_F_FM | IAP_F_IBX | IAP_F_HW), + IAPDESCR(E7H_01H, 0xE7, 0x01, IAP_F_CAS), + IAPDESCR(E8H_01H, 0xE8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(E8H_02H, 0xE8, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(E8H_03H, 0xE8, 0x03, IAP_F_FM | IAP_F_I7O), @@ -2005,6 +2051,9 @@ iap_allocate_pmc(int cpu, int ri, struct case PMC_CPU_INTEL_ATOM: cpuflag = IAP_F_CA; break; + case PMC_CPU_INTEL_ATOM_SILVERMONT: + cpuflag = IAP_F_CAS; + break; case PMC_CPU_INTEL_CORE: cpuflag = IAP_F_CC; break; @@ -2119,6 +2168,7 @@ iap_allocate_pmc(int cpu, int ri, struct * Only Atom and SandyBridge CPUs support the 'ANY' qualifier. */ if (core_cputype == PMC_CPU_INTEL_ATOM || + core_cputype == PMC_CPU_INTEL_ATOM_SILVERMONT || core_cputype == PMC_CPU_INTEL_SANDYBRIDGE || core_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON) evsel |= (config & IAP_ANY); Modified: stable/10/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_intel.c Fri May 30 23:37:31 2014 (r266910) +++ stable/10/sys/dev/hwpmc/hwpmc_intel.c Sat May 31 00:40:13 2014 (r266911) @@ -168,6 +168,10 @@ pmc_intel_initialize(void) cputype = PMC_CPU_INTEL_HASWELL; nclasses = 5; break; + case 0x4D: /* Per Intel document 330061-001 01/2014. */ + cputype = PMC_CPU_INTEL_ATOM_SILVERMONT; + nclasses = 3; + break; } break; #if defined(__i386__) || defined(__amd64__) @@ -200,6 +204,7 @@ pmc_intel_initialize(void) * Intel Core, Core 2 and Atom processors. */ case PMC_CPU_INTEL_ATOM: + case PMC_CPU_INTEL_ATOM_SILVERMONT: case PMC_CPU_INTEL_CORE: case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: @@ -288,6 +293,7 @@ pmc_intel_finalize(struct pmc_mdep *md) switch (md->pmd_cputype) { #if defined(__i386__) || defined(__amd64__) case PMC_CPU_INTEL_ATOM: + case PMC_CPU_INTEL_ATOM_SILVERMONT: case PMC_CPU_INTEL_CORE: case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: Modified: stable/10/sys/dev/hwpmc/pmc_events.h ============================================================================== --- stable/10/sys/dev/hwpmc/pmc_events.h Fri May 30 23:37:31 2014 (r266910) +++ stable/10/sys/dev/hwpmc/pmc_events.h Sat May 31 00:40:13 2014 (r266911) @@ -484,11 +484,18 @@ __PMC_EV(IAP, EVENT_03H_04H) \ __PMC_EV(IAP, EVENT_03H_08H) \ __PMC_EV(IAP, EVENT_03H_10H) \ __PMC_EV(IAP, EVENT_03H_20H) \ +__PMC_EV(IAP, EVENT_03H_40H) \ +__PMC_EV(IAP, EVENT_03H_80H) \ __PMC_EV(IAP, EVENT_04H_00H) \ __PMC_EV(IAP, EVENT_04H_01H) \ __PMC_EV(IAP, EVENT_04H_02H) \ +__PMC_EV(IAP, EVENT_04H_04H) \ __PMC_EV(IAP, EVENT_04H_07H) \ __PMC_EV(IAP, EVENT_04H_08H) \ +__PMC_EV(IAP, EVENT_04H_10H) \ +__PMC_EV(IAP, EVENT_04H_20H) \ +__PMC_EV(IAP, EVENT_04H_40H) \ +__PMC_EV(IAP, EVENT_04H_80H) \ __PMC_EV(IAP, EVENT_05H_00H) \ __PMC_EV(IAP, EVENT_05H_01H) \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat May 31 05:59:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 67ECC646; Sat, 31 May 2014 05:59: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 541992820; Sat, 31 May 2014 05:59: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 s4V5xuE5017493; Sat, 31 May 2014 05:59:56 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4V5xuKZ017492; Sat, 31 May 2014 05:59:56 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201405310559.s4V5xuKZ017492@svn.freebsd.org> From: Dmitry Chagin Date: Sat, 31 May 2014 05:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266918 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 05:59:56 -0000 Author: dchagin Date: Sat May 31 05:59:55 2014 New Revision: 266918 URL: http://svnweb.freebsd.org/changeset/base/266918 Log: MFC r266782: In r218101 I have not changed properly the futex syscall definition. Some Linux futex ops atomically verifies that the futex address uaddr (uval) contains the value val. Comparing signed uval and unsigned val may lead to an unexpected result, mostly to a deadlock. So copyin uaddr to an unsigned int to compare the parameters correctly. While here change ktr records to print parameters in more readable format. Modified: stable/10/sys/compat/linux/linux_futex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Sat May 31 05:16:12 2014 (r266917) +++ stable/10/sys/compat/linux/linux_futex.c Sat May 31 05:59:55 2014 (r266918) @@ -680,12 +680,12 @@ futex_atomic_op(struct thread *td, int e int linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) { - int clockrt, nrwake, op_ret, ret, val; + int clockrt, nrwake, op_ret, ret; struct linux_emuldata *em; struct waiting_proc *wp; struct futex *f, *f2; int error; - uint32_t flags; + uint32_t flags, val; LIN_SDT_PROBE2(futex, linux_sys_futex, entry, td, args); @@ -722,7 +722,7 @@ linux_sys_futex(struct thread *td, struc case LINUX_FUTEX_WAIT_BITSET: LIN_SDT_PROBE3(futex, linux_sys_futex, debug_wait, args->uaddr, args->val, args->val3); - LINUX_CTR3(sys_futex, "WAIT uaddr %p val %d val3 %d", + LINUX_CTR3(sys_futex, "WAIT uaddr %p val 0x%x bitset 0x%x", args->uaddr, args->val, args->val3); error = futex_get(args->uaddr, &wp, &f, @@ -747,9 +747,9 @@ linux_sys_futex(struct thread *td, struc LIN_SDT_PROBE4(futex, linux_sys_futex, debug_wait_value_neq, args->uaddr, args->val, val, args->val3); - LINUX_CTR4(sys_futex, - "WAIT uaddr %p val %d != uval %d val3 %d", - args->uaddr, args->val, val, args->val3); + LINUX_CTR3(sys_futex, + "WAIT uaddr %p val 0x%x != uval 0x%x", + args->uaddr, args->val, val); futex_put(f, wp); LIN_SDT_PROBE1(futex, linux_sys_futex, return, @@ -767,7 +767,7 @@ linux_sys_futex(struct thread *td, struc case LINUX_FUTEX_WAKE_BITSET: LIN_SDT_PROBE3(futex, linux_sys_futex, debug_wake, args->uaddr, args->val, args->val3); - LINUX_CTR3(sys_futex, "WAKE uaddr %p val % d val3 %d", + LINUX_CTR3(sys_futex, "WAKE uaddr %p nrwake 0x%x bitset 0x%x", args->uaddr, args->val, args->val3); error = futex_get(args->uaddr, NULL, &f, @@ -792,9 +792,9 @@ linux_sys_futex(struct thread *td, struc args->uaddr, args->val, args->val3, args->uaddr2, args->timeout); LINUX_CTR5(sys_futex, "CMP_REQUEUE uaddr %p " - "val %d val3 %d uaddr2 %p val2 %d", + "nrwake 0x%x uval 0x%x uaddr2 %p nrequeue 0x%x", args->uaddr, args->val, args->val3, args->uaddr2, - (int)(unsigned long)args->timeout); + args->timeout); /* * Linux allows this, we would not, it is an incorrect @@ -843,7 +843,7 @@ linux_sys_futex(struct thread *td, struc if (val != args->val3) { LIN_SDT_PROBE2(futex, linux_sys_futex, debug_cmp_requeue_value_neq, args->val, val); - LINUX_CTR2(sys_futex, "CMP_REQUEUE val %d != uval %d", + LINUX_CTR2(sys_futex, "CMP_REQUEUE val 0x%x != uval 0x%x", args->val, val); futex_put(f2, NULL); futex_put(f, NULL); @@ -862,9 +862,9 @@ linux_sys_futex(struct thread *td, struc LIN_SDT_PROBE5(futex, linux_sys_futex, debug_wake_op, args->uaddr, args->op, args->val, args->uaddr2, args->val3); LINUX_CTR5(sys_futex, "WAKE_OP " - "uaddr %p op %d val %x uaddr2 %p val3 %x", - args->uaddr, args->op, args->val, - args->uaddr2, args->val3); + "uaddr %p nrwake 0x%x uaddr2 %p op 0x%x nrwake2 0x%x", + args->uaddr, args->val, args->uaddr2, args->val3, + args->timeout); error = futex_get(args->uaddr, NULL, &f, flags); if (error) { @@ -887,6 +887,9 @@ linux_sys_futex(struct thread *td, struc */ op_ret = futex_atomic_op(td, args->val3, args->uaddr2); + LINUX_CTR2(sys_futex, "WAKE_OP atomic_op uaddr %p ret 0x%x", + args->uaddr, op_ret); + if (op_ret < 0) { /* XXX: We don't handle the EFAULT yet. */ if (op_ret != -EFAULT) { From owner-svn-src-stable-10@FreeBSD.ORG Sat May 31 11:08:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5511CA75; Sat, 31 May 2014 11:08: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 3573A2EED; Sat, 31 May 2014 11:08: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 s4VB8OEw055986; Sat, 31 May 2014 11:08:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4VB8MTZ055975; Sat, 31 May 2014 11:08:22 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405311108.s4VB8MTZ055975@svn.freebsd.org> From: Christian Brueffer Date: Sat, 31 May 2014 11:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266921 - in stable/10/sys/dev: firewire my nfe siba sis sk tx usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 11:08:24 -0000 Author: brueffer Date: Sat May 31 11:08:22 2014 New Revision: 266921 URL: http://svnweb.freebsd.org/changeset/base/266921 Log: MFC: r266270 Remove some unused variables. Modified: stable/10/sys/dev/firewire/sbp.c stable/10/sys/dev/my/if_my.c stable/10/sys/dev/nfe/if_nfe.c stable/10/sys/dev/siba/siba_core.c stable/10/sys/dev/sis/if_sis.c stable/10/sys/dev/sk/if_sk.c stable/10/sys/dev/tx/if_tx.c stable/10/sys/dev/usb/net/if_axge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/firewire/sbp.c ============================================================================== --- stable/10/sys/dev/firewire/sbp.c Sat May 31 11:07:30 2014 (r266920) +++ stable/10/sys/dev/firewire/sbp.c Sat May 31 11:08:22 2014 (r266921) @@ -2745,7 +2745,6 @@ sbp_dequeue_ocb(struct sbp_dev *sdev, st struct sbp_ocb *ocb; struct sbp_ocb *next; int s = splfw(), order = 0; - int flags; SBP_DEBUG(1) device_printf(sdev->target->sbp->fd.dev, @@ -2759,7 +2758,6 @@ END_DEBUG SBP_LOCK(sdev->target->sbp); for (ocb = STAILQ_FIRST(&sdev->ocbs); ocb != NULL; ocb = next) { next = STAILQ_NEXT(ocb, ocb); - flags = ocb->flags; if (OCB_MATCH(ocb, sbp_status)) { /* found */ STAILQ_REMOVE(&sdev->ocbs, ocb, sbp_ocb, ocb); Modified: stable/10/sys/dev/my/if_my.c ============================================================================== --- stable/10/sys/dev/my/if_my.c Sat May 31 11:07:30 2014 (r266920) +++ stable/10/sys/dev/my/if_my.c Sat May 31 11:08:22 2014 (r266921) @@ -657,10 +657,8 @@ static void my_setmode_mii(struct my_softc * sc, int media) { u_int16_t bmcr; - struct ifnet *ifp; MY_LOCK_ASSERT(sc); - ifp = sc->my_ifp; /* * If an autoneg session is in progress, stop it. */ Modified: stable/10/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/10/sys/dev/nfe/if_nfe.c Sat May 31 11:07:30 2014 (r266920) +++ stable/10/sys/dev/nfe/if_nfe.c Sat May 31 11:08:22 2014 (r266921) @@ -1375,15 +1375,12 @@ nfe_free_rx_ring(struct nfe_softc *sc, s { struct nfe_rx_data *data; void *desc; - int i, descsize; + int i; - if (sc->nfe_flags & NFE_40BIT_ADDR) { + if (sc->nfe_flags & NFE_40BIT_ADDR) desc = ring->desc64; - descsize = sizeof (struct nfe_desc64); - } else { + else desc = ring->desc32; - descsize = sizeof (struct nfe_desc32); - } for (i = 0; i < NFE_RX_RING_COUNT; i++) { data = &ring->data[i]; Modified: stable/10/sys/dev/siba/siba_core.c ============================================================================== --- stable/10/sys/dev/siba/siba_core.c Sat May 31 11:07:30 2014 (r266920) +++ stable/10/sys/dev/siba/siba_core.c Sat May 31 11:08:22 2014 (r266921) @@ -1739,12 +1739,10 @@ static void siba_pcicore_init(struct siba_pci *spc) { struct siba_dev_softc *sd = spc->spc_dev; - struct siba_softc *siba; if (sd == NULL) return; - siba = sd->sd_bus; if (!siba_dev_isup_sub(sd)) siba_dev_up_sub(sd, 0); Modified: stable/10/sys/dev/sis/if_sis.c ============================================================================== --- stable/10/sys/dev/sis/if_sis.c Sat May 31 11:07:30 2014 (r266920) +++ stable/10/sys/dev/sis/if_sis.c Sat May 31 11:08:22 2014 (r266921) @@ -1616,11 +1616,9 @@ sis_tick(void *xsc) { struct sis_softc *sc; struct mii_data *mii; - struct ifnet *ifp; sc = xsc; SIS_LOCK_ASSERT(sc); - ifp = sc->sis_ifp; mii = device_get_softc(sc->sis_miibus); mii_tick(mii); Modified: stable/10/sys/dev/sk/if_sk.c ============================================================================== --- stable/10/sys/dev/sk/if_sk.c Sat May 31 11:07:30 2014 (r266920) +++ stable/10/sys/dev/sk/if_sk.c Sat May 31 11:08:22 2014 (r266921) @@ -2876,13 +2876,11 @@ static void sk_txeof(sc_if) struct sk_if_softc *sc_if; { - struct sk_softc *sc; struct sk_txdesc *txd; struct sk_tx_desc *cur_tx; struct ifnet *ifp; u_int32_t idx, sk_ctl; - sc = sc_if->sk_softc; ifp = sc_if->sk_ifp; txd = STAILQ_FIRST(&sc_if->sk_cdata.sk_txbusyq); Modified: stable/10/sys/dev/tx/if_tx.c ============================================================================== --- stable/10/sys/dev/tx/if_tx.c Sat May 31 11:07:30 2014 (r266920) +++ stable/10/sys/dev/tx/if_tx.c Sat May 31 11:08:22 2014 (r266921) @@ -1150,12 +1150,10 @@ epic_ifmedia_sts(struct ifnet *ifp, stru { epic_softc_t *sc; struct mii_data *mii; - struct ifmedia *ifm; sc = ifp->if_softc; mii = device_get_softc(sc->miibus); EPIC_LOCK(sc); - ifm = &mii->mii_media; /* Nothing should be selected if interface is down. */ if ((ifp->if_flags & IFF_UP) == 0) { Modified: stable/10/sys/dev/usb/net/if_axge.c ============================================================================== --- stable/10/sys/dev/usb/net/if_axge.c Sat May 31 11:07:30 2014 (r266920) +++ stable/10/sys/dev/usb/net/if_axge.c Sat May 31 11:08:22 2014 (r266921) @@ -910,7 +910,6 @@ axge_ioctl(struct ifnet *ifp, u_long cmd static int axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) { - struct axge_softc *sc; struct axge_csum_hdr csum_hdr; int error, len, pos; int pkt_cnt; @@ -918,7 +917,6 @@ axge_rx_frame(struct usb_ether *ue, stru uint16_t hdr_off; uint16_t pktlen; - sc = uether_getsc(ue); pos = 0; len = 0; error = 0; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 1 18:41:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4C2EE222; Sun, 1 Jun 2014 18:41: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 1EA7D2587; Sun, 1 Jun 2014 18:41: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 s51IfX5o014660; Sun, 1 Jun 2014 18:41:33 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s51IfXFR014659; Sun, 1 Jun 2014 18:41:33 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201406011841.s51IfXFR014659@svn.freebsd.org> From: Benjamin Kaduk Date: Sun, 1 Jun 2014 18:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266952 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 18:41:34 -0000 Author: bjk (doc committer) Date: Sun Jun 1 18:41:33 2014 New Revision: 266952 URL: http://svnweb.freebsd.org/changeset/base/266952 Log: MFC r266285,266866: ------------------------------------------------------------------------ r266285 | bjk | 2014-05-16 23:05:52 -0400 (Fri, 16 May 2014) | 9 lines Correct documentation of the limit on how much memory can be mlock()ed vm.max_wired is a system-wide limit, not per-process. Reword the section to make this more clear. PR: docs/189214 Submitted by: Lawrence Chen (original text) Approved by: hrs (mentor) ------------------------------------------------------------------------ r266866 | bjk | 2014-05-29 22:16:28 -0400 (Thu, 29 May 2014) | 5 lines Minor mdoc fix Submitted by: hrs Approved by: hrs (mentor, implicit) ------------------------------------------------------------------------ PR: docs/189214 Approved by: hrs (mentor) Modified: stable/10/lib/libc/sys/mlock.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/mlock.2 ============================================================================== --- stable/10/lib/libc/sys/mlock.2 Sun Jun 1 18:16:01 2014 (r266951) +++ stable/10/lib/libc/sys/mlock.2 Sun Jun 1 18:41:33 2014 (r266952) @@ -28,7 +28,7 @@ .\" @(#)mlock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd March 18, 2013 +.Dd May 17, 2014 .Dt MLOCK 2 .Os .Sh NAME @@ -91,14 +91,21 @@ Locked mappings are not inherited by the .Pp Since physical memory is a potentially scarce resource, processes are limited in how much they can lock down. -A single process can +The amount of memory that a single process can .Fn mlock -the minimum of -a system-wide ``wired pages'' limit +is limited by both the per-process +.Dv RLIMIT_MEMLOCK +resource limit and the +system-wide +.Dq wired pages +limit +.Va vm.max_wired . .Va vm.max_wired -and the per-process -.Li RLIMIT_MEMLOCK -resource limit. +applies to the system as a whole, so the amount available to a single +process at any given time is the difference between +.Va vm.max_wired +and +.Va vm.stats.vm.v_wire_count . .Pp If .Va security.bsd.unprivileged_mlock From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 1 18:52:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6A4889E8; Sun, 1 Jun 2014 18:52: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 566E4266A; Sun, 1 Jun 2014 18:52: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 s51IqMTL019367; Sun, 1 Jun 2014 18:52:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s51IqMif019366; Sun, 1 Jun 2014 18:52:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201406011852.s51IqMif019366@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 1 Jun 2014 18:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266953 - stable/10/usr.sbin/mergemaster X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 18:52:22 -0000 Author: jilles Date: Sun Jun 1 18:52:21 2014 New Revision: 266953 URL: http://svnweb.freebsd.org/changeset/base/266953 Log: MFC r264480: mergemaster: Avoid "/var/tmp/temproot disappeared" if there is nothing to compare. Because of the change to find in SVN r253886, the entire temproot would be deleted if it became empty, leading to a confusing message "*** FATAL ERROR: The temproot directory ${TEMPROOT} has disappeared!" Note that mergemaster does not do anything useful in this situation anyway (e.g. put IGNORE_FILES="/etc/group /etc/master.passwd" in /etc/mergemaster.rc and run mergemaster -p). As noted in that commit, add -mindepth 1. PR: bin/188485 Submitted by: David Boyd Modified: stable/10/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/10/usr.sbin/mergemaster/mergemaster.sh Sun Jun 1 18:41:33 2014 (r266952) +++ stable/10/usr.sbin/mergemaster/mergemaster.sh Sun Jun 1 18:52:21 2014 (r266953) @@ -708,7 +708,7 @@ case "${RERUN}" in # and to make the actual comparison faster. find ${TEMPROOT}/usr -type l -delete 2>/dev/null find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null - find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null + find -d ${TEMPROOT} -type d -empty -mindepth 1 -delete 2>/dev/null # Build the mtree database in a temporary location. case "${PRE_WORLD}" in From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 2 05:01:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EFB23263; Mon, 2 Jun 2014 05:01:08 +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 DC3932829; Mon, 2 Jun 2014 05:01:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52518xR090037; Mon, 2 Jun 2014 05:01:08 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52518J6090036; Mon, 2 Jun 2014 05:01:08 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201406020501.s52518J6090036@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 2 Jun 2014 05:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266965 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 05:01:09 -0000 Author: np Date: Mon Jun 2 05:01:08 2014 New Revision: 266965 URL: http://svnweb.freebsd.org/changeset/base/266965 Log: MFC r266908: cxgbe(4): Fix a NULL dereference when the very first call to get_scatter_segment() in get_fl_payload() fails. While here, fix the code to adjust fl_bufs_used when a failure occurs for any other scatter segment. Modified: stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Mon Jun 2 03:27:33 2014 (r266964) +++ stable/10/sys/dev/cxgbe/t4_sge.c Mon Jun 2 05:01:08 2014 (r266965) @@ -1565,6 +1565,7 @@ get_fl_payload(struct adapter *sc, struc nbuf = 0; len = G_RSPD_LEN(len_newbuf); if (__predict_false(fl->m0 != NULL)) { + M_ASSERTPKTHDR(fl->m0); MPASS(len == fl->m0->m_pkthdr.len); MPASS(fl->remaining < len); @@ -1588,6 +1589,8 @@ get_fl_payload(struct adapter *sc, struc */ m0 = get_scatter_segment(sc, fl, len, M_PKTHDR); + if (m0 == NULL) + goto done; len -= m0->m_len; pnext = &m0->m_next; while (len > 0) { @@ -1599,7 +1602,8 @@ get_segment: fl->m0 = m0; fl->pnext = pnext; fl->remaining = len; - return (NULL); + m0 = NULL; + goto done; } *pnext = m; pnext = &m->m_next; @@ -1608,7 +1612,7 @@ get_segment: *pnext = NULL; if (fl->rx_offset == 0) nbuf++; - +done: (*fl_bufs_used) += nbuf; return (m0); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 2 10:14:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C2ECCD81; Mon, 2 Jun 2014 10:14: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 AF56A2171; Mon, 2 Jun 2014 10:14: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 s52AE3Rx033481; Mon, 2 Jun 2014 10:14:03 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52AE3DY033480; Mon, 2 Jun 2014 10:14:03 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201406021014.s52AE3DY033480@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 2 Jun 2014 10:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266970 - stable/10/sys/geom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 10:14:03 -0000 Author: ae Date: Mon Jun 2 10:14:03 2014 New Revision: 266970 URL: http://svnweb.freebsd.org/changeset/base/266970 Log: MFC r266444: We have two functions from where a geom orphan method could be called: g_orphan_register and g_resize_provider_event. Both are called from the event queue. Also we have GEOM_DEV class, which does deferred destroy for its consumers via g_dev_destroy (also called from the event queue). So it is possible, that for some consumers an orphan method will be called twice. This triggers panic in g_dev_orphan. Check that consumer isn't already orphaned before call orphan method. Modified: stable/10/sys/geom/geom_event.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_event.c ============================================================================== --- stable/10/sys/geom/geom_event.c Mon Jun 2 07:08:34 2014 (r266969) +++ stable/10/sys/geom/geom_event.c Mon Jun 2 10:14:03 2014 (r266970) @@ -206,6 +206,14 @@ g_orphan_register(struct g_provider *pp) KASSERT(cp->geom->orphan != NULL, ("geom %s has no orphan, class %s", cp->geom->name, cp->geom->class->name)); + /* + * XXX: g_dev_orphan method does deferred destroying + * and it is possible, that other event could already + * call the orphan method. Check consumer's flags to + * do not schedule it twice. + */ + if (cp->flags & G_CF_ORPHAN) + continue; cp->flags |= G_CF_ORPHAN; cp->geom->orphan(cp); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 2 13:07:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DA2827E3; Mon, 2 Jun 2014 13:07:28 +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 AD39C22EF; Mon, 2 Jun 2014 13:07:28 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WrRxR-000Orv-Eg; Mon, 02 Jun 2014 13:07:21 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s52D7InY001135; Mon, 2 Jun 2014 07:07:18 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18yAVbJVIROk9JN3uJf/yu3 Subject: Re: svn commit: r266970 - stable/10/sys/geom From: Ian Lepore To: "Andrey V. Elsukov" In-Reply-To: <201406021014.s52AE3DY033480@svn.freebsd.org> References: <201406021014.s52AE3DY033480@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 02 Jun 2014 07:07:18 -0600 Message-ID: <1401714438.20883.83.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-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-10@FreeBSD.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 13:07:29 -0000 On Mon, 2014-06-02 at 10:14 +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Mon Jun 2 10:14:03 2014 > New Revision: 266970 > URL: http://svnweb.freebsd.org/changeset/base/266970 > > Log: > MFC r266444: > We have two functions from where a geom orphan method could be called: > g_orphan_register and g_resize_provider_event. Both are called from the > event queue. Also we have GEOM_DEV class, which does deferred destroy > for its consumers via g_dev_destroy (also called from the event queue). > So it is possible, that for some consumers an orphan method will be > called twice. This triggers panic in g_dev_orphan. > Check that consumer isn't already orphaned before call orphan method. > > Modified: > stable/10/sys/geom/geom_event.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/geom/geom_event.c > ============================================================================== > --- stable/10/sys/geom/geom_event.c Mon Jun 2 07:08:34 2014 (r266969) > +++ stable/10/sys/geom/geom_event.c Mon Jun 2 10:14:03 2014 (r266970) > @@ -206,6 +206,14 @@ g_orphan_register(struct g_provider *pp) > KASSERT(cp->geom->orphan != NULL, > ("geom %s has no orphan, class %s", > cp->geom->name, cp->geom->class->name)); > + /* > + * XXX: g_dev_orphan method does deferred destroying > + * and it is possible, that other event could already > + * call the orphan method. Check consumer's flags to > + * do not schedule it twice. > + */ > + if (cp->flags & G_CF_ORPHAN) > + continue; > cp->flags |= G_CF_ORPHAN; > cp->geom->orphan(cp); > } > Why is this comment flagged with XXX? Doesn't that generally mean that more action or further analysis in the future is required? Nothing about the comment itself indicates that there's more work to do. -- Ian From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 2 13:23:46 2014 Return-Path: Delivered-To: svn-src-stable-10@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8A7FD76; Mon, 2 Jun 2014 13:23:46 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 3821F2E83; Mon, 2 Jun 2014 13:23:44 +0000 (UTC) Message-ID: <538C7AC3.7030405@FreeBSD.org> Date: Mon, 02 Jun 2014 17:23:15 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r266970 - stable/10/sys/geom References: <201406021014.s52AE3DY033480@svn.freebsd.org> <1401714438.20883.83.camel@revolution.hippie.lan> In-Reply-To: <1401714438.20883.83.camel@revolution.hippie.lan> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-10@FreeBSD.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 13:23:46 -0000 On 02.06.2014 17:07, Ian Lepore wrote: >> ============================================================================== >> --- stable/10/sys/geom/geom_event.c Mon Jun 2 07:08:34 2014 (r266969) >> +++ stable/10/sys/geom/geom_event.c Mon Jun 2 10:14:03 2014 (r266970) >> @@ -206,6 +206,14 @@ g_orphan_register(struct g_provider *pp) >> KASSERT(cp->geom->orphan != NULL, >> ("geom %s has no orphan, class %s", >> cp->geom->name, cp->geom->class->name)); >> + /* >> + * XXX: g_dev_orphan method does deferred destroying >> + * and it is possible, that other event could already >> + * call the orphan method. Check consumer's flags to >> + * do not schedule it twice. >> + */ >> + if (cp->flags & G_CF_ORPHAN) >> + continue; >> cp->flags |= G_CF_ORPHAN; >> cp->geom->orphan(cp); >> } >> > > Why is this comment flagged with XXX? Doesn't that generally mean that > more action or further analysis in the future is required? Nothing > about the comment itself indicates that there's more work to do. I suspect that there are some another places, where similar problem can occurs. It needs more attention. I just did fix for the easy reproducible panic. -- WBR, Andrey V. Elsukov From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 3 01:39:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CC5A348A; Tue, 3 Jun 2014 01:39: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 B88952AA5; Tue, 3 Jun 2014 01:39: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 s531dugU048269; Tue, 3 Jun 2014 01:39:56 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s531duHV048265; Tue, 3 Jun 2014 01:39:56 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201406030139.s531duHV048265@svn.freebsd.org> From: Kevin Lo Date: Tue, 3 Jun 2014 01:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266991 - in stable/10/sys/dev/usb: . net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 01:39:57 -0000 Author: kevlo Date: Tue Jun 3 01:39:55 2014 New Revision: 266991 URL: http://svnweb.freebsd.org/changeset/base/266991 Log: MFC r266490, r266738: - Configure Rx bulk - Announce flow control capability to PHY drivers - Improve performance by fixing incorrect Rx/Tx handling - Rename definition of AXGE_* to reflect reality - Add new USB IDs Modified: stable/10/sys/dev/usb/net/if_axge.c stable/10/sys/dev/usb/net/if_axgereg.h stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_axge.c ============================================================================== --- stable/10/sys/dev/usb/net/if_axge.c Tue Jun 3 01:30:32 2014 (r266990) +++ stable/10/sys/dev/usb/net/if_axge.c Tue Jun 3 01:39:55 2014 (r266991) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Kevin Lo + * Copyright (c) 2013-2014 Kevin Lo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,17 +66,22 @@ static const STRUCT_USB_HOST_ID axge_dev #define AXGE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } AXGE_DEV(ASIX, AX88178A), AXGE_DEV(ASIX, AX88179), - /* AXGE_DEV(SITECOMEU, LN032), */ + AXGE_DEV(DLINK, DUB1312), + AXGE_DEV(SITECOMEU, LN032), #undef AXGE_DEV }; static const struct { - unsigned char ctrl, timer_l, timer_h, size, ifg; -} AX88179_BULKIN_SIZE[] = { - {7, 0x4f, 0, 0x12, 0xff}, - {7, 0x20, 3, 0x16, 0xff}, - {7, 0xae, 7, 0x18, 0xff}, - {7, 0xcc, 0x4c, 0x18, 8}, + uint8_t ctrl; + uint8_t timer_l; + uint8_t timer_h; + uint8_t size; + uint8_t ifg; +} axge_bulk_size[] = { + { 7, 0x4f, 0x00, 0x12, 0xff }, + { 7, 0x20, 0x03, 0x16, 0xff }, + { 7, 0xae, 0x07, 0x18, 0xff }, + { 7, 0xcc, 0x4c, 0x18, 0x08 } }; /* prototypes */ @@ -104,10 +109,11 @@ static int axge_read_mem(struct axge_sof uint16_t, void *, int); static void axge_write_mem(struct axge_softc *, uint8_t, uint16_t, uint16_t, void *, int); +static uint8_t axge_read_cmd_1(struct axge_softc *, uint8_t, uint16_t); static uint16_t axge_read_cmd_2(struct axge_softc *, uint8_t, uint16_t, uint16_t); static void axge_write_cmd_1(struct axge_softc *, uint8_t, uint16_t, - uint16_t, uint8_t); + uint8_t); static void axge_write_cmd_2(struct axge_softc *, uint8_t, uint16_t, uint16_t, uint16_t); static void axge_chip_init(struct axge_softc *); @@ -119,7 +125,7 @@ static void axge_ifmedia_sts(struct ifne static int axge_ioctl(struct ifnet *, u_long, caddr_t); static int axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int); static int axge_rxeof(struct usb_ether *, struct usb_page_cache *, - unsigned int, unsigned int, struct axge_csum_hdr *); + unsigned int, unsigned int, uint32_t); static void axge_csum_cfg(struct usb_ether *); #define AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) @@ -138,7 +144,7 @@ static const struct usb_config axge_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .frames = 16, - .bufsize = 16 * (MCLBYTES + 16), + .bufsize = 16 * MCLBYTES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = axge_bulk_write_callback, .timeout = 10000, /* 10 seconds */ @@ -233,6 +239,15 @@ axge_write_mem(struct axge_softc *sc, ui } } +static uint8_t +axge_read_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t reg) +{ + uint8_t val; + + axge_read_mem(sc, cmd, 1, reg, &val, 1); + return (val); +} + static uint16_t axge_read_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, uint16_t reg) @@ -244,10 +259,9 @@ axge_read_cmd_2(struct axge_softc *sc, u } static void -axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t index, - uint16_t reg, uint8_t val) +axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t reg, uint8_t val) { - axge_write_mem(sc, cmd, index, reg, &val, 1); + axge_write_mem(sc, cmd, 1, reg, &val, 1); } static void @@ -307,6 +321,7 @@ axge_miibus_statchg(device_t dev) struct axge_softc *sc; struct mii_data *mii; struct ifnet *ifp; + uint8_t link_status, tmp[5]; uint16_t val; int locked; @@ -339,26 +354,41 @@ axge_miibus_statchg(device_t dev) if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) goto done; + link_status = axge_read_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_PLSR); + val = 0; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { - val |= AXGE_MEDIUM_FULL_DUPLEX; + val |= MSR_FD; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) - val |= AXGE_MEDIUM_TXFLOW_CTRLEN; + val |= MSR_TFC; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) - val |= AXGE_MEDIUM_RXFLOW_CTRLEN; + val |= MSR_RFC; } - val |= AXGE_MEDIUM_RECEIVE_EN | AXGE_MEDIUM_ALWAYS_ONE; + val |= MSR_RE; switch (IFM_SUBTYPE(mii->mii_media_active)) { case IFM_1000_T: - val |= AXGE_MEDIUM_GIGAMODE; + val |= MSR_GM | MSR_EN_125MHZ; + if (link_status & PLSR_USB_SS) + memcpy(tmp, &axge_bulk_size[0], 5); + else if (link_status & PLSR_USB_HS) + memcpy(tmp, &axge_bulk_size[1], 5); + else + memcpy(tmp, &axge_bulk_size[3], 5); + break; case IFM_100_TX: - val |= AXGE_MEDIUM_PS; + val |= MSR_PS; + if (link_status & (PLSR_USB_SS | PLSR_USB_HS)) + memcpy(tmp, &axge_bulk_size[2], 5); + else + memcpy(tmp, &axge_bulk_size[3], 5); + break; case IFM_10_T: - /* Doesn't need to be handled. */ + memcpy(tmp, &axge_bulk_size[3], 5); break; } - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MEDIUM_STATUS_MODE, val); - + /* Rx bulk configuration. */ + axge_write_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR, val); done: if (!locked) AXGE_UNLOCK(sc); @@ -368,11 +398,10 @@ static void axge_chip_init(struct axge_softc *sc) { /* Power up ethernet PHY. */ - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, 0); - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, - AXGE_PHYPWR_RSTCTL_IPRL); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_EPPRCR, 0); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_EPPRCR, EPPRCR_IPRL); uether_pause(&sc->sc_ue, hz / 4); - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_CLK_SELECT, + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CLK_SELECT, AXGE_CLK_SELECT_ACS | AXGE_CLK_SELECT_BCS); uether_pause(&sc->sc_ue, hz / 10); } @@ -401,17 +430,13 @@ static void axge_attach_post(struct usb_ether *ue) { struct axge_softc *sc; - uint8_t tmp[5]; sc = uether_getsc(ue); sc->sc_phyno = 3; /* Initialize controller and get station address. */ axge_chip_init(sc); - - memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5); - axge_read_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5); - axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NIDR, ue->ue_eaddr, ETHER_ADDR_LEN); } @@ -439,7 +464,7 @@ axge_attach_post_sub(struct usb_ether *u mtx_lock(&Giant); error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, - BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, 0); + BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, MIIF_DOPAUSE); mtx_unlock(&Giant); return (error); @@ -580,7 +605,8 @@ axge_bulk_read_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: pc = usbd_xfer_get_frame(xfer, 0); - axge_rx_frame(ue, pc, actlen); + if (axge_rx_frame(ue, pc, actlen) != 0) + goto tr_setup; /* FALLTHROUGH */ case USB_ST_SETUP: @@ -608,9 +634,7 @@ axge_bulk_write_callback(struct usb_xfer struct usb_page_cache *pc; struct mbuf *m; uint32_t txhdr; - uint32_t txhdr2; - int nframes; - int frm_len; + int nframes, pos; sc = usbd_xfer_softc(xfer); ifp = uether_getifp(&sc->sc_ue); @@ -637,26 +661,18 @@ tr_setup: break; usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, nframes); - frm_len = 0; + pos = 0; pc = usbd_xfer_get_frame(xfer, nframes); - - txhdr = m->m_pkthdr.len; - txhdr = htole32(txhdr); + txhdr = htole32(m->m_pkthdr.len); usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); - frm_len += sizeof(txhdr); - - txhdr2 = 0; - if ((m->m_pkthdr.len + sizeof(txhdr) + sizeof(txhdr2)) % - usbd_xfer_max_framelen(xfer) == 0) { - txhdr2 |= 0x80008000; - } - txhdr2 = htole32(txhdr2); - usbd_copy_in(pc, frm_len, &txhdr2, sizeof(txhdr2)); - frm_len += sizeof(txhdr2); - - /* Next copy in the actual packet. */ - usbd_m_copy_in(pc, frm_len, m, 0, m->m_pkthdr.len); - frm_len += m->m_pkthdr.len; + txhdr = 0; + txhdr = htole32(txhdr); + usbd_copy_in(pc, 4, &txhdr, sizeof(txhdr)); + pos += 8; + usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); + pos += m->m_pkthdr.len; + if ((pos % usbd_xfer_max_framelen(xfer)) == 0) + txhdr |= 0x80008000; /* * XXX @@ -678,7 +694,7 @@ tr_setup: m_freem(m); /* Set frame length. */ - usbd_xfer_set_frame_len(xfer, nframes, frm_len); + usbd_xfer_set_frame_len(xfer, nframes, pos); } if (nframes != 0) { usbd_xfer_set_frames(xfer, nframes); @@ -733,13 +749,13 @@ axge_setmulti(struct usb_ether *ue) h = 0; AXGE_LOCK_ASSERT(sc, MA_OWNED); - rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { - rxmode |= AXGE_RX_CTL_AMALL; - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + rxmode |= RCR_AMALL; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); return; } - rxmode &= ~AXGE_RX_CTL_AMALL; + rxmode &= ~RCR_AMALL; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -751,9 +767,8 @@ axge_setmulti(struct usb_ether *ue) } if_maddr_runlock(ifp); - axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MULTI_FILTER_ARRY, - (void *)&hashtbl, 8); - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MFA, (void *)&hashtbl, 8); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); } static void @@ -765,14 +780,14 @@ axge_setpromisc(struct usb_ether *ue) sc = uether_getsc(ue); ifp = uether_getifp(ue); - rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); if (ifp->if_flags & IFF_PROMISC) - rxmode |= AXGE_RX_CTL_PRO; + rxmode |= RCR_PRO; else - rxmode &= ~AXGE_RX_CTL_PRO; + rxmode &= ~RCR_PRO; - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); axge_setmulti(ue); } @@ -811,27 +826,31 @@ axge_init(struct usb_ether *ue) axge_reset(sc); /* Set MAC address. */ - axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NIDR, IF_LLADDR(ifp), ETHER_ADDR_LEN); - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_LOW, 0x34); - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_HIGH, - 0x52); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_PWLLR, 0x34); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_PWLHR, 0x52); /* Configure TX/RX checksum offloading. */ axge_csum_cfg(ue); /* Configure RX settings. */ - rxmode = (AXGE_RX_CTL_IPE | AXGE_RX_CTL_AM | AXGE_RX_CTL_START); + rxmode = (RCR_AM | RCR_SO | RCR_DROP_CRCE); + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) + rxmode |= RCR_IPE; /* If we want promiscuous mode, set the allframes bit. */ if (ifp->if_flags & IFF_PROMISC) - rxmode |= AXGE_RX_CTL_PRO; + rxmode |= RCR_PRO; if (ifp->if_flags & IFF_BROADCAST) - rxmode |= AXGE_RX_CTL_AB; + rxmode |= RCR_AB; - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); + + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_MMSR, + MMSR_PME_TYPE | MMSR_PME_POL | MMSR_RWMP); /* Load the multicast filter. */ axge_setmulti(ue); @@ -910,38 +929,39 @@ axge_ioctl(struct ifnet *ifp, u_long cmd static int axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) { - struct axge_csum_hdr csum_hdr; - int error, len, pos; + int error, pos; int pkt_cnt; - uint32_t rxhdr; + uint32_t rxhdr, pkt_hdr; uint16_t hdr_off; - uint16_t pktlen; + uint16_t len, pktlen; pos = 0; len = 0; error = 0; usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr)); - actlen -= sizeof(rxhdr); rxhdr = le32toh(rxhdr); pkt_cnt = (uint16_t)rxhdr; hdr_off = (uint16_t)(rxhdr >> 16); - usbd_copy_out(pc, pos + hdr_off, &csum_hdr, sizeof(csum_hdr)); - csum_hdr.len = le16toh(csum_hdr.len); - csum_hdr.cstatus = le16toh(csum_hdr.cstatus); + usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr)); - while (pkt_cnt--) { - if (actlen <= sizeof(csum_hdr) + sizeof(struct ether_header)) { + while (pkt_cnt > 0) { + if ((int)(sizeof(pkt_hdr)) > actlen) { error = EINVAL; break; } - pktlen = AXGE_CSUM_RXBYTES(csum_hdr.len); - - if (pkt_cnt == 0) - /* Skip the 2-byte IP alignment header. */ - axge_rxeof(ue, pc, 2, pktlen - 2, &csum_hdr); + pkt_hdr = le32toh(pkt_hdr); + pktlen = (pkt_hdr >> 16) & 0x1fff; + if ((pkt_hdr & AXGE_RXHDR_CRC_ERR) || + (pkt_hdr & AXGE_RXHDR_DROP_ERR)) + ue->ue_ifp->if_ierrors++; + axge_rxeof(ue, pc, pos + 2, pktlen - 6, pkt_hdr); + len = (pktlen + 7) & ~7; + pos += len; + pkt_hdr++; + pkt_cnt--; } if (error != 0) @@ -951,7 +971,7 @@ axge_rx_frame(struct usb_ether *ue, stru static int axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, - unsigned int offset, unsigned int len, struct axge_csum_hdr *csum_hdr) + unsigned int offset, unsigned int len, uint32_t pkt_hdr) { struct ifnet *ifp; struct mbuf *m; @@ -976,20 +996,15 @@ axge_rxeof(struct usb_ether *ue, struct m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len; - if (csum_hdr != NULL && - csum_hdr->cstatus & AXGE_CSUM_HDR_L3_TYPE_IPV4) { - if ((csum_hdr->cstatus & (AXGE_CSUM_HDR_L4_CSUM_ERR | - AXGE_RXHDR_L4CSUM_ERR)) == 0) { - m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | - CSUM_IP_VALID; - if ((csum_hdr->cstatus & AXGE_CSUM_HDR_L4_TYPE_MASK) == - AXGE_CSUM_HDR_L4_TYPE_TCP || - (csum_hdr->cstatus & AXGE_CSUM_HDR_L4_TYPE_MASK) == - AXGE_CSUM_HDR_L4_TYPE_UDP) { - m->m_pkthdr.csum_flags |= - CSUM_DATA_VALID | CSUM_PSEUDO_HDR; - m->m_pkthdr.csum_data = 0xffff; - } + if ((pkt_hdr & (AXGE_RXHDR_L4CSUM_ERR | AXGE_RXHDR_L3CSUM_ERR)) == 0) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | CSUM_IP_VALID; + if ((pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == + AXGE_RXHDR_L4_TYPE_TCP || + (pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == + AXGE_RXHDR_L4_TYPE_UDP) { + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; } } @@ -1010,12 +1025,11 @@ axge_csum_cfg(struct usb_ether *ue) csum = 0; if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) - csum |= AXGE_TXCOE_IP | AXGE_TXCOE_TCP | AXGE_TXCOE_UDP; - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_TXCOE_CTL, csum); + csum |= CTCR_IP | CTCR_TCP | CTCR_UDP; + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CTCR, csum); csum = 0; if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) - csum |= AXGE_RXCOE_IP | AXGE_RXCOE_TCP | AXGE_RXCOE_UDP | - AXGE_RXCOE_ICMP | AXGE_RXCOE_IGMP; - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_RXCOE_CTL, csum); + csum |= CRCR_IP | CRCR_TCP | CRCR_UDP; + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CRCR, csum); } Modified: stable/10/sys/dev/usb/net/if_axgereg.h ============================================================================== --- stable/10/sys/dev/usb/net/if_axgereg.h Tue Jun 3 01:30:32 2014 (r266990) +++ stable/10/sys/dev/usb/net/if_axgereg.h Tue Jun 3 01:39:55 2014 (r266991) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Kevin Lo + * Copyright (c) 2013-2014 Kevin Lo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,13 +26,6 @@ * $FreeBSD$ */ -#define AX88179_PHY_ID 0x03 -#define AXGE_MCAST_FILTER_SIZE 8 -#define AXGE_MAXGE_MCAST 64 -#define AXGE_EEPROM_LEN 0x40 -#define AXGE_RX_CHECKSUM 1 -#define AXGE_TX_CHECKSUM 2 - #define AXGE_ACCESS_MAC 0x01 #define AXGE_ACCESS_PHY 0x02 #define AXGE_ACCESS_WAKEUP 0x03 @@ -43,74 +36,73 @@ #define AXGE_WRITE_EFUSE_DIS 0x0A #define AXGE_ACCESS_MFAB 0x10 -#define AXGE_LINK_STATUS 0x02 -#define AXGE_LINK_STATUS_USB_FS 0x01 -#define AXGE_LINK_STATUS_USB_HS 0x02 -#define AXGE_LINK_STATUS_USB_SS 0x04 - -#define AXGE_SROM_ADDR 0x07 -#define AXGE_SROM_DATA_LOW 0x08 -#define AXGE_SROM_DATA_HIGH 0x09 -#define AXGE_SROM_CMD 0x0a -#define AXGE_SROM_CMD_RD 0x04 /* EEprom read command */ -#define AXGE_SROM_CMD_WR 0x08 /* EEprom write command */ -#define AXGE_SROM_CMD_BUSY 0x10 /* EEprom access module busy */ - -#define AXGE_RX_CTL 0x0b -#define AXGE_RX_CTL_DROPCRCERR 0x0100 /* Drop CRC error packet */ -#define AXGE_RX_CTL_IPE 0x0200 /* 4-byte IP header alignment */ -#define AXGE_RX_CTL_TXPADCRC 0x0400 /* Csum value in rx header 3 */ -#define AXGE_RX_CTL_START 0x0080 /* Ethernet MAC start */ -#define AXGE_RX_CTL_AP 0x0020 /* Accept physical address from - multicast array */ -#define AXGE_RX_CTL_AM 0x0010 -#define AXGE_RX_CTL_AB 0x0008 -#define AXGE_RX_CTL_HA8B 0x0004 -#define AXGE_RX_CTL_AMALL 0x0002 /* Accept all multicast frames */ -#define AXGE_RX_CTL_PRO 0x0001 /* Promiscuous Mode */ -#define AXGE_RX_CTL_STOP 0x0000 /* Stop MAC */ - -#define AXGE_NODE_ID 0x10 -#define AXGE_MULTI_FILTER_ARRY 0x16 - -#define AXGE_MEDIUM_STATUS_MODE 0x22 -#define AXGE_MEDIUM_GIGAMODE 0x0001 -#define AXGE_MEDIUM_FULL_DUPLEX 0x0002 -#define AXGE_MEDIUM_ALWAYS_ONE 0x0004 -#define AXGE_MEDIUM_EN_125MHZ 0x0008 -#define AXGE_MEDIUM_RXFLOW_CTRLEN 0x0010 -#define AXGE_MEDIUM_TXFLOW_CTRLEN 0x0020 -#define AXGE_MEDIUM_RECEIVE_EN 0x0100 -#define AXGE_MEDIUM_PS 0x0200 -#define AXGE_MEDIUM_JUMBO_EN 0x8040 - -#define AXGE_MONITOR_MODE 0x24 -#define AXGE_MONITOR_MODE_RWLC 0x02 -#define AXGE_MONITOR_MODE_RWMP 0x04 -#define AXGE_MONITOR_MODE_RWWF 0x08 -#define AXGE_MONITOR_MODE_RW_FLAG 0x10 -#define AXGE_MONITOR_MODE_PMEPOL 0x20 -#define AXGE_MONITOR_MODE_PMETYPE 0x40 - -#define AXGE_GPIO_CTRL 0x25 -#define AXGE_GPIO_CTRL_GPIO3EN 0x80 -#define AXGE_GPIO_CTRL_GPIO2EN 0x40 -#define AXGE_GPIO_CTRL_GPIO1EN 0x20 - -#define AXGE_PHYPWR_RSTCTL 0x26 -#define AXGE_PHYPWR_RSTCTL_BZ 0x0010 -#define AXGE_PHYPWR_RSTCTL_IPRL 0x0020 -#define AXGE_PHYPWR_RSTCTL_AUTODETACH 0x1000 +/* Physical link status register */ +#define AXGE_PLSR 0x02 +#define PLSR_USB_FS 0x01 +#define PLSR_USB_HS 0x02 +#define PLSR_USB_SS 0x04 + +/* EEPROM address register */ +#define AXGE_EAR 0x07 + +/* EEPROM data low register */ +#define AXGE_EDLR 0x08 + +/* EEPROM data high register */ +#define AXGE_EDHR 0x09 + +/* EEPROM command register */ +#define AXGE_ECR 0x0a + +/* Rx control register */ +#define AXGE_RCR 0x0b +#define RCR_STOP 0x0000 +#define RCR_PRO 0x0001 +#define RCR_AMALL 0x0002 +#define RCR_AB 0x0008 +#define RCR_AM 0x0010 +#define RCR_AP 0x0020 +#define RCR_SO 0x0080 +#define RCR_DROP_CRCE 0x0100 +#define RCR_IPE 0x0200 +#define RCR_TX_CRC_PAD 0x0400 + +/* Node id register */ +#define AXGE_NIDR 0x10 + +/* Multicast filter array */ +#define AXGE_MFA 0x16 + +/* Medium status register */ +#define AXGE_MSR 0x22 +#define MSR_GM 0x0001 +#define MSR_FD 0x0002 +#define MSR_EN_125MHZ 0x0008 +#define MSR_RFC 0x0010 +#define MSR_TFC 0x0020 +#define MSR_RE 0x0100 +#define MSR_PS 0x0200 + +/* Monitor mode status register */ +#define AXGE_MMSR 0x24 +#define MMSR_RWLC 0x02 +#define MMSR_RWMP 0x04 +#define MMSR_RWWF 0x08 +#define MMSR_RW_FLAG 0x10 +#define MMSR_PME_POL 0x20 +#define MMSR_PME_TYPE 0x40 +#define MMSR_PME_IND 0x80 + +/* GPIO control/status register */ +#define AXGE_GPIOCR 0x25 + +/* Ethernet PHY power & reset control register */ +#define AXGE_EPPRCR 0x26 +#define EPPRCR_BZ 0x0010 +#define EPPRCR_IPRL 0x0020 +#define EPPRCR_AUTODETACH 0x1000 #define AXGE_RX_BULKIN_QCTRL 0x2e -#define AXGE_RX_BULKIN_QCTRL_TIME 0x01 -#define AXGE_RX_BULKIN_QCTRL_IFG 0x02 -#define AXGE_RX_BULKIN_QCTRL_SIZE 0x04 - -#define AXGE_RX_BULKIN_QTIMR_LOW 0x2f -#define AXGE_RX_BULKIN_QTIMR_HIGH 0x30 -#define AXGE_RX_BULKIN_QSIZE 0x31 -#define AXGE_RX_BULKIN_QIFG 0x32 #define AXGE_CLK_SELECT 0x33 #define AXGE_CLK_SELECT_BCS 0x01 @@ -118,75 +110,44 @@ #define AXGE_CLK_SELECT_ACSREQ 0x10 #define AXGE_CLK_SELECT_ULR 0x08 -#define AXGE_RXCOE_CTL 0x34 -#define AXGE_RXCOE_IP 0x01 -#define AXGE_RXCOE_TCP 0x02 -#define AXGE_RXCOE_UDP 0x04 -#define AXGE_RXCOE_ICMP 0x08 -#define AXGE_RXCOE_IGMP 0x10 -#define AXGE_RXCOE_TCPV6 0x20 -#define AXGE_RXCOE_UDPV6 0x40 -#define AXGE_RXCOE_ICMV6 0x80 - -#define AXGE_TXCOE_CTL 0x35 -#define AXGE_TXCOE_IP 0x01 -#define AXGE_TXCOE_TCP 0x02 -#define AXGE_TXCOE_UDP 0x04 -#define AXGE_TXCOE_ICMP 0x08 -#define AXGE_TXCOE_IGMP 0x10 -#define AXGE_TXCOE_TCPV6 0x20 -#define AXGE_TXCOE_UDPV6 0x40 -#define AXGE_TXCOE_ICMV6 0x80 +/* COE Rx control register */ +#define AXGE_CRCR 0x34 +#define CRCR_IP 0x01 +#define CRCR_TCP 0x02 +#define CRCR_UDP 0x04 +#define CRCR_ICMP 0x08 +#define CRCR_IGMP 0x10 +#define CRCR_TCPV6 0x20 +#define CRCR_UDPV6 0x40 +#define CRCR_ICMPV6 0x80 + +/* COE Tx control register */ +#define AXGE_CTCR 0x35 +#define CTCR_IP 0x01 +#define CTCR_TCP 0x02 +#define CTCR_UDP 0x04 +#define CTCR_ICMP 0x08 +#define CTCR_IGMP 0x10 +#define CTCR_TCPV6 0x20 +#define CTCR_UDPV6 0x40 +#define CTCR_ICMPV6 0x80 -#define AXGE_PAUSE_WATERLVL_HIGH 0x54 -#define AXGE_PAUSE_WATERLVL_LOW 0x55 +/* Pause water level high register */ +#define AXGE_PWLHR 0x54 -#define AXGE_EEP_EFUSE_CORRECT 0x00 -#define AX88179_EEPROM_MAGIC 0x17900b95 +/* Pause water level low register */ +#define AXGE_PWLLR 0x55 #define AXGE_CONFIG_IDX 0 /* config number 1 */ #define AXGE_IFACE_IDX 0 -#define AXGE_RXHDR_CRC_ERR 0x80000000 -#define AXGE_RXHDR_L4_ERR (1 << 8) -#define AXGE_RXHDR_L3_ERR (1 << 9) - -#define AXGE_RXHDR_L4_TYPE_ICMP 2 -#define AXGE_RXHDR_L4_TYPE_IGMP 3 -#define AXGE_RXHDR_L4_TYPE_TCMPV6 5 - -#define AXGE_RXHDR_L3_TYPE_IP 1 -#define AXGE_RXHDR_L3_TYPE_IPV6 2 - #define AXGE_RXHDR_L4_TYPE_MASK 0x1c +#define AXGE_RXHDR_L4CSUM_ERR 1 +#define AXGE_RXHDR_L3CSUM_ERR 2 #define AXGE_RXHDR_L4_TYPE_UDP 4 #define AXGE_RXHDR_L4_TYPE_TCP 16 -#define AXGE_RXHDR_L3CSUM_ERR 2 -#define AXGE_RXHDR_L4CSUM_ERR 1 -#define AXGE_RXHDR_CRC_ERR 0x80000000 -#define AXGE_RXHDR_DROP_ERR 0x40000000 - -struct axge_csum_hdr { - uint16_t cstatus; -#define AXGE_CSUM_HDR_L4_CSUM_ERR 0x0001 -#define AXGE_CSUM_HDR_L3_CSUM_ERR 0x0002 -#define AXGE_CSUM_HDR_L4_TYPE_UDP 0x0004 -#define AXGE_CSUM_HDR_L4_TYPE_ICMP 0x0008 -#define AXGE_CSUM_HDR_L4_TYPE_IGMP 0x000C -#define AXGE_CSUM_HDR_L4_TYPE_TCP 0x0010 -#define AXGE_CSUM_HDR_L4_TYPE_TCPV6 0x0014 -#define AXGE_CSUM_HDR_L4_TYPE_MASK 0x001C -#define AXGE_CSUM_HDR_L3_TYPE_IPV4 0x0020 -#define AXGE_CSUM_HDR_L3_TYPE_IPV6 0x0040 -#define AXGE_CSUM_HDR_VLAN_MASK 0x0700 - uint16_t len; -#define AXGE_CSUM_HDR_LEN_MASK 0x1FFF -#define AXGE_CSUM_HDR_CRC_ERR 0x2000 -#define AXGE_CSUM_HDR_MII_ERR 0x4000 -#define AXGE_CSUM_HDR_DROP 0x8000 -} __packed; - -#define AXGE_CSUM_RXBYTES(x) ((x) & AXGE_CSUM_HDR_LEN_MASK) +#define AXGE_RXHDR_CRC_ERR 0x20000000 +#define AXGE_RXHDR_DROP_ERR 0x80000000 #define GET_MII(sc) uether_getmii(&(sc)->sc_ue) Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Tue Jun 3 01:30:32 2014 (r266990) +++ stable/10/sys/dev/usb/usbdevs Tue Jun 3 01:39:55 2014 (r266991) @@ -1615,6 +1615,7 @@ product DLINK DSB650TX 0x4002 10/100 Et product DLINK DSB650TX_PNA 0x4003 1/10/100 Ethernet product DLINK DSB650TX3 0x400b 10/100 Ethernet product DLINK DSB650TX2 0x4102 10/100 Ethernet +product DLINK DUB1312 0x4a00 10/100/1000 Ethernet product DLINK DSB650 0xabc1 10/100 Ethernet product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode @@ -4092,6 +4093,7 @@ product SITECOMEU RT3072_6 0x004d RT3072 product SITECOMEU RTL8188CU_1 0x0052 RTL8188CU product SITECOMEU RTL8188CU_2 0x005c RTL8188CU product SITECOMEU RTL8192CU 0x0061 RTL8192CU +product SITECOMEU LN032 0x0072 LN-032 product SITECOMEU LN028 0x061c LN-028 product SITECOMEU WL113 0x9071 WL-113 product SITECOMEU ZD1211B 0x9075 ZD1211B From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 3 04:29:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9FB27BD4; Tue, 3 Jun 2014 04:29: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 811C42832; Tue, 3 Jun 2014 04:29: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 s534TQO9027336; Tue, 3 Jun 2014 04:29:26 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s534TQ7N027335; Tue, 3 Jun 2014 04:29:26 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201406030429.s534TQ7N027335@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 3 Jun 2014 04:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266998 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 04:29:26 -0000 Author: dchagin Date: Tue Jun 3 04:29:26 2014 New Revision: 266998 URL: http://svnweb.freebsd.org/changeset/base/266998 Log: MFC r266924: Glibc was switched to the FUTEX_WAIT_BITSET op and CLOCK_REALTIME flag has been added instead of FUTEX_WAIT to replace the FUTEX_WAIT logic which needs to do gettimeofday() calls before the futex syscall to convert the absolute timeout to a relative timeout. Before this the CLOCK_MONOTONIC used by the FUTEX_WAIT_BITSET op. When the FUTEX_CLOCK_REALTIME is specified the timeout is an absolute time, not a relative time. Rework futex_wait to handle this. On the side fix the futex leak in error case and remove useless parentheses. Properly calculate the timeout for the CLOCK_MONOTONIC case. Tested by: Hans Petter Selasky Modified: stable/10/sys/compat/linux/linux_futex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Tue Jun 3 04:29:10 2014 (r266997) +++ stable/10/sys/compat/linux/linux_futex.c Tue Jun 3 04:29:26 2014 (r266998) @@ -129,9 +129,7 @@ LIN_SDT_PROBE_DEFINE3(futex, futex_reque "struct waiting_proc *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_requeue, return, "int"); LIN_SDT_PROBE_DEFINE4(futex, futex_wait, entry, "struct futex *", - "struct waiting_proc **", "struct l_timespec *", "uint32_t"); -LIN_SDT_PROBE_DEFINE1(futex, futex_wait, copyin_error, "int"); -LIN_SDT_PROBE_DEFINE1(futex, futex_wait, itimerfix_error, "int"); + "struct waiting_proc **", "int", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_wait, sleep_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, futex_wait, return, "int"); LIN_SDT_PROBE_DEFINE3(futex, futex_atomic_op, entry, "struct thread *", @@ -145,6 +143,7 @@ LIN_SDT_PROBE_DEFINE1(futex, futex_atomi LIN_SDT_PROBE_DEFINE2(futex, linux_sys_futex, entry, "struct thread *", "struct linux_sys_futex_args *"); LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_clockswitch); +LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, itimerfix_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, copyin_error, "int"); LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, invalid_cmp_requeue_use); LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wait, "uint32_t *", @@ -555,15 +554,12 @@ futex_requeue(struct futex *f, int n, st } static int -futex_wait(struct futex *f, struct waiting_proc *wp, struct l_timespec *ts, +futex_wait(struct futex *f, struct waiting_proc *wp, int timeout_hz, uint32_t bitset) { - struct l_timespec timeout; - struct timeval tv; - int timeout_hz; int error; - LIN_SDT_PROBE4(futex, futex_wait, entry, f, wp, ts, bitset); + LIN_SDT_PROBE4(futex, futex_wait, entry, f, wp, timeout_hz, bitset); if (bitset == 0) { LIN_SDT_PROBE1(futex, futex_wait, return, EINVAL); @@ -571,30 +567,9 @@ futex_wait(struct futex *f, struct waiti } f->f_bitset = bitset; - - if (ts != NULL) { - error = copyin(ts, &timeout, sizeof(timeout)); - if (error) { - LIN_SDT_PROBE1(futex, futex_wait, copyin_error, error); - LIN_SDT_PROBE1(futex, futex_wait, return, error); - return (error); - } - TIMESPEC_TO_TIMEVAL(&tv, &timeout); - error = itimerfix(&tv); - if (error) { - LIN_SDT_PROBE1(futex, futex_wait, itimerfix_error, - error); - LIN_SDT_PROBE1(futex, futex_wait, return, error); - return (error); - } - timeout_hz = tvtohz(&tv); - } else - timeout_hz = 0; - error = futex_sleep(f, wp, timeout_hz); - if (error) { + if (error) LIN_SDT_PROBE1(futex, futex_wait, sleep_error, error); - } if (error == EWOULDBLOCK) error = ETIMEDOUT; @@ -684,6 +659,9 @@ linux_sys_futex(struct thread *td, struc struct linux_emuldata *em; struct waiting_proc *wp; struct futex *f, *f2; + struct l_timespec timeout; + struct timeval utv, ctv; + int timeout_hz; int error; uint32_t flags, val; @@ -757,7 +735,38 @@ linux_sys_futex(struct thread *td, struc return (EWOULDBLOCK); } - error = futex_wait(f, wp, args->timeout, args->val3); + if (args->timeout != NULL) { + error = copyin(args->timeout, &timeout, sizeof(timeout)); + if (error) { + LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, + error); + LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); + futex_put(f, wp); + return (error); + } + TIMESPEC_TO_TIMEVAL(&utv, &timeout); + error = itimerfix(&utv); + if (error) { + LIN_SDT_PROBE1(futex, linux_sys_futex, itimerfix_error, + error); + LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); + futex_put(f, wp); + return (error); + } + if (clockrt) { + microtime(&ctv); + timevalsub(&utv, &ctv); + } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { + microuptime(&ctv); + timevalsub(&utv, &ctv); + } + if (utv.tv_sec < 0) + timevalclear(&utv); + timeout_hz = tvtohz(&utv); + } else + timeout_hz = 0; + + error = futex_wait(f, wp, timeout_hz, args->val3); break; case LINUX_FUTEX_WAKE: From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 3 04:31:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 34A4FD18; Tue, 3 Jun 2014 04:31: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 218A328B1; Tue, 3 Jun 2014 04:31: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 s534ViL7030773; Tue, 3 Jun 2014 04:31:44 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s534Vh4m030769; Tue, 3 Jun 2014 04:31:43 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201406030431.s534Vh4m030769@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 3 Jun 2014 04:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266999 - in stable/10/sys: amd64/linux32 i386/linux kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 04:31:44 -0000 Author: dchagin Date: Tue Jun 3 04:31:42 2014 New Revision: 266999 URL: http://svnweb.freebsd.org/changeset/base/266999 Log: MFC r266925: To allow to run the interpreter itself add a new ELF branding type. Allow Linux ABI to run ELF interpreter. Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/i386/linux/linux_sysvec.c stable/10/sys/kern/imgact_elf.c stable/10/sys/sys/imgact_elf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Tue Jun 3 04:29:26 2014 (r266998) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Tue Jun 3 04:31:42 2014 (r266999) @@ -1083,7 +1083,7 @@ static Elf32_Brandinfo linux_brand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1095,7 +1095,7 @@ static Elf32_Brandinfo linux_glibc2brand .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP }; Elf32_Brandinfo *linux_brandlist[] = { Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Tue Jun 3 04:29:26 2014 (r266998) +++ stable/10/sys/i386/linux/linux_sysvec.c Tue Jun 3 04:31:42 2014 (r266999) @@ -1058,7 +1058,7 @@ static Elf32_Brandinfo linux_brand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1070,7 +1070,7 @@ static Elf32_Brandinfo linux_glibc2brand .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP }; Elf32_Brandinfo *linux_brandlist[] = { Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Tue Jun 3 04:29:26 2014 (r266998) +++ stable/10/sys/kern/imgact_elf.c Tue Jun 3 04:31:42 2014 (r266999) @@ -261,6 +261,8 @@ __elfN(get_brandinfo)(struct image_param { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi; + const char *fname_name, *interp_brand_name; + int fname_len, interp_len; boolean_t ret; int i; @@ -311,6 +313,33 @@ __elfN(get_brandinfo)(struct image_param } } + /* Some ABI allows to run the interpreter itself. */ + for (i = 0; i < MAX_BRANDS; i++) { + bi = elf_brand_list[i]; + if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) + continue; + if (hdr->e_machine != bi->machine || + (bi->flags & BI_CAN_EXEC_INTERP) == 0) + continue; + /* + * Compare the interpreter name not the path to allow run it + * from everywhere. + */ + interp_brand_name = strrchr(bi->interp_path, '/'); + if (interp_brand_name == NULL) + interp_brand_name = bi->interp_path; + interp_len = strlen(interp_brand_name); + fname_name = strrchr(imgp->args->fname, '/'); + if (fname_name == NULL) + fname_name = imgp->args->fname; + fname_len = strlen(fname_name); + if (fname_len < interp_len) + continue; + ret = strncmp(fname_name, interp_brand_name, interp_len); + if (ret == 0) + return (bi); + } + /* Lacking a recognized interpreter, try the default brand */ for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; Modified: stable/10/sys/sys/imgact_elf.h ============================================================================== --- stable/10/sys/sys/imgact_elf.h Tue Jun 3 04:29:26 2014 (r266998) +++ stable/10/sys/sys/imgact_elf.h Tue Jun 3 04:31:42 2014 (r266999) @@ -77,6 +77,7 @@ typedef struct { #define BI_CAN_EXEC_DYN 0x0001 #define BI_BRAND_NOTE 0x0002 /* May have note.ABI-tag section. */ #define BI_BRAND_NOTE_MANDATORY 0x0004 /* Must have note.ABI-tag section. */ +#define BI_CAN_EXEC_INTERP 0x0008 /* Allow to run interpreter itself. */ } __ElfN(Brandinfo); __ElfType(Auxargs); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 3 06:48:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AD6ECF62; Tue, 3 Jun 2014 06:48: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 7FA1823BD; Tue, 3 Jun 2014 06:48: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 s536mai0090918; Tue, 3 Jun 2014 06:48:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s536mZ6K090915; Tue, 3 Jun 2014 06:48:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406030648.s536mZ6K090915@svn.freebsd.org> From: Alexander Motin Date: Tue, 3 Jun 2014 06:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267002 - in stable/10: sys/dev/pci usr.sbin/pciconf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 06:48:36 -0000 Author: mav Date: Tue Jun 3 06:48:35 2014 New Revision: 267002 URL: http://svnweb.freebsd.org/changeset/base/267002 Log: MFC r266468: Add IOMMU PCI subclass, found on Tyan S8236 motherboard. Submitted by: Dmitry Luhtionov Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pcireg.h stable/10/usr.sbin/pciconf/pciconf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Tue Jun 3 05:19:10 2014 (r267001) +++ stable/10/sys/dev/pci/pci.c Tue Jun 3 06:48:35 2014 (r267002) @@ -3782,6 +3782,7 @@ static const struct {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, 1, "realtime clock"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, 1, "PCI hot-plug controller"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, 1, "SD host controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_IOMMU, 1, "IOMMU"}, {PCIC_INPUTDEV, -1, 1, "input device"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, 1, "keyboard"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,1, "digitizer"}, Modified: stable/10/sys/dev/pci/pcireg.h ============================================================================== --- stable/10/sys/dev/pci/pcireg.h Tue Jun 3 05:19:10 2014 (r267001) +++ stable/10/sys/dev/pci/pcireg.h Tue Jun 3 06:48:35 2014 (r267002) @@ -361,6 +361,7 @@ #define PCIS_BASEPERIPH_RTC 0x03 #define PCIS_BASEPERIPH_PCIHOT 0x04 #define PCIS_BASEPERIPH_SDHC 0x05 +#define PCIS_BASEPERIPH_IOMMU 0x06 #define PCIS_BASEPERIPH_OTHER 0x80 #define PCIC_INPUTDEV 0x09 Modified: stable/10/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/10/usr.sbin/pciconf/pciconf.c Tue Jun 3 05:19:10 2014 (r267001) +++ stable/10/usr.sbin/pciconf/pciconf.c Tue Jun 3 06:48:35 2014 (r267002) @@ -466,6 +466,7 @@ static struct {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, "realtime clock"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, "SD host controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_IOMMU, "IOMMU"}, {PCIC_INPUTDEV, -1, "input device"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"}, From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 3 14:50:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9C942AEB; Tue, 3 Jun 2014 14:50: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 899EB237A; Tue, 3 Jun 2014 14:50: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 s53EopUK010920; Tue, 3 Jun 2014 14:50:51 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53Eoptr010919; Tue, 3 Jun 2014 14:50:51 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201406031450.s53Eoptr010919@svn.freebsd.org> From: Craig Rodrigues Date: Tue, 3 Jun 2014 14:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267010 - stable/10/sys/boot/forth X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 14:50:51 -0000 Author: rodrigc Date: Tue Jun 3 14:50:51 2014 New Revision: 267010 URL: http://svnweb.freebsd.org/changeset/base/267010 Log: MFC r266938: Allow customization of the brand displayed in the boot menu. If the user specifies in /boot/loader.conf: loader_brand="mycustom-brand" Then "mycustom-brand" will be executed instead of "fbsd-logo". Submitted by: alfred Obtained from: FreeNAS Modified: stable/10/sys/boot/forth/brand.4th Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/brand.4th ============================================================================== --- stable/10/sys/boot/forth/brand.4th Tue Jun 3 14:46:50 2014 (r267009) +++ stable/10/sys/boot/forth/brand.4th Tue Jun 3 14:50:51 2014 (r267010) @@ -56,6 +56,8 @@ variable brandY \ NAME DESCRIPTION \ fbsd FreeBSD logo \ +\ NOTE: Setting `loader_brand' to the value of an existing function +\ (such as "mycustom-brand") will cause that symbol to be executed. \ NOTE: Setting `loader_brand' to an undefined value (such as "none") will \ prevent any brand from being drawn. \ @@ -87,5 +89,14 @@ variable brandY 2drop exit then + \ if it refers to a raw symbol then run that function + sfind if + brandX @ brandY @ + 2 roll + execute + else + drop + then + 2drop ; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 3 19:02:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CB470E91; Tue, 3 Jun 2014 19:02: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 B51482B5F; Tue, 3 Jun 2014 19:02: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 s53J2IqO027237; Tue, 3 Jun 2014 19:02:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53J2IH5027236; Tue, 3 Jun 2014 19:02:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406031902.s53J2IH5027236@svn.freebsd.org> From: Xin LI Date: Tue, 3 Jun 2014 19:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267014 - stable/10/contrib/openpam/lib/libpam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 19:02:19 -0000 Author: delphij Date: Tue Jun 3 19:02:18 2014 New Revision: 267014 URL: http://svnweb.freebsd.org/changeset/base/267014 Log: Fix incorrect error handling in PAM policy parser. [SA-14:13] Modified: stable/10/contrib/openpam/lib/libpam/openpam_configure.c Modified: stable/10/contrib/openpam/lib/libpam/openpam_configure.c ============================================================================== --- stable/10/contrib/openpam/lib/libpam/openpam_configure.c Tue Jun 3 19:01:38 2014 (r267013) +++ stable/10/contrib/openpam/lib/libpam/openpam_configure.c Tue Jun 3 19:02:18 2014 (r267014) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2001-2003 Networks Associates Technology, Inc. - * Copyright (c) 2004-2012 Dag-Erling Smørgrav + * Copyright (c) 2004-2014 Dag-Erling Smørgrav * All rights reserved. * * This software was developed for the FreeBSD Project by ThinkSec AS and @@ -193,6 +193,7 @@ openpam_parse_chain(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "%s(%d): missing or invalid facility", filename, lineno); + errno = EINVAL; goto fail; } if (facility != fclt && facility != PAM_FACILITY_ANY) { @@ -208,18 +209,28 @@ openpam_parse_chain(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "%s(%d): missing or invalid service name", filename, lineno); + errno = EINVAL; goto fail; } if (wordv[i] != NULL) { openpam_log(PAM_LOG_ERROR, "%s(%d): garbage at end of line", filename, lineno); + errno = EINVAL; goto fail; } ret = openpam_load_chain(pamh, servicename, fclt); FREEV(wordc, wordv); - if (ret < 0) + if (ret < 0) { + /* + * Bogus errno, but this ensures that the + * outer loop does not just ignore the + * error and keep searching. + */ + if (errno == ENOENT) + errno = EINVAL; goto fail; + } continue; } @@ -229,6 +240,7 @@ openpam_parse_chain(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "%s(%d): missing or invalid control flag", filename, lineno); + errno = EINVAL; goto fail; } @@ -238,6 +250,7 @@ openpam_parse_chain(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "%s(%d): missing or invalid module name", filename, lineno); + errno = EINVAL; goto fail; } @@ -247,8 +260,11 @@ openpam_parse_chain(pam_handle_t *pamh, this->flag = ctlf; /* load module */ - if ((this->module = openpam_load_module(modulename)) == NULL) + if ((this->module = openpam_load_module(modulename)) == NULL) { + if (errno == ENOENT) + errno = ENOEXEC; goto fail; + } /* * The remaining items in wordv are the module's @@ -281,7 +297,11 @@ openpam_parse_chain(pam_handle_t *pamh, * The loop ended because openpam_readword() returned NULL, which * can happen for four different reasons: an I/O error (ferror(f) * is true), a memory allocation failure (ferror(f) is false, - * errno is non-zero) + * feof(f) is false, errno is non-zero), the file ended with an + * unterminated quote or backslash escape (ferror(f) is false, + * feof(f) is true, errno is non-zero), or the end of the file was + * reached without error (ferror(f) is false, feof(f) is true, + * errno is zero). */ if (ferror(f) || errno != 0) goto syserr; @@ -402,6 +422,9 @@ openpam_load_chain(pam_handle_t *pamh, } ret = openpam_load_file(pamh, service, facility, filename, style); + /* success */ + if (ret > 0) + RETURNN(ret); /* the file exists, but an error occurred */ if (ret == -1 && errno != ENOENT) RETURNN(ret); @@ -411,7 +434,8 @@ openpam_load_chain(pam_handle_t *pamh, } /* no hit */ - RETURNN(0); + errno = ENOENT; + RETURNN(-1); } /* @@ -432,8 +456,10 @@ openpam_configure(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "invalid service name"); RETURNC(PAM_SYSTEM_ERR); } - if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0) - goto load_err; + if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0) { + if (errno != ENOENT) + goto load_err; + } for (fclt = 0; fclt < PAM_NUM_FACILITIES; ++fclt) { if (pamh->chains[fclt] != NULL) continue; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 3 19:06:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 87A618EA; Tue, 3 Jun 2014 19:06: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 74B9A2BBA; Tue, 3 Jun 2014 19:06: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 s53J6mm1028460; Tue, 3 Jun 2014 19:06:48 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53J6mxx028458; Tue, 3 Jun 2014 19:06:48 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201406031906.s53J6mxx028458@svn.freebsd.org> From: Cy Schubert Date: Tue, 3 Jun 2014 19:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267020 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 19:06:48 -0000 Author: cy Date: Tue Jun 3 19:06:47 2014 New Revision: 267020 URL: http://svnweb.freebsd.org/changeset/base/267020 Log: MFC r266605. Move mutex creation from ipf_log_soft_init() to ipf_log_soft_create() to be consistent with mutex destruction in ipf_log_soft_destroy(). As a result mutex destruction in ipf_log_soft_fini() is redundant. Approved by: glebius (mentor) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_log.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_log.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_log.c Tue Jun 3 19:03:23 2014 (r267019) +++ stable/10/sys/contrib/ipfilter/netinet/ip_log.c Tue Jun 3 19:06:47 2014 (r267020) @@ -214,6 +214,7 @@ ipf_log_soft_create(softc) ipf_main_softc_t *softc; { ipf_log_softc_t *softl; + int i; KMALLOC(softl, ipf_log_softc_t *); if (softl == NULL) @@ -234,6 +235,10 @@ ipf_log_soft_create(softc) return NULL; } + for (i = IPL_LOGMAX; i >= 0; i--) { + MUTEX_INIT(&softl->ipl_mutex[i], "ipf log mutex"); + } + softl->ipl_suppress = 1; softl->ipl_logall = 0; softl->ipl_log_init = 0; @@ -267,13 +272,6 @@ ipf_log_soft_init(softc, arg) softl->iplog_ss[i].read_waiter = 0; softl->iplog_ss[i].state = 0; # endif -# if defined(linux) && defined(_KERNEL) - init_waitqueue_head(softl->iplh_linux + i); -# endif -# if SOLARIS && defined(_KERNEL) - cv_init(&softl->ipl_wait[i], NULL, CV_DRIVER, NULL); -# endif - MUTEX_INIT(&softl->ipl_mutex[i], "ipf log mutex"); } @@ -324,7 +322,7 @@ ipf_log_soft_fini(softc, arg) # endif MUTEX_ENTER(&softl->ipl_mutex[i]); } - MUTEX_DESTROY(&softl->ipl_mutex[i]); + MUTEX_EXIT(&softl->ipl_mutex[i]); } return 0; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 3 19:25:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9B46E8ED; Tue, 3 Jun 2014 19:25: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 7B6122DA3; Tue, 3 Jun 2014 19:25: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 s53JPdTB037651; Tue, 3 Jun 2014 19:25:39 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53JPdOg037650; Tue, 3 Jun 2014 19:25:39 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201406031925.s53JPdOg037650@svn.freebsd.org> From: Christian Brueffer Date: Tue, 3 Jun 2014 19:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267022 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 19:25:39 -0000 Author: brueffer Date: Tue Jun 3 19:25:39 2014 New Revision: 267022 URL: http://svnweb.freebsd.org/changeset/base/267022 Log: MFC: r266709 Language cleanup. Reviewed by: mav, bcr, wblock Modified: stable/10/share/man/man4/attimer.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/attimer.4 ============================================================================== --- stable/10/share/man/man4/attimer.4 Tue Jun 3 19:24:53 2014 (r267021) +++ stable/10/share/man/man4/attimer.4 Tue Jun 3 19:25:39 2014 (r267022) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2010 +.Dd May 26, 2014 .Dt ATTIMER 4 .Os .Sh NAME @@ -37,38 +37,48 @@ The following tunables are settable from .Xr loader 8 : .Bl -ohang .It Va hint.attimer. Ns Ar X Ns Va .clock -controls event timers functionality support. Setting to 0, disables it. -Default value is 1. +controls support for the event timer functionality. +Setting this value to +.Dv 0 +disables it. +The default value is +.Dv 1 . .It Va hint.attimer. Ns Ar X Ns Va .timecounter -controls time counter functionality support. Setting to 0, disables it. -Default value is 1. +controls support for the time counter functionality. +Setting this value to +.Dv 0 +disables it. +The default value is +.Dv 1 . .It Va hw.i8254.freq -allows to override default counter frequency. -The same value is also available in run-time via +allows overriding the default counter frequency. +The same value is also available at run-time via the .Va machdep.i8254_freq sysctl. .El .Sh DESCRIPTION This driver uses i8254 Programmable Interval Timer (AT Timer) hardware -to supply kernel with one time counter and one event timer, and generate -sound tones for system speaker. +to supply the kernel with one timecounter and one event timer, and to generate +sound tones for the system speaker. This hardware includes three channels. -Each channel includes 16bit counter, counting down with known, +Each channel includes a 16 bit counter which decreases with a known, platform-dependent frequency. Counters can operate in several different modes, including periodic and one-shot. -Output of each channel has platform-defined wiring: one channel is wired +The output of each channel has platform-defined wiring: one channel is wired to the interrupt controller and may be used as event timer, one channel is -wired to speaker and used to generate sound tones, and one timer is reserved +wired to the speaker and used to generate sound tones, and one timer is reserved for platform purposes. .Pp -Driver uses single hardware channel to provide both time counter and event +The +.Nm +driver uses a single hardware channel to provide both time counter and event timer functionality. -To make it possible, respective counter must be running in periodic more. -As result, one-shot event timer mode supported only when time counter +To make this possible, the respective counter must be running in periodic mode. +As a result, the one-shot event timer mode is supported only when time counter functionality is disabled. .Pp -Event timer provided by the driver is irrelevant to CPU power states. +The event timer provided by the driver is irrelevant to CPU power states. .Sh SEE ALSO .Xr apic 4 , .Xr atrtc 4 , From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 03:03:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 161C0B9A; Wed, 4 Jun 2014 03:03: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 02EED2877; Wed, 4 Jun 2014 03:03: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 s5433YEf094980; Wed, 4 Jun 2014 03:03:34 GMT (envelope-from lwhsu@svn.freebsd.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5433YHn094979; Wed, 4 Jun 2014 03:03:34 GMT (envelope-from lwhsu@svn.freebsd.org) Message-Id: <201406040303.s5433YHn094979@svn.freebsd.org> From: Li-Wen Hsu Date: Wed, 4 Jun 2014 03:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267036 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 03:03:35 -0000 Author: lwhsu (ports committer) Date: Wed Jun 4 03:03:34 2014 New Revision: 267036 URL: http://svnweb.freebsd.org/changeset/base/267036 Log: MFC r266335: Add axge(4) to LINT Approved by: kevlo Modified: stable/10/sys/conf/NOTES Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Wed Jun 4 03:02:49 2014 (r267035) +++ stable/10/sys/conf/NOTES Wed Jun 4 03:03:34 2014 (r267036) @@ -2695,6 +2695,8 @@ device aue # ASIX Electronics AX88172 USB 2.0 ethernet driver. Used in the # LinkSys USB200M and various other adapters. device axe +# ASIX Electronics AX88178A/AX88179 USB 2.0/3.0 gigabit ethernet driver. +device axge # # Devices which communicate using Ethernet over USB, particularly From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 06:15:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4CDF4549; Wed, 4 Jun 2014 06:15: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 38B67279A; Wed, 4 Jun 2014 06:15: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 s546Fk1i004398; Wed, 4 Jun 2014 06:15:46 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s546FknI004397; Wed, 4 Jun 2014 06:15:46 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406040615.s546FknI004397@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 4 Jun 2014 06:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267039 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 06:15:46 -0000 Author: hselasky Date: Wed Jun 4 06:15:45 2014 New Revision: 267039 URL: http://svnweb.freebsd.org/changeset/base/267039 Log: MFC r266833: Add some more spinlocks to protect the state of the USB transfer queue. Rename some functions to indicate locking requirements. Modified: stable/10/sys/dev/usb/controller/dwc_otg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- stable/10/sys/dev/usb/controller/dwc_otg.c Wed Jun 4 05:04:15 2014 (r267038) +++ stable/10/sys/dev/usb/controller/dwc_otg.c Wed Jun 4 06:15:45 2014 (r267039) @@ -142,7 +142,7 @@ static void dwc_otg_device_done(struct u static void dwc_otg_do_poll(struct usb_bus *); static void dwc_otg_standard_done(struct usb_xfer *); static void dwc_otg_root_intr(struct dwc_otg_softc *); -static void dwc_otg_interrupt_poll(struct dwc_otg_softc *); +static void dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *); static void dwc_otg_host_channel_disable(struct dwc_otg_softc *, uint8_t); /* @@ -2245,7 +2245,7 @@ done: } static uint8_t -dwc_otg_xfer_do_complete(struct dwc_otg_softc *sc, struct usb_xfer *xfer) +dwc_otg_xfer_do_complete_locked(struct dwc_otg_softc *sc, struct usb_xfer *xfer) { struct dwc_otg_td *td; @@ -2349,7 +2349,7 @@ dwc_otg_host_channel_disable(struct dwc_ } static uint8_t -dwc_otg_update_host_transfer_schedule(struct dwc_otg_softc *sc) +dwc_otg_update_host_transfer_schedule_locked(struct dwc_otg_softc *sc) { TAILQ_HEAD(, usb_xfer) head; struct usb_xfer *xfer; @@ -2519,7 +2519,7 @@ dwc_otg_update_host_transfer_schedule(st } static void -dwc_otg_interrupt_poll(struct dwc_otg_softc *sc) +dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *sc) { struct usb_xfer *xfer; uint32_t temp; @@ -2620,19 +2620,19 @@ repeat: if (sc->sc_flags.status_device_mode == 0 && sc->sc_xfer_complete == 0) { /* update host transfer schedule, so that new transfers can be issued */ - if (dwc_otg_update_host_transfer_schedule(sc)) + if (dwc_otg_update_host_transfer_schedule_locked(sc)) goto repeat; } } static void -dwc_otg_interrupt_complete(struct dwc_otg_softc *sc) +dwc_otg_interrupt_complete_locked(struct dwc_otg_softc *sc) { struct usb_xfer *xfer; repeat: /* scan for completion events */ TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (dwc_otg_xfer_do_complete(sc, xfer)) + if (dwc_otg_xfer_do_complete_locked(sc, xfer)) goto repeat; } } @@ -2672,6 +2672,8 @@ dwc_otg_filter_interrupt(void *arg) int retval = FILTER_HANDLED; uint32_t status; + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* read and clear interrupt status */ status = DWC_OTG_READ_4(sc, DOTG_GINTSTS); @@ -2696,10 +2698,8 @@ dwc_otg_filter_interrupt(void *arg) } } - USB_BUS_SPIN_LOCK(&sc->sc_bus); - /* poll FIFOs, if any */ - dwc_otg_interrupt_poll(sc); + dwc_otg_interrupt_poll_locked(sc); if (sc->sc_xfer_complete != 0) retval = FILTER_SCHEDULE_THREAD; @@ -2896,15 +2896,14 @@ dwc_otg_interrupt(void *arg) sc->sc_xfer_complete = 0; /* complete FIFOs, if any */ - dwc_otg_interrupt_complete(sc); + dwc_otg_interrupt_complete_locked(sc); if (sc->sc_flags.status_device_mode == 0) { /* update host transfer schedule, so that new transfers can be issued */ - if (dwc_otg_update_host_transfer_schedule(sc)) - dwc_otg_interrupt_poll(sc); + if (dwc_otg_update_host_transfer_schedule_locked(sc)) + dwc_otg_interrupt_poll_locked(sc); } } - USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -3269,12 +3268,13 @@ dwc_otg_start_standard_chain(struct usb_ * endpoint interrupts. Else wait for SOF interrupt in host * mode. */ + USB_BUS_SPIN_LOCK(&sc->sc_bus); + if (sc->sc_flags.status_device_mode != 0) { dwc_otg_xfer_do_fifo(sc, xfer); - if (dwc_otg_xfer_do_complete(sc, xfer)) - return; + if (dwc_otg_xfer_do_complete_locked(sc, xfer)) + goto done; } - USB_BUS_SPIN_LOCK(&sc->sc_bus); /* put transfer on interrupt queue */ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); @@ -3451,6 +3451,8 @@ dwc_otg_device_done(struct usb_xfer *xfe DPRINTFN(9, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { /* Interrupts are cleared by the interrupt handler */ } else { @@ -3465,6 +3467,8 @@ dwc_otg_device_done(struct usb_xfer *xfe } /* dequeue transfer and start next transfer */ usbd_transfer_done(xfer, error); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -3492,6 +3496,8 @@ dwc_otg_set_stall(struct usb_device *ude sc = DWC_OTG_BUS2SC(udev->bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* get endpoint address */ ep_no = ep->edesc->bEndpointAddress; @@ -3520,14 +3526,15 @@ dwc_otg_set_stall(struct usb_device *ude /* dump data */ dwc_otg_common_rx_ack(sc); /* poll interrupt */ - dwc_otg_interrupt_poll(sc); - dwc_otg_interrupt_complete(sc); + dwc_otg_interrupt_poll_locked(sc); + dwc_otg_interrupt_complete_locked(sc); } } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void -dwc_otg_clear_stall_sub(struct dwc_otg_softc *sc, uint32_t mps, +dwc_otg_clear_stall_sub_locked(struct dwc_otg_softc *sc, uint32_t mps, uint8_t ep_no, uint8_t ep_type, uint8_t ep_dir) { uint32_t reg; @@ -3585,8 +3592,8 @@ dwc_otg_clear_stall_sub(struct dwc_otg_s } /* poll interrupt */ - dwc_otg_interrupt_poll(sc); - dwc_otg_interrupt_complete(sc); + dwc_otg_interrupt_poll_locked(sc); + dwc_otg_interrupt_complete_locked(sc); } static void @@ -3607,15 +3614,19 @@ dwc_otg_clear_stall(struct usb_device *u /* get softc */ sc = DWC_OTG_BUS2SC(udev->bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* get endpoint descriptor */ ed = ep->edesc; /* reset endpoint */ - dwc_otg_clear_stall_sub(sc, + dwc_otg_clear_stall_sub_locked(sc, UGETW(ed->wMaxPacketSize), (ed->bEndpointAddress & UE_ADDR), (ed->bmAttributes & UE_XFERTYPE), (ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT))); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -3886,12 +3897,12 @@ dwc_otg_do_poll(struct usb_bus *bus) USB_BUS_LOCK(&sc->sc_bus); USB_BUS_SPIN_LOCK(&sc->sc_bus); - dwc_otg_interrupt_poll(sc); - dwc_otg_interrupt_complete(sc); + dwc_otg_interrupt_poll_locked(sc); + dwc_otg_interrupt_complete_locked(sc); if (sc->sc_flags.status_device_mode == 0) { /* update host transfer schedule, so that new transfers can be issued */ - if (dwc_otg_update_host_transfer_schedule(sc)) - dwc_otg_interrupt_poll(sc); + if (dwc_otg_update_host_transfer_schedule_locked(sc)) + dwc_otg_interrupt_poll_locked(sc); } USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 06:21:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 94642894; Wed, 4 Jun 2014 06:21: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 67997285E; Wed, 4 Jun 2014 06:21: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 s546Lt8m008335; Wed, 4 Jun 2014 06:21:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s546LtSA008332; Wed, 4 Jun 2014 06:21:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201406040621.s546LtSA008332@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 4 Jun 2014 06:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267040 - stable/10/sys/powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 06:21:55 -0000 Author: nwhitehorn Date: Wed Jun 4 06:21:54 2014 New Revision: 267040 URL: http://svnweb.freebsd.org/changeset/base/267040 Log: MFC r266778: Repair nested signal handling on PowerPC. The signal trampoline code was not allocating space for the parameter save area in the stack frame. If the compiler chose to save the argument to the signal handler on the stack, it would overwrite the first 32 bits of the sigaction struct with it, corrupting it for a subsequent invocation. PR: powerpc/183040 Modified: stable/10/sys/powerpc/powerpc/sigcode32.S stable/10/sys/powerpc/powerpc/sigcode64.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/powerpc/sigcode32.S ============================================================================== --- stable/10/sys/powerpc/powerpc/sigcode32.S Wed Jun 4 06:15:45 2014 (r267039) +++ stable/10/sys/powerpc/powerpc/sigcode32.S Wed Jun 4 06:21:54 2014 (r267040) @@ -45,9 +45,9 @@ */ .globl CNAME(sigcode32),CNAME(szsigcode32) CNAME(sigcode32): - addi 1,1,-16 /* reserved space for callee */ + addi 1,1,-20 /* reserved space for callee */ blrl - addi 3,1,16+SF_UC /* restore sp, and get &frame->sf_uc */ + addi 3,1,20+SF_UC /* restore sp, and get &frame->sf_uc */ li 0,SYS_sigreturn sc /* sigreturn(scp) */ li 0,SYS_exit Modified: stable/10/sys/powerpc/powerpc/sigcode64.S ============================================================================== --- stable/10/sys/powerpc/powerpc/sigcode64.S Wed Jun 4 06:15:45 2014 (r267039) +++ stable/10/sys/powerpc/powerpc/sigcode64.S Wed Jun 4 06:21:54 2014 (r267040) @@ -45,7 +45,7 @@ */ .globl CNAME(sigcode64),CNAME(szsigcode64) CNAME(sigcode64): - addi 1,1,-48 /* reserved space for callee */ + addi 1,1,-112 /* reserved space for callee */ mflr 2 /* resolve function descriptor */ ld 0,0(2) ld 2,8(2) @@ -53,7 +53,7 @@ CNAME(sigcode64): blrl - addi 3,1,48+SF_UC /* restore sp, and get &frame->sf_uc */ + addi 3,1,112+SF_UC /* restore sp, and get &frame->sf_uc */ li 0,SYS_sigreturn sc /* sigreturn(scp) */ li 0,SYS_exit From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 09:44:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 277F9C4A; Wed, 4 Jun 2014 09:44: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 13F872BC7; Wed, 4 Jun 2014 09:44: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 s549i5Xn098706; Wed, 4 Jun 2014 09:44:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s549i5NA098705; Wed, 4 Jun 2014 09:44:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406040944.s549i5NA098705@svn.freebsd.org> From: Marius Strobl Date: Wed, 4 Jun 2014 09:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267042 - stable/10/sys/dev/drm2/radeon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 09:44:06 -0000 Author: marius Date: Wed Jun 4 09:44:05 2014 New Revision: 267042 URL: http://svnweb.freebsd.org/changeset/base/267042 Log: MFC: r266792 Fix DMA handling in radeon_dummy_page_init(): - Based on actual usage and on what Linux does, dummy_page.addr should contain the physical bus address of the dummy page rather than its virtual one. As a side-effect, correcting this bug fixes compilation with PAE support enabled by getting rid of an inappropriate cast. - Also based on actual usage of dummy_page.addr, theoretically Radeon devices could do a maximum of 44-bit DMA. In reality, though, it is more likely that they only support 32-bit DMA, at least that is what radeon_gart_table_ram_alloc() sets up for, too. However, passing ~0 to drm_pci_alloc() as maxaddr parameter translates to 64-bit DMA on amd64/64-bit machines. Thus, use BUS_SPACE_MAXSIZE_32BIT instead, which the existing 32-bit DMA limits within the drm2 code spelled as 0xFFFFFFFF should also be changed to. Reviewed by: dumbbell Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sys/dev/drm2/radeon/radeon_device.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/radeon/radeon_device.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_device.c Wed Jun 4 09:18:13 2014 (r267041) +++ stable/10/sys/dev/drm2/radeon/radeon_device.c Wed Jun 4 09:44:05 2014 (r267042) @@ -548,10 +548,10 @@ int radeon_dummy_page_init(struct radeon if (rdev->dummy_page.dmah) return 0; rdev->dummy_page.dmah = drm_pci_alloc(rdev->ddev, - PAGE_SIZE, PAGE_SIZE, ~0); + PAGE_SIZE, PAGE_SIZE, BUS_SPACE_MAXSIZE_32BIT); if (rdev->dummy_page.dmah == NULL) return -ENOMEM; - rdev->dummy_page.addr = (dma_addr_t)rdev->dummy_page.dmah->vaddr; + rdev->dummy_page.addr = rdev->dummy_page.dmah->busaddr; return 0; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 09:54:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3D518F78; Wed, 4 Jun 2014 09:54: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 101192CCC; Wed, 4 Jun 2014 09:54: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 s549s15I003096; Wed, 4 Jun 2014 09:54:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s549s1c2003095; Wed, 4 Jun 2014 09:54:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406040954.s549s1c2003095@svn.freebsd.org> From: Marius Strobl Date: Wed, 4 Jun 2014 09:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267043 - stable/10/sys/dev/sound/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 09:54:02 -0000 Author: marius Date: Wed Jun 4 09:54:01 2014 New Revision: 267043 URL: http://svnweb.freebsd.org/changeset/base/267043 Log: MFC: r266793, r266799, r266808 - Fix compilation with PAE support enabled by merging r233362 and, thus, doing away with the unnecessary uint8_t pointer casting. physical addresses. - Nuke the unused softc of emujoy(4). - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sys/dev/sound/pci/emu10k1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pci/emu10k1.c ============================================================================== --- stable/10/sys/dev/sound/pci/emu10k1.c Wed Jun 4 09:44:05 2014 (r267042) +++ stable/10/sys/dev/sound/pci/emu10k1.c Wed Jun 4 09:54:01 2014 (r267043) @@ -1378,7 +1378,7 @@ emu_memalloc(struct sc_info *sc, u_int32 ofs = 0; for (idx = start; idx < start + blksz; idx++) { mem->bmap[idx >> 3] |= 1 << (idx & 7); - tmp = (u_int32_t)(u_long)((u_int8_t *)blk->buf_addr + ofs); + tmp = (uint32_t)(blk->buf_addr + ofs); #ifdef EMUDEBUG printf("pte[%d] -> %x phys, %x virt\n", idx, tmp, ((u_int32_t)buf) + ofs); @@ -2182,7 +2182,7 @@ static device_method_t emu_methods[] = { DEVMETHOD(device_attach, emu_pci_attach), DEVMETHOD(device_detach, emu_pci_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t emu_driver = { @@ -2191,7 +2191,7 @@ static driver_t emu_driver = { PCM_SOFTC_SIZE, }; -DRIVER_MODULE(snd_emu10k1, pci, emu_driver, pcm_devclass, 0, 0); +DRIVER_MODULE(snd_emu10k1, pci, emu_driver, pcm_devclass, NULL, NULL); MODULE_DEPEND(snd_emu10k1, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(snd_emu10k1, 1); MODULE_DEPEND(snd_emu10k1, midi, 1, 1, 1); @@ -2220,12 +2220,14 @@ emujoy_pci_probe(device_t dev) static int emujoy_pci_attach(device_t dev) { + return 0; } static int emujoy_pci_detach(device_t dev) { + return 0; } @@ -2234,16 +2236,15 @@ static device_method_t emujoy_methods[] DEVMETHOD(device_attach, emujoy_pci_attach), DEVMETHOD(device_detach, emujoy_pci_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t emujoy_driver = { "emujoy", emujoy_methods, - 8, + 1 /* no softc */ }; static devclass_t emujoy_devclass; -DRIVER_MODULE(emujoy, pci, emujoy_driver, emujoy_devclass, 0, 0); - +DRIVER_MODULE(emujoy, pci, emujoy_driver, emujoy_devclass, NULL, NULL); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 10:33:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 66633E37; Wed, 4 Jun 2014 10:33: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 52E802077; Wed, 4 Jun 2014 10:33:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54AXVfc021701; Wed, 4 Jun 2014 10:33:31 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54AXVP1021700; Wed, 4 Jun 2014 10:33:31 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406041033.s54AXVP1021700@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 4 Jun 2014 10:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267045 - stable/10/usr.sbin/usbdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 10:33:31 -0000 Author: hselasky Date: Wed Jun 4 10:33:30 2014 New Revision: 267045 URL: http://svnweb.freebsd.org/changeset/base/267045 Log: MFC r266798 and r266803: Fix for big-endian architectures. Modified: stable/10/usr.sbin/usbdump/usbdump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/usbdump/usbdump.c ============================================================================== --- stable/10/usr.sbin/usbdump/usbdump.c Wed Jun 4 10:29:01 2014 (r267044) +++ stable/10/usr.sbin/usbdump/usbdump.c Wed Jun 4 10:33:30 2014 (r267045) @@ -472,7 +472,6 @@ print_apacket(const struct header_32 *hd */ up->up_totlen = le32toh(up->up_totlen); up->up_busunit = le32toh(up->up_busunit); - up->up_address = le32toh(up->up_address); up->up_flags = le32toh(up->up_flags); up->up_status = le32toh(up->up_status); up->up_error = le32toh(up->up_error); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 10:40:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 100565E8; Wed, 4 Jun 2014 10:40: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 F066E20F8; Wed, 4 Jun 2014 10:40:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54AehgQ025104; Wed, 4 Jun 2014 10:40:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54AehEl025103; Wed, 4 Jun 2014 10:40:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406041040.s54AehEl025103@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 4 Jun 2014 10:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267047 - stable/10/lib/libusb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 10:40:44 -0000 Author: hselasky Date: Wed Jun 4 10:40:43 2014 New Revision: 267047 URL: http://svnweb.freebsd.org/changeset/base/267047 Log: MFC r266664: Add empty LIBUSB_CALL macro, to be compatible to the libusb 1.0-API from sourceforge. PR: usb/190204 Modified: stable/10/lib/libusb/libusb.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libusb/libusb.h ============================================================================== --- stable/10/lib/libusb/libusb.h Wed Jun 4 10:36:02 2014 (r267046) +++ stable/10/lib/libusb/libusb.h Wed Jun 4 10:40:43 2014 (r267047) @@ -33,6 +33,8 @@ #include #endif +#define LIBUSB_CALL + #ifdef __cplusplus extern "C" { #endif From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 11:06:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A53D379E; Wed, 4 Jun 2014 11:06: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 91E3F23FF; Wed, 4 Jun 2014 11:06: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 s54B6c5O036265; Wed, 4 Jun 2014 11:06:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54B6cxQ036264; Wed, 4 Jun 2014 11:06:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406041106.s54B6cxQ036264@svn.freebsd.org> From: Marius Strobl Date: Wed, 4 Jun 2014 11:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267049 - stable/10/sys/i386/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 11:06:38 -0000 Author: marius Date: Wed Jun 4 11:06:38 2014 New Revision: 267049 URL: http://svnweb.freebsd.org/changeset/base/267049 Log: MFC: r266820 (partial) - Shrink the list of excluded modules to what actually still doesn't build as of r267043. - Some style cleanups. Modified: stable/10/sys/i386/conf/XEN Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/conf/XEN ============================================================================== --- stable/10/sys/i386/conf/XEN Wed Jun 4 10:42:04 2014 (r267048) +++ stable/10/sys/i386/conf/XEN Wed Jun 4 11:06:38 2014 (r267049) @@ -6,12 +6,13 @@ cpu I686_CPU ident XEN -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols -makeoptions WITHOUT_MODULES="aha ahb amd ctl cxgb dpt drm drm2 hptnr hptmv ida malo mpr mps mwl nve rdma sound sym trm xfs" +makeoptions DEBUG=-g + +# The following modules don't build with PAE and XEN enabled. +makeoptions WITHOUT_MODULES="ctl cxgb dpt drm drm2 hptmv ida malo mwl rdma" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption -#options SCHED_4BSD options INET # InterNETworking options INET6 # IPv6 communications protocols @@ -65,7 +66,6 @@ options MCLSHIFT=12 options SMP # Symmetric MultiProcessor Kernel device apic # I/O APIC - #device atkbdc # AT keyboard controller #device atkbd # AT keyboard device psm # PS/2 mouse @@ -90,4 +90,3 @@ options AH_SUPPORT_AR5416 # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter - From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 12:03:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DA9C7276; Wed, 4 Jun 2014 12:03: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 C6BE32A07; Wed, 4 Jun 2014 12:03: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 s54C3pPl063474; Wed, 4 Jun 2014 12:03:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54C3p5e063473; Wed, 4 Jun 2014 12:03:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406041203.s54C3p5e063473@svn.freebsd.org> From: Marius Strobl Date: Wed, 4 Jun 2014 12:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267050 - stable/10/sys/i386/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 12:03:52 -0000 Author: marius Date: Wed Jun 4 12:03:51 2014 New Revision: 267050 URL: http://svnweb.freebsd.org/changeset/base/267050 Log: MFC: r266821 (partial) - Actually, modules are built correctly when compiled along the kernel as they then pick up an opt_global.h from KERNBUILDDIR having PAE defined. Thus, build all modules by default except those which still really are defective as of r267043. - Minor style cleanup. Modified: stable/10/sys/i386/conf/PAE Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/conf/PAE ============================================================================== --- stable/10/sys/i386/conf/PAE Wed Jun 4 11:06:38 2014 (r267049) +++ stable/10/sys/i386/conf/PAE Wed Jun 4 12:03:51 2014 (r267050) @@ -10,9 +10,8 @@ ident PAE-GENERIC # To make a PAE kernel, the next option is needed options PAE # Physical Address Extensions Kernel -# Don't build modules with this kernel config, since they are not built with -# the correct options headers. -makeoptions NO_MODULES=yes +# The following modules don't build with PAE enabled. +makeoptions WITHOUT_MODULES="ctl dpt hptmv ida malo mwl" # force isp firmware to fully loaded device ispfw @@ -23,7 +22,6 @@ device ispfw # address properly may cause data corruption when used in a machine with more # than 4 gigabytes of memory. - nodevice ahb nodevice sym nodevice trm From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 14:58:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6E3AB874; Wed, 4 Jun 2014 14:58: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 5A7952B8B; Wed, 4 Jun 2014 14:58: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 s54Ewq5f045131; Wed, 4 Jun 2014 14:58:52 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54Ewqkr045130; Wed, 4 Jun 2014 14:58:52 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <201406041458.s54Ewqkr045130@svn.freebsd.org> From: Ollivier Robert Date: Wed, 4 Jun 2014 14:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267056 - stable/10/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 14:58:52 -0000 Author: roberto Date: Wed Jun 4 14:58:51 2014 New Revision: 267056 URL: http://svnweb.freebsd.org/changeset/base/267056 Log: MFC r266107,r266108,r266109: Here is a patch for the bsdinstall root-on-zfs stuff that adds optional encryption for swap, and optional gmirror for swap (which can be combined) Updates to the datasets created by zfsboot. Set compress=lz4 for the entire pool, removing it from the individual datasets Remove exec=no from /usr/src, breaks the test suite. Fix the "disks" variable reuse. It starts off being used to track the grammar for the number of disks (singular vs plural) and then it is reused as the list of available disks. Replace the variable with disks_grammar and move 'disk' and 'disks' to msg_ vars so they can be translated in the future. Submitted by: Allan Jude Reviewed by: roberto Sponsored by: ScaleEngine Inc. Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Wed Jun 4 13:42:19 2014 (r267055) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Wed Jun 4 14:58:51 2014 (r267056) @@ -108,6 +108,16 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_SWAP_SIZE:=2g} # +# Should we use geli(8) to encrypt the swap? +# +: ${ZFSBOOT_SWAP_ENCRYPTION=} + +# +# Should we use gmirror(8) to mirror the swap? +# +: ${ZFSBOOT_SWAP_MIRROR=} + +# # Default ZFS datasets for root zpool # # NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BOOTFS_NAME/$ZFSBOOT_BOOTFS_NAME @@ -121,7 +131,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/ # Compress /tmp, allow exec but not setuid - /tmp mountpoint=/tmp,compression=lz4,exec=on,setuid=off + /tmp mountpoint=/tmp,exec=on,setuid=off # Don't mount /usr so that 'base' files go to the BEROOT /usr mountpoint=/usr,canmount=off @@ -130,17 +140,17 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA /usr/home # NB: /home is a symlink to /usr/home # Ports tree - /usr/ports compression=lz4,setuid=off + /usr/ports setuid=off # Source tree (compressed) - /usr/src compression=lz4,exec=off,setuid=off + /usr/src # Create /var and friends /var mountpoint=/var - /var/crash compression=lz4,exec=off,setuid=off - /var/log compression=lz4,exec=off,setuid=off - /var/mail compression=lz4,atime=on - /var/tmp compression=lz4,exec=on,setuid=off + /var/crash exec=off,setuid=off + /var/log exec=off,setuid=off + /var/mail atime=on + /var/tmp setuid=off " # END-QUOTE # @@ -184,6 +194,7 @@ MOUNT_TYPE='mount -t %s "%s" "%s"' PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\"" PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"' SHELL_TRUNCATE=':> "%s"' +SWAP_GMIRROR_LABEL='gmirror label swap %s' UMOUNT='umount "%s"' ZFS_CREATE_WITH_OPTIONS='zfs create %s "%s"' ZFS_SET='zfs set "%s" "%s"' @@ -209,6 +220,8 @@ msg_configure_options="Configure Options msg_detailed_disk_info="gpart(8) show %s:\n%s\n\ncamcontrol(8) inquiry %s:\n%s\n\n\ncamcontrol(8) identify %s:\n%s\n" msg_disk_info="Disk Info" msg_disk_info_help="Get detailed information on disk device(s)" +msg_disk_singular="disk" +msg_disk_plural="disks" msg_encrypt_disks="Encrypt Disks?" msg_encrypt_disks_help="Use geli(8) to encrypt all data partitions" msg_error="Error" @@ -263,6 +276,10 @@ msg_select_a_disk_device="Select a disk msg_select_virtual_device_type="Select Virtual Device type:" msg_stripe_desc="Stripe - No Redundancy" msg_stripe_help="[1+ Disks] Striping provides maximum storage but no redundancy" +msg_swap_encrypt="Encrypt Swap?" +msg_swap_encrypt_help="Encrypt swap partitions with temporary keys, discarded on reboot" +msg_swap_mirror="Mirror Swap?" +msg_swap_mirror_help="Mirror swap partitions for redundancy, breaks crash dumps" msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." @@ -285,15 +302,20 @@ dialog_menu_main() local prompt="$msg_configure_options" local force4k="$msg_no" local usegeli="$msg_no" + local swapgeli="$msg_no" + local swapmirror="$msg_no" [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && force4k="$msg_yes" [ "$ZFSBOOT_GELI_ENCRYPTION" ] && usegeli="$msg_yes" - local disks n + [ "$ZFSBOOT_SWAP_ENCRYPTION" ] && swapgeli="$msg_yes" + [ "$ZFSBOOT_SWAP_MIRROR" ] && swapmirror="$msg_yes" + local disks n disks_grammar f_count n $ZFSBOOT_DISKS - { [ $n -eq 1 ] && disks=disk; } || disks=disks # grammar + { [ $n -eq 1 ] && disks_grammar=$msg_disk_singular; } || + disks_grammar=$msg_disk_plural # grammar local menu_list=" '>>> $msg_install' '$msg_install_desc' '$msg_install_help' - 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks' + 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks_grammar' '$msg_pool_type_disks_help' '- $msg_rescan_devices' '*' '$msg_rescan_devices_help' @@ -309,6 +331,10 @@ dialog_menu_main() '$msg_partition_scheme_help' 'S $msg_swap_size' '$ZFSBOOT_SWAP_SIZE' '$msg_swap_size_help' + 'M $msg_swap_mirror' '$swapmirror' + '$msg_swap_mirror_help' + 'W $msg_swap_encrypt' '$swapgeli' + '$msg_swap_encrypt_help' " # END-QUOTE local defaultitem= # Calculated below local hline="$hline_alnum_arrows_punc_tab_enter" @@ -747,14 +773,14 @@ zfs_create_diskpart() return $FAILURE # NB: zpool will use the `zfs#' GPT labels - bootpart=p2 targetpart=p2 + bootpart=p2 swappart=p2 targetpart=p2 [ ${swapsize:-0} -gt 0 ] && targetpart=p3 # # Prepare boot pool if enabled (e.g., for geli(8)) # if [ "$ZFSBOOT_BOOT_POOL" ]; then - bootpart=p2 targetpart=p3 + bootpart=p2 swappart=p3 targetpart=p3 [ ${swapsize:-0} -gt 0 ] && targetpart=p4 f_eval_catch $funcname gpart \ "$GPART_ADD_LABEL_WITH_SIZE" boot$index \ @@ -781,12 +807,7 @@ zfs_create_diskpart() return $FAILURE # Pedantically nuke any old labels on the swap f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ - /dev/gpt/swap$index - # Update fstab(5) - f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/gpt/swap$index none swap sw 0 0 \ - $BSDINSTALL_TMPETC/fstab || - return $FAILURE + /dev/$disk$swappart fi # @@ -827,7 +848,7 @@ zfs_create_diskpart() return $FAILURE # NB: zpool will use s1a (no labels) - bootpart=s1a targetpart=s1d mbrindex=4 + bootpart=s1a swappart=s1b targetpart=s1d mbrindex=4 # # Always prepare a boot pool on MBR @@ -858,11 +879,6 @@ zfs_create_diskpart() # Pedantically nuke any old labels on the swap f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ /dev/${disk}s1b - # Update fstab(5) - f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/${disk}s1b none swap sw 0 0 \ - $BSDINSTALL_TMPETC/fstab || - return $FAILURE fi # @@ -879,6 +895,33 @@ zfs_create_diskpart() esac # $ZFSBOOT_PARTITION_SCHEME + # Update fstab(5) + if [ "$isswapmirror" ]; then + # This is not the first disk in the mirror, do nothing + elif [ "$ZFSBOOT_SWAP_ENCRYPTION" -a "$ZFSBOOT_SWAP_MIRROR" ]; then + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + /dev/mirror/swap.eli none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || + return $FAILURE + isswapmirror=1 + elif [ "$ZFSBOOT_SWAP_MIRROR" ]; then + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + /dev/mirror/swap none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || + return $FAILURE + isswapmirror=1 + elif [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + /dev/$disk${swappart}.eli none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || + return $FAILURE + else + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + /dev/$disk$swappart none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || + return $FAILURE + fi + return $SUCCESS } @@ -893,10 +936,12 @@ zfs_create_boot() local zroot_name="$1" local zroot_vdevtype="$2" local zroot_vdevs= # Calculated below + local swap_devs= # Calculated below local boot_vdevs= # Used for geli(8) and/or MBR layouts shift 2 # poolname vdev_type local disks="$*" disk - local bootpart targetpart # Set by zfs_create_diskpart() below + local isswapmirror + local bootpart targetpart swappart # Set by zfs_create_diskpart() below # # Pedantic checks; should never be seen @@ -968,7 +1013,8 @@ zfs_create_boot() local n=0 for disk in $disks; do zfs_create_diskpart $disk $n || return $FAILURE - # Now $bootpart and $targetpart are set (suffix for $disk) + # Now $bootpart, $targetpart, and $swappart are set (suffix + # for $disk) # Forced 4k alignment support using Geom NOP (see gnop(8)) if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then @@ -1087,13 +1133,24 @@ zfs_create_boot() return $FAILURE f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi + # + # Create the gmirror(8) GEOMS for swap + # + if [ "$ZFSBOOT_SWAP_MIRROR" ]; then + for disk in $disks; do + swap_devs="$swap_devs $disk$swappart" + done + f_eval_catch $funcname gmirror "$SWAP_GMIRROR_LABEL" \ + "$swap_devs" || return $FAILURE + fi # # Create the ZFS root pool with desired type and disk devices # f_dprintf "$funcname: Creating root pool..." f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "-o altroot=$BSDINSTALL_CHROOT -m none -f" \ + "-o altroot=$BSDINSTALL_CHROOT -O compress=lz4 + -m none -f" \ "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || return $FAILURE @@ -1212,6 +1269,14 @@ zfs_create_boot() $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + f_eval_catch $funcname echo "$ECHO_APPEND" \ + 'kern.geom.label.gptid.enable=\"0\"' \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + + if [ "$ZFSBOOT_SWAP_MIRROR" ]; then + f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_mirror_load=\"YES\"' \ + $BSDINSTALL_TMPBOOT/loader.conf.gmirror || return $FAILURE + fi # We're all done unless we should go on for boot pool [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS @@ -1445,6 +1510,22 @@ while :; do "$ZFSBOOT_SWAP_SIZE" && ZFSBOOT_SWAP_SIZE="${input:-0}" ;; + ?" $msg_swap_mirror") + # Toggle the variable referenced both by the menu and later + if [ "$ZFSBOOT_SWAP_MIRROR" ]; then + ZFSBOOT_SWAP_MIRROR= + else + ZFSBOOT_SWAP_MIRROR=1 + fi + ;; + ?" $msg_swap_encrypt") + # Toggle the variable referenced both by the menu and later + if [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then + ZFSBOOT_SWAP_ENCRYPTION= + else + ZFSBOOT_SWAP_ENCRYPTION=1 + fi + ;; esac done From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 15:18:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CFC1344C; Wed, 4 Jun 2014 15:18: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 BCD7C2DA7; Wed, 4 Jun 2014 15:18: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 s54FIkiS054753; Wed, 4 Jun 2014 15:18:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54FIkpB054752; Wed, 4 Jun 2014 15:18:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406041518.s54FIkpB054752@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 4 Jun 2014 15:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267059 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 15:18:46 -0000 Author: kib Date: Wed Jun 4 15:18:46 2014 New Revision: 267059 URL: http://svnweb.freebsd.org/changeset/base/267059 Log: MFC r266780: Remove the assert which can be triggered by the userspace. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Wed Jun 4 15:05:24 2014 (r267058) +++ stable/10/sys/vm/vm_map.c Wed Jun 4 15:18:46 2014 (r267059) @@ -1986,11 +1986,8 @@ vm_map_protect(vm_map_t map, vm_offset_t */ if ((current->eflags & MAP_ENTRY_USER_WIRED) != 0 && (current->protection & VM_PROT_WRITE) != 0 && - (old_prot & VM_PROT_WRITE) == 0) { - KASSERT(old_prot != VM_PROT_NONE, - ("vm_map_protect: inaccessible wired map entry")); + (old_prot & VM_PROT_WRITE) == 0) vm_fault_copy_entry(map, map, current, current, NULL); - } /* * When restricting access, update the physical map. Worry From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 15:31:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D336CC80; Wed, 4 Jun 2014 15: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 BFA432F44; Wed, 4 Jun 2014 15: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 s54FVvei062786; Wed, 4 Jun 2014 15:31:57 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54FVvxc062785; Wed, 4 Jun 2014 15:31:57 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <201406041531.s54FVvxc062785@svn.freebsd.org> From: Ollivier Robert Date: Wed, 4 Jun 2014 15:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267061 - stable/10/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 15:31:58 -0000 Author: roberto Date: Wed Jun 4 15:31:57 2014 New Revision: 267061 URL: http://svnweb.freebsd.org/changeset/base/267061 Log: Fix syntax error thrown at the point of creating the root pool, caused by an embedded newline appearing within the options string surrounded by double-quotes. Rework the logic that goes into setting dataset options on the root pool dataset while we're here -- added two new variables (which can be altered via scripting) ZFSBOOT_POOL_CREATE_OPTIONS and also ZFSBOOT_BOOT_POOL_CREATE_OPTIONS for setting pool/dataset attributes at the time of pool creation. The former is for setting options on the root pool (zroot) and the latter is for setting options on the optional separate boot pool (bootpool) implicitly enabled when using either GELI or MBR. The default value for the root pool variable (ZFSBOOT_POOL_CREATE_OPTIONS) is "-O compress=lz4 -O atime=off" and the default value for separate boot pool variable (ZFSBOOT_BOOT_POOL_CREATE_OPTIONS) is NULL (no additional options for the separate boot pool dataset). Reviewed by: allanjude Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Wed Jun 4 15:30:49 2014 (r267060) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Wed Jun 4 15:31:57 2014 (r267061) @@ -45,6 +45,11 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_POOL_NAME:=zroot} # +# Default options to use when creating zroot pool +# +: ${ZFSBOOT_POOL_CREATE_OPTIONS:=-O compress=lz4 -O atime=off} + +# # Default name for the boot environment parent dataset # : ${ZFSBOOT_BEROOT_NAME:=ROOT} @@ -82,6 +87,11 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_BOOT_POOL=} # +# Options to use when creating separate boot pool (if any) +# +: ${ZFSBOOT_BOOT_POOL_CREATE_OPTIONS:=} + +# # Default name for boot pool when enabled (e.g., geli(8) or MBR) # : ${ZFSBOOT_BOOT_POOL_NAME:=bootpool} @@ -942,6 +952,7 @@ zfs_create_boot() local disks="$*" disk local isswapmirror local bootpart targetpart swappart # Set by zfs_create_diskpart() below + local create_options # # Pedantic checks; should never be seen @@ -1066,7 +1077,9 @@ zfs_create_boot() f_count nvdevs $boot_vdevs [ $nvdevs -gt 1 ] && bootpool_vdevtype=mirror + create_options="$ZFSBOOT_BOOT_POOL_CREATE_OPTIONS" bootpool_options="-o altroot=$BSDINSTALL_CHROOT" + bootpool_options="$bootpool_options $create_options" bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ "$bootpool_options" "$bootpool_name" \ @@ -1148,19 +1161,11 @@ zfs_create_boot() # Create the ZFS root pool with desired type and disk devices # f_dprintf "$funcname: Creating root pool..." + create_options="$ZFSBOOT_POOL_CREATE_OPTIONS" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "-o altroot=$BSDINSTALL_CHROOT -O compress=lz4 - -m none -f" \ - "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || - return $FAILURE - - # Customize the zroot a bit... - local option - f_dprintf "$funcname: Setting miscellaneous options on root pool..." - for option in atime=off; do - f_eval_catch $funcname zfs "$ZFS_SET" $option "$zroot_name" || - return $FAILURE - done + "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \ + "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || + return $FAILURE # # Create ZFS dataset layout within the new root pool From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 17:50:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0CDE6BD3; Wed, 4 Jun 2014 17:50: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 DD7AD2DA5; Wed, 4 Jun 2014 17:50: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 s54HolTb025709; Wed, 4 Jun 2014 17:50:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54Holrx025708; Wed, 4 Jun 2014 17:50:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406041750.s54Holrx025708@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jun 2014 17:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267068 - stable/10/sys/x86/xen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 17:50:48 -0000 Author: jhb Date: Wed Jun 4 17:50:47 2014 New Revision: 267068 URL: http://svnweb.freebsd.org/changeset/base/267068 Log: MFC 263772: Fix build without SMP. PR: 187854 Modified: stable/10/sys/x86/xen/hvm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/xen/hvm.c ============================================================================== --- stable/10/sys/x86/xen/hvm.c Wed Jun 4 17:17:30 2014 (r267067) +++ stable/10/sys/x86/xen/hvm.c Wed Jun 4 17:50:47 2014 (r267068) @@ -71,9 +71,9 @@ static driver_filter_t xen_ipi_bitmap_ha static driver_filter_t xen_cpustop_handler; static driver_filter_t xen_cpususpend_handler; static driver_filter_t xen_cpustophard_handler; -#endif static void xen_ipi_vectored(u_int vector, int dest); static void xen_hvm_cpu_resume(void); +#endif static void xen_hvm_cpu_init(void); /*---------------------------- Extern Declarations ---------------------------*/ @@ -106,11 +106,13 @@ struct xen_ipi_handler /*-------------------------------- Global Data -------------------------------*/ enum xen_domain_type xen_domain_type = XEN_NATIVE; +#ifdef SMP struct cpu_ops xen_hvm_cpu_ops = { .ipi_vectored = lapic_ipi_vectored, .cpu_init = xen_hvm_cpu_init, .cpu_resume = xen_hvm_cpu_resume }; +#endif static MALLOC_DEFINE(M_XENHVM, "xen_hvm", "Xen HVM PV Support"); @@ -526,7 +528,9 @@ xen_hvm_init(enum xen_hvm_init_type init return; setup_xen_features(); +#ifdef SMP cpu_ops = xen_hvm_cpu_ops; +#endif vm_guest = VM_GUEST_XEN; break; case XEN_HVM_INIT_RESUME: From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 17:57:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4B60DBA; Wed, 4 Jun 2014 17:57: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 38A9C2E16; Wed, 4 Jun 2014 17:57: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 s54HvnJD028935; Wed, 4 Jun 2014 17:57:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54Hvm4L028931; Wed, 4 Jun 2014 17:57:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406041757.s54Hvm4L028931@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jun 2014 17:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267070 - in stable/10/sys/amd64/vmm: . io X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 17:57:49 -0000 Author: jhb Date: Wed Jun 4 17:57:48 2014 New Revision: 267070 URL: http://svnweb.freebsd.org/changeset/base/267070 Log: MFC 260972: There is no need to initialize the IOMMU if no passthru devices have been configured for bhyve to use. Modified: stable/10/sys/amd64/vmm/io/iommu.c stable/10/sys/amd64/vmm/io/ppt.c stable/10/sys/amd64/vmm/io/ppt.h stable/10/sys/amd64/vmm/vmm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/io/iommu.c ============================================================================== --- stable/10/sys/amd64/vmm/io/iommu.c Wed Jun 4 17:56:57 2014 (r267069) +++ stable/10/sys/amd64/vmm/io/iommu.c Wed Jun 4 17:57:48 2014 (r267070) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -43,7 +44,13 @@ __FBSDID("$FreeBSD$"); #include "vmm_mem.h" #include "iommu.h" -static boolean_t iommu_avail; +SYSCTL_DECL(_hw_vmm); +SYSCTL_NODE(_hw_vmm, OID_AUTO, iommu, CTLFLAG_RW, 0, "bhyve iommu parameters"); + +static int iommu_avail; +SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, initialized, CTLFLAG_RD, &iommu_avail, + 0, "bhyve iommu initialized?"); + static struct iommu_ops *ops; static void *host_domain; @@ -160,7 +167,7 @@ iommu_init(void) if (error) return; - iommu_avail = TRUE; + iommu_avail = 1; /* * Create a domain for the devices owned by the host Modified: stable/10/sys/amd64/vmm/io/ppt.c ============================================================================== --- stable/10/sys/amd64/vmm/io/ppt.c Wed Jun 4 17:56:57 2014 (r267069) +++ stable/10/sys/amd64/vmm/io/ppt.c Wed Jun 4 17:57:48 2014 (r267070) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -100,7 +101,12 @@ static struct pptdev { } msix; } pptdevs[64]; +SYSCTL_DECL(_hw_vmm); +SYSCTL_NODE(_hw_vmm, OID_AUTO, ppt, CTLFLAG_RW, 0, "bhyve passthru devices"); + static int num_pptdevs; +SYSCTL_INT(_hw_vmm_ppt, OID_AUTO, devices, CTLFLAG_RD, &num_pptdevs, 0, + "number of pci passthru devices"); static int ppt_probe(device_t dev) @@ -282,7 +288,14 @@ ppt_teardown_msix(struct pptdev *ppt) } int -ppt_num_devices(struct vm *vm) +ppt_avail_devices(void) +{ + + return (num_pptdevs); +} + +int +ppt_assigned_devices(struct vm *vm) { int i, num; Modified: stable/10/sys/amd64/vmm/io/ppt.h ============================================================================== --- stable/10/sys/amd64/vmm/io/ppt.h Wed Jun 4 17:56:57 2014 (r267069) +++ stable/10/sys/amd64/vmm/io/ppt.h Wed Jun 4 17:57:48 2014 (r267070) @@ -36,10 +36,16 @@ int ppt_setup_msi(struct vm *vm, int vcp uint64_t addr, uint64_t msg, int numvec); int ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); -int ppt_num_devices(struct vm *vm); +int ppt_assigned_devices(struct vm *vm); boolean_t ppt_is_mmio(struct vm *vm, vm_paddr_t gpa); /* + * Returns the number of devices sequestered by the ppt driver for assignment + * to virtual machines. + */ +int ppt_avail_devices(void); + +/* * The following functions should never be called directly. * Use 'vm_assign_pptdev()' and 'vm_unassign_pptdev()' instead. */ Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Wed Jun 4 17:56:57 2014 (r267069) +++ stable/10/sys/amd64/vmm/vmm.c Wed Jun 4 17:57:48 2014 (r267070) @@ -266,7 +266,8 @@ vmm_handler(module_t mod, int what, void switch (what) { case MOD_LOAD: vmmdev_init(); - iommu_init(); + if (ppt_avail_devices() > 0) + iommu_init(); error = vmm_init(); if (error == 0) vmm_initialized = 1; @@ -604,7 +605,7 @@ vm_unassign_pptdev(struct vm *vm, int bu if (error) return (error); - if (ppt_num_devices(vm) == 0) { + if (ppt_assigned_devices(vm) == 0) { vm_iommu_unmap(vm); vm_gpa_unwire(vm); } @@ -624,7 +625,7 @@ vm_assign_pptdev(struct vm *vm, int bus, * * We need to do this before the first pci passthru device is attached. */ - if (ppt_num_devices(vm) == 0) { + if (ppt_assigned_devices(vm) == 0) { KASSERT(vm->iommu == NULL, ("vm_assign_pptdev: iommu must be NULL")); maxaddr = vmm_mem_maxaddr(); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 18:08:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0CC7384E; Wed, 4 Jun 2014 18:08: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 EEB1C2F3F; Wed, 4 Jun 2014 18:08:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54I8852034127; Wed, 4 Jun 2014 18:08:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54I88qm034126; Wed, 4 Jun 2014 18:08:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406041808.s54I88qm034126@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jun 2014 18:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267071 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 18:08:09 -0000 Author: jhb Date: Wed Jun 4 18:08:08 2014 New Revision: 267071 URL: http://svnweb.freebsd.org/changeset/base/267071 Log: MFC 260999: Increase the block-layer backend maximum number of requests to match the AHCI command queue depth. Modified: stable/10/usr.sbin/bhyve/block_if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.c Wed Jun 4 17:57:48 2014 (r267070) +++ stable/10/usr.sbin/bhyve/block_if.c Wed Jun 4 18:08:08 2014 (r267071) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #define BLOCKIF_SIG 0xb109b109 -#define BLOCKIF_MAXREQ 16 +#define BLOCKIF_MAXREQ 32 enum blockop { BOP_READ, From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 18:21:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9889ED6A; Wed, 4 Jun 2014 18:21:33 +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 86728207B; Wed, 4 Jun 2014 18:21:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54ILXmR042542; Wed, 4 Jun 2014 18:21:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54ILXna042541; Wed, 4 Jun 2014 18:21:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406041821.s54ILXna042541@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jun 2014 18:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267074 - stable/10/sys/dev/aac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 18:21:33 -0000 Author: jhb Date: Wed Jun 4 18:21:33 2014 New Revision: 267074 URL: http://svnweb.freebsd.org/changeset/base/267074 Log: MFC 266281: Clear the data buffer length field when freeing a command structure so that it doesn't leak through when the command structure is reused for a user command without a data buffer. PR: 189668 Modified: stable/10/sys/dev/aac/aac.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/aac/aac.c ============================================================================== --- stable/10/sys/dev/aac/aac.c Wed Jun 4 18:19:10 2014 (r267073) +++ stable/10/sys/dev/aac/aac.c Wed Jun 4 18:21:33 2014 (r267074) @@ -1408,6 +1408,7 @@ aac_release_command(struct aac_command * fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); /* (re)initialize the command/FIB */ + cm->cm_datalen = 0; cm->cm_sgtable = NULL; cm->cm_flags = 0; cm->cm_complete = NULL; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 4 21:17:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F099F94E; Wed, 4 Jun 2014 21:17:23 +0000 (UTC) Received: from smtp.digiware.nl (smtp.digiware.nl [31.223.170.169]) (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 ADCC825D2; Wed, 4 Jun 2014 21:17:22 +0000 (UTC) Received: from rack1.digiware.nl (unknown [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id 280CC1534D1; Wed, 4 Jun 2014 23:17:13 +0200 (CEST) X-Virus-Scanned: amavisd-new at digiware.nl Received: from smtp.digiware.nl ([127.0.0.1]) by rack1.digiware.nl (rack1.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QYM9FXS0Q5Qx; Wed, 4 Jun 2014 23:17:11 +0200 (CEST) Received: from [192.168.10.9] (vaio [192.168.10.9]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 4163E153434; Wed, 4 Jun 2014 23:17:11 +0200 (CEST) Message-ID: <538F8CDE.3010302@digiware.nl> Date: Wed, 04 Jun 2014 23:17:18 +0200 From: Willem Jan Withagen User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r267071 - stable/10/usr.sbin/bhyve References: <201406041808.s54I88qm034126@svn.freebsd.org> In-Reply-To: <201406041808.s54I88qm034126@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 21:17:24 -0000 On 4-6-2014 20:08, John Baldwin wrote: > Author: jhb > Date: Wed Jun 4 18:08:08 2014 > New Revision: 267071 > URL: http://svnweb.freebsd.org/changeset/base/267071 > > Log: > MFC 260999: > Increase the block-layer backend maximum number of requests to match > the AHCI command queue depth. > > Modified: > stable/10/usr.sbin/bhyve/block_if.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/usr.sbin/bhyve/block_if.c > ============================================================================== > --- stable/10/usr.sbin/bhyve/block_if.c Wed Jun 4 17:57:48 2014 (r267070) > +++ stable/10/usr.sbin/bhyve/block_if.c Wed Jun 4 18:08:08 2014 (r267071) > @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); > > #define BLOCKIF_SIG 0xb109b109 > > -#define BLOCKIF_MAXREQ 16 > +#define BLOCKIF_MAXREQ 32 > > enum blockop { > BOP_READ, I once asked Peter about this, because of the trouble I had when running the bhyve_svm branch. This is not perse a good enhancement.... I've had a combination of HEAD and bhyve where running Linux and AMD would regularly generate timeouts for FPDMA for slots > 16.... After building the most recent bhyve_svm with patch set to get to a more recent almost-head-snapshot I ran some test, and did not run into these timeouts. So can very well be that fixes in HEAD got ride off the timeout. But then again I would say: thread with caution. --WjW From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 00:40:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 94606CF9; Thu, 5 Jun 2014 00:40: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 814B8269D; Thu, 5 Jun 2014 00:40: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 s550em2I014275; Thu, 5 Jun 2014 00:40:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s550empA014274; Thu, 5 Jun 2014 00:40:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406050040.s550empA014274@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 5 Jun 2014 00:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267083 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 00:40:48 -0000 Author: kib Date: Thu Jun 5 00:40:48 2014 New Revision: 267083 URL: http://svnweb.freebsd.org/changeset/base/267083 Log: MFC r266846: When usermode loaded non-default segment selector into the %gs, correctly prepare KGSBASE msr to restore the user descriptor base on the last swapgs during return to usermode. Modified: stable/10/sys/amd64/amd64/exception.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/exception.S ============================================================================== --- stable/10/sys/amd64/amd64/exception.S Thu Jun 5 00:38:32 2014 (r267082) +++ stable/10/sys/amd64/amd64/exception.S Thu Jun 5 00:40:48 2014 (r267083) @@ -722,21 +722,38 @@ ld_fsbase: pushfq cli movl $MSR_GSBASE,%ecx + /* Save current kernel %gs base into %r12d:%r13d */ rdmsr + movl %eax,%r12d + movl %edx,%r13d .globl ld_gs ld_gs: movw %si,%gs + /* Save user %gs base into %r14d:%r15d */ + rdmsr + movl %eax,%r14d + movl %edx,%r15d + /* Restore kernel %gs base */ + movl %r12d,%eax + movl %r13d,%edx wrmsr popfq + /* + * Restore user %gs base, either from PCB if used for TLS, or + * from the previously saved msr read. + */ + movl $MSR_KGSBASE,%ecx cmpw $KUG32SEL,%si jne 1f - movl $MSR_KGSBASE,%ecx movl PCB_GSBASE(%r8),%eax movl PCB_GSBASE+4(%r8),%edx + jmp ld_gsbase +1: + movl %r14d,%eax + movl %r15d,%edx .globl ld_gsbase ld_gsbase: - wrmsr -1: + wrmsr /* May trap if non-canonical, but only for TLS. */ .globl ld_es ld_es: movw TF_ES(%rsp),%es From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 00:43:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6B444E73; Thu, 5 Jun 2014 00:43: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 4C4B42729; Thu, 5 Jun 2014 00:43: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 s550hYA0015394; Thu, 5 Jun 2014 00:43:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s550hXDC015388; Thu, 5 Jun 2014 00:43:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406050043.s550hXDC015388@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 5 Jun 2014 00:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267084 - stable/10/sys/dev/mfi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 00:43:34 -0000 Author: kib Date: Thu Jun 5 00:43:32 2014 New Revision: 267084 URL: http://svnweb.freebsd.org/changeset/base/267084 Log: MFC r266848: Add support for the unmapped i/o to mfi(4). Modified: stable/10/sys/dev/mfi/mfi.c stable/10/sys/dev/mfi/mfi_cam.c stable/10/sys/dev/mfi/mfi_disk.c stable/10/sys/dev/mfi/mfi_syspd.c stable/10/sys/dev/mfi/mfivar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mfi/mfi.c ============================================================================== --- stable/10/sys/dev/mfi/mfi.c Thu Jun 5 00:40:48 2014 (r267083) +++ stable/10/sys/dev/mfi/mfi.c Thu Jun 5 00:43:32 2014 (r267084) @@ -2122,6 +2122,8 @@ mfi_build_cdb(int readop, uint8_t byte2, return cdb_len; } +extern char *unmapped_buf; + static struct mfi_command * mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) { @@ -2145,11 +2147,11 @@ mfi_build_syspdio(struct mfi_softc *sc, pass->header.cmd = MFI_CMD_PD_SCSI_IO; switch (bio->bio_cmd & 0x03) { case BIO_READ: - flags = MFI_CMD_DATAIN; + flags = MFI_CMD_DATAIN | MFI_CMD_BIO; readop = 1; break; case BIO_WRITE: - flags = MFI_CMD_DATAOUT; + flags = MFI_CMD_DATAOUT | MFI_CMD_BIO; readop = 0; break; default: @@ -2174,7 +2176,7 @@ mfi_build_syspdio(struct mfi_softc *sc, pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_complete = mfi_bio_complete; cm->cm_private = bio; - cm->cm_data = bio->bio_data; + cm->cm_data = unmapped_buf; cm->cm_len = bio->bio_bcount; cm->cm_sg = &pass->sgl; cm->cm_total_frame_size = MFI_PASS_FRAME_SIZE; @@ -2205,11 +2207,11 @@ mfi_build_ldio(struct mfi_softc *sc, str switch (bio->bio_cmd & 0x03) { case BIO_READ: io->header.cmd = MFI_CMD_LD_READ; - flags = MFI_CMD_DATAIN; + flags = MFI_CMD_DATAIN | MFI_CMD_BIO; break; case BIO_WRITE: io->header.cmd = MFI_CMD_LD_WRITE; - flags = MFI_CMD_DATAOUT; + flags = MFI_CMD_DATAOUT | MFI_CMD_BIO; break; default: /* TODO: what about BIO_DELETE??? */ @@ -2230,7 +2232,7 @@ mfi_build_ldio(struct mfi_softc *sc, str io->lba_lo = bio->bio_pblkno & 0xffffffff; cm->cm_complete = mfi_bio_complete; cm->cm_private = bio; - cm->cm_data = bio->bio_data; + cm->cm_data = unmapped_buf; cm->cm_len = bio->bio_bcount; cm->cm_sg = &io->sgl; cm->cm_total_frame_size = MFI_IO_FRAME_SIZE; @@ -2316,6 +2318,10 @@ mfi_mapcmd(struct mfi_softc *sc, struct error = bus_dmamap_load_ccb(sc->mfi_buffer_dmat, cm->cm_dmamap, cm->cm_data, mfi_data_cb, cm, polled); + else if (cm->cm_flags & MFI_CMD_BIO) + error = bus_dmamap_load_bio(sc->mfi_buffer_dmat, + cm->cm_dmamap, cm->cm_private, mfi_data_cb, cm, + polled); else error = bus_dmamap_load(sc->mfi_buffer_dmat, cm->cm_dmamap, cm->cm_data, cm->cm_len, Modified: stable/10/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/10/sys/dev/mfi/mfi_cam.c Thu Jun 5 00:40:48 2014 (r267083) +++ stable/10/sys/dev/mfi/mfi_cam.c Thu Jun 5 00:43:32 2014 (r267084) @@ -218,7 +218,7 @@ mfip_cam_action(struct cam_sim *sim, uni cpi->version_num = 1; cpi->hba_inquiry = PI_TAG_ABLE; cpi->target_sprt = 0; - cpi->hba_misc = PIM_NOBUSRESET|PIM_SEQSCAN; + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN | PIM_UNMAPPED; cpi->hba_eng_cnt = 0; cpi->max_target = MFI_SCSI_MAX_TARGETS; cpi->max_lun = MFI_SCSI_MAX_LUNS; Modified: stable/10/sys/dev/mfi/mfi_disk.c ============================================================================== --- stable/10/sys/dev/mfi/mfi_disk.c Thu Jun 5 00:40:48 2014 (r267083) +++ stable/10/sys/dev/mfi/mfi_disk.c Thu Jun 5 00:43:32 2014 (r267084) @@ -169,6 +169,7 @@ mfi_disk_attach(device_t dev) sc->ld_disk->d_fwheads = 64; sc->ld_disk->d_fwsectors = 32; } + sc->ld_disk->d_flags = DISKFLAG_UNMAPPED_BIO; disk_create(sc->ld_disk, DISK_VERSION); return (0); Modified: stable/10/sys/dev/mfi/mfi_syspd.c ============================================================================== --- stable/10/sys/dev/mfi/mfi_syspd.c Thu Jun 5 00:40:48 2014 (r267083) +++ stable/10/sys/dev/mfi/mfi_syspd.c Thu Jun 5 00:43:32 2014 (r267084) @@ -143,6 +143,7 @@ mfi_syspd_attach(device_t dev) sc->pd_disk->d_fwheads = 64; sc->pd_disk->d_fwsectors = 32; } + sc->pd_disk->d_flags = DISKFLAG_UNMAPPED_BIO; disk_create(sc->pd_disk, DISK_VERSION); device_printf(dev, " SYSPD volume attached\n"); Modified: stable/10/sys/dev/mfi/mfivar.h ============================================================================== --- stable/10/sys/dev/mfi/mfivar.h Thu Jun 5 00:40:48 2014 (r267083) +++ stable/10/sys/dev/mfi/mfivar.h Thu Jun 5 00:43:32 2014 (r267084) @@ -104,10 +104,11 @@ struct mfi_command { #define MFI_CMD_POLLED (1<<4) #define MFI_CMD_SCSI (1<<5) #define MFI_CMD_CCB (1<<6) -#define MFI_CMD_TBOLT (1<<7) -#define MFI_ON_MFIQ_FREE (1<<8) -#define MFI_ON_MFIQ_READY (1<<9) -#define MFI_ON_MFIQ_BUSY (1<<10) +#define MFI_CMD_BIO (1<<7) +#define MFI_CMD_TBOLT (1<<8) +#define MFI_ON_MFIQ_FREE (1<<9) +#define MFI_ON_MFIQ_READY (1<<10) +#define MFI_ON_MFIQ_BUSY (1<<11) #define MFI_ON_MFIQ_MASK (MFI_ON_MFIQ_FREE | MFI_ON_MFIQ_READY| \ MFI_ON_MFIQ_BUSY) #define MFI_CMD_FLAGS_FMT "\20" \ @@ -117,10 +118,11 @@ struct mfi_command { "\4COMPLETED" \ "\5POLLED" \ "\6SCSI" \ - "\7TBOLT" \ - "\10Q_FREE" \ - "\11Q_READY" \ - "\12Q_BUSY" + "\7BIO" \ + "\10TBOLT" \ + "\11Q_FREE" \ + "\12Q_READY" \ + "\13Q_BUSY" uint8_t retry_for_fw_reset; void (* cm_complete)(struct mfi_command *cm); void *cm_private; From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 01:20:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 49B621E4; Thu, 5 Jun 2014 01:20: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 36A5C2A56; Thu, 5 Jun 2014 01:20: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 s551KQqS030754; Thu, 5 Jun 2014 01:20:26 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s551KQQ5030753; Thu, 5 Jun 2014 01:20:26 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201406050120.s551KQQ5030753@svn.freebsd.org> From: Warren Block Date: Thu, 5 Jun 2014 01:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267087 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 01:20:26 -0000 Author: wblock (doc committer) Date: Thu Jun 5 01:20:25 2014 New Revision: 267087 URL: http://svnweb.freebsd.org/changeset/base/267087 Log: MFC r266828: Correct the description of characters allowed. Based on pw_checkname in usr.sbin/pw/pw_user.c. Modified version of patch submitted by venture37. Modified: stable/10/share/man/man5/passwd.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man5/passwd.5 ============================================================================== --- stable/10/share/man/man5/passwd.5 Thu Jun 5 01:00:27 2014 (r267086) +++ stable/10/share/man/man5/passwd.5 Thu Jun 5 01:20:25 2014 (r267087) @@ -129,19 +129,29 @@ Routines that manipulate these files will often return only one of the multiple entries, and that one by random selection. .Pp -The login name must never begin with a hyphen -.Pq Ql - ; -also, it is strongly -suggested that neither upper-case characters or dots -.Pq Ql \&. -be part -of the name, as this tends to confuse mailers. +The login name must not begin with a hyphen +.Pq Ql \&- , +and cannot contain 8-bit characters, tabs or spaces, or any of these +symbols: +.Ql \&,:+&#%^\&(\&)!@~*?<>=|\e\\&/" . +The dollar symbol +.Pq Ql \&$ +is allowed only as the last character for use with Samba. No field may contain a colon .Pq Ql \&: as this has been used historically to separate the fields in the user database. .Pp +Case is significant. +Login names +.Ql Lrrr +and +.Ql lrrr +represent different users. +Be aware of this when interoperating with systems that do not have +case-sensitive login names. +.Pp In the .Nm master.passwd file, From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 05:36:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 446C3B82; Thu, 5 Jun 2014 05:36: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 269A62F52; Thu, 5 Jun 2014 05:36: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 s555auWF048816; Thu, 5 Jun 2014 05:36:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s555ausR048815; Thu, 5 Jun 2014 05:36:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406050536.s555ausR048815@svn.freebsd.org> From: Alexander Motin Date: Thu, 5 Jun 2014 05:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267093 - stable/10/sys/netgraph X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 05:36:56 -0000 Author: mav Date: Thu Jun 5 05:36:55 2014 New Revision: 267093 URL: http://svnweb.freebsd.org/changeset/base/267093 Log: MFC r266538: Make ng_mppc to not disable the node in case of multiple packet loss. Quite often it can be just packet reorder, and killing link in such case is inconvenient. Add few sysctl's to control that behavior. PR: kern/182212 Submitted by: Eugene Grosbein Modified: stable/10/sys/netgraph/ng_mppc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netgraph/ng_mppc.c ============================================================================== --- stable/10/sys/netgraph/ng_mppc.c Thu Jun 5 03:46:46 2014 (r267092) +++ stable/10/sys/netgraph/ng_mppc.c Thu Jun 5 05:36:55 2014 (r267093) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -107,6 +108,23 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "n */ #define MPPE_MAX_REKEY 1000 +SYSCTL_NODE(_net_graph, OID_AUTO, mppe, CTLFLAG_RW, 0, "MPPE"); + +static int mppe_block_on_max_rekey = 0; +TUNABLE_INT("net.graph.mppe.block_on_max_rekey", &mppe_block_on_max_rekey); +SYSCTL_INT(_net_graph_mppe, OID_AUTO, block_on_max_rekey, CTLFLAG_RW, + &mppe_block_on_max_rekey, 0, "Block node on max MPPE key re-calculations"); + +static int mppe_log_max_rekey = 1; +TUNABLE_INT("net.graph.mppe.log_max_rekey", &mppe_log_max_rekey); +SYSCTL_INT(_net_graph_mppe, OID_AUTO, log_max_rekey, CTLFLAG_RW, + &mppe_log_max_rekey, 0, "Log max MPPE key re-calculations event"); + +static int mppe_max_rekey = MPPE_MAX_REKEY; +TUNABLE_INT("net.graph.mppe.max_rekey", &mppe_max_rekey); +SYSCTL_INT(_net_graph_mppe, OID_AUTO, max_rekey, CTLFLAG_RW, + &mppe_max_rekey, 0, "Maximum number of MPPE key re-calculations"); + /* MPPC packet header bits */ #define MPPC_FLAG_FLUSHED 0x8000 /* xmitter reset state */ #define MPPC_FLAG_RESTART 0x4000 /* compress history restart */ @@ -646,12 +664,23 @@ ng_mppc_decompress(node_p node, struct m /* How many times are we going to have to re-key? */ rekey = ((d->cfg.bits & MPPE_STATELESS) != 0) ? numLost : (numLost / (MPPE_UPDATE_MASK + 1)); - if (rekey > MPPE_MAX_REKEY) { - log(LOG_ERR, "%s: too many (%d) packets" - " dropped, disabling node %p!", - __func__, numLost, node); + if (rekey > mppe_max_rekey) { + if (mppe_block_on_max_rekey) { + if (mppe_log_max_rekey) { + log(LOG_ERR, "%s: too many (%d) packets" + " dropped, disabling node %p!\n", + __func__, numLost, node); + } priv->recv.cfg.enable = 0; goto failed; + } else { + if (mppe_log_max_rekey) { + log(LOG_ERR, "%s: %d packets" + " dropped, node %p\n", + __func__, numLost, node); + } + goto failed; + } } /* Re-key as necessary to catch up to peer */ From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 11:48:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B0077631; Thu, 5 Jun 2014 11:48: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 90F982EE8; Thu, 5 Jun 2014 11:48: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 s55BmaZA016721; Thu, 5 Jun 2014 11:48:36 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55Bma0q016720; Thu, 5 Jun 2014 11:48:36 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201406051148.s55Bma0q016720@svn.freebsd.org> From: Dmitry Morozovsky Date: Thu, 5 Jun 2014 11:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267100 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 11:48:36 -0000 Author: marck (doc committer) Date: Thu Jun 5 11:48:36 2014 New Revision: 267100 URL: http://svnweb.freebsd.org/changeset/base/267100 Log: MFC r266859: Change examples to have master skew above 0 to have ability to overwrite this from the slave (for example, when master is failing on disk IO and could not be logged into or execute cronjob). Commented out examples changed too to simplify future merging. Idea by: kaa@zvuki.ru Discussed with: glebius Modified: stable/10/share/man/man4/carp.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/carp.4 ============================================================================== --- stable/10/share/man/man4/carp.4 Thu Jun 5 09:27:42 2014 (r267099) +++ stable/10/share/man/man4/carp.4 Thu Jun 5 11:48:36 2014 (r267100) @@ -210,17 +210,18 @@ Enable it on both hosts A and B: .Pp Assume that host A is the preferred master and we are running the 192.168.1.0/24 prefix on em0 and 192.168.2.0/24 on em1. -This is the setup for host A: +This is the setup for host A (advskew is above 0 so it could be overwritten +in the emergency situation from the other host): .Bd -literal -offset indent -ifconfig em0 vhid 1 pass mekmitasdigoat 192.168.1.1/24 -ifconfig em1 vhid 2 pass mekmitasdigoat 192.168.2.1/24 +ifconfig em0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.1/24 +ifconfig em1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.2.1/24 .Ed .Pp The setup for host B is identical, but it has a higher .Cm advskew : .Bd -literal -offset indent -ifconfig em0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.1/24 -ifconfig em1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.2.1/24 +ifconfig em0 vhid 1 advskew 200 pass mekmitasdigoat 192.168.1.1/24 +ifconfig em1 vhid 2 advskew 200 pass mekmitasdigoat 192.168.2.1/24 .Ed .Pp When one of the physical interfaces of host A fails, @@ -246,9 +247,9 @@ preempt host A on both interfaces instea .\"out slightly less frequently. .\".Bd -literal -offset indent .\"ifconfig carp0 create -.\"ifconfig carp0 vhid 1 pass mekmitasdigoat 192.168.1.10/24 +.\"ifconfig carp0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.10/24 .\"ifconfig carp1 create -.\"ifconfig carp1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.1.10/24 +.\"ifconfig carp1 vhid 2 advskew 200 pass mekmitasdigoat 192.168.1.10/24 .\".Ed .\".Pp .\"The configuration for host B is identical, except the @@ -256,9 +257,9 @@ preempt host A on both interfaces instea .\"is on virtual host 1 rather than virtual host 2. .\".Bd -literal -offset indent .\"ifconfig carp0 create -.\"ifconfig carp0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.10/24 +.\"ifconfig carp0 vhid 1 advskew 200 pass mekmitasdigoat 192.168.1.10/24 .\"ifconfig carp1 create -.\"ifconfig carp1 vhid 2 pass mekmitasdigoat 192.168.1.10/24 +.\"ifconfig carp1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.1.10/24 .\".Ed .\".Pp .\"Finally, the ARP balancing feature must be enabled on both hosts: From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 12:32:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A0748727; Thu, 5 Jun 2014 12:32: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 82E3E258A; Thu, 5 Jun 2014 12:32: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 s55CWfIv038472; Thu, 5 Jun 2014 12:32:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55CWeA0038467; Thu, 5 Jun 2014 12:32:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406051232.s55CWeA0038467@svn.freebsd.org> From: Xin LI Date: Thu, 5 Jun 2014 12:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267103 - in stable: 10/crypto/openssl/ssl 8/crypto/openssl/ssl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 12:32:41 -0000 Author: delphij Date: Thu Jun 5 12:32:38 2014 New Revision: 267103 URL: http://svnweb.freebsd.org/changeset/base/267103 Log: Fix OpenSSL multiple vulnerabilities. Security: CVE-2014-0195, CVE-2014-0221, CVE-2014-0224, CVE-2014-3470 Security: SA-14:14.openssl Modified: stable/10/crypto/openssl/ssl/d1_both.c stable/10/crypto/openssl/ssl/s3_clnt.c stable/10/crypto/openssl/ssl/s3_pkt.c stable/10/crypto/openssl/ssl/s3_srvr.c stable/10/crypto/openssl/ssl/ssl3.h Changes in other areas also in this revision: Modified: stable/8/crypto/openssl/ssl/d1_both.c stable/8/crypto/openssl/ssl/s3_clnt.c stable/8/crypto/openssl/ssl/s3_pkt.c stable/8/crypto/openssl/ssl/s3_srvr.c stable/8/crypto/openssl/ssl/ssl3.h Modified: stable/10/crypto/openssl/ssl/d1_both.c ============================================================================== --- stable/10/crypto/openssl/ssl/d1_both.c Thu Jun 5 12:32:16 2014 (r267102) +++ stable/10/crypto/openssl/ssl/d1_both.c Thu Jun 5 12:32:38 2014 (r267103) @@ -627,7 +627,16 @@ dtls1_reassemble_fragment(SSL *s, struct frag->msg_header.frag_off = 0; } else + { frag = (hm_fragment*) item->data; + if (frag->msg_header.msg_len != msg_hdr->msg_len) + { + item = NULL; + frag = NULL; + goto err; + } + } + /* If message is already reassembled, this must be a * retransmit and can be dropped. @@ -784,6 +793,7 @@ dtls1_get_message_fragment(SSL *s, int s int i,al; struct hm_header_st msg_hdr; + redo: /* see if we have the required fragment already */ if ((frag_len = dtls1_retrieve_buffered_fragment(s,max,ok)) || *ok) { @@ -842,8 +852,7 @@ dtls1_get_message_fragment(SSL *s, int s s->msg_callback_arg); s->init_num = 0; - return dtls1_get_message_fragment(s, st1, stn, - max, ok); + goto redo; } else /* Incorrectly formated Hello request */ { Modified: stable/10/crypto/openssl/ssl/s3_clnt.c ============================================================================== --- stable/10/crypto/openssl/ssl/s3_clnt.c Thu Jun 5 12:32:16 2014 (r267102) +++ stable/10/crypto/openssl/ssl/s3_clnt.c Thu Jun 5 12:32:38 2014 (r267103) @@ -559,6 +559,7 @@ int ssl3_connect(SSL *s) case SSL3_ST_CR_FINISHED_A: case SSL3_ST_CR_FINISHED_B: + s->s3->flags |= SSL3_FLAGS_CCS_OK; ret=ssl3_get_finished(s,SSL3_ST_CR_FINISHED_A, SSL3_ST_CR_FINISHED_B); if (ret <= 0) goto end; @@ -915,6 +916,7 @@ int ssl3_get_server_hello(SSL *s) SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); goto f_err; } + s->s3->flags |= SSL3_FLAGS_CCS_OK; s->hit=1; } else /* a miss or crap from the other end */ @@ -2510,6 +2512,13 @@ int ssl3_send_client_key_exchange(SSL *s int ecdh_clnt_cert = 0; int field_size = 0; + if (s->session->sess_cert == NULL) + { + ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_UNEXPECTED_MESSAGE); + SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,SSL_R_UNEXPECTED_MESSAGE); + goto err; + } + /* Did we send out the client's * ECDH share for use in premaster * computation as part of client certificate? Modified: stable/10/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- stable/10/crypto/openssl/ssl/s3_pkt.c Thu Jun 5 12:32:16 2014 (r267102) +++ stable/10/crypto/openssl/ssl/s3_pkt.c Thu Jun 5 12:32:38 2014 (r267103) @@ -1301,6 +1301,15 @@ start: goto f_err; } + if (!(s->s3->flags & SSL3_FLAGS_CCS_OK)) + { + al=SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_SSL3_READ_BYTES,SSL_R_CCS_RECEIVED_EARLY); + goto f_err; + } + + s->s3->flags &= ~SSL3_FLAGS_CCS_OK; + rr->length=0; if (s->msg_callback) @@ -1435,7 +1444,7 @@ int ssl3_do_change_cipher_spec(SSL *s) if (s->s3->tmp.key_block == NULL) { - if (s->session == NULL) + if (s->session == NULL || s->session->master_key_length == 0) { /* might happen if dtls1_read_bytes() calls this */ SSLerr(SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC,SSL_R_CCS_RECEIVED_EARLY); Modified: stable/10/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- stable/10/crypto/openssl/ssl/s3_srvr.c Thu Jun 5 12:32:16 2014 (r267102) +++ stable/10/crypto/openssl/ssl/s3_srvr.c Thu Jun 5 12:32:38 2014 (r267103) @@ -673,6 +673,7 @@ int ssl3_accept(SSL *s) case SSL3_ST_SR_CERT_VRFY_A: case SSL3_ST_SR_CERT_VRFY_B: + s->s3->flags |= SSL3_FLAGS_CCS_OK; /* we should decide if we expected this one */ ret=ssl3_get_cert_verify(s); if (ret <= 0) goto end; @@ -700,6 +701,7 @@ int ssl3_accept(SSL *s) case SSL3_ST_SR_FINISHED_A: case SSL3_ST_SR_FINISHED_B: + s->s3->flags |= SSL3_FLAGS_CCS_OK; ret=ssl3_get_finished(s,SSL3_ST_SR_FINISHED_A, SSL3_ST_SR_FINISHED_B); if (ret <= 0) goto end; @@ -770,7 +772,10 @@ int ssl3_accept(SSL *s) s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A; #else if (s->s3->next_proto_neg_seen) + { + s->s3->flags |= SSL3_FLAGS_CCS_OK; s->s3->tmp.next_state=SSL3_ST_SR_NEXT_PROTO_A; + } else s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A; #endif Modified: stable/10/crypto/openssl/ssl/ssl3.h ============================================================================== --- stable/10/crypto/openssl/ssl/ssl3.h Thu Jun 5 12:32:16 2014 (r267102) +++ stable/10/crypto/openssl/ssl/ssl3.h Thu Jun 5 12:32:38 2014 (r267103) @@ -399,6 +399,7 @@ typedef struct ssl3_buffer_st * effected, but we can't prevent that. */ #define SSL3_FLAGS_SGC_RESTART_DONE 0x0040 +#define SSL3_FLAGS_CCS_OK 0x0080 #ifndef OPENSSL_NO_SSL_INTERN From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 13:08:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F17F0CA9; Thu, 5 Jun 2014 13:08:08 +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 DE3292A61; Thu, 5 Jun 2014 13:08:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55D88d6053473; Thu, 5 Jun 2014 13:08:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55D88mM053472; Thu, 5 Jun 2014 13:08:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406051308.s55D88mM053472@svn.freebsd.org> From: Marius Strobl Date: Thu, 5 Jun 2014 13:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267107 - stable/10/sys/i386/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 13:08:09 -0000 Author: marius Date: Thu Jun 5 13:08:08 2014 New Revision: 267107 URL: http://svnweb.freebsd.org/changeset/base/267107 Log: Fix mismerge in r267049 and put makeoptions DEBUG=-gdwarf-2 instead of DEBUG=-g back. Still, the original comment should be restored in head and then be MFCed along with r263749. Modified: stable/10/sys/i386/conf/XEN Modified: stable/10/sys/i386/conf/XEN ============================================================================== --- stable/10/sys/i386/conf/XEN Thu Jun 5 12:53:06 2014 (r267106) +++ stable/10/sys/i386/conf/XEN Thu Jun 5 13:08:08 2014 (r267107) @@ -6,7 +6,7 @@ cpu I686_CPU ident XEN -makeoptions DEBUG=-g +makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols # The following modules don't build with PAE and XEN enabled. makeoptions WITHOUT_MODULES="ctl cxgb dpt drm drm2 hptmv ida malo mwl rdma" From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 15:16:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0BD6AC48; Thu, 5 Jun 2014 15:16: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 EC83028A7; Thu, 5 Jun 2014 15:16: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 s55FGiVg019333; Thu, 5 Jun 2014 15:16:44 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55FGiRL019332; Thu, 5 Jun 2014 15:16:44 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201406051516.s55FGiRL019332@svn.freebsd.org> From: Hajimu UMEMOTO Date: Thu, 5 Jun 2014 15:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267111 - stable/10/lib/libcrypt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 15:16:45 -0000 Author: ume Date: Thu Jun 5 15:16:44 2014 New Revision: 267111 URL: http://svnweb.freebsd.org/changeset/base/267111 Log: MFH r266813: Don't break the legacy applications which set just 2 bytes to salt. Modified: stable/10/lib/libcrypt/crypt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcrypt/crypt.c ============================================================================== --- stable/10/lib/libcrypt/crypt.c Thu Jun 5 14:19:32 2014 (r267110) +++ stable/10/lib/libcrypt/crypt.c Thu Jun 5 15:16:44 2014 (r267111) @@ -104,12 +104,16 @@ char * crypt(const char *passwd, const char *salt) { const struct crypt_format *cf; +#ifdef HAS_DES + int len; +#endif for (cf = crypt_formats; cf->name != NULL; ++cf) if (cf->magic != NULL && strstr(salt, cf->magic) == salt) return (cf->func(passwd, salt)); #ifdef HAS_DES - if (strlen(salt) == 13 && strspn(salt, DES_SALT_ALPHABET) == 13) + len = strlen(salt); + if ((len == 13 || len == 2) && strspn(salt, DES_SALT_ALPHABET) == len) return (crypt_des(passwd, salt)); #endif return (crypt_format->func(passwd, salt)); From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 15:21:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 42F3F24B; Thu, 5 Jun 2014 15:21: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 148BB296F; Thu, 5 Jun 2014 15:21: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 s55FLPHl021723; Thu, 5 Jun 2014 15:21:25 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55FLPk4021718; Thu, 5 Jun 2014 15:21:25 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201406051521.s55FLPk4021718@svn.freebsd.org> From: Bryan Drewery Date: Thu, 5 Jun 2014 15:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267113 - in stable/10: etc etc/mtree usr.sbin/newsyslog X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 15:21:26 -0000 Author: bdrewery Date: Thu Jun 5 15:21:25 2014 New Revision: 267113 URL: http://svnweb.freebsd.org/changeset/base/267113 Log: MFC r266463: - Include /etc/newsyslog.conf.d/* and /usr/local/etc/newsyslog.conf.d/* by default for newsyslog(8). Modified: stable/10/etc/mtree/BSD.root.dist stable/10/etc/newsyslog.conf stable/10/usr.sbin/newsyslog/newsyslog.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.root.dist ============================================================================== --- stable/10/etc/mtree/BSD.root.dist Thu Jun 5 15:18:49 2014 (r267112) +++ stable/10/etc/mtree/BSD.root.dist Thu Jun 5 15:21:25 2014 (r267113) @@ -38,6 +38,8 @@ .. mtree .. + newsyslog.conf.d + .. ntp mode=0700 .. pam.d Modified: stable/10/etc/newsyslog.conf ============================================================================== --- stable/10/etc/newsyslog.conf Thu Jun 5 15:18:49 2014 (r267112) +++ stable/10/etc/newsyslog.conf Thu Jun 5 15:21:25 2014 (r267113) @@ -38,3 +38,6 @@ /var/log/utx.log 644 3 * @01T05 B /var/log/weekly.log 640 5 * $W6D0 JN /var/log/xferlog 600 7 100 * JC + + /etc/newsyslog.conf.d/* + /usr/local/etc/newsyslog.conf.d/* Modified: stable/10/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.8 Thu Jun 5 15:18:49 2014 (r267112) +++ stable/10/usr.sbin/newsyslog/newsyslog.8 Thu Jun 5 15:21:25 2014 (r267113) @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd January 31, 2011 +.Dd May 19, 2014 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -261,10 +261,16 @@ If additional command line arguments are will only examine log files that match those arguments; otherwise, it will examine all files listed in the configuration file. .Sh FILES -.Bl -tag -width /etc/newsyslog.confxxxx -compact +.Bl -tag -width /usr/local/etc/newsyslog.conf.d -compact .It Pa /etc/newsyslog.conf .Nm configuration file +.It Pa /etc/newsyslog.conf.d +Each file in this directory will be included by the default +.Pa newsyslog.conf . +.It Pa /usr/local/etc/newsyslog.conf.d +Each file in this directory will be included by the default +.Pa newsyslog.conf . .El .Sh COMPATIBILITY Previous versions of the From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 15:34:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 210DCB17 for ; Thu, 5 Jun 2014 15:34:19 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 060BD2AF9 for ; Thu, 5 Jun 2014 15:34:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s55FYIM3085399 for ; Thu, 5 Jun 2014 15:34:18 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s55FYILl085391 for svn-src-stable-10@freebsd.org; Thu, 5 Jun 2014 15:34:18 GMT (envelope-from bdrewery) Received: (qmail 19312 invoked from network); 5 Jun 2014 10:34:16 -0500 Received: from unknown (HELO blah) (freebsd@shatow.net@67.182.131.225) by sweb.xzibition.com with ESMTPA; 5 Jun 2014 10:34:16 -0500 Message-ID: <53908DFA.2050206@FreeBSD.org> Date: Thu, 05 Jun 2014 10:34:18 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r267113 - in stable/10: etc etc/mtree usr.sbin/newsyslog References: <201406051521.s55FLPk4021718@svn.freebsd.org> In-Reply-To: <201406051521.s55FLPk4021718@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: re@FreeBSD.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 15:34:19 -0000 On 6/5/14, 10:21 AM, Bryan Drewery wrote: > Author: bdrewery > Date: Thu Jun 5 15:21:25 2014 > New Revision: 267113 > URL: http://svnweb.freebsd.org/changeset/base/267113 > > Log: > MFC r266463: > > - Include /etc/newsyslog.conf.d/* and /usr/local/etc/newsyslog.conf.d/* by > default for newsyslog(8). Relnotes: yes I'll update my mfc script to copy that in. -- Regards, Bryan Drewery From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 5 23:56:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CD1DAD1D; Thu, 5 Jun 2014 23:56: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 B94182981; Thu, 5 Jun 2014 23:56: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 s55Nu6Yl062972; Thu, 5 Jun 2014 23:56:06 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55Nu6Iu062971; Thu, 5 Jun 2014 23:56:06 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406052356.s55Nu6Iu062971@svn.freebsd.org> From: Glen Barber Date: Thu, 5 Jun 2014 23:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267135 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 23:56:06 -0000 Author: gjb Date: Thu Jun 5 23:56:06 2014 New Revision: 267135 URL: http://svnweb.freebsd.org/changeset/base/267135 Log: Document r267113, newsyslog.conf(5) includes in conf.d. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 5 23:53:47 2014 (r267134) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 5 23:56:06 2014 (r267135) @@ -240,6 +240,12 @@ to filter by &man.jail.8; ID or name, in followup to the &man.ps.1; change in r265229. + The default &man.newsyslog.conf.5; now + includes files in the + /etc/newsyslog.conf.d/ and + /usr/local/etc/newsyslog.conf.d/ + directories by default for &man.newsyslog.8;. + <filename>/etc/rc.d</filename> Scripts From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 6 00:13:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 86E7E44C; Fri, 6 Jun 2014 00:13: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 58CE42B1F; Fri, 6 Jun 2014 00:13: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 s560DdeA073022; Fri, 6 Jun 2014 00:13:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s560DdSq073021; Fri, 6 Jun 2014 00:13:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406060013.s560DdSq073021@svn.freebsd.org> From: Xin LI Date: Fri, 6 Jun 2014 00:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267138 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 00:13:39 -0000 Author: delphij Date: Fri Jun 6 00:13:38 2014 New Revision: 267138 URL: http://svnweb.freebsd.org/changeset/base/267138 Log: MFC r266915: MFV 266913+266914: 3897 zfs filesystem and snapshot limits (fix leak) 4901 zfs filesystem/snapshot limit leaks Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Fri Jun 6 00:12:21 2014 (r267137) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Fri Jun 6 00:13:38 2014 (r267138) @@ -489,7 +489,7 @@ dsl_dir_init_fs_ss_count(dsl_dir_t *dd, zap_attribute_t *za; dsl_dataset_t *ds; - ASSERT(spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)); + ASSERT(spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)); ASSERT(dsl_pool_config_held(dp)); ASSERT(dmu_tx_is_syncing(tx)); @@ -549,6 +549,7 @@ dsl_dir_init_fs_ss_count(dsl_dir_t *dd, if (za->za_name[0] != '%') my_ss_cnt++; } + zap_cursor_fini(zc); dsl_dataset_rele(ds, FTAG); @@ -1717,7 +1718,7 @@ dsl_dir_rename_check(void *arg, dmu_tx_t } if (dmu_tx_is_syncing(tx)) { - if (spa_feature_is_enabled(dp->dp_spa, + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)) { /* * Although this is the check function and we don't @@ -1745,8 +1746,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t err = zap_lookup(os, dd->dd_object, DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1, &fs_cnt); - if (err != ENOENT && err != 0) + if (err != ENOENT && err != 0) { + dsl_dir_rele(newparent, FTAG); + dsl_dir_rele(dd, FTAG); return (err); + } /* * have to add 1 for the filesystem itself that we're @@ -1757,8 +1761,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t err = zap_lookup(os, dd->dd_object, DD_FIELD_SNAPSHOT_COUNT, sizeof (ss_cnt), 1, &ss_cnt); - if (err != ENOENT && err != 0) + if (err != ENOENT && err != 0) { + dsl_dir_rele(newparent, FTAG); + dsl_dir_rele(dd, FTAG); return (err); + } } /* no rename into our descendant */ @@ -1809,7 +1816,7 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t * We already made sure the dd counts were initialized in the * check function. */ - if (spa_feature_is_enabled(dp->dp_spa, + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)) { VERIFY0(zap_lookup(os, dd->dd_object, DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1, From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 6 01:35:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8A9B0DF; Fri, 6 Jun 2014 01:35: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 770DC21E0; Fri, 6 Jun 2014 01:35: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 s561ZrNL009784; Fri, 6 Jun 2014 01:35:53 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s561Zr2q009783; Fri, 6 Jun 2014 01:35:53 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406060135.s561Zr2q009783@svn.freebsd.org> From: Ed Maste Date: Fri, 6 Jun 2014 01:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267143 - stable/10/usr.sbin/pmcstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 01:35:53 -0000 Author: emaste Date: Fri Jun 6 01:35:52 2014 New Revision: 267143 URL: http://svnweb.freebsd.org/changeset/base/267143 Log: MFC r266903: Update default callchain depth to 16 to match kernel Modified: stable/10/usr.sbin/pmcstat/pmcstat.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pmcstat/pmcstat.h ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat.h Fri Jun 6 00:24:04 2014 (r267142) +++ stable/10/usr.sbin/pmcstat/pmcstat.h Fri Jun 6 01:35:52 2014 (r267143) @@ -61,7 +61,7 @@ #define DEFAULT_DISPLAY_HEIGHT 256 /* file virtual height */ #define DEFAULT_DISPLAY_WIDTH 1024 /* file virtual width */ #define DEFAULT_BUFFER_SIZE 4096 -#define DEFAULT_CALLGRAPH_DEPTH 4 +#define DEFAULT_CALLGRAPH_DEPTH 16 #define PRINT_HEADER_PREFIX "# " #define READPIPEFD 0 From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 6 12:37:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1430BB0E; Fri, 6 Jun 2014 12:37: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 0032D2B72; Fri, 6 Jun 2014 12:37: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 s56Cbu2h012132; Fri, 6 Jun 2014 12:37:56 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56CbuAr012129; Fri, 6 Jun 2014 12:37:56 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201406061237.s56CbuAr012129@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 6 Jun 2014 12:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267156 - stable/10/sys/geom/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 12:37:57 -0000 Author: ae Date: Fri Jun 6 12:37:56 2014 New Revision: 267156 URL: http://svnweb.freebsd.org/changeset/base/267156 Log: MFC r266880: Use g_conf_printf_escaped() to escape symbols, which can break an XML tree. Modified: stable/10/sys/geom/part/g_part_apm.c stable/10/sys/geom/part/g_part_gpt.c stable/10/sys/geom/part/g_part_pc98.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/part/g_part_apm.c ============================================================================== --- stable/10/sys/geom/part/g_part_apm.c Fri Jun 6 12:06:40 2014 (r267155) +++ stable/10/sys/geom/part/g_part_apm.c Fri Jun 6 12:37:56 2014 (r267156) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -310,10 +311,14 @@ g_part_apm_dumpconf(struct g_part_table /* confxml: partition entry information */ strncpy(u.name, entry->ent.ent_name, APM_ENT_NAMELEN); u.name[APM_ENT_NAMELEN] = '\0'; - sbuf_printf(sb, "%s\n", indent, u.name); + sbuf_printf(sb, "%s\n"); strncpy(u.type, entry->ent.ent_type, APM_ENT_TYPELEN); u.type[APM_ENT_TYPELEN] = '\0'; - sbuf_printf(sb, "%s%s\n", indent, u.type); + sbuf_printf(sb, "%s", indent); + g_conf_printf_escaped(sb, "%s", u.type); + sbuf_printf(sb, "\n"); } else { /* confxml: scheme information */ } Modified: stable/10/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/10/sys/geom/part/g_part_gpt.c Fri Jun 6 12:06:40 2014 (r267155) +++ stable/10/sys/geom/part/g_part_gpt.c Fri Jun 6 12:37:56 2014 (r267156) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -1230,16 +1231,16 @@ g_gpt_printf_utf16(struct sbuf *sb, uint /* Write the Unicode character in UTF-8 */ if (ch < 0x80) - sbuf_printf(sb, "%c", ch); + g_conf_printf_escaped(sb, "%c", ch); else if (ch < 0x800) - sbuf_printf(sb, "%c%c", 0xc0 | (ch >> 6), + g_conf_printf_escaped(sb, "%c%c", 0xc0 | (ch >> 6), 0x80 | (ch & 0x3f)); else if (ch < 0x10000) - sbuf_printf(sb, "%c%c%c", 0xe0 | (ch >> 12), + g_conf_printf_escaped(sb, "%c%c%c", 0xe0 | (ch >> 12), 0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f)); else if (ch < 0x200000) - sbuf_printf(sb, "%c%c%c%c", 0xf0 | (ch >> 18), - 0x80 | ((ch >> 12) & 0x3f), + g_conf_printf_escaped(sb, "%c%c%c%c", 0xf0 | + (ch >> 18), 0x80 | ((ch >> 12) & 0x3f), 0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f)); } } Modified: stable/10/sys/geom/part/g_part_pc98.c ============================================================================== --- stable/10/sys/geom/part/g_part_pc98.c Fri Jun 6 12:06:40 2014 (r267155) +++ stable/10/sys/geom/part/g_part_pc98.c Fri Jun 6 12:37:56 2014 (r267156) @@ -300,7 +300,9 @@ g_part_pc98_dumpconf(struct g_part_table sbuf_printf(sb, " xs PC98 xt %u sn %s", type, name); } else { /* confxml: partition entry information */ - sbuf_printf(sb, "%s\n", indent, name); + sbuf_printf(sb, "%s\n"); if (entry->ent.dp_mid & PC98_MID_BOOTABLE) sbuf_printf(sb, "%sbootable\n", indent); From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 6 13:37:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DD920D0; Fri, 6 Jun 2014 13:37: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 B018921B4; Fri, 6 Jun 2014 13:37: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 s56DbeGM040948; Fri, 6 Jun 2014 13:37:40 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56Dbet4040947; Fri, 6 Jun 2014 13:37:40 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201406061337.s56Dbet4040947@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 6 Jun 2014 13:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267161 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 13:37:41 -0000 Author: jilles Date: Fri Jun 6 13:37:40 2014 New Revision: 267161 URL: http://svnweb.freebsd.org/changeset/base/267161 Log: MFC r264417: realpath(): Properly fail "." or ".." components after non-directories. If realpath() is called on pathnames like "/dev/null/." or "/dev/null/..", it should fail with [ENOTDIR]. Pathnames like "/dev/null/" already failed as they should. Also, put the check for non-directories after lstatting the previous component instead of when the empty component (consecutive or trailing slashes) is detected, saving an lstat() call and some lines of code. PR: 82980 Modified: stable/10/lib/libc/stdlib/realpath.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/realpath.c ============================================================================== --- stable/10/lib/libc/stdlib/realpath.c Fri Jun 6 13:36:52 2014 (r267160) +++ stable/10/lib/libc/stdlib/realpath.c Fri Jun 6 13:37:40 2014 (r267161) @@ -132,26 +132,7 @@ realpath(const char * __restrict path, c resolved[resolved_len] = '\0'; } if (next_token[0] == '\0') { - /* - * Handle consequential slashes. The path - * before slash shall point to a directory. - * - * Only the trailing slashes are not covered - * by other checks in the loop, but we verify - * the prefix for any (rare) "//" or "/\0" - * occurrence to not implement lookahead. - */ - if (lstat(resolved, &sb) != 0) { - if (m) - free(resolved); - return (NULL); - } - if (!S_ISDIR(sb.st_mode)) { - if (m) - free(resolved); - errno = ENOTDIR; - return (NULL); - } + /* Handle consequential slashes. */ continue; } else if (strcmp(next_token, ".") == 0) @@ -236,6 +217,11 @@ realpath(const char * __restrict path, c } } left_len = strlcpy(left, symlink, sizeof(left)); + } else if (!S_ISDIR(sb.st_mode) && p != NULL) { + if (m) + free(resolved); + errno = ENOTDIR; + return (NULL); } } From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 6 17:42:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6B6D33A2; Fri, 6 Jun 2014 17: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 4CDF42BED; Fri, 6 Jun 2014 17:42: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 s56HgurI056439; Fri, 6 Jun 2014 17:42:56 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56HgtxI056436; Fri, 6 Jun 2014 17:42:55 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201406061742.s56HgtxI056436@svn.freebsd.org> From: Alan Somers Date: Fri, 6 Jun 2014 17:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267175 - in stable/10: sys/netinet tests/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 17:42:56 -0000 Author: asomers Date: Fri Jun 6 17:42:55 2014 New Revision: 267175 URL: http://svnweb.freebsd.org/changeset/base/267175 Log: MFC r263779 Correct ARP update handling when the routes for network interfaces are restricted to a single FIB in a multifib system. Restricting an interface's routes to the FIB to which it is assigned (by setting net.add_addr_allfibs=0) causes ARP updates to fail with "arpresolve: can't allocate llinfo for x.x.x.x". This is due to the ARP update code hard coding it's lookup for existing routing entries to FIB 0. sys/netinet/in.c: When dealing with RTM_ADD (add route) requests for an interface, use the interface's assigned FIB instead of the default (FIB 0). sys/netinet/if_ether.c: In arpresolve(), enhance error message generated when an lla_lookup() fails so that the interface causing the error is visible in logs. tests/sys/netinet/fibs_test.sh Clear ATF expected error. Modified: stable/10/sys/netinet/if_ether.c stable/10/sys/netinet/in.c stable/10/tests/sys/netinet/fibs_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/if_ether.c ============================================================================== --- stable/10/sys/netinet/if_ether.c Fri Jun 6 17:38:37 2014 (r267174) +++ stable/10/sys/netinet/if_ether.c Fri Jun 6 17:42:55 2014 (r267175) @@ -338,8 +338,8 @@ retry: if (la == NULL) { if (flags & LLE_CREATE) log(LOG_DEBUG, - "arpresolve: can't allocate llinfo for %s\n", - inet_ntoa(SIN(dst)->sin_addr)); + "arpresolve: can't allocate llinfo for %s on %s\n", + inet_ntoa(SIN(dst)->sin_addr), ifp->if_xname); m_freem(m); return (EINVAL); } Modified: stable/10/sys/netinet/in.c ============================================================================== --- stable/10/sys/netinet/in.c Fri Jun 6 17:38:37 2014 (r267174) +++ stable/10/sys/netinet/in.c Fri Jun 6 17:42:55 2014 (r267175) @@ -1303,8 +1303,9 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - /* XXX rtalloc1 should take a const param */ - rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); + /* XXX rtalloc1_fib should take a const param */ + rt = rtalloc1_fib(__DECONST(struct sockaddr *, l3addr), 0, 0, + ifp->if_fib); if (rt == NULL) return (EINVAL); Modified: stable/10/tests/sys/netinet/fibs_test.sh ============================================================================== --- stable/10/tests/sys/netinet/fibs_test.sh Fri Jun 6 17:38:37 2014 (r267174) +++ stable/10/tests/sys/netinet/fibs_test.sh Fri Jun 6 17:42:55 2014 (r267175) @@ -55,7 +55,6 @@ arpresolve_checks_interface_fib_head() } arpresolve_checks_interface_fib_body() { - atf_expect_fail "kern/167947 arpresolve checks only the default FIB for the interface route" # Configure the TAP interfaces to use a RFC5737 nonrouteable addresses # and a non-default fib ADDR0="192.0.2.2" From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 6 20:35:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 163B9FC7; Fri, 6 Jun 2014 20:35: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 00CA12BF3; Fri, 6 Jun 2014 20:35: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 s56KZfiL037568; Fri, 6 Jun 2014 20:35:41 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56KZeDJ037562; Fri, 6 Jun 2014 20:35:40 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201406062035.s56KZeDJ037562@svn.freebsd.org> From: Alan Somers Date: Fri, 6 Jun 2014 20:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267186 - in stable/10: sys/net sys/netinet tests/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 20:35:42 -0000 Author: asomers Date: Fri Jun 6 20:35:40 2014 New Revision: 267186 URL: http://svnweb.freebsd.org/changeset/base/267186 Log: MFC changes relating to running multiple interfaces on different fibs but with addresses on the same subnet. MFC r266860 Fix unintended KBI change from r264905. Add _fib versions of ifa_ifwithnet() and ifa_ifwithdstaddr() The legacy functions will call the _fib() versions with RT_ALL_FIBS, preserving legacy behavior. sys/net/if_var.h sys/net/if.c Add legacy-compatible functions as described above. Ensure legacy behavior when RT_ALL_FIBS is passed as fibnum. sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/net/route.c sys/net/rtsock.c sys/netinet6/nd6.c Call with _fib() functions if we must use a specific fib, or the legacy functions otherwise. tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c Improve the udp_dontroute test. The bug that this test exercises is that ifa_ifwithnet() will return the wrong address, if multiple interfaces have addresses on the same subnet but with different fibs. The previous version of the test only considered one possible failure mode: that ifa_ifwithnet_fib() might fail to find any suitable address at all. The new version also checks whether ifa_ifwithnet_fib() finds the correct address by checking where the ARP request goes. MFC r264917 Style fixes, mostly trailing whitespace elimination. No functional change. MFC r264905 Fix subnet and default routes on different FIBs on the same subnet. These two bugs are closely related. The root cause is that ifa_ifwithnet does not consider FIBs when searching for an interface address. sys/net/if_var.h sys/net/if.c Add a fib argument to ifa_ifwithnet and ifa_ifwithdstadddr. Those functions will only return an address whose interface fib equals the argument. sys/net/route.c Update calls to ifa_ifwithnet and ifa_ifwithdstaddr with fib arguments. sys/netinet/in.c Update in_addprefix to consider the interface fib when adding prefixes. This will prevent it from not adding a subnet route when one already exists on a different fib. sys/net/rtsock.c sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/netinet6/nd6.c Add RT_DEFAULT_FIB arguments to ifa_ifwithdstaddr and ifa_ifwithnet. In some cases it there wasn't a clear specific fib number to use. In others, I was unable to test those functions so I chose RT_DEFAULT_FIB to minimize divergence from current behavior. I will fix some of the latter changes along with PR kern/187553. tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c tests/sys/netinet/Makefile Revert r263738. The udp_dontroute test was right all along. However, bugs kern/187550 and kern/187553 cancelled each other out when it came to this test. Because of kern/187553, ifa_ifwithnet searched the default fib instead of the requested one, but because of kern/187550, there was an applicable subnet route on the default fib. The new test added in r263738 doesn't work right, however. I can verify with dtrace that ifa_ifwithnet returned the wrong address before I applied this commit, but route(8) miraculously found the correct interface to use anyway. I don't know how. Clear expected failure messages for kern/187550 and kern/187552. MFC r263738 tests/sys/netinet/Makefile tests/sys/netinet/fibs.sh Replace fibs:udp_dontroute with fibs:src_addr_selection_by_subnet. The original test was poorly written; it was actually testing kern/167947 instead of the desired kern/187553. The root cause of the bug is that ifa_ifwithnet did not have a fib argument. The new test more directly targets that behavior. tests/sys/netinet/udp_dontroute.c Delete the auxilliary binary used by the old test Modified: stable/10/sys/net/if.c stable/10/sys/net/if_var.h stable/10/sys/net/route.c stable/10/sys/netinet/in.c stable/10/tests/sys/netinet/fibs_test.sh stable/10/tests/sys/netinet/udp_dontroute.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Fri Jun 6 20:01:45 2014 (r267185) +++ stable/10/sys/net/if.c Fri Jun 6 20:35:40 2014 (r267186) @@ -1607,7 +1607,7 @@ done: */ /*ARGSUSED*/ struct ifaddr * -ifa_ifwithdstaddr(struct sockaddr *addr) +ifa_ifwithdstaddr_fib(struct sockaddr *addr, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1616,6 +1616,8 @@ ifa_ifwithdstaddr(struct sockaddr *addr) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0) continue; + if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) + continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) @@ -1635,12 +1637,19 @@ done: return (ifa); } +struct ifaddr * +ifa_ifwithdstaddr(struct sockaddr *addr) +{ + + return (ifa_ifwithdstaddr_fib(addr, RT_ALL_FIBS)); +} + /* * Find an interface on a specific network. If many, choice * is most specific found. */ struct ifaddr * -ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) +ifa_ifwithnet_fib(struct sockaddr *addr, int ignore_ptp, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1660,12 +1669,14 @@ ifa_ifwithnet(struct sockaddr *addr, int /* * Scan though each interface, looking for ones that have addresses - * in this address family. Maintain a reference on ifa_maybe once - * we find one, as we release the IF_ADDR_RLOCK() that kept it stable - * when we move onto the next interface. + * in this address family and the requested fib. Maintain a reference + * on ifa_maybe once we find one, as we release the IF_ADDR_RLOCK() that + * kept it stable when we move onto the next interface. */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { + if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) + continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { char *cp, *cp2, *cp3; @@ -1749,6 +1760,13 @@ done: return (ifa); } +struct ifaddr * +ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) +{ + + return (ifa_ifwithnet_fib(addr, ignore_ptp, RT_ALL_FIBS)); +} + /* * Find an interface address specific to an interface best matching * a given address. Modified: stable/10/sys/net/if_var.h ============================================================================== --- stable/10/sys/net/if_var.h Fri Jun 6 20:01:45 2014 (r267185) +++ stable/10/sys/net/if_var.h Fri Jun 6 20:35:40 2014 (r267186) @@ -941,7 +941,9 @@ struct ifaddr *ifa_ifwithaddr(struct soc int ifa_ifwithaddr_check(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); +struct ifaddr *ifa_ifwithdstaddr_fib(struct sockaddr *, int); struct ifaddr *ifa_ifwithnet(struct sockaddr *, int); +struct ifaddr *ifa_ifwithnet_fib(struct sockaddr *, int, int); struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); struct ifaddr *ifa_ifwithroute_fib(int, struct sockaddr *, struct sockaddr *, u_int); struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *); Modified: stable/10/sys/net/route.c ============================================================================== --- stable/10/sys/net/route.c Fri Jun 6 20:01:45 2014 (r267185) +++ stable/10/sys/net/route.c Fri Jun 6 20:35:40 2014 (r267186) @@ -589,7 +589,7 @@ rtredirect_fib(struct sockaddr *dst, } /* verify the gateway is directly reachable */ - if ((ifa = ifa_ifwithnet(gateway, 0)) == NULL) { + if ((ifa = ifa_ifwithnet_fib(gateway, 0, fibnum)) == NULL) { error = ENETUNREACH; goto out; } @@ -746,7 +746,7 @@ ifa_ifwithroute_fib(int flags, struct so */ ifa = NULL; if (flags & RTF_HOST) - ifa = ifa_ifwithdstaddr(dst); + ifa = ifa_ifwithdstaddr_fib(dst, fibnum); if (ifa == NULL) ifa = ifa_ifwithaddr(gateway); } else { @@ -755,10 +755,10 @@ ifa_ifwithroute_fib(int flags, struct so * or host, the gateway may still be on the * other end of a pt to pt link. */ - ifa = ifa_ifwithdstaddr(gateway); + ifa = ifa_ifwithdstaddr_fib(gateway, fibnum); } if (ifa == NULL) - ifa = ifa_ifwithnet(gateway, 0); + ifa = ifa_ifwithnet_fib(gateway, 0, fibnum); if (ifa == NULL) { struct rtentry *rt = rtalloc1_fib(gateway, 0, RTF_RNH_LOCKED, fibnum); if (rt == NULL) @@ -872,7 +872,7 @@ rt_getifa_fib(struct rt_addrinfo *info, */ if (info->rti_ifp == NULL && ifpaddr != NULL && ifpaddr->sa_family == AF_LINK && - (ifa = ifa_ifwithnet(ifpaddr, 0)) != NULL) { + (ifa = ifa_ifwithnet_fib(ifpaddr, 0, fibnum)) != NULL) { info->rti_ifp = ifa->ifa_ifp; ifa_free(ifa); } Modified: stable/10/sys/netinet/in.c ============================================================================== --- stable/10/sys/netinet/in.c Fri Jun 6 20:01:45 2014 (r267185) +++ stable/10/sys/netinet/in.c Fri Jun 6 20:35:40 2014 (r267186) @@ -908,7 +908,7 @@ in_addprefix(struct in_ifaddr *target, i { struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; - int error, fibnum; + int error; if ((flags & RTF_HOST) != 0) { prefix = target->ia_dstaddr.sin_addr; @@ -919,9 +919,8 @@ in_addprefix(struct in_ifaddr *target, i prefix.s_addr &= mask.s_addr; } - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; - IN_IFADDR_RLOCK(); + /* Look for an existing address with the same prefix, mask, and fib */ TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (rtinitflags(ia)) { p = ia->ia_dstaddr.sin_addr; @@ -937,6 +936,8 @@ in_addprefix(struct in_ifaddr *target, i mask.s_addr != m.s_addr) continue; } + if (target->ia_ifp->if_fib != ia->ia_ifp->if_fib) + continue; /* * If we got a matching prefix route inserted by other @@ -955,6 +956,10 @@ in_addprefix(struct in_ifaddr *target, i IN_IFADDR_RUNLOCK(); return (EEXIST); } else { + int fibnum; + + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + target->ia_ifp->if_fib; rt_addrmsg(RTM_ADD, &target->ia_ifa, fibnum); IN_IFADDR_RUNLOCK(); return (0); Modified: stable/10/tests/sys/netinet/fibs_test.sh ============================================================================== --- stable/10/tests/sys/netinet/fibs_test.sh Fri Jun 6 20:01:45 2014 (r267185) +++ stable/10/tests/sys/netinet/fibs_test.sh Fri Jun 6 20:35:40 2014 (r267186) @@ -176,7 +176,6 @@ default_route_with_multiple_fibs_on_same default_route_with_multiple_fibs_on_same_subnet_body() { - atf_expect_fail "kern/187552 default route uses the wrong interface when multiple interfaces have the same subnet but different fibs" # Configure the TAP interfaces to use a RFC5737 nonrouteable addresses # and a non-default fib ADDR0="192.0.2.2" @@ -226,7 +225,6 @@ subnet_route_with_multiple_fibs_on_same_ subnet_route_with_multiple_fibs_on_same_subnet_body() { - atf_expect_fail "kern/187550 Multiple interfaces on different FIBs but the same subnet don't all have a subnet route" # Configure the TAP interfaces to use a RFC5737 nonrouteable addresses # and a non-default fib ADDR0="192.0.2.2" @@ -258,6 +256,15 @@ subnet_route_with_multiple_fibs_on_same_ # SO_DONTROUTE set that are sent on non-default FIBs. # This bug was discovered with "setfib 1 netperf -t UDP_STREAM -H some_host" # Regression test for kern/187553 +# +# The root cause was that ifa_ifwithnet() did not have a fib argument. It +# would return an address from an interface on any FIB that had a subnet route +# for the destination. If more than one were available, it would choose the +# most specific. This is most easily tested by creating a FIB without a +# default route, then trying to send a UDP packet with SO_DONTROUTE set to an +# address which is not routable on that FIB. Absent the fix for this bug, +# in_pcbladdr would choose an interface on any FIB with a default route. With +# the fix, you will get EUNREACH or ENETUNREACH. atf_test_case udp_dontroute cleanup udp_dontroute_head() { @@ -271,25 +278,38 @@ udp_dontroute_body() atf_expect_fail "kern/187553 Source address selection for UDP packets with SO_DONTROUTE uses the default FIB" # Configure the TAP interface to use an RFC5737 nonrouteable address # and a non-default fib - ADDR="192.0.2.2" + ADDR0="192.0.2.2" + ADDR1="192.0.2.3" SUBNET="192.0.2.0" MASK="24" # Use a different IP on the same subnet as the target TARGET="192.0.2.100" + SRCDIR=`atf_get_srcdir` # Check system configuration if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then atf_skip "This test requires net.add_addr_allfibs=0" fi - get_fibs 1 + get_fibs 2 - # Configure a TAP interface - setup_tap ${FIB0} ${ADDR} ${MASK} + # Configure the TAP interfaces + setup_tap ${FIB0} ${ADDR0} ${MASK} + TARGET_TAP=${TAP} + setup_tap ${FIB1} ${ADDR1} ${MASK} # Send a UDP packet with SO_DONTROUTE. In the failure case, it will - # return ENETUNREACH - SRCDIR=`atf_get_srcdir` - atf_check -o ignore setfib ${FIB0} ${SRCDIR}/udp_dontroute ${TARGET} + # return ENETUNREACH, or send the packet to the wrong tap + atf_check -o ignore setfib ${FIB0} \ + ${SRCDIR}/udp_dontroute ${TARGET} /dev/${TARGET_TAP} + cleanup_tap + + # Repeat, but this time target the other tap + setup_tap ${FIB0} ${ADDR0} ${MASK} + setup_tap ${FIB1} ${ADDR1} ${MASK} + TARGET_TAP=${TAP} + + atf_check -o ignore setfib ${FIB1} \ + ${SRCDIR}/udp_dontroute ${TARGET} /dev/${TARGET_TAP} } udp_dontroute_cleanup() @@ -367,4 +387,5 @@ cleanup_tap() for TAPD in `cat "tap_devices_to_cleanup"`; do ifconfig ${TAPD} destroy done + rm "tap_devices_to_cleanup" } Modified: stable/10/tests/sys/netinet/udp_dontroute.c ============================================================================== --- stable/10/tests/sys/netinet/udp_dontroute.c Fri Jun 6 20:01:45 2014 (r267185) +++ stable/10/tests/sys/netinet/udp_dontroute.c Fri Jun 6 20:35:40 2014 (r267186) @@ -39,9 +39,11 @@ #include #include +#include #include #include #include +#include /* * Sends a single UDP packet to the provided address, with SO_DONTROUTE set @@ -51,23 +53,31 @@ int main(int argc, char **argv) { struct sockaddr_in dst; - int s; + int s, t; int opt; int ret; - const char* buf = "Hello, World!"; + ssize_t len; + const char* sendbuf = "Hello, World!"; + const size_t buflen = 80; + char recvbuf[buflen]; - if (argc != 2) { - fprintf(stderr, "Usage: %s ip_address\n", argv[0]); + if (argc != 3) { + fprintf(stderr, "Usage: %s ip_address tapdev\n", argv[0]); exit(2); } + + t = open(argv[2], O_RDWR | O_NONBLOCK); + if (t < 0) + err(EXIT_FAILURE, "open"); + s = socket(PF_INET, SOCK_DGRAM, 0); if (s < 0) - err(errno, "socket"); + err(EXIT_FAILURE, "socket"); opt = 1; ret = setsockopt(s, SOL_SOCKET, SO_DONTROUTE, &opt, sizeof(opt)); if (ret == -1) - err(errno, "setsockopt(SO_DONTROUTE)"); + err(EXIT_FAILURE, "setsockopt(SO_DONTROUTE)"); dst.sin_len = sizeof(dst); dst.sin_family = AF_INET; @@ -77,10 +87,25 @@ main(int argc, char **argv) fprintf(stderr, "Invalid address: %s\n", argv[1]); exit(2); } - ret = sendto(s, buf, strlen(buf), 0, (struct sockaddr*)&dst, + ret = sendto(s, sendbuf, strlen(sendbuf), 0, (struct sockaddr*)&dst, dst.sin_len); if (ret == -1) - err(errno, "sendto"); + err(EXIT_FAILURE, "sendto"); + + /* Verify that the packet went to the desired tap device */ + len = read(t, recvbuf, buflen); + if (len == 0) + errx(EXIT_FAILURE, "read returned EOF"); + else if (len < 0 && errno == EAGAIN) + errx(EXIT_FAILURE, "Did not receive any packets"); + else if (len < 0) + err(EXIT_FAILURE, "read"); + + /* + * If read returned anything at all, consider it a success. The packet + * should be an Ethernet frame containing an ARP request for + * ip_address. We won't bother to decode it + */ return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 6 21:45:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B9F2C637; Fri, 6 Jun 2014 21:45: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 A5A8622C0; Fri, 6 Jun 2014 21:45: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 s56LjFO2073881; Fri, 6 Jun 2014 21:45:15 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56LjEKQ073872; Fri, 6 Jun 2014 21:45:14 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201406062145.s56LjEKQ073872@svn.freebsd.org> From: Alan Somers Date: Fri, 6 Jun 2014 21:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267193 - in stable/10: sys/net sys/netinet tests/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 21:45:15 -0000 Author: asomers Date: Fri Jun 6 21:45:14 2014 New Revision: 267193 URL: http://svnweb.freebsd.org/changeset/base/267193 Log: MFC r264887 Fix host and network routes for new interfaces when net.add_addr_allfibs=0 sys/net/route.c In rtinit1, use the interface fib instead of the process fib. The latter wasn't very useful because ifconfig(8) is usually invoked with the default process fib. Changing ifconfig(8) to use setfib(2) would be redundant, because it already sets the interface fib. tests/sys/netinet/fibs_test.sh Clear the expected ATF failure sys/net/if.c Pass the interface fib in calls to rtrequest1_fib and rtalloc1_fib sys/netinet/in.c sys/net/if_var.h Add a fibnum argument to ifa_switch_loopback_route, a subroutine of in_scrubprefix. Pass it the interface fib. Modified: stable/10/sys/net/if.c stable/10/sys/net/route.c stable/10/sys/netinet/in.c stable/10/tests/sys/netinet/fibs_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Fri Jun 6 21:39:16 2014 (r267192) +++ stable/10/sys/net/if.c Fri Jun 6 21:45:14 2014 (r267193) @@ -1458,7 +1458,7 @@ ifa_add_loopback_route(struct ifaddr *if info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); + error = rtrequest1_fib(RTM_ADD, &info, &rt, ifa->ifa_ifp->if_fib); if (error == 0 && rt != NULL) { RT_LOCK(rt); @@ -1490,7 +1490,7 @@ ifa_del_loopback_route(struct ifaddr *if info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); + error = rtrequest1_fib(RTM_DELETE, &info, NULL, ifa->ifa_ifp->if_fib); if (error != 0) log(LOG_DEBUG, "%s: deletion failed: %u\n", __func__, error); Modified: stable/10/sys/net/route.c ============================================================================== --- stable/10/sys/net/route.c Fri Jun 6 21:39:16 2014 (r267192) +++ stable/10/sys/net/route.c Fri Jun 6 21:45:14 2014 (r267193) @@ -1543,7 +1543,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int } if (fibnum == RT_ALL_FIBS) { if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { - startfib = endfib = curthread->td_proc->p_fibnum; + startfib = endfib = ifa->ifa_ifp->if_fib; } else { startfib = 0; endfib = rt_numfibs - 1; Modified: stable/10/sys/netinet/in.c ============================================================================== --- stable/10/sys/netinet/in.c Fri Jun 6 21:39:16 2014 (r267192) +++ stable/10/sys/netinet/in.c Fri Jun 6 21:45:14 2014 (r267193) @@ -1007,10 +1007,12 @@ in_scrubprefix(struct in_ifaddr *target, (target->ia_flags & IFA_RTSELF)) { struct route ia_ro; int freeit = 0; + int fib; bzero(&ia_ro, sizeof(ia_ro)); *((struct sockaddr_in *)(&ia_ro.ro_dst)) = target->ia_addr; - rtalloc_ign_fib(&ia_ro, 0, 0); + fib = target->ia_ifa.ifa_ifp->if_fib; + rtalloc_ign_fib(&ia_ro, 0, fib); if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && (ia_ro.ro_rt->rt_ifp == V_loif)) { RT_LOCK(ia_ro.ro_rt); Modified: stable/10/tests/sys/netinet/fibs_test.sh ============================================================================== --- stable/10/tests/sys/netinet/fibs_test.sh Fri Jun 6 21:39:16 2014 (r267192) +++ stable/10/tests/sys/netinet/fibs_test.sh Fri Jun 6 21:45:14 2014 (r267193) @@ -116,7 +116,6 @@ loopback_and_network_routes_on_nondefaul loopback_and_network_routes_on_nondefault_fib_body() { - atf_expect_fail "kern/187549 Host and network routes for a new interface appear in the wrong FIB" # Configure the TAP interface to use an RFC5737 nonrouteable address # and a non-default fib ADDR="192.0.2.2" From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 6 22:14:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5458CE9; Fri, 6 Jun 2014 22:14: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 34635257C; Fri, 6 Jun 2014 22:14: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 s56MEQWx088187; Fri, 6 Jun 2014 22:14:26 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56MEPDl088184; Fri, 6 Jun 2014 22:14:25 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201406062214.s56MEPDl088184@svn.freebsd.org> From: Alan Somers Date: Fri, 6 Jun 2014 22:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267195 - in stable/10: sys/netinet tests/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 22:14:26 -0000 Author: asomers Date: Fri Jun 6 22:14:25 2014 New Revision: 267195 URL: http://svnweb.freebsd.org/changeset/base/267195 Log: MFC changes related to PR kern/189089. Unlike CURRENT, stable/10 does not panic when you attempt to remove the IP address. But it still fails to remove the address. MFC r265094 Add regression test for PR kern/189088. MFC r265092 Fix a panic when removing an IP address from an interface, if the same address exists on another interface. The panic was introduced by change 264887, which changed the fibnum parameter in the call to rtalloc1_fib() in ifa_switch_loopback_route() from RT_DEFAULT_FIB to RT_ALL_FIBS. The solution is to use the interface fib in that call. For the majority of users, that will be equivalent to the legacy behavior. Modified: stable/10/sys/netinet/in.c stable/10/tests/sys/netinet/fibs_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/in.c ============================================================================== --- stable/10/sys/netinet/in.c Fri Jun 6 21:58:27 2014 (r267194) +++ stable/10/sys/netinet/in.c Fri Jun 6 22:14:25 2014 (r267195) @@ -987,11 +987,9 @@ in_scrubprefix(struct in_ifaddr *target, { struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; - int error = 0, fibnum; + int error = 0; struct sockaddr_in prefix0, mask0; - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; - /* * Remove the loopback route to the interface address. * The "useloopback" setting is not consulted because if the @@ -1046,6 +1044,10 @@ in_scrubprefix(struct in_ifaddr *target, } if ((target->ia_flags & IFA_ROUTE) == 0) { + int fibnum; + + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + target->ia_ifp->if_fib; rt_addrmsg(RTM_DELETE, &target->ia_ifa, fibnum); return (0); } Modified: stable/10/tests/sys/netinet/fibs_test.sh ============================================================================== --- stable/10/tests/sys/netinet/fibs_test.sh Fri Jun 6 21:58:27 2014 (r267194) +++ stable/10/tests/sys/netinet/fibs_test.sh Fri Jun 6 22:14:25 2014 (r267195) @@ -213,6 +213,98 @@ default_route_with_multiple_fibs_on_same } +# Regression test for PR kern/189089 +# Create two tap interfaces and assign them both the same IP address but with +# different netmasks, and both on the default FIB. Then remove one's IP +# address. Hopefully the machine won't panic. +atf_test_case same_ip_multiple_ifaces_fib0 cleanup +same_ip_multiple_ifaces_fib0_head() +{ + atf_set "descr" "Can remove an IP alias from an interface when the same IP is also assigned to another interface." + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} +same_ip_multiple_ifaces_fib0_body() +{ + ADDR="192.0.2.2" + MASK0="24" + MASK1="32" + + # Unlike most of the tests in this file, this is applicable regardless + # of net.add_addr_allfibs + + # Setup the interfaces, then remove one alias. It should not panic. + setup_tap 0 ${ADDR} ${MASK0} + TAP0=${TAP} + setup_tap 0 ${ADDR} ${MASK1} + TAP1=${TAP} + ifconfig ${TAP1} -alias ${ADDR} + + # Do it again, in the opposite order. It should not panic. + setup_tap 0 ${ADDR} ${MASK0} + TAP0=${TAP} + setup_tap 0 ${ADDR} ${MASK1} + TAP1=${TAP} + ifconfig ${TAP0} -alias ${ADDR} +} +same_ip_multiple_ifaces_fib0_cleanup() +{ + cleanup_tap +} + +# Regression test for PR kern/189088 +# Test that removing an IP address works even if the same IP is assigned to a +# different interface, on a different FIB. Tests the same code that whose +# panic was regressed by same_ip_multiple_ifaces_fib0. +# Create two tap interfaces and assign them both the same IP address but with +# different netmasks, and on different FIBs. Then remove one's IP +# address. Hopefully the machine won't panic. Also, the IP's hostroute should +# dissappear from the correct fib. +atf_test_case same_ip_multiple_ifaces cleanup +same_ip_multiple_ifaces_head() +{ + atf_set "descr" "Can remove an IP alias from an interface when the same IP is also assigned to another interface, on non-default FIBs." + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} +same_ip_multiple_ifaces_body() +{ + atf_expect_fail "kern/189088 Assigning the same IP to multiple interfaces in different FIBs creates a host route for only one" + ADDR="192.0.2.2" + MASK0="24" + MASK1="32" + + # Unlike most of the tests in this file, this is applicable regardless + # of net.add_addr_allfibs + get_fibs 2 + + # Setup the interfaces, then remove one alias. It should not panic. + setup_tap ${FIB0} ${ADDR} ${MASK0} + TAP0=${TAP} + setup_tap ${FIB1} ${ADDR} ${MASK1} + TAP1=${TAP} + ifconfig ${TAP1} -alias ${ADDR} + atf_check -o not-match:"^${ADDR}[[:space:]]" \ + setfib ${FIB1} netstat -rn -f inet + + # Do it again, in the opposite order. It should not panic. + setup_tap ${FIB0} ${ADDR} ${MASK0} + TAP0=${TAP} + setup_tap ${FIB1} ${ADDR} ${MASK1} + TAP1=${TAP} + ifconfig ${TAP0} -alias ${ADDR} + atf_check -o not-match:"^${ADDR}[[:space:]]" \ + setfib ${FIB0} netstat -rn -f inet +} +same_ip_multiple_ifaces_cleanup() +{ + # Due to PR kern/189088, we must destroy the interfaces in LIFO order + # in order for the routes to be correctly cleaned up. + for TAPD in `tail -r "tap_devices_to_cleanup"`; do + ifconfig ${TAPD} destroy + done +} + # Regression test for kern/187550 atf_test_case subnet_route_with_multiple_fibs_on_same_subnet cleanup subnet_route_with_multiple_fibs_on_same_subnet_head() @@ -322,6 +414,8 @@ atf_init_test_cases() atf_add_test_case arpresolve_checks_interface_fib atf_add_test_case loopback_and_network_routes_on_nondefault_fib atf_add_test_case default_route_with_multiple_fibs_on_same_subnet + atf_add_test_case same_ip_multiple_ifaces_fib0 + atf_add_test_case same_ip_multiple_ifaces atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet atf_add_test_case udp_dontroute } From owner-svn-src-stable-10@FreeBSD.ORG Sat Jun 7 02:45:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7B7FC1CD; Sat, 7 Jun 2014 02:45: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 680752DFB; Sat, 7 Jun 2014 02:45: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 s572jPtk020847; Sat, 7 Jun 2014 02:45:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s572jONL020842; Sat, 7 Jun 2014 02:45:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406070245.s572jONL020842@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 7 Jun 2014 02:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267200 - in stable/10: lib/libthr/thread libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 02:45:25 -0000 Author: kib Date: Sat Jun 7 02:45:24 2014 New Revision: 267200 URL: http://svnweb.freebsd.org/changeset/base/267200 Log: MFC r266609: Change the _rtld_atfork() to lock the bind lock in write mode. Modified: stable/10/lib/libthr/thread/thr_fork.c stable/10/lib/libthr/thread/thr_rtld.c stable/10/libexec/rtld-elf/rtld_lock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_fork.c ============================================================================== --- stable/10/lib/libthr/thread/thr_fork.c Sat Jun 7 02:38:13 2014 (r267199) +++ stable/10/lib/libthr/thread/thr_fork.c Sat Jun 7 02:45:24 2014 (r267200) @@ -57,6 +57,7 @@ * */ +#include #include "namespace.h" #include #include @@ -174,8 +175,15 @@ _fork(void) was_threaded = 0; } - /* Fork a new process: */ - if ((ret = __sys_fork()) == 0) { + /* + * Fork a new process. + * There is no easy way to pre-resolve the __sys_fork symbol + * without performing the fork. Use the syscall(2) + * indirection, the syscall symbol is resolved in + * _thr_rtld_init() with side-effect free call. + */ + ret = syscall(SYS_fork); + if (ret == 0) { /* Child process */ errsave = errno; curthread->cancel_pending = 0; @@ -250,6 +258,5 @@ _fork(void) } errno = errsave; - /* Return the process ID: */ return (ret); } Modified: stable/10/lib/libthr/thread/thr_rtld.c ============================================================================== --- stable/10/lib/libthr/thread/thr_rtld.c Sat Jun 7 02:38:13 2014 (r267199) +++ stable/10/lib/libthr/thread/thr_rtld.c Sat Jun 7 02:45:24 2014 (r267200) @@ -32,10 +32,12 @@ */ #include #include +#include #include #include #include +#include "libc_private.h" #include "rtld_lock.h" #include "thr_private.h" @@ -207,7 +209,24 @@ _thr_rtld_init(void) li.thread_set_flag = _thr_rtld_set_flag; li.thread_clr_flag = _thr_rtld_clr_flag; li.at_fork = NULL; - + + /* + * Preresolve the symbols needed for the fork interposer. We + * call _rtld_atfork_pre() and _rtld_atfork_post() with NULL + * argument to indicate that no actual locking inside the + * functions should happen. Neither rtld compat locks nor + * libthr rtld locks cannot work there: + * - compat locks do not handle the case of two locks taken + * in write mode (the signal mask for the thread is corrupted); + * - libthr locks would work, but locked rtld_bind_lock prevents + * symbol resolution for _rtld_atfork_post. + */ + _rtld_atfork_pre(NULL); + _rtld_atfork_post(NULL); + _malloc_prefork(); + _malloc_postfork(); + syscall(SYS_getpid); + /* mask signals, also force to resolve __sys_sigprocmask PLT */ _thr_signal_block(curthread); _rtld_thread_init(&li); Modified: stable/10/libexec/rtld-elf/rtld_lock.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld_lock.c Sat Jun 7 02:38:13 2014 (r267199) +++ stable/10/libexec/rtld-elf/rtld_lock.c Sat Jun 7 02:45:24 2014 (r267200) @@ -365,8 +365,19 @@ _rtld_atfork_pre(int *locks) { RtldLockState ls[2]; + if (locks == NULL) + return; + + /* + * Warning: this does not work with the rtld compat locks + * above, since the thread signal mask is corrupted (set to + * all signals blocked) if two locks are taken in write mode. + * The caller of the _rtld_atfork_pre() must provide the + * working implementation of the locks, and libthr locks are + * fine. + */ wlock_acquire(rtld_phdr_lock, &ls[0]); - rlock_acquire(rtld_bind_lock, &ls[1]); + wlock_acquire(rtld_bind_lock, &ls[1]); /* XXXKIB: I am really sorry for this. */ locks[0] = ls[1].lockstate; @@ -378,6 +389,9 @@ _rtld_atfork_post(int *locks) { RtldLockState ls[2]; + if (locks == NULL) + return; + bzero(ls, sizeof(ls)); ls[0].lockstate = locks[2]; ls[1].lockstate = locks[0]; From owner-svn-src-stable-10@FreeBSD.ORG Sat Jun 7 02:49:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EFAF7457; Sat, 7 Jun 2014 02:49: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 DD0D72E28; Sat, 7 Jun 2014 02:49: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 s572ndnJ021747; Sat, 7 Jun 2014 02:49:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s572ndXK021746; Sat, 7 Jun 2014 02:49:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406070249.s572ndXK021746@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 7 Jun 2014 02:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267201 - stable/10/usr.bin/yes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 02:49:40 -0000 Author: kib Date: Sat Jun 7 02:49:39 2014 New Revision: 267201 URL: http://svnweb.freebsd.org/changeset/base/267201 Log: MFC r267067: Cross-reference jot(1) and seq(1). MFC r267098 (by pluknet): mdoc: drop the trailing dot from the xref list. Modified: stable/10/usr.bin/yes/yes.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/yes/yes.1 ============================================================================== --- stable/10/usr.bin/yes/yes.1 Sat Jun 7 02:45:24 2014 (r267200) +++ stable/10/usr.bin/yes/yes.1 Sat Jun 7 02:49:39 2014 (r267201) @@ -28,7 +28,7 @@ .\" @(#)yes.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd June 4, 2014 .Dt YES 1 .Os .Sh NAME @@ -45,6 +45,9 @@ utility outputs or, by default, .Dq y , forever. +.Sh SEE ALSO +.Xr jot 1 , +.Xr seq 1 .Sh HISTORY The .Nm From owner-svn-src-stable-10@FreeBSD.ORG Sat Jun 7 15:23:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AD4DE497 for ; Sat, 7 Jun 2014 15:23:56 +0000 (UTC) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.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 7E9E4264A for ; Sat, 7 Jun 2014 15:23:56 +0000 (UTC) Received: by mail-pb0-f51.google.com with SMTP id ma3so3715674pbc.24 for ; Sat, 07 Jun 2014 08:23:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=jFkkYFpCt67BFwJKcKE6NO5wppbXwEws9aN+P5SbLiQ=; b=WXeTwPu0cRSyWgtVDtyjffUcfUA6THHUvxDEwOczEB9lnxwVkAqqGXvuvkJyEaZqRL k+yIk/XEJhoaYntsUmcJJWHh3u4eOro/uSV1N0SHUQBMj52ZmRTCiy4Jd+Hjgk2w2Hcc 11J45hIDrm3dN6vsgpvsFiXgjbYoO9KacdTtM0ZBm9+7HMf2oEgKgDzfiyQFuiCPZy0a hDmUJA5ANG0jQhdi9uxLlc/Arfi71RzRkWZ2QL2I9pDQg8ZA+yqm5pw2sxQY8DSWjGLP p+x31Qu9vNYhv2HsUe7BFLMBo8LJR+nACjpsWhjMkSD71efbZLwKITxbpqf9TesBCi0y O6zw== X-Gm-Message-State: ALoCoQmaSqAzpBnh9gLOZITeLK9DaYav2ciAKv6cBTu8OL73JVvX8DdjLsD81lYUTPR/TNqGhZuA X-Received: by 10.68.254.5 with SMTP id ae5mr12643083pbd.83.1402154629833; Sat, 07 Jun 2014 08:23:49 -0700 (PDT) Received: from lgmac-cvenus.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id au4sm49827153pbc.10.2014.06.07.08.23.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Jun 2014 08:23:49 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267107 - stable/10/sys/i386/conf In-Reply-To: <201406051308.s55D88mM053472@svn.freebsd.org> Date: Sat, 7 Jun 2014 09:23:47 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <652C13FA-F367-4884-BF65-2692E7614F93@gmail.com> References: <201406051308.s55D88mM053472@svn.freebsd.org> To: Marius Strobl X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 15:23:56 -0000 Why? There should be no -gdwarf-2 in the tree, that was a workaround = that has since been obsoleted by (a) -g automatically changes to this in = the makefile system and (b) the default was reverted back to dwarf 2. = This wasn=92t a mismerge, but an intentional fix. Warner On Jun 5, 2014, at 7:08 AM, Marius Strobl wrote: > Author: marius > Date: Thu Jun 5 13:08:08 2014 > New Revision: 267107 > URL: http://svnweb.freebsd.org/changeset/base/267107 >=20 > Log: > Fix mismerge in r267049 and put makeoptions DEBUG=3D-gdwarf-2 instead = of > DEBUG=3D-g back. > Still, the original comment should be restored in head and then be = MFCed > along with r263749. >=20 > Modified: > stable/10/sys/i386/conf/XEN >=20 > Modified: stable/10/sys/i386/conf/XEN > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/10/sys/i386/conf/XEN Thu Jun 5 12:53:06 2014 = (r267106) > +++ stable/10/sys/i386/conf/XEN Thu Jun 5 13:08:08 2014 = (r267107) > @@ -6,7 +6,7 @@ > cpu I686_CPU > ident XEN >=20 > -makeoptions DEBUG=3D-g > +makeoptions DEBUG=3D-gdwarf-2 # Build kernel with = gdb(1) debug symbols >=20 > # The following modules don't build with PAE and XEN enabled. > makeoptions WITHOUT_MODULES=3D"ctl cxgb dpt drm drm2 hptmv ida malo = mwl rdma" >=20 From owner-svn-src-stable-10@FreeBSD.ORG Sat Jun 7 19:12:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E57A4871; Sat, 7 Jun 2014 19:12: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 D0FEF293D; Sat, 7 Jun 2014 19:12:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s57JChdj077047; Sat, 7 Jun 2014 19:12:43 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s57JChFl077046; Sat, 7 Jun 2014 19:12:43 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201406071912.s57JChFl077046@svn.freebsd.org> From: Christian Brueffer Date: Sat, 7 Jun 2014 19:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267214 - stable/10/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 19:12:44 -0000 Author: brueffer Date: Sat Jun 7 19:12:43 2014 New Revision: 267214 URL: http://svnweb.freebsd.org/changeset/base/267214 Log: MFC: r266931 Grammar cleanup; sort SEE ALSO. Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Sat Jun 7 17:12:26 2014 (r267213) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Sat Jun 7 19:12:43 2014 (r267214) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2013 +.Dd May 31, 2014 .Dt SNMP_HAST 3 .Os .Sh NAME @@ -40,11 +40,12 @@ The module implements a private BEGEMOT-HAST-MIB, which allows management of HAST resources. .Pp -The module uses +The module uses the .Xr hastd 8 control socket to communicate with the daemon. +The .Va hastConfigFile -variable can be used to specify the location of +variable can be used to specify the location of the .Xr hast.conf 5 file to find the address of the control connection. .Sh FILES @@ -62,8 +63,8 @@ configuration file. .Sh SEE ALSO .Xr bsnmpd 1 , .Xr gensnmptree 1 , +.Xr snmpmod 3 , .Xr hastctl 8 , -.Xr hastd 8 , -.Xr snmpmod 3 +.Xr hastd 8 .Sh AUTHORS .An Mikolaj Golub Aq trociny@FreeBSD.org From owner-svn-src-stable-10@FreeBSD.ORG Sat Jun 7 21:48:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 80B9C16B; Sat, 7 Jun 2014 21:48:46 +0000 (UTC) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 139652573; Sat, 7 Jun 2014 21:48:45 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id s57LmZe1030702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 7 Jun 2014 23:48:35 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.8/8.14.8/Submit) id s57LmZXY030701; Sat, 7 Jun 2014 23:48:35 +0200 (CEST) (envelope-from marius) Date: Sat, 7 Jun 2014 23:48:35 +0200 From: Marius Strobl To: Warner Losh Subject: Re: svn commit: r267107 - stable/10/sys/i386/conf Message-ID: <20140607214835.GH679@alchemy.franken.de> References: <201406051308.s55D88mM053472@svn.freebsd.org> <652C13FA-F367-4884-BF65-2692E7614F93@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <652C13FA-F367-4884-BF65-2692E7614F93@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (alchemy.franken.de [0.0.0.0]); Sat, 07 Jun 2014 23:48:36 +0200 (CEST) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 21:48:46 -0000 On Sat, Jun 07, 2014 at 09:23:47AM -0600, Warner Losh wrote: > Why? There should be no -gdwarf-2 in the tree, that was a workaround that has since been obsoleted by (a) -g automatically changes to this in the makefile system and (b) the default was reverted back to dwarf 2. This wasn?t a mismerge, but an intentional fix. Because despite what you say, -gdwarf-2 actually still is in stable/9 and stable/10 as of now: marius@alchemy:/home/marius/co > grep -l -- -gdwarf-2 {9,10}/src/sys/*/conf/* 9/src/sys/amd64/conf/GENERIC 9/src/sys/i386/conf/GENERIC 9/src/sys/i386/conf/XEN 9/src/sys/sparc64/conf/GENERIC 10/src/sys/amd64/conf/GENERIC 10/src/sys/i386/conf/GENERIC 10/src/sys/i386/conf/XEN 10/src/sys/sparc64/conf/GENERIC And also because replacing -gdwarf-2 with -g just wasn't part of r266820, doing the former when MFCing that revision as r267049 simply was a mismerge on my part. Apart from these I'm fully aware that -gdwarf-2 was/is only transient, but we're just not fully back to -g, yet. Marius From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 8 14:02:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3D415925; Sun, 8 Jun 2014 14:02: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 273E52823; Sun, 8 Jun 2014 14:02: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 s58E2QqI091070; Sun, 8 Jun 2014 14:02:26 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58E2QHr091069; Sun, 8 Jun 2014 14:02:26 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406081402.s58E2QHr091069@svn.freebsd.org> From: Ed Maste Date: Sun, 8 Jun 2014 14:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267231 - stable/10/sys/dev/vt/font X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 14:02:26 -0000 Author: emaste Date: Sun Jun 8 14:02:25 2014 New Revision: 267231 URL: http://svnweb.freebsd.org/changeset/base/267231 Log: MFC r267078, r267079: Update vt(4) console font author's email address Remove extra copy of old email address. Modified: stable/10/sys/dev/vt/font/vt_font_default.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/font/vt_font_default.c ============================================================================== --- stable/10/sys/dev/vt/font/vt_font_default.c Sun Jun 8 11:27:21 2014 (r267230) +++ stable/10/sys/dev/vt/font/vt_font_default.c Sun Jun 8 14:02:25 2014 (r267231) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2011 Dimitar Toshkov Zhekov - * All rights reserved. + * Copyright (c) 2011 Dimitar Toshkov Zhekov. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Please contribute any changes back to . + * Please contribute any changes back to . */ #include From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 8 17:50:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 525C6D99; Sun, 8 Jun 2014 17:50: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 324B429B8; Sun, 8 Jun 2014 17:50: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 s58Ho9Cn019165; Sun, 8 Jun 2014 17:50:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58Ho7BO019155; Sun, 8 Jun 2014 17:50:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201406081750.s58Ho7BO019155@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 8 Jun 2014 17:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267236 - in stable/10: . etc/etc.amd64 etc/etc.i386 include lib/libc/gen libexec/getty X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 17:50:09 -0000 Author: nwhitehorn Date: Sun Jun 8 17:50:07 2014 New Revision: 267236 URL: http://svnweb.freebsd.org/changeset/base/267236 Log: MFC r260913,266895: Add a new flag to /etc/ttys: onifconsole. This is equivalent to "on" if the device is an active kernel console and "off" otherwise. This is designed to allow serial-booting x86 systems to provide a login prompt on the serial line by default without providing one on all systems by default. Set this flag on x86 systems for ttyu0. Comments and suggestions by: grehan, dteske, jilles Modified: stable/10/UPDATING stable/10/etc/etc.amd64/ttys stable/10/etc/etc.i386/ttys stable/10/include/ttyent.h stable/10/lib/libc/gen/getttyent.c stable/10/libexec/getty/ttys.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Sun Jun 8 17:43:19 2014 (r267235) +++ stable/10/UPDATING Sun Jun 8 17:50:07 2014 (r267236) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20140608: + On i386 and amd64 systems, the onifconsole flag is now set by default + in /etc/ttys for ttyu0. This causes ttyu0 to be automatically enabled + as a login TTY if it is set in the bootloader as an active kernel + console. No changes in behavior should result otherwise. To revert to + the previous behavior, set ttyu0 to "off" in /etc/ttys. + 20140512: Clang and llvm have been upgraded to 3.4.1 release. Modified: stable/10/etc/etc.amd64/ttys ============================================================================== --- stable/10/etc/etc.amd64/ttys Sun Jun 8 17:43:19 2014 (r267235) +++ stable/10/etc/etc.amd64/ttys Sun Jun 8 17:50:07 2014 (r267236) @@ -41,7 +41,7 @@ ttyv7 "/usr/libexec/getty Pc" xterm on ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty std.9600" dialup off secure +ttyu0 "/usr/libexec/getty std.9600" vt100 onifconsole secure ttyu1 "/usr/libexec/getty std.9600" dialup off secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure Modified: stable/10/etc/etc.i386/ttys ============================================================================== --- stable/10/etc/etc.i386/ttys Sun Jun 8 17:43:19 2014 (r267235) +++ stable/10/etc/etc.i386/ttys Sun Jun 8 17:50:07 2014 (r267236) @@ -41,7 +41,7 @@ ttyv7 "/usr/libexec/getty Pc" xterm on ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty std.9600" dialup off secure +ttyu0 "/usr/libexec/getty std.9600" vt100 onifconsole secure ttyu1 "/usr/libexec/getty std.9600" dialup off secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure Modified: stable/10/include/ttyent.h ============================================================================== --- stable/10/include/ttyent.h Sun Jun 8 17:43:19 2014 (r267235) +++ stable/10/include/ttyent.h Sun Jun 8 17:50:07 2014 (r267236) @@ -37,6 +37,7 @@ #define _TTYS_OFF "off" #define _TTYS_ON "on" +#define _TTYS_ONIFCONSOLE "onifconsole" #define _TTYS_SECURE "secure" #define _TTYS_INSECURE "insecure" #define _TTYS_WINDOW "window" Modified: stable/10/lib/libc/gen/getttyent.c ============================================================================== --- stable/10/lib/libc/gen/getttyent.c Sun Jun 8 17:43:19 2014 (r267235) +++ stable/10/lib/libc/gen/getttyent.c Sun Jun 8 17:50:07 2014 (r267236) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + static char zapchar; static FILE *tf; static size_t lbsize; @@ -64,6 +67,36 @@ getttynam(const char *tty) return (t); } +static int +auto_tty_status(const char *ty_name) +{ + size_t len; + char *buf, *cons, *nextcons; + + /* Check if this is an enabled kernel console line */ + buf = NULL; + if (sysctlbyname("kern.console", NULL, &len, NULL, 0) == -1) + return (0); /* Errors mean don't enable */ + buf = malloc(len); + if (sysctlbyname("kern.console", buf, &len, NULL, 0) == -1) + goto done; + + if ((cons = strchr(buf, '/')) == NULL) + goto done; + *cons = '\0'; + nextcons = buf; + while ((cons = strsep(&nextcons, ",")) != NULL && strlen(cons) != 0) { + if (strcmp(cons, ty_name) == 0) { + free(buf); + return (TTY_ON); + } + } + +done: + free(buf); + return (0); +} + struct ttyent * getttyent(void) { @@ -126,6 +159,8 @@ getttyent(void) tty.ty_status &= ~TTY_ON; else if (scmp(_TTYS_ON)) tty.ty_status |= TTY_ON; + else if (scmp(_TTYS_ONIFCONSOLE)) + tty.ty_status |= auto_tty_status(tty.ty_name); else if (scmp(_TTYS_SECURE)) tty.ty_status |= TTY_SECURE; else if (scmp(_TTYS_INSECURE)) Modified: stable/10/libexec/getty/ttys.5 ============================================================================== --- stable/10/libexec/getty/ttys.5 Sun Jun 8 17:43:19 2014 (r267235) +++ stable/10/libexec/getty/ttys.5 Sun Jun 8 17:50:07 2014 (r267236) @@ -98,8 +98,11 @@ ttys as a group. .Pp As flag values, the strings ``on'' and ``off'' specify that .Xr init 8 -should (should not) execute the command given in the second field, -while ``secure'' (if ``on'' is also specified) allows users with a +should (should not) execute the command given in the second field. +``onifconsole'' will cause this line to be enabled if and only if it is +an active kernel console device (it is equivalent to ``on'' in this +case). +The flag ``secure'' (if the console is enabled) allows users with a uid of 0 to login on this line. The flag ``dialin'' indicates that a tty entry describes a dialin From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 8 20:39:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9D4CA26B; Sun, 8 Jun 2014 20:39: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 882CA26DC; Sun, 8 Jun 2014 20:39: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 s58KddKW021708; Sun, 8 Jun 2014 20:39:39 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58Kdd3d021706; Sun, 8 Jun 2014 20:39:39 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406082039.s58Kdd3d021706@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 8 Jun 2014 20:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267242 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 20:39:39 -0000 Author: hselasky Date: Sun Jun 8 20:39:39 2014 New Revision: 267242 URL: http://svnweb.freebsd.org/changeset/base/267242 Log: MFC r267044, r267120, r267210 and r267211: Multiple fixes for FULL and LOW speed USB transfers going through the DWC OTG as split transactions. INTERRUPT transfers should have a higher chance of success after this series of patches and the chance of data loss should be reduced. Modified: stable/10/sys/dev/usb/controller/dwc_otg.c stable/10/sys/dev/usb/controller/dwc_otg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- stable/10/sys/dev/usb/controller/dwc_otg.c Sun Jun 8 20:20:08 2014 (r267241) +++ stable/10/sys/dev/usb/controller/dwc_otg.c Sun Jun 8 20:39:39 2014 (r267242) @@ -98,6 +98,8 @@ GINTMSK_USBSUSPMSK | \ GINTMSK_IEPINTMSK | \ GINTMSK_SESSREQINTMSK | \ + GINTMSK_RXFLVLMSK | \ + GINTMSK_HCHINTMSK | \ GINTMSK_OTGINTMSK | \ GINTMSK_PRTINTMSK) @@ -239,7 +241,8 @@ dwc_otg_init_fifo(struct dwc_otg_softc * for (x = 0; x != sc->sc_host_ch_max; x++) { /* disable all host interrupts */ - DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), 0); + DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), + HCINT_DEFAULT_MASK); } DWC_OTG_WRITE_4(sc, DOTG_HPTXFSIZ, @@ -256,8 +259,9 @@ dwc_otg_init_fifo(struct dwc_otg_softc * /* store maximum periodic and non-periodic FIFO TX size */ sc->sc_tx_max_size = fifo_size; - /* disable all host channel interrupts */ - DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, 0); + /* enable all host channel interrupts */ + DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, + (1U << sc->sc_host_ch_max) - 1U); } if (mode == DWC_MODE_DEVICE) { @@ -568,11 +572,9 @@ dwc_otg_common_rx_ack(struct dwc_otg_sof { DPRINTFN(5, "RX status clear\n"); - if (sc->sc_flags.status_device_mode != 0) { - /* enable RX FIFO level interrupt */ - sc->sc_irq_mask |= GINTMSK_RXFLVLMSK; - DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); - } + /* enable RX FIFO level interrupt */ + sc->sc_irq_mask |= GINTMSK_RXFLVLMSK; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* clear cached status */ sc->sc_last_rx_status = 0; @@ -592,13 +594,13 @@ dwc_otg_clear_hcint(struct dwc_otg_softc } static uint8_t -dwc_otg_host_channel_alloc(struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t which, uint8_t is_out) +dwc_otg_host_channel_alloc(struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t is_out) { uint32_t tx_p_size; uint32_t tx_np_size; uint8_t x; - if (td->channel[which] < DWC_OTG_MAX_CHANNELS) + if (td->channel < DWC_OTG_MAX_CHANNELS) return (0); /* already allocated */ /* check if device is suspended */ @@ -607,8 +609,7 @@ dwc_otg_host_channel_alloc(struct dwc_ot /* compute needed TX FIFO size */ if (is_out != 0) { - if (td->ep_type == UE_INTERRUPT || - td->ep_type == UE_ISOCHRONOUS) { + if (td->ep_type == UE_ISOCHRONOUS) { tx_p_size = td->max_packet_size; tx_np_size = 0; if (td->hcsplt != 0 && tx_p_size > HCSPLT_XACTLEN_BURST) @@ -658,7 +659,7 @@ dwc_otg_host_channel_alloc(struct dwc_ot sc->sc_active_rx_ep |= (1 << x); /* set channel */ - td->channel[which] = x; + td->channel = x; return (0); /* allocated */ } @@ -668,16 +669,16 @@ dwc_otg_host_channel_alloc(struct dwc_ot } static void -dwc_otg_host_channel_free(struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t which) +dwc_otg_host_channel_free(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { uint8_t x; - if (td->channel[which] >= DWC_OTG_MAX_CHANNELS) + if (td->channel >= DWC_OTG_MAX_CHANNELS) return; /* already freed */ /* free channel */ - x = td->channel[which]; - td->channel[which] = DWC_OTG_MAX_CHANNELS; + x = td->channel; + td->channel = DWC_OTG_MAX_CHANNELS; DPRINTF("CH=%d\n", x); @@ -687,7 +688,7 @@ dwc_otg_host_channel_free(struct dwc_otg * after a fixed given amount of time the host channel is no * longer doing any USB traffic: */ - if (td->ep_type == UE_ISOCHRONOUS || td->ep_type == UE_INTERRUPT) { + if (td->ep_type == UE_ISOCHRONOUS) { /* double buffered */ sc->sc_chan_state[x].wait_sof = DWC_OTG_SLOT_IDLE_MAX; } else { @@ -707,6 +708,18 @@ dwc_otg_host_channel_free(struct dwc_otg sc->sc_active_rx_ep &= ~(1 << x); } +static void +dwc_otg_host_dump_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) +{ + /* dump any pending messages */ + if (sc->sc_last_rx_status != 0) { + if (td->channel < DWC_OTG_MAX_CHANNELS && + td->channel == GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status)) { + dwc_otg_common_rx_ack(sc); + } + } +} + static uint8_t dwc_otg_host_setup_tx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { @@ -715,13 +728,15 @@ dwc_otg_host_setup_tx(struct dwc_otg_sof uint32_t hcchar; uint8_t delta; - if (td->channel[0] < DWC_OTG_MAX_CHANNELS) { - hcint = sc->sc_chan_state[td->channel[0]].hcint; + dwc_otg_host_dump_rx(sc, td); + + if (td->channel < DWC_OTG_MAX_CHANNELS) { + hcint = sc->sc_chan_state[td->channel].hcint; DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", - td->channel[0], td->state, hcint, - DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel[0])), - DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel[0]))); + td->channel, td->state, hcint, + DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel)), + DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel))); } else { hcint = 0; goto check_state; @@ -731,12 +746,12 @@ dwc_otg_host_setup_tx(struct dwc_otg_sof HCINT_ACK | HCINT_NYET)) { /* give success bits priority over failure bits */ } else if (hcint & HCINT_STALL) { - DPRINTF("CH=%d STALL\n", td->channel[0]); + DPRINTF("CH=%d STALL\n", td->channel); td->error_stall = 1; td->error_any = 1; goto complete; } else if (hcint & HCINT_ERRORS) { - DPRINTF("CH=%d ERROR\n", td->channel[0]); + DPRINTF("CH=%d ERROR\n", td->channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { td->error_any = 1; @@ -804,7 +819,7 @@ check_state: send_pkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td); if (sizeof(req) != td->remainder) { td->error_any = 1; @@ -827,7 +842,7 @@ send_pkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, 0, 1)) { + if (dwc_otg_host_channel_alloc(sc, td, 1)) { td->state = DWC_CHAN_ST_START; goto busy; } @@ -841,23 +856,26 @@ send_pkt: usbd_copy_out(td->pc, 0, &req, sizeof(req)); - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel[0]), + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), (sizeof(req) << HCTSIZ_XFERSIZE_SHIFT) | (1 << HCTSIZ_PKTCNT_SHIFT) | (HCTSIZ_PID_SETUP << HCTSIZ_PID_SHIFT)); - DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel[0]), td->hcsplt); + DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); hcchar = td->hcchar; hcchar &= ~(HCCHAR_EPDIR_IN | HCCHAR_EPTYPE_MASK); hcchar |= UE_CONTROL << HCCHAR_EPTYPE_SHIFT; /* must enable channel before writing data to FIFO */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel[0]), hcchar); + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); /* transfer data into FIFO */ bus_space_write_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DOTG_DFIFO(td->channel[0]), (uint32_t *)&req, sizeof(req) / 4); + DOTG_DFIFO(td->channel), (uint32_t *)&req, sizeof(req) / 4); + + /* wait until next slot before trying complete split */ + td->tt_complete_slot = sc->sc_last_frame_num + 1; /* store number of bytes transmitted */ td->tx_bytes = sizeof(req); @@ -865,7 +883,7 @@ send_pkt: send_cpkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td); delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { @@ -880,34 +898,34 @@ send_cpkt: goto complete; } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, 0, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } - /* wait until next slot before trying again */ - td->tt_complete_slot++; + /* wait until next slot before trying complete split */ + td->tt_complete_slot = sc->sc_last_frame_num + 1; td->hcsplt |= HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_C_ANE; - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel[0]), + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), (HCTSIZ_PID_SETUP << HCTSIZ_PID_SHIFT)); - DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel[0]), td->hcsplt); + DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); hcchar = td->hcchar; hcchar &= ~(HCCHAR_EPDIR_IN | HCCHAR_EPTYPE_MASK); hcchar |= UE_CONTROL << HCCHAR_EPTYPE_SHIFT; /* must enable channel before writing data to FIFO */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel[0]), hcchar); + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); busy: return (1); /* busy */ complete: - dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td); return (0); /* complete */ } @@ -1085,55 +1103,21 @@ busy: } static uint8_t -dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) +dwc_otg_host_data_rx_sub(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - uint32_t hcint; - uint32_t hcchar; uint32_t count; - uint8_t delta; uint8_t channel; - channel = td->channel[td->tt_channel_tog]; - - if (channel < DWC_OTG_MAX_CHANNELS) { - hcint = sc->sc_chan_state[channel].hcint; - - DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", - channel, td->state, hcint, - DWC_OTG_READ_4(sc, DOTG_HCCHAR(channel)), - DWC_OTG_READ_4(sc, DOTG_HCTSIZ(channel))); - } else { - hcint = 0; - goto check_state; - } - - /* check interrupt bits */ - - if (hcint & (HCINT_RETRY | - HCINT_ACK | HCINT_NYET)) { - /* give success bits priority over failure bits */ - } else if (hcint & HCINT_STALL) { - DPRINTF("CH=%d STALL\n", channel); - td->error_stall = 1; - td->error_any = 1; - goto complete; - } else if (hcint & HCINT_ERRORS) { - DPRINTF("CH=%d ERROR\n", channel); - td->errcnt++; - if (td->hcsplt != 0 || td->errcnt >= 3) { - if (td->ep_type != UE_ISOCHRONOUS) { - td->error_any = 1; - goto complete; - } - } - } - /* check endpoint status */ if (sc->sc_last_rx_status == 0) - goto check_state; + goto busy; + + channel = td->channel; + if (channel >= DWC_OTG_MAX_CHANNELS) + goto busy; if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != channel) - goto check_state; + goto busy; switch (sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) { case GRXSTSRH_IN_DATA: @@ -1141,7 +1125,7 @@ dwc_otg_host_data_rx(struct dwc_otg_soft DPRINTF("DATA ST=%d STATUS=0x%08x\n", (int)td->state, (int)sc->sc_last_rx_status); - if (hcint & HCINT_SOFTWARE_ONLY) { + if (sc->sc_chan_state[channel].hcint & HCINT_SOFTWARE_ONLY) { /* * When using SPLIT transactions on interrupt * endpoints, sometimes data occurs twice. @@ -1203,21 +1187,71 @@ dwc_otg_host_data_rx(struct dwc_otg_soft td->remainder -= count; td->offset += count; - hcint |= HCINT_SOFTWARE_ONLY; - sc->sc_chan_state[channel].hcint = hcint; + sc->sc_chan_state[channel].hcint |= HCINT_SOFTWARE_ONLY; break; - default: break; } /* release FIFO */ dwc_otg_common_rx_ack(sc); +busy: + return (0); +complete: + return (1); +} -check_state: - if (hcint & (HCINT_ERRORS | HCINT_RETRY | - HCINT_ACK | HCINT_NYET)) { - if (!(hcint & HCINT_ERRORS)) - td->errcnt = 0; +static uint8_t +dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) +{ + uint32_t hcint; + uint32_t hcchar; + uint8_t delta; + uint8_t channel; + + channel = td->channel; + + if (channel < DWC_OTG_MAX_CHANNELS) { + hcint = sc->sc_chan_state[channel].hcint; + + DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", + channel, td->state, hcint, + DWC_OTG_READ_4(sc, DOTG_HCCHAR(channel)), + DWC_OTG_READ_4(sc, DOTG_HCTSIZ(channel))); + + /* check interrupt bits */ + if (hcint & (HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { + /* give success bits priority over failure bits */ + } else if (hcint & HCINT_STALL) { + DPRINTF("CH=%d STALL\n", channel); + td->error_stall = 1; + td->error_any = 1; + goto complete; + } else if (hcint & HCINT_ERRORS) { + DPRINTF("CH=%d ERROR\n", channel); + td->errcnt++; + if (td->hcsplt != 0 || td->errcnt >= 3) { + if (td->ep_type != UE_ISOCHRONOUS) { + td->error_any = 1; + goto complete; + } + } + } + + /* check channels for data, if any */ + if (dwc_otg_host_data_rx_sub(sc, td)) + goto complete; + + /* refresh interrupt status */ + hcint = sc->sc_chan_state[channel].hcint; + + if (hcint & (HCINT_ERRORS | HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { + if (!(hcint & HCINT_ERRORS)) + td->errcnt = 0; + } + } else { + hcint = 0; } switch (td->state) { @@ -1229,6 +1263,22 @@ check_state: case DWC_CHAN_ST_WAIT_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { + if (td->ep_type == UE_INTERRUPT) { + /* + * The USB specification does not + * mandate a particular data toggle + * value for USB INTERRUPT + * transfers. Switch the data toggle + * value to receive the packet + * correctly: + */ + if (hcint & HCINT_DATATGLERR) { + DPRINTF("Retrying packet due to " + "data toggle error\n"); + td->toggle ^= 1; + goto receive_pkt; + } + } td->did_nak++; td->tt_scheduled = 0; if (td->hcsplt != 0) @@ -1306,7 +1356,7 @@ check_state: receive_pkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(sc, td, td->tt_channel_tog); + dwc_otg_host_channel_free(sc, td); if (td->hcsplt != 0) { delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; @@ -1316,9 +1366,10 @@ receive_pkt: } delta = sc->sc_last_frame_num - td->tt_start_slot; if (delta > DWC_OTG_TT_SLOT_MAX) { - /* we missed the service interval */ - if (td->ep_type != UE_ISOCHRONOUS) + if (td->ep_type != UE_ISOCHRONOUS) { + /* we missed the service interval */ td->error_any = 1; + } goto complete; } /* complete split */ @@ -1330,12 +1381,12 @@ receive_pkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, td->tt_channel_tog, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } - channel = td->channel[td->tt_channel_tog]; + channel = td->channel; /* set toggle, if any */ if (td->set_toggle) { @@ -1357,46 +1408,23 @@ receive_pkt: hcchar = td->hcchar; hcchar |= HCCHAR_EPDIR_IN; - /* check if other channel is allocated */ - if (td->channel[td->tt_channel_tog ^ 1] < DWC_OTG_MAX_CHANNELS) { - /* second - receive after next SOF event */ - if ((sc->sc_last_frame_num & 1) != 0) - hcchar |= HCCHAR_ODDFRM; - else - hcchar &= ~HCCHAR_ODDFRM; - - /* other channel is next */ - td->tt_channel_tog ^= 1; - td->tt_complete_slot++; + /* receive complete split ASAP */ + if ((sc->sc_last_frame_num & 1) != 0) + hcchar |= HCCHAR_ODDFRM; + else + hcchar &= ~HCCHAR_ODDFRM; - /* must enable channel before data can be received */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); - } else { - /* first - receive after second next SOF event */ - if ((sc->sc_last_frame_num & 1) == 0) - hcchar |= HCCHAR_ODDFRM; - else - hcchar &= ~HCCHAR_ODDFRM; + /* must enable channel before data can be received */ + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); - /* must enable channel before data can be received */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); + /* wait until next slot before trying complete split */ + td->tt_complete_slot = sc->sc_last_frame_num + 1; - if (td->hcsplt != 0) { - if (td->ep_type == UE_ISOCHRONOUS || td->ep_type == UE_INTERRUPT) { - /* allocate a second channel */ - td->tt_channel_tog ^= 1; - goto receive_pkt; - } else { - td->tt_complete_slot++; - } - } - } goto busy; receive_spkt: /* free existing channel(s), if any */ - dwc_otg_host_channel_free(sc, td, 0); - dwc_otg_host_channel_free(sc, td, 1); + dwc_otg_host_channel_free(sc, td); delta = td->tt_start_slot - sc->sc_last_frame_num - 1; if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { @@ -1412,19 +1440,16 @@ receive_spkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, 0, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, 0)) { td->state = DWC_CHAN_ST_START; goto busy; } - channel = td->channel[0]; + channel = td->channel; td->hcsplt &= ~HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_S_ANE; - /* reset channel toggle */ - td->tt_channel_tog = 0; - /* receive one packet */ DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(channel), (HCTSIZ_PID_DATA0 << HCTSIZ_PID_SHIFT)); @@ -1440,14 +1465,16 @@ receive_spkt: hcchar = td->hcchar; hcchar |= HCCHAR_EPDIR_IN; + /* wait until next slot before trying complete split */ + td->tt_complete_slot = sc->sc_last_frame_num + 1; + /* must enable channel before data can be received */ DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); busy: return (1); /* busy */ complete: - dwc_otg_host_channel_free(sc, td, 0); - dwc_otg_host_channel_free(sc, td, 1); + dwc_otg_host_channel_free(sc, td); return (0); /* complete */ } @@ -1569,7 +1596,9 @@ dwc_otg_host_data_tx(struct dwc_otg_soft uint8_t delta; uint8_t channel; - channel = td->channel[td->tt_channel_tog]; + dwc_otg_host_dump_rx(sc, td); + + channel = td->channel; if (channel < DWC_OTG_MAX_CHANNELS) { hcint = sc->sc_chan_state[channel].hcint; @@ -1578,36 +1607,34 @@ dwc_otg_host_data_tx(struct dwc_otg_soft channel, td->state, hcint, DWC_OTG_READ_4(sc, DOTG_HCCHAR(channel)), DWC_OTG_READ_4(sc, DOTG_HCTSIZ(channel))); - } else { - hcint = 0; - goto check_state; - } - if (hcint & (HCINT_RETRY | - HCINT_ACK | HCINT_NYET)) { - /* give success bits priority over failure bits */ - } else if (hcint & HCINT_STALL) { - DPRINTF("CH=%d STALL\n", channel); - td->error_stall = 1; - td->error_any = 1; - goto complete; - } else if (hcint & HCINT_ERRORS) { - DPRINTF("CH=%d ERROR\n", channel); - td->errcnt++; - if (td->hcsplt != 0 || td->errcnt >= 3) { + if (hcint & (HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { + /* give success bits priority over failure bits */ + } else if (hcint & HCINT_STALL) { + DPRINTF("CH=%d STALL\n", channel); + td->error_stall = 1; td->error_any = 1; goto complete; + } else if (hcint & HCINT_ERRORS) { + DPRINTF("CH=%d ERROR\n", channel); + td->errcnt++; + if (td->hcsplt != 0 || td->errcnt >= 3) { + td->error_any = 1; + goto complete; + } } - } - if (hcint & (HCINT_ERRORS | HCINT_RETRY | - HCINT_ACK | HCINT_NYET)) { + if (hcint & (HCINT_ERRORS | HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { - if (!(hcint & HCINT_ERRORS)) - td->errcnt = 0; + if (!(hcint & HCINT_ERRORS)) + td->errcnt = 0; + } + } else { + hcint = 0; } -check_state: switch (td->state) { case DWC_CHAN_ST_START: goto send_pkt; @@ -1694,16 +1721,16 @@ check_state: td->tt_xactpos++; /* free existing channel, if any */ - dwc_otg_host_channel_free(sc, td, td->tt_channel_tog); + dwc_otg_host_channel_free(sc, td); td->state = DWC_CHAN_ST_TX_PKT_ISOC; /* FALLTHROUGH */ case DWC_CHAN_ST_TX_PKT_ISOC: - if (dwc_otg_host_channel_alloc(sc, td, 0, 1)) + if (dwc_otg_host_channel_alloc(sc, td, 1)) break; - channel = td->channel[0]; + channel = td->channel; goto send_isoc_pkt; default: break; @@ -1712,8 +1739,7 @@ check_state: send_pkt: /* free existing channel(s), if any */ - dwc_otg_host_channel_free(sc, td, 0); - dwc_otg_host_channel_free(sc, td, 1); + dwc_otg_host_channel_free(sc, td); if (td->hcsplt != 0) { delta = td->tt_start_slot - sc->sc_last_frame_num - 1; @@ -1734,12 +1760,12 @@ send_pkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, 0, 1)) { + if (dwc_otg_host_channel_alloc(sc, td, 1)) { td->state = DWC_CHAN_ST_START; goto busy; } - channel = td->channel[0]; + channel = td->channel; /* set toggle, if any */ if (td->set_toggle) { @@ -1757,7 +1783,7 @@ send_isoc_pkt: count = td->remainder; if (count > HCSPLT_XACTLEN_BURST) { DPRINTF("TT overflow\n"); - td->error = 1; + td->error_any = 1; goto complete; } /* Update transaction position */ @@ -1883,7 +1909,7 @@ send_isoc_pkt: send_cpkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(sc, td, td->tt_channel_tog); + dwc_otg_host_channel_free(sc, td); delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { @@ -1899,12 +1925,12 @@ send_cpkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, td->tt_channel_tog, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } - channel = td->channel[td->tt_channel_tog]; + channel = td->channel; td->hcsplt |= HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_C_ANE; @@ -1917,48 +1943,22 @@ send_cpkt: hcchar = td->hcchar; hcchar &= ~HCCHAR_EPDIR_IN; - /* check if other channel is allocated */ - if (td->channel[td->tt_channel_tog ^ 1] < DWC_OTG_MAX_CHANNELS) { - /* second - receive after next SOF event */ - if ((sc->sc_last_frame_num & 1) != 0) - hcchar |= HCCHAR_ODDFRM; - else - hcchar &= ~HCCHAR_ODDFRM; - - /* other channel is next */ - td->tt_channel_tog ^= 1; - /* wait until next slot before trying again */ - td->tt_complete_slot++; - - /* must enable channel before data can be received */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); - } else { - /* first - receive after second next SOF event */ - if ((sc->sc_last_frame_num & 1) == 0) - hcchar |= HCCHAR_ODDFRM; - else - hcchar &= ~HCCHAR_ODDFRM; + /* receive complete split ASAP */ + if ((sc->sc_last_frame_num & 1) != 0) + hcchar |= HCCHAR_ODDFRM; + else + hcchar &= ~HCCHAR_ODDFRM; - /* must enable channel before data can be received */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); + /* must enable channel before data can be received */ + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); - if (td->hcsplt != 0) { - if (td->ep_type == UE_ISOCHRONOUS || td->ep_type == UE_INTERRUPT) { - /* allocate a second channel */ - td->tt_channel_tog ^= 1; - goto send_cpkt; - } else { - /* wait until next slot before trying again */ - td->tt_complete_slot++; - } - } - } + /* wait until next slot before trying complete split */ + td->tt_complete_slot = sc->sc_last_frame_num + 1; busy: return (1); /* busy */ complete: - dwc_otg_host_channel_free(sc, td, 0); - dwc_otg_host_channel_free(sc, td, 1); + dwc_otg_host_channel_free(sc, td); return (0); /* complete */ } @@ -2348,6 +2348,14 @@ dwc_otg_host_channel_disable(struct dwc_ sc->sc_chan_state[x].tx_np_size = 0; } +static uint16_t +dwc_otg_compute_isoc_rx_tt_slot(struct dwc_otg_tt_info *pinfo) +{ + if (pinfo->slot_index < DWC_OTG_TT_SLOT_MAX) + pinfo->slot_index++; + return (pinfo->slot_index); +} + static uint8_t dwc_otg_update_host_transfer_schedule_locked(struct dwc_otg_softc *sc) { @@ -2356,6 +2364,7 @@ dwc_otg_update_host_transfer_schedule_lo struct usb_xfer *xfer_next; struct dwc_otg_td *td; uint16_t temp; + uint16_t slot; uint8_t x; temp = DWC_OTG_READ_4(sc, DOTG_HFNUM) & DWC_OTG_FRAME_MASK; @@ -2377,11 +2386,53 @@ dwc_otg_update_host_transfer_schedule_lo } if ((temp & 7) == 0) { + + /* reset the schedule */ + memset(sc->sc_tt_info, 0, sizeof(sc->sc_tt_info)); + TAILQ_FOREACH_SAFE(xfer, &sc->sc_bus.intr_q.head, wait_entry, xfer_next) { td = xfer->td_transfer_cache; if (td == NULL || td->ep_type != UE_ISOCHRONOUS) continue; + /* check for IN direction */ + if ((td->hcchar & HCCHAR_EPDIR_IN) != 0) + continue; + + /* execute more frames */ + td->tmr_val = 0; + + sc->sc_needsof = 1; + + if (td->hcsplt == 0 || td->tt_scheduled != 0) + continue; + + /* compute slot */ + slot = dwc_otg_compute_isoc_rx_tt_slot( + sc->sc_tt_info + td->tt_index); + if (slot > 3) { + /* + * Not enough time to get complete + * split executed. + */ + continue; + } + /* Delayed start */ + td->tt_start_slot = temp + slot; + td->tt_scheduled = 1; + TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); + TAILQ_INSERT_TAIL(&head, xfer, wait_entry); + } + + TAILQ_FOREACH_SAFE(xfer, &sc->sc_bus.intr_q.head, wait_entry, xfer_next) { + td = xfer->td_transfer_cache; + if (td == NULL || td->ep_type != UE_ISOCHRONOUS) + continue; + + /* check for OUT direction */ + if ((td->hcchar & HCCHAR_EPDIR_IN) == 0) + continue; + /* execute more frames */ td->tmr_val = 0; @@ -2391,8 +2442,7 @@ dwc_otg_update_host_transfer_schedule_lo continue; /* Start ASAP */ - td->tt_start_slot = temp + 0; - td->tt_complete_slot = temp + 2; + td->tt_start_slot = temp; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); @@ -2418,8 +2468,7 @@ dwc_otg_update_host_transfer_schedule_lo } /* start ASAP */ - td->tt_start_slot = temp + 0; - td->tt_complete_slot = temp + 2; + td->tt_start_slot = temp; sc->sc_needsof = 1; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); @@ -2440,8 +2489,7 @@ dwc_otg_update_host_transfer_schedule_lo continue; /* start ASAP */ - td->tt_start_slot = temp + 0; - td->tt_complete_slot = temp + 1; + td->tt_start_slot = temp; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); @@ -2462,8 +2510,7 @@ dwc_otg_update_host_transfer_schedule_lo continue; /* start ASAP */ - td->tt_start_slot = temp + 0; - td->tt_complete_slot = temp + 1; + td->tt_start_slot = temp; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); @@ -2739,8 +2786,6 @@ dwc_otg_interrupt(void *arg) /* Disable SOF interrupt */ sc->sc_irq_mask &= ~GINTMSK_SOFMSK; - /* Enable RX frame interrupt */ - sc->sc_irq_mask |= GINTMSK_RXFLVLMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ @@ -2781,7 +2826,7 @@ dwc_otg_interrupt(void *arg) * suspend and RX frame interrupt: */ sc->sc_irq_mask &= ~(GINTMSK_WKUPINTMSK | GINTMSK_SOFMSK); - sc->sc_irq_mask |= (GINTMSK_USBSUSPMSK | GINTMSK_RXFLVLMSK); + sc->sc_irq_mask |= GINTMSK_USBSUSPMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ @@ -2852,10 +2897,6 @@ dwc_otg_interrupt(void *arg) /* complete root HUB interrupt endpoint */ dwc_otg_root_intr(sc); - /* disable RX FIFO level interrupt */ - sc->sc_irq_mask &= ~GINTMSK_RXFLVLMSK; - DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); - /* update host frame interval */ dwc_otg_update_host_frame_interval(sc); } @@ -2935,12 +2976,10 @@ dwc_otg_setup_standard_chain_sub(struct td->set_toggle = 0; td->got_short = 0; td->did_nak = 0; - td->channel[0] = DWC_OTG_MAX_CHANNELS; - td->channel[1] = DWC_OTG_MAX_CHANNELS; + td->channel = DWC_OTG_MAX_CHANNELS; td->state = 0; td->errcnt = 0; td->tt_scheduled = 0; - td->tt_channel_tog = 0; td->tt_xactpos = HCSPLT_XACTPOS_BEGIN; } @@ -3156,9 +3195,21 @@ dwc_otg_setup_standard_chain(struct usb_ (xfer->max_packet_size << HCCHAR_MPS_SHIFT) | HCCHAR_CHENA; - /* XXX stability hack - possible HW issue */ - if (td->ep_type == UE_CONTROL) - hcchar |= (UE_BULK << HCCHAR_EPTYPE_SHIFT); + /* + * We are not always able to meet the timing + * requirements of the USB interrupt endpoint's + * complete split token, when doing transfers going + * via a transaction translator. Use the CONTROL + * transfer type instead of the INTERRUPT transfer + * type in general, as a means to workaround + * that. This trick should work for both FULL and LOW + * speed USB traffic going through a TT. For non-TT + * traffic it works aswell. The reason for using + * CONTROL type instead of BULK is that some TTs might + * reject LOW speed BULK traffic. + */ + if (td->ep_type == UE_INTERRUPT) + hcchar |= (UE_CONTROL << HCCHAR_EPTYPE_SHIFT); else hcchar |= (td->ep_type << HCCHAR_EPTYPE_SHIFT); @@ -3199,13 +3250,12 @@ dwc_otg_setup_standard_chain(struct usb_ break; case USB_SPEED_HIGH: hcsplt = 0; - if (td->ep_type == UE_ISOCHRONOUS || - td->ep_type == UE_INTERRUPT) { - hcchar |= ((xfer->max_packet_count & 3) - << HCCHAR_MC_SHIFT); - } if (td->ep_type == UE_INTERRUPT) { uint32_t ival; +#if 0 + hcchar |= ((xfer->max_packet_count & 3) + << HCCHAR_MC_SHIFT); +#endif ival = xfer->interval / DWC_OTG_HOST_TIMER_RATE; if (ival == 0) ival = 1; @@ -3214,6 +3264,8 @@ dwc_otg_setup_standard_chain(struct usb_ td->tmr_val = sc->sc_tmr_val + ival; td->tmr_res = ival; } else if (td->ep_type == UE_ISOCHRONOUS) { + hcchar |= ((xfer->max_packet_count & 3) + << HCCHAR_MC_SHIFT); td->tmr_val = 0; td->tmr_res = 1 << usbd_xfer_get_fps_shift(xfer); } else { @@ -3458,12 +3510,9 @@ dwc_otg_device_done(struct usb_xfer *xfe } else { struct dwc_otg_td *td; - td = xfer->td_transfer_first; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 8 23:22:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E536963F; Sun, 8 Jun 2014 23:22: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 D265622DB; Sun, 8 Jun 2014 23:22: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 s58NMPhg018318; Sun, 8 Jun 2014 23:22:25 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58NMPOd018317; Sun, 8 Jun 2014 23:22:25 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201406082322.s58NMPOd018317@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 8 Jun 2014 23:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267244 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 23:22:26 -0000 Author: np Date: Sun Jun 8 23:22:25 2014 New Revision: 267244 URL: http://svnweb.freebsd.org/changeset/base/267244 Log: MFC r267082: cxgbe(4): Properly account for the freelist buffers used when returning early from service_iq due to a budget restriction. This fixes a potential rx hang when using INTx. Modified: stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Sun Jun 8 21:21:54 2014 (r267243) +++ stable/10/sys/dev/cxgbe/t4_sge.c Sun Jun 8 23:22:25 2014 (r267244) @@ -1361,8 +1361,15 @@ service_iq(struct sge_iq *iq, int budget } #endif - if (budget) + if (budget) { + if (fl_bufs_used) { + FL_LOCK(fl); + fl->needed += fl_bufs_used; + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + } return (EINPROGRESS); + } } } From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 01:24:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 89CC6AEA; Mon, 9 Jun 2014 01:24: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 770E92AFE; Mon, 9 Jun 2014 01:24: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 s591OsTA078652; Mon, 9 Jun 2014 01:24:54 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s591Ospj078651; Mon, 9 Jun 2014 01:24:54 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406090124.s591Ospj078651@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Jun 2014 01:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267246 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 01:24:54 -0000 Author: gjb Date: Mon Jun 9 01:24:53 2014 New Revision: 267246 URL: http://svnweb.freebsd.org/changeset/base/267246 Log: MFC r267160: Dereference portaudit(1), as it is now deprecated and its functionality exists in pkg-audit(8). Sponsored by: The FreeBSD Foundation Modified: stable/10/share/man/man7/ports.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/ports.7 ============================================================================== --- stable/10/share/man/man7/ports.7 Mon Jun 9 00:15:16 2014 (r267245) +++ stable/10/share/man/man7/ports.7 Mon Jun 9 01:24:53 2014 (r267246) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2012 +.Dd June 6, 2014 .Dt PORTS 7 .Os .Sh NAME @@ -458,7 +458,7 @@ If defined, only operate on a port if it If defined, only operate on a port if it can be installed 100% automatically. .It Va DISABLE_VULNERABILITIES If defined, disable check for security vulnerabilities using -.Xr portaudit 1 Pq Pa ports/ports-mgmt/portaudit +.Xr pkg-audit 8 when installing new ports. .It Va NO_IGNORE If defined, allow installation of ports marked as @@ -500,7 +500,7 @@ The big Kahuna. .Pp The following are part of the ports collection: .Pp -.Xr portaudit 1 , +.Xr pkg 7 , .Xr portlint 1 .Rs .%B "The FreeBSD Handbook" From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 02:30:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B81037AE; Mon, 9 Jun 2014 02:30: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 A56AF2F0C; Mon, 9 Jun 2014 02:30: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 s592UvTG009435; Mon, 9 Jun 2014 02:30:57 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s592Uv52009434; Mon, 9 Jun 2014 02:30:57 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406090230.s592Uv52009434@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Jun 2014 02:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267250 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 02:30:57 -0000 Author: gjb Date: Mon Jun 9 02:30:57 2014 New Revision: 267250 URL: http://svnweb.freebsd.org/changeset/base/267250 Log: Document r267236, ttys 'onifconsole' Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jun 9 02:26:41 2014 (r267249) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jun 9 02:30:57 2014 (r267250) @@ -246,6 +246,12 @@ /usr/local/etc/newsyslog.conf.d/ directories by default for &man.newsyslog.8;. + A new flag, onifconsole has + been added to /etc/ttys. This allows the + system to provide a login prompt via serial console if the + device is an active kernel console, otherwise it is equivalent + to off. + <filename>/etc/rc.d</filename> Scripts From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 05:56:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CAFBA952; Mon, 9 Jun 2014 05:56: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 B7BEB2E55; Mon, 9 Jun 2014 05:56: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 s595uIix004361; Mon, 9 Jun 2014 05:56:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s595uINw004360; Mon, 9 Jun 2014 05:56:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201406090556.s595uINw004360@svn.freebsd.org> From: Christian Brueffer Date: Mon, 9 Jun 2014 05:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267257 - stable/10/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 05:56:18 -0000 Author: brueffer Date: Mon Jun 9 05:56:18 2014 New Revision: 267257 URL: http://svnweb.freebsd.org/changeset/base/267257 Log: MFC: r267184 Add vte(4) to the hardware notes. Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Jun 9 05:50:57 2014 (r267256) +++ stable/10/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Jun 9 05:56:18 2014 (r267257) @@ -946,6 +946,8 @@ &hwlist.vr; + &hwlist.vte; + &hwlist.vx; &hwlist.vxge; From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 06:00:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 311ABAC5; Mon, 9 Jun 2014 06:00: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 19DDA2E7A; Mon, 9 Jun 2014 06:00: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 s5960ebg005252; Mon, 9 Jun 2014 06:00:40 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5960SRn005175; Mon, 9 Jun 2014 06:00:28 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201406090600.s5960SRn005175@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 9 Jun 2014 06:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267258 - in stable/10: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/cms ... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 06:00:40 -0000 Author: jkim Date: Mon Jun 9 06:00:28 2014 New Revision: 267258 URL: http://svnweb.freebsd.org/changeset/base/267258 Log: MFC: r267256 Merge OpenSSL 1.0.1h. Approved by: so (delphij) Added: stable/10/crypto/openssl/ssl/heartbeat_test.c - copied unchanged from r267256, head/crypto/openssl/ssl/heartbeat_test.c Modified: stable/10/crypto/openssl/ACKNOWLEDGMENTS stable/10/crypto/openssl/CHANGES stable/10/crypto/openssl/Makefile stable/10/crypto/openssl/NEWS stable/10/crypto/openssl/README stable/10/crypto/openssl/apps/enc.c stable/10/crypto/openssl/apps/ocsp.c stable/10/crypto/openssl/apps/req.c stable/10/crypto/openssl/apps/s_cb.c stable/10/crypto/openssl/apps/s_socket.c stable/10/crypto/openssl/apps/smime.c stable/10/crypto/openssl/crypto/asn1/a_strnid.c stable/10/crypto/openssl/crypto/bio/bss_dgram.c stable/10/crypto/openssl/crypto/bn/bn_mont.c stable/10/crypto/openssl/crypto/cms/cms_env.c stable/10/crypto/openssl/crypto/cms/cms_sd.c stable/10/crypto/openssl/crypto/cms/cms_smime.c stable/10/crypto/openssl/crypto/dso/dso_dlfcn.c stable/10/crypto/openssl/crypto/ec/ec_ameth.c stable/10/crypto/openssl/crypto/ec/ec_asn1.c stable/10/crypto/openssl/crypto/ec/ec_lcl.h stable/10/crypto/openssl/crypto/evp/bio_b64.c stable/10/crypto/openssl/crypto/evp/encode.c stable/10/crypto/openssl/crypto/opensslv.h stable/10/crypto/openssl/crypto/pkcs12/p12_crt.c stable/10/crypto/openssl/crypto/pkcs12/p12_kiss.c stable/10/crypto/openssl/crypto/pkcs7/pk7_doit.c stable/10/crypto/openssl/crypto/pkcs7/pkcs7.h stable/10/crypto/openssl/crypto/pkcs7/pkcs7err.c stable/10/crypto/openssl/crypto/rsa/rsa_ameth.c stable/10/crypto/openssl/crypto/srp/srp_vfy.c stable/10/crypto/openssl/crypto/ts/ts_rsp_verify.c stable/10/crypto/openssl/crypto/x509v3/v3_purp.c stable/10/crypto/openssl/doc/apps/cms.pod stable/10/crypto/openssl/doc/apps/enc.pod stable/10/crypto/openssl/doc/apps/s_server.pod stable/10/crypto/openssl/doc/apps/smime.pod stable/10/crypto/openssl/doc/apps/verify.pod stable/10/crypto/openssl/doc/apps/version.pod stable/10/crypto/openssl/doc/apps/x509v3_config.pod stable/10/crypto/openssl/doc/crypto/CMS_decrypt.pod stable/10/crypto/openssl/doc/crypto/CONF_modules_free.pod stable/10/crypto/openssl/doc/crypto/CONF_modules_load_file.pod stable/10/crypto/openssl/doc/crypto/OPENSSL_config.pod stable/10/crypto/openssl/doc/crypto/X509_NAME_ENTRY_get_object.pod stable/10/crypto/openssl/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod stable/10/crypto/openssl/doc/fingerprints.txt stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_msg_callback.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod stable/10/crypto/openssl/doc/ssl/SSL_get_peer_cert_chain.pod stable/10/crypto/openssl/engines/ccgost/gost_ameth.c stable/10/crypto/openssl/ssl/Makefile stable/10/crypto/openssl/ssl/d1_both.c stable/10/crypto/openssl/ssl/d1_lib.c stable/10/crypto/openssl/ssl/d1_pkt.c stable/10/crypto/openssl/ssl/d1_srvr.c stable/10/crypto/openssl/ssl/s3_pkt.c stable/10/crypto/openssl/ssl/s3_srvr.c stable/10/crypto/openssl/ssl/ssl.h stable/10/crypto/openssl/ssl/ssl3.h stable/10/crypto/openssl/ssl/ssl_asn1.c stable/10/crypto/openssl/ssl/ssl_err.c stable/10/crypto/openssl/ssl/ssl_lib.c stable/10/crypto/openssl/ssl/t1_enc.c stable/10/crypto/openssl/ssl/t1_lib.c stable/10/secure/lib/libcrypto/Makefile.inc stable/10/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/10/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/10/secure/lib/libcrypto/man/BIO_ctrl.3 stable/10/secure/lib/libcrypto/man/BIO_f_base64.3 stable/10/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/10/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/10/secure/lib/libcrypto/man/BIO_f_md.3 stable/10/secure/lib/libcrypto/man/BIO_f_null.3 stable/10/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/10/secure/lib/libcrypto/man/BIO_find_type.3 stable/10/secure/lib/libcrypto/man/BIO_new.3 stable/10/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/10/secure/lib/libcrypto/man/BIO_push.3 stable/10/secure/lib/libcrypto/man/BIO_read.3 stable/10/secure/lib/libcrypto/man/BIO_s_accept.3 stable/10/secure/lib/libcrypto/man/BIO_s_bio.3 stable/10/secure/lib/libcrypto/man/BIO_s_connect.3 stable/10/secure/lib/libcrypto/man/BIO_s_fd.3 stable/10/secure/lib/libcrypto/man/BIO_s_file.3 stable/10/secure/lib/libcrypto/man/BIO_s_mem.3 stable/10/secure/lib/libcrypto/man/BIO_s_null.3 stable/10/secure/lib/libcrypto/man/BIO_s_socket.3 stable/10/secure/lib/libcrypto/man/BIO_set_callback.3 stable/10/secure/lib/libcrypto/man/BIO_should_retry.3 stable/10/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_start.3 stable/10/secure/lib/libcrypto/man/BN_add.3 stable/10/secure/lib/libcrypto/man/BN_add_word.3 stable/10/secure/lib/libcrypto/man/BN_bn2bin.3 stable/10/secure/lib/libcrypto/man/BN_cmp.3 stable/10/secure/lib/libcrypto/man/BN_copy.3 stable/10/secure/lib/libcrypto/man/BN_generate_prime.3 stable/10/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/10/secure/lib/libcrypto/man/BN_new.3 stable/10/secure/lib/libcrypto/man/BN_num_bytes.3 stable/10/secure/lib/libcrypto/man/BN_rand.3 stable/10/secure/lib/libcrypto/man/BN_set_bit.3 stable/10/secure/lib/libcrypto/man/BN_swap.3 stable/10/secure/lib/libcrypto/man/BN_zero.3 stable/10/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/10/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/10/secure/lib/libcrypto/man/CMS_compress.3 stable/10/secure/lib/libcrypto/man/CMS_decrypt.3 stable/10/secure/lib/libcrypto/man/CMS_encrypt.3 stable/10/secure/lib/libcrypto/man/CMS_final.3 stable/10/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_type.3 stable/10/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/10/secure/lib/libcrypto/man/CMS_sign.3 stable/10/secure/lib/libcrypto/man/CMS_sign_add1_signer.3 stable/10/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/10/secure/lib/libcrypto/man/CMS_uncompress.3 stable/10/secure/lib/libcrypto/man/CMS_verify.3 stable/10/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/10/secure/lib/libcrypto/man/CONF_modules_free.3 stable/10/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/10/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/10/secure/lib/libcrypto/man/DH_generate_key.3 stable/10/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DH_new.3 stable/10/secure/lib/libcrypto/man/DH_set_method.3 stable/10/secure/lib/libcrypto/man/DH_size.3 stable/10/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/10/secure/lib/libcrypto/man/DSA_do_sign.3 stable/10/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/10/secure/lib/libcrypto/man/DSA_generate_key.3 stable/10/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DSA_new.3 stable/10/secure/lib/libcrypto/man/DSA_set_method.3 stable/10/secure/lib/libcrypto/man/DSA_sign.3 stable/10/secure/lib/libcrypto/man/DSA_size.3 stable/10/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/10/secure/lib/libcrypto/man/ERR_clear_error.3 stable/10/secure/lib/libcrypto/man/ERR_error_string.3 stable/10/secure/lib/libcrypto/man/ERR_get_error.3 stable/10/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/10/secure/lib/libcrypto/man/ERR_load_strings.3 stable/10/secure/lib/libcrypto/man/ERR_print_errors.3 stable/10/secure/lib/libcrypto/man/ERR_put_error.3 stable/10/secure/lib/libcrypto/man/ERR_remove_state.3 stable/10/secure/lib/libcrypto/man/ERR_set_mark.3 stable/10/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/10/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/10/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/10/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/10/secure/lib/libcrypto/man/EVP_SealInit.3 stable/10/secure/lib/libcrypto/man/EVP_SignInit.3 stable/10/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/10/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/10/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/10/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/10/secure/lib/libcrypto/man/OPENSSL_config.3 stable/10/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/10/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/10/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/10/secure/lib/libcrypto/man/PKCS12_create.3 stable/10/secure/lib/libcrypto/man/PKCS12_parse.3 stable/10/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/10/secure/lib/libcrypto/man/PKCS7_verify.3 stable/10/secure/lib/libcrypto/man/RAND_add.3 stable/10/secure/lib/libcrypto/man/RAND_bytes.3 stable/10/secure/lib/libcrypto/man/RAND_cleanup.3 stable/10/secure/lib/libcrypto/man/RAND_egd.3 stable/10/secure/lib/libcrypto/man/RAND_load_file.3 stable/10/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/10/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/10/secure/lib/libcrypto/man/RSA_check_key.3 stable/10/secure/lib/libcrypto/man/RSA_generate_key.3 stable/10/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/RSA_new.3 stable/10/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/10/secure/lib/libcrypto/man/RSA_print.3 stable/10/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_set_method.3 stable/10/secure/lib/libcrypto/man/RSA_sign.3 stable/10/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/10/secure/lib/libcrypto/man/RSA_size.3 stable/10/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/10/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/10/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/10/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/10/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/10/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/10/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/10/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/10/secure/lib/libcrypto/man/X509_new.3 stable/10/secure/lib/libcrypto/man/X509_verify_cert.3 stable/10/secure/lib/libcrypto/man/bio.3 stable/10/secure/lib/libcrypto/man/blowfish.3 stable/10/secure/lib/libcrypto/man/bn.3 stable/10/secure/lib/libcrypto/man/bn_internal.3 stable/10/secure/lib/libcrypto/man/buffer.3 stable/10/secure/lib/libcrypto/man/crypto.3 stable/10/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/10/secure/lib/libcrypto/man/d2i_DHparams.3 stable/10/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/10/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_X509.3 stable/10/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/10/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/10/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/10/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/10/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/10/secure/lib/libcrypto/man/des.3 stable/10/secure/lib/libcrypto/man/dh.3 stable/10/secure/lib/libcrypto/man/dsa.3 stable/10/secure/lib/libcrypto/man/ecdsa.3 stable/10/secure/lib/libcrypto/man/engine.3 stable/10/secure/lib/libcrypto/man/err.3 stable/10/secure/lib/libcrypto/man/evp.3 stable/10/secure/lib/libcrypto/man/hmac.3 stable/10/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/10/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/10/secure/lib/libcrypto/man/lh_stats.3 stable/10/secure/lib/libcrypto/man/lhash.3 stable/10/secure/lib/libcrypto/man/md5.3 stable/10/secure/lib/libcrypto/man/mdc2.3 stable/10/secure/lib/libcrypto/man/pem.3 stable/10/secure/lib/libcrypto/man/rand.3 stable/10/secure/lib/libcrypto/man/rc4.3 stable/10/secure/lib/libcrypto/man/ripemd.3 stable/10/secure/lib/libcrypto/man/rsa.3 stable/10/secure/lib/libcrypto/man/sha.3 stable/10/secure/lib/libcrypto/man/threads.3 stable/10/secure/lib/libcrypto/man/ui.3 stable/10/secure/lib/libcrypto/man/ui_compat.3 stable/10/secure/lib/libcrypto/man/x509.3 stable/10/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/10/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/10/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/10/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_free.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/10/secure/lib/libssl/man/SSL_CTX_new.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 stable/10/secure/lib/libssl/man/SSL_SESSION_free.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/10/secure/lib/libssl/man/SSL_accept.3 stable/10/secure/lib/libssl/man/SSL_alert_type_string.3 stable/10/secure/lib/libssl/man/SSL_clear.3 stable/10/secure/lib/libssl/man/SSL_connect.3 stable/10/secure/lib/libssl/man/SSL_do_handshake.3 stable/10/secure/lib/libssl/man/SSL_free.3 stable/10/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/10/secure/lib/libssl/man/SSL_get_ciphers.3 stable/10/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/10/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/10/secure/lib/libssl/man/SSL_get_error.3 stable/10/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/10/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_get_fd.3 stable/10/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/10/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/10/secure/lib/libssl/man/SSL_get_psk_identity.3 stable/10/secure/lib/libssl/man/SSL_get_rbio.3 stable/10/secure/lib/libssl/man/SSL_get_session.3 stable/10/secure/lib/libssl/man/SSL_get_verify_result.3 stable/10/secure/lib/libssl/man/SSL_get_version.3 stable/10/secure/lib/libssl/man/SSL_library_init.3 stable/10/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/10/secure/lib/libssl/man/SSL_new.3 stable/10/secure/lib/libssl/man/SSL_pending.3 stable/10/secure/lib/libssl/man/SSL_read.3 stable/10/secure/lib/libssl/man/SSL_rstate_string.3 stable/10/secure/lib/libssl/man/SSL_session_reused.3 stable/10/secure/lib/libssl/man/SSL_set_bio.3 stable/10/secure/lib/libssl/man/SSL_set_connect_state.3 stable/10/secure/lib/libssl/man/SSL_set_fd.3 stable/10/secure/lib/libssl/man/SSL_set_session.3 stable/10/secure/lib/libssl/man/SSL_set_shutdown.3 stable/10/secure/lib/libssl/man/SSL_set_verify_result.3 stable/10/secure/lib/libssl/man/SSL_shutdown.3 stable/10/secure/lib/libssl/man/SSL_state_string.3 stable/10/secure/lib/libssl/man/SSL_want.3 stable/10/secure/lib/libssl/man/SSL_write.3 stable/10/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/10/secure/lib/libssl/man/ssl.3 stable/10/secure/usr.bin/openssl/man/CA.pl.1 stable/10/secure/usr.bin/openssl/man/asn1parse.1 stable/10/secure/usr.bin/openssl/man/ca.1 stable/10/secure/usr.bin/openssl/man/ciphers.1 stable/10/secure/usr.bin/openssl/man/cms.1 stable/10/secure/usr.bin/openssl/man/crl.1 stable/10/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/10/secure/usr.bin/openssl/man/dgst.1 stable/10/secure/usr.bin/openssl/man/dhparam.1 stable/10/secure/usr.bin/openssl/man/dsa.1 stable/10/secure/usr.bin/openssl/man/dsaparam.1 stable/10/secure/usr.bin/openssl/man/ec.1 stable/10/secure/usr.bin/openssl/man/ecparam.1 stable/10/secure/usr.bin/openssl/man/enc.1 stable/10/secure/usr.bin/openssl/man/errstr.1 stable/10/secure/usr.bin/openssl/man/gendsa.1 stable/10/secure/usr.bin/openssl/man/genpkey.1 stable/10/secure/usr.bin/openssl/man/genrsa.1 stable/10/secure/usr.bin/openssl/man/nseq.1 stable/10/secure/usr.bin/openssl/man/ocsp.1 stable/10/secure/usr.bin/openssl/man/openssl.1 stable/10/secure/usr.bin/openssl/man/passwd.1 stable/10/secure/usr.bin/openssl/man/pkcs12.1 stable/10/secure/usr.bin/openssl/man/pkcs7.1 stable/10/secure/usr.bin/openssl/man/pkcs8.1 stable/10/secure/usr.bin/openssl/man/pkey.1 stable/10/secure/usr.bin/openssl/man/pkeyparam.1 stable/10/secure/usr.bin/openssl/man/pkeyutl.1 stable/10/secure/usr.bin/openssl/man/rand.1 stable/10/secure/usr.bin/openssl/man/req.1 stable/10/secure/usr.bin/openssl/man/rsa.1 stable/10/secure/usr.bin/openssl/man/rsautl.1 stable/10/secure/usr.bin/openssl/man/s_client.1 stable/10/secure/usr.bin/openssl/man/s_server.1 stable/10/secure/usr.bin/openssl/man/s_time.1 stable/10/secure/usr.bin/openssl/man/sess_id.1 stable/10/secure/usr.bin/openssl/man/smime.1 stable/10/secure/usr.bin/openssl/man/speed.1 stable/10/secure/usr.bin/openssl/man/spkac.1 stable/10/secure/usr.bin/openssl/man/ts.1 stable/10/secure/usr.bin/openssl/man/tsget.1 stable/10/secure/usr.bin/openssl/man/verify.1 stable/10/secure/usr.bin/openssl/man/version.1 stable/10/secure/usr.bin/openssl/man/x509.1 stable/10/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/crypto/openssl/ACKNOWLEDGMENTS ============================================================================== --- stable/10/crypto/openssl/ACKNOWLEDGMENTS Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/ACKNOWLEDGMENTS Mon Jun 9 06:00:28 2014 (r267258) @@ -10,13 +10,18 @@ OpenSSL project. We would like to identify and thank the following such sponsors for their past or current significant support of the OpenSSL project: +Major support: + + Qualys http://www.qualys.com/ + Very significant support: - OpenGear: www.opengear.com + OpenGear: http://www.opengear.com/ Significant support: - PSW Group: www.psw.net + PSW Group: http://www.psw.net/ + Acano Ltd. http://acano.com/ Please note that we ask permission to identify sponsors and that some sponsors we consider eligible for inclusion here have requested to remain anonymous. Modified: stable/10/crypto/openssl/CHANGES ============================================================================== --- stable/10/crypto/openssl/CHANGES Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/CHANGES Mon Jun 9 06:00:28 2014 (r267258) @@ -2,6 +2,50 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1g and 1.0.1h [5 Jun 2014] + + *) Fix for SSL/TLS MITM flaw. An attacker using a carefully crafted + handshake can force the use of weak keying material in OpenSSL + SSL/TLS clients and servers. + + Thanks to KIKUCHI Masashi (Lepidum Co. Ltd.) for discovering and + researching this issue. (CVE-2014-0224) + [KIKUCHI Masashi, Steve Henson] + + *) Fix DTLS recursion flaw. By sending an invalid DTLS handshake to an + OpenSSL DTLS client the code can be made to recurse eventually crashing + in a DoS attack. + + Thanks to Imre Rad (Search-Lab Ltd.) for discovering this issue. + (CVE-2014-0221) + [Imre Rad, Steve Henson] + + *) Fix DTLS invalid fragment vulnerability. A buffer overrun attack can + be triggered by sending invalid DTLS fragments to an OpenSSL DTLS + client or server. This is potentially exploitable to run arbitrary + code on a vulnerable client or server. + + Thanks to Jüri Aedla for reporting this issue. (CVE-2014-0195) + [Jüri Aedla, Steve Henson] + + *) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites + are subject to a denial of service attack. + + Thanks to Felix Gröbert and Ivan Fratric at Google for discovering + this issue. (CVE-2014-3470) + [Felix Gröbert, Ivan Fratric, Steve Henson] + + *) Harmonize version and its documentation. -f flag is used to display + compilation flags. + [mancha ] + + *) Fix eckey_priv_encode so it immediately returns an error upon a failure + in i2d_ECPrivateKey. + [mancha ] + + *) Fix some double frees. These are not thought to be exploitable. + [mancha ] + Changes between 1.0.1f and 1.0.1g [7 Apr 2014] *) A missing bounds check in the handling of the TLS heartbeat extension Modified: stable/10/crypto/openssl/Makefile ============================================================================== --- stable/10/crypto/openssl/Makefile Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/Makefile Mon Jun 9 06:00:28 2014 (r267258) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1g +VERSION=1.0.1h MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 Modified: stable/10/crypto/openssl/NEWS ============================================================================== --- stable/10/crypto/openssl/NEWS Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/NEWS Mon Jun 9 06:00:28 2014 (r267258) @@ -5,6 +5,14 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.1g and OpenSSL 1.0.1h [5 Jun 2014] + + o Fix for CVE-2014-0224 + o Fix for CVE-2014-0221 + o Fix for CVE-2014-0195 + o Fix for CVE-2014-3470 + o Fix for CVE-2010-5298 + Major changes between OpenSSL 1.0.1f and OpenSSL 1.0.1g [7 Apr 2014] o Fix for CVE-2014-0160 Modified: stable/10/crypto/openssl/README ============================================================================== --- stable/10/crypto/openssl/README Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/README Mon Jun 9 06:00:28 2014 (r267258) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1g 7 Apr 2014 + OpenSSL 1.0.1h 5 Jun 2014 Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/10/crypto/openssl/apps/enc.c ============================================================================== --- stable/10/crypto/openssl/apps/enc.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/apps/enc.c Mon Jun 9 06:00:28 2014 (r267258) @@ -331,6 +331,12 @@ bad: setup_engine(bio_err, engine, 0); #endif + if (cipher && EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) + { + BIO_printf(bio_err, "AEAD ciphers not supported by the enc utility\n"); + goto end; + } + if (md && (dgst=EVP_get_digestbyname(md)) == NULL) { BIO_printf(bio_err,"%s is an unsupported message digest type\n",md); Modified: stable/10/crypto/openssl/apps/ocsp.c ============================================================================== --- stable/10/crypto/openssl/apps/ocsp.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/apps/ocsp.c Mon Jun 9 06:00:28 2014 (r267258) @@ -127,6 +127,7 @@ int MAIN(int argc, char **argv) ENGINE *e = NULL; char **args; char *host = NULL, *port = NULL, *path = "/"; + char *thost = NULL, *tport = NULL, *tpath = NULL; char *reqin = NULL, *respin = NULL; char *reqout = NULL, *respout = NULL; char *signfile = NULL, *keyfile = NULL; @@ -204,6 +205,12 @@ int MAIN(int argc, char **argv) } else if (!strcmp(*args, "-url")) { + if (thost) + OPENSSL_free(thost); + if (tport) + OPENSSL_free(tport); + if (tpath) + OPENSSL_free(tpath); if (args[1]) { args++; @@ -212,6 +219,9 @@ int MAIN(int argc, char **argv) BIO_printf(bio_err, "Error parsing URL\n"); badarg = 1; } + thost = host; + tport = port; + tpath = path; } else badarg = 1; } @@ -920,12 +930,12 @@ end: sk_X509_pop_free(verify_other, X509_free); sk_CONF_VALUE_pop_free(headers, X509V3_conf_free); - if (use_ssl != -1) - { - OPENSSL_free(host); - OPENSSL_free(port); - OPENSSL_free(path); - } + if (thost) + OPENSSL_free(thost); + if (tport) + OPENSSL_free(tport); + if (tpath) + OPENSSL_free(tpath); OPENSSL_EXIT(ret); } Modified: stable/10/crypto/openssl/apps/req.c ============================================================================== --- stable/10/crypto/openssl/apps/req.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/apps/req.c Mon Jun 9 06:00:28 2014 (r267258) @@ -1489,7 +1489,13 @@ start: #ifdef CHARSET_EBCDIC ebcdic2ascii(buf, buf, i); #endif - if(!req_check_len(i, n_min, n_max)) goto start; + if(!req_check_len(i, n_min, n_max)) + { + if (batch || value) + return 0; + goto start; + } + if (!X509_NAME_add_entry_by_NID(n,nid, chtype, (unsigned char *) buf, -1,-1,mval)) goto err; ret=1; @@ -1548,7 +1554,12 @@ start: #ifdef CHARSET_EBCDIC ebcdic2ascii(buf, buf, i); #endif - if(!req_check_len(i, n_min, n_max)) goto start; + if(!req_check_len(i, n_min, n_max)) + { + if (batch || value) + return 0; + goto start; + } if(!X509_REQ_add1_attr_by_NID(req, nid, chtype, (unsigned char *)buf, -1)) { Modified: stable/10/crypto/openssl/apps/s_cb.c ============================================================================== --- stable/10/crypto/openssl/apps/s_cb.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/apps/s_cb.c Mon Jun 9 06:00:28 2014 (r267258) @@ -747,6 +747,10 @@ void MS_CALLBACK tlsext_cb(SSL *s, int c break; #endif + case TLSEXT_TYPE_padding: + extname = "TLS padding"; + break; + default: extname = "unknown"; break; Modified: stable/10/crypto/openssl/apps/s_socket.c ============================================================================== --- stable/10/crypto/openssl/apps/s_socket.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/apps/s_socket.c Mon Jun 9 06:00:28 2014 (r267258) @@ -274,7 +274,7 @@ static int init_client_ip(int *sock, uns { i=0; i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); - if (i < 0) { perror("keepalive"); return(0); } + if (i < 0) { closesocket(s); perror("keepalive"); return(0); } } #endif @@ -450,6 +450,7 @@ redoit: if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL) { perror("OPENSSL_malloc"); + closesocket(ret); return(0); } BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1); @@ -458,11 +459,13 @@ redoit: if (h2 == NULL) { BIO_printf(bio_err,"gethostbyname failure\n"); + closesocket(ret); return(0); } if (h2->h_addrtype != AF_INET) { BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n"); + closesocket(ret); return(0); } } Modified: stable/10/crypto/openssl/apps/smime.c ============================================================================== --- stable/10/crypto/openssl/apps/smime.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/apps/smime.c Mon Jun 9 06:00:28 2014 (r267258) @@ -541,8 +541,8 @@ int MAIN(int argc, char **argv) { if (!cipher) { -#ifndef OPENSSL_NO_RC2 - cipher = EVP_rc2_40_cbc(); +#ifndef OPENSSL_NO_DES + cipher = EVP_des_ede3_cbc(); #else BIO_printf(bio_err, "No cipher selected\n"); goto end; Modified: stable/10/crypto/openssl/crypto/asn1/a_strnid.c ============================================================================== --- stable/10/crypto/openssl/crypto/asn1/a_strnid.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/asn1/a_strnid.c Mon Jun 9 06:00:28 2014 (r267258) @@ -74,7 +74,7 @@ static int sk_table_cmp(const ASN1_STRIN * certain software (e.g. Netscape) has problems with them. */ -static unsigned long global_mask = 0xFFFFFFFFL; +static unsigned long global_mask = B_ASN1_UTF8STRING; void ASN1_STRING_set_default_mask(unsigned long mask) { Modified: stable/10/crypto/openssl/crypto/bio/bss_dgram.c ============================================================================== --- stable/10/crypto/openssl/crypto/bio/bss_dgram.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/bio/bss_dgram.c Mon Jun 9 06:00:28 2014 (r267258) @@ -1333,7 +1333,7 @@ static long dgram_sctp_ctrl(BIO *b, int bio_dgram_sctp_data *data = NULL; socklen_t sockopt_len = 0; struct sctp_authkeyid authkeyid; - struct sctp_authkey *authkey; + struct sctp_authkey *authkey = NULL; data = (bio_dgram_sctp_data *)b->ptr; @@ -1388,6 +1388,11 @@ static long dgram_sctp_ctrl(BIO *b, int /* Add new key */ sockopt_len = sizeof(struct sctp_authkey) + 64 * sizeof(uint8_t); authkey = OPENSSL_malloc(sockopt_len); + if (authkey == NULL) + { + ret = -1; + break; + } memset(authkey, 0x00, sockopt_len); authkey->sca_keynumber = authkeyid.scact_keynumber + 1; #ifndef __FreeBSD__ @@ -1399,6 +1404,8 @@ static long dgram_sctp_ctrl(BIO *b, int memcpy(&authkey->sca_key[0], ptr, 64 * sizeof(uint8_t)); ret = setsockopt(b->num, IPPROTO_SCTP, SCTP_AUTH_KEY, authkey, sockopt_len); + OPENSSL_free(authkey); + authkey = NULL; if (ret < 0) break; /* Reset active key */ Modified: stable/10/crypto/openssl/crypto/bn/bn_mont.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/bn_mont.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/bn/bn_mont.c Mon Jun 9 06:00:28 2014 (r267258) @@ -478,32 +478,38 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CT BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, const BIGNUM *mod, BN_CTX *ctx) { - int got_write_lock = 0; BN_MONT_CTX *ret; CRYPTO_r_lock(lock); - if (!*pmont) + ret = *pmont; + CRYPTO_r_unlock(lock); + if (ret) + return ret; + + /* We don't want to serialise globally while doing our lazy-init math in + * BN_MONT_CTX_set. That punishes threads that are doing independent + * things. Instead, punish the case where more than one thread tries to + * lazy-init the same 'pmont', by having each do the lazy-init math work + * independently and only use the one from the thread that wins the race + * (the losers throw away the work they've done). */ + ret = BN_MONT_CTX_new(); + if (!ret) + return NULL; + if (!BN_MONT_CTX_set(ret, mod, ctx)) { - CRYPTO_r_unlock(lock); - CRYPTO_w_lock(lock); - got_write_lock = 1; + BN_MONT_CTX_free(ret); + return NULL; + } - if (!*pmont) - { - ret = BN_MONT_CTX_new(); - if (ret && !BN_MONT_CTX_set(ret, mod, ctx)) - BN_MONT_CTX_free(ret); - else - *pmont = ret; - } + /* The locked compare-and-set, after the local work is done. */ + CRYPTO_w_lock(lock); + if (*pmont) + { + BN_MONT_CTX_free(ret); + ret = *pmont; } - - ret = *pmont; - - if (got_write_lock) - CRYPTO_w_unlock(lock); else - CRYPTO_r_unlock(lock); - + *pmont = ret; + CRYPTO_w_unlock(lock); return ret; } Modified: stable/10/crypto/openssl/crypto/cms/cms_env.c ============================================================================== --- stable/10/crypto/openssl/crypto/cms/cms_env.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/cms/cms_env.c Mon Jun 9 06:00:28 2014 (r267258) @@ -185,6 +185,8 @@ CMS_RecipientInfo *CMS_add1_recipient_ce if (flags & CMS_USE_KEYID) { ktri->version = 2; + if (env->version < 2) + env->version = 2; type = CMS_RECIPINFO_KEYIDENTIFIER; } else Modified: stable/10/crypto/openssl/crypto/cms/cms_sd.c ============================================================================== --- stable/10/crypto/openssl/crypto/cms/cms_sd.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/cms/cms_sd.c Mon Jun 9 06:00:28 2014 (r267258) @@ -158,8 +158,8 @@ static void cms_sd_set_version(CMS_Signe if (sd->version < 3) sd->version = 3; } - else - sd->version = 1; + else if (si->version < 1) + si->version = 1; } if (sd->version < 1) Modified: stable/10/crypto/openssl/crypto/cms/cms_smime.c ============================================================================== --- stable/10/crypto/openssl/crypto/cms/cms_smime.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/cms/cms_smime.c Mon Jun 9 06:00:28 2014 (r267258) @@ -611,7 +611,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInf STACK_OF(CMS_RecipientInfo) *ris; CMS_RecipientInfo *ri; int i, r; - int debug = 0; + int debug = 0, ri_match = 0; ris = CMS_get0_RecipientInfos(cms); if (ris) debug = cms->d.envelopedData->encryptedContentInfo->debug; @@ -620,6 +620,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInf ri = sk_CMS_RecipientInfo_value(ris, i); if (CMS_RecipientInfo_type(ri) != CMS_RECIPINFO_TRANS) continue; + ri_match = 1; /* If we have a cert try matching RecipientInfo * otherwise try them all. */ @@ -655,7 +656,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInf } } /* If no cert and not debugging always return success */ - if (!cert && !debug) + if (ri_match && !cert && !debug) { ERR_clear_error(); return 1; Modified: stable/10/crypto/openssl/crypto/dso/dso_dlfcn.c ============================================================================== --- stable/10/crypto/openssl/crypto/dso/dso_dlfcn.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/dso/dso_dlfcn.c Mon Jun 9 06:00:28 2014 (r267258) @@ -464,7 +464,7 @@ static int dlfcn_pathbyaddr(void *addr,c return len; } - ERR_add_error_data(4, "dlfcn_pathbyaddr(): ", dlerror()); + ERR_add_error_data(2, "dlfcn_pathbyaddr(): ", dlerror()); #endif return -1; } Modified: stable/10/crypto/openssl/crypto/ec/ec_ameth.c ============================================================================== --- stable/10/crypto/openssl/crypto/ec/ec_ameth.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/ec/ec_ameth.c Mon Jun 9 06:00:28 2014 (r267258) @@ -352,6 +352,7 @@ static int eckey_priv_encode(PKCS8_PRIV_ EC_KEY_set_enc_flags(ec_key, old_flags); OPENSSL_free(ep); ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB); + return 0; } /* restore old encoding flags */ EC_KEY_set_enc_flags(ec_key, old_flags); Modified: stable/10/crypto/openssl/crypto/ec/ec_asn1.c ============================================================================== --- stable/10/crypto/openssl/crypto/ec/ec_asn1.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/ec/ec_asn1.c Mon Jun 9 06:00:28 2014 (r267258) @@ -1435,8 +1435,11 @@ int i2o_ECPublicKey(EC_KEY *a, unsigned *out, buf_len, NULL)) { ECerr(EC_F_I2O_ECPUBLICKEY, ERR_R_EC_LIB); - OPENSSL_free(*out); - *out = NULL; + if (new_buffer) + { + OPENSSL_free(*out); + *out = NULL; + } return 0; } if (!new_buffer) Modified: stable/10/crypto/openssl/crypto/ec/ec_lcl.h ============================================================================== --- stable/10/crypto/openssl/crypto/ec/ec_lcl.h Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/ec/ec_lcl.h Mon Jun 9 06:00:28 2014 (r267258) @@ -404,7 +404,7 @@ int ec_GF2m_simple_mul(const EC_GROUP *g int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); int ec_GF2m_have_precompute_mult(const EC_GROUP *group); -#ifndef OPENSSL_EC_NISTP_64_GCC_128 +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 /* method functions in ecp_nistp224.c */ int ec_GFp_nistp224_group_init(EC_GROUP *group); int ec_GFp_nistp224_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *n, BN_CTX *); Modified: stable/10/crypto/openssl/crypto/evp/bio_b64.c ============================================================================== --- stable/10/crypto/openssl/crypto/evp/bio_b64.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/evp/bio_b64.c Mon Jun 9 06:00:28 2014 (r267258) @@ -226,6 +226,7 @@ static int b64_read(BIO *b, char *out, i else if (ctx->start) { q=p=(unsigned char *)ctx->tmp; + num = 0; for (j=0; j v) { rv=-1; goto end; } ret+=(v-eof); } else Modified: stable/10/crypto/openssl/crypto/opensslv.h ============================================================================== --- stable/10/crypto/openssl/crypto/opensslv.h Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/opensslv.h Mon Jun 9 06:00:28 2014 (r267258) @@ -25,11 +25,11 @@ * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -#define OPENSSL_VERSION_NUMBER 0x1000107fL +#define OPENSSL_VERSION_NUMBER 0x1000108fL #ifdef OPENSSL_FIPS -#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1g-fips 7 Apr 2014" +#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1h-fips 5 Jun 2014" #else -#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1g-freebsd 7 Apr 2014" +#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1h-freebsd 5 Jun 2014" #endif #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT Modified: stable/10/crypto/openssl/crypto/pkcs12/p12_crt.c ============================================================================== --- stable/10/crypto/openssl/crypto/pkcs12/p12_crt.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/pkcs12/p12_crt.c Mon Jun 9 06:00:28 2014 (r267258) @@ -96,7 +96,11 @@ PKCS12 *PKCS12_create(char *pass, char * nid_cert = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; else #endif +#ifdef OPENSSL_NO_RC2 + nid_cert = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; +#else nid_cert = NID_pbe_WithSHA1And40BitRC2_CBC; +#endif } if (!nid_key) nid_key = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; @@ -286,7 +290,11 @@ int PKCS12_add_safe(STACK_OF(PKCS7) **ps free_safes = 0; if (nid_safe == 0) +#ifdef OPENSSL_NO_RC2 + nid_safe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; +#else nid_safe = NID_pbe_WithSHA1And40BitRC2_CBC; +#endif if (nid_safe == -1) p7 = PKCS12_pack_p7data(bags); Modified: stable/10/crypto/openssl/crypto/pkcs12/p12_kiss.c ============================================================================== --- stable/10/crypto/openssl/crypto/pkcs12/p12_kiss.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/pkcs12/p12_kiss.c Mon Jun 9 06:00:28 2014 (r267258) @@ -269,7 +269,7 @@ static int parse_bag(PKCS12_SAFEBAG *bag int len, r; unsigned char *data; len = ASN1_STRING_to_UTF8(&data, fname); - if(len > 0) { + if(len >= 0) { r = X509_alias_set1(x509, data, len); OPENSSL_free(data); if (!r) Modified: stable/10/crypto/openssl/crypto/pkcs7/pk7_doit.c ============================================================================== --- stable/10/crypto/openssl/crypto/pkcs7/pk7_doit.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/pkcs7/pk7_doit.c Mon Jun 9 06:00:28 2014 (r267258) @@ -440,6 +440,11 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKE { case NID_pkcs7_signed: data_body=PKCS7_get_octet_string(p7->d.sign->contents); + if (!PKCS7_is_detached(p7) && data_body == NULL) + { + PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_INVALID_SIGNED_DATA_TYPE); + goto err; + } md_sk=p7->d.sign->md_algs; break; case NID_pkcs7_signedAndEnveloped: @@ -928,6 +933,7 @@ int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_ if (EVP_DigestSignUpdate(&mctx,abuf,alen) <= 0) goto err; OPENSSL_free(abuf); + abuf = NULL; if (EVP_DigestSignFinal(&mctx, NULL, &siglen) <= 0) goto err; abuf = OPENSSL_malloc(siglen); Modified: stable/10/crypto/openssl/crypto/pkcs7/pkcs7.h ============================================================================== --- stable/10/crypto/openssl/crypto/pkcs7/pkcs7.h Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/pkcs7/pkcs7.h Mon Jun 9 06:00:28 2014 (r267258) @@ -453,6 +453,7 @@ void ERR_load_PKCS7_strings(void); #define PKCS7_R_ERROR_SETTING_CIPHER 121 #define PKCS7_R_INVALID_MIME_TYPE 131 #define PKCS7_R_INVALID_NULL_POINTER 143 +#define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155 #define PKCS7_R_MIME_NO_CONTENT_TYPE 132 #define PKCS7_R_MIME_PARSE_ERROR 133 #define PKCS7_R_MIME_SIG_PARSE_ERROR 134 Modified: stable/10/crypto/openssl/crypto/pkcs7/pkcs7err.c ============================================================================== --- stable/10/crypto/openssl/crypto/pkcs7/pkcs7err.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/pkcs7/pkcs7err.c Mon Jun 9 06:00:28 2014 (r267258) @@ -1,6 +1,6 @@ /* crypto/pkcs7/pkcs7err.c */ /* ==================================================================== - * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2014 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -130,6 +130,7 @@ static ERR_STRING_DATA PKCS7_str_reasons {ERR_REASON(PKCS7_R_ERROR_SETTING_CIPHER),"error setting cipher"}, {ERR_REASON(PKCS7_R_INVALID_MIME_TYPE) ,"invalid mime type"}, {ERR_REASON(PKCS7_R_INVALID_NULL_POINTER),"invalid null pointer"}, +{ERR_REASON(PKCS7_R_INVALID_SIGNED_DATA_TYPE),"invalid signed data type"}, {ERR_REASON(PKCS7_R_MIME_NO_CONTENT_TYPE),"mime no content type"}, {ERR_REASON(PKCS7_R_MIME_PARSE_ERROR) ,"mime parse error"}, {ERR_REASON(PKCS7_R_MIME_SIG_PARSE_ERROR),"mime sig parse error"}, Modified: stable/10/crypto/openssl/crypto/rsa/rsa_ameth.c ============================================================================== --- stable/10/crypto/openssl/crypto/rsa/rsa_ameth.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/rsa/rsa_ameth.c Mon Jun 9 06:00:28 2014 (r267258) @@ -358,7 +358,7 @@ static int rsa_pss_param_print(BIO *bp, if (i2a_ASN1_INTEGER(bp, pss->saltLength) <= 0) goto err; } - else if (BIO_puts(bp, "0x14 (default)") <= 0) + else if (BIO_puts(bp, "14 (default)") <= 0) goto err; BIO_puts(bp, "\n"); Modified: stable/10/crypto/openssl/crypto/srp/srp_vfy.c ============================================================================== --- stable/10/crypto/openssl/crypto/srp/srp_vfy.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/srp/srp_vfy.c Mon Jun 9 06:00:28 2014 (r267258) @@ -93,6 +93,9 @@ static int t_fromb64(unsigned char *a, c else a[i] = loc - b64table; ++i; } + /* if nothing valid to process we have a zero length response */ + if (i == 0) + return 0; size = i; i = size - 1; j = size; Modified: stable/10/crypto/openssl/crypto/ts/ts_rsp_verify.c ============================================================================== --- stable/10/crypto/openssl/crypto/ts/ts_rsp_verify.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/ts/ts_rsp_verify.c Mon Jun 9 06:00:28 2014 (r267258) @@ -629,6 +629,7 @@ static int TS_compute_imprint(BIO *data, X509_ALGOR_free(*md_alg); OPENSSL_free(*imprint); *imprint_len = 0; + *imprint = NULL; return 0; } Modified: stable/10/crypto/openssl/crypto/x509v3/v3_purp.c ============================================================================== --- stable/10/crypto/openssl/crypto/x509v3/v3_purp.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/crypto/x509v3/v3_purp.c Mon Jun 9 06:00:28 2014 (r267258) @@ -389,8 +389,8 @@ static void x509v3_cache_extensions(X509 /* Handle proxy certificates */ if((pci=X509_get_ext_d2i(x, NID_proxyCertInfo, NULL, NULL))) { if (x->ex_flags & EXFLAG_CA - || X509_get_ext_by_NID(x, NID_subject_alt_name, 0) >= 0 - || X509_get_ext_by_NID(x, NID_issuer_alt_name, 0) >= 0) { + || X509_get_ext_by_NID(x, NID_subject_alt_name, -1) >= 0 + || X509_get_ext_by_NID(x, NID_issuer_alt_name, -1) >= 0) { x->ex_flags |= EXFLAG_INVALID; } if (pci->pcPathLengthConstraint) { @@ -670,7 +670,7 @@ static int check_purpose_timestamp_sign( return 0; /* Extended Key Usage MUST be critical */ - i_ext = X509_get_ext_by_NID((X509 *) x, NID_ext_key_usage, 0); + i_ext = X509_get_ext_by_NID((X509 *) x, NID_ext_key_usage, -1); if (i_ext >= 0) { X509_EXTENSION *ext = X509_get_ext((X509 *) x, i_ext); Modified: stable/10/crypto/openssl/doc/apps/cms.pod ============================================================================== --- stable/10/crypto/openssl/doc/apps/cms.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/apps/cms.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -90,6 +90,11 @@ decrypt mail using the supplied certific encrypted mail message in MIME format for the input file. The decrypted mail is written to the output file. +=item B<-debug_decrypt> + +this option sets the B flag. This option should be used +with caution: see the notes section below. + =item B<-sign> sign mail using the supplied certificate and private key. Input file is @@ -446,6 +451,16 @@ Streaming is always used for the B<-sign since the content is no longer part of the CMS structure the encoding remains DER. +If the B<-decrypt> option is used without a recipient certificate then an +attempt is made to locate the recipient by trying each potential recipient +in turn using the supplied private key. To thwart the MMA attack +(Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) all recipients are +tried whether they succeed or not and if no recipients match the message +is "decrypted" using a random key which will typically output garbage. +The B<-debug_decrypt> option can be used to disable the MMA attack protection +and return an error if no recipient can be found: this option should be used +with caution. For a fuller description see L). + =head1 EXIT CODES =over 4 Modified: stable/10/crypto/openssl/doc/apps/enc.pod ============================================================================== --- stable/10/crypto/openssl/doc/apps/enc.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/apps/enc.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -215,6 +215,10 @@ unsupported options (for example B program does not support authenticated encryption modes +like CCM and GCM. The utility does not store or retrieve the +authentication tag. + base64 Base 64 Modified: stable/10/crypto/openssl/doc/apps/s_server.pod ============================================================================== --- stable/10/crypto/openssl/doc/apps/s_server.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/apps/s_server.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -44,6 +44,7 @@ B B [B<-no_ssl3>] [B<-no_tls1>] [B<-no_dhe>] +[B<-no_ecdhe>] [B<-bugs>] [B<-hack>] [B<-www>] @@ -131,6 +132,11 @@ a static set of parameters hard coded in if this option is set then no DH parameters will be loaded effectively disabling the ephemeral DH cipher suites. +=item B<-no_ecdhe> + +if this option is set then no ECDH parameters will be loaded effectively +disabling the ephemeral ECDH cipher suites. + =item B<-no_tmp_rsa> certain export cipher suites sometimes use a temporary RSA key, this option Modified: stable/10/crypto/openssl/doc/apps/smime.pod ============================================================================== --- stable/10/crypto/openssl/doc/apps/smime.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/apps/smime.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -159,7 +159,7 @@ EVP_get_cipherbyname() function) can als example B<-aes_128_cbc>. See L|enc(1)> for list of ciphers supported by your version of OpenSSL. -If not specified 40 bit RC2 is used. Only used with B<-encrypt>. +If not specified triple DES is used. Only used with B<-encrypt>. =item B<-nointern> Modified: stable/10/crypto/openssl/doc/apps/verify.pod ============================================================================== --- stable/10/crypto/openssl/doc/apps/verify.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/apps/verify.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -25,6 +25,7 @@ B B [B<-untrusted file>] [B<-help>] [B<-issuer_checks>] +[B<-attime timestamp>] [B<-verbose>] [B<->] [certificates] @@ -80,6 +81,12 @@ rejected. The presence of rejection mess anything is wrong; during the normal verification process, several rejections may take place. +=item B<-attime timestamp> + +Perform validation checks using time specified by B and not +current system time. B is the number of seconds since +01.01.1970 (UNIX time). + =item B<-policy arg> Enable policy processing and add B to the user-initial-policy-set (see @@ -386,7 +393,7 @@ an application specific error. Unused. =head1 BUGS -Although the issuer checks are a considerably improvement over the old technique they still +Although the issuer checks are a considerable improvement over the old technique they still suffer from limitations in the underlying X509_LOOKUP API. One consequence of this is that trusted certificates with matching subject name must either appear in a file (as specified by the B<-CAfile> option) or a directory (as specified by B<-CApath>. If they occur in both then only Modified: stable/10/crypto/openssl/doc/apps/version.pod ============================================================================== --- stable/10/crypto/openssl/doc/apps/version.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/apps/version.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -13,6 +13,7 @@ B [B<-o>] [B<-f>] [B<-p>] +[B<-d>] =head1 DESCRIPTION @@ -38,7 +39,7 @@ the date the current version of OpenSSL option information: various options set when the library was built. -=item B<-c> +=item B<-f> compilation flags. Modified: stable/10/crypto/openssl/doc/apps/x509v3_config.pod ============================================================================== --- stable/10/crypto/openssl/doc/apps/x509v3_config.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/apps/x509v3_config.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -301,7 +301,7 @@ Example: O=Organisation CN=Some Name - + =head2 Certificate Policies. This is a I extension. All the fields of this extension can be set by @@ -390,7 +390,7 @@ Examples: nameConstraints=permitted;email:.somedomain.com nameConstraints=excluded;email:.com -issuingDistributionPoint = idp_section + =head2 OCSP No Check Modified: stable/10/crypto/openssl/doc/crypto/CMS_decrypt.pod ============================================================================== --- stable/10/crypto/openssl/doc/crypto/CMS_decrypt.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/crypto/CMS_decrypt.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -27,7 +27,21 @@ function or errors about unknown algorit Although the recipients certificate is not needed to decrypt the data it is needed to locate the appropriate (of possible several) recipients in the CMS -structure. If B is set to NULL all possible recipients are tried. +structure. + +If B is set to NULL all possible recipients are tried. This case however +is problematic. To thwart the MMA attack (Bleichenbacher's attack on +PKCS #1 v1.5 RSA padding) all recipients are tried whether they succeed or +not. If no recipient succeeds then a random symmetric key is used to decrypt +the content: this will typically output garbage and may (but is not guaranteed +to) ultimately return a padding error only. If CMS_decrypt() just returned an +error when all recipient encrypted keys failed to decrypt an attacker could +use this in a timing attack. If the special flag B is set +then the above behaviour is modified and an error B returned if no +recipient encrypted key can be decrypted B generating a random +content encryption key. Applications should use this flag with +B especially in automated gateways as it can leave them +open to attack. It is possible to determine the correct recipient key by other means (for example looking them up in a database) and setting them in the CMS structure Modified: stable/10/crypto/openssl/doc/crypto/CONF_modules_free.pod ============================================================================== --- stable/10/crypto/openssl/doc/crypto/CONF_modules_free.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/crypto/CONF_modules_free.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -37,7 +37,7 @@ None of the functions return a value. =head1 SEE ALSO L, L, -L +L =head1 HISTORY Modified: stable/10/crypto/openssl/doc/crypto/CONF_modules_load_file.pod ============================================================================== --- stable/10/crypto/openssl/doc/crypto/CONF_modules_load_file.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/crypto/CONF_modules_load_file.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -51,7 +51,7 @@ return value of the failing module (this =head1 SEE ALSO L, L, -L, L +L, L =head1 HISTORY Modified: stable/10/crypto/openssl/doc/crypto/OPENSSL_config.pod ============================================================================== --- stable/10/crypto/openssl/doc/crypto/OPENSSL_config.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/crypto/OPENSSL_config.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -73,7 +73,7 @@ Neither OPENSSL_config() nor OPENSSL_no_ =head1 SEE ALSO L, L, -L +L =head1 HISTORY Modified: stable/10/crypto/openssl/doc/crypto/X509_NAME_ENTRY_get_object.pod ============================================================================== --- stable/10/crypto/openssl/doc/crypto/X509_NAME_ENTRY_get_object.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/crypto/X509_NAME_ENTRY_get_object.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -65,7 +65,7 @@ set first so the relevant field informat =head1 SEE ALSO L, L, -L +L =head1 HISTORY Modified: stable/10/crypto/openssl/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod ============================================================================== --- stable/10/crypto/openssl/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -15,7 +15,7 @@ X509_STORE_CTX_get_ex_new_index, X509_ST int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *d, int idx, void *arg); - char *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx); + void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx); =head1 DESCRIPTION Modified: stable/10/crypto/openssl/doc/fingerprints.txt ============================================================================== --- stable/10/crypto/openssl/doc/fingerprints.txt Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/fingerprints.txt Mon Jun 9 06:00:28 2014 (r267258) @@ -21,6 +21,13 @@ pub 2048R/F295C759 1998-12-13 Key fingerprint = D0 5D 8C 61 6E 27 E6 60 41 EC B1 B8 D5 7E E5 97 uid Dr S N Henson +pub 4096R/FA40E9E2 2005-03-19 + Key fingerprint = 6260 5AA4 334A F9F0 DDE5 D349 D357 7507 FA40 E9E2 +uid Dr Stephen Henson +uid Dr Stephen Henson +uid Dr Stephen N Henson +sub 4096R/8811F530 2005-03-19 + pub 1024R/49A563D9 1997-02-24 Key fingerprint = 7B 79 19 FA 71 6B 87 25 0E 77 21 E5 52 D9 83 BF uid Mark Cox Modified: stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_msg_callback.pod ============================================================================== --- stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_msg_callback.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_msg_callback.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -11,8 +11,8 @@ SSL_CTX_set_msg_callback, SSL_CTX_set_ms void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg); - void SSL_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); - void SSL_set_msg_callback_arg(SSL_CTX *ctx, void *arg); + void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); + void SSL_set_msg_callback_arg(SSL *ssl, void *arg); =head1 DESCRIPTION Modified: stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod ============================================================================== --- stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -112,6 +112,12 @@ vulnerability affecting CBC ciphers, whi broken SSL implementations. This option has no effect for connections using other ciphers. +=item SSL_OP_TLSEXT_PADDING + +Adds a padding extension to ensure the ClientHello size is never between +256 and 511 bytes in length. This is needed as a workaround for some +implementations. + =item SSL_OP_ALL All of the above bug workarounds. Modified: stable/10/crypto/openssl/doc/ssl/SSL_get_peer_cert_chain.pod ============================================================================== --- stable/10/crypto/openssl/doc/ssl/SSL_get_peer_cert_chain.pod Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/doc/ssl/SSL_get_peer_cert_chain.pod Mon Jun 9 06:00:28 2014 (r267258) @@ -8,11 +8,11 @@ SSL_get_peer_cert_chain - get the X509 c #include - STACKOF(X509) *SSL_get_peer_cert_chain(const SSL *ssl); + STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl); =head1 DESCRIPTION -SSL_get_peer_cert_chain() returns a pointer to STACKOF(X509) certificates +SSL_get_peer_cert_chain() returns a pointer to STACK_OF(X509) certificates forming the certificate chain of the peer. If called on the client side, the stack also contains the peer's certificate; if called on the server side, the peer's certificate must be obtained separately using @@ -24,7 +24,7 @@ If the peer did not present a certificat The peer certificate chain is not necessarily available after reusing a session, in which case a NULL pointer is returned. -The reference count of the STACKOF(X509) object is not incremented. +The reference count of the STACK_OF(X509) object is not incremented. If the corresponding session is freed, the pointer must not be used any longer. @@ -39,7 +39,7 @@ The following return values can occur: No certificate was presented by the peer or no connection was established or the certificate chain is no longer available when a session is reused. -=item Pointer to a STACKOF(X509) +=item Pointer to a STACK_OF(X509) The return value points to the certificate chain presented by the peer. Modified: stable/10/crypto/openssl/engines/ccgost/gost_ameth.c ============================================================================== --- stable/10/crypto/openssl/engines/ccgost/gost_ameth.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/engines/ccgost/gost_ameth.c Mon Jun 9 06:00:28 2014 (r267258) @@ -269,7 +269,7 @@ static int pkey_ctrl_gost(EVP_PKEY *pkey case ASN1_PKEY_CTRL_CMS_ENVELOPE: if (arg1 == 0) { - X509_ALGOR *alg; + X509_ALGOR *alg = NULL; ASN1_STRING * params = encode_gost_algor_params(pkey); if (!params) { Modified: stable/10/crypto/openssl/ssl/Makefile ============================================================================== --- stable/10/crypto/openssl/ssl/Makefile Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/ssl/Makefile Mon Jun 9 06:00:28 2014 (r267258) @@ -15,7 +15,7 @@ KRB5_INCLUDES= CFLAGS= $(INCLUDES) $(CFLAG) GENERAL=Makefile README ssl-lib.com install.com -TEST=ssltest.c +TEST=ssltest.c heartbeat_test.c APPS= LIB=$(TOP)/libssl.a Modified: stable/10/crypto/openssl/ssl/d1_both.c ============================================================================== --- stable/10/crypto/openssl/ssl/d1_both.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/ssl/d1_both.c Mon Jun 9 06:00:28 2014 (r267258) @@ -683,8 +683,8 @@ dtls1_reassemble_fragment(SSL *s, struct item = pitem_new(seq64be, frag); if (item == NULL) { - goto err; i = -1; + goto err; } pqueue_insert(s->d1->buffered_messages, item); Modified: stable/10/crypto/openssl/ssl/d1_lib.c ============================================================================== --- stable/10/crypto/openssl/ssl/d1_lib.c Mon Jun 9 05:56:18 2014 (r267257) +++ stable/10/crypto/openssl/ssl/d1_lib.c Mon Jun 9 06:00:28 2014 (r267258) @@ -176,9 +176,12 @@ static void dtls1_clear_queues(SSL *s) while ( (item = pqueue_pop(s->d1->buffered_app_data.q)) != NULL) { - frag = (hm_fragment *)item->data; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 06:08:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 272F5DAD; Mon, 9 Jun 2014 06:08:31 +0000 (UTC) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "ca.infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 93C922F36; Mon, 9 Jun 2014 06:08:30 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.2.117.99]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.8/8.14.8) with ESMTP id s5968NMR048826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 9 Jun 2014 07:08:24 +0100 (BST) (envelope-from matthew@FreeBSD.org) Authentication-Results: lucid-nonsense.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org DKIM-Filter: OpenDKIM Filter v2.8.3 smtp.infracaninophile.co.uk s5968NMR048826 Authentication-Results: smtp.infracaninophile.co.uk/s5968NMR048826; dkim=none reason="no signature"; dkim-adsp=none Message-ID: <53954F4D.1030103@FreeBSD.org> Date: Mon, 09 Jun 2014 07:08:13 +0100 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: svn-src-stable-10@freebsd.org Subject: Re: svn commit: r267246 - stable/10/share/man/man7 References: <201406090124.s591Ospj078651@svn.freebsd.org> In-Reply-To: <201406090124.s591Ospj078651@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8MePJfEdK9PRArpH9e6kmtvfWaS2hJrcw" X-Virus-Scanned: clamav-milter 0.98.3 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lucid-nonsense.infracaninophile.co.uk Cc: Glen Barber X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 06:08:31 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8MePJfEdK9PRArpH9e6kmtvfWaS2hJrcw Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 09/06/2014 02:24, Glen Barber wrote: > -.Xr portaudit 1 , > +.Xr pkg 7 , > .Xr portlint 1 It's pkg(8) that has the pkg audit functionality, not pkg(7) Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey --8MePJfEdK9PRArpH9e6kmtvfWaS2hJrcw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.20 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTlU9WXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkAT5iwQAJ0Up0Iq3klrhYOpoW6snLJ1 XN91OzjXIexwoeV018S3FeyL/kPGBu+hkW/4yFWDqZKemqwgIBeF6ESKLrA7j1OY uGsqYFVNDfSRubO1upxH41T0SCP5vAdxpVcJRCv8fDkaRzouNtUpsHE+ca1nSYE/ IKGeKINalfXf1PSxxzf+pLifK2kJwjsFoR4Fr/0Q1qWGXI2z6ME0PIr8QI4aNzXJ GVPhFtOrZZviDBvrz9mymm5Bg6w0t9Aa/3ilBe1/+LCdAfS9rnIIue8Ql3mKEJM0 aryCMuVvtKWE4wjms4tJWDVGbDSyBt/giBDJPysMd/f8Ox1YSnT9cuTcya2zK5S8 f5uSEp0sht+Sk4celKBLMdZzgtLTWq5GDTjS6y21msol0SMLyufWwLbc7rJBlBMT i/iMFW594fay7S0BvSzudZUjh7R7AynH0LEL1xPl5s1dmeRLrFEPQEe+A6+SyC65 bdAm1D0swITx0zEJ4AB5mqwKZFqap6hnpdR93V5zQblwkcOpdUHot33AURYtNBUd Tky67VfLdbeOZzVXDAYSPFq5QPaAh441A7Tq4RLMkoRsyQw/wA7PCVnPrTVEzWWW ogCDkwK+b63JaNBJagV0PcZi9zrF8QJgDIdbPtHf4I7KKNmmUF6nFpCSMq3RZ1bA wjSOSin9jS5gXWzN7TkK =yPIr -----END PGP SIGNATURE----- --8MePJfEdK9PRArpH9e6kmtvfWaS2hJrcw-- From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 07:21:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F2AE5CB7; Mon, 9 Jun 2014 07:21: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 E03C124FD; Mon, 9 Jun 2014 07:21: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 s597LgwH045413; Mon, 9 Jun 2014 07:21:42 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s597LgW7045412; Mon, 9 Jun 2014 07:21:42 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201406090721.s597LgW7045412@svn.freebsd.org> From: Kevin Lo Date: Mon, 9 Jun 2014 07:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267263 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 07:21:43 -0000 Author: kevlo Date: Mon Jun 9 07:21:42 2014 New Revision: 267263 URL: http://svnweb.freebsd.org/changeset/base/267263 Log: MFC r267089: Remove D-Link DWA140 rev D1 by accident. Modified: stable/10/sys/dev/usb/wlan/if_run.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_run.c Mon Jun 9 07:00:27 2014 (r267262) +++ stable/10/sys/dev/usb/wlan/if_run.c Mon Jun 9 07:21:42 2014 (r267263) @@ -180,6 +180,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(DLINK, DWA127), RUN_DEV(DLINK, DWA140B3), RUN_DEV(DLINK, DWA160B2), + RUN_DEV(DLINK, DWA140D1), RUN_DEV(DLINK, DWA162), RUN_DEV(DLINK2, DWA130), RUN_DEV(DLINK2, RT2870_1), From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 10:50:46 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72A31906; Mon, 9 Jun 2014 10:50:45 +0000 (UTC) Date: Mon, 9 Jun 2014 06:50:43 -0400 From: Glen Barber To: Matthew Seaman Subject: Re: svn commit: r267246 - stable/10/share/man/man7 Message-ID: <20140609105043.GL33882@hub.FreeBSD.org> References: <201406090124.s591Ospj078651@svn.freebsd.org> <53954F4D.1030103@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HlXFiQcSFG/a+HqU" Content-Disposition: inline In-Reply-To: <53954F4D.1030103@FreeBSD.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 10:50:46 -0000 --HlXFiQcSFG/a+HqU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 09, 2014 at 07:08:13AM +0100, Matthew Seaman wrote: > On 09/06/2014 02:24, Glen Barber wrote: > > -.Xr portaudit 1 , > > +.Xr pkg 7 , > > .Xr portlint 1 >=20 > It's pkg(8) that has the pkg audit functionality, not pkg(7) >=20 Sure, but pkg(7) manual is in the base system. Otherwise, I would have referenced pkg-audit(8) directly. Glen --HlXFiQcSFG/a+HqU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTlZGDAAoJELls3eqvi17QwkkQAMWBNsNWdOGgVnGI8OOaZ0ae /ekZyKQD7ZKxAX3iugmFCjwxjGOqp2hTXEjNLfNmYwFV0I0vREvN0ngT2P7ORPPq sGgUqFREf56gQcoLDwc8D3Cq16eig0PErvU7gpoxwlQ/GFPC0R+9Yb5jm/h9ha5S 4zrwyHu+A2aTtpD0lrAutASQKh05JixswJHR7TO3Znu7gcsmZ/OFQc2Wm4CSATWt YFKXrsnlgNW81sW/T49EHjoxjUitPfJtNrPaXHN+e73ynoZ4CTGyAF+I+9DMa1RN vn+DlDqXsbRfPv7+7Cg0XG/dCS6G11vnDBjKTkBk1YyMRfKFkC9gHHLoQhdU7hSK /oJkNAykln2t6xT0EOmhd/IW0SouzhaYqeDQhtCPfOk22M8HEHykaAib3fmDWa7N EREhnpbv9q7OzjY7BUuwe8aAe9auuAPFJGfRayGAJMznF3ZCaR+zsH7hO3QmECWW GqNAi6AJPqVJL0XJUmaf8ImZEwaM+E5kIKDPYuDFCtumJuzZre2G0xK179uHMSl5 XDJR6lkZM8TANCuKD9dBRSJ1tM7MVkyiSzVyk72gRGzFmjvUULSUyhVsDP9HUbsn 7FzQYgSXuvUP5CKIUkYD74mwLfIw0leIgJv5KWI0YXqTYd5wa64KOlYVW98xUp0g opGpxw5CYHSAlVl2/C2p =2RUC -----END PGP SIGNATURE----- --HlXFiQcSFG/a+HqU-- From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 11:12:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1D631F7C; Mon, 9 Jun 2014 11:12:34 +0000 (UTC) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "ca.infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A3D2F29CF; Mon, 9 Jun 2014 11:12:33 +0000 (UTC) Received: from ox-dell39.ox.adestra.com (no-reverse-dns.metronet-uk.com [85.199.232.226] (may be forged)) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.8/8.14.8) with ESMTP id s59BCMxp057870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 9 Jun 2014 12:12:23 +0100 (BST) (envelope-from matthew@freebsd.org) Authentication-Results: lucid-nonsense.infracaninophile.co.uk; dmarc=none header.from=freebsd.org DKIM-Filter: OpenDKIM Filter v2.8.3 smtp.infracaninophile.co.uk s59BCMxp057870 Authentication-Results: smtp.infracaninophile.co.uk/s59BCMxp057870; dkim=none reason="no signature"; dkim-adsp=none X-Authentication-Warning: lucid-nonsense.infracaninophile.co.uk: Host no-reverse-dns.metronet-uk.com [85.199.232.226] (may be forged) claimed to be ox-dell39.ox.adestra.com Message-ID: <5395968F.9060201@freebsd.org> Date: Mon, 09 Jun 2014 12:12:15 +0100 From: Matthew Seaman User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Glen Barber Subject: Re: svn commit: r267246 - stable/10/share/man/man7 References: <201406090124.s591Ospj078651@svn.freebsd.org> <53954F4D.1030103@FreeBSD.org> <20140609105043.GL33882@hub.FreeBSD.org> In-Reply-To: <20140609105043.GL33882@hub.FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bVI5wvvu4WafxsKfDBl5pa5kOVwRU1whU" X-Virus-Scanned: clamav-milter 0.98.3 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lucid-nonsense.infracaninophile.co.uk Cc: svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 11:12:34 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bVI5wvvu4WafxsKfDBl5pa5kOVwRU1whU Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/09/14 11:50, Glen Barber wrote: > On Mon, Jun 09, 2014 at 07:08:13AM +0100, Matthew Seaman wrote: >> On 09/06/2014 02:24, Glen Barber wrote: >>> -.Xr portaudit 1 , >>> +.Xr pkg 7 , >>> .Xr portlint 1 >> >> It's pkg(8) that has the pkg audit functionality, not pkg(7) >> >=20 > Sure, but pkg(7) manual is in the base system. Otherwise, I would have= > referenced pkg-audit(8) directly. Yet neither portaudit nor portlint are in the base system. And I notice now that I managed to crop the diff a bit too hard. The paragraph above says: > .Pp > The following are part of the ports collection: > .Pp > -.Xr portaudit 1 , > +.Xr pkg 7 , > .Xr portlint 1 Hmmm... Cheers, Matthew --bVI5wvvu4WafxsKfDBl5pa5kOVwRU1whU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTlZaWXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTnlK0QAK9m5YWTXSBxKorPJnGnc9u0 woN7p6slxnQIyzvIuDapRmniK3Hl+lHn9tRbinIDgTrs5VF/zS2xfkpr46bmu2fb 3EH87JBO2TPoRtgqCL9FVGo4onefrX8FA5ft1Fd30xlbtWjvUEa6VsUkRLNQcLHs TbUoDcWduUYPQGwbuaqpRtTB6sSA3opXRo7fb8KCa809fuOJ8RzJOnD6eOT+jaYU xyaWVpmyLRDuyzM5+DmwdwFUaetYIlIDP1Cv3kLQfh8v/kFvrfvVQMybmg4KAeqe S9S4nIqIo1ty5pd1kmf+gAZBqVLfhpx3oobsyXl8v4INZVhcIJO7XWaGHM3/NkUa E4u8rKyOnwfe90vbblAhiECmIwNlnGAV0Bb7th/BlCi3/yd0rD2ZBc6oVCprDgSn 1zfvKFXO59HhLVZojhRsX/VQhDm0VPcmVeCKAH9uqr/B0sKB5oopG9MAk9v0oC/r 3+qAxTbCEvyLtby4NZlaFsvB+AkVK4ebED5+1FilD08lhYQhqhOPoQJk2nhxHXBM urxeWF6cFp8DTAnmrvwNdiDPAvwjanu13S0wFCLHdrfGV1eWM+VXwGrdYksCVS61 KQQQjz6B4IjR4AJ6JvRSml8J0tMRP4PKCHhj+4mr4i9DlgTi3m8D3piqhh0Hk/6V fhNdj6Gr0wx+J4Ihaa8D =pH/I -----END PGP SIGNATURE----- --bVI5wvvu4WafxsKfDBl5pa5kOVwRU1whU-- From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 15:09:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2D8B2D28; Mon, 9 Jun 2014 15:09:07 +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 0E2A82DC9; Mon, 9 Jun 2014 15:09:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59F96YA060272; Mon, 9 Jun 2014 15:09:06 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59F96lo060267; Mon, 9 Jun 2014 15:09:06 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406091509.s59F96lo060267@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 9 Jun 2014 15:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267279 - in stable/10/sys/dev: e1000 ixgbe virtio/network vmware/vmxnet3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 15:09:07 -0000 Author: luigi Date: Mon Jun 9 15:09:05 2014 New Revision: 267279 URL: http://svnweb.freebsd.org/changeset/base/267279 Log: MFC svn 267065 and 267187 make sure ifp->if_transmit returns 0 if a buffer is enqueued. This should also be merged to stable/9. After this fix, drivers still known to have this bug are igxbe/ixv and i40e. Drivers using if_transmit are correct, and so are most of the other drivers that reassing if_transmit. Among other things, this bug causes panics when using netmap emulation on top of generic drivers. Modified: stable/10/sys/dev/e1000/if_igb.c stable/10/sys/dev/ixgbe/ixgbe.c stable/10/sys/dev/virtio/network/if_vtnet.c stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Mon Jun 9 15:00:43 2014 (r267278) +++ stable/10/sys/dev/e1000/if_igb.c Mon Jun 9 15:09:05 2014 (r267279) @@ -988,12 +988,12 @@ igb_mq_start(struct ifnet *ifp, struct m if (err) return (err); if (IGB_TX_TRYLOCK(txr)) { - err = igb_mq_start_locked(ifp, txr); + igb_mq_start_locked(ifp, txr); IGB_TX_UNLOCK(txr); } else taskqueue_enqueue(que->tq, &txr->txq_task); - return (err); + return (0); } static int Modified: stable/10/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe.c Mon Jun 9 15:00:43 2014 (r267278) +++ stable/10/sys/dev/ixgbe/ixgbe.c Mon Jun 9 15:09:05 2014 (r267279) @@ -831,12 +831,12 @@ ixgbe_mq_start(struct ifnet *ifp, struct if (err) return (err); if (IXGBE_TX_TRYLOCK(txr)) { - err = ixgbe_mq_start_locked(ifp, txr); + ixgbe_mq_start_locked(ifp, txr); IXGBE_TX_UNLOCK(txr); } else taskqueue_enqueue(que->tq, &txr->txq_task); - return (err); + return (0); } static int Modified: stable/10/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/10/sys/dev/virtio/network/if_vtnet.c Mon Jun 9 15:00:43 2014 (r267278) +++ stable/10/sys/dev/virtio/network/if_vtnet.c Mon Jun 9 15:09:05 2014 (r267279) @@ -2260,7 +2260,6 @@ vtnet_txq_mq_start_locked(struct vtnet_t while ((m = drbr_peek(ifp, br)) != NULL) { if (virtqueue_full(vq)) { drbr_putback(ifp, br, m); - error = ENOBUFS; break; } @@ -2283,7 +2282,7 @@ vtnet_txq_mq_start_locked(struct vtnet_t txq->vtntx_watchdog = VTNET_TX_TIMEOUT; } - return (error); + return (0); } static int Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Mon Jun 9 15:00:43 2014 (r267278) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Mon Jun 9 15:09:05 2014 (r267279) @@ -2933,7 +2933,6 @@ vmxnet3_txq_mq_start_locked(struct vmxne /* Assume worse case if this mbuf is the head of a chain. */ if (m->m_next != NULL && avail < VMXNET3_TX_MAXSEGS) { drbr_putback(ifp, br, m); - error = ENOBUFS; break; } @@ -2956,7 +2955,7 @@ vmxnet3_txq_mq_start_locked(struct vmxne txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT; } - return (error); + return (0); } static int From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 15:15:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 05EFC124; Mon, 9 Jun 2014 15:15: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 E69162FA6; Mon, 9 Jun 2014 15:15:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59FF8n4064484; Mon, 9 Jun 2014 15:15:08 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59FF8iL064483; Mon, 9 Jun 2014 15:15:08 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406091515.s59FF8iL064483@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 9 Jun 2014 15:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267280 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 15:15:09 -0000 Author: luigi Date: Mon Jun 9 15:15:08 2014 New Revision: 267280 URL: http://svnweb.freebsd.org/changeset/base/267280 Log: MFC 267167: whitespace changes (comments) Modified: stable/10/sys/net/netmap.h Modified: stable/10/sys/net/netmap.h ============================================================================== --- stable/10/sys/net/netmap.h Mon Jun 9 15:09:05 2014 (r267279) +++ stable/10/sys/net/netmap.h Mon Jun 9 15:15:08 2014 (r267280) @@ -124,7 +124,7 @@ * space with a parent device. The ifname indicates the parent device, * which must already exist. Flags in nr_flags indicate if we want to * bind the master or slave side, the index (from nr_ringid) - * is just a cookie and does need to be sequential. + * is just a cookie and does not need to be sequential. * * + NIOCREGIF can also attach to 'monitor' rings that replicate * the content of specific rings, also from the same memory space. @@ -228,7 +228,7 @@ struct netmap_slot { * 'head' and 'cur' must be incremented as slots are filled * with new packets to be sent; * 'cur' can be moved further ahead if we need more space - * for new transmissions. + * for new transmissions. XXX todo (2014-03-12) * * In RX rings: * @@ -447,27 +447,13 @@ struct netmap_if { * * nr_arg1, nr_arg2, nr_arg3 (in/out) command specific * - * + * * */ /* * struct nmreq overlays a struct ifreq (just the name) - * - * On input, nr_ringid indicates which rings we are requesting, - * with the low flags for the specific ring number. - * selection FLAGS RING INDEX - * - * all the NIC rings 0x0000 - - * only HOST ring 0x2000 ring index - * single NIC ring 0x4000 - - * all the NIC+HOST rings 0x6000 - - * one pipe ring, master 0x8000 ring index - * *** INVALID 0xA000 - * one pipe ring, slave 0xC000 ring index - * *** INVALID 0xE000 - * */ struct nmreq { char nr_name[IFNAMSIZ]; From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 15:16:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 03B802AB; Mon, 9 Jun 2014 15:16: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 CBBFC2FF0; Mon, 9 Jun 2014 15:16: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 s59FGH1C064684; Mon, 9 Jun 2014 15:16:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59FGHFd064683; Mon, 9 Jun 2014 15:16:17 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406091516.s59FGHFd064683@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 9 Jun 2014 15:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267281 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 15:16:18 -0000 Author: luigi Date: Mon Jun 9 15:16:17 2014 New Revision: 267281 URL: http://svnweb.freebsd.org/changeset/base/267281 Log: MFC 267168: misc bugfixes: - stdio.h is needed for fprint() - make memsize uint32_t to avoid errors due to overflow - honor the *XPOLL flagg in NIOCREGIF requests - mmap fails wit MAP_FAILED, not NULL. Modified: stable/10/sys/net/netmap_user.h Modified: stable/10/sys/net/netmap_user.h ============================================================================== --- stable/10/sys/net/netmap_user.h Mon Jun 9 15:15:08 2014 (r267280) +++ stable/10/sys/net/netmap_user.h Mon Jun 9 15:16:17 2014 (r267281) @@ -133,6 +133,7 @@ nm_ring_space(struct netmap_ring *ring) #ifndef HAVE_NETMAP_WITH_LIBS #define HAVE_NETMAP_WITH_LIBS +#include #include #include #include /* memset */ @@ -192,7 +193,7 @@ struct nm_desc { struct nm_desc *self; /* point to self if netmap. */ int fd; void *mem; - int memsize; + uint32_t memsize; int done_mmap; /* set if mem is the result of mmap */ struct netmap_if * const nifp; uint16_t first_tx_ring, last_tx_ring, cur_tx_ring; @@ -293,7 +294,7 @@ typedef void (*nm_cb_t)(u_char *, const * if passed a netmap_desc with mem != NULL, * use that memory instead of mmap. */ - + static struct nm_desc *nm_open(const char *ifname, const struct nmreq *req, uint64_t flags, const struct nm_desc *arg); @@ -404,8 +405,6 @@ nm_open(const char *ifname, const struct errmsg = "invalid ringid"; goto fail; } - /* add the *XPOLL flags */ - nr_ringid |= new_flags & (NETMAP_NO_TX_POLL | NETMAP_DO_RX_POLL); d = (struct nm_desc *)calloc(1, sizeof(*d)); if (d == NULL) { @@ -461,6 +460,9 @@ nm_open(const char *ifname, const struct d->req.nr_flags = parent->req.nr_flags; } } + /* add the *XPOLL flags */ + d->req.nr_ringid |= new_flags & (NETMAP_NO_TX_POLL | NETMAP_DO_RX_POLL); + if (ioctl(d->fd, NIOCREGIF, &d->req)) { errmsg = "NIOCREGIF failed"; goto fail; @@ -472,10 +474,11 @@ nm_open(const char *ifname, const struct d->memsize = parent->memsize; d->mem = parent->mem; } else { + /* XXX TODO: check if memsize is too large (or there is overflow) */ d->memsize = d->req.nr_memsize; d->mem = mmap(0, d->memsize, PROT_WRITE | PROT_READ, MAP_SHARED, d->fd, 0); - if (d->mem == NULL) { + if (d->mem == MAP_FAILED) { errmsg = "mmap failed"; goto fail; } @@ -531,7 +534,7 @@ nm_open(const char *ifname, const struct } } #endif /* debugging */ - + d->cur_tx_ring = d->first_tx_ring; d->cur_rx_ring = d->first_rx_ring; return d; From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 15:24:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0D7139F6; Mon, 9 Jun 2014 15:24: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 ED0EB2251; Mon, 9 Jun 2014 15:24: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 s59FOl3t069028; Mon, 9 Jun 2014 15:24:47 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59FOkR3069016; Mon, 9 Jun 2014 15:24:46 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406091524.s59FOkR3069016@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 9 Jun 2014 15:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267282 - stable/10/sys/dev/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 15:24:48 -0000 Author: luigi Date: Mon Jun 9 15:24:45 2014 New Revision: 267282 URL: http://svnweb.freebsd.org/changeset/base/267282 Log: sync netmap code with the version in HEAD: - fix handling of tx mbufs in emulated netmap mode; - introduce mbq_lock() and mbq_unlock() - rate limit some error messages - many whitespace and comment fixes Modified: stable/10/sys/dev/netmap/netmap.c stable/10/sys/dev/netmap/netmap_freebsd.c stable/10/sys/dev/netmap/netmap_generic.c stable/10/sys/dev/netmap/netmap_kern.h stable/10/sys/dev/netmap/netmap_mbq.c stable/10/sys/dev/netmap/netmap_mbq.h stable/10/sys/dev/netmap/netmap_mem2.c stable/10/sys/dev/netmap/netmap_pipe.c stable/10/sys/dev/netmap/netmap_vale.c Modified: stable/10/sys/dev/netmap/netmap.c ============================================================================== --- stable/10/sys/dev/netmap/netmap.c Mon Jun 9 15:16:17 2014 (r267281) +++ stable/10/sys/dev/netmap/netmap.c Mon Jun 9 15:24:45 2014 (r267282) @@ -270,6 +270,7 @@ netmap_disable_ring(struct netmap_kring } +/* stop or enable all the rings of na */ static void netmap_set_all_rings(struct ifnet *ifp, int stopped) { @@ -303,6 +304,13 @@ netmap_set_all_rings(struct ifnet *ifp, } +/* + * Convenience function used in drivers. Waits for current txsync()s/rxsync()s + * to finish and prevents any new one from starting. Call this before turning + * netmap mode off, or before removing the harware rings (e.g., on module + * onload). As a rule of thumb for linux drivers, this should be placed near + * each napi_disable(). + */ void netmap_disable_all_rings(struct ifnet *ifp) { @@ -310,6 +318,11 @@ netmap_disable_all_rings(struct ifnet *i } +/* + * Convenience function used in drivers. Re-enables rxsync and txsync on the + * adapter's rings In linux drivers, this should be placed near each + * napi_enable(). + */ void netmap_enable_all_rings(struct ifnet *ifp) { @@ -393,6 +406,7 @@ nm_dump_buf(char *p, int len, int lim, c * Fetch configuration from the device, to cope with dynamic * reconfigurations after loading the module. */ +/* call with NMG_LOCK held */ int netmap_update_config(struct netmap_adapter *na) { @@ -447,18 +461,20 @@ netmap_rxsync_compat(struct netmap_kring return na->nm_rxsync(na, kring->ring_id, flags); } +/* kring->nm_sync callback for the host tx ring */ static int netmap_txsync_to_host_compat(struct netmap_kring *kring, int flags) { - (void)flags; + (void)flags; /* unused */ netmap_txsync_to_host(kring->na); return 0; } +/* kring->nm_sync callback for the host rx ring */ static int netmap_rxsync_from_host_compat(struct netmap_kring *kring, int flags) { - (void)flags; + (void)flags; /* unused */ netmap_rxsync_from_host(kring->na, NULL, NULL); return 0; } @@ -489,6 +505,7 @@ netmap_rxsync_from_host_compat(struct ne * Note: for compatibility, host krings are created even when not needed. * The tailroom space is currently used by vale ports for allocating leases. */ +/* call with NMG_LOCK held */ int netmap_krings_create(struct netmap_adapter *na, u_int tailroom) { @@ -567,6 +584,7 @@ netmap_krings_create(struct netmap_adapt /* undo the actions performed by netmap_krings_create */ +/* call with NMG_LOCK held */ void netmap_krings_delete(struct netmap_adapter *na) { @@ -586,6 +604,7 @@ netmap_krings_delete(struct netmap_adapt * on the rings connected to the host so we need to purge * them first. */ +/* call with NMG_LOCK held */ static void netmap_hw_krings_delete(struct netmap_adapter *na) { @@ -598,6 +617,12 @@ netmap_hw_krings_delete(struct netmap_ad } +/* create a new netmap_if for a newly registered fd. + * If this is the first registration of the adapter, + * also create the netmap rings and their in-kernel view, + * the netmap krings. + */ +/* call with NMG_LOCK held */ static struct netmap_if* netmap_if_new(const char *ifname, struct netmap_adapter *na) { @@ -608,17 +633,23 @@ netmap_if_new(const char *ifname, struct return NULL; } - if (na->active_fds) + if (na->active_fds) /* already registered */ goto final; + /* create and init the krings arrays. + * Depending on the adapter, this may also create + * the netmap rings themselves + */ if (na->nm_krings_create(na)) goto cleanup; + /* create all missing netmap rings */ if (netmap_mem_rings_create(na)) goto cleanup; final: + /* in all cases, create a new netmap if */ nifp = netmap_mem_if_new(ifname, na); if (nifp == NULL) goto cleanup; @@ -638,8 +669,8 @@ cleanup: /* grab a reference to the memory allocator, if we don't have one already. The * reference is taken from the netmap_adapter registered with the priv. - * */ +/* call with NMG_LOCK held */ static int netmap_get_memory_locked(struct netmap_priv_d* p) { @@ -672,6 +703,7 @@ netmap_get_memory_locked(struct netmap_p } +/* call with NMG_LOCK *not* held */ int netmap_get_memory(struct netmap_priv_d* p) { @@ -683,6 +715,7 @@ netmap_get_memory(struct netmap_priv_d* } +/* call with NMG_LOCK held */ static int netmap_have_memory_locked(struct netmap_priv_d* p) { @@ -690,6 +723,7 @@ netmap_have_memory_locked(struct netmap_ } +/* call with NMG_LOCK held */ static void netmap_drop_memory_locked(struct netmap_priv_d* p) { @@ -755,6 +789,7 @@ netmap_do_unregif(struct netmap_priv_d * netmap_mem_if_delete(na, nifp); } +/* call with NMG_LOCK held */ static __inline int nm_tx_si_user(struct netmap_priv_d *priv) { @@ -762,6 +797,7 @@ nm_tx_si_user(struct netmap_priv_d *priv (priv->np_txqlast - priv->np_txqfirst > 1)); } +/* call with NMG_LOCK held */ static __inline int nm_rx_si_user(struct netmap_priv_d *priv) { @@ -771,8 +807,12 @@ nm_rx_si_user(struct netmap_priv_d *priv /* + * Destructor of the netmap_priv_d, called when the fd has + * no active open() and mmap(). Also called in error paths. + * * returns 1 if this is the last instance and we can free priv */ +/* call with NMG_LOCK held */ int netmap_dtor_locked(struct netmap_priv_d *priv) { @@ -805,6 +845,7 @@ netmap_dtor_locked(struct netmap_priv_d } +/* call with NMG_LOCK *not* held */ void netmap_dtor(void *data) { @@ -1009,7 +1050,7 @@ netmap_rxsync_from_host(struct netmap_ad (void)pwait; /* disable unused warnings */ (void)td; - mtx_lock(&q->lock); + mbq_lock(q); /* First part: import newly received packets */ n = mbq_len(q); @@ -1019,7 +1060,7 @@ netmap_rxsync_from_host(struct netmap_ad nm_i = kring->nr_hwtail; stop_i = nm_prev(nm_i, lim); - while ( nm_i != stop_i && (m = mbq_dequeue(q)) != NULL ) { + while ( nm_i != stop_i && (m = mbq_dequeue(q)) != NULL ) { int len = MBUF_LEN(m); struct netmap_slot *slot = &ring->slot[nm_i]; @@ -1051,7 +1092,7 @@ netmap_rxsync_from_host(struct netmap_ad if (kring->rcur == kring->rtail && td) /* no bufs available */ selrecord(td, &kring->si); - mtx_unlock(&q->lock); + mbq_unlock(q); return ret; } @@ -1194,6 +1235,12 @@ netmap_get_na(struct nmreq *nmr, struct if (*na != NULL) /* valid match in netmap_get_bdg_na() */ goto pipes; + /* + * This must be a hardware na, lookup the name in the system. + * Note that by hardware we actually mean "it shows up in ifconfig". + * This may still be a tap, a veth/epair, or even a + * persistent VALE port. + */ ifp = ifunit_ref(nmr->nr_name); if (ifp == NULL) { return ENXIO; @@ -1212,6 +1259,11 @@ netmap_get_na(struct nmreq *nmr, struct netmap_adapter_get(ret); pipes: + /* + * If we are opening a pipe whose parent was not in netmap mode, + * we have to allocate the pipe array now. + * XXX get rid of this clumsiness (2014-03-15) + */ error = netmap_pipe_alloc(*na, nmr); out: @@ -1219,7 +1271,7 @@ out: netmap_adapter_put(ret); if (ifp) - if_rele(ifp); + if_rele(ifp); /* allow live unloading of drivers modules */ return error; } @@ -1515,7 +1567,7 @@ netmap_set_ringid(struct netmap_priv_d * if (nm_rx_si_user(priv)) na->rx_si_users++; if (netmap_verbose) { - D("%s: tx [%d,%d) rx [%d,%d) id %d", + D("%s: tx [%d,%d) rx [%d,%d) id %d", NM_IFPNAME(na->ifp), priv->np_txqfirst, priv->np_txqlast, @@ -1555,10 +1607,9 @@ netmap_do_regif(struct netmap_priv_d *pr goto out; } nifp = netmap_if_new(NM_IFPNAME(ifp), na); + + /* Allocate a netmap_if and, if necessary, all the netmap_ring's */ if (nifp == NULL) { /* allocation failed */ - /* we should drop the allocator, but only - * if we were the ones who grabbed it - */ error = ENOMEM; goto out; } @@ -1568,10 +1619,8 @@ netmap_do_regif(struct netmap_priv_d *pr } else { /* Otherwise set the card in netmap mode * and make it use the shared buffers. - * - * do not core lock because the race is harmless here, - * there cannot be any traffic to netmap_transmit() */ + /* cache the allocator info in the na */ na->na_lut = na->nm_mem->pools[NETMAP_BUF_POOL].lut; ND("%p->na_lut == %p", na, na->na_lut); na->na_lut_objtotal = na->nm_mem->pools[NETMAP_BUF_POOL].objtotal; @@ -1585,6 +1634,9 @@ out: *err = error; if (error) { priv->np_na = NULL; + /* we should drop the allocator, but only + * if we were the ones who grabbed it + */ if (need_mem) netmap_drop_memory_locked(priv); } @@ -2008,6 +2060,12 @@ flush_tx: continue; /* only one thread does txsync */ if (nm_kr_tryget(kring)) { + /* either busy or stopped + * XXX if the ring is stopped, sleeping would + * be better. In current code, however, we only + * stop the rings for brief intervals (2014-03-14) + */ + if (netmap_verbose) RD(2, "%p lost race on txring %d, ok", priv, i); @@ -2049,7 +2107,7 @@ flush_tx: */ if (want_rx) { int send_down = 0; /* transparent mode */ - /* two rounds here to for race avoidance */ + /* two rounds here for race avoidance */ do_retry_rx: for (i = priv->np_rxqfirst; i < priv->np_rxqlast; i++) { int found = 0; @@ -2120,7 +2178,7 @@ do_retry_rx: * Transparent mode: marked bufs on rx rings between * kring->nr_hwcur and ring->head * are passed to the other endpoint. - * + * * In this mode we also scan the sw rxring, which in * turn passes packets up. * @@ -2139,6 +2197,7 @@ do_retry_rx: static int netmap_hw_krings_create(struct netmap_adapter *); +/* default notify callback */ static int netmap_notify(struct netmap_adapter *na, u_int n_ring, enum txrx tx, int flags) @@ -2148,11 +2207,16 @@ netmap_notify(struct netmap_adapter *na, if (tx == NR_TX) { kring = na->tx_rings + n_ring; OS_selwakeup(&kring->si, PI_NET); + /* optimization: avoid a wake up on the global + * queue if nobody has registered for more + * than one ring + */ if (na->tx_si_users > 0) OS_selwakeup(&na->tx_si, PI_NET); } else { kring = na->rx_rings + n_ring; OS_selwakeup(&kring->si, PI_NET); + /* optimization: same as above */ if (na->rx_si_users > 0) OS_selwakeup(&na->rx_si, PI_NET); } @@ -2160,7 +2224,11 @@ netmap_notify(struct netmap_adapter *na, } -// XXX check handling of failures +/* called by all routines that create netmap_adapters. + * Attach na to the ifp (if any) and provide defaults + * for optional callbacks. Defaults assume that we + * are creating an hardware netmap_adapter. + */ int netmap_attach_common(struct netmap_adapter *na) { @@ -2182,6 +2250,10 @@ netmap_attach_common(struct netmap_adapt NETMAP_SET_CAPABLE(ifp); if (na->nm_krings_create == NULL) { + /* we assume that we have been called by a driver, + * since other port types all provide their own + * nm_krings_create + */ na->nm_krings_create = netmap_hw_krings_create; na->nm_krings_delete = netmap_hw_krings_delete; } @@ -2195,10 +2267,11 @@ netmap_attach_common(struct netmap_adapt } +/* standard cleanup, called by all destructors */ void netmap_detach_common(struct netmap_adapter *na) { - if (na->ifp) + if (na->ifp != NULL) WNA(na->ifp) = NULL; /* XXX do we need this? */ if (na->tx_rings) { /* XXX should not happen */ @@ -2255,12 +2328,17 @@ netmap_attach(struct netmap_adapter *arg hwna->nm_ndo.ndo_start_xmit = linux_netmap_start_xmit; #endif /* linux */ - D("success for %s", NM_IFPNAME(ifp)); + D("success for %s tx %d/%d rx %d/%d queues/slots", + NM_IFPNAME(ifp), + hwna->up.num_tx_rings, hwna->up.num_tx_desc, + hwna->up.num_rx_rings, hwna->up.num_rx_desc + ); return 0; fail: D("fail, arg %p ifp %p na %p", arg, ifp, hwna); - netmap_detach(ifp); + if (ifp) + netmap_detach(ifp); return (hwna ? EINVAL : ENOMEM); } @@ -2294,6 +2372,7 @@ NM_DBG(netmap_adapter_put)(struct netmap return 1; } +/* nm_krings_create callback for all hardware native adapters */ int netmap_hw_krings_create(struct netmap_adapter *na) { @@ -2309,8 +2388,7 @@ netmap_hw_krings_create(struct netmap_ad /* - * Free the allocated memory linked to the given ``netmap_adapter`` - * object. + * Called on module unload by the netmap-enabled drivers */ void netmap_detach(struct ifnet *ifp) @@ -2381,7 +2459,7 @@ netmap_transmit(struct ifnet *ifp, struc * not possible on Linux). * Also avoid overflowing the queue. */ - mtx_lock(&q->lock); + mbq_lock(q); space = kring->nr_hwtail - kring->nr_hwcur; if (space < 0) @@ -2398,13 +2476,17 @@ netmap_transmit(struct ifnet *ifp, struc m = NULL; error = 0; } - mtx_unlock(&q->lock); + mbq_unlock(q); done: if (m) m_freem(m); /* unconditionally wake up listeners */ na->nm_notify(na, na->num_rx_rings, NR_RX, 0); + /* this is normally netmap_notify(), but for nics + * connected to a bridge it is netmap_bwrap_intr_notify(), + * that possibly forwards the frames through the switch + */ return (error); } Modified: stable/10/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- stable/10/sys/dev/netmap/netmap_freebsd.c Mon Jun 9 15:16:17 2014 (r267281) +++ stable/10/sys/dev/netmap/netmap_freebsd.c Mon Jun 9 15:24:45 2014 (r267282) @@ -61,7 +61,8 @@ /* ======================== FREEBSD-SPECIFIC ROUTINES ================== */ -rawsum_t nm_csum_raw(uint8_t *data, size_t len, rawsum_t cur_sum) +rawsum_t +nm_csum_raw(uint8_t *data, size_t len, rawsum_t cur_sum) { /* TODO XXX please use the FreeBSD implementation for this. */ uint16_t *words = (uint16_t *)data; @@ -80,7 +81,8 @@ rawsum_t nm_csum_raw(uint8_t *data, size /* Fold a raw checksum: 'cur_sum' is in host byte order, while the * return value is in network byte order. */ -uint16_t nm_csum_fold(rawsum_t cur_sum) +uint16_t +nm_csum_fold(rawsum_t cur_sum) { /* TODO XXX please use the FreeBSD implementation for this. */ while (cur_sum >> 16) @@ -89,7 +91,8 @@ uint16_t nm_csum_fold(rawsum_t cur_sum) return htobe16((~cur_sum) & 0xFFFF); } -uint16_t nm_csum_ipv4(struct nm_iphdr *iph) +uint16_t +nm_csum_ipv4(struct nm_iphdr *iph) { #if 0 return in_cksum_hdr((void *)iph); @@ -98,7 +101,8 @@ uint16_t nm_csum_ipv4(struct nm_iphdr *i #endif } -void nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, +void +nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, size_t datalen, uint16_t *check) { #ifdef INET @@ -120,7 +124,8 @@ void nm_csum_tcpudp_ipv4(struct nm_iphdr #endif } -void nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, +void +nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, size_t datalen, uint16_t *check) { #ifdef INET6 @@ -143,7 +148,8 @@ void nm_csum_tcpudp_ipv6(struct nm_ipv6h int netmap_catch_rx(struct netmap_adapter *na, int intercept) { - struct netmap_generic_adapter *gna = (struct netmap_generic_adapter *)na; + struct netmap_generic_adapter *gna = + (struct netmap_generic_adapter *)na; struct ifnet *ifp = na->ifp; if (intercept) { @@ -209,11 +215,29 @@ generic_xmit_frame(struct ifnet *ifp, st { int ret; - m->m_len = m->m_pkthdr.len = 0; + /* + * The mbuf should be a cluster from our special pool, + * so we do not need to do an m_copyback but just copy + * (and eventually, just reference the netmap buffer) + */ - // copy data to the mbuf - m_copyback(m, 0, len, addr); - // inc refcount. We are alone, so we can skip the atomic + if (*m->m_ext.ref_cnt != 1) { + D("invalid refcnt %d for %p", + *m->m_ext.ref_cnt, m); + panic("in generic_xmit_frame"); + } + // XXX the ext_size check is unnecessary if we link the netmap buf + if (m->m_ext.ext_size < len) { + RD(5, "size %d < len %d", m->m_ext.ext_size, len); + len = m->m_ext.ext_size; + } + if (1) { /* XXX seems to have negligible benefits */ + m->m_ext.ext_buf = m->m_data = addr; + } else { + bcopy(addr, m->m_data, len); + } + m->m_len = m->m_pkthdr.len = len; + // inc refcount. All ours, we could skip the atomic atomic_fetchadd_int(m->m_ext.ref_cnt, 1); m->m_flags |= M_FLOWID; m->m_pkthdr.flowid = ring_nr; @@ -223,6 +247,14 @@ generic_xmit_frame(struct ifnet *ifp, st } +#if __FreeBSD_version >= 1100005 +struct netmap_adapter * +netmap_getna(if_t ifp) +{ + return (NA((struct ifnet *)ifp)); +} +#endif /* __FreeBSD_version >= 1100005 */ + /* * The following two functions are empty until we have a generic * way to extract the info from the ifp @@ -230,7 +262,7 @@ generic_xmit_frame(struct ifnet *ifp, st int generic_find_num_desc(struct ifnet *ifp, unsigned int *tx, unsigned int *rx) { - D("called"); + D("called, in tx %d rx %d", *tx, *rx); return 0; } @@ -238,13 +270,14 @@ generic_find_num_desc(struct ifnet *ifp, void generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq) { - D("called"); + D("called, in txq %d rxq %d", *txq, *rxq); *txq = netmap_generic_rings; *rxq = netmap_generic_rings; } -void netmap_mitigation_init(struct nm_generic_mit *mit, struct netmap_adapter *na) +void +netmap_mitigation_init(struct nm_generic_mit *mit, struct netmap_adapter *na) { ND("called"); mit->mit_pending = 0; @@ -252,26 +285,30 @@ void netmap_mitigation_init(struct nm_ge } -void netmap_mitigation_start(struct nm_generic_mit *mit) +void +netmap_mitigation_start(struct nm_generic_mit *mit) { ND("called"); } -void netmap_mitigation_restart(struct nm_generic_mit *mit) +void +netmap_mitigation_restart(struct nm_generic_mit *mit) { ND("called"); } -int netmap_mitigation_active(struct nm_generic_mit *mit) +int +netmap_mitigation_active(struct nm_generic_mit *mit) { ND("called"); return 0; } -void netmap_mitigation_cleanup(struct nm_generic_mit *mit) +void +netmap_mitigation_cleanup(struct nm_generic_mit *mit) { ND("called"); } Modified: stable/10/sys/dev/netmap/netmap_generic.c ============================================================================== --- stable/10/sys/dev/netmap/netmap_generic.c Mon Jun 9 15:16:17 2014 (r267281) +++ stable/10/sys/dev/netmap/netmap_generic.c Mon Jun 9 15:24:45 2014 (r267282) @@ -81,20 +81,26 @@ __FBSDID("$FreeBSD$"); #include #include -#define rtnl_lock() D("rtnl_lock called"); -#define rtnl_unlock() D("rtnl_unlock called"); +#define rtnl_lock() ND("rtnl_lock called") +#define rtnl_unlock() ND("rtnl_unlock called") #define MBUF_TXQ(m) ((m)->m_pkthdr.flowid) #define MBUF_RXQ(m) ((m)->m_pkthdr.flowid) #define smp_mb() /* - * mbuf wrappers + * FreeBSD mbuf allocator/deallocator in emulation mode: + * + * We allocate EXT_PACKET mbuf+clusters, but need to set M_NOFREE + * so that the destructor, if invoked, will not free the packet. + * In principle we should set the destructor only on demand, + * but since there might be a race we better do it on allocation. + * As a consequence, we also need to set the destructor or we + * would leak buffers. */ /* - * we allocate an EXT_PACKET + * mbuf wrappers */ -#define netmap_get_mbuf(len) m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR|M_NOFREE) /* mbuf destructor, also need to change the type to EXT_EXTREF, * add an M_NOFREE flag, and then clear the flag and @@ -106,6 +112,32 @@ __FBSDID("$FreeBSD$"); (m)->m_ext.ext_type = EXT_EXTREF; \ } while (0) +static void +netmap_default_mbuf_destructor(struct mbuf *m) +{ + /* restore original mbuf */ + m->m_ext.ext_buf = m->m_data = m->m_ext.ext_arg1; + m->m_ext.ext_arg1 = NULL; + m->m_ext.ext_type = EXT_PACKET; + m->m_ext.ext_free = NULL; + if (*(m->m_ext.ref_cnt) == 0) + *(m->m_ext.ref_cnt) = 1; + uma_zfree(zone_pack, m); +} + +static inline struct mbuf * +netmap_get_mbuf(int len) +{ + struct mbuf *m; + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR | M_NOFREE); + if (m) { + m->m_ext.ext_arg1 = m->m_ext.ext_buf; // XXX save + m->m_ext.ext_free = (void *)netmap_default_mbuf_destructor; + m->m_ext.ext_type = EXT_EXTREF; + ND(5, "create m %p refcnt %d", m, *m->m_ext.ref_cnt); + } + return m; +} #define GET_MBUF_REFCNT(m) ((m)->m_ext.ref_cnt ? *(m)->m_ext.ref_cnt : -1) @@ -223,7 +255,7 @@ generic_netmap_register(struct netmap_ad #endif /* REG_RESET */ if (enable) { /* Enable netmap mode. */ - /* Init the mitigation support. */ + /* Init the mitigation support on all the rx queues. */ gna->mit = malloc(na->num_rx_rings * sizeof(struct nm_generic_mit), M_DEVBUF, M_NOWAIT | M_ZERO); if (!gna->mit) { @@ -373,15 +405,11 @@ out: static void generic_mbuf_destructor(struct mbuf *m) { - if (netmap_verbose) - D("Tx irq (%p) queue %d", m, MBUF_TXQ(m)); netmap_generic_irq(MBUF_IFP(m), MBUF_TXQ(m), NULL); #ifdef __FreeBSD__ - m->m_ext.ext_type = EXT_PACKET; - m->m_ext.ext_free = NULL; - if (*(m->m_ext.ref_cnt) == 0) - *(m->m_ext.ref_cnt) = 1; - uma_zfree(zone_pack, m); + if (netmap_verbose) + RD(5, "Tx irq (%p) queue %d index %d" , m, MBUF_TXQ(m), (int)(uintptr_t)m->m_ext.ext_arg1); + netmap_default_mbuf_destructor(m); #endif /* __FreeBSD__ */ IFRATE(rate_ctx.new.txirq++); } @@ -471,12 +499,12 @@ generic_set_tx_event(struct netmap_kring e = generic_tx_event_middle(kring, hwcur); m = kring->tx_pool[e]; + ND(5, "Request Event at %d mbuf %p refcnt %d", e, m, m ? GET_MBUF_REFCNT(m) : -2 ); if (m == NULL) { /* This can happen if there is already an event on the netmap slot 'e': There is nothing to do. */ return; } - ND("Event at %d mbuf %p refcnt %d", e, m, GET_MBUF_REFCNT(m)); kring->tx_pool[e] = NULL; SET_MBUF_DESTRUCTOR(m, generic_mbuf_destructor); @@ -770,6 +798,10 @@ generic_netmap_attach(struct ifnet *ifp) generic_find_num_desc(ifp, &num_tx_desc, &num_rx_desc); ND("Netmap ring size: TX = %d, RX = %d", num_tx_desc, num_rx_desc); + if (num_tx_desc == 0 || num_rx_desc == 0) { + D("Device has no hw slots (tx %u, rx %u)", num_tx_desc, num_rx_desc); + return EINVAL; + } gna = malloc(sizeof(*gna), M_DEVBUF, M_NOWAIT | M_ZERO); if (gna == NULL) { Modified: stable/10/sys/dev/netmap/netmap_kern.h ============================================================================== --- stable/10/sys/dev/netmap/netmap_kern.h Mon Jun 9 15:16:17 2014 (r267281) +++ stable/10/sys/dev/netmap/netmap_kern.h Mon Jun 9 15:24:45 2014 (r267282) @@ -62,6 +62,9 @@ #define NM_ATOMIC_TEST_AND_SET(p) (!atomic_cmpset_acq_int((p), 0, 1)) #define NM_ATOMIC_CLEAR(p) atomic_store_rel_int((p), 0) +#if __FreeBSD_version >= 1100005 +struct netmap_adapter *netmap_getna(if_t ifp); +#endif MALLOC_DECLARE(M_NETMAP); @@ -183,9 +186,6 @@ extern NMG_LOCK_T netmap_global_lock; * the next empty buffer as known by the hardware (next_to_check or so). * TX rings: hwcur + hwofs coincides with next_to_send * - * Clients cannot issue concurrent syscall on a ring. The system - * detects this and reports an error using two flags, - * NKR_WBUSY and NKR_RBUSY * For received packets, slot->flags is set to nkr_slot_flags * so we can provide a proper initial value (e.g. set NS_FORWARD * when operating in 'transparent' mode). @@ -208,7 +208,7 @@ extern NMG_LOCK_T netmap_global_lock; * The kring is manipulated by txsync/rxsync and generic netmap function. * * Concurrent rxsync or txsync on the same ring are prevented through - * by nm_kr_lock() which in turn uses nr_busy. This is all we need + * by nm_kr_(try)lock() which in turn uses nr_busy. This is all we need * for NIC rings, and for TX rings attached to the host stack. * * RX rings attached to the host stack use an mbq (rx_queue) on both @@ -440,15 +440,18 @@ struct netmap_adapter { /* * nm_dtor() is the cleanup routine called when destroying * the adapter. + * Called with NMG_LOCK held. * * nm_register() is called on NIOCREGIF and close() to enter * or exit netmap mode on the NIC + * Called with NMG_LOCK held. * * nm_txsync() pushes packets to the underlying hw/switch * * nm_rxsync() collects packets from the underlying hw/switch * * nm_config() returns configuration information from the OS + * Called with NMG_LOCK held. * * nm_krings_create() create and init the krings array * (the array layout must conform to the description @@ -456,13 +459,12 @@ struct netmap_adapter { * * nm_krings_delete() cleanup and delete the kring array * - * nm_notify() is used to act after data have become available. + * nm_notify() is used to act after data have become available + * (or the stopped state of the ring has changed) * For hw devices this is typically a selwakeup(), * but for NIC/host ports attached to a switch (or vice-versa) * we also need to invoke the 'txsync' code downstream. */ - - /* private cleanup */ void (*nm_dtor)(struct netmap_adapter *); int (*nm_register)(struct netmap_adapter *, int onoff); @@ -678,7 +680,7 @@ static inline uint32_t nm_kr_rxspace(struct netmap_kring *k) { int space = k->nr_hwtail - k->nr_hwcur; - if (space < 0) + if (space < 0) space += k->nkr_num_slots; ND("preserving %d rx slots %d -> %d", space, k->nr_hwcur, k->nr_hwtail); @@ -827,7 +829,7 @@ nm_txsync_finalize(struct netmap_kring * { /* update ring tail to what the kernel knows */ kring->ring->tail = kring->rtail = kring->nr_hwtail; - + /* note, head/rhead/hwcur might be behind cur/rcur * if no carrier */ @@ -1376,5 +1378,4 @@ void bdg_mismatch_datapath(struct netmap struct netmap_vp_adapter *dst_na, struct nm_bdg_fwd *ft_p, struct netmap_ring *ring, u_int *j, u_int lim, u_int *howmany); - #endif /* _NET_NETMAP_KERN_H_ */ Modified: stable/10/sys/dev/netmap/netmap_mbq.c ============================================================================== --- stable/10/sys/dev/netmap/netmap_mbq.c Mon Jun 9 15:16:17 2014 (r267281) +++ stable/10/sys/dev/netmap/netmap_mbq.c Mon Jun 9 15:24:45 2014 (r267282) @@ -76,9 +76,9 @@ static inline void __mbq_enqueue(struct void mbq_safe_enqueue(struct mbq *q, struct mbuf *m) { - mtx_lock(&q->lock); + mbq_lock(q); __mbq_enqueue(q, m); - mtx_unlock(&q->lock); + mbq_unlock(q); } @@ -110,9 +110,9 @@ struct mbuf *mbq_safe_dequeue(struct mbq { struct mbuf *ret; - mtx_lock(&q->lock); + mbq_lock(q); ret = __mbq_dequeue(q); - mtx_unlock(&q->lock); + mbq_unlock(q); return ret; } Modified: stable/10/sys/dev/netmap/netmap_mbq.h ============================================================================== --- stable/10/sys/dev/netmap/netmap_mbq.h Mon Jun 9 15:16:17 2014 (r267281) +++ stable/10/sys/dev/netmap/netmap_mbq.h Mon Jun 9 15:24:45 2014 (r267282) @@ -62,7 +62,17 @@ void mbq_enqueue(struct mbq *q, struct m struct mbuf *mbq_dequeue(struct mbq *q); void mbq_purge(struct mbq *q); -/* XXX missing mbq_lock() and mbq_unlock */ +static inline void +mbq_lock(struct mbq *q) +{ + mtx_lock_spin(&q->lock); +} + +static inline void +mbq_unlock(struct mbq *q) +{ + mtx_unlock_spin(&q->lock); +} void mbq_safe_init(struct mbq *q); void mbq_safe_destroy(struct mbq *q); Modified: stable/10/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/10/sys/dev/netmap/netmap_mem2.c Mon Jun 9 15:16:17 2014 (r267281) +++ stable/10/sys/dev/netmap/netmap_mem2.c Mon Jun 9 15:24:45 2014 (r267282) @@ -992,7 +992,7 @@ netmap_mem_private_new(const char *name, if (p[NETMAP_RING_POOL].num < v) p[NETMAP_RING_POOL].num = v; /* for each pipe we only need the buffers for the 4 "real" rings. - * On the other end, the pipe ring dimension may be different from + * On the other end, the pipe ring dimension may be different from * the parent port ring dimension. As a compromise, we allocate twice the * space actually needed if the pipe rings were the same size as the parent rings */ Modified: stable/10/sys/dev/netmap/netmap_pipe.c ============================================================================== --- stable/10/sys/dev/netmap/netmap_pipe.c Mon Jun 9 15:16:17 2014 (r267281) +++ stable/10/sys/dev/netmap/netmap_pipe.c Mon Jun 9 15:24:45 2014 (r267282) @@ -391,7 +391,7 @@ err: /* netmap_pipe_reg. * * There are two cases on registration (onoff==1) - * + * * 1.a) state is * * usr1 --> e1 --> e2 @@ -403,7 +403,7 @@ err: * usr1 --> e1 --> e2 <-- usr2 * * and we are e2. Drop the ref e1 is holding. - * + * * There are two additional cases on unregister (onoff==0) * * 2.a) state is @@ -462,14 +462,14 @@ netmap_pipe_reg(struct netmap_adapter *n * * 1) state is * - * usr1 --> e1 --> e2 + * usr1 --> e1 --> e2 * - * and we are e1 (e2 is not registered, so krings_delete cannot be + * and we are e1 (e2 is not registered, so krings_delete cannot be * called on it); * * 2) state is * - * usr1 --> e1 e2 <-- usr2 + * usr1 --> e1 e2 <-- usr2 * * and we are either e1 or e2. * @@ -519,7 +519,7 @@ netmap_pipe_dtor(struct netmap_adapter * pna->peer_ref = 0; netmap_adapter_put(&pna->peer->up); } - if (pna->role == NR_REG_PIPE_MASTER) + if (pna->role == NR_REG_PIPE_MASTER) netmap_pipe_remove(pna->parent, pna); netmap_adapter_put(pna->parent); free(na->ifp, M_DEVBUF); @@ -587,7 +587,7 @@ netmap_get_pipe_na(struct nmreq *nmr, st error = ENODEV; goto put_out; } - /* we create both master and slave. + /* we create both master and slave. * The endpoint we were asked for holds a reference to * the other one. */ Modified: stable/10/sys/dev/netmap/netmap_vale.c ============================================================================== --- stable/10/sys/dev/netmap/netmap_vale.c Mon Jun 9 15:16:17 2014 (r267281) +++ stable/10/sys/dev/netmap/netmap_vale.c Mon Jun 9 15:24:45 2014 (r267282) @@ -959,6 +959,14 @@ nm_bdg_preflush(struct netmap_vp_adapter ft[ft_i].ft_next = NM_FT_NULL; buf = ft[ft_i].ft_buf = (slot->flags & NS_INDIRECT) ? (void *)(uintptr_t)slot->ptr : BDG_NMB(&na->up, slot); + if (unlikely(buf == NULL)) { + RD(5, "NULL %s buffer pointer from %s slot %d len %d", + (slot->flags & NS_INDIRECT) ? "INDIRECT" : "DIRECT", + kring->name, j, ft[ft_i].ft_len); + buf = ft[ft_i].ft_buf = NMB_VA(0); /* the 'null' buffer */ + ft[ft_i].ft_len = 0; + ft[ft_i].ft_flags = 0; + } __builtin_prefetch(buf); ++ft_i; if (slot->flags & NS_MOREFRAG) { @@ -1064,7 +1072,7 @@ netmap_bdg_learning(char *buf, u_int buf uint64_t smac, dmac; if (buf_len < 14) { - D("invalid buf length %d", buf_len); + RD(5, "invalid buf length %d", buf_len); return NM_BDG_NOPORT; } dmac = le64toh(*(uint64_t *)(buf)) & 0xffffffffffff; @@ -1312,6 +1320,7 @@ nm_bdg_flush(struct nm_bdg_fwd *ft, u_in needed = d->bq_len + brddst->bq_len; if (unlikely(dst_na->virt_hdr_len != na->virt_hdr_len)) { + RD(3, "virt_hdr_mismatch, src %d len %d", na->virt_hdr_len, dst_na->virt_hdr_len); /* There is a virtio-net header/offloadings mismatch between * source and destination. The slower mismatch datapath will * be used to cope with all the mismatches. @@ -1412,6 +1421,11 @@ retry: /* round to a multiple of 64 */ copy_len = (copy_len + 63) & ~63; + if (unlikely(copy_len > NETMAP_BUF_SIZE || + copy_len > NETMAP_BUF_SIZE)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 20:54:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4C2126CC; Mon, 9 Jun 2014 20:54: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 384A221B7; Mon, 9 Jun 2014 20:54: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 s59KsOBd029365; Mon, 9 Jun 2014 20:54:24 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59KsO6b029364; Mon, 9 Jun 2014 20:54:24 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406092054.s59KsO6b029364@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Jun 2014 20:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267303 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 20:54:24 -0000 Author: gjb Date: Mon Jun 9 20:54:23 2014 New Revision: 267303 URL: http://svnweb.freebsd.org/changeset/base/267303 Log: Document r267258, OpenSSL update to 1.0.1h. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jun 9 20:52:42 2014 (r267302) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jun 9 20:54:23 2014 (r267303) @@ -269,6 +269,8 @@ Sendmail has been updated to 8.14.9. + OpenSSL has + been updated to version 1.0.1h. From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 9 23:11:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 388CDF90; Mon, 9 Jun 2014 23:11: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 250A82CD2; Mon, 9 Jun 2014 23:11: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 s59NBpb0093842; Mon, 9 Jun 2014 23:11:51 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59NBo8I093840; Mon, 9 Jun 2014 23:11:50 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201406092311.s59NBo8I093840@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 9 Jun 2014 23:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267309 - in stable/10/share/man: man5 man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 23:11:51 -0000 Author: bjk (doc committer) Date: Mon Jun 9 23:11:50 2014 New Revision: 267309 URL: http://svnweb.freebsd.org/changeset/base/267309 Log: MFC r266416: ------------------------------------------------------------------------ r266416 | bjk | 2014-05-18 17:05:54 -0400 (Sun, 18 May 2014) | 14 lines Document some user-settable make variables in ports.7 This is not a comprehensive list, as the variables themselves are spread out over multiple files, but it is a start. Add a section to make.conf noting that variables may be set there that affect ports builds, but refer to ports.7 and elsewhere for the actual listing; any listing in make.conf.5 would likely become out of date fairly quickly. PR: docs/189199 Reviewed by: bdrewery (previous version) Approved by: hrs (mentor) ------------------------------------------------------------------------ PR: 189199 Approved by: hrs (mentor) Modified: stable/10/share/man/man5/make.conf.5 stable/10/share/man/man7/ports.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man5/make.conf.5 ============================================================================== --- stable/10/share/man/man5/make.conf.5 Mon Jun 9 22:09:03 2014 (r267308) +++ stable/10/share/man/man5/make.conf.5 Mon Jun 9 23:11:50 2014 (r267309) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 2014 +.Dd May 17, 2014 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -655,6 +655,14 @@ for simple printers, or for postscript or graphics printers with a ghostscript filter, or both. .El +.Ss "BUILDING PORTS" +Several make variables can be set that affect the building of ports. +These variables and their effects are documented in +.Xr ports 7 , +.Pa ${PORTSDIR}/Mk/* +and the +.Fx +Porter's Handbook. .Sh FILES .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact .It Pa /etc/make.conf Modified: stable/10/share/man/man7/ports.7 ============================================================================== --- stable/10/share/man/man7/ports.7 Mon Jun 9 22:09:03 2014 (r267308) +++ stable/10/share/man/man7/ports.7 Mon Jun 9 23:11:50 2014 (r267309) @@ -486,6 +486,44 @@ have been configured will have a uniquel single file .Pa options . .El +.Sh MAKE VARIABLES +The following list provides a name and short description for many of the +variables that are used when building ports. +More information on these and other related variables may be found in +.Pa ${PORTSDIR}/Mk/* +and the +.Fx +Porter's Handbook. +.Bl -tag -width ".Va OVERRIDE_LINUX_BASE_PORT" +.It Va WITH_OPENSSL_PORT +.Pq Vt bool +If set, causes ports that make use of OpenSSL to use the OpenSSL from +ports +.Pq if available +instead of the OpenSSL from the base system. +.It Va WITH_DEBUG +.Pq Vt bool +If set, debugging symbols are installed for ports binaries. +.It Va WITH_DEBUG_PORTS +A list of origins for which to set +.Va WITH_DEBUG_PORTS . +.It Va WITH_SSP_PORTS +.Pq Vt bool +If set, enables +.Fl fstack-protector +for most ports. +.It Va WITH_GHOSTSCRIPT_VER +If set, the version of ghostscript to be used by ports. +.It Va OVERRIDE_LINUX_BASE_PORT +The default linux base to use. +.It Va WITH_CCACHE_BUILD +.Pq Vt bool +If set, enables the use of +.Xr ccache 1 +for building ports. +.It Va CCACHE_DIR +Which directory to use for the ccache data. +.El .Sh FILES .Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact .It Pa /usr/ports @@ -495,6 +533,7 @@ The big Kahuna. .El .Sh SEE ALSO .Xr make 1 , +.Xr make.conf 5 , .Xr pkg 8 , .Xr portsnap 8 .Pp From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 10 03:23:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3858CD60; Tue, 10 Jun 2014 03:23: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 22F0620A5; Tue, 10 Jun 2014 03:23: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 s5A3Na66012534; Tue, 10 Jun 2014 03:23:36 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A3NZlM012525; Tue, 10 Jun 2014 03:23:35 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201406100323.s5A3NZlM012525@svn.freebsd.org> From: Bryan Venteicher Date: Tue, 10 Jun 2014 03:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267312 - in stable/10/sys/dev/virtio: . pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 03:23:37 -0000 Author: bryanv Date: Tue Jun 10 03:23:35 2014 New Revision: 267312 URL: http://svnweb.freebsd.org/changeset/base/267312 Log: MFC r266951: Split the virtio.h header file into multiple files Reorganize the previous contexts of the file as it is in Linux. The eventual goal is to install the header files and share them between the kernel and bhyve. Added: stable/10/sys/dev/virtio/virtio_config.h - copied unchanged from r266951, head/sys/dev/virtio/virtio_config.h stable/10/sys/dev/virtio/virtio_ids.h - copied unchanged from r266951, head/sys/dev/virtio/virtio_ids.h Modified: stable/10/sys/dev/virtio/pci/virtio_pci.c stable/10/sys/dev/virtio/virtio.c stable/10/sys/dev/virtio/virtio.h stable/10/sys/dev/virtio/virtqueue.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- stable/10/sys/dev/virtio/pci/virtio_pci.c Tue Jun 10 01:38:02 2014 (r267311) +++ stable/10/sys/dev/virtio/pci/virtio_pci.c Tue Jun 10 03:23:35 2014 (r267312) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: stable/10/sys/dev/virtio/virtio.c ============================================================================== --- stable/10/sys/dev/virtio/virtio.c Tue Jun 10 01:38:02 2014 (r267311) +++ stable/10/sys/dev/virtio/virtio.c Tue Jun 10 03:23:35 2014 (r267312) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "virtio_bus_if.h" Modified: stable/10/sys/dev/virtio/virtio.h ============================================================================== --- stable/10/sys/dev/virtio/virtio.h Tue Jun 10 01:38:02 2014 (r267311) +++ stable/10/sys/dev/virtio/virtio.h Tue Jun 10 03:23:35 2014 (r267312) @@ -1,29 +1,27 @@ /*- - * This header is BSD licensed so anyone can use the definitions to implement - * compatible drivers/servers. + * Copyright (c) 2014, Bryan Venteicher + * 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. + * notice unmodified, this list of conditions, and the following + * disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of IBM nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD$ */ @@ -31,44 +29,9 @@ #ifndef _VIRTIO_H_ #define _VIRTIO_H_ -struct vq_alloc_info; - -/* VirtIO device IDs. */ -#define VIRTIO_ID_NETWORK 0x01 -#define VIRTIO_ID_BLOCK 0x02 -#define VIRTIO_ID_CONSOLE 0x03 -#define VIRTIO_ID_ENTROPY 0x04 -#define VIRTIO_ID_BALLOON 0x05 -#define VIRTIO_ID_IOMEMORY 0x06 -#define VIRTIO_ID_SCSI 0x08 -#define VIRTIO_ID_9P 0x09 - -/* Status byte for guest to report progress. */ -#define VIRTIO_CONFIG_STATUS_RESET 0x00 -#define VIRTIO_CONFIG_STATUS_ACK 0x01 -#define VIRTIO_CONFIG_STATUS_DRIVER 0x02 -#define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04 -#define VIRTIO_CONFIG_STATUS_FAILED 0x80 - -/* - * Generate interrupt when the virtqueue ring is - * completely used, even if we've suppressed them. - */ -#define VIRTIO_F_NOTIFY_ON_EMPTY (1 << 24) - -/* - * The guest should never negotiate this feature; it - * is used to detect faulty drivers. - */ -#define VIRTIO_F_BAD_FEATURE (1 << 30) +#include -/* - * Some VirtIO feature bits (currently bits 28 through 31) are - * reserved for the transport being used (eg. virtio_ring), the - * rest are per-device feature bits. - */ -#define VIRTIO_TRANSPORT_F_START 28 -#define VIRTIO_TRANSPORT_F_END 32 +struct vq_alloc_info; /* * Each virtqueue indirect descriptor list must be physically contiguous. Copied: stable/10/sys/dev/virtio/virtio_config.h (from r266951, head/sys/dev/virtio/virtio_config.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/virtio/virtio_config.h Tue Jun 10 03:23:35 2014 (r267312, copy of r266951, head/sys/dev/virtio/virtio_config.h) @@ -0,0 +1,61 @@ +/*- + * This header is BSD licensed so anyone can use the definitions to implement + * compatible drivers/servers. + * + * 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. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VIRTIO_CONFIG_H_ +#define _VIRTIO_CONFIG_H_ + +/* Status byte for guest to report progress. */ +#define VIRTIO_CONFIG_STATUS_RESET 0x00 +#define VIRTIO_CONFIG_STATUS_ACK 0x01 +#define VIRTIO_CONFIG_STATUS_DRIVER 0x03 +#define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04 +#define VIRTIO_CONFIG_STATUS_FAILED 0x80 + +/* + * Generate interrupt when the virtqueue ring is + * completely used, even if we've suppressed them. + */ +#define VIRTIO_F_NOTIFY_ON_EMPTY (1 << 24) + +/* + * The guest should never negotiate this feature; it + * is used to detect faulty drivers. + */ +#define VIRTIO_F_BAD_FEATURE (1 << 30) + +/* + * Some VirtIO feature bits (currently bits 28 through 31) are + * reserved for the transport being used (eg. virtio_ring), the + * rest are per-device feature bits. + */ +#define VIRTIO_TRANSPORT_F_START 28 +#define VIRTIO_TRANSPORT_F_END 32 + +#endif /* _VIRTIO_CONFIG_H_ */ Copied: stable/10/sys/dev/virtio/virtio_ids.h (from r266951, head/sys/dev/virtio/virtio_ids.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/virtio/virtio_ids.h Tue Jun 10 03:23:35 2014 (r267312, copy of r266951, head/sys/dev/virtio/virtio_ids.h) @@ -0,0 +1,44 @@ +/*- + * This header is BSD licensed so anyone can use the definitions to implement + * compatible drivers/servers. + * + * 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. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VIRTIO_IDS_H_ +#define _VIRTIO_IDS_H_ + +/* VirtIO device IDs. */ +#define VIRTIO_ID_NETWORK 0x01 +#define VIRTIO_ID_BLOCK 0x02 +#define VIRTIO_ID_CONSOLE 0x03 +#define VIRTIO_ID_ENTROPY 0x04 +#define VIRTIO_ID_BALLOON 0x05 +#define VIRTIO_ID_IOMEMORY 0x06 +#define VIRTIO_ID_SCSI 0x08 +#define VIRTIO_ID_9P 0x09 + +#endif /* _VIRTIO_IDS_H_ */ Modified: stable/10/sys/dev/virtio/virtqueue.c ============================================================================== --- stable/10/sys/dev/virtio/virtqueue.c Tue Jun 10 01:38:02 2014 (r267311) +++ stable/10/sys/dev/virtio/virtqueue.c Tue Jun 10 03:23:35 2014 (r267312) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 10 04:44:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 365BB268; Tue, 10 Jun 2014 04:44: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 22F9626A3; Tue, 10 Jun 2014 04:44: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 s5A4iTc8050740; Tue, 10 Jun 2014 04:44:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A4iSek050739; Tue, 10 Jun 2014 04:44:28 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406100444.s5A4iSek050739@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 10 Jun 2014 04:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267315 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 04:44:29 -0000 Author: hselasky Date: Tue Jun 10 04:44:28 2014 New Revision: 267315 URL: http://svnweb.freebsd.org/changeset/base/267315 Log: MFC r267212: Make WITNESS happy by giving USB mutexes different names. Modified: stable/10/sys/dev/usb/controller/usb_controller.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/10/sys/dev/usb/controller/usb_controller.c Tue Jun 10 04:28:57 2014 (r267314) +++ stable/10/sys/dev/usb/controller/usb_controller.c Tue Jun 10 04:44:28 2014 (r267315) @@ -898,10 +898,10 @@ usb_bus_mem_alloc_all(struct usb_bus *bu bus->alloc_failed = 0; mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent), - NULL, MTX_DEF | MTX_RECURSE); + "usb_def_mtx", MTX_DEF | MTX_RECURSE); mtx_init(&bus->bus_spin_lock, device_get_nameunit(bus->parent), - NULL, MTX_SPIN | MTX_RECURSE); + "usb_spin_mtx", MTX_SPIN | MTX_RECURSE); usb_callout_init_mtx(&bus->power_wdog, &bus->bus_mtx, 0); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 10 17:17:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2E406C30; Tue, 10 Jun 2014 17:17: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 01CC52CD3; Tue, 10 Jun 2014 17:17: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 s5AHHiXx012909; Tue, 10 Jun 2014 17:17:44 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AHHiAR012908; Tue, 10 Jun 2014 17:17:44 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406101717.s5AHHiAR012908@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 10 Jun 2014 17:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267333 - stable/10/sys/dev/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 17:17:45 -0000 Author: luigi Date: Tue Jun 10 17:17:44 2014 New Revision: 267333 URL: http://svnweb.freebsd.org/changeset/base/267333 Log: MFC 267328: change the netmap mbuf destructor so the same code works also on FreeBSD 9. For head and 10 this change has no effect, but on stable/9 it would cause panics when using emulated netmap on top of a standard device driver. MFC after: 3 days Modified: stable/10/sys/dev/netmap/netmap_generic.c Modified: stable/10/sys/dev/netmap/netmap_generic.c ============================================================================== --- stable/10/sys/dev/netmap/netmap_generic.c Tue Jun 10 17:05:41 2014 (r267332) +++ stable/10/sys/dev/netmap/netmap_generic.c Tue Jun 10 17:17:44 2014 (r267333) @@ -102,24 +102,30 @@ __FBSDID("$FreeBSD$"); * mbuf wrappers */ -/* mbuf destructor, also need to change the type to EXT_EXTREF, +/* + * mbuf destructor, also need to change the type to EXT_EXTREF, * add an M_NOFREE flag, and then clear the flag and * chain into uma_zfree(zone_pack, mf) * (or reinstall the buffer ?) + * + * On FreeBSD 9 the destructor is called as ext_free(ext_arg1, ext_arg2) + * whereas newer version have ext_free(m, ext_arg1, ext_arg2) + * For compatibility we set ext_arg1 = m on allocation so we have + * the same code on both. */ #define SET_MBUF_DESTRUCTOR(m, fn) do { \ - (m)->m_ext.ext_free = (void *)fn; \ - (m)->m_ext.ext_type = EXT_EXTREF; \ -} while (0) + (m)->m_ext.ext_free = (void *)fn; \ + (m)->m_ext.ext_type = EXT_EXTREF; \ + } while (0) static void -netmap_default_mbuf_destructor(struct mbuf *m) +netmap_default_mbuf_destructor(struct mbuf *m) { - /* restore original mbuf */ - m->m_ext.ext_buf = m->m_data = m->m_ext.ext_arg1; - m->m_ext.ext_arg1 = NULL; + /* restore original data pointer and type */ + m->m_ext.ext_buf = m->m_data = m->m_ext.ext_arg2; m->m_ext.ext_type = EXT_PACKET; m->m_ext.ext_free = NULL; + m->m_ext.ext_arg1 = m->m_ext.ext_arg2 = NULL; if (*(m->m_ext.ref_cnt) == 0) *(m->m_ext.ref_cnt) = 1; uma_zfree(zone_pack, m); @@ -131,7 +137,8 @@ netmap_get_mbuf(int len) struct mbuf *m; m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR | M_NOFREE); if (m) { - m->m_ext.ext_arg1 = m->m_ext.ext_buf; // XXX save + m->m_ext.ext_arg1 = m; /* FreeBSD 9 compat */ + m->m_ext.ext_arg2 = m->m_ext.ext_buf; /* save original */ m->m_ext.ext_free = (void *)netmap_default_mbuf_destructor; m->m_ext.ext_type = EXT_EXTREF; ND(5, "create m %p refcnt %d", m, *m->m_ext.ref_cnt); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 10 17:24:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 63F2826C; Tue, 10 Jun 2014 17:24: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 44D932DA0; Tue, 10 Jun 2014 17:24: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 s5AHOlfL017270; Tue, 10 Jun 2014 17:24:47 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AHOlmQ017269; Tue, 10 Jun 2014 17:24:47 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406101724.s5AHOlmQ017269@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 10 Jun 2014 17:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267334 - stable/10/sys/dev/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 17:24:47 -0000 Author: luigi Date: Tue Jun 10 17:24:46 2014 New Revision: 267334 URL: http://svnweb.freebsd.org/changeset/base/267334 Log: MFC 267284 Fixes from Fanco Ficthner on transparent mode * The way rings are updated changed with the last API bump. Also sync ->head when moving slots in netmap_sw_to_nic(). * Remove a crashing selrecord() call. * Unclog the logic surrounding netmap_rxsync_from_host(). * Add timestamping to RX host ring. * Remove a couple of obsolete comments. Submitted by: Franco Fichtner MFC after: 3 days Sponsored by: Packetwerk Modified: stable/10/sys/dev/netmap/netmap.c Modified: stable/10/sys/dev/netmap/netmap.c ============================================================================== --- stable/10/sys/dev/netmap/netmap.c Tue Jun 10 17:17:44 2014 (r267333) +++ stable/10/sys/dev/netmap/netmap.c Tue Jun 10 17:24:46 2014 (r267334) @@ -981,7 +981,7 @@ netmap_sw_to_nic(struct netmap_adapter * dst->len = tmp.len; dst->flags = NS_BUF_CHANGED; - rdst->cur = nm_next(dst_cur, dst_lim); + rdst->head = rdst->cur = nm_next(dst_cur, dst_lim); } /* if (sent) XXX txsync ? */ } @@ -1028,11 +1028,6 @@ netmap_txsync_to_host(struct netmap_adap * They have been put in kring->rx_queue by netmap_transmit(). * We protect access to the kring using kring->rx_queue.lock * - * This routine also does the selrecord if called from the poll handler - * (we know because td != NULL). - * - * NOTE: on linux, selrecord() is defined as a macro and uses pwait - * as an additional hidden argument. * returns the number of packets delivered to tx queues in * transparent mode, or a negative value if error */ @@ -1088,10 +1083,6 @@ netmap_rxsync_from_host(struct netmap_ad nm_rxsync_finalize(kring); - /* access copies of cur,tail in the kring */ - if (kring->rcur == kring->rtail && td) /* no bufs available */ - selrecord(td, &kring->si); - mbq_unlock(q); return ret; } @@ -2124,8 +2115,6 @@ do_retry_rx: /* * transparent mode support: collect packets * from the rxring(s). - * XXX NR_FORWARD should only be read on - * physical or NIC ports */ if (netmap_fwd ||kring->ring->flags & NR_FORWARD) { ND(10, "forwarding some buffers up %d to %d", @@ -2152,13 +2141,12 @@ do_retry_rx: /* transparent mode XXX only during first pass ? */ if (na->na_flags & NAF_HOST_RINGS) { kring = &na->rx_rings[na->num_rx_rings]; - if (check_all_rx - && (netmap_fwd || kring->ring->flags & NR_FORWARD)) { - /* XXX fix to use kring fields */ - if (nm_ring_empty(kring->ring)) - send_down = netmap_rxsync_from_host(na, td, dev); - if (!nm_ring_empty(kring->ring)) - revents |= want_rx; + if (netmap_fwd || kring->ring->flags & NR_FORWARD) { + send_down = netmap_rxsync_from_host(na, td, dev); + if (send_down && (netmap_no_timestamp == 0 || + kring->ring->flags & NR_TIMESTAMP)) { + microtime(&kring->ring->ts); + } } } From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 10 19:00:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BBA0B820; Tue, 10 Jun 2014 19:00: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 9C7F027E0; Tue, 10 Jun 2014 19:00: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 s5AJ0EKs060232; Tue, 10 Jun 2014 19:00:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AJ0EgH060231; Tue, 10 Jun 2014 19:00:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406101900.s5AJ0EgH060231@svn.freebsd.org> From: John Baldwin Date: Tue, 10 Jun 2014 19:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267339 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 19:00:14 -0000 Author: jhb Date: Tue Jun 10 19:00:14 2014 New Revision: 267339 URL: http://svnweb.freebsd.org/changeset/base/267339 Log: MFC 261000,261785,263238,263322,264302: Various AHCI fixes: - Fix issue with stale fields from a recycled request pulled off the freelist. - Provide an indication a "PIO Setup Device to Host FIS" occurred while executing the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands. - Provide an indication a "D2H Register FIS" occurred during a SET FEATURES command. - Though there currently isn't a way to insert new media into an ATAPI drive, at least pretend to support Asynchronous Notification (AN) to avoid a guest needlessly polling for it. - Don't reissue in-flight commands. - Constrain the amount of data returned to what is actually available not the size of the buffer. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Tue Jun 10 18:46:00 2014 (r267338) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Tue Jun 10 19:00:14 2014 (r267339) @@ -95,6 +95,13 @@ enum sata_fis_type { #define MODEPAGE_CD_CAPABILITIES 0x2A /* + * ATA commands + */ +#define ATA_SF_ENAB_SATA_SF 0x10 +#define ATA_SATA_SF_AN 0x05 +#define ATA_SF_DIS_SATA_SF 0x90 + +/* * Debug printf */ #ifdef AHCI_DEBUG @@ -127,6 +134,7 @@ struct ahci_port { uint8_t xfermode; uint8_t sense_key; uint8_t asc; + uint32_t pending; uint32_t clb; uint32_t clbu; @@ -254,6 +262,16 @@ ahci_write_fis(struct ahci_port *p, enum } static void +ahci_write_fis_piosetup(struct ahci_port *p) +{ + uint8_t fis[20]; + + memset(fis, 0, sizeof(fis)); + fis[0] = FIS_TYPE_PIOSETUP; + ahci_write_fis(p, FIS_TYPE_PIOSETUP, fis); +} + +static void ahci_write_fis_sdb(struct ahci_port *p, int slot, uint32_t tfd) { uint8_t fis[8]; @@ -454,6 +472,10 @@ ahci_handle_dma(struct ahci_port *p, int if (iovcnt > BLOCKIF_IOV_MAX) { aior->prdtl = iovcnt - BLOCKIF_IOV_MAX; iovcnt = BLOCKIF_IOV_MAX; + /* + * Mark this command in-flight. + */ + p->pending |= 1 << slot; } else aior->prdtl = 0; breq->br_iovcnt = iovcnt; @@ -477,7 +499,7 @@ ahci_handle_dma(struct ahci_port *p, int err = blockif_write(p->bctx, breq); assert(err == 0); - if (!aior->prdtl && ncq) + if (ncq) p->ci &= ~(1 << slot); } @@ -497,6 +519,8 @@ ahci_handle_flush(struct ahci_port *p, i aior->cfis = cfis; aior->slot = slot; aior->len = 0; + aior->done = 0; + aior->prdtl = 0; breq = &aior->io_req; err = blockif_flush(p->bctx, breq); @@ -519,12 +543,14 @@ write_prdt(struct ahci_port *p, int slot for (i = 0; i < hdr->prdtl && len; i++) { uint8_t *ptr; uint32_t dbcsz; + int sublen; dbcsz = (prdt->dbc & DBCMASK) + 1; ptr = paddr_guest2host(ahci_ctx(p->pr_sc), prdt->dba, dbcsz); - memcpy(ptr, from, dbcsz); - len -= dbcsz; - from += dbcsz; + sublen = len < dbcsz ? len : dbcsz; + memcpy(ptr, from, sublen); + len -= sublen; + from += sublen; prdt++; } hdr->prdbc = size - len; @@ -585,6 +611,7 @@ handle_identify(struct ahci_port *p, int buf[101] = (sectors >> 16); buf[102] = (sectors >> 32); buf[103] = (sectors >> 48); + ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); p->tfd = ATA_S_DSC | ATA_S_READY; p->is |= AHCI_P_IX_DP; @@ -627,6 +654,7 @@ handle_atapi_identify(struct ahci_port * buf[85] = (1 << 4); buf[87] = (1 << 14); buf[88] = (1 << 14 | 0x7f); + ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); p->tfd = ATA_S_DSC | ATA_S_READY; p->is |= AHCI_P_IX_DHR; @@ -1155,6 +1183,17 @@ ahci_handle_cmd(struct ahci_port *p, int case ATA_SETFEATURES: { switch (cfis[3]) { + case ATA_SF_ENAB_SATA_SF: + switch (cfis[12]) { + case ATA_SATA_SF_AN: + p->tfd = ATA_S_DSC | ATA_S_READY; + break; + default: + p->tfd = ATA_S_ERROR | ATA_S_READY; + p->tfd |= (ATA_ERROR_ABORT << 8); + break; + } + break; case ATA_SF_ENAB_WCACHE: case ATA_SF_DIS_WCACHE: case ATA_SF_ENAB_RCACHE: @@ -1180,9 +1219,7 @@ ahci_handle_cmd(struct ahci_port *p, int p->tfd |= (ATA_ERROR_ABORT << 8); break; } - p->is |= AHCI_P_IX_DP; - p->ci &= ~(1 << slot); - ahci_generate_intr(p->pr_sc); + ahci_write_fis_d2h(p, slot, cfis, p->tfd); break; } case ATA_SET_MULTI: @@ -1297,8 +1334,12 @@ ahci_handle_port(struct ahci_port *p) if (!(p->cmd & AHCI_P_CMD_ST)) return; + /* + * Search for any new commands to issue ignoring those that + * are already in-flight. + */ for (i = 0; (i < 32) && p->ci; i++) { - if (p->ci & (1 << i)) + if ((p->ci & (1 << i)) && !(p->pending & (1 << i))) ahci_handle_slot(p, i); } } @@ -1359,6 +1400,11 @@ ata_ioreq_cb(struct blockif_req *br, int p->serr |= (1 << slot); } + /* + * This command is now complete. + */ + p->pending &= ~(1 << slot); + if (ncq) { p->sact &= ~(1 << slot); ahci_write_fis_sdb(p, slot, tfd); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 10 21:20:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9C05E809; Tue, 10 Jun 2014 21:20: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 87FC12437; Tue, 10 Jun 2014 21:20: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 s5ALKc5S025439; Tue, 10 Jun 2014 21:20:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5ALKbG5025433; Tue, 10 Jun 2014 21:20:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406102120.s5ALKbG5025433@svn.freebsd.org> From: John Baldwin Date: Tue, 10 Jun 2014 21:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267341 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 21:20:38 -0000 Author: jhb Date: Tue Jun 10 21:20:37 2014 New Revision: 267341 URL: http://svnweb.freebsd.org/changeset/base/267341 Log: MFC 261217: Remove support for legacy PCI devices. These haven't been needed since support for LPC uart devices was added and it conflicts with upcoming patches to add PCI INTx support. Approved by: grehan Modified: stable/10/usr.sbin/bhyve/bhyve.8 stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/pci_emul.c stable/10/usr.sbin/bhyve/pci_emul.h stable/10/usr.sbin/bhyve/pci_uart.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/10/usr.sbin/bhyve/bhyve.8 Tue Jun 10 20:25:45 2014 (r267340) +++ stable/10/usr.sbin/bhyve/bhyve.8 Tue Jun 10 21:20:37 2014 (r267341) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2013 +.Dd January 27, 2014 .Dt BHYVE 8 .Os .Sh NAME @@ -37,7 +37,6 @@ .Op Fl g Ar gdbport .Op Fl p Ar pinnedcpu .Op Fl s Ar slot,emulation Ns Op , Ns Ar conf -.Op Fl S Ar slot,emulation Ns Op , Ns Ar conf .Op Fl l Ar lpcdev Ns Op , Ns Ar conf .Ar vmname .Sh DESCRIPTION @@ -202,13 +201,6 @@ The host device must have been reserved loader variable as described in .Xr vmm 4 . .El -.It Fl S Ar slot , Ns Ar emulation Ns Op , Ns Ar conf -Identical to the -s option except the device is instructed to use legacy -ISA addresses if possible. -Currently this only has an effect with the -.Li uart -device emulation. -This option will be deprecated in a future version. .It Fl l Ar lpcdev Ns Op , Ns Ar conf Allow devices behind the LPC PCI-ISA bridge to be configured. The only supported devices are the TTY-class devices, Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Tue Jun 10 20:25:45 2014 (r267340) +++ stable/10/usr.sbin/bhyve/bhyverun.c Tue Jun 10 21:20:37 2014 (r267341) @@ -124,7 +124,7 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-aehwAHIPW] [-g ] [-s ] [-S ]\n" + "Usage: %s [-aehwAHIPW] [-g ] [-s ]\n" " %*s [-c vcpus] [-p pincpu] [-m mem] [-l ] \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" " -A: create an ACPI table\n" @@ -137,7 +137,6 @@ usage(int code) " -e: exit on unhandled I/O access\n" " -h: help\n" " -s: PCI slot config\n" - " -S: legacy PCI slot config\n" " -l: LPC device configuration\n" " -m: memory size in MB\n" " -w: ignore unimplemented MSRs\n", @@ -599,7 +598,7 @@ main(int argc, char *argv[]) guest_ncpus = 1; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehwAHIPWp:g:c:s:S:m:l:")) != -1) { + while ((c = getopt(argc, argv, "abehwAHIPWp:g:c:s:m:l:")) != -1) { switch (c) { case 'a': disable_x2apic = 1; @@ -626,12 +625,7 @@ main(int argc, char *argv[]) } break; case 's': - if (pci_parse_slot(optarg, 0) != 0) - exit(1); - else - break; - case 'S': - if (pci_parse_slot(optarg, 1) != 0) + if (pci_parse_slot(optarg) != 0) exit(1); else break; Modified: stable/10/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.c Tue Jun 10 20:25:45 2014 (r267340) +++ stable/10/usr.sbin/bhyve/pci_emul.c Tue Jun 10 21:20:37 2014 (r267341) @@ -75,7 +75,6 @@ static struct slotinfo { char *si_name; char *si_param; struct pci_devinst *si_devi; - int si_legacy; } pci_slotinfo[MAXSLOTS][MAXFUNCS]; SET_DECLARE(pci_devemu_set, struct pci_devemu); @@ -123,7 +122,7 @@ pci_parse_slot_usage(char *aopt) } int -pci_parse_slot(char *opt, int legacy) +pci_parse_slot(char *opt) { char *slot, *func, *emul, *config; char *str, *cpy; @@ -170,7 +169,6 @@ pci_parse_slot(char *opt, int legacy) error = 0; pci_slotinfo[snum][fnum].si_name = emul; pci_slotinfo[snum][fnum].si_param = config; - pci_slotinfo[snum][fnum].si_legacy = legacy; done: if (error) @@ -521,13 +519,7 @@ pci_emul_alloc_pbar(struct pci_devinst * addr = mask = lobits = 0; break; case PCIBAR_IO: - if (hostbase && - pci_slotinfo[pdi->pi_slot][pdi->pi_func].si_legacy) { - assert(hostbase < PCI_EMUL_IOBASE); - baseptr = &hostbase; - } else { - baseptr = &pci_emul_iobase; - } + baseptr = &pci_emul_iobase; limit = PCI_EMUL_IOLIMIT; mask = PCIM_BAR_IO_BASE; lobits = PCIM_BAR_IO_SPACE; @@ -1185,13 +1177,6 @@ pci_generate_msi(struct pci_devinst *pi, } int -pci_is_legacy(struct pci_devinst *pi) -{ - - return (pci_slotinfo[pi->pi_slot][pi->pi_func].si_legacy); -} - -int pci_lintr_request(struct pci_devinst *pi, int req) { int irq; Modified: stable/10/usr.sbin/bhyve/pci_emul.h ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.h Tue Jun 10 20:25:45 2014 (r267340) +++ stable/10/usr.sbin/bhyve/pci_emul.h Tue Jun 10 21:20:37 2014 (r267341) @@ -199,7 +199,6 @@ int pci_emul_alloc_pbar(struct pci_devin uint64_t hostbase, enum pcibar_type type, uint64_t size); int pci_emul_add_msicap(struct pci_devinst *pi, int msgnum); int pci_emul_add_pciecap(struct pci_devinst *pi, int pcie_device_type); -int pci_is_legacy(struct pci_devinst *pi); void pci_generate_msi(struct pci_devinst *pi, int msgnum); void pci_generate_msix(struct pci_devinst *pi, int msgnum); void pci_lintr_assert(struct pci_devinst *pi); @@ -210,7 +209,7 @@ int pci_msix_enabled(struct pci_devinst int pci_msix_table_bar(struct pci_devinst *pi); int pci_msix_pba_bar(struct pci_devinst *pi); int pci_msi_msgnum(struct pci_devinst *pi); -int pci_parse_slot(char *opt, int legacy); +int pci_parse_slot(char *opt); void pci_populate_msicap(struct msicap *cap, int msgs, int nextptr); int pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum); int pci_emul_msix_twrite(struct pci_devinst *pi, uint64_t offset, int size, Modified: stable/10/usr.sbin/bhyve/pci_uart.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_uart.c Tue Jun 10 20:25:45 2014 (r267340) +++ stable/10/usr.sbin/bhyve/pci_uart.c Tue Jun 10 21:20:37 2014 (r267341) @@ -85,28 +85,13 @@ pci_uart_read(struct vmctx *ctx, int vcp return (val); } -static int pci_uart_nldevs; /* number of legacy uart ports allocated */ - static int pci_uart_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) { struct uart_softc *sc; - int ioaddr, ivec; - if (pci_is_legacy(pi)) { - if (uart_legacy_alloc(pci_uart_nldevs, &ioaddr, &ivec) != 0) { - fprintf(stderr, "Unable to allocate resources for " - "legacy COM%d port at pci device %d:%d\n", - pci_uart_nldevs + 1, pi->pi_slot, pi->pi_func); - return (-1); - } - pci_uart_nldevs++; - pci_emul_alloc_pbar(pi, 0, ioaddr, PCIBAR_IO, UART_IO_BAR_SIZE); - } else { - ivec = -1; - pci_emul_alloc_bar(pi, 0, PCIBAR_IO, UART_IO_BAR_SIZE); - } - pci_lintr_request(pi, ivec); + pci_emul_alloc_bar(pi, 0, PCIBAR_IO, UART_IO_BAR_SIZE); + pci_lintr_request(pi, -1); /* initialize config space */ pci_set_cfgdata16(pi, PCIR_DEVICE, COM_DEV); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 10 21:23:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 05BC5986; Tue, 10 Jun 2014 21:23:26 +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 CCDFF24CC; Tue, 10 Jun 2014 21:23:25 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CBF34B94A; Tue, 10 Jun 2014 17:23:23 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r267341 - stable/10/usr.sbin/bhyve Date: Tue, 10 Jun 2014 17:23:18 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201406102120.s5ALKbG5025433@svn.freebsd.org> In-Reply-To: <201406102120.s5ALKbG5025433@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201406101723.18610.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 Jun 2014 17:23:23 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 21:23:26 -0000 On Tuesday, June 10, 2014 5:20:37 pm John Baldwin wrote: > Author: jhb > Date: Tue Jun 10 21:20:37 2014 > New Revision: 267341 > URL: http://svnweb.freebsd.org/changeset/base/267341 > > Log: > MFC 261217: > Remove support for legacy PCI devices. These haven't been needed since > support for LPC uart devices was added and it conflicts with upcoming > patches to add PCI INTx support. > > Approved by: grehan Note that this is a user-visible change (bhyve -S no longer works), but this option was already documented as being subject to removal in the old manual page. This hack has also not been needed for a long time. -- John Baldwin From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 10 22:36:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3E1A7395; Tue, 10 Jun 2014 22:36: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 2AB0F2AB1; Tue, 10 Jun 2014 22:36: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 s5AMa2rE061943; Tue, 10 Jun 2014 22:36:02 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AMa22C061942; Tue, 10 Jun 2014 22:36:02 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201406102236.s5AMa22C061942@svn.freebsd.org> From: Rick Macklem Date: Tue, 10 Jun 2014 22:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267343 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 22:36:02 -0000 Author: rmacklem Date: Tue Jun 10 22:36:01 2014 New Revision: 267343 URL: http://svnweb.freebsd.org/changeset/base/267343 Log: MFC: r267191 The new NFS server would not allow a hard link to be created to a symlink. This restriction (which was inherited from OpenBSD) is not required by the NFS RFCs. Since this is allowed by the old NFS server, it is a POLA violation to not allow it. This patch modifies the new NFS server to allow this. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jun 10 21:40:43 2014 (r267342) +++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jun 10 22:36:01 2014 (r267343) @@ -1620,13 +1620,6 @@ nfsrvd_link(struct nfsrv_descript *nd, i nd->nd_repstat = NFSERR_INVAL; if (tovp) vrele(tovp); - } else if (vnode_vtype(vp) == VLNK) { - if (nd->nd_flag & ND_NFSV2) - nd->nd_repstat = NFSERR_INVAL; - else - nd->nd_repstat = NFSERR_NOTSUPP; - if (tovp) - vrele(tovp); } if (!nd->nd_repstat) { if (nd->nd_flag & ND_NFSV4) { From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 11 03:59:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7F423284; Wed, 11 Jun 2014 03:59: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 6B5B42362; Wed, 11 Jun 2014 03:59: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 s5B3xFha008954; Wed, 11 Jun 2014 03:59:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5B3xFQI008953; Wed, 11 Jun 2014 03:59:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406110359.s5B3xFQI008953@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 11 Jun 2014 03:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267346 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 03:59:15 -0000 Author: kib Date: Wed Jun 11 03:59:14 2014 New Revision: 267346 URL: http://svnweb.freebsd.org/changeset/base/267346 Log: MFC r267060: Allow shared locking for the tmpfs vnode. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Tue Jun 10 23:22:17 2014 (r267345) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Wed Jun 11 03:59:14 2014 (r267346) @@ -595,6 +595,8 @@ loop1: default: panic("tmpfs_alloc_vp: type %p %d", node, (int)node->tn_type); } + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); error = insmntque1(vp, mp, tmpfs_insmntque_dtr, NULL); if (error) From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 11 05:39:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6E453F33; Wed, 11 Jun 2014 05:39: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 4F1E42A63; Wed, 11 Jun 2014 05:39: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 s5B5dAo4053715; Wed, 11 Jun 2014 05:39:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5B5d8Wi053705; Wed, 11 Jun 2014 05:39:08 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406110539.s5B5d8Wi053705@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 11 Jun 2014 05:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267347 - in stable/10/sys/dev/usb: . controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 05:39:10 -0000 Author: hselasky Date: Wed Jun 11 05:39:08 2014 New Revision: 267347 URL: http://svnweb.freebsd.org/changeset/base/267347 Log: MFC r267240: Resolve a deadlock setting the USB configuration index from userspace on USB HUBs by moving the code into the USB explore threads. The deadlock happens because child devices of the USB HUB don't have the expected reference count when called from outside the explore thread. Only the HUB device itself, which the IOCTL interface locks, gets the correct reference count. Modified: stable/10/sys/dev/usb/controller/usb_controller.c stable/10/sys/dev/usb/usb_dev.c stable/10/sys/dev/usb/usb_device.h stable/10/sys/dev/usb/usb_generic.c stable/10/sys/dev/usb/usb_hub.c stable/10/sys/dev/usb/usb_hub.h stable/10/sys/dev/usb/usbdi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/10/sys/dev/usb/controller/usb_controller.c Wed Jun 11 03:59:14 2014 (r267346) +++ stable/10/sys/dev/usb/controller/usb_controller.c Wed Jun 11 05:39:08 2014 (r267347) @@ -366,7 +366,13 @@ usb_bus_explore(struct usb_proc_msg *pm) if (bus->no_explore != 0) return; - if (udev && udev->hub) { + if (udev != NULL) { + USB_BUS_UNLOCK(bus); + uhub_explore_handle_re_enumerate(udev); + USB_BUS_LOCK(bus); + } + + if (udev != NULL && udev->hub != NULL) { if (bus->do_probe) { bus->do_probe = 0; Modified: stable/10/sys/dev/usb/usb_dev.c ============================================================================== --- stable/10/sys/dev/usb/usb_dev.c Wed Jun 11 03:59:14 2014 (r267346) +++ stable/10/sys/dev/usb/usb_dev.c Wed Jun 11 05:39:08 2014 (r267347) @@ -1116,9 +1116,14 @@ usb_ioctl(struct cdev *dev, u_long cmd, usb_pause_mtx(NULL, hz / 128); - if (usb_ref_device(cpd, &refs, 1 /* need uref */)) { - err = ENXIO; - goto done; + while (usb_ref_device(cpd, &refs, 1 /* need uref */)) { + if (usb_ref_device(cpd, &refs, 0)) { + /* device no longer exits */ + err = ENXIO; + goto done; + } + usb_unref_device(cpd, &refs); + usb_pause_mtx(NULL, hz / 128); } } Modified: stable/10/sys/dev/usb/usb_device.h ============================================================================== --- stable/10/sys/dev/usb/usb_device.h Wed Jun 11 03:59:14 2014 (r267346) +++ stable/10/sys/dev/usb/usb_device.h Wed Jun 11 05:39:08 2014 (r267347) @@ -228,6 +228,7 @@ struct usb_device { uint8_t address; /* device addess */ uint8_t device_index; /* device index in "bus->devices" */ uint8_t controller_slot_id; /* controller specific value */ + uint8_t next_config_index; /* used by USB_RE_ENUM_SET_CONFIG */ uint8_t curr_config_index; /* current configuration index */ uint8_t curr_config_no; /* current configuration number */ uint8_t depth; /* distance from root HUB */ @@ -241,6 +242,7 @@ struct usb_device { #define USB_RE_ENUM_DONE 0 #define USB_RE_ENUM_START 1 #define USB_RE_ENUM_PWR_OFF 2 +#define USB_RE_ENUM_SET_CONFIG 3 uint8_t ifaces_max; /* number of interfaces present */ uint8_t endpoints_max; /* number of endpoints present */ Modified: stable/10/sys/dev/usb/usb_generic.c ============================================================================== --- stable/10/sys/dev/usb/usb_generic.c Wed Jun 11 03:59:14 2014 (r267346) +++ stable/10/sys/dev/usb/usb_generic.c Wed Jun 11 05:39:08 2014 (r267347) @@ -616,24 +616,17 @@ ugen_set_config(struct usb_fifo *f, uint /* not possible in device side mode */ return (ENOTTY); } - if (f->udev->curr_config_index == index) { - /* no change needed */ - return (0); - } + /* make sure all FIFO's are gone */ /* else there can be a deadlock */ if (ugen_fs_uninit(f)) { /* ignore any errors */ DPRINTFN(6, "no FIFOs\n"); } - /* change setting - will free generic FIFOs, if any */ - if (usbd_set_config_index(f->udev, index)) { - return (EIO); - } - /* probe and attach */ - if (usb_probe_and_attach(f->udev, USB_IFACE_INDEX_ANY)) { + + if (usbd_start_set_config(f->udev, index) != 0) return (EIO); - } + return (0); } @@ -970,11 +963,6 @@ ugen_re_enumerate(struct usb_fifo *f) DPRINTFN(6, "device mode\n"); return (ENOTTY); } - if (udev->parent_hub == NULL) { - /* the root HUB cannot be re-enumerated */ - DPRINTFN(6, "cannot reset root HUB\n"); - return (EINVAL); - } /* make sure all FIFO's are gone */ /* else there can be a deadlock */ if (ugen_fs_uninit(f)) { Modified: stable/10/sys/dev/usb/usb_hub.c ============================================================================== --- stable/10/sys/dev/usb/usb_hub.c Wed Jun 11 03:59:14 2014 (r267346) +++ stable/10/sys/dev/usb/usb_hub.c Wed Jun 11 05:39:08 2014 (r267347) @@ -427,6 +427,86 @@ done: return (retval); } +void +uhub_explore_handle_re_enumerate(struct usb_device *child) +{ + uint8_t do_unlock; + usb_error_t err; + + /* check if device should be re-enumerated */ + if (child->flags.usb_mode != USB_MODE_HOST) + return; + + do_unlock = usbd_enum_lock(child); + switch (child->re_enumerate_wait) { + case USB_RE_ENUM_START: + err = usbd_set_config_index(child, + USB_UNCONFIG_INDEX); + if (err != 0) { + DPRINTF("Unconfigure failed: %s: Ignored.\n", + usbd_errstr(err)); + } + if (child->parent_hub == NULL) { + /* the root HUB cannot be re-enumerated */ + DPRINTFN(6, "cannot reset root HUB\n"); + err = 0; + } else { + err = usbd_req_re_enumerate(child, NULL); + } + if (err == 0) + err = usbd_set_config_index(child, 0); + if (err == 0) { + err = usb_probe_and_attach(child, + USB_IFACE_INDEX_ANY); + } + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; + + case USB_RE_ENUM_PWR_OFF: + /* get the device unconfigured */ + err = usbd_set_config_index(child, + USB_UNCONFIG_INDEX); + if (err) { + DPRINTFN(0, "Could not unconfigure " + "device (ignored)\n"); + } + if (child->parent_hub == NULL) { + /* the root HUB cannot be re-enumerated */ + DPRINTFN(6, "cannot set port feature\n"); + err = 0; + } else { + /* clear port enable */ + err = usbd_req_clear_port_feature(child->parent_hub, + NULL, child->port_no, UHF_PORT_ENABLE); + if (err) { + DPRINTFN(0, "Could not disable port " + "(ignored)\n"); + } + } + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; + + case USB_RE_ENUM_SET_CONFIG: + err = usbd_set_config_index(child, + child->next_config_index); + if (err != 0) { + DPRINTF("Configure failed: %s: Ignored.\n", + usbd_errstr(err)); + } else { + err = usb_probe_and_attach(child, + USB_IFACE_INDEX_ANY); + } + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; + + default: + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; + } + if (do_unlock) + usbd_enum_unlock(child); +} + /*------------------------------------------------------------------------* * uhub_explore_sub - subroutine * @@ -455,59 +535,7 @@ uhub_explore_sub(struct uhub_softc *sc, goto done; } - /* check if device should be re-enumerated */ - - if (child->flags.usb_mode == USB_MODE_HOST) { - uint8_t do_unlock; - - do_unlock = usbd_enum_lock(child); - switch (child->re_enumerate_wait) { - case USB_RE_ENUM_START: - err = usbd_set_config_index(child, - USB_UNCONFIG_INDEX); - if (err != 0) { - DPRINTF("Unconfigure failed: " - "%s: Ignored.\n", - usbd_errstr(err)); - } - err = usbd_req_re_enumerate(child, NULL); - if (err == 0) - err = usbd_set_config_index(child, 0); - if (err == 0) { - err = usb_probe_and_attach(child, - USB_IFACE_INDEX_ANY); - } - child->re_enumerate_wait = USB_RE_ENUM_DONE; - err = 0; - break; - - case USB_RE_ENUM_PWR_OFF: - /* get the device unconfigured */ - err = usbd_set_config_index(child, - USB_UNCONFIG_INDEX); - if (err) { - DPRINTFN(0, "Could not unconfigure " - "device (ignored)\n"); - } - - /* clear port enable */ - err = usbd_req_clear_port_feature(child->parent_hub, - NULL, child->port_no, UHF_PORT_ENABLE); - if (err) { - DPRINTFN(0, "Could not disable port " - "(ignored)\n"); - } - child->re_enumerate_wait = USB_RE_ENUM_DONE; - err = 0; - break; - - default: - child->re_enumerate_wait = USB_RE_ENUM_DONE; - break; - } - if (do_unlock) - usbd_enum_unlock(child); - } + uhub_explore_handle_re_enumerate(child); /* check if probe and attach should be done */ @@ -2798,3 +2826,31 @@ usbd_start_re_enumerate(struct usb_devic usb_needs_explore(udev->bus, 0); } } + +/*-----------------------------------------------------------------------* + * usbd_start_set_config + * + * This function starts setting a USB configuration. This function + * does not need to be called BUS-locked. This function does not wait + * until the set USB configuratino is completed. + *------------------------------------------------------------------------*/ +usb_error_t +usbd_start_set_config(struct usb_device *udev, uint8_t index) +{ + if (udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + if (udev->curr_config_index == index) { + /* no change needed */ + return (0); + } + udev->next_config_index = index; + udev->re_enumerate_wait = USB_RE_ENUM_SET_CONFIG; + usb_needs_explore(udev->bus, 0); + return (0); + } else if (udev->re_enumerate_wait == USB_RE_ENUM_SET_CONFIG) { + if (udev->next_config_index == index) { + /* no change needed */ + return (0); + } + } + return (USB_ERR_PENDING_REQUESTS); +} Modified: stable/10/sys/dev/usb/usb_hub.h ============================================================================== --- stable/10/sys/dev/usb/usb_hub.h Wed Jun 11 03:59:14 2014 (r267346) +++ stable/10/sys/dev/usb/usb_hub.h Wed Jun 11 05:39:08 2014 (r267347) @@ -75,5 +75,6 @@ void usb_bus_power_update(struct usb_bus void usb_bus_powerd(struct usb_bus *bus); void uhub_root_intr(struct usb_bus *, const uint8_t *, uint8_t); usb_error_t uhub_query_info(struct usb_device *, uint8_t *, uint8_t *); +void uhub_explore_handle_re_enumerate(struct usb_device *); #endif /* _USB_HUB_H_ */ Modified: stable/10/sys/dev/usb/usbdi.h ============================================================================== --- stable/10/sys/dev/usb/usbdi.h Wed Jun 11 03:59:14 2014 (r267346) +++ stable/10/sys/dev/usb/usbdi.h Wed Jun 11 05:39:08 2014 (r267347) @@ -586,6 +586,8 @@ void usbd_m_copy_in(struct usb_page_cach void usbd_frame_zero(struct usb_page_cache *cache, usb_frlength_t offset, usb_frlength_t len); void usbd_start_re_enumerate(struct usb_device *udev); +usb_error_t + usbd_start_set_config(struct usb_device *, uint8_t); int usb_fifo_attach(struct usb_device *udev, void *priv_sc, struct mtx *priv_mtx, struct usb_fifo_methods *pm, From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 11 05:50:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 330EC541; Wed, 11 Jun 2014 05:50: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 149542B3B; Wed, 11 Jun 2014 05:50: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 s5B5o4EV058527; Wed, 11 Jun 2014 05:50:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5B5o4p5058524; Wed, 11 Jun 2014 05:50:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406110550.s5B5o4p5058524@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 11 Jun 2014 05:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267349 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 05:50:05 -0000 Author: hselasky Date: Wed Jun 11 05:50:04 2014 New Revision: 267349 URL: http://svnweb.freebsd.org/changeset/base/267349 Log: MFC r267066 and r267041: Fixes for the RSU driver: - The R92S_TCR register is an 8-bit register. Don't access it like a 16-bit register. - Disable parsing the delete station event, due to many false events. - Ensure that there is only one transfer queue for each endpoint, so to hal packets transmitted don't get out of order. - Properly align temporary buffer to 32-bit. - Add an extra parenthesis to make expression clear. - Range check the association ID received from hardware. Modified: stable/10/sys/dev/usb/wlan/if_rsu.c stable/10/sys/dev/usb/wlan/if_rsureg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsu.c Wed Jun 11 05:45:48 2014 (r267348) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Wed Jun 11 05:50:04 2014 (r267349) @@ -127,10 +127,8 @@ static const STRUCT_USB_HOST_ID rsu_devs static device_probe_t rsu_match; static device_attach_t rsu_attach; static device_detach_t rsu_detach; -static usb_callback_t rsu_bulk_tx_callback_0; -static usb_callback_t rsu_bulk_tx_callback_1; -static usb_callback_t rsu_bulk_tx_callback_2; -static usb_callback_t rsu_bulk_tx_callback_3; +static usb_callback_t rsu_bulk_tx_callback_be_bk; +static usb_callback_t rsu_bulk_tx_callback_vi_vo; static usb_callback_t rsu_bulk_rx_callback; static usb_error_t rsu_do_request(struct rsu_softc *, struct usb_device_request *, void *); @@ -220,6 +218,13 @@ MODULE_DEPEND(rsu, usb, 1, 1, 1); MODULE_DEPEND(rsu, firmware, 1, 1, 1); MODULE_VERSION(rsu, 1); +static uint8_t rsu_wme_ac_xfer_map[4] = { + [WME_AC_BE] = RSU_BULK_TX_BE_BK, + [WME_AC_BK] = RSU_BULK_TX_BE_BK, + [WME_AC_VI] = RSU_BULK_TX_VI_VO, + [WME_AC_VO] = RSU_BULK_TX_VI_VO, +}; + static const struct usb_config rsu_config[RSU_N_TRANSFER] = { [RSU_BULK_RX] = { .type = UE_BULK, @@ -232,20 +237,7 @@ static const struct usb_config rsu_confi }, .callback = rsu_bulk_rx_callback }, - [RSU_BULK_TX_BE] = { - .type = UE_BULK, - .endpoint = 0x06, - .direction = UE_DIR_OUT, - .bufsize = RSU_TXBUFSZ, - .flags = { - .ext_buffer = 1, - .pipe_bof = 1, - .force_short_xfer = 1 - }, - .callback = rsu_bulk_tx_callback_0, - .timeout = RSU_TX_TIMEOUT - }, - [RSU_BULK_TX_BK] = { + [RSU_BULK_TX_BE_BK] = { .type = UE_BULK, .endpoint = 0x06, .direction = UE_DIR_OUT, @@ -255,10 +247,10 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback_1, + .callback = rsu_bulk_tx_callback_be_bk, .timeout = RSU_TX_TIMEOUT }, - [RSU_BULK_TX_VI] = { + [RSU_BULK_TX_VI_VO] = { .type = UE_BULK, .endpoint = 0x04, .direction = UE_DIR_OUT, @@ -268,20 +260,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback_2, - .timeout = RSU_TX_TIMEOUT - }, - [RSU_BULK_TX_VO] = { - .type = UE_BULK, - .endpoint = 0x04, - .direction = UE_DIR_OUT, - .bufsize = RSU_TXBUFSZ, - .flags = { - .ext_buffer = 1, - .pipe_bof = 1, - .force_short_xfer = 1 - }, - .callback = rsu_bulk_tx_callback_3, + .callback = rsu_bulk_tx_callback_vi_vo, .timeout = RSU_TX_TIMEOUT }, }; @@ -613,7 +592,7 @@ rsu_alloc_tx_list(struct rsu_softc *sc) STAILQ_INIT(&sc->sc_tx_inactive); - for (i = 0; i != RSU_MAX_TX_EP; i++) { + for (i = 0; i != RSU_N_TRANSFER; i++) { STAILQ_INIT(&sc->sc_tx_active[i]); STAILQ_INIT(&sc->sc_tx_pending[i]); } @@ -633,7 +612,7 @@ rsu_free_tx_list(struct rsu_softc *sc) /* prevent further allocations from TX list(s) */ STAILQ_INIT(&sc->sc_tx_inactive); - for (i = 0; i != RSU_MAX_TX_EP; i++) { + for (i = 0; i != RSU_N_TRANSFER; i++) { STAILQ_INIT(&sc->sc_tx_active[i]); STAILQ_INIT(&sc->sc_tx_pending[i]); } @@ -873,7 +852,7 @@ rsu_read_rom(struct rsu_softc *sc) static int rsu_fw_cmd(struct rsu_softc *sc, uint8_t code, void *buf, int len) { - const uint8_t which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; + const uint8_t which = rsu_wme_ac_xfer_map[WME_AC_VO]; struct rsu_data *data; struct r92s_tx_desc *txd; struct r92s_fw_cmd_hdr *cmd; @@ -912,7 +891,7 @@ rsu_fw_cmd(struct rsu_softc *sc, uint8_t DPRINTFN(2, "Tx cmd code=0x%x len=0x%x\n", code, cmdsz); data->buflen = xferlen; STAILQ_INSERT_TAIL(&sc->sc_tx_pending[which], data, next); - usbd_transfer_start(sc->sc_xfer[which + RSU_BULK_TX_BE]); + usbd_transfer_start(sc->sc_xfer[which]); return (0); } @@ -925,6 +904,7 @@ rsu_calib_task(void *arg, int pending __ uint32_t reg; DPRINTFN(6, "running calibration task\n"); + RSU_LOCK(sc); #ifdef notyet /* Read WPS PBC status. */ @@ -941,12 +921,9 @@ rsu_calib_task(void *arg, int pending __ reg = rsu_read_4(sc, R92S_IOCMD_DATA); DPRINTFN(8, "RSSI=%d%%\n", reg >> 4); } - if (sc->sc_calibrating) { - RSU_UNLOCK(sc); - taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, - hz * 2); - } else - RSU_UNLOCK(sc); + if (sc->sc_calibrating) + taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, hz); + RSU_UNLOCK(sc); } static int @@ -1000,11 +977,10 @@ rsu_newstate(struct ieee80211vap *vap, e break; } sc->sc_calibrating = 1; + /* Start periodic calibration. */ + taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, hz); RSU_UNLOCK(sc); IEEE80211_LOCK(ic); - /* Start periodic calibration. */ - taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, hz * 2); - return (uvp->newstate(vap, nstate, arg)); } @@ -1080,7 +1056,8 @@ rsu_join_bss(struct rsu_softc *sc, struc struct ndis_wlan_bssid_ex *bss; struct ndis_802_11_fixed_ies *fixed; struct r92s_fw_cmd_auth auth; - uint8_t buf[sizeof(*bss) + 128], *frm; + uint8_t buf[sizeof(*bss) + 128] __aligned(4); + uint8_t *frm; uint8_t opmode; int error; @@ -1094,7 +1071,7 @@ rsu_join_bss(struct rsu_softc *sc, struc memset(&auth, 0, sizeof(auth)); if (vap->iv_flags & IEEE80211_F_WPA) { auth.mode = R92S_AUTHMODE_WPA; - auth.dot1x = ni->ni_authmode == IEEE80211_AUTH_8021X; + auth.dot1x = (ni->ni_authmode == IEEE80211_AUTH_8021X); } else auth.mode = R92S_AUTHMODE_OPEN; DPRINTF("setting auth mode to %d\n", auth.mode); @@ -1222,6 +1199,7 @@ rsu_event_join_bss(struct rsu_softc *sc, struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_node *ni = vap->iv_bss; struct r92s_event_join_bss *rsp; + uint32_t tmp; int res; if (__predict_false(len < sizeof(*rsp))) @@ -1236,9 +1214,14 @@ rsu_event_join_bss(struct rsu_softc *sc, RSU_LOCK(sc); return; } + tmp = le32toh(rsp->associd); + if (tmp >= vap->iv_max_aid) { + DPRINTF("Assoc ID overflow\n"); + tmp = 1; + } DPRINTF("associated with %s associd=%d\n", - ether_sprintf(rsp->bss.macaddr), le32toh(rsp->associd)); - ni->ni_associd = le32toh(rsp->associd) | 0xc000; + ether_sprintf(rsp->bss.macaddr), tmp); + ni->ni_associd = tmp | 0xc000; RSU_UNLOCK(sc); ieee80211_new_state(vap, IEEE80211_S_RUN, IEEE80211_FC0_SUBTYPE_ASSOC_RESP); @@ -1277,6 +1260,9 @@ rsu_rx_event(struct rsu_softc *sc, uint8 if (vap->iv_state == IEEE80211_S_AUTH) rsu_event_join_bss(sc, buf, len); break; +#if 0 +XXX This event is occurring regularly, possibly due to some power saving event +XXX and disrupts the WLAN traffic. Disable for now. case R92S_EVT_DEL_STA: DPRINTF("disassociated from %s\n", ether_sprintf(buf)); if (vap->iv_state == IEEE80211_S_RUN && @@ -1286,6 +1272,7 @@ rsu_rx_event(struct rsu_softc *sc, uint8 RSU_LOCK(sc); } break; +#endif case R92S_EVT_WPS_PBC: DPRINTF("WPS PBC pushed.\n"); break; @@ -1295,6 +1282,8 @@ rsu_rx_event(struct rsu_softc *sc, uint8 printf("FWDBG: %s\n", (char *)buf); } break; + default: + break; } } @@ -1676,27 +1665,15 @@ tr_setup: } static void -rsu_bulk_tx_callback_0(struct usb_xfer *xfer, usb_error_t error) -{ - rsu_bulk_tx_callback_sub(xfer, error, 0); -} - -static void -rsu_bulk_tx_callback_1(struct usb_xfer *xfer, usb_error_t error) +rsu_bulk_tx_callback_be_bk(struct usb_xfer *xfer, usb_error_t error) { - rsu_bulk_tx_callback_sub(xfer, error, 1); + rsu_bulk_tx_callback_sub(xfer, error, RSU_BULK_TX_BE_BK); } static void -rsu_bulk_tx_callback_2(struct usb_xfer *xfer, usb_error_t error) +rsu_bulk_tx_callback_vi_vo(struct usb_xfer *xfer, usb_error_t error) { - rsu_bulk_tx_callback_sub(xfer, error, 2); -} - -static void -rsu_bulk_tx_callback_3(struct usb_xfer *xfer, usb_error_t error) -{ - rsu_bulk_tx_callback_sub(xfer, error, 3); + rsu_bulk_tx_callback_sub(xfer, error, RSU_BULK_TX_VI_VO); } static int @@ -1734,12 +1711,10 @@ rsu_tx_start(struct rsu_softc *sc, struc switch (type) { case IEEE80211_FC0_TYPE_CTL: case IEEE80211_FC0_TYPE_MGT: - which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; + which = rsu_wme_ac_xfer_map[WME_AC_VO]; break; default: - which = M_WME_GETAC(m0); - KASSERT(which < RSU_MAX_TX_EP, - ("unsupported WME pipe %d", which)); + which = rsu_wme_ac_xfer_map[M_WME_GETAC(m0)]; break; } hasqos = 0; @@ -1804,7 +1779,7 @@ rsu_tx_start(struct rsu_softc *sc, struc STAILQ_INSERT_TAIL(&sc->sc_tx_pending[which], data, next); /* start transfer, if any */ - usbd_transfer_start(sc->sc_xfer[which + RSU_BULK_TX_BE]); + usbd_transfer_start(sc->sc_xfer[which]); return (0); } @@ -2119,7 +2094,7 @@ rsu_power_off(struct rsu_softc *sc) static int rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t *buf, int len) { - const uint8_t which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; + const uint8_t which = rsu_wme_ac_xfer_map[WME_AC_VO]; struct rsu_data *data; struct r92s_tx_desc *txd; int mlen; @@ -2144,7 +2119,7 @@ rsu_fw_loadsection(struct rsu_softc *sc, buf += mlen; len -= mlen; } - usbd_transfer_start(sc->sc_xfer[RSU_BULK_TX_BE + which]); + usbd_transfer_start(sc->sc_xfer[which]); return (0); } @@ -2160,6 +2135,11 @@ rsu_load_firmware(struct rsu_softc *sc) uint32_t reg; int ntries, error; + if (rsu_read_1(sc, R92S_TCR) & R92S_TCR_FWRDY) { + DPRINTF("Firmware already loaded\n"); + return (0); + } + RSU_UNLOCK(sc); /* Read firmware image from the filesystem. */ if ((fw = firmware_get("rsu-rtl8712fw")) == NULL) { @@ -2216,7 +2196,7 @@ rsu_load_firmware(struct rsu_softc *sc) /* Wait for load to complete. */ for (ntries = 0; ntries != 50; ntries++) { usb_pause_mtx(&sc->sc_mtx, hz / 100); - reg = rsu_read_2(sc, R92S_TCR); + reg = rsu_read_1(sc, R92S_TCR); if (reg & R92S_TCR_IMEM_CODE_DONE) break; } @@ -2225,7 +2205,6 @@ rsu_load_firmware(struct rsu_softc *sc) error = ETIMEDOUT; goto fail; } - /* Load EMEM section. */ error = rsu_fw_loadsection(sc, emem, ememsz); if (error != 0) { @@ -2245,7 +2224,6 @@ rsu_load_firmware(struct rsu_softc *sc) error = ETIMEDOUT; goto fail; } - /* Enable CPU. */ rsu_write_1(sc, R92S_SYS_CLKR, rsu_read_1(sc, R92S_SYS_CLKR) | R92S_SYS_CPU_CLKSEL); @@ -2264,7 +2242,7 @@ rsu_load_firmware(struct rsu_softc *sc) } /* Wait for CPU to initialize. */ for (ntries = 0; ntries < 100; ntries++) { - if (rsu_read_2(sc, R92S_TCR) & R92S_TCR_IMEM_RDY) + if (rsu_read_1(sc, R92S_TCR) & R92S_TCR_IMEM_RDY) break; rsu_ms_delay(sc); } @@ -2296,7 +2274,7 @@ rsu_load_firmware(struct rsu_softc *sc) } /* Wait for load to complete. */ for (ntries = 0; ntries < 100; ntries++) { - if (rsu_read_2(sc, R92S_TCR) & R92S_TCR_DMEM_CODE_DONE) + if (rsu_read_1(sc, R92S_TCR) & R92S_TCR_DMEM_CODE_DONE) break; rsu_ms_delay(sc); } @@ -2308,7 +2286,7 @@ rsu_load_firmware(struct rsu_softc *sc) } /* Wait for firmware readiness. */ for (ntries = 0; ntries < 60; ntries++) { - if (!(rsu_read_2(sc, R92S_TCR) & R92S_TCR_FWRDY)) + if (!(rsu_read_1(sc, R92S_TCR) & R92S_TCR_FWRDY)) break; rsu_ms_delay(sc); } @@ -2386,6 +2364,7 @@ rsu_init_locked(struct rsu_softc *sc) rsu_power_on_acut(sc); else rsu_power_on_bcut(sc); + /* Load firmware. */ error = rsu_load_firmware(sc); if (error != 0) Modified: stable/10/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsureg.h Wed Jun 11 05:45:48 2014 (r267348) +++ stable/10/sys/dev/usb/wlan/if_rsureg.h Wed Jun 11 05:50:04 2014 (r267349) @@ -698,11 +698,9 @@ struct rsu_host_cmd_ring { enum { RSU_BULK_RX, - RSU_BULK_TX_BE, /* = WME_AC_BE */ - RSU_BULK_TX_BK, /* = WME_AC_BK */ - RSU_BULK_TX_VI, /* = WME_AC_VI */ - RSU_BULK_TX_VO, /* = WME_AC_VI */ - RSU_N_TRANSFER = 5, + RSU_BULK_TX_BE_BK, /* = WME_AC_BE/BK */ + RSU_BULK_TX_VI_VO, /* = WME_AC_VI/VO */ + RSU_N_TRANSFER, }; struct rsu_data { @@ -727,8 +725,6 @@ struct rsu_vap { #define RSU_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) #define RSU_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) -#define RSU_MAX_TX_EP 4 - struct rsu_softc { struct ifnet *sc_ifp; device_t sc_dev; @@ -754,9 +750,9 @@ struct rsu_softc { STAILQ_HEAD(, rsu_data) sc_rx_active; STAILQ_HEAD(, rsu_data) sc_rx_inactive; - STAILQ_HEAD(, rsu_data) sc_tx_active[RSU_MAX_TX_EP]; + STAILQ_HEAD(, rsu_data) sc_tx_active[RSU_N_TRANSFER]; STAILQ_HEAD(, rsu_data) sc_tx_inactive; - STAILQ_HEAD(, rsu_data) sc_tx_pending[RSU_MAX_TX_EP]; + STAILQ_HEAD(, rsu_data) sc_tx_pending[RSU_N_TRANSFER]; union { struct rsu_rx_radiotap_header th; From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 01:33:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5955351B; Thu, 12 Jun 2014 01:33: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 4339A2FBA; Thu, 12 Jun 2014 01:33: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 s5C1X2Cn022466; Thu, 12 Jun 2014 01:33:02 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5C1X2E5022465; Thu, 12 Jun 2014 01:33:02 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406120133.s5C1X2E5022465@svn.freebsd.org> From: Ed Maste Date: Thu, 12 Jun 2014 01:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267381 - stable/10/sys/dev/vt/font X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 01:33:02 -0000 Author: emaste Date: Thu Jun 12 01:33:01 2014 New Revision: 267381 URL: http://svnweb.freebsd.org/changeset/base/267381 Log: MFC r267109, r267179: Update vt(4) "Terminus BSD Console" font "Terminus BSD Console" is a derivative of Terminus that is provided by Mr. Dimitar Zhekov under the 2-clause BSD license for use by the FreeBSD vt(4) console. Clarify statement on font origin Modified: stable/10/sys/dev/vt/font/vt_font_default.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/font/vt_font_default.c ============================================================================== --- stable/10/sys/dev/vt/font/vt_font_default.c Thu Jun 12 00:19:05 2014 (r267380) +++ stable/10/sys/dev/vt/font/vt_font_default.c Thu Jun 12 01:33:01 2014 (r267381) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Dimitar Toshkov Zhekov. All rights reserved. + * Copyright (C) 2014 Dimitar Toshkov Zhekov. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -21,8 +21,13 @@ * 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. - * - * Please contribute any changes back to . + */ + +/* + * This is the "Terminus BSD Console" font. It is identical to the standard + * variant of Terminus Font 8x16, but provided under the 2-clause BSD License + * (FreeBSD License). Please contribute any changes back to Mr. Zhekov at + * . */ #include @@ -30,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include -static uint8_t font_bytes[1422 * 16] = { +static uint8_t font_bytes[1477 * 16] = { 0x00, 0x00, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, @@ -784,8 +789,8 @@ static uint8_t font_bytes[1422 * 16] = { 0x40, 0x20, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x04, 0x04, 0x04, 0x44, 0x44, 0x44, 0x24, 0x14, 0x0c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x92, 0x92, - 0x92, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x92, 0x92, + 0x92, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x44, 0x44, @@ -952,68 +957,112 @@ static uint8_t font_bytes[1422 * 16] = { 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xff, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xef, 0x00, 0xef, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, + 0xfc, 0xfc, 0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, + 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, + 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, + 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, + 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, - 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, - 0x88, 0x22, 0x88, 0x22, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xee, 0xbb, 0xee, 0xbb, + 0x0f, 0x0f, 0x0f, 0x0f, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, + 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0xaa, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, - 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, - 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, + 0xee, 0xbb, 0xee, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, - 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x3c, 0x3c, - 0x3c, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0x38, - 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc0, 0xf0, 0xfc, 0xff, 0xfc, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x3f, 0xff, - 0x3f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x44, 0x82, 0x44, 0x28, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, - 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xdb, 0xdb, 0xe7, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7c, 0x82, 0xaa, 0x82, 0x82, 0xba, - 0x92, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xfe, - 0xd6, 0xfe, 0xfe, 0xc6, 0xee, 0xfe, 0xfe, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x10, 0x92, 0x54, 0x38, 0xee, 0x38, 0x54, 0x92, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, - 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x06, - 0x0a, 0x12, 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x10, 0x38, 0x7c, 0xfe, 0xfe, 0x7c, 0x10, 0x10, 0x38, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x10, 0x54, 0xfe, - 0xfe, 0x54, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3e, 0x22, 0x3e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x7e, 0x42, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x44, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, + 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, + 0x7e, 0x7e, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xfc, 0xff, 0xfc, 0xf0, 0xc0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, + 0x38, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x0f, 0x3f, 0xff, 0x3f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x44, 0x82, + 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x24, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xdb, + 0xdb, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7c, 0x82, + 0xaa, 0x82, 0x82, 0xba, 0x92, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xfe, 0xd6, 0xfe, 0xfe, 0xc6, 0xee, 0xfe, 0xfe, 0x7c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x92, 0x54, 0x38, 0xee, + 0x38, 0x54, 0x92, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, + 0x44, 0x44, 0x44, 0x38, 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1e, 0x06, 0x0a, 0x12, 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0x7c, 0xfe, 0xfe, + 0x7c, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, + 0x38, 0x10, 0x54, 0xfe, 0xfe, 0x54, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x22, 0x3e, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x42, + 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x44, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x04, 0x04, 0x88, 0x88, 0x50, 0x50, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x06, 0x06, 0xcc, 0xcc, + 0x78, 0x78, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, + 0x28, 0x18, 0x18, 0x14, 0x22, 0x20, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0c, 0xcc, 0x78, 0x38, 0x38, 0x3c, 0x66, 0x60, 0xc0, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x88, 0x9c, 0xaa, 0x88, 0x88, 0x88, + 0x10, 0x20, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, + 0x80, 0x80, 0xf8, 0x00, 0x11, 0x19, 0x15, 0x13, 0x11, 0x11, 0x00, 0x00, + 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0xfe, 0xfe, 0xee, 0xc6, 0xee, 0xfe, + 0xfe, 0xfe, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff, + 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x80, 0x40, 0x20, 0x10, + 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff, 0xff, 0x7f, 0x3f, 0x1f, + 0x0f, 0x07, 0x03, 0x01, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, + 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, @@ -1903,19 +1952,39 @@ static uint8_t font_bytes[1422 * 16] = { 0x18, 0x18, 0x18, 0x18, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0xff, 0xff, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0xef, 0xef, 0x00, 0xef, 0xef, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, - 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3c, 0x3c, 0x7e, 0x7e, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xfc, 0xff, - 0xff, 0xfc, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x7e, 0x7e, 0x3c, 0x3c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x3f, 0xff, 0xff, 0x3f, 0x0f, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, - 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x66, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x1c, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0xf0, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x38, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1c, 0x0f, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf8, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x38, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x3c, 0x3c, 0x7e, 0x7e, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xfc, 0xff, 0xff, 0xfc, 0xf0, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x7e, + 0x3c, 0x3c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x0f, 0x3f, 0xff, 0xff, 0x3f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0x7e, 0x3c, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66, 0xc3, + 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x7e, 0x7e, 0x7e, 0x7e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x18, 0xdb, 0x7e, 0x3c, 0xe7, 0x3c, 0x7e, 0xdb, 0x18, 0x00, 0x00, 0x00, 0x00, @@ -1927,9 +1996,19 @@ static uint8_t font_bytes[1422 * 16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x66, 0x7e, 0x60, 0x60, 0x60, 0x60, 0x60, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6e, 0xec, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x07, 0x0e, 0x0e, 0xdc, 0xfc, 0x78, 0x78, 0x30, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xee, 0x7c, 0x3c, 0x3c, 0x3e, + 0x77, 0x73, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xcc, 0xde, + 0xff, 0xcc, 0xcc, 0xcc, 0x98, 0x30, 0x60, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, + 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0x00, 0x33, 0x3b, 0x3f, 0x37, + 0x33, 0x33, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0xff, 0xff, + 0xe7, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, + 0x18, 0x0c, 0x06, 0x03, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, + 0x01, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc0, 0x60, 0x30, 0x18, + 0x0c, 0x06, 0x03, 0x01, }; -static struct vt_font_map font_mapping_normal[248] = { +static struct vt_font_map font_mapping_normal[252] = { { 0x0020, 0x0001, 0x5e }, { 0x00a0, 0x0001, 0x00 }, { 0x00a1, 0x0060, 0x6e }, { 0x0110, 0x008f, 0x00 }, { 0x0111, 0x00cf, 0x08 }, { 0x011a, 0x00d2, 0x01 }, @@ -2038,155 +2117,163 @@ static struct vt_font_map font_mapping_n { 0x2212, 0x000e, 0x00 }, { 0x2219, 0x0233, 0x01 }, { 0x221e, 0x0235, 0x01 }, { 0x2227, 0x0237, 0x03 }, { 0x2248, 0x023b, 0x00 }, { 0x2260, 0x023c, 0x01 }, - { 0x2264, 0x023e, 0x01 }, { 0x2302, 0x0240, 0x00 }, - { 0x2310, 0x0241, 0x00 }, { 0x2320, 0x0242, 0x01 }, - { 0x23ba, 0x0244, 0x03 }, { 0x2409, 0x0248, 0x04 }, - { 0x2424, 0x024d, 0x00 }, { 0x2500, 0x024e, 0x03 }, - { 0x2508, 0x0252, 0x43 }, { 0x2550, 0x0296, 0x1c }, - { 0x2580, 0x02b3, 0x08 }, { 0x258c, 0x02bc, 0x00 }, - { 0x2590, 0x02bd, 0x03 }, { 0x2596, 0x02c1, 0x0a }, - { 0x25ac, 0x02cc, 0x00 }, { 0x25ae, 0x02cd, 0x00 }, - { 0x25b2, 0x02ce, 0x00 }, { 0x25b6, 0x02cf, 0x00 }, - { 0x25bc, 0x02d0, 0x00 }, { 0x25c0, 0x02d1, 0x00 }, - { 0x25c6, 0x02d2, 0x00 }, { 0x25ca, 0x02d3, 0x01 }, - { 0x25d8, 0x02d5, 0x01 }, { 0x263a, 0x02d7, 0x02 }, - { 0x2640, 0x02da, 0x00 }, { 0x2642, 0x02db, 0x00 }, - { 0x2660, 0x02dc, 0x00 }, { 0x2663, 0x02dd, 0x00 }, - { 0x2665, 0x02de, 0x00 }, { 0x2666, 0x02d2, 0x00 }, - { 0x266a, 0x02df, 0x01 }, { 0xf6be, 0x0148, 0x00 }, + { 0x2264, 0x023e, 0x01 }, { 0x2300, 0x0230, 0x00 }, + { 0x2302, 0x0240, 0x00 }, { 0x2310, 0x0241, 0x00 }, + { 0x2320, 0x0242, 0x01 }, { 0x23ba, 0x0244, 0x03 }, + { 0x2409, 0x0248, 0x04 }, { 0x2424, 0x024d, 0x00 }, + { 0x2500, 0x024e, 0x03 }, { 0x2508, 0x0252, 0x43 }, + { 0x2550, 0x0296, 0x20 }, { 0x2574, 0x02b7, 0x1f }, + { 0x2596, 0x02d7, 0x0a }, { 0x25ac, 0x02e2, 0x00 }, + { 0x25ae, 0x02e3, 0x00 }, { 0x25b2, 0x02e4, 0x00 }, + { 0x25b6, 0x02e5, 0x00 }, { 0x25bc, 0x02e6, 0x00 }, + { 0x25c0, 0x02e7, 0x00 }, { 0x25c6, 0x02e8, 0x00 }, + { 0x25ca, 0x02e9, 0x01 }, { 0x25cf, 0x0212, 0x00 }, + { 0x25d8, 0x02eb, 0x01 }, { 0x263a, 0x02ed, 0x02 }, + { 0x2640, 0x02f0, 0x00 }, { 0x2642, 0x02f1, 0x00 }, + { 0x2660, 0x02f2, 0x00 }, { 0x2663, 0x02f3, 0x00 }, + { 0x2665, 0x02f4, 0x00 }, { 0x2666, 0x02e8, 0x00 }, + { 0x266a, 0x02f5, 0x01 }, { 0x2713, 0x02f7, 0x01 }, + { 0x2717, 0x02f9, 0x01 }, { 0xe0a0, 0x02fb, 0x02 }, + { 0xe0b0, 0x02fe, 0x03 }, { 0xf6be, 0x0148, 0x00 }, }; -static struct vt_font_map font_mapping_bold[260] = { - { 0x0021, 0x02e1, 0x0b }, { 0x002d, 0x0205, 0x00 }, - { 0x002e, 0x02ed, 0x50 }, { 0x00a1, 0x033e, 0x07 }, - { 0x00aa, 0x0346, 0x03 }, { 0x00af, 0x034a, 0x07 }, - { 0x00b7, 0x0233, 0x00 }, { 0x00b8, 0x0352, 0x57 }, - { 0x0110, 0x036a, 0x00 }, { 0x0111, 0x03aa, 0x08 }, - { 0x011a, 0x03ad, 0x01 }, { 0x011c, 0x03b3, 0x59 }, - { 0x0178, 0x040d, 0x07 }, { 0x0186, 0x0415, 0x00 }, - { 0x018e, 0x0416, 0x02 }, { 0x0192, 0x0419, 0x00 }, - { 0x019d, 0x041a, 0x01 }, { 0x01b7, 0x041c, 0x00 }, - { 0x0218, 0x041d, 0x03 }, { 0x0232, 0x0421, 0x01 }, - { 0x0237, 0x0423, 0x00 }, { 0x0254, 0x0424, 0x00 }, - { 0x0258, 0x0425, 0x01 }, { 0x025b, 0x0427, 0x00 }, - { 0x0272, 0x0428, 0x00 }, { 0x0292, 0x0429, 0x00 }, - { 0x02bb, 0x042a, 0x02 }, { 0x02c6, 0x042d, 0x01 }, - { 0x02d8, 0x042e, 0x01 }, { 0x02db, 0x0430, 0x02 }, - { 0x0300, 0x031f, 0x00 }, { 0x0301, 0x034f, 0x00 }, - { 0x0302, 0x042d, 0x00 }, { 0x0303, 0x0431, 0x00 }, - { 0x0306, 0x042e, 0x00 }, { 0x030c, 0x042e, 0x00 }, - { 0x0329, 0x0433, 0x00 }, { 0x0384, 0x0434, 0x06 }, - { 0x038c, 0x043b, 0x00 }, { 0x038e, 0x043c, 0x02 }, - { 0x0391, 0x0300, 0x01 }, { 0x0393, 0x043f, 0x01 }, - { 0x0395, 0x0304, 0x00 }, { 0x0396, 0x0319, 0x00 }, - { 0x0397, 0x0307, 0x00 }, { 0x0398, 0x0441, 0x00 }, - { 0x0399, 0x0308, 0x00 }, { 0x039a, 0x030a, 0x00 }, - { 0x039b, 0x0442, 0x00 }, { 0x039c, 0x030c, 0x01 }, - { 0x039e, 0x0443, 0x00 }, { 0x039f, 0x030e, 0x00 }, - { 0x03a0, 0x0444, 0x00 }, { 0x03a1, 0x030f, 0x00 }, - { 0x03a3, 0x0445, 0x00 }, { 0x03a4, 0x0313, 0x00 }, - { 0x03a5, 0x0318, 0x00 }, { 0x03a6, 0x0446, 0x00 }, - { 0x03a7, 0x0317, 0x00 }, { 0x03a8, 0x0447, 0x01 }, - { 0x03aa, 0x0369, 0x00 }, { 0x03ab, 0x040d, 0x00 }, - { 0x03ac, 0x0449, 0x08 }, { 0x03b5, 0x0427, 0x00 }, - { 0x03b6, 0x0452, 0x00 }, { 0x03b7, 0x041b, 0x00 }, - { 0x03b8, 0x0453, 0x01 }, { 0x03ba, 0x03cf, 0x00 }, - { 0x03bb, 0x0455, 0x00 }, { 0x03bc, 0x0350, 0x00 }, - { 0x03bd, 0x0335, 0x00 }, { 0x03be, 0x0456, 0x00 }, - { 0x03bf, 0x032e, 0x00 }, { 0x03c0, 0x0457, 0x0b }, - { 0x03cc, 0x038d, 0x00 }, { 0x03cd, 0x0463, 0x01 }, - { 0x03f3, 0x0329, 0x00 }, { 0x03f4, 0x0465, 0x00 }, - { 0x0400, 0x0362, 0x00 }, { 0x0401, 0x0365, 0x00 }, - { 0x0402, 0x0466, 0x02 }, { 0x0405, 0x0312, 0x00 }, - { 0x0406, 0x0308, 0x00 }, { 0x0407, 0x0369, 0x00 }, - { 0x0408, 0x0309, 0x00 }, { 0x0409, 0x0469, 0x06 }, - { 0x0410, 0x0300, 0x00 }, { 0x0411, 0x0470, 0x00 }, - { 0x0412, 0x0301, 0x00 }, { 0x0413, 0x043f, 0x00 }, - { 0x0414, 0x0471, 0x00 }, { 0x0415, 0x0304, 0x00 }, - { 0x0416, 0x0472, 0x00 }, { 0x0417, 0x02f2, 0x00 }, - { 0x0418, 0x0473, 0x01 }, { 0x041a, 0x030a, 0x00 }, - { 0x041b, 0x0475, 0x00 }, { 0x041c, 0x030c, 0x00 }, - { 0x041d, 0x0307, 0x00 }, { 0x041e, 0x030e, 0x00 }, - { 0x041f, 0x0444, 0x00 }, { 0x0420, 0x030f, 0x00 }, - { 0x0421, 0x0302, 0x00 }, { 0x0422, 0x0313, 0x00 }, - { 0x0423, 0x0476, 0x01 }, { 0x0425, 0x0317, 0x00 }, - { 0x0426, 0x0478, 0x09 }, { 0x0430, 0x0320, 0x00 }, - { 0x0431, 0x0482, 0x02 }, { 0x0434, 0x0326, 0x00 }, - { 0x0435, 0x0324, 0x00 }, { 0x0436, 0x0485, 0x01 }, - { 0x0438, 0x0334, 0x00 }, { 0x0439, 0x0404, 0x00 }, - { 0x043a, 0x03cf, 0x00 }, { 0x043b, 0x0487, 0x02 }, - { 0x043e, 0x032e, 0x00 }, { 0x043f, 0x0457, 0x00 }, - { 0x0440, 0x032f, 0x00 }, { 0x0441, 0x0322, 0x00 }, - { 0x0442, 0x048a, 0x00 }, { 0x0443, 0x0338, 0x00 }, - { 0x0444, 0x048b, 0x00 }, { 0x0445, 0x0337, 0x00 }, - { 0x0446, 0x048c, 0x09 }, { 0x0450, 0x0382, 0x00 }, - { 0x0451, 0x0385, 0x00 }, { 0x0452, 0x0496, 0x02 }, - { 0x0455, 0x0332, 0x00 }, { 0x0456, 0x0328, 0x00 }, - { 0x0457, 0x0389, 0x00 }, { 0x0458, 0x0329, 0x00 }, - { 0x0459, 0x0499, 0x01 }, { 0x045b, 0x03be, 0x00 }, - { 0x045c, 0x049b, 0x00 }, { 0x045d, 0x0393, 0x00 }, - { 0x045e, 0x049c, 0x01 }, { 0x0490, 0x049e, 0x0d }, - { 0x04a0, 0x04ac, 0x05 }, { 0x04aa, 0x04b2, 0x01 }, - { 0x04ae, 0x0318, 0x00 }, { 0x04af, 0x0450, 0x00 }, - { 0x04b0, 0x04b4, 0x03 }, { 0x04b6, 0x04b8, 0x05 }, - { 0x04d0, 0x039c, 0x01 }, { 0x04d2, 0x035e, 0x00 }, - { 0x04d3, 0x037e, 0x00 }, { 0x04d4, 0x0360, 0x00 }, - { 0x04d5, 0x0380, 0x00 }, { 0x04d6, 0x03ad, 0x01 }, - { 0x04d8, 0x0417, 0x00 }, { 0x04d9, 0x0426, 0x00 }, - { 0x04da, 0x04be, 0x05 }, { 0x04e2, 0x04c4, 0x00 }, - { 0x04e3, 0x0402, 0x00 }, { 0x04e4, 0x04c5, 0x00 }, - { 0x04e5, 0x0396, 0x00 }, { 0x04e6, 0x0370, 0x00 }, - { 0x04e7, 0x0390, 0x00 }, { 0x04e8, 0x0465, 0x00 }, - { 0x04e9, 0x04c6, 0x05 }, { 0x04ef, 0x0422, 0x00 }, - { 0x04f0, 0x04cc, 0x00 }, { 0x04f1, 0x0399, 0x00 }, - { 0x04f2, 0x04cd, 0x03 }, { 0x04f8, 0x04d1, 0x01 }, - { 0x1e34, 0x04d3, 0x01 }, { 0x1eb8, 0x04d5, 0x01 }, - { 0x1ebc, 0x04d7, 0x01 }, { 0x1eca, 0x04d9, 0x03 }, - { 0x1ee4, 0x04dd, 0x01 }, { 0x1ef8, 0x04df, 0x01 }, - { 0x2010, 0x0349, 0x00 }, { 0x2011, 0x0349, 0x00 }, +static struct vt_font_map font_mapping_bold[272] = { + { 0x0021, 0x0302, 0x0b }, { 0x002d, 0x0205, 0x00 }, + { 0x002e, 0x030e, 0x50 }, { 0x00a1, 0x035f, 0x07 }, + { 0x00aa, 0x0367, 0x03 }, { 0x00af, 0x036b, 0x07 }, + { 0x00b7, 0x0233, 0x00 }, { 0x00b8, 0x0373, 0x57 }, + { 0x0110, 0x038b, 0x00 }, { 0x0111, 0x03cb, 0x08 }, + { 0x011a, 0x03ce, 0x01 }, { 0x011c, 0x03d4, 0x59 }, + { 0x0178, 0x042e, 0x07 }, { 0x0186, 0x0436, 0x00 }, + { 0x018e, 0x0437, 0x02 }, { 0x0192, 0x043a, 0x00 }, + { 0x019d, 0x043b, 0x01 }, { 0x01b7, 0x043d, 0x00 }, + { 0x0218, 0x043e, 0x03 }, { 0x0232, 0x0442, 0x01 }, + { 0x0237, 0x0444, 0x00 }, { 0x0254, 0x0445, 0x00 }, + { 0x0258, 0x0446, 0x01 }, { 0x025b, 0x0448, 0x00 }, + { 0x0272, 0x0449, 0x00 }, { 0x0292, 0x044a, 0x00 }, + { 0x02bb, 0x044b, 0x02 }, { 0x02c6, 0x044e, 0x01 }, + { 0x02d8, 0x044f, 0x01 }, { 0x02db, 0x0451, 0x02 }, + { 0x0300, 0x0340, 0x00 }, { 0x0301, 0x0370, 0x00 }, + { 0x0302, 0x044e, 0x00 }, { 0x0303, 0x0452, 0x00 }, + { 0x0306, 0x044f, 0x00 }, { 0x030c, 0x044f, 0x00 }, + { 0x0329, 0x0454, 0x00 }, { 0x0384, 0x0455, 0x06 }, + { 0x038c, 0x045c, 0x00 }, { 0x038e, 0x045d, 0x02 }, + { 0x0391, 0x0321, 0x01 }, { 0x0393, 0x0460, 0x01 }, + { 0x0395, 0x0325, 0x00 }, { 0x0396, 0x033a, 0x00 }, + { 0x0397, 0x0328, 0x00 }, { 0x0398, 0x0462, 0x00 }, + { 0x0399, 0x0329, 0x00 }, { 0x039a, 0x032b, 0x00 }, + { 0x039b, 0x0463, 0x00 }, { 0x039c, 0x032d, 0x01 }, + { 0x039e, 0x0464, 0x00 }, { 0x039f, 0x032f, 0x00 }, + { 0x03a0, 0x0465, 0x00 }, { 0x03a1, 0x0330, 0x00 }, + { 0x03a3, 0x0466, 0x00 }, { 0x03a4, 0x0334, 0x00 }, + { 0x03a5, 0x0339, 0x00 }, { 0x03a6, 0x0467, 0x00 }, + { 0x03a7, 0x0338, 0x00 }, { 0x03a8, 0x0468, 0x01 }, + { 0x03aa, 0x038a, 0x00 }, { 0x03ab, 0x042e, 0x00 }, + { 0x03ac, 0x046a, 0x08 }, { 0x03b5, 0x0448, 0x00 }, + { 0x03b6, 0x0473, 0x00 }, { 0x03b7, 0x043c, 0x00 }, + { 0x03b8, 0x0474, 0x01 }, { 0x03ba, 0x03f0, 0x00 }, + { 0x03bb, 0x0476, 0x00 }, { 0x03bc, 0x0371, 0x00 }, + { 0x03bd, 0x0356, 0x00 }, { 0x03be, 0x0477, 0x00 }, + { 0x03bf, 0x034f, 0x00 }, { 0x03c0, 0x0478, 0x0b }, + { 0x03cc, 0x03ae, 0x00 }, { 0x03cd, 0x0484, 0x01 }, + { 0x03f3, 0x034a, 0x00 }, { 0x03f4, 0x0486, 0x00 }, + { 0x0400, 0x0383, 0x00 }, { 0x0401, 0x0386, 0x00 }, + { 0x0402, 0x0487, 0x02 }, { 0x0405, 0x0333, 0x00 }, + { 0x0406, 0x0329, 0x00 }, { 0x0407, 0x038a, 0x00 }, + { 0x0408, 0x032a, 0x00 }, { 0x0409, 0x048a, 0x06 }, + { 0x0410, 0x0321, 0x00 }, { 0x0411, 0x0491, 0x00 }, + { 0x0412, 0x0322, 0x00 }, { 0x0413, 0x0460, 0x00 }, + { 0x0414, 0x0492, 0x00 }, { 0x0415, 0x0325, 0x00 }, + { 0x0416, 0x0493, 0x00 }, { 0x0417, 0x0313, 0x00 }, + { 0x0418, 0x0494, 0x01 }, { 0x041a, 0x032b, 0x00 }, + { 0x041b, 0x0496, 0x00 }, { 0x041c, 0x032d, 0x00 }, + { 0x041d, 0x0328, 0x00 }, { 0x041e, 0x032f, 0x00 }, + { 0x041f, 0x0465, 0x00 }, { 0x0420, 0x0330, 0x00 }, + { 0x0421, 0x0323, 0x00 }, { 0x0422, 0x0334, 0x00 }, + { 0x0423, 0x0497, 0x01 }, { 0x0425, 0x0338, 0x00 }, + { 0x0426, 0x0499, 0x09 }, { 0x0430, 0x0341, 0x00 }, + { 0x0431, 0x04a3, 0x02 }, { 0x0434, 0x0347, 0x00 }, + { 0x0435, 0x0345, 0x00 }, { 0x0436, 0x04a6, 0x01 }, + { 0x0438, 0x0355, 0x00 }, { 0x0439, 0x0425, 0x00 }, + { 0x043a, 0x03f0, 0x00 }, { 0x043b, 0x04a8, 0x02 }, + { 0x043e, 0x034f, 0x00 }, { 0x043f, 0x0478, 0x00 }, + { 0x0440, 0x0350, 0x00 }, { 0x0441, 0x0343, 0x00 }, + { 0x0442, 0x04ab, 0x00 }, { 0x0443, 0x0359, 0x00 }, + { 0x0444, 0x04ac, 0x00 }, { 0x0445, 0x0358, 0x00 }, + { 0x0446, 0x04ad, 0x09 }, { 0x0450, 0x03a3, 0x00 }, + { 0x0451, 0x03a6, 0x00 }, { 0x0452, 0x04b7, 0x02 }, + { 0x0455, 0x0353, 0x00 }, { 0x0456, 0x0349, 0x00 }, + { 0x0457, 0x03aa, 0x00 }, { 0x0458, 0x034a, 0x00 }, + { 0x0459, 0x04ba, 0x01 }, { 0x045b, 0x03df, 0x00 }, + { 0x045c, 0x04bc, 0x00 }, { 0x045d, 0x03b4, 0x00 }, + { 0x045e, 0x04bd, 0x01 }, { 0x0490, 0x04bf, 0x0d }, + { 0x04a0, 0x04cd, 0x05 }, { 0x04aa, 0x04d3, 0x01 }, + { 0x04ae, 0x0339, 0x00 }, { 0x04af, 0x0471, 0x00 }, + { 0x04b0, 0x04d5, 0x03 }, { 0x04b6, 0x04d9, 0x05 }, + { 0x04d0, 0x03bd, 0x01 }, { 0x04d2, 0x037f, 0x00 }, + { 0x04d3, 0x039f, 0x00 }, { 0x04d4, 0x0381, 0x00 }, + { 0x04d5, 0x03a1, 0x00 }, { 0x04d6, 0x03ce, 0x01 }, + { 0x04d8, 0x0438, 0x00 }, { 0x04d9, 0x0447, 0x00 }, + { 0x04da, 0x04df, 0x05 }, { 0x04e2, 0x04e5, 0x00 }, + { 0x04e3, 0x0423, 0x00 }, { 0x04e4, 0x04e6, 0x00 }, + { 0x04e5, 0x03b7, 0x00 }, { 0x04e6, 0x0391, 0x00 }, + { 0x04e7, 0x03b1, 0x00 }, { 0x04e8, 0x0486, 0x00 }, + { 0x04e9, 0x04e7, 0x05 }, { 0x04ef, 0x0443, 0x00 }, + { 0x04f0, 0x04ed, 0x00 }, { 0x04f1, 0x03ba, 0x00 }, + { 0x04f2, 0x04ee, 0x03 }, { 0x04f8, 0x04f2, 0x01 }, + { 0x1e34, 0x04f4, 0x01 }, { 0x1eb8, 0x04f6, 0x01 }, + { 0x1ebc, 0x04f8, 0x01 }, { 0x1eca, 0x04fa, 0x03 }, + { 0x1ee4, 0x04fe, 0x01 }, { 0x1ef8, 0x0500, 0x01 }, + { 0x2010, 0x036a, 0x00 }, { 0x2011, 0x036a, 0x00 }, { 0x2012, 0x0205, 0x00 }, { 0x2013, 0x0205, 0x00 }, - { 0x2016, 0x04e1, 0x03 }, { 0x201a, 0x02ec, 0x00 }, - { 0x201b, 0x04e5, 0x06 }, { 0x2026, 0x04ec, 0x00 }, - { 0x2030, 0x04ed, 0x00 }, { 0x2032, 0x04ee, 0x01 }, - { 0x2039, 0x04f0, 0x01 }, { 0x203c, 0x04f2, 0x00 }, - { 0x203e, 0x04f3, 0x00 }, { 0x207f, 0x04f4, 0x00 }, - { 0x20a7, 0x04f5, 0x00 }, { 0x20ac, 0x04f6, 0x00 }, - { 0x20ae, 0x04f7, 0x00 }, { 0x210e, 0x0327, 0x00 }, - { 0x210f, 0x03be, 0x00 }, { 0x2126, 0x0448, 0x00 }, - { 0x2190, 0x04f8, 0x05 }, { 0x21a8, 0x04fe, 0x00 }, - { 0x21b5, 0x04ff, 0x00 }, { 0x21d0, 0x0500, 0x05 }, - { 0x2203, 0x0506, 0x00 }, { 0x2205, 0x0507, 0x00 }, - { 0x2206, 0x0440, 0x00 }, { 0x2208, 0x0508, 0x00 }, - { 0x220a, 0x0509, 0x00 }, { 0x2212, 0x0205, 0x00 }, - { 0x2219, 0x050a, 0x01 }, { 0x221e, 0x050c, 0x01 }, - { 0x2227, 0x050e, 0x03 }, { 0x2248, 0x0512, 0x00 }, - { 0x2260, 0x0513, 0x01 }, { 0x2264, 0x0515, 0x01 }, - { 0x2302, 0x0517, 0x00 }, { 0x2310, 0x0518, 0x00 }, - { 0x2320, 0x0519, 0x01 }, { 0x23ba, 0x051b, 0x02 }, - { 0x23bd, 0x02b4, 0x00 }, { 0x2409, 0x051e, 0x04 }, - { 0x2424, 0x0523, 0x00 }, { 0x2500, 0x024f, 0x00 }, - { 0x2501, 0x0524, 0x00 }, { 0x2502, 0x0251, 0x00 }, - { 0x2503, 0x0525, 0x00 }, { 0x2508, 0x0253, 0x00 }, - { 0x2509, 0x0526, 0x00 }, { 0x250a, 0x0255, 0x00 }, - { 0x250b, 0x0527, 0x00 }, { 0x250c, 0x0259, 0x00 }, - { 0x250d, 0x0528, 0x02 }, { 0x2510, 0x025d, 0x00 }, - { 0x2511, 0x052b, 0x02 }, { 0x2514, 0x0261, 0x00 }, - { 0x2515, 0x052e, 0x02 }, { 0x2518, 0x0265, 0x00 }, - { 0x2519, 0x0531, 0x02 }, { 0x251c, 0x026d, 0x00 }, - { 0x251d, 0x0534, 0x06 }, { 0x2524, 0x0275, 0x00 }, - { 0x2525, 0x053b, 0x06 }, { 0x252c, 0x027d, 0x00 }, - { 0x252d, 0x0542, 0x06 }, { 0x2534, 0x0285, 0x00 }, - { 0x2535, 0x0549, 0x06 }, { 0x253c, 0x0295, 0x00 }, - { 0x253d, 0x0550, 0x0e }, { 0x2550, 0x055f, 0x1c }, - { 0x25a0, 0x057c, 0x00 }, { 0x25ac, 0x057d, 0x00 }, - { 0x25ae, 0x057e, 0x00 }, { 0x25b2, 0x057f, 0x00 }, - { 0x25b6, 0x0580, 0x00 }, { 0x25bc, 0x0581, 0x00 }, - { 0x25c0, 0x0582, 0x00 }, { 0x25c6, 0x0583, 0x00 }, - { 0x25ca, 0x0584, 0x01 }, { 0x25d9, 0x0586, 0x00 }, - { 0x263c, 0x0587, 0x00 }, { 0x2640, 0x0588, 0x00 }, - { 0x2642, 0x0589, 0x00 }, { 0x2660, 0x058a, 0x00 }, - { 0x2663, 0x058b, 0x00 }, { 0x2666, 0x0583, 0x00 }, - { 0x266a, 0x058c, 0x01 }, { 0xf6be, 0x0423, 0x00 }, + { 0x2016, 0x0502, 0x03 }, { 0x201a, 0x030d, 0x00 }, + { 0x201b, 0x0506, 0x06 }, { 0x2026, 0x050d, 0x00 }, + { 0x2030, 0x050e, 0x00 }, { 0x2032, 0x050f, 0x01 }, + { 0x2039, 0x0511, 0x01 }, { 0x203c, 0x0513, 0x00 }, + { 0x203e, 0x0514, 0x00 }, { 0x207f, 0x0515, 0x00 }, + { 0x20a7, 0x0516, 0x00 }, { 0x20ac, 0x0517, 0x00 }, + { 0x20ae, 0x0518, 0x00 }, { 0x210e, 0x0348, 0x00 }, + { 0x210f, 0x03df, 0x00 }, { 0x2126, 0x0469, 0x00 }, + { 0x2190, 0x0519, 0x05 }, { 0x21a8, 0x051f, 0x00 }, + { 0x21b5, 0x0520, 0x00 }, { 0x21d0, 0x0521, 0x05 }, + { 0x2203, 0x0527, 0x00 }, { 0x2205, 0x0528, 0x00 }, + { 0x2206, 0x0461, 0x00 }, { 0x2208, 0x0529, 0x00 }, + { 0x220a, 0x052a, 0x00 }, { 0x2212, 0x0205, 0x00 }, + { 0x2219, 0x052b, 0x01 }, { 0x221e, 0x052d, 0x01 }, + { 0x2227, 0x052f, 0x03 }, { 0x2248, 0x0533, 0x00 }, + { 0x2260, 0x0534, 0x01 }, { 0x2264, 0x0536, 0x01 }, + { 0x2300, 0x0528, 0x00 }, { 0x2302, 0x0538, 0x00 }, + { 0x2310, 0x0539, 0x00 }, { 0x2320, 0x053a, 0x01 }, + { 0x23ba, 0x053c, 0x02 }, { 0x23bd, 0x02c4, 0x00 }, + { 0x2409, 0x053f, 0x04 }, { 0x2424, 0x0544, 0x00 }, + { 0x2500, 0x024f, 0x00 }, { 0x2501, 0x0545, 0x00 }, + { 0x2502, 0x0251, 0x00 }, { 0x2503, 0x0546, 0x00 }, + { 0x2508, 0x0253, 0x00 }, { 0x2509, 0x0547, 0x00 }, + { 0x250a, 0x0255, 0x00 }, { 0x250b, 0x0548, 0x00 }, + { 0x250c, 0x0259, 0x00 }, { 0x250d, 0x0549, 0x02 }, + { 0x2510, 0x025d, 0x00 }, { 0x2511, 0x054c, 0x02 }, + { 0x2514, 0x0261, 0x00 }, { 0x2515, 0x054f, 0x02 }, + { 0x2518, 0x0265, 0x00 }, { 0x2519, 0x0552, 0x02 }, + { 0x251c, 0x026d, 0x00 }, { 0x251d, 0x0555, 0x06 }, + { 0x2524, 0x0275, 0x00 }, { 0x2525, 0x055c, 0x06 }, + { 0x252c, 0x027d, 0x00 }, { 0x252d, 0x0563, 0x06 }, + { 0x2534, 0x0285, 0x00 }, { 0x2535, 0x056a, 0x06 }, + { 0x253c, 0x0295, 0x00 }, { 0x253d, 0x0571, 0x0e }, + { 0x2550, 0x0580, 0x20 }, { 0x2574, 0x05a1, 0x01 }, + { 0x2576, 0x02bd, 0x01 }, { 0x2578, 0x05a3, 0x07 }, + { 0x25a0, 0x05ab, 0x00 }, { 0x25ac, 0x05ac, 0x00 }, + { 0x25ae, 0x05ad, 0x00 }, { 0x25b2, 0x05ae, 0x00 }, + { 0x25b6, 0x05af, 0x00 }, { 0x25bc, 0x05b0, 0x00 }, + { 0x25c0, 0x05b1, 0x00 }, { 0x25c6, 0x05b2, 0x00 }, + { 0x25ca, 0x05b3, 0x01 }, { 0x25cf, 0x05b5, 0x00 }, + { 0x25d9, 0x05b6, 0x00 }, { 0x263c, 0x05b7, 0x00 }, + { 0x2640, 0x05b8, 0x00 }, { 0x2642, 0x05b9, 0x00 }, + { 0x2660, 0x05ba, 0x00 }, { 0x2663, 0x05bb, 0x00 }, + { 0x2666, 0x05b2, 0x00 }, { 0x266a, 0x05bc, 0x01 }, + { 0x2713, 0x02f8, 0x00 }, { 0x2714, 0x05be, 0x00 }, + { 0x2717, 0x02fa, 0x00 }, { 0x2718, 0x05bf, 0x00 }, + { 0xe0a0, 0x05c0, 0x02 }, { 0xe0b1, 0x05c3, 0x00 }, + { 0xe0b3, 0x05c4, 0x00 }, { 0xf6be, 0x0444, 0x00 }, }; struct vt_font vt_font_default = { @@ -2199,6 +2286,6 @@ struct vt_font vt_font_default = { font_mapping_bold, NULL, }, - .vf_map_count = { 248, 0, 260, 0 }, + .vf_map_count = { 252, 0, 272, 0 }, .vf_refcount = 1, }; From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 04:47:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 493132A7; Thu, 12 Jun 2014 04:47: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 343FD2E3D; Thu, 12 Jun 2014 04:47: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 s5C4lFG0009402; Thu, 12 Jun 2014 04:47:15 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5C4lFHF009401; Thu, 12 Jun 2014 04:47:15 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201406120447.s5C4lFHF009401@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 12 Jun 2014 04:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267382 - stable/10/sys/dev/vmware/vmxnet3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 04:47:15 -0000 Author: bryanv Date: Thu Jun 12 04:47:14 2014 New Revision: 267382 URL: http://svnweb.freebsd.org/changeset/base/267382 Log: MFC r267252, r267253: - Remove an unnecessary variable reassignment - Fix TSO support on VMware Fusion Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Thu Jun 12 01:33:01 2014 (r267381) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Thu Jun 12 04:47:14 2014 (r267382) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -2602,6 +2604,12 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t { struct ether_vlan_header *evh; int offset; +#if defined(INET) + struct ip *ip, iphdr; +#endif +#if defined(INET6) + struct ip6_hdr *ip6, ip6hdr; +#endif evh = mtod(m, struct ether_vlan_header *); if (evh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { @@ -2615,8 +2623,7 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t switch (*etype) { #if defined(INET) - case ETHERTYPE_IP: { - struct ip *ip, iphdr; + case ETHERTYPE_IP: if (__predict_false(m->m_len < offset + sizeof(struct ip))) { m_copydata(m, offset, sizeof(struct ip), (caddr_t) &iphdr); @@ -2626,10 +2633,16 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t *proto = ip->ip_p; *start = offset + (ip->ip_hl << 2); break; - } #endif #if defined(INET6) case ETHERTYPE_IPV6: + if (__predict_false(m->m_len < + offset + sizeof(struct ip6_hdr))) { + m_copydata(m, offset, sizeof(struct ip6_hdr), + (caddr_t) &ip6hdr); + ip6 = &ip6hdr; + } else + ip6 = mtodo(m, offset); *proto = -1; *start = ip6_lasthdr(m, offset, IPPROTO_IPV6, proto); /* Assert the network stack sent us a valid packet. */ @@ -2644,6 +2657,7 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t if (m->m_pkthdr.csum_flags & CSUM_TSO) { struct tcphdr *tcp, tcphdr; + uint16_t sum; if (__predict_false(*proto != IPPROTO_TCP)) { /* Likely failed to correctly parse the mbuf. */ @@ -2652,16 +2666,38 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t txq->vxtxq_stats.vmtxs_tso++; - /* - * For TSO, the size of the protocol header is also - * included in the descriptor header size. - */ + switch (*etype) { +#if defined(INET) + case ETHERTYPE_IP: + sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, + htons(IPPROTO_TCP)); + break; +#endif +#if defined(INET6) + case ETHERTYPE_IPV6: + sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); + break; +#endif + default: + sum = 0; + break; + } + if (m->m_len < *start + sizeof(struct tcphdr)) { - m_copydata(m, offset, sizeof(struct tcphdr), + m_copyback(m, *start + offsetof(struct tcphdr, th_sum), + sizeof(uint16_t), (caddr_t) &sum); + m_copydata(m, *start, sizeof(struct tcphdr), (caddr_t) &tcphdr); tcp = &tcphdr; - } else + } else { tcp = mtodo(m, *start); + tcp->th_sum = sum; + } + + /* + * For TSO, the size of the protocol header is also + * included in the descriptor header size. + */ *start += (tcp->th_off << 2); } else txq->vxtxq_stats.vmtxs_csum++; @@ -2755,7 +2791,7 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue } } - txr->vxtxr_txbuf[txr->vxtxr_head].vtxb_m = m = *m0; + txr->vxtxr_txbuf[txr->vxtxr_head].vtxb_m = m; sop = &txr->vxtxr_txd[txr->vxtxr_head]; gen = txr->vxtxr_gen ^ 1; /* Owned by cpu (yet) */ From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 13:13:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6D368DEF; Thu, 12 Jun 2014 13:13: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 578AA2A76; Thu, 12 Jun 2014 13:13: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 s5CDDJWl041248; Thu, 12 Jun 2014 13:13:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CDDFNm041223; Thu, 12 Jun 2014 13:13:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406121313.s5CDDFNm041223@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jun 2014 13:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267393 - in stable/10: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 13:13:19 -0000 Author: jhb Date: Thu Jun 12 13:13:15 2014 New Revision: 267393 URL: http://svnweb.freebsd.org/changeset/base/267393 Log: MFC 260239,261268,265058: Expand the support for PCI INTx interrupts including providing interrupt routing information for INTx interrupts to I/O APIC pins and enabling INTx interrupts in the virtio and AHCI backends. Added: stable/10/usr.sbin/bhyve/ioapic.c - copied unchanged from r261268, head/usr.sbin/bhyve/ioapic.c stable/10/usr.sbin/bhyve/ioapic.h - copied unchanged from r261268, head/usr.sbin/bhyve/ioapic.h Deleted: stable/10/usr.sbin/bhyve/legacy_irq.c stable/10/usr.sbin/bhyve/legacy_irq.h Modified: stable/10/lib/libvmmapi/vmmapi.c stable/10/lib/libvmmapi/vmmapi.h stable/10/sys/amd64/include/vmm_dev.h stable/10/sys/amd64/vmm/vmm_dev.c stable/10/usr.sbin/bhyve/Makefile stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/mptbl.c stable/10/usr.sbin/bhyve/pci_ahci.c stable/10/usr.sbin/bhyve/pci_emul.c stable/10/usr.sbin/bhyve/pci_emul.h stable/10/usr.sbin/bhyve/pci_uart.c stable/10/usr.sbin/bhyve/pci_virtio_block.c stable/10/usr.sbin/bhyve/pci_virtio_net.c stable/10/usr.sbin/bhyve/virtio.c stable/10/usr.sbin/bhyve/virtio.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.c Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/lib/libvmmapi/vmmapi.c Thu Jun 12 13:13:15 2014 (r267393) @@ -454,6 +454,13 @@ vm_ioapic_pulse_irq(struct vmctx *ctx, i } int +vm_ioapic_pincount(struct vmctx *ctx, int *pincount) +{ + + return (ioctl(ctx->fd, VM_IOAPIC_PINCOUNT, pincount)); +} + +int vm_inject_nmi(struct vmctx *ctx, int vcpu) { struct vm_nmi vmnmi; Modified: stable/10/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.h Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/lib/libvmmapi/vmmapi.h Thu Jun 12 13:13:15 2014 (r267393) @@ -72,6 +72,7 @@ int vm_lapic_msi(struct vmctx *ctx, uint int vm_ioapic_assert_irq(struct vmctx *ctx, int irq); int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); +int vm_ioapic_pincount(struct vmctx *ctx, int *pincount); int vm_inject_nmi(struct vmctx *ctx, int vcpu); int vm_capability_name2type(const char *capname); const char *vm_capability_type2name(int type); Modified: stable/10/sys/amd64/include/vmm_dev.h ============================================================================== --- stable/10/sys/amd64/include/vmm_dev.h Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/sys/amd64/include/vmm_dev.h Thu Jun 12 13:13:15 2014 (r267393) @@ -181,7 +181,8 @@ enum { IOCNUM_IOAPIC_DEASSERT_IRQ = 34, IOCNUM_IOAPIC_PULSE_IRQ = 35, IOCNUM_LAPIC_MSI = 36, - IOCNUM_LAPIC_LOCAL_IRQ = 37, + IOCNUM_LAPIC_LOCAL_IRQ = 37, + IOCNUM_IOAPIC_PINCOUNT = 38, /* PCI pass-thru */ IOCNUM_BIND_PPTDEV = 40, @@ -228,6 +229,8 @@ enum { _IOW('v', IOCNUM_IOAPIC_DEASSERT_IRQ, struct vm_ioapic_irq) #define VM_IOAPIC_PULSE_IRQ \ _IOW('v', IOCNUM_IOAPIC_PULSE_IRQ, struct vm_ioapic_irq) +#define VM_IOAPIC_PINCOUNT \ + _IOR('v', IOCNUM_IOAPIC_PINCOUNT, int) #define VM_SET_CAPABILITY \ _IOW('v', IOCNUM_SET_CAPABILITY, struct vm_capability) #define VM_GET_CAPABILITY \ Modified: stable/10/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_dev.c Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/sys/amd64/vmm/vmm_dev.c Thu Jun 12 13:13:15 2014 (r267393) @@ -318,6 +318,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long c ioapic_irq = (struct vm_ioapic_irq *)data; error = vioapic_pulse_irq(sc->vm, ioapic_irq->irq); break; + case VM_IOAPIC_PINCOUNT: + *(int *)data = vioapic_pincount(sc->vm); + break; case VM_MAP_MEMORY: seg = (struct vm_memory_segment *)data; error = vm_malloc(sc->vm, seg->gpa, seg->len); Modified: stable/10/usr.sbin/bhyve/Makefile ============================================================================== --- stable/10/usr.sbin/bhyve/Makefile Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/Makefile Thu Jun 12 13:13:15 2014 (r267393) @@ -7,11 +7,37 @@ PROG= bhyve DEBUG_FLAGS= -g -O0 MAN= bhyve.8 -SRCS= acpi.c atpic.c bhyverun.c block_if.c consport.c dbgport.c elcr.c -SRCS+= inout.c legacy_irq.c mem.c mevent.c mptbl.c pci_ahci.c -SRCS+= pci_emul.c pci_hostbridge.c pci_lpc.c pci_passthru.c pci_virtio_block.c -SRCS+= pci_virtio_net.c pci_uart.c pit_8254.c pm.c pmtmr.c post.c rtc.c -SRCS+= uart_emul.c virtio.c xmsr.c spinup_ap.c + +SRCS= \ + acpi.c \ + atpic.c \ + bhyverun.c \ + block_if.c \ + consport.c \ + dbgport.c \ + elcr.c \ + inout.c \ + ioapic.c \ + mem.c \ + mevent.c \ + mptbl.c \ + pci_ahci.c \ + pci_emul.c \ + pci_hostbridge.c \ + pci_lpc.c \ + pci_passthru.c \ + pci_virtio_block.c \ + pci_virtio_net.c \ + pci_uart.c \ + pit_8254.c \ + pm.c \ + pmtmr.c \ + post.c \ + rtc.c \ + uart_emul.c \ + virtio.c \ + xmsr.c \ + spinup_ap.c .PATH: ${.CURDIR}/../../sys/amd64/vmm SRCS+= vmm_instruction_emul.c Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/bhyverun.c Thu Jun 12 13:13:15 2014 (r267393) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #include "acpi.h" #include "inout.h" #include "dbgport.h" -#include "legacy_irq.h" +#include "ioapic.h" #include "mem.h" #include "mevent.h" #include "mptbl.h" @@ -695,7 +695,7 @@ main(int argc, char *argv[]) init_mem(); init_inout(); - legacy_irq_init(); + ioapic_init(ctx); rtc_init(ctx); Copied: stable/10/usr.sbin/bhyve/ioapic.c (from r261268, head/usr.sbin/bhyve/ioapic.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyve/ioapic.c Thu Jun 12 13:13:15 2014 (r267393, copy of r261268, head/usr.sbin/bhyve/ioapic.c) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2014 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include + +#include "ioapic.h" + +/* + * Assign PCI INTx interrupts to I/O APIC pins in a round-robin + * fashion. Note that we have no idea what the HPET is using, but the + * HPET is also programmable whereas this is intended for hardwired + * PCI interrupts. + * + * This assumes a single I/O APIC where pins >= 16 are permitted for + * PCI devices. + */ +static int pci_pins; + +void +ioapic_init(struct vmctx *ctx) +{ + + if (vm_ioapic_pincount(ctx, &pci_pins) < 0) { + pci_pins = 0; + return; + } + + /* Ignore the first 16 pins. */ + if (pci_pins <= 16) { + pci_pins = 0; + return; + } + pci_pins -= 16; +} + +int +ioapic_pci_alloc_irq(void) +{ + static int last_pin; + + if (pci_pins == 0) + return (-1); + return (16 + (last_pin++ % pci_pins)); +} Copied: stable/10/usr.sbin/bhyve/ioapic.h (from r261268, head/usr.sbin/bhyve/ioapic.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyve/ioapic.h Thu Jun 12 13:13:15 2014 (r267393, copy of r261268, head/usr.sbin/bhyve/ioapic.h) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2014 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _IOAPIC_H_ +#define _IOAPIC_H_ + +/* + * Allocate a PCI IRQ from the I/O APIC. + */ +void ioapic_init(struct vmctx *ctx); +int ioapic_pci_alloc_irq(void); + +#endif Modified: stable/10/usr.sbin/bhyve/mptbl.c ============================================================================== --- stable/10/usr.sbin/bhyve/mptbl.c Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/mptbl.c Thu Jun 12 13:13:15 2014 (r267393) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "acpi.h" #include "bhyverun.h" #include "mptbl.h" +#include "pci_emul.h" #define MPTABLE_BASE 0xF0000 @@ -75,9 +76,6 @@ __FBSDID("$FreeBSD$"); /* Number of local intr entries */ #define MPEII_NUM_LOCAL_IRQ 2 -/* Number of i/o intr entries */ -#define MPEII_MAX_IRQ 24 - /* Bus entry defines */ #define MPE_NUM_BUSES 2 #define MPE_BUSNAME_LEN 6 @@ -195,8 +193,42 @@ mpt_build_ioapic_entries(io_apic_entry_p mpei->apic_address = IOAPIC_PADDR; } +static int +mpt_count_ioint_entries(void) +{ + + /* + * Always include entries for the first 16 pins along with a entry + * for each active PCI INTx pin. + */ + return (16 + pci_count_lintr()); +} + static void -mpt_build_ioint_entries(int_entry_ptr mpie, int num_pins, int id) +mpt_generate_pci_int(int slot, int pin, int ioapic_irq, void *arg) +{ + int_entry_ptr *mpiep, mpie; + + mpiep = arg; + mpie = *mpiep; + memset(mpie, 0, sizeof(*mpie)); + + /* + * This is always after another I/O interrupt entry, so cheat + * and fetch the I/O APIC ID from the prior entry. + */ + mpie->type = MPCT_ENTRY_INT; + mpie->int_type = INTENTRY_TYPE_INT; + mpie->src_bus_id = 0; + mpie->src_bus_irq = slot << 2 | (pin - 1); + mpie->dst_apic_id = mpie[-1].dst_apic_id; + mpie->dst_apic_int = ioapic_irq; + + *mpiep = mpie + 1; +} + +static void +mpt_build_ioint_entries(int_entry_ptr mpie, int id) { int pin; @@ -206,8 +238,8 @@ mpt_build_ioint_entries(int_entry_ptr mp * just use the default config, tweek later if needed. */ - /* Run through all 16 pins. */ - for (pin = 0; pin < num_pins; pin++) { + /* First, generate the first 16 pins. */ + for (pin = 0; pin < 16; pin++) { memset(mpie, 0, sizeof(*mpie)); mpie->type = MPCT_ENTRY_INT; mpie->src_bus_id = 1; @@ -235,16 +267,6 @@ mpt_build_ioint_entries(int_entry_ptr mp mpie->int_type = INTENTRY_TYPE_INT; mpie->src_bus_irq = SCI_INT; break; - case 5: - case 10: - case 11: - /* - * PCI Irqs set to level triggered and active-lo. - */ - mpie->int_flags = INTENTRY_FLAGS_POLARITY_ACTIVELO | - INTENTRY_FLAGS_TRIGGER_LEVEL; - mpie->src_bus_id = 0; - /* fall through.. */ default: /* All other pins are identity mapped. */ mpie->int_type = INTENTRY_TYPE_INT; @@ -254,6 +276,8 @@ mpt_build_ioint_entries(int_entry_ptr mp mpie++; } + /* Next, generate entries for any PCI INTx interrupts. */ + pci_walk_lintr(mpt_generate_pci_int, &mpie); } void @@ -273,6 +297,7 @@ mptable_build(struct vmctx *ctx, int ncp proc_entry_ptr mpep; mpfps_t mpfp; int_entry_ptr mpie; + int ioints; char *curraddr; char *startaddr; @@ -307,9 +332,10 @@ mptable_build(struct vmctx *ctx, int ncp mpch->entry_count++; mpie = (int_entry_ptr) curraddr; - mpt_build_ioint_entries(mpie, MPEII_MAX_IRQ, 0); - curraddr += sizeof(*mpie) * MPEII_MAX_IRQ; - mpch->entry_count += MPEII_MAX_IRQ; + ioints = mpt_count_ioint_entries(); + mpt_build_ioint_entries(mpie, 0); + curraddr += sizeof(*mpie) * ioints; + mpch->entry_count += ioints; mpie = (int_entry_ptr)curraddr; mpt_build_localint_entries(mpie); Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Thu Jun 12 13:13:15 2014 (r267393) @@ -192,6 +192,7 @@ struct pci_ahci_softc { uint32_t em_ctl; uint32_t cap2; uint32_t bohc; + uint32_t lintr; struct ahci_port port[MAX_PORTS]; }; #define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) @@ -211,8 +212,11 @@ static inline void lba_to_msf(uint8_t *b static void ahci_generate_intr(struct pci_ahci_softc *sc) { + struct pci_devinst *pi; int i; + pi = sc->asc_pi; + for (i = 0; i < sc->ports; i++) { struct ahci_port *pr; pr = &sc->port[i]; @@ -222,8 +226,28 @@ ahci_generate_intr(struct pci_ahci_softc DPRINTF("%s %x\n", __func__, sc->is); - if (sc->is && (sc->ghc & AHCI_GHC_IE)) - pci_generate_msi(sc->asc_pi, 0); + if (sc->is && (sc->ghc & AHCI_GHC_IE)) { + if (pci_msi_enabled(pi)) { + /* + * Generate an MSI interrupt on every edge + */ + pci_generate_msi(pi, 0); + } else if (!sc->lintr) { + /* + * Only generate a pin-based interrupt if one wasn't + * in progress + */ + sc->lintr = 1; + pci_lintr_assert(pi); + } + } else if (sc->lintr) { + /* + * No interrupts: deassert pin-based signal if it had + * been asserted + */ + pci_lintr_deassert(pi); + sc->lintr = 0; + } } static void @@ -367,6 +391,12 @@ ahci_reset(struct pci_ahci_softc *sc) sc->ghc = AHCI_GHC_AE; sc->is = 0; + + if (sc->lintr) { + pci_lintr_deassert(sc->asc_pi); + sc->lintr = 0; + } + for (i = 0; i < sc->ports; i++) { sc->port[i].ie = 0; sc->port[i].is = 0; @@ -1815,6 +1845,8 @@ pci_ahci_init(struct vmctx *ctx, struct pci_emul_alloc_bar(pi, 5, PCIBAR_MEM32, AHCI_OFFSET + sc->ports * AHCI_STEP); + pci_lintr_request(pi); + open_fail: if (ret) { blockif_close(sc->port[0].bctx); Modified: stable/10/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.c Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/pci_emul.c Thu Jun 12 13:13:15 2014 (r267393) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -47,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include "acpi.h" #include "bhyverun.h" #include "inout.h" -#include "legacy_irq.h" +#include "ioapic.h" #include "mem.h" #include "pci_emul.h" #include "pci_lpc.h" @@ -71,11 +72,21 @@ do { \ #define MAXSLOTS (PCI_SLOTMAX + 1) #define MAXFUNCS (PCI_FUNCMAX + 1) -static struct slotinfo { - char *si_name; - char *si_param; - struct pci_devinst *si_devi; -} pci_slotinfo[MAXSLOTS][MAXFUNCS]; +struct funcinfo { + char *fi_name; + char *fi_param; + struct pci_devinst *fi_devi; +}; + +struct intxinfo { + int ii_count; + int ii_ioapic_irq; +}; + +struct slotinfo { + struct intxinfo si_intpins[4]; + struct funcinfo si_funcs[MAXFUNCS]; +} pci_slotinfo[MAXSLOTS]; SET_DECLARE(pci_devemu_set, struct pci_devemu); @@ -92,6 +103,7 @@ static uint64_t pci_emul_membase64; #define PCI_EMUL_MEMLIMIT64 0xFD00000000UL static struct pci_devemu *pci_emul_finddev(char *name); +static void pci_lintr_update(struct pci_devinst *pi); static int pci_emul_devices; static struct mem_range pci_mem_hole; @@ -154,7 +166,7 @@ pci_parse_slot(char *opt) goto done; } - if (pci_slotinfo[snum][fnum].si_name != NULL) { + if (pci_slotinfo[snum].si_funcs[fnum].fi_name != NULL) { fprintf(stderr, "pci slot %d:%d already occupied!\n", snum, fnum); goto done; @@ -167,8 +179,8 @@ pci_parse_slot(char *opt) } error = 0; - pci_slotinfo[snum][fnum].si_name = emul; - pci_slotinfo[snum][fnum].si_param = config; + pci_slotinfo[snum].si_funcs[fnum].fi_name = emul; + pci_slotinfo[snum].si_funcs[fnum].fi_param = config; done: if (error) @@ -666,7 +678,10 @@ pci_emul_init(struct vmctx *ctx, struct pdi->pi_bus = 0; pdi->pi_slot = slot; pdi->pi_func = func; - pdi->pi_lintr_pin = -1; + pthread_mutex_init(&pdi->pi_lintr.lock, NULL); + pdi->pi_lintr.pin = 0; + pdi->pi_lintr.state = IDLE; + pdi->pi_lintr.ioapic_irq = 0; pdi->pi_d = pde; snprintf(pdi->pi_name, PI_NAMESZ, "%s-pci-%d", pde->pe_emu, slot); @@ -682,7 +697,7 @@ pci_emul_init(struct vmctx *ctx, struct free(pdi); } else { pci_emul_devices++; - pci_slotinfo[slot][func].si_devi = pdi; + pci_slotinfo[slot].si_funcs[func].fi_devi = pdi; } return (err); @@ -816,6 +831,7 @@ msixcap_cfgwrite(struct pci_devinst *pi, pi->pi_msix.enabled = val & PCIM_MSIXCTRL_MSIX_ENABLE; pi->pi_msix.function_mask = val & PCIM_MSIXCTRL_FUNCTION_MASK; + pci_lintr_update(pi); } CFGWRITE(pi, offset, val, bytes); @@ -854,6 +870,7 @@ msicap_cfgwrite(struct pci_devinst *pi, } else { pi->pi_msi.maxmsgnum = 0; } + pci_lintr_update(pi); } CFGWRITE(pi, offset, val, bytes); @@ -993,7 +1010,7 @@ int init_pci(struct vmctx *ctx) { struct pci_devemu *pde; - struct slotinfo *si; + struct funcinfo *fi; size_t lowmem; int slot, func; int error; @@ -1004,12 +1021,12 @@ init_pci(struct vmctx *ctx) for (slot = 0; slot < MAXSLOTS; slot++) { for (func = 0; func < MAXFUNCS; func++) { - si = &pci_slotinfo[slot][func]; - if (si->si_name != NULL) { - pde = pci_emul_finddev(si->si_name); + fi = &pci_slotinfo[slot].si_funcs[func]; + if (fi->fi_name != NULL) { + pde = pci_emul_finddev(fi->fi_name); assert(pde != NULL); error = pci_emul_init(ctx, pde, slot, func, - si->si_param); + fi->fi_param); if (error) return (error); } @@ -1042,11 +1059,27 @@ init_pci(struct vmctx *ctx) return (0); } +static void +pci_prt_entry(int slot, int pin, int ioapic_irq, void *arg) +{ + int *count; + + count = arg; + dsdt_line(" Package (0x04)"); + dsdt_line(" {"); + dsdt_line(" 0x%X,", slot << 16 | 0xffff); + dsdt_line(" 0x%02X,", pin - 1); + dsdt_line(" Zero,"); + dsdt_line(" 0x%X", ioapic_irq); + dsdt_line(" }%s", *count == 1 ? "" : ","); + (*count)--; +} + void pci_write_dsdt(void) { struct pci_devinst *pi; - int slot, func; + int count, slot, func; dsdt_indent(1); dsdt_line("Scope (_SB)"); @@ -1107,11 +1140,20 @@ pci_write_dsdt(void) PCI_EMUL_MEMLIMIT64 - PCI_EMUL_MEMBASE64); dsdt_line(" ,, , AddressRangeMemory, TypeStatic)"); dsdt_line(" })"); + count = pci_count_lintr(); + if (count != 0) { + dsdt_indent(2); + dsdt_line("Name (_PRT, Package (0x%02X)", count); + dsdt_line("{"); + pci_walk_lintr(pci_prt_entry, &count); + dsdt_line("})"); + dsdt_unindent(2); + } dsdt_indent(2); for (slot = 0; slot < MAXSLOTS; slot++) { for (func = 0; func < MAXFUNCS; func++) { - pi = pci_slotinfo[slot][func].si_devi; + pi = pci_slotinfo[slot].si_funcs[func].fi_devi; if (pi != NULL && pi->pi_d->pe_write_dsdt != NULL) pi->pi_d->pe_write_dsdt(pi); } @@ -1176,18 +1218,54 @@ pci_generate_msi(struct pci_devinst *pi, } } +static bool +pci_lintr_permitted(struct pci_devinst *pi) +{ + uint16_t cmd; + + cmd = pci_get_cfgdata16(pi, PCIR_COMMAND); + return (!(pi->pi_msi.enabled || pi->pi_msix.enabled || + (cmd & PCIM_CMD_INTxDIS))); +} + int -pci_lintr_request(struct pci_devinst *pi, int req) +pci_lintr_request(struct pci_devinst *pi) { - int irq; + struct slotinfo *si; + int bestpin, bestcount, irq, pin; - irq = legacy_irq_alloc(req); - if (irq < 0) - return (-1); + /* + * First, allocate a pin from our slot. + */ + si = &pci_slotinfo[pi->pi_slot]; + bestpin = 0; + bestcount = si->si_intpins[0].ii_count; + for (pin = 1; pin < 4; pin++) { + if (si->si_intpins[pin].ii_count < bestcount) { + bestpin = pin; + bestcount = si->si_intpins[pin].ii_count; + } + } + + /* + * Attempt to allocate an I/O APIC pin for this intpin. If + * 8259A support is added we will need a separate field to + * assign the intpin to an input pin on the PCI interrupt + * router. + */ + if (si->si_intpins[bestpin].ii_count == 0) { + irq = ioapic_pci_alloc_irq(); + if (irq < 0) + return (-1); + si->si_intpins[bestpin].ii_ioapic_irq = irq; + } else + irq = si->si_intpins[bestpin].ii_ioapic_irq; + si->si_intpins[bestpin].ii_count++; - pi->pi_lintr_pin = irq; + pi->pi_lintr.pin = bestpin + 1; + pi->pi_lintr.ioapic_irq = irq; pci_set_cfgdata8(pi, PCIR_INTLINE, irq); - pci_set_cfgdata8(pi, PCIR_INTPIN, 1); + pci_set_cfgdata8(pi, PCIR_INTPIN, bestpin + 1); return (0); } @@ -1195,23 +1273,77 @@ void pci_lintr_assert(struct pci_devinst *pi) { - assert(pi->pi_lintr_pin >= 0); + assert(pi->pi_lintr.pin > 0); - if (pi->pi_lintr_state == 0) { - pi->pi_lintr_state = 1; - vm_ioapic_assert_irq(pi->pi_vmctx, pi->pi_lintr_pin); + pthread_mutex_lock(&pi->pi_lintr.lock); + if (pi->pi_lintr.state == IDLE) { + if (pci_lintr_permitted(pi)) { + pi->pi_lintr.state = ASSERTED; + vm_ioapic_assert_irq(pi->pi_vmctx, + pi->pi_lintr.ioapic_irq); + } else + pi->pi_lintr.state = PENDING; } + pthread_mutex_unlock(&pi->pi_lintr.lock); } void pci_lintr_deassert(struct pci_devinst *pi) { - assert(pi->pi_lintr_pin >= 0); + assert(pi->pi_lintr.pin > 0); + + pthread_mutex_lock(&pi->pi_lintr.lock); + if (pi->pi_lintr.state == ASSERTED) { + pi->pi_lintr.state = IDLE; + vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); + } else if (pi->pi_lintr.state == PENDING) + pi->pi_lintr.state = IDLE; + pthread_mutex_unlock(&pi->pi_lintr.lock); +} + +static void +pci_lintr_update(struct pci_devinst *pi) +{ - if (pi->pi_lintr_state == 1) { - pi->pi_lintr_state = 0; - vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr_pin); + pthread_mutex_lock(&pi->pi_lintr.lock); + if (pi->pi_lintr.state == ASSERTED && !pci_lintr_permitted(pi)) { + vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); + pi->pi_lintr.state = PENDING; + } else if (pi->pi_lintr.state == PENDING && pci_lintr_permitted(pi)) { + pi->pi_lintr.state = ASSERTED; + vm_ioapic_assert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); + } + pthread_mutex_unlock(&pi->pi_lintr.lock); +} + +int +pci_count_lintr(void) +{ + int count, slot, pin; + + count = 0; + for (slot = 0; slot < MAXSLOTS; slot++) { + for (pin = 0; pin < 4; pin++) { + if (pci_slotinfo[slot].si_intpins[pin].ii_count != 0) + count++; + } + } + return (count); +} + +void +pci_walk_lintr(pci_lintr_cb cb, void *arg) +{ + struct intxinfo *ii; + int slot, pin; + + for (slot = 0; slot < MAXSLOTS; slot++) { + for (pin = 0; pin < 4; pin++) { + ii = &pci_slotinfo[slot].si_intpins[pin]; + if (ii->ii_count != 0) + cb(slot, pin + 1, ii->ii_ioapic_irq, arg); + } } } @@ -1226,7 +1358,7 @@ pci_emul_is_mfdev(int slot) numfuncs = 0; for (f = 0; f < MAXFUNCS; f++) { - if (pci_slotinfo[slot][f].si_devi != NULL) { + if (pci_slotinfo[slot].si_funcs[f].fi_devi != NULL) { numfuncs++; } } @@ -1348,6 +1480,12 @@ pci_emul_cmdwrite(struct pci_devinst *pi assert(0); } } + + /* + * If INTx has been unmasked and is pending, assert the + * interrupt. + */ + pci_lintr_update(pi); } static int @@ -1362,7 +1500,7 @@ pci_emul_cfgdata(struct vmctx *ctx, int assert(bytes == 1 || bytes == 2 || bytes == 4); if (cfgbus == 0) - pi = pci_slotinfo[cfgslot][cfgfunc].si_devi; + pi = pci_slotinfo[cfgslot].si_funcs[cfgfunc].fi_devi; else pi = NULL; Modified: stable/10/usr.sbin/bhyve/pci_emul.h ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.h Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/pci_emul.h Thu Jun 12 13:13:15 2014 (r267393) @@ -32,6 +32,7 @@ #include #include #include +#include #include @@ -102,16 +103,27 @@ struct msix_table_entry { #define MAX_MSIX_TABLE_ENTRIES 2048 #define PBA_TABLE_ENTRY_SIZE 8 +enum lintr_stat { + IDLE, + ASSERTED, + PENDING +}; + struct pci_devinst { struct pci_devemu *pi_d; struct vmctx *pi_vmctx; uint8_t pi_bus, pi_slot, pi_func; - int8_t pi_lintr_pin; - int8_t pi_lintr_state; char pi_name[PI_NAMESZ]; int pi_bar_getsize; struct { + int8_t pin; + enum lintr_stat state; + int ioapic_irq; + pthread_mutex_t lock; + } pi_lintr; + + struct { int enabled; uint64_t addr; uint64_t msg_data; @@ -187,6 +199,8 @@ struct pciecap { uint16_t slot_status2; } __packed; +typedef void (*pci_lintr_cb)(int slot, int pin, int ioapic_irq, void *arg); + int init_pci(struct vmctx *ctx); void msicap_cfgwrite(struct pci_devinst *pi, int capoff, int offset, int bytes, uint32_t val); @@ -203,7 +217,7 @@ void pci_generate_msi(struct pci_devinst void pci_generate_msix(struct pci_devinst *pi, int msgnum); void pci_lintr_assert(struct pci_devinst *pi); void pci_lintr_deassert(struct pci_devinst *pi); -int pci_lintr_request(struct pci_devinst *pi, int ivec); +int pci_lintr_request(struct pci_devinst *pi); int pci_msi_enabled(struct pci_devinst *pi); int pci_msix_enabled(struct pci_devinst *pi); int pci_msix_table_bar(struct pci_devinst *pi); @@ -215,6 +229,8 @@ int pci_emul_add_msixcap(struct pci_devi int pci_emul_msix_twrite(struct pci_devinst *pi, uint64_t offset, int size, uint64_t value); uint64_t pci_emul_msix_tread(struct pci_devinst *pi, uint64_t offset, int size); +int pci_count_lintr(void); +void pci_walk_lintr(pci_lintr_cb cb, void *arg); void pci_write_dsdt(void); static __inline void Modified: stable/10/usr.sbin/bhyve/pci_uart.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_uart.c Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/pci_uart.c Thu Jun 12 13:13:15 2014 (r267393) @@ -91,7 +91,7 @@ pci_uart_init(struct vmctx *ctx, struct struct uart_softc *sc; pci_emul_alloc_bar(pi, 0, PCIBAR_IO, UART_IO_BAR_SIZE); - pci_lintr_request(pi, -1); + pci_lintr_request(pi); /* initialize config space */ pci_set_cfgdata16(pi, PCIR_DEVICE, COM_DEV); Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Thu Jun 12 13:13:15 2014 (r267393) @@ -117,6 +117,7 @@ static int pci_vtblk_debug; */ struct pci_vtblk_softc { struct virtio_softc vbsc_vs; + pthread_mutex_t vsc_mtx; struct vqueue_info vbsc_vq; int vbsc_fd; struct vtblk_config vbsc_cfg; @@ -304,8 +305,12 @@ pci_vtblk_init(struct vmctx *ctx, struct /* record fd of storage device/file */ sc->vbsc_fd = fd; + pthread_mutex_init(&sc->vsc_mtx, NULL); + /* init virtio softc and virtqueues */ vi_softc_linkup(&sc->vbsc_vs, &vtblk_vi_consts, sc, pi, &sc->vbsc_vq); + sc->vbsc_vs.vs_mtx = &sc->vsc_mtx; + sc->vbsc_vq.vq_qsize = VTBLK_RINGSZ; /* sc->vbsc_vq.vq_notify = we have no per-queue notify */ @@ -339,6 +344,8 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_STORAGE); pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_BLOCK); + pci_lintr_request(pi); + if (vi_intr_init(&sc->vbsc_vs, 1, fbsdrun_virtio_msix())) return (1); vi_set_io_bar(&sc->vbsc_vs, 0); Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_net.c Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/pci_virtio_net.c Thu Jun 12 13:13:15 2014 (r267393) @@ -519,6 +519,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pthread_mutex_init(&sc->vsc_mtx, NULL); vi_softc_linkup(&sc->vsc_vs, &vtnet_vi_consts, sc, pi, sc->vsc_queues); + sc->vsc_vs.vs_mtx = &sc->vsc_mtx; + sc->vsc_queues[VTNET_RXQ].vq_qsize = VTNET_RINGSZ; sc->vsc_queues[VTNET_RXQ].vq_notify = pci_vtnet_ping_rxq; sc->vsc_queues[VTNET_TXQ].vq_qsize = VTNET_RINGSZ; @@ -608,6 +610,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_NETWORK); pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_NET); + pci_lintr_request(pi); + /* link always up */ sc->vsc_config.status = 1; Modified: stable/10/usr.sbin/bhyve/virtio.c ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.c Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/virtio.c Thu Jun 12 13:13:15 2014 (r267393) @@ -99,7 +99,11 @@ vi_reset_dev(struct virtio_softc *vs) vs->vs_negotiated_caps = 0; vs->vs_curq = 0; /* vs->vs_status = 0; -- redundant */ + VS_LOCK(vs); + if (vs->vs_isr) + pci_lintr_deassert(vs->vs_pi); vs->vs_isr = 0; + VS_UNLOCK(vs); vs->vs_msix_cfg_idx = VIRTIO_MSI_NO_VECTOR; } @@ -137,11 +141,10 @@ vi_intr_init(struct virtio_softc *vs, in nvec = vs->vs_vc->vc_nvq + 1; if (pci_emul_add_msixcap(vs->vs_pi, nvec, barnum)) return (1); - } else { + } else vs->vs_flags &= ~VIRTIO_USE_MSIX; - /* Only 1 MSI vector for bhyve */ - pci_emul_add_msicap(vs->vs_pi, 1); - } + /* Only 1 MSI vector for bhyve */ + pci_emul_add_msicap(vs->vs_pi, 1); return (0); } @@ -591,6 +594,8 @@ bad: case VTCFG_R_ISR: value = vs->vs_isr; vs->vs_isr = 0; /* a read clears this flag */ + if (value) + pci_lintr_deassert(pi); break; case VTCFG_R_CFGVEC: value = vs->vs_msix_cfg_idx; Modified: stable/10/usr.sbin/bhyve/virtio.h ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.h Thu Jun 12 12:43:48 2014 (r267392) +++ stable/10/usr.sbin/bhyve/virtio.h Thu Jun 12 13:13:15 2014 (r267393) @@ -328,6 +328,18 @@ struct virtio_softc { uint16_t vs_msix_cfg_idx; /* MSI-X vector for config event */ }; +#define VS_LOCK(vs) \ +do { \ + if (vs->vs_mtx) \ + pthread_mutex_lock(vs->vs_mtx); \ +} while (0) + +#define VS_UNLOCK(vs) \ +do { \ + if (vs->vs_mtx) \ + pthread_mutex_unlock(vs->vs_mtx); \ +} while (0) + struct virtio_consts { const char *vc_name; /* name of driver (for diagnostics) */ int vc_nvq; /* number of virtual queues */ @@ -431,11 +443,14 @@ static inline void vq_interrupt(struct virtio_softc *vs, struct vqueue_info *vq) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 13:17:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 74289F7C; Thu, 12 Jun 2014 13:17: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 60D2F2AAA; Thu, 12 Jun 2014 13:17: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 s5CDHCWD041931; Thu, 12 Jun 2014 13:17:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CDHC1v041930; Thu, 12 Jun 2014 13:17:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406121317.s5CDHC1v041930@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jun 2014 13:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267394 - stable/10/usr.sbin/bhyveload X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 13:17:12 -0000 Author: jhb Date: Thu Jun 12 13:17:11 2014 New Revision: 267394 URL: http://svnweb.freebsd.org/changeset/base/267394 Log: MFC 261229: o Fix typo, sort .Xrs. PR: docs/186191 Modified: stable/10/usr.sbin/bhyveload/bhyveload.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyveload/bhyveload.8 ============================================================================== --- stable/10/usr.sbin/bhyveload/bhyveload.8 Thu Jun 12 13:13:15 2014 (r267393) +++ stable/10/usr.sbin/bhyveload/bhyveload.8 Thu Jun 12 13:17:11 2014 (r267394) @@ -134,10 +134,10 @@ device .Dl "bhyveload -m 256MB -h /usr/images/test -c /dev/nmdm1B test-vm" .Sh SEE ALSO .Xr bhyve 4 , +.Xr nmdm 4 , +.Xr vmm 4 , .Xr bhyve 8 , -.Xr loader 8 , -.Xr nmdm 4, -.Xr vmm 4 +.Xr loader 8 .Sh HISTORY .Nm first appeared in From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 13:48:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C1253A03; Thu, 12 Jun 2014 13:48: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 ADF052E1D; Thu, 12 Jun 2014 13:48: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 s5CDmqWg055455; Thu, 12 Jun 2014 13:48:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CDmqdM055454; Thu, 12 Jun 2014 13:48:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406121348.s5CDmqdM055454@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jun 2014 13:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267396 - stable/10/sys/amd64/vmm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 13:48:53 -0000 Author: jhb Date: Thu Jun 12 13:48:52 2014 New Revision: 267396 URL: http://svnweb.freebsd.org/changeset/base/267396 Log: MFC 261503,264501: Emulate the byte move and zero/sign extend instructions. Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_instruction_emul.c Thu Jun 12 13:33:01 2014 (r267395) +++ stable/10/sys/amd64/vmm/vmm_instruction_emul.c Thu Jun 12 13:48:52 2014 (r267396) @@ -58,8 +58,11 @@ enum cpu_mode { enum { VIE_OP_TYPE_NONE = 0, VIE_OP_TYPE_MOV, + VIE_OP_TYPE_MOVSX, + VIE_OP_TYPE_MOVZX, VIE_OP_TYPE_AND, VIE_OP_TYPE_OR, + VIE_OP_TYPE_TWO_BYTE, VIE_OP_TYPE_LAST }; @@ -67,7 +70,22 @@ enum { #define VIE_OP_F_IMM (1 << 0) /* immediate operand present */ #define VIE_OP_F_IMM8 (1 << 1) /* 8-bit immediate operand */ +static const struct vie_op two_byte_opcodes[256] = { + [0xB6] = { + .op_byte = 0xB6, + .op_type = VIE_OP_TYPE_MOVZX, + }, + [0xBE] = { + .op_byte = 0xBE, + .op_type = VIE_OP_TYPE_MOVSX, + }, +}; + static const struct vie_op one_byte_opcodes[256] = { + [0x0F] = { + .op_byte = 0x0F, + .op_type = VIE_OP_TYPE_TWO_BYTE + }, [0x88] = { .op_byte = 0x88, .op_type = VIE_OP_TYPE_MOV, @@ -313,6 +331,85 @@ emulate_mov(void *vm, int vcpuid, uint64 return (error); } +/* + * The following simplifying assumptions are made during emulation: + * + * - guest is in 64-bit mode + * - default address size is 64-bits + * - default operand size is 32-bits + * + * - operand size override is not supported + * + * - address size override is not supported + */ +static int +emulate_movx(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; + enum vm_reg_name reg; + uint64_t val; + + size = 4; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0xB6: + /* + * MOV and zero extend byte from mem (ModRM:r/m) to + * reg (ModRM:reg). + * + * 0F B6/r movzx r/m8, r32 + * REX.W + 0F B6/r movzx r/m8, r64 + */ + + /* get the first operand */ + error = memread(vm, vcpuid, gpa, &val, 1, arg); + if (error) + break; + + /* get the second operand */ + reg = gpr_map[vie->reg]; + + if (vie->rex_w) + size = 8; + + /* write the result */ + error = vie_update_register(vm, vcpuid, reg, val, size); + break; + case 0xBE: + /* + * MOV and sign extend byte from mem (ModRM:r/m) to + * reg (ModRM:reg). + * + * 0F BE/r movsx r/m8, r32 + * REX.W + 0F BE/r movsx r/m8, r64 + */ + + /* get the first operand */ + error = memread(vm, vcpuid, gpa, &val, 1, arg); + if (error) + break; + + /* get the second operand */ + reg = gpr_map[vie->reg]; + + if (vie->rex_w) + size = 8; + + /* sign extend byte */ + val = (int8_t)val; + + /* write the result */ + error = vie_update_register(vm, vcpuid, reg, val, size); + break; + default: + break; + } + return (error); +} + static int emulate_and(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -447,6 +544,11 @@ vmm_emulate_instruction(void *vm, int vc error = emulate_mov(vm, vcpuid, gpa, vie, memread, memwrite, memarg); break; + case VIE_OP_TYPE_MOVSX: + case VIE_OP_TYPE_MOVZX: + error = emulate_movx(vm, vcpuid, gpa, vie, + memread, memwrite, memarg); + break; case VIE_OP_TYPE_AND: error = emulate_and(vm, vcpuid, gpa, vie, memread, memwrite, memarg); @@ -609,6 +711,23 @@ decode_rex(struct vie *vie) } static int +decode_two_byte_opcode(struct vie *vie) +{ + uint8_t x; + + if (vie_peek(vie, &x)) + return (-1); + + vie->op = two_byte_opcodes[x]; + + if (vie->op.op_type == VIE_OP_TYPE_NONE) + return (-1); + + vie_advance(vie); + return (0); +} + +static int decode_opcode(struct vie *vie) { uint8_t x; @@ -622,6 +741,10 @@ decode_opcode(struct vie *vie) return (-1); vie_advance(vie); + + if (vie->op.op_type == VIE_OP_TYPE_TWO_BYTE) + return (decode_two_byte_opcode(vie)); + return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 15:21:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B5B3D3E9; Thu, 12 Jun 2014 15:21: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 9F45A2818; Thu, 12 Jun 2014 15:21: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 s5CFL2iO099503; Thu, 12 Jun 2014 15:21:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CFKxvA099459; Thu, 12 Jun 2014 15:20:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406121520.s5CFKxvA099459@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jun 2014 15:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267399 - in stable/10: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/boot/common sys/boot/userboot/userboot usr.sbin/bhyveload X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 15:21:02 -0000 Author: jhb Date: Thu Jun 12 15:20:59 2014 New Revision: 267399 URL: http://svnweb.freebsd.org/changeset/base/267399 Log: MFC 261504: Add support for FreeBSD/i386 guests under bhyve. Added: stable/10/sys/boot/userboot/userboot/biossmap.c - copied unchanged from r261504, head/sys/boot/userboot/userboot/biossmap.c Modified: stable/10/lib/libvmmapi/vmmapi.h stable/10/lib/libvmmapi/vmmapi_freebsd.c stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/include/vmm_instruction_emul.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_instruction_emul.c stable/10/sys/boot/common/load_elf32.c stable/10/sys/boot/common/load_elf32_obj.c stable/10/sys/boot/userboot/userboot/Makefile stable/10/sys/boot/userboot/userboot/bootinfo32.c stable/10/sys/boot/userboot/userboot/bootinfo64.c stable/10/sys/boot/userboot/userboot/elf32_freebsd.c stable/10/sys/boot/userboot/userboot/libuserboot.h stable/10/usr.sbin/bhyveload/bhyveload.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.h Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/lib/libvmmapi/vmmapi.h Thu Jun 12 15:20:59 2014 (r267399) @@ -111,5 +111,8 @@ int vcpu_reset(struct vmctx *ctx, int vc int vm_setup_freebsd_registers(struct vmctx *ctx, int vcpu, uint64_t rip, uint64_t cr3, uint64_t gdtbase, uint64_t rsp); +int vm_setup_freebsd_registers_i386(struct vmctx *vmctx, int vcpu, + uint32_t eip, uint32_t gdtbase, + uint32_t esp); void vm_setup_freebsd_gdt(uint64_t *gdtr); #endif /* _VMMAPI_H_ */ Modified: stable/10/lib/libvmmapi/vmmapi_freebsd.c ============================================================================== --- stable/10/lib/libvmmapi/vmmapi_freebsd.c Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/lib/libvmmapi/vmmapi_freebsd.c Thu Jun 12 15:20:59 2014 (r267399) @@ -35,14 +35,176 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "vmmapi.h" +#define I386_TSS_SIZE 104 + +#define DESC_PRESENT 0x00000080 +#define DESC_LONGMODE 0x00002000 +#define DESC_DEF32 0x00004000 +#define DESC_GRAN 0x00008000 #define DESC_UNUSABLE 0x00010000 #define GUEST_NULL_SEL 0 #define GUEST_CODE_SEL 1 #define GUEST_DATA_SEL 2 -#define GUEST_GDTR_LIMIT (3 * 8 - 1) +#define GUEST_TSS_SEL 3 +#define GUEST_GDTR_LIMIT64 (3 * 8 - 1) + +static struct segment_descriptor i386_gdt[] = { + {}, /* NULL */ + { .sd_lolimit = 0xffff, .sd_type = SDT_MEMER, /* CODE */ + .sd_p = 1, .sd_hilimit = 0xf, .sd_def32 = 1, .sd_gran = 1 }, + { .sd_lolimit = 0xffff, .sd_type = SDT_MEMRW, /* DATA */ + .sd_p = 1, .sd_hilimit = 0xf, .sd_def32 = 1, .sd_gran = 1 }, + { .sd_lolimit = I386_TSS_SIZE - 1, /* TSS */ + .sd_type = SDT_SYS386TSS, .sd_p = 1 } +}; + +/* + * Setup the 'vcpu' register set such that it will begin execution at + * 'eip' in flat mode. + */ +int +vm_setup_freebsd_registers_i386(struct vmctx *vmctx, int vcpu, uint32_t eip, + uint32_t gdtbase, uint32_t esp) +{ + uint64_t cr0, rflags, desc_base; + uint32_t desc_access, desc_limit, tssbase; + uint16_t gsel; + struct segment_descriptor *gdt; + int error, tmp; + + /* A 32-bit guest requires unrestricted mode. */ + error = vm_get_capability(vmctx, vcpu, VM_CAP_UNRESTRICTED_GUEST, &tmp); + if (error) + goto done; + error = vm_set_capability(vmctx, vcpu, VM_CAP_UNRESTRICTED_GUEST, 1); + if (error) + goto done; + + cr0 = CR0_PE | CR0_NE; + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_CR0, cr0)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_CR4, 0)) != 0) + goto done; + + /* + * Forcing EFER to 0 causes bhyve to clear the "IA-32e guest + * mode" entry control. + */ + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_EFER, 0))) + goto done; + + gdt = vm_map_gpa(vmctx, gdtbase, 0x1000); + if (gdt == NULL) + return (EFAULT); + memcpy(gdt, i386_gdt, sizeof(i386_gdt)); + desc_base = gdtbase; + desc_limit = sizeof(i386_gdt) - 1; + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_GDTR, + desc_base, desc_limit, 0); + if (error != 0) + goto done; + + /* Place the TSS one page above the GDT. */ + tssbase = gdtbase + 0x1000; + gdt[3].sd_lobase = tssbase; + + rflags = 0x2; + error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_RFLAGS, rflags); + if (error) + goto done; + + desc_base = 0; + desc_limit = 0xffffffff; + desc_access = DESC_GRAN | DESC_DEF32 | DESC_PRESENT | SDT_MEMERA; + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_CS, + desc_base, desc_limit, desc_access); + + desc_access = DESC_GRAN | DESC_DEF32 | DESC_PRESENT | SDT_MEMRWA; + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_DS, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_ES, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_FS, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_GS, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_SS, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + desc_base = tssbase; + desc_limit = I386_TSS_SIZE - 1; + desc_access = DESC_PRESENT | SDT_SYS386BSY; + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_TR, + desc_base, desc_limit, desc_access); + if (error) + goto done; + + + error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_LDTR, 0, 0, + DESC_UNUSABLE); + if (error) + goto done; + + gsel = GSEL(GUEST_CODE_SEL, SEL_KPL); + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_CS, gsel)) != 0) + goto done; + + gsel = GSEL(GUEST_DATA_SEL, SEL_KPL); + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_DS, gsel)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_ES, gsel)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_FS, gsel)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_GS, gsel)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_SS, gsel)) != 0) + goto done; + + gsel = GSEL(GUEST_TSS_SEL, SEL_KPL); + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_TR, gsel)) != 0) + goto done; + + /* LDTR is pointing to the null selector */ + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_LDTR, 0)) != 0) + goto done; + + /* entry point */ + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_RIP, eip)) != 0) + goto done; + + if ((error = vm_set_register(vmctx, vcpu, VM_REG_GUEST_RSP, esp)) != 0) + goto done; + + error = 0; +done: + return (error); +} void vm_setup_freebsd_gdt(uint64_t *gdtr) @@ -168,7 +330,7 @@ vm_setup_freebsd_registers(struct vmctx goto done; desc_base = gdtbase; - desc_limit = GUEST_GDTR_LIMIT; + desc_limit = GUEST_GDTR_LIMIT64; error = vm_set_desc(vmctx, vcpu, VM_REG_GUEST_GDTR, desc_base, desc_limit, 0); if (error != 0) Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/amd64/include/vmm.h Thu Jun 12 15:20:59 2014 (r267399) @@ -323,6 +323,8 @@ struct vm_exit { uint64_t gpa; uint64_t gla; uint64_t cr3; + enum vie_cpu_mode cpu_mode; + enum vie_paging_mode paging_mode; struct vie vie; } inst_emul; /* Modified: stable/10/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- stable/10/sys/amd64/include/vmm_instruction_emul.h Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/amd64/include/vmm_instruction_emul.h Thu Jun 12 15:20:59 2014 (r267399) @@ -29,6 +29,18 @@ #ifndef _VMM_INSTRUCTION_EMUL_H_ #define _VMM_INSTRUCTION_EMUL_H_ +enum vie_cpu_mode { + CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ + CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */ +}; + +enum vie_paging_mode { + PAGING_MODE_FLAT, + PAGING_MODE_32, + PAGING_MODE_PAE, + PAGING_MODE_64, +}; + /* * The data structures 'vie' and 'vie_op' are meant to be opaque to the * consumers of instruction decoding. The only reason why their contents @@ -107,7 +119,7 @@ int vmm_emulate_instruction(void *vm, in */ int vmm_fetch_instruction(struct vm *vm, int cpuid, uint64_t rip, int inst_length, uint64_t cr3, - struct vie *vie); + enum vie_paging_mode paging_mode, struct vie *vie); void vie_init(struct vie *vie); @@ -123,8 +135,8 @@ void vie_init(struct vie *vie); * in VIE_INVALID_GLA instead. */ #define VIE_INVALID_GLA (1UL << 63) /* a non-canonical address */ -int vmm_decode_instruction(struct vm *vm, int cpuid, - uint64_t gla, struct vie *vie); +int vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla, + enum vie_cpu_mode cpu_mode, struct vie *vie); #endif /* _KERNEL */ #endif /* _VMM_INSTRUCTION_EMUL_H_ */ Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/amd64/vmm/intel/vmx.c Thu Jun 12 15:20:59 2014 (r267399) @@ -1337,6 +1337,30 @@ vmx_emulate_cr_access(struct vmx *vmx, i return (HANDLED); } +static enum vie_cpu_mode +vmx_cpu_mode(void) +{ + + if (vmcs_read(VMCS_GUEST_IA32_EFER) & EFER_LMA) + return (CPU_MODE_64BIT); + else + return (CPU_MODE_COMPATIBILITY); +} + +static enum vie_paging_mode +vmx_paging_mode(void) +{ + + if (!(vmcs_read(VMCS_GUEST_CR0) & CR0_PG)) + return (PAGING_MODE_FLAT); + if (!(vmcs_read(VMCS_GUEST_CR4) & CR4_PAE)) + return (PAGING_MODE_32); + if (vmcs_read(VMCS_GUEST_IA32_EFER) & EFER_LME) + return (PAGING_MODE_64); + else + return (PAGING_MODE_PAE); +} + static int ept_fault_type(uint64_t ept_qual) { @@ -1496,6 +1520,8 @@ vmx_handle_apic_access(struct vmx *vmx, vmexit->u.inst_emul.gpa = DEFAULT_APIC_BASE + offset; vmexit->u.inst_emul.gla = VIE_INVALID_GLA; vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); + vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); + vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); } /* @@ -1714,6 +1740,8 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.inst_emul.gpa = gpa; vmexit->u.inst_emul.gla = vmcs_gla(); vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); + vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); + vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INST_EMUL, 1); } /* Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/amd64/vmm/vmm.c Thu Jun 12 15:20:59 2014 (r267399) @@ -1082,6 +1082,8 @@ vm_handle_inst_emul(struct vm *vm, int v struct vm_exit *vme; int error, inst_length; uint64_t rip, gla, gpa, cr3; + enum vie_cpu_mode cpu_mode; + enum vie_paging_mode paging_mode; mem_region_read_t mread; mem_region_write_t mwrite; @@ -1094,15 +1096,18 @@ vm_handle_inst_emul(struct vm *vm, int v gla = vme->u.inst_emul.gla; gpa = vme->u.inst_emul.gpa; cr3 = vme->u.inst_emul.cr3; + cpu_mode = vme->u.inst_emul.cpu_mode; + paging_mode = vme->u.inst_emul.paging_mode; vie = &vme->u.inst_emul.vie; vie_init(vie); /* Fetch, decode and emulate the faulting instruction */ - if (vmm_fetch_instruction(vm, vcpuid, rip, inst_length, cr3, vie) != 0) + if (vmm_fetch_instruction(vm, vcpuid, rip, inst_length, cr3, + paging_mode, vie) != 0) return (EFAULT); - if (vmm_decode_instruction(vm, vcpuid, gla, vie) != 0) + if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, vie) != 0) return (EFAULT); /* return to userland unless this is an in-kernel emulated device */ Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_instruction_emul.c Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/amd64/vmm/vmm_instruction_emul.c Thu Jun 12 15:20:59 2014 (r267399) @@ -49,11 +49,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* _KERNEL */ -enum cpu_mode { - CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ - CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */ -}; - /* struct vie_op.op_type */ enum { VIE_OP_TYPE_NONE = 0, @@ -578,16 +573,76 @@ vie_init(struct vie *vie) static int gla2gpa(struct vm *vm, uint64_t gla, uint64_t ptpphys, - uint64_t *gpa, uint64_t *gpaend) + uint64_t *gpa, enum vie_paging_mode paging_mode) { int nlevels, ptpshift, ptpindex; uint64_t *ptpbase, pte, pgsize; + uint32_t *ptpbase32, pte32; void *cookie; - /* - * XXX assumes 64-bit guest with 4 page walk levels - */ - nlevels = 4; + if (paging_mode == PAGING_MODE_FLAT) { + *gpa = gla; + return (0); + } + + if (paging_mode == PAGING_MODE_32) { + nlevels = 2; + while (--nlevels >= 0) { + /* Zero out the lower 12 bits. */ + ptpphys &= ~0xfff; + + ptpbase32 = vm_gpa_hold(vm, ptpphys, PAGE_SIZE, + VM_PROT_READ, &cookie); + + if (ptpbase32 == NULL) + goto error; + + ptpshift = PAGE_SHIFT + nlevels * 10; + ptpindex = (gla >> ptpshift) & 0x3FF; + pgsize = 1UL << ptpshift; + + pte32 = ptpbase32[ptpindex]; + + vm_gpa_release(cookie); + + if ((pte32 & PG_V) == 0) + goto error; + + if (pte32 & PG_PS) + break; + + ptpphys = pte32; + } + + /* Zero out the lower 'ptpshift' bits */ + pte32 >>= ptpshift; pte32 <<= ptpshift; + *gpa = pte32 | (gla & (pgsize - 1)); + return (0); + } + + if (paging_mode == PAGING_MODE_PAE) { + /* Zero out the lower 5 bits and the upper 12 bits */ + ptpphys >>= 5; ptpphys <<= 17; ptpphys >>= 12; + + ptpbase = vm_gpa_hold(vm, ptpphys, sizeof(*ptpbase) * 4, + VM_PROT_READ, &cookie); + if (ptpbase == NULL) + goto error; + + ptpindex = (gla >> 30) & 0x3; + + pte = ptpbase[ptpindex]; + + vm_gpa_release(cookie); + + if ((pte & PG_V) == 0) + goto error; + + ptpphys = pte; + + nlevels = 2; + } else + nlevels = 4; while (--nlevels >= 0) { /* Zero out the lower 12 bits and the upper 12 bits */ ptpphys >>= 12; ptpphys <<= 24; ptpphys >>= 12; @@ -621,7 +676,6 @@ gla2gpa(struct vm *vm, uint64_t gla, uin /* Zero out the lower 'ptpshift' bits and the upper 12 bits */ pte >>= ptpshift; pte <<= (ptpshift + 12); pte >>= 12; *gpa = pte | (gla & (pgsize - 1)); - *gpaend = pte + pgsize; return (0); error: @@ -630,10 +684,11 @@ error: int vmm_fetch_instruction(struct vm *vm, int cpuid, uint64_t rip, int inst_length, - uint64_t cr3, struct vie *vie) + uint64_t cr3, enum vie_paging_mode paging_mode, + struct vie *vie) { int n, err, prot; - uint64_t gpa, gpaend, off; + uint64_t gpa, off; void *hpa, *cookie; /* @@ -646,7 +701,7 @@ vmm_fetch_instruction(struct vm *vm, int /* Copy the instruction into 'vie' */ while (vie->num_valid < inst_length) { - err = gla2gpa(vm, rip, cr3, &gpa, &gpaend); + err = gla2gpa(vm, rip, cr3, &gpa, paging_mode); if (err) break; @@ -749,15 +804,9 @@ decode_opcode(struct vie *vie) } static int -decode_modrm(struct vie *vie) +decode_modrm(struct vie *vie, enum vie_cpu_mode cpu_mode) { uint8_t x; - enum cpu_mode cpu_mode; - - /* - * XXX assuming that guest is in IA-32E 64-bit mode - */ - cpu_mode = CPU_MODE_64BIT; if (vie_peek(vie, &x)) return (-1); @@ -1034,16 +1083,19 @@ verify_gla(struct vm *vm, int cpuid, uin } int -vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla, struct vie *vie) +vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla, + enum vie_cpu_mode cpu_mode, struct vie *vie) { - if (decode_rex(vie)) - return (-1); + if (cpu_mode == CPU_MODE_64BIT) { + if (decode_rex(vie)) + return (-1); + } if (decode_opcode(vie)) return (-1); - if (decode_modrm(vie)) + if (decode_modrm(vie, cpu_mode)) return (-1); if (decode_sib(vie)) Modified: stable/10/sys/boot/common/load_elf32.c ============================================================================== --- stable/10/sys/boot/common/load_elf32.c Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/boot/common/load_elf32.c Thu Jun 12 15:20:59 2014 (r267399) @@ -2,5 +2,6 @@ __FBSDID("$FreeBSD$"); #define __ELF_WORD_SIZE 32 +#define _MACHINE_ELF_WANT_32BIT #include "load_elf.c" Modified: stable/10/sys/boot/common/load_elf32_obj.c ============================================================================== --- stable/10/sys/boot/common/load_elf32_obj.c Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/boot/common/load_elf32_obj.c Thu Jun 12 15:20:59 2014 (r267399) @@ -2,5 +2,6 @@ __FBSDID("$FreeBSD$"); #define __ELF_WORD_SIZE 32 +#define _MACHINE_ELF_WANT_32BIT #include "load_elf_obj.c" Modified: stable/10/sys/boot/userboot/userboot/Makefile ============================================================================== --- stable/10/sys/boot/userboot/userboot/Makefile Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/boot/userboot/userboot/Makefile Thu Jun 12 15:20:59 2014 (r267399) @@ -11,6 +11,7 @@ STRIP= LIBDIR= /boot SRCS= autoload.c +SRCS+= biossmap.c SRCS+= bootinfo.c SRCS+= bootinfo32.c SRCS+= bootinfo64.c Copied: stable/10/sys/boot/userboot/userboot/biossmap.c (from r261504, head/sys/boot/userboot/userboot/biossmap.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/userboot/userboot/biossmap.c Thu Jun 12 15:20:59 2014 (r267399, copy of r261504, head/sys/boot/userboot/userboot/biossmap.c) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 1998 Michael Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include "bootstrap.h" +#include "libuserboot.h" + +#define GB (1024UL * 1024 * 1024) + +void +bios_addsmapdata(struct preloaded_file *kfp) +{ + uint64_t lowmem, highmem; + int smapnum, len; + struct bios_smap smap[3], *sm; + + CALLBACK(getmem, &lowmem, &highmem); + + sm = &smap[0]; + + sm->base = 0; /* base memory */ + sm->length = 640 * 1024; + sm->type = SMAP_TYPE_MEMORY; + sm++; + + sm->base = 0x100000; /* extended memory */ + sm->length = lowmem - 0x100000; + sm->type = SMAP_TYPE_MEMORY; + sm++; + + smapnum = 2; + + if (highmem != 0) { + sm->base = 4 * GB; + sm->length = highmem; + sm->type = SMAP_TYPE_MEMORY; + smapnum++; + } + + len = smapnum * sizeof(struct bios_smap); + file_addmetadata(kfp, MODINFOMD_SMAP, len, &smap[0]); +} Modified: stable/10/sys/boot/userboot/userboot/bootinfo32.c ============================================================================== --- stable/10/sys/boot/userboot/userboot/bootinfo32.c Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/boot/userboot/userboot/bootinfo32.c Thu Jun 12 15:20:59 2014 (r267399) @@ -66,7 +66,7 @@ static struct bootinfo bi; COPY32(strlen(s) + 1, a, c); \ if (c) \ CALLBACK(copyin, s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(u_long));\ + a += roundup(strlen(s) + 1, sizeof(uint32_t));\ } #define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) @@ -78,7 +78,7 @@ static struct bootinfo bi; COPY32(sizeof(s), a, c); \ if (c) \ CALLBACK(copyin, &s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(u_long)); \ + a += roundup(sizeof(s), sizeof(uint32_t)); \ } #define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) @@ -89,7 +89,7 @@ static struct bootinfo bi; COPY32(mm->md_size, a, c); \ if (c) \ CALLBACK(copyin, mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(u_long));\ + a += roundup(mm->md_size, sizeof(uint32_t));\ } #define MOD_END(a, c) { \ @@ -146,6 +146,7 @@ bi_load32(char *args, int *howtop, int * int bootdevnr, howto; char *kernelname; const char *kernelpath; + uint64_t lowmem, highmem; howto = bi_getboothowto(args); @@ -198,9 +199,7 @@ bi_load32(char *args, int *howtop, int * file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); -#if 0 bios_addsmapdata(kfp); -#endif /* Figure out the size and location of the metadata */ *modulep = addr; @@ -237,11 +236,10 @@ bi_load32(char *args, int *howtop, int * bi.bi_bios_geom[i] = bd_getbigeom(i); #endif bi.bi_size = sizeof(bi); + CALLBACK(getmem, &lowmem, &highmem); bi.bi_memsizes_valid = 1; -#if 0 - bi.bi_basemem = bios_basemem / 1024; - bi.bi_extmem = bios_extmem / 1024; -#endif + bi.bi_basemem = 640; + bi.bi_extmem = (lowmem - 0x100000) / 1024; bi.bi_envp = envp; bi.bi_modulep = *modulep; bi.bi_kernend = kernend; @@ -251,7 +249,7 @@ bi_load32(char *args, int *howtop, int * /* * Copy the legacy bootinfo and kernel name to the guest at 0x2000 */ - bi.bi_kernelname = (char *) (0x2000 + sizeof(bi)); + bi.bi_kernelname = 0x2000 + sizeof(bi); CALLBACK(copyin, &bi, 0x2000, sizeof(bi)); CALLBACK(copyin, kernelname, 0x2000 + sizeof(bi), strlen(kernelname) + 1); Modified: stable/10/sys/boot/userboot/userboot/bootinfo64.c ============================================================================== --- stable/10/sys/boot/userboot/userboot/bootinfo64.c Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/boot/userboot/userboot/bootinfo64.c Thu Jun 12 15:20:59 2014 (r267399) @@ -169,53 +169,6 @@ bi_checkcpu(void) #endif } -struct smap { - uint64_t base; - uint64_t length; - uint32_t type; -} __packed; - -/* From FreeBSD */ -#define SMAP_TYPE_MEMORY 1 - -#define GB (1024UL * 1024 * 1024) - -#define MODINFOMD_SMAP 0x1001 - -static void -bios_addsmapdata(struct preloaded_file *kfp) -{ - uint64_t lowmem, highmem; - int smapnum, len; - struct smap smap[3], *sm; - - CALLBACK(getmem, &lowmem, &highmem); - - sm = &smap[0]; - - sm->base = 0; /* base memory */ - sm->length = 640 * 1024; - sm->type = SMAP_TYPE_MEMORY; - sm++; - - sm->base = 0x100000; /* extended memory */ - sm->length = lowmem - 0x100000; - sm->type = SMAP_TYPE_MEMORY; - sm++; - - smapnum = 2; - - if (highmem != 0) { - sm->base = 4 * GB; - sm->length = highmem; - sm->type = SMAP_TYPE_MEMORY; - smapnum++; - } - - len = smapnum * sizeof (struct smap); - file_addmetadata(kfp, MODINFOMD_SMAP, len, &smap[0]); -} - /* * Load the information expected by an amd64 kernel. * Modified: stable/10/sys/boot/userboot/userboot/elf32_freebsd.c ============================================================================== --- stable/10/sys/boot/userboot/userboot/elf32_freebsd.c Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/boot/userboot/userboot/elf32_freebsd.c Thu Jun 12 15:20:59 2014 (r267399) @@ -45,6 +45,9 @@ static int elf32_obj_exec(struct preload struct file_format i386_elf = { elf32_loadfile, elf32_exec }; struct file_format i386_elf_obj = { elf32_obj_loadfile, elf32_obj_exec }; +#define GUEST_STACK 0x1000 /* Initial stack base */ +#define GUEST_GDT 0x3000 /* Address of initial GDT */ + /* * There is an ELF kernel and one or more ELF modules loaded. * We wish to start executing the kernel image, so make such @@ -57,7 +60,7 @@ elf32_exec(struct preloaded_file *fp) Elf_Ehdr *ehdr; vm_offset_t entry, bootinfop, modulep, kernend; int boothowto, err, bootdev; - uint32_t stack[1024]; + uint32_t stack[1024], *sp; if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) @@ -78,16 +81,27 @@ elf32_exec(struct preloaded_file *fp) /* * Build a scratch stack at physical 0x1000 */ - stack[0] = boothowto; - stack[1] = bootdev; - stack[2] = 0; - stack[3] = 0; - stack[4] = 0; - stack[5] = bootinfop; - stack[6] = modulep; - stack[7] = kernend; - CALLBACK(copyin, stack, 0x1000, sizeof(stack)); - CALLBACK(setreg, 4, 0x1000); + memset(stack, 0, sizeof(stack)); + sp = (uint32_t *)((char *)stack + sizeof(stack)); + *--sp = kernend; + *--sp = modulep; + *--sp = bootinfop; + *--sp = 0; + *--sp = 0; + *--sp = 0; + *--sp = bootdev; + *--sp = boothowto; + + /* + * Fake return address to mimic "new" boot blocks. For more + * details see recover_bootinfo in locore.S. + */ + *--sp = 0xbeefface; + CALLBACK(copyin, stack, GUEST_STACK, sizeof(stack)); + CALLBACK(setreg, 4, (char *)sp - (char *)stack + GUEST_STACK); + + CALLBACK(setgdt, GUEST_GDT, 8 * 4 - 1); + CALLBACK(exec, entry); panic("exec returned"); Modified: stable/10/sys/boot/userboot/userboot/libuserboot.h ============================================================================== --- stable/10/sys/boot/userboot/userboot/libuserboot.h Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/sys/boot/userboot/userboot/libuserboot.h Thu Jun 12 15:20:59 2014 (r267399) @@ -65,3 +65,4 @@ vm_offset_t bi_copyenv(vm_offset_t addr) int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernend); int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend); +void bios_addsmapdata(struct preloaded_file *kfp); Modified: stable/10/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- stable/10/usr.sbin/bhyveload/bhyveload.c Thu Jun 12 14:20:58 2014 (r267398) +++ stable/10/usr.sbin/bhyveload/bhyveload.c Thu Jun 12 15:20:59 2014 (r267399) @@ -465,7 +465,12 @@ cb_exec(void *arg, uint64_t rip) { int error; - error = vm_setup_freebsd_registers(ctx, BSP, rip, cr3, gdtbase, rsp); + if (cr3 == 0) + error = vm_setup_freebsd_registers_i386(ctx, BSP, rip, gdtbase, + rsp); + else + error = vm_setup_freebsd_registers(ctx, BSP, rip, cr3, gdtbase, + rsp); if (error) { perror("vm_setup_freebsd_registers"); cb_exit(NULL, USERBOOT_EXIT_QUIT); From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 15:24:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 074F569E; Thu, 12 Jun 2014 15:24: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 E80BF284D; Thu, 12 Jun 2014 15:24:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CFOXgt001498; Thu, 12 Jun 2014 15:24:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CFOXBG001497; Thu, 12 Jun 2014 15:24:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406121524.s5CFOXBG001497@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jun 2014 15:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267401 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 15:24:34 -0000 Author: jhb Date: Thu Jun 12 15:24:33 2014 New Revision: 267401 URL: http://svnweb.freebsd.org/changeset/base/267401 Log: MFC 262311: Fix virtio spec URL. Modified: stable/10/usr.sbin/bhyve/virtio.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/virtio.h ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.h Thu Jun 12 15:23:51 2014 (r267400) +++ stable/10/usr.sbin/bhyve/virtio.h Thu Jun 12 15:24:33 2014 (r267401) @@ -33,7 +33,7 @@ * These are derived from several virtio specifications. * * Some useful links: - * https://github.com/rustyrussel/virtio-spec + * https://github.com/rustyrussell/virtio-spec * http://people.redhat.com/pbonzini/virtio-spec.pdf */ From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 15:46:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9AF11F09; Thu, 12 Jun 2014 15:46: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 8758A2A2E; Thu, 12 Jun 2014 15:46: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 s5CFkODw010890; Thu, 12 Jun 2014 15:46:24 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CFkOEv010889; Thu, 12 Jun 2014 15:46:24 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201406121546.s5CFkOEv010889@svn.freebsd.org> From: Warren Block Date: Thu, 12 Jun 2014 15:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267402 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 15:46:24 -0000 Author: wblock (doc committer) Date: Thu Jun 12 15:46:24 2014 New Revision: 267402 URL: http://svnweb.freebsd.org/changeset/base/267402 Log: MFC r267090: Correct the document date for last change. Modified: stable/10/share/man/man5/passwd.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man5/passwd.5 ============================================================================== --- stable/10/share/man/man5/passwd.5 Thu Jun 12 15:24:33 2014 (r267401) +++ stable/10/share/man/man5/passwd.5 Thu Jun 12 15:46:24 2014 (r267402) @@ -35,7 +35,7 @@ .\" From: @(#)passwd.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 23, 2012 +.Dd May 29, 2014 .Dt PASSWD 5 .Os .Sh NAME From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 16:41:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 87905B4A; Thu, 12 Jun 2014 16:41: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 5A8092FCB; Thu, 12 Jun 2014 16:41: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 s5CGfrpm038653; Thu, 12 Jun 2014 16:41:53 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CGfrKG038652; Thu, 12 Jun 2014 16:41:53 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406121641.s5CGfrKG038652@svn.freebsd.org> From: Ed Maste Date: Thu, 12 Jun 2014 16:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267410 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 16:41:53 -0000 Author: emaste Date: Thu Jun 12 16:41:52 2014 New Revision: 267410 URL: http://svnweb.freebsd.org/changeset/base/267410 Log: MFC r265798, r265815 by wblock: Add a man page for the new vt.4 device. Fix document title. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 16:51:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C6FC52DD; Thu, 12 Jun 2014 16:51:53 +0000 (UTC) Received: from mail-qa0-x22d.google.com (mail-qa0-x22d.google.com [IPv6:2607:f8b0:400d:c00::22d]) (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 56E5120D5; Thu, 12 Jun 2014 16:51:53 +0000 (UTC) Received: by mail-qa0-f45.google.com with SMTP id v10so1992871qac.4 for ; Thu, 12 Jun 2014 09:51:52 -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:content-type; bh=0Pb7xqEBdxfGqjVNkY0eX4dh9AEgDD6gpVLn5m11a0o=; b=WfIZ3rQgagCG+dsPK7/j+4jWlVGdM1wAERJs90DR8RE2l16Q6lQfa4tmRGUzvuFeol g7D+HuDvVcTcRIXOgAPAmkjfQQ6U0MCpAtPdeRWuw0YczTNp2UdYUH6PZpKcLX0Dktd0 e8L2pAbtm+wueXdfwxAy6P+WlNKQPzEJLSTgdOMScwMIL8KuYe8w+AIANjJ0jAJM4/Qi aW/7m7LtzRbt309dzkICUsZ1f7bfslaiVD7g6re46CA2paQzyj/s5DQY0H6434drn3mE gCNgpYTA0Pw7ErkTJEXi6u5c64Hs5/d9VmerbRoRwLH7FQB6z+tSyLXMDv5oA4abQTOK lXlw== MIME-Version: 1.0 X-Received: by 10.224.47.148 with SMTP id n20mr63133744qaf.90.1402591912452; Thu, 12 Jun 2014 09:51:52 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.140.49.239 with HTTP; Thu, 12 Jun 2014 09:51:52 -0700 (PDT) In-Reply-To: <201406121641.s5CGfrKG038652@svn.freebsd.org> References: <201406121641.s5CGfrKG038652@svn.freebsd.org> Date: Thu, 12 Jun 2014 12:51:52 -0400 X-Google-Sender-Auth: Ca8OCrGXGznOW7x40byVbBdt1e4 Message-ID: Subject: Re: svn commit: r267410 - stable/10 From: Ed Maste To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 16:51:53 -0000 On 12 June 2014 12:41, Ed Maste wrote: > Author: emaste > Date: Thu Jun 12 16:41:52 2014 > New Revision: 267410 > URL: http://svnweb.freebsd.org/changeset/base/267410 > > Log: > MFC r265798, r265815 by wblock: Oops - vt.4 is already in stable/10 (and stable/9), and I had a typo in the revision. Sorry for adding bogus mergeinfo here. -Ed From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 16:55:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C55965BA; Thu, 12 Jun 2014 16:55: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 B1BC92104; Thu, 12 Jun 2014 16:55: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 s5CGt4Gj043952; Thu, 12 Jun 2014 16:55:04 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CGt4YV043951; Thu, 12 Jun 2014 16:55:04 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406121655.s5CGt4YV043951@svn.freebsd.org> From: Glen Barber Date: Thu, 12 Jun 2014 16:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267413 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 16:55:04 -0000 Author: gjb Date: Thu Jun 12 16:55:04 2014 New Revision: 267413 URL: http://svnweb.freebsd.org/changeset/base/267413 Log: Document r266890, pmcstat(8) '-l' flag. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 12 16:52:36 2014 (r267412) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 12 16:55:04 2014 (r267413) @@ -240,6 +240,11 @@ to filter by &man.jail.8; ID or name, in followup to the &man.ps.1; change in r265229. + The &man.pmcstat.8; utility has been + updated to include a new flag, -l, which + adds event collection after the specified number of + seconds. + The default &man.newsyslog.conf.5; now includes files in the /etc/newsyslog.conf.d/ and From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 17:06:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8C94B9AA; Thu, 12 Jun 2014 17:06: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 5F6532255; Thu, 12 Jun 2014 17:06: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 s5CH6osQ048998; Thu, 12 Jun 2014 17:06:50 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CH6oHr048997; Thu, 12 Jun 2014 17:06:50 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406121706.s5CH6oHr048997@svn.freebsd.org> From: Ed Maste Date: Thu, 12 Jun 2014 17:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267414 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 17:06:51 -0000 Author: emaste Date: Thu Jun 12 17:06:50 2014 New Revision: 267414 URL: http://svnweb.freebsd.org/changeset/base/267414 Log: Undo incorrect mergeinfo from r267410 Suggested by: gjb Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 17:13:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 47323FA1; Thu, 12 Jun 2014 17:13: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 34335234C; Thu, 12 Jun 2014 17:13: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 s5CHDaXw053524; Thu, 12 Jun 2014 17:13:36 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CHDaEi053523; Thu, 12 Jun 2014 17:13:36 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406121713.s5CHDaEi053523@svn.freebsd.org> From: Glen Barber Date: Thu, 12 Jun 2014 17:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267417 - stable/10/release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 17:13:36 -0000 Author: gjb Date: Thu Jun 12 17:13:35 2014 New Revision: 267417 URL: http://svnweb.freebsd.org/changeset/base/267417 Log: MFC r267326, r267327: r267326: Add empty pkg-stage file to CLEANFILES if WITH_DVD=1. r267327: Fix indentation level. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Thu Jun 12 17:12:58 2014 (r267416) +++ stable/10/release/Makefile Thu Jun 12 17:13:35 2014 (r267417) @@ -100,6 +100,9 @@ CLEANFILES= packagesystem *.txz MANIFEST CLEANFILES+= ${I}.xz . endfor .endif +.if defined(WITH_DVD) && !empty(WITH_DVD) +CLEANFILES+= pkg-stage +.endif CLEANDIRS= dist ftp release bootonly dvd beforeclean: chflags -R noschg . From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 17:15:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7A6E31A9; Thu, 12 Jun 2014 17:15: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 5C5042365; Thu, 12 Jun 2014 17:15: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 s5CHFv2m053983; Thu, 12 Jun 2014 17:15:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CHFuno053980; Thu, 12 Jun 2014 17:15:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406121715.s5CHFuno053980@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jun 2014 17:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267418 - in stable/10/sys: amd64/amd64 x86/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 17:15:57 -0000 Author: jhb Date: Thu Jun 12 17:15:56 2014 New Revision: 267418 URL: http://svnweb.freebsd.org/changeset/base/267418 Log: MFC 266263,266551,266552: - Add definitions for more structured extended features as well as XSAVE Extended Features for AVX512 and MPX (Memory Protection Extensions). - Don't permit users to request a subset of the AVX512 or MPX xsave masks. Modified: stable/10/sys/amd64/amd64/fpu.c stable/10/sys/amd64/amd64/identcpu.c stable/10/sys/x86/include/specialreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/fpu.c ============================================================================== --- stable/10/sys/amd64/amd64/fpu.c Thu Jun 12 17:13:35 2014 (r267417) +++ stable/10/sys/amd64/amd64/fpu.c Thu Jun 12 17:15:56 2014 (r267418) @@ -199,6 +199,10 @@ fpuinit_bsp1(void) TUNABLE_ULONG_FETCH("hw.xsave_mask", &xsave_mask_user); xsave_mask_user |= XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; xsave_mask &= xsave_mask_user; + if ((xsave_mask & XFEATURE_AVX512) != XFEATURE_AVX512) + xsave_mask &= ~XFEATURE_AVX512; + if ((xsave_mask & XFEATURE_MPX) != XFEATURE_MPX) + xsave_mask &= ~XFEATURE_MPX; cpuid_count(0xd, 0x1, cp); if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) { Modified: stable/10/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/10/sys/amd64/amd64/identcpu.c Thu Jun 12 17:13:35 2014 (r267417) +++ stable/10/sys/amd64/amd64/identcpu.c Thu Jun 12 17:15:56 2014 (r267418) @@ -385,11 +385,11 @@ printcpuinfo(void) } if (cpu_stdext_feature != 0) { - printf("\n Standard Extended Features=0x%b", + printf("\n Structured Extended Features=0x%b", cpu_stdext_feature, "\020" /* RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE */ - "\001GSFSBASE" + "\001FSGSBASE" "\002TSCADJ" /* Bit Manipulation Instructions */ "\004BMI1" @@ -401,17 +401,27 @@ printcpuinfo(void) "\010SMEP" /* Bit Manipulation Instructions */ "\011BMI2" - "\012ENHMOVSB" + "\012ERMS" /* Invalidate Processor Context ID */ "\013INVPCID" /* Restricted Transactional Memory */ "\014RTM" + /* Intel Memory Protection Extensions */ + "\017MPX" + /* AVX512 Foundation */ + "\021AVX512F" /* Enhanced NRBG */ "\023RDSEED" /* ADCX + ADOX */ "\024ADX" /* Supervisor Mode Access Prevention */ "\025SMAP" + "\030CLFLUSHOPT" + "\032PROCTRACE" + "\033AVX512PF" + "\034AVX512ER" + "\035AVX512CD" + "\036SHA" ); } Modified: stable/10/sys/x86/include/specialreg.h ============================================================================== --- stable/10/sys/x86/include/specialreg.h Thu Jun 12 17:13:35 2014 (r267417) +++ stable/10/sys/x86/include/specialreg.h Thu Jun 12 17:15:56 2014 (r267418) @@ -87,12 +87,23 @@ */ #define XCR0 0 /* XFEATURE_ENABLED_MASK register */ -#define XFEATURE_ENABLED_X87 0x00000001 -#define XFEATURE_ENABLED_SSE 0x00000002 -#define XFEATURE_ENABLED_AVX 0x00000004 +#define XFEATURE_ENABLED_X87 0x00000001 +#define XFEATURE_ENABLED_SSE 0x00000002 +#define XFEATURE_ENABLED_YMM_HI128 0x00000004 +#define XFEATURE_ENABLED_AVX XFEATURE_ENABLED_YMM_HI128 +#define XFEATURE_ENABLED_BNDREGS 0x00000008 +#define XFEATURE_ENABLED_BNDCSR 0x00000010 +#define XFEATURE_ENABLED_OPMASK 0x00000020 +#define XFEATURE_ENABLED_ZMM_HI256 0x00000040 +#define XFEATURE_ENABLED_HI16_ZMM 0x00000080 #define XFEATURE_AVX \ (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE | XFEATURE_ENABLED_AVX) +#define XFEATURE_AVX512 \ + (XFEATURE_ENABLED_OPMASK | XFEATURE_ENABLED_ZMM_HI256 | \ + XFEATURE_ENABLED_HI16_ZMM) +#define XFEATURE_MPX \ + (XFEATURE_ENABLED_BNDREGS | XFEATURE_ENABLED_BNDCSR) /* * CPUID instruction features register @@ -308,7 +319,7 @@ #define AMDID_COREID_SIZE_SHIFT 12 /* - * Structured Extended Features + * CPUID instruction 7 Structured Extended Features, leaf 0 ebx info */ #define CPUID_STDEXT_FSGSBASE 0x00000001 #define CPUID_STDEXT_TSC_ADJUST 0x00000002 @@ -317,12 +328,20 @@ #define CPUID_STDEXT_AVX2 0x00000020 #define CPUID_STDEXT_SMEP 0x00000080 #define CPUID_STDEXT_BMI2 0x00000100 -#define CPUID_STDEXT_ENH_MOVSB 0x00000200 -#define CPUID_STDEXT_RTM 0x00000800 +#define CPUID_STDEXT_ERMS 0x00000200 #define CPUID_STDEXT_INVPCID 0x00000400 +#define CPUID_STDEXT_RTM 0x00000800 +#define CPUID_STDEXT_MPX 0x00004000 +#define CPUID_STDEXT_AVX512F 0x00010000 #define CPUID_STDEXT_RDSEED 0x00040000 #define CPUID_STDEXT_ADX 0x00080000 #define CPUID_STDEXT_SMAP 0x00100000 +#define CPUID_STDEXT_CLFLUSHOPT 0x00800000 +#define CPUID_STDEXT_PROCTRACE 0x02000000 +#define CPUID_STDEXT_AVX512PF 0x04000000 +#define CPUID_STDEXT_AVX512ER 0x08000000 +#define CPUID_STDEXT_AVX512CD 0x10000000 +#define CPUID_STDEXT_SHA 0x20000000 /* * CPUID manufacturers identifiers From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 17:21:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2B61167D; Thu, 12 Jun 2014 17:21: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 17A1123FC; Thu, 12 Jun 2014 17:21: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 s5CHLBo1058007; Thu, 12 Jun 2014 17:21:11 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CHLBa6058006; Thu, 12 Jun 2014 17:21:11 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406121721.s5CHLBa6058006@svn.freebsd.org> From: Glen Barber Date: Thu, 12 Jun 2014 17:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267421 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 17:21:12 -0000 Author: gjb Date: Thu Jun 12 17:21:11 2014 New Revision: 267421 URL: http://svnweb.freebsd.org/changeset/base/267421 Log: Fix a typo in note for r266890, pmcstat(8) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 12 17:19:57 2014 (r267420) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 12 17:21:11 2014 (r267421) @@ -242,7 +242,7 @@ The &man.pmcstat.8; utility has been updated to include a new flag, -l, which - adds event collection after the specified number of + ends event collection after the specified number of seconds. The default &man.newsyslog.conf.5; now From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 19:58:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5FF49572; Thu, 12 Jun 2014 19:58: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 4A42D22C2; Thu, 12 Jun 2014 19:58: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 s5CJwFeO028394; Thu, 12 Jun 2014 19:58:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CJwCQE028376; Thu, 12 Jun 2014 19:58:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406121958.s5CJwCQE028376@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jun 2014 19:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267427 - in stable/10: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 19:58:15 -0000 Author: jhb Date: Thu Jun 12 19:58:12 2014 New Revision: 267427 URL: http://svnweb.freebsd.org/changeset/base/267427 Log: MFC 261638,262144,262506,266765: Add virtualized XSAVE support to bhyve which permits guests to use XSAVE and XSAVE-enabled features like AVX. - Store a per-cpu guest xcr0 register and handle xsetbv VM exits by emulating the instruction. - Only expose XSAVE to guests if XSAVE is enabled in the host. Only expose a subset of XSAVE features currently supported by the guest and for which the proper emulation of xsetbv is known. Currently this includes X87, SSE, AVX, AVX-512, and Intel MPX. - Add support for injecting hardware exceptions into the guest and use this to trigger exceptions in the guest for invalid xsetbv operations instead of potentially faulting in the host. - Queue pending exceptions in the 'struct vcpu' instead of directly updating the processor-specific VMCS or VMCB. The pending exception will be delivered right before entering the guest. - Rename the unused ioctl VM_INJECT_EVENT to VM_INJECT_EXCEPTION and restrict it to only deliver x86 hardware exceptions. This new ioctl is now used to inject a protection fault when the guest accesses an unimplemented MSR. - Expose a subset of known-safe features from leaf 0 of the structured extended features to guests if they are supported on the host including RDFSBASE/RDGSBASE, BMI1/2, AVX2, AVX-512, HLE, ERMS, and RTM. Aside from AVX-512, these features are all new instructions available for use in ring 3 with no additional hypervisor changes needed. Modified: stable/10/lib/libvmmapi/vmmapi.c stable/10/lib/libvmmapi/vmmapi.h stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/include/vmm_dev.h stable/10/sys/amd64/vmm/amd/amdv.c stable/10/sys/amd64/vmm/intel/vmcs.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_dev.c stable/10/sys/amd64/vmm/vmm_host.c stable/10/sys/amd64/vmm/vmm_host.h stable/10/sys/amd64/vmm/x86.c stable/10/usr.sbin/bhyve/bhyverun.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.c Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/lib/libvmmapi/vmmapi.c Thu Jun 12 19:58:12 2014 (r267427) @@ -343,35 +343,32 @@ vm_run(struct vmctx *ctx, int vcpu, uint } static int -vm_inject_event_real(struct vmctx *ctx, int vcpu, enum vm_event_type type, - int vector, int error_code, int error_code_valid) +vm_inject_exception_real(struct vmctx *ctx, int vcpu, int vector, + int error_code, int error_code_valid) { - struct vm_event ev; + struct vm_exception exc; - bzero(&ev, sizeof(ev)); - ev.cpuid = vcpu; - ev.type = type; - ev.vector = vector; - ev.error_code = error_code; - ev.error_code_valid = error_code_valid; + bzero(&exc, sizeof(exc)); + exc.cpuid = vcpu; + exc.vector = vector; + exc.error_code = error_code; + exc.error_code_valid = error_code_valid; - return (ioctl(ctx->fd, VM_INJECT_EVENT, &ev)); + return (ioctl(ctx->fd, VM_INJECT_EXCEPTION, &exc)); } int -vm_inject_event(struct vmctx *ctx, int vcpu, enum vm_event_type type, - int vector) +vm_inject_exception(struct vmctx *ctx, int vcpu, int vector) { - return (vm_inject_event_real(ctx, vcpu, type, vector, 0, 0)); + return (vm_inject_exception_real(ctx, vcpu, vector, 0, 0)); } int -vm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type, - int vector, int error_code) +vm_inject_exception2(struct vmctx *ctx, int vcpu, int vector, int errcode) { - return (vm_inject_event_real(ctx, vcpu, type, vector, error_code, 1)); + return (vm_inject_exception_real(ctx, vcpu, vector, errcode, 1)); } int Modified: stable/10/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.h Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/lib/libvmmapi/vmmapi.h Thu Jun 12 19:58:12 2014 (r267427) @@ -62,10 +62,8 @@ int vm_get_register(struct vmctx *ctx, i int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *ret_vmexit); int vm_apicid2vcpu(struct vmctx *ctx, int apicid); -int vm_inject_event(struct vmctx *ctx, int vcpu, enum vm_event_type type, - int vector); -int vm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type, - int vector, int error_code); +int vm_inject_exception(struct vmctx *ctx, int vcpu, int vec); +int vm_inject_exception2(struct vmctx *ctx, int vcpu, int vec, int errcode); int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector); int vm_lapic_local_irq(struct vmctx *ctx, int vcpu, int vector); int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg); Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/sys/amd64/include/vmm.h Thu Jun 12 19:58:12 2014 (r267427) @@ -34,6 +34,7 @@ #define VM_MAX_NAMELEN 32 struct vm; +struct vm_exception; struct vm_memory_segment; struct seg_desc; struct vm_exit; @@ -62,9 +63,6 @@ typedef int (*vmi_get_desc_t)(void *vmi, struct seg_desc *desc); typedef int (*vmi_set_desc_t)(void *vmi, int vcpu, int num, struct seg_desc *desc); -typedef int (*vmi_inject_event_t)(void *vmi, int vcpu, - int type, int vector, - uint32_t code, int code_valid); typedef int (*vmi_get_cap_t)(void *vmi, int vcpu, int num, int *retval); typedef int (*vmi_set_cap_t)(void *vmi, int vcpu, int num, int val); typedef struct vmspace * (*vmi_vmspace_alloc)(vm_offset_t min, vm_offset_t max); @@ -84,7 +82,6 @@ struct vmm_ops { vmi_set_register_t vmsetreg; vmi_get_desc_t vmgetdesc; vmi_set_desc_t vmsetdesc; - vmi_inject_event_t vminject; vmi_get_cap_t vmgetcap; vmi_set_cap_t vmsetcap; vmi_vmspace_alloc vmspace_alloc; @@ -117,8 +114,6 @@ int vm_get_seg_desc(struct vm *vm, int v int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc); int vm_run(struct vm *vm, struct vm_run *vmrun); -int vm_inject_event(struct vm *vm, int vcpu, int type, - int vector, uint32_t error_code, int error_code_valid); int vm_inject_nmi(struct vm *vm, int vcpu); int vm_nmi_pending(struct vm *vm, int vcpuid); void vm_nmi_clear(struct vm *vm, int vcpuid); @@ -192,6 +187,33 @@ void vcpu_notify_event(struct vm *vm, in struct vmspace *vm_get_vmspace(struct vm *vm); int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); + +/* + * Inject exception 'vme' into the guest vcpu. This function returns 0 on + * success and non-zero on failure. + * + * Wrapper functions like 'vm_inject_gp()' should be preferred to calling + * this function directly because they enforce the trap-like or fault-like + * behavior of an exception. + * + * This function should only be called in the context of the thread that is + * executing this vcpu. + */ +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 should only be called in the context of the thread that is + * executing this vcpu. + */ +int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); + +void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ +void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ + #endif /* KERNEL */ #include @@ -199,20 +221,6 @@ int vm_unassign_pptdev(struct vm *vm, in #define VM_MAXCPU 16 /* maximum virtual cpus */ /* - * Identifiers for events that can be injected into the VM - */ -enum vm_event_type { - VM_EVENT_NONE, - VM_HW_INTR, - VM_NMI, - VM_HW_EXCEPTION, - VM_SW_INTR, - VM_PRIV_SW_EXCEPTION, - VM_SW_EXCEPTION, - VM_EVENT_MAX -}; - -/* * Identifiers for architecturally defined registers. */ enum vm_reg_name { Modified: stable/10/sys/amd64/include/vmm_dev.h ============================================================================== --- stable/10/sys/amd64/include/vmm_dev.h Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/sys/amd64/include/vmm_dev.h Thu Jun 12 19:58:12 2014 (r267427) @@ -58,9 +58,8 @@ struct vm_run { struct vm_exit vm_exit; }; -struct vm_event { +struct vm_exception { int cpuid; - enum vm_event_type type; int vector; uint32_t error_code; int error_code_valid; @@ -174,7 +173,7 @@ enum { IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, /* interrupt injection */ - IOCNUM_INJECT_EVENT = 30, + IOCNUM_INJECT_EXCEPTION = 30, IOCNUM_LAPIC_IRQ = 31, IOCNUM_INJECT_NMI = 32, IOCNUM_IOAPIC_ASSERT_IRQ = 33, @@ -215,8 +214,8 @@ enum { _IOW('v', IOCNUM_SET_SEGMENT_DESCRIPTOR, struct vm_seg_desc) #define VM_GET_SEGMENT_DESCRIPTOR \ _IOWR('v', IOCNUM_GET_SEGMENT_DESCRIPTOR, struct vm_seg_desc) -#define VM_INJECT_EVENT \ - _IOW('v', IOCNUM_INJECT_EVENT, struct vm_event) +#define VM_INJECT_EXCEPTION \ + _IOW('v', IOCNUM_INJECT_EXCEPTION, struct vm_exception) #define VM_LAPIC_IRQ \ _IOW('v', IOCNUM_LAPIC_IRQ, struct vm_lapic_irq) #define VM_LAPIC_LOCAL_IRQ \ Modified: stable/10/sys/amd64/vmm/amd/amdv.c ============================================================================== --- stable/10/sys/amd64/vmm/amd/amdv.c Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/sys/amd64/vmm/amd/amdv.c Thu Jun 12 19:58:12 2014 (r267427) @@ -115,15 +115,6 @@ amdv_setdesc(void *vmi, int vcpu, int nu } static int -amdv_inject_event(void *vmi, int vcpu, int type, int vector, - uint32_t error_code, int error_code_valid) -{ - - printf("amdv_inject_event: not implemented\n"); - return (EINVAL); -} - -static int amdv_getcap(void *arg, int vcpu, int type, int *retval) { @@ -180,7 +171,6 @@ struct vmm_ops vmm_ops_amd = { amdv_setreg, amdv_getdesc, amdv_setdesc, - amdv_inject_event, amdv_getcap, amdv_setcap, amdv_vmspace_alloc, Modified: stable/10/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.h Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/sys/amd64/vmm/intel/vmcs.h Thu Jun 12 19:58:12 2014 (r267427) @@ -345,6 +345,8 @@ vmcs_write(uint32_t encoding, uint64_t v #define VMCS_INTR_T_MASK 0x700 /* Interruption-info type */ #define VMCS_INTR_T_HWINTR (0 << 8) #define VMCS_INTR_T_NMI (2 << 8) +#define VMCS_INTR_T_HWEXCEPTION (3 << 8) +#define VMCS_INTR_DEL_ERRCODE (1 << 11) /* * VMCS IDT-Vectoring information fields Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/sys/amd64/vmm/intel/vmx.c Thu Jun 12 19:58:12 2014 (r267427) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "vmm_host.h" #include "vmm_ipi.h" #include "vmm_msr.h" @@ -1090,10 +1091,27 @@ 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; uint64_t rflags; 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)); + + 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); + } + vmcs_write(VMCS_ENTRY_INTR_INFO, info); + } + if (vm_nmi_pending(vmx->vm, vcpu)) { /* * If there are no conditions blocking NMI injection then @@ -1169,6 +1187,7 @@ vmx_inject_interrupts(struct vmx *vmx, i * This is expected and could happen for multiple reasons: * - A vectoring VM-entry was aborted due to astpending * - A VM-exit happened during event injection. + * - An exception was injected above. * - An NMI was injected above or after "NMI window exiting" */ VCPU_CTR2(vmx->vm, vcpu, "Cannot inject vector %d due to " @@ -1228,6 +1247,82 @@ vmx_clear_nmi_blocking(struct vmx *vmx, } static int +vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) +{ + struct vmxctx *vmxctx; + uint64_t xcrval; + const struct xsave_limits *limits; + + vmxctx = &vmx->ctx[vcpu]; + limits = vmm_get_xsave_limits(); + + /* + * Note that the processor raises a GP# fault on its own if + * xsetbv is executed for CPL != 0, so we do not have to + * emulate that fault here. + */ + + /* Only xcr0 is supported. */ + if (vmxctx->guest_rcx != 0) { + vm_inject_gp(vmx->vm, vcpu); + return (HANDLED); + } + + /* We only handle xcr0 if both the host and guest have XSAVE enabled. */ + if (!limits->xsave_enabled || !(vmcs_read(VMCS_GUEST_CR4) & CR4_XSAVE)) { + vm_inject_ud(vmx->vm, vcpu); + return (HANDLED); + } + + xcrval = vmxctx->guest_rdx << 32 | (vmxctx->guest_rax & 0xffffffff); + if ((xcrval & ~limits->xcr0_allowed) != 0) { + vm_inject_gp(vmx->vm, vcpu); + return (HANDLED); + } + + if (!(xcrval & XFEATURE_ENABLED_X87)) { + vm_inject_gp(vmx->vm, vcpu); + return (HANDLED); + } + + /* AVX (YMM_Hi128) requires SSE. */ + if (xcrval & XFEATURE_ENABLED_AVX && + (xcrval & XFEATURE_AVX) != XFEATURE_AVX) { + vm_inject_gp(vmx->vm, vcpu); + return (HANDLED); + } + + /* + * AVX512 requires base AVX (YMM_Hi128) as well as OpMask, + * ZMM_Hi256, and Hi16_ZMM. + */ + if (xcrval & XFEATURE_AVX512 && + (xcrval & (XFEATURE_AVX512 | XFEATURE_AVX)) != + (XFEATURE_AVX512 | XFEATURE_AVX)) { + vm_inject_gp(vmx->vm, vcpu); + return (HANDLED); + } + + /* + * Intel MPX requires both bound register state flags to be + * set. + */ + if (((xcrval & XFEATURE_ENABLED_BNDREGS) != 0) != + ((xcrval & XFEATURE_ENABLED_BNDCSR) != 0)) { + vm_inject_gp(vmx->vm, vcpu); + return (HANDLED); + } + + /* + * This runs "inside" vmrun() with the guest's FPU state, so + * modifying xcr0 directly modifies the guest's xcr0, not the + * host's. + */ + load_xcr(0, xcrval); + return (HANDLED); +} + +static int vmx_emulate_cr_access(struct vmx *vmx, int vcpu, uint64_t exitqual) { int cr, vmcs_guest_cr, vmcs_shadow_cr; @@ -1413,7 +1508,7 @@ vmx_handle_apic_write(struct vlapic *vla if (!virtual_interrupt_delivery) return (UNHANDLED); - handled = 1; + handled = HANDLED; offset = APIC_WRITE_OFFSET(qual); switch (offset) { case APIC_OFFSET_ID: @@ -1435,7 +1530,7 @@ vmx_handle_apic_write(struct vlapic *vla retu = false; error = vlapic_icrlo_write_handler(vlapic, &retu); if (error != 0 || retu) - handled = 0; + handled = UNHANDLED; break; case APIC_OFFSET_CMCI_LVT: case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: @@ -1448,7 +1543,7 @@ vmx_handle_apic_write(struct vlapic *vla vlapic_dcr_write_handler(vlapic); break; default: - handled = 0; + handled = UNHANDLED; break; } return (handled); @@ -1548,7 +1643,7 @@ vmx_exit_process(struct vmx *vmx, int vc CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_NMI_EXITING) != 0); - handled = 0; + handled = UNHANDLED; vmxctx = &vmx->ctx[vcpu]; qual = vmexit->u.vmx.exit_qualification; @@ -1611,7 +1706,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->exitcode = VM_EXITCODE_RDMSR; vmexit->u.msr.code = ecx; } else if (!retu) { - handled = 1; + handled = HANDLED; } else { /* Return to userspace with a valid exitcode */ KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS, @@ -1631,7 +1726,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.msr.code = ecx; vmexit->u.msr.wval = (uint64_t)edx << 32 | eax; } else if (!retu) { - handled = 1; + handled = HANDLED; } else { /* Return to userspace with a valid exitcode */ KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS, @@ -1773,6 +1868,9 @@ vmx_exit_process(struct vmx *vmx, int vc vlapic = vm_lapic(vmx->vm, vcpu); handled = vmx_handle_apic_write(vlapic, qual); break; + case EXIT_REASON_XSETBV: + handled = vmx_emulate_xsetbv(vmx, vcpu, vmexit); + break; default: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_UNKNOWN, 1); break; @@ -2198,50 +2296,6 @@ vmx_setdesc(void *arg, int vcpu, int reg } static int -vmx_inject(void *arg, int vcpu, int type, int vector, uint32_t code, - int code_valid) -{ - int error; - uint64_t info; - struct vmx *vmx = arg; - struct vmcs *vmcs = &vmx->vmcs[vcpu]; - - static uint32_t type_map[VM_EVENT_MAX] = { - 0x1, /* VM_EVENT_NONE */ - 0x0, /* VM_HW_INTR */ - 0x2, /* VM_NMI */ - 0x3, /* VM_HW_EXCEPTION */ - 0x4, /* VM_SW_INTR */ - 0x5, /* VM_PRIV_SW_EXCEPTION */ - 0x6, /* VM_SW_EXCEPTION */ - }; - - /* - * If there is already an exception pending to be delivered to the - * vcpu then just return. - */ - error = vmcs_getreg(vmcs, 0, VMCS_IDENT(VMCS_ENTRY_INTR_INFO), &info); - if (error) - return (error); - - if (info & VMCS_INTR_VALID) - return (EAGAIN); - - info = vector | (type_map[type] << 8) | (code_valid ? 1 << 11 : 0); - info |= VMCS_INTR_VALID; - error = vmcs_setreg(vmcs, 0, VMCS_IDENT(VMCS_ENTRY_INTR_INFO), info); - if (error != 0) - return (error); - - if (code_valid) { - error = vmcs_setreg(vmcs, 0, - VMCS_IDENT(VMCS_ENTRY_EXCEPTION_ERROR), - code); - } - return (error); -} - -static int vmx_getcap(void *arg, int vcpu, int type, int *retval) { struct vmx *vmx = arg; @@ -2643,7 +2697,6 @@ struct vmm_ops vmm_ops_intel = { vmx_setreg, vmx_getdesc, vmx_setdesc, - vmx_inject, vmx_getcap, vmx_setcap, ept_vmspace_alloc, Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/sys/amd64/vmm/vmm.c Thu Jun 12 19:58:12 2014 (r267427) @@ -89,10 +89,13 @@ struct vcpu { struct vlapic *vlapic; int vcpuid; struct savefpu *guestfpu; /* guest fpu state */ + uint64_t guest_xcr0; void *stats; struct vm_exit exitinfo; enum x2apic_state x2apic_state; int nmi_pending; + struct vm_exception exception; + int exception_pending; }; #define vcpu_lock_init(v) mtx_init(&((v)->mtx), "vcpu lock", 0, MTX_SPIN) @@ -156,8 +159,6 @@ static struct vmm_ops *ops; (ops != NULL ? (*ops->vmgetdesc)(vmi, vcpu, num, desc) : ENXIO) #define VMSETDESC(vmi, vcpu, num, desc) \ (ops != NULL ? (*ops->vmsetdesc)(vmi, vcpu, num, desc) : ENXIO) -#define VMINJECT(vmi, vcpu, type, vec, ec, ecv) \ - (ops != NULL ? (*ops->vminject)(vmi, vcpu, type, vec, ec, ecv) : ENXIO) #define VMGETCAP(vmi, vcpu, num, retval) \ (ops != NULL ? (*ops->vmgetcap)(vmi, vcpu, num, retval) : ENXIO) #define VMSETCAP(vmi, vcpu, num, val) \ @@ -206,6 +207,7 @@ vcpu_init(struct vm *vm, uint32_t vcpu_i vcpu->vcpuid = vcpu_id; vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); vm_set_x2apic_state(vm, vcpu_id, X2APIC_ENABLED); + vcpu->guest_xcr0 = XFEATURE_ENABLED_X87; vcpu->guestfpu = fpu_save_area_alloc(); fpu_save_area_reset(vcpu->guestfpu); vcpu->stats = vmm_stat_alloc(); @@ -815,6 +817,10 @@ restore_guest_fpustate(struct vcpu *vcpu fpu_stop_emulating(); fpurestore(vcpu->guestfpu); + /* restore guest XCR0 if XSAVE is enabled in the host */ + if (rcr4() & CR4_XSAVE) + load_xcr(0, vcpu->guest_xcr0); + /* * The FPU is now "dirty" with the guest's state so turn on emulation * to trap any access to the FPU by the host. @@ -829,6 +835,12 @@ save_guest_fpustate(struct vcpu *vcpu) if ((rcr0() & CR0_TS) == 0) panic("fpu emulation not enabled in host!"); + /* save guest XCR0 and restore host XCR0 */ + if (rcr4() & CR4_XSAVE) { + vcpu->guest_xcr0 = rxcr(0); + load_xcr(0, vmm_get_host_xcr0()); + } + /* save guest FPU state */ fpu_stop_emulating(); fpusave(vcpu->guestfpu); @@ -1214,19 +1226,91 @@ restart: } int -vm_inject_event(struct vm *vm, int vcpuid, int type, - int vector, uint32_t code, int code_valid) +vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) { + struct vcpu *vcpu; + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) return (EINVAL); - if ((type > VM_EVENT_NONE && type < VM_EVENT_MAX) == 0) + if (exception->vector < 0 || exception->vector >= 32) return (EINVAL); - if (vector < 0 || vector > 255) - return (EINVAL); + vcpu = &vm->vcpu[vcpuid]; + + if (vcpu->exception_pending) { + VCPU_CTR2(vm, vcpuid, "Unable to inject exception %d due to " + "pending exception %d", exception->vector, + vcpu->exception.vector); + return (EBUSY); + } + + vcpu->exception_pending = 1; + vcpu->exception = *exception; + VCPU_CTR1(vm, vcpuid, "Exception %d pending", exception->vector); + 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) +{ + struct vm_exit *vmexit; + int error; + + error = vm_inject_exception(vm, vcpuid, exception); + KASSERT(error == 0, ("vm_inject_exception error %d", error)); + + /* + * A fault-like exception allows the instruction to be restarted + * after the exception handler returns. + * + * By setting the inst_length to 0 we ensure that the instruction + * pointer remains at the faulting instruction. + */ + vmexit = vm_exitinfo(vm, vcpuid); + vmexit->inst_length = 0; +} + +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 + }; - return (VMINJECT(vm->cookie, vcpuid, type, vector, code, code_valid)); + vm_inject_fault(vm, vcpuid, &udf); } static VMM_STAT(VCPU_NMI_COUNT, "number of NMIs delivered to vcpu"); Modified: stable/10/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_dev.c Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/sys/amd64/vmm/vmm_dev.c Thu Jun 12 19:58:12 2014 (r267427) @@ -150,7 +150,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_register *vmreg; struct vm_seg_desc *vmsegdesc; struct vm_run *vmrun; - struct vm_event *vmevent; + struct vm_exception *vmexc; struct vm_lapic_irq *vmirq; struct vm_lapic_msi *vmmsi; struct vm_ioapic_irq *ioapic_irq; @@ -181,7 +181,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c case VM_SET_REGISTER: case VM_GET_SEGMENT_DESCRIPTOR: case VM_SET_SEGMENT_DESCRIPTOR: - case VM_INJECT_EVENT: + case VM_INJECT_EXCEPTION: case VM_GET_CAPABILITY: case VM_SET_CAPABILITY: case VM_PPTDEV_MSI: @@ -282,12 +282,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long c error = vm_unassign_pptdev(sc->vm, pptdev->bus, pptdev->slot, pptdev->func); break; - case VM_INJECT_EVENT: - vmevent = (struct vm_event *)data; - error = vm_inject_event(sc->vm, vmevent->cpuid, vmevent->type, - vmevent->vector, - vmevent->error_code, - vmevent->error_code_valid); + case VM_INJECT_EXCEPTION: + vmexc = (struct vm_exception *)data; + error = vm_inject_exception(sc->vm, vmexc->cpuid, vmexc); break; case VM_INJECT_NMI: vmnmi = (struct vm_nmi *)data; Modified: stable/10/sys/amd64/vmm/vmm_host.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_host.c Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/sys/amd64/vmm/vmm_host.c Thu Jun 12 19:58:12 2014 (r267427) @@ -38,11 +38,14 @@ __FBSDID("$FreeBSD$"); #include "vmm_host.h" -static uint64_t vmm_host_efer, vmm_host_pat, vmm_host_cr0, vmm_host_cr4; +static uint64_t vmm_host_efer, vmm_host_pat, vmm_host_cr0, vmm_host_cr4, + vmm_host_xcr0; +static struct xsave_limits vmm_xsave_limits; void vmm_host_state_init(void) { + int regs[4]; vmm_host_efer = rdmsr(MSR_EFER); vmm_host_pat = rdmsr(MSR_PAT); @@ -57,6 +60,26 @@ vmm_host_state_init(void) vmm_host_cr0 = rcr0() | CR0_TS; vmm_host_cr4 = rcr4(); + + /* + * Only permit a guest to use XSAVE if the host is using + * XSAVE. Only permit a guest to use XSAVE features supported + * by the host. This ensures that the FPU state used by the + * guest is always a subset of the saved guest FPU state. + * + * In addition, only permit known XSAVE features where the + * rules for which features depend on other features is known + * to properly emulate xsetbv. + */ + if (vmm_host_cr4 & CR4_XSAVE) { + vmm_xsave_limits.xsave_enabled = 1; + vmm_host_xcr0 = rxcr(0); + vmm_xsave_limits.xcr0_allowed = vmm_host_xcr0 & + (XFEATURE_AVX | XFEATURE_MPX | XFEATURE_AVX512); + + cpuid_count(0xd, 0x0, regs); + vmm_xsave_limits.xsave_max_size = regs[1]; + } } uint64_t @@ -88,6 +111,13 @@ vmm_get_host_cr4(void) } uint64_t +vmm_get_host_xcr0(void) +{ + + return (vmm_host_xcr0); +} + +uint64_t vmm_get_host_datasel(void) { @@ -122,3 +152,10 @@ vmm_get_host_idtrbase(void) return (r_idt.rd_base); } + +const struct xsave_limits * +vmm_get_xsave_limits(void) +{ + + return (&vmm_xsave_limits); +} Modified: stable/10/sys/amd64/vmm/vmm_host.h ============================================================================== --- stable/10/sys/amd64/vmm/vmm_host.h Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/sys/amd64/vmm/vmm_host.h Thu Jun 12 19:58:12 2014 (r267427) @@ -33,17 +33,25 @@ #error "no user-servicable parts inside" #endif +struct xsave_limits { + int xsave_enabled; + uint64_t xcr0_allowed; + uint32_t xsave_max_size; +}; + void vmm_host_state_init(void); uint64_t vmm_get_host_pat(void); uint64_t vmm_get_host_efer(void); uint64_t vmm_get_host_cr0(void); uint64_t vmm_get_host_cr4(void); +uint64_t vmm_get_host_xcr0(void); uint64_t vmm_get_host_datasel(void); uint64_t vmm_get_host_codesel(void); uint64_t vmm_get_host_tsssel(void); uint64_t vmm_get_host_fsbase(void); uint64_t vmm_get_host_idtrbase(void); +const struct xsave_limits *vmm_get_xsave_limits(void); /* * Inline access to host state that is used on every VM entry Modified: stable/10/sys/amd64/vmm/x86.c ============================================================================== --- stable/10/sys/amd64/vmm/x86.c Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/sys/amd64/vmm/x86.c Thu Jun 12 19:58:12 2014 (r267427) @@ -30,17 +30,19 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include #include #include +#include #include #include +#include "vmm_host.h" #include "x86.h" #define CPUID_VM_HIGH 0x40000000 @@ -53,6 +55,8 @@ int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) { + const struct xsave_limits *limits; + uint64_t cr4; int error, enable_invpcid; unsigned int func, regs[4]; enum x2apic_state x2apic_state; @@ -147,11 +151,27 @@ x86_emulate_cpuid(struct vm *vm, int vcp regs[2] |= CPUID2_X2APIC; /* - * Hide xsave/osxsave/avx until the FPU save/restore - * issues are resolved + * Only advertise CPUID2_XSAVE in the guest if + * the host is using XSAVE. */ - regs[2] &= ~(CPUID2_XSAVE | CPUID2_OSXSAVE | - CPUID2_AVX); + if (!(regs[2] & CPUID2_OSXSAVE)) + regs[2] &= ~CPUID2_XSAVE; + + /* + * If CPUID2_XSAVE is being advertised and the + * guest has set CR4_XSAVE, set + * CPUID2_OSXSAVE. + */ + regs[2] &= ~CPUID2_OSXSAVE; + if (regs[2] & CPUID2_XSAVE) { + error = vm_get_register(vm, vcpu_id, + VM_REG_GUEST_CR4, &cr4); + if (error) + panic("x86_emulate_cpuid: error %d " + "fetching %%cr4", error); + if (cr4 & CR4_XSAVE) + regs[2] |= CPUID2_OSXSAVE; + } /* * Hide monitor/mwait until we know how to deal with @@ -210,6 +230,26 @@ x86_emulate_cpuid(struct vm *vm, int vcp /* leaf 0 */ if (*ecx == 0) { + cpuid_count(*eax, *ecx, regs); + + /* Only leaf 0 is supported */ + regs[0] = 0; + + /* + * Expose known-safe features. + */ + regs[1] &= (CPUID_STDEXT_FSGSBASE | + CPUID_STDEXT_BMI1 | CPUID_STDEXT_HLE | + CPUID_STDEXT_AVX2 | CPUID_STDEXT_BMI2 | + CPUID_STDEXT_ERMS | CPUID_STDEXT_RTM | + CPUID_STDEXT_AVX512F | + CPUID_STDEXT_AVX512PF | + CPUID_STDEXT_AVX512ER | + CPUID_STDEXT_AVX512CD); + regs[2] = 0; + regs[3] = 0; + + /* Advertise INVPCID if it is enabled. */ error = vm_get_capability(vm, vcpu_id, VM_CAP_ENABLE_INVPCID, &enable_invpcid); if (error == 0 && enable_invpcid) @@ -219,7 +259,6 @@ x86_emulate_cpuid(struct vm *vm, int vcp case CPUID_0000_0006: case CPUID_0000_000A: - case CPUID_0000_000D: /* * Handle the access, but report 0 for * all options @@ -240,6 +279,57 @@ x86_emulate_cpuid(struct vm *vm, int vcp regs[3] = vcpu_id; break; + case CPUID_0000_000D: + limits = vmm_get_xsave_limits(); + if (!limits->xsave_enabled) { + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + break; + } + + cpuid_count(*eax, *ecx, regs); + switch (*ecx) { + case 0: + /* + * Only permit the guest to use bits + * that are active in the host in + * %xcr0. Also, claim that the + * maximum save area size is + * equivalent to the host's current + * save area size. Since this runs + * "inside" of vmrun(), it runs with + * the guest's xcr0, so the current + * save area size is correct as-is. + */ + regs[0] &= limits->xcr0_allowed; + regs[2] = limits->xsave_max_size; + regs[3] &= (limits->xcr0_allowed >> 32); + break; + case 1: + /* Only permit XSAVEOPT. */ + regs[0] &= CPUID_EXTSTATE_XSAVEOPT; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + break; + default: + /* + * If the leaf is for a permitted feature, + * pass through as-is, otherwise return + * all zeroes. + */ + if (!(limits->xcr0_allowed & (1ul << *ecx))) { + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + } + break; + } + break; + case 0x40000000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, ®s[1], 4); Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Thu Jun 12 19:01:57 2014 (r267426) +++ stable/10/usr.sbin/bhyve/bhyverun.c Thu Jun 12 19:58:12 2014 (r267427) @@ -326,8 +326,11 @@ vmexit_rdmsr(struct vmctx *ctx, struct v if (error != 0) { fprintf(stderr, "rdmsr to register %#x on vcpu %d\n", vme->u.msr.code, *pvcpu); - if (strictmsr) - return (VMEXIT_ABORT); + if (strictmsr) { + error = vm_inject_exception2(ctx, *pvcpu, IDT_GP, 0); + assert(error == 0); + return (VMEXIT_RESTART); + } } eax = val; @@ -350,8 +353,11 @@ vmexit_wrmsr(struct vmctx *ctx, struct v if (error != 0) { fprintf(stderr, "wrmsr to register %#x(%#lx) on vcpu %d\n", vme->u.msr.code, vme->u.msr.wval, *pvcpu); - if (strictmsr) - return (VMEXIT_ABORT); + if (strictmsr) { + error = vm_inject_exception2(ctx, *pvcpu, IDT_GP, 0); + assert(error == 0); + return (VMEXIT_RESTART); + } } return (VMEXIT_CONTINUE); } From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 12 21:36:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B9610D4; Thu, 12 Jun 2014 21:36: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 A62A02B30; Thu, 12 Jun 2014 21:36: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 s5CLaHI3073964; Thu, 12 Jun 2014 21:36:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CLaHn9073963; Thu, 12 Jun 2014 21:36:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406122136.s5CLaHn9073963@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jun 2014 21:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267428 - stable/10/sys/amd64/vmm/intel X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 21:36:17 -0000 Author: jhb Date: Thu Jun 12 21:36:17 2014 New Revision: 267428 URL: http://svnweb.freebsd.org/changeset/base/267428 Log: MFC 262615,262624: Workaround an apparent bug in VMWare Fusion's nested VT support where it triggers a VM exit with the exit reason of an external interrupt but without a valid interrupt set in the exit interrupt information. Modified: stable/10/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Thu Jun 12 19:58:12 2014 (r267427) +++ stable/10/sys/amd64/vmm/intel/vmx.c Thu Jun 12 21:36:17 2014 (r267428) @@ -1761,6 +1761,13 @@ vmx_exit_process(struct vmx *vmx, int vc * this virtual interrupt during the subsequent VM enter. */ intr_info = vmcs_read(VMCS_EXIT_INTR_INFO); + + /* + * XXX: Ignore this exit if VMCS_INTR_VALID is not set. + * This appears to be a bug in VMware Fusion? + */ + if (!(intr_info & VMCS_INTR_VALID)) + return (1); KASSERT((intr_info & VMCS_INTR_VALID) != 0 && (intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_HWINTR, ("VM exit interruption info invalid: %#x", intr_info)); From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 13 07:33:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C66DD1D9; Fri, 13 Jun 2014 07:33: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 B30F32B38; Fri, 13 Jun 2014 07:33:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5D7XhHd044615; Fri, 13 Jun 2014 07:33:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5D7XhYx044614; Fri, 13 Jun 2014 07:33:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406130733.s5D7XhYx044614@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 13 Jun 2014 07:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267435 - stable/10/lib/libusb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 07:33:43 -0000 Author: hselasky Date: Fri Jun 13 07:33:43 2014 New Revision: 267435 URL: http://svnweb.freebsd.org/changeset/base/267435 Log: MFC r263191: Add libusb_log_level enum. Modified: stable/10/lib/libusb/libusb.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libusb/libusb.h ============================================================================== --- stable/10/lib/libusb/libusb.h Fri Jun 13 07:23:46 2014 (r267434) +++ stable/10/lib/libusb/libusb.h Fri Jun 13 07:33:43 2014 (r267435) @@ -194,6 +194,19 @@ enum libusb_transfer_flags { LIBUSB_TRANSFER_FREE_TRANSFER = 1 << 2, }; +enum libusb_log_level { + LIBUSB_LOG_LEVEL_NONE = 0, + LIBUSB_LOG_LEVEL_ERROR, + LIBUSB_LOG_LEVEL_WARNING, + LIBUSB_LOG_LEVEL_INFO, + LIBUSB_LOG_LEVEL_DEBUG +}; + +/* XXX */ +/* libusb_set_debug should take parameters from libusb_log_level + * above according to + * http://libusb.sourceforge.net/api-1.0/group__lib.html + */ enum libusb_debug_level { LIBUSB_DEBUG_NO=0, LIBUSB_DEBUG_FUNCTION=1, From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 13 12:01:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BE4E1519; Fri, 13 Jun 2014 12:01: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 AB2B824B0; Fri, 13 Jun 2014 12:01: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 s5DC1tQ6070634; Fri, 13 Jun 2014 12:01:55 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DC1tT6070633; Fri, 13 Jun 2014 12:01:55 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201406131201.s5DC1tT6070633@svn.freebsd.org> From: Christian Brueffer Date: Fri, 13 Jun 2014 12:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267442 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 12:01:55 -0000 Author: brueffer Date: Fri Jun 13 12:01:55 2014 New Revision: 267442 URL: http://svnweb.freebsd.org/changeset/base/267442 Log: MFC: r267185 Minor improvements. Modified: stable/10/share/man/man4/xnb.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/xnb.4 ============================================================================== --- stable/10/share/man/man4/xnb.4 Fri Jun 13 10:08:18 2014 (r267441) +++ stable/10/share/man/man4/xnb.4 Fri Jun 13 12:01:55 2014 (r267442) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2012 +.Dd June 6, 2014 .Dt XNB 4 .Os .Sh NAME @@ -116,7 +116,9 @@ machine. However, when a Xennet interface is bridged to a physical interface, a correct checksum must be attached to any packets bound for that physical interface. -Currently, FreeBSD lacks any mechanism for an ethernet device to +Currently, +.Fx +lacks any mechanism for an Ethernet device to inform the OS that newly received packets are valid even though their checksums are not. So if the netfront driver is configured to offload checksum calculations, From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 13 12:39:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1E802E7D; Fri, 13 Jun 2014 12:39:07 +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 E595227A7; Fri, 13 Jun 2014 12:39: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 s5DCd6SB087206; Fri, 13 Jun 2014 12:39:06 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DCd6MY087205; Fri, 13 Jun 2014 12:39:06 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201406131239.s5DCd6MY087205@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 13 Jun 2014 12:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267443 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 12:39:07 -0000 Author: jilles Date: Fri Jun 13 12:39:06 2014 New Revision: 267443 URL: http://svnweb.freebsd.org/changeset/base/267443 Log: MFC r267162: ktrace: Use designated initializers for the data_lengths array. In the .o file, this only changes some line numbers (stable/10 amd64) because element 0 is no longer explicitly initialized. This should make bugs like FreeBSD-SA-14:12.ktrace less likely. Discussed with: des Modified: stable/10/sys/kern/kern_ktrace.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_ktrace.c ============================================================================== --- stable/10/sys/kern/kern_ktrace.c Fri Jun 13 12:01:55 2014 (r267442) +++ stable/10/sys/kern/kern_ktrace.c Fri Jun 13 12:39:06 2014 (r267443) @@ -109,21 +109,20 @@ struct ktr_request { }; static int data_lengths[] = { - 0, /* none */ - offsetof(struct ktr_syscall, ktr_args), /* KTR_SYSCALL */ - sizeof(struct ktr_sysret), /* KTR_SYSRET */ - 0, /* KTR_NAMEI */ - sizeof(struct ktr_genio), /* KTR_GENIO */ - sizeof(struct ktr_psig), /* KTR_PSIG */ - sizeof(struct ktr_csw), /* KTR_CSW */ - 0, /* KTR_USER */ - 0, /* KTR_STRUCT */ - 0, /* KTR_SYSCTL */ - sizeof(struct ktr_proc_ctor), /* KTR_PROCCTOR */ - 0, /* KTR_PROCDTOR */ - sizeof(struct ktr_cap_fail), /* KTR_CAPFAIL */ - sizeof(struct ktr_fault), /* KTR_FAULT */ - sizeof(struct ktr_faultend), /* KTR_FAULTEND */ + [KTR_SYSCALL] = offsetof(struct ktr_syscall, ktr_args), + [KTR_SYSRET] = sizeof(struct ktr_sysret), + [KTR_NAMEI] = 0, + [KTR_GENIO] = sizeof(struct ktr_genio), + [KTR_PSIG] = sizeof(struct ktr_psig), + [KTR_CSW] = sizeof(struct ktr_csw), + [KTR_USER] = 0, + [KTR_STRUCT] = 0, + [KTR_SYSCTL] = 0, + [KTR_PROCCTOR] = sizeof(struct ktr_proc_ctor), + [KTR_PROCDTOR] = 0, + [KTR_CAPFAIL] = sizeof(struct ktr_cap_fail), + [KTR_FAULT] = sizeof(struct ktr_fault), + [KTR_FAULTEND] = sizeof(struct ktr_faultend), }; static STAILQ_HEAD(, ktr_request) ktr_free; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 13 15:04:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2760C3D3; Fri, 13 Jun 2014 15:04: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 144E624F2; Fri, 13 Jun 2014 15:04: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 s5DF4L96055484; Fri, 13 Jun 2014 15:04:21 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DF4L7n055482; Fri, 13 Jun 2014 15:04:21 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201406131504.s5DF4L7n055482@svn.freebsd.org> From: Bryan Drewery Date: Fri, 13 Jun 2014 15:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267444 - stable/10/usr.bin/rpcgen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 15:04:22 -0000 Author: bdrewery Date: Fri Jun 13 15:04:21 2014 New Revision: 267444 URL: http://svnweb.freebsd.org/changeset/base/267444 Log: MFC r267174: Fix some rpcgen sample file issues. PR: 185582 Modified: stable/10/usr.bin/rpcgen/rpc_main.c stable/10/usr.bin/rpcgen/rpc_sample.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/rpcgen/rpc_main.c ============================================================================== --- stable/10/usr.bin/rpcgen/rpc_main.c Fri Jun 13 12:39:06 2014 (r267443) +++ stable/10/usr.bin/rpcgen/rpc_main.c Fri Jun 13 15:04:21 2014 (r267444) @@ -872,8 +872,8 @@ $(TARGETS_SVC.c) \n\n"); f_print(fout, "\t$(CC) -o $(CLIENT) $(OBJECTS_CLNT) \ $(LDLIBS) \n\n"); f_print(fout, "$(SERVER) : $(OBJECTS_SVC) \n"); - f_print(fout, "\t$(CC) -o $(SERVER) $(OBJECTS_SVC) $(LDLIBS)\n\n "); - f_print(fout, "clean:\n\t $(RM) -f core $(TARGETS) $(OBJECTS_CLNT) \ + f_print(fout, "\t$(CC) -o $(SERVER) $(OBJECTS_SVC) $(LDLIBS)\n\n"); + f_print(fout, "clean:\n\t rm -f core $(TARGETS) $(OBJECTS_CLNT) \ $(OBJECTS_SVC) $(CLIENT) $(SERVER)\n\n"); } Modified: stable/10/usr.bin/rpcgen/rpc_sample.c ============================================================================== --- stable/10/usr.bin/rpcgen/rpc_sample.c Fri Jun 13 12:39:06 2014 (r267443) +++ stable/10/usr.bin/rpcgen/rpc_sample.c Fri Jun 13 15:04:21 2014 (r267444) @@ -270,6 +270,7 @@ write_sample_clnt_main(void) version_list *vp; f_print(fout, "\n\n"); + f_print(fout, "int\n"); f_print(fout, "main(int argc, char *argv[])\n{\n"); f_print(fout, "\tchar *host;"); From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 13 19:10:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AA4C6A2A; Fri, 13 Jun 2014 19:10: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 943952C3C; Fri, 13 Jun 2014 19:10: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 s5DJAgDQ070782; Fri, 13 Jun 2014 19:10:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DJAenu070766; Fri, 13 Jun 2014 19:10:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406131910.s5DJAenu070766@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jun 2014 19:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267447 - in stable/10: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 19:10:42 -0000 Author: jhb Date: Fri Jun 13 19:10:40 2014 New Revision: 267447 URL: http://svnweb.freebsd.org/changeset/base/267447 Log: MFC 262139,262140,262236,262281,262532: Various x2APIC fixes and enhancements: - Use spinlocks for the vioapic. - Handle the SELF_IPI MSR. - Simplify the APIC mode switching between MMIO and x2APIC. The guest is no longer allowed to switch modes at runtime. Instead, the desired mode is set when the virtual machine is created. - Disallow MMIO access in x2APIC mode and MSR access in xAPIC mode. - Add support for x2APIC virtualization assist in Intel VT-x. Modified: stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/io/vioapic.c stable/10/sys/amd64/vmm/io/vlapic.c stable/10/sys/amd64/vmm/io/vlapic.h stable/10/sys/amd64/vmm/io/vlapic_priv.h stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_lapic.c stable/10/sys/amd64/vmm/x86.c stable/10/usr.sbin/bhyve/bhyve.8 stable/10/usr.sbin/bhyve/bhyverun.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/sys/amd64/include/vmm.h Fri Jun 13 19:10:40 2014 (r267447) @@ -273,9 +273,8 @@ enum vm_cap_type { }; enum x2apic_state { - X2APIC_ENABLED, - X2APIC_AVAILABLE, X2APIC_DISABLED, + X2APIC_ENABLED, X2APIC_STATE_LAST }; Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/sys/amd64/vmm/intel/vmx.c Fri Jun 13 19:10:40 2014 (r267447) @@ -114,6 +114,9 @@ __FBSDID("$FreeBSD$"); #define guest_msr_rw(vmx, msr) \ msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_RW) +#define guest_msr_ro(vmx, msr) \ + msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_READ) + #define HANDLED 1 #define UNHANDLED 0 @@ -302,6 +305,54 @@ exit_reason_to_str(int reason) } #endif /* KTR */ +static int +vmx_allow_x2apic_msrs(struct vmx *vmx) +{ + int i, error; + + error = 0; + + /* + * Allow readonly access to the following x2APIC MSRs from the guest. + */ + error += guest_msr_ro(vmx, MSR_APIC_ID); + error += guest_msr_ro(vmx, MSR_APIC_VERSION); + error += guest_msr_ro(vmx, MSR_APIC_LDR); + error += guest_msr_ro(vmx, MSR_APIC_SVR); + + for (i = 0; i < 8; i++) + error += guest_msr_ro(vmx, MSR_APIC_ISR0 + i); + + for (i = 0; i < 8; i++) + error += guest_msr_ro(vmx, MSR_APIC_TMR0 + i); + + for (i = 0; i < 8; i++) + error += guest_msr_ro(vmx, MSR_APIC_IRR0 + i); + + error += guest_msr_ro(vmx, MSR_APIC_ESR); + error += guest_msr_ro(vmx, MSR_APIC_LVT_TIMER); + error += guest_msr_ro(vmx, MSR_APIC_LVT_THERMAL); + error += guest_msr_ro(vmx, MSR_APIC_LVT_PCINT); + error += guest_msr_ro(vmx, MSR_APIC_LVT_LINT0); + error += guest_msr_ro(vmx, MSR_APIC_LVT_LINT1); + error += guest_msr_ro(vmx, MSR_APIC_LVT_ERROR); + error += guest_msr_ro(vmx, MSR_APIC_ICR_TIMER); + error += guest_msr_ro(vmx, MSR_APIC_DCR_TIMER); + error += guest_msr_ro(vmx, MSR_APIC_ICR); + + /* + * Allow TPR, EOI and SELF_IPI MSRs to be read and written by the guest. + * + * These registers get special treatment described in the section + * "Virtualizing MSR-Based APIC Accesses". + */ + error += guest_msr_rw(vmx, MSR_APIC_TPR); + error += guest_msr_rw(vmx, MSR_APIC_EOI); + error += guest_msr_rw(vmx, MSR_APIC_SELF_IPI); + + return (error); +} + u_long vmx_fix_cr0(u_long cr0) { @@ -1499,17 +1550,53 @@ ept_emulation_fault(uint64_t ept_qual) return (TRUE); } +static __inline int +apic_access_virtualization(struct vmx *vmx, int vcpuid) +{ + uint32_t proc_ctls2; + + proc_ctls2 = vmx->cap[vcpuid].proc_ctls2; + return ((proc_ctls2 & PROCBASED2_VIRTUALIZE_APIC_ACCESSES) ? 1 : 0); +} + +static __inline int +x2apic_virtualization(struct vmx *vmx, int vcpuid) +{ + uint32_t proc_ctls2; + + proc_ctls2 = vmx->cap[vcpuid].proc_ctls2; + return ((proc_ctls2 & PROCBASED2_VIRTUALIZE_X2APIC_MODE) ? 1 : 0); +} + static int -vmx_handle_apic_write(struct vlapic *vlapic, uint64_t qual) +vmx_handle_apic_write(struct vmx *vmx, int vcpuid, struct vlapic *vlapic, + uint64_t qual) { int error, handled, offset; + uint32_t *apic_regs, vector; bool retu; - if (!virtual_interrupt_delivery) - return (UNHANDLED); - handled = HANDLED; offset = APIC_WRITE_OFFSET(qual); + + if (!apic_access_virtualization(vmx, vcpuid)) { + /* + * In general there should not be any APIC write VM-exits + * unless APIC-access virtualization is enabled. + * + * However self-IPI virtualization can legitimately trigger + * an APIC-write VM-exit so treat it specially. + */ + if (x2apic_virtualization(vmx, vcpuid) && + offset == APIC_OFFSET_SELF_IPI) { + apic_regs = (uint32_t *)(vlapic->apic_page); + vector = apic_regs[APIC_OFFSET_SELF_IPI / 4]; + vlapic_self_ipi_handler(vlapic, vector); + return (HANDLED); + } else + return (UNHANDLED); + } + switch (offset) { case APIC_OFFSET_ID: vlapic_id_write_handler(vlapic); @@ -1550,10 +1637,10 @@ vmx_handle_apic_write(struct vlapic *vla } static bool -apic_access_fault(uint64_t gpa) +apic_access_fault(struct vmx *vmx, int vcpuid, uint64_t gpa) { - if (virtual_interrupt_delivery && + if (apic_access_virtualization(vmx, vcpuid) && (gpa >= DEFAULT_APIC_BASE && gpa < DEFAULT_APIC_BASE + PAGE_SIZE)) return (true); else @@ -1566,7 +1653,7 @@ vmx_handle_apic_access(struct vmx *vmx, uint64_t qual; int access_type, offset, allowed; - if (!virtual_interrupt_delivery) + if (!apic_access_virtualization(vmx, vcpuid)) return (UNHANDLED); qual = vmexit->u.vmx.exit_qualification; @@ -1832,7 +1919,8 @@ vmx_exit_process(struct vmx *vmx, int vc * this must be an instruction that accesses MMIO space. */ gpa = vmcs_gpa(); - if (vm_mem_allocated(vmx->vm, gpa) || apic_access_fault(gpa)) { + if (vm_mem_allocated(vmx->vm, gpa) || + apic_access_fault(vmx, vcpu, gpa)) { vmexit->exitcode = VM_EXITCODE_PAGING; vmexit->u.paging.gpa = gpa; vmexit->u.paging.fault_type = ept_fault_type(qual); @@ -1873,7 +1961,7 @@ vmx_exit_process(struct vmx *vmx, int vc */ vmexit->inst_length = 0; vlapic = vm_lapic(vmx->vm, vcpu); - handled = vmx_handle_apic_write(vlapic, qual); + handled = vmx_handle_apic_write(vmx, vcpu, vlapic, qual); break; case EXIT_REASON_XSETBV: handled = vmx_emulate_xsetbv(vmx, vcpu, vmexit); @@ -2119,7 +2207,7 @@ vmx_vmcleanup(void *arg) int i, error; struct vmx *vmx = arg; - if (virtual_interrupt_delivery) + if (apic_access_virtualization(vmx, 0)) vm_unmap_mmio(vmx->vm, DEFAULT_APIC_BASE, PAGE_SIZE); for (i = 0; i < VM_MAXCPU; i++) @@ -2571,6 +2659,49 @@ vmx_set_tmr(struct vlapic *vlapic, int v } static void +vmx_enable_x2apic_mode(struct vlapic *vlapic) +{ + struct vmx *vmx; + struct vmcs *vmcs; + uint32_t proc_ctls2; + int vcpuid, error; + + vcpuid = vlapic->vcpuid; + vmx = ((struct vlapic_vtx *)vlapic)->vmx; + vmcs = &vmx->vmcs[vcpuid]; + + proc_ctls2 = vmx->cap[vcpuid].proc_ctls2; + KASSERT((proc_ctls2 & PROCBASED2_VIRTUALIZE_APIC_ACCESSES) != 0, + ("%s: invalid proc_ctls2 %#x", __func__, proc_ctls2)); + + proc_ctls2 &= ~PROCBASED2_VIRTUALIZE_APIC_ACCESSES; + proc_ctls2 |= PROCBASED2_VIRTUALIZE_X2APIC_MODE; + vmx->cap[vcpuid].proc_ctls2 = proc_ctls2; + + VMPTRLD(vmcs); + vmcs_write(VMCS_SEC_PROC_BASED_CTLS, proc_ctls2); + VMCLEAR(vmcs); + + if (vlapic->vcpuid == 0) { + /* + * The nested page table mappings are shared by all vcpus + * so unmap the APIC access page just once. + */ + error = vm_unmap_mmio(vmx->vm, DEFAULT_APIC_BASE, PAGE_SIZE); + KASSERT(error == 0, ("%s: vm_unmap_mmio error %d", + __func__, error)); + + /* + * The MSR bitmap is shared by all vcpus so modify it only + * once in the context of vcpu 0. + */ + error = vmx_allow_x2apic_msrs(vmx); + KASSERT(error == 0, ("%s: vmx_allow_x2apic_msrs error %d", + __func__, error)); + } +} + +static void vmx_post_intr(struct vlapic *vlapic, int hostcpu) { @@ -2675,6 +2806,7 @@ vmx_vlapic_init(void *arg, int vcpuid) vlapic->ops.pending_intr = vmx_pending_intr; vlapic->ops.intr_accepted = vmx_intr_accepted; vlapic->ops.set_tmr = vmx_set_tmr; + vlapic->ops.enable_x2apic_mode = vmx_enable_x2apic_mode; } if (posted_interrupts) Modified: stable/10/sys/amd64/vmm/io/vioapic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vioapic.c Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/sys/amd64/vmm/io/vioapic.c Fri Jun 13 19:10:40 2014 (r267447) @@ -64,8 +64,8 @@ struct vioapic { } rtbl[REDIR_ENTRIES]; }; -#define VIOAPIC_LOCK(vioapic) mtx_lock(&((vioapic)->mtx)) -#define VIOAPIC_UNLOCK(vioapic) mtx_unlock(&((vioapic)->mtx)) +#define VIOAPIC_LOCK(vioapic) mtx_lock_spin(&((vioapic)->mtx)) +#define VIOAPIC_UNLOCK(vioapic) mtx_unlock_spin(&((vioapic)->mtx)) #define VIOAPIC_LOCKED(vioapic) mtx_owned(&((vioapic)->mtx)) static MALLOC_DEFINE(M_VIOAPIC, "vioapic", "bhyve virtual ioapic"); @@ -476,7 +476,7 @@ vioapic_init(struct vm *vm) vioapic = malloc(sizeof(struct vioapic), M_VIOAPIC, M_WAITOK | M_ZERO); vioapic->vm = vm; - mtx_init(&vioapic->mtx, "vioapic lock", NULL, MTX_DEF); + mtx_init(&vioapic->mtx, "vioapic lock", NULL, MTX_SPIN); /* Initialize all redirection entries to mask all interrupts */ for (i = 0; i < REDIR_ENTRIES; i++) Modified: stable/10/sys/amd64/vmm/io/vlapic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vlapic.c Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/sys/amd64/vmm/io/vlapic.c Fri Jun 13 19:10:40 2014 (r267447) @@ -289,9 +289,11 @@ vlapic_set_intr_ready(struct vlapic *vla * the vlapic TMR registers. */ tmrptr = &lapic->tmr0; - KASSERT((tmrptr[idx] & mask) == (level ? mask : 0), - ("vlapic TMR[%d] is 0x%08x but interrupt is %s-triggered", - idx / 4, tmrptr[idx], level ? "level" : "edge")); + if ((tmrptr[idx] & mask) != (level ? mask : 0)) { + VLAPIC_CTR3(vlapic, "vlapic TMR[%d] is 0x%08x but " + "interrupt is %s-triggered", idx / 4, tmrptr[idx], + level ? "level" : "edge"); + } VLAPIC_CTR_IRR(vlapic, "vlapic_set_intr_ready"); return (1); @@ -997,6 +999,20 @@ vlapic_icrlo_write_handler(struct vlapic return (1); } +void +vlapic_self_ipi_handler(struct vlapic *vlapic, uint64_t val) +{ + int vec; + + KASSERT(x2apic(vlapic), ("SELF_IPI does not exist in xAPIC mode")); + + vec = val & 0xff; + lapic_intr_edge(vlapic->vm, vlapic->vcpuid, vec); + vmm_stat_array_incr(vlapic->vm, vlapic->vcpuid, IPIS_SENT, + vlapic->vcpuid, 1); + VLAPIC_CTR1(vlapic, "vlapic self-ipi %d", vec); +} + int vlapic_pending_intr(struct vlapic *vlapic, int *vecptr) { @@ -1105,12 +1121,31 @@ vlapic_svr_write_handler(struct vlapic * } int -vlapic_read(struct vlapic *vlapic, uint64_t offset, uint64_t *data, bool *retu) +vlapic_read(struct vlapic *vlapic, int mmio_access, uint64_t offset, + uint64_t *data, bool *retu) { struct LAPIC *lapic = vlapic->apic_page; uint32_t *reg; int i; + /* Ignore MMIO accesses in x2APIC mode */ + if (x2apic(vlapic) && mmio_access) { + VLAPIC_CTR1(vlapic, "MMIO read from offset %#lx in x2APIC mode", + offset); + *data = 0; + goto done; + } + + if (!x2apic(vlapic) && !mmio_access) { + /* + * XXX Generate GP fault for MSR accesses in xAPIC mode + */ + VLAPIC_CTR1(vlapic, "x2APIC MSR read from offset %#lx in " + "xAPIC mode", offset); + *data = 0; + goto done; + } + if (offset > sizeof(*lapic)) { *data = 0; goto done; @@ -1190,6 +1225,12 @@ vlapic_read(struct vlapic *vlapic, uint6 case APIC_OFFSET_TIMER_DCR: *data = lapic->dcr_timer; break; + case APIC_OFFSET_SELF_IPI: + /* + * XXX generate a GP fault if vlapic is in x2apic mode + */ + *data = 0; + break; case APIC_OFFSET_RRR: default: *data = 0; @@ -1201,7 +1242,8 @@ done: } int -vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data, bool *retu) +vlapic_write(struct vlapic *vlapic, int mmio_access, uint64_t offset, + uint64_t data, bool *retu) { struct LAPIC *lapic = vlapic->apic_page; uint32_t *regptr; @@ -1210,10 +1252,26 @@ vlapic_write(struct vlapic *vlapic, uint KASSERT((offset & 0xf) == 0 && offset < PAGE_SIZE, ("vlapic_write: invalid offset %#lx", offset)); - VLAPIC_CTR2(vlapic, "vlapic write offset %#x, data %#lx", offset, data); + VLAPIC_CTR2(vlapic, "vlapic write offset %#lx, data %#lx", + offset, data); - if (offset > sizeof(*lapic)) { - return 0; + if (offset > sizeof(*lapic)) + return (0); + + /* Ignore MMIO accesses in x2APIC mode */ + if (x2apic(vlapic) && mmio_access) { + VLAPIC_CTR2(vlapic, "MMIO write of %#lx to offset %#lx " + "in x2APIC mode", data, offset); + return (0); + } + + /* + * XXX Generate GP fault for MSR accesses in xAPIC mode + */ + if (!x2apic(vlapic) && !mmio_access) { + VLAPIC_CTR2(vlapic, "x2APIC MSR write of %#lx to offset %#lx " + "in xAPIC mode", data, offset); + return (0); } retval = 0; @@ -1270,6 +1328,12 @@ vlapic_write(struct vlapic *vlapic, uint case APIC_OFFSET_ESR: vlapic_esr_write_handler(vlapic); break; + + case APIC_OFFSET_SELF_IPI: + if (x2apic(vlapic)) + vlapic_self_ipi_handler(vlapic, data); + break; + case APIC_OFFSET_VER: case APIC_OFFSET_APR: case APIC_OFFSET_PPR: @@ -1354,50 +1418,52 @@ vlapic_get_apicbase(struct vlapic *vlapi return (vlapic->msr_apicbase); } -void +int vlapic_set_apicbase(struct vlapic *vlapic, uint64_t new) { - struct LAPIC *lapic; - enum x2apic_state state; - uint64_t old; - int err; - - err = vm_get_x2apic_state(vlapic->vm, vlapic->vcpuid, &state); - if (err) - panic("vlapic_set_apicbase: err %d fetching x2apic state", err); - if (state == X2APIC_DISABLED) - new &= ~APICBASE_X2APIC; - - old = vlapic->msr_apicbase; - vlapic->msr_apicbase = new; - - /* - * If the vlapic is switching between xAPIC and x2APIC modes then - * reset the mode-dependent registers. - */ - if ((old ^ new) & APICBASE_X2APIC) { - lapic = vlapic->apic_page; - lapic->id = vlapic_get_id(vlapic); - if (x2apic(vlapic)) { - lapic->ldr = x2apic_ldr(vlapic); - lapic->dfr = 0; - } else { - lapic->ldr = 0; - lapic->dfr = 0xffffffff; - } + if (vlapic->msr_apicbase != new) { + VLAPIC_CTR2(vlapic, "Changing APIC_BASE MSR from %#lx to %#lx " + "not supported", vlapic->msr_apicbase, new); + return (-1); } + + return (0); } void vlapic_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state state) { struct vlapic *vlapic; + struct LAPIC *lapic; vlapic = vm_lapic(vm, vcpuid); if (state == X2APIC_DISABLED) vlapic->msr_apicbase &= ~APICBASE_X2APIC; + else + vlapic->msr_apicbase |= APICBASE_X2APIC; + + /* + * Reset the local APIC registers whose values are mode-dependent. + * + * XXX this works because the APIC mode can be changed only at vcpu + * initialization time. + */ + lapic = vlapic->apic_page; + lapic->id = vlapic_get_id(vlapic); + if (x2apic(vlapic)) { + lapic->ldr = x2apic_ldr(vlapic); + lapic->dfr = 0; + } else { + lapic->ldr = 0; + lapic->dfr = 0xffffffff; + } + + if (state == X2APIC_ENABLED) { + if (vlapic->ops.enable_x2apic_mode) + (*vlapic->ops.enable_x2apic_mode)(vlapic); + } } void Modified: stable/10/sys/amd64/vmm/io/vlapic.h ============================================================================== --- stable/10/sys/amd64/vmm/io/vlapic.h Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/sys/amd64/vmm/io/vlapic.h Fri Jun 13 19:10:40 2014 (r267447) @@ -32,10 +32,10 @@ struct vm; enum x2apic_state; -int vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data, - bool *retu); -int vlapic_read(struct vlapic *vlapic, uint64_t offset, uint64_t *data, - bool *retu); +int vlapic_write(struct vlapic *vlapic, int mmio_access, uint64_t offset, + uint64_t data, bool *retu); +int vlapic_read(struct vlapic *vlapic, int mmio_access, uint64_t offset, + uint64_t *data, bool *retu); /* * Returns 0 if there is no eligible vector that can be delivered to the @@ -74,7 +74,7 @@ void vlapic_fire_cmci(struct vlapic *vla int vlapic_trigger_lvt(struct vlapic *vlapic, int vector); uint64_t vlapic_get_apicbase(struct vlapic *vlapic); -void vlapic_set_apicbase(struct vlapic *vlapic, uint64_t val); +int vlapic_set_apicbase(struct vlapic *vlapic, uint64_t val); void vlapic_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state s); bool vlapic_enabled(struct vlapic *vlapic); @@ -102,4 +102,5 @@ int vlapic_icrlo_write_handler(struct vl void vlapic_icrtmr_write_handler(struct vlapic *vlapic); void vlapic_dcr_write_handler(struct vlapic *vlapic); void vlapic_lvt_write_handler(struct vlapic *vlapic, uint32_t offset); +void vlapic_self_ipi_handler(struct vlapic *vlapic, uint64_t val); #endif /* _VLAPIC_H_ */ Modified: stable/10/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- stable/10/sys/amd64/vmm/io/vlapic_priv.h Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/sys/amd64/vmm/io/vlapic_priv.h Fri Jun 13 19:10:40 2014 (r267447) @@ -81,6 +81,7 @@ #define APIC_OFFSET_TIMER_ICR 0x380 /* Timer's Initial Count */ #define APIC_OFFSET_TIMER_CCR 0x390 /* Timer's Current Count */ #define APIC_OFFSET_TIMER_DCR 0x3E0 /* Timer's Divide Configuration */ +#define APIC_OFFSET_SELF_IPI 0x3F0 /* Self IPI register */ #define VLAPIC_CTR0(vlapic, format) \ VCPU_CTR0((vlapic)->vm, (vlapic)->vcpuid, format) @@ -91,6 +92,9 @@ #define VLAPIC_CTR2(vlapic, format, p1, p2) \ VCPU_CTR2((vlapic)->vm, (vlapic)->vcpuid, format, p1, p2) +#define VLAPIC_CTR3(vlapic, format, p1, p2, p3) \ + VCPU_CTR3((vlapic)->vm, (vlapic)->vcpuid, format, p1, p2, p3) + #define VLAPIC_CTR_IRR(vlapic, msg) \ do { \ uint32_t *irrptr = &(vlapic)->apic_page->irr0; \ @@ -140,6 +144,7 @@ struct vlapic_ops { void (*intr_accepted)(struct vlapic *vlapic, int vector); void (*post_intr)(struct vlapic *vlapic, int hostcpu); void (*set_tmr)(struct vlapic *vlapic, int vector, bool level); + void (*enable_x2apic_mode)(struct vlapic *vlapic); }; struct vlapic { Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/sys/amd64/vmm/vmm.c Fri Jun 13 19:10:40 2014 (r267447) @@ -206,7 +206,7 @@ vcpu_init(struct vm *vm, uint32_t vcpu_i vcpu->hostcpu = NOCPU; vcpu->vcpuid = vcpu_id; vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); - vm_set_x2apic_state(vm, vcpu_id, X2APIC_ENABLED); + vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); vcpu->guest_xcr0 = XFEATURE_ENABLED_X87; vcpu->guestfpu = fpu_save_area_alloc(); fpu_save_area_reset(vcpu->guestfpu); Modified: stable/10/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_lapic.c Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/sys/amd64/vmm/vmm_lapic.c Fri Jun 13 19:10:40 2014 (r267447) @@ -172,7 +172,7 @@ lapic_rdmsr(struct vm *vm, int cpu, u_in error = 0; } else { offset = x2apic_msr_to_regoff(msr); - error = vlapic_read(vlapic, offset, rval, retu); + error = vlapic_read(vlapic, 0, offset, rval, retu); } return (error); @@ -188,11 +188,10 @@ lapic_wrmsr(struct vm *vm, int cpu, u_in vlapic = vm_lapic(vm, cpu); if (msr == MSR_APICBASE) { - vlapic_set_apicbase(vlapic, val); - error = 0; + error = vlapic_set_apicbase(vlapic, val); } else { offset = x2apic_msr_to_regoff(msr); - error = vlapic_write(vlapic, offset, val, retu); + error = vlapic_write(vlapic, 0, offset, val, retu); } return (error); @@ -216,7 +215,7 @@ lapic_mmio_write(void *vm, int cpu, uint return (EINVAL); vlapic = vm_lapic(vm, cpu); - error = vlapic_write(vlapic, off, wval, arg); + error = vlapic_write(vlapic, 1, off, wval, arg); return (error); } @@ -238,6 +237,6 @@ lapic_mmio_read(void *vm, int cpu, uint6 return (EINVAL); vlapic = vm_lapic(vm, cpu); - error = vlapic_read(vlapic, off, rval, arg); + error = vlapic_read(vlapic, 1, off, rval, arg); return (error); } Modified: stable/10/sys/amd64/vmm/x86.c ============================================================================== --- stable/10/sys/amd64/vmm/x86.c Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/sys/amd64/vmm/x86.c Fri Jun 13 19:10:40 2014 (r267447) @@ -149,6 +149,8 @@ x86_emulate_cpuid(struct vm *vm, int vcp if (x2apic_state != X2APIC_DISABLED) regs[2] |= CPUID2_X2APIC; + else + regs[2] &= ~CPUID2_X2APIC; /* * Only advertise CPUID2_XSAVE in the guest if Modified: stable/10/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/10/usr.sbin/bhyve/bhyve.8 Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/usr.sbin/bhyve/bhyve.8 Fri Jun 13 19:10:40 2014 (r267447) @@ -32,7 +32,7 @@ .Nd "run a guest operating system inside a virtual machine" .Sh SYNOPSIS .Nm -.Op Fl aehwAHPW +.Op Fl aehwxAHPW .Op Fl c Ar numcpus .Op Fl g Ar gdbport .Op Fl p Ar pinnedcpu @@ -58,7 +58,9 @@ exit is detected. .Sh OPTIONS .Bl -tag -width 10n .It Fl a -Disallow use of the local APIC in X2APIC mode. +The guest's local APIC is configured in xAPIC mode. +The xAPIC mode is the default setting so this option is redundant. It will be +deprecated in a future version. .It Fl A Generate ACPI tables. Required for @@ -223,6 +225,8 @@ to exit when a guest issues an access to This is intended for debug purposes. .It Fl w Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes. +.It Fl x +The guest's local APIC is configured in x2APIC mode. .It Fl h Print help message and exit. .It Ar vmname Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Fri Jun 13 18:20:44 2014 (r267446) +++ stable/10/usr.sbin/bhyve/bhyverun.c Fri Jun 13 19:10:40 2014 (r267447) @@ -84,8 +84,9 @@ char *vmname; int guest_ncpus; static int pincpu = -1; -static int guest_vmexit_on_hlt, guest_vmexit_on_pause, disable_x2apic; +static int guest_vmexit_on_hlt, guest_vmexit_on_pause; static int virtio_msix = 1; +static int x2apic_mode = 0; /* default is xAPIC */ static int strictio; static int strictmsr = 1; @@ -126,7 +127,7 @@ usage(int code) fprintf(stderr, "Usage: %s [-aehwAHIPW] [-g ] [-s ]\n" " %*s [-c vcpus] [-p pincpu] [-m mem] [-l ] \n" - " -a: local apic is in XAPIC mode (default is X2APIC)\n" + " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create an ACPI table\n" " -g: gdb port\n" " -c: # cpus (default 1)\n" @@ -139,7 +140,8 @@ usage(int code) " -s: PCI slot config\n" " -l: LPC device configuration\n" " -m: memory size in MB\n" - " -w: ignore unimplemented MSRs\n", + " -w: ignore unimplemented MSRs\n" + " -x: local apic is in x2APIC mode\n", progname, (int)strlen(progname), ""); exit(code); @@ -153,13 +155,6 @@ paddr_guest2host(struct vmctx *ctx, uint } int -fbsdrun_disable_x2apic(void) -{ - - return (disable_x2apic); -} - -int fbsdrun_vmexit_on_pause(void) { @@ -576,10 +571,10 @@ fbsdrun_set_capabilities(struct vmctx *c handler[VM_EXITCODE_PAUSE] = vmexit_pause; } - if (fbsdrun_disable_x2apic()) - err = vm_set_x2apic_state(ctx, cpu, X2APIC_DISABLED); - else + if (x2apic_mode) err = vm_set_x2apic_state(ctx, cpu, X2APIC_ENABLED); + else + err = vm_set_x2apic_state(ctx, cpu, X2APIC_DISABLED); if (err) { fprintf(stderr, "Unable to set x2apic state (%d)\n", err); @@ -604,10 +599,10 @@ main(int argc, char *argv[]) guest_ncpus = 1; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehwAHIPWp:g:c:s:m:l:")) != -1) { + while ((c = getopt(argc, argv, "abehwxAHIPWp:g:c:s:m:l:")) != -1) { switch (c) { case 'a': - disable_x2apic = 1; + x2apic_mode = 0; break; case 'A': acpi = 1; @@ -664,6 +659,9 @@ main(int argc, char *argv[]) case 'W': virtio_msix = 0; break; + case 'x': + x2apic_mode = 1; + break; case 'h': usage(0); default: From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 13 21:30:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 442EE22B; Fri, 13 Jun 2014 21:30: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 2FCE7287A; Fri, 13 Jun 2014 21:30: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 s5DLUgQq033501; Fri, 13 Jun 2014 21:30:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DLUfdQ033494; Fri, 13 Jun 2014 21:30:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406132130.s5DLUfdQ033494@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jun 2014 21:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267450 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 21:30:42 -0000 Author: jhb Date: Fri Jun 13 21:30:40 2014 New Revision: 267450 URL: http://svnweb.freebsd.org/changeset/base/267450 Log: MFC 262744: Add SMBIOS support. A new option, -U, can be used to set the UUID in the System Information (Type 1) structure. Added: stable/10/usr.sbin/bhyve/smbiostbl.c - copied unchanged from r262744, head/usr.sbin/bhyve/smbiostbl.c stable/10/usr.sbin/bhyve/smbiostbl.h - copied unchanged from r262744, head/usr.sbin/bhyve/smbiostbl.h Modified: stable/10/usr.sbin/bhyve/Makefile stable/10/usr.sbin/bhyve/acpi.c stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/bhyverun.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/Makefile ============================================================================== --- stable/10/usr.sbin/bhyve/Makefile Fri Jun 13 19:40:02 2014 (r267449) +++ stable/10/usr.sbin/bhyve/Makefile Fri Jun 13 21:30:40 2014 (r267450) @@ -34,6 +34,7 @@ SRCS= \ pmtmr.c \ post.c \ rtc.c \ + smbiostbl.c \ uart_emul.c \ virtio.c \ xmsr.c \ Modified: stable/10/usr.sbin/bhyve/acpi.c ============================================================================== --- stable/10/usr.sbin/bhyve/acpi.c Fri Jun 13 19:40:02 2014 (r267449) +++ stable/10/usr.sbin/bhyve/acpi.c Fri Jun 13 21:30:40 2014 (r267450) @@ -39,14 +39,14 @@ * * Layout * ------ - * RSDP -> 0xf0400 (36 bytes fixed) - * RSDT -> 0xf0440 (36 bytes + 4*N table addrs, 2 used) - * XSDT -> 0xf0480 (36 bytes + 8*N table addrs, 2 used) - * MADT -> 0xf0500 (depends on #CPUs) - * FADT -> 0xf0600 (268 bytes) - * HPET -> 0xf0740 (56 bytes) - * FACS -> 0xf0780 (64 bytes) - * DSDT -> 0xf0800 (variable - can go up to 0x100000) + * RSDP -> 0xf2400 (36 bytes fixed) + * RSDT -> 0xf2440 (36 bytes + 4*N table addrs, 2 used) + * XSDT -> 0xf2480 (36 bytes + 8*N table addrs, 2 used) + * MADT -> 0xf2500 (depends on #CPUs) + * FADT -> 0xf2600 (268 bytes) + * HPET -> 0xf2740 (56 bytes) + * FACS -> 0xf2780 (64 bytes) + * DSDT -> 0xf2800 (variable - can go up to 0x100000) */ #include @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); * Define the base address of the ACPI tables, and the offsets to * the individual tables */ -#define BHYVE_ACPI_BASE 0xf0400 +#define BHYVE_ACPI_BASE 0xf2400 #define RSDT_OFFSET 0x040 #define XSDT_OFFSET 0x080 #define MADT_OFFSET 0x100 Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Fri Jun 13 19:40:02 2014 (r267449) +++ stable/10/usr.sbin/bhyve/bhyverun.c Fri Jun 13 21:30:40 2014 (r267450) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include "mptbl.h" #include "pci_emul.h" #include "pci_lpc.h" +#include "smbiostbl.h" #include "xmsr.h" #include "spinup_ap.h" #include "rtc.h" @@ -82,6 +83,7 @@ typedef int (*vmexit_handler_t)(struct v char *vmname; int guest_ncpus; +char *guest_uuid_str; static int pincpu = -1; static int guest_vmexit_on_hlt, guest_vmexit_on_pause; @@ -141,7 +143,8 @@ usage(int code) " -l: LPC device configuration\n" " -m: memory size in MB\n" " -w: ignore unimplemented MSRs\n" - " -x: local apic is in x2APIC mode\n", + " -x: local apic is in x2APIC mode\n" + " -U: uuid\n", progname, (int)strlen(progname), ""); exit(code); @@ -599,7 +602,7 @@ main(int argc, char *argv[]) guest_ncpus = 1; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehwxAHIPWp:g:c:s:m:l:")) != -1) { + while ((c = getopt(argc, argv, "abehwxAHIPWp:g:c:s:m:l:U:")) != -1) { switch (c) { case 'a': x2apic_mode = 0; @@ -653,6 +656,9 @@ main(int argc, char *argv[]) case 'e': strictio = 1; break; + case 'U': + guest_uuid_str = optarg; + break; case 'w': strictmsr = 0; break; @@ -723,6 +729,9 @@ main(int argc, char *argv[]) */ mptable_build(ctx, guest_ncpus); + error = smbios_build(ctx); + assert(error == 0); + if (acpi) { error = acpi_build(ctx, guest_ncpus); assert(error == 0); Modified: stable/10/usr.sbin/bhyve/bhyverun.h ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.h Fri Jun 13 19:40:02 2014 (r267449) +++ stable/10/usr.sbin/bhyve/bhyverun.h Fri Jun 13 21:30:40 2014 (r267450) @@ -37,6 +37,7 @@ struct vmctx; extern int guest_ncpus; +extern char *guest_uuid_str; extern char *vmname; void *paddr_guest2host(struct vmctx *ctx, uintptr_t addr, size_t len); Copied: stable/10/usr.sbin/bhyve/smbiostbl.c (from r262744, head/usr.sbin/bhyve/smbiostbl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyve/smbiostbl.c Fri Jun 13 21:30:40 2014 (r267450, copy of r262744, head/usr.sbin/bhyve/smbiostbl.c) @@ -0,0 +1,832 @@ +/*- + * Copyright (c) 2014 Tycho Nightingale + * 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 ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "bhyverun.h" +#include "smbiostbl.h" + +#define MB (1024*1024) +#define GB (1024ULL*1024*1024) + +#define SMBIOS_BASE 0xF1000 + +/* BHYVE_ACPI_BASE - SMBIOS_BASE) */ +#define SMBIOS_MAX_LENGTH (0xF2400 - 0xF1000) + +#define SMBIOS_TYPE_BIOS 0 +#define SMBIOS_TYPE_SYSTEM 1 +#define SMBIOS_TYPE_CHASSIS 3 +#define SMBIOS_TYPE_PROCESSOR 4 +#define SMBIOS_TYPE_MEMARRAY 16 +#define SMBIOS_TYPE_MEMDEVICE 17 +#define SMBIOS_TYPE_MEMARRAYMAP 19 +#define SMBIOS_TYPE_BOOT 32 +#define SMBIOS_TYPE_EOT 127 + +struct smbios_structure { + uint8_t type; + uint8_t length; + uint16_t handle; +} __packed; + +typedef int (*initializer_func_t)(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +struct smbios_template_entry { + struct smbios_structure *entry; + const char **strings; + initializer_func_t initializer; +}; + +/* + * SMBIOS Structure Table Entry Point + */ +#define SMBIOS_ENTRY_EANCHOR "_SM_" +#define SMBIOS_ENTRY_EANCHORLEN 4 +#define SMBIOS_ENTRY_IANCHOR "_DMI_" +#define SMBIOS_ENTRY_IANCHORLEN 5 + +struct smbios_entry_point { + char eanchor[4]; /* anchor tag */ + uint8_t echecksum; /* checksum of entry point structure */ + uint8_t eplen; /* length in bytes of entry point */ + uint8_t major; /* major version of the SMBIOS spec */ + uint8_t minor; /* minor version of the SMBIOS spec */ + uint16_t maxssize; /* maximum size in bytes of a struct */ + uint8_t revision; /* entry point structure revision */ + uint8_t format[5]; /* entry point rev-specific data */ + char ianchor[5]; /* intermediate anchor tag */ + uint8_t ichecksum; /* intermediate checksum */ + uint16_t stlen; /* len in bytes of structure table */ + uint32_t staddr; /* physical addr of structure table */ + uint16_t stnum; /* number of structure table entries */ + uint8_t bcdrev; /* BCD value representing DMI ver */ +} __packed; + +/* + * BIOS Information + */ +#define SMBIOS_FL_ISA 0x00000010 /* ISA is supported */ +#define SMBIOS_FL_PCI 0x00000080 /* PCI is supported */ +#define SMBIOS_FL_SHADOW 0x00001000 /* BIOS shadowing is allowed */ +#define SMBIOS_FL_CDBOOT 0x00008000 /* Boot from CD is supported */ +#define SMBIOS_FL_SELBOOT 0x00010000 /* Selectable Boot supported */ +#define SMBIOS_FL_EDD 0x00080000 /* EDD Spec is supported */ + +#define SMBIOS_XB1_FL_ACPI 0x00000001 /* ACPI is supported */ + +#define SMBIOS_XB2_FL_BBS 0x00000001 /* BIOS Boot Specification */ +#define SMBIOS_XB2_FL_VM 0x00000010 /* Virtual Machine */ + +struct smbios_table_type0 { + struct smbios_structure header; + uint8_t vendor; /* vendor string */ + uint8_t version; /* version string */ + uint16_t segment; /* address segment location */ + uint8_t rel_date; /* release date */ + uint8_t size; /* rom size */ + uint64_t cflags; /* characteristics */ + uint8_t xc_bytes[2]; /* characteristics ext bytes */ + uint8_t sb_major_rel; /* system bios version */ + uint8_t sb_minor_rele; + uint8_t ecfw_major_rel; /* embedded ctrl fw version */ + uint8_t ecfw_minor_rel; +} __packed; + +/* + * System Information + */ +#define SMBIOS_WAKEUP_SWITCH 0x06 /* power switch */ + +struct smbios_table_type1 { + struct smbios_structure header; + uint8_t manufacturer; /* manufacturer string */ + uint8_t product; /* product name string */ + uint8_t version; /* version string */ + uint8_t serial; /* serial number string */ + uint8_t uuid[16]; /* uuid byte array */ + uint8_t wakeup; /* wake-up event */ + uint8_t sku; /* sku number string */ + uint8_t family; /* family name string */ +} __packed; + +/* + * System Enclosure or Chassis + */ +#define SMBIOS_CHT_UNKNOWN 0x02 /* unknown */ + +#define SMBIOS_CHST_SAFE 0x03 /* safe */ + +#define SMBIOS_CHSC_NONE 0x03 /* none */ + +struct smbios_table_type3 { + struct smbios_structure header; + uint8_t manufacturer; /* manufacturer string */ + uint8_t type; /* type */ + uint8_t version; /* version string */ + uint8_t serial; /* serial number string */ + uint8_t asset; /* asset tag string */ + uint8_t bustate; /* boot-up state */ + uint8_t psstate; /* power supply state */ + uint8_t tstate; /* thermal state */ + uint8_t security; /* security status */ + uint8_t uheight; /* height in 'u's */ + uint8_t cords; /* number of power cords */ + uint8_t elems; /* number of element records */ + uint8_t elemlen; /* length of records */ + uint8_t sku; /* sku number string */ +} __packed; + +/* + * Processor Information + */ +#define SMBIOS_PRT_CENTRAL 0x03 /* central processor */ + +#define SMBIOS_PRF_OTHER 0x01 /* other */ + +#define SMBIOS_PRS_PRESENT 0x40 /* socket is populated */ +#define SMBIOS_PRS_ENABLED 0x1 /* enabled */ + +#define SMBIOS_PRU_NONE 0x06 /* none */ + +#define SMBIOS_PFL_64B 0x04 /* 64-bit capable */ + +struct smbios_table_type4 { + struct smbios_structure header; + uint8_t socket; /* socket designation string */ + uint8_t type; /* processor type */ + uint8_t family; /* processor family */ + uint8_t manufacturer; /* manufacturer string */ + uint64_t cpuid; /* processor cpuid */ + uint8_t version; /* version string */ + uint8_t voltage; /* voltage */ + uint16_t clkspeed; /* ext clock speed in mhz */ + uint16_t maxspeed; /* maximum speed in mhz */ + uint16_t curspeed; /* current speed in mhz */ + uint8_t status; /* status */ + uint8_t upgrade; /* upgrade */ + uint16_t l1handle; /* l1 cache handle */ + uint16_t l2handle; /* l2 cache handle */ + uint16_t l3handle; /* l3 cache handle */ + uint8_t serial; /* serial number string */ + uint8_t asset; /* asset tag string */ + uint8_t part; /* part number string */ + uint8_t cores; /* cores per socket */ + uint8_t ecores; /* enabled cores */ + uint8_t threads; /* threads per socket */ + uint16_t cflags; /* processor characteristics */ + uint16_t family2; /* processor family 2 */ +} __packed; + +/* + * Physical Memory Array + */ +#define SMBIOS_MAL_SYSMB 0x03 /* system board or motherboard */ + +#define SMBIOS_MAU_SYSTEM 0x03 /* system memory */ + +#define SMBIOS_MAE_NONE 0x03 /* none */ + +struct smbios_table_type16 { + struct smbios_structure header; + uint8_t location; /* physical device location */ + uint8_t use; /* device functional purpose */ + uint8_t ecc; /* err detect/correct method */ + uint32_t size; /* max mem capacity in kb */ + uint16_t errhand; /* handle of error (if any) */ + uint16_t ndevs; /* num of slots or sockets */ + uint64_t xsize; /* max mem capacity in bytes */ +} __packed; + +/* + * Memory Device + */ +#define SMBIOS_MDFF_UNKNOWN 0x02 /* unknown */ + +#define SMBIOS_MDT_UNKNOWN 0x02 /* unknown */ + +#define SMBIOS_MDF_UNKNOWN 0x0004 /* unknown */ + +struct smbios_table_type17 { + struct smbios_structure header; + uint16_t arrayhand; /* handle of physl mem array */ + uint16_t errhand; /* handle of mem error data */ + uint16_t twidth; /* total width in bits */ + uint16_t dwidth; /* data width in bits */ + uint16_t size; /* size in bytes */ + uint8_t form; /* form factor */ + uint8_t set; /* set */ + uint8_t dloc; /* device locator string */ + uint8_t bloc; /* phys bank locator string */ + uint8_t type; /* memory type */ + uint16_t flags; /* memory characteristics */ + uint16_t maxspeed; /* maximum speed in mhz */ + uint8_t manufacturer; /* manufacturer string */ + uint8_t serial; /* serial number string */ + uint8_t asset; /* asset tag string */ + uint8_t part; /* part number string */ + uint8_t attributes; /* attributes */ + uint32_t xsize; /* extended size in mbs */ + uint16_t curspeed; /* current speed in mhz */ + uint16_t minvoltage; /* minimum voltage */ + uint16_t maxvoltage; /* maximum voltage */ + uint16_t curvoltage; /* configured voltage */ +} __packed; + +/* + * Memory Array Mapped Address + */ +struct smbios_table_type19 { + struct smbios_structure header; + uint32_t saddr; /* start phys addr in kb */ + uint32_t eaddr; /* end phys addr in kb */ + uint16_t arrayhand; /* physical mem array handle */ + uint8_t width; /* num of dev in row */ + uint64_t xsaddr; /* start phys addr in bytes */ + uint64_t xeaddr; /* end phys addr in bytes */ +} __packed; + +/* + * System Boot Information + */ +#define SMBIOS_BOOT_NORMAL 0 /* no errors detected */ + +struct smbios_table_type32 { + struct smbios_structure header; + uint8_t reserved[6]; + uint8_t status; /* boot status */ +} __packed; + +/* + * End-of-Table + */ +struct smbios_table_type127 { + struct smbios_structure header; +} __packed; + +struct smbios_table_type0 smbios_type0_template = { + { SMBIOS_TYPE_BIOS, sizeof (struct smbios_table_type0), 0 }, + 1, /* bios vendor string */ + 2, /* bios version string */ + 0xF000, /* bios address segment location */ + 3, /* bios release date */ + 0x0, /* bios size (64k * (n + 1) is the size in bytes) */ + SMBIOS_FL_ISA | SMBIOS_FL_PCI | SMBIOS_FL_SHADOW | + SMBIOS_FL_CDBOOT | SMBIOS_FL_EDD, + { SMBIOS_XB1_FL_ACPI, SMBIOS_XB2_FL_BBS | SMBIOS_XB2_FL_VM }, + 0x0, /* bios major release */ + 0x0, /* bios minor release */ + 0xff, /* embedded controller firmware major release */ + 0xff /* embedded controller firmware minor release */ +}; + +const char *smbios_type0_strings[] = { + "BHYVE", /* vendor string */ + __TIME__, /* bios version string */ + __DATE__, /* bios release date string */ + NULL +}; + +struct smbios_table_type1 smbios_type1_template = { + { SMBIOS_TYPE_SYSTEM, sizeof (struct smbios_table_type1), 0 }, + 1, /* manufacturer string */ + 2, /* product string */ + 3, /* version string */ + 4, /* serial number string */ + { 0 }, + SMBIOS_WAKEUP_SWITCH, + 5, /* sku string */ + 6 /* family string */ +}; + +static int smbios_type1_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +const char *smbios_type1_strings[] = { + " ", /* manufacturer string */ + "BHYVE", /* product name string */ + "1.0", /* version string */ + "None", /* serial number string */ + "None", /* sku string */ + " ", /* family name string */ + NULL +}; + +struct smbios_table_type3 smbios_type3_template = { + { SMBIOS_TYPE_CHASSIS, sizeof (struct smbios_table_type3), 0 }, + 1, /* manufacturer string */ + SMBIOS_CHT_UNKNOWN, + 2, /* version string */ + 3, /* serial number string */ + 4, /* asset tag string */ + SMBIOS_CHST_SAFE, + SMBIOS_CHST_SAFE, + SMBIOS_CHST_SAFE, + SMBIOS_CHSC_NONE, + 0, /* height in 'u's (0=enclosure height unspecified) */ + 0, /* number of power cords (0=number unspecified) */ + 0, /* number of contained element records */ + 0, /* length of records */ + 5 /* sku number string */ +}; + +const char *smbios_type3_strings[] = { + " ", /* manufacturer string */ + "1.0", /* version string */ + "None", /* serial number string */ + "None", /* asset tag string */ + "None", /* sku number string */ + NULL +}; + +struct smbios_table_type4 smbios_type4_template = { + { SMBIOS_TYPE_PROCESSOR, sizeof (struct smbios_table_type4), 0 }, + 1, /* socket designation string */ + SMBIOS_PRT_CENTRAL, + SMBIOS_PRF_OTHER, + 2, /* manufacturer string */ + 0, /* cpuid */ + 3, /* version string */ + 0, /* voltage */ + 0, /* external clock frequency in mhz (0=unknown) */ + 0, /* maximum frequency in mhz (0=unknown) */ + 0, /* current frequency in mhz (0=unknown) */ + SMBIOS_PRS_PRESENT | SMBIOS_PRS_ENABLED, + SMBIOS_PRU_NONE, + -1, /* l1 cache handle */ + -1, /* l2 cache handle */ + -1, /* l3 cache handle */ + 4, /* serial number string */ + 5, /* asset tag string */ + 6, /* part number string */ + 0, /* cores per socket (0=unknown) */ + 0, /* enabled cores per socket (0=unknown) */ + 0, /* threads per socket (0=unknown) */ + SMBIOS_PFL_64B, + SMBIOS_PRF_OTHER +}; + +const char *smbios_type4_strings[] = { + " ", /* socket designation string */ + " ", /* manufacturer string */ + " ", /* version string */ + "None", /* serial number string */ + "None", /* asset tag string */ + "None", /* part number string */ + NULL +}; + +static int smbios_type4_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +struct smbios_table_type16 smbios_type16_template = { + { SMBIOS_TYPE_MEMARRAY, sizeof (struct smbios_table_type16), 0 }, + SMBIOS_MAL_SYSMB, + SMBIOS_MAU_SYSTEM, + SMBIOS_MAE_NONE, + 0x80000000, /* max mem capacity in kb (0x80000000=use extended) */ + -1, /* handle of error (if any) */ + 0, /* number of slots or sockets (TBD) */ + 0 /* extended maximum memory capacity in bytes (TBD) */ +}; + +static int smbios_type16_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +struct smbios_table_type17 smbios_type17_template = { + { SMBIOS_TYPE_MEMDEVICE, sizeof (struct smbios_table_type17), 0 }, + -1, /* handle of physical memory array */ + -1, /* handle of memory error data */ + 64, /* total width in bits including ecc */ + 64, /* data width in bits */ + 0x7fff, /* size in bytes (0x7fff=use extended)*/ + SMBIOS_MDFF_UNKNOWN, + 0, /* set (0x00=none, 0xff=unknown) */ + 1, /* device locator string */ + 2, /* physical bank locator string */ + SMBIOS_MDT_UNKNOWN, + SMBIOS_MDF_UNKNOWN, + 0, /* maximum memory speed in mhz (0=unknown) */ + 3, /* manufacturer string */ + 4, /* serial number string */ + 5, /* asset tag string */ + 6, /* part number string */ + 0, /* attributes (0=unknown rank information) */ + 0, /* extended size in mb (TBD) */ + 0, /* current speed in mhz (0=unknown) */ + 0, /* minimum voltage in mv (0=unknown) */ + 0, /* maximum voltage in mv (0=unknown) */ + 0 /* configured voltage in mv (0=unknown) */ +}; + +const char *smbios_type17_strings[] = { + " ", /* device locator string */ + " ", /* physical bank locator string */ + " ", /* manufacturer string */ + "None", /* serial number string */ + "None", /* asset tag string */ + "None", /* part number string */ + NULL +}; + +static int smbios_type17_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +struct smbios_table_type19 smbios_type19_template = { + { SMBIOS_TYPE_MEMARRAYMAP, sizeof (struct smbios_table_type19), 0 }, + 0xffffffff, /* starting phys addr in kb (0xffffffff=use ext) */ + 0xffffffff, /* ending phys addr in kb (0xffffffff=use ext) */ + -1, /* physical memory array handle */ + 1, /* number of devices that form a row */ + 0, /* extended starting phys addr in bytes (TDB) */ + 0 /* extended ending phys addr in bytes (TDB) */ +}; + +static int smbios_type19_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +struct smbios_table_type32 smbios_type32_template = { + { SMBIOS_TYPE_BOOT, sizeof (struct smbios_table_type32), 0 }, + { 0, 0, 0, 0, 0, 0 }, + SMBIOS_BOOT_NORMAL +}; + +struct smbios_table_type127 smbios_type127_template = { + { SMBIOS_TYPE_EOT, sizeof (struct smbios_table_type127), 0 } +}; + +static int smbios_generic_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +static struct smbios_template_entry smbios_template[] = { + { (struct smbios_structure *)&smbios_type0_template, + smbios_type0_strings, + smbios_generic_initializer }, + { (struct smbios_structure *)&smbios_type1_template, + smbios_type1_strings, + smbios_type1_initializer }, + { (struct smbios_structure *)&smbios_type3_template, + smbios_type3_strings, + smbios_generic_initializer }, + { (struct smbios_structure *)&smbios_type4_template, + smbios_type4_strings, + smbios_type4_initializer }, + { (struct smbios_structure *)&smbios_type16_template, + NULL, + smbios_type16_initializer }, + { (struct smbios_structure *)&smbios_type17_template, + smbios_type17_strings, + smbios_type17_initializer }, + { (struct smbios_structure *)&smbios_type19_template, + NULL, + smbios_type19_initializer }, + { (struct smbios_structure *)&smbios_type32_template, + NULL, + smbios_generic_initializer }, + { (struct smbios_structure *)&smbios_type127_template, + NULL, + smbios_generic_initializer }, + { NULL,NULL, NULL } +}; + +static uint64_t guest_lomem, guest_himem; +static uint16_t type16_handle; + +static int +smbios_generic_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + struct smbios_structure *entry; + + memcpy(curaddr, template_entry, template_entry->length); + entry = (struct smbios_structure *)curaddr; + entry->handle = *n + 1; + curaddr += entry->length; + if (template_strings != NULL) { + int i; + + for (i = 0; template_strings[i] != NULL; i++) { + const char *string; + int len; + + string = template_strings[i]; + len = strlen(string) + 1; + memcpy(curaddr, string, len); + curaddr += len; + } + *curaddr = '\0'; + curaddr++; + } else { + /* Minimum string section is double nul */ + *curaddr = '\0'; + curaddr++; + *curaddr = '\0'; + curaddr++; + } + (*n)++; + *endaddr = curaddr; + + return (0); +} + +static int +smbios_type1_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + struct smbios_table_type1 *type1; + + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type1 = (struct smbios_table_type1 *)curaddr; + + if (guest_uuid_str != NULL) { + uuid_t uuid; + uint32_t status; + + uuid_from_string(guest_uuid_str, &uuid, &status); + if (status != uuid_s_ok) + return (-1); + + uuid_enc_le(&type1->uuid, &uuid); + } else { + MD5_CTX mdctx; + u_char digest[16]; + char hostname[MAXHOSTNAMELEN]; + + /* + * Universally unique and yet reproducible are an + * oxymoron, however reproducible is desirable in + * this case. + */ + if (gethostname(hostname, sizeof(hostname))) + return (-1); + + MD5Init(&mdctx); + MD5Update(&mdctx, vmname, strlen(vmname)); + MD5Update(&mdctx, hostname, sizeof(hostname)); + MD5Final(digest, &mdctx); + + /* + * Set the variant and version number. + */ + digest[6] &= 0x0F; + digest[6] |= 0x30; /* version 3 */ + digest[8] &= 0x3F; + digest[8] |= 0x80; + + memcpy(&type1->uuid, digest, sizeof (digest)); + } + + return (0); +} + +static int +smbios_type4_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + int i; + + for (i = 0; i < guest_ncpus; i++) { + struct smbios_table_type4 *type4; + char *p; + int nstrings, len; + + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type4 = (struct smbios_table_type4 *)curaddr; + p = curaddr + sizeof (struct smbios_table_type4); + nstrings = 0; + while (p < *endaddr - 1) { + if (*p++ == '\0') + nstrings++; + } + len = sprintf(*endaddr - 1, "CPU #%d", i) + 1; + *endaddr += len - 1; + *(*endaddr) = '\0'; + (*endaddr)++; + type4->socket = nstrings + 1; + curaddr = *endaddr; + } + + return (0); +} + +static int +smbios_type16_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + struct smbios_table_type16 *type16; + + type16_handle = *n; + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type16 = (struct smbios_table_type16 *)curaddr; + type16->xsize = guest_lomem + guest_himem; + type16->ndevs = guest_himem > 0 ? 2 : 1; + + return (0); +} + +static int +smbios_type17_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + struct smbios_table_type17 *type17; + + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type17 = (struct smbios_table_type17 *)curaddr; + type17->arrayhand = type16_handle; + type17->xsize = guest_lomem; + + if (guest_himem > 0) { + curaddr = *endaddr; + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type17 = (struct smbios_table_type17 *)curaddr; + type17->arrayhand = type16_handle; + type17->xsize = guest_himem; + } + + return (0); +} + +static int +smbios_type19_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + struct smbios_table_type19 *type19; + + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type19 = (struct smbios_table_type19 *)curaddr; + type19->arrayhand = type16_handle; + type19->xsaddr = 0; + type19->xeaddr = guest_lomem; + + if (guest_himem > 0) { + curaddr = *endaddr; + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type19 = (struct smbios_table_type19 *)curaddr; + type19->arrayhand = type16_handle; + type19->xsaddr = 4*GB; + type19->xeaddr = guest_himem; + } + + return (0); +} + +static void +smbios_ep_initializer(struct smbios_entry_point *smbios_ep, uint32_t staddr) +{ + memset(smbios_ep, 0, sizeof(*smbios_ep)); + memcpy(smbios_ep->eanchor, SMBIOS_ENTRY_EANCHOR, + SMBIOS_ENTRY_EANCHORLEN); + smbios_ep->eplen = 0x1F; + assert(sizeof (struct smbios_entry_point) == smbios_ep->eplen); + smbios_ep->major = 2; + smbios_ep->minor = 4; + smbios_ep->revision = 0; + memcpy(smbios_ep->ianchor, SMBIOS_ENTRY_IANCHOR, + SMBIOS_ENTRY_IANCHORLEN); + smbios_ep->staddr = staddr; + smbios_ep->bcdrev = 0x24; +} + +static void +smbios_ep_finalizer(struct smbios_entry_point *smbios_ep, uint16_t len, + uint16_t num, uint16_t maxssize) +{ + uint8_t checksum; + int i; + + smbios_ep->maxssize = maxssize; + smbios_ep->stlen = len; + smbios_ep->stnum = num; + + checksum = 0; + for (i = 0x10; i < 0x1f; i++) { + checksum -= ((uint8_t *)smbios_ep)[i]; + } + smbios_ep->ichecksum = checksum; + + checksum = 0; + for (i = 0; i < 0x1f; i++) { + checksum -= ((uint8_t *)smbios_ep)[i]; + } + smbios_ep->echecksum = checksum; +} + +int +smbios_build(struct vmctx *ctx) +{ + struct smbios_entry_point *smbios_ep; + uint16_t n; + uint16_t maxssize; + char *curaddr, *startaddr, *ststartaddr; + int i; + int err; + + err = vm_get_memory_seg(ctx, 0, &guest_lomem, NULL); + if (err != 0) + return (err); + + err = vm_get_memory_seg(ctx, 4*GB, &guest_himem, NULL); + if (err != 0) + return (err); + + startaddr = paddr_guest2host(ctx, SMBIOS_BASE, SMBIOS_MAX_LENGTH); + if (startaddr == NULL) { + fprintf(stderr, "smbios table requires mapped mem\n"); + return (ENOMEM); + } + + curaddr = startaddr; + + smbios_ep = (struct smbios_entry_point *)curaddr; + smbios_ep_initializer(smbios_ep, SMBIOS_BASE + + sizeof(struct smbios_entry_point)); + curaddr += sizeof(struct smbios_entry_point); + ststartaddr = curaddr; + + n = 0; + maxssize = 0; + for (i = 0; smbios_template[i].entry != NULL; i++) { + struct smbios_structure *entry; + const char **strings; + initializer_func_t initializer; + char *endaddr; + uint16_t size; + + entry = smbios_template[i].entry; + strings = smbios_template[i].strings; + initializer = smbios_template[i].initializer; + + err = (*initializer)(entry, strings, curaddr, &endaddr, + &n, &size); + if (err != 0) + return (err); + + if (size > maxssize) + maxssize = size; + + curaddr = endaddr; + } + + assert(curaddr - startaddr < SMBIOS_MAX_LENGTH); + smbios_ep_finalizer(smbios_ep, curaddr - ststartaddr, n, maxssize); + + return (0); +} Copied: stable/10/usr.sbin/bhyve/smbiostbl.h (from r262744, head/usr.sbin/bhyve/smbiostbl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyve/smbiostbl.h Fri Jun 13 21:30:40 2014 (r267450, copy of r262744, head/usr.sbin/bhyve/smbiostbl.h) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2014 Tycho Nightingale + * 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 ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SMBIOSTBL_H_ +#define _SMBIOSTBL_H_ + +struct vmctx; + +int smbios_build(struct vmctx *ctx); + +#endif /* _SMBIOSTBL_H_ */ From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 13 21:52:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 77F6A75A for ; Fri, 13 Jun 2014 21:52:13 +0000 (UTC) Received: from mail-ie0-f173.google.com (mail-ie0-f173.google.com [209.85.223.173]) (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 3A1282A26 for ; Fri, 13 Jun 2014 21:52:13 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id y20so3037390ier.18 for ; Fri, 13 Jun 2014 14:52:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=j4TKs4DAtpgMw2gI/OYDbdRy+YNhPJkf4zUvebuLl9A=; b=OxP2YVbX/JoNlXkkgVDNvpaK5IsS71ZJ+H+6dBdUkIlEPkAMP/I8X7XDNwZsN7/uCU CGXYgm6dIlnqHIZpLCJLc9dV7mzS2kfhs2LYCiefYudMbGUZXZQdttBl+IhIJUwlyGyW 8uJZsu72tstydDp7aabP3skQvCR53vWtTSLg3t2Mtgm3hAt0bGpnxM5fMT6JhSTIajVY Lw0ds1aG5x411rqFTRtDXrb/oLa0PkMj15qNZb4ij0agAIg+l6DQMyyxxtAolfvvWU5u yXf6mazmWvFc8L3gnkQC89JTxsUmU75ggnACjsNgr9uVqz6Xga9Lb8KhfVhgvH5/YU12 JOmQ== X-Gm-Message-State: ALoCoQlNfDJHbIPfQ/iM+wWUp5xBllMhZWCE1wsiuFca7pnpA0L5BLUqrlHqXHdlR6tkzEEvRDDy X-Received: by 10.43.160.69 with SMTP id mb5mr6100130icc.49.1402696332274; Fri, 13 Jun 2014 14:52:12 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id c5sm6181577ign.1.2014.06.13.14.52.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Jun 2014 14:52:11 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_A14F6696-FF56-4BE1-8FB5-BE6FEE5060DF"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267107 - stable/10/sys/i386/conf From: Warner Losh In-Reply-To: <20140607214835.GH679@alchemy.franken.de> Date: Fri, 13 Jun 2014 15:52:12 -0600 Message-Id: <4F65442A-DAF8-4C76-A5A5-802C3EF51769@bsdimp.com> References: <201406051308.s55D88mM053472@svn.freebsd.org> <652C13FA-F367-4884-BF65-2692E7614F93@gmail.com> <20140607214835.GH679@alchemy.franken.de> To: Marius Strobl X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 21:52:13 -0000 --Apple-Mail=_A14F6696-FF56-4BE1-8FB5-BE6FEE5060DF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jun 7, 2014, at 3:48 PM, Marius Strobl = wrote: > On Sat, Jun 07, 2014 at 09:23:47AM -0600, Warner Losh wrote: >> Why? There should be no -gdwarf-2 in the tree, that was a workaround = that has since been obsoleted by (a) -g automatically changes to this in = the makefile system and (b) the default was reverted back to dwarf 2. = This wasn?t a mismerge, but an intentional fix. >=20 > Because despite what you say, -gdwarf-2 actually still is in stable/9 = and > stable/10 as of now: > marius@alchemy:/home/marius/co > grep -l -- -gdwarf-2 = {9,10}/src/sys/*/conf/* > 9/src/sys/amd64/conf/GENERIC > 9/src/sys/i386/conf/GENERIC > 9/src/sys/i386/conf/XEN > 9/src/sys/sparc64/conf/GENERIC > 10/src/sys/amd64/conf/GENERIC > 10/src/sys/i386/conf/GENERIC > 10/src/sys/i386/conf/XEN > 10/src/sys/sparc64/conf/GENERIC >=20 > And also because replacing -gdwarf-2 with -g just wasn't part of = r266820, > doing the former when MFCing that revision as r267049 simply was a = mismerge > on my part. > Apart from these I'm fully aware that -gdwarf-2 was/is only transient, = but > we're just not fully back to -g, yet. Oh, yea, the MFC issue=85. Yea, you=92re right. That mess hasn=92t been = sorted out yet :( I=92ll sort 10 out this weekend and 9 out after 9.3, = per the RE=92s request. Warner --Apple-Mail=_A14F6696-FF56-4BE1-8FB5-BE6FEE5060DF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTm3KMAAoJEGwc0Sh9sBEA6NcQANVFeturtIh7VWwCMOYL16QW hlIk2zz/spCwaNosO4dSZIUQhK7EI3E5rxsunJPYNQ+tw7FNxsWt/Z+nCbU8wq/G 9uga+LaM+wrNnDEJ6thxq/aKHpHK3Fnm+sE7gjHTmRLJR/nFnBZ96QjgaX+fnlbQ DDDNg03zuwMlpTm996tBv0MTTkhcuhcdoZXSuviC4ntJ0RzbgpB7LdZerl2dGmAR OGKcdr0Hg3Kp8nPyslIby1Ek4IRGEpL4Ud6xUFs9HPZJCBpPnYj/CKH1tQ1YzWFX l9gDCll6ChQzpkjgjNyx9qQ2AGHhjra4manaoVTCkoVZi9zG4/ylAaRdc1XCP+fE urmmDz1Bmm60dypE9x28q+0uIrZ81vgo5bsvCeSelO7Uow4k1FCWlpCoMlJX1X2a iabUhalu2nn2v/3BgAw+vp1PJqstlMy4gm2vywhNz7pdUw6V/kR4VO1yCnVZSkeQ tJ/xAlXTd8vvqtVYf6O/isSdKMFLv+lONotB3DjvbpwwAljLhhuvcytZZEblOGoH d0XCWhYoLyehVw+/Zoqdx/lYJ3oCpS6ctyGE0agCBojStKyoY2u7tBIzkyrctOy4 riLUi4C/2X2bE/4YBbbDLK0XACFYJrqiI0hbL5W/N//t+AAHAyYAlNsXYWYEI1s+ TtYX0bQ9M/FaToK8G7x6 =QO7C -----END PGP SIGNATURE----- --Apple-Mail=_A14F6696-FF56-4BE1-8FB5-BE6FEE5060DF-- From owner-svn-src-stable-10@FreeBSD.ORG Sat Jun 14 00:44:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4626082E; Sat, 14 Jun 2014 00: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 2770527C9; Sat, 14 Jun 2014 00: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 s5E0ixax025143; Sat, 14 Jun 2014 00:44:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5E0iw6M025138; Sat, 14 Jun 2014 00:44:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406140044.s5E0iw6M025138@svn.freebsd.org> From: Xin LI Date: Sat, 14 Jun 2014 00:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267457 - in stable/10/sys/dev: hpt27xx hptmv hptrr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2014 00:44:59 -0000 Author: delphij Date: Sat Jun 14 00:44:57 2014 New Revision: 267457 URL: http://svnweb.freebsd.org/changeset/base/267457 Log: MFC r267368: Apply vendor fixes to the High Point drivers: - Don't call xpt_free_path() in os_query_remove_device() and always return TRUE. - Update os_buildsgl() to support build logical SG table which will be used by lower RAID module. - Return CAM_SEL_TIMEOUTstatus for SCSIcommand failed as target missing. Many thanks to HighPoint for providing this driver update. Submitted by: Steve Chang Reviewed by: mav Modified: stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c stable/10/sys/dev/hptmv/entry.c stable/10/sys/dev/hptrr/hptrr_os_bsd.c stable/10/sys/dev/hptrr/hptrr_osm_bsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c ============================================================================== --- stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c Sat Jun 14 00:18:17 2014 (r267456) +++ stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c Sat Jun 14 00:44:57 2014 (r267457) @@ -324,21 +324,7 @@ int os_revalidate_device(void *osext, in int os_query_remove_device(void *osext, int id) { - PVBUS_EXT vbus_ext = (PVBUS_EXT)osext; - struct cam_periph *periph = NULL; - struct cam_path *path; - int status,retval = 0; - - status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0); - if (status == CAM_REQ_CMP) { - if((periph = cam_periph_find(path, "da")) != NULL){ - if(periph->refcount >= 1) - retval = -1; - } - xpt_free_path(path); - } - - return retval; + return 0; } HPT_U8 os_get_vbus_seq(void *osext) Modified: stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Sat Jun 14 00:18:17 2014 (r267456) +++ stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Sat Jun 14 00:44:57 2014 (r267457) @@ -474,6 +474,16 @@ static void os_cmddone(PCOMMAND pCmd) static int os_buildsgl(PCOMMAND pCmd, PSG pSg, int logical) { + POS_CMDEXT ext = (POS_CMDEXT)pCmd->priv; + union ccb *ccb = ext->ccb; + + if (logical) { + os_set_sgptr(pSg, (HPT_U8 *)ccb->csio.data_ptr); + pSg->size = ccb->csio.dxfer_len; + pSg->eot = 1; + return TRUE; + } + /* since we have provided physical sg, nobody will ask us to build physical sg */ HPT_ASSERT(0); return FALSE; @@ -546,7 +556,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_e vd = ldm_find_target(vbus, ccb->ccb_h.target_id); if (!vd) { - ccb->ccb_h.status = CAM_TID_INVALID; + ccb->ccb_h.status = CAM_SEL_TIMEOUT; xpt_done(ccb); return; } Modified: stable/10/sys/dev/hptmv/entry.c ============================================================================== --- stable/10/sys/dev/hptmv/entry.c Sat Jun 14 00:18:17 2014 (r267456) +++ stable/10/sys/dev/hptmv/entry.c Sat Jun 14 00:44:57 2014 (r267457) @@ -2016,7 +2016,7 @@ hpt_probe(device_t dev) { KdPrintI((CONTROLLER_NAME " found\n")); device_set_desc(dev, CONTROLLER_NAME); - return 0; + return (BUS_PROBE_DEFAULT); } else return(ENXIO); @@ -2623,7 +2623,14 @@ launch_worker_thread(void) int HPTLIBAPI fOsBuildSgl(_VBUS_ARG PCommand pCmd, FPSCAT_GATH pSg, int logical) { - + union ccb *ccb = (union ccb *)pCmd->pOrgCommand; + + if (logical) { + pSg->dSgAddress = (ULONG_PTR)(UCHAR *)ccb->csio.data_ptr; + pSg->wSgSize = ccb->csio.dxfer_len; + pSg->wSgFlag = SG_FLAG_EOT; + return TRUE; + } /* since we have provided physical sg, nobody will ask us to build physical sg */ HPT_ASSERT(0); return FALSE; Modified: stable/10/sys/dev/hptrr/hptrr_os_bsd.c ============================================================================== --- stable/10/sys/dev/hptrr/hptrr_os_bsd.c Sat Jun 14 00:18:17 2014 (r267456) +++ stable/10/sys/dev/hptrr/hptrr_os_bsd.c Sat Jun 14 00:44:57 2014 (r267457) @@ -256,21 +256,7 @@ int os_revalidate_device(void *osext, in int os_query_remove_device(void *osext, int id) { - PVBUS_EXT vbus_ext = (PVBUS_EXT)osext; - struct cam_periph *periph = NULL; - struct cam_path *path; - int status,retval = 0; - - status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0); - if (status == CAM_REQ_CMP) { - if((periph = cam_periph_find(path, "da")) != NULL){ - if(periph->refcount >= 1) - retval = -1; - } - xpt_free_path(path); - } - - return retval; + return 0; } HPT_U8 os_get_vbus_seq(void *osext) Modified: stable/10/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- stable/10/sys/dev/hptrr/hptrr_osm_bsd.c Sat Jun 14 00:18:17 2014 (r267456) +++ stable/10/sys/dev/hptrr/hptrr_osm_bsd.c Sat Jun 14 00:44:57 2014 (r267457) @@ -61,7 +61,7 @@ static int hpt_probe(device_t dev) memset(hba, 0, sizeof(HBA)); hba->ext_type = EXT_TYPE_HBA; hba->ldm_adapter.him = him; - return 0; + return (BUS_PROBE_DEFAULT); } } } @@ -482,6 +482,15 @@ static void os_cmddone(PCOMMAND pCmd) static int os_buildsgl(PCOMMAND pCmd, PSG pSg, int logical) { + POS_CMDEXT ext = (POS_CMDEXT)pCmd->priv; + union ccb *ccb = ext->ccb; + + if (logical) { + os_set_sgptr(pSg, (HPT_U8 *)ccb->csio.data_ptr); + pSg->size = ccb->csio.dxfer_len; + pSg->eot = 1; + return TRUE; + } /* since we have provided physical sg, nobody will ask us to build physical sg */ HPT_ASSERT(0); @@ -555,7 +564,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_e vd = ldm_find_target(vbus, ccb->ccb_h.target_id); if (!vd) { - ccb->ccb_h.status = CAM_TID_INVALID; + ccb->ccb_h.status = CAM_SEL_TIMEOUT; xpt_done(ccb); return; } From owner-svn-src-stable-10@FreeBSD.ORG Sat Jun 14 02:57:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3700C3C7; Sat, 14 Jun 2014 02:57: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 228852104; Sat, 14 Jun 2014 02:57: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 s5E2vgkk084914; Sat, 14 Jun 2014 02:57:42 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5E2veqD084908; Sat, 14 Jun 2014 02:57:40 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201406140257.s5E2veqD084908@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 14 Jun 2014 02:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267465 - in stable/10: include include/xlocale lib/libc/string sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2014 02:57:42 -0000 Author: pfg Date: Sat Jun 14 02:57:40 2014 New Revision: 267465 URL: http://svnweb.freebsd.org/changeset/base/267465 Log: MFC r266865; Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance. POSIX.1-2008 specifies that those two functions should be declared by including , not (the latter only has strcoll_l() and strxfrm_l()): http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html Bump __FreeBSD_version for ports that may be using the non-standard reference. Obtained from: DragonFlyBSD Reviewed by: theraven Added: stable/10/include/xlocale/_strings.h - copied unchanged from r266865, head/include/xlocale/_strings.h Modified: stable/10/include/strings.h stable/10/include/xlocale/Makefile stable/10/include/xlocale/_string.h stable/10/lib/libc/string/strcasecmp.3 stable/10/sys/sys/param.h Modified: stable/10/include/strings.h ============================================================================== --- stable/10/include/strings.h Sat Jun 14 01:58:33 2014 (r267464) +++ stable/10/include/strings.h Sat Jun 14 02:57:40 2014 (r267465) @@ -59,6 +59,10 @@ char *rindex(const char *, int) __pure; #endif int strcasecmp(const char *, const char *) __pure; int strncasecmp(const char *, const char *, size_t) __pure; + +#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) +#include +#endif __END_DECLS #endif /* _STRINGS_H_ */ Modified: stable/10/include/xlocale/Makefile ============================================================================== --- stable/10/include/xlocale/Makefile Sat Jun 14 01:58:33 2014 (r267464) +++ stable/10/include/xlocale/Makefile Sat Jun 14 02:57:40 2014 (r267465) @@ -2,7 +2,7 @@ NO_OBJ= INCS= _ctype.h _inttypes.h _langinfo.h _locale.h _monetary.h _stdio.h\ - _stdlib.h _string.h _time.h _uchar.h _wchar.h + _stdlib.h _string.h _strings.h _time.h _uchar.h _wchar.h INCSDIR=${INCLUDEDIR}/xlocale .include Modified: stable/10/include/xlocale/_string.h ============================================================================== --- stable/10/include/xlocale/_string.h Sat Jun 14 01:58:33 2014 (r267464) +++ stable/10/include/xlocale/_string.h Sat Jun 14 02:57:40 2014 (r267465) @@ -53,9 +53,7 @@ size_t strxfrm_l(char *, const char *, #ifdef _XLOCALE_H_ #ifndef _XLOCALE_STRING2_H #define _XLOCALE_STRING2_H -int strcasecmp_l(const char *, const char *, locale_t); char *strcasestr_l(const char *, const char *, locale_t); -int strncasecmp_l(const char *, const char *, size_t, locale_t); #endif /* _XLOCALE_STRING2_H */ #endif /* _XLOCALE_H_ */ Copied: stable/10/include/xlocale/_strings.h (from r266865, head/include/xlocale/_strings.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/include/xlocale/_strings.h Sat Jun 14 02:57:40 2014 (r267465, copy of r266865, head/include/xlocale/_strings.h) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2011, 2012 The FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LOCALE_T_DEFINED +#define _LOCALE_T_DEFINED +typedef struct _xlocale *locale_t; +#endif + +/* + * This file is included from both strings.h and xlocale.h. We need to expose + * the declarations unconditionally if we are included from xlocale.h, but only + * if we are in POSIX2008 mode if included from string.h. + */ + +#ifndef _XLOCALE_STRINGS1_H +#define _XLOCALE_STRINGS1_H + +/* + * POSIX2008 functions + */ +int strcasecmp_l(const char *, const char *, locale_t); +int strncasecmp_l(const char *, const char *, size_t, locale_t); +#endif /* _XLOCALE_STRINGS1_H */ Modified: stable/10/lib/libc/string/strcasecmp.3 ============================================================================== --- stable/10/lib/libc/string/strcasecmp.3 Sat Jun 14 01:58:33 2014 (r267464) +++ stable/10/lib/libc/string/strcasecmp.3 Sat Jun 14 02:57:40 2014 (r267465) @@ -30,7 +30,7 @@ .\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd May 29, 2014 .Dt STRCASECMP 3 .Os .Sh NAME @@ -45,7 +45,7 @@ .Fn strcasecmp "const char *s1" "const char *s2" .Ft int .Fn strncasecmp "const char *s1" "const char *s2" "size_t len" -.In string.h +.In strings.h .In xlocale.h .Ft int .Fn strcasecmp_l "const char *s1" "const char *s2" "locale_t loc" Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Sat Jun 14 01:58:33 2014 (r267464) +++ stable/10/sys/sys/param.h Sat Jun 14 02:57:40 2014 (r267465) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000709 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000710 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@FreeBSD.ORG Sat Jun 14 11:20:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A33785B3; Sat, 14 Jun 2014 11:20: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 8DE7126EA; Sat, 14 Jun 2014 11:20: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 s5EBKfwp020714; Sat, 14 Jun 2014 11:20:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5EBKfdV020713; Sat, 14 Jun 2014 11:20:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201406141120.s5EBKfdV020713@svn.freebsd.org> From: Dimitry Andric Date: Sat, 14 Jun 2014 11:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267470 - stable/10/lib/clang X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2014 11:20:41 -0000 Author: dim Date: Sat Jun 14 11:20:41 2014 New Revision: 267470 URL: http://svnweb.freebsd.org/changeset/base/267470 Log: MFC r267335: In some scenarios, when generating llvm/clang .inc.h files, multiple source files could be passed to tblgen or clang-tblgen, leading to a "Too many positional arguments specified" error message. Fix this by replacing the too-generic ${.ALLSRC} sources with explicit paths. Reported by: rysto32@gmail.com, rodrigc Modified: stable/10/lib/clang/clang.build.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/clang/clang.build.mk ============================================================================== --- stable/10/lib/clang/clang.build.mk Sat Jun 14 11:13:02 2014 (r267469) +++ stable/10/lib/clang/clang.build.mk Sat Jun 14 11:20:41 2014 (r267470) @@ -70,149 +70,160 @@ ${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM Attrs.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-classes \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrDump.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-dump \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrIdentifierArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-identifier-arg-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-impl \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-late-parsed-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrParsedAttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-impl \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrParsedAttrKinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-kinds \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-pch-read \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-pch-write \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-spelling-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrSpellingListIndex.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-spelling-index \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-template-instantiate \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrTypeArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-type-arg-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td CommentCommandInfo.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td ${CLANG_TBLGEN} -gen-clang-comment-command-info \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/CommentCommands.td CommentCommandList.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td ${CLANG_TBLGEN} -gen-clang-comment-command-list \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/CommentCommands.td CommentHTMLNamedCharacterReferences.inc.h: \ ${CLANG_SRCS}/include/clang/AST/CommentHTMLNamedCharacterReferences.td ${CLANG_TBLGEN} -gen-clang-comment-html-named-character-references \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/CommentHTMLNamedCharacterReferences.td CommentHTMLTags.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td ${CLANG_TBLGEN} -gen-clang-comment-html-tags \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td CommentHTMLTagsProperties.inc.h: \ ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td ${CLANG_TBLGEN} -gen-clang-comment-html-tags-properties \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td CommentNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td ${CLANG_TBLGEN} -gen-clang-comment-nodes \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td DeclNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td ${CLANG_TBLGEN} -gen-clang-decl-nodes \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td StmtNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td ${CLANG_TBLGEN} -gen-clang-stmt-nodes \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td arm_neon.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td ${CLANG_TBLGEN} -gen-arm-neon \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/arm_neon.td arm_neon.inc.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td ${CLANG_TBLGEN} -gen-arm-neon-sema \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/arm_neon.td DiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td ${CLANG_TBLGEN} -gen-clang-diag-groups \ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ - -o ${.TARGET} ${.ALLSRC} + -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td DiagnosticIndexName.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td ${CLANG_TBLGEN} -gen-clang-diags-index-name \ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ - -o ${.TARGET} ${.ALLSRC} + -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td .for hdr in AST Analysis Comment Common Driver Frontend Lex Parse Sema Serialization Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td ${CLANG_TBLGEN} -gen-clang-diags-defs -clang-component=${hdr} \ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ - -o ${.TARGET} ${.ALLSRC} + -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td .endfor Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td ${TBLGEN} -gen-opt-parser-defs \ -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Driver/Options.td CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td ${TBLGEN} -gen-opt-parser-defs \ -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td -Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td \ - ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/CheckerBase.td +Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td ${CLANG_TBLGEN} -gen-clang-sa-checkers \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td From owner-svn-src-stable-10@FreeBSD.ORG Sat Jun 14 11:46:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC472147; Sat, 14 Jun 2014 11:46: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 A7D3928FD; Sat, 14 Jun 2014 11:46: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 s5EBkNto031925; Sat, 14 Jun 2014 11:46:23 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5EBkMKv031921; Sat, 14 Jun 2014 11:46:22 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201406141146.s5EBkMKv031921@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 14 Jun 2014 11:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267477 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2014 11:46:23 -0000 Author: edwin Date: Sat Jun 14 11:46:22 2014 New Revision: 267477 URL: http://svnweb.freebsd.org/changeset/base/267477 Log: MFC of 267473,tzdata2014e Fix historical data for Egypt. Better prediction for future Egypt / Morocco changes. Update to Cocos / Cook islands. Fix historical data for Russia. Modified: stable/10/contrib/tzdata/africa stable/10/contrib/tzdata/australasia stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/northamerica Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/africa ============================================================================== --- stable/10/contrib/tzdata/africa Sat Jun 14 11:37:53 2014 (r267476) +++ stable/10/contrib/tzdata/africa Sat Jun 14 11:46:22 2014 (r267477) @@ -239,13 +239,13 @@ Rule Egypt 1990 1994 - May 1 1:00 1:00 # http://www.worldtimezone.com/dst_news/dst_news_egypt04.html # Rule Egypt 1995 2010 - Apr lastFri 0:00s 1:00 S -Rule Egypt 1995 2005 - Sep lastThu 23:00s 0 - +Rule Egypt 1995 2005 - Sep lastThu 24:00 0 - # From Steffen Thorsen (2006-09-19): # The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports: # Egypt will turn back clocks by one hour at the midnight of Thursday # after observing the daylight saving time since May. # http://news.gom.com.eg/gazette/pdf/2006/09/18/01.pdf -Rule Egypt 2006 only - Sep 21 23:00s 0 - +Rule Egypt 2006 only - Sep 21 24:00 0 - # From Dirk Losch (2007-08-14): # I received a mail from an airline which says that the daylight # saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07. @@ -254,7 +254,7 @@ Rule Egypt 2006 only - Sep 21 23:00s 0 - # http://www.timeanddate.com/worldclock/city.html?n=53 # From Steffen Thorsen (2007-09-04): The official information...: # http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm -Rule Egypt 2007 only - Sep Thu>=1 23:00s 0 - +Rule Egypt 2007 only - Sep Thu>=1 24:00 0 - # From Abdelrahman Hassan (2007-09-06): # Due to the Hijri (lunar Islamic calendar) year being 11 days shorter # than the year of the Gregorian calendar, Ramadan shifts earlier each @@ -342,46 +342,77 @@ Rule Egypt 2007 only - Sep Thu>=1 23:00s # From Gunther Vermier (2015-05-13): # our Egypt office confirms that the change will be at 15 May "midnight" (24:00) -# From Paul Eggert (2014-05-13): +# From Imed Chihi (2014-06-04): +# We have finally "located" a precise official reference about the DST changes +# in Egypt. The Ministers Cabinet decision is explained at +# http://www.cabinet.gov.eg/Media/CabinetMeetingsDetails.aspx?id=347 ... +# [T]his (Arabic) site is not accessible outside Egypt, but the page ... +# translates into: "With regard to daylight saving time, it is scheduled to +# take effect at exactly twelve o'clock this evening, Thursday, 15 MAY 2014, +# to be suspended by twelve o'clock on the evening of Thursday, 26 JUN 2014, +# and re-established again at the end of the month of Ramadan, at twelve +# o'clock on the evening of Thursday, 31 JUL 2014." This statement has been +# reproduced by other (more accessible) sites[, e.g.,]... +# http://elgornal.net/news/news.aspx?id=4699258 + +# From Paul Eggert (2014-06-04): # Sarah El Deeb and Lee Keath of AP report that the Egyptian government says # the change is because of blackouts in Cairo, even though Ahram Online (cited -# above) says DST had no affect on electricity consumption. The AP story says -# DST will not be observed during Ramadan. There is no information about when -# DST will end. See: +# above) says DST had no affect on electricity consumption. There is +# no information about when DST will end this fall. See: # http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833 # -# For now, guess that later transitions will use 2010's rules, and that -# Egypt will agree with Morocco (see below) about the date Ramadan starts and -# ends, though (unlike Morocco) it will switch at 00:00 standard time. In -# Egypt the spring-forward transitions are removed for 2020-2022, when the -# guessed spring-forward date falls during the estimated Ramadan, and all -# transitions removed for 2023-2038, where the estimated Ramadan falls entirely -# outside the guessed daylight-saving time. Ramadan intrudes on the guessed -# DST starting in 2039, but that's beyond our somewhat-arbitrary cutoff. - -Rule Egypt 2008 only - Aug lastThu 23:00s 0 - -Rule Egypt 2009 only - Aug 20 23:00s 0 - -Rule Egypt 2010 only - Aug 11 0:00 0 - -Rule Egypt 2010 only - Sep 10 0:00 1:00 S -Rule Egypt 2010 only - Sep lastThu 23:00s 0 - +# For now, guess that later spring and fall transitions will use +# 2010's rules, and guess that Egypt will switch to standard time at +# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the +# first Friday after Ramadan. To implement this, +# transition dates for 2015 through 2037 were determined by running +# the following program under GNU Emacs 24.3, with the results integrated +# by hand into the table below. Ramadan again intrudes on the guessed +# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff. +# (let ((islamic-year 1436)) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (friday 5)) +# (while (/= friday (mod a 7)) +# (setq a (1- a))) +# (while (/= friday (mod b 7)) +# (setq b (1+ b))) +# (setq a (1- a)) +# (setq b (1- b)) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n" +# "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# (setq islamic-year (+ 1 islamic-year)))) +Rule Egypt 2008 only - Aug lastThu 24:00 0 - +Rule Egypt 2009 only - Aug 20 24:00 0 - +Rule Egypt 2010 only - Aug 10 24:00 0 - +Rule Egypt 2010 only - Sep 9 24:00 1:00 S +Rule Egypt 2010 only - Sep lastThu 24:00 0 - Rule Egypt 2014 only - May 15 24:00 1:00 S -Rule Egypt 2014 only - Jun 29 0:00s 0 - -Rule Egypt 2014 only - Jul 29 0:00s 1:00 S -Rule Egypt 2014 max - Sep lastThu 23:00s 0 - +Rule Egypt 2014 only - Jun 26 24:00 0 - +Rule Egypt 2014 only - Jul 31 24:00 1:00 S +Rule Egypt 2014 max - Sep lastThu 24:00 0 - Rule Egypt 2015 2019 - Apr lastFri 0:00s 1:00 S -Rule Egypt 2015 only - Jun 18 0:00s 0 - -Rule Egypt 2015 only - Jul 18 0:00s 1:00 S -Rule Egypt 2016 only - Jun 7 0:00s 0 - -Rule Egypt 2016 only - Jul 7 0:00s 1:00 S -Rule Egypt 2017 only - May 27 0:00s 0 - -Rule Egypt 2017 only - Jun 26 0:00s 1:00 S -Rule Egypt 2018 only - May 16 0:00s 0 - -Rule Egypt 2018 only - Jun 15 0:00s 1:00 S -Rule Egypt 2019 only - May 6 0:00s 0 - -Rule Egypt 2019 only - Jun 5 0:00s 1:00 S -Rule Egypt 2020 only - May 24 0:00s 1:00 S -Rule Egypt 2021 only - May 13 0:00s 1:00 S -Rule Egypt 2022 only - May 3 0:00s 1:00 S +Rule Egypt 2015 only - Jun 11 24:00 0 - +Rule Egypt 2015 only - Jul 23 24:00 1:00 S +Rule Egypt 2016 only - Jun 2 24:00 0 - +Rule Egypt 2016 only - Jul 7 24:00 1:00 S +Rule Egypt 2017 only - May 25 24:00 0 - +Rule Egypt 2017 only - Jun 29 24:00 1:00 S +Rule Egypt 2018 only - May 10 24:00 0 - +Rule Egypt 2018 only - Jun 14 24:00 1:00 S +Rule Egypt 2019 only - May 2 24:00 0 - +Rule Egypt 2019 only - Jun 6 24:00 1:00 S +Rule Egypt 2020 only - May 28 24:00 1:00 S +Rule Egypt 2021 only - May 13 24:00 1:00 S +Rule Egypt 2022 only - May 5 24:00 1:00 S Rule Egypt 2023 max - Apr lastFri 0:00s 1:00 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -914,39 +945,36 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # From Sebastien Willemijns (2014-03-18): # http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp -# From Paul Eggert (2014-03-19): -# To estimate what the Moroccan government will do in future years, -# transition dates for 2014 through 2038 were determined by running -# the following program under GNU Emacs 24.3: -# -# (let ((islamic-year 1435)) -# (while (< islamic-year 1461) -# (let ((a -# (calendar-gregorian-from-absolute -# (calendar-islamic-to-absolute (list 9 1 islamic-year)))) -# (b -# (calendar-gregorian-from-absolute -# (calendar-islamic-to-absolute (list 10 1 islamic-year))))) -# (insert -# (format -# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 3:00\t0\t-\n" -# "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 2:00\t1:00\tS\n") -# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) -# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# From Milamber Space Network (2014-06-05): +# The Moroccan government has recently announced that the country will return +# to standard time at 03:00 on Saturday, June 28, 2014 local time.... DST +# will resume again at 02:00 on Saturday, August 2, 2014.... +# http://www.mmsp.gov.ma/fr/actualites.aspx?id=586 + +# From Paul Eggert (2014-06-05): +# For now, guess that later spring and fall transitions will use 2014's rules, +# and guess that Morocco will switch to standard time at 03:00 the last +# Saturday before Ramadan, and back to DST at 02:00 the first Saturday after +# Ramadan. To implement this, transition dates for 2015 through 2037 were +# determined by running the following program under GNU Emacs 24.3, with the +# results integrated by hand into the table below. +# (let ((islamic-year 1436)) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (saturday 6)) +# (while (/= saturday (mod (setq a (1- a)) 7))) +# (while (/= saturday (mod b 7)) +# (setq b (1+ b))) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t0\t-\n" +# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t1:00\tS\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) # (setq islamic-year (+ 1 islamic-year)))) -# -# with spring-forward transitions removed for 2023-2025, when the -# normal spring-forward date falls during the estimated Ramadan; with -# all transitions removed for 2026-2035, where the estimated Ramadan -# falls entirely outside daylight-saving time; and with fall-back -# transitions removed for 2036-2037, where the normal fall-back -# date falls during the estimated Ramadan. Normally, the table would -# stop after 2037 because 32-bit time_t values roll around early in 2038, -# but that would imply a prediction of perpetual DST after March 2038 -# due to the year-2037 glitches. So, this table instead stops after -# 2038, the first non-glitchy year after the 32-bit rollover. -# An advantage of stopping after 2038 is that it lets zic guess -# TZ='WET0WEST,M3.5.0,M10.5.0/3' for time stamps far in the future. # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -968,46 +996,44 @@ Rule Morocco 1978 only - Aug 4 0:00 0 Rule Morocco 2008 only - Jun 1 0:00 1:00 S Rule Morocco 2008 only - Sep 1 0:00 0 - Rule Morocco 2009 only - Jun 1 0:00 1:00 S -Rule Morocco 2009 only - Aug 21 0:00 0 - +Rule Morocco 2009 only - Aug 21 0:00 0 - Rule Morocco 2010 only - May 2 0:00 1:00 S Rule Morocco 2010 only - Aug 8 0:00 0 - Rule Morocco 2011 only - Apr 3 0:00 1:00 S -Rule Morocco 2011 only - Jul 31 0 0 - -Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S -Rule Morocco 2012 only - Sep 30 3:00 0 - -Rule Morocco 2012 only - Jul 20 3:00 0 - -Rule Morocco 2012 only - Aug 20 2:00 1:00 S -Rule Morocco 2013 only - Jul 7 3:00 0 - -Rule Morocco 2013 only - Aug 10 2:00 1:00 S -Rule Morocco 2013 2035 - Oct lastSun 3:00 0 - -Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S -Rule Morocco 2014 only - Jun 29 3:00 0 - -Rule Morocco 2014 only - Jul 29 2:00 1:00 S -Rule Morocco 2015 only - Jun 18 3:00 0 - -Rule Morocco 2015 only - Jul 18 2:00 1:00 S -Rule Morocco 2016 only - Jun 7 3:00 0 - -Rule Morocco 2016 only - Jul 7 2:00 1:00 S -Rule Morocco 2017 only - May 27 3:00 0 - -Rule Morocco 2017 only - Jun 26 2:00 1:00 S -Rule Morocco 2018 only - May 16 3:00 0 - -Rule Morocco 2018 only - Jun 15 2:00 1:00 S -Rule Morocco 2019 only - May 6 3:00 0 - -Rule Morocco 2019 only - Jun 5 2:00 1:00 S -Rule Morocco 2020 only - Apr 24 3:00 0 - -Rule Morocco 2020 only - May 24 2:00 1:00 S -Rule Morocco 2021 only - Apr 13 3:00 0 - -Rule Morocco 2021 only - May 13 2:00 1:00 S -Rule Morocco 2022 only - Apr 3 3:00 0 - -Rule Morocco 2022 only - May 3 2:00 1:00 S -Rule Morocco 2023 only - Apr 22 2:00 1:00 S -Rule Morocco 2024 only - Apr 10 2:00 1:00 S -Rule Morocco 2025 only - Mar 31 2:00 1:00 S -Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S -Rule Morocco 2036 only - Oct 21 3:00 0 - -Rule Morocco 2037 only - Oct 11 3:00 0 - -Rule Morocco 2038 only - Sep 30 3:00 0 - -Rule Morocco 2038 only - Oct 30 2:00 1:00 S -Rule Morocco 2038 max - Oct lastSun 3:00 0 - +Rule Morocco 2011 only - Jul 31 0 0 - +Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S +Rule Morocco 2012 only - Sep 30 3:00 0 - +Rule Morocco 2012 only - Jul 20 3:00 0 - +Rule Morocco 2012 only - Aug 20 2:00 1:00 S +Rule Morocco 2013 only - Jul 7 3:00 0 - +Rule Morocco 2013 only - Aug 10 2:00 1:00 S +Rule Morocco 2013 max - Oct lastSun 3:00 0 - +Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S +Rule Morocco 2014 only - Jun 28 3:00 0 - +Rule Morocco 2014 only - Aug 2 2:00 1:00 S +Rule Morocco 2015 only - Jun 13 3:00 0 - +Rule Morocco 2015 only - Jul 18 2:00 1:00 S +Rule Morocco 2016 only - Jun 4 3:00 0 - +Rule Morocco 2016 only - Jul 9 2:00 1:00 S +Rule Morocco 2017 only - May 20 3:00 0 - +Rule Morocco 2017 only - Jul 1 2:00 1:00 S +Rule Morocco 2018 only - May 12 3:00 0 - +Rule Morocco 2018 only - Jun 16 2:00 1:00 S +Rule Morocco 2019 only - May 4 3:00 0 - +Rule Morocco 2019 only - Jun 8 2:00 1:00 S +Rule Morocco 2020 only - Apr 18 3:00 0 - +Rule Morocco 2020 only - May 30 2:00 1:00 S +Rule Morocco 2021 only - Apr 10 3:00 0 - +Rule Morocco 2021 only - May 15 2:00 1:00 S +Rule Morocco 2022 only - Apr 2 3:00 0 - +Rule Morocco 2022 only - May 7 2:00 1:00 S +Rule Morocco 2023 only - Apr 22 2:00 1:00 S +Rule Morocco 2024 only - Apr 13 2:00 1:00 S +Rule Morocco 2025 only - Apr 5 2:00 1:00 S +Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S +Rule Morocco 2035 only - Oct 27 3:00 0 - +Rule Morocco 2036 only - Oct 18 3:00 0 - +Rule Morocco 2037 only - Oct 10 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Modified: stable/10/contrib/tzdata/australasia ============================================================================== --- stable/10/contrib/tzdata/australasia Sat Jun 14 11:37:53 2014 (r267476) +++ stable/10/contrib/tzdata/australasia Sat Jun 14 11:46:22 2014 (r267477) @@ -250,24 +250,14 @@ Zone Antarctica/Macquarie 0 - zzz 1899 N Zone Indian/Christmas 7:02:52 - LMT 1895 Feb 7:00 - CXT # Christmas Island Time -# Cook Is -# From Shanks & Pottenger: -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Cook 1978 only - Nov 12 0:00 0:30 HS -Rule Cook 1979 1991 - Mar Sun>=1 0:00 0 - -Rule Cook 1979 1990 - Oct lastSun 0:00 0:30 HS -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Rarotonga -10:39:04 - LMT 1901 # Avarua - -10:30 - CKT 1978 Nov 12 # Cook Is Time - -10:00 Cook CK%sT - -# Cocos +# Cocos (Keeling) Is # These islands were ruled by the Ross family from about 1830 to 1978. # We don't know when standard time was introduced; for now, we guess 1900. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Indian/Cocos 6:27:40 - LMT 1900 6:30 - CCT # Cocos Islands Time + # Fiji # Milne gives 11:55:44 for Suva. @@ -473,7 +463,8 @@ Rule NZ 1934 1940 - Apr lastSun 2:00 0 M Rule NZ 1934 1940 - Sep lastSun 2:00 0:30 S Rule NZ 1946 only - Jan 1 0:00 0 S # Since 1957 Chatham has been 45 minutes ahead of NZ, but there's no -# convenient notation for this so we must duplicate the Rule lines. +# convenient single notation for the date and time of this transition +# so we must duplicate the Rule lines. Rule NZ 1974 only - Nov Sun>=1 2:00s 1:00 D Rule Chatham 1974 only - Nov Sun>=1 2:45s 1:00 D Rule NZ 1975 only - Feb lastSun 2:00s 0 S @@ -511,6 +502,17 @@ Link Pacific/Auckland Antarctica/McMurdo # previously whalers, sealers, pastoralists, and scientific personnel wintered # was probably like Pacific/Auckland +# Cook Is +# From Shanks & Pottenger: +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Cook 1978 only - Nov 12 0:00 0:30 HS +Rule Cook 1979 1991 - Mar Sun>=1 0:00 0 - +Rule Cook 1979 1990 - Oct lastSun 0:00 0:30 HS +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Rarotonga -10:39:04 - LMT 1901 # Avarua + -10:30 - CKT 1978 Nov 12 # Cook Is Time + -10:00 Cook CK%sT + ############################################################################### Modified: stable/10/contrib/tzdata/europe ============================================================================== --- stable/10/contrib/tzdata/europe Sat Jun 14 11:37:53 2014 (r267476) +++ stable/10/contrib/tzdata/europe Sat Jun 14 11:46:22 2014 (r267477) @@ -6,7 +6,7 @@ # go ahead and edit the file (and please send any changes to # tz@iana.org for general use in the future). -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2014-05-31): # A good source for time zone historical data outside the U.S. is # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). @@ -17,6 +17,9 @@ # published semiannually. Law sent in several helpful summaries # of the IATA's data after 1990. # +# A reliable and entertaining source about time zones is +# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). +# # Except where otherwise noted, Shanks & Pottenger is the source for # entries through 1991, and IATA SSIM is the source for entries afterwards. # @@ -26,9 +29,9 @@ # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), # which I found in the UCLA library. # -# # William Willett, The Waste of Daylight, 19th edition -# (1914-03) +# +# [PDF] (1914-03) # # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 # . He writes: @@ -58,10 +61,7 @@ # 1:00 CET CEST CEMT Central Europe # 1:00:14 SET Swedish (1879-1899)* # 2:00 EET EEST Eastern Europe -# 3:00 MSK MSD Moscow -# -# A reliable and entertaining source about time zones, especially in Britain, -# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). +# 3:00 MSK MSD MSM* Moscow # From Peter Ilieve (1994-12-04), # The original six [EU members]: Belgium, France, (West) Germany, Italy, @@ -558,11 +558,11 @@ Rule Russia 1917 only - Dec 28 0:00 0 M Rule Russia 1918 only - May 31 22:00 2:00 MDST # Moscow Double Summer Time Rule Russia 1918 only - Sep 16 1:00 1:00 MST Rule Russia 1919 only - May 31 23:00 2:00 MDST -Rule Russia 1919 only - Jul 1 2:00 1:00 S -Rule Russia 1919 only - Aug 16 0:00 0 - -Rule Russia 1921 only - Feb 14 23:00 1:00 S -Rule Russia 1921 only - Mar 20 23:00 2:00 M # Midsummer -Rule Russia 1921 only - Sep 1 0:00 1:00 S +Rule Russia 1919 only - Jul 1 2:00 1:00 MSD +Rule Russia 1919 only - Aug 16 0:00 0 MSK +Rule Russia 1921 only - Feb 14 23:00 1:00 MSD +Rule Russia 1921 only - Mar 20 23:00 2:00 MSM # Midsummer +Rule Russia 1921 only - Sep 1 0:00 1:00 MSD Rule Russia 1921 only - Oct 1 0:00 0 - # Act No.925 of the Council of Ministers of the USSR (1980-10-24): Rule Russia 1981 1984 - Apr 1 0:00 1:00 S @@ -2217,6 +2217,7 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1 Zone Europe/Moscow 2:30:20 - LMT 1880 2:30 - MMT 1916 Jul 3 # Moscow Mean Time 2:30:48 Russia %s 1919 Jul 1 2:00 + 3:00 Russia %s 1921 Oct 3:00 Russia MSK/MSD 1922 Oct 2:00 - EET 1930 Jun 21 3:00 Russia MSK/MSD 1991 Mar 31 2:00s @@ -2375,7 +2376,7 @@ Zone Asia/Yakutsk 8:38:40 - LMT 1919 De Zone Asia/Vladivostok 8:47:44 - LMT 1922 Nov 15 9:00 - VLAT 1930 Jun 21 # Vladivostok Time 10:00 Russia VLA%sT 1991 Mar 31 2:00s - 9:00 Russia VLA%sST 1992 Jan 19 2:00s + 9:00 Russia VLA%sT 1992 Jan 19 2:00s 10:00 Russia VLA%sT 2011 Mar 27 2:00s 11:00 - VLAT Modified: stable/10/contrib/tzdata/northamerica ============================================================================== --- stable/10/contrib/tzdata/northamerica Sat Jun 14 11:37:53 2014 (r267476) +++ stable/10/contrib/tzdata/northamerica Sat Jun 14 11:46:22 2014 (r267477) @@ -1019,9 +1019,9 @@ Zone America/Menominee -5:50:27 - LMT 18 # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), # which I found in the UCLA library. # -# # William Willett, The Waste of Daylight, 19th edition -# (1914-03) +# +# [PDF] (1914-03) # # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 # . From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 15 05:15:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B0A4EF75; Sun, 15 Jun 2014 05:15: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 9D286221A; Sun, 15 Jun 2014 05:15: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 s5F5FdZd014453; Sun, 15 Jun 2014 05:15:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F5Fcbj014446; Sun, 15 Jun 2014 05:15:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406150515.s5F5Fcbj014446@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 15 Jun 2014 05:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267494 - in stable/10/sys: conf kern modules/ufs ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jun 2014 05:15:39 -0000 Author: kib Date: Sun Jun 15 05:15:38 2014 New Revision: 267494 URL: http://svnweb.freebsd.org/changeset/base/267494 Log: MFC r267226: Initialize the pbuf counter for directio using SYSINIT. Mark ffs_rawread.c as requiring both ffs and directio options to be compiled into the kernel. Add ffs_rawread.c to the list of ufs.ko module' sources. Modified: stable/10/sys/conf/files stable/10/sys/kern/vfs_bio.c stable/10/sys/modules/ufs/Makefile stable/10/sys/ufs/ffs/ffs_rawread.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sun Jun 15 05:07:01 2014 (r267493) +++ stable/10/sys/conf/files Sun Jun 15 05:15:38 2014 (r267494) @@ -3910,7 +3910,7 @@ ufs/ffs/ffs_subr.c optional ffs ufs/ffs/ffs_tables.c optional ffs ufs/ffs/ffs_vfsops.c optional ffs ufs/ffs/ffs_vnops.c optional ffs -ufs/ffs/ffs_rawread.c optional directio +ufs/ffs/ffs_rawread.c optional ffs directio ufs/ffs/ffs_suspend.c optional ffs ufs/ufs/ufs_acl.c optional ffs ufs/ufs/ufs_bmap.c optional ffs Modified: stable/10/sys/kern/vfs_bio.c ============================================================================== --- stable/10/sys/kern/vfs_bio.c Sun Jun 15 05:07:01 2014 (r267493) +++ stable/10/sys/kern/vfs_bio.c Sun Jun 15 05:15:38 2014 (r267494) @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$"); #include #include #include "opt_compat.h" -#include "opt_directio.h" #include "opt_swap.h" static MALLOC_DEFINE(M_BIOBUF, "biobuf", "BIO buffer"); @@ -351,10 +350,6 @@ sysctl_bufspace(SYSCTL_HANDLER_ARGS) } #endif -#ifdef DIRECTIO -extern void ffs_rawread_setup(void); -#endif /* DIRECTIO */ - /* * bqlock: * @@ -739,9 +734,6 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon if (nswbuf < NSWBUF_MIN) nswbuf = NSWBUF_MIN; #endif -#ifdef DIRECTIO - ffs_rawread_setup(); -#endif /* * Reserve space for the buffer cache buffers Modified: stable/10/sys/modules/ufs/Makefile ============================================================================== --- stable/10/sys/modules/ufs/Makefile Sun Jun 15 05:07:01 2014 (r267493) +++ stable/10/sys/modules/ufs/Makefile Sun Jun 15 05:15:38 2014 (r267494) @@ -6,9 +6,9 @@ KMOD= ufs SRCS= opt_ddb.h opt_directio.h opt_ffs.h opt_quota.h opt_suiddir.h opt_ufs.h \ vnode_if.h ufs_acl.c ufs_bmap.c ufs_dirhash.c ufs_extattr.c \ ufs_gjournal.c ufs_inode.c ufs_lookup.c ufs_quota.c ufs_vfsops.c \ - ufs_vnops.c ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_snapshot.c \ - ffs_softdep.c ffs_subr.c ffs_suspend.c ffs_tables.c ffs_vfsops.c \ - ffs_vnops.c + ufs_vnops.c ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_rawread.c \ + ffs_snapshot.c ffs_softdep.c ffs_subr.c ffs_suspend.c ffs_tables.c \ + ffs_vfsops.c ffs_vnops.c .if !defined(KERNBUILDDIR) CFLAGS+= -DSOFTUPDATES -DUFS_DIRHASH Modified: stable/10/sys/ufs/ffs/ffs_rawread.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_rawread.c Sun Jun 15 05:07:01 2014 (r267493) +++ stable/10/sys/ufs/ffs/ffs_rawread.c Sun Jun 15 05:15:38 2014 (r267494) @@ -71,8 +71,6 @@ static int ffs_rawread_sync(struct vnode int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); -void ffs_rawread_setup(void); - SYSCTL_DECL(_vfs_ffs); static int ffsrawbufcnt = 4; @@ -87,13 +85,13 @@ static int rawreadahead = 1; SYSCTL_INT(_vfs_ffs, OID_AUTO, rawreadahead, CTLFLAG_RW, &rawreadahead, 0, "Flag to enable readahead for long raw reads"); - -void -ffs_rawread_setup(void) +static void +ffs_rawread_setup(void *arg __unused) { + ffsrawbufcnt = (nswbuf > 100 ) ? (nswbuf - (nswbuf >> 4)) : nswbuf - 8; } - +SYSINIT(ffs_raw, SI_SUB_VM_CONF, SI_ORDER_ANY, ffs_rawread_setup, NULL); static int ffs_rawread_sync(struct vnode *vp) From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 15 05:17:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7BBA2137; Sun, 15 Jun 2014 05:17: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 696192225; Sun, 15 Jun 2014 05:17: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 s5F5Hfc1014797; Sun, 15 Jun 2014 05:17:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F5HfSr014796; Sun, 15 Jun 2014 05:17:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406150517.s5F5HfSr014796@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 15 Jun 2014 05:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267495 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jun 2014 05:17:41 -0000 Author: kib Date: Sun Jun 15 05:17:40 2014 New Revision: 267495 URL: http://svnweb.freebsd.org/changeset/base/267495 Log: MFC r267227: Remove write-only local variable. Modified: stable/10/sys/kern/sched_ule.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sched_ule.c ============================================================================== --- stable/10/sys/kern/sched_ule.c Sun Jun 15 05:15:38 2014 (r267494) +++ stable/10/sys/kern/sched_ule.c Sun Jun 15 05:17:40 2014 (r267495) @@ -2691,7 +2691,6 @@ sched_throw(struct thread *td) void sched_fork_exit(struct thread *td) { - struct td_sched *ts; struct tdq *tdq; int cpuid; @@ -2701,7 +2700,6 @@ sched_fork_exit(struct thread *td) */ cpuid = PCPU_GET(cpuid); tdq = TDQ_CPU(cpuid); - ts = td->td_sched; if (TD_IS_IDLETHREAD(td)) td->td_lock = TDQ_LOCKPTR(tdq); MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 15 18:32:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 520698E2; Sun, 15 Jun 2014 18:32: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 3DF49259B; Sun, 15 Jun 2014 18:32: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 s5FIW35Z086762; Sun, 15 Jun 2014 18:32:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FIW3cY086761; Sun, 15 Jun 2014 18:32:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406151832.s5FIW3cY086761@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 15 Jun 2014 18:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267517 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jun 2014 18:32:03 -0000 Author: hselasky Date: Sun Jun 15 18:32:02 2014 New Revision: 267517 URL: http://svnweb.freebsd.org/changeset/base/267517 Log: MFC r267395: - Fix out of range shifting bug in bitops.h. - Make code a bit easier to read by adding parenthesis. Modified: stable/10/sys/ofed/include/linux/bitops.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/bitops.h ============================================================================== --- stable/10/sys/ofed/include/linux/bitops.h Sun Jun 15 18:30:26 2014 (r267516) +++ stable/10/sys/ofed/include/linux/bitops.h Sun Jun 15 18:32:02 2014 (r267517) @@ -286,14 +286,14 @@ bitmap_empty(unsigned long *addr, int si #define NBLONG (NBBY * sizeof(long)) #define set_bit(i, a) \ - atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << (i) % NBLONG) + atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) #define clear_bit(i, a) \ - atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << (i) % NBLONG) + atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) #define test_bit(i, a) \ !!(atomic_load_acq_long(&((volatile long *)(a))[(i)/NBLONG]) & \ - 1UL << ((i) % NBLONG)) + (1UL << ((i) % NBLONG))) static inline long test_and_clear_bit(long bit, long *var) @@ -302,7 +302,7 @@ test_and_clear_bit(long bit, long *var) var += bit / (sizeof(long) * NBBY); bit %= sizeof(long) * NBBY; - bit = 1 << bit; + bit = (1UL << bit); do { val = *(volatile long *)var; } while (atomic_cmpset_long(var, val, val & ~bit) == 0); @@ -317,7 +317,7 @@ test_and_set_bit(long bit, long *var) var += bit / (sizeof(long) * NBBY); bit %= sizeof(long) * NBBY; - bit = 1 << bit; + bit = (1UL << bit); do { val = *(volatile long *)var; } while (atomic_cmpset_long(var, val, val | bit) == 0); From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 16 11:26:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 03EDD130; Mon, 16 Jun 2014 11:26:33 +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 E27422568; Mon, 16 Jun 2014 11:26: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 s5GBQWgj048481; Mon, 16 Jun 2014 11:26:32 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GBQUxv048470; Mon, 16 Jun 2014 11:26:30 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201406161126.s5GBQUxv048470@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 16 Jun 2014 11:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267538 - in stable/10/sys/dev/vt: . hw/efifb hw/fb hw/ofwfb hw/vga hw/xboxfb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2014 11:26:33 -0000 Author: ray Date: Mon Jun 16 11:26:30 2014 New Revision: 267538 URL: http://svnweb.freebsd.org/changeset/base/267538 Log: MFC 262785 263183 264182 264999 265391 265392 265395 265397 265398 265402 265403 265442 265546 265680 265681 265719 265862 265864 265867 265927 266010 266495 266540 266835 266856 266861 266862 267007 267310. 265391 Define a new method for probing vt(4) driver before attach it at early stage. 265392 Create dataset for vt(4) drivers. 265395 Set of updates to vt(4) core part. o Declare vt(4) drivers dataset. o Create single static structures for all early drivers. o Add vt(4) to be by default in the kernel consoles list. o Create one more sysinit point, to be able to initialize memory and lock requirement of early drivers. o Implement early drivers select. (Only best available will be selected). o Fix one missed "return (0)" for VTYLOCK. o Improve locking for cases when one driver replace another. o Make driver replacement notification less debug-look-like. o Minor spell fixes. 265397 Switch fb and efifb drivers to use names and new vt(4) driver probe method. 265398 Add vt(4) driver name for ofwfb driver. 265402 Revert r264997 and r265026. It is not required anymore. 265403 Switch vga drivers to use names and new vt(4) driver probe method. 265442 Implement KDMKTONE ioctl. 265546 Fix possible divide by zero. 265680 No need to assign fields required and checked on probe. 265681 Fix scrollback. 265719 Hide debug messages under VT_DEBUG. 265927 Update terminal sizes in any case when new vt(4) driver arrive. (Plus remove one unused newline) 266010 Remove extra newlines. No functional changes. 266495 Fix tty locking. o Correct expected values for VT_LOCKSWITCH ioctl. o Check current window for locked state. 266540 Proper fix of VT_LOCKSWITCH ioctl. 266835 Remove driver as unused. 267007 Fix case when vt(4) started w/o driver assigned. o Always init locks and cv ASAP. o Initialize driver-independent parts even if driver probing fail. o Allow to call vt_upgrade anytime, for later loaded drivers. o New window flag VWF_READY, to track if window already initialized. Other updates: o Pass vd as a cookie for kbd_allocate. o Do not blank window on driver replacement. Sponsored by: The FreeBSD Foundation Added: stable/10/sys/dev/vt/hw/efifb/ - copied from r262785, head/sys/dev/vt/hw/efifb/ Deleted: stable/10/sys/dev/vt/hw/xboxfb/ Modified: stable/10/sys/dev/vt/hw/efifb/efifb.c stable/10/sys/dev/vt/hw/fb/vt_early_fb.c stable/10/sys/dev/vt/hw/fb/vt_fb.c stable/10/sys/dev/vt/hw/fb/vt_fb.h stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c stable/10/sys/dev/vt/hw/vga/vga.c stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_buf.c stable/10/sys/dev/vt/vt_consolectl.c stable/10/sys/dev/vt/vt_core.c stable/10/sys/dev/vt/vt_sysmouse.c Modified: stable/10/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Wed Mar 5 14:37:45 2014 (r262785) +++ stable/10/sys/dev/vt/hw/efifb/efifb.c Mon Jun 16 11:26:30 2014 (r267538) @@ -52,42 +52,64 @@ __FBSDID("$FreeBSD$"); #include #include -static vd_init_t vt_efb_init; +static vd_init_t vt_efifb_init; +static vd_probe_t vt_efifb_probe; -static struct vt_driver vt_efb_driver = { - .vd_init = vt_efb_init, +static struct vt_driver vt_efifb_driver = { + .vd_name = "efifb", + .vd_probe = vt_efifb_probe, + .vd_init = vt_efifb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, + .vd_maskbitbltchr = vt_fb_maskbitbltchr, /* Better than VGA, but still generic driver. */ .vd_priority = VD_PRIORITY_GENERIC + 1, }; -static struct fb_info info; -VT_CONSDEV_DECLARE(vt_efb_driver, - MAX(80, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)), - MAX(25, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)), &info); +static struct fb_info local_info; +VT_DRIVER_DECLARE(vt_efifb, vt_efifb_driver); static int -vt_efb_init(struct vt_device *vd) +vt_efifb_probe(struct vt_device *vd) { - int depth, d, disable, i, len; - struct fb_info *info; + int disabled; struct efi_fb *efifb; caddr_t kmdp; - info = vd->vd_softc; + disabled = 0; + TUNABLE_INT_FETCH("hw.syscons.disable", &disabled); + if (disabled != 0) + return (CN_DEAD); - disable = 0; - TUNABLE_INT_FETCH("hw.syscons.disable", &disable); - if (disable != 0) + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + efifb = (struct efi_fb *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_FB); + if (efifb == NULL) return (CN_DEAD); + return (CN_INTERNAL); +} + +static int +vt_efifb_init(struct vt_device *vd) +{ + int depth, d, i, len; + struct fb_info *info; + struct efi_fb *efifb; + caddr_t kmdp; + + info = vd->vd_softc; + if (info == NULL) + info = vd->vd_softc = (void *)&local_info; + kmdp = preload_search_by_type("elf kernel"); if (kmdp == NULL) kmdp = preload_search_by_type("elf64 kernel"); efifb = (struct efi_fb *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_FB); - if (!efifb->fb_present) + if (efifb == NULL) return (CN_DEAD); info->fb_height = efifb->fb_height; @@ -137,7 +159,8 @@ vt_efb_init(struct vt_device *vd) fb_probe(info); vt_fb_init(vd); + /* Clear the screen. */ + vt_fb_blank(vd, TC_BLACK); return (CN_INTERNAL); } - Modified: stable/10/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_early_fb.c Mon Jun 16 11:00:14 2014 (r267537) +++ stable/10/sys/dev/vt/hw/fb/vt_early_fb.c Mon Jun 16 11:26:30 2014 (r267538) @@ -52,18 +52,19 @@ __FBSDID("$FreeBSD$"); #include static vd_init_t vt_efb_init; +static vd_probe_t vt_efb_probe; static struct vt_driver vt_fb_early_driver = { + .vd_name = "efb", + .vd_probe = vt_efb_probe, .vd_init = vt_efb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, .vd_priority = VD_PRIORITY_GENERIC, }; -static struct fb_info info; -VT_CONSDEV_DECLARE(vt_fb_early_driver, - MAX(80, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)), - MAX(25, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)), &info); +static struct fb_info local_info; +VT_DRIVER_DECLARE(vt_efb, vt_fb_early_driver); static void #ifdef FDT @@ -126,30 +127,62 @@ vt_efb_initialize(struct fb_info *info) } } -static int -vt_efb_init(struct vt_device *vd) +static phandle_t +vt_efb_get_fbnode() { - struct ofw_pci_register pciaddrs[8]; - struct fb_info *info; - int i, len, n_pciaddrs; phandle_t chosen, node; ihandle_t stdout; char type[64]; - info = vd->vd_softc; - chosen = OF_finddevice("/chosen"); OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); node = OF_instance_to_package(stdout); - if (node == -1) { - /* - * The "/chosen/stdout" does not exist try - * using "screen" directly. - */ - node = OF_finddevice("screen"); + if (node != -1) { + /* The "/chosen/stdout" present. */ + OF_getprop(node, "device_type", type, sizeof(type)); + /* Check if it has "display" type. */ + if (strcmp(type, "display") == 0) + return (node); } - OF_getprop(node, "device_type", type, sizeof(type)); - if (strcmp(type, "display") != 0) + /* Try device with name "screen". */ + node = OF_finddevice("screen"); + + return (node); +} + +static int +vt_efb_probe(struct vt_device *vd) +{ + phandle_t node; + + node = vt_efb_get_fbnode(); + if (node == -1) + return (CN_DEAD); + + if ((OF_getproplen(node, "height") <= 0) || + (OF_getproplen(node, "width") <= 0) || + (OF_getproplen(node, "depth") <= 0) || + (OF_getproplen(node, "linebytes") <= 0)) + return (CN_DEAD); + + return (CN_INTERNAL); +} + +static int +vt_efb_init(struct vt_device *vd) +{ + struct ofw_pci_register pciaddrs[8]; + struct fb_info *info; + int i, len, n_pciaddrs; + phandle_t node; + + if (vd->vd_softc == NULL) + vd->vd_softc = (void *)&local_info; + + info = vd->vd_softc; + + node = vt_efb_get_fbnode(); + if (node == -1) return (CN_DEAD); #define GET(name, var) \ @@ -249,7 +282,6 @@ vt_efb_init(struct vt_device *vd) #endif } - /* blank full size */ len = info->fb_size / 4; for (i = 0; i < len; i++) { @@ -259,13 +291,6 @@ vt_efb_init(struct vt_device *vd) /* Get pixel storage size. */ info->fb_bpp = info->fb_stride / info->fb_width * 8; - /* - * Early FB driver work with static window buffer 80x25, so reduce - * size to 640x480. - */ - info->fb_width = VT_FB_DEFAULT_WIDTH; - info->fb_height = VT_FB_DEFAULT_HEIGHT; - #ifdef FDT vt_efb_initialize(info, node); #else @@ -274,6 +299,5 @@ vt_efb_init(struct vt_device *vd) fb_probe(info); vt_fb_init(vd); - return (CN_INTERNAL); } Modified: stable/10/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_fb.c Mon Jun 16 11:00:14 2014 (r267537) +++ stable/10/sys/dev/vt/hw/fb/vt_fb.c Mon Jun 16 11:26:30 2014 (r267538) @@ -50,9 +50,11 @@ void vt_fb_drawrect(struct vt_device *vd void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color); static struct vt_driver vt_fb_driver = { + .vd_name = "fb", .vd_init = vt_fb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, + .vd_maskbitbltchr = vt_fb_maskbitbltchr, .vd_drawrect = vt_fb_drawrect, .vd_setpixel = vt_fb_setpixel, .vd_postswitch = vt_fb_postswitch, @@ -61,6 +63,8 @@ static struct vt_driver vt_fb_driver = { .vd_fb_mmap = vt_fb_mmap, }; +VT_DRIVER_DECLARE(vt_fb, vt_fb_driver); + static int vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, struct thread *td) { @@ -189,6 +193,68 @@ vt_fb_bitbltchr(struct vt_device *vd, co uint32_t fgc, bgc, cc, o; int c, l, bpp; u_long line; + uint8_t b; + const uint8_t *ch; + + info = vd->vd_softc; + bpp = FBTYPE_GET_BYTESPP(info); + fgc = info->fb_cmap[fg]; + bgc = info->fb_cmap[bg]; + b = 0; + if (bpl == 0) + bpl = (width + 7) >> 3; /* Bytes per sorce line. */ + + /* Don't try to put off screen pixels */ + if (((left + width) > info->fb_width) || ((top + height) > + info->fb_height)) + return; + + line = (info->fb_stride * top) + (left * bpp); + for (l = 0; l < height; l++) { + ch = src; + for (c = 0; c < width; c++) { + if (c % 8 == 0) + b = *ch++; + else + b <<= 1; + o = line + (c * bpp); + cc = b & 0x80 ? fgc : bgc; + + switch(bpp) { + case 1: + info->wr1(info, o, cc); + break; + case 2: + info->wr2(info, o, cc); + break; + case 3: + /* Packed mode, so unaligned. Byte access. */ + info->wr1(info, o, (cc >> 16) & 0xff); + info->wr1(info, o + 1, (cc >> 8) & 0xff); + info->wr1(info, o + 2, cc & 0xff); + break; + case 4: + info->wr4(info, o, cc); + break; + default: + /* panic? */ + break; + } + } + line += info->fb_stride; + src += bpl; + } +} + +void +vt_fb_maskbitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, + int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, + unsigned int height, term_color_t fg, term_color_t bg) +{ + struct fb_info *info; + uint32_t fgc, bgc, cc, o; + int c, l, bpp; + u_long line; uint8_t b, m; const uint8_t *ch; Modified: stable/10/sys/dev/vt/hw/fb/vt_fb.h ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_fb.h Mon Jun 16 11:00:14 2014 (r267537) +++ stable/10/sys/dev/vt/hw/fb/vt_fb.h Mon Jun 16 11:26:30 2014 (r267538) @@ -41,7 +41,7 @@ int fb_probe(struct fb_info *info); vd_init_t vt_fb_init; vd_blank_t vt_fb_blank; vd_bitbltchr_t vt_fb_bitbltchr; +vd_maskbitbltchr_t vt_fb_maskbitbltchr; vd_postswitch_t vt_fb_postswitch; - #endif /* _DEV_VT_HW_FB_VT_FB_H_ */ Modified: stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c Mon Jun 16 11:00:14 2014 (r267537) +++ stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c Mon Jun 16 11:26:30 2014 (r267538) @@ -49,6 +49,10 @@ __FBSDID("$FreeBSD$"); struct ofwfb_softc { phandle_t sc_node; + struct ofw_pci_register sc_pciaddrs[8]; + int sc_num_pciaddrs; + + intptr_t sc_addr; int sc_depth; int sc_stride; @@ -58,21 +62,50 @@ struct ofwfb_softc { uint32_t sc_colormap[16]; }; +static vd_probe_t ofwfb_probe; static vd_init_t ofwfb_init; static vd_blank_t ofwfb_blank; static vd_bitbltchr_t ofwfb_bitbltchr; +static vd_fb_mmap_t ofwfb_mmap; static const struct vt_driver vt_ofwfb_driver = { + .vd_name = "ofwfb", + .vd_probe = ofwfb_probe, .vd_init = ofwfb_init, .vd_blank = ofwfb_blank, .vd_bitbltchr = ofwfb_bitbltchr, + .vd_maskbitbltchr = ofwfb_bitbltchr, + .vd_fb_mmap = ofwfb_mmap, .vd_priority = VD_PRIORITY_GENERIC+1, }; static struct ofwfb_softc ofwfb_conssoftc; -VT_CONSDEV_DECLARE(vt_ofwfb_driver, PIXEL_WIDTH(1920), PIXEL_HEIGHT(1200), - &ofwfb_conssoftc); -/* XXX: hardcoded max size */ +VT_DRIVER_DECLARE(vt_ofwfb, vt_ofwfb_driver); + +static int +ofwfb_probe(struct vt_device *vd) +{ + phandle_t chosen, node; + ihandle_t stdout; + char type[64]; + + chosen = OF_finddevice("/chosen"); + OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); + node = OF_instance_to_package(stdout); + if (node == -1) { + /* + * The "/chosen/stdout" does not exist try + * using "screen" directly. + */ + node = OF_finddevice("screen"); + } + OF_getprop(node, "device_type", type, sizeof(type)); + if (strcmp(type, "display") != 0) + return (CN_DEAD); + + /* Looks OK... */ + return (CN_INTERNAL); +} static void ofwfb_blank(struct vt_device *vd, term_color_t color) @@ -109,6 +142,10 @@ ofwfb_bitbltchr(struct vt_device *vd, co uint32_t fgc, bgc; int c; uint8_t b, m; + union { + uint32_t l; + uint8_t c[4]; + } ch1, ch2; fgc = sc->sc_colormap[fg]; bgc = sc->sc_colormap[bg]; @@ -120,36 +157,70 @@ ofwfb_bitbltchr(struct vt_device *vd, co return; line = (sc->sc_stride * top) + left * sc->sc_depth/8; - for (; height > 0; height--) { - for (c = 0; c < width; c++) { - if (c % 8 == 0) + if (mask == NULL && sc->sc_depth == 8 && (width % 8 == 0)) { + for (; height > 0; height--) { + for (c = 0; c < width; c += 8) { b = *src++; - else - b <<= 1; - if (mask != NULL) { + + /* + * Assume that there is more background than + * foreground in characters and init accordingly + */ + ch1.l = ch2.l = (bg << 24) | (bg << 16) | + (bg << 8) | bg; + + /* + * Calculate 2 x 4-chars at a time, and then + * write these out. + */ + if (b & 0x80) ch1.c[0] = fg; + if (b & 0x40) ch1.c[1] = fg; + if (b & 0x20) ch1.c[2] = fg; + if (b & 0x10) ch1.c[3] = fg; + + if (b & 0x08) ch2.c[0] = fg; + if (b & 0x04) ch2.c[1] = fg; + if (b & 0x02) ch2.c[2] = fg; + if (b & 0x01) ch2.c[3] = fg; + + *(uint32_t *)(sc->sc_addr + line + c) = ch1.l; + *(uint32_t *)(sc->sc_addr + line + c + 4) = + ch2.l; + } + line += sc->sc_stride; + } + } else { + for (; height > 0; height--) { + for (c = 0; c < width; c++) { if (c % 8 == 0) - m = *mask++; + b = *src++; else - m <<= 1; - /* Skip pixel write, if mask has no bit set. */ - if ((m & 0x80) == 0) - continue; - } - switch(sc->sc_depth) { - case 8: - *(uint8_t *)(sc->sc_addr + line + c) = - b & 0x80 ? fg : bg; - break; - case 32: - *(uint32_t *)(sc->sc_addr + line + 4*c) = - (b & 0x80) ? fgc : bgc; - break; - default: - /* panic? */ - break; + b <<= 1; + if (mask != NULL) { + if (c % 8 == 0) + m = *mask++; + else + m <<= 1; + /* Skip pixel write, if mask not set. */ + if ((m & 0x80) == 0) + continue; + } + switch(sc->sc_depth) { + case 8: + *(uint8_t *)(sc->sc_addr + line + c) = + b & 0x80 ? fg : bg; + break; + case 32: + *(uint32_t *)(sc->sc_addr + line + 4*c) + = (b & 0x80) ? fgc : bgc; + break; + default: + /* panic? */ + break; + } } + line += sc->sc_stride; } - line += sc->sc_stride; } } @@ -217,14 +288,12 @@ ofwfb_initialize(struct vt_device *vd) static int ofwfb_init(struct vt_device *vd) { - struct ofwfb_softc *sc = vd->vd_softc; + struct ofwfb_softc *sc; char type[64]; phandle_t chosen; ihandle_t stdout; phandle_t node; uint32_t depth, height, width; - struct ofw_pci_register pciaddrs[8]; - int n_pciaddrs; uint32_t fb_phys; int i, len; #ifdef __sparc64__ @@ -233,6 +302,9 @@ ofwfb_init(struct vt_device *vd) int space; #endif + /* Initialize softc */ + vd->vd_softc = sc = &ofwfb_conssoftc; + chosen = OF_finddevice("/chosen"); OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); node = OF_instance_to_package(stdout); @@ -275,15 +347,15 @@ ofwfb_init(struct vt_device *vd) * child of the PCI device: in that case, try the parent for * the assigned-addresses property. */ - len = OF_getprop(node, "assigned-addresses", pciaddrs, - sizeof(pciaddrs)); + len = OF_getprop(node, "assigned-addresses", sc->sc_pciaddrs, + sizeof(sc->sc_pciaddrs)); if (len == -1) { len = OF_getprop(OF_parent(node), "assigned-addresses", - pciaddrs, sizeof(pciaddrs)); + sc->sc_pciaddrs, sizeof(sc->sc_pciaddrs)); } if (len == -1) len = 0; - n_pciaddrs = len / sizeof(struct ofw_pci_register); + sc->sc_num_pciaddrs = len / sizeof(struct ofw_pci_register); /* * Grab the physical address of the framebuffer, and then map it @@ -313,13 +385,13 @@ ofwfb_init(struct vt_device *vd) * Linux does the same thing. */ - fb_phys = n_pciaddrs; - for (i = 0; i < n_pciaddrs; i++) { + fb_phys = sc->sc_num_pciaddrs; + for (i = 0; i < sc->sc_num_pciaddrs; i++) { /* If it is too small, not the framebuffer */ - if (pciaddrs[i].size_lo < sc->sc_stride*height) + if (sc->sc_pciaddrs[i].size_lo < sc->sc_stride*height) continue; /* If it is not memory, it isn't either */ - if (!(pciaddrs[i].phys_hi & + if (!(sc->sc_pciaddrs[i].phys_hi & OFW_PCI_PHYS_HI_SPACE_MEM32)) continue; @@ -327,11 +399,12 @@ ofwfb_init(struct vt_device *vd) fb_phys = i; /* If it is prefetchable, it certainly is */ - if (pciaddrs[i].phys_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) + if (sc->sc_pciaddrs[i].phys_hi & + OFW_PCI_PHYS_HI_PREFETCHABLE) break; } - if (fb_phys == n_pciaddrs) /* No candidates found */ + if (fb_phys == sc->sc_num_pciaddrs) /* No candidates found */ return (CN_DEAD); #if defined(__powerpc__) @@ -348,3 +421,37 @@ ofwfb_init(struct vt_device *vd) return (CN_INTERNAL); } +static int +ofwfb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) +{ + struct ofwfb_softc *sc = vd->vd_softc; + int i; + + /* + * Make sure the requested address lies within the PCI device's + * assigned addrs + */ + for (i = 0; i < sc->sc_num_pciaddrs; i++) + if (offset >= sc->sc_pciaddrs[i].phys_lo && + offset < (sc->sc_pciaddrs[i].phys_lo + sc->sc_pciaddrs[i].size_lo)) + { + /* + * If this is a prefetchable BAR, we can (and should) + * enable write-combining. + */ + if (sc->sc_pciaddrs[i].phys_hi & + OFW_PCI_PHYS_HI_PREFETCHABLE) + *memattr = VM_MEMATTR_WRITE_COMBINING; + + *paddr = offset; + return (0); + } + + /* + * Hack for Radeon... + */ + *paddr = offset; + return (0); +} + Modified: stable/10/sys/dev/vt/hw/vga/vga.c ============================================================================== --- stable/10/sys/dev/vt/hw/vga/vga.c Mon Jun 16 11:00:14 2014 (r267537) +++ stable/10/sys/dev/vt/hw/vga/vga.c Mon Jun 16 11:26:30 2014 (r267538) @@ -71,6 +71,7 @@ struct vga_softc { #define VT_VGA_HEIGHT 480 #define VT_VGA_MEMSIZE (VT_VGA_WIDTH * VT_VGA_HEIGHT / 8) +static vd_probe_t vga_probe; static vd_init_t vga_init; static vd_blank_t vga_blank; static vd_bitbltchr_t vga_bitbltchr; @@ -81,6 +82,8 @@ static vd_putchar_t vga_putchar; static vd_postswitch_t vga_postswitch; static const struct vt_driver vt_vga_driver = { + .vd_name = "vga", + .vd_probe = vga_probe, .vd_init = vga_init, .vd_blank = vga_blank, .vd_bitbltchr = vga_bitbltchr, @@ -97,8 +100,7 @@ static const struct vt_driver vt_vga_dri * buffer is always big enough to support both. */ static struct vga_softc vga_conssoftc; -VT_CONSDEV_DECLARE(vt_vga_driver, MAX(80, PIXEL_WIDTH(VT_VGA_WIDTH)), - MAX(25, PIXEL_HEIGHT(VT_VGA_HEIGHT)), &vga_conssoftc); +VT_DRIVER_DECLARE(vt_vga, vt_vga_driver); static inline void vga_setcolor(struct vt_device *vd, term_color_t color) @@ -349,7 +351,8 @@ static const struct unicp437 cp437table[ { 0x263a, 0x01, 0x01 }, { 0x263c, 0x0f, 0x00 }, { 0x2640, 0x0c, 0x00 }, { 0x2642, 0x0b, 0x00 }, { 0x2660, 0x06, 0x00 }, { 0x2663, 0x05, 0x00 }, - { 0x2665, 0x03, 0x01 }, { 0x266a, 0x0d, 0x01 }, + { 0x2665, 0x03, 0x01 }, { 0x266a, 0x0d, 0x00 }, + { 0x266c, 0x0e, 0x00 }, }; static uint8_t @@ -631,10 +634,22 @@ vga_initialize(struct vt_device *vd, int } static int +vga_probe(struct vt_device *vd) +{ + + return (CN_INTERNAL); +} + +static int vga_init(struct vt_device *vd) { - struct vga_softc *sc = vd->vd_softc; - int textmode = 0; + struct vga_softc *sc; + int textmode; + + if (vd->vd_softc == NULL) + vd->vd_softc = (void *)&vga_conssoftc; + sc = vd->vd_softc; + textmode = 0; #if defined(__amd64__) || defined(__i386__) sc->vga_fb_tag = X86_BUS_SPACE_MEM; Modified: stable/10/sys/dev/vt/vt.h ============================================================================== --- stable/10/sys/dev/vt/vt.h Mon Jun 16 11:00:14 2014 (r267537) +++ stable/10/sys/dev/vt/vt.h Mon Jun 16 11:26:30 2014 (r267538) @@ -78,7 +78,13 @@ one 'device sc' or 'device vt'" #endif /* defined(SC_TWOBUTTON_MOUSE) || defined(VT_TWOBUTTON_MOUSE) */ #define SC_DRIVER_NAME "vt" +#ifdef VT_DEBUG #define DPRINTF(_l, ...) if (vt_debug > (_l)) printf( __VA_ARGS__ ) +#define VT_CONSOLECTL_DEBUG +#define VT_SYSMOUSE_DEBUG +#else +#define DPRINTF(_l, ...) do {} while (0) +#endif #define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG) #define VT_SYSCTL_INT(_name, _default, _descr) \ @@ -253,6 +259,7 @@ struct vt_window { #define VWF_CONSOLE 0x8 /* Kernel message console window. */ #define VWF_VTYLOCK 0x10 /* Prevent window switch. */ #define VWF_MOUSE_HIDE 0x20 /* Disable mouse events processing. */ +#define VWF_READY 0x40 /* Window fully initialized. */ #define VWF_SWWAIT_REL 0x10000 /* Program wait for VT acquire is done. */ #define VWF_SWWAIT_ACQ 0x20000 /* Program wait for VT release is done. */ pid_t vw_pid; /* Terminal holding process */ @@ -277,6 +284,7 @@ struct vt_window { */ typedef int vd_init_t(struct vt_device *vd); +typedef int vd_probe_t(struct vt_device *vd); typedef void vd_postswitch_t(struct vt_device *vd); typedef void vd_blank_t(struct vt_device *vd, term_color_t color); typedef void vd_bitbltchr_t(struct vt_device *vd, const uint8_t *src, @@ -295,7 +303,9 @@ typedef void vd_drawrect_t(struct vt_dev typedef void vd_setpixel_t(struct vt_device *, int, int, term_color_t); struct vt_driver { + char vd_name[16]; /* Console attachment. */ + vd_probe_t *vd_probe; vd_init_t *vd_init; /* Drawing. */ @@ -337,10 +347,10 @@ void vt_upgrade(struct vt_device *vd); #define PIXEL_HEIGHT(h) ((h) / 16) #ifndef VT_FB_DEFAULT_WIDTH -#define VT_FB_DEFAULT_WIDTH 640 +#define VT_FB_DEFAULT_WIDTH 2048 #endif #ifndef VT_FB_DEFAULT_HEIGHT -#define VT_FB_DEFAULT_HEIGHT 480 +#define VT_FB_DEFAULT_HEIGHT 1200 #endif #define VT_CONSDEV_DECLARE(driver, width, height, softc) \ @@ -391,6 +401,9 @@ TERMINAL_DECLARE_EARLY(driver ## _conste SYSINIT(vt_early_cons, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, \ vt_upgrade, &driver ## _consdev) +/* name argument is not used yet. */ +#define VT_DRIVER_DECLARE(name, drv) DATA_SET(vt_drv_set, drv) + /* * Fonts. * Modified: stable/10/sys/dev/vt/vt_buf.c ============================================================================== --- stable/10/sys/dev/vt/vt_buf.c Mon Jun 16 11:00:14 2014 (r267537) +++ stable/10/sys/dev/vt/vt_buf.c Mon Jun 16 11:26:30 2014 (r267538) @@ -357,17 +357,17 @@ void vtbuf_fill_locked(struct vt_buf *vb, const term_rect_t *r, term_char_t c) { KASSERT(r->tr_begin.tp_row < vb->vb_scr_size.tp_row, - ("vtbuf_fill_locked begin.tp_row %d must be < screen width %d", + ("vtbuf_fill_locked begin.tp_row %d must be < screen height %d", r->tr_begin.tp_row, vb->vb_scr_size.tp_row)); KASSERT(r->tr_begin.tp_col < vb->vb_scr_size.tp_col, - ("vtbuf_fill_locked begin.tp_col %d must be < screen height %d", + ("vtbuf_fill_locked begin.tp_col %d must be < screen width %d", r->tr_begin.tp_col, vb->vb_scr_size.tp_col)); KASSERT(r->tr_end.tp_row <= vb->vb_scr_size.tp_row, - ("vtbuf_fill_locked end.tp_row %d must be <= screen width %d", + ("vtbuf_fill_locked end.tp_row %d must be <= screen height %d", r->tr_end.tp_row, vb->vb_scr_size.tp_row)); KASSERT(r->tr_end.tp_col <= vb->vb_scr_size.tp_col, - ("vtbuf_fill_locked end.tp_col %d must be <= screen height %d", + ("vtbuf_fill_locked end.tp_col %d must be <= screen width %d", r->tr_end.tp_col, vb->vb_scr_size.tp_col)); VTBUF_LOCK(vb); @@ -448,8 +448,9 @@ vtbuf_grow(struct vt_buf *vb, const term history_size = MAX(history_size, p->tp_row); - if (history_size > vb->vb_history_size || p->tp_col > - vb->vb_scr_size.tp_col) { + /* If new screen/history size bigger or buffer is VBF_STATIC. */ + if ((history_size > vb->vb_history_size) || (p->tp_col > + vb->vb_scr_size.tp_col) || (vb->vb_flags & VBF_STATIC)) { /* Allocate new buffer. */ bufsize = history_size * p->tp_col * sizeof(term_char_t); new = malloc(bufsize, M_VTBUF, M_WAITOK | M_ZERO); @@ -495,6 +496,9 @@ vtbuf_grow(struct vt_buf *vb, const term /* Deallocate old buffer. */ free(old, M_VTBUF); free(oldrows, M_VTBUF); + } else { + /* Just update the size. */ + vb->vb_scr_size = *p; } } Modified: stable/10/sys/dev/vt/vt_consolectl.c ============================================================================== --- stable/10/sys/dev/vt/vt_consolectl.c Mon Jun 16 11:00:14 2014 (r267537) +++ stable/10/sys/dev/vt/vt_consolectl.c Mon Jun 16 11:26:30 2014 (r267538) @@ -61,8 +61,10 @@ consolectl_ioctl(struct cdev *dev, u_lon return (0); } default: +#ifdef VT_CONSOLECTL_DEBUG printf("consolectl: unknown ioctl: %c:%lx\n", (char)IOCGROUP(cmd), IOCBASECMD(cmd)); +#endif return (ENOIOCTL); } } Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Mon Jun 16 11:00:14 2014 (r267537) +++ stable/10/sys/dev/vt/vt_core.c Mon Jun 16 11:26:30 2014 (r267538) @@ -120,9 +120,10 @@ VT_SYSCTL_INT(debug, 0, "vt(9) debug lev VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); +static struct vt_device vt_consdev; static unsigned int vt_unit = 0; static MALLOC_DEFINE(M_VT, "vt", "vt device"); -struct vt_device *main_vd = NULL; +struct vt_device *main_vd = &vt_consdev; /* Boot logo. */ extern unsigned int vt_logo_width; @@ -144,6 +145,85 @@ static int vt_window_switch(struct vt_wi static int vt_late_window_switch(struct vt_window *); static int vt_proc_alive(struct vt_window *); static void vt_resize(struct vt_device *); +static void vt_update_static(void *); + +SET_DECLARE(vt_drv_set, struct vt_driver); + +#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)) +#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)) + +static struct terminal vt_consterm; +static struct vt_window vt_conswindow; +static struct vt_device vt_consdev = { + .vd_driver = NULL, + .vd_softc = NULL, + .vd_flags = VDF_INVALID, + .vd_windows = { [VT_CONSWINDOW] = &vt_conswindow, }, + .vd_curwindow = &vt_conswindow, + .vd_markedwin = NULL, + .vd_kbstate = 0, +}; +static term_char_t vt_constextbuf[(_VTDEFW) * (VBF_DEFAULT_HISTORY_SIZE)]; +static term_char_t *vt_constextbufrows[VBF_DEFAULT_HISTORY_SIZE]; +static struct vt_window vt_conswindow = { + .vw_number = VT_CONSWINDOW, + .vw_flags = VWF_CONSOLE, + .vw_buf = { + .vb_buffer = vt_constextbuf, + .vb_rows = vt_constextbufrows, + .vb_history_size = VBF_DEFAULT_HISTORY_SIZE, + .vb_curroffset = 0, + .vb_roffset = 0, + .vb_flags = VBF_STATIC, + .vb_mark_start = {.tp_row = 0, .tp_col = 0,}, + .vb_mark_end = {.tp_row = 0, .tp_col = 0,}, + .vb_scr_size = { + .tp_row = _VTDEFH, + .tp_col = _VTDEFW, + }, + }, + .vw_device = &vt_consdev, + .vw_terminal = &vt_consterm, + .vw_kbdmode = K_XLATE, +}; +static struct terminal vt_consterm = { + .tm_class = &vt_termclass, + .tm_softc = &vt_conswindow, + .tm_flags = TF_CONS, +}; +static struct consdev vt_consterm_consdev = { + .cn_ops = &termcn_cnops, + .cn_arg = &vt_consterm, + .cn_name = "ttyv0", +}; + +/* Add to set of consoles. */ +DATA_SET(cons_set, vt_consterm_consdev); + +/* + * Right after kmem is done to allow early drivers to use locking and allocate + * memory. + */ +SYSINIT(vt_update_static, SI_SUB_KMEM, SI_ORDER_ANY, vt_update_static, + &vt_consdev); +/* Delay until all devices attached, to not waste time. */ +SYSINIT(vt_early_cons, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade, + &vt_consdev); + +/* Initialize locks/mem depended members. */ +static void +vt_update_static(void *dummy) +{ + + if (main_vd->vd_driver != NULL) + printf("VT: running with driver \"%s\".\n", + main_vd->vd_driver->vd_name); + else + printf("VT: init without driver.\n"); + + mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); + cv_init(&main_vd->vd_winswitch, "vtwswt"); +} static void vt_switch_timer(void *arg) @@ -203,12 +283,12 @@ vt_proc_window_switch(struct vt_window * struct vt_device *vd; int ret; - if (vw->vw_flags & VWF_VTYLOCK) - return (EBUSY); - vd = vw->vw_device; curvw = vd->vd_curwindow; + if (curvw->vw_flags & VWF_VTYLOCK) + return (EBUSY); + /* Ask current process permitions to switch away. */ if (curvw->vw_smode.mode == VT_PROCESS) { DPRINTF(30, "%s: VT_PROCESS ", __func__); @@ -556,11 +636,9 @@ vt_allocate_keyboard(struct vt_device *v keyboard_t *k0, *k; keyboard_info_t ki; - idx0 = kbd_allocate("kbdmux", -1, (void *)&vd->vd_keyboard, - vt_kbdevent, vd); - /* XXX: kb_token lost */ + idx0 = kbd_allocate("kbdmux", -1, vd, vt_kbdevent, vd); vd->vd_keyboard = idx0; - if (idx0 != -1) { + if (idx0 >= 0) { DPRINTF(20, "%s: kbdmux allocated, idx = %d\n", __func__, idx0); k0 = kbd_get_keyboard(idx0); @@ -580,8 +658,11 @@ vt_allocate_keyboard(struct vt_device *v } } else { DPRINTF(20, "%s: no kbdmux allocated\n", __func__); - idx0 = kbd_allocate("*", -1, (void *)&vd->vd_keyboard, - vt_kbdevent, vd); + idx0 = kbd_allocate("*", -1, vd, vt_kbdevent, vd); + if (idx0 < 0) { + DPRINTF(10, "%s: No keyboard found.\n", __func__); + return (-1); + } } DPRINTF(20, "%s: vd_keyboard = %d\n", __func__, vd->vd_keyboard); @@ -601,6 +682,22 @@ vtterm_bell(struct terminal *tm) } static void +vtterm_beep(struct terminal *tm, u_int param) +{ + u_int freq, period; + + if ((param == 0) || ((param & 0xffff) == 0)) { + vtterm_bell(tm); + return; + } + + period = ((param >> 16) & 0xffff) * hz / 1000; + freq = 1193182 / (param & 0xffff); + + sysbeep(freq, period); +} + +static void vtterm_cursor(struct terminal *tm, const term_pos_t *p) { struct vt_window *vw = tm->tm_softc; @@ -775,7 +872,7 @@ vt_flush(struct vt_device *vd) if ((vd->vd_flags & (VDF_MOUSECURSOR|VDF_TEXTMODE)) == VDF_MOUSECURSOR) { m = &vt_default_mouse_pointer; - bpl = (m->w + 7) >> 3; /* Bytes per sorce line. */ + bpl = (m->w + 7) >> 3; /* Bytes per source line. */ w = m->w; h = m->h; @@ -851,9 +948,11 @@ vtterm_splash(struct vt_device *vd) } #endif + static void vtterm_cnprobe(struct terminal *tm, struct consdev *cp) { + struct vt_driver *vtd, **vtdlist, *vtdbest = NULL; struct vt_window *vw = tm->tm_softc; struct vt_device *vd = vw->vw_device; struct winsize wsz; @@ -862,10 +961,27 @@ vtterm_cnprobe(struct terminal *tm, stru /* Initialization already done. */ return; - cp->cn_pri = vd->vd_driver->vd_init(vd); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 16 11:42:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DB859646; Mon, 16 Jun 2014 11:42: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 AE4D72754; Mon, 16 Jun 2014 11:42: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 s5GBgJsu056890; Mon, 16 Jun 2014 11:42:19 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GBgJGs056889; Mon, 16 Jun 2014 11:42:19 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201406161142.s5GBgJGs056889@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 16 Jun 2014 11:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267539 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2014 11:42:20 -0000 Author: ray Date: Mon Jun 16 11:42:19 2014 New Revision: 267539 URL: http://svnweb.freebsd.org/changeset/base/267539 Log: Record merginfo for r267538. Pointy hat to: ray Sponsored by: The FreeBSD Foundation Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 16 11:51:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 83452B70; Mon, 16 Jun 2014 11:51: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 6351E27B3; Mon, 16 Jun 2014 11:51: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 s5GBp1IU059457; Mon, 16 Jun 2014 11:51:01 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GBp02s059446; Mon, 16 Jun 2014 11:51:00 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201406161151.s5GBp02s059446@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 16 Jun 2014 11:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267540 - in stable/10/usr.sbin: kbdcontrol vidcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2014 11:51:01 -0000 Author: ray Date: Mon Jun 16 11:51:00 2014 New Revision: 267540 URL: http://svnweb.freebsd.org/changeset/base/267540 Log: MFC: 266836, 266839 vt(4) support for vidcontrol(1). o Teach vidcontrol(1) how to load vt(4) font. o Teach vidcontrol(1) to distinct which virtual terminal system is running now. o Load vt(4) fonts from different location. o Add $FreeBSD$ tag for path.h. vt(4) support for kbdcontrol(1). Enable kbdcontrol(1) to use maps from vt(4) keymaps dir /usr/share/vt/keymaps if vt(4) is present. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/kbdcontrol/kbdcontrol.c stable/10/usr.sbin/kbdcontrol/path.h stable/10/usr.sbin/vidcontrol/path.h stable/10/usr.sbin/vidcontrol/vidcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/kbdcontrol/kbdcontrol.c ============================================================================== --- stable/10/usr.sbin/kbdcontrol/kbdcontrol.c Mon Jun 16 11:42:19 2014 (r267539) +++ stable/10/usr.sbin/kbdcontrol/kbdcontrol.c Mon Jun 16 11:51:00 2014 (r267540) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "path.h" #include "lex.h" @@ -141,6 +142,17 @@ static void set_keyrates(char *opt); static void show_kbd_info(void); static void usage(void) __dead2; +/* Detect presence of vt(4). */ +static int +is_vt4(void) +{ + + if (sysctlbyname("kern.vt.deadtimer", NULL, NULL, NULL, 0) == 0) + return (1); + + return (0); +} + static char * nextarg(int ac, char **av, int *indp, int oc) { @@ -785,10 +797,13 @@ load_keymap(char *opt, int dumponly) FILE *fd; int i, j; char *name, *cp; - char blank[] = "", keymap_path[] = KEYMAP_PATH, dotkbd[] = ".kbd"; + char blank[] = "", keymap_path[] = KEYMAP_PATH; + char vt_keymap_path[] = VT_KEYMAP_PATH, dotkbd[] = ".kbd"; char *prefix[] = {blank, blank, keymap_path, NULL}; char *postfix[] = {blank, dotkbd, NULL}; + if (is_vt4()) + prefix[2] = vt_keymap_path; cp = getenv("KEYMAP_PATH"); if (cp != NULL) asprintf(&(prefix[0]), "%s/", cp); Modified: stable/10/usr.sbin/kbdcontrol/path.h ============================================================================== --- stable/10/usr.sbin/kbdcontrol/path.h Mon Jun 16 11:42:19 2014 (r267539) +++ stable/10/usr.sbin/kbdcontrol/path.h Mon Jun 16 11:51:00 2014 (r267540) @@ -1,4 +1,8 @@ +/* $FreeBSD$ */ + #define KEYMAP_PATH "/usr/share/syscons/keymaps/" #define FONT_PATH "/usr/share/syscons/fonts/" #define SCRNMAP_PATH "/usr/share/syscons/scrnmaps/" +#define VT_KEYMAP_PATH "/usr/share/vt/keymaps/" +#define VT_FONT_PATH "/usr/share/vt/fonts/" Modified: stable/10/usr.sbin/vidcontrol/path.h ============================================================================== --- stable/10/usr.sbin/vidcontrol/path.h Mon Jun 16 11:42:19 2014 (r267539) +++ stable/10/usr.sbin/vidcontrol/path.h Mon Jun 16 11:51:00 2014 (r267540) @@ -1,4 +1,8 @@ +/* $FreeBSD$ */ + #define KEYMAP_PATH "/usr/share/syscons/keymaps/" #define FONT_PATH "/usr/share/syscons/fonts/" #define SCRNMAP_PATH "/usr/share/syscons/scrnmaps/" +#define VT_KEYMAP_PATH "/usr/share/vt/keymaps/" +#define VT_FONT_PATH "/usr/share/vt/fonts/" Modified: stable/10/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- stable/10/usr.sbin/vidcontrol/vidcontrol.c Mon Jun 16 11:42:19 2014 (r267539) +++ stable/10/usr.sbin/vidcontrol/vidcontrol.c Mon Jun 16 11:51:00 2014 (r267540) @@ -45,9 +45,12 @@ static const char rcsid[] = #include #include #include +#include #include +#include #include #include +#include #include "path.h" #include "decode.h" @@ -78,6 +81,15 @@ static struct { struct video_info video_mode_info; } cur_info; +struct vt4font_header { + uint8_t magic[8]; + uint8_t width; + uint8_t height; + uint16_t pad; + uint32_t glyph_count; + uint32_t map_count[4]; +} __packed; + static int hex = 0; static int vesa_cols; static int vesa_rows; @@ -86,6 +98,7 @@ static int colors_changed; static int video_mode_changed; static int normal_fore_color, normal_back_color; static int revers_fore_color, revers_back_color; +static int vt4_mode = 0; static struct vid_info info; static struct video_info new_mode_info; @@ -115,7 +128,9 @@ init(void) if (ioctl(0, CONS_GETINFO, &cur_info.console_info) == -1) errc(1, errno, "getting console information"); - if (ioctl(0, GIO_SCRNMAP, &cur_info.screen_map) == -1) + /* vt(4) use unicode, so no screen mapping required. */ + if (vt4_mode == 0 && + ioctl(0, GIO_SCRNMAP, &cur_info.screen_map) == -1) errc(1, errno, "getting screen map"); if (ioctl(0, CONS_GET, &cur_info.video_mode_number) == -1) @@ -153,7 +168,8 @@ revert(void) fprintf(stderr, "\033[=%dH", cur_info.console_info.mv_rev.fore); fprintf(stderr, "\033[=%dI", cur_info.console_info.mv_rev.back); - ioctl(0, PIO_SCRNMAP, &cur_info.screen_map); + if (vt4_mode == 0) + ioctl(0, PIO_SCRNMAP, &cur_info.screen_map); if (cur_info.video_mode_number >= M_VESA_BASE) ioctl(0, _IO('V', cur_info.video_mode_number - M_VESA_BASE), @@ -179,7 +195,15 @@ revert(void) static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", + if (vt4_mode) + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", +"usage: vidcontrol [-CHPpx] [-b color] [-c appearance] [-f [size] file]", +" [-g geometry] [-h size] [-i adapter | mode]", +" [-M char] [-m on | off] [-r foreground background]", +" [-S on | off] [-s number] [-T xterm | cons25] [-t N | off]", +" [mode] [foreground [background]] [show]"); + else + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", "usage: vidcontrol [-CdHLPpx] [-b color] [-c appearance] [-f [size] file]", " [-g geometry] [-h size] [-i adapter | mode] [-l screen_map]", " [-M char] [-m on | off] [-r foreground background]", @@ -188,6 +212,16 @@ usage(void) exit(1); } +/* Detect presence of vt(4). */ +static int +is_vt4(void) +{ + + if (sysctlbyname("kern.vt.deadtimer", NULL, NULL, NULL, 0) == 0) + return (1); + + return (0); +} /* * Retrieve the next argument from the command line (for options that require @@ -349,6 +383,72 @@ fsize(FILE *file) return -1; } +static vfnt_map_t * +load_vt4mappingtable(unsigned int nmappings, FILE *f) +{ + vfnt_map_t *t; + unsigned int i; + + if (nmappings == 0) + return (NULL); + + t = malloc(sizeof *t * nmappings); + + if (fread(t, sizeof *t * nmappings, 1, f) != 1) { + perror("mappings"); + exit(1); + } + + for (i = 0; i < nmappings; i++) { + t[i].src = be32toh(t[i].src); + t[i].dst = be16toh(t[i].dst); + t[i].len = be16toh(t[i].len); + } + + return (t); +} + +static int +load_vt4font(FILE *f) +{ + struct vt4font_header fh; + static vfnt_t vfnt; + size_t glyphsize; + unsigned int i; + + if (fread(&fh, sizeof fh, 1, f) != 1) { + perror("file_header"); + return (1); + } + + if (memcmp(fh.magic, "VFNT0002", 8) != 0) { + fprintf(stderr, "Bad magic\n"); + return (1); + } + + for (i = 0; i < VFNT_MAPS; i++) + vfnt.map_count[i] = be32toh(fh.map_count[i]); + vfnt.glyph_count = be32toh(fh.glyph_count); + vfnt.width = fh.width; + vfnt.height = fh.height; + + glyphsize = howmany(vfnt.width, 8) * vfnt.height * vfnt.glyph_count; + vfnt.glyphs = malloc(glyphsize); + + if (fread(vfnt.glyphs, glyphsize, 1, f) != 1) { + perror("glyphs"); + return (1); + } + + for (i = 0; i < VFNT_MAPS; i++) + vfnt.map[i] = load_vt4mappingtable(vfnt.map_count[i], f); + + if (ioctl(STDIN_FILENO, PIO_VFONT, &vfnt) == -1) { + perror("PIO_VFONT"); + return (1); + } + return (0); +} /* * Load a font from file and set it. @@ -362,6 +462,7 @@ load_font(const char *type, const char * unsigned long io = 0; /* silence stupid gcc(1) in the Wall mode */ char *name, *fontmap, size_sufx[6]; const char *a[] = {"", FONT_PATH, NULL}; + const char *vt4a[] = {"", VT_FONT_PATH, NULL}; const char *b[] = {filename, NULL}; const char *c[] = {"", size_sufx, NULL}; const char *d[] = {"", ".fnt", NULL}; @@ -376,21 +477,32 @@ load_font(const char *type, const char * {8, 8, PIO_FONT8x8}, {0, 0, 0}}; - _info.size = sizeof(_info); - if (ioctl(0, CONS_GETINFO, &_info) == -1) { - revert(); - warn("failed to obtain current video mode parameters"); - return; - } + if (vt4_mode) { + size_sufx[0] = '\0'; + } else { + _info.size = sizeof(_info); + if (ioctl(0, CONS_GETINFO, &_info) == -1) { + revert(); + warn("failed to obtain current video mode parameters"); + return; + } - snprintf(size_sufx, sizeof(size_sufx), "-8x%d", _info.font_size); - fd = openguess(a, b, c, d, &name); + snprintf(size_sufx, sizeof(size_sufx), "-8x%d", _info.font_size); + } + fd = openguess((vt4_mode == 0) ? a : vt4a, b, c, d, &name); if (fd == NULL) { revert(); errx(1, "%s: can't load font file", filename); } + if (vt4_mode) { + if(load_vt4font(fd)) + warn("failed to load font \"%s\"", filename); + fclose(fd); + return; + } + if (type != NULL) { size = 0; if (sscanf(type, "%dx%d", &w, &h) == 2) { @@ -1199,9 +1311,12 @@ int main(int argc, char **argv) { char *font, *type, *termmode; + const char *opts; int dumpmod, dumpopt, opt; int reterr; + vt4_mode = is_vt4(); + init(); info.size = sizeof(info); @@ -1211,8 +1326,12 @@ main(int argc, char **argv) dumpmod = 0; dumpopt = DUMP_FBF; termmode = NULL; - while ((opt = getopt(argc, argv, - "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1) + if (vt4_mode) + opts = "b:Cc:f:g:h:Hi:M:m:pPr:S:s:T:t:x"; + else + opts = "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x"; + + while ((opt = getopt(argc, argv, opts)) != -1) switch(opt) { case 'b': set_border_color(optarg); @@ -1224,6 +1343,8 @@ main(int argc, char **argv) set_cursor_type(optarg); break; case 'd': + if (vt4_mode) + break; print_scrnmap(); break; case 'f': @@ -1255,9 +1376,13 @@ main(int argc, char **argv) show_info(optarg); break; case 'l': + if (vt4_mode) + break; load_scrnmap(optarg); break; case 'L': + if (vt4_mode) + break; load_default_scrnmap(); break; case 'M': From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 16 12:37:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 759F0318; Mon, 16 Jun 2014 12:37: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 56E992C73; Mon, 16 Jun 2014 12:37: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 s5GCbBhO081444; Mon, 16 Jun 2014 12:37:11 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GCbALO081441; Mon, 16 Jun 2014 12:37:10 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201406161237.s5GCbALO081441@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 16 Jun 2014 12:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267541 - in stable/10/share/vt: . fonts keymaps X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2014 12:37:11 -0000 Author: ray Date: Mon Jun 16 12:37:10 2014 New Revision: 267541 URL: http://svnweb.freebsd.org/changeset/base/267541 Log: MFC: 266838 266841 267194 Add gallant vt(4) font as an example of font loading for vt(4). Add Ukranian vt(4) keymaps as an example. Sponsored by: The FreeBSD Foundation Added: stable/10/share/vt/ - copied from r266838, head/share/vt/ stable/10/share/vt/fonts/gallant.fnt.uu - copied unchanged from r266841, head/share/vt/fonts/gallant.fnt.uu stable/10/share/vt/keymaps/ - copied from r267194, head/share/vt/keymaps/ Deleted: stable/10/share/vt/fonts/gallant.fnt Modified: stable/10/share/vt/Makefile stable/10/share/vt/fonts/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/vt/Makefile ============================================================================== --- head/share/vt/Makefile Thu May 29 13:41:07 2014 (r266838) +++ stable/10/share/vt/Makefile Mon Jun 16 12:37:10 2014 (r267541) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= fonts +SUBDIR= fonts keymaps .include Modified: stable/10/share/vt/fonts/Makefile ============================================================================== --- head/share/vt/fonts/Makefile Thu May 29 13:41:07 2014 (r266838) +++ stable/10/share/vt/fonts/Makefile Mon Jun 16 12:37:10 2014 (r267541) @@ -2,8 +2,12 @@ FILES= gallant.fnt -FILESDIR= ${SHAREDIR}/vt/fonts +CLEANFILES+= ${FILES} -NO_OBJ= +.SUFFIXES: .uu +.uu: + uudecode < ${.IMPSRC} + +FILESDIR= ${SHAREDIR}/vt/fonts .include Copied: stable/10/share/vt/fonts/gallant.fnt.uu (from r266841, head/share/vt/fonts/gallant.fnt.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/vt/fonts/gallant.fnt.uu Mon Jun 16 12:37:10 2014 (r267541, copy of r266841, head/share/vt/fonts/gallant.fnt.uu) @@ -0,0 +1,192 @@ +# $FreeBSD$ +begin 644 gallant.fnt +M5D9.5#`P,#(,%@``````OP````(````````````````````````````````` +M```````````````````````````````````````````````&``8`!@`&``8` +M!@`&``8`!@`&``8```````8`!@```````````````````!F`&8`9@!F`&8`9 +M@````````````````````````````````````````````S`#,`,P!F`?\!_P +M#,`,P!F`&8!_P'_`,P!F`&8````````````````````&`!^`/\!FX&9@9@`^ +M`!^`!\`&8`9@9F!_P#^`!@```````````````````#A@1,!$P$6`.8`#``,` +M!@`,``P`&<`:(#(@,B!AP```````````````````!P`/@!C`&,`8P`^`'@`^ +M`'<`8V!AX&'`88`_X!Y@```````````````````,`!X`'@`&``8`#``8`!`` +M``````````````````````````````````````#``8`#@`,`!P`&``8`!@`& +M``8`!P`#``.``8``P```````````````````,``8`!P`#``.``8`!@`&``8` +M!@`.``P`'``8`#````````````````````````````````\`!@!F8';@&8`` +M`!F`=N!F8`8`#P`````````````````````````````````&``8`!@`&`'_@ +M?^`&``8`!@`&```````````````````````````````````````````````` +M````#``>`!X`!@`&``P`&``0``````````````````````````````!_X'_@ +M```````````````````````````````````````````````````````````, +M`!X`'@`,`````````````````````&``P`#``8`!@`,``P`&``P`#``8`!@` +M,``P`&`````````````````````'``^`$8`0P##`,,`PP##`,,`PP##`,(`8 +M@!\`#@````````````````````(`!@`.`!X`-@`&``8`!@`&``8`!@`&``8` +M!@`_P```````````````````'P`_@&'`0,``P`#``,`!@`,`!@`,`!@`,"!_ +MX'_@```````````````````/@!_`(.!`8`!@`.`'P`_``.``8`!@0&!@0#^` +M'P````````````````````&``X`#@`6`!8`)@`F`$8`1@"&`/^!_X`&``8`! +M@```````````````````#\`/P!``$``@`#^`,<``X`!@`&``8$!@8&`PP!^` +M```````````````````'``P`&``P`#``8`!G@&_`<.!@8&!@8&!P0#^`'P`` +M`````````````````!_@/^!@0`!``,``@`"``8`!``$``P`"``(`!@`$```` +M````````````````#P`1@##`,,`PP!B`#0`&``L`$8`PP##`,,`8@`\````` +M```````````````/@!'`(.!@8&!@8&!PX#]@'F``8`#``,`!@`<`/``````` +M```````````````````````````,`!X`'@`,```````,`!X`'@`,```````` +M````````````````````````````#``>`!X`#```````#``>`!X`!@`&``P` +M&``0`````````````````````&`!P`<`'@!X`'@`'@`'``'``&`````````` +M````````````````````````````?\!_P`````!_P'_````````````````` +M`````````````````````&``.``>``>``>`!X`>`'@`X`&`````````````` +M```````/`!^`.<`@P`#``,`!@`,`!@`,``P```````P`#``````````````` +M``````````````^`/\`P8&!@9R!OH&R@;*!GX&``,``_X`_@```````````` +M```````&``8`"P`+``D`$8`1@!"`/\`@P"!`0&!`8.#P```````````````` +M`````/\`8(!@P&#`8,!A@'^`8,!@8&!@8&!@8&#`_X`````````````````` +M````#\`08"`@(`!@`&``8`!@`&``8``@`#`@&$`/@``````````````````` +M``#_`&'`8,!@8&!@8&!@8&!@8&!@8&!@8$!A@/X````````````````````` +M`'_`,$`P0#``,``P@#^`,(`P`#``,``P(#`@?^`````````````````````` +M?\`P0#!`,``P`#"`/X`P@#``,``P`#``,`!X```````````````````````/ +MP!!@("`@`&``8`!@`&``8?!@8"!@,&`88`^``````````````````````/#P +M8&!@8&!@8&!@8'_@8&!@8&!@8&!@8&!@\/``````````````````````'X`& +M``8`!@`&``8`!@`&``8`!@`&``8`!@`?@``````````````````````?@`8` +M!@`&``8`!@`&``8`!@`&``8`!@`&``8`!@`&``0`.``P`````````/#@88!C +M`&8`;`!X`'@`?`!N`&<`8X!AP&#@\'``````````````````````>``P`#`` +M,``P`#``,``P`#``,``P`#`@,"!_X`````````````````````#@<&#@<.!P +MX'#@66!98%E@36!.8$Y@1&!$8.3P`````````````````````,!P8"!P('@@ +M6"!,($8@1R!#($&@0.!`X$!@X#``````````````````````#P`1P"#`(&!@ +M8&!@8&!@8&!@8&`@0#!`&(`/``````````````````````!_@##`,&`P8#!@ +M,,`W@#``,``P`#``,``P`'@```````````````````````\`$<`@P"!@8&!@ +M8&!@8&!@8&!@,$`X0!^`#@`?`".0`>``````````````_P!A@&#`8,!@P&"` +M?P!\`&X`9P!C@&'`8.#P<``````````````````````?X#!@8"!@('``/``> +M``>``<``X$!@0&!@P'^``````````````````````'_@1B`&``8`!@`&``8` +M!@`&``8`!@`&``8`'X``````````````````````\'!@(&`@8"!@(&`@8"!@ +M(&`@8"!@('!`/\`?@`````````````````````#@X&!`,(`P@#"`&0`9`!D` +M#``.``X`!``$``0``````````````````````/[P9B!F(&8@=B!W0#-`-T`[ +MP#N`&8`9@!F`&8``````````````````````\'!@(#!`.(`8@`T`!@`&``L` +M$8`1P"#`0&#@\`````````````````````#P<&`@,$`8@!B`#0`&``8`!@`& +M``8`!@`&``\``````````````````````#_@(,``P`&``8`#``,`!@`&``P` +M#``8`!@@/^````````````````````?`!\`&``8`!@`&``8`!@`&``8`!@`& +M``8`!\`'P```````````````````8`!@`#``,``8`!@`#``,``8``P`#``&` +M`8``P`#```````````````````!\`'P`#``,``P`#``,``P`#``,``P`#``, +M`'P`?`````````````````````0`#@`;`#&`8,`````````````````````` +M```````````````````````````````````````````````````````````` +M``````#_X/_@```````````!``,`!@`&``>`!X`#```````````````````` +M```````````````````````````````````/@!C`$,`#P!S`,,`PP##`.<`> +MX```````````````````(`!@`.``8`!@`&>`;\!PX&!@8&!@8&!@<&!XP$^` +M````````````````````````````````'X`QP"#`8`!@`&``8`!P0##`'X`` +M``````````````````!@`.``8`!@`&`/8#'@(.!@8&!@8&!@8'#@.6`><``` +M``````````````````````````````\`,,!@8&!@?^!@`&``,``88`^````` +M```````````````#@`3`!,`,``P`#``,`!^`#``,``P`#``,``P`'@`````` +M```````````````````````````?(#'@8,!@P&#`,8`_`&``?\`_X"!@0"!` +M('_`/X``````$``P`'``,``P`#>`.<`PP##`,,`PP##`,,`PP'G@```````` +M``````````````8`!@``````'@`&``8`!@`&``8`!@`&``8`'X`````````` +M`````````````,``P``````#P`#``,``P`#``,``P`#``,``P"#`,,`X@!\` +M#@``````8`#@`&``8`!@`&'`8P!F`'P`>`!\`&X`9P!C@/'@```````````` +M```````>``8`!@`&``8`!@`&``8`!@`&``8`!@`&``8`'X`````````````` +M``````````````````#=P&[@9F!F8&9@9F!F8&9@9F#O<``````````````` +M`````````````````">`><`PP##`,,`PP##`,,`PP'G@```````````````` +M````````````````#X`1P"#@8&!@8&!@8&!P0#B`'P`````````````````` +M``````````````#O@''`8.!@8&!@8&!@8&!`<(!_`&``8`!@`&``\``````` +M``````````````\@$>`@X&!@8&!@8&!@<&`XX!_@`&``8`!@`&``\``````` +M``````````````````````````````````` +M```````````?P##`,$`X`!X`!X`!P"#`,,`_@``````````````````````` +M``0`!``,`'_`#``,``P`#``,``P`#"`.0`>````````````````````````` +M````````>>`PP##`,,`PP##`,,`PP#G`'F`````````````````````````` +M``````#P<&`@,$`P0!B`&(`-``T`!@`&```````````````````````````` +M`````/]P9B!F(&8@-T`[0#M`&8`9@!F````````````````````````````` +M````^/!P0#B`'0`.``<`"X`1P"#@\?`````````````````````````````` +M``#P\&`@,$`P0!B`&(`-``T`!@`&``0`#``(`'@`<``````````````````` +M`'_@8.!!P`.`!P`.`!P`."!P8'_@```````````````````!P`,``P`!@`&` +M`8`#``<``P`!@`&``8`#``,``<````````````````````8`!@`&``8`!@`& +M``8`!@`&``8`!@`&``8`!@`&``8`!@`&``8`!@``````.``,``P`&``8`!@` +M#``.``P`&``8`!@`#``,`#@````````````````````````````````````` +M````'"`^8#;`9\!#@```````````````````JJ!54*J@55"JH%50JJ!54*J@ +M55"JH%50JJ!54*J@55"JH%50JJ!54*J@55`````````&``8```````8`!@`& +M``8`!@`&``8`!@`&``8`!@````````````````````$``0`#``(`'P`W@"6` +M9`!L`&@`>(`Y@!\`$``P`"``(``````````&``P`$``0`#``,``P`#X`?``8 +M`!@`&``8`#\@/^`QP```````````````````````````8"!W0#N`$<`PP##` +M.(`=P"[@0&```````````````````````````/!P8"`P0!B`&(`-``8`/\`& +M`#_`!@`&``8`#P````````````````````8`!@`&``8`!@`&``8`!@`&```` +M```&``8`!@`&``8`!@`&``8`!@``````#^`88#`@."`>`!^`,`0P`;`!L`&P`;`!L`&P`;````````` +M````````````````````````````````!@`/``\`!@`````````````````` +M``````````````````````````````````````````````````(``P`!@`F` +M!P`````````&``X`#@`&``8`!@`&``8`#P`````````````````````````` +M``````````<`"X`1P##`,,`X@!T`#@``````/^!_P``````````````````` +M`````````````````````&8`,P`9@`S`"(`1`"(`1``````````````````` +M`!@`.``X`!@`&"`88!C`&8`_0`;`#<`9P#+`9,!'X`#``,`````````````` +M&``X`#@`&``8(!A@&,`9@#_`!^`/8!I@,,!A@$,``^`#X``````````````X +M`'P`3``,`!@@#&!,P'V`.T`&P`W`&<`RP&3`1^``P`#````````````````` +M```#``,```````,``P`&``P`&``P`#``,$`YP!^`#P```````````!P`#P`# +M@`8`!@`+``L`"0`1@!&`$(`_P"#`($!`8$!@X/```````````````X`/`!P` +M!@`&``L`"P`)`!&`$8`0@#_`(,`@0$!@0&#@\``````````````&``\`&8`& +M``8`"P`+``D`$8`1@!"`/\`@P"!`0&!`8.#P``````````````S`'X`S``8` +M!@`+``L`"0`1@!&`$(`_P"#`($!`8$!@X/``````````````&8`9@```!@`& +M``L`"P`)`!&`$8`0@#_`(,`@0$!@0&#@\``````````````&``\`&8`/``8` +M"P`+``D`$8`1@!"`/\`@P"!`0&!`8.#P``````````````````````_@#B`6 +M(!8`%@`60"?`)D`^`"8`1@!&$$80Y_``````````````````````#\`08"`@ +M(`!@`&``8`!@`&``8``@`#`@&$`/@`(``P`!@`F`!P`<``\``X!_P#!`,$`P +M`#``,(`_@#"`,``P`#``,"`P('_@``````````````.`#P`<`'_`,$`P0#`` +M,``P@#^`,(`P`#``,``P(#`@?^``````````````!@`/`!F`?\`P0#!`,``P +M`#"`/X`P@#``,``P`#`@,"!_X``````````````9@!F```!_P#!`,$`P`#`` +M,(`_@#"`,``P`#``,"`P('_@`````````````!P`#P`#@!^`!@`&``8`!@`& +M``8`!@`&``8`!@`&``8`'X```````````````X`/`!P`'X`&``8`!@`&``8` +M!@`&``8`!@`&``8`!@`?@``````````````&``\`&8`?@`8`!@`&``8`!@`& +M``8`!@`&``8`!@`&`!^``````````````!F`&8```!^`!@`&``8`!@`&``8` +M!@`&``8`!@`&``8`'X``````````````````````_P!AP&#`8&!@8&!@^&#X +M8&!@8&!@8&!`88#^```````````````,P!^`,P#`<&`@<"!X(%@@3"!&($<@ +M0R!!H$#@0.!`8.`P`````````````!P`#P`#@`\`$<`@P"!@8&!@8&!@8&!@ +M8&!@($`P0!B`#P```````````````X`/`!P`#P`1P"#`(&!@8&!@8&!@8&!@ +M8&`@0#!`&(`/```````````````&``\`&8`/`!'`(,`@8&!@8&!@8&!@8&!@ +M8"!`,$`8@`\```````````````S`'X`S``\`$<`@P"!@8&!@8&!@8&!@8&!@ +M($`P0!B`#P``````````````&8`9@```#P`1P"#`(&!@8&!@8&!@8&!@8&`@ +M0#!`&(`/`````````````````````````````````&!@,,`9@`\`!@`/`!F` +M,,!@8```````````````````````8`_`$<`AP"'@8V!C8&9@;&!L8'A@.$`P +M0#B`;P``````````````'``/``.`\'!@(&`@8"!@(&`@8"!@(&`@8"!@('!` +M/\`?@``````````````#@`\`'`#P<&`@8"!@(&`@8"!@(&`@8"!@(&`@<$`_ +MP!^```````````````8`#P`9@/!P8"!@(&`@8"!@(&`@8"!@(&`@8"!P0#_` +M'X``````````````&8`9@```\'!@(&`@8"!@(&`@8"!@(&`@8"!@('!`/\`? +M@``````````````#@`\`'`#P<&`@,$`8@!B`#0`&``8`!@`&``8`!@`&``\` +M`````````````````````'@`,``P`#^`,,`P8#!@,&`P8##`/X`P`#``>``` +M``````````````````\`&8`9@#&`,8`S@#8`-@`V`#.`,<`PX#1@-F!WP``` +M```````````````````<``\``X````^`&,`0P`/`',`PP##`,,`YP![@```` +M``````````````````.`#P`<````#X`8P!#``\`X``````` +M```````````````,P!^`,P````^`&,`0P`/`',`PP##`,,`YP![@```````` +M`````````````!F`&8``````#X`8P!#``\`X``````````` +M`````````````````````!^`-D`F8`Y@/^!F`&8`9@!G8#_````````````` +M````````````````````'X`QP"#`8`!@`&``8`!P0##`'X`"``,``8`)@`<` +M````````'``/``.````/`##`8&!@8'_@8`!@`#``&&`/@``````````````` +M```````#@`\`'`````\`,,!@8&!@?^!@`&``,``88`^````````````````` +M``````8`#P`9@```#P`PP&!@8&!_X&``8``P`!A@#X`````````````````` +M````&8`9@``````/`##`8&!@8'_@8`!@`#``&&`/@``````````````````` +M```<``\``X```!X`!@`&``8`!@`&``8`!@`&`!^````````````````````` +M``.`#P`<````'@`&``8`!@`&``8`!@`&``8`'X`````````````````````` +M!@`/`!F````>``8`!@`&``8`!@`&``8`!@`?@``````````````````````9 +M@!F``````!X`!@`&``8`!@`&``8`!@`&`!^````````````````````PP!^` +M!@`?`#&``<`/P!#@(.!@8&!@8&!P0#B`'P``````````````````````#,`? +M@#,````G@'G`,,`PP##`,,`PP##`,,!YX``````````````````````<``\` +M`X````^`$<`@X&!@8&!@8&!@<$`X@!\```````````````````````.`#P`< +M````#X`1P"#@8&!@8&!@8&!P0#B`'P``````````````````````!@`/`!F` +M```/@!'`(.!@8&!@8&!@8'!`.(`?```````````````````````,P!^`,P`` +M``^`$<`@X&!@8&!@8&!@<$`X@!\``````````````````````!F`&8`````` +M#X`1P"#@8&!@8&!@8&!P0#B`'P`````````````````````````````````& +M``8``````'_@?^``````!@`&``````````````````````````````````_@ +M$<`AX&-@9F!F8&Q@>$`X@'\``````````````````````!P`#P`#@```>>`P +MP##`,,`PP##`,,`PP#G`'F```````````````````````X`/`!P```!YX##` +M,,`PP##`,,`PP##`.<`>8``````````````````````&``\`&8```'G@,,`P +MP##`,,`PP##`,,`YP!Y@`````````````````````!F`&8``````>>`PP##` +M,,`PP##`,,`PP#G`'F```````````````````````X`/`!P```#P\&`@,$`P +M0!B`&(`-``T`!@`&``0`#``(`'@`<```````X`!@`&``8`!@`&^`< Delivered-To: svn-src-stable-10@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 83724D48; Tue, 17 Jun 2014 05:21: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 7023424F3; Tue, 17 Jun 2014 05:21: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 s5H5Lnwr056986; Tue, 17 Jun 2014 05:21:49 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H5LmBB056982; Tue, 17 Jun 2014 05:21:48 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201406170521.s5H5LmBB056982@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 17 Jun 2014 05:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267561 - in stable/10/sys: amd64/linux32 i386/linux kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 05:21:49 -0000 Author: dchagin Date: Tue Jun 17 05:21:48 2014 New Revision: 267561 URL: http://svnweb.freebsd.org/changeset/base/267561 Log: Revert MFC r266925 because it can lead to instant panic at fexecve(): To allow to run interpreter itself add a new ELF branding type. Pointed out by: kib, mjg Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/i386/linux/linux_sysvec.c stable/10/sys/kern/imgact_elf.c stable/10/sys/sys/imgact_elf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Tue Jun 17 02:10:40 2014 (r267560) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Tue Jun 17 05:21:48 2014 (r267561) @@ -1083,7 +1083,7 @@ static Elf32_Brandinfo linux_brand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1095,7 +1095,7 @@ static Elf32_Brandinfo linux_glibc2brand .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; Elf32_Brandinfo *linux_brandlist[] = { Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Tue Jun 17 02:10:40 2014 (r267560) +++ stable/10/sys/i386/linux/linux_sysvec.c Tue Jun 17 05:21:48 2014 (r267561) @@ -1058,7 +1058,7 @@ static Elf32_Brandinfo linux_brand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1070,7 +1070,7 @@ static Elf32_Brandinfo linux_glibc2brand .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; Elf32_Brandinfo *linux_brandlist[] = { Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Tue Jun 17 02:10:40 2014 (r267560) +++ stable/10/sys/kern/imgact_elf.c Tue Jun 17 05:21:48 2014 (r267561) @@ -261,8 +261,6 @@ __elfN(get_brandinfo)(struct image_param { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi; - const char *fname_name, *interp_brand_name; - int fname_len, interp_len; boolean_t ret; int i; @@ -313,33 +311,6 @@ __elfN(get_brandinfo)(struct image_param } } - /* Some ABI allows to run the interpreter itself. */ - for (i = 0; i < MAX_BRANDS; i++) { - bi = elf_brand_list[i]; - if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) - continue; - if (hdr->e_machine != bi->machine || - (bi->flags & BI_CAN_EXEC_INTERP) == 0) - continue; - /* - * Compare the interpreter name not the path to allow run it - * from everywhere. - */ - interp_brand_name = strrchr(bi->interp_path, '/'); - if (interp_brand_name == NULL) - interp_brand_name = bi->interp_path; - interp_len = strlen(interp_brand_name); - fname_name = strrchr(imgp->args->fname, '/'); - if (fname_name == NULL) - fname_name = imgp->args->fname; - fname_len = strlen(fname_name); - if (fname_len < interp_len) - continue; - ret = strncmp(fname_name, interp_brand_name, interp_len); - if (ret == 0) - return (bi); - } - /* Lacking a recognized interpreter, try the default brand */ for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; Modified: stable/10/sys/sys/imgact_elf.h ============================================================================== --- stable/10/sys/sys/imgact_elf.h Tue Jun 17 02:10:40 2014 (r267560) +++ stable/10/sys/sys/imgact_elf.h Tue Jun 17 05:21:48 2014 (r267561) @@ -77,7 +77,6 @@ typedef struct { #define BI_CAN_EXEC_DYN 0x0001 #define BI_BRAND_NOTE 0x0002 /* May have note.ABI-tag section. */ #define BI_BRAND_NOTE_MANDATORY 0x0004 /* Must have note.ABI-tag section. */ -#define BI_CAN_EXEC_INTERP 0x0008 /* Allow to run interpreter itself. */ } __ElfN(Brandinfo); __ElfType(Auxargs); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 17 05:24:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9EE87E9D; Tue, 17 Jun 2014 05:24: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 8C1F42511; Tue, 17 Jun 2014 05:24: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 s5H5Ojg9057536; Tue, 17 Jun 2014 05:24:45 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H5OjMu057535; Tue, 17 Jun 2014 05:24:45 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201406170524.s5H5OjMu057535@svn.freebsd.org> From: Bryan Venteicher Date: Tue, 17 Jun 2014 05:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267562 - stable/10/sys/dev/virtio/block X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 05:24:45 -0000 Author: bryanv Date: Tue Jun 17 05:24:45 2014 New Revision: 267562 URL: http://svnweb.freebsd.org/changeset/base/267562 Log: MFC r267313: Always append new bios to the tail of the queue, instead of sorting them Modified: stable/10/sys/dev/virtio/block/virtio_blk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- stable/10/sys/dev/virtio/block/virtio_blk.c Tue Jun 17 05:21:48 2014 (r267561) +++ stable/10/sys/dev/virtio/block/virtio_blk.c Tue Jun 17 05:24:45 2014 (r267562) @@ -577,7 +577,7 @@ vtblk_strategy(struct bio *bp) if (sc->vtblk_flags & VTBLK_FLAG_DETACH) vtblk_finish_bio(bp, ENXIO); else { - bioq_disksort(&sc->vtblk_bioq, bp); + bioq_insert_tail(&sc->vtblk_bioq, bp); if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) vtblk_startio(sc); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 17 08:09:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 87D13560; Tue, 17 Jun 2014 08:09: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 742782149; Tue, 17 Jun 2014 08:09: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 s5H89fRx031397; Tue, 17 Jun 2014 08:09:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H89fXs031396; Tue, 17 Jun 2014 08:09:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406170809.s5H89fXs031396@svn.freebsd.org> From: Alexander Motin Date: Tue, 17 Jun 2014 08:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267571 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 08:09:41 -0000 Author: mav Date: Tue Jun 17 08:09:40 2014 New Revision: 267571 URL: http://svnweb.freebsd.org/changeset/base/267571 Log: MFC r267029, r267038: Replace gethrtime() with cpu_ticks(), as source of random for the taskqueue selection. gethrtime() in our port updated with HZ rate, so unusable for this specific purpose, completely draining benefit of multiple taskqueues. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun 17 08:02:50 2014 (r267570) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun 17 08:09:40 2014 (r267571) @@ -953,7 +953,11 @@ spa_taskq_dispatch_ent(spa_t *spa, zio_t if (tqs->stqs_count == 1) { tq = tqs->stqs_taskq[0]; } else { +#ifdef _KERNEL + tq = tqs->stqs_taskq[cpu_ticks() % tqs->stqs_count]; +#else tq = tqs->stqs_taskq[gethrtime() % tqs->stqs_count]; +#endif } taskq_dispatch_ent(tq, func, arg, flags, ent); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 17 08:56:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 41F6E33E; Tue, 17 Jun 2014 08:56: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 2E542257F; Tue, 17 Jun 2014 08:56: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 s5H8uHXL053887; Tue, 17 Jun 2014 08:56:17 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H8uHVw053886; Tue, 17 Jun 2014 08:56:17 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201406170856.s5H8uHVw053886@svn.freebsd.org> From: Christian Brueffer Date: Tue, 17 Jun 2014 08:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267573 - stable/10/contrib/openbsm/libbsm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 08:56:17 -0000 Author: brueffer Date: Tue Jun 17 08:56:16 2014 New Revision: 267573 URL: http://svnweb.freebsd.org/changeset/base/267573 Log: MFC: r267478 MFp4: change 1191346 In print_header32_tok(), correct printing in the XML case. This lead to invalid XML files before. PR: 176259 Submitted by: zi Modified: stable/10/contrib/openbsm/libbsm/bsm_io.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/openbsm/libbsm/bsm_io.c ============================================================================== --- stable/10/contrib/openbsm/libbsm/bsm_io.c Tue Jun 17 08:11:45 2014 (r267572) +++ stable/10/contrib/openbsm/libbsm/bsm_io.c Tue Jun 17 08:56:16 2014 (r267573) @@ -949,7 +949,7 @@ print_header32_tok(FILE *fp, tokenstr_t { print_tok_type(fp, tok->id, "header", oflags); - if (oflags & AU_OFLAG_RAW) { + if (oflags & AU_OFLAG_XML) { open_attr(fp, "version"); print_1_byte(fp, tok->tt.hdr32.version, "%u"); close_attr(fp); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 17 13:14:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2D4EDECA; Tue, 17 Jun 2014 13:14: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 199492E2B; Tue, 17 Jun 2014 13:14: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 s5HDEVav075534; Tue, 17 Jun 2014 13:14:31 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HDEV7H075533; Tue, 17 Jun 2014 13:14:31 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201406171314.s5HDEV7H075533@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 17 Jun 2014 13:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267579 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 13:14:32 -0000 Author: trasz Date: Tue Jun 17 13:14:31 2014 New Revision: 267579 URL: http://svnweb.freebsd.org/changeset/base/267579 Log: MFC r266007: Initialize loginclass mutex using MTX_SYSINIT instead of using SI_SUB_CPU. Modified: stable/10/sys/kern/kern_loginclass.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_loginclass.c ============================================================================== --- stable/10/sys/kern/kern_loginclass.c Tue Jun 17 13:12:30 2014 (r267578) +++ stable/10/sys/kern/kern_loginclass.c Tue Jun 17 13:14:31 2014 (r267579) @@ -69,9 +69,7 @@ LIST_HEAD(, loginclass) loginclasses; * Lock protecting loginclasses list. */ static struct mtx loginclasses_lock; - -static void lc_init(void); -SYSINIT(loginclass, SI_SUB_CPU, SI_ORDER_FIRST, lc_init, NULL); +MTX_SYSINIT(loginclasses_init, &loginclasses_lock, "loginclasses lock", MTX_DEF); void loginclass_hold(struct loginclass *lc) @@ -229,10 +227,3 @@ loginclass_racct_foreach(void (*callback (callback)(lc->lc_racct, arg2, arg3); mtx_unlock(&loginclasses_lock); } - -static void -lc_init(void) -{ - - mtx_init(&loginclasses_lock, "loginclasses lock", NULL, MTX_DEF); -} From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 17 20:08:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 446B9C70; Tue, 17 Jun 2014 20:08: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 2FC5A27EB; Tue, 17 Jun 2014 20:08: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 s5HK8JYA073004; Tue, 17 Jun 2014 20:08:19 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HK8IV4072996; Tue, 17 Jun 2014 20:08:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406172008.s5HK8IV4072996@svn.freebsd.org> From: Glen Barber Date: Tue, 17 Jun 2014 20:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267592 - in stable/10/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 20:08:19 -0000 Author: gjb Date: Tue Jun 17 20:08:17 2014 New Revision: 267592 URL: http://svnweb.freebsd.org/changeset/base/267592 Log: MFC r265590, r265594, r265595, r265599 [1], r265601 [1], r265602 [1], r265603 [1], r265605 [1], r265607 [1], r267554 [1]: r265590: Modify release.xsl to allow proper attribution for sponsored and/or contributed works. r265594: Add two new entity files in followup to r265590, sponsor.ent and vendor.ent, which will be used for sponsor/vendor names and URLs. r265595: Add references to sponsor.ent and vendor.ent in relnotes/article.xml and share/xml/catalog.xml. r265599: Add DARPA, AFRL to sponsor.ent. r265601: Add LSI and Spectra Logic to sponsor.ent. r265602: Add Netgate to sponsor.ent. r265603: Add a note to keep the entity lists sorted alphabetically. r265605: Add Google to the sponsor.ent file. r265607: Separate &darpa; entity and create &darpa_afrl to avoid confusion. r267554: Add &citrix; and &citrix.rd; macros. [1] - Partial, entity addition only. Sponsored by: The FreeBSD Foundation Added: stable/10/release/doc/share/xml/sponsor.ent - copied, changed from r265594, head/release/doc/share/xml/sponsor.ent stable/10/release/doc/share/xml/vendor.ent - copied, changed from r265594, head/release/doc/share/xml/vendor.ent Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml stable/10/release/doc/share/xml/catalog.xml stable/10/release/doc/share/xml/release.xsl Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 17 18:51:03 2014 (r267591) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 17 20:08:17 2014 (r267592) @@ -3,6 +3,10 @@ "../../../share/xml/freebsd50.dtd" [ %release; + + %sponsor; + + %vendor; ]>
Modified: stable/10/release/doc/share/xml/catalog.xml ============================================================================== --- stable/10/release/doc/share/xml/catalog.xml Tue Jun 17 18:51:03 2014 (r267591) +++ stable/10/release/doc/share/xml/catalog.xml Tue Jun 17 20:08:17 2014 (r267592) @@ -7,5 +7,7 @@ rewritePrefix="../../"/> + + Modified: stable/10/release/doc/share/xml/release.xsl ============================================================================== --- stable/10/release/doc/share/xml/release.xsl Tue Jun 17 18:51:03 2014 (r267591) +++ stable/10/release/doc/share/xml/release.xsl Tue Jun 17 20:08:17 2014 (r267592) @@ -43,6 +43,51 @@ + + + + + + + + + (Sponsored by + + + + + + + + + + + + + + + + + + (Contributed / provided by + + + + + + + + + + + + + + + + + +

Copied and modified: stable/10/release/doc/share/xml/sponsor.ent (from r265594, head/release/doc/share/xml/sponsor.ent) ============================================================================== --- head/release/doc/share/xml/sponsor.ent Wed May 7 19:43:23 2014 (r265594, copy source) +++ stable/10/release/doc/share/xml/sponsor.ent Tue Jun 17 20:08:17 2014 (r267592) @@ -4,7 +4,25 @@ Sponsors of various works. + Please keep the entity list sorted alphabetically. + --> + + + + + + + + + + + + + + + + Copied and modified: stable/10/release/doc/share/xml/vendor.ent (from r265594, head/release/doc/share/xml/vendor.ent) ============================================================================== --- head/release/doc/share/xml/vendor.ent Wed May 7 19:43:23 2014 (r265594, copy source) +++ stable/10/release/doc/share/xml/vendor.ent Tue Jun 17 20:08:17 2014 (r267592) @@ -4,4 +4,6 @@ Vendors and contributors. + Please keep the entity list sorted alphabetically. + --> From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 17 20:32:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 ACF3C52E; Tue, 17 Jun 2014 20:32: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 80E302A75; Tue, 17 Jun 2014 20:32: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 s5HKWb8J086631; Tue, 17 Jun 2014 20:32:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HKWbYp086629; Tue, 17 Jun 2014 20:32:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406172032.s5HKWbYp086629@svn.freebsd.org> From: Glen Barber Date: Tue, 17 Jun 2014 20:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267593 - in stable/10/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 20:32:37 -0000 Author: gjb Date: Tue Jun 17 20:32:36 2014 New Revision: 267593 URL: http://svnweb.freebsd.org/changeset/base/267593 Log: Add sponsorship attributions for stable/10. Add iX and Netflix to the sponsors.ent file. This is a direct commit to stable/10. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml stable/10/release/doc/share/xml/sponsor.ent Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 17 20:08:17 2014 (r267592) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 17 20:32:36 2014 (r267593) @@ -130,7 +130,8 @@ which should be resolved due to several change in the VM subsystem. - The &man.geom.4; RAID driver has been + The + &man.geom.4; RAID driver has been updated to support unmapped I/O. A new &man.sysctl.8;, @@ -138,11 +139,13 @@ which allows controlling how long the system will wait after &man.panic.9; before rebooting. - The &man.mpr.4; device has been added, + The + &man.mpr.4; device has been added, providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA controllers. - The &man.mrsas.4; driver has been added, + The + &man.mrsas.4; driver has been added, providing support for LSI MegaRAID SAS controllers. The &man.mfi.4; driver will attach to the controller, by default. To enable &man.mrsas.4; add @@ -229,7 +232,8 @@ Userland Changes - A new flag is added to &man.camcontrol.8;, + A new flag is added to &man.camcontrol.8;, -b, which outputs the existing buses and their parents. Modified: stable/10/release/doc/share/xml/sponsor.ent ============================================================================== --- stable/10/release/doc/share/xml/sponsor.ent Tue Jun 17 20:08:17 2014 (r267592) +++ stable/10/release/doc/share/xml/sponsor.ent Tue Jun 17 20:32:36 2014 (r267593) @@ -21,8 +21,11 @@ + + + From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 17 21:07:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6C0ECF33; Tue, 17 Jun 2014 21:07: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 58D302D32; Tue, 17 Jun 2014 21:07: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 s5HL7ZPe001857; Tue, 17 Jun 2014 21:07:35 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HL7ZZo001856; Tue, 17 Jun 2014 21:07:35 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406172107.s5HL7ZZo001856@svn.freebsd.org> From: Glen Barber Date: Tue, 17 Jun 2014 21:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267594 - stable/10/release/doc/share/xml X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 21:07:35 -0000 Author: gjb Date: Tue Jun 17 21:07:34 2014 New Revision: 267594 URL: http://svnweb.freebsd.org/changeset/base/267594 Log: Correct the spelling of iXsystems. Submitted by: delphij Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/sponsor.ent Modified: stable/10/release/doc/share/xml/sponsor.ent ============================================================================== --- stable/10/release/doc/share/xml/sponsor.ent Tue Jun 17 20:32:36 2014 (r267593) +++ stable/10/release/doc/share/xml/sponsor.ent Tue Jun 17 21:07:34 2014 (r267594) @@ -21,7 +21,7 @@ - + From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 17 21:09:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 60223241; Tue, 17 Jun 2014 21:09: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 4D5952D42; Tue, 17 Jun 2014 21:09: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 s5HL94Ig002248; Tue, 17 Jun 2014 21:09:04 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HL94aJ002247; Tue, 17 Jun 2014 21:09:04 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406172109.s5HL94aJ002247@svn.freebsd.org> From: Glen Barber Date: Tue, 17 Jun 2014 21:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267596 - stable/10/release/doc/share/xml X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 21:09:04 -0000 Author: gjb Date: Tue Jun 17 21:09:03 2014 New Revision: 267596 URL: http://svnweb.freebsd.org/changeset/base/267596 Log: Drop 'Inc.' for consistency. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/sponsor.ent Modified: stable/10/release/doc/share/xml/sponsor.ent ============================================================================== --- stable/10/release/doc/share/xml/sponsor.ent Tue Jun 17 21:08:49 2014 (r267595) +++ stable/10/release/doc/share/xml/sponsor.ent Tue Jun 17 21:09:03 2014 (r267596) @@ -19,7 +19,7 @@ - + From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 17 21:49:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F2C8B329; Tue, 17 Jun 2014 21:49: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 DF6C320FF; Tue, 17 Jun 2014 21:49: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 s5HLn3u7020905; Tue, 17 Jun 2014 21:49:03 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HLn3xX020904; Tue, 17 Jun 2014 21:49:03 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201406172149.s5HLn3xX020904@svn.freebsd.org> From: Neel Natu Date: Tue, 17 Jun 2014 21:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267598 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 21:49:04 -0000 Author: neel Date: Tue Jun 17 21:49:03 2014 New Revision: 267598 URL: http://svnweb.freebsd.org/changeset/base/267598 Log: MFC r266901 Allocate a zeroed LDT. Failing to do this might result in the LDT appearing to run out of free descriptors because of random junk in the descriptor's 'sd_type' field. Modified: stable/10/sys/amd64/amd64/sys_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/sys_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/sys_machdep.c Tue Jun 17 21:48:04 2014 (r267597) +++ stable/10/sys/amd64/amd64/sys_machdep.c Tue Jun 17 21:49:03 2014 (r267598) @@ -465,7 +465,7 @@ user_ldt_alloc(struct proc *p, int force new_ldt = malloc(sizeof(struct proc_ldt), M_SUBPROC, M_WAITOK); new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, max_ldt_segment * sizeof(struct user_segment_descriptor), - M_WAITOK); + M_WAITOK | M_ZERO); if (new_ldt->ldt_base == NULL) { FREE(new_ldt, M_SUBPROC); mtx_lock(&dt_lock); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 18 05:35:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 923CBCF4; Wed, 18 Jun 2014 05:35: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 7353B275D; Wed, 18 Jun 2014 05:35: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 s5I5ZAGx037680; Wed, 18 Jun 2014 05:35:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5I5Z9gh037676; Wed, 18 Jun 2014 05:35:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406180535.s5I5Z9gh037676@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 18 Jun 2014 05:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267602 - in stable/10: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2014 05:35:10 -0000 Author: kib Date: Wed Jun 18 05:35:09 2014 New Revision: 267602 URL: http://svnweb.freebsd.org/changeset/base/267602 Log: MFC r267062: Disable existing uncore hwpmc code for Nehalem and Westmere EX. Modified: stable/10/lib/libpmc/libpmc.c stable/10/sys/dev/hwpmc/hwpmc_core.c stable/10/sys/dev/hwpmc/hwpmc_intel.c stable/10/sys/sys/pmc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpmc/libpmc.c ============================================================================== --- stable/10/lib/libpmc/libpmc.c Wed Jun 18 02:36:21 2014 (r267601) +++ stable/10/lib/libpmc/libpmc.c Wed Jun 18 05:35:09 2014 (r267602) @@ -190,6 +190,11 @@ static const struct pmc_event_descr core __PMC_EV_ALIAS_COREI7() }; +static const struct pmc_event_descr nehalem_ex_event_table[] = +{ + __PMC_EV_ALIAS_COREI7() +}; + static const struct pmc_event_descr haswell_event_table[] = { __PMC_EV_ALIAS_HASWELL() @@ -220,6 +225,11 @@ static const struct pmc_event_descr west __PMC_EV_ALIAS_WESTMERE() }; +static const struct pmc_event_descr westmere_ex_event_table[] = +{ + __PMC_EV_ALIAS_WESTMERE() +}; + static const struct pmc_event_descr corei7uc_event_table[] = { __PMC_EV_ALIAS_COREI7UC() @@ -255,12 +265,14 @@ PMC_MDEP_TABLE(atom_silvermont, IAP, PMC PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(nehalem_ex, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(haswell, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(sandybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(westmere_ex, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(p4, P4, PMC_CLASS_SOFT, PMC_CLASS_TSC); @@ -298,12 +310,14 @@ PMC_CLASS_TABLE_DESC(atom_silvermont, IA PMC_CLASS_TABLE_DESC(core, IAP, core, iap); PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); +PMC_CLASS_TABLE_DESC(nehalem_ex, IAP, nehalem_ex, iap); PMC_CLASS_TABLE_DESC(haswell, IAP, haswell, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); PMC_CLASS_TABLE_DESC(sandybridge_xeon, IAP, sandybridge_xeon, iap); PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); +PMC_CLASS_TABLE_DESC(westmere_ex, IAP, westmere_ex, iap); PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf); PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp); PMC_CLASS_TABLE_DESC(haswelluc, UCP, haswelluc, ucp); @@ -608,6 +622,8 @@ static struct pmc_event_alias core2_alia #define atom_silvermont_aliases_without_iaf core2_aliases_without_iaf #define corei7_aliases core2_aliases #define corei7_aliases_without_iaf core2_aliases_without_iaf +#define nehalem_ex_aliases core2_aliases +#define nehalem_ex_aliases_without_iaf core2_aliases_without_iaf #define haswell_aliases core2_aliases #define haswell_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_aliases core2_aliases @@ -620,6 +636,8 @@ static struct pmc_event_alias core2_alia #define sandybridge_xeon_aliases_without_iaf core2_aliases_without_iaf #define westmere_aliases core2_aliases #define westmere_aliases_without_iaf core2_aliases_without_iaf +#define westmere_ex_aliases core2_aliases +#define westmere_ex_aliases_without_iaf core2_aliases_without_iaf #define IAF_KW_OS "os" #define IAF_KW_USR "usr" @@ -863,7 +881,9 @@ iap_allocate_pmc(enum pmc_event pe, char } else return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_COREI7 || - cpu_info.pm_cputype == PMC_CPU_INTEL_WESTMERE) { + cpu_info.pm_cputype == PMC_CPU_INTEL_WESTMERE || + cpu_info.pm_cputype == PMC_CPU_INTEL_NEHALEM_EX || + cpu_info.pm_cputype == PMC_CPU_INTEL_WESTMERE_EX) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_i7_wm, p, &rsp); } else @@ -2760,6 +2780,10 @@ pmc_event_names_of_class(enum pmc_class ev = corei7_event_table; count = PMC_EVENT_TABLE_SIZE(corei7); break; + case PMC_CPU_INTEL_NEHALEM_EX: + ev = nehalem_ex_event_table; + count = PMC_EVENT_TABLE_SIZE(nehalem_ex); + break; case PMC_CPU_INTEL_HASWELL: ev = haswell_event_table; count = PMC_EVENT_TABLE_SIZE(haswell); @@ -2784,6 +2808,10 @@ pmc_event_names_of_class(enum pmc_class ev = westmere_event_table; count = PMC_EVENT_TABLE_SIZE(westmere); break; + case PMC_CPU_INTEL_WESTMERE_EX: + ev = westmere_ex_event_table; + count = PMC_EVENT_TABLE_SIZE(westmere_ex); + break; } break; case PMC_CLASS_UCF: @@ -3079,6 +3107,9 @@ pmc_init(void) pmc_class_table[n++] = &corei7uc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(corei7); break; + case PMC_CPU_INTEL_NEHALEM_EX: + PMC_MDEP_INIT_INTEL_V2(nehalem_ex); + break; case PMC_CPU_INTEL_HASWELL: pmc_class_table[n++] = &ucf_class_table_descr; pmc_class_table[n++] = &haswelluc_class_table_descr; @@ -3103,6 +3134,9 @@ pmc_init(void) pmc_class_table[n++] = &westmereuc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(westmere); break; + case PMC_CPU_INTEL_WESTMERE_EX: + PMC_MDEP_INIT_INTEL_V2(westmere_ex); + break; case PMC_CPU_INTEL_PIV: PMC_MDEP_INIT(p4); pmc_class_table[n] = &p4_class_table_descr; @@ -3237,6 +3271,11 @@ _pmc_name_of_event(enum pmc_event pe, en ev = corei7_event_table; evfence = corei7_event_table + PMC_EVENT_TABLE_SIZE(corei7); break; + case PMC_CPU_INTEL_NEHALEM_EX: + ev = nehalem_ex_event_table; + evfence = nehalem_ex_event_table + + PMC_EVENT_TABLE_SIZE(nehalem_ex); + break; case PMC_CPU_INTEL_HASWELL: ev = haswell_event_table; evfence = haswell_event_table + PMC_EVENT_TABLE_SIZE(haswell); @@ -3261,6 +3300,11 @@ _pmc_name_of_event(enum pmc_event pe, en ev = westmere_event_table; evfence = westmere_event_table + PMC_EVENT_TABLE_SIZE(westmere); break; + case PMC_CPU_INTEL_WESTMERE_EX: + ev = westmere_ex_event_table; + evfence = westmere_ex_event_table + + PMC_EVENT_TABLE_SIZE(westmere_ex); + break; default: /* Unknown CPU type. */ break; } Modified: stable/10/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_core.c Wed Jun 18 02:36:21 2014 (r267601) +++ stable/10/sys/dev/hwpmc/hwpmc_core.c Wed Jun 18 05:35:09 2014 (r267602) @@ -2021,6 +2021,7 @@ iap_allocate_pmc(int cpu, int ri, struct switch (core_cputype) { case PMC_CPU_INTEL_COREI7: + case PMC_CPU_INTEL_NEHALEM_EX: if (iap_event_corei7_ok_on_counter(ev, ri) == 0) return (EINVAL); break; @@ -2033,6 +2034,7 @@ iap_allocate_pmc(int cpu, int ri, struct return (EINVAL); break; case PMC_CPU_INTEL_WESTMERE: + case PMC_CPU_INTEL_WESTMERE_EX: if (iap_event_westmere_ok_on_counter(ev, ri) == 0) return (EINVAL); break; @@ -2186,7 +2188,9 @@ iap_allocate_pmc(int cpu, int ri, struct ev == PMC_EV_IAP_EVENT_BBH_01H) return (EINVAL); if ((core_cputype == PMC_CPU_INTEL_COREI7 || - core_cputype == PMC_CPU_INTEL_WESTMERE) && + core_cputype == PMC_CPU_INTEL_WESTMERE || + core_cputype == PMC_CPU_INTEL_NEHALEM_EX || + core_cputype == PMC_CPU_INTEL_WESTMERE_EX) && a->pm_md.pm_iap.pm_iap_rsp & ~IA_OFFCORE_RSP_MASK_I7WM) return (EINVAL); else if ((core_cputype == PMC_CPU_INTEL_SANDYBRIDGE || Modified: stable/10/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_intel.c Wed Jun 18 02:36:21 2014 (r267601) +++ stable/10/sys/dev/hwpmc/hwpmc_intel.c Wed Jun 18 05:35:09 2014 (r267602) @@ -139,15 +139,22 @@ pmc_intel_initialize(void) * Per Intel document 253669-032 9/2009, * pages A-2 and A-57 */ - case 0x2E: cputype = PMC_CPU_INTEL_COREI7; nclasses = 5; break; + case 0x2E: + cputype = PMC_CPU_INTEL_NEHALEM_EX; + nclasses = 3; + break; case 0x25: /* Per Intel document 253669-033US 12/2009. */ case 0x2C: /* Per Intel document 253669-033US 12/2009. */ cputype = PMC_CPU_INTEL_WESTMERE; nclasses = 5; break; + case 0x2F: /* Westmere-EX, seen in wild */ + cputype = PMC_CPU_INTEL_WESTMERE_EX; + nclasses = 3; + break; case 0x2A: /* Per Intel document 253669-039US 05/2011. */ cputype = PMC_CPU_INTEL_SANDYBRIDGE; nclasses = 5; @@ -209,9 +216,11 @@ pmc_intel_initialize(void) case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: case PMC_CPU_INTEL_COREI7: + case PMC_CPU_INTEL_NEHALEM_EX: case PMC_CPU_INTEL_IVYBRIDGE: case PMC_CPU_INTEL_SANDYBRIDGE: case PMC_CPU_INTEL_WESTMERE: + case PMC_CPU_INTEL_WESTMERE_EX: case PMC_CPU_INTEL_SANDYBRIDGE_XEON: case PMC_CPU_INTEL_IVYBRIDGE_XEON: case PMC_CPU_INTEL_HASWELL: @@ -298,10 +307,12 @@ pmc_intel_finalize(struct pmc_mdep *md) case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: case PMC_CPU_INTEL_COREI7: + case PMC_CPU_INTEL_NEHALEM_EX: case PMC_CPU_INTEL_HASWELL: case PMC_CPU_INTEL_IVYBRIDGE: case PMC_CPU_INTEL_SANDYBRIDGE: case PMC_CPU_INTEL_WESTMERE: + case PMC_CPU_INTEL_WESTMERE_EX: case PMC_CPU_INTEL_SANDYBRIDGE_XEON: case PMC_CPU_INTEL_IVYBRIDGE_XEON: pmc_core_finalize(md); Modified: stable/10/sys/sys/pmc.h ============================================================================== --- stable/10/sys/sys/pmc.h Wed Jun 18 02:36:21 2014 (r267601) +++ stable/10/sys/sys/pmc.h Wed Jun 18 05:35:09 2014 (r267602) @@ -92,6 +92,8 @@ __PMC_CPU(INTEL_IVYBRIDGE_XEON, 0x90, "Intel Ivy Bridge Xeon") \ __PMC_CPU(INTEL_HASWELL, 0x91, "Intel Haswell") \ __PMC_CPU(INTEL_ATOM_SILVERMONT, 0x92, "Intel Atom Silvermont") \ + __PMC_CPU(INTEL_NEHALEM_EX, 0x93, "Intel Nehalem Xeon 7500") \ + __PMC_CPU(INTEL_WESTMERE_EX, 0x94, "Intel Westmere Xeon E7") \ __PMC_CPU(INTEL_XSCALE, 0x100, "Intel XScale") \ __PMC_CPU(MIPS_24K, 0x200, "MIPS 24K") \ __PMC_CPU(MIPS_OCTEON, 0x201, "Cavium Octeon") \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 18 19:32:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CE8C2A89; Wed, 18 Jun 2014 19:32: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 BBD71286B; Wed, 18 Jun 2014 19:32: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 s5IJWc1G024774; Wed, 18 Jun 2014 19:32:38 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IJWcE0024773; Wed, 18 Jun 2014 19:32:38 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201406181932.s5IJWcE0024773@svn.freebsd.org> From: Jim Harris Date: Wed, 18 Jun 2014 19:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267620 - stable/10/sys/dev/nvme X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2014 19:32:38 -0000 Author: jimharris Date: Wed Jun 18 19:32:38 2014 New Revision: 267620 URL: http://svnweb.freebsd.org/changeset/base/267620 Log: MFC r267342: Use bitwise OR instead of logical OR when constructing value for SET_FEATURES/NUMBER_OF_QUEUES command. Sponsored by: Intel Modified: stable/10/sys/dev/nvme/nvme_ctrlr_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nvme/nvme_ctrlr_cmd.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_ctrlr_cmd.c Wed Jun 18 19:28:55 2014 (r267619) +++ stable/10/sys/dev/nvme/nvme_ctrlr_cmd.c Wed Jun 18 19:32:38 2014 (r267620) @@ -205,7 +205,7 @@ nvme_ctrlr_cmd_set_num_queues(struct nvm { uint32_t cdw11; - cdw11 = ((num_queues - 1) << 16) || (num_queues - 1); + cdw11 = ((num_queues - 1) << 16) | (num_queues - 1); nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_NUMBER_OF_QUEUES, cdw11, NULL, 0, cb_fn, cb_arg); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 18 22:09:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E2EE579E; Wed, 18 Jun 2014 22:09:33 +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 D024F25A8; Wed, 18 Jun 2014 22:09:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IM9Xoi096954; Wed, 18 Jun 2014 22:09:33 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IM9Xje096953; Wed, 18 Jun 2014 22:09:33 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201406182209.s5IM9Xje096953@svn.freebsd.org> From: Nick Hibma Date: Wed, 18 Jun 2014 22:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267621 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2014 22:09:34 -0000 Author: n_hibma Date: Wed Jun 18 22:09:33 2014 New Revision: 267621 URL: http://svnweb.freebsd.org/changeset/base/267621 Log: MFC r261270: Fix the ordering of the arguments to printf in uhub_child_location_string(). This produced bogus information in dev...%location output from sysctl. Modified: stable/10/sys/dev/usb/usb_hub.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_hub.c ============================================================================== --- stable/10/sys/dev/usb/usb_hub.c Wed Jun 18 19:32:38 2014 (r267620) +++ stable/10/sys/dev/usb/usb_hub.c Wed Jun 18 22:09:33 2014 (r267621) @@ -1625,8 +1625,9 @@ uhub_child_location_string(device_t pare goto done; } snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u interface=%u", + device_get_unit(res.udev->bus->bdev), (res.udev->parent_hub != NULL) ? res.udev->parent_hub->device_index : 0, - res.portno, device_get_unit(res.udev->bus->bdev), + res.portno, res.udev->device_index, res.iface_index); done: mtx_unlock(&Giant); From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 20 07:32:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D1CB17BF; Fri, 20 Jun 2014 07: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 BD8802F3D; Fri, 20 Jun 2014 07: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 s5K7W4qC045775; Fri, 20 Jun 2014 07:32:04 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5K7W3Zt045767; Fri, 20 Jun 2014 07:32:03 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201406200732.s5K7W3Zt045767@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 20 Jun 2014 07:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267665 - in stable/10: lib/libc/iconv lib/libiconv_modules/HZ usr.bin/iconv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 07:32:04 -0000 Author: tijl Date: Fri Jun 20 07:32:03 2014 New Revision: 267665 URL: http://svnweb.freebsd.org/changeset/base/267665 Log: MFC r267436-267439: - Replace malloc+memset with calloc. - iconv_open(3): initialise ci_ilseq_invalid field of _citrus_iconv_shared struct after allocation with malloc. - iconvlist(3): reduce a memory leak by copying strings only once. - iconv(1): - Make invalids variable local to do_conv such that it prints the number of invalid characters of the current file instead of an accumulated value. - Make do_conv return an error when invalid characters have been found. Return EXIT_FAILURE from main if any file contained invalid characters. This matches the behaviour of GNU iconv. - Mark usage with __dead2 attribute. - Make the long_options array const. Tested by: Pavel Timofeev Modified: stable/10/lib/libc/iconv/bsd_iconv.c stable/10/lib/libc/iconv/citrus_db_factory.c stable/10/lib/libc/iconv/citrus_iconv.c stable/10/lib/libiconv_modules/HZ/citrus_hz.c stable/10/usr.bin/iconv/iconv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/iconv/bsd_iconv.c ============================================================================== --- stable/10/lib/libc/iconv/bsd_iconv.c Fri Jun 20 07:01:53 2014 (r267664) +++ stable/10/lib/libc/iconv/bsd_iconv.c Fri Jun 20 07:32:03 2014 (r267665) @@ -83,6 +83,7 @@ __bsd___iconv_open(const char *out, cons } handle->cv_shared->ci_discard_ilseq = strcasestr(out, "//IGNORE"); + handle->cv_shared->ci_ilseq_invalid = false; handle->cv_shared->ci_hooks = NULL; return ((iconv_t)(void *)handle); @@ -223,7 +224,7 @@ __bsd_iconvlist(int (*do_one) (unsigned return; } strlcpy(curkey, list[i], slashpos - list[i] + 1); - names[j++] = strdup(curkey); + names[j++] = curkey; for (; (i < sz) && (memcmp(curkey, list[i], strlen(curkey)) == 0); i++) { slashpos = strchr(list[i], '/'); curitem = (char *)malloc(strlen(slashpos) + 1); @@ -235,7 +236,7 @@ __bsd_iconvlist(int (*do_one) (unsigned if (strcmp(curkey, curitem) == 0) { continue; } - names[j++] = strdup(curitem); + names[j++] = curitem; } np = (const char * const *)names; do_one(j, np, data); Modified: stable/10/lib/libc/iconv/citrus_db_factory.c ============================================================================== --- stable/10/lib/libc/iconv/citrus_db_factory.c Fri Jun 20 07:01:53 2014 (r267664) +++ stable/10/lib/libc/iconv/citrus_db_factory.c Fri Jun 20 07:32:03 2014 (r267665) @@ -270,11 +270,9 @@ _citrus_db_factory_serialize(struct _cit return (0); } /* allocate hash table */ - depp = malloc(sizeof(*depp) * df->df_num_entries); + depp = calloc(df->df_num_entries, sizeof(*depp)); if (depp == NULL) return (-1); - for (i = 0; i < df->df_num_entries; i++) - depp[i] = NULL; /* step1: store the entries which are not conflicting */ STAILQ_FOREACH(de, &df->df_entries, de_entry) { Modified: stable/10/lib/libc/iconv/citrus_iconv.c ============================================================================== --- stable/10/lib/libc/iconv/citrus_iconv.c Fri Jun 20 07:01:53 2014 (r267664) +++ stable/10/lib/libc/iconv/citrus_iconv.c Fri Jun 20 07:32:03 2014 (r267665) @@ -344,9 +344,8 @@ const char { char *buf; - if ((buf = malloc((size_t)PATH_MAX)) == NULL) + if ((buf = calloc((size_t)PATH_MAX, sizeof(*buf))) == NULL) return (NULL); - memset((void *)buf, 0, (size_t)PATH_MAX); _citrus_esdb_alias(name, buf, (size_t)PATH_MAX); return (buf); } Modified: stable/10/lib/libiconv_modules/HZ/citrus_hz.c ============================================================================== --- stable/10/lib/libiconv_modules/HZ/citrus_hz.c Fri Jun 20 07:01:53 2014 (r267664) +++ stable/10/lib/libiconv_modules/HZ/citrus_hz.c Fri Jun 20 07:32:03 2014 (r267665) @@ -532,10 +532,9 @@ _citrus_HZ_parse_graphic(void *context, p = (void **)context; escape = (escape_t *)p[0]; ei = (_HZEncodingInfo *)p[1]; - graphic = malloc(sizeof(*graphic)); + graphic = calloc(1, sizeof(*graphic)); if (graphic == NULL) return (ENOMEM); - memset(graphic, 0, sizeof(*graphic)); if (strcmp("GL", name) == 0) { if (GL(escape) != NULL) goto release; @@ -598,10 +597,9 @@ _citrus_HZ_parse_escape(void *context, c void *p[2]; ei = (_HZEncodingInfo *)context; - escape = malloc(sizeof(*escape)); + escape = calloc(1, sizeof(*escape)); if (escape == NULL) return (EINVAL); - memset(escape, 0, sizeof(*escape)); if (strcmp("0", name) == 0) { escape->set = E0SET(ei); TAILQ_INSERT_TAIL(E0SET(ei), escape, entry); Modified: stable/10/usr.bin/iconv/iconv.c ============================================================================== --- stable/10/usr.bin/iconv/iconv.c Fri Jun 20 07:01:53 2014 (r267664) +++ stable/10/usr.bin/iconv/iconv.c Fri Jun 20 07:32:03 2014 (r267665) @@ -41,13 +41,11 @@ #include #include -static unsigned long long invalids; +static int do_conv(FILE *, const char *, const char *, bool, bool); +static int do_list(unsigned int, const char * const *, void *); +static void usage(void) __dead2; -static void do_conv(FILE *, const char *, const char *, bool, bool); -static int do_list(unsigned int, const char * const *, void *); -static void usage(void); - -static struct option long_options[] = { +static const struct option long_options[] = { {"from-code", required_argument, NULL, 'f'}, {"list", no_argument, NULL, 'l'}, {"silent", no_argument, NULL, 's'}, @@ -68,12 +66,13 @@ usage(void) #define INBUFSIZE 1024 #define OUTBUFSIZE (INBUFSIZE * 2) -static void +static int do_conv(FILE *fp, const char *from, const char *to, bool silent, bool hide_invalid) { iconv_t cd; char inbuf[INBUFSIZE], outbuf[OUTBUFSIZE], *out; + unsigned long long invalids; const char *in; size_t inbytes, outbytes, ret; @@ -84,8 +83,9 @@ do_conv(FILE *fp, const char *from, cons int arg = 1; if (iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, (void *)&arg) == -1) - err(1, NULL); + err(EXIT_FAILURE, NULL); } + invalids = 0; while ((inbytes = fread(inbuf, 1, INBUFSIZE, fp)) > 0) { in = inbuf; while (inbytes > 0) { @@ -135,6 +135,7 @@ do_conv(FILE *fp, const char *from, cons warnx("warning: invalid characters: %llu", invalids); iconv_close(cd); + return (invalids > 0); } static int @@ -157,7 +158,7 @@ main(int argc, char **argv) { FILE *fp; char *opt_f, *opt_t; - int ch, i; + int ch, i, res; bool opt_c = false, opt_s = false; opt_f = opt_t = strdup(""); @@ -202,18 +203,18 @@ main(int argc, char **argv) if ((strcmp(opt_f, "") == 0) && (strcmp(opt_t, "") == 0)) usage(); if (argc == 0) - do_conv(stdin, opt_f, opt_t, opt_s, opt_c); + res = do_conv(stdin, opt_f, opt_t, opt_s, opt_c); else { + res = 0; for (i = 0; i < argc; i++) { fp = (strcmp(argv[i], "-") != 0) ? fopen(argv[i], "r") : stdin; if (fp == NULL) err(EXIT_FAILURE, "Cannot open `%s'", argv[i]); - do_conv(fp, opt_f, opt_t, opt_s, - opt_c); + res |= do_conv(fp, opt_f, opt_t, opt_s, opt_c); (void)fclose(fp); } } - return (EXIT_SUCCESS); + return (res == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 20 07:35:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4C112A0A; Fri, 20 Jun 2014 07:35: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 1EF282F65; Fri, 20 Jun 2014 07:35: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 s5K7ZtK7046541; Fri, 20 Jun 2014 07:35:55 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5K7Ztha046539; Fri, 20 Jun 2014 07:35:55 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201406200735.s5K7Ztha046539@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 20 Jun 2014 07:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267666 - in stable/10: include tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 07:35:56 -0000 Author: tijl Date: Fri Jun 20 07:35:55 2014 New Revision: 267666 URL: http://svnweb.freebsd.org/changeset/base/267666 Log: MFC r267441: Don't install GSS-API headers when the GSSAPI option has been disabled. Some ports assume GSS-API is supported when they find the headers. PR: 189156 Submitted by: Garrett Cooper Modified: stable/10/include/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/include/Makefile ============================================================================== --- stable/10/include/Makefile Fri Jun 20 07:32:03 2014 (r267665) +++ stable/10/include/Makefile Fri Jun 20 07:35:55 2014 (r267666) @@ -6,11 +6,11 @@ .include CLEANFILES= osreldate.h version vers.c -SUBDIR= arpa gssapi protocols rpcsvc rpc xlocale +SUBDIR= arpa protocols rpcsvc rpc xlocale INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ db.h \ dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ - fts.h ftw.h getopt.h glob.h grp.h gssapi.h \ + fts.h ftw.h getopt.h glob.h grp.h \ ieeefp.h ifaddrs.h \ inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \ locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \ @@ -68,6 +68,11 @@ _dev_powermac_nvram= dev/powermac_nvram _dev_ieee488= dev/ieee488 .endif +.if ${MK_GSSAPI} != "no" +SUBDIR+= gssapi +INCS+= gssapi.h +.endif + .if ${MK_HESIOD} != "no" INCS+= hesiod.h .endif Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 20 07:32:03 2014 (r267665) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 20 07:35:55 2014 (r267666) @@ -1773,6 +1773,9 @@ OLD_DIRS+=usr/share/tmac .endif .if ${MK_GSSAPI} == no +OLD_FILES+=usr/include/gssapi/gssapi.h +OLD_DIRS+=usr/include/gssapi +OLD_FILES+=usr/include/gssapi.h OLD_FILES+=usr/lib/libgssapi.a OLD_FILES+=usr/lib/libgssapi.so OLD_LIBS+=usr/lib/libgssapi.so.10 From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 20 15:40:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D34A860D; Fri, 20 Jun 2014 15:40: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 BDCD02D8B; Fri, 20 Jun 2014 15:40: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 s5KFeEtm073603; Fri, 20 Jun 2014 15:40:14 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KFeEJi073598; Fri, 20 Jun 2014 15:40:14 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201406201540.s5KFeEJi073598@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Jun 2014 15:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267676 - stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 15:40:14 -0000 Author: pfg Date: Fri Jun 20 15:40:13 2014 New Revision: 267676 URL: http://svnweb.freebsd.org/changeset/base/267676 Log: MFC r267513: Merge from r258379 missed the tests. 4248 dtrace(1M) should never create DOF with empty probes section 4249 Only probes from the first DTrace object file will be included Illumos Revision: 54a20ab41aadcb81c53e72fc65886e964e9add59 Added: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh - copied unchanged from r267513, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out - copied unchanged from r267513, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh - copied unchanged from r267513, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh (from r267513, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh Fri Jun 20 15:40:13 2014 (r267676, copy of r267513, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh) @@ -0,0 +1,106 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2013, Joyent, Inc. All rights reserved. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +echo '#pragma D option quiet' > test.d +echo '#pragma D option aggsortkey' >> test.d + +cat > test.c < + +void +main() +{ +EOF + +objs= + +for oogle in doogle bagnoogle; do + cat > $oogle.c < + +void +$oogle() +{ + DTRACE_PROBE($oogle, knows); +} +EOF + + cat > $oogle.d <> test.c + echo $oogle'$target:::{@[probefunc] = count()}' >> test.d +done + +echo "}" >> test.c + +echo 'END{printa("%-10s %@d\\n", @)}' >> test.d + +cc -o test test.c $objs + +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi + +$dtrace -s ./test.d -Zc ./test + +if [ $? -ne 0 ]; then + print -u2 "failed to execute test" + exit 1 +fi + +cd / +/usr/bin/rm -rf $DIR +exit 0 Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out (from r267513, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out Fri Jun 20 15:40:13 2014 (r267676, copy of r267513, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out) @@ -0,0 +1,3 @@ +bagnoogle 1 +doogle 1 + Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh (from r267513, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh Fri Jun 20 15:40:13 2014 (r267676, copy of r267513, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh) @@ -0,0 +1,59 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2013, Joyent, Inc. All rights reserved. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.c < doogle.d < Delivered-To: svn-src-stable-10@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 D3E57910; Fri, 20 Jun 2014 15:43:58 +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 B464F2E2E; Fri, 20 Jun 2014 15:43:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KFhwnA076818; Fri, 20 Jun 2014 15:43:58 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KFhwds076817; Fri, 20 Jun 2014 15:43:58 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201406201543.s5KFhwds076817@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Jun 2014 15:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267677 - stable/10/lib/libc/stdtime X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 15:43:59 -0000 Author: pfg Date: Fri Jun 20 15:43:58 2014 New Revision: 267677 URL: http://svnweb.freebsd.org/changeset/base/267677 Log: MFC r267544: Update license to strptime(3) implementation. Our strptime(3) implementation was the base for the illumos implementation and after contacting the author, Kevin Rudy stated the code is under a 2-Clause BSD License [1] After reviewing our local changes to the file in question, the FreeBSD Foundation has agreed that their contributions to this file are not required to carry clause 3 or 4 so the file can be relicensed as in Illumos [2]. References: [1] https://www.illumos.org/issues/357 [2] Illumos Revision: 13222:02526851ba75 Approved: core (jhb) Approved: FreeBSD Foundation (emaste) Modified: stable/10/lib/libc/stdtime/strptime.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdtime/strptime.c ============================================================================== --- stable/10/lib/libc/stdtime/strptime.c Fri Jun 20 15:40:13 2014 (r267676) +++ stable/10/lib/libc/stdtime/strptime.c Fri Jun 20 15:43:58 2014 (r267677) @@ -1,25 +1,4 @@ -/* - * Powerdog Industries kindly requests feedback from anyone modifying - * this function: - * - * Date: Thu, 05 Jun 1997 23:17:17 -0400 - * From: Kevin Ruddy - * To: James FitzGibbon - * Subject: Re: Use of your strptime(3) code (fwd) - * - * The reason for the "no mod" clause was so that modifications would - * come back and we could integrate them and reissue so that a wider - * audience could use it (thereby spreading the wealth). This has - * made it possible to get strptime to work on many operating systems. - * I'm not sure why that's "plain unacceptable" to the FreeBSD team. - * - * Anyway, you can change it to "with or without modification" as - * you see fit. Enjoy. - * - * Kevin Ruddy - * Powerdog Industries, Inc. - */ -/* +/*- * Copyright (c) 1994 Powerdog Industries. All rights reserved. * * Copyright (c) 2011 The FreeBSD Foundation @@ -36,12 +15,6 @@ * notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgement: - * This product includes software developed by Powerdog Industries. - * 4. The name of Powerdog Industries may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. * * THIS SOFTWARE IS PROVIDED BY POWERDOG INDUSTRIES ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -54,6 +27,10 @@ * 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. + * + * The views and conclusions contained in the software and documentation + * are those of the authors and should not be interpreted as representing + * official policies, either expressed or implied, of Powerdog Industries. */ #include From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 20 20:17:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4E92D45C; Fri, 20 Jun 2014 20:17: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 20CB22706; Fri, 20 Jun 2014 20:17: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 s5KKH3kZ006736; Fri, 20 Jun 2014 20:17:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KKH3OW006735; Fri, 20 Jun 2014 20:17:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406202017.s5KKH3OW006735@svn.freebsd.org> From: Glen Barber Date: Fri, 20 Jun 2014 20:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267687 - stable/10/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 20:17:04 -0000 Author: gjb Date: Fri Jun 20 20:17:03 2014 New Revision: 267687 URL: http://svnweb.freebsd.org/changeset/base/267687 Log: Update list of SAs on the 10.0R errata page. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jun 20 19:57:55 2014 (r267686) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jun 20 20:17:03 2014 (r267687) @@ -153,6 +153,54 @@ OpenSSL multiple vulnerabilities + + + SA-14:07.devfs + 30 April 2014 + Fix devfs rules not applied by default for + jails + + + + SA-14:08.tcp + 30 April 2014 + Fix TCP reassembly + vulnerability + + + + SA-14:09.openssl + 30 April 2014 + Fix OpenSSL use-after-free + vulnerability + + + + SA-14:10.openssl + 15 May 2014 + Fix OpenSSL NULL pointer deference + vulnerability + + + + SA-14:11.sendmail + 3 June 2014 + Fix sendmail improper close-on-exec flag + handling + + + + SA-14:13.pam + 3 June 2014 + Fix incorrect error handling in PAM policy + parser + + + + SA-14:14.openssl + 5 June 2014 + Multiple vulnerabilities + From owner-svn-src-stable-10@FreeBSD.ORG Sat Jun 21 00:30:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3AC3C986; Sat, 21 Jun 2014 00:30: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 249842B46; Sat, 21 Jun 2014 00:30: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 s5L0UqMs028471; Sat, 21 Jun 2014 00:30:52 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5L0UpOL028469; Sat, 21 Jun 2014 00:30:51 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201406210030.s5L0UpOL028469@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 21 Jun 2014 00:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267694 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jun 2014 00:30:52 -0000 Author: np Date: Sat Jun 21 00:30:51 2014 New Revision: 267694 URL: http://svnweb.freebsd.org/changeset/base/267694 Log: MFC r267600: cxgbe(4): Fix bug in the fast rx buffer recycle path. In some cases rx buffers were getting recycled when they should have been left alone. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Fri Jun 20 21:53:50 2014 (r267693) +++ stable/10/sys/dev/cxgbe/adapter.h Sat Jun 21 00:30:51 2014 (r267694) @@ -254,7 +254,8 @@ struct cluster_metadata { struct fl_sdesc { caddr_t cl; - uint8_t nmbuf; + uint8_t nimbuf; /* # of inline mbufs with ref on the cluster */ + uint8_t nembuf; /* # of allocated mbufs with ref */ struct cluster_layout cll; }; Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Fri Jun 20 21:53:50 2014 (r267693) +++ stable/10/sys/dev/cxgbe/t4_sge.c Sat Jun 21 00:30:51 2014 (r267694) @@ -1498,22 +1498,22 @@ get_scatter_segment(struct adapter *sc, /* copy data to mbuf */ bcopy(payload, mtod(m, caddr_t), len); - } else if (sd->nmbuf * MSIZE < cll->region1) { + } else if (sd->nimbuf * MSIZE < cll->region1) { /* * There's spare room in the cluster for an mbuf. Create one - * and associate it with the payload that's in the cluster too. + * and associate it with the payload that's in the cluster. */ MPASS(clm != NULL); - m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); + m = (struct mbuf *)(sd->cl + sd->nimbuf * 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->nmbuf++; + sd->nimbuf++; } else { @@ -1527,10 +1527,11 @@ get_scatter_segment(struct adapter *sc, if (m == NULL) return (NULL); fl->mbuf_allocated++; - if (clm != NULL) + if (clm != NULL) { m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, swz->zone, sd->cl); - else { + sd->nembuf++; + } else { m_cljset(m, sd->cl, swz->type); sd->cl = NULL; /* consumed, not a recycle candidate */ } @@ -3053,7 +3054,7 @@ refill_fl(struct adapter *sc, struct sge if (sd->cl != NULL) { - if (sd->nmbuf == 0) { + if (sd->nimbuf + sd->nembuf == 0) { /* * Fast recycle without involving any atomics on * the cluster's metadata (if the cluster has @@ -3062,6 +3063,11 @@ refill_fl(struct adapter *sc, struct sge * fit within a single mbuf each. */ fl->cl_fast_recycled++; +#ifdef INVARIANTS + clm = cl_metadata(sc, fl, &sd->cll, sd->cl); + if (clm != NULL) + MPASS(clm->refcount == 1); +#endif goto recycled_fast; } @@ -3107,7 +3113,8 @@ recycled: #endif clm->refcount = 1; } - sd->nmbuf = 0; + sd->nimbuf = 0; + sd->nembuf = 0; recycled_fast: fl->pending++; fl->needed--; @@ -3176,7 +3183,7 @@ free_fl_sdesc(struct adapter *sc, struct cll = &sd->cll; clm = cl_metadata(sc, fl, cll, sd->cl); - if (sd->nmbuf == 0 || + if (sd->nimbuf + sd->nembuf == 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-stable-10@FreeBSD.ORG Sat Jun 21 01:48:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C2F8145E; Sat, 21 Jun 2014 01:48: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 A2F2D20A8; Sat, 21 Jun 2014 01:48: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 s5L1mkEL063024; Sat, 21 Jun 2014 01:48:46 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5L1mk3Z063021; Sat, 21 Jun 2014 01:48:46 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201406210148.s5L1mk3Z063021@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 21 Jun 2014 01:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267701 - stable/10/usr.bin/patch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jun 2014 01:48:47 -0000 Author: pfg Date: Sat Jun 21 01:48:45 2014 New Revision: 267701 URL: http://svnweb.freebsd.org/changeset/base/267701 Log: MFC r267426, r267464: Avoid zeroing during allocation. This change reverts a change from OpenBSD which made use of calloc, and therefore wasted time initializing arrays that will later be realloc'ed. Consistently use FreeBSD's reallocf(): - Drop some bogus casts to size_t. - The new_p_foo variables are not needed anymore. Also merge the changes from OpenBSD's manpage patch.1 Rev 1.27: "patch was moved from user portability (UP) to base in issue 7 and is no longer optional" Modified: stable/10/usr.bin/patch/patch.1 stable/10/usr.bin/patch/pch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/patch/patch.1 ============================================================================== --- stable/10/usr.bin/patch/patch.1 Sat Jun 21 01:43:56 2014 (r267700) +++ stable/10/usr.bin/patch/patch.1 Sat Jun 21 01:48:45 2014 (r267701) @@ -19,9 +19,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: patch.1,v 1.26 2010/09/03 11:09:29 jmc Exp $ +.\" $OpenBSD: patch.1,v 1.27 2014/04/15 06:26:54 jmc Exp $ .\" $FreeBSD$ -.Dd January 29, 2013 +.Dd June 12, 2014 .Dt PATCH 1 .Os .Sh NAME @@ -639,13 +639,10 @@ The .Nm utility is compliant with the .St -p1003.1-2008 -specification -(except as detailed above for the +specification, +except as detailed above for the .Fl -posix -option), -though the presence of -.Nm -itself is optional. +option. .Pp The flags .Op Fl BCEFfstVvxz Modified: stable/10/usr.bin/patch/pch.c ============================================================================== --- stable/10/usr.bin/patch/pch.c Sat Jun 21 01:43:56 2014 (r267700) +++ stable/10/usr.bin/patch/pch.c Sat Jun 21 01:48:45 2014 (r267701) @@ -132,11 +132,11 @@ void set_hunkmax(void) { if (p_line == NULL) - p_line = calloc((size_t) hunkmax, sizeof(char *)); + p_line = malloc(hunkmax * sizeof(char *)); if (p_len == NULL) - p_len = calloc((size_t) hunkmax, sizeof(short)); + p_len = malloc(hunkmax * sizeof(short)); if (p_char == NULL) - p_char = calloc((size_t) hunkmax, sizeof(char)); + p_char = malloc(hunkmax * sizeof(char)); } /* @@ -145,31 +145,14 @@ set_hunkmax(void) static void grow_hunkmax(void) { - int new_hunkmax; - char **new_p_line; - short *new_p_len; - char *new_p_char; - - new_hunkmax = hunkmax * 2; + int new_hunkmax = hunkmax * 2; if (p_line == NULL || p_len == NULL || p_char == NULL) fatal("Internal memory allocation error\n"); - new_p_line = realloc(p_line, new_hunkmax * sizeof(char *)); - if (new_p_line == NULL) - free(p_line); - - new_p_len = realloc(p_len, new_hunkmax * sizeof(short)); - if (new_p_len == NULL) - free(p_len); - - new_p_char = realloc(p_char, new_hunkmax * sizeof(char)); - if (new_p_char == NULL) - free(p_char); - - p_char = new_p_char; - p_len = new_p_len; - p_line = new_p_line; + p_line = reallocf(p_line, new_hunkmax * sizeof(char *)); + p_len = reallocf(p_len, new_hunkmax * sizeof(short)); + p_char = reallocf(p_char, new_hunkmax * sizeof(char)); if (p_line != NULL && p_len != NULL && p_char != NULL) { hunkmax = new_hunkmax; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 08:30:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 62AE1EB5; Sun, 22 Jun 2014 08:30: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 4ECCF20A8; Sun, 22 Jun 2014 08:30: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 s5M8UikS009556; Sun, 22 Jun 2014 08:30:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5M8Ui6j009555; Sun, 22 Jun 2014 08:30:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406220830.s5M8Ui6j009555@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Jun 2014 08:30:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267713 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 08:30:44 -0000 Author: kib Date: Sun Jun 22 08:30:43 2014 New Revision: 267713 URL: http://svnweb.freebsd.org/changeset/base/267713 Log: MFC r267255: Change the nblock mutex to rwlock. MFC r267264: Devolatile as needed. Modified: stable/10/sys/kern/vfs_bio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_bio.c ============================================================================== --- stable/10/sys/kern/vfs_bio.c Sun Jun 22 06:54:36 2014 (r267712) +++ stable/10/sys/kern/vfs_bio.c Sun Jun 22 08:30:43 2014 (r267713) @@ -251,7 +251,7 @@ static struct mtx_padalign rbreqlock; /* * Lock that protects needsbuffer and the sleeps/wakeups surrounding it. */ -static struct mtx_padalign nblock; +static struct rwlock_padalign nblock; /* * Lock that protects bdirtywait. @@ -296,7 +296,7 @@ static int runningbufreq; * Used in numdirtywakeup(), bufspacewakeup(), bufcountadd(), bwillwrite(), * getnewbuf(), and getblk(). */ -static int needsbuffer; +static volatile int needsbuffer; /* * Synchronization for bwillwrite() waiters. @@ -426,18 +426,27 @@ bdirtyadd(void) static __inline void bufspacewakeup(void) { + int need_wakeup, on; /* * If someone is waiting for BUF space, wake them up. Even * though we haven't freed the kva space yet, the waiting * process will be able to now. */ - mtx_lock(&nblock); - if (needsbuffer & VFS_BIO_NEED_BUFSPACE) { - needsbuffer &= ~VFS_BIO_NEED_BUFSPACE; - wakeup(&needsbuffer); + rw_rlock(&nblock); + for (;;) { + need_wakeup = 0; + on = needsbuffer; + if ((on & VFS_BIO_NEED_BUFSPACE) == 0) + break; + need_wakeup = 1; + if (atomic_cmpset_rel_int(&needsbuffer, on, + on & ~VFS_BIO_NEED_BUFSPACE)) + break; } - mtx_unlock(&nblock); + if (need_wakeup) + wakeup(__DEVOLATILE(void *, &needsbuffer)); + rw_runlock(&nblock); } /* @@ -497,7 +506,7 @@ runningbufwakeup(struct buf *bp) static __inline void bufcountadd(struct buf *bp) { - int old; + int mask, need_wakeup, old, on; KASSERT((bp->b_flags & B_INFREECNT) == 0, ("buf %p already counted as free", bp)); @@ -505,14 +514,22 @@ bufcountadd(struct buf *bp) old = atomic_fetchadd_int(&numfreebuffers, 1); KASSERT(old >= 0 && old < nbuf, ("numfreebuffers climbed to %d", old + 1)); - mtx_lock(&nblock); - if (needsbuffer) { - needsbuffer &= ~VFS_BIO_NEED_ANY; - if (numfreebuffers >= hifreebuffers) - needsbuffer &= ~VFS_BIO_NEED_FREE; - wakeup(&needsbuffer); + mask = VFS_BIO_NEED_ANY; + if (numfreebuffers >= hifreebuffers) + mask |= VFS_BIO_NEED_FREE; + rw_rlock(&nblock); + for (;;) { + need_wakeup = 0; + on = needsbuffer; + if (on == 0) + break; + need_wakeup = 1; + if (atomic_cmpset_rel_int(&needsbuffer, on, on & ~mask)) + break; } - mtx_unlock(&nblock); + if (need_wakeup) + wakeup(__DEVOLATILE(void *, &needsbuffer)); + rw_runlock(&nblock); } /* @@ -756,7 +773,7 @@ bufinit(void) mtx_init(&bqclean, "bufq clean lock", NULL, MTX_DEF); mtx_init(&bqdirty, "bufq dirty lock", NULL, MTX_DEF); mtx_init(&rbreqlock, "runningbufspace lock", NULL, MTX_DEF); - mtx_init(&nblock, "needsbuffer lock", NULL, MTX_DEF); + rw_init(&nblock, "needsbuffer lock"); mtx_init(&bdlock, "buffer daemon lock", NULL, MTX_DEF); mtx_init(&bdirtylock, "dirty buf lock", NULL, MTX_DEF); @@ -2054,9 +2071,7 @@ getnewbuf_bufd_help(struct vnode *vp, in waitmsg = "newbuf"; flags = VFS_BIO_NEED_ANY; } - mtx_lock(&nblock); - needsbuffer |= flags; - mtx_unlock(&nblock); + atomic_set_int(&needsbuffer, flags); mtx_unlock(&bqclean); bd_speedup(); /* heeeelp */ @@ -2066,12 +2081,11 @@ getnewbuf_bufd_help(struct vnode *vp, in td = curthread; cnt = 0; wait = MNT_NOWAIT; - mtx_lock(&nblock); - while (needsbuffer & flags) { + rw_wlock(&nblock); + while ((needsbuffer & flags) != 0) { if (vp != NULL && vp->v_type != VCHR && (td->td_pflags & TDP_BUFNEED) == 0) { - mtx_unlock(&nblock); - + rw_wunlock(&nblock); /* * getblk() is called with a vnode locked, and * some majority of the dirty buffers may as @@ -2093,15 +2107,16 @@ getnewbuf_bufd_help(struct vnode *vp, in atomic_add_long(¬bufdflushes, 1); curthread_pflags_restore(norunbuf); } - mtx_lock(&nblock); + rw_wlock(&nblock); if ((needsbuffer & flags) == 0) break; } - if (msleep(&needsbuffer, &nblock, (PRIBIO + 4) | slpflag, - waitmsg, slptimeo)) + error = rw_sleep(__DEVOLATILE(void *, &needsbuffer), &nblock, + (PRIBIO + 4) | slpflag, waitmsg, slptimeo); + if (error != 0) break; } - mtx_unlock(&nblock); + rw_wunlock(&nblock); } static void From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 08:32:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 35CF3FEA; Sun, 22 Jun 2014 08:32: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 08C67211E; Sun, 22 Jun 2014 08:32: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 s5M8WVAw012039; Sun, 22 Jun 2014 08:32:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5M8WV4k012038; Sun, 22 Jun 2014 08:32:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406220832.s5M8WV4k012038@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Jun 2014 08:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267714 - stable/10/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 08:32:32 -0000 Author: kib Date: Sun Jun 22 08:32:31 2014 New Revision: 267714 URL: http://svnweb.freebsd.org/changeset/base/267714 Log: MFC r267492: Fix some cosmetic issues with the use of kmem_malloc() in the i386 LDT sysarch(2) code. Modified: stable/10/sys/i386/i386/sys_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/sys_machdep.c ============================================================================== --- stable/10/sys/i386/i386/sys_machdep.c Sun Jun 22 08:30:43 2014 (r267713) +++ stable/10/sys/i386/i386/sys_machdep.c Sun Jun 22 08:32:31 2014 (r267714) @@ -164,19 +164,14 @@ sysarch(td, uap) break; case I386_SET_LDT: if (kargs.largs.descs != NULL) { - lp = (union descriptor *)kmem_malloc(kernel_arena, + lp = (union descriptor *)malloc( kargs.largs.num * sizeof(union descriptor), - M_WAITOK); - if (lp == NULL) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(kargs.largs.descs, lp, kargs.largs.num * sizeof(union descriptor)); if (error == 0) error = i386_set_ldt(td, &kargs.largs, lp); - kmem_free(kernel_arena, (vm_offset_t)lp, - kargs.largs.num * sizeof(union descriptor)); + free(lp, M_TEMP); } else { error = i386_set_ldt(td, &kargs.largs, NULL); } @@ -300,10 +295,7 @@ i386_extend_pcb(struct thread *td) }; ext = (struct pcb_ext *)kmem_malloc(kernel_arena, ctob(IOPAGES+1), - M_WAITOK); - if (ext == 0) - return (ENOMEM); - bzero(ext, sizeof(struct pcb_ext)); + M_WAITOK | M_ZERO); /* -16 is so we can convert a trapframe into vm86trapframe inplace */ ext->ext_tss.tss_esp0 = td->td_kstack + ctob(KSTACK_PAGES) - sizeof(struct pcb) - 16; @@ -474,12 +466,7 @@ user_ldt_alloc(struct mdproc *mdp, int l new_ldt->ldt_len = len = NEW_MAX_LD(len); new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, - round_page(len * sizeof(union descriptor)), M_WAITOK); - if (new_ldt->ldt_base == NULL) { - free(new_ldt, M_SUBPROC); - mtx_lock_spin(&dt_lock); - return (NULL); - } + round_page(len * sizeof(union descriptor)), M_WAITOK); new_ldt->ldt_refcnt = 1; new_ldt->ldt_active = 0; @@ -514,12 +501,7 @@ user_ldt_alloc(struct mdproc *mdp, int l new_ldt->ldt_len = len = NEW_MAX_LD(len); new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, - len * sizeof(union descriptor), M_WAITOK); - if (new_ldt->ldt_base == NULL) { - free(new_ldt, M_SUBPROC); - mtx_lock_spin(&dt_lock); - return (NULL); - } + len * sizeof(union descriptor), M_WAITOK); new_ldt->ldt_refcnt = 1; new_ldt->ldt_active = 0; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:21:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BFE1A848; Sun, 22 Jun 2014 16:21: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 93040220F; Sun, 22 Jun 2014 16:21: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 s5MGLFJk034259; Sun, 22 Jun 2014 16:21:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGLFJa034257; Sun, 22 Jun 2014 16:21:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221621.s5MGLFJa034257@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267720 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:21:15 -0000 Author: tuexen Date: Sun Jun 22 16:21:14 2014 New Revision: 267720 URL: http://svnweb.freebsd.org/changeset/base/267720 Log: MFC r262252: Remove redundant code and fix a style error. Modified: stable/10/sys/netinet/sctp_input.c stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Sun Jun 22 15:15:52 2014 (r267719) +++ stable/10/sys/netinet/sctp_input.c Sun Jun 22 16:21:14 2014 (r267720) @@ -439,7 +439,6 @@ sctp_process_init_ack(struct mbuf *m, in /* First verify that we have no illegal param's */ abort_flag = 0; - op_err = NULL; op_err = sctp_arethere_unrecognized_parameters(m, (offset + sizeof(struct sctp_init_chunk)), @@ -1553,8 +1552,7 @@ sctp_process_cookie_existing(struct mbuf return (NULL); } - switch SCTP_GET_STATE - (asoc) { + switch (SCTP_GET_STATE(asoc)) { case SCTP_STATE_COOKIE_WAIT: case SCTP_STATE_COOKIE_ECHOED: /* @@ -1644,7 +1642,7 @@ sctp_process_cookie_existing(struct mbuf * have simply lost the COOKIE-ACK */ break; - } /* end switch */ + } /* end switch */ sctp_stop_all_cookie_timers(stcb); /* * We ignore the return code here.. not sure if we should Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Jun 22 15:15:52 2014 (r267719) +++ stable/10/sys/netinet/sctp_output.c Sun Jun 22 16:21:14 2014 (r267720) @@ -3671,7 +3671,6 @@ sctp_add_cookie(struct mbuf *init, int i int sig_offset; uint16_t cookie_sz; - mret = NULL; mret = sctp_get_mbuf_for_msg((sizeof(struct sctp_state_cookie) + sizeof(struct sctp_paramhdr)), 0, M_NOWAIT, 1, MT_DATA); @@ -8960,7 +8959,6 @@ sctp_send_cookie_ack(struct sctp_tcb *st struct sctp_chunkhdr *hdr; struct sctp_tmit_chunk *chk; - cookie_ack = NULL; SCTP_TCB_LOCK_ASSERT(stcb); cookie_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_NOWAIT, 1, MT_HEADER); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:22:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A725B9BD; Sun, 22 Jun 2014 16:22: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 9423C222D; Sun, 22 Jun 2014 16:22: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 s5MGMitw034565; Sun, 22 Jun 2014 16:22:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGMitR034564; Sun, 22 Jun 2014 16:22:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221622.s5MGMitR034564@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267721 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:22:44 -0000 Author: tuexen Date: Sun Jun 22 16:22:44 2014 New Revision: 267721 URL: http://svnweb.freebsd.org/changeset/base/267721 Log: MFC r263094: SCTP uses CRC32C and not Adler anymore. While there change the reference to RFC 4960. This does not change any code, just comments. Modified: stable/10/sys/netinet/sctp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp.h ============================================================================== --- stable/10/sys/netinet/sctp.h Sun Jun 22 16:21:14 2014 (r267720) +++ stable/10/sys/netinet/sctp.h Sun Jun 22 16:22:44 2014 (r267721) @@ -43,13 +43,13 @@ __FBSDID("$FreeBSD$"); #define SCTP_PACKED __attribute__((packed)) /* - * SCTP protocol - RFC2960. + * SCTP protocol - RFC4960. */ struct sctphdr { uint16_t src_port; /* source port */ uint16_t dest_port; /* destination port */ uint32_t v_tag; /* verification tag of packet */ - uint32_t checksum; /* Adler32 C-Sum */ + uint32_t checksum; /* CRC32C checksum */ /* chunks follow... */ } SCTP_PACKED; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:26:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8DA26AF9; Sun, 22 Jun 2014 16:26: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 60CE7223A; Sun, 22 Jun 2014 16:26: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 s5MGQHJ8035103; Sun, 22 Jun 2014 16:26:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGQH4v035102; Sun, 22 Jun 2014 16:26:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221626.s5MGQH4v035102@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267722 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:26:17 -0000 Author: tuexen Date: Sun Jun 22 16:26:16 2014 New Revision: 267722 URL: http://svnweb.freebsd.org/changeset/base/267722 Log: MFC r263096: Put the offset of the CRC32C in csum_data instead of 0. The virtio driver needs the offset to be stored in csum_data, like in the case for UDP and TCP. The virtio problem was reported by Niu Zhixiong , who helped in debugging and testing the patch. Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Jun 22 16:22:44 2014 (r267721) +++ stable/10/sys/netinet/sctp_output.c Sun Jun 22 16:26:16 2014 (r267722) @@ -4108,7 +4108,7 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_STAT_INCR(sctps_sendnocrc); #else m->m_pkthdr.csum_flags = CSUM_SCTP; - m->m_pkthdr.csum_data = 0; + m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); #endif } @@ -4457,7 +4457,7 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_STAT_INCR(sctps_sendnocrc); #else m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; - m->m_pkthdr.csum_data = 0; + m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); #endif } @@ -11007,7 +11007,7 @@ sctp_send_resp_msg(struct sockaddr *src, SCTP_STAT_INCR(sctps_sendnocrc); #else mout->m_pkthdr.csum_flags = CSUM_SCTP; - mout->m_pkthdr.csum_data = 0; + mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); #endif } @@ -11037,7 +11037,7 @@ sctp_send_resp_msg(struct sockaddr *src, SCTP_STAT_INCR(sctps_sendnocrc); #else mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; - mout->m_pkthdr.csum_data = 0; + mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); #endif } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:28:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8D8EAC43; Sun, 22 Jun 2014 16: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 78C8B2248; Sun, 22 Jun 2014 16: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 s5MGSrSG035481; Sun, 22 Jun 2014 16:28:53 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGSqMR035474; Sun, 22 Jun 2014 16:28:52 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221628.s5MGSqMR035474@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267723 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:28:53 -0000 Author: tuexen Date: Sun Jun 22 16:28:52 2014 New Revision: 267723 URL: http://svnweb.freebsd.org/changeset/base/267723 Log: MFC r263237: * Provide information in error causes in ASCII instead of proprietary binary format. * Add support for a diagnostic information error cause. The code is sysctlable and the default is 0, which means it is not sent. This is joint work with rrs@. Modified: stable/10/sys/netinet/sctp.h stable/10/sys/netinet/sctp_constants.h stable/10/sys/netinet/sctp_indata.c stable/10/sys/netinet/sctp_input.c stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_pcb.c stable/10/sys/netinet/sctp_sysctl.c stable/10/sys/netinet/sctp_sysctl.h stable/10/sys/netinet/sctp_timer.c stable/10/sys/netinet/sctp_usrreq.c stable/10/sys/netinet/sctputil.c stable/10/sys/netinet/sctputil.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp.h ============================================================================== --- stable/10/sys/netinet/sctp.h Sun Jun 22 16:26:16 2014 (r267722) +++ stable/10/sys/netinet/sctp.h Sun Jun 22 16:28:52 2014 (r267723) @@ -365,6 +365,12 @@ struct sctp_paramhdr { /* * error cause parameters (user visible) */ +struct sctp_gen_error_cause { + uint16_t code; + uint16_t length; + uint8_t info[]; +} SCTP_PACKED; + struct sctp_error_cause { uint16_t code; uint16_t length; Modified: stable/10/sys/netinet/sctp_constants.h ============================================================================== --- stable/10/sys/netinet/sctp_constants.h Sun Jun 22 16:26:16 2014 (r267722) +++ stable/10/sys/netinet/sctp_constants.h Sun Jun 22 16:28:52 2014 (r267723) @@ -771,6 +771,9 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_DEFAULT_SPLIT_POINT_MIN 2904 +/* Maximum length of diagnostic information in error causes */ +#define SCTP_DIAG_INFO_LEN 64 + /* ABORT CODES and other tell-tale location * codes are generated by adding the below * to the instance id. Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Sun Jun 22 16:26:16 2014 (r267722) +++ stable/10/sys/netinet/sctp_indata.c Sun Jun 22 16:28:52 2014 (r267723) @@ -561,7 +561,8 @@ sctp_queue_data_to_stream(struct sctp_tc struct sctp_queued_to_read *at; int queue_needed; uint16_t nxt_todel; - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; queue_needed = 1; asoc->size_on_all_streams += control->length; @@ -578,7 +579,7 @@ sctp_queue_data_to_stream(struct sctp_tc (uint32_t) nxt_todel); if (SCTP_SSN_GE(strm->last_sequence_delivered, control->sinfo_ssn)) { /* The incoming sseq is behind where we last delivered? */ - SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d from peer, Abort association\n", + SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d from peer, Abort association\n", control->sinfo_ssn, strm->last_sequence_delivered); protocol_error: /* @@ -586,26 +587,12 @@ protocol_error: * association destruction */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - (sizeof(uint32_t) * 3); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_1); - ippp++; - *ippp = control->sinfo_tsn; - ippp++; - *ippp = ((control->sinfo_stream << 16) | control->sinfo_ssn); - } + snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + strm->last_sequence_delivered, control->sinfo_tsn, + control->sinfo_stream, control->sinfo_ssn); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_1; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; @@ -839,7 +826,9 @@ static void sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_tmit_chunk *chk, int *abort_flag) { - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; + uint32_t cum_ackp1, prev_tsn, post_tsn; struct sctp_tmit_chunk *at, *prev, *next; @@ -864,30 +853,14 @@ sctp_queue_data_for_reasm(struct sctp_tc * a FIRST fragment mark. */ SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, its not first, no fragmented delivery in progress\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (sizeof(uint32_t) * 3); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_2); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Expected B-bit for TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } else if (asoc->fragmented_delivery_inprogress && (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) == SCTP_DATA_FIRST_FRAG) { @@ -897,28 +870,14 @@ sctp_queue_data_for_reasm(struct sctp_tc * MIDDLE fragment NOT a FIRST */ SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it IS a first and fragmented delivery in progress\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_3); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Didn't expect B-bit for TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } else if (asoc->fragmented_delivery_inprogress) { /* @@ -931,30 +890,15 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it IS not same stream number %d vs %d\n", chk->rec.data.stream_number, asoc->str_of_pdapi); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (sizeof(uint32_t) * 3); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_4); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Expected SID=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + asoc->str_of_pdapi, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_4; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } else if ((asoc->fragment_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED && @@ -963,31 +907,15 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it IS not same stream seq %d vs %d\n", chk->rec.data.stream_seq, asoc->ssn_of_pdapi); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_5); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Expected SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + asoc->ssn_of_pdapi, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_5; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } } @@ -1057,31 +985,14 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTP_DATA_FIRST_FRAG) { SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - It can be a midlle or last but not a first\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it's a FIRST!\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_6); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Can't handle B-bit, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_6; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1091,33 +1002,18 @@ sctp_queue_data_for_reasm(struct sctp_tc * Huh, need the correct STR here, * they must be the same. */ - SCTP_PRINTF("Prev check - Gak, Evil plot, ssn:%d not the same as at:%d\n", + SCTP_PRINTF("Prev check - Gak, Evil plot, sid:%d not the same as at:%d\n", chk->rec.data.stream_number, prev->rec.data.stream_number); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_7); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Expect SID=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + prev->rec.data.stream_number, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_7; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1131,30 +1027,15 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - Gak, Evil plot, sseq:%d not the same as at:%d\n", chk->rec.data.stream_seq, prev->rec.data.stream_seq); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_8); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Expect SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + prev->rec.data.stream_seq, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_8; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1164,31 +1045,14 @@ sctp_queue_data_for_reasm(struct sctp_tc if ((chk->rec.data.rcv_flags & SCTP_DATA_FRAG_MASK) != SCTP_DATA_FIRST_FRAG) { SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - Gak, evil plot, its not FIRST and it must be!\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_9); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Expect B-bit, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_9; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1208,30 +1072,14 @@ sctp_queue_data_for_reasm(struct sctp_tc != SCTP_DATA_LAST_FRAG) { SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Next is FIRST, we must be LAST\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, its not a last!\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_10); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Expect only E-bit, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_10; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1247,31 +1095,14 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTP_DATA_LAST_FRAG) { SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Next is a MIDDLE/LAST\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, new prev chunk is a LAST\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_11); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Didn't expect E-bit, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_11; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1284,31 +1115,15 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Gak, Evil plot, ssn:%d not the same as at:%d\n", chk->rec.data.stream_number, next->rec.data.stream_number); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_12); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Required SID %4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + next->rec.data.stream_number, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_12; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1322,30 +1137,15 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Gak, Evil plot, sseq:%d not the same as at:%d\n", chk->rec.data.stream_seq, next->rec.data.stream_seq); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_13); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Required SSN %4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + next->rec.data.stream_seq, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_13; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1430,7 +1230,8 @@ sctp_process_a_data_chunk(struct sctp_tc int the_len; int need_reasm_check = 0; uint16_t strmno, strmseq; - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; struct sctp_queued_to_read *control; int ordered; uint32_t protocol_id; @@ -1497,15 +1298,12 @@ sctp_process_a_data_chunk(struct sctp_tc */ if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || - (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) - ) { + (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET))) { /* * wait a minute, this guy is gone, there is no longer a * receiver. Send peer an ABORT! */ - struct mbuf *op_err; - - op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); @@ -1633,27 +1431,13 @@ sctp_process_a_data_chunk(struct sctp_tc /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ:%d delivered:%d from peer, Abort!\n", strmseq, asoc->strmin[strmno].last_sequence_delivered); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_14); - ippp++; - *ippp = tsn; - ippp++; - *ippp = ((strmno << 16) | strmseq); - } + snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + asoc->strmin[strmno].last_sequence_delivered, + tsn, strmno, strmseq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_14; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } @@ -1892,28 +1676,11 @@ failed_pdapi_express_del: control->whoFrom = NULL; } sctp_free_a_readq(stcb, control); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_15); - ippp++; - *ippp = tsn; - ippp++; - *ippp = ((strmno << 16) | strmseq); - } + snprintf(msg, sizeof(msg), "Reas. queue emtpy, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + tsn, strmno, strmseq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } else { @@ -1925,31 +1692,11 @@ failed_pdapi_express_del: control->whoFrom = NULL; } sctp_free_a_readq(stcb, control); - - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_16); - ippp++; - *ippp = tsn; - ippp++; - *ippp = ((strmno << 16) | strmseq); - } + snprintf(msg, sizeof(msg), "PD ongoing, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + tsn, strmno, strmseq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } @@ -1971,30 +1718,11 @@ failed_pdapi_express_del: control->whoFrom = NULL; } sctp_free_a_readq(stcb, control); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_17); - ippp++; - *ippp = tsn; - ippp++; - *ippp = ((strmno << 16) | strmseq); - } + snprintf(msg, sizeof(msg), "No PD ongoing, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + tsn, strmno, strmseq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } @@ -2601,26 +2329,11 @@ sctp_process_data(struct mbuf **mm, int * invalid data chunk. */ struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 2 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - - if (op_err) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr) + - (2 * sizeof(uint32_t)); - ph = mtod(op_err, struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_19); - ippp++; - *ippp = asoc->cumulative_tsn; - - } + snprintf(msg, sizeof(msg), "DATA chunk of length %d", + chk_length); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, @@ -2688,7 +2401,7 @@ sctp_process_data(struct mbuf **mm, int if (SCTP_BASE_SYSCTL(sctp_strict_data_order)) { struct mbuf *op_err; - op_err = sctp_generate_invmanparam(SCTP_CAUSE_PROTOCOL_VIOLATION); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, @@ -3837,7 +3550,8 @@ sctp_express_handle_sack(struct sctp_tcb } if (SCTP_TSN_GE(cumack, send_s)) { #ifndef INVARIANTS - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; #endif #ifdef INVARIANTS @@ -3846,22 +3560,11 @@ sctp_express_handle_sack(struct sctp_tcb *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - sizeof(uint32_t); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_25); - } + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal then TSN %8.8x", + cumack, send_s); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; #endif } @@ -4211,23 +3914,14 @@ again: (asoc->stream_queue_cnt == 0)) { if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { /* Need to abort here */ - struct mbuf *oper; + struct mbuf *op_err; abort_out_now: *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - } + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); } else { struct sctp_nets *netp; @@ -4420,7 +4114,8 @@ sctp_handle_sack(struct mbuf *m, int off send_s = asoc->sending_seq; } if (SCTP_TSN_GE(cum_ack, send_s)) { - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; /* * no way, we have not even sent this TSN out yet. @@ -4435,22 +4130,11 @@ sctp_handle_sack(struct mbuf *m, int off hopeless_peer: *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - sizeof(uint32_t); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_25); - } + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal then TSN %8.8x", + cum_ack, send_s); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } } @@ -4939,23 +4623,14 @@ sctp_handle_sack(struct mbuf *m, int off (asoc->stream_queue_cnt == 0)) { if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { /* Need to abort here */ - struct mbuf *oper; + struct mbuf *op_err; abort_out_now: *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - } + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_31; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } else { struct sctp_nets *netp; @@ -5384,33 +5059,20 @@ sctp_handle_forward_tsn(struct sctp_tcb asoc->cumulative_tsn = new_cum_tsn; if (gap >= m_size) { if ((long)gap > sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv)) { - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; /* * out of range (of single byte chunks in the rwnd I * give out). This must be an attacker. */ *abort_flag = 1; - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - (sizeof(uint32_t) * 3); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_33); - ippp++; - *ippp = asoc->highest_tsn_inside_map; - ippp++; - *ippp = new_cum_tsn; - } + snprintf(msg, sizeof(msg), + "New cum ack %8.8x too high, highest TSN %8.8x", + new_cum_tsn, asoc->highest_tsn_inside_map); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_33; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } SCTP_STAT_INCR(sctps_fwdtsn_map_over); Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Sun Jun 22 16:26:16 2014 (r267722) +++ stable/10/sys/netinet/sctp_input.c Sun Jun 22 16:28:52 2014 (r267723) @@ -97,7 +97,7 @@ sctp_handle_init(struct mbuf *m, int iph } /* validate length */ if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { - op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); @@ -109,7 +109,7 @@ sctp_handle_init(struct mbuf *m, int iph init = &cp->init; if (init->initiate_tag == 0) { /* protocol error... send abort */ - op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); @@ -119,7 +119,7 @@ sctp_handle_init(struct mbuf *m, int iph } if (ntohl(init->a_rwnd) < SCTP_MIN_RWND) { /* invalid parameter... send abort */ - op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); @@ -129,7 +129,7 @@ sctp_handle_init(struct mbuf *m, int iph } if (init->num_inbound_streams == 0) { /* protocol error... send abort */ - op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); @@ -139,7 +139,7 @@ sctp_handle_init(struct mbuf *m, int iph } if (init->num_outbound_streams == 0) { /* protocol error... send abort */ - op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); @@ -150,7 +150,9 @@ sctp_handle_init(struct mbuf *m, int iph if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, NULL, + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "Problem with AUTH parameters"); + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -179,7 +181,9 @@ sctp_handle_init(struct mbuf *m, int iph * state :-) */ if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { - sctp_send_abort(m, iphlen, src, dst, sh, 0, NULL, + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "No listener"); + sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:30:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 34BC5D88; Sun, 22 Jun 2014 16:30: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 07E6822CE; Sun, 22 Jun 2014 16:30: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 s5MGUqrJ038014; Sun, 22 Jun 2014 16:30:52 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGUqAU038009; Sun, 22 Jun 2014 16:30:52 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221630.s5MGUqAU038009@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267724 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:30:53 -0000 Author: tuexen Date: Sun Jun 22 16:30:52 2014 New Revision: 267724 URL: http://svnweb.freebsd.org/changeset/base/267724 Log: MFC r263921: Use SCTP_OVER_UDP_TUNNELING_PORT more consistently. Modified: stable/10/sys/netinet/sctp_constants.h stable/10/sys/netinet/sctp_sysctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_constants.h ============================================================================== --- stable/10/sys/netinet/sctp_constants.h Sun Jun 22 16:28:52 2014 (r267723) +++ stable/10/sys/netinet/sctp_constants.h Sun Jun 22 16:30:52 2014 (r267724) @@ -36,16 +36,10 @@ __FBSDID("$FreeBSD$"); #ifndef _NETINET_SCTP_CONSTANTS_H_ #define _NETINET_SCTP_CONSTANTS_H_ + /* IANA assigned port number for SCTP over UDP encapsulation */ -/* For freebsd we cannot bind the port at - * startup. Otherwise what will happen is - * we really won't be bound. The user must - * put it into the sysctl... or we need - * to build a special timer for this to allow - * us to wait 1 second or so after the system - * comes up. - */ -#define SCTP_OVER_UDP_TUNNELING_PORT 0 +#define SCTP_OVER_UDP_TUNNELING_PORT 9899 + /* Number of packets to get before sack sent by default */ #define SCTP_DEFAULT_SACK_FREQ 2 Modified: stable/10/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/10/sys/netinet/sctp_sysctl.h Sun Jun 22 16:28:52 2014 (r267723) +++ stable/10/sys/netinet/sctp_sysctl.h Sun Jun 22 16:30:52 2014 (r267724) @@ -466,7 +466,7 @@ struct sctp_sysctl { #define SCTPCTL_UDP_TUNNELING_PORT_DESC "Set the SCTP/UDP tunneling port" #define SCTPCTL_UDP_TUNNELING_PORT_MIN 0 #define SCTPCTL_UDP_TUNNELING_PORT_MAX 65535 -#define SCTPCTL_UDP_TUNNELING_PORT_DEFAULT SCTP_OVER_UDP_TUNNELING_PORT +#define SCTPCTL_UDP_TUNNELING_PORT_DEFAULT 0 /* Enable sending of the SACK-IMMEDIATELY bit */ #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC "Enable sending of the SACK-IMMEDIATELY-bit." From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:32:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E5E5EEC5; Sun, 22 Jun 2014 16:32: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 D31C522DC; Sun, 22 Jun 2014 16:32: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 s5MGWfQZ039219; Sun, 22 Jun 2014 16:32:41 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGWfhn039218; Sun, 22 Jun 2014 16:32:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221632.s5MGWfhn039218@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267725 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:32:42 -0000 Author: tuexen Date: Sun Jun 22 16:32:41 2014 New Revision: 267725 URL: http://svnweb.freebsd.org/changeset/base/267725 Log: MFC r263922: Handle an edge case of address management similar to TCP. This needs to be reconsidered when the address handling will be reimplemented. The patch is from rrs@. Modified: stable/10/sys/netinet/sctp_pcb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Sun Jun 22 16:30:52 2014 (r267724) +++ stable/10/sys/netinet/sctp_pcb.c Sun Jun 22 16:32:41 2014 (r267725) @@ -772,7 +772,14 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, } SCTPDBG(SCTP_DEBUG_PCB4, "Deleting ifa %p\n", (void *)sctp_ifap); sctp_ifap->localifa_flags &= SCTP_ADDR_VALID; - sctp_ifap->localifa_flags |= SCTP_BEING_DELETED; + /* + * We don't set the flag. This means that the structure will + * hang around in EP's that have bound specific to it until + * they close. This gives us TCP like behavior if someone + * removes an address (or for that matter adds it right + * back). + */ + /* sctp_ifap->localifa_flags |= SCTP_BEING_DELETED; */ vrf->total_ifa_count--; LIST_REMOVE(sctp_ifap, next_bucket); sctp_remove_ifa_from_ifn(sctp_ifap); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:34:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 53246FFE; Sun, 22 Jun 2014 16:34: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 405A622E5; Sun, 22 Jun 2014 16:34: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 s5MGYSXX039552; Sun, 22 Jun 2014 16:34:28 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGYS0F039551; Sun, 22 Jun 2014 16:34:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221634.s5MGYS0F039551@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267726 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:34:28 -0000 Author: tuexen Date: Sun Jun 22 16:34:27 2014 New Revision: 267726 URL: http://svnweb.freebsd.org/changeset/base/267726 Log: MFC r264017: Increment the SSN only after processing the last fragment of an ordered user message. Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Jun 22 16:32:41 2014 (r267725) +++ stable/10/sys/netinet/sctp_output.c Sun Jun 22 16:34:27 2014 (r267726) @@ -7367,7 +7367,8 @@ dont_do_it: chk->pad_inplace = 0; chk->no_fr_allowed = 0; chk->rec.data.stream_seq = strq->next_sequence_send; - if (rcv_flags & SCTP_DATA_LAST_FRAG) { + if ((rcv_flags & SCTP_DATA_LAST_FRAG) && + !(rcv_flags & SCTP_DATA_UNORDERED)) { strq->next_sequence_send++; } chk->rec.data.stream_number = sp->stream; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:36:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1A3652F7; Sun, 22 Jun 2014 16:36: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 0781D22EC; Sun, 22 Jun 2014 16:36: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 s5MGaEpk039957; Sun, 22 Jun 2014 16:36:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGaEGa039956; Sun, 22 Jun 2014 16:36:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221636.s5MGaEGa039956@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267728 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:36:15 -0000 Author: tuexen Date: Sun Jun 22 16:36:14 2014 New Revision: 267728 URL: http://svnweb.freebsd.org/changeset/base/267728 Log: MFC r264241: Call sctp_addr_change() from rt_addrmsg() instead of rt_newaddrmsg_fib(), since rt_addrmsg() gets also called from other functions. Modified: stable/10/sys/net/route.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/route.c ============================================================================== --- stable/10/sys/net/route.c Sun Jun 22 16:35:03 2014 (r267727) +++ stable/10/sys/net/route.c Sun Jun 22 16:36:14 2014 (r267728) @@ -1780,6 +1780,16 @@ rt_addrmsg(int cmd, struct ifaddr *ifa, KASSERT(fibnum == RT_ALL_FIBS || (fibnum >= 0 && fibnum < rt_numfibs), ("%s: fib out of range 0 <=%d<%d", __func__, fibnum, rt_numfibs)); +#if defined(INET) || defined(INET6) +#ifdef SCTP + /* + * notify the SCTP stack + * this will only get called when an address is added/deleted + * XXX pass the ifaddr struct instead if ifa->ifa_addr... + */ + sctp_addr_change(ifa, cmd); +#endif /* SCTP */ +#endif return (rtsock_addrmsg(cmd, ifa, fibnum)); } @@ -1830,16 +1840,6 @@ rt_newaddrmsg_fib(int cmd, struct ifaddr KASSERT(fibnum == RT_ALL_FIBS || (fibnum >= 0 && fibnum < rt_numfibs), ("%s: fib out of range 0 <=%d<%d", __func__, fibnum, rt_numfibs)); -#if defined(INET) || defined(INET6) -#ifdef SCTP - /* - * notify the SCTP stack - * this will only get called when an address is added/deleted - * XXX pass the ifaddr struct instead if ifa->ifa_addr... - */ - sctp_addr_change(ifa, cmd); -#endif /* SCTP */ -#endif if (cmd == RTM_ADD) { rt_addrmsg(cmd, ifa, fibnum); if (rt != NULL) From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:38:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6EF7644F; Sun, 22 Jun 2014 16:38:07 +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 5BEC3230D; Sun, 22 Jun 2014 16:38:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MGc7PT040272; Sun, 22 Jun 2014 16:38:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGc6jK040268; Sun, 22 Jun 2014 16:38:06 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221638.s5MGc6jK040268@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267729 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:38:07 -0000 Author: tuexen Date: Sun Jun 22 16:38:06 2014 New Revision: 267729 URL: http://svnweb.freebsd.org/changeset/base/267729 Log: MFC r264679: Send the correct error cause, when a DATA chunk with no user data is received. This bug was reported by Irene Ruengeler. Modified: stable/10/sys/netinet/sctp.h stable/10/sys/netinet/sctp_indata.c stable/10/sys/netinet/sctputil.c stable/10/sys/netinet/sctputil.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp.h ============================================================================== --- stable/10/sys/netinet/sctp.h Sun Jun 22 16:36:14 2014 (r267728) +++ stable/10/sys/netinet/sctp.h Sun Jun 22 16:38:06 2014 (r267729) @@ -408,6 +408,11 @@ struct sctp_error_unrecognized_chunk { struct sctp_chunkhdr ch;/* header from chunk in error */ } SCTP_PACKED; +struct sctp_error_no_user_data { + struct sctp_error_cause cause; /* code=SCTP_CAUSE_NO_USER_DATA */ + uint32_t tsn; /* TSN of the empty data chunk */ +} SCTP_PACKED; + /* * Main SCTP chunk types we place these here so natd and f/w's in user land * can find them. Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Sun Jun 22 16:36:14 2014 (r267728) +++ stable/10/sys/netinet/sctp_indata.c Sun Jun 22 16:38:06 2014 (r267729) @@ -2323,7 +2323,7 @@ sctp_process_data(struct mbuf **mm, int continue; } if (ch->ch.chunk_type == SCTP_DATA) { - if ((size_t)chk_length < sizeof(struct sctp_data_chunk) + 1) { + if ((size_t)chk_length < sizeof(struct sctp_data_chunk)) { /* * Need to send an abort since we had a * invalid data chunk. @@ -2341,6 +2341,21 @@ sctp_process_data(struct mbuf **mm, int vrf_id, port); return (2); } + if ((size_t)chk_length == sizeof(struct sctp_data_chunk)) { + /* + * Need to send an abort since we had an + * empty data chunk. + */ + struct mbuf *op_err; + + op_err = sctp_generate_no_user_data_cause(ch->dp.tsn); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, + use_mflowid, mflowid, + vrf_id, port); + return (2); + } #ifdef SCTP_AUDITING_ENABLED sctp_audit_log(0xB1, 0); #endif Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Sun Jun 22 16:36:14 2014 (r267728) +++ stable/10/sys/netinet/sctputil.c Sun Jun 22 16:38:06 2014 (r267729) @@ -4654,6 +4654,25 @@ sctp_generate_cause(uint16_t code, char return (m); } +struct mbuf * +sctp_generate_no_user_data_cause(uint32_t tsn) +{ + struct mbuf *m; + struct sctp_error_no_user_data *no_user_data_cause; + size_t len; + + len = sizeof(struct sctp_error_no_user_data); + m = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); + if (m != NULL) { + SCTP_BUF_LEN(m) = len; + no_user_data_cause = mtod(m, struct sctp_error_no_user_data *); + no_user_data_cause->cause.code = htons(SCTP_CAUSE_NO_USER_DATA); + no_user_data_cause->cause.length = htons((uint16_t) len); + no_user_data_cause->tsn = tsn; /* tsn is passed in as NBO */ + } + return (m); +} + #ifdef SCTP_MBCNT_LOGGING void sctp_free_bufspace(struct sctp_tcb *stcb, struct sctp_association *asoc, Modified: stable/10/sys/netinet/sctputil.h ============================================================================== --- stable/10/sys/netinet/sctputil.h Sun Jun 22 16:36:14 2014 (r267728) +++ stable/10/sys/netinet/sctputil.h Sun Jun 22 16:38:06 2014 (r267729) @@ -254,6 +254,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t ); struct mbuf *sctp_generate_cause(uint16_t, char *); +struct mbuf *sctp_generate_no_user_data_cause(uint32_t); void sctp_bindx_add_address(struct socket *so, struct sctp_inpcb *inp, From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:40:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 91918680; Sun, 22 Jun 2014 16:40: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 7ED622395; Sun, 22 Jun 2014 16:40: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 s5MGeaLK040738; Sun, 22 Jun 2014 16:40:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGeaRW040737; Sun, 22 Jun 2014 16:40:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221640.s5MGeaRW040737@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267730 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:40:36 -0000 Author: tuexen Date: Sun Jun 22 16:40:36 2014 New Revision: 267730 URL: http://svnweb.freebsd.org/changeset/base/267730 Log: MFC r264682: Use consistently debug output instead of an unconditional printf. Modified: stable/10/sys/netinet/sctp_indata.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Sun Jun 22 16:38:06 2014 (r267729) +++ stable/10/sys/netinet/sctp_indata.c Sun Jun 22 16:40:36 2014 (r267730) @@ -1002,7 +1002,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * Huh, need the correct STR here, * they must be the same. */ - SCTP_PRINTF("Prev check - Gak, Evil plot, sid:%d not the same as at:%d\n", + SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - Gak, Evil plot, sid:%d not the same as at:%d\n", chk->rec.data.stream_number, prev->rec.data.stream_number); snprintf(msg, sizeof(msg), From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:42:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 89C0E7B6; Sun, 22 Jun 2014 16:42: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 77208239F; Sun, 22 Jun 2014 16:42: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 s5MGgA6M044045; Sun, 22 Jun 2014 16:42:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGgAPd044044; Sun, 22 Jun 2014 16:42:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221642.s5MGgAPd044044@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267731 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:42:10 -0000 Author: tuexen Date: Sun Jun 22 16:42:09 2014 New Revision: 267731 URL: http://svnweb.freebsd.org/changeset/base/267731 Log: MFC r264701: Send also a packet containing an ABORT chunk in response to an OOTB packet containing a COOKIE-ECHO chunk. Modified: stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Sun Jun 22 16:40:36 2014 (r267730) +++ stable/10/sys/netinet/sctputil.c Sun Jun 22 16:42:09 2014 (r267731) @@ -4047,9 +4047,6 @@ sctp_handle_ootb(struct mbuf *m, int iph case SCTP_INIT: contains_init_chunk = 1; break; - case SCTP_COOKIE_ECHO: - /* We hit here only if the assoc is being freed */ - return; case SCTP_PACKET_DROPPED: /* we don't respond to pkt-dropped */ return; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:44:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F2DDAA8E; Sun, 22 Jun 2014 16:43: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 D3BB823AB; Sun, 22 Jun 2014 16:43: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 s5MGhxaB044315; Sun, 22 Jun 2014 16:43:59 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGhxSf044314; Sun, 22 Jun 2014 16:43:59 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221643.s5MGhxSf044314@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267732 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:44:00 -0000 Author: tuexen Date: Sun Jun 22 16:43:59 2014 New Revision: 267732 URL: http://svnweb.freebsd.org/changeset/base/267732 Log: MFC r264704: Add consistency checks to ensure that fragments of a user message have the same U-bit. Modified: stable/10/sys/netinet/sctp_indata.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Sun Jun 22 16:42:09 2014 (r267731) +++ stable/10/sys/netinet/sctp_indata.c Sun Jun 22 16:43:59 2014 (r267732) @@ -828,7 +828,6 @@ sctp_queue_data_for_reasm(struct sctp_tc { struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - uint32_t cum_ackp1, prev_tsn, post_tsn; struct sctp_tmit_chunk *at, *prev, *next; @@ -1017,6 +1016,24 @@ sctp_queue_data_for_reasm(struct sctp_tc *abort_flag = 1; return; } + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + (prev->rec.data.rcv_flags & SCTP_DATA_UNORDERED)) { + /* + * Huh, need the same ordering here, + * they must be the same. + */ + SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - Gak, Evil plot, U-bit not constant\n"); + snprintf(msg, sizeof(msg), + "Expect U-bit=%d for TSN=%8.8x, got U-bit=%d", + (prev->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0, + chk->rec.data.TSN_seq, + (chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_7; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + *abort_flag = 1; + return; + } if ((prev->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == 0 && chk->rec.data.stream_seq != prev->rec.data.stream_seq) { @@ -1127,6 +1144,24 @@ sctp_queue_data_for_reasm(struct sctp_tc *abort_flag = 1; return; } + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + (next->rec.data.rcv_flags & SCTP_DATA_UNORDERED)) { + /* + * Huh, need the same ordering here, + * they must be the same. + */ + SCTPDBG(SCTP_DEBUG_INDATA1, "Next check - Gak, Evil plot, U-bit not constant\n"); + snprintf(msg, sizeof(msg), + "Expect U-bit=%d for TSN=%8.8x, got U-bit=%d", + (next->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0, + chk->rec.data.TSN_seq, + (chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_12; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + *abort_flag = 1; + return; + } if ((next->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == 0 && chk->rec.data.stream_seq != next->rec.data.stream_seq) { From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:45:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 89DA4BDA; Sun, 22 Jun 2014 16:45: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 5D3A923BC; Sun, 22 Jun 2014 16:45:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MGjhqw044901; Sun, 22 Jun 2014 16:45:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGjhU9044900; Sun, 22 Jun 2014 16:45:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221645.s5MGjhU9044900@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267733 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:45:43 -0000 Author: tuexen Date: Sun Jun 22 16:45:42 2014 New Revision: 267733 URL: http://svnweb.freebsd.org/changeset/base/267733 Log: MFC r264838: Don't free an mbuf twice. This only happens in very rare error cases where the peer sends illegal sequencing information in DATA chunks for an existing association. Modified: stable/10/sys/netinet/sctp_indata.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Sun Jun 22 16:43:59 2014 (r267732) +++ stable/10/sys/netinet/sctp_indata.c Sun Jun 22 16:45:42 2014 (r267733) @@ -1717,6 +1717,9 @@ failed_pdapi_express_del: stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; + if (last_chunk) { + *m = NULL; + } return (0); } else { if (sctp_does_tsn_belong_to_reasm(asoc, control->sinfo_tsn)) { @@ -1733,6 +1736,9 @@ failed_pdapi_express_del: stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; + if (last_chunk) { + *m = NULL; + } return (0); } } @@ -1759,6 +1765,9 @@ failed_pdapi_express_del: stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; + if (last_chunk) { + *m = NULL; + } return (0); } } @@ -1822,6 +1831,9 @@ failed_pdapi_express_del: } else { sctp_queue_data_to_stream(stcb, asoc, control, abort_flag); if (*abort_flag) { + if (last_chunk) { + *m = NULL; + } return (0); } } @@ -1834,7 +1846,9 @@ failed_pdapi_express_del: * the assoc is now gone and chk was put onto the * reasm queue, which has all been freed. */ - *m = NULL; + if (last_chunk) { + *m = NULL; + } return (0); } } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:48:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 035BDDF6; Sun, 22 Jun 2014 16:48: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 D9B3A23CF; Sun, 22 Jun 2014 16:48: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 s5MGmOKB045656; Sun, 22 Jun 2014 16:48:24 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGmMAq045640; Sun, 22 Jun 2014 16:48:22 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201406221648.s5MGmMAq045640@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 22 Jun 2014 16:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267734 - in stable/10: . contrib/gcc etc etc/mtree gnu/usr.bin gnu/usr.bin/binutils/libbfd gnu/usr.bin/send-pr share/man/man7 share/termcap sys/mips/rmi sys/modules/svr4 usr.bin usr.bi... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:48:25 -0000 Author: gavin Date: Sun Jun 22 16:48:21 2014 New Revision: 267734 URL: http://svnweb.freebsd.org/changeset/base/267734 Log: Merge r267482,r267483,r267486,r267577,r267671,r267672 from head: Remove send-pr and fix up all references to it. Replace it with a stub send-pr directing people towards the web site. Added: stable/10/usr.bin/send-pr/ - copied from r267577, head/usr.bin/send-pr/ Deleted: stable/10/gnu/usr.bin/send-pr/ Modified: stable/10/MAINTAINERS stable/10/ObsoleteFiles.inc stable/10/contrib/gcc/version.c stable/10/etc/Makefile stable/10/etc/mtree/BSD.root.dist stable/10/gnu/usr.bin/Makefile stable/10/gnu/usr.bin/binutils/libbfd/Makefile stable/10/share/man/man7/hier.7 stable/10/share/man/man7/tests.7 stable/10/share/termcap/termcap.src stable/10/sys/mips/rmi/rootfs_list.txt stable/10/sys/modules/svr4/README stable/10/usr.bin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/MAINTAINERS ============================================================================== --- stable/10/MAINTAINERS Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/MAINTAINERS Sun Jun 22 16:48:21 2014 (r267734) @@ -110,7 +110,6 @@ lib/libbluetooth emax Pre-commit review lib/libsdp emax Pre-commit review preferred. usr.bin/bluetooth emax Pre-commit review preferred. usr.sbin/bluetooth emax Pre-commit review preferred. -gnu/usr.bin/send-pr bugmaster Pre-commit review requested. *env(3) secteam Due to the problematic security history of this code, please have patches reviewed by secteam. share/zoneinfo edwin Heads-up appreciated, since our data is coming Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/ObsoleteFiles.inc Sun Jun 22 16:48:21 2014 (r267734) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20140614: send-pr removal +OLD_FILES+=usr/share/man/man1/send-pr.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. OLD_FILES+=usr/include/clang/3.4/__wmmintrin_aes.h OLD_FILES+=usr/include/clang/3.4/__wmmintrin_pclmul.h Modified: stable/10/contrib/gcc/version.c ============================================================================== --- stable/10/contrib/gcc/version.c Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/contrib/gcc/version.c Sun Jun 22 16:48:21 2014 (r267734) @@ -18,7 +18,7 @@ forward us bugs reported to you, if you determine that they are not bugs in your modifications.) */ -const char bug_report_url[] = ""; +const char bug_report_url[] = ""; /* The complete version string, assembled from several pieces. BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */ Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/etc/Makefile Sun Jun 22 16:48:21 2014 (r267734) @@ -231,7 +231,6 @@ distribution: ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install - ${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install Modified: stable/10/etc/mtree/BSD.root.dist ============================================================================== --- stable/10/etc/mtree/BSD.root.dist Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/etc/mtree/BSD.root.dist Sun Jun 22 16:48:21 2014 (r267734) @@ -30,8 +30,6 @@ .. devd .. - gnats - .. gss .. mail Modified: stable/10/gnu/usr.bin/Makefile ============================================================================== --- stable/10/gnu/usr.bin/Makefile Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/gnu/usr.bin/Makefile Sun Jun 22 16:48:21 2014 (r267734) @@ -14,7 +14,6 @@ SUBDIR= ${_binutils} \ ${_groff} \ ${_rcs} \ sdiff \ - send-pr \ ${_tests} \ ${_texinfo} Modified: stable/10/gnu/usr.bin/binutils/libbfd/Makefile ============================================================================== --- stable/10/gnu/usr.bin/binutils/libbfd/Makefile Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/gnu/usr.bin/binutils/libbfd/Makefile Sun Jun 22 16:48:21 2014 (r267734) @@ -84,7 +84,7 @@ bfdver.h: Makefile echo '#define BFD_VERSION 217500000' > ${.TARGET} echo '#define BFD_VERSION_DATE 20070703' >> ${.TARGET} echo '#define BFD_VERSION_STRING ${VERSION}' >> ${.TARGET} - echo '#define REPORT_BUGS_TO ""' >> ${.TARGET} + echo '#define REPORT_BUGS_TO ""' >> ${.TARGET} targmatch.h: targmatch.sed config.bfd sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} > ${.TARGET} Modified: stable/10/share/man/man7/hier.7 ============================================================================== --- stable/10/share/man/man7/hier.7 Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/share/man/man7/hier.7 Sun Jun 22 16:48:21 2014 (r267734) @@ -90,10 +90,6 @@ see .Xr rc 8 .It Pa bluetooth/ bluetooth configuration files -.It Pa gnats/ -gnats configuration files; -see -.Xr send-pr 1 .It Pa localtime local timezone information; see Modified: stable/10/share/man/man7/tests.7 ============================================================================== --- stable/10/share/man/man7/tests.7 Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/share/man/man7/tests.7 Sun Jun 22 16:48:21 2014 (r267734) @@ -195,7 +195,7 @@ For more details please refer to: .It .Lk http://lists.freebsd.org/ "FreeBSD Mailing Lists" .It -.Lk http://www.freebsd.org/send-pr.html "Submit a FreeBSD Problem Report" +.Lk http://www.freebsd.org/support.html "Problem Reporting" .El .Sh FILES .Bl -tag -compact -width usrXlocalXetcXkyuaXkyuaXconfXX Modified: stable/10/share/termcap/termcap.src ============================================================================== --- stable/10/share/termcap/termcap.src Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/share/termcap/termcap.src Sun Jun 22 16:48:21 2014 (r267734) @@ -36,7 +36,7 @@ # John Kunze, Berkeley # Craig Leres, Berkeley # -# Please submit changes with send-pr(1). +# Please submit changes via https://bugs.freebsd.org/submit/ # # << EOH - after reordering, above header lines survive and this line dies >> # Modified: stable/10/sys/mips/rmi/rootfs_list.txt ============================================================================== --- stable/10/sys/mips/rmi/rootfs_list.txt Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/sys/mips/rmi/rootfs_list.txt Sun Jun 22 16:48:21 2014 (r267734) @@ -64,8 +64,6 @@ ./etc/defaults/rc.conf ./etc/devd ./etc/devd/asus.conf -./etc/gnats -./etc/gnats/freefall ./etc/gss ./etc/gss/mech ./etc/gss/qop Modified: stable/10/sys/modules/svr4/README ============================================================================== --- stable/10/sys/modules/svr4/README Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/sys/modules/svr4/README Sun Jun 22 16:48:21 2014 (r267734) @@ -30,7 +30,7 @@ To use it: It's early days yet, folks -- You'll probably have trouble getting 100% functionality out of most things (specifically, poll() on a socket doesn't look like it works at the moment, so Netscape doesn't work (among other -things)). Patches will be appreciated (use send-pr). +things)). Patches will be appreciated. - Mark Newton newton@atdot.dotat.org Modified: stable/10/usr.bin/Makefile ============================================================================== --- stable/10/usr.bin/Makefile Sun Jun 22 16:45:42 2014 (r267733) +++ stable/10/usr.bin/Makefile Sun Jun 22 16:48:21 2014 (r267734) @@ -143,6 +143,7 @@ SUBDIR= alias \ rwall \ script \ sed \ + send-pr \ seq \ shar \ showmount \ From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:50:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E9E74F2A; Sun, 22 Jun 2014 16:50: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 D672523D4; Sun, 22 Jun 2014 16:50: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 s5MGokvC046822; Sun, 22 Jun 2014 16:50:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGok2B046820; Sun, 22 Jun 2014 16:50:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221650.s5MGok2B046820@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267735 - in stable/10/sys: dev/usb/net netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:50:47 -0000 Author: tuexen Date: Sun Jun 22 16:50:46 2014 New Revision: 267735 URL: http://svnweb.freebsd.org/changeset/base/267735 Log: MFC r265455: Remove unused code. This is triggered by the bugreport of Sylvestre Ledru which deal with useless code in the user land stack: https://bugzilla.mozilla.org/show_bug.cgi?id=1003929 Modified: stable/10/sys/dev/usb/net/if_smsc.c stable/10/sys/netinet/sctp_pcb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/10/sys/dev/usb/net/if_smsc.c Sun Jun 22 16:48:21 2014 (r267734) +++ stable/10/sys/dev/usb/net/if_smsc.c Sun Jun 22 16:50:46 2014 (r267735) @@ -82,6 +82,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "opt_platform.h" #ifdef FDT @@ -1021,25 +1024,32 @@ smsc_bulk_read_callback(struct usb_xfer * * Ignore H/W csum for non-IPv4 packets. */ - if (be16toh(eh->ether_type) == ETHERTYPE_IP && pktlen > ETHER_MIN_LEN) { - - /* Indicate the UDP/TCP csum has been calculated */ - m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; - - /* Copy the TCP/UDP checksum from the last 2 bytes - * of the transfer and put in the csum_data field. - */ - usbd_copy_out(pc, (off + pktlen), - &m->m_pkthdr.csum_data, 2); - - /* The data is copied in network order, but the - * csum algorithm in the kernel expects it to be - * in host network order. - */ - m->m_pkthdr.csum_data = ntohs(m->m_pkthdr.csum_data); - - smsc_dbg_printf(sc, "RX checksum offloaded (0x%04x)\n", - m->m_pkthdr.csum_data); + if ((be16toh(eh->ether_type) == ETHERTYPE_IP) && + (pktlen > ETHER_MIN_LEN)) { + struct ip *ip; + + ip = (struct ip *)(eh + 1); + if ((ip->ip_v == IPVERSION) && + ((ip->ip_p == IPPROTO_TCP) || + (ip->ip_p == IPPROTO_UDP))) { + /* Indicate the UDP/TCP csum has been calculated */ + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; + + /* Copy the TCP/UDP checksum from the last 2 bytes + * of the transfer and put in the csum_data field. + */ + usbd_copy_out(pc, (off + pktlen), + &m->m_pkthdr.csum_data, 2); + + /* The data is copied in network order, but the + * csum algorithm in the kernel expects it to be + * in host network order. + */ + m->m_pkthdr.csum_data = ntohs(m->m_pkthdr.csum_data); + + smsc_dbg_printf(sc, "RX checksum offloaded (0x%04x)\n", + m->m_pkthdr.csum_data); + } } /* Need to adjust the offset as well or we'll be off Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Sun Jun 22 16:48:21 2014 (r267734) +++ stable/10/sys/netinet/sctp_pcb.c Sun Jun 22 16:50:46 2014 (r267735) @@ -2735,7 +2735,6 @@ sctp_inpcb_bind(struct socket *so, struc uint32_t vrf_id; lport = 0; - error = 0; bindall = 1; inp = (struct sctp_inpcb *)so->so_pcb; ip_inp = (struct inpcb *)so->so_pcb; @@ -2856,13 +2855,6 @@ sctp_inpcb_bind(struct socket *so, struc return (error); } } - if (p == NULL) { - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - SCTP_INP_INFO_WUNLOCK(); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); - return (error); - } SCTP_INP_WUNLOCK(inp); if (bindall) { vrf_id = inp->def_vrf_id; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:55:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5E60E21B; Sun, 22 Jun 2014 16:55: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 4B480246B; Sun, 22 Jun 2014 16:55: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 s5MGt0RG049783; Sun, 22 Jun 2014 16:55:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGt014049782; Sun, 22 Jun 2014 16:55:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221655.s5MGt014049782@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267736 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:55:00 -0000 Author: tuexen Date: Sun Jun 22 16:54:59 2014 New Revision: 267736 URL: http://svnweb.freebsd.org/changeset/base/267736 Log: MFC r265691: For some UDP packets (for example with 200 byte payload) and IP options, the IP header and the UDP header are not in the same mbuf. Add code to in_delayed_cksum() to deal with this case. MFC r265713: Use KASSERTs as suggested by glebius@ Modified: stable/10/sys/netinet/ip_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_output.c ============================================================================== --- stable/10/sys/netinet/ip_output.c Sun Jun 22 16:50:46 2014 (r267735) +++ stable/10/sys/netinet/ip_output.c Sun Jun 22 16:54:59 2014 (r267736) @@ -864,17 +864,13 @@ in_delayed_cksum(struct mbuf *m) csum = 0xffff; offset += m->m_pkthdr.csum_data; /* checksum offset */ - if (offset + sizeof(u_short) > m->m_len) { - printf("delayed m_pullup, m->len: %d off: %d p: %d\n", - m->m_len, offset, ip->ip_p); - /* - * XXX - * this shouldn't happen, but if it does, the - * correct behavior may be to insert the checksum - * in the appropriate next mbuf in the chain. - */ - return; + /* find the mbuf in the chain where the checksum starts*/ + while ((m != NULL) && (offset >= m->m_len)) { + offset -= m->m_len; + m = m->m_next; } + KASSERT(m != NULL, ("in_delayed_cksum: checksum outside mbuf chain.")); + KASSERT(offset + sizeof(u_short) <= m->m_len, ("in_delayed_cksum: checksum split between mbufs.")); *(u_short *)(m->m_data + offset) = csum; } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:57:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 84C0E35F; Sun, 22 Jun 2014 16:57:08 +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 71C30247A; Sun, 22 Jun 2014 16:57:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MGv8mi050163; Sun, 22 Jun 2014 16:57:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGv8Kn050162; Sun, 22 Jun 2014 16:57:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221657.s5MGv8Kn050162@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267737 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:57:08 -0000 Author: tuexen Date: Sun Jun 22 16:57:07 2014 New Revision: 267737 URL: http://svnweb.freebsd.org/changeset/base/267737 Log: MFC r267105: Use ENOBUFS instead of ENOMEM in error situations related to m_uiotombuf(). This was suggested by kevlo@. Modified: stable/10/sys/netinet/sctp_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Sun Jun 22 16:54:59 2014 (r267736) +++ stable/10/sys/netinet/sctp_output.c Sun Jun 22 16:57:07 2014 (r267737) @@ -11911,8 +11911,8 @@ sctp_copy_resume(struct uio *uio, m = m_uiotombuf(uio, M_WAITOK, max_send_len, 0, (M_PKTHDR | (user_marks_eor ? M_EOR : 0))); if (m == NULL) { - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); - *error = ENOMEM; + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOBUFS); + *error = ENOBUFS; } else { *sndout = m_length(m, NULL); *new_tail = m_last(m); @@ -11931,8 +11931,8 @@ sctp_copy_one(struct sctp_stream_queue_p sp->data = m_uiotombuf(uio, M_WAITOK, sp->length, resv_upfront, 0); if (sp->data == NULL) { - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); - return (ENOMEM); + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOBUFS); + return (ENOBUFS); } sp->tail_mbuf = m_last(sp->data); return (0); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 16:58:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E067A610; Sun, 22 Jun 2014 16:58: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 CC4AA248D; Sun, 22 Jun 2014 16:58: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 s5MGwTDv050477; Sun, 22 Jun 2014 16:58:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGwT4K050476; Sun, 22 Jun 2014 16:58:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406221658.s5MGwT4K050476@svn.freebsd.org> From: Michael Tuexen Date: Sun, 22 Jun 2014 16:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267739 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 16:58:30 -0000 Author: tuexen Date: Sun Jun 22 16:58:29 2014 New Revision: 267739 URL: http://svnweb.freebsd.org/changeset/base/267739 Log: MFC r267329: Add support for the SCTP_LOCAL_TRACE_BUF options. While there, fix some whitespaces. Modified: stable/10/sys/conf/options Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Sun Jun 22 16:58:18 2014 (r267738) +++ stable/10/sys/conf/options Sun Jun 22 16:58:29 2014 (r267739) @@ -455,8 +455,9 @@ SCTP_MBCNT_LOGGING opt_sctp.h # Log to K SCTP_PACKET_LOGGING opt_sctp.h # Log to a packet buffer last N packets SCTP_LTRACE_CHUNKS opt_sctp.h # Log to KTR chunks processed SCTP_LTRACE_ERRORS opt_sctp.h # Log to KTR error returns. -SCTP_USE_PERCPU_STAT opt_sctp.h # Use per cpu stats. -SCTP_MCORE_INPUT opt_sctp.h # Have multiple input threads for input mbufs +SCTP_USE_PERCPU_STAT opt_sctp.h # Use per cpu stats. +SCTP_MCORE_INPUT opt_sctp.h # Have multiple input threads for input mbufs +SCTP_LOCAL_TRACE_BUF opt_sctp.h # Use tracebuffer exported via sysctl # # # From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 18:01:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 35C5225B; Sun, 22 Jun 2014 18:01: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 16C73294C; Sun, 22 Jun 2014 18:01: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 s5MI1eBp081054; Sun, 22 Jun 2014 18:01:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MI1efW081051; Sun, 22 Jun 2014 18:01:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406221801.s5MI1efW081051@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 18:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267740 - in stable/10/sys: nfs rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 18:01:41 -0000 Author: mav Date: Sun Jun 22 18:01:40 2014 New Revision: 267740 URL: http://svnweb.freebsd.org/changeset/base/267740 Log: MFC r267221, r267278: Introduce new per-thread lock to protect the list of requests. This allows to slightly simplify svc_run_internal() code: if we processed all the requests in a queue, then we know that new one will not appear. Modified: stable/10/sys/nfs/nfs_fha.c stable/10/sys/rpc/svc.c stable/10/sys/rpc/svc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/nfs/nfs_fha.c ============================================================================== --- stable/10/sys/nfs/nfs_fha.c Sun Jun 22 16:58:29 2014 (r267739) +++ stable/10/sys/nfs/nfs_fha.c Sun Jun 22 18:01:40 2014 (r267740) @@ -288,11 +288,7 @@ fha_hash_entry_add_op(struct fha_hash_en * Get the service thread currently associated with the fhe that is * appropriate to handle this operation. */ -SVCTHREAD * -fha_hash_entry_choose_thread(struct fha_params *softc, - struct fha_hash_entry *fhe, struct fha_info *i, SVCTHREAD *this_thread); - -SVCTHREAD * +static SVCTHREAD * fha_hash_entry_choose_thread(struct fha_params *softc, struct fha_hash_entry *fhe, struct fha_info *i, SVCTHREAD *this_thread) { @@ -428,13 +424,13 @@ fha_assign(SVCTHREAD *this_thread, struc * Grab the pool lock here to not let chosen thread go away before * the new request inserted to its queue while we drop fhe lock. */ - mtx_lock(&(*softc->pool)->sp_lock); + mtx_lock(&thread->st_lock); mtx_unlock(fhe->mtx); return (thread); thist: req->rq_p1 = NULL; - mtx_lock(&(*softc->pool)->sp_lock); + mtx_lock(&this_thread->st_lock); return (this_thread); } Modified: stable/10/sys/rpc/svc.c ============================================================================== --- stable/10/sys/rpc/svc.c Sun Jun 22 16:58:29 2014 (r267739) +++ stable/10/sys/rpc/svc.c Sun Jun 22 18:01:40 2014 (r267740) @@ -1070,7 +1070,6 @@ svc_request_space_available(SVCPOOL *poo static void svc_run_internal(SVCPOOL *pool, bool_t ismaster) { - struct svc_reqlist reqs; SVCTHREAD *st, *stpref; SVCXPRT *xprt; enum xprt_stat stat; @@ -1079,11 +1078,11 @@ svc_run_internal(SVCPOOL *pool, bool_t i int error; st = mem_alloc(sizeof(*st)); + mtx_init(&st->st_lock, "st_lock", NULL, MTX_DEF); st->st_pool = pool; st->st_xprt = NULL; STAILQ_INIT(&st->st_reqs); cv_init(&st->st_cond, "rpcsvc"); - STAILQ_INIT(&reqs); mtx_lock(&pool->sp_lock); LIST_INSERT_HEAD(&pool->sp_threads, st, st_link); @@ -1117,7 +1116,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i } xprt = st->st_xprt; - if (!xprt && STAILQ_EMPTY(&st->st_reqs)) { + if (!xprt) { /* * Enforce maxthreads count. */ @@ -1159,8 +1158,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i if (!ismaster && (pool->sp_threadcount > pool->sp_minthreads) - && !st->st_xprt - && STAILQ_EMPTY(&st->st_reqs)) + && !st->st_xprt) break; } else if (error) { mtx_unlock(&pool->sp_lock); @@ -1170,93 +1168,71 @@ svc_run_internal(SVCPOOL *pool, bool_t i } continue; } + mtx_unlock(&pool->sp_lock); - if (xprt) { - /* - * Drain the transport socket and queue up any - * RPCs. - */ - xprt->xp_lastactive = time_uptime; - do { - if (!svc_request_space_available(pool)) - break; - mtx_unlock(&pool->sp_lock); - rqstp = NULL; - stat = svc_getreq(xprt, &rqstp); - if (rqstp) { - svc_change_space_used(pool, rqstp->rq_size); - /* - * See if the application has - * a preference for some other - * thread. - */ - stpref = st; - if (pool->sp_assign) - stpref = pool->sp_assign(st, - rqstp); - else - mtx_lock(&pool->sp_lock); - + /* + * Drain the transport socket and queue up any RPCs. + */ + xprt->xp_lastactive = time_uptime; + do { + if (!svc_request_space_available(pool)) + break; + rqstp = NULL; + stat = svc_getreq(xprt, &rqstp); + if (rqstp) { + svc_change_space_used(pool, rqstp->rq_size); + /* + * See if the application has a preference + * for some other thread. + */ + if (pool->sp_assign) { + stpref = pool->sp_assign(st, rqstp); rqstp->rq_thread = stpref; STAILQ_INSERT_TAIL(&stpref->st_reqs, rqstp, rq_link); - - /* - * If we assigned the request - * to another thread, make - * sure its awake and continue - * reading from the - * socket. Otherwise, try to - * find some other thread to - * read from the socket and - * execute the request - * immediately. - */ - if (stpref == st) - break; - if (stpref->st_idle) { - LIST_REMOVE(stpref, st_ilink); - stpref->st_idle = FALSE; - cv_signal(&stpref->st_cond); - } - } else - mtx_lock(&pool->sp_lock); - } while (stat == XPRT_MOREREQS - && pool->sp_state != SVCPOOL_CLOSING); - - /* - * Move this transport to the end of the - * active list to ensure fairness when - * multiple transports are active. If this was - * the last queued request, svc_getreq will - * end up calling xprt_inactive to remove from - * the active list. - */ - xprt->xp_thread = NULL; - st->st_xprt = NULL; - if (xprt->xp_active) { - if (!svc_request_space_available(pool) || - !xprt_assignthread(xprt)) - TAILQ_INSERT_TAIL(&pool->sp_active, - xprt, xp_alink); + mtx_unlock(&stpref->st_lock); + if (stpref != st) + rqstp = NULL; + } else { + rqstp->rq_thread = st; + STAILQ_INSERT_TAIL(&st->st_reqs, + rqstp, rq_link); + } } - STAILQ_CONCAT(&reqs, &st->st_reqs); - mtx_unlock(&pool->sp_lock); - SVC_RELEASE(xprt); - } else { - STAILQ_CONCAT(&reqs, &st->st_reqs); - mtx_unlock(&pool->sp_lock); + } while (rqstp == NULL && stat == XPRT_MOREREQS + && pool->sp_state != SVCPOOL_CLOSING); + + /* + * Move this transport to the end of the active list to + * ensure fairness when multiple transports are active. + * If this was the last queued request, svc_getreq will end + * up calling xprt_inactive to remove from the active list. + */ + mtx_lock(&pool->sp_lock); + xprt->xp_thread = NULL; + st->st_xprt = NULL; + if (xprt->xp_active) { + if (!svc_request_space_available(pool) || + !xprt_assignthread(xprt)) + TAILQ_INSERT_TAIL(&pool->sp_active, + xprt, xp_alink); } + mtx_unlock(&pool->sp_lock); + SVC_RELEASE(xprt); /* * Execute what we have queued. */ sz = 0; - while ((rqstp = STAILQ_FIRST(&reqs)) != NULL) { - STAILQ_REMOVE_HEAD(&reqs, rq_link); + mtx_lock(&st->st_lock); + while ((rqstp = STAILQ_FIRST(&st->st_reqs)) != NULL) { + STAILQ_REMOVE_HEAD(&st->st_reqs, rq_link); + mtx_unlock(&st->st_lock); sz += rqstp->rq_size; svc_executereq(rqstp); + mtx_lock(&st->st_lock); } + mtx_unlock(&st->st_lock); svc_change_space_used(pool, -sz); mtx_lock(&pool->sp_lock); } @@ -1273,6 +1249,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i mtx_unlock(&pool->sp_lock); + mtx_destroy(&st->st_lock); cv_destroy(&st->st_cond); mem_free(st, sizeof(*st)); Modified: stable/10/sys/rpc/svc.h ============================================================================== --- stable/10/sys/rpc/svc.h Sun Jun 22 16:58:29 2014 (r267739) +++ stable/10/sys/rpc/svc.h Sun Jun 22 18:01:40 2014 (r267740) @@ -291,6 +291,7 @@ STAILQ_HEAD(svc_reqlist, svc_req); * thread to read and execute pending RPCs. */ typedef struct __rpc_svcthread { + struct mtx_padalign st_lock; /* protects st_reqs field */ struct __rpc_svcpool *st_pool; SVCXPRT *st_xprt; /* transport we are processing */ struct svc_reqlist st_reqs; /* RPC requests to execute */ From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 18:02:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1624239A; Sun, 22 Jun 2014 18: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 DF57F2954; Sun, 22 Jun 2014 18:02: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 s5MI2dAr082195; Sun, 22 Jun 2014 18:02:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MI2d0P082193; Sun, 22 Jun 2014 18:02:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406221802.s5MI2d0P082193@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 18:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267741 - stable/10/sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 18:02:40 -0000 Author: mav Date: Sun Jun 22 18:02:39 2014 New Revision: 267741 URL: http://svnweb.freebsd.org/changeset/base/267741 Log: MFC r267223: Remove st_idle variable, duplicating st_xprt. Modified: stable/10/sys/rpc/svc.c stable/10/sys/rpc/svc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc.c ============================================================================== --- stable/10/sys/rpc/svc.c Sun Jun 22 18:01:40 2014 (r267740) +++ stable/10/sys/rpc/svc.c Sun Jun 22 18:02:39 2014 (r267741) @@ -340,7 +340,6 @@ xprt_assignthread(SVCXPRT *xprt) st = LIST_FIRST(&pool->sp_idlethreads); if (st) { LIST_REMOVE(st, st_ilink); - st->st_idle = FALSE; SVC_ACQUIRE(xprt); xprt->xp_thread = st; st->st_xprt = xprt; @@ -1138,7 +1137,6 @@ svc_run_internal(SVCPOOL *pool, bool_t i } LIST_INSERT_HEAD(&pool->sp_idlethreads, st, st_ilink); - st->st_idle = TRUE; if (ismaster || (!ismaster && pool->sp_threadcount > pool->sp_minthreads)) error = cv_timedwait_sig(&st->st_cond, @@ -1146,10 +1144,8 @@ svc_run_internal(SVCPOOL *pool, bool_t i else error = cv_wait_sig(&st->st_cond, &pool->sp_lock); - if (st->st_idle) { + if (st->st_xprt == NULL) LIST_REMOVE(st, st_ilink); - st->st_idle = FALSE; - } /* * Reduce worker thread count when idle. Modified: stable/10/sys/rpc/svc.h ============================================================================== --- stable/10/sys/rpc/svc.h Sun Jun 22 18:01:40 2014 (r267740) +++ stable/10/sys/rpc/svc.h Sun Jun 22 18:02:39 2014 (r267741) @@ -295,7 +295,6 @@ typedef struct __rpc_svcthread { struct __rpc_svcpool *st_pool; SVCXPRT *st_xprt; /* transport we are processing */ struct svc_reqlist st_reqs; /* RPC requests to execute */ - int st_idle; /* thread is on idle list */ struct cv st_cond; /* sleeping for work */ LIST_ENTRY(__rpc_svcthread) st_link; /* all threads list */ LIST_ENTRY(__rpc_svcthread) st_ilink; /* idle threads list */ From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 18:03:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 ECAD64D1; Sun, 22 Jun 2014 18:03: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 D8B71295B; Sun, 22 Jun 2014 18:03: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 s5MI3ri5082447; Sun, 22 Jun 2014 18:03:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MI3r93082444; Sun, 22 Jun 2014 18:03:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406221803.s5MI3r93082444@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 18:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267742 - stable/10/sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 18:03:54 -0000 Author: mav Date: Sun Jun 22 18:03:53 2014 New Revision: 267742 URL: http://svnweb.freebsd.org/changeset/base/267742 Log: MFC r267228: Split RPC pool threads into number of smaller semi-isolated groups. Old design with unified thread pool was good from the point of thread utilization. But single pool-wide mutex became huge congestion point for systems with many CPUs. To reduce the congestion create several thread groups within a pool (one group for every 6 CPUs and 12 threads), each group with own mutex. Each connection during its registration is assigned to one of the groups in round-robin fashion. File affinify code may still move requests between the groups, but otherwise groups are self-contained. Modified: stable/10/sys/rpc/svc.c stable/10/sys/rpc/svc.h stable/10/sys/rpc/svc_generic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc.c ============================================================================== --- stable/10/sys/rpc/svc.c Sun Jun 22 18:02:39 2014 (r267741) +++ stable/10/sys/rpc/svc.c Sun Jun 22 18:03:53 2014 (r267742) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -70,7 +71,7 @@ __FBSDID("$FreeBSD$"); static struct svc_callout *svc_find(SVCPOOL *pool, rpcprog_t, rpcvers_t, char *); -static void svc_new_thread(SVCPOOL *pool); +static void svc_new_thread(SVCGROUP *grp); static void xprt_unregister_locked(SVCXPRT *xprt); static void svc_change_space_used(SVCPOOL *pool, int delta); static bool_t svc_request_space_available(SVCPOOL *pool); @@ -79,11 +80,14 @@ static bool_t svc_request_space_availabl static int svcpool_minthread_sysctl(SYSCTL_HANDLER_ARGS); static int svcpool_maxthread_sysctl(SYSCTL_HANDLER_ARGS); +static int svcpool_threads_sysctl(SYSCTL_HANDLER_ARGS); SVCPOOL* svcpool_create(const char *name, struct sysctl_oid_list *sysctl_base) { SVCPOOL *pool; + SVCGROUP *grp; + int g; pool = malloc(sizeof(SVCPOOL), M_RPC, M_WAITOK|M_ZERO); @@ -91,15 +95,22 @@ svcpool_create(const char *name, struct pool->sp_name = name; pool->sp_state = SVCPOOL_INIT; pool->sp_proc = NULL; - TAILQ_INIT(&pool->sp_xlist); - TAILQ_INIT(&pool->sp_active); TAILQ_INIT(&pool->sp_callouts); TAILQ_INIT(&pool->sp_lcallouts); - LIST_INIT(&pool->sp_threads); - LIST_INIT(&pool->sp_idlethreads); pool->sp_minthreads = 1; pool->sp_maxthreads = 1; - pool->sp_threadcount = 0; + pool->sp_groupcount = 1; + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_init(&grp->sg_lock, "sg_lock", NULL, MTX_DEF); + grp->sg_pool = pool; + grp->sg_state = SVCPOOL_ACTIVE; + TAILQ_INIT(&grp->sg_xlist); + TAILQ_INIT(&grp->sg_active); + LIST_INIT(&grp->sg_idlethreads); + grp->sg_minthreads = 1; + grp->sg_maxthreads = 1; + } /* * Don't use more than a quarter of mbuf clusters or more than @@ -114,12 +125,19 @@ svcpool_create(const char *name, struct if (sysctl_base) { SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, "minthreads", CTLTYPE_INT | CTLFLAG_RW, - pool, 0, svcpool_minthread_sysctl, "I", ""); + pool, 0, svcpool_minthread_sysctl, "I", + "Minimal number of threads"); SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, "maxthreads", CTLTYPE_INT | CTLFLAG_RW, - pool, 0, svcpool_maxthread_sysctl, "I", ""); + pool, 0, svcpool_maxthread_sysctl, "I", + "Maximal number of threads"); + SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, + "threads", CTLTYPE_INT | CTLFLAG_RD, + pool, 0, svcpool_threads_sysctl, "I", + "Current number of threads"); SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, - "threads", CTLFLAG_RD, &pool->sp_threadcount, 0, ""); + "groups", CTLFLAG_RD, &pool->sp_groupcount, 0, + "Number of thread groups"); SYSCTL_ADD_UINT(&pool->sp_sysctl, sysctl_base, OID_AUTO, "request_space_used", CTLFLAG_RD, @@ -158,20 +176,29 @@ svcpool_create(const char *name, struct void svcpool_destroy(SVCPOOL *pool) { + SVCGROUP *grp; SVCXPRT *xprt, *nxprt; struct svc_callout *s; struct svc_loss_callout *sl; struct svcxprt_list cleanup; + int g; TAILQ_INIT(&cleanup); - mtx_lock(&pool->sp_lock); - while (TAILQ_FIRST(&pool->sp_xlist)) { - xprt = TAILQ_FIRST(&pool->sp_xlist); - xprt_unregister_locked(xprt); - TAILQ_INSERT_TAIL(&cleanup, xprt, xp_link); + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + while ((xprt = TAILQ_FIRST(&grp->sg_xlist)) != NULL) { + xprt_unregister_locked(xprt); + TAILQ_INSERT_TAIL(&cleanup, xprt, xp_link); + } + mtx_unlock(&grp->sg_lock); + } + TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { + SVC_RELEASE(xprt); } + mtx_lock(&pool->sp_lock); while ((s = TAILQ_FIRST(&pool->sp_callouts)) != NULL) { mtx_unlock(&pool->sp_lock); svc_unreg(pool, s->sc_prog, s->sc_vers); @@ -184,10 +211,10 @@ svcpool_destroy(SVCPOOL *pool) } mtx_unlock(&pool->sp_lock); - TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { - SVC_RELEASE(xprt); + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_destroy(&grp->sg_lock); } - mtx_destroy(&pool->sp_lock); if (pool->sp_rcache) @@ -197,14 +224,23 @@ svcpool_destroy(SVCPOOL *pool) free(pool, M_RPC); } -static bool_t -svcpool_active(SVCPOOL *pool) +/* + * Sysctl handler to get the present thread count on a pool + */ +static int +svcpool_threads_sysctl(SYSCTL_HANDLER_ARGS) { - enum svcpool_state state = pool->sp_state; + SVCPOOL *pool; + int threads, error, g; - if (state == SVCPOOL_INIT || state == SVCPOOL_CLOSING) - return (FALSE); - return (TRUE); + pool = oidp->oid_arg1; + threads = 0; + mtx_lock(&pool->sp_lock); + for (g = 0; g < pool->sp_groupcount; g++) + threads += pool->sp_groups[g].sg_threadcount; + mtx_unlock(&pool->sp_lock); + error = sysctl_handle_int(oidp, &threads, 0, req); + return (error); } /* @@ -214,7 +250,7 @@ static int svcpool_minthread_sysctl(SYSCTL_HANDLER_ARGS) { SVCPOOL *pool; - int newminthreads, error, n; + int newminthreads, error, g; pool = oidp->oid_arg1; newminthreads = pool->sp_minthreads; @@ -223,21 +259,11 @@ svcpool_minthread_sysctl(SYSCTL_HANDLER_ if (newminthreads > pool->sp_maxthreads) return (EINVAL); mtx_lock(&pool->sp_lock); - if (newminthreads > pool->sp_minthreads - && svcpool_active(pool)) { - /* - * If the pool is running and we are - * increasing, create some more threads now. - */ - n = newminthreads - pool->sp_threadcount; - if (n > 0) { - mtx_unlock(&pool->sp_lock); - while (n--) - svc_new_thread(pool); - mtx_lock(&pool->sp_lock); - } - } pool->sp_minthreads = newminthreads; + for (g = 0; g < pool->sp_groupcount; g++) { + pool->sp_groups[g].sg_minthreads = max(1, + pool->sp_minthreads / pool->sp_groupcount); + } mtx_unlock(&pool->sp_lock); } return (error); @@ -250,8 +276,7 @@ static int svcpool_maxthread_sysctl(SYSCTL_HANDLER_ARGS) { SVCPOOL *pool; - SVCTHREAD *st; - int newmaxthreads, error; + int newmaxthreads, error, g; pool = oidp->oid_arg1; newmaxthreads = pool->sp_maxthreads; @@ -260,17 +285,11 @@ svcpool_maxthread_sysctl(SYSCTL_HANDLER_ if (newmaxthreads < pool->sp_minthreads) return (EINVAL); mtx_lock(&pool->sp_lock); - if (newmaxthreads < pool->sp_maxthreads - && svcpool_active(pool)) { - /* - * If the pool is running and we are - * decreasing, wake up some idle threads to - * encourage them to exit. - */ - LIST_FOREACH(st, &pool->sp_idlethreads, st_ilink) - cv_signal(&st->st_cond); - } pool->sp_maxthreads = newmaxthreads; + for (g = 0; g < pool->sp_groupcount; g++) { + pool->sp_groups[g].sg_maxthreads = max(1, + pool->sp_maxthreads / pool->sp_groupcount); + } mtx_unlock(&pool->sp_lock); } return (error); @@ -283,13 +302,17 @@ void xprt_register(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp; + int g; SVC_ACQUIRE(xprt); - mtx_lock(&pool->sp_lock); + g = atomic_fetchadd_int(&pool->sp_nextgroup, 1) % pool->sp_groupcount; + xprt->xp_group = grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); xprt->xp_registered = TRUE; xprt->xp_active = FALSE; - TAILQ_INSERT_TAIL(&pool->sp_xlist, xprt, xp_link); - mtx_unlock(&pool->sp_lock); + TAILQ_INSERT_TAIL(&grp->sg_xlist, xprt, xp_link); + mtx_unlock(&grp->sg_lock); } /* @@ -300,29 +323,29 @@ xprt_register(SVCXPRT *xprt) static void xprt_unregister_locked(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; - mtx_assert(&pool->sp_lock, MA_OWNED); + mtx_assert(&grp->sg_lock, MA_OWNED); KASSERT(xprt->xp_registered == TRUE, ("xprt_unregister_locked: not registered")); xprt_inactive_locked(xprt); - TAILQ_REMOVE(&pool->sp_xlist, xprt, xp_link); + TAILQ_REMOVE(&grp->sg_xlist, xprt, xp_link); xprt->xp_registered = FALSE; } void xprt_unregister(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); if (xprt->xp_registered == FALSE) { /* Already unregistered by another thread */ - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); return; } xprt_unregister_locked(xprt); - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); SVC_RELEASE(xprt); } @@ -333,11 +356,11 @@ xprt_unregister(SVCXPRT *xprt) static int xprt_assignthread(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; SVCTHREAD *st; - mtx_assert(&pool->sp_lock, MA_OWNED); - st = LIST_FIRST(&pool->sp_idlethreads); + mtx_assert(&grp->sg_lock, MA_OWNED); + st = LIST_FIRST(&grp->sg_idlethreads); if (st) { LIST_REMOVE(st, st_ilink); SVC_ACQUIRE(xprt); @@ -354,10 +377,10 @@ xprt_assignthread(SVCXPRT *xprt) * from a socket upcall). Don't create more * than one thread per second. */ - if (pool->sp_state == SVCPOOL_ACTIVE - && pool->sp_lastcreatetime < time_uptime - && pool->sp_threadcount < pool->sp_maxthreads) { - pool->sp_state = SVCPOOL_THREADWANTED; + if (grp->sg_state == SVCPOOL_ACTIVE + && grp->sg_lastcreatetime < time_uptime + && grp->sg_threadcount < grp->sg_maxthreads) { + grp->sg_state = SVCPOOL_THREADWANTED; } } return (FALSE); @@ -366,40 +389,40 @@ xprt_assignthread(SVCXPRT *xprt) void xprt_active(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); if (!xprt->xp_registered) { /* * Race with xprt_unregister - we lose. */ - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); return; } if (!xprt->xp_active) { xprt->xp_active = TRUE; if (xprt->xp_thread == NULL) { - if (!svc_request_space_available(pool) || + if (!svc_request_space_available(xprt->xp_pool) || !xprt_assignthread(xprt)) - TAILQ_INSERT_TAIL(&pool->sp_active, xprt, + TAILQ_INSERT_TAIL(&grp->sg_active, xprt, xp_alink); } } - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); } void xprt_inactive_locked(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; - mtx_assert(&pool->sp_lock, MA_OWNED); + mtx_assert(&grp->sg_lock, MA_OWNED); if (xprt->xp_active) { if (xprt->xp_thread == NULL) - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); + TAILQ_REMOVE(&grp->sg_active, xprt, xp_alink); xprt->xp_active = FALSE; } } @@ -407,11 +430,11 @@ xprt_inactive_locked(SVCXPRT *xprt) void xprt_inactive(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); xprt_inactive_locked(xprt); - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); } /* @@ -991,14 +1014,14 @@ svc_executereq(struct svc_req *rqstp) } static void -svc_checkidle(SVCPOOL *pool) +svc_checkidle(SVCGROUP *grp) { SVCXPRT *xprt, *nxprt; time_t timo; struct svcxprt_list cleanup; TAILQ_INIT(&cleanup); - TAILQ_FOREACH_SAFE(xprt, &pool->sp_xlist, xp_link, nxprt) { + TAILQ_FOREACH_SAFE(xprt, &grp->sg_xlist, xp_link, nxprt) { /* * Only some transports have idle timers. Don't time * something out which is just waking up. @@ -1013,27 +1036,31 @@ svc_checkidle(SVCPOOL *pool) } } - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { SVC_RELEASE(xprt); } - mtx_lock(&pool->sp_lock); - + mtx_lock(&grp->sg_lock); } static void svc_assign_waiting_sockets(SVCPOOL *pool) { + SVCGROUP *grp; SVCXPRT *xprt; + int g; - mtx_lock(&pool->sp_lock); - while ((xprt = TAILQ_FIRST(&pool->sp_active)) != NULL) { - if (xprt_assignthread(xprt)) - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); - else - break; + for (g = 0; g < pool->sp_groupcount; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + while ((xprt = TAILQ_FIRST(&grp->sg_active)) != NULL) { + if (xprt_assignthread(xprt)) + TAILQ_REMOVE(&grp->sg_active, xprt, xp_alink); + else + break; + } + mtx_unlock(&grp->sg_lock); } - mtx_unlock(&pool->sp_lock); } static void @@ -1067,8 +1094,9 @@ svc_request_space_available(SVCPOOL *poo } static void -svc_run_internal(SVCPOOL *pool, bool_t ismaster) +svc_run_internal(SVCGROUP *grp, bool_t ismaster) { + SVCPOOL *pool = grp->sg_pool; SVCTHREAD *st, *stpref; SVCXPRT *xprt; enum xprt_stat stat; @@ -1083,35 +1111,34 @@ svc_run_internal(SVCPOOL *pool, bool_t i STAILQ_INIT(&st->st_reqs); cv_init(&st->st_cond, "rpcsvc"); - mtx_lock(&pool->sp_lock); - LIST_INSERT_HEAD(&pool->sp_threads, st, st_link); + mtx_lock(&grp->sg_lock); /* * If we are a new thread which was spawned to cope with * increased load, set the state back to SVCPOOL_ACTIVE. */ - if (pool->sp_state == SVCPOOL_THREADSTARTING) - pool->sp_state = SVCPOOL_ACTIVE; + if (grp->sg_state == SVCPOOL_THREADSTARTING) + grp->sg_state = SVCPOOL_ACTIVE; - while (pool->sp_state != SVCPOOL_CLOSING) { + while (grp->sg_state != SVCPOOL_CLOSING) { /* * Create new thread if requested. */ - if (pool->sp_state == SVCPOOL_THREADWANTED) { - pool->sp_state = SVCPOOL_THREADSTARTING; - pool->sp_lastcreatetime = time_uptime; - mtx_unlock(&pool->sp_lock); - svc_new_thread(pool); - mtx_lock(&pool->sp_lock); + if (grp->sg_state == SVCPOOL_THREADWANTED) { + grp->sg_state = SVCPOOL_THREADSTARTING; + grp->sg_lastcreatetime = time_uptime; + mtx_unlock(&grp->sg_lock); + svc_new_thread(grp); + mtx_lock(&grp->sg_lock); continue; } /* * Check for idle transports once per second. */ - if (time_uptime > pool->sp_lastidlecheck) { - pool->sp_lastidlecheck = time_uptime; - svc_checkidle(pool); + if (time_uptime > grp->sg_lastidlecheck) { + grp->sg_lastidlecheck = time_uptime; + svc_checkidle(grp); } xprt = st->st_xprt; @@ -1119,7 +1146,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i /* * Enforce maxthreads count. */ - if (pool->sp_threadcount > pool->sp_maxthreads) + if (grp->sg_threadcount > grp->sg_maxthreads) break; /* @@ -1128,22 +1155,22 @@ svc_run_internal(SVCPOOL *pool, bool_t i * by a thread. */ if (svc_request_space_available(pool) && - (xprt = TAILQ_FIRST(&pool->sp_active)) != NULL) { - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); + (xprt = TAILQ_FIRST(&grp->sg_active)) != NULL) { + TAILQ_REMOVE(&grp->sg_active, xprt, xp_alink); SVC_ACQUIRE(xprt); xprt->xp_thread = st; st->st_xprt = xprt; continue; } - LIST_INSERT_HEAD(&pool->sp_idlethreads, st, st_ilink); + LIST_INSERT_HEAD(&grp->sg_idlethreads, st, st_ilink); if (ismaster || (!ismaster && - pool->sp_threadcount > pool->sp_minthreads)) + grp->sg_threadcount > grp->sg_minthreads)) error = cv_timedwait_sig(&st->st_cond, - &pool->sp_lock, 5 * hz); + &grp->sg_lock, 5 * hz); else error = cv_wait_sig(&st->st_cond, - &pool->sp_lock); + &grp->sg_lock); if (st->st_xprt == NULL) LIST_REMOVE(st, st_ilink); @@ -1152,19 +1179,19 @@ svc_run_internal(SVCPOOL *pool, bool_t i */ if (error == EWOULDBLOCK) { if (!ismaster - && (pool->sp_threadcount - > pool->sp_minthreads) + && (grp->sg_threadcount + > grp->sg_minthreads) && !st->st_xprt) break; } else if (error) { - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); svc_exit(pool); - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); break; } continue; } - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); /* * Drain the transport socket and queue up any RPCs. @@ -1196,7 +1223,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i } } } while (rqstp == NULL && stat == XPRT_MOREREQS - && pool->sp_state != SVCPOOL_CLOSING); + && grp->sg_state != SVCPOOL_CLOSING); /* * Move this transport to the end of the active list to @@ -1204,16 +1231,16 @@ svc_run_internal(SVCPOOL *pool, bool_t i * If this was the last queued request, svc_getreq will end * up calling xprt_inactive to remove from the active list. */ - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); xprt->xp_thread = NULL; st->st_xprt = NULL; if (xprt->xp_active) { if (!svc_request_space_available(pool) || !xprt_assignthread(xprt)) - TAILQ_INSERT_TAIL(&pool->sp_active, + TAILQ_INSERT_TAIL(&grp->sg_active, xprt, xp_alink); } - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); SVC_RELEASE(xprt); /* @@ -1230,7 +1257,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i } mtx_unlock(&st->st_lock); svc_change_space_used(pool, -sz); - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); } if (st->st_xprt) { @@ -1238,46 +1265,43 @@ svc_run_internal(SVCPOOL *pool, bool_t i st->st_xprt = NULL; SVC_RELEASE(xprt); } - KASSERT(STAILQ_EMPTY(&st->st_reqs), ("stray reqs on exit")); - LIST_REMOVE(st, st_link); - pool->sp_threadcount--; - - mtx_unlock(&pool->sp_lock); - mtx_destroy(&st->st_lock); cv_destroy(&st->st_cond); mem_free(st, sizeof(*st)); + grp->sg_threadcount--; if (!ismaster) - wakeup(pool); + wakeup(grp); + mtx_unlock(&grp->sg_lock); } static void svc_thread_start(void *arg) { - svc_run_internal((SVCPOOL *) arg, FALSE); + svc_run_internal((SVCGROUP *) arg, FALSE); kthread_exit(); } static void -svc_new_thread(SVCPOOL *pool) +svc_new_thread(SVCGROUP *grp) { + SVCPOOL *pool = grp->sg_pool; struct thread *td; - pool->sp_threadcount++; - kthread_add(svc_thread_start, pool, - pool->sp_proc, &td, 0, 0, + grp->sg_threadcount++; + kthread_add(svc_thread_start, grp, pool->sp_proc, &td, 0, 0, "%s: service", pool->sp_name); } void svc_run(SVCPOOL *pool) { - int i; + int g, i; struct proc *p; struct thread *td; + SVCGROUP *grp; p = curproc; td = curthread; @@ -1285,35 +1309,56 @@ svc_run(SVCPOOL *pool) "%s: master", pool->sp_name); pool->sp_state = SVCPOOL_ACTIVE; pool->sp_proc = p; - pool->sp_lastcreatetime = time_uptime; - pool->sp_threadcount = 1; - for (i = 1; i < pool->sp_minthreads; i++) { - svc_new_thread(pool); + /* Choose group count based on number of threads and CPUs. */ + pool->sp_groupcount = max(1, min(SVC_MAXGROUPS, + min(pool->sp_maxthreads / 2, mp_ncpus) / 6)); + for (g = 0; g < pool->sp_groupcount; g++) { + grp = &pool->sp_groups[g]; + grp->sg_minthreads = max(1, + pool->sp_minthreads / pool->sp_groupcount); + grp->sg_maxthreads = max(1, + pool->sp_maxthreads / pool->sp_groupcount); + grp->sg_lastcreatetime = time_uptime; + } + + /* Starting threads */ + for (g = 0; g < pool->sp_groupcount; g++) { + grp = &pool->sp_groups[g]; + for (i = ((g == 0) ? 1 : 0); i < grp->sg_minthreads; i++) + svc_new_thread(grp); + } + pool->sp_groups[0].sg_threadcount++; + svc_run_internal(&pool->sp_groups[0], TRUE); + + /* Waiting for threads to stop. */ + for (g = 0; g < pool->sp_groupcount; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + while (grp->sg_threadcount > 0) + msleep(grp, &grp->sg_lock, 0, "svcexit", 0); + mtx_unlock(&grp->sg_lock); } - - svc_run_internal(pool, TRUE); - - mtx_lock(&pool->sp_lock); - while (pool->sp_threadcount > 0) - msleep(pool, &pool->sp_lock, 0, "svcexit", 0); - mtx_unlock(&pool->sp_lock); } void svc_exit(SVCPOOL *pool) { + SVCGROUP *grp; SVCTHREAD *st; + int g; - mtx_lock(&pool->sp_lock); - - if (pool->sp_state != SVCPOOL_CLOSING) { - pool->sp_state = SVCPOOL_CLOSING; - LIST_FOREACH(st, &pool->sp_idlethreads, st_ilink) - cv_signal(&st->st_cond); + pool->sp_state = SVCPOOL_CLOSING; + for (g = 0; g < pool->sp_groupcount; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + if (grp->sg_state != SVCPOOL_CLOSING) { + grp->sg_state = SVCPOOL_CLOSING; + LIST_FOREACH(st, &grp->sg_idlethreads, st_ilink) + cv_signal(&st->st_cond); + } + mtx_unlock(&grp->sg_lock); } - - mtx_unlock(&pool->sp_lock); } bool_t Modified: stable/10/sys/rpc/svc.h ============================================================================== --- stable/10/sys/rpc/svc.h Sun Jun 22 18:02:39 2014 (r267741) +++ stable/10/sys/rpc/svc.h Sun Jun 22 18:03:53 2014 (r267742) @@ -137,6 +137,7 @@ struct xp_ops2 { #ifdef _KERNEL struct __rpc_svcpool; +struct __rpc_svcgroup; struct __rpc_svcthread; #endif @@ -150,6 +151,7 @@ typedef struct __rpc_svcxprt { volatile u_int xp_refs; struct sx xp_lock; struct __rpc_svcpool *xp_pool; /* owning pool (see below) */ + struct __rpc_svcgroup *xp_group; /* owning group (see below) */ TAILQ_ENTRY(__rpc_svcxprt) xp_link; TAILQ_ENTRY(__rpc_svcxprt) xp_alink; bool_t xp_registered; /* xprt_register has been called */ @@ -245,8 +247,6 @@ struct svc_loss_callout { }; TAILQ_HEAD(svc_loss_callout_list, svc_loss_callout); -struct __rpc_svcthread; - /* * Service request */ @@ -296,7 +296,6 @@ typedef struct __rpc_svcthread { SVCXPRT *st_xprt; /* transport we are processing */ struct svc_reqlist st_reqs; /* RPC requests to execute */ struct cv st_cond; /* sleeping for work */ - LIST_ENTRY(__rpc_svcthread) st_link; /* all threads list */ LIST_ENTRY(__rpc_svcthread) st_ilink; /* idle threads list */ LIST_ENTRY(__rpc_svcthread) st_alink; /* application thread list */ int st_p2; /* application workspace */ @@ -305,6 +304,36 @@ typedef struct __rpc_svcthread { LIST_HEAD(svcthread_list, __rpc_svcthread); /* + * A thread group contain all information needed to assign subset of + * transports to subset of threads. On systems with many CPUs and many + * threads that allows to reduce lock congestion and improve performance. + * Hundreds of threads on dozens of CPUs sharing the single pool lock do + * not scale well otherwise. + */ +TAILQ_HEAD(svcxprt_list, __rpc_svcxprt); +enum svcpool_state { + SVCPOOL_INIT, /* svc_run not called yet */ + SVCPOOL_ACTIVE, /* normal running state */ + SVCPOOL_THREADWANTED, /* new service thread requested */ + SVCPOOL_THREADSTARTING, /* new service thread started */ + SVCPOOL_CLOSING /* svc_exit called */ +}; +typedef struct __rpc_svcgroup { + struct mtx_padalign sg_lock; /* protect the thread/req lists */ + struct __rpc_svcpool *sg_pool; + enum svcpool_state sg_state; /* current pool state */ + struct svcxprt_list sg_xlist; /* all transports in the group */ + struct svcxprt_list sg_active; /* transports needing service */ + struct svcthread_list sg_idlethreads; /* idle service threads */ + + int sg_minthreads; /* minimum service thread count */ + int sg_maxthreads; /* maximum service thread count */ + int sg_threadcount; /* current service thread count */ + time_t sg_lastcreatetime; /* when we last started a thread */ + time_t sg_lastidlecheck; /* when we last checked idle transports */ +} SVCGROUP; + +/* * In the kernel, we can't use global variables to store lists of * transports etc. since otherwise we could not have two unrelated RPC * services running, each on its own thread. We solve this by @@ -316,32 +345,18 @@ LIST_HEAD(svcthread_list, __rpc_svcthrea * this to support something similar to the Solaris multi-threaded RPC * server. */ -TAILQ_HEAD(svcxprt_list, __rpc_svcxprt); -enum svcpool_state { - SVCPOOL_INIT, /* svc_run not called yet */ - SVCPOOL_ACTIVE, /* normal running state */ - SVCPOOL_THREADWANTED, /* new service thread requested */ - SVCPOOL_THREADSTARTING, /* new service thread started */ - SVCPOOL_CLOSING /* svc_exit called */ -}; typedef SVCTHREAD *pool_assign_fn(SVCTHREAD *, struct svc_req *); typedef void pool_done_fn(SVCTHREAD *, struct svc_req *); +#define SVC_MAXGROUPS 16 typedef struct __rpc_svcpool { struct mtx_padalign sp_lock; /* protect the transport lists */ const char *sp_name; /* pool name (e.g. "nfsd", "NLM" */ enum svcpool_state sp_state; /* current pool state */ struct proc *sp_proc; /* process which is in svc_run */ - struct svcxprt_list sp_xlist; /* all transports in the pool */ - struct svcxprt_list sp_active; /* transports needing service */ struct svc_callout_list sp_callouts; /* (prog,vers)->dispatch list */ struct svc_loss_callout_list sp_lcallouts; /* loss->dispatch list */ - struct svcthread_list sp_threads; /* service threads */ - struct svcthread_list sp_idlethreads; /* idle service threads */ int sp_minthreads; /* minimum service thread count */ int sp_maxthreads; /* maximum service thread count */ - int sp_threadcount; /* current service thread count */ - time_t sp_lastcreatetime; /* when we last started a thread */ - time_t sp_lastidlecheck; /* when we last checked idle transports */ /* * Hooks to allow an application to control request to thread @@ -364,6 +379,10 @@ typedef struct __rpc_svcpool { struct replay_cache *sp_rcache; /* optional replay cache */ struct sysctl_ctx_list sp_sysctl; + + int sp_groupcount; /* Number of groups in the pool. */ + int sp_nextgroup; /* Next group to assign port. */ + SVCGROUP sp_groups[SVC_MAXGROUPS]; /* Thread/port groups. */ } SVCPOOL; #else Modified: stable/10/sys/rpc/svc_generic.c ============================================================================== --- stable/10/sys/rpc/svc_generic.c Sun Jun 22 18:02:39 2014 (r267741) +++ stable/10/sys/rpc/svc_generic.c Sun Jun 22 18:03:53 2014 (r267742) @@ -86,7 +86,8 @@ svc_create( rpcvers_t versnum, /* Version number */ const char *nettype) /* Networktype token */ { - int num = 0; + int g, num = 0; + SVCGROUP *grp; SVCXPRT *xprt; struct netconfig *nconf; void *handle; @@ -96,11 +97,14 @@ svc_create( return (0); } while ((nconf = __rpc_getconf(handle)) != NULL) { - mtx_lock(&pool->sp_lock); - TAILQ_FOREACH(xprt, &pool->sp_xlist, xp_link) { - if (strcmp(xprt->xp_netid, nconf->nc_netid) == 0) { + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + TAILQ_FOREACH(xprt, &grp->sg_xlist, xp_link) { + if (strcmp(xprt->xp_netid, nconf->nc_netid)) + continue; /* Found an old one, use it */ - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); (void) rpcb_unset(prognum, versnum, nconf); if (svc_reg(xprt, prognum, versnum, dispatch, nconf) == FALSE) { @@ -108,15 +112,15 @@ svc_create( "svc_create: could not register prog %u vers %u on %s\n", (unsigned)prognum, (unsigned)versnum, nconf->nc_netid); - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); } else { num++; - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); break; } } + mtx_unlock(&grp->sg_lock); } - mtx_unlock(&pool->sp_lock); if (xprt == NULL) { /* It was not found. Now create a new one */ xprt = svc_tp_create(pool, dispatch, prognum, versnum, From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 18:06:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D6C93623; Sun, 22 Jun 2014 18:06: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 AA13E296A; Sun, 22 Jun 2014 18:06: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 s5MI6BKA082944; Sun, 22 Jun 2014 18:06:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MI6Bsn082943; Sun, 22 Jun 2014 18:06:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406221806.s5MI6Bsn082943@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 18:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267743 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 18:06:11 -0000 Author: mav Date: Sun Jun 22 18:06:11 2014 New Revision: 267743 URL: http://svnweb.freebsd.org/changeset/base/267743 Log: MFC r267232, r267239: Use atomics to modify numvnodes variable. This allows to mostly avoid lock usage in getnewvnode_[drop_]reserve(), that reduces number of global vnode_free_list_mtx mutex acquisitions from 4 to 2 per NFS request on ZFS, improving SMP scalability. Modified: stable/10/sys/kern/vfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Sun Jun 22 18:03:53 2014 (r267742) +++ stable/10/sys/kern/vfs_subr.c Sun Jun 22 18:06:11 2014 (r267743) @@ -997,12 +997,19 @@ getnewvnode_reserve(u_int count) struct thread *td; td = curthread; + /* First try to be quick and racy. */ + if (atomic_fetchadd_long(&numvnodes, count) + count <= desiredvnodes) { + td->td_vp_reserv += count; + return; + } else + atomic_subtract_long(&numvnodes, count); + mtx_lock(&vnode_free_list_mtx); while (count > 0) { if (getnewvnode_wait(0) == 0) { count--; td->td_vp_reserv++; - numvnodes++; + atomic_add_long(&numvnodes, 1); } } mtx_unlock(&vnode_free_list_mtx); @@ -1014,10 +1021,7 @@ getnewvnode_drop_reserve(void) struct thread *td; td = curthread; - mtx_lock(&vnode_free_list_mtx); - KASSERT(numvnodes >= td->td_vp_reserv, ("reserve too large")); - numvnodes -= td->td_vp_reserv; - mtx_unlock(&vnode_free_list_mtx); + atomic_subtract_long(&numvnodes, td->td_vp_reserv); td->td_vp_reserv = 0; } @@ -1054,7 +1058,7 @@ getnewvnode(const char *tag, struct moun return (error); } #endif - numvnodes++; + atomic_add_long(&numvnodes, 1); mtx_unlock(&vnode_free_list_mtx); alloc: vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK|M_ZERO); @@ -2383,9 +2387,7 @@ vdropl(struct vnode *vp) * The vnode has been marked for destruction, so free it. */ CTR2(KTR_VFS, "%s: destroying the vnode %p", __func__, vp); - mtx_lock(&vnode_free_list_mtx); - numvnodes--; - mtx_unlock(&vnode_free_list_mtx); + atomic_subtract_long(&numvnodes, 1); bo = &vp->v_bufobj; VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, ("cleaned vnode still on the free list.")); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 20:24:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4D09A366; Sun, 22 Jun 2014 20:24: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 3977D233C; Sun, 22 Jun 2014 20:24: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 s5MKOI3I050396; Sun, 22 Jun 2014 20:24:18 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MKOH9G050393; Sun, 22 Jun 2014 20:24:17 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201406222024.s5MKOH9G050393@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 22 Jun 2014 20:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267746 - stable/10/usr.bin/patch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 20:24:18 -0000 Author: pfg Date: Sun Jun 22 20:24:17 2014 New Revision: 267746 URL: http://svnweb.freebsd.org/changeset/base/267746 Log: MFC r267490: patch: unsign the line length to avoid overflows. Patch(1) uses a short int for the line length, which is usually sufficient for regular diffs, but makes no effort to signal when there is an overflow. Change the line length to an unsigned short int to better use the fact that a length is never negative. The change is loosely inspired on a related change in DragonFly, but we avoid spending more memory than necessary. While here adjust the messages to be clearer on what is happening. Modified: stable/10/usr.bin/patch/patch.c stable/10/usr.bin/patch/pch.c stable/10/usr.bin/patch/pch.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/patch/patch.c ============================================================================== --- stable/10/usr.bin/patch/patch.c Sun Jun 22 20:13:57 2014 (r267745) +++ stable/10/usr.bin/patch/patch.c Sun Jun 22 20:24:17 2014 (r267746) @@ -742,14 +742,18 @@ abort_context_hunk(void) static void rej_line(int ch, LINENUM i) { - size_t len; + unsigned short len; const char *line = pfetch(i); - len = strlen(line); + len = strnlen(line, USHRT_MAX); fprintf(rejfp, "%c%s", ch, line); - if (len == 0 || line[len-1] != '\n') - fprintf(rejfp, "\n\\ No newline at end of file\n"); + if (len == 0 || line[len-1] != '\n') { + if (len >= USHRT_MAX) + fprintf(rejfp, "\n\\ Line too long\n"); + else + fprintf(rejfp, "\n\\ No newline at end of line\n"); + } } static void @@ -1016,7 +1020,7 @@ patch_match(LINENUM base, LINENUM offset LINENUM pat_lines = pch_ptrn_lines() - fuzz; const char *ilineptr; const char *plineptr; - short plinelen; + unsigned short plinelen; for (iline = base + offset + fuzz; pline <= pat_lines; pline++, iline++) { ilineptr = ifetch(iline, offset >= 0); Modified: stable/10/usr.bin/patch/pch.c ============================================================================== --- stable/10/usr.bin/patch/pch.c Sun Jun 22 20:13:57 2014 (r267745) +++ stable/10/usr.bin/patch/pch.c Sun Jun 22 20:24:17 2014 (r267746) @@ -56,7 +56,7 @@ static LINENUM p_max; /* max allowed va static LINENUM p_context = 3; /* # of context lines */ static LINENUM p_input_line = 0; /* current line # from patch file */ static char **p_line = NULL;/* the text of the hunk */ -static short *p_len = NULL; /* length of each line */ +static unsigned short *p_len = NULL; /* length of each line */ static char *p_char = NULL; /* +, -, and ! */ static int hunkmax = INITHUNKMAX; /* size of above arrays to begin with */ static int p_indent; /* indent to patch */ @@ -134,7 +134,7 @@ set_hunkmax(void) if (p_line == NULL) p_line = malloc(hunkmax * sizeof(char *)); if (p_len == NULL) - p_len = malloc(hunkmax * sizeof(short)); + p_len = malloc(hunkmax * sizeof(unsigned short)); if (p_char == NULL) p_char = malloc(hunkmax * sizeof(char)); } @@ -151,7 +151,7 @@ grow_hunkmax(void) fatal("Internal memory allocation error\n"); p_line = reallocf(p_line, new_hunkmax * sizeof(char *)); - p_len = reallocf(p_len, new_hunkmax * sizeof(short)); + p_len = reallocf(p_len, new_hunkmax * sizeof(unsigned short)); p_char = reallocf(p_char, new_hunkmax * sizeof(char)); if (p_line != NULL && p_len != NULL && p_char != NULL) { @@ -1201,7 +1201,7 @@ bool pch_swap(void) { char **tp_line; /* the text of the hunk */ - short *tp_len; /* length of each line */ + unsigned short *tp_len;/* length of each line */ char *tp_char; /* +, -, and ! */ LINENUM i; LINENUM n; @@ -1358,7 +1358,7 @@ pch_context(void) /* * Return the length of a particular patch line. */ -short +unsigned short pch_line_len(LINENUM line) { return p_len[line]; Modified: stable/10/usr.bin/patch/pch.h ============================================================================== --- stable/10/usr.bin/patch/pch.h Sun Jun 22 20:13:57 2014 (r267745) +++ stable/10/usr.bin/patch/pch.h Sun Jun 22 20:24:17 2014 (r267746) @@ -44,7 +44,7 @@ bool there_is_another_patch(void); bool another_hunk(void); bool pch_swap(void); char *pfetch(LINENUM); -short pch_line_len(LINENUM); +unsigned short pch_line_len(LINENUM); LINENUM pch_first(void); LINENUM pch_ptrn_lines(void); LINENUM pch_newfirst(void); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 20:29:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E57525CD; Sun, 22 Jun 2014 20:29: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 D2142236A; Sun, 22 Jun 2014 20:29: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 s5MKTpdT051288; Sun, 22 Jun 2014 20:29:51 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MKTpqH051286; Sun, 22 Jun 2014 20:29:51 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201406222029.s5MKTpqH051286@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 22 Jun 2014 20:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267747 - stable/10/usr.bin/patch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 20:29:52 -0000 Author: pfg Date: Sun Jun 22 20:29:51 2014 New Revision: 267747 URL: http://svnweb.freebsd.org/changeset/base/267747 Log: MFC r267512: patch: add dry-run alias for compatibility with other implementations. Other implementations of patch(1), including GNU patch and "svn patch" have a --dry-run option which does the same as our -C or --check option. Add a new alias to make our implementation more compatible. Modified: stable/10/usr.bin/patch/patch.1 stable/10/usr.bin/patch/patch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/patch/patch.1 ============================================================================== --- stable/10/usr.bin/patch/patch.1 Sun Jun 22 20:24:17 2014 (r267746) +++ stable/10/usr.bin/patch/patch.1 Sun Jun 22 20:29:51 2014 (r267747) @@ -21,7 +21,7 @@ .\" .\" $OpenBSD: patch.1,v 1.27 2014/04/15 06:26:54 jmc Exp $ .\" $FreeBSD$ -.Dd June 12, 2014 +.Dd June 15, 2014 .Dt PATCH 1 .Os .Sh NAME @@ -107,7 +107,7 @@ This is equivalent to specifying This option is currently the default, unless .Fl -posix is specified. -.It Fl C , Fl Fl check +.It Fl C , Fl Fl check , Fl Fl dry-run Checks that the patch would apply cleanly, but does not modify anything. .It Fl c , Fl Fl context Forces Modified: stable/10/usr.bin/patch/patch.c ============================================================================== --- stable/10/usr.bin/patch/patch.c Sun Jun 22 20:24:17 2014 (r267746) +++ stable/10/usr.bin/patch/patch.c Sun Jun 22 20:29:51 2014 (r267747) @@ -469,6 +469,7 @@ get_some_switches(void) {"context", no_argument, 0, 'c'}, {"debug", required_argument, 0, 'x'}, {"directory", required_argument, 0, 'd'}, + {"dry-run", no_argument, 0, 'C'}, {"ed", no_argument, 0, 'e'}, {"force", no_argument, 0, 'f'}, {"forward", no_argument, 0, 'N'}, From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 21:14:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DE747F3B; Sun, 22 Jun 2014 21:14: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 CB7B0269E; Sun, 22 Jun 2014 21:14: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 s5MLEYBZ074290; Sun, 22 Jun 2014 21:14:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MLEYnZ074289; Sun, 22 Jun 2014 21:14:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406222114.s5MLEYnZ074289@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 21:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267748 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 21:14:35 -0000 Author: mav Date: Sun Jun 22 21:14:34 2014 New Revision: 267748 URL: http://svnweb.freebsd.org/changeset/base/267748 Log: MFC r267362: Remove unneeded mountlist_mtx acquisition from sync_fsync(). All struct mount fields accessed by sync_fsync() are protected by MNT_MTX. Modified: stable/10/sys/kern/vfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Sun Jun 22 20:29:51 2014 (r267747) +++ stable/10/sys/kern/vfs_subr.c Sun Jun 22 21:14:34 2014 (r267748) @@ -3654,11 +3654,8 @@ sync_fsync(struct vop_fsync_args *ap) * Walk the list of vnodes pushing all that are dirty and * not already on the sync list. */ - mtx_lock(&mountlist_mtx); - if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK) != 0) { - mtx_unlock(&mountlist_mtx); + if (vfs_busy(mp, MBF_NOWAIT) != 0) return (0); - } if (vn_start_write(NULL, &mp, V_NOWAIT) != 0) { vfs_unbusy(mp); return (0); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 21:16:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A74C41EA; Sun, 22 Jun 2014 21:16: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 7A39026B3; Sun, 22 Jun 2014 21:16: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 s5MLGJte074740; Sun, 22 Jun 2014 21:16:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MLGJmp074739; Sun, 22 Jun 2014 21:16:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406222116.s5MLGJmp074739@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 21:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267749 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 21:16:19 -0000 Author: mav Date: Sun Jun 22 21:16:18 2014 New Revision: 267749 URL: http://svnweb.freebsd.org/changeset/base/267749 Log: MFC r267392: Implement simple direct-mapped cache for popular filesystem identifiers to avoid congestion on global mountlist_mtx mutex in vfs_busyfs(), while traversing through the list of mount points. This change significantly improves NFS server scalability, since it had to do this translation for every request, and the global lock becomes quite congested. This code is more optimized for relatively small number of mount points. On systems with hundreds of active mount points this simple cache may have many collisions. But the original traversal code in that case should also behave much worse, so we are not loosing much. Modified: stable/10/sys/kern/vfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Sun Jun 22 21:14:34 2014 (r267748) +++ stable/10/sys/kern/vfs_subr.c Sun Jun 22 21:16:18 2014 (r267749) @@ -500,23 +500,53 @@ vfs_getvfs(fsid_t *fsid) /* * Lookup a mount point by filesystem identifier, busying it before * returning. + * + * To avoid congestion on mountlist_mtx, implement simple direct-mapped + * cache for popular filesystem identifiers. The cache is lockess, using + * the fact that struct mount's are never freed. In worst case we may + * get pointer to unmounted or even different filesystem, so we have to + * check what we got, and go slow way if so. */ struct mount * vfs_busyfs(fsid_t *fsid) { +#define FSID_CACHE_SIZE 256 + typedef struct mount * volatile vmp_t; + static vmp_t cache[FSID_CACHE_SIZE]; struct mount *mp; int error; + uint32_t hash; CTR2(KTR_VFS, "%s: fsid %p", __func__, fsid); + hash = fsid->val[0] ^ fsid->val[1]; + hash = (hash >> 16 ^ hash) & (FSID_CACHE_SIZE - 1); + mp = cache[hash]; + if (mp == NULL || + mp->mnt_stat.f_fsid.val[0] != fsid->val[0] || + mp->mnt_stat.f_fsid.val[1] != fsid->val[1]) + goto slow; + if (vfs_busy(mp, 0) != 0) { + cache[hash] = NULL; + goto slow; + } + if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && + mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) + return (mp); + else + vfs_unbusy(mp); + +slow: mtx_lock(&mountlist_mtx); TAILQ_FOREACH(mp, &mountlist, mnt_list) { if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) { error = vfs_busy(mp, MBF_MNTLSTLOCK); if (error) { + cache[hash] = NULL; mtx_unlock(&mountlist_mtx); return (NULL); } + cache[hash] = mp; return (mp); } } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 21:18:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2F4484F2; Sun, 22 Jun 2014 21:18: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 1CB9826CD; Sun, 22 Jun 2014 21:18: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 s5MLIO0W075307; Sun, 22 Jun 2014 21:18:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MLIOxX075305; Sun, 22 Jun 2014 21:18:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406222118.s5MLIOxX075305@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 21:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267750 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 21:18:25 -0000 Author: mav Date: Sun Jun 22 21:18:24 2014 New Revision: 267750 URL: http://svnweb.freebsd.org/changeset/base/267750 Log: MFC r267387: Allocating new bucket for bucket zone, never take it from the zone itself, since it will almost certanly fail. Take next bigger zone instead. This situation should not happen with original bucket zones configuration: "32 Bucket" zone uses "64 Bucket" and vice versa. But if "64 Bucket" zone lock is congested, zone may grow its bucket size and start biting itself. Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Sun Jun 22 21:16:18 2014 (r267749) +++ stable/10/sys/vm/uma_core.c Sun Jun 22 21:18:24 2014 (r267750) @@ -381,6 +381,8 @@ bucket_alloc(uma_zone_t zone, void *udat if ((uintptr_t)udata & UMA_ZFLAG_CACHEONLY) flags |= M_NOVM; ubz = bucket_zone_lookup(zone->uz_count); + if (ubz->ubz_zone == zone && (ubz + 1)->ubz_entries != 0) + ubz++; bucket = uma_zalloc_arg(ubz->ubz_zone, udata, flags); if (bucket) { #ifdef INVARIANTS From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 21:19:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E4DBD625; Sun, 22 Jun 2014 21:19: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 D207F26D3; Sun, 22 Jun 2014 21:19: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 s5MLJJ2g075491; Sun, 22 Jun 2014 21:19:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MLJJAC075490; Sun, 22 Jun 2014 21:19:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406222119.s5MLJJAC075490@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 21:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267751 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 21:19:20 -0000 Author: mav Date: Sun Jun 22 21:19:19 2014 New Revision: 267751 URL: http://svnweb.freebsd.org/changeset/base/267751 Log: MFC r267391: Introduce new "256 Bucket" zone to split requests and reduce congestion on "128 Bucket" zone lock. Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Sun Jun 22 21:18:24 2014 (r267750) +++ stable/10/sys/vm/uma_core.c Sun Jun 22 21:19:19 2014 (r267751) @@ -205,7 +205,7 @@ struct uma_bucket_zone { #define BUCKET_SIZE(n) \ (((sizeof(void *) * (n)) - sizeof(struct uma_bucket)) / sizeof(void *)) -#define BUCKET_MAX BUCKET_SIZE(128) +#define BUCKET_MAX BUCKET_SIZE(256) struct uma_bucket_zone bucket_zones[] = { { NULL, "4 Bucket", BUCKET_SIZE(4), 4096 }, @@ -216,6 +216,7 @@ struct uma_bucket_zone bucket_zones[] = { NULL, "32 Bucket", BUCKET_SIZE(32), 512 }, { NULL, "64 Bucket", BUCKET_SIZE(64), 256 }, { NULL, "128 Bucket", BUCKET_SIZE(128), 128 }, + { NULL, "256 Bucket", BUCKET_SIZE(256), 64 }, { NULL, NULL, 0} }; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 21:21:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 48225795; Sun, 22 Jun 2014 21:21: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 1B93C274D; Sun, 22 Jun 2014 21:21: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 s5MLLRfS078047; Sun, 22 Jun 2014 21:21:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MLLRjY078046; Sun, 22 Jun 2014 21:21:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406222121.s5MLLRjY078046@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 21:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267752 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 21:21:28 -0000 Author: mav Date: Sun Jun 22 21:21:27 2014 New Revision: 267752 URL: http://svnweb.freebsd.org/changeset/base/267752 Log: MFC r267351: Move root_mount_hold() functionality to separate mutex. It has nothing to share with mutex protecting list of mounted file systems. Modified: stable/10/sys/kern/vfs_mountroot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_mountroot.c ============================================================================== --- stable/10/sys/kern/vfs_mountroot.c Sun Jun 22 21:19:19 2014 (r267751) +++ stable/10/sys/kern/vfs_mountroot.c Sun Jun 22 21:21:27 2014 (r267752) @@ -97,6 +97,9 @@ struct vnode *rootvnode; char *rootdevnames[2] = {NULL, NULL}; +struct mtx root_holds_mtx; +MTX_SYSINIT(root_holds, &root_holds_mtx, "root_holds", MTX_DEF); + struct root_hold_token { const char *who; LIST_ENTRY(root_hold_token) list; @@ -131,9 +134,9 @@ root_mount_hold(const char *identifier) h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK); h->who = identifier; - mtx_lock(&mountlist_mtx); + mtx_lock(&root_holds_mtx); LIST_INSERT_HEAD(&root_holds, h, list); - mtx_unlock(&mountlist_mtx); + mtx_unlock(&root_holds_mtx); return (h); } @@ -143,10 +146,10 @@ root_mount_rel(struct root_hold_token *h if (h == NULL) return; - mtx_lock(&mountlist_mtx); + mtx_lock(&root_holds_mtx); LIST_REMOVE(h, list); wakeup(&root_holds); - mtx_unlock(&mountlist_mtx); + mtx_unlock(&root_holds_mtx); free(h, M_DEVBUF); } @@ -168,12 +171,12 @@ root_mount_wait(void) */ KASSERT(curthread->td_proc->p_pid != 0, ("root_mount_wait: cannot be called from the swapper thread")); - mtx_lock(&mountlist_mtx); + mtx_lock(&root_holds_mtx); while (!root_mount_complete) { - msleep(&root_mount_complete, &mountlist_mtx, PZERO, "rootwait", + msleep(&root_mount_complete, &root_holds_mtx, PZERO, "rootwait", hz); } - mtx_unlock(&mountlist_mtx); + mtx_unlock(&root_holds_mtx); } static void @@ -908,9 +911,9 @@ vfs_mountroot_wait(void) DROP_GIANT(); g_waitidle(); PICKUP_GIANT(); - mtx_lock(&mountlist_mtx); + mtx_lock(&root_holds_mtx); if (LIST_EMPTY(&root_holds)) { - mtx_unlock(&mountlist_mtx); + mtx_unlock(&root_holds_mtx); break; } if (ppsratecheck(&lastfail, &curfail, 1)) { @@ -919,7 +922,7 @@ vfs_mountroot_wait(void) printf(" %s", h->who); printf("\n"); } - msleep(&root_holds, &mountlist_mtx, PZERO | PDROP, "roothold", + msleep(&root_holds, &root_holds_mtx, PZERO | PDROP, "roothold", hz); } } @@ -979,10 +982,10 @@ vfs_mountroot(void) vref(prison0.pr_root); mtx_unlock(&prison0.pr_mtx); - mtx_lock(&mountlist_mtx); + mtx_lock(&root_holds_mtx); atomic_store_rel_int(&root_mount_complete, 1); wakeup(&root_mount_complete); - mtx_unlock(&mountlist_mtx); + mtx_unlock(&root_holds_mtx); EVENTHANDLER_INVOKE(mountroot); } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 21:26:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A064E93D; Sun, 22 Jun 2014 21:26: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 72AF52786; Sun, 22 Jun 2014 21:26: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 s5MLQl1N079738; Sun, 22 Jun 2014 21:26:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MLQlSU079737; Sun, 22 Jun 2014 21:26:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406222126.s5MLQlSU079737@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 21:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267753 - stable/10/sys/nfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 21:26:47 -0000 Author: mav Date: Sun Jun 22 21:26:46 2014 New Revision: 267753 URL: http://svnweb.freebsd.org/changeset/base/267753 Log: MFC r267479: Fix/improve fhe_stats sysctl output. Modified: stable/10/sys/nfs/nfs_fha.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/nfs/nfs_fha.c ============================================================================== --- stable/10/sys/nfs/nfs_fha.c Sun Jun 22 21:21:27 2014 (r267752) +++ stable/10/sys/nfs/nfs_fha.c Sun Jun 22 21:26:46 2014 (r267753) @@ -468,14 +468,14 @@ fha_nd_complete(SVCTHREAD *thread, struc int fhe_stats_sysctl(SYSCTL_HANDLER_ARGS, struct fha_params *softc) { - int error, count, i; + int error, i; struct sbuf sb; struct fha_hash_entry *fhe; - bool_t first = TRUE; + bool_t first, hfirst; SVCTHREAD *thread; SVCPOOL *pool; - sbuf_new(&sb, NULL, 4096, SBUF_FIXEDLEN); + sbuf_new(&sb, NULL, 65536, SBUF_FIXEDLEN); pool = NULL; @@ -485,42 +485,44 @@ fhe_stats_sysctl(SYSCTL_HANDLER_ARGS, st } pool = *softc->pool; - count = 0; for (i = 0; i < FHA_HASH_SIZE; i++) if (!LIST_EMPTY(&softc->fha_hash[i].list)) - count++; + break; - if (count == 0) { + if (i == FHA_HASH_SIZE) { sbuf_printf(&sb, "No file handle entries.\n"); goto out; } - for (i = 0; i < FHA_HASH_SIZE; i++) { + hfirst = TRUE; + for (; i < FHA_HASH_SIZE; i++) { mtx_lock(&softc->fha_hash[i].mtx); + if (LIST_EMPTY(&softc->fha_hash[i].list)) { + mtx_unlock(&softc->fha_hash[i].mtx); + continue; + } + sbuf_printf(&sb, "%shash %d: {\n", hfirst ? "" : ", ", i); + first = TRUE; LIST_FOREACH(fhe, &softc->fha_hash[i].list, link) { - sbuf_printf(&sb, "%sfhe %p: {\n", first ? "" : ", ", fhe); + sbuf_printf(&sb, "%sfhe %p: {\n", first ? " " : ", ", fhe); sbuf_printf(&sb, " fh: %ju\n", (uintmax_t) fhe->fh); - sbuf_printf(&sb, " num_rw: %d\n", fhe->num_rw); - sbuf_printf(&sb, " num_exclusive: %d\n", fhe->num_exclusive); + sbuf_printf(&sb, " num_rw/exclusive: %d/%d\n", + fhe->num_rw, fhe->num_exclusive); sbuf_printf(&sb, " num_threads: %d\n", fhe->num_threads); LIST_FOREACH(thread, &fhe->threads, st_alink) { - sbuf_printf(&sb, " thread %p offset %ju " - "(count %d)\n", thread, + sbuf_printf(&sb, " thread %p offset %ju " + "reqs %d\n", thread, thread->st_p3, thread->st_p2); } - sbuf_printf(&sb, "}"); + sbuf_printf(&sb, " }"); first = FALSE; - - /* Limit the output. */ - if (++count > 128) { - sbuf_printf(&sb, "..."); - break; - } } + sbuf_printf(&sb, "\n}"); mtx_unlock(&softc->fha_hash[i].mtx); + hfirst = FALSE; } out: From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 22 21:28:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BF3F7B4A; Sun, 22 Jun 2014 21:28: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 AC17D278F; Sun, 22 Jun 2014 21:28: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 s5MLS5xq080098; Sun, 22 Jun 2014 21:28:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MLS5RS080097; Sun, 22 Jun 2014 21:28:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406222128.s5MLS5RS080097@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jun 2014 21:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267754 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 21:28:05 -0000 Author: mav Date: Sun Jun 22 21:28:05 2014 New Revision: 267754 URL: http://svnweb.freebsd.org/changeset/base/267754 Log: MFC r267429: Fix some leaks on LUN creation error. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Sun Jun 22 21:26:46 2014 (r267753) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Sun Jun 22 21:28:05 2014 (r267754) @@ -2115,9 +2115,14 @@ ctl_be_block_create(struct ctl_be_block_ bailout_error: req->status = CTL_LUN_ERROR; + if (be_lun->io_taskqueue != NULL) + taskqueue_free(be_lun->io_taskqueue); ctl_be_block_close(be_lun); - - free(be_lun->dev_path, M_CTLBLK); + if (be_lun->dev_path != NULL) + free(be_lun->dev_path, M_CTLBLK); + if (be_lun->lun_zone != NULL) + uma_zdestroy(be_lun->lun_zone); + mtx_destroy(&be_lun->lock); free(be_lun, M_CTLBLK); return (retval); From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 05:39:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 04B1C36A; Mon, 23 Jun 2014 05:39: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 E64242EB2; Mon, 23 Jun 2014 05:39: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 s5N5dAvW013531; Mon, 23 Jun 2014 05:39:10 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N5dAWn013530; Mon, 23 Jun 2014 05:39:10 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201406230539.s5N5dAWn013530@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 23 Jun 2014 05:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267764 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 05:39:11 -0000 Author: np Date: Mon Jun 23 05:39:10 2014 New Revision: 267764 URL: http://svnweb.freebsd.org/changeset/base/267764 Log: MFC r267689: Consider the total number of descriptors available (and not just those that are ready to be reclaimed) when deciding whether to resume tx after a stall. Modified: stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Mon Jun 23 05:17:39 2014 (r267763) +++ stable/10/sys/dev/cxgbe/t4_sge.c Mon Jun 23 05:39:10 2014 (r267764) @@ -1708,7 +1708,7 @@ t4_wrq_tx_locked(struct adapter *sc, str can_reclaim = reclaimable(eq); if (__predict_false(eq->flags & EQ_STALLED)) { - if (can_reclaim < tx_resume_threshold(eq)) + if (eq->avail + can_reclaim < tx_resume_threshold(eq)) return; eq->flags &= ~EQ_STALLED; eq->unstalled++; @@ -1829,7 +1829,7 @@ t4_eth_tx(struct ifnet *ifp, struct sge_ can_reclaim = reclaimable(eq); if (__predict_false(eq->flags & EQ_STALLED)) { - if (can_reclaim < tx_resume_threshold(eq)) { + if (eq->avail + can_reclaim < tx_resume_threshold(eq)) { txq->m = m; return (0); } @@ -2003,7 +2003,8 @@ t4_update_fl_bufsize(struct ifnet *ifp) int can_resume_tx(struct sge_eq *eq) { - return (reclaimable(eq) >= tx_resume_threshold(eq)); + + return (eq->avail + reclaimable(eq) >= tx_resume_threshold(eq)); } static inline void From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 07:54:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 130F6295; Mon, 23 Jun 2014 07:54: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 F2E5F28DE; Mon, 23 Jun 2014 07:54: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 s5N7sDwq075932; Mon, 23 Jun 2014 07:54:13 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N7sCgp075926; Mon, 23 Jun 2014 07:54:12 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406230754.s5N7sCgp075926@svn.freebsd.org> From: Michael Tuexen Date: Mon, 23 Jun 2014 07:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267769 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 07:54:14 -0000 Author: tuexen Date: Mon Jun 23 07:54:12 2014 New Revision: 267769 URL: http://svnweb.freebsd.org/changeset/base/267769 Log: MFC r267674: Honor jails for unbound SCTP sockets when selecting source addresses, reporting IP-addresses to the peer during the handshake, adding addresses to the host, reporting the addresses via the sysctl interface (used by netstat, for example) and reporting the addresses to the application via socket options. This issue was reported by Bernd Walter. Modified: stable/10/sys/netinet/sctp_asconf.c stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_pcb.c stable/10/sys/netinet/sctp_sysctl.c stable/10/sys/netinet/sctp_usrreq.c stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_asconf.c ============================================================================== --- stable/10/sys/netinet/sctp_asconf.c Mon Jun 23 07:45:44 2014 (r267768) +++ stable/10/sys/netinet/sctp_asconf.c Mon Jun 23 07:54:12 2014 (r267769) @@ -1889,14 +1889,22 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * * this is boundall or subset bound w/ASCONF allowed */ - /* first, make sure it's a good address family */ + /* first, make sure that the address is IPv4 or IPv6 and not jailed */ switch (ifa->address.sa.sa_family) { #ifdef INET6 case AF_INET6: + if (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &ifa->address.sin6.sin6_addr) != 0) { + return; + } break; #endif #ifdef INET case AF_INET: + if (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &ifa->address.sin.sin_addr) != 0) { + return; + } break; #endif default: @@ -2122,6 +2130,10 @@ sctp_asconf_iterator_stcb(struct sctp_in /* we skip unspecifed addresses */ continue; } + if (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sin6->sin6_addr) != 0) { + continue; + } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { if (stcb->asoc.scope.local_scope == 0) { continue; @@ -2152,6 +2164,10 @@ sctp_asconf_iterator_stcb(struct sctp_in /* we skip unspecifed addresses */ continue; } + if (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sin->sin_addr) != 0) { + continue; + } if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { continue; @@ -2465,6 +2481,10 @@ sctp_find_valid_localaddr(struct sctp_tc /* skip unspecifed addresses */ continue; } + if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred, + &sin->sin_addr) != 0) { + continue; + } if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) continue; @@ -2498,6 +2518,10 @@ sctp_find_valid_localaddr(struct sctp_tc */ continue; } + if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, + &sin6->sin6_addr) != 0) { + continue; + } if (stcb->asoc.scope.local_scope == 0 && IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) continue; @@ -3112,6 +3136,10 @@ sctp_check_address_list_all(struct sctp_ #ifdef INET case AF_INET: sin = (struct sockaddr_in *)&sctp_ifa->address.sin; + if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred, + &sin->sin_addr) != 0) { + continue; + } if ((ipv4_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) { /* private address not in scope */ @@ -3122,6 +3150,10 @@ sctp_check_address_list_all(struct sctp_ #ifdef INET6 case AF_INET6: sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sin6; + if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, + &sin6->sin6_addr) != 0) { + continue; + } if ((local_scope == 0) && (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))) { continue; @@ -3407,6 +3439,10 @@ sctp_asconf_send_nat_state_update(struct #ifdef INET case AF_INET: to = &sctp_ifap->address.sin; + if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred, + &to->sin_addr) != 0) { + continue; + } if (IN4_ISPRIVATE_ADDRESS(&to->sin_addr)) { continue; } @@ -3418,6 +3454,10 @@ sctp_asconf_send_nat_state_update(struct #ifdef INET6 case AF_INET6: to6 = &sctp_ifap->address.sin6; + if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, + &to6->sin6_addr) != 0) { + continue; + } if (IN6_IS_ADDR_LOOPBACK(&to6->sin6_addr)) { continue; } Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Mon Jun 23 07:45:44 2014 (r267768) +++ stable/10/sys/netinet/sctp_output.c Mon Jun 23 07:54:12 2014 (r267769) @@ -2060,6 +2060,20 @@ sctp_add_addresses_to_i_ia(struct sctp_i continue; } LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) { +#ifdef INET + if ((sctp_ifap->address.sa.sa_family == AF_INET) && + (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sctp_ifap->address.sin.sin_addr) != 0)) { + continue; + } +#endif +#ifdef INET6 + if ((sctp_ifap->address.sa.sa_family == AF_INET6) && + (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sctp_ifap->address.sin6.sin6_addr) != 0)) { + continue; + } +#endif if (sctp_is_addr_restricted(stcb, sctp_ifap)) { continue; } @@ -2089,6 +2103,20 @@ skip_count: continue; } LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) { +#ifdef INET + if ((sctp_ifap->address.sa.sa_family == AF_INET) && + (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sctp_ifap->address.sin.sin_addr) != 0)) { + continue; + } +#endif +#ifdef INET6 + if ((sctp_ifap->address.sa.sa_family == AF_INET6) && + (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sctp_ifap->address.sin6.sin6_addr) != 0)) { + continue; + } +#endif if (sctp_is_addr_restricted(stcb, sctp_ifap)) { continue; } @@ -2453,6 +2481,20 @@ sctp_choose_boundspecific_inp(struct sct if (sctp_ifn) { /* is a preferred one on the interface we route out? */ LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { +#ifdef INET + if ((sctp_ifa->address.sa.sa_family == AF_INET) && + (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin.sin_addr) != 0)) { + continue; + } +#endif +#ifdef INET6 + if ((sctp_ifa->address.sa.sa_family == AF_INET6) && + (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin6.sin6_addr) != 0)) { + continue; + } +#endif if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) continue; @@ -2576,6 +2618,20 @@ sctp_choose_boundspecific_stcb(struct sc if (sctp_ifn) { /* first try for a preferred address on the ep */ LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { +#ifdef INET + if ((sctp_ifa->address.sa.sa_family == AF_INET) && + (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin.sin_addr) != 0)) { + continue; + } +#endif +#ifdef INET6 + if ((sctp_ifa->address.sa.sa_family == AF_INET6) && + (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin6.sin6_addr) != 0)) { + continue; + } +#endif if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) continue; if (sctp_is_addr_in_ep(inp, sctp_ifa)) { @@ -2596,6 +2652,20 @@ sctp_choose_boundspecific_stcb(struct sc } /* next try for an acceptable address on the ep */ LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { +#ifdef INET + if ((sctp_ifa->address.sa.sa_family == AF_INET) && + (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin.sin_addr) != 0)) { + continue; + } +#endif +#ifdef INET6 + if ((sctp_ifa->address.sa.sa_family == AF_INET6) && + (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin6.sin6_addr) != 0)) { + continue; + } +#endif if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) continue; if (sctp_is_addr_in_ep(inp, sctp_ifa)) { @@ -2700,6 +2770,7 @@ sctp_from_the_top2: static struct sctp_ifa * sctp_select_nth_preferred_addr_from_ifn_boundall(struct sctp_ifn *ifn, + struct sctp_inpcb *inp, struct sctp_tcb *stcb, int non_asoc_addr_ok, uint8_t dest_is_loop, @@ -2721,6 +2792,20 @@ sctp_select_nth_preferred_addr_from_ifn_ } #endif /* INET6 */ LIST_FOREACH(ifa, &ifn->ifalist, next_ifa) { +#ifdef INET + if ((ifa->address.sa.sa_family == AF_INET) && + (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &ifa->address.sin.sin_addr) != 0)) { + continue; + } +#endif +#ifdef INET6 + if ((ifa->address.sa.sa_family == AF_INET6) && + (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &ifa->address.sin6.sin6_addr) != 0)) { + continue; + } +#endif if ((ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) continue; @@ -2806,6 +2891,7 @@ sctp_select_nth_preferred_addr_from_ifn_ static int sctp_count_num_preferred_boundall(struct sctp_ifn *ifn, + struct sctp_inpcb *inp, struct sctp_tcb *stcb, int non_asoc_addr_ok, uint8_t dest_is_loop, @@ -2816,6 +2902,21 @@ sctp_count_num_preferred_boundall(struct int num_eligible_addr = 0; LIST_FOREACH(ifa, &ifn->ifalist, next_ifa) { +#ifdef INET + if ((ifa->address.sa.sa_family == AF_INET) && + (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &ifa->address.sin.sin_addr) != 0)) { + continue; + } +#endif +#ifdef INET6 + if ((ifa->address.sa.sa_family == AF_INET6) && + (stcb != NULL) && + (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &ifa->address.sin6.sin6_addr) != 0)) { + continue; + } +#endif if ((ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) { continue; @@ -2847,7 +2948,8 @@ sctp_count_num_preferred_boundall(struct } static struct sctp_ifa * -sctp_choose_boundall(struct sctp_tcb *stcb, +sctp_choose_boundall(struct sctp_inpcb *inp, + struct sctp_tcb *stcb, struct sctp_nets *net, sctp_route_t * ro, uint32_t vrf_id, @@ -2902,7 +3004,7 @@ sctp_choose_boundall(struct sctp_tcb *st cur_addr_num = net->indx_of_eligible_next_to_use; } num_preferred = sctp_count_num_preferred_boundall(sctp_ifn, - stcb, + inp, stcb, non_asoc_addr_ok, dest_is_loop, dest_is_priv, fam); @@ -2929,7 +3031,7 @@ sctp_choose_boundall(struct sctp_tcb *st */ SCTPDBG(SCTP_DEBUG_OUTPUT2, "cur_addr_num:%d\n", cur_addr_num); - sctp_ifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, stcb, non_asoc_addr_ok, dest_is_loop, + sctp_ifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok, dest_is_loop, dest_is_priv, cur_addr_num, fam, ro); /* if sctp_ifa is NULL something changed??, fall to plan b. */ @@ -2960,7 +3062,7 @@ bound_all_plan_b: SCTPDBG(SCTP_DEBUG_OUTPUT2, "already seen\n"); continue; } - num_preferred = sctp_count_num_preferred_boundall(sctp_ifn, stcb, non_asoc_addr_ok, + num_preferred = sctp_count_num_preferred_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok, dest_is_loop, dest_is_priv, fam); SCTPDBG(SCTP_DEBUG_OUTPUT2, "Found ifn:%p %d preferred source addresses\n", @@ -2982,7 +3084,7 @@ bound_all_plan_b: if (cur_addr_num >= num_preferred) { cur_addr_num = 0; } - sifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, stcb, non_asoc_addr_ok, dest_is_loop, + sifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok, dest_is_loop, dest_is_priv, cur_addr_num, fam, ro); if (sifa == NULL) continue; @@ -3010,6 +3112,22 @@ again_with_private_addresses_allowed: } LIST_FOREACH(sctp_ifa, &emit_ifn->ifalist, next_ifa) { SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", (void *)sctp_ifa); +#ifdef INET + if ((sctp_ifa->address.sa.sa_family == AF_INET) && + (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin.sin_addr) != 0)) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Jailed\n"); + continue; + } +#endif +#ifdef INET6 + if ((sctp_ifa->address.sa.sa_family == AF_INET6) && + (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin6.sin6_addr) != 0)) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Jailed\n"); + continue; + } +#endif if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) { SCTPDBG(SCTP_DEBUG_OUTPUT2, "Defer\n"); @@ -3060,6 +3178,20 @@ plan_d: continue; } LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { +#ifdef INET + if ((sctp_ifa->address.sa.sa_family == AF_INET) && + (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin.sin_addr) != 0)) { + continue; + } +#endif +#ifdef INET6 + if ((sctp_ifa->address.sa.sa_family == AF_INET6) && + (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin6.sin6_addr) != 0)) { + continue; + } +#endif if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) continue; @@ -3110,6 +3242,20 @@ out: LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { struct sctp_ifa *tmp_sifa; +#ifdef INET + if ((sctp_ifa->address.sa.sa_family == AF_INET) && + (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin.sin_addr) != 0)) { + continue; + } +#endif +#ifdef INET6 + if ((sctp_ifa->address.sa.sa_family == AF_INET6) && + (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sctp_ifa->address.sin6.sin6_addr) != 0)) { + continue; + } +#endif if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) continue; @@ -3295,7 +3441,7 @@ sctp_source_address_selection(struct sct /* * Bound all case */ - answer = sctp_choose_boundall(stcb, net, ro, vrf_id, + answer = sctp_choose_boundall(inp, stcb, net, ro, vrf_id, dest_is_priv, dest_is_loop, non_asoc_addr_ok, fam); SCTP_IPI_ADDR_RUNLOCK(); Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Mon Jun 23 07:45:44 2014 (r267768) +++ stable/10/sys/netinet/sctp_pcb.c Mon Jun 23 07:54:12 2014 (r267769) @@ -898,6 +898,10 @@ sctp_does_stcb_own_this_addr(struct sctp IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { continue; } + if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred, + &sin->sin_addr) != 0) { + continue; + } if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { SCTP_IPI_ADDR_RUNLOCK(); return (1); @@ -913,6 +917,10 @@ sctp_does_stcb_own_this_addr(struct sctp sin6 = &sctp_ifa->address.sin6; rsin6 = (struct sockaddr_in6 *)to; + if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, + &sin6->sin6_addr) != 0) { + continue; + } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { if (local_scope == 0) continue; @@ -1060,6 +1068,39 @@ sctp_tcb_special_locate(struct sctp_inpc SCTP_INP_RUNLOCK(inp); continue; } + switch (to->sa_family) { +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)to; + if (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sin->sin_addr) != 0) { + SCTP_INP_RUNLOCK(inp); + continue; + } + break; + } +#endif +#ifdef INET6 + case AF_INET6: + { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)to; + if (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sin6->sin6_addr) != 0) { + SCTP_INP_RUNLOCK(inp); + continue; + } + break; + } +#endif + default: + SCTP_INP_RUNLOCK(inp); + continue; + } if (inp->def_vrf_id != vrf_id) { SCTP_INP_RUNLOCK(inp); continue; @@ -1628,23 +1669,45 @@ sctp_endpoint_probe(struct sockaddr *nam if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) && (inp->sctp_lport == lport)) { /* got it */ + switch (nam->sa_family) { #ifdef INET - if ((nam->sa_family == AF_INET) && - (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && - SCTP_IPV6_V6ONLY(inp)) { - /* IPv4 on a IPv6 socket with ONLY IPv6 set */ - SCTP_INP_RUNLOCK(inp); - continue; - } + case AF_INET: + if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && + SCTP_IPV6_V6ONLY(inp)) { + /* + * IPv4 on a IPv6 socket with ONLY + * IPv6 set + */ + SCTP_INP_RUNLOCK(inp); + continue; + } + if (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sin->sin_addr) != 0) { + SCTP_INP_RUNLOCK(inp); + continue; + } + break; #endif #ifdef INET6 - /* A V6 address and the endpoint is NOT bound V6 */ - if (nam->sa_family == AF_INET6 && - (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) { - SCTP_INP_RUNLOCK(inp); - continue; - } + case AF_INET6: + /* + * A V6 address and the endpoint is NOT + * bound V6 + */ + if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) { + SCTP_INP_RUNLOCK(inp); + continue; + } + if (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sin6->sin6_addr) != 0) { + SCTP_INP_RUNLOCK(inp); + continue; + } + break; #endif + default: + break; + } /* does a VRF id match? */ fnd = 0; if (inp->def_vrf_id == vrf_id) @@ -2403,6 +2466,7 @@ sctp_inpcb_alloc(struct socket *so, uint /* setup socket pointers */ inp->sctp_socket = so; inp->ip_inp.inp.inp_socket = so; + inp->ip_inp.inp.inp_cred = crhold(so->so_cred); #ifdef INET6 if (INP_SOCKAF(so) == AF_INET6) { if (MODULE_GLOBAL(ip6_auto_flowlabel)) { @@ -2421,6 +2485,7 @@ sctp_inpcb_alloc(struct socket *so, uint /* init the small hash table we use to track asocid <-> tcb */ inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark); if (inp->sctp_asocidhash == NULL) { + crfree(inp->ip_inp.inp.inp_cred); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_INP_INFO_WUNLOCK(); return (ENOBUFS); @@ -2435,6 +2500,7 @@ sctp_inpcb_alloc(struct socket *so, uint ((struct in6pcb *)(&inp->ip_inp.inp))->in6p_sp = pcb_sp; } if (error != 0) { + crfree(inp->ip_inp.inp.inp_cred); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); SCTP_INP_INFO_WUNLOCK(); return error; @@ -2465,6 +2531,7 @@ sctp_inpcb_alloc(struct socket *so, uint */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EOPNOTSUPP); so->so_pcb = NULL; + crfree(inp->ip_inp.inp.inp_cred); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); return (EOPNOTSUPP); } @@ -2484,6 +2551,7 @@ sctp_inpcb_alloc(struct socket *so, uint SCTP_PRINTF("Out of SCTP-INPCB->hashinit - no resources\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, ENOBUFS); so->so_pcb = NULL; + crfree(inp->ip_inp.inp.inp_cred); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); return (ENOBUFS); } @@ -3630,6 +3698,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, inp->sctp_tcbhash = NULL; } /* Now we must put the ep memory back into the zone pool */ + crfree(inp->ip_inp.inp.inp_cred); INP_LOCK_DESTROY(&inp->ip_inp.inp); SCTP_INP_LOCK_DESTROY(inp); SCTP_INP_READ_DESTROY(inp); Modified: stable/10/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/10/sys/netinet/sctp_sysctl.c Mon Jun 23 07:45:44 2014 (r267768) +++ stable/10/sys/netinet/sctp_sysctl.c Mon Jun 23 07:54:12 2014 (r267769) @@ -252,6 +252,10 @@ copy_out_local_addresses(struct sctp_inp sin = (struct sockaddr_in *)&sctp_ifa->address.sa; if (sin->sin_addr.s_addr == 0) continue; + if (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sin->sin_addr) != 0) { + continue; + } if ((ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) continue; } else { @@ -267,6 +271,10 @@ copy_out_local_addresses(struct sctp_inp sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) continue; + if (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sin6->sin6_addr) != 0) { + continue; + } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { if (local_scope == 0) continue; Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Mon Jun 23 07:45:44 2014 (r267768) +++ stable/10/sys/netinet/sctp_usrreq.c Mon Jun 23 07:54:12 2014 (r267769) @@ -1197,6 +1197,10 @@ sctp_fill_up_addresses_vrf(struct sctp_i */ continue; } + if (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sin->sin_addr) != 0) { + continue; + } if ((ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) { continue; @@ -1238,6 +1242,10 @@ sctp_fill_up_addresses_vrf(struct sctp_i */ continue; } + if (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sin6->sin6_addr) != 0) { + continue; + } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { if (local_scope == 0) continue; @@ -5239,6 +5247,43 @@ sctp_setopt(struct socket *so, int optna error = EINVAL; goto out_of_it; } + } else { + switch (sspp->sspp_addr.ss_family) { +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)&sspp->sspp_addr; + if (prison_check_ip4(inp->ip_inp.inp.inp_cred, + &sin->sin_addr) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + goto out_of_it; + } + break; + } +#endif +#ifdef INET6 + case AF_INET6: + { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&sspp->sspp_addr; + if (prison_check_ip6(inp->ip_inp.inp.inp_cred, + &sin6->sin6_addr) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + goto out_of_it; + } + break; + } +#endif + default: + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + goto out_of_it; + } } if (sctp_set_primary_ip_address_sa(stcb, (struct sockaddr *)&sspp->sspp_addr) != 0) { Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Mon Jun 23 07:45:44 2014 (r267768) +++ stable/10/sys/netinet/sctputil.c Mon Jun 23 07:54:12 2014 (r267769) @@ -6693,6 +6693,10 @@ sctp_local_addr_count(struct sctp_tcb *s */ continue; } + if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred, + &sin->sin_addr) != 0) { + continue; + } if ((ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) { continue; @@ -6713,6 +6717,10 @@ sctp_local_addr_count(struct sctp_tcb *s if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { continue; } + if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, + &sin6->sin6_addr) != 0) { + continue; + } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { if (local_scope == 0) continue; From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 07:56:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1DB533FD; Mon, 23 Jun 2014 07:56: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 0AA7028FB; Mon, 23 Jun 2014 07:56: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 s5N7udjh076362; Mon, 23 Jun 2014 07:56:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N7udCg076361; Mon, 23 Jun 2014 07:56:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406230756.s5N7udCg076361@svn.freebsd.org> From: Michael Tuexen Date: Mon, 23 Jun 2014 07:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267770 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 07:56:40 -0000 Author: tuexen Date: Mon Jun 23 07:56:39 2014 New Revision: 267770 URL: http://svnweb.freebsd.org/changeset/base/267770 Log: MFC r267682: Fix a bug in the setsockopt()-handling of the SCTP specific option SCTP_PEER_ADDR_THLDS: Use the provided address as intended. Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Mon Jun 23 07:54:12 2014 (r267769) +++ stable/10/sys/netinet/sctp_usrreq.c Mon Jun 23 07:56:39 2014 (r267770) @@ -5642,7 +5642,7 @@ sctp_setopt(struct socket *so, int optna SCTP_FIND_STCB(inp, stcb, thlds->spt_assoc_id); net = NULL; if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&thlds->spt_assoc_id); + net = sctp_findnet(stcb, (struct sockaddr *)&thlds->spt_address); } else { /* * We increment here since @@ -5653,7 +5653,7 @@ sctp_setopt(struct socket *so, int optna */ SCTP_INP_INCR_REF(inp); stcb = sctp_findassociation_ep_addr(&inp, - (struct sockaddr *)&thlds->spt_assoc_id, + (struct sockaddr *)&thlds->spt_address, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); @@ -5662,7 +5662,7 @@ sctp_setopt(struct socket *so, int optna if (stcb && (net == NULL)) { struct sockaddr *sa; - sa = (struct sockaddr *)&thlds->spt_assoc_id; + sa = (struct sockaddr *)&thlds->spt_address; #ifdef INET if (sa->sa_family == AF_INET) { From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 07:58:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DD857553; Mon, 23 Jun 2014 07:58: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 BEAF3290E; Mon, 23 Jun 2014 07:58: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 s5N7wfg2076713; Mon, 23 Jun 2014 07:58:41 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N7wfoM076712; Mon, 23 Jun 2014 07:58:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406230758.s5N7wfoM076712@svn.freebsd.org> From: Michael Tuexen Date: Mon, 23 Jun 2014 07:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267771 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 07:58:42 -0000 Author: tuexen Date: Mon Jun 23 07:58:41 2014 New Revision: 267771 URL: http://svnweb.freebsd.org/changeset/base/267771 Log: MFC r267688: Fix a bug which incorrectly allowed two listening SCTP sockets on the same port bound to the wildcard address. Modified: stable/10/sys/netinet/sctp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Mon Jun 23 07:56:39 2014 (r267770) +++ stable/10/sys/netinet/sctp_usrreq.c Mon Jun 23 07:58:41 2014 (r267771) @@ -6098,30 +6098,29 @@ sctp_listen(struct socket *so, int backl if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) { /* See if we have a listener */ struct sctp_inpcb *tinp; - union sctp_sockstore store, *sp; + union sctp_sockstore store; - sp = &store; if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) { /* not bound all */ struct sctp_laddr *laddr; LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { memcpy(&store, &laddr->ifa->address, sizeof(store)); - switch (sp->sa.sa_family) { + switch (store.sa.sa_family) { #ifdef INET case AF_INET: - sp->sin.sin_port = inp->sctp_lport; + store.sin.sin_port = inp->sctp_lport; break; #endif #ifdef INET6 case AF_INET6: - sp->sin6.sin6_port = inp->sctp_lport; + store.sin6.sin6_port = inp->sctp_lport; break; #endif default: break; } - tinp = sctp_pcb_findep(&sp->sa, 0, 0, inp->def_vrf_id); + tinp = sctp_pcb_findep(&store.sa, 0, 0, inp->def_vrf_id); if (tinp && (tinp != inp) && ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) == 0) && ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && @@ -6139,20 +6138,6 @@ sctp_listen(struct socket *so, int backl } else { /* Setup a local addr bound all */ memset(&store, 0, sizeof(store)); - switch (sp->sa.sa_family) { -#ifdef INET - case AF_INET: - store.sin.sin_port = inp->sctp_lport; - break; -#endif -#ifdef INET6 - case AF_INET6: - sp->sin6.sin6_port = inp->sctp_lport; - break; -#endif - default: - break; - } #ifdef INET6 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { store.sa.sa_family = AF_INET6; @@ -6165,7 +6150,21 @@ sctp_listen(struct socket *so, int backl store.sa.sa_len = sizeof(struct sockaddr_in); } #endif - tinp = sctp_pcb_findep(&sp->sa, 0, 0, inp->def_vrf_id); + switch (store.sa.sa_family) { +#ifdef INET + case AF_INET: + store.sin.sin_port = inp->sctp_lport; + break; +#endif +#ifdef INET6 + case AF_INET6: + store.sin6.sin6_port = inp->sctp_lport; + break; +#endif + default: + break; + } + tinp = sctp_pcb_findep(&store.sa, 0, 0, inp->def_vrf_id); if (tinp && (tinp != inp) && ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) == 0) && ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 08:08:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CE4C3CD5; Mon, 23 Jun 2014 08:08: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 BAC1F2A5C; Mon, 23 Jun 2014 08:08: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 s5N88Mhj081704; Mon, 23 Jun 2014 08:08:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N88Mks081702; Mon, 23 Jun 2014 08:08:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406230808.s5N88Mks081702@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 23 Jun 2014 08:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267772 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 08:08:23 -0000 Author: kib Date: Mon Jun 23 08:08:22 2014 New Revision: 267772 URL: http://svnweb.freebsd.org/changeset/base/267772 Log: MFC r267254: Make mmap(MAP_STACK) search for the available address space. MFC r267497 (by alc): Use local variable instead of sgrowsiz. Modified: stable/10/sys/vm/vm_map.c stable/10/sys/vm/vm_mmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Mon Jun 23 07:58:41 2014 (r267771) +++ stable/10/sys/vm/vm_map.c Mon Jun 23 08:08:22 2014 (r267772) @@ -136,6 +136,9 @@ static void vm_map_entry_dispose(vm_map_ static void vm_map_zdtor(void *mem, int size, void *arg); static void vmspace_zdtor(void *mem, int size, void *arg); #endif +static int vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, + vm_size_t max_ssize, vm_size_t growsize, vm_prot_t prot, vm_prot_t max, + int cow); #define ENTRY_CHARGED(e) ((e)->cred != NULL || \ ((e)->object.vm_object != NULL && (e)->object.vm_object->cred != NULL && \ @@ -1399,11 +1402,19 @@ vm_map_fixed(vm_map_t map, vm_object_t o int result; end = start + length; + KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 || + object == NULL, + ("vm_map_fixed: non-NULL backing object for stack")); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); (void) vm_map_delete(map, start, end); - result = vm_map_insert(map, object, offset, start, end, prot, - max, cow); + if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { + result = vm_map_stack_locked(map, start, length, sgrowsiz, + prot, max, cow); + } else { + result = vm_map_insert(map, object, offset, start, end, + prot, max, cow); + } vm_map_unlock(map); return (result); } @@ -1426,6 +1437,9 @@ vm_map_find(vm_map_t map, vm_object_t ob vm_offset_t alignment, initial_addr, start; int result; + KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 || + object == NULL, + ("vm_map_find: non-NULL backing object for stack")); if (find_space == VMFS_OPTIMAL_SPACE && (object == NULL || (object->flags & OBJ_COLORED) == 0)) find_space = VMFS_ANY_SPACE; @@ -1467,8 +1481,13 @@ again: start = *addr; } - result = vm_map_insert(map, object, offset, start, start + - length, prot, max, cow); + if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { + result = vm_map_stack_locked(map, start, length, + sgrowsiz, prot, max, cow); + } else { + result = vm_map_insert(map, object, offset, start, + start + length, prot, max, cow); + } } while (result == KERN_NO_SPACE && find_space != VMFS_NO_SPACE && find_space != VMFS_ANY_SPACE); vm_map_unlock(map); @@ -3334,11 +3353,43 @@ int vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, vm_prot_t prot, vm_prot_t max, int cow) { + vm_size_t growsize, init_ssize; + rlim_t lmemlim, vmemlim; + int rv; + + growsize = sgrowsiz; + init_ssize = (max_ssize < growsize) ? max_ssize : growsize; + vm_map_lock(map); + PROC_LOCK(curproc); + lmemlim = lim_cur(curproc, RLIMIT_MEMLOCK); + vmemlim = lim_cur(curproc, RLIMIT_VMEM); + PROC_UNLOCK(curproc); + if (!old_mlock && map->flags & MAP_WIREFUTURE) { + if (ptoa(pmap_wired_count(map->pmap)) + init_ssize > lmemlim) { + rv = KERN_NO_SPACE; + goto out; + } + } + /* If we would blow our VMEM resource limit, no go */ + if (map->size + init_ssize > vmemlim) { + rv = KERN_NO_SPACE; + goto out; + } + rv = vm_map_stack_locked(map, addrbos, max_ssize, growsize, prot, + max, cow); +out: + vm_map_unlock(map); + return (rv); +} + +static int +vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, + vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) +{ vm_map_entry_t new_entry, prev_entry; vm_offset_t bot, top; - vm_size_t growsize, init_ssize; + vm_size_t init_ssize; int orient, rv; - rlim_t lmemlim, vmemlim; /* * The stack orientation is piggybacked with the cow argument. @@ -3354,34 +3405,11 @@ vm_map_stack(vm_map_t map, vm_offset_t a addrbos + max_ssize < addrbos) return (KERN_NO_SPACE); - growsize = sgrowsiz; init_ssize = (max_ssize < growsize) ? max_ssize : growsize; - PROC_LOCK(curproc); - lmemlim = lim_cur(curproc, RLIMIT_MEMLOCK); - vmemlim = lim_cur(curproc, RLIMIT_VMEM); - PROC_UNLOCK(curproc); - - vm_map_lock(map); - /* If addr is already mapped, no go */ - if (vm_map_lookup_entry(map, addrbos, &prev_entry)) { - vm_map_unlock(map); + if (vm_map_lookup_entry(map, addrbos, &prev_entry)) return (KERN_NO_SPACE); - } - - if (!old_mlock && map->flags & MAP_WIREFUTURE) { - if (ptoa(pmap_wired_count(map->pmap)) + init_ssize > lmemlim) { - vm_map_unlock(map); - return (KERN_NO_SPACE); - } - } - - /* If we would blow our VMEM resource limit, no go */ - if (map->size + init_ssize > vmemlim) { - vm_map_unlock(map); - return (KERN_NO_SPACE); - } /* * If we can't accomodate max_ssize in the current mapping, no go. @@ -3393,10 +3421,8 @@ vm_map_stack(vm_map_t map, vm_offset_t a * grow the stack. */ if ((prev_entry->next != &map->header) && - (prev_entry->next->start < addrbos + max_ssize)) { - vm_map_unlock(map); + (prev_entry->next->start < addrbos + max_ssize)) return (KERN_NO_SPACE); - } /* * We initially map a stack of only init_ssize. We will grow as @@ -3432,7 +3458,6 @@ vm_map_stack(vm_map_t map, vm_offset_t a new_entry->eflags |= MAP_ENTRY_GROWS_UP; } - vm_map_unlock(map); return (rv); } Modified: stable/10/sys/vm/vm_mmap.c ============================================================================== --- stable/10/sys/vm/vm_mmap.c Mon Jun 23 07:58:41 2014 (r267771) +++ stable/10/sys/vm/vm_mmap.c Mon Jun 23 08:08:22 2014 (r267772) @@ -1621,11 +1621,13 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, docow |= MAP_INHERIT_SHARE; if (writecounted) docow |= MAP_VN_WRITECOUNT; + if (flags & MAP_STACK) { + if (object != NULL) + return (EINVAL); + docow |= MAP_STACK_GROWS_DOWN; + } - if (flags & MAP_STACK) - rv = vm_map_stack(map, *addr, size, prot, maxprot, - docow | MAP_STACK_GROWS_DOWN); - else if (fitit) { + if (fitit) { if ((flags & MAP_ALIGNMENT_MASK) == MAP_ALIGNED_SUPER) findspace = VMFS_SUPER_SPACE; else if ((flags & MAP_ALIGNMENT_MASK) != 0) @@ -1638,9 +1640,10 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, flags & MAP_32BIT ? MAP_32BIT_MAX_ADDR : #endif 0, findspace, prot, maxprot, docow); - } else + } else { rv = vm_map_fixed(map, object, foff, *addr, size, - prot, maxprot, docow); + prot, maxprot, docow); + } if (rv == KERN_SUCCESS) { /* From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 08:27:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DC1C5444; Mon, 23 Jun 2014 08:27: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 AEDDE2BDE; Mon, 23 Jun 2014 08:27: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 s5N8RFKp091189; Mon, 23 Jun 2014 08:27:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N8RFQ8091184; Mon, 23 Jun 2014 08:27:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406230827.s5N8RFQ8091184@svn.freebsd.org> From: Marius Strobl Date: Mon, 23 Jun 2014 08:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267775 - in stable/10/sys/dev/usb: . controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 08:27:16 -0000 Author: marius Date: Mon Jun 23 08:27:15 2014 New Revision: 267775 URL: http://svnweb.freebsd.org/changeset/base/267775 Log: MFC: r267321 Avoid the USB device disconnected and controller shutdown clutter on system shutdown by putting the former under !rebooting and turning the latter into debug messages. Reviewed by: hps Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sys/dev/usb/controller/usb_controller.c stable/10/sys/dev/usb/usb_device.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/10/sys/dev/usb/controller/usb_controller.c Mon Jun 23 08:25:03 2014 (r267774) +++ stable/10/sys/dev/usb/controller/usb_controller.c Mon Jun 23 08:27:15 2014 (r267775) @@ -332,7 +332,7 @@ usb_shutdown(device_t dev) return (0); } - device_printf(bus->bdev, "Controller shutdown\n"); + DPRINTF("%s: Controller shutdown\n", device_get_nameunit(bus->bdev)); USB_BUS_LOCK(bus); usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), @@ -344,7 +344,8 @@ usb_shutdown(device_t dev) } USB_BUS_UNLOCK(bus); - device_printf(bus->bdev, "Controller shutdown complete\n"); + DPRINTF("%s: Controller shutdown complete\n", + device_get_nameunit(bus->bdev)); return (0); } Modified: stable/10/sys/dev/usb/usb_device.c ============================================================================== --- stable/10/sys/dev/usb/usb_device.c Mon Jun 23 08:25:03 2014 (r267774) +++ stable/10/sys/dev/usb/usb_device.c Mon Jun 23 08:27:15 2014 (r267775) @@ -1124,10 +1124,12 @@ usb_detach_device_sub(struct usb_device */ *ppdev = NULL; - device_printf(dev, "at %s, port %d, addr %d " - "(disconnected)\n", - device_get_nameunit(udev->parent_dev), - udev->port_no, udev->address); + if (!rebooting) { + device_printf(dev, "at %s, port %d, addr %d " + "(disconnected)\n", + device_get_nameunit(udev->parent_dev), + udev->port_no, udev->address); + } if (device_is_attached(dev)) { if (udev->flags.peer_suspended) { @@ -2143,8 +2145,10 @@ usb_free_device(struct usb_device *udev, #endif #if USB_HAVE_UGEN - printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name, - usb_get_manufacturer(udev), device_get_nameunit(bus->bdev)); + if (!rebooting) { + printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name, + usb_get_manufacturer(udev), device_get_nameunit(bus->bdev)); + } /* Destroy UGEN symlink, if any */ if (udev->ugen_symlink) { From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 08:32:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EEA1685E; Mon, 23 Jun 2014 08:32: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 DB6212C88; Mon, 23 Jun 2014 08:32: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 s5N8WaIW095281; Mon, 23 Jun 2014 08:32:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N8WasL095280; Mon, 23 Jun 2014 08:32:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406230832.s5N8WasL095280@svn.freebsd.org> From: Marius Strobl Date: Mon, 23 Jun 2014 08:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267778 - stable/10/sys/cam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 08:32:37 -0000 Author: marius Date: Mon Jun 23 08:32:36 2014 New Revision: 267778 URL: http://svnweb.freebsd.org/changeset/base/267778 Log: MFC: r267638 Don't denounce peripherals on system shutdown. Together with r267321 (MFCed to stable/10 in r267775), we're now back to the pre-r228483 level of default verbosity. This in turn again typically allows for reading information that userland might have printed on the screen before initiating a halt, but still permits to debug potential device shutdown problems on system shutdown via CAM_DEBUG etc. Reviewed by: mav Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sys/cam/cam_periph.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_periph.c ============================================================================== --- stable/10/sys/cam/cam_periph.c Mon Jun 23 08:28:14 2014 (r267777) +++ stable/10/sys/cam/cam_periph.c Mon Jun 23 08:32:36 2014 (r267778) @@ -597,7 +597,7 @@ cam_periph_invalidate(struct cam_periph return; CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); - if (periph->flags & CAM_PERIPH_ANNOUNCED) + if ((periph->flags & CAM_PERIPH_ANNOUNCED) && !rebooting) xpt_denounce_periph(periph); periph->flags |= CAM_PERIPH_INVALID; periph->flags &= ~CAM_PERIPH_NEW_DEV_FOUND; @@ -663,9 +663,9 @@ camperiphfree(struct cam_periph *periph) xpt_remove_periph(periph); xpt_unlock_buses(); - if (periph->flags & CAM_PERIPH_ANNOUNCED) { + if ((periph->flags & CAM_PERIPH_ANNOUNCED) && !rebooting) xpt_print(periph->path, "Periph destroyed\n"); - } else + else CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 13:50:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 133C84C5; Mon, 23 Jun 2014 13:50: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 D9D8D2A63; Mon, 23 Jun 2014 13:50: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 s5NDo3Yn043961; Mon, 23 Jun 2014 13:50:03 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NDo3P8043956; Mon, 23 Jun 2014 13:50:03 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406231350.s5NDo3P8043956@svn.freebsd.org> From: Ed Maste Date: Mon, 23 Jun 2014 13:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267797 - in stable/10: etc/mtree share share/mk tools/build/options X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 13:50:04 -0000 Author: emaste Date: Mon Jun 23 13:50:02 2014 New Revision: 267797 URL: http://svnweb.freebsd.org/changeset/base/267797 Log: MFC r267124, r267582: Install VT support files They can be disabled by setting WITHOUT_VT_SUPPORT=yes in src.conf. Added: stable/10/tools/build/options/WITHOUT_VT_SUPPORT - copied, changed from r267124, head/tools/build/options/WITHOUT_VT_SUPPORT Modified: stable/10/etc/mtree/BSD.usr.dist stable/10/share/Makefile stable/10/share/mk/bsd.own.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.usr.dist ============================================================================== --- stable/10/etc/mtree/BSD.usr.dist Mon Jun 23 13:41:20 2014 (r267796) +++ stable/10/etc/mtree/BSD.usr.dist Mon Jun 23 13:50:02 2014 (r267797) @@ -1406,6 +1406,12 @@ catalog .. .. + vt + fonts + .. + keymaps + .. + .. zoneinfo Africa .. Modified: stable/10/share/Makefile ============================================================================== --- stable/10/share/Makefile Mon Jun 23 13:41:20 2014 (r267796) +++ stable/10/share/Makefile Mon Jun 23 13:50:02 2014 (r267797) @@ -28,6 +28,7 @@ SUBDIR= ${_colldef} \ termcap \ ${_tests} \ ${_timedef} \ + ${_vt} \ ${_zoneinfo} # NB: keep these sorted by MK_* knobs @@ -85,6 +86,10 @@ _syscons= syscons _tests= tests .endif +.if ${MK_VT_SUPPORT} != "no" +_vt= vt +.endif + .if ${MK_ZONEINFO} != "no" _zoneinfo= zoneinfo .endif Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Mon Jun 23 13:41:20 2014 (r267796) +++ stable/10/share/mk/bsd.own.mk Mon Jun 23 13:50:02 2014 (r267797) @@ -358,6 +358,7 @@ __DEFAULT_YES_OPTIONS = \ UNBOUND \ USB \ UTMPX \ + VT_SUPPORT \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ Copied and modified: stable/10/tools/build/options/WITHOUT_VT_SUPPORT (from r267124, head/tools/build/options/WITHOUT_VT_SUPPORT) ============================================================================== --- head/tools/build/options/WITHOUT_VT_SUPPORT Thu Jun 5 18:53:56 2014 (r267124, copy source) +++ stable/10/tools/build/options/WITHOUT_VT_SUPPORT Mon Jun 23 13:50:02 2014 (r267797) @@ -1,4 +1,4 @@ .\" $FreeBSD$ Set to not build .Xr vt 4 -support files (fonts). +support files (fonts and keymaps). From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 15:03:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2F3EE736; Mon, 23 Jun 2014 15:03: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 1A22E21BC; Mon, 23 Jun 2014 15:03: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 s5NF3pxK081764; Mon, 23 Jun 2014 15:03:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NF3pBG081761; Mon, 23 Jun 2014 15:03:51 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201406231503.s5NF3pBG081761@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 23 Jun 2014 15:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267798 - stable/10/lib/libc/stdtime X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 15:03:52 -0000 Author: pfg Date: Mon Jun 23 15:03:51 2014 New Revision: 267798 URL: http://svnweb.freebsd.org/changeset/base/267798 Log: MFC r267601: stdtime: style(9) fixes. Obtained from: illumos Modified: stable/10/lib/libc/stdtime/strftime.c stable/10/lib/libc/stdtime/strptime.c stable/10/lib/libc/stdtime/timelocal.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdtime/strftime.c ============================================================================== --- stable/10/lib/libc/stdtime/strftime.c Mon Jun 23 13:50:02 2014 (r267797) +++ stable/10/lib/libc/stdtime/strftime.c Mon Jun 23 15:03:51 2014 (r267798) @@ -24,9 +24,9 @@ #ifndef NOID static const char elsieid[] = "@(#)strftime.3 8.3"; /* -** Based on the UCB version with the ID appearing below. -** This is ANSIish only when "multibyte character == plain character". -*/ + * Based on the UCB version with the ID appearing below. + * This is ANSIish only when "multibyte character == plain character". + */ #endif /* !defined NOID */ #endif /* !defined lint */ @@ -57,32 +57,32 @@ extern char * tzname[]; #define YEAR_2000_NAME "CHECK_STRFTIME_FORMATS_FOR_TWO_DIGIT_YEARS" #endif /* !defined YEAR_2000_NAME */ -#define IN_NONE 0 -#define IN_SOME 1 -#define IN_THIS 2 -#define IN_ALL 3 - -#define PAD_DEFAULT 0 -#define PAD_LESS 1 -#define PAD_SPACE 2 -#define PAD_ZERO 3 +#define IN_NONE 0 +#define IN_SOME 1 +#define IN_THIS 2 +#define IN_ALL 3 + +#define PAD_DEFAULT 0 +#define PAD_LESS 1 +#define PAD_SPACE 2 +#define PAD_ZERO 3 static const char fmt_padding[][4][5] = { /* DEFAULT, LESS, SPACE, ZERO */ -#define PAD_FMT_MONTHDAY 0 -#define PAD_FMT_HMS 0 -#define PAD_FMT_CENTURY 0 -#define PAD_FMT_SHORTYEAR 0 -#define PAD_FMT_MONTH 0 -#define PAD_FMT_WEEKOFYEAR 0 -#define PAD_FMT_DAYOFMONTH 0 +#define PAD_FMT_MONTHDAY 0 +#define PAD_FMT_HMS 0 +#define PAD_FMT_CENTURY 0 +#define PAD_FMT_SHORTYEAR 0 +#define PAD_FMT_MONTH 0 +#define PAD_FMT_WEEKOFYEAR 0 +#define PAD_FMT_DAYOFMONTH 0 { "%02d", "%d", "%2d", "%02d" }, -#define PAD_FMT_SDAYOFMONTH 1 -#define PAD_FMT_SHMS 1 +#define PAD_FMT_SDAYOFMONTH 1 +#define PAD_FMT_SHMS 1 { "%2d", "%d", "%2d", "%02d" }, #define PAD_FMT_DAYOFYEAR 2 { "%03d", "%d", "%3d", "%03d" }, -#define PAD_FMT_YEAR 3 +#define PAD_FMT_YEAR 3 { "%04d", "%d", "%4d", "%04d" } }; @@ -114,7 +114,7 @@ strftime_l(char * __restrict s, size_t m } #endif /* !defined NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU */ if (p == s + maxsize) - return 0; + return (0); *p = '\0'; return p - s; } @@ -176,12 +176,12 @@ label: continue; case 'C': /* - ** %C used to do a... - ** _fmt("%a %b %e %X %Y", t); - ** ...whereas now POSIX 1003.2 calls for - ** something completely different. - ** (ado, 1993-05-24) - */ + * %C used to do a... + * _fmt("%a %b %e %X %Y", t); + * ...whereas now POSIX 1003.2 calls for + * something completely different. + * (ado, 1993-05-24) + */ pt = _yconv(t->tm_year, TM_YEAR_BASE, 1, 0, pt, ptlim); continue; @@ -210,17 +210,17 @@ label: goto label; case 'O': /* - ** C99 locale modifiers. - ** The sequences - ** %Ec %EC %Ex %EX %Ey %EY - ** %Od %oe %OH %OI %Om %OM - ** %OS %Ou %OU %OV %Ow %OW %Oy - ** are supposed to provide alternate - ** representations. - ** - ** FreeBSD extension - ** %OB - */ + * C99 locale modifiers. + * The sequences + * %Ec %EC %Ex %EX %Ey %EY + * %Od %oe %OH %OI %Om %OM + * %OS %Ou %OU %OV %Ow %OW %Oy + * are supposed to provide alternate + * representations. + * + * FreeBSD extension + * %OB + */ if (Ealternative || Oalternative) break; Oalternative++; @@ -239,7 +239,8 @@ label: case 'I': pt = _conv((t->tm_hour % 12) ? (t->tm_hour % 12) : 12, - fmt_padding[PAD_FMT_HMS][PadIndex], pt, ptlim); + fmt_padding[PAD_FMT_HMS][PadIndex], + pt, ptlim); continue; case 'j': pt = _conv(t->tm_yday + 1, @@ -247,15 +248,15 @@ label: continue; case 'k': /* - ** This used to be... - ** _conv(t->tm_hour % 12 ? - ** t->tm_hour % 12 : 12, 2, ' '); - ** ...and has been changed to the below to - ** match SunOS 4.1.1 and Arnold Robbins' - ** strftime version 3.0. That is, "%k" and - ** "%l" have been swapped. - ** (ado, 1993-05-24) - */ + * This used to be... + * _conv(t->tm_hour % 12 ? + * t->tm_hour % 12 : 12, 2, ' '); + * ...and has been changed to the below to + * match SunOS 4.1.1 and Arnold Robbins' + * strftime version 3.0. That is, "%k" and + * "%l" have been swapped. + * (ado, 1993-05-24) + */ pt = _conv(t->tm_hour, fmt_padding[PAD_FMT_SHMS][PadIndex], pt, ptlim); continue; @@ -269,17 +270,18 @@ label: #endif /* defined KITCHEN_SINK */ case 'l': /* - ** This used to be... - ** _conv(t->tm_hour, 2, ' '); - ** ...and has been changed to the below to - ** match SunOS 4.1.1 and Arnold Robbin's - ** strftime version 3.0. That is, "%k" and - ** "%l" have been swapped. - ** (ado, 1993-05-24) - */ + * This used to be... + * _conv(t->tm_hour, 2, ' '); + * ...and has been changed to the below to + * match SunOS 4.1.1 and Arnold Robbin's + * strftime version 3.0. That is, "%k" and + * "%l" have been swapped. + * (ado, 1993-05-24) + */ pt = _conv((t->tm_hour % 12) ? (t->tm_hour % 12) : 12, - fmt_padding[PAD_FMT_SHMS][PadIndex], pt, ptlim); + fmt_padding[PAD_FMT_SHMS][PadIndex], + pt, ptlim); continue; case 'M': pt = _conv(t->tm_min, fmt_padding[PAD_FMT_HMS][PadIndex], @@ -287,15 +289,15 @@ label: continue; case 'm': pt = _conv(t->tm_mon + 1, - fmt_padding[PAD_FMT_MONTH][PadIndex], pt, ptlim); + fmt_padding[PAD_FMT_MONTH][PadIndex], + pt, ptlim); continue; case 'n': pt = _add("\n", pt, ptlim); continue; case 'p': pt = _add((t->tm_hour >= (HOURSPERDAY / 2)) ? - tptr->pm : - tptr->am, + tptr->pm : tptr->am, pt, ptlim); continue; case 'R': @@ -339,11 +341,11 @@ label: continue; case 'u': /* - ** From Arnold Robbins' strftime version 3.0: - ** "ISO 8601: Weekday as a decimal number - ** [1 (Monday) - 7]" - ** (ado, 1993-05-24) - */ + * From Arnold Robbins' strftime version 3.0: + * "ISO 8601: Weekday as a decimal number + * [1 (Monday) - 7]" + * (ado, 1993-05-24) + */ pt = _conv((t->tm_wday == 0) ? DAYSPERWEEK : t->tm_wday, "%d", pt, ptlim); @@ -352,23 +354,23 @@ label: case 'G': /* ISO 8601 year (four digits) */ case 'g': /* ISO 8601 year (two digits) */ /* -** From Arnold Robbins' strftime version 3.0: "the week number of the -** year (the first Monday as the first day of week 1) as a decimal number -** (01-53)." -** (ado, 1993-05-24) -** -** From "http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html" by Markus Kuhn: -** "Week 01 of a year is per definition the first week which has the -** Thursday in this year, which is equivalent to the week which contains -** the fourth day of January. In other words, the first week of a new year -** is the week which has the majority of its days in the new year. Week 01 -** might also contain days from the previous year and the week before week -** 01 of a year is the last week (52 or 53) of the previous year even if -** it contains days from the new year. A week starts with Monday (day 1) -** and ends with Sunday (day 7). For example, the first week of the year -** 1997 lasts from 1996-12-30 to 1997-01-05..." -** (ado, 1996-01-02) -*/ + * From Arnold Robbins' strftime version 3.0: "the week number of the + * year (the first Monday as the first day of week 1) as a decimal number + * (01-53)." + * (ado, 1993-05-24) + * + * From "http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html" by Markus Kuhn: + * "Week 01 of a year is per definition the first week which has the + * Thursday in this year, which is equivalent to the week which contains + * the fourth day of January. In other words, the first week of a new year + * is the week which has the majority of its days in the new year. Week 01 + * might also contain days from the previous year and the week before week + * 01 of a year is the last week (52 or 53) of the previous year even if + * it contains days from the new year. A week starts with Monday (day 1) + * and ends with Sunday (day 7). For example, the first week of the year + * 1997 lasts from 1996-12-30 to 1997-01-05..." + * (ado, 1996-01-02) + */ { int year; int base; @@ -389,15 +391,15 @@ label: DAYSPERLYEAR : DAYSPERNYEAR; /* - ** What yday (-3 ... 3) does - ** the ISO year begin on? - */ + * What yday (-3 ... 3) does + * the ISO year begin on? + */ bot = ((yday + 11 - wday) % DAYSPERWEEK) - 3; /* - ** What yday does the NEXT - ** ISO year begin on? - */ + * What yday does the NEXT + * ISO year begin on? + */ top = bot - (len % DAYSPERWEEK); if (top < -3) @@ -438,10 +440,10 @@ label: continue; case 'v': /* - ** From Arnold Robbins' strftime version 3.0: - ** "date as dd-bbb-YYYY" - ** (ado, 1993-05-24) - */ + * From Arnold Robbins' strftime version 3.0: + * "date as dd-bbb-YYYY" + * (ado, 1993-05-24) + */ pt = _fmt("%e-%b-%Y", t, pt, ptlim, warnp, loc); continue; case 'W': @@ -487,10 +489,10 @@ label: pt = _add(tzname[t->tm_isdst != 0], pt, ptlim); /* - ** C99 says that %Z must be replaced by the - ** empty string if the time zone is not - ** determinable. - */ + * C99 says that %Z must be replaced by the + * empty string if the time zone is not + * determinable. + */ continue; case 'z': { @@ -503,24 +505,24 @@ label: diff = t->TM_GMTOFF; #else /* !defined TM_GMTOFF */ /* - ** C99 says that the UTC offset must - ** be computed by looking only at - ** tm_isdst. This requirement is - ** incorrect, since it means the code - ** must rely on magic (in this case - ** altzone and timezone), and the - ** magic might not have the correct - ** offset. Doing things correctly is - ** tricky and requires disobeying C99; - ** see GNU C strftime for details. - ** For now, punt and conform to the - ** standard, even though it's incorrect. - ** - ** C99 says that %z must be replaced by the - ** empty string if the time zone is not - ** determinable, so output nothing if the - ** appropriate variables are not available. - */ + * C99 says that the UTC offset must + * be computed by looking only at + * tm_isdst. This requirement is + * incorrect, since it means the code + * must rely on magic (in this case + * altzone and timezone), and the + * magic might not have the correct + * offset. Doing things correctly is + * tricky and requires disobeying C99; + * see GNU C strftime for details. + * For now, punt and conform to the + * standard, even though it's incorrect. + * + * C99 says that %z must be replaced by the + * empty string if the time zone is not + * determinable, so output nothing if the + * appropriate variables are not available. + */ if (t->tm_isdst == 0) #ifdef USG_COMPAT diff = -timezone; @@ -537,7 +539,8 @@ label: if (diff < 0) { sign = "-"; diff = -diff; - } else sign = "+"; + } else + sign = "+"; pt = _add(sign, pt, ptlim); diff /= SECSPERMIN; diff = (diff / MINSPERHOUR) * 100 + @@ -567,10 +570,10 @@ label: goto label; case '%': /* - ** X311J/88-090 (4.12.3.5): if conversion char is - ** undefined, behavior is undefined. Print out the - ** character itself as printf(3) also does. - */ + * X311J/88-090 (4.12.3.5): if conversion char is + * undefined, behavior is undefined. Print out the + * character itself as printf(3) also does. + */ default: break; } @@ -579,7 +582,7 @@ label: break; *pt++ = *format; } - return pt; + return (pt); } static char * @@ -603,16 +606,16 @@ const char * const ptlim; { while (pt < ptlim && (*pt = *str++) != '\0') ++pt; - return pt; + return (pt); } /* -** POSIX and the C Standard are unclear or inconsistent about -** what %C and %y do if the year is negative or exceeds 9999. -** Use the convention that %C concatenated with %y yields the -** same output as %Y, and that %Y contains at least 4 bytes, -** with more only if necessary. -*/ + * POSIX and the C Standard are unclear or inconsistent about + * what %C and %y do if the year is negative or exceeds 9999. + * Use the convention that %C concatenated with %y yields the + * same output as %Y, and that %Y contains at least 4 bytes, + * with more only if necessary. + */ static char * _yconv(a, b, convert_top, convert_yy, pt, ptlim) @@ -626,7 +629,7 @@ const char * const ptlim; register int lead; register int trail; -#define DIVISOR 100 +#define DIVISOR 100 trail = a % DIVISOR + b % DIVISOR; lead = a / DIVISOR + b / DIVISOR + trail / DIVISOR; trail %= DIVISOR; @@ -644,5 +647,5 @@ const char * const ptlim; } if (convert_yy) pt = _conv(((trail < 0) ? -trail : trail), "%02d", pt, ptlim); - return pt; + return (pt); } Modified: stable/10/lib/libc/stdtime/strptime.c ============================================================================== --- stable/10/lib/libc/stdtime/strptime.c Mon Jun 23 13:50:02 2014 (r267797) +++ stable/10/lib/libc/stdtime/strptime.c Mon Jun 23 15:03:51 2014 (r267798) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); static char * _strptime(const char *, const char *, struct tm *, int *, locale_t); -#define asizeof(a) (sizeof (a) / sizeof ((a)[0])) +#define asizeof(a) (sizeof (a) / sizeof ((a)[0])) static char * _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp, @@ -64,8 +64,7 @@ _strptime(const char *buf, const char *f { char c; const char *ptr; - int i, - len; + int i, len; int Ealternative, Oalternative; struct lc_time_T *tptr = __get_current_time_locale(locale); @@ -82,7 +81,7 @@ _strptime(const char *buf, const char *f isspace_l((unsigned char)*buf, locale)) buf++; else if (c != *buf++) - return 0; + return (NULL); continue; } @@ -94,18 +93,18 @@ label: case 0: case '%': if (*buf++ != '%') - return 0; + return (NULL); break; case '+': buf = _strptime(buf, tptr->date_fmt, tm, GMTp, locale); - if (buf == 0) - return 0; + if (buf == NULL) + return (NULL); break; case 'C': if (!isdigit_l((unsigned char)*buf, locale)) - return 0; + return (NULL); /* XXX This will break for 3-digit centuries. */ len = 2; @@ -116,21 +115,21 @@ label: len--; } if (i < 19) - return 0; + return (NULL); tm->tm_year = i * 100 - 1900; break; case 'c': buf = _strptime(buf, tptr->c_fmt, tm, GMTp, locale); - if (buf == 0) - return 0; + if (buf == NULL) + return (NULL); break; case 'D': buf = _strptime(buf, "%m/%d/%y", tm, GMTp, locale); - if (buf == 0) - return 0; + if (buf == NULL) + return (NULL); break; case 'E': @@ -147,43 +146,43 @@ label: case 'F': buf = _strptime(buf, "%Y-%m-%d", tm, GMTp, locale); - if (buf == 0) - return 0; + if (buf == NULL) + return (NULL); break; case 'R': buf = _strptime(buf, "%H:%M", tm, GMTp, locale); - if (buf == 0) - return 0; + if (buf == NULL) + return (NULL); break; case 'r': buf = _strptime(buf, tptr->ampm_fmt, tm, GMTp, locale); - if (buf == 0) - return 0; + if (buf == NULL) + return (NULL); break; case 'T': buf = _strptime(buf, "%H:%M:%S", tm, GMTp, locale); - if (buf == 0) - return 0; + if (buf == NULL) + return (NULL); break; case 'X': buf = _strptime(buf, tptr->X_fmt, tm, GMTp, locale); - if (buf == 0) - return 0; + if (buf == NULL) + return (NULL); break; case 'x': buf = _strptime(buf, tptr->x_fmt, tm, GMTp, locale); - if (buf == 0) - return 0; + if (buf == NULL) + return (NULL); break; case 'j': if (!isdigit_l((unsigned char)*buf, locale)) - return 0; + return (NULL); len = 3; for (i = 0; len && *buf != 0 && @@ -193,7 +192,7 @@ label: len--; } if (i < 1 || i > 366) - return 0; + return (NULL); tm->tm_yday = i - 1; break; @@ -205,7 +204,7 @@ label: break; if (!isdigit_l((unsigned char)*buf, locale)) - return 0; + return (NULL); len = 2; for (i = 0; len && *buf != 0 && @@ -217,11 +216,11 @@ label: if (c == 'M') { if (i > 59) - return 0; + return (NULL); tm->tm_min = i; } else { if (i > 60) - return 0; + return (NULL); tm->tm_sec = i; } @@ -245,7 +244,7 @@ label: * digits if used incorrectly. */ if (!isdigit_l((unsigned char)*buf, locale)) - return 0; + return (NULL); len = 2; for (i = 0; len && *buf != 0 && @@ -256,9 +255,9 @@ label: } if (c == 'H' || c == 'k') { if (i > 23) - return 0; + return (NULL); } else if (i > 12) - return 0; + return (NULL); tm->tm_hour = i; @@ -277,7 +276,7 @@ label: len = strlen(tptr->am); if (strncasecmp_l(buf, tptr->am, len, locale) == 0) { if (tm->tm_hour > 12) - return 0; + return (NULL); if (tm->tm_hour == 12) tm->tm_hour = 0; buf += len; @@ -287,14 +286,14 @@ label: len = strlen(tptr->pm); if (strncasecmp_l(buf, tptr->pm, len, locale) == 0) { if (tm->tm_hour > 12) - return 0; + return (NULL); if (tm->tm_hour != 12) tm->tm_hour += 12; buf += len; break; } - return 0; + return (NULL); case 'A': case 'a': @@ -309,7 +308,7 @@ label: break; } if (i == asizeof(tptr->weekday)) - return 0; + return (NULL); tm->tm_wday = i; buf += len; @@ -324,7 +323,7 @@ label: * range for now. */ if (!isdigit_l((unsigned char)*buf, locale)) - return 0; + return (NULL); len = 2; for (i = 0; len && *buf != 0 && @@ -334,7 +333,7 @@ label: len--; } if (i > 53) - return 0; + return (NULL); if (*buf != 0 && isspace_l((unsigned char)*buf, locale)) @@ -345,11 +344,11 @@ label: case 'w': if (!isdigit_l((unsigned char)*buf, locale)) - return 0; + return (NULL); i = *buf - '0'; if (i > 6) - return 0; + return (NULL); tm->tm_wday = i; @@ -371,7 +370,7 @@ label: * digits if used incorrectly. */ if (!isdigit_l((unsigned char)*buf, locale)) - return 0; + return (NULL); len = 2; for (i = 0; len && *buf != 0 && @@ -381,7 +380,7 @@ label: len--; } if (i > 31) - return 0; + return (NULL); tm->tm_mday = i; @@ -424,7 +423,7 @@ label: } } if (i == asizeof(tptr->month)) - return 0; + return (NULL); tm->tm_mon = i; buf += len; @@ -432,7 +431,7 @@ label: case 'm': if (!isdigit_l((unsigned char)*buf, locale)) - return 0; + return (NULL); len = 2; for (i = 0; len && *buf != 0 && @@ -442,7 +441,7 @@ label: len--; } if (i < 1 || i > 12) - return 0; + return (NULL); tm->tm_mon = i - 1; @@ -465,7 +464,7 @@ label: n = strtol_l(buf, &cp, 10, locale); if (errno == ERANGE || (long)(t = n) != n) { errno = sverrno; - return 0; + return (NULL); } errno = sverrno; buf = cp; @@ -481,7 +480,7 @@ label: break; if (!isdigit_l((unsigned char)*buf, locale)) - return 0; + return (NULL); len = (c == 'Y') ? 4 : 2; for (i = 0; len && *buf != 0 && @@ -495,7 +494,7 @@ label: if (c == 'y' && i < 69) i += 100; if (i < 0) - return 0; + return (NULL); tm->tm_year = i; @@ -526,7 +525,7 @@ label: } else if (0 == strcmp(zonestr, tzname[1])) { tm->tm_isdst = 1; } else { - return 0; + return (NULL); } buf += cp - buf; } @@ -541,7 +540,7 @@ label: if (*buf == '-') sign = -1; else - return 0; + return (NULL); } buf++; @@ -552,7 +551,7 @@ label: i += *buf - '0'; buf++; } else - return 0; + return (NULL); } tm->tm_hour -= sign * (i / 100); @@ -562,7 +561,7 @@ label: break; } } - return (char *)buf; + return ((char *)buf); } Modified: stable/10/lib/libc/stdtime/timelocal.c ============================================================================== --- stable/10/lib/libc/stdtime/timelocal.c Mon Jun 23 13:50:02 2014 (r267797) +++ stable/10/lib/libc/stdtime/timelocal.c Mon Jun 23 15:03:51 2014 (r267798) @@ -46,7 +46,7 @@ struct xlocale_time { struct xlocale_time __xlocale_global_time; -#define LCTIME_SIZE (sizeof(struct lc_time_T) / sizeof(char *)) +#define LCTIME_SIZE (sizeof(struct lc_time_T) / sizeof(char *)) static const struct lc_time_T _C_time_locale = { { From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 22:31:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 16FF03DB; Mon, 23 Jun 2014 22:31: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 EC1212C61; Mon, 23 Jun 2014 22:31: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 s5NMVS07092411; Mon, 23 Jun 2014 22:31:28 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NMVS4d092409; Mon, 23 Jun 2014 22:31:28 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201406232231.s5NMVS4d092409@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 23 Jun 2014 22:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267807 - in stable/10: sbin/mount_nullfs sys/x86/acpica X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 22:31:29 -0000 Author: rodrigc Date: Mon Jun 23 22:31:28 2014 New Revision: 267807 URL: http://svnweb.freebsd.org/changeset/base/267807 Log: MFC r263795: Strict value checking will cause problem. Bay trail DN2820FYKH is supported on Linux but does not work on FreeBSD. This behaviour is bug-compatible with Linux-3.13.5. References: http://d.hatena.ne.jp/syuu1228/20140326 http://lxr.linux.no/linux+v3.13.5/arch/x86/kernel/acpi/boot.c#L1094 Submitted by: syuu PR: 187966 Modified: stable/10/sbin/mount_nullfs/mount_nullfs.c stable/10/sys/x86/acpica/madt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/mount_nullfs/mount_nullfs.c ============================================================================== --- stable/10/sbin/mount_nullfs/mount_nullfs.c Mon Jun 23 19:47:25 2014 (r267806) +++ stable/10/sbin/mount_nullfs/mount_nullfs.c Mon Jun 23 22:31:28 2014 (r267807) @@ -103,18 +103,25 @@ main(int argc, char *argv[]) err(EX_USAGE, "%s", source); if (subdir(target, source) || subdir(source, target)) - errx(EX_USAGE, "%s (%s) and %s are not distinct paths", + errx(EX_USAGE, "%s (%s) and %s are not lldistinct paths", argv[0], target, argv[1]); + printf("Debug: 1\n"); build_iovec(&iov, &iovlen, "fstype", nullfs, (size_t)-1); build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1); build_iovec(&iov, &iovlen, "target", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); + printf("Debug: 2, source: %zd target: %zdd\n", strlen(source), strlen(target)); if (nmount(iov, iovlen, 0) < 0) { - if (errmsg[0] != 0) + printf("Debug: 3\n"); + if (errmsg[0] != 0) { + printf("Debug 4\n"); err(1, "%s: %s", source, errmsg); - else + } + else { + printf("Debug 5\n"); err(1, "%s", source); + } } exit(0); } Modified: stable/10/sys/x86/acpica/madt.c ============================================================================== --- stable/10/sys/x86/acpica/madt.c Mon Jun 23 19:47:25 2014 (r267806) +++ stable/10/sys/x86/acpica/madt.c Mon Jun 23 22:31:28 2014 (r267807) @@ -306,10 +306,11 @@ interrupt_polarity(UINT16 IntiFlags, UIN case ACPI_MADT_POLARITY_ACTIVE_HIGH: return (INTR_POLARITY_HIGH); case ACPI_MADT_POLARITY_ACTIVE_LOW: - return (INTR_POLARITY_LOW); + break; default: - panic("Bogus Interrupt Polarity"); + printf("WARNING: Bogus Interrupt Polarity. Assume POLALITY LOW"); } + return (INTR_POLARITY_LOW); } static enum intr_trigger @@ -325,10 +326,13 @@ interrupt_trigger(UINT16 IntiFlags, UINT case ACPI_MADT_TRIGGER_EDGE: return (INTR_TRIGGER_EDGE); case ACPI_MADT_TRIGGER_LEVEL: - return (INTR_TRIGGER_LEVEL); + break; default: - panic("Bogus Interrupt Trigger Mode"); + printf("WARNING: Bogus Interrupt Trigger Mode. Assume Level trigger."); + + break; } + return (INTR_TRIGGER_LEVEL); } /* From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 22:33:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E889D5C9; Mon, 23 Jun 2014 22:33:20 +0000 (UTC) Received: from mail-we0-x232.google.com (mail-we0-x232.google.com [IPv6:2a00:1450:400c:c03::232]) (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 E12002CAB; Mon, 23 Jun 2014 22:33:19 +0000 (UTC) Received: by mail-we0-f178.google.com with SMTP id x48so7941685wes.9 for ; Mon, 23 Jun 2014 15:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=6O+vWC4+Kqo6DGXES1u7qAoqkYSBXF6wVs50GN76oEo=; b=aiL8PC5xUz0M7/P3Pz/3HXF559mAFY+nia2ry96slYeHHfblstYvKaJYt5gbqNKf6e cHXjQ0KiXyhkB63gWQUdf/GZhhbK0BC7kRymUsGtBIVlEM0MtoFkBOIN08yzLjDoaBvF VFr1O+vq+BUu6qqNzy8FDDd56zfyEmc67tZmDpJXBgZzYsNB6CEAW5TSM+N6nW1RehlB aTY6lkSyqIQnEKv21fKvdCnF2+eqmhfPLobIAFq9buuevzVmtcbzAYzwUaQaFdOlOc9Q +kmfrG8Coi4KQA+kbYEFg2P+7LRuX5hwhPc2r9XcWt2k96eNSAd51wMuZALmYjtzt1fT xG+Q== X-Received: by 10.194.238.134 with SMTP id vk6mr31435307wjc.93.1403562797997; Mon, 23 Jun 2014 15:33:17 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id jv9sm39142241wjc.28.2014.06.23.15.33.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Jun 2014 15:33:17 -0700 (PDT) Date: Tue, 24 Jun 2014 00:33:14 +0200 From: Mateusz Guzik To: Craig Rodrigues Subject: Re: svn commit: r267807 - in stable/10: sbin/mount_nullfs sys/x86/acpica Message-ID: <20140623223314.GA15832@dft-labs.eu> References: <201406232231.s5NMVS4d092409@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201406232231.s5NMVS4d092409@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 22:33:21 -0000 On Mon, Jun 23, 2014 at 10:31:28PM +0000, Craig Rodrigues wrote: > Author: rodrigc > Date: Mon Jun 23 22:31:28 2014 > New Revision: 267807 > URL: http://svnweb.freebsd.org/changeset/base/267807 > > Log: > MFC r263795: > > Strict value checking will cause problem. > Bay trail DN2820FYKH is supported on Linux but does not work on FreeBSD. > This behaviour is bug-compatible with Linux-3.13.5. > > References: > http://d.hatena.ne.jp/syuu1228/20140326 > http://lxr.linux.no/linux+v3.13.5/arch/x86/kernel/acpi/boot.c#L1094 > > Submitted by: syuu > PR: 187966 > > Modified: > stable/10/sbin/mount_nullfs/mount_nullfs.c > stable/10/sys/x86/acpica/madt.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sbin/mount_nullfs/mount_nullfs.c > ============================================================================== > --- stable/10/sbin/mount_nullfs/mount_nullfs.c Mon Jun 23 19:47:25 2014 (r267806) > +++ stable/10/sbin/mount_nullfs/mount_nullfs.c Mon Jun 23 22:31:28 2014 (r267807) > @@ -103,18 +103,25 @@ main(int argc, char *argv[]) > err(EX_USAGE, "%s", source); > > if (subdir(target, source) || subdir(source, target)) > - errx(EX_USAGE, "%s (%s) and %s are not distinct paths", > + errx(EX_USAGE, "%s (%s) and %s are not lldistinct paths", > argv[0], target, argv[1]); > > + printf("Debug: 1\n"); > build_iovec(&iov, &iovlen, "fstype", nullfs, (size_t)-1); > build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1); > build_iovec(&iov, &iovlen, "target", target, (size_t)-1); > build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); > + printf("Debug: 2, source: %zd target: %zdd\n", strlen(source), strlen(target)); > if (nmount(iov, iovlen, 0) < 0) { > - if (errmsg[0] != 0) > + printf("Debug: 3\n"); > + if (errmsg[0] != 0) { > + printf("Debug 4\n"); > err(1, "%s: %s", source, errmsg); > - else > + } > + else { > + printf("Debug 5\n"); > err(1, "%s", source); > + } > } > exit(0); > } > Does not look intended. :> -- Mateusz Guzik From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 22:35:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AF15A772; Mon, 23 Jun 2014 22:35: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 8137D2CC6; Mon, 23 Jun 2014 22:35: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 s5NMZgqi095468; Mon, 23 Jun 2014 22:35:42 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NMZgjP095465; Mon, 23 Jun 2014 22:35:42 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201406232235.s5NMZgjP095465@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 23 Jun 2014 22:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267808 - in stable/10: sbin/mount_nullfs sys/x86/acpica X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 22:35:42 -0000 Author: rodrigc Date: Mon Jun 23 22:35:41 2014 New Revision: 267808 URL: http://svnweb.freebsd.org/changeset/base/267808 Log: Undo bad merge. Modified: stable/10/sbin/mount_nullfs/mount_nullfs.c stable/10/sys/x86/acpica/madt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/mount_nullfs/mount_nullfs.c ============================================================================== --- stable/10/sbin/mount_nullfs/mount_nullfs.c Mon Jun 23 22:31:28 2014 (r267807) +++ stable/10/sbin/mount_nullfs/mount_nullfs.c Mon Jun 23 22:35:41 2014 (r267808) @@ -103,25 +103,18 @@ main(int argc, char *argv[]) err(EX_USAGE, "%s", source); if (subdir(target, source) || subdir(source, target)) - errx(EX_USAGE, "%s (%s) and %s are not lldistinct paths", + errx(EX_USAGE, "%s (%s) and %s are not distinct paths", argv[0], target, argv[1]); - printf("Debug: 1\n"); build_iovec(&iov, &iovlen, "fstype", nullfs, (size_t)-1); build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1); build_iovec(&iov, &iovlen, "target", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - printf("Debug: 2, source: %zd target: %zdd\n", strlen(source), strlen(target)); if (nmount(iov, iovlen, 0) < 0) { - printf("Debug: 3\n"); - if (errmsg[0] != 0) { - printf("Debug 4\n"); + if (errmsg[0] != 0) err(1, "%s: %s", source, errmsg); - } - else { - printf("Debug 5\n"); + else err(1, "%s", source); - } } exit(0); } Modified: stable/10/sys/x86/acpica/madt.c ============================================================================== --- stable/10/sys/x86/acpica/madt.c Mon Jun 23 22:31:28 2014 (r267807) +++ stable/10/sys/x86/acpica/madt.c Mon Jun 23 22:35:41 2014 (r267808) @@ -306,11 +306,10 @@ interrupt_polarity(UINT16 IntiFlags, UIN case ACPI_MADT_POLARITY_ACTIVE_HIGH: return (INTR_POLARITY_HIGH); case ACPI_MADT_POLARITY_ACTIVE_LOW: - break; + return (INTR_POLARITY_LOW); default: - printf("WARNING: Bogus Interrupt Polarity. Assume POLALITY LOW"); + panic("Bogus Interrupt Polarity"); } - return (INTR_POLARITY_LOW); } static enum intr_trigger @@ -326,13 +325,10 @@ interrupt_trigger(UINT16 IntiFlags, UINT case ACPI_MADT_TRIGGER_EDGE: return (INTR_TRIGGER_EDGE); case ACPI_MADT_TRIGGER_LEVEL: - break; + return (INTR_TRIGGER_LEVEL); default: - printf("WARNING: Bogus Interrupt Trigger Mode. Assume Level trigger."); - - break; + panic("Bogus Interrupt Trigger Mode"); } - return (INTR_TRIGGER_LEVEL); } /* From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 23 22:37:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B185C8DB; Mon, 23 Jun 2014 22:37: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 9E22B2CF1; Mon, 23 Jun 2014 22:37: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 s5NMbnS3095848; Mon, 23 Jun 2014 22:37:49 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NMbnOr095847; Mon, 23 Jun 2014 22:37:49 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201406232237.s5NMbnOr095847@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 23 Jun 2014 22:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267809 - stable/10/sys/x86/acpica X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 22:37:49 -0000 Author: rodrigc Date: Mon Jun 23 22:37:49 2014 New Revision: 267809 URL: http://svnweb.freebsd.org/changeset/base/267809 Log: MFC r263795: Strict value checking will cause problem. Bay trail DN2820FYKH is supported on Linux but does not work on FreeBSD. This behaviour is bug-compatible with Linux-3.13.5. References: http://d.hatena.ne.jp/syuu1228/20140326 http://lxr.linux.no/linux+v3.13.5/arch/x86/kernel/acpi/boot.c#L1094 Submitted by: syuu PR: 187966 Modified: stable/10/sys/x86/acpica/madt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/acpica/madt.c ============================================================================== --- stable/10/sys/x86/acpica/madt.c Mon Jun 23 22:35:41 2014 (r267808) +++ stable/10/sys/x86/acpica/madt.c Mon Jun 23 22:37:49 2014 (r267809) @@ -306,10 +306,11 @@ interrupt_polarity(UINT16 IntiFlags, UIN case ACPI_MADT_POLARITY_ACTIVE_HIGH: return (INTR_POLARITY_HIGH); case ACPI_MADT_POLARITY_ACTIVE_LOW: - return (INTR_POLARITY_LOW); + break; default: - panic("Bogus Interrupt Polarity"); + printf("WARNING: Bogus Interrupt Polarity. Assume POLALITY LOW"); } + return (INTR_POLARITY_LOW); } static enum intr_trigger @@ -325,10 +326,13 @@ interrupt_trigger(UINT16 IntiFlags, UINT case ACPI_MADT_TRIGGER_EDGE: return (INTR_TRIGGER_EDGE); case ACPI_MADT_TRIGGER_LEVEL: - return (INTR_TRIGGER_LEVEL); + break; default: - panic("Bogus Interrupt Trigger Mode"); + printf("WARNING: Bogus Interrupt Trigger Mode. Assume Level trigger."); + + break; } + return (INTR_TRIGGER_LEVEL); } /* From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 24 06:12:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E921C6B3; Tue, 24 Jun 2014 06:12: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 CAE162280; Tue, 24 Jun 2014 06:12: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 s5O6CChn013854; Tue, 24 Jun 2014 06:12:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5O6CCsb013851; Tue, 24 Jun 2014 06:12:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201406240612.s5O6CCsb013851@svn.freebsd.org> From: Dimitry Andric Date: Tue, 24 Jun 2014 06:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267813 - in stable: 10/contrib/llvm/lib/CodeGen/SelectionDAG 10/contrib/llvm/patches 9/contrib/llvm/lib/CodeGen/SelectionDAG 9/contrib/llvm/patches X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 06:12:13 -0000 Author: dim Date: Tue Jun 24 06:12:11 2014 New Revision: 267813 URL: http://svnweb.freebsd.org/changeset/base/267813 Log: MFC r267704: Pull in r211435 from upstream llvm trunk (by Benjamin Kramer): Legalizer: Add support for splitting insert_subvectors. We handle this by spilling the whole thing to the stack and doing the insertion as a store. PR19492. This happens in real code because the vectorizer creates v2i128 when AVX is enabled. This fixes a "fatal error: error in backend: Do not know how to split the result of this operator!" message encountered during compilation of the net-p2p/libtorrent-rasterbar port. Reported by: Evgeniy MFC r267705: Add the llvm patch for r267704. Added: stable/10/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff - copied unchanged from r267705, head/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/9/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff - copied unchanged from r267705, head/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h Tue Jun 24 04:37:36 2014 (r267812) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h Tue Jun 24 06:12:11 2014 (r267813) @@ -569,6 +569,7 @@ private: void SplitVecRes_BUILD_VECTOR(SDNode *N, SDValue &Lo, SDValue &Hi); void SplitVecRes_CONCAT_VECTORS(SDNode *N, SDValue &Lo, SDValue &Hi); void SplitVecRes_EXTRACT_SUBVECTOR(SDNode *N, SDValue &Lo, SDValue &Hi); + void SplitVecRes_INSERT_SUBVECTOR(SDNode *N, SDValue &Lo, SDValue &Hi); void SplitVecRes_FPOWI(SDNode *N, SDValue &Lo, SDValue &Hi); void SplitVecRes_INSERT_VECTOR_ELT(SDNode *N, SDValue &Lo, SDValue &Hi); void SplitVecRes_LOAD(LoadSDNode *N, SDValue &Lo, SDValue &Hi); Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Tue Jun 24 04:37:36 2014 (r267812) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Tue Jun 24 06:12:11 2014 (r267813) @@ -506,6 +506,7 @@ void DAGTypeLegalizer::SplitVectorResult case ISD::BUILD_VECTOR: SplitVecRes_BUILD_VECTOR(N, Lo, Hi); break; case ISD::CONCAT_VECTORS: SplitVecRes_CONCAT_VECTORS(N, Lo, Hi); break; case ISD::EXTRACT_SUBVECTOR: SplitVecRes_EXTRACT_SUBVECTOR(N, Lo, Hi); break; + case ISD::INSERT_SUBVECTOR: SplitVecRes_INSERT_SUBVECTOR(N, Lo, Hi); break; case ISD::FP_ROUND_INREG: SplitVecRes_InregOp(N, Lo, Hi); break; case ISD::FPOWI: SplitVecRes_FPOWI(N, Lo, Hi); break; case ISD::INSERT_VECTOR_ELT: SplitVecRes_INSERT_VECTOR_ELT(N, Lo, Hi); break; @@ -725,6 +726,43 @@ void DAGTypeLegalizer::SplitVecRes_EXTRA TLI.getVectorIdxTy())); } +void DAGTypeLegalizer::SplitVecRes_INSERT_SUBVECTOR(SDNode *N, SDValue &Lo, + SDValue &Hi) { + SDValue Vec = N->getOperand(0); + SDValue SubVec = N->getOperand(1); + SDValue Idx = N->getOperand(2); + SDLoc dl(N); + GetSplitVector(Vec, Lo, Hi); + + // Spill the vector to the stack. + EVT VecVT = Vec.getValueType(); + EVT SubVecVT = VecVT.getVectorElementType(); + SDValue StackPtr = DAG.CreateStackTemporary(VecVT); + SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr, + MachinePointerInfo(), false, false, 0); + + // Store the new subvector into the specified index. + SDValue SubVecPtr = GetVectorElementPointer(StackPtr, SubVecVT, Idx); + Type *VecType = VecVT.getTypeForEVT(*DAG.getContext()); + unsigned Alignment = TLI.getDataLayout()->getPrefTypeAlignment(VecType); + Store = DAG.getStore(Store, dl, SubVec, SubVecPtr, MachinePointerInfo(), + false, false, 0); + + // Load the Lo part from the stack slot. + Lo = DAG.getLoad(Lo.getValueType(), dl, Store, StackPtr, MachinePointerInfo(), + false, false, false, 0); + + // Increment the pointer to the other part. + unsigned IncrementSize = Lo.getValueType().getSizeInBits() / 8; + StackPtr = + DAG.getNode(ISD::ADD, dl, StackPtr.getValueType(), StackPtr, + DAG.getConstant(IncrementSize, StackPtr.getValueType())); + + // Load the Hi part from the stack slot. + Hi = DAG.getLoad(Hi.getValueType(), dl, Store, StackPtr, MachinePointerInfo(), + false, false, false, MinAlign(Alignment, IncrementSize)); +} + void DAGTypeLegalizer::SplitVecRes_FPOWI(SDNode *N, SDValue &Lo, SDValue &Hi) { SDLoc dl(N); Copied: stable/10/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff (from r267705, head/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff Tue Jun 24 06:12:11 2014 (r267813, copy of r267705, head/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff) @@ -0,0 +1,125 @@ +Pull in r211435 from upstream llvm trunk (by Benjamin Kramer): + + Legalizer: Add support for splitting insert_subvectors. + + We handle this by spilling the whole thing to the stack and doing the + insertion as a store. + + PR19492. This happens in real code because the vectorizer creates + v2i128 when AVX is enabled. + +This fixes a "fatal error: error in backend: Do not know how to split +the result of this operator!" message encountered during compilation of +the net-p2p/libtorrent-rasterbar port. + +Introduced here: http://svnweb.freebsd.org/changeset/base/267704 + +Index: lib/CodeGen/SelectionDAG/LegalizeTypes.h +=================================================================== +--- lib/CodeGen/SelectionDAG/LegalizeTypes.h ++++ lib/CodeGen/SelectionDAG/LegalizeTypes.h +@@ -569,6 +569,7 @@ class LLVM_LIBRARY_VISIBILITY DAGTypeLegalizer { + void SplitVecRes_BUILD_VECTOR(SDNode *N, SDValue &Lo, SDValue &Hi); + void SplitVecRes_CONCAT_VECTORS(SDNode *N, SDValue &Lo, SDValue &Hi); + void SplitVecRes_EXTRACT_SUBVECTOR(SDNode *N, SDValue &Lo, SDValue &Hi); ++ void SplitVecRes_INSERT_SUBVECTOR(SDNode *N, SDValue &Lo, SDValue &Hi); + void SplitVecRes_FPOWI(SDNode *N, SDValue &Lo, SDValue &Hi); + void SplitVecRes_INSERT_VECTOR_ELT(SDNode *N, SDValue &Lo, SDValue &Hi); + void SplitVecRes_LOAD(LoadSDNode *N, SDValue &Lo, SDValue &Hi); +Index: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +=================================================================== +--- lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ++++ lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +@@ -506,6 +506,7 @@ void DAGTypeLegalizer::SplitVectorResult(SDNode *N + case ISD::BUILD_VECTOR: SplitVecRes_BUILD_VECTOR(N, Lo, Hi); break; + case ISD::CONCAT_VECTORS: SplitVecRes_CONCAT_VECTORS(N, Lo, Hi); break; + case ISD::EXTRACT_SUBVECTOR: SplitVecRes_EXTRACT_SUBVECTOR(N, Lo, Hi); break; ++ case ISD::INSERT_SUBVECTOR: SplitVecRes_INSERT_SUBVECTOR(N, Lo, Hi); break; + case ISD::FP_ROUND_INREG: SplitVecRes_InregOp(N, Lo, Hi); break; + case ISD::FPOWI: SplitVecRes_FPOWI(N, Lo, Hi); break; + case ISD::INSERT_VECTOR_ELT: SplitVecRes_INSERT_VECTOR_ELT(N, Lo, Hi); break; +@@ -725,6 +726,43 @@ void DAGTypeLegalizer::SplitVecRes_EXTRACT_SUBVECT + TLI.getVectorIdxTy())); + } + ++void DAGTypeLegalizer::SplitVecRes_INSERT_SUBVECTOR(SDNode *N, SDValue &Lo, ++ SDValue &Hi) { ++ SDValue Vec = N->getOperand(0); ++ SDValue SubVec = N->getOperand(1); ++ SDValue Idx = N->getOperand(2); ++ SDLoc dl(N); ++ GetSplitVector(Vec, Lo, Hi); ++ ++ // Spill the vector to the stack. ++ EVT VecVT = Vec.getValueType(); ++ EVT SubVecVT = VecVT.getVectorElementType(); ++ SDValue StackPtr = DAG.CreateStackTemporary(VecVT); ++ SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr, ++ MachinePointerInfo(), false, false, 0); ++ ++ // Store the new subvector into the specified index. ++ SDValue SubVecPtr = GetVectorElementPointer(StackPtr, SubVecVT, Idx); ++ Type *VecType = VecVT.getTypeForEVT(*DAG.getContext()); ++ unsigned Alignment = TLI.getDataLayout()->getPrefTypeAlignment(VecType); ++ Store = DAG.getStore(Store, dl, SubVec, SubVecPtr, MachinePointerInfo(), ++ false, false, 0); ++ ++ // Load the Lo part from the stack slot. ++ Lo = DAG.getLoad(Lo.getValueType(), dl, Store, StackPtr, MachinePointerInfo(), ++ false, false, false, 0); ++ ++ // Increment the pointer to the other part. ++ unsigned IncrementSize = Lo.getValueType().getSizeInBits() / 8; ++ StackPtr = ++ DAG.getNode(ISD::ADD, dl, StackPtr.getValueType(), StackPtr, ++ DAG.getConstant(IncrementSize, StackPtr.getValueType())); ++ ++ // Load the Hi part from the stack slot. ++ Hi = DAG.getLoad(Hi.getValueType(), dl, Store, StackPtr, MachinePointerInfo(), ++ false, false, false, MinAlign(Alignment, IncrementSize)); ++} ++ + void DAGTypeLegalizer::SplitVecRes_FPOWI(SDNode *N, SDValue &Lo, + SDValue &Hi) { + SDLoc dl(N); +Index: test/CodeGen/X86/vec_split.ll +=================================================================== +--- test/CodeGen/X86/vec_split.ll ++++ test/CodeGen/X86/vec_split.ll +@@ -40,3 +40,36 @@ define <32 x i16> @split32(<32 x i16> %a, <32 x i1 + %2 = select <32 x i1> %1, <32 x i16> %a, <32 x i16> %b + ret <32 x i16> %2 + } ++ ++; PR19492 ++define i128 @split128(<2 x i128> %a, <2 x i128> %b) { ++; SSE4-LABEL: split128: ++; SSE4: addq ++; SSE4: adcq ++; SSE4: addq ++; SSE4: adcq ++; SSE4: addq ++; SSE4: adcq ++; SSE4: ret ++; AVX1-LABEL: split128: ++; AVX1: addq ++; AVX1: adcq ++; AVX1: addq ++; AVX1: adcq ++; AVX1: addq ++; AVX1: adcq ++; AVX1: ret ++; AVX2-LABEL: split128: ++; AVX2: addq ++; AVX2: adcq ++; AVX2: addq ++; AVX2: adcq ++; AVX2: addq ++; AVX2: adcq ++; AVX2: ret ++ %add = add nsw <2 x i128> %a, %b ++ %rdx.shuf = shufflevector <2 x i128> %add, <2 x i128> undef, <2 x i32> ++ %bin.rdx = add <2 x i128> %add, %rdx.shuf ++ %e = extractelement <2 x i128> %bin.rdx, i32 1 ++ ret i128 %e ++} From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 24 08:21:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1DAC7B09; Tue, 24 Jun 2014 08:21: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 092FB2C75; Tue, 24 Jun 2014 08:21: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 s5O8LikM077804; Tue, 24 Jun 2014 08:21:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5O8Lhjm077794; Tue, 24 Jun 2014 08:21:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406240821.s5O8Lhjm077794@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Jun 2014 08:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267816 - in stable/10/sys: fs/devfs fs/msdosfs fs/tmpfs kern sys ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 08:21:45 -0000 Author: kib Date: Tue Jun 24 08:21:43 2014 New Revision: 267816 URL: http://svnweb.freebsd.org/changeset/base/267816 Log: MFC r267564: In msdosfs_setattr(), add a check for result of the utimes(2) permissions test. Refactor the permission checks for utimes(2). Modified: stable/10/sys/fs/devfs/devfs_vnops.c stable/10/sys/fs/msdosfs/msdosfs_vnops.c stable/10/sys/fs/tmpfs/tmpfs.h stable/10/sys/fs/tmpfs/tmpfs_subr.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c stable/10/sys/kern/vfs_vnops.c stable/10/sys/sys/vnode.h stable/10/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/10/sys/fs/devfs/devfs_vnops.c Tue Jun 24 06:55:49 2014 (r267815) +++ stable/10/sys/fs/devfs/devfs_vnops.c Tue Jun 24 08:21:43 2014 (r267816) @@ -1533,10 +1533,8 @@ devfs_setattr(struct vop_setattr_args *a } if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) { - /* See the comment in ufs_vnops::ufs_setattr(). */ - if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td)) && - ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(vp, VWRITE, ap->a_cred, td)))) + error = vn_utimes_perm(vp, vap, ap->a_cred, td); + if (error != 0) return (error); if (vap->va_atime.tv_sec != VNOVAL) { if (vp->v_type == VCHR) Modified: stable/10/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_vnops.c Tue Jun 24 06:55:49 2014 (r267815) +++ stable/10/sys/fs/msdosfs/msdosfs_vnops.c Tue Jun 24 08:21:43 2014 (r267816) @@ -501,12 +501,9 @@ msdosfs_setattr(ap) if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - if (vap->va_vaflags & VA_UTIMES_NULL) { - error = VOP_ACCESS(vp, VADMIN, cred, td); - if (error) - error = VOP_ACCESS(vp, VWRITE, cred, td); - } else - error = VOP_ACCESS(vp, VADMIN, cred, td); + error = vn_utimes_perm(vp, vap, cred, td); + if (error != 0) + return (error); if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 && vap->va_atime.tv_sec != VNOVAL) { dep->de_flag &= ~DE_ACCESS; Modified: stable/10/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs.h Tue Jun 24 06:55:49 2014 (r267815) +++ stable/10/sys/fs/tmpfs/tmpfs.h Tue Jun 24 08:21:43 2014 (r267816) @@ -425,8 +425,8 @@ int tmpfs_chmod(struct vnode *, mode_t, int tmpfs_chown(struct vnode *, uid_t, gid_t, struct ucred *, struct thread *); int tmpfs_chsize(struct vnode *, u_quad_t, struct ucred *, struct thread *); -int tmpfs_chtimes(struct vnode *, struct timespec *, struct timespec *, - struct timespec *, int, struct ucred *, struct thread *); +int tmpfs_chtimes(struct vnode *, struct vattr *, struct ucred *cred, + struct thread *); void tmpfs_itimes(struct vnode *, const struct timespec *, const struct timespec *); Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Tue Jun 24 06:55:49 2014 (r267815) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Tue Jun 24 08:21:43 2014 (r267816) @@ -1677,8 +1677,8 @@ tmpfs_chsize(struct vnode *vp, u_quad_t * The vnode must be locked on entry and remain locked on exit. */ int -tmpfs_chtimes(struct vnode *vp, struct timespec *atime, struct timespec *mtime, - struct timespec *birthtime, int vaflags, struct ucred *cred, struct thread *l) +tmpfs_chtimes(struct vnode *vp, struct vattr *vap, + struct ucred *cred, struct thread *l) { int error; struct tmpfs_node *node; @@ -1695,29 +1695,25 @@ tmpfs_chtimes(struct vnode *vp, struct t if (node->tn_flags & (IMMUTABLE | APPEND)) return EPERM; - /* Determine if the user have proper privilege to update time. */ - if (vaflags & VA_UTIMES_NULL) { - error = VOP_ACCESS(vp, VADMIN, cred, l); - if (error) - error = VOP_ACCESS(vp, VWRITE, cred, l); - } else - error = VOP_ACCESS(vp, VADMIN, cred, l); - if (error) + error = vn_utimes_perm(vp, vap, cred, l); + if (error != 0) return (error); - if (atime->tv_sec != VNOVAL && atime->tv_nsec != VNOVAL) + if (vap->va_atime.tv_sec != VNOVAL && vap->va_atime.tv_nsec != VNOVAL) node->tn_status |= TMPFS_NODE_ACCESSED; - if (mtime->tv_sec != VNOVAL && mtime->tv_nsec != VNOVAL) + if (vap->va_mtime.tv_sec != VNOVAL && vap->va_mtime.tv_nsec != VNOVAL) node->tn_status |= TMPFS_NODE_MODIFIED; - if (birthtime->tv_nsec != VNOVAL && birthtime->tv_nsec != VNOVAL) + if (vap->va_birthtime.tv_nsec != VNOVAL && + vap->va_birthtime.tv_nsec != VNOVAL) node->tn_status |= TMPFS_NODE_MODIFIED; - tmpfs_itimes(vp, atime, mtime); + tmpfs_itimes(vp, &vap->va_atime, &vap->va_mtime); - if (birthtime->tv_nsec != VNOVAL && birthtime->tv_nsec != VNOVAL) - node->tn_birthtime = *birthtime; + if (vap->va_birthtime.tv_nsec != VNOVAL && + vap->va_birthtime.tv_nsec != VNOVAL) + node->tn_birthtime = vap->va_birthtime; MPASS(VOP_ISLOCKED(vp)); return 0; Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Tue Jun 24 06:55:49 2014 (r267815) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Tue Jun 24 08:21:43 2014 (r267816) @@ -378,10 +378,6 @@ tmpfs_getattr(struct vop_getattr_args *v return 0; } -/* --------------------------------------------------------------------- */ - -/* XXX Should this operation be atomic? I think it should, but code in - * XXX other places (e.g., ufs) doesn't seem to be... */ int tmpfs_setattr(struct vop_setattr_args *v) { @@ -425,8 +421,7 @@ tmpfs_setattr(struct vop_setattr_args *v vap->va_mtime.tv_nsec != VNOVAL) || (vap->va_birthtime.tv_sec != VNOVAL && vap->va_birthtime.tv_nsec != VNOVAL))) - error = tmpfs_chtimes(vp, &vap->va_atime, &vap->va_mtime, - &vap->va_birthtime, vap->va_vaflags, cred, td); + error = tmpfs_chtimes(vp, vap, cred, td); /* Update the node times. We give preference to the error codes * generated by this function rather than the ones that may arise Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Tue Jun 24 06:55:49 2014 (r267815) +++ stable/10/sys/kern/vfs_vnops.c Tue Jun 24 08:21:43 2014 (r267816) @@ -2085,3 +2085,27 @@ drop: foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); return (error); } + +int +vn_utimes_perm(struct vnode *vp, struct vattr *vap, struct ucred *cred, + struct thread *td) +{ + int error; + + error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred, td); + + /* + * From utimes(2): + * Grant permission if the caller is the owner of the file or + * the super-user. If the time pointer is null, then write + * permission on the file is also sufficient. + * + * From NFSv4.1, draft 21, 6.2.1.3.1, Discussion of Mask Attributes: + * A user having ACL_WRITE_DATA or ACL_WRITE_ATTRIBUTES + * will be allowed to set the times [..] to the current + * server time. + */ + if (error != 0 && (vap->va_vaflags & VA_UTIMES_NULL) != 0) + error = VOP_ACCESS(vp, VWRITE, cred, td); + return (error); +} Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Tue Jun 24 06:55:49 2014 (r267815) +++ stable/10/sys/sys/vnode.h Tue Jun 24 08:21:43 2014 (r267816) @@ -696,6 +696,8 @@ int vn_extattr_rm(struct vnode *vp, int const char *attrname, struct thread *td); int vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp); +int vn_utimes_perm(struct vnode *vp, struct vattr *vap, + struct ucred *cred, struct thread *td); int vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio); int vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, int xfersize, Modified: stable/10/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_vnops.c Tue Jun 24 06:55:49 2014 (r267815) +++ stable/10/sys/ufs/ufs/ufs_vnops.c Tue Jun 24 08:21:43 2014 (r267816) @@ -635,35 +635,8 @@ ufs_setattr(ap) return (EROFS); if ((ip->i_flags & SF_SNAPSHOT) != 0) return (EPERM); - /* - * From utimes(2): - * If times is NULL, ... The caller must be the owner of - * the file, have permission to write the file, or be the - * super-user. - * If times is non-NULL, ... The caller must be the owner of - * the file or be the super-user. - * - * Possibly for historical reasons, try to use VADMIN in - * preference to VWRITE for a NULL timestamp. This means we - * will return EACCES in preference to EPERM if neither - * check succeeds. - */ - if (vap->va_vaflags & VA_UTIMES_NULL) { - /* - * NFSv4.1, draft 21, 6.2.1.3.1, Discussion of Mask Attributes - * - * "A user having ACL_WRITE_DATA or ACL_WRITE_ATTRIBUTES - * will be allowed to set the times [..] to the current - * server time." - * - * XXX: Calling it four times seems a little excessive. - */ - error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred, td); - if (error) - error = VOP_ACCESS(vp, VWRITE, cred, td); - } else - error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred, td); - if (error) + error = vn_utimes_perm(vp, vap, cred, td); + if (error != 0) return (error); if (vap->va_atime.tv_sec != VNOVAL) ip->i_flag |= IN_ACCESS; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 24 15:57:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 ADE6A946; Tue, 24 Jun 2014 15:57: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 8070129E1; Tue, 24 Jun 2014 15:57: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 s5OFvnfo091631; Tue, 24 Jun 2014 15:57:49 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OFvn6L091628; Tue, 24 Jun 2014 15:57:49 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201406241557.s5OFvn6L091628@svn.freebsd.org> From: Bryan Drewery Date: Tue, 24 Jun 2014 15:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267823 - in stable/10: . share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 15:57:49 -0000 Author: bdrewery Date: Tue Jun 24 15:57:48 2014 New Revision: 267823 URL: http://svnweb.freebsd.org/changeset/base/267823 Log: MFC r267599: - Add a LOCAL_ITOOLS to allow adding additional tools required for the installworld and distributeworld targets PR: 179562 Modified: stable/10/Makefile.inc1 stable/10/share/man/man7/build.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Jun 24 15:54:42 2014 (r267822) +++ stable/10/Makefile.inc1 Tue Jun 24 15:57:48 2014 (r267823) @@ -17,6 +17,7 @@ # -DNO_DOCUPDATE do not update doc in ${MAKE} update # -DNO_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list +# LOCAL_ITOOLS="list of tools" to add additional tools to the ITOOLS list # LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target # LOCAL_MTREE="list of mtree files" to process to allow local directories # to be created before files are installed @@ -756,7 +757,8 @@ _nmtree_itools= nmtree ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ date echo egrep find grep id install ${_install-info} \ ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \ - rm sed sh sysctl test true uname wc ${_zoneinfo} + rm sed sh sysctl test true uname wc ${_zoneinfo} \ + ${LOCAL_ITOOLS} # # distributeworld Modified: stable/10/share/man/man7/build.7 ============================================================================== --- stable/10/share/man/man7/build.7 Tue Jun 24 15:54:42 2014 (r267822) +++ stable/10/share/man/man7/build.7 Tue Jun 24 15:57:48 2014 (r267823) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd June 17, 2014 .Dt BUILD 7 .Os .Sh NAME @@ -415,6 +415,12 @@ If set, this variable supplies a list of the root of the source tree to build as part of the .Cm everything target. +.It Va LOCAL_ITOOLS +If set, this variable supplies a list of additional tools that are used by the +.Cm installworld +and +.Cm distributeworld +targets. .It Va LOCAL_LIB_DIRS If set, this variable supplies a list of additional directories relative to the root of the source tree to build as part of the From owner-svn-src-stable-10@FreeBSD.ORG Tue Jun 24 19:04:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CDFC97B1; Tue, 24 Jun 2014 19:04: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 1EA8A2D56; Tue, 24 Jun 2014 19:04: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 s5OJ4wf6089404; Tue, 24 Jun 2014 19:04:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OJ4wNj089398; Tue, 24 Jun 2014 19:04:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406241904.s5OJ4wNj089398@svn.freebsd.org> From: Xin LI Date: Tue, 24 Jun 2014 19:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267828 - in stable: 10/contrib/file 10/contrib/file/Magdir 8/contrib/file 9/contrib/file 9/contrib/file/Magdir X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 19:04:59 -0000 Author: delphij Date: Tue Jun 24 19:04:55 2014 New Revision: 267828 URL: http://svnweb.freebsd.org/changeset/base/267828 Log: Fix multiple vulnerabilities in file(1) and libmagic(3). Security: FreeBSD-SA-14:16.file Approved by: so Modified: stable/10/contrib/file/Magdir/commands stable/10/contrib/file/ascmagic.c stable/10/contrib/file/file.h stable/10/contrib/file/funcs.c stable/10/contrib/file/softmagic.c Changes in other areas also in this revision: Modified: stable/8/contrib/file/ascmagic.c stable/8/contrib/file/cdf.c stable/8/contrib/file/cdf.h stable/8/contrib/file/cdf_time.c stable/8/contrib/file/file.h stable/8/contrib/file/funcs.c stable/8/contrib/file/readcdf.c stable/8/contrib/file/softmagic.c stable/9/contrib/file/Magdir/commands stable/9/contrib/file/ascmagic.c stable/9/contrib/file/file.h stable/9/contrib/file/funcs.c stable/9/contrib/file/softmagic.c Modified: stable/10/contrib/file/Magdir/commands ============================================================================== --- stable/10/contrib/file/Magdir/commands Tue Jun 24 19:04:32 2014 (r267827) +++ stable/10/contrib/file/Magdir/commands Tue Jun 24 19:04:55 2014 (r267828) @@ -49,7 +49,8 @@ !:mime text/x-awk 0 string/wt #!\ /usr/bin/awk awk script text executable !:mime text/x-awk -0 regex =^\\s*BEGIN\\s*[{] awk script text +0 regex =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text +!:strength - 12 # AT&T Bell Labs' Plan 9 shell 0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable Modified: stable/10/contrib/file/ascmagic.c ============================================================================== --- stable/10/contrib/file/ascmagic.c Tue Jun 24 19:04:32 2014 (r267827) +++ stable/10/contrib/file/ascmagic.c Tue Jun 24 19:04:55 2014 (r267828) @@ -147,7 +147,7 @@ file_ascmagic_with_encoding(struct magic == NULL) goto done; if ((rv = file_softmagic(ms, utf8_buf, - (size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0) + (size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0) rv = -1; } Modified: stable/10/contrib/file/file.h ============================================================================== --- stable/10/contrib/file/file.h Tue Jun 24 19:04:32 2014 (r267827) +++ stable/10/contrib/file/file.h Tue Jun 24 19:04:55 2014 (r267828) @@ -414,7 +414,7 @@ protected int file_encoding(struct magic unichar **, size_t *, const char **, const char **, const char **); protected int file_is_tar(struct magic_set *, const unsigned char *, size_t); protected int file_softmagic(struct magic_set *, const unsigned char *, size_t, - int, int); + size_t, int, int); protected struct mlist *file_apprentice(struct magic_set *, const char *, int); protected uint64_t file_signextend(struct magic_set *, struct magic *, uint64_t); Modified: stable/10/contrib/file/funcs.c ============================================================================== --- stable/10/contrib/file/funcs.c Tue Jun 24 19:04:32 2014 (r267827) +++ stable/10/contrib/file/funcs.c Tue Jun 24 19:04:55 2014 (r267828) @@ -228,7 +228,7 @@ file_buffer(struct magic_set *ms, int fd /* try soft magic tests */ if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0) - if ((m = file_softmagic(ms, ubuf, nb, BINTEST, + if ((m = file_softmagic(ms, ubuf, nb, 0, BINTEST, looks_text)) != 0) { if ((ms->flags & MAGIC_DEBUG) != 0) (void)fprintf(stderr, "softmagic %d\n", m); Modified: stable/10/contrib/file/softmagic.c ============================================================================== --- stable/10/contrib/file/softmagic.c Tue Jun 24 19:04:32 2014 (r267827) +++ stable/10/contrib/file/softmagic.c Tue Jun 24 19:04:55 2014 (r267828) @@ -43,9 +43,9 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.1 private int match(struct magic_set *, struct magic *, uint32_t, - const unsigned char *, size_t, int, int); + const unsigned char *, size_t, int, int, int); private int mget(struct magic_set *, const unsigned char *, - struct magic *, size_t, unsigned int, int); + struct magic *, size_t, unsigned int, int, int); private int magiccheck(struct magic_set *, struct magic *); private int32_t mprint(struct magic_set *, struct magic *); private int32_t moffset(struct magic_set *, struct magic *); @@ -60,6 +60,7 @@ private void cvt_16(union VALUETYPE *, c private void cvt_32(union VALUETYPE *, const struct magic *); private void cvt_64(union VALUETYPE *, const struct magic *); +#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o))) /* * softmagic - lookup one file in parsed, in-memory copy of database * Passed the name and FILE * of one file to be typed. @@ -67,13 +68,13 @@ private void cvt_64(union VALUETYPE *, c /*ARGSUSED1*/ /* nbytes passed for regularity, maybe need later */ protected int file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes, - int mode, int text) + size_t level, int mode, int text) { struct mlist *ml; int rv; for (ml = ms->mlist->next; ml != ms->mlist; ml = ml->next) if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, mode, - text)) != 0) + text, level)) != 0) return rv; return 0; @@ -108,7 +109,8 @@ file_softmagic(struct magic_set *ms, con */ private int match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, - const unsigned char *s, size_t nbytes, int mode, int text) + const unsigned char *s, size_t nbytes, int mode, int text, + int recursion_level) { uint32_t magindex = 0; unsigned int cont_level = 0; @@ -140,7 +142,7 @@ match(struct magic_set *ms, struct magic ms->line = m->lineno; /* if main entry matches, print it... */ - switch (mget(ms, s, m, nbytes, cont_level, text)) { + switch (mget(ms, s, m, nbytes, cont_level, text, recursion_level + 1)) { case -1: return -1; case 0: @@ -223,7 +225,7 @@ match(struct magic_set *ms, struct magic continue; } #endif - switch (mget(ms, s, m, nbytes, cont_level, text)) { + switch (mget(ms, s, m, nbytes, cont_level, text, recursion_level + 1)) { case -1: return -1; case 0: @@ -1018,12 +1020,18 @@ mcopy(struct magic_set *ms, union VALUET private int mget(struct magic_set *ms, const unsigned char *s, - struct magic *m, size_t nbytes, unsigned int cont_level, int text) + struct magic *m, size_t nbytes, unsigned int cont_level, int text, + int recursion_level) { uint32_t offset = ms->offset; uint32_t count = m->str_range; union VALUETYPE *p = &ms->ms_value; + if (recursion_level >= 20) { + file_error(ms, 0, "recursion nesting exceeded"); + return -1; + } + if (mcopy(ms, p, m->type, m->flag & INDIR, s, offset, nbytes, count) == -1) return -1; @@ -1073,7 +1081,7 @@ mget(struct magic_set *ms, const unsigne } switch (m->in_type) { case FILE_BYTE: - if (nbytes < (offset + 1)) + if (OFFSET_OOB(nbytes, offset, 1)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1108,7 +1116,7 @@ mget(struct magic_set *ms, const unsigne offset = ~offset; break; case FILE_BESHORT: - if (nbytes < (offset + 2)) + if (OFFSET_OOB(nbytes, offset, 2)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1160,7 +1168,7 @@ mget(struct magic_set *ms, const unsigne offset = ~offset; break; case FILE_LESHORT: - if (nbytes < (offset + 2)) + if (OFFSET_OOB(nbytes, offset, 2)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1212,7 +1220,7 @@ mget(struct magic_set *ms, const unsigne offset = ~offset; break; case FILE_SHORT: - if (nbytes < (offset + 2)) + if (OFFSET_OOB(nbytes, offset, 2)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1249,7 +1257,7 @@ mget(struct magic_set *ms, const unsigne break; case FILE_BELONG: case FILE_BEID3: - if (nbytes < (offset + 4)) + if (OFFSET_OOB(nbytes, offset, 4)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1320,7 +1328,7 @@ mget(struct magic_set *ms, const unsigne break; case FILE_LELONG: case FILE_LEID3: - if (nbytes < (offset + 4)) + if (OFFSET_OOB(nbytes, offset, 4)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1390,7 +1398,7 @@ mget(struct magic_set *ms, const unsigne offset = ~offset; break; case FILE_MELONG: - if (nbytes < (offset + 4)) + if (OFFSET_OOB(nbytes, offset, 4)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1460,7 +1468,7 @@ mget(struct magic_set *ms, const unsigne offset = ~offset; break; case FILE_LONG: - if (nbytes < (offset + 4)) + if (OFFSET_OOB(nbytes, offset, 4)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1527,14 +1535,14 @@ mget(struct magic_set *ms, const unsigne /* Verify we have enough data to match magic type */ switch (m->type) { case FILE_BYTE: - if (nbytes < (offset + 1)) /* should alway be true */ + if (OFFSET_OOB(nbytes, offset, 1)) return 0; break; case FILE_SHORT: case FILE_BESHORT: case FILE_LESHORT: - if (nbytes < (offset + 2)) + if (OFFSET_OOB(nbytes, offset, 2)) return 0; break; @@ -1553,21 +1561,21 @@ mget(struct magic_set *ms, const unsigne case FILE_FLOAT: case FILE_BEFLOAT: case FILE_LEFLOAT: - if (nbytes < (offset + 4)) + if (OFFSET_OOB(nbytes, offset, 4)) return 0; break; case FILE_DOUBLE: case FILE_BEDOUBLE: case FILE_LEDOUBLE: - if (nbytes < (offset + 8)) + if (OFFSET_OOB(nbytes, offset, 8)) return 0; break; case FILE_STRING: case FILE_PSTRING: case FILE_SEARCH: - if (nbytes < (offset + m->vallen)) + if (OFFSET_OOB(nbytes, offset, m->vallen)) return 0; break; @@ -1577,13 +1585,15 @@ mget(struct magic_set *ms, const unsigne break; case FILE_INDIRECT: + if (offset == 0) + return 0; if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && file_printf(ms, "%s", m->desc) == -1) return -1; if (nbytes < offset) return 0; return file_softmagic(ms, s + offset, nbytes - offset, - BINTEST, text); + recursion_level, BINTEST, text); case FILE_DEFAULT: /* nothing to check */ default: From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 25 00:10:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C320EFD5; Wed, 25 Jun 2014 00:10: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 ACB4C2F00; Wed, 25 Jun 2014 00:10: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 s5P0Afn6037319; Wed, 25 Jun 2014 00:10:41 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5P0Afxi037318; Wed, 25 Jun 2014 00:10:41 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406250010.s5P0Afxi037318@svn.freebsd.org> From: Glen Barber Date: Wed, 25 Jun 2014 00:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267846 - in stable: 10/release/doc/en_US.ISO8859-1/errata 9/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 00:10:41 -0000 Author: gjb Date: Wed Jun 25 00:10:41 2014 New Revision: 267846 URL: http://svnweb.freebsd.org/changeset/base/267846 Log: Document FreeBSD-SA-14:15.iconv and FreeBSD-SA-14:16.file Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Changes in other areas also in this revision: Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jun 24 22:15:27 2014 (r267845) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Wed Jun 25 00:10:41 2014 (r267846) @@ -201,6 +201,19 @@ 5 June 2014 Multiple vulnerabilities + + + SA-14:15.iconv + 24 June 2014 + NULL pointer dereference and out-of-bounds + array access + + + + SA-14:16.file + 24 June 2014 + Multiple vulnerabilities + From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 25 02:14:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E8B4776F; Wed, 25 Jun 2014 02:14: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 D29C329E2; Wed, 25 Jun 2014 02:14: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 s5P2EtQZ096105; Wed, 25 Jun 2014 02:14:55 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5P2EtY3096103; Wed, 25 Jun 2014 02:14:55 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201406250214.s5P2EtY3096103@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 25 Jun 2014 02:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267849 - in stable/10/sys: conf dev/cxgbe dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 02:14:56 -0000 Author: np Date: Wed Jun 25 02:14:55 2014 New Revision: 267849 URL: http://svnweb.freebsd.org/changeset/base/267849 Log: MFC r267757: cxgbe(4): Update the bundled T4 and T5 firmwares to versions 1.11.27.0 Obtained from: Chelsio Added: stable/10/sys/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu - copied unchanged from r267757, head/sys/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu stable/10/sys/dev/cxgbe/firmware/t5fw-1.11.27.0.bin.uu - copied unchanged from r267757, head/sys/dev/cxgbe/firmware/t5fw-1.11.27.0.bin.uu Deleted: stable/10/sys/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu stable/10/sys/dev/cxgbe/firmware/t5fw-1.9.12.0.bin.uu Modified: stable/10/sys/conf/files stable/10/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt stable/10/sys/dev/cxgbe/firmware/t4fw_interface.h stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt stable/10/sys/dev/cxgbe/t4_sge.c stable/10/sys/modules/cxgbe/t4_firmware/Makefile stable/10/sys/modules/cxgbe/t5_firmware/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Wed Jun 25 00:33:30 2014 (r267848) +++ stable/10/sys/conf/files Wed Jun 25 02:14:55 2014 (r267849) @@ -1202,7 +1202,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1226,7 +1226,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.9.12.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.11.27.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" Copied: stable/10/sys/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu (from r267757, head/sys/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu Wed Jun 25 02:14:55 2014 (r267849, copy of r267757, head/sys/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu) @@ -0,0 +1,9019 @@ +/*- + * Copyright (c) 2014 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + */ +begin-base64 644 t4fw +AAAD6QELGwAAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAA8wD2wPjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFdlZCBKdW4gMTggMTc6 +MTk6MzMgUERUIDIwMTQgb24gY2xlb3BhdHJhLmFzaWNkZXNpZ25lcnMuY29tOi9ob21lL2Zpcm13 +YXJlL2N2cy9mdy1yZWxlYXNlKSwgVmVyc2lvbiBUNHh4IDAxLjBiLjFiLjAwAAAAAAAAAG/bT/dg +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//zc4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//khAAAAAA +H/+SFAAAAAAf/5IYAAAAAB//khwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn +NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m +lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+KMOMACfgf/4owH/+KMOMAFCgf +/4owH/+KMOMAFCgf/4owH/+LuOMAFCgf/4u4H/+SCOMAFbAf/5IQH/+xHOMAHAgf/7EcH/+xHOMA +OxQf/8AAH//9yeMAOxQgAAAAIAABauMAeOAgAAF4IAABfOMAekwgAAF8IAABheMAelAgAAGYIAAB +nOMAelwgAAGcIAABpeMAemAgAAG4IAABvOMAemwgAAG8IAABxeMAenAgAAHYIAAB2OMAenwgAAHc +IAAB4uMAenwgAAH4IAAB+OMAeoQgAAH8IAAB/OMAeoQgAAIYIAACGOMAeoQgAAIcIAACHOMAeoQg +AAI4IAACOOMAeoQgAAI8IAACPOMAeoQgAAJYIAACWOMAeoQgAAJcIAACYuMAeoQgAAJ4IAACeOMA +eowgAAJ8IAACguMAeowgAAKYIAHZmeMAepQgAwAAIAMT/OMCUZggAxP8IAMT/OMCZZQgAxQAIAaQ +XOMCZZggBpBgIAaWEOMF4fggCAAAIAgOMOMF56ggCA4wIAkeUOMF9dggCR5QIAkfHOMHBfggCwAA +IAsAAOMHBsQgCwAAIAsAAOMHBsQgCwAAIAuPr+MHBsQAAAAAAAAAAAAAAAAgABGWIAARiCAAFXog +ABGIIAAU9SAAEYggABI9IAAUjSAAFBIgABGIIAATvSAAE3QgABMJIAARdSAAErQgABGIIAARiCAA +EYggABJcAAAAAP///////w/8///w////APwgAKejIACo4yAAqRMgAKjZIAComSAAqI8gAKhUIACo +SiAAqEAgAKfwIACpESAAp+YgAKfMAAAAAAAAAAAAAAAAAAAACgAAAAoAAAAUAAAACgAAAAoAAAAK +AAAACgAAAAoAAAAKAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAIAAwAEAAUABgAHAAgA +CQAKAA4AEQAVABkAHgAjAC0APABQAGQAyAEsAZAB9AAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAgAC +AAMAAwADAAMABAAEAAQABAAEAAUABQAFAAUABQAFAAYABgAHAAcAAAACAAAABgAAAAoAAAAOAAAA +FAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAAAFAQAABwAAAAoA +AAAOAAAAFAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAP8AAQIC +AAAAAAAAAAAAAAAQIEAAAAAAAAAAAAAAAAAABAACAAEAAIAAQAAgABAACCBAgAAAAAAAAAAAAAAA +AAAgCJ5CIAieQiAIngEgCJ3RIAidmiAInYAgCJ2AIAie9iAInvYgCJ2AIAie9iAInvYgCJ2AIAie +9iAInUwgCJ72IAie9iAInvYgCJ72IAie9iAInvYgCJ72IAie9iAInvYgCJ72IAie9iAInvYgCJ72 +IAie9iAInvYgCJ72IAidYSADCawAAAAAIAMJsAAAAAEgAwm4AAAAAgAAAAAAAAAAIAMJlAAAAAEg +AwmYAAAAAiADDbgAAAD/IAMHrAAAAP8gAwesAAAAACADDbgAAAAAIAMIvAAAAAEgAwjEAAAABCAD +CMwAAAAIIAMI2AAAACAgAwjoAAAAQCADCPAAAACAIAMI+AAAAQAgAwkAAAACACADCRQAAAQAIAMJ +KAAACAAgAwlAAAAQACADCVQAACAAIAMJZAAAQAAgAwlwAACAACADCYQAAQAAAAAAAAAAAAAgAwio +AAAAECADCLAAAAARIAMIkAAAAAAgAwiUAAAAASADCJgAAAACIAMIoAAAAAMAAAAAAAD//wAAAAAA +AP//IAMIEAAAAQAgAwgcAAAAgCADCCwAAABAIAMIPAAAACAgAwhMAAAAECADCFwAAAAIIAMIaAAA +AAQgAwh0AAAAAiADCIAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAA +AQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAABwAAAAcAAAAGAAAABgAMNQAAEEaq +ABRYVQAYagAAACtoAAAjgwAAGGoAAA0GAAALKgAAAAAAAAAAAAAAAAAAaCsAAGgrAABsggAAb5wA +AEpoAABKaAAATSkAAEpoAABO6gAATJgAAFI9AABPuAABhqAAAYagAAII1gACCNYAAgjVAAII1QAC +iwsAAosLAAII1QACtnIAArZyAAMNQAAEBgcAAAAAAAAAAAAAAAAgCRYVIAkWFSAJFgogCRX/IAkV +8SAJFekgCRXpIAkWGCAJFhggCRXpIAkWGCAJFhggCRXpIAkWGCAJFekgCRYYIAkWGCAJFhggCRYY +IAkWGCAJFhggCRYYIAkWGCAJFhggCRYYIAkWGCAJFhggCRYYIAkWGCAJFhggCRYYIAkWGAACAgUF +CAgLCw4OEREUFBcXGhodHSAgIyMmJikpLCwvLzIyNTU4ODs7AAAAAAAAAAEDEREICBAJAwEAAAAA +AAAgBLdgIAGTPCAANnggAWi8IAGPhCABiXwgAUegIAPaHB//6jQgAJRkIACppB//3RAgAGG8IABT +IAAAAAAAAAAAIAFqcCAAgbAAAAAAAAAAAB//1fQf/8V8H//ClB//wDAgAE4gIABGRCAAQoAgAKBk +H//j6CAGZ7gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAGbACABergg +ALNIIACyfB//8Ggf/9CgH//MOCAAfyggBRkwIAEoGCABB6QgAPCgIADkqCAA2CwgAMqkIAC2ICAE +uxggA/YcIAEcmCAEFzQgAccsIABhfAAAAAAgALOkIAWDDCAApyAgAXK4IAACmCAAmiQAAAAAAAAA +AB//87AgALNkIAP4zAAAAAAAAAAAIANWRCAAJtQgAB0MIAAlwAAAAAAgADFwIAAuyCAAK8gAAAAA +IAA2OCABIFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgADPIIAS3AAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAA1eCADXdAgADSAAAAAAAAAAAAAAAAAAAAAAAAA +AAQAAAAEAAAACAsAAAAgAxFQCAAAACADEVwIAAAAIAMRaAoAAAAgAxF0DAAAACADEYASAAAAIAMR +kA0AAAAgAxGkDgAAACADEbQTAAAAIAMRxAoAAAAgAxHYDgAAACADEeQYAAAAIAMR9A0AAAAgAxIQ +DgAAACADEiAQAAAAIAMSMBIAAAAgAxJEDgAAACADElgQAAAAIAMSaBEAAAAgAxJ8CgAAACADEpAL +AAAAIAMSnA0AAAAgAxKoFAAAACADErgKAAAAIAMS0A8AAAAgAxLcBgAAACADEuwGAAAAIAMS9AYA +AAAgAxL8BgAAACADEwQGAAAAIAMTDAkAAAAgAxMUBgAAACADEyAEAAAAIAMTKAYAAAAgAxMwCwAA +ACADEzgLAAAAIAMTRAQAAAAgAxMoBAAAACADE1AJAAAAIAMTWAkAAAAgAxNkAAAAAAAAAAANAAAA +IAMTcAoAAAAgAxOABgAAACADE4wCAAAAIAMTlAMAAAAgAw2MAQAAACADE5gAAAAAAAAAANdqpHjo +x7dWJCBw28G9zu71fA+vR4fGKqgwRhP9RpUBaYCY2ItE96///1uxiVzXvmuQESL9mHGTpnlDjkm0 +CCH2HiViwECzQCZeWlHptseq1i8QXQJEFFPYoeaB59P7yCHhzebDNwfW9NUNh0VaFO2p4+kF/O+j ++GdvAtmNKkyK//o5Qodx9oFtnWEi/eU4DKS+6kRL3s+p9rtLYL6/vHAom37G6qEn+tTvMIUEiB0F +2dTQOebbmeUfonz4xKxWZfQpIkRDKv+Xq5Qjp/yToDllW1nDjwzMkv/v9H2FhF3Rb6h+T/4s5uCj +AUMUTggRofdTfoK9OvI1KtfSu+uG05EHDBEWBwwRFgcMERYHDBEWBQkOFAUJDhQFCQ4UBQkOFAQL +EBcECxAXBAsQFwQLEBcGCg8VBgoPFQYKDxUGCg8VH//AAAAEACAgBpYQIAaZwB/83gAf/53UIAaW +QB//nuQf/6IwA4AAAIEAAAAf/6IgAP/4AAEAAAAAEAAAgQQBAIEEAAABBAAAAQQBAIAAAAAABf// +H/+FYAYAAAAqAAAAH//P+CAEMngCAAAAgBAAAEFAAABBQAEAgwAAAf//v/+/////H/+XcAQAAAgg +AwuggYAAAAwAAAAf/5Jg//8AAP//AP8AAQAAAAD//x//raAf/5q0D////x//n+gf/OIAH/+kHB// +oOQf/6OQH/+kFB/84ODg//4A4QGSAB//l+QA////H/+fnB//m/QEQQAIBAEACKUAAADAAAAAwAQA +ADAAAAAf/6AgAAAPoAAA/4AgBpBgIAtUYOEALgAf/6AUH/+b/B//oPAf/5xgH/+gQOAAAKDhADC4 +AACAAOEAYBAAAEAA4QIQAOECMADhAlAA4QJwAOEAEAgf/OFA4QB7cB//sNwf/7DUH/zgCB//sNgf +/7D0H/+w7B//sPAf/7EMH/+xBB//sQgf/53UH/+toCAGlkAf/N4AH/+e5AEAAAAf/6BgH/+fbB// +nAQf/6DsAAD/gAAAEIAf/5JgH/+g+B//oPQf/6FYBAAACAUAAACD/wAAgQAAAAAQAAAqAAAAIAAH +7CADCsgf/4lwH/+FYB//ojBnRSMB782riZi63P4QMlR2H/+AAAAAPyggAw2Mz////yALBhAQAAAA +P////wIAAABAAAAA//9//yALBzAf/6IgIAAhsCALB9AIAAAAAP///yALCEAgCwdg9////yALCjAg +AB5Y//7//yALFCAAIAAAAABAAAwAAAAAAP//AACAAA0AAAAgACRg//v//w/2gAAAA///AAAn/yAL +GFAgCxiAAAEAAAAEAAAfgAA/H/+feCAAMXAgADOEIAAuyCALGRAgCxmwIAAryCALGgAgCxqQBAEA +COAAAAAf/5+EUwAAAFIAAABRAAAAIAHRpB//nFggCx0wIAsdkCALHWAgCyAQH/+fnCALIGAf/5v8 +H/+fUCALIgAUAAAAgAAAAIAAAAJ4AAAAgAAABoAAsAAAAAoAAOMwkv//8ACAALEA4QGaAAACAAAg +CyHAH/+ZmAAAfkAf/5+IAP/AAB//n4wf/5LkKAAAACYAAAAgCyIwH/+TIAYAAAAFgAAAIAtoEB// +m8ArAAAAIABJCB//nVA1AAAAA4AAAAMAAAAH////AD///4BAAAAID///H////yAAAAAAAMAAPQAA +AB//mBAHAAAAgQQBAIEEAAAf/52wAAA6mMMAAAAAAA//AEMAAAAACAAEAAAAIAtocB//sFAf/63A +H/+XcAAGAADhAHoAH/+X4B//n3AgoAAAH/+cCB//newf/534IAtooAADB4AgC2kQH/+Z4ABAAAAA +AAkAAAAwAv/8+H/AAAAAo/+7AKP/ugDgAwAAg/+2AA////8P//gA/wAAACALaVAgCyQwIAskYCAL +aeAADwAAAAoAAP//AA8f/590A//AAIP/wAAgC2pgIAtq0B//oAQf/OIAH/+kHB//rjD/YPAAH/+u +EB//pCAf/5IgBIAACB//gFAARAAA/x///wDAAAAAAIEA8AAAAIGAAAD/f///H/zgdB//mrT/v/// +//8AAACAAAAAAIbdH/+TEB/84gzuAAAADwAAAB//n5Qf/6QYAAAPSB/84ggf/5gMH/+AYCAGkkAA +ADAAAAAnEB//3IAgC3LwH/+g5B//oEQAAP/+H/+b8N6tvu8gAwYQNAAAAD8AAAAAAIkGAJkAAB// +rXgQAAcCAcCAAB//rEiZAAAAH/+uNACIAAiCgAABH/+tyB//rNQDFQAAAxEAAAAPA/8gCyjQIAsp +MCALKYAgCyngIAspACAA30QgCyuAIAsrsCALLAAgCyxgIADk8CkAAAAgAOtsIAtzQCALc6AgC3QQ +8PDw8P8A/wCqqqqqzMzMzB//sEAAAB3gH/+uSCAA/EggC3SgIAt1EAAPQkAgBB3QH/+fzB//oDAA +CQAAAABIAIIAAAAgASBYIAt1kCALdgAACQAIH/+tPDAAAAAf/62IAAAIBgAAiMwAAIkUfwAAACAL +enAgC3sAAADgACALeLAgC3rQH/+ZnAAEA/8KAAAAH/+sZB//n0Af/5tgg/+3AIP/tiAgCzSw4QAA +ADMAAAAf/6xUH/+uhAP/4AAAP/aQAAAdKB//rZAD//AAIAtlYCALZSAgC2WAH/+vkCALNPAaAAAA +H/+b+CALNUAgAWAwH/+tjB//ncQAD///AADerR//rUAgC3uQH/+cICADB2Af/5wQH/+eBCAAZeAf +/5zsIAAFzB//mSwf/5esIAt8oB//nGwf/6L0H/+jgCALfPDABAAAH/+eECADDFAgAGbA4AEAACAL +fjAgCzhAIACkrCAAojAgC32wIAt+ACAGkGAf/5m8IAs5sOD//gAgC1iAH/+kLCALQfAf/5RIIAtM +wCALTVAgC1AAIAtQMEgAAAAgAaMgH/+dYCABpSQf/5hgH/+a9B//neQf/5tMAAAK4AAACOwf/54c +IAaWNB//m9Qf/5fk4QAuAB//nijhAF4A4QIOAP//v//hAA4A4QGOAP//vv8f/5v0IAGqQCABtmjg +BQAAA/8AAB//m5QgAwugPAAAAAAF//+DAAAAH/+a/CABy+wf/6BUIAtXoAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAgYAAAAAAAAD/////////////////////H//70B//+9Af//uYH//7mB//+5gf//uY +H//1KB//+FAf//asH//2rB//9qwgBmmoAAAAAAAAAAAAAAAAAAAAACAGbSggBm0oAAAAAAAAAAAA +AAAAAAAAACAGaaggBmmoH//5RB//+UQf//lEH//5RB//+UQf//lEAAAAACABq1gAAAAAAAAAAAAA +AAAAAAAAAgEAAAAAAAAAAAAAAAAAAAQAAAAAAAAAgYAAAAAAABAFAAAAAAAABAAAAAAAAAAAAAAA +AAAAAACBAAAAAAAAGAUAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAACAKABHyixPyi9MPA+YxAQIAFvKJF/KKd2sGkGC0Zndj+FQPBVWz +4A8UAGP/+QAAAGwQCCggBScgBykxBfgghhXgGUUA+QAOhWF3AQCKIhbyfP3k+gXgDJUA8Ve8DeAP +pQDq8ngbxwKAAKaIK4KeCnkKKZK//WANg6IAnQAogp0JiAHoFgUkDVGAACjSCPcADaiSAJ0AK2Ku +7PJtFYq5gAAqYq0swn/sqwEEc/0AAP1ACh4iAJ0ALtYI/UAKHiIAnQAvIBSk/w8PRy8kFPXgDF3S +AJ0AGfJfLiIWLCEpiBUf8l2uzJ+A6iIeLmfCgAD9AGYVoA0lAP0ARhXgC2UA7fJWHVYCgAALqgKL +FJqB6QAVBEBBAACJFQgAiig8EP0gxhXgTAUA/SDmFaAMRQDsuzYEyIEAAG25BQgAhgkCYe7yRxWg +h4AAiBXuAAUNzwKAAKmI6IwgJaQ1AAALyQxtmQIIAmEtISnTD+ohKCboBQAADQ1PLSUp/UAHdGIA +nQD/5HAF4AwVAPogqBXgHuUA6iIeLs1CgAD4ICYV4AgFAPggBhWgDQUA6BYCJdmBAABYfoL+4AAX +N8UBAPfAAEcwDZUA7eadKAQKgAD5gAVZUgCdAMAg0Q8AAADqJAAJ2ASAAOxEAAroBIAAWIBp0qDR +DwAAAADAsA+JNOnWCC32LgAA+kBoHaAbxQD8AAIdoA0VAFiDnmP/wQAA6iQACtgEgABYgerSoNEP +AP/5WA2gCAUA6iQAA9hhAAD8AAIdoA2VAFiDkmP/kcCgWa5sHfH/iNj5H/IIkA+lAGP/pNogWAti +Y/5wAAAAAAD8AAId4AoFAPpFJB2v/CoAiifrRAAKaASAAPtEABWgDAUAWHn90qDRDwAAAGwQBi4i +EJQR5SEaKtAEgAAmIAf2QSgV4B/FAOoWACrHwoAA/wJSDeFmAQAHCULxIHAN4oUBAGSB8tTwKSAF +/EBIFaAbhQD+ngANsBpFAPsgD5UiAJ0A5/HWHgvWAADl8dMbTwKAAPTADBISAJ0ApZktkp4Hagoq +or/3oBG7UgCdACmSnQqZAe6UAASOSYAAjCmLKgwHPgy7DPdgCQPiAJ0AKiBOLSBMsaj7oA3sIAsV +ACgkTiowASkiGPNADfaSAJ0AKyAHLSEk+GAkFaAMVQD9QAQFMLsRAOCqEQ3agoAAC6oCG/G7CogC +KiEHLCEJC90C+wYADHqqAQDr8bYdUwKAAArMAiohIpjgiCCc453kC6oCmuL9AAAUMAplAAqIApjh +LSIQneUsIDgb8av4ACIdoE0VAPnBJhWgzBkADNg5HfGnlOgMvTn5pgAOsAsFAJvnGPGanebt8ZsU +4AUAACwmGJvrmeroABUHSMEAAAkAiu3mDiHIQQAA7+YPJ3kBAAAJIIYPAmMJAIYPAmEMbhGl7urm +nSOAsYAAiCkvIDiniCgmCfPgCBeSAJ0AiRAJCUf5IAcBUgCdAMAg0Q+eEuokAAvYBIAAWILMjhL/ +TRAN4B/FAOwSASlQBIAA7RIAKdgEgABYf8XSoNEPAB7xcoro90AGOJIAnQAMaRGlmSuSnvdgBotS +AJ0AKZKdB2sKK7K/C5kBZJC/sKyc6O6UAAzzfgAAYAAsAAAAAADz3/BIUgCdAAlUDPSdABWv+AIA +AAAAAADrEgApUASAAFiBOtKg0Q8A6iQAA1hhAAD8ACIdoA1lAFiC5GP/aY0iwOQO3QL8QEYV7/1+ +AAAAAPhDqBWk2QEAANEEALwaDIgC+EOmFa/4xgCKJ40RwMDqrCAu2ASAAFh5UtKg0Q/aIFh/W2P+ ++QAA//c8DaAJBQDAoFmtqh7xPIro+V/5eJAfxQD//SgNoAkFAMCQwLoLqzT7wQYV7/zuAAAAAGwQ +DpUcKCIQLiIJJyE1KSAHIxYOKjIC/mCIFeANFQD8YGgdp7UBAOMhGiXb+QAAC9s5+iGmFeGZAQDn +/zYJt8KAAP7CUg3jqgEADg5C8cBwDeLTAQBk1GMmIAXB6Pn+AA8wF0UA9sAkHWIAnQCHIose9OX8 +DeAOhQArsAGfEfNgIScSAJ0AmRCZGpoUGPEO7fEOEjANAADmFgssrwKAAOhVCAzfgoAArbvrFgki +cAUAAIkanhiNG/UgBqoSAJ0AK1Kehhn9YAoj4gCdAC9SnSZivwb/AWT0ORnw/YmY9yAJmJIAnQAq +gq5koVIa8Pkjgq0qon8d8PYKOwHrFgUk2/0AAPpgCeYiAJ0Am9j6YB9mIgCdAIcphioMAz4HZgzy +wAmr4gCdACkaAPMiMg3g+vUAKyAWnBP7YAn9IgCdAIsRhsMqIDj34OYVoAYFAPfhJhWgRwUA++EG +FeCqGQAKdjkX8OeWFi0iFxbw5J36LSIbnfuJxAp2OZYX+WARSuIAnQCGHZ4f7BYDIw3ZgABgAQgZ +8M+JmGqRLosbKlKejxl7o0stUp0v8r8P3QGdFYYV6/DHFNP9AADvZAADAemAAJq4Zf8TYANKnh/8 +IGYVoAoFAFmtKxnwvomYGPC6jBPuEg8kjtsAAP//XA2gDwUAwKD6IKYVr/7mAB3wtcC6C5s0+6EG +Fe/+9gAAAAAA//sUDaAPBQCeHy8WEPwgZhWgCgUAWa0XGfCqjBMvEhCJmI4fGPCl+T/1cJIAnQBg +Ar3AoJoVixUW8KLA2g2dNO1mCC32JgAAYAKknh8vFhCcE+okAAnYBIAAWIHqjBMvEhDuEg8ldaGA +AGACWp4fLxYQ+kDwFaAMBQBYgcCMEy8SEO4SDy11ZgAAYAPHjheLE4gUjBH2IMgVr4oFACokOwyZ +DAhmApm0rNgG7gItIhDoJhspUASAAFiAZI4fjBMY8H76s6YVoQkFAHObDSsgFioK//tgBE0iAJ0A +iikrIDgPAgCjquomCSgECoAA82AEP5IAnQAmITUvwgQrIRopIhDm/zYN78KAAH/bCwoKQmSgBQsN +QmTQc/4gJhXgHYUA+f4ADvAKFQD6IaYVoAY1APYhhhWv9cYAiicvFhCLHuqsICpgBIAAWH0OLxIQ +mhMtIhv5QIgV7/zeAAAAAAAAAOogByngBIAAWIFvGPBTjBP+IegVr/2eANogWH5rGPBOjBOOH/pB +KBWv/bYAcZ6ICr8M//0AFe/+CgCLFIoWLSIQGfBUC6oCG/BUCmgChh0a8EsJiALp8EobCz4AACMW +ESUWEiYgB4XAIyEH9kEkFeBmEQDrVQELMoKAAPamAAq6MwEA5iEiKZsCgAADdwIKVQIjISQJZgKV +8IUgl/OW8v3gphXjmAEA6PYGLMoCgAAJOQLjEhEiU/kAAOn2BCquAoAA5eUCBkCBAADl9gEnyMEA +AOUSEiIUNQAAbakFCACGCQJhJiAUpGYGBkcmJBT0wAg10gCdAIgY+LOmFaEHBQDy4fIN4Pn1ACsg +FvlgCM1iAJ0AKiIXsarqJhchgKmAAIwpKyA4o8ycKfNgB5+SAJ0AjR1l0M/AINEPLyBOZPvZDngC ++EBGFaAAhgAAAAAAAPMf3MBSAJ0ADj8M//0AFe/uNgAAAAAAAOsSDilQBIAA7RIMKmAEgABYfkvS +oNEPAOsSDClQBIAAWH/W0qDRDwD6QGgdoBvFAPwAIh2gDRUAWIGAY//BixD6QGgdoAwVAO0SCyXY +YQAAWIF6Y/+pAAAmIDtkYHHqJAAOWASAAPwgKBWviQUA6SQ7LHAEgABYf8P6IQYVoAsFACsmG/pH +Zh3v+84AAAAAAOsSBSlQBIAAWAk/Y/7viifrRAAKaASAAPtEABWgDAUAWHff0qDRDwDaIFh96WP/ +COogByngBIAAWIDlY/7cAAAnIQklFhIjFhEkFhMmIAeEwCMhJPRA5BXgZhEA60QBCzKCgAAGRAIK +RAL2REQVqrUBAOsiBy3TAoAACncCCWYCKrEVmhKU8IUgl/OW8v3gphXjSAEA6PYGKiICgAAEMwLj +9gQl2IEAAPQiaBWvwwUAA7sBIxIR66kICq4CgAAF5QLl9gEmYIEAAOUSEiTJAQAA6ctDfkAEgAAt +TP4M1hGmhuaTO3fgwQAA9J/v8RIAnQBt2QUIAIYMAmFj/e2LEPpAaB2gDBUA+2JAFeANBQBYgSdj +/loAAAD7jwAMP/72AAidDA1JFG2ZBQgghgwCY+/aCAXBAQAA6UwMBUjBAAD1n+1BEgCdACvM/m25 +BQhAhgkCZWP9lAAAbBAGKCAFHO+C997+BeAaRQD7AAqdIgCdACsgTonIsLsrJE73IAjIkgCdAC5y +ru3veRcRcYAAK3KtLdJ/DbsB5rQABZEpgACwnu7GCCWIOYAALyAUs/8PD0cvJBT14BDF0gCdAC4g +c/hDqBXv+vUA+8AEANALFQDguBoHaAUAAPsXAA003QEALSRzCYgBCLg5CpkB6SYdLAcOAACKInyn +BCggTsmPfacIKyBMKSBOe5MUzGwsIBTtIgIuWBwAAGTRycAg0Q8AjifH8w+vAe8mAidQwQAAWG6V +4+9dFQE5gAAooADTD9MPA4gKKIIQ7KAHLVgEgAD6QGgdoA1FAAuAAGWv3Ikn0w9kn6YqmRTKp4qZ +ZK+cKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA01AAuAAGWv4GP/egAA//9UDaAKBQDAoFmroBzvMonI ++T/26JIAnQDAYCkgFLOZ+EKGHe/8HgAAAAAAAAAA6iQACtgEgABYfwjSoNEPACogBSsgB8HU/UAO +ZWG7AQAFBUf4oA55UgCdAJMQjTadEu3vHB2YBIAA9WAJihIAnQAMuhGnqi6invfADZzSAJ0AKqKd +DbwKLMK/DKoBZKE9+kAIFeAMFQBYILcd7xEpIQkY7xErISIvIAce7xssIST5ZgANsP8RAOgSAi/6 +goAAD8wCDswCLKYAjiCbovlAphWgDyUA6aYDL3YCgAAP7gL/QCYVoAkFAO0AFQVQYQAAsZnqgx4M +j+gAAAw5EfcgAETwCKUAKJad9L/yuRIAnQCKJ+tEAApoBIAA+0QAFaAMBQBYdvtj/jr/92wNoAsF +AMC6C5s068YIK28GAABj/tvqJAALWASAAFgIS/3dxgWv93YAiifAsPtEABWgDBUAWH+KGe7umaD+ +QAgVoBvFAPnd2AWgDBUA+UBGFaANFQD9wAAXMAgVAOjuAg14BIAA7vYBKVAEgABYgGHAINEPicj3 +IASgkgCdAAw6EaeqLqKe98AFVNIAnQAqop0NPgou4r8OqgFkoJiwn5/IZa7BiCLrFgEkBOGAAPi/ +7DlSAJ0AiicrCgD7RAAVoAwVAFh7aosQHu7KnqCMIB3uyp2i/YAAFjANFQANzAKcoYu2+0BmFe/1 +SgAAAADrVAAJUASAAFh+jmP9PI8z/iBGFe/41gD/+WQNoAoFAPogJhXgCgUAWasSHO6liciLER3u +ovk/+riSAJ0A//3IDaAKBQAAwKDAigiYNPmBBhWv/YoAAAAA6iQABdhhAAD8ACIdoA2lAFiAJmP/ +UQAAbBAEKCAU74seahgEgACKJ/pgaB3gDAUA6qwgKegEgABYdpnSoNEPAIsic75LFO6IikhqoUcb +7oQssq7Kxx3uhSyyrS3Sfw3LAX3AG7Cunkh9wCEvIBTvJBQv2tAAANogWAfjY/+nwLDAigioNOhG +CC3/FgAAiSLJlcAg0Q/AoFmq4YpIa6GtY//qAAAAAAAA+kBoHaAbxQD8ACIdoA0VAFh//MAg0Q8A +bBAILCIPLyAHKCE0JzIH/kNEFafVAQD5v8AV4AsVAOm5OQmwBIAA6yIJKlAEgAD4IIYV4AQVAOh3 +Ng9PwoAA9yJSDeH/AQALCULxIHAN4o4BAGSCcsG07HsfDpR0AAAsIE/pIE0mYAUAAAwMRywkT/0g +FKOiAJ0ALCAF+4AS/WIAnQCNIvogBhWv+zUA/WAOWOIAnQAoIhmOMvnAFNUiAJ0AiTgY7kMc7j/k +kmJv34KAAJoQmBGsu+juOhVIDQAAmRPrFgIvpwKAAKhE9eANIhIAnQCLEypCnvtAGxviAJ0AihIp +Qp3TDyqivwqZAe6UAASScYAAjCmLKgwFPtMPDLsM9WAJ2+IAnQAtGgD1ofIN4Pj1ACsgFvlgGXUi +AJ0ALCEiGe41KCEHKiEkKyEJ/EDwFeqIAQDpqgIMQwKAAAi7AhnuLhjuHw0tQOnMAg7qgoAACN0C +neCJIJzimuT7wGYV4ApVAOvuJhzOAoAACpkCmeGIL5jlLCA498EGFeANBQD9wOYV4AolAP3cPAXg +SSUA+MCIFaDMGQAMmjmY6QzbOY1lneod7hj8wMgVoAkFAOzmCyOH4YAACpwQDcwCnOyMEYlol++Z +7ohpKOYQjWot5hHsABUHSSEAAAkAiohn+OALo6IAnQAf7f0KvQIP3QKd5sDF/JOmFaEJBQD1IfIN +4Pj1ACsgFvlgE6UiAJ0ALCIZiikrIE8pIDjlqggGYAUAAOwmGSXb/QAAKyRPminzIA+PkgCdAIsU +ZbHvwCDRD58VnxaeF+okAArYBIAAWH8njhfvEgUldZGAAIwUZc/biifbMOwSACVQwQAAWHpEwCDR +DxrtzYqo90AQiJIAnQCMEytCnv1gEUOiAJ0AixIpQp0rsr8d7cQLmQHkkhRlY/0AAJzY7pQADPJm +AABgAI4oIDnxH/gOEgCdAP/75A2gCRUAAAAAAPOf7EhSAJ0ACecM9v2AFe/1+gAAAADBs3vJFCkg +OpoQ/iDGFeAM9QD9IBD9IgCdAOokAArYBIAAWH2K0qDRDwDwABgNoBrVAMChjDcrIQmNOI4y668R +Dd0CgAAPuwLkuwIJUASAAFh9bsAg0Q8AAAD//1gNoBqFAOokAAfYYQAA/CBoFeAMFQBYfyZj/wUA +AAq4ApjmwNX8k6YV4QwFAHXLDSsgFikK//lgDjViAJ0AihRkoV2LaoxnimmrewfMDJxn92DSDeAO +BQCxqoxlm2qLZppprOqre3e7AbGqjimbZpplLSA4pe6eKfOgCjeSAJ0AiScomRTKgouZyb4Z7Yco +sACfFZ8WCYgKKIIQLLAH+kBoHaANNQALgACPFYsix6P7X/KA4gCdACghNIdnLiEaii+LKeh3Ng9n +woAAd8sKCwlCyJQOC0JksLTB1Pr+AA6wDBUA/CCGFa/yrgDaIFh7emP+Coon6qwwK1gEgABYZwXS +oNEPAAD/8qgNoAkFAAAAnxWfFp4X+kDwFaAMBQBYfoKOF+8SBS1l/gAA6iQAB9hJAAD8ACIdoA0F +AFh+3WP94AAAAAAA6iAHKuAEgABYfmFj/YGfFf4gxhXgCgUAWamwGu1DiqiPFflf7tiSAJ0A//fg +DaAJBQDAkBztPcC6C6s0+4EGFe/3mgAAAAAA81/6OFIAnQAJ5wz2/YAV7/zyAIonnxXvFgYp2ASA +AOwSACVQwQAAWHmk1qD+IKgV7/oWAJ8V7xYGKVAEgABYe0L+IKgV7/q2AAAAwVP6QGgdoAsFAPwA +Ah2gDTUAWHPXKyAFjxaKEPV/2oViAJ0AY/0hnxWfFuogByrgBIAAWH4y/iCoFe/4rgAAAABsEA6T +HJUaiC+KKS4hGichNC8yBPhA8BXntQEA+3/AFeANFQAL2znrFgsp4ASAAPfhAA/xmQEA5yAFLzfC +gAD+wfIN4qoBAPFAcA3ibgEAZGRBwaQI+o364CNNIgCdAI4iixz1xFwN4AqFACuwAZ8S82AgVxIA +nQCZEZkYGOz06+z0EmgNAADtFgksrwKAAOhVCAzXgoAAq6rqFgcicAUAAIYYnhaLGfTABeoSAJ0A +KlKehhf7QAlj4gCdAC9SnSZivwb/AWT0IRns44mY9yAI4JIAnQAqgq5koTka7N8jgq0qon8d7NwK +OwHrFgMk2/0AAPpgCR4iAJ0Am9j6YB6mIgCdAIcphioMAz4HZgzywAjj4gCdACkaAPMiMg3g+vUA +KyAWnBD7YAklIgCdABvs4CkgOPvZvAWgBgUA9+DmFaBHBQD9gIgV4JkZAAl2OQm6OYsSmhSWFf1g +EdLiAJ0AhhtkYdNgAQMZ7LuJmGqRLosZKlKejxd7o0stUp0v8r8P3QGdE4YT6+yzFNP9AADvZAAD +AemAAJq4Zf8rYANKnh38IAYVoAoFAFmpFxnsqomYjBAY7KbuEg0kjtsAAP//XA2gDwUAwKD6IGYV +r/7mAB3socC6C5s0+6EGFe/+9gAAAAAA//t0DaAPBQAAnh2fHvwgBhWgCgUAWakDGeyWjBCPHomY +jh0Y7JH5P/Y4kgCdAGACvsCgmhOLExbsjsDaDZ007WYILfbuAABgAqWeHZ8enBDqJAAJ2ASAAFh9 +1owQjx7uEg0ldnmAAGACXZ4dnx76QPAVoAwFAFh9rYwQjx7uEg0tdk4AAGADxJwQ/iGmFa+JBQDp +JDsmOEEAAAcAhucSAiewgQAABgJhjceX+IrEicatfQeqDJrEd9sJnh3sFgAkyAUAAIwSixCGFY4U +mbadtwbuAu0iDylQBIAAWHxIjh0Y7GKMEPqzphWhBwUAc3sIKyAWKQr/ebl+iikrIDijquomCSgE +CoAA82AEJ5IAnQAmITSPxCshGokv5v82De/CgAB/2woKCkLIpAsNQmTQc/4gRhXgHUUA+f4ADvAK +FQD6IWYVoAY1APYhRhWv9cYAAAAAAACeHYonnx6LHOqsICpgBIAAWHjy7xIOLWAEgAD+IagVr/xS +AOogByngBIAAWH1VjBAY7Dj+IagVr/22ANogWHpRjBAY7DSOHfpBKBWv/cIAcZ6ICr8M//2AFe/+ +CgAX7DYb7DYd7DsGqQKGGxrsOu2ZAgZAQQAA5WFUZ+iBAAAlFhCTHyUgB4PABSVA6jMBCqqCgAAF +MwIHMwInIQcqISImIQn0QegV6ncBAOuqAgu7AoAAB2YCJyEkk/CDIJbzmfaa8vXgphXjqQEA5RIQ +LVICgAAKdwLn9gQpngKAAAPjAuP2ASJT/QAA4xIPIgw1AABtqQUIAIYNAmEmIBSkZgYGRyYkFPTA +CB3SAJ0AiBb4s6YVoQcFAPLh8g3g+fUAKyAW+WAItWIAnQDIP4spKiA4o7ubKfNAB9+SAJ0AjBtl +wNfAINEPLSBOZNvzCugC+EBGFaAAhgAAAAAAAPMf3dBSAJ0ACu8M//2AFe/uvgAAAAAAAOsSDClQ +BIAA7RIKKmAEgABYejfSoNEPAOsSCilQBIAAWHvC0qDRDwD6QGgdoBvFAPwAIh2gDRUAWH1sY//B +ixH6QGgdoAwVAO0SCSXYYQAAWH1mY/+pAAAAAAAmIDtkYHcr+oArJDvsEgIuWASAAAgghg0CY+z2 +CCzwBIAA7SIPKVAEgABYe6v6IMYVoAwFAPxHZh2v+8oA6xIDKVAEgABYBSlj/vKKJ+tEAApoBIAA ++0QAFaAMBQBYc8nSoNEPANogWHnTY/8A6iAHKeAEgABYfM9j/t8AAAAnIQckFhEmIAeEwJMf8kRE +FeBmEQDqRAELMoKAAAZEAhbrsiwhJIonBkQCJiEJ+mYACfp3AQDroRUruwKAAAdmAocvlPCEIJf1 +k/L34GYVozkBAOn2BimaAoAAA8wC4xIPKiYCgAAE5ALs9gQlUIEAAPXgJhWvzAUADKoBqrzkEhEm +YQEAAOyLPXxIBIAAsEgMhhGmlnbDNvSf8IiSAJ0AbYkFCUCGDQJlY/4AixH6QGgdoAwVAPtiQBXg +DQUAWH0VY/5iAAAA+w8ADP//DgAJzAwMSBRtiQUJYIYNAmfvzQgFSQEAAOhMDAbAgQAA9Z/t2JIA +nQCwzm3pBQmAhggCaWP9qAAAAGwQBiggBSMgByQKA/0PQERRMwEAKCAiZIBvAioCWHGQ/UzAgNAN +FQAsICEY62UPAgDsMxEGfVaAAKgzKTKeDwIAbpNFKzKdZLA/+kAIFaD+5QAOzgH9xgAO8A8FAPxE +Jh3gCQUA+CAGFeAMBQD4ICYV4A6VAPggRhXgDQUAWHeu9HOmFaACBQDRD8Ag0Q8AAGwQCiogBfhA +8BXgDBUA+GBoHae1AQDoFgAl2/kAAOvLOQoYBIAA6xYFLCAEgAD9QcAEUZkBAMHD/UAf5SIAnQCN +Iu/rPB6b3gAA6+s5EbARAADmFgQs94KAAK/u7hYDLNcCgACrquoWByzABIAAhxf1AAQiEgCdAIoU +J3KehhOPF/rgB1uiAJ0AJmK/L/KdBv8B7xYGJ5nRgAAlIRuKQocphioFpTb1TwAOcQsFAHyzAdWg +mBoHZgz0wAXj4gCdACoaAPVCMg3g/PUAKyAWmBr9YAX9IgCdAIpC+qAOeqIAnQCMFRvrLodDmBrr +dwEGCPmAAGAAtgAAGusQiqjoFgolDN+AAIsXjBSGEyuyno8XJmK/fLNDL/KdHOsHBv8B5PA5ZVv9 +AACbyO8WBi/7bgAAYAKbAAAAAPghZhXgCgUAWadqGur9iqiJG+gSCiUO3wAA//9MDaAPBQDA8Bzq +98C6C6s0+4EGFe//BgAAAAAA//x4DaAPBQCZG+okAArYBIAAWHw+iRvoEgoleamAAGACLgCZG/pA +8BWgDAUAWHwViRvoEgoteZYAAGADEvDgBIhSAJ0ALSEajCmXGPghRhWi7QEA6RYLLwQWAACXGPgh +RhWi7AEA6RYLJwOBgACYGukWCy7/woAAdfteDtUM+dXYBaC36QDmQgMt3IKAAAt5ApkYCGYB9oBm +FaABAgCKJ5kbKxIA6qwgKeAEgABYd3aJG/ghSBWgCyUA66QCLSAEgADqogIoBAqAAPL/+7hSAJ0A +jCmXGJgamRuOGI8W5a0MClgEgADlzAgJUASAAO1GAiroBIAA7CYJKeAEgABYd5GIGokbjxf786YV +oQ4FAHXrCCsgFiYK/3a5DMCh+iCmFa/3dgAAAADqIAcq4ASAAFh7v4kb+CFIFa//igCPKRjqvYkW +pf+fKYxDi0CNFefEAATIgQAA/A4ABTfrAQDuFgEuiKYAACcgBwcHQQh3Cidyn+6tEA1TwoAA7aoC +AkBBAADqdwEB0/0AAOfHAgGMPQAAbakFCACGCQJhi0DAgJgSGeqoGuqnLyEahhYe6qQkIQcY6qH8 +ICgVodcxAP+gAEa6RAEA7dCAKicCgADszA8mcEEAAPiGAAo0zB0A5GYAJmAFAAAMPAwU6nwNXQyI +IJ9ml2eeY51lDKQ5CYkC6WYELEYCgADkZgIh0AUAAAioAphhJiAU42YIDSAEgADmJBQoBAqAAPNg +BAqSAJ0AiBf1E6YVoQcFAPTh8g3g+fUAKyAW+WAFDWIAnQCIEtKA0Q+KFWSgosAg0Q8AAAAAAADq +JAAE2GEAAPwgiBXgDBUAWHvmY//aiif8ISYVp9tBAOqsICgECoAA9aAEYdIAnQCMFisKAezMICno +BIAAWHJYmhL6gAgV7/vuAACLFuxNEQlQBIAA/WAARfAMFQBYcDr0gGAVr/2qAGW8BPlf4AjSAJ0A +LyAg8f/ft5IAnQBj/3QAAAAAAAAA6iAHKuAEgABYe0+IEtKA0Q+KJ9ww6xIAJVCBAABYduDAsvtA +Rh3gAgUA0Q8AAAAA6zQADjgEgAD8YGgd4AwFAFhyNdtA7DQACugEgADqFgIr8ASAAO8SBilQBIAA +WHb/+oAIFe/7HgDqJAAE2EkAAPwAIh2gDQUAWHuqY/7qAABsEAiSFJMVGeoliED4IEYVr8sFAOsq +AQJwIQAA+iBmFaeIQQDkgcBiUBEAAI8TLSEFqYwswACv3wTMC+/8QC5YBIAA/4ANiuIAnQD6ICYV +oGgBAP4AIh3gDQUABv04C98L690KB9ghAACCFZ4Q+QAARXAMJQDyQQAV4A8FAPJAgBWgAg4AjRQO +VQz/4CAVoAMFAO/kAARABQAA8Q5gDeB+AQCGEyKgAC3RBQQiC+bWCAlYBIAA4hYGIzEBAAD2QAZ6 +ogCdAAgGQPIAIh2gDQUABi04C9IL690KAVghAAD3IBAVoAIVAAcjOIcVB2YLF+n8pzcncKAGMgoG +MwvsfAgBmCEAAI7QCwCJBe42LiYAAwCLItIA6qwBJMgFAAD0X/sj4gCdAAUpDA4qDPugBhWgBxUA +9WAoFeAGBQAJdjgIaAgisgAF5QgltgF+WwIiLAHitgAmfRKAABbp44sSHuni5rYBB5AFAAAGIgKG +Fe67AQxuAoAADbsCkmD6gAYV4SwdANEPixD8ICgV7/1SAAAA/E8ADf/8xgCFFRnpswXFC/gAChXg +AgUAsSLlgx4JD+gAAB3pzIYSGunM7W0BB9gFAAANuwKNFepmAQxOAoAACWYC69YAJhAFAAD2gAYV +oSIdANEPAAAAAOoWAS1oBIAA+8BoHe/51gD9jwAN//k+AGwQDPhASBWgCgUA6yAHKcgEgADygGgd +58UBAP2fwBWgBBUA7Ew5DLgEgAD8ISYVobsBAPMbXA3gDAUAmhacFZkTmxSbGy4gFhXphB3phB/p +p+8WCC3HgoAA7YgIDacCgAClRB3poygWCvnS+gWg//UAf+ETAioCWCvgGOl5Hemc6hYIJSn5gABg +ABcAAGZjy/jAHyiQ+vUAKSAW+yAZTSIAnQCJiPcgBhCSAJ0AK1KuHOltZLDRLMJ/K1KtDLsBZLDH +sJmZiBzpi2SzSyzAgCzMN/4haBWkzB0ArDzrFgImYB0AAPXABYISAJ0ALkKe/cAIK6IAnQCMGitC +nSzCvwy7AesWACWZUYAAKnEMiXeZEf1ADpxiAJ0ALHAQ63IDJglBgAD5n/so0gCdAC5yA2Tg0I8W +ZfGuhhGPGI0U7hIAKVAEgADm/zYL2ASAAO8WASngBIAAWClqGOlCHell568ubTAEgABgAvIAAMCg +WaWpGOk8iYgd6V75P/mIkgCdAP/9CA2gCwUAwLDAqgqZNPkBBhXv/M4AAGqRJCtCnnyzQYwaK0Kd +LMK/DLsB5LA1ZPP9AAD/AQYVr/0qAAAAAAD8IaYVoAoFAFmlkhjpJYmIHelI7BINJI8TAAD//IwN +oAsFAMCwwPoPnzT/AQYV7/xSAAAAAAAAAP/8GA2gCwUAAAAAihjAsZsW+V/5KuIAnQDA4J4W+V/4 +yuIAnQDrdAAJUASAAO0SCSngBIAAWCmm/gAiHeAHFQDnFgktOASAAP9AZhXv+7oAZLBJjxX+ACId +oAwFAA/sOGTAiogRhhjqJAAL2ASAAO0SBCngBIAA6GY2CPAEgADmFgEg+BEAAFgqMujo9x0wBIAA +/dIyBe/3/gAAAACLGA8CAPlhVg3gDAUAeaMCLAoB+AAiHeAOBQAMnjjsFgUnfKGAAOt0AAlQBIAA +7RIJKeAEgABYKtH3QGgd4AsVAPohJhXgChUA+uBmFa/9pgCLEBXo/CohB4lwHOj4/9G+BeqqAQD/ +QAAVOJkBAOyqAgTAPQAA/CEoFaSIHQDqtgAkQAkAAAg4DI4gmbPoXzkBs/0AAO+2Ai92AoAA7m4C +BahBAADutgEuDtYAACgSA+iMICGUVQAA6jz+KsgEgABtqQUIAIYJAmErPP4MuxGrW5sQKCAULCAE +o4j1gAihEgCdAAgJRykkFPUgCjZSAJ0AiHIoJhwpcgHoFgctqASAAPMgCjBSAJ0A8TYYDeAHBQCn +ZiZGnSogFisK/3uhCusSASlQBIAAWC32jBllwOPAINEP6xIBKVAEgABYLfEuIBYY6KL90YoF4P/1 +AP/f5RxiAJ0AY/yHiBllj9IqcBDbcPxgaB2gCRUA+1/gFaANBQDqnTgJUASAAFgoXcAg0Q8AAAD6 +QGgdoBvFAPwAIh2gDRUAWHoeY/+9AAAd6LEt0IDrEgQm6N0AAPpAaB2k3R0A/GAARvAMFQDt3Acl +2GEAAFh6E2P/jy4gFi8K///f+vRiAJ0A6xIBKVAEgABYLcnAINEPixAMbBGsu/ogBhXv+5IAKCQU +jXDxv/i6kgCdAPpAaB2gDAUAWG5o9sBgFa/8EgCKJ+s0AAnoBIAA+0QAFaAMBQBYcHfSoNEPAAAA +AAAAAOsSAilQBIAAWAHL+iAIFe/6vgAAAAAAAOokAAxgBIAAWANOiBcpcgEqFgznpAANXwKAAOtV +CAT1PYAA21DqJAAMYASAAFgDFPdAAEP/+koAiif8oGgdoAslAOqsICnoBIAAWChPK3AQ+X/xUNIA +nQApcBUJCEVkjhwrcQkc6GsqcQwvcBGOJwyqDKv/D4gJ/cKkFa/NBQDu7CAkeIkAAO3uAQRASQAA +Cvg5qH2uzu7sQCbogQAA7tteftAEgAAO6jAb6FstoQH9QAQVofkxAAv/CisiF+/yny5kAoAADN0C +C+4MD+4srt2oXv3AJB3v3YEA/cAEHe/2ggAAixT6QGgdoAwVAPtiQBXgDQUAWHmzY/4QAAAAAAD9 +rwANP/6KAGwQBCMgACQK7XQxBiIhA7wi0Q+EIYYg8kBoFaAIJQD3ZAACsJRxAPkPAAxzNgEA9GAA +QfNmgQDl6DccAQqAAABmGvZgAQG9RAEA5SIBAag5AADlIgwBmGkAAAQkLAQzKKMi0Q9sEAiKIicg +B4kwlRX4QtAVoXcBAPFdTA3omQEA+CAmFeD89QB8gR0FC0f7f8AV4AkVAOubOQlQBIAAWC1a81Mw +DeD89QAa5/OIqBbn8PcADZiSAJ0ALmKuGefwZOHbKZJ/JWKtCVUBZFHRKIz/KKYI6VQAAo2BgAAb +6AwlsIDt5+QSqN0AAPggBhXkVR0A5UUIC88CgADmmQgCqA0AAPTgCJISAJ0AKJKe9QATO+IAnQAl +kp0NeAoogr8IVQFkUYgpIBb9IyYNoOvVACowEPtAElRiAJ0AKzELvLvaIFgtGyggFCwgBKSI9YAM +QReYAQApJBT1IA4uUgCdAIoVHufjjREoIQcc58cZ59//oeAV6ogBAP8AABQ0/x0A6YgCB/gFAAAP +TwyYUIsgD+w5/KBmFeeqAQDsVgIt3gKAAOtLAgLIQQAA61YBIcBBAAD5QAlxUgCdAOhBDWJT/QAA +bakFCACGCQJhwICYFOkgBCJb/QAADLsRq1v1IAkJEgCdAIgyKCYc6TIBJdhBAACbEygWAvMgCbhQ +BQUAZpFQpUyIFAx9Eabd7NadLBAEgADRDwAAAAAA9wAOkJIAnQAMeRGmmS6SnvXADvviAJ0AJZKd +DXsKK7K/C1UBZFHNsI2dqGVe3WAAYwAAAAAAAADqJAAJ2ASAAO0SBSpgBIAAWHXX0qDRDwDAoFmj +8Brngoio+R/yGJD89QD/+VgNoAUFAAAAAAAAAPpAaB2gG8UA/AAiHaANFQBYeQhj/7HAUMDqDog0 ++UEGFa/4rgAd55ct0IAt3Df64wAV5N0dAO1NCAlQBIAA/aBgFeAMFQBYePtj/3sAAAAA+EKGHa/6 +DgAAAACKJ/0gaB2gCxUA6qwgKmgEgABYb276IIYVr/tKAIsw82AIopIAnQDiEgQr5wKAAKbMJMad +0Q8AAAAAAAAA6xIAKVAEgABYALtj/jAAAOokAAxgBIAAWAJAiTGLE4gS7KwRDSgEgADsuwgE9Z2A +AOokAAxgBIAAWAIHiBSlpaVMDH0Rpt3s1p0sEASAANEPAAAAAAAAAP/2lA2gBQUAjTWMNB7nZPpg +6BXgCSUA/HAAB7CtcQD7LwAMu4whAPsgBADTzAEA6MwID/gKgAD/gAEGfd0BAO67AQZwOQAA7rsM +BmBpAAANvSwNzCj9YABFv/W6AAAAAOokAAPYSQAA/AAiHaANBQBYeLRj/mHAoFmjjhrnIYioHecf ++R/xCJD89QD/+PANoAUFAMBQwLoLizT7QQYV7/i2ALBLDLsR61sICVAEgAD7YgAV4AwFAFhtCrNM +4hIEK+8CgACm3SzWndEPAGwQBgIqAlgtAyQwFvnOVAWipgUABqYohTeoaARECghEC+RNESlQBIAA +5EwwIqghAABYLPiIQB3nJyswFvUMHg2gBxUALNJsLdJpqt0J3RGtzBjnIh7nIaho6YJ9LW8CgADu +3QgNgQqAAO/SASvwCoAADpkCHucRDv8BLoJ/D+4CH+b6KYZ9Dv44DpkCmdIogn/Ii4bHJmwQ2mBY +BddooRuIMupCASkBCoAAAHkaCYgClaCaUZRQlUGYMtEP2mBYBesW5wcLqBGoZuYWASUCeYAAFucA +DOowixErsoWLsLCqmhAMuwhZqBuMECpilgDBBAB7GguqAipmllmoUY0y70IBKQEKgAAAfhoO3QKV +8JRQn1GVQZ0y0Q8AAAAA+gDiHaALFQBYcbiIMitifytmg+pCASkBCoAAAHkaCYgClaCUUJpRlUGY +MtEPAAAAbBAI2iBYLLDUoBvm5fnNxgXipgUABkQoFebU6UkICVcCgACrqoqgKZJ/GObbpUX7IAQE +sGMFAPggBhXgBxUA4QAFATO5AAD4gABCMADCAAAAAAM8CuXMCwtoBIAA6MKQKVAEgADszQIqWASA +AO48oCZgwQAAC4AAAQGHAzdg4QEHCfdAAADRD2wQBCYhCfhCkBXv+AUAJyAV6JgBCzYCgADomQwL +uQKAAAdmAvhChh3gBwUAJzQA+GBmHaAEFQAEZgKWMRXmhyRWrdEPAAAAAGwQBBbmtBXmkdMPpiIF +NQIlJoAkIoBnQAttCAUoIoBngAJj//PRDwBsEAQT5qsiNopj//wAAAAAbBAEKCAFJSAH+mCoFa/0 +1QD6QEgV4AMlAP0BIBHRVQEAwCDRDwCIKZorDwIA+wAIPCIAnQAa5psKWgnpofwlUAsAACqhAPsg +BLOiAJ0A82AEcBIAnQACKgJYbHgrIgIPAgADugFkr7iKJwS7AesmAiVQwQAAWGWh4+ZpFQE5gAAo +oADTD9MPA4gKKIIQ7KAHLVgEgAD6QGgdoA1FAAuAAGWv3Ikn0w9kn3YqmRTKp4qZZK9sKKAAA4gK +KIIQ7KAHLVgEgAD6QGgdoA01AAuAAGWv4GP/SgAA//9UDaAKBQDaIFhsZSsgIuq7DAlQBIAAWG2v +2lD6ACId4AwFAFhvXosiA7oB83/65mIAnQAvIAfaIPwAIh2gDQUA9WAEBzG/AQDuJgIl2H0AAFh3 +vsAg0Q8AAAAAAAAA6yAiKVAEgABYbZsqIAXBg3ihDGioKYsi82AEBX/8RgApIDrAv3uZ6vpAaB2g +CwUA/AACHaANJQBYbNJj/9cAAPpAaB2gCwUA/AACHaANJQBYbEtj/78AAGwQCogrHeY5LiAhizf8 +YMgVoP/lAA/uAS4kIQ3MAQy7DOuJCHjIBIAAwCDRDwMAhgkCYZsVKCAFJSAH+CEGFe/01QD8QEgV +4AMlAP0bQEHRVQEAiikc5i+bK/tACBRiAJ0ADFwJ68H8JmALAAAswQD9YASjogCdAPOgBGASAJ0A +2iBYbAqLIgO6AWSvm4onBLsB6yYCJVDBAABYZTQKqwLj5fsVASmAACiwANMPA4gKKIIQLLAH+kBo +HaANRQALgADrpAANfx4AAIknZJ9aKpkUK5IJyqhkv08osAADiAooghAssAf6QGgdoA01AAuAAOuk +AA1/LgAAY/8tAAAAAAD//0gNoAsFANogWGv3KyAi6rsMCVAEgABYbUHaUPoAIh3gDAUAWG7wiyID +ugHzf/rOYgCdAC8gB9og/AAiHaANBQD1YAQHMb8BAO4mAiXYfQAAWHdQwCDRDwAAAAAAAADrICIp +UASAAFhtLSogBcGDeKEMaKgpiyLzYAQFf/w6ACkgOsC/e5nq+kBoHaALBQD8AAIdoA0lAFhsZGP/ +1wAA+kBoHaALBQD8AAIdoA0lAFhr3WP/vwAAbBAEHOXXizQpMBb9YAQFtZkdAPUgCAiSAJ0A7uXS +FIiJgAD7y6IFr/3lAOTlqhSkuQAAaZUiLKF+7LMMdlARAAD7YAibogCdACsgBrC7CwtH6yQGJYLJ +gADAINEPLKF+0w/sswx2eBEAAP9gB9PiAJ0AKCAGsIgICEfoJAYsft4AAIkniyIqmRQNuwGbIouZ +ZKC0KLAABIgKKIIQ2iD9YPAVoA01AAuAAMAg0Q8AiyKKJw8CAA27AesmAiVQwQAAWGS8ya0ooAAE +iAooghDsoActWASAAPpAaB2gDUUAC4AAZa/giSdkn28qmRRkoGCKmWSvZCigAASICiiCEOygBy1Y +BIAA+kBoHaANNQALgABlr+Bj/0IAAOokAAnYBIAA7EQACugEgABYbOXAINEPAOokAAnYBIAA7EQA +CugEgABb/0HAINEPAP/9HA2gCwUA//50DaAKBQCINyLifwmIEfhAAEE/+5YAiDci4n8JiBH4QABB +P/v6AGwQBBrlZyiis2SACwnqMCuitAuZDGeQAdEPWG8G0Q8AbBAEHOV0JiAHG+VzH+V1/kEEFaDW +EQANyzmbMIcg+8p4BaAJJQD6YEYVoBgFAOg2Ayu+AoAA+OYADHFmAQD4YCYVoAwFAOUgeSs0AoAA +98YADrArBQD/pgAO8Ao1AOjlXxKCAYAAnDWcN5szGeVeCnUClTGZNiUhCZ00LyAHnDmUO/imAAkx +/wEA4jYKL/wCgAAP7gII7gLuNggtEASAANEPJyEIKiEJnDWUNwZ3AgiqApo2CHcC5zYELJAEgADR +DwAAAGwQBBjlSB3lQisgBxzlQiohCPoCAAdxuwEA7tw5DdwCgAALqgKcMOPlKhmwBIAACKoCHOUG +IzCA+kAIFeANBQCdZexmAiG43QAA+sCGFaR3HQDpfP8t3gKAAOt7AgzPAoAA62YBJMvhAACZYwIE +iZNnKGYGBiCLGOT2JSEJ9MFmFaQzHQDlZgorkASAAOgABQMowQAAbTkCBQJh0Q8AAABsEAYd5SEL +KxGtsyoyfxnlHxflAoigwED44ABE8AYVAOm5CAQBqYAALDJ4LzJ7+YAFfGIAnQBl8RQsNnwrMnkr +NnvdQA3kFgECAJSgDeQWwMn8QAXcIgCdAC8ye8HA7eUMF4ORgAAiMnwqIQSOIPPh/g2mugEAJDZ8 +9G9mFaAAHgAuNnztrwEFw/0AAAj/Au8lBCWMWQAAIjJ8sMzvMnshAPGAAMnGY/+/2iBYbyFloMIq +IQT/QQAMFpoBAMiX0Q/aIFhvFNEP2iBYbtbRDwAAAAAAAPpAaB2gCwUAWG+k0Q8uLPjq0ogvAQqA +APzAAQXf/PUADLsDC6oBKtaIWaYqJDZ8JDZ7+m/oFa/84gAAABXkoy9QaWTwalmcolhujShys9MP +yIFYbmIpUGlknylYblzIrhXk2CxSeLDM7FZ4JgLJgABYbeNj/w4AAAAAHOTS/m+IFaAKVQD8b0gV +4AtFAO0WACFr5QAAWaRb+m/oFa/7MgAuMnviNnwveh4AACI2e9EPH+TGL/KucfaL9q0mHa/+IgAA +AAAAWZxs+q8GFa/+kgBsEAQU5L4Z5Ljo5JsZXsKAAKS0I0J/qYjouAgBgiGAACoyAHipAipCexzk +sCsxBCpGfwy6Aeo1BCnQBIAAWG7TzqkpMQT/IQAMFtkBAMjX0Q/aMFhux9EP2jBYbonRDwD6QGgd +oAsFAFhvWNEPI0Z/0Q8AAGwQBPBg4A3v+fUAiCIJOQMJiAGYIoonKqwwWGOh4+RoFQEZgAAooAAD +iAooghDsoActWASAAPpAaB2gDUUAC4AAZa/giSfLkiqZFMqlipnJrSigAAOICiiCEOygBy1YBIAA ++kBoHaANNQALgABlr+DRDwAA//9cDaAKBQDRDwAAbBAIHeRgG+SCFOQ898kABaAYxQDjLOgl04EA +APhADcwnMwEADDURpFXoUp4pZsKAAKbEKUB/+QAQU+IAnQAoUp1kgf+bEeoLHg1IBIAAmRAKIIYL +AmULAmMNAIcJAmEJAmHtxwgJAQqAAP/I1AXgDhUA4+QzH3AKgACeE6/P/iCGFe//9QD/1wAPcAZF +AP4gRhWgAMIAAAAAipnJrSigAAOICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+ApQiBkkO8tQHws +QH0e5FQN2wkHuwru3ggF2CsAAIqyLuCAZKE4/cf+DaAIFQAvCgANjzgP/wkH/wov/Qov/Jwv8hss +CgEM3APx4SAN58wBAAzLCQe7CuxEfCXYKwAAwND8j6Yd4AwFAI2w71KeJvP/AAAu4P//4AR7ogCd +AC9Snfbf4BWg+PUA8efADedmAQB4YXTqEgQmQAUAAOhEfSbj4QAAWG5YiRPSoOsSAiSAYYAAiqIL +qgEqJgKKJyqsMFhjKcmtKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA1FAAuAAGWv4IknZJ8XKpkUZa7u +//u0DaAKBQCMEYsQDICGDGCGCwJpCwJn0Q+PEY0QLkR/D8CGD6CGDQJtDQJr0Q+bEeoHHg1ABIAA +mBAKAIYLAmMLAmEN4IcIAm/o7AAJ0ASAAFmbzGSvr+3j4BmvAoAA5FUICWbCgAD3gABCP/kyAMCx ++7cADfAMBQD8j6Ydp7sBACtEfAu7CfdgAQXwDAUA+2FAJe/7mgAAAAtghgtAhgoCZwoCZdEPAABs +EAQY46kCA0cMMxGoMysyhBnjtiiwAIqxCYgKCiGMAgo+KIIQAwI+/EBoHaANJQALgAAiNoTRD2wQ +BBTjmwIDRwwzEQQzCCQyhCpCASZAAChACPqYaB2gqSUAAgU+AwI+eYEjGOOiCGgKKIIQ6lQAClgE +gAD8QGgdoA0lAAuAACI2hNEPAAAA6yQAClAEgABYbh/zQGgdr/82AAAAAAAAbBAEWZ8cEuOAE+Oh +DAIAKSKCCRqOA6gKiIQLgABj/+sS48ID6DAE7jAFsTCTIJQhlSIS474T44OEIAQzApMgEuO8wDAo +N0AoN0QoN0goN0wjPQFyM+0S47fAMJMgxy8T47YDIwMS47WEIAQ0AZQgEuO0hCAENAGUIBLjsoQg +BDQBlCAS47GEIAQ0AZQgxy/AMQMjAxLjroQgBDQBlCBj//wAAAAS46uDIAMTFA8zEZMgEuOowDAj +JgBX/9kQ46eRAJIBkwKUAxHjpYIQAeowohEB8DHAQATkFgACABHjoYIQIxoAAyICkhAR457AIZIQ +BOQxhAODAoIBgQAA0jABIwAAAAAQ45mRAJIBkwKUAxHjl4IQAeowohEB8THAQATkFgACABHjj4IQ +IyoAAyICkhAR44/AIZIQBOQxhAODAoIBgQAA0zABMwAAAAAQ44qRAJIBkwKUAxHjiIIQAeowohEB +8jHAQATkFgACABHjfYIQI0oAAyICkhAR44DAIZIQBOQxhAODAoIBgQAA1DABQwAAAAAAXJQBXZQC +XpQDX5QAQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AFyQAV2QAl6QA1+QAFMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAACclAAdkAGdlAKelAOflAQIlAUJlAYKlAcLlABDAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAnJABnZACnpAHHZADn5AEeJAFeZAGepAHe5AAUwAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAANyUAB2QAd2UAt6UA9+UBASUBQWUBgaUBweUCAiUCQmUCgqU +CwuUAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADckAHdkALekAsdkAPfkAS0kAW1kAa2kAe3kAi4 +kAm5kAq6kAu7kABTAAAAH//89ADSMRD//goAAAAAAB///TwA0zEQ//4KAAAAAAAf//2EANQxEP/+ +CgAAAAAAAPQwCgAAAAAA9DAKAAAAAAD0MAoAAAAAbBAIiCInIAcpIhmZFfEVfA3hdwEAHeJDZJEl +FuJELdCA6+I/G9cCgADmqggG6N0AAP1TyBWk3R0ArU3p4jsW6AkAAP2ACwvgCKUAKqKdC3wKLMK/ +DKoB6hYGJQqpgACKmPdACwiSAJ0ALmKu7eIxFwiJgAAsYq0t0n/tywEFc/0AAP2AB+5iAJ0Anpj9 +gAf2YgCdAC8gFKT/Dw9HLyQU9eAJxlIAnQArMgn4IMgV54UBAPkACWlWux0A6DwQIgxBAAAqTP9t +qQUIAIYJAmHAUIkVGuIYDwIAiZDoEgYia/0AAOqZAgzmAoAADNwC/QAmFaAKBQBtuQfphgYkQQEA +AIgWjDKcFCwmHOsyAS7PAoAAqYiYE/NgCrhSAJ0A6hYALYuCAACLEOtLCAvnAoAA5swIBdv9AADr +xp0qkASAANEPBQxHaMIYiif6gGgd4AwFAOqsICpoBIAAWGmj0qDRD8Ag0Q8AAAAA6iQACdgEgADs +RAAK6ASAAFhv39Kg0Q8AAMCwCKw07JYILfhWAACNImXf1Nog/EBoHaAbxQBYbHNj/8QAAAAAAP/6 +rA2gCgUAjiJl77IrfBjqJAAJYASAAFhsamP/ocCgWZ3mGeHXipj5X/SokAilAGP/stogW/rcY/7D +jyefEYX5+eKCFa/JBQDs8RUn6IEAAAnZAZkS6ckIClcCgADqiAwCqEEAAJX5CIgy6PUUJMkBAAD4 +oAfS4gCdAGirQaWsLMzw/SAEY6IAnQDvEgYiDIUAALBObekFBQCGDwJhjNEPAgAPAgCsrOjZBCZj +wQAA+YAGRGIAnQDs1gEuKASAAGWOZGAAlAAA6iQADFgEgABb/D6LMYgTjBTqFgAtbwKAAO2ICAX0 +xYAA6iQADFgEgABb/AWOEO6uCAqQBIAA7k4IC/8CgADm/wgHc/0AAC72ndEPBZkM/CDIFaT5HQBt ++QUFIIYMAmOMEg9FDC8SBizMQOn/CAKMQQAAKFz/bYkFDECGDwJlhRIs2QQJqAyoVSVcMOXWAS5u +jgAAiRLAUOXVBCTJAQAAmdH5oAYV7/buAAxVDPXhJhXv/A4AhRIlXED1oCYV7/zuAAAAAGwQBB3h +gBrhgRzhfy3SNiqhfizCi6Pd6joMDu5CgAD9gABGcAsFACvEBCvEBVkMbPpAaB2gCwUAW/yv0Q8A +AABsEASFI4MgFOFy+ECEFaFVAQDq4XAarsKAAORUCAGAuYAA+wAEBDaYOQAJiAIoJQQiQn/RDx3h +ZxPhaB/haCZCfishBC5Cf5JgliGj//1gBAX2yzkADLsCr1/vJgAnKAUAACVGfyJGfuslBCqQBIAA +0Q8AAGwQBIIjAgJB0Q8AAGwQBIogZaBQHeFW6iIDKfbCgACu3f2v6BXgDBUA/IBABjGqAQAGqgIN +yCwI3SgnJQXtzAwEWAUAAP1tAAw/+8UA66oBDE5CgAAJWQIDqgKaIwmIAiglBNEPjyMb4UIPD0EL +/hGr6y2yfxnhPCyyfnLZGdnA8yPeDaAMBQDAwCy2fyy2fvpACBWgAEYA2MDzDEYNoAwFAHLRHI0h +mtCOICmyfZ3hnCDsJgEky/0AAPlvphXv/VoAGeEoGOEoqYio6HihIOq2fy+BLgAAza0qsn1qohgt +snv9b+YV4ABKAAAAAAAAAOy2fyf/KYAA+kAIFa/+pgAc4RmIIayZqen5DwAM8AwFAAnIOPlvxhWv +/ioAbBAE9cIqBeAGFQD0QGgdoAI1APaAQAMwAB4AALAiKFJ/6GP3cquBAADRDwBsEAT0QggVpCNB +APJaAAk/U4EABCIKhCaCIQVEKApEEaQi0Q9sEAQpIhIjIAfUUPg+AARwBTUA9QAIcJEzAQAX4Oz3 +wdwFoYnhAPUACFCSAJ0A9GAGIhIAnQAMORGmmSqSngc7Ciuyv/dACGHSAJ0AKpKdC6oB8U7ADedE +AQAoIQcZ4Ov/wdgFqogBAOvg6xxHAoAACYgCmKAY4Oj8QAgV4DwFAJyn+0CmFeAZhQCZo/lARhWg +CAUAmKbu3QIO/gKAAJ2kBf8Cn6EvIhIPj0Hopggv/wKAAJ+p7eDZGfcCgACm7iXmnSwiEioiEA3M +AuwmEilYBIAAWNCAaEIYiif6ACId4AwFAPtEABWgDRUAWGhq0qDRD8Ag0Q8c4LeLyGqxXQw5EaaZ +LZKebtNoKpKdBz0KLdK/DaoB5KBbZfP9AAD/gQYVr/zGAC8aAA+ZAvhCRhXv+7IAACgqAAiYAvhC +RhWv+8IAiSLLnGhCUMAg0Q8AAAAAAAAA//voDaAKBQDAoFmcrBzgnIvIa7GU//uUDaAKBQAAwKDA +2g29NP2BBhXv+1YAAAAA6iQAAdhhAAD8AAIdoA01AFhxwmlCrownL8kUisn/hAAVr8gFAOjuAQf4 +QQAA78UUJVPBAADqxgkncQEAAH6rKinBFR3glqqamsmdoIwg+8EoBeANFQDrpgIuZgKAAA3MAv1A +JhWgAgUA0Q8d4IydoIwg+8EWBeANFQDrpgIuZgKAAA3MAv1AJhWgAgUA0Q8AbBAYkhCOIBXgg4kj +iyGKIioWIisWJPgkZhXgBBUA9CDmFaAIBQD4IKYVoAxFAPwhRhWgDTUALRYJ9CDGFeAPJQAvFgj1 +wOoF4A+lAP4iBhXgDbUA/CImFeAMxQD8IkYVoAiFAPghxhWgBJUA9CHmFaAJdQD4IaYV4AtVAPoh +ZhXgCmUA+iGGFaAL1QD6ImYV4ArlACoWFPXAwgWgCfUA+CKmFeAIRQCYFIYWKxIkiRUnYX4sEiIi +YX8HmSgvUIAJKQj4nIgVo5kBAAOZCu6SAC9QBIAAJmI+LRIjCO4IC2AAjhcsEiQtEiIH7igvUIGu +LvicqBWj7gEAA+4KjuAqFhbqEiMtWASAAKjuC2AAjhgsEhYtEiQH7igvUIKuLvicyBWj7gEAA+4K +juAqFhfqEiItWASAAAjuCAtgAI4ZLBIXLRIWB+4oL1CDri74nOgVo+4BAAPuCo7gKhYY6hIkLVgE +gACo7gtgAI4aLBIYLRIXB+4oL1CEri74nQgVo+4BAAPuCo7gKhYZ6hIWLVgEgACo7gtgAI4bLBIZ +LRIYB+4oL1CFri74nSgVo+4BAAPuCo7gKhYa6hIXLVgEgAAI7ggLYACOHCwSGi0SGQfuKC9Qhq4u ++J1IFaPuAQAD7gqO4CoWG+oSGC1YBIAAqO4LYACOHSwSGy0SGgfuKC9Qh64u+J1oFaPuAQAD7gqO +4CoWHOoSGS1YBIAAqO4LYACOHiwSHC0SGwfuKC9QiA4uCPidiBWj7gEAA+4KLuIAKhYd6hIaLVgE +gAAI7ggLYACOHywSHS0SHAfuKC9Qia4u+J2oFaPuAQAD7gou4gAqFh7qEhstWASAAAjuCAtgAC4S +ECwSHi0SHQfuKC9Qiq4u+J3IFaPuAQAD7gqO4CoWH+oSHC1YBIAACO4IC2AALhIRLBIfLRIeB+4o +L1CLri74negVo+4BAAPuCo7gKhYg6hIdLVgEgACo7gtgAC4SEiwSIC0SHwfuKC9QjK4u+J4IFaPu +AQAD7gqO4CoWIeoSHi1YBIAAqO4LYAAsEiEuEhMtEiAvUI0H7igoQvGuLvogZhWj7gEAA+4KjuDq +Eh8tWASAAJsRqO4LYACMES4SFC0SIS9QjgfuKChC8q4u+iBGFaPuAQAD7gqO4OoSIC1YBIAAKxYj +qO4LYAAuEhUsEiONEwfuKC9Qj64u+J5oFaPuAQAD7gqO4OoSIS04BIAAJxYi6O4IC9gEgAALYACO +ESoWJCkSEi0SFY8VKxITLBIU6BIRJ/hBAADvFgUl2EEAAOsWEyZgQQAA7BYUJEBBAADoFhEm6EEA +AO0WFSTIQQAAKRYSjR+JHIgbjB6LHe8SECRAQQAA6BYLJmBBAADsFg4l2EEAAOsWDSf4QQAA7xYQ +JMhBAADpFgwm6EEAAJ0fiRaNGY8a6xIHIiEBAADsEggm6EEAAO0WCSf4QQAA7xYKIqhBAADvEgQm +YEEAAOwWCCXYQQAA6xYHJMghAADpFgYn+/0AAO8WBC/iFgAAiRCPE4sSjpCIk4ySjZGriKfMqt2v +7p6QnZGckpiT0Q8AbBAEKSIV+KAABPA4dQDpjAwBIEEAAPMgAEU/iwUA66QQJVBFAAD5AAXTYgCd +ACsKAFmYgSwiFSsiFO3NEQlABIAA/EJGFe6APQD9awANsAk1APpCZhXgCiUAbaoMjoQODo7uhgQk +QBEAAA8CANMP0w9tmiHpggQkQEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD60QACVAEgABb +/rWKIIgiiSGPIwgIjgkJjg8PjgoKjpognyMpJgHoJgIpQASAABnfNAIAhgMCYfgAChXgCbUAbZoC +CACK0Q8AAAAAAAAA/YEAFaALBQBZmFL4QGgdoAlFANMPbZoh6YIEJEBBAACKgYuCjIMJCY4KCo4L +C44MDI6ZgJqBm4Kcg+okAApYBIAAW/6T2kD/+/wNoDyFAABsEAYpIhX4QogVoEYFANMP+IAARXWZ +AQAJZgx0qwGxiComFQYqDOgmFCVRQQAA9oAHs6IAnQDrNAALYASAAFmYJfhAaB2gCUUA0w/TD22a +IemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIMlLBDqJAAK2ASAAFv+cAZHDPbgBY7S +AJ0A5jQICtAEgAD24GgdoAMFAOQWACpABIAA+MhoHaAJRQAKAmcIQIYKAmUIIIYKAmMIAIbqDAAJ +QASAAG2aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIPqJAAK2ASAAFv+U+pUAAGY +BQAA5mzAIiEBAADvbZpqQASAAIsQCjwRC8sI7HwMCtAEgABZl+3RDwAAAAAAAOs0AApgBIAAWZfo +0Q8AAAD2YABGMAMFAPwgBhWv/yYAbBAEGN7IGd7GGt7EE97HkyOYIpkh+kAGFaALBQArJhUrJhTR +DwAAAGwQBt4g5OIQKmAEgADnQgcr0ASAAPu9agXgGDUA40IVKZAEgADncg4i++kAAHj7JxjetQj4 +CoiAmhOcEu4WASwAIoAAAJMQKrKV7FQACVgEgABZmZlkpc/ygqYV4AIFANEPAAAAACviEgubUu4W +ASX/QYAAGt6e4xYAKVgEgADqorcq4ASAAFmZjGSlghrel9sg6qK5KuAEgABZmYdkpuAa3pPbIOqi +uyrgBIAAWZmC90jgDeN2xQAa3o3bIOqivSrgBIAAWZl8ZKbhGt6I2yDqor8q4ASAAFmZdyN9A+8C +AAGaAQAA+0BDcBIAnQArMNnBWPVgLAhiAJ0AabchJTTZixD6gqYV4AIFANEPkxAqso3sVAAJWASA +AFmZZ2SnH4sQ+oKmFeACBQDRD5MQKrKb7FQACVgEgABZmV9lrxj6IGgdoAu1AFjMifoAIh3gAwUA +6rM4BQDhgADqEgIrWASAAFmX8sipHN5ojREMrDYs1hdlMyuNEPyCphXgAgUA0Q8AAAAuQG5k7s2T +ECqysexUAAlYBIAAWZlIZa66+iBoHaAbZQBYzHH6ACId4AIFAOqyOAUAqYAA6hICK1gEgABZl9os +fQMqxShlItSNEPyCphXgAgUA0Q8AkxAqsqPsVAAJWASAAFmZNGSiuxreQNsg6qKPKuAEgABZmS9l +rlj6IGgdoAtVAFjMWfoAIh3gAgUA6rI4BSgZgADqEgIrWASAAFmXwixAb/GAJ27SAJ0AZKTlihP6 +AKId4AzVAFjMNdKg0Q+TECqyqexUAAlYBIAAWZkZZa7I+iBoHaAbJQBYzENkojsrQG7TD2S3kuoS +AitYBIAAWZetLEIWCsw2LEYWixD6gqYV4AIFANEPkxAqsqfsVAAJWASAAFmZB2SiNxreEwIrAg8C +AOqioSrgBIAAWZkBZa5o+iBoHaAL5QBYzCtkodvqEgIrWASAAFmXlyt9Aiq1FIsQ+oKmFeACBQDR +D5MQKrKZ7FQACVgEgABZmPJkoioa3f3bIOqipSrgBIAAWZjtZKOHGt352yDTD+qikyrgBIAAWZjo +Za4C+iBoHaALdQBYzBFkoXUrQG5ktwIa3e6LEuqi3ytgBIAAWZjeZaZkK0BvwMgMuwIrRG+LEPqC +phXgAgUA0Q8AAJMQKrKv7FQACVgEgABZmNNkoe8a3d/bINMP6qKRKuAEgABZmM5lrZr6IGgdoAtl +AFjL92ShDStAbmS2iRrd1IsS6qLfK2AEgABZmMRkppgrQG8sCv0MuwErRG+LEPqCphXgAgUA0Q8A +kxAqspfsVAAJWASAAFmYuWShtxrdxdsg0w/qoosq4ASAAFmYtGSi2hrdv9sg6qKrKuAEgABZmK9k +rFca3bvbIOqisyrgBIAAWZiqZaxEGt22ixLqos0rYASAAFmYpWWkaosRK7ISC5lSyJlokgf5IA9h +0gCdAIwRK8YS8oKmFeACBQDRD5MQKrKH7FQACVgEgABZmJhkoXoa3aPbIOqiiSrgBIAAWZiTZayv ++iBoHaALJQBYy7zKohrdm4sS6qLfK2AEgABZmItlrI+KE/oAQh3gDNUAWMue0qDRD8Ag0Q8AAAD6 +IGgdoAv1AFjLrmSv6uoSAitYBIAAWZcb6xIAI+ALAAAqxRX6gqYV4AIFANEPAAD6IGgdoBsVAFjL +omSvui1AbmTVJClAb/E/4W+SAJ0A8T/hL9IAnQDqEgIrWASAAFmXCS5CFwruNi5GF4sQ+oKmFeAC +BQDRDwD6IGgdoAulAFjLkGSvci9AbtMPZPSV6hICK1gEgABZlvsoQTT7AA8CogCdAIoT+gFCHeAM +1QBYy2/SoNEPAAAA+iBoHaAbVQBYy4BkrzLqEgEqWASAAOwSAitoBIAAWMsIixD6gqYV4AIFANEP +AAAA+iBoHaALlQBYy3RkrwIpQG5klDga3VKLEuqi3ytgBIAAWZhBZaJzK0BvjRD8gqYV4AwVAAy7 +AvqN5h3gAgUA0Q8AAAAAAAAA+iBoHaALFQBYy2Jkrroa3UGLEtMP6qLfK2AEgABZmDBlqySKE/oA +Ih3gDNUAWMtD0qDRDwAAAADqEgIrWASAAFmWxPVAFrKSAJ0Axy/RDwD6IGgdoAuFAFjLTvoAIh3g +AgUA6rI4BQFJgAAsQG4PAgBkw6Ea3TDrEgIrYASAAFmYGGWihi1Ab8DoDt0CLURvZS41jxD+gqYV +4AIFANEPAOoSASpYBIAAWMtDZa+cKzDZY/puAAAAAPogaB2gGwUAWMs0ZK4CKEBu0w9kgxTqEgIr +WASAAFmWnylCGIsQK0YVCpk2+IMGFeACBQDRDwAA+iBoHaALNQBYyyZkrcoa3QWLEtMP6qLFK2AE +gABZl/Tj3QodB+YAAIsRK7ISC8lRyJlokgf5P/kR0gCdAI4RjBADvQEt5hL8gqYVoAIFANEPZS2E +jxD+gqYV4AIFANEP6hICK1gEgABZln4qRTSCEPKCphWgAgUA0Q8jfQPyb4AV4AsFAPpgaB2gjAUA +WZYP6hICKdgEgABYy10jfQMjPIArMNnAxAy7Avp/Zh2nuwEA+nsmHe/l0gAjfQMjPIAoMNn6IEgV +oAklAAmIAug02StYBIAAWZZjKzDZ+nsGHa/lKgAAAIoSWYxqKH0DKID8eKkaihJZjGbspAAD2BMA +AOoSAiXb9QAAWZe5ZKG5wKL9uZ4FoDsFAFmcHMcv0Q8AGtzBixLqoscrYASAAFmXsGWuJ4sRK7IS +C8lRaJEKaJIH+T/wsdIAnQAe3MEDvQEO3QKOEYwQLeYS/IKmFaACBQDRD4oT+gEiHeAM1QBYyrfS +oNEPAAAAAPogaB2gC0UAWMrIZKxSGtynixLTD+qixStgBIAAWZeW49yvHQVmAACLESuyEgvpUciZ +aJIH+T/tUdIAnQCOEYwQA70BLeYS/IKmFaACBQDRDxrclosS6qLPK2AEgABZl4ZlrX6LESuyEguZ +UmiRCmiSB/k/62nSAJ0AH9yZghHvvwID6A8AAO8mEibqAQAALNDZwOEOzAIs1NnygqYV4AIFANEP +ihP6AQId4AzVAFjKidKg0Q8jfQMjPIArMNnAwQy7AgsLR/p7Jh3v354AAAAa3HeLEuqixytgBIAA +WZdmZaz/ixErshIL6VFokQpokgf5P+dx0gCdAB3cegO8AQ3MAo0RLNYSixD6gqYV4AIFANEPAAAA +AAD24ABCsAsFAPqgaB2gjAUAWZWKwWDqEgIq2ASAAFjK2Csw2Qa7Avp/Zh2nuwEA+nsmHe/dngAA +ACN9AyM8gCsw2cDIDLsCCwtH+nsmHe/dMgCKE/oA4h3gDNUAWMpY0qDRDwCKE/oCAh3gDMUAWMpT +0qDRD4oT+gFCHeAMxQBYyk/SoNEPihP6ASId4AzFAFjKS9Kg0Q+KE/oBAh3gDMUAWMpG0qDRDwCK +E/oCQh3gDMUAWMpC0qDRD4oT+gIiHeAMxQBYyj7SoNEPAIoT+gDCHeAMxQBYyjnSoNEPihP6AOId +4AzFAFjKNdKg0Q+KE/oAwh3gDNUAWMox0qDRDwAAbBAEJCIQZEBsKTAQKjARLDAa6zASLM4CgAAK +mQLqMBMszgKAAAuZAuswGSzOAoAACpkC6jAYJIURAAAIqhELqgLrMBstVgKAAAyqAgiqEQuqArGq +6iYWJISNAAApIhLr3BwUwCiAAAubASsmEixABS0KlX3BScAg0Q8ALjAULzAV6DAWL3YCgAAP7gLv +MBcvdgKAAAjuAgjuEQ/uAv3XYABQjQUALyISePckwKX9uBIFoDsFAFmbUcAg0Q8AAAAA+oBoHaAL +ZQBY5KDAINEPAIwnKckUi8n5hAAVr8oFAOqIAQTJAQAA6cUUJdsBAADrxgkkQQEAAHi7Bi7BFavr +m8kY2/XZsPgACB2gD0UAbfoCCQJhHNvcnLCKIP1AABUwDEUADKoCmrEpMBQqMBUe2+vvMBYszgKA +AAqZAuowFyzOAoAAD5kC7rYCLM4CgAAKmQLptgQhwCEAAOgGAAX4YQAADwCKKiISiSINqgLqJhIs +9+YAAPpAaB2gDTUAC+AAY/7pAGwQBiQiEC9AbvXgBtiQnFUAHNvSjSCONi8xC/hj8BWgClUA+CAG +FaA7BQBZmxMa28wkIhgsMQuILIlKhUf9AABEMAsFAPhBhhWgDQUA5VIOJJBWgAAtRhcKngL+gUYV +oAAqAAAAACtCF+taCAHYgQAAWZTFL0IXLjELjUCv7i5GFypQBCxQBRjbt+tQBi1WAoAADKoC6VAH +LVYCgAALqgLs27IdLgKAAAlVAghVAfSgYBXv+MUA+KAEArA7BQD+oGgd4ApVAFma7CoiEykxCytC +F6qZ6SYTIsDBAAB4sUHAINEPAAAAAAArQAV8sfAc25/8QAgV4AolAP6ACBWgOwUAWZrd+oBoHaAN +JQD8TIYd4AsVAFjkLMAg0Q8AAAAAAAAf25OOSg/uAe5GCilQBIAAWOFo+kBoHaALBQD8AAIdoA0l +AFgBg8Ag0Q8AbBAGHNuJLSIALjIF9EDoFadVAQD+v8AV4AgVAA+POfSCghWgClUA9CAGFaA7BQBZ +mr+JImWQmCYgBxfbTAYGQeoyBStHAoAAp4grgp4krB/5togF5EQdAHSzfCiCnQlrCiuyvwuIAe2E +AAQDqYAAHNtmDACHbUkCCAJhiDQe20ie0IkgHNtK6tYDJthBAADs1gIszgKAAOlJAgHggQAA6dYB +KVAEgAALgAAMbxGn/+T2nSKUdQAAiif6AUId4AwFAPtEABWgDaUAWGLX0qDRD8Ag0Q8AAAAA//4s +DaAIBQDqJAAKaASAAPrDABXgDAUAWGxQwCDRDwBsEASHJyp5FB/bQvjipBXvzQUA6HIIJVAHAADs +cgslUoEAAOqTd3PYgQAADbsBq5nowXR0yQEAAC6NAep1FCdSgQAA6pNxfDAEgAB5oX2aeO8ABQs4 +BIAABwJhBwJhBwJhBwJhBwJhBwJhBwJhBwJhBwJhBwJhF9sRl2CFIJNllGTztlgFoAelAOJmAiqu +AoAAB1UC5WYBKxAEgADRD8Ag0Q8AAAAAAAD3gGgdoAgFAPjhZhWv/nIACJoMCroMKq0BKqzg+uEG +Fa/+IgAsvED84QYVr/32AABsEATHjwhYAwg4AghIA6ho6CIIC4EKgAACIhiiMtEPAGwQBAQ4AwhY +A6ho6CIIC4EKgAACIhiiMtEPAABsEAQEOAMIWAEISAOoaOgiCAuBCoAAAiIYojLRDwAAAGwQBAVI +Awg4AQhYA6ho6CIIC4EKgAACIhiiMtEPAAAAbBAEIyIQKDAF+EJIFeCUJQB0iUj/KKADEI0FAHif +PXCfGera8BS9WIAACpoB+kJGFaACBQDRDwAAAAAA/bXWBaAKVQD8YAgV4DsFAFmaJCswbtMPabEF +LDAFdMEGwCDRDwAAAPpgaB2gDSUA/EyGHeALFQBY427AINEPAIwnL8kUi8n/hAAVr8gFAOjuAQf5 +AQAA78UUJdsBAADrxgkncQEAAH67BinBFaubm8kc2sPZsPwACB2gCkUAbaoCCQJhHNqqnLCJIB7a +vvv/4h2gDEUA6rYELM4CgAAMmQKZsSgiEo8inrINiALoJhIv+4YAAPpAaB2gDTUAC+AAwCDRD2wQ +BBPaugMiAtEPAGwQBCcgB4giHNqD9kIIFaF3AQDlgmNrzwKAAAyZCCiSnhraefcAEsLSAJ0AJJKd +CngKKIK/CEQB6NqNEhIhgAAlIhIqIgn4QUgV4FVBAAhVCiVSgOqZDAKowQAA9SAOw+IAnQArIBYt +Cv99sRX6QPAVoAwFAFhrNxzaZ/NBkA3g/fUAG9qYLyEHGtqXGNpv/7TiBar/AQDpIRov/wKAAAj/ +Ap9A+EAIFaBPBQCfQ55C+wYADTAOVQDqRgQsRgKAAA6IAphBKCIS+IDGFeA6BQCaRfgIAAUyiFEA +5ogRDVaCgAAIqgILqgKaR4opKSIVG9pwpaqlmfhCphXv6AUA6iYJIkiBAAD4gAuEIgCdAPoACB3v +iAUACQJhCQJhCQJhL0Qg+IQmHaAPBQAvRCQvRCcvRCYvRCUpYhH4h2Yd6JkdAPiHRh3omR0A+Icm +HeiZHQApRDgoIhb4h+YdqIgdAPiHxh2oiB0A+IemHaiIHQAoRDyKNCg8GPVABpgQ+fUACACI6Npa +ElChAAAKAIoa2kwpRDD4hiYdr/n1AClEMypEMoo0L0Qj+obmHaiPHQD4hEYdqJodAPiGxh3omR0A ++IamHeiZHQApRDTrAAUCQQEAAAgCYSkgBwkJQQyZEayZLpadKyAWfbEK+kDwFaA8BQBYasOJNGiQ +J4on+gCCHeAMBQD7RAAVoA1FAFhhsSsiEiz6fwy7AfpCRhXgAgUA0Q8e2jQtIhIO3QL8QkYV7/8u +AAAAAAAAAADqJAAK2ASAAFhq5uzZ9BVw6YAAYAAriW4Y2iSxmZluCJkC+IZmHeiJHQD4hkYdqIgd +APiGJh2oiB0A+IYGHa/8tgDAINEPAADrfBgpUASAAPwAIh2gDVUAWGsSwCDRDwDrfBIpUASAAPwA +Ih2gDQUAWGsMwCDRDwBsEAQqIhQpIhMc2db9s6YF5zUBAOqZDAGUHQAAZJCAKiAHCgpBDKsRrLsu +sp5u4ngrsp0Nrgou4r8f2esY2dr/YAQFsBQFAO7Z1BWC8YAALSEHDQ1K758CDu8CgAAO3QIe2fmd +sI0gn7WYspSzGNnU/6YADzAEJQDutgQu7gKAAATdAp2x6AAVBdhhAAALAIoMrxGs/yT2nS4iFKnu +LiYUaTIQwCDRDwAAiCLKgWgyNcAg0Q+KJ/oAIh3gDAUA+0QAFaANFQBYYVbSoNEPAAAA+0MAFeAM +FQD6QGgdoA0lAFhq0mkyyYwnLckUisn7hAAV784FAO67AQboQQAA7cUUJVPBAADqxgkl2QEAAHur +Ki/BFRnZpqr6msmZoIgg87OUBaAJFQDipgIsRgKAAAmIAvlAJhWgAgUA0Q8Z2ZyZoIgg87OCBaAJ +FQDipgIsRgKAAAmIAvlAJhWgAgUA0Q8AbBAGLyIYL/BYKAqOePF5KCAF6dm3FAOZgAAY2bQkIhII +RAEkJhKNOSsxCy4iEX2YfikiE6uZKSYT8oAFHlIAnQBk4MYq4gx9pz4o4gv7wGgdoAsFAPwAAh2g +DSUAC4AAKyIUKiITGdmjC6oM7NmjFVkDAAB7kxj7grYNoAkFAOkmESyQBIAA0Q/AINEPAAAA+kBo +HaALBQD8AAIdoA0lAFv/f8CQ6SYRLJAEgADRDwD9syYFoAolAP5ACBWgOwUAWZjAKiIQLaAFLgqV +ftG5wPL+TIYd4AsVAFjiDsAg0Q8c2YiN4P/AsBWgClUA9CAGFaA7BQBZmLMoIhIp+r8JiAH4QkYV +r/1uAAAA2iBY30Rj/0wAbBAILSIYK9BYKAqOeLENKSAFGNl37Nl3HIBGAADAINEPJCISKSIRCEQC +5CYSIjT6gACPLIk2JTAgJjEK/hFiHa/4xQD/KMYN5aUBACoiECugBSwKlXyxxMDS/EyGHeALFQBY +4efAINEPAAAA5JKCYdCBAACJl4me+SYAFeALZQDAIG25BQoAhgkCYdEPAAYGTiZs2whmAf9gE4wg +NxUApvj8hgAKMCslAPhBhhWgLFUA9EJGFaAmFQD3QkYNoA8FAHyhCnehB/tAILViAJ0ALzAwKDAx +GdlI7jAyL/4CgAAI/wLoMDMv/gKAAA7/AuvZQx/+AoAACP8C+eAcPmiPuQD9EAAUNe8BAAjuAhjY +/CiCPSuyiK6OCe4Rrrvt0Fgl2gEAACsmEf9gsBWgibUA+aAZDWIAnQApCpr5wBi0YJi1APnAGHQg +mWUA+cAYNGIAnQAtCpn9wBmdYARFAPdABjQiAJ0A/UAF9CIAnQApMEEuMEAvMDwtMD3oMD4vdgKA +AOnuAg/+AoAADf8CKTA/7TBCL/4CgAAI/wLoMEMvdgKAAO3uAg/+AoAA6f8CD3YCgAAI7gIP6Azt +IhAkBJuAACXSEn9RCAX4DGaAAi/WEi/SE9MP0w9+8QgP6QxmkAIu1hONvATdAp28fKFQ90AK5GIA +nQD3QBEEIgCdAMLi/0AVVCIAnQAvEBBk/hCKtyk8IPtByBWgCDUAbYoFCSCGCgJjwCDRDwAtMCPA +4Q3tOS20QS0UEP1f+aUiAJ0ALzAhf/eoLzBBLDBALTA8KDA97jA+LmYCgADvzAIO7gKAAAjdAi8w +P+gwQi7uAoAADt0C7jBDLmYCgADozAIO7gKAAO/dAg5mAoAADswCDcgM6iIQJASLgAAuohJ94QgO +3wxm8AItphItohN80QgNyAxmgAIsphMsMDgtMDmKvO4wOi5mAoAADcwC7TA7LmYCgAAOzALp2Mse +ZgKAAA3MAuSqAgZgBQAALCYWmrz5YWYV7/xiAInXKzELiZ6/uwtLS+W9fmTIwQAAY/0TAAAA+gBi +HeOE4QD5f+w+IgCdACswJCgwJekwJi3eAoAACLsC6DAnLd4CgAAJuwIIuxHouwIDSBEAAPstAAt/ +9WIAACwwIfGADM4SAJ0ALTAkLjAl7zAmLu4CgAAO3QLuMCcu7gKAAA/dAgjdEQ7dAmXRbywwTC0w +Te4wTi5mAoAADcwC7TBPLmYCgAAOzALqIhAuZgKAAA3MAmTMqC2iGP2/5ROiAJ0ALLYSLzBIKTBJ +6jBKL/4CgAAJ/wLpMEsv/gKAAAr/AujYjR/+AoAACf8CL7YUKTA2LjA0LTA1/mbwFeAKBQDqthUv +dgKAAA3uAuq2Ey92AoAACe4C6LYLL3YCgAAP7gL/YaYVr/fKACkwOCowOewwOizOAoAACpkC6jA7 +LM4CgAAMmQIImREKmQLo2HMUyAUAACkmFvlhZhWv9vYAAAAAAAAAAOzYbh74BIAA/WAIFeAKVQD0 +IAYVoDsFAFmXkCoiEsSwC6oC+kJGFaACBQDRDwAAAP/yEA2v7qUA7NhhH2gEgAD/YAgVoAolAPQg +BhXgOwUAWZeCY/uhAAAtMDguMDnvMDou7gKAAA7dAu4wOy7uAoAAD90CCN0RDt0C7NhRFugFAAAt +Jhb9YWYVr/S+AC8mEfugaB3v9JIAKiIQY/tcAABsEAgrIgcmIAcPAgAouRQFDUf1YcgVoWYBAOOy +CSQREYAA+aATEVIAnQAc2D6IIP9gSBWgClUA/b/AFeAJFQDtnTkJeASAAPggBhWgOwUAWZdbHNg1 +/GAQFeAKVQD+ShAVoDsFAFmXVRXX4uvX5BtQBIAA9MAOihIAnQAMaRGrmSySnveAEgpSAJ0AKZKd +BWwKLMK/DJkBZJH7LiEHLCBAJiAH96/MBeruAQDv2CAfdwKAAPWADkiRVgEA9YALyRIAnQD1oAuK +kgCdAMDQ+bAwBaBmEQDsIQgrMoKAAAbuAu/uAgqsAoAABcwCCMwCnpCPIPcgRhXgNgUA9yBmFaAF +BQCVlZWX/SCGFaAORQDolgYv/gKAAP/mAA+wCCUA75YBLv4CgADo/wIE4IEAAAMghgwCYwMAhgwC +YZ+Z5BMeBMkBAAAJAmkEYIYJAmcEQIYJAmXpIhItZwKAAOvMCAE5IQAA/5OmFa+aZQD3IAYUb2tF +APev4AWvmXUAJCISq0QvQigpRIEoQieY8CNCJy5CK58xJUYnJUYoI2KL6kSBJ3ysgAArQjEuMiQL +ikT7WgANMAwFAP9AAQUwDRUA+0AIFa+7gQBYXsUlRjEoQiYrQh8lRiv/BAAV78kFAAn/AeWFFCf5 +AQAAn4mfiC5idPpiKBWgDAUA/28ADbANFQBYXrf+QkgV75l1APxiSBXvmmUA/gAiHa9rRQD37wAP +8AwFAO/sOAbr/QAA7TYSJnpxgADAINEPAAAA/IBQFe/6RgD/93gNoAMFABfXbIx45hYEJg3/gAAM +qRGrmSiSnvcABIJSAJ0AKZKdBa0KLdK/DZkBZJB+sM6eeGWeHmAAFwAA/BBCHe/5JgAvIEAI/xD+ +YAYV7/ZiAIgiZY+VjTDrbBgpUASAAPmvSAXn3cEA/EgGHeAMFQD4YAYV4A1FAFhogcAg0Q8AAAAA +//csDaAJBQDAoFmTWIx4ihTr10gYBAqAAPmf+4CSAJ0A//4sDaAJBQDAkMDqDs40/uEGFa/98gBs +EAaJJyMgByiZFAMDQeeSCSQLsYAABQhH+QANcVIAnQAqIEEV1zP2AIIdoAQFAPFabA3gDAUAG9cx +DDoR9GAKehIAnQCrqi2invegENOiAJ0AKaKdBT0KLdK/DZkB6pQABI2hgAAuIEHsFgAvDp4AABjX +Mh/Xbi4hByUgBxnXbPxBBBXq7gEA9CAAAnBVEQDqVRAPdwKAAOXuAgokAoAABN0CCd0CD+4CnqCP +IJ2k+UBGFaAEBQCUpZSn+UDGFeA1BQCVo/3gABewBUUA5f8CDnYCgADl11cVSIEAAP9AJhXgDyUA +ByCGCQJjBwCGCQJhD+4CnqkMPRGr3SbWnf5BiBXvmXUAKSQF8rFoFe+YZQDoJAUn/KyAACsiEi4y +JAuKRPtaAA0wDAUA/0ABBTANFQD7QAgVr7uBAFheKCQmEogniyCULP8EABXvyQUACf8B5IUUJ/kB +AACfiZ+ILlJ0+mIoFaAMBQD/bwANsA0VAFheGioyErCq+mJGFaACBQDRDwAAAAAAAP/6KA2gBwUA +Htbajej3oAa4kgCdAAw6EauqL6Ke9+AHa6IAnQAqop0FPwov8r8PqgHkoNtmw/0AAJjo+UBoHe/6 +XgAqIEAIqhD64AYVr/kyAIieJIAEK4AFFtbx6oAGKiYCgAALRALogAcqJgKAAApEAghEEQhEAgZE +ASZMZ/aOAAswjJUA9sCAFa/4lgCJcO1kAAlQBIAA+a4OBaeZwQDpJEAh2GEAAPjgBhWgDBUAWGfi +wCDRDwDtRAACYSEAAOtMZylwBIAA/uBoHeS7HQBZlfMb1qj8IAgVr/g+AAAA//fIDaAJBQD8IAYV +oAoFAFmSrh7Wn43oG9afjBD5v/igkgCdAP/8yA2gCgUAAMCgwPoP3zT/wQYV7/yKAAAAAGwQBCki +ByMgByiZFAMDQeeSCSQK6YAAFNaM960cBaeFAQD5AAwRUgCdAPRgClISAJ0ADDkRBpkIKpKe90AN +SlIAnQApkp0EOgoqor8KmQFkkWMqIAcoIQcf1o8b1sr5QAAEMMoRAOrMEAxHAoAADIgCC4gCmJCM +IP8gRhXgPgUA/yBmFaANRQDu1sAeZgKAAA3MApyRKyBB/EEEFaAEBQD/IMYVofoBAOSWBS/8AoAA +78wCBNCBAADuzAINiSYAAMCwlJf9IIYVoAUlAAcghgoCYwcAhgoCYQi/EQX/AhXWq5+ZDD4Rpu4t +5p34QYgVr5x1ACwkBfKxaBXvmmUA6iQFJHysgAArIhIuMiQLikT7WgANMAwFAP9AAQUwDRUA+0AI +Fa+7gQBYXYMkJhKIJ4sglCz/BAAV78kFAAn/AeSFFCf5AQAAn4mfiC5SdPpiKBWgDAUA/28ADbAN +FQBYXXUqMhKwqvpiRhWgAgUA0Q8A//qMDaAHBQAV1jaKWGqhbww5EaaZK5KebrR2KZKdBDsKK7K/ +C5kB5JBpZWP9AACcWGWerWAADgAtIEAI3RD84AYV7/niAI9w6zwYKVAEgAD/rOwFp//BAP5IBh3g +DBUA/uAGFaANRQBYZ1DAINEPAPoRIh3v+3oA//mMDaAJBQDAoFmSJopYa6GF//6MDaAJBQDAkMCK +CKg0+KEGFa/+UgAAAABsEASKKo6vGNZg6CYLIUiBAADp5gAleOEAAO8mCClYBIAA/kEmFaAMBQD5 +QeYV75iFAPhAph2gDSUAWGd5wCDRDwAAAGwQBBvWUSoxDCuyfxzWMvhiEBXgFGUA+0PWDeAFBQB8 +oRbqJAAK2ASAAOw0AApoBIAAWN4QwCDRD2iRSGiSKGiUCsBA//9oDaAFBQAAfKHRe6vO2jBY3j3V +oP//EA2gBAUAAAAAAAAA/UDmDaAUZQB7owJgAAHAQNowWN5T//6EDaAFBQDaMFjeZuWkAAUBEYAA +/axcBaAKVQD8YCgV4DsFAFmVRv/95A2gBAUAAAAA//24DaAExQBsEAQpMBPxJrAN4PWFAGiRBMAg +0Q8AhCeEThzWH+0wESJIDwAA/T+GHeAKVQDuMBIiQBMAAP8bph2gOwUAWZUx6zwYIlATAADsMBEl +U/UAAFjedeU7CAJQFwAA7DASJVN5AABY3nHqJAAKWASAAFjf8sAg0Q+EJw8CAIROHNYILTARLUQC +/mJQFaAKVQD+gGYdoDsFAFmVG+s8GCJQCwAA7DARJVMhAABY3l/lOwgCUA8AAOwwEiVSoQAAWN5b +wCDRDwAAbBAE9EBgJeizHQAjVFf6qsYd4EQ1APSqph2gCHUA+KqGHaAJBQD4qmYd4EoFACpUUtEP +AGwQBI84/avQBaAKVQD8YhAV4DsFAP/gaB2h//EAWZT7KTAQ6tXiFIyRAABokllplBKINiKifwmI +EagiKCAFKQqVeYFewCDRDwAAANowWOB8/18ADeAJdQCLp4u+LLKODJ1W/SNAHejsuQDA037QEPtg +QCXgDAUAWOBGwCDRDwAAWN+vwCDRDwCLNiqifwm7EftAAEVwCwUAWN8uwCDRDwAAAADApf2rhAWg +OwUAWZTX+kBoHaALJQBY3ijAINEPAGwQBIguIyw4c4kFwCDRDwAAiy6Is+xEAAroBIAA67zgKVAE +gAALgACMIu0gBS5+7gAAZN/Vji5z6dZj/80AAABsEBYlFheHNSYxDysgB4g04xYaKkgEgACZHP4j +SBXgChUAmh/7q0gFoMhZAPwjZhWhuwEA+iLGFeP+9QD7T8QVoLZ5APoiZhXgd/kA+eOwFexIHQD6 +jwANMDhRAPggBh3vqgEA6hYUJFRWgAAGDEn8IcYVoAAyAAAAAAAAAJ4eLhIXKPE9KBYSL/If/iIG +FefuAQAuFhX1wDwhEgCdAIoi+0BBoJIAnQDw5WAN4A0FAO0WESOASYAA2kBY6Hf0AAId4AYFAC8S +G9pw/gBiHaAMJQDv7DkJ2ASAAFjoX/dAAEMwCPUAdoBV9CFmFaSWHQDjFgokyAUAAPgjBhXgAT4A +AAAqEhJkp2MrEhqLtX22n/oiSBXgDBUA7BYRKlAEgADsEhAo6ASAAFjojGankfwAYh3gBQUACtU6 +ZFd7w2CUG/IhRhXk5h0ALhYYKBIWHtT8HNT949T+HCAEgAD1AAkyEgCdAOoSGCw3AoAAo2YpYp4O +iAoogr/7IEDrogCdACZinQhmAdtg5rQABb15gACPyJsV9+A94JIAnQApMq7q1UYUu3mAAC4yrS2i +ZO3rAQfT/QAA/cA63mIAnQCayP3AOvZiAJ0AjRwsIBTTD63MDAxHLCQU9YA8flIAnQAuEhspEhTx +wMAN4Ag1APkAPYjiAJ0AZFDOihoPAgDIoWRQY+tkAAlQBIAA/ABiHaAdhQBY6ITuEg4teASAAOYS +CyKvmYAAHNUmLRIT+amsBeAKBQCa8przmvSa9elpAg9EAoAA6fYALuiCgADo3QIK9sKAAP+mAA6w +G8UA/eAmFeAKVQBZlCorEhX5YDgpUgCdAMAg7BIYKm8CgACj3SzWndEPAAAAAAAAj8j34DjgkgCd +AOkSGCo3AoAAo2YoYp75ADk74gCdACtinQ5NCi3Svw27Aea0AAW42YAAsP6eyPrAaB3v+xoALxIR +0w9k8HfrEgUpUASAAPwAYh2gHYUAWOhRGdT4FtT1jhsoEAAmYpsJ7gIZ1PQIHxTmhgsP+wKAAOn/ +AgR8oIAALBIQ7RISI1v/AAAosj8rsX2eoJ+hnaKco5uk+UCmFaAAcgAALBIQLRISK2EFiGOeoJ+h +m6KYo52knKUmrBgtEhOMHgLdEO0WBy5kAoAA7BYIK6b+AAAa1In4IWgVoA8FAP4gxhXgDyUAnx0K +iAIoFgnrZAAJUASAAPwAYh2gHYUAWOgmjRkvEhqJFisSGo/18TXQDeP+9QAc1MqLtP9ARhWgj5kA +/UAGFeBviQD9QCYVoN+hAPDQABMwz5EA7tTCHulCgADupgMsQQKAAP0GAAx5uwEA66YELmDCgAAM +ZgIIZgImpgUsEg3pnAElMGEAAOkWBiZj/QAA7BYNLnumAADrZAAJUASAAPwAYh2gHYUAWOgCFtSt +iRePGPohKBXgDQUAnRGdEp0TnRSdpP1AphXv/vUAnqKeo5ugLhIa6f8CCsbCgADo/wIA4DEAAOb/ +AgDYIQAA7RwQJTBhAADvpgEg0BEAAFjmzvlAaB3gDBUA6sk5DSgEgADpFh4lIAmAACQWH/4AIh2g +DQUACe045RYgJurhgAAT1I2IGIwXGtSMKxIbhBsV1IXxeAAUsA4VAOvrOQongoAA9IYACnYPBQAL +rzn9JgAMsA01APkmAAwwDCUAC9w5LBYdCfkCKRYZ+eYAD7AFBQD+I4YV4AMKAAAPVlD+GAAF8M/J +APwhKBXgj7EA/UAGFeDveQDs7hEMRAKAAOvMEA3agoAA7LsCCzPCgAD4xgALMM+BAP2IABYxj2kA +7O4CDEUCgAAI7gIc1F+coSgQAAbuAvvGAA9wb7kA9MgAEzu/AQD3xgAPMAYlAObuAg3dAoAA7qYE +LEICgAALiAKYpRvUV5uiGNRX+UBmFa/5jgCZoZSgnqKeo56knqWdpp2nnaidqS8SHeVcASUwoQAA +/qARnGIAnQDrZAAJUASAAPwAgh2gLYUAWOeX5FBRas7CgAD0oApgkgCdACsSHMfv+yYADPANBQDj +mQIL/S4AAI0TLBIajhKPEYvMLMIQmaGbqfVABhWgCAUAmKKYpp+jnqSdp5yljBT9QQYVr/4mAC0S +GywSGRvUMAyZAuuZAgaEGYAA8OJADe/+9QCZoZSgnqKeo56k/0CmFaANBQCdpp2nnaj9QSYV7/02 +AC8SGiIWISvyFibxOCLxOizyFejxOSs0AoAABiICJvE7LfIb7vIaLEQCgAAIZgIo8hcv8hmfop6j +naScppunmKiWpZmhlKCSqfIkKBWv+/YAAAAAAAAAAPDiQA3v+/UAmaGUoJuim6ObpPtAphXgCAUA +mKaYp5io+UEmFa/7OgAsEhqNEi/BOybBOSjBOC7BOuvCGCs0AoAA5v8CDEQCgAAI7gImwhSIzCzC +EJukmKeWqJmhnaKUoJyjn6WeqYwU/UDGFa/6GgArEhvsEhklg1GAABvT7sfv/SYADLANBQDrmQID +gPGAAJmhlKCeop6jnqSepZ2mnaedqP1BJhXv+TIALhIaIhYhLeISLOITK+IYiO2G7i/iFILvLuIR +nqKdo5ykm6WYppann6mZoZSgkqjyJCgVr/hWACsSHMff+yYADPAMBQDjmQIDgPGAAJmhlKCdop2j +naSdpZymnKecqP1BJhWv95oAmaGUoI4T/iAoFeAIBQCYopijmKSYppinmKifpf9BJhWv9woAKhIa +GdPAiqUT01glEiDkEh8lTDCAAOPTVBODuYAAHNO6ixsMuwL7P0YV7+eiAIUfwNL3rQAK/+gmAMCl +/adoBaAbxQDuThEKaASAAFmStmP4ZwAA+iKIFaAOBQCeEZ4SnhOeFFjl0iQWH+UWICViYYAA+iKI +FaALBQBY5cUkFh/0JAYV7/DaAC8SEGX4lWP4OhrTdYgbCogC+T9GFa/l1gDAoFlQ+sinG9OaK7CA +ZLBaKhIUWOW+6RIeLV9OAAD6IogVoAsVAFjlsvgjyBXv71oAAAD/4CQNoDYFAOsSEipQBIAA7BIQ +KOgEgABY5oFj+FcAACsSGowc7RIXKVAEgABYYQzSoNEPAAAAAPunBAWhSxUAWX9GLBoADKwC+6b6 +BaFLFQBZf0Zj/4UAAMCwwNoN/TTtxggtxVYAAPpAaB2gG8UA/AACHaANFQBYZDhj/6EAAAAAKxIW ++kBoHaAMBQDtEhgl2GEAAFhkMWP/hMCgWY8LHNL8j8j5/8HQkgCdAGP/t9ogW+wBY/hsiieNHMDA +6qwgLtgEgABYWqLSoOsSGCpnAoAAo8wrxp3RDwAAAAAAAP/fpA2gBgUA/+FIDaAFRQDAoFmO9hzS +5o/IHtLj+f/GuJIAnQD/4/ANoAYFAAAAAP/jlA2gCwUAwNoN/TT9gQYV7+OSAAAAAGwQBBTTRoIg +JEJ/E9NFBCIMAyIC0Q8AAGwQDBjTQxrS1hnTQCiAfSqiRimSgwmqEeqZCAR8RIAAJJ0B9JAAFaAA +MgAAACSdAyRMgBnS/ihBK/kACAxiAJ0AGtLr6gAFCMgEgAAJAmEJAmEJAmEJAmEZ0y8Y0wsf0r+O +IJ8S+CDGFaAKRQDpFgAvdgKAAArqApoRKUAHL0Er/aZMBaGZAQDj7gIMzAKAAAn/Agj/Ap8UKyA5 +/iFmFaANJQCdGQy7AusWCCgECoAA9GAEsZIAnQCJRyqZFOSgf2TggQAAjZmLwP/4Ah2gJYUA7s4B +BoIZgABtCC59sTgv0AAp0Ad18S8vwQXu+AgMzwKAAOndCARBAQAA6NsRftAEgADtpAAFAImAAGP/ +ygAA/68ADX//vgD9bwANcAkFAAqdOObUAA6BpgAA6kQACNgEgAD8AIIdoA0lAFhWVdEP//4MDaAN +BQAAACocOvpHQBXgDGUAWYuzY/9cwnaOaPoAoh2gOwUA7NLtG2gEgAD+RzAV4+4BAFmR54poCo9X +d/FtikcuoRX7RAAVr8sFAAurAavr62pwc2kBAADvogAmgYGAAH3xKCzQANMPDwIAdcEdKdAHDJkR +6d0IBcEBAADo2yR+0ASAAO2kAA1+xgAA/e8ADfAKBQALrTjm1AAG+mGAAGP/dgAA/68ADT//cgAs +IDkKDUN9yYiOIAjuEQ4+Ap5r0Q8AAAD/rwAOv/5CAGwQBiggBSwgB8GUDwIA+QAQdWHMAQApIgJl +kcMtMAEb0kbm0kgeOASAAP+hQAbQD6UALiBOZeJX7tJCHk8CgAD1gArSEgCdAKaZKJKenBALywr3 +ABGU0gCdACuyvyqSnQurAesWASWOSYAAiuj3QA64kgCdAChiru3SNBQL+YAALGKtLdJ/7csBBUP9 +AAD9gAteYgCdAJjo/YALZmIAnQApIBSkmQkJRykkFPUgDXXSAJ0AHtIyG9IsjCD4ICgV4AoFACq2 +Mu7MAg5uAoAA/WcGFaAORQAO3QIttjEb0o3ckOsPHg3QBIAADAJnC0CGDAJlCyCGDAJjCwCG7AwA +BNkBAAAK4IYLAm8KwIYLAm0KoIYLAmsKgIYLAmkuMQEoIQktIAcsMAEb0nsqIST8IAAGMN0RAOrd +EA5kAoAADcwCDKoCHdJ1LCEiC6oCKpYgDcwCiyAd0hMoliMuliQsliL9YAAVsAwlAAy7AiuWIYoz +6pYlJMgHAADtABUEymEAAAkAigx4EaaI/xOmFeflAQD5wAa5UgCdAMAg0Q8AAIro90AH4JIAnQAM +eRGmmS2Sngt7Ciuyv/egCGTSAJ0ALZKdC9sBZLEAsK2d6OsWAS305gAA/CAGFaABZgAAAAAAAOok +AAnYBIAA7EQACugEgABYX8fSoNEPAAAAAMCwD6k06eYILfTmAAD6QGgdoBvFAPwAIh2gDRUAWGL8 +Y//BAADqJAAK2ASAAFhhSNKg0Q8AixD6QGgdoAwVAPtjABXgDaUAWGLyY/+XwKBZjcwe0byK6Plf +8PiQD6UAY/+q2iBb6sL/+TQNoA+lAACKJ+tEAApoBIAA+0QAFaAMBQBYWWDSoNEPAAAAAP/3XA2g +CwUAwLgLmwL6QEYV7/0eAAAAAPwgBhWgCgUAWY20HtGliuiMEBvRoflf93iQD6UA//woDaALBQAA +wLAPrTT9wQYV7/vyAABsEAYS0ZsX0hD1o0QFoBOVAPhQyBWgpiUAKiKCf6cgKyKCf7cYKiKELKAI +JaAHdsE3iETAoAuAAAUzDGU/2tEPLSKEKSKHKiKH+WAABPuqgQB6mS8K6jArQkHDwgy7KKuq+paG +Fa/+6gAuoQsu7PgODkPu7Pwi6/0AAP+iAAq//s4AAAAMAgAvIoJ//8Yl0AduW8DccPoAoh2gCwUA +/qAAFzD/BQBZkOIlXPHKWygKcZgRwKFZhk/6ICgV4An1AAlZNpkQCbsM+iAmFeAKBQBZbQKKEApV +DGVf18ChWYZF+g4iHeAKBQBZbPxj/2YAAABsEAYoIAUmIAfnNAAK2ASAAPgCgh3gBTUA+QAPnWFm +AQALCEdoghSKIhjRUhfRVeRkAAUDyYAAwCDRDwArIh1lseGIJ4OI+wKkFe/MBQDpggskcIEAAAzs +Aey7CAp/AoAA7BYAJdkBAADzIA38YgCdAC2JFKP6r90thRT7YA3rogCdAMl1yUPZMG1JBQcAhgkC +YYrgDwIADwIAr6r7QBCsYgCdAPvABhWv/f4A7GoRAyTxAAAHqggrop4PAgD3YArZ0gCdACqinQhr +CiuyvwuqAWWgT+tsGClQBIAA/AAiHaANNQBYYljAINEPABvRJIm49yAMoJIAnQAMShEHqggsop73 +gA0B0gCdACqinQhMCizCvwyqAeShjmTr/QAALbYIZK+vGdE6maCIIP+jGAXgCxUA66YCLEYCgAAF +iAKYoYgzL/J//6JKBaiIHQCo/5+j7gAVBUhBAAD/ojIF4AgFALGI6YMeDA/oAACfphnRfPlBBhXg +GAUAmKeOIAjuEQXuAp6pDE0Rp90l1p2OIiwgBoknC+4C69FzFmAFAADsJAYkyIEAAIiR/SCCFe/M +BQAMnAHuJgIkQ0EAAOiWASbowQAA7ZUEJmEBAAB8iyIqkQUd0P2oqJiRnYCMIOuGAi5mAoAABcwC +/QAmFaACBQDRDx3Q9Z2AjCAb0VvrhgIuZgKAAAXMAv0AJhWgAgUA0Q/aIFhgXdKg0Q8AAAD/+sQN +oAoFAFv/OmP+FwAA8yBoHeAOBQD/AWYVr/e+AOO6DAOBuYAACksU7LwIK8AEgADsTDYJyASAANMP +bckFCACGCQJhiRCqeOtNDATJAQAAbdkFCCCGCQJjixAK/Aysuyu8QPvABhXv9ooAwKBZjMsb0LuJ +uBjQuPk/8viSAJ0A//n8DaAKBQDAoMDaDZ00/WEGFe/5wgCPEC/8QP/ABhXv9aYAAABsEAyIJ/hA +SBXvygUA64EVKmcCgADsPAgEQIEAAAqIAai46IxALngEgAD5gCQSogCdAC3wBysgBxbQoezc/i+o +BIAA+6BgFeH7AQDkkAlvxwKAAMAg0Q8A5o0IBsgZAAAo0p4e0JXrFgEv0ASAAPkAIjPiAJ0AG9CO +KdKdC/sKK7K/C5kB55QABKG5gAAt4ggqFgz3oCJIkgCdAC9iruvRARee4YAALmKtL7LkD+gB6BYJ +Jsv9AAD/wB4+YgCdABjQfpmI/8AeZmIAnQAtIBQpUAetmfohhhWnmQEAKSQU9SAg7dIAnQAZ0MEf +0O/qIgAtbwKAAIg0HtCB5t0IDVYCgADxAAUCUgCdACggByshJPygJBWgFIUAlHP+4EYVoAQ1AASj +AvuhGAWgiBEA43YBLEKCgAD5BgAMcAMFAPjgBhWgCCUA6gAFA9BBAABtigIKAmEuIQkpIAfy4KYV +4DilAOx2CS91AoAA+cYADzHJAQDudgYuZAKAAAy8Ag/MApx0KyEJ2iD+oCQVoAwFAOTWnS3dAoAA ++WYADbANBQBYX7jAINEPAIYnKGEV6BYDIzCBAAD2IMYVr8kFAAlmAaaI71wgJEEBAAB48wSIEwj/ +DOnyACZABQAACKgCmBf4+AAE8IgVAHiZHB/QsYgX6HYBJkv9AAD+4AYV4ZkdAPjgRhXgAFIAiRcY +0KqYcJlxifEJWRSZco8WiTYb0KaWEPngpBWimR0AC5kBG9CemBSmiCuyHe/yASRBAQAAKBYKCbsI +63YDIkgJAADr0JYczwKAAAn/CCkWCAxJCOYSCCTICQAA6PMKfM8CgAAoEgQI/wzmmQwDwEEAAOSQ +TG43AoAAmBWIGg9pCPkADuriAJ0AKRIFD4oM+iBGFaSqHQBtqQUPAIYJAmGIEikSAArPDAeICOmc +QCRQQQAAbfkFCSCGCgJjKiIACKoRGNB59uAARLAPFQD/IMYV4AxFAAyqApqVmJSIUy+yGxbQdP2g +FgWoiB0AqP+fl/wAChWgCgUA7NBwFNiBAACxquuDHg0P6AAA/yFGFaAoBQCYm480iFOKNQb/ARbQ +ZuyqAQxCQoAACP8CBv8Cn5woUAkrUAsvUAomUAjs0GAd2QKAAOb/EAxDAoAA+wYADDCmMQDr/wIN +UcKAAAr/Agj/Aoo2GM//n53+YUgV5bYdAOyqAQ3YQoAAC6oC+yHGFaRmAQDo/wELMgKAAAb/AohV +mJ+GViaWEIxXL5YSLJYRi1QrlhMqUAEvUQHr0A4YBAqAAPFABDfSAJ0AKiAHCipA7CEkLVKCgAAL +qgIqlhSIIPoDAh3gCjUA65YXLEYCgAAKiAIaz9v/IsYVoAsFAPkiphWgCCUA6gAFBNGBAABtigIK +AmEoIQkuIAf7AAAUMBqlAAqIAiiWGvmgRAWh7gEAAO4RDs4CCO4CiBErlhkvlh3ulhgkQA0AACgW +AY4RLtadLVAHiif1oABGsAwFAOvUAAVQgQAAWFdG0qDRDwAAAADpEgUmcuGAANMPbckFD0CGCQJl +Y/5DwPCfGYgZH8+NwJoJ2TTp9ggsYeYAAPpAaB2gG8UA/AAiHaANFQBYYLfAINEPAAAAAAD7jwAP +/+36AP/vJA2gCQUAjRHr/BgpUASAAP2gYBXgDBUAWGCswCDRDwAAAAAAAAD8IWYVoAoFAFmLgh7P +c43oihyMG/m/3RiSAJ0AY/+UAJwb6xIJKVAEgABb6HWKHPwhaBWv71IAAGwQBikgBSYgB9gw9gBi +HeAaRQD7IA/NIWYBAAUJR/0jAAFfxQUAiyIZz1wTz17kZAAFg7GAAMAg0Q+IJ4uILoEV6YILJHiB +AAAF+gHq7ggKbwKAAOoWACdxAQAA+yAORGIAnQAsiRSdEavarcwshRT7wA4jogCdAMk0yULZsG1J +BQMAhgkCYSwSASryAAyqCP9AESQiAJ0AmvDTsPhgaB2v/hoAAAAAAOxqEQMk/QAAA6oILaKeCWsK +K7K/96ALAdIAnQAqop0PAgALqgFloE/rbBgpUASAAPwAIh2gDTUAWGBiwCDRDwAAAAAdzy2L2JgS +92AMkJIAnQAMShGjqiyinveADRHSAJ0AKqKdCUwKLMK/DKoBZKGQsL6e2GSvrx7PRJ6gjSD9nywF +oAsVAOumAi7uAoAAB90CnaGJgyjCf/+eXgXomR0AqYiYo+8AFQVIQQAA/55GBeAIBQCxiOmDHgwP +6AAAn6YZz4b5QQYV4BgFAJinjiAI7hEH7gKeqekiBypvAoAAo90n1p0sIAbtIgIkyIEAAOWfAQZg +BQAALCQGiJEsmQQL3QLtJgIkQ0EAAOiWASZgwQAA7JUEJ/kBAAD/BTIN4AwFACqRBR3PB6iomJGd +gIsg7IYCLd4CgAAHuwL7ACYV4AIFANEPAAAdzv+dgIsgwMDshgIt3gKAAAe7AvsAJhXgAgUA0Q8A +AOokAArYBIAAWF5k0qDRDwD/+qQNoAoFAPMgaB3gDgUA/wFmFa/5ogDr6gwBgbmAAApNFOzcCCnA +BIAA7Ew2DcgEgADTD23JBQgAhgkCYYkQqjjtTgwEyQEAAG3pBQgghgkCY40RjBAK3QytzCzMQP3g +BhWv+F4AAMCgWYrUHc7Ei9iIEhnOwfl/8viSAJ0A//noDaAKBQAAwKDA6g6+NP+hBhWv+aoAAIgQ +KIxA+eAGFa/3ZgAAAABsEAQVzsQWzr7wiAATsAlFAOTPJRnGAoAACYgCKGYxBTUC52YyKhgEgADl +ZjgpMASAAANghgYCZwNAhgYCZQMghgYCYwMAhuYMAAEZAQAAIi0B5B8eARIBAAADAm8EwIYDAm0E +oIYDAmsEgIYDAmnRDwAAAGwQBiMgBxTOmAMDQerOlBnPAoAApJkokp76YAEGMAU1AOzCvywZHAAA +K5KdDLsBy7kfzxAdzxD6QAgVoA4FAJ4QnhL8ICYV4AwFAPwAoh3gHuUAWFqCDD8RpP/186YV4AIF +ANEPAAAAAAAAAOs8GClQBIAA/AAiHaANNQBYX6zHJNEPAGwQBiggcPWc7gXgBkUA6s5yFHXkgAAj +IAcDA0EMOREFmQgrkp4kIgAKOgrqor8toYQAACiSndMPCooBZKBR20BY+IvAwfwAAh3gDhUA+Z3S +BaAJBQD4ICYV4A8FAOkWAi1YBIAA6BYAKlAEgABYWloMPBGlzCbGnSogcCsK+wuqAfpOBh2gAgUA +0Q/AINEPAOs8GClQBIAA/AAiHaANRQBYX4LHJNEPAGwQBCMgBxTOURXOTPuckgWhMwEA5EJ/Kc8C +gAClmSiSngo6Ciqiv+NECAwRVAAAKJKdDwIACooBZKBE20D8AAIdoA0lAP4AQh2gHwUAWYv7/52A +BaAIFQDupgAqfgKAAAj/Ap+hjSCdogw8EfWAAEZwCyUA+5OmFeACBQDRDwAA6zwYKVAEgAD8ACId +oA0lAFhfXMck0Q8AbBAULzAQ95xOBeAKdQDz5PAN4AYFAPXgRXCSAJ0AaPIDwCDRDysgB/ogphWn +lQEA+CNmFeG7AQDrFhwslGgAACwgBfeAYIxSAJ0ALSBy86BgN5IAnQDaIFhcXftAQoiSAJ0AjiL7 +wEI4kgCdACoiECwhGog1iynoFg0uf8KAAHj7DwsJQsiZDAtC+2BaEBIAnQCOHfwjiBWgH4UA7BYZ +J2hdAAD73gAPtN0dAO0WCCboDQAAnRqdGfWAT4ISAJ0ADMsRp7sosp63SfkAYpPiAJ0AHc3xK7Kd +DcwKLMK/DLsB+2Bf6BIAnQCMKY4qDA8+LxYXDO4Mf+t3KiAiKSAjCpkM+yBh2BIAnQAoIAcazmv9 +WgAV4YgBAA2ICS6B/gnvNg/uDC6F/i0gIq/dDQ1HLSQi+6BhKBIAnQAoon/uIgsmy/0AAPsABADQ +CBUA4JkaDEAKgADp7ggEQ/0AAAjuAi4mCigSFwzpDPkgX8OiAJ0AiRoezlMsIAcoIQcdzcz+QSQV +4MwRAPWQABY6iAEA7cwCDEMCgAAI/wItISScsIogiB0czdHu3QINVgKAAAqZApmxKiEinbSfswyq +AhzOQZqyKSIQihWZtRnOP/xHEBXgDyUAn7mWt/lhBhWgDhUAnrr8AwAG8E51AA3qOQ3JOQqZAooY +5rYLIcBBAADptgYlyMEAAG2pBQgAhgkCYR7NtZ68jTDzoELSkgCdACoSGekSCS1XAoAAp6oppp0o +IBQvEhekiOgkFCeAwYAALRIXjCkrIDitzJwp82BWP5IAnQAuEhv5wFUZUgCdAMAg0Q8ALiAHLyAF +LTARDg5BLhYc+eAxZFDdOQCPItzg/8AAFbAZxQDnuwgIBAqAAPvgTICSAJ0ALRYWKLKeKhYFLBYZ ++QBN4+IAnQAazXwpsp0PAgAK6goqor8KmQEpFg7pFhooBAqAAPsgTQgSAJ0A+kBoHaALRQBZiZL7 +QE1gUAsVABzNcIzI94BNqJIAnQAtcq4ezffTD/egSf1SAJ0AKnKtLeLMGc1n0w8NrwHvFhUmQ/0A +AP1ATa5iAJ0AmJj9QEkOYgCdACkwFCkkOCgwFSgkOSYkO484jjaNOYw6iTyKOyolJSwlJC0lIy4l +Ii8lCSkkTIg9KCRNLzIQLjIRLiYVJiRxJiRyJiRwKyRzJiYdKyYZKyYYKyYXJiYbJiRPJiROKyUp +LyUoLTARKhIFLiEaDQ1DLSQ6/0Av8KIAnQAtIDgq+vz7wAQFMA8lAA/cAe/QHXVTsQAA/wAAB7AJ +FQD/LQAP+Y4dAAj/CA7/EQ+qDP+bgAWgCRUA/S0ADjAIRQAI2AEK7ywImDkK7i4OnjkZzYvv7ggL +eASAAAifORjNTd1gDI05D90CKCAUDq8c7yU0JUvxAAAOnhykjO4lNSzMAoAA6dkCDXQCgAAO3QIu +EhYpJhAsJBTtJg8nLSmAABrNZS8gB40pnSyOPp4f/iHIFaCfEQDoIQgsyoKAAAqZApng+Zs4BeH/ +AQDqIgAv/AKAAA+IAvkGAAxwDzUA6akCDVYCgAAPqgKa4f+aLAXgKgUAmuPv5gIuUgKAAAuqAo8r +luUo5gQp5gYq5gcv5gnt5ggneMEAAP4jRhXgHUUA/CCGFeAKBQD6IgYVoBmFACkWGCYkFCsSGvph +6BWgDBUA+iImFaANBQD6QAgVoAkFAPggBhXgDgUA+CBGFeAIFQD4ICYVoA8VAFhY4ywgOPrAaB3g +HwUA8iPmFeANJQD9gAQB8OwRAO7bOQtIBIAA8+0ADPDsGQD7xgAPcMwBAPLAaB3gKwUADLM5KyA5 +6GQAC3gEgAD4ZgAJ8EkFAP1gBAbwuwEA+yIAD/CMBQDtyDgNWASAAPpACBWgDQUAnREczVacEAj/ +AgP/AvIj6BXgDQUA/8YAD3AMFQD/wAAXMA9FAP/GAA9wDwUA/iBGFaAOBQBYWLnAwe/NSR1YBIAA ++kAIFaQJBQD4IAYV4A0FAPggRhXgCAUA+CAmFaAOFQBYWK4oEhHpEg8tWASAAPpACBWv/vUAnhD8 +RKQV7//1APxEhBWomQEA+zgAFLiIAQDpiAIO7AKAAP2GAA5wHqUA+CBGFaANBQD8ICYVoAwVAFhY +mgqrAvpACBWv/fUA/CAGFeAMBQAsFgEpISIoIQkuChz5IAAUv//1APkGAAxwDBUA+CBGFaANBQBY +WIsqFhIqIShZivntzRYdYASAAPpACBWv/vUAnhAuEhAt0CwbzRXu3QIGY/0AAOLpEA7oQoAA7ZkC +DmZCgAAMmQILmQKZESgiFRnNDP//4h3gHuUA+iJIFeaIHQD5BgAMcA0FAPggRhWgDBUAWFhw+0Bo +HeAMFQD6QAgVoAgFAPggBhWgDQUA+CAmFaAOBQD4IEYVoA8VAFhYZYkw8yAVepIAnQAuEhkbzGgs +IQftEhgvdwKAAKfuLeadKCANK7I4HczojyCOICkgDCrS+g67CO4gFS3eQoAAC6oIKhYTKyAHK6QH +KaQMLKUHKKQNLDIJLKUJLqQVLjIR+GIIFa/MAQAsFhQopSgspSP9oIgV4AkVAPlFJB3gG0UAK6QF +/0PGFebuHQD6IqgV4P/1AP+gAEawDgUA/ULGFeANFQBY9m4rEhMvEhYoEhQpsBX3YoYdoCsFAOuk +AyxGAoAA5qQALMkCgAD5BgAMcAkVAAmIAuimASeUIYAALCA6wN/9gBP8YgCdAC8wV8TgD+4MnhvA +0f4f4h3gDgUA7CEJJVhBAADsFgwpUASAAFj2U4kcixsmJBQoIBUmpAArpAPomREMQQKAAPkGAAxw +CRUACYgC+UAmFaALxQCKJxzMP4quiRQMAIcKAmEKAmEKAmEKAmEKAmEKAmEKAmEKAmEtEhYrdq34 +QKYd4A4VAO4kFyaBWYAALyA6wI948R4ZzB4oMFAJiAooghDsMFch2UEAAPpAaB2gDSUAC4AABQpH *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 25 10:17:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 224323F8; Wed, 25 Jun 2014 10:17: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 0E9EB24A5; Wed, 25 Jun 2014 10:17: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 s5PAH0UE030883; Wed, 25 Jun 2014 10:17:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PAH0VG030882; Wed, 25 Jun 2014 10:17:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406251017.s5PAH0VG030882@svn.freebsd.org> From: Marius Strobl Date: Wed, 25 Jun 2014 10:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267860 - stable/10/sys/geom/eli X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 10:17:01 -0000 Author: marius Date: Wed Jun 25 10:17:00 2014 New Revision: 267860 URL: http://svnweb.freebsd.org/changeset/base/267860 Log: MFC: r267145 Fix the keyfile being cleared prematurely after r259428 (MFCed to stable/10 in r266749). PR: 185084 Submitted by: fk@fabiankeil.de Reviewed by: pjd Modified: stable/10/sys/geom/eli/g_eli.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/eli/g_eli.c ============================================================================== --- stable/10/sys/geom/eli/g_eli.c Wed Jun 25 10:01:02 2014 (r267859) +++ stable/10/sys/geom/eli/g_eli.c Wed Jun 25 10:17:00 2014 (r267860) @@ -990,7 +990,6 @@ g_eli_keyfiles_load(struct hmac_ctx *ctx G_ELI_DEBUG(1, "Loaded keyfile %s for %s (type: %s).", file, provider, name); g_eli_crypto_hmac_update(ctx, data, size); - bzero(data, size); } } @@ -1140,6 +1139,7 @@ g_eli_taste(struct g_class *mp, struct g g_eli_keyfiles_clear(pp->name); return (NULL); } + g_eli_keyfiles_clear(pp->name); G_ELI_DEBUG(1, "Using Master Key %u for %s.", nkey, pp->name); break; } From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 25 13:33:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 64A91636; Wed, 25 Jun 2014 13:33: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 509F42878; Wed, 25 Jun 2014 13:33: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 s5PDXW48024916; Wed, 25 Jun 2014 13:33:32 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PDXWZ5024915; Wed, 25 Jun 2014 13:33:32 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201406251333.s5PDXWZ5024915@svn.freebsd.org> From: Cy Schubert Date: Wed, 25 Jun 2014 13:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267868 - stable/10/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 13:33:32 -0000 Author: cy Date: Wed Jun 25 13:33:31 2014 New Revision: 267868 URL: http://svnweb.freebsd.org/changeset/base/267868 Log: MFC r267634: Fix case where fastroute or "to interface" is used with incorrect FIB. PR: 183065 Submitted by: p-freebsd-bugs@ziemba.us Approved by: glebius (mentor) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jun 25 12:32:41 2014 (r267867) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jun 25 13:33:31 2014 (r267868) @@ -787,7 +787,7 @@ ipf_fastroute(m0, mpp, fin, fdp) dst->sin_addr = fdp->fd_ip; dst->sin_len = sizeof(*dst); - in_rtalloc(ro, 0); + in_rtalloc(ro, M_GETFIB(m0)); if ((ifp == NULL) && (ro->ro_rt != NULL)) ifp = ro->ro_rt->rt_ifp; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 25 17:10:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 456A9EB5; Wed, 25 Jun 2014 17:10: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 31CD42E9D; Wed, 25 Jun 2014 17:10: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 s5PHAQA9026355; Wed, 25 Jun 2014 17:10:26 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PHAQ31026354; Wed, 25 Jun 2014 17:10:26 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201406251710.s5PHAQ31026354@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 25 Jun 2014 17:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267874 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 17:10:27 -0000 Author: ume Date: Wed Jun 25 17:10:26 2014 New Revision: 267874 URL: http://svnweb.freebsd.org/changeset/base/267874 Log: MFC r267616, 267640: Retooling addrconfig() to exclude addresses on loopback interfaces when looking for configured addresses. This change is based upon the code from the submitter, and made following changes: - Exclude addresses assigned on interfaces which are down, like NetBSD does. - Exclude addresses assigned on interfaces which are ifdisabled. Use SOCK_CLOEXEC. PR: 190824 Submitted by: Justin McOmie Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Wed Jun 25 17:02:01 2014 (r267873) +++ stable/10/lib/libc/net/getaddrinfo.c Wed Jun 25 17:10:26 2014 (r267874) @@ -62,12 +62,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #ifdef INET6 #include #include #include -#include /* XXX */ +#include +#include #endif #include #include @@ -245,6 +248,9 @@ static int get_portmatch(const struct ad static int get_port(struct addrinfo *, const char *, int); static const struct afd *find_afd(int); static int addrconfig(struct addrinfo *); +#ifdef INET6 +static int is_ifdisabled(char *); +#endif static void set_source(struct ai_order *, struct policyhead *); static int comp_dst(const void *, const void *); #ifdef INET6 @@ -1525,10 +1531,11 @@ find_afd(int af) } /* - * post-2553: AI_ADDRCONFIG check. if we use getipnodeby* as backend, backend - * will take care of it. - * the semantics of AI_ADDRCONFIG is not defined well. we are not sure - * if the code is right or not. + * post-2553: AI_ADDRCONFIG check. Determines which address families are + * configured on the local system and correlates with pai->ai_family value. + * If an address family is not configured on the system, it will not be + * queried for. For this purpose, loopback addresses are not considered + * configured addresses. * * XXX PF_UNSPEC -> PF_INET6 + PF_INET mapping needs to be in sync with * _dns_getaddrinfo. @@ -1536,38 +1543,64 @@ find_afd(int af) static int addrconfig(struct addrinfo *pai) { - int s, af; + struct ifaddrs *ifaddrs, *ifa; + int seen_inet = 0, seen_inet6 = 0; - /* - * TODO: - * Note that implementation dependent test for address - * configuration should be done everytime called - * (or apropriate interval), - * because addresses will be dynamically assigned or deleted. - */ - af = pai->ai_family; - if (af == AF_UNSPEC) { - if ((s = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) - af = AF_INET; - else { - _close(s); - if ((s = _socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, - 0)) < 0) - af = AF_INET6; - else - _close(s); + if (getifaddrs(&ifaddrs) != 0) + return 0; + + for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { + if (ifa->ifa_addr == NULL || (ifa->ifa_flags & IFF_UP) == 0) + continue; + if ((ifa->ifa_flags & IFT_LOOP) != 0) + continue; + switch (ifa->ifa_addr->sa_family) { + case AF_INET: + seen_inet = 1; + break; +#ifdef INET6 + case AF_INET6: + if (!seen_inet6 && !is_ifdisabled(ifa->ifa_name)) + seen_inet6 = 1; + break; +#endif } } - if (af != AF_UNSPEC) { - if ((s = _socket(af, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) - return 0; - _close(s); + freeifaddrs(ifaddrs); + + switch(pai->ai_family) { + case AF_INET6: + return seen_inet6; + case AF_INET: + return seen_inet; + case AF_UNSPEC: + if (seen_inet == seen_inet6) + return seen_inet; + pai->ai_family = seen_inet ? AF_INET : AF_INET6; + return 1; } - pai->ai_family = af; return 1; } #ifdef INET6 +static int +is_ifdisabled(char *name) +{ + struct in6_ndireq nd; + int fd; + + if ((fd = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) + return -1; + memset(&nd, 0, sizeof(nd)); + strlcpy(nd.ifname, name, sizeof(nd.ifname)); + if (_ioctl(fd, SIOCGIFINFO_IN6, &nd) < 0) { + _close(fd); + return -1; + } + _close(fd); + return ((nd.ndi.flags & ND6_IFF_IFDISABLED) != 0); +} + /* convert a string to a scope identifier. XXX: IPv6 specific */ static int ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, u_int32_t *scopeid) From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 25 18:00:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E1B7FEB8; Wed, 25 Jun 2014 18:00:51 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (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 79F2C23BE; Wed, 25 Jun 2014 18:00:51 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1WznZQ-000D8c-8J; Wed, 25 Jun 2014 17:49:04 +0400 Message-ID: <53AB0E0C.3050802@FreeBSD.org> Date: Wed, 25 Jun 2014 21:59:40 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Hajimu UMEMOTO , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r267874 - stable/10/lib/libc/net References: <201406251710.s5PHAQ31026354@svn.freebsd.org> In-Reply-To: <201406251710.s5PHAQ31026354@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 18:00:52 -0000 On 25.06.2014 21:10, Hajimu UMEMOTO wrote: > Author: ume > Date: Wed Jun 25 17:10:26 2014 > New Revision: 267874 > URL: http://svnweb.freebsd.org/changeset/base/267874 > > Log: > MFC r267616, 267640: > > Retooling addrconfig() to exclude addresses on loopback interfaces > when looking for configured addresses. > This change is based upon the code from the submitter, and made > following changes: > - Exclude addresses assigned on interfaces which are down, like NetBSD > does. > - Exclude addresses assigned on interfaces which are ifdisabled. > > Use SOCK_CLOEXEC. > > PR: 190824 > Submitted by: Justin McOmie > > Modified: > stable/10/lib/libc/net/getaddrinfo.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/lib/libc/net/getaddrinfo.c > ============================================================================== > --- stable/10/lib/libc/net/getaddrinfo.c Wed Jun 25 17:02:01 2014 (r267873) > +++ stable/10/lib/libc/net/getaddrinfo.c Wed Jun 25 17:10:26 2014 (r267874) > @@ -62,12 +62,15 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > #include > #ifdef INET6 > #include > #include > #include > -#include /* XXX */ > +#include > +#include > #endif > #include > #include > @@ -245,6 +248,9 @@ static int get_portmatch(const struct ad > static int get_port(struct addrinfo *, const char *, int); > static const struct afd *find_afd(int); > static int addrconfig(struct addrinfo *); > +#ifdef INET6 > +static int is_ifdisabled(char *); > +#endif > static void set_source(struct ai_order *, struct policyhead *); > static int comp_dst(const void *, const void *); > #ifdef INET6 > @@ -1525,10 +1531,11 @@ find_afd(int af) > } > > /* > - * post-2553: AI_ADDRCONFIG check. if we use getipnodeby* as backend, backend > - * will take care of it. > - * the semantics of AI_ADDRCONFIG is not defined well. we are not sure > - * if the code is right or not. > + * post-2553: AI_ADDRCONFIG check. Determines which address families are RFC 2553 is obsoleted by RFC 3493. > + * configured on the local system and correlates with pai->ai_family value. > + * If an address family is not configured on the system, it will not be > + * queried for. For this purpose, loopback addresses are not considered > + * configured addresses. > * > * XXX PF_UNSPEC -> PF_INET6 + PF_INET mapping needs to be in sync with > * _dns_getaddrinfo. > @@ -1536,38 +1543,64 @@ find_afd(int af) > static int > addrconfig(struct addrinfo *pai) > { > - int s, af; > + struct ifaddrs *ifaddrs, *ifa; > + int seen_inet = 0, seen_inet6 = 0; > > - /* > - * TODO: > - * Note that implementation dependent test for address > - * configuration should be done everytime called > - * (or apropriate interval), > - * because addresses will be dynamically assigned or deleted. > - */ > - af = pai->ai_family; > - if (af == AF_UNSPEC) { > - if ((s = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) > - af = AF_INET; > - else { > - _close(s); > - if ((s = _socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, > - 0)) < 0) > - af = AF_INET6; > - else > - _close(s); > + if (getifaddrs(&ifaddrs) != 0) > + return 0; Well, two socket() calls has some predictable cost, but getaddrinfo() can be quite slow for system with many interfaces. It would be better to introduce some kernel sysctls to report IPv4/IPv6 status... It looks like style(9) needs to be altered, too.. > + > + for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { > + if (ifa->ifa_addr == NULL || (ifa->ifa_flags & IFF_UP) == 0) > + continue; > + if ((ifa->ifa_flags & IFT_LOOP) != 0) > + continue; This is not correct. RFC 3493 talks about "loopback address" (and specifies explicit IN6_IS_ADDR_LOOPBACK macro to test in IPv6 case) and not about loopback interface. > + switch (ifa->ifa_addr->sa_family) { > + case AF_INET: > + seen_inet = 1; > + break; > +#ifdef INET6 > + case AF_INET6: > + if (!seen_inet6 && !is_ifdisabled(ifa->ifa_name)) > + seen_inet6 = 1; > + break; > +#endif > } > } > - if (af != AF_UNSPEC) { > - if ((s = _socket(af, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) > - return 0; > - _close(s); > + freeifaddrs(ifaddrs); > + > + switch(pai->ai_family) { > + case AF_INET6: > + return seen_inet6; > + case AF_INET: > + return seen_inet; > + case AF_UNSPEC: > + if (seen_inet == seen_inet6) > + return seen_inet; > + pai->ai_family = seen_inet ? AF_INET : AF_INET6; > + return 1; > } > - pai->ai_family = af; > return 1; > } > > #ifdef INET6 > +static int > +is_ifdisabled(char *name) > +{ > + struct in6_ndireq nd; > + int fd; > + > + if ((fd = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) > + return -1; > + memset(&nd, 0, sizeof(nd)); > + strlcpy(nd.ifname, name, sizeof(nd.ifname)); > + if (_ioctl(fd, SIOCGIFINFO_IN6, &nd) < 0) { > + _close(fd); > + return -1; > + } > + _close(fd); > + return ((nd.ndi.flags & ND6_IFF_IFDISABLED) != 0); > +} > + > /* convert a string to a scope identifier. XXX: IPv6 specific */ > static int > ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, u_int32_t *scopeid) > > From owner-svn-src-stable-10@FreeBSD.ORG Wed Jun 25 18:59:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 05444B31; Wed, 25 Jun 2014 18:59: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 E67A9295B; Wed, 25 Jun 2014 18:59:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PIxh0S078213; Wed, 25 Jun 2014 18:59:43 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PIxhSN078212; Wed, 25 Jun 2014 18:59:43 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406251859.s5PIxhSN078212@svn.freebsd.org> From: Glen Barber Date: Wed, 25 Jun 2014 18:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267878 - stable/10/usr.bin/grep X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 18:59:44 -0000 Author: gjb Date: Wed Jun 25 18:59:43 2014 New Revision: 267878 URL: http://svnweb.freebsd.org/changeset/base/267878 Log: MFC r267693: Fix a bug in bsdgrep(1) where patterns are not correctly detected. Certain criteria must be met for this bug to show up: * the -w flag is specified, and * neither -o or --color are specified, and * the pattern is part of another word in the line, and * the other word that contains the pattern occurs first PR: 181973 Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/grep/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/grep/util.c ============================================================================== --- stable/10/usr.bin/grep/util.c Wed Jun 25 17:54:36 2014 (r267877) +++ stable/10/usr.bin/grep/util.c Wed Jun 25 18:59:43 2014 (r267878) @@ -336,7 +336,7 @@ procline(struct str *l, int nottext) } /* One pass if we are not recording matches */ - if ((color == NULL && !oflag) || qflag || lflag) + if (!wflag && ((color == NULL && !oflag) || qflag || lflag)) break; if (st == (size_t)pmatch.rm_so) From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 26 08:24:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 042A5C28; Thu, 26 Jun 2014 08:24: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 E51F12CB8; Thu, 26 Jun 2014 08:24: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 s5Q8OIar050464; Thu, 26 Jun 2014 08:24:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q8OIbc050463; Thu, 26 Jun 2014 08:24:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406260824.s5Q8OIbc050463@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Jun 2014 08:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267899 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2014 08:24:19 -0000 Author: kib Date: Thu Jun 26 08:24:18 2014 New Revision: 267899 URL: http://svnweb.freebsd.org/changeset/base/267899 Log: MFC r267766: Use correct names for the flags. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Thu Jun 26 07:06:43 2014 (r267898) +++ stable/10/sys/vm/vm_map.c Thu Jun 26 08:24:18 2014 (r267899) @@ -1210,7 +1210,7 @@ charged: } else if ((prev_entry != &map->header) && (prev_entry->eflags == protoeflags) && - (cow & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) == 0 && + (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && (prev_entry->end == start) && (prev_entry->wired_count == 0) && (prev_entry->cred == cred || From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 26 08:27:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 02C4BDD5; Thu, 26 Jun 2014 08:27: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 E3B552CDE; Thu, 26 Jun 2014 08:27: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 s5Q8R1pd050933; Thu, 26 Jun 2014 08:27:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q8R16h050932; Thu, 26 Jun 2014 08:27:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406260827.s5Q8R16h050932@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Jun 2014 08:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267900 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2014 08:27:02 -0000 Author: kib Date: Thu Jun 26 08:27:01 2014 New Revision: 267900 URL: http://svnweb.freebsd.org/changeset/base/267900 Log: MFC r267629: Tidy up code of the wrapper. Modified: stable/10/lib/libc/sys/mmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/mmap.c ============================================================================== --- stable/10/lib/libc/sys/mmap.c Thu Jun 26 08:24:18 2014 (r267899) +++ stable/10/lib/libc/sys/mmap.c Thu Jun 26 08:27:01 2014 (r267900) @@ -44,18 +44,13 @@ __FBSDID("$FreeBSD$"); * is not supplied by GCC 1.X but is supplied by GCC 2.X. */ void * -mmap(addr, len, prot, flags, fd, offset) - void * addr; - size_t len; - int prot; - int flags; - int fd; - off_t offset; +mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset) { - if (__getosreldate() >= 700051) + if (__getosreldate() >= 700051) { return (__sys_mmap(addr, len, prot, flags, fd, offset)); - else - - return (__sys_freebsd6_mmap(addr, len, prot, flags, fd, 0, offset)); + } else { + return (__sys_freebsd6_mmap(addr, len, prot, flags, fd, 0, + offset)); + } } From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 26 08:30:09 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EA47FFB3; Thu, 26 Jun 2014 08:30: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 CC7E52CF5; Thu, 26 Jun 2014 08:30: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 s5Q8U9tc051885; Thu, 26 Jun 2014 08:30:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q8U8mD051880; Thu, 26 Jun 2014 08:30:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406260830.s5Q8U8mD051880@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Jun 2014 08:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267901 - in stable/10: lib/libc/sys sys/sys sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2014 08:30:10 -0000 Author: kib Date: Thu Jun 26 08:30:08 2014 New Revision: 267901 URL: http://svnweb.freebsd.org/changeset/base/267901 Log: MFC r267630: Add MAP_EXCL flag for mmap(2). Modified: stable/10/lib/libc/sys/mmap.2 stable/10/sys/sys/mman.h stable/10/sys/vm/vm_map.c stable/10/sys/vm/vm_map.h stable/10/sys/vm/vm_mmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/mmap.2 ============================================================================== --- stable/10/lib/libc/sys/mmap.2 Thu Jun 26 08:27:01 2014 (r267900) +++ stable/10/lib/libc/sys/mmap.2 Thu Jun 26 08:30:08 2014 (r267901) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd September 9, 2013 +.Dd June 19, 2014 .Dt MMAP 2 .Os .Sh NAME @@ -141,6 +141,12 @@ argument must be 0. This flag is identical to .Dv MAP_ANON and is provided for compatibility. +.It Dv MAP_EXCL +This flag can only be used in combination with +.Dv MAP_FIXED . +Please see the definition of +.Dv MAP_FIXED +for the description of its effect. .It Dv MAP_FIXED Do not permit the system to select a different address than the one specified. @@ -152,17 +158,21 @@ If is specified, .Fa addr must be a multiple of the pagesize. -If a +If +.Dv MAP_EXCL +is not specified, a successfull .Dv MAP_FIXED -request is successful, the mapping established by -.Fn mmap -replaces any previous mappings for the process' pages in the range from +request replaces any previous mappings for the process' +pages in the range from .Fa addr to .Fa addr + .Fa len . -Use of this option is discouraged. +In contrast, if +.Dv MAP_EXCL +is specified, the request will fail if a mapping +already exists within the range. .It Dv MAP_HASSEMAPHORE Notify the kernel that the region may contain semaphores and that special handling may be necessary. @@ -393,6 +403,17 @@ argument was not -1. was specified and the .Fa offset argument was not 0. +.It Bq Er EINVAL +Both +.Dv MAP_FIXED +and +.Dv MAP_EXCL +were specified, but the requested region is already used by a mapping. +.It Bq Er EINVAL +.Dv MAP_EXCL +was specified, but +.Dv MAP_FIXED +was not. .It Bq Er ENODEV .Dv MAP_ANON has not been specified and Modified: stable/10/sys/sys/mman.h ============================================================================== --- stable/10/sys/sys/mman.h Thu Jun 26 08:27:01 2014 (r267900) +++ stable/10/sys/sys/mman.h Thu Jun 26 08:30:08 2014 (r267901) @@ -89,6 +89,7 @@ /* * Extended flags */ +#define MAP_EXCL 0x00004000 /* for MAP_FIXED, fail if address is used */ #define MAP_NOCORE 0x00020000 /* dont include these pages in a coredump */ #define MAP_PREFAULT_READ 0x00040000 /* prefault mapping for reading */ #ifdef __LP64__ Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Thu Jun 26 08:27:01 2014 (r267900) +++ stable/10/sys/vm/vm_map.c Thu Jun 26 08:30:08 2014 (r267901) @@ -1407,7 +1407,8 @@ vm_map_fixed(vm_map_t map, vm_object_t o ("vm_map_fixed: non-NULL backing object for stack")); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - (void) vm_map_delete(map, start, end); + if ((cow & MAP_CHECK_EXCL) == 0) + vm_map_delete(map, start, end); if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { result = vm_map_stack_locked(map, start, length, sgrowsiz, prot, max, cow); Modified: stable/10/sys/vm/vm_map.h ============================================================================== --- stable/10/sys/vm/vm_map.h Thu Jun 26 08:27:01 2014 (r267900) +++ stable/10/sys/vm/vm_map.h Thu Jun 26 08:30:08 2014 (r267901) @@ -315,6 +315,7 @@ long vmspace_resident_count(struct vmspa #define MAP_PREFAULT 0x0008 #define MAP_PREFAULT_PARTIAL 0x0010 #define MAP_DISABLE_SYNCER 0x0020 +#define MAP_CHECK_EXCL 0x0040 #define MAP_DISABLE_COREDUMP 0x0100 #define MAP_PREFAULT_MADVISE 0x0200 /* from (user) madvise request */ #define MAP_VN_WRITECOUNT 0x0400 Modified: stable/10/sys/vm/vm_mmap.c ============================================================================== --- stable/10/sys/vm/vm_mmap.c Thu Jun 26 08:27:01 2014 (r267900) +++ stable/10/sys/vm/vm_mmap.c Thu Jun 26 08:30:08 2014 (r267901) @@ -245,6 +245,8 @@ sys_mmap(td, uap) flags |= MAP_ANON; pos = 0; } + if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL) + return (EINVAL); /* * Align the file position to a page boundary, @@ -1626,6 +1628,8 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, return (EINVAL); docow |= MAP_STACK_GROWS_DOWN; } + if ((flags & MAP_EXCL) != 0) + docow |= MAP_CHECK_EXCL; if (fitit) { if ((flags & MAP_ALIGNMENT_MASK) == MAP_ALIGNED_SUPER) From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 26 08:41:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D160C38D; Thu, 26 Jun 2014 08:41: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 BDF902E30; Thu, 26 Jun 2014 08:41: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 s5Q8fswu059611; Thu, 26 Jun 2014 08:41:54 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q8fs9H059609; Thu, 26 Jun 2014 08:41:54 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201406260841.s5Q8fs9H059609@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 26 Jun 2014 08:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267902 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2014 08:41:54 -0000 Author: pluknet Date: Thu Jun 26 08:41:54 2014 New Revision: 267902 URL: http://svnweb.freebsd.org/changeset/base/267902 Log: MFC r261901: Preserve one character space for a trailing '\0'. Modified: stable/10/sys/kern/subr_hints.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_hints.c ============================================================================== --- stable/10/sys/kern/subr_hints.c Thu Jun 26 08:30:08 2014 (r267901) +++ stable/10/sys/kern/subr_hints.c Thu Jun 26 08:41:54 2014 (r267902) @@ -210,7 +210,7 @@ res_find(int *line, int *startln, if (strncmp(cp, "hint.", 5) != 0) hit = 0; else - n = sscanf(cp, "hint.%32[^.].%d.%32[^=]=%128s", + n = sscanf(cp, "hint.%32[^.].%d.%32[^=]=%127s", r_name, &r_unit, r_resname, r_value); if (hit && n != 4) { printf("CONFIG: invalid hint '%s'\n", cp); From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 26 08:55:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4CD7EA8F; Thu, 26 Jun 2014 08:55:07 +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 1FCB82F31; Thu, 26 Jun 2014 08:55:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q8t6jL065227; Thu, 26 Jun 2014 08:55:06 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q8t6nd065223; Thu, 26 Jun 2014 08:55:06 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201406260855.s5Q8t6nd065223@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 26 Jun 2014 08:55:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267904 - stable/10/bin/ps X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2014 08:55:07 -0000 Author: pluknet Date: Thu Jun 26 08:55:06 2014 New Revision: 267904 URL: http://svnweb.freebsd.org/changeset/base/267904 Log: MFC r267196: Add support for inspecting process flags set in p_flag2. Modified: stable/10/bin/ps/keyword.c stable/10/bin/ps/ps.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ps/keyword.c ============================================================================== --- stable/10/bin/ps/keyword.c Thu Jun 26 08:44:28 2014 (r267903) +++ stable/10/bin/ps/keyword.c Thu Jun 26 08:55:06 2014 (r267904) @@ -87,8 +87,10 @@ static VAR var[] = { {"etimes", "ELAPSED", NULL, USER, elapseds, 0, CHAR, NULL, 0}, {"euid", "", "uid", 0, NULL, 0, CHAR, NULL, 0}, {"f", "F", NULL, 0, kvar, KOFF(ki_flag), INT, "x", 0}, + {"f2", "F2", NULL, 0, kvar, KOFF(ki_flag2), INT, "08x", 0}, {"fib", "FIB", NULL, 0, kvar, KOFF(ki_fibnum), INT, "d", 0}, {"flags", "", "f", 0, NULL, 0, CHAR, NULL, 0}, + {"flags2", "", "f2", 0, NULL, 0, CHAR, NULL, 0}, {"gid", "GID", NULL, 0, kvar, KOFF(ki_groups), UINT, UIDFMT, 0}, {"group", "GROUP", NULL, LJUST, egroupname, 0, CHAR, NULL, 0}, {"ignored", "", "sigignore", 0, NULL, 0, CHAR, NULL, 0}, Modified: stable/10/bin/ps/ps.1 ============================================================================== --- stable/10/bin/ps/ps.1 Thu Jun 26 08:44:28 2014 (r267903) +++ stable/10/bin/ps/ps.1 Thu Jun 26 08:55:06 2014 (r267904) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 2, 2014 +.Dd June 6, 2014 .Dt PS 1 .Os .Sh NAME @@ -340,6 +340,15 @@ the include file .It Dv "P_SWAPPINGIN" Ta No "0x40000000" Ta "Process is being swapped in" .It Dv "P_PPTRACE" Ta No "0x80000000" Ta "Vforked child issued ptrace(PT_TRACEME)" .El +.It Cm flags2 +The flags kept in +.Va p_flag2 +associated with the process as in +the include file +.In sys/proc.h : +.Bl -column P2_INHERIT_PROTECTED 0x00000001 +.It Dv "P2_INHERIT_PROTECTED" Ta No "0x00000001" Ta "New children get P_PROTECTED" +.El .It Cm label The MAC label of the process. .It Cm lim @@ -533,6 +542,9 @@ default FIB number, see .It Cm flags the process flags, in hexadecimal (alias .Cm f ) +.It Cm flags2 +the additional set of process flags, in hexadecimal (alias +.Cm f2 ) .It Cm gid effective group ID (alias .Cm egid ) From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 26 12:18:00 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AD390F9D; Thu, 26 Jun 2014 12:18:00 +0000 (UTC) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "asuka.mahoroba.org", Issuer "ca.mahoroba.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B971E2290; Thu, 26 Jun 2014 12:17:59 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:7258:12ff:fe22:d94b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.9/8.14.9) with ESMTP/inet6 id s5QCHp1v018106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 26 Jun 2014 21:17:52 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 26 Jun 2014 21:17:59 +0900 Message-ID: From: Hajimu UMEMOTO To: "Alexander V. Chernikov" Subject: Re: svn commit: r267874 - stable/10/lib/libc/net In-Reply-To: <53AB0E0C.3050802@FreeBSD.org> References: <201406251710.s5PHAQ31026354@svn.freebsd.org> <53AB0E0C.3050802@FreeBSD.org> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) Emacs/24.3 Mule/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.3-PRERELEASE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Thu, 26 Jun 2014 21:17:52 +0900 (JST) X-Virus-Scanned: clamav-milter 0.98.4 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on asuka.mahoroba.org Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2014 12:18:00 -0000 Hi, >>>>> On Wed, 25 Jun 2014 21:59:40 +0400 >>>>> "Alexander V. Chernikov" said: melifaro> Well, two socket() calls has some predictable cost, but getaddrinfo() melifaro> can be quite slow for system with many interfaces. It would be better to melifaro> introduce some kernel sysctls to report IPv4/IPv6 status... Yes, it should be better having some sysctls as you say. melifaro> It looks like style(9) needs to be altered, too.. melifaro> This is not correct. RFC 3493 talks about "loopback address" (and melifaro> specifies explicit IN6_IS_ADDR_LOOPBACK macro to test in IPv6 case) and melifaro> not about loopback interface. Yes, but the spec is still unclear about handling of link-local address especially on loopback interface. We have to exclude fe80::1%lo0 to make addrconfig() functional. I've committed the change: r267912. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-stable-10@FreeBSD.ORG Thu Jun 26 19:19:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EB8F7D9E; Thu, 26 Jun 2014 19:19: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 D846C2E30; Thu, 26 Jun 2014 19:19: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 s5QJJ63b065612; Thu, 26 Jun 2014 19:19:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QJJ68W065611; Thu, 26 Jun 2014 19:19:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406261919.s5QJJ68W065611@svn.freebsd.org> From: John Baldwin Date: Thu, 26 Jun 2014 19:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267928 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2014 19:19:07 -0000 Author: jhb Date: Thu Jun 26 19:19:06 2014 New Revision: 267928 URL: http://svnweb.freebsd.org/changeset/base/267928 Log: MFC 264277: Handle single-byte reads from the bvmcons port (0x220) by returning 0xff. Some guests may attempt to read from this port to identify psuedo-PNP ISA devices. (The ie(4) driver in FreeBSD/i386 is one example.) Modified: stable/10/usr.sbin/bhyve/consport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/consport.c ============================================================================== --- stable/10/usr.sbin/bhyve/consport.c Thu Jun 26 17:59:23 2014 (r267927) +++ stable/10/usr.sbin/bhyve/consport.c Thu Jun 26 19:19:06 2014 (r267928) @@ -110,6 +110,15 @@ console_handler(struct vmctx *ctx, int v return (0); } + /* + * Guests might probe this port to look for old ISA devices + * using single-byte reads. Return 0xff for those. + */ + if (bytes == 1 && in) { + *eax = 0xff; + return (0); + } + if (bytes != 4) return (-1); From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 05:37:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9D8096F6; Fri, 27 Jun 2014 05:37: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 88AA62249; Fri, 27 Jun 2014 05:37: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 s5R5b135059893; Fri, 27 Jun 2014 05:37:01 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5R5b1ia059891; Fri, 27 Jun 2014 05:37:01 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201406270537.s5R5b1ia059891@svn.freebsd.org> From: Hiren Panchasara Date: Fri, 27 Jun 2014 05:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267950 - stable/10/sys/dev/mpt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 05:37:01 -0000 Author: hiren Date: Fri Jun 27 05:37:00 2014 New Revision: 267950 URL: http://svnweb.freebsd.org/changeset/base/267950 Log: MFC r267690 Hide a harmless "QUEUE FULL EVENT" message behind bootverbose. Modified: stable/10/sys/dev/mpt/mpt_cam.c Modified: stable/10/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/10/sys/dev/mpt/mpt_cam.c Fri Jun 27 05:27:37 2014 (r267949) +++ stable/10/sys/dev/mpt/mpt_cam.c Fri Jun 27 05:37:00 2014 (r267950) @@ -2449,8 +2449,11 @@ mpt_cam_event(struct mpt_softc *mpt, req pqf = (PTR_EVENT_DATA_QUEUE_FULL)msg->Data; pqf->CurrentDepth = le16toh(pqf->CurrentDepth); - mpt_prt(mpt, "QUEUE FULL EVENT: Bus 0x%02x Target 0x%02x Depth " - "%d\n", pqf->Bus, pqf->TargetID, pqf->CurrentDepth); + if (bootverbose) { + mpt_prt(mpt, "QUEUE FULL EVENT: Bus 0x%02x Target 0x%02x " + "Depth %d\n", + pqf->Bus, pqf->TargetID, pqf->CurrentDepth); + } if (mpt->phydisk_sim && mpt_is_raid_member(mpt, pqf->TargetID) != 0) { sim = mpt->phydisk_sim; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 05:50:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3894CC88; Fri, 27 Jun 2014 05:50: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 253D5235D; Fri, 27 Jun 2014 05:50: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 s5R5ouhq067560; Fri, 27 Jun 2014 05:50:56 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5R5oueK067559; Fri, 27 Jun 2014 05:50:56 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201406270550.s5R5oueK067559@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 27 Jun 2014 05:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267951 - stable/10/gnu/usr.bin/groff/tmac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 05:50:56 -0000 Author: pluknet Date: Fri Jun 27 05:50:55 2014 New Revision: 267951 URL: http://svnweb.freebsd.org/changeset/base/267951 Log: MFC r266479, r267153: - Move Nx definition to a separate block. - Add Lb string for libcuse. Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local Directory Properties: stable/10/ (props changed) Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- stable/10/gnu/usr.bin/groff/tmac/mdoc.local Fri Jun 27 05:37:00 2014 (r267950) +++ stable/10/gnu/usr.bin/groff/tmac/mdoc.local Fri Jun 27 05:50:55 2014 (r267951) @@ -35,6 +35,7 @@ .ds doc-str-Lb-libarchive Streaming Archive Library (libarchive, \-larchive) .ds doc-str-Lb-libbluetooth Bluetooth User Library (libbluetooth, \-lbluetooth) .ds doc-str-Lb-libcapsicum Capsicum Library (libcapsicum, \-lcapsicum) +.ds doc-str-Lb-libcuse Userland Character Device Library (libcuse, \-lcuse) .ds doc-str-Lb-libedit Line Editor and History Library (libedit, \-ledit) .ds doc-str-Lb-libefi EFI Runtime Services Library (libefi, \-lefi) .ds doc-str-Lb-libelf ELF Parsing Library (libelf, \-lelf) @@ -61,6 +62,8 @@ .ds doc-operating-system-FreeBSD-10.0 10.0 .ds doc-operating-system-FreeBSD-10.1 10.1 .ds doc-operating-system-FreeBSD-11.0 11.0 +. +.\" Definitions for other *BSDs not (yet) in doc-common .ds doc-operating-system-NetBSD-7.0 7.0 . .\" Definitions not (yet) in doc-syms From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 09:11:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0F7AC963; Fri, 27 Jun 2014 09:11: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 EFA782550; Fri, 27 Jun 2014 09:11: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 s5R9BOle063336; Fri, 27 Jun 2014 09:11:24 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5R9BOaT063335; Fri, 27 Jun 2014 09:11:24 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201406270911.s5R9BOaT063335@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 27 Jun 2014 09:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267953 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 09:11:25 -0000 Author: pluknet Date: Fri Jun 27 09:11:24 2014 New Revision: 267953 URL: http://svnweb.freebsd.org/changeset/base/267953 Log: MFC r261140: Add MLINK for fdclosedir.3 to directory.3 and sort fdopendir(3) entry. Modified: stable/10/lib/libc/gen/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/Makefile.inc ============================================================================== --- stable/10/lib/libc/gen/Makefile.inc Fri Jun 27 06:52:37 2014 (r267952) +++ stable/10/lib/libc/gen/Makefile.inc Fri Jun 27 09:11:24 2014 (r267953) @@ -304,8 +304,9 @@ MLINKS+=devname.3 fdevname.3 MLINKS+=devname.3 fdevname_r.3 MLINKS+=directory.3 closedir.3 \ directory.3 dirfd.3 \ - directory.3 opendir.3 \ + directory.3 fdclosedir.3 \ directory.3 fdopendir.3 \ + directory.3 opendir.3 \ directory.3 readdir.3 \ directory.3 readdir_r.3 \ directory.3 rewinddir.3 \ From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 11:42:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DAFA6C1B; Fri, 27 Jun 2014 11:42: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 C761D24C2; Fri, 27 Jun 2014 11:42: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 s5RBgpZw032778; Fri, 27 Jun 2014 11:42:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RBgp26032777; Fri, 27 Jun 2014 11:42:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406271142.s5RBgp26032777@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 27 Jun 2014 11:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267956 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 11:42:52 -0000 Author: kib Date: Fri Jun 27 11:42:51 2014 New Revision: 267956 URL: http://svnweb.freebsd.org/changeset/base/267956 Log: MFC r267664: Assert that the new entry is inserted into the right location in the map entries list, and that it does not overlap with the previous and next entries. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Fri Jun 27 10:24:36 2014 (r267955) +++ stable/10/sys/vm/vm_map.c Fri Jun 27 11:42:51 2014 (r267956) @@ -940,6 +940,15 @@ vm_map_entry_link(vm_map_t map, "vm_map_entry_link: map %p, nentries %d, entry %p, after %p", map, map->nentries, entry, after_where); VM_MAP_ASSERT_LOCKED(map); + KASSERT(after_where == &map->header || + after_where->end <= entry->start, + ("vm_map_entry_link: prev end %jx new start %jx overlap", + (uintmax_t)after_where->end, (uintmax_t)entry->start)); + KASSERT(after_where->next == &map->header || + entry->end <= after_where->next->start, + ("vm_map_entry_link: new end %jx next start %jx overlap", + (uintmax_t)entry->end, (uintmax_t)after_where->next->start)); + map->nentries++; entry->prev = after_where; entry->next = after_where->next; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 14:42:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F255E322; Fri, 27 Jun 2014 14:42: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 D2AC3274C; Fri, 27 Jun 2014 14:42: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 s5REgDji020989; Fri, 27 Jun 2014 14:42:13 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5REgDtg020988; Fri, 27 Jun 2014 14:42:13 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406271442.s5REgDtg020988@svn.freebsd.org> From: Ed Maste Date: Fri, 27 Jun 2014 14:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267958 - stable/10/usr.bin/elfdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 14:42:14 -0000 Author: emaste Date: Fri Jun 27 14:42:13 2014 New Revision: 267958 URL: http://svnweb.freebsd.org/changeset/base/267958 Log: MFC r265613, r267649: Handle ELF files with 65280 or more sections If e_shnum or e_shstrndx are at least SHN_LORESERVE (0xff00) then an escape value is used to indicate that the actual value is found in one of section 0's fields. Don't dump core when the ELF file has no section headers. The ELF core files created by gcore are among those. Modified: stable/10/usr.bin/elfdump/elfdump.c Modified: stable/10/usr.bin/elfdump/elfdump.c ============================================================================== --- stable/10/usr.bin/elfdump/elfdump.c Fri Jun 27 13:19:03 2014 (r267957) +++ stable/10/usr.bin/elfdump/elfdump.c Fri Jun 27 14:42:13 2014 (r267958) @@ -368,7 +368,7 @@ static u_int64_t elf_get_half(Elf32_Ehdr static u_int64_t elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member); static u_int64_t elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member); -static void elf_print_ehdr(Elf32_Ehdr *e); +static void elf_print_ehdr(Elf32_Ehdr *e, void *sh); static void elf_print_phdr(Elf32_Ehdr *e, void *p); static void elf_print_shdr(Elf32_Ehdr *e, void *sh); static void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str); @@ -382,6 +382,33 @@ static void elf_print_note(Elf32_Ehdr *e static void usage(void); +/* + * Helpers for ELF files with shnum or shstrndx values that don't fit in the + * ELF header. If the values are too large then an escape value is used to + * indicate that the actual value is found in one of section 0's fields. + */ +static uint64_t +elf_get_shnum(Elf32_Ehdr *e, void *sh) +{ + uint64_t shnum; + + shnum = elf_get_quarter(e, e, E_SHNUM); + if (shnum == 0) + shnum = elf_get_word(e, (char *)sh, SH_SIZE); + return shnum; +} + +static uint64_t +elf_get_shstrndx(Elf32_Ehdr *e, void *sh) +{ + uint64_t shstrndx; + + shstrndx = elf_get_quarter(e, e, E_SHSTRNDX); + if (shstrndx == SHN_XINDEX) + shstrndx = elf_get_word(e, (char *)sh, SH_LINK); + return shstrndx; +} + int main(int ac, char **av) { @@ -467,12 +494,20 @@ main(int ac, char **av) phentsize = elf_get_quarter(e, e, E_PHENTSIZE); phnum = elf_get_quarter(e, e, E_PHNUM); shentsize = elf_get_quarter(e, e, E_SHENTSIZE); - shnum = elf_get_quarter(e, e, E_SHNUM); - shstrndx = elf_get_quarter(e, e, E_SHSTRNDX); p = (char *)e + phoff; - sh = (char *)e + shoff; - offset = elf_get_off(e, (char *)sh + shstrndx * shentsize, SH_OFFSET); - shstrtab = (char *)e + offset; + if (shoff > 0) { + sh = (char *)e + shoff; + shnum = elf_get_shnum(e, sh); + shstrndx = elf_get_shstrndx(e, sh); + offset = elf_get_off(e, (char *)sh + shstrndx * shentsize, + SH_OFFSET); + shstrtab = (char *)e + offset; + } else { + sh = NULL; + shnum = 0; + shstrndx = 0; + shstrtab = NULL; + } for (i = 0; (u_int64_t)i < shnum; i++) { name = elf_get_word(e, (char *)sh + i * shentsize, SH_NAME); offset = elf_get_off(e, (char *)sh + i * shentsize, SH_OFFSET); @@ -482,7 +517,7 @@ main(int ac, char **av) dynstr = (char *)e + offset; } if (flags & ED_EHDR) - elf_print_ehdr(e); + elf_print_ehdr(e, sh); if (flags & ED_PHDR) elf_print_phdr(e, p); if (flags & ED_SHDR) @@ -556,7 +591,7 @@ main(int ac, char **av) } static void -elf_print_ehdr(Elf32_Ehdr *e) +elf_print_ehdr(Elf32_Ehdr *e, void *sh) { u_int64_t class; u_int64_t data; @@ -589,8 +624,6 @@ elf_print_ehdr(Elf32_Ehdr *e) phentsize = elf_get_quarter(e, e, E_PHENTSIZE); phnum = elf_get_quarter(e, e, E_PHNUM); shentsize = elf_get_quarter(e, e, E_SHENTSIZE); - shnum = elf_get_quarter(e, e, E_SHNUM); - shstrndx = elf_get_quarter(e, e, E_SHSTRNDX); fprintf(out, "\nelf header:\n"); fprintf(out, "\n"); fprintf(out, "\te_ident: %s %s %s\n", ei_classes[class], ei_data[data], @@ -606,8 +639,12 @@ elf_print_ehdr(Elf32_Ehdr *e) fprintf(out, "\te_phentsize: %jd\n", (intmax_t)phentsize); fprintf(out, "\te_phnum: %jd\n", (intmax_t)phnum); fprintf(out, "\te_shentsize: %jd\n", (intmax_t)shentsize); - fprintf(out, "\te_shnum: %jd\n", (intmax_t)shnum); - fprintf(out, "\te_shstrndx: %jd\n", (intmax_t)shstrndx); + if (sh != NULL) { + shnum = elf_get_shnum(e, sh); + shstrndx = elf_get_shstrndx(e, sh); + fprintf(out, "\te_shnum: %jd\n", (intmax_t)shnum); + fprintf(out, "\te_shstrndx: %jd\n", (intmax_t)shstrndx); + } } static void @@ -670,8 +707,13 @@ elf_print_shdr(Elf32_Ehdr *e, void *sh) void *v; int i; + if (sh == NULL) { + fprintf(out, "\nNo section headers\n"); + return; + } + shentsize = elf_get_quarter(e, e, E_SHENTSIZE); - shnum = elf_get_quarter(e, e, E_SHNUM); + shnum = elf_get_shnum(e, sh); fprintf(out, "\nsection header:\n"); for (i = 0; (u_int64_t)i < shnum; i++) { v = (char *)sh + i * shentsize; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 17:10:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7ABE070A; Fri, 27 Jun 2014 17:10: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 6712425AC; Fri, 27 Jun 2014 17:10: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 s5RHATIq093079; Fri, 27 Jun 2014 17:10:29 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RHATFN093077; Fri, 27 Jun 2014 17:10:29 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201406271710.s5RHATFN093077@svn.freebsd.org> From: Josh Paetzel Date: Fri, 27 Jun 2014 17:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267962 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 17:10:29 -0000 Author: jpaetzel Date: Fri Jun 27 17:10:28 2014 New Revision: 267962 URL: http://svnweb.freebsd.org/changeset/base/267962 Log: MFC: 267833 Fix issues in config parser relating to lun serial numbers. Without this fix some serial numbers needed to be quoted to avoid the config parser bailing out. Submitted by: delphij Sponsored by: iXsystems Modified: stable/10/usr.sbin/ctld/parse.y stable/10/usr.sbin/ctld/token.l Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/parse.y ============================================================================== --- stable/10/usr.sbin/ctld/parse.y Fri Jun 27 16:33:43 2014 (r267961) +++ stable/10/usr.sbin/ctld/parse.y Fri Jun 27 17:10:28 2014 (r267962) @@ -659,6 +659,19 @@ lun_serial: SERIAL STR } lun_set_serial(lun, $2); free($2); + } | SERIAL NUM + { + char *str = NULL; + + if (lun->l_serial != NULL) { + log_warnx("serial for lun %d, target \"%s\" " + "specified more than once", + lun->l_lun, target->t_name); + return (1); + } + asprintf(&str, "%ju", $2); + lun_set_serial(lun, str); + free(str); } ; Modified: stable/10/usr.sbin/ctld/token.l ============================================================================== --- stable/10/usr.sbin/ctld/token.l Fri Jun 27 16:33:43 2014 (r267961) +++ stable/10/usr.sbin/ctld/token.l Fri Jun 27 17:10:28 2014 (r267962) @@ -74,8 +74,9 @@ target { return TARGET; } timeout { return TIMEOUT; } [0-9]+[kKmMgGtTpPeE]? { if (expand_number(yytext, &yylval.num) == 0) return NUM; - else - return STR; + else { + yylval.str = strdup(yytext); return STR; + } } \"[^"]+\" { yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 17:22:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC34AD8C; Fri, 27 Jun 2014 17:22: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 9D2662721; Fri, 27 Jun 2014 17:22: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 s5RHMJNt002266; Fri, 27 Jun 2014 17:22:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RHMIQD002254; Fri, 27 Jun 2014 17:22:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406271722.s5RHMIQD002254@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Jun 2014 17:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267964 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 10/sys/i386/include 10/sys/i386/xen 10/sys/pc98/pc98 9/sys/amd64/amd64 9/sys/i386/i386 9/sys/i386/include 9/sys/i386/xen 9/sys/p... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 17:22:19 -0000 Author: jhb Date: Fri Jun 27 17:22:18 2014 New Revision: 267964 URL: http://svnweb.freebsd.org/changeset/base/267964 Log: MFC 261781: Don't waste a page of KVA for the boot-time memory test on x86. For amd64, reuse the first page of the crashdumpmap as CMAP1/CADDR1. For i386, remove CMAP1/CADDR1 entirely and reuse CMAP3/CADDR3 for the memory test. Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/i386/i386/machdep.c stable/10/sys/i386/i386/pmap.c stable/10/sys/i386/include/pmap.h stable/10/sys/i386/xen/pmap.c stable/10/sys/pc98/pc98/machdep.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/amd64/amd64/pmap.c stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/i386/pmap.c stable/9/sys/i386/include/pmap.h stable/9/sys/i386/xen/pmap.c stable/9/sys/pc98/pc98/machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Fri Jun 27 17:18:54 2014 (r267963) +++ stable/10/sys/amd64/amd64/pmap.c Fri Jun 27 17:22:18 2014 (r267964) @@ -812,7 +812,7 @@ void pmap_bootstrap(vm_paddr_t *firstaddr) { vm_offset_t va; - pt_entry_t *pte, *unused; + pt_entry_t *pte; /* * Create an initial set of page tables to run the kernel in. @@ -858,14 +858,11 @@ pmap_bootstrap(vm_paddr_t *firstaddr) pte = vtopte(va); /* - * CMAP1 is only used for the memory test. - */ - SYSMAP(caddr_t, CMAP1, CADDR1, 1) - - /* - * Crashdump maps. + * Crashdump maps. The first page is reused as CMAP1 for the + * memory test. */ - SYSMAP(caddr_t, unused, crashdumpmap, MAXDUMPPGS) + SYSMAP(caddr_t, CMAP1, crashdumpmap, MAXDUMPPGS) + CADDR1 = crashdumpmap; virtual_avail = va; Modified: stable/10/sys/i386/i386/machdep.c ============================================================================== --- stable/10/sys/i386/i386/machdep.c Fri Jun 27 17:18:54 2014 (r267963) +++ stable/10/sys/i386/i386/machdep.c Fri Jun 27 17:22:18 2014 (r267964) @@ -2387,7 +2387,7 @@ physmap_done: phys_avail[pa_indx++] = physmap[0]; phys_avail[pa_indx] = physmap[0]; dump_avail[da_indx] = physmap[0]; - pte = CMAP1; + pte = CMAP3; /* * Get dcons buffer address @@ -2409,7 +2409,7 @@ physmap_done: end = trunc_page(physmap[i + 1]); for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) { int tmp, page_bad, full; - int *ptr = (int *)CADDR1; + int *ptr = (int *)CADDR3; full = FALSE; /* Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Fri Jun 27 17:18:54 2014 (r267963) +++ stable/10/sys/i386/i386/pmap.c Fri Jun 27 17:22:18 2014 (r267964) @@ -256,11 +256,10 @@ struct sysmaps { caddr_t CADDR2; }; static struct sysmaps sysmaps_pcpu[MAXCPU]; -pt_entry_t *CMAP1 = 0; -static pt_entry_t *CMAP3; +pt_entry_t *CMAP3; static pd_entry_t *KPTD; -caddr_t CADDR1 = 0, ptvmmap = 0; -static caddr_t CADDR3; +caddr_t ptvmmap = 0; +caddr_t CADDR3; struct msgbuf *msgbufp = 0; /* @@ -434,7 +433,6 @@ pmap_bootstrap(vm_paddr_t firstaddr) SYSMAP(caddr_t, sysmaps->CMAP1, sysmaps->CADDR1, 1) SYSMAP(caddr_t, sysmaps->CMAP2, sysmaps->CADDR2, 1) } - SYSMAP(caddr_t, CMAP1, CADDR1, 1) SYSMAP(caddr_t, CMAP3, CADDR3, 1) /* Modified: stable/10/sys/i386/include/pmap.h ============================================================================== --- stable/10/sys/i386/include/pmap.h Fri Jun 27 17:18:54 2014 (r267963) +++ stable/10/sys/i386/include/pmap.h Fri Jun 27 17:22:18 2014 (r267964) @@ -420,8 +420,8 @@ struct pv_chunk { #ifdef _KERNEL -extern caddr_t CADDR1; -extern pt_entry_t *CMAP1; +extern caddr_t CADDR3; +extern pt_entry_t *CMAP3; extern vm_paddr_t phys_avail[]; extern vm_paddr_t dump_avail[]; extern int pseflag; Modified: stable/10/sys/i386/xen/pmap.c ============================================================================== --- stable/10/sys/i386/xen/pmap.c Fri Jun 27 17:18:54 2014 (r267963) +++ stable/10/sys/i386/xen/pmap.c Fri Jun 27 17:22:18 2014 (r267964) @@ -249,9 +249,9 @@ struct sysmaps { caddr_t CADDR2; }; static struct sysmaps sysmaps_pcpu[MAXCPU]; -static pt_entry_t *CMAP3; +pt_entry_t *CMAP3; caddr_t ptvmmap = 0; -static caddr_t CADDR3; +caddr_t CADDR3; struct msgbuf *msgbufp = 0; /* Modified: stable/10/sys/pc98/pc98/machdep.c ============================================================================== --- stable/10/sys/pc98/pc98/machdep.c Fri Jun 27 17:18:54 2014 (r267963) +++ stable/10/sys/pc98/pc98/machdep.c Fri Jun 27 17:22:18 2014 (r267964) @@ -1962,7 +1962,7 @@ getmemsize(int first) phys_avail[pa_indx++] = physmap[0]; phys_avail[pa_indx] = physmap[0]; dump_avail[da_indx] = physmap[0]; - pte = CMAP1; + pte = CMAP3; /* * Get dcons buffer address @@ -1983,7 +1983,7 @@ getmemsize(int first) end = trunc_page(physmap[i + 1]); for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) { int tmp, page_bad, full; - int *ptr = (int *)CADDR1; + int *ptr = (int *)CADDR3; full = FALSE; /* From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 19:50:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3A57ED8F; Fri, 27 Jun 2014 19:50: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 0C42525F3; Fri, 27 Jun 2014 19:50:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RJoU0X069846; Fri, 27 Jun 2014 19:50:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RJoUFZ069845; Fri, 27 Jun 2014 19:50:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406271950.s5RJoUFZ069845@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Jun 2014 19:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267976 - in stable: 10/usr.bin/procstat 8/usr.bin/procstat 9/usr.bin/procstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 19:50:31 -0000 Author: jhb Date: Fri Jun 27 19:50:30 2014 New Revision: 267976 URL: http://svnweb.freebsd.org/changeset/base/267976 Log: MFC 266296: Correct some minor nits in the per-thread signal format description such as missing posessives and misordering of fields. Modified: stable/10/usr.bin/procstat/procstat.1 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat.1 Directory Properties: stable/8/usr.bin/procstat/ (props changed) stable/9/usr.bin/procstat/ (props changed) Modified: stable/10/usr.bin/procstat/procstat.1 ============================================================================== --- stable/10/usr.bin/procstat/procstat.1 Fri Jun 27 19:11:32 2014 (r267975) +++ stable/10/usr.bin/procstat/procstat.1 Fri Jun 27 19:50:30 2014 (r267976) @@ -65,7 +65,7 @@ Display file descriptor information for .It Fl i Display signal pending and disposition information for the process. .It Fl j -Display signal pending and blocked information for the process threads. +Display signal pending and blocked information for the process's threads. .It Fl k Display the stacks of kernel threads in the process, excluding stacks of threads currently running on a CPU and threads with stacks swapped to disk. @@ -260,15 +260,15 @@ If .Fl n switch is given, the signal numbers are shown instead of signal names. .Ss Thread Signal Information -Display signal pending and blocked for a process threads: +Display signal pending and blocked for a process's threads: .Pp .Bl -tag -width ident -compact .It PID process ID -.It COMM -command .It TID thread ID +.It COMM +command .It SIG signal name .It FLAGS @@ -285,7 +285,7 @@ The .Fl n switch has the same effect as for the .Fl i -switch, the signals numbers are shown instead of signal names. +switch: the signal numbers are shown instead of signal names. .Ss Kernel Thread Stacks Display kernel thread stacks for a process, allowing further interpretation of thread wait channels. From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 20:34:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8DED93C1; Fri, 27 Jun 2014 20:34: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 6EFB629D2; Fri, 27 Jun 2014 20:34: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 s5RKYN9q093116; Fri, 27 Jun 2014 20:34:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RKYMca093108; Fri, 27 Jun 2014 20:34:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406272034.s5RKYMca093108@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Jun 2014 20:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267979 - in stable: 10/usr.bin/procstat 9/usr.bin/procstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 20:34:23 -0000 Author: jhb Date: Fri Jun 27 20:34:22 2014 New Revision: 267979 URL: http://svnweb.freebsd.org/changeset/base/267979 Log: MFC 266293: - Add support for dumping current resource usage for processes via a new -r flag to procstat. - Add an -H flag to request information about threads rather than processes when dumping statistics. Currently it is only used for -r to display resource usage for individual threads instead of the entire process. Added: stable/10/usr.bin/procstat/procstat_rusage.c - copied unchanged from r266293, head/usr.bin/procstat/procstat_rusage.c Modified: stable/10/usr.bin/procstat/Makefile stable/10/usr.bin/procstat/procstat.1 stable/10/usr.bin/procstat/procstat.c stable/10/usr.bin/procstat/procstat.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/9/usr.bin/procstat/procstat_rusage.c - copied unchanged from r266293, head/usr.bin/procstat/procstat_rusage.c Modified: stable/9/usr.bin/procstat/Makefile stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat.c stable/9/usr.bin/procstat/procstat.h Directory Properties: stable/9/usr.bin/procstat/ (props changed) Modified: stable/10/usr.bin/procstat/Makefile ============================================================================== --- stable/10/usr.bin/procstat/Makefile Fri Jun 27 19:57:57 2014 (r267978) +++ stable/10/usr.bin/procstat/Makefile Fri Jun 27 20:34:22 2014 (r267979) @@ -11,6 +11,7 @@ SRCS= procstat.c \ procstat_files.c \ procstat_kstack.c \ procstat_rlimit.c \ + procstat_rusage.c \ procstat_sigs.c \ procstat_threads.c \ procstat_vm.c Modified: stable/10/usr.bin/procstat/procstat.1 ============================================================================== --- stable/10/usr.bin/procstat/procstat.1 Fri Jun 27 19:57:57 2014 (r267978) +++ stable/10/usr.bin/procstat/procstat.1 Fri Jun 27 20:34:22 2014 (r267979) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 11, 2014 +.Dd May 16, 2014 .Dt PROCSTAT 1 .Os .Sh NAME @@ -33,11 +33,9 @@ .Nd get detailed process information .Sh SYNOPSIS .Nm -.Op Fl h -.Op Fl n -.Op Fl C +.Op Fl CHhn .Op Fl w Ar interval -.Op Fl b | c | e | f | i | j | k | l | s | t | v | x +.Op Fl b | c | e | f | i | j | k | l | r | s | t | v | x .Op Fl a | Ar pid | Ar core ... .Sh DESCRIPTION The @@ -73,6 +71,8 @@ If the flag is repeated, function offset printed. .It Fl l Display resource limits for the process. +.It Fl r +Display resource usage information for the process. .It Fl s Display security credential information for the process. .It Fl t @@ -102,6 +102,13 @@ The flag requests the printing of additional capability information in the file descriptor view. .Pp +The +.Fl H +flag may be used to request per-thread statistics rather than per-process +statistics for some options. +For those options, the second field in the table will list the thread ID +to which the row of information corresponds. +.Pp Some information, such as VM and file descriptor information, is available only to the owner of a process or the superuser. .Ss Binary Information Modified: stable/10/usr.bin/procstat/procstat.c ============================================================================== --- stable/10/usr.bin/procstat/procstat.c Fri Jun 27 19:57:57 2014 (r267978) +++ stable/10/usr.bin/procstat/procstat.c Fri Jun 27 20:34:22 2014 (r267979) @@ -39,18 +39,19 @@ #include "procstat.h" -static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, sflag; -static int tflag, vflag, xflag; -int hflag, nflag, Cflag; +static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, rflag; +static int sflag, tflag, vflag, xflag; +int hflag, nflag, Cflag, Hflag; static void usage(void) { - fprintf(stderr, "usage: procstat [-h] [-C] [-M core] [-N system] " + fprintf(stderr, "usage: procstat [-CHhn] [-M core] [-N system] " "[-w interval] \n"); fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " - "-l | -s | -t | -v | -x] [-a | pid | core ...]\n"); + "-l | -r | -s | -t | -v | -x]\n"); + fprintf(stderr, " [-a | pid | core ...]\n"); exit(EX_USAGE); } @@ -74,6 +75,8 @@ procstat(struct procstat *prstat, struct procstat_kstack(prstat, kipp, kflag); else if (lflag) procstat_rlimit(prstat, kipp); + else if (rflag) + procstat_rusage(prstat, kipp); else if (sflag) procstat_cred(prstat, kipp); else if (tflag) @@ -125,12 +128,16 @@ main(int argc, char *argv[]) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "CN:M:abcefijklhstvw:x")) != -1) { + while ((ch = getopt(argc, argv, "CHN:M:abcefijklhrstvw:x")) != -1) { switch (ch) { case 'C': Cflag++; break; + case 'H': + Hflag++; + break; + case 'M': memf = optarg; break; @@ -181,6 +188,10 @@ main(int argc, char *argv[]) hflag++; break; + case 'r': + rflag++; + break; + case 's': sflag++; break; @@ -217,7 +228,7 @@ main(int argc, char *argv[]) /* We require that either 0 or 1 mode flags be set. */ tmp = bflag + cflag + eflag + fflag + iflag + jflag + (kflag ? 1 : 0) + - lflag + sflag + tflag + vflag + xflag; + lflag + rflag + sflag + tflag + vflag + xflag; if (!(tmp == 0 || tmp == 1)) usage(); Modified: stable/10/usr.bin/procstat/procstat.h ============================================================================== --- stable/10/usr.bin/procstat/procstat.h Fri Jun 27 19:57:57 2014 (r267978) +++ stable/10/usr.bin/procstat/procstat.h Fri Jun 27 20:34:22 2014 (r267979) @@ -29,7 +29,7 @@ #ifndef PROCSTAT_H #define PROCSTAT_H -extern int hflag, nflag, Cflag; +extern int hflag, nflag, Cflag, Hflag; struct kinfo_proc; void kinfo_proc_sort(struct kinfo_proc *kipp, int count); @@ -44,6 +44,7 @@ void procstat_files(struct procstat *prs void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp, int kflag); void procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_rusage(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads_sigs(struct procstat *prstat, struct kinfo_proc *kipp); Copied: stable/10/usr.bin/procstat/procstat_rusage.c (from r266293, head/usr.bin/procstat/procstat_rusage.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/procstat/procstat_rusage.c Fri Jun 27 20:34:22 2014 (r267979, copy of r266293, head/usr.bin/procstat/procstat_rusage.c) @@ -0,0 +1,160 @@ +/*- + * Copyright (c) 2012 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include + +#include "procstat.h" + +static struct { + const char *ri_name; + bool ri_humanize; + int ri_scale; +} rusage_info[] = { + { "maximum RSS", true, 1 }, + { "integral shared memory", true, 1 }, + { "integral unshared data", true, 1 }, + { "integral unshared stack", true, 1 }, + { "page reclaims", false, 0 }, + { "page faults", false, 0 }, + { "swaps", false, 0 }, + { "block reads", false, 0 }, + { "block writes", false, 0 }, + { "messages sent", false, 0 }, + { "messages received", false, 0 }, + { "signals received", false, 0 }, + { "voluntary context switches", false, 0 }, + { "involuntary context switches", false, 0 } +}; + +/* xxx days hh:mm:ss.uuuuuu */ +static const char * +format_time(struct timeval *tv) +{ + static char buffer[32]; + int days, hours, minutes, seconds, used; + + minutes = tv->tv_sec / 60; + seconds = tv->tv_sec % 60; + hours = minutes / 60; + minutes %= 60; + days = hours / 24; + hours %= 24; + used = 0; + if (days == 1) + used += snprintf(buffer, sizeof(buffer), "1 day "); + else if (days > 0) + used += snprintf(buffer, sizeof(buffer), "%u days ", days); + + snprintf(buffer + used, sizeof(buffer) - used, "%02u:%02u:%02u.%06u ", + hours, minutes, seconds, (unsigned int)tv->tv_usec); + return (buffer); +} + +static const char * +format_value(long value, bool humanize, int scale) +{ + static char buffer[14]; + + if (scale != 0) + value <<= scale * 10; + if (humanize) + humanize_number(buffer, sizeof(buffer), value, "B", + scale, HN_DECIMAL); + else + snprintf(buffer, sizeof(buffer), "%ld ", value); + return (buffer); +} + +static void +print_prefix(struct kinfo_proc *kipp) +{ + + printf("%5d ", kipp->ki_pid); + if (Hflag) + printf("%6d ", kipp->ki_tid); + printf("%-16s ", kipp->ki_comm); +} + +static void +print_rusage(struct kinfo_proc *kipp) +{ + long *lp; + unsigned int i; + + print_prefix(kipp); + printf("%-14s %32s\n", "user time", + format_time(&kipp->ki_rusage.ru_utime)); + print_prefix(kipp); + printf("%-14s %32s\n", "system time", + format_time(&kipp->ki_rusage.ru_stime)); + lp = &kipp->ki_rusage.ru_maxrss; + for (i = 0; i < nitems(rusage_info); i++) { + print_prefix(kipp); + printf("%-32s %14s\n", rusage_info[i].ri_name, + format_value(*lp, rusage_info[i].ri_humanize, + rusage_info[i].ri_scale)); + lp++; + } +} + +void +procstat_rusage(struct procstat *procstat, struct kinfo_proc *kipp) +{ + struct kinfo_proc *kip; + unsigned int count, i; + + if (!hflag) { + printf("%5s ", "PID"); + if (Hflag) + printf("%6s ", "TID"); + printf("%-16s %-32s %14s\n", "COMM", "TYPE", "VALUE "); + } + + if (!Hflag) { + print_rusage(kipp); + return; + } + + kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, + kipp->ki_pid, &count); + if (kip == NULL) + return; + kinfo_proc_sort(kip, count); + for (i = 0; i < count; i++) + print_rusage(&kip[i]); + procstat_freeprocs(procstat, kip); +} From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 20:39:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4B9CCA08; Fri, 27 Jun 2014 20:39: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 1E3142A3B; Fri, 27 Jun 2014 20:39: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 s5RKdjGP093991; Fri, 27 Jun 2014 20:39:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RKdjTI093989; Fri, 27 Jun 2014 20:39:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406272039.s5RKdjTI093989@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Jun 2014 20:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267980 - in stable: 10/sys/libkern 9/sys/libkern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 20:39:46 -0000 Author: jhb Date: Fri Jun 27 20:39:45 2014 New Revision: 267980 URL: http://svnweb.freebsd.org/changeset/base/267980 Log: MFC 267291: Use strcasecmp() instead of strcmp() when checking user-supplied encoding names so that encoding names are treated as case-insensitive. This allows the use of 'utf-8' instead of 'UTF-8' for example and matches the behavior of iconv(1). PR: 167977 Modified: stable/10/sys/libkern/iconv.c stable/10/sys/libkern/iconv_ucs.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/libkern/iconv.c stable/9/sys/libkern/iconv_ucs.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/libkern/iconv.c ============================================================================== --- stable/10/sys/libkern/iconv.c Fri Jun 27 20:34:22 2014 (r267979) +++ stable/10/sys/libkern/iconv.c Fri Jun 27 20:39:45 2014 (r267980) @@ -168,8 +168,8 @@ iconv_lookupcs(const char *to, const cha struct iconv_cspair *csp; TAILQ_FOREACH(csp, &iconv_cslist, cp_link) { - if (strcmp(csp->cp_to, to) == 0 && - strcmp(csp->cp_from, from) == 0) { + if (strcasecmp(csp->cp_to, to) == 0 && + strcasecmp(csp->cp_from, from) == 0) { if (cspp) *cspp = csp; return 0; Modified: stable/10/sys/libkern/iconv_ucs.c ============================================================================== --- stable/10/sys/libkern/iconv_ucs.c Fri Jun 27 20:34:22 2014 (r267979) +++ stable/10/sys/libkern/iconv_ucs.c Fri Jun 27 20:39:45 2014 (r267980) @@ -102,9 +102,9 @@ iconv_ucs_open(struct iconv_converter_cl if (cspf) dp->convtype |= KICONV_UCS_COMBINE; for (i = 0; unicode_family[i].name; i++) { - if (strcmp(from, unicode_family[i].name) == 0) + if (strcasecmp(from, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].from_flag; - if (strcmp(to, unicode_family[i].name) == 0) + if (strcasecmp(to, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].to_flag; } if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 27 20:57:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1A2B45FE; Fri, 27 Jun 2014 20:57: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 06B7F2C0E; Fri, 27 Jun 2014 20:57: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 s5RKvC2i003452; Fri, 27 Jun 2014 20:57:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RKvCAD003451; Fri, 27 Jun 2014 20:57:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406272057.s5RKvCAD003451@svn.freebsd.org> From: John Baldwin Date: Fri, 27 Jun 2014 20:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267983 - in stable: 10/sys/dev/acpica 9/sys/dev/acpica X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 20:57:13 -0000 Author: jhb Date: Fri Jun 27 20:57:12 2014 New Revision: 267983 URL: http://svnweb.freebsd.org/changeset/base/267983 Log: MFC 267647: Trust the state of a power resource that we get from a working _STA method instead of trying to cache it. Modified: stable/10/sys/dev/acpica/acpi_powerres.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/acpica/acpi_powerres.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/sys/dev/acpica/acpi_powerres.c ============================================================================== --- stable/10/sys/dev/acpica/acpi_powerres.c Fri Jun 27 20:45:17 2014 (r267982) +++ stable/10/sys/dev/acpica/acpi_powerres.c Fri Jun 27 20:57:12 2014 (r267983) @@ -64,7 +64,6 @@ ACPI_MODULE_NAME("POWERRES") /* Return values from _STA on a power resource */ #define ACPI_PWR_OFF 0 #define ACPI_PWR_ON 1 -#define ACPI_PWR_UNK (-1) /* A relationship between a power resource and a consumer. */ struct acpi_powerreference { @@ -90,7 +89,6 @@ struct acpi_powerresource { ACPI_HANDLE ap_resource; UINT64 ap_systemlevel; UINT64 ap_order; - int ap_state; }; static TAILQ_HEAD(acpi_powerresource_list, acpi_powerresource) @@ -173,7 +171,6 @@ acpi_pwr_register_resource(ACPI_HANDLE r } rp->ap_systemlevel = obj->PowerResource.SystemLevel; rp->ap_order = obj->PowerResource.ResourceOrder; - rp->ap_state = ACPI_PWR_UNK; /* Sort the resource into the list */ status = AE_OK; @@ -638,22 +635,20 @@ acpi_pwr_switch_power(void) continue; } - /* We could cache this if we trusted it not to change under us */ status = acpi_GetInteger(rp->ap_resource, "_STA", &cur); if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "can't get status of %s - %d\n", acpi_name(rp->ap_resource), status)); /* XXX is this correct? Always switch if in doubt? */ continue; - } else if (rp->ap_state == ACPI_PWR_UNK) - rp->ap_state = cur; + } /* * Switch if required. Note that we ignore the result of the switch * effort; we don't know what to do if it fails, so checking wouldn't * help much. */ - if (rp->ap_state != ACPI_PWR_ON) { + if (cur != ACPI_PWR_ON) { status = AcpiEvaluateObject(rp->ap_resource, "_ON", NULL, NULL); if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, @@ -661,7 +656,6 @@ acpi_pwr_switch_power(void) acpi_name(rp->ap_resource), AcpiFormatException(status))); } else { - rp->ap_state = ACPI_PWR_ON; ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "switched %s on\n", acpi_name(rp->ap_resource))); } @@ -682,22 +676,20 @@ acpi_pwr_switch_power(void) continue; } - /* We could cache this if we trusted it not to change under us */ status = acpi_GetInteger(rp->ap_resource, "_STA", &cur); if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "can't get status of %s - %d\n", acpi_name(rp->ap_resource), status)); /* XXX is this correct? Always switch if in doubt? */ continue; - } else if (rp->ap_state == ACPI_PWR_UNK) - rp->ap_state = cur; + } /* * Switch if required. Note that we ignore the result of the switch * effort; we don't know what to do if it fails, so checking wouldn't * help much. */ - if (rp->ap_state != ACPI_PWR_OFF) { + if (cur != ACPI_PWR_OFF) { status = AcpiEvaluateObject(rp->ap_resource, "_OFF", NULL, NULL); if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, @@ -705,7 +697,6 @@ acpi_pwr_switch_power(void) acpi_name(rp->ap_resource), AcpiFormatException(status))); } else { - rp->ap_state = ACPI_PWR_OFF; ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "switched %s off\n", acpi_name(rp->ap_resource))); } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 29 00:38:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 23B994E6; Sun, 29 Jun 2014 00:38: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 0EC27263E; Sun, 29 Jun 2014 00:38: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 s5T0c11u072835; Sun, 29 Jun 2014 00:38:01 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5T0c0TM072768; Sun, 29 Jun 2014 00:38:00 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201406290038.s5T0c0TM072768@svn.freebsd.org> From: Bryan Venteicher Date: Sun, 29 Jun 2014 00:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268010 - in stable/10/sys/dev/virtio: . network pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jun 2014 00:38:02 -0000 Author: bryanv Date: Sun Jun 29 00:37:59 2014 New Revision: 268010 URL: http://svnweb.freebsd.org/changeset/base/268010 Log: MFC r267520, r267521, r267522, r267523, r267524: - Remove two write-only local variables - Remove unused element in the vtnet_rxq structure - Remove kernel specific macro out of the VirtIO PCI header file - Move the VIRTIO_RING_F_* defines out of virtqueue.h into virtio_config.h - Make the feature negotiation code easier to follow - Force two byte alignment for all control message headers Modified: stable/10/sys/dev/virtio/network/if_vtnet.c stable/10/sys/dev/virtio/network/if_vtnetvar.h stable/10/sys/dev/virtio/pci/virtio_pci.c stable/10/sys/dev/virtio/pci/virtio_pci.h stable/10/sys/dev/virtio/virtio.h stable/10/sys/dev/virtio/virtio_config.h stable/10/sys/dev/virtio/virtqueue.c stable/10/sys/dev/virtio/virtqueue.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/10/sys/dev/virtio/network/if_vtnet.c Sat Jun 28 23:20:24 2014 (r268009) +++ stable/10/sys/dev/virtio/network/if_vtnet.c Sun Jun 29 00:37:59 2014 (r268010) @@ -550,37 +550,38 @@ vtnet_negotiate_features(struct vtnet_so mask |= VTNET_TSO_FEATURES; if (vtnet_tunable_int(sc, "lro_disable", vtnet_lro_disable)) mask |= VTNET_LRO_FEATURES; +#ifndef VTNET_LEGACY_TX if (vtnet_tunable_int(sc, "mq_disable", vtnet_mq_disable)) mask |= VIRTIO_NET_F_MQ; -#ifdef VTNET_LEGACY_TX +#else mask |= VIRTIO_NET_F_MQ; #endif features = VTNET_FEATURES & ~mask; sc->vtnet_features = virtio_negotiate_features(dev, features); - if (virtio_with_feature(dev, VTNET_LRO_FEATURES) == 0) - return; - if (virtio_with_feature(dev, VIRTIO_NET_F_MRG_RXBUF)) - return; - - /* - * LRO without mergeable buffers requires special care. This is not - * ideal because every receive buffer must be large enough to hold - * the maximum TCP packet, the Ethernet header, and the header. This - * requires up to 34 descriptors with MCLBYTES clusters. If we do - * not have indirect descriptors, LRO is disabled since the virtqueue - * will not contain very many receive buffers. - */ - if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC) == 0) { - device_printf(dev, - "LRO disabled due to both mergeable buffers and indirect " - "descriptors not negotiated\n"); + if (virtio_with_feature(dev, VTNET_LRO_FEATURES) && + virtio_with_feature(dev, VIRTIO_NET_F_MRG_RXBUF) == 0) { + /* + * LRO without mergeable buffers requires special care. This + * is not ideal because every receive buffer must be large + * enough to hold the maximum TCP packet, the Ethernet header, + * and the header. This requires up to 34 descriptors with + * MCLBYTES clusters. If we do not have indirect descriptors, + * LRO is disabled since the virtqueue will not contain very + * many receive buffers. + */ + if (!virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC)) { + device_printf(dev, + "LRO disabled due to both mergeable buffers and " + "indirect descriptors not negotiated\n"); - features &= ~VTNET_LRO_FEATURES; - sc->vtnet_features = virtio_negotiate_features(dev, features); - } else - sc->vtnet_flags |= VTNET_FLAG_LRO_NOMRG; + features &= ~VTNET_LRO_FEATURES; + sc->vtnet_features = + virtio_negotiate_features(dev, features); + } else + sc->vtnet_flags |= VTNET_FLAG_LRO_NOMRG; + } } static void @@ -2111,13 +2112,11 @@ fail: static int vtnet_txq_encap(struct vtnet_txq *txq, struct mbuf **m_head) { - struct vtnet_softc *sc; struct vtnet_tx_header *txhdr; struct virtio_net_hdr *hdr; struct mbuf *m; int error; - sc = txq->vtntx_sc; m = *m_head; M_ASSERTPKTHDR(m); @@ -2944,11 +2943,9 @@ vtnet_set_active_vq_pairs(struct vtnet_s static int vtnet_reinit(struct vtnet_softc *sc) { - device_t dev; struct ifnet *ifp; int error; - dev = sc->vtnet_dev; ifp = sc->vtnet_ifp; /* Use the current MAC address. */ @@ -3069,7 +3066,7 @@ vtnet_exec_ctrl_cmd(struct vtnet_softc * static int vtnet_ctrl_mac_cmd(struct vtnet_softc *sc, uint8_t *hwaddr) { - struct virtio_net_ctrl_hdr hdr; + struct virtio_net_ctrl_hdr hdr __aligned(2); struct sglist_seg segs[3]; struct sglist sg; uint8_t ack; @@ -3103,7 +3100,7 @@ vtnet_ctrl_mq_cmd(struct vtnet_softc *sc struct virtio_net_ctrl_mq mq; uint8_t pad2; uint8_t ack; - } s; + } s __aligned(2); int error; s.hdr.class = VIRTIO_NET_CTRL_MQ; @@ -3135,7 +3132,7 @@ vtnet_ctrl_rx_cmd(struct vtnet_softc *sc uint8_t onoff; uint8_t pad2; uint8_t ack; - } s; + } s __aligned(2); int error; KASSERT(sc->vtnet_flags & VTNET_FLAG_CTRL_RX, @@ -3218,7 +3215,7 @@ vtnet_rx_filter(struct vtnet_softc *sc) static void vtnet_rx_filter_mac(struct vtnet_softc *sc) { - struct virtio_net_ctrl_hdr hdr; + struct virtio_net_ctrl_hdr hdr __aligned(2); struct vtnet_mac_filter *filter; struct sglist_seg segs[4]; struct sglist sg; @@ -3331,7 +3328,7 @@ vtnet_exec_vlan_filter(struct vtnet_soft uint16_t tag; uint8_t pad2; uint8_t ack; - } s; + } s __aligned(2); int error; s.hdr.class = VIRTIO_NET_CTRL_VLAN; Modified: stable/10/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- stable/10/sys/dev/virtio/network/if_vtnetvar.h Sat Jun 28 23:20:24 2014 (r268009) +++ stable/10/sys/dev/virtio/network/if_vtnetvar.h Sun Jun 29 00:37:59 2014 (r268010) @@ -74,7 +74,6 @@ struct vtnet_rxq { struct virtqueue *vtnrx_vq; struct sglist *vtnrx_sg; int vtnrx_id; - int vtnrx_process_limit; struct vtnet_rxq_stats vtnrx_stats; struct taskqueue *vtnrx_tq; struct task vtnrx_intrtask; Modified: stable/10/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- stable/10/sys/dev/virtio/pci/virtio_pci.c Sat Jun 28 23:20:24 2014 (r268009) +++ stable/10/sys/dev/virtio/pci/virtio_pci.c Sun Jun 29 00:37:59 2014 (r268010) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -170,6 +169,9 @@ static void vtpci_config_intr(void *); #define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt +#define VIRTIO_PCI_CONFIG(_sc) \ + VIRTIO_PCI_CONFIG_OFF((((_sc)->vtpci_flags & VTPCI_FLAG_MSIX)) != 0) + /* * I/O port read/write wrappers. */ Modified: stable/10/sys/dev/virtio/pci/virtio_pci.h ============================================================================== --- stable/10/sys/dev/virtio/pci/virtio_pci.h Sat Jun 28 23:20:24 2014 (r268009) +++ stable/10/sys/dev/virtio/pci/virtio_pci.h Sun Jun 29 00:37:59 2014 (r268010) @@ -72,8 +72,7 @@ * The remaining space is defined by each driver as the per-driver * configuration space. */ -#define VIRTIO_PCI_CONFIG(sc) \ - (((sc)->vtpci_flags & VTPCI_FLAG_MSIX) ? 24 : 20) +#define VIRTIO_PCI_CONFIG_OFF(msix_enabled) ((msix_enabled) ? 24 : 20) /* * How many bits to shift physical queue address written to QUEUE_PFN. Modified: stable/10/sys/dev/virtio/virtio.h ============================================================================== --- stable/10/sys/dev/virtio/virtio.h Sat Jun 28 23:20:24 2014 (r268009) +++ stable/10/sys/dev/virtio/virtio.h Sun Jun 29 00:37:59 2014 (r268010) @@ -30,6 +30,7 @@ #define _VIRTIO_H_ #include +#include struct vq_alloc_info; Modified: stable/10/sys/dev/virtio/virtio_config.h ============================================================================== --- stable/10/sys/dev/virtio/virtio_config.h Sat Jun 28 23:20:24 2014 (r268009) +++ stable/10/sys/dev/virtio/virtio_config.h Sun Jun 29 00:37:59 2014 (r268010) @@ -44,6 +44,12 @@ */ #define VIRTIO_F_NOTIFY_ON_EMPTY (1 << 24) +/* Support for indirect buffer descriptors. */ +#define VIRTIO_RING_F_INDIRECT_DESC (1 << 28) + +/* Support to suppress interrupt until specific index is reached. */ +#define VIRTIO_RING_F_EVENT_IDX (1 << 29) + /* * The guest should never negotiate this feature; it * is used to detect faulty drivers. Modified: stable/10/sys/dev/virtio/virtqueue.c ============================================================================== --- stable/10/sys/dev/virtio/virtqueue.c Sat Jun 28 23:20:24 2014 (r268009) +++ stable/10/sys/dev/virtio/virtqueue.c Sun Jun 29 00:37:59 2014 (r268010) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: stable/10/sys/dev/virtio/virtqueue.h ============================================================================== --- stable/10/sys/dev/virtio/virtqueue.h Sat Jun 28 23:20:24 2014 (r268009) +++ stable/10/sys/dev/virtio/virtqueue.h Sun Jun 29 00:37:59 2014 (r268010) @@ -32,12 +32,6 @@ struct virtqueue; struct sglist; -/* Support for indirect buffer descriptors. */ -#define VIRTIO_RING_F_INDIRECT_DESC (1 << 28) - -/* Support to suppress interrupt until specific index is reached. */ -#define VIRTIO_RING_F_EVENT_IDX (1 << 29) - /* Device callback for a virtqueue interrupt. */ typedef void virtqueue_intr_t(void *); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 29 00:50:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 56B436D2; Sun, 29 Jun 2014 00:50: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 435A226E2; Sun, 29 Jun 2014 00:50: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 s5T0ovDl077886; Sun, 29 Jun 2014 00:50:57 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5T0ou1s077883; Sun, 29 Jun 2014 00:50:56 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201406290050.s5T0ou1s077883@svn.freebsd.org> From: Bryan Venteicher Date: Sun, 29 Jun 2014 00:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268011 - stable/10/sys/dev/vmware/vmxnet3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jun 2014 00:50:57 -0000 Author: bryanv Date: Sun Jun 29 00:50:56 2014 New Revision: 268011 URL: http://svnweb.freebsd.org/changeset/base/268011 Log: MFC r267661, r267662, r267663: - Remove an unnecessary kick of the host at the end of transmitting - Handle multiple calls to rxq_eof for single packet completion - Increment the pending packets more aggressively for TSO Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Sun Jun 29 00:37:59 2014 (r268010) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Sun Jun 29 00:50:56 2014 (r268011) @@ -166,7 +166,6 @@ static int vmxnet3_txq_load_mbuf(struct bus_dmamap_t, bus_dma_segment_t [], int *); static void vmxnet3_txq_unload_mbuf(struct vmxnet3_txqueue *, bus_dmamap_t); static int vmxnet3_txq_encap(struct vmxnet3_txqueue *, struct mbuf **); -static void vmxnet3_txq_update_pending(struct vmxnet3_txqueue *); #ifdef VMXNET3_LEGACY_TX static void vmxnet3_start_locked(struct ifnet *); static void vmxnet3_start(struct ifnet *); @@ -2086,17 +2085,25 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue * sc = rxq->vxrxq_sc; ifp = sc->vmx_ifp; rxc = &rxq->vxrxq_comp_ring; - m_head = m_tail = NULL; VMXNET3_RXQ_LOCK_ASSERT(rxq); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; + m_head = rxq->vxrxq_mhead; + rxq->vxrxq_mhead = NULL; + m_tail = rxq->vxrxq_mtail; + rxq->vxrxq_mtail = NULL; + MPASS(m_head == NULL || m_tail != NULL); + for (;;) { rxcd = &rxc->vxcr_u.rxcd[rxc->vxcr_next]; - if (rxcd->gen != rxc->vxcr_gen) + if (rxcd->gen != rxc->vxcr_gen) { + rxq->vxrxq_mhead = m_head; + rxq->vxrxq_mtail = m_tail; break; + } vmxnet3_barrier(sc, VMXNET3_BARRIER_RD); if (++rxc->vxcr_next == rxc->vxcr_ndesc) { @@ -2328,6 +2335,12 @@ vmxnet3_rxstop(struct vmxnet3_softc *sc, struct vmxnet3_rxbuf *rxb; int i, j; + if (rxq->vxrxq_mhead != NULL) { + m_freem(rxq->vxrxq_mhead); + rxq->vxrxq_mhead = NULL; + rxq->vxrxq_mtail = NULL; + } + for (i = 0; i < VMXNET3_RXRINGS_PERQ; i++) { rxr = &rxq->vxrxq_cmd_ring[i]; @@ -2839,7 +2852,8 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue vmxnet3_barrier(sc, VMXNET3_BARRIER_WR); sop->gen ^= 1; - if (++txq->vxtxq_ts->npending >= txq->vxtxq_ts->intr_threshold) { + txq->vxtxq_ts->npending += nsegs; + if (txq->vxtxq_ts->npending >= txq->vxtxq_ts->intr_threshold) { txq->vxtxq_ts->npending = 0; vmxnet3_write_bar0(sc, VMXNET3_BAR0_TXH(txq->vxtxq_id), txr->vxtxr_head); @@ -2848,20 +2862,6 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue return (0); } -static void -vmxnet3_txq_update_pending(struct vmxnet3_txqueue *txq) -{ - struct vmxnet3_txring *txr; - - txr = &txq->vxtxq_cmd_ring; - - if (txq->vxtxq_ts->npending > 0) { - txq->vxtxq_ts->npending = 0; - vmxnet3_write_bar0(txq->vxtxq_sc, - VMXNET3_BAR0_TXH(txq->vxtxq_id), txr->vxtxr_head); - } -} - #ifdef VMXNET3_LEGACY_TX static void @@ -2908,10 +2908,8 @@ vmxnet3_start_locked(struct ifnet *ifp) ETHER_BPF_MTAP(ifp, m_head); } - if (tx > 0) { - vmxnet3_txq_update_pending(txq); + if (tx > 0) txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT; - } } static void @@ -2972,8 +2970,7 @@ vmxnet3_txq_mq_start_locked(struct vmxne break; } - error = vmxnet3_txq_encap(txq, &m); - if (error) { + if (vmxnet3_txq_encap(txq, &m) != 0) { if (m != NULL) drbr_putback(ifp, br, m); else @@ -2986,10 +2983,8 @@ vmxnet3_txq_mq_start_locked(struct vmxne ETHER_BPF_MTAP(ifp, m); } - if (tx > 0) { - vmxnet3_txq_update_pending(txq); + if (tx > 0) txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT; - } return (0); } Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h Sun Jun 29 00:37:59 2014 (r268010) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h Sun Jun 29 00:50:56 2014 (r268011) @@ -168,6 +168,8 @@ struct vmxnet3_rxqueue { struct vmxnet3_softc *vxrxq_sc; int vxrxq_id; int vxrxq_intr_idx; + struct mbuf *vxrxq_mhead; + struct mbuf *vxrxq_mtail; struct vmxnet3_rxring vxrxq_cmd_ring[VMXNET3_RXRINGS_PERQ]; struct vmxnet3_comp_ring vxrxq_comp_ring; struct vmxnet3_rxq_stats vxrxq_stats; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 29 07:02:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DE85D663; Sun, 29 Jun 2014 07:02: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 BFEDD2F07; Sun, 29 Jun 2014 07:02: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 s5T72lnd048777; Sun, 29 Jun 2014 07:02:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5T72lsU048775; Sun, 29 Jun 2014 07:02:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406290702.s5T72lsU048775@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 29 Jun 2014 07:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268015 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jun 2014 07:02:48 -0000 Author: kib Date: Sun Jun 29 07:02:47 2014 New Revision: 268015 URL: http://svnweb.freebsd.org/changeset/base/268015 Log: MFC r267491: Use vn_io_fault for the writes from core dumping code. Modified: stable/10/sys/kern/vfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Sun Jun 29 02:28:05 2014 (r268014) +++ stable/10/sys/kern/vfs_vnops.c Sun Jun 29 07:02:47 2014 (r268015) @@ -8,7 +8,7 @@ * the permission of UNIX System Laboratories, Inc. * * Copyright (c) 2012 Konstantin Belousov - * Copyright (c) 2013 The FreeBSD Foundation + * Copyright (c) 2013, 2014 The FreeBSD Foundation * * Portions of this software were developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. @@ -106,6 +106,53 @@ struct fileops vnops = { .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; +static const int io_hold_cnt = 16; +static int vn_io_fault_enable = 1; +SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RW, + &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance"); +static u_long vn_io_faults_cnt; +SYSCTL_ULONG(_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD, + &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers"); + +/* + * Returns true if vn_io_fault mode of handling the i/o request should + * be used. + */ +static bool +do_vn_io_fault(struct vnode *vp, struct uio *uio) +{ + struct mount *mp; + + return (uio->uio_segflg == UIO_USERSPACE && vp->v_type == VREG && + (mp = vp->v_mount) != NULL && + (mp->mnt_kern_flag & MNTK_NO_IOPF) != 0 && vn_io_fault_enable); +} + +/* + * Structure used to pass arguments to vn_io_fault1(), to do either + * file- or vnode-based I/O calls. + */ +struct vn_io_fault_args { + enum { + VN_IO_FAULT_FOP, + VN_IO_FAULT_VOP + } kind; + struct ucred *cred; + int flags; + union { + struct fop_args_tag { + struct file *fp; + fo_rdwr_t *doio; + } fop_args; + struct vop_args_tag { + struct vnode *vp; + } vop_args; + } args; +}; + +static int vn_io_fault1(struct vnode *vp, struct uio *uio, + struct vn_io_fault_args *args, struct thread *td); + int vn_open(ndp, flagp, cmode, fp) struct nameidata *ndp; @@ -439,6 +486,7 @@ vn_rdwr(enum uio_rw rw, struct vnode *vp struct mount *mp; struct ucred *cred; void *rl_cookie; + struct vn_io_fault_args args; int error, lock_flags; auio.uio_iov = &aiov; @@ -493,10 +541,17 @@ vn_rdwr(enum uio_rw rw, struct vnode *vp cred = file_cred; else cred = active_cred; - if (rw == UIO_READ) + if (do_vn_io_fault(vp, &auio)) { + args.kind = VN_IO_FAULT_VOP; + args.cred = cred; + args.flags = ioflg; + args.args.vop_args.vp = vp; + error = vn_io_fault1(vp, &auio, &args, td); + } else if (rw == UIO_READ) { error = VOP_READ(vp, &auio, ioflg, cred); - else + } else /* if (rw == UIO_WRITE) */ { error = VOP_WRITE(vp, &auio, ioflg, cred); + } } if (aresid) *aresid = auio.uio_resid; @@ -883,14 +938,6 @@ unlock: return (error); } -static const int io_hold_cnt = 16; -static int vn_io_fault_enable = 1; -SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RW, - &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance"); -static u_long vn_io_faults_cnt; -SYSCTL_ULONG(_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD, - &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers"); - /* * The vn_io_fault() is a wrapper around vn_read() and vn_write() to * prevent the following deadlock: @@ -924,38 +971,55 @@ SYSCTL_ULONG(_debug, OID_AUTO, vn_io_fau * make the current i/o request atomic with respect to other i/os and * truncations. */ + +/* + * Decode vn_io_fault_args and perform the corresponding i/o. + */ static int -vn_io_fault(struct file *fp, struct uio *uio, struct ucred *active_cred, - int flags, struct thread *td) +vn_io_fault_doio(struct vn_io_fault_args *args, struct uio *uio, + struct thread *td) +{ + + switch (args->kind) { + case VN_IO_FAULT_FOP: + return ((args->args.fop_args.doio)(args->args.fop_args.fp, + uio, args->cred, args->flags, td)); + case VN_IO_FAULT_VOP: + if (uio->uio_rw == UIO_READ) { + return (VOP_READ(args->args.vop_args.vp, uio, + args->flags, args->cred)); + } else if (uio->uio_rw == UIO_WRITE) { + return (VOP_WRITE(args->args.vop_args.vp, uio, + args->flags, args->cred)); + } + break; + } + panic("vn_io_fault_doio: unknown kind of io %d %d", args->kind, + uio->uio_rw); +} + +/* + * Common code for vn_io_fault(), agnostic to the kind of i/o request. + * Uses vn_io_fault_doio() to make the call to an actual i/o function. + * Used from vn_rdwr() and vn_io_fault(), which encode the i/o request + * into args and call vn_io_fault1() to handle faults during the user + * mode buffer accesses. + */ +static int +vn_io_fault1(struct vnode *vp, struct uio *uio, struct vn_io_fault_args *args, + struct thread *td) { vm_page_t ma[io_hold_cnt + 2]; struct uio *uio_clone, short_uio; struct iovec short_iovec[1]; - fo_rdwr_t *doio; - struct vnode *vp; - void *rl_cookie; - struct mount *mp; vm_page_t *prev_td_ma; - int error, cnt, save, saveheld, prev_td_ma_cnt; - vm_offset_t addr, end; vm_prot_t prot; + vm_offset_t addr, end; size_t len, resid; ssize_t adv; + int error, cnt, save, saveheld, prev_td_ma_cnt; - if (uio->uio_rw == UIO_READ) - doio = vn_read; - else - doio = vn_write; - vp = fp->f_vnode; - foffset_lock_uio(fp, uio, flags); - - if (uio->uio_segflg != UIO_USERSPACE || vp->v_type != VREG || - ((mp = vp->v_mount) != NULL && - (mp->mnt_kern_flag & MNTK_NO_IOPF) == 0) || - !vn_io_fault_enable) { - error = doio(fp, uio, active_cred, flags | FOF_OFFSET, td); - goto out_last; - } + prot = uio->uio_rw == UIO_READ ? VM_PROT_WRITE : VM_PROT_READ; /* * The UFS follows IO_UNIT directive and replays back both @@ -973,22 +1037,8 @@ vn_io_fault(struct file *fp, struct uio short_uio.uio_rw = uio->uio_rw; short_uio.uio_td = uio->uio_td; - if (uio->uio_rw == UIO_READ) { - prot = VM_PROT_WRITE; - rl_cookie = vn_rangelock_rlock(vp, uio->uio_offset, - uio->uio_offset + uio->uio_resid); - } else { - prot = VM_PROT_READ; - if ((fp->f_flag & O_APPEND) != 0 || (flags & FOF_OFFSET) == 0) - /* For appenders, punt and lock the whole range. */ - rl_cookie = vn_rangelock_wlock(vp, 0, OFF_MAX); - else - rl_cookie = vn_rangelock_wlock(vp, uio->uio_offset, - uio->uio_offset + uio->uio_resid); - } - save = vm_fault_disable_pagefaults(); - error = doio(fp, uio, active_cred, flags | FOF_OFFSET, td); + error = vn_io_fault_doio(args, uio, td); if (error != EFAULT) goto out; @@ -1038,8 +1088,7 @@ vn_io_fault(struct file *fp, struct uio td->td_ma = ma; td->td_ma_cnt = cnt; - error = doio(fp, &short_uio, active_cred, flags | FOF_OFFSET, - td); + error = vn_io_fault_doio(args, &short_uio, td); vm_page_unhold_pages(ma, cnt); adv = len - short_uio.uio_resid; @@ -1060,9 +1109,45 @@ vn_io_fault(struct file *fp, struct uio curthread_pflags_restore(saveheld); out: vm_fault_enable_pagefaults(save); - vn_rangelock_unlock(vp, rl_cookie); free(uio_clone, M_IOV); -out_last: + return (error); +} + +static int +vn_io_fault(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) +{ + fo_rdwr_t *doio; + struct vnode *vp; + void *rl_cookie; + struct vn_io_fault_args args; + int error; + + doio = uio->uio_rw == UIO_READ ? vn_read : vn_write; + vp = fp->f_vnode; + foffset_lock_uio(fp, uio, flags); + if (do_vn_io_fault(vp, uio)) { + args.kind = VN_IO_FAULT_FOP; + args.args.fop_args.fp = fp; + args.args.fop_args.doio = doio; + args.cred = active_cred; + args.flags = flags | FOF_OFFSET; + if (uio->uio_rw == UIO_READ) { + rl_cookie = vn_rangelock_rlock(vp, uio->uio_offset, + uio->uio_offset + uio->uio_resid); + } else if ((fp->f_flag & O_APPEND) != 0 || + (flags & FOF_OFFSET) == 0) { + /* For appenders, punt and lock the whole range. */ + rl_cookie = vn_rangelock_wlock(vp, 0, OFF_MAX); + } else { + rl_cookie = vn_rangelock_wlock(vp, uio->uio_offset, + uio->uio_offset + uio->uio_resid); + } + error = vn_io_fault1(vp, uio, &args, td); + vn_rangelock_unlock(vp, rl_cookie); + } else { + error = doio(fp, uio, active_cred, flags | FOF_OFFSET, td); + } foffset_unlock_uio(fp, uio, flags); return (error); } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jun 29 18:54:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 923102F1; Sun, 29 Jun 2014 18:54: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 65B9D2075; Sun, 29 Jun 2014 18:54: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 s5TIsgmC077036; Sun, 29 Jun 2014 18:54:42 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5TIsgeu077034; Sun, 29 Jun 2014 18:54:42 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201406291854.s5TIsgeu077034@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 29 Jun 2014 18:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268019 - stable/10/usr.bin/sed X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jun 2014 18:54:42 -0000 Author: pfg Date: Sun Jun 29 18:54:41 2014 New Revision: 268019 URL: http://svnweb.freebsd.org/changeset/base/268019 Log: MFC r267692, r267703: Add -u (unbuffered output) after GNU sed. Obtained from: NetBSD Modified: stable/10/usr.bin/sed/main.c stable/10/usr.bin/sed/sed.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sed/main.c ============================================================================== --- stable/10/usr.bin/sed/main.c Sun Jun 29 18:53:15 2014 (r268018) +++ stable/10/usr.bin/sed/main.c Sun Jun 29 18:54:41 2014 (r268019) @@ -132,7 +132,7 @@ main(int argc, char *argv[]) fflag = 0; inplace = NULL; - while ((c = getopt(argc, argv, "EI:ae:f:i:lnr")) != -1) + while ((c = getopt(argc, argv, "EI:ae:f:i:lnru")) != -1) switch (c) { case 'r': /* Gnu sed compat */ case 'E': @@ -162,12 +162,16 @@ main(int argc, char *argv[]) ispan = 0; /* don't span across input files */ break; case 'l': - if(setlinebuf(stdout) != 0) - warnx("setlinebuf() failed"); + if(setvbuf(stdout, NULL, _IOLBF, 0) != 0) + warnx("setting line buffered output failed"); break; case 'n': nflag = 1; break; + case 'u': + if(setvbuf(stdout, NULL, _IONBF, 0) != 0) + warnx("setting unbuffered output failed"); + break; default: case '?': usage(); @@ -199,9 +203,10 @@ main(int argc, char *argv[]) static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n", - "usage: sed script [-Ealn] [-i extension] [file ...]", - " sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]"); + (void)fprintf(stderr, + "usage: %s script [-Ealnru] [-i[]] [file ...]\n" + "\t%s [-Ealnu] [-i[]] [-e script] ... [-f script_file]" + " ... [file ...]\n", getprogname(), getprogname()); exit(1); } Modified: stable/10/usr.bin/sed/sed.1 ============================================================================== --- stable/10/usr.bin/sed/sed.1 Sun Jun 29 18:53:15 2014 (r268018) +++ stable/10/usr.bin/sed/sed.1 Sun Jun 29 18:54:41 2014 (r268019) @@ -31,7 +31,7 @@ .\" @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd December 9, 2013 +.Dd June 20, 2014 .Dt SED 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Nd stream editor .Sh SYNOPSIS .Nm -.Op Fl Ealnr +.Op Fl Ealnru .Ar command .Op Ar .Nm @@ -148,6 +148,8 @@ option suppresses this behavior. Same as .Fl E for compatibility with GNU sed. +.It Fl u +Make output unbuffered. .El .Pp The form of a From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 09:38:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 36661DCF; Mon, 30 Jun 2014 09:38: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 0A58821DD; Mon, 30 Jun 2014 09:38: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 s5U9cE8Y087199; Mon, 30 Jun 2014 09:38:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U9cEQA087198; Mon, 30 Jun 2014 09:38:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406300938.s5U9cEQA087198@svn.freebsd.org> From: Marius Strobl Date: Mon, 30 Jun 2014 09:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268032 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 09:38:15 -0000 Author: marius Date: Mon Jun 30 09:38:14 2014 New Revision: 268032 URL: http://svnweb.freebsd.org/changeset/base/268032 Log: MFC: r267967, r267968 - SC_NO_SYSMOUSE isn't currently supported by vt(4), so nuke it from vt.4. - vt_vga(4) is a driver rather than a function so reference it accordingly. - Uncomment HISTORY section given that vt(4) will first appear in 9.3. Reviewed by: emaste (modulo last part) Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/share/man/man4/vt.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/vt.4 ============================================================================== --- stable/10/share/man/man4/vt.4 Mon Jun 30 09:38:09 2014 (r268031) +++ stable/10/share/man/man4/vt.4 Mon Jun 30 09:38:14 2014 (r268032) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2014 +.Dd June 27, 2014 .Dt "VIRTUAL TERMINALS" 4 .Os .Sh NAME @@ -37,7 +37,6 @@ .Cd "options VT_FB_DEFAULT_WIDTH=X" .Cd "options VT_FB_DEFAULT_HEIGHT=Y" .Cd "options SC_NO_CUTPASTE" -.Cd "options SC_NO_SYSMOUSE" .Cd "device vt" .Pp In @@ -139,7 +138,6 @@ version. .It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE .It Dv VT_MAXWINDOWS Ta Dv MAXCONS .It none Ta Dv SC_NO_CUTPASTE -.It none Ta Dv SC_NO_SYSMOUSE .El .Sh START-UP OPERATION WITH X86 BIOS SYSTEMS The computer BIOS starts in text mode, and @@ -153,13 +151,13 @@ is set, the system remains in text mode. Otherwise, .Nm switches to 640x480x16 VGA mode using -.Fn vt_vga . +.Xr vt_vga 4 . If a KMS .Pq Kernel Mode Switching video driver is available, the display is switched to high resolution and the KMS driver takes over. When a KMS driver is not available, -.Fn vt_vga +.Xr vt_vga 4 remains active. .Sh LOADER TUNABLES These settings can be entered at the @@ -201,12 +199,11 @@ terminal initialization information .Xr kbdmux 8 , .Xr kldload 8 , .Xr moused 8 -.\" WB: to be uncommented when an actual release contains vt(4) -.\" .Sh HISTORY -.\" The -.\" Nm -.\" driver first appeared in -.\" .Fx 9.3 . +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 9.3 . .Sh AUTHORS .An -nosplit The From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 09:48:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9D28AEFF; Mon, 30 Jun 2014 09:48: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 8838322C1; Mon, 30 Jun 2014 09:48: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 s5U9mkVJ091864; Mon, 30 Jun 2014 09:48:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U9miZO091853; Mon, 30 Jun 2014 09:48:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406300948.s5U9miZO091853@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jun 2014 09:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268033 - in stable/10/sys: amd64/amd64 amd64/include crypto/aesni crypto/via i386/include i386/isa X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 09:48:46 -0000 Author: kib Date: Mon Jun 30 09:48:44 2014 New Revision: 268033 URL: http://svnweb.freebsd.org/changeset/base/268033 Log: MFC r267767: Add FPU_KERN_KTHR flag to fpu_kern_enter(9). Apply the flag to padlock(4) and aesni(4). In aesni_cipher_process(), do not leak FPU context state on error. Modified: stable/10/sys/amd64/amd64/fpu.c stable/10/sys/amd64/include/fpu.h stable/10/sys/crypto/aesni/aesni_wrap.c stable/10/sys/crypto/via/padlock.c stable/10/sys/crypto/via/padlock_cipher.c stable/10/sys/crypto/via/padlock_hash.c stable/10/sys/i386/include/npx.h stable/10/sys/i386/isa/npx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/fpu.c ============================================================================== --- stable/10/sys/amd64/amd64/fpu.c Mon Jun 30 09:38:14 2014 (r268032) +++ stable/10/sys/amd64/amd64/fpu.c Mon Jun 30 09:48:44 2014 (r268033) @@ -890,6 +890,7 @@ static MALLOC_DEFINE(M_FPUKERN_CTX, "fpu "Kernel contexts for FPU state"); #define FPU_KERN_CTX_FPUINITDONE 0x01 +#define FPU_KERN_CTX_DUMMY 0x02 /* avoided save for the kern thread */ struct fpu_kern_ctx { struct savefpu *prev; @@ -933,6 +934,10 @@ fpu_kern_enter(struct thread *td, struct { struct pcb *pcb; + if ((flags & FPU_KERN_KTHR) != 0 && is_fpu_kern_thread(0)) { + ctx->flags = FPU_KERN_CTX_DUMMY; + return (0); + } pcb = td->td_pcb; KASSERT(!PCB_USER_FPU(pcb) || pcb->pcb_save == get_pcb_user_save_pcb(pcb), ("mangled pcb_save")); @@ -952,6 +957,9 @@ fpu_kern_leave(struct thread *td, struct { struct pcb *pcb; + if (is_fpu_kern_thread(0) && (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) + return (0); + KASSERT((ctx->flags & FPU_KERN_CTX_DUMMY) == 0, ("dummy ctx")); pcb = td->td_pcb; critical_enter(); if (curthread == PCPU_GET(fpcurthread)) Modified: stable/10/sys/amd64/include/fpu.h ============================================================================== --- stable/10/sys/amd64/include/fpu.h Mon Jun 30 09:38:14 2014 (r268032) +++ stable/10/sys/amd64/include/fpu.h Mon Jun 30 09:48:44 2014 (r268033) @@ -84,6 +84,7 @@ void fpu_save_area_reset(struct savefpu */ #define FPU_KERN_NORMAL 0x0000 #define FPU_KERN_NOWAIT 0x0001 +#define FPU_KERN_KTHR 0x0002 #endif Modified: stable/10/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- stable/10/sys/crypto/aesni/aesni_wrap.c Mon Jun 30 09:38:14 2014 (r268032) +++ stable/10/sys/crypto/aesni/aesni_wrap.c Mon Jun 30 09:48:44 2014 (r268033) @@ -382,22 +382,16 @@ int aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini) { struct thread *td; - int error, saved_ctx; + int error; td = curthread; - if (!is_fpu_kern_thread(0)) { - error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL); - saved_ctx = 1; - } else { - error = 0; - saved_ctx = 0; - } - if (error == 0) { - error = aesni_cipher_setup_common(ses, encini->cri_key, - encini->cri_klen); - if (saved_ctx) - fpu_kern_leave(td, ses->fpu_ctx); - } + error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL | + FPU_KERN_KTHR); + if (error != 0) + return (error); + error = aesni_cipher_setup_common(ses, encini->cri_key, + encini->cri_klen); + fpu_kern_leave(td, ses->fpu_ctx); return (error); } @@ -407,22 +401,17 @@ aesni_cipher_process(struct aesni_sessio { struct thread *td; uint8_t *buf; - int error, allocated, saved_ctx; + int error, allocated; buf = aesni_cipher_alloc(enccrd, crp, &allocated); if (buf == NULL) return (ENOMEM); td = curthread; - if (!is_fpu_kern_thread(0)) { - error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL); - if (error != 0) - goto out; - saved_ctx = 1; - } else { - saved_ctx = 0; - error = 0; - } + error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL | + FPU_KERN_KTHR); + if (error != 0) + goto out1; if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) { error = aesni_cipher_setup_common(ses, enccrd->crd_key, @@ -460,8 +449,6 @@ aesni_cipher_process(struct aesni_sessio ses->iv); } } - if (saved_ctx) - fpu_kern_leave(td, ses->fpu_ctx); if (allocated) crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, enccrd->crd_len, buf); @@ -469,7 +456,9 @@ aesni_cipher_process(struct aesni_sessio crypto_copydata(crp->crp_flags, crp->crp_buf, enccrd->crd_skip + enccrd->crd_len - AES_BLOCK_LEN, AES_BLOCK_LEN, ses->iv); - out: +out: + fpu_kern_leave(td, ses->fpu_ctx); +out1: if (allocated) { bzero(buf, enccrd->crd_len); free(buf, M_AESNI); Modified: stable/10/sys/crypto/via/padlock.c ============================================================================== --- stable/10/sys/crypto/via/padlock.c Mon Jun 30 09:38:14 2014 (r268032) +++ stable/10/sys/crypto/via/padlock.c Mon Jun 30 09:48:44 2014 (r268033) @@ -171,7 +171,7 @@ padlock_newsession(device_t dev, uint32_ struct padlock_session *ses = NULL; struct cryptoini *encini, *macini; struct thread *td; - int error, saved_ctx; + int error; if (sidp == NULL || cri == NULL) return (EINVAL); @@ -246,18 +246,11 @@ padlock_newsession(device_t dev, uint32_ if (macini != NULL) { td = curthread; - if (!is_fpu_kern_thread(0)) { - error = fpu_kern_enter(td, ses->ses_fpu_ctx, - FPU_KERN_NORMAL); - saved_ctx = 1; - } else { - error = 0; - saved_ctx = 0; - } + error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL | + FPU_KERN_KTHR); if (error == 0) { error = padlock_hash_setup(ses, macini); - if (saved_ctx) - fpu_kern_leave(td, ses->ses_fpu_ctx); + fpu_kern_leave(td, ses->ses_fpu_ctx); } if (error != 0) { padlock_freesession_one(sc, ses, 0); Modified: stable/10/sys/crypto/via/padlock_cipher.c ============================================================================== --- stable/10/sys/crypto/via/padlock_cipher.c Mon Jun 30 09:38:14 2014 (r268032) +++ stable/10/sys/crypto/via/padlock_cipher.c Mon Jun 30 09:48:44 2014 (r268033) @@ -205,7 +205,7 @@ padlock_cipher_process(struct padlock_se struct thread *td; u_char *buf, *abuf; uint32_t *key; - int allocated, error, saved_ctx; + int allocated, error; buf = padlock_cipher_alloc(enccrd, crp, &allocated); if (buf == NULL) @@ -250,21 +250,13 @@ padlock_cipher_process(struct padlock_se } td = curthread; - if (!is_fpu_kern_thread(0)) { - error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL); - saved_ctx = 1; - } else { - error = 0; - saved_ctx = 0; - } + error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL | + FPU_KERN_KTHR); if (error != 0) goto out; - padlock_cbc(abuf, abuf, enccrd->crd_len / AES_BLOCK_LEN, key, cw, ses->ses_iv); - - if (saved_ctx) - fpu_kern_leave(td, ses->ses_fpu_ctx); + fpu_kern_leave(td, ses->ses_fpu_ctx); if (allocated) { crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, Modified: stable/10/sys/crypto/via/padlock_hash.c ============================================================================== --- stable/10/sys/crypto/via/padlock_hash.c Mon Jun 30 09:38:14 2014 (r268032) +++ stable/10/sys/crypto/via/padlock_hash.c Mon Jun 30 09:48:44 2014 (r268033) @@ -366,24 +366,18 @@ padlock_hash_process(struct padlock_sess struct cryptop *crp) { struct thread *td; - int error, saved_ctx; + int error; td = curthread; - if (!is_fpu_kern_thread(0)) { - error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL); - saved_ctx = 1; - } else { - error = 0; - saved_ctx = 0; - } + error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL | + FPU_KERN_KTHR); if (error != 0) return (error); if ((maccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) padlock_hash_key_setup(ses, maccrd->crd_key, maccrd->crd_klen); error = padlock_authcompute(ses, maccrd, crp->crp_buf, crp->crp_flags); - if (saved_ctx) - fpu_kern_leave(td, ses->ses_fpu_ctx); + fpu_kern_leave(td, ses->ses_fpu_ctx); return (error); } Modified: stable/10/sys/i386/include/npx.h ============================================================================== --- stable/10/sys/i386/include/npx.h Mon Jun 30 09:38:14 2014 (r268032) +++ stable/10/sys/i386/include/npx.h Mon Jun 30 09:48:44 2014 (r268033) @@ -71,6 +71,7 @@ int is_fpu_kern_thread(u_int flags); */ #define FPU_KERN_NORMAL 0x0000 #define FPU_KERN_NOWAIT 0x0001 +#define FPU_KERN_KTHR 0x0002 #endif Modified: stable/10/sys/i386/isa/npx.c ============================================================================== --- stable/10/sys/i386/isa/npx.c Mon Jun 30 09:38:14 2014 (r268032) +++ stable/10/sys/i386/isa/npx.c Mon Jun 30 09:48:44 2014 (r268033) @@ -1008,6 +1008,7 @@ static MALLOC_DEFINE(M_FPUKERN_CTX, "fpu #define XSAVE_AREA_ALIGN 64 #define FPU_KERN_CTX_NPXINITDONE 0x01 +#define FPU_KERN_CTX_DUMMY 0x02 struct fpu_kern_ctx { union savefpu *prev; @@ -1051,6 +1052,10 @@ fpu_kern_enter(struct thread *td, struct { struct pcb *pcb; + if ((flags & FPU_KERN_KTHR) != 0 && is_fpu_kern_thread(0)) { + ctx->flags = FPU_KERN_CTX_DUMMY; + return (0); + } pcb = td->td_pcb; KASSERT(!PCB_USER_FPU(pcb) || pcb->pcb_save == &pcb->pcb_user_save, ("mangled pcb_save")); @@ -1070,6 +1075,8 @@ fpu_kern_leave(struct thread *td, struct { struct pcb *pcb; + if (is_fpu_kern_thread(0) && (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) + return (0); pcb = td->td_pcb; critical_enter(); if (curthread == PCPU_GET(fpcurthread)) From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 09:51:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2859AC85; Mon, 30 Jun 2014 09:51: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 0A796234A; Mon, 30 Jun 2014 09:51: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 s5U9pR9T092928; Mon, 30 Jun 2014 09:51:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U9pRa4092924; Mon, 30 Jun 2014 09:51:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406300951.s5U9pRa4092924@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jun 2014 09:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268034 - stable/10/sys/crypto/aesni X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 09:51:28 -0000 Author: kib Date: Mon Jun 30 09:51:27 2014 New Revision: 268034 URL: http://svnweb.freebsd.org/changeset/base/268034 Log: MFC r267815: Put the aesni_cipher_setup() and aesni_cipher_process() functions into the file which is compiled with SSE disabled. Modified: stable/10/sys/crypto/aesni/aesni.c stable/10/sys/crypto/aesni/aesni.h stable/10/sys/crypto/aesni/aesni_wrap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/crypto/aesni/aesni.c ============================================================================== --- stable/10/sys/crypto/aesni/aesni.c Mon Jun 30 09:48:44 2014 (r268033) +++ stable/10/sys/crypto/aesni/aesni.c Mon Jun 30 09:51:27 2014 (r268034) @@ -53,6 +53,10 @@ static int aesni_newsession(device_t, ui static int aesni_freesession(device_t, uint64_t tid); static void aesni_freesession_locked(struct aesni_softc *sc, struct aesni_session *ses); +static int aesni_cipher_setup(struct aesni_session *ses, + struct cryptoini *encini); +static int aesni_cipher_process(struct aesni_session *ses, + struct cryptodesc *enccrd, struct cryptop *crp); MALLOC_DEFINE(M_AESNI, "aesni_data", "AESNI Data"); @@ -354,3 +358,91 @@ static devclass_t aesni_devclass; DRIVER_MODULE(aesni, nexus, aesni_driver, aesni_devclass, 0, 0); MODULE_VERSION(aesni, 1); MODULE_DEPEND(aesni, crypto, 1, 1, 1); + +static int +aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini) +{ + struct thread *td; + int error; + + td = curthread; + error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL | + FPU_KERN_KTHR); + if (error != 0) + return (error); + error = aesni_cipher_setup_common(ses, encini->cri_key, + encini->cri_klen); + fpu_kern_leave(td, ses->fpu_ctx); + return (error); +} + +static int +aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd, + struct cryptop *crp) +{ + struct thread *td; + uint8_t *buf; + int error, allocated; + + buf = aesni_cipher_alloc(enccrd, crp, &allocated); + if (buf == NULL) + return (ENOMEM); + + td = curthread; + error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL | + FPU_KERN_KTHR); + if (error != 0) + goto out1; + + if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) { + error = aesni_cipher_setup_common(ses, enccrd->crd_key, + enccrd->crd_klen); + if (error != 0) + goto out; + } + + if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0) { + if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0) + bcopy(enccrd->crd_iv, ses->iv, AES_BLOCK_LEN); + if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) + crypto_copyback(crp->crp_flags, crp->crp_buf, + enccrd->crd_inject, AES_BLOCK_LEN, ses->iv); + if (ses->algo == CRYPTO_AES_CBC) { + aesni_encrypt_cbc(ses->rounds, ses->enc_schedule, + enccrd->crd_len, buf, buf, ses->iv); + } else /* if (ses->algo == CRYPTO_AES_XTS) */ { + aesni_encrypt_xts(ses->rounds, ses->enc_schedule, + ses->xts_schedule, enccrd->crd_len, buf, buf, + ses->iv); + } + } else { + if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0) + bcopy(enccrd->crd_iv, ses->iv, AES_BLOCK_LEN); + else + crypto_copydata(crp->crp_flags, crp->crp_buf, + enccrd->crd_inject, AES_BLOCK_LEN, ses->iv); + if (ses->algo == CRYPTO_AES_CBC) { + aesni_decrypt_cbc(ses->rounds, ses->dec_schedule, + enccrd->crd_len, buf, ses->iv); + } else /* if (ses->algo == CRYPTO_AES_XTS) */ { + aesni_decrypt_xts(ses->rounds, ses->dec_schedule, + ses->xts_schedule, enccrd->crd_len, buf, buf, + ses->iv); + } + } + if (allocated) + crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, + enccrd->crd_len, buf); + if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0) + crypto_copydata(crp->crp_flags, crp->crp_buf, + enccrd->crd_skip + enccrd->crd_len - AES_BLOCK_LEN, + AES_BLOCK_LEN, ses->iv); +out: + fpu_kern_leave(td, ses->fpu_ctx); +out1: + if (allocated) { + bzero(buf, enccrd->crd_len); + free(buf, M_AESNI); + } + return (error); +} Modified: stable/10/sys/crypto/aesni/aesni.h ============================================================================== --- stable/10/sys/crypto/aesni/aesni.h Mon Jun 30 09:48:44 2014 (r268033) +++ stable/10/sys/crypto/aesni/aesni.h Mon Jun 30 09:51:27 2014 (r268034) @@ -96,11 +96,8 @@ void aesni_decrypt_xts(int rounds, const const void *tweak_schedule /*__aligned(16)*/, size_t len, const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN]); -int aesni_cipher_setup(struct aesni_session *ses, - struct cryptoini *encini); -int aesni_cipher_process(struct aesni_session *ses, - struct cryptodesc *enccrd, struct cryptop *crp); - +int aesni_cipher_setup_common(struct aesni_session *ses, const uint8_t *key, + int keylen); uint8_t *aesni_cipher_alloc(struct cryptodesc *enccrd, struct cryptop *crp, int *allocated); Modified: stable/10/sys/crypto/aesni/aesni_wrap.c ============================================================================== --- stable/10/sys/crypto/aesni/aesni_wrap.c Mon Jun 30 09:48:44 2014 (r268033) +++ stable/10/sys/crypto/aesni/aesni_wrap.c Mon Jun 30 09:51:27 2014 (r268034) @@ -329,7 +329,7 @@ aesni_decrypt_xts(int rounds, const void iv, 0); } -static int +int aesni_cipher_setup_common(struct aesni_session *ses, const uint8_t *key, int keylen) { @@ -377,91 +377,3 @@ aesni_cipher_setup_common(struct aesni_s return (0); } - -int -aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini) -{ - struct thread *td; - int error; - - td = curthread; - error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL | - FPU_KERN_KTHR); - if (error != 0) - return (error); - error = aesni_cipher_setup_common(ses, encini->cri_key, - encini->cri_klen); - fpu_kern_leave(td, ses->fpu_ctx); - return (error); -} - -int -aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd, - struct cryptop *crp) -{ - struct thread *td; - uint8_t *buf; - int error, allocated; - - buf = aesni_cipher_alloc(enccrd, crp, &allocated); - if (buf == NULL) - return (ENOMEM); - - td = curthread; - error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL | - FPU_KERN_KTHR); - if (error != 0) - goto out1; - - if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) { - error = aesni_cipher_setup_common(ses, enccrd->crd_key, - enccrd->crd_klen); - if (error != 0) - goto out; - } - - if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0) { - if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0) - bcopy(enccrd->crd_iv, ses->iv, AES_BLOCK_LEN); - if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) - crypto_copyback(crp->crp_flags, crp->crp_buf, - enccrd->crd_inject, AES_BLOCK_LEN, ses->iv); - if (ses->algo == CRYPTO_AES_CBC) { - aesni_encrypt_cbc(ses->rounds, ses->enc_schedule, - enccrd->crd_len, buf, buf, ses->iv); - } else /* if (ses->algo == CRYPTO_AES_XTS) */ { - aesni_encrypt_xts(ses->rounds, ses->enc_schedule, - ses->xts_schedule, enccrd->crd_len, buf, buf, - ses->iv); - } - } else { - if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0) - bcopy(enccrd->crd_iv, ses->iv, AES_BLOCK_LEN); - else - crypto_copydata(crp->crp_flags, crp->crp_buf, - enccrd->crd_inject, AES_BLOCK_LEN, ses->iv); - if (ses->algo == CRYPTO_AES_CBC) { - aesni_decrypt_cbc(ses->rounds, ses->dec_schedule, - enccrd->crd_len, buf, ses->iv); - } else /* if (ses->algo == CRYPTO_AES_XTS) */ { - aesni_decrypt_xts(ses->rounds, ses->dec_schedule, - ses->xts_schedule, enccrd->crd_len, buf, buf, - ses->iv); - } - } - if (allocated) - crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, - enccrd->crd_len, buf); - if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0) - crypto_copydata(crp->crp_flags, crp->crp_buf, - enccrd->crd_skip + enccrd->crd_len - AES_BLOCK_LEN, - AES_BLOCK_LEN, ses->iv); -out: - fpu_kern_leave(td, ses->fpu_ctx); -out1: - if (allocated) { - bzero(buf, enccrd->crd_len); - free(buf, M_AESNI); - } - return (error); -} From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 09:54:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E9ADDC90; Mon, 30 Jun 2014 09:54:08 +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 B8FEF239B; Mon, 30 Jun 2014 09:54:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U9s8tt095994; Mon, 30 Jun 2014 09:54:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U9s8MA095993; Mon, 30 Jun 2014 09:54:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406300954.s5U9s8MA095993@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jun 2014 09:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268035 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 09:54:09 -0000 Author: kib Date: Mon Jun 30 09:54:08 2014 New Revision: 268035 URL: http://svnweb.freebsd.org/changeset/base/268035 Log: MFC r267768: Add documentation for the fpu_kern(9) interfaces. MFC r267785 (by brueffer): Several small fixes. Added: stable/10/share/man/man9/fpu_kern.9 - copied, changed from r267768, head/share/man/man9/fpu_kern.9 Modified: Directory Properties: stable/10/ (props changed) Copied and modified: stable/10/share/man/man9/fpu_kern.9 (from r267768, head/share/man/man9/fpu_kern.9) ============================================================================== --- head/share/man/man9/fpu_kern.9 Mon Jun 23 07:45:44 2014 (r267768, copy source) +++ stable/10/share/man/man9/fpu_kern.9 Mon Jun 30 09:54:08 2014 (r268035) @@ -23,8 +23,8 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 2014 -.Dt KERN_FPU 9 +.Dd June 23, 2014 +.Dt FPU_KERN 9 .Os .Sh NAME .Nm fpu_kern @@ -47,11 +47,11 @@ The .Nm family of functions allows the use of FPU hardware in kernel code. Modern FPUs are not limited to providing hardware implementation for -floating point arithmetic, they offer advanced accelerators for cryptography +floating point arithmetic; they offer advanced accelerators for cryptography and other computational-intensive algorithms. These facilities share registers with the FPU hardware. .Pp -Typical kernel code does not need to access to the FPU. +Typical kernel code does not need access to the FPU. Saving a large register file on each entry to the kernel would waste time. When kernel code uses the FPU, the current FPU state must be saved to @@ -80,6 +80,7 @@ without sleep. .It 0 No special handling is required. .El +.Pp The function returns the allocated context area, or .Va NULL if the allocation failed. @@ -121,6 +122,7 @@ The function correctly handles such contexts. .El .El +.Pp The function does not sleep or block. It could cause the .Nm Device Not Available @@ -173,7 +175,7 @@ and false otherwise. .Sh NOTES The .Nm -is currently implemented only for i386 and amd64 architectures. +is currently implemented only for the i386 and amd64 architectures. .Pp There is no way to handle floating point exceptions raised from kernel mode. From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 09:55:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E951045F; Mon, 30 Jun 2014 09:55: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 D5FFF23B0; Mon, 30 Jun 2014 09:55: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 s5U9tTe1096337; Mon, 30 Jun 2014 09:55:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U9tTch096336; Mon, 30 Jun 2014 09:55:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406300955.s5U9tTch096336@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jun 2014 09:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268036 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 09:55:30 -0000 Author: kib Date: Mon Jun 30 09:55:29 2014 New Revision: 268036 URL: http://svnweb.freebsd.org/changeset/base/268036 Log: MFC r267854: Add fpu_kern.9 man page to the install. Modified: stable/10/share/man/man9/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Mon Jun 30 09:54:08 2014 (r268035) +++ stable/10/share/man/man9/Makefile Mon Jun 30 09:55:29 2014 (r268036) @@ -112,6 +112,7 @@ MAN= accept_filter.9 \ fail.9 \ fetch.9 \ firmware.9 \ + fpu_kern.9 \ g_access.9 \ g_attach.9 \ g_bio.9 \ @@ -669,6 +670,12 @@ MLINKS+=fetch.9 fubyte.9 \ fetch.9 fuword16.9 \ fetch.9 fuword32.9 \ fetch.9 fuword64.9 +MLINKS+=fpu_kern.9 fpu_kern_alloc_ctx.9 \ + fpu_kern.9 fpu_kern_free_ctx.9 \ + fpu_kern.9 fpu_kern_enter.9 \ + fpu_kern.9 fpu_kern_leave.9 \ + fpu_kern.9 fpu_kern_thread.9 \ + fpu_kern.9 is_fpu_kern_thread.9 MLINKS+=g_attach.9 g_detach.9 MLINKS+=g_bio.9 g_clone_bio.9 \ g_bio.9 g_destroy_bio.9 \ From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 09:59:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 255DE749; Mon, 30 Jun 2014 09: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 EA17823E1; Mon, 30 Jun 2014 09:59: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 s5U9xORB096843; Mon, 30 Jun 2014 09:59:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U9xNeM096835; Mon, 30 Jun 2014 09:59:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406300959.s5U9xNeM096835@svn.freebsd.org> From: Marius Strobl Date: Mon, 30 Jun 2014 09:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268037 - in stable/10: share/man/man4 sys/conf sys/dev/vt sys/kern sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 09:59:25 -0000 Author: marius Date: Mon Jun 30 09:59:23 2014 New Revision: 268037 URL: http://svnweb.freebsd.org/changeset/base/268037 Log: MFC: r267978 In order to get vt(4) a bit closer to the feature set provided by sc(4), implement options TERMINAL_{KERN,NORM}_ATTR. These are aliased to SC_{KERNEL_CONS,NORM}_ATTR and like these latter, allow to change the default colors of normal and kernel text respectively. Note on the naming: Although affecting the output of vt(4), technically kern/subr_terminal.c is primarily concerned with changing default colors so it would be inconsistent to term these options VT_{KERN,NORM}_ATTR. Actually, if the architecture and abstraction of terminal+teken+vt would be perfect, dev/vt/* wouldn't be touched by this commit at all. Reviewed by: emaste Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/share/man/man4/vt.4 stable/10/sys/conf/options stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_buf.c stable/10/sys/dev/vt/vt_core.c stable/10/sys/kern/subr_terminal.c stable/10/sys/sys/terminal.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/vt.4 ============================================================================== --- stable/10/share/man/man4/vt.4 Mon Jun 30 09:55:29 2014 (r268036) +++ stable/10/share/man/man4/vt.4 Mon Jun 30 09:59:23 2014 (r268037) @@ -31,6 +31,8 @@ .Nm vt .Nd virtual terminal console driver .Sh SYNOPSIS +.Cd "options TERMINAL_KERN_ATTR=_attribute_" +.Cd "options TERMINAL_NORM_ATTR=_attribute_" .Cd "options VT_MAXWINDOWS=N" .Cd "options VT_ALT_TO_ESC_HACK=1" .Cd "options VT_TWOBUTTON_MOUSE" @@ -106,6 +108,15 @@ These kernel options control the .Nm driver. .Bl -tag -width MAXCONS +.It Dv TERMINAL_NORM_ATTR=_attribute_ +.It Dv TERMINAL_KERN_ATTR=_attribute_ +These options allow to change the default colors used for normal and kernel +text respectively. +Available colors are defined in +.In sys/terminal.h . +See +.Sx EXAMPLES +below. .It Dv VT_MAXWINDOWS=N Set the number of virtual terminals to be created to .Fa N . @@ -135,6 +146,8 @@ These options will be removed in a futur version. .Bl -column -offset indent ".Sy vt VT_TWOBUTTON_MOUSE" ".Sy SC_TWOBUTTON_MOUSE" .It Sy vt Option Name Ta Sy sc Option Name +.It Dv TERMINAL_KERN_ATTR Ta Dv SC_KERNEL_CONS_ATTR +.It Dv TERMINAL_NORM_ATTR Ta Dv SC_NORM_ATTR .It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE .It Dv VT_MAXWINDOWS Ta Dv MAXCONS .It none Ta Dv SC_NO_CUTPASTE @@ -170,6 +183,21 @@ Set to 1 to use virtual terminals in tex Features that require graphics mode, like loadable fonts, will be disabled. .El +.Sh EXAMPLES +The following line will change the default color of normal text. +Normal text will be green on black background. +Reversed normal text will be black on green background. +Note that you cannot put any white space inside the quoted string, +because of the current implementation of +.Xr config 8 . +.Pp +.Dl "options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)" +.Pp +The following line will change the default color of kernel messages. +Kernel messages will be printed bright red on black background. +Reversed kernel messages will be black on bright red background. +.Pp +.Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)" .Sh FILES .Bl -tag -width /usr/share/syscons/keymaps/* -compact .It Pa /dev/console Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Mon Jun 30 09:55:29 2014 (r268036) +++ stable/10/sys/conf/options Mon Jun 30 09:59:23 2014 (r268037) @@ -765,10 +765,11 @@ SC_TWOBUTTON_MOUSE opt_syscons.h DEV_SC opt_syscons.h DEV_VT opt_syscons.h - # teken terminal emulator options TEKEN_CONS25 opt_teken.h TEKEN_UTF8 opt_teken.h +TERMINAL_KERN_ATTR opt_teken.h +TERMINAL_NORM_ATTR opt_teken.h # options for printf PRINTF_BUFR_SIZE opt_printf.h Modified: stable/10/sys/dev/vt/vt.h ============================================================================== --- stable/10/sys/dev/vt/vt.h Mon Jun 30 09:55:29 2014 (r268036) +++ stable/10/sys/dev/vt/vt.h Mon Jun 30 09:59:23 2014 (r268037) @@ -230,7 +230,7 @@ void vtbuf_extract_marked(struct vt_buf ((mask)->vbm_row & ((uint64_t)1 << ((row) % 64))) #define VTBUF_DIRTYCOL(mask, col) \ ((mask)->vbm_col & ((uint64_t)1 << ((col) % 64))) -#define VTBUF_SPACE_CHAR (' ' | TC_WHITE << 26 | TC_BLACK << 29) +#define VTBUF_SPACE_CHAR(attr) (' ' | (attr)) #define VHS_SET 0 #define VHS_CUR 1 Modified: stable/10/sys/dev/vt/vt_buf.c ============================================================================== --- stable/10/sys/dev/vt/vt_buf.c Mon Jun 30 09:55:29 2014 (r268036) +++ stable/10/sys/dev/vt/vt_buf.c Mon Jun 30 09:59:23 2014 (r268037) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -385,13 +386,13 @@ vtbuf_init_rows(struct vt_buf *vb) vb->vb_history_size = MAX(vb->vb_history_size, vb->vb_scr_size.tp_row); for (r = 0; r < vb->vb_history_size; r++) - vb->vb_rows[r] = &vb->vb_buffer[r * - vb->vb_scr_size.tp_col]; + vb->vb_rows[r] = &vb->vb_buffer[r * vb->vb_scr_size.tp_col]; } void vtbuf_init_early(struct vt_buf *vb) { + term_rect_t rect; vb->vb_flags |= VBF_CURSOR; vb->vb_roffset = 0; @@ -402,6 +403,10 @@ vtbuf_init_early(struct vt_buf *vb) vb->vb_mark_end.tp_col = 0; vtbuf_init_rows(vb); + rect.tr_begin.tp_row = rect.tr_begin.tp_col = 0; + rect.tr_end = vb->vb_scr_size; + vtbuf_fill(vb, &rect, VTBUF_SPACE_CHAR((boothowto & RB_MUTE) == 0 ? + TERMINAL_KERN_ATTR : TERMINAL_NORM_ATTR)); vtbuf_make_undirty(vb); if ((vb->vb_flags & VBF_MTX_INIT) == 0) { mtx_init(&vb->vb_lock, "vtbuf", NULL, MTX_SPIN); @@ -474,20 +479,27 @@ vtbuf_grow(struct vt_buf *vb, const term /* Copy history and fill extra space. */ for (r = 0; r < history_size; r ++) { + /* + * XXX VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR) will + * extended lines of kernel text using the wrong + * background color. + */ row = rows[r]; if (r < h) { /* Copy. */ memmove(rows[r], copyrows[r], MIN(p->tp_col, w) * sizeof(term_char_t)); for (c = MIN(p->tp_col, w); c < p->tp_col; c++) { - row[c] = VTBUF_SPACE_CHAR; + row[c] = VTBUF_SPACE_CHAR( + TERMINAL_NORM_ATTR); } } else { /* Just fill. */ rect.tr_begin.tp_col = 0; rect.tr_begin.tp_row = r; rect.tr_end.tp_col = p->tp_col; rect.tr_end.tp_row = p->tp_row; - vtbuf_fill(vb, &rect, VTBUF_SPACE_CHAR); + vtbuf_fill(vb, &rect, + VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR)); break; } } Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Mon Jun 30 09:55:29 2014 (r268036) +++ stable/10/sys/dev/vt/vt_core.c Mon Jun 30 09:59:23 2014 (r268037) @@ -956,6 +956,8 @@ vtterm_cnprobe(struct terminal *tm, stru struct vt_window *vw = tm->tm_softc; struct vt_device *vd = vw->vw_device; struct winsize wsz; + term_attr_t attr; + term_char_t c; if (vd->vd_flags & VDF_INITIALIZED) /* Initialization already done. */ @@ -997,7 +999,12 @@ vtterm_cnprobe(struct terminal *tm, stru vtbuf_init_early(&vw->vw_buf); vt_winsize(vd, vw->vw_font, &wsz); - terminal_set_winsize(tm, &wsz); + c = (boothowto & RB_MUTE) == 0 ? TERMINAL_KERN_ATTR : + TERMINAL_NORM_ATTR; + attr.ta_format = TCHAR_FORMAT(c); + attr.ta_fgcolor = TCHAR_FGCOLOR(c); + attr.ta_bgcolor = TCHAR_BGCOLOR(c); + terminal_set_winsize_blank(tm, &wsz, 1, &attr); if (vtdbest != NULL) { #ifdef DEV_SPLASH @@ -1155,7 +1162,7 @@ vt_change_font(struct vt_window *vw, str /* Grow the screen buffer and terminal. */ terminal_mute(tm, 1); vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); - terminal_set_winsize_blank(tm, &wsz, 0); + terminal_set_winsize_blank(tm, &wsz, 0, NULL); terminal_mute(tm, 0); /* Actually apply the font to the current window. */ @@ -2116,7 +2123,7 @@ vt_allocate(struct vt_driver *drv, void /* Update console window sizes to actual. */ vt_winsize(vd, vd->vd_windows[VT_CONSWINDOW]->vw_font, &wsz); terminal_set_winsize_blank(vd->vd_windows[VT_CONSWINDOW]->vw_terminal, - &wsz, 0); + &wsz, 0, NULL); } void Modified: stable/10/sys/kern/subr_terminal.c ============================================================================== --- stable/10/sys/kern/subr_terminal.c Mon Jun 30 09:55:29 2014 (r268036) +++ stable/10/sys/kern/subr_terminal.c Mon Jun 30 09:59:23 2014 (r268037) @@ -119,20 +119,20 @@ static teken_funcs_t terminal_drawmethod /* Kernel message formatting. */ static const teken_attr_t kernel_message = { - .ta_fgcolor = TC_WHITE, - .ta_bgcolor = TC_BLACK, - .ta_format = TF_BOLD, + .ta_fgcolor = TCHAR_FGCOLOR(TERMINAL_KERN_ATTR), + .ta_bgcolor = TCHAR_BGCOLOR(TERMINAL_KERN_ATTR), + .ta_format = TCHAR_FORMAT(TERMINAL_KERN_ATTR) }; static const teken_attr_t default_message = { - .ta_fgcolor = TC_WHITE, - .ta_bgcolor = TC_BLACK, + .ta_fgcolor = TCHAR_FGCOLOR(TERMINAL_NORM_ATTR), + .ta_bgcolor = TCHAR_BGCOLOR(TERMINAL_NORM_ATTR), + .ta_format = TCHAR_FORMAT(TERMINAL_NORM_ATTR) }; -#define TCHAR_CREATE(c, a) ((c) | \ - (a)->ta_format << 21 | \ - teken_256to8((a)->ta_fgcolor) << 26 | \ - teken_256to8((a)->ta_bgcolor) << 29) +#define TCHAR_CREATE(c, a) ((c) | TFORMAT((a)->ta_format) | \ + TCOLOR_FG(teken_256to8((a)->ta_fgcolor)) | \ + TCOLOR_BG(teken_256to8((a)->ta_bgcolor))) static void terminal_init(struct terminal *tm) @@ -191,7 +191,7 @@ terminal_maketty(struct terminal *tm, co void terminal_set_winsize_blank(struct terminal *tm, const struct winsize *size, - int blank) + int blank, const term_attr_t *attr) { term_rect_t r; @@ -209,8 +209,8 @@ terminal_set_winsize_blank(struct termin TERMINAL_UNLOCK(tm); if ((blank != 0) && !(tm->tm_flags & TF_MUTE)) - tm->tm_class->tc_fill(tm, &r, TCHAR_CREATE((teken_char_t)' ', - &default_message)); + tm->tm_class->tc_fill(tm, &r, + TCHAR_CREATE((teken_char_t)' ', attr)); terminal_sync_ttysize(tm); } @@ -219,7 +219,8 @@ void terminal_set_winsize(struct terminal *tm, const struct winsize *size) { - terminal_set_winsize_blank(tm, size, 1); + terminal_set_winsize_blank(tm, size, 1, + (const term_attr_t *)&default_message); } /* Modified: stable/10/sys/sys/terminal.h ============================================================================== --- stable/10/sys/sys/terminal.h Mon Jun 30 09:55:29 2014 (r268036) +++ stable/10/sys/sys/terminal.h Mon Jun 30 09:59:23 2014 (r268037) @@ -41,6 +41,9 @@ #include +#include "opt_syscons.h" +#include "opt_teken.h" + struct terminal; struct thread; struct tty; @@ -71,11 +74,71 @@ typedef uint32_t term_char_t; #define TCHAR_CHARACTER(c) ((c) & 0x1fffff) #define TCHAR_FORMAT(c) (((c) >> 21) & 0x1f) #define TCHAR_FGCOLOR(c) (((c) >> 26) & 0x7) -#define TCHAR_BGCOLOR(c) ((c) >> 29) +#define TCHAR_BGCOLOR(c) (((c) >> 29) & 0x7) + +typedef teken_attr_t term_attr_t; typedef teken_color_t term_color_t; +#define TCOLOR_FG(c) (((c) & 0x7) << 26) +#define TCOLOR_BG(c) (((c) & 0x7) << 29) #define TCOLOR_LIGHT(c) ((c) | 0x8) #define TCOLOR_DARK(c) ((c) & ~0x8) + +#define TFORMAT(c) (((c) & 0x1f) << 21) + +/* syscons(4) compatible color attributes for foreground text */ +#define FG_BLACK TCOLOR_FG(TC_BLACK) +#define FG_BLUE TCOLOR_FG(TC_BLUE) +#define FG_GREEN TCOLOR_FG(TC_GREEN) +#define FG_CYAN TCOLOR_FG(TC_CYAN) +#define FG_RED TCOLOR_FG(TC_RED) +#define FG_MAGENTA TCOLOR_FG(TC_MAGENTA) +#define FG_BROWN TCOLOR_FG(TC_BROWN) +#define FG_LIGHTGREY TCOLOR_FG(TC_WHITE) +#define FG_DARKGREY (TFORMAT(TF_BOLD) | TCOLOR_FG(TC_BLACK)) +#define FG_LIGHTBLUE (TFORMAT(TF_BOLD) | TCOLOR_FG(TC_BLUE)) +#define FG_LIGHTGREEN (TFORMAT(TF_BOLD) | TCOLOR_FG(TC_GREEN)) +#define FG_LIGHTCYAN (TFORMAT(TF_BOLD) | TCOLOR_FG(TC_CYAN)) +#define FG_LIGHTRED (TFORMAT(TF_BOLD) | TCOLOR_FG(TC_RED)) +#define FG_LIGHTMAGENTA (TFORMAT(TF_BOLD) | TCOLOR_FG(TC_MAGENTA)) +#define FG_YELLOW (TFORMAT(TF_BOLD) | TCOLOR_FG(TC_BROWN)) +#define FG_WHITE (TFORMAT(TF_BOLD) | TCOLOR_FG(TC_WHITE)) +#define FG_BLINK TFORMAT(TF_BLINK) + +/* syscons(4) compatible color attributes for text background */ +#define BG_BLACK TCOLOR_BG(TC_BLACK) +#define BG_BLUE TCOLOR_BG(TC_BLUE) +#define BG_GREEN TCOLOR_BG(TC_GREEN) +#define BG_CYAN TCOLOR_BG(TC_CYAN) +#define BG_RED TCOLOR_BG(TC_RED) +#define BG_MAGENTA TCOLOR_BG(TC_MAGENTA) +#define BG_BROWN TCOLOR_BG(TC_BROWN) +#define BG_LIGHTGREY TCOLOR_BG(TC_WHITE) +#define BG_DARKGREY (TFORMAT(TF_BOLD) | TCOLOR_BG(TC_BLACK)) +#define BG_LIGHTBLUE (TFORMAT(TF_BOLD) | TCOLOR_BG(TC_BLUE)) +#define BG_LIGHTGREEN (TFORMAT(TF_BOLD) | TCOLOR_BG(TC_GREEN)) +#define BG_LIGHTCYAN (TFORMAT(TF_BOLD) | TCOLOR_BG(TC_CYAN)) +#define BG_LIGHTRED (TFORMAT(TF_BOLD) | TCOLOR_BG(TC_RED)) +#define BG_LIGHTMAGENTA (TFORMAT(TF_BOLD) | TCOLOR_BG(TC_MAGENTA)) +#define BG_YELLOW (TFORMAT(TF_BOLD) | TCOLOR_BG(TC_BROWN)) +#define BG_WHITE (TFORMAT(TF_BOLD) | TCOLOR_BG(TC_WHITE)) + +#ifndef TERMINAL_NORM_ATTR +#ifdef SC_NORM_ATTR +#define TERMINAL_NORM_ATTR SC_NORM_ATTR +#else +#define TERMINAL_NORM_ATTR (FG_LIGHTGREY | BG_BLACK) +#endif +#endif + +#ifndef TERMINAL_KERN_ATTR +#ifdef SC_KERNEL_CONS_ATTR +#define TERMINAL_KERN_ATTR SC_KERNEL_CONS_ATTR +#else +#define TERMINAL_KERN_ATTR (FG_WHITE | BG_BLACK) +#endif +#endif + typedef teken_pos_t term_pos_t; typedef teken_rect_t term_rect_t; @@ -138,7 +201,7 @@ struct terminal { struct terminal *terminal_alloc(const struct terminal_class *tc, void *softc); void terminal_maketty(struct terminal *tm, const char *fmt, ...); void terminal_set_winsize_blank(struct terminal *tm, - const struct winsize *size, int blank); + const struct winsize *size, int blank, const term_attr_t *attr); void terminal_set_winsize(struct terminal *tm, const struct winsize *size); void terminal_mute(struct terminal *tm, int yes); void terminal_input_char(struct terminal *tm, term_char_t c); From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 14:52:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5757CAC; Mon, 30 Jun 2014 14:52: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 43E6E2FF0; Mon, 30 Jun 2014 14:52: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 s5UEqf0k038498; Mon, 30 Jun 2014 14:52:41 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UEqfIg038497; Mon, 30 Jun 2014 14:52:41 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201406301452.s5UEqfIg038497@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 30 Jun 2014 14:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268043 - stable/10/lib/libc/stdtime X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 14:52:41 -0000 Author: pfg Date: Mon Jun 30 14:52:40 2014 New Revision: 268043 URL: http://svnweb.freebsd.org/changeset/base/268043 Log: MFC r267627: strptime: add support for %t and %n Posix strptime() requires support for %t and %n, which were added to the illumos port. Curiously we were skipping white spaces by default in most other cases making %t meaningless. We now skip spaces in the case of the %e specifier as strftime(3) explicitly adds a space for the single digit case. Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html PR: 173421 Obtained from: Illumos (Rev. a11c1571b6942161b0186d0588609448066892c2) Modified: stable/10/lib/libc/stdtime/strptime.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdtime/strptime.c ============================================================================== --- stable/10/lib/libc/stdtime/strptime.c Mon Jun 30 14:15:16 2014 (r268042) +++ stable/10/lib/libc/stdtime/strptime.c Mon Jun 30 14:52:40 2014 (r268043) @@ -1,4 +1,6 @@ /*- + * Copyright (c) 2014 Gary Mills + * Copyright 2011, Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1994 Powerdog Industries. All rights reserved. * * Copyright (c) 2011 The FreeBSD Foundation @@ -224,11 +226,6 @@ label: tm->tm_sec = i; } - if (*buf != 0 && - isspace_l((unsigned char)*buf, locale)) - while (*ptr != 0 && - !isspace_l((unsigned char)*ptr, locale)) - ptr++; break; case 'H': @@ -261,11 +258,6 @@ label: tm->tm_hour = i; - if (*buf != 0 && - isspace_l((unsigned char)*buf, locale)) - while (*ptr != 0 && - !isspace_l((unsigned char)*ptr, locale)) - ptr++; break; case 'p': @@ -335,11 +327,6 @@ label: if (i > 53) return (NULL); - if (*buf != 0 && - isspace_l((unsigned char)*buf, locale)) - while (*ptr != 0 && - !isspace_l((unsigned char)*ptr, locale)) - ptr++; break; case 'w': @@ -352,18 +339,22 @@ label: tm->tm_wday = i; - if (*buf != 0 && - isspace_l((unsigned char)*buf, locale)) - while (*ptr != 0 && - !isspace_l((unsigned char)*ptr, locale)) - ptr++; break; - case 'd': case 'e': /* - * The %e specifier is explicitly documented as not - * being zero-padded but there is no harm in allowing + * With %e format, our strftime(3) adds a blank space + * before single digits. + */ + if (*buf != 0 && + isspace_l((unsigned char)*buf, locale)) + buf++; + /* FALLTHROUGH */ + case 'd': + /* + * The %e specifier was once explicitly documented as + * not being zero-padded but was later changed to + * equivalent to %d. There is no harm in allowing * such padding. * * XXX The %e specifier may gobble one too many @@ -384,11 +375,6 @@ label: tm->tm_mday = i; - if (*buf != 0 && - isspace_l((unsigned char)*buf, locale)) - while (*ptr != 0 && - !isspace_l((unsigned char)*ptr, locale)) - ptr++; break; case 'B': @@ -445,11 +431,6 @@ label: tm->tm_mon = i - 1; - if (*buf != 0 && - isspace_l((unsigned char)*buf, locale)) - while (*ptr != 0 && - !isspace_l((unsigned char)*ptr, locale)) - ptr++; break; case 's': @@ -498,11 +479,6 @@ label: tm->tm_year = i; - if (*buf != 0 && - isspace_l((unsigned char)*buf, locale)) - while (*ptr != 0 && - !isspace_l((unsigned char)*ptr, locale)) - ptr++; break; case 'Z': @@ -559,6 +535,12 @@ label: *GMTp = 1; } break; + + case 'n': + case 't': + while (isspace_l((unsigned char)*buf, locale)) + buf++; + break; } } return ((char *)buf); From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 16:23:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 771E92B9; Mon, 30 Jun 2014 16:23:33 +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 58DBF2939; Mon, 30 Jun 2014 16:23:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UGNX7G083467; Mon, 30 Jun 2014 16:23:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UGNWeR083459; Mon, 30 Jun 2014 16:23:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406301623.s5UGNWeR083459@svn.freebsd.org> From: Xin LI Date: Mon, 30 Jun 2014 16:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268046 - stable/10/sys/dev/oce X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 16:23:33 -0000 Author: delphij Date: Mon Jun 30 16:23:31 2014 New Revision: 268046 URL: http://svnweb.freebsd.org/changeset/base/268046 Log: MFC r267839: Apply vendor fixes for big endian support and 20GBps/25GBps link speeds. Many thanks to Emulex for their continued support of FreeBSD! Submitted by: Venkata Duvvuru Modified: stable/10/sys/dev/oce/oce_hw.c stable/10/sys/dev/oce/oce_hw.h stable/10/sys/dev/oce/oce_if.c stable/10/sys/dev/oce/oce_if.h stable/10/sys/dev/oce/oce_mbox.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/oce/oce_hw.c ============================================================================== --- stable/10/sys/dev/oce/oce_hw.c Mon Jun 30 16:18:38 2014 (r268045) +++ stable/10/sys/dev/oce/oce_hw.c Mon Jun 30 16:23:31 2014 (r268046) @@ -487,11 +487,7 @@ oce_hw_start(POCE_SOFTC sc) if_link_state_change(sc->ifp, LINK_STATE_DOWN); } - if (link.mac_speed > 0 && link.mac_speed < 5) - sc->link_speed = link.mac_speed; - else - sc->link_speed = 0; - + sc->link_speed = link.phys_port_speed; sc->qos_link_speed = (uint32_t )link.qos_link_speed * 10; rc = oce_start_mq(sc->mq); Modified: stable/10/sys/dev/oce/oce_hw.h ============================================================================== --- stable/10/sys/dev/oce/oce_hw.h Mon Jun 30 16:18:38 2014 (r268045) +++ stable/10/sys/dev/oce/oce_hw.h Mon Jun 30 16:23:31 2014 (r268046) @@ -1023,7 +1023,7 @@ struct mbx_hdr { #define OCE_MBX_ADDL_STATUS(_MHDR) ((_MHDR)->u0.rsp.additional_status) #define OCE_MBX_STATUS(_MHDR) ((_MHDR)->u0.rsp.status) -/* [05] OPCODE_COMMON_QUERY_LINK_CONFIG */ +/* [05] OPCODE_COMMON_QUERY_LINK_CONFIG_V1 */ struct mbx_query_common_link_config { struct mbx_hdr hdr; union { @@ -1032,16 +1032,37 @@ struct mbx_query_common_link_config { } req; struct { - /* dw 0 */ - uint8_t physical_port; - uint8_t mac_duplex; - uint8_t mac_speed; - uint8_t mac_fault; - /* dw 1 */ - uint8_t mgmt_mac_duplex; - uint8_t mgmt_mac_speed; + #ifdef _BIG_ENDIAN + uint32_t physical_port_fault:8; + uint32_t physical_port_speed:8; + uint32_t link_duplex:8; + uint32_t pt:2; + uint32_t port_number:6; + uint16_t qos_link_speed; - uint32_t logical_link_status; + uint16_t rsvd0; + + uint32_t rsvd1:21; + uint32_t phys_fcv:1; + uint32_t phys_rxf:1; + uint32_t phys_txf:1; + uint32_t logical_link_status:8; + #else + uint32_t port_number:6; + uint32_t pt:2; + uint32_t link_duplex:8; + uint32_t physical_port_speed:8; + uint32_t physical_port_fault:8; + + uint16_t rsvd0; + uint16_t qos_link_speed; + + uint32_t logical_link_status:8; + uint32_t phys_txf:1; + uint32_t phys_rxf:1; + uint32_t phys_fcv:1; + uint32_t rsvd1:21; + #endif } rsp; } params; }; Modified: stable/10/sys/dev/oce/oce_if.c ============================================================================== --- stable/10/sys/dev/oce/oce_if.c Mon Jun 30 16:18:38 2014 (r268045) +++ stable/10/sys/dev/oce/oce_if.c Mon Jun 30 16:23:31 2014 (r268046) @@ -829,10 +829,21 @@ oce_media_status(struct ifnet *ifp, stru req->ifm_active |= IFM_10G_SR | IFM_FDX; sc->speed = 10000; break; + case 5: /* 20 Gbps */ + req->ifm_active |= IFM_10G_SR | IFM_FDX; + sc->speed = 20000; + break; + case 6: /* 25 Gbps */ + req->ifm_active |= IFM_10G_SR | IFM_FDX; + sc->speed = 25000; + break; case 7: /* 40 Gbps */ req->ifm_active |= IFM_40G_SR4 | IFM_FDX; sc->speed = 40000; break; + default: + sc->speed = 0; + break; } return; @@ -2217,13 +2228,16 @@ setup_max_queues_want(POCE_SOFTC sc) (sc->function_mode & FNM_UMC_MODE) || (sc->function_mode & FNM_VNIC_MODE) || (!is_rss_enabled(sc)) || - (sc->flags & OCE_FLAGS_BE2)) { + IS_BE2(sc)) { sc->nrqs = 1; sc->nwqs = 1; } else { sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1; sc->nwqs = MIN(OCE_NCPUS, sc->nrssqs); } + + if (IS_BE2(sc) && is_rss_enabled(sc)) + sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1; } @@ -2237,6 +2251,9 @@ update_queues_got(POCE_SOFTC sc) sc->nrqs = 1; sc->nwqs = 1; } + + if (IS_BE2(sc)) + sc->nwqs = 1; } static int Modified: stable/10/sys/dev/oce/oce_if.h ============================================================================== --- stable/10/sys/dev/oce/oce_if.h Mon Jun 30 16:18:38 2014 (r268045) +++ stable/10/sys/dev/oce/oce_if.h Mon Jun 30 16:23:31 2014 (r268046) @@ -759,14 +759,9 @@ struct oce_rq { }; struct link_status { - uint8_t physical_port; - uint8_t mac_duplex; - uint8_t mac_speed; - uint8_t mac_fault; - uint8_t mgmt_mac_duplex; - uint8_t mgmt_mac_speed; + uint8_t phys_port_speed; + uint8_t logical_link_status; uint16_t qos_link_speed; - uint32_t logical_link_status; }; Modified: stable/10/sys/dev/oce/oce_mbox.c ============================================================================== --- stable/10/sys/dev/oce/oce_mbox.c Mon Jun 30 16:18:38 2014 (r268045) +++ stable/10/sys/dev/oce/oce_mbox.c Mon Jun 30 16:23:31 2014 (r268046) @@ -961,9 +961,9 @@ oce_get_link_status(POCE_SOFTC sc, struc goto error; } /* interpret response */ - bcopy(&fwcmd->params.rsp, link, sizeof(struct link_status)); - link->logical_link_status = HOST_32(link->logical_link_status); - link->qos_link_speed = HOST_16(link->qos_link_speed); + link->qos_link_speed = HOST_16(fwcmd->params.rsp.qos_link_speed); + link->phys_port_speed = fwcmd->params.rsp.physical_port_speed; + link->logical_link_status = fwcmd->params.rsp.logical_link_status; error: return rc; } From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 16:31:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC1C874C; Mon, 30 Jun 2014 16:31: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 A8C5C2A0D; Mon, 30 Jun 2014 16:31: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 s5UGVSw6087258; Mon, 30 Jun 2014 16:31:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UGVSuV087256; Mon, 30 Jun 2014 16:31:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406301631.s5UGVSuV087256@svn.freebsd.org> From: Xin LI Date: Mon, 30 Jun 2014 16:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268047 - stable/10/lib/libz X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 16:31:28 -0000 Author: delphij Date: Mon Jun 30 16:31:28 2014 New Revision: 268047 URL: http://svnweb.freebsd.org/changeset/base/268047 Log: MFC r267378: Fix path for zlib examples, this have no runtime effect and was overlooked when I was doing zlib update. Modified: stable/10/lib/libz/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libz/Makefile ============================================================================== --- stable/10/lib/libz/Makefile Mon Jun 30 16:23:31 2014 (r268046) +++ stable/10/lib/libz/Makefile Mon Jun 30 16:31:28 2014 (r268047) @@ -55,6 +55,8 @@ CFLAGS+= -DSYMBOL_VERSIONING INCS= zconf.h zlib.h +.PATH: ${.CURDIR}/test + minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 16:53:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 62CFE792; Mon, 30 Jun 2014 16:53: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 4FB782C1A; Mon, 30 Jun 2014 16:53: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 s5UGrDZ0000327; Mon, 30 Jun 2014 16:53:13 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UGrDTb000326; Mon, 30 Jun 2014 16:53:13 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201406301653.s5UGrDTb000326@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 30 Jun 2014 16:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268051 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 16:53:13 -0000 Author: ume Date: Mon Jun 30 16:53:12 2014 New Revision: 268051 URL: http://svnweb.freebsd.org/changeset/base/268051 Log: MFC r267800: Exclude IPv4 address from doing longest match. It prevented DNS based load balancing. Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Mon Jun 30 16:49:00 2014 (r268050) +++ stable/10/lib/libc/net/getaddrinfo.c Mon Jun 30 16:53:12 2014 (r268051) @@ -1009,7 +1009,8 @@ comp_dst(const void *arg1, const void *a * We compare the match length in a same AF only. */ if (dst1->aio_ai->ai_addr->sa_family == - dst2->aio_ai->ai_addr->sa_family) { + dst2->aio_ai->ai_addr->sa_family && + dst1->aio_ai->ai_addr->sa_family != AF_INET) { if (dst1->aio_matchlen > dst2->aio_matchlen) { return(-1); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 16:56:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B0E6A901; Mon, 30 Jun 2014 16:56: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 9D7272C37; Mon, 30 Jun 2014 16:56: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 s5UGuCHU000862; Mon, 30 Jun 2014 16:56:12 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UGuCSu000861; Mon, 30 Jun 2014 16:56:12 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201406301656.s5UGuCSu000861@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 30 Jun 2014 16:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268052 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 16:56:12 -0000 Author: ume Date: Mon Jun 30 16:56:12 2014 New Revision: 268052 URL: http://svnweb.freebsd.org/changeset/base/268052 Log: MFC r267801: Make nd6_gctimer tunable. Modified: stable/10/sys/netinet6/nd6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/nd6.c ============================================================================== --- stable/10/sys/netinet6/nd6.c Mon Jun 30 16:53:12 2014 (r268051) +++ stable/10/sys/netinet6/nd6.c Mon Jun 30 16:56:12 2014 (r268052) @@ -2272,6 +2272,8 @@ SYSCTL_NODE(_net_inet6_icmp6, ICMPV6CTL_ CTLFLAG_RD, nd6_sysctl_prlist, ""); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXQLEN, nd6_maxqueuelen, CTLFLAG_RW, &VNET_NAME(nd6_maxqueuelen), 1, ""); +SYSCTL_VNET_INT(_net_inet6_icmp6, OID_AUTO, nd6_gctimer, + CTLFLAG_RW, &VNET_NAME(nd6_gctimer), (60 * 60 * 24), ""); static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 19:46:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EFD7468C; Mon, 30 Jun 2014 19:46: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 DC53F2D39; Mon, 30 Jun 2014 19:46: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 s5UJkI1M081900; Mon, 30 Jun 2014 19:46:18 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UJkH4B081891; Mon, 30 Jun 2014 19:46:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201406301946.s5UJkH4B081891@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 30 Jun 2014 19:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268061 - stable/10/sys/netgraph/bluetooth/socket X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 19:46:19 -0000 Author: trociny Date: Mon Jun 30 19:46:17 2014 New Revision: 268061 URL: http://svnweb.freebsd.org/changeset/base/268061 Log: MFC r267336: PF_BLUETOOTH protocols: skip initialization of non-virtualized globals for non-default VNET instances. This fixes panic on a vnet initialization when ng_btsocket is loaded. Modified: stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c ============================================================================== --- stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c Mon Jun 30 19:36:08 2014 (r268060) +++ stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c Mon Jun 30 19:46:17 2014 (r268061) @@ -51,6 +51,9 @@ #include #include #include + +#include + #include #include #include @@ -728,6 +731,10 @@ ng_btsocket_hci_raw_init(void) bitstr_t *f = NULL; int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_hci_raw_node = NULL; ng_btsocket_hci_raw_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_hci_raw_ioctl_timeout = 5; Modified: stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Mon Jun 30 19:36:08 2014 (r268060) +++ stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Mon Jun 30 19:46:17 2014 (r268061) @@ -1813,6 +1813,10 @@ ng_btsocket_l2cap_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_l2cap_node = NULL; ng_btsocket_l2cap_debug_level = NG_BTSOCKET_WARN_LEVEL; Modified: stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c ============================================================================== --- stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Mon Jun 30 19:36:08 2014 (r268060) +++ stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Mon Jun 30 19:46:17 2014 (r268061) @@ -50,6 +50,9 @@ #include #include #include + +#include + #include #include #include @@ -513,6 +516,10 @@ ng_btsocket_l2cap_raw_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_l2cap_raw_node = NULL; ng_btsocket_l2cap_raw_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_l2cap_raw_ioctl_timeout = 5; Modified: stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Mon Jun 30 19:36:08 2014 (r268060) +++ stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Mon Jun 30 19:46:17 2014 (r268061) @@ -328,6 +328,11 @@ ng_btsocket_rfcomm_check_fcs(u_int8_t *d void ng_btsocket_rfcomm_init(void) { + + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_rfcomm_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_rfcomm_timo = 60; Modified: stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c ============================================================================== --- stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Mon Jun 30 19:36:08 2014 (r268060) +++ stable/10/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Mon Jun 30 19:46:17 2014 (r268061) @@ -1107,6 +1107,10 @@ ng_btsocket_sco_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_sco_node = NULL; ng_btsocket_sco_debug_level = NG_BTSOCKET_WARN_LEVEL; From owner-svn-src-stable-10@FreeBSD.ORG Mon Jun 30 20:26:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A096E6ED; Mon, 30 Jun 2014 20:26: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 8C556212F; Mon, 30 Jun 2014 20:26:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UKQV8e001943; Mon, 30 Jun 2014 20:26:31 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UKQV2i001941; Mon, 30 Jun 2014 20:26:31 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201406302026.s5UKQV2i001941@svn.freebsd.org> From: Dimitry Andric Date: Mon, 30 Jun 2014 20:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268065 - in stable: 10/contrib/llvm/lib/Target/PowerPC 10/contrib/llvm/patches 9/contrib/llvm/lib/Target/PowerPC 9/contrib/llvm/patches X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 20:26:31 -0000 Author: dim Date: Mon Jun 30 20:26:30 2014 New Revision: 268065 URL: http://svnweb.freebsd.org/changeset/base/268065 Log: MFC r267981: Pull in r211627 from upstream llvm trunk (by Bill Schmidt): [PPC64] Fix PR20071 (fctiduz generated for targets lacking that instruction) PR20071 identifies a problem in PowerPC's fast-isel implementation for floating-point conversion to integer. The fctiduz instruction was added in Power ISA 2.06 (i.e., Power7 and later). However, this instruction is being generated regardless of which 64-bit PowerPC target is selected. The intent is for fast-isel to punt to DAG selection when this instruction is not available. This patch implements that change. For testing purposes, the existing fast-isel-conversion.ll test adds a RUN line for -mcpu=970 and tests for the expected code generation. Additionally, the existing test fast-isel-conversion-p5.ll was found to be incorrectly expecting the unavailable instruction to be generated. I've removed these test variants since we have adequate coverage in fast-isel-conversion.ll. This is needed to compile clang with debug+asserts on older powerpc64 and ppc970 targets. Requested by: jhibbits MFC r267982: Add the llvm patch for r267981. MFC r268003: Fix breakage after r267981. Pointy hat to: dim Added: stable/10/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff - copied, changed from r267982, head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff Modified: stable/10/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/9/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff - copied, changed from r267982, head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff Modified: stable/9/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/10/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp Mon Jun 30 20:24:00 2014 (r268064) +++ stable/10/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp Mon Jun 30 20:26:30 2014 (r268065) @@ -1026,6 +1026,10 @@ bool PPCFastISel::SelectFPToI(const Inst if (DstVT != MVT::i32 && DstVT != MVT::i64) return false; + // If we don't have FCTIDUZ and we need it, punt to SelectionDAG. + if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget.hasFPCVT()) + return false; + Value *Src = I->getOperand(0); Type *SrcTy = Src->getType(); if (!isTypeLegal(SrcTy, SrcVT)) Copied and modified: stable/10/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff (from r267982, head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff) ============================================================================== --- head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff Fri Jun 27 20:45:17 2014 (r267982, copy source) +++ stable/10/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff Mon Jun 30 20:26:30 2014 (r268065) @@ -32,7 +32,7 @@ Index: lib/Target/PowerPC/PPCFastISel.cp return false; + // If we don't have FCTIDUZ and we need it, punt to SelectionDAG. -+ if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget->hasFPCVT()) ++ if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget.hasFPCVT()) + return false; + Value *Src = I->getOperand(0); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 1 06:23:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 092BBE87; Tue, 1 Jul 2014 06:23: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 E04D72936; Tue, 1 Jul 2014 06:23: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 s616NnHi081556; Tue, 1 Jul 2014 06:23:49 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s616NmAx081549; Tue, 1 Jul 2014 06:23:48 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201407010623.s616NmAx081549@svn.freebsd.org> From: Scott Long Date: Tue, 1 Jul 2014 06:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268073 - in stable/10/sys/dev/isci: . scil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 06:23:50 -0000 Author: scottl Date: Tue Jul 1 06:23:48 2014 New Revision: 268073 URL: http://svnweb.freebsd.org/changeset/base/268073 Log: Merge r268024, 268025: Fix a case in ndling ATA_PASSTHROUGH commands that have an unaligned buffer. This impacts some home-rolled SMART tools. In rare cases, a SATA drive can stop responding to commands and trigger a reset device task request from the driver. If the drive fails to respond with a signature FIS, the driver would previously get into an endless retry loop, stalling all I/O to the drive and keeping user processes stranded. Instead, fail the i/o and invalidate the device if the task management command times out. This is controllable with the sysctl and tunable hw.isci.fail_on_task_timeout dev.isci.0.fail_on_task_timeout The default for these is 1. Obtained from: Netflix, Inc. Modified: stable/10/sys/dev/isci/isci.h stable/10/sys/dev/isci/isci_controller.c stable/10/sys/dev/isci/isci_sysctl.c stable/10/sys/dev/isci/isci_task_request.c stable/10/sys/dev/isci/scil/scic_sds_stp_request.c Modified: stable/10/sys/dev/isci/isci.h ============================================================================== --- stable/10/sys/dev/isci/isci.h Tue Jul 1 04:44:18 2014 (r268072) +++ stable/10/sys/dev/isci/isci.h Tue Jul 1 06:23:48 2014 (r268073) @@ -164,6 +164,7 @@ struct ISCI_CONTROLLER uint32_t initial_discovery_mask; BOOL is_frozen; BOOL release_queued_ccbs; + BOOL fail_on_task_timeout; uint8_t *remote_device_memory; struct ISCI_MEMORY cached_controller_memory; struct ISCI_MEMORY uncached_controller_memory; Modified: stable/10/sys/dev/isci/isci_controller.c ============================================================================== --- stable/10/sys/dev/isci/isci_controller.c Tue Jul 1 04:44:18 2014 (r268072) +++ stable/10/sys/dev/isci/isci_controller.c Tue Jul 1 06:23:48 2014 (r268073) @@ -300,6 +300,8 @@ SCI_STATUS isci_controller_initialize(st SCI_CONTROLLER_HANDLE_T scic_controller_handle; char led_name[64]; unsigned long tunable; + uint32_t io_shortage; + uint32_t fail_on_timeout; int i; scic_controller_handle = @@ -365,10 +367,12 @@ SCI_STATUS isci_controller_initialize(st * this io_shortage parameter, which will tell CAM that we have a * large queue depth than we really do. */ - uint32_t io_shortage = 0; + io_shortage = 0; TUNABLE_INT_FETCH("hw.isci.io_shortage", &io_shortage); controller->sim_queue_depth += io_shortage; + fail_on_timeout = 1; + TUNABLE_INT_FETCH("hw.isci.fail_on_task_timeout", &fail_on_timeout); /* Attach to CAM using xpt_bus_register now, then immediately freeze * the simq. It will get released later when initial domain discovery * is complete. Modified: stable/10/sys/dev/isci/isci_sysctl.c ============================================================================== --- stable/10/sys/dev/isci/isci_sysctl.c Tue Jul 1 04:44:18 2014 (r268072) +++ stable/10/sys/dev/isci/isci_sysctl.c Tue Jul 1 06:23:48 2014 (r268073) @@ -222,6 +222,24 @@ isci_sysctl_log_frozen_lun_masks(SYSCTL_ return (0); } +static int +isci_sysctl_fail_on_task_timeout(SYSCTL_HANDLER_ARGS) +{ + struct isci_softc *isci = (struct isci_softc *)arg1; + int32_t fail_on_timeout = 0; + int error, i; + + error = sysctl_handle_int(oidp, &fail_on_timeout, 0, req); + + if (error || fail_on_timeout == 0) + return (error); + + for (i = 0; i < isci->controller_count; i++) + isci->controllers[i].fail_on_task_timeout = fail_on_timeout; + + return (0); +} + void isci_sysctl_initialize(struct isci_softc *isci) { struct sysctl_ctx_list *sysctl_ctx = device_get_sysctl_ctx(isci->device); @@ -259,5 +277,10 @@ void isci_sysctl_initialize(struct isci_ "log_frozen_lun_masks", CTLTYPE_UINT| CTLFLAG_RW, isci, 0, isci_sysctl_log_frozen_lun_masks, "IU", "Log frozen lun masks to kernel log"); + + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "fail_on_task_timeout", CTLTYPE_UINT | CTLFLAG_RW, isci, 0, + isci_sysctl_fail_on_task_timeout, "IU", + "Fail a command that has encountered a task management timeout"); } Modified: stable/10/sys/dev/isci/isci_task_request.c ============================================================================== --- stable/10/sys/dev/isci/isci_task_request.c Tue Jul 1 04:44:18 2014 (r268072) +++ stable/10/sys/dev/isci/isci_task_request.c Tue Jul 1 06:23:48 2014 (r268073) @@ -206,8 +206,17 @@ isci_task_request_complete(SCI_CONTROLLE break; case SCI_FAILURE_TIMEOUT: - retry_task = TRUE; - isci_log_message(0, "ISCI", "task timeout - retrying\n"); + if (isci_controller->fail_on_task_timeout) { + retry_task = FALSE; + isci_log_message(0, "ISCI", + "task timeout - not retrying\n"); + scif_cb_domain_device_removed(isci_controller, + isci_remote_device->domain, isci_remote_device); + } else { + retry_task = TRUE; + isci_log_message(0, "ISCI", + "task timeout - retrying\n"); + } break; case SCI_TASK_FAILURE: Modified: stable/10/sys/dev/isci/scil/scic_sds_stp_request.c ============================================================================== --- stable/10/sys/dev/isci/scil/scic_sds_stp_request.c Tue Jul 1 04:44:18 2014 (r268072) +++ stable/10/sys/dev/isci/scil/scic_sds_stp_request.c Tue Jul 1 06:23:48 2014 (r268073) @@ -1222,6 +1222,7 @@ SCI_STATUS scic_sds_stp_request_pio_data length -= copy_length; sgl_offset += copy_length; data_offset += copy_length; + source_address += copy_length; #endif } } From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 1 06:50:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 08D66A80; Tue, 1 Jul 2014 06:50: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 DF2822BBE; Tue, 1 Jul 2014 06:50: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 s616oZ8r092029; Tue, 1 Jul 2014 06:50:35 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s616oZTJ092028; Tue, 1 Jul 2014 06:50:35 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201407010650.s616oZTJ092028@svn.freebsd.org> From: Scott Long Date: Tue, 1 Jul 2014 06:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268076 - stable/10/sys/x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 06:50:36 -0000 Author: scottl Date: Tue Jul 1 06:50:35 2014 New Revision: 268076 URL: http://svnweb.freebsd.org/changeset/base/268076 Log: Merge r266746, 266775: Now that there are separate back-end implementations of busdma, the bounce implementation shouldn't steal flags from the common front-end. Move those flags to the back-end. Eliminate the fake contig_dmamap and replace it with a new flag, BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag means that the map can be NULL again, which in turn enables significant optimizations for the common case of no bouncing. Obtained from: Netflix, Inc. Modified: stable/10/sys/x86/x86/busdma_bounce.c Modified: stable/10/sys/x86/x86/busdma_bounce.c ============================================================================== --- stable/10/sys/x86/x86/busdma_bounce.c Tue Jul 1 06:43:15 2014 (r268075) +++ stable/10/sys/x86/x86/busdma_bounce.c Tue Jul 1 06:50:35 2014 (r268076) @@ -58,16 +58,21 @@ __FBSDID("$FreeBSD$"); #else #define MAX_BPAGES 8192 #endif -#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 -#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 + +enum { + BUS_DMA_COULD_BOUNCE = 0x01, + BUS_DMA_MIN_ALLOC_COMP = 0x02, + BUS_DMA_KMEM_ALLOC = 0x04, +}; struct bounce_zone; struct bus_dma_tag { struct bus_dma_tag_common common; - int map_count; - bus_dma_segment_t *segments; - struct bounce_zone *bounce_zone; + int map_count; + int bounce_flags; + bus_dma_segment_t *segments; + struct bounce_zone *bounce_zone; }; struct bounce_page { @@ -121,7 +126,7 @@ struct bus_dmamap { static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; -static struct bus_dmamap nobounce_dmamap, contig_dmamap; +static struct bus_dmamap nobounce_dmamap; static void init_bounce_pages(void *dummy); static int alloc_bounce_zone(bus_dma_tag_t dmat); @@ -173,14 +178,14 @@ bounce_bus_dma_tag_create(bus_dma_tag_t newtag->segments = NULL; if (parent != NULL && ((newtag->common.filter != NULL) || - ((parent->common.flags & BUS_DMA_COULD_BOUNCE) != 0))) - newtag->common.flags |= BUS_DMA_COULD_BOUNCE; + ((parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0))) + newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || newtag->common.alignment > 1) - newtag->common.flags |= BUS_DMA_COULD_BOUNCE; + newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; - if (((newtag->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && (flags & BUS_DMA_ALLOCNOW) != 0) { struct bounce_zone *bz; @@ -201,7 +206,7 @@ bounce_bus_dma_tag_create(bus_dma_tag_t error = ENOMEM; } /* Performed initial allocation */ - newtag->common.flags |= BUS_DMA_MIN_ALLOC_COMP; + newtag->bounce_flags |= BUS_DMA_MIN_ALLOC_COMP; } else error = 0; @@ -279,7 +284,7 @@ bounce_bus_dmamap_create(bus_dma_tag_t d * exclusion region, a data alignment that is stricter than 1, and/or * an active address boundary. */ - if (dmat->common.flags & BUS_DMA_COULD_BOUNCE) { + if (dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) { /* Must bounce */ if (dmat->bounce_zone == NULL) { if ((error = alloc_bounce_zone(dmat)) != 0) @@ -307,17 +312,17 @@ bounce_bus_dmamap_create(bus_dma_tag_t d else maxpages = MIN(MAX_BPAGES, Maxmem - atop(dmat->common.lowaddr)); - if ((dmat->common.flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || + if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || (bz->map_count > 0 && bz->total_bpages < maxpages)) { pages = MAX(atop(dmat->common.maxsize), 1); pages = MIN(maxpages - bz->total_bpages, pages); pages = MAX(pages, 1); if (alloc_bounce_pages(dmat, pages) < pages) error = ENOMEM; - if ((dmat->common.flags & BUS_DMA_MIN_ALLOC_COMP) + if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0) { if (error == 0) { - dmat->common.flags |= + dmat->bounce_flags |= BUS_DMA_MIN_ALLOC_COMP; } } else @@ -342,7 +347,7 @@ static int bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { - if (map != NULL && map != &nobounce_dmamap && map != &contig_dmamap) { + if (map != NULL && map != &nobounce_dmamap) { if (STAILQ_FIRST(&map->bpages) != NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); @@ -416,13 +421,13 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, attr); - *mapp = &contig_dmamap; + dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; } else { *vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, dmat->common.boundary, attr); - *mapp = &contig_dmamap; + dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; } if (*vaddr == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", @@ -445,18 +450,18 @@ bounce_bus_dmamem_free(bus_dma_tag_t dma { /* * dmamem does not need to be bounced, so the map should be - * NULL if malloc() was used and contig_dmamap if - * kmem_alloc_contig() was used. + * NULL and the BUS_DMA_KMEM_ALLOC flag cleared if malloc() + * was used and set if kmem_alloc_contig() was used. */ - if (!(map == NULL || map == &contig_dmamap)) + if (map != NULL) panic("bus_dmamem_free: Invalid map freed\n"); - if (map == NULL) + if ((dmat->bounce_flags & BUS_DMA_KMEM_ALLOC) == 0) free(vaddr, M_DEVBUF); else kmem_free(kernel_arena, (vm_offset_t)vaddr, dmat->common.maxsize); CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, - dmat->common.flags); + dmat->bounce_flags); } static void @@ -608,13 +613,13 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ bus_addr_t curaddr; int error; - if (map == NULL || map == &contig_dmamap) + if (map == NULL) map = &nobounce_dmamap; if (segs == NULL) segs = dmat->segments; - if ((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) { + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); if (map->pagesneeded != 0) { error = _bus_dmamap_reserve_pages(dmat, map, flags); @@ -626,7 +631,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ while (buflen > 0) { curaddr = buf; sgsize = MIN(buflen, dmat->common.maxsegsz); - if (((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = MIN(sgsize, PAGE_SIZE); @@ -661,13 +666,13 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta vm_offset_t vaddr; int error; - if (map == NULL || map == &contig_dmamap) + if (map == NULL) map = &nobounce_dmamap; if (segs == NULL) segs = dmat->segments; - if ((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) { + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags); if (map->pagesneeded != 0) { error = _bus_dmamap_reserve_pages(dmat, map, flags); @@ -691,7 +696,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta */ max_sgsize = MIN(buflen, dmat->common.maxsegsz); sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); - if (((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = roundup2(sgsize, dmat->common.alignment); @@ -972,7 +977,7 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ struct bounce_page *bpage; KASSERT(dmat->bounce_zone != NULL, ("no bounce zone in dma tag")); - KASSERT(map != NULL && map != &nobounce_dmamap && map != &contig_dmamap, + KASSERT(map != NULL && map != &nobounce_dmamap, ("add_bounce_page: bad map %p", map)); bz = dmat->bounce_zone; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 1 06:59:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 68DCAD9A; Tue, 1 Jul 2014 06:59: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 3C9B92C1E; Tue, 1 Jul 2014 06:59: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 s616xOmu096243; Tue, 1 Jul 2014 06:59:24 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s616xOfc096242; Tue, 1 Jul 2014 06:59:24 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201407010659.s616xOfc096242@svn.freebsd.org> From: Scott Long Date: Tue, 1 Jul 2014 06:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268077 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 06:59:24 -0000 Author: scottl Date: Tue Jul 1 06:59:23 2014 New Revision: 268077 URL: http://svnweb.freebsd.org/changeset/base/268077 Log: Merge r265463: Due to reasons unknown at this time, the system can be forced to write a journal block even when there are no journal entries to be written. Until the root cause is found, handle this case by ensuring that a valid journal segment is always written. Second, the data buffer used for writing journal entries was never being scrubbed of old data. Fix this. Submitted by: Takehara Mikihito Obtained from: Netflix, Inc. Modified: stable/10/sys/ufs/ffs/ffs_softdep.c Modified: stable/10/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_softdep.c Tue Jul 1 06:50:35 2014 (r268076) +++ stable/10/sys/ufs/ffs/ffs_softdep.c Tue Jul 1 06:59:23 2014 (r268077) @@ -1275,6 +1275,7 @@ static int stat_cleanup_blkrequests; /* static int stat_cleanup_inorequests; /* Number of inode cleanup requests */ static int stat_cleanup_retries; /* Number of cleanups that needed to flush */ static int stat_cleanup_failures; /* Number of cleanup requests that failed */ +static int stat_emptyjblocks; /* Number of potentially empty journal blocks */ SYSCTL_INT(_debug_softdep, OID_AUTO, max_softdeps, CTLFLAG_RW, &max_softdeps, 0, ""); @@ -1334,6 +1335,8 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, cle &stat_cleanup_failures, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, flushcache, CTLFLAG_RW, &softdep_flushcache, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, emptyjblocks, CTLFLAG_RD, + &stat_emptyjblocks, 0, ""); SYSCTL_DECL(_vfs_ffs); @@ -3328,6 +3331,24 @@ softdep_process_journal(mp, needwk, flag */ data = bp->b_data; off = 0; + + /* + * Always put a header on the first block. + * XXX As with below, there might not be a chance to get + * into the loop. Ensure that something valid is written. + */ + jseg_write(ump, jseg, data); + off += JREC_SIZE; + data = bp->b_data + off; + + /* + * XXX Something is wrong here. There's no work to do, + * but we need to perform and I/O and allow it to complete + * anyways. + */ + if (LIST_EMPTY(&ump->softdep_journal_pending)) + stat_emptyjblocks++; + while ((wk = LIST_FIRST(&ump->softdep_journal_pending)) != NULL) { if (cnt == 0) @@ -3377,6 +3398,11 @@ softdep_process_journal(mp, needwk, flag data = bp->b_data + off; cnt--; } + + /* Clear any remaining space so we don't leak kernel data */ + if (size > off) + bzero(data, size - off); + /* * Write this one buffer and continue. */ From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 1 13:29:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C6B95404; Tue, 1 Jul 2014 13:29: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 B066C2120; Tue, 1 Jul 2014 13:29: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 s61DTKCt078152; Tue, 1 Jul 2014 13:29:20 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61DTI8Q078118; Tue, 1 Jul 2014 13:29:18 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201407011329.s61DTI8Q078118@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 1 Jul 2014 13:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268091 - in stable/10: sbin/geom/class/part sys/conf sys/geom/part sys/modules/geom/geom_part sys/modules/geom/geom_part/geom_part_bsd64 sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 13:29:20 -0000 Author: ae Date: Tue Jul 1 13:29:17 2014 New Revision: 268091 URL: http://svnweb.freebsd.org/changeset/base/268091 Log: MFC r267355: Add UUIDs for DragonFlyBSD's partition types. MFC r267356: Add DragonFlyBSD's Hammer FS types and type names. MFC r267357: Add aliases for DragonFlyBSD's partition types. MFC r267358: Allow dumping to DragonFlyBSD's swap partition. MFC r267359: Add disklabel64 support to GEOM_PART class. This partitioning scheme is used in DragonFlyBSD. It is similar to BSD disklabel, but has the following improvements: * metadata has own dedicated place and isn't accessible through partitions; * all offsets are 64-bit; * supports 16 partitions by default (has reserved place for more); * has reserved place for backup label (but not yet implemented); * has UUIDs for partitions and partition types; MFC r267360: Add disklabel64 support Relnotes: yes Added: stable/10/sys/geom/part/g_part_bsd64.c - copied unchanged from r267359, head/sys/geom/part/g_part_bsd64.c stable/10/sys/modules/geom/geom_part/geom_part_bsd64/ - copied from r267359, head/sys/modules/geom/geom_part/geom_part_bsd64/ Modified: stable/10/sbin/geom/class/part/gpart.8 stable/10/sys/conf/NOTES stable/10/sys/conf/files stable/10/sys/conf/options stable/10/sys/geom/part/g_part.c stable/10/sys/geom/part/g_part.h stable/10/sys/geom/part/g_part_bsd.c stable/10/sys/geom/part/g_part_gpt.c stable/10/sys/modules/geom/geom_part/Makefile stable/10/sys/sys/disklabel.h stable/10/sys/sys/gpt.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/10/sbin/geom/class/part/gpart.8 Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sbin/geom/class/part/gpart.8 Tue Jul 1 13:29:17 2014 (r268091) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 2, 2014 +.Dd June 11, 2014 .Dt GPART 8 .Os .Sh NAME @@ -491,6 +491,12 @@ called Requires the .Cm GEOM_PART_BSD kernel option. +.It Cm BSD64 +64-bit implementation of BSD disklabel used in DragonFlyBSD to subdivide MBR +or GPT partitions. +Requires the +.Cm GEOM_PART_BSD64 +kernel option. .It Cm LDM The Logical Disk Manager is an implementation of volume manager for Microsoft Windows NT. Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sys/conf/NOTES Tue Jul 1 13:29:17 2014 (r268091) @@ -162,6 +162,7 @@ options GEOM_MULTIPATH # Disk multipat options GEOM_NOP # Test class. options GEOM_PART_APM # Apple partitioning options GEOM_PART_BSD # BSD disklabel +options GEOM_PART_BSD64 # BSD disklabel64 options GEOM_PART_EBR # Extended Boot Records options GEOM_PART_EBR_COMPAT # Backward compatible partition names options GEOM_PART_GPT # GPT partitioning Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sys/conf/files Tue Jul 1 13:29:17 2014 (r268091) @@ -2764,6 +2764,7 @@ geom/part/g_part.c standard geom/part/g_part_if.m standard geom/part/g_part_apm.c optional geom_part_apm geom/part/g_part_bsd.c optional geom_part_bsd +geom/part/g_part_bsd64.c optional geom_part_bsd64 geom/part/g_part_ebr.c optional geom_part_ebr geom/part/g_part_gpt.c optional geom_part_gpt geom/part/g_part_ldm.c optional geom_part_ldm Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sys/conf/options Tue Jul 1 13:29:17 2014 (r268091) @@ -109,6 +109,7 @@ GEOM_MULTIPATH opt_geom.h GEOM_NOP opt_geom.h GEOM_PART_APM opt_geom.h GEOM_PART_BSD opt_geom.h +GEOM_PART_BSD64 opt_geom.h GEOM_PART_EBR opt_geom.h GEOM_PART_EBR_COMPAT opt_geom.h GEOM_PART_GPT opt_geom.h Modified: stable/10/sys/geom/part/g_part.c ============================================================================== --- stable/10/sys/geom/part/g_part.c Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sys/geom/part/g_part.c Tue Jul 1 13:29:17 2014 (r268091) @@ -108,6 +108,15 @@ struct g_part_alias_list { { "vmware-vmkdiag", G_PART_ALIAS_VMKDIAG }, { "vmware-reserved", G_PART_ALIAS_VMRESERVED }, { "vmware-vsanhdr", G_PART_ALIAS_VMVSANHDR }, + { "dragonfly-label32", G_PART_ALIAS_DFBSD }, + { "dragonfly-label64", G_PART_ALIAS_DFBSD64 }, + { "dragonfly-swap", G_PART_ALIAS_DFBSD_SWAP }, + { "dragonfly-ufs", G_PART_ALIAS_DFBSD_UFS }, + { "dragonfly-vinum", G_PART_ALIAS_DFBSD_VINUM }, + { "dragonfly-ccd", G_PART_ALIAS_DFBSD_CCD }, + { "dragonfly-legacy", G_PART_ALIAS_DFBSD_LEGACY }, + { "dragonfly-hammer", G_PART_ALIAS_DFBSD_HAMMER }, + { "dragonfly-hammer2", G_PART_ALIAS_DFBSD_HAMMER2 }, }; SYSCTL_DECL(_kern_geom); Modified: stable/10/sys/geom/part/g_part.h ============================================================================== --- stable/10/sys/geom/part/g_part.h Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sys/geom/part/g_part.h Tue Jul 1 13:29:17 2014 (r268091) @@ -75,6 +75,15 @@ enum g_part_alias { G_PART_ALIAS_VMKDIAG, /* A VMware vmkDiagnostic partition entry */ G_PART_ALIAS_VMRESERVED, /* A VMware reserved partition entry */ G_PART_ALIAS_VMVSANHDR, /* A VMware vSAN header partition entry */ + G_PART_ALIAS_DFBSD, /* A DfBSD label32 partition entry */ + G_PART_ALIAS_DFBSD64, /* A DfBSD label64 partition entry */ + G_PART_ALIAS_DFBSD_SWAP, /* A DfBSD swap partition entry */ + G_PART_ALIAS_DFBSD_UFS, /* A DfBSD UFS partition entry */ + G_PART_ALIAS_DFBSD_VINUM, /* A DfBSD Vinum partition entry */ + G_PART_ALIAS_DFBSD_CCD, /* A DfBSD CCD partition entry */ + G_PART_ALIAS_DFBSD_LEGACY, /* A DfBSD legacy partition entry */ + G_PART_ALIAS_DFBSD_HAMMER, /* A DfBSD HAMMER FS partition entry */ + G_PART_ALIAS_DFBSD_HAMMER2, /* A DfBSD HAMMER2 FS partition entry */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: stable/10/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/10/sys/geom/part/g_part_bsd.c Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sys/geom/part/g_part_bsd.c Tue Jul 1 13:29:17 2014 (r268091) @@ -112,12 +112,26 @@ static struct g_part_scheme g_part_bsd_s }; G_PART_SCHEME_DECLARE(g_part_bsd); +static struct g_part_bsd_alias { + uint8_t type; + int alias; +} bsd_alias_match[] = { + { FS_BSDFFS, G_PART_ALIAS_FREEBSD_UFS }, + { FS_SWAP, G_PART_ALIAS_FREEBSD_SWAP }, + { FS_ZFS, G_PART_ALIAS_FREEBSD_ZFS }, + { FS_VINUM, G_PART_ALIAS_FREEBSD_VINUM }, + { FS_NANDFS, G_PART_ALIAS_FREEBSD_NANDFS }, + { FS_HAMMER, G_PART_ALIAS_DFBSD_HAMMER }, + { FS_HAMMER2, G_PART_ALIAS_DFBSD_HAMMER2 }, +}; + static int bsd_parse_type(const char *type, uint8_t *fstype) { const char *alias; char *endp; long lt; + int i; if (type[0] == '!') { lt = strtol(type + 1, &endp, 0); @@ -126,30 +140,13 @@ bsd_parse_type(const char *type, uint8_t *fstype = (u_int)lt; return (0); } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); - if (!strcasecmp(type, alias)) { - *fstype = FS_NANDFS; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); - if (!strcasecmp(type, alias)) { - *fstype = FS_SWAP; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS); - if (!strcasecmp(type, alias)) { - *fstype = FS_BSDFFS; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM); - if (!strcasecmp(type, alias)) { - *fstype = FS_VINUM; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS); - if (!strcasecmp(type, alias)) { - *fstype = FS_ZFS; - return (0); + for (i = 0; + i < sizeof(bsd_alias_match) / sizeof(bsd_alias_match[0]); i++) { + alias = g_part_alias_name(bsd_alias_match[i].alias); + if (strcasecmp(type, alias) == 0) { + *fstype = bsd_alias_match[i].type; + return (0); + } } return (EINVAL); } Copied: stable/10/sys/geom/part/g_part_bsd64.c (from r267359, head/sys/geom/part/g_part_bsd64.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/geom/part/g_part_bsd64.c Tue Jul 1 13:29:17 2014 (r268091, copy of r267359, head/sys/geom/part/g_part_bsd64.c) @@ -0,0 +1,667 @@ +/*- + * Copyright (c) 2014 Andrey V. Elsukov + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "g_part_if.h" + +FEATURE(geom_part_bsd64, "GEOM partitioning class for 64-bit BSD disklabels"); + +/* XXX: move this to sys/disklabel64.h */ +#define DISKMAGIC64 ((uint32_t)0xc4464c59) +#define MAXPARTITIONS64 16 +#define RESPARTITIONS64 32 + +struct disklabel64 { + char d_reserved0[512]; /* reserved or unused */ + u_int32_t d_magic; /* the magic number */ + u_int32_t d_crc; /* crc32() d_magic thru last part */ + u_int32_t d_align; /* partition alignment requirement */ + u_int32_t d_npartitions; /* number of partitions */ + struct uuid d_stor_uuid; /* unique uuid for label */ + + u_int64_t d_total_size; /* total size incl everything (bytes) */ + u_int64_t d_bbase; /* boot area base offset (bytes) */ + /* boot area is pbase - bbase */ + u_int64_t d_pbase; /* first allocatable offset (bytes) */ + u_int64_t d_pstop; /* last allocatable offset+1 (bytes) */ + u_int64_t d_abase; /* location of backup copy if not 0 */ + + u_char d_packname[64]; + u_char d_reserved[64]; + + /* + * Note: offsets are relative to the base of the slice, NOT to + * d_pbase. Unlike 32 bit disklabels the on-disk format for + * a 64 bit disklabel remains slice-relative. + * + * An uninitialized partition has a p_boffset and p_bsize of 0. + * + * If p_fstype is not supported for a live partition it is set + * to FS_OTHER. This is typically the case when the filesystem + * is identified by its uuid. + */ + struct partition64 { /* the partition table */ + u_int64_t p_boffset; /* slice relative offset, in bytes */ + u_int64_t p_bsize; /* size of partition, in bytes */ + u_int8_t p_fstype; + u_int8_t p_unused01; /* reserved, must be 0 */ + u_int8_t p_unused02; /* reserved, must be 0 */ + u_int8_t p_unused03; /* reserved, must be 0 */ + u_int32_t p_unused04; /* reserved, must be 0 */ + u_int32_t p_unused05; /* reserved, must be 0 */ + u_int32_t p_unused06; /* reserved, must be 0 */ + struct uuid p_type_uuid;/* mount type as UUID */ + struct uuid p_stor_uuid;/* unique uuid for storage */ + } d_partitions[MAXPARTITIONS64];/* actually may be more */ +}; + +struct g_part_bsd64_table { + struct g_part_table base; + + uint32_t d_align; + uint64_t d_bbase; + uint64_t d_abase; + struct uuid d_stor_uuid; + char d_reserved0[512]; + u_char d_packname[64]; + u_char d_reserved[64]; +}; + +struct g_part_bsd64_entry { + struct g_part_entry base; + + uint8_t fstype; + struct uuid type_uuid; + struct uuid stor_uuid; +}; + +static int g_part_bsd64_add(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); +static int g_part_bsd64_bootcode(struct g_part_table *, struct g_part_parms *); +static int g_part_bsd64_create(struct g_part_table *, struct g_part_parms *); +static int g_part_bsd64_destroy(struct g_part_table *, struct g_part_parms *); +static void g_part_bsd64_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); +static int g_part_bsd64_dumpto(struct g_part_table *, struct g_part_entry *); +static int g_part_bsd64_modify(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); +static const char *g_part_bsd64_name(struct g_part_table *, struct g_part_entry *, + char *, size_t); +static int g_part_bsd64_probe(struct g_part_table *, struct g_consumer *); +static int g_part_bsd64_read(struct g_part_table *, struct g_consumer *); +static const char *g_part_bsd64_type(struct g_part_table *, struct g_part_entry *, + char *, size_t); +static int g_part_bsd64_write(struct g_part_table *, struct g_consumer *); +static int g_part_bsd64_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); + +static kobj_method_t g_part_bsd64_methods[] = { + KOBJMETHOD(g_part_add, g_part_bsd64_add), + KOBJMETHOD(g_part_bootcode, g_part_bsd64_bootcode), + KOBJMETHOD(g_part_create, g_part_bsd64_create), + KOBJMETHOD(g_part_destroy, g_part_bsd64_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_bsd64_dumpconf), + KOBJMETHOD(g_part_dumpto, g_part_bsd64_dumpto), + KOBJMETHOD(g_part_modify, g_part_bsd64_modify), + KOBJMETHOD(g_part_resize, g_part_bsd64_resize), + KOBJMETHOD(g_part_name, g_part_bsd64_name), + KOBJMETHOD(g_part_probe, g_part_bsd64_probe), + KOBJMETHOD(g_part_read, g_part_bsd64_read), + KOBJMETHOD(g_part_type, g_part_bsd64_type), + KOBJMETHOD(g_part_write, g_part_bsd64_write), + { 0, 0 } +}; + +static struct g_part_scheme g_part_bsd64_scheme = { + "BSD64", + g_part_bsd64_methods, + sizeof(struct g_part_bsd64_table), + .gps_entrysz = sizeof(struct g_part_bsd64_entry), + .gps_minent = MAXPARTITIONS64, + .gps_maxent = MAXPARTITIONS64 +}; +G_PART_SCHEME_DECLARE(g_part_bsd64); + +#define EQUUID(a, b) (memcmp(a, b, sizeof(struct uuid)) == 0) +static struct uuid bsd64_uuid_unused = GPT_ENT_TYPE_UNUSED; +static struct uuid bsd64_uuid_dfbsd_swap = GPT_ENT_TYPE_DRAGONFLY_SWAP; +static struct uuid bsd64_uuid_dfbsd_ufs1 = GPT_ENT_TYPE_DRAGONFLY_UFS1; +static struct uuid bsd64_uuid_dfbsd_vinum = GPT_ENT_TYPE_DRAGONFLY_VINUM; +static struct uuid bsd64_uuid_dfbsd_ccd = GPT_ENT_TYPE_DRAGONFLY_CCD; +static struct uuid bsd64_uuid_dfbsd_legacy = GPT_ENT_TYPE_DRAGONFLY_LEGACY; +static struct uuid bsd64_uuid_dfbsd_hammer = GPT_ENT_TYPE_DRAGONFLY_HAMMER; +static struct uuid bsd64_uuid_dfbsd_hammer2 = GPT_ENT_TYPE_DRAGONFLY_HAMMER2; +static struct uuid bsd64_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; +static struct uuid bsd64_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; +static struct uuid bsd64_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; +static struct uuid bsd64_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; +static struct uuid bsd64_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; +static struct uuid bsd64_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; + +struct bsd64_uuid_alias { + struct uuid *uuid; + uint8_t fstype; + int alias; +}; +static struct bsd64_uuid_alias dfbsd_alias_match[] = { + { &bsd64_uuid_dfbsd_swap, FS_SWAP, G_PART_ALIAS_DFBSD_SWAP }, + { &bsd64_uuid_dfbsd_ufs1, FS_BSDFFS, G_PART_ALIAS_DFBSD_UFS }, + { &bsd64_uuid_dfbsd_vinum, FS_VINUM, G_PART_ALIAS_DFBSD_VINUM }, + { &bsd64_uuid_dfbsd_ccd, FS_CCD, G_PART_ALIAS_DFBSD_CCD }, + { &bsd64_uuid_dfbsd_legacy, FS_OTHER, G_PART_ALIAS_DFBSD_LEGACY }, + { &bsd64_uuid_dfbsd_hammer, FS_HAMMER, G_PART_ALIAS_DFBSD_HAMMER }, + { &bsd64_uuid_dfbsd_hammer2, FS_HAMMER2, G_PART_ALIAS_DFBSD_HAMMER2 }, + { NULL, 0, 0} +}; +static struct bsd64_uuid_alias fbsd_alias_match[] = { + { &bsd64_uuid_freebsd_boot, FS_OTHER, G_PART_ALIAS_FREEBSD_BOOT }, + { &bsd64_uuid_freebsd_swap, FS_OTHER, G_PART_ALIAS_FREEBSD_SWAP }, + { &bsd64_uuid_freebsd_ufs, FS_OTHER, G_PART_ALIAS_FREEBSD_UFS }, + { &bsd64_uuid_freebsd_zfs, FS_OTHER, G_PART_ALIAS_FREEBSD_ZFS }, + { &bsd64_uuid_freebsd_vinum, FS_OTHER, G_PART_ALIAS_FREEBSD_VINUM }, + { &bsd64_uuid_freebsd_nandfs, FS_OTHER, G_PART_ALIAS_FREEBSD_NANDFS }, + { NULL, 0, 0} +}; + +static int +bsd64_parse_type(const char *type, struct g_part_bsd64_entry *entry) +{ + struct uuid tmp; + const struct bsd64_uuid_alias *uap; + const char *alias; + char *p; + long lt; + int error; + + if (type[0] == '!') { + if (type[1] == '\0') + return (EINVAL); + lt = strtol(type + 1, &p, 0); + /* The type specified as number */ + if (*p == '\0') { + if (lt <= 0 || lt > 255) + return (EINVAL); + entry->fstype = lt; + entry->type_uuid = bsd64_uuid_unused; + return (0); + } + /* The type specified as uuid */ + error = parse_uuid(type + 1, &tmp); + if (error != 0) + return (error); + if (EQUUID(&tmp, &bsd64_uuid_unused)) + return (EINVAL); + for (uap = &dfbsd_alias_match[0]; uap->uuid != NULL; uap++) { + if (EQUUID(&tmp, uap->uuid)) { + /* Prefer fstype for known uuids */ + entry->type_uuid = bsd64_uuid_unused; + entry->fstype = uap->fstype; + return (0); + } + } + entry->type_uuid = tmp; + entry->fstype = FS_OTHER; + return (0); + } + /* The type specified as symbolic alias name */ + for (uap = &fbsd_alias_match[0]; uap->uuid != NULL; uap++) { + alias = g_part_alias_name(uap->alias); + if (!strcasecmp(type, alias)) { + entry->type_uuid = *uap->uuid; + entry->fstype = uap->fstype; + return (0); + } + } + for (uap = &dfbsd_alias_match[0]; uap->uuid != NULL; uap++) { + alias = g_part_alias_name(uap->alias); + if (!strcasecmp(type, alias)) { + entry->type_uuid = bsd64_uuid_unused; + entry->fstype = uap->fstype; + return (0); + } + } + return (EINVAL); +} + +static int +g_part_bsd64_add(struct g_part_table *basetable, struct g_part_entry *baseentry, + struct g_part_parms *gpp) +{ + struct g_part_bsd64_entry *entry; + + if (gpp->gpp_parms & G_PART_PARM_LABEL) + return (EINVAL); + + entry = (struct g_part_bsd64_entry *)baseentry; + if (bsd64_parse_type(gpp->gpp_type, entry) != 0) + return (EINVAL); + kern_uuidgen(&entry->stor_uuid, 1); + return (0); +} + +static int +g_part_bsd64_bootcode(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + + return (EOPNOTSUPP); +} + +#define PALIGN_SIZE (1024 * 1024) +#define PALIGN_MASK (PALIGN_SIZE - 1) +#define BLKSIZE (4 * 1024) +#define BOOTSIZE (32 * 1024) +#define DALIGN_SIZE (32 * 1024) +static int +g_part_bsd64_create(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + struct g_part_bsd64_table *table; + struct g_part_entry *baseentry; + struct g_provider *pp; + uint64_t blkmask, pbase; + uint32_t blksize, ressize; + + pp = gpp->gpp_provider; + if (pp->mediasize < 2* PALIGN_SIZE) + return (ENOSPC); + + /* + * Use at least 4KB block size. Blksize is stored in the d_align. + * XXX: Actually it is used just for calculate d_bbase and used + * for better alignment in bsdlabel64(8). + */ + blksize = pp->sectorsize < BLKSIZE ? BLKSIZE: pp->sectorsize; + blkmask = blksize - 1; + /* Reserve enough space for RESPARTITIONS64 partitions. */ + ressize = offsetof(struct disklabel64, d_partitions[RESPARTITIONS64]); + ressize = (ressize + blkmask) & ~blkmask; + /* + * Reserve enough space for bootcode and align first allocatable + * offset to PALIGN_SIZE. + * XXX: Currently DragonFlyBSD has 32KB bootcode, but the size could + * be bigger, because it is possible change it (it is equal pbase-bbase) + * in the bsdlabel64(8). + */ + pbase = ressize + ((BOOTSIZE + blkmask) & ~blkmask); + pbase = (pbase + PALIGN_MASK) & ~PALIGN_MASK; + /* + * Take physical offset into account and make first allocatable + * offset 32KB aligned to the start of the physical disk. + * XXX: Actually there are no such restrictions, this is how + * DragonFlyBSD behaves. + */ + pbase += DALIGN_SIZE - pp->stripeoffset % DALIGN_SIZE; + + table = (struct g_part_bsd64_table *)basetable; + table->d_align = blksize; + table->d_bbase = ressize / pp->sectorsize; + table->d_abase = ((pp->mediasize - ressize) & + ~blkmask) / pp->sectorsize; + kern_uuidgen(&table->d_stor_uuid, 1); + basetable->gpt_first = pbase / pp->sectorsize; + basetable->gpt_last = table->d_abase - 1; /* XXX */ + /* + * Create 'c' partition and make it internal, so user will not be + * able use it. + */ + baseentry = g_part_new_entry(basetable, RAW_PART + 1, 0, 0); + baseentry->gpe_internal = 1; + return (0); +} + +static int +g_part_bsd64_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + struct g_provider *pp; + + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + if (pp->sectorsize > offsetof(struct disklabel64, d_magic)) + basetable->gpt_smhead |= 1; + else + basetable->gpt_smhead |= 3; + return (0); +} + +static void +g_part_bsd64_dumpconf(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) +{ + struct g_part_bsd64_table *table; + struct g_part_bsd64_entry *entry; + char buf[sizeof(table->d_packname)]; + + entry = (struct g_part_bsd64_entry *)baseentry; + if (indent == NULL) { + /* conftxt: libdisk compatibility */ + sbuf_printf(sb, " xs BSD64 xt %u", entry->fstype); + } else if (entry != NULL) { + /* confxml: partition entry information */ + sbuf_printf(sb, "%s%u\n", indent, + entry->fstype); + if (!EQUUID(&bsd64_uuid_unused, &entry->type_uuid)) { + sbuf_printf(sb, "%s", indent); + sbuf_printf_uuid(sb, &entry->type_uuid); + sbuf_printf(sb, "\n"); + } + sbuf_printf(sb, "%s", indent); + sbuf_printf_uuid(sb, &entry->stor_uuid); + sbuf_printf(sb, "\n"); + } else { + /* confxml: scheme information */ + table = (struct g_part_bsd64_table *)basetable; + sbuf_printf(sb, "%s%ju\n", indent, + (uintmax_t)table->d_bbase); + if (table->d_abase) + sbuf_printf(sb, "%s%ju\n", + indent, (uintmax_t)table->d_abase); + sbuf_printf(sb, "%s", indent); + sbuf_printf_uuid(sb, &table->d_stor_uuid); + sbuf_printf(sb, "\n"); + sbuf_printf(sb, "%s\n"); + } +} + +static int +g_part_bsd64_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) +{ + struct g_part_bsd64_entry *entry; + + /* Allow dumping to a swap partition. */ + entry = (struct g_part_bsd64_entry *)baseentry; + if (entry->fstype == FS_SWAP || + EQUUID(&entry->type_uuid, &bsd64_uuid_dfbsd_swap) || + EQUUID(&entry->type_uuid, &bsd64_uuid_freebsd_swap)) + return (1); + return (0); +} + +static int +g_part_bsd64_modify(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_bsd64_entry *entry; + + if (gpp->gpp_parms & G_PART_PARM_LABEL) + return (EINVAL); + + entry = (struct g_part_bsd64_entry *)baseentry; + if (gpp->gpp_parms & G_PART_PARM_TYPE) + return (bsd64_parse_type(gpp->gpp_type, entry)); + return (0); +} + +static int +g_part_bsd64_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_bsd64_table *table; + struct g_provider *pp; + + if (baseentry == NULL) { + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + table = (struct g_part_bsd64_table *)basetable; + table->d_abase = ((pp->mediasize - + table->d_bbase * pp->sectorsize) & ~(table->d_align - 1)) / + pp->sectorsize; + basetable->gpt_last = table->d_abase - 1; + return (0); + } + baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; + return (0); +} + +static const char * +g_part_bsd64_name(struct g_part_table *table, struct g_part_entry *baseentry, + char *buf, size_t bufsz) +{ + + snprintf(buf, bufsz, "%c", 'a' + baseentry->gpe_index - 1); + return (buf); +} + +static int +g_part_bsd64_probe(struct g_part_table *table, struct g_consumer *cp) +{ + struct g_provider *pp; + uint32_t v; + int error; + u_char *buf; + + pp = cp->provider; + if (pp->mediasize < 2 * PALIGN_SIZE) + return (ENOSPC); + v = (pp->sectorsize + + offsetof(struct disklabel64, d_magic)) & ~(pp->sectorsize - 1); + buf = g_read_data(cp, 0, v, &error); + if (buf == NULL) + return (error); + v = le32dec(buf + offsetof(struct disklabel64, d_magic)); + g_free(buf); + return (v == DISKMAGIC64 ? G_PART_PROBE_PRI_HIGH: ENXIO); +} + +static int +g_part_bsd64_read(struct g_part_table *basetable, struct g_consumer *cp) +{ + struct g_part_bsd64_table *table; + struct g_part_bsd64_entry *entry; + struct g_part_entry *baseentry; + struct g_provider *pp; + struct disklabel64 *dlp; + uint64_t v64, sz; + uint32_t v32; + int error, index; + u_char *buf; + + pp = cp->provider; + table = (struct g_part_bsd64_table *)basetable; + v32 = (pp->sectorsize + + sizeof(struct disklabel64) - 1) & ~(pp->sectorsize - 1); + buf = g_read_data(cp, 0, v32, &error); + if (buf == NULL) + return (error); + + dlp = (struct disklabel64 *)buf; + basetable->gpt_entries = le32toh(dlp->d_npartitions); + if (basetable->gpt_entries > MAXPARTITIONS64) + goto invalid_label; + v32 = le32toh(dlp->d_crc); + dlp->d_crc = 0; + if (crc32(&dlp->d_magic, offsetof(struct disklabel64, + d_partitions[basetable->gpt_entries]) - + offsetof(struct disklabel64, d_magic)) != v32) + goto invalid_label; + table->d_align = le32toh(dlp->d_align); + if (table->d_align == 0 || (table->d_align & (pp->sectorsize - 1))) + goto invalid_label; + if (le64toh(dlp->d_total_size) > pp->mediasize) + goto invalid_label; + v64 = le64toh(dlp->d_pbase); + if (v64 % pp->sectorsize) + goto invalid_label; + basetable->gpt_first = v64 / pp->sectorsize; + v64 = le64toh(dlp->d_pstop); + if (v64 % pp->sectorsize) + goto invalid_label; + basetable->gpt_last = v64 / pp->sectorsize; + basetable->gpt_isleaf = 1; + v64 = le64toh(dlp->d_bbase); + if (v64 % pp->sectorsize) + goto invalid_label; + table->d_bbase = v64 / pp->sectorsize; + v64 = le64toh(dlp->d_abase); + if (v64 % pp->sectorsize) + goto invalid_label; + table->d_abase = v64 / pp->sectorsize; + le_uuid_dec(&dlp->d_stor_uuid, &table->d_stor_uuid); + for (index = basetable->gpt_entries - 1; index >= 0; index--) { + if (index == RAW_PART) { + /* Skip 'c' partition. */ + baseentry = g_part_new_entry(basetable, + index + 1, 0, 0); + baseentry->gpe_internal = 1; + continue; + } + v64 = le64toh(dlp->d_partitions[index].p_boffset); + sz = le64toh(dlp->d_partitions[index].p_bsize); + if (sz == 0 && v64 == 0) + continue; + if (sz == 0 || (v64 % pp->sectorsize) || (sz % pp->sectorsize)) + goto invalid_label; + baseentry = g_part_new_entry(basetable, index + 1, + v64 / pp->sectorsize, (v64 + sz) / pp->sectorsize - 1); + entry = (struct g_part_bsd64_entry *)baseentry; + le_uuid_dec(&dlp->d_partitions[index].p_type_uuid, + &entry->type_uuid); + le_uuid_dec(&dlp->d_partitions[index].p_stor_uuid, + &entry->stor_uuid); + entry->fstype = dlp->d_partitions[index].p_fstype; + if (index == RAW_PART) + baseentry->gpe_internal = 1; + } + bcopy(dlp->d_reserved0, table->d_reserved0, + sizeof(table->d_reserved0)); + bcopy(dlp->d_packname, table->d_packname, sizeof(table->d_packname)); + bcopy(dlp->d_reserved, table->d_reserved, sizeof(table->d_reserved)); + g_free(buf); + return (0); + +invalid_label: + g_free(buf); + return (EINVAL); +} + +static const char * +g_part_bsd64_type(struct g_part_table *basetable, struct g_part_entry *baseentry, + char *buf, size_t bufsz) +{ + struct g_part_bsd64_entry *entry; + struct bsd64_uuid_alias *uap; + + entry = (struct g_part_bsd64_entry *)baseentry; + if (entry->fstype != FS_OTHER) { + for (uap = &dfbsd_alias_match[0]; uap->uuid != NULL; uap++) + if (uap->fstype == entry->fstype) + return (g_part_alias_name(uap->alias)); + } else { + for (uap = &fbsd_alias_match[0]; uap->uuid != NULL; uap++) + if (EQUUID(uap->uuid, &entry->type_uuid)) + return (g_part_alias_name(uap->alias)); + for (uap = &dfbsd_alias_match[0]; uap->uuid != NULL; uap++) + if (EQUUID(uap->uuid, &entry->type_uuid)) + return (g_part_alias_name(uap->alias)); + } + if (EQUUID(&bsd64_uuid_unused, &entry->type_uuid)) + snprintf(buf, bufsz, "!%d", entry->fstype); + else { + buf[0] = '!'; + snprintf_uuid(buf + 1, bufsz - 1, &entry->type_uuid); + } + return (buf); +} + +static int +g_part_bsd64_write(struct g_part_table *basetable, struct g_consumer *cp) +{ + struct g_provider *pp; + struct g_part_entry *baseentry; + struct g_part_bsd64_entry *entry; + struct g_part_bsd64_table *table; + struct disklabel64 *dlp; + uint32_t v, sz; + int error, index; + + pp = cp->provider; + table = (struct g_part_bsd64_table *)basetable; + sz = (pp->sectorsize + + sizeof(struct disklabel64) - 1) & ~(pp->sectorsize - 1); + dlp = g_malloc(sz, M_WAITOK | M_ZERO); + + memcpy(dlp->d_reserved0, table->d_reserved0, + sizeof(table->d_reserved0)); + memcpy(dlp->d_packname, table->d_packname, sizeof(table->d_packname)); + memcpy(dlp->d_reserved, table->d_reserved, sizeof(table->d_reserved)); + le32enc(&dlp->d_magic, DISKMAGIC64); + le32enc(&dlp->d_align, table->d_align); + le32enc(&dlp->d_npartitions, basetable->gpt_entries); + le_uuid_enc(&dlp->d_stor_uuid, &table->d_stor_uuid); + le64enc(&dlp->d_total_size, pp->mediasize); + le64enc(&dlp->d_bbase, table->d_bbase * pp->sectorsize); + le64enc(&dlp->d_pbase, basetable->gpt_first * pp->sectorsize); + le64enc(&dlp->d_pstop, basetable->gpt_last * pp->sectorsize); + le64enc(&dlp->d_abase, table->d_abase * pp->sectorsize); + + LIST_FOREACH(baseentry, &basetable->gpt_entry, gpe_entry) { + if (baseentry->gpe_deleted) + continue; + index = baseentry->gpe_index - 1; + entry = (struct g_part_bsd64_entry *)baseentry; + if (index == RAW_PART) + continue; + le64enc(&dlp->d_partitions[index].p_boffset, + baseentry->gpe_start * pp->sectorsize); + le64enc(&dlp->d_partitions[index].p_bsize, pp->sectorsize * + (baseentry->gpe_end - baseentry->gpe_start + 1)); + dlp->d_partitions[index].p_fstype = entry->fstype; + le_uuid_enc(&dlp->d_partitions[index].p_type_uuid, + &entry->type_uuid); + le_uuid_enc(&dlp->d_partitions[index].p_stor_uuid, + &entry->stor_uuid); + } + /* Calculate checksum. */ + v = offsetof(struct disklabel64, + d_partitions[basetable->gpt_entries]) - + offsetof(struct disklabel64, d_magic); + le32enc(&dlp->d_crc, crc32(&dlp->d_magic, v)); + error = g_write_data(cp, 0, dlp, sz); + g_free(dlp); + return (error); +} + Modified: stable/10/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/10/sys/geom/part/g_part_gpt.c Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sys/geom/part/g_part_gpt.c Tue Jul 1 13:29:17 2014 (r268091) @@ -181,6 +181,15 @@ static struct uuid gpt_uuid_netbsd_raid static struct uuid gpt_uuid_netbsd_swap = GPT_ENT_TYPE_NETBSD_SWAP; static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; +static struct uuid gpt_uuid_dfbsd_swap = GPT_ENT_TYPE_DRAGONFLY_SWAP; +static struct uuid gpt_uuid_dfbsd_ufs1 = GPT_ENT_TYPE_DRAGONFLY_UFS1; +static struct uuid gpt_uuid_dfbsd_vinum = GPT_ENT_TYPE_DRAGONFLY_VINUM; +static struct uuid gpt_uuid_dfbsd_ccd = GPT_ENT_TYPE_DRAGONFLY_CCD; +static struct uuid gpt_uuid_dfbsd_legacy = GPT_ENT_TYPE_DRAGONFLY_LEGACY; +static struct uuid gpt_uuid_dfbsd_hammer = GPT_ENT_TYPE_DRAGONFLY_HAMMER; +static struct uuid gpt_uuid_dfbsd_hammer2 = GPT_ENT_TYPE_DRAGONFLY_HAMMER2; +static struct uuid gpt_uuid_dfbsd_label32 = GPT_ENT_TYPE_DRAGONFLY_LABEL32; +static struct uuid gpt_uuid_dfbsd_label64 = GPT_ENT_TYPE_DRAGONFLY_LABEL64; static struct g_part_uuid_alias { struct uuid *uuid; @@ -222,6 +231,15 @@ static struct g_part_uuid_alias { { &gpt_uuid_netbsd_lfs, G_PART_ALIAS_NETBSD_LFS, 0 }, { &gpt_uuid_netbsd_raid, G_PART_ALIAS_NETBSD_RAID, 0 }, { &gpt_uuid_netbsd_swap, G_PART_ALIAS_NETBSD_SWAP, 0 }, + { &gpt_uuid_dfbsd_swap, G_PART_ALIAS_DFBSD_SWAP, 0 }, + { &gpt_uuid_dfbsd_ufs1, G_PART_ALIAS_DFBSD_UFS, 0 }, + { &gpt_uuid_dfbsd_vinum, G_PART_ALIAS_DFBSD_VINUM, 0 }, + { &gpt_uuid_dfbsd_ccd, G_PART_ALIAS_DFBSD_CCD, 0 }, + { &gpt_uuid_dfbsd_legacy, G_PART_ALIAS_DFBSD_LEGACY, 0 }, + { &gpt_uuid_dfbsd_hammer, G_PART_ALIAS_DFBSD_HAMMER, 0 }, + { &gpt_uuid_dfbsd_hammer2, G_PART_ALIAS_DFBSD_HAMMER2, 0 }, + { &gpt_uuid_dfbsd_label32, G_PART_ALIAS_DFBSD, 0xa5 }, + { &gpt_uuid_dfbsd_label64, G_PART_ALIAS_DFBSD64, 0xa5 }, { NULL, 0, 0 } }; @@ -706,7 +724,8 @@ g_part_gpt_dumpto(struct g_part_table *t entry = (struct g_part_gpt_entry *)baseentry; return ((EQUUID(&entry->ent.ent_type, &gpt_uuid_freebsd_swap) || - EQUUID(&entry->ent.ent_type, &gpt_uuid_linux_swap)) ? 1 : 0); + EQUUID(&entry->ent.ent_type, &gpt_uuid_linux_swap) || + EQUUID(&entry->ent.ent_type, &gpt_uuid_dfbsd_swap)) ? 1 : 0); } static int Modified: stable/10/sys/modules/geom/geom_part/Makefile ============================================================================== --- stable/10/sys/modules/geom/geom_part/Makefile Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sys/modules/geom/geom_part/Makefile Tue Jul 1 13:29:17 2014 (r268091) @@ -2,6 +2,7 @@ SUBDIR= geom_part_apm \ geom_part_bsd \ + geom_part_bsd64 \ geom_part_ebr \ geom_part_gpt \ geom_part_ldm \ Modified: stable/10/sys/sys/disklabel.h ============================================================================== --- stable/10/sys/sys/disklabel.h Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sys/sys/disklabel.h Tue Jul 1 13:29:17 2014 (r268091) @@ -229,6 +229,8 @@ static const char *dktypenames[] = { #define FS_NTFS 18 /* Windows/NT file system */ #define FS_CCD 20 /* concatenated disk component */ #define FS_JFS2 21 /* IBM JFS2 */ +#define FS_HAMMER 22 /* DragonFlyBSD Hammer FS */ +#define FS_HAMMER2 23 /* DragonFlyBSD Hammer2 FS */ #define FS_UDF 24 /* UDF */ #define FS_EFS 26 /* SGI's Extent File system */ #define FS_ZFS 27 /* Sun's ZFS */ @@ -258,8 +260,8 @@ static const char *fstypenames[] = { "?", "ccd", "jfs", - "?", - "?", + "HAMMER", + "HAMMER2", "UDF", "?", "EFS", Modified: stable/10/sys/sys/gpt.h ============================================================================== --- stable/10/sys/sys/gpt.h Tue Jul 1 12:44:47 2014 (r268090) +++ stable/10/sys/sys/gpt.h Tue Jul 1 13:29:17 2014 (r268091) @@ -161,6 +161,25 @@ struct gpt_ent { #define GPT_ENT_TYPE_NETBSD_CGD \ {0x2db519ec,0xb10f,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} +#define GPT_ENT_TYPE_DRAGONFLY_LABEL32 \ + {0x9d087404,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_SWAP \ + {0x9d58fdbd,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_UFS1 \ + {0x9d94ce7c,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_VINUM \ + {0x9dd4478f,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_CCD \ + {0xdbd5211b,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_LABEL64 \ + {0x3d48ce54,0x1d16,0x11dc,0x86,0x96,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_LEGACY \ + {0xbd215ab2,0x1d16,0x11dc,0x86,0x96,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_HAMMER \ + {0x61dc63ac,0x6e38,0x11dc,0x85,0x13,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_HAMMER2 \ + {0x5cbb9ad1,0x862d,0x11dc,0xa9,0x4d,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} + /* * Boot partition used by GRUB 2. */ From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 1 15:50:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC3713C1; Tue, 1 Jul 2014 15:50: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 A93C52F90; Tue, 1 Jul 2014 15:50: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 s61FoYaW048034; Tue, 1 Jul 2014 15:50:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61FoYpj048033; Tue, 1 Jul 2014 15:50:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407011550.s61FoYpj048033@svn.freebsd.org> From: Xin LI Date: Tue, 1 Jul 2014 15:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268098 - stable/10/usr.sbin/service X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 15:50:34 -0000 Author: delphij Date: Tue Jul 1 15:50:34 2014 New Revision: 268098 URL: http://svnweb.freebsd.org/changeset/base/268098 Log: MFC r267493: Fix two issues: - Check for rc.d directory's existence before traversing it; - Don't output * when rc.d directory is empty. PR: bin/190665 Submitted by: Oleg Ginzburg (with changes) Modified: stable/10/usr.sbin/service/service.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/service/service.sh ============================================================================== --- stable/10/usr.sbin/service/service.sh Tue Jul 1 15:36:05 2014 (r268097) +++ stable/10/usr.sbin/service/service.sh Tue Jul 1 15:50:34 2014 (r268098) @@ -109,7 +109,7 @@ fi if [ -n "$LIST" ]; then for dir in /etc/rc.d $local_startup; do [ -n "$VERBOSE" ] && echo "From ${dir}:" - cd $dir && for file in *; do echo $file; done + [ -d ${dir} ] && /bin/ls -1 ${dir} done exit 0 fi From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 1 15:55:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1763F85C; Tue, 1 Jul 2014 15:55: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 DEEAF20C8; Tue, 1 Jul 2014 15:55: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 s61Ftfvb050239; Tue, 1 Jul 2014 15:55:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61Ftf3q050238; Tue, 1 Jul 2014 15:55:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407011555.s61Ftf3q050238@svn.freebsd.org> From: Xin LI Date: Tue, 1 Jul 2014 15:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268100 - stable/10/sys/contrib/x86emu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 15:55:42 -0000 Author: delphij Date: Tue Jul 1 15:55:41 2014 New Revision: 268100 URL: http://svnweb.freebsd.org/changeset/base/268100 Log: MFC r267372-267374: fix various misimplementation of instructions. Submitted by: Wolf Ramovsky Modified: stable/10/sys/contrib/x86emu/x86emu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/x86emu/x86emu.c ============================================================================== --- stable/10/sys/contrib/x86emu/x86emu.c Tue Jul 1 15:51:19 2014 (r268099) +++ stable/10/sys/contrib/x86emu/x86emu.c Tue Jul 1 15:55:41 2014 (r268100) @@ -2151,21 +2151,24 @@ x86emuOp_mov_word_RM_SR(struct x86emu *e static void x86emuOp_lea_word_R_M(struct x86emu *emu) { - uint16_t *srcreg; uint32_t destoffset; -/* - * TODO: Need to handle address size prefix! - * - * lea eax,[eax+ebx*2] ?? - */ fetch_decode_modrm(emu); if (emu->cur_mod == 3) x86emu_halt_sys(emu); - srcreg = decode_rh_word_register(emu); destoffset = decode_rl_address(emu); - *srcreg = (uint16_t) destoffset; + if (emu->x86.mode & SYSMODE_PREFIX_ADDR) { + uint32_t *srcreg; + + srcreg = decode_rh_long_register(emu); + *srcreg = (uint32_t) destoffset; + } else { + uint16_t *srcreg; + + srcreg = decode_rh_word_register(emu); + *srcreg = (uint16_t) destoffset; + } } /* @@ -3750,12 +3753,19 @@ x86emuOp_out_word_IMM_AX(struct x86emu * static void x86emuOp_call_near_IMM(struct x86emu *emu) { - int16_t ip; - - ip = (int16_t) fetch_word_imm(emu); - ip += (int16_t) emu->x86.R_IP; /* CHECK SIGN */ - push_word(emu, emu->x86.R_IP); - emu->x86.R_IP = ip; + if (emu->x86.mode & SYSMODE_PREFIX_DATA) { + int32_t ip; + ip = (int32_t) fetch_long_imm(emu); + ip += (int32_t) emu->x86.R_EIP; + push_long(emu, emu->x86.R_EIP); + emu->x86.R_EIP = ip; + } else { + int16_t ip; + ip = (int16_t) fetch_word_imm(emu); + ip += (int16_t) emu->x86.R_IP; /* CHECK SIGN */ + push_word(emu, emu->x86.R_IP); + emu->x86.R_IP = ip; + } } /* @@ -5610,6 +5620,7 @@ x86emuOp2_32_movsx_byte_R_RM(struct x86e { uint32_t *destreg; + fetch_decode_modrm(emu); destreg = decode_rh_long_register(emu); *destreg = (int32_t)(int8_t)decode_and_fetch_byte(emu); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 1 18:23:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A8BDC12E; Tue, 1 Jul 2014 18:23: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 954682F36; Tue, 1 Jul 2014 18:23: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 s61IN15J021637; Tue, 1 Jul 2014 18:23:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61IN13H021629; Tue, 1 Jul 2014 18:23:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407011823.s61IN13H021629@svn.freebsd.org> From: John Baldwin Date: Tue, 1 Jul 2014 18:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268108 - in stable: 10/usr.bin/procstat 9/usr.bin/procstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 18:23:01 -0000 Author: jhb Date: Tue Jul 1 18:23:00 2014 New Revision: 268108 URL: http://svnweb.freebsd.org/changeset/base/268108 Log: MFC 266322,266323: - Use 'RESOURCE' instead of the more generic 'TYPE' for the resource name column header when displaying resource usage. This more closely matches other procstat displays. - Add descriptions of the display formats for -e, -l, -r, and -x. Fix a few typos in indent settings while here. Modified: stable/10/usr.bin/procstat/procstat.1 stable/10/usr.bin/procstat/procstat_rusage.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat_rusage.c Directory Properties: stable/9/usr.bin/procstat/ (props changed) Modified: stable/10/usr.bin/procstat/procstat.1 ============================================================================== --- stable/10/usr.bin/procstat/procstat.1 Tue Jul 1 18:05:38 2014 (r268107) +++ stable/10/usr.bin/procstat/procstat.1 Tue Jul 1 18:23:00 2014 (r268108) @@ -135,6 +135,17 @@ command .It ARGS command line arguments (if available) .El +.Ss Environment Variables +Display the process ID, command, and environment variables: +.Pp +.Bl -tag -width "ENVIRONMENT" -compact +.It PID +process ID +.It COMM +command +.It ENVIRONMENT +environment variables (if available) +.El .Ss File Descriptors Display detailed information about each file descriptor referenced by a process, including the process ID, command, file descriptor number, and @@ -244,7 +255,7 @@ present for each capability descriptor. .Ss Signal Disposition Information Display signal pending and disposition for a process: .Pp -.Bl -tag -width ident -compact +.Bl -tag -width indent -compact .It PID process ID .It COMM @@ -269,7 +280,7 @@ switch is given, the signal numbers are .Ss Thread Signal Information Display signal pending and blocked for a process's threads: .Pp -.Bl -tag -width ident -compact +.Bl -tag -width indent -compact .It PID process ID .It TID @@ -318,6 +329,45 @@ thread name .It KSTACK kernel thread call stack .El +.Ss Resource Limits +Display resource limits for a process: +.Pp +.Bl -tag -width indent -compact +.It PID +process ID +.It COMM +command +.It RLIMIT +resource limit name +.It SOFT +soft limit +.It HARD +hard limit +.El +.Ss Resource Usage +Display resource usage for a process. +If the +.Fl H +flag is specified, +resource usage for individual threads is displayed instead. +.Pp +.Bl -tag -width "RESOURCE" -compact +.It PID +process ID +.It TID +thread ID +.Po +if +.Fl H +is specified +.Pc +.It COMM +command +.It RESOURCE +resource name +.It VALUE +current usage +.El .Ss Security Credentials Display process credential information: .Pp @@ -450,6 +500,19 @@ grows down (top-down stack) .It U grows up (bottom-up stack) .El +.Ss ELF Auxiliary Vector +Display ELF auxiliary vector values: +.Pp +.Bl -tag -width indent -compact +.It PID +process ID +.It COMM +command +.It AUXV +auxiliary vector name +.It VALUE +auxiliary vector value +.El .Sh EXIT STATUS .Ex -std .Sh SEE ALSO Modified: stable/10/usr.bin/procstat/procstat_rusage.c ============================================================================== --- stable/10/usr.bin/procstat/procstat_rusage.c Tue Jul 1 18:05:38 2014 (r268107) +++ stable/10/usr.bin/procstat/procstat_rusage.c Tue Jul 1 18:23:00 2014 (r268108) @@ -141,7 +141,8 @@ procstat_rusage(struct procstat *procsta printf("%5s ", "PID"); if (Hflag) printf("%6s ", "TID"); - printf("%-16s %-32s %14s\n", "COMM", "TYPE", "VALUE "); + printf("%-16s %-32s %14s\n", "COMM", "RESOURCE", + "VALUE "); } if (!Hflag) { From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 01:28:39 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7A6944A5; Wed, 2 Jul 2014 01:28: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 4CDF2251A; Wed, 2 Jul 2014 01:28: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 s621SdIx025686; Wed, 2 Jul 2014 01:28:39 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s621SdT1025685; Wed, 2 Jul 2014 01:28:39 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407020128.s621SdT1025685@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 2 Jul 2014 01:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268132 - stable/10/sys/cddl/contrib/opensolaris/common/unicode X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 01:28:39 -0000 Author: pfg Date: Wed Jul 2 01:28:38 2014 New Revision: 268132 URL: http://svnweb.freebsd.org/changeset/base/268132 Log: MVC r268014: Reduce some warnings in the Solaris unicode support. Clean some warnings from parenthesis and minor style issues. Modified: stable/10/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c Tue Jul 1 23:41:54 2014 (r268131) +++ stable/10/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c Wed Jul 2 01:28:38 2014 (r268132) @@ -23,7 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" /* @@ -143,10 +142,10 @@ #define U8_16BIT_TABLE_INDICATOR (0x8000U) /* The following are some convenience macros. */ -#define U8_PUT_3BYTES_INTO_UTF32(u, b1, b2, b3) \ - (u) = ((uint32_t)(b1) & 0x0F) << 12 | ((uint32_t)(b2) & 0x3F) << 6 | \ - (uint32_t)(b3) & 0x3F; - +#define U8_PUT_3BYTES_INTO_UTF32(u, b1, b2, b3) \ + (u) = ((((uint32_t)(b1) & 0x0F) << 12) | \ + (((uint32_t)(b2) & 0x3F) << 6) | \ + ((uint32_t)(b3) & 0x3F)); #define U8_SIMPLE_SWAP(a, b, t) \ (t) = (a); \ (a) = (b); \ @@ -216,10 +215,10 @@ const int8_t u8_number_of_bytes[0x100] = /* 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F */ I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, -/* 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F */ +/* 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F */ I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, -/* A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF */ +/* A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF */ I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, /* B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:16:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0E2A62C3; Wed, 2 Jul 2014 10:16: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 ED414237E; Wed, 2 Jul 2014 10:16: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 s62AGDvw074206; Wed, 2 Jul 2014 10:16:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AGDFp074201; Wed, 2 Jul 2014 10:16:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021016.s62AGDFp074201@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268139 - in stable/10/sys: cam/scsi compat/freebsd32 compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:16:14 -0000 Author: mav Date: Wed Jul 2 10:16:12 2014 New Revision: 268139 URL: http://svnweb.freebsd.org/changeset/base/268139 Log: MFC r266981: Overhaul CAM SG driver IOCTL interfaces. Make it really work for native FreeBSD programs. Before this it was broken for years due to different number of pointer dereferences in Linux and FreeBSD IOCTL paths, permanently returning errors to FreeBSD programs. This change breaks the driver FreeBSD IOCTL ABI, making it more strict, but since it was not working any way -- who bother. Add shims for 32-bit programs on 64-bit host, translating the argument of the SG_IO IOCTL for both FreeBSD and Linux ABIs. With this change I was able to run 32-bit Linux sg3_utils tools and simple 32 and 64-bit FreeBSD test tools on both 32 and 64-bit FreeBSD systems. Modified: stable/10/sys/cam/scsi/scsi_sg.c stable/10/sys/cam/scsi/scsi_sg.h stable/10/sys/compat/freebsd32/freebsd32_ioctl.c stable/10/sys/compat/freebsd32/freebsd32_ioctl.h stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sg.c Wed Jul 2 08:49:06 2014 (r268138) +++ stable/10/sys/cam/scsi/scsi_sg.c Wed Jul 2 10:16:12 2014 (r268139) @@ -494,7 +494,7 @@ sgioctl(struct cdev *dev, u_long cmd, ca struct ccb_scsiio *csio; struct cam_periph *periph; struct sg_softc *softc; - struct sg_io_hdr req; + struct sg_io_hdr *req; int dir, error; periph = (struct cam_periph *)dev->si_drv1; @@ -507,40 +507,22 @@ sgioctl(struct cdev *dev, u_long cmd, ca error = 0; switch (cmd) { - case LINUX_SCSI_GET_BUS_NUMBER: { - int busno; - - busno = xpt_path_path_id(periph->path); - error = copyout(&busno, arg, sizeof(busno)); - break; - } - case LINUX_SCSI_GET_IDLUN: { - struct scsi_idlun idlun; - struct cam_sim *sim; + case SG_GET_VERSION_NUM: + { + int *version = (int *)arg; - idlun.dev_id = xpt_path_target_id(periph->path); - sim = xpt_path_sim(periph->path); - idlun.host_unique_id = sim->unit_number; - error = copyout(&idlun, arg, sizeof(idlun)); + *version = sg_version; break; } - case SG_GET_VERSION_NUM: - case LINUX_SG_GET_VERSION_NUM: - error = copyout(&sg_version, arg, sizeof(sg_version)); - break; case SG_SET_TIMEOUT: - case LINUX_SG_SET_TIMEOUT: { - u_int user_timeout; + { + u_int user_timeout = *(u_int *)arg; - error = copyin(arg, &user_timeout, sizeof(u_int)); - if (error == 0) { - softc->sg_user_timeout = user_timeout; - softc->sg_timeout = user_timeout / SG_DEFAULT_HZ * hz; - } + softc->sg_user_timeout = user_timeout; + softc->sg_timeout = user_timeout / SG_DEFAULT_HZ * hz; break; } case SG_GET_TIMEOUT: - case LINUX_SG_GET_TIMEOUT: /* * The value is returned directly to the syscall. */ @@ -548,17 +530,14 @@ sgioctl(struct cdev *dev, u_long cmd, ca error = 0; break; case SG_IO: - case LINUX_SG_IO: - error = copyin(arg, &req, sizeof(req)); - if (error) - break; + req = (struct sg_io_hdr *)arg; - if (req.cmd_len > IOCDBLEN) { + if (req->cmd_len > IOCDBLEN) { error = EINVAL; break; } - if (req.iovec_count != 0) { + if (req->iovec_count != 0) { error = EOPNOTSUPP; break; } @@ -566,14 +545,14 @@ sgioctl(struct cdev *dev, u_long cmd, ca ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; - error = copyin(req.cmdp, &csio->cdb_io.cdb_bytes, - req.cmd_len); + error = copyin(req->cmdp, &csio->cdb_io.cdb_bytes, + req->cmd_len); if (error) { xpt_release_ccb(ccb); break; } - switch(req.dxfer_direction) { + switch(req->dxfer_direction) { case SG_DXFER_TO_DEV: dir = CAM_DIR_OUT; break; @@ -594,62 +573,57 @@ sgioctl(struct cdev *dev, u_long cmd, ca sgdone, dir|CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, - req.dxferp, - req.dxfer_len, - req.mx_sb_len, - req.cmd_len, - req.timeout); + req->dxferp, + req->dxfer_len, + req->mx_sb_len, + req->cmd_len, + req->timeout); error = sgsendccb(periph, ccb); if (error) { - req.host_status = DID_ERROR; - req.driver_status = DRIVER_INVALID; + req->host_status = DID_ERROR; + req->driver_status = DRIVER_INVALID; xpt_release_ccb(ccb); break; } - req.status = csio->scsi_status; - req.masked_status = (csio->scsi_status >> 1) & 0x7f; - sg_scsiio_status(csio, &req.host_status, &req.driver_status); - req.resid = csio->resid; - req.duration = csio->ccb_h.timeout; - req.info = 0; - - error = copyout(&req, arg, sizeof(req)); - if ((error == 0) && (csio->ccb_h.status & CAM_AUTOSNS_VALID) - && (req.sbp != NULL)) { - req.sb_len_wr = req.mx_sb_len - csio->sense_resid; - error = copyout(&csio->sense_data, req.sbp, - req.sb_len_wr); + req->status = csio->scsi_status; + req->masked_status = (csio->scsi_status >> 1) & 0x7f; + sg_scsiio_status(csio, &req->host_status, &req->driver_status); + req->resid = csio->resid; + req->duration = csio->ccb_h.timeout; + req->info = 0; + + if ((csio->ccb_h.status & CAM_AUTOSNS_VALID) + && (req->sbp != NULL)) { + req->sb_len_wr = req->mx_sb_len - csio->sense_resid; + error = copyout(&csio->sense_data, req->sbp, + req->sb_len_wr); } xpt_release_ccb(ccb); break; case SG_GET_RESERVED_SIZE: - case LINUX_SG_GET_RESERVED_SIZE: { - int size = 32768; - - error = copyout(&size, arg, sizeof(size)); + { + int *size = (int *)arg; + *size = DFLTPHYS; break; } case SG_GET_SCSI_ID: - case LINUX_SG_GET_SCSI_ID: { - struct sg_scsi_id id; - - id.host_no = cam_sim_path(xpt_path_sim(periph->path)); - id.channel = xpt_path_path_id(periph->path); - id.scsi_id = xpt_path_target_id(periph->path); - id.lun = xpt_path_lun_id(periph->path); - id.scsi_type = softc->pd_type; - id.h_cmd_per_lun = 1; - id.d_queue_depth = 1; - id.unused[0] = 0; - id.unused[1] = 0; + struct sg_scsi_id *id = (struct sg_scsi_id *)arg; - error = copyout(&id, arg, sizeof(id)); + id->host_no = cam_sim_path(xpt_path_sim(periph->path)); + id->channel = xpt_path_path_id(periph->path); + id->scsi_id = xpt_path_target_id(periph->path); + id->lun = xpt_path_lun_id(periph->path); + id->scsi_type = softc->pd_type; + id->h_cmd_per_lun = 1; + id->d_queue_depth = 1; + id->unused[0] = 0; + id->unused[1] = 0; break; } @@ -672,25 +646,6 @@ sgioctl(struct cdev *dev, u_long cmd, ca case SG_SET_COMMAND_Q: case SG_SET_DEBUG: case SG_NEXT_CMD_LEN: - case LINUX_SG_EMULATED_HOST: - case LINUX_SG_SET_TRANSFORM: - case LINUX_SG_GET_TRANSFORM: - case LINUX_SG_GET_NUM_WAITING: - case LINUX_SG_SCSI_RESET: - case LINUX_SG_GET_REQUEST_TABLE: - case LINUX_SG_SET_KEEP_ORPHAN: - case LINUX_SG_GET_KEEP_ORPHAN: - case LINUX_SG_GET_ACCESS_COUNT: - case LINUX_SG_SET_FORCE_LOW_DMA: - case LINUX_SG_GET_LOW_DMA: - case LINUX_SG_GET_SG_TABLESIZE: - case LINUX_SG_SET_FORCE_PACK_ID: - case LINUX_SG_GET_PACK_ID: - case LINUX_SG_SET_RESERVED_SIZE: - case LINUX_SG_GET_COMMAND_Q: - case LINUX_SG_SET_COMMAND_Q: - case LINUX_SG_SET_DEBUG: - case LINUX_SG_NEXT_CMD_LEN: default: #ifdef CAMDEBUG printf("sgioctl: rejecting cmd 0x%lx\n", cmd); Modified: stable/10/sys/cam/scsi/scsi_sg.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_sg.h Wed Jul 2 08:49:06 2014 (r268138) +++ stable/10/sys/cam/scsi/scsi_sg.h Wed Jul 2 10:16:12 2014 (r268139) @@ -8,31 +8,31 @@ #define _SCSI_SG_H #define SGIOC '"' -#define SG_SET_TIMEOUT _IO(SGIOC, 0x01) +#define SG_SET_TIMEOUT _IOW(SGIOC, 0x01, u_int) #define SG_GET_TIMEOUT _IO(SGIOC, 0x02) -#define SG_EMULATED_HOST _IO(SGIOC, 0x03) +#define SG_EMULATED_HOST _IOR(SGIOC, 0x03, int) #define SG_SET_TRANSFORM _IO(SGIOC, 0x04) #define SG_GET_TRANSFORM _IO(SGIOC, 0x05) -#define SG_GET_COMMAND_Q _IO(SGIOC, 0x70) -#define SG_SET_COMMAND_Q _IO(SGIOC, 0x71) -#define SG_GET_RESERVED_SIZE _IO(SGIOC, 0x72) -#define SG_SET_RESERVED_SIZE _IO(SGIOC, 0x75) -#define SG_GET_SCSI_ID _IO(SGIOC, 0x76) -#define SG_SET_FORCE_LOW_DMA _IO(SGIOC, 0x79) -#define SG_GET_LOW_DMA _IO(SGIOC, 0x7a) -#define SG_SET_FORCE_PACK_ID _IO(SGIOC, 0x7b) -#define SG_GET_PACK_ID _IO(SGIOC, 0x7c) -#define SG_GET_NUM_WAITING _IO(SGIOC, 0x7d) -#define SG_SET_DEBUG _IO(SGIOC, 0x7e) -#define SG_GET_SG_TABLESIZE _IO(SGIOC, 0x7f) -#define SG_GET_VERSION_NUM _IO(SGIOC, 0x82) -#define SG_NEXT_CMD_LEN _IO(SGIOC, 0x83) -#define SG_SCSI_RESET _IO(SGIOC, 0x84) -#define SG_IO _IO(SGIOC, 0x85) +#define SG_GET_COMMAND_Q _IOW(SGIOC, 0x70, int) +#define SG_SET_COMMAND_Q _IOR(SGIOC, 0x71, int) +#define SG_GET_RESERVED_SIZE _IOR(SGIOC, 0x72, int) +#define SG_SET_RESERVED_SIZE _IOW(SGIOC, 0x75, int) +#define SG_GET_SCSI_ID _IOR(SGIOC, 0x76, struct sg_scsi_id) +#define SG_SET_FORCE_LOW_DMA _IOW(SGIOC, 0x79, int) +#define SG_GET_LOW_DMA _IOR(SGIOC, 0x7a, int) +#define SG_SET_FORCE_PACK_ID _IOW(SGIOC, 0x7b, int) +#define SG_GET_PACK_ID _IOR(SGIOC, 0x7c, int) +#define SG_GET_NUM_WAITING _IOR(SGIOC, 0x7d, int) +#define SG_SET_DEBUG _IOW(SGIOC, 0x7e, int) +#define SG_GET_SG_TABLESIZE _IOR(SGIOC, 0x7f, int) +#define SG_GET_VERSION_NUM _IOR(SGIOC, 0x82, int) +#define SG_NEXT_CMD_LEN _IOW(SGIOC, 0x83, int) +#define SG_SCSI_RESET _IOW(SGIOC, 0x84, int) +#define SG_IO _IOWR(SGIOC, 0x85, struct sg_io_hdr) #define SG_GET_REQUEST_TABLE _IO(SGIOC, 0x86) -#define SG_SET_KEEP_ORPHAN _IO(SGIOC, 0x87) -#define SG_GET_KEEP_ORPHAN _IO(SGIOC, 0x88) -#define SG_GET_ACCESS_COUNT _IO(SGIOC, 0x89) +#define SG_SET_KEEP_ORPHAN _IOW(SGIOC, 0x87, int) +#define SG_GET_KEEP_ORPHAN _IOR(SGIOC, 0x88, int) +#define SG_GET_ACCESS_COUNT _IOR(SGIOC, 0x89, int) struct sg_io_hdr { int interface_id; @@ -59,6 +59,31 @@ struct sg_io_hdr { u_int info; }; +struct sg_io_hdr32 { + int interface_id; + int dxfer_direction; + u_char cmd_len; + u_char mx_sb_len; + u_short iovec_count; + u_int dxfer_len; + uint32_t dxferp; + uint32_t cmdp; + uint32_t sbp; + u_int timeout; + u_int flags; + int pack_id; + uint32_t usr_ptr; + u_char status; + u_char masked_status; + u_char msg_status; + u_char sb_len_wr; + u_short host_status; + u_short driver_status; + int resid; + u_int duration; + u_int info; +}; + #define SG_DXFER_NONE -1 #define SG_DXFER_TO_DEV -2 #define SG_DXFER_FROM_DEV -3 Modified: stable/10/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_ioctl.c Wed Jul 2 08:49:06 2014 (r268138) +++ stable/10/sys/compat/freebsd32/freebsd32_ioctl.c Wed Jul 2 10:16:12 2014 (r268139) @@ -344,6 +344,71 @@ cleanup: return (error); } +static int +freebsd32_ioctl_sg(struct thread *td, + struct freebsd32_ioctl_args *uap, struct file *fp) +{ + struct sg_io_hdr io; + struct sg_io_hdr32 io32; + int error; + + if ((error = copyin(uap->data, &io32, sizeof(io32))) != 0) + return (error); + + CP(io32, io, interface_id); + CP(io32, io, dxfer_direction); + CP(io32, io, cmd_len); + CP(io32, io, mx_sb_len); + CP(io32, io, iovec_count); + CP(io32, io, dxfer_len); + PTRIN_CP(io32, io, dxferp); + PTRIN_CP(io32, io, cmdp); + PTRIN_CP(io32, io, sbp); + CP(io32, io, timeout); + CP(io32, io, flags); + CP(io32, io, pack_id); + PTRIN_CP(io32, io, usr_ptr); + CP(io32, io, status); + CP(io32, io, masked_status); + CP(io32, io, msg_status); + CP(io32, io, sb_len_wr); + CP(io32, io, host_status); + CP(io32, io, driver_status); + CP(io32, io, resid); + CP(io32, io, duration); + CP(io32, io, info); + + if ((error = fo_ioctl(fp, SG_IO, (caddr_t)&io, td->td_ucred, td)) != 0) + return (error); + + CP(io, io32, interface_id); + CP(io, io32, dxfer_direction); + CP(io, io32, cmd_len); + CP(io, io32, mx_sb_len); + CP(io, io32, iovec_count); + CP(io, io32, dxfer_len); + PTROUT_CP(io, io32, dxferp); + PTROUT_CP(io, io32, cmdp); + PTROUT_CP(io, io32, sbp); + CP(io, io32, timeout); + CP(io, io32, flags); + CP(io, io32, pack_id); + PTROUT_CP(io, io32, usr_ptr); + CP(io, io32, status); + CP(io, io32, masked_status); + CP(io, io32, msg_status); + CP(io, io32, sb_len_wr); + CP(io, io32, host_status); + CP(io, io32, driver_status); + CP(io, io32, resid); + CP(io, io32, duration); + CP(io, io32, info); + + error = copyout(&io32, uap->data, sizeof(io32)); + + return (error); +} + int freebsd32_ioctl(struct thread *td, struct freebsd32_ioctl_args *uap) { @@ -393,6 +458,10 @@ freebsd32_ioctl(struct thread *td, struc error = freebsd32_ioctl_pciocgetconf(td, uap, fp); break; + case SG_IO_32: + error = freebsd32_ioctl_sg(td, uap, fp); + break; + default: fdrop(fp, td); ap.fd = uap->fd; Modified: stable/10/sys/compat/freebsd32/freebsd32_ioctl.h ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_ioctl.h Wed Jul 2 08:49:06 2014 (r268138) +++ stable/10/sys/compat/freebsd32/freebsd32_ioctl.h Wed Jul 2 10:16:12 2014 (r268139) @@ -32,6 +32,8 @@ #ifndef _COMPAT_FREEBSD32_IOCTL_H_ #define _COMPAT_FREEBSD32_IOCTL_H_ +#include + typedef __uint32_t caddr_t32; struct ioc_toc_header32 { @@ -122,5 +124,6 @@ struct pci_conf_io32 { #define MEMRANGE_GET32 _IOWR('m', 50, struct mem_range_op32) #define MEMRANGE_SET32 _IOW('m', 51, struct mem_range_op32) #define PCIOCGETCONF_32 _IOWR('p', 5, struct pci_conf_io32) +#define SG_IO_32 _IOWR(SGIOC, 0x85, struct sg_io_hdr32) #endif /* _COMPAT_FREEBSD32_IOCTL_H_ */ Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Wed Jul 2 08:49:06 2014 (r268138) +++ stable/10/sys/compat/linux/linux_ioctl.c Wed Jul 2 10:16:12 2014 (r268139) @@ -91,6 +91,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); @@ -1645,9 +1647,32 @@ linux_ioctl_cdrom(struct thread *td, str } case LINUX_SCSI_GET_BUS_NUMBER: + { + struct sg_scsi_id id; + + error = fo_ioctl(fp, SG_GET_SCSI_ID, (caddr_t)&id, + td->td_ucred, td); + if (error) + break; + error = copyout(&id.channel, (void *)args->arg, sizeof(int)); + break; + } + case LINUX_SCSI_GET_IDLUN: - error = linux_ioctl_sg(td, args); + { + struct sg_scsi_id id; + struct scsi_idlun idl; + + error = fo_ioctl(fp, SG_GET_SCSI_ID, (caddr_t)&id, + td->td_ucred, td); + if (error) + break; + idl.dev_id = (id.scsi_id & 0xff) + ((id.lun & 0xff) << 8) + + ((id.channel & 0xff) << 16) + ((id.host_no & 0xff) << 24); + idl.host_unique_id = id.host_no; + error = copyout(&idl, (void *)args->arg, sizeof(idl)); break; + } /* LINUX_CDROM_SEND_PACKET */ /* LINUX_CDROM_NEXT_WRITABLE */ @@ -2617,12 +2642,20 @@ linux_ioctl_drm(struct thread *td, struc return sys_ioctl(td, (struct ioctl_args *)args); } +#ifdef COMPAT_LINUX32 +#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) +#define PTRIN_CP(src,dst,fld) \ + do { (dst).fld = PTRIN((src).fld); } while (0) +#define PTROUT_CP(src,dst,fld) \ + do { (dst).fld = PTROUT((src).fld); } while (0) + static int -linux_ioctl_sg(struct thread *td, struct linux_ioctl_args *args) +linux_ioctl_sg_io(struct thread *td, struct linux_ioctl_args *args) { + struct sg_io_hdr io; + struct sg_io_hdr32 io32; cap_rights_t rights; struct file *fp; - u_long cmd; int error; error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), &fp); @@ -2630,12 +2663,98 @@ linux_ioctl_sg(struct thread *td, struct printf("sg_linux_ioctl: fget returned %d\n", error); return (error); } - cmd = args->cmd; - error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td)); + if ((error = copyin((void *)args->arg, &io32, sizeof(io32))) != 0) + goto out; + + CP(io32, io, interface_id); + CP(io32, io, dxfer_direction); + CP(io32, io, cmd_len); + CP(io32, io, mx_sb_len); + CP(io32, io, iovec_count); + CP(io32, io, dxfer_len); + PTRIN_CP(io32, io, dxferp); + PTRIN_CP(io32, io, cmdp); + PTRIN_CP(io32, io, sbp); + CP(io32, io, timeout); + CP(io32, io, flags); + CP(io32, io, pack_id); + PTRIN_CP(io32, io, usr_ptr); + CP(io32, io, status); + CP(io32, io, masked_status); + CP(io32, io, msg_status); + CP(io32, io, sb_len_wr); + CP(io32, io, host_status); + CP(io32, io, driver_status); + CP(io32, io, resid); + CP(io32, io, duration); + CP(io32, io, info); + + if ((error = fo_ioctl(fp, SG_IO, (caddr_t)&io, td->td_ucred, td)) != 0) + goto out; + + CP(io, io32, interface_id); + CP(io, io32, dxfer_direction); + CP(io, io32, cmd_len); + CP(io, io32, mx_sb_len); + CP(io, io32, iovec_count); + CP(io, io32, dxfer_len); + PTROUT_CP(io, io32, dxferp); + PTROUT_CP(io, io32, cmdp); + PTROUT_CP(io, io32, sbp); + CP(io, io32, timeout); + CP(io, io32, flags); + CP(io, io32, pack_id); + PTROUT_CP(io, io32, usr_ptr); + CP(io, io32, status); + CP(io, io32, masked_status); + CP(io, io32, msg_status); + CP(io, io32, sb_len_wr); + CP(io, io32, host_status); + CP(io, io32, driver_status); + CP(io, io32, resid); + CP(io, io32, duration); + CP(io, io32, info); + + error = copyout(&io32, (void *)args->arg, sizeof(io32)); + +out: fdrop(fp, td); return (error); } +#endif + +static int +linux_ioctl_sg(struct thread *td, struct linux_ioctl_args *args) +{ + + switch (args->cmd) { + case LINUX_SG_GET_VERSION_NUM: + args->cmd = SG_GET_VERSION_NUM; + break; + case LINUX_SG_SET_TIMEOUT: + args->cmd = SG_SET_TIMEOUT; + break; + case LINUX_SG_GET_TIMEOUT: + args->cmd = SG_GET_TIMEOUT; + break; + case LINUX_SG_IO: + args->cmd = SG_IO; +#ifdef COMPAT_LINUX32 + return (linux_ioctl_sg_io(td, args)); +#endif + break; + case LINUX_SG_GET_RESERVED_SIZE: + args->cmd = SG_GET_RESERVED_SIZE; + break; + case LINUX_SG_GET_SCSI_ID: + args->cmd = SG_GET_SCSI_ID; + break; + default: + return (ENODEV); + } + return (sys_ioctl(td, (struct ioctl_args *)args)); +} /* * Video4Linux (V4L) ioctl handler From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:18:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 ACC32513; Wed, 2 Jul 2014 10:18: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 7F8C923A1; Wed, 2 Jul 2014 10:18: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 s62AIgwK074705; Wed, 2 Jul 2014 10:18:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AIghR074704; Wed, 2 Jul 2014 10:18:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021018.s62AIghR074704@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268140 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:18:42 -0000 Author: mav Date: Wed Jul 2 10:18:42 2014 New Revision: 268140 URL: http://svnweb.freebsd.org/changeset/base/268140 Log: MFC r267606: On discovery stage add set of TargetAddress keys to reply, reporting to the client all the portal groups addresses and ports. Modified: stable/10/usr.sbin/ctld/discovery.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/discovery.c ============================================================================== --- stable/10/usr.sbin/ctld/discovery.c Wed Jul 2 10:16:12 2014 (r268139) +++ stable/10/usr.sbin/ctld/discovery.c Wed Jul 2 10:18:42 2014 (r268140) @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include "ctld.h" #include "iscsi_proto.h" @@ -155,6 +157,48 @@ logout_new_response(struct pdu *request) return (response); } +static void +discovery_add_target(struct keys *response_keys, struct target *targ) +{ + struct portal *portal; + char *buf; + char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; + struct addrinfo *ai; + int ret; + + keys_add(response_keys, "TargetName", targ->t_name); + TAILQ_FOREACH(portal, &targ->t_portal_group->pg_portals, p_next) { + ai = portal->p_ai; + ret = getnameinfo(ai->ai_addr, ai->ai_addrlen, + hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), + NI_NUMERICHOST | NI_NUMERICSERV); + if (ret != 0) { + log_warnx("getnameinfo: %s", gai_strerror(ret)); + continue; + } + switch (ai->ai_addr->sa_family) { + case AF_INET: + if (strcmp(hbuf, "0.0.0.0") == 0) + continue; + ret = asprintf(&buf, "%s:%s,%d", hbuf, sbuf, + targ->t_portal_group->pg_tag); + break; + case AF_INET6: + if (strcmp(hbuf, "::") == 0) + continue; + ret = asprintf(&buf, "[%s]:%s,%d", hbuf, sbuf, + targ->t_portal_group->pg_tag); + break; + default: + continue; + } + if (ret <= 0) + log_err(1, "asprintf"); + keys_add(response_keys, "TargetAddress", buf); + free(buf); + } +} + void discovery(struct connection *conn) { @@ -186,7 +230,7 @@ discovery(struct connection *conn) targ->t_name); continue; } - keys_add(response_keys, "TargetName", targ->t_name); + discovery_add_target(response_keys, targ); } } else { targ = target_find(conn->conn_portal->p_portal_group->pg_conf, @@ -194,9 +238,8 @@ discovery(struct connection *conn) if (targ == NULL) { log_debugx("initiator requested information on unknown " "target \"%s\"; returning nothing", send_targets); - } else { - keys_add(response_keys, "TargetName", targ->t_name); - } + } else + discovery_add_target(response_keys, targ); } keys_save(response_keys, response); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:20:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C1072655; Wed, 2 Jul 2014 10:20:08 +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 9439823AD; Wed, 2 Jul 2014 10:20:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62AK8rL075103; Wed, 2 Jul 2014 10:20:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AK8dT075102; Wed, 2 Jul 2014 10:20:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021020.s62AK8dT075102@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268141 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:20:08 -0000 Author: mav Date: Wed Jul 2 10:20:08 2014 New Revision: 268141 URL: http://svnweb.freebsd.org/changeset/base/268141 Log: MFC r267872: Allow to use iSCSI immediate data by several ctl_datamove() calls. While for FreeBSD client that is only a minor optimization, VMWare client doesn't support additional data requests after all data being sent once as immediate. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 2 10:18:42 2014 (r268140) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 2 10:20:08 2014 (r268141) @@ -737,12 +737,15 @@ cfiscsi_handle_data_segment(struct icl_p buffer_offset = ntohl(bhsdo->bhsdo_buffer_offset); else buffer_offset = 0; + len = icl_pdu_data_segment_length(request); /* * Make sure the offset, as sent by the initiator, matches the offset * we're supposed to be at in the scatter-gather list. */ - if (buffer_offset != + if (buffer_offset > + io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled || + buffer_offset + len <= io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled) { CFISCSI_SESSION_WARN(cs, "received bad buffer offset %zd, " "expected %zd; dropping connection", buffer_offset, @@ -758,8 +761,8 @@ cfiscsi_handle_data_segment(struct icl_p * to buffer_offset, which is the offset within the task (SCSI * command). */ - off = 0; - len = icl_pdu_data_segment_length(request); + off = io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled - + buffer_offset; /* * Iterate over the scatter/gather segments, filling them with data @@ -816,12 +819,8 @@ cfiscsi_handle_data_segment(struct icl_p * This obviously can only happen with SCSI Command PDU. */ if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == - ISCSI_BHS_OPCODE_SCSI_COMMAND) { - CFISCSI_SESSION_DEBUG(cs, "received too much immediate " - "data: got %zd bytes, expected %zd", - icl_pdu_data_segment_length(request), off); + ISCSI_BHS_OPCODE_SCSI_COMMAND) return (true); - } CFISCSI_SESSION_WARN(cs, "received too much data: got %zd bytes, " "expected %zd; dropping connection", @@ -2623,8 +2622,8 @@ cfiscsi_datamove_out(union ctl_io *io) cdw->cdw_target_transfer_tag = target_transfer_tag; cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; - if (cs->cs_immediate_data && io->scsiio.kern_rel_offset == 0 && - icl_pdu_data_segment_length(request) > 0) { + if (cs->cs_immediate_data && io->scsiio.kern_rel_offset < + icl_pdu_data_segment_length(request)) { done = cfiscsi_handle_data_segment(request, cdw); if (done) { uma_zfree(cfiscsi_data_wait_zone, cdw); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:32:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0F3C6A9D; Wed, 2 Jul 2014 10:32: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 E4959252C; Wed, 2 Jul 2014 10:32: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 s62AWiUj083408; Wed, 2 Jul 2014 10:32:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AWif5083407; Wed, 2 Jul 2014 10:32:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021032.s62AWif5083407@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268142 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:32:45 -0000 Author: mav Date: Wed Jul 2 10:32:44 2014 New Revision: 268142 URL: http://svnweb.freebsd.org/changeset/base/268142 Log: MFC r265323 (by trasz): Provide better descriptions for 'struct ctl_scsiio' fields; based mostly on emails from ken@. Modified: stable/10/sys/cam/ctl/ctl_io.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Wed Jul 2 10:20:08 2014 (r268141) +++ stable/10/sys/cam/ctl/ctl_io.h Wed Jul 2 10:32:44 2014 (r268142) @@ -293,21 +293,60 @@ union ctl_io; */ struct ctl_scsiio { struct ctl_io_hdr io_hdr; /* common to all I/O types */ + + /* + * The ext_* fields are generally intended for frontend use; CTL itself + * doesn't modify or use them. + */ uint32_t ext_sg_entries; /* 0 = no S/G list, > 0 = num entries */ uint8_t *ext_data_ptr; /* data buffer or S/G list */ uint32_t ext_data_len; /* Data transfer length */ uint32_t ext_data_filled; /* Amount of data filled so far */ - uint32_t kern_sg_entries; /* 0 = no S/G list, > 0 = num entries */ - uint32_t rem_sg_entries; /* 0 = no S/G list, > 0 = num entries */ - uint8_t *kern_data_ptr; /* data buffer or S/G list */ - uint32_t kern_data_len; /* Length of this S/G list/buffer */ - uint32_t kern_total_len; /* Total length of this transaction */ - uint32_t kern_data_resid; /* Length left to transfer after this*/ - uint32_t kern_rel_offset; /* Byte Offset of this transfer */ + + /* + * The number of scatter/gather entries in the list pointed to + * by kern_data_ptr. 0 means there is no list, just a data pointer. + */ + uint32_t kern_sg_entries; + + uint32_t rem_sg_entries; /* Unused. */ + + /* + * The data pointer or a pointer to the scatter/gather list. + */ + uint8_t *kern_data_ptr; + + /* + * Length of the data buffer or scatter/gather list. It's also + * the length of this particular piece of the data transfer, + * ie. number of bytes expected to be transferred by the current + * invocation of frontend's datamove() callback. It's always + * less than or equal to kern_total_len. + */ + uint32_t kern_data_len; + + /* + * Total length of data to be transferred during this particular + * SCSI command, as decoded from SCSI CDB. + */ + uint32_t kern_total_len; + + /* + * Amount of data left after the current data transfer. + */ + uint32_t kern_data_resid; + + /* + * Byte offset of this transfer, equal to the amount of data + * already transferred for this SCSI command during previous + * datamove() invocations. + */ + uint32_t kern_rel_offset; + struct scsi_sense_data sense_data; /* sense data */ uint8_t sense_len; /* Returned sense length */ uint8_t scsi_status; /* SCSI status byte */ - uint8_t sense_residual; /* sense residual length */ + uint8_t sense_residual; /* Unused. */ uint32_t residual; /* data residual length */ uint32_t tag_num; /* tag number */ ctl_tag_type tag_type; /* simple, ordered, head of queue,etc.*/ From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:35:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 91FA8C11; Wed, 2 Jul 2014 10:35:07 +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 7E0DF2544; Wed, 2 Jul 2014 10:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62AZ74Q083916; Wed, 2 Jul 2014 10:35:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AZ6h7083909; Wed, 2 Jul 2014 10:35:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021035.s62AZ6h7083909@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268143 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:35:07 -0000 Author: mav Date: Wed Jul 2 10:35:06 2014 New Revision: 268143 URL: http://svnweb.freebsd.org/changeset/base/268143 Log: MFC r267481, r267952: Implement small KPI to access LUN options instead doing it by hands. Modified: stable/10/sys/cam/ctl/ctl_backend.c stable/10/sys/cam/ctl/ctl_backend.h stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.c Wed Jul 2 10:32:44 2014 (r268142) +++ stable/10/sys/cam/ctl/ctl_backend.c Wed Jul 2 10:35:06 2014 (r268143) @@ -173,6 +173,45 @@ ctl_backend_find(char *backend_name) return (NULL); } -/* - * vim: ts=8 - */ +void +ctl_init_opts(struct ctl_be_lun *be_lun, struct ctl_lun_req *req) +{ + struct ctl_be_lun_option *opt; + int i; + + STAILQ_INIT(&be_lun->options); + for (i = 0; i < req->num_be_args; i++) { + opt = malloc(sizeof(*opt), M_CTL, M_WAITOK); + opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_CTL, M_WAITOK); + strcpy(opt->name, req->kern_be_args[i].kname); + opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_CTL, M_WAITOK); + strcpy(opt->value, req->kern_be_args[i].kvalue); + STAILQ_INSERT_TAIL(&be_lun->options, opt, links); + } +} + +void +ctl_free_opts(struct ctl_be_lun *be_lun) +{ + struct ctl_be_lun_option *opt; + + while ((opt = STAILQ_FIRST(&be_lun->options)) != NULL) { + STAILQ_REMOVE_HEAD(&be_lun->options, links); + free(opt->name, M_CTL); + free(opt->value, M_CTL); + free(opt, M_CTL); + } +} + +char * +ctl_get_opt(struct ctl_be_lun *be_lun, const char *name) +{ + struct ctl_be_lun_option *opt; + + STAILQ_FOREACH(opt, &be_lun->options, links) { + if (strcmp(opt->name, name) == 0) { + return (opt->value); + } + } + return (NULL); +} Modified: stable/10/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.h Wed Jul 2 10:32:44 2014 (r268142) +++ stable/10/sys/cam/ctl/ctl_backend.h Wed Jul 2 10:35:06 2014 (r268143) @@ -301,6 +301,14 @@ int ctl_lun_online(struct ctl_be_lun *be */ void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun); +/* + * KPI to manipulate LUN options + */ +struct ctl_lun_req; +void ctl_init_opts(struct ctl_be_lun *be_lun, struct ctl_lun_req *req); +void ctl_free_opts(struct ctl_be_lun *be_lun); +char * ctl_get_opt(struct ctl_be_lun *be_lun, const char *name); + #endif /* _KERNEL */ #endif /* _CTL_BACKEND_H_ */ Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:32:44 2014 (r268142) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:35:06 2014 (r268143) @@ -1824,9 +1824,12 @@ ctl_be_block_create(struct ctl_be_block_ struct ctl_be_block_lun *be_lun; struct ctl_lun_create_params *params; struct ctl_be_arg *file_arg; + char num_thread_str[16]; char tmpstr[32]; + char *value; int retval, num_threads, unmap; int i; + int tmp_num_threads; params = &req->reqdata.create; retval = 0; @@ -1841,9 +1844,9 @@ ctl_be_block_create(struct ctl_be_block_ STAILQ_INIT(&be_lun->input_queue); STAILQ_INIT(&be_lun->config_write_queue); STAILQ_INIT(&be_lun->datamove_queue); - STAILQ_INIT(&be_lun->ctl_be_lun.options); sprintf(be_lun->lunname, "cblk%d", softc->num_luns); mtx_init(&be_lun->lock, be_lun->lunname, NULL, MTX_DEF); + ctl_init_opts(&be_lun->ctl_be_lun, req); be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG, NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); @@ -1916,50 +1919,27 @@ ctl_be_block_create(struct ctl_be_block_ * XXX This searching loop might be refactored to be combined with * the loop above, */ - unmap = 0; - for (i = 0; i < req->num_be_args; i++) { - if (strcmp(req->kern_be_args[i].kname, "num_threads") == 0) { - struct ctl_be_arg *thread_arg; - char num_thread_str[16]; - int tmp_num_threads; - - - thread_arg = &req->kern_be_args[i]; - - strlcpy(num_thread_str, (char *)thread_arg->kvalue, - min(thread_arg->vallen, - sizeof(num_thread_str))); - - tmp_num_threads = strtol(num_thread_str, NULL, 0); - - /* - * We don't let the user specify less than one - * thread, but hope he's clueful enough not to - * specify 1000 threads. - */ - if (tmp_num_threads < 1) { - snprintf(req->error_str, sizeof(req->error_str), - "%s: invalid number of threads %s", - __func__, num_thread_str); - goto bailout_error; - } + value = ctl_get_opt(&be_lun->ctl_be_lun, "num_threads"); + if (value != NULL) { + tmp_num_threads = strtol(value, NULL, 0); - num_threads = tmp_num_threads; - } else if (strcmp(req->kern_be_args[i].kname, "unmap") == 0 && - strcmp(req->kern_be_args[i].kvalue, "on") == 0) { - unmap = 1; - } else if (strcmp(req->kern_be_args[i].kname, "file") != 0 && - strcmp(req->kern_be_args[i].kname, "dev") != 0) { - struct ctl_be_lun_option *opt; - - opt = malloc(sizeof(*opt), M_CTLBLK, M_WAITOK); - opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_CTLBLK, M_WAITOK); - strcpy(opt->name, req->kern_be_args[i].kname); - opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_CTLBLK, M_WAITOK); - strcpy(opt->value, req->kern_be_args[i].kvalue); - STAILQ_INSERT_TAIL(&be_lun->ctl_be_lun.options, opt, links); + /* + * We don't let the user specify less than one + * thread, but hope he's clueful enough not to + * specify 1000 threads. + */ + if (tmp_num_threads < 1) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: invalid number of threads %s", + __func__, num_thread_str); + goto bailout_error; } + num_threads = tmp_num_threads; } + unmap = 0; + value = ctl_get_opt(&be_lun->ctl_be_lun, "unmap"); + if (value != NULL && strcmp(value, "on") == 0) + unmap = 1; be_lun->flags = CTL_BE_BLOCK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; @@ -2122,6 +2102,7 @@ bailout_error: free(be_lun->dev_path, M_CTLBLK); if (be_lun->lun_zone != NULL) uma_zdestroy(be_lun->lun_zone); + ctl_free_opts(&be_lun->ctl_be_lun); mtx_destroy(&be_lun->lock); free(be_lun, M_CTLBLK); @@ -2208,6 +2189,7 @@ ctl_be_block_rm(struct ctl_be_block_soft uma_zdestroy(be_lun->lun_zone); + ctl_free_opts(&be_lun->ctl_be_lun); free(be_lun->dev_path, M_CTLBLK); free(be_lun, M_CTLBLK); Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 2 10:32:44 2014 (r268142) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 2 10:35:06 2014 (r268143) @@ -502,6 +502,7 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram if (retval == 0) { taskqueue_drain(be_lun->io_taskqueue, &be_lun->io_task); taskqueue_free(be_lun->io_taskqueue); + ctl_free_opts(&be_lun->ctl_be_lun); mtx_destroy(&be_lun->lock); free(be_lun, M_RAMDISK); } @@ -523,8 +524,9 @@ ctl_backend_ramdisk_create(struct ctl_be struct ctl_be_ramdisk_lun *be_lun; struct ctl_lun_create_params *params; uint32_t blocksize; + char *value; char tmpstr[32]; - int i, retval, unmap; + int retval, unmap; retval = 0; params = &req->reqdata.create; @@ -543,7 +545,7 @@ ctl_backend_ramdisk_create(struct ctl_be goto bailout_error; } sprintf(be_lun->lunname, "cram%d", softc->num_luns); - STAILQ_INIT(&be_lun->ctl_be_lun.options); + ctl_init_opts(&be_lun->ctl_be_lun, req); if (params->flags & CTL_LUN_FLAG_DEV_TYPE) be_lun->ctl_be_lun.lun_type = params->device_type; @@ -581,21 +583,9 @@ ctl_backend_ramdisk_create(struct ctl_be be_lun->softc = softc; unmap = 0; - for (i = 0; i < req->num_be_args; i++) { - if (strcmp(req->kern_be_args[i].kname, "unmap") == 0 && - strcmp(req->kern_be_args[i].kvalue, "on") == 0) { - unmap = 1; - } else { - struct ctl_be_lun_option *opt; - - opt = malloc(sizeof(*opt), M_RAMDISK, M_WAITOK); - opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_RAMDISK, M_WAITOK); - strcpy(opt->name, req->kern_be_args[i].kname); - opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_RAMDISK, M_WAITOK); - strcpy(opt->value, req->kern_be_args[i].kvalue); - STAILQ_INSERT_TAIL(&be_lun->ctl_be_lun.options, opt, links); - } - } + value = ctl_get_opt(&be_lun->ctl_be_lun, "unmap"); + if (value != NULL && strcmp(value, "on") == 0) + unmap = 1; be_lun->flags = CTL_BE_RAMDISK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; @@ -728,6 +718,7 @@ bailout_error: if (be_lun->io_taskqueue != NULL) { taskqueue_free(be_lun->io_taskqueue); } + ctl_free_opts(&be_lun->ctl_be_lun); mtx_destroy(&be_lun->lock); free(be_lun, M_RAMDISK); } Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 2 10:32:44 2014 (r268142) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 2 10:35:06 2014 (r268143) @@ -2311,22 +2311,18 @@ cfiscsi_lun_enable(void *arg, struct ctl { struct cfiscsi_softc *softc; struct cfiscsi_target *ct; - struct ctl_be_lun_option *opt; const char *target = NULL, *target_alias = NULL; const char *lun = NULL; unsigned long tmp; softc = (struct cfiscsi_softc *)arg; - STAILQ_FOREACH(opt, - &control_softc->ctl_luns[lun_id]->be_lun->options, links) { - if (strcmp(opt->name, "cfiscsi_target") == 0) - target = opt->value; - else if (strcmp(opt->name, "cfiscsi_target_alias") == 0) - target_alias = opt->value; - else if (strcmp(opt->name, "cfiscsi_lun") == 0) - lun = opt->value; - } + target = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun, + "cfiscsi_target"); + target_alias = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun, + "cfiscsi_target_alias"); + lun = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun, + "cfiscsi_lun"); if (target == NULL && lun == NULL) return (0); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:36:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 84149D47; Wed, 2 Jul 2014 10:36: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 581D9254B; Wed, 2 Jul 2014 10:36: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 s62Aa5gs084099; Wed, 2 Jul 2014 10:36:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62Aa4L5084096; Wed, 2 Jul 2014 10:36:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021036.s62Aa4L5084096@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268144 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:36:05 -0000 Author: mav Date: Wed Jul 2 10:36:04 2014 New Revision: 268144 URL: http://svnweb.freebsd.org/changeset/base/268144 Log: MFC r267485: Remove non-functional remnants of control LUN -- 18MB of RAM for nothing. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed Jul 2 10:35:06 2014 (r268143) +++ stable/10/sys/cam/ctl/ctl.c Wed Jul 2 10:36:04 2014 (r268144) @@ -961,7 +961,6 @@ ctl_init(void) struct ctl_softc *softc; struct ctl_io_pool *internal_pool, *emergency_pool, *other_pool; struct ctl_frontend *fe; - struct ctl_lun *lun; uint8_t sc_id =0; int i, error, retval; //int isc_retval; @@ -1049,8 +1048,6 @@ ctl_init(void) STAILQ_INIT(&softc->be_list); STAILQ_INIT(&softc->io_pools); - lun = &softc->lun; - /* * We don't bother calling these with ctl_lock held here, because, * in theory, no one else can try to do anything while we're in our @@ -1085,16 +1082,6 @@ ctl_init(void) softc->emergency_pool = emergency_pool; softc->othersc_pool = other_pool; - /* - * We used to allocate a processor LUN here. The new scheme is to - * just let the user allocate LUNs as he sees fit. - */ -#if 0 - mtx_lock(&softc->ctl_lock); - ctl_alloc_lun(softc, lun, /*be_lun*/NULL, /*target*/softc->target); - mtx_unlock(&softc->ctl_lock); -#endif - if (worker_threads > MAXCPU || worker_threads == 0) { printf("invalid kern.cam.ctl.worker_threads value; " "setting to 1"); @@ -1116,9 +1103,6 @@ ctl_init(void) &softc->work_thread, NULL, 0, 0, "ctl", "work%d", i); if (error != 0) { printf("error creating CTL work thread!\n"); - mtx_lock(&softc->ctl_lock); - ctl_free_lun(lun); - mtx_unlock(&softc->ctl_lock); ctl_pool_free(internal_pool); ctl_pool_free(emergency_pool); ctl_pool_free(other_pool); Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Wed Jul 2 10:35:06 2014 (r268143) +++ stable/10/sys/cam/ctl/ctl_private.h Wed Jul 2 10:36:04 2014 (r268144) @@ -426,7 +426,6 @@ struct ctl_softc { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; struct ctl_ioctl_info ioctl_info; - struct ctl_lun lun; struct ctl_io_pool *internal_pool; struct ctl_io_pool *emergency_pool; struct ctl_io_pool *othersc_pool; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:37:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5D525EAC; Wed, 2 Jul 2014 10:37: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 4A3242571; Wed, 2 Jul 2014 10:37: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 s62AbNLH084374; Wed, 2 Jul 2014 10:37:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AbMSc084372; Wed, 2 Jul 2014 10:37:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021037.s62AbMSc084372@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268145 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:37:23 -0000 Author: mav Date: Wed Jul 2 10:37:22 2014 New Revision: 268145 URL: http://svnweb.freebsd.org/changeset/base/268145 Log: MFC r267496, r267498: Add "vendor", "product" and "revision" options to control inquiry data. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed Jul 2 10:36:04 2014 (r268144) +++ stable/10/sys/cam/ctl/ctl.c Wed Jul 2 10:37:22 2014 (r268145) @@ -9303,6 +9303,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio struct ctl_softc *ctl_softc; struct ctl_lun *lun; struct ctl_frontend *fe; + char *val; #ifndef CTL_USE_BACKEND_SN char tmpstr[32]; #endif /* CTL_USE_BACKEND_SN */ @@ -9396,7 +9397,13 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio */ desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; desc->length = sizeof(*t10id) + CTL_DEVID_LEN; - strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); + if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) { + strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); + } else { + memset(t10id->vendor, ' ', sizeof(t10id->vendor)); + strncpy(t10id->vendor, val, + min(sizeof(t10id->vendor), strlen(val))); + } /* * desc1 is for the WWPN which is a port asscociation. @@ -9634,6 +9641,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio struct scsi_inquiry *cdb; struct ctl_softc *ctl_softc; struct ctl_lun *lun; + char *val; uint32_t alloc_len; int is_fc; @@ -9778,10 +9786,16 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * We have 8 bytes for the vendor name, and 16 bytes for the device * name and 4 bytes for the revision. */ - strncpy(inq_ptr->vendor, CTL_VENDOR, sizeof(inq_ptr->vendor)); + if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) { + strcpy(inq_ptr->vendor, CTL_VENDOR); + } else { + memset(inq_ptr->vendor, ' ', sizeof(inq_ptr->vendor)); + strncpy(inq_ptr->vendor, val, + min(sizeof(inq_ptr->vendor), strlen(val))); + } if (lun == NULL) { strcpy(inq_ptr->product, CTL_DIRECT_PRODUCT); - } else { + } else if ((val = ctl_get_opt(lun->be_lun, "product")) == NULL) { switch (lun->be_lun->lun_type) { case T_DIRECT: strcpy(inq_ptr->product, CTL_DIRECT_PRODUCT); @@ -9793,13 +9807,23 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio strcpy(inq_ptr->product, CTL_UNKNOWN_PRODUCT); break; } + } else { + memset(inq_ptr->product, ' ', sizeof(inq_ptr->product)); + strncpy(inq_ptr->product, val, + min(sizeof(inq_ptr->product), strlen(val))); } /* * XXX make this a macro somewhere so it automatically gets * incremented when we make changes. */ - strncpy(inq_ptr->revision, "0001", sizeof(inq_ptr->revision)); + if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "revision")) == NULL) { + strncpy(inq_ptr->revision, "0001", sizeof(inq_ptr->revision)); + } else { + memset(inq_ptr->revision, ' ', sizeof(inq_ptr->revision)); + strncpy(inq_ptr->revision, val, + min(sizeof(inq_ptr->revision), strlen(val))); + } /* * For parallel SCSI, we support double transition and single Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 2 10:36:04 2014 (r268144) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 2 10:37:22 2014 (r268145) @@ -2037,6 +2037,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, struct scsi_vpd_id_t10 *t10id; struct ctl_lun *lun; const struct icl_pdu *request; + char *val; size_t devid_len, wwpn_len; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -2101,7 +2102,13 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_ASCII; desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; desc->length = sizeof(*t10id) + CTL_DEVID_LEN; - strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); + if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) { + strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); + } else { + memset(t10id->vendor, ' ', sizeof(t10id->vendor)); + strncpy(t10id->vendor, val, + min(sizeof(t10id->vendor), strlen(val))); + } /* * If we've actually got a backend, copy the device id from the From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:38:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4FE0CFE0; Wed, 2 Jul 2014 10:38: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 22CBA2576; Wed, 2 Jul 2014 10:38: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 s62AcNmv084579; Wed, 2 Jul 2014 10:38:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AcM6K084577; Wed, 2 Jul 2014 10:38:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021038.s62AcM6K084577@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268146 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:38:23 -0000 Author: mav Date: Wed Jul 2 10:38:22 2014 New Revision: 268146 URL: http://svnweb.freebsd.org/changeset/base/268146 Log: MFC r267499: Remove custom processing for "file" option. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:37:22 2014 (r268145) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:38:22 2014 (r268146) @@ -1823,12 +1823,10 @@ ctl_be_block_create(struct ctl_be_block_ { struct ctl_be_block_lun *be_lun; struct ctl_lun_create_params *params; - struct ctl_be_arg *file_arg; char num_thread_str[16]; char tmpstr[32]; char *value; int retval, num_threads, unmap; - int i; int tmp_num_threads; params = &req->reqdata.create; @@ -1836,8 +1834,6 @@ ctl_be_block_create(struct ctl_be_block_ num_threads = cbb_num_threads; - file_arg = NULL; - be_lun = malloc(sizeof(*be_lun), M_CTLBLK, M_ZERO | M_WAITOK); be_lun->softc = softc; @@ -1863,24 +1859,13 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.lun_type = T_DIRECT; if (be_lun->ctl_be_lun.lun_type == T_DIRECT) { - for (i = 0; i < req->num_be_args; i++) { - if (strcmp(req->kern_be_args[i].kname, "file") == 0) { - file_arg = &req->kern_be_args[i]; - break; - } - } - - if (file_arg == NULL) { + value = ctl_get_opt(&be_lun->ctl_be_lun, "file"); + if (value == NULL) { snprintf(req->error_str, sizeof(req->error_str), "%s: no file argument specified", __func__); goto bailout_error; } - - be_lun->dev_path = malloc(file_arg->vallen, M_CTLBLK, - M_WAITOK | M_ZERO); - - strlcpy(be_lun->dev_path, (char *)file_arg->kvalue, - file_arg->vallen); + be_lun->dev_path = strdup(value, M_CTLBLK); retval = ctl_be_block_open(softc, be_lun, req); if (retval != 0) { @@ -2518,25 +2503,6 @@ ctl_be_block_lun_info(void *be_lun, stru retval = sbuf_printf(sb, ""); - /* - * For processor devices, we don't have a path variable. - */ - if ((retval != 0) - || (lun->dev_path == NULL)) - goto bailout; - - retval = sbuf_printf(sb, ""); - - if (retval != 0) - goto bailout; - - retval = ctl_sbuf_printf_esc(sb, lun->dev_path); - - if (retval != 0) - goto bailout; - - retval = sbuf_printf(sb, "\n"); - bailout: return (retval); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:39:45 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C7FD71AE; Wed, 2 Jul 2014 10:39: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 B4F48257F; Wed, 2 Jul 2014 10:39: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 s62Adjps084856; Wed, 2 Jul 2014 10:39:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AdjcA084855; Wed, 2 Jul 2014 10:39:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021039.s62AdjcA084855@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268147 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:39:45 -0000 Author: mav Date: Wed Jul 2 10:39:45 2014 New Revision: 268147 URL: http://svnweb.freebsd.org/changeset/base/268147 Log: MFC r267500: Format Portal Group Tag same as istgt does -- %4.4x instead of %x. SPC-4 spec tells it should be "two or more hexadecimal digits". RFC3720 tells it is 16-bit value. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 2 10:38:22 2014 (r268146) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 2 10:39:45 2014 (r268147) @@ -2045,7 +2045,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, cs = PDU_SESSION(request); wwpn_len = strlen(cs->cs_target->ct_name); - wwpn_len += strlen(",t,0x01"); + wwpn_len += strlen(",t,0x0001"); wwpn_len += 1; /* '\0' */ if ((wwpn_len % 4) != 0) wwpn_len += (4 - (wwpn_len % 4)); @@ -2134,7 +2134,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | SVPD_ID_TYPE_SCSI_NAME; desc1->length = wwpn_len; - snprintf(desc1->identifier, wwpn_len, "%s,t,0x%x", + snprintf(desc1->identifier, wwpn_len, "%s,t,0x%4.4x", cs->cs_target->ct_name, cs->cs_portal_group_tag); /* From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:41:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 86C4C302; Wed, 2 Jul 2014 10:41: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 73B152592; Wed, 2 Jul 2014 10:41: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 s62AfCuo087666; Wed, 2 Jul 2014 10:41:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AfBED087663; Wed, 2 Jul 2014 10:41:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021041.s62AfBED087663@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268148 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:41:12 -0000 Author: mav Date: Wed Jul 2 10:41:11 2014 New Revision: 268148 URL: http://svnweb.freebsd.org/changeset/base/268148 Log: MFC r267514: Move kern_total_len setting from backend to core code. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed Jul 2 10:39:45 2014 (r268147) +++ stable/10/sys/cam/ctl/ctl.c Wed Jul 2 10:41:11 2014 (r268148) @@ -8800,6 +8800,9 @@ ctl_read_write(struct ctl_scsiio *ctsio) memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen, sizeof(lbalen)); + ctsio->kern_total_len = num_blocks * lun->be_lun->blocksize; + ctsio->kern_rel_offset = 0; + CTL_DEBUG_PRINT(("ctl_read_write: calling data_submit()\n")); retval = lun->backend->data_submit((union ctl_io *)ctsio); Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:39:45 2014 (r268147) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:41:11 2014 (r268148) @@ -1385,15 +1385,11 @@ ctl_be_block_worker(void *context, int p static int ctl_be_block_submit(union ctl_io *io) { - struct ctl_lba_len lbalen; struct ctl_be_block_lun *be_lun; struct ctl_be_lun *ctl_be_lun; - int retval; DPRINTF("entered\n"); - retval = CTL_RETVAL_COMPLETE; - ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ CTL_PRIV_BACKEND_LUN].ptr; be_lun = (struct ctl_be_block_lun *)ctl_be_lun->be_lun; @@ -1404,11 +1400,6 @@ ctl_be_block_submit(union ctl_io *io) KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Non-SCSI I/O (type " "%#x) encountered", io->io_hdr.io_type)); - memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(lbalen)); - io->scsiio.kern_total_len = lbalen.len * be_lun->blocksize; - io->scsiio.kern_rel_offset = 0; - mtx_lock(&be_lun->lock); /* * XXX KDM make sure that links is okay to use at this point. @@ -1417,10 +1408,9 @@ ctl_be_block_submit(union ctl_io *io) */ STAILQ_INSERT_TAIL(&be_lun->input_queue, &io->io_hdr, links); mtx_unlock(&be_lun->lock); - taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task); - return (retval); + return (CTL_RETVAL_COMPLETE); } static int Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 2 10:39:45 2014 (r268147) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 2 10:41:11 2014 (r268148) @@ -274,20 +274,8 @@ ctl_backend_ramdisk_move_done(union ctl_ static int ctl_backend_ramdisk_submit(union ctl_io *io) { - struct ctl_lba_len lbalen; - struct ctl_be_lun *ctl_be_lun; - ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ - CTL_PRIV_BACKEND_LUN].ptr; - - memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(lbalen)); - io->scsiio.be_move_done = ctl_backend_ramdisk_move_done; - io->scsiio.kern_total_len = lbalen.len * ctl_be_lun->blocksize; - io->scsiio.kern_rel_offset = 0; - io->scsiio.kern_data_resid = 0; ctl_backend_ramdisk_continue(io); - return (CTL_RETVAL_COMPLETE); } @@ -328,6 +316,8 @@ ctl_backend_ramdisk_continue(union ctl_i io->scsiio.kern_data_ptr = softc->ramdisk_buffer; #endif /* CTL_RAMDISK_PAGES */ + io->scsiio.be_move_done = ctl_backend_ramdisk_move_done; + io->scsiio.kern_data_resid = 0; io->scsiio.kern_data_len = len_filled; io->scsiio.kern_sg_entries = sg_filled; io->io_hdr.flags |= CTL_FLAG_ALLOCATED; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:42:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 020BE449; Wed, 2 Jul 2014 10:42: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 E2628260E; Wed, 2 Jul 2014 10:42:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62Aghe9088427; Wed, 2 Jul 2014 10:42:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AghFg088425; Wed, 2 Jul 2014 10:42:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021042.s62AghFg088425@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268149 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:42:44 -0000 Author: mav Date: Wed Jul 2 10:42:43 2014 New Revision: 268149 URL: http://svnweb.freebsd.org/changeset/base/268149 Log: MFC r267515: Remove memcpy() from ctl_private[] accesses. That union is aligned enough to access data directly. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed Jul 2 10:41:11 2014 (r268148) +++ stable/10/sys/cam/ctl/ctl.c Wed Jul 2 10:42:43 2014 (r268149) @@ -5779,7 +5779,7 @@ int ctl_write_same(struct ctl_scsiio *ctsio) { struct ctl_lun *lun; - struct ctl_lba_len_flags lbalen; + struct ctl_lba_len_flags *lbalen; uint64_t lba; uint32_t num_blocks; int len, retval; @@ -5872,11 +5872,10 @@ ctl_write_same(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } - lbalen.lba = lba; - lbalen.len = num_blocks; - lbalen.flags = byte2; - memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen, - sizeof(lbalen)); + lbalen = (struct ctl_lba_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->lba = lba; + lbalen->len = num_blocks; + lbalen->flags = byte2; retval = lun->backend->config_write((union ctl_io *)ctsio); return (retval); @@ -5887,7 +5886,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) { struct ctl_lun *lun; struct scsi_unmap *cdb; - struct ctl_ptr_len_flags ptrlen; + struct ctl_ptr_len_flags *ptrlen; struct scsi_unmap_header *hdr; struct scsi_unmap_desc *buf, *end; uint64_t lba; @@ -5942,11 +5941,10 @@ ctl_unmap(struct ctl_scsiio *ctsio) buf = (struct scsi_unmap_desc *)(hdr + 1); end = buf + len / sizeof(*buf); - ptrlen.ptr = (void *)buf; - ptrlen.len = len; - ptrlen.flags = byte2; - memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &ptrlen, - sizeof(ptrlen)); + ptrlen = (struct ctl_ptr_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + ptrlen->ptr = (void *)buf; + ptrlen->len = len; + ptrlen->flags = byte2; for (; buf < end; buf++) { lba = scsi_8btou64(buf->lba); @@ -12755,7 +12753,7 @@ ctl_process_done(union ctl_io *io, int h switch (io->io_hdr.io_type) { case CTL_IO_SCSI: { int isread; - struct ctl_lba_len lbalen; + struct ctl_lba_len *lbalen; isread = 0; switch (io->scsiio.cdb[0]) { @@ -12772,12 +12770,12 @@ ctl_process_done(union ctl_io *io, int h case WRITE_VERIFY_10: case WRITE_VERIFY_12: case WRITE_VERIFY_16: - memcpy(&lbalen, io->io_hdr.ctl_private[ - CTL_PRIV_LBA_LEN].bytes, sizeof(lbalen)); + lbalen = (struct ctl_lba_len *) + &io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; if (isread) { lun->stats.ports[targ_port].bytes[CTL_STATS_READ] += - lbalen.len * blocksize; + lbalen->len * blocksize; lun->stats.ports[targ_port].operations[CTL_STATS_READ]++; #ifdef CTL_TIME_IO @@ -12807,7 +12805,7 @@ ctl_process_done(union ctl_io *io, int h #endif /* CTL_TIME_IO */ } else { lun->stats.ports[targ_port].bytes[CTL_STATS_WRITE] += - lbalen.len * blocksize; + lbalen->len * blocksize; lun->stats.ports[targ_port].operations[ CTL_STATS_WRITE]++; Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:41:11 2014 (r268148) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:42:43 2014 (r268149) @@ -788,7 +788,7 @@ ctl_be_block_unmap_dev(struct ctl_be_blo { union ctl_io *io; struct ctl_be_block_devdata *dev_data; - struct ctl_ptr_len_flags ptrlen; + struct ctl_ptr_len_flags *ptrlen; struct scsi_unmap_desc *buf, *end; uint64_t len; @@ -802,10 +802,9 @@ ctl_be_block_unmap_dev(struct ctl_be_blo if (beio->io_offset == -1) { beio->io_len = 0; - memcpy(&ptrlen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(ptrlen)); - buf = (struct scsi_unmap_desc *)ptrlen.ptr; - end = buf + ptrlen.len / sizeof(*buf); + ptrlen = (struct ctl_ptr_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + buf = (struct scsi_unmap_desc *)ptrlen->ptr; + end = buf + ptrlen->len / sizeof(*buf); for (; buf < end; buf++) { len = (uint64_t)scsi_4btoul(buf->length) * be_lun->blocksize; @@ -928,7 +927,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b { struct ctl_be_block_io *beio; struct ctl_be_block_softc *softc; - struct ctl_lba_len_flags lbalen; + struct ctl_lba_len_flags *lbalen; uint64_t len_left, lba; int i, seglen; uint8_t *buf, *end; @@ -937,11 +936,10 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; softc = be_lun->softc; - memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(lbalen)); + lbalen = (struct ctl_lba_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; - if (lbalen.flags & ~(SWS_LBDATA | SWS_UNMAP) || - (lbalen.flags & SWS_UNMAP && be_lun->unmap == NULL)) { + if (lbalen->flags & ~(SWS_LBDATA | SWS_UNMAP) || + (lbalen->flags & SWS_UNMAP && be_lun->unmap == NULL)) { ctl_free_beio(beio); ctl_set_invalid_field(&io->scsiio, /*sks_valid*/ 1, @@ -977,9 +975,9 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b break; } - if (lbalen.flags & SWS_UNMAP) { - beio->io_offset = lbalen.lba * be_lun->blocksize; - beio->io_len = (uint64_t)lbalen.len * be_lun->blocksize; + if (lbalen->flags & SWS_UNMAP) { + beio->io_offset = lbalen->lba * be_lun->blocksize; + beio->io_len = (uint64_t)lbalen->len * be_lun->blocksize; beio->bio_cmd = BIO_DELETE; beio->ds_trans_type = DEVSTAT_FREE; @@ -991,9 +989,9 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b beio->ds_trans_type = DEVSTAT_WRITE; DPRINTF("WRITE SAME at LBA %jx len %u\n", - (uintmax_t)lbalen.lba, lbalen.len); + (uintmax_t)lbalen->lba, lbalen->len); - len_left = (uint64_t)lbalen.len * be_lun->blocksize; + len_left = (uint64_t)lbalen->len * be_lun->blocksize; for (i = 0, lba = 0; i < CTLBLK_MAX_SEGS && len_left > 0; i++) { /* @@ -1014,21 +1012,19 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b end = buf + seglen; for (; buf < end; buf += be_lun->blocksize) { memcpy(buf, io->scsiio.kern_data_ptr, be_lun->blocksize); - if (lbalen.flags & SWS_LBDATA) - scsi_ulto4b(lbalen.lba + lba, buf); + if (lbalen->flags & SWS_LBDATA) + scsi_ulto4b(lbalen->lba + lba, buf); lba++; } } - beio->io_offset = lbalen.lba * be_lun->blocksize; + beio->io_offset = lbalen->lba * be_lun->blocksize; beio->io_len = lba * be_lun->blocksize; /* We can not do all in one run. Correct and schedule rerun. */ if (len_left > 0) { - lbalen.lba += lba; - lbalen.len -= lba; - memcpy(io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen, - sizeof(lbalen)); + lbalen->lba += lba; + lbalen->len -= lba; beio->beio_cont = ctl_be_block_cw_done_ws; } @@ -1041,16 +1037,15 @@ ctl_be_block_cw_dispatch_unmap(struct ct { struct ctl_be_block_io *beio; struct ctl_be_block_softc *softc; - struct ctl_ptr_len_flags ptrlen; + struct ctl_ptr_len_flags *ptrlen; DPRINTF("entered\n"); beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; softc = be_lun->softc; - memcpy(&ptrlen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(ptrlen)); + ptrlen = (struct ctl_ptr_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; - if (ptrlen.flags != 0 || be_lun->unmap == NULL) { + if (ptrlen->flags != 0 || be_lun->unmap == NULL) { ctl_free_beio(beio); ctl_set_invalid_field(&io->scsiio, /*sks_valid*/ 0, @@ -1092,8 +1087,7 @@ ctl_be_block_cw_dispatch_unmap(struct ct beio->bio_cmd = BIO_DELETE; beio->ds_trans_type = DEVSTAT_FREE; - DPRINTF("WRITE SAME at LBA %jx len %u\n", - (uintmax_t)lbalen.lba, lbalen.len); + DPRINTF("UNMAP\n"); be_lun->unmap(be_lun, beio); } @@ -1188,7 +1182,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc { struct ctl_be_block_io *beio; struct ctl_be_block_softc *softc; - struct ctl_lba_len lbalen; + struct ctl_lba_len *lbalen; uint64_t len_left, lbaoff; int i; @@ -1248,14 +1242,13 @@ ctl_be_block_dispatch(struct ctl_be_bloc beio->ds_trans_type = DEVSTAT_WRITE; } - memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(lbalen)); + lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; DPRINTF("%s at LBA %jx len %u @%ju\n", (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", - (uintmax_t)lbalen.lba, lbalen.len, lbaoff); + (uintmax_t)lbalen->lba, lbalen->len, lbaoff); lbaoff = io->scsiio.kern_rel_offset / be_lun->blocksize; - beio->io_offset = (lbalen.lba + lbaoff) * be_lun->blocksize; - beio->io_len = MIN((lbalen.len - lbaoff) * be_lun->blocksize, + beio->io_offset = (lbalen->lba + lbaoff) * be_lun->blocksize; + beio->io_len = MIN((lbalen->len - lbaoff) * be_lun->blocksize, CTLBLK_MAX_IO_SIZE); beio->io_len -= beio->io_len % be_lun->blocksize; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:43:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A84EE58C; Wed, 2 Jul 2014 10: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 94B5B2619; Wed, 2 Jul 2014 10: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 s62Ahs6Z088636; Wed, 2 Jul 2014 10:43:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AhsS8088634; Wed, 2 Jul 2014 10:43:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021043.s62AhsS8088634@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268150 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:43:54 -0000 Author: mav Date: Wed Jul 2 10:43:53 2014 New Revision: 268150 URL: http://svnweb.freebsd.org/changeset/base/268150 Log: MFC r267519: Make backends track completion by processed number of sectors instead of total transfer size. Commands such as VERIFY or COMPARE AND WRITE may have transfer size not matching directly to number of sectors. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:42:43 2014 (r268149) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:43:53 2014 (r268150) @@ -105,6 +105,9 @@ __FBSDID("$FreeBSD$"); #define DPRINTF(fmt, args...) do {} while(0) #endif +#define PRIV(io) \ + ((struct ctl_ptr_len_flags *)&(io)->io_hdr.ctl_private[CTL_PRIV_BACKEND]) + SDT_PROVIDER_DEFINE(cbb); typedef enum { @@ -358,9 +361,7 @@ ctl_be_block_move_done(union ctl_io *io) struct bintime cur_bt; #endif - beio = (struct ctl_be_block_io *) - io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; - + beio = (struct ctl_be_block_io *)PRIV(io)->ptr; be_lun = beio->lun; DPRINTF("entered\n"); @@ -934,7 +935,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b DPRINTF("entered\n"); - beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; + beio = (struct ctl_be_block_io *)PRIV(io)->ptr; softc = be_lun->softc; lbalen = (struct ctl_lba_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; @@ -1041,7 +1042,7 @@ ctl_be_block_cw_dispatch_unmap(struct ct DPRINTF("entered\n"); - beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; + beio = (struct ctl_be_block_io *)PRIV(io)->ptr; softc = be_lun->softc; ptrlen = (struct ctl_ptr_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; @@ -1116,7 +1117,7 @@ ctl_be_block_cw_dispatch(struct ctl_be_b beio->io = io; beio->lun = be_lun; beio->beio_cont = ctl_be_block_cw_done; - io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr = beio; + PRIV(io)->ptr = (void *)beio; switch (io->scsiio.cdb[0]) { case SYNCHRONIZE_CACHE: @@ -1183,7 +1184,8 @@ ctl_be_block_dispatch(struct ctl_be_bloc struct ctl_be_block_io *beio; struct ctl_be_block_softc *softc; struct ctl_lba_len *lbalen; - uint64_t len_left, lbaoff; + struct ctl_ptr_len_flags *bptrlen; + uint64_t len_left, lbas; int i; softc = be_lun->softc; @@ -1199,7 +1201,8 @@ ctl_be_block_dispatch(struct ctl_be_bloc beio = ctl_alloc_beio(softc); beio->io = io; beio->lun = be_lun; - io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr = beio; + bptrlen = PRIV(io); + bptrlen->ptr = (void *)beio; /* * If the I/O came down with an ordered or head of queue tag, set @@ -1245,12 +1248,12 @@ ctl_be_block_dispatch(struct ctl_be_bloc lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; DPRINTF("%s at LBA %jx len %u @%ju\n", (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", - (uintmax_t)lbalen->lba, lbalen->len, lbaoff); - lbaoff = io->scsiio.kern_rel_offset / be_lun->blocksize; - beio->io_offset = (lbalen->lba + lbaoff) * be_lun->blocksize; - beio->io_len = MIN((lbalen->len - lbaoff) * be_lun->blocksize, - CTLBLK_MAX_IO_SIZE); - beio->io_len -= beio->io_len % be_lun->blocksize; + (uintmax_t)lbalen->lba, lbalen->len, bptrlen->len); + lbas = MIN(lbalen->len - bptrlen->len, + CTLBLK_MAX_IO_SIZE / be_lun->blocksize); + beio->io_offset = (lbalen->lba + bptrlen->len) * be_lun->blocksize; + beio->io_len = lbas * be_lun->blocksize; + bptrlen->len += lbas; for (i = 0, len_left = beio->io_len; len_left > 0; i++) { KASSERT(i < CTLBLK_MAX_SEGS, ("Too many segs (%d >= %d)", @@ -1268,8 +1271,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc beio->num_segs++; len_left -= beio->sg_segs[i].len; } - if (io->scsiio.kern_rel_offset + beio->io_len < - io->scsiio.kern_total_len) + if (bptrlen->len < lbalen->len) beio->beio_cont = ctl_be_block_next; io->scsiio.be_move_done = ctl_be_block_move_done; io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; @@ -1320,8 +1322,7 @@ ctl_be_block_worker(void *context, int p mtx_unlock(&be_lun->lock); - beio = (struct ctl_be_block_io *) - io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; + beio = (struct ctl_be_block_io *)PRIV(io)->ptr; be_lun->dispatch(be_lun, beio); @@ -1393,6 +1394,8 @@ ctl_be_block_submit(union ctl_io *io) KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Non-SCSI I/O (type " "%#x) encountered", io->io_hdr.io_type)); + PRIV(io)->len = 0; + mtx_lock(&be_lun->lock); /* * XXX KDM make sure that links is okay to use at this point. Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 2 10:42:43 2014 (r268149) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 2 10:43:53 2014 (r268150) @@ -241,7 +241,7 @@ ctl_backend_ramdisk_move_done(union ctl_ if ((io->io_hdr.port_status == 0) && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { - if (io->scsiio.kern_rel_offset < io->scsiio.kern_total_len) { + if (io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer > 0) { mtx_lock(&be_lun->lock); STAILQ_INSERT_TAIL(&be_lun->cont_queue, &io->io_hdr, links); @@ -274,7 +274,14 @@ ctl_backend_ramdisk_move_done(union ctl_ static int ctl_backend_ramdisk_submit(union ctl_io *io) { + struct ctl_be_lun *ctl_be_lun; + struct ctl_lba_len *lbalen; + ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ + CTL_PRIV_BACKEND_LUN].ptr; + lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer = + lbalen->len * ctl_be_lun->blocksize; ctl_backend_ramdisk_continue(io); return (CTL_RETVAL_COMPLETE); } @@ -290,7 +297,7 @@ ctl_backend_ramdisk_continue(union ctl_i #endif softc = &rd_softc; - len = io->scsiio.kern_total_len - io->scsiio.kern_rel_offset; + len = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer; #ifdef CTL_RAMDISK_PAGES sg_filled = min(btoc(len), softc->num_pages); if (sg_filled > 1) { @@ -321,6 +328,7 @@ ctl_backend_ramdisk_continue(union ctl_i io->scsiio.kern_data_len = len_filled; io->scsiio.kern_sg_entries = sg_filled; io->io_hdr.flags |= CTL_FLAG_ALLOCATED; + io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer -= len_filled; #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:45:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 705C8786; Wed, 2 Jul 2014 10:45: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 5C560263A; Wed, 2 Jul 2014 10:45: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 s62AjYgd089059; Wed, 2 Jul 2014 10:45:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62AjWkZ089046; Wed, 2 Jul 2014 10:45:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021045.s62AjWkZ089046@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268151 - in stable/10/sys/cam: ctl scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:45:34 -0000 Author: mav Date: Wed Jul 2 10:45:31 2014 New Revision: 268151 URL: http://svnweb.freebsd.org/changeset/base/268151 Log: MFC r267537: Add support for VERIFY(10/12/16) and COMPARE AND WRITE SCSI commands. Make data_submit backends method support not only read and write requests, but also two new ones: verify and compare. Verify just checks readability of the data in specified location without transferring them outside. Compare reads the specified data and compares them to received data, returning error if they are different. VERIFY(10/12/16) commands request either verify or compare from backend, depending on BYTCHK CDB field. COMPARE AND WRITE command executed in two stages: first it requests compare, and then, if succeesed, requests write. Atomicity of operation is guarantied by CTL request ordering code. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/scsi/scsi_all.c stable/10/sys/cam/scsi/scsi_all.h stable/10/sys/cam/scsi/scsi_da.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed Jul 2 10:43:53 2014 (r268150) +++ stable/10/sys/cam/ctl/ctl.c Wed Jul 2 10:45:31 2014 (r268151) @@ -4996,6 +4996,30 @@ bailout: /* * This gets called by a backend driver when it is done with a + * data_submit method. + */ +void +ctl_data_submit_done(union ctl_io *io) +{ + /* + * If the IO_CONT flag is set, we need to call the supplied + * function to continue processing the I/O, instead of completing + * the I/O just yet. + * + * If there is an error, though, we don't want to keep processing. + * Instead, just send status back to the initiator. + */ + if ((io->io_hdr.flags & CTL_FLAG_IO_CONT) + && (((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE) + || ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS))) { + io->scsiio.io_cont(io); + return; + } + ctl_done(io); +} + +/* + * This gets called by a backend driver when it is done with a * configuration write. */ void @@ -8582,7 +8606,7 @@ int ctl_read_write(struct ctl_scsiio *ctsio) { struct ctl_lun *lun; - struct ctl_lba_len lbalen; + struct ctl_lba_len_flags *lbalen; uint64_t lba; uint32_t num_blocks; int reladdr, fua, dpo, ebp; @@ -8793,10 +8817,11 @@ ctl_read_write(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } - lbalen.lba = lba; - lbalen.len = num_blocks; - memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen, - sizeof(lbalen)); + lbalen = (struct ctl_lba_len_flags *) + &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->lba = lba; + lbalen->len = num_blocks; + lbalen->flags = isread ? CTL_LLF_READ : CTL_LLF_WRITE; ctsio->kern_total_len = num_blocks * lun->be_lun->blocksize; ctsio->kern_rel_offset = 0; @@ -8808,6 +8833,228 @@ ctl_read_write(struct ctl_scsiio *ctsio) return (retval); } +static int +ctl_cnw_cont(union ctl_io *io) +{ + struct ctl_scsiio *ctsio; + struct ctl_lun *lun; + struct ctl_lba_len_flags *lbalen; + int retval; + + ctsio = &io->scsiio; + ctsio->io_hdr.status = CTL_STATUS_NONE; + ctsio->io_hdr.flags &= ~CTL_FLAG_IO_CONT; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + lbalen = (struct ctl_lba_len_flags *) + &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->flags = CTL_LLF_WRITE; + + CTL_DEBUG_PRINT(("ctl_cnw_cont: calling data_submit()\n")); + retval = lun->backend->data_submit((union ctl_io *)ctsio); + return (retval); +} + +int +ctl_cnw(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct ctl_lba_len_flags *lbalen; + uint64_t lba; + uint32_t num_blocks; + int fua, dpo; + int retval; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + CTL_DEBUG_PRINT(("ctl_cnw: command: %#x\n", ctsio->cdb[0])); + + fua = 0; + dpo = 0; + + retval = CTL_RETVAL_COMPLETE; + + switch (ctsio->cdb[0]) { + case COMPARE_AND_WRITE: { + struct scsi_compare_and_write *cdb; + + cdb = (struct scsi_compare_and_write *)ctsio->cdb; + + if (cdb->byte2 & SRW10_FUA) + fua = 1; + if (cdb->byte2 & SRW10_DPO) + dpo = 1; + lba = scsi_8btou64(cdb->addr); + num_blocks = cdb->length; + break; + } + default: + /* + * We got a command we don't support. This shouldn't + * happen, commands should be filtered out above us. + */ + ctl_set_invalid_opcode(ctsio); + ctl_done((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); + break; /* NOTREACHED */ + } + + /* + * XXX KDM what do we do with the DPO and FUA bits? FUA might be + * interesting for us, but if RAIDCore is in write-back mode, + * getting it to do write-through for a particular transaction may + * not be possible. + */ + + /* + * The first check is to make sure we're in bounds, the second + * check is to catch wrap-around problems. If the lba + num blocks + * is less than the lba, then we've wrapped around and the block + * range is invalid anyway. + */ + if (((lba + num_blocks) > (lun->be_lun->maxlba + 1)) + || ((lba + num_blocks) < lba)) { + ctl_set_lba_out_of_range(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + /* + * According to SBC-3, a transfer length of 0 is not an error. + */ + if (num_blocks == 0) { + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + ctsio->kern_total_len = 2 * num_blocks * lun->be_lun->blocksize; + ctsio->kern_rel_offset = 0; + + /* + * Set the IO_CONT flag, so that if this I/O gets passed to + * ctl_data_submit_done(), it'll get passed back to + * ctl_ctl_cnw_cont() for further processing. + */ + ctsio->io_hdr.flags |= CTL_FLAG_IO_CONT; + ctsio->io_cont = ctl_cnw_cont; + + lbalen = (struct ctl_lba_len_flags *) + &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->lba = lba; + lbalen->len = num_blocks; + lbalen->flags = CTL_LLF_COMPARE; + + CTL_DEBUG_PRINT(("ctl_cnw: calling data_submit()\n")); + retval = lun->backend->data_submit((union ctl_io *)ctsio); + return (retval); +} + +int +ctl_verify(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct ctl_lba_len_flags *lbalen; + uint64_t lba; + uint32_t num_blocks; + int bytchk, dpo; + int retval; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + CTL_DEBUG_PRINT(("ctl_verify: command: %#x\n", ctsio->cdb[0])); + + bytchk = 0; + dpo = 0; + retval = CTL_RETVAL_COMPLETE; + + switch (ctsio->cdb[0]) { + case VERIFY_10: { + struct scsi_verify_10 *cdb; + + cdb = (struct scsi_verify_10 *)ctsio->cdb; + if (cdb->byte2 & SVFY_BYTCHK) + bytchk = 1; + if (cdb->byte2 & SVFY_DPO) + dpo = 1; + lba = scsi_4btoul(cdb->addr); + num_blocks = scsi_2btoul(cdb->length); + break; + } + case VERIFY_12: { + struct scsi_verify_12 *cdb; + + cdb = (struct scsi_verify_12 *)ctsio->cdb; + if (cdb->byte2 & SVFY_BYTCHK) + bytchk = 1; + if (cdb->byte2 & SVFY_DPO) + dpo = 1; + lba = scsi_4btoul(cdb->addr); + num_blocks = scsi_4btoul(cdb->length); + break; + } + case VERIFY_16: { + struct scsi_rw_16 *cdb; + + cdb = (struct scsi_rw_16 *)ctsio->cdb; + if (cdb->byte2 & SVFY_BYTCHK) + bytchk = 1; + if (cdb->byte2 & SVFY_DPO) + dpo = 1; + lba = scsi_8btou64(cdb->addr); + num_blocks = scsi_4btoul(cdb->length); + break; + } + default: + /* + * We got a command we don't support. This shouldn't + * happen, commands should be filtered out above us. + */ + ctl_set_invalid_opcode(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + /* + * The first check is to make sure we're in bounds, the second + * check is to catch wrap-around problems. If the lba + num blocks + * is less than the lba, then we've wrapped around and the block + * range is invalid anyway. + */ + if (((lba + num_blocks) > (lun->be_lun->maxlba + 1)) + || ((lba + num_blocks) < lba)) { + ctl_set_lba_out_of_range(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + /* + * According to SBC-3, a transfer length of 0 is not an error. + */ + if (num_blocks == 0) { + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + lbalen = (struct ctl_lba_len_flags *) + &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->lba = lba; + lbalen->len = num_blocks; + if (bytchk) { + lbalen->flags = CTL_LLF_COMPARE; + ctsio->kern_total_len = num_blocks * lun->be_lun->blocksize; + } else { + lbalen->flags = CTL_LLF_VERIFY; + ctsio->kern_total_len = 0; + } + ctsio->kern_rel_offset = 0; + + CTL_DEBUG_PRINT(("ctl_verify: calling data_submit()\n")); + retval = lun->backend->data_submit((union ctl_io *)ctsio); + return (retval); +} + int ctl_report_luns(struct ctl_scsiio *ctsio) { @@ -9526,6 +9773,7 @@ ctl_inquiry_evpd_block_limits(struct ctl bl_ptr->page_code = SVPD_BLOCK_LIMITS; scsi_ulto2b(sizeof(*bl_ptr), bl_ptr->page_length); + bl_ptr->max_cmp_write_len = 0xff; scsi_ulto4b(0xffffffff, bl_ptr->max_txfer_len); scsi_ulto4b(MAXPHYS / bs, bl_ptr->opt_txfer_len); if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { @@ -9937,6 +10185,15 @@ ctl_get_lba_len(union ctl_io *io, uint64 return (1); switch (io->scsiio.cdb[0]) { + case COMPARE_AND_WRITE: { + struct scsi_compare_and_write *cdb; + + cdb = (struct scsi_compare_and_write *)io->scsiio.cdb; + + *lba = scsi_8btou64(cdb->addr); + *len = cdb->length; + break; + } case READ_6: case WRITE_6: { struct scsi_rw_6 *cdb; @@ -10025,6 +10282,33 @@ ctl_get_lba_len(union ctl_io *io, uint64 *len = scsi_4btoul(cdb->length); break; } + case VERIFY_10: { + struct scsi_verify_10 *cdb; + + cdb = (struct scsi_verify_10 *)io->scsiio.cdb; + + *lba = scsi_4btoul(cdb->addr); + *len = scsi_2btoul(cdb->length); + break; + } + case VERIFY_12: { + struct scsi_verify_12 *cdb; + + cdb = (struct scsi_verify_12 *)io->scsiio.cdb; + + *lba = scsi_4btoul(cdb->addr); + *len = scsi_4btoul(cdb->length); + break; + } + case VERIFY_16: { + struct scsi_verify_16 *cdb; + + cdb = (struct scsi_verify_16 *)io->scsiio.cdb; + + *lba = scsi_8btou64(cdb->addr); + *len = scsi_4btoul(cdb->length); + break; + } default: return (1); break; /* NOTREACHED */ @@ -12753,7 +13037,7 @@ ctl_process_done(union ctl_io *io, int h switch (io->io_hdr.io_type) { case CTL_IO_SCSI: { int isread; - struct ctl_lba_len *lbalen; + struct ctl_lba_len_flags *lbalen; isread = 0; switch (io->scsiio.cdb[0]) { @@ -12770,7 +13054,7 @@ ctl_process_done(union ctl_io *io, int h case WRITE_VERIFY_10: case WRITE_VERIFY_12: case WRITE_VERIFY_16: - lbalen = (struct ctl_lba_len *) + lbalen = (struct ctl_lba_len_flags *) &io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; if (isread) { Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Wed Jul 2 10:43:53 2014 (r268150) +++ stable/10/sys/cam/ctl/ctl.h Wed Jul 2 10:45:31 2014 (r268151) @@ -195,6 +195,7 @@ int ctl_debugconf_sp_select_handler(stru int ctl_config_move_done(union ctl_io *io); void ctl_datamove(union ctl_io *io); void ctl_done(union ctl_io *io); +void ctl_data_submit_done(union ctl_io *io); void ctl_config_write_done(union ctl_io *io); #if 0 int ctl_thread(void *arg); Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:43:53 2014 (r268150) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Wed Jul 2 10:45:31 2014 (r268151) @@ -94,9 +94,11 @@ __FBSDID("$FreeBSD$"); * The idea here is that we'll allocate enough S/G space to hold a 1MB * I/O. If we get an I/O larger than that, we'll split it. */ -#define CTLBLK_MAX_IO_SIZE (1024 * 1024) +#define CTLBLK_HALF_IO_SIZE (512 * 1024) +#define CTLBLK_MAX_IO_SIZE (CTLBLK_HALF_IO_SIZE * 2) #define CTLBLK_MAX_SEG MAXPHYS -#define CTLBLK_MAX_SEGS MAX(CTLBLK_MAX_IO_SIZE / CTLBLK_MAX_SEG, 1) +#define CTLBLK_HALF_SEGS MAX(CTLBLK_HALF_IO_SIZE / CTLBLK_MAX_SEG, 1) +#define CTLBLK_MAX_SEGS (CTLBLK_HALF_SEGS * 2) #ifdef CTLBLK_DEBUG #define DPRINTF(fmt, args...) \ @@ -107,6 +109,8 @@ __FBSDID("$FreeBSD$"); #define PRIV(io) \ ((struct ctl_ptr_len_flags *)&(io)->io_hdr.ctl_private[CTL_PRIV_BACKEND]) +#define ARGS(io) \ + ((struct ctl_lba_len_flags *)&(io)->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]) SDT_PROVIDER_DEFINE(cbb); @@ -314,6 +318,13 @@ ctl_free_beio(struct ctl_be_block_io *be uma_zfree(beio->lun->lun_zone, beio->sg_segs[i].addr); beio->sg_segs[i].addr = NULL; + + /* For compare we had two equal S/G lists. */ + if (ARGS(beio->io)->flags & CTL_LLF_COMPARE) { + uma_zfree(beio->lun->lun_zone, + beio->sg_segs[i + CTLBLK_HALF_SEGS].addr); + beio->sg_segs[i + CTLBLK_HALF_SEGS].addr = NULL; + } } if (duplicate_free > 0) { @@ -348,7 +359,7 @@ ctl_complete_beio(struct ctl_be_block_io beio->beio_cont(beio); } else { ctl_free_beio(beio); - ctl_done(io); + ctl_data_submit_done(io); } } @@ -357,9 +368,11 @@ ctl_be_block_move_done(union ctl_io *io) { struct ctl_be_block_io *beio; struct ctl_be_block_lun *be_lun; + struct ctl_lba_len_flags *lbalen; #ifdef CTL_TIME_IO struct bintime cur_bt; -#endif +#endif + int i; beio = (struct ctl_be_block_io *)PRIV(io)->ptr; be_lun = beio->lun; @@ -372,16 +385,37 @@ ctl_be_block_move_done(union ctl_io *io) bintime_add(&io->io_hdr.dma_bt, &cur_bt); io->io_hdr.num_dmas++; #endif + io->scsiio.kern_rel_offset += io->scsiio.kern_data_len; /* * We set status at this point for read commands, and write * commands with errors. */ - if ((beio->bio_cmd == BIO_READ) - && (io->io_hdr.port_status == 0) - && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) - ctl_set_success(&io->scsiio); + if ((io->io_hdr.port_status == 0) && + ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { + lbalen = ARGS(beio->io); + if (lbalen->flags & CTL_LLF_READ) { + ctl_set_success(&io->scsiio); + } else if (lbalen->flags & CTL_LLF_COMPARE) { + /* We have two data blocks ready for comparison. */ + for (i = 0; i < beio->num_segs; i++) { + if (memcmp(beio->sg_segs[i].addr, + beio->sg_segs[i + CTLBLK_HALF_SEGS].addr, + beio->sg_segs[i].len) != 0) + break; + } + if (i < beio->num_segs) + ctl_set_sense(&io->scsiio, + /*current_error*/ 1, + /*sense_key*/ SSD_KEY_MISCOMPARE, + /*asc*/ 0x1D, + /*ascq*/ 0x00, + SSD_ELEM_NONE); + else + ctl_set_success(&io->scsiio); + } + } else if ((io->io_hdr.port_status != 0) && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { @@ -493,12 +527,13 @@ ctl_be_block_biodone(struct bio *bio) } /* - * If this is a write, a flush or a delete, we're all done. + * If this is a write, a flush, a delete or 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) || (beio->bio_cmd == BIO_FLUSH) - || (beio->bio_cmd == BIO_DELETE)) { + || (beio->bio_cmd == BIO_DELETE) + || (ARGS(io)->flags & CTL_LLF_VERIFY)) { ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { @@ -574,18 +609,14 @@ ctl_be_block_dispatch_file(struct ctl_be 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); - } - - bzero(&xuio, sizeof(xuio)); - if (beio->bio_cmd == BIO_READ) - xuio.uio_rw = UIO_READ; - else xuio.uio_rw = UIO_WRITE; - + } xuio.uio_offset = beio->io_offset; xuio.uio_resid = beio->io_len; xuio.uio_segflg = UIO_SYSSPACE; @@ -628,6 +659,7 @@ ctl_be_block_dispatch_file(struct ctl_be (IO_DIRECT|IO_SYNC) : 0, file_data->cred); VOP_UNLOCK(be_lun->vn, 0); + SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0); } else { struct mount *mountpoint; int lock_flags; @@ -669,6 +701,7 @@ ctl_be_block_dispatch_file(struct ctl_be VOP_UNLOCK(be_lun->vn, 0); vn_finished_write(mountpoint); + SDT_PROBE(cbb, kernel, write, file_done, 0, 0, 0, 0, 0); } /* @@ -695,12 +728,10 @@ ctl_be_block_dispatch_file(struct ctl_be * If this is a write, we're all done. * If this is a read, we can now send the data to the user. */ - if (beio->bio_cmd == BIO_WRITE) { + if (ARGS(io)->flags & (CTL_LLF_WRITE | CTL_LLF_VERIFY)) { ctl_set_success(&io->scsiio); - SDT_PROBE(cbb, kernel, write, file_done, 0, 0, 0, 0, 0); ctl_complete_beio(beio); } else { - SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0); #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -937,7 +968,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b beio = (struct ctl_be_block_io *)PRIV(io)->ptr; softc = be_lun->softc; - lbalen = (struct ctl_lba_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen = ARGS(beio->io); if (lbalen->flags & ~(SWS_LBDATA | SWS_UNMAP) || (lbalen->flags & SWS_UNMAP && be_lun->unmap == NULL)) { @@ -1157,11 +1188,10 @@ ctl_be_block_next(struct ctl_be_block_io ctl_free_beio(beio); if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { - ctl_done(io); + ctl_data_submit_done(io); return; } - io->scsiio.kern_rel_offset += io->scsiio.kern_data_len; io->io_hdr.status &= ~CTL_STATUS_MASK; io->io_hdr.status |= CTL_STATUS_NONE; @@ -1183,7 +1213,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc { struct ctl_be_block_io *beio; struct ctl_be_block_softc *softc; - struct ctl_lba_len *lbalen; + struct ctl_lba_len_flags *lbalen; struct ctl_ptr_len_flags *bptrlen; uint64_t len_left, lbas; int i; @@ -1192,10 +1222,11 @@ ctl_be_block_dispatch(struct ctl_be_bloc DPRINTF("entered\n"); - if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) { - SDT_PROBE(cbb, kernel, read, start, 0, 0, 0, 0, 0); - } else { + lbalen = ARGS(io); + if (lbalen->flags & CTL_LLF_WRITE) { SDT_PROBE(cbb, kernel, write, start, 0, 0, 0, 0, 0); + } else { + SDT_PROBE(cbb, kernel, read, start, 0, 0, 0, 0, 0); } beio = ctl_alloc_beio(softc); @@ -1233,24 +1264,22 @@ ctl_be_block_dispatch(struct ctl_be_bloc break; } - /* - * This path handles read and write only. The config write path - * handles flush operations. - */ - if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) { - beio->bio_cmd = BIO_READ; - beio->ds_trans_type = DEVSTAT_READ; - } else { + if (lbalen->flags & CTL_LLF_WRITE) { beio->bio_cmd = BIO_WRITE; beio->ds_trans_type = DEVSTAT_WRITE; + } else { + beio->bio_cmd = BIO_READ; + beio->ds_trans_type = DEVSTAT_READ; } - lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; DPRINTF("%s at LBA %jx len %u @%ju\n", (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", (uintmax_t)lbalen->lba, lbalen->len, bptrlen->len); - lbas = MIN(lbalen->len - bptrlen->len, - CTLBLK_MAX_IO_SIZE / be_lun->blocksize); + if (lbalen->flags & CTL_LLF_COMPARE) + lbas = CTLBLK_HALF_IO_SIZE; + else + lbas = CTLBLK_MAX_IO_SIZE; + lbas = MIN(lbalen->len - bptrlen->len, lbas / be_lun->blocksize); beio->io_offset = (lbalen->lba + bptrlen->len) * be_lun->blocksize; beio->io_len = lbas * be_lun->blocksize; bptrlen->len += lbas; @@ -1268,13 +1297,25 @@ ctl_be_block_dispatch(struct ctl_be_bloc DPRINTF("segment %d addr %p len %zd\n", i, beio->sg_segs[i].addr, beio->sg_segs[i].len); + /* Set up second segment for compare operation. */ + if (lbalen->flags & CTL_LLF_COMPARE) { + beio->sg_segs[i + CTLBLK_HALF_SEGS].len = + beio->sg_segs[i].len; + beio->sg_segs[i + CTLBLK_HALF_SEGS].addr = + uma_zalloc(be_lun->lun_zone, M_WAITOK); + } + beio->num_segs++; len_left -= beio->sg_segs[i].len; } if (bptrlen->len < lbalen->len) beio->beio_cont = ctl_be_block_next; io->scsiio.be_move_done = ctl_be_block_move_done; - io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; + /* For compare we have separate S/G lists for read and datamove. */ + if (lbalen->flags & CTL_LLF_COMPARE) + io->scsiio.kern_data_ptr = (uint8_t *)&beio->sg_segs[CTLBLK_HALF_SEGS]; + else + io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; io->scsiio.kern_data_len = beio->io_len; io->scsiio.kern_data_resid = 0; io->scsiio.kern_sg_entries = beio->num_segs; Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 2 10:43:53 2014 (r268150) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 2 10:45:31 2014 (r268151) @@ -267,7 +267,7 @@ ctl_backend_ramdisk_move_done(union ctl_ /*retry_count*/ io->io_hdr.port_status); } - ctl_done(io); + ctl_data_submit_done(io); return(0); } @@ -275,11 +275,16 @@ static int ctl_backend_ramdisk_submit(union ctl_io *io) { struct ctl_be_lun *ctl_be_lun; - struct ctl_lba_len *lbalen; + struct ctl_lba_len_flags *lbalen; ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ CTL_PRIV_BACKEND_LUN].ptr; - lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen = (struct ctl_lba_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + if (lbalen->flags & CTL_LLF_VERIFY) { + ctl_set_success(&io->scsiio); + ctl_data_submit_done(io); + return (CTL_RETVAL_COMPLETE); + } io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer = lbalen->len * ctl_be_lun->blocksize; ctl_backend_ramdisk_continue(io); Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Wed Jul 2 10:43:53 2014 (r268150) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Wed Jul 2 10:45:31 2014 (r268151) @@ -273,7 +273,10 @@ struct ctl_cmd_entry ctl_cmd_table[] = CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE}, /* 2F VERIFY(10) */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE}, /* 30 SEARCH DATA HIGH(10) */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -591,8 +594,9 @@ struct ctl_cmd_entry ctl_cmd_table[] = CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE}, -/* 89 */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +/* 89 COMPARE AND WRITE */ +{ctl_cnw, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE}, /* 8A WRITE(16) */ {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT, @@ -612,7 +616,10 @@ struct ctl_cmd_entry ctl_cmd_table[] = CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE}, /* 8F VERIFY(16) */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE}, /* 90 PRE-FETCH(16) */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -737,7 +744,10 @@ struct ctl_cmd_entry ctl_cmd_table[] = CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE}, /* AF VERIFY(12) */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE}, /* B0 SEARCH DATA HIGH(12) */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Wed Jul 2 10:43:53 2014 (r268150) +++ stable/10/sys/cam/ctl/ctl_io.h Wed Jul 2 10:45:31 2014 (r268151) @@ -138,6 +138,10 @@ struct ctl_lba_len_flags { uint64_t lba; uint32_t len; uint32_t flags; +#define CTL_LLF_READ 0x10000000 +#define CTL_LLF_WRITE 0x20000000 +#define CTL_LLF_VERIFY 0x40000000 +#define CTL_LLF_COMPARE 0x80000000 }; struct ctl_ptr_len_flags { Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Wed Jul 2 10:43:53 2014 (r268150) +++ stable/10/sys/cam/ctl/ctl_private.h Wed Jul 2 10:45:31 2014 (r268151) @@ -477,9 +477,11 @@ int ctl_mode_sense(struct ctl_scsiio *ct int ctl_read_capacity(struct ctl_scsiio *ctsio); int ctl_service_action_in(struct ctl_scsiio *ctsio); int ctl_read_write(struct ctl_scsiio *ctsio); +int ctl_cnw(struct ctl_scsiio *ctsio); int ctl_report_luns(struct ctl_scsiio *ctsio); int ctl_request_sense(struct ctl_scsiio *ctsio); int ctl_tur(struct ctl_scsiio *ctsio); +int ctl_verify(struct ctl_scsiio *ctsio); int ctl_inquiry(struct ctl_scsiio *ctsio); int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio); int ctl_persistent_reserve_out(struct ctl_scsiio *ctsio); Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Wed Jul 2 10:43:53 2014 (r268150) +++ stable/10/sys/cam/scsi/scsi_all.c Wed Jul 2 10:45:31 2014 (r268151) @@ -471,7 +471,8 @@ static struct op_table_entry scsi_op_cod */ /* 88 MM O O O READ(16) */ { 0x88, D | T | W | O | B, "READ(16)" }, - /* 89 */ + /* 89 O COMPARE AND WRITE*/ + { 0x89, D, "COMPARE AND WRITE" }, /* 8A OM O O O WRITE(16) */ { 0x8A, D | T | W | O | B, "WRITE(16)" }, /* 8B O ORWRITE */ Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Wed Jul 2 10:43:53 2014 (r268150) +++ stable/10/sys/cam/scsi/scsi_all.h Wed Jul 2 10:45:31 2014 (r268151) @@ -1041,8 +1041,10 @@ struct ata_pass_16 { #define PERSISTENT_RES_OUT 0x5F #define ATA_PASS_16 0x85 #define READ_16 0x88 +#define COMPARE_AND_WRITE 0x89 #define WRITE_16 0x8A #define WRITE_VERIFY_16 0x8E +#define VERIFY_16 0x8F #define SYNCHRONIZE_CACHE_16 0x91 #define WRITE_SAME_16 0x93 #define SERVICE_ACTION_IN 0x9E @@ -1054,6 +1056,7 @@ struct ata_pass_16 { #define READ_12 0xA8 #define WRITE_12 0xAA #define WRITE_VERIFY_12 0xAE +#define VERIFY_12 0xAF #define READ_ELEMENT_STATUS 0xB8 #define READ_CD 0xBE Modified: stable/10/sys/cam/scsi/scsi_da.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.h Wed Jul 2 10:43:53 2014 (r268150) +++ stable/10/sys/cam/scsi/scsi_da.h Wed Jul 2 10:45:31 2014 (r268151) @@ -222,18 +222,49 @@ struct scsi_read_format_capacities uint8_t reserved1[3]; }; -struct scsi_verify +struct scsi_verify_10 { - uint8_t opcode; /* VERIFY */ + uint8_t opcode; /* VERIFY(10) */ uint8_t byte2; #define SVFY_LUN_MASK 0xE0 #define SVFY_RELADR 0x01 -#define SVFY_BYTECHK 0x02 +#define SVFY_BYTCHK 0x02 #define SVFY_DPO 0x10 uint8_t addr[4]; /* LBA to begin verification at */ - uint8_t reserved0[1]; - uint8_t len[2]; /* number of blocks to verify */ - uint8_t reserved1[3]; + uint8_t group; + uint8_t length[2]; /* number of blocks to verify */ + uint8_t control; +}; + +struct scsi_verify_12 +{ + uint8_t opcode; /* VERIFY(12) */ + uint8_t byte2; + uint8_t addr[4]; /* LBA to begin verification at */ + uint8_t length[4]; /* number of blocks to verify */ + uint8_t group; + uint8_t control; +}; + +struct scsi_verify_16 +{ + uint8_t opcode; /* VERIFY(16) */ + uint8_t byte2; + uint8_t addr[8]; /* LBA to begin verification at */ + uint8_t length[4]; /* number of blocks to verify */ + uint8_t group; + uint8_t control; +}; + +struct scsi_compare_and_write +{ + uint8_t opcode; /* COMPARE AND WRITE */ + uint8_t byte2; + uint8_t addr[8]; /* LBA to begin verification at */ + uint8_t reserved[3]; + uint8_t length; /* number of blocks */ + uint8_t group; + uint8_t control; }; struct scsi_write_and_verify From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:48:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 F10228F1; Wed, 2 Jul 2014 10:48: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 DDF1E2655; Wed, 2 Jul 2014 10:48: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 s62Am6HL089488; Wed, 2 Jul 2014 10:48:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62Am6A2089487; Wed, 2 Jul 2014 10:48:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021048.s62Am6A2089487@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268152 - stable/10/usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:48:07 -0000 Author: mav Date: Wed Jul 2 10:48:06 2014 New Revision: 268152 URL: http://svnweb.freebsd.org/changeset/base/268152 Log: MFC r267506: Document additional LUN/backend options. Modified: stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Wed Jul 2 10:45:31 2014 (r268151) +++ stable/10/usr.sbin/ctladm/ctladm.8 Wed Jul 2 10:48:06 2014 (r268152) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd October 30, 2013 +.Dd June 15, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -933,6 +933,29 @@ Display .Nm usage information. .El +.Sh OPTIONS +Number of additional configuration options may be specified for LUNs. +Some options are global, others are backend-specific. +.Pp +Global options: +.Bl -tag +.It Va vendor +Specifies LUN vendor string up to 8 chars. +.It Va product +Specifies LUN product string up to 16 chars. +.It Va revision +Specifies LUN revision string up to 4 chars. +.It Va unmap +Set to "on", enables UNMAP support for the LUN. +.El +.Pp +Options specific for block backend: +.Bl -tag +.It Va file +Specifies file or device name to use for backing store. +.It Va num_threads +Specifies number of backend threads to use for this LUN. +.El .Sh EXAMPLES .Dl ctladm tur 0:1 .Pp From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 10:49:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E4070A28; Wed, 2 Jul 2014 10:49: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 D0F5D265A; Wed, 2 Jul 2014 10:49: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 s62An6EM089680; Wed, 2 Jul 2014 10:49:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62An6P2089679; Wed, 2 Jul 2014 10:49:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407021049.s62An6P2089679@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Jul 2014 10:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268153 - stable/10/usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 10:49:07 -0000 Author: mav Date: Wed Jul 2 10:49:06 2014 New Revision: 268153 URL: http://svnweb.freebsd.org/changeset/base/268153 Log: MFC r267516i (by joel): mdoc: add missing width to Bl -tag. Modified: stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Wed Jul 2 10:48:06 2014 (r268152) +++ stable/10/usr.sbin/ctladm/ctladm.8 Wed Jul 2 10:49:06 2014 (r268153) @@ -938,7 +938,7 @@ Number of additional configuration optio Some options are global, others are backend-specific. .Pp Global options: -.Bl -tag +.Bl -tag -width 12n .It Va vendor Specifies LUN vendor string up to 8 chars. .It Va product @@ -950,7 +950,7 @@ Set to "on", enables UNMAP support for t .El .Pp Options specific for block backend: -.Bl -tag +.Bl -tag -width 12n .It Va file Specifies file or device name to use for backing store. .It Va num_threads From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 11:49:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 77444CEE; Wed, 2 Jul 2014 11:49: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 6288C2B5C; Wed, 2 Jul 2014 11:49: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 s62BnGkp018057; Wed, 2 Jul 2014 11:49:16 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62BnG1B018056; Wed, 2 Jul 2014 11:49:16 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201407021149.s62BnG1B018056@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 2 Jul 2014 11:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268154 - stable/10/usr.bin/whois X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 11:49:16 -0000 Author: ume Date: Wed Jul 2 11:49:15 2014 New Revision: 268154 URL: http://svnweb.freebsd.org/changeset/base/268154 Log: MFC r267871: Introduce $RA_SERVER to set default whois server. Requested by: nork Reviewed by: nork Modified: stable/10/usr.bin/whois/whois.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/whois/whois.c ============================================================================== --- stable/10/usr.bin/whois/whois.c Wed Jul 2 10:49:06 2014 (r268153) +++ stable/10/usr.bin/whois/whois.c Wed Jul 2 11:49:15 2014 (r268154) @@ -179,10 +179,12 @@ main(int argc, char *argv[]) * back to NICHOST. */ if (host == NULL && country == NULL) { - use_qnichost = 1; - host = NICHOST; - if (!(flags & WHOIS_QUICK)) - flags |= WHOIS_RECURSE; + if ((host = getenv("RA_SERVER")) == NULL) { + use_qnichost = 1; + host = NICHOST; + if (!(flags & WHOIS_QUICK)) + flags |= WHOIS_RECURSE; + } } while (argc-- > 0) { if (country != NULL) { From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 13:09:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D1017197; Wed, 2 Jul 2014 13:09: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 B186A2337; Wed, 2 Jul 2014 13:09: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 s62D9RuC056281; Wed, 2 Jul 2014 13:09:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62D9QnG056273; Wed, 2 Jul 2014 13:09:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407021309.s62D9QnG056273@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 2 Jul 2014 13:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268157 - in stable/10: share/man/man4 sys/dev/cpuctl sys/sys usr.sbin/cpucontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 13:09:27 -0000 Author: kib Date: Wed Jul 2 13:09:26 2014 New Revision: 268157 URL: http://svnweb.freebsd.org/changeset/base/268157 Log: MFC r267651 (by attilio): Add the possibility to specify ecx when performing cpuid calls. MFC r267673: Restore the ABI of the cpuctl(4) ioctl request CPUCTL_CPUID. MFC r267814: Make cpuctl_do_cpuid() and cpuctl_do_cpuid_count() return void. Modified: stable/10/share/man/man4/cpuctl.4 stable/10/sys/dev/cpuctl/cpuctl.c stable/10/sys/sys/cpuctl.h stable/10/usr.sbin/cpucontrol/cpucontrol.8 stable/10/usr.sbin/cpucontrol/cpucontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/cpuctl.4 ============================================================================== --- stable/10/share/man/man4/cpuctl.4 Wed Jul 2 12:13:11 2014 (r268156) +++ stable/10/share/man/man4/cpuctl.4 Wed Jul 2 13:09:26 2014 (r268157) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 2009 +.Dd June 20, 2014 .Dt CPUCTL 4 .Os .Sh NAME @@ -65,7 +65,7 @@ All of the supported operations are invo .Xr ioctl 2 system call. Currently, the following ioctls are defined: -.Bl -tag -width CPUCTL_UPDATE +.Bl -tag -width CPUCTL_CPUID_COUNT .It Dv CPUCTL_RDMSR Fa cpuctl_msr_args_t *args .It Dv CPUCTL_WRMSR Fa cpuctl_msr_args_t *args Read/write CPU machine specific register. @@ -87,20 +87,59 @@ Set/clear MSR bits according to the mask field. .It Dv CPUCTL_CPUID Fa cpuctl_cpuid_args_t *args Retrieve CPUID information. -Arguments are supplied in -the following struct: +Arguments are supplied in the following structure: .Bd -literal typedef struct { - int level; /* CPUID level */ + int level; /* CPUID level */ uint32_t data[4]; } cpuctl_cpuid_args_t; .Ed -.Pp +It is equivalent to the +.Dv CPUCTL_CPUID_COUNT +request with +.Va level_type +set to 0. +.It Dv CPUCTL_CPUID_COUNT Fa cpuctl_cpuid_count_args_t *args +Retrieve CPUID information. +Arguments are supplied in the following structure: +.Bd -literal +typedef struct { + int level; /* CPUID level */ + int level_type; /* CPUID level type */ + uint32_t data[4]; +} cpuctl_cpuid_count_args_t; +.Ed The .Va level -field indicates the CPUID level to retrieve information for, while the +field indicates the CPUID level to retrieve, +it is loaded into the +.Va %eax +register before the CPUID instruction is executed, +The +.Va level_type +field indicates the CPUID level type to retrieve, +it is loaded into the +.Va %ecx +register. +.Pp +The .Va data field is used to store the received CPUID data. +That is, +.Va data[0] +contains the value of +.Va %eax +register after the CPUID instruction is executed, +.Va data[1] +is for +.Va %ebx , +.Va data[2] +for +.Va %ecx , +and +.Va data[3] +for +.Va %edx . .It Dv CPUCTL_UPDATE cpuctl_update_args_t *args Update CPU firmware (microcode). The structure is defined in Modified: stable/10/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/10/sys/dev/cpuctl/cpuctl.c Wed Jul 2 12:13:11 2014 (r268156) +++ stable/10/sys/dev/cpuctl/cpuctl.c Wed Jul 2 13:09:26 2014 (r268157) @@ -67,7 +67,9 @@ static d_ioctl_t cpuctl_ioctl; static int cpuctl_do_msr(int cpu, cpuctl_msr_args_t *data, u_long cmd, struct thread *td); -static int cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, +static void cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, + struct thread *td); +static void cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data, struct thread *td); static int cpuctl_do_update(int cpu, cpuctl_update_args_t *data, struct thread *td); @@ -169,7 +171,8 @@ cpuctl_ioctl(struct cdev *dev, u_long cm ret = cpuctl_do_msr(cpu, (cpuctl_msr_args_t *)data, cmd, td); break; case CPUCTL_CPUID: - ret = cpuctl_do_cpuid(cpu, (cpuctl_cpuid_args_t *)data, td); + cpuctl_do_cpuid(cpu, (cpuctl_cpuid_args_t *)data, td); + ret = 0; break; case CPUCTL_UPDATE: ret = priv_check(td, PRIV_CPUCTL_UPDATE); @@ -177,6 +180,11 @@ cpuctl_ioctl(struct cdev *dev, u_long cm goto fail; ret = cpuctl_do_update(cpu, (cpuctl_update_args_t *)data, td); break; + case CPUCTL_CPUID_COUNT: + cpuctl_do_cpuid_count(cpu, (cpuctl_cpuid_count_args_t *)data, + td); + ret = 0; + break; default: ret = EINVAL; break; @@ -188,8 +196,9 @@ fail: /* * Actually perform cpuid operation. */ -static int -cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td) +static void +cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data, + struct thread *td) { int is_bound = 0; int oldcpu; @@ -199,14 +208,25 @@ cpuctl_do_cpuid(int cpu, cpuctl_cpuid_ar /* Explicitly clear cpuid data to avoid returning stale info. */ bzero(data->data, sizeof(data->data)); - DPRINTF("[cpuctl,%d]: retriving cpuid level %#0x for %d cpu\n", - __LINE__, data->level, cpu); + DPRINTF("[cpuctl,%d]: retrieving cpuid lev %#0x type %#0x for %d cpu\n", + __LINE__, data->level, data->level_type, cpu); oldcpu = td->td_oncpu; is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); - cpuid_count(data->level, 0, data->data); + cpuid_count(data->level, data->level_type, data->data); restore_cpu(oldcpu, is_bound, td); - return (0); +} + +static void +cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td) +{ + cpuctl_cpuid_count_args_t cdata; + + cdata.level = data->level; + /* Override the level type. */ + cdata.level_type = 0; + cpuctl_do_cpuid_count(cpu, &cdata, td); + bcopy(cdata.data, data->data, sizeof(data->data)); /* Ignore error */ } /* @@ -271,12 +291,7 @@ cpuctl_do_update(int cpu, cpuctl_update_ ("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu)); DPRINTF("[cpuctl,%d]: XXX %d", __LINE__, cpu); - ret = cpuctl_do_cpuid(cpu, &args, td); - if (ret != 0) { - DPRINTF("[cpuctl,%d]: cannot retrive cpuid info for cpu %d", - __LINE__, cpu); - return (ENXIO); - } + cpuctl_do_cpuid(cpu, &args, td); ((uint32_t *)vendor)[0] = args.data[1]; ((uint32_t *)vendor)[1] = args.data[3]; ((uint32_t *)vendor)[2] = args.data[2]; Modified: stable/10/sys/sys/cpuctl.h ============================================================================== --- stable/10/sys/sys/cpuctl.h Wed Jul 2 12:13:11 2014 (r268156) +++ stable/10/sys/sys/cpuctl.h Wed Jul 2 13:09:26 2014 (r268157) @@ -35,11 +35,17 @@ typedef struct { } cpuctl_msr_args_t; typedef struct { - int level; /* CPUID level */ + int level; /* CPUID level */ uint32_t data[4]; } cpuctl_cpuid_args_t; typedef struct { + int level; /* CPUID level */ + int level_type; /* CPUID level type */ + uint32_t data[4]; +} cpuctl_cpuid_count_args_t; + +typedef struct { void *data; size_t size; } cpuctl_update_args_t; @@ -50,5 +56,6 @@ typedef struct { #define CPUCTL_UPDATE _IOWR('c', 4, cpuctl_update_args_t) #define CPUCTL_MSRSBIT _IOWR('c', 5, cpuctl_msr_args_t) #define CPUCTL_MSRCBIT _IOWR('c', 6, cpuctl_msr_args_t) +#define CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_count_args_t) #endif /* _CPUCTL_H_ */ Modified: stable/10/usr.sbin/cpucontrol/cpucontrol.8 ============================================================================== --- stable/10/usr.sbin/cpucontrol/cpucontrol.8 Wed Jul 2 12:13:11 2014 (r268156) +++ stable/10/usr.sbin/cpucontrol/cpucontrol.8 Wed Jul 2 13:09:26 2014 (r268157) @@ -65,6 +65,12 @@ device .Ek .Nm .Op Fl vh +.Fl i Ar level,level_type +.Bk +.Ar device +.Ek +.Nm +.Op Fl vh .Op Fl d Ar datadir .Fl u .Bk @@ -114,6 +120,9 @@ In this case the inverted value of mask .It Fl i Ar level Retrieve CPUID info. Level should be given as a hex number. +.It Fl i Ar level,level_type +Retrieve CPUID info. +Level and level_type should be given as hex numbers. .It Fl u Apply CPU firmware updates. The Modified: stable/10/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- stable/10/usr.sbin/cpucontrol/cpucontrol.c Wed Jul 2 12:13:11 2014 (r268156) +++ stable/10/usr.sbin/cpucontrol/cpucontrol.c Wed Jul 2 13:09:26 2014 (r268157) @@ -99,6 +99,7 @@ static struct ucode_handler { static void usage(void); static int isdir(const char *path); static int do_cpuid(const char *cmdarg, const char *dev); +static int do_cpuid_count(const char *cmdarg, const char *dev); static int do_msr(const char *cmdarg, const char *dev); static int do_update(const char *dev); static void datadir_add(const char *path); @@ -112,7 +113,7 @@ usage(void) if (name == NULL) name = "cpuctl"; fprintf(stderr, "Usage: %s [-vh] [-d datadir] [-m msr[=value] | " - "-i level | -u] device\n", name); + "-i level | -i level,level_type | -u] device\n", name); exit(EX_USAGE); } @@ -170,6 +171,57 @@ do_cpuid(const char *cmdarg, const char } static int +do_cpuid_count(const char *cmdarg, const char *dev) +{ + char *cmdarg1, *endptr, *endptr1; + unsigned int level, level_type; + cpuctl_cpuid_count_args_t args; + int fd, error; + + assert(cmdarg != NULL); + assert(dev != NULL); + + level = strtoul(cmdarg, &endptr, 16); + if (*cmdarg == '\0' || *endptr == '\0') { + WARNX(0, "incorrect or missing operand: %s", cmdarg); + usage(); + /* NOTREACHED */ + } + /* Locate the comma... */ + cmdarg1 = strstr(endptr, ","); + /* ... and skip past it */ + cmdarg1 += 1; + level_type = strtoul(cmdarg1, &endptr1, 16); + if (*cmdarg1 == '\0' || *endptr1 != '\0') { + WARNX(0, "incorrect or missing operand: %s", cmdarg); + usage(); + /* NOTREACHED */ + } + + /* + * Fill ioctl argument structure. + */ + args.level = level; + args.level_type = level_type; + fd = open(dev, O_RDONLY); + if (fd < 0) { + WARN(0, "error opening %s for reading", dev); + return (1); + } + error = ioctl(fd, CPUCTL_CPUID_COUNT, &args); + if (error < 0) { + WARN(0, "ioctl(%s, CPUCTL_CPUID_COUNT)", dev); + close(fd); + return (error); + } + fprintf(stdout, "cpuid level 0x%x, level_type 0x%x: 0x%.8x 0x%.8x " + "0x%.8x 0x%.8x\n", level, level_type, args.data[0], args.data[1], + args.data[2], args.data[3]); + close(fd); + return (0); +} + +static int do_msr(const char *cmdarg, const char *dev) { unsigned int msr; @@ -414,7 +466,10 @@ main(int argc, char *argv[]) c = flags & (FLAG_I | FLAG_M | FLAG_U); switch (c) { case FLAG_I: - error = do_cpuid(cmdarg, dev); + if (strstr(cmdarg, ",") != NULL) + error = do_cpuid_count(cmdarg, dev); + else + error = do_cpuid(cmdarg, dev); break; case FLAG_M: error = do_msr(cmdarg, dev); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 14:54:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C2ACDB57; Wed, 2 Jul 2014 14:54: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 AD3252E47; Wed, 2 Jul 2014 14:54: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 s62Esio4009021; Wed, 2 Jul 2014 14:54:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62Esg64009007; Wed, 2 Jul 2014 14:54:42 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407021454.s62Esg64009007@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 14:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268161 - in stable/10/usr.bin: . mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 14:54:44 -0000 Author: marcel Date: Wed Jul 2 14:54:41 2014 New Revision: 268161 URL: http://svnweb.freebsd.org/changeset/base/268161 Log: MFC mkimg(1) -- revisions 268159, 268134, 266556, 266514, 266513, 266512, 266511, 266510, 266509, 266176, 265468, 265467, 265462, 265170, 263926, 263924, 263923, 263919 and 263918. Revision 267182 changed mkimg.1 alongside other unrelated manpages. The change to mkimg.1 has been applied without registering a merge of the revision. This allows a future merge of r267182 to happen. Relnotes: yes Added: stable/10/usr.bin/mkimg/ - copied from r263918, head/usr.bin/mkimg/ stable/10/usr.bin/mkimg/format.c - copied unchanged from r266176, head/usr.bin/mkimg/format.c stable/10/usr.bin/mkimg/format.h - copied unchanged from r266176, head/usr.bin/mkimg/format.h stable/10/usr.bin/mkimg/image.c - copied, changed from r266176, head/usr.bin/mkimg/image.c stable/10/usr.bin/mkimg/image.h - copied unchanged from r266176, head/usr.bin/mkimg/image.h stable/10/usr.bin/mkimg/raw.c - copied unchanged from r266176, head/usr.bin/mkimg/raw.c stable/10/usr.bin/mkimg/vmdk.c - copied unchanged from r266176, head/usr.bin/mkimg/vmdk.c Modified: stable/10/usr.bin/Makefile stable/10/usr.bin/mkimg/Makefile (contents, props changed) stable/10/usr.bin/mkimg/apm.c stable/10/usr.bin/mkimg/bsd.c stable/10/usr.bin/mkimg/ebr.c stable/10/usr.bin/mkimg/gpt.c stable/10/usr.bin/mkimg/mbr.c stable/10/usr.bin/mkimg/mkimg.1 (contents, props changed) stable/10/usr.bin/mkimg/mkimg.c (contents, props changed) stable/10/usr.bin/mkimg/mkimg.h stable/10/usr.bin/mkimg/pc98.c stable/10/usr.bin/mkimg/scheme.c (contents, props changed) stable/10/usr.bin/mkimg/scheme.h (contents, props changed) stable/10/usr.bin/mkimg/vtoc8.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/Makefile ============================================================================== --- stable/10/usr.bin/Makefile Wed Jul 2 14:47:48 2014 (r268160) +++ stable/10/usr.bin/Makefile Wed Jul 2 14:54:41 2014 (r268161) @@ -106,6 +106,7 @@ SUBDIR= alias \ mkdep \ ${_mkesdb} \ mkfifo \ + mkimg \ mklocale \ mktemp \ mkulzma \ Modified: stable/10/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Sat Mar 29 19:03:10 2014 (r263918) +++ stable/10/usr.bin/mkimg/Makefile Wed Jul 2 14:54:41 2014 (r268161) @@ -1,11 +1,16 @@ # $FreeBSD$ PROG= mkimg -SRCS= mkimg.c scheme.c +SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 CFLAGS+=-DSPARSE_WRITE +# List of formats to support +SRCS+= \ + raw.c \ + vmdk.c + # List of schemes to support SRCS+= \ apm.c \ Modified: stable/10/usr.bin/mkimg/apm.c ============================================================================== --- head/usr.bin/mkimg/apm.c Sat Mar 29 19:03:10 2014 (r263918) +++ stable/10/usr.bin/mkimg/apm.c Wed Jul 2 14:54:41 2014 (r268161) @@ -35,11 +35,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" +#ifndef APM_ENT_TYPE_FREEBSD_NANDFS +#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" +#endif + static struct mkimg_alias apm_aliases[] = { { ALIAS_FREEBSD, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD) }, + { ALIAS_FREEBSD_BOOT, ALIAS_PTR2TYPE(APM_ENT_TYPE_APPLE_BOOT) }, { ALIAS_FREEBSD_NANDFS, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD_NANDFS) }, { ALIAS_FREEBSD_SWAP, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD_SWAP) }, { ALIAS_FREEBSD_UFS, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD_UFS) }, @@ -58,13 +64,12 @@ apm_metadata(u_int where) } static int -apm_write(int fd __unused, lba_t imgsz __unused, void *bootcode __unused) +apm_write(lba_t imgsz, void *bootcode __unused) { u_char *buf; struct apm_ddr *ddr; struct apm_ent *ent; struct part *part; - ssize_t nbytes; int error; buf = calloc(nparts + 2, secsz); @@ -81,8 +86,8 @@ apm_write(int fd __unused, lba_t imgsz _ be32enc(&ent->ent_pmblkcnt, nparts + 1); be32enc(&ent->ent_start, 1); be32enc(&ent->ent_size, nparts + 1); - strcpy(ent->ent_type, APM_ENT_TYPE_SELF); - strcpy(ent->ent_name, "Apple"); + strncpy(ent->ent_type, APM_ENT_TYPE_SELF, sizeof(ent->ent_type)); + strncpy(ent->ent_name, "Apple", sizeof(ent->ent_name)); STAILQ_FOREACH(part, &partlist, link) { ent = (void *)(buf + (part->index + 2) * secsz); @@ -90,17 +95,14 @@ apm_write(int fd __unused, lba_t imgsz _ be32enc(&ent->ent_pmblkcnt, nparts + 1); be32enc(&ent->ent_start, part->block); be32enc(&ent->ent_size, part->size); - strcpy(ent->ent_type, ALIAS_TYPE2PTR(part->type)); + strncpy(ent->ent_type, ALIAS_TYPE2PTR(part->type), + sizeof(ent->ent_type)); if (part->label != NULL) - strcpy(ent->ent_name, part->label); + strncpy(ent->ent_name, part->label, + sizeof(ent->ent_name)); } - error = mkimg_seek(fd, 0); - if (error == 0) { - nbytes = (nparts + 2) * secsz; - if (write(fd, buf, nbytes) != nbytes) - error = errno; - } + error = image_write(0, buf, nparts + 2); free(buf); return (error); } Modified: stable/10/usr.bin/mkimg/bsd.c ============================================================================== --- head/usr.bin/mkimg/bsd.c Sat Mar 29 19:03:10 2014 (r263918) +++ stable/10/usr.bin/mkimg/bsd.c Wed Jul 2 14:54:41 2014 (r268161) @@ -35,9 +35,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" +#ifndef FS_NANDFS +#define FS_NANDFS 30 +#endif + static struct mkimg_alias bsd_aliases[] = { { ALIAS_FREEBSD_NANDFS, ALIAS_INT2TYPE(FS_NANDFS) }, { ALIAS_FREEBSD_SWAP, ALIAS_INT2TYPE(FS_SWAP) }, @@ -57,7 +62,7 @@ bsd_metadata(u_int where) } static int -bsd_write(int fd, lba_t imgsz, void *bootcode) +bsd_write(lba_t imgsz, void *bootcode) { u_char *buf, *p; struct disklabel *d; @@ -75,8 +80,12 @@ bsd_write(int fd, lba_t imgsz, void *boo } else memset(buf, 0, BBSIZE); - imgsz = ncyls * nheads * nsecs; - ftruncate(fd, imgsz * secsz); + imgsz = (lba_t)ncyls * nheads * nsecs; + error = image_set_size(imgsz); + if (error) { + free(buf); + return (error); + } d = (void *)(buf + secsz); le32enc(&d->d_magic, DISKMAGIC); @@ -107,11 +116,7 @@ bsd_write(int fd, lba_t imgsz, void *boo checksum ^= le16dec(p); le16enc(&d->d_checksum, checksum); - error = mkimg_seek(fd, 0); - if (error == 0) { - if (write(fd, buf, BBSIZE) != BBSIZE) - error = errno; - } + error = image_write(0, buf, BBSIZE / secsz); free(buf); return (error); } Modified: stable/10/usr.bin/mkimg/ebr.c ============================================================================== --- head/usr.bin/mkimg/ebr.c Sat Mar 29 19:03:10 2014 (r263918) +++ stable/10/usr.bin/mkimg/ebr.c Wed Jul 2 14:54:41 2014 (r268161) @@ -35,9 +35,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" +#ifndef DOSPTYP_FAT32 +#define DOSPTYP_FAT32 0x0b +#endif + static struct mkimg_alias ebr_aliases[] = { { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, @@ -63,7 +68,7 @@ ebr_chs(u_char *cyl, u_char *hd, u_char } static int -ebr_write(int fd, lba_t imgsz __unused, void *bootcode __unused) +ebr_write(lba_t imgsz __unused, void *bootcode __unused) { u_char *ebr; struct dos_partition *dp; @@ -100,11 +105,7 @@ ebr_write(int fd, lba_t imgsz __unused, le32enc(&dp->dp_size, next->size + nsecs); } - error = mkimg_seek(fd, block); - if (error == 0) { - if (write(fd, ebr, secsz) != (ssize_t)secsz) - error = errno; - } + error = image_write(block, ebr, 1); if (error) break; Copied: stable/10/usr.bin/mkimg/format.c (from r266176, head/usr.bin/mkimg/format.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/mkimg/format.c Wed Jul 2 14:54:41 2014 (r268161, copy of r266176, head/usr.bin/mkimg/format.c) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2014 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "image.h" +#include "format.h" +#include "mkimg.h" + +static struct mkimg_format *format; + +int +format_resize(lba_t end) +{ + + if (format == NULL) + return (ENOSYS); + return (format->resize(end)); +} + +int +format_select(const char *spec) +{ + struct mkimg_format *f, **iter; + + SET_FOREACH(iter, formats) { + f = *iter; + if (strcasecmp(spec, f->name) == 0) { + format = f; + return (0); + } + } + return (EINVAL); +} + +struct mkimg_format * +format_selected(void) +{ + + return (format); +} + +int +format_write(int fd) +{ + lba_t size; + int error; + + if (format == NULL) + return (ENOSYS); + size = image_get_size(); + error = format->resize(size); + if (!error) + error = format->write(fd); + return (error); +} Copied: stable/10/usr.bin/mkimg/format.h (from r266176, head/usr.bin/mkimg/format.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/mkimg/format.h Wed Jul 2 14:54:41 2014 (r268161, copy of r266176, head/usr.bin/mkimg/format.h) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2014 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MKIMG_FORMAT_H_ +#define _MKIMG_FORMAT_H_ + +#include + +struct mkimg_format { + const char *name; + const char *description; + int (*resize)(lba_t); + int (*write)(int); +}; + +SET_DECLARE(formats, struct mkimg_format); +#define FORMAT_DEFINE(nm) DATA_SET(formats, nm) + +int format_resize(lba_t); +int format_select(const char *); +struct mkimg_format *format_selected(void); +int format_write(int); + +#endif /* _MKIMG_FORMAT_H_ */ Modified: stable/10/usr.bin/mkimg/gpt.c ============================================================================== --- head/usr.bin/mkimg/gpt.c Sat Mar 29 19:03:10 2014 (r263918) +++ stable/10/usr.bin/mkimg/gpt.c Wed Jul 2 14:54:41 2014 (r268161) @@ -39,9 +39,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" +#ifndef GPT_ENT_TYPE_FREEBSD_NANDFS +#define GPT_ENT_TYPE_FREEBSD_NANDFS \ + {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} +#endif + static uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; static uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; @@ -123,6 +129,21 @@ crc32(const void *buf, size_t sz) return (crc ^ ~0U); } +static void +gpt_uuid_enc(void *buf, const uuid_t *uuid) +{ + uint8_t *p = buf; + int i; + + le32enc(p, uuid->time_low); + le16enc(p + 4, uuid->time_mid); + le16enc(p + 6, uuid->time_hi_and_version); + p[8] = uuid->clock_seq_hi_and_reserved; + p[9] = uuid->clock_seq_low; + for (i = 0; i < _UUID_NODE_LEN; i++) + p[10 + i] = uuid->node[i]; +} + static u_int gpt_tblsz(void) { @@ -146,20 +167,7 @@ gpt_metadata(u_int where) } static int -gpt_filewrite(int fd, lba_t blk, void *buf, ssize_t bufsz) -{ - int error; - - error = mkimg_seek(fd, blk); - if (error == 0) { - if (write(fd, buf, bufsz) != bufsz) - error = errno; - } - return (error); -} - -static int -gpt_write_pmbr(int fd, lba_t blks, void *bootcode) +gpt_write_pmbr(lba_t blks, void *bootcode) { u_char *pmbr; uint32_t secs; @@ -183,7 +191,7 @@ gpt_write_pmbr(int fd, lba_t blks, void le32enc(pmbr + DOSPARTOFF + 8, 1); le32enc(pmbr + DOSPARTOFF + 12, secs); le16enc(pmbr + DOSMAGICOFFSET, DOSMAGIC); - error = gpt_filewrite(fd, 0, pmbr, secsz); + error = image_write(0, pmbr, 1); free(pmbr); return (error); } @@ -202,9 +210,9 @@ gpt_mktbl(u_int tblsz) STAILQ_FOREACH(part, &partlist, link) { ent = tbl + part->index; - uuid_enc_le(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); + gpt_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); uuidgen(&uuid, 1); - uuid_enc_le(&ent->ent_uuid, &uuid); + gpt_uuid_enc(&ent->ent_uuid, &uuid); le64enc(&ent->ent_lba_start, part->block); le64enc(&ent->ent_lba_end, part->block + part->size - 1); if (part->label != NULL) { @@ -219,8 +227,7 @@ gpt_mktbl(u_int tblsz) } static int -gpt_write_hdr(int fd, struct gpt_hdr *hdr, uint64_t self, uint64_t alt, - uint64_t tbl) +gpt_write_hdr(struct gpt_hdr *hdr, uint64_t self, uint64_t alt, uint64_t tbl) { uint32_t crc; @@ -230,11 +237,11 @@ gpt_write_hdr(int fd, struct gpt_hdr *hd hdr->hdr_crc_self = 0; crc = crc32(hdr, offsetof(struct gpt_hdr, padding)); le64enc(&hdr->hdr_crc_self, crc); - return (gpt_filewrite(fd, self, hdr, secsz)); + return (image_write(self, hdr, 1)); } static int -gpt_write(int fd, lba_t imgsz, void *bootcode) +gpt_write(lba_t imgsz, void *bootcode) { uuid_t uuid; struct gpt_ent *tbl; @@ -244,7 +251,7 @@ gpt_write(int fd, lba_t imgsz, void *boo int error; /* PMBR */ - error = gpt_write_pmbr(fd, imgsz, bootcode); + error = gpt_write_pmbr(imgsz, bootcode); if (error) return (error); @@ -253,10 +260,10 @@ gpt_write(int fd, lba_t imgsz, void *boo tbl = gpt_mktbl(tblsz); if (tbl == NULL) return (errno); - error = gpt_filewrite(fd, 2, tbl, tblsz * secsz); + error = image_write(2, tbl, tblsz); if (error) goto out; - error = gpt_filewrite(fd, imgsz - (tblsz + 1), tbl, tblsz * secsz); + error = image_write(imgsz - (tblsz + 1), tbl, tblsz); if (error) goto out; @@ -273,14 +280,14 @@ gpt_write(int fd, lba_t imgsz, void *boo le64enc(&hdr->hdr_lba_start, 2 + tblsz); le64enc(&hdr->hdr_lba_end, imgsz - tblsz - 2); uuidgen(&uuid, 1); - uuid_enc_le(&hdr->hdr_uuid, &uuid); + gpt_uuid_enc(&hdr->hdr_uuid, &uuid); le32enc(&hdr->hdr_entries, nparts); le32enc(&hdr->hdr_entsz, sizeof(struct gpt_ent)); crc = crc32(tbl, nparts * sizeof(struct gpt_ent)); le32enc(&hdr->hdr_crc_table, crc); - error = gpt_write_hdr(fd, hdr, 1, imgsz - 1, 2); + error = gpt_write_hdr(hdr, 1, imgsz - 1, 2); if (!error) - error = gpt_write_hdr(fd, hdr, imgsz - 1, 1, imgsz - tblsz - 1); + error = gpt_write_hdr(hdr, imgsz - 1, 1, imgsz - tblsz - 1); free(hdr); out: Copied and modified: stable/10/usr.bin/mkimg/image.c (from r266176, head/usr.bin/mkimg/image.c) ============================================================================== --- head/usr.bin/mkimg/image.c Thu May 15 19:19:57 2014 (r266176, copy source) +++ stable/10/usr.bin/mkimg/image.c Wed Jul 2 14:54:41 2014 (r268161) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include @@ -38,7 +41,7 @@ __FBSDID("$FreeBSD$"); #define BUFFER_SIZE (1024*1024) -static char image_tmpfile[] = "/tmp/mkimg-XXXXXX"; +static char image_tmpfile[PATH_MAX]; static int image_fd = -1; static lba_t image_size; @@ -98,11 +101,11 @@ image_copyout(int fd) ofs = lseek(fd, 0L, SEEK_CUR); + if (lseek(image_fd, 0, SEEK_SET) != 0) + return (errno); buffer = malloc(BUFFER_SIZE); if (buffer == NULL) return (errno); - if (lseek(image_fd, 0, SEEK_SET) != 0) - return (errno); error = 0; while (1) { rdsz = read(image_fd, buffer, BUFFER_SIZE); @@ -119,8 +122,12 @@ image_copyout(int fd) } } free(buffer); + if (error) + return (error); ofs = lseek(fd, 0L, SEEK_CUR); - ftruncate(fd, ofs); + if (ofs == -1) + return (errno); + error = (ftruncate(fd, ofs) == -1) ? errno : 0; return (error); } @@ -157,9 +164,14 @@ image_write(lba_t blk, void *buf, ssize_ int image_init(void) { + const char *tmpdir; if (atexit(cleanup) == -1) return (errno); + if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0') + tmpdir = _PATH_TMP; + snprintf(image_tmpfile, sizeof(image_tmpfile), "%s/mkimg-XXXXXX", + tmpdir); image_fd = mkstemp(image_tmpfile); if (image_fd == -1) return (errno); Copied: stable/10/usr.bin/mkimg/image.h (from r266176, head/usr.bin/mkimg/image.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.bin/mkimg/image.h Wed Jul 2 14:54:41 2014 (r268161, copy of r266176, head/usr.bin/mkimg/image.h) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2014 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MKIMG_IMAGE_H_ +#define _MKIMG_IMAGE_H_ + +typedef int64_t lba_t; + +int image_copyin(lba_t blk, int fd, uint64_t *sizep); +int image_copyout(int fd); +lba_t image_get_size(void); +int image_init(void); +int image_set_size(lba_t blk); +int image_write(lba_t blk, void *buf, ssize_t len); + +#endif /* _MKIMG_IMAGE_H_ */ Modified: stable/10/usr.bin/mkimg/mbr.c ============================================================================== --- head/usr.bin/mkimg/mbr.c Sat Mar 29 19:03:10 2014 (r263918) +++ stable/10/usr.bin/mkimg/mbr.c Wed Jul 2 14:54:41 2014 (r268161) @@ -35,9 +35,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" +#ifndef DOSPTYP_FAT32 +#define DOSPTYP_FAT32 0x0b +#endif + static struct mkimg_alias mbr_aliases[] = { { ALIAS_EBR, ALIAS_INT2TYPE(DOSPTYP_EXT) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, @@ -64,7 +69,7 @@ mbr_chs(u_char *cyl, u_char *hd, u_char } static int -mbr_write(int fd, lba_t imgsz __unused, void *bootcode) +mbr_write(lba_t imgsz __unused, void *bootcode) { u_char *mbr; struct dos_partition *dpbase, *dp; @@ -92,11 +97,7 @@ mbr_write(int fd, lba_t imgsz __unused, le32enc(&dp->dp_start, part->block); le32enc(&dp->dp_size, part->size); } - error = mkimg_seek(fd, 0); - if (error == 0) { - if (write(fd, mbr, secsz) != (ssize_t)secsz) - error = errno; - } + error = image_write(0, mbr, 1); free(mbr); return (error); } Modified: stable/10/usr.bin/mkimg/mkimg.1 ============================================================================== --- head/usr.bin/mkimg/mkimg.1 Sat Mar 29 19:03:10 2014 (r263918) +++ stable/10/usr.bin/mkimg/mkimg.1 Wed Jul 2 14:54:41 2014 (r268161) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd July 2, 2014 .Dt MKIMG 1 .Os .Sh NAME @@ -37,6 +37,7 @@ .Op Fl S Ar secsz .Op Fl T Ar tracksz .Op Fl b Ar bootcode +.Op Fl f Ar format .Op Fl o Ar outfile .Op Fl v .Fl s Ar scheme @@ -56,6 +57,10 @@ The disk image is written to by default or the file specified with the .Ar outfile argument. +The image file is a raw disk image by default, but the format of the +image file can be specified with the +.Ar format +argument. .Pp The disk image can be made bootable by specifying the scheme-specific boot block contents with the @@ -106,10 +111,16 @@ option increases the level of output tha .Nm utility prints. .Pp -For a complete list of supported partitioning schemes or for a detailed -description of how to specify partitions, run the +For a complete list of supported partitioning schemes or supported output +format, or for a detailed description of how to specify partitions, run the .Nm utility without any arguments. +.Sh ENVIRONMENT +.Bl -tag -width "TMPDIR" -compact +.It Ev TMPDIR +Directory to put temporary files in; default is +.Pa /tmp . +.El .Sh EXAMPLES To create a bootable disk image that is partitioned using the GPT scheme and containing a root file system that was previously created using @@ -121,6 +132,14 @@ utility as follows: -p freebsd-ufs:=root-file-system.ufs -p freebsd-swap::1G \ -o gpt.img .Pp +The command line given above results in a raw image file. +This is because no output format was given. +To create a VMDK image for example, add the +.Fl f Ar vmdk +argument to the +.Nm +utility and name the output file accordingly. +.Pp A nested partitioning scheme is created by running the .Nm utility twice. @@ -154,8 +173,8 @@ In the following example the file system .Sh HISTORY The .Nm -utility appeared in -.Fx 11.0 +utility first appeared in +.Fx 10.1 . .Sh AUTHORS The .Nm Modified: stable/10/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Sat Mar 29 19:03:10 2014 (r263918) +++ stable/10/usr.bin/mkimg/mkimg.c Wed Jul 2 14:54:41 2014 (r268161) @@ -42,15 +42,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" +#include "format.h" #include "mkimg.h" #include "scheme.h" -#if !defined(SPARSE_WRITE) -#define sparse_write write -#endif - -#define BUFFER_SIZE (1024*1024) - struct partlisthead partlist = STAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; @@ -62,31 +58,18 @@ u_int nsecs = 1; u_int secsz = 512; u_int blksz = 0; -static int bcfd = -1; -static int outfd = 0; -static int tmpfd = -1; - -static char tmpfname[] = "/tmp/mkimg-XXXXXX"; - -static void -cleanup(void) -{ - - if (tmpfd != -1) - close(tmpfd); - unlink(tmpfname); -} - static void usage(const char *why) { - struct mkimg_scheme *s, **iter; + struct mkimg_format *f, **f_iter; + struct mkimg_scheme *s, **s_iter; warnx("error: %s", why); fprintf(stderr, "\nusage: %s \n", getprogname()); fprintf(stderr, " options:\n"); fprintf(stderr, "\t-b \t- file containing boot code\n"); + fprintf(stderr, "\t-f \n"); fprintf(stderr, "\t-o \t- file to write image into\n"); fprintf(stderr, "\t-p \n"); fprintf(stderr, "\t-s \n"); @@ -95,13 +78,19 @@ usage(const char *why) fprintf(stderr, "\t-S \t- logical sector size\n"); fprintf(stderr, "\t-T \t- number of tracks to simulate\n"); - fprintf(stderr, " schemes:\n"); - SET_FOREACH(iter, schemes) { - s = *iter; + fprintf(stderr, "\n formats:\n"); + SET_FOREACH(f_iter, formats) { + f = *f_iter; + fprintf(stderr, "\t%s\t- %s\n", f->name, f->description); + } + + fprintf(stderr, "\n schemes:\n"); + SET_FOREACH(s_iter, schemes) { + s = *s_iter; fprintf(stderr, "\t%s\t- %s\n", s->name, s->description); } - fprintf(stderr, " partition specification:\n"); + fprintf(stderr, "\n partition specification:\n"); fprintf(stderr, "\t[/]::\t- empty partition of given " "size\n"); fprintf(stderr, "\t[/]:=\t- partition content and size " @@ -228,14 +217,15 @@ parse_part(const char *spec) } #if defined(SPARSE_WRITE) -static ssize_t -sparse_write(int fd, const char *buf, size_t sz) +ssize_t +sparse_write(int fd, const void *ptr, size_t sz) { - const char *p; + const char *buf, *p; off_t ofs; size_t len; ssize_t wr, wrsz; + buf = ptr; wrsz = 0; p = memchr(buf, 0, sz); while (sz > 0) { @@ -268,53 +258,8 @@ sparse_write(int fd, const char *buf, si } #endif /* SPARSE_WRITE */ -static int -fdcopy(int src, int dst, uint64_t *count) -{ - char *buffer; - off_t ofs; - ssize_t rdsz, wrsz; - - /* A return value of -1 means that we can't write a sparse file. */ - ofs = lseek(dst, 0L, SEEK_CUR); - - if (count != NULL) - *count = 0; - - buffer = malloc(BUFFER_SIZE); - if (buffer == NULL) - return (errno); - while (1) { - rdsz = read(src, buffer, BUFFER_SIZE); - if (rdsz <= 0) { - free(buffer); - return ((rdsz < 0) ? errno : 0); - } - if (count != NULL) - *count += rdsz; - wrsz = (ofs == -1) ? - write(dst, buffer, rdsz) : - sparse_write(dst, buffer, rdsz); - if (wrsz < 0) - break; - } - free(buffer); - return (errno); -} - -int -mkimg_seek(int fd, lba_t blk) -{ - off_t off; - - off = blk * secsz; - if (lseek(fd, off, SEEK_SET) != off) - return (errno); - return (0); -} - static void -mkimg(int bfd) +mkimg(void) { FILE *fp; struct part *part; @@ -322,10 +267,6 @@ mkimg(int bfd) off_t bytesize; int error, fd; - error = scheme_bootcode(bfd); - if (error) - errc(EX_DATAERR, error, "boot code"); - /* First check partition information */ STAILQ_FOREACH(part, &partlist, link) { error = scheme_check_part(part); @@ -340,7 +281,6 @@ mkimg(int bfd) fprintf(stderr, "partition %d: starting block %llu " "... ", part->index + 1, (long long)block); part->block = block; - error = mkimg_seek(tmpfd, block); switch (part->kind) { case PART_KIND_SIZE: if (expand_number(part->contents, &bytesize) == -1) @@ -349,7 +289,7 @@ mkimg(int bfd) case PART_KIND_FILE: fd = open(part->contents, O_RDONLY, 0); if (fd != -1) { - error = fdcopy(fd, tmpfd, &bytesize); + error = image_copyin(block, fd, &bytesize); close(fd); } else error = errno; @@ -357,7 +297,8 @@ mkimg(int bfd) case PART_KIND_PIPE: fp = popen(part->contents, "r"); if (fp != NULL) { - error = fdcopy(fileno(fp), tmpfd, &bytesize); + fd = fileno(fp); + error = image_copyin(block, fd, &bytesize); pclose(fp); } else error = errno; @@ -376,15 +317,27 @@ mkimg(int bfd) } block = scheme_metadata(SCHEME_META_IMG_END, block); - error = (scheme_write(tmpfd, block)); + error = image_set_size(block); + if (!error) + error = format_resize(block); + if (error) + errc(EX_IOERR, error, "image sizing"); + block = image_get_size(); + ncyls = block / (nsecs * nheads); + error = (scheme_write(block)); + if (error) + errc(EX_IOERR, error, "writing metadata"); } int main(int argc, char *argv[]) { + int bcfd, outfd; int c, error; - while ((c = getopt(argc, argv, "b:o:p:s:vH:P:S:T:")) != -1) { + bcfd = -1; + outfd = 1; /* Write to stdout by default */ + while ((c = getopt(argc, argv, "b:f:o:p:s:vH:P:S:T:")) != -1) { switch (c) { case 'b': /* BOOT CODE */ if (bcfd != -1) @@ -393,8 +346,15 @@ main(int argc, char *argv[]) if (bcfd == -1) err(EX_UNAVAILABLE, "%s", optarg); break; + case 'f': /* OUTPUT FORMAT */ + if (format_selected() != NULL) + usage("multiple formats given"); + error = format_select(optarg); + if (error) + errc(EX_DATAERR, error, "format"); + break; case 'o': /* OUTPUT FILE */ - if (outfd != 0) + if (outfd != 1) usage("multiple output files given"); outfd = open(optarg, O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); @@ -467,35 +427,43 @@ main(int argc, char *argv[]) errx(EX_DATAERR, "%d partitions supported; %d given", scheme_max_parts(), nparts); - if (outfd == 0) { - if (atexit(cleanup) == -1) - err(EX_OSERR, "cannot register cleanup function"); - outfd = 1; - tmpfd = mkstemp(tmpfname); - if (tmpfd == -1) - err(EX_OSERR, "cannot create temporary file"); - } else - tmpfd = outfd; + if (format_selected() == NULL) + format_select("raw"); + + if (bcfd != -1) { + error = scheme_bootcode(bcfd); + close(bcfd); + if (error) + errc(EX_DATAERR, error, "boot code"); + } if (verbose) { fprintf(stderr, "Logical sector size: %u\n", secsz); fprintf(stderr, "Physical block size: %u\n", blksz); fprintf(stderr, "Sectors per track: %u\n", nsecs); fprintf(stderr, "Number of heads: %u\n", nheads); + fputc('\n', stderr); + fprintf(stderr, "Partitioning scheme: %s\n", + scheme_selected()->name); + fprintf(stderr, "Output file format: %s\n", + format_selected()->name); + fputc('\n', stderr); } - mkimg(bcfd); + error = image_init(); + if (error) + errc(EX_OSERR, error, "cannot initialize"); - if (verbose) - fprintf(stderr, "Number of cylinders: %u\n", ncyls); + mkimg(); - if (tmpfd != outfd) { - error = mkimg_seek(tmpfd, 0); - if (error == 0) - error = fdcopy(tmpfd, outfd, NULL); - if (error) - errc(EX_IOERR, error, "writing to stdout"); + if (verbose) { + fputc('\n', stderr); + fprintf(stderr, "Number of cylinders: %u\n", ncyls); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 17:32:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EF2E14DC; Wed, 2 Jul 2014 17:32: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 D0F2C2DBA; Wed, 2 Jul 2014 17:32:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62HWhtI087238; Wed, 2 Jul 2014 17:32:43 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62HWhYw087237; Wed, 2 Jul 2014 17:32:43 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201407021732.s62HWhYw087237@svn.freebsd.org> From: Don Lewis Date: Wed, 2 Jul 2014 17:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268167 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 17:32:44 -0000 Author: truckman Date: Wed Jul 2 17:32:43 2014 New Revision: 268167 URL: http://svnweb.freebsd.org/changeset/base/268167 Log: MFC r266814 Initialize r_flags the same way in all cases using a sanitized copy of flags that has several bits cleared. The RF_WANTED and RF_FIRSTSHARE bits are invalid in this context, and we want to defer setting RF_ACTIVE in r_flags until later. This should make rman_get_flags() return the correct answer in all cases. Add a KASSERT() to catch callers which incorrectly pass the RF_WANTED or RF_FIRSTSHARE flags. Do a strict equality check on the share type bits of flags. In particular, do an equality check on RF_PREFETCHABLE. The previous code would allow one type of mismatch of RF_PREFETCHABLE but disallow the other type of mismatch. Also, ignore the the RF_ALIGNMENT_MASK bits since alignment validity should be handled by the amask check. This field contains an integer value, but previous code did a strange bitwise comparison on it. Leave the original value of flags unmolested as a minor debug aid. Change the start+amask overflow check to a KASSERT() since it is just meant to catch a highly unlikely programming error in the caller. Reviewed by: jhb Modified: stable/10/sys/kern/subr_rman.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_rman.c ============================================================================== --- stable/10/sys/kern/subr_rman.c Wed Jul 2 17:25:28 2014 (r268166) +++ stable/10/sys/kern/subr_rman.c Wed Jul 2 17:32:43 2014 (r268167) @@ -435,12 +435,14 @@ rman_adjust_resource(struct resource *rr return (0); } +#define SHARE_TYPE(f) (f & (RF_SHAREABLE | RF_TIMESHARE | RF_PREFETCHABLE)) + struct resource * rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end, u_long count, u_long bound, u_int flags, struct device *dev) { - u_int want_activate; + u_int new_rflags; struct resource_i *r, *s, *rv; u_long rstart, rend, amask, bmask; @@ -450,8 +452,10 @@ rman_reserve_resource_bound(struct rman "length %#lx, flags %u, device %s\n", rm->rm_descr, start, end, count, flags, dev == NULL ? "" : device_get_nameunit(dev))); - want_activate = (flags & RF_ACTIVE); - flags &= ~RF_ACTIVE; + KASSERT((flags & (RF_WANTED | RF_FIRSTSHARE)) == 0, + ("invalid flags %#x", flags)); + new_rflags = (flags & ~(RF_ACTIVE | RF_WANTED | RF_FIRSTSHARE)) | + RF_ALLOCATED; mtx_lock(rm->rm_mtx); @@ -466,10 +470,8 @@ rman_reserve_resource_bound(struct rman } amask = (1ul << RF_ALIGNMENT(flags)) - 1; - if (start > ULONG_MAX - amask) { - DPRINTF(("start+amask would wrap around\n")); - goto out; - } + KASSERT(start <= ULONG_MAX - amask, + ("start (%#lx) + amask (%#lx) would wrap around", start, amask)); /* If bound is 0, bmask will also be 0 */ bmask = ~(bound - 1); @@ -522,7 +524,7 @@ rman_reserve_resource_bound(struct rman if ((s->r_end - s->r_start + 1) == count) { DPRINTF(("candidate region is entire chunk\n")); rv = s; - rv->r_flags |= RF_ALLOCATED | flags; + rv->r_flags = new_rflags; rv->r_dev = dev; goto out; } @@ -542,7 +544,7 @@ rman_reserve_resource_bound(struct rman goto out; rv->r_start = rstart; rv->r_end = rstart + count - 1; - rv->r_flags = flags | RF_ALLOCATED; + rv->r_flags = new_rflags; rv->r_dev = dev; rv->r_rm = rm; @@ -603,7 +605,7 @@ rman_reserve_resource_bound(struct rman goto out; for (s = r; s && s->r_end <= end; s = TAILQ_NEXT(s, r_link)) { - if ((s->r_flags & flags) == flags && + if (SHARE_TYPE(s->r_flags) == SHARE_TYPE(flags) && s->r_start >= start && (s->r_end - s->r_start + 1) == count && (s->r_start & amask) == 0 && @@ -613,8 +615,7 @@ rman_reserve_resource_bound(struct rman goto out; rv->r_start = s->r_start; rv->r_end = s->r_end; - rv->r_flags = s->r_flags & - (RF_ALLOCATED | RF_SHAREABLE | RF_TIMESHARE); + rv->r_flags = new_rflags; rv->r_dev = dev; rv->r_rm = rm; if (s->r_sharehead == NULL) { @@ -641,13 +642,12 @@ rman_reserve_resource_bound(struct rman */ out: /* - * If the user specified RF_ACTIVE in the initial flags, - * which is reflected in `want_activate', we attempt to atomically + * If the user specified RF_ACTIVE in flags, we attempt to atomically * activate the resource. If this fails, we release the resource * and indicate overall failure. (This behavior probably doesn't * make sense for RF_TIMESHARE-type resources.) */ - if (rv && want_activate) { + if (rv && (flags & RF_ACTIVE) != 0) { struct resource_i *whohas; if (int_rman_activate_resource(rm, rv, &whohas)) { int_rman_release_resource(rm, rv); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 19:25:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8FAE958F; Wed, 2 Jul 2014 19: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 7BF88288E; Wed, 2 Jul 2014 19: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 s62JPQh3041723; Wed, 2 Jul 2014 19:25:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62JPQee041722; Wed, 2 Jul 2014 19:25:26 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201407021925.s62JPQee041722@svn.freebsd.org> From: Devin Teske Date: Wed, 2 Jul 2014 19:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268170 - stable/10/usr.sbin/bsdconfig/share/packages X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 19:25:26 -0000 Author: dteske Date: Wed Jul 2 19:25:25 2014 New Revision: 268170 URL: http://svnweb.freebsd.org/changeset/base/268170 Log: MFC r267680: Fix a code typo that prevented mkdir from firing (unnoticed usually because another part of the code succeeded in making the same directory). Modified: stable/10/usr.sbin/bsdconfig/share/packages/index.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/index.subr Wed Jul 2 19:22:12 2014 (r268169) +++ stable/10/usr.sbin/bsdconfig/share/packages/index.subr Wed Jul 2 19:25:25 2014 (r268170) @@ -258,7 +258,7 @@ f_index_initialize() # Finally, move the temporary file into place case "$PACKAGES_INDEX_CACHEFILE" in - */*) f_eval_catch -d $funcname mkdir \ + */*) f_eval_catch -d $__funcname mkdir \ 'mkdir -p "%s"' "${PACKAGES_INDEX_CACHEFILE%/*}" esac f_eval_catch -d $__funcname mv 'mv -f "%s" "%s"' \ From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 21:53:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 381FF758; Wed, 2 Jul 2014 21:53: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 24E992616; Wed, 2 Jul 2014 21:53: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 s62LrZKn014319; Wed, 2 Jul 2014 21:53:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62LrZXB014318; Wed, 2 Jul 2014 21:53:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022153.s62LrZXB014318@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 21:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268181 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 21:53:35 -0000 Author: marcel Date: Wed Jul 2 21:53:34 2014 New Revision: 268181 URL: http://svnweb.freebsd.org/changeset/base/268181 Log: MFC 257475: Respect the kern.smp.disabled tunable. Modified: stable/10/sys/ia64/ia64/mp_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/mp_machdep.c Wed Jul 2 21:28:50 2014 (r268180) +++ stable/10/sys/ia64/ia64/mp_machdep.c Wed Jul 2 21:53:34 2014 (r268181) @@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); extern uint64_t bdata[]; +extern int smp_disabled; + MALLOC_DEFINE(M_SMP, "SMP", "SMP related allocations"); void ia64_ap_startup(void); @@ -292,6 +294,9 @@ cpu_mp_add(u_int acpi_id, u_int id, u_in void *dpcpu; u_int cpuid, sapic_id; + if (smp_disabled) + return; + sapic_id = SAPIC_ID_SET(id, eid); cpuid = (IA64_LID_GET_SAPIC_ID(ia64_get_lid()) == sapic_id) ? 0 : smp_cpus++; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 22:06:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D5BE1EFE; Wed, 2 Jul 2014 22:06: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 AA6B6274F; Wed, 2 Jul 2014 22:06: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 s62M6WUJ021817; Wed, 2 Jul 2014 22:06:32 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62M6WAm021812; Wed, 2 Jul 2014 22:06:32 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022206.s62M6WAm021812@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 22:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268184 - in stable/10/sys/ia64: ia64 include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 22:06:32 -0000 Author: marcel Date: Wed Jul 2 22:06:31 2014 New Revision: 268184 URL: http://svnweb.freebsd.org/changeset/base/268184 Log: MFC r257477: Purge the translation cache of APs before we unleash them. Modified: stable/10/sys/ia64/ia64/mp_machdep.c stable/10/sys/ia64/ia64/pmap.c stable/10/sys/ia64/include/pmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/mp_machdep.c Wed Jul 2 22:04:14 2014 (r268183) +++ stable/10/sys/ia64/ia64/mp_machdep.c Wed Jul 2 22:06:31 2014 (r268184) @@ -240,6 +240,8 @@ ia64_ap_startup(void) KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread")); PCPU_SET(curthread, PCPU_GET(idlethread)); + pmap_invalidate_all(); + atomic_add_int(&ia64_ap_state.as_awake, 1); while (!smp_started) cpu_spinwait(); Modified: stable/10/sys/ia64/ia64/pmap.c ============================================================================== --- stable/10/sys/ia64/ia64/pmap.c Wed Jul 2 22:04:14 2014 (r268183) +++ stable/10/sys/ia64/ia64/pmap.c Wed Jul 2 22:06:31 2014 (r268184) @@ -262,7 +262,6 @@ static vm_page_t pmap_pv_reclaim(pmap_t static void pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot); static void pmap_free_pte(struct ia64_lpte *pte, vm_offset_t va); -static void pmap_invalidate_all(void); static int pmap_remove_pte(pmap_t pmap, struct ia64_lpte *pte, vm_offset_t va, pv_entry_t pv, int freepte); static int pmap_remove_vhpt(vm_offset_t va); @@ -537,13 +536,12 @@ pmap_invalidate_page(vm_offset_t va) critical_exit(); } -static void -pmap_invalidate_all_1(void *arg) +void +pmap_invalidate_all(void) { uint64_t addr; int i, j; - critical_enter(); addr = pmap_ptc_e_base; for (i = 0; i < pmap_ptc_e_count1; i++) { for (j = 0; j < pmap_ptc_e_count2; j++) { @@ -552,20 +550,7 @@ pmap_invalidate_all_1(void *arg) } addr += pmap_ptc_e_stride1; } - critical_exit(); -} - -static void -pmap_invalidate_all(void) -{ - -#ifdef SMP - if (mp_ncpus > 1) { - smp_rendezvous(NULL, pmap_invalidate_all_1, NULL, NULL); - return; - } -#endif - pmap_invalidate_all_1(NULL); + ia64_srlz_i(); } static uint32_t Modified: stable/10/sys/ia64/include/pmap.h ============================================================================== --- stable/10/sys/ia64/include/pmap.h Wed Jul 2 22:04:14 2014 (r268183) +++ stable/10/sys/ia64/include/pmap.h Wed Jul 2 22:06:31 2014 (r268184) @@ -122,6 +122,7 @@ extern int pmap_vhpt_log2size; vm_offset_t pmap_alloc_vhpt(void); void pmap_bootstrap(void); +void pmap_invalidate_all(void); void pmap_kenter(vm_offset_t va, vm_offset_t pa); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 22:19:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CA07221B; Wed, 2 Jul 2014 22:19: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 B6B3A287F; Wed, 2 Jul 2014 22:19: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 s62MJxFQ028768; Wed, 2 Jul 2014 22:19:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62MJxX9028767; Wed, 2 Jul 2014 22:19:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022219.s62MJxX9028767@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 22:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268189 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 22:19:59 -0000 Author: marcel Date: Wed Jul 2 22:19:59 2014 New Revision: 268189 URL: http://svnweb.freebsd.org/changeset/base/268189 Log: MFC r257484: Change PAL_PTCE_INFO related variables. Modified: stable/10/sys/ia64/ia64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/pmap.c ============================================================================== --- stable/10/sys/ia64/ia64/pmap.c Wed Jul 2 22:17:27 2014 (r268188) +++ stable/10/sys/ia64/ia64/pmap.c Wed Jul 2 22:19:59 2014 (r268189) @@ -195,12 +195,12 @@ extern struct ia64_lpte ***ia64_kptdir; vm_offset_t kernel_vm_end; -/* Values for ptc.e. XXX values for SKI. */ -static uint64_t pmap_ptc_e_base = 0x100000000; -static uint64_t pmap_ptc_e_count1 = 3; -static uint64_t pmap_ptc_e_count2 = 2; -static uint64_t pmap_ptc_e_stride1 = 0x2000; -static uint64_t pmap_ptc_e_stride2 = 0x100000000; +/* Defaults for ptc.e. */ +static uint64_t pmap_ptc_e_base = 0; +static uint32_t pmap_ptc_e_count1 = 1; +static uint32_t pmap_ptc_e_count2 = 1; +static uint32_t pmap_ptc_e_stride1 = 0; +static uint32_t pmap_ptc_e_stride2 = 0; struct mtx pmap_ptc_mutex; @@ -324,12 +324,12 @@ pmap_bootstrap() panic("Can't configure ptc.e parameters"); pmap_ptc_e_base = res.pal_result[0]; pmap_ptc_e_count1 = res.pal_result[1] >> 32; - pmap_ptc_e_count2 = res.pal_result[1] & ((1L<<32) - 1); + pmap_ptc_e_count2 = res.pal_result[1]; pmap_ptc_e_stride1 = res.pal_result[2] >> 32; - pmap_ptc_e_stride2 = res.pal_result[2] & ((1L<<32) - 1); + pmap_ptc_e_stride2 = res.pal_result[2]; if (bootverbose) - printf("ptc.e base=0x%lx, count1=%ld, count2=%ld, " - "stride1=0x%lx, stride2=0x%lx\n", + printf("ptc.e base=0x%lx, count1=%u, count2=%u, " + "stride1=0x%x, stride2=0x%x\n", pmap_ptc_e_base, pmap_ptc_e_count1, pmap_ptc_e_count2, From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 23:05:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D6659351; Wed, 2 Jul 2014 23:05: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 B078E2C69; Wed, 2 Jul 2014 23:05: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 s62N5vl3051745; Wed, 2 Jul 2014 23:05:57 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62N5vQ1051744; Wed, 2 Jul 2014 23:05:57 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022305.s62N5vQ1051744@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 23:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268192 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 23:05:57 -0000 Author: marcel Date: Wed Jul 2 23:05:57 2014 New Revision: 268192 URL: http://svnweb.freebsd.org/changeset/base/268192 Log: MFC r259959 & r260009: Add prototypical support for minidumps. Modified: stable/10/sys/ia64/ia64/dump_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/dump_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/dump_machdep.c Wed Jul 2 22:34:06 2014 (r268191) +++ stable/10/sys/ia64/ia64/dump_machdep.c Wed Jul 2 23:05:57 2014 (r268192) @@ -56,7 +56,10 @@ CTASSERT(sizeof(struct kerneldumpheader) #define MD_ALIGN(x) (((off_t)(x) + EFI_PAGE_MASK) & ~EFI_PAGE_MASK) #define DEV_ALIGN(x) (((off_t)(x) + (DEV_BSIZE-1)) & ~(DEV_BSIZE-1)) -typedef int callback_t(struct efi_md*, int, void*); +static int minidump = 0; +TUNABLE_INT("debug.minidump", &minidump); +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &minidump, 0, + "Enable mini crash dumps"); static struct kerneldumpheader kdh; static off_t dumplo, fileofs; @@ -83,7 +86,7 @@ buf_write(struct dumperinfo *di, char *p error = dump_write(di, buffer, 0, dumplo, DEV_BSIZE); if (error) - return error; + return (error); dumplo += DEV_BSIZE; fragsz = 0; } @@ -106,8 +109,14 @@ buf_flush(struct dumperinfo *di) return (error); } +/* + * Physical dump support + */ + +typedef int phys_callback_t(struct efi_md*, int, void*); + static int -cb_dumpdata(struct efi_md *mdp, int seqnr, void *arg) +phys_cb_dumpdata(struct efi_md *mdp, int seqnr, void *arg) { struct dumperinfo *di = (struct dumperinfo*)arg; vm_offset_t pa; @@ -153,7 +162,7 @@ cb_dumpdata(struct efi_md *mdp, int seqn } static int -cb_dumphdr(struct efi_md *mdp, int seqnr, void *arg) +phys_cb_dumphdr(struct efi_md *mdp, int seqnr, void *arg) { struct dumperinfo *di = (struct dumperinfo*)arg; Elf64_Phdr phdr; @@ -175,7 +184,7 @@ cb_dumphdr(struct efi_md *mdp, int seqnr } static int -cb_size(struct efi_md *mdp, int seqnr, void *arg) +phys_cb_size(struct efi_md *mdp, int seqnr, void *arg) { uint64_t *sz = (uint64_t*)arg; @@ -184,7 +193,7 @@ cb_size(struct efi_md *mdp, int seqnr, v } static int -foreach_chunk(callback_t cb, void *arg) +phys_foreach(phys_callback_t cb, void *arg) { struct efi_md *mdp; int error, seqnr; @@ -206,6 +215,117 @@ foreach_chunk(callback_t cb, void *arg) return (seqnr); } +/* + * Virtual dump (aka minidump) support + */ + +typedef int virt_callback_t(vm_offset_t, vm_size_t, int, void*); + +static int +virt_cb_size(vm_offset_t va, vm_size_t sz, int seqnr, void *arg) +{ + uint64_t *dumpsize = (uint64_t *)arg; + + *dumpsize += sz; + return (0); +} + +static int +virt_cb_dumphdr(vm_offset_t va, vm_size_t sz, int seqnr, void *arg) +{ + struct dumperinfo *di = (struct dumperinfo *)arg; + Elf64_Phdr phdr; + int error; + + bzero(&phdr, sizeof(phdr)); + phdr.p_type = PT_LOAD; + phdr.p_flags = PF_R; /* XXX */ + phdr.p_offset = fileofs; + phdr.p_vaddr = va; + phdr.p_paddr = ~0UL; + phdr.p_filesz = sz; + phdr.p_memsz = sz; + phdr.p_align = PAGE_SIZE; + + error = buf_write(di, (char*)&phdr, sizeof(phdr)); + fileofs += phdr.p_filesz; + return (error); +} + +static int +virt_cb_dumpdata(vm_offset_t va, vm_size_t sz, int seqnr, void *arg) +{ + struct dumperinfo *di = (struct dumperinfo *)arg; + size_t counter, iosz; + int c, error, twiddle; + + error = 0; /* catch case in which pgs is 0 */ + counter = 0; /* Update twiddle every 16MB */ + twiddle = 0; + + printf(" chunk %d: %ld pages ", seqnr, atop(sz)); + + while (sz) { + iosz = (sz > DFLTPHYS) ? DFLTPHYS : sz; + counter += iosz; + if (counter >> 24) { + printf("%c\b", "|/-\\"[twiddle++ & 3]); + counter &= (1<<24) - 1; + } +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif + error = dump_write(di, (void*)va, 0, dumplo, iosz); + if (error) + break; + dumplo += iosz; + sz -= iosz; + va += iosz; + + /* Check for user abort. */ + c = cncheckc(); + if (c == 0x03) + return (ECANCELED); + if (c != -1) + printf("(CTRL-C to abort) "); + } + printf("... %s\n", (error) ? "fail" : "ok"); + return (error); +} + +static int +virt_foreach(virt_callback_t cb, void *arg) +{ + vm_offset_t va; + vm_size_t sz; + int error, seqnr; + + seqnr = 0; + while (1) { + switch (seqnr) { + case 0: + va = IA64_PBVM_BASE; + sz = round_page(bootinfo->bi_kernend) - va; + break; + default: + va = 0; + sz = 0; + break; + } + if (va == 0 && sz == 0) + break; + error = (*cb)(va, sz, seqnr, arg); + if (error) + return (-error); + seqnr++; + } + return (seqnr); +} + +/* + * main entry point. + */ + void dumpsys(struct dumperinfo *di) { @@ -213,7 +333,7 @@ dumpsys(struct dumperinfo *di) uint64_t dumpsize; off_t hdrgap; size_t hdrsz; - int error; + int error, status; bzero(&ehdr, sizeof(ehdr)); ehdr.e_ident[EI_MAG0] = ELFMAG0; @@ -230,18 +350,25 @@ dumpsys(struct dumperinfo *di) ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ ehdr.e_type = ET_CORE; ehdr.e_machine = EM_IA_64; - ehdr.e_entry = ia64_tpa((uintptr_t)bootinfo); + ehdr.e_entry = (minidump) ? (uintptr_t)bootinfo : + ia64_tpa((uintptr_t)bootinfo); ehdr.e_phoff = sizeof(ehdr); - ehdr.e_flags = EF_IA_64_ABSOLUTE; /* XXX misuse? */ + ehdr.e_flags = (minidump) ? 0 : EF_IA_64_ABSOLUTE; /* XXX misuse? */ ehdr.e_ehsize = sizeof(ehdr); ehdr.e_phentsize = sizeof(Elf64_Phdr); ehdr.e_shentsize = sizeof(Elf64_Shdr); /* Calculate dump size. */ dumpsize = 0L; - ehdr.e_phnum = foreach_chunk(cb_size, &dumpsize); + status = (minidump) ? virt_foreach(virt_cb_size, &dumpsize) : + phys_foreach(phys_cb_size, &dumpsize); + if (status < 0) { + error = -status; + goto fail; + } + ehdr.e_phnum = status; hdrsz = ehdr.e_phoff + ehdr.e_phnum * ehdr.e_phentsize; - fileofs = MD_ALIGN(hdrsz); + fileofs = (minidump) ? round_page(hdrsz) : MD_ALIGN(hdrsz); dumpsize += fileofs; hdrgap = fileofs - DEV_ALIGN(hdrsz); @@ -270,24 +397,30 @@ dumpsys(struct dumperinfo *di) goto fail; /* Dump program headers */ - error = foreach_chunk(cb_dumphdr, di); - if (error < 0) + status = (minidump) ? virt_foreach(virt_cb_dumphdr, di) : + phys_foreach(phys_cb_dumphdr, di); + if (status < 0) { + error = -status; goto fail; + } buf_flush(di); /* * All headers are written using blocked I/O, so we know the - * current offset is (still) block aligned. Skip the alignement + * current offset is (still) block aligned. Skip the alignment * in the file to have the segment contents aligned at page - * boundary. We cannot use MD_ALIGN on dumplo, because we don't - * care and may very well be unaligned within the dump device. + * boundary. For physical dumps, it's the EFI page size (= 4K). + * For minidumps it's the kernel's page size (= 8K). */ dumplo += hdrgap; /* Dump memory chunks (updates dumplo) */ - error = foreach_chunk(cb_dumpdata, di); - if (error < 0) + status = (minidump) ? virt_foreach(virt_cb_dumpdata, di) : + phys_foreach(phys_cb_dumpdata, di); + if (status < 0) { + error = -status; goto fail; + } /* Dump trailer */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); @@ -300,9 +433,6 @@ dumpsys(struct dumperinfo *di) return; fail: - if (error < 0) - error = -error; - if (error == ECANCELED) printf("\nDump aborted\n"); else From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 23:12:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E86A2A79; Wed, 2 Jul 2014 23:12: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 C93922D42; Wed, 2 Jul 2014 23:12: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 s62NCusY056508; Wed, 2 Jul 2014 23:12:56 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62NCun6056507; Wed, 2 Jul 2014 23:12:56 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022312.s62NCun6056507@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 23:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268194 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 23:12:57 -0000 Author: marcel Date: Wed Jul 2 23:12:56 2014 New Revision: 268194 URL: http://svnweb.freebsd.org/changeset/base/268194 Log: MFC r262726: When reading physical memory, make sure to access it using the right memory attributes. Modified: stable/10/sys/ia64/ia64/mem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/mem.c ============================================================================== --- stable/10/sys/ia64/ia64/mem.c Wed Jul 2 23:07:01 2014 (r268193) +++ stable/10/sys/ia64/ia64/mem.c Wed Jul 2 23:12:56 2014 (r268194) @@ -47,19 +47,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include -#include -#include -#include -#include -#include #include #include - -#include -#include +#include #include #include @@ -69,10 +61,25 @@ __FBSDID("$FreeBSD$"); struct mem_range_softc mem_range_softc; -static __inline int -ia64_pa_access(vm_offset_t pa) +static int +mem_phys2virt(vm_offset_t offset, int prot, void **ptr, u_long *limit) { - return (VM_PROT_READ|VM_PROT_WRITE); + struct efi_md *md; + + if (prot & ~(VM_PROT_READ | VM_PROT_WRITE)) + return (EPERM); + + md = efi_md_find(offset); + if (md == NULL) + return (EFAULT); + + if (md->md_type == EFI_MD_TYPE_BAD) + return (EIO); + + *ptr = (void *)((md->md_attr & EFI_MD_ATTR_WB) + ? IA64_PHYS_TO_RR7(offset) : IA64_PHYS_TO_RR6(offset)); + *limit = (md->md_pages * EFI_PAGE_SIZE) - (offset - md->md_phys); + return (0); } /* ARGSUSED */ @@ -80,10 +87,15 @@ int memrw(struct cdev *dev, struct uio *uio, int flags) { struct iovec *iov; - vm_offset_t addr, eaddr, o, v; - int c, error, rw; + off_t ofs; + vm_offset_t addr; + void *ptr; + u_long limit; + int count, error, phys, rw; error = 0; + rw = (uio->uio_rw == UIO_READ) ? VM_PROT_READ : VM_PROT_WRITE; + while (uio->uio_resid > 0 && !error) { iov = uio->uio_iov; if (iov->iov_len == 0) { @@ -94,51 +106,41 @@ memrw(struct cdev *dev, struct uio *uio, continue; } - if (dev2unit(dev) == CDEV_MINOR_MEM) { - v = uio->uio_offset; -kmemphys: - /* Allow reads only in RAM. */ - rw = (uio->uio_rw == UIO_READ) - ? VM_PROT_READ : VM_PROT_WRITE; - if ((ia64_pa_access(v) & rw) != rw) { - error = EFAULT; - c = 0; - break; - } + ofs = uio->uio_offset; - o = uio->uio_offset & PAGE_MASK; - c = min(uio->uio_resid, (int)(PAGE_SIZE - o)); - error = uiomove((caddr_t)IA64_PHYS_TO_RR7(v), c, uio); - continue; + phys = (dev2unit(dev) == CDEV_MINOR_MEM) ? 1 : 0; + if (phys == 0 && ofs >= IA64_RR_BASE(6)) { + ofs = IA64_RR_MASK(ofs); + phys++; } - else if (dev2unit(dev) == CDEV_MINOR_KMEM) { - v = uio->uio_offset; - - if (v >= IA64_RR_BASE(6)) { - v = IA64_RR_MASK(v); - goto kmemphys; - } - c = min(iov->iov_len, MAXPHYS); + if (phys) { + error = mem_phys2virt(ofs, rw, &ptr, &limit); + if (error) + return (error); + + count = min(uio->uio_resid, limit); + error = uiomove(ptr, count, uio); + } else { + ptr = (void *)ofs; + count = iov->iov_len; /* * Make sure that all of the pages are currently * resident so that we don't create any zero-fill * pages. */ - addr = trunc_page(v); - eaddr = round_page(v + c); + limit = round_page(ofs + count); + addr = trunc_page(ofs); if (addr < VM_MAXUSER_ADDRESS) - return (EFAULT); - for (; addr < eaddr; addr += PAGE_SIZE) { + return (EINVAL); + for (; addr < limit; addr += PAGE_SIZE) { if (pmap_kextract(addr) == 0) return (EFAULT); } - if (!kernacc((caddr_t)v, c, (uio->uio_rw == UIO_READ) - ? VM_PROT_READ : VM_PROT_WRITE)) + if (!kernacc(ptr, count, rw)) return (EFAULT); - error = uiomove((caddr_t)v, c, uio); - continue; + error = uiomove(ptr, count, uio); } /* else panic! */ } @@ -153,6 +155,10 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) { + void *ptr; + u_long limit; + int error; + /* * /dev/mem is the only one that makes sense through this * interface. For /dev/kmem any physaddr we return here @@ -160,13 +166,14 @@ memmmap(struct cdev *dev, vm_ooffset_t o * a later time. */ if (dev2unit(dev) != CDEV_MINOR_MEM) - return (-1); + return (ENXIO); - /* - * Allow access only in RAM. - */ - if ((prot & ia64_pa_access(atop((vm_offset_t)offset))) != prot) - return (-1); - *paddr = IA64_PHYS_TO_RR7(offset); + error = mem_phys2virt(offset, prot, &ptr, &limit); + if (error) + return (error); + + *paddr = offset; + *memattr = ((uintptr_t)ptr >= IA64_RR_BASE(7)) ? + VM_MEMATTR_WRITE_BACK : VM_MEMATTR_UNCACHEABLE; return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 23:23:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 696ACD82; Wed, 2 Jul 2014 23:23: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 3DE332E10; Wed, 2 Jul 2014 23:23: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 s62NNJx3061183; Wed, 2 Jul 2014 23:23:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62NNIBB061175; Wed, 2 Jul 2014 23:23:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022323.s62NNIBB061175@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 23:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268195 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 23:23:19 -0000 Author: marcel Date: Wed Jul 2 23:23:18 2014 New Revision: 268195 URL: http://svnweb.freebsd.org/changeset/base/268195 Log: MFC r263248 & r263257: In intr_event_handle() we already save and set td_intr_frame, so don't do it also in ia64_handle_intr(). Modified: stable/10/sys/ia64/ia64/clock.c stable/10/sys/ia64/ia64/interrupt.c stable/10/sys/ia64/ia64/mp_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/clock.c ============================================================================== --- stable/10/sys/ia64/ia64/clock.c Wed Jul 2 23:12:56 2014 (r268194) +++ stable/10/sys/ia64/ia64/clock.c Wed Jul 2 23:23:18 2014 (r268195) @@ -76,6 +76,7 @@ static u_int ia64_ih_clock(struct thread *td, u_int xiv, struct trapframe *tf) { struct eventtimer *et; + struct trapframe *stf; uint64_t itc, load; uint32_t mode; @@ -96,8 +97,12 @@ ia64_ih_clock(struct thread *td, u_int x ia64_srlz_d(); et = &ia64_clock_et; - if (et->et_active) + if (et->et_active) { + stf = td->td_intr_frame; + td->td_intr_frame = tf; et->et_event_cb(et, et->et_arg); + td->td_intr_frame = stf; + } return (1); } Modified: stable/10/sys/ia64/ia64/interrupt.c ============================================================================== --- stable/10/sys/ia64/ia64/interrupt.c Wed Jul 2 23:12:56 2014 (r268194) +++ stable/10/sys/ia64/ia64/interrupt.c Wed Jul 2 23:23:18 2014 (r268195) @@ -301,7 +301,6 @@ void ia64_handle_intr(struct trapframe *tf) { struct thread *td; - struct trapframe *stf; u_int xiv; td = curthread; @@ -316,9 +315,6 @@ ia64_handle_intr(struct trapframe *tf) } critical_enter(); - stf = td->td_intr_frame; - td->td_intr_frame = tf; - do { CTR2(KTR_INTR, "INTR: ITC=%u, XIV=%u", (u_int)tf->tf_special.ifa, xiv); @@ -329,8 +325,6 @@ ia64_handle_intr(struct trapframe *tf) xiv = ia64_get_ivr(); ia64_srlz_d(); } while (xiv != 15); - - td->td_intr_frame = stf; critical_exit(); out: Modified: stable/10/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/mp_machdep.c Wed Jul 2 23:12:56 2014 (r268194) +++ stable/10/sys/ia64/ia64/mp_machdep.c Wed Jul 2 23:23:18 2014 (r268195) @@ -113,10 +113,14 @@ ia64_ih_ast(struct thread *td, u_int xiv static u_int ia64_ih_hardclock(struct thread *td, u_int xiv, struct trapframe *tf) { + struct trapframe *stf; PCPU_INC(md.stats.pcs_nhardclocks); CTR1(KTR_SMP, "IPI_HARDCLOCK, cpuid=%d", PCPU_GET(cpuid)); + stf = td->td_intr_frame; + td->td_intr_frame = tf; hardclockintr(); + td->td_intr_frame = stf; return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 23:32:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B2CCB551; Wed, 2 Jul 2014 23:32: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 9E4E52EF9; Wed, 2 Jul 2014 23:32: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 s62NW61k066140; Wed, 2 Jul 2014 23:32:06 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62NW565066135; Wed, 2 Jul 2014 23:32:05 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201407022332.s62NW565066135@svn.freebsd.org> From: Scott Long Date: Wed, 2 Jul 2014 23:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268197 - stable/10/sys/dev/mps X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 23:32:06 -0000 Author: scottl Date: Wed Jul 2 23:32:05 2014 New Revision: 268197 URL: http://svnweb.freebsd.org/changeset/base/268197 Log: Merge r268071, 268072, 268088 Refactor some code in mps.c to reduce header pollution. Add accessor functions for manipulating the CAM CCB status field. Don't overload the CCB status field within the driver. Reviewed by: gibbs, slm Obtained from: Netflix, Inc. Modified: stable/10/sys/dev/mps/mps.c stable/10/sys/dev/mps/mps_sas.c stable/10/sys/dev/mps/mps_sas.h stable/10/sys/dev/mps/mps_user.c stable/10/sys/dev/mps/mpsvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mps/mps.c ============================================================================== --- stable/10/sys/dev/mps/mps.c Wed Jul 2 23:28:21 2014 (r268196) +++ stable/10/sys/dev/mps/mps.c Wed Jul 2 23:32:05 2014 (r268197) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include static int mps_diag_reset(struct mps_softc *sc, int sleep_flag); static int mps_init_queues(struct mps_softc *sc); @@ -328,11 +327,9 @@ mps_transition_operational(struct mps_so static int mps_iocfacts_allocate(struct mps_softc *sc, uint8_t attaching) { - int error, i; + int error; Mpi2IOCFactsReply_t saved_facts; uint8_t saved_mode, reallocating; - struct mpssas_lun *lun, *lun_tmp; - struct mpssas_target *targ; mps_dprint(sc, MPS_TRACE, "%s\n", __func__); @@ -489,27 +486,7 @@ mps_iocfacts_allocate(struct mps_softc * */ if (reallocating) { mps_iocfacts_free(sc); - - /* - * The number of targets is based on IOC Facts, so free all of - * the allocated LUNs for each target and then the target buffer - * itself. - */ - for (i=0; i< saved_facts.MaxTargets; i++) { - targ = &sc->sassc->targets[i]; - SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, - lun_tmp) { - free(lun, M_MPT2); - } - } - free(sc->sassc->targets, M_MPT2); - - sc->sassc->targets = malloc(sizeof(struct mpssas_target) * - sc->facts->MaxTargets, M_MPT2, M_WAITOK|M_ZERO); - if (!sc->sassc->targets) { - panic("%s failed to alloc targets with error %d\n", - __func__, ENOMEM); - } + mpssas_realloc_targets(sc, saved_facts.MaxTargets); } /* Modified: stable/10/sys/dev/mps/mps_sas.c ============================================================================== --- stable/10/sys/dev/mps/mps_sas.c Wed Jul 2 23:28:21 2014 (r268196) +++ stable/10/sys/dev/mps/mps_sas.c Wed Jul 2 23:32:05 2014 (r268197) @@ -597,7 +597,7 @@ mpssas_remove_device(struct mps_softc *s mps_dprint(sc, MPS_XINFO, "Completing missed command %p\n", tm); ccb = tm->cm_complete_data; - ccb->ccb_h.status = CAM_DEV_NOT_THERE; + mpssas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE); mpssas_scsiio_complete(sc, tm); } } @@ -986,7 +986,7 @@ mpssas_action(struct cam_sim *sim, union */ cpi->maxio = 256 * 1024; #endif - cpi->ccb_h.status = CAM_REQ_CMP; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); break; } case XPT_GET_TRAN_SETTINGS: @@ -1005,7 +1005,7 @@ mpssas_action(struct cam_sim *sim, union cts->ccb_h.target_id)); targ = &sassc->targets[cts->ccb_h.target_id]; if (targ->handle == 0x0) { - cts->ccb_h.status = CAM_SEL_TIMEOUT; + mpssas_set_ccbstatus(ccb, CAM_SEL_TIMEOUT); break; } @@ -1032,12 +1032,12 @@ mpssas_action(struct cam_sim *sim, union scsi->valid = CTS_SCSI_VALID_TQ; scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; - cts->ccb_h.status = CAM_REQ_CMP; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); break; } case XPT_CALC_GEOMETRY: cam_calc_geometry(&ccb->ccg, /*extended*/1); - ccb->ccb_h.status = CAM_REQ_CMP; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); break; case XPT_RESET_DEV: mps_dprint(sassc->sc, MPS_XINFO, "mpssas_action XPT_RESET_DEV\n"); @@ -1048,7 +1048,7 @@ mpssas_action(struct cam_sim *sim, union case XPT_TERM_IO: mps_dprint(sassc->sc, MPS_XINFO, "mpssas_action faking success for abort or reset\n"); - ccb->ccb_h.status = CAM_REQ_CMP; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); break; case XPT_SCSI_IO: mpssas_action_scsiio(sassc, ccb); @@ -1059,7 +1059,7 @@ mpssas_action(struct cam_sim *sim, union return; #endif default: - ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; + mpssas_set_ccbstatus(ccb, CAM_FUNC_NOTAVAIL); break; } xpt_done(ccb); @@ -1588,8 +1588,7 @@ mpssas_scsiio_timeout(void *data) /* XXX first, check the firmware state, to see if it's still * operational. if not, do a diag reset. */ - - cm->cm_ccb->ccb_h.status = CAM_CMD_TIMEOUT; + mpssas_set_ccbstatus(cm->cm_ccb, CAM_CMD_TIMEOUT); cm->cm_state = MPS_CM_STATE_TIMEDOUT; TAILQ_INSERT_TAIL(&targ->timedout_commands, cm, cm_recovery); @@ -1650,14 +1649,14 @@ mpssas_action_scsiio(struct mpssas_softc if (targ->handle == 0x0) { mps_dprint(sc, MPS_ERROR, "%s NULL handle for target %u\n", __func__, csio->ccb_h.target_id); - csio->ccb_h.status = CAM_SEL_TIMEOUT; + mpssas_set_ccbstatus(ccb, CAM_SEL_TIMEOUT); xpt_done(ccb); return; } if (targ->flags & MPS_TARGET_FLAGS_RAID_COMPONENT) { mps_dprint(sc, MPS_ERROR, "%s Raid component no SCSI IO " "supported %u\n", __func__, csio->ccb_h.target_id); - csio->ccb_h.status = CAM_TID_INVALID; + mpssas_set_ccbstatus(ccb, CAM_TID_INVALID); xpt_done(ccb); return; } @@ -1666,7 +1665,7 @@ mpssas_action_scsiio(struct mpssas_softc * Progress" and was actually aborted by the upper layer. Check for * this here and complete the command without error. */ - if (ccb->ccb_h.status != CAM_REQ_INPROG) { + if (mpssas_get_ccbstatus(ccb) != CAM_REQ_INPROG) { mps_dprint(sc, MPS_TRACE, "%s Command is not in progress for " "target %u\n", __func__, csio->ccb_h.target_id); xpt_done(ccb); @@ -1679,16 +1678,16 @@ mpssas_action_scsiio(struct mpssas_softc */ if (targ->flags & MPSSAS_TARGET_INREMOVAL) { if (targ->devinfo == 0) - csio->ccb_h.status = CAM_REQ_CMP; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); else - csio->ccb_h.status = CAM_SEL_TIMEOUT; + mpssas_set_ccbstatus(ccb, CAM_SEL_TIMEOUT); xpt_done(ccb); return; } if ((sc->mps_flags & MPS_FLAGS_SHUTDOWN) != 0) { mps_dprint(sc, MPS_INFO, "%s shutting down\n", __func__); - csio->ccb_h.status = CAM_TID_INVALID; + mpssas_set_ccbstatus(ccb, CAM_TID_INVALID); xpt_done(ccb); return; } @@ -1767,7 +1766,7 @@ mpssas_action_scsiio(struct mpssas_softc req->Control = htole32(mpi_control); if (MPS_SET_LUN(req->LUN, csio->ccb_h.target_lun) != 0) { mps_free_command(sc, cm); - ccb->ccb_h.status = CAM_LUN_INVALID; + mpssas_set_ccbstatus(ccb, CAM_LUN_INVALID); xpt_done(ccb); return; } @@ -1855,10 +1854,10 @@ mpssas_action_scsiio(struct mpssas_softc * the I/O to the IR volume itself. */ if (sc->WD_valid_config) { - if (ccb->ccb_h.status != MPS_WD_RETRY) { + if (ccb->ccb_h.sim_priv.entries[0].field == MPS_WD_RETRY) { mpssas_direct_drive_io(sassc, cm, ccb); } else { - ccb->ccb_h.status = CAM_REQ_INPROG; + mpssas_set_ccbstatus(ccb, CAM_REQ_INPROG); } } @@ -2152,7 +2151,7 @@ mpssas_scsiio_complete(struct mps_softc * because there can be no reply when we haven't actually * gone out to the hardware. */ - ccb->ccb_h.status = CAM_REQUEUE_REQ; + mpssas_set_ccbstatus(ccb, CAM_REQUEUE_REQ); /* * Currently the only error included in the mask is @@ -2175,11 +2174,11 @@ mpssas_scsiio_complete(struct mps_softc /* Take the fast path to completion */ if (cm->cm_reply == NULL) { - if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) { + if (mpssas_get_ccbstatus(ccb) == CAM_REQ_INPROG) { if ((sc->mps_flags & MPS_FLAGS_DIAGRESET) != 0) - ccb->ccb_h.status = CAM_SCSI_BUS_RESET; + mpssas_set_ccbstatus(ccb, CAM_SCSI_BUS_RESET); else { - ccb->ccb_h.status = CAM_REQ_CMP; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); ccb->csio.scsi_status = SCSI_STATUS_OK; } if (sassc->flags & MPSSAS_QUEUE_FROZEN) { @@ -2195,10 +2194,10 @@ mpssas_scsiio_complete(struct mps_softc * CAM_REQ_CMP. The first is if MPS_CM_FLAGS_ERROR_MASK is * set, the second is in the MPS_FLAGS_DIAGRESET above. */ - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (mpssas_get_ccbstatus(ccb) != CAM_REQ_CMP) { /* * Freeze the dev queue so that commands are - * executed in the correct order with after error + * executed in the correct order after error * recovery. */ ccb->ccb_h.status |= CAM_DEV_QFRZN; @@ -2222,10 +2221,11 @@ mpssas_scsiio_complete(struct mps_softc */ if (cm->cm_flags & MPS_CM_FLAGS_DD_IO) { mps_free_command(sc, cm); - ccb->ccb_h.status = MPS_WD_RETRY; + ccb->ccb_h.sim_priv.entries[0].field = MPS_WD_RETRY; mpssas_action_scsiio(sassc, ccb); return; - } + } else + ccb->ccb_h.sim_priv.entries[0].field = 0; switch (le16toh(rep->IOCStatus) & MPI2_IOCSTATUS_MASK) { case MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN: @@ -2241,7 +2241,7 @@ mpssas_scsiio_complete(struct mps_softc /* Completion failed at the transport level. */ if (rep->SCSIState & (MPI2_SCSI_STATE_NO_SCSI_STATUS | MPI2_SCSI_STATE_TERMINATED)) { - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); break; } @@ -2250,7 +2250,7 @@ mpssas_scsiio_complete(struct mps_softc * recover the command. */ if (rep->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_FAILED) { - ccb->ccb_h.status = CAM_AUTOSENSE_FAIL; + mpssas_set_ccbstatus(ccb, CAM_AUTOSENSE_FAIL); break; } @@ -2274,16 +2274,16 @@ mpssas_scsiio_complete(struct mps_softc */ if ((rep->SCSIStatus == MPI2_SCSI_STATUS_COMMAND_TERMINATED) || (rep->SCSIStatus == MPI2_SCSI_STATUS_TASK_ABORTED)) { - ccb->ccb_h.status = CAM_REQ_ABORTED; + mpssas_set_ccbstatus(ccb, CAM_REQ_ABORTED); break; } /* Handle normal status and sense */ csio->scsi_status = rep->SCSIStatus; if (rep->SCSIStatus == MPI2_SCSI_STATUS_GOOD) - ccb->ccb_h.status = CAM_REQ_CMP; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); else - ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR; + mpssas_set_ccbstatus(ccb, CAM_SCSI_STATUS_ERROR); if (rep->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_VALID) { int sense_len, returned_sense_len; @@ -2347,13 +2347,13 @@ mpssas_scsiio_complete(struct mps_softc * failed. */ if (cm->cm_targ->devinfo == 0) - ccb->ccb_h.status = CAM_REQ_CMP; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); else - ccb->ccb_h.status = CAM_DEV_NOT_THERE; + mpssas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE); break; case MPI2_IOCSTATUS_INVALID_SGL: mps_print_scsiio_cmd(sc, cm); - ccb->ccb_h.status = CAM_UNREC_HBA_ERROR; + mpssas_set_ccbstatus(ccb, CAM_UNREC_HBA_ERROR); break; case MPI2_IOCSTATUS_SCSI_TASK_TERMINATED: /* @@ -2366,14 +2366,14 @@ mpssas_scsiio_complete(struct mps_softc * on the console. */ if (cm->cm_state == MPS_CM_STATE_TIMEDOUT) - ccb->ccb_h.status = CAM_CMD_TIMEOUT; + mpssas_set_ccbstatus(ccb, CAM_CMD_TIMEOUT); else - ccb->ccb_h.status = CAM_REQ_ABORTED; + mpssas_set_ccbstatus(ccb, CAM_REQ_ABORTED); break; case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN: /* resid is ignored for this condition */ csio->resid = 0; - ccb->ccb_h.status = CAM_DATA_RUN_ERR; + mpssas_set_ccbstatus(ccb, CAM_DATA_RUN_ERR); break; case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: @@ -2382,7 +2382,7 @@ mpssas_scsiio_complete(struct mps_softc * transient transport-related) errors, retry these without * decrementing the retry count. */ - ccb->ccb_h.status = CAM_REQUEUE_REQ; + mpssas_set_ccbstatus(ccb, CAM_REQUEUE_REQ); mpssas_log_command(cm, MPS_INFO, "terminated ioc %x scsi %x state %x xfer %u\n", le16toh(rep->IOCStatus), rep->SCSIStatus, rep->SCSIState, @@ -2404,7 +2404,7 @@ mpssas_scsiio_complete(struct mps_softc le16toh(rep->IOCStatus), rep->SCSIStatus, rep->SCSIState, le32toh(rep->TransferCount)); csio->resid = cm->cm_length; - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); break; } @@ -2417,7 +2417,7 @@ mpssas_scsiio_complete(struct mps_softc "unfreezing SIM queue\n"); } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (mpssas_get_ccbstatus(ccb) != CAM_REQ_CMP) { ccb->ccb_h.status |= CAM_DEV_QFRZN; xpt_freeze_devq(ccb->ccb_h.path, /*count*/ 1); } @@ -2715,14 +2715,14 @@ mpssas_smpio_complete(struct mps_softc * if ((cm->cm_flags & MPS_CM_FLAGS_ERROR_MASK) != 0) { mps_dprint(sc, MPS_ERROR,"%s: cm_flags = %#x on SMP request!\n", __func__, cm->cm_flags); - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); goto bailout; } rpl = (MPI2_SMP_PASSTHROUGH_REPLY *)cm->cm_reply; if (rpl == NULL) { mps_dprint(sc, MPS_ERROR, "%s: NULL cm_reply!\n", __func__); - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); goto bailout; } @@ -2735,7 +2735,7 @@ mpssas_smpio_complete(struct mps_softc * rpl->SASStatus != MPI2_SASSTATUS_SUCCESS) { mps_dprint(sc, MPS_XINFO, "%s: IOCStatus %04x SASStatus %02x\n", __func__, le16toh(rpl->IOCStatus), rpl->SASStatus); - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); goto bailout; } @@ -2744,9 +2744,9 @@ mpssas_smpio_complete(struct mps_softc * (uintmax_t)sasaddr); if (ccb->smpio.smp_response[2] == SMP_FR_ACCEPTED) - ccb->ccb_h.status = CAM_REQ_CMP; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); else - ccb->ccb_h.status = CAM_SMP_STATUS_ERROR; + mpssas_set_ccbstatus(ccb, CAM_SMP_STATUS_ERROR); bailout: /* @@ -2782,7 +2782,7 @@ mpssas_send_smpcmd(struct mpssas_softc * case CAM_DATA_SG_PADDR: mps_dprint(sc, MPS_ERROR, "%s: physical addresses not supported\n", __func__); - ccb->ccb_h.status = CAM_REQ_INVALID; + mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID); xpt_done(ccb); return; case CAM_DATA_SG: @@ -2796,7 +2796,7 @@ mpssas_send_smpcmd(struct mpssas_softc * "%s: multiple request or response " "buffer segments not supported for SMP\n", __func__); - ccb->ccb_h.status = CAM_REQ_INVALID; + mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID); xpt_done(ccb); return; } @@ -2830,7 +2830,7 @@ mpssas_send_smpcmd(struct mpssas_softc * response = ccb->smpio.smp_response; break; default: - ccb->ccb_h.status = CAM_REQ_INVALID; + mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID); xpt_done(ccb); return; } @@ -2839,7 +2839,7 @@ mpssas_send_smpcmd(struct mpssas_softc * if (cm == NULL) { mps_dprint(sc, MPS_ERROR, "%s: cannot allocate command\n", __func__); - ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + mpssas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL); xpt_done(ccb); return; } @@ -2927,7 +2927,7 @@ mpssas_send_smpcmd(struct mpssas_softc * bailout_error: mps_free_command(sc, cm); - ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + mpssas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL); xpt_done(ccb); return; @@ -2952,7 +2952,7 @@ mpssas_action_smpio(struct mpssas_softc mps_dprint(sc, MPS_ERROR, "%s: target %d does not exist!\n", __func__, ccb->ccb_h.target_id); - ccb->ccb_h.status = CAM_SEL_TIMEOUT; + mpssas_set_ccbstatus(ccb, CAM_SEL_TIMEOUT); xpt_done(ccb); return; } @@ -3001,7 +3001,7 @@ mpssas_action_smpio(struct mpssas_softc mps_dprint(sc, MPS_ERROR, "%s: handle %d does not have a valid " "parent handle!\n", __func__, targ->handle); - ccb->ccb_h.status = CAM_REQ_INVALID; + mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID); goto bailout; } #ifdef OLD_MPS_PROBE @@ -3012,7 +3012,7 @@ mpssas_action_smpio(struct mpssas_softc mps_dprint(sc, MPS_ERROR, "%s: handle %d does not have a valid " "parent target!\n", __func__, targ->handle); - ccb->ccb_h.status = CAM_REQ_INVALID; + mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID); goto bailout; } @@ -3022,7 +3022,7 @@ mpssas_action_smpio(struct mpssas_softc "%s: handle %d parent %d does not " "have an SMP target!\n", __func__, targ->handle, parent_target->handle); - ccb->ccb_h.status = CAM_REQ_INVALID; + mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID); goto bailout; } @@ -3035,7 +3035,7 @@ mpssas_action_smpio(struct mpssas_softc "%s: handle %d parent %d does not " "have an SMP target!\n", __func__, targ->handle, targ->parent_handle); - ccb->ccb_h.status = CAM_REQ_INVALID; + mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID); goto bailout; } @@ -3044,7 +3044,7 @@ mpssas_action_smpio(struct mpssas_softc "%s: handle %d parent handle %d does " "not have a valid SAS address!\n", __func__, targ->handle, targ->parent_handle); - ccb->ccb_h.status = CAM_REQ_INVALID; + mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID); goto bailout; } @@ -3057,7 +3057,7 @@ mpssas_action_smpio(struct mpssas_softc mps_dprint(sc, MPS_INFO, "%s: unable to find SAS address for handle %d\n", __func__, targ->handle); - ccb->ccb_h.status = CAM_REQ_INVALID; + mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID); goto bailout; } mpssas_send_smpcmd(sassc, ccb, sasaddr); @@ -3089,7 +3089,7 @@ mpssas_action_resetdev(struct mpssas_sof if (tm == NULL) { mps_dprint(sc, MPS_ERROR, "command alloc failure in mpssas_action_resetdev\n"); - ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + mpssas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL); xpt_done(ccb); return; } @@ -3137,7 +3137,7 @@ mpssas_resetdev_complete(struct mps_soft "%s: cm_flags = %#x for reset of handle %#04x! " "This should not happen!\n", __func__, tm->cm_flags, req->DevHandle); - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); goto bailout; } @@ -3146,12 +3146,12 @@ mpssas_resetdev_complete(struct mps_soft le16toh(resp->IOCStatus), le32toh(resp->ResponseCode)); if (le32toh(resp->ResponseCode) == MPI2_SCSITASKMGMT_RSP_TM_COMPLETE) { - ccb->ccb_h.status = CAM_REQ_CMP; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); mpssas_announce_reset(sc, AC_SENT_BDR, tm->cm_targ->tid, CAM_LUN_WILDCARD); } else - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); bailout: @@ -3253,7 +3253,7 @@ mpssas_async(void *callback_arg, uint32_ cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); - if (((cdai.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) + if ((mpssas_get_ccbstatus((union ccb *)&cdai) == CAM_REQ_CMP) && (rcap_buf.prot & SRC16_PROT_EN)) { lun->eedp_formatted = TRUE; lun->eedp_block_size = scsi_4btoul(rcap_buf.length); @@ -3455,7 +3455,7 @@ mpssas_read_cap_done(struct cam_periph * * the lun as not supporting EEDP and set the block size * to 0. */ - if (((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + if ((mpssas_get_ccbstatus(done_ccb) != CAM_REQ_CMP) || (done_ccb->csio.scsi_status != SCSI_STATUS_OK)) { lun->eedp_formatted = FALSE; lun->eedp_block_size = 0; @@ -3593,3 +3593,33 @@ mpssas_check_id(struct mpssas_softc *sas return (0); } + +void +mpssas_realloc_targets(struct mps_softc *sc, int maxtargets) +{ + struct mpssas_softc *sassc; + struct mpssas_lun *lun, *lun_tmp; + struct mpssas_target *targ; + int i; + + sassc = sc->sassc; + /* + * The number of targets is based on IOC Facts, so free all of + * the allocated LUNs for each target and then the target buffer + * itself. + */ + for (i=0; i< maxtargets; i++) { + targ = &sassc->targets[i]; + SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, lun_tmp) { + free(lun, M_MPT2); + } + } + free(sassc->targets, M_MPT2); + + sassc->targets = malloc(sizeof(struct mpssas_target) * maxtargets, + M_MPT2, M_WAITOK|M_ZERO); + if (!sassc->targets) { + panic("%s failed to alloc targets with error %d\n", + __func__, ENOMEM); + } +} Modified: stable/10/sys/dev/mps/mps_sas.h ============================================================================== --- stable/10/sys/dev/mps/mps_sas.h Wed Jul 2 23:28:21 2014 (r268196) +++ stable/10/sys/dev/mps/mps_sas.h Wed Jul 2 23:32:05 2014 (r268197) @@ -145,6 +145,19 @@ mpssas_set_lun(uint8_t *lun, u_int ccblu return (0); } +static __inline void +mpssas_set_ccbstatus(union ccb *ccb, int status) +{ + ccb->ccb_h.status &= ~CAM_STATUS_MASK; + ccb->ccb_h.status |= status; +} + +static __inline int +mpssas_get_ccbstatus(union ccb *ccb) +{ + return (ccb->ccb_h.status & CAM_STATUS_MASK); +} + #define MPS_SET_SINGLE_LUN(req, lun) \ do { \ bzero((req)->LUN, 8); \ @@ -156,7 +169,5 @@ void mpssas_discovery_end(struct mpssas_ void mpssas_startup_increment(struct mpssas_softc *sassc); void mpssas_startup_decrement(struct mpssas_softc *sassc); -struct mps_command * mpssas_alloc_tm(struct mps_softc *sc); -void mpssas_free_tm(struct mps_softc *sc, struct mps_command *tm); void mpssas_firmware_event_work(void *arg, int pending); int mpssas_check_id(struct mpssas_softc *sassc, int id); Modified: stable/10/sys/dev/mps/mps_user.c ============================================================================== --- stable/10/sys/dev/mps/mps_user.c Wed Jul 2 23:28:21 2014 (r268196) +++ stable/10/sys/dev/mps/mps_user.c Wed Jul 2 23:32:05 2014 (r268197) @@ -101,7 +101,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/dev/mps/mpsvar.h ============================================================================== --- stable/10/sys/dev/mps/mpsvar.h Wed Jul 2 23:28:21 2014 (r268196) +++ stable/10/sys/dev/mps/mpsvar.h Wed Jul 2 23:32:05 2014 (r268197) @@ -756,6 +756,9 @@ void mpssas_prepare_remove(struct mpssas void mpssas_prepare_volume_remove(struct mpssas_softc *sassc, uint16_t handle); int mpssas_startup(struct mps_softc *sc); struct mpssas_target * mpssas_find_target_by_handle(struct mpssas_softc *, int, uint16_t); +void mpssas_realloc_targets(struct mps_softc *sc, int maxtargets); +struct mps_command * mpssas_alloc_tm(struct mps_softc *sc); +void mpssas_free_tm(struct mps_softc *sc, struct mps_command *tm); SYSCTL_DECL(_hw_mps); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 23:33:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D111476C; Wed, 2 Jul 2014 23:33:07 +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 BE3C52F08; Wed, 2 Jul 2014 23:33:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62NX74f066553; Wed, 2 Jul 2014 23:33:07 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62NX7fD066542; Wed, 2 Jul 2014 23:33:07 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022333.s62NX7fD066542@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 23:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268198 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 23:33:07 -0000 Author: marcel Date: Wed Jul 2 23:33:07 2014 New Revision: 268198 URL: http://svnweb.freebsd.org/changeset/base/268198 Log: MFC r263253: Don't use the ITC as the faulting address for external interrupts. Modified: stable/10/sys/ia64/ia64/exception.S stable/10/sys/ia64/ia64/interrupt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/exception.S ============================================================================== --- stable/10/sys/ia64/ia64/exception.S Wed Jul 2 23:32:05 2014 (r268197) +++ stable/10/sys/ia64/ia64/exception.S Wed Jul 2 23:33:07 2014 (r268198) @@ -1388,7 +1388,7 @@ IVT_END(Break_Instruction) IVT_ENTRY(External_Interrupt, 0x3000) { .mib - mov r17=ar.itc // Put the ITC in the trapframe. + mov r17=0 mov r16=ip br.sptk exception_save ;; Modified: stable/10/sys/ia64/ia64/interrupt.c ============================================================================== --- stable/10/sys/ia64/ia64/interrupt.c Wed Jul 2 23:32:05 2014 (r268197) +++ stable/10/sys/ia64/ia64/interrupt.c Wed Jul 2 23:33:07 2014 (r268198) @@ -316,8 +316,8 @@ ia64_handle_intr(struct trapframe *tf) critical_enter(); do { - CTR2(KTR_INTR, "INTR: ITC=%u, XIV=%u", - (u_int)tf->tf_special.ifa, xiv); + CTR3(KTR_INTR, "INTR: XIV=%u, #%u: frame=%p", xiv, + PCPU_GET(cnt.v_intr), tf); if (!(ia64_handler[xiv])(td, xiv, tf)) { ia64_set_eoi(0); ia64_srlz_d(); From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 23:37:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC2C3C59; Wed, 2 Jul 2014 23:37: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 8ED382F46; Wed, 2 Jul 2014 23:37: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 s62NbFFb067437; Wed, 2 Jul 2014 23:37:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62NbFvc067435; Wed, 2 Jul 2014 23:37:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022337.s62NbFvc067435@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 23:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268199 - in stable/10/sys/ia64: ia64 include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 23:37:15 -0000 Author: marcel Date: Wed Jul 2 23:37:14 2014 New Revision: 268199 URL: http://svnweb.freebsd.org/changeset/base/268199 Log: MFC r263254: Move the implementation of kdb_cpu_trap() from to machdep.c. Modified: stable/10/sys/ia64/ia64/machdep.c stable/10/sys/ia64/include/kdb.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/machdep.c Wed Jul 2 23:33:07 2014 (r268198) +++ stable/10/sys/ia64/ia64/machdep.c Wed Jul 2 23:37:14 2014 (r268199) @@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -562,6 +563,18 @@ spinlock_exit(void) } void +kdb_cpu_trap(int vector, int code __unused) +{ + + __asm __volatile("flushrs;;"); + + /* Restart after the break instruction. */ + if (vector == IA64_VEC_BREAK && + kdb_frame->tf_special.ifa == IA64_FIXED_BREAK) + kdb_frame->tf_special.psr += IA64_PSR_RI_1; +} + +void map_vhpt(uintptr_t vhpt) { pt_entry_t pte; Modified: stable/10/sys/ia64/include/kdb.h ============================================================================== --- stable/10/sys/ia64/include/kdb.h Wed Jul 2 23:33:07 2014 (r268198) +++ stable/10/sys/ia64/include/kdb.h Wed Jul 2 23:37:14 2014 (r268199) @@ -35,6 +35,8 @@ #define KDB_STOPPEDPCB(pc) (&(pc)->pc_md.pcb) +void kdb_cpu_trap(int, int); + static __inline void kdb_cpu_clear_singlestep(void) { @@ -62,14 +64,4 @@ kdb_cpu_sync_icache(unsigned char *addr, } } -static __inline void -kdb_cpu_trap(int vector, int _) -{ - __asm __volatile("flushrs;;"); - - if (vector == IA64_VEC_BREAK && - kdb_frame->tf_special.ifa == IA64_FIXED_BREAK) - kdb_frame->tf_special.psr += IA64_PSR_RI_1; -} - #endif /* _MACHINE_KDB_H_ */ From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 23:47:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0A96D80B; Wed, 2 Jul 2014 23:47: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 E9B95208A; Wed, 2 Jul 2014 23: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 s62NljG7073399; Wed, 2 Jul 2014 23:47:45 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62Nlh84073386; Wed, 2 Jul 2014 23:47:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022347.s62Nlh84073386@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 23:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268200 - in stable/10/sys: conf ia64/ia64 ia64/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 23:47:46 -0000 Author: marcel Date: Wed Jul 2 23:47:43 2014 New Revision: 268200 URL: http://svnweb.freebsd.org/changeset/base/268200 Log: MFC r263323: Fix and improve exception tracing. Added: stable/10/sys/ia64/ia64/xtrace.c - copied unchanged from r263323, head/sys/ia64/ia64/xtrace.c Modified: stable/10/sys/conf/files.ia64 stable/10/sys/conf/options.ia64 stable/10/sys/ia64/ia64/db_machdep.c stable/10/sys/ia64/ia64/exception.S stable/10/sys/ia64/ia64/interrupt.c stable/10/sys/ia64/ia64/machdep.c stable/10/sys/ia64/ia64/mp_machdep.c stable/10/sys/ia64/ia64/trap.c stable/10/sys/ia64/include/md_var.h stable/10/sys/ia64/include/pcpu.h stable/10/sys/ia64/include/smp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.ia64 ============================================================================== --- stable/10/sys/conf/files.ia64 Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/conf/files.ia64 Wed Jul 2 23:47:43 2014 (r268200) @@ -110,6 +110,7 @@ ia64/ia64/uma_machdep.c standard ia64/ia64/unaligned.c standard ia64/ia64/unwind.c standard ia64/ia64/vm_machdep.c standard +ia64/ia64/xtrace.c optional xtrace ia64/isa/isa.c optional isa ia64/isa/isa_dma.c optional isa ia64/pci/pci_cfgreg.c optional pci Modified: stable/10/sys/conf/options.ia64 ============================================================================== --- stable/10/sys/conf/options.ia64 Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/conf/options.ia64 Wed Jul 2 23:47:43 2014 (r268200) @@ -13,7 +13,7 @@ COMPAT_FREEBSD32 opt_compat.h PV_STATS opt_pmap.h -EXCEPTION_TRACING opt_xtrace.h +XTRACE VGA_ALT_SEQACCESS opt_vga.h VGA_DEBUG opt_vga.h Modified: stable/10/sys/ia64/ia64/db_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/db_machdep.c Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/ia64/ia64/db_machdep.c Wed Jul 2 23:47:43 2014 (r268200) @@ -26,11 +26,11 @@ * SUCH DAMAGE. */ +#include "opt_xtrace.h" + #include __FBSDID("$FreeBSD$"); -#include "opt_xtrace.h" - #include #include #include @@ -585,6 +585,10 @@ db_show_mdpcpu(struct pcpu *pc) db_printf("MD: clock_load = %#lx\n", md->clock_load); db_printf("MD: stats = %p\n", &md->stats); db_printf("MD: pmap = %p\n", md->current_pmap); +#ifdef XTRACE + db_printf("MD: xtrace_buffer = %p\n", md->xtrace_buffer); + db_printf("MD: xtrace_tail = %#lx\n", md->xtrace_tail); +#endif } void @@ -604,29 +608,3 @@ db_trace_thread(struct thread *td, int c ctx = kdb_thr_ctx(td); return (db_backtrace(td, ctx, count)); } - -#ifdef EXCEPTION_TRACING - -extern long xtrace[]; -extern long *xhead; - -DB_COMMAND(xtrace, db_xtrace) -{ - long *p; - - p = (*xhead == 0) ? xtrace : xhead; - - db_printf("ITC\t\t IVT\t\t IIP\t\t IFA\t\t ISR\n"); - if (*p == 0) - return; - - do { - db_printf("%016lx %016lx %016lx %016lx %016lx\n", p[0], p[1], - p[2], p[3], p[4]); - p += 5; - if (p == (void *)&xhead) - p = xtrace; - } while (p != xhead); -} - -#endif Modified: stable/10/sys/ia64/ia64/exception.S ============================================================================== --- stable/10/sys/ia64/ia64/exception.S Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/ia64/ia64/exception.S Wed Jul 2 23:47:43 2014 (r268200) @@ -50,63 +50,185 @@ __FBSDID("$FreeBSD$"); .section .ivt.data, "aw" + .align 8 .global ia64_kptdir + .size ia64_kptdir, 8 ia64_kptdir: data8 0 -#ifdef EXCEPTION_TRACING +#ifdef XTRACE - .global xtrace, xhead -xtrace: .space 1024*5*8 -xhead: data8 xtrace + .align 8 + .global ia64_xtrace_mask + .size ia64_xtrace_mask, 8 +ia64_xtrace_mask: data8 0 + + .align 4 + .global ia64_xtrace_enabled + .size ia64_xtrace_enabled, 4 +ia64_xtrace_enabled: data4 0 -#define XTRACE(offset) \ -{ .mmi ; \ - mov r24=ar.itc ; \ - mov r25=cr.iip ; \ - mov r27=offset ; \ -} ; \ -{ .mlx ; \ - mov r28=cr.ifa ; \ - movl r29=xhead ;; \ -} ; \ -{ .mmi ; \ - ld8 r29=[r29] ;; \ - st8 [r29]=r24,8 ; \ - nop 0 ;; \ -} ; \ -{ .mmi ; \ - st8 [r29]=r27,8 ;; \ - mov r24=cr.isr ; \ - add r27=8,r29 ;; \ -} ; \ -{ .mmi ; \ - st8 [r29]=r25,16 ;; \ - st8 [r27]=r28,16 ; \ - mov r25=pr ;; \ +#define XTRACE_HOOK(offset) \ +{ .mii ; \ + nop 0 ; \ + mov r31 = b7 ; \ + mov r28 = pr ; \ } ; \ -{ .mlx ; \ - st8 [r29]=r24 ; \ - movl r28=xhead ;; \ +{ .mib ; \ + nop 0 ; \ + mov r25 = ip ; \ + br.sptk ia64_xtrace_write ;; \ } ; \ { .mii ; \ - cmp.eq p15,p0=r27,r28 ; \ - addl r29=1024*5*8,r0 ;; \ -(p15) sub r27=r28,r29 ;; \ -} ; \ -{ .mmi ; \ - st8 [r28]=r27 ; \ - nop 0 ; \ - mov pr=r25,0x1ffff ;; \ + nop 0 ; \ + mov b7 = r31 ; \ + mov pr = r28, 0x1ffff ;; \ } -#else + .section .ivt.text, "ax" + +// We can only use r25, r26 & r27 +ENTRY_NOPROFILE(ia64_xtrace_write, 0) +{ .mlx + add r25 = 16, r25 + movl r26 = ia64_xtrace_enabled + ;; +} +{ .mmi + mov r27 = ar.k3 + ld4 r26 = [r26] + mov b7 = r25 + ;; +} +{ .mib + add r25 = -32, r25 + cmp.eq p15,p0 = r0, r26 +(p15) br.dptk.few b7 + ;; +} +{ .mib + nop 0 + cmp.eq p15,p0 = r0, r27 +(p15) br.dptk.few b7 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x00 IVT + mov r26 = ar.itc + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x08 ITC + mov r25 = cr.iip + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x10 IIP + mov r26 = cr.ifa + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x18 IFA + mov r25 = cr.isr + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x20 ISR + mov r26 = cr.ipsr + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x28 IPSR + mov r25 = cr.itir + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x30 ITIR + mov r26 = cr.iipa + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x38 IIPA + mov r25 = cr.ifs + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x40 IFS + mov r26 = cr.iim + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x48 IIM + mov r25 = cr.iha + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x50 IHA + mov r26 = ar.unat + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x58 UNAT + mov r25 = ar.rsc + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x60 RSC + mov r26 = ar.bsp + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x68 BSP + mov r25 = r13 + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x70 PCPU/TLS + mov r26 = r12 + nop 0 + ;; +} +{ .mlx + st8 [r27] = r26, 8 // 0x78 SP + movl r25 = ia64_xtrace_mask + ;; +} +{ .mmi + ld8 r26 = [r25] + ;; + and r25 = r27, r26 + nop 0 + ;; +} +{ .mib + mov ar.k3 = r25 + nop 0 + br.sptk b7 + ;; +} +END(ia64_xtrace_write) -#define XTRACE(offset) +#else /* XTRACE */ -#endif +#define XTRACE_HOOK(offset) .section .ivt.text, "ax" +#endif /* XTRACE */ + /* * exception_save: save interrupted state * @@ -632,6 +754,7 @@ ENTRY_NOPROFILE(exception_restore, 0) ssm psr.dt ;; srlz.d + mov r16 = r25 exception_restore_restart: { .mmi @@ -649,20 +772,21 @@ exception_restore_restart: ;; } { .mmi + mov cr.ifs=r16 mov ar.k6=r31 - mov ar.rnat=r21 - nop 0 + mov pr=r18,0x1ffff ;; } { .mmi - mov ar.unat=r17 mov cr.iip=r19 + mov ar.unat=r17 nop 0 + ;; } { .mmi mov cr.ipsr=r24 - mov cr.ifs=r25 - mov pr=r18,0x1ffff + mov ar.rnat=r21 + nop 0 ;; } { .mmb @@ -713,7 +837,7 @@ END(exception_restore) .save rp, r0; \ .body; \ ivt_##name: \ - XTRACE(offset) + XTRACE_HOOK(offset) #define IVT_END(name) \ .endp ivt_##name Modified: stable/10/sys/ia64/ia64/interrupt.c ============================================================================== --- stable/10/sys/ia64/ia64/interrupt.c Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/ia64/ia64/interrupt.c Wed Jul 2 23:47:43 2014 (r268200) @@ -25,6 +25,7 @@ */ #include "opt_ddb.h" +#include "opt_xtrace.h" #include __FBSDID("$FreeBSD$"); @@ -305,6 +306,11 @@ ia64_handle_intr(struct trapframe *tf) td = curthread; ia64_set_fpsr(IA64_FPSR_DEFAULT); + +#ifdef XTRACE + ia64_xtrace_save(); +#endif + PCPU_INC(cnt.v_intr); xiv = ia64_get_ivr(); Modified: stable/10/sys/ia64/ia64/machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/machdep.c Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/ia64/ia64/machdep.c Wed Jul 2 23:47:43 2014 (r268200) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_sched.h" +#include "opt_xtrace.h" #include #include @@ -177,9 +178,6 @@ void (*cpu_idle_hook)(sbintime_t) = NULL struct kva_md_info kmi; -#define Mhz 1000000L -#define Ghz (1000L*Mhz) - static void identifycpu(void) { @@ -566,6 +564,9 @@ void kdb_cpu_trap(int vector, int code __unused) { +#ifdef XTRACE + ia64_xtrace_stop(); +#endif __asm __volatile("flushrs;;"); /* Restart after the break instruction. */ @@ -892,6 +893,10 @@ ia64_init(void) */ pmap_bootstrap(); +#ifdef XTRACE + ia64_xtrace_init_bsp(); +#endif + /* * Initialize debuggers, and break into them if appropriate. */ Modified: stable/10/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/mp_machdep.c Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/ia64/ia64/mp_machdep.c Wed Jul 2 23:47:43 2014 (r268200) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" +#include "opt_xtrace.h" #include #include @@ -236,6 +237,10 @@ ia64_ap_startup(void) ia64_set_fpsr(IA64_FPSR_DEFAULT); +#ifdef XTRACE + ia64_xtrace_init_ap(ia64_ap_state.as_xtrace_buffer); +#endif + /* Wait until it's time for us to be unleashed */ while (ia64_ap_state.as_spin) cpu_spinwait(); @@ -398,6 +403,10 @@ cpu_mp_start() ia64_ap_state.as_kstack = stp; ia64_ap_state.as_kstack_top = stp + KSTACK_PAGES * PAGE_SIZE; +#ifdef XTRACE + ia64_ap_state.as_xtrace_buffer = ia64_xtrace_alloc(); +#endif + ia64_ap_state.as_trace = 0; ia64_ap_state.as_delay = 2000; ia64_ap_state.as_awake = 0; Modified: stable/10/sys/ia64/ia64/trap.c ============================================================================== --- stable/10/sys/ia64/ia64/trap.c Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/ia64/ia64/trap.c Wed Jul 2 23:47:43 2014 (r268200) @@ -354,6 +354,12 @@ trap(int vector, struct trapframe *tf) ksiginfo_t ksi; user = TRAPF_USERMODE(tf) ? 1 : 0; + if (user) + ia64_set_fpsr(IA64_FPSR_DEFAULT); + +#ifdef XTRACE + ia64_xtrace_save(); +#endif PCPU_INC(cnt.v_trap); @@ -362,7 +368,6 @@ trap(int vector, struct trapframe *tf) ucode = 0; if (user) { - ia64_set_fpsr(IA64_FPSR_DEFAULT); td->td_pticks = 0; td->td_frame = tf; if (td->td_ucred != p->p_ucred) Copied: stable/10/sys/ia64/ia64/xtrace.c (from r263323, head/sys/ia64/ia64/xtrace.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/ia64/ia64/xtrace.c Wed Jul 2 23:47:43 2014 (r268200, copy of r263323, head/sys/ia64/ia64/xtrace.c) @@ -0,0 +1,220 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_ddb.h" +#include "opt_xtrace.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define XTRACE_LOG2SZ 14 /* 16KB trace buffers */ + +struct ia64_xtrace_record { + uint64_t ivt; + uint64_t itc; + uint64_t iip; + uint64_t ifa; + uint64_t isr; + uint64_t ipsr; + uint64_t itir; + uint64_t iipa; + + uint64_t ifs; + uint64_t iim; + uint64_t iha; + uint64_t unat; + uint64_t rsc; + uint64_t bsp; + uint64_t tp; + uint64_t sp; +}; + +extern uint32_t ia64_xtrace_enabled; +extern uint64_t ia64_xtrace_mask; + +static uint64_t ia64_xtrace_base; + +static void +ia64_xtrace_init_common(vm_paddr_t pa) +{ + uint64_t psr; + pt_entry_t pte; + + pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY | + PTE_PL_KERN | PTE_AR_RW; + pte |= pa & PTE_PPN_MASK; + + __asm __volatile("ptr.d %0,%1" :: "r"(ia64_xtrace_base), + "r"(XTRACE_LOG2SZ << 2)); + + __asm __volatile("mov %0=psr" : "=r"(psr)); + __asm __volatile("rsm psr.ic|psr.i"); + ia64_srlz_i(); + + ia64_set_ifa(ia64_xtrace_base); + ia64_set_itir(XTRACE_LOG2SZ << 2); + ia64_srlz_d(); + __asm __volatile("itr.d dtr[%0]=%1" :: "r"(6), "r"(pte)); + + __asm __volatile("mov psr.l=%0" :: "r" (psr)); + ia64_srlz_i(); + + PCPU_SET(md.xtrace_tail, ia64_xtrace_base); + ia64_set_k3(ia64_xtrace_base); +} + +void * +ia64_xtrace_alloc(void) +{ + uintptr_t buf; + size_t sz; + + sz = 1UL << XTRACE_LOG2SZ; + buf = kmem_alloc_contig(kernel_arena, sz, M_WAITOK | M_ZERO, + 0UL, ~0UL, sz, 0, VM_MEMATTR_DEFAULT); + return ((void *)buf); +} + +void +ia64_xtrace_init_ap(void *buf) +{ + vm_paddr_t pa; + + if (buf == NULL) { + ia64_set_k3(0); + return; + } + PCPU_SET(md.xtrace_buffer, buf); + pa = ia64_tpa((uintptr_t)buf); + ia64_xtrace_init_common(pa); +} + +void +ia64_xtrace_init_bsp(void) +{ + void *buf; + vm_paddr_t pa; + size_t sz; + + sz = 1UL << XTRACE_LOG2SZ; + ia64_xtrace_base = VM_MIN_KERNEL_ADDRESS + (sz << 1); + ia64_xtrace_mask = ~sz; + + buf = ia64_physmem_alloc(sz, sz); + if (buf == NULL) { + ia64_set_k3(0); + return; + } + PCPU_SET(md.xtrace_buffer, buf); + pa = IA64_RR_MASK((uintptr_t)buf); + ia64_xtrace_init_common(pa); +} + +static void +ia64_xtrace_init(void *dummy __unused) +{ + + TUNABLE_INT_FETCH("machdep.xtrace.enabled", &ia64_xtrace_enabled); +} +SYSINIT(xtrace, SI_SUB_CPU, SI_ORDER_ANY, ia64_xtrace_init, NULL); + +void +ia64_xtrace_save(void) +{ + struct ia64_xtrace_record *rec; + uint64_t head, tail; + + critical_enter(); + head = ia64_get_k3(); + tail = PCPU_GET(md.xtrace_tail); + if (head == 0 || tail == 0) { + critical_exit(); + return; + } + while (head != tail) { + rec = (void *)(uintptr_t)tail; + CTR6(KTR_TRAP, "XTRACE: itc=%lu, ticks=%d: " + "IVT=%#lx, IIP=%#lx, IFA=%#lx, ISR=%#lx", + rec->itc, ticks, + rec->ivt, rec->iip, rec->ifa, rec->isr); + tail += sizeof(*rec); + tail &= ia64_xtrace_mask; + } + PCPU_SET(md.xtrace_tail, tail); + critical_exit(); +} + +void +ia64_xtrace_stop(void) +{ + ia64_xtrace_enabled = 0; +} + +#if 0 +#ifdef DDB + +#include + +DB_SHOW_COMMAND(xtrace, db_xtrace) +{ + struct ia64_xtrace_record *p, *r; + + p = (ia64_xtptr == 0) ? ia64_xtptr1 : ia64_xtptr; + if (p == 0) { + db_printf("Exception trace buffer not allocated\n"); + return; + } + + r = (p->ivt == 0) ? ia64_xtbase : p; + if (r->ivt == 0) { + db_printf("No exception trace records written\n"); + return; + } + + db_printf("IVT\t\t ITC\t\t IIP\t\t IFA\n"); + do { + db_printf("%016lx %016lx %016lx %016lx\n", + r->ivt, r->itc, r->iip, r->ifa); + r++; + if (r == ia64_xtlim) + r = ia64_xtbase; + } while (r != p); +} + +#endif /* DDB */ +#endif Modified: stable/10/sys/ia64/include/md_var.h ============================================================================== --- stable/10/sys/ia64/include/md_var.h Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/ia64/include/md_var.h Wed Jul 2 23:47:43 2014 (r268200) @@ -102,6 +102,11 @@ int ia64_physmem_init(void); int ia64_physmem_track(vm_paddr_t, vm_size_t); void ia64_probe_sapics(void); void ia64_sync_icache(vm_offset_t, vm_size_t); +void *ia64_xtrace_alloc(void); +void ia64_xtrace_init_ap(void *); +void ia64_xtrace_init_bsp(void); +void ia64_xtrace_save(void); +void ia64_xtrace_stop(void); void interrupt(struct trapframe *); void map_gateway_page(void); void map_pal_code(void); Modified: stable/10/sys/ia64/include/pcpu.h ============================================================================== --- stable/10/sys/ia64/include/pcpu.h Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/ia64/include/pcpu.h Wed Jul 2 23:47:43 2014 (r268200) @@ -56,6 +56,8 @@ struct pcpu_md { uint32_t clock_mode; /* Clock ET mode */ uint32_t awake:1; /* CPU is awake? */ struct pcpu_stats stats; /* Interrupt stats. */ + void *xtrace_buffer; + uint64_t xtrace_tail; #ifdef _KERNEL struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -65,7 +67,7 @@ struct pcpu_md { #define PCPU_MD_FIELDS \ uint32_t pc_acpi_id; /* ACPI CPU id. */ \ struct pcpu_md pc_md; /* MD fields. */ \ - char __pad[1265] + char __pad[10*128] #ifdef _KERNEL Modified: stable/10/sys/ia64/include/smp.h ============================================================================== --- stable/10/sys/ia64/include/smp.h Wed Jul 2 23:37:14 2014 (r268199) +++ stable/10/sys/ia64/include/smp.h Wed Jul 2 23:47:43 2014 (r268200) @@ -32,6 +32,7 @@ struct ia64_ap_state { void *as_kstack; void *as_kstack_top; struct pcpu *as_pcpu; + void *as_xtrace_buffer; volatile int as_delay; volatile u_int as_awake; volatile u_int as_spin; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 2 23:57:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 325C1ED2; Wed, 2 Jul 2014 23:57: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 1E32621A7; Wed, 2 Jul 2014 23:57: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 s62Nvuqp078042; Wed, 2 Jul 2014 23:57:56 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62NvtPH078037; Wed, 2 Jul 2014 23:57:55 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407022357.s62NvtPH078037@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Jul 2014 23:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268201 - in stable/10/sys/ia64: ia64 include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2014 23:57:56 -0000 Author: marcel Date: Wed Jul 2 23:57:55 2014 New Revision: 268201 URL: http://svnweb.freebsd.org/changeset/base/268201 Log: MFC r263380 & r268185: Add KTR events for the PMAP interface functions. Modified: stable/10/sys/ia64/ia64/machdep.c stable/10/sys/ia64/ia64/pmap.c stable/10/sys/ia64/include/pmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/machdep.c Wed Jul 2 23:47:43 2014 (r268200) +++ stable/10/sys/ia64/ia64/machdep.c Wed Jul 2 23:57:55 2014 (r268201) @@ -133,6 +133,7 @@ SYSCTL_UINT(_hw_freq, OID_AUTO, itc, CTL "ITC frequency"); int cold = 1; +int unmapped_buf_allowed = 0; struct bootinfo *bootinfo; @@ -746,8 +747,8 @@ ia64_init(void) mdlen = md->md_pages * EFI_PAGE_SIZE; switch (md->md_type) { case EFI_MD_TYPE_IOPORT: - ia64_port_base = (uintptr_t)pmap_mapdev(md->md_phys, - mdlen); + ia64_port_base = pmap_mapdev_priv(md->md_phys, + mdlen, VM_MEMATTR_UNCACHEABLE); break; case EFI_MD_TYPE_PALCODE: ia64_pal_base = md->md_phys; Modified: stable/10/sys/ia64/ia64/pmap.c ============================================================================== --- stable/10/sys/ia64/ia64/pmap.c Wed Jul 2 23:47:43 2014 (r268200) +++ stable/10/sys/ia64/ia64/pmap.c Wed Jul 2 23:57:55 2014 (r268201) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -484,6 +485,8 @@ void pmap_page_init(vm_page_t m) { + CTR2(KTR_PMAP, "%s(m=%p)", __func__, m); + TAILQ_INIT(&m->md.pv_list); m->md.memattr = VM_MEMATTR_DEFAULT; } @@ -497,6 +500,8 @@ void pmap_init(void) { + CTR1(KTR_PMAP, "%s()", __func__); + ptezone = uma_zcreate("PT ENTRY", sizeof (struct ia64_lpte), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM|UMA_ZONE_NOFREE); } @@ -604,13 +609,25 @@ pmap_free_rid(uint32_t rid) * Page table page management routines..... ***************************************************/ +static void +pmap_pinit_common(pmap_t pmap) +{ + int i; + + for (i = 0; i < IA64_VM_MINKERN_REGION; i++) + pmap->pm_rid[i] = pmap_allocate_rid(); + TAILQ_INIT(&pmap->pm_pvchunk); + bzero(&pmap->pm_stats, sizeof pmap->pm_stats); +} + void -pmap_pinit0(struct pmap *pmap) +pmap_pinit0(pmap_t pmap) { + CTR2(KTR_PMAP, "%s(pm=%p)", __func__, pmap); + PMAP_LOCK_INIT(pmap); - /* kernel_pmap is the same as any other pmap. */ - pmap_pinit(pmap); + pmap_pinit_common(pmap); } /* @@ -618,14 +635,12 @@ pmap_pinit0(struct pmap *pmap) * such as one in a vmspace structure. */ int -pmap_pinit(struct pmap *pmap) +pmap_pinit(pmap_t pmap) { - int i; - for (i = 0; i < IA64_VM_MINKERN_REGION; i++) - pmap->pm_rid[i] = pmap_allocate_rid(); - TAILQ_INIT(&pmap->pm_pvchunk); - bzero(&pmap->pm_stats, sizeof pmap->pm_stats); + CTR2(KTR_PMAP, "%s(pm=%p)", __func__, pmap); + + pmap_pinit_common(pmap); return (1); } @@ -643,6 +658,8 @@ pmap_release(pmap_t pmap) { int i; + CTR2(KTR_PMAP, "%s(pm=%p)", __func__, pmap); + for (i = 0; i < IA64_VM_MINKERN_REGION; i++) if (pmap->pm_rid[i]) pmap_free_rid(pmap->pm_rid[i]); @@ -658,6 +675,8 @@ pmap_growkernel(vm_offset_t addr) struct ia64_lpte *leaf; vm_page_t nkpg; + CTR2(KTR_PMAP, "%s(va=%#lx)", __func__, addr); + while (kernel_vm_end <= addr) { if (nkpt == PAGE_SIZE/8 + PAGE_SIZE*PAGE_SIZE/64) panic("%s: out of kernel address space", __func__); @@ -1152,6 +1171,8 @@ pmap_extract(pmap_t pmap, vm_offset_t va pmap_t oldpmap; vm_paddr_t pa; + CTR3(KTR_PMAP, "%s(pm=%p, va=%#lx)", __func__, pmap, va); + pa = 0; PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); @@ -1178,6 +1199,9 @@ pmap_extract_and_hold(pmap_t pmap, vm_of vm_page_t m; vm_paddr_t pa; + CTR4(KTR_PMAP, "%s(pm=%p, va=%#lx, prot=%#x)", __func__, pmap, va, + prot); + pa = 0; m = NULL; PMAP_LOCK(pmap); @@ -1359,6 +1383,8 @@ pmap_kextract(vm_offset_t va) vm_paddr_t pa; u_int idx; + CTR2(KTR_PMAP, "%s(va=%#lx)", __func__, va); + KASSERT(va >= VM_MAXUSER_ADDRESS, ("Must be kernel VA")); /* Regions 6 and 7 are direct mapped. */ @@ -1419,6 +1445,8 @@ pmap_qenter(vm_offset_t va, vm_page_t *m struct ia64_lpte *pte; int i; + CTR4(KTR_PMAP, "%s(va=%#lx, m_p=%p, cnt=%d)", __func__, va, m, count); + for (i = 0; i < count; i++) { pte = pmap_find_kpte(va); if (pmap_present(pte)) @@ -1442,6 +1470,8 @@ pmap_qremove(vm_offset_t va, int count) struct ia64_lpte *pte; int i; + CTR3(KTR_PMAP, "%s(va=%#lx, cnt=%d)", __func__, va, count); + for (i = 0; i < count; i++) { pte = pmap_find_kpte(va); if (pmap_present(pte)) { @@ -1458,10 +1488,12 @@ pmap_qremove(vm_offset_t va, int count) * to not have the PTE reflect that, nor update statistics. */ void -pmap_kenter(vm_offset_t va, vm_offset_t pa) +pmap_kenter(vm_offset_t va, vm_paddr_t pa) { struct ia64_lpte *pte; + CTR3(KTR_PMAP, "%s(va=%#lx, pa=%#lx)", __func__, va, pa); + pte = pmap_find_kpte(va); if (pmap_present(pte)) pmap_invalidate_page(va); @@ -1480,6 +1512,8 @@ pmap_kremove(vm_offset_t va) { struct ia64_lpte *pte; + CTR2(KTR_PMAP, "%s(va=%#lx)", __func__, va); + pte = pmap_find_kpte(va); if (pmap_present(pte)) { pmap_remove_vhpt(va); @@ -1503,6 +1537,10 @@ pmap_kremove(vm_offset_t va) vm_offset_t pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot) { + + CTR5(KTR_PMAP, "%s(va_p=%p, sva=%#lx, eva=%#lx, prot=%#x)", __func__, + virt, start, end, prot); + return IA64_PHYS_TO_RR7(start); } @@ -1522,6 +1560,9 @@ pmap_remove(pmap_t pmap, vm_offset_t sva vm_offset_t va; struct ia64_lpte *pte; + CTR4(KTR_PMAP, "%s(pm=%p, sva=%#lx, eva=%#lx)", __func__, pmap, sva, + eva); + /* * Perform an unsynchronized read. This is, however, safe. */ @@ -1553,13 +1594,14 @@ pmap_remove(pmap_t pmap, vm_offset_t sva * inefficient because they iteratively called * pmap_remove (slow...) */ - void pmap_remove_all(vm_page_t m) { pmap_t oldpmap; pv_entry_t pv; + CTR2(KTR_PMAP, "%s(m=%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); rw_wlock(&pvh_global_lock); @@ -1592,6 +1634,9 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pmap_t oldpmap; struct ia64_lpte *pte; + CTR5(KTR_PMAP, "%s(pm=%p, sva=%#lx, eva=%#lx, prot=%#x)", __func__, + pmap, sva, eva, prot); + if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; @@ -1658,6 +1703,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, struct ia64_lpte *pte; boolean_t icache_inval, managed; + CTR6(KTR_PMAP, "pmap_enter(pm=%p, va=%#lx, acc=%#x, m=%p, prot=%#x, " + "wired=%u)", pmap, va, access, m, prot, wired); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); @@ -1789,6 +1837,9 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m; vm_pindex_t diff, psize; + CTR6(KTR_PMAP, "%s(pm=%p, sva=%#lx, eva=%#lx, m=%p, prot=%#x)", + __func__, pmap, start, end, m_start, prot); + VM_OBJECT_ASSERT_LOCKED(m_start->object); psize = atop(end - start); @@ -1813,12 +1864,14 @@ pmap_enter_object(pmap_t pmap, vm_offset * 4. No page table pages. * but is *MUCH* faster than pmap_enter... */ - void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { pmap_t oldpmap; + CTR5(KTR_PMAP, "%s(pm=%p, va=%#lx, m=%p, prot=%#x)", __func__, pmap, + va, m, prot); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); @@ -1876,11 +1929,13 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ * faults on process startup and immediately after an mmap. */ void -pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, - vm_object_t object, vm_pindex_t pindex, - vm_size_t size) +pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object, + vm_pindex_t pindex, vm_size_t size) { + CTR6(KTR_PMAP, "%s(pm=%p, va=%#lx, obj=%p, idx=%lu, sz=%#lx)", + __func__, pmap, addr, object, pindex, size); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); @@ -1894,14 +1949,14 @@ pmap_object_init_pt(pmap_t pmap, vm_offs * The mapping must already exist in the pmap. */ void -pmap_change_wiring(pmap, va, wired) - register pmap_t pmap; - vm_offset_t va; - boolean_t wired; +pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) { pmap_t oldpmap; struct ia64_lpte *pte; + CTR4(KTR_PMAP, "%s(pm=%p, va=%#lx, wired=%u)", __func__, pmap, va, + wired); + PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); @@ -1919,8 +1974,6 @@ pmap_change_wiring(pmap, va, wired) PMAP_UNLOCK(pmap); } - - /* * Copy the range specified by src_addr/len * from the source map to the range dst_addr/len @@ -1928,30 +1981,31 @@ pmap_change_wiring(pmap, va, wired) * * This routine is only advisory and need not do anything. */ - void -pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, - vm_offset_t src_addr) +pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_va, vm_size_t len, + vm_offset_t src_va) { -} + CTR6(KTR_PMAP, "%s(dpm=%p, spm=%p, dva=%#lx, sz=%#lx, sva=%#lx)", + __func__, dst_pmap, src_pmap, dst_va, len, src_va); +} /* * pmap_zero_page zeros the specified hardware page by * mapping it into virtual memory and using bzero to clear * its contents. */ - void pmap_zero_page(vm_page_t m) { void *p; + CTR2(KTR_PMAP, "%s(m=%p)", __func__, m); + p = (void *)pmap_page_to_va(m); bzero(p, PAGE_SIZE); } - /* * pmap_zero_page_area zeros the specified hardware page by * mapping it into virtual memory and using bzero to clear @@ -1959,33 +2013,33 @@ pmap_zero_page(vm_page_t m) * * off and size must reside within a single page. */ - void pmap_zero_page_area(vm_page_t m, int off, int size) { char *p; + CTR4(KTR_PMAP, "%s(m=%p, ofs=%d, len=%d)", __func__, m, off, size); + p = (void *)pmap_page_to_va(m); bzero(p + off, size); } - /* * pmap_zero_page_idle zeros the specified hardware page by * mapping it into virtual memory and using bzero to clear * its contents. This is for the vm_idlezero process. */ - void pmap_zero_page_idle(vm_page_t m) { void *p; + CTR2(KTR_PMAP, "%s(m=%p)", __func__, m); + p = (void *)pmap_page_to_va(m); bzero(p, PAGE_SIZE); } - /* * pmap_copy_page copies the specified (machine independent) * page by mapping the page into virtual memory and using @@ -1997,13 +2051,13 @@ pmap_copy_page(vm_page_t msrc, vm_page_t { void *dst, *src; + CTR3(KTR_PMAP, "%s(sm=%p, dm=%p)", __func__, msrc, mdst); + src = (void *)pmap_page_to_va(msrc); dst = (void *)pmap_page_to_va(mdst); bcopy(src, dst, PAGE_SIZE); } -int unmapped_buf_allowed; - void pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], vm_offset_t b_offset, int xfersize) @@ -2012,6 +2066,9 @@ pmap_copy_pages(vm_page_t ma[], vm_offse vm_offset_t a_pg_offset, b_pg_offset; int cnt; + CTR6(KTR_PMAP, "%s(m0=%p, va0=%#lx, m1=%p, va1=%#lx, sz=%#x)", + __func__, ma, a_offset, mb, b_offset, xfersize); + while (xfersize > 0) { a_pg_offset = a_offset & PAGE_MASK; cnt = min(xfersize, PAGE_SIZE - a_pg_offset); @@ -2042,6 +2099,8 @@ pmap_page_exists_quick(pmap_t pmap, vm_p int loops = 0; boolean_t rv; + CTR3(KTR_PMAP, "%s(pm=%p, m=%p)", __func__, pmap, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; @@ -2073,6 +2132,8 @@ pmap_page_wired_mappings(vm_page_t m) pv_entry_t pv; int count; + CTR2(KTR_PMAP, "%s(m=%p)", __func__, m); + count = 0; if ((m->oflags & VPO_UNMANAGED) != 0) return (count); @@ -2112,6 +2173,8 @@ pmap_remove_pages(pmap_t pmap) u_long inuse, bitmask; int allfree, bit, field, idx; + CTR2(KTR_PMAP, "%s(pm=%p)", __func__, pmap); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); @@ -2179,6 +2242,8 @@ pmap_ts_referenced(vm_page_t m) pv_entry_t pv; int count = 0; + CTR2(KTR_PMAP, "%s(m=%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); rw_wlock(&pvh_global_lock); @@ -2214,6 +2279,8 @@ pmap_is_modified(vm_page_t m) pv_entry_t pv; boolean_t rv; + CTR2(KTR_PMAP, "%s(m=%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_modified: page %p is not managed", m)); rv = FALSE; @@ -2254,6 +2321,8 @@ pmap_is_prefaultable(pmap_t pmap, vm_off { struct ia64_lpte *pte; + CTR3(KTR_PMAP, "%s(pm=%p, va=%#lx)", __func__, pmap, addr); + pte = pmap_find_vhpt(addr); if (pte != NULL && pmap_present(pte)) return (FALSE); @@ -2274,6 +2343,8 @@ pmap_is_referenced(vm_page_t m) pv_entry_t pv; boolean_t rv; + CTR2(KTR_PMAP, "%s(m=%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); rv = FALSE; @@ -2306,6 +2377,9 @@ pmap_advise(pmap_t pmap, vm_offset_t sva pmap_t oldpmap; vm_page_t m; + CTR5(KTR_PMAP, "%s(pm=%p, sva=%#lx, eva=%#lx, adv=%d)", __func__, + pmap, sva, eva, advice); + PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); for (; sva < eva; sva += PAGE_SIZE) { @@ -2348,6 +2422,8 @@ pmap_clear_modify(vm_page_t m) pmap_t oldpmap, pmap; pv_entry_t pv; + CTR2(KTR_PMAP, "%s(m=%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_ASSERT_WLOCKED(m->object); @@ -2389,6 +2465,8 @@ pmap_remove_write(vm_page_t m) pv_entry_t pv; vm_prot_t prot; + CTR2(KTR_PMAP, "%s(m=%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); @@ -2425,20 +2503,13 @@ pmap_remove_write(vm_page_t m) rw_wunlock(&pvh_global_lock); } -/* - * Map a set of physical memory pages into the kernel virtual - * address space. Return a pointer to where it is mapped. This - * routine is intended to be used for mapping device memory, - * NOT real memory. - */ -void * -pmap_mapdev(vm_paddr_t pa, vm_size_t sz) +vm_offset_t +pmap_mapdev_priv(vm_paddr_t pa, vm_size_t sz, vm_memattr_t attr) { - static void *last_va = NULL; - static vm_paddr_t last_pa = 0; + static vm_offset_t last_va = 0; + static vm_paddr_t last_pa = ~0UL; static vm_size_t last_sz = 0; struct efi_md *md; - vm_offset_t va; if (pa == last_pa && sz == last_sz) return (last_va); @@ -2447,30 +2518,48 @@ pmap_mapdev(vm_paddr_t pa, vm_size_t sz) if (md == NULL) { printf("%s: [%#lx..%#lx] not covered by memory descriptor\n", __func__, pa, pa + sz - 1); - return ((void *)IA64_PHYS_TO_RR6(pa)); + return (IA64_PHYS_TO_RR6(pa)); } if (md->md_type == EFI_MD_TYPE_FREE) { printf("%s: [%#lx..%#lx] is in DRAM\n", __func__, pa, pa + sz - 1); - return (NULL); + return (0); } - va = (md->md_attr & EFI_MD_ATTR_WB) ? IA64_PHYS_TO_RR7(pa) : + last_va = (md->md_attr & EFI_MD_ATTR_WB) ? IA64_PHYS_TO_RR7(pa) : IA64_PHYS_TO_RR6(pa); - - last_va = (void *)va; last_pa = pa; last_sz = sz; return (last_va); } /* - * 'Unmap' a range mapped by pmap_mapdev(). + * Map a set of physical memory pages into the kernel virtual + * address space. Return a pointer to where it is mapped. This + * routine is intended to be used for mapping device memory, + * NOT real memory. + */ +void * +pmap_mapdev_attr(vm_paddr_t pa, vm_size_t sz, vm_memattr_t attr) +{ + vm_offset_t va; + + CTR4(KTR_PMAP, "%s(pa=%#lx, sz=%#lx, attr=%#x)", __func__, pa, sz, + attr); + + va = pmap_mapdev_priv(pa, sz, attr); + return ((void *)(uintptr_t)va); +} + +/* + * 'Unmap' a range mapped by pmap_mapdev_attr(). */ void pmap_unmapdev(vm_offset_t va, vm_size_t size) { + + CTR3(KTR_PMAP, "%s(va=%#lx, sz=%#lx)", __func__, va, size); } /* @@ -2496,6 +2585,8 @@ pmap_page_set_memattr(vm_page_t m, vm_me pv_entry_t pv; void *va; + CTR3(KTR_PMAP, "%s(m=%p, attr=%#x)", __func__, m, ma); + rw_wlock(&pvh_global_lock); m->md.memattr = ma; TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -2542,6 +2633,9 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad vm_paddr_t pa; int val; + CTR4(KTR_PMAP, "%s(pm=%p, va=%#lx, pa_p=%p)", __func__, pmap, addr, + locked_pa); + PMAP_LOCK(pmap); retry: oldpmap = pmap_switch(pmap); @@ -2574,9 +2668,15 @@ out: return (val); } +/* + * + */ void pmap_activate(struct thread *td) { + + CTR2(KTR_PMAP, "%s(td=%p)", __func__, td); + pmap_switch(vmspace_pmap(td->td_proc->p_vmspace)); } @@ -2609,6 +2709,9 @@ out: return (prevpm); } +/* + * + */ void pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) { @@ -2617,6 +2720,8 @@ pmap_sync_icache(pmap_t pm, vm_offset_t vm_offset_t lim; vm_size_t len; + CTR4(KTR_PMAP, "%s(pm=%p, va=%#lx, sz=%#lx)", __func__, pm, va, sz); + sz += va & 31; va &= ~31; sz = (sz + 31) & ~31; @@ -2644,6 +2749,9 @@ void pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, vm_size_t size) { + + CTR5(KTR_PMAP, "%s(obj=%p, ofs=%#lx, va_p=%p, sz=%#lx)", __func__, + object, offset, addr, size); } #include "opt_ddb.h" Modified: stable/10/sys/ia64/include/pmap.h ============================================================================== --- stable/10/sys/ia64/include/pmap.h Wed Jul 2 23:47:43 2014 (r268200) +++ stable/10/sys/ia64/include/pmap.h Wed Jul 2 23:57:55 2014 (r268201) @@ -114,24 +114,29 @@ extern vm_offset_t virtual_end; extern uint64_t pmap_vhpt_base[]; extern int pmap_vhpt_log2size; +#define pmap_mapbios(pa,sz) pmap_mapdev_attr(pa,sz,VM_MEMATTR_UNCACHEABLE) +#define pmap_mapdev(pa,sz) pmap_mapdev_attr(pa,sz,VM_MEMATTR_UNCACHEABLE) +#define pmap_unmapbios(va,sz) pmap_unmapdev(va,sz) + #define pmap_page_get_memattr(m) ((m)->md.memattr) -#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) -#define pmap_mapbios(pa, sz) pmap_mapdev(pa, sz) -#define pmap_unmapbios(va, sz) pmap_unmapdev(va, sz) -vm_offset_t pmap_alloc_vhpt(void); -void pmap_bootstrap(void); -void pmap_invalidate_all(void); -void pmap_kenter(vm_offset_t va, vm_offset_t pa); +void pmap_kenter(vm_offset_t va, vm_paddr_t pa); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); -void *pmap_mapdev(vm_paddr_t, vm_size_t); +void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, vm_memattr_t); void pmap_page_set_memattr(vm_page_t, vm_memattr_t); +void pmap_unmapdev(vm_offset_t, vm_size_t); + +/* Machine-architecture private */ +vm_offset_t pmap_alloc_vhpt(void); +void pmap_bootstrap(void); +void pmap_invalidate_all(void); +vm_offset_t pmap_mapdev_priv(vm_paddr_t, vm_size_t, vm_memattr_t); vm_offset_t pmap_page_to_va(vm_page_t); vm_offset_t pmap_steal_memory(vm_size_t); struct pmap *pmap_switch(struct pmap *pmap); -void pmap_unmapdev(vm_offset_t, vm_size_t); #endif /* _KERNEL */ From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 3 06:44:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AF503145; Thu, 3 Jul 2014 06:44: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 8236F21F9; Thu, 3 Jul 2014 06:44: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 s636iuPN069333; Thu, 3 Jul 2014 06:44:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s636itKK069329; Thu, 3 Jul 2014 06:44:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407030644.s636itKK069329@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 3 Jul 2014 06:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268206 - in stable/10/sys/dev/usb: net serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2014 06:44:56 -0000 Author: hselasky Date: Thu Jul 3 06:44:55 2014 New Revision: 268206 URL: http://svnweb.freebsd.org/changeset/base/268206 Log: MFC r268078 and r268080: Fix for memory use after free() and mtx_destroy(). Modified: stable/10/sys/dev/usb/net/uhso.c stable/10/sys/dev/usb/serial/usb_serial.c stable/10/sys/dev/usb/serial/usb_serial.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/uhso.c ============================================================================== --- stable/10/sys/dev/usb/net/uhso.c Thu Jul 3 05:22:13 2014 (r268205) +++ stable/10/sys/dev/usb/net/uhso.c Thu Jul 3 06:44:55 2014 (r268206) @@ -558,8 +558,6 @@ uhso_attach(device_t self) mtx_init(&sc->sc_mtx, "uhso", NULL, MTX_DEF); ucom_ref(&sc->sc_super_ucom); - sc->sc_ucom = NULL; - sc->sc_ttys = 0; sc->sc_radio = 1; id = usbd_get_interface_descriptor(uaa->iface); @@ -679,9 +677,6 @@ uhso_detach(device_t self) UHSO_CTRL_MAX); } } - - free(sc->sc_tty, M_USBDEV); - free(sc->sc_ucom, M_USBDEV); } if (sc->sc_ifp != NULL) { @@ -709,6 +704,8 @@ static void uhso_free_softc(struct uhso_softc *sc) { if (ucom_unref(&sc->sc_super_ucom)) { + free(sc->sc_tty, M_USBDEV); + free(sc->sc_ucom, M_USBDEV); mtx_destroy(&sc->sc_mtx); device_free_softc(sc); } Modified: stable/10/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/10/sys/dev/usb/serial/usb_serial.c Thu Jul 3 05:22:13 2014 (r268205) +++ stable/10/sys/dev/usb/serial/usb_serial.c Thu Jul 3 06:44:55 2014 (r268206) @@ -203,7 +203,7 @@ ucom_uninit(void *arg) mtx_destroy(&ucom_mtx); } -SYSUNINIT(ucom_uninit, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_uninit, NULL); +SYSUNINIT(ucom_uninit, SI_SUB_KLD - 3, SI_ORDER_ANY, ucom_uninit, NULL); /* * Mark a unit number (the X in cuaUX) as in use. Modified: stable/10/sys/dev/usb/serial/usb_serial.h ============================================================================== --- stable/10/sys/dev/usb/serial/usb_serial.h Thu Jul 3 05:22:13 2014 (r268205) +++ stable/10/sys/dev/usb/serial/usb_serial.h Thu Jul 3 06:44:55 2014 (r268206) @@ -195,7 +195,7 @@ struct ucom_softc { #define UCOM_MTX_LOCK(sc) mtx_lock((sc)->sc_mtx) #define UCOM_MTX_UNLOCK(sc) mtx_unlock((sc)->sc_mtx) #define UCOM_UNLOAD_DRAIN(x) \ -SYSUNINIT(var, SI_SUB_KLD - 3, SI_ORDER_ANY, ucom_drain_all, 0) +SYSUNINIT(var, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_drain_all, 0) #define ucom_cfg_do_request(udev,com,req,ptr,flags,timo) \ usbd_do_request_proc(udev,&(com)->sc_super->sc_tq,req,ptr,flags,NULL,timo) From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 3 10:59:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 7B2FE8AF; Thu, 3 Jul 2014 10:59: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 4D57E2928; Thu, 3 Jul 2014 10:59:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63Axh1I085955; Thu, 3 Jul 2014 10:59:43 GMT (envelope-from daichi@svn.freebsd.org) Received: (from daichi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63AxhfH085954; Thu, 3 Jul 2014 10:59:43 GMT (envelope-from daichi@svn.freebsd.org) Message-Id: <201407031059.s63AxhfH085954@svn.freebsd.org> From: Daichi GOTO Date: Thu, 3 Jul 2014 10:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268210 - stable/10/sys/dev/glxiic X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2014 10:59:43 -0000 Author: daichi (ports committer) Date: Thu Jul 3 10:59:42 2014 New Revision: 268210 URL: http://svnweb.freebsd.org/changeset/base/268210 Log: MFC: r267852 Fixed an IIC timing issue between the glxiic master and a slave of peripheral devices. When transmitting (rx) from slave to master, sometimes nAKC delays. As a result, some slaves fails their transmission. Submitted by: Masanori OZAWA Reviewed by: brix Modified: stable/10/sys/dev/glxiic/glxiic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/glxiic/glxiic.c ============================================================================== --- stable/10/sys/dev/glxiic/glxiic.c Thu Jul 3 10:49:46 2014 (r268209) +++ stable/10/sys/dev/glxiic/glxiic.c Thu Jul 3 10:59:42 2014 (r268210) @@ -711,6 +711,7 @@ static int glxiic_state_master_addr_callback(struct glxiic_softc *sc, uint8_t status) { uint8_t slave; + uint8_t ctrl1; GLXIIC_ASSERT_LOCKED(sc); @@ -746,6 +747,13 @@ glxiic_state_master_addr_callback(struct bus_write_1(sc->smb_res, GLXIIC_SMB_SDA, slave); + if ((sc->msg->flags & IIC_M_RD) != 0 && sc->ndata == 1) { + /* Last byte from slave, set NACK. */ + ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1); + bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1, + ctrl1 | GLXIIC_SMB_CTRL1_ACK_BIT); + } + return (IIC_NOERR); } @@ -811,13 +819,6 @@ glxiic_state_master_rx_callback(struct g return (IIC_ENOACK); } - if (sc->ndata == 1) { - /* Last byte from slave, set NACK. */ - ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1); - bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1, - ctrl1 | GLXIIC_SMB_CTRL1_ACK_BIT); - } - if ((status & GLXIIC_SMB_STS_STASTR_BIT) != 0) { /* Bus is stalled, clear and wait for data. */ bus_write_1(sc->smb_res, GLXIIC_SMB_STS, @@ -837,6 +838,13 @@ glxiic_state_master_rx_callback(struct g return (glxiic_state_table[sc->state].callback(sc, status)); } + if (sc->ndata == 1) { + /* Last byte from slave, set NACK. */ + ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1); + bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1, + ctrl1 | GLXIIC_SMB_CTRL1_ACK_BIT); + } + glxiic_start_timeout_locked(sc); return (IIC_NOERR); From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 3 15:56:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1E74C412; Thu, 3 Jul 2014 15:56: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 F1C9C27C2; Thu, 3 Jul 2014 15:56: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 s63FuU3X027910; Thu, 3 Jul 2014 15:56:30 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63FuUCr027909; Thu, 3 Jul 2014 15:56:30 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201407031556.s63FuUCr027909@svn.freebsd.org> From: Hajimu UMEMOTO Date: Thu, 3 Jul 2014 15:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268216 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2014 15:56:31 -0000 Author: ume Date: Thu Jul 3 15:56:30 2014 New Revision: 268216 URL: http://svnweb.freebsd.org/changeset/base/268216 Log: MFC r267912, r267915: - Exclude loopback address rather than loopback interface. - style(9) Spotted by: melifaro Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Thu Jul 3 13:51:10 2014 (r268215) +++ stable/10/lib/libc/net/getaddrinfo.c Thu Jul 3 15:56:30 2014 (r268216) @@ -1532,7 +1532,7 @@ find_afd(int af) } /* - * post-2553: AI_ADDRCONFIG check. Determines which address families are + * RFC 3493: AI_ADDRCONFIG check. Determines which address families are * configured on the local system and correlates with pai->ai_family value. * If an address family is not configured on the system, it will not be * queried for. For this purpose, loopback addresses are not considered @@ -1545,24 +1545,40 @@ static int addrconfig(struct addrinfo *pai) { struct ifaddrs *ifaddrs, *ifa; + struct sockaddr_in *sin; +#ifdef INET6 + struct sockaddr_in6 *sin6; +#endif int seen_inet = 0, seen_inet6 = 0; if (getifaddrs(&ifaddrs) != 0) - return 0; + return (0); for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { if (ifa->ifa_addr == NULL || (ifa->ifa_flags & IFF_UP) == 0) continue; - if ((ifa->ifa_flags & IFT_LOOP) != 0) - continue; switch (ifa->ifa_addr->sa_family) { case AF_INET: + if (seen_inet) + continue; + sin = (struct sockaddr_in *)(ifa->ifa_addr); + if (IN_LOOPBACK(htonl(sin->sin_addr.s_addr))) + continue; seen_inet = 1; break; #ifdef INET6 case AF_INET6: - if (!seen_inet6 && !is_ifdisabled(ifa->ifa_name)) - seen_inet6 = 1; + if (seen_inet6) + continue; + sin6 = (struct sockaddr_in6 *)(ifa->ifa_addr); + if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) + continue; + if ((ifa->ifa_flags & IFT_LOOP) != 0 && + IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) + continue; + if (is_ifdisabled(ifa->ifa_name)) + continue; + seen_inet6 = 1; break; #endif } @@ -1571,16 +1587,16 @@ addrconfig(struct addrinfo *pai) switch(pai->ai_family) { case AF_INET6: - return seen_inet6; + return (seen_inet6); case AF_INET: - return seen_inet; + return (seen_inet); case AF_UNSPEC: if (seen_inet == seen_inet6) - return seen_inet; + return (seen_inet); pai->ai_family = seen_inet ? AF_INET : AF_INET6; - return 1; + return (1); } - return 1; + return (1); } #ifdef INET6 @@ -1591,12 +1607,12 @@ is_ifdisabled(char *name) int fd; if ((fd = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) - return -1; + return (-1); memset(&nd, 0, sizeof(nd)); strlcpy(nd.ifname, name, sizeof(nd.ifname)); if (_ioctl(fd, SIOCGIFINFO_IN6, &nd) < 0) { _close(fd); - return -1; + return (-1); } _close(fd); return ((nd.ndi.flags & ND6_IFF_IFDISABLED) != 0); From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 3 16:13:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BAB44529; Thu, 3 Jul 2014 16:13: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 9C02929FE; Thu, 3 Jul 2014 16:13: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 s63GDim2038424; Thu, 3 Jul 2014 16:13:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63GDiCW038423; Thu, 3 Jul 2014 16:13:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407031613.s63GDiCW038423@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 3 Jul 2014 16:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268219 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2014 16:13:44 -0000 Author: hselasky Date: Thu Jul 3 16:13:44 2014 New Revision: 268219 URL: http://svnweb.freebsd.org/changeset/base/268219 Log: MFC r267955 and r268209: - Add proper rangechecks in "axge_rx_frame()" function and fix receive loop header parsing. - Disable hardware checksumming until it is properly tested. PR: 191432 Modified: stable/10/sys/dev/usb/net/if_axge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_axge.c ============================================================================== --- stable/10/sys/dev/usb/net/if_axge.c Thu Jul 3 16:01:30 2014 (r268218) +++ stable/10/sys/dev/usb/net/if_axge.c Thu Jul 3 16:13:44 2014 (r268219) @@ -123,8 +123,8 @@ static int axge_attach_post_sub(struct u static int axge_ifmedia_upd(struct ifnet *); static void axge_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int axge_ioctl(struct ifnet *, u_long, caddr_t); -static int axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int); -static int axge_rxeof(struct usb_ether *, struct usb_page_cache *, +static void axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int); +static void axge_rxeof(struct usb_ether *, struct usb_page_cache *, unsigned int, unsigned int, uint32_t); static void axge_csum_cfg(struct usb_ether *); @@ -605,8 +605,7 @@ axge_bulk_read_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: pc = usbd_xfer_get_frame(xfer, 0); - if (axge_rx_frame(ue, pc, actlen) != 0) - goto tr_setup; + axge_rx_frame(ue, pc, actlen); /* FALLTHROUGH */ case USB_ST_SETUP: @@ -926,18 +925,21 @@ axge_ioctl(struct ifnet *ifp, u_long cmd return (error); } -static int +static void axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) { - int error, pos; - int pkt_cnt; - uint32_t rxhdr, pkt_hdr; - uint16_t hdr_off; - uint16_t len, pktlen; + uint32_t pos; + uint32_t pkt_cnt; + uint32_t rxhdr; + uint32_t pkt_hdr; + uint32_t hdr_off; + uint32_t pktlen; + + /* verify we have enough data */ + if (actlen < (int)sizeof(rxhdr)) + return; pos = 0; - len = 0; - error = 0; usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr)); rxhdr = le32toh(rxhdr); @@ -945,31 +947,36 @@ axge_rx_frame(struct usb_ether *ue, stru pkt_cnt = (uint16_t)rxhdr; hdr_off = (uint16_t)(rxhdr >> 16); - usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr)); - - while (pkt_cnt > 0) { - if ((int)(sizeof(pkt_hdr)) > actlen) { - error = EINVAL; + while (pkt_cnt--) { + /* verify the header offset */ + if ((int)(hdr_off + sizeof(pkt_hdr)) > actlen) { + DPRINTF("End of packet headers\n"); + break; + } + if ((int)pos >= actlen) { + DPRINTF("Data position reached end\n"); break; } + usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr)); + pkt_hdr = le32toh(pkt_hdr); pktlen = (pkt_hdr >> 16) & 0x1fff; - if ((pkt_hdr & AXGE_RXHDR_CRC_ERR) || - (pkt_hdr & AXGE_RXHDR_DROP_ERR)) + if (pkt_hdr & (AXGE_RXHDR_CRC_ERR | AXGE_RXHDR_DROP_ERR)) { + DPRINTF("Dropped a packet\n"); ue->ue_ifp->if_ierrors++; - axge_rxeof(ue, pc, pos + 2, pktlen - 6, pkt_hdr); - len = (pktlen + 7) & ~7; - pos += len; - pkt_hdr++; - pkt_cnt--; + } + if (pktlen >= 2 && (int)(pos + pktlen) <= actlen) { + axge_rxeof(ue, pc, pos + 2, pktlen - 2, pkt_hdr); + } else { + DPRINTF("Invalid packet pos=%d len=%d\n", + (int)pos, (int)pktlen); + } + pos += (pktlen + 7) & ~7; + hdr_off += sizeof(pkt_hdr); } - - if (error != 0) - ue->ue_ifp->if_ierrors++; - return (error); } -static int +static void axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, unsigned int offset, unsigned int len, uint32_t pkt_hdr) { @@ -979,37 +986,34 @@ axge_rxeof(struct usb_ether *ue, struct ifp = ue->ue_ifp; if (len < ETHER_HDR_LEN || len > MCLBYTES - ETHER_ALIGN) { ifp->if_ierrors++; - return (EINVAL); + return; } m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { ifp->if_iqdrops++; - return (ENOMEM); + return; } - m->m_len = m->m_pkthdr.len = MCLBYTES; + m->m_pkthdr.rcvif = ifp; + m->m_len = m->m_pkthdr.len = len + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset, mtod(m, uint8_t *), len); ifp->if_ipackets++; - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = m->m_len = len; - +#if 0 if ((pkt_hdr & (AXGE_RXHDR_L4CSUM_ERR | AXGE_RXHDR_L3CSUM_ERR)) == 0) { - m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | CSUM_IP_VALID; if ((pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == AXGE_RXHDR_L4_TYPE_TCP || (pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == AXGE_RXHDR_L4_TYPE_UDP) { m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | - CSUM_PSEUDO_HDR; + CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; m->m_pkthdr.csum_data = 0xffff; } } - +#endif _IF_ENQUEUE(&ue->ue_rxq, m); - return (0); } static void From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 3 16:20:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 15136D60 for ; Thu, 3 Jul 2014 16:20:45 +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 DC23D2A84 for ; Thu, 3 Jul 2014 16:20:44 +0000 (UTC) Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 1013E22256 for ; Thu, 3 Jul 2014 12:20:41 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Thu, 03 Jul 2014 12:20:41 -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=8tmGp7gXkuLW2OC1qy0wKGxAfuY=; b=O+I+Hw98oKnv/Th9FlSb/EFTx3k1 xIuJh4j53dIsPVuT94boyQ9qt8N0r+4U1s+Bz1Kc5cVb58HHNXLuDaYbOiMT1O2d VdRLVto+FMo0kI/LKzso4TV++ULOcI6aLQsLQyAd7aNpXD2sEpHe06UA5KorC7qy JijOCUvjB68XQHY= 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=8tmGp7gXkuLW2OC1qy0wKG xAfuY=; b=hvtWWwguePzodcjpQQzyZ4fiaMHSxoDU7ePsH059PQXlOa2oIjGOmL 5VeEbY3/HjGPrTD6oycrEQW5rbP/Xxi9AVzMVh6VZt5bxKTxCNDh9jcoO7nYZABo ko7M6IjH2Ia9oT0uOXcIFkQJ4AjIKQoV627sM20SD3ylQt4rpRjuM= X-Sasl-enc: gTmrYg4t+n1+b91eBJLefERHApRv+75TK3OSlksdMm+m 1404404440 Received: from [192.168.1.66] (unknown [86.136.6.163]) by mail.messagingengine.com (Postfix) with ESMTPA id 4871FC00003; Thu, 3 Jul 2014 12:20:40 -0400 (EDT) Message-ID: <53B582D7.9010901@fastmail.net> Date: Thu, 03 Jul 2014 17:20:39 +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: Daichi GOTO , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r268210 - stable/10/sys/dev/glxiic References: <201407031059.s63AxhfH085954@svn.freebsd.org> In-Reply-To: <201407031059.s63AxhfH085954@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2014 16:20:46 -0000 Daichi-san, Just FYI: I could not get IIC to work with the glxiic(4) driver in tree on my PC Engines ALIX 6D2, although this driver [1] appears to work. Tested with a Dallas Semiconductor DS1337 RTC module some time ago. Bruce [1] http://www.phisch.org/website/glxiic/ From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 3 17:35:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B3BCC49B; Thu, 3 Jul 2014 17:35: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 A06AA21BB; Thu, 3 Jul 2014 17:35: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 s63HZ2BY078869; Thu, 3 Jul 2014 17:35:02 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63HZ2Ch078867; Thu, 3 Jul 2014 17:35:02 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407031735.s63HZ2Ch078867@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 3 Jul 2014 17:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268223 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2014 17:35:02 -0000 Author: pluknet Date: Thu Jul 3 17:35:01 2014 New Revision: 268223 URL: http://svnweb.freebsd.org/changeset/base/268223 Log: MFC r267909: Document EINVAL. PR: 191382 Modified: stable/10/lib/libc/sys/bind.2 stable/10/lib/libc/sys/connect.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/bind.2 ============================================================================== --- stable/10/lib/libc/sys/bind.2 Thu Jul 3 16:34:01 2014 (r268222) +++ stable/10/lib/libc/sys/bind.2 Thu Jul 3 17:35:01 2014 (r268223) @@ -28,7 +28,7 @@ .\" @(#)bind.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd June 26, 2014 .Dt BIND 2 .Os .Sh NAME @@ -85,6 +85,10 @@ is not a valid descriptor. .It Bq Er EINVAL The socket is already bound to an address, and the protocol does not support binding to a new address; or the socket has been shut down. +.It Bq Er EINVAL +The +.Fa addrlen +argument is not a valid length for the address family. .It Bq Er ENOTSOCK The .Fa s Modified: stable/10/lib/libc/sys/connect.2 ============================================================================== --- stable/10/lib/libc/sys/connect.2 Thu Jul 3 16:34:01 2014 (r268222) +++ stable/10/lib/libc/sys/connect.2 Thu Jul 3 17:35:01 2014 (r268223) @@ -28,7 +28,7 @@ .\" @(#)connect.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 5, 2010 +.Dd June 26, 2014 .Dt CONNECT 2 .Os .Sh NAME @@ -80,6 +80,10 @@ The .Fa s argument is not a valid descriptor. +.It Bq Er EINVAL +The +.Fa namelen +argument is not a valid length for the address family. .It Bq Er ENOTSOCK The .Fa s From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 4 06:03:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EE0BD197; Fri, 4 Jul 2014 06:03: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 DAA1121E2; Fri, 4 Jul 2014 06:03: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 s6463sNa042863; Fri, 4 Jul 2014 06:03:54 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6463sn0042862; Fri, 4 Jul 2014 06:03:54 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407040603.s6463sn0042862@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 4 Jul 2014 06:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268243 - stable/10/sbin/sysctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 06:03:55 -0000 Author: hselasky Date: Fri Jul 4 06:03:54 2014 New Revision: 268243 URL: http://svnweb.freebsd.org/changeset/base/268243 Log: MFC r267960: Don't hide zero-length strings when doing sysctl listings. Modified: stable/10/sbin/sysctl/sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/sysctl/sysctl.c ============================================================================== --- stable/10/sbin/sysctl/sysctl.c Fri Jul 4 04:47:29 2014 (r268242) +++ stable/10/sbin/sysctl/sysctl.c Fri Jul 4 06:03:54 2014 (r268243) @@ -710,9 +710,10 @@ show_var(int *oid, int nlen) warnx("malloc failed"); return (1); } + ctltype = (kind & CTLTYPE); len = j; i = sysctl(oid, nlen, val, &len, 0, 0); - if (i || !len) { + if (i != 0 || (len == 0 && ctltype != CTLTYPE_STRING)) { free(oval); return (1); } @@ -724,7 +725,6 @@ show_var(int *oid, int nlen) } val[len] = '\0'; p = val; - ctltype = (kind & CTLTYPE); sign = ctl_sign[ctltype]; intlen = ctl_size[ctltype]; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 4 13:57:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 60788999; Fri, 4 Jul 2014 13:57: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 4CD102CF7; Fri, 4 Jul 2014 13:57: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 s64DvxDS072823; Fri, 4 Jul 2014 13:57:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64Dvxg2072822; Fri, 4 Jul 2014 13:57:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201407041357.s64Dvxg2072822@svn.freebsd.org> From: Marius Strobl Date: Fri, 4 Jul 2014 13:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268250 - stable/10/sys/dev/ata/chipsets X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 13:57:59 -0000 Author: marius Date: Fri Jul 4 13:57:58 2014 New Revision: 268250 URL: http://svnweb.freebsd.org/changeset/base/268250 Log: MFC: r268095 Actually pro AMD chipsets, making r244146 work. Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: stable/10/sys/dev/ata/chipsets/ata-ati.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- stable/10/sys/dev/ata/chipsets/ata-ati.c Fri Jul 4 09:34:24 2014 (r268249) +++ stable/10/sys/dev/ata/chipsets/ata-ati.c Fri Jul 4 13:57:58 2014 (r268250) @@ -98,7 +98,7 @@ ata_ati_probe(device_t dev) { ATA_AMD_HUDSON2_S5, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, { 0, 0, 0, 0, 0, 0}}; - if (pci_get_vendor(dev) != ATA_ATI_ID) + if (pci_get_vendor(dev) != ATA_AMD_ID && pci_get_vendor(dev) != ATA_ATI_ID) return ENXIO; if (!(ctlr->chip = ata_match_chip(dev, ids))) From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 4 15:09:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 27DADB17; Fri, 4 Jul 2014 15:09: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 EEB7B2320; Fri, 4 Jul 2014 15:09: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 s64F9usv008368; Fri, 4 Jul 2014 15:09:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64F9uLg008365; Fri, 4 Jul 2014 15:09:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407041509.s64F9uLg008365@svn.freebsd.org> From: Alexander Motin Date: Fri, 4 Jul 2014 15:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268255 - in stable/10/sys: cam/scsi compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 15:09:57 -0000 Author: mav Date: Fri Jul 4 15:09:56 2014 New Revision: 268255 URL: http://svnweb.freebsd.org/changeset/base/268255 Log: MFC r267051: - Add support for SG_GET_SG_TABLESIZE IOCTL to report that we don't support scatter/gather lists. - Return error for still unsupported SG 3.x API read/write calls. Modified: stable/10/sys/cam/scsi/scsi_sg.c stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sg.c Fri Jul 4 14:49:40 2014 (r268254) +++ stable/10/sys/cam/scsi/scsi_sg.c Fri Jul 4 15:09:56 2014 (r268255) @@ -627,6 +627,13 @@ sgioctl(struct cdev *dev, u_long cmd, ca break; } + case SG_GET_SG_TABLESIZE: + { + int *size = (int *)arg; + *size = 0; + break; + } + case SG_EMULATED_HOST: case SG_SET_TRANSFORM: case SG_GET_TRANSFORM: @@ -638,7 +645,6 @@ sgioctl(struct cdev *dev, u_long cmd, ca case SG_GET_ACCESS_COUNT: case SG_SET_FORCE_LOW_DMA: case SG_GET_LOW_DMA: - case SG_GET_SG_TABLESIZE: case SG_SET_FORCE_PACK_ID: case SG_GET_PACK_ID: case SG_SET_RESERVED_SIZE: @@ -684,6 +690,12 @@ sgwrite(struct cdev *dev, struct uio *ui if (error) goto out_hdr; + /* XXX: We don't support SG 3.x read/write API. */ + if (hdr->reply_len < 0) { + error = ENODEV; + goto out_hdr; + } + ccb = xpt_alloc_ccb(); if (ccb == NULL) { error = ENOMEM; Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Fri Jul 4 14:49:40 2014 (r268254) +++ stable/10/sys/compat/linux/linux_ioctl.c Fri Jul 4 15:09:56 2014 (r268255) @@ -2750,6 +2750,9 @@ linux_ioctl_sg(struct thread *td, struct case LINUX_SG_GET_SCSI_ID: args->cmd = SG_GET_SCSI_ID; break; + case LINUX_SG_GET_SG_TABLESIZE: + args->cmd = SG_GET_SG_TABLESIZE; + break; default: return (ENODEV); } From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 4 16:06:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6AD5922D; Fri, 4 Jul 2014 16:06: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 4D3E92877; Fri, 4 Jul 2014 16:06: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 s64G6vAG036418; Fri, 4 Jul 2014 16:06:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64G6vub036417; Fri, 4 Jul 2014 16:06:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407041606.s64G6vub036417@svn.freebsd.org> From: Alexander Motin Date: Fri, 4 Jul 2014 16:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268257 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 16:06:57 -0000 Author: mav Date: Fri Jul 4 16:06:56 2014 New Revision: 268257 URL: http://svnweb.freebsd.org/changeset/base/268257 Log: MFC r267547, r267551 (by trasz): Add LUN-associated name to VPD, to make Hyper-V Failover Cluster happy. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Jul 4 15:55:32 2014 (r268256) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Jul 4 16:06:56 2014 (r268257) @@ -2032,13 +2032,13 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, { struct cfiscsi_session *cs; struct scsi_vpd_device_id *devid_ptr; - struct scsi_vpd_id_descriptor *desc, *desc1; - struct scsi_vpd_id_descriptor *desc2, *desc3; /* for types 4h and 5h */ + struct scsi_vpd_id_descriptor *desc, *desc1, *desc2, *desc3, *desc4; struct scsi_vpd_id_t10 *t10id; struct ctl_lun *lun; const struct icl_pdu *request; + int i, ret; char *val; - size_t devid_len, wwpn_len; + size_t devid_len, wwpn_len, lun_name_len; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; request = ctsio->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; @@ -2050,9 +2050,20 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, if ((wwpn_len % 4) != 0) wwpn_len += (4 - (wwpn_len % 4)); + if (lun == NULL) { + lun_name_len = 0; + } else { + lun_name_len = strlen(cs->cs_target->ct_name); + lun_name_len += strlen(",lun,XXXXXXXX"); + lun_name_len += 1; /* '\0' */ + if ((lun_name_len % 4) != 0) + lun_name_len += (4 - (lun_name_len % 4)); + } + devid_len = sizeof(struct scsi_vpd_device_id) + sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN + + sizeof(struct scsi_vpd_id_descriptor) + lun_name_len + sizeof(struct scsi_vpd_id_descriptor) + wwpn_len + sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_rel_trgt_port_id) + @@ -2081,8 +2092,10 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN); desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] + - wwpn_len); + lun_name_len); desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] + + wwpn_len); + desc4 = (struct scsi_vpd_id_descriptor *)(&desc3->identifier[0] + sizeof(struct scsi_vpd_id_rel_trgt_port_id)); if (lun != NULL) @@ -2128,33 +2141,61 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, } /* - * desc1 is for the WWPN which is a port asscociation. - */ - desc1->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; - desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | - SVPD_ID_TYPE_SCSI_NAME; - desc1->length = wwpn_len; - snprintf(desc1->identifier, wwpn_len, "%s,t,0x%4.4x", - cs->cs_target->ct_name, cs->cs_portal_group_tag); + * desc1 is for the unique LUN name. + * + * XXX: According to SPC-3, LUN must report the same ID through + * all the ports. The code below, however, reports the + * ID only via iSCSI. + */ + desc1->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; + desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | + SVPD_ID_TYPE_SCSI_NAME; + desc1->length = lun_name_len; + if (lun != NULL) { + /* + * Find the per-target LUN number. + */ + for (i = 0; i < CTL_MAX_LUNS; i++) { + if (cs->cs_target->ct_luns[i] == lun->lun) + break; + } + KASSERT(i < CTL_MAX_LUNS, + ("lun %jd not found", (uintmax_t)lun->lun)); + ret = snprintf(desc1->identifier, lun_name_len, "%s,lun,%d", + cs->cs_target->ct_name, i); + KASSERT(ret > 0 && ret <= lun_name_len, ("bad snprintf")); + } else { + KASSERT(lun_name_len == 0, ("no lun, but lun_name_len != 0")); + } /* - * desc2 is for the Relative Target Port(type 4h) identifier + * desc2 is for the WWPN which is a port asscociation. */ - desc2->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY; + desc2->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; desc2->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | - SVPD_ID_TYPE_RELTARG; - desc2->length = 4; - desc2->identifier[3] = 1; + SVPD_ID_TYPE_SCSI_NAME; + desc2->length = wwpn_len; + snprintf(desc2->identifier, wwpn_len, "%s,t,0x%4.4x", + cs->cs_target->ct_name, cs->cs_portal_group_tag); /* - * desc3 is for the Target Port Group(type 5h) identifier + * desc3 is for the Relative Target Port(type 4h) identifier */ desc3->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY; desc3->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | - SVPD_ID_TYPE_TPORTGRP; + SVPD_ID_TYPE_RELTARG; desc3->length = 4; desc3->identifier[3] = 1; + /* + * desc4 is for the Target Port Group(type 5h) identifier + */ + desc4->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY; + desc4->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | + SVPD_ID_TYPE_TPORTGRP; + desc4->length = 4; + desc4->identifier[3] = 1; + ctsio->scsi_status = SCSI_STATUS_OK; ctsio->be_move_done = ctl_config_move_done; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 4 16:07:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 125C8469; Fri, 4 Jul 2014 16:07:58 +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 F337D28A1; Fri, 4 Jul 2014 16:07: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 s64G7vBC036779; Fri, 4 Jul 2014 16:07:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64G7vpv036777; Fri, 4 Jul 2014 16:07:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407041607.s64G7vpv036777@svn.freebsd.org> From: Alexander Motin Date: Fri, 4 Jul 2014 16:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268258 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 16:07:58 -0000 Author: mav Date: Fri Jul 4 16:07:57 2014 New Revision: 268258 URL: http://svnweb.freebsd.org/changeset/base/268258 Log: MFC r267574 (by trasz): Make cs_terminating a bool; no functional changes. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Jul 4 16:06:56 2014 (r268257) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Jul 4 16:07:57 2014 (r268258) @@ -1129,8 +1129,6 @@ cfiscsi_maintenance_thread(void *arg) icl_conn_shutdown(cs->cs_conn); icl_conn_close(cs->cs_conn); - cs->cs_terminating++; - /* * XXX: We used to wait up to 30 seconds to deliver queued PDUs * to the initiator. We also tried hard to deliver SCSI Responses @@ -1150,9 +1148,9 @@ static void cfiscsi_session_terminate(struct cfiscsi_session *cs) { - if (cs->cs_terminating != 0) + if (cs->cs_terminating) return; - cs->cs_terminating = 1; + cs->cs_terminating = true; cv_signal(&cs->cs_maintenance_cv); #ifdef ICL_KERNEL_PROXY cv_signal(&cs->cs_login_cv); Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Fri Jul 4 16:06:56 2014 (r268257) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Fri Jul 4 16:07:57 2014 (r268258) @@ -72,7 +72,7 @@ struct cfiscsi_session { int cs_timeout; int cs_portal_group_tag; struct cv cs_maintenance_cv; - int cs_terminating; + bool cs_terminating; size_t cs_max_data_segment_length; size_t cs_max_burst_length; bool cs_immediate_data; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 4 16:09:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1AD285A3; Fri, 4 Jul 2014 16:09: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 EFED128AB; Fri, 4 Jul 2014 16:09: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 s64G99ee037056; Fri, 4 Jul 2014 16:09:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64G99me037055; Fri, 4 Jul 2014 16:09:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407041609.s64G99me037055@svn.freebsd.org> From: Alexander Motin Date: Fri, 4 Jul 2014 16:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268259 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 16:09:10 -0000 Author: mav Date: Fri Jul 4 16:09:09 2014 New Revision: 268259 URL: http://svnweb.freebsd.org/changeset/base/268259 Log: MFC r267610 (by trasz): Rework session termination in iSCSI target to actually wait for any outstanding commands to be properly aborted by CTL. Without it, in some cases (such as files backing the LUNs stored on failing disk drives), terminating a busy session would result in panic. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Jul 4 16:07:57 2014 (r268258) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Jul 4 16:09:09 2014 (r268259) @@ -1044,7 +1044,7 @@ cfiscsi_session_terminate_tasks(struct c { struct cfiscsi_data_wait *cdw, *tmpcdw; union ctl_io *io; - int error; + int error, last; #ifdef notyet io = ctl_alloc_io(cs->cs_target->ct_softc->fe.ctl_pool_ref); @@ -1101,12 +1101,31 @@ cfiscsi_session_terminate_tasks(struct c CFISCSI_SESSION_DEBUG(cs, "removing csw for initiator task tag " "0x%x", cdw->cdw_initiator_task_tag); #endif + /* + * Set nonzero port status; this prevents backends from + * assuming that the data transfer actually succeeded + * and writing uninitialized data to disk. + */ + cdw->cdw_ctl_io->scsiio.io_hdr.port_status = 42; cdw->cdw_ctl_io->scsiio.be_move_done(cdw->cdw_ctl_io); TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next); uma_zfree(cfiscsi_data_wait_zone, cdw); } CFISCSI_SESSION_UNLOCK(cs); #endif + + /* + * Wait for CTL to terminate all the tasks. + */ + for (;;) { + refcount_acquire(&cs->cs_outstanding_ctl_pdus); + last = refcount_release(&cs->cs_outstanding_ctl_pdus); + if (last != 0) + break; + CFISCSI_SESSION_WARN(cs, "waiting for CTL to terminate tasks, " + "%d remaining", cs->cs_outstanding_ctl_pdus); + pause("cfiscsi_terminate", 1); + } } static void @@ -1123,19 +1142,22 @@ cfiscsi_maintenance_thread(void *arg) CFISCSI_SESSION_UNLOCK(cs); if (cs->cs_terminating) { - cfiscsi_session_terminate_tasks(cs); - callout_drain(&cs->cs_callout); + /* + * We used to wait up to 30 seconds to deliver queued + * PDUs to the initiator. We also tried hard to deliver + * SCSI Responses for the aborted PDUs. We don't do + * that anymore. We might need to revisit that. + */ + callout_drain(&cs->cs_callout); icl_conn_shutdown(cs->cs_conn); icl_conn_close(cs->cs_conn); /* - * XXX: We used to wait up to 30 seconds to deliver queued PDUs - * to the initiator. We also tried hard to deliver SCSI Responses - * for the aborted PDUs. We don't do that anymore. We might need - * to revisit that. + * At this point ICL receive thread is no longer + * running; no new tasks can be queued. */ - + cfiscsi_session_terminate_tasks(cs); cfiscsi_session_delete(cs); kthread_exit(); return; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 4 16:10:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 17D527D4; Fri, 4 Jul 2014 16:10: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 0440228BC; Fri, 4 Jul 2014 16:10: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 s64GAEfI037383; Fri, 4 Jul 2014 16:10:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64GAEI8037382; Fri, 4 Jul 2014 16:10:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407041610.s64GAEI8037382@svn.freebsd.org> From: Alexander Motin Date: Fri, 4 Jul 2014 16:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268260 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 16:10:15 -0000 Author: mav Date: Fri Jul 4 16:10:14 2014 New Revision: 268260 URL: http://svnweb.freebsd.org/changeset/base/268260 Log: MFC r267637: Add iSCSI Target Name ID descriptor to VPD 83h. It shall/should be there according to SPC-4, and istgt also provides it. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Jul 4 16:09:09 2014 (r268259) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Jul 4 16:10:14 2014 (r268260) @@ -2053,12 +2053,13 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, struct cfiscsi_session *cs; struct scsi_vpd_device_id *devid_ptr; struct scsi_vpd_id_descriptor *desc, *desc1, *desc2, *desc3, *desc4; + struct scsi_vpd_id_descriptor *desc5; struct scsi_vpd_id_t10 *t10id; struct ctl_lun *lun; const struct icl_pdu *request; int i, ret; char *val; - size_t devid_len, wwpn_len, lun_name_len; + size_t devid_len, wwnn_len, wwpn_len, lun_name_len; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; request = ctsio->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; @@ -2070,6 +2071,11 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, if ((wwpn_len % 4) != 0) wwpn_len += (4 - (wwpn_len % 4)); + wwnn_len = strlen(cs->cs_target->ct_name); + wwnn_len += 1; /* '\0' */ + if ((wwnn_len % 4) != 0) + wwnn_len += (4 - (wwnn_len % 4)); + if (lun == NULL) { lun_name_len = 0; } else { @@ -2084,6 +2090,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN + sizeof(struct scsi_vpd_id_descriptor) + lun_name_len + + sizeof(struct scsi_vpd_id_descriptor) + wwnn_len + sizeof(struct scsi_vpd_id_descriptor) + wwpn_len + sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_rel_trgt_port_id) + @@ -2114,8 +2121,10 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] + lun_name_len); desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] + - wwpn_len); + wwnn_len); desc4 = (struct scsi_vpd_id_descriptor *)(&desc3->identifier[0] + + wwpn_len); + desc5 = (struct scsi_vpd_id_descriptor *)(&desc4->identifier[0] + sizeof(struct scsi_vpd_id_rel_trgt_port_id)); if (lun != NULL) @@ -2189,32 +2198,41 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, } /* - * desc2 is for the WWPN which is a port asscociation. + * desc2 is for the Target Name. + */ + desc2->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; + desc2->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_TARGET | + SVPD_ID_TYPE_SCSI_NAME; + desc2->length = wwnn_len; + snprintf(desc2->identifier, wwnn_len, "%s", cs->cs_target->ct_name); + + /* + * desc3 is for the WWPN which is a port asscociation. */ - desc2->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; - desc2->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | + desc3->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; + desc3->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | SVPD_ID_TYPE_SCSI_NAME; - desc2->length = wwpn_len; - snprintf(desc2->identifier, wwpn_len, "%s,t,0x%4.4x", + desc3->length = wwpn_len; + snprintf(desc3->identifier, wwpn_len, "%s,t,0x%4.4x", cs->cs_target->ct_name, cs->cs_portal_group_tag); /* * desc3 is for the Relative Target Port(type 4h) identifier */ - desc3->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY; - desc3->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | + desc4->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY; + desc4->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | SVPD_ID_TYPE_RELTARG; - desc3->length = 4; - desc3->identifier[3] = 1; + desc4->length = 4; + desc4->identifier[3] = 1; /* * desc4 is for the Target Port Group(type 5h) identifier */ - desc4->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY; - desc4->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | + desc5->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY; + desc5->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | SVPD_ID_TYPE_TPORTGRP; - desc4->length = 4; - desc4->identifier[3] = 1; + desc5->length = 4; + desc5->identifier[3] = 1; ctsio->scsi_status = SCSI_STATUS_OK; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 4 16:11:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3FDB5918; Fri, 4 Jul 2014 16:11: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 1276E2938; Fri, 4 Jul 2014 16:11:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64GBU0n038992; Fri, 4 Jul 2014 16:11:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64GBUc2038990; Fri, 4 Jul 2014 16:11:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407041611.s64GBUc2038990@svn.freebsd.org> From: Alexander Motin Date: Fri, 4 Jul 2014 16:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268261 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 16:11:31 -0000 Author: mav Date: Fri Jul 4 16:11:30 2014 New Revision: 268261 URL: http://svnweb.freebsd.org/changeset/base/268261 Log: MFC r267641: Add some more CTL_FLAG_ABORT check points. This should allow to abort commands doing mostly disk I/O, such as VERIFY or WRITE SAME. Before this change CTL_FLAG_ABORT was only checked around data moves, which for these commands may not happen for a very long time. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri Jul 4 16:10:14 2014 (r268260) +++ stable/10/sys/cam/ctl/ctl.c Fri Jul 4 16:11:30 2014 (r268261) @@ -5009,9 +5009,10 @@ ctl_data_submit_done(union ctl_io *io) * If there is an error, though, we don't want to keep processing. * Instead, just send status back to the initiator. */ - if ((io->io_hdr.flags & CTL_FLAG_IO_CONT) - && (((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE) - || ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS))) { + if ((io->io_hdr.flags & CTL_FLAG_IO_CONT) && + (io->io_hdr.flags & CTL_FLAG_ABORT) == 0 && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { io->scsiio.io_cont(io); return; } Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Fri Jul 4 16:10:14 2014 (r268260) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Fri Jul 4 16:11:30 2014 (r268261) @@ -944,8 +944,9 @@ ctl_be_block_cw_done_ws(struct ctl_be_bl io = beio->io; ctl_free_beio(beio); - if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) - && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { + if ((io->io_hdr.flags & CTL_FLAG_ABORT) || + ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE && + (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { ctl_config_write_done(io); return; } @@ -1186,8 +1187,9 @@ ctl_be_block_next(struct ctl_be_block_io io = beio->io; be_lun = beio->lun; ctl_free_beio(beio); - if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) - && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { + if ((io->io_hdr.flags & CTL_FLAG_ABORT) || + ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE && + (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { ctl_data_submit_done(io); return; } From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 4 16:17:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4734BB9C; Fri, 4 Jul 2014 16:17: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 34160297B; Fri, 4 Jul 2014 16:17: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 s64GHGJd041835; Fri, 4 Jul 2014 16:17:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64GHGt4041834; Fri, 4 Jul 2014 16:17:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407041617.s64GHGt4041834@svn.freebsd.org> From: Alexander Motin Date: Fri, 4 Jul 2014 16:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268262 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 16:17:16 -0000 Author: mav Date: Fri Jul 4 16:17:15 2014 New Revision: 268262 URL: http://svnweb.freebsd.org/changeset/base/268262 Log: MFC r267648: serial_num and device_id fields are not necessarily null-terminated. Before this it was impossible to use all 16 bytes of serial number, and client always got serial number NULL-terminated, that is not required. Modified: stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Fri Jul 4 16:11:30 2014 (r268261) +++ stable/10/usr.sbin/ctld/kernel.c Fri Jul 4 16:17:15 2014 (r268262) @@ -413,13 +413,13 @@ kernel_lun_add(struct lun *lun) req.reqdata.create.device_type = T_DIRECT; if (lun->l_serial != NULL) { - strlcpy(req.reqdata.create.serial_num, lun->l_serial, + strncpy(req.reqdata.create.serial_num, lun->l_serial, sizeof(req.reqdata.create.serial_num)); req.reqdata.create.flags |= CTL_LUN_FLAG_SERIAL_NUM; } if (lun->l_device_id != NULL) { - strlcpy(req.reqdata.create.device_id, lun->l_device_id, + strncpy(req.reqdata.create.device_id, lun->l_device_id, sizeof(req.reqdata.create.device_id)); req.reqdata.create.flags |= CTL_LUN_FLAG_DEVID; } From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 5 01:14:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C78AF7F0; Sat, 5 Jul 2014 01:14: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 B35D725D8; Sat, 5 Jul 2014 01:14: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 s651EEG2005485; Sat, 5 Jul 2014 01:14:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s651EEfV005484; Sat, 5 Jul 2014 01:14:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407050114.s651EEfV005484@svn.freebsd.org> From: Alexander Motin Date: Sat, 5 Jul 2014 01:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268274 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jul 2014 01:14:14 -0000 Author: mav Date: Sat Jul 5 01:14:14 2014 New Revision: 268274 URL: http://svnweb.freebsd.org/changeset/base/268274 Log: MFC r268178: Fix bug in sync control in new "dev" mode of ZVOL (r265678). Don't check ZVOL_WCE flag, used in Solaris to control device "write cache". It is not applicable on FreeBSD and by default set to "disable". Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jul 4 22:47:07 2014 (r268273) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Jul 5 01:14:14 2014 (r268274) @@ -1628,7 +1628,11 @@ zvol_write(struct cdev *dev, struct uio } #endif +#ifdef sun sync = !(zv->zv_flags & ZVOL_WCE) || +#else + sync = +#endif (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS); rl = zfs_range_lock(&zv->zv_znode, uio->uio_loffset, uio->uio_resid, From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 5 03:48:22 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CE1B126F; Sat, 5 Jul 2014 03:48: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 9CCFF203F; Sat, 5 Jul 2014 03:48: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 s653mMCx076024; Sat, 5 Jul 2014 03:48:22 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s653mMcM076023; Sat, 5 Jul 2014 03:48:22 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201407050348.s653mMcM076023@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 5 Jul 2014 03:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268281 - stable/10/sys/dev/vmware/vmxnet3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jul 2014 03:48:22 -0000 Author: bryanv Date: Sat Jul 5 03:48:22 2014 New Revision: 268281 URL: http://svnweb.freebsd.org/changeset/base/268281 Log: MFC r268012, r268196: - Remove some write only variables - Give each interrupt a descriptive name when using MSIX Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Sat Jul 5 03:34:52 2014 (r268280) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Sat Jul 5 03:48:22 2014 (r268281) @@ -692,6 +692,8 @@ vmxnet3_setup_msix_interrupts(struct vmx vmxnet3_txq_intr, txq, &intr->vmxi_handler); if (error) return (error); + bus_describe_intr(dev, intr->vmxi_irq, intr->vmxi_handler, + "tq%d", i); txq->vxtxq_intr_idx = intr->vmxi_rid - 1; } @@ -701,6 +703,8 @@ vmxnet3_setup_msix_interrupts(struct vmx vmxnet3_rxq_intr, rxq, &intr->vmxi_handler); if (error) return (error); + bus_describe_intr(dev, intr->vmxi_irq, intr->vmxi_handler, + "rq%d", i); rxq->vxrxq_intr_idx = intr->vmxi_rid - 1; } @@ -708,6 +712,7 @@ vmxnet3_setup_msix_interrupts(struct vmx vmxnet3_event_intr, sc, &intr->vmxi_handler); if (error) return (error); + bus_describe_intr(dev, intr->vmxi_irq, intr->vmxi_handler, "event"); sc->vmx_event_intr_idx = intr->vmxi_rid - 1; return (0); @@ -2219,12 +2224,10 @@ vmxnet3_legacy_intr(void *xsc) struct vmxnet3_softc *sc; struct vmxnet3_rxqueue *rxq; struct vmxnet3_txqueue *txq; - struct ifnet *ifp; sc = xsc; rxq = &sc->vmx_rxq[0]; txq = &sc->vmx_txq[0]; - ifp = sc->vmx_ifp; if (sc->vmx_intr_type == VMXNET3_IT_LEGACY) { if (vmxnet3_read_bar1(sc, VMXNET3_BAR1_INTR) == 0) @@ -2253,11 +2256,9 @@ vmxnet3_txq_intr(void *xtxq) { struct vmxnet3_softc *sc; struct vmxnet3_txqueue *txq; - struct ifnet *ifp; txq = xtxq; sc = txq->vxtxq_sc; - ifp = sc->vmx_ifp; if (sc->vmx_intr_mask_mode == VMXNET3_IMM_ACTIVE) vmxnet3_disable_intr(sc, txq->vxtxq_intr_idx); @@ -2765,7 +2766,6 @@ static int vmxnet3_txq_encap(struct vmxnet3_txqueue *txq, struct mbuf **m0) { struct vmxnet3_softc *sc; - struct ifnet *ifp; struct vmxnet3_txring *txr; struct vmxnet3_txdesc *txd, *sop; struct mbuf *m; @@ -2774,7 +2774,6 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue int i, gen, nsegs, etype, proto, start, error; sc = txq->vxtxq_sc; - ifp = sc->vmx_ifp; start = 0; txd = NULL; txr = &txq->vxtxq_cmd_ring; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 03:31:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 25949ED0; Sun, 6 Jul 2014 03:31: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 0912D2AA5; Sun, 6 Jul 2014 03:31: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 s663V1sE022531; Sun, 6 Jul 2014 03:31:01 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s663V1V5022529; Sun, 6 Jul 2014 03:31:01 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201407060331.s663V1V5022529@svn.freebsd.org> From: Glen Barber Date: Sun, 6 Jul 2014 03:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268305 - stable/10/release/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 03:31:02 -0000 Author: gjb Date: Sun Jul 6 03:31:01 2014 New Revision: 268305 URL: http://svnweb.freebsd.org/changeset/base/268305 Log: MFC r268232: The u-boot tarball needed for some boards, BEAGLEBONE for example, explicitly hard-code gcc(1) as the compiler. Partially revert r264703, which did a post-chroot install of gcc(1). This was initially removed because gcc(1) fails to build usr.bin/dtc/ causing the xdev target to fail. So this time, move the gcc(1) installation after xdev is built. This change is likely applicable to stable/10 arm build failures, as well. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/arm/release.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/arm/release.sh ============================================================================== --- stable/10/release/arm/release.sh Sat Jul 5 21:50:59 2014 (r268304) +++ stable/10/release/arm/release.sh Sun Jul 6 03:31:01 2014 (r268305) @@ -111,6 +111,9 @@ main() { BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean done + eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \ + WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install + mkdir -p ${CHROOTDIR}/tmp/crochet/work before_build install_crochet From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 17:18:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1ADEC92E; Sun, 6 Jul 2014 17:18: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 06BD222EB; Sun, 6 Jul 2014 17:18: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 s66HImIf009104; Sun, 6 Jul 2014 17:18:48 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66HImHi009103; Sun, 6 Jul 2014 17:18:48 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407061718.s66HImHi009103@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 6 Jul 2014 17:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268323 - stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 17:18:49 -0000 Author: pfg Date: Sun Jul 6 17:18:48 2014 New Revision: 268323 URL: http://svnweb.freebsd.org/changeset/base/268323 Log: MFC r268125: Small merges from OpenSolaris: These have no effect on FreeBSD, in fact they are ifdef'ed, but make easier future merges: 6699767 panic in spec_open() 6718877 crgetzoneid() use can cause problems when forking processes with USDT providers in a non global zone Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Jul 6 16:42:04 2014 (r268322) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Jul 6 17:18:48 2014 (r268323) @@ -11689,7 +11689,8 @@ dtrace_enabling_matchall(void) #if defined(sun) cred_t *cr = enab->dten_vstate->dtvs_state->dts_cred.dcr_cred; - if (INGLOBALZONE(curproc) || getzoneid() == crgetzoneid(cr)) + if (INGLOBALZONE(curproc) || + cr != NULL && getzoneid() == crgetzoneid(cr)) #endif (void) dtrace_enabling_match(enab, NULL); } @@ -15697,7 +15698,8 @@ dtrace_open(struct cdev *dev, int oflags * If this wasn't an open with the "helper" minor, then it must be * the "dtrace" minor. */ - ASSERT(getminor(*devp) == DTRACEMNRN_DTRACE); + if (getminor(*devp) == DTRACEMNRN_DTRACE) + return (ENXIO); #else cred_t *cred_p = NULL; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 17:29:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5CFCA17F; Sun, 6 Jul 2014 17:29: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 4945D23E7; Sun, 6 Jul 2014 17:29: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 s66HTKWx014013; Sun, 6 Jul 2014 17:29:20 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66HTK4T014012; Sun, 6 Jul 2014 17:29:20 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407061729.s66HTK4T014012@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 6 Jul 2014 17:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268325 - stable/10/usr.bin/sed X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 17:29:20 -0000 Author: pfg Date: Sun Jul 6 17:29:19 2014 New Revision: 268325 URL: http://svnweb.freebsd.org/changeset/base/268325 Log: MFC r268193, r268203: Fix sed(1) usage: the -i extension is not an optional. Modified: stable/10/usr.bin/sed/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sed/main.c ============================================================================== --- stable/10/usr.bin/sed/main.c Sun Jul 6 17:23:25 2014 (r268324) +++ stable/10/usr.bin/sed/main.c Sun Jul 6 17:29:19 2014 (r268325) @@ -204,8 +204,8 @@ static void usage(void) { (void)fprintf(stderr, - "usage: %s script [-Ealnru] [-i[]] [file ...]\n" - "\t%s [-Ealnu] [-i[]] [-e script] ... [-f script_file]" + "usage: %s script [-Ealnru] [-i extension] [file ...]\n" + "\t%s [-Ealnu] [-i extension] [-e script] ... [-f script_file]" " ... [file ...]\n", getprogname(), getprogname()); exit(1); } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 22:47:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 78049544; Sun, 6 Jul 2014 22:47: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 588182D0B; Sun, 6 Jul 2014 22:47: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 s66MlJkk068692; Sun, 6 Jul 2014 22:47:19 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66MlI8e068689; Sun, 6 Jul 2014 22:47:18 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062247.s66MlI8e068689@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 22:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268335 - in stable/10/sys: fs/fifofs kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 22:47:19 -0000 Author: mjg Date: Sun Jul 6 22:47:18 2014 New Revision: 268335 URL: http://svnweb.freebsd.org/changeset/base/268335 Log: MFC r265206: Ignore the error from pipespace_new when creating a pipe. It can fail if pipe map is exhausted (as a result of too many pipes created), but it is not fatal and could be provoked by unprivileged users. The only consequence is worse performance with given pipe. Modified: stable/10/sys/fs/fifofs/fifo_vnops.c stable/10/sys/kern/sys_pipe.c stable/10/sys/sys/pipe.h Modified: stable/10/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- stable/10/sys/fs/fifofs/fifo_vnops.c Sun Jul 6 22:09:50 2014 (r268334) +++ stable/10/sys/fs/fifofs/fifo_vnops.c Sun Jul 6 22:47:18 2014 (r268335) @@ -146,9 +146,7 @@ fifo_open(ap) if (fp == NULL || (ap->a_mode & FEXEC) != 0) return (EINVAL); if ((fip = vp->v_fifoinfo) == NULL) { - error = pipe_named_ctor(&fpipe, td); - if (error != 0) - return (error); + pipe_named_ctor(&fpipe, td); fip = malloc(sizeof(*fip), M_VNODE, M_WAITOK); fip->fi_pipe = fpipe; fpipe->pipe_wgen = fip->fi_readers = fip->fi_writers = 0; Modified: stable/10/sys/kern/sys_pipe.c ============================================================================== --- stable/10/sys/kern/sys_pipe.c Sun Jul 6 22:09:50 2014 (r268334) +++ stable/10/sys/kern/sys_pipe.c Sun Jul 6 22:47:18 2014 (r268335) @@ -221,8 +221,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesi static void pipeinit(void *dummy __unused); static void pipeclose(struct pipe *cpipe); static void pipe_free_kmem(struct pipe *cpipe); -static int pipe_create(struct pipe *pipe, int backing); -static int pipe_paircreate(struct thread *td, struct pipepair **p_pp); +static void pipe_create(struct pipe *pipe, int backing); +static void pipe_paircreate(struct thread *td, struct pipepair **p_pp); static __inline int pipelock(struct pipe *cpipe, int catch); static __inline void pipeunlock(struct pipe *cpipe); #ifndef PIPE_NODIRECT @@ -331,12 +331,11 @@ pipe_zone_fini(void *mem, int size) mtx_destroy(&pp->pp_mtx); } -static int +static void pipe_paircreate(struct thread *td, struct pipepair **p_pp) { struct pipepair *pp; struct pipe *rpipe, *wpipe; - int error; *p_pp = pp = uma_zalloc(pipe_zone, M_WAITOK); #ifdef MAC @@ -355,30 +354,21 @@ pipe_paircreate(struct thread *td, struc knlist_init_mtx(&wpipe->pipe_sel.si_note, PIPE_MTX(wpipe)); /* Only the forward direction pipe is backed by default */ - if ((error = pipe_create(rpipe, 1)) != 0 || - (error = pipe_create(wpipe, 0)) != 0) { - pipeclose(rpipe); - pipeclose(wpipe); - return (error); - } + pipe_create(rpipe, 1); + pipe_create(wpipe, 0); rpipe->pipe_state |= PIPE_DIRECTOK; wpipe->pipe_state |= PIPE_DIRECTOK; - return (0); } -int +void pipe_named_ctor(struct pipe **ppipe, struct thread *td) { struct pipepair *pp; - int error; - error = pipe_paircreate(td, &pp); - if (error != 0) - return (error); + pipe_paircreate(td, &pp); pp->pp_rpipe.pipe_state |= PIPE_NAMED; *ppipe = &pp->pp_rpipe; - return (0); } void @@ -419,9 +409,7 @@ kern_pipe2(struct thread *td, int fildes int fd, fflags, error; fdp = td->td_proc->p_fd; - error = pipe_paircreate(td, &pp); - if (error != 0) - return (error); + pipe_paircreate(td, &pp); rpipe = &pp->pp_rpipe; wpipe = &pp->pp_wpipe; error = falloc(td, &rf, &fd, flags); @@ -642,24 +630,27 @@ pipeselwakeup(cpipe) * Initialize and allocate VM and memory for pipe. The structure * will start out zero'd from the ctor, so we just manage the kmem. */ -static int +static void pipe_create(pipe, backing) struct pipe *pipe; int backing; { - int error; if (backing) { + /* + * Note that these functions can fail if pipe map is exhausted + * (as a result of too many pipes created), but we ignore the + * error as it is not fatal and could be provoked by + * unprivileged users. The only consequence is worse performance + * with given pipe. + */ if (amountpipekva > maxpipekva / 2) - error = pipespace_new(pipe, SMALL_PIPE_SIZE); + (void)pipespace_new(pipe, SMALL_PIPE_SIZE); else - error = pipespace_new(pipe, PIPE_SIZE); - } else { - /* If we're not backing this pipe, no need to do anything. */ - error = 0; + (void)pipespace_new(pipe, PIPE_SIZE); } + pipe->pipe_ino = -1; - return (error); } /* ARGSUSED */ Modified: stable/10/sys/sys/pipe.h ============================================================================== --- stable/10/sys/sys/pipe.h Sun Jul 6 22:09:50 2014 (r268334) +++ stable/10/sys/sys/pipe.h Sun Jul 6 22:47:18 2014 (r268335) @@ -142,6 +142,6 @@ struct pipepair { #define PIPE_LOCK_ASSERT(pipe, type) mtx_assert(PIPE_MTX(pipe), (type)) void pipe_dtor(struct pipe *dpipe); -int pipe_named_ctor(struct pipe **ppipe, struct thread *td); +void pipe_named_ctor(struct pipe **ppipe, struct thread *td); void pipeselwakeup(struct pipe *cpipe); #endif /* !_SYS_PIPE_H_ */ From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 22:49:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B91376F4; Sun, 6 Jul 2014 22:49:07 +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 A64A32D1C; Sun, 6 Jul 2014 22:49:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66Mn7Fc068993; Sun, 6 Jul 2014 22:49:07 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66Mn74s068992; Sun, 6 Jul 2014 22:49:07 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062249.s66Mn74s068992@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 22:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268336 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 22:49:07 -0000 Author: mjg Date: Sun Jul 6 22:49:07 2014 New Revision: 268336 URL: http://svnweb.freebsd.org/changeset/base/268336 Log: MFC r265247: Request a non-exiting process in sysctl_kern_proc_{o,}filedesc This fixes a race with exit1 freeing p_textvp. Modified: stable/10/sys/kern/kern_descrip.c Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:47:18 2014 (r268335) +++ stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:49:07 2014 (r268336) @@ -3043,7 +3043,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE struct tty *tp; name = (int *)arg1; - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) return (error); fdp = fdhold(p); @@ -3540,7 +3540,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER name = (int *)arg1; sbuf_new_for_sysctl(&sb, NULL, FILEDESC_SBUF_SIZE, req); - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) { sbuf_delete(&sb); return (error); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 22:51:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3F37F866; Sun, 6 Jul 2014 22:51: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 2C0D22D98; Sun, 6 Jul 2014 22:51: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 s66MpsiP072547; Sun, 6 Jul 2014 22:51:54 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66Mpsol072546; Sun, 6 Jul 2014 22:51:54 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062251.s66Mpsol072546@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 22:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268337 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 22:51:54 -0000 Author: mjg Date: Sun Jul 6 22:51:53 2014 New Revision: 268337 URL: http://svnweb.freebsd.org/changeset/base/268337 Log: MFC r267708: do_dup: plug redundant adjustment of fd_lastfile By that time it was already set by fdalloc, or was there in the first place if fd is replaced. Modified: stable/10/sys/kern/kern_descrip.c Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:49:07 2014 (r268336) +++ stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:51:53 2014 (r268337) @@ -886,8 +886,6 @@ do_dup(struct thread *td, int flags, int newfde->fde_flags = oldfde->fde_flags | UF_EXCLOSE; else newfde->fde_flags = oldfde->fde_flags & ~UF_EXCLOSE; - if (new > fdp->fd_lastfile) - fdp->fd_lastfile = new; *retval = new; if (delfp != NULL) { From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 22:54:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 937CBA0E; Sun, 6 Jul 2014 22:54: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 805982DB4; Sun, 6 Jul 2014 22:54: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 s66MsI4H072912; Sun, 6 Jul 2014 22:54:18 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66MsHHv072908; Sun, 6 Jul 2014 22:54:17 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062254.s66MsHHv072908@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 22:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268338 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 22:54:18 -0000 Author: mjg Date: Sun Jul 6 22:54:17 2014 New Revision: 268338 URL: http://svnweb.freebsd.org/changeset/base/268338 Log: MFC r267710: fd: replace fd_nfiles with fd_lastfile where appropriate fd_lastfile is guaranteed to be the biggest open fd, so when the intent is to iterate over active fds or lookup one, there is no point in looking beyond that limit. Few places are left unpatched for now. Modified: stable/10/sys/kern/kern_descrip.c stable/10/sys/kern/sys_generic.c stable/10/sys/kern/vfs_syscalls.c stable/10/sys/sys/filedesc.h Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:51:53 2014 (r268337) +++ stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:54:17 2014 (r268338) @@ -1235,7 +1235,7 @@ sys_closefrom(struct thread *td, struct if (uap->lowfd < 0) uap->lowfd = 0; FILEDESC_SLOCK(fdp); - for (fd = uap->lowfd; fd < fdp->fd_nfiles; fd++) { + for (fd = uap->lowfd; fd <= fdp->fd_lastfile; fd++) { if (fdp->fd_ofiles[fd].fde_file != NULL) { FILEDESC_SUNLOCK(fdp); (void)kern_close(td, fd); @@ -2949,7 +2949,7 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) if (fdp == NULL) continue; FILEDESC_SLOCK(fdp); - for (n = 0; fdp->fd_refcnt > 0 && n < fdp->fd_nfiles; ++n) { + for (n = 0; fdp->fd_refcnt > 0 && n <= fdp->fd_lastfile; ++n) { if ((fp = fdp->fd_ofiles[n].fde_file) == NULL) continue; xf.xf_fd = n; @@ -3059,7 +3059,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE if (fdp->fd_jdir != NULL) export_vnode_for_osysctl(fdp->fd_jdir, KF_FD_TYPE_JAIL, kif, fdp, req); - for (i = 0; fdp->fd_refcnt > 0 && i < fdp->fd_nfiles; i++) { + for (i = 0; fdp->fd_refcnt > 0 && i <= fdp->fd_lastfile; i++) { if ((fp = fdp->fd_ofiles[i].fde_file) == NULL) continue; bzero(kif, sizeof(*kif)); @@ -3430,7 +3430,7 @@ kern_proc_filedesc_out(struct proc *p, export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, FREAD, -1, -1, NULL, efbuf); } - for (i = 0; fdp->fd_refcnt > 0 && i < fdp->fd_nfiles; i++) { + for (i = 0; fdp->fd_refcnt > 0 && i <= fdp->fd_lastfile; i++) { if ((fp = fdp->fd_ofiles[i].fde_file) == NULL) continue; data = NULL; @@ -3803,7 +3803,7 @@ file_to_first_proc(struct file *fp) fdp = p->p_fd; if (fdp == NULL) continue; - for (n = 0; n < fdp->fd_nfiles; n++) { + for (n = 0; n <= fdp->fd_lastfile; n++) { if (fp == fdp->fd_ofiles[n].fde_file) return (p); } @@ -3853,7 +3853,7 @@ DB_SHOW_COMMAND(files, db_show_files) continue; if ((fdp = p->p_fd) == NULL) continue; - for (n = 0; n < fdp->fd_nfiles; ++n) { + for (n = 0; n <= fdp->fd_lastfile; ++n) { if ((fp = fdp->fd_ofiles[n].fde_file) == NULL) continue; db_print_file(fp, header); Modified: stable/10/sys/kern/sys_generic.c ============================================================================== --- stable/10/sys/kern/sys_generic.c Sun Jul 6 22:51:53 2014 (r268337) +++ stable/10/sys/kern/sys_generic.c Sun Jul 6 22:54:17 2014 (r268338) @@ -1458,7 +1458,7 @@ pollscan(td, fds, nfd) FILEDESC_SLOCK(fdp); for (i = 0; i < nfd; i++, fds++) { - if (fds->fd >= fdp->fd_nfiles) { + if (fds->fd > fdp->fd_lastfile) { fds->revents = POLLNVAL; n++; } else if (fds->fd < 0) { Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Sun Jul 6 22:51:53 2014 (r268337) +++ stable/10/sys/kern/vfs_syscalls.c Sun Jul 6 22:54:17 2014 (r268338) @@ -829,7 +829,7 @@ chroot_refuse_vdir_fds(fdp) FILEDESC_LOCK_ASSERT(fdp); - for (fd = 0; fd < fdp->fd_nfiles ; fd++) { + for (fd = 0; fd <= fdp->fd_lastfile; fd++) { fp = fget_locked(fdp, fd); if (fp == NULL) continue; Modified: stable/10/sys/sys/filedesc.h ============================================================================== --- stable/10/sys/sys/filedesc.h Sun Jul 6 22:51:53 2014 (r268337) +++ stable/10/sys/sys/filedesc.h Sun Jul 6 22:54:17 2014 (r268338) @@ -176,7 +176,7 @@ fget_locked(struct filedesc *fdp, int fd FILEDESC_LOCK_ASSERT(fdp); - if (fd < 0 || fd >= fdp->fd_nfiles) + if (fd < 0 || fd > fdp->fd_lastfile) return (NULL); return (fdp->fd_ofiles[fd].fde_file); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 22:56:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4C900B58; Sun, 6 Jul 2014 22:56: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 396902DCB; Sun, 6 Jul 2014 22:56: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 s66MuZlV073324; Sun, 6 Jul 2014 22:56:35 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66MuZ2F073323; Sun, 6 Jul 2014 22:56:35 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062256.s66MuZ2F073323@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 22:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268339 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 22:56:35 -0000 Author: mjg Date: Sun Jul 6 22:56:34 2014 New Revision: 268339 URL: http://svnweb.freebsd.org/changeset/base/268339 Log: MFC r267755: Don't take filedesc lock in fdunshare(). We can read refcnt safely and only care if it is equal to 1. If it could suddenly change from 1 to something bigger the code would be buggy even in the previous form and transitions from > 1 to 1 are equally racy and harmless (we copy even though there is no need). Modified: stable/10/sys/kern/kern_descrip.c Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:54:17 2014 (r268338) +++ stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:56:34 2014 (r268339) @@ -1885,17 +1885,14 @@ fdshare(struct filedesc *fdp) void fdunshare(struct proc *p, struct thread *td) { + struct filedesc *tmp; - FILEDESC_XLOCK(p->p_fd); - if (p->p_fd->fd_refcnt > 1) { - struct filedesc *tmp; - - FILEDESC_XUNLOCK(p->p_fd); - tmp = fdcopy(p->p_fd); - fdescfree(td); - p->p_fd = tmp; - } else - FILEDESC_XUNLOCK(p->p_fd); + if (p->p_fd->fd_refcnt == 1) + return; + + tmp = fdcopy(p->p_fd); + fdescfree(td); + p->p_fd = tmp; } /* From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 22:58:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BE0D3C9E; Sun, 6 Jul 2014 22:58: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 9116F2DD5; Sun, 6 Jul 2014 22:58: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 s66MwrQb073692; Sun, 6 Jul 2014 22:58:53 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66MwrnL073691; Sun, 6 Jul 2014 22:58:53 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062258.s66MwrnL073691@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 22:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268340 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 22:58:53 -0000 Author: mjg Date: Sun Jul 6 22:58:53 2014 New Revision: 268340 URL: http://svnweb.freebsd.org/changeset/base/268340 Log: MFC r267760: Tidy up fd-related functions called by do_execve o assert in each one that fdp is not shared o remove unnecessary NULL checks - all userspace processes have fdtables and kernel processes cannot execve o remove comments about the danger of fd_ofiles getting reallocated - fdtable is not shared and fd_ofiles could be only reallocated if new fd was about to be added, but if that was possible the code would already be buggy as setugidsafety work could be undone Modified: stable/10/sys/kern/kern_descrip.c Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:56:34 2014 (r268339) +++ stable/10/sys/kern/kern_descrip.c Sun Jul 6 22:58:53 2014 (r268340) @@ -2114,15 +2114,8 @@ setugidsafety(struct thread *td) struct file *fp; int i; - /* Certain daemons might not have file descriptors. */ fdp = td->td_proc->p_fd; - if (fdp == NULL) - return; - - /* - * Note: fdp->fd_ofiles may be reallocated out from under us while - * we are blocked in a close. Be careful! - */ + KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared")); FILEDESC_XLOCK(fdp); for (i = 0; i <= fdp->fd_lastfile; i++) { if (i > 2) @@ -2174,15 +2167,8 @@ fdcloseexec(struct thread *td) struct file *fp; int i; - /* Certain daemons might not have file descriptors. */ fdp = td->td_proc->p_fd; - if (fdp == NULL) - return; - - /* - * We cannot cache fd_ofiles since operations - * may block and rip them out from under us. - */ + KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared")); FILEDESC_XLOCK(fdp); for (i = 0; i <= fdp->fd_lastfile; i++) { fde = &fdp->fd_ofiles[i]; @@ -2213,8 +2199,6 @@ fdcheckstd(struct thread *td) int i, error, devnull; fdp = td->td_proc->p_fd; - if (fdp == NULL) - return (0); KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared")); devnull = -1; error = 0; From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 23:01:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3EA74DDF; Sun, 6 Jul 2014 23:01: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 2B83D2DE6; Sun, 6 Jul 2014 23:01: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 s66N1ULq076827; Sun, 6 Jul 2014 23:01:30 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66N1US8076826; Sun, 6 Jul 2014 23:01:30 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062301.s66N1US8076826@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 23:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268341 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 23:01:30 -0000 Author: mjg Date: Sun Jul 6 23:01:29 2014 New Revision: 268341 URL: http://svnweb.freebsd.org/changeset/base/268341 Log: MFC r267947: Check lower bound of cmsg_len. If passed cm->cmsg_len was below cmsghdr size the experssion: datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; would give negative result. However, in practice it would not result in a crash because the kernel would try to obtain garbage fds for given process and would error out with EBADF. PR: 124908 Submitted by: campbell mumble.net (modified a little) Modified: stable/10/sys/kern/uipc_usrreq.c Modified: stable/10/sys/kern/uipc_usrreq.c ============================================================================== --- stable/10/sys/kern/uipc_usrreq.c Sun Jul 6 22:58:53 2014 (r268340) +++ stable/10/sys/kern/uipc_usrreq.c Sun Jul 6 23:01:29 2014 (r268341) @@ -1859,7 +1859,7 @@ unp_internalize(struct mbuf **controlp, *controlp = NULL; while (cm != NULL) { if (sizeof(*cm) > clen || cm->cmsg_level != SOL_SOCKET - || cm->cmsg_len > clen) { + || cm->cmsg_len > clen || cm->cmsg_len < sizeof(*cm)) { error = EINVAL; goto out; } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 23:17:21 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BF5B84B4; Sun, 6 Jul 2014 23:17: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 92C952F41; Sun, 6 Jul 2014 23:17: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 s66NHLsN083248; Sun, 6 Jul 2014 23:17:21 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66NHLNk083247; Sun, 6 Jul 2014 23:17:21 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062317.s66NHLNk083247@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 23:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268343 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 23:17:21 -0000 Author: mjg Date: Sun Jul 6 23:17:21 2014 New Revision: 268343 URL: http://svnweb.freebsd.org/changeset/base/268343 Log: Add mergeinfo missed in r268335-r268341 Prodded by: gjb Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 23:20:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 599FE60F; Sun, 6 Jul 2014 23:20: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 4664A2FBA; Sun, 6 Jul 2014 23:20: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 s66NKnFm086438; Sun, 6 Jul 2014 23:20:49 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66NKnce086437; Sun, 6 Jul 2014 23:20:49 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062320.s66NKnce086437@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 23:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268344 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 23:20:49 -0000 Author: mjg Date: Sun Jul 6 23:20:48 2014 New Revision: 268344 URL: http://svnweb.freebsd.org/changeset/base/268344 Log: MFC r268000: Make sure to always clear p_fd for process getting rid of its filetable. Filetable can be shared with other processes. Previous code failed to clear the pointer for all but the last process getting rid of the table. This is mostly cosmetics. Get rid of 'This should happen earlier' comment. Clearing the pointer in this place is fine as consumers can reliably check for files availability by inspecting fd_refcnt and vnodes availabity by NULL-checking them. Modified: stable/10/sys/kern/kern_descrip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Jul 6 23:17:21 2014 (r268343) +++ stable/10/sys/kern/kern_descrip.c Sun Jul 6 23:20:48 2014 (r268344) @@ -2036,6 +2036,11 @@ fdescfree(struct thread *td) if (fdtol != NULL) free(fdtol, M_FILEDESC_TO_LEADER); } + + mtx_lock(&fdesc_mtx); + td->td_proc->p_fd = NULL; + mtx_unlock(&fdesc_mtx); + FILEDESC_XLOCK(fdp); i = --fdp->fd_refcnt; FILEDESC_XUNLOCK(fdp); @@ -2053,11 +2058,6 @@ fdescfree(struct thread *td) } FILEDESC_XLOCK(fdp); - /* XXX This should happen earlier. */ - mtx_lock(&fdesc_mtx); - td->td_proc->p_fd = NULL; - mtx_unlock(&fdesc_mtx); - if (fdp->fd_nfiles > NDFILE) free(fdp->fd_ofiles, M_FILEDESC); if (NDSLOTS(fdp->fd_nfiles) > NDSLOTS(NDFILE)) From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 23:23:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4A8EB764; Sun, 6 Jul 2014 23:23: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 1D5502FD3; Sun, 6 Jul 2014 23:23: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 s66NN2Jr087255; Sun, 6 Jul 2014 23:23:02 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66NN2JX087250; Sun, 6 Jul 2014 23:23:02 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062323.s66NN2JX087250@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 23:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268345 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 23:23:03 -0000 Author: mjg Date: Sun Jul 6 23:23:01 2014 New Revision: 268345 URL: http://svnweb.freebsd.org/changeset/base/268345 Log: MFC r268001: Make fdunshare accept only td parameter. Proc had to match the thread anyway and 2 parameters were inconsistent with the rest. Modified: stable/10/sys/kern/kern_descrip.c stable/10/sys/kern/kern_exec.c stable/10/sys/kern/kern_fork.c stable/10/sys/sys/filedesc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Sun Jul 6 23:20:48 2014 (r268344) +++ stable/10/sys/kern/kern_descrip.c Sun Jul 6 23:23:01 2014 (r268345) @@ -1883,9 +1883,10 @@ fdshare(struct filedesc *fdp) * Unshare a filedesc structure, if necessary by making a copy */ void -fdunshare(struct proc *p, struct thread *td) +fdunshare(struct thread *td) { struct filedesc *tmp; + struct proc *p = td->td_proc; if (p->p_fd->fd_refcnt == 1) return; Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Sun Jul 6 23:20:48 2014 (r268344) +++ stable/10/sys/kern/kern_exec.c Sun Jul 6 23:23:01 2014 (r268345) @@ -597,7 +597,7 @@ interpret: * For security and other reasons, the file descriptor table cannot * be shared after an exec. */ - fdunshare(p, td); + fdunshare(td); /* * Malloc things before we need locks. Modified: stable/10/sys/kern/kern_fork.c ============================================================================== --- stable/10/sys/kern/kern_fork.c Sun Jul 6 23:20:48 2014 (r268344) +++ stable/10/sys/kern/kern_fork.c Sun Jul 6 23:23:01 2014 (r268345) @@ -347,8 +347,8 @@ fork_norfproc(struct thread *td, int fla /* * Unshare file descriptors (from parent). */ - if (flags & RFFDG) - fdunshare(p1, td); + if (flags & RFFDG) + fdunshare(td); fail: if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) && Modified: stable/10/sys/sys/filedesc.h ============================================================================== --- stable/10/sys/sys/filedesc.h Sun Jul 6 23:20:48 2014 (r268344) +++ stable/10/sys/sys/filedesc.h Sun Jul 6 23:23:01 2014 (r268345) @@ -153,7 +153,7 @@ int fdcheckstd(struct thread *td); void fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td); void fdcloseexec(struct thread *td); struct filedesc *fdcopy(struct filedesc *fdp); -void fdunshare(struct proc *p, struct thread *td); +void fdunshare(struct thread *td); void fdescfree(struct thread *td); struct filedesc *fdinit(struct filedesc *fdp); struct filedesc *fdshare(struct filedesc *fdp); From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 23:24:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8D4188A1; Sun, 6 Jul 2014 23:24:07 +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 79C8C2FE1; Sun, 6 Jul 2014 23:24:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66NO77c087455; Sun, 6 Jul 2014 23:24:07 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66NO6Hl087451; Sun, 6 Jul 2014 23:24:06 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407062324.s66NO6Hl087451@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 6 Jul 2014 23:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268346 - stable/10/usr.sbin/pw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 23:24:07 -0000 Author: bapt Date: Sun Jul 6 23:24:06 2014 New Revision: 268346 URL: http://svnweb.freebsd.org/changeset/base/268346 Log: MFH: r264781, r267669, r267670 Simplify reading pw.conf(5) by using getline(3) Removed compatibility with pre FreeBSD 2.2 pw_mkdb command [1] Fix some broken indentattion [1] Fix changing the username [2] PR: 189172 [1], 189173 [2] Submitted by: fullermd@over-yonder.net [1][2] Modified: stable/10/usr.sbin/pw/pw.h stable/10/usr.sbin/pw/pw_conf.c stable/10/usr.sbin/pw/pwupd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/pw.h ============================================================================== --- stable/10/usr.sbin/pw/pw.h Sun Jul 6 23:23:01 2014 (r268345) +++ stable/10/usr.sbin/pw/pw.h Sun Jul 6 23:24:06 2014 (r268346) @@ -26,6 +26,7 @@ * $FreeBSD$ */ +#define _WITH_GETLINE #include #include #include Modified: stable/10/usr.sbin/pw/pw_conf.c ============================================================================== --- stable/10/usr.sbin/pw/pw_conf.c Sun Jul 6 23:23:01 2014 (r268345) +++ stable/10/usr.sbin/pw/pw_conf.c Sun Jul 6 23:24:06 2014 (r268346) @@ -226,35 +226,21 @@ newstr(char const * p) struct userconf * read_userconfig(char const * file) { - FILE *fp; + FILE *fp; + char *buf, *p; + size_t linecap; + ssize_t linelen; + + buf = NULL; + linecap = 0; extendarray(&config.groups, &config.numgroups, 200); memset(config.groups, 0, config.numgroups * sizeof(char *)); if (file == NULL) file = _PATH_PW_CONF; - if ((fp = fopen(file, "r")) != NULL) { - int buflen = LNBUFSZ; - char *buf = malloc(buflen); - - nextline: - while (fgets(buf, buflen, fp) != NULL) { - char *p; - - while ((p = strchr(buf, '\n')) == NULL) { - int l; - if (extendline(&buf, &buflen, buflen + LNBUFSZ) == -1) { - int ch; - while ((ch = fgetc(fp)) != '\n' && ch != EOF); - goto nextline; /* Ignore it */ - } - l = strlen(buf); - if (fgets(buf + l, buflen - l, fp) == NULL) - break; /* Unterminated last line */ - } - - if (p != NULL) - *p = '\0'; + if ((fp = fopen(file, "r")) != NULL) { + while ((linelen = getline(&buf, &linecap, fp)) > 0) { if (*buf && (p = strtok(buf, " \t\r\n=")) != NULL && *p != '#') { static char const toks[] = " \t\r\n,="; char *q = strtok(NULL, toks); @@ -368,7 +354,8 @@ read_userconfig(char const * file) } } } - free(buf); + if (linecap > 0) + free(buf); fclose(fp); } return &config; Modified: stable/10/usr.sbin/pw/pwupd.c ============================================================================== --- stable/10/usr.sbin/pw/pwupd.c Sun Jul 6 23:23:01 2014 (r268345) +++ stable/10/usr.sbin/pw/pwupd.c Sun Jul 6 23:24:06 2014 (r268346) @@ -45,9 +45,6 @@ static const char rcsid[] = #include "pwupd.h" -#define HAVE_PWDB_C 1 -#define HAVE_PWDB_U 1 - static char pathpwd[] = _PATH_PWD; static char * pwpath = pathpwd; @@ -112,22 +109,14 @@ pw_update(struct passwd * pwd, char cons { int rc = 0; - /* - * First, let's check the see if the database is alright - * Note: -C is only available in FreeBSD 2.2 and above - */ -#ifdef HAVE_PWDB_C rc = pwdb("-C", (char *)NULL); /* Check only */ if (rc == 0) { -#else - { /* No -C */ -#endif int pfd, tfd; struct passwd *pw = NULL; struct passwd *old_pw = NULL; - if (pwd != NULL) - pw = pw_dup(pwd); + if (pwd != NULL) + pw = pw_dup(pwd); if (user != NULL) old_pw = GETPWNAM(user); @@ -150,7 +139,7 @@ pw_update(struct passwd * pwd, char cons * in case of deletion of a user, the whole database * needs to be regenerated */ - if (pw_mkdb(pw != NULL ? user : NULL) == -1) { + if (pw_mkdb(pw != NULL ? pw->pw_name : NULL) == -1) { pw_fini(); err(1, "pw_mkdb()"); } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 6 23:27:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 729E3B0D; Sun, 6 Jul 2014 23:27: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 5FD992034; Sun, 6 Jul 2014 23:27: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 s66NREsc088017; Sun, 6 Jul 2014 23:27:14 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66NREiZ088016; Sun, 6 Jul 2014 23:27:14 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407062327.s66NREiZ088016@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jul 2014 23:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268348 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 23:27:14 -0000 Author: mjg Date: Sun Jul 6 23:27:13 2014 New Revision: 268348 URL: http://svnweb.freebsd.org/changeset/base/268348 Log: MFC r268002: Call fdcloseexec right after fdunshare. No functional changes. Modified: stable/10/sys/kern/kern_exec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Sun Jul 6 23:26:34 2014 (r268347) +++ stable/10/sys/kern/kern_exec.c Sun Jul 6 23:27:13 2014 (r268348) @@ -598,6 +598,8 @@ interpret: * be shared after an exec. */ fdunshare(td); + /* close files on exec */ + fdcloseexec(td); /* * Malloc things before we need locks. @@ -611,8 +613,6 @@ interpret: bcopy(imgp->args->begin_argv, newargs->ar_args, i); } - /* close files on exec */ - fdcloseexec(td); vn_lock(imgp->vp, LK_SHARED | LK_RETRY); /* Get a reference to the vnode prior to locking the proc */ From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 7 02:47:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5B912267; Mon, 7 Jul 2014 02:47: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 476532E67; Mon, 7 Jul 2014 02:47: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 s672lg0U079845; Mon, 7 Jul 2014 02:47:42 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s672lfMx079842; Mon, 7 Jul 2014 02:47:41 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407070247.s672lfMx079842@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 7 Jul 2014 02:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268352 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2014 02:47:42 -0000 Author: pfg Date: Mon Jul 7 02:47:41 2014 New Revision: 268352 URL: http://svnweb.freebsd.org/changeset/base/268352 Log: MFC r267745, r268268: getopt(3): recognize option:: as GNU extension for "optional options". Also ANSIfy a function declaration. While here update the OpenBSD patch level in getopt_long.c as we already have the corresponding change. Obtained from: NetBSD MFC after: 2 weeks Modified: stable/10/lib/libc/stdlib/getopt.3 stable/10/lib/libc/stdlib/getopt.c stable/10/lib/libc/stdlib/getopt_long.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/getopt.3 ============================================================================== --- stable/10/lib/libc/stdlib/getopt.3 Mon Jul 7 00:27:09 2014 (r268351) +++ stable/10/lib/libc/stdlib/getopt.3 Mon Jul 7 02:47:41 2014 (r268352) @@ -1,4 +1,4 @@ -.\" $NetBSD: getopt.3,v 1.31 2003/09/23 10:26:54 wiz Exp $ +.\" $NetBSD: getopt.3,v 1.34 2014/06/05 22:09:50 wiz Exp $ .\" .\" Copyright (c) 1988, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -30,7 +30,7 @@ .\" @(#)getopt.3 8.5 (Berkeley) 4/27/95 .\" $FreeBSD$ .\" -.Dd April 27, 1995 +.Dd June 5, 2014 .Dt GETOPT 3 .Os .Sh NAME @@ -65,6 +65,17 @@ The option string may contain the following elements: individual characters, and characters followed by a colon to indicate an option argument is to follow. +If an individual character is followed by two colons, then the +option argument is optional; +.Va optarg +is set to the rest of the current +.Va argv +word, or +.Dv NULL +if there were no more characters in the current word. +This is a +.It Tn GNU +extension. For example, an option string .Li \&"x" recognizes an option Modified: stable/10/lib/libc/stdlib/getopt.c ============================================================================== --- stable/10/lib/libc/stdlib/getopt.c Mon Jul 7 00:27:09 2014 (r268351) +++ stable/10/lib/libc/stdlib/getopt.c Mon Jul 7 02:47:41 2014 (r268352) @@ -1,4 +1,4 @@ -/* $NetBSD: getopt.c,v 1.26 2003/08/07 16:43:40 agc Exp $ */ +/* $NetBSD: getopt.c,v 1.29 2014/06/05 22:00:22 christos Exp $ */ /* * Copyright (c) 1987, 1993, 1994 @@ -59,10 +59,7 @@ char *optarg; /* argument associated wi * Parse argc/argv argument vector. */ int -getopt(nargc, nargv, ostr) - int nargc; - char * const nargv[]; - const char *ostr; +getopt(int nargc, char * const nargv[], const char *ostr) { static char *place = EMSG; /* option letter processing */ char *oli; /* option letter list index */ @@ -115,6 +112,12 @@ getopt(nargc, nargv, ostr) entire next argument. */ if (*place) optarg = place; + else if (oli[2] == ':') + /* + * GNU Extension, for optional arguments if the rest of + * the argument is empty, we return NULL + */ + optarg = NULL; else if (nargc > ++optind) optarg = nargv[optind]; else { Modified: stable/10/lib/libc/stdlib/getopt_long.c ============================================================================== --- stable/10/lib/libc/stdlib/getopt_long.c Mon Jul 7 00:27:09 2014 (r268351) +++ stable/10/lib/libc/stdlib/getopt_long.c Mon Jul 7 02:47:41 2014 (r268352) @@ -1,4 +1,4 @@ -/* $OpenBSD: getopt_long.c,v 1.22 2006/10/04 21:29:04 jmc Exp $ */ +/* $OpenBSD: getopt_long.c,v 1.23 2007/10/31 12:34:57 chl Exp $ */ /* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ /* From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 7 05:31:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6EE21A16; Mon, 7 Jul 2014 05:31: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 41E1A2AF0; Mon, 7 Jul 2014 05:31: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 s675VpxH055483; Mon, 7 Jul 2014 05:31:51 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s675Vpmv055482; Mon, 7 Jul 2014 05:31:51 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201407070531.s675Vpmv055482@svn.freebsd.org> From: "Andrey A. Chernov" Date: Mon, 7 Jul 2014 05:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268355 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2014 05:31:51 -0000 Author: ache Date: Mon Jul 7 05:31:50 2014 New Revision: 268355 URL: http://svnweb.freebsd.org/changeset/base/268355 Log: MFC 267756: Merge intermediate OpenBSD v1.25 changes (almost identical to ours) to reduce diff and bump OpenBSD patch level to v1.26. Modified: stable/10/lib/libc/stdlib/getopt_long.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/getopt_long.c ============================================================================== --- stable/10/lib/libc/stdlib/getopt_long.c Mon Jul 7 05:17:16 2014 (r268354) +++ stable/10/lib/libc/stdlib/getopt_long.c Mon Jul 7 05:31:50 2014 (r268355) @@ -1,4 +1,4 @@ -/* $OpenBSD: getopt_long.c,v 1.23 2007/10/31 12:34:57 chl Exp $ */ +/* $OpenBSD: getopt_long.c,v 1.26 2013/06/08 22:47:56 millert Exp $ */ /* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ /* @@ -248,7 +248,7 @@ parse_long_options(char * const *nargv, if (short_too && current_argv_len == 1) continue; - if (match == -1) /* first partial match */ + if (match == -1) /* first partial match */ match = i; else if ((flags & FLAG_LONGONLY) || long_options[i].has_arg != @@ -359,37 +359,31 @@ getopt_internal(int nargc, char * const { char *oli; /* option letter list index */ int optchar, short_too; - int posixly_correct; /* no static, can be changed on the fly */ + static int posixly_correct = -1; if (options == NULL) return (-1); /* + * XXX Some GNU programs (like cvs) set optind to 0 instead of + * XXX using optreset. Work around this braindamage. + */ + if (optind == 0) + optind = optreset = 1; + + /* * Disable GNU extensions if POSIXLY_CORRECT is set or options * string begins with a '+'. */ - posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); -#ifdef GNU_COMPATIBLE + if (posixly_correct == -1 || optreset) + posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); if (*options == '-') flags |= FLAG_ALLARGS; else if (posixly_correct || *options == '+') flags &= ~FLAG_PERMUTE; -#else - if (posixly_correct || *options == '+') - flags &= ~FLAG_PERMUTE; - else if (*options == '-') - flags |= FLAG_ALLARGS; -#endif if (*options == '+' || *options == '-') options++; - /* - * XXX Some GNU programs (like cvs) set optind to 0 instead of - * XXX using optreset. Work around this braindamage. - */ - if (optind == 0) - optind = optreset = 1; - optarg = NULL; if (optreset) nonopt_start = nonopt_end = -1; From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 7 14:16:07 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EE631B0C; Mon, 7 Jul 2014 14:16:07 +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 D723F2A0E; Mon, 7 Jul 2014 14:16:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67EG7GN005662; Mon, 7 Jul 2014 14:16:07 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67EG6qV005651; Mon, 7 Jul 2014 14:16:06 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201407071416.s67EG6qV005651@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 7 Jul 2014 14:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268366 - in stable/10: share/man/man4 sys/amd64/conf sys/conf sys/dev/syscons sys/dev/vt sys/dev/vt/hw/vga sys/i386/conf sys/kern sys/sys usr.sbin/kbdcontrol usr.sbin/vidcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2014 14:16:08 -0000 Author: ray Date: Mon Jul 7 14:16:05 2014 New Revision: 268366 URL: http://svnweb.freebsd.org/changeset/base/268366 Log: 267622 Log: Rename vt(4) vga module to dismiss interference with syscons(4) vga module. 267623 Log: Remove stale link to deleted vt(4) xboxfb driver. 267624 Log: syscons(4) and vt(4) can be built together now. 267625 Log: Allow to disable syscons(4) if "hw.syscons.disable" kenv is set. 267626 Log: Suspend vt(4) initialization if "kern.vt.disable" kenv is set. 267965 by emaste@ Log: Use a common tunable to choose between vt(4)/sc(4) With this change and previous work from ray@ it will be possible to put both in GENERIC, and have one enabled by default, but allow the other to be selected via the loader. (The previous implementation had separate kern.vt.disable and hw.syscons.disable tunables, and would panic if both drivers were compiled in and neither was explicitly disabled.) 268175 by emaste@ Log: Fix vt(4) detection in kbdcontrol and vidcontrol As sc(4) and vt(4) coexist and are both enabled in GENERIC, the existence of a vt(4) sysctl is not sufficient to determine that vt(4) is in use. Reported by: Trond Endrestøl 268045 by emaste@ Log: Add vt(4) to GENERIC and retire the separate VT config vt(4) and sc(4) can now coexist in the same kernel. To choose the vt driver, set the loader tunable kern.vty=vt . Sponsored by: The FreeBSD Foundation Added: stable/10/sys/dev/vt/hw/vga/vt_vga.c - copied unchanged from r267622, head/sys/dev/vt/hw/vga/vt_vga.c stable/10/sys/dev/vt/hw/vga/vt_vga_reg.h - copied unchanged from r267622, head/sys/dev/vt/hw/vga/vt_vga_reg.h Deleted: stable/10/sys/amd64/conf/VT stable/10/sys/dev/vt/hw/vga/vga.c stable/10/sys/dev/vt/hw/vga/vga_reg.h stable/10/sys/i386/conf/VT Modified: stable/10/share/man/man4/vt.4 stable/10/sys/amd64/conf/GENERIC stable/10/sys/conf/files stable/10/sys/conf/files.i386 stable/10/sys/dev/syscons/syscons.c stable/10/sys/dev/syscons/sysmouse.c stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_consolectl.c stable/10/sys/dev/vt/vt_core.c stable/10/sys/dev/vt/vt_sysmouse.c stable/10/sys/i386/conf/GENERIC stable/10/sys/kern/kern_cons.c stable/10/sys/sys/cons.h stable/10/usr.sbin/kbdcontrol/kbdcontrol.c stable/10/usr.sbin/vidcontrol/vidcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/vt.4 ============================================================================== --- stable/10/share/man/man4/vt.4 Mon Jul 7 14:03:30 2014 (r268365) +++ stable/10/share/man/man4/vt.4 Mon Jul 7 14:16:05 2014 (r268366) @@ -44,6 +44,7 @@ In .Xr loader.conf 5 : .Cd hw.vga.textmode=1 +.Cd kern.vty=vt .Sh DESCRIPTION The .Nm @@ -182,6 +183,12 @@ prompt or in Set to 1 to use virtual terminals in text mode instead of graphics mode. Features that require graphics mode, like loadable fonts, will be disabled. +.It Va kern.vty +Set to vt to choose the +.Nm +driver for the system console, if the +.Xr syscons 4 +driver is also compiled in and is the default. .El .Sh EXAMPLES The following line will change the default color of normal text. Modified: stable/10/sys/amd64/conf/GENERIC ============================================================================== --- stable/10/sys/amd64/conf/GENERIC Mon Jul 7 14:03:30 2014 (r268365) +++ stable/10/sys/amd64/conf/GENERIC Mon Jul 7 14:16:05 2014 (r268366) @@ -176,6 +176,11 @@ device splash # Splash screen and scr device sc options SC_PIXEL_MODE # add support for the raster text mode +# vt is the new video console driver +device vt +device vt_vga +device vt_efifb + device agp # support several AGP chipsets # PCCARD (PCMCIA) support Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Jul 7 14:03:30 2014 (r268365) +++ stable/10/sys/conf/files Mon Jul 7 14:16:05 2014 (r268366) @@ -2535,7 +2535,7 @@ dev/vt/colors/vt_termcolors.c optional v dev/vt/font/vt_font_default.c optional vt dev/vt/font/vt_mouse_cursor.c optional vt dev/vt/hw/fb/vt_fb.c optional vt -dev/vt/hw/vga/vga.c optional vt vt_vga +dev/vt/hw/vga/vt_vga.c optional vt vt_vga dev/vt/logo/logo_freebsd.c optional vt splash dev/vt/vt_buf.c optional vt dev/vt/vt_consolectl.c optional vt Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Mon Jul 7 14:03:30 2014 (r268365) +++ stable/10/sys/conf/files.i386 Mon Jul 7 14:16:05 2014 (r268366) @@ -293,7 +293,6 @@ dev/viawd/viawd.c optional viawd dev/vmware/vmxnet3/if_vmx.c optional vmx dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard -dev/vt/hw/xboxfb/xboxfb.c optional vt_xboxfb dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci Modified: stable/10/sys/dev/syscons/syscons.c ============================================================================== --- stable/10/sys/dev/syscons/syscons.c Mon Jul 7 14:03:30 2014 (r268365) +++ stable/10/sys/dev/syscons/syscons.c Mon Jul 7 14:16:05 2014 (r268366) @@ -267,6 +267,8 @@ static struct cdevsw consolectl_devsw = int sc_probe_unit(int unit, int flags) { + if (!vty_enabled(VTY_SC)) + return ENXIO; if (!scvidprobe(unit, flags, FALSE)) { if (bootverbose) printf("%s%d: no video adapter found.\n", SC_DRIVER_NAME, unit); @@ -492,6 +494,9 @@ sc_attach_unit(int unit, int flags) struct cdev *dev; int vc; + if (!vty_enabled(VTY_SC)) + return ENXIO; + flags &= ~SC_KERNEL_CONSOLE; if (sc_console_unit == unit) { @@ -576,6 +581,8 @@ sc_attach_unit(int unit, int flags) static void scmeminit(void *arg) { + if (!vty_enabled(VTY_SC)) + return; if (sc_malloc) return; sc_malloc = TRUE; @@ -1589,6 +1596,11 @@ sc_cnprobe(struct consdev *cp) int unit; int flags; + if (!vty_enabled(VTY_SC)) { + cp->cn_pri = CN_DEAD; + return; + } + cp->cn_pri = sc_get_cons_priority(&unit, &flags); /* a video card is always required */ Modified: stable/10/sys/dev/syscons/sysmouse.c ============================================================================== --- stable/10/sys/dev/syscons/sysmouse.c Mon Jul 7 14:03:30 2014 (r268365) +++ stable/10/sys/dev/syscons/sysmouse.c Mon Jul 7 14:16:05 2014 (r268366) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -165,6 +166,8 @@ static struct ttydevsw smdev_ttydevsw = static void sm_attach_mouse(void *unused) { + if (!vty_enabled(VTY_SC)) + return; sysmouse_tty = tty_alloc(&smdev_ttydevsw, NULL); tty_makedev(sysmouse_tty, NULL, "sysmouse"); } Copied: stable/10/sys/dev/vt/hw/vga/vt_vga.c (from r267622, head/sys/dev/vt/hw/vga/vt_vga.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/vt/hw/vga/vt_vga.c Mon Jul 7 14:16:05 2014 (r268366, copy of r267622, head/sys/dev/vt/hw/vga/vt_vga.c) @@ -0,0 +1,690 @@ +/*- + * Copyright (c) 2005 Marcel Moolenaar + * All rights reserved. + * + * Copyright (c) 2009 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Ed Schouten + * 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 THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include + +#include + +#if defined(__amd64__) || defined(__i386__) +#include +#include +#include +#include +#endif /* __amd64__ || __i386__ */ + +struct vga_softc { + bus_space_tag_t vga_fb_tag; + bus_space_handle_t vga_fb_handle; + bus_space_tag_t vga_reg_tag; + bus_space_handle_t vga_reg_handle; + int vga_curcolor; +}; + +/* Convenience macros. */ +#define MEM_READ1(sc, ofs) \ + bus_space_read_1(sc->vga_fb_tag, sc->vga_fb_handle, ofs) +#define MEM_WRITE1(sc, ofs, val) \ + bus_space_write_1(sc->vga_fb_tag, sc->vga_fb_handle, ofs, val) +#define REG_READ1(sc, reg) \ + bus_space_read_1(sc->vga_reg_tag, sc->vga_reg_handle, reg) +#define REG_WRITE1(sc, reg, val) \ + bus_space_write_1(sc->vga_reg_tag, sc->vga_reg_handle, reg, val) + +#define VT_VGA_WIDTH 640 +#define VT_VGA_HEIGHT 480 +#define VT_VGA_MEMSIZE (VT_VGA_WIDTH * VT_VGA_HEIGHT / 8) + +static vd_probe_t vga_probe; +static vd_init_t vga_init; +static vd_blank_t vga_blank; +static vd_bitbltchr_t vga_bitbltchr; +static vd_maskbitbltchr_t vga_maskbitbltchr; +static vd_drawrect_t vga_drawrect; +static vd_setpixel_t vga_setpixel; +static vd_putchar_t vga_putchar; +static vd_postswitch_t vga_postswitch; + +static const struct vt_driver vt_vga_driver = { + .vd_name = "vga", + .vd_probe = vga_probe, + .vd_init = vga_init, + .vd_blank = vga_blank, + .vd_bitbltchr = vga_bitbltchr, + .vd_maskbitbltchr = vga_maskbitbltchr, + .vd_drawrect = vga_drawrect, + .vd_setpixel = vga_setpixel, + .vd_putchar = vga_putchar, + .vd_postswitch = vga_postswitch, + .vd_priority = VD_PRIORITY_GENERIC, +}; + +/* + * Driver supports both text mode and graphics mode. Make sure the + * buffer is always big enough to support both. + */ +static struct vga_softc vga_conssoftc; +VT_DRIVER_DECLARE(vt_vga, vt_vga_driver); + +static inline void +vga_setcolor(struct vt_device *vd, term_color_t color) +{ + struct vga_softc *sc = vd->vd_softc; + + if (sc->vga_curcolor != color) { + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); + REG_WRITE1(sc, VGA_GC_DATA, color); + sc->vga_curcolor = color; + } +} + +static void +vga_blank(struct vt_device *vd, term_color_t color) +{ + struct vga_softc *sc = vd->vd_softc; + u_int ofs; + + vga_setcolor(vd, color); + for (ofs = 0; ofs < VT_VGA_MEMSIZE; ofs++) + MEM_WRITE1(sc, ofs, 0xff); +} + +static inline void +vga_bitblt_put(struct vt_device *vd, u_long dst, term_color_t color, + uint8_t v) +{ + struct vga_softc *sc = vd->vd_softc; + + /* Skip empty writes, in order to avoid palette changes. */ + if (v != 0x00) { + vga_setcolor(vd, color); + /* + * When this MEM_READ1() gets disabled, all sorts of + * artifacts occur. This is because this read loads the + * set of 8 pixels that are about to be changed. There + * is one scenario where we can avoid the read, namely + * if all pixels are about to be overwritten anyway. + */ + if (v != 0xff) + MEM_READ1(sc, dst); + MEM_WRITE1(sc, dst, v); + } +} + +static void +vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) +{ + + vga_bitblt_put(vd, (y * VT_VGA_WIDTH / 8) + (x / 8), color, + 0x80 >> (x % 8)); +} + +static void +vga_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, + term_color_t color) +{ + int x, y; + + for (y = y1; y <= y2; y++) { + if (fill || (y == y1) || (y == y2)) { + for (x = x1; x <= x2; x++) + vga_setpixel(vd, x, y, color); + } else { + vga_setpixel(vd, x1, y, color); + vga_setpixel(vd, x2, y, color); + } + } +} + +static inline void +vga_bitblt_draw(struct vt_device *vd, const uint8_t *src, + u_long ldst, uint8_t shift, unsigned int width, unsigned int height, + term_color_t color, int negate) +{ + u_long dst; + int w; + uint8_t b, r, out; + + for (; height > 0; height--) { + dst = ldst; + ldst += VT_VGA_WIDTH / 8; + r = 0; + for (w = width; w > 0; w -= 8) { + b = *src++; + if (negate) { + b = ~b; + /* Don't go too far. */ + if (w < 8) + b &= 0xff << (8 - w); + } + /* Reintroduce bits from previous column. */ + out = (b >> shift) | r; + r = b << (8 - shift); + vga_bitblt_put(vd, dst++, color, out); + } + /* Print the remainder. */ + vga_bitblt_put(vd, dst, color, r); + } +} + +static void +vga_bitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, + int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, + unsigned int height, term_color_t fg, term_color_t bg) +{ + u_long dst, ldst; + int w; + + /* Don't try to put off screen pixels */ + if (((left + width) > VT_VGA_WIDTH) || ((top + height) > + VT_VGA_HEIGHT)) + return; + + dst = (VT_VGA_WIDTH * top + left) / 8; + + for (; height > 0; height--) { + ldst = dst; + for (w = width; w > 0; w -= 8) { + vga_bitblt_put(vd, ldst, fg, *src); + vga_bitblt_put(vd, ldst, bg, ~*src); + ldst++; + src++; + } + dst += VT_VGA_WIDTH / 8; + } +} + +/* Bitblt with mask support. Slow. */ +static void +vga_maskbitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, + int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, + unsigned int height, term_color_t fg, term_color_t bg) +{ + struct vga_softc *sc = vd->vd_softc; + u_long dst; + uint8_t shift; + + dst = (VT_VGA_WIDTH * top + left) / 8; + shift = left % 8; + + /* Don't try to put off screen pixels */ + if (((left + width) > VT_VGA_WIDTH) || ((top + height) > + VT_VGA_HEIGHT)) + return; + + if (sc->vga_curcolor == fg) { + vga_bitblt_draw(vd, src, dst, shift, width, height, fg, 0); + vga_bitblt_draw(vd, src, dst, shift, width, height, bg, 1); + } else { + vga_bitblt_draw(vd, src, dst, shift, width, height, bg, 1); + vga_bitblt_draw(vd, src, dst, shift, width, height, fg, 0); + } +} + +/* + * Binary searchable table for Unicode to CP437 conversion. + */ + +struct unicp437 { + uint16_t unicode_base; + uint8_t cp437_base; + uint8_t length; +}; + +static const struct unicp437 cp437table[] = { + { 0x0020, 0x20, 0x5e }, { 0x00a0, 0x20, 0x00 }, + { 0x00a1, 0xad, 0x00 }, { 0x00a2, 0x9b, 0x00 }, + { 0x00a3, 0x9c, 0x00 }, { 0x00a5, 0x9d, 0x00 }, + { 0x00a7, 0x15, 0x00 }, { 0x00aa, 0xa6, 0x00 }, + { 0x00ab, 0xae, 0x00 }, { 0x00ac, 0xaa, 0x00 }, + { 0x00b0, 0xf8, 0x00 }, { 0x00b1, 0xf1, 0x00 }, + { 0x00b2, 0xfd, 0x00 }, { 0x00b5, 0xe6, 0x00 }, + { 0x00b6, 0x14, 0x00 }, { 0x00b7, 0xfa, 0x00 }, + { 0x00ba, 0xa7, 0x00 }, { 0x00bb, 0xaf, 0x00 }, + { 0x00bc, 0xac, 0x00 }, { 0x00bd, 0xab, 0x00 }, + { 0x00bf, 0xa8, 0x00 }, { 0x00c4, 0x8e, 0x01 }, + { 0x00c6, 0x92, 0x00 }, { 0x00c7, 0x80, 0x00 }, + { 0x00c9, 0x90, 0x00 }, { 0x00d1, 0xa5, 0x00 }, + { 0x00d6, 0x99, 0x00 }, { 0x00dc, 0x9a, 0x00 }, + { 0x00df, 0xe1, 0x00 }, { 0x00e0, 0x85, 0x00 }, + { 0x00e1, 0xa0, 0x00 }, { 0x00e2, 0x83, 0x00 }, + { 0x00e4, 0x84, 0x00 }, { 0x00e5, 0x86, 0x00 }, + { 0x00e6, 0x91, 0x00 }, { 0x00e7, 0x87, 0x00 }, + { 0x00e8, 0x8a, 0x00 }, { 0x00e9, 0x82, 0x00 }, + { 0x00ea, 0x88, 0x01 }, { 0x00ec, 0x8d, 0x00 }, + { 0x00ed, 0xa1, 0x00 }, { 0x00ee, 0x8c, 0x00 }, + { 0x00ef, 0x8b, 0x00 }, { 0x00f0, 0xeb, 0x00 }, + { 0x00f1, 0xa4, 0x00 }, { 0x00f2, 0x95, 0x00 }, + { 0x00f3, 0xa2, 0x00 }, { 0x00f4, 0x93, 0x00 }, + { 0x00f6, 0x94, 0x00 }, { 0x00f7, 0xf6, 0x00 }, + { 0x00f8, 0xed, 0x00 }, { 0x00f9, 0x97, 0x00 }, + { 0x00fa, 0xa3, 0x00 }, { 0x00fb, 0x96, 0x00 }, + { 0x00fc, 0x81, 0x00 }, { 0x00ff, 0x98, 0x00 }, + { 0x0192, 0x9f, 0x00 }, { 0x0393, 0xe2, 0x00 }, + { 0x0398, 0xe9, 0x00 }, { 0x03a3, 0xe4, 0x00 }, + { 0x03a6, 0xe8, 0x00 }, { 0x03a9, 0xea, 0x00 }, + { 0x03b1, 0xe0, 0x01 }, { 0x03b4, 0xeb, 0x00 }, + { 0x03b5, 0xee, 0x00 }, { 0x03bc, 0xe6, 0x00 }, + { 0x03c0, 0xe3, 0x00 }, { 0x03c3, 0xe5, 0x00 }, + { 0x03c4, 0xe7, 0x00 }, { 0x03c6, 0xed, 0x00 }, + { 0x03d5, 0xed, 0x00 }, { 0x2010, 0x2d, 0x00 }, + { 0x2014, 0x2d, 0x00 }, { 0x2018, 0x60, 0x00 }, + { 0x2019, 0x27, 0x00 }, { 0x201c, 0x22, 0x00 }, + { 0x201d, 0x22, 0x00 }, { 0x2022, 0x07, 0x00 }, + { 0x203c, 0x13, 0x00 }, { 0x207f, 0xfc, 0x00 }, + { 0x20a7, 0x9e, 0x00 }, { 0x20ac, 0xee, 0x00 }, + { 0x2126, 0xea, 0x00 }, { 0x2190, 0x1b, 0x00 }, + { 0x2191, 0x18, 0x00 }, { 0x2192, 0x1a, 0x00 }, + { 0x2193, 0x19, 0x00 }, { 0x2194, 0x1d, 0x00 }, + { 0x2195, 0x12, 0x00 }, { 0x21a8, 0x17, 0x00 }, + { 0x2202, 0xeb, 0x00 }, { 0x2208, 0xee, 0x00 }, + { 0x2211, 0xe4, 0x00 }, { 0x2212, 0x2d, 0x00 }, + { 0x2219, 0xf9, 0x00 }, { 0x221a, 0xfb, 0x00 }, + { 0x221e, 0xec, 0x00 }, { 0x221f, 0x1c, 0x00 }, + { 0x2229, 0xef, 0x00 }, { 0x2248, 0xf7, 0x00 }, + { 0x2261, 0xf0, 0x00 }, { 0x2264, 0xf3, 0x00 }, + { 0x2265, 0xf2, 0x00 }, { 0x2302, 0x7f, 0x00 }, + { 0x2310, 0xa9, 0x00 }, { 0x2320, 0xf4, 0x00 }, + { 0x2321, 0xf5, 0x00 }, { 0x2500, 0xc4, 0x00 }, + { 0x2502, 0xb3, 0x00 }, { 0x250c, 0xda, 0x00 }, + { 0x2510, 0xbf, 0x00 }, { 0x2514, 0xc0, 0x00 }, + { 0x2518, 0xd9, 0x00 }, { 0x251c, 0xc3, 0x00 }, + { 0x2524, 0xb4, 0x00 }, { 0x252c, 0xc2, 0x00 }, + { 0x2534, 0xc1, 0x00 }, { 0x253c, 0xc5, 0x00 }, + { 0x2550, 0xcd, 0x00 }, { 0x2551, 0xba, 0x00 }, + { 0x2552, 0xd5, 0x00 }, { 0x2553, 0xd6, 0x00 }, + { 0x2554, 0xc9, 0x00 }, { 0x2555, 0xb8, 0x00 }, + { 0x2556, 0xb7, 0x00 }, { 0x2557, 0xbb, 0x00 }, + { 0x2558, 0xd4, 0x00 }, { 0x2559, 0xd3, 0x00 }, + { 0x255a, 0xc8, 0x00 }, { 0x255b, 0xbe, 0x00 }, + { 0x255c, 0xbd, 0x00 }, { 0x255d, 0xbc, 0x00 }, + { 0x255e, 0xc6, 0x01 }, { 0x2560, 0xcc, 0x00 }, + { 0x2561, 0xb5, 0x00 }, { 0x2562, 0xb6, 0x00 }, + { 0x2563, 0xb9, 0x00 }, { 0x2564, 0xd1, 0x01 }, + { 0x2566, 0xcb, 0x00 }, { 0x2567, 0xcf, 0x00 }, + { 0x2568, 0xd0, 0x00 }, { 0x2569, 0xca, 0x00 }, + { 0x256a, 0xd8, 0x00 }, { 0x256b, 0xd7, 0x00 }, + { 0x256c, 0xce, 0x00 }, { 0x2580, 0xdf, 0x00 }, + { 0x2584, 0xdc, 0x00 }, { 0x2588, 0xdb, 0x00 }, + { 0x258c, 0xdd, 0x00 }, { 0x2590, 0xde, 0x00 }, + { 0x2591, 0xb0, 0x02 }, { 0x25a0, 0xfe, 0x00 }, + { 0x25ac, 0x16, 0x00 }, { 0x25b2, 0x1e, 0x00 }, + { 0x25ba, 0x10, 0x00 }, { 0x25bc, 0x1f, 0x00 }, + { 0x25c4, 0x11, 0x00 }, { 0x25cb, 0x09, 0x00 }, + { 0x25d8, 0x08, 0x00 }, { 0x25d9, 0x0a, 0x00 }, + { 0x263a, 0x01, 0x01 }, { 0x263c, 0x0f, 0x00 }, + { 0x2640, 0x0c, 0x00 }, { 0x2642, 0x0b, 0x00 }, + { 0x2660, 0x06, 0x00 }, { 0x2663, 0x05, 0x00 }, + { 0x2665, 0x03, 0x01 }, { 0x266a, 0x0d, 0x00 }, + { 0x266c, 0x0e, 0x00 }, +}; + +static uint8_t +vga_get_cp437(term_char_t c) +{ + int min, mid, max; + + min = 0; + max = (sizeof(cp437table) / sizeof(struct unicp437)) - 1; + + if (c < cp437table[0].unicode_base || + c > cp437table[max].unicode_base + cp437table[max].length) + return '?'; + + while (max >= min) { + mid = (min + max) / 2; + if (c < cp437table[mid].unicode_base) + max = mid - 1; + else if (c > cp437table[mid].unicode_base + + cp437table[mid].length) + min = mid + 1; + else + return (c - cp437table[mid].unicode_base + + cp437table[mid].cp437_base); + } + + return '?'; +} + +static void +vga_putchar(struct vt_device *vd, term_char_t c, + vt_axis_t top, vt_axis_t left, term_color_t fg, term_color_t bg) +{ + struct vga_softc *sc = vd->vd_softc; + uint8_t ch, attr; + + /* + * Convert character to CP437, which is the character set used + * by the VGA hardware by default. + */ + ch = vga_get_cp437(c); + + /* + * Convert colors to VGA attributes. + */ + attr = bg << 4 | fg; + + MEM_WRITE1(sc, 0x18000 + (top * 80 + left) * 2 + 0, ch); + MEM_WRITE1(sc, 0x18000 + (top * 80 + left) * 2 + 1, attr); +} + +static void +vga_initialize_graphics(struct vt_device *vd) +{ + struct vga_softc *sc = vd->vd_softc; + + /* Clock select. */ + REG_WRITE1(sc, VGA_GEN_MISC_OUTPUT_W, VGA_GEN_MO_VSP | VGA_GEN_MO_HSP | + VGA_GEN_MO_PB | VGA_GEN_MO_ER | VGA_GEN_MO_IOA); + /* Set sequencer clocking and memory mode. */ + REG_WRITE1(sc, VGA_SEQ_ADDRESS, VGA_SEQ_CLOCKING_MODE); + REG_WRITE1(sc, VGA_SEQ_DATA, VGA_SEQ_CM_89); + REG_WRITE1(sc, VGA_SEQ_ADDRESS, VGA_SEQ_MEMORY_MODE); + REG_WRITE1(sc, VGA_SEQ_DATA, VGA_SEQ_MM_OE | VGA_SEQ_MM_EM); + + /* Set the graphics controller in graphics mode. */ + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_MISCELLANEOUS); + REG_WRITE1(sc, VGA_GC_DATA, 0x04 + VGA_GC_MISC_GA); + /* Program the CRT controller. */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_TOTAL); + REG_WRITE1(sc, VGA_CRTC_DATA, 0x5f); /* 760 */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_HORIZ_DISP_END); + REG_WRITE1(sc, VGA_CRTC_DATA, 0x4f); /* 640 - 8 */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_HORIZ_BLANK); + REG_WRITE1(sc, VGA_CRTC_DATA, 0x50); /* 640 */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_HORIZ_BLANK); + REG_WRITE1(sc, VGA_CRTC_DATA, VGA_CRTC_EHB_CR + 2); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_HORIZ_RETRACE); + REG_WRITE1(sc, VGA_CRTC_DATA, 0x54); /* 672 */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_HORIZ_RETRACE); + REG_WRITE1(sc, VGA_CRTC_DATA, VGA_CRTC_EHR_EHB + 0); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_TOTAL); + REG_WRITE1(sc, VGA_CRTC_DATA, 0x0b); /* 523 */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_OVERFLOW); + REG_WRITE1(sc, VGA_CRTC_DATA, VGA_CRTC_OF_VT9 | VGA_CRTC_OF_LC8 | + VGA_CRTC_OF_VBS8 | VGA_CRTC_OF_VRS8 | VGA_CRTC_OF_VDE8); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MAX_SCAN_LINE); + REG_WRITE1(sc, VGA_CRTC_DATA, VGA_CRTC_MSL_LC9); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_START); + REG_WRITE1(sc, VGA_CRTC_DATA, 0xea); /* 480 + 10 */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); + REG_WRITE1(sc, VGA_CRTC_DATA, 0x0c); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_DISPLAY_END); + REG_WRITE1(sc, VGA_CRTC_DATA, 0xdf); /* 480 - 1*/ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_OFFSET); + REG_WRITE1(sc, VGA_CRTC_DATA, 0x28); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_VERT_BLANK); + REG_WRITE1(sc, VGA_CRTC_DATA, 0xe7); /* 480 + 7 */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_END_VERT_BLANK); + REG_WRITE1(sc, VGA_CRTC_DATA, 0x04); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); + REG_WRITE1(sc, VGA_CRTC_DATA, VGA_CRTC_MC_WB | VGA_CRTC_MC_AW | + VGA_CRTC_MC_SRS | VGA_CRTC_MC_CMS); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_LINE_COMPARE); + REG_WRITE1(sc, VGA_CRTC_DATA, 0xff); /* 480 + 31 */ + + REG_WRITE1(sc, VGA_GEN_FEATURE_CTRL_W, 0); + + REG_WRITE1(sc, VGA_SEQ_ADDRESS, VGA_SEQ_MAP_MASK); + REG_WRITE1(sc, VGA_SEQ_DATA, VGA_SEQ_MM_EM3 | VGA_SEQ_MM_EM2 | + VGA_SEQ_MM_EM1 | VGA_SEQ_MM_EM0); + REG_WRITE1(sc, VGA_SEQ_ADDRESS, VGA_SEQ_CHAR_MAP_SELECT); + REG_WRITE1(sc, VGA_SEQ_DATA, 0); + + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_SET_RESET); + REG_WRITE1(sc, VGA_GC_DATA, 0); + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); + REG_WRITE1(sc, VGA_GC_DATA, 0x0f); + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_COLOR_COMPARE); + REG_WRITE1(sc, VGA_GC_DATA, 0); + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_DATA_ROTATE); + REG_WRITE1(sc, VGA_GC_DATA, 0); + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_READ_MAP_SELECT); + REG_WRITE1(sc, VGA_GC_DATA, 0); + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_MODE); + REG_WRITE1(sc, VGA_GC_DATA, 0); + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_COLOR_DONT_CARE); + REG_WRITE1(sc, VGA_GC_DATA, 0x0f); + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_BIT_MASK); + REG_WRITE1(sc, VGA_GC_DATA, 0xff); +} + +static void +vga_initialize(struct vt_device *vd, int textmode) +{ + struct vga_softc *sc = vd->vd_softc; + uint8_t x; + + /* Make sure the VGA adapter is not in monochrome emulation mode. */ + x = REG_READ1(sc, VGA_GEN_MISC_OUTPUT_R); + REG_WRITE1(sc, VGA_GEN_MISC_OUTPUT_W, x | VGA_GEN_MO_IOA); + + /* Unprotect CRTC registers 0-7. */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_VERT_RETRACE_END); + x = REG_READ1(sc, VGA_CRTC_DATA); + REG_WRITE1(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_VRE_PR); + + /* + * Wait for the vertical retrace. + * NOTE: this code reads the VGA_GEN_INPUT_STAT_1 register, which has + * the side-effect of clearing the internal flip-flip of the attribute + * controller's write register. This means that because this code is + * here, we know for sure that the first write to the attribute + * controller will be a write to the address register. Removing this + * code therefore also removes that guarantee and appropriate measures + * need to be taken. + */ + do { + x = REG_READ1(sc, VGA_GEN_INPUT_STAT_1); + x &= VGA_GEN_IS1_VR | VGA_GEN_IS1_DE; + } while (x != (VGA_GEN_IS1_VR | VGA_GEN_IS1_DE)); + + /* Now, disable the sync. signals. */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); + x = REG_READ1(sc, VGA_CRTC_DATA); + REG_WRITE1(sc, VGA_CRTC_DATA, x & ~VGA_CRTC_MC_HR); + + /* Asynchronous sequencer reset. */ + REG_WRITE1(sc, VGA_SEQ_ADDRESS, VGA_SEQ_RESET); + REG_WRITE1(sc, VGA_SEQ_DATA, VGA_SEQ_RST_SR); + + if (!textmode) + vga_initialize_graphics(vd); + + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_PRESET_ROW_SCAN); + REG_WRITE1(sc, VGA_CRTC_DATA, 0); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_START); + REG_WRITE1(sc, VGA_CRTC_DATA, VGA_CRTC_CS_COO); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_END); + REG_WRITE1(sc, VGA_CRTC_DATA, 0); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_HIGH); + REG_WRITE1(sc, VGA_CRTC_DATA, 0); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_START_ADDR_LOW); + REG_WRITE1(sc, VGA_CRTC_DATA, 0); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_HIGH); + REG_WRITE1(sc, VGA_CRTC_DATA, 0); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_CURSOR_LOC_LOW); + REG_WRITE1(sc, VGA_CRTC_DATA, 0x59); + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_UNDERLINE_LOC); + REG_WRITE1(sc, VGA_CRTC_DATA, VGA_CRTC_UL_UL); + + if (textmode) { + /* Set the attribute controller to blink disable. */ + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_MODE_CONTROL); + REG_WRITE1(sc, VGA_AC_WRITE, 0); + } else { + /* Set the attribute controller in graphics mode. */ + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_MODE_CONTROL); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_MC_GA); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_HORIZ_PIXEL_PANNING); + REG_WRITE1(sc, VGA_AC_WRITE, 0); + } + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(0)); + REG_WRITE1(sc, VGA_AC_WRITE, 0); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(1)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_R); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(2)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_G); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(3)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_SG | VGA_AC_PAL_R); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(4)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_B); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(5)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_R | VGA_AC_PAL_B); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(6)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_G | VGA_AC_PAL_B); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(7)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_R | VGA_AC_PAL_G | VGA_AC_PAL_B); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(8)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(9)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_R); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(10)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_G); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(11)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_R | VGA_AC_PAL_G); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(12)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_B); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(13)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_R | VGA_AC_PAL_B); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(14)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_G | VGA_AC_PAL_B); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PALETTE(15)); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_PAL_SR | VGA_AC_PAL_SG | + VGA_AC_PAL_SB | VGA_AC_PAL_R | VGA_AC_PAL_G | VGA_AC_PAL_B); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_OVERSCAN_COLOR); + REG_WRITE1(sc, VGA_AC_WRITE, 0); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_COLOR_PLANE_ENABLE); + REG_WRITE1(sc, VGA_AC_WRITE, 0x0f); + REG_WRITE1(sc, VGA_AC_WRITE, VGA_AC_COLOR_SELECT); + REG_WRITE1(sc, VGA_AC_WRITE, 0); + + if (!textmode) { + u_int ofs; + + /* + * Done. Clear the frame buffer. All bit planes are + * enabled, so a single-paged loop should clear all + * planes. + */ + for (ofs = 0; ofs < VT_VGA_MEMSIZE; ofs++) { + MEM_READ1(sc, ofs); + MEM_WRITE1(sc, ofs, 0); + } + } + + /* Re-enable the sequencer. */ + REG_WRITE1(sc, VGA_SEQ_ADDRESS, VGA_SEQ_RESET); + REG_WRITE1(sc, VGA_SEQ_DATA, VGA_SEQ_RST_SR | VGA_SEQ_RST_NAR); + /* Re-enable the sync signals. */ + REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL); + x = REG_READ1(sc, VGA_CRTC_DATA); + REG_WRITE1(sc, VGA_CRTC_DATA, x | VGA_CRTC_MC_HR); + + if (!textmode) { + /* Switch to write mode 3, because we'll mainly do bitblt. */ + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_MODE); + REG_WRITE1(sc, VGA_GC_DATA, 3); + REG_WRITE1(sc, VGA_GC_ADDRESS, VGA_GC_ENABLE_SET_RESET); + REG_WRITE1(sc, VGA_GC_DATA, 0x0f); + } +} + +static int +vga_probe(struct vt_device *vd) +{ + + return (CN_INTERNAL); +} + +static int +vga_init(struct vt_device *vd) +{ + struct vga_softc *sc; + int textmode; + + if (vd->vd_softc == NULL) + vd->vd_softc = (void *)&vga_conssoftc; + sc = vd->vd_softc; + textmode = 0; + +#if defined(__amd64__) || defined(__i386__) + sc->vga_fb_tag = X86_BUS_SPACE_MEM; + sc->vga_fb_handle = KERNBASE + VGA_MEM_BASE; + sc->vga_reg_tag = X86_BUS_SPACE_IO; + sc->vga_reg_handle = VGA_REG_BASE; +#elif defined(__ia64__) + sc->vga_fb_tag = IA64_BUS_SPACE_MEM; + sc->vga_fb_handle = IA64_PHYS_TO_RR6(VGA_MEM_BASE); + sc->vga_reg_tag = IA64_BUS_SPACE_IO; + sc->vga_reg_handle = VGA_REG_BASE; +#else +# error "Architecture not yet supported!" +#endif + + TUNABLE_INT_FETCH("hw.vga.textmode", &textmode); + if (textmode) { + vd->vd_flags |= VDF_TEXTMODE; + vd->vd_width = 80; + vd->vd_height = 25; + } else { + vd->vd_width = VT_VGA_WIDTH; + vd->vd_height = VT_VGA_HEIGHT; + } + vga_initialize(vd, textmode); + + return (CN_INTERNAL); +} + +static void +vga_postswitch(struct vt_device *vd) +{ + + /* Reinit VGA mode, to restore view after app which change mode. */ + vga_initialize(vd, (vd->vd_flags & VDF_TEXTMODE)); + /* Ask vt(9) to update chars on visible area. */ + vd->vd_flags |= VDF_INVALID; +} Copied: stable/10/sys/dev/vt/hw/vga/vt_vga_reg.h (from r267622, head/sys/dev/vt/hw/vga/vt_vga_reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/vt/hw/vga/vt_vga_reg.h Mon Jul 7 14:16:05 2014 (r268366, copy of r267622, head/sys/dev/vt/hw/vga/vt_vga_reg.h) @@ -0,0 +1,220 @@ +/*- + * Copyright (c) 2005 Marcel Moolenaar + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_VT_HW_VGA_VGA_REG_H_ +#define _DEV_VT_HW_VGA_VGA_REG_H_ + +/* + * The VGA adapter uses two I/O port blocks. One of these blocks, the CRT + * controller registers, can be located either at 0x3B0 or at 0x3D0 in I/O + * port space. This allows compatibility with the monochrome adapter, which + * has the CRT controller registers at 0x3B0. + * + * It is assumed that compatibility with the monochrome adapter is not of + * interest anymore. As such, the CRT controller can be located at 0x3D0 in + * I/O port space unconditionally. This means that the 2 I/O blocks are + * always adjacent and can therefore be treated as a single logical I/O port + * range. In practical terms: there only has to be a single tag and handle + * to access all registers. + * + * The following definitions are taken from or inspired by: + * Programmer's Guide to the EGA, VGA, and Super VGA Cards -- 3rd ed., + * Richard F. Ferraro, Addison-Wesley, ISBN 0-201-62490-7 + */ + +#define VGA_MEM_BASE 0xA0000 +#define VGA_MEM_SIZE 0x10000 +#define VGA_REG_BASE 0x3c0 +#define VGA_REG_SIZE 0x10+0x0c + +/* Attribute controller registers. */ +#define VGA_AC_WRITE 0x00 +#define VGA_AC_READ 0x01 +#define VGA_AC_PALETTE(x) (x) /* 0 <= x <= 15 */ +#define VGA_AC_PAL_SR 0x20 /* Secondary red */ +#define VGA_AC_PAL_SG 0x10 /* Secondary green */ +#define VGA_AC_PAL_SB 0x08 /* Secondary blue */ +#define VGA_AC_PAL_R 0x04 /* Red */ +#define VGA_AC_PAL_G 0x02 /* Green */ +#define VGA_AC_PAL_B 0x01 /* Blue */ +#define VGA_AC_MODE_CONTROL (32+16) +#define VGA_AC_MC_IPS 0x80 /* Internal palette size */ +#define VGA_AC_MC_PCS 0x40 /* Pixel clock select */ +#define VGA_AC_MC_PPC 0x20 /* Pixel panning compat. */ +#define VGA_AC_MC_BI 0x08 /* Blink/intensity */ +#define VGA_AC_MC_ELG 0x04 /* Enable line graphics cc. */ +#define VGA_AC_MC_DT 0x02 /* Display type */ +#define VGA_AC_MC_GA 0x01 /* Graphics/alphanumeric */ +#define VGA_AC_OVERSCAN_COLOR (32+17) +#define VGA_AC_COLOR_PLANE_ENABLE (32+18) +#define VGA_AC_HORIZ_PIXEL_PANNING (32+19) +#define VGA_AC_COLOR_SELECT (32+20) +#define VGA_AC_CS_C67 0x0C /* Color reg. addr. bits 6+7 */ +#define VGA_AC_CS_C45 0x03 /* Color reg. addr. bits 4+5 */ + +/* General registers. */ +#define VGA_GEN_MISC_OUTPUT_W 0x02 /* Write only. */ +#define VGA_GEN_MISC_OUTPUT_R 0x0c /* Read only. */ +#define VGA_GEN_MO_VSP 0x80 /* Vertical sync. polarity */ +#define VGA_GEN_MO_HSP 0x40 /* Horiz. sync. polarity */ +#define VGA_GEN_MO_PB 0x20 /* Page bit for odd/even */ +#define VGA_GEN_MO_CS 0x0C /* Clock select */ +#define VGA_GEN_MO_ER 0x02 /* Enable RAM */ +#define VGA_GEN_MO_IOA 0x01 /* Input/output address */ +#define VGA_GEN_INPUT_STAT_0 0x02 /* Read only. */ +#define VGA_GEN_FEATURE_CTRL_W 0x1a /* Write only. */ +#define VGA_GEN_FEATURE_CTRL_R 0x0a /* Read only. */ +#define VGA_GEN_INPUT_STAT_1 0x1a /* Read only. */ +#define VGA_GEN_IS1_VR 0x08 /* Vertical retrace */ +#define VGA_GEN_IS1_DE 0x01 /* Display enable not */ + +/* Sequencer registers. */ +#define VGA_SEQ_ADDRESS 0x04 +#define VGA_SEQ_RESET 0 +#define VGA_SEQ_RST_SR 0x02 /* Synchronous reset */ +#define VGA_SEQ_RST_NAR 0x01 /* No async. reset */ +#define VGA_SEQ_CLOCKING_MODE 1 +#define VGA_SEQ_CM_SO 0x20 /* Screen off */ +#define VGA_SEQ_CM_S4 0x10 /* Shift four */ +#define VGA_SEQ_CM_DC 0x08 /* Dot clock */ +#define VGA_SEQ_CM_SL 0x04 /* Shift load */ +#define VGA_SEQ_CM_89 0x01 /* 8/9 Dot clocks */ +#define VGA_SEQ_MAP_MASK 2 +#define VGA_SEQ_MM_EM3 0x08 /* Enable memory plane 3 */ +#define VGA_SEQ_MM_EM2 0x04 /* Enable memory plane 2 */ +#define VGA_SEQ_MM_EM1 0x02 /* Enable memory plane 1 */ +#define VGA_SEQ_MM_EM0 0x01 /* Enable memory plane 0 */ +#define VGA_SEQ_CHAR_MAP_SELECT 3 +#define VGA_SEQ_CMS_SAH 0x20 /* Char. A (bit 2) */ +#define VGA_SEQ_CMS_SBH 0x10 /* Char. B (bit 2) */ +#define VGA_SEQ_CMS_SA 0x0C /* Char. A (bit 0+1) */ +#define VGA_SEQ_CMS_SB 0x03 /* Char. B (bit 0+1) */ +#define VGA_SEQ_MEMORY_MODE 4 +#define VGA_SEQ_MM_C4 0x08 /* Chain four */ +#define VGA_SEQ_MM_OE 0x04 /* Odd/even */ +#define VGA_SEQ_MM_EM 0x02 /* Extended memory */ +#define VGA_SEQ_DATA 0x05 + +/* Color registers. */ +#define VGA_PEL_MASK 0x06 +#define VGA_PEL_ADDR_RD_MODE 0x07 /* Write only. */ +#define VGA_DAC_STATE 0x07 /* Read only. */ +#define VGA_PEL_ADDR_WR_MODE 0x08 +#define VGA_PEL_DATA 0x09 + +/* Graphics controller registers. */ +#define VGA_GC_ADDRESS 0x0e +#define VGA_GC_SET_RESET 0 +#define VGA_GC_ENABLE_SET_RESET 1 +#define VGA_GC_COLOR_COMPARE 2 +#define VGA_GC_DATA_ROTATE 3 +#define VGA_GC_DR_FS_XOR 0x18 /* Function select - XOR */ +#define VGA_GC_DR_FS_OR 0x10 /* Function select - OR */ +#define VGA_GC_DR_FS_AND 0x08 /* Function select - AND */ +#define VGA_GC_DR_RC 0x07 /* Rotate count */ +#define VGA_GC_READ_MAP_SELECT 4 +#define VGA_GC_MODE 5 +#define VGA_GC_MODE_SR 0x60 /* Shift register */ +#define VGA_GC_MODE_OE 0x10 /* Odd/even */ +#define VGA_GC_MODE_RM 0x08 /* Read mode */ +#define VGA_GC_MODE_WM 0x03 /* Write mode */ +#define VGA_GC_MISCELLANEOUS 6 +#define VGA_GC_MISC_MM 0x0C /* memory map */ +#define VGA_GC_MISC_COE 0x02 /* Chain odd/even */ +#define VGA_GC_MISC_GA 0x01 /* Graphics/text mode */ +#define VGA_GC_COLOR_DONT_CARE 7 +#define VGA_GC_BIT_MASK 8 +#define VGA_GC_DATA 0x0f + +/* CRT controller registers. */ +#define VGA_CRTC_ADDRESS 0x14 +#define VGA_CRTC_HORIZ_TOTAL 0 +#define VGA_CRTC_HORIZ_DISP_END 1 +#define VGA_CRTC_START_HORIZ_BLANK 2 +#define VGA_CRTC_END_HORIZ_BLANK 3 +#define VGA_CRTC_EHB_CR 0x80 /* Compatible read */ +#define VGA_CRTC_EHB_DES 0x60 /* Display enable skew */ +#define VGA_CRTC_EHB_EHB 0x1F /* End horizontal blank */ +#define VGA_CRTC_START_HORIZ_RETRACE 4 +#define VGA_CRTC_END_HORIZ_RETRACE 5 +#define VGA_CRTC_EHR_EHB 0x80 /* End horizontal blanking */ +#define VGA_CRTC_EHR_HRD 0x60 /* Horizontal retrace delay */ +#define VGA_CRTC_EHR_EHR 0x1F /* End horizontal retrace */ +#define VGA_CRTC_VERT_TOTAL 6 +#define VGA_CRTC_OVERFLOW 7 +#define VGA_CRTC_OF_VRS9 0x80 /* Vertical retrace start */ +#define VGA_CRTC_OF_VDE9 0x40 /* Vertical disp. enable end */ +#define VGA_CRTC_OF_VT9 0x20 /* Vertical total (bit 9) */ +#define VGA_CRTC_OF_LC8 0x10 /* Line compare */ +#define VGA_CRTC_OF_VBS8 0x08 /* Start vertical blanking */ +#define VGA_CRTC_OF_VRS8 0x04 /* Vertical retrace start */ +#define VGA_CRTC_OF_VDE8 0x02 /* Vertical disp. enable end */ +#define VGA_CRTC_OF_VT8 0x01 /* Vertical total (bit 8) */ +#define VGA_CRTC_PRESET_ROW_SCAN 8 +#define VGA_CRTC_PRS_BP 0x60 /* Byte panning */ +#define VGA_CRTC_PRS_PRS 0x1F /* Preset row scan */ +#define VGA_CRTC_MAX_SCAN_LINE 9 +#define VGA_CRTC_MSL_2T4 0x80 /* 200-to-400 line conversion */ +#define VGA_CRTC_MSL_LC9 0x40 /* Line compare (bit 9) */ +#define VGA_CRTC_MSL_VBS9 0x20 /* Start vertical blanking */ +#define VGA_CRTC_MSL_MSL 0x1F /* Maximum scan line */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 7 15:31:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 53235996; Mon, 7 Jul 2014 15:31: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 273BE2202; Mon, 7 Jul 2014 15:31: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 s67FVlqd047000; Mon, 7 Jul 2014 15:31:47 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67FVlUc046999; Mon, 7 Jul 2014 15:31:47 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201407071531.s67FVlUc046999@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 7 Jul 2014 15:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268367 - stable/10/sbin/ifconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2014 15:31:47 -0000 Author: ume Date: Mon Jul 7 15:31:46 2014 New Revision: 268367 URL: http://svnweb.freebsd.org/changeset/base/268367 Log: MFC r268049: Fix ifconfig to show pltime and vltime with -L option, again after usage change from time_second to time_uptime. PR: 188520 Submitted by: Guy Yur Modified: stable/10/sbin/ifconfig/af_inet6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/af_inet6.c ============================================================================== --- stable/10/sbin/ifconfig/af_inet6.c Mon Jul 7 14:16:05 2014 (r268366) +++ stable/10/sbin/ifconfig/af_inet6.c Mon Jul 7 15:31:46 2014 (r268367) @@ -42,6 +42,7 @@ static const char rcsid[] = #include #include #include +#include #include #include @@ -98,20 +99,21 @@ static void setip6lifetime(const char *cmd, const char *val, int s, const struct afswtch *afp) { - time_t newval, t; + struct timespec now; + time_t newval; char *ep; - t = time(NULL); + clock_gettime(CLOCK_MONOTONIC_FAST, &now); newval = (time_t)strtoul(val, &ep, 0); if (val == ep) errx(1, "invalid %s", cmd); if (afp->af_af != AF_INET6) errx(1, "%s not allowed for the AF", cmd); if (strcmp(cmd, "vltime") == 0) { - in6_addreq.ifra_lifetime.ia6t_expire = t + newval; + in6_addreq.ifra_lifetime.ia6t_expire = now.tv_sec + newval; in6_addreq.ifra_lifetime.ia6t_vltime = newval; } else if (strcmp(cmd, "pltime") == 0) { - in6_addreq.ifra_lifetime.ia6t_preferred = t + newval; + in6_addreq.ifra_lifetime.ia6t_preferred = now.tv_sec + newval; in6_addreq.ifra_lifetime.ia6t_pltime = newval; } } @@ -172,9 +174,11 @@ in6_status(int s __unused, const struct int s6; u_int32_t flags6; struct in6_addrlifetime lifetime; - time_t t = time(NULL); + struct timespec now; int error; + clock_gettime(CLOCK_MONOTONIC_FAST, &now); + memset(&null_sin, 0, sizeof(null_sin)); sin = (struct sockaddr_in6 *)ifa->ifa_addr; @@ -258,15 +262,15 @@ in6_status(int s __unused, const struct if (ip6lifetime && (lifetime.ia6t_preferred || lifetime.ia6t_expire)) { printf("pltime "); if (lifetime.ia6t_preferred) { - printf("%s ", lifetime.ia6t_preferred < t - ? "0" : sec2str(lifetime.ia6t_preferred - t)); + printf("%s ", lifetime.ia6t_preferred < now.tv_sec + ? "0" : sec2str(lifetime.ia6t_preferred - now.tv_sec)); } else printf("infty "); printf("vltime "); if (lifetime.ia6t_expire) { - printf("%s ", lifetime.ia6t_expire < t - ? "0" : sec2str(lifetime.ia6t_expire - t)); + printf("%s ", lifetime.ia6t_expire < now.tv_sec + ? "0" : sec2str(lifetime.ia6t_expire - now.tv_sec)); } else printf("infty "); } From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 7 19:31:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 08A7D99C; Mon, 7 Jul 2014 19:31: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 E9EB1282B; Mon, 7 Jul 2014 19:31: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 s67JV2CN060024; Mon, 7 Jul 2014 19:31:02 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67JV29c060023; Mon, 7 Jul 2014 19:31:02 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201407071931.s67JV29c060023@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 7 Jul 2014 19:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268371 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2014 19:31:03 -0000 Author: ray Date: Mon Jul 7 19:31:02 2014 New Revision: 268371 URL: http://svnweb.freebsd.org/changeset/base/268371 Log: MFC of r263873. Pointed by: Ivan Klymenko Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Jul 7 17:34:48 2014 (r268370) +++ stable/10/sys/conf/files Mon Jul 7 19:31:02 2014 (r268371) @@ -2534,6 +2534,7 @@ dev/vr/if_vr.c optional vr pci dev/vt/colors/vt_termcolors.c optional vt dev/vt/font/vt_font_default.c optional vt dev/vt/font/vt_mouse_cursor.c optional vt +dev/vt/hw/efifb/efifb.c optional vt_efifb dev/vt/hw/fb/vt_fb.c optional vt dev/vt/hw/vga/vt_vga.c optional vt vt_vga dev/vt/logo/logo_freebsd.c optional vt splash From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 7 21:27:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DD1C31BC; Mon, 7 Jul 2014 21:27: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 C9FC62305; Mon, 7 Jul 2014 21:27: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 s67LRlrR015227; Mon, 7 Jul 2014 21:27:47 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67LRljA015226; Mon, 7 Jul 2014 21:27:47 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201407072127.s67LRljA015226@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 7 Jul 2014 21:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268372 - stable/10/sys/amd64/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2014 21:27:48 -0000 Author: ray Date: Mon Jul 7 21:27:47 2014 New Revision: 268372 URL: http://svnweb.freebsd.org/changeset/base/268372 Log: Temporary disable build of vt_efifb vt(4) driver, not all parts of UEFI support here yet. This direct commit to STABLE-10, because HEAD already support UEFI FB. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/amd64/conf/GENERIC Modified: stable/10/sys/amd64/conf/GENERIC ============================================================================== --- stable/10/sys/amd64/conf/GENERIC Mon Jul 7 19:31:02 2014 (r268371) +++ stable/10/sys/amd64/conf/GENERIC Mon Jul 7 21:27:47 2014 (r268372) @@ -179,7 +179,6 @@ options SC_PIXEL_MODE # add support fo # vt is the new video console driver device vt device vt_vga -device vt_efifb device agp # support several AGP chipsets From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 8 00:59:35 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C135D624; Tue, 8 Jul 2014 00:59: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 AE12D2479; Tue, 8 Jul 2014 00:59: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 s680xZ9s013604; Tue, 8 Jul 2014 00:59:35 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s680xZWB013603; Tue, 8 Jul 2014 00:59:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201407080059.s680xZWB013603@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 8 Jul 2014 00:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268378 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 00:59:35 -0000 Author: ae Date: Tue Jul 8 00:59:35 2014 New Revision: 268378 URL: http://svnweb.freebsd.org/changeset/base/268378 Log: MFC r268089: Linux uses its own UUID for data partitions. Modified: stable/10/sys/sys/gpt.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/gpt.h ============================================================================== --- stable/10/sys/sys/gpt.h Mon Jul 7 23:21:25 2014 (r268377) +++ stable/10/sys/sys/gpt.h Tue Jul 8 00:59:35 2014 (r268378) @@ -114,7 +114,8 @@ struct gpt_ent { #define GPT_ENT_TYPE_MS_LDM_DATA \ {0xaf9b60a0,0x1431,0x4f62,0xbc,0x68,{0x33,0x11,0x71,0x4a,0x69,0xad}} -#define GPT_ENT_TYPE_LINUX_DATA GPT_ENT_TYPE_MS_BASIC_DATA +#define GPT_ENT_TYPE_LINUX_DATA \ + {0x0fc63daf,0x8483,0x4772,0x8e,0x79,{0x3d,0x69,0xd8,0x47,0x7d,0xe4}} #define GPT_ENT_TYPE_LINUX_RAID \ {0xa19d880f,0x05fc,0x4d3b,0xa0,0x06,{0x74,0x3f,0x0f,0x84,0x91,0x1e}} #define GPT_ENT_TYPE_LINUX_SWAP \ From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 8 01:01:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0C235780; Tue, 8 Jul 2014 01:01: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 EB54624FD; Tue, 8 Jul 2014 01:01: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 s6811Uwn017156; Tue, 8 Jul 2014 01:01:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6811UrD017155; Tue, 8 Jul 2014 01:01:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201407080101.s6811UrD017155@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 8 Jul 2014 01:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268379 - stable/10/sbin/geom/class/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 01:01:31 -0000 Author: ae Date: Tue Jul 8 01:01:30 2014 New Revision: 268379 URL: http://svnweb.freebsd.org/changeset/base/268379 Log: MFC r268090: Document all aliases supported by GEOM_PART class. Modified: stable/10/sbin/geom/class/part/gpart.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/10/sbin/geom/class/part/gpart.8 Tue Jul 8 00:59:35 2014 (r268378) +++ stable/10/sbin/geom/class/part/gpart.8 Tue Jul 8 01:01:30 2014 (r268379) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 11, 2014 +.Dd July 1, 2014 .Dt GPART 8 .Os .Sh NAME @@ -550,8 +550,9 @@ The .Nm utility also allows the user to specify scheme-specific partition types for partition types that do not have symbolic names. -Symbolic names currently understood are: -.Bl -tag -width ".Cm ms-ldm-metadata" +Symbolic names currently understood and used by +.Fx are: +.Bl -tag -width ".Cm dragonfly-disklabel64" .It Cm bios-boot The system partition dedicated to second stage of the boot loader program. Usually it is used by the GRUB 2 loader for GPT partitioning schemes. @@ -563,16 +564,6 @@ Interface (EFI). In such cases, the GPT partitioning scheme is used and the actual partition type for the system partition can also be specified as .Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" . -.It Cm fat16 -A partition that contains a FAT16 filesystem. -The scheme-specific type is -.Qq Li "!6" -for MBR. -.It Cm fat32 -A partition that contains a FAT32 filesystem. -The scheme-specific type is -.Qq Li "!11" -for MBR. .It Cm freebsd A .Fx @@ -631,6 +622,145 @@ The scheme-specific types are for APM, .Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and 0x0904 for VTOC8. +.El +.Pp +Another symbolic names that can be used with +.Cm gpart +utility are: +.Bl -tag -width ".Cm dragonfly-disklabel64" +.It Cm apple-boot +An Apple Mac OS X partition dedicated to bootloader. +The scheme-specific types are +.Qq Li "!Apple_Bootstrap" +for APM and +.Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac" +for GPT. +.It Cm apple-hfs +An Apple Mac OS X partition that contains a HFS or HFS+ filesystem. +The scheme-specific types are +.Qq Li "!Apple_HFS" +for APM and +.Qq Li "!48465300-0000-11aa-aa11-00306543ecac" +for GPT. +.It Cm apple-label +An Apple Mac OS X partition dedicated to partition metadata that descibes +disk device. +The scheme-specific type is +.Qq Li "!4c616265-6c00-11aa-aa11-00306543ecac" +for GPT. +.It Cm apple-raid +An Apple Mac OS X partition used in a software RAID configuration. +The scheme-specific type is +.Qq Li "!52414944-0000-11aa-aa11-00306543ecac" +for GPT. +.It Cm apple-raid-offline +An Apple Mac OS X partition used in a software RAID configuration. +The scheme-specific type is +.Qq Li "!52414944-5f4f-11aa-aa11-00306543ecac" +for GPT. +.It Cm apple-tv-recovery +An Apple Mac OS X partition used by Apple TV. +The scheme-specific type is +.Qq Li "!5265636f-7665-11aa-aa11-00306543ecac" +for GPT. +.It Cm apple-ufs +An Apple Mac OS X partition that contains a UFS filesystem. +The scheme-specific types are +.Qq Li "!Apple_UNIX_SVR2" +for APM and +.Qq Li "!55465300-0000-11aa-aa11-00306543ecac" +for GPT. +.It Cm dragonfly-label32 +A DragonFlyBSD partition subdivided into filesystems with a +.Bx +disklabel. +The scheme-specific type is +.Qq Li "!9d087404-1ca5-11dc-8817-01301bb8a9f5" +for GPT. +.It Cm dragonfly-label64 +A DragonFlyBSD partition subdivided into filesystems with a +disklabel64. +The scheme-specific type is +.Qq Li "!3d48ce54-1d16-11dc-8696-01301bb8a9f5" +for GPT. +.It Cm dragonfly-legacy +A legacy partition type used in DragonFlyBSD. +The scheme-specific type is +.Qq Li "!bd215ab2-1d16-11dc-8696-01301bb8a9f5" +for GPT. +.It Cm dragonfly-ccd +A DragonFlyBSD partition used with Concatenated Disk driver. +The scheme-specific type is +.Qq Li "!dbd5211b-1ca5-11dc-8817-01301bb8a9f5" +for GPT. +.It Cm dragonfly-hammer +A DragonFlyBSD partition that contains a Hammer filesystem. +The scheme-specific type is +.Qq Li "!61dc63ac-6e38-11dc-8513-01301bb8a9f5" +for GPT. +.It Cm dragonfly-hammer2 +A DragonFlyBSD partition that contains a Hammer2 filesystem. +The scheme-specific type is +.Qq Li "!5cbb9ad1-862d-11dc-a94d-01301bb8a9f5" +for GPT. +.It Cm dragonfly-swap +A DragonFlyBSD partition dedicated to swap space. +The scheme-specific type is +.Qq Li "!9d58fdbd-1ca5-11dc-8817-01301bb8a9f5" +for GPT. +.It Cm dragonfly-ufs +A DragonFlyBSD partition that contains an UFS1 filesystem. +The scheme-specific type is +.Qq Li "!9d94ce7c-1ca5-11dc-8817-01301bb8a9f5" +for GPT. +.It Cm dragonfly-vinum +A DragonFlyBSD partition used with Logical Volume Manager. +The scheme-specific type is +.Qq Li "!9dd4478f-1ca5-11dc-8817-01301bb8a9f5" +for GPT. +.It Cm ebr +A partition subdivided into filesystems with a EBR. +The scheme-specific type is +.Qq Li "!5" +for MBR. +.It Cm fat16 +A partition that contains a FAT16 filesystem. +The scheme-specific type is +.Qq Li "!6" +for MBR. +.It Cm fat32 +A partition that contains a FAT32 filesystem. +The scheme-specific type is +.Qq Li "!11" +for MBR. +.It Cm linux-data +A Linux partition that contains some filesystem with data. +The scheme-specific types are +.Qq Li "!131" +for MBR and +.Qq Li "!0fc63daf-8483-4772-8e79-3d69d8477de4" +for GPT. +.It Cm linux-lvm +A Linux partition dedicated to Logical Volume Manager. +The scheme-specific types are +.Qq Li "!142" +for MBR and +.Qq Li "!e6d6d379-f507-44c2-a23c-238f2a3df928" +for GPT. +.It Cm linux-raid +A Linux partition used in a software RAID configuration. +The scheme-specific types are +.Qq Li "!253" +for MBR and +.Qq Li "!a19d880f-05fc-4d3b-a006-743f0f84911e" +for GPT. +.It Cm linux-swap +A Linux partition dedicated to swap space. +The scheme-specific types are +.Qq Li "!130" +for MBR and +.Qq Li "!0657fd6d-a4ab-43c4-84e5-0933c84b4f4f" +for GPT. .It Cm mbr A partition that is sub-partitioned by a Master Boot Record (MBR). This type is known as @@ -658,6 +788,36 @@ A partition that contains Logical Disk M The scheme-specific type is .Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3" for GPT. +.It Cm netbsd-ccd +A NetBSD partition used with Concatenated Disk driver. +The scheme-specific type is +.Qq Li "!2db519c4-b10f-11dc-b99b-0019d1879648" +for GPT. +.It Cm netbsd-cgd +An encrypted NetBSD partition. +The scheme-specific type is +.Qq Li "!2db519ec-b10f-11dc-b99b-0019d1879648" +for GPT. +.It Cm netbsd-ffs +A NetBSD partition that contains an UFS filesystem. +The scheme-specific type is +.Qq Li "!49f48d5a-b10e-11dc-b99b-0019d1879648" +for GPT. +.It Cm netbsd-lfs +A NetBSD partition that contains an LFS filesystem. +The scheme-specific type is +.Qq Li "!49f48d82-b10e-11dc-b99b-0019d1879648" +for GPT. +.It Cm netbsd-raid +A NetBSD partition used in a software RAID configuration. +The scheme-specific type is +.Qq Li "!49f48daa-b10e-11dc-b99b-0019d1879648" +for GPT. +.It Cm netbsd-swap +A NetBSD partition dedicated to swap space. +The scheme-specific type is +.Qq Li "!49f48d32-b10e-11dc-b99b-0019d1879648" +for GPT. .It Cm ntfs A partition that contains a NTFS or exFAT filesystem. The scheme-specific type is From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 8 09:47:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8730CC7; Tue, 8 Jul 2014 09:47: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 73E192F49; Tue, 8 Jul 2014 09:47: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 s689lrOo063581; Tue, 8 Jul 2014 09:47:53 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s689lrjP063580; Tue, 8 Jul 2014 09:47:53 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407080947.s689lrjP063580@svn.freebsd.org> From: Ed Maste Date: Tue, 8 Jul 2014 09:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268389 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 09:47:53 -0000 Author: emaste Date: Tue Jul 8 09:47:52 2014 New Revision: 268389 URL: http://svnweb.freebsd.org/changeset/base/268389 Log: MFC r268059: Add missing VT_ kernel config knobs Modified: stable/10/sys/conf/options Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Tue Jul 8 09:37:41 2014 (r268388) +++ stable/10/sys/conf/options Tue Jul 8 09:47:52 2014 (r268389) @@ -739,8 +739,6 @@ SAFE_RNDTEST opt_safe.h # syscons/vt options MAXCONS opt_syscons.h -VT_FB_DEFAULT_WIDTH opt_syscons.h -VT_FB_DEFAULT_HEIGHT opt_syscons.h SC_ALT_MOUSE_IMAGE opt_syscons.h SC_CUT_SPACES2TABS opt_syscons.h SC_CUT_SEPCHARS opt_syscons.h @@ -763,6 +761,11 @@ SC_NORM_REV_ATTR opt_syscons.h SC_PIXEL_MODE opt_syscons.h SC_RENDER_DEBUG opt_syscons.h SC_TWOBUTTON_MOUSE opt_syscons.h +VT_ALT_TO_ESC_HACK opt_syscons.h +VT_FB_DEFAULT_WIDTH opt_syscons.h +VT_FB_DEFAULT_HEIGHT opt_syscons.h +VT_MAXWINDOWS opt_syscons.h +VT_TWOBUTTON_MOUSE opt_syscons.h DEV_SC opt_syscons.h DEV_VT opt_syscons.h From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 8 13:16:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E3D11AA1; Tue, 8 Jul 2014 13:16: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 D0D3421A9; Tue, 8 Jul 2014 13: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 s68DG3RS069507; Tue, 8 Jul 2014 13:16:03 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68DG3H8069506; Tue, 8 Jul 2014 13:16:03 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407081316.s68DG3H8069506@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 8 Jul 2014 13:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268396 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 13:16:04 -0000 Author: pluknet Date: Tue Jul 8 13:16:03 2014 New Revision: 268396 URL: http://svnweb.freebsd.org/changeset/base/268396 Log: MFC r268393: [mdoc] Fix previous. Modified: stable/10/lib/libc/stdlib/getopt.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/getopt.3 ============================================================================== --- stable/10/lib/libc/stdlib/getopt.3 Tue Jul 8 13:01:36 2014 (r268395) +++ stable/10/lib/libc/stdlib/getopt.3 Tue Jul 8 13:16:03 2014 (r268396) @@ -74,7 +74,7 @@ word, or .Dv NULL if there were no more characters in the current word. This is a -.It Tn GNU +.Tn GNU extension. For example, an option string .Li \&"x" From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 8 14:04:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5A2C5438; Tue, 8 Jul 2014 14:04: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 2CC812696; Tue, 8 Jul 2014 14:04: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 s68E4bTi093338; Tue, 8 Jul 2014 14:04:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68E4aMq093332; Tue, 8 Jul 2014 14:04:36 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407081404.s68E4aMq093332@svn.freebsd.org> From: Ed Maste Date: Tue, 8 Jul 2014 14:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268399 - in stable/10: . share share/mk tools/build/options X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 14:04:37 -0000 Author: emaste Date: Tue Jul 8 14:04:36 2014 New Revision: 268399 URL: http://svnweb.freebsd.org/changeset/base/268399 Log: MFC r268022: Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT The _SUPPORT knobs have a consistent meaning which differs from the behaviour controlled by this knob. As the knob is opt-out and has not appeared in a release the impact should be low. Added: stable/10/tools/build/options/WITHOUT_VT - copied unchanged from r268022, head/tools/build/options/WITHOUT_VT Deleted: stable/10/tools/build/options/WITHOUT_VT_SUPPORT Modified: stable/10/UPDATING stable/10/share/Makefile stable/10/share/mk/bsd.own.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Tue Jul 8 13:28:37 2014 (r268398) +++ stable/10/UPDATING Tue Jul 8 14:04:36 2014 (r268399) @@ -16,6 +16,11 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20140708: + The WITHOUT_VT_SUPPORT kernel config knob has been renamed + WITHOUT_VT. (The other _SUPPORT knobs have a consistent meaning + which differs from the behaviour controlled by this knob.) + 20140608: On i386 and amd64 systems, the onifconsole flag is now set by default in /etc/ttys for ttyu0. This causes ttyu0 to be automatically enabled Modified: stable/10/share/Makefile ============================================================================== --- stable/10/share/Makefile Tue Jul 8 13:28:37 2014 (r268398) +++ stable/10/share/Makefile Tue Jul 8 14:04:36 2014 (r268399) @@ -86,7 +86,7 @@ _syscons= syscons _tests= tests .endif -.if ${MK_VT_SUPPORT} != "no" +.if ${MK_VT} != "no" _vt= vt .endif Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Tue Jul 8 13:28:37 2014 (r268398) +++ stable/10/share/mk/bsd.own.mk Tue Jul 8 14:04:36 2014 (r268399) @@ -358,7 +358,7 @@ __DEFAULT_YES_OPTIONS = \ UNBOUND \ USB \ UTMPX \ - VT_SUPPORT \ + VT \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ Copied: stable/10/tools/build/options/WITHOUT_VT (from r268022, head/tools/build/options/WITHOUT_VT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_VT Tue Jul 8 14:04:36 2014 (r268399, copy of r268022, head/tools/build/options/WITHOUT_VT) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr vt 4 +support files (fonts and keymaps). From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 8 14:11:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D49FF61F; Tue, 8 Jul 2014 14:11: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 C15A726FF; Tue, 8 Jul 2014 14:11: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 s68EBSrf097440; Tue, 8 Jul 2014 14:11:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68EBSid097439; Tue, 8 Jul 2014 14:11:28 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407081411.s68EBSid097439@svn.freebsd.org> From: Ed Maste Date: Tue, 8 Jul 2014 14:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268400 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 14:11:28 -0000 Author: emaste Date: Tue Jul 8 14:11:28 2014 New Revision: 268400 URL: http://svnweb.freebsd.org/changeset/base/268400 Log: Regen src.conf(5) after r268399 Modified: stable/10/share/man/man5/src.conf.5 Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Tue Jul 8 14:04:36 2014 (r268399) +++ stable/10/share/man/man5/src.conf.5 Tue Jul 8 14:11:28 2014 (r268400) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: stable/10/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd April 14, 2014 +.Dd July 8, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1052,6 +1052,11 @@ Set to not build user accounting tools s .Xr lastlogin 8 and .Xr utx 8 . +.It Va WITHOUT_VT +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_VT 268399 2014-07-08 14:04:36Z emaste +Set to not build +.Xr vt 4 +support files (fonts and keymaps). .It Va WITHOUT_WIRELESS .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_WIRELESS 183242 2008-09-21 22:02:26Z sam Set to not build programs used for 802.11 wireless networks; especially From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 8 15:09:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 95DE548A; Tue, 8 Jul 2014 15:09: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 828A42DB1; Tue, 8 Jul 2014 15:09: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 s68F9t9J023301; Tue, 8 Jul 2014 15:09:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68F9tf4023300; Tue, 8 Jul 2014 15:09:55 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201407081509.s68F9tf4023300@svn.freebsd.org> From: Glen Barber Date: Tue, 8 Jul 2014 15:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268411 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 15:09:55 -0000 Author: gjb Date: Tue Jul 8 15:09:55 2014 New Revision: 268411 URL: http://svnweb.freebsd.org/changeset/base/268411 Log: Document r268161, mkimg(1) merged to stable/10. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jul 8 15:04:35 2014 (r268410) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jul 8 15:09:55 2014 (r268411) @@ -265,6 +265,9 @@ device is an active kernel console, otherwise it is equivalent to off. + The &man.mkimg.1; utility has been merged + from &os;-CURRENT. + <filename>/etc/rc.d</filename> Scripts From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 8 15:11:33 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DCCF46D2; Tue, 8 Jul 2014 15:11:33 +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 C95D22E39; Tue, 8 Jul 2014 15:11:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68FBXsf026402; Tue, 8 Jul 2014 15:11:33 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68FBXq6026401; Tue, 8 Jul 2014 15:11:33 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201407081511.s68FBXq6026401@svn.freebsd.org> From: Glen Barber Date: Tue, 8 Jul 2014 15:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268412 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 15:11:34 -0000 Author: gjb Date: Tue Jul 8 15:11:33 2014 New Revision: 268412 URL: http://svnweb.freebsd.org/changeset/base/268412 Log: Document r268091, disklabel64 partition scheme. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jul 8 15:09:55 2014 (r268411) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jul 8 15:11:33 2014 (r268412) @@ -217,8 +217,9 @@ Disks and Storage -   - + Support for the + disklabel64 partitioning scheme has been + added to &man.gpart.8;. From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 8 21:54:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B32F84ED; Tue, 8 Jul 2014 21:54: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 B273825E5; Tue, 8 Jul 2014 21:54: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 s68Lsrvf019088; Tue, 8 Jul 2014 21:54:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68LsqlS019083; Tue, 8 Jul 2014 21:54:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407082154.s68LsqlS019083@svn.freebsd.org> From: Xin LI Date: Tue, 8 Jul 2014 21:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268432 - in stable: 10/sys/kern 10/sys/netinet 8/sys/kern 8/sys/netinet 9/sys/kern 9/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 21:54:54 -0000 Author: delphij Date: Tue Jul 8 21:54:50 2014 New Revision: 268432 URL: http://svnweb.freebsd.org/changeset/base/268432 Log: Fix kernel memory disclosure in control message and SCTP notifications. Security: FreeBSD-SA-14:17.kmem Security: CVE-2014-3952, CVE-2014-3953 Modified: stable/10/sys/kern/uipc_sockbuf.c stable/10/sys/netinet/sctp_auth.c stable/10/sys/netinet/sctp_indata.c stable/10/sys/netinet/sctputil.c Changes in other areas also in this revision: Modified: stable/8/sys/kern/uipc_sockbuf.c stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctputil.c stable/9/sys/kern/uipc_sockbuf.c stable/9/sys/netinet/sctp_auth.c stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctputil.c Modified: stable/10/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/10/sys/kern/uipc_sockbuf.c Tue Jul 8 21:54:27 2014 (r268431) +++ stable/10/sys/kern/uipc_sockbuf.c Tue Jul 8 21:54:50 2014 (r268432) @@ -1071,6 +1071,11 @@ sbcreatecontrol(caddr_t p, int size, int m->m_len = 0; KASSERT(CMSG_SPACE((u_int)size) <= M_TRAILINGSPACE(m), ("sbcreatecontrol: short mbuf")); + /* + * Don't leave the padding between the msg header and the + * cmsg data and the padding after the cmsg data un-initialized. + */ + bzero(cp, CMSG_SPACE((u_int)size)); if (p != NULL) (void)memcpy(CMSG_DATA(cp), p, size); m->m_len = CMSG_SPACE(size); Modified: stable/10/sys/netinet/sctp_auth.c ============================================================================== --- stable/10/sys/netinet/sctp_auth.c Tue Jul 8 21:54:27 2014 (r268431) +++ stable/10/sys/netinet/sctp_auth.c Tue Jul 8 21:54:50 2014 (r268432) @@ -1790,6 +1790,7 @@ sctp_notify_authentication(struct sctp_t SCTP_BUF_LEN(m_notify) = 0; auth = mtod(m_notify, struct sctp_authkey_event *); + memset(auth, 0, sizeof(struct sctp_authkey_event)); auth->auth_type = SCTP_AUTHENTICATION_EVENT; auth->auth_flags = 0; auth->auth_length = sizeof(*auth); Modified: stable/10/sys/netinet/sctp_indata.c ============================================================================== --- stable/10/sys/netinet/sctp_indata.c Tue Jul 8 21:54:27 2014 (r268431) +++ stable/10/sys/netinet/sctp_indata.c Tue Jul 8 21:54:50 2014 (r268432) @@ -250,6 +250,11 @@ sctp_build_ctl_nchunk(struct sctp_inpcb /* We need a CMSG header followed by the struct */ cmh = mtod(ret, struct cmsghdr *); + /* + * Make sure that there is no un-initialized padding between the + * cmsg header and cmsg data and after the cmsg data. + */ + memset(cmh, 0, len); if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) { cmh->cmsg_level = IPPROTO_SCTP; cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_rcvinfo)); Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Tue Jul 8 21:54:27 2014 (r268431) +++ stable/10/sys/netinet/sctputil.c Tue Jul 8 21:54:50 2014 (r268432) @@ -2622,6 +2622,7 @@ sctp_notify_assoc_change(uint16_t state, } SCTP_BUF_NEXT(m_notify) = NULL; sac = mtod(m_notify, struct sctp_assoc_change *); + memset(sac, 0, notif_len); sac->sac_type = SCTP_ASSOC_CHANGE; sac->sac_flags = 0; sac->sac_length = sizeof(struct sctp_assoc_change); @@ -2835,21 +2836,21 @@ sctp_notify_send_failed(struct sctp_tcb if (m_notify == NULL) /* no space left */ return; - length += chk->send_size; - length -= sizeof(struct sctp_data_chunk); SCTP_BUF_LEN(m_notify) = 0; if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { ssfe = mtod(m_notify, struct sctp_send_failed_event *); + memset(ssfe, 0, length); ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT; if (sent) { ssfe->ssfe_flags = SCTP_DATA_SENT; } else { ssfe->ssfe_flags = SCTP_DATA_UNSENT; } + length += chk->send_size; + length -= sizeof(struct sctp_data_chunk); ssfe->ssfe_length = length; ssfe->ssfe_error = error; /* not exactly what the user sent in, but should be close :) */ - bzero(&ssfe->ssfe_info, sizeof(ssfe->ssfe_info)); ssfe->ssfe_info.snd_sid = chk->rec.data.stream_number; ssfe->ssfe_info.snd_flags = chk->rec.data.rcv_flags; ssfe->ssfe_info.snd_ppid = chk->rec.data.payloadtype; @@ -2859,12 +2860,15 @@ sctp_notify_send_failed(struct sctp_tcb SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed_event); } else { ssf = mtod(m_notify, struct sctp_send_failed *); + memset(ssf, 0, length); ssf->ssf_type = SCTP_SEND_FAILED; if (sent) { ssf->ssf_flags = SCTP_DATA_SENT; } else { ssf->ssf_flags = SCTP_DATA_UNSENT; } + length += chk->send_size; + length -= sizeof(struct sctp_data_chunk); ssf->ssf_length = length; ssf->ssf_error = error; /* not exactly what the user sent in, but should be close :) */ @@ -2948,16 +2952,16 @@ sctp_notify_send_failed2(struct sctp_tcb /* no space left */ return; } - length += sp->length; SCTP_BUF_LEN(m_notify) = 0; if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { ssfe = mtod(m_notify, struct sctp_send_failed_event *); + memset(ssfe, 0, length); ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT; ssfe->ssfe_flags = SCTP_DATA_UNSENT; + length += sp->length; ssfe->ssfe_length = length; ssfe->ssfe_error = error; /* not exactly what the user sent in, but should be close :) */ - bzero(&ssfe->ssfe_info, sizeof(ssfe->ssfe_info)); ssfe->ssfe_info.snd_sid = sp->stream; if (sp->some_taken) { ssfe->ssfe_info.snd_flags = SCTP_DATA_LAST_FRAG; @@ -2971,12 +2975,13 @@ sctp_notify_send_failed2(struct sctp_tcb SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed_event); } else { ssf = mtod(m_notify, struct sctp_send_failed *); + memset(ssf, 0, length); ssf->ssf_type = SCTP_SEND_FAILED; ssf->ssf_flags = SCTP_DATA_UNSENT; + length += sp->length; ssf->ssf_length = length; ssf->ssf_error = error; /* not exactly what the user sent in, but should be close :) */ - bzero(&ssf->ssf_info, sizeof(ssf->ssf_info)); ssf->ssf_info.sinfo_stream = sp->stream; ssf->ssf_info.sinfo_ssn = 0; if (sp->some_taken) { @@ -3038,6 +3043,7 @@ sctp_notify_adaptation_layer(struct sctp return; SCTP_BUF_LEN(m_notify) = 0; sai = mtod(m_notify, struct sctp_adaptation_event *); + memset(sai, 0, sizeof(struct sctp_adaptation_event)); sai->sai_type = SCTP_ADAPTATION_INDICATION; sai->sai_flags = 0; sai->sai_length = sizeof(struct sctp_adaptation_event); @@ -3093,6 +3099,7 @@ sctp_notify_partial_delivery_indication( return; SCTP_BUF_LEN(m_notify) = 0; pdapi = mtod(m_notify, struct sctp_pdapi_event *); + memset(pdapi, 0, sizeof(struct sctp_pdapi_event)); pdapi->pdapi_type = SCTP_PARTIAL_DELIVERY_EVENT; pdapi->pdapi_flags = 0; pdapi->pdapi_length = sizeof(struct sctp_pdapi_event); @@ -3202,6 +3209,7 @@ sctp_notify_shutdown_event(struct sctp_t /* no space left */ return; sse = mtod(m_notify, struct sctp_shutdown_event *); + memset(sse, 0, sizeof(struct sctp_shutdown_event)); sse->sse_type = SCTP_SHUTDOWN_EVENT; sse->sse_flags = 0; sse->sse_length = sizeof(struct sctp_shutdown_event); @@ -3252,6 +3260,7 @@ sctp_notify_sender_dry_event(struct sctp } SCTP_BUF_LEN(m_notify) = 0; event = mtod(m_notify, struct sctp_sender_dry_event *); + memset(event, 0, sizeof(struct sctp_sender_dry_event)); event->sender_dry_type = SCTP_SENDER_DRY_EVENT; event->sender_dry_flags = 0; event->sender_dry_length = sizeof(struct sctp_sender_dry_event); @@ -3284,7 +3293,6 @@ sctp_notify_stream_reset_add(struct sctp struct mbuf *m_notify; struct sctp_queued_to_read *control; struct sctp_stream_change_event *stradd; - int len; if ((stcb == NULL) || (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_CHANGEEVNT))) { @@ -3297,25 +3305,20 @@ sctp_notify_stream_reset_add(struct sctp return; } stcb->asoc.peer_req_out = 0; - m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_stream_change_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; SCTP_BUF_LEN(m_notify) = 0; - len = sizeof(struct sctp_stream_change_event); - if (len > M_TRAILINGSPACE(m_notify)) { - /* never enough room */ - sctp_m_freem(m_notify); - return; - } stradd = mtod(m_notify, struct sctp_stream_change_event *); + memset(stradd, 0, sizeof(struct sctp_stream_change_event)); stradd->strchange_type = SCTP_STREAM_CHANGE_EVENT; stradd->strchange_flags = flag; - stradd->strchange_length = len; + stradd->strchange_length = sizeof(struct sctp_stream_change_event); stradd->strchange_assoc_id = sctp_get_associd(stcb); stradd->strchange_instrms = numberin; stradd->strchange_outstrms = numberout; - SCTP_BUF_LEN(m_notify) = len; + SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_stream_change_event); SCTP_BUF_NEXT(m_notify) = NULL; if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < SCTP_BUF_LEN(m_notify)) { /* no space */ @@ -3346,32 +3349,26 @@ sctp_notify_stream_reset_tsn(struct sctp struct mbuf *m_notify; struct sctp_queued_to_read *control; struct sctp_assoc_reset_event *strasoc; - int len; if ((stcb == NULL) || (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ASSOC_RESETEVNT))) { /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_assoc_reset_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; SCTP_BUF_LEN(m_notify) = 0; - len = sizeof(struct sctp_assoc_reset_event); - if (len > M_TRAILINGSPACE(m_notify)) { - /* never enough room */ - sctp_m_freem(m_notify); - return; - } strasoc = mtod(m_notify, struct sctp_assoc_reset_event *); + memset(strasoc, 0, sizeof(struct sctp_assoc_reset_event)); strasoc->assocreset_type = SCTP_ASSOC_RESET_EVENT; strasoc->assocreset_flags = flag; - strasoc->assocreset_length = len; + strasoc->assocreset_length = sizeof(struct sctp_assoc_reset_event); strasoc->assocreset_assoc_id = sctp_get_associd(stcb); strasoc->assocreset_local_tsn = sending_tsn; strasoc->assocreset_remote_tsn = recv_tsn; - SCTP_BUF_LEN(m_notify) = len; + SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_assoc_reset_event); SCTP_BUF_NEXT(m_notify) = NULL; if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < SCTP_BUF_LEN(m_notify)) { /* no space */ @@ -3424,6 +3421,7 @@ sctp_notify_stream_reset(struct sctp_tcb return; } strreset = mtod(m_notify, struct sctp_stream_reset_event *); + memset(strreset, 0, len); strreset->strreset_type = SCTP_STREAM_RESET_EVENT; strreset->strreset_flags = flag; strreset->strreset_length = len; @@ -6236,9 +6234,12 @@ sctp_soreceive(struct socket *so, fromlen = 0; } + if (filling_sinfo) { + memset(&sinfo, 0, sizeof(struct sctp_extrcvinfo)); + } error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, flagsp, (struct sctp_sndrcvinfo *)&sinfo, filling_sinfo); - if ((controlp) && (filling_sinfo)) { + if (controlp != NULL) { /* copy back the sinfo in a CMSG format */ if (filling_sinfo) *controlp = sctp_build_ctl_nchunk(inp, From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 8 23:19:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5F7EE93B; Tue, 8 Jul 2014 23:19: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 075212184; Tue, 8 Jul 2014 23:19: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 s68N7AxS074582; Tue, 8 Jul 2014 23:07:10 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68N7AUO074581; Tue, 8 Jul 2014 23:07:10 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201407082307.s68N7AUO074581@svn.freebsd.org> From: Glen Barber Date: Tue, 8 Jul 2014 23:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268439 - in stable: 10/release/doc/en_US.ISO8859-1/errata 9/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 23:19:57 -0000 Author: gjb Date: Tue Jul 8 23:07:09 2014 New Revision: 268439 URL: http://svnweb.freebsd.org/changeset/base/268439 Log: Document FreeBSD-SA-14:17.kmem Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Changes in other areas also in this revision: Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jul 8 22:54:11 2014 (r268438) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jul 8 23:07:09 2014 (r268439) @@ -214,6 +214,13 @@ 24 June 2014 Multiple vulnerabilities + + + SA-14:17.kmem + 8 July 2014 + Kernel memory disclosure in control messages + and SCTP notifications + From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 9 00:12:16 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5CF09554; Wed, 9 Jul 2014 00:12: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 4A6B62664; Wed, 9 Jul 2014 00:12: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 s690CG5q004551; Wed, 9 Jul 2014 00:12:16 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s690CGAW004550; Wed, 9 Jul 2014 00:12:16 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201407090012.s690CGAW004550@svn.freebsd.org> From: Peter Wemm Date: Wed, 9 Jul 2014 00:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268442 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2014 00:12:16 -0000 Author: peter Date: Wed Jul 9 00:12:15 2014 New Revision: 268442 URL: http://svnweb.freebsd.org/changeset/base/268442 Log: Bump __FreeBSD_version after last SA-14:17.kmem so we have something to test against in the freebsd.org cluster. Modified: stable/10/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Wed Jul 9 00:12:05 2014 (r268441) +++ stable/10/sys/sys/param.h Wed Jul 9 00:12:15 2014 (r268442) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000710 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000711 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 10 09:08:02 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D190AD07; Thu, 10 Jul 2014 09: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 BE2222398; Thu, 10 Jul 2014 09: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 s6A982L9062891; Thu, 10 Jul 2014 09:08:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6A982fn062890; Thu, 10 Jul 2014 09:08:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407100908.s6A982fn062890@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 10 Jul 2014 09:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268483 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2014 09:08:02 -0000 Author: kib Date: Thu Jul 10 09:08:02 2014 New Revision: 268483 URL: http://svnweb.freebsd.org/changeset/base/268483 Log: MFC r268211: Micro-manage clang to get the expected inlining for cpu_search(). Modified: stable/10/sys/kern/sched_ule.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sched_ule.c ============================================================================== --- stable/10/sys/kern/sched_ule.c Thu Jul 10 07:16:55 2014 (r268482) +++ stable/10/sys/kern/sched_ule.c Thu Jul 10 09:08:02 2014 (r268483) @@ -622,12 +622,14 @@ struct cpu_search { for ((cpu) = 0; (cpu) <= mp_maxid; (cpu)++) \ if (CPU_ISSET(cpu, &mask)) -static __inline int cpu_search(const struct cpu_group *cg, struct cpu_search *low, - struct cpu_search *high, const int match); -int cpu_search_lowest(const struct cpu_group *cg, struct cpu_search *low); -int cpu_search_highest(const struct cpu_group *cg, struct cpu_search *high); -int cpu_search_both(const struct cpu_group *cg, struct cpu_search *low, +static __always_inline int cpu_search(const struct cpu_group *cg, + struct cpu_search *low, struct cpu_search *high, const int match); +int __noinline cpu_search_lowest(const struct cpu_group *cg, + struct cpu_search *low); +int __noinline cpu_search_highest(const struct cpu_group *cg, struct cpu_search *high); +int __noinline cpu_search_both(const struct cpu_group *cg, + struct cpu_search *low, struct cpu_search *high); /* * Search the tree of cpu_groups for the lowest or highest loaded cpu @@ -640,7 +642,7 @@ int cpu_search_both(const struct cpu_gro * match argument. It is reduced to the minimum set for each case. It is * also recursive to the depth of the tree. */ -static __inline int +static __always_inline int cpu_search(const struct cpu_group *cg, struct cpu_search *low, struct cpu_search *high, const int match) { From owner-svn-src-stable-10@FreeBSD.ORG Thu Jul 10 09:09:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B5D6AEE3; Thu, 10 Jul 2014 09:09: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 9668723AC; Thu, 10 Jul 2014 09:09: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 s6A99bJi063329; Thu, 10 Jul 2014 09:09:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6A99bDQ063328; Thu, 10 Jul 2014 09:09:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407100909.s6A99bDQ063328@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 10 Jul 2014 09:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268484 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2014 09:09:37 -0000 Author: kib Date: Thu Jul 10 09:09:37 2014 New Revision: 268484 URL: http://svnweb.freebsd.org/changeset/base/268484 Log: MFC r268212: Note that most errors are possible for all syscalls from utimes(2) family. Minor wording corrections. Modified: stable/10/lib/libc/sys/utimes.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/utimes.2 ============================================================================== --- stable/10/lib/libc/sys/utimes.2 Thu Jul 10 09:08:02 2014 (r268483) +++ stable/10/lib/libc/sys/utimes.2 Thu Jul 10 09:09:37 2014 (r268484) @@ -30,7 +30,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd July 3, 2014 .Dt UTIMES 2 .Os .Sh NAME @@ -119,22 +119,18 @@ is passed the special value .Dv AT_FDCWD in the .Fa fd -parameter, the current working directory is used and the behavior is identical to -a call to +parameter, the current working directory is used and the behavior +is identical to a call to .Fn utimes . .Sh RETURN VALUES .Rv -std .Sh ERRORS -The -.Fn utimes -and -.Fn lutimes -system calls -will fail if: +All of the system call will fail if: .Bl -tag -width Er .It Bq Er EACCES -Search permission is denied for a component of the path prefix; -or the +Search permission is denied for a component of the path prefix. +.It Bq Er EACCES +The .Fa times argument is .Dv NULL @@ -148,6 +144,17 @@ or .Fa times argument points outside the process's allocated address space. +.It Bq Er EFAULT +The +.Fa times +argument +points outside the process's allocated address space. +.It Bq Er EINVAL +The +.Va tv_usec +component of at least one of the values specified by the +.Fa times +argument has a value less than 0 or greater than 999999. .It Bq Er EIO An I/O error occurred while reading or writing the affected inode. .It Bq Er ELOOP @@ -170,7 +177,8 @@ argument is not and the calling process's effective user ID does not match the owner of the file and is not the super-user. .It Bq Er EPERM -The named file has its immutable or append-only flag set, see the +The named file has its immutable or append-only flags set. +See the .Xr chflags 2 manual page for more information. .It Bq Er EROFS @@ -189,40 +197,6 @@ argument does not refer to a valid descriptor. .El .Pp -All of the system calls will fail if: -.Bl -tag -width Er -.It Bq Er EACCES -The -.Fa times -argument is -.Dv NULL -and the effective user ID of the process does not -match the owner of the file, and is not the super-user, and write -access is denied. -.It Bq Er EFAULT -The -.Fa times -argument -points outside the process's allocated address space. -.It Bq Er EINVAL -The -.Va tv_usec -component of at least one of the values specified by the -.Fa times -argument has a value less than 0 or greater than 999999. -.It Bq Er EIO -An I/O error occurred while reading or writing the affected inode. -.It Bq Er EPERM -The -.Fa times -argument is not -.Dv NULL -and the calling process's effective user ID -does not match the owner of the file and is not the super-user. -.It Bq Er EROFS -The file system containing the file is mounted read-only. -.El -.Pp In addition to the errors returned by the .Fn utimes , the From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 11 00:00:01 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C9907588; Fri, 11 Jul 2014 00:00: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 B15F1249A; Fri, 11 Jul 2014 00:00: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 s6B001T3095233; Fri, 11 Jul 2014 00:00:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6B0013I095178; Fri, 11 Jul 2014 00:00:01 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407110000.s6B0013I095178@svn.freebsd.org> From: Xin LI Date: Fri, 11 Jul 2014 00:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268515 - in stable/10: contrib/file contrib/file/Magdir contrib/file/doc contrib/file/m4 contrib/file/magic contrib/file/python contrib/file/src contrib/file/tests lib/libmagic usr.bin... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2014 00:00:02 -0000 Author: delphij Date: Fri Jul 11 00:00:00 2014 New Revision: 268515 URL: http://svnweb.freebsd.org/changeset/base/268515 Log: MFC r267897: MFV r267843: Update file/libmagic to 5.19. Added: stable/10/contrib/file/config.guess - copied unchanged from r267897, head/contrib/file/config.guess stable/10/contrib/file/config.sub - copied unchanged from r267897, head/contrib/file/config.sub stable/10/contrib/file/depcomp - copied unchanged from r267897, head/contrib/file/depcomp stable/10/contrib/file/doc/ - copied from r267897, head/contrib/file/doc/ stable/10/contrib/file/ltmain.sh - copied unchanged from r267897, head/contrib/file/ltmain.sh stable/10/contrib/file/m4/ - copied from r267897, head/contrib/file/m4/ stable/10/contrib/file/magic/ - copied from r267897, head/contrib/file/magic/ stable/10/contrib/file/missing - copied unchanged from r267897, head/contrib/file/missing stable/10/contrib/file/python/ - copied from r267897, head/contrib/file/python/ stable/10/contrib/file/src/ - copied from r267897, head/contrib/file/src/ stable/10/contrib/file/tests/escapevel.result - copied unchanged from r267897, head/contrib/file/tests/escapevel.result stable/10/contrib/file/tests/escapevel.testfile - copied unchanged from r267897, head/contrib/file/tests/escapevel.testfile stable/10/contrib/file/tests/issue311docx.result - copied unchanged from r267897, head/contrib/file/tests/issue311docx.result stable/10/contrib/file/tests/issue311docx.testfile - copied unchanged from r267897, head/contrib/file/tests/issue311docx.testfile Deleted: stable/10/contrib/file/Header stable/10/contrib/file/Localstuff stable/10/contrib/file/Magdir/ stable/10/contrib/file/Makefile.am-src stable/10/contrib/file/apprentice.c stable/10/contrib/file/apptype.c stable/10/contrib/file/ascmagic.c stable/10/contrib/file/asprintf.c stable/10/contrib/file/cdf.c stable/10/contrib/file/cdf.h stable/10/contrib/file/cdf_time.c stable/10/contrib/file/compress.c stable/10/contrib/file/elfclass.h stable/10/contrib/file/encoding.c stable/10/contrib/file/file.c stable/10/contrib/file/file.h stable/10/contrib/file/file.man stable/10/contrib/file/file_opts.h stable/10/contrib/file/fsmagic.c stable/10/contrib/file/funcs.c stable/10/contrib/file/getline.c stable/10/contrib/file/getopt_long.c stable/10/contrib/file/is_tar.c stable/10/contrib/file/libmagic.man stable/10/contrib/file/magic.c stable/10/contrib/file/magic.h stable/10/contrib/file/magic.man stable/10/contrib/file/magic2mime stable/10/contrib/file/mygetopt.h stable/10/contrib/file/names.h stable/10/contrib/file/print.c stable/10/contrib/file/readcdf.c stable/10/contrib/file/readelf.c stable/10/contrib/file/readelf.h stable/10/contrib/file/softmagic.c stable/10/contrib/file/strlcat.c stable/10/contrib/file/strlcpy.c stable/10/contrib/file/tar.h stable/10/contrib/file/tests/gedcom.magic stable/10/contrib/file/vasprintf.c Modified: stable/10/contrib/file/ChangeLog stable/10/contrib/file/Makefile.am stable/10/contrib/file/Makefile.in stable/10/contrib/file/README stable/10/contrib/file/TODO stable/10/contrib/file/aclocal.m4 stable/10/contrib/file/compile stable/10/contrib/file/config.h.in stable/10/contrib/file/configure stable/10/contrib/file/configure.ac stable/10/contrib/file/install-sh stable/10/contrib/file/tests/Makefile.am stable/10/contrib/file/tests/Makefile.in stable/10/contrib/file/tests/README stable/10/contrib/file/tests/gedcom.result stable/10/lib/libmagic/Makefile stable/10/lib/libmagic/config.h stable/10/usr.bin/file/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/file/ChangeLog ============================================================================== --- stable/10/contrib/file/ChangeLog Thu Jul 10 22:54:38 2014 (r268514) +++ stable/10/contrib/file/ChangeLog Fri Jul 11 00:00:00 2014 (r268515) @@ -1,3 +1,245 @@ +2014-06-12 12:28 Christos Zoulas + + * release 5.19 + +2014-06-09 9:04 Christos Zoulas + + * Misc buffer overruns and missing buffer size tests in cdf parsing + (Francisco Alonso, Jan Kaluza) + +2014-06-02 14:50 Christos Zoulas + + * Enforce limit of 8K on regex searches that have no limits + * Allow the l modifier for regex to mean line count. Default + to byte count. If line count is specified, assume a max + of 80 characters per line to limit the byte count. + * Don't allow conversions to be used for dates, allowing + the mask field to be used as an offset. + +2014-05-30 12:51 Christos Zoulas + + * Make the range operator limit the length of the + regex search. + +2014-05-14 19:23 Christos Zoulas + + * PR/347: Windows fixes + * PR/352: Hangul word processor recognition + * PR/354: Encoding irregularities in text files + +2014-05-06 6:12 Christos Zoulas + + * Fix uninitialized title in CDF files (Jan Kaluza) + +2014-05-04 14:55 Christos Zoulas + + * PR/351: Fix compilation of empty files + +2014-04-30 17:39 Christos Zoulas + + * Fix integer formats: We don't specify 'l' or + 'h' and 'hh' specifiers anymore, only 'll' for + quads and nothing for the rest. This is so that + magic writing is simpler. + +2014-04-01 15:25 Christos Zoulas + + * PR/341: Jan Kaluza, fix memory leak + * PR/342: Jan Kaluza, fix out of bounds read + +2014-03-28 15:25 Christos Zoulas + + * Fix issue with long formats not matching fmtcheck + +2014-03-26 11:25 Christos Zoulas + + * release 5.18 + +2014-03-15 17:45 Christos Zoulas + + * add fmtcheck(3) for those who don't have it + +2014-03-14 15:12 Christos Zoulas + + * prevent mime entries from being attached to magic + entries with no descriptions + + * adjust magic strength for regex type + + * remove superfluous ascmagic with encoding test + +2014-03-06 12:01 Christos Zoulas + + * fix regression fix echo -ne "\012\013\014" | file -i - + which printed "binary" instead of "application/octet-stream" + + * add size_t overflow check for magic file size + +2014-02-27 16:01 Christos Zoulas + + * experimental support for matching with CFD CLSID + +2014-02-18 13:04 Kimmo Suominen (kimmo@suominen.com) + + * Cache old LC_CTYPE locale before setting it to "C", so + we can use it to restore LC_CTYPE instead of asking + setlocale() to scan the environment variables. + +2014-02-12 18:21 Christos Zoulas + + * Count recursion levels through indirect magic + +2014-02-11 10:40 Christos Zoulas + + * Prevent infinite recursion on files with indirect offsets of 0 + +2014-01-30 21:00 Christos Zoulas + + * Add -E flag that makes file print filesystem errors to stderr + and exit. + +2014-01-08 17:20 Christos Zoulas + + * mime printing could print results from multiple magic entries + if there were multiple matches. + * in some cases overflow was not detected when computing offsets + in softmagic. + +2013-12-05 12:00 Christos Zoulas + + * use strcasestr() to for cdf strings + * reset to the "C" locale while doing regex operations, or case + insensitive comparisons; this is provisional + +2013-11-19 20:10 Christos Zoulas + + * always leave magic file loaded, don't unload for magic_check, etc. + * fix default encoding to binary instead of unknown which broke recently + * handle empty and one byte files, less specially so that + --mime-encoding does not break completely. + ` +2013-11-06 14:40 Christos Zoulas + + * fix erroneous non-zero exit code from non-existant file and message + +2013-10-29 14:25 Christos Zoulas + + * add CDF MSI file detection (Guy Helmer) + +2013-09-03 11:56 Christos Zoulas + + * Don't mix errors and regular output if there was an error + * in magic_descriptor() don't close the file and try to restore + its position + +2013-05-30 17:25 Christos Zoulas + + * Don't treat magic as an error if offset was past EOF (Christoph Biedl) + +2013-05-28 17:25 Christos Zoulas + + * Fix spacing issues in softmagic and elf (Jan Kaluza) + +2013-05-02 18:00 Christos Zoulas + + * Fix segmentation fault with multiple magic_load commands. + +2013-04-22 11:20 Christos Zoulas + + * The way "default" was implemented was not very useful + because the "if something was printed at that level" + was not easily controlled by the user, and the format + was bound to a string which is too restrictive. Add + a "clear" for that level keyword and make "default" + void. This way one can do: + + >>13 clear x + >>13 lelong 1 foo + >>13 lelong 2 bar + >>13 default x + >>>13 lelong x unknown %x + +2013-03-25 13:20 Christos Zoulas + + * disallow strength setting in "name" entries + +2013-03-06 21:24 Christos Zoulas + + * fix recursive magic separator printing + +2013-02-26 19:28 Christos Zoulas + + * limit recursion level for mget + * fix pread() related breakage in cdf + * handle offsets properly in recursive "use" + +2013-02-18 10:39 Christos Zoulas + + * add elf reading of debug info to determine if file is stripped + (Jan Kaluza) + * use pread() + +2013-01-25 18:05 Christos Zoulas + + * change mime description size from 64 to 80 to accommodate OOXML. + +2013-01-11 14:50 Christos Zoulas + + * Warn about inconsistent continuation levels. + * Change fsmagic to add a space after it prints. + +2013-01-10 21:00 Christos Zoulas + + * Make getline public so that file can link against it. + Perhaps it is better to rename it, or hide it differently. + Fixes builds on platforms that do not provide it. + +2013-01-07 16:30 Christos Zoulas + + * Add SuS d{,1,2,4,8}, u{,1,2,4,8} and document + what long, int, short, etc is (Guy Harris) + +2013-01-06 11:20 Christos Zoulas + + * add magic_version function and constant + * Redo memory allocation and de-allocation. + (prevents double frees on non mmap platforms) + * Fix bug with name/use having to do with passing + found state from the parent to the child and back. + +2012-12-19 8:47 Christos Zoulas + + * Only print elf capabilities for archs we know (Jan Kaluza) + +2012-10-30 19:14 Christos Zoulas + + * Add "name" and "use" file types in order to look + inside mach-o files. + +2012-09-06 10:40 Christos Zoulas + + * make --version exit 0 (Matthew Schultz) + * add string/T (Jan Kaluza) + +2012-08-09 2:15 Christos Zoulas + + * add z and t modifiers for our own vasprintf + * search for $HOME/.magic.mgc if it is there first + * fix reads from a pipe, and preserve errno + +2012-05-15 13:12 Christos Zoulas + + * use ctime_r, asctime_r + +2012-04-06 17:18 Christos Zoulas + + * Fixes for indirect offsets to handle apple disk formats + +2012-04-03 18:26 Christos Zoulas + + * Add windows date field types + * More info for windows shortcuts (incomplete) + 2012-02-20 17:33 Christos Zoulas * Fix CDF parsing issues found by CERT's fuzzing tool (Will Dormann) @@ -851,7 +1093,7 @@ * Identify gnu tar vs. posix tar - * When keep going, don't print spurious newlines (Radek Vokál) + * When keep going, don't print spurious newlines (Radek Vokal) 2006-04-01 12:02 Christos Zoulas @@ -875,7 +1117,7 @@ 2005-10-31 8:54 Christos Zoulas * Fix regression where the core info was not completely processed - (Radek Vokál) + (Radek Vokal) 2005-10-20 11:15 Christos Zoulas @@ -892,7 +1134,7 @@ 2005-09-20 13:33 Christos Zoulas * Don't print SVR4 Style in core files multiple times - (Radek Vokál) + (Radek Vokal) 2005-08-27 04:09 Christos Zoulas Modified: stable/10/contrib/file/Makefile.am ============================================================================== --- stable/10/contrib/file/Makefile.am Thu Jul 10 22:54:38 2014 (r268514) +++ stable/10/contrib/file/Makefile.am Fri Jul 11 00:00:00 2014 (r268515) @@ -1,280 +1,5 @@ -# -# $File: Makefile.am,v 1.78 2012/01/27 01:41:26 christos Exp $ -# -MAGIC_FRAGMENT_BASE = Magdir -MAGIC_DIR = $(top_srcdir)/magic -MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE) +ACLOCAL_AMFLAGS = -I m4 -pkgdata_DATA = magic.mgc +EXTRA_DIST = MAINT -EXTRA_DIST = \ -$(MAGIC_DIR)/Header \ -$(MAGIC_DIR)/Localstuff \ -$(MAGIC_FRAGMENT_DIR)/acorn \ -$(MAGIC_FRAGMENT_DIR)/adi \ -$(MAGIC_FRAGMENT_DIR)/adventure \ -$(MAGIC_FRAGMENT_DIR)/allegro \ -$(MAGIC_FRAGMENT_DIR)/alliant \ -$(MAGIC_FRAGMENT_DIR)/amanda \ -$(MAGIC_FRAGMENT_DIR)/amigaos \ -$(MAGIC_FRAGMENT_DIR)/animation \ -$(MAGIC_FRAGMENT_DIR)/apl \ -$(MAGIC_FRAGMENT_DIR)/apple \ -$(MAGIC_FRAGMENT_DIR)/applix \ -$(MAGIC_FRAGMENT_DIR)/archive \ -$(MAGIC_FRAGMENT_DIR)/assembler \ -$(MAGIC_FRAGMENT_DIR)/asterix \ -$(MAGIC_FRAGMENT_DIR)/att3b \ -$(MAGIC_FRAGMENT_DIR)/audio \ -$(MAGIC_FRAGMENT_DIR)/basis \ -$(MAGIC_FRAGMENT_DIR)/bflt \ -$(MAGIC_FRAGMENT_DIR)/blcr \ -$(MAGIC_FRAGMENT_DIR)/blender \ -$(MAGIC_FRAGMENT_DIR)/blit \ -$(MAGIC_FRAGMENT_DIR)/bout \ -$(MAGIC_FRAGMENT_DIR)/bsdi \ -$(MAGIC_FRAGMENT_DIR)/bsi \ -$(MAGIC_FRAGMENT_DIR)/btsnoop \ -$(MAGIC_FRAGMENT_DIR)/c-lang \ -$(MAGIC_FRAGMENT_DIR)/c64 \ -$(MAGIC_FRAGMENT_DIR)/cad \ -$(MAGIC_FRAGMENT_DIR)/cafebabe \ -$(MAGIC_FRAGMENT_DIR)/cddb \ -$(MAGIC_FRAGMENT_DIR)/chord \ -$(MAGIC_FRAGMENT_DIR)/cisco \ -$(MAGIC_FRAGMENT_DIR)/citrus \ -$(MAGIC_FRAGMENT_DIR)/clarion \ -$(MAGIC_FRAGMENT_DIR)/claris \ -$(MAGIC_FRAGMENT_DIR)/clipper \ -$(MAGIC_FRAGMENT_DIR)/commands \ -$(MAGIC_FRAGMENT_DIR)/communications \ -$(MAGIC_FRAGMENT_DIR)/compress \ -$(MAGIC_FRAGMENT_DIR)/console \ -$(MAGIC_FRAGMENT_DIR)/convex \ -$(MAGIC_FRAGMENT_DIR)/cracklib \ -$(MAGIC_FRAGMENT_DIR)/ctags \ -$(MAGIC_FRAGMENT_DIR)/cups \ -$(MAGIC_FRAGMENT_DIR)/dact \ -$(MAGIC_FRAGMENT_DIR)/database \ -$(MAGIC_FRAGMENT_DIR)/diamond \ -$(MAGIC_FRAGMENT_DIR)/diff \ -$(MAGIC_FRAGMENT_DIR)/digital \ -$(MAGIC_FRAGMENT_DIR)/dolby \ -$(MAGIC_FRAGMENT_DIR)/dump \ -$(MAGIC_FRAGMENT_DIR)/dyadic \ -$(MAGIC_FRAGMENT_DIR)/ebml \ -$(MAGIC_FRAGMENT_DIR)/editors \ -$(MAGIC_FRAGMENT_DIR)/efi \ -$(MAGIC_FRAGMENT_DIR)/elf \ -$(MAGIC_FRAGMENT_DIR)/encore \ -$(MAGIC_FRAGMENT_DIR)/epoc \ -$(MAGIC_FRAGMENT_DIR)/erlang \ -$(MAGIC_FRAGMENT_DIR)/esri \ -$(MAGIC_FRAGMENT_DIR)/fcs \ -$(MAGIC_FRAGMENT_DIR)/filesystems \ -$(MAGIC_FRAGMENT_DIR)/flash \ -$(MAGIC_FRAGMENT_DIR)/fonts \ -$(MAGIC_FRAGMENT_DIR)/fortran \ -$(MAGIC_FRAGMENT_DIR)/frame \ -$(MAGIC_FRAGMENT_DIR)/freebsd \ -$(MAGIC_FRAGMENT_DIR)/fsav \ -$(MAGIC_FRAGMENT_DIR)/fusecompress \ -$(MAGIC_FRAGMENT_DIR)/games \ -$(MAGIC_FRAGMENT_DIR)/gcc \ -$(MAGIC_FRAGMENT_DIR)/geo \ -$(MAGIC_FRAGMENT_DIR)/geos \ -$(MAGIC_FRAGMENT_DIR)/gimp \ -$(MAGIC_FRAGMENT_DIR)/gnome-keyring \ -$(MAGIC_FRAGMENT_DIR)/gnu \ -$(MAGIC_FRAGMENT_DIR)/gnumeric \ -$(MAGIC_FRAGMENT_DIR)/grace \ -$(MAGIC_FRAGMENT_DIR)/graphviz \ -$(MAGIC_FRAGMENT_DIR)/gringotts \ -$(MAGIC_FRAGMENT_DIR)/guile \ -$(MAGIC_FRAGMENT_DIR)/hitachi-sh \ -$(MAGIC_FRAGMENT_DIR)/hp \ -$(MAGIC_FRAGMENT_DIR)/human68k \ -$(MAGIC_FRAGMENT_DIR)/ibm370 \ -$(MAGIC_FRAGMENT_DIR)/ibm6000 \ -$(MAGIC_FRAGMENT_DIR)/iff \ -$(MAGIC_FRAGMENT_DIR)/images \ -$(MAGIC_FRAGMENT_DIR)/inform \ -$(MAGIC_FRAGMENT_DIR)/intel \ -$(MAGIC_FRAGMENT_DIR)/interleaf \ -$(MAGIC_FRAGMENT_DIR)/island \ -$(MAGIC_FRAGMENT_DIR)/ispell \ -$(MAGIC_FRAGMENT_DIR)/isz \ -$(MAGIC_FRAGMENT_DIR)/java \ -$(MAGIC_FRAGMENT_DIR)/jpeg \ -$(MAGIC_FRAGMENT_DIR)/karma \ -$(MAGIC_FRAGMENT_DIR)/kde \ -$(MAGIC_FRAGMENT_DIR)/kml \ -$(MAGIC_FRAGMENT_DIR)/lecter \ -$(MAGIC_FRAGMENT_DIR)/lex \ -$(MAGIC_FRAGMENT_DIR)/lif \ -$(MAGIC_FRAGMENT_DIR)/linux \ -$(MAGIC_FRAGMENT_DIR)/lisp \ -$(MAGIC_FRAGMENT_DIR)/llvm \ -$(MAGIC_FRAGMENT_DIR)/lua \ -$(MAGIC_FRAGMENT_DIR)/luks \ -$(MAGIC_FRAGMENT_DIR)/m4 \ -$(MAGIC_FRAGMENT_DIR)/mach \ -$(MAGIC_FRAGMENT_DIR)/macintosh \ -$(MAGIC_FRAGMENT_DIR)/magic \ -$(MAGIC_FRAGMENT_DIR)/mail.news \ -$(MAGIC_FRAGMENT_DIR)/make \ -$(MAGIC_FRAGMENT_DIR)/maple \ -$(MAGIC_FRAGMENT_DIR)/marc21 \ -$(MAGIC_FRAGMENT_DIR)/mathcad \ -$(MAGIC_FRAGMENT_DIR)/mathematica \ -$(MAGIC_FRAGMENT_DIR)/matroska \ -$(MAGIC_FRAGMENT_DIR)/mcrypt \ -$(MAGIC_FRAGMENT_DIR)/mercurial \ -$(MAGIC_FRAGMENT_DIR)/metastore \ -$(MAGIC_FRAGMENT_DIR)/mime \ -$(MAGIC_FRAGMENT_DIR)/mips \ -$(MAGIC_FRAGMENT_DIR)/mirage \ -$(MAGIC_FRAGMENT_DIR)/misctools \ -$(MAGIC_FRAGMENT_DIR)/mkid \ -$(MAGIC_FRAGMENT_DIR)/mlssa \ -$(MAGIC_FRAGMENT_DIR)/mmdf \ -$(MAGIC_FRAGMENT_DIR)/modem \ -$(MAGIC_FRAGMENT_DIR)/motorola \ -$(MAGIC_FRAGMENT_DIR)/mozilla \ -$(MAGIC_FRAGMENT_DIR)/msdos \ -$(MAGIC_FRAGMENT_DIR)/msooxml \ -$(MAGIC_FRAGMENT_DIR)/msvc \ -$(MAGIC_FRAGMENT_DIR)/mup \ -$(MAGIC_FRAGMENT_DIR)/music \ -$(MAGIC_FRAGMENT_DIR)/natinst \ -$(MAGIC_FRAGMENT_DIR)/ncr \ -$(MAGIC_FRAGMENT_DIR)/netbsd \ -$(MAGIC_FRAGMENT_DIR)/netscape \ -$(MAGIC_FRAGMENT_DIR)/netware \ -$(MAGIC_FRAGMENT_DIR)/news \ -$(MAGIC_FRAGMENT_DIR)/nitpicker \ -$(MAGIC_FRAGMENT_DIR)/oasis \ -$(MAGIC_FRAGMENT_DIR)/ocaml \ -$(MAGIC_FRAGMENT_DIR)/octave \ -$(MAGIC_FRAGMENT_DIR)/ole2compounddocs \ -$(MAGIC_FRAGMENT_DIR)/olf \ -$(MAGIC_FRAGMENT_DIR)/os2 \ -$(MAGIC_FRAGMENT_DIR)/os400 \ -$(MAGIC_FRAGMENT_DIR)/os9 \ -$(MAGIC_FRAGMENT_DIR)/osf1 \ -$(MAGIC_FRAGMENT_DIR)/palm \ -$(MAGIC_FRAGMENT_DIR)/parix \ -$(MAGIC_FRAGMENT_DIR)/parrot \ -$(MAGIC_FRAGMENT_DIR)/pascal \ -$(MAGIC_FRAGMENT_DIR)/pbm \ -$(MAGIC_FRAGMENT_DIR)/pdf \ -$(MAGIC_FRAGMENT_DIR)/pdp \ -$(MAGIC_FRAGMENT_DIR)/perl \ -$(MAGIC_FRAGMENT_DIR)/pgp \ -$(MAGIC_FRAGMENT_DIR)/pkgadd \ -$(MAGIC_FRAGMENT_DIR)/plan9 \ -$(MAGIC_FRAGMENT_DIR)/plus5 \ -$(MAGIC_FRAGMENT_DIR)/printer \ -$(MAGIC_FRAGMENT_DIR)/project \ -$(MAGIC_FRAGMENT_DIR)/psdbms \ -$(MAGIC_FRAGMENT_DIR)/pulsar \ -$(MAGIC_FRAGMENT_DIR)/pyramid \ -$(MAGIC_FRAGMENT_DIR)/python \ -$(MAGIC_FRAGMENT_DIR)/revision \ -$(MAGIC_FRAGMENT_DIR)/riff \ -$(MAGIC_FRAGMENT_DIR)/rinex \ -$(MAGIC_FRAGMENT_DIR)/rpm \ -$(MAGIC_FRAGMENT_DIR)/rtf \ -$(MAGIC_FRAGMENT_DIR)/ruby \ -$(MAGIC_FRAGMENT_DIR)/sc \ -$(MAGIC_FRAGMENT_DIR)/sccs \ -$(MAGIC_FRAGMENT_DIR)/scientific \ -$(MAGIC_FRAGMENT_DIR)/securitycerts \ -$(MAGIC_FRAGMENT_DIR)/selinux \ -$(MAGIC_FRAGMENT_DIR)/sendmail \ -$(MAGIC_FRAGMENT_DIR)/sequent \ -$(MAGIC_FRAGMENT_DIR)/sgi \ -$(MAGIC_FRAGMENT_DIR)/sgml \ -$(MAGIC_FRAGMENT_DIR)/sharc \ -$(MAGIC_FRAGMENT_DIR)/sinclair \ -$(MAGIC_FRAGMENT_DIR)/sisu \ -$(MAGIC_FRAGMENT_DIR)/sketch \ -$(MAGIC_FRAGMENT_DIR)/smalltalk \ -$(MAGIC_FRAGMENT_DIR)/smile \ -$(MAGIC_FRAGMENT_DIR)/sniffer \ -$(MAGIC_FRAGMENT_DIR)/softquad \ -$(MAGIC_FRAGMENT_DIR)/spec \ -$(MAGIC_FRAGMENT_DIR)/spectrum \ -$(MAGIC_FRAGMENT_DIR)/sql \ -$(MAGIC_FRAGMENT_DIR)/ssh \ -$(MAGIC_FRAGMENT_DIR)/ssl \ -$(MAGIC_FRAGMENT_DIR)/sun \ -$(MAGIC_FRAGMENT_DIR)/sysex \ -$(MAGIC_FRAGMENT_DIR)/tcl \ -$(MAGIC_FRAGMENT_DIR)/teapot \ -$(MAGIC_FRAGMENT_DIR)/terminfo \ -$(MAGIC_FRAGMENT_DIR)/tex \ -$(MAGIC_FRAGMENT_DIR)/tgif \ -$(MAGIC_FRAGMENT_DIR)/ti-8x \ -$(MAGIC_FRAGMENT_DIR)/timezone \ -$(MAGIC_FRAGMENT_DIR)/troff \ -$(MAGIC_FRAGMENT_DIR)/tuxedo \ -$(MAGIC_FRAGMENT_DIR)/typeset \ -$(MAGIC_FRAGMENT_DIR)/unicode \ -$(MAGIC_FRAGMENT_DIR)/unknown \ -$(MAGIC_FRAGMENT_DIR)/uuencode \ -$(MAGIC_FRAGMENT_DIR)/varied.out \ -$(MAGIC_FRAGMENT_DIR)/varied.script \ -$(MAGIC_FRAGMENT_DIR)/vax \ -$(MAGIC_FRAGMENT_DIR)/vicar \ -$(MAGIC_FRAGMENT_DIR)/virtual \ -$(MAGIC_FRAGMENT_DIR)/virtutech \ -$(MAGIC_FRAGMENT_DIR)/visx \ -$(MAGIC_FRAGMENT_DIR)/vms \ -$(MAGIC_FRAGMENT_DIR)/vmware \ -$(MAGIC_FRAGMENT_DIR)/vorbis \ -$(MAGIC_FRAGMENT_DIR)/vxl \ -$(MAGIC_FRAGMENT_DIR)/warc \ -$(MAGIC_FRAGMENT_DIR)/weak \ -$(MAGIC_FRAGMENT_DIR)/windows \ -$(MAGIC_FRAGMENT_DIR)/wireless \ -$(MAGIC_FRAGMENT_DIR)/wordprocessors \ -$(MAGIC_FRAGMENT_DIR)/wsdl \ -$(MAGIC_FRAGMENT_DIR)/xdelta \ -$(MAGIC_FRAGMENT_DIR)/xenix \ -$(MAGIC_FRAGMENT_DIR)/xilinx \ -$(MAGIC_FRAGMENT_DIR)/xo65 \ -$(MAGIC_FRAGMENT_DIR)/xwindows \ -$(MAGIC_FRAGMENT_DIR)/zfs \ -$(MAGIC_FRAGMENT_DIR)/zilog \ -$(MAGIC_FRAGMENT_DIR)/zyxel - -MAGIC = magic.mgc -CLEANFILES = ${MAGIC} $(MAGIC_FRAGMENT_DIR)/Localstuff - -# FIXME: Build file natively as well so that it can be used to compile -# the target's magic file; for now we bail if the local version does not match -if IS_CROSS_COMPILE -FILE_COMPILE = file -FILE_COMPILE_DEP = -else -FILE_COMPILE = $(top_builddir)/src/file -FILE_COMPILE_DEP = $(FILE_COMPILE) -endif - -${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) - @rm -fr magic - @mkdir magic && cp -p $(EXTRA_DIST) magic - @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \ - echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \ - else \ - v=$$(file --version | sed -e s/file-// -e q); \ - if [ "$$v" != "${PACKAGE_VERSION}" ]; then \ - echo "Cannot use the installed version of file ($$v) to"; \ - echo "cross-compile file ${PACKAGE_VERSION}"; \ - echo "Please install file ${PACKAGE_VERSION} locally first"; \ - exit 1; \ - fi; \ - fi) - $(FILE_COMPILE) -C -m magic - @rm -fr magic +SUBDIRS = src magic tests doc python Modified: stable/10/contrib/file/Makefile.in ============================================================================== --- stable/10/contrib/file/Makefile.in Thu Jul 10 22:54:38 2014 (r268514) +++ stable/10/contrib/file/Makefile.in Fri Jul 11 00:00:00 2014 (r268515) @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +13,52 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ @@ -33,8 +76,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -subdir = magic -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \ + README TODO compile config.guess config.sub depcomp install-sh \ + missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -42,42 +89,111 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/l $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(pkgdatadir)" -DATA = $(pkgdata_DATA) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print pkgdatadir = @pkgdatadir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -90,11 +206,13 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -104,6 +222,7 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -118,6 +237,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MINGW = @MINGW@ MKDIR_P = @MKDIR_P@ NM = @NM@ @@ -145,6 +265,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -178,7 +299,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -194,332 +314,181 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ - -# -# $File: Makefile.am,v 1.78 2012/01/27 01:41:26 christos Exp $ -# -MAGIC_FRAGMENT_BASE = Magdir -MAGIC_DIR = $(top_srcdir)/magic -MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE) -pkgdata_DATA = magic.mgc -EXTRA_DIST = \ -$(MAGIC_DIR)/Header \ -$(MAGIC_DIR)/Localstuff \ -$(MAGIC_FRAGMENT_DIR)/acorn \ -$(MAGIC_FRAGMENT_DIR)/adi \ -$(MAGIC_FRAGMENT_DIR)/adventure \ -$(MAGIC_FRAGMENT_DIR)/allegro \ -$(MAGIC_FRAGMENT_DIR)/alliant \ -$(MAGIC_FRAGMENT_DIR)/amanda \ -$(MAGIC_FRAGMENT_DIR)/amigaos \ -$(MAGIC_FRAGMENT_DIR)/animation \ -$(MAGIC_FRAGMENT_DIR)/apl \ -$(MAGIC_FRAGMENT_DIR)/apple \ -$(MAGIC_FRAGMENT_DIR)/applix \ -$(MAGIC_FRAGMENT_DIR)/archive \ -$(MAGIC_FRAGMENT_DIR)/assembler \ -$(MAGIC_FRAGMENT_DIR)/asterix \ -$(MAGIC_FRAGMENT_DIR)/att3b \ -$(MAGIC_FRAGMENT_DIR)/audio \ -$(MAGIC_FRAGMENT_DIR)/basis \ -$(MAGIC_FRAGMENT_DIR)/bflt \ -$(MAGIC_FRAGMENT_DIR)/blcr \ -$(MAGIC_FRAGMENT_DIR)/blender \ -$(MAGIC_FRAGMENT_DIR)/blit \ -$(MAGIC_FRAGMENT_DIR)/bout \ -$(MAGIC_FRAGMENT_DIR)/bsdi \ -$(MAGIC_FRAGMENT_DIR)/bsi \ -$(MAGIC_FRAGMENT_DIR)/btsnoop \ -$(MAGIC_FRAGMENT_DIR)/c-lang \ -$(MAGIC_FRAGMENT_DIR)/c64 \ -$(MAGIC_FRAGMENT_DIR)/cad \ -$(MAGIC_FRAGMENT_DIR)/cafebabe \ -$(MAGIC_FRAGMENT_DIR)/cddb \ -$(MAGIC_FRAGMENT_DIR)/chord \ -$(MAGIC_FRAGMENT_DIR)/cisco \ -$(MAGIC_FRAGMENT_DIR)/citrus \ -$(MAGIC_FRAGMENT_DIR)/clarion \ -$(MAGIC_FRAGMENT_DIR)/claris \ -$(MAGIC_FRAGMENT_DIR)/clipper \ -$(MAGIC_FRAGMENT_DIR)/commands \ -$(MAGIC_FRAGMENT_DIR)/communications \ -$(MAGIC_FRAGMENT_DIR)/compress \ -$(MAGIC_FRAGMENT_DIR)/console \ -$(MAGIC_FRAGMENT_DIR)/convex \ -$(MAGIC_FRAGMENT_DIR)/cracklib \ -$(MAGIC_FRAGMENT_DIR)/ctags \ -$(MAGIC_FRAGMENT_DIR)/cups \ -$(MAGIC_FRAGMENT_DIR)/dact \ -$(MAGIC_FRAGMENT_DIR)/database \ -$(MAGIC_FRAGMENT_DIR)/diamond \ -$(MAGIC_FRAGMENT_DIR)/diff \ -$(MAGIC_FRAGMENT_DIR)/digital \ -$(MAGIC_FRAGMENT_DIR)/dolby \ -$(MAGIC_FRAGMENT_DIR)/dump \ -$(MAGIC_FRAGMENT_DIR)/dyadic \ -$(MAGIC_FRAGMENT_DIR)/ebml \ -$(MAGIC_FRAGMENT_DIR)/editors \ -$(MAGIC_FRAGMENT_DIR)/efi \ -$(MAGIC_FRAGMENT_DIR)/elf \ -$(MAGIC_FRAGMENT_DIR)/encore \ -$(MAGIC_FRAGMENT_DIR)/epoc \ -$(MAGIC_FRAGMENT_DIR)/erlang \ -$(MAGIC_FRAGMENT_DIR)/esri \ -$(MAGIC_FRAGMENT_DIR)/fcs \ -$(MAGIC_FRAGMENT_DIR)/filesystems \ -$(MAGIC_FRAGMENT_DIR)/flash \ -$(MAGIC_FRAGMENT_DIR)/fonts \ -$(MAGIC_FRAGMENT_DIR)/fortran \ -$(MAGIC_FRAGMENT_DIR)/frame \ -$(MAGIC_FRAGMENT_DIR)/freebsd \ -$(MAGIC_FRAGMENT_DIR)/fsav \ -$(MAGIC_FRAGMENT_DIR)/fusecompress \ -$(MAGIC_FRAGMENT_DIR)/games \ -$(MAGIC_FRAGMENT_DIR)/gcc \ -$(MAGIC_FRAGMENT_DIR)/geo \ -$(MAGIC_FRAGMENT_DIR)/geos \ -$(MAGIC_FRAGMENT_DIR)/gimp \ -$(MAGIC_FRAGMENT_DIR)/gnome-keyring \ -$(MAGIC_FRAGMENT_DIR)/gnu \ -$(MAGIC_FRAGMENT_DIR)/gnumeric \ -$(MAGIC_FRAGMENT_DIR)/grace \ -$(MAGIC_FRAGMENT_DIR)/graphviz \ -$(MAGIC_FRAGMENT_DIR)/gringotts \ -$(MAGIC_FRAGMENT_DIR)/guile \ -$(MAGIC_FRAGMENT_DIR)/hitachi-sh \ -$(MAGIC_FRAGMENT_DIR)/hp \ -$(MAGIC_FRAGMENT_DIR)/human68k \ -$(MAGIC_FRAGMENT_DIR)/ibm370 \ -$(MAGIC_FRAGMENT_DIR)/ibm6000 \ -$(MAGIC_FRAGMENT_DIR)/iff \ -$(MAGIC_FRAGMENT_DIR)/images \ -$(MAGIC_FRAGMENT_DIR)/inform \ -$(MAGIC_FRAGMENT_DIR)/intel \ -$(MAGIC_FRAGMENT_DIR)/interleaf \ -$(MAGIC_FRAGMENT_DIR)/island \ -$(MAGIC_FRAGMENT_DIR)/ispell \ -$(MAGIC_FRAGMENT_DIR)/isz \ -$(MAGIC_FRAGMENT_DIR)/java \ -$(MAGIC_FRAGMENT_DIR)/jpeg \ -$(MAGIC_FRAGMENT_DIR)/karma \ -$(MAGIC_FRAGMENT_DIR)/kde \ -$(MAGIC_FRAGMENT_DIR)/kml \ -$(MAGIC_FRAGMENT_DIR)/lecter \ -$(MAGIC_FRAGMENT_DIR)/lex \ -$(MAGIC_FRAGMENT_DIR)/lif \ -$(MAGIC_FRAGMENT_DIR)/linux \ -$(MAGIC_FRAGMENT_DIR)/lisp \ -$(MAGIC_FRAGMENT_DIR)/llvm \ -$(MAGIC_FRAGMENT_DIR)/lua \ -$(MAGIC_FRAGMENT_DIR)/luks \ -$(MAGIC_FRAGMENT_DIR)/m4 \ -$(MAGIC_FRAGMENT_DIR)/mach \ -$(MAGIC_FRAGMENT_DIR)/macintosh \ -$(MAGIC_FRAGMENT_DIR)/magic \ -$(MAGIC_FRAGMENT_DIR)/mail.news \ -$(MAGIC_FRAGMENT_DIR)/make \ -$(MAGIC_FRAGMENT_DIR)/maple \ -$(MAGIC_FRAGMENT_DIR)/marc21 \ -$(MAGIC_FRAGMENT_DIR)/mathcad \ -$(MAGIC_FRAGMENT_DIR)/mathematica \ -$(MAGIC_FRAGMENT_DIR)/matroska \ -$(MAGIC_FRAGMENT_DIR)/mcrypt \ -$(MAGIC_FRAGMENT_DIR)/mercurial \ -$(MAGIC_FRAGMENT_DIR)/metastore \ -$(MAGIC_FRAGMENT_DIR)/mime \ -$(MAGIC_FRAGMENT_DIR)/mips \ -$(MAGIC_FRAGMENT_DIR)/mirage \ -$(MAGIC_FRAGMENT_DIR)/misctools \ -$(MAGIC_FRAGMENT_DIR)/mkid \ -$(MAGIC_FRAGMENT_DIR)/mlssa \ -$(MAGIC_FRAGMENT_DIR)/mmdf \ -$(MAGIC_FRAGMENT_DIR)/modem \ -$(MAGIC_FRAGMENT_DIR)/motorola \ -$(MAGIC_FRAGMENT_DIR)/mozilla \ -$(MAGIC_FRAGMENT_DIR)/msdos \ -$(MAGIC_FRAGMENT_DIR)/msooxml \ -$(MAGIC_FRAGMENT_DIR)/msvc \ -$(MAGIC_FRAGMENT_DIR)/mup \ -$(MAGIC_FRAGMENT_DIR)/music \ -$(MAGIC_FRAGMENT_DIR)/natinst \ -$(MAGIC_FRAGMENT_DIR)/ncr \ -$(MAGIC_FRAGMENT_DIR)/netbsd \ -$(MAGIC_FRAGMENT_DIR)/netscape \ -$(MAGIC_FRAGMENT_DIR)/netware \ -$(MAGIC_FRAGMENT_DIR)/news \ -$(MAGIC_FRAGMENT_DIR)/nitpicker \ -$(MAGIC_FRAGMENT_DIR)/oasis \ -$(MAGIC_FRAGMENT_DIR)/ocaml \ -$(MAGIC_FRAGMENT_DIR)/octave \ -$(MAGIC_FRAGMENT_DIR)/ole2compounddocs \ -$(MAGIC_FRAGMENT_DIR)/olf \ -$(MAGIC_FRAGMENT_DIR)/os2 \ -$(MAGIC_FRAGMENT_DIR)/os400 \ -$(MAGIC_FRAGMENT_DIR)/os9 \ -$(MAGIC_FRAGMENT_DIR)/osf1 \ -$(MAGIC_FRAGMENT_DIR)/palm \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 11 00:08:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D667187D; Fri, 11 Jul 2014 00:08: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 C33FA2579; Fri, 11 Jul 2014 00:08: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 s6B08DL8001058; Fri, 11 Jul 2014 00:08:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6B08Dk6001057; Fri, 11 Jul 2014 00:08:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407110008.s6B08Dk6001057@svn.freebsd.org> From: Xin LI Date: Fri, 11 Jul 2014 00:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268516 - stable/10/usr.bin/gzip X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2014 00:08:13 -0000 Author: delphij Date: Fri Jul 11 00:08:13 2014 New Revision: 268516 URL: http://svnweb.freebsd.org/changeset/base/268516 Log: MFC r267887: Correct buffer size. Submitted by: Sascha Wildner Modified: stable/10/usr.bin/gzip/zuncompress.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/10/usr.bin/gzip/zuncompress.c Fri Jul 11 00:00:00 2014 (r268515) +++ stable/10/usr.bin/gzip/zuncompress.c Fri Jul 11 00:08:13 2014 (r268516) @@ -145,7 +145,7 @@ zuncompress(FILE *in, FILE *out, char *p else compressed_pre = NULL; - while ((bin = fread(buf, 1, sizeof(buf), in)) != 0) { + while ((bin = fread(buf, 1, BUFSIZE, in)) != 0) { if (tflag == 0 && (off_t)fwrite(buf, 1, bin, out) != bin) { free(buf); return -1; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 11 00:11:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 C74C0AD6; Fri, 11 Jul 2014 00:11: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 B46922619; Fri, 11 Jul 2014 00:11: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 s6B0BOKS002796; Fri, 11 Jul 2014 00:11:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6B0BOHK002795; Fri, 11 Jul 2014 00:11:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407110011.s6B0BOHK002795@svn.freebsd.org> From: Xin LI Date: Fri, 11 Jul 2014 00:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268517 - stable/10/usr.bin/procstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2014 00:11:24 -0000 Author: delphij Date: Fri Jul 11 00:11:24 2014 New Revision: 268517 URL: http://svnweb.freebsd.org/changeset/base/268517 Log: MFC r267886: Use correct length for buffer. Submitted by: Sascha Wildner Modified: stable/10/usr.bin/procstat/procstat_files.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/procstat/procstat_files.c ============================================================================== --- stable/10/usr.bin/procstat/procstat_files.c Fri Jul 11 00:08:13 2014 (r268516) +++ stable/10/usr.bin/procstat/procstat_files.c Fri Jul 11 00:11:24 2014 (r268517) @@ -114,7 +114,7 @@ addr_to_string(struct sockaddr_storage * snprintf(buffer, buflen, "%s.%d", buffer2, ntohs(sin6->sin6_port)); else - strlcpy(buffer, "-", sizeof(buffer)); + strlcpy(buffer, "-", buflen); break; default: From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 11 00:14:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 22365D24; Fri, 11 Jul 2014 00:14: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 0F1E62632; Fri, 11 Jul 2014 00:14: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 s6B0ETLU005565; Fri, 11 Jul 2014 00:14:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6B0ETpc005564; Fri, 11 Jul 2014 00:14:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407110014.s6B0ETpc005564@svn.freebsd.org> From: Xin LI Date: Fri, 11 Jul 2014 00:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268518 - stable/10/sys/dev/mrsas X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2014 00:14:30 -0000 Author: delphij Date: Fri Jul 11 00:14:29 2014 New Revision: 268518 URL: http://svnweb.freebsd.org/changeset/base/268518 Log: Correct memset size. Submitted by: Sascha Wildner (swildner at dragonflybsd dot org) Reviewed by: Kashyap Desai Modified: stable/10/sys/dev/mrsas/mrsas_fp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- stable/10/sys/dev/mrsas/mrsas_fp.c Fri Jul 11 00:11:24 2014 (r268517) +++ stable/10/sys/dev/mrsas/mrsas_fp.c Fri Jul 11 00:14:29 2014 (r268518) @@ -1219,7 +1219,7 @@ void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO opcode = cdb[0] == READ_6 ? READ_10 : WRITE_10; control = cdb[5]; - memset(cdb, 0, sizeof(cdb)); + memset(cdb, 0, sizeof(io_request->CDB.CDB32)); cdb[0] = opcode; cdb[9] = control; From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 11 00:26:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 2E7BB1A3; Fri, 11 Jul 2014 00:26:58 +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 1B4E8273B; Fri, 11 Jul 2014 00:26:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6B0QvpD010525; Fri, 11 Jul 2014 00:26:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6B0Qvtn010524; Fri, 11 Jul 2014 00:26:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407110026.s6B0Qvtn010524@svn.freebsd.org> From: Xin LI Date: Fri, 11 Jul 2014 00:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268519 - stable/10/sys/dev/random X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2014 00:26:58 -0000 Author: delphij Date: Fri Jul 11 00:26:57 2014 New Revision: 268519 URL: http://svnweb.freebsd.org/changeset/base/268519 Log: MFC r267984: Use Intel's official name (Secure Key) per Intel® Digital Random Number Generator (DRNG) Software Implementation Guide. Reviewed by: kib Approved by: so Modified: stable/10/sys/dev/random/ivy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/random/ivy.c ============================================================================== --- stable/10/sys/dev/random/ivy.c Fri Jul 11 00:14:29 2014 (r268518) +++ stable/10/sys/dev/random/ivy.c Fri Jul 11 00:26:57 2014 (r268519) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); static int random_ivy_read(void *, int); static struct random_hardware_source random_ivy = { - .ident = "Hardware, Intel IvyBridge+ RNG", + .ident = "Hardware, Intel Secure Key RNG", .source = RANDOM_PURE_RDRAND, .read = random_ivy_read }; From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 01:59:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 121DBE3B; Sat, 12 Jul 2014 01:59:08 +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 D85E32EFD; Sat, 12 Jul 2014 01:59:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6C1x79d011019; Sat, 12 Jul 2014 01:59:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C1x7aB011018; Sat, 12 Jul 2014 01:59:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407120159.s6C1x7aB011018@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jul 2014 01:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268545 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 01:59:08 -0000 Author: mav Date: Sat Jul 12 01:59:07 2014 New Revision: 268545 URL: http://svnweb.freebsd.org/changeset/base/268545 Log: MFC r267986: Remove odd practice of inverting error codes. -EPERM is equal to ERESTART, returning which from ioctl() handler causes infinite syscall restart. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jul 12 01:06:29 2014 (r268544) +++ stable/10/sys/cam/ctl/ctl.c Sat Jul 12 01:59:07 2014 (r268545) @@ -2191,14 +2191,14 @@ ctl_ioctl(struct cdev *dev, u_long cmd, * to this FETD. */ if ((softc->ioctl_info.flags & CTL_IOCTL_FLAG_ENABLED) == 0) { - retval = -EPERM; + retval = EPERM; break; } io = ctl_alloc_io(softc->ioctl_info.fe.ctl_pool_ref); if (io == NULL) { printf("ctl_ioctl: can't allocate ctl_io!\n"); - retval = -ENOSPC; + retval = ENOSPC; break; } @@ -2728,7 +2728,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, softc->flags |= CTL_FLAG_REAL_SYNC; break; default: - retval = -EINVAL; + retval = EINVAL; break; } mtx_unlock(&softc->ctl_lock); @@ -3199,7 +3199,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (found == 0) { printf("ctl: unknown ioctl command %#lx or backend " "%d\n", cmd, type); - retval = -EINVAL; + retval = EINVAL; break; } retval = backend->ioctl(dev, cmd, addr, flag, td); @@ -3364,7 +3364,7 @@ ctl_pool_create(struct ctl_softc *ctl_so pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, M_NOWAIT | M_ZERO); if (pool == NULL) { - retval = -ENOMEM; + retval = ENOMEM; goto bailout; } @@ -3447,7 +3447,7 @@ ctl_pool_acquire(struct ctl_io_pool *poo mtx_assert(&pool->ctl_softc->pool_lock, MA_OWNED); if (pool->flags & CTL_POOL_FLAG_INVALID) - return (-EINVAL); + return (EINVAL); pool->refcount++; @@ -9396,7 +9396,7 @@ ctl_tur(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_tur\n")); if (lun == NULL) - return (-EINVAL); + return (EINVAL); ctsio->scsi_status = SCSI_STATUS_OK; ctsio->io_hdr.status = CTL_SUCCESS; @@ -13417,7 +13417,7 @@ ctl_queue(union ctl_io *io) default: mtx_unlock(&ctl_softc->ctl_lock); printf("ctl_queue: unknown I/O type %d\n", io->io_hdr.io_type); - return (-EINVAL); + return (EINVAL); break; /* NOTREACHED */ } mtx_unlock(&ctl_softc->ctl_lock); From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 02:03:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 93706112; Sat, 12 Jul 2014 02:03: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 7F7312F99; Sat, 12 Jul 2014 02:03: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 s6C23TDB015599; Sat, 12 Jul 2014 02:03:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C23T5O015598; Sat, 12 Jul 2014 02:03:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407120203.s6C23T5O015598@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jul 2014 02:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268546 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 02:03:29 -0000 Author: mav Date: Sat Jul 12 02:03:29 2014 New Revision: 268546 URL: http://svnweb.freebsd.org/changeset/base/268546 Log: MFC r268419: Fix use-after-free on XPT_RESET_BUS. That command is not queued, so does not use later status update. Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Sat Jul 12 01:59:07 2014 (r268545) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Sat Jul 12 02:03:29 2014 (r268546) @@ -505,6 +505,10 @@ cfcs_done(union ctl_io *io) union ccb *ccb; ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + if (ccb == NULL) { + ctl_free_io(io); + return; + } /* * At this point we should have status. If we don't, that's a bug. @@ -786,7 +790,8 @@ cfcs_action(struct cam_sim *sim, union c ctl_zero_io(io); /* Save pointers on both sides */ - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = ccb; + if (ccb->ccb_h.func_code == XPT_RESET_DEV) + io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = ccb; ccb->ccb_h.io_ptr = io; io->io_hdr.io_type = CTL_IO_TASK; From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 02:17:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1F5F86E5; Sat, 12 Jul 2014 02:17: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 0A9E720A4; Sat, 12 Jul 2014 02:17: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 s6C2HB3t023093; Sat, 12 Jul 2014 02:17:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C2HAkM023091; Sat, 12 Jul 2014 02:17:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407120217.s6C2HAkM023091@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jul 2014 02:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268549 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 02:17:11 -0000 Author: mav Date: Sat Jul 12 02:17:10 2014 New Revision: 268549 URL: http://svnweb.freebsd.org/changeset/base/268549 Log: MFC r267877: Lock devstat updates in block backend to make it usable. Polish lock names. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Sat Jul 12 02:05:51 2014 (r268548) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Sat Jul 12 02:17:10 2014 (r268549) @@ -162,7 +162,6 @@ struct ctl_be_block_lun { cbb_dispatch_t dispatch; cbb_dispatch_t lun_flush; cbb_dispatch_t unmap; - struct mtx lock; uma_zone_t lun_zone; uint64_t size_blocks; uint64_t size_bytes; @@ -181,6 +180,8 @@ struct ctl_be_block_lun { STAILQ_HEAD(, ctl_io_hdr) input_queue; STAILQ_HEAD(, ctl_io_hdr) config_write_queue; STAILQ_HEAD(, ctl_io_hdr) datamove_queue; + struct mtx_padalign io_lock; + struct mtx_padalign queue_lock; }; /* @@ -338,22 +339,7 @@ ctl_free_beio(struct ctl_be_block_io *be static void ctl_complete_beio(struct ctl_be_block_io *beio) { - union ctl_io *io; - int io_len; - - io = beio->io; - - if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) - io_len = beio->io_len; - else - io_len = 0; - - devstat_end_transaction(beio->lun->disk_stats, - /*bytes*/ io_len, - beio->ds_tag_type, - beio->ds_trans_type, - /*now*/ NULL, - /*then*/&beio->ds_t0); + union ctl_io *io = beio->io; if (beio->beio_cont != NULL) { beio->beio_cont(beio); @@ -451,14 +437,14 @@ ctl_be_block_move_done(union ctl_io *io) * This move done routine is generally called in the SIM's * interrupt context, and therefore we cannot block. */ - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); /* * XXX KDM make sure that links is okay to use at this point. * Otherwise, we either need to add another field to ctl_io_hdr, * or deal with resource allocation here. */ STAILQ_INSERT_TAIL(&be_lun->datamove_queue, &io->io_hdr, links); - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task); @@ -480,7 +466,7 @@ ctl_be_block_biodone(struct bio *bio) DPRINTF("entered\n"); error = bio->bio_error; - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->io_lock); if (error != 0) beio->num_errors++; @@ -498,7 +484,7 @@ ctl_be_block_biodone(struct bio *bio) */ if ((beio->send_complete == 0) || (beio->num_bios_done < beio->num_bios_sent)) { - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->io_lock); return; } @@ -506,7 +492,10 @@ ctl_be_block_biodone(struct bio *bio) * At this point, we've verified that we are the last I/O to * complete, so it's safe to drop the lock. */ - mtx_unlock(&be_lun->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 there are any errors from the backing device, we fail the @@ -548,15 +537,18 @@ static void ctl_be_block_flush_file(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { - union ctl_io *io; + union ctl_io *io = beio->io; struct mount *mountpoint; int error, lock_flags; DPRINTF("entered\n"); - io = beio->io; + 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); - (void) vn_start_write(be_lun->vn, &mountpoint, V_WAIT); + (void) vn_start_write(be_lun->vn, &mountpoint, V_WAIT); if (MNT_SHARED_WRITES(mountpoint) || ((mountpoint == NULL) @@ -567,14 +559,17 @@ ctl_be_block_flush_file(struct ctl_be_bl vn_lock(be_lun->vn, lock_flags | LK_RETRY); - binuptime(&beio->ds_t0); - devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0); - error = VOP_FSYNC(be_lun->vn, MNT_WAIT, curthread); VOP_UNLOCK(be_lun->vn, 0); vn_finished_write(mountpoint); + 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 (error == 0) ctl_set_success(&io->scsiio); else { @@ -629,12 +624,14 @@ ctl_be_block_dispatch_file(struct ctl_be 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) { vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); - binuptime(&beio->ds_t0); - devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0); - /* * UFS pays attention to IO_DIRECT for reads. If the * DIRECTIO option is configured into the kernel, it calls @@ -675,9 +672,6 @@ ctl_be_block_dispatch_file(struct ctl_be vn_lock(be_lun->vn, lock_flags | LK_RETRY); - binuptime(&beio->ds_t0); - devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0); - /* * UFS pays attention to IO_DIRECT for writes. The write * is done asynchronously. (Normally the write would just @@ -704,6 +698,12 @@ ctl_be_block_dispatch_file(struct ctl_be 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. @@ -773,7 +773,9 @@ ctl_be_block_flush_dev(struct ctl_be_blo beio->send_complete = 1; binuptime(&beio->ds_t0); + mtx_lock(&be_lun->io_lock); devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0); + mtx_unlock(&be_lun->io_lock); (*dev_data->csw->d_strategy)(bio); } @@ -804,11 +806,11 @@ ctl_be_block_unmap_dev_range(struct ctl_ off += bio->bio_length; len -= bio->bio_length; - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->io_lock); beio->num_bios_sent++; if (last && len == 0) beio->send_complete = 1; - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->io_lock); (*dev_data->csw->d_strategy)(bio); } @@ -830,7 +832,9 @@ ctl_be_block_unmap_dev(struct ctl_be_blo DPRINTF("entered\n"); binuptime(&beio->ds_t0); + mtx_lock(&be_lun->io_lock); devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0); + mtx_unlock(&be_lun->io_lock); if (beio->io_offset == -1) { beio->io_len = 0; @@ -854,6 +858,7 @@ static void ctl_be_block_dispatch_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { + TAILQ_HEAD(, bio) queue = TAILQ_HEAD_INITIALIZER(queue); int i; struct bio *bio; struct ctl_be_block_devdata *dev_data; @@ -874,14 +879,6 @@ ctl_be_block_dispatch_dev(struct ctl_be_ max_iosize = DFLTPHYS; cur_offset = beio->io_offset; - - /* - * XXX KDM need to accurately reflect the number of I/Os outstanding - * to a device. - */ - binuptime(&beio->ds_t0); - devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0); - for (i = 0; i < beio->num_segs; i++) { size_t cur_size; uint8_t *cur_ptr; @@ -909,32 +906,23 @@ ctl_be_block_dispatch_dev(struct ctl_be_ cur_ptr += bio->bio_length; cur_size -= bio->bio_length; - /* - * Make sure we set the complete bit just before we - * issue the last bio so we don't wind up with a - * race. - * - * Use the LUN mutex here instead of a combination - * of atomic variables for simplicity. - * - * XXX KDM we could have a per-IO lock, but that - * would cause additional per-IO setup and teardown - * overhead. Hopefully there won't be too much - * contention on the LUN lock. - */ - mtx_lock(&be_lun->lock); - + TAILQ_INSERT_TAIL(&queue, bio, bio_queue); beio->num_bios_sent++; - - if ((i == beio->num_segs - 1) - && (cur_size == 0)) - beio->send_complete = 1; - - mtx_unlock(&be_lun->lock); - - (*dev_data->csw->d_strategy)(bio); } } + binuptime(&beio->ds_t0); + mtx_lock(&be_lun->io_lock); + devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0); + beio->send_complete = 1; + mtx_unlock(&be_lun->io_lock); + + /* + * Fire off all allocated requests! + */ + while ((bio = TAILQ_FIRST(&queue)) != NULL) { + TAILQ_REMOVE(&queue, bio, bio_queue); + (*dev_data->csw->d_strategy)(bio); + } } static void @@ -1197,14 +1185,14 @@ ctl_be_block_next(struct ctl_be_block_io io->io_hdr.status &= ~CTL_STATUS_MASK; io->io_hdr.status |= CTL_STATUS_NONE; - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); /* * XXX KDM make sure that links is okay to use at this point. * Otherwise, we either need to add another field to ctl_io_hdr, * or deal with resource allocation here. */ STAILQ_INSERT_TAIL(&be_lun->input_queue, &io->io_hdr, links); - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task); } @@ -1352,7 +1340,7 @@ ctl_be_block_worker(void *context, int p DPRINTF("entered\n"); - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); for (;;) { io = (union ctl_io *)STAILQ_FIRST(&be_lun->datamove_queue); if (io != NULL) { @@ -1363,13 +1351,13 @@ ctl_be_block_worker(void *context, int p STAILQ_REMOVE(&be_lun->datamove_queue, &io->io_hdr, ctl_io_hdr, links); - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); beio = (struct ctl_be_block_io *)PRIV(io)->ptr; be_lun->dispatch(be_lun, beio); - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); continue; } io = (union ctl_io *)STAILQ_FIRST(&be_lun->config_write_queue); @@ -1380,11 +1368,11 @@ ctl_be_block_worker(void *context, int p STAILQ_REMOVE(&be_lun->config_write_queue, &io->io_hdr, ctl_io_hdr, links); - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); ctl_be_block_cw_dispatch(be_lun, io); - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); continue; } io = (union ctl_io *)STAILQ_FIRST(&be_lun->input_queue); @@ -1393,7 +1381,7 @@ ctl_be_block_worker(void *context, int p STAILQ_REMOVE(&be_lun->input_queue, &io->io_hdr, ctl_io_hdr, links); - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); /* * We must drop the lock, since this routine and @@ -1401,7 +1389,7 @@ ctl_be_block_worker(void *context, int p */ ctl_be_block_dispatch(be_lun, io); - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); continue; } @@ -1411,7 +1399,7 @@ ctl_be_block_worker(void *context, int p */ break; } - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); } /* @@ -1439,14 +1427,14 @@ ctl_be_block_submit(union ctl_io *io) PRIV(io)->len = 0; - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); /* * XXX KDM make sure that links is okay to use at this point. * Otherwise, we either need to add another field to ctl_io_hdr, * or deal with resource allocation here. */ STAILQ_INSERT_TAIL(&be_lun->input_queue, &io->io_hdr, links); - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task); return (CTL_RETVAL_COMPLETE); @@ -1870,7 +1858,8 @@ ctl_be_block_create(struct ctl_be_block_ STAILQ_INIT(&be_lun->config_write_queue); STAILQ_INIT(&be_lun->datamove_queue); sprintf(be_lun->lunname, "cblk%d", softc->num_luns); - mtx_init(&be_lun->lock, be_lun->lunname, NULL, MTX_DEF); + mtx_init(&be_lun->io_lock, "cblk io lock", NULL, MTX_DEF); + mtx_init(&be_lun->queue_lock, "cblk queue lock", NULL, MTX_DEF); ctl_init_opts(&be_lun->ctl_be_lun, req); be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG, @@ -2117,7 +2106,8 @@ bailout_error: if (be_lun->lun_zone != NULL) uma_zdestroy(be_lun->lun_zone); ctl_free_opts(&be_lun->ctl_be_lun); - mtx_destroy(&be_lun->lock); + mtx_destroy(&be_lun->queue_lock); + mtx_destroy(&be_lun->io_lock); free(be_lun, M_CTLBLK); return (retval); @@ -2205,7 +2195,8 @@ ctl_be_block_rm(struct ctl_be_block_soft ctl_free_opts(&be_lun->ctl_be_lun); free(be_lun->dev_path, M_CTLBLK); - + mtx_destroy(&be_lun->queue_lock); + mtx_destroy(&be_lun->io_lock); free(be_lun, M_CTLBLK); req->status = CTL_LUN_OK; @@ -2452,10 +2443,10 @@ ctl_be_block_config_write(union ctl_io * * user asked to be synced out. When they issue a sync * cache command, we'll sync out the whole thing. */ - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); STAILQ_INSERT_TAIL(&be_lun->config_write_queue, &io->io_hdr, links); - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task); break; case START_STOP_UNIT: { @@ -2546,7 +2537,7 @@ ctl_be_block_init(void) softc = &backend_block_softc; retval = 0; - mtx_init(&softc->lock, "ctlblk", NULL, MTX_DEF); + mtx_init(&softc->lock, "ctlblock", NULL, MTX_DEF); beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); STAILQ_INIT(&softc->disk_list); Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Sat Jul 12 02:05:51 2014 (r268548) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Sat Jul 12 02:17:10 2014 (r268549) @@ -84,7 +84,7 @@ struct ctl_be_ramdisk_lun { struct taskqueue *io_taskqueue; struct task io_task; STAILQ_HEAD(, ctl_io_hdr) cont_queue; - struct mtx lock; + struct mtx_padalign queue_lock; }; struct ctl_be_ramdisk_softc { @@ -150,7 +150,7 @@ ctl_backend_ramdisk_init(void) memset(softc, 0, sizeof(*softc)); - mtx_init(&softc->lock, "ramdisk", NULL, MTX_DEF); + mtx_init(&softc->lock, "ctlramdisk", NULL, MTX_DEF); STAILQ_INIT(&softc->lun_list); softc->rd_size = 1024 * 1024; @@ -242,10 +242,10 @@ ctl_backend_ramdisk_move_done(union ctl_ && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { if (io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer > 0) { - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); STAILQ_INSERT_TAIL(&be_lun->cont_queue, &io->io_hdr, links); - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task); return (0); @@ -350,18 +350,18 @@ ctl_backend_ramdisk_worker(void *context be_lun = (struct ctl_be_ramdisk_lun *)context; softc = be_lun->softc; - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); for (;;) { io = (union ctl_io *)STAILQ_FIRST(&be_lun->cont_queue); if (io != NULL) { STAILQ_REMOVE(&be_lun->cont_queue, &io->io_hdr, ctl_io_hdr, links); - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); ctl_backend_ramdisk_continue(io); - mtx_lock(&be_lun->lock); + mtx_lock(&be_lun->queue_lock); continue; } @@ -371,7 +371,7 @@ ctl_backend_ramdisk_worker(void *context */ break; } - mtx_unlock(&be_lun->lock); + mtx_unlock(&be_lun->queue_lock); } static int @@ -506,7 +506,7 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram taskqueue_drain(be_lun->io_taskqueue, &be_lun->io_task); taskqueue_free(be_lun->io_taskqueue); ctl_free_opts(&be_lun->ctl_be_lun); - mtx_destroy(&be_lun->lock); + mtx_destroy(&be_lun->queue_lock); free(be_lun, M_RAMDISK); } @@ -639,7 +639,7 @@ ctl_backend_ramdisk_create(struct ctl_be } STAILQ_INIT(&be_lun->cont_queue); - mtx_init(&be_lun->lock, "CTL ramdisk", NULL, MTX_DEF); + mtx_init(&be_lun->queue_lock, "cram queue lock", NULL, MTX_DEF); TASK_INIT(&be_lun->io_task, /*priority*/0, ctl_backend_ramdisk_worker, be_lun); @@ -722,7 +722,7 @@ bailout_error: taskqueue_free(be_lun->io_taskqueue); } ctl_free_opts(&be_lun->ctl_be_lun); - mtx_destroy(&be_lun->lock); + mtx_destroy(&be_lun->queue_lock); free(be_lun, M_RAMDISK); } From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 02:24:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5AEA4927; Sat, 12 Jul 2014 02:24: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 3B19D2159; Sat, 12 Jul 2014 02:24: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 s6C2Orop028228; Sat, 12 Jul 2014 02:24:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C2OqLM028219; Sat, 12 Jul 2014 02:24:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407120224.s6C2OqLM028219@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jul 2014 02:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268550 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 02:24:53 -0000 Author: mav Date: Sat Jul 12 02:24:52 2014 New Revision: 268550 URL: http://svnweb.freebsd.org/changeset/base/268550 Log: MFC r267905: Add READ BUFFER and improve WRITE BUFFER SCSI commands support. This gives some use to 512KB per-LUN buffers, allocated for Copan-specific processor code and not used. It allows, for example, to test transport performance and/or correctness without accessing the media, as supported by Linux version of sg3_utils. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:17:10 2014 (r268549) +++ stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:24:52 2014 (r268550) @@ -4954,7 +4954,8 @@ ctl_config_move_done(union ctl_io *io) /*sks_valid*/ 1, /*retry_count*/ io->io_hdr.port_status); - free(io->scsiio.kern_data_ptr, M_CTL); + if (io->io_hdr.flags & CTL_FLAG_ALLOCATED) + free(io->scsiio.kern_data_ptr, M_CTL); ctl_done(io); goto bailout; } @@ -4967,7 +4968,8 @@ ctl_config_move_done(union ctl_io *io) * S/G list. If we start using S/G lists for config data, * we'll need to know how to clean them up here as well. */ - free(io->scsiio.kern_data_ptr, M_CTL); + if (io->io_hdr.flags & CTL_FLAG_ALLOCATED) + free(io->scsiio.kern_data_ptr, M_CTL); /* Hopefully the user has already set the status... */ ctl_done(io); } else { @@ -5712,26 +5714,40 @@ bailout: } int -ctl_write_buffer(struct ctl_scsiio *ctsio) +ctl_read_buffer(struct ctl_scsiio *ctsio) { - struct scsi_write_buffer *cdb; - struct copan_page_header *header; + struct scsi_read_buffer *cdb; struct ctl_lun *lun; - struct ctl_softc *ctl_softc; int buffer_offset, len; - int retval; + static uint8_t descr[4]; + static uint8_t echo_descr[4] = { 0 }; - header = NULL; + CTL_DEBUG_PRINT(("ctl_read_buffer\n")); - retval = CTL_RETVAL_COMPLETE; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + cdb = (struct scsi_read_buffer *)ctsio->cdb; - CTL_DEBUG_PRINT(("ctl_write_buffer\n")); + if (lun->flags & CTL_LUN_PR_RESERVED) { + uint32_t residx; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctl_softc = control_softc; - cdb = (struct scsi_write_buffer *)ctsio->cdb; + /* + * XXX KDM need a lock here. + */ + residx = ctl_get_resindex(&ctsio->io_hdr.nexus); + if ((lun->res_type == SPR_TYPE_EX_AC + && residx != lun->pr_res_idx) + || ((lun->res_type == SPR_TYPE_EX_AC_RO + || lun->res_type == SPR_TYPE_EX_AC_AR) + && !lun->per_res[residx].registered)) { + ctl_set_reservation_conflict(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + } - if ((cdb->byte2 & RWB_MODE) != RWB_MODE_DATA) { + if ((cdb->byte2 & RWB_MODE) != RWB_MODE_DATA && + (cdb->byte2 & RWB_MODE) != RWB_MODE_ECHO_DESCR && + (cdb->byte2 & RWB_MODE) != RWB_MODE_DESCR) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, @@ -5755,7 +5771,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsi len = scsi_3btoul(cdb->length); buffer_offset = scsi_3btoul(cdb->offset); - if (len > sizeof(lun->write_buffer)) { + if (buffer_offset + len > sizeof(lun->write_buffer)) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, @@ -5766,11 +5782,68 @@ ctl_write_buffer(struct ctl_scsiio *ctsi return (CTL_RETVAL_COMPLETE); } - if (buffer_offset != 0) { + if ((cdb->byte2 & RWB_MODE) == RWB_MODE_DESCR) { + descr[0] = 0; + scsi_ulto3b(sizeof(lun->write_buffer), &descr[1]); + ctsio->kern_data_ptr = descr; + len = min(len, sizeof(descr)); + } else if ((cdb->byte2 & RWB_MODE) == RWB_MODE_ECHO_DESCR) { + ctsio->kern_data_ptr = echo_descr; + len = min(len, sizeof(echo_descr)); + } else + ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; + ctsio->kern_data_len = len; + ctsio->kern_total_len = len; + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); +} + +int +ctl_write_buffer(struct ctl_scsiio *ctsio) +{ + struct scsi_write_buffer *cdb; + struct ctl_lun *lun; + int buffer_offset, len; + + CTL_DEBUG_PRINT(("ctl_write_buffer\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + cdb = (struct scsi_write_buffer *)ctsio->cdb; + + if ((cdb->byte2 & RWB_MODE) != RWB_MODE_DATA) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 1, + /*bit_valid*/ 1, + /*bit*/ 4); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + if (cdb->buffer_id != 0) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 2, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + len = scsi_3btoul(cdb->length); + buffer_offset = scsi_3btoul(cdb->offset); + + if (buffer_offset + len > sizeof(lun->write_buffer)) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, - /*field*/ 3, + /*field*/ 6, /*bit_valid*/ 0, /*bit*/ 0); ctl_done((union ctl_io *)ctsio); @@ -5782,7 +5855,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsi * malloc it and tell the caller the data buffer is here. */ if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { - ctsio->kern_data_ptr = lun->write_buffer; + ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_data_resid = 0; @@ -6993,6 +7066,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -7052,6 +7126,7 @@ ctl_read_capacity(struct ctl_scsiio *cts ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -7114,6 +7189,7 @@ ctl_read_capacity_16(struct ctl_scsiio * ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -7287,6 +7363,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct } } + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; CTL_DEBUG_PRINT(("buf = %x %x %x %x %x %x %x %x\n", @@ -7512,6 +7589,7 @@ retry: } mtx_unlock(&softc->ctl_lock); + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; CTL_DEBUG_PRINT(("buf = %x %x %x %x %x %x %x %x\n", @@ -9225,6 +9303,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio */ ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -9351,7 +9430,7 @@ ctl_request_sense(struct ctl_scsiio *cts * parameter data. */ ctsio->sense_len = 0; - + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -9380,6 +9459,7 @@ no_sense: * autosense in this case. We're reporting sense as parameter data. */ ctsio->sense_len = 0; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -9467,6 +9547,7 @@ ctl_inquiry_evpd_supported(struct ctl_sc ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -9535,6 +9616,7 @@ ctl_inquiry_evpd_serial(struct ctl_scsii #endif ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -9728,6 +9810,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -9784,6 +9867,7 @@ ctl_inquiry_evpd_block_limits(struct ctl scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length); ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -9833,6 +9917,7 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10; ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); @@ -10117,6 +10202,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio ctsio->scsi_status = SCSI_STATUS_OK; if (ctsio->kern_data_len > 0) { + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); } else { Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Sat Jul 12 02:17:10 2014 (r268549) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Sat Jul 12 02:24:52 2014 (r268550) @@ -314,12 +314,15 @@ struct ctl_cmd_entry ctl_cmd_table[] = {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 3B WRITE BUFFER */ -{ctl_write_buffer, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_PROC | - CTL_FLAG_DATA_OUT, +{ctl_write_buffer, CTL_SERIDX_MD_SEL, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_FLAG_DATA_OUT, CTL_LUN_PAT_NONE}, /* 3C READ BUFFER */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_read_buffer, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_LUN_PAT_NONE}, /* 3D UPDATE BLOCK */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sat Jul 12 02:17:10 2014 (r268549) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sat Jul 12 02:24:52 2014 (r268550) @@ -2236,6 +2236,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Sat Jul 12 02:17:10 2014 (r268549) +++ stable/10/sys/cam/ctl/ctl_private.h Sat Jul 12 02:24:52 2014 (r268550) @@ -469,6 +469,7 @@ int ctl_scsi_reserve(struct ctl_scsiio * int ctl_start_stop(struct ctl_scsiio *ctsio); int ctl_sync_cache(struct ctl_scsiio *ctsio); int ctl_format(struct ctl_scsiio *ctsio); +int ctl_read_buffer(struct ctl_scsiio *ctsio); int ctl_write_buffer(struct ctl_scsiio *ctsio); int ctl_write_same(struct ctl_scsiio *ctsio); int ctl_unmap(struct ctl_scsiio *ctsio); From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 02:26:12 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8054FA6E; Sat, 12 Jul 2014 02:26: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 6C8EE2165; Sat, 12 Jul 2014 02:26: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 s6C2QCd6028685; Sat, 12 Jul 2014 02:26:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C2QBxT028682; Sat, 12 Jul 2014 02:26:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407120226.s6C2QBxT028682@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jul 2014 02:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268551 - in stable/10/sys/cam: ctl scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 02:26:12 -0000 Author: mav Date: Sat Jul 12 02:26:11 2014 New Revision: 268551 URL: http://svnweb.freebsd.org/changeset/base/268551 Log: MFC r267906: Allow MODE SENSE commands through Write Exclusive persistent reservation, as required by SPC-4. Report that fact in persistent reservation capabilities. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:24:52 2014 (r268550) +++ stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:26:11 2014 (r268551) @@ -6772,6 +6772,24 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) else control_dev = 0; + if (lun->flags & CTL_LUN_PR_RESERVED) { + uint32_t residx; + + /* + * XXX KDM need a lock here. + */ + residx = ctl_get_resindex(&ctsio->io_hdr.nexus); + if ((lun->res_type == SPR_TYPE_EX_AC + && residx != lun->pr_res_idx) + || ((lun->res_type == SPR_TYPE_EX_AC_RO + || lun->res_type == SPR_TYPE_EX_AC_AR) + && !lun->per_res[residx].registered)) { + ctl_set_reservation_conflict(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + } + switch (ctsio->cdb[0]) { case MODE_SENSE_6: { struct scsi_mode_sense_6 *cdb; @@ -7568,7 +7586,7 @@ retry: res_cap = (struct scsi_per_res_cap *)ctsio->kern_data_ptr; scsi_ulto2b(sizeof(*res_cap), res_cap->length); - res_cap->flags2 |= SPRI_TMV; + res_cap->flags2 |= SPRI_TMV | SPRI_ALLOW_3; type_mask = SPRI_TM_WR_EX_AR | SPRI_TM_EX_AC_RO | SPRI_TM_WR_EX_RO | Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Sat Jul 12 02:24:52 2014 (r268550) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Sat Jul 12 02:26:11 2014 (r268551) @@ -192,7 +192,8 @@ struct ctl_cmd_entry ctl_cmd_table[] = CTL_CMD_FLAG_OK_ON_STOPPED | CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE}, /* 1B START STOP UNIT */ @@ -436,7 +437,8 @@ struct ctl_cmd_entry ctl_cmd_table[] = CTL_CMD_FLAG_OK_ON_STOPPED | CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE}, /* 5B CLOSE TRACK/SESSION */ Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Sat Jul 12 02:24:52 2014 (r268550) +++ stable/10/sys/cam/scsi/scsi_all.h Sat Jul 12 02:26:11 2014 (r268551) @@ -308,6 +308,11 @@ struct scsi_per_res_cap #define SPRI_PTPL_C 0x01 uint8_t flags2; #define SPRI_TMV 0x80 +#define SPRI_ALLOW_MASK 0x70 +#define SPRI_ALLOW_0 0x00 +#define SPRI_ALLOW_1 0x10 +#define SPRI_ALLOW_2 0x20 +#define SPRI_ALLOW_3 0x30 #define SPRI_PTPL_A 0x01 uint8_t type_mask[2]; #define SPRI_TM_WR_EX_AR 0x8000 @@ -746,12 +751,16 @@ struct scsi_read_buffer { u_int8_t opcode; u_int8_t byte2; -#define RWB_MODE 0x07 +#define RWB_MODE 0x1F #define RWB_MODE_HDR_DATA 0x00 #define RWB_MODE_VENDOR 0x01 #define RWB_MODE_DATA 0x02 +#define RWB_MODE_DESCR 0x03 #define RWB_MODE_DOWNLOAD 0x04 #define RWB_MODE_DOWNLOAD_SAVE 0x05 +#define RWB_MODE_ECHO 0x0A +#define RWB_MODE_ECHO_DESCR 0x0B +#define RWB_MODE_ERROR_HISTORY 0x1C u_int8_t buffer_id; u_int8_t offset[3]; u_int8_t length[3]; From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 02:28:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 E0C7BBCB; Sat, 12 Jul 2014 02:28: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 C1042217C; Sat, 12 Jul 2014 02:28: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 s6C2SBQN029207; Sat, 12 Jul 2014 02:28:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C2SBfj029206; Sat, 12 Jul 2014 02:28:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407120228.s6C2SBfj029206@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jul 2014 02:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268552 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 02:28:12 -0000 Author: mav Date: Sat Jul 12 02:28:11 2014 New Revision: 268552 URL: http://svnweb.freebsd.org/changeset/base/268552 Log: MFC r267933: Simplify statistics calculation. Instead of trying to guess size of disk I/O operations (it just won't work that way for newly added commands, and is equal to data move size for old ones), account data move traffic. If disk I/Os are that interesting, then backends have to account and provide that information. Block backend already exports the information about disk I/Os via devstat, so having it here too is excessive. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:26:11 2014 (r268551) +++ stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:28:11 2014 (r268552) @@ -13127,132 +13127,34 @@ ctl_process_done(union ctl_io *io, int h * * XXX KDM should we also track I/O latency? */ - if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) { - uint32_t blocksize; + if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS && + io->io_hdr.io_type == CTL_IO_SCSI) { #ifdef CTL_TIME_IO struct bintime cur_bt; #endif + int type; - if ((lun->be_lun != NULL) - && (lun->be_lun->blocksize != 0)) - blocksize = lun->be_lun->blocksize; + if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == + CTL_FLAG_DATA_IN) + type = CTL_STATS_READ; + else if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == + CTL_FLAG_DATA_OUT) + type = CTL_STATS_WRITE; else - blocksize = 512; - - switch (io->io_hdr.io_type) { - case CTL_IO_SCSI: { - int isread; - struct ctl_lba_len_flags *lbalen; - - isread = 0; - switch (io->scsiio.cdb[0]) { - case READ_6: - case READ_10: - case READ_12: - case READ_16: - isread = 1; - /* FALLTHROUGH */ - case WRITE_6: - case WRITE_10: - case WRITE_12: - case WRITE_16: - case WRITE_VERIFY_10: - case WRITE_VERIFY_12: - case WRITE_VERIFY_16: - lbalen = (struct ctl_lba_len_flags *) - &io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; - - if (isread) { - lun->stats.ports[targ_port].bytes[CTL_STATS_READ] += - lbalen->len * blocksize; - lun->stats.ports[targ_port].operations[CTL_STATS_READ]++; - -#ifdef CTL_TIME_IO - bintime_add( - &lun->stats.ports[targ_port].dma_time[CTL_STATS_READ], - &io->io_hdr.dma_bt); - lun->stats.ports[targ_port].num_dmas[CTL_STATS_READ] += - io->io_hdr.num_dmas; - getbintime(&cur_bt); - bintime_sub(&cur_bt, - &io->io_hdr.start_bt); - - bintime_add( - &lun->stats.ports[targ_port].time[CTL_STATS_READ], - &cur_bt); - -#if 0 - cs_prof_gettime(&cur_ticks); - lun->stats.time[CTL_STATS_READ] += - cur_ticks - - io->io_hdr.start_ticks; -#endif -#if 0 - lun->stats.time[CTL_STATS_READ] += - jiffies - io->io_hdr.start_time; -#endif -#endif /* CTL_TIME_IO */ - } else { - lun->stats.ports[targ_port].bytes[CTL_STATS_WRITE] += - lbalen->len * blocksize; - lun->stats.ports[targ_port].operations[ - CTL_STATS_WRITE]++; - -#ifdef CTL_TIME_IO - bintime_add( - &lun->stats.ports[targ_port].dma_time[CTL_STATS_WRITE], - &io->io_hdr.dma_bt); - lun->stats.ports[targ_port].num_dmas[CTL_STATS_WRITE] += - io->io_hdr.num_dmas; - getbintime(&cur_bt); - bintime_sub(&cur_bt, - &io->io_hdr.start_bt); - - bintime_add( - &lun->stats.ports[targ_port].time[CTL_STATS_WRITE], - &cur_bt); -#if 0 - cs_prof_gettime(&cur_ticks); - lun->stats.ports[targ_port].time[CTL_STATS_WRITE] += - cur_ticks - - io->io_hdr.start_ticks; - lun->stats.ports[targ_port].time[CTL_STATS_WRITE] += - jiffies - io->io_hdr.start_time; -#endif -#endif /* CTL_TIME_IO */ - } - break; - default: - lun->stats.ports[targ_port].operations[CTL_STATS_NO_IO]++; + type = CTL_STATS_NO_IO; + lun->stats.ports[targ_port].bytes[type] += + io->scsiio.kern_total_len; + lun->stats.ports[targ_port].operations[type]++; #ifdef CTL_TIME_IO - bintime_add( - &lun->stats.ports[targ_port].dma_time[CTL_STATS_NO_IO], - &io->io_hdr.dma_bt); - lun->stats.ports[targ_port].num_dmas[CTL_STATS_NO_IO] += - io->io_hdr.num_dmas; - getbintime(&cur_bt); - bintime_sub(&cur_bt, &io->io_hdr.start_bt); - - bintime_add(&lun->stats.ports[targ_port].time[CTL_STATS_NO_IO], - &cur_bt); - -#if 0 - cs_prof_gettime(&cur_ticks); - lun->stats.ports[targ_port].time[CTL_STATS_NO_IO] += - cur_ticks - - io->io_hdr.start_ticks; - lun->stats.ports[targ_port].time[CTL_STATS_NO_IO] += - jiffies - io->io_hdr.start_time; + bintime_add(&lun->stats.ports[targ_port].dma_time[type], + &io->io_hdr.dma_bt); + lun->stats.ports[targ_port].num_dmas[type] += + io->io_hdr.num_dmas; + getbintime(&cur_bt); + bintime_sub(&cur_bt, &io->io_hdr.start_bt); + bintime_add(&lun->stats.ports[targ_port].time[type], &cur_bt); #endif -#endif /* CTL_TIME_IO */ - break; - } - break; - } - default: - break; - } } TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links); From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 02:29:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8295FD15; Sat, 12 Jul 2014 02:29: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 5645A2183; Sat, 12 Jul 2014 02:29: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 s6C2TYTa029589; Sat, 12 Jul 2014 02:29:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C2TYt0029588; Sat, 12 Jul 2014 02:29:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407120229.s6C2TYt0029588@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jul 2014 02:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268553 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 02:29:34 -0000 Author: mav Date: Sat Jul 12 02:29:33 2014 New Revision: 268553 URL: http://svnweb.freebsd.org/changeset/base/268553 Log: MFC r268204: Use separate memory type M_CTLIO for I/Os. CTL allocate large amount of RAM. This change give some more stats. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:28:11 2014 (r268552) +++ stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:29:33 2014 (r268553) @@ -460,6 +460,7 @@ static struct cdevsw ctl_cdevsw = { MALLOC_DEFINE(M_CTL, "ctlmem", "Memory used for CTL"); +MALLOC_DEFINE(M_CTLIO, "ctlio", "Memory used for CTL requests"); static int ctl_module_event_handler(module_t, int /*modeventtype_t*/, void *); @@ -3387,7 +3388,7 @@ ctl_pool_create(struct ctl_softc *ctl_so * tracking. */ for (i = 0; i < total_ctl_io; i++) { - cur_io = (union ctl_io *)malloc(sizeof(*cur_io), M_CTL, + cur_io = (union ctl_io *)malloc(sizeof(*cur_io), M_CTLIO, M_NOWAIT); if (cur_io == NULL) { retval = ENOMEM; @@ -3406,7 +3407,7 @@ ctl_pool_create(struct ctl_softc *ctl_so links); STAILQ_REMOVE(&pool->free_queue, &cur_io->io_hdr, ctl_io_hdr, links); - free(cur_io, M_CTL); + free(cur_io, M_CTLIO); } free(pool, M_CTL); @@ -3468,7 +3469,7 @@ ctl_pool_release(struct ctl_io_pool *poo while ((io = (union ctl_io *)STAILQ_FIRST(&pool->free_queue)) != NULL) { STAILQ_REMOVE(&pool->free_queue, &io->io_hdr, ctl_io_hdr, links); - free(io, M_CTL); + free(io, M_CTLIO); } STAILQ_REMOVE(&ctl_softc->io_pools, pool, ctl_io_pool, links); @@ -3572,7 +3573,7 @@ ctl_alloc_io(void *pool_ref) * The emergency pool (if it exists) didn't have one, so try an * atomic (i.e. nonblocking) malloc and see if we get lucky. */ - io = (union ctl_io *)malloc(sizeof(*io), M_CTL, M_NOWAIT); + io = (union ctl_io *)malloc(sizeof(*io), M_CTLIO, M_NOWAIT); if (io != NULL) { /* * If the emergency pool exists but is empty, add this @@ -3664,7 +3665,7 @@ ctl_free_io(union ctl_io *io) * Otherwise, just free it. We probably malloced it and * the emergency pool wasn't available. */ - free(io, M_CTL); + free(io, M_CTLIO); } } From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 02:33:04 2014 Return-Path: Delivered-To: svn-src-stable-10@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 37FAEF22; Sat, 12 Jul 2014 02:33: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 2160C220F; Sat, 12 Jul 2014 02:33: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 s6C2X42h033799; Sat, 12 Jul 2014 02:33:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C2X3Co033798; Sat, 12 Jul 2014 02:33:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407120233.s6C2X3Co033798@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jul 2014 02:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268554 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 02:33:04 -0000 Author: mav Date: Sat Jul 12 02:33:03 2014 New Revision: 268554 URL: http://svnweb.freebsd.org/changeset/base/268554 Log: MFC r268392: Do not return statuses for aborted iSCSI commands. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sat Jul 12 02:29:33 2014 (r268553) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sat Jul 12 02:33:03 2014 (r268554) @@ -2807,6 +2807,16 @@ cfiscsi_scsi_command_done(union ctl_io * CFISCSI_SESSION_UNLOCK(cs); #endif + /* + * Do not return status for aborted commands. + * There are exceptions, but none supported by CTL yet. + */ + if (io->io_hdr.status == CTL_CMD_ABORTED) { + ctl_free_io(io); + icl_pdu_free(request); + return; + } + response = cfiscsi_pdu_new_response(request, M_WAITOK); bhssr = (struct iscsi_bhs_scsi_response *)response->ip_bhs; bhssr->bhssr_opcode = ISCSI_BHS_OPCODE_SCSI_RESPONSE; From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 02:40:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DBC7C231; Sat, 12 Jul 2014 02:40: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 BBDA72246; Sat, 12 Jul 2014 02:40: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 s6C2ePcC036959; Sat, 12 Jul 2014 02:40:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C2ePA9036957; Sat, 12 Jul 2014 02:40:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407120240.s6C2ePA9036957@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jul 2014 02:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268555 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 02:40:26 -0000 Author: mav Date: Sat Jul 12 02:40:25 2014 New Revision: 268555 URL: http://svnweb.freebsd.org/changeset/base/268555 Log: MFC r268283: Improve readability of XML generated by CTL_LUN_LIST. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:33:03 2014 (r268554) +++ stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:40:25 2014 (r268555) @@ -3049,7 +3049,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (retval != 0) break; - retval = sbuf_printf(sb, "%s" + retval = sbuf_printf(sb, "\t%s" "\n", (lun->backend == NULL) ? "none" : lun->backend->name); @@ -3057,7 +3057,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (retval != 0) break; - retval = sbuf_printf(sb, "%d\n", + retval = sbuf_printf(sb, "\t%d\n", lun->be_lun->lun_type); if (retval != 0) @@ -3070,20 +3070,20 @@ ctl_ioctl(struct cdev *dev, u_long cmd, continue; } - retval = sbuf_printf(sb, "%ju\n", + retval = sbuf_printf(sb, "\t%ju\n", (lun->be_lun->maxlba > 0) ? lun->be_lun->maxlba + 1 : 0); if (retval != 0) break; - retval = sbuf_printf(sb, "%u\n", + retval = sbuf_printf(sb, "\t%u\n", lun->be_lun->blocksize); if (retval != 0) break; - retval = sbuf_printf(sb, ""); + retval = sbuf_printf(sb, "\t"); if (retval != 0) break; @@ -3099,7 +3099,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (retval != 0) break; - retval = sbuf_printf(sb, ""); + retval = sbuf_printf(sb, "\t"); if (retval != 0) break; @@ -3120,7 +3120,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } STAILQ_FOREACH(opt, &lun->be_lun->options, links) { - retval = sbuf_printf(sb, "<%s>%s", opt->name, opt->value, opt->name); + retval = sbuf_printf(sb, "\t<%s>%s\n", + opt->name, opt->value, opt->name); if (retval != 0) break; } Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Sat Jul 12 02:33:03 2014 (r268554) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Sat Jul 12 02:40:25 2014 (r268555) @@ -2511,7 +2511,7 @@ ctl_be_block_lun_info(void *be_lun, stru lun = (struct ctl_be_block_lun *)be_lun; retval = 0; - retval = sbuf_printf(sb, ""); + retval = sbuf_printf(sb, "\t"); if (retval != 0) goto bailout; @@ -2521,7 +2521,7 @@ ctl_be_block_lun_info(void *be_lun, stru if (retval != 0) goto bailout; - retval = sbuf_printf(sb, ""); + retval = sbuf_printf(sb, "\n"); bailout: From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 04:34:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1A9091C0; Sat, 12 Jul 2014 04:34: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 0699E2BFE; Sat, 12 Jul 2014 04:34: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 s6C4YdGo008786; Sat, 12 Jul 2014 04:34:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C4Ydjm008784; Sat, 12 Jul 2014 04:34:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407120434.s6C4Ydjm008784@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jul 2014 04:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268556 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 04:34:40 -0000 Author: mav Date: Sat Jul 12 04:34:39 2014 New Revision: 268556 URL: http://svnweb.freebsd.org/changeset/base/268556 Log: MFC r267643, r267873, r268391, r268398: Introduce fine-grained CTL locking to improve SMP scalability. Split global ctl_lock, historically protecting most of CTL context: - remaining ctl_lock now protects lists of fronends and backends; - per-LUN lun_lock(s) protect LUN-specific information; - per-thread queue_lock(s) protect request queues. This allows to radically reduce congestion on ctl_lock. Create multiple worker threads, depending on number of CPUs, and assign each LUN to one of them. This allows to spread load between multiple CPUs, still avoiging congestion on queues and LUNs locks. On 40-core server, exporting 5 LUNs, each backed by gstripe of SATA SSDs, accessed via 6 iSCSI connections, this change improves peak request rate from 250K to 680K IOPS. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jul 12 02:40:25 2014 (r268555) +++ stable/10/sys/cam/ctl/ctl.c Sat Jul 12 04:34:39 2014 (r268556) @@ -83,14 +83,6 @@ __FBSDID("$FreeBSD$"); struct ctl_softc *control_softc = NULL; /* - * The default is to run with CTL_DONE_THREAD turned on. Completed - * transactions are queued for processing by the CTL work thread. When - * CTL_DONE_THREAD is not defined, completed transactions are processed in - * the caller's context. - */ -#define CTL_DONE_THREAD - -/* * Use the serial number and device ID provided by the backend, rather than * making up our own. */ @@ -321,7 +313,7 @@ static int ctl_is_single = 1; static int index_to_aps_page; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); -static int worker_threads = 1; +static int worker_threads = -1; TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads); SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN, &worker_threads, 1, "Number of worker threads"); @@ -350,7 +342,7 @@ static int ctl_ioctl_targ_disable(void * static int ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id); static int ctl_ioctl_lun_disable(void *arg, struct ctl_id targ_id, int lun_id); static int ctl_ioctl_do_datamove(struct ctl_scsiio *ctsio); -static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio, int have_lock); +static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio); static int ctl_ioctl_submit_wait(union ctl_io *io); static void ctl_ioctl_datamove(union ctl_io *io); static void ctl_ioctl_done(union ctl_io *io); @@ -420,7 +412,7 @@ static int ctl_target_reset(struct ctl_s static int ctl_lun_reset(struct ctl_lun *lun, union ctl_io *io, ctl_ua_type ua_type); static int ctl_abort_task(union ctl_io *io); -static void ctl_run_task_queue(struct ctl_softc *ctl_softc); +static void ctl_run_task(union ctl_io *io); #ifdef CTL_IO_DELAY static void ctl_datamove_timer_wakeup(void *arg); static void ctl_done_timer_wakeup(void *arg); @@ -437,8 +429,13 @@ static int ctl_datamove_remote_xfer(unio ctl_ha_dt_cb callback); static void ctl_datamove_remote_read(union ctl_io *io); static void ctl_datamove_remote(union ctl_io *io); -static int ctl_process_done(union ctl_io *io, int have_lock); +static int ctl_process_done(union ctl_io *io); +static void ctl_lun_thread(void *arg); static void ctl_work_thread(void *arg); +static void ctl_enqueue_incoming(union ctl_io *io); +static void ctl_enqueue_rtr(union ctl_io *io); +static void ctl_enqueue_done(union ctl_io *io); +static void ctl_enqueue_isc(union ctl_io *io); /* * Load the serialization table. This isn't very pretty, but is probably @@ -497,8 +494,7 @@ ctl_isc_handler_finish_xfer(struct ctl_s sizeof(ctsio->sense_data)); memcpy(&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &msg_info->scsi.lbalen, sizeof(msg_info->scsi.lbalen)); - STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, &ctsio->io_hdr, links); - ctl_wakeup_thread(); + ctl_enqueue_isc((union ctl_io *)ctsio); } static void @@ -544,8 +540,7 @@ ctl_isc_handler_finish_ser_only(struct c } #endif ctsio->io_hdr.msg_type = CTL_MSG_FINISH_IO; - STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, &ctsio->io_hdr, links); - ctl_wakeup_thread(); + ctl_enqueue_isc((union ctl_io *)ctsio); } /* @@ -580,7 +575,6 @@ ctl_isc_event_handler(ctl_ha_channel cha isc_status); return; } - mtx_lock(&ctl_softc->ctl_lock); switch (msg_info.hdr.msg_type) { case CTL_MSG_SERIALIZE: @@ -593,7 +587,6 @@ ctl_isc_event_handler(ctl_ha_channel cha "ctl_io!\n"); /* Bad Juju */ /* Need to set busy and send msg back */ - mtx_unlock(&ctl_softc->ctl_lock); msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU; msg_info.hdr.status = CTL_SCSI_ERROR; msg_info.scsi.scsi_status = SCSI_STATUS_BUSY; @@ -644,9 +637,7 @@ ctl_isc_event_handler(ctl_ha_channel cha io->io_hdr.flags |= entry->flags & CTL_FLAG_DATA_MASK; } - STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, - &io->io_hdr, links); - ctl_wakeup_thread(); + ctl_enqueue_isc(io); break; /* Performed on the Originating SC, XFER mode only */ @@ -750,11 +741,8 @@ ctl_isc_event_handler(ctl_ha_channel cha * the full S/G list. Queue processing in the thread. * Otherwise wait for the next piece. */ - if (msg_info.dt.sg_last != 0) { - STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, - &io->io_hdr, links); - ctl_wakeup_thread(); - } + if (msg_info.dt.sg_last != 0) + ctl_enqueue_isc(io); break; } /* Performed on the Serializing (primary) SC, XFER mode only */ @@ -780,10 +768,7 @@ ctl_isc_event_handler(ctl_ha_channel cha io->scsiio.residual = msg_info.scsi.residual; memcpy(&io->scsiio.sense_data,&msg_info.scsi.sense_data, sizeof(io->scsiio.sense_data)); - - STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, - &io->io_hdr, links); - ctl_wakeup_thread(); + ctl_enqueue_isc(io); break; } @@ -792,7 +777,6 @@ ctl_isc_event_handler(ctl_ha_channel cha io = msg_info.hdr.original_sc; if (io == NULL) { printf("%s: Major Bummer\n", __func__); - mtx_unlock(&ctl_softc->ctl_lock); return; } else { #if 0 @@ -801,9 +785,7 @@ ctl_isc_event_handler(ctl_ha_channel cha } io->io_hdr.msg_type = CTL_MSG_R2R; io->io_hdr.serializing_sc = msg_info.hdr.serializing_sc; - STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, - &io->io_hdr, links); - ctl_wakeup_thread(); + ctl_enqueue_isc(io); break; /* @@ -840,9 +822,7 @@ ctl_isc_event_handler(ctl_ha_channel cha /* io = msg_info.hdr.serializing_sc; */ io->io_hdr.msg_type = CTL_MSG_BAD_JUJU; - STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, - &io->io_hdr, links); - ctl_wakeup_thread(); + ctl_enqueue_isc(io); break; /* Handle resets sent from the other side */ @@ -856,7 +836,6 @@ ctl_isc_event_handler(ctl_ha_channel cha /* Bad Juju */ /* should I just call the proper reset func here??? */ - mtx_unlock(&ctl_softc->ctl_lock); goto bailout; } ctl_zero_io((union ctl_io *)taskio); @@ -873,10 +852,7 @@ ctl_isc_event_handler(ctl_ha_channel cha cs_prof_gettime(&taskio->io_hdr.start_ticks); #endif #endif /* CTL_TIME_IO */ - STAILQ_INSERT_TAIL(&ctl_softc->task_queue, - &taskio->io_hdr, links); - ctl_softc->flags |= CTL_FLAG_TASK_PENDING; - ctl_wakeup_thread(); + ctl_run_task((union ctl_io *)taskio); break; } /* Persistent Reserve action which needs attention */ @@ -888,15 +864,12 @@ ctl_isc_event_handler(ctl_ha_channel cha "ctl_io!\n"); /* Bad Juju */ /* Need to set busy and send msg back */ - mtx_unlock(&ctl_softc->ctl_lock); goto bailout; } ctl_zero_io((union ctl_io *)presio); presio->io_hdr.msg_type = CTL_MSG_PERS_ACTION; presio->pr_msg = msg_info.pr; - STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, - &presio->io_hdr, links); - ctl_wakeup_thread(); + ctl_enqueue_isc((union ctl_io *)presio); break; case CTL_MSG_SYNC_FE: rcv_sync_msg = 1; @@ -909,23 +882,21 @@ ctl_isc_event_handler(ctl_ha_channel cha struct copan_aps_subpage *current_sp; uint32_t targ_lun; - targ_lun = msg_info.hdr.nexus.targ_lun; - if (msg_info.hdr.nexus.lun_map_fn != NULL) - targ_lun = msg_info.hdr.nexus.lun_map_fn(msg_info.hdr.nexus.lun_map_arg, targ_lun); - + targ_lun = msg_info.hdr.nexus.targ_mapped_lun; lun = ctl_softc->ctl_luns[targ_lun]; + mtx_lock(&lun->lun_lock); page_index = &lun->mode_pages.index[index_to_aps_page]; current_sp = (struct copan_aps_subpage *) (page_index->page_data + (page_index->page_len * CTL_PAGE_CURRENT)); current_sp->lock_active = msg_info.aps.lock_flag; + mtx_unlock(&lun->lun_lock); break; } default: printf("How did I get here?\n"); } - mtx_unlock(&ctl_softc->ctl_lock); } else if (event == CTL_HA_EVT_MSG_SENT) { if (param != CTL_HA_STATUS_SUCCESS) { printf("Bad status from ctl_ha_msg_send status %d\n", @@ -1040,20 +1011,10 @@ ctl_init(void) softc->target.wwid[1] = 0x87654321; STAILQ_INIT(&softc->lun_list); STAILQ_INIT(&softc->pending_lun_queue); - STAILQ_INIT(&softc->task_queue); - STAILQ_INIT(&softc->incoming_queue); - STAILQ_INIT(&softc->rtr_queue); - STAILQ_INIT(&softc->done_queue); - STAILQ_INIT(&softc->isc_queue); STAILQ_INIT(&softc->fe_list); STAILQ_INIT(&softc->be_list); STAILQ_INIT(&softc->io_pools); - /* - * We don't bother calling these with ctl_lock held here, because, - * in theory, no one else can try to do anything while we're in our - * module init routine. - */ if (ctl_pool_create(softc, CTL_POOL_INTERNAL, CTL_POOL_ENTRIES_INTERNAL, &internal_pool)!= 0){ printf("ctl: can't allocate %d entry internal pool, " @@ -1083,25 +1044,23 @@ ctl_init(void) softc->emergency_pool = emergency_pool; softc->othersc_pool = other_pool; - if (worker_threads > MAXCPU || worker_threads == 0) { - printf("invalid kern.cam.ctl.worker_threads value; " - "setting to 1"); - worker_threads = 1; - } else if (worker_threads < 0) { - if (mp_ncpus > 2) { - /* - * Using more than two worker threads actually hurts - * performance due to lock contention. - */ - worker_threads = 2; - } else { - worker_threads = 1; - } - } + if (worker_threads <= 0) + worker_threads = max(1, mp_ncpus / 4); + if (worker_threads > CTL_MAX_THREADS) + worker_threads = CTL_MAX_THREADS; for (i = 0; i < worker_threads; i++) { - error = kproc_kthread_add(ctl_work_thread, softc, - &softc->work_thread, NULL, 0, 0, "ctl", "work%d", i); + struct ctl_thread *thr = &softc->threads[i]; + + mtx_init(&thr->queue_lock, "CTL queue mutex", NULL, MTX_DEF); + thr->ctl_softc = softc; + STAILQ_INIT(&thr->incoming_queue); + STAILQ_INIT(&thr->rtr_queue); + STAILQ_INIT(&thr->done_queue); + STAILQ_INIT(&thr->isc_queue); + + error = kproc_kthread_add(ctl_work_thread, thr, + &softc->ctl_proc, &thr->thread, 0, 0, "ctl", "work%d", i); if (error != 0) { printf("error creating CTL work thread!\n"); ctl_pool_free(internal_pool); @@ -1110,6 +1069,15 @@ ctl_init(void) return (error); } } + error = kproc_kthread_add(ctl_lun_thread, softc, + &softc->ctl_proc, NULL, 0, 0, "ctl", "lun"); + if (error != 0) { + printf("error creating CTL lun thread!\n"); + ctl_pool_free(internal_pool); + ctl_pool_free(emergency_pool); + ctl_pool_free(other_pool); + return (error); + } if (bootverbose) printf("ctl: CAM Target Layer loaded\n"); @@ -1193,6 +1161,7 @@ ctl_shutdown(void) #if 0 ctl_shutdown_thread(softc->work_thread); + mtx_destroy(&softc->queue_lock); #endif mtx_destroy(&softc->pool_lock); @@ -1684,7 +1653,7 @@ bailout: * (SER_ONLY mode). */ static int -ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio, int have_lock) +ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) { struct ctl_softc *ctl_softc; union ctl_ha_msg msg_info; @@ -1693,12 +1662,8 @@ ctl_serialize_other_sc_cmd(struct ctl_sc uint32_t targ_lun; ctl_softc = control_softc; - if (have_lock == 0) - mtx_lock(&ctl_softc->ctl_lock); - targ_lun = ctsio->io_hdr.nexus.targ_lun; - if (ctsio->io_hdr.nexus.lun_map_fn != NULL) - targ_lun = ctsio->io_hdr.nexus.lun_map_fn(ctsio->io_hdr.nexus.lun_map_arg, targ_lun); + targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; lun = ctl_softc->ctl_luns[targ_lun]; if (lun==NULL) { @@ -1727,12 +1692,11 @@ ctl_serialize_other_sc_cmd(struct ctl_sc if (ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, sizeof(msg_info), 0 ) > CTL_HA_STATUS_SUCCESS) { } - if (have_lock == 0) - mtx_unlock(&ctl_softc->ctl_lock); return(1); } + mtx_lock(&lun->lun_lock); TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links); switch (ctl_check_ooa(lun, (union ctl_io *)ctsio, @@ -1747,8 +1711,7 @@ ctl_serialize_other_sc_cmd(struct ctl_sc case CTL_ACTION_SKIP: if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) { ctsio->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR; - STAILQ_INSERT_TAIL(&ctl_softc->rtr_queue, - &ctsio->io_hdr, links); + ctl_enqueue_rtr((union ctl_io *)ctsio); } else { /* send msg back to other side */ @@ -1843,8 +1806,7 @@ ctl_serialize_other_sc_cmd(struct ctl_sc } break; } - if (have_lock == 0) - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); return (retval); } @@ -2003,8 +1965,7 @@ ctl_ioctl_fill_ooa(struct ctl_lun *lun, retval = 0; - mtx_assert(&control_softc->ctl_lock, MA_OWNED); - + mtx_lock(&lun->lun_lock); for (io = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); (io != NULL); (*cur_fill_num)++, io = (union ctl_io *)TAILQ_NEXT(&io->io_hdr, ooa_links)) { @@ -2041,6 +2002,7 @@ ctl_ioctl_fill_ooa(struct ctl_lun *lun, if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) entry->cmd_flags |= CTL_OOACMD_FLAG_DMA_QUEUED; } + mtx_unlock(&lun->lun_lock); return (retval); } @@ -2413,6 +2375,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, mtx_lock(&softc->ctl_lock); printf("Dumping OOA queues:\n"); STAILQ_FOREACH(lun, &softc->lun_list, links) { + mtx_lock(&lun->lun_lock); for (io = (union ctl_io *)TAILQ_FIRST( &lun->ooa_queue); io != NULL; io = (union ctl_io *)TAILQ_NEXT(&io->io_hdr, @@ -2434,6 +2397,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, sbuf_finish(&sb); printf("%s\n", sbuf_data(&sb)); } + mtx_unlock(&lun->lun_lock); } printf("OOA queues dump done\n"); mtx_unlock(&softc->ctl_lock); @@ -2549,15 +2513,16 @@ ctl_ioctl(struct cdev *dev, u_long cmd, ooa_info->status = CTL_OOA_INVALID_LUN; break; } - + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); ooa_info->num_entries = 0; for (io = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); io != NULL; io = (union ctl_io *)TAILQ_NEXT( &io->io_hdr, ooa_links)) { ooa_info->num_entries++; } + mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); ooa_info->status = CTL_OOA_SUCCESS; break; @@ -2675,6 +2640,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, delay_info->status = CTL_DELAY_STATUS_INVALID_LUN; } else { lun = softc->ctl_luns[delay_info->lun_id]; + mtx_lock(&lun->lun_lock); delay_info->status = CTL_DELAY_STATUS_OK; @@ -2707,6 +2673,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, CTL_DELAY_STATUS_INVALID_LOC; break; } + mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); @@ -2767,12 +2734,13 @@ ctl_ioctl(struct cdev *dev, u_long cmd, * in the set case, hopefully the user won't do something * silly. */ + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); if (cmd == CTL_GETSYNC) sync_info->sync_interval = lun->sync_interval; else lun->sync_interval = sync_info->sync_interval; - - mtx_unlock(&softc->ctl_lock); + mtx_unlock(&lun->lun_lock); sync_info->status = CTL_GS_SYNC_OK; @@ -2833,6 +2801,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, retval = EINVAL; break; } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); /* * We could do some checking here to verify the validity @@ -2855,7 +2825,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, err_desc->serial = lun->error_serial; lun->error_serial++; - mtx_unlock(&softc->ctl_lock); + mtx_unlock(&lun->lun_lock); break; } case CTL_ERROR_INJECT_DELETE: { @@ -2875,6 +2845,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, retval = EINVAL; break; } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); STAILQ_FOREACH_SAFE(desc, &lun->error_list, links, desc2) { if (desc->serial != delete_desc->serial) continue; @@ -2884,7 +2856,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, free(desc, M_CTL); delete_done = 1; } - mtx_unlock(&softc->ctl_lock); + mtx_unlock(&lun->lun_lock); if (delete_done == 0) { printf("%s: CTL_ERROR_INJECT_DELETE: can't find " "error serial %ju on LUN %u\n", __func__, @@ -3037,8 +3009,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, sbuf_printf(sb, "\n"); mtx_lock(&softc->ctl_lock); - STAILQ_FOREACH(lun, &softc->lun_list, links) { + mtx_lock(&lun->lun_lock); retval = sbuf_printf(sb, "\n", (uintmax_t)lun->lun); @@ -3130,7 +3102,10 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (retval != 0) break; + mtx_unlock(&lun->lun_lock); } + if (lun != NULL) + mtx_unlock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); if ((retval != 0) @@ -3612,49 +3587,9 @@ ctl_free_io(union ctl_io *io) */ if (io->io_hdr.pool != NULL) { struct ctl_io_pool *pool; -#if 0 - struct ctl_softc *ctl_softc; - union ctl_io *tmp_io; - unsigned long xflags; - int i; - - ctl_softc = control_softc; -#endif pool = (struct ctl_io_pool *)io->io_hdr.pool; - mtx_lock(&pool->ctl_softc->pool_lock); -#if 0 - save_flags(xflags); - - for (i = 0, tmp_io = (union ctl_io *)STAILQ_FIRST( - &ctl_softc->task_queue); tmp_io != NULL; i++, - tmp_io = (union ctl_io *)STAILQ_NEXT(&tmp_io->io_hdr, - links)) { - if (tmp_io == io) { - printf("%s: %p is still on the task queue!\n", - __func__, tmp_io); - printf("%s: (%d): type %d " - "msg %d cdb %x iptl: " - "%d:%d:%d:%d tag 0x%04x " - "flg %#lx\n", - __func__, i, - tmp_io->io_hdr.io_type, - tmp_io->io_hdr.msg_type, - tmp_io->scsiio.cdb[0], - tmp_io->io_hdr.nexus.initid.id, - tmp_io->io_hdr.nexus.targ_port, - tmp_io->io_hdr.nexus.targ_target.id, - tmp_io->io_hdr.nexus.targ_lun, - (tmp_io->io_hdr.io_type == - CTL_IO_TASK) ? - tmp_io->taskio.tag_num : - tmp_io->scsiio.tag_num, - xflags); - panic("I/O still on the task queue!"); - } - } -#endif io->io_hdr.io_type = 0xff; STAILQ_INSERT_TAIL(&pool->free_queue, &io->io_hdr, links); pool->total_freed++; @@ -4304,6 +4239,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft } ctl_set_mask(ctl_softc->ctl_lun_mask, lun_number); + mtx_init(&lun->lun_lock, "CTL LUN", NULL, MTX_DEF); lun->target = target_id; lun->lun = lun_number; lun->be_lun = be_lun; @@ -4423,7 +4359,6 @@ ctl_free_lun(struct ctl_lun *lun) struct ctl_frontend *fe; #endif struct ctl_lun *nlun; - union ctl_io *io, *next_io; int i; softc = lun->ctl_softc; @@ -4436,49 +4371,8 @@ ctl_free_lun(struct ctl_lun *lun) softc->ctl_luns[lun->lun] = NULL; - if (TAILQ_FIRST(&lun->ooa_queue) != NULL) { - printf("ctl_free_lun: aieee!! freeing a LUN with " - "outstanding I/O!!\n"); - } - - /* - * If we have anything pending on the RtR queue, remove it. - */ - for (io = (union ctl_io *)STAILQ_FIRST(&softc->rtr_queue); io != NULL; - io = next_io) { - uint32_t targ_lun; - - next_io = (union ctl_io *)STAILQ_NEXT(&io->io_hdr, links); - targ_lun = io->io_hdr.nexus.targ_lun; - if (io->io_hdr.nexus.lun_map_fn != NULL) - targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun); - if ((io->io_hdr.nexus.targ_target.id == lun->target.id) - && (targ_lun == lun->lun)) - STAILQ_REMOVE(&softc->rtr_queue, &io->io_hdr, - ctl_io_hdr, links); - } - - /* - * Then remove everything from the blocked queue. - */ - for (io = (union ctl_io *)TAILQ_FIRST(&lun->blocked_queue); io != NULL; - io = next_io) { - next_io = (union ctl_io *)TAILQ_NEXT(&io->io_hdr,blocked_links); - TAILQ_REMOVE(&lun->blocked_queue, &io->io_hdr, blocked_links); - io->io_hdr.flags &= ~CTL_FLAG_BLOCKED; - } - - /* - * Now clear out the OOA queue, and free all the I/O. - * XXX KDM should we notify the FETD here? We probably need to - * quiesce the LUN before deleting it. - */ - for (io = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); io != NULL; - io = next_io) { - next_io = (union ctl_io *)TAILQ_NEXT(&io->io_hdr, ooa_links); - TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links); - ctl_free_io(io); - } + if (!TAILQ_EMPTY(&lun->ooa_queue)) + panic("Freeing a LUN %p with outstanding I/O!!\n", lun); softc->num_luns--; @@ -4540,6 +4434,7 @@ ctl_free_lun(struct ctl_lun *lun) atomic_subtract_int(&lun->be_lun->be->num_luns, 1); lun->be_lun->lun_shutdown(lun->be_lun->be_lun); + mtx_destroy(&lun->lun_lock); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); @@ -4568,15 +4463,12 @@ ctl_create_lun(struct ctl_be_lun *be_lun int ctl_add_lun(struct ctl_be_lun *be_lun) { - struct ctl_softc *ctl_softc; - - ctl_softc = control_softc; + struct ctl_softc *ctl_softc = control_softc; mtx_lock(&ctl_softc->ctl_lock); STAILQ_INSERT_TAIL(&ctl_softc->pending_lun_queue, be_lun, links); mtx_unlock(&ctl_softc->ctl_lock); - - ctl_wakeup_thread(); + wakeup(&ctl_softc->pending_lun_queue); return (0); } @@ -4594,15 +4486,18 @@ ctl_enable_lun(struct ctl_be_lun *be_lun lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); if ((lun->flags & CTL_LUN_DISABLED) == 0) { /* * eh? Why did we get called if the LUN is already * enabled? */ + mtx_unlock(&lun->lun_lock); mtx_unlock(&ctl_softc->ctl_lock); return (0); } lun->flags &= ~CTL_LUN_DISABLED; + mtx_unlock(&lun->lun_lock); for (fe = STAILQ_FIRST(&ctl_softc->fe_list); fe != NULL; fe = nfe) { nfe = STAILQ_NEXT(fe, links); @@ -4647,12 +4542,14 @@ ctl_disable_lun(struct ctl_be_lun *be_lu lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&ctl_softc->ctl_lock); - + mtx_lock(&lun->lun_lock); if (lun->flags & CTL_LUN_DISABLED) { + mtx_unlock(&lun->lun_lock); mtx_unlock(&ctl_softc->ctl_lock); return (0); } lun->flags |= CTL_LUN_DISABLED; + mtx_unlock(&lun->lun_lock); STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) { mtx_unlock(&ctl_softc->ctl_lock); @@ -4689,9 +4586,9 @@ ctl_start_lun(struct ctl_be_lun *be_lun) lun = (struct ctl_lun *)be_lun->ctl_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); lun->flags &= ~CTL_LUN_STOPPED; - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); return (0); } @@ -4706,9 +4603,9 @@ ctl_stop_lun(struct ctl_be_lun *be_lun) lun = (struct ctl_lun *)be_lun->ctl_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_STOPPED; - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); return (0); } @@ -4723,9 +4620,9 @@ ctl_lun_offline(struct ctl_be_lun *be_lu lun = (struct ctl_lun *)be_lun->ctl_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_OFFLINE; - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); return (0); } @@ -4740,9 +4637,9 @@ ctl_lun_online(struct ctl_be_lun *be_lun lun = (struct ctl_lun *)be_lun->ctl_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); lun->flags &= ~CTL_LUN_OFFLINE; - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); return (0); } @@ -4757,13 +4654,13 @@ ctl_invalidate_lun(struct ctl_be_lun *be lun = (struct ctl_lun *)be_lun->ctl_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); /* * The LUN needs to be disabled before it can be marked invalid. */ if ((lun->flags & CTL_LUN_DISABLED) == 0) { - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); return (-1); } /* @@ -4776,9 +4673,13 @@ ctl_invalidate_lun(struct ctl_be_lun *be * If we have something in the OOA queue, we'll free it when the * last I/O completes. */ - if (TAILQ_FIRST(&lun->ooa_queue) == NULL) + if (TAILQ_EMPTY(&lun->ooa_queue)) { + mtx_unlock(&lun->lun_lock); + mtx_lock(&ctl_softc->ctl_lock); ctl_free_lun(lun); - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&ctl_softc->ctl_lock); + } else + mtx_unlock(&lun->lun_lock); return (0); } @@ -4792,9 +4693,9 @@ ctl_lun_inoperable(struct ctl_be_lun *be ctl_softc = control_softc; lun = (struct ctl_lun *)be_lun->ctl_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_INOPERABLE; - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); return (0); } @@ -4808,9 +4709,9 @@ ctl_lun_operable(struct ctl_be_lun *be_l ctl_softc = control_softc; lun = (struct ctl_lun *)be_lun->ctl_lun; - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); lun->flags &= ~CTL_LUN_INOPERABLE; - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); return (0); } @@ -4830,6 +4731,7 @@ ctl_lun_power_lock(struct ctl_be_lun *be mtx_lock(&softc->ctl_lock); lun = (struct ctl_lun *)be_lun->ctl_lun; + mtx_lock(&lun->lun_lock); page_index = NULL; for (i = 0; i < CTL_NUM_MODE_PAGES; i++) { @@ -4843,6 +4745,7 @@ ctl_lun_power_lock(struct ctl_be_lun *be } if (page_index == NULL) { + mtx_unlock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); printf("%s: APS subpage not found for lun %ju!\n", __func__, (uintmax_t)lun->lun); @@ -4853,6 +4756,7 @@ ctl_lun_power_lock(struct ctl_be_lun *be && (softc->aps_locked_lun != lun->lun)) { printf("%s: attempt to lock LUN %llu when %llu is already " "locked\n"); + mtx_unlock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); return (1); } @@ -4889,11 +4793,13 @@ ctl_lun_power_lock(struct ctl_be_lun *be if (isc_retval > CTL_HA_STATUS_SUCCESS) { printf("%s: APS (lock=%d) error returned from " "ctl_ha_msg_send: %d\n", __func__, lock, isc_retval); + mtx_unlock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); return (1); } } + mtx_unlock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); return (0); @@ -4908,14 +4814,14 @@ ctl_lun_capacity_changed(struct ctl_be_l softc = control_softc; - mtx_lock(&softc->ctl_lock); - lun = (struct ctl_lun *)be_lun->ctl_lun; + mtx_lock(&lun->lun_lock); + for (i = 0; i < CTL_MAX_INITIATORS; i++) lun->pending_sense[i].ua_pending |= CTL_UA_CAPACITY_CHANGED; - mtx_unlock(&softc->ctl_lock); + mtx_unlock(&lun->lun_lock); } /* @@ -5156,7 +5062,7 @@ ctl_scsi_release(struct ctl_scsiio *ctsi if (length > 0) thirdparty_id = scsi_8btou64(ctsio->kern_data_ptr); - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); /* * According to SPC, it is not an error for an intiator to attempt @@ -5174,6 +5080,8 @@ ctl_scsi_release(struct ctl_scsiio *ctsi } } + mtx_unlock(&lun->lun_lock); + ctsio->scsi_status = SCSI_STATUS_OK; ctsio->io_hdr.status = CTL_SUCCESS; @@ -5182,8 +5090,6 @@ ctl_scsi_release(struct ctl_scsiio *ctsi ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED; } - mtx_unlock(&ctl_softc->ctl_lock); - ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } @@ -5291,7 +5197,7 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi if (length > 0) thirdparty_id = scsi_8btou64(ctsio->kern_data_ptr); - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); if (lun->flags & CTL_LUN_RESERVED) { if ((ctsio->io_hdr.nexus.initid.id != lun->rsv_nexus.initid.id) || (ctsio->io_hdr.nexus.targ_port != lun->rsv_nexus.targ_port) @@ -5310,13 +5216,13 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi ctsio->io_hdr.status = CTL_SUCCESS; bailout: + mtx_unlock(&lun->lun_lock); + if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { free(ctsio->kern_data_ptr, M_CTL); ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED; } - mtx_unlock(&ctl_softc->ctl_lock); - ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } @@ -5425,7 +5331,7 @@ ctl_start_stop(struct ctl_scsiio *ctsio) * Figure out a reasonable way to port this? */ #ifdef NEEDTOPORT - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); if (((cdb->byte2 & SSS_ONOFFLINE) == 0) && (lun->flags & CTL_LUN_OFFLINE)) { @@ -5433,11 +5339,11 @@ ctl_start_stop(struct ctl_scsiio *ctsio) * If the LUN is offline, and the on/offline bit isn't set, * reject the start or stop. Otherwise, let it through. */ - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); ctl_set_lun_not_ready(ctsio); ctl_done((union ctl_io *)ctsio); } else { - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); #endif /* NEEDTOPORT */ /* * This could be a start or a stop when we're online, @@ -5598,14 +5504,14 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) * Check to see whether we're configured to send the SYNCHRONIZE * CACHE command directly to the back end. */ - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); if ((ctl_softc->flags & CTL_FLAG_REAL_SYNC) && (++(lun->sync_count) >= lun->sync_interval)) { lun->sync_count = 0; - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); retval = lun->backend->config_write((union ctl_io *)ctsio); } else { - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); ctl_set_success(ctsio); ctl_done((union ctl_io *)ctsio); } @@ -5698,9 +5604,9 @@ ctl_format(struct ctl_scsiio *ctsio) * get them to issue a command that will basically make them think * they're blowing away the media. */ - mtx_lock(&ctl_softc->ctl_lock); + mtx_lock(&lun->lun_lock); lun->flags &= ~CTL_LUN_INOPERABLE; - mtx_unlock(&ctl_softc->ctl_lock); + mtx_unlock(&lun->lun_lock); ctsio->scsi_status = SCSI_STATUS_OK; ctsio->io_hdr.status = CTL_SUCCESS; @@ -6099,7 +6005,7 @@ ctl_control_page_handler(struct ctl_scsi softc = control_softc; - mtx_lock(&softc->ctl_lock); + mtx_lock(&lun->lun_lock); if (((current_cp->rlec & SCP_DSENSE) == 0) && ((user_cp->rlec & SCP_DSENSE) != 0)) { /* @@ -6195,7 +6101,7 @@ ctl_control_page_handler(struct ctl_scsi CTL_UA_MODE_CHANGE; } } - mtx_unlock(&softc->ctl_lock); + mtx_unlock(&lun->lun_lock); return (0); } @@ -7279,10 +7185,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct return(retval); } - mtx_lock(&softc->ctl_lock); single = ctl_is_single; - mtx_unlock(&softc->ctl_lock); - if (single) num_target_port_groups = NUM_TARGET_PORT_GROUPS - 1; else @@ -7416,7 +7319,7 @@ ctl_persistent_reserve_in(struct ctl_scs lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; retry: - mtx_lock(&softc->ctl_lock); + mtx_lock(&lun->lun_lock); switch (cdb->action) { case SPRI_RK: /* read keys */ total_len = sizeof(struct scsi_per_res_in_keys) + @@ -7434,7 +7337,7 @@ retry: break; case SPRI_RS: /* read full status */ default: - mtx_unlock(&softc->ctl_lock); + mtx_unlock(&lun->lun_lock); ctl_set_invalid_field(ctsio, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 05:59:20 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BA06366D; Sat, 12 Jul 2014 05:59: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 8CF4D21EB; Sat, 12 Jul 2014 05:59: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 s6C5xK6g056190; Sat, 12 Jul 2014 05:59:20 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6C5xJNP056186; Sat, 12 Jul 2014 05:59:19 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201407120559.s6C5xJNP056186@svn.freebsd.org> From: Cy Schubert Date: Sat, 12 Jul 2014 05:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268563 - stable/10/contrib/ipfilter/lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 05:59:20 -0000 Author: cy Date: Sat Jul 12 05:59:19 2014 New Revision: 268563 URL: http://svnweb.freebsd.org/changeset/base/268563 Log: MFC r268286: Fix compile-time errors when NO_WERROR and WITHOUT_INET6_SUPPORT (NO_INET6) are specified. Approved by: glebius (mentor) Modified: stable/10/contrib/ipfilter/lib/printhost.c stable/10/contrib/ipfilter/lib/printhostmask.c stable/10/contrib/ipfilter/lib/save_v1trap.c stable/10/contrib/ipfilter/lib/save_v2trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/lib/printhost.c ============================================================================== --- stable/10/contrib/ipfilter/lib/printhost.c Sat Jul 12 05:46:33 2014 (r268562) +++ stable/10/contrib/ipfilter/lib/printhost.c Sat Jul 12 05:59:19 2014 (r268563) @@ -23,9 +23,9 @@ printhost(family, addr) if ((family == -1) || !*addr) PRINTF("any"); else { +#ifdef USE_INET6 void *ptr = addr; -#ifdef USE_INET6 PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf))); #else ipa.s_addr = *addr; Modified: stable/10/contrib/ipfilter/lib/printhostmask.c ============================================================================== --- stable/10/contrib/ipfilter/lib/printhostmask.c Sat Jul 12 05:46:33 2014 (r268562) +++ stable/10/contrib/ipfilter/lib/printhostmask.c Sat Jul 12 05:59:19 2014 (r268563) @@ -25,9 +25,9 @@ printhostmask(family, addr, mask) if ((family == -1) || ((!addr || !*addr) && (!mask || !*mask))) PRINTF("any"); else { +#ifdef USE_INET6 void *ptr = addr; -#ifdef USE_INET6 PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf))); #else ipa.s_addr = *addr; Modified: stable/10/contrib/ipfilter/lib/save_v1trap.c ============================================================================== --- stable/10/contrib/ipfilter/lib/save_v1trap.c Sat Jul 12 05:46:33 2014 (r268562) +++ stable/10/contrib/ipfilter/lib/save_v1trap.c Sat Jul 12 05:59:19 2014 (r268563) @@ -178,7 +178,7 @@ snmpv1_parse(char **strings) if (ctx->fd >= 0) { ctx->sin.sin_family = AF_INET; ctx->sin.sin_port = htons(162); - if (connect(ctx->fd, &ctx->sin, + if (connect(ctx->fd, (struct sockaddr *)&ctx->sin, sizeof(ctx->sin)) != 0) { snmpv1_destroy(ctx); return NULL; Modified: stable/10/contrib/ipfilter/lib/save_v2trap.c ============================================================================== --- stable/10/contrib/ipfilter/lib/save_v2trap.c Sat Jul 12 05:46:33 2014 (r268562) +++ stable/10/contrib/ipfilter/lib/save_v2trap.c Sat Jul 12 05:59:19 2014 (r268563) @@ -181,7 +181,7 @@ snmpv2_parse(char **strings) if (ctx->fd >= 0) { ctx->sin.sin_family = AF_INET; ctx->sin.sin_port = htons(162); - if (connect(ctx->fd, &ctx->sin, + if (connect(ctx->fd, (struct sockaddr *)&ctx->sin, sizeof(ctx->sin)) != 0) { snmpv2_destroy(ctx); return NULL; From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 17:39:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 59EF82D9; Sat, 12 Jul 2014 17:39: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 2BABC24B8; Sat, 12 Jul 2014 17:39: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 s6CHdEwZ020335; Sat, 12 Jul 2014 17:39:14 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6CHdEkg020334; Sat, 12 Jul 2014 17:39:14 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407121739.s6CHdEkg020334@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 12 Jul 2014 17:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268571 - stable/10/lib/libc/locale X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 17:39:14 -0000 Author: pfg Date: Sat Jul 12 17:39:13 2014 New Revision: 268571 URL: http://svnweb.freebsd.org/changeset/base/268571 Log: MFC r268272: minor perf enhancement for UTF-8 Reduce some duplicate code. Reference: https://www.illumos.org/issues/628 Obtained from: Illumos Modified: stable/10/lib/libc/locale/utf8.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/locale/utf8.c ============================================================================== --- stable/10/lib/libc/locale/utf8.c Sat Jul 12 15:35:04 2014 (r268570) +++ stable/10/lib/libc/locale/utf8.c Sat Jul 12 17:39:13 2014 (r268571) @@ -1,4 +1,5 @@ /*- + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2002-2004 Tim J. Robbins * All rights reserved. * @@ -112,13 +113,6 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, /* Incomplete multibyte sequence */ return ((size_t)-2); - if (us->want == 0 && ((ch = (unsigned char)*s) & ~0x7f) == 0) { - /* Fast path for plain ASCII characters. */ - if (pwc != NULL) - *pwc = ch; - return (ch != '\0' ? 1 : 0); - } - if (us->want == 0) { /* * Determine the number of octets that make up this character @@ -134,10 +128,12 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, */ ch = (unsigned char)*s; if ((ch & 0x80) == 0) { - mask = 0x7f; - want = 1; - lbound = 0; - } else if ((ch & 0xe0) == 0xc0) { + /* Fast path for plain ASCII characters. */ + if (pwc != NULL) + *pwc = ch; + return (ch != '\0' ? 1 : 0); + } + if ((ch & 0xe0) == 0xc0) { mask = 0x1f; want = 2; lbound = 0x80; @@ -316,12 +312,6 @@ _UTF8_wcrtomb(char * __restrict s, wchar /* Reset to initial shift state (no-op) */ return (1); - if ((wc & ~0x7f) == 0) { - /* Fast path for plain ASCII characters. */ - *s = (char)wc; - return (1); - } - /* * Determine the number of octets needed to represent this character. * We always output the shortest sequence possible. Also specify the @@ -329,8 +319,9 @@ _UTF8_wcrtomb(char * __restrict s, wchar * about the sequence length. */ if ((wc & ~0x7f) == 0) { - lead = 0; - len = 1; + /* Fast path for plain ASCII characters. */ + *s = (char)wc; + return (1); } else if ((wc & ~0x7ff) == 0) { lead = 0xc0; len = 2; From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 18:23:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1CF40149; Sat, 12 Jul 2014 18:23: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 098572896; Sat, 12 Jul 2014 18:23: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 s6CINZG9043680; Sat, 12 Jul 2014 18:23:35 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6CINZiN043677; Sat, 12 Jul 2014 18:23:35 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407121823.s6CINZiN043677@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 12 Jul 2014 18:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268572 - in stable/10/sys/cddl/contrib/opensolaris/uts/common: dtrace sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 18:23:36 -0000 Author: pfg Date: Sat Jul 12 18:23:35 2014 New Revision: 268572 URL: http://svnweb.freebsd.org/changeset/base/268572 Log: MFC r268130, r268224, r268230, r268231: Various DTrace Merges from OpenSolaris/Illumos: 15-Sep-2008: 6735480 race between probe enabling and provider registration 20-Apr-2008: 6822482 DOF validation needs to handle loadable sections flagged as unloadable 22-Apr-2009: 6823388 DTrace ioctl handlers must validate all structure members 30-Jun-2009: 6851093 system drops to kmdb with anonymous dtrace probes + kmdb Obtained from: OpenSolaris Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Jul 12 17:39:13 2014 (r268571) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Jul 12 18:23:35 2014 (r268572) @@ -27,8 +27,6 @@ * Copyright (c) 2012 by Delphix. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * DTrace - Dynamic Tracing for Solaris * @@ -233,6 +231,7 @@ static dtrace_ecb_t *dtrace_ecb_create_c static dtrace_genid_t dtrace_probegen; /* current probe generation */ static dtrace_helpers_t *dtrace_deferred_pid; /* deferred helper list */ static dtrace_enabling_t *dtrace_retained; /* list of retained enablings */ +static dtrace_genid_t dtrace_retained_gen; /* current retained enab gen */ static dtrace_dynvar_t dtrace_dynhash_sink; /* end of dynamic hash chains */ #if !defined(sun) static struct mtx dtrace_unr_mtx; @@ -8854,7 +8853,7 @@ dtrace_difo_validate(dtrace_difo_t *dp, break; default: - err += efunc(dp->dtdo_len - 1, "bad return size"); + err += efunc(dp->dtdo_len - 1, "bad return size\n"); } } @@ -11467,6 +11466,7 @@ dtrace_enabling_destroy(dtrace_enabling_ ASSERT(enab->dten_vstate->dtvs_state != NULL); ASSERT(enab->dten_vstate->dtvs_state->dts_nretained > 0); enab->dten_vstate->dtvs_state->dts_nretained--; + dtrace_retained_gen++; } if (enab->dten_prev == NULL) { @@ -11509,6 +11509,7 @@ dtrace_enabling_retain(dtrace_enabling_t return (ENOSPC); state->dts_nretained++; + dtrace_retained_gen++; if (dtrace_retained == NULL) { dtrace_retained = enab; @@ -11751,6 +11752,7 @@ dtrace_enabling_provide(dtrace_provider_ { int i, all = 0; dtrace_probedesc_t desc; + dtrace_genid_t gen; ASSERT(MUTEX_HELD(&dtrace_lock)); ASSERT(MUTEX_HELD(&dtrace_provider_lock)); @@ -11761,15 +11763,25 @@ dtrace_enabling_provide(dtrace_provider_ } do { - dtrace_enabling_t *enab = dtrace_retained; + dtrace_enabling_t *enab; void *parg = prv->dtpv_arg; - for (; enab != NULL; enab = enab->dten_next) { +retry: + gen = dtrace_retained_gen; + for (enab = dtrace_retained; enab != NULL; + enab = enab->dten_next) { for (i = 0; i < enab->dten_ndesc; i++) { desc = enab->dten_desc[i]->dted_probe; mutex_exit(&dtrace_lock); prv->dtpv_pops.dtps_provide(parg, &desc); mutex_enter(&dtrace_lock); + /* + * Process the retained enablings again if + * they have changed while we weren't holding + * dtrace_lock. + */ + if (gen != dtrace_retained_gen) + goto retry; } } } while (all && (prv = prv->dtpv_next) != NULL); @@ -11970,7 +11982,8 @@ dtrace_dof_copyin(uintptr_t uarg, int *e dof = kmem_alloc(hdr.dofh_loadsz, KM_SLEEP); - if (copyin((void *)uarg, dof, hdr.dofh_loadsz) != 0) { + if (copyin((void *)uarg, dof, hdr.dofh_loadsz) != 0 || + dof->dofh_loadsz != hdr.dofh_loadsz) { kmem_free(dof, hdr.dofh_loadsz); *errp = EFAULT; return (NULL); @@ -12780,6 +12793,13 @@ dtrace_dof_slurp(dof_hdr_t *dof, dtrace_ } } + if (DOF_SEC_ISLOADABLE(sec->dofs_type) && + !(sec->dofs_flags & DOF_SECF_LOAD)) { + dtrace_dof_error(dof, "loadable section with load " + "flag unset"); + return (-1); + } + if (!(sec->dofs_flags & DOF_SECF_LOAD)) continue; /* just ignore non-loadable sections */ @@ -15778,7 +15798,7 @@ dtrace_open(struct cdev *dev, int oflags if (state == NULL) { #if defined(sun) - if (--dtrace_opens == 0) + if (--dtrace_opens == 0 && dtrace_anon.dta_enabling == NULL) (void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE); #else --dtrace_opens; @@ -15855,7 +15875,11 @@ dtrace_dtr(void *data) ASSERT(dtrace_opens > 0); #if defined(sun) - if (--dtrace_opens == 0) + /* + * Only relinquish control of the kernel debugger interface when there + * are no consumers and no anonymous enablings. + */ + if (--dtrace_opens == 0 && dtrace_anon.dta_enabling == NULL) (void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE); #else --dtrace_opens; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sat Jul 12 17:39:13 2014 (r268571) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sat Jul 12 18:23:35 2014 (r268572) @@ -2089,7 +2089,8 @@ fasttrap_ioctl(struct cdev *dev, u_long probe = kmem_alloc(size, KM_SLEEP); - if (copyin(uprobe, probe, size) != 0) { + if (copyin(uprobe, probe, size) != 0 || + probe->ftps_noffs != noffs) { kmem_free(probe, size); return (EFAULT); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Sat Jul 12 17:39:13 2014 (r268571) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Sat Jul 12 18:23:35 2014 (r268572) @@ -723,6 +723,20 @@ typedef struct dof_sec { #define DOF_SECF_LOAD 1 /* section should be loaded */ +#define DOF_SEC_ISLOADABLE(x) \ + (((x) == DOF_SECT_ECBDESC) || ((x) == DOF_SECT_PROBEDESC) || \ + ((x) == DOF_SECT_ACTDESC) || ((x) == DOF_SECT_DIFOHDR) || \ + ((x) == DOF_SECT_DIF) || ((x) == DOF_SECT_STRTAB) || \ + ((x) == DOF_SECT_VARTAB) || ((x) == DOF_SECT_RELTAB) || \ + ((x) == DOF_SECT_TYPTAB) || ((x) == DOF_SECT_URELHDR) || \ + ((x) == DOF_SECT_KRELHDR) || ((x) == DOF_SECT_OPTDESC) || \ + ((x) == DOF_SECT_PROVIDER) || ((x) == DOF_SECT_PROBES) || \ + ((x) == DOF_SECT_PRARGS) || ((x) == DOF_SECT_PROFFS) || \ + ((x) == DOF_SECT_INTTAB) || ((x) == DOF_SECT_XLTAB) || \ + ((x) == DOF_SECT_XLMEMBERS) || ((x) == DOF_SECT_XLIMPORT) || \ + ((x) == DOF_SECT_XLIMPORT) || ((x) == DOF_SECT_XLEXPORT) || \ + ((x) == DOF_SECT_PREXPORT) || ((x) == DOF_SECT_PRENOFFS)) + typedef struct dof_ecbdesc { dof_secidx_t dofe_probes; /* link to DOF_SECT_PROBEDESC */ dof_secidx_t dofe_pred; /* link to DOF_SECT_DIFOHDR */ From owner-svn-src-stable-10@FreeBSD.ORG Sat Jul 12 22:56:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DF03BAA9; Sat, 12 Jul 2014 22:56: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 C66AC2BCF; Sat, 12 Jul 2014 22:56:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6CMuhPG071425; Sat, 12 Jul 2014 22:56:43 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6CMugR4071412; Sat, 12 Jul 2014 22:56:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201407122256.s6CMugR4071412@svn.freebsd.org> From: Rui Paulo Date: Sat, 12 Jul 2014 22:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268578 - in stable/10: cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json cddl/contri... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 22:56:44 -0000 Author: rpaulo Date: Sat Jul 12 22:56:41 2014 New Revision: 268578 URL: http://svnweb.freebsd.org/changeset/base/268578 Log: MFC 267929, 267937, 267939, 267940, 267941, 267942, 267987, 268006: 2915 DTrace in a zone should see "cpu", "curpsinfo", et al 2916 DTrace in a zone should be able to access fds[] 2917 DTrace in a zone should have limited provider access 4477 DTrace should speak JSON Add stubs for CTF functions which are not yet implemented. 4474 DTrace Userland CTF Support 4475 DTrace userland Keyword 4476 DTrace tests should be better citizens 4479 pid provider types 4480 dof emulation is missing checks 4471 DTrace count() with histogram 4472 DTrace full width distribution histograms 4473 DTrace frequency trails Added: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out - copied unchanged from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/ - copied from r267937, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.fds.ksh - copied unchanged from r267929, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.fds.ksh stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.getf.ksh - copied unchanged from r267929, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.getf.ksh stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh - copied unchanged from r267929, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.providers.ksh - copied unchanged from r267929, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.providers.ksh stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/strtoll/ - copied from r267937, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/strtoll/ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/ - copied from r267941, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/ stable/10/cddl/contrib/opensolaris/common/util/ - copied from r267937, head/cddl/contrib/opensolaris/common/util/ Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh stable/10/cddl/contrib/opensolaris/common/ctf/ctf_open.c stable/10/cddl/contrib/opensolaris/common/ctf/ctf_types.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_as.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.h stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.h stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h stable/10/cddl/lib/libdtrace/libproc_compat.h stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/sdt_subr.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h stable/10/sys/cddl/dev/dtrace/dtrace_cddl.h stable/10/sys/modules/dtrace/dtrace/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Sat Jul 12 22:27:21 2014 (r268577) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Sat Jul 12 22:56:41 2014 (r268578) @@ -25,6 +25,7 @@ */ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -513,6 +514,7 @@ static void print_probe_info(const dtrace_probeinfo_t *p) { char buf[BUFSIZ]; + char *user; int i; oprintf("\n\tProbe Description Attributes\n"); @@ -536,10 +538,14 @@ print_probe_info(const dtrace_probeinfo_ oprintf("\n\tArgument Types\n"); for (i = 0; i < p->dtp_argc; i++) { + if (p->dtp_argv[i].dtt_flags & DTT_FL_USER) + user = "userland "; + else + user = ""; if (ctf_type_name(p->dtp_argv[i].dtt_ctfp, p->dtp_argv[i].dtt_type, buf, sizeof (buf)) == NULL) (void) strlcpy(buf, "(unknown)", sizeof (buf)); - oprintf("\t\targs[%d]: %s\n", i, buf); + oprintf("\t\targs[%d]: %s%s\n", i, user, buf); } if (p->dtp_argc == 0) Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d (from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d Sat Jul 12 22:56:41 2014 (r268578, copy of r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d) @@ -0,0 +1,32 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2013 Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet +#pragma D option encoding=utf8 +#pragma D option aggzoom + +tick-1ms +/i++ < 320/ +{ + @ = lquantize(i, 0, 640, 1, i); + @ = lquantize(641 - i, 0, 640, 1, i); +} + +tick-1ms +/i == 320/ +{ + printa(@); + exit(0); +} Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out (from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out Sat Jul 12 22:56:41 2014 (r268578, copy of r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out) @@ -0,0 +1,646 @@ + + + value ------------- Distribution ------------- count + 0 | 0 + 1 | 1 + 2 |â– 2 + 3 |â–Ž 3 + 4 |â– 4 + 5 |â–Œ 5 + 6 |â–‹ 6 + 7 |â–Š 7 + 8 |â–‰ 8 + 9 |â–ˆ 9 + 10 |█■10 + 11 |█▎ 11 + 12 |█■12 + 13 |█▌ 13 + 14 |█▋ 14 + 15 |█▊ 15 + 16 |█▉ 16 + 17 |██ 17 + 18 |██■18 + 19 |██▎ 19 + 20 |██■20 + 21 |██■21 + 22 |██▌ 22 + 23 |██▋ 23 + 24 |██▊ 24 + 25 |██▉ 25 + 26 |███ 26 + 27 |███■27 + 28 |███▎ 28 + 29 |███■29 + 30 |███▌ 30 + 31 |███▋ 31 + 32 |███▊ 32 + 33 |███▉ 33 + 34 |████ 34 + 35 |████■35 + 36 |████▎ 36 + 37 |████■37 + 38 |████▌ 38 + 39 |████▋ 39 + 40 |████▊ 40 + 41 |████▊ 41 + 42 |████▉ 42 + 43 |█████ 43 + 44 |█████■44 + 45 |█████▎ 45 + 46 |█████■46 + 47 |█████▌ 47 + 48 |█████▋ 48 + 49 |█████▊ 49 + 50 |█████▉ 50 + 51 |██████ 51 + 52 |██████■52 + 53 |██████▎ 53 + 54 |██████■54 + 55 |██████▌ 55 + 56 |██████▋ 56 + 57 |██████▊ 57 + 58 |██████▉ 58 + 59 |███████ 59 + 60 |███████■60 + 61 |███████■61 + 62 |███████▎ 62 + 63 |███████■63 + 64 |███████▌ 64 + 65 |███████▋ 65 + 66 |███████▊ 66 + 67 |███████▉ 67 + 68 |████████ 68 + 69 |████████■69 + 70 |████████▎ 70 + 71 |████████■71 + 72 |████████▌ 72 + 73 |████████▋ 73 + 74 |████████▊ 74 + 75 |████████▉ 75 + 76 |█████████ 76 + 77 |█████████■77 + 78 |█████████▎ 78 + 79 |█████████■79 + 80 |█████████▌ 80 + 81 |█████████▌ 81 + 82 |█████████▋ 82 + 83 |█████████▊ 83 + 84 |█████████▉ 84 + 85 |██████████ 85 + 86 |██████████■86 + 87 |██████████▎ 87 + 88 |██████████■88 + 89 |██████████▌ 89 + 90 |██████████▋ 90 + 91 |██████████▊ 91 + 92 |██████████▉ 92 + 93 |███████████ 93 + 94 |███████████■94 + 95 |███████████▎ 95 + 96 |███████████■96 + 97 |███████████▌ 97 + 98 |███████████▋ 98 + 99 |███████████▊ 99 + 100 |███████████▉ 100 + 101 |███████████▉ 101 + 102 |████████████ 102 + 103 |████████████■103 + 104 |████████████▎ 104 + 105 |████████████■105 + 106 |████████████▌ 106 + 107 |████████████▋ 107 + 108 |████████████▊ 108 + 109 |████████████▉ 109 + 110 |█████████████ 110 + 111 |█████████████■111 + 112 |█████████████▎ 112 + 113 |█████████████■113 + 114 |█████████████▌ 114 + 115 |█████████████▋ 115 + 116 |█████████████▊ 116 + 117 |█████████████▉ 117 + 118 |██████████████ 118 + 119 |██████████████■119 + 120 |██████████████▎ 120 + 121 |██████████████▎ 121 + 122 |██████████████■122 + 123 |██████████████▌ 123 + 124 |██████████████▋ 124 + 125 |██████████████▊ 125 + 126 |██████████████▉ 126 + 127 |███████████████ 127 + 128 |███████████████■128 + 129 |███████████████▎ 129 + 130 |███████████████■130 + 131 |███████████████▌ 131 + 132 |███████████████▋ 132 + 133 |███████████████▊ 133 + 134 |███████████████▉ 134 + 135 |████████████████ 135 + 136 |████████████████■136 + 137 |████████████████▎ 137 + 138 |████████████████■138 + 139 |████████████████▌ 139 + 140 |████████████████▋ 140 + 141 |████████████████▋ 141 + 142 |████████████████▊ 142 + 143 |████████████████▉ 143 + 144 |█████████████████ 144 + 145 |█████████████████■145 + 146 |█████████████████▎ 146 + 147 |█████████████████■147 + 148 |█████████████████▌ 148 + 149 |█████████████████▋ 149 + 150 |█████████████████▊ 150 + 151 |█████████████████▉ 151 + 152 |██████████████████ 152 + 153 |██████████████████■153 + 154 |██████████████████▎ 154 + 155 |██████████████████■155 + 156 |██████████████████▌ 156 + 157 |██████████████████▋ 157 + 158 |██████████████████▊ 158 + 159 |██████████████████▉ 159 + 160 |███████████████████ 160 + 161 |███████████████████ 161 + 162 |███████████████████■162 + 163 |███████████████████▎ 163 + 164 |███████████████████■164 + 165 |███████████████████▌ 165 + 166 |███████████████████▋ 166 + 167 |███████████████████▊ 167 + 168 |███████████████████▉ 168 + 169 |████████████████████ 169 + 170 |████████████████████■170 + 171 |████████████████████▎ 171 + 172 |████████████████████■172 + 173 |████████████████████▌ 173 + 174 |████████████████████▋ 174 + 175 |████████████████████▊ 175 + 176 |████████████████████▉ 176 + 177 |█████████████████████ 177 + 178 |█████████████████████■178 + 179 |█████████████████████▎ 179 + 180 |█████████████████████■180 + 181 |█████████████████████■181 + 182 |█████████████████████▌ 182 + 183 |█████████████████████▋ 183 + 184 |█████████████████████▊ 184 + 185 |█████████████████████▉ 185 + 186 |██████████████████████ 186 + 187 |██████████████████████■187 + 188 |██████████████████████▎ 188 + 189 |██████████████████████■189 + 190 |██████████████████████▌ 190 + 191 |██████████████████████▋ 191 + 192 |██████████████████████▊ 192 + 193 |██████████████████████▉ 193 + 194 |███████████████████████ 194 + 195 |███████████████████████■195 + 196 |███████████████████████▎ 196 + 197 |███████████████████████■197 + 198 |███████████████████████▌ 198 + 199 |███████████████████████▋ 199 + 200 |███████████████████████▊ 200 + 201 |███████████████████████▊ 201 + 202 |███████████████████████▉ 202 + 203 |████████████████████████ 203 + 204 |████████████████████████■204 + 205 |████████████████████████▎ 205 + 206 |████████████████████████■206 + 207 |████████████████████████▌ 207 + 208 |████████████████████████▋ 208 + 209 |████████████████████████▊ 209 + 210 |████████████████████████▉ 210 + 211 |█████████████████████████ 211 + 212 |█████████████████████████■212 + 213 |█████████████████████████▎ 213 + 214 |█████████████████████████■214 + 215 |█████████████████████████▌ 215 + 216 |█████████████████████████▋ 216 + 217 |█████████████████████████▊ 217 + 218 |█████████████████████████▉ 218 + 219 |██████████████████████████ 219 + 220 |██████████████████████████■220 + 221 |██████████████████████████■221 + 222 |██████████████████████████▎ 222 + 223 |██████████████████████████■223 + 224 |██████████████████████████▌ 224 + 225 |██████████████████████████▋ 225 + 226 |██████████████████████████▊ 226 + 227 |██████████████████████████▉ 227 + 228 |███████████████████████████ 228 + 229 |███████████████████████████■229 + 230 |███████████████████████████▎ 230 + 231 |███████████████████████████■231 + 232 |███████████████████████████▌ 232 + 233 |███████████████████████████▋ 233 + 234 |███████████████████████████▊ 234 + 235 |███████████████████████████▉ 235 + 236 |████████████████████████████ 236 + 237 |████████████████████████████■237 + 238 |████████████████████████████▎ 238 + 239 |████████████████████████████■239 + 240 |████████████████████████████▌ 240 + 241 |████████████████████████████▌ 241 + 242 |████████████████████████████▋ 242 + 243 |████████████████████████████▊ 243 + 244 |████████████████████████████▉ 244 + 245 |█████████████████████████████ 245 + 246 |█████████████████████████████■246 + 247 |█████████████████████████████▎ 247 + 248 |█████████████████████████████■248 + 249 |█████████████████████████████▌ 249 + 250 |█████████████████████████████▋ 250 + 251 |█████████████████████████████▊ 251 + 252 |█████████████████████████████▉ 252 + 253 |██████████████████████████████ 253 + 254 |██████████████████████████████■254 + 255 |██████████████████████████████▎ 255 + 256 |██████████████████████████████■256 + 257 |██████████████████████████████▌ 257 + 258 |██████████████████████████████▋ 258 + 259 |██████████████████████████████▊ 259 + 260 |██████████████████████████████▉ 260 + 261 |██████████████████████████████▉ 261 + 262 |███████████████████████████████ 262 + 263 |███████████████████████████████■263 + 264 |███████████████████████████████▎ 264 + 265 |███████████████████████████████■265 + 266 |███████████████████████████████▌ 266 + 267 |███████████████████████████████▋ 267 + 268 |███████████████████████████████▊ 268 + 269 |███████████████████████████████▉ 269 + 270 |████████████████████████████████ 270 + 271 |████████████████████████████████■271 + 272 |████████████████████████████████▎ 272 + 273 |████████████████████████████████■273 + 274 |████████████████████████████████▌ 274 + 275 |████████████████████████████████▋ 275 + 276 |████████████████████████████████▊ 276 + 277 |████████████████████████████████▉ 277 + 278 |█████████████████████████████████ 278 + 279 |█████████████████████████████████■279 + 280 |█████████████████████████████████▎ 280 + 281 |█████████████████████████████████▎ 281 + 282 |█████████████████████████████████■282 + 283 |█████████████████████████████████▌ 283 + 284 |█████████████████████████████████▋ 284 + 285 |█████████████████████████████████▊ 285 + 286 |█████████████████████████████████▉ 286 + 287 |██████████████████████████████████ 287 + 288 |██████████████████████████████████■288 + 289 |██████████████████████████████████▎ 289 + 290 |██████████████████████████████████■290 + 291 |██████████████████████████████████▌ 291 + 292 |██████████████████████████████████▋ 292 + 293 |██████████████████████████████████▊ 293 + 294 |██████████████████████████████████▉ 294 + 295 |███████████████████████████████████ 295 + 296 |███████████████████████████████████■296 + 297 |███████████████████████████████████▎ 297 + 298 |███████████████████████████████████■298 + 299 |███████████████████████████████████▌ 299 + 300 |███████████████████████████████████▋ 300 + 301 |███████████████████████████████████▋ 301 + 302 |███████████████████████████████████▊ 302 + 303 |███████████████████████████████████▉ 303 + 304 |████████████████████████████████████ 304 + 305 |████████████████████████████████████■305 + 306 |████████████████████████████████████▎ 306 + 307 |████████████████████████████████████■307 + 308 |████████████████████████████████████▌ 308 + 309 |████████████████████████████████████▋ 309 + 310 |████████████████████████████████████▊ 310 + 311 |████████████████████████████████████▉ 311 + 312 |█████████████████████████████████████ 312 + 313 |█████████████████████████████████████■313 + 314 |█████████████████████████████████████▎ 314 + 315 |█████████████████████████████████████■315 + 316 |█████████████████████████████████████▌ 316 + 317 |█████████████████████████████████████▋ 317 + 318 |█████████████████████████████████████▊ 318 + 319 |█████████████████████████████████████▉ 319 + 320 |██████████████████████████████████████ 320 + 321 |██████████████████████████████████████ 320 + 322 |█████████████████████████████████████▉ 319 + 323 |█████████████████████████████████████▊ 318 + 324 |█████████████████████████████████████▋ 317 + 325 |█████████████████████████████████████▌ 316 + 326 |█████████████████████████████████████■315 + 327 |█████████████████████████████████████▎ 314 + 328 |█████████████████████████████████████■313 + 329 |█████████████████████████████████████ 312 + 330 |████████████████████████████████████▉ 311 + 331 |████████████████████████████████████▊ 310 + 332 |████████████████████████████████████▋ 309 + 333 |████████████████████████████████████▌ 308 + 334 |████████████████████████████████████■307 + 335 |████████████████████████████████████▎ 306 + 336 |████████████████████████████████████■305 + 337 |████████████████████████████████████ 304 + 338 |███████████████████████████████████▉ 303 + 339 |███████████████████████████████████▊ 302 + 340 |███████████████████████████████████▋ 301 + 341 |███████████████████████████████████▋ 300 + 342 |███████████████████████████████████▌ 299 + 343 |███████████████████████████████████■298 + 344 |███████████████████████████████████▎ 297 + 345 |███████████████████████████████████■296 + 346 |███████████████████████████████████ 295 + 347 |██████████████████████████████████▉ 294 + 348 |██████████████████████████████████▊ 293 + 349 |██████████████████████████████████▋ 292 + 350 |██████████████████████████████████▌ 291 + 351 |██████████████████████████████████■290 + 352 |██████████████████████████████████▎ 289 + 353 |██████████████████████████████████■288 + 354 |██████████████████████████████████ 287 + 355 |█████████████████████████████████▉ 286 + 356 |█████████████████████████████████▊ 285 + 357 |█████████████████████████████████▋ 284 + 358 |█████████████████████████████████▌ 283 + 359 |█████████████████████████████████■282 + 360 |█████████████████████████████████▎ 281 + 361 |█████████████████████████████████▎ 280 + 362 |█████████████████████████████████■279 + 363 |█████████████████████████████████ 278 + 364 |████████████████████████████████▉ 277 + 365 |████████████████████████████████▊ 276 + 366 |████████████████████████████████▋ 275 + 367 |████████████████████████████████▌ 274 + 368 |████████████████████████████████■273 + 369 |████████████████████████████████▎ 272 + 370 |████████████████████████████████■271 + 371 |████████████████████████████████ 270 + 372 |███████████████████████████████▉ 269 + 373 |███████████████████████████████▊ 268 + 374 |███████████████████████████████▋ 267 + 375 |███████████████████████████████▌ 266 + 376 |███████████████████████████████■265 + 377 |███████████████████████████████▎ 264 + 378 |███████████████████████████████■263 + 379 |███████████████████████████████ 262 + 380 |██████████████████████████████▉ 261 + 381 |██████████████████████████████▉ 260 + 382 |██████████████████████████████▊ 259 + 383 |██████████████████████████████▋ 258 + 384 |██████████████████████████████▌ 257 + 385 |██████████████████████████████■256 + 386 |██████████████████████████████▎ 255 + 387 |██████████████████████████████■254 + 388 |██████████████████████████████ 253 + 389 |█████████████████████████████▉ 252 + 390 |█████████████████████████████▊ 251 + 391 |█████████████████████████████▋ 250 + 392 |█████████████████████████████▌ 249 + 393 |█████████████████████████████■248 + 394 |█████████████████████████████▎ 247 + 395 |█████████████████████████████■246 + 396 |█████████████████████████████ 245 + 397 |████████████████████████████▉ 244 + 398 |████████████████████████████▊ 243 + 399 |████████████████████████████▋ 242 + 400 |████████████████████████████▌ 241 + 401 |████████████████████████████▌ 240 + 402 |████████████████████████████■239 + 403 |████████████████████████████▎ 238 + 404 |████████████████████████████■237 + 405 |████████████████████████████ 236 + 406 |███████████████████████████▉ 235 + 407 |███████████████████████████▊ 234 + 408 |███████████████████████████▋ 233 + 409 |███████████████████████████▌ 232 + 410 |███████████████████████████■231 + 411 |███████████████████████████▎ 230 + 412 |███████████████████████████■229 + 413 |███████████████████████████ 228 + 414 |██████████████████████████▉ 227 + 415 |██████████████████████████▊ 226 + 416 |██████████████████████████▋ 225 + 417 |██████████████████████████▌ 224 + 418 |██████████████████████████■223 + 419 |██████████████████████████▎ 222 + 420 |██████████████████████████■221 + 421 |██████████████████████████■220 + 422 |██████████████████████████ 219 + 423 |█████████████████████████▉ 218 + 424 |█████████████████████████▊ 217 + 425 |█████████████████████████▋ 216 + 426 |█████████████████████████▌ 215 + 427 |█████████████████████████■214 + 428 |█████████████████████████▎ 213 + 429 |█████████████████████████■212 + 430 |█████████████████████████ 211 + 431 |████████████████████████▉ 210 + 432 |████████████████████████▊ 209 + 433 |████████████████████████▋ 208 + 434 |████████████████████████▌ 207 + 435 |████████████████████████■206 + 436 |████████████████████████▎ 205 + 437 |████████████████████████■204 + 438 |████████████████████████ 203 + 439 |███████████████████████▉ 202 + 440 |███████████████████████▊ 201 + 441 |███████████████████████▊ 200 + 442 |███████████████████████▋ 199 + 443 |███████████████████████▌ 198 + 444 |███████████████████████■197 + 445 |███████████████████████▎ 196 + 446 |███████████████████████■195 + 447 |███████████████████████ 194 + 448 |██████████████████████▉ 193 + 449 |██████████████████████▊ 192 + 450 |██████████████████████▋ 191 + 451 |██████████████████████▌ 190 + 452 |██████████████████████■189 + 453 |██████████████████████▎ 188 + 454 |██████████████████████■187 + 455 |██████████████████████ 186 + 456 |█████████████████████▉ 185 + 457 |█████████████████████▊ 184 + 458 |█████████████████████▋ 183 + 459 |█████████████████████▌ 182 + 460 |█████████████████████■181 + 461 |█████████████████████■180 + 462 |█████████████████████▎ 179 + 463 |█████████████████████■178 + 464 |█████████████████████ 177 + 465 |████████████████████▉ 176 + 466 |████████████████████▊ 175 + 467 |████████████████████▋ 174 + 468 |████████████████████▌ 173 + 469 |████████████████████■172 + 470 |████████████████████▎ 171 + 471 |████████████████████■170 + 472 |████████████████████ 169 + 473 |███████████████████▉ 168 + 474 |███████████████████▊ 167 + 475 |███████████████████▋ 166 + 476 |███████████████████▌ 165 + 477 |███████████████████■164 + 478 |███████████████████▎ 163 + 479 |███████████████████■162 + 480 |███████████████████ 161 + 481 |███████████████████ 160 + 482 |██████████████████▉ 159 + 483 |██████████████████▊ 158 + 484 |██████████████████▋ 157 + 485 |██████████████████▌ 156 + 486 |██████████████████■155 + 487 |██████████████████▎ 154 + 488 |██████████████████■153 + 489 |██████████████████ 152 + 490 |█████████████████▉ 151 + 491 |█████████████████▊ 150 + 492 |█████████████████▋ 149 + 493 |█████████████████▌ 148 + 494 |█████████████████■147 + 495 |█████████████████▎ 146 + 496 |█████████████████■145 + 497 |█████████████████ 144 + 498 |████████████████▉ 143 + 499 |████████████████▊ 142 + 500 |████████████████▋ 141 + 501 |████████████████▋ 140 + 502 |████████████████▌ 139 + 503 |████████████████■138 + 504 |████████████████▎ 137 + 505 |████████████████■136 + 506 |████████████████ 135 + 507 |███████████████▉ 134 + 508 |███████████████▊ 133 + 509 |███████████████▋ 132 + 510 |███████████████▌ 131 + 511 |███████████████■130 + 512 |███████████████▎ 129 + 513 |███████████████■128 + 514 |███████████████ 127 + 515 |██████████████▉ 126 + 516 |██████████████▊ 125 + 517 |██████████████▋ 124 + 518 |██████████████▌ 123 + 519 |██████████████■122 + 520 |██████████████▎ 121 + 521 |██████████████▎ 120 + 522 |██████████████■119 + 523 |██████████████ 118 + 524 |█████████████▉ 117 + 525 |█████████████▊ 116 + 526 |█████████████▋ 115 + 527 |█████████████▌ 114 + 528 |█████████████■113 + 529 |█████████████▎ 112 + 530 |█████████████■111 + 531 |█████████████ 110 + 532 |████████████▉ 109 + 533 |████████████▊ 108 + 534 |████████████▋ 107 + 535 |████████████▌ 106 + 536 |████████████■105 + 537 |████████████▎ 104 + 538 |████████████■103 + 539 |████████████ 102 + 540 |███████████▉ 101 + 541 |███████████▉ 100 + 542 |███████████▊ 99 + 543 |███████████▋ 98 + 544 |███████████▌ 97 + 545 |███████████■96 + 546 |███████████▎ 95 + 547 |███████████■94 + 548 |███████████ 93 + 549 |██████████▉ 92 + 550 |██████████▊ 91 + 551 |██████████▋ 90 + 552 |██████████▌ 89 + 553 |██████████■88 + 554 |██████████▎ 87 + 555 |██████████■86 + 556 |██████████ 85 + 557 |█████████▉ 84 + 558 |█████████▊ 83 + 559 |█████████▋ 82 + 560 |█████████▌ 81 + 561 |█████████▌ 80 + 562 |█████████■79 + 563 |█████████▎ 78 + 564 |█████████■77 + 565 |█████████ 76 + 566 |████████▉ 75 + 567 |████████▊ 74 + 568 |████████▋ 73 + 569 |████████▌ 72 + 570 |████████■71 + 571 |████████▎ 70 + 572 |████████■69 + 573 |████████ 68 + 574 |███████▉ 67 + 575 |███████▊ 66 + 576 |███████▋ 65 + 577 |███████▌ 64 + 578 |███████■63 + 579 |███████▎ 62 + 580 |███████■61 + 581 |███████■60 + 582 |███████ 59 + 583 |██████▉ 58 + 584 |██████▊ 57 + 585 |██████▋ 56 + 586 |██████▌ 55 + 587 |██████■54 + 588 |██████▎ 53 + 589 |██████■52 + 590 |██████ 51 + 591 |█████▉ 50 + 592 |█████▊ 49 + 593 |█████▋ 48 + 594 |█████▌ 47 + 595 |█████■46 + 596 |█████▎ 45 + 597 |█████■44 + 598 |█████ 43 + 599 |████▉ 42 + 600 |████▊ 41 + 601 |████▊ 40 + 602 |████▋ 39 + 603 |████▌ 38 + 604 |████■37 + 605 |████▎ 36 + 606 |████■35 + 607 |████ 34 + 608 |███▉ 33 + 609 |███▊ 32 + 610 |███▋ 31 + 611 |███▌ 30 + 612 |███■29 + 613 |███▎ 28 + 614 |███■27 + 615 |███ 26 + 616 |██▉ 25 + 617 |██▊ 24 + 618 |██▋ 23 + 619 |██▌ 22 + 620 |██■21 + 621 |██■20 + 622 |██▎ 19 + 623 |██■18 + 624 |██ 17 + 625 |█▉ 16 + 626 |█▊ 15 + 627 |█▋ 14 + 628 |█▌ 13 + 629 |█■12 + 630 |█▎ 11 + 631 |█■10 + 632 |â–ˆ 9 + 633 |â–‰ 8 + 634 |â–Š 7 + 635 |â–‹ 6 + 636 |â–Œ 5 + 637 |â– 4 + 638 |â–Ž 3 + 639 |â– 2 + >= 640 | 1 + + Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d (from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d Sat Jul 12 22:56:41 2014 (r268578, copy of r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d) @@ -0,0 +1,46 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2013 Joyent, Inc. All rights reserved. + */ + +#pragma D option agghist +#pragma D option quiet + +BEGIN +{ + @["demerit"] = sum(-10); + @["wtf"] = sum(10); + @["bot"] = sum(20); + + @bagnoogle["SOAP/XML"] = sum(1); + @bagnoogle["XACML store"] = sum(5); + @bagnoogle["SAML token"] = sum(6); + + @stalloogle["breakfast"] = sum(-5); + @stalloogle["non-diet pepsi"] = sum(-20); + @stalloogle["parrot"] = sum(-100); + + printa(@); + printa(@bagnoogle); + printa(@stalloogle); + + printf("\nzoomed:"); + + setopt("aggzoom"); + printa(@); + printa(@bagnoogle); + printa(@stalloogle); + + exit(0); +} + Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out (from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out Sat Jul 12 22:56:41 2014 (r268578, copy of r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out) @@ -0,0 +1,38 @@ + + + key ------------- Distribution ------------- count + demerit @@@@@| -10 + wtf |@@@@@ 10 + bot |@@@@@@@@@@ 20 + + + key ------------- Distribution ------------- count + SOAP/XML |@@@ 1 + XACML store |@@@@@@@@@@@@@@@@@ 5 + SAML token |@@@@@@@@@@@@@@@@@@@@ 6 + + + key ------------- Distribution ------------- count + parrot @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100 + non-diet pepsi @@@@@@| -20 + breakfast @@| -5 + +zoomed: + + key ------------- Distribution ------------- count + demerit @@@@@@@@@@| -10 + wtf |@@@@@@@@@@ 10 + bot |@@@@@@@@@@@@@@@@@@@ 20 + + + key ------------- Distribution ------------- count + SOAP/XML |@@@@@@@ 1 + XACML store |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5 + SAML token |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6 + + + key ------------- Distribution ------------- count + parrot @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100 + non-diet pepsi @@@@@@@@| -20 + breakfast @@| -5 + Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d (from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d Sat Jul 12 22:56:41 2014 (r268578, copy of r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d) @@ -0,0 +1,53 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2013 Joyent, Inc. All rights reserved. + */ + +#pragma D option aggpack +#pragma D option encoding=ascii +#pragma D option quiet + +BEGIN +{ + @x = quantize(1 << 32); + @y[1] = quantize(1); + @z["mumble"] = quantize(1); + @xx["foo", (char)1, (short)2, (long)3] = quantize(1); + + @neg = lquantize(-10, -10, 20, 1, -1); + @neg = lquantize(-5, -10, 20, 1, 1); + @neg = lquantize(0, -10, 20, 1, 1); + + i = 0; +} + +tick-1ms +{ + @a[i] = quantize(0, i); + @a[i] = quantize(1, 100 - i); + i++; +} + +tick-1ms +/i > 100/ +{ + exit(0); +} + +END +{ + setopt("aggzoom", "true"); + printa(@neg); + setopt("aggzoom", "false"); + printa(@neg); +} Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out (from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out Sat Jul 12 22:56:41 2014 (r268578, copy of r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out) @@ -0,0 +1,124 @@ + + + min .--------------------------------. max | count + < -10 : V X X : >= 20 | 1 + + + min .--------------------------------. max | count + < -10 : v x x : >= 20 | 1 + + + min .---. max | count + 2147483648 : X : 8589934592 | 1 + + key min .---. max | count + 1 0 : X : 2 | 1 + + key min .---. max | count + mumble 0 : X : 2 | 1 + + key min .---. max | count + foo 1 2 3 0 : X : 2 | 1 + + key min .---. max | count + 100 0 :X : 2 | 100 + 99 0 :X_ : 2 | 100 + 98 0 :X_ : 2 | 100 + 97 0 :X_ : 2 | 100 + 96 0 :X_ : 2 | 100 + 95 0 :X_ : 2 | 100 + 94 0 :X_ : 2 | 100 + 93 0 :X_ : 2 | 100 + 92 0 :X_ : 2 | 100 + 91 0 :X_ : 2 | 100 + 90 0 :X_ : 2 | 100 + 89 0 :X_ : 2 | 100 + 88 0 :X_ : 2 | 100 + 87 0 :X_ : 2 | 100 + 86 0 :X_ : 2 | 100 + 85 0 :X_ : 2 | 100 + 84 0 :X_ : 2 | 100 + 83 0 :X_ : 2 | 100 + 82 0 :X_ : 2 | 100 + 81 0 :X_ : 2 | 100 + 80 0 :X_ : 2 | 100 + 79 0 :X_ : 2 | 100 + 78 0 :xx : 2 | 100 + 77 0 :xx : 2 | 100 + 76 0 :xx : 2 | 100 + 75 0 :xx : 2 | 100 + 74 0 :xx : 2 | 100 + 73 0 :xx : 2 | 100 + 72 0 :xx : 2 | 100 + 71 0 :xx : 2 | 100 + 70 0 :xx : 2 | 100 + 69 0 :xx : 2 | 100 + 68 0 :xx : 2 | 100 + 67 0 :xx : 2 | 100 + 66 0 :xx : 2 | 100 + 65 0 :xx : 2 | 100 + 64 0 :xx : 2 | 100 + 63 0 :xx : 2 | 100 + 62 0 :xx : 2 | 100 + 61 0 :xx : 2 | 100 + 60 0 :xx : 2 | 100 + 59 0 :xx : 2 | 100 + 58 0 :xx : 2 | 100 + 57 0 :xx : 2 | 100 + 56 0 :xx : 2 | 100 + 55 0 :xx : 2 | 100 + 54 0 :xx : 2 | 100 + 53 0 :xx : 2 | 100 + 52 0 :xx : 2 | 100 + 51 0 :xx : 2 | 100 + 50 0 :xx : 2 | 100 + 49 0 :xx : 2 | 100 + 48 0 :xx : 2 | 100 + 47 0 :xx : 2 | 100 + 46 0 :xx : 2 | 100 + 45 0 :xx : 2 | 100 + 44 0 :xx : 2 | 100 + 43 0 :xx : 2 | 100 + 42 0 :xx : 2 | 100 + 41 0 :xx : 2 | 100 + 40 0 :xx : 2 | 100 + 39 0 :xx : 2 | 100 + 38 0 :xx : 2 | 100 + 37 0 :xx : 2 | 100 + 36 0 :xx : 2 | 100 + 35 0 :xx : 2 | 100 + 34 0 :xx : 2 | 100 + 33 0 :xx : 2 | 100 + 32 0 :xx : 2 | 100 + 31 0 :xx : 2 | 100 + 30 0 :xx : 2 | 100 + 29 0 :xx : 2 | 100 + 28 0 :xx : 2 | 100 + 27 0 :xx : 2 | 100 + 26 0 :xx : 2 | 100 + 25 0 :xx : 2 | 100 + 24 0 :xx : 2 | 100 + 23 0 :xx : 2 | 100 + 22 0 :xx : 2 | 100 + 21 0 :_X : 2 | 100 + 20 0 :_X : 2 | 100 + 19 0 :_X : 2 | 100 + 18 0 :_X : 2 | 100 + 17 0 :_X : 2 | 100 + 16 0 :_X : 2 | 100 + 15 0 :_X : 2 | 100 + 14 0 :_X : 2 | 100 + 13 0 :_X : 2 | 100 + 12 0 :_X : 2 | 100 + 11 0 :_X : 2 | 100 + 10 0 :_X : 2 | 100 + 9 0 :_X : 2 | 100 + 8 0 :_X : 2 | 100 + 7 0 :_X : 2 | 100 + 6 0 :_X : 2 | 100 + 5 0 :_X : 2 | 100 + 4 0 :_X : 2 | 100 + 3 0 :_X : 2 | 100 + 2 0 :_X : 2 | 100 + 1 0 :_X : 2 | 100 + 0 0 : X : 2 | 100 Copied: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh (from r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh Sat Jul 12 22:56:41 2014 (r268578, copy of r267942, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh) @@ -0,0 +1,75 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 13 00:19:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0B2F6433; Sun, 13 Jul 2014 00:19: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 D248D20EA; Sun, 13 Jul 2014 00:19: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 s6D0JdG4011076; Sun, 13 Jul 2014 00:19:39 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6D0JdbU011075; Sun, 13 Jul 2014 00:19:39 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201407130019.s6D0JdbU011075@svn.freebsd.org> From: Rick Macklem Date: Sun, 13 Jul 2014 00:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268580 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2014 00:19:40 -0000 Author: rmacklem Date: Sun Jul 13 00:19:39 2014 New Revision: 268580 URL: http://svnweb.freebsd.org/changeset/base/268580 Log: MFC: r268008 There might be a potential race condition for the NFSv4 client when a newly created file has another open done on it that update the open mode. This patch moves the code that updates the open mode up into the block where the mutex is held to ensure this cannot happen. No bug caused by this potential race has been observed, but this fix is a safety belt to ensure it cannot happen. Modified: stable/10/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clstate.c Sat Jul 12 23:27:38 2014 (r268579) +++ stable/10/sys/fs/nfsclient/nfs_clstate.c Sun Jul 13 00:19:39 2014 (r268580) @@ -281,6 +281,23 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i newonep); /* + * Now, check the mode on the open and return the appropriate + * value. + */ + if (retp != NULL) { + if (nfhp != NULL && dp != NULL && nop == NULL) + /* new local open on delegation */ + *retp = NFSCLOPEN_SETCRED; + else + *retp = NFSCLOPEN_OK; + } + if (op != NULL && (amode & ~(op->nfso_mode))) { + op->nfso_mode |= amode; + if (retp != NULL && dp == NULL) + *retp = NFSCLOPEN_DOOPEN; + } + + /* * Serialize modifications to the open owner for multiple threads * within the same process using a read/write sleep lock. */ @@ -295,23 +312,6 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i *owpp = owp; if (opp != NULL) *opp = op; - if (retp != NULL) { - if (nfhp != NULL && dp != NULL && nop == NULL) - /* new local open on delegation */ - *retp = NFSCLOPEN_SETCRED; - else - *retp = NFSCLOPEN_OK; - } - - /* - * Now, check the mode on the open and return the appropriate - * value. - */ - if (op != NULL && (amode & ~(op->nfso_mode))) { - op->nfso_mode |= amode; - if (retp != NULL && dp == NULL) - *retp = NFSCLOPEN_DOOPEN; - } return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 13 15:13:25 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BC1DBE4A; Sun, 13 Jul 2014 15:13: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 A95502E47; Sun, 13 Jul 2014 15:13: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 s6DFDP72025627; Sun, 13 Jul 2014 15:13:25 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6DFDPkb025626; Sun, 13 Jul 2014 15:13:25 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201407131513.s6DFDPkb025626@svn.freebsd.org> From: Kevin Lo Date: Sun, 13 Jul 2014 15:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268586 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2014 15:13:25 -0000 Author: kevlo Date: Sun Jul 13 15:13:25 2014 New Revision: 268586 URL: http://svnweb.freebsd.org/changeset/base/268586 Log: MFC r268487: Enable 8051 before downloading firmware. Tested by: Carlos Jacobo Puga Medina chip & URTWN_CHIP_88E)) { + urtwn_write_2(sc, R92C_SYS_FUNC_EN, + urtwn_read_2(sc, R92C_SYS_FUNC_EN) | + R92C_SYS_FUNC_EN_CPUEN); + } urtwn_write_1(sc, R92C_MCUFWDL, urtwn_read_1(sc, R92C_MCUFWDL) | R92C_MCUFWDL_EN); urtwn_write_1(sc, R92C_MCUFWDL + 2, From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 13 17:49:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3FB1CA17; Sun, 13 Jul 2014 17:49: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 2C31C2A43; Sun, 13 Jul 2014 17:49: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 s6DHnSJS099035; Sun, 13 Jul 2014 17:49:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6DHnSFW099033; Sun, 13 Jul 2014 17:49:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407131749.s6DHnSFW099033@svn.freebsd.org> From: John Baldwin Date: Sun, 13 Jul 2014 17:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268594 - stable/10/share/examples/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2014 17:49:28 -0000 Author: jhb Date: Sun Jul 13 17:49:27 2014 New Revision: 268594 URL: http://svnweb.freebsd.org/changeset/base/268594 Log: MFC 267963: The latest versoin of file/libmagic identifes a filesystem image is identified as "DOS/MBR boot sector" as opposed to "x86 boot sector". This trips up vmrun.sh when using the new file(1) and makes it want to boot into the installer instead. Fix this by just looking for "boot sector" instead. Modified: stable/10/share/examples/bhyve/vmrun.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/bhyve/vmrun.sh ============================================================================== --- stable/10/share/examples/bhyve/vmrun.sh Sun Jul 13 17:05:03 2014 (r268593) +++ stable/10/share/examples/bhyve/vmrun.sh Sun Jul 13 17:49:27 2014 (r268594) @@ -138,7 +138,7 @@ echo "Launching virtual machine \"$vmnam while [ 1 ]; do ${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1 - file ${virtio_diskdev} | grep ": x86 boot sector" > /dev/null + file ${virtio_diskdev} | grep "boot sector" > /dev/null rc=$? if [ $rc -ne 0 ]; then file ${virtio_diskdev} | grep ": Unix Fast File sys" > /dev/null From owner-svn-src-stable-10@FreeBSD.ORG Sun Jul 13 17:50:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0DC21D1E; Sun, 13 Jul 2014 17:50: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 E26DC2A5C; Sun, 13 Jul 2014 17:50: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 s6DHoopB000360; Sun, 13 Jul 2014 17:50:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6DHooMR000359; Sun, 13 Jul 2014 17:50:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407131750.s6DHooMR000359@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 13 Jul 2014 17:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268595 - stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2014 17:50:51 -0000 Author: pfg Date: Sun Jul 13 17:50:50 2014 New Revision: 268595 URL: http://svnweb.freebsd.org/changeset/base/268595 Log: MFC r268290: Merge from OpenSolaris (24-Jul-2010): 6679140 asymmetric alloc/dealloc activity can induce dynamic variable drops 6679193 dtrace_dynvar walker produces flood of dtrace_dynhash_sink This finishes a set of merges from the older OpenSolaris releases. Still the FreeBSD port has many differences that are difficult to account for but that seems normal given that the kernels are different. Obtained from: OpenSolaris (through Illumos) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Jul 13 17:49:27 2014 (r268594) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Jul 13 17:50:50 2014 (r268595) @@ -22,7 +22,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -235,6 +235,7 @@ static dtrace_helpers_t *dtrace_deferred static dtrace_enabling_t *dtrace_retained; /* list of retained enablings */ static dtrace_genid_t dtrace_retained_gen; /* current retained enab gen */ static dtrace_dynvar_t dtrace_dynhash_sink; /* end of dynamic hash chains */ +static int dtrace_dynvar_failclean; /* dynvars failed to clean */ #if !defined(sun) static struct mtx dtrace_unr_mtx; MTX_SYSINIT(dtrace_unr_mtx, &dtrace_unr_mtx, "Unique resource identifier", MTX_DEF); @@ -1555,12 +1556,12 @@ dtrace_dynvar_clean(dtrace_dstate_t *dst { dtrace_dynvar_t *dirty; dtrace_dstate_percpu_t *dcpu; - int i, work = 0; + dtrace_dynvar_t **rinsep; + int i, j, work = 0; for (i = 0; i < NCPU; i++) { dcpu = &dstate->dtds_percpu[i]; - - ASSERT(dcpu->dtdsc_rinsing == NULL); + rinsep = &dcpu->dtdsc_rinsing; /* * If the dirty list is NULL, there is no dirty work to do. @@ -1568,14 +1569,62 @@ dtrace_dynvar_clean(dtrace_dstate_t *dst if (dcpu->dtdsc_dirty == NULL) continue; - /* - * If the clean list is non-NULL, then we're not going to do - * any work for this CPU -- it means that there has not been - * a dtrace_dynvar() allocation on this CPU (or from this CPU) - * since the last time we cleaned house. - */ - if (dcpu->dtdsc_clean != NULL) + if (dcpu->dtdsc_rinsing != NULL) { + /* + * If the rinsing list is non-NULL, then it is because + * this CPU was selected to accept another CPU's + * dirty list -- and since that time, dirty buffers + * have accumulated. This is a highly unlikely + * condition, but we choose to ignore the dirty + * buffers -- they'll be picked up a future cleanse. + */ continue; + } + + if (dcpu->dtdsc_clean != NULL) { + /* + * If the clean list is non-NULL, then we're in a + * situation where a CPU has done deallocations (we + * have a non-NULL dirty list) but no allocations (we + * also have a non-NULL clean list). We can't simply + * move the dirty list into the clean list on this + * CPU, yet we also don't want to allow this condition + * to persist, lest a short clean list prevent a + * massive dirty list from being cleaned (which in + * turn could lead to otherwise avoidable dynamic + * drops). To deal with this, we look for some CPU + * with a NULL clean list, NULL dirty list, and NULL + * rinsing list -- and then we borrow this CPU to + * rinse our dirty list. + */ + for (j = 0; j < NCPU; j++) { + dtrace_dstate_percpu_t *rinser; + + rinser = &dstate->dtds_percpu[j]; + + if (rinser->dtdsc_rinsing != NULL) + continue; + + if (rinser->dtdsc_dirty != NULL) + continue; + + if (rinser->dtdsc_clean != NULL) + continue; + + rinsep = &rinser->dtdsc_rinsing; + break; + } + + if (j == NCPU) { + /* + * We were unable to find another CPU that + * could accept this dirty list -- we are + * therefore unable to clean it now. + */ + dtrace_dynvar_failclean++; + continue; + } + } work = 1; @@ -1592,7 +1641,7 @@ dtrace_dynvar_clean(dtrace_dstate_t *dst * on a hash chain, either the dirty list or the * rinsing list for some CPU must be non-NULL.) */ - dcpu->dtdsc_rinsing = dirty; + *rinsep = dirty; dtrace_membar_producer(); } while (dtrace_casptr(&dcpu->dtdsc_dirty, dirty, NULL) != dirty); @@ -2023,7 +2072,7 @@ retry: ASSERT(clean->dtdv_hashval == DTRACE_DYNHASH_FREE); /* - * Now we'll move the clean list to the free list. + * Now we'll move the clean list to our free list. * It's impossible for this to fail: the only way * the free list can be updated is through this * code path, and only one CPU can own the clean list. @@ -2036,6 +2085,7 @@ retry: * owners of the clean lists out before resetting * the clean lists. */ + dcpu = &dstate->dtds_percpu[me]; rval = dtrace_casptr(&dcpu->dtdsc_free, NULL, clean); ASSERT(rval == NULL); goto retry; @@ -4726,7 +4776,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, int64_t index = (int64_t)tupregs[1].dttk_value; int64_t remaining = (int64_t)tupregs[2].dttk_value; size_t len = dtrace_strlen((char *)s, size); - int64_t i = 0; + int64_t i; if (!dtrace_canload(s, len + 1, mstate, vstate)) { regs[rd] = 0; From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 14 07:30:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B78C35DC; Mon, 14 Jul 2014 07:30: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 A40C327C1; Mon, 14 Jul 2014 07:30: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 s6E7U5Pu096286; Mon, 14 Jul 2014 07:30:05 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6E7U5f9096283; Mon, 14 Jul 2014 07:30:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407140730.s6E7U5f9096283@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 14 Jul 2014 07:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268604 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2014 07:30:05 -0000 Author: hselasky Date: Mon Jul 14 07:30:04 2014 New Revision: 268604 URL: http://svnweb.freebsd.org/changeset/base/268604 Log: MFC r268354: Improve support for Intel Lynx Point USB 3.0 controllers by masking the port routing bits like done in Linux. Modified: stable/10/sys/dev/usb/controller/xhci_pci.c stable/10/sys/dev/usb/controller/xhcireg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Mon Jul 14 07:27:10 2014 (r268603) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Mon Jul 14 07:30:04 2014 (r268604) @@ -157,6 +157,9 @@ xhci_pci_port_route(device_t self, uint3 temp |= set; temp &= ~clear; + /* Don't set bits which the hardware doesn't support */ + temp &= pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4); + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); Modified: stable/10/sys/dev/usb/controller/xhcireg.h ============================================================================== --- stable/10/sys/dev/usb/controller/xhcireg.h Mon Jul 14 07:27:10 2014 (r268603) +++ stable/10/sys/dev/usb/controller/xhcireg.h Mon Jul 14 07:30:04 2014 (r268604) @@ -35,7 +35,9 @@ #define PCI_XHCI_FLADJ 0x61 /* RW frame length adjust */ #define PCI_XHCI_INTEL_XUSB2PR 0xD0 /* Intel USB2 Port Routing */ +#define PCI_XHCI_INTEL_USB2PRM 0xD4 /* Intel USB2 Port Routing Mask */ #define PCI_XHCI_INTEL_USB3_PSSEN 0xD8 /* Intel USB3 Port SuperSpeed Enable */ +#define PCI_XHCI_INTEL_USB3PRM 0xDC /* Intel USB3 Port Routing Mask */ /* XHCI capability registers */ #define XHCI_CAPLENGTH 0x00 /* RO capability */ From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 14 15:54:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D4B0835E; Mon, 14 Jul 2014 15:54: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 C148825FF; Mon, 14 Jul 2014 15:54: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 s6EFsoDW041770; Mon, 14 Jul 2014 15:54:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6EFsohH041769; Mon, 14 Jul 2014 15:54:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407141554.s6EFsohH041769@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 14 Jul 2014 15:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268622 - stable/10/tools/test/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2014 15:54:50 -0000 Author: pfg Date: Mon Jul 14 15:54:50 2014 New Revision: 268622 URL: http://svnweb.freebsd.org/changeset/base/268622 Log: MFC r268538: Avoid hardcoding "gcc" in the DTrace tests. At least one test doesn't work yet without gcc, however gcc is not always available in base. Using the environment compiler is more trustable and will also work with an external compiler. Reviewed by: markj Modified: stable/10/tools/test/dtrace/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/test/dtrace/Makefile ============================================================================== --- stable/10/tools/test/dtrace/Makefile Mon Jul 14 14:33:03 2014 (r268621) +++ stable/10/tools/test/dtrace/Makefile Mon Jul 14 15:54:50 2014 (r268622) @@ -340,7 +340,7 @@ listprgs : .for _f in ${ALL_TESTCFILES} ${_f:T:S/c$/exe/} : ${_f} - gcc -o ${.TARGET} ${_f} -lrt + ${CC} -o ${.TARGET} ${_f} -lrt .endfor listcfiles : From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 14 20:07:23 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9F23EEE5; Mon, 14 Jul 2014 20:07: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 8BDD32DC3; Mon, 14 Jul 2014 20:07: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 s6EK7NWN066141; Mon, 14 Jul 2014 20:07:23 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6EK7N75066136; Mon, 14 Jul 2014 20:07:23 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407142007.s6EK7N75066136@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 14 Jul 2014 20:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268629 - stable/10/sbin/fsck_msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2014 20:07:23 -0000 Author: pfg Date: Mon Jul 14 20:07:23 2014 New Revision: 268629 URL: http://svnweb.freebsd.org/changeset/base/268629 Log: fsck_msdosfs: be a bit more permissive The free space value in the FSInfo block is merely unitialized when it is 0xffffffff. This fixes a bug found in NetBSD. It must be noted that we never supported all the checks that NetBSD does as some of them would cause failures with a freshly created FAT32 from MS-Windows. While here, bring some space fixes. Obtained from: NetBSD (rev. 1.22) Modified: stable/10/sbin/fsck_msdosfs/fat.c Modified: stable/10/sbin/fsck_msdosfs/fat.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/fat.c Mon Jul 14 19:16:49 2014 (r268628) +++ stable/10/sbin/fsck_msdosfs/fat.c Mon Jul 14 20:07:23 2014 (r268629) @@ -242,7 +242,7 @@ readfat(int fs, struct bootblock *boot, ret |= FSDIRTY; else { /* just some odd byte sequence in FAT */ - + switch (boot->ClustMask) { case CLUST32_MASK: pwarn("%s (%02x%02x%02x%02x%02x%02x%02x%02x)\n", @@ -262,7 +262,7 @@ readfat(int fs, struct bootblock *boot, break; } - + if (ask(1, "Correct")) ret |= FSFIXFAT; } @@ -653,7 +653,7 @@ checklost(int dosfs, struct bootblock *b cl_t head; int mod = FSOK; int ret; - + for (head = CLUST_FIRST; head < boot->NumClusters; head++) { /* find next untravelled chain */ if (fat[head].head != head @@ -677,8 +677,9 @@ checklost(int dosfs, struct bootblock *b if (boot->bpbFSInfo) { ret = 0; - if (boot->FSFree != boot->NumFree) { - pwarn("Free space in FSInfo block (%d) not correct (%d)\n", + if (boot->FSFree != 0xffffffffU && + boot->FSFree != boot->NumFree) { + pwarn("Free space in FSInfo block (%u) not correct (%u)\n", boot->FSFree, boot->NumFree); if (ask(1, "Fix")) { boot->FSFree = boot->NumFree; From owner-svn-src-stable-10@FreeBSD.ORG Mon Jul 14 20:13:24 2014 Return-Path: Delivered-To: svn-src-stable-10@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 BD0A72C9; Mon, 14 Jul 2014 20:13: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 AA4082EA9; Mon, 14 Jul 2014 20:13: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 s6EKDO73070463; Mon, 14 Jul 2014 20:13:24 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6EKDOtm070462; Mon, 14 Jul 2014 20:13:24 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407142013.s6EKDOtm070462@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 14 Jul 2014 20:13:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268630 - stable/10/sbin/fsck_msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2014 20:13:24 -0000 Author: pfg Date: Mon Jul 14 20:13:24 2014 New Revision: 268630 URL: http://svnweb.freebsd.org/changeset/base/268630 Log: Revert r268629: This was supposed to go to head first :( Modified: stable/10/sbin/fsck_msdosfs/fat.c Modified: stable/10/sbin/fsck_msdosfs/fat.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/fat.c Mon Jul 14 20:07:23 2014 (r268629) +++ stable/10/sbin/fsck_msdosfs/fat.c Mon Jul 14 20:13:24 2014 (r268630) @@ -242,7 +242,7 @@ readfat(int fs, struct bootblock *boot, ret |= FSDIRTY; else { /* just some odd byte sequence in FAT */ - + switch (boot->ClustMask) { case CLUST32_MASK: pwarn("%s (%02x%02x%02x%02x%02x%02x%02x%02x)\n", @@ -262,7 +262,7 @@ readfat(int fs, struct bootblock *boot, break; } - + if (ask(1, "Correct")) ret |= FSFIXFAT; } @@ -653,7 +653,7 @@ checklost(int dosfs, struct bootblock *b cl_t head; int mod = FSOK; int ret; - + for (head = CLUST_FIRST; head < boot->NumClusters; head++) { /* find next untravelled chain */ if (fat[head].head != head @@ -677,9 +677,8 @@ checklost(int dosfs, struct bootblock *b if (boot->bpbFSInfo) { ret = 0; - if (boot->FSFree != 0xffffffffU && - boot->FSFree != boot->NumFree) { - pwarn("Free space in FSInfo block (%u) not correct (%u)\n", + if (boot->FSFree != boot->NumFree) { + pwarn("Free space in FSInfo block (%d) not correct (%d)\n", boot->FSFree, boot->NumFree); if (ask(1, "Fix")) { boot->FSFree = boot->NumFree; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 04:33:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8CB1E658; Tue, 15 Jul 2014 04:33: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 79E412736; Tue, 15 Jul 2014 04:33: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 s6F4XBu0011329; Tue, 15 Jul 2014 04:33:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F4XB6P011328; Tue, 15 Jul 2014 04:33:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150433.s6F4XB6P011328@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 04:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268645 - stable/10/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 04:33:11 -0000 Author: delphij Date: Tue Jul 15 04:33:11 2014 New Revision: 268645 URL: http://svnweb.freebsd.org/changeset/base/268645 Log: MFC r267572: MFV r249332 (illumos-gate 14005:55fc53126003) Illumos ZFS issues: 3654 zdb should print number of ganged blocks Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Jul 15 03:28:37 2014 (r268644) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Jul 15 04:33:11 2014 (r268645) @@ -2108,6 +2108,8 @@ typedef struct zdb_blkstats { uint64_t zb_lsize; uint64_t zb_psize; uint64_t zb_count; + uint64_t zb_gangs; + uint64_t zb_ditto_samevdev; uint64_t zb_psize_histogram[PSIZE_HISTO_SIZE]; } zdb_blkstats_t; @@ -2155,6 +2157,7 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t * for (int i = 0; i < 4; i++) { int l = (i < 2) ? BP_GET_LEVEL(bp) : ZB_TOTAL; int t = (i & 1) ? type : ZDB_OT_TOTAL; + int equal; zdb_blkstats_t *zb = &zcb->zcb_type[l][t]; zb->zb_asize += BP_GET_ASIZE(bp); @@ -2162,6 +2165,27 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t * zb->zb_psize += BP_GET_PSIZE(bp); zb->zb_count++; zb->zb_psize_histogram[BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT]++; + + zb->zb_gangs += BP_COUNT_GANG(bp); + + switch (BP_GET_NDVAS(bp)) { + case 2: + if (DVA_GET_VDEV(&bp->blk_dva[0]) == + DVA_GET_VDEV(&bp->blk_dva[1])) + zb->zb_ditto_samevdev++; + break; + case 3: + equal = (DVA_GET_VDEV(&bp->blk_dva[0]) == + DVA_GET_VDEV(&bp->blk_dva[1])) + + (DVA_GET_VDEV(&bp->blk_dva[0]) == + DVA_GET_VDEV(&bp->blk_dva[2])) + + (DVA_GET_VDEV(&bp->blk_dva[1]) == + DVA_GET_VDEV(&bp->blk_dva[2])); + if (equal != 0) + zb->zb_ditto_samevdev++; + break; + } + } if (dump_opt['L']) @@ -2552,6 +2576,8 @@ dump_block_stats(spa_t *spa) (void) printf("\n"); (void) printf("\tbp count: %10llu\n", (u_longlong_t)tzb->zb_count); + (void) printf("\tganged count: %10llu\n", + (longlong_t)tzb->zb_gangs); (void) printf("\tbp logical: %10llu avg: %6llu\n", (u_longlong_t)tzb->zb_lsize, (u_longlong_t)(tzb->zb_lsize / tzb->zb_count)); @@ -2573,6 +2599,11 @@ dump_block_stats(spa_t *spa) (void) printf("\tSPA allocated: %10llu used: %5.2f%%\n", (u_longlong_t)norm_alloc, 100.0 * norm_alloc / norm_space); + if (tzb->zb_ditto_samevdev != 0) { + (void) printf("\tDittoed blocks on same vdev: %llu\n", + (longlong_t)tzb->zb_ditto_samevdev); + } + if (dump_opt['b'] >= 2) { int l, t, level; (void) printf("\nBlocks\tLSIZE\tPSIZE\tASIZE" @@ -2580,7 +2611,7 @@ dump_block_stats(spa_t *spa) for (t = 0; t <= ZDB_OT_TOTAL; t++) { char csize[32], lsize[32], psize[32], asize[32]; - char avg[32]; + char avg[32], gang[32]; char *typename; if (t < DMU_OT_NUMTYPES) @@ -2621,6 +2652,7 @@ dump_block_stats(spa_t *spa) zdb_nicenum(zb->zb_psize, psize); zdb_nicenum(zb->zb_asize, asize); zdb_nicenum(zb->zb_asize / zb->zb_count, avg); + zdb_nicenum(zb->zb_gangs, gang); (void) printf("%6s\t%5s\t%5s\t%5s\t%5s" "\t%5.2f\t%6.2f\t", @@ -2634,6 +2666,11 @@ dump_block_stats(spa_t *spa) (void) printf(" L%d %s\n", level, typename); + if (dump_opt['b'] >= 3 && zb->zb_gangs > 0) { + (void) printf("\t number of ganged " + "blocks: %s\n", gang); + } + if (dump_opt['b'] >= 4) { (void) printf("psize " "(in 512-byte sectors): " From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 04:39:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 210AA944; Tue, 15 Jul 2014 04:39: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 E50832784; Tue, 15 Jul 2014 04:39: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 s6F4duL7012450; Tue, 15 Jul 2014 04:39:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F4dtUe012443; Tue, 15 Jul 2014 04:39:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150439.s6F4dtUe012443@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 04:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268647 - in stable/10: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/f... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 04:39:57 -0000 Author: delphij Date: Tue Jul 15 04:39:55 2014 New Revision: 268647 URL: http://svnweb.freebsd.org/changeset/base/268647 Log: MFC r266771: MFV r266766: Add a new zfs property, "redundant_metadata" which can have values "all" or "most". The default will be "all", which is the current behavior. When set to all, ZFS stores an extra copy of all metadata. If a single on-disk block is corrupt, at worst a single block of user data (which is recordsize bytes long) can be lost. Setting to "most" will cause us to only store 1 copy of level-1 indirect blocks of user data files. This can improve performance of random writes, because less metadata has to be written. In practice, at worst about 100 blocks (of recordsize bytes each) of user data can be lost if a single on-disk block is corrupt. The exact behavior of which metadata blocks are stored redundantly may change in future releases. Illumos issue: 3835 zfs need not store 2 copies of all metadata Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Jul 15 04:39:23 2014 (r268646) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Jul 15 04:39:55 2014 (r268647) @@ -18,7 +18,7 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright (c) 2013 by Delphix. All rights reserved. +.\" Copyright (c) 2014 by Delphix. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2012, Bryan Drewery @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 23, 2014 +.Dd May 27, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -1193,6 +1193,53 @@ affects only files created afterward; ex .Pp This property can also be referred to by its shortened column name, .Sy recsize . +.It Sy redundant_metadata Ns = Ns Cm all | most +Controls what types of metadata are stored redundantly. +ZFS stores an extra copy of metadata, so that if a single block is corrupted, +the amount of user data lost is limited. +This extra copy is in addition to any redundancy provided at the pool level +.Pq e.g. by mirroring or RAID-Z , +and is in addition to an extra copy specified by the +.Sy copies +property +.Pq up to a total of 3 copies . +For example if the pool is mirrored, +.Cm copies Ns = Ns Ar 2 , +and +.Cm redundant_metadata Ns = Ns Ar most , +then ZFS +stores 6 copies of most metadata, and 4 copies of data and some +metadata. +.Pp +When set to +.Cm all , +ZFS stores an extra copy of all metadata. +If a +single on-disk block is corrupt, at worst a single block of user data +.Po which is +.Cm recordsize +bytes long +can be lost. +.Pc +.Pp +When set to +.Cm most , +ZFS stores an extra copy of most types of +metadata. +This can improve performance of random writes, because less +metadata must be written. +In practice, at worst about 100 blocks +.Po of +.Cm recordsize +bytes each +.Pc +of user data can be lost if a single +on-disk block is corrupt. +The exact behavior of which metadata blocks +are stored redundantly may change in future releases. +.Pp +The default value is +.Cm all . .It Sy refquota Ns = Ns Ar size | Cm none Limits the amount of space a dataset can consume. This property enforces a hard limit on the amount of space used. This hard limit does not include space used Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Jul 15 04:39:23 2014 (r268646) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Jul 15 04:39:55 2014 (r268647) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -206,7 +206,18 @@ zfs_prop_init(void) { NULL } }; + static zprop_index_t redundant_metadata_table[] = { + { "all", ZFS_REDUNDANT_METADATA_ALL }, + { "most", ZFS_REDUNDANT_METADATA_MOST }, + { NULL } + }; + /* inherit index properties */ + zprop_register_index(ZFS_PROP_REDUNDANT_METADATA, "redundant_metadata", + ZFS_REDUNDANT_METADATA_ALL, + PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, + "all | most", "REDUND_MD", + redundant_metadata_table); zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "standard | always | disabled", "SYNC", Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Jul 15 04:39:23 2014 (r268646) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Jul 15 04:39:55 2014 (r268647) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ /* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1630,6 +1630,12 @@ TUNABLE_INT("vfs.zfs.mdcomp_disable", &z SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RW, &zfs_mdcomp_disable, 0, "Disable metadata compression"); +/* + * When the "redundant_metadata" property is set to "most", only indirect + * blocks of this level and higher will have an additional ditto block. + */ +int zfs_redundant_metadata_most_ditto_level = 2; + void dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, zio_prop_t *zp) { @@ -1669,6 +1675,13 @@ dmu_write_policy(objset_t *os, dnode_t * if (zio_checksum_table[checksum].ci_correctable < 1 || zio_checksum_table[checksum].ci_eck) checksum = ZIO_CHECKSUM_FLETCHER_4; + + if (os->os_redundant_metadata == ZFS_REDUNDANT_METADATA_ALL || + (os->os_redundant_metadata == + ZFS_REDUNDANT_METADATA_MOST && + (level >= zfs_redundant_metadata_most_ditto_level || + DMU_OT_IS_METADATA(type) || (wp & WP_SPILL)))) + copies++; } else if (wp & WP_NOFILL) { ASSERT(level == 0); @@ -1716,7 +1729,7 @@ dmu_write_policy(objset_t *os, dnode_t * zp->zp_compress = compress; zp->zp_type = (wp & WP_SPILL) ? dn->dn_bonustype : type; zp->zp_level = level; - zp->zp_copies = MIN(copies + ismd, spa_max_replication(os->os_spa)); + zp->zp_copies = MIN(copies, spa_max_replication(os->os_spa)); zp->zp_dedup = dedup; zp->zp_dedup_verify = dedup && dedup_verify; zp->zp_nopwrite = nopwrite; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Jul 15 04:39:23 2014 (r268646) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Jul 15 04:39:55 2014 (r268647) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -115,13 +115,13 @@ dmu_objset_id(objset_t *os) return (ds ? ds->ds_object : 0); } -uint64_t +zfs_sync_type_t dmu_objset_syncprop(objset_t *os) { return (os->os_sync); } -uint64_t +zfs_logbias_op_t dmu_objset_logbias(objset_t *os) { return (os->os_logbias); @@ -230,6 +230,20 @@ sync_changed_cb(void *arg, uint64_t newv } static void +redundant_metadata_changed_cb(void *arg, uint64_t newval) +{ + objset_t *os = arg; + + /* + * Inheritance and range checking should have been done by now. + */ + ASSERT(newval == ZFS_REDUNDANT_METADATA_ALL || + newval == ZFS_REDUNDANT_METADATA_MOST); + + os->os_redundant_metadata = newval; +} + +static void logbias_changed_cb(void *arg, uint64_t newval) { objset_t *os = arg; @@ -364,6 +378,12 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat zfs_prop_to_name(ZFS_PROP_SYNC), sync_changed_cb, os); } + if (err == 0) { + err = dsl_prop_register(ds, + zfs_prop_to_name( + ZFS_PROP_REDUNDANT_METADATA), + redundant_metadata_changed_cb, os); + } } if (err != 0) { VERIFY(arc_buf_remove_ref(os->os_phys_buf, @@ -377,9 +397,9 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat os->os_compress = ZIO_COMPRESS_LZJB; os->os_copies = spa_max_replication(spa); os->os_dedup_checksum = ZIO_CHECKSUM_OFF; - os->os_dedup_verify = 0; - os->os_logbias = 0; - os->os_sync = 0; + os->os_dedup_verify = B_FALSE; + os->os_logbias = ZFS_LOGBIAS_LATENCY; + os->os_sync = ZFS_SYNC_STANDARD; os->os_primary_cache = ZFS_CACHE_ALL; os->os_secondary_cache = ZFS_CACHE_ALL; } @@ -622,6 +642,9 @@ dmu_objset_evict(objset_t *os) VERIFY0(dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_SYNC), sync_changed_cb, os)); + VERIFY0(dsl_prop_unregister(ds, + zfs_prop_to_name(ZFS_PROP_REDUNDANT_METADATA), + redundant_metadata_changed_cb, os)); } VERIFY0(dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_PRIMARYCACHE), Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Jul 15 04:39:23 2014 (r268646) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Jul 15 04:39:55 2014 (r268647) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright 2013 DEY Storage Systems, Inc. @@ -746,8 +746,8 @@ extern struct dsl_dataset *dmu_objset_ds extern void dmu_objset_name(objset_t *os, char *buf); extern dmu_objset_type_t dmu_objset_type(objset_t *os); extern uint64_t dmu_objset_id(objset_t *os); -extern uint64_t dmu_objset_syncprop(objset_t *os); -extern uint64_t dmu_objset_logbias(objset_t *os); +extern zfs_sync_type_t dmu_objset_syncprop(objset_t *os); +extern zfs_logbias_op_t dmu_objset_logbias(objset_t *os); extern int dmu_snapshot_list_next(objset_t *os, int namelen, char *name, uint64_t *id, uint64_t *offp, boolean_t *case_conflict); extern int dmu_snapshot_realname(objset_t *os, char *name, char *real, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Tue Jul 15 04:39:23 2014 (r268646) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Tue Jul 15 04:39:55 2014 (r268647) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -85,15 +85,16 @@ struct objset { zilog_t *os_zil; /* can change, under dsl_dir's locks: */ - uint8_t os_checksum; - uint8_t os_compress; + enum zio_checksum os_checksum; + enum zio_compress os_compress; uint8_t os_copies; - uint8_t os_dedup_checksum; - uint8_t os_dedup_verify; - uint8_t os_logbias; - uint8_t os_primary_cache; - uint8_t os_secondary_cache; - uint8_t os_sync; + enum zio_checksum os_dedup_checksum; + boolean_t os_dedup_verify; + zfs_logbias_op_t os_logbias; + zfs_cache_type_t os_primary_cache; + zfs_cache_type_t os_secondary_cache; + zfs_sync_type_t os_sync; + zfs_redundant_metadata_type_t os_redundant_metadata; /* no lock needed: */ struct dmu_tx *os_synctx; /* XXX sketchy */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Jul 15 04:39:23 2014 (r268646) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Jul 15 04:39:55 2014 (r268647) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. @@ -150,6 +150,7 @@ typedef enum { ZFS_PROP_SNAPSHOT_LIMIT, ZFS_PROP_FILESYSTEM_COUNT, ZFS_PROP_SNAPSHOT_COUNT, + ZFS_PROP_REDUNDANT_METADATA, ZFS_NUM_PROPS } zfs_prop_t; @@ -349,6 +350,11 @@ typedef enum { ZFS_VOLMODE_NONE = 3 } zfs_volmode_t; +typedef enum { + ZFS_REDUNDANT_METADATA_ALL, + ZFS_REDUNDANT_METADATA_MOST +} zfs_redundant_metadata_type_t; + /* * On-disk version number. */ From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 04:44:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EE650AAB; Tue, 15 Jul 2014 04:44: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 DA9F7280B; Tue, 15 Jul 2014 04:44: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 s6F4i687016239; Tue, 15 Jul 2014 04:44:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F4i6A6016237; Tue, 15 Jul 2014 04:44:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150444.s6F4i6A6016237@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 04:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268648 - stable/10/cddl/contrib/opensolaris/cmd/zstreamdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 04:44:07 -0000 Author: delphij Date: Tue Jul 15 04:44:06 2014 New Revision: 268648 URL: http://svnweb.freebsd.org/changeset/base/268648 Log: MFC r260142: MFV r258972: 4373 add block contents print to zstreamdump Modified: stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 Tue Jul 15 04:39:55 2014 (r268647) +++ stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 Tue Jul 15 04:44:06 2014 (r268648) @@ -18,10 +18,11 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright (c) 2013, Delphix. All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd November 26, 2011 +.Dd December 31, 2013 .Dt ZSTREAMDUMP 8 .Os .Sh NAME @@ -30,6 +31,7 @@ .Sh SYNOPSIS .Nm .Op Fl C +.Op Fl d .Op Fl v .Sh DESCRIPTION The @@ -43,6 +45,8 @@ The following options are supported: .Bl -tag -width indent .It Fl C Suppress the validation of checksums. +.It Fl d +Dump contents of blocks modified, implies verbose. .It Fl v Verbose. Dump all headers, not only begin and end headers. .El Modified: stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Tue Jul 15 04:39:55 2014 (r268647) +++ stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Tue Jul 15 04:44:06 2014 (r268648) @@ -24,6 +24,11 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + +#include #include #include #include @@ -34,6 +39,16 @@ #include #include +/* + * If dump mode is enabled, the number of bytes to print per line + */ +#define BYTES_PER_LINE 16 +/* + * If dump mode is enabled, the number of bytes to group together, separated + * by newlines or spaces + */ +#define DUMP_GROUPING 4 + uint64_t drr_record_count[DRR_NUMTYPES]; uint64_t total_write_size = 0; uint64_t total_stream_len = 0; @@ -45,9 +60,11 @@ boolean_t do_cksum = B_TRUE; static void usage(void) { - (void) fprintf(stderr, "usage: zstreamdump [-v] [-C] < file\n"); + (void) fprintf(stderr, "usage: zstreamdump [-v] [-C] [-d] < file\n"); (void) fprintf(stderr, "\t -v -- verbose\n"); (void) fprintf(stderr, "\t -C -- suppress checksum verification\n"); + (void) fprintf(stderr, "\t -d -- dump contents of blocks modified, " + "implies verbose\n"); exit(1); } @@ -75,6 +92,70 @@ ssread(void *buf, size_t len, zio_cksum_ return (outlen); } +/* + * Print part of a block in ASCII characters + */ +static void +print_ascii_block(char *subbuf, int length) +{ + int i; + + for (i = 0; i < length; i++) { + char char_print = isprint(subbuf[i]) ? subbuf[i] : '.'; + if (i != 0 && i % DUMP_GROUPING == 0) { + (void) printf(" "); + } + (void) printf("%c", char_print); + } + (void) printf("\n"); +} + +/* + * print_block - Dump the contents of a modified block to STDOUT + * + * Assume that buf has capacity evenly divisible by BYTES_PER_LINE + */ +static void +print_block(char *buf, int length) +{ + int i; + /* + * Start printing ASCII characters at a constant offset, after + * the hex prints. Leave 3 characters per byte on a line (2 digit + * hex number plus 1 space) plus spaces between characters and + * groupings + */ + int ascii_start = BYTES_PER_LINE * 3 + + BYTES_PER_LINE / DUMP_GROUPING + 2; + + for (i = 0; i < length; i += BYTES_PER_LINE) { + int j; + int this_line_length = MIN(BYTES_PER_LINE, length - i); + int print_offset = 0; + + for (j = 0; j < this_line_length; j++) { + int buf_offset = i + j; + + /* + * Separate every DUMP_GROUPING bytes by a space. + */ + if (buf_offset % DUMP_GROUPING == 0) { + print_offset += printf(" "); + } + + /* + * Print the two-digit hex value for this byte. + */ + unsigned char hex_print = buf[buf_offset]; + print_offset += printf("%02x ", hex_print); + } + + (void) printf("%*s", ascii_start - print_offset, " "); + + print_ascii_block(buf + i, this_line_length); + } +} + int main(int argc, char *argv[]) { @@ -92,11 +173,17 @@ main(int argc, char *argv[]) char c; boolean_t verbose = B_FALSE; boolean_t first = B_TRUE; + /* + * dump flag controls whether the contents of any modified data blocks + * are printed to the console during processing of the stream. Warning: + * for large streams, this can obviously lead to massive prints. + */ + boolean_t dump = B_FALSE; int err; zio_cksum_t zc = { 0 }; zio_cksum_t pcksum = { 0 }; - while ((c = getopt(argc, argv, ":vC")) != -1) { + while ((c = getopt(argc, argv, ":vCd")) != -1) { switch (c) { case 'C': do_cksum = B_FALSE; @@ -104,6 +191,10 @@ main(int argc, char *argv[]) case 'v': verbose = B_TRUE; break; + case 'd': + dump = B_TRUE; + verbose = B_TRUE; + break; case ':': (void) fprintf(stderr, "missing argument for '%c' option\n", optopt); @@ -128,6 +219,10 @@ main(int argc, char *argv[]) pcksum = zc; while (ssread(drr, sizeof (dmu_replay_record_t), &zc)) { + /* + * If this is the first DMU record being processed, check for + * the magic bytes and figure out the endian-ness based on them. + */ if (first) { if (drrb->drr_magic == BSWAP_64(DMU_BACKUP_MAGIC)) { do_byteswap = B_TRUE; @@ -209,7 +304,7 @@ main(int argc, char *argv[]) nvlist_t *nv; int sz = drr->drr_payloadlen; - if (sz > 1<<20) { + if (sz > INITIAL_BUFLEN) { free(buf); buf = malloc(sz); } @@ -283,6 +378,10 @@ main(int argc, char *argv[]) if (drro->drr_bonuslen > 0) { (void) ssread(buf, P2ROUNDUP(drro->drr_bonuslen, 8), &zc); + if (dump) { + print_block(buf, + P2ROUNDUP(drro->drr_bonuslen, 8)); + } } break; @@ -312,6 +411,10 @@ main(int argc, char *argv[]) drrw->drr_key.ddk_prop = BSWAP_64(drrw->drr_key.ddk_prop); } + /* + * If this is verbose and/or dump output, + * print info on the modified block + */ if (verbose) { (void) printf("WRITE object = %llu type = %u " "checksum type = %u\n" @@ -324,7 +427,16 @@ main(int argc, char *argv[]) (u_longlong_t)drrw->drr_length, (u_longlong_t)drrw->drr_key.ddk_prop); } + /* + * Read the contents of the block in from STDIN to buf + */ (void) ssread(buf, drrw->drr_length, &zc); + /* + * If in dump mode + */ + if (dump) { + print_block(buf, drrw->drr_length); + } total_write_size += drrw->drr_length; break; @@ -390,6 +502,9 @@ main(int argc, char *argv[]) drrs->drr_length); } (void) ssread(buf, drrs->drr_length, &zc); + if (dump) { + print_block(buf, drrs->drr_length); + } break; } pcksum = zc; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 04:53:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8A705C83; Tue, 15 Jul 2014 04:53: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 740A328C7; Tue, 15 Jul 2014 04:53: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 s6F4rcDv020692; Tue, 15 Jul 2014 04:53:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F4rYxA020667; Tue, 15 Jul 2014 04:53:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150453.s6F4rYxA020667@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 04:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268649 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/openso... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 04:53:38 -0000 Author: delphij Date: Tue Jul 15 04:53:34 2014 New Revision: 268649 URL: http://svnweb.freebsd.org/changeset/base/268649 Log: MFC r268075: MFV r267565: 4757 ZFS embedded-data block pointers ("zero block compression") 4913 zfs release should not be subject to space checks Added: stable/10/sys/cddl/boot/zfs/blkptr.c - copied unchanged from r268075, head/sys/cddl/boot/zfs/blkptr.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/blkptr.c - copied unchanged from r268075, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/blkptr.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/blkptr.h - copied unchanged from r268075, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/blkptr.h Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h stable/10/cddl/sbin/zpool/Makefile stable/10/cddl/usr.bin/zinject/Makefile stable/10/cddl/usr.sbin/zdb/Makefile stable/10/cddl/usr.sbin/zhack/Makefile stable/10/sys/boot/zfs/zfsimpl.c stable/10/sys/cddl/boot/zfs/README stable/10/sys/cddl/boot/zfs/zfsimpl.h stable/10/sys/cddl/boot/zfs/zfssubr.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Jul 15 04:53:34 2014 (r268649) @@ -1059,8 +1059,17 @@ snprintf_blkptr_compact(char *blkbuf, si return; } - blkbuf[0] = '\0'; + if (BP_IS_EMBEDDED(bp)) { + (void) sprintf(blkbuf, + "EMBEDDED et=%u %llxL/%llxP B=%llu", + (int)BPE_GET_ETYPE(bp), + (u_longlong_t)BPE_GET_LSIZE(bp), + (u_longlong_t)BPE_GET_PSIZE(bp), + (u_longlong_t)bp->blk_birth); + return; + } + blkbuf[0] = '\0'; for (int i = 0; i < ndvas; i++) (void) snprintf(blkbuf + strlen(blkbuf), buflen - strlen(blkbuf), "%llu:%llx:%llx ", @@ -1078,7 +1087,7 @@ snprintf_blkptr_compact(char *blkbuf, si "%llxL/%llxP F=%llu B=%llu/%llu", (u_longlong_t)BP_GET_LSIZE(bp), (u_longlong_t)BP_GET_PSIZE(bp), - (u_longlong_t)bp->blk_fill, + (u_longlong_t)BP_GET_FILL(bp), (u_longlong_t)bp->blk_birth, (u_longlong_t)BP_PHYSICAL_BIRTH(bp)); } @@ -1091,8 +1100,10 @@ print_indirect(blkptr_t *bp, const zbook char blkbuf[BP_SPRINTF_LEN]; int l; - ASSERT3U(BP_GET_TYPE(bp), ==, dnp->dn_type); - ASSERT3U(BP_GET_LEVEL(bp), ==, zb->zb_level); + if (!BP_IS_EMBEDDED(bp)) { + ASSERT3U(BP_GET_TYPE(bp), ==, dnp->dn_type); + ASSERT3U(BP_GET_LEVEL(bp), ==, zb->zb_level); + } (void) printf("%16llx ", (u_longlong_t)blkid2offset(dnp, bp, zb)); @@ -1146,10 +1157,10 @@ visit_indirect(spa_t *spa, const dnode_p err = visit_indirect(spa, dnp, cbp, &czb); if (err) break; - fill += cbp->blk_fill; + fill += BP_GET_FILL(cbp); } if (!err) - ASSERT3U(fill, ==, bp->blk_fill); + ASSERT3U(fill, ==, BP_GET_FILL(bp)); (void) arc_buf_remove_ref(buf, &buf); } @@ -1816,14 +1827,14 @@ dump_dir(objset_t *os) if (dds.dds_type == DMU_OST_META) { dds.dds_creation_txg = TXG_INITIAL; - usedobjs = os->os_rootbp->blk_fill; + usedobjs = BP_GET_FILL(os->os_rootbp); refdbytes = os->os_spa->spa_dsl_pool-> dp_mos_dir->dd_phys->dd_used_bytes; } else { dmu_objset_space(os, &refdbytes, &scratch, &usedobjs, &scratch); } - ASSERT3U(usedobjs, ==, os->os_rootbp->blk_fill); + ASSERT3U(usedobjs, ==, BP_GET_FILL(os->os_rootbp)); zdb_nicenum(refdbytes, numbuf); @@ -2134,6 +2145,9 @@ typedef struct zdb_cb { zdb_blkstats_t zcb_type[ZB_TOTAL + 1][ZDB_OT_TOTAL + 1]; uint64_t zcb_dedup_asize; uint64_t zcb_dedup_blocks; + uint64_t zcb_embedded_blocks[NUM_BP_EMBEDDED_TYPES]; + uint64_t zcb_embedded_histogram[NUM_BP_EMBEDDED_TYPES] + [BPE_PAYLOAD_SIZE]; uint64_t zcb_start; uint64_t zcb_lastprint; uint64_t zcb_totalasize; @@ -2188,6 +2202,13 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t * } + if (BP_IS_EMBEDDED(bp)) { + zcb->zcb_embedded_blocks[BPE_GET_ETYPE(bp)]++; + zcb->zcb_embedded_histogram[BPE_GET_ETYPE(bp)] + [BPE_GET_PSIZE(bp)]++; + return; + } + if (dump_opt['L']) return; @@ -2287,7 +2308,8 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)); - if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) { + if (!BP_IS_EMBEDDED(bp) && + (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata))) { size_t size = BP_GET_PSIZE(bp); void *data = zio_data_buf_alloc(size); int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW; @@ -2479,7 +2501,7 @@ dump_block_stats(spa_t *spa) zdb_blkstats_t *zb, *tzb; uint64_t norm_alloc, norm_space, total_alloc, total_found; int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD; - int leaks = 0; + boolean_t leaks = B_FALSE; (void) printf("\nTraversing all blocks %s%s%s%s%s...\n\n", (dump_opt['c'] || !dump_opt['L']) ? "to verify " : "", @@ -2567,7 +2589,7 @@ dump_block_stats(spa_t *spa) (u_longlong_t)total_alloc, (dump_opt['L']) ? "unreachable" : "leaked", (longlong_t)(total_alloc - total_found)); - leaks = 1; + leaks = B_TRUE; } if (tzb->zb_count == 0) @@ -2599,6 +2621,23 @@ dump_block_stats(spa_t *spa) (void) printf("\tSPA allocated: %10llu used: %5.2f%%\n", (u_longlong_t)norm_alloc, 100.0 * norm_alloc / norm_space); + for (bp_embedded_type_t i = 0; i < NUM_BP_EMBEDDED_TYPES; i++) { + if (zcb.zcb_embedded_blocks[i] == 0) + continue; + (void) printf("\n"); + (void) printf("\tadditional, non-pointer bps of type %u: " + "%10llu\n", + i, (u_longlong_t)zcb.zcb_embedded_blocks[i]); + + if (dump_opt['b'] >= 3) { + (void) printf("\t number of (compressed) bytes: " + "number of bps\n"); + dump_histogram(zcb.zcb_embedded_histogram[i], + sizeof (zcb.zcb_embedded_histogram[i]) / + sizeof (zcb.zcb_embedded_histogram[i][0]), 0); + } + } + if (tzb->zb_ditto_samevdev != 0) { (void) printf("\tDittoed blocks on same vdev: %llu\n", (longlong_t)tzb->zb_ditto_samevdev); @@ -2711,14 +2750,14 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo avl_index_t where; zdb_ddt_entry_t *zdde, zdde_search; - if (BP_IS_HOLE(bp)) + if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp)) return (0); if (dump_opt['S'] > 1 && zb->zb_level == ZB_ROOT_LEVEL) { (void) printf("traversing objset %llu, %llu objects, " "%lu blocks so far\n", (u_longlong_t)zb->zb_objset, - (u_longlong_t)bp->blk_fill, + (u_longlong_t)BP_GET_FILL(bp), avl_numnodes(t)); } Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Jul 15 04:53:34 2014 (r268649) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2014 +.Dd June 30, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -179,11 +179,12 @@ .Ar bookmark .Nm .Cm send -.Op Fl DnPpRv +.Op Fl DnPpRve .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Nm .Cm send +.Op Fl e .Op Fl i Ar snapshot Ns | Ns bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm @@ -2476,7 +2477,7 @@ feature. .It Xo .Nm .Cm send -.Op Fl DnPpRv +.Op Fl DnPpRve .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Xc @@ -2548,6 +2549,29 @@ be used regardless of the dataset's property, but performance will be much better if the filesystem uses a dedup-capable checksum (eg. .Sy sha256 ) . +.It Fl e +Generate a more compact stream by using WRITE_EMBEDDED records for blocks +which are stored more compactly on disk by the +.Sy embedded_data +pool +feature. +This flag has no effect if the +.Sy embedded_data +feature is +disabled. +The receiving system must have the +.Sy embedded_data +feature +enabled. +If the +.Sy lz4_compress +feature is active on the sending system, +then the receiving system must have that feature enabled as well. +See +.Xr zpool-features 7 +for details on ZFS feature flags and the +.Sy embedded_data +feature. .It Fl p Include the dataset's properties in the stream. This flag is implicit when .Fl R @@ -2572,6 +2596,7 @@ on future versions of .It Xo .Nm .Cm send +.Op Fl e .Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc @@ -2597,6 +2622,29 @@ specified as the last component of the n If the incremental target is a clone, the incremental source can be the origin snapshot, or an earlier snapshot in the origin's filesystem, or the origin's origin, etc. +.It Fl e +Generate a more compact stream by using WRITE_EMBEDDED records for blocks +which are stored more compactly on disk by the +.Sy embedded_data +pool +feature. +This flag has no effect if the +.Sy embedded_data +feature is +disabled. +The receiving system must have the +.Sy embedded_data +feature +enabled. +If the +.Sy lz4_compress +feature is active on the sending system, +then the receiving system must have that feature enabled as well. +See +.Xr zpool-features 7 +for details on ZFS feature flags and the +.Sy embedded_data +feature. .El .It Xo .Nm Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Jul 15 04:53:34 2014 (r268649) @@ -274,9 +274,9 @@ get_usage(zfs_help_t idx) case HELP_ROLLBACK: return (gettext("\trollback [-rRf] \n")); case HELP_SEND: - return (gettext("\tsend [-DnPpRv] [-[iI] snapshot] " + return (gettext("\tsend [-DnPpRve] [-[iI] snapshot] " "\n" - "\tsend [-i snapshot|bookmark] " + "\tsend [-e] [-i snapshot|bookmark] " "\n")); case HELP_SET: return (gettext("\tset " @@ -590,6 +590,7 @@ finish_progress(char *done) free(pt_header); pt_header = NULL; } + /* * zfs clone [-p] [-o prop=value] ... * @@ -3368,6 +3369,7 @@ rollback_check_dependent(zfs_handle_t *z zfs_close(zhp); return (0); } + /* * Report any snapshots more recent than the one specified. Used when '-r' is * not specified. We reuse this same callback for the snapshot dependents - if @@ -3707,7 +3709,7 @@ zfs_do_send(int argc, char **argv) boolean_t extraverbose = B_FALSE; /* check options */ - while ((c = getopt(argc, argv, ":i:I:RDpvnP")) != -1) { + while ((c = getopt(argc, argv, ":i:I:RDpvnPe")) != -1) { switch (c) { case 'i': if (fromname) @@ -3742,6 +3744,9 @@ zfs_do_send(int argc, char **argv) case 'n': flags.dryrun = B_TRUE; break; + case 'e': + flags.embed_data = B_TRUE; + break; case ':': (void) fprintf(stderr, gettext("missing argument for " "'%c' option\n"), optopt); @@ -3780,6 +3785,7 @@ zfs_do_send(int argc, char **argv) if (strchr(argv[0], '@') == NULL || (fromname && strchr(fromname, '#') != NULL)) { char frombuf[ZFS_MAXNAMELEN]; + enum lzc_send_flags lzc_flags = 0; if (flags.replicate || flags.doall || flags.props || flags.dedup || flags.dryrun || flags.verbose || @@ -3794,6 +3800,9 @@ zfs_do_send(int argc, char **argv) if (zhp == NULL) return (1); + if (flags.embed_data) + lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; + if (fromname != NULL && (fromname[0] == '#' || fromname[0] == '@')) { /* @@ -3807,7 +3816,7 @@ zfs_do_send(int argc, char **argv) (void) strlcat(frombuf, fromname, sizeof (frombuf)); fromname = frombuf; } - err = zfs_send_one(zhp, fromname, STDOUT_FILENO); + err = zfs_send_one(zhp, fromname, STDOUT_FILENO, lzc_flags); zfs_close(zhp); return (err != 0); } Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Jul 15 04:53:34 2014 (r268649) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 23, 2014 +.Dd June 30, 2014 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -396,6 +396,34 @@ This feature becomes as soon as it is enabled and will never return to being .Sy enabled . +.It Sy embedded_data +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:embedded_data" +.It GUID Ta com.delphix:embedded_data +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +This feature improves the performance and compression ratio of +highly-compressible blocks. +Blocks whose contents can compress to 112 bytes +or smaller can take advantage of this feature. +.Pp +When this feature is enabled, the contents of highly-compressible blocks are +stored in the block "pointer" itself +.Po a misnomer in this case, as it contains +the compresseed data, rather than a pointer to its location on disk +.Pc . +Thus +the space of the block +.Pq one sector, typically 512 bytes or 4KB +is saved, +and no additional i/o is needed to read and write the data block. +.Pp +This feature becomes +.Sy active +as soon as it is enabled and will +never return to being +.Sy enabled . .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Tue Jul 15 04:53:34 2014 (r268649) @@ -49,7 +49,6 @@ */ #define DUMP_GROUPING 4 -uint64_t drr_record_count[DRR_NUMTYPES]; uint64_t total_write_size = 0; uint64_t total_stream_len = 0; FILE *send_stream = 0; @@ -123,7 +122,7 @@ print_block(char *buf, int length) * Start printing ASCII characters at a constant offset, after * the hex prints. Leave 3 characters per byte on a line (2 digit * hex number plus 1 space) plus spaces between characters and - * groupings + * groupings. */ int ascii_start = BYTES_PER_LINE * 3 + BYTES_PER_LINE / DUMP_GROUPING + 2; @@ -160,6 +159,8 @@ int main(int argc, char *argv[]) { char *buf = malloc(INITIAL_BUFLEN); + uint64_t drr_record_count[DRR_NUMTYPES] = { 0 }; + uint64_t total_records = 0; dmu_replay_record_t thedrr; dmu_replay_record_t *drr = &thedrr; struct drr_begin *drrb = &thedrr.drr_u.drr_begin; @@ -170,6 +171,7 @@ main(int argc, char *argv[]) struct drr_write_byref *drrwbr = &thedrr.drr_u.drr_write_byref; struct drr_free *drrf = &thedrr.drr_u.drr_free; struct drr_spill *drrs = &thedrr.drr_u.drr_spill; + struct drr_write_embedded *drrwe = &thedrr.drr_u.drr_write_embedded; char c; boolean_t verbose = B_FALSE; boolean_t first = B_TRUE; @@ -264,6 +266,7 @@ main(int argc, char *argv[]) } drr_record_count[drr->drr_type]++; + total_records++; switch (drr->drr_type) { case DRR_BEGIN: @@ -376,8 +379,8 @@ main(int argc, char *argv[]) drro->drr_bonuslen); } if (drro->drr_bonuslen > 0) { - (void) ssread(buf, P2ROUNDUP(drro->drr_bonuslen, - 8), &zc); + (void) ssread(buf, + P2ROUNDUP(drro->drr_bonuslen, 8), &zc); if (dump) { print_block(buf, P2ROUNDUP(drro->drr_bonuslen, 8)); @@ -506,6 +509,38 @@ main(int argc, char *argv[]) print_block(buf, drrs->drr_length); } break; + case DRR_WRITE_EMBEDDED: + if (do_byteswap) { + drrwe->drr_object = + BSWAP_64(drrwe->drr_object); + drrwe->drr_offset = + BSWAP_64(drrwe->drr_offset); + drrwe->drr_length = + BSWAP_64(drrwe->drr_length); + drrwe->drr_toguid = + BSWAP_64(drrwe->drr_toguid); + drrwe->drr_lsize = + BSWAP_32(drrwe->drr_lsize); + drrwe->drr_psize = + BSWAP_32(drrwe->drr_psize); + } + if (verbose) { + (void) printf("WRITE_EMBEDDED object = %llu " + "offset = %llu length = %llu\n" + "toguid = %llx comp = %u etype = %u " + "lsize = %u psize = %u\n", + (u_longlong_t)drrwe->drr_object, + (u_longlong_t)drrwe->drr_offset, + (u_longlong_t)drrwe->drr_length, + (u_longlong_t)drrwe->drr_toguid, + drrwe->drr_compression, + drrwe->drr_etype, + drrwe->drr_lsize, + drrwe->drr_psize); + } + (void) ssread(buf, + P2ROUNDUP(drrwe->drr_psize, 8), &zc); + break; } pcksum = zc; } @@ -524,18 +559,16 @@ main(int argc, char *argv[]) (u_longlong_t)drr_record_count[DRR_FREEOBJECTS]); (void) printf("\tTotal DRR_WRITE records = %lld\n", (u_longlong_t)drr_record_count[DRR_WRITE]); + (void) printf("\tTotal DRR_WRITE_BYREF records = %lld\n", + (u_longlong_t)drr_record_count[DRR_WRITE_BYREF]); + (void) printf("\tTotal DRR_WRITE_EMBEDDED records = %lld\n", + (u_longlong_t)drr_record_count[DRR_WRITE_EMBEDDED]); (void) printf("\tTotal DRR_FREE records = %lld\n", (u_longlong_t)drr_record_count[DRR_FREE]); (void) printf("\tTotal DRR_SPILL records = %lld\n", (u_longlong_t)drr_record_count[DRR_SPILL]); (void) printf("\tTotal records = %lld\n", - (u_longlong_t)(drr_record_count[DRR_BEGIN] + - drr_record_count[DRR_OBJECT] + - drr_record_count[DRR_FREEOBJECTS] + - drr_record_count[DRR_WRITE] + - drr_record_count[DRR_FREE] + - drr_record_count[DRR_SPILL] + - drr_record_count[DRR_END])); + (u_longlong_t)total_records); (void) printf("\tTotal write size = %lld (0x%llx)\n", (u_longlong_t)total_write_size, (u_longlong_t)total_write_size); (void) printf("\tTotal stream length = %lld (0x%llx)\n", Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Jul 15 04:53:34 2014 (r268649) @@ -53,7 +53,7 @@ * At random times, the child self-immolates with a SIGKILL. * This is the software equivalent of pulling the power cord. * The parent then runs the test again, using the existing - * storage pool, as many times as desired. If backwards compatability + * storage pool, as many times as desired. If backwards compatibility * testing is enabled ztest will sometimes run the "older" version * of ztest after a SIGKILL. * @@ -1267,13 +1267,13 @@ static void ztest_bt_verify(ztest_block_tag_t *bt, objset_t *os, uint64_t object, uint64_t offset, uint64_t gen, uint64_t txg, uint64_t crtxg) { - ASSERT(bt->bt_magic == BT_MAGIC); - ASSERT(bt->bt_objset == dmu_objset_id(os)); - ASSERT(bt->bt_object == object); - ASSERT(bt->bt_offset == offset); - ASSERT(bt->bt_gen <= gen); - ASSERT(bt->bt_txg <= txg); - ASSERT(bt->bt_crtxg == crtxg); + ASSERT3U(bt->bt_magic, ==, BT_MAGIC); + ASSERT3U(bt->bt_objset, ==, dmu_objset_id(os)); + ASSERT3U(bt->bt_object, ==, object); + ASSERT3U(bt->bt_offset, ==, offset); + ASSERT3U(bt->bt_gen, <=, gen); + ASSERT3U(bt->bt_txg, <=, txg); + ASSERT3U(bt->bt_crtxg, ==, crtxg); } static ztest_block_tag_t * @@ -3472,6 +3472,11 @@ ztest_dsl_dataset_promote_busy(ztest_ds_ if (error) fatal(0, "dmu_objset_own(%s) = %d", snap2name, error); error = dsl_dataset_promote(clone2name, NULL); + if (error == ENOSPC) { + dmu_objset_disown(os, FTAG); + ztest_record_enospc(FTAG); + goto out; + } if (error != EBUSY) fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name, error); @@ -3627,11 +3632,19 @@ ztest_dmu_read_write(ztest_ds_t *zd, uin return; } - dmu_object_set_checksum(os, bigobj, - (enum zio_checksum)ztest_random_dsl_prop(ZFS_PROP_CHECKSUM), tx); + enum zio_checksum cksum; + do { + cksum = (enum zio_checksum) + ztest_random_dsl_prop(ZFS_PROP_CHECKSUM); + } while (cksum >= ZIO_CHECKSUM_LEGACY_FUNCTIONS); + dmu_object_set_checksum(os, bigobj, cksum, tx); - dmu_object_set_compress(os, bigobj, - (enum zio_compress)ztest_random_dsl_prop(ZFS_PROP_COMPRESSION), tx); + enum zio_compress comp; + do { + comp = (enum zio_compress) + ztest_random_dsl_prop(ZFS_PROP_COMPRESSION); + } while (comp >= ZIO_COMPRESS_LEGACY_FUNCTIONS); + dmu_object_set_compress(os, bigobj, comp, tx); /* * For each index from n to n + s, verify that the existing bufwad @@ -4711,8 +4724,13 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, error = dsl_dataset_user_hold(holds, 0, NULL); fnvlist_free(holds); - if (error) - fatal(0, "dsl_dataset_user_hold(%s)", fullname, tag); + if (error == ENOSPC) { + ztest_record_enospc("dsl_dataset_user_hold"); + goto out; + } else if (error) { + fatal(0, "dsl_dataset_user_hold(%s, %s) = %u", + fullname, tag, error); + } error = dsl_destroy_snapshot(fullname, B_FALSE); if (error != EBUSY) { @@ -5165,7 +5183,7 @@ ztest_run_zdb(char *pool) isa = strdup(isa); /* LINTED */ (void) sprintf(bin, - "/usr/sbin%.*s/zdb -bcc%s%s -U %s %s", + "/usr/sbin%.*s/zdb -bcc%s%s -d -U %s %s", isalen, isa, ztest_opts.zo_verbose >= 3 ? "s" : "", Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Jul 15 04:53:34 2014 (r268649) @@ -42,6 +42,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -607,13 +608,16 @@ typedef struct sendflags { /* show progress (ie. -v) */ boolean_t progress; + + /* WRITE_EMBEDDED records of type DATA are permitted */ + boolean_t embed_data; } sendflags_t; typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *); extern int zfs_send(zfs_handle_t *, const char *, const char *, sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **); -extern int zfs_send_one(zfs_handle_t *, const char *, int); +extern int zfs_send_one(zfs_handle_t *, const char *, int, enum lzc_send_flags); extern int zfs_promote(zfs_handle_t *); extern int zfs_hold(zfs_handle_t *, const char *, const char *, Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Jul 15 04:53:34 2014 (r268649) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. @@ -45,6 +45,7 @@ #include #include +#include #include "zfs_namecheck.h" #include "zfs_prop.h" @@ -222,6 +223,7 @@ cksummer(void *arg) struct drr_object *drro = &thedrr.drr_u.drr_object; struct drr_write *drrw = &thedrr.drr_u.drr_write; struct drr_spill *drrs = &thedrr.drr_u.drr_spill; + struct drr_write_embedded *drrwe = &thedrr.drr_u.drr_write_embedded; FILE *ofp; int outfd; dmu_replay_record_t wbr_drr = {0}; @@ -418,6 +420,20 @@ cksummer(void *arg) break; } + case DRR_WRITE_EMBEDDED: + { + if (cksum_and_write(drr, sizeof (dmu_replay_record_t), + &stream_cksum, outfd) == -1) + goto out; + (void) ssread(buf, + P2ROUNDUP((uint64_t)drrwe->drr_psize, 8), ofp); + if (cksum_and_write(buf, + P2ROUNDUP((uint64_t)drrwe->drr_psize, 8), + &stream_cksum, outfd) == -1) + goto out; + break; + } + case DRR_FREE: { if (cksum_and_write(drr, sizeof (dmu_replay_record_t), @@ -799,7 +815,7 @@ typedef struct send_dump_data { char prevsnap[ZFS_MAXNAMELEN]; uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; - boolean_t verbose, dryrun, parsable, progress; + boolean_t verbose, dryrun, parsable, progress, embed_data; int outfd; boolean_t err; nvlist_t *fss; @@ -878,7 +894,8 @@ estimate_ioctl(zfs_handle_t *zhp, uint64 */ static int dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, uint64_t fromsnap_obj, - boolean_t fromorigin, int outfd, nvlist_t *debugnv) + boolean_t fromorigin, int outfd, enum lzc_send_flags flags, + nvlist_t *debugnv) { zfs_cmd_t zc = { 0 }; libzfs_handle_t *hdl = zhp->zfs_hdl; @@ -892,6 +909,7 @@ dump_ioctl(zfs_handle_t *zhp, const char zc.zc_obj = fromorigin; zc.zc_sendobj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID); zc.zc_fromobj = fromsnap_obj; + zc.zc_flags = flags; VERIFY(0 == nvlist_alloc(&thisdbg, NV_UNIQUE_NAME, 0)); if (fromsnap && fromsnap[0] != '\0') { @@ -1144,8 +1162,12 @@ dump_snapshot(zfs_handle_t *zhp, void *a } } + enum lzc_send_flags flags = 0; + if (sdd->embed_data) + flags |= LZC_SEND_FLAG_EMBED_DATA; + err = dump_ioctl(zhp, sdd->prevsnap, sdd->prevsnap_obj, - fromorigin, sdd->outfd, sdd->debugnv); + fromorigin, sdd->outfd, flags, sdd->debugnv); if (sdd->progress) { (void) pthread_cancel(tid); @@ -1489,6 +1511,7 @@ zfs_send(zfs_handle_t *zhp, const char * sdd.parsable = flags->parsable; sdd.progress = flags->progress; sdd.dryrun = flags->dryrun; + sdd.embed_data = flags->embed_data; sdd.filter_cb = filter_func; sdd.filter_cb_arg = cb_arg; if (debugnvp) @@ -1620,7 +1643,8 @@ err_out: } int -zfs_send_one(zfs_handle_t *zhp, const char *from, int fd) +zfs_send_one(zfs_handle_t *zhp, const char *from, int fd, + enum lzc_send_flags flags) { int err; libzfs_handle_t *hdl = zhp->zfs_hdl; @@ -1629,7 +1653,7 @@ zfs_send_one(zfs_handle_t *zhp, const ch (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "warning: cannot send '%s'"), zhp->zfs_name); - err = lzc_send(zhp->zfs_name, from, fd); + err = lzc_send(zhp->zfs_name, from, fd, flags); if (err != 0) { switch (errno) { case EXDEV: @@ -2576,6 +2600,16 @@ recv_skip(libzfs_handle_t *hdl, int fd, (void) recv_read(hdl, fd, buf, drr->drr_u.drr_spill.drr_length, B_FALSE, NULL); break; + case DRR_WRITE_EMBEDDED: + if (byteswap) { + drr->drr_u.drr_write_embedded.drr_psize = + BSWAP_32(drr->drr_u.drr_write_embedded. + drr_psize); + } + (void) recv_read(hdl, fd, buf, + P2ROUNDUP(drr->drr_u.drr_write_embedded.drr_psize, + 8), B_FALSE, NULL); + break; case DRR_WRITE_BYREF: case DRR_FREEOBJECTS: case DRR_FREE: Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Tue Jul 15 04:53:34 2014 (r268649) @@ -486,6 +486,8 @@ lzc_get_holds(const char *snapname, nvli } /* + * Generate a zfs send stream for the specified snapshot and write it to + * the specified file descriptor. * * "snapname" is the full name of the snapshot to send (e.g. "pool/fs@snap") * @@ -499,9 +501,15 @@ lzc_get_holds(const char *snapname, nvli * snapshot in the origin, etc. * * "fd" is the file descriptor to write the send stream to. + * + * If "flags" contains LZC_SEND_FLAG_EMBED_DATA, the stream is permitted + * to contain DRR_WRITE_EMBEDDED records with drr_etype==BP_EMBEDDED_TYPE_DATA, + * which the receiving system must support (as indicated by support + * for the "embedded_data" feature). */ int -lzc_send(const char *snapname, const char *from, int fd) +lzc_send(const char *snapname, const char *from, int fd, + enum lzc_send_flags flags) { nvlist_t *args; int err; @@ -510,6 +518,8 @@ lzc_send(const char *snapname, const cha fnvlist_add_int32(args, "fd", fd); if (from != NULL) fnvlist_add_string(args, "fromsnap", from); + if (flags & LZC_SEND_FLAG_EMBED_DATA) + fnvlist_add_boolean(args, "embedok"); err = lzc_ioctl(ZFS_IOC_SEND_NEW, snapname, args, NULL); nvlist_free(args); return (err); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Tue Jul 15 04:53:34 2014 (r268649) @@ -53,7 +53,11 @@ int lzc_hold(nvlist_t *, int, nvlist_t * int lzc_release(nvlist_t *, nvlist_t **); int lzc_get_holds(const char *, nvlist_t **); -int lzc_send(const char *, const char *, int); +enum lzc_send_flags { + LZC_SEND_FLAG_EMBED_DATA = 1 << 0 +}; + +int lzc_send(const char *, const char *, int, enum lzc_send_flags); int lzc_receive(const char *, nvlist_t *, const char *, boolean_t, int); int lzc_send_space(const char *, const char *, uint64_t *); Modified: stable/10/cddl/sbin/zpool/Makefile ============================================================================== --- stable/10/cddl/sbin/zpool/Makefile Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/sbin/zpool/Makefile Tue Jul 15 04:53:34 2014 (r268649) @@ -18,6 +18,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/cont CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libumem/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common Modified: stable/10/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zinject/Makefile Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/usr.bin/zinject/Makefile Tue Jul 15 04:53:34 2014 (r268649) @@ -11,6 +11,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs_core/common CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs Modified: stable/10/cddl/usr.sbin/zdb/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/zdb/Makefile Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/usr.sbin/zdb/Makefile Tue Jul 15 04:53:34 2014 (r268649) @@ -15,6 +15,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common Modified: stable/10/cddl/usr.sbin/zhack/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/zhack/Makefile Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/cddl/usr.sbin/zhack/Makefile Tue Jul 15 04:53:34 2014 (r268649) @@ -14,6 +14,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common Modified: stable/10/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/10/sys/boot/zfs/zfsimpl.c Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/sys/boot/zfs/zfsimpl.c Tue Jul 15 04:53:34 2014 (r268649) @@ -56,6 +56,7 @@ static const char *features_for_read[] = "org.illumos:lz4_compress", "com.delphix:hole_birth", "com.delphix:extensible_dataset", + "com.delphix:embedded_data", NULL }; @@ -1133,6 +1134,34 @@ zio_read(const spa_t *spa, const blkptr_ void *pbuf; int i, error; + /* + * Process data embedded in block pointer + */ + if (BP_IS_EMBEDDED(bp)) { + ASSERT(BPE_GET_ETYPE(bp) == BP_EMBEDDED_TYPE_DATA); + + size = BPE_GET_PSIZE(bp); + ASSERT(size <= BPE_PAYLOAD_SIZE); + + if (cpfunc != ZIO_COMPRESS_OFF) + pbuf = zfs_alloc(size); + else + pbuf = buf; + + decode_embedded_bp_compressed(bp, pbuf); + error = 0; + + if (cpfunc != ZIO_COMPRESS_OFF) { + error = zio_decompress_data(cpfunc, pbuf, + size, buf, BP_GET_LSIZE(bp)); + zfs_free(pbuf, size); + } + if (error != 0) + printf("ZFS: i/o error - unable to decompress block pointer data, error %d\n", + error); + return (error); + } + error = EIO; for (i = 0; i < SPA_DVAS_PER_BP; i++) { Modified: stable/10/sys/cddl/boot/zfs/README ============================================================================== --- stable/10/sys/cddl/boot/zfs/README Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/sys/cddl/boot/zfs/README Tue Jul 15 04:53:34 2014 (r268649) @@ -7,9 +7,10 @@ are used by the ZFS bootstrap: sha256.c checksum support lz4.c compression support lzjb.c compression support + blkptr.c ZFS embedded-data block pointers support zfssubr.c checksum, compression and raidz support zfsimpl.h mostly describing the physical layout -The files fletcher.c, lzjb.c and sha256.c are largely identical to the -ZFS base code (with write support removed) and could be shared but -that might complicate future imports from OpenSolaris. +The files fletcher.c, lzjb.c, lz4.c, sha256.c and blkptr.c are largely identical +to the ZFS base code (with write support removed) and could be shared but that +might complicate future imports from Illumos. Copied: stable/10/sys/cddl/boot/zfs/blkptr.c (from r268075, head/sys/cddl/boot/zfs/blkptr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/cddl/boot/zfs/blkptr.c Tue Jul 15 04:53:34 2014 (r268649, copy of r268075, head/sys/cddl/boot/zfs/blkptr.c) @@ -0,0 +1,73 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + +/* + * Embedded-data Block Pointers + * + * Normally, block pointers point (via their DVAs) to a block which holds data. + * If the data that we need to store is very small, this is an inefficient + * use of space, because a block must be at minimum 1 sector (typically 512 + * bytes or 4KB). Additionally, reading these small blocks tends to generate + * more random reads. + * + * Embedded-data Block Pointers allow small pieces of data (the "payload", + * up to 112 bytes) to be stored in the block pointer itself, instead of + * being pointed to. The "Pointer" part of this name is a bit of a + * misnomer, as nothing is pointed to. + * + * BP_EMBEDDED_TYPE_DATA block pointers allow highly-compressible data to + * be embedded in the block pointer. The logic for this is handled in + * the SPA, by the zio pipeline. Therefore most code outside the zio + * pipeline doesn't need special-cases to handle these block pointers. + * + * See spa.h for details on the exact layout of embedded block pointers. + */ + +/* + * buf must be at least BPE_GET_PSIZE(bp) bytes long (which will never be + * more than BPE_PAYLOAD_SIZE bytes). + */ +void +decode_embedded_bp_compressed(const blkptr_t *bp, void *buf) +{ + int psize; + uint8_t *buf8 = buf; + uint64_t w = 0; + const uint64_t *bp64 = (const uint64_t *)bp; + + ASSERT(BP_IS_EMBEDDED(bp)); + + psize = BPE_GET_PSIZE(bp); + + /* + * Decode the words of the block pointer into the byte array. + * Low bits of first word are the first byte (little endian). + */ + for (int i = 0; i < psize; i++) { + if (i % sizeof (w) == 0) { + /* beginning of a word */ + ASSERT3P(bp64, <, bp + 1); + w = *bp64; + bp64++; + if (!BPE_IS_PAYLOADWORD(bp, bp64)) + bp64++; + } + buf8[i] = BF64_GET(w, (i % sizeof (w)) * NBBY, NBBY); + } +} Modified: stable/10/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- stable/10/sys/cddl/boot/zfs/zfsimpl.h Tue Jul 15 04:44:06 2014 (r268648) +++ stable/10/sys/cddl/boot/zfs/zfsimpl.h Tue Jul 15 04:53:34 2014 (r268649) @@ -55,9 +55,14 @@ /* * Copyright 2013 by Saso Kiselkov. All rights reserved. */ +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 05:00:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6AB1AE1C; Tue, 15 Jul 2014 05:00: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 5443528F8; Tue, 15 Jul 2014 05:00: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 s6F50o4g022659; Tue, 15 Jul 2014 05:00:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F50kNZ022473; Tue, 15 Jul 2014 05:00:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150500.s6F50kNZ022473@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 05:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268650 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zf... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 05:00:50 -0000 Author: delphij Date: Tue Jul 15 05:00:46 2014 New Revision: 268650 URL: http://svnweb.freebsd.org/changeset/base/268650 Log: MFC r268079: MFV r267566: 4390 i/o errors when deleting filesystem/zvol can lead to space map corruption Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Jul 15 05:00:46 2014 (r268650) @@ -75,9 +75,9 @@ DMU_OT_ZAP_OTHER : DMU_OT_NUMTYPES)) #ifndef lint -extern int zfs_recover; +extern boolean_t zfs_recover; #else -int zfs_recover; +boolean_t zfs_recover; #endif const char cmdname[] = "zdb"; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Tue Jul 15 05:00:46 2014 (r268650) @@ -303,6 +303,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo case ZPOOL_PROP_ALLOCATED: case ZPOOL_PROP_FREE: case ZPOOL_PROP_FREEING: + case ZPOOL_PROP_LEAKED: case ZPOOL_PROP_EXPANDSZ: if (literal) { (void) snprintf(buf, len, "%llu", Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Tue Jul 15 05:00:46 2014 (r268650) @@ -81,6 +81,8 @@ zpool_prop_init(void) ZFS_TYPE_POOL, "", "FREE"); zprop_register_number(ZPOOL_PROP_FREEING, "freeing", 0, PROP_READONLY, ZFS_TYPE_POOL, "", "FREEING"); + zprop_register_number(ZPOOL_PROP_LEAKED, "leaked", 0, PROP_READONLY, + ZFS_TYPE_POOL, "", "LEAKED"); zprop_register_number(ZPOOL_PROP_ALLOCATED, "allocated", 0, PROP_READONLY, ZFS_TYPE_POOL, "", "ALLOC"); zprop_register_number(ZPOOL_PROP_EXPANDSZ, "expandsize", 0, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Tue Jul 15 05:00:46 2014 (r268650) @@ -102,13 +102,27 @@ bptree_free(objset_t *os, uint64_t obj, return (dmu_object_free(os, obj, tx)); } +boolean_t +bptree_is_empty(objset_t *os, uint64_t obj) +{ + dmu_buf_t *db; + bptree_phys_t *bt; + boolean_t rv; + + VERIFY0(dmu_bonus_hold(os, obj, FTAG, &db)); + bt = db->db_data; + rv = (bt->bt_begin == bt->bt_end); + dmu_buf_rele(db, FTAG); + return (rv); +} + void bptree_add(objset_t *os, uint64_t obj, blkptr_t *bp, uint64_t birth_txg, uint64_t bytes, uint64_t comp, uint64_t uncomp, dmu_tx_t *tx) { dmu_buf_t *db; bptree_phys_t *bt; - bptree_entry_phys_t bte; + bptree_entry_phys_t bte = { 0 }; /* * bptree objects are in the pool mos, therefore they can only be @@ -122,7 +136,6 @@ bptree_add(objset_t *os, uint64_t obj, b bte.be_birth_txg = birth_txg; bte.be_bp = *bp; - bzero(&bte.be_zb, sizeof (bte.be_zb)); dmu_write(os, obj, bt->bt_end * sizeof (bte), sizeof (bte), &bte, tx); dmu_buf_will_dirty(db, tx); @@ -153,10 +166,27 @@ bptree_visit_cb(spa_t *spa, zilog_t *zil return (err); } +/* + * If "free" is set: + * - It is assumed that "func" will be freeing the block pointers. + * - If "func" returns nonzero, the bookmark will be remembered and + * iteration will be restarted from this point on next invocation. + * - If an i/o error is encountered (e.g. "func" returns EIO or ECKSUM), + * bptree_iterate will remember the bookmark, continue traversing + * any additional entries, and return 0. + * + * If "free" is not set, traversal will stop and return an error if + * an i/o error is encountered. + * + * In either case, if zfs_free_leak_on_eio is set, i/o errors will be + * ignored and traversal will continue (i.e. TRAVERSE_HARD will be passed to + * traverse_dataset_destroyed()). + */ int bptree_iterate(objset_t *os, uint64_t obj, boolean_t free, bptree_itor_t func, void *arg, dmu_tx_t *tx) { + boolean_t ioerr = B_FALSE; int err; uint64_t i; dmu_buf_t *db; @@ -182,49 +212,82 @@ bptree_iterate(objset_t *os, uint64_t ob bptree_entry_phys_t bte; int flags = TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST; - ASSERT(!free || i == ba.ba_phys->bt_begin); - err = dmu_read(os, obj, i * sizeof (bte), sizeof (bte), &bte, DMU_READ_NO_PREFETCH); if (err != 0) break; - if (zfs_recover) + if (zfs_free_leak_on_eio) flags |= TRAVERSE_HARD; + zfs_dbgmsg("bptree index %d: traversing from min_txg=%lld " + "bookmark %lld/%lld/%lld/%lld", + i, (longlong_t)bte.be_birth_txg, + (longlong_t)bte.be_zb.zb_objset, + (longlong_t)bte.be_zb.zb_object, + (longlong_t)bte.be_zb.zb_level, + (longlong_t)bte.be_zb.zb_blkid); err = traverse_dataset_destroyed(os->os_spa, &bte.be_bp, bte.be_birth_txg, &bte.be_zb, flags, bptree_visit_cb, &ba); if (free) { - if (err == ERESTART) { + /* + * The callback has freed the visited block pointers. + * Record our traversal progress on disk, either by + * updating this record's bookmark, or by logically + * removing this record by advancing bt_begin. + */ + if (err != 0) { /* save bookmark for future resume */ ASSERT3U(bte.be_zb.zb_objset, ==, ZB_DESTROYED_OBJSET); ASSERT0(bte.be_zb.zb_level); dmu_write(os, obj, i * sizeof (bte), sizeof (bte), &bte, tx); - break; - } - if (err != 0) { + if (err == EIO || err == ECKSUM || + err == ENXIO) { + /* + * Skip the rest of this tree and + * continue on to the next entry. + */ + err = 0; + ioerr = B_TRUE; + } else { + break; + } + } else if (ioerr) { /* - * We can not properly handle an i/o - * error, because the traversal code - * does not know how to resume from an - * arbitrary bookmark. + * This entry is finished, but there were + * i/o errors on previous entries, so we + * can't adjust bt_begin. Set this entry's + * be_birth_txg such that it will be + * treated as a no-op in future traversals. */ - zfs_panic_recover("error %u from " - "traverse_dataset_destroyed()", err); + bte.be_birth_txg = UINT64_MAX; + dmu_write(os, obj, i * sizeof (bte), + sizeof (bte), &bte, tx); } - ba.ba_phys->bt_begin++; - (void) dmu_free_range(os, obj, - i * sizeof (bte), sizeof (bte), tx); + if (!ioerr) { + ba.ba_phys->bt_begin++; + (void) dmu_free_range(os, obj, + i * sizeof (bte), sizeof (bte), tx); + } + } else if (err != 0) { + break; } } - ASSERT(!free || err != 0 || ba.ba_phys->bt_begin == ba.ba_phys->bt_end); + ASSERT(!free || err != 0 || ioerr || + ba.ba_phys->bt_begin == ba.ba_phys->bt_end); /* if all blocks are free there should be no used space */ if (ba.ba_phys->bt_begin == ba.ba_phys->bt_end) { + if (zfs_free_leak_on_eio) { + ba.ba_phys->bt_bytes = 0; + ba.ba_phys->bt_comp = 0; + ba.ba_phys->bt_uncomp = 0; + } + ASSERT0(ba.ba_phys->bt_bytes); ASSERT0(ba.ba_phys->bt_comp); ASSERT0(ba.ba_phys->bt_uncomp); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Tue Jul 15 05:00:46 2014 (r268650) @@ -58,6 +58,7 @@ typedef struct traverse_data { zbookmark_t *td_resume; int td_flags; prefetch_data_t *td_pfd; + boolean_t td_paused; blkptr_cb_t *td_func; void *td_arg; } traverse_data_t; @@ -163,7 +164,6 @@ resume_skip_check(traverse_data_t *td, c * If we found the block we're trying to resume from, zero * the bookmark out to indicate that we have resumed. */ - ASSERT3U(zb->zb_object, <=, td->td_resume->zb_object); if (bcmp(zb, td->td_resume, sizeof (*zb)) == 0) { bzero(td->td_resume, sizeof (*zb)); if (td->td_flags & TRAVERSE_POST) @@ -174,14 +174,6 @@ resume_skip_check(traverse_data_t *td, c } static void -traverse_pause(traverse_data_t *td, const zbookmark_t *zb) -{ - ASSERT(td->td_resume != NULL); - ASSERT0(zb->zb_level); - bcopy(zb, td->td_resume, sizeof (*td->td_resume)); -} - -static void traverse_prefetch_metadata(traverse_data_t *td, const blkptr_t *bp, const zbookmark_t *zb) { @@ -210,11 +202,10 @@ traverse_visitbp(traverse_data_t *td, co const blkptr_t *bp, const zbookmark_t *zb) { zbookmark_t czb; - int err = 0, lasterr = 0; + int err = 0; arc_buf_t *buf = NULL; prefetch_data_t *pd = td->td_pfd; boolean_t hard = td->td_flags & TRAVERSE_HARD; - boolean_t pause = B_FALSE; switch (resume_skip_check(td, dnp, zb)) { case RESUME_SKIP_ALL: @@ -253,7 +244,9 @@ traverse_visitbp(traverse_data_t *td, co if (BP_IS_HOLE(bp)) { err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); - return (err); + if (err != 0) + goto post; + return (0); } if (pd && !pd->pd_exited && @@ -273,8 +266,6 @@ traverse_visitbp(traverse_data_t *td, co td->td_arg); if (err == TRAVERSE_VISIT_NO_CHILDREN) return (0); - if (err == ERESTART) - pause = B_TRUE; /* handle pausing at a common point */ if (err != 0) goto post; } @@ -288,7 +279,7 @@ traverse_visitbp(traverse_data_t *td, co err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err != 0) - return (err); + goto post; cbp = buf->b_data; for (i = 0; i < epb; i++) { @@ -304,11 +295,8 @@ traverse_visitbp(traverse_data_t *td, co zb->zb_level - 1, zb->zb_blkid * epb + i); err = traverse_visitbp(td, dnp, &cbp[i], &czb); - if (err != 0) { - if (!hard) - break; - lasterr = err; - } + if (err != 0) + break; } } else if (BP_GET_TYPE(bp) == DMU_OT_DNODE) { uint32_t flags = ARC_WAIT; @@ -318,7 +306,7 @@ traverse_visitbp(traverse_data_t *td, co err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err != 0) - return (err); + goto post; dnp = buf->b_data; for (i = 0; i < epb; i++) { @@ -330,11 +318,8 @@ traverse_visitbp(traverse_data_t *td, co for (i = 0; i < epb; i++) { err = traverse_dnode(td, &dnp[i], zb->zb_objset, zb->zb_blkid * epb + i); - if (err != 0) { - if (!hard) - break; - lasterr = err; - } + if (err != 0) + break; } } else if (BP_GET_TYPE(bp) == DMU_OT_OBJSET) { uint32_t flags = ARC_WAIT; @@ -344,7 +329,7 @@ traverse_visitbp(traverse_data_t *td, co err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err != 0) - return (err); + goto post; osp = buf->b_data; dnp = &osp->os_meta_dnode; @@ -359,19 +344,11 @@ traverse_visitbp(traverse_data_t *td, co err = traverse_dnode(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); - if (err && hard) { - lasterr = err; - err = 0; - } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { dnp = &osp->os_groupused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, DMU_GROUPUSED_OBJECT); } - if (err && hard) { - lasterr = err; - err = 0; - } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { dnp = &osp->os_userused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, @@ -383,19 +360,37 @@ traverse_visitbp(traverse_data_t *td, co (void) arc_buf_remove_ref(buf, &buf); post: - if (err == 0 && (td->td_flags & TRAVERSE_POST)) { + if (err == 0 && (td->td_flags & TRAVERSE_POST)) err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); - if (err == ERESTART) - pause = B_TRUE; + + if (hard && (err == EIO || err == ECKSUM)) { + /* + * Ignore this disk error as requested by the HARD flag, + * and continue traversal. + */ + err = 0; } - if (pause && td->td_resume != NULL) { - ASSERT3U(err, ==, ERESTART); - ASSERT(!hard); - traverse_pause(td, zb); + /* + * If we are stopping here, set td_resume. + */ + if (td->td_resume != NULL && err != 0 && !td->td_paused) { + td->td_resume->zb_objset = zb->zb_objset; + td->td_resume->zb_object = zb->zb_object; + td->td_resume->zb_level = 0; + /* + * If we have stopped on an indirect block (e.g. due to + * i/o error), we have not visited anything below it. + * Set the bookmark to the first level-0 block that we need + * to visit. This way, the resuming code does not need to + * deal with resuming from indirect blocks. + */ + td->td_resume->zb_blkid = zb->zb_blkid << + (zb->zb_level * (dnp->dn_indblkshift - SPA_BLKPTRSHIFT)); + td->td_paused = B_TRUE; } - return (err != 0 ? err : lasterr); + return (err); } static void @@ -420,30 +415,21 @@ static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp, uint64_t objset, uint64_t object) { - int j, err = 0, lasterr = 0; + int j, err = 0; zbookmark_t czb; - boolean_t hard = (td->td_flags & TRAVERSE_HARD); for (j = 0; j < dnp->dn_nblkptr; j++) { SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); err = traverse_visitbp(td, dnp, &dnp->dn_blkptr[j], &czb); - if (err != 0) { - if (!hard) - break; - lasterr = err; - } + if (err != 0) + break; } if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID); err = traverse_visitbp(td, dnp, &dnp->dn_spill, &czb); - if (err != 0) { - if (!hard) - return (err); - lasterr = err; - } } - return (err != 0 ? err : lasterr); + return (err); } /* ARGSUSED */ @@ -530,6 +516,7 @@ traverse_impl(spa_t *spa, dsl_dataset_t td.td_arg = arg; td.td_pfd = &pd; td.td_flags = flags; + td.td_paused = B_FALSE; pd.pd_blks_max = zfs_pd_blks_max; pd.pd_flags = flags; @@ -603,7 +590,7 @@ int traverse_pool(spa_t *spa, uint64_t txg_start, int flags, blkptr_cb_t func, void *arg) { - int err, lasterr = 0; + int err; uint64_t obj; dsl_pool_t *dp = spa_get_dsl(spa); objset_t *mos = dp->dp_meta_objset; @@ -616,16 +603,15 @@ traverse_pool(spa_t *spa, uint64_t txg_s return (err); /* visit each dataset */ - for (obj = 1; err == 0 || (err != ESRCH && hard); + for (obj = 1; err == 0; err = dmu_object_next(mos, &obj, FALSE, txg_start)) { dmu_object_info_t doi; err = dmu_object_info(mos, obj, &doi); if (err != 0) { - if (!hard) - return (err); - lasterr = err; - continue; + if (hard) + continue; + break; } if (doi.doi_bonus_type == DMU_OT_DSL_DATASET) { @@ -636,23 +622,19 @@ traverse_pool(spa_t *spa, uint64_t txg_s err = dsl_dataset_hold_obj(dp, obj, FTAG, &ds); dsl_pool_config_exit(dp, FTAG); if (err != 0) { - if (!hard) - return (err); - lasterr = err; - continue; + if (hard) + continue; + break; } if (ds->ds_phys->ds_prev_snap_txg > txg) txg = ds->ds_phys->ds_prev_snap_txg; err = traverse_dataset(ds, txg, flags, func, arg); dsl_dataset_rele(ds, FTAG); - if (err != 0) { - if (!hard) - return (err); - lasterr = err; - } + if (err != 0) + break; } } if (err == ESRCH) err = 0; - return (err != 0 ? err : lasterr); + return (err); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Tue Jul 15 05:00:46 2014 (r268650) @@ -278,6 +278,13 @@ dsl_pool_open(dsl_pool_t *dp) dp->dp_meta_objset, obj)); } + /* + * Note: errors ignored, because the leak dir will not exist if we + * have not encountered a leak yet. + */ + (void) dsl_pool_open_special_dir(dp, LEAK_DIR_NAME, + &dp->dp_leak_dir); + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) { err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1, @@ -325,6 +332,8 @@ dsl_pool_close(dsl_pool_t *dp) dsl_dir_rele(dp->dp_mos_dir, dp); if (dp->dp_free_dir) dsl_dir_rele(dp->dp_free_dir, dp); + if (dp->dp_leak_dir) + dsl_dir_rele(dp->dp_leak_dir, dp); if (dp->dp_root_dir) dsl_dir_rele(dp->dp_root_dir, dp); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Tue Jul 15 05:00:46 2014 (r268650) @@ -52,9 +52,7 @@ typedef int (scan_cb_t)(dsl_pool_t *, const blkptr_t *, const zbookmark_t *); -static scan_cb_t dsl_scan_defrag_cb; static scan_cb_t dsl_scan_scrub_cb; -static scan_cb_t dsl_scan_remove_cb; static void dsl_scan_cancel_sync(void *, dmu_tx_t *); static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *tx); @@ -68,7 +66,7 @@ unsigned int zfs_free_min_time_ms = 1000 unsigned int zfs_resilver_min_time_ms = 3000; /* min millisecs to resilver per txg */ boolean_t zfs_no_scrub_io = B_FALSE; /* set to disable scrub i/o */ -boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable srub prefetching */ +boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable scrub prefetch */ SYSCTL_DECL(_vfs_zfs); TUNABLE_INT("vfs.zfs.top_maxinflight", &zfs_top_maxinflight); @@ -1389,7 +1387,7 @@ dsl_scan_active(dsl_scan_t *scn) if (spa_shutting_down(spa)) return (B_FALSE); if (scn->scn_phys.scn_state == DSS_SCANNING || - scn->scn_async_destroying) + (scn->scn_async_destroying && !scn->scn_async_stalled)) return (B_TRUE); if (spa_version(scn->scn_dp->dp_spa) >= SPA_VERSION_DEADLISTS) { @@ -1404,7 +1402,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * { dsl_scan_t *scn = dp->dp_scan; spa_t *spa = dp->dp_spa; - int err; + int err = 0; /* * Check for scn_restart_txg before checking spa_load_state, so @@ -1422,7 +1420,10 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * dsl_scan_setup_sync(&func, tx); } - if (!dsl_scan_active(scn) || + /* + * If the scan is inactive due to a stalled async destroy, try again. + */ + if ((!scn->scn_async_stalled && !dsl_scan_active(scn)) || spa_sync_pass(dp->dp_spa) > 1) return; @@ -1432,10 +1433,11 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * spa->spa_scrub_active = B_TRUE; /* - * First process the free list. If we pause the free, don't do - * any scanning. This ensures that there is no free list when - * we are scanning, so the scan code doesn't have to worry about - * traversing it. + * First process the async destroys. If we pause, don't do + * any scrubbing or resilvering. This ensures that there are no + * async destroys while we are scanning, so the scan code doesn't + * have to worry about traversing it. It is also faster to free the + * blocks than to scrub them. */ if (spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) { scn->scn_is_bptree = B_FALSE; @@ -1445,48 +1447,92 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * dsl_scan_free_block_cb, scn, tx); VERIFY3U(0, ==, zio_wait(scn->scn_zio_root)); - if (err == 0 && spa_feature_is_active(spa, - SPA_FEATURE_ASYNC_DESTROY)) { - ASSERT(scn->scn_async_destroying); - scn->scn_is_bptree = B_TRUE; - scn->scn_zio_root = zio_root(dp->dp_spa, NULL, - NULL, ZIO_FLAG_MUSTSUCCEED); - err = bptree_iterate(dp->dp_meta_objset, - dp->dp_bptree_obj, B_TRUE, dsl_scan_free_block_cb, - scn, tx); - VERIFY0(zio_wait(scn->scn_zio_root)); - - if (err == 0) { - /* finished; deactivate async destroy feature */ - spa_feature_decr(spa, SPA_FEATURE_ASYNC_DESTROY, - tx); - ASSERT(!spa_feature_is_active(spa, - SPA_FEATURE_ASYNC_DESTROY)); - VERIFY0(zap_remove(dp->dp_meta_objset, - DMU_POOL_DIRECTORY_OBJECT, - DMU_POOL_BPTREE_OBJ, tx)); - VERIFY0(bptree_free(dp->dp_meta_objset, - dp->dp_bptree_obj, tx)); - dp->dp_bptree_obj = 0; - scn->scn_async_destroying = B_FALSE; - } - } - if (scn->scn_visited_this_txg) { - zfs_dbgmsg("freed %llu blocks in %llums from " - "free_bpobj/bptree txg %llu", - (longlong_t)scn->scn_visited_this_txg, - (longlong_t) - NSEC2MSEC(gethrtime() - scn->scn_sync_start_time), - (longlong_t)tx->tx_txg); - scn->scn_visited_this_txg = 0; - /* - * Re-sync the ddt so that we can further modify - * it when doing bprewrite. - */ - ddt_sync(spa, tx->tx_txg); + if (err != 0 && err != ERESTART) + zfs_panic_recover("error %u from bpobj_iterate()", err); + } + + if (err == 0 && spa_feature_is_active(spa, SPA_FEATURE_ASYNC_DESTROY)) { + ASSERT(scn->scn_async_destroying); + scn->scn_is_bptree = B_TRUE; + scn->scn_zio_root = zio_root(dp->dp_spa, NULL, + NULL, ZIO_FLAG_MUSTSUCCEED); + err = bptree_iterate(dp->dp_meta_objset, + dp->dp_bptree_obj, B_TRUE, dsl_scan_free_block_cb, scn, tx); + VERIFY0(zio_wait(scn->scn_zio_root)); + + if (err == EIO || err == ECKSUM) { + err = 0; + } else if (err != 0 && err != ERESTART) { + zfs_panic_recover("error %u from " + "traverse_dataset_destroyed()", err); } - if (err == ERESTART) - return; + + /* + * If we didn't make progress, mark the async destroy as + * stalled, so that we will not initiate a spa_sync() on + * its behalf. + */ + scn->scn_async_stalled = (scn->scn_visited_this_txg == 0); + + if (bptree_is_empty(dp->dp_meta_objset, dp->dp_bptree_obj)) { + /* finished; deactivate async destroy feature */ + spa_feature_decr(spa, SPA_FEATURE_ASYNC_DESTROY, tx); + ASSERT(!spa_feature_is_active(spa, + SPA_FEATURE_ASYNC_DESTROY)); + VERIFY0(zap_remove(dp->dp_meta_objset, + DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_BPTREE_OBJ, tx)); + VERIFY0(bptree_free(dp->dp_meta_objset, + dp->dp_bptree_obj, tx)); + dp->dp_bptree_obj = 0; + scn->scn_async_destroying = B_FALSE; + } + } + if (scn->scn_visited_this_txg) { + zfs_dbgmsg("freed %llu blocks in %llums from " + "free_bpobj/bptree txg %llu; err=%u", + (longlong_t)scn->scn_visited_this_txg, + (longlong_t) + NSEC2MSEC(gethrtime() - scn->scn_sync_start_time), + (longlong_t)tx->tx_txg, err); + scn->scn_visited_this_txg = 0; + + /* + * Write out changes to the DDT that may be required as a + * result of the blocks freed. This ensures that the DDT + * is clean when a scrub/resilver runs. + */ + ddt_sync(spa, tx->tx_txg); + } + if (err != 0) + return; + if (!scn->scn_async_destroying && zfs_free_leak_on_eio && + (dp->dp_free_dir->dd_phys->dd_used_bytes != 0 || + dp->dp_free_dir->dd_phys->dd_compressed_bytes != 0 || + dp->dp_free_dir->dd_phys->dd_uncompressed_bytes != 0)) { + /* + * We have finished background destroying, but there is still + * some space left in the dp_free_dir. Transfer this leaked + * space to the dp_leak_dir. + */ + if (dp->dp_leak_dir == NULL) { + rrw_enter(&dp->dp_config_rwlock, RW_WRITER, FTAG); + (void) dsl_dir_create_sync(dp, dp->dp_root_dir, + LEAK_DIR_NAME, tx); + VERIFY0(dsl_pool_open_special_dir(dp, + LEAK_DIR_NAME, &dp->dp_leak_dir)); + rrw_exit(&dp->dp_config_rwlock, FTAG); + } + dsl_dir_diduse_space(dp->dp_leak_dir, DD_USED_HEAD, + dp->dp_free_dir->dd_phys->dd_used_bytes, + dp->dp_free_dir->dd_phys->dd_compressed_bytes, + dp->dp_free_dir->dd_phys->dd_uncompressed_bytes, tx); + dsl_dir_diduse_space(dp->dp_free_dir, DD_USED_HEAD, + -dp->dp_free_dir->dd_phys->dd_used_bytes, + -dp->dp_free_dir->dd_phys->dd_compressed_bytes, + -dp->dp_free_dir->dd_phys->dd_uncompressed_bytes, tx); + } + if (!scn->scn_async_destroying) { /* finished; verify that space accounting went to zero */ ASSERT0(dp->dp_free_dir->dd_phys->dd_used_bytes); ASSERT0(dp->dp_free_dir->dd_phys->dd_compressed_bytes); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jul 15 05:00:46 2014 (r268650) @@ -258,19 +258,25 @@ spa_prop_get_config(spa_t *spa, nvlist_t } if (pool != NULL) { - dsl_dir_t *freedir = pool->dp_free_dir; - /* * The $FREE directory was introduced in SPA_VERSION_DEADLISTS, * when opening pools before this version freedir will be NULL. */ - if (freedir != NULL) { + if (pool->dp_free_dir != NULL) { spa_prop_add_list(*nvp, ZPOOL_PROP_FREEING, NULL, - freedir->dd_phys->dd_used_bytes, src); + pool->dp_free_dir->dd_phys->dd_used_bytes, src); } else { spa_prop_add_list(*nvp, ZPOOL_PROP_FREEING, NULL, 0, src); } + + if (pool->dp_leak_dir != NULL) { + spa_prop_add_list(*nvp, ZPOOL_PROP_LEAKED, NULL, + pool->dp_leak_dir->dd_phys->dd_used_bytes, src); + } else { + spa_prop_add_list(*nvp, ZPOOL_PROP_LEAKED, + NULL, 0, src); + } } spa_prop_add_list(*nvp, ZPOOL_PROP_GUID, NULL, spa_guid(spa), src); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Jul 15 05:00:46 2014 (r268650) @@ -255,13 +255,44 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, * This should only be used as a last resort, as it typically results * in leaked space, or worse. */ -int zfs_recover = 0; +boolean_t zfs_recover = B_FALSE; SYSCTL_DECL(_vfs_zfs); TUNABLE_INT("vfs.zfs.recover", &zfs_recover); SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, "Try to recover from otherwise-fatal errors."); /* + * If destroy encounters an EIO while reading metadata (e.g. indirect + * blocks), space referenced by the missing metadata can not be freed. + * Normally this causes the background destroy to become "stalled", as + * it is unable to make forward progress. While in this stalled state, + * all remaining space to free from the error-encountering filesystem is + * "temporarily leaked". Set this flag to cause it to ignore the EIO, + * permanently leak the space from indirect blocks that can not be read, + * and continue to free everything else that it can. + * + * The default, "stalling" behavior is useful if the storage partially + * fails (i.e. some but not all i/os fail), and then later recovers. In + * this case, we will be able to continue pool operations while it is + * partially failed, and when it recovers, we can continue to free the + * space, with no leaks. However, note that this case is actually + * fairly rare. + * + * Typically pools either (a) fail completely (but perhaps temporarily, + * e.g. a top-level vdev going offline), or (b) have localized, + * permanent errors (e.g. disk returns the wrong data due to bit flip or + * firmware bug). In case (a), this setting does not matter because the + * pool will be suspended and the sync thread will not be able to make + * forward progress regardless. In case (b), because the error is + * permanent, the best we can do is leak the minimum amount of space, + * which is what setting this flag will do. Therefore, it is reasonable + * for this flag to normally be set, but we chose the more conservative + * approach of not setting it, so that there is no possibility of + * leaking space in the "partial temporary" failure case. + */ +boolean_t zfs_free_leak_on_eio = B_FALSE; + +/* * Expiration time in milliseconds. This value has two meanings. First it is * used to determine when the spa_deadman() logic should fire. By default the * spa_deadman() will fire if spa_sync() has not completed in 1000 seconds. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h Tue Jul 15 05:00:46 2014 (r268650) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_BPTREE_H @@ -50,6 +50,7 @@ typedef int bptree_itor_t(void *arg, con uint64_t bptree_alloc(objset_t *os, dmu_tx_t *tx); int bptree_free(objset_t *os, uint64_t obj, dmu_tx_t *tx); +boolean_t bptree_is_empty(objset_t *os, uint64_t obj); void bptree_add(objset_t *os, uint64_t obj, blkptr_t *bp, uint64_t birth_txg, uint64_t bytes, uint64_t comp, uint64_t uncomp, dmu_tx_t *tx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Jul 15 05:00:46 2014 (r268650) @@ -253,7 +253,6 @@ void zfs_znode_byteswap(void *buf, size_ #define DMU_USERUSED_OBJECT (-1ULL) #define DMU_GROUPUSED_OBJECT (-2ULL) -#define DMU_DEADLIST_OBJECT (-3ULL) /* * artificial blkids for bonus buffer and spill blocks Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h Tue Jul 15 05:00:46 2014 (r268650) @@ -160,6 +160,7 @@ boolean_t dsl_dir_is_zapified(dsl_dir_t #define ORIGIN_DIR_NAME "$ORIGIN" #define XLATION_DIR_NAME "$XLATION" #define FREE_DIR_NAME "$FREE" +#define LEAK_DIR_NAME "$LEAK" #ifdef ZFS_DEBUG #define dprintf_dd(dd, fmt, ...) do { \ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Tue Jul 15 05:00:46 2014 (r268650) @@ -84,6 +84,7 @@ typedef struct dsl_pool { struct dsl_dir *dp_root_dir; struct dsl_dir *dp_mos_dir; struct dsl_dir *dp_free_dir; + struct dsl_dir *dp_leak_dir; struct dsl_dataset *dp_origin_snap; uint64_t dp_root_dir_obj; struct taskq *dp_vnrele_taskq; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Tue Jul 15 05:00:46 2014 (r268650) @@ -114,6 +114,7 @@ typedef struct dsl_scan { /* for freeing blocks */ boolean_t scn_is_bptree; boolean_t scn_async_destroying; + boolean_t scn_async_stalled; /* for debugging / information */ uint64_t scn_visited_this_txg; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Tue Jul 15 05:00:46 2014 (r268650) @@ -49,7 +49,8 @@ extern "C" { #endif extern int zfs_flags; -extern int zfs_recover; +extern boolean_t zfs_recover; +extern boolean_t zfs_free_leak_on_eio; #define ZFS_DEBUG_DPRINTF (1<<0) #define ZFS_DEBUG_DBUF_VERIFY (1<<1) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Tue Jul 15 05:00:46 2014 (r268650) @@ -28,7 +28,7 @@ list_t zfs_dbgmsgs; int zfs_dbgmsg_size; kmutex_t zfs_dbgmsgs_lock; -int zfs_dbgmsg_maxsize = 1<<20; /* 1MB */ +int zfs_dbgmsg_maxsize = 4<<20; /* 4MB */ void zfs_dbgmsg_init(void) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Jul 15 05:00:46 2014 (r268650) @@ -3367,13 +3367,6 @@ zbookmark_is_before(const dnode_phys_t * ASSERT(zb1->zb_objset == zb2->zb_objset); ASSERT(zb2->zb_level == 0); - /* - * A bookmark in the deadlist is considered to be after - * everything else. - */ - if (zb2->zb_object == DMU_DEADLIST_OBJECT) - return (B_TRUE); - /* The objset_phys_t isn't before anything. */ if (dnp == NULL) return (B_FALSE); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Jul 15 04:53:34 2014 (r268649) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Jul 15 05:00:46 2014 (r268650) @@ -193,6 +193,7 @@ typedef enum { ZPOOL_PROP_COMMENT, ZPOOL_PROP_EXPANDSZ, ZPOOL_PROP_FREEING, + ZPOOL_PROP_LEAKED, ZPOOL_NUM_PROPS } zpool_prop_t; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 05:12:17 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1F89C376; Tue, 15 Jul 2014 05:12: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 E78AC2A5C; Tue, 15 Jul 2014 05:12: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 s6F5CGMr030697; Tue, 15 Jul 2014 05:12:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F5CGoq030696; Tue, 15 Jul 2014 05:12:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150512.s6F5CGoq030696@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 05:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268651 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 05:12:17 -0000 Author: delphij Date: Tue Jul 15 05:12:16 2014 New Revision: 268651 URL: http://svnweb.freebsd.org/changeset/base/268651 Log: MFC r268082: MFV r267567: 4881 zfs send performance degradation when embedded block pointers are encountered Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Tue Jul 15 05:00:46 2014 (r268650) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Tue Jul 15 05:12:16 2014 (r268651) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -197,6 +197,16 @@ traverse_prefetch_metadata(traverse_data ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); } +static boolean_t +prefetch_needed(prefetch_data_t *pfd, const blkptr_t *bp) +{ + ASSERT(pfd->pd_flags & TRAVERSE_PREFETCH_DATA); + if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp) || + BP_GET_TYPE(bp) == DMU_OT_INTENT_LOG) + return (B_FALSE); + return (B_TRUE); +} + static int traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp, const blkptr_t *bp, const zbookmark_t *zb) @@ -242,16 +252,7 @@ traverse_visitbp(traverse_data_t *td, co return (0); } - if (BP_IS_HOLE(bp)) { - err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); - if (err != 0) - goto post; - return (0); - } - - if (pd && !pd->pd_exited && - ((pd->pd_flags & TRAVERSE_PREFETCH_DATA) || - BP_GET_TYPE(bp) == DMU_OT_DNODE || BP_GET_LEVEL(bp) > 0)) { + if (pd != NULL && !pd->pd_exited && prefetch_needed(pd, bp)) { mutex_enter(&pd->pd_mtx); ASSERT(pd->pd_blks_fetched >= 0); while (pd->pd_blks_fetched == 0 && !pd->pd_exited) @@ -261,6 +262,13 @@ traverse_visitbp(traverse_data_t *td, co mutex_exit(&pd->pd_mtx); } + if (BP_IS_HOLE(bp)) { + err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); + if (err != 0) + goto post; + return (0); + } + if (td->td_flags & TRAVERSE_PRE) { err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); @@ -444,10 +452,7 @@ traverse_prefetcher(spa_t *spa, zilog_t if (pfd->pd_cancel) return (SET_ERROR(EINTR)); - if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp) || - !((pfd->pd_flags & TRAVERSE_PREFETCH_DATA) || - BP_GET_TYPE(bp) == DMU_OT_DNODE || BP_GET_LEVEL(bp) > 0) || - BP_GET_TYPE(bp) == DMU_OT_INTENT_LOG) + if (!prefetch_needed(pfd, bp)) return (0); mutex_enter(&pfd->pd_mtx); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 05:28:59 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A504B9CA; Tue, 15 Jul 2014 05:28: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 8F39A2B43; Tue, 15 Jul 2014 05:28: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 s6F5Sxce036690; Tue, 15 Jul 2014 05:28:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F5SwYC036686; Tue, 15 Jul 2014 05:28:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150528.s6F5SwYC036686@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 05:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268653 - in stable/10/cddl/contrib/opensolaris: cmd/zdb lib/libzpool/common lib/libzpool/common/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 05:28:59 -0000 Author: delphij Date: Tue Jul 15 05:28:58 2014 New Revision: 268653 URL: http://svnweb.freebsd.org/changeset/base/268653 Log: MFC r268084: MFV r267568: 4891 want zdb option to dump all metadata Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Tue Jul 15 05:16:00 2014 (r268652) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Tue Jul 15 05:28:58 2014 (r268653) @@ -14,12 +14,12 @@ .\" .\" Copyright 2012, Richard Lowe. .\" Copyright (c) 2012, Marcelo Araujo . -.\" Copyright (c) 2012 by Delphix. All rights reserved. +.\" Copyright (c) 2012, 2014 by Delphix. All rights reserved. .\" All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd March 20, 2014 +.Dd July 1, 2014 .Dt ZDB 8 .Os .Sh NAME @@ -32,6 +32,7 @@ .Op Fl t Ar txg .Op Fl U Ar cache .Op Fl M Ar inflight I/Os +.Op Fl x Ar dumpdir .Ar poolname .Op Ar object ... .Nm @@ -217,6 +218,14 @@ Operate on an exported pool, not present The .Fl p flag specifies the path under which devices are to be searched. +.It Fl x Ar dumpdir +All blocks accessed will be copied to files in the specified directory. +The blocks will be placed in sparse files whose name is the same as +that of the file or device read. zdb can be then run on the generated files. +Note that the +.Fl bbc +flags are sufficient to access (and thus copy) +all metadata on the pool. .It Fl F Attempt to make an unreadable pool readable by trying progressively older transactions. Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Jul 15 05:16:00 2014 (r268652) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Jul 15 05:28:58 2014 (r268653) @@ -112,7 +112,7 @@ usage(void) { (void) fprintf(stderr, "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " - "[-U config] [-M inflight I/Os] poolname [object...]\n" + "[-U config] [-M 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] " @@ -150,7 +150,7 @@ usage(void) (void) fprintf(stderr, " -R read and display block from a " "device\n\n"); (void) fprintf(stderr, " Below options are intended for use " - "with other options (except -l):\n"); + "with other options:\n"); (void) fprintf(stderr, " -A ignore assertions (-A), enable " "panic recovery (-AA) or both (-AAA)\n"); (void) fprintf(stderr, " -F attempt automatic rewind within " @@ -163,11 +163,14 @@ usage(void) "has altroot/not in a cachefile\n"); (void) fprintf(stderr, " -p -- use one or more with " "-e to specify path to vdev dir\n"); - (void) fprintf(stderr, " -P print numbers in parseable form\n"); + (void) fprintf(stderr, " -x -- " + "dump all read blocks into specified directory\n"); + (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 -- " - "specify the maximum number of checksumming I/Os [default is 200]"); + "specify the maximum number of " + "checksumming I/Os [default is 200]\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -3355,7 +3358,8 @@ main(int argc, char **argv) dprintf_setup(&argc, argv); - while ((c = getopt(argc, argv, "bcdhilmM:suCDRSAFLXevp:t:U:P")) != -1) { + while ((c = getopt(argc, argv, + "bcdhilmM:suCDRSAFLXx:evp:t:U:P")) != -1) { switch (c) { case 'b': case 'c': @@ -3408,6 +3412,9 @@ 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) { Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Tue Jul 15 05:16:00 2014 (r268652) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Tue Jul 15 05:28:58 2014 (r268653) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -52,6 +53,9 @@ char hw_serial[HW_HOSTID_LEN]; kmutex_t cpu_lock; #endif +/* If set, all blocks read will be copied to the specified directory. */ +char *vn_dumpdir = NULL; + struct utsname utsname = { "userland", "libzpool", "1", "1", "na" }; @@ -415,6 +419,7 @@ int vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3) { int fd; + int dump_fd; vnode_t *vp; int old_umask; char realpath[MAXPATHLEN]; @@ -463,6 +468,17 @@ vn_open(char *path, int x1, int flags, i if (flags & FCREAT) (void) umask(old_umask); + if (vn_dumpdir != NULL) { + char dumppath[MAXPATHLEN]; + (void) snprintf(dumppath, sizeof (dumppath), + "%s/%s", vn_dumpdir, basename(realpath)); + dump_fd = open64(dumppath, O_CREAT | O_WRONLY, 0666); + if (dump_fd == -1) + return (errno); + } else { + dump_fd = -1; + } + if (fd == -1) return (errno); @@ -478,6 +494,7 @@ vn_open(char *path, int x1, int flags, i vp->v_fd = fd; vp->v_size = st.st_size; vp->v_path = spa_strdup(path); + vp->v_dump_fd = dump_fd; return (0); } @@ -510,6 +527,11 @@ vn_rdwr(int uio, vnode_t *vp, void *addr if (uio == UIO_READ) { iolen = pread64(vp->v_fd, addr, len, offset); + if (vp->v_dump_fd != -1) { + int status = + pwrite64(vp->v_dump_fd, addr, iolen, offset); + ASSERT(status != -1); + } } else { /* * To simulate partial disk writes, we split writes into two @@ -536,6 +558,8 @@ void vn_close(vnode_t *vp, int openflag, cred_t *cr, kthread_t *td) { close(vp->v_fd); + if (vp->v_dump_fd != -1) + close(vp->v_dump_fd); spa_strfree(vp->v_path); umem_free(vp, sizeof (vnode_t)); } Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Tue Jul 15 05:16:00 2014 (r268652) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Tue Jul 15 05:28:58 2014 (r268653) @@ -424,8 +424,10 @@ typedef struct vnode { uint64_t v_size; int v_fd; char *v_path; + int v_dump_fd; } vnode_t; +extern char *vn_dumpdir; #define AV_SCANSTAMP_SZ 32 /* length of anti-virus scanstamp */ typedef struct xoptattr { From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 05:32:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 EE257B1C; Tue, 15 Jul 2014 05:32: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 DA9CE2BC1; Tue, 15 Jul 2014 05:32: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 s6F5WrPG040436; Tue, 15 Jul 2014 05:32:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F5WrkQ040435; Tue, 15 Jul 2014 05:32:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150532.s6F5WrkQ040435@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 05:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268654 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 05:32:54 -0000 Author: delphij Date: Tue Jul 15 05:32:53 2014 New Revision: 268654 URL: http://svnweb.freebsd.org/changeset/base/268654 Log: MFC r268085: MFV r267569: 4897 Space accounting mismatch in L2ARC/zpool Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Jul 15 05:28:58 2014 (r268653) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Jul 15 05:32:53 2014 (r268654) @@ -22,7 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ /* @@ -1748,6 +1748,8 @@ arc_hdr_destroy(arc_buf_hdr_t *hdr) list_remove(l2hdr->b_dev->l2ad_buflist, hdr); ARCSTAT_INCR(arcstat_l2_size, -hdr->b_size); ARCSTAT_INCR(arcstat_l2_asize, -l2hdr->b_asize); + vdev_space_update(l2hdr->b_dev->l2ad_vdev, + -l2hdr->b_asize, 0, 0); kmem_free(l2hdr, sizeof (l2arc_buf_hdr_t)); if (hdr->b_state == arc_l2c_only) l2arc_hdr_stat_remove(); @@ -3701,6 +3703,8 @@ arc_release(arc_buf_t *buf, void *tag) if (l2hdr) { ARCSTAT_INCR(arcstat_l2_asize, -l2hdr->b_asize); + vdev_space_update(l2hdr->b_dev->l2ad_vdev, + -l2hdr->b_asize, 0, 0); trim_map_free(l2hdr->b_dev->l2ad_vdev, l2hdr->b_daddr, hdr->b_size, 0); kmem_free(l2hdr, sizeof (l2arc_buf_hdr_t)); @@ -4602,6 +4606,7 @@ l2arc_write_done(zio_t *zio) arc_buf_hdr_t *head, *ab, *ab_prev; l2arc_buf_hdr_t *abl2; kmutex_t *hash_lock; + int64_t bytes_dropped = 0; cb = zio->io_private; ASSERT(cb != NULL); @@ -4649,6 +4654,7 @@ l2arc_write_done(zio_t *zio) */ list_remove(buflist, ab); ARCSTAT_INCR(arcstat_l2_asize, -abl2->b_asize); + bytes_dropped += abl2->b_asize; ab->b_l2hdr = NULL; trim_map_free(abl2->b_dev->l2ad_vdev, abl2->b_daddr, ab->b_size, 0); @@ -4669,6 +4675,8 @@ l2arc_write_done(zio_t *zio) kmem_cache_free(hdr_cache, head); mutex_exit(&l2arc_buflist_mtx); + vdev_space_update(dev->l2ad_vdev, -bytes_dropped, 0, 0); + l2arc_do_free_on_write(); kmem_free(cb, sizeof (l2arc_write_callback_t)); @@ -4808,6 +4816,7 @@ l2arc_evict(l2arc_dev_t *dev, uint64_t d arc_buf_hdr_t *ab, *ab_prev; kmutex_t *hash_lock; uint64_t taddr; + int64_t bytes_evicted = 0; buflist = dev->l2ad_buflist; @@ -4906,6 +4915,7 @@ top: if (ab->b_l2hdr != NULL) { abl2 = ab->b_l2hdr; ARCSTAT_INCR(arcstat_l2_asize, -abl2->b_asize); + bytes_evicted += abl2->b_asize; ab->b_l2hdr = NULL; kmem_free(abl2, sizeof (l2arc_buf_hdr_t)); ARCSTAT_INCR(arcstat_l2_size, -ab->b_size); @@ -4922,7 +4932,7 @@ top: } mutex_exit(&l2arc_buflist_mtx); - vdev_space_update(dev->l2ad_vdev, -(taddr - dev->l2ad_evict), 0, 0); + vdev_space_update(dev->l2ad_vdev, -bytes_evicted, 0, 0); dev->l2ad_evict = taddr; } @@ -5175,15 +5185,13 @@ l2arc_write_buffers(spa_t *spa, l2arc_de ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize); ARCSTAT_INCR(arcstat_l2_size, write_sz); ARCSTAT_INCR(arcstat_l2_asize, write_asize); - vdev_space_update(dev->l2ad_vdev, write_psize, 0, 0); + vdev_space_update(dev->l2ad_vdev, write_asize, 0, 0); /* * Bump device hand to the device start if it is approaching the end. * l2arc_evict() will already have evicted ahead for this case. */ if (dev->l2ad_hand >= (dev->l2ad_end - target_sz)) { - vdev_space_update(dev->l2ad_vdev, - dev->l2ad_end - dev->l2ad_hand, 0, 0); dev->l2ad_hand = dev->l2ad_start; dev->l2ad_evict = dev->l2ad_start; dev->l2ad_first = B_FALSE; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 05:36:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 D26F8DAF; Tue, 15 Jul 2014 05:36: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 BE39B2BD9; Tue, 15 Jul 2014 05:36: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 s6F5aQZY041162; Tue, 15 Jul 2014 05:36:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F5aQnk041160; Tue, 15 Jul 2014 05:36:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150536.s6F5aQnk041160@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 05:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268656 - in stable/10: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 05:36:27 -0000 Author: delphij Date: Tue Jul 15 05:36:26 2014 New Revision: 268656 URL: http://svnweb.freebsd.org/changeset/base/268656 Log: MFC r268086: MFV r267570: 4756 metaslab_group_preload() could deadlock Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Jul 15 05:34:27 2014 (r268655) +++ stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Jul 15 05:36:26 2014 (r268656) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -187,6 +187,7 @@ static const ztest_shared_opts_t ztest_o extern uint64_t metaslab_gang_bang; extern uint64_t metaslab_df_alloc_threshold; extern uint64_t zfs_deadman_synctime_ms; +extern int metaslab_preload_limit; static ztest_shared_opts_t *ztest_shared_opts; static ztest_shared_opts_t ztest_opts; @@ -5596,6 +5597,7 @@ ztest_run(ztest_shared_t *zs) kernel_init(FREAD | FWRITE); VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG)); spa->spa_debug = B_TRUE; + metaslab_preload_limit = ztest_random(20) + 1; ztest_spa = spa; VERIFY0(dmu_objset_own(ztest_opts.zo_pool, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Jul 15 05:34:27 2014 (r268655) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Jul 15 05:36:26 2014 (r268656) @@ -1299,6 +1299,8 @@ metaslab_preload(void *arg) metaslab_t *msp = arg; spa_t *spa = msp->ms_group->mg_vd->vdev_spa; + ASSERT(!MUTEX_HELD(&msp->ms_group->mg_lock)); + mutex_enter(&msp->ms_lock); metaslab_load_wait(msp); if (!msp->ms_loaded) @@ -1323,19 +1325,36 @@ metaslab_group_preload(metaslab_group_t taskq_wait(mg->mg_taskq); return; } - mutex_enter(&mg->mg_lock); + mutex_enter(&mg->mg_lock); /* - * Prefetch the next potential metaslabs + * Load the next potential metaslabs */ - for (msp = avl_first(t); msp != NULL; msp = AVL_NEXT(t, msp)) { + msp = avl_first(t); + while (msp != NULL) { + metaslab_t *msp_next = AVL_NEXT(t, msp); /* If we have reached our preload limit then we're done */ if (++m > metaslab_preload_limit) break; + /* + * We must drop the metaslab group lock here to preserve + * lock ordering with the ms_lock (when grabbing both + * the mg_lock and the ms_lock, the ms_lock must be taken + * first). As a result, it is possible that the ordering + * of the metaslabs within the avl tree may change before + * we reacquire the lock. The metaslab cannot be removed from + * the tree while we're in syncing context so it is safe to + * drop the mg_lock here. If the metaslabs are reordered + * nothing will break -- we just may end up loading a + * less than optimal one. + */ + mutex_exit(&mg->mg_lock); VERIFY(taskq_dispatch(mg->mg_taskq, metaslab_preload, msp, TQ_SLEEP) != 0); + mutex_enter(&mg->mg_lock); + msp = msp_next; } mutex_exit(&mg->mg_lock); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 05:39:27 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B3584FEE; Tue, 15 Jul 2014 05:39: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 9CCD12BFB; Tue, 15 Jul 2014 05:39: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 s6F5dREi041721; Tue, 15 Jul 2014 05:39:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F5dMGS041686; Tue, 15 Jul 2014 05:39:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150539.s6F5dMGS041686@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 05:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268657 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/commo... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 05:39:27 -0000 Author: delphij Date: Tue Jul 15 05:39:22 2014 New Revision: 268657 URL: http://svnweb.freebsd.org/changeset/base/268657 Log: MFC r268123: MFV r268119: 4914 zfs on-disk bookmark structure should be named *_phys_t Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Jul 15 05:39:22 2014 (r268657) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #include @@ -1035,7 +1035,8 @@ dump_dnode(objset_t *os, uint64_t object } static uint64_t -blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp, const zbookmark_t *zb) +blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp, + const zbookmark_phys_t *zb) { if (dnp == NULL) { ASSERT(zb->zb_level < 0); @@ -1097,7 +1098,7 @@ snprintf_blkptr_compact(char *blkbuf, si } static void -print_indirect(blkptr_t *bp, const zbookmark_t *zb, +print_indirect(blkptr_t *bp, const zbookmark_phys_t *zb, const dnode_phys_t *dnp) { char blkbuf[BP_SPRINTF_LEN]; @@ -1126,7 +1127,7 @@ print_indirect(blkptr_t *bp, const zbook static int visit_indirect(spa_t *spa, const dnode_phys_t *dnp, - blkptr_t *bp, const zbookmark_t *zb) + blkptr_t *bp, const zbookmark_phys_t *zb) { int err = 0; @@ -1152,7 +1153,7 @@ visit_indirect(spa_t *spa, const dnode_p /* recursively visit blocks below this */ cbp = buf->b_data; for (i = 0; i < epb; i++, cbp++) { - zbookmark_t czb; + zbookmark_phys_t czb; SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, zb->zb_level - 1, @@ -1176,7 +1177,7 @@ dump_indirect(dnode_t *dn) { dnode_phys_t *dnp = dn->dn_phys; int j; - zbookmark_t czb; + zbookmark_phys_t czb; (void) printf("Indirect blocks:\n"); @@ -2248,7 +2249,7 @@ zdb_blkptr_done(zio_t *zio) blkptr_t *bp = zio->io_bp; int ioerr = zio->io_error; zdb_cb_t *zcb = zio->io_private; - zbookmark_t *zb = &zio->io_bookmark; + zbookmark_phys_t *zb = &zio->io_bookmark; zio_data_buf_free(zio->io_data, zio->io_size); @@ -2283,7 +2284,7 @@ zdb_blkptr_done(zio_t *zio) /* ARGSUSED */ static int zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { zdb_cb_t *zcb = arg; dmu_object_type_t type; @@ -2747,7 +2748,7 @@ typedef struct zdb_ddt_entry { /* ARGSUSED */ static int zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { avl_tree_t *t = arg; avl_index_t where; Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Tue Jul 15 05:39:22 2014 (r268657) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ /* @@ -122,7 +122,7 @@ zil_prt_rec_write(zilog_t *zilog, int tx { char *data, *dlimit; blkptr_t *bp = &lr->lr_blkptr; - zbookmark_t zb; + zbookmark_phys_t zb; char buf[SPA_MAXBLOCKSIZE]; int verbose = MAX(dump_opt['d'], dump_opt['i']); int error; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Tue Jul 15 05:39:22 2014 (r268657) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -3513,7 +3513,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zp static int zbookmark_compare(const void *a, const void *b) { - return (memcmp(a, b, sizeof (zbookmark_t))); + return (memcmp(a, b, sizeof (zbookmark_phys_t))); } /* @@ -3525,7 +3525,7 @@ zpool_get_errlog(zpool_handle_t *zhp, nv { zfs_cmd_t zc = { 0 }; uint64_t count; - zbookmark_t *zb = NULL; + zbookmark_phys_t *zb = NULL; int i; /* @@ -3538,7 +3538,7 @@ zpool_get_errlog(zpool_handle_t *zhp, nv if (count == 0) return (0); if ((zc.zc_nvlist_dst = (uintptr_t)zfs_alloc(zhp->zpool_hdl, - count * sizeof (zbookmark_t))) == (uintptr_t)NULL) + count * sizeof (zbookmark_phys_t))) == (uintptr_t)NULL) return (-1); zc.zc_nvlist_dst_size = count; (void) strcpy(zc.zc_name, zhp->zpool_name); @@ -3547,11 +3547,14 @@ zpool_get_errlog(zpool_handle_t *zhp, nv &zc) != 0) { free((void *)(uintptr_t)zc.zc_nvlist_dst); if (errno == ENOMEM) { + void *dst; + count = zc.zc_nvlist_dst_size; - if ((zc.zc_nvlist_dst = (uintptr_t) - zfs_alloc(zhp->zpool_hdl, count * - sizeof (zbookmark_t))) == (uintptr_t)NULL) + dst = zfs_alloc(zhp->zpool_hdl, count * + sizeof (zbookmark_phys_t)); + if (dst == NULL) return (-1); + zc.zc_nvlist_dst = (uintptr_t)dst; } else { return (-1); } @@ -3567,11 +3570,11 @@ zpool_get_errlog(zpool_handle_t *zhp, nv * _not_ copied as part of the process. So we point the start of our * array appropriate and decrement the total number of elements. */ - zb = ((zbookmark_t *)(uintptr_t)zc.zc_nvlist_dst) + + zb = ((zbookmark_phys_t *)(uintptr_t)zc.zc_nvlist_dst) + zc.zc_nvlist_dst_size; count -= zc.zc_nvlist_dst_size; - qsort(zb, count, sizeof (zbookmark_t), zbookmark_compare); + qsort(zb, count, sizeof (zbookmark_phys_t), zbookmark_compare); verify(nvlist_alloc(nverrlistp, 0, KM_SLEEP) == 0); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ @@ -782,7 +782,7 @@ typedef struct l2arc_read_callback { arc_buf_t *l2rcb_buf; /* read buffer */ spa_t *l2rcb_spa; /* spa */ blkptr_t l2rcb_bp; /* original blkptr */ - zbookmark_t l2rcb_zb; /* original bookmark */ + zbookmark_phys_t l2rcb_zb; /* original bookmark */ int l2rcb_flags; /* original flags */ enum zio_compress l2rcb_compress; /* applied compress */ } l2arc_read_callback_t; @@ -3146,7 +3146,7 @@ arc_read_done(zio_t *zio) int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done, void *private, zio_priority_t priority, int zio_flags, uint32_t *arc_flags, - const zbookmark_t *zb) + const zbookmark_phys_t *zb) { arc_buf_hdr_t *hdr = NULL; arc_buf_t *buf = NULL; @@ -3340,7 +3340,7 @@ top: */ ASSERT3U(hdr->b_size, ==, size); DTRACE_PROBE4(arc__miss, arc_buf_hdr_t *, hdr, blkptr_t *, bp, - uint64_t, size, zbookmark_t *, zb); + uint64_t, size, zbookmark_phys_t *, zb); ARCSTAT_BUMP(arcstat_misses); ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_PREFETCH), demand, prefetch, hdr->b_type != ARC_BUFC_METADATA, @@ -3874,7 +3874,7 @@ arc_write(zio_t *pio, spa_t *spa, uint64 blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress, const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *physdone, arc_done_func_t *done, void *private, zio_priority_t priority, - int zio_flags, const zbookmark_t *zb) + int zio_flags, const zbookmark_phys_t *zb) { arc_buf_hdr_t *hdr = buf->b_hdr; arc_write_callback_t *callback; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #include @@ -149,7 +149,7 @@ bptree_add(objset_t *os, uint64_t obj, b /* ARGSUSED */ static int bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { int err; struct bptree_args *ba = arg; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Jul 15 05:39:22 2014 (r268657) @@ -521,7 +521,7 @@ static void dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t *flags) { dnode_t *dn; - zbookmark_t zb; + zbookmark_phys_t zb; uint32_t aflags = ARC_NOWAIT; DB_DNODE_ENTER(db); @@ -1856,7 +1856,7 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki if (bp && !BP_IS_HOLE(bp) && !BP_IS_EMBEDDED(bp)) { dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset; uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH; - zbookmark_t zb; + zbookmark_phys_t zb; SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET, dn->dn_object, 0, blkid); @@ -2725,7 +2725,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ objset_t *os; dmu_buf_impl_t *parent = db->db_parent; uint64_t txg = tx->tx_txg; - zbookmark_t zb; + zbookmark_phys_t zb; zio_prop_t zp; zio_t *zio; int wp_flag = 0; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ /* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1448,7 +1448,7 @@ dmu_sync_late_arrival_done(zio_t *zio) static int dmu_sync_late_arrival(zio_t *pio, objset_t *os, dmu_sync_cb_t *done, zgd_t *zgd, - zio_prop_t *zp, zbookmark_t *zb) + zio_prop_t *zp, zbookmark_phys_t *zb) { dmu_sync_arg_t *dsa; dmu_tx_t *tx; @@ -1509,7 +1509,7 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s dsl_dataset_t *ds = os->os_dsl_dataset; dbuf_dirty_record_t *dr; dmu_sync_arg_t *dsa; - zbookmark_t zb; + zbookmark_phys_t zb; zio_prop_t zp; dnode_t *dn; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -130,7 +130,7 @@ report_dnode(struct diffarg *da, uint64_ /* ARGSUSED */ static int diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { struct diffarg *da = arg; int err = 0; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Jul 15 05:39:22 2014 (r268657) @@ -286,7 +286,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat os->os_rootbp = bp; if (!BP_IS_HOLE(os->os_rootbp)) { uint32_t aflags = ARC_WAIT; - zbookmark_t zb; + zbookmark_phys_t zb; SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET, ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); @@ -1023,7 +1023,7 @@ void dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx) { int txgoff; - zbookmark_t zb; + zbookmark_phys_t zb; zio_prop_t zp; zio_t *zio; list_t *list; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Jul 15 05:39:22 2014 (r268657) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. */ @@ -441,7 +441,7 @@ backup_do_embed(dmu_sendarg_t *dsp, cons /* ARGSUSED */ static int backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { dmu_sendarg_t *dsp = arg; dmu_object_type_t type = bp ? BP_GET_TYPE(bp) : DMU_OT_NONE; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Tue Jul 15 05:39:22 2014 (r268657) @@ -55,7 +55,7 @@ typedef struct traverse_data { uint64_t td_objset; blkptr_t *td_rootbp; uint64_t td_min_txg; - zbookmark_t *td_resume; + zbookmark_phys_t *td_resume; int td_flags; prefetch_data_t *td_pfd; boolean_t td_paused; @@ -72,7 +72,7 @@ static int traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) { traverse_data_t *td = arg; - zbookmark_t zb; + zbookmark_phys_t zb; if (BP_IS_HOLE(bp)) return (0); @@ -96,7 +96,7 @@ traverse_zil_record(zilog_t *zilog, lr_t if (lrc->lrc_txtype == TX_WRITE) { lr_write_t *lr = (lr_write_t *)lrc; blkptr_t *bp = &lr->lr_blkptr; - zbookmark_t zb; + zbookmark_phys_t zb; if (BP_IS_HOLE(bp)) return (0); @@ -150,7 +150,7 @@ typedef enum resume_skip { */ static resume_skip_t resume_skip_check(traverse_data_t *td, const dnode_phys_t *dnp, - const zbookmark_t *zb) + const zbookmark_phys_t *zb) { if (td->td_resume != NULL && !ZB_IS_ZERO(td->td_resume)) { /* @@ -175,7 +175,7 @@ resume_skip_check(traverse_data_t *td, c static void traverse_prefetch_metadata(traverse_data_t *td, - const blkptr_t *bp, const zbookmark_t *zb) + const blkptr_t *bp, const zbookmark_phys_t *zb) { uint32_t flags = ARC_NOWAIT | ARC_PREFETCH; @@ -209,9 +209,9 @@ prefetch_needed(prefetch_data_t *pfd, co static int traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp, - const blkptr_t *bp, const zbookmark_t *zb) + const blkptr_t *bp, const zbookmark_phys_t *zb) { - zbookmark_t czb; + zbookmark_phys_t czb; int err = 0; arc_buf_t *buf = NULL; prefetch_data_t *pd = td->td_pfd; @@ -406,7 +406,7 @@ prefetch_dnode_metadata(traverse_data_t uint64_t objset, uint64_t object) { int j; - zbookmark_t czb; + zbookmark_phys_t czb; for (j = 0; j < dnp->dn_nblkptr; j++) { SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); @@ -424,7 +424,7 @@ traverse_dnode(traverse_data_t *td, cons uint64_t objset, uint64_t object) { int j, err = 0; - zbookmark_t czb; + zbookmark_phys_t czb; for (j = 0; j < dnp->dn_nblkptr; j++) { SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); @@ -443,7 +443,7 @@ traverse_dnode(traverse_data_t *td, cons /* ARGSUSED */ static int traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { prefetch_data_t *pfd = arg; uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH; @@ -473,7 +473,7 @@ traverse_prefetch_thread(void *arg) { traverse_data_t *td_main = arg; traverse_data_t td = *td_main; - zbookmark_t czb; + zbookmark_phys_t czb; td.td_func = traverse_prefetcher; td.td_arg = td_main->td_pfd; @@ -495,12 +495,12 @@ traverse_prefetch_thread(void *arg) */ static int traverse_impl(spa_t *spa, dsl_dataset_t *ds, uint64_t objset, blkptr_t *rootbp, - uint64_t txg_start, zbookmark_t *resume, int flags, + uint64_t txg_start, zbookmark_phys_t *resume, int flags, blkptr_cb_t func, void *arg) { traverse_data_t td; prefetch_data_t pd = { 0 }; - zbookmark_t czb; + zbookmark_phys_t czb; int err; ASSERT(ds == NULL || objset == ds->ds_object); @@ -581,7 +581,7 @@ traverse_dataset(dsl_dataset_t *ds, uint int traverse_dataset_destroyed(spa_t *spa, blkptr_t *blkptr, - uint64_t txg_start, zbookmark_t *resume, int flags, + uint64_t txg_start, zbookmark_phys_t *resume, int flags, blkptr_cb_t func, void *arg) { return (traverse_impl(spa, NULL, ZB_DESTROYED_OBJSET, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2013 by Joyent, Inc. All rights reserved. */ @@ -534,7 +534,7 @@ struct killarg { /* ARGSUSED */ static int kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { struct killarg *ka = arg; dmu_tx_t *tx = ka->tx; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #include @@ -50,7 +50,8 @@ #include #endif -typedef int (scan_cb_t)(dsl_pool_t *, const blkptr_t *, const zbookmark_t *); +typedef int (scan_cb_t)(dsl_pool_t *, const blkptr_t *, + const zbookmark_phys_t *); static scan_cb_t dsl_scan_scrub_cb; static void dsl_scan_cancel_sync(void *, dmu_tx_t *); @@ -379,7 +380,7 @@ dsl_scan_cancel(dsl_pool_t *dp) } static void dsl_scan_visitbp(blkptr_t *bp, - const zbookmark_t *zb, dnode_phys_t *dnp, arc_buf_t *pbuf, + const zbookmark_phys_t *zb, dnode_phys_t *dnp, arc_buf_t *pbuf, dsl_dataset_t *ds, dsl_scan_t *scn, dmu_objset_type_t ostype, dmu_tx_t *tx); static void dsl_scan_visitdnode(dsl_scan_t *, dsl_dataset_t *ds, @@ -419,7 +420,7 @@ dsl_scan_sync_state(dsl_scan_t *scn, dmu } static boolean_t -dsl_scan_check_pause(dsl_scan_t *scn, const zbookmark_t *zb) +dsl_scan_check_pause(dsl_scan_t *scn, const zbookmark_phys_t *zb) { uint64_t elapsed_nanosecs; unsigned int mintime; @@ -477,7 +478,7 @@ dsl_scan_zil_block(zilog_t *zilog, blkpt dsl_pool_t *dp = zsa->zsa_dp; dsl_scan_t *scn = dp->dp_scan; zil_header_t *zh = zsa->zsa_zh; - zbookmark_t zb; + zbookmark_phys_t zb; if (BP_IS_HOLE(bp) || bp->blk_birth <= scn->scn_phys.scn_cur_min_txg) return (0); @@ -509,7 +510,7 @@ dsl_scan_zil_record(zilog_t *zilog, lr_t zil_header_t *zh = zsa->zsa_zh; lr_write_t *lr = (lr_write_t *)lrc; blkptr_t *bp = &lr->lr_blkptr; - zbookmark_t zb; + zbookmark_phys_t zb; if (BP_IS_HOLE(bp) || bp->blk_birth <= scn->scn_phys.scn_cur_min_txg) @@ -559,7 +560,7 @@ static void dsl_scan_prefetch(dsl_scan_t *scn, arc_buf_t *buf, blkptr_t *bp, uint64_t objset, uint64_t object, uint64_t blkid) { - zbookmark_t czb; + zbookmark_phys_t czb; uint32_t flags = ARC_NOWAIT | ARC_PREFETCH; if (zfs_no_scrub_prefetch) @@ -578,7 +579,7 @@ dsl_scan_prefetch(dsl_scan_t *scn, arc_b static boolean_t dsl_scan_check_resume(dsl_scan_t *scn, const dnode_phys_t *dnp, - const zbookmark_t *zb) + const zbookmark_phys_t *zb) { /* * We never skip over user/group accounting objects (obj<0) @@ -618,7 +619,7 @@ dsl_scan_check_resume(dsl_scan_t *scn, c static int dsl_scan_recurse(dsl_scan_t *scn, dsl_dataset_t *ds, dmu_objset_type_t ostype, dnode_phys_t *dnp, const blkptr_t *bp, - const zbookmark_t *zb, dmu_tx_t *tx, arc_buf_t **bufp) + const zbookmark_phys_t *zb, dmu_tx_t *tx, arc_buf_t **bufp) { dsl_pool_t *dp = scn->scn_dp; int zio_flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD; @@ -641,7 +642,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da zb->zb_object, zb->zb_blkid * epb + i); } for (i = 0, cbp = (*bufp)->b_data; i < epb; i++, cbp++) { - zbookmark_t czb; + zbookmark_phys_t czb; SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, zb->zb_level - 1, @@ -725,7 +726,7 @@ dsl_scan_visitdnode(dsl_scan_t *scn, dsl int j; for (j = 0; j < dnp->dn_nblkptr; j++) { - zbookmark_t czb; + zbookmark_phys_t czb; SET_BOOKMARK(&czb, ds ? ds->ds_object : 0, object, dnp->dn_nlevels - 1, j); @@ -734,7 +735,7 @@ dsl_scan_visitdnode(dsl_scan_t *scn, dsl } if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { - zbookmark_t czb; + zbookmark_phys_t czb; SET_BOOKMARK(&czb, ds ? ds->ds_object : 0, object, 0, DMU_SPILL_BLKID); dsl_scan_visitbp(&dnp->dn_spill, @@ -747,7 +748,7 @@ dsl_scan_visitdnode(dsl_scan_t *scn, dsl * first 5; we want them to be useful. */ static void -dsl_scan_visitbp(blkptr_t *bp, const zbookmark_t *zb, +dsl_scan_visitbp(blkptr_t *bp, const zbookmark_phys_t *zb, dnode_phys_t *dnp, arc_buf_t *pbuf, dsl_dataset_t *ds, dsl_scan_t *scn, dmu_objset_type_t ostype, dmu_tx_t *tx) @@ -811,7 +812,7 @@ static void dsl_scan_visit_rootbp(dsl_scan_t *scn, dsl_dataset_t *ds, blkptr_t *bp, dmu_tx_t *tx) { - zbookmark_t zb; + zbookmark_phys_t zb; SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET, ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); @@ -1238,7 +1239,7 @@ dsl_scan_ddt_entry(dsl_scan_t *scn, enum const ddt_key_t *ddk = &dde->dde_key; ddt_phys_t *ddp = dde->dde_phys; blkptr_t bp; - zbookmark_t zb = { 0 }; + zbookmark_phys_t zb = { 0 }; if (scn->scn_phys.scn_state != DSS_SCANNING) return; @@ -1306,7 +1307,7 @@ dsl_scan_visit(dsl_scan_t *scn, dmu_tx_t * In case we were paused right at the end of the ds, zero the * bookmark so we don't think that we're still trying to resume. */ - bzero(&scn->scn_phys.scn_bookmark, sizeof (zbookmark_t)); + bzero(&scn->scn_phys.scn_bookmark, sizeof (zbookmark_phys_t)); /* keep pulling things out of the zap-object-as-queue */ while (zap_cursor_init(&zc, dp->dp_meta_objset, @@ -1703,7 +1704,7 @@ dsl_scan_scrub_done(zio_t *zio) static int dsl_scan_scrub_cb(dsl_pool_t *dp, - const blkptr_t *bp, const zbookmark_t *zb) + const blkptr_t *bp, const zbookmark_phys_t *zb) { dsl_scan_t *scn = dp->dp_scan; size_t size = BP_GET_PSIZE(bp); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jul 15 05:39:22 2014 (r268657) @@ -810,7 +810,7 @@ spa_error_entry_compare(const void *a, c int ret; ret = bcmp(&sa->se_bookmark, &sb->se_bookmark, - sizeof (zbookmark_t)); + sizeof (zbookmark_phys_t)); if (ret < 0) return (-1); @@ -1887,7 +1887,7 @@ spa_load_verify_done(zio_t *zio) /*ARGSUSED*/ static int spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) + const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { if (!BP_IS_HOLE(bp) && !BP_IS_EMBEDDED(bp)) { zio_t *rio = arg; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ /* @@ -35,7 +35,7 @@ * deleted from the log when the scrub completes. * * The log is stored using a ZAP object whose key is a string form of the - * zbookmark tuple (objset, object, level, blkid), and whose contents is an + * zbookmark_phys tuple (objset, object, level, blkid), and whose contents is an * optional 'objset:object' human-readable string describing the data. When an * error is first logged, this string will be empty, indicating that no name is * known. This prevents us from having to issue a potentially large amount of @@ -59,7 +59,7 @@ * Convert a bookmark to a string. */ static void -bookmark_to_name(zbookmark_t *zb, char *buf, size_t len) +bookmark_to_name(zbookmark_phys_t *zb, char *buf, size_t len) { (void) snprintf(buf, len, "%llx:%llx:%llx:%llx", (u_longlong_t)zb->zb_objset, (u_longlong_t)zb->zb_object, @@ -71,7 +71,7 @@ bookmark_to_name(zbookmark_t *zb, char * */ #ifdef _KERNEL static void -name_to_bookmark(char *buf, zbookmark_t *zb) +name_to_bookmark(char *buf, zbookmark_phys_t *zb) { zb->zb_objset = strtonum(buf, &buf); ASSERT(*buf == ':'); @@ -92,7 +92,7 @@ name_to_bookmark(char *buf, zbookmark_t void spa_log_error(spa_t *spa, zio_t *zio) { - zbookmark_t *zb = &zio->io_logical->io_bookmark; + zbookmark_phys_t *zb = &zio->io_logical->io_bookmark; spa_error_entry_t search; spa_error_entry_t *new; avl_tree_t *tree; @@ -165,7 +165,7 @@ process_error_log(spa_t *spa, uint64_t o { zap_cursor_t zc; zap_attribute_t za; - zbookmark_t zb; + zbookmark_phys_t zb; if (obj == 0) return (0); @@ -182,8 +182,8 @@ process_error_log(spa_t *spa, uint64_t o name_to_bookmark(za.za_name, &zb); if (copyout(&zb, (char *)addr + - (*count - 1) * sizeof (zbookmark_t), - sizeof (zbookmark_t)) != 0) { + (*count - 1) * sizeof (zbookmark_phys_t), + sizeof (zbookmark_phys_t)) != 0) { zap_cursor_fini(&zc); return (SET_ERROR(EFAULT)); } @@ -207,8 +207,8 @@ process_error_list(avl_tree_t *list, voi return (SET_ERROR(ENOMEM)); if (copyout(&se->se_bookmark, (char *)addr + - (*count - 1) * sizeof (zbookmark_t), - sizeof (zbookmark_t)) != 0) + (*count - 1) * sizeof (zbookmark_phys_t), + sizeof (zbookmark_phys_t)) != 0) return (SET_ERROR(EFAULT)); *count -= 1; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -105,12 +105,12 @@ int arc_referenced(arc_buf_t *buf); int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done, void *priv, zio_priority_t priority, int flags, - uint32_t *arc_flags, const zbookmark_t *zb); + uint32_t *arc_flags, const zbookmark_phys_t *zb); zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress, const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *physdone, arc_done_func_t *done, void *priv, zio_priority_t priority, - int zio_flags, const zbookmark_t *zb); + int zio_flags, const zbookmark_phys_t *zb); void arc_freed(spa_t *spa, const blkptr_t *bp); void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *priv); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h Tue Jul 15 05:39:22 2014 (r268657) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_BPTREE_H @@ -43,7 +43,7 @@ typedef struct bptree_phys { typedef struct bptree_entry_phys { blkptr_t be_bp; uint64_t be_birth_txg; /* only delete blocks born after this txg */ - zbookmark_t be_zb; /* holds traversal resume point if needed */ + zbookmark_phys_t be_zb; /* holds traversal resume point if needed */ } bptree_entry_phys_t; typedef int bptree_itor_t(void *arg, const blkptr_t *bp, dmu_tx_t *tx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Jul 15 05:39:22 2014 (r268657) @@ -64,7 +64,7 @@ struct dsl_pool; struct dnode; struct drr_begin; struct drr_end; -struct zbookmark; +struct zbookmark_phys; struct spa; struct nvlist; struct arc_buf; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_DMU_TRAVERSE_H @@ -40,7 +40,7 @@ struct zilog; struct arc_buf; typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, - const zbookmark_t *zb, const struct dnode_phys *dnp, void *arg); + const zbookmark_phys_t *zb, const struct dnode_phys *dnp, void *arg); #define TRAVERSE_PRE (1<<0) #define TRAVERSE_POST (1<<1) @@ -55,7 +55,7 @@ typedef int (blkptr_cb_t)(spa_t *spa, zi int traverse_dataset(struct dsl_dataset *ds, uint64_t txg_start, int flags, blkptr_cb_t func, void *arg); int traverse_dataset_destroyed(spa_t *spa, blkptr_t *blkptr, - uint64_t txg_start, zbookmark_t *resume, int flags, + uint64_t txg_start, zbookmark_phys_t *resume, int flags, blkptr_cb_t func, void *arg); int traverse_pool(spa_t *spa, uint64_t txg_start, int flags, blkptr_cb_t func, void *arg); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_DSL_SCAN_H @@ -62,7 +62,7 @@ typedef struct dsl_scan_phys { uint64_t scn_errors; /* scan I/O error count */ uint64_t scn_ddt_class_max; ddt_bookmark_t scn_ddt_bookmark; - zbookmark_t scn_bookmark; + zbookmark_phys_t scn_bookmark; uint64_t scn_flags; /* dsl_scan_flags_t */ } dsl_scan_phys_t; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ @@ -820,7 +820,7 @@ extern void spa_history_log_internal_dd( dmu_tx_t *tx, const char *fmt, ...); /* error handling */ -struct zbookmark; +struct zbookmark_phys; extern void spa_log_error(spa_t *spa, zio_t *zio); extern void zfs_ereport_post(const char *cls, spa_t *spa, vdev_t *vd, zio_t *zio, uint64_t stateoroffset, uint64_t length); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. */ @@ -47,9 +47,9 @@ extern "C" { #endif typedef struct spa_error_entry { - zbookmark_t se_bookmark; - char *se_name; - avl_node_t se_avl; + zbookmark_phys_t se_bookmark; + char *se_name; + avl_node_t se_avl; } spa_error_entry_t; typedef struct spa_history_phys { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue Jul 15 05:39:22 2014 (r268657) @@ -22,8 +22,7 @@ /* * Copyright (c) 2005, 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) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -262,16 +261,16 @@ extern const char *zio_type_name[ZIO_TYP * Note: this structure is called a bookmark because its original purpose * was to remember where to resume a pool-wide traverse. * - * Note: this structure is passed between userland and the kernel. - * Therefore it must not change size or alignment between 32/64 bit - * compilation options. + * Note: this structure is passed between userland and the kernel, and is + * stored on disk (by virtue of being incorporated into other on-disk + * structures, e.g. dsl_scan_phys_t). */ -typedef struct zbookmark { +typedef struct zbookmark_phys { uint64_t zb_objset; uint64_t zb_object; int64_t zb_level; uint64_t zb_blkid; -} zbookmark_t; +} zbookmark_phys_t; #define SET_BOOKMARK(zb, objset, object, level, blkid) \ { \ @@ -415,7 +414,7 @@ extern zio_trim_stats_t zio_trim_stats; struct zio { /* Core information about this I/O */ - zbookmark_t io_bookmark; + zbookmark_phys_t io_bookmark; zio_prop_t io_prop; zio_type_t io_type; enum zio_child io_child_type; @@ -497,17 +496,17 @@ extern zio_t *zio_root(spa_t *spa, extern zio_t *zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data, uint64_t size, zio_done_func_t *done, void *priv, - zio_priority_t priority, enum zio_flag flags, const zbookmark_t *zb); + zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb); extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, const zio_prop_t *zp, zio_done_func_t *ready, zio_done_func_t *physdone, zio_done_func_t *done, void *priv, - zio_priority_t priority, enum zio_flag flags, const zbookmark_t *zb); + zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb); extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, zio_done_func_t *done, void *priv, - zio_priority_t priority, enum zio_flag flags, zbookmark_t *zb); + zio_priority_t priority, enum zio_flag flags, zbookmark_phys_t *zb); extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies, boolean_t nopwrite); @@ -629,9 +628,9 @@ extern void zfs_ereport_post_checksum(sp /* Called from spa_sync(), but primarily an injection handler */ extern void spa_handle_ignored_writes(spa_t *spa); -/* zbookmark functions */ +/* zbookmark_phys functions */ boolean_t zbookmark_is_before(const struct dnode_phys *dnp, - const zbookmark_t *zb1, const zbookmark_t *zb2); + const zbookmark_phys_t *zb1, const zbookmark_phys_t *zb2); #ifdef __cplusplus } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Tue Jul 15 05:36:26 2014 (r268656) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Tue Jul 15 05:39:22 2014 (r268657) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -195,7 +195,7 @@ zil_read_log_block(zilog_t *zilog, const enum zio_flag zio_flags = ZIO_FLAG_CANFAIL; uint32_t aflags = ARC_WAIT; arc_buf_t *abuf = NULL; - zbookmark_t zb; + zbookmark_phys_t zb; int error; if (zilog->zl_header->zh_claim_txg == 0) @@ -268,7 +268,7 @@ zil_read_log_data(zilog_t *zilog, const const blkptr_t *bp = &lr->lr_blkptr; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 05:42:10 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9C8CE1D0; Tue, 15 Jul 2014 05:42: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 872422C7D; Tue, 15 Jul 2014 05:42: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 s6F5gAQm045289; Tue, 15 Jul 2014 05:42:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F5g9jZ045283; Tue, 15 Jul 2014 05:42:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150542.s6F5g9jZ045283@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 05:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268658 - in stable/10: cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 05:42:10 -0000 Author: delphij Date: Tue Jul 15 05:42:09 2014 New Revision: 268658 URL: http://svnweb.freebsd.org/changeset/base/268658 Log: MFC r268126: MFV r268121: 4924 LZ4 Compression for metadata Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Jul 15 05:39:22 2014 (r268657) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Jul 15 05:42:09 2014 (r268658) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 2014 +.Dd July 1, 2014 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -235,14 +235,11 @@ administrator can turn on compression on any dataset on the pool using the .Xr zfs 8 -command. Please note that doing so will -immediately activate the -.Sy lz4_compress -feature on the underlying -pool -.Pq even before any data is written , -and the feature will not be -deactivated. +command. +Also, all newly written metadata +will be compressed with +.Sy lz4 +algorithm. Since this feature is not read-only compatible, this operation will render the pool unimportable on systems without support for the @@ -251,6 +248,12 @@ feature. Booting off of .Sy lz4 -compressed root pools is supported. +.Pp +This feature becomes +.Sy active +as soon as it is enabled and will +never return to being +.Sy enabled . .It Sy multi_vdev_crash_dump .Bl -column "READ\-ONLY COMPATIBLE" "com.joyent:multi_vdev_crash_dump" .It GUID Ta com.joyent:multi_vdev_crash_dump Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Tue Jul 15 05:39:22 2014 (r268657) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Tue Jul 15 05:42:09 2014 (r268658) @@ -23,6 +23,7 @@ * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved. */ #ifdef _KERNEL @@ -168,7 +169,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_LZ4_COMPRESS, "org.illumos:lz4_compress", "lz4_compress", "LZ4 compression algorithm support.", B_FALSE, B_FALSE, - B_FALSE, NULL); + B_TRUE, NULL); zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Jul 15 05:39:22 2014 (r268657) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Jul 15 05:42:09 2014 (r268658) @@ -24,6 +24,7 @@ */ /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ /* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ +/* Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved. */ #include #include @@ -44,6 +45,7 @@ #include #include #include +#include #ifdef _KERNEL #include #include @@ -1707,8 +1709,16 @@ dmu_write_policy(objset_t *os, dnode_t * * XXX -- we should design a compression algorithm * that specializes in arrays of bps. */ - compress = zfs_mdcomp_disable ? ZIO_COMPRESS_EMPTY : - ZIO_COMPRESS_LZJB; + boolean_t lz4_ac = spa_feature_is_active(os->os_spa, + SPA_FEATURE_LZ4_COMPRESS); + + if (zfs_mdcomp_disable) { + compress = ZIO_COMPRESS_EMPTY; + } else if (lz4_ac) { + compress = ZIO_COMPRESS_LZ4; + } else { + compress = ZIO_COMPRESS_LZJB; + } /* * Metadata always gets checksummed. If the data Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jul 15 05:39:22 2014 (r268657) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jul 15 05:42:09 2014 (r268658) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2013, 2014, Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Martin Matuska . All rights reserved. */ @@ -6429,6 +6429,22 @@ spa_sync_upgrades(spa_t *spa, dmu_tx_t * spa->spa_uberblock.ub_version >= SPA_VERSION_FEATURES) { spa_feature_create_zap_objects(spa, tx); } + + /* + * LZ4_COMPRESS feature's behaviour was changed to activate_on_enable + * when possibility to use lz4 compression for metadata was added + * Old pools that have this feature enabled must be upgraded to have + * this feature active + */ + if (spa->spa_uberblock.ub_version >= SPA_VERSION_FEATURES) { + boolean_t lz4_en = spa_feature_is_enabled(spa, + SPA_FEATURE_LZ4_COMPRESS); + boolean_t lz4_ac = spa_feature_is_active(spa, + SPA_FEATURE_LZ4_COMPRESS); + + if (lz4_en && !lz4_ac) + spa_feature_incr(spa, SPA_FEATURE_LZ4_COMPRESS, tx); + } rrw_exit(&dp->dp_config_rwlock, FTAG); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jul 15 05:39:22 2014 (r268657) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jul 15 05:42:09 2014 (r268658) @@ -29,6 +29,7 @@ * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved. */ /* @@ -2504,37 +2505,6 @@ zfs_prop_set_special(const char *dsname, } break; } - case ZFS_PROP_COMPRESSION: - { - if (intval == ZIO_COMPRESS_LZ4) { - spa_t *spa; - - if ((err = spa_open(dsname, &spa, FTAG)) != 0) - return (err); - - /* - * Setting the LZ4 compression algorithm activates - * the feature. - */ - if (!spa_feature_is_active(spa, - SPA_FEATURE_LZ4_COMPRESS)) { - if ((err = zfs_prop_activate_feature(spa, - SPA_FEATURE_LZ4_COMPRESS)) != 0) { - spa_close(spa, FTAG); - return (err); - } - } - - spa_close(spa, FTAG); - } - /* - * We still want the default set action to be performed in the - * caller, we only performed zfeature settings here. - */ - err = -1; - break; - } - default: err = -1; } From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 05:45:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8DDAB3C9; Tue, 15 Jul 2014 05:45: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 6F40E2C96; Tue, 15 Jul 2014 05:45: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 s6F5jplM046059; Tue, 15 Jul 2014 05:45:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6F5jol4046051; Tue, 15 Jul 2014 05:45:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407150545.s6F5jol4046051@svn.freebsd.org> From: Xin LI Date: Tue, 15 Jul 2014 05:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268659 - in stable/10/sys/cddl/contrib/opensolaris: common/zfs uts/common/fs/zfs uts/common/sys/fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 05:45:51 -0000 Author: delphij Date: Tue Jul 15 05:45:50 2014 New Revision: 268659 URL: http://svnweb.freebsd.org/changeset/base/268659 Log: MFC r268128: MFV r268122: 4929 want prevsnap property Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Jul 15 05:42:09 2014 (r268658) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Jul 15 05:45:50 2014 (r268659) @@ -435,6 +435,8 @@ zfs_prop_init(void) PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID"); zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT"); + zprop_register_hidden(ZFS_PROP_PREV_SNAP, "prevsnap", PROP_TYPE_STRING, + PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "PREVSNAP"); /* oddball properties */ zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Jul 15 05:42:09 2014 (r268658) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Jul 15 05:45:50 2014 (r268659) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright (c) 2011 Martin Matuska - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2014 RackTop Systems. */ @@ -1603,6 +1603,12 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl ds->ds_phys->ds_unique_bytes); get_clones_stat(ds, nv); } else { + if (ds->ds_prev != NULL && ds->ds_prev != dp->dp_origin_snap) { + char buf[MAXNAMELEN]; + dsl_dataset_name(ds->ds_prev, buf); + dsl_prop_nvlist_add_string(nv, ZFS_PROP_PREV_SNAP, buf); + } + dsl_dir_stats(ds->ds_dir, nv); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Jul 15 05:42:09 2014 (r268658) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Jul 15 05:45:50 2014 (r268659) @@ -151,6 +151,7 @@ typedef enum { ZFS_PROP_FILESYSTEM_COUNT, ZFS_PROP_SNAPSHOT_COUNT, ZFS_PROP_REDUNDANT_METADATA, + ZFS_PROP_PREV_SNAP, ZFS_NUM_PROPS } zfs_prop_t; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 10:01:34 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3D540E7C; Tue, 15 Jul 2014 10:01: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 2A10123D6; Tue, 15 Jul 2014 10:01: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 s6FA1Xri069407; Tue, 15 Jul 2014 10:01:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FA1Xua069405; Tue, 15 Jul 2014 10:01:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407151001.s6FA1Xua069405@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Jul 2014 10:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268661 - in stable/10/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 10:01:34 -0000 Author: kib Date: Tue Jul 15 10:01:33 2014 New Revision: 268661 URL: http://svnweb.freebsd.org/changeset/base/268661 Log: MFC r268383: Correct si_code for the SIGBUS signal generated by the alignment trap. Modified: stable/10/sys/amd64/amd64/trap.c stable/10/sys/i386/i386/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/trap.c ============================================================================== --- stable/10/sys/amd64/amd64/trap.c Tue Jul 15 09:30:43 2014 (r268660) +++ stable/10/sys/amd64/amd64/trap.c Tue Jul 15 10:01:33 2014 (r268661) @@ -345,6 +345,10 @@ trap(struct trapframe *frame) i = SIGBUS; ucode = BUS_OBJERR; break; + case T_ALIGNFLT: + i = SIGBUS; + ucode = BUS_ADRALN; + break; case T_DOUBLEFLT: /* double fault */ default: i = SIGBUS; Modified: stable/10/sys/i386/i386/trap.c ============================================================================== --- stable/10/sys/i386/i386/trap.c Tue Jul 15 09:30:43 2014 (r268660) +++ stable/10/sys/i386/i386/trap.c Tue Jul 15 10:01:33 2014 (r268661) @@ -398,6 +398,10 @@ trap(struct trapframe *frame) i = SIGBUS; ucode = BUS_OBJERR; break; + case T_ALIGNFLT: + i = SIGBUS; + ucode = BUS_ADRALN; + break; case T_DOUBLEFLT: /* double fault */ default: i = SIGBUS; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 10:05:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6C5A11C2; Tue, 15 Jul 2014 10:05: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 593472467; Tue, 15 Jul 2014 10:05: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 s6FA5rbo070382; Tue, 15 Jul 2014 10:05:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FA5roO070381; Tue, 15 Jul 2014 10:05:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407151005.s6FA5roO070381@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Jul 2014 10:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268663 - stable/10/tools/regression/file/flock X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 10:05:53 -0000 Author: kib Date: Tue Jul 15 10:05:52 2014 New Revision: 268663 URL: http://svnweb.freebsd.org/changeset/base/268663 Log: MFC r268385: Make this compilable on latest Linux'es without warnings. Modified: stable/10/tools/regression/file/flock/flock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/file/flock/flock.c ============================================================================== --- stable/10/tools/regression/file/flock/flock.c Tue Jul 15 10:04:09 2014 (r268662) +++ stable/10/tools/regression/file/flock/flock.c Tue Jul 15 10:05:52 2014 (r268663) @@ -27,6 +27,7 @@ * $FreeBSD$ */ +#include #include #ifdef __FreeBSD__ #include @@ -39,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -51,9 +53,13 @@ #include #else #ifndef __unused +#ifdef __GNUC__ +#define __unused __attribute__((__unused__)) +#else #define __unused #endif #endif +#endif int verbose = 0; @@ -1329,7 +1335,6 @@ test15(int fd, __unused int argc, const */ int pid; int pfd[2]; - int fd2; struct flock fl; char ch; int res; @@ -1366,7 +1371,7 @@ test15(int fd, __unused int argc, const if (read(pfd[0], &ch, 1) != 1) err(1, "reading from pipe (child)"); - fd2 = dup(fd); + (void)dup(fd); if (flock(fd, LOCK_SH) < 0) err(1, "flock shared"); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 16:49:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A1A7A6A4; Tue, 15 Jul 2014 16:49: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 45EDD2A96; Tue, 15 Jul 2014 16:49: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 s6FGnaEg072226; Tue, 15 Jul 2014 16:49:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FGnZjq072220; Tue, 15 Jul 2014 16:49:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151649.s6FGnZjq072220@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 16:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268673 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 16:49:36 -0000 Author: mav Date: Tue Jul 15 16:49:35 2014 New Revision: 268673 URL: http://svnweb.freebsd.org/changeset/base/268673 Log: MFC r267639: Increase CTL_DEVID_LEN from 16 to 64 bytes. SPC-4 recommends T10 vendor ID based LUN ID was created by concatenating product name and serial number (and istgt follows that). But product name is 16 bytes long by itself, so 16 bytes total length is clearly not enough to fit both. To keep compatibility with existing configurations, pad short device IDs to old length of 16, same as before. This change probably breaks CTL user-level ABI, so control tools should be rebuilt after this change. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 15:40:33 2014 (r268672) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:49:35 2014 (r268673) @@ -83,12 +83,6 @@ __FBSDID("$FreeBSD$"); struct ctl_softc *control_softc = NULL; /* - * Use the serial number and device ID provided by the backend, rather than - * making up our own. - */ -#define CTL_USE_BACKEND_SN - -/* * Size and alignment macros needed for Copan-specific HA hardware. These * can go away when the HA code is re-written, and uses busdma for any * hardware. @@ -9480,9 +9474,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii { struct scsi_vpd_unit_serial_number *sn_ptr; struct ctl_lun *lun; -#ifndef CTL_USE_BACKEND_SN - char tmpstr[32]; -#endif lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -9516,7 +9507,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii sn_ptr->page_code = SVPD_UNIT_SERIAL_NUMBER; sn_ptr->length = ctl_min(sizeof(*sn_ptr) - 4, CTL_SN_LEN); -#ifdef CTL_USE_BACKEND_SN /* * If we don't have a LUN, we just leave the serial number as * all spaces. @@ -9526,15 +9516,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii strncpy((char *)sn_ptr->serial_num, (char *)lun->be_lun->serial_num, CTL_SN_LEN); } -#else - /* - * Note that we're using a non-unique serial number here, - */ - snprintf(tmpstr, sizeof(tmpstr), "MYSERIALNUMIS000"); - memset(sn_ptr->serial_num, 0x20, sizeof(sn_ptr->serial_num)); - strncpy(sn_ptr->serial_num, tmpstr, ctl_min(CTL_SN_LEN, - ctl_min(sizeof(tmpstr), sizeof(*sn_ptr) - 4))); -#endif ctsio->scsi_status = SCSI_STATUS_OK; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -9556,10 +9537,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio struct ctl_lun *lun; struct ctl_frontend *fe; char *val; -#ifndef CTL_USE_BACKEND_SN - char tmpstr[32]; -#endif /* CTL_USE_BACKEND_SN */ - int devid_len; + int data_len, devid_len; ctl_softc = control_softc; @@ -9570,23 +9548,30 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - devid_len = sizeof(struct scsi_vpd_device_id) + + if (lun == NULL) { + devid_len = CTL_DEVID_MIN_LEN; + } else { + devid_len = max(CTL_DEVID_MIN_LEN, + strnlen(lun->be_lun->device_id, CTL_DEVID_LEN)); + } + + data_len = sizeof(struct scsi_vpd_device_id) + sizeof(struct scsi_vpd_id_descriptor) + - sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN + + sizeof(struct scsi_vpd_id_t10) + devid_len + sizeof(struct scsi_vpd_id_descriptor) + CTL_WWPN_LEN + sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_rel_trgt_port_id) + sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_trgt_port_grp_id); - ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO); + ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; - if (devid_len < alloc_len) { - ctsio->residual = alloc_len - devid_len; - ctsio->kern_data_len = devid_len; - ctsio->kern_total_len = devid_len; + if (data_len < alloc_len) { + ctsio->residual = alloc_len - data_len; + ctsio->kern_data_len = data_len; + ctsio->kern_total_len = data_len; } else { ctsio->residual = 0; ctsio->kern_data_len = alloc_len; @@ -9599,7 +9584,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list; t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0]; desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + - sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN); + sizeof(struct scsi_vpd_id_t10) + devid_len); desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] + CTL_WWPN_LEN); desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] + @@ -9617,7 +9602,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio devid_ptr->page_code = SVPD_DEVICE_ID; - scsi_ulto2b(devid_len - 4, devid_ptr->length); + scsi_ulto2b(data_len - 4, devid_ptr->length); /* * For Fibre channel, @@ -9643,7 +9628,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio * per-LUN identifier. */ desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; - desc->length = sizeof(*t10id) + CTL_DEVID_LEN; + desc->length = sizeof(*t10id) + devid_len; if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) { strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); } else { @@ -9700,7 +9685,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio else desc3->identifier[3] = 2; -#ifdef CTL_USE_BACKEND_SN /* * If we've actually got a backend, copy the device id from the * per-LUN data. Otherwise, set it to all spaces. @@ -9710,19 +9694,13 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio * Copy the backend's LUN ID. */ strncpy((char *)t10id->vendor_spec_id, - (char *)lun->be_lun->device_id, CTL_DEVID_LEN); + (char *)lun->be_lun->device_id, devid_len); } else { /* * No backend, set this to spaces. */ - memset(t10id->vendor_spec_id, 0x20, CTL_DEVID_LEN); + memset(t10id->vendor_spec_id, 0x20, devid_len); } -#else - snprintf(tmpstr, sizeof(tmpstr), "MYDEVICEIDIS%4d", - (lun != NULL) ? (int)lun->lun : 0); - strncpy(t10id->vendor_spec_id, tmpstr, ctl_min(CTL_DEVID_LEN, - sizeof(tmpstr))); -#endif ctsio->scsi_status = SCSI_STATUS_OK; Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Tue Jul 15 15:40:33 2014 (r268672) +++ stable/10/sys/cam/ctl/ctl.h Tue Jul 15 16:49:35 2014 (r268673) @@ -96,7 +96,8 @@ union ctl_modepage_info { /* * Device ID length, for VPD page 0x83. */ -#define CTL_DEVID_LEN 16 +#define CTL_DEVID_LEN 64 +#define CTL_DEVID_MIN_LEN 16 /* * WWPN length, for VPD page 0x83. */ Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 15:40:33 2014 (r268672) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 16:49:35 2014 (r268673) @@ -2059,7 +2059,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, const struct icl_pdu *request; int i, ret; char *val; - size_t devid_len, wwnn_len, wwpn_len, lun_name_len; + size_t data_len, devid_len, wwnn_len, wwpn_len, lun_name_len; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; request = ctsio->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; @@ -2077,8 +2077,11 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, wwnn_len += (4 - (wwnn_len % 4)); if (lun == NULL) { + devid_len = CTL_DEVID_MIN_LEN; lun_name_len = 0; } else { + devid_len = max(CTL_DEVID_MIN_LEN, + strnlen(lun->be_lun->device_id, CTL_DEVID_LEN)); lun_name_len = strlen(cs->cs_target->ct_name); lun_name_len += strlen(",lun,XXXXXXXX"); lun_name_len += 1; /* '\0' */ @@ -2086,9 +2089,9 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, lun_name_len += (4 - (lun_name_len % 4)); } - devid_len = sizeof(struct scsi_vpd_device_id) + + data_len = sizeof(struct scsi_vpd_device_id) + sizeof(struct scsi_vpd_id_descriptor) + - sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN + + sizeof(struct scsi_vpd_id_t10) + devid_len + sizeof(struct scsi_vpd_id_descriptor) + lun_name_len + sizeof(struct scsi_vpd_id_descriptor) + wwnn_len + sizeof(struct scsi_vpd_id_descriptor) + wwpn_len + @@ -2097,14 +2100,14 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_trgt_port_grp_id); - ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO); + ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; - if (devid_len < alloc_len) { - ctsio->residual = alloc_len - devid_len; - ctsio->kern_data_len = devid_len; - ctsio->kern_total_len = devid_len; + if (data_len < alloc_len) { + ctsio->residual = alloc_len - data_len; + ctsio->kern_data_len = data_len; + ctsio->kern_total_len = data_len; } else { ctsio->residual = 0; ctsio->kern_data_len = alloc_len; @@ -2117,7 +2120,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list; t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0]; desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + - sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN); + sizeof(struct scsi_vpd_id_t10) + devid_len); desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] + lun_name_len); desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] + @@ -2135,7 +2138,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, devid_ptr->page_code = SVPD_DEVICE_ID; - scsi_ulto2b(devid_len - 4, devid_ptr->length); + scsi_ulto2b(data_len - 4, devid_ptr->length); /* * We're using a LUN association here. i.e., this device ID is a @@ -2143,7 +2146,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, */ desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_ASCII; desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; - desc->length = sizeof(*t10id) + CTL_DEVID_LEN; + desc->length = sizeof(*t10id) + devid_len; if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) { strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); } else { @@ -2161,12 +2164,12 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, * Copy the backend's LUN ID. */ strncpy((char *)t10id->vendor_spec_id, - (char *)lun->be_lun->device_id, CTL_DEVID_LEN); + (char *)lun->be_lun->device_id, devid_len); } else { /* * No backend, set this to spaces. */ - memset(t10id->vendor_spec_id, 0x20, CTL_DEVID_LEN); + memset(t10id->vendor_spec_id, 0x20, devid_len); } /* From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 16:53:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 43CBBA24; Tue, 15 Jul 2014 16:53: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 2F38E2B4C; Tue, 15 Jul 2014 16:53: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 s6FGr5ZZ076234; Tue, 15 Jul 2014 16:53:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FGr5Tp076232; Tue, 15 Jul 2014 16:53:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151653.s6FGr5Tp076232@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 16:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268674 - in stable/10/sys/cam: ctl scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 16:53:05 -0000 Author: mav Date: Tue Jul 15 16:53:04 2014 New Revision: 268674 URL: http://svnweb.freebsd.org/changeset/base/268674 Log: MFC r268096, r268306, r268361: Add more formal and strict command parsing and validation. For every supported command define CDB length and mask of bits that are allowed to be set. This allows to remove bunch of checks through the code and still make the validation more strict. To properly do it for commands supporting multiple service actions, formalize their parsing by adding subtables for each of such commands. As visible effect, this change allows to add support for REPORT SUPPORTED OPERATION CODES command, reporting to client all the data about supported SCSI commands, except timeouts. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:49:35 2014 (r268673) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:53:04 2014 (r268674) @@ -392,7 +392,7 @@ static ctl_action ctl_check_ooa(struct c static int ctl_check_blocked(struct ctl_lun *lun); static int ctl_scsiio_lun_check(struct ctl_softc *ctl_softc, struct ctl_lun *lun, - struct ctl_cmd_entry *entry, + const struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio); //static int ctl_check_rtr(union ctl_io *pending_io, struct ctl_softc *softc); static void ctl_failover(void); @@ -430,6 +430,12 @@ static void ctl_enqueue_incoming(union c static void ctl_enqueue_rtr(union ctl_io *io); static void ctl_enqueue_done(union ctl_io *io); static void ctl_enqueue_isc(union ctl_io *io); +static const struct ctl_cmd_entry * + ctl_get_cmd_entry(struct ctl_scsiio *ctsio); +static const struct ctl_cmd_entry * + ctl_validate_command(struct ctl_scsiio *ctsio); +static int ctl_cmd_applicable(uint8_t lun_type, + const struct ctl_cmd_entry *entry); /* * Load the serialization table. This isn't very pretty, but is probably @@ -622,11 +628,9 @@ ctl_isc_event_handler(ctl_ha_channel cha memcpy(io->scsiio.cdb, msg_info.scsi.cdb, CTL_MAX_CDBLEN); if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) { - struct ctl_cmd_entry *entry; - uint8_t opcode; + const struct ctl_cmd_entry *entry; - opcode = io->scsiio.cdb[0]; - entry = &ctl_cmd_table[opcode]; + entry = ctl_get_cmd_entry(&io->scsiio); io->io_hdr.flags &= ~CTL_FLAG_DATA_MASK; io->io_hdr.flags |= entry->flags & CTL_FLAG_DATA_MASK; @@ -4973,50 +4977,11 @@ ctl_scsi_release(struct ctl_scsiio *ctsi ctl_softc = control_softc; switch (ctsio->cdb[0]) { - case RELEASE: { - struct scsi_release *cdb; - - cdb = (struct scsi_release *)ctsio->cdb; - if ((cdb->byte2 & 0x1f) != 0) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 0, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - break; - } case RELEASE_10: { struct scsi_release_10 *cdb; cdb = (struct scsi_release_10 *)ctsio->cdb; - if ((cdb->byte2 & SR10_EXTENT) != 0) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - - } - - if ((cdb->byte2 & SR10_3RDPTY) != 0) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 4); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - if (cdb->byte2 & SR10_LONGID) longid = 1; else @@ -5110,49 +5075,11 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi ctl_softc = control_softc; switch (ctsio->cdb[0]) { - case RESERVE: { - struct scsi_reserve *cdb; - - cdb = (struct scsi_reserve *)ctsio->cdb; - if ((cdb->byte2 & 0x1f) != 0) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 0, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - resv_id = cdb->resv_id; - length = scsi_2btoul(cdb->length); - break; - } case RESERVE_10: { struct scsi_reserve_10 *cdb; cdb = (struct scsi_reserve_10 *)ctsio->cdb; - if ((cdb->byte2 & SR10_EXTENT) != 0) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - if ((cdb->byte2 & SR10_3RDPTY) != 0) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 4); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } if (cdb->byte2 & SR10_LONGID) longid = 1; else @@ -5265,35 +5192,6 @@ ctl_start_stop(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } - /* - * We don't support the power conditions field. We need to check - * this prior to checking the load/eject and start/stop bits. - */ - if ((cdb->how & SSS_PC_MASK) != SSS_PC_START_VALID) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 4, - /*bit_valid*/ 1, - /*bit*/ 4); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - - /* - * Media isn't removable, so we can't load or eject it. - */ - if ((cdb->how & SSS_LOEJ) != 0) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 4, - /*bit_valid*/ 1, - /*bit*/ 1); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - if ((lun->flags & CTL_LUN_PR_RESERVED) && ((cdb->how & SSS_START)==0)) { uint32_t residx; @@ -5391,7 +5289,6 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) struct ctl_softc *ctl_softc; uint64_t starting_lba; uint32_t block_count; - int reladr, immed; int retval; CTL_DEBUG_PRINT(("ctl_sync_cache\n")); @@ -5399,20 +5296,12 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; ctl_softc = control_softc; retval = 0; - reladr = 0; - immed = 0; switch (ctsio->cdb[0]) { case SYNCHRONIZE_CACHE: { struct scsi_sync_cache *cdb; cdb = (struct scsi_sync_cache *)ctsio->cdb; - if (cdb->byte2 & SSC_RELADR) - reladr = 1; - - if (cdb->byte2 & SSC_IMMED) - immed = 1; - starting_lba = scsi_4btoul(cdb->begin_lba); block_count = scsi_2btoul(cdb->lb_count); break; @@ -5421,12 +5310,6 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) struct scsi_sync_cache_16 *cdb; cdb = (struct scsi_sync_cache_16 *)ctsio->cdb; - if (cdb->byte2 & SSC_RELADR) - reladr = 1; - - if (cdb->byte2 & SSC_IMMED) - immed = 1; - starting_lba = scsi_8btou64(cdb->begin_lba); block_count = scsi_4btoul(cdb->lb_count); break; @@ -5438,41 +5321,6 @@ ctl_sync_cache(struct ctl_scsiio *ctsio) break; /* NOTREACHED */ } - if (immed) { - /* - * We don't support the immediate bit. Since it's in the - * same place for the 10 and 16 byte SYNCHRONIZE CACHE - * commands, we can just return the same error in either - * case. - */ - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 1); - ctl_done((union ctl_io *)ctsio); - goto bailout; - } - - if (reladr) { - /* - * We don't support the reladr bit either. It can only be - * used with linked commands, and we don't support linked - * commands. Since the bit is in the same place for the - * 10 and 16 byte SYNCHRONIZE CACHE * commands, we can - * just return the same error in either case. - */ - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - goto bailout; - } - /* * We check the LBA and length, but don't do anything with them. * A SYNCHRONIZE CACHE will cause the entire cache for this lun to @@ -5659,16 +5507,6 @@ ctl_read_buffer(struct ctl_scsiio *ctsio ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } - if (cdb->buffer_id != 0) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 2, - /*bit_valid*/ 0, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } len = scsi_3btoul(cdb->length); buffer_offset = scsi_3btoul(cdb->offset); @@ -5727,16 +5565,6 @@ ctl_write_buffer(struct ctl_scsiio *ctsi ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } - if (cdb->buffer_id != 0) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 2, - /*bit_valid*/ 0, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } len = scsi_3btoul(cdb->length); buffer_offset = scsi_3btoul(cdb->offset); @@ -7053,7 +6881,7 @@ ctl_read_capacity(struct ctl_scsiio *cts return (CTL_RETVAL_COMPLETE); } -static int +int ctl_read_capacity_16(struct ctl_scsiio *ctsio) { struct scsi_read_capacity_16 *cdb; @@ -7117,37 +6945,7 @@ ctl_read_capacity_16(struct ctl_scsiio * } int -ctl_service_action_in(struct ctl_scsiio *ctsio) -{ - struct scsi_service_action_in *cdb; - int retval; - - CTL_DEBUG_PRINT(("ctl_service_action_in\n")); - - cdb = (struct scsi_service_action_in *)ctsio->cdb; - - retval = CTL_RETVAL_COMPLETE; - - switch (cdb->service_action) { - case SRC16_SERVICE_ACTION: - retval = ctl_read_capacity_16(ctsio); - break; - default: - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 4); - ctl_done((union ctl_io *)ctsio); - break; - } - - return (retval); -} - -int -ctl_maintenance_in(struct ctl_scsiio *ctsio) +ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio) { struct scsi_maintenance_in *cdb; int retval; @@ -7160,7 +6958,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct struct scsi_target_port_descriptor *tp_desc_ptr1_1, *tp_desc_ptr1_2, *tp_desc_ptr2_1, *tp_desc_ptr2_2; - CTL_DEBUG_PRINT(("ctl_maintenance_in\n")); + CTL_DEBUG_PRINT(("ctl_report_tagret_port_groups\n")); cdb = (struct scsi_maintenance_in *)ctsio->cdb; softc = control_softc; @@ -7168,17 +6966,6 @@ ctl_maintenance_in(struct ctl_scsiio *ct retval = CTL_RETVAL_COMPLETE; - if ((cdb->byte2 & SERVICE_ACTION_MASK) != SA_RPRT_TRGT_GRP) { - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 4); - ctl_done((union ctl_io *)ctsio); - return(retval); - } - single = ctl_is_single; if (single) num_target_port_groups = NUM_TARGET_PORT_GROUPS - 1; @@ -7294,6 +7081,217 @@ ctl_maintenance_in(struct ctl_scsiio *ct } int +ctl_report_supported_opcodes(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct scsi_report_supported_opcodes *cdb; + const struct ctl_cmd_entry *entry, *sentry; + struct scsi_report_supported_opcodes_all *all; + struct scsi_report_supported_opcodes_descr *descr; + struct scsi_report_supported_opcodes_one *one; + int retval; + int alloc_len, total_len; + int opcode, service_action, i, j, num; + + CTL_DEBUG_PRINT(("ctl_report_supported_opcodes\n")); + + cdb = (struct scsi_report_supported_opcodes *)ctsio->cdb; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + retval = CTL_RETVAL_COMPLETE; + + opcode = cdb->requested_opcode; + service_action = scsi_2btoul(cdb->requested_service_action); + switch (cdb->options & RSO_OPTIONS_MASK) { + case RSO_OPTIONS_ALL: + num = 0; + for (i = 0; i < 256; i++) { + entry = &ctl_cmd_table[i]; + if (entry->flags & CTL_CMD_FLAG_SA5) { + for (j = 0; j < 32; j++) { + sentry = &((const struct ctl_cmd_entry *) + entry->execute)[j]; + if (ctl_cmd_applicable( + lun->be_lun->lun_type, sentry)) + num++; + } + } else { + if (ctl_cmd_applicable(lun->be_lun->lun_type, + entry)) + num++; + } + } + total_len = sizeof(struct scsi_report_supported_opcodes_all) + + num * sizeof(struct scsi_report_supported_opcodes_descr); + break; + case RSO_OPTIONS_OC: + if (ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) { + ctl_set_invalid_field(/*ctsio*/ ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 2, + /*bit_valid*/ 1, + /*bit*/ 2); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; + break; + case RSO_OPTIONS_OC_SA: + if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 || + service_action >= 32) { + ctl_set_invalid_field(/*ctsio*/ ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 2, + /*bit_valid*/ 1, + /*bit*/ 2); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32; + break; + default: + ctl_set_invalid_field(/*ctsio*/ ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 2, + /*bit_valid*/ 1, + /*bit*/ 2); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + alloc_len = scsi_4btoul(cdb->length); + + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + + ctsio->kern_sg_entries = 0; + + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + + switch (cdb->options & RSO_OPTIONS_MASK) { + case RSO_OPTIONS_ALL: + all = (struct scsi_report_supported_opcodes_all *) + ctsio->kern_data_ptr; + num = 0; + for (i = 0; i < 256; i++) { + entry = &ctl_cmd_table[i]; + if (entry->flags & CTL_CMD_FLAG_SA5) { + for (j = 0; j < 32; j++) { + sentry = &((const struct ctl_cmd_entry *) + entry->execute)[j]; + if (!ctl_cmd_applicable( + lun->be_lun->lun_type, sentry)) + continue; + descr = &all->descr[num++]; + descr->opcode = i; + scsi_ulto2b(j, descr->service_action); + descr->flags = RSO_SERVACTV; + scsi_ulto2b(sentry->length, + descr->cdb_length); + } + } else { + if (!ctl_cmd_applicable(lun->be_lun->lun_type, + entry)) + continue; + descr = &all->descr[num++]; + descr->opcode = i; + scsi_ulto2b(0, descr->service_action); + descr->flags = 0; + scsi_ulto2b(entry->length, descr->cdb_length); + } + } + scsi_ulto4b( + num * sizeof(struct scsi_report_supported_opcodes_descr), + all->length); + break; + case RSO_OPTIONS_OC: + one = (struct scsi_report_supported_opcodes_one *) + ctsio->kern_data_ptr; + entry = &ctl_cmd_table[opcode]; + goto fill_one; + case RSO_OPTIONS_OC_SA: + one = (struct scsi_report_supported_opcodes_one *) + ctsio->kern_data_ptr; + entry = &ctl_cmd_table[opcode]; + entry = &((const struct ctl_cmd_entry *) + entry->execute)[service_action]; +fill_one: + if (ctl_cmd_applicable(lun->be_lun->lun_type, entry)) { + one->support = 3; + scsi_ulto2b(entry->length, one->cdb_length); + one->cdb_usage[0] = opcode; + memcpy(&one->cdb_usage[1], entry->usage, + entry->length - 1); + } else + one->support = 1; + break; + } + + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + + ctl_datamove((union ctl_io *)ctsio); + return(retval); +} + +int +ctl_report_supported_tmf(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct scsi_report_supported_tmf *cdb; + struct scsi_report_supported_tmf_data *data; + int retval; + int alloc_len, total_len; + + CTL_DEBUG_PRINT(("ctl_report_supported_tmf\n")); + + cdb = (struct scsi_report_supported_tmf *)ctsio->cdb; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + retval = CTL_RETVAL_COMPLETE; + + total_len = sizeof(struct scsi_report_supported_tmf_data); + alloc_len = scsi_4btoul(cdb->length); + + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + + ctsio->kern_sg_entries = 0; + + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + + data = (struct scsi_report_supported_tmf_data *)ctsio->kern_data_ptr; + data->byte1 |= RST_ATS | RST_LURS | RST_TRS; + + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + + ctl_datamove((union ctl_io *)ctsio); + return (retval); +} + +int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio) { struct scsi_per_res_in *cdb; @@ -7329,18 +7327,8 @@ retry: case SPRI_RC: /* report capabilities */ total_len = sizeof(struct scsi_per_res_cap); break; - case SPRI_RS: /* read full status */ default: - mtx_unlock(&lun->lun_lock); - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - break; /* NOTREACHED */ + panic("Invalid PR type %x", cdb->action); } mtx_unlock(&lun->lun_lock); @@ -8049,28 +8037,6 @@ ctl_persistent_reserve_out(struct ctl_sc } } - switch (cdb->action & SPRO_ACTION_MASK) { - case SPRO_REGISTER: - case SPRO_RESERVE: - case SPRO_RELEASE: - case SPRO_CLEAR: - case SPRO_PREEMPT: - case SPRO_REG_IGNO: - break; - case SPRO_REG_MOVE: - case SPRO_PRE_ABO: - default: - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - break; /* NOTREACHED */ - } - param_len = scsi_4btoul(cdb->length); if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { @@ -8439,19 +8405,8 @@ ctl_persistent_reserve_out(struct ctl_sc return (CTL_RETVAL_COMPLETE); break; } - case SPRO_REG_MOVE: - case SPRO_PRE_ABO: default: - free(ctsio->kern_data_ptr, M_CTL); - ctl_set_invalid_field(/*ctsio*/ ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - break; /* NOTREACHED */ + panic("Invalid PR type %x", cdb->action); } done: @@ -8600,7 +8555,7 @@ ctl_read_write(struct ctl_scsiio *ctsio) struct ctl_lba_len_flags *lbalen; uint64_t lba; uint32_t num_blocks; - int reladdr, fua, dpo, ebp; + int fua, dpo; int retval; int isread; @@ -8608,10 +8563,8 @@ ctl_read_write(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_read_write: command: %#x\n", ctsio->cdb[0])); - reladdr = 0; fua = 0; dpo = 0; - ebp = 0; retval = CTL_RETVAL_COMPLETE; @@ -8659,17 +8612,11 @@ ctl_read_write(struct ctl_scsiio *ctsio) cdb = (struct scsi_rw_10 *)ctsio->cdb; - if (cdb->byte2 & SRW10_RELADDR) - reladdr = 1; if (cdb->byte2 & SRW10_FUA) fua = 1; if (cdb->byte2 & SRW10_DPO) dpo = 1; - if ((cdb->opcode == WRITE_10) - && (cdb->byte2 & SRW10_EBP)) - ebp = 1; - lba = scsi_4btoul(cdb->addr); num_blocks = scsi_2btoul(cdb->length); break; @@ -8699,8 +8646,6 @@ ctl_read_write(struct ctl_scsiio *ctsio) cdb = (struct scsi_rw_12 *)ctsio->cdb; - if (cdb->byte2 & SRW12_RELADDR) - reladdr = 1; if (cdb->byte2 & SRW12_FUA) fua = 1; if (cdb->byte2 & SRW12_DPO) @@ -8728,8 +8673,6 @@ ctl_read_write(struct ctl_scsiio *ctsio) cdb = (struct scsi_rw_16 *)ctsio->cdb; - if (cdb->byte2 & SRW12_RELADDR) - reladdr = 1; if (cdb->byte2 & SRW12_FUA) fua = 1; if (cdb->byte2 & SRW12_DPO) @@ -8769,20 +8712,6 @@ ctl_read_write(struct ctl_scsiio *ctsio) * getting it to do write-through for a particular transaction may * not be possible. */ - /* - * We don't support relative addressing. That also requires - * supporting linked commands, which we don't do. - */ - if (reladdr != 0) { - ctl_set_invalid_field(ctsio, - /*sks_valid*/ 1, - /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } /* * The first check is to make sure we're in bounds, the second @@ -10332,7 +10261,7 @@ ctl_extent_check(union ctl_io *io1, unio static ctl_action ctl_check_for_blockage(union ctl_io *pending_io, union ctl_io *ooa_io) { - struct ctl_cmd_entry *pending_entry, *ooa_entry; + const struct ctl_cmd_entry *pending_entry, *ooa_entry; ctl_serialize_action *serialize_row; /* @@ -10405,8 +10334,8 @@ ctl_check_for_blockage(union ctl_io *pen || (ooa_io->scsiio.tag_type == CTL_TAG_ORDERED))) return (CTL_ACTION_BLOCK); - pending_entry = &ctl_cmd_table[pending_io->scsiio.cdb[0]]; - ooa_entry = &ctl_cmd_table[ooa_io->scsiio.cdb[0]]; + pending_entry = ctl_get_cmd_entry(&pending_io->scsiio); + ooa_entry = ctl_get_cmd_entry(&ooa_io->scsiio); serialize_row = ctl_serialize_table[ooa_entry->seridx]; @@ -10536,9 +10465,8 @@ ctl_check_blocked(struct ctl_lun *lun) case CTL_ACTION_PASS: case CTL_ACTION_SKIP: { struct ctl_softc *softc; - struct ctl_cmd_entry *entry; + const struct ctl_cmd_entry *entry; uint32_t initidx; - uint8_t opcode; int isc_retval; /* @@ -10575,8 +10503,7 @@ ctl_check_blocked(struct ctl_lun *lun) } break; } - opcode = cur_blocked->scsiio.cdb[0]; - entry = &ctl_cmd_table[opcode]; + entry = ctl_get_cmd_entry(&cur_blocked->scsiio); softc = control_softc; initidx = ctl_get_initindex(&cur_blocked->io_hdr.nexus); @@ -10624,7 +10551,7 @@ ctl_check_blocked(struct ctl_lun *lun) */ static int ctl_scsiio_lun_check(struct ctl_softc *ctl_softc, struct ctl_lun *lun, - struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio) + const struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio) { int retval; @@ -10984,8 +10911,7 @@ static int ctl_scsiio_precheck(struct ctl_softc *ctl_softc, struct ctl_scsiio *ctsio) { struct ctl_lun *lun; - struct ctl_cmd_entry *entry; - uint8_t opcode; + const struct ctl_cmd_entry *entry; uint32_t initidx, targ_lun; int retval; @@ -10993,8 +10919,6 @@ ctl_scsiio_precheck(struct ctl_softc *ct lun = NULL; - opcode = ctsio->cdb[0]; - targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; if ((targ_lun < CTL_MAX_LUNS) && (ctl_softc->ctl_luns[targ_lun] != NULL)) { @@ -11013,13 +10937,27 @@ ctl_scsiio_precheck(struct ctl_softc *ct if (lun->be_lun->lun_type == T_PROCESSOR) { ctsio->io_hdr.flags |= CTL_FLAG_CONTROL_DEV; } + + /* + * Every I/O goes into the OOA queue for a + * particular LUN, and stays there until completion. + */ + mtx_lock(&lun->lun_lock); + TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, + ooa_links); } } else { ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL; ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL; } - entry = &ctl_cmd_table[opcode]; + /* Get command entry and return error if it is unsuppotyed. */ + entry = ctl_validate_command(ctsio); + if (entry == NULL) { + if (lun) + mtx_unlock(&lun->lun_lock); + return (retval); + } ctsio->io_hdr.flags &= ~CTL_FLAG_DATA_MASK; ctsio->io_hdr.flags |= entry->flags & CTL_FLAG_DATA_MASK; @@ -11043,43 +10981,15 @@ ctl_scsiio_precheck(struct ctl_softc *ct CTL_DEBUG_PRINT(("ctl_scsiio_precheck: bailing out due to invalid LUN\n")); return (retval); } else { - mtx_lock(&lun->lun_lock); - - /* - * Every I/O goes into the OOA queue for a particular LUN, and - * stays there until completion. - */ - TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links); - /* * Make sure we support this particular command on this LUN. * e.g., we don't support writes to the control LUN. */ - switch (lun->be_lun->lun_type) { - case T_PROCESSOR: - if (((entry->flags & CTL_CMD_FLAG_OK_ON_PROC) == 0) - && ((entry->flags & CTL_CMD_FLAG_OK_ON_ALL_LUNS) - == 0)) { - mtx_unlock(&lun->lun_lock); - ctl_set_invalid_opcode(ctsio); - ctl_done((union ctl_io *)ctsio); - return (retval); - } - break; - case T_DIRECT: - if (((entry->flags & CTL_CMD_FLAG_OK_ON_SLUN) == 0) - && ((entry->flags & CTL_CMD_FLAG_OK_ON_ALL_LUNS) - == 0)){ - mtx_unlock(&lun->lun_lock); - ctl_set_invalid_opcode(ctsio); - ctl_done((union ctl_io *)ctsio); - return (retval); - } - break; - default: + if (!ctl_cmd_applicable(lun->be_lun->lun_type, entry)) { mtx_unlock(&lun->lun_lock); - panic("Unsupported CTL LUN type %d\n", - lun->be_lun->lun_type); + ctl_set_invalid_opcode(ctsio); + ctl_done((union ctl_io *)ctsio); + return (retval); } } @@ -11091,7 +11001,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct * this initiator, clear it, because it sent down a command other * than request sense. */ - if ((opcode != REQUEST_SENSE) + if ((ctsio->cdb[0] != REQUEST_SENSE) && (ctl_is_set(lun->have_ca, initidx))) ctl_clear_mask(lun->have_ca, initidx); @@ -11187,7 +11097,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct CTL_HA_STATUS_SUCCESS) { printf("CTL:precheck, ctl_ha_msg_send returned %d\n", isc_retval); - printf("CTL:opcode is %x\n",opcode); + printf("CTL:opcode is %x\n", ctsio->cdb[0]); } else { #if 0 printf("CTL:Precheck sent msg, opcode is %x\n",opcode); @@ -11242,17 +11152,85 @@ ctl_scsiio_precheck(struct ctl_softc *ct return (retval); } +const struct ctl_cmd_entry * +ctl_get_cmd_entry(struct ctl_scsiio *ctsio) +{ + const struct ctl_cmd_entry *entry; + int service_action; + + entry = &ctl_cmd_table[ctsio->cdb[0]]; + if (entry->flags & CTL_CMD_FLAG_SA5) { + service_action = ctsio->cdb[1] & SERVICE_ACTION_MASK; + entry = &((const struct ctl_cmd_entry *) + entry->execute)[service_action]; + } + return (entry); +} + +const struct ctl_cmd_entry * +ctl_validate_command(struct ctl_scsiio *ctsio) +{ + const struct ctl_cmd_entry *entry; + int i; + uint8_t diff; + + entry = ctl_get_cmd_entry(ctsio); + if (entry->execute == NULL) { + ctl_set_invalid_opcode(ctsio); + ctl_done((union ctl_io *)ctsio); + return (NULL); + } + KASSERT(entry->length > 0, + ("Not defined length for command 0x%02x/0x%02x", + ctsio->cdb[0], ctsio->cdb[1])); + for (i = 1; i < entry->length; i++) { + diff = ctsio->cdb[i] & ~entry->usage[i - 1]; + if (diff == 0) + continue; + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ i, + /*bit_valid*/ 1, + /*bit*/ fls(diff) - 1); + ctl_done((union ctl_io *)ctsio); + return (NULL); + } + return (entry); +} + +static int +ctl_cmd_applicable(uint8_t lun_type, const struct ctl_cmd_entry *entry) +{ + + switch (lun_type) { + case T_PROCESSOR: + if (((entry->flags & CTL_CMD_FLAG_OK_ON_PROC) == 0) && + ((entry->flags & CTL_CMD_FLAG_OK_ON_ALL_LUNS) == 0)) + return (0); + break; + case T_DIRECT: + if (((entry->flags & CTL_CMD_FLAG_OK_ON_SLUN) == 0) && + ((entry->flags & CTL_CMD_FLAG_OK_ON_ALL_LUNS) == 0)) + return (0); + break; + default: + return (0); + } + return (1); +} + static int ctl_scsiio(struct ctl_scsiio *ctsio) { int retval; - struct ctl_cmd_entry *entry; + const struct ctl_cmd_entry *entry; retval = CTL_RETVAL_COMPLETE; CTL_DEBUG_PRINT(("ctl_scsiio cdb[0]=%02X\n", ctsio->cdb[0])); - entry = &ctl_cmd_table[ctsio->cdb[0]]; + entry = ctl_get_cmd_entry(ctsio); /* * If this I/O has been aborted, just send it straight to @@ -11684,15 +11662,13 @@ ctl_handle_isc(union ctl_io *io) free_io = ctl_serialize_other_sc_cmd(&io->scsiio); break; case CTL_MSG_R2R: { - uint8_t opcode; - struct ctl_cmd_entry *entry; + const struct ctl_cmd_entry *entry; /* * This is only used in SER_ONLY mode. */ free_io = 0; - opcode = io->scsiio.cdb[0]; - entry = &ctl_cmd_table[opcode]; + entry = ctl_get_cmd_entry(&io->scsiio); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 16:54:05 2014 Return-Path: Delivered-To: svn-src-stable-10@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 80427B61; Tue, 15 Jul 2014 16:54: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 6BBA72B56; Tue, 15 Jul 2014 16:54: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 s6FGs5cG076422; Tue, 15 Jul 2014 16:54:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FGs4gK076412; Tue, 15 Jul 2014 16:54:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151654.s6FGs4gK076412@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 16:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268675 - in stable/10/sys/cam: ctl scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 16:54:05 -0000 Author: mav Date: Tue Jul 15 16:54:04 2014 New Revision: 268675 URL: http://svnweb.freebsd.org/changeset/base/268675 Log: MFC r268103: Add support for REPORT TIMESTAMP command. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:53:04 2014 (r268674) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:54:04 2014 (r268675) @@ -7292,6 +7292,58 @@ ctl_report_supported_tmf(struct ctl_scsi } int +ctl_report_timestamp(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct scsi_report_timestamp *cdb; + struct scsi_report_timestamp_data *data; + struct timeval tv; + int64_t timestamp; + int retval; + int alloc_len, total_len; + + CTL_DEBUG_PRINT(("ctl_report_timestamp\n")); + + cdb = (struct scsi_report_timestamp *)ctsio->cdb; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + retval = CTL_RETVAL_COMPLETE; + + total_len = sizeof(struct scsi_report_timestamp_data); + alloc_len = scsi_4btoul(cdb->length); + + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + + ctsio->kern_sg_entries = 0; + + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + + data = (struct scsi_report_timestamp_data *)ctsio->kern_data_ptr; + scsi_ulto2b(sizeof(*data) - 2, data->length); + data->origin = RTS_ORIG_OUTSIDE; + getmicrotime(&tv); + timestamp = (int64_t)tv.tv_sec * 1000 + tv.tv_usec / 1000; + scsi_ulto4b(timestamp >> 16, data->timestamp); + scsi_ulto2b(timestamp & 0xffff, &data->timestamp[4]); + + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + + ctl_datamove((union ctl_io *)ctsio); + return (retval); +} + +int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio) { struct scsi_per_res_in *cdb; Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Tue Jul 15 16:53:04 2014 (r268674) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Tue Jul 15 16:54:04 2014 (r268675) @@ -309,7 +309,19 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_LUN_PAT_NONE, 12, {0x0d, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, -/* 0e-1f */ +/* 0E */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 0F REPORT TIMESTAMP */ +{ctl_report_timestamp, CTL_SERIDX_MAIN_IN, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_SECONDARY | + CTL_FLAG_DATA_IN, + CTL_LUN_PAT_NONE, + 12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + +/* 10-1f */ }; const struct ctl_cmd_entry ctl_cmd_table[256] = Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Tue Jul 15 16:53:04 2014 (r268674) +++ stable/10/sys/cam/ctl/ctl_private.h Tue Jul 15 16:54:04 2014 (r268675) @@ -501,6 +501,7 @@ int ctl_persistent_reserve_out(struct ct int ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio); int ctl_report_supported_opcodes(struct ctl_scsiio *ctsio); int ctl_report_supported_tmf(struct ctl_scsiio *ctsio); +int ctl_report_timestamp(struct ctl_scsiio *ctsio); int ctl_isc(struct ctl_scsiio *ctsio); #endif /* _KERNEL */ Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Tue Jul 15 16:53:04 2014 (r268674) +++ stable/10/sys/cam/scsi/scsi_all.h Tue Jul 15 16:54:04 2014 (r268675) @@ -1059,6 +1059,29 @@ struct scsi_report_supported_tmf_data uint8_t reserved[2]; }; +struct scsi_report_timestamp +{ + uint8_t opcode; + uint8_t service_action; + uint8_t reserved[4]; + uint8_t length[4]; + uint8_t reserved1; + uint8_t control; +}; + +struct scsi_report_timestamp_data +{ + uint8_t length[2]; + uint8_t origin; +#define RTS_ORIG_MASK 0x00 +#define RTS_ORIG_ZERO 0x00 +#define RTS_ORIG_SET 0x02 +#define RTS_ORIG_OUTSIDE 0x03 + uint8_t reserved; + uint8_t timestamp[6]; + uint8_t reserve2[2]; +}; + struct ata_pass_16 { u_int8_t opcode; u_int8_t protocol; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 16:55:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4A19BCB0; Tue, 15 Jul 2014 16:55: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 2A9152B65; Tue, 15 Jul 2014 16:55: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 s6FGtFF2076845; Tue, 15 Jul 2014 16:55:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FGtD58076836; Tue, 15 Jul 2014 16:55:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151655.s6FGtD58076836@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 16:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268676 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 16:55:15 -0000 Author: mav Date: Tue Jul 15 16:55:13 2014 New Revision: 268676 URL: http://svnweb.freebsd.org/changeset/base/268676 Log: MFC r268265: Remove targ_enable()/targ_disable() frontend methods. Those methods were never implemented, and I believe that their concept is wrong, since single frontend (SCSI port) can not handle several targets. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_internal.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:54:04 2014 (r268675) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:55:13 2014 (r268676) @@ -331,8 +331,6 @@ static int ctl_open(struct cdev *dev, in static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td); static void ctl_ioctl_online(void *arg); static void ctl_ioctl_offline(void *arg); -static int ctl_ioctl_targ_enable(void *arg, struct ctl_id targ_id); -static int ctl_ioctl_targ_disable(void *arg, struct ctl_id targ_id); static int ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id); static int ctl_ioctl_lun_disable(void *arg, struct ctl_id targ_id, int lun_id); static int ctl_ioctl_do_datamove(struct ctl_scsiio *ctsio); @@ -1095,8 +1093,6 @@ ctl_init(void) fe->port_online = ctl_ioctl_online; fe->port_offline = ctl_ioctl_offline; fe->onoff_arg = &softc->ioctl_info; - fe->targ_enable = ctl_ioctl_targ_enable; - fe->targ_disable = ctl_ioctl_targ_disable; fe->lun_enable = ctl_ioctl_lun_enable; fe->lun_disable = ctl_ioctl_lun_disable; fe->targ_lun_arg = &softc->ioctl_info; @@ -1451,22 +1447,6 @@ bailout: return (retval); } -/* - * XXX KDM should we pretend to do something in the target/lun - * enable/disable functions? - */ -static int -ctl_ioctl_targ_enable(void *arg, struct ctl_id targ_id) -{ - return (0); -} - -static int -ctl_ioctl_targ_disable(void *arg, struct ctl_id targ_id) -{ - return (0); -} - static int ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id) { @@ -4313,24 +4293,6 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) { int retval; - /* - * XXX KDM this only works for ONE TARGET ID. We'll need - * to do things differently if we go to a multiple target - * ID scheme. - */ - if ((fe->status & CTL_PORT_STATUS_TARG_ONLINE) == 0) { - - retval = fe->targ_enable(fe->targ_lun_arg, target_id); - if (retval != 0) { - printf("ctl_alloc_lun: FETD %s port %d " - "returned error %d for targ_enable on " - "target %ju\n", fe->port_name, - fe->targ_port, retval, - (uintmax_t)target_id.id); - } else - fe->status |= CTL_PORT_STATUS_TARG_ONLINE; - } - retval = fe->lun_enable(fe->targ_lun_arg, target_id,lun_number); if (retval != 0) { printf("ctl_alloc_lun: FETD %s port %d returned error " Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 16:54:04 2014 (r268675) +++ stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 16:55:13 2014 (r268676) @@ -105,30 +105,6 @@ typedef int (*fe_devid_t)(struct ctl_scs * and port_offline(). This is specified by the * FETD. * - * targ_enable(): This function is called, with targ_lun_arg and a - * target ID as its arguments, by CTL when it wants - * the FETD to enable a particular target. targ_enable() - * will always be called for a particular target ID - * before any LUN is enabled for that target. If the - * FETD does not support enabling targets, but rather - * LUNs, it should ignore this call and return 0. If - * the FETD does support enabling targets, it should - * return 0 for success and non-zero if it cannot - * enable the given target. - * - * TODO: Add the ability to specify a WWID here. - * - * targ_disable(): This function is called, with targ_lun_arg and a - * target ID as its arguments, by CTL when it wants - * the FETD to disable a particular target. - * targ_disable() will always be called for a - * particular target ID after all LUNs are disabled - * on that particular target. If the FETD does not - * support enabling targets, it should ignore this - * call and return 0. If the FETD does support - * enabling targets, it should return 0 for success, - * and non-zero if it cannot disable the given target. - * * lun_enable(): This function is called, with targ_lun_arg, a target * ID and a LUN ID as its arguments, by CTL when it * wants the FETD to enable a particular LUN. If the @@ -212,8 +188,6 @@ struct ctl_frontend { port_func_t port_online; /* passed to CTL */ port_func_t port_offline; /* passed to CTL */ void *onoff_arg; /* passed to CTL */ - targ_func_t targ_enable; /* passed to CTL */ - targ_func_t targ_disable; /* passed to CTL */ lun_func_t lun_enable; /* passed to CTL */ lun_func_t lun_disable; /* passed to CTL */ fe_ioctl_t ioctl; /* passed to CTL */ Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Jul 15 16:54:04 2014 (r268675) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Jul 15 16:55:13 2014 (r268676) @@ -101,8 +101,6 @@ void cfcs_shutdown(void); static void cfcs_poll(struct cam_sim *sim); static void cfcs_online(void *arg); static void cfcs_offline(void *arg); -static int cfcs_targ_enable(void *arg, struct ctl_id targ_id); -static int cfcs_targ_disable(void *arg, struct ctl_id targ_id); static int cfcs_lun_enable(void *arg, struct ctl_id target_id, int lun_id); static int cfcs_lun_disable(void *arg, struct ctl_id target_id, int lun_id); static void cfcs_datamove(union ctl_io *io); @@ -163,8 +161,6 @@ cfcs_init(void) fe->port_online = cfcs_online; fe->port_offline = cfcs_offline; fe->onoff_arg = softc; - fe->targ_enable = cfcs_targ_enable; - fe->targ_disable = cfcs_targ_disable; fe->lun_enable = cfcs_lun_enable; fe->lun_disable = cfcs_lun_disable; fe->targ_lun_arg = softc; @@ -336,18 +332,6 @@ cfcs_offline(void *arg) } static int -cfcs_targ_enable(void *arg, struct ctl_id targ_id) -{ - return (0); -} - -static int -cfcs_targ_disable(void *arg, struct ctl_id targ_id) -{ - return (0); -} - -static int cfcs_lun_enable(void *arg, struct ctl_id target_id, int lun_id) { return (0); Modified: stable/10/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_internal.c Tue Jul 15 16:54:04 2014 (r268675) +++ stable/10/sys/cam/ctl/ctl_frontend_internal.c Tue Jul 15 16:55:13 2014 (r268676) @@ -192,8 +192,6 @@ int cfi_init(void); void cfi_shutdown(void) __unused; static void cfi_online(void *arg); static void cfi_offline(void *arg); -static int cfi_targ_enable(void *arg, struct ctl_id targ_id); -static int cfi_targ_disable(void *arg, struct ctl_id targ_id); static int cfi_lun_enable(void *arg, struct ctl_id target_id, int lun_id); static int cfi_lun_disable(void *arg, struct ctl_id target_id, int lun_id); static void cfi_datamove(union ctl_io *io); @@ -261,8 +259,6 @@ cfi_init(void) fe->port_online = cfi_online; fe->port_offline = cfi_offline; fe->onoff_arg = softc; - fe->targ_enable = cfi_targ_enable; - fe->targ_disable = cfi_targ_disable; fe->lun_enable = cfi_lun_enable; fe->lun_disable = cfi_lun_disable; fe->targ_lun_arg = softc; @@ -347,18 +343,6 @@ cfi_offline(void *arg) } static int -cfi_targ_enable(void *arg, struct ctl_id targ_id) -{ - return (0); -} - -static int -cfi_targ_disable(void *arg, struct ctl_id targ_id) -{ - return (0); -} - -static int cfi_lun_enable(void *arg, struct ctl_id target_id, int lun_id) { struct cfi_softc *softc; Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 16:54:04 2014 (r268675) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 16:55:13 2014 (r268676) @@ -149,8 +149,6 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO int cfiscsi_init(void); static void cfiscsi_online(void *arg); static void cfiscsi_offline(void *arg); -static int cfiscsi_targ_enable(void *arg, struct ctl_id targ_id); -static int cfiscsi_targ_disable(void *arg, struct ctl_id targ_id); static int cfiscsi_lun_enable(void *arg, struct ctl_id target_id, int lun_id); static int cfiscsi_lun_disable(void *arg, @@ -1346,8 +1344,6 @@ cfiscsi_init(void) fe->port_online = cfiscsi_online; fe->port_offline = cfiscsi_offline; fe->onoff_arg = softc; - fe->targ_enable = cfiscsi_targ_enable; - fe->targ_disable = cfiscsi_targ_disable; fe->lun_enable = cfiscsi_lun_enable; fe->lun_disable = cfiscsi_lun_disable; fe->targ_lun_arg = softc; @@ -1451,20 +1447,6 @@ cfiscsi_offline(void *arg) #endif } -static int -cfiscsi_targ_enable(void *arg, struct ctl_id targ_id) -{ - - return (0); -} - -static int -cfiscsi_targ_disable(void *arg, struct ctl_id targ_id) -{ - - return (0); -} - static void cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) { Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Tue Jul 15 16:54:04 2014 (r268675) +++ stable/10/sys/cam/ctl/scsi_ctl.c Tue Jul 15 16:55:13 2014 (r268676) @@ -211,8 +211,6 @@ static void ctlfedone(struct cam_periph static void ctlfe_onoffline(void *arg, int online); static void ctlfe_online(void *arg); static void ctlfe_offline(void *arg); -static int ctlfe_targ_enable(void *arg, struct ctl_id targ_id); -static int ctlfe_targ_disable(void *arg, struct ctl_id targ_id); static int ctlfe_lun_enable(void *arg, struct ctl_id targ_id, int lun_id); static int ctlfe_lun_disable(void *arg, struct ctl_id targ_id, @@ -410,8 +408,6 @@ ctlfeasync(void *callback_arg, uint32_t fe->port_online = ctlfe_online; fe->port_offline = ctlfe_offline; fe->onoff_arg = bus_softc; - fe->targ_enable = ctlfe_targ_enable; - fe->targ_disable = ctlfe_targ_disable; fe->lun_enable = ctlfe_lun_enable; fe->lun_disable = ctlfe_lun_disable; fe->targ_lun_arg = bus_softc; @@ -1927,18 +1923,6 @@ ctlfe_offline(void *arg) xpt_free_path(path); } -static int -ctlfe_targ_enable(void *arg, struct ctl_id targ_id) -{ - return (0); -} - -static int -ctlfe_targ_disable(void *arg, struct ctl_id targ_id) -{ - return (0); -} - /* * This will get called to enable a LUN on every bus that is attached to * CTL. So we only need to create a path/periph for this particular bus. From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 16:57:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 64663EE0; Tue, 15 Jul 2014 16:57: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 4F9A62B7C; Tue, 15 Jul 2014 16:57:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6FGvV45077760; Tue, 15 Jul 2014 16:57:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FGvUw0077752; Tue, 15 Jul 2014 16:57:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151657.s6FGvUw0077752@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 16:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268677 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 16:57:31 -0000 Author: mav Date: Tue Jul 15 16:57:30 2014 New Revision: 268677 URL: http://svnweb.freebsd.org/changeset/base/268677 Log: MFC r268266, r268275: Separate concepts of frontend and port. Before iSCSI implementation CTL had no knowledge about frontend drivers, it had only frontends, which really were ports (alike to LUNs, if comparing to backends). But iSCSI added there ioctl() method, which does not belong to frontend as a port, but belongs to a frontend driver. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_internal.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:55:13 2014 (r268676) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:57:30 2014 (r268677) @@ -468,6 +468,11 @@ static moduledata_t ctl_moduledata = { DECLARE_MODULE(ctl, ctl_moduledata, SI_SUB_CONFIGURE, SI_ORDER_THIRD); MODULE_VERSION(ctl, 1); +static struct ctl_frontend ioctl_frontend = +{ + .name = "ioctl", +}; + static void ctl_isc_handler_finish_xfer(struct ctl_softc *ctl_softc, union ctl_ha_msg *msg_info) @@ -928,7 +933,7 @@ ctl_init(void) { struct ctl_softc *softc; struct ctl_io_pool *internal_pool, *emergency_pool, *other_pool; - struct ctl_frontend *fe; + struct ctl_port *port; uint8_t sc_id =0; int i, error, retval; //int isc_retval; @@ -1008,6 +1013,7 @@ ctl_init(void) STAILQ_INIT(&softc->lun_list); STAILQ_INIT(&softc->pending_lun_queue); STAILQ_INIT(&softc->fe_list); + STAILQ_INIT(&softc->port_list); STAILQ_INIT(&softc->be_list); STAILQ_INIT(&softc->io_pools); @@ -1085,23 +1091,25 @@ ctl_init(void) /* * Initialize the ioctl front end. */ - fe = &softc->ioctl_info.fe; - sprintf(softc->ioctl_info.port_name, "CTL ioctl"); - fe->port_type = CTL_PORT_IOCTL; - fe->num_requested_ctl_io = 100; - fe->port_name = softc->ioctl_info.port_name; - fe->port_online = ctl_ioctl_online; - fe->port_offline = ctl_ioctl_offline; - fe->onoff_arg = &softc->ioctl_info; - fe->lun_enable = ctl_ioctl_lun_enable; - fe->lun_disable = ctl_ioctl_lun_disable; - fe->targ_lun_arg = &softc->ioctl_info; - fe->fe_datamove = ctl_ioctl_datamove; - fe->fe_done = ctl_ioctl_done; - fe->max_targets = 15; - fe->max_target_id = 15; + ctl_frontend_register(&ioctl_frontend); + port = &softc->ioctl_info.port; + port->frontend = &ioctl_frontend; + sprintf(softc->ioctl_info.port_name, "ioctl"); + port->port_type = CTL_PORT_IOCTL; + port->num_requested_ctl_io = 100; + port->port_name = softc->ioctl_info.port_name; + port->port_online = ctl_ioctl_online; + port->port_offline = ctl_ioctl_offline; + port->onoff_arg = &softc->ioctl_info; + port->lun_enable = ctl_ioctl_lun_enable; + port->lun_disable = ctl_ioctl_lun_disable; + port->targ_lun_arg = &softc->ioctl_info; + port->fe_datamove = ctl_ioctl_datamove; + port->fe_done = ctl_ioctl_done; + port->max_targets = 15; + port->max_target_id = 15; - if (ctl_frontend_register(&softc->ioctl_info.fe, + if (ctl_port_register(&softc->ioctl_info.port, (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) { printf("ctl: ioctl front end registration failed, will " "continue anyway\n"); @@ -1127,7 +1135,7 @@ ctl_shutdown(void) softc = (struct ctl_softc *)control_softc; - if (ctl_frontend_deregister(&softc->ioctl_info.fe) != 0) + if (ctl_port_deregister(&softc->ioctl_info.port) != 0) printf("ctl: ioctl front end deregistration failed\n"); mtx_lock(&softc->ctl_lock); @@ -1142,6 +1150,8 @@ ctl_shutdown(void) mtx_unlock(&softc->ctl_lock); + ctl_frontend_deregister(&ioctl_frontend); + /* * This will rip the rug out from under any FETDs or anyone else * that has a pool allocated. Since we increment our module @@ -1206,7 +1216,7 @@ int ctl_port_enable(ctl_port_type port_type) { struct ctl_softc *softc; - struct ctl_frontend *fe; + struct ctl_port *port; if (ctl_is_single == 0) { union ctl_ha_msg msg_info; @@ -1235,13 +1245,13 @@ ctl_port_enable(ctl_port_type port_type) softc = control_softc; - STAILQ_FOREACH(fe, &softc->fe_list, links) { - if (port_type & fe->port_type) + STAILQ_FOREACH(port, &softc->port_list, links) { + if (port_type & port->port_type) { #if 0 - printf("port %d\n", fe->targ_port); + printf("port %d\n", port->targ_port); #endif - ctl_frontend_online(fe); + ctl_port_online(port); } } @@ -1252,13 +1262,13 @@ int ctl_port_disable(ctl_port_type port_type) { struct ctl_softc *softc; - struct ctl_frontend *fe; + struct ctl_port *port; softc = control_softc; - STAILQ_FOREACH(fe, &softc->fe_list, links) { - if (port_type & fe->port_type) - ctl_frontend_offline(fe); + STAILQ_FOREACH(port, &softc->port_list, links) { + if (port_type & port->port_type) + ctl_port_offline(port); } return (0); @@ -1276,7 +1286,7 @@ ctl_port_list(struct ctl_port_entry *ent ctl_port_type port_type, int no_virtual) { struct ctl_softc *softc; - struct ctl_frontend *fe; + struct ctl_port *port; int entries_dropped, entries_filled; int retval; int i; @@ -1289,14 +1299,14 @@ ctl_port_list(struct ctl_port_entry *ent i = 0; mtx_lock(&softc->ctl_lock); - STAILQ_FOREACH(fe, &softc->fe_list, links) { + STAILQ_FOREACH(port, &softc->port_list, links) { struct ctl_port_entry *entry; - if ((fe->port_type & port_type) == 0) + if ((port->port_type & port_type) == 0) continue; if ((no_virtual != 0) - && (fe->virtual_port != 0)) + && (port->virtual_port != 0)) continue; if (entries_filled >= num_entries_alloced) { @@ -1305,13 +1315,13 @@ ctl_port_list(struct ctl_port_entry *ent } entry = &entries[i]; - entry->port_type = fe->port_type; - strlcpy(entry->port_name, fe->port_name, + entry->port_type = port->port_type; + strlcpy(entry->port_name, port->port_name, sizeof(entry->port_name)); - entry->physical_port = fe->physical_port; - entry->virtual_port = fe->virtual_port; - entry->wwnn = fe->wwnn; - entry->wwpn = fe->wwpn; + entry->physical_port = port->physical_port; + entry->virtual_port = port->virtual_port; + entry->wwnn = port->wwnn; + entry->wwpn = port->wwpn; i++; entries_filled++; @@ -2136,7 +2146,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } - io = ctl_alloc_io(softc->ioctl_info.fe.ctl_pool_ref); + io = ctl_alloc_io(softc->ioctl_info.port.ctl_pool_ref); if (io == NULL) { printf("ctl_ioctl: can't allocate ctl_io!\n"); retval = ENOSPC; @@ -2160,7 +2170,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, /* * The user sets the initiator ID, target and LUN IDs. */ - io->io_hdr.nexus.targ_port = softc->ioctl_info.fe.targ_port; + io->io_hdr.nexus.targ_port = softc->ioctl_info.port.targ_port; io->io_hdr.flags |= CTL_FLAG_USER_REQ; if ((io->io_hdr.io_type == CTL_IO_SCSI) && (io->scsiio.tag_type != CTL_TAG_UNTAGGED)) @@ -2183,20 +2193,20 @@ ctl_ioctl(struct cdev *dev, u_long cmd, case CTL_ENABLE_PORT: case CTL_DISABLE_PORT: case CTL_SET_PORT_WWNS: { - struct ctl_frontend *fe; + struct ctl_port *port; struct ctl_port_entry *entry; entry = (struct ctl_port_entry *)addr; mtx_lock(&softc->ctl_lock); - STAILQ_FOREACH(fe, &softc->fe_list, links) { + STAILQ_FOREACH(port, &softc->port_list, links) { int action, done; action = 0; done = 0; if ((entry->port_type == CTL_PORT_NONE) - && (entry->targ_port == fe->targ_port)) { + && (entry->targ_port == port->targ_port)) { /* * If the user only wants to enable or * disable or set WWNs on a specific port, @@ -2204,7 +2214,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, */ action = 1; done = 1; - } else if (entry->port_type & fe->port_type) { + } else if (entry->port_type & port->port_type) { /* * Compare the user's type mask with the * particular frontend type to see if we @@ -2239,21 +2249,21 @@ ctl_ioctl(struct cdev *dev, u_long cmd, STAILQ_FOREACH(lun, &softc->lun_list, links) { - fe->lun_enable(fe->targ_lun_arg, + port->lun_enable(port->targ_lun_arg, lun->target, lun->lun); } - ctl_frontend_online(fe); + ctl_port_online(port); } else if (cmd == CTL_DISABLE_PORT) { struct ctl_lun *lun; - ctl_frontend_offline(fe); + ctl_port_offline(port); STAILQ_FOREACH(lun, &softc->lun_list, links) { - fe->lun_disable( - fe->targ_lun_arg, + port->lun_disable( + port->targ_lun_arg, lun->target, lun->lun); } @@ -2262,7 +2272,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, mtx_lock(&softc->ctl_lock); if (cmd == CTL_SET_PORT_WWNS) - ctl_frontend_set_wwns(fe, + ctl_port_set_wwns(port, (entry->flags & CTL_PORT_WWNN_VALID) ? 1 : 0, entry->wwnn, (entry->flags & CTL_PORT_WWPN_VALID) ? @@ -2275,7 +2285,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_GET_PORT_LIST: { - struct ctl_frontend *fe; + struct ctl_port *port; struct ctl_port_list *list; int i; @@ -2295,7 +2305,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, list->dropped_num = 0; i = 0; mtx_lock(&softc->ctl_lock); - STAILQ_FOREACH(fe, &softc->fe_list, links) { + STAILQ_FOREACH(port, &softc->port_list, links) { struct ctl_port_entry entry, *list_entry; if (list->fill_num >= list->alloc_num) { @@ -2303,15 +2313,15 @@ ctl_ioctl(struct cdev *dev, u_long cmd, continue; } - entry.port_type = fe->port_type; - strlcpy(entry.port_name, fe->port_name, + entry.port_type = port->port_type; + strlcpy(entry.port_name, port->port_name, sizeof(entry.port_name)); - entry.targ_port = fe->targ_port; - entry.physical_port = fe->physical_port; - entry.virtual_port = fe->virtual_port; - entry.wwnn = fe->wwnn; - entry.wwpn = fe->wwpn; - if (fe->status & CTL_PORT_STATUS_ONLINE) + entry.targ_port = port->targ_port; + entry.physical_port = port->physical_port; + entry.virtual_port = port->virtual_port; + entry.wwnn = port->wwnn; + entry.wwpn = port->wwpn; + if (port->status & CTL_PORT_STATUS_ONLINE) entry.online = 1; else entry.online = 0; @@ -2846,6 +2856,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } case CTL_DUMP_STRUCTS: { int i, j, k; + struct ctl_port *port; struct ctl_frontend *fe; printf("CTL IID to WWPN map start:\n"); @@ -2883,26 +2894,25 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } } printf("CTL Persistent Reservation information end\n"); - printf("CTL Frontends:\n"); + printf("CTL Ports:\n"); /* * XXX KDM calling this without a lock. We'd likely want * to drop the lock before calling the frontend's dump * routine anyway. */ + STAILQ_FOREACH(port, &softc->port_list, links) { + printf("Port %s Frontend %s Type %u pport %d vport %d WWNN " + "%#jx WWPN %#jx\n", port->port_name, + port->frontend->name, port->port_type, + port->physical_port, port->virtual_port, + (uintmax_t)port->wwnn, (uintmax_t)port->wwpn); + } + printf("CTL Port information end\n"); + printf("CTL Frontends:\n"); STAILQ_FOREACH(fe, &softc->fe_list, links) { - printf("Frontend %s Type %u pport %d vport %d WWNN " - "%#jx WWPN %#jx\n", fe->port_name, fe->port_type, - fe->physical_port, fe->virtual_port, - (uintmax_t)fe->wwnn, (uintmax_t)fe->wwpn); - - /* - * Frontends are not required to support the dump - * routine. - */ - if (fe->fe_dump == NULL) - continue; - - fe->fe_dump(); + printf("Frontend %s\n", fe->name); + if (fe->fe_dump != NULL) + fe->fe_dump(); } printf("CTL Frontend information end\n"); break; @@ -3115,14 +3125,15 @@ ctl_ioctl(struct cdev *dev, u_long cmd, mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(fe, &softc->fe_list, links) { - if (strcmp(fe->port_name, "iscsi") == 0) + if (strcmp(fe->name, "iscsi") == 0) break; } mtx_unlock(&softc->ctl_lock); if (fe == NULL) { ci->status = CTL_ISCSI_ERROR; - snprintf(ci->error_str, sizeof(ci->error_str), "Backend \"iscsi\" not found."); + snprintf(ci->error_str, sizeof(ci->error_str), + "Frontend \"iscsi\" not found."); break; } @@ -3381,7 +3392,6 @@ ctl_pool_create(struct ctl_softc *ctl_so #if 0 if ((pool_type != CTL_POOL_EMERGENCY) && (pool_type != CTL_POOL_INTERNAL) - && (pool_type != CTL_POOL_IOCTL) && (pool_type != CTL_POOL_4OTHERSC)) MOD_INC_USE_COUNT; #endif @@ -3435,7 +3445,7 @@ ctl_pool_release(struct ctl_io_pool *poo #if 0 if ((pool->type != CTL_POOL_EMERGENCY) && (pool->type != CTL_POOL_INTERNAL) - && (pool->type != CTL_POOL_IOCTL)) + && (pool->type != CTL_POOL_4OTHERSC)) MOD_DEC_USE_COUNT; #endif @@ -4141,7 +4151,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft struct ctl_be_lun *const be_lun, struct ctl_id target_id) { struct ctl_lun *nlun, *lun; - struct ctl_frontend *fe; + struct ctl_port *port; int lun_number, i, lun_malloced; if (be_lun == NULL) @@ -4290,17 +4300,17 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft * already. Enable the target ID if it hasn't been enabled, and * enable this particular LUN. */ - STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) { + STAILQ_FOREACH(port, &ctl_softc->port_list, links) { int retval; - retval = fe->lun_enable(fe->targ_lun_arg, target_id,lun_number); + retval = port->lun_enable(port->targ_lun_arg, target_id,lun_number); if (retval != 0) { printf("ctl_alloc_lun: FETD %s port %d returned error " "%d for lun_enable on target %ju lun %d\n", - fe->port_name, fe->targ_port, retval, + port->port_name, port->targ_port, retval, (uintmax_t)target_id.id, lun_number); } else - fe->status |= CTL_PORT_STATUS_LUN_ONLINE; + port->status |= CTL_PORT_STATUS_LUN_ONLINE; } return (0); } @@ -4316,7 +4326,7 @@ ctl_free_lun(struct ctl_lun *lun) { struct ctl_softc *softc; #if 0 - struct ctl_frontend *fe; + struct ctl_port *port; #endif struct ctl_lun *nlun; int i; @@ -4340,7 +4350,7 @@ ctl_free_lun(struct ctl_lun *lun) * XXX KDM this scheme only works for a single target/multiple LUN * setup. It needs to be revamped for a multiple target scheme. * - * XXX KDM this results in fe->lun_disable() getting called twice, + * XXX KDM this results in port->lun_disable() getting called twice, * once when ctl_disable_lun() is called, and a second time here. * We really need to re-think the LUN disable semantics. There * should probably be several steps/levels to LUN removal: @@ -4352,37 +4362,37 @@ ctl_free_lun(struct ctl_lun *lun) * the front end ports, at least for individual LUNs. */ #if 0 - STAILQ_FOREACH(fe, &softc->fe_list, links) { + STAILQ_FOREACH(port, &softc->port_list, links) { int retval; - retval = fe->lun_disable(fe->targ_lun_arg, lun->target, + retval = port->lun_disable(port->targ_lun_arg, lun->target, lun->lun); if (retval != 0) { printf("ctl_free_lun: FETD %s port %d returned error " "%d for lun_disable on target %ju lun %jd\n", - fe->port_name, fe->targ_port, retval, + port->port_name, port->targ_port, retval, (uintmax_t)lun->target.id, (intmax_t)lun->lun); } if (STAILQ_FIRST(&softc->lun_list) == NULL) { - fe->status &= ~CTL_PORT_STATUS_LUN_ONLINE; + port->status &= ~CTL_PORT_STATUS_LUN_ONLINE; - retval = fe->targ_disable(fe->targ_lun_arg,lun->target); + retval = port->targ_disable(port->targ_lun_arg,lun->target); if (retval != 0) { printf("ctl_free_lun: FETD %s port %d " "returned error %d for targ_disable on " - "target %ju\n", fe->port_name, - fe->targ_port, retval, + "target %ju\n", port->port_name, + port->targ_port, retval, (uintmax_t)lun->target.id); } else - fe->status &= ~CTL_PORT_STATUS_TARG_ONLINE; + port->status &= ~CTL_PORT_STATUS_TARG_ONLINE; - if ((fe->status & CTL_PORT_STATUS_TARG_ONLINE) != 0) + if ((port->status & CTL_PORT_STATUS_TARG_ONLINE) != 0) continue; #if 0 - fe->port_offline(fe->onoff_arg); - fe->status &= ~CTL_PORT_STATUS_ONLINE; + port->port_offline(port->onoff_arg); + port->status &= ~CTL_PORT_STATUS_ONLINE; #endif } } @@ -4437,7 +4447,7 @@ int ctl_enable_lun(struct ctl_be_lun *be_lun) { struct ctl_softc *ctl_softc; - struct ctl_frontend *fe, *nfe; + struct ctl_port *port, *nport; struct ctl_lun *lun; int retval; @@ -4459,8 +4469,8 @@ ctl_enable_lun(struct ctl_be_lun *be_lun lun->flags &= ~CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); - for (fe = STAILQ_FIRST(&ctl_softc->fe_list); fe != NULL; fe = nfe) { - nfe = STAILQ_NEXT(fe, links); + for (port = STAILQ_FIRST(&ctl_softc->port_list); port != NULL; port = nport) { + nport = STAILQ_NEXT(port, links); /* * Drop the lock while we call the FETD's enable routine. @@ -4468,18 +4478,18 @@ ctl_enable_lun(struct ctl_be_lun *be_lun * case of the internal initiator frontend. */ mtx_unlock(&ctl_softc->ctl_lock); - retval = fe->lun_enable(fe->targ_lun_arg, lun->target,lun->lun); + retval = port->lun_enable(port->targ_lun_arg, lun->target,lun->lun); mtx_lock(&ctl_softc->ctl_lock); if (retval != 0) { printf("%s: FETD %s port %d returned error " "%d for lun_enable on target %ju lun %jd\n", - __func__, fe->port_name, fe->targ_port, retval, + __func__, port->port_name, port->targ_port, retval, (uintmax_t)lun->target.id, (intmax_t)lun->lun); } #if 0 else { /* NOTE: TODO: why does lun enable affect port status? */ - fe->status |= CTL_PORT_STATUS_LUN_ONLINE; + port->status |= CTL_PORT_STATUS_LUN_ONLINE; } #endif } @@ -4493,7 +4503,7 @@ int ctl_disable_lun(struct ctl_be_lun *be_lun) { struct ctl_softc *ctl_softc; - struct ctl_frontend *fe; + struct ctl_port *port; struct ctl_lun *lun; int retval; @@ -4511,7 +4521,7 @@ ctl_disable_lun(struct ctl_be_lun *be_lu lun->flags |= CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); - STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) { + STAILQ_FOREACH(port, &ctl_softc->port_list, links) { mtx_unlock(&ctl_softc->ctl_lock); /* * Drop the lock before we call the frontend's disable @@ -4520,13 +4530,13 @@ ctl_disable_lun(struct ctl_be_lun *be_lu * XXX KDM what happens if the frontend list changes while * we're traversing it? It's unlikely, but should be handled. */ - retval = fe->lun_disable(fe->targ_lun_arg, lun->target, + retval = port->lun_disable(port->targ_lun_arg, lun->target, lun->lun); mtx_lock(&ctl_softc->ctl_lock); if (retval != 0) { printf("ctl_alloc_lun: FETD %s port %d returned error " "%d for lun_disable on target %ju lun %jd\n", - fe->port_name, fe->targ_port, retval, + port->port_name, port->targ_port, retval, (uintmax_t)lun->target.id, (intmax_t)lun->lun); } } @@ -9478,16 +9488,16 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio struct scsi_vpd_id_t10 *t10id; struct ctl_softc *ctl_softc; struct ctl_lun *lun; - struct ctl_frontend *fe; + struct ctl_port *port; char *val; int data_len, devid_len; ctl_softc = control_softc; - fe = ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]; + port = ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]; - if (fe->devid != NULL) - return ((fe->devid)(ctsio, alloc_len)); + if (port->devid != NULL) + return ((port->devid)(ctsio, alloc_len)); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -9550,7 +9560,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio /* * For Fibre channel, */ - if (fe->port_type == CTL_PORT_FC) + if (port->port_type == CTL_PORT_FC) { desc->proto_codeset = (SCSI_PROTO_FC << 4) | SVPD_ID_CODESET_ASCII; @@ -9599,7 +9609,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio desc1->identifier[7] += ctsio->io_hdr.nexus.targ_port; #endif - be64enc(desc1->identifier, fe->wwpn); + be64enc(desc1->identifier, port->wwpn); /* * desc2 is for the Relative Target Port(type 4h) identifier Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Tue Jul 15 16:55:13 2014 (r268676) +++ stable/10/sys/cam/ctl/ctl_frontend.c Tue Jul 15 16:57:30 2014 (r268677) @@ -66,7 +66,60 @@ __FBSDID("$FreeBSD$"); extern struct ctl_softc *control_softc; int -ctl_frontend_register(struct ctl_frontend *fe, int master_shelf) +ctl_frontend_register(struct ctl_frontend *fe) +{ + struct ctl_frontend *fe_tmp; + + KASSERT(control_softc != NULL, ("CTL is not initialized")); + + /* + * Sanity check, make sure this isn't a duplicate registration. + */ + mtx_lock(&control_softc->ctl_lock); + STAILQ_FOREACH(fe_tmp, &control_softc->fe_list, links) { + if (strcmp(fe_tmp->name, fe->name) == 0) { + mtx_unlock(&control_softc->ctl_lock); + return (-1); + } + } + mtx_unlock(&control_softc->ctl_lock); + STAILQ_INIT(&fe->port_list); + + /* + * Call the frontend's initialization routine. + */ + if (fe->init != NULL) + fe->init(); + + mtx_lock(&control_softc->ctl_lock); + control_softc->num_frontends++; + STAILQ_INSERT_TAIL(&control_softc->fe_list, fe, links); + mtx_unlock(&control_softc->ctl_lock); + return (0); +} + +int +ctl_frontend_deregister(struct ctl_frontend *fe) +{ + + if (!STAILQ_EMPTY(&fe->port_list)) + return (-1); + + mtx_lock(&control_softc->ctl_lock); + STAILQ_REMOVE(&control_softc->fe_list, fe, ctl_frontend, links); + control_softc->num_frontends--; + mtx_unlock(&control_softc->ctl_lock); + + /* + * Call the frontend's shutdown routine. + */ + if (fe->shutdown != NULL) + fe->shutdown(); + return (0); +} + +int +ctl_port_register(struct ctl_port *port, int master_shelf) { struct ctl_io_pool *pool; int port_num; @@ -80,13 +133,13 @@ ctl_frontend_register(struct ctl_fronten port_num = ctl_ffz(&control_softc->ctl_port_mask, CTL_MAX_PORTS); if ((port_num == -1) || (ctl_set_mask(&control_softc->ctl_port_mask, port_num) == -1)) { - fe->targ_port = -1; + port->targ_port = -1; mtx_unlock(&control_softc->ctl_lock); return (1); } - control_softc->num_frontends++; - + control_softc->num_ports++; mtx_unlock(&control_softc->ctl_lock); + /* * We add 20 to whatever the caller requests, so he doesn't get * burned by queueing things back to the pending sense queue. In @@ -95,36 +148,30 @@ ctl_frontend_register(struct ctl_fronten * pending sense queue on the next command, whether or not it is * a REQUEST SENSE. */ - retval = ctl_pool_create(control_softc, - (fe->port_type != CTL_PORT_IOCTL) ? - CTL_POOL_FETD : CTL_POOL_IOCTL, - fe->num_requested_ctl_io + 20, &pool); + retval = ctl_pool_create(control_softc, CTL_POOL_FETD, + port->num_requested_ctl_io + 20, &pool); if (retval != 0) { - fe->targ_port = -1; + port->targ_port = -1; mtx_lock(&control_softc->ctl_lock); ctl_clear_mask(&control_softc->ctl_port_mask, port_num); mtx_unlock(&control_softc->ctl_lock); return (retval); } + port->ctl_pool_ref = pool; mtx_lock(&control_softc->ctl_lock); - - /* For now assume master shelf */ - //fe->targ_port = port_num; - fe->targ_port = port_num + (master_shelf!=0 ? 0 : CTL_MAX_PORTS); - fe->max_initiators = CTL_MAX_INIT_PER_PORT; - STAILQ_INSERT_TAIL(&control_softc->fe_list, fe, links); - control_softc->ctl_ports[port_num] = fe; - + port->targ_port = port_num + (master_shelf != 0 ? 0 : CTL_MAX_PORTS); + port->max_initiators = CTL_MAX_INIT_PER_PORT; + STAILQ_INSERT_TAIL(&port->frontend->port_list, port, fe_links); + STAILQ_INSERT_TAIL(&control_softc->port_list, port, links); + control_softc->ctl_ports[port_num] = port; mtx_unlock(&control_softc->ctl_lock); - fe->ctl_pool_ref = pool; - return (retval); } int -ctl_frontend_deregister(struct ctl_frontend *fe) +ctl_port_deregister(struct ctl_port *port) { struct ctl_io_pool *pool; int port_num; @@ -132,18 +179,19 @@ ctl_frontend_deregister(struct ctl_front retval = 0; - pool = (struct ctl_io_pool *)fe->ctl_pool_ref; + pool = (struct ctl_io_pool *)port->ctl_pool_ref; - if (fe->targ_port == -1) { + if (port->targ_port == -1) { retval = 1; goto bailout; } mtx_lock(&control_softc->ctl_lock); - STAILQ_REMOVE(&control_softc->fe_list, fe, ctl_frontend, links); - control_softc->num_frontends--; - port_num = (fe->targ_port < CTL_MAX_PORTS) ? fe->targ_port : - fe->targ_port - CTL_MAX_PORTS; + STAILQ_REMOVE(&control_softc->port_list, port, ctl_port, links); + STAILQ_REMOVE(&port->frontend->port_list, port, ctl_port, fe_links); + control_softc->num_ports--; + port_num = (port->targ_port < CTL_MAX_PORTS) ? port->targ_port : + port->targ_port - CTL_MAX_PORTS; ctl_clear_mask(&control_softc->ctl_port_mask, port_num); control_softc->ctl_ports[port_num] = NULL; mtx_unlock(&control_softc->ctl_lock); @@ -155,30 +203,30 @@ bailout: } void -ctl_frontend_set_wwns(struct ctl_frontend *fe, int wwnn_valid, uint64_t wwnn, +ctl_port_set_wwns(struct ctl_port *port, int wwnn_valid, uint64_t wwnn, int wwpn_valid, uint64_t wwpn) { if (wwnn_valid) - fe->wwnn = wwnn; + port->wwnn = wwnn; if (wwpn_valid) - fe->wwpn = wwpn; + port->wwpn = wwpn; } void -ctl_frontend_online(struct ctl_frontend *fe) +ctl_port_online(struct ctl_port *port) { - fe->port_online(fe->onoff_arg); + port->port_online(port->onoff_arg); /* XXX KDM need a lock here? */ - fe->status |= CTL_PORT_STATUS_ONLINE; + port->status |= CTL_PORT_STATUS_ONLINE; } void -ctl_frontend_offline(struct ctl_frontend *fe) +ctl_port_offline(struct ctl_port *port) { - fe->port_offline(fe->onoff_arg); + port->port_offline(port->onoff_arg); /* XXX KDM need a lock here? */ - fe->status &= ~CTL_PORT_STATUS_ONLINE; + port->status &= ~CTL_PORT_STATUS_ONLINE; } /* Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 16:55:13 2014 (r268676) +++ stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 16:57:30 2014 (r268677) @@ -39,6 +39,8 @@ #ifndef _CTL_FRONTEND_H_ #define _CTL_FRONTEND_H_ +#define CTL_FE_NAME_LEN 32 + typedef enum { CTL_PORT_STATUS_NONE = 0x00, CTL_PORT_STATUS_ONLINE = 0x01, @@ -46,6 +48,8 @@ typedef enum { CTL_PORT_STATUS_LUN_ONLINE = 0x04 } ctl_port_status; +typedef int (*fe_init_t)(void); +typedef void (*fe_shutdown_t)(void); typedef void (*port_func_t)(void *onoff_arg); typedef int (*targ_func_t)(void *arg, struct ctl_id targ_id); typedef int (*lun_func_t)(void *arg, struct ctl_id targ_id, int lun_id); @@ -53,6 +57,31 @@ typedef int (*fe_ioctl_t)(struct cdev *d struct thread *td); typedef int (*fe_devid_t)(struct ctl_scsiio *ctsio, int alloc_len); +#define CTL_FRONTEND_DECLARE(name, driver) \ + static int name ## _modevent(module_t mod, int type, void *data) \ + { \ + switch (type) { \ + case MOD_LOAD: \ + ctl_frontend_register( \ + (struct ctl_frontend *)data); \ + break; \ + case MOD_UNLOAD: \ + printf(#name " module unload - not possible for this module type\n"); \ + return EINVAL; \ + default: \ + return EOPNOTSUPP; \ + } \ + return 0; \ + } \ + static moduledata_t name ## _mod = { \ + #name, \ + name ## _modevent, \ + (void *)&driver \ + }; \ + DECLARE_MODULE(name, name ## _mod, SI_SUB_CONFIGURE, SI_ORDER_FOURTH); \ + MODULE_DEPEND(name, ctl, 1, 1, 1); \ + MODULE_DEPEND(name, cam, 1, 1, 1) + /* * The ctl_frontend structure is the registration mechanism between a FETD * (Front End Target Driver) and the CTL layer. Here is a description of @@ -179,7 +208,8 @@ typedef int (*fe_devid_t)(struct ctl_scs * links: Linked list pointers, used by CTL. The FETD * shouldn't touch this field. */ -struct ctl_frontend { +struct ctl_port { + struct ctl_frontend *frontend; ctl_port_type port_type; /* passed to CTL */ int num_requested_ctl_io; /* passed to CTL */ char *port_name; /* passed to CTL */ @@ -190,12 +220,10 @@ struct ctl_frontend { void *onoff_arg; /* passed to CTL */ lun_func_t lun_enable; /* passed to CTL */ lun_func_t lun_disable; /* passed to CTL */ - fe_ioctl_t ioctl; /* passed to CTL */ fe_devid_t devid; /* passed to CTL */ void *targ_lun_arg; /* passed to CTL */ void (*fe_datamove)(union ctl_io *io); /* passed to CTL */ void (*fe_done)(union ctl_io *io); /* passed to CTL */ - void (*fe_dump)(void); /* passed to CTL */ int max_targets; /* passed to CTL */ int max_target_id; /* passed to CTL */ int32_t targ_port; /* passed back to FETD */ @@ -204,6 +232,17 @@ struct ctl_frontend { uint64_t wwnn; /* set by CTL before online */ uint64_t wwpn; /* set by CTL before online */ ctl_port_status status; /* used by CTL */ + STAILQ_ENTRY(ctl_port) fe_links; /* used by CTL */ + STAILQ_ENTRY(ctl_port) links; /* used by CTL */ +}; + +struct ctl_frontend { + char name[CTL_FE_NAME_LEN]; /* passed to CTL */ + fe_init_t init; /* passed to CTL */ + fe_ioctl_t ioctl; /* passed to CTL */ + void (*fe_dump)(void); /* passed to CTL */ + fe_shutdown_t shutdown; /* passed to CTL */ + STAILQ_HEAD(, ctl_port) port_list; /* used by CTL */ STAILQ_ENTRY(ctl_frontend) links; /* used by CTL */ }; @@ -211,7 +250,7 @@ struct ctl_frontend { * This may block until resources are allocated. Called at FETD module load * time. Returns 0 for success, non-zero for failure. */ -int ctl_frontend_register(struct ctl_frontend *fe, int master_SC); +int ctl_frontend_register(struct ctl_frontend *fe); /* * Called at FETD module unload time. @@ -220,20 +259,32 @@ int ctl_frontend_register(struct ctl_fro int ctl_frontend_deregister(struct ctl_frontend *fe); /* + * This may block until resources are allocated. Called at FETD module load + * time. Returns 0 for success, non-zero for failure. + */ +int ctl_port_register(struct ctl_port *fe, int master_SC); + +/* + * Called at FETD module unload time. + * Returns 0 for success, non-zero for failure. + */ +int ctl_port_deregister(struct ctl_port *fe); + +/* * Called to set the WWNN and WWPN for a particular frontend. */ -void ctl_frontend_set_wwns(struct ctl_frontend *fe, int wwnn_valid, +void ctl_port_set_wwns(struct ctl_port *port, int wwnn_valid, uint64_t wwnn, int wwpn_valid, uint64_t wwpn); /* * Called to bring a particular frontend online. */ -void ctl_frontend_online(struct ctl_frontend *fe); +void ctl_port_online(struct ctl_port *fe); /* * Called to take a particular frontend offline. */ -void ctl_frontend_offline(struct ctl_frontend *fe); +void ctl_port_offline(struct ctl_port *fe); /* * This routine queues I/O and task management requests from the FETD to the Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Jul 15 16:55:13 2014 (r268676) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Jul 15 16:57:30 2014 (r268677) @@ -74,13 +74,12 @@ struct cfcs_io { }; struct cfcs_softc { - struct ctl_frontend fe; + struct ctl_port port; char port_name[32]; struct cam_sim *sim; struct cam_devq *devq; struct cam_path *path; struct mtx lock; - char lock_desc[32]; uint64_t wwnn; uint64_t wwpn; uint32_t cur_tag_num; @@ -97,7 +96,6 @@ struct cfcs_softc { CAM_SENSE_PHYS) int cfcs_init(void); -void cfcs_shutdown(void); static void cfcs_poll(struct cam_sim *sim); static void cfcs_online(void *arg); static void cfcs_offline(void *arg); @@ -122,25 +120,19 @@ SYSCTL_NODE(_kern_cam, OID_AUTO, ctl2cam SYSCTL_INT(_kern_cam_ctl2cam, OID_AUTO, max_sense, CTLFLAG_RW, &cfcs_max_sense, 0, "Maximum sense data size"); -static int cfcs_module_event_handler(module_t, int /*modeventtype_t*/, void *); - -static moduledata_t cfcs_moduledata = { - "ctlcfcs", - cfcs_module_event_handler, - NULL +static struct ctl_frontend cfcs_frontend = +{ + .name = "camsim", + .init = cfcs_init, }; - -DECLARE_MODULE(ctlcfcs, cfcs_moduledata, SI_SUB_CONFIGURE, SI_ORDER_FOURTH); -MODULE_VERSION(ctlcfcs, 1); -MODULE_DEPEND(ctlcfi, ctl, 1, 1, 1); -MODULE_DEPEND(ctlcfi, cam, 1, 1, 1); +CTL_FRONTEND_DECLARE(ctlcfcs, cfcs_frontend); int cfcs_init(void) { struct cfcs_softc *softc; struct ccb_setasync csa; - struct ctl_frontend *fe; + struct ctl_port *port; #ifdef NEEDTOPORT char wwnn[8]; #endif @@ -149,32 +141,32 @@ cfcs_init(void) softc = &cfcs_softc; retval = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 16:58:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A7CC4193; Tue, 15 Jul 2014 16:58: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 92E7A2B8A; Tue, 15 Jul 2014 16:58: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 s6FGwecc078400; Tue, 15 Jul 2014 16:58:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FGwd9i078393; Tue, 15 Jul 2014 16:58:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151658.s6FGwd9i078393@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 16:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268678 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 16:58:40 -0000 Author: mav Date: Tue Jul 15 16:58:38 2014 New Revision: 268678 URL: http://svnweb.freebsd.org/changeset/base/268678 Log: MFC r268280: Make options KPI more generic to allow it to be used for ports too, not only for LUNs. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_backend.c stable/10/sys/cam/ctl/ctl_backend.h stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_backend_ramdisk.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:57:30 2014 (r268677) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:58:38 2014 (r268678) @@ -2956,7 +2956,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, struct sbuf *sb; struct ctl_lun *lun; struct ctl_lun_list *list; - struct ctl_be_lun_option *opt; + struct ctl_option *opt; list = (struct ctl_lun_list *)addr; @@ -9582,7 +9582,8 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio */ desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; desc->length = sizeof(*t10id) + devid_len; - if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) { + if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options, + "vendor")) == NULL) { strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); } else { memset(t10id->vendor, ' ', sizeof(t10id->vendor)); @@ -9966,7 +9967,8 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * We have 8 bytes for the vendor name, and 16 bytes for the device * name and 4 bytes for the revision. */ - if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) { + if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options, + "vendor")) == NULL) { strcpy(inq_ptr->vendor, CTL_VENDOR); } else { memset(inq_ptr->vendor, ' ', sizeof(inq_ptr->vendor)); @@ -9975,7 +9977,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio } if (lun == NULL) { strcpy(inq_ptr->product, CTL_DIRECT_PRODUCT); - } else if ((val = ctl_get_opt(lun->be_lun, "product")) == NULL) { + } else if ((val = ctl_get_opt(&lun->be_lun->options, "product")) == NULL) { switch (lun->be_lun->lun_type) { case T_DIRECT: strcpy(inq_ptr->product, CTL_DIRECT_PRODUCT); @@ -9997,7 +9999,8 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * XXX make this a macro somewhere so it automatically gets * incremented when we make changes. */ - if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "revision")) == NULL) { + if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options, + "revision")) == NULL) { strncpy(inq_ptr->revision, "0001", sizeof(inq_ptr->revision)); } else { memset(inq_ptr->revision, ' ', sizeof(inq_ptr->revision)); Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Tue Jul 15 16:57:30 2014 (r268677) +++ stable/10/sys/cam/ctl/ctl.h Tue Jul 15 16:58:38 2014 (r268678) @@ -186,6 +186,22 @@ void ctl_config_write_done(union ctl_io void ctl_portDB_changed(int portnum); void ctl_init_isc_msg(void); +/* + * KPI to manipulate LUN/port options + */ + +struct ctl_option { + STAILQ_ENTRY(ctl_option) links; + char *name; + char *value; +}; +typedef STAILQ_HEAD(ctl_options, ctl_option) ctl_options_t; + +struct ctl_be_arg; +void ctl_init_opts(ctl_options_t *opts, int num_args, struct ctl_be_arg *args); +void ctl_free_opts(ctl_options_t *opts); +char * ctl_get_opt(ctl_options_t *opts, const char *name); + #endif /* _KERNEL */ #endif /* _CTL_H_ */ Modified: stable/10/sys/cam/ctl/ctl_backend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.c Tue Jul 15 16:57:30 2014 (r268677) +++ stable/10/sys/cam/ctl/ctl_backend.c Tue Jul 15 16:58:38 2014 (r268678) @@ -174,29 +174,29 @@ ctl_backend_find(char *backend_name) } void -ctl_init_opts(struct ctl_be_lun *be_lun, struct ctl_lun_req *req) +ctl_init_opts(ctl_options_t *opts, int num_args, struct ctl_be_arg *args) { - struct ctl_be_lun_option *opt; + struct ctl_option *opt; int i; - STAILQ_INIT(&be_lun->options); - for (i = 0; i < req->num_be_args; i++) { + STAILQ_INIT(opts); + for (i = 0; i < num_args; i++) { opt = malloc(sizeof(*opt), M_CTL, M_WAITOK); - opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_CTL, M_WAITOK); - strcpy(opt->name, req->kern_be_args[i].kname); - opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_CTL, M_WAITOK); - strcpy(opt->value, req->kern_be_args[i].kvalue); - STAILQ_INSERT_TAIL(&be_lun->options, opt, links); + opt->name = malloc(strlen(args[i].kname) + 1, M_CTL, M_WAITOK); + strcpy(opt->name, args[i].kname); + opt->value = malloc(strlen(args[i].kvalue) + 1, M_CTL, M_WAITOK); + strcpy(opt->value, args[i].kvalue); + STAILQ_INSERT_TAIL(opts, opt, links); } } void -ctl_free_opts(struct ctl_be_lun *be_lun) +ctl_free_opts(ctl_options_t *opts) { - struct ctl_be_lun_option *opt; + struct ctl_option *opt; - while ((opt = STAILQ_FIRST(&be_lun->options)) != NULL) { - STAILQ_REMOVE_HEAD(&be_lun->options, links); + while ((opt = STAILQ_FIRST(opts)) != NULL) { + STAILQ_REMOVE_HEAD(opts, links); free(opt->name, M_CTL); free(opt->value, M_CTL); free(opt, M_CTL); @@ -204,11 +204,11 @@ ctl_free_opts(struct ctl_be_lun *be_lun) } char * -ctl_get_opt(struct ctl_be_lun *be_lun, const char *name) +ctl_get_opt(ctl_options_t *opts, const char *name) { - struct ctl_be_lun_option *opt; + struct ctl_option *opt; - STAILQ_FOREACH(opt, &be_lun->options, links) { + STAILQ_FOREACH(opt, opts, links) { if (strcmp(opt->name, name) == 0) { return (opt->value); } Modified: stable/10/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.h Tue Jul 15 16:57:30 2014 (r268677) +++ stable/10/sys/cam/ctl/ctl_backend.h Tue Jul 15 16:58:38 2014 (r268678) @@ -180,12 +180,6 @@ typedef void (*be_lun_config_t)(void *be * The links field is for CTL internal use only, and should not be used by * the backend. */ -struct ctl_be_lun_option { - STAILQ_ENTRY(ctl_be_lun_option) links; - char *name; - char *value; -}; - struct ctl_be_lun { uint8_t lun_type; /* passed to CTL */ ctl_backend_lun_flags flags; /* passed to CTL */ @@ -202,7 +196,7 @@ struct ctl_be_lun { be_lun_config_t lun_config_status; /* passed to CTL */ struct ctl_backend_driver *be; /* passed to CTL */ void *ctl_lun; /* used by CTL */ - STAILQ_HEAD(, ctl_be_lun_option) options; /* passed to CTL */ + ctl_options_t options; /* passed to CTL */ STAILQ_ENTRY(ctl_be_lun) links; /* used by CTL */ }; @@ -301,14 +295,6 @@ int ctl_lun_online(struct ctl_be_lun *be */ void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun); -/* - * KPI to manipulate LUN options - */ -struct ctl_lun_req; -void ctl_init_opts(struct ctl_be_lun *be_lun, struct ctl_lun_req *req); -void ctl_free_opts(struct ctl_be_lun *be_lun); -char * ctl_get_opt(struct ctl_be_lun *be_lun, const char *name); - #endif /* _KERNEL */ #endif /* _CTL_BACKEND_H_ */ Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Tue Jul 15 16:57:30 2014 (r268677) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Tue Jul 15 16:58:38 2014 (r268678) @@ -1860,7 +1860,8 @@ ctl_be_block_create(struct ctl_be_block_ sprintf(be_lun->lunname, "cblk%d", softc->num_luns); mtx_init(&be_lun->io_lock, "cblk io lock", NULL, MTX_DEF); mtx_init(&be_lun->queue_lock, "cblk queue lock", NULL, MTX_DEF); - ctl_init_opts(&be_lun->ctl_be_lun, req); + ctl_init_opts(&be_lun->ctl_be_lun.options, + req->num_be_args, req->kern_be_args); be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG, NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); @@ -1877,7 +1878,7 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.lun_type = T_DIRECT; if (be_lun->ctl_be_lun.lun_type == T_DIRECT) { - value = ctl_get_opt(&be_lun->ctl_be_lun, "file"); + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "file"); if (value == NULL) { snprintf(req->error_str, sizeof(req->error_str), "%s: no file argument specified", __func__); @@ -1922,7 +1923,7 @@ ctl_be_block_create(struct ctl_be_block_ * XXX This searching loop might be refactored to be combined with * the loop above, */ - value = ctl_get_opt(&be_lun->ctl_be_lun, "num_threads"); + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "num_threads"); if (value != NULL) { tmp_num_threads = strtol(value, NULL, 0); @@ -1940,7 +1941,7 @@ ctl_be_block_create(struct ctl_be_block_ num_threads = tmp_num_threads; } unmap = 0; - value = ctl_get_opt(&be_lun->ctl_be_lun, "unmap"); + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "unmap"); if (value != NULL && strcmp(value, "on") == 0) unmap = 1; @@ -2105,7 +2106,7 @@ bailout_error: free(be_lun->dev_path, M_CTLBLK); if (be_lun->lun_zone != NULL) uma_zdestroy(be_lun->lun_zone); - ctl_free_opts(&be_lun->ctl_be_lun); + ctl_free_opts(&be_lun->ctl_be_lun.options); mtx_destroy(&be_lun->queue_lock); mtx_destroy(&be_lun->io_lock); free(be_lun, M_CTLBLK); @@ -2193,7 +2194,7 @@ ctl_be_block_rm(struct ctl_be_block_soft uma_zdestroy(be_lun->lun_zone); - ctl_free_opts(&be_lun->ctl_be_lun); + ctl_free_opts(&be_lun->ctl_be_lun.options); free(be_lun->dev_path, M_CTLBLK); mtx_destroy(&be_lun->queue_lock); mtx_destroy(&be_lun->io_lock); Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Tue Jul 15 16:57:30 2014 (r268677) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Tue Jul 15 16:58:38 2014 (r268678) @@ -505,7 +505,7 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram if (retval == 0) { taskqueue_drain(be_lun->io_taskqueue, &be_lun->io_task); taskqueue_free(be_lun->io_taskqueue); - ctl_free_opts(&be_lun->ctl_be_lun); + ctl_free_opts(&be_lun->ctl_be_lun.options); mtx_destroy(&be_lun->queue_lock); free(be_lun, M_RAMDISK); } @@ -548,7 +548,8 @@ ctl_backend_ramdisk_create(struct ctl_be goto bailout_error; } sprintf(be_lun->lunname, "cram%d", softc->num_luns); - ctl_init_opts(&be_lun->ctl_be_lun, req); + ctl_init_opts(&be_lun->ctl_be_lun.options, + req->num_be_args, req->kern_be_args); if (params->flags & CTL_LUN_FLAG_DEV_TYPE) be_lun->ctl_be_lun.lun_type = params->device_type; @@ -586,7 +587,7 @@ ctl_backend_ramdisk_create(struct ctl_be be_lun->softc = softc; unmap = 0; - value = ctl_get_opt(&be_lun->ctl_be_lun, "unmap"); + value = ctl_get_opt(&be_lun->ctl_be_lun.options, "unmap"); if (value != NULL && strcmp(value, "on") == 0) unmap = 1; @@ -721,7 +722,7 @@ bailout_error: if (be_lun->io_taskqueue != NULL) { taskqueue_free(be_lun->io_taskqueue); } - ctl_free_opts(&be_lun->ctl_be_lun); + ctl_free_opts(&be_lun->ctl_be_lun.options); mtx_destroy(&be_lun->queue_lock); free(be_lun, M_RAMDISK); } Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 16:57:30 2014 (r268677) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 16:58:38 2014 (r268678) @@ -2110,7 +2110,8 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_ASCII; desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; desc->length = sizeof(*t10id) + devid_len; - if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) { + if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options, + "vendor")) == NULL) { strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); } else { memset(t10id->vendor, ' ', sizeof(t10id->vendor)); @@ -2370,11 +2371,11 @@ cfiscsi_lun_enable(void *arg, struct ctl softc = (struct cfiscsi_softc *)arg; - target = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun, + target = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options, "cfiscsi_target"); - target_alias = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun, + target_alias = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options, "cfiscsi_target_alias"); - lun = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun, + lun = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options, "cfiscsi_lun"); if (target == NULL && lun == NULL) From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 16:59:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 141212D5; Tue, 15 Jul 2014 16:59: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 F379F2B93; Tue, 15 Jul 2014 16:59: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 s6FGxkEh078621; Tue, 15 Jul 2014 16:59:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FGxkCk078617; Tue, 15 Jul 2014 16:59:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151659.s6FGxkCk078617@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 16:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268679 - in stable/10: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 16:59:47 -0000 Author: mav Date: Tue Jul 15 16:59:46 2014 New Revision: 268679 URL: http://svnweb.freebsd.org/changeset/base/268679 Log: MFC r268284: Introduce new IOCTL CTL_PORT_LIST reporting in more flexible XML format. Leave old CTL_GET_PORT_LIST in place so far. Garbage-collect it later. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_ioctl.h stable/10/usr.sbin/ctladm/ctladm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:58:38 2014 (r268678) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:59:46 2014 (r268679) @@ -3140,6 +3140,104 @@ ctl_ioctl(struct cdev *dev, u_long cmd, retval = fe->ioctl(dev, cmd, addr, flag, td); break; } + case CTL_PORT_LIST: { + struct sbuf *sb; + struct ctl_port *port; + struct ctl_lun_list *list; +// struct ctl_option *opt; + + list = (struct ctl_lun_list *)addr; + + sb = sbuf_new(NULL, NULL, list->alloc_len, SBUF_FIXEDLEN); + if (sb == NULL) { + list->status = CTL_LUN_LIST_ERROR; + snprintf(list->error_str, sizeof(list->error_str), + "Unable to allocate %d bytes for LUN list", + list->alloc_len); + break; + } + + sbuf_printf(sb, "\n"); + + mtx_lock(&softc->ctl_lock); + STAILQ_FOREACH(port, &softc->port_list, links) { + retval = sbuf_printf(sb, "\n", + (uintmax_t)port->targ_port); + + /* + * Bail out as soon as we see that we've overfilled + * the buffer. + */ + if (retval != 0) + break; + + retval = sbuf_printf(sb, "\t%s" + "\n", port->frontend->name); + if (retval != 0) + break; + + retval = sbuf_printf(sb, "\t%d\n", + port->port_type); + if (retval != 0) + break; + + retval = sbuf_printf(sb, "\t%s\n", + (port->status & CTL_PORT_STATUS_ONLINE) ? "YES" : "NO"); + if (retval != 0) + break; + + retval = sbuf_printf(sb, "\t%s\n", + port->port_name); + if (retval != 0) + break; + + retval = sbuf_printf(sb, "\t%d\n", + port->physical_port); + if (retval != 0) + break; + + retval = sbuf_printf(sb, "\t%d\n", + port->virtual_port); + if (retval != 0) + break; + + retval = sbuf_printf(sb, "\t%#jx\n", + (uintmax_t)port->wwnn); + if (retval != 0) + break; + + retval = sbuf_printf(sb, "\t%#jx\n", + (uintmax_t)port->wwpn); + if (retval != 0) + break; + + retval = sbuf_printf(sb, "\n"); + if (retval != 0) + break; + } + mtx_unlock(&softc->ctl_lock); + + if ((retval != 0) + || ((retval = sbuf_printf(sb, "\n")) != 0)) { + retval = 0; + sbuf_delete(sb); + list->status = CTL_LUN_LIST_NEED_MORE_SPACE; + snprintf(list->error_str, sizeof(list->error_str), + "Out of space, %d bytes is too small", + list->alloc_len); + break; + } + + sbuf_finish(sb); + + retval = copyout(sbuf_data(sb), list->lun_xml, + sbuf_len(sb) + 1); + + list->fill_len = sbuf_len(sb) + 1; + list->status = CTL_LUN_LIST_OK; + sbuf_delete(sb); + break; + } default: { /* XXX KDM should we fix this? */ #if 0 Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Tue Jul 15 16:58:38 2014 (r268678) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Tue Jul 15 16:59:46 2014 (r268679) @@ -789,6 +789,7 @@ struct ctl_iscsi { #define CTL_ERROR_INJECT_DELETE _IOW(CTL_MINOR, 0x23, struct ctl_error_desc) #define CTL_SET_PORT_WWNS _IOW(CTL_MINOR, 0x24, struct ctl_port_entry) #define CTL_ISCSI _IOWR(CTL_MINOR, 0x25, struct ctl_iscsi) +#define CTL_PORT_LIST _IOWR(CTL_MINOR, 0x26, struct ctl_lun_list) #endif /* _CTL_IOCTL_H_ */ Modified: stable/10/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.c Tue Jul 15 16:58:38 2014 (r268678) +++ stable/10/usr.sbin/ctladm/ctladm.c Tue Jul 15 16:59:46 2014 (r268679) @@ -95,6 +95,7 @@ typedef enum { CTLADM_CMD_READ, CTLADM_CMD_WRITE, CTLADM_CMD_PORT, + CTLADM_CMD_PORTLIST, CTLADM_CMD_READCAPACITY, CTLADM_CMD_MODESENSE, CTLADM_CMD_DUMPOOA, @@ -190,6 +191,7 @@ static struct ctladm_opts option_table[] {"modesense", CTLADM_CMD_MODESENSE, CTLADM_ARG_NEED_TL, "P:S:dlm:c:"}, {"modify", CTLADM_CMD_MODIFY, CTLADM_ARG_NONE, "b:l:s:"}, {"port", CTLADM_CMD_PORT, CTLADM_ARG_NONE, "lo:p:qt:w:W:x"}, + {"portlist", CTLADM_CMD_PORTLIST, CTLADM_ARG_NONE, "f:vx"}, {"prin", CTLADM_CMD_PRES_IN, CTLADM_ARG_NEED_TL, "a:"}, {"prout", CTLADM_CMD_PRES_OUT, CTLADM_ARG_NEED_TL, "a:k:r:s:"}, {"read", CTLADM_CMD_READ, CTLADM_ARG_NEED_TL, rw_opts}, @@ -4073,6 +4075,269 @@ bailout: return (retval); } +/* + * Port information. + */ +struct cctl_port { + uint64_t port_id; + char *online; + char *frontend_type; + char *name; + int pp, vp; + char *wwnn, *wwpn; + STAILQ_HEAD(,cctl_lun_nv) attr_list; + STAILQ_ENTRY(cctl_port) links; +}; + +struct cctl_portlist_data { + int num_ports; + STAILQ_HEAD(,cctl_port) port_list; + struct cctl_port *cur_port; + int level; + struct sbuf *cur_sb[32]; +}; + +static void +cctl_start_pelement(void *user_data, const char *name, const char **attr) +{ + int i; + struct cctl_portlist_data *portlist; + struct cctl_port *cur_port; + + portlist = (struct cctl_portlist_data *)user_data; + cur_port = portlist->cur_port; + portlist->level++; + if ((u_int)portlist->level >= (sizeof(portlist->cur_sb) / + sizeof(portlist->cur_sb[0]))) + errx(1, "%s: too many nesting levels, %zd max", __func__, + sizeof(portlist->cur_sb) / sizeof(portlist->cur_sb[0])); + + portlist->cur_sb[portlist->level] = sbuf_new_auto(); + if (portlist->cur_sb[portlist->level] == NULL) + err(1, "%s: Unable to allocate sbuf", __func__); + + if (strcmp(name, "targ_port") == 0) { + if (cur_port != NULL) + errx(1, "%s: improper port element nesting", __func__); + + cur_port = calloc(1, sizeof(*cur_port)); + if (cur_port == NULL) + err(1, "%s: cannot allocate %zd bytes", __func__, + sizeof(*cur_port)); + + portlist->num_ports++; + portlist->cur_port = cur_port; + + STAILQ_INIT(&cur_port->attr_list); + STAILQ_INSERT_TAIL(&portlist->port_list, cur_port, links); + + for (i = 0; attr[i] != NULL; i += 2) { + if (strcmp(attr[i], "id") == 0) { + cur_port->port_id = strtoull(attr[i+1], NULL, 0); + } else { + errx(1, "%s: invalid LUN attribute %s = %s", + __func__, attr[i], attr[i+1]); + } + } + } +} + +static void +cctl_end_pelement(void *user_data, const char *name) +{ + struct cctl_portlist_data *portlist; + struct cctl_port *cur_port; + char *str; + + portlist = (struct cctl_portlist_data *)user_data; + cur_port = portlist->cur_port; + + if ((cur_port == NULL) + && (strcmp(name, "ctlportlist") != 0)) + errx(1, "%s: cur_port == NULL! (name = %s)", __func__, name); + + if (portlist->cur_sb[portlist->level] == NULL) + errx(1, "%s: no valid sbuf at level %d (name %s)", __func__, + portlist->level, name); + + if (sbuf_finish(portlist->cur_sb[portlist->level]) != 0) + err(1, "%s: sbuf_finish", __func__); + str = strdup(sbuf_data(portlist->cur_sb[portlist->level])); + if (str == NULL) + err(1, "%s can't allocate %zd bytes for string", __func__, + sbuf_len(portlist->cur_sb[portlist->level])); + + if (strlen(str) == 0) { + free(str); + str = NULL; + } + + sbuf_delete(portlist->cur_sb[portlist->level]); + portlist->cur_sb[portlist->level] = NULL; + portlist->level--; + + if (strcmp(name, "frontend_type") == 0) { + cur_port->frontend_type = str; + str = NULL; + } else if (strcmp(name, "port_name") == 0) { + cur_port->name = str; + str = NULL; + } else if (strcmp(name, "online") == 0) { + cur_port->online = str; + str = NULL; + } else if (strcmp(name, "physical_port") == 0) { + cur_port->pp = strtoull(str, NULL, 0); + } else if (strcmp(name, "virtual_port") == 0) { + cur_port->pp = strtoull(str, NULL, 0); + } else if (strcmp(name, "wwnn") == 0) { + cur_port->wwnn = str; + str = NULL; + } else if (strcmp(name, "wwpn") == 0) { + cur_port->wwpn = str; + str = NULL; + } else if (strcmp(name, "targ_port") == 0) { + portlist->cur_port = NULL; + } else if (strcmp(name, "ctlportlist") == 0) { + + } else { + struct cctl_lun_nv *nv; + + nv = calloc(1, sizeof(*nv)); + if (nv == NULL) + err(1, "%s: can't allocate %zd bytes for nv pair", + __func__, sizeof(*nv)); + + nv->name = strdup(name); + if (nv->name == NULL) + err(1, "%s: can't allocated %zd bytes for string", + __func__, strlen(name)); + + nv->value = str; + str = NULL; + STAILQ_INSERT_TAIL(&cur_port->attr_list, nv, links); + } + + free(str); +} + +static void +cctl_char_phandler(void *user_data, const XML_Char *str, int len) +{ + struct cctl_portlist_data *portlist; + + portlist = (struct cctl_portlist_data *)user_data; + + sbuf_bcat(portlist->cur_sb[portlist->level], str, len); +} + +static int +cctl_portlist(int fd, int argc, char **argv, char *combinedopt) +{ + struct ctl_lun_list list; + struct cctl_portlist_data portlist; + struct cctl_port *port; + XML_Parser parser; + char *port_str; + int port_len; + int dump_xml = 0; + int retval, c; + char *frontend = NULL; + int verbose = 0; + + retval = 0; + port_len = 4096; + + bzero(&portlist, sizeof(portlist)); + STAILQ_INIT(&portlist.port_list); + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'f': + frontend = strdup(optarg); + break; + case 'v': + verbose++; + break; + case 'x': + dump_xml = 1; + break; + default: + break; + } + } + +retry: + port_str = malloc(port_len); + + bzero(&list, sizeof(list)); + list.alloc_len = port_len; + list.status = CTL_LUN_LIST_NONE; + list.lun_xml = port_str; + + if (ioctl(fd, CTL_PORT_LIST, &list) == -1) { + warn("%s: error issuing CTL_PORT_LIST ioctl", __func__); + retval = 1; + goto bailout; + } + + if (list.status == CTL_LUN_LIST_ERROR) { + warnx("%s: error returned from CTL_PORT_LIST ioctl:\n%s", + __func__, list.error_str); + } else if (list.status == CTL_LUN_LIST_NEED_MORE_SPACE) { + port_len = port_len << 1; + goto retry; + } + + if (dump_xml != 0) { + printf("%s", port_str); + goto bailout; + } + + parser = XML_ParserCreate(NULL); + if (parser == NULL) { + warn("%s: Unable to create XML parser", __func__); + retval = 1; + goto bailout; + } + + XML_SetUserData(parser, &portlist); + XML_SetElementHandler(parser, cctl_start_pelement, cctl_end_pelement); + XML_SetCharacterDataHandler(parser, cctl_char_phandler); + + retval = XML_Parse(parser, port_str, strlen(port_str), 1); + XML_ParserFree(parser); + if (retval != 1) { + retval = 1; + goto bailout; + } + + printf("Port Online Frontend %-12s pp vp %-18s %-18s\n", + "Name", "WWNN", "WWPN"); + STAILQ_FOREACH(port, &portlist.port_list, links) { + struct cctl_lun_nv *nv; + + if ((frontend != NULL) + && (strcmp(port->frontend_type, frontend) != 0)) + continue; + + printf("%-4ju %-6s %-8s %-12s %-2d %-2d %-18s %-18s\n", + (uintmax_t)port->port_id, port->online, + port->frontend_type, port->name, port->pp, port->vp, + port->wwnn, port->wwpn); + + if (verbose == 0) + continue; + + STAILQ_FOREACH(nv, &port->attr_list, links) { + printf(" %s=%s\n", nv->name, nv->value); + } + } +bailout: + free(port_str); + + return (retval); +} + void usage(int error) { @@ -4104,7 +4369,7 @@ usage(int error) " [-S serial_num] [-t dev_type]\n" " ctladm remove <-b backend> <-l lun_id> [-o name=value]\n" " ctladm modify <-b backend> <-l lun_id> <-s size_bytes>\n" -" ctladm devlist [-b][-v][-x]\n" +" ctladm devlist [-b backend] [-v] [-x]\n" " ctladm shutdown\n" " ctladm startup\n" " ctladm hardstop\n" @@ -4120,6 +4385,7 @@ usage(int error) " [-s len fmt [args]] [-c] [-d delete_id]\n" " ctladm port <-l | -o | [-w wwnn][-W wwpn]>\n" " [-p targ_port] [-t port_type] [-q] [-x]\n" +" ctladm portlist [-f frontend] [-v] [-x]\n" " ctladm islist [-v | -x]\n" " ctladm islogout <-a | -c connection-id | -i name | -p portal>\n" " ctladm isterminate <-a | -c connection-id | -i name | -p portal>\n" @@ -4429,6 +4695,9 @@ main(int argc, char **argv) case CTLADM_CMD_PORT: retval = cctl_port(fd, argc, argv, combinedopt); break; + case CTLADM_CMD_PORTLIST: + retval = cctl_portlist(fd, argc, argv, combinedopt); + break; case CTLADM_CMD_READCAPACITY: retval = cctl_read_capacity(fd, target, lun, initid, retries, argc, argv, combinedopt); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:00:42 2014 Return-Path: Delivered-To: svn-src-stable-10@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 59C6541E; Tue, 15 Jul 2014 17:00: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 2BC362C08; Tue, 15 Jul 2014 17:00: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 s6FH0glH081542; Tue, 15 Jul 2014 17:00:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FH0fwJ081537; Tue, 15 Jul 2014 17:00:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151700.s6FH0fwJ081537@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268680 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:00:42 -0000 Author: mav Date: Tue Jul 15 17:00:41 2014 New Revision: 268680 URL: http://svnweb.freebsd.org/changeset/base/268680 Log: MFC r268287: Implement and use ctl_frontend_find(). Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 16:59:46 2014 (r268679) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:00:41 2014 (r268680) @@ -3123,13 +3123,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, ci = (struct ctl_iscsi *)addr; - mtx_lock(&softc->ctl_lock); - STAILQ_FOREACH(fe, &softc->fe_list, links) { - if (strcmp(fe->name, "iscsi") == 0) - break; - } - mtx_unlock(&softc->ctl_lock); - + fe = ctl_frontend_find("iscsi"); if (fe == NULL) { ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Tue Jul 15 16:59:46 2014 (r268679) +++ stable/10/sys/cam/ctl/ctl_frontend.c Tue Jul 15 17:00:41 2014 (r268680) @@ -118,6 +118,23 @@ ctl_frontend_deregister(struct ctl_front return (0); } +struct ctl_frontend * +ctl_frontend_find(char *frontend_name) +{ + struct ctl_softc *ctl_softc = control_softc; + struct ctl_frontend *fe; + + mtx_lock(&ctl_softc->ctl_lock); + STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) { + if (strcmp(fe->name, frontend_name) == 0) { + mtx_unlock(&ctl_softc->ctl_lock); + return (fe); + } + } + mtx_unlock(&ctl_softc->ctl_lock); + return (NULL); +} + int ctl_port_register(struct ctl_port *port, int master_shelf) { Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 16:59:46 2014 (r268679) +++ stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:00:41 2014 (r268680) @@ -259,6 +259,11 @@ int ctl_frontend_register(struct ctl_fro int ctl_frontend_deregister(struct ctl_frontend *fe); /* + * Find the frontend by its name. Returns NULL if not found. + */ +struct ctl_frontend * ctl_frontend_find(char *frontend_name); + +/* * This may block until resources are allocated. Called at FETD module load * time. Returns 0 for success, non-zero for failure. */ From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:01:40 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A1DCC63B; Tue, 15 Jul 2014 17:01: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 8D9DB2C19; Tue, 15 Jul 2014 17:01: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 s6FH1eRx082613; Tue, 15 Jul 2014 17:01:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FH1eqG082608; Tue, 15 Jul 2014 17:01:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151701.s6FH1eqG082608@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268681 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:01:40 -0000 Author: mav Date: Tue Jul 15 17:01:39 2014 New Revision: 268681 URL: http://svnweb.freebsd.org/changeset/base/268681 Log: MFC r268288: Improve CTL_BEARG_* flags support, including optional values copyout. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:00:41 2014 (r268680) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:01:39 2014 (r268681) @@ -2015,40 +2015,40 @@ ctl_copyin_alloc(void *user_addr, int le } static void -ctl_free_args(int num_be_args, struct ctl_be_arg *be_args) +ctl_free_args(int num_args, struct ctl_be_arg *args) { int i; - if (be_args == NULL) + if (args == NULL) return; - for (i = 0; i < num_be_args; i++) { - free(be_args[i].kname, M_CTL); - free(be_args[i].kvalue, M_CTL); + for (i = 0; i < num_args; i++) { + free(args[i].kname, M_CTL); + free(args[i].kvalue, M_CTL); } - free(be_args, M_CTL); + free(args, M_CTL); } static struct ctl_be_arg * -ctl_copyin_args(int num_be_args, struct ctl_be_arg *be_args, +ctl_copyin_args(int num_args, struct ctl_be_arg *uargs, char *error_str, size_t error_str_len) { struct ctl_be_arg *args; int i; - args = ctl_copyin_alloc(be_args, num_be_args * sizeof(*be_args), + args = ctl_copyin_alloc(uargs, num_args * sizeof(*args), error_str, error_str_len); if (args == NULL) goto bailout; - for (i = 0; i < num_be_args; i++) { + for (i = 0; i < num_args; i++) { args[i].kname = NULL; args[i].kvalue = NULL; } - for (i = 0; i < num_be_args; i++) { + for (i = 0; i < num_args; i++) { uint8_t *tmpptr; args[i].kname = ctl_copyin_alloc(args[i].name, @@ -2062,31 +2062,43 @@ ctl_copyin_args(int num_be_args, struct goto bailout; } - args[i].kvalue = NULL; - - tmpptr = ctl_copyin_alloc(args[i].value, - args[i].vallen, error_str, error_str_len); - if (tmpptr == NULL) - goto bailout; - - args[i].kvalue = tmpptr; - - if ((args[i].flags & CTL_BEARG_ASCII) - && (tmpptr[args[i].vallen - 1] != '\0')) { - snprintf(error_str, error_str_len, "Argument %d " - "value is not NUL-terminated", i); - goto bailout; + if (args[i].flags & CTL_BEARG_RD) { + tmpptr = ctl_copyin_alloc(args[i].value, + args[i].vallen, error_str, error_str_len); + if (tmpptr == NULL) + goto bailout; + if ((args[i].flags & CTL_BEARG_ASCII) + && (tmpptr[args[i].vallen - 1] != '\0')) { + snprintf(error_str, error_str_len, "Argument " + "%d value is not NUL-terminated", i); + goto bailout; + } + args[i].kvalue = tmpptr; + } else { + args[i].kvalue = malloc(args[i].vallen, + M_CTL, M_WAITOK | M_ZERO); } } return (args); bailout: - ctl_free_args(num_be_args, args); + ctl_free_args(num_args, args); return (NULL); } +static void +ctl_copyout_args(int num_args, struct ctl_be_arg *args) +{ + int i; + + for (i = 0; i < num_args; i++) { + if (args[i].flags & CTL_BEARG_WR) + copyout(args[i].kvalue, args[i].value, args[i].vallen); + } +} + /* * Escape characters that are illegal or not recommended in XML. */ @@ -2947,6 +2959,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, retval = backend->ioctl(dev, cmd, addr, flag, td); if (lun_req->num_be_args > 0) { + ctl_copyout_args(lun_req->num_be_args, + lun_req->kern_be_args); ctl_free_args(lun_req->num_be_args, lun_req->kern_be_args); } Modified: stable/10/sys/cam/ctl/ctl_backend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.c Tue Jul 15 17:00:41 2014 (r268680) +++ stable/10/sys/cam/ctl/ctl_backend.c Tue Jul 15 17:01:39 2014 (r268681) @@ -181,6 +181,10 @@ ctl_init_opts(ctl_options_t *opts, int n STAILQ_INIT(opts); for (i = 0; i < num_args; i++) { + if ((args[i].flags & CTL_BEARG_RD) == 0) + continue; + if ((args[i].flags & CTL_BEARG_ASCII) == 0) + continue; opt = malloc(sizeof(*opt), M_CTL, M_WAITOK); opt->name = malloc(strlen(args[i].kname) + 1, M_CTL, M_WAITOK); strcpy(opt->name, args[i].kname); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:05:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 50C53B3E; Tue, 15 Jul 2014 17:05: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 3BA812C63; Tue, 15 Jul 2014 17:05: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 s6FH5EHW083560; Tue, 15 Jul 2014 17:05:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FH5CxF083536; Tue, 15 Jul 2014 17:05:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151705.s6FH5CxF083536@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268682 - in stable/10: sys/cam/ctl usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:05:14 -0000 Author: mav Date: Tue Jul 15 17:05:11 2014 New Revision: 268682 URL: http://svnweb.freebsd.org/changeset/base/268682 Log: MFC r268291: Create separate CTL port for every iSCSI target (and maybe portal group). Having single port for all iSCSI connections makes problematic implementing some more advanced SCSI functionality in CTL, that require proper ports enumeration and identification. This change extends CTL iSCSI API, making ctld daemon to control list of iSCSI ports in CTL. When new target is defined in config fine, ctld will create respective port in CTL. When target is removed -- port will be also removed after all active commands through that port properly aborted. This change require ctld to be rebuilt to match the kernel. As a minor side effect, this allows to have iSCSI targets without LUNs. While that may look odd and not very useful, that is not incorrect. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h stable/10/sys/cam/ctl/ctl_ioctl.h stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:01:39 2014 (r268681) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:05:11 2014 (r268682) @@ -3148,11 +3148,41 @@ ctl_ioctl(struct cdev *dev, u_long cmd, retval = fe->ioctl(dev, cmd, addr, flag, td); break; } + case CTL_PORT_REQ: { + struct ctl_req *req; + struct ctl_frontend *fe; + + req = (struct ctl_req *)addr; + + fe = ctl_frontend_find(req->driver); + if (fe == NULL) { + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "Frontend \"%s\" not found.", req->driver); + break; + } + if (req->num_args > 0) { + req->kern_args = ctl_copyin_args(req->num_args, + req->args, req->error_str, sizeof(req->error_str)); + if (req->kern_args == NULL) { + req->status = CTL_LUN_ERROR; + break; + } + } + + retval = fe->ioctl(dev, cmd, addr, flag, td); + + if (req->num_args > 0) { + ctl_copyout_args(req->num_args, req->kern_args); + ctl_free_args(req->num_args, req->kern_args); + } + break; + } case CTL_PORT_LIST: { struct sbuf *sb; struct ctl_port *port; struct ctl_lun_list *list; -// struct ctl_option *opt; + struct ctl_option *opt; list = (struct ctl_lun_list *)addr; @@ -3219,6 +3249,13 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (retval != 0) break; + STAILQ_FOREACH(opt, &port->options, links) { + retval = sbuf_printf(sb, "\t<%s>%s\n", + opt->name, opt->value, opt->name); + if (retval != 0) + break; + } + retval = sbuf_printf(sb, "\n"); if (retval != 0) break; Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Tue Jul 15 17:01:39 2014 (r268681) +++ stable/10/sys/cam/ctl/ctl.h Tue Jul 15 17:05:11 2014 (r268682) @@ -103,6 +103,8 @@ union ctl_modepage_info { */ #define CTL_WWPN_LEN 8 +#define CTL_DRIVER_NAME_LEN 32 + /* * Unit attention types. ASC/ASCQ values for these should be placed in * ctl_build_ua. These are also listed in order of reporting priority. Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Tue Jul 15 17:01:39 2014 (r268681) +++ stable/10/sys/cam/ctl/ctl_frontend.c Tue Jul 15 17:05:11 2014 (r268682) @@ -176,6 +176,9 @@ ctl_port_register(struct ctl_port *port, } port->ctl_pool_ref = pool; + if (port->options.stqh_first == NULL) + STAILQ_INIT(&port->options); + mtx_lock(&control_softc->ctl_lock); port->targ_port = port_num + (master_shelf != 0 ? 0 : CTL_MAX_PORTS); port->max_initiators = CTL_MAX_INIT_PER_PORT; @@ -214,6 +217,7 @@ ctl_port_deregister(struct ctl_port *por mtx_unlock(&control_softc->ctl_lock); ctl_pool_free(pool); + ctl_free_opts(&port->options); bailout: return (retval); Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:01:39 2014 (r268681) +++ stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:05:11 2014 (r268682) @@ -39,8 +39,6 @@ #ifndef _CTL_FRONTEND_H_ #define _CTL_FRONTEND_H_ -#define CTL_FE_NAME_LEN 32 - typedef enum { CTL_PORT_STATUS_NONE = 0x00, CTL_PORT_STATUS_ONLINE = 0x01, @@ -232,12 +230,13 @@ struct ctl_port { uint64_t wwnn; /* set by CTL before online */ uint64_t wwpn; /* set by CTL before online */ ctl_port_status status; /* used by CTL */ + ctl_options_t options; /* passed to CTL */ STAILQ_ENTRY(ctl_port) fe_links; /* used by CTL */ STAILQ_ENTRY(ctl_port) links; /* used by CTL */ }; struct ctl_frontend { - char name[CTL_FE_NAME_LEN]; /* passed to CTL */ + char name[CTL_DRIVER_NAME_LEN]; /* passed to CTL */ fe_init_t init; /* passed to CTL */ fe_ioctl_t ioctl; /* passed to CTL */ void (*fe_dump)(void); /* passed to CTL */ Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:01:39 2014 (r268681) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:05:11 2014 (r268682) @@ -168,6 +168,8 @@ static void cfiscsi_pdu_handle_logout_re static void cfiscsi_session_terminate(struct cfiscsi_session *cs); static struct cfiscsi_target *cfiscsi_target_find(struct cfiscsi_softc *softc, const char *name); +static struct cfiscsi_target *cfiscsi_target_find_or_create( + struct cfiscsi_softc *softc, const char *name, const char *alias); static void cfiscsi_target_release(struct cfiscsi_target *ct); static void cfiscsi_session_delete(struct cfiscsi_session *cs); @@ -540,7 +542,7 @@ cfiscsi_pdu_handle_scsi_command(struct i cfiscsi_session_terminate(cs); return; } - io = ctl_alloc_io(cs->cs_target->ct_softc->port.ctl_pool_ref); + io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); if (io == NULL) { CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io; " "dropping connection"); @@ -552,7 +554,7 @@ cfiscsi_pdu_handle_scsi_command(struct i io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request; io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.nexus.initid.id = cs->cs_ctl_initid; - io->io_hdr.nexus.targ_port = cs->cs_target->ct_softc->port.targ_port; + io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; io->io_hdr.nexus.targ_target.id = 0; io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhssc->bhssc_lun); io->io_hdr.nexus.lun_map_fn = cfiscsi_map_lun; @@ -606,7 +608,7 @@ cfiscsi_pdu_handle_task_request(struct i cs = PDU_SESSION(request); bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; - io = ctl_alloc_io(cs->cs_target->ct_softc->port.ctl_pool_ref); + io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); if (io == NULL) { CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io;" "dropping connection"); @@ -618,7 +620,7 @@ cfiscsi_pdu_handle_task_request(struct i io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request; io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid.id = cs->cs_ctl_initid; - io->io_hdr.nexus.targ_port = cs->cs_target->ct_softc->port.targ_port; + io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; io->io_hdr.nexus.targ_target.id = 0; io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhstmr->bhstmr_lun); io->io_hdr.nexus.lun_map_fn = cfiscsi_map_lun; @@ -1040,7 +1042,7 @@ cfiscsi_session_terminate_tasks(struct c int error, last; #ifdef notyet - io = ctl_alloc_io(cs->cs_target->ct_softc->port.ctl_pool_ref); + io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); if (io == NULL) { CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); return; @@ -1049,7 +1051,7 @@ cfiscsi_session_terminate_tasks(struct c io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL; io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid.id = cs->cs_ctl_initid; - io->io_hdr.nexus.targ_port = cs->cs_target->ct_softc->port.targ_port; + io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; io->io_hdr.nexus.targ_target.id = 0; io->io_hdr.nexus.targ_lun = lun; io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */ @@ -1068,7 +1070,7 @@ cfiscsi_session_terminate_tasks(struct c CFISCSI_SESSION_LOCK(cs); TAILQ_FOREACH_SAFE(cdw, &cs->cs_waiting_for_data_out, cdw_next, tmpcdw) { - io = ctl_alloc_io(cs->cs_target->ct_softc->port.ctl_pool_ref); + io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); if (io == NULL) { CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); return; @@ -1077,8 +1079,7 @@ cfiscsi_session_terminate_tasks(struct c io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL; io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid.id = cs->cs_ctl_initid; - io->io_hdr.nexus.targ_port = - cs->cs_target->ct_softc->port.targ_port; + io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; io->io_hdr.nexus.targ_target.id = 0; //io->io_hdr.nexus.targ_lun = lun; /* Not needed? */ io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */ @@ -1201,7 +1202,7 @@ cfiscsi_session_register_initiator(struc i, softc->max_initiators); #endif cs->cs_ctl_initid = i; - error = ctl_add_initiator(0x0, softc->port.targ_port, cs->cs_ctl_initid); + error = ctl_add_initiator(0x0, cs->cs_target->ct_port.targ_port, cs->cs_ctl_initid); if (error != 0) { CFISCSI_SESSION_WARN(cs, "ctl_add_initiator failed with error %d", error); mtx_lock(&softc->lock); @@ -1225,7 +1226,7 @@ cfiscsi_session_unregister_initiator(str softc = &cfiscsi_softc; - error = ctl_remove_initiator(softc->port.targ_port, cs->cs_ctl_initid); + error = ctl_remove_initiator(cs->cs_target->ct_port.targ_port, cs->cs_ctl_initid); if (error != 0) { CFISCSI_SESSION_WARN(cs, "ctl_remove_initiator failed with error %d", error); @@ -1316,7 +1317,6 @@ int cfiscsi_init(void) { struct cfiscsi_softc *softc; - struct ctl_port *port; int retval; softc = &cfiscsi_softc; @@ -1330,46 +1330,13 @@ cfiscsi_init(void) TAILQ_INIT(&softc->sessions); TAILQ_INIT(&softc->targets); - port = &softc->port; - port->frontend = &cfiscsi_frontend; - port->port_type = CTL_PORT_ISCSI; - /* XXX KDM what should the real number be here? */ - port->num_requested_ctl_io = 4096; - snprintf(softc->port_name, sizeof(softc->port_name), "iscsi"); - port->port_name = softc->port_name; - port->port_online = cfiscsi_online; - port->port_offline = cfiscsi_offline; - port->onoff_arg = softc; - port->lun_enable = cfiscsi_lun_enable; - port->lun_disable = cfiscsi_lun_disable; - port->targ_lun_arg = softc; - port->devid = cfiscsi_devid; - port->fe_datamove = cfiscsi_datamove; - port->fe_done = cfiscsi_done; - - /* XXX KDM what should we report here? */ - /* XXX These should probably be fetched from CTL. */ - port->max_targets = 1; - port->max_target_id = 15; - - retval = ctl_port_register(port, /*master_SC*/ 1); - if (retval != 0) { - CFISCSI_WARN("ctl_frontend_register() failed with error %d", - retval); - retval = 1; - goto bailout; - } - - softc->max_initiators = port->max_initiators; + softc->max_initiators = CTL_MAX_INIT_PER_PORT; cfiscsi_data_wait_zone = uma_zcreate("cfiscsi_data_wait", sizeof(struct cfiscsi_data_wait), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); return (0); - -bailout: - return (retval); } #ifdef ICL_KERNEL_PROXY @@ -1396,10 +1363,23 @@ static void cfiscsi_online(void *arg) { struct cfiscsi_softc *softc; + struct cfiscsi_target *ct; + int online; + + ct = (struct cfiscsi_target *)arg; + softc = ct->ct_softc; - softc = (struct cfiscsi_softc *)arg; + mtx_lock(&softc->lock); + if (ct->ct_online) { + mtx_unlock(&softc->lock); + return; + } + ct->ct_online = 1; + online = softc->online++; + mtx_unlock(&softc->lock); + if (online > 0) + return; - softc->online = 1; #ifdef ICL_KERNEL_PROXY if (softc->listener != NULL) icl_listen_free(softc->listener); @@ -1411,16 +1391,28 @@ static void cfiscsi_offline(void *arg) { struct cfiscsi_softc *softc; + struct cfiscsi_target *ct; struct cfiscsi_session *cs; + int online; - softc = (struct cfiscsi_softc *)arg; - - softc->online = 0; + ct = (struct cfiscsi_target *)arg; + softc = ct->ct_softc; mtx_lock(&softc->lock); - TAILQ_FOREACH(cs, &softc->sessions, cs_next) - cfiscsi_session_terminate(cs); + if (!ct->ct_online) { + mtx_unlock(&softc->lock); + return; + } + ct->ct_online = 0; + online = --softc->online; + + TAILQ_FOREACH(cs, &softc->sessions, cs_next) { + if (cs->cs_target == ct) + cfiscsi_session_terminate(cs); + } mtx_unlock(&softc->lock); + if (online > 0) + return; #ifdef ICL_KERNEL_PROXY icl_listen_free(softc->listener); @@ -1444,18 +1436,19 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cihp->initiator_name, cihp->initiator_addr, cihp->target_name); - if (softc->online == 0) { + ct = cfiscsi_target_find(softc, cihp->target_name); + if (ct == NULL) { ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), - "%s: port offline", __func__); + "%s: target not found", __func__); return; } - ct = cfiscsi_target_find(softc, cihp->target_name); - if (ct == NULL) { + if (ct->ct_online == 0) { ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), - "%s: target not found", __func__); + "%s: port offline", __func__); + cfiscsi_target_release(ct); return; } @@ -1953,11 +1946,148 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * #endif /* !ICL_KERNEL_PROXY */ +static void +cfiscsi_ioctl_port_create(struct ctl_req *req) +{ + struct cfiscsi_target *ct; + struct ctl_port *port; + const char *target, *alias, *tag; + ctl_options_t opts; + int retval; + + ctl_init_opts(&opts, req->num_args, req->kern_args); + target = ctl_get_opt(&opts, "cfiscsi_target"); + alias = ctl_get_opt(&opts, "cfiscsi_target_alias"); + tag = ctl_get_opt(&opts, "cfiscsi_portal_group_tag"); + if (target == NULL || tag == NULL) { + ctl_free_opts(&opts); + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "Missing required argument"); + return; + } + ct = cfiscsi_target_find_or_create(&cfiscsi_softc, target, alias); + if (ct == NULL) { + ctl_free_opts(&opts); + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "failed to create target \"%s\"", target); + return; + } + if (ct->ct_state == CFISCSI_TARGET_STATE_ACTIVE) { + cfiscsi_target_release(ct); + ctl_free_opts(&opts); + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "target \"%s\" already exist", target); + return; + } + port = &ct->ct_port; + if (ct->ct_state == CFISCSI_TARGET_STATE_DYING) + goto done; + + port->frontend = &cfiscsi_frontend; + port->port_type = CTL_PORT_ISCSI; + /* XXX KDM what should the real number be here? */ + port->num_requested_ctl_io = 4096; + port->port_name = "iscsi"; + port->virtual_port = strtoul(tag, NULL, 0); + port->port_online = cfiscsi_online; + port->port_offline = cfiscsi_offline; + port->onoff_arg = ct; + port->lun_enable = cfiscsi_lun_enable; + port->lun_disable = cfiscsi_lun_disable; + port->targ_lun_arg = ct; + port->devid = cfiscsi_devid; + port->fe_datamove = cfiscsi_datamove; + port->fe_done = cfiscsi_done; + + /* XXX KDM what should we report here? */ + /* XXX These should probably be fetched from CTL. */ + port->max_targets = 1; + port->max_target_id = 15; + + port->options = opts; + STAILQ_INIT(&opts); + + retval = ctl_port_register(port, /*master_SC*/ 1); + if (retval != 0) { + ctl_free_opts(&port->options); + cfiscsi_target_release(ct); + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "ctl_frontend_register() failed with error %d", retval); + return; + } +done: + ct->ct_state = CFISCSI_TARGET_STATE_ACTIVE; + req->status = CTL_LUN_OK; + memcpy(req->kern_args[0].kvalue, &port->targ_port, + sizeof(port->targ_port)); //XXX +} + +static void +cfiscsi_ioctl_port_remove(struct ctl_req *req) +{ + struct cfiscsi_target *ct; + const char *target; + ctl_options_t opts; + + ctl_init_opts(&opts, req->num_args, req->kern_args); + target = ctl_get_opt(&opts, "cfiscsi_target"); + if (target == NULL) { + ctl_free_opts(&opts); + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "Missing required argument"); + return; + } + ct = cfiscsi_target_find(&cfiscsi_softc, target); + if (ct == NULL) { + ctl_free_opts(&opts); + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "can't find target \"%s\"", target); + return; + } + if (ct->ct_state != CFISCSI_TARGET_STATE_ACTIVE) { + ctl_free_opts(&opts); + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "target \"%s\" is already dying", target); + return; + } + ctl_free_opts(&opts); + + ct->ct_state = CFISCSI_TARGET_STATE_DYING; + ctl_port_offline(&ct->ct_port); + cfiscsi_target_release(ct); + cfiscsi_target_release(ct); +} + static int cfiscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { struct ctl_iscsi *ci; + struct ctl_req *req; + + if (cmd == CTL_PORT_REQ) { + req = (struct ctl_req *)addr; + switch (req->reqtype) { + case CTL_REQ_CREATE: + cfiscsi_ioctl_port_create(req); + break; + case CTL_REQ_REMOVE: + cfiscsi_ioctl_port_remove(req); + break; + default: + req->status = CTL_LUN_ERROR; + snprintf(req->error_str, sizeof(req->error_str), + "Unsupported request type %d", req->reqtype); + } + return (0); + } if (cmd != CTL_ISCSI) return (ENOTTY); @@ -2227,6 +2357,12 @@ cfiscsi_target_release(struct cfiscsi_ta if (refcount_release(&ct->ct_refcount)) { TAILQ_REMOVE(&softc->targets, ct, ct_next); mtx_unlock(&softc->lock); + if (ct->ct_state != CFISCSI_TARGET_STATE_INVALID) { + ct->ct_state = CFISCSI_TARGET_STATE_INVALID; + if (ctl_port_deregister(&ct->ct_port) != 0) + printf("%s: ctl_port_deregister() failed\n", + __func__); + } free(ct, M_CFISCSI); return; @@ -2241,7 +2377,8 @@ cfiscsi_target_find(struct cfiscsi_softc mtx_lock(&softc->lock); TAILQ_FOREACH(ct, &softc->targets, ct_next) { - if (strcmp(name, ct->ct_name) != 0) + if (strcmp(name, ct->ct_name) != 0 || + ct->ct_state != CFISCSI_TARGET_STATE_ACTIVE) continue; cfiscsi_target_hold(ct); mtx_unlock(&softc->lock); @@ -2266,7 +2403,8 @@ cfiscsi_target_find_or_create(struct cfi mtx_lock(&softc->lock); TAILQ_FOREACH(ct, &softc->targets, ct_next) { - if (strcmp(name, ct->ct_name) != 0) + if (strcmp(name, ct->ct_name) != 0 || + ct->ct_state == CFISCSI_TARGET_STATE_INVALID) continue; cfiscsi_target_hold(ct); mtx_unlock(&softc->lock); @@ -2340,22 +2478,6 @@ cfiscsi_target_set_lun(struct cfiscsi_ta #endif ct->ct_luns[lun_id] = ctl_lun_id; - cfiscsi_target_hold(ct); - - return (0); -} - -static int -cfiscsi_target_unset_lun(struct cfiscsi_target *ct, unsigned long lun_id) -{ - - if (ct->ct_luns[lun_id] < 0) { - CFISCSI_WARN("lun %ld not allocated", lun_id); - return (-1); - } - - ct->ct_luns[lun_id] = -1; - cfiscsi_target_release(ct); return (0); } @@ -2365,16 +2487,15 @@ cfiscsi_lun_enable(void *arg, struct ctl { struct cfiscsi_softc *softc; struct cfiscsi_target *ct; - const char *target = NULL, *target_alias = NULL; + const char *target = NULL; const char *lun = NULL; unsigned long tmp; - softc = (struct cfiscsi_softc *)arg; + ct = (struct cfiscsi_target *)arg; + softc = ct->ct_softc; target = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options, "cfiscsi_target"); - target_alias = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options, - "cfiscsi_target_alias"); lun = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options, "cfiscsi_lun"); @@ -2387,15 +2508,11 @@ cfiscsi_lun_enable(void *arg, struct ctl return (0); } - ct = cfiscsi_target_find_or_create(softc, target, target_alias); - if (ct == NULL) { - CFISCSI_WARN("failed to create target \"%s\"", target); + if (strcmp(target, ct->ct_name) != 0) return (0); - } tmp = strtoul(lun, NULL, 10); cfiscsi_target_set_lun(ct, tmp, lun_id); - cfiscsi_target_release(ct); return (0); } @@ -2406,19 +2523,17 @@ cfiscsi_lun_disable(void *arg, struct ct struct cfiscsi_target *ct; int i; - softc = (struct cfiscsi_softc *)arg; + ct = (struct cfiscsi_target *)arg; + softc = ct->ct_softc; mtx_lock(&softc->lock); - TAILQ_FOREACH(ct, &softc->targets, ct_next) { - for (i = 0; i < CTL_MAX_LUNS; i++) { - if (ct->ct_luns[i] < 0) - continue; - if (ct->ct_luns[i] != lun_id) - continue; - mtx_unlock(&softc->lock); - cfiscsi_target_unset_lun(ct, i); - return (0); - } + for (i = 0; i < CTL_MAX_LUNS; i++) { + if (ct->ct_luns[i] < 0) + continue; + if (ct->ct_luns[i] != lun_id) + continue; + ct->ct_luns[lun_id] = -1; + break; } mtx_unlock(&softc->lock); return (0); Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:01:39 2014 (r268681) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:05:11 2014 (r268682) @@ -32,6 +32,10 @@ #ifndef CTL_FRONTEND_ISCSI_H #define CTL_FRONTEND_ISCSI_H +#define CFISCSI_TARGET_STATE_INVALID 0 +#define CFISCSI_TARGET_STATE_ACTIVE 1 +#define CFISCSI_TARGET_STATE_DYING 2 + struct cfiscsi_target { TAILQ_ENTRY(cfiscsi_target) ct_next; int ct_luns[CTL_MAX_LUNS]; @@ -39,6 +43,9 @@ struct cfiscsi_target { volatile u_int ct_refcount; char ct_name[CTL_ISCSI_NAME_LEN]; char ct_alias[CTL_ISCSI_ALIAS_LEN]; + int ct_state; + int ct_online; + struct ctl_port ct_port; }; struct cfiscsi_data_wait { @@ -96,7 +103,6 @@ struct icl_listen; #endif struct cfiscsi_softc { - struct ctl_port port; struct mtx lock; char port_name[32]; int online; Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Tue Jul 15 17:01:39 2014 (r268681) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Tue Jul 15 17:05:11 2014 (r268682) @@ -595,6 +595,45 @@ struct ctl_lun_list { }; /* + * Port request interface: + * + * driver: This is required, and is NUL-terminated a string + * that is the name of the frontend, like "iscsi" . + * + * reqtype: The type of request, CTL_REQ_CREATE to create a + * port, CTL_REQ_REMOVE to delete a port. + * + * num_be_args: This is the number of frontend-specific arguments + * in the be_args array. + * + * be_args: This is an array of frontend-specific arguments. + * See above for a description of the fields in this + * structure. + * + * status: Status of the request. + * + * error_str: If the status is CTL_LUN_ERROR, this will + * contain a string describing the error. + * + * kern_be_args: For kernel use only. + */ +typedef enum { + CTL_REQ_CREATE, + CTL_REQ_REMOVE, + CTL_REQ_MODIFY, +} ctl_req_type; + +struct ctl_req { + char driver[CTL_DRIVER_NAME_LEN]; + ctl_req_type reqtype; + int num_args; + struct ctl_be_arg *args; + ctl_lun_status status; + char error_str[CTL_ERROR_STR_LEN]; + struct ctl_be_arg *kern_args; +}; + +/* * iSCSI status * * OK: Request completed successfully. @@ -789,7 +828,8 @@ struct ctl_iscsi { #define CTL_ERROR_INJECT_DELETE _IOW(CTL_MINOR, 0x23, struct ctl_error_desc) #define CTL_SET_PORT_WWNS _IOW(CTL_MINOR, 0x24, struct ctl_port_entry) #define CTL_ISCSI _IOWR(CTL_MINOR, 0x25, struct ctl_iscsi) -#define CTL_PORT_LIST _IOWR(CTL_MINOR, 0x26, struct ctl_lun_list) +#define CTL_PORT_REQ _IOWR(CTL_MINOR, 0x26, struct ctl_req) +#define CTL_PORT_LIST _IOWR(CTL_MINOR, 0x27, struct ctl_lun_list) #endif /* _CTL_IOCTL_H_ */ Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Tue Jul 15 17:01:39 2014 (r268681) +++ stable/10/usr.sbin/ctld/ctld.c Tue Jul 15 17:05:11 2014 (r268682) @@ -1120,7 +1120,6 @@ conf_verify(struct conf *conf) if (!found_lun) { log_warnx("no LUNs defined for target \"%s\"", targ->t_name); - return (1); } } TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { @@ -1209,19 +1208,6 @@ conf_apply(struct conf *oldconf, struct } } - if (oldconf->conf_kernel_port_on != newconf->conf_kernel_port_on) { - if (newconf->conf_kernel_port_on == true) { - log_debugx("enabling CTL iSCSI port"); - error = kernel_port_on(); - if (error != 0) - log_errx(1, "failed to enable CTL iSCSI port; exiting"); - } else { - error = kernel_port_off(); - if (error != 0) - log_warnx("failed to disable CTL iSCSI port"); - } - } - /* * XXX: If target or lun removal fails, we should somehow "move" * the old lun or target into newconf, so that subsequent @@ -1253,6 +1239,7 @@ conf_apply(struct conf *oldconf, struct } lun_delete(oldlun); } + kernel_port_remove(oldtarg); target_delete(oldtarg); continue; } @@ -1387,6 +1374,8 @@ conf_apply(struct conf *oldconf, struct cumulated_error++; } } + if (oldtarg == NULL) + kernel_port_add(newtarg); } /* Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Tue Jul 15 17:01:39 2014 (r268681) +++ stable/10/usr.sbin/ctld/ctld.h Tue Jul 15 17:05:11 2014 (r268682) @@ -272,8 +272,8 @@ int kernel_lun_add(struct lun *lun); int kernel_lun_resize(struct lun *lun); int kernel_lun_remove(struct lun *lun); void kernel_handoff(struct connection *conn); -int kernel_port_on(void); -int kernel_port_off(void); +int kernel_port_add(struct target *targ); +int kernel_port_remove(struct target *targ); void kernel_capsicate(void); #ifdef ICL_KERNEL_PROXY Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Tue Jul 15 17:01:39 2014 (r268681) +++ stable/10/usr.sbin/ctld/kernel.c Tue Jul 15 17:05:11 2014 (r268682) @@ -119,10 +119,21 @@ struct cctl_lun { STAILQ_ENTRY(cctl_lun) links; }; +struct cctl_port { + uint32_t port_id; + char *cfiscsi_target; + uint16_t cfiscsi_portal_group_tag; + STAILQ_HEAD(,cctl_lun_nv) attr_list; + STAILQ_ENTRY(cctl_port) links; +}; + struct cctl_devlist_data { int num_luns; STAILQ_HEAD(,cctl_lun) lun_list; struct cctl_lun *cur_lun; + int num_ports; + STAILQ_HEAD(,cctl_port) port_list; + struct cctl_port *cur_port; int level; struct sbuf *cur_sb[32]; }; @@ -247,6 +258,109 @@ cctl_end_element(void *user_data, const } static void +cctl_start_pelement(void *user_data, const char *name, const char **attr) +{ + int i; + struct cctl_devlist_data *devlist; + struct cctl_port *cur_port; + + devlist = (struct cctl_devlist_data *)user_data; + cur_port = devlist->cur_port; + devlist->level++; + if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / + sizeof(devlist->cur_sb[0]))) + log_errx(1, "%s: too many nesting levels, %zd max", __func__, + sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + + devlist->cur_sb[devlist->level] = sbuf_new_auto(); + if (devlist->cur_sb[devlist->level] == NULL) + log_err(1, "%s: unable to allocate sbuf", __func__); + + if (strcmp(name, "targ_port") == 0) { + if (cur_port != NULL) + log_errx(1, "%s: improper port element nesting (%s)", + __func__, name); + + cur_port = calloc(1, sizeof(*cur_port)); + if (cur_port == NULL) + log_err(1, "%s: cannot allocate %zd bytes", __func__, + sizeof(*cur_port)); + + devlist->num_ports++; + devlist->cur_port = cur_port; + + STAILQ_INIT(&cur_port->attr_list); + STAILQ_INSERT_TAIL(&devlist->port_list, cur_port, links); + + for (i = 0; attr[i] != NULL; i += 2) { + if (strcmp(attr[i], "id") == 0) { + cur_port->port_id = strtoul(attr[i+1], NULL, 0); + } else { + log_errx(1, "%s: invalid LUN attribute %s = %s", + __func__, attr[i], attr[i+1]); + } + } + } +} + +static void +cctl_end_pelement(void *user_data, const char *name) +{ + struct cctl_devlist_data *devlist; + struct cctl_port *cur_port; + char *str; + + devlist = (struct cctl_devlist_data *)user_data; + cur_port = devlist->cur_port; + + if ((cur_port == NULL) + && (strcmp(name, "ctlportlist") != 0)) + log_errx(1, "%s: cur_port == NULL! (name = %s)", __func__, name); + + if (devlist->cur_sb[devlist->level] == NULL) + log_errx(1, "%s: no valid sbuf at level %d (name %s)", __func__, + devlist->level, name); + + sbuf_finish(devlist->cur_sb[devlist->level]); + str = checked_strdup(sbuf_data(devlist->cur_sb[devlist->level])); + + if (strlen(str) == 0) { + free(str); + str = NULL; + } + + sbuf_delete(devlist->cur_sb[devlist->level]); + devlist->cur_sb[devlist->level] = NULL; + devlist->level--; + + if (strcmp(name, "cfiscsi_target") == 0) { + cur_port->cfiscsi_target = str; + str = NULL; + } else if (strcmp(name, "cfiscsi_portal_group_tag") == 0) { + cur_port->cfiscsi_portal_group_tag = strtoul(str, NULL, 0); + } else if (strcmp(name, "targ_port") == 0) { + devlist->cur_port = NULL; + } else if (strcmp(name, "ctlportlist") == 0) { + + } else { + struct cctl_lun_nv *nv; + + nv = calloc(1, sizeof(*nv)); + if (nv == NULL) + log_err(1, "%s: can't allocate %zd bytes for nv pair", + __func__, sizeof(*nv)); + + nv->name = checked_strdup(name); + + nv->value = str; + str = NULL; + STAILQ_INSERT_TAIL(&cur_port->attr_list, nv, links); + } + + free(str); +} + +static void cctl_char_handler(void *user_data, const XML_Char *str, int len) { struct cctl_devlist_data *devlist; @@ -266,50 +380,51 @@ conf_new_from_kernel(void) struct ctl_lun_list list; struct cctl_devlist_data devlist; struct cctl_lun *lun; + struct cctl_port *port; XML_Parser parser; - char *lun_str = NULL; - int lun_len; - int retval; - - lun_len = 4096; + char *str; + int len, retval; bzero(&devlist, sizeof(devlist)); STAILQ_INIT(&devlist.lun_list); + STAILQ_INIT(&devlist.port_list); log_debugx("obtaining previously configured CTL luns from the kernel"); + str = NULL; + len = 4096; retry: - lun_str = realloc(lun_str, lun_len); - if (lun_str == NULL) + str = realloc(str, len); + if (str == NULL) log_err(1, "realloc"); bzero(&list, sizeof(list)); - list.alloc_len = lun_len; + list.alloc_len = len; list.status = CTL_LUN_LIST_NONE; - list.lun_xml = lun_str; + list.lun_xml = str; if (ioctl(ctl_fd, CTL_LUN_LIST, &list) == -1) { log_warn("error issuing CTL_LUN_LIST ioctl"); - free(lun_str); + free(str); return (NULL); } if (list.status == CTL_LUN_LIST_ERROR) { log_warnx("error returned from CTL_LUN_LIST ioctl: %s", list.error_str); - free(lun_str); + free(str); return (NULL); } if (list.status == CTL_LUN_LIST_NEED_MORE_SPACE) { - lun_len = lun_len << 1; + len = len << 1; goto retry; } parser = XML_ParserCreate(NULL); if (parser == NULL) { log_warnx("unable to create XML parser"); - free(lun_str); + free(str); return (NULL); } @@ -317,9 +432,58 @@ retry: XML_SetElementHandler(parser, cctl_start_element, cctl_end_element); XML_SetCharacterDataHandler(parser, cctl_char_handler); - retval = XML_Parse(parser, lun_str, strlen(lun_str), 1); + retval = XML_Parse(parser, str, strlen(str), 1); + XML_ParserFree(parser); + free(str); + if (retval != 1) { + log_warnx("XML_Parse failed"); + return (NULL); + } + + str = NULL; + len = 4096; +retry_port: + str = realloc(str, len); + if (str == NULL) + log_err(1, "realloc"); + + bzero(&list, sizeof(list)); + list.alloc_len = len; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:06:13 2014 Return-Path: Delivered-To: svn-src-stable-10@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 173E2C87; Tue, 15 Jul 2014 17:06: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 022DF2C75; Tue, 15 Jul 2014 17:06: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 s6FH6CTY083830; Tue, 15 Jul 2014 17:06:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FH6B1F083817; Tue, 15 Jul 2014 17:06:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151706.s6FH6B1F083817@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268683 - in stable/10: sys/cam/ctl usr.sbin/ctladm usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:06:13 -0000 Author: mav Date: Tue Jul 15 17:06:10 2014 New Revision: 268683 URL: http://svnweb.freebsd.org/changeset/base/268683 Log: MFC r268293: Burry devid port method, which was a gross hack. Instead make ports provide wanted port and target IDs, and LUNs provide wanted LUN IDs. After that core Device ID VPD code only had to link all of them together and add relative port and port group numbers. LUN ID for iSCSI LUNs no longer created by CTL, but by ctld, and passed to CTL as "scsiname" LUN option. This makes LUNs to report the same set of IDs, independently from the port through which it is accessed, as required by SCSI specifications. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/scsi_ctl.c stable/10/usr.sbin/ctladm/ctladm.8 stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:05:11 2014 (r268682) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:06:10 2014 (r268683) @@ -4295,7 +4295,11 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft { struct ctl_lun *nlun, *lun; struct ctl_port *port; + struct scsi_vpd_id_descriptor *desc; + struct scsi_vpd_id_t10 *t10id; + const char *scsiname, *vendor; int lun_number, i, lun_malloced; + int devidlen, idlen1, idlen2, len; if (be_lun == NULL) return (EINVAL); @@ -4327,6 +4331,43 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft if (lun_malloced) lun->flags = CTL_LUN_MALLOCED; + /* Generate LUN ID. */ + devidlen = max(CTL_DEVID_MIN_LEN, + strnlen(be_lun->device_id, CTL_DEVID_LEN)); + idlen1 = sizeof(*t10id) + devidlen; + len = sizeof(struct scsi_vpd_id_descriptor) + idlen1; + scsiname = ctl_get_opt(&be_lun->options, "scsiname"); + if (scsiname != NULL) { + idlen2 = roundup2(strlen(scsiname) + 1, 4); + len += sizeof(struct scsi_vpd_id_descriptor) + idlen2; + } + lun->lun_devid = malloc(sizeof(struct ctl_devid) + len, + M_CTL, M_WAITOK | M_ZERO); + lun->lun_devid->len = len; + desc = (struct scsi_vpd_id_descriptor *)lun->lun_devid->data; + desc->proto_codeset = SVPD_ID_CODESET_ASCII; + desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; + desc->length = idlen1; + t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0]; + memset(t10id->vendor, ' ', sizeof(t10id->vendor)); + if ((vendor = ctl_get_opt(&be_lun->options, "vendor")) == NULL) { + strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); + } else { + strncpy(t10id->vendor, vendor, + min(sizeof(t10id->vendor), strlen(vendor))); + } + strncpy((char *)t10id->vendor_spec_id, + (char *)be_lun->device_id, devidlen); + if (scsiname != NULL) { + desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + + desc->length); + desc->proto_codeset = SVPD_ID_CODESET_UTF8; + desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | + SVPD_ID_TYPE_SCSI_NAME; + desc->length = idlen2; + strlcpy(desc->identifier, scsiname, idlen2); + } + mtx_lock(&ctl_softc->ctl_lock); /* * See if the caller requested a particular LUN number. If so, see @@ -4548,6 +4589,7 @@ ctl_free_lun(struct ctl_lun *lun) lun->be_lun->lun_shutdown(lun->be_lun->be_lun); mtx_destroy(&lun->lun_lock); + free(lun->lun_devid, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); @@ -9626,39 +9668,29 @@ static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len) { struct scsi_vpd_device_id *devid_ptr; - struct scsi_vpd_id_descriptor *desc, *desc1; - struct scsi_vpd_id_descriptor *desc2, *desc3; /* for types 4h and 5h */ - struct scsi_vpd_id_t10 *t10id; + struct scsi_vpd_id_descriptor *desc; struct ctl_softc *ctl_softc; struct ctl_lun *lun; struct ctl_port *port; - char *val; - int data_len, devid_len; + int data_len; + uint8_t proto; ctl_softc = control_softc; port = ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]; - - if (port->devid != NULL) - return ((port->devid)(ctsio, alloc_len)); - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - if (lun == NULL) { - devid_len = CTL_DEVID_MIN_LEN; - } else { - devid_len = max(CTL_DEVID_MIN_LEN, - strnlen(lun->be_lun->device_id, CTL_DEVID_LEN)); - } - data_len = sizeof(struct scsi_vpd_device_id) + - sizeof(struct scsi_vpd_id_descriptor) + - sizeof(struct scsi_vpd_id_t10) + devid_len + - sizeof(struct scsi_vpd_id_descriptor) + CTL_WWPN_LEN + - sizeof(struct scsi_vpd_id_descriptor) + + sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_rel_trgt_port_id) + - sizeof(struct scsi_vpd_id_descriptor) + + sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_trgt_port_grp_id); + if (lun && lun->lun_devid) + data_len += lun->lun_devid->len; + if (port->port_devid) + data_len += port->port_devid->len; + if (port->target_devid) + data_len += port->target_devid->len; ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr; @@ -9677,15 +9709,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list; - t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0]; - desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + - sizeof(struct scsi_vpd_id_t10) + devid_len); - desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] + - CTL_WWPN_LEN); - desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] + - sizeof(struct scsi_vpd_id_rel_trgt_port_id)); - /* * The control device is always connected. The disk device, on the * other hand, may not be online all the time. @@ -9695,112 +9718,69 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio lun->be_lun->lun_type; else devid_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; - devid_ptr->page_code = SVPD_DEVICE_ID; - scsi_ulto2b(data_len - 4, devid_ptr->length); - /* - * For Fibre channel, - */ if (port->port_type == CTL_PORT_FC) - { - desc->proto_codeset = (SCSI_PROTO_FC << 4) | - SVPD_ID_CODESET_ASCII; - desc1->proto_codeset = (SCSI_PROTO_FC << 4) | - SVPD_ID_CODESET_BINARY; - } + proto = SCSI_PROTO_FC << 4; + else if (port->port_type == CTL_PORT_ISCSI) + proto = SCSI_PROTO_ISCSI << 4; else - { - desc->proto_codeset = (SCSI_PROTO_SPI << 4) | - SVPD_ID_CODESET_ASCII; - desc1->proto_codeset = (SCSI_PROTO_SPI << 4) | - SVPD_ID_CODESET_BINARY; - } - desc2->proto_codeset = desc3->proto_codeset = desc1->proto_codeset; + proto = SCSI_PROTO_SPI << 4; + desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list; /* * We're using a LUN association here. i.e., this device ID is a * per-LUN identifier. */ - desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; - desc->length = sizeof(*t10id) + devid_len; - if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options, - "vendor")) == NULL) { - strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); - } else { - memset(t10id->vendor, ' ', sizeof(t10id->vendor)); - strncpy(t10id->vendor, val, - min(sizeof(t10id->vendor), strlen(val))); + if (lun && lun->lun_devid) { + memcpy(desc, lun->lun_devid->data, lun->lun_devid->len); + desc = (struct scsi_vpd_id_descriptor *)((uint8_t *)desc + + lun->lun_devid->len); } /* - * desc1 is for the WWPN which is a port asscociation. + * This is for the WWPN which is a port association. */ - desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | SVPD_ID_TYPE_NAA; - desc1->length = CTL_WWPN_LEN; - /* XXX Call Reggie's get_WWNN func here then add port # to the end */ - /* For testing just create the WWPN */ -#if 0 - ddb_GetWWNN((char *)desc1->identifier); - - /* NOTE: if the port is 0 or 8 we don't want to subtract 1 */ - /* This is so Copancontrol will return something sane */ - if (ctsio->io_hdr.nexus.targ_port!=0 && - ctsio->io_hdr.nexus.targ_port!=8) - desc1->identifier[7] += ctsio->io_hdr.nexus.targ_port-1; - else - desc1->identifier[7] += ctsio->io_hdr.nexus.targ_port; -#endif - - be64enc(desc1->identifier, port->wwpn); + if (port->port_devid) { + memcpy(desc, port->port_devid->data, port->port_devid->len); + desc = (struct scsi_vpd_id_descriptor *)((uint8_t *)desc + + port->port_devid->len); + } /* - * desc2 is for the Relative Target Port(type 4h) identifier + * This is for the Relative Target Port(type 4h) identifier */ - desc2->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT - | SVPD_ID_TYPE_RELTARG; - desc2->length = 4; -//#if 0 - /* NOTE: if the port is 0 or 8 we don't want to subtract 1 */ - /* This is so Copancontrol will return something sane */ - if (ctsio->io_hdr.nexus.targ_port!=0 && - ctsio->io_hdr.nexus.targ_port!=8) - desc2->identifier[3] = ctsio->io_hdr.nexus.targ_port - 1; - else - desc2->identifier[3] = ctsio->io_hdr.nexus.targ_port; -//#endif + desc->proto_codeset = proto | SVPD_ID_CODESET_BINARY; + desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | + SVPD_ID_TYPE_RELTARG; + desc->length = 4; + scsi_ulto2b(ctsio->io_hdr.nexus.targ_port, &desc->identifier[2]); + desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + + sizeof(struct scsi_vpd_id_rel_trgt_port_id)); /* - * desc3 is for the Target Port Group(type 5h) identifier + * This is for the Target Port Group(type 5h) identifier */ - desc3->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT - | SVPD_ID_TYPE_TPORTGRP; - desc3->length = 4; + desc->proto_codeset = proto | SVPD_ID_CODESET_BINARY; + desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | + SVPD_ID_TYPE_TPORTGRP; + desc->length = 4; if (ctsio->io_hdr.nexus.targ_port < CTL_MAX_PORTS || ctl_is_single) - desc3->identifier[3] = 1; + scsi_ulto2b(1, &desc->identifier[2]); else - desc3->identifier[3] = 2; + scsi_ulto2b(2, &desc->identifier[2]); + desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + + sizeof(struct scsi_vpd_id_trgt_port_grp_id)); /* - * If we've actually got a backend, copy the device id from the - * per-LUN data. Otherwise, set it to all spaces. + * This is for the Target identifier */ - if (lun != NULL) { - /* - * Copy the backend's LUN ID. - */ - strncpy((char *)t10id->vendor_spec_id, - (char *)lun->be_lun->device_id, devid_len); - } else { - /* - * No backend, set this to spaces. - */ - memset(t10id->vendor_spec_id, 0x20, devid_len); + if (port->target_devid) { + memcpy(desc, port->target_devid->data, port->target_devid->len); } ctsio->scsi_status = SCSI_STATUS_OK; - ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Tue Jul 15 17:05:11 2014 (r268682) +++ stable/10/sys/cam/ctl/ctl_frontend.c Tue Jul 15 17:06:10 2014 (r268683) @@ -219,6 +219,11 @@ ctl_port_deregister(struct ctl_port *por ctl_pool_free(pool); ctl_free_opts(&port->options); + free(port->port_devid, M_CTL); + port->port_devid = NULL; + free(port->target_devid, M_CTL); + port->target_devid = NULL; + bailout: return (retval); } @@ -227,11 +232,49 @@ void ctl_port_set_wwns(struct ctl_port *port, int wwnn_valid, uint64_t wwnn, int wwpn_valid, uint64_t wwpn) { - if (wwnn_valid) + struct scsi_vpd_id_descriptor *desc; + int len, proto; + + if (port->port_type == CTL_PORT_FC) + proto = SCSI_PROTO_FC << 4; + else if (port->port_type == CTL_PORT_ISCSI) + proto = SCSI_PROTO_ISCSI << 4; + else + proto = SCSI_PROTO_SPI << 4; + + if (wwnn_valid) { port->wwnn = wwnn; - if (wwpn_valid) + free(port->target_devid, M_CTL); + + len = sizeof(struct scsi_vpd_device_id) + CTL_WWPN_LEN; + port->target_devid = malloc(sizeof(struct ctl_devid) + len, + M_CTL, M_WAITOK | M_ZERO); + port->target_devid->len = len; + desc = (struct scsi_vpd_id_descriptor *)port->target_devid->data; + desc->proto_codeset = proto | SVPD_ID_CODESET_BINARY; + desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_TARGET | + SVPD_ID_TYPE_NAA; + desc->length = CTL_WWPN_LEN; + scsi_u64to8b(port->wwnn, desc->identifier); + } + + if (wwpn_valid) { port->wwpn = wwpn; + + free(port->port_devid, M_CTL); + + len = sizeof(struct scsi_vpd_device_id) + CTL_WWPN_LEN; + port->port_devid = malloc(sizeof(struct ctl_devid) + len, + M_CTL, M_WAITOK | M_ZERO); + port->port_devid->len = len; + desc = (struct scsi_vpd_id_descriptor *)port->port_devid->data; + desc->proto_codeset = proto | SVPD_ID_CODESET_BINARY; + desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | + SVPD_ID_TYPE_NAA; + desc->length = CTL_WWPN_LEN; + scsi_u64to8b(port->wwpn, desc->identifier); + } } void Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:05:11 2014 (r268682) +++ stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:06:10 2014 (r268683) @@ -53,7 +53,6 @@ typedef int (*targ_func_t)(void *arg, st typedef int (*lun_func_t)(void *arg, struct ctl_id targ_id, int lun_id); typedef int (*fe_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); -typedef int (*fe_devid_t)(struct ctl_scsiio *ctsio, int alloc_len); #define CTL_FRONTEND_DECLARE(name, driver) \ static int name ## _modevent(module_t mod, int type, void *data) \ @@ -218,7 +217,6 @@ struct ctl_port { void *onoff_arg; /* passed to CTL */ lun_func_t lun_enable; /* passed to CTL */ lun_func_t lun_disable; /* passed to CTL */ - fe_devid_t devid; /* passed to CTL */ void *targ_lun_arg; /* passed to CTL */ void (*fe_datamove)(union ctl_io *io); /* passed to CTL */ void (*fe_done)(union ctl_io *io); /* passed to CTL */ @@ -231,6 +229,8 @@ struct ctl_port { uint64_t wwpn; /* set by CTL before online */ ctl_port_status status; /* used by CTL */ ctl_options_t options; /* passed to CTL */ + struct ctl_devid *port_devid; /* passed to CTL */ + struct ctl_devid *target_devid; /* passed to CTL */ STAILQ_ENTRY(ctl_port) fe_links; /* used by CTL */ STAILQ_ENTRY(ctl_port) links; /* used by CTL */ }; Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Jul 15 17:05:11 2014 (r268682) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Jul 15 17:06:10 2014 (r268683) @@ -193,8 +193,7 @@ cfcs_init(void) /* Company ID */ 0x5000000000000000ULL | /* NL-Port */ 0x0300; softc->wwpn = softc->wwnn + port->targ_port + 1; - port->wwnn = softc->wwnn; - port->wwpn = softc->wwpn; + ctl_port_set_wwns(port, true, softc->wwnn, true, softc->wwpn); } else { softc->wwnn = port->wwnn; softc->wwpn = port->wwpn; Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:05:11 2014 (r268682) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:06:10 2014 (r268683) @@ -155,7 +155,6 @@ static int cfiscsi_lun_disable(void *arg struct ctl_id target_id, int lun_id); static int cfiscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); -static int cfiscsi_devid(struct ctl_scsiio *ctsio, int alloc_len); static void cfiscsi_datamove(union ctl_io *io); static void cfiscsi_done(union ctl_io *io); static uint32_t cfiscsi_map_lun(void *arg, uint32_t lun); @@ -1952,8 +1951,9 @@ cfiscsi_ioctl_port_create(struct ctl_req struct cfiscsi_target *ct; struct ctl_port *port; const char *target, *alias, *tag; + struct scsi_vpd_id_descriptor *desc; ctl_options_t opts; - int retval; + int retval, len, idlen; ctl_init_opts(&opts, req->num_args, req->kern_args); target = ctl_get_opt(&opts, "cfiscsi_target"); @@ -1998,7 +1998,6 @@ cfiscsi_ioctl_port_create(struct ctl_req port->lun_enable = cfiscsi_lun_enable; port->lun_disable = cfiscsi_lun_disable; port->targ_lun_arg = ct; - port->devid = cfiscsi_devid; port->fe_datamove = cfiscsi_datamove; port->fe_done = cfiscsi_done; @@ -2010,10 +2009,41 @@ cfiscsi_ioctl_port_create(struct ctl_req port->options = opts; STAILQ_INIT(&opts); + /* Generate Port ID. */ + idlen = strlen(target) + strlen(",t,0x0001") + 1; + idlen = roundup2(idlen, 4); + len = sizeof(struct scsi_vpd_device_id) + idlen; + port->port_devid = malloc(sizeof(struct ctl_devid) + len, + M_CTL, M_WAITOK | M_ZERO); + port->port_devid->len = len; + desc = (struct scsi_vpd_id_descriptor *)port->port_devid->data; + desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; + desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | + SVPD_ID_TYPE_SCSI_NAME; + desc->length = idlen; + snprintf(desc->identifier, idlen, "%s,t,0x%4.4x", + target, port->virtual_port); + + /* Generate Target ID. */ + idlen = strlen(target) + 1; + idlen = roundup2(idlen, 4); + len = sizeof(struct scsi_vpd_device_id) + idlen; + port->target_devid = malloc(sizeof(struct ctl_devid) + len, + M_CTL, M_WAITOK | M_ZERO); + port->target_devid->len = len; + desc = (struct scsi_vpd_id_descriptor *)port->target_devid->data; + desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; + desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_TARGET | + SVPD_ID_TYPE_SCSI_NAME; + desc->length = idlen; + strlcpy(desc->identifier, target, idlen); + retval = ctl_port_register(port, /*master_SC*/ 1); if (retval != 0) { ctl_free_opts(&port->options); cfiscsi_target_release(ct); + free(port->port_devid, M_CFISCSI); + free(port->target_devid, M_CFISCSI); req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), "ctl_frontend_register() failed with error %d", retval); @@ -2140,206 +2170,6 @@ cfiscsi_ioctl(struct cdev *dev, return (0); } -static int -cfiscsi_devid(struct ctl_scsiio *ctsio, int alloc_len) -{ - struct cfiscsi_session *cs; - struct scsi_vpd_device_id *devid_ptr; - struct scsi_vpd_id_descriptor *desc, *desc1, *desc2, *desc3, *desc4; - struct scsi_vpd_id_descriptor *desc5; - struct scsi_vpd_id_t10 *t10id; - struct ctl_lun *lun; - const struct icl_pdu *request; - int i, ret; - char *val; - size_t data_len, devid_len, wwnn_len, wwpn_len, lun_name_len; - - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - request = ctsio->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; - cs = PDU_SESSION(request); - - wwpn_len = strlen(cs->cs_target->ct_name); - wwpn_len += strlen(",t,0x0001"); - wwpn_len += 1; /* '\0' */ - if ((wwpn_len % 4) != 0) - wwpn_len += (4 - (wwpn_len % 4)); - - wwnn_len = strlen(cs->cs_target->ct_name); - wwnn_len += 1; /* '\0' */ - if ((wwnn_len % 4) != 0) - wwnn_len += (4 - (wwnn_len % 4)); - - if (lun == NULL) { - devid_len = CTL_DEVID_MIN_LEN; - lun_name_len = 0; - } else { - devid_len = max(CTL_DEVID_MIN_LEN, - strnlen(lun->be_lun->device_id, CTL_DEVID_LEN)); - lun_name_len = strlen(cs->cs_target->ct_name); - lun_name_len += strlen(",lun,XXXXXXXX"); - lun_name_len += 1; /* '\0' */ - if ((lun_name_len % 4) != 0) - lun_name_len += (4 - (lun_name_len % 4)); - } - - data_len = sizeof(struct scsi_vpd_device_id) + - sizeof(struct scsi_vpd_id_descriptor) + - sizeof(struct scsi_vpd_id_t10) + devid_len + - sizeof(struct scsi_vpd_id_descriptor) + lun_name_len + - sizeof(struct scsi_vpd_id_descriptor) + wwnn_len + - sizeof(struct scsi_vpd_id_descriptor) + wwpn_len + - sizeof(struct scsi_vpd_id_descriptor) + - sizeof(struct scsi_vpd_id_rel_trgt_port_id) + - sizeof(struct scsi_vpd_id_descriptor) + - sizeof(struct scsi_vpd_id_trgt_port_grp_id); - - ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); - devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr; - ctsio->kern_sg_entries = 0; - - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } - ctsio->kern_data_resid = 0; - ctsio->kern_rel_offset = 0; - ctsio->kern_sg_entries = 0; - - desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list; - t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0]; - desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + - sizeof(struct scsi_vpd_id_t10) + devid_len); - desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] + - lun_name_len); - desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] + - wwnn_len); - desc4 = (struct scsi_vpd_id_descriptor *)(&desc3->identifier[0] + - wwpn_len); - desc5 = (struct scsi_vpd_id_descriptor *)(&desc4->identifier[0] + - sizeof(struct scsi_vpd_id_rel_trgt_port_id)); - - if (lun != NULL) - devid_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | - lun->be_lun->lun_type; - else - devid_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; - - devid_ptr->page_code = SVPD_DEVICE_ID; - - scsi_ulto2b(data_len - 4, devid_ptr->length); - - /* - * We're using a LUN association here. i.e., this device ID is a - * per-LUN identifier. - */ - desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_ASCII; - desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; - desc->length = sizeof(*t10id) + devid_len; - if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options, - "vendor")) == NULL) { - strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor)); - } else { - memset(t10id->vendor, ' ', sizeof(t10id->vendor)); - strncpy(t10id->vendor, val, - min(sizeof(t10id->vendor), strlen(val))); - } - - /* - * If we've actually got a backend, copy the device id from the - * per-LUN data. Otherwise, set it to all spaces. - */ - if (lun != NULL) { - /* - * Copy the backend's LUN ID. - */ - strncpy((char *)t10id->vendor_spec_id, - (char *)lun->be_lun->device_id, devid_len); - } else { - /* - * No backend, set this to spaces. - */ - memset(t10id->vendor_spec_id, 0x20, devid_len); - } - - /* - * desc1 is for the unique LUN name. - * - * XXX: According to SPC-3, LUN must report the same ID through - * all the ports. The code below, however, reports the - * ID only via iSCSI. - */ - desc1->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; - desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | - SVPD_ID_TYPE_SCSI_NAME; - desc1->length = lun_name_len; - if (lun != NULL) { - /* - * Find the per-target LUN number. - */ - for (i = 0; i < CTL_MAX_LUNS; i++) { - if (cs->cs_target->ct_luns[i] == lun->lun) - break; - } - KASSERT(i < CTL_MAX_LUNS, - ("lun %jd not found", (uintmax_t)lun->lun)); - ret = snprintf(desc1->identifier, lun_name_len, "%s,lun,%d", - cs->cs_target->ct_name, i); - KASSERT(ret > 0 && ret <= lun_name_len, ("bad snprintf")); - } else { - KASSERT(lun_name_len == 0, ("no lun, but lun_name_len != 0")); - } - - /* - * desc2 is for the Target Name. - */ - desc2->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; - desc2->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_TARGET | - SVPD_ID_TYPE_SCSI_NAME; - desc2->length = wwnn_len; - snprintf(desc2->identifier, wwnn_len, "%s", cs->cs_target->ct_name); - - /* - * desc3 is for the WWPN which is a port asscociation. - */ - desc3->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8; - desc3->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | - SVPD_ID_TYPE_SCSI_NAME; - desc3->length = wwpn_len; - snprintf(desc3->identifier, wwpn_len, "%s,t,0x%4.4x", - cs->cs_target->ct_name, cs->cs_portal_group_tag); - - /* - * desc3 is for the Relative Target Port(type 4h) identifier - */ - desc4->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY; - desc4->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | - SVPD_ID_TYPE_RELTARG; - desc4->length = 4; - desc4->identifier[3] = 1; - - /* - * desc4 is for the Target Port Group(type 5h) identifier - */ - desc5->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY; - desc5->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | - SVPD_ID_TYPE_TPORTGRP; - desc5->length = 4; - desc5->identifier[3] = 1; - - ctsio->scsi_status = SCSI_STATUS_OK; - - ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; - ctsio->be_move_done = ctl_config_move_done; - ctl_datamove((union ctl_io *)ctsio); - - return (CTL_RETVAL_COMPLETE); -} - static void cfiscsi_target_hold(struct cfiscsi_target *ct) { Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Tue Jul 15 17:05:11 2014 (r268682) +++ stable/10/sys/cam/ctl/ctl_private.h Tue Jul 15 17:06:10 2014 (r268683) @@ -367,6 +367,11 @@ struct ctl_per_res_info { #define CTL_PR_ALL_REGISTRANTS 0xFFFF #define CTL_PR_NO_RESERVATION 0xFFF0 +struct ctl_devid { + int len; + uint8_t data[]; +}; + /* * For report target port groups. */ @@ -402,6 +407,7 @@ struct ctl_lun { uint16_t pr_res_idx; uint8_t res_type; uint8_t write_buffer[524288]; + struct ctl_devid *lun_devid; }; typedef enum { Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Tue Jul 15 17:05:11 2014 (r268682) +++ stable/10/sys/cam/ctl/scsi_ctl.c Tue Jul 15 17:06:10 2014 (r268683) @@ -1732,10 +1732,9 @@ ctlfe_onoffline(void *arg, int online) * using with the frontend code so it's reported * accurately. */ - bus_softc->port.wwnn = - ccb->knob.xport_specific.fc.wwnn; - bus_softc->port.wwpn = - ccb->knob.xport_specific.fc.wwpn; + ctl_port_set_wwns(&bus_softc->port, + true, ccb->knob.xport_specific.fc.wwnn, + true, ccb->knob.xport_specific.fc.wwpn); set_wwnn = 1; #else /* RANDOM_WWNN */ /* @@ -1751,10 +1750,9 @@ ctlfe_onoffline(void *arg, int online) bus_softc->port.wwpn; set_wwnn = 1; } else { - bus_softc->port.wwnn = - ccb->knob.xport_specific.fc.wwnn; - bus_softc->port.wwpn = - ccb->knob.xport_specific.fc.wwpn; + ctl_port_set_wwns(&bus_softc->port, + true, ccb->knob.xport_specific.fc.wwnn, + true, ccb->knob.xport_specific.fc.wwpn); } #endif /* RANDOM_WWNN */ Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Tue Jul 15 17:05:11 2014 (r268682) +++ stable/10/usr.sbin/ctladm/ctladm.8 Tue Jul 15 17:06:10 2014 (r268683) @@ -945,6 +945,8 @@ Specifies LUN vendor string up to 8 char Specifies LUN product string up to 16 chars. .It Va revision Specifies LUN revision string up to 4 chars. +.It Va scsiname +Specifies LUN SCSI name string. .It Va unmap Set to "on", enables UNMAP support for the LUN. .El Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Tue Jul 15 17:05:11 2014 (r268682) +++ stable/10/usr.sbin/ctld/kernel.c Tue Jul 15 17:06:10 2014 (r268683) @@ -113,7 +113,6 @@ struct cctl_lun { char *serial_number; char *device_id; char *cfiscsi_target; - char *cfiscsi_target_alias; int cfiscsi_lun; STAILQ_HEAD(,cctl_lun_nv) attr_list; STAILQ_ENTRY(cctl_lun) links; @@ -230,9 +229,6 @@ cctl_end_element(void *user_data, const } else if (strcmp(name, "cfiscsi_target") == 0) { cur_lun->cfiscsi_target = str; str = NULL; - } else if (strcmp(name, "cfiscsi_target_alias") == 0) { - cur_lun->cfiscsi_target_alias = str; - str = NULL; } else if (strcmp(name, "cfiscsi_lun") == 0) { cur_lun->cfiscsi_lun = strtoul(str, NULL, 0); } else if (strcmp(name, "lun") == 0) { @@ -640,17 +636,6 @@ kernel_lun_add(struct lun *lun) assert(lo != NULL); } - if (lun->l_target->t_alias != NULL) { - lo = lun_option_find(lun, "cfiscsi_target_alias"); - if (lo != NULL) { - lun_option_set(lo, lun->l_target->t_alias); - } else { - lo = lun_option_new(lun, "cfiscsi_target_alias", - lun->l_target->t_alias); - assert(lo != NULL); - } - } - asprintf(&tmp, "%d", lun->l_lun); if (tmp == NULL) log_errx(1, "asprintf"); @@ -664,6 +649,19 @@ kernel_lun_add(struct lun *lun) assert(lo != NULL); } + asprintf(&tmp, "%s,lun,%d", lun->l_target->t_name, lun->l_lun); + if (tmp == NULL) + log_errx(1, "asprintf"); + lo = lun_option_find(lun, "scsiname"); + if (lo != NULL) { + lun_option_set(lo, tmp); + free(tmp); + } else { + lo = lun_option_new(lun, "scsiname", tmp); + free(tmp); + assert(lo != NULL); + } + num_options = 0; TAILQ_FOREACH(lo, &lun->l_options, lo_next) num_options++; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:07:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DEE0DDEE; Tue, 15 Jul 2014 17:07:08 +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 CA91F2C99; Tue, 15 Jul 2014 17:07:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6FH78wo084120; Tue, 15 Jul 2014 17:07:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FH77hh084113; Tue, 15 Jul 2014 17:07:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151707.s6FH77hh084113@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268684 - in stable/10: sys/cam/ctl usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:07:09 -0000 Author: mav Date: Tue Jul 15 17:07:07 2014 New Revision: 268684 URL: http://svnweb.freebsd.org/changeset/base/268684 Log: MFC r268302: Pass through iSCSI session ISID from LOGIN request to the CTL frontend. ISID is an important part of initiator transport ID for iSCSI. It is not used now, but should be to properly implement persistent reservation. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h stable/10/sys/cam/ctl/ctl_ioctl.h stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/kernel.c stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:07:07 2014 (r268684) @@ -1511,6 +1511,13 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cihp->initiator_addr, sizeof(cs->cs_initiator_addr)); strlcpy(cs->cs_initiator_alias, cihp->initiator_alias, sizeof(cs->cs_initiator_alias)); + memcpy(cs->cs_initiator_isid, + cihp->initiator_isid, sizeof(cs->cs_initiator_isid)); + snprintf(cs->cs_initiator_id, sizeof(cs->cs_initiator_id), + "%s,i,0x%02x%02x%02x%02x%02x%02x", cs->cs_initiator_name, + cihp->initiator_isid[0], cihp->initiator_isid[1], + cihp->initiator_isid[2], cihp->initiator_isid[3], + cihp->initiator_isid[4], cihp->initiator_isid[5]); #ifdef ICL_KERNEL_PROXY if (cihp->socket > 0) { Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:07:07 2014 (r268684) @@ -86,6 +86,8 @@ struct cfiscsi_session { char cs_initiator_name[CTL_ISCSI_NAME_LEN]; char cs_initiator_addr[CTL_ISCSI_ADDR_LEN]; char cs_initiator_alias[CTL_ISCSI_ALIAS_LEN]; + char cs_initiator_isid[6]; + char cs_initiator_id[CTL_ISCSI_NAME_LEN + 5 + 6 + 1]; unsigned int cs_id; int cs_ctl_initid; #ifdef ICL_KERNEL_PROXY Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Tue Jul 15 17:07:07 2014 (r268684) @@ -681,6 +681,7 @@ struct ctl_iscsi_handoff_params { char initiator_name[CTL_ISCSI_NAME_LEN]; char initiator_addr[CTL_ISCSI_ADDR_LEN]; char initiator_alias[CTL_ISCSI_ALIAS_LEN]; + uint8_t initiator_isid[6]; char target_name[CTL_ISCSI_NAME_LEN]; int socket; int portal_group_tag; Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/usr.sbin/ctld/ctld.h Tue Jul 15 17:07:07 2014 (r268684) @@ -178,6 +178,7 @@ struct connection { char *conn_initiator_name; char *conn_initiator_addr; char *conn_initiator_alias; + uint8_t conn_initiator_isid[6]; uint32_t conn_cmdsn; uint32_t conn_statsn; size_t conn_max_data_segment_length; Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/usr.sbin/ctld/kernel.c Tue Jul 15 17:07:07 2014 (r268684) @@ -787,6 +787,8 @@ kernel_handoff(struct connection *conn) strlcpy(req.data.handoff.initiator_alias, conn->conn_initiator_alias, sizeof(req.data.handoff.initiator_alias)); } + memcpy(req.data.handoff.initiator_isid, conn->conn_initiator_isid, + sizeof(req.data.handoff.initiator_isid)); strlcpy(req.data.handoff.target_name, conn->conn_target->t_name, sizeof(req.data.handoff.target_name)); #ifdef ICL_KERNEL_PROXY Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/usr.sbin/ctld/login.c Tue Jul 15 17:07:07 2014 (r268684) @@ -850,6 +850,9 @@ login(struct connection *conn) log_errx(1, "received Login PDU with non-zero TSIH"); } + memcpy(conn->conn_initiator_isid, bhslr->bhslr_isid, + sizeof(conn->conn_initiator_isid)); + /* * XXX: Implement the C flag some day. */ From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:08:06 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1808AF3B; Tue, 15 Jul 2014 17:08: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 038C42CA7; Tue, 15 Jul 2014 17:08: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 s6FH85mx084347; Tue, 15 Jul 2014 17:08:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FH84ZS084338; Tue, 15 Jul 2014 17:08:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151708.s6FH84ZS084338@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268685 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:08:06 -0000 Author: mav Date: Tue Jul 15 17:08:04 2014 New Revision: 268685 URL: http://svnweb.freebsd.org/changeset/base/268685 Log: MFC r268307: Move lun_map() method from command nexus to port. Previous implementation made impossible to do some things, such as calling it for ports other then one through which command arrived. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h stable/10/sys/cam/ctl/ctl_io.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:07:07 2014 (r268684) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:08:04 2014 (r268685) @@ -348,6 +348,7 @@ static int ctl_ioctl(struct cdev *dev, u struct thread *td); uint32_t ctl_get_resindex(struct ctl_nexus *nexus); uint32_t ctl_port_idx(int port_num); +static uint32_t ctl_map_lun(int port_num, uint32_t lun); #ifdef unused static union ctl_io *ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port, uint32_t targ_target, uint32_t targ_lun, @@ -3347,6 +3348,19 @@ ctl_port_idx(int port_num) return(port_num - CTL_MAX_PORTS); } +static uint32_t +ctl_map_lun(int port_num, uint32_t lun_id) +{ + struct ctl_port *port; + + port = control_softc->ctl_ports[ctl_port_idx(port_num)]; + if (port == NULL) + return (UINT32_MAX); + if (port->lun_map == NULL) + return (lun_id); + return (port->lun_map(port->targ_lun_arg, lun_id)); +} + /* * Note: This only works for bitmask sizes that are at least 32 bits, and * that are a power of 2. @@ -9258,9 +9272,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_lock(&control_softc->ctl_lock); for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { - lun_id = targ_lun_id; - if (ctsio->io_hdr.nexus.lun_map_fn != NULL) - lun_id = ctsio->io_hdr.nexus.lun_map_fn(ctsio->io_hdr.nexus.lun_map_arg, lun_id); + lun_id = ctl_map_lun(ctsio->io_hdr.nexus.targ_port, targ_lun_id); if (lun_id >= CTL_MAX_LUNS) continue; lun = control_softc->ctl_luns[lun_id]; @@ -13238,8 +13250,7 @@ ctl_queue_sense(union ctl_io *io) * information. */ targ_lun = io->io_hdr.nexus.targ_lun; - if (io->io_hdr.nexus.lun_map_fn != NULL) - targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun); + targ_lun = ctl_map_lun(io->io_hdr.nexus.targ_port, targ_lun); if ((targ_lun < CTL_MAX_LUNS) && (ctl_softc->ctl_luns[targ_lun] != NULL)) lun = ctl_softc->ctl_luns[targ_lun]; @@ -13290,11 +13301,8 @@ ctl_queue(union ctl_io *io) #endif /* CTL_TIME_IO */ /* Map FE-specific LUN ID into global one. */ - if (io->io_hdr.nexus.lun_map_fn != NULL) - io->io_hdr.nexus.targ_mapped_lun = io->io_hdr.nexus.lun_map_fn( - io->io_hdr.nexus.lun_map_arg, io->io_hdr.nexus.targ_lun); - else - io->io_hdr.nexus.targ_mapped_lun = io->io_hdr.nexus.targ_lun; + io->io_hdr.nexus.targ_mapped_lun = + ctl_map_lun(io->io_hdr.nexus.targ_port, io->io_hdr.nexus.targ_lun); switch (io->io_hdr.io_type) { case CTL_IO_SCSI: Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:07:07 2014 (r268684) +++ stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:08:04 2014 (r268685) @@ -49,8 +49,8 @@ typedef enum { typedef int (*fe_init_t)(void); typedef void (*fe_shutdown_t)(void); typedef void (*port_func_t)(void *onoff_arg); -typedef int (*targ_func_t)(void *arg, struct ctl_id targ_id); typedef int (*lun_func_t)(void *arg, struct ctl_id targ_id, int lun_id); +typedef uint32_t (*lun_map_func_t)(void *arg, uint32_t lun_id); typedef int (*fe_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); @@ -217,6 +217,7 @@ struct ctl_port { void *onoff_arg; /* passed to CTL */ lun_func_t lun_enable; /* passed to CTL */ lun_func_t lun_disable; /* passed to CTL */ + lun_map_func_t lun_map; /* passed to CTL */ void *targ_lun_arg; /* passed to CTL */ void (*fe_datamove)(union ctl_io *io); /* passed to CTL */ void (*fe_done)(union ctl_io *io); /* passed to CTL */ Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:07:07 2014 (r268684) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:08:04 2014 (r268685) @@ -153,11 +153,11 @@ static int cfiscsi_lun_enable(void *arg, struct ctl_id target_id, int lun_id); static int cfiscsi_lun_disable(void *arg, struct ctl_id target_id, int lun_id); +static uint32_t cfiscsi_lun_map(void *arg, uint32_t lun); static int cfiscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); static void cfiscsi_datamove(union ctl_io *io); static void cfiscsi_done(union ctl_io *io); -static uint32_t cfiscsi_map_lun(void *arg, uint32_t lun); static bool cfiscsi_pdu_update_cmdsn(const struct icl_pdu *request); static void cfiscsi_pdu_handle_nop_out(struct icl_pdu *request); static void cfiscsi_pdu_handle_scsi_command(struct icl_pdu *request); @@ -556,8 +556,6 @@ cfiscsi_pdu_handle_scsi_command(struct i io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; io->io_hdr.nexus.targ_target.id = 0; io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhssc->bhssc_lun); - io->io_hdr.nexus.lun_map_fn = cfiscsi_map_lun; - io->io_hdr.nexus.lun_map_arg = cs; io->scsiio.tag_num = bhssc->bhssc_initiator_task_tag; switch ((bhssc->bhssc_flags & BHSSC_FLAGS_ATTR)) { case BHSSC_FLAGS_ATTR_UNTAGGED: @@ -622,8 +620,6 @@ cfiscsi_pdu_handle_task_request(struct i io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; io->io_hdr.nexus.targ_target.id = 0; io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhstmr->bhstmr_lun); - io->io_hdr.nexus.lun_map_fn = cfiscsi_map_lun; - io->io_hdr.nexus.lun_map_arg = cs; io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */ switch (bhstmr->bhstmr_function & ~0x80) { @@ -2004,6 +2000,7 @@ cfiscsi_ioctl_port_create(struct ctl_req port->onoff_arg = ct; port->lun_enable = cfiscsi_lun_enable; port->lun_disable = cfiscsi_lun_disable; + port->lun_map = cfiscsi_lun_map; port->targ_lun_arg = ct; port->fe_datamove = cfiscsi_datamove; port->fe_done = cfiscsi_done; @@ -2250,7 +2247,7 @@ cfiscsi_target_find_or_create(struct cfi } for (i = 0; i < CTL_MAX_LUNS; i++) - newct->ct_luns[i] = -1; + newct->ct_luns[i] = UINT32_MAX; strlcpy(newct->ct_name, name, sizeof(newct->ct_name)); if (alias != NULL) @@ -2267,22 +2264,16 @@ cfiscsi_target_find_or_create(struct cfi * Takes LUN from the target space and returns LUN from the CTL space. */ static uint32_t -cfiscsi_map_lun(void *arg, uint32_t lun) +cfiscsi_lun_map(void *arg, uint32_t lun) { - struct cfiscsi_session *cs; - - cs = arg; + struct cfiscsi_target *ct = arg; if (lun >= CTL_MAX_LUNS) { CFISCSI_DEBUG("requested lun number %d is higher " "than maximum %d", lun, CTL_MAX_LUNS - 1); - return (0xffffffff); + return (UINT32_MAX); } - - if (cs->cs_target->ct_luns[lun] < 0) - return (0xffffffff); - - return (cs->cs_target->ct_luns[lun]); + return (ct->ct_luns[lun]); } static int @@ -2296,7 +2287,7 @@ cfiscsi_target_set_lun(struct cfiscsi_ta return (-1); } - if (ct->ct_luns[lun_id] >= 0) { + if (ct->ct_luns[lun_id] < CTL_MAX_LUNS) { /* * CTL calls cfiscsi_lun_enable() twice for each LUN - once * when the LUN is created, and a second time just before @@ -2365,11 +2356,9 @@ cfiscsi_lun_disable(void *arg, struct ct mtx_lock(&softc->lock); for (i = 0; i < CTL_MAX_LUNS; i++) { - if (ct->ct_luns[i] < 0) - continue; if (ct->ct_luns[i] != lun_id) continue; - ct->ct_luns[lun_id] = -1; + ct->ct_luns[i] = UINT32_MAX; break; } mtx_unlock(&softc->lock); Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:07:07 2014 (r268684) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:08:04 2014 (r268685) @@ -38,7 +38,7 @@ struct cfiscsi_target { TAILQ_ENTRY(cfiscsi_target) ct_next; - int ct_luns[CTL_MAX_LUNS]; + uint32_t ct_luns[CTL_MAX_LUNS]; struct cfiscsi_softc *ct_softc; volatile u_int ct_refcount; char ct_name[CTL_ISCSI_NAME_LEN]; Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Tue Jul 15 17:07:07 2014 (r268684) +++ stable/10/sys/cam/ctl/ctl_io.h Tue Jul 15 17:08:04 2014 (r268685) @@ -221,8 +221,6 @@ struct ctl_nexus { struct ctl_id targ_target; /* Destination target */ uint32_t targ_lun; /* Destination lun */ uint32_t targ_mapped_lun; /* Destination lun CTL-wide */ - uint32_t (*lun_map_fn)(void *arg, uint32_t lun); - void *lun_map_arg; }; typedef enum { From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:09:03 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1FF37137; Tue, 15 Jul 2014 17:09: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 0C0862CBC; Tue, 15 Jul 2014 17:09: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 s6FH92eJ084572; Tue, 15 Jul 2014 17:09:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FH92pQ084565; Tue, 15 Jul 2014 17:09:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151709.s6FH92pQ084565@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268686 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:09:03 -0000 Author: mav Date: Tue Jul 15 17:09:02 2014 New Revision: 268686 URL: http://svnweb.freebsd.org/changeset/base/268686 Log: MFC r268308: Make REPORT TARGET PORT GROUPS command report realistic data instead of hardcoded garbage. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:08:04 2014 (r268685) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:09:02 2014 (r268686) @@ -349,6 +349,7 @@ static int ctl_ioctl(struct cdev *dev, u uint32_t ctl_get_resindex(struct ctl_nexus *nexus); uint32_t ctl_port_idx(int port_num); static uint32_t ctl_map_lun(int port_num, uint32_t lun); +static uint32_t ctl_map_lun_back(int port_num, uint32_t lun); #ifdef unused static union ctl_io *ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port, uint32_t targ_target, uint32_t targ_lun, @@ -3361,6 +3362,22 @@ ctl_map_lun(int port_num, uint32_t lun_i return (port->lun_map(port->targ_lun_arg, lun_id)); } +static uint32_t +ctl_map_lun_back(int port_num, uint32_t lun_id) +{ + struct ctl_port *port; + uint32_t i; + + port = control_softc->ctl_ports[ctl_port_idx(port_num)]; + if (port->lun_map == NULL) + return (lun_id); + for (i = 0; i < CTL_MAX_LUNS; i++) { + if (port->lun_map(port->targ_lun_arg, i) == lun_id) + return (i); + } + return (UINT32_MAX); +} + /* * Note: This only works for bitmask sizes that are at least 32 bits, and * that are a power of 2. @@ -7120,14 +7137,14 @@ ctl_report_tagret_port_groups(struct ctl { struct scsi_maintenance_in *cdb; int retval; - int alloc_len, total_len = 0; - int num_target_port_groups, single; + int alloc_len, ext, total_len = 0, g, p, pc, pg; + int num_target_port_groups, num_target_ports, single; struct ctl_lun *lun; struct ctl_softc *softc; + struct ctl_port *port; struct scsi_target_group_data *rtg_ptr; - struct scsi_target_port_group_descriptor *tpg_desc_ptr1, *tpg_desc_ptr2; - struct scsi_target_port_descriptor *tp_desc_ptr1_1, *tp_desc_ptr1_2, - *tp_desc_ptr2_1, *tp_desc_ptr2_2; + struct scsi_target_group_data_extended *rtg_ext_ptr; + struct scsi_target_port_group_descriptor *tpg_desc; CTL_DEBUG_PRINT(("ctl_report_tagret_port_groups\n")); @@ -7137,17 +7154,48 @@ ctl_report_tagret_port_groups(struct ctl retval = CTL_RETVAL_COMPLETE; + switch (cdb->byte2 & STG_PDF_MASK) { + case STG_PDF_LENGTH: + ext = 0; + break; + case STG_PDF_EXTENDED: + ext = 1; + break; + default: + ctl_set_invalid_field(/*ctsio*/ ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 2, + /*bit_valid*/ 1, + /*bit*/ 5); + ctl_done((union ctl_io *)ctsio); + return(retval); + } + single = ctl_is_single; if (single) - num_target_port_groups = NUM_TARGET_PORT_GROUPS - 1; + num_target_port_groups = 1; else - num_target_port_groups = NUM_TARGET_PORT_GROUPS; + num_target_port_groups = NUM_TARGET_PORT_GROUPS; + num_target_ports = 0; + mtx_lock(&softc->ctl_lock); + STAILQ_FOREACH(port, &softc->port_list, links) { + if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) + continue; + if (ctl_map_lun_back(port->targ_port, lun->lun) >= CTL_MAX_LUNS) + continue; + num_target_ports++; + } + mtx_unlock(&softc->ctl_lock); - total_len = sizeof(struct scsi_target_group_data) + - sizeof(struct scsi_target_port_group_descriptor) * + if (ext) + total_len = sizeof(struct scsi_target_group_data_extended); + else + total_len = sizeof(struct scsi_target_group_data); + total_len += sizeof(struct scsi_target_port_group_descriptor) * num_target_port_groups + - sizeof(struct scsi_target_port_descriptor) * - NUM_PORTS_PER_GRP * num_target_port_groups; + sizeof(struct scsi_target_port_descriptor) * + num_target_ports * num_target_port_groups; alloc_len = scsi_4btoul(cdb->length); @@ -7167,76 +7215,51 @@ ctl_report_tagret_port_groups(struct ctl ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; - rtg_ptr = (struct scsi_target_group_data *)ctsio->kern_data_ptr; - - tpg_desc_ptr1 = &rtg_ptr->groups[0]; - tp_desc_ptr1_1 = &tpg_desc_ptr1->descriptors[0]; - tp_desc_ptr1_2 = (struct scsi_target_port_descriptor *) - &tp_desc_ptr1_1->desc_list[0]; - - if (single == 0) { - tpg_desc_ptr2 = (struct scsi_target_port_group_descriptor *) - &tp_desc_ptr1_2->desc_list[0]; - tp_desc_ptr2_1 = &tpg_desc_ptr2->descriptors[0]; - tp_desc_ptr2_2 = (struct scsi_target_port_descriptor *) - &tp_desc_ptr2_1->desc_list[0]; - } else { - tpg_desc_ptr2 = NULL; - tp_desc_ptr2_1 = NULL; - tp_desc_ptr2_2 = NULL; - } - - scsi_ulto4b(total_len - 4, rtg_ptr->length); - if (single == 0) { - if (ctsio->io_hdr.nexus.targ_port < CTL_MAX_PORTS) { - if (lun->flags & CTL_LUN_PRIMARY_SC) { - tpg_desc_ptr1->pref_state = TPG_PRIMARY; - tpg_desc_ptr2->pref_state = - TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; - } else { - tpg_desc_ptr1->pref_state = - TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; - tpg_desc_ptr2->pref_state = TPG_PRIMARY; - } - } else { - if (lun->flags & CTL_LUN_PRIMARY_SC) { - tpg_desc_ptr1->pref_state = - TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; - tpg_desc_ptr2->pref_state = TPG_PRIMARY; - } else { - tpg_desc_ptr1->pref_state = TPG_PRIMARY; - tpg_desc_ptr2->pref_state = - TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; - } - } + if (ext) { + rtg_ext_ptr = (struct scsi_target_group_data_extended *) + ctsio->kern_data_ptr; + scsi_ulto4b(total_len - 4, rtg_ext_ptr->length); + rtg_ext_ptr->format_type = 0x10; + rtg_ext_ptr->implicit_transition_time = 0; + tpg_desc = &rtg_ext_ptr->groups[0]; } else { - tpg_desc_ptr1->pref_state = TPG_PRIMARY; + rtg_ptr = (struct scsi_target_group_data *) + ctsio->kern_data_ptr; + scsi_ulto4b(total_len - 4, rtg_ptr->length); + tpg_desc = &rtg_ptr->groups[0]; } - tpg_desc_ptr1->support = 0; - tpg_desc_ptr1->target_port_group[1] = 1; - tpg_desc_ptr1->status = TPG_IMPLICIT; - tpg_desc_ptr1->target_port_count= NUM_PORTS_PER_GRP; - - if (single == 0) { - tpg_desc_ptr2->support = 0; - tpg_desc_ptr2->target_port_group[1] = 2; - tpg_desc_ptr2->status = TPG_IMPLICIT; - tpg_desc_ptr2->target_port_count = NUM_PORTS_PER_GRP; - tp_desc_ptr1_1->relative_target_port_identifier[1] = 1; - tp_desc_ptr1_2->relative_target_port_identifier[1] = 2; - - tp_desc_ptr2_1->relative_target_port_identifier[1] = 9; - tp_desc_ptr2_2->relative_target_port_identifier[1] = 10; - } else { - if (ctsio->io_hdr.nexus.targ_port < CTL_MAX_PORTS) { - tp_desc_ptr1_1->relative_target_port_identifier[1] = 1; - tp_desc_ptr1_2->relative_target_port_identifier[1] = 2; - } else { - tp_desc_ptr1_1->relative_target_port_identifier[1] = 9; - tp_desc_ptr1_2->relative_target_port_identifier[1] = 10; - } + pg = ctsio->io_hdr.nexus.targ_port / CTL_MAX_PORTS; + mtx_lock(&softc->ctl_lock); + for (g = 0; g < num_target_port_groups; g++) { + if (g == pg) + tpg_desc->pref_state = TPG_PRIMARY | + TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + else + tpg_desc->pref_state = + TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; + tpg_desc->support = TPG_AO_SUP; + if (!single) + tpg_desc->support = TPG_AN_SUP; + scsi_ulto2b(g + 1, tpg_desc->target_port_group); + tpg_desc->status = TPG_IMPLICIT; + pc = 0; + STAILQ_FOREACH(port, &softc->port_list, links) { + if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) + continue; + if (ctl_map_lun_back(port->targ_port, lun->lun) >= + CTL_MAX_LUNS) + continue; + p = port->targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS; + scsi_ulto2b(p, tpg_desc->descriptors[pc]. + relative_target_port_identifier); + pc++; + } + tpg_desc->target_port_count = pc; + tpg_desc = (struct scsi_target_port_group_descriptor *) + &tpg_desc->descriptors[pc]; } + mtx_unlock(&softc->ctl_lock); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; @@ -9778,10 +9801,8 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | SVPD_ID_TYPE_TPORTGRP; desc->length = 4; - if (ctsio->io_hdr.nexus.targ_port < CTL_MAX_PORTS || ctl_is_single) - scsi_ulto2b(1, &desc->identifier[2]); - else - scsi_ulto2b(2, &desc->identifier[2]); + scsi_ulto2b(ctsio->io_hdr.nexus.targ_port / CTL_MAX_PORTS + 1, + &desc->identifier[2]); desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + sizeof(struct scsi_vpd_id_trgt_port_grp_id)); Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Tue Jul 15 17:08:04 2014 (r268685) +++ stable/10/sys/cam/ctl/ctl_private.h Tue Jul 15 17:09:02 2014 (r268686) @@ -376,7 +376,6 @@ struct ctl_devid { * For report target port groups. */ #define NUM_TARGET_PORT_GROUPS 2 -#define NUM_PORTS_PER_GRP 2 struct ctl_lun { struct mtx lun_lock; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:09:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 6CDB0386; Tue, 15 Jul 2014 17:09: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 4D1662CDA; Tue, 15 Jul 2014 17:09: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 s6FH9rqd085123; Tue, 15 Jul 2014 17:09:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FH9qmp085121; Tue, 15 Jul 2014 17:09:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151709.s6FH9qmp085121@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268687 - in stable/10/sys/cam: ctl scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:09:53 -0000 Author: mav Date: Tue Jul 15 17:09:52 2014 New Revision: 268687 URL: http://svnweb.freebsd.org/changeset/base/268687 Log: MFC r268309: Add support for SCSI Ports (88h) VPD page. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:09:02 2014 (r268686) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:09:52 2014 (r268687) @@ -317,10 +317,11 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verb &verbose, 0, "Show SCSI errors returned to initiator"); /* - * Serial number (0x80), device id (0x83), supported pages (0x00), - * Block limits (0xB0) and Logical Block Provisioning (0xB2) + * Supported pages (0x00), Serial number (0x80), Device ID (0x83), + * SCSI Ports (0x88), Block limits (0xB0) and + * Logical Block Provisioning (0xB2) */ -#define SCSI_EVPD_NUM_SUPPORTED_PAGES 5 +#define SCSI_EVPD_NUM_SUPPORTED_PAGES 6 static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, int param); @@ -378,6 +379,8 @@ static void ctl_hndl_per_res_out_on_othe static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len); +static int ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio, + int alloc_len); static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len); @@ -7240,7 +7243,7 @@ ctl_report_tagret_port_groups(struct ctl TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; tpg_desc->support = TPG_AO_SUP; if (!single) - tpg_desc->support = TPG_AN_SUP; + tpg_desc->support |= TPG_AN_SUP; scsi_ulto2b(g + 1, tpg_desc->target_port_group); tpg_desc->status = TPG_IMPLICIT; pc = 0; @@ -9628,10 +9631,12 @@ ctl_inquiry_evpd_supported(struct ctl_sc pages->page_list[1] = SVPD_UNIT_SERIAL_NUMBER; /* Device Identification */ pages->page_list[2] = SVPD_DEVICE_ID; + /* SCSI Ports */ + pages->page_list[3] = SVPD_SCSI_PORTS; /* Block limits */ - pages->page_list[3] = SVPD_BLOCK_LIMITS; + pages->page_list[4] = SVPD_BLOCK_LIMITS; /* Logical Block Provisioning */ - pages->page_list[4] = SVPD_LBP; + pages->page_list[5] = SVPD_LBP; ctsio->scsi_status = SCSI_STATUS_OK; @@ -9822,6 +9827,117 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio } static int +ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio, int alloc_len) +{ + struct ctl_softc *softc = control_softc; + struct scsi_vpd_scsi_ports *sp; + struct scsi_vpd_port_designation *pd; + struct scsi_vpd_port_designation_cont *pdc; + struct ctl_lun *lun; + struct ctl_port *port; + int data_len, num_target_ports, id_len, g, pg, p; + int num_target_port_groups, single; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + single = ctl_is_single; + if (single) + num_target_port_groups = 1; + else + num_target_port_groups = NUM_TARGET_PORT_GROUPS; + num_target_ports = 0; + id_len = 0; + mtx_lock(&softc->ctl_lock); + STAILQ_FOREACH(port, &softc->port_list, links) { + if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) + continue; + if (ctl_map_lun_back(port->targ_port, lun->lun) >= + CTL_MAX_LUNS) + continue; + num_target_ports++; + if (port->port_devid) + id_len += port->port_devid->len; + } + mtx_unlock(&softc->ctl_lock); + + data_len = sizeof(struct scsi_vpd_scsi_ports) + num_target_port_groups * + num_target_ports * (sizeof(struct scsi_vpd_port_designation) + + sizeof(struct scsi_vpd_port_designation_cont)) + id_len; + ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); + sp = (struct scsi_vpd_scsi_ports *)ctsio->kern_data_ptr; + ctsio->kern_sg_entries = 0; + + if (data_len < alloc_len) { + ctsio->residual = alloc_len - data_len; + ctsio->kern_data_len = data_len; + ctsio->kern_total_len = data_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* + * The control device is always connected. The disk device, on the + * other hand, may not be online all the time. Need to change this + * to figure out whether the disk device is actually online or not. + */ + if (lun != NULL) + sp->device = (SID_QUAL_LU_CONNECTED << 5) | + lun->be_lun->lun_type; + else + sp->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; + + sp->page_code = SVPD_SCSI_PORTS; + scsi_ulto2b(data_len - sizeof(struct scsi_vpd_scsi_ports), + sp->page_length); + pd = &sp->design[0]; + + mtx_lock(&softc->ctl_lock); + if (softc->flags & CTL_FLAG_MASTER_SHELF) + pg = 0; + else + pg = 1; + for (g = 0; g < num_target_port_groups; g++) { + STAILQ_FOREACH(port, &softc->port_list, links) { + if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) + continue; + if (ctl_map_lun_back(port->targ_port, lun->lun) >= + CTL_MAX_LUNS) + continue; + p = port->targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS; + scsi_ulto2b(p, pd->relative_port_id); + scsi_ulto2b(0, pd->initiator_transportid_length); + pdc = (struct scsi_vpd_port_designation_cont *) + &pd->initiator_transportid[0]; + if (port->port_devid && g == pg) { + id_len = port->port_devid->len; + scsi_ulto2b(port->port_devid->len, + pdc->target_port_descriptors_length); + memcpy(pdc->target_port_descriptors, + port->port_devid->data, port->port_devid->len); + } else { + id_len = 0; + scsi_ulto2b(0, pdc->target_port_descriptors_length); + } + pd = (struct scsi_vpd_port_designation *) + ((uint8_t *)pdc->target_port_descriptors + id_len); + } + } + mtx_unlock(&softc->ctl_lock); + + ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); +} + +static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len) { struct scsi_vpd_block_limits *bl_ptr; @@ -9952,6 +10068,9 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsi case SVPD_DEVICE_ID: retval = ctl_inquiry_evpd_devid(ctsio, alloc_len); break; + case SVPD_SCSI_PORTS: + retval = ctl_inquiry_evpd_scsi_ports(ctsio, alloc_len); + break; case SVPD_BLOCK_LIMITS: retval = ctl_inquiry_evpd_block_limits(ctsio, alloc_len); break; Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Tue Jul 15 17:09:02 2014 (r268686) +++ stable/10/sys/cam/scsi/scsi_all.h Tue Jul 15 17:09:52 2014 (r268687) @@ -1564,6 +1564,31 @@ struct scsi_diag_page { uint8_t params[0]; }; +struct scsi_vpd_port_designation +{ + uint8_t reserved[2]; + uint8_t relative_port_id[2]; + uint8_t reserved2[2]; + uint8_t initiator_transportid_length[2]; + uint8_t initiator_transportid[0]; +}; + +struct scsi_vpd_port_designation_cont +{ + uint8_t reserved[2]; + uint8_t target_port_descriptors_length[2]; + struct scsi_vpd_id_descriptor target_port_descriptors[0]; +}; + +struct scsi_vpd_scsi_ports +{ + u_int8_t device; + u_int8_t page_code; +#define SVPD_SCSI_PORTS 0x88 + u_int8_t page_length[2]; + struct scsi_vpd_port_designation design[]; +}; + /* * ATA Information VPD Page based on * T10/2126-D Revision 04 @@ -1754,8 +1779,9 @@ struct scsi_target_group { uint8_t opcode; uint8_t service_action; +#define STG_PDF_MASK 0xe0 #define STG_PDF_LENGTH 0x00 -#define RPL_PDF_EXTENDED 0x20 +#define STG_PDF_EXTENDED 0x20 uint8_t reserved1[4]; uint8_t length[4]; uint8_t reserved2; @@ -1805,7 +1831,7 @@ struct scsi_target_group_data { struct scsi_target_group_data_extended { uint8_t length[4]; /* length of returned data, in bytes */ - uint8_t format_type; /* STG_PDF_LENGTH or RPL_PDF_EXTENDED */ + uint8_t format_type; /* STG_PDF_LENGTH or STG_PDF_EXTENDED */ uint8_t implicit_transition_time; uint8_t reserved[2]; struct scsi_target_port_group_descriptor groups[]; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:10:49 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9EF9D4C7; Tue, 15 Jul 2014 17:10: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 7F4AB2CE6; Tue, 15 Jul 2014 17:10: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 s6FHAnN8087555; Tue, 15 Jul 2014 17:10:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHAmoV087551; Tue, 15 Jul 2014 17:10:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151710.s6FHAmoV087551@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268688 - in stable/10: sys/cam/ctl usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:10:49 -0000 Author: mav Date: Tue Jul 15 17:10:48 2014 New Revision: 268688 URL: http://svnweb.freebsd.org/changeset/base/268688 Log: MFC r268328: Close race in r268291 between port destruction, delayed by sessions teardown, and new port creation during `service ctld restart`. Close it by returning iSCSI port internal state, that allows to identify dying ports, which should not be counted as existing, from really alive. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:09:52 2014 (r268687) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:10:48 2014 (r268688) @@ -3254,6 +3254,11 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (retval != 0) break; + if (port->port_info != NULL) { + retval = port->port_info(port->onoff_arg, sb); + if (retval != 0) + break; + } STAILQ_FOREACH(opt, &port->options, links) { retval = sbuf_printf(sb, "\t<%s>%s\n", opt->name, opt->value, opt->name); Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:09:52 2014 (r268687) +++ stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:10:48 2014 (r268688) @@ -49,6 +49,7 @@ typedef enum { typedef int (*fe_init_t)(void); typedef void (*fe_shutdown_t)(void); typedef void (*port_func_t)(void *onoff_arg); +typedef int (*port_info_func_t)(void *onoff_arg, struct sbuf *sb); typedef int (*lun_func_t)(void *arg, struct ctl_id targ_id, int lun_id); typedef uint32_t (*lun_map_func_t)(void *arg, uint32_t lun_id); typedef int (*fe_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag, @@ -214,6 +215,7 @@ struct ctl_port { int virtual_port; /* passed to CTL */ port_func_t port_online; /* passed to CTL */ port_func_t port_offline; /* passed to CTL */ + port_info_func_t port_info; /* passed to CTL */ void *onoff_arg; /* passed to CTL */ lun_func_t lun_enable; /* passed to CTL */ lun_func_t lun_disable; /* passed to CTL */ Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:09:52 2014 (r268687) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:10:48 2014 (r268688) @@ -149,6 +149,7 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO int cfiscsi_init(void); static void cfiscsi_online(void *arg); static void cfiscsi_offline(void *arg); +static int cfiscsi_info(void *arg, struct sbuf *sb); static int cfiscsi_lun_enable(void *arg, struct ctl_id target_id, int lun_id); static int cfiscsi_lun_disable(void *arg, @@ -1415,6 +1416,17 @@ cfiscsi_offline(void *arg) #endif } +static int +cfiscsi_info(void *arg, struct sbuf *sb) +{ + struct cfiscsi_target *ct = (struct cfiscsi_target *)arg; + int retval; + + retval = sbuf_printf(sb, "\t%d\n", + ct->ct_state); + return (retval); +} + static void cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) { @@ -1997,6 +2009,7 @@ cfiscsi_ioctl_port_create(struct ctl_req port->virtual_port = strtoul(tag, NULL, 0); port->port_online = cfiscsi_online; port->port_offline = cfiscsi_offline; + port->port_info = cfiscsi_info; port->onoff_arg = ct; port->lun_enable = cfiscsi_lun_enable; port->lun_disable = cfiscsi_lun_disable; Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Tue Jul 15 17:09:52 2014 (r268687) +++ stable/10/usr.sbin/ctld/kernel.c Tue Jul 15 17:10:48 2014 (r268688) @@ -120,6 +120,7 @@ struct cctl_lun { struct cctl_port { uint32_t port_id; + int cfiscsi_status; char *cfiscsi_target; uint16_t cfiscsi_portal_group_tag; STAILQ_HEAD(,cctl_lun_nv) attr_list; @@ -332,6 +333,8 @@ cctl_end_pelement(void *user_data, const if (strcmp(name, "cfiscsi_target") == 0) { cur_port->cfiscsi_target = str; str = NULL; + } else if (strcmp(name, "cfiscsi_status") == 0) { + cur_port->cfiscsi_status = strtoul(str, NULL, 0); } else if (strcmp(name, "cfiscsi_portal_group_tag") == 0) { cur_port->cfiscsi_portal_group_tag = strtoul(str, NULL, 0); } else if (strcmp(name, "targ_port") == 0) { @@ -494,6 +497,11 @@ retry_port: "ignoring", (uintmax_t)port->port_id); continue; } + if (port->cfiscsi_status != 1) { + log_debugx("CTL port %ju is not active (%d); ignoring", + (uintmax_t)port->port_id, port->cfiscsi_status); + continue; + } targ = target_find(conf, port->cfiscsi_target); if (targ == NULL) { From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:11:43 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5AA07618; Tue, 15 Jul 2014 17:11: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 46C8C2D67; Tue, 15 Jul 2014 17:11:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6FHBhf4088416; Tue, 15 Jul 2014 17:11:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHBhm9088415; Tue, 15 Jul 2014 17:11:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151711.s6FHBhm9088415@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268689 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:11:43 -0000 Author: mav Date: Tue Jul 15 17:11:42 2014 New Revision: 268689 URL: http://svnweb.freebsd.org/changeset/base/268689 Log: MFC r268330: Make gcc happy, init idlen2. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:10:48 2014 (r268688) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:11:42 2014 (r268689) @@ -4338,7 +4338,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft struct scsi_vpd_id_t10 *t10id; const char *scsiname, *vendor; int lun_number, i, lun_malloced; - int devidlen, idlen1, idlen2, len; + int devidlen, idlen1, idlen2 = 0, len; if (be_lun == NULL) return (EINVAL); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:12:38 2014 Return-Path: Delivered-To: svn-src-stable-10@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 CBC37765; Tue, 15 Jul 2014 17:12: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 B715D2D75; Tue, 15 Jul 2014 17:12: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 s6FHCcYV089052; Tue, 15 Jul 2014 17:12:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHCbnq089043; Tue, 15 Jul 2014 17:12:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151712.s6FHCbnq089043@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268690 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:12:38 -0000 Author: mav Date: Tue Jul 15 17:12:37 2014 New Revision: 268690 URL: http://svnweb.freebsd.org/changeset/base/268690 Log: MFC r268353: Implement ABORT TASK SET and I_T NEXUS RESET task management functions. Use the last one to terminate active commands on iSCSI session termination. Previous code was aborting only commands doing some data moves. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_error.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:11:42 2014 (r268689) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:12:37 2014 (r268690) @@ -409,6 +409,8 @@ static int ctl_target_reset(struct ctl_s static int ctl_lun_reset(struct ctl_lun *lun, union ctl_io *io, ctl_ua_type ua_type); static int ctl_abort_task(union ctl_io *io); +static int ctl_abort_task_set(union ctl_io *io); +static int ctl_i_t_nexus_reset(union ctl_io *io); static void ctl_run_task(union ctl_io *io); #ifdef CTL_IO_DELAY static void ctl_datamove_timer_wakeup(void *arg); @@ -7484,7 +7486,8 @@ ctl_report_supported_tmf(struct ctl_scsi ctsio->kern_rel_offset = 0; data = (struct scsi_report_supported_tmf_data *)ctsio->kern_data_ptr; - data->byte1 |= RST_ATS | RST_LURS | RST_TRS; + data->byte1 |= RST_ATS | RST_ATSS | RST_LURS | RST_TRS; + data->byte2 |= RST_ITNRS; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; @@ -11675,6 +11678,97 @@ ctl_lun_reset(struct ctl_lun *lun, union } static int +ctl_abort_tasks_lun(struct ctl_lun *lun, uint32_t targ_port, uint32_t init_id, + int other_sc) +{ + union ctl_io *xio; + int found; + + mtx_assert(&lun->lun_lock, MA_OWNED); + + /* + * Run through the OOA queue and attempt to find the given I/O. + * The target port, initiator ID, tag type and tag number have to + * match the values that we got from the initiator. If we have an + * untagged command to abort, simply abort the first untagged command + * we come to. We only allow one untagged command at a time of course. + */ + for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL; + xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) { + + if ((targ_port == xio->io_hdr.nexus.targ_port) && + (init_id == xio->io_hdr.nexus.initid.id)) { + xio->io_hdr.flags |= CTL_FLAG_ABORT; + found = 1; + if (!other_sc && !(lun->flags & CTL_LUN_PRIMARY_SC)) { + union ctl_ha_msg msg_info; + + msg_info.hdr.nexus = xio->io_hdr.nexus; + msg_info.task.task_action = CTL_TASK_ABORT_TASK; + msg_info.task.tag_num = xio->scsiio.tag_num; + msg_info.task.tag_type = xio->scsiio.tag_type; + msg_info.hdr.msg_type = CTL_MSG_MANAGE_TASKS; + msg_info.hdr.original_sc = NULL; + msg_info.hdr.serializing_sc = NULL; + ctl_ha_msg_send(CTL_HA_CHAN_CTL, + (void *)&msg_info, sizeof(msg_info), 0); + } + } + } + return (found); +} + +static int +ctl_abort_task_set(union ctl_io *io) +{ + struct ctl_softc *softc = control_softc; + struct ctl_lun *lun; + uint32_t targ_lun; + + /* + * Look up the LUN. + */ + targ_lun = io->io_hdr.nexus.targ_mapped_lun; + mtx_lock(&softc->ctl_lock); + if ((targ_lun < CTL_MAX_LUNS) && (softc->ctl_luns[targ_lun] != NULL)) + lun = softc->ctl_luns[targ_lun]; + else { + mtx_unlock(&softc->ctl_lock); + return (1); + } + + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port, + io->io_hdr.nexus.initid.id, + (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0); + mtx_unlock(&lun->lun_lock); + return (0); +} + +static int +ctl_i_t_nexus_reset(union ctl_io *io) +{ + struct ctl_softc *softc = control_softc; + struct ctl_lun *lun; + uint32_t initindex; + + initindex = ctl_get_initindex(&io->io_hdr.nexus); + mtx_lock(&softc->ctl_lock); + STAILQ_FOREACH(lun, &softc->lun_list, links) { + mtx_lock(&lun->lun_lock); + ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port, + io->io_hdr.nexus.initid.id, + (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0); + ctl_clear_mask(lun->have_ca, initindex); + lun->pending_sense[initindex].ua_pending |= CTL_UA_I_T_NEXUS_LOSS; + mtx_unlock(&lun->lun_lock); + } + mtx_unlock(&softc->ctl_lock); + return (0); +} + +static int ctl_abort_task(union ctl_io *io) { union ctl_io *xio; @@ -11873,11 +11967,15 @@ ctl_run_task(union ctl_io *io) retval = ctl_abort_task(io); break; case CTL_TASK_ABORT_TASK_SET: + retval = ctl_abort_task_set(io); break; case CTL_TASK_CLEAR_ACA: break; case CTL_TASK_CLEAR_TASK_SET: break; + case CTL_TASK_I_T_NEXUS_RESET: + retval = ctl_i_t_nexus_reset(io); + break; case CTL_TASK_LUN_RESET: { struct ctl_lun *lun; uint32_t targ_lun; Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Tue Jul 15 17:11:42 2014 (r268689) +++ stable/10/sys/cam/ctl/ctl.h Tue Jul 15 17:12:37 2014 (r268690) @@ -115,17 +115,18 @@ typedef enum { CTL_UA_POWERON = 0x0001, CTL_UA_BUS_RESET = 0x0002, CTL_UA_TARG_RESET = 0x0004, - CTL_UA_LUN_RESET = 0x0008, - CTL_UA_LUN_CHANGE = 0x0010, - CTL_UA_MODE_CHANGE = 0x0020, - CTL_UA_LOG_CHANGE = 0x0040, - CTL_UA_LVD = 0x0080, - CTL_UA_SE = 0x0100, - CTL_UA_RES_PREEMPT = 0x0200, - CTL_UA_RES_RELEASE = 0x0400, - CTL_UA_REG_PREEMPT = 0x0800, - CTL_UA_ASYM_ACC_CHANGE = 0x1000, - CTL_UA_CAPACITY_CHANGED = 0x2000 + CTL_UA_I_T_NEXUS_LOSS = 0x0008, + CTL_UA_LUN_RESET = 0x0010, + CTL_UA_LUN_CHANGE = 0x0020, + CTL_UA_MODE_CHANGE = 0x0030, + CTL_UA_LOG_CHANGE = 0x0080, + CTL_UA_LVD = 0x0100, + CTL_UA_SE = 0x0200, + CTL_UA_RES_PREEMPT = 0x0400, + CTL_UA_RES_RELEASE = 0x0800, + CTL_UA_REG_PREEMPT = 0x1000, + CTL_UA_ASYM_ACC_CHANGE = 0x2000, + CTL_UA_CAPACITY_CHANGED = 0x4000 } ctl_ua_type; #ifdef _KERNEL Modified: stable/10/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.c Tue Jul 15 17:11:42 2014 (r268689) +++ stable/10/sys/cam/ctl/ctl_error.c Tue Jul 15 17:12:37 2014 (r268690) @@ -401,6 +401,11 @@ ctl_build_ua(ctl_ua_type ua_type, struct asc = 0x29; ascq = 0x03; break; + case CTL_UA_I_T_NEXUS_LOSS: + /* 29h/07h I_T NEXUS LOSS OCCURRED */ + asc = 0x29; + ascq = 0x07; + break; case CTL_UA_LUN_RESET: /* 29h/00h POWER ON, RESET, OR BUS DEVICE RESET OCCURRED */ /* Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:11:42 2014 (r268689) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:12:37 2014 (r268690) @@ -631,6 +631,12 @@ cfiscsi_pdu_handle_task_request(struct i io->taskio.task_action = CTL_TASK_ABORT_TASK; io->taskio.tag_num = bhstmr->bhstmr_referenced_task_tag; break; + case BHSTMR_FUNCTION_ABORT_TASK_SET: +#if 0 + CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_ABORT_TASK_SET"); +#endif + io->taskio.task_action = CTL_TASK_ABORT_TASK_SET; + break; case BHSTMR_FUNCTION_LOGICAL_UNIT_RESET: #if 0 CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_LOGICAL_UNIT_RESET"); @@ -1033,64 +1039,36 @@ cfiscsi_callout(void *context) static void cfiscsi_session_terminate_tasks(struct cfiscsi_session *cs) { - struct cfiscsi_data_wait *cdw, *tmpcdw; + struct cfiscsi_data_wait *cdw; union ctl_io *io; int error, last; -#ifdef notyet io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); if (io == NULL) { CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); return; } ctl_zero_io(io); - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL; + io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = cs; io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid.id = cs->cs_ctl_initid; io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; io->io_hdr.nexus.targ_target.id = 0; - io->io_hdr.nexus.targ_lun = lun; + io->io_hdr.nexus.targ_lun = 0; io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */ - io->taskio.task_action = CTL_TASK_ABORT_TASK_SET; + io->taskio.task_action = CTL_TASK_I_T_NEXUS_RESET; + refcount_acquire(&cs->cs_outstanding_ctl_pdus); error = ctl_queue(io); if (error != CTL_RETVAL_COMPLETE) { CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d", error); + refcount_release(&cs->cs_outstanding_ctl_pdus); ctl_free_io(io); } -#else - /* - * CTL doesn't currently support CTL_TASK_ABORT_TASK_SET, so instead - * just iterate over tasks that are waiting for something - data - and - * terminate those. - */ + CFISCSI_SESSION_LOCK(cs); - TAILQ_FOREACH_SAFE(cdw, - &cs->cs_waiting_for_data_out, cdw_next, tmpcdw) { - io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); - if (io == NULL) { - CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); - return; - } - ctl_zero_io(io); - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL; - io->io_hdr.io_type = CTL_IO_TASK; - io->io_hdr.nexus.initid.id = cs->cs_ctl_initid; - io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; - io->io_hdr.nexus.targ_target.id = 0; - //io->io_hdr.nexus.targ_lun = lun; /* Not needed? */ - io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */ - io->taskio.task_action = CTL_TASK_ABORT_TASK; - io->taskio.tag_num = cdw->cdw_initiator_task_tag; - error = ctl_queue(io); - if (error != CTL_RETVAL_COMPLETE) { - CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d", error); - ctl_free_io(io); - return; - } -#if 0 - CFISCSI_SESSION_DEBUG(cs, "removing csw for initiator task tag " - "0x%x", cdw->cdw_initiator_task_tag); -#endif + while ((cdw = TAILQ_FIRST(&cs->cs_waiting_for_data_out)) != NULL) { + TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next); + CFISCSI_SESSION_UNLOCK(cs); /* * Set nonzero port status; this prevents backends from * assuming that the data transfer actually succeeded @@ -1098,11 +1076,10 @@ cfiscsi_session_terminate_tasks(struct c */ cdw->cdw_ctl_io->scsiio.io_hdr.port_status = 42; cdw->cdw_ctl_io->scsiio.be_move_done(cdw->cdw_ctl_io); - TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next); uma_zfree(cfiscsi_data_wait_zone, cdw); + CFISCSI_SESSION_LOCK(cs); } CFISCSI_SESSION_UNLOCK(cs); -#endif /* * Wait for CTL to terminate all the tasks. @@ -1114,7 +1091,7 @@ cfiscsi_session_terminate_tasks(struct c break; CFISCSI_SESSION_WARN(cs, "waiting for CTL to terminate tasks, " "%d remaining", cs->cs_outstanding_ctl_pdus); - pause("cfiscsi_terminate", 1); + pause("cfiscsi_terminate", hz / 100); } } @@ -2864,14 +2841,18 @@ cfiscsi_done(union ctl_io *io) KASSERT(((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE), ("invalid CTL status %#x", io->io_hdr.status)); - request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; - if (request == NULL) { + if (io->io_hdr.io_type == CTL_IO_TASK && + io->taskio.task_action == CTL_TASK_I_T_NEXUS_RESET) { /* * Implicit task termination has just completed; nothing to do. */ + cs = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + refcount_release(&cs->cs_outstanding_ctl_pdus); + ctl_free_io(io); return; } + request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; cs = PDU_SESSION(request); refcount_release(&cs->cs_outstanding_ctl_pdus); Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Tue Jul 15 17:11:42 2014 (r268689) +++ stable/10/sys/cam/ctl/ctl_io.h Tue Jul 15 17:12:37 2014 (r268690) @@ -364,6 +364,7 @@ typedef enum { CTL_TASK_ABORT_TASK_SET, CTL_TASK_CLEAR_ACA, CTL_TASK_CLEAR_TASK_SET, + CTL_TASK_I_T_NEXUS_RESET, CTL_TASK_LUN_RESET, CTL_TASK_TARGET_RESET, CTL_TASK_BUS_RESET, Modified: stable/10/sys/cam/ctl/ctl_util.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_util.c Tue Jul 15 17:11:42 2014 (r268689) +++ stable/10/sys/cam/ctl/ctl_util.c Tue Jul 15 17:12:37 2014 (r268690) @@ -84,6 +84,7 @@ static struct ctl_task_desc ctl_task_tab {CTL_TASK_ABORT_TASK_SET, "Abort Task Set"}, {CTL_TASK_CLEAR_ACA, "Clear ACA"}, {CTL_TASK_CLEAR_TASK_SET, "Clear Task Set"}, + {CTL_TASK_I_T_NEXUS_RESET, "I_T Nexus Reset"}, {CTL_TASK_LUN_RESET, "LUN Reset"}, {CTL_TASK_TARGET_RESET, "Target Reset"}, {CTL_TASK_BUS_RESET, "Bus Reset"}, From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:13:50 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1CFC88CB; Tue, 15 Jul 2014 17:13: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 08E812D84; Tue, 15 Jul 2014 17:13: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 s6FHDn87089304; Tue, 15 Jul 2014 17:13:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHDnG8089301; Tue, 15 Jul 2014 17:13:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151713.s6FHDnG8089301@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268691 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:13:50 -0000 Author: mav Date: Tue Jul 15 17:13:49 2014 New Revision: 268691 URL: http://svnweb.freebsd.org/changeset/base/268691 Log: MFC r268356, r268357: When new connection comes in, check whether we already have session from the same intiator (Name+ISID). If so -- terminate the old session and let the new one take its place, as required by iSCSI RFC. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:12:37 2014 (r268690) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:13:49 2014 (r268691) @@ -1091,7 +1091,8 @@ cfiscsi_session_terminate_tasks(struct c break; CFISCSI_SESSION_WARN(cs, "waiting for CTL to terminate tasks, " "%d remaining", cs->cs_outstanding_ctl_pdus); - pause("cfiscsi_terminate", hz / 100); + tsleep(__DEVOLATILE(void *, &cs->cs_outstanding_ctl_pdus), + 0, "cfiscsi_terminate", hz / 100); } } @@ -1408,7 +1409,7 @@ static void cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) { struct cfiscsi_softc *softc; - struct cfiscsi_session *cs; + struct cfiscsi_session *cs, *cs2; struct cfiscsi_target *ct; struct ctl_iscsi_handoff_params *cihp; int error; @@ -1504,12 +1505,36 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cihp->initiator_isid[2], cihp->initiator_isid[3], cihp->initiator_isid[4], cihp->initiator_isid[5]); + refcount_acquire(&cs->cs_outstanding_ctl_pdus); +restart: + if (!cs->cs_terminating) { + mtx_lock(&softc->lock); + TAILQ_FOREACH(cs2, &softc->sessions, cs_next) { + if (cs2 != cs && cs2->cs_tasks_aborted == false && + cs->cs_target == cs2->cs_target && + cs->cs_portal_group_tag == cs2->cs_portal_group_tag && + strcmp(cs->cs_initiator_id, cs2->cs_initiator_id) == 0) { + cfiscsi_session_terminate(cs2); + mtx_unlock(&softc->lock); + pause("cfiscsi_reinstate", 1); + goto restart; + } + } + mtx_unlock(&softc->lock); + } + + /* + * Register initiator with CTL. + */ + cfiscsi_session_register_initiator(cs); + #ifdef ICL_KERNEL_PROXY if (cihp->socket > 0) { #endif error = icl_conn_handoff(cs->cs_conn, cihp->socket); if (error != 0) { - cfiscsi_session_delete(cs); + cfiscsi_session_terminate(cs); + refcount_release(&cs->cs_outstanding_ctl_pdus); ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), "%s: icl_conn_handoff failed with error %d", @@ -1520,11 +1545,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * } #endif - /* - * Register initiator with CTL. - */ - cfiscsi_session_register_initiator(cs); - #ifdef ICL_KERNEL_PROXY cs->cs_login_phase = false; @@ -1539,6 +1559,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * } #endif + refcount_release(&cs->cs_outstanding_ctl_pdus); ci->status = CTL_ISCSI_OK; } @@ -2847,7 +2868,9 @@ cfiscsi_done(union ctl_io *io) * Implicit task termination has just completed; nothing to do. */ cs = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + cs->cs_tasks_aborted = true; refcount_release(&cs->cs_outstanding_ctl_pdus); + wakeup(__DEVOLATILE(void *, &cs->cs_outstanding_ctl_pdus)); ctl_free_io(io); return; } Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:12:37 2014 (r268690) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:13:49 2014 (r268691) @@ -80,6 +80,7 @@ struct cfiscsi_session { int cs_portal_group_tag; struct cv cs_maintenance_cv; bool cs_terminating; + bool cs_tasks_aborted; size_t cs_max_data_segment_length; size_t cs_max_burst_length; bool cs_immediate_data; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:14:55 2014 Return-Path: Delivered-To: svn-src-stable-10@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 81F57B01; Tue, 15 Jul 2014 17:14: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 6209F2DA3; Tue, 15 Jul 2014 17:14: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 s6FHEt7T089816; Tue, 15 Jul 2014 17:14:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHEs2e089805; Tue, 15 Jul 2014 17:14:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151714.s6FHEs2e089805@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268692 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:14:55 -0000 Author: mav Date: Tue Jul 15 17:14:53 2014 New Revision: 268692 URL: http://svnweb.freebsd.org/changeset/base/268692 Log: MFC r268362: Teach ctl_add_initiator() to dynamically allocate IIDs from pool. If port passed negative IID value, the function will try to allocate IID from the pool of unused, based on passed wwpn or name arguments. It does all its best to make IID unique and persistent across reconnects. This makes persistent reservation properly work for iSCSI. Previously, in case of reconnects, reservation could be unexpectedly lost, or even migrate between intiators. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:13:49 2014 (r268691) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:14:53 2014 (r268692) @@ -1091,11 +1091,6 @@ ctl_init(void) printf("ctl: CAM Target Layer loaded\n"); /* - * Initialize the initiator and portname mappings - */ - memset(softc->wwpn_iid, 0, sizeof(softc->wwpn_iid)); - - /* * Initialize the ioctl front end. */ ctl_frontend_register(&ioctl_frontend); @@ -1367,32 +1362,24 @@ ctl_ioctl_offline(void *arg) /* * Remove an initiator by port number and initiator ID. - * Returns 0 for success, 1 for failure. + * Returns 0 for success, -1 for failure. */ int -ctl_remove_initiator(int32_t targ_port, uint32_t iid) +ctl_remove_initiator(struct ctl_port *port, int iid) { - struct ctl_softc *softc; - - softc = control_softc; + struct ctl_softc *softc = control_softc; mtx_assert(&softc->ctl_lock, MA_NOTOWNED); - if ((targ_port < 0) - || (targ_port > CTL_MAX_PORTS)) { - printf("%s: invalid port number %d\n", __func__, targ_port); - return (1); - } if (iid > CTL_MAX_INIT_PER_PORT) { printf("%s: initiator ID %u > maximun %u!\n", __func__, iid, CTL_MAX_INIT_PER_PORT); - return (1); + return (-1); } mtx_lock(&softc->ctl_lock); - - softc->wwpn_iid[targ_port][iid].in_use = 0; - + port->wwpn_iid[iid].in_use--; + port->wwpn_iid[iid].last_use = time_uptime; mtx_unlock(&softc->ctl_lock); return (0); @@ -1400,41 +1387,91 @@ ctl_remove_initiator(int32_t targ_port, /* * Add an initiator to the initiator map. - * Returns 0 for success, 1 for failure. + * Returns iid for success, < 0 for failure. */ int -ctl_add_initiator(uint64_t wwpn, int32_t targ_port, uint32_t iid) +ctl_add_initiator(struct ctl_port *port, int iid, uint64_t wwpn, char *name) { - struct ctl_softc *softc; - int retval; - - softc = control_softc; + struct ctl_softc *softc = control_softc; + time_t best_time; + int i, best; mtx_assert(&softc->ctl_lock, MA_NOTOWNED); - retval = 0; - - if ((targ_port < 0) - || (targ_port > CTL_MAX_PORTS)) { - printf("%s: invalid port number %d\n", __func__, targ_port); - return (1); - } - if (iid > CTL_MAX_INIT_PER_PORT) { - printf("%s: WWPN %#jx initiator ID %u > maximun %u!\n", + if (iid >= CTL_MAX_INIT_PER_PORT) { + printf("%s: WWPN %#jx initiator ID %u > maximum %u!\n", __func__, wwpn, iid, CTL_MAX_INIT_PER_PORT); - return (1); + free(name, M_CTL); + return (-1); } mtx_lock(&softc->ctl_lock); - if (softc->wwpn_iid[targ_port][iid].in_use != 0) { + if (iid < 0 && (wwpn != 0 || name != NULL)) { + for (i = 0; i < CTL_MAX_INIT_PER_PORT; i++) { + if (wwpn != 0 && wwpn == port->wwpn_iid[i].wwpn) { + iid = i; + break; + } + if (name != NULL && port->wwpn_iid[i].name != NULL && + strcmp(name, port->wwpn_iid[i].name) == 0) { + iid = i; + break; + } + } + } + + if (iid < 0) { + for (i = 0; i < CTL_MAX_INIT_PER_PORT; i++) { + if (port->wwpn_iid[i].in_use == 0 && + port->wwpn_iid[i].wwpn == 0 && + port->wwpn_iid[i].name == NULL) { + iid = i; + break; + } + } + } + + if (iid < 0) { + best = -1; + best_time = INT32_MAX; + for (i = 0; i < CTL_MAX_INIT_PER_PORT; i++) { + if (port->wwpn_iid[i].in_use == 0) { + if (port->wwpn_iid[i].last_use < best_time) { + best = i; + best_time = port->wwpn_iid[i].last_use; + } + } + } + iid = best; + } + + if (iid < 0) { + mtx_unlock(&softc->ctl_lock); + free(name, M_CTL); + return (-2); + } + + if (port->wwpn_iid[iid].in_use > 0 && (wwpn != 0 || name != NULL)) { /* - * We don't treat this as an error. + * This is not an error yet. */ - if (softc->wwpn_iid[targ_port][iid].wwpn == wwpn) { - printf("%s: port %d iid %u WWPN %#jx arrived again?\n", - __func__, targ_port, iid, (uintmax_t)wwpn); - goto bailout; + if (wwpn != 0 && wwpn == port->wwpn_iid[iid].wwpn) { +#if 0 + printf("%s: port %d iid %u WWPN %#jx arrived" + " again\n", __func__, port->targ_port, + iid, (uintmax_t)wwpn); +#endif + goto take; + } + if (name != NULL && port->wwpn_iid[iid].name != NULL && + strcmp(name, port->wwpn_iid[iid].name) == 0) { +#if 0 + printf("%s: port %d iid %u name '%s' arrived" + " again\n", __func__, port->targ_port, + iid, name); +#endif + goto take; } /* @@ -1442,26 +1479,25 @@ ctl_add_initiator(uint64_t wwpn, int32_t * driver is telling us we have a new WWPN for this * initiator ID, so we pretty much need to use it. */ - printf("%s: port %d iid %u WWPN %#jx arrived, WWPN %#jx is " - "still at that address\n", __func__, targ_port, iid, - (uintmax_t)wwpn, - (uintmax_t)softc->wwpn_iid[targ_port][iid].wwpn); + printf("%s: port %d iid %u WWPN %#jx '%s' arrived," + " but WWPN %#jx '%s' is still at that address\n", + __func__, port->targ_port, iid, wwpn, name, + (uintmax_t)port->wwpn_iid[iid].wwpn, + port->wwpn_iid[iid].name); /* * XXX KDM clear have_ca and ua_pending on each LUN for * this initiator. */ } - softc->wwpn_iid[targ_port][iid].in_use = 1; - softc->wwpn_iid[targ_port][iid].iid = iid; - softc->wwpn_iid[targ_port][iid].wwpn = wwpn; - softc->wwpn_iid[targ_port][iid].port = targ_port; - -bailout: - +take: + free(port->wwpn_iid[iid].name, M_CTL); + port->wwpn_iid[iid].name = name; + port->wwpn_iid[iid].wwpn = wwpn; + port->wwpn_iid[iid].in_use++; mtx_unlock(&softc->ctl_lock); - return (retval); + return (iid); } static int @@ -2874,23 +2910,11 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_DUMP_STRUCTS: { - int i, j, k; + int i, j, k, idx; struct ctl_port *port; struct ctl_frontend *fe; - printf("CTL IID to WWPN map start:\n"); - for (i = 0; i < CTL_MAX_PORTS; i++) { - for (j = 0; j < CTL_MAX_INIT_PER_PORT; j++) { - if (softc->wwpn_iid[i][j].in_use == 0) - continue; - - printf("port %d iid %u WWPN %#jx\n", - softc->wwpn_iid[i][j].port, - softc->wwpn_iid[i][j].iid, - (uintmax_t)softc->wwpn_iid[i][j].wwpn); - } - } - printf("CTL IID to WWPN map end\n"); + mtx_lock(&softc->ctl_lock); printf("CTL Persistent Reservation information start:\n"); for (i = 0; i < CTL_MAX_LUNS; i++) { struct ctl_lun *lun; @@ -2903,33 +2927,46 @@ ctl_ioctl(struct cdev *dev, u_long cmd, for (j = 0; j < (CTL_MAX_PORTS * 2); j++) { for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){ - if (lun->per_res[j+k].registered == 0) + idx = j * CTL_MAX_INIT_PER_PORT + k; + if (lun->per_res[idx].registered == 0) continue; - printf("LUN %d port %d iid %d key " + printf(" LUN %d port %d iid %d key " "%#jx\n", i, j, k, (uintmax_t)scsi_8btou64( - lun->per_res[j+k].res_key.key)); + lun->per_res[idx].res_key.key)); } } } printf("CTL Persistent Reservation information end\n"); printf("CTL Ports:\n"); - /* - * XXX KDM calling this without a lock. We'd likely want - * to drop the lock before calling the frontend's dump - * routine anyway. - */ STAILQ_FOREACH(port, &softc->port_list, links) { - printf("Port %s Frontend %s Type %u pport %d vport %d WWNN " - "%#jx WWPN %#jx\n", port->port_name, + printf(" Port %d '%s' Frontend '%s' Type %u pp %d vp %d WWNN " + "%#jx WWPN %#jx\n", port->targ_port, port->port_name, port->frontend->name, port->port_type, port->physical_port, port->virtual_port, (uintmax_t)port->wwnn, (uintmax_t)port->wwpn); + for (j = 0; j < CTL_MAX_INIT_PER_PORT; j++) { + if (port->wwpn_iid[j].in_use == 0 && + port->wwpn_iid[j].wwpn == 0 && + port->wwpn_iid[j].name == NULL) + continue; + + printf(" iid %u use %d WWPN %#jx '%s'\n", + j, port->wwpn_iid[j].in_use, + (uintmax_t)port->wwpn_iid[j].wwpn, + port->wwpn_iid[j].name); + } } printf("CTL Port information end\n"); + mtx_unlock(&softc->ctl_lock); + /* + * XXX KDM calling this without a lock. We'd likely want + * to drop the lock before calling the frontend's dump + * routine anyway. + */ printf("CTL Frontends:\n"); STAILQ_FOREACH(fe, &softc->fe_list, links) { - printf("Frontend %s\n", fe->name); + printf(" Frontend '%s'\n", fe->name); if (fe->fe_dump != NULL) fe->fe_dump(); } Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Tue Jul 15 17:13:49 2014 (r268691) +++ stable/10/sys/cam/ctl/ctl_frontend.c Tue Jul 15 17:14:53 2014 (r268692) @@ -158,6 +158,17 @@ ctl_port_register(struct ctl_port *port, mtx_unlock(&control_softc->ctl_lock); /* + * Initialize the initiator and portname mappings + */ + port->max_initiators = CTL_MAX_INIT_PER_PORT; + port->wwpn_iid = malloc(sizeof(*port->wwpn_iid) * port->max_initiators, + M_CTL, M_NOWAIT | M_ZERO); + if (port->wwpn_iid == NULL) { + retval = ENOMEM; + goto error; + } + + /* * We add 20 to whatever the caller requests, so he doesn't get * burned by queueing things back to the pending sense queue. In * theory, there should probably only be one outstanding item, at @@ -168,6 +179,8 @@ ctl_port_register(struct ctl_port *port, retval = ctl_pool_create(control_softc, CTL_POOL_FETD, port->num_requested_ctl_io + 20, &pool); if (retval != 0) { + free(port->wwpn_iid, M_CTL); +error: port->targ_port = -1; mtx_lock(&control_softc->ctl_lock); ctl_clear_mask(&control_softc->ctl_port_mask, port_num); @@ -181,7 +194,6 @@ ctl_port_register(struct ctl_port *port, mtx_lock(&control_softc->ctl_lock); port->targ_port = port_num + (master_shelf != 0 ? 0 : CTL_MAX_PORTS); - port->max_initiators = CTL_MAX_INIT_PER_PORT; STAILQ_INSERT_TAIL(&port->frontend->port_list, port, fe_links); STAILQ_INSERT_TAIL(&control_softc->port_list, port, links); control_softc->ctl_ports[port_num] = port; @@ -194,8 +206,7 @@ int ctl_port_deregister(struct ctl_port *port) { struct ctl_io_pool *pool; - int port_num; - int retval; + int port_num, retval, i; retval = 0; @@ -223,6 +234,9 @@ ctl_port_deregister(struct ctl_port *por port->port_devid = NULL; free(port->target_devid, M_CTL); port->target_devid = NULL; + for (i = 0; i < port->max_initiators; i++) + free(port->wwpn_iid[i].name, M_CTL); + free(port->wwpn_iid, M_CTL); bailout: return (retval); Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:13:49 2014 (r268691) +++ stable/10/sys/cam/ctl/ctl_frontend.h Tue Jul 15 17:14:53 2014 (r268692) @@ -80,6 +80,13 @@ typedef int (*fe_ioctl_t)(struct cdev *d MODULE_DEPEND(name, ctl, 1, 1, 1); \ MODULE_DEPEND(name, cam, 1, 1, 1) +struct ctl_wwpn_iid { + int in_use; + time_t last_use; + uint64_t wwpn; + char *name; +}; + /* * The ctl_frontend structure is the registration mechanism between a FETD * (Front End Target Driver) and the CTL layer. Here is a description of @@ -228,6 +235,7 @@ struct ctl_port { int32_t targ_port; /* passed back to FETD */ void *ctl_pool_ref; /* passed back to FETD */ uint32_t max_initiators; /* passed back to FETD */ + struct ctl_wwpn_iid *wwpn_iid; /* used by CTL */ uint64_t wwnn; /* set by CTL before online */ uint64_t wwpn; /* set by CTL before online */ ctl_port_status status; /* used by CTL */ @@ -269,13 +277,13 @@ struct ctl_frontend * ctl_frontend_find( * This may block until resources are allocated. Called at FETD module load * time. Returns 0 for success, non-zero for failure. */ -int ctl_port_register(struct ctl_port *fe, int master_SC); +int ctl_port_register(struct ctl_port *port, int master_SC); /* * Called at FETD module unload time. * Returns 0 for success, non-zero for failure. */ -int ctl_port_deregister(struct ctl_port *fe); +int ctl_port_deregister(struct ctl_port *port); /* * Called to set the WWNN and WWPN for a particular frontend. @@ -312,21 +320,18 @@ int ctl_queue(union ctl_io *io); int ctl_queue_sense(union ctl_io *io); /* - * This routine adds an initiator to CTL's port database. The WWPN should - * be the FC WWPN, if available. The targ_port field should be the same as - * the targ_port passed back from CTL in the ctl_frontend structure above. + * This routine adds an initiator to CTL's port database. * The iid field should be the same as the iid passed in the nexus of each * ctl_io from this initiator. + * The WWPN should be the FC WWPN, if available. */ -int ctl_add_initiator(uint64_t wwpn, int32_t targ_port, uint32_t iid); +int ctl_add_initiator(struct ctl_port *port, int iid, uint64_t wwpn, char *name); /* - * This routine will remove an initiator from CTL's port database. The - * targ_port field should be the same as the targ_port passed back in the - * ctl_frontend structure above. The iid field should be the same as the - * iid passed in the nexus of each ctl_io from this initiator. + * This routine will remove an initiator from CTL's port database. + * The iid field should be the same as the iid passed in the nexus of each + * ctl_io from this initiator. */ -int -ctl_remove_initiator(int32_t targ_port, uint32_t iid); +int ctl_remove_initiator(struct ctl_port *port, int iid); #endif /* _CTL_FRONTEND_H_ */ Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:13:49 2014 (r268691) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:14:53 2014 (r268692) @@ -1150,41 +1150,25 @@ cfiscsi_session_terminate(struct cfiscsi static int cfiscsi_session_register_initiator(struct cfiscsi_session *cs) { - int error, i; - struct cfiscsi_softc *softc; + struct cfiscsi_target *ct; + char *name; + int i; KASSERT(cs->cs_ctl_initid == -1, ("already registered")); - softc = &cfiscsi_softc; - - mtx_lock(&softc->lock); - for (i = 0; i < softc->max_initiators; i++) { - if (softc->ctl_initids[i] == 0) - break; - } - if (i == softc->max_initiators) { - CFISCSI_SESSION_WARN(cs, "too many concurrent sessions (%d)", - softc->max_initiators); - mtx_unlock(&softc->lock); + ct = cs->cs_target; + name = strdup(cs->cs_initiator_id, M_CTL); + i = ctl_add_initiator(&ct->ct_port, -1, 0, name); + if (i < 0) { + CFISCSI_SESSION_WARN(cs, "ctl_add_initiator failed with error %d", + i); + cs->cs_ctl_initid = -1; return (1); } - softc->ctl_initids[i] = 1; - mtx_unlock(&softc->lock); - + cs->cs_ctl_initid = i; #if 0 - CFISCSI_SESSION_DEBUG(cs, "adding initiator id %d, max %d", - i, softc->max_initiators); + CFISCSI_SESSION_DEBUG(cs, "added initiator id %d", i); #endif - cs->cs_ctl_initid = i; - error = ctl_add_initiator(0x0, cs->cs_target->ct_port.targ_port, cs->cs_ctl_initid); - if (error != 0) { - CFISCSI_SESSION_WARN(cs, "ctl_add_initiator failed with error %d", error); - mtx_lock(&softc->lock); - softc->ctl_initids[cs->cs_ctl_initid] = 0; - mtx_unlock(&softc->lock); - cs->cs_ctl_initid = -1; - return (1); - } return (0); } @@ -1193,21 +1177,15 @@ static void cfiscsi_session_unregister_initiator(struct cfiscsi_session *cs) { int error; - struct cfiscsi_softc *softc; if (cs->cs_ctl_initid == -1) return; - softc = &cfiscsi_softc; - - error = ctl_remove_initiator(cs->cs_target->ct_port.targ_port, cs->cs_ctl_initid); + error = ctl_remove_initiator(&cs->cs_target->ct_port, cs->cs_ctl_initid); if (error != 0) { CFISCSI_SESSION_WARN(cs, "ctl_remove_initiator failed with error %d", error); } - mtx_lock(&softc->lock); - softc->ctl_initids[cs->cs_ctl_initid] = 0; - mtx_unlock(&softc->lock); cs->cs_ctl_initid = -1; } @@ -1304,8 +1282,6 @@ cfiscsi_init(void) TAILQ_INIT(&softc->sessions); TAILQ_INIT(&softc->targets); - softc->max_initiators = CTL_MAX_INIT_PER_PORT; - cfiscsi_data_wait_zone = uma_zcreate("cfiscsi_data_wait", sizeof(struct cfiscsi_data_wait), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:13:49 2014 (r268691) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:14:53 2014 (r268692) @@ -112,8 +112,6 @@ struct cfiscsi_softc { unsigned int last_session_id; TAILQ_HEAD(, cfiscsi_target) targets; TAILQ_HEAD(, cfiscsi_session) sessions; - char ctl_initids[CTL_MAX_INIT_PER_PORT]; - int max_initiators; #ifdef ICL_KERNEL_PROXY struct icl_listen *listener; struct cv accept_cv; Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Tue Jul 15 17:13:49 2014 (r268691) +++ stable/10/sys/cam/ctl/ctl_private.h Tue Jul 15 17:14:53 2014 (r268692) @@ -414,13 +414,6 @@ typedef enum { CTL_FLAG_MASTER_SHELF = 0x04 } ctl_gen_flags; -struct ctl_wwpn_iid { - int in_use; - uint64_t wwpn; - uint32_t iid; - int32_t port; -}; - #define CTL_MAX_THREADS 16 struct ctl_thread { @@ -453,7 +446,6 @@ struct ctl_softc { int targ_online; uint32_t ctl_lun_mask[CTL_MAX_LUNS >> 5]; struct ctl_lun *ctl_luns[CTL_MAX_LUNS]; - struct ctl_wwpn_iid wwpn_iid[CTL_MAX_PORTS][CTL_MAX_INIT_PER_PORT]; uint32_t ctl_port_mask; uint64_t aps_locked_lun; STAILQ_HEAD(, ctl_lun) lun_list; Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Tue Jul 15 17:13:49 2014 (r268691) +++ stable/10/sys/cam/ctl/scsi_ctl.c Tue Jul 15 17:14:53 2014 (r268692) @@ -484,14 +484,14 @@ ctlfeasync(void *callback_arg, uint32_t break; } if (dev_chg->arrived != 0) { - retval = ctl_add_initiator(dev_chg->wwpn, - softc->port.targ_port, dev_chg->target); + retval = ctl_add_initiator(&softc->port, + dev_chg->target, dev_chg->wwpn, NULL); } else { - retval = ctl_remove_initiator( - softc->port.targ_port, dev_chg->target); + retval = ctl_remove_initiator(&softc->port, + dev_chg->target); } - if (retval != 0) { + if (retval < 0) { printf("%s: could not %s port %d iid %u " "WWPN %#jx!\n", __func__, (dev_chg->arrived != 0) ? "add" : From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:16:08 2014 Return-Path: Delivered-To: svn-src-stable-10@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 46D4CE1C; Tue, 15 Jul 2014 17:16:08 +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 289A92DC4; Tue, 15 Jul 2014 17:16:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6FHG8Cv090185; Tue, 15 Jul 2014 17:16:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHG7mU090176; Tue, 15 Jul 2014 17:16:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151716.s6FHG7mU090176@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268694 - in stable/10: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:16:08 -0000 Author: mav Date: Tue Jul 15 17:16:06 2014 New Revision: 268694 URL: http://svnweb.freebsd.org/changeset/base/268694 Log: MFC r268363: Add support for READ FULL STATUS action of PERSISTENT RESERVE IN command. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/scsi_ctl.c stable/10/usr.sbin/ctladm/ctladm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:16:06 2014 (r268693) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:16:06 2014 (r268694) @@ -1501,6 +1501,61 @@ take: } static int +ctl_create_iid(struct ctl_port *port, int iid, uint8_t *buf) +{ + int len; + + switch (port->port_type) { + case CTL_PORT_FC: + { + struct scsi_transportid_fcp *id = + (struct scsi_transportid_fcp *)buf; + if (port->wwpn_iid[iid].wwpn == 0) + return (0); + memset(id, 0, sizeof(*id)); + id->format_protocol = SCSI_PROTO_FC; + scsi_u64to8b(port->wwpn_iid[iid].wwpn, id->n_port_name); + return (sizeof(*id)); + } + case CTL_PORT_ISCSI: + { + struct scsi_transportid_iscsi_port *id = + (struct scsi_transportid_iscsi_port *)buf; + if (port->wwpn_iid[iid].name == NULL) + return (0); + memset(id, 0, 256); + id->format_protocol = SCSI_TRN_ISCSI_FORMAT_PORT | + SCSI_PROTO_ISCSI; + len = strlcpy(id->iscsi_name, port->wwpn_iid[iid].name, 252) + 1; + len = roundup2(min(len, 252), 4); + scsi_ulto2b(len, id->additional_length); + return (sizeof(*id) + len); + } + case CTL_PORT_SAS: + { + struct scsi_transportid_sas *id = + (struct scsi_transportid_sas *)buf; + if (port->wwpn_iid[iid].wwpn == 0) + return (0); + memset(id, 0, sizeof(*id)); + id->format_protocol = SCSI_PROTO_SAS; + scsi_u64to8b(port->wwpn_iid[iid].wwpn, id->sas_address); + return (sizeof(*id)); + } + default: + { + struct scsi_transportid_spi *id = + (struct scsi_transportid_spi *)buf; + memset(id, 0, sizeof(*id)); + id->format_protocol = SCSI_PROTO_SPI; + scsi_ulto2b(iid, id->scsi_addr); + scsi_ulto2b(port->targ_port, id->rel_trgt_port_id); + return (sizeof(*id)); + } + } +} + +static int ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id) { return (0); @@ -7621,6 +7676,11 @@ retry: case SPRI_RC: /* report capabilities */ total_len = sizeof(struct scsi_per_res_cap); break; + case SPRI_RS: /* read full status */ + total_len = sizeof(struct scsi_per_res_in_header) + + (sizeof(struct scsi_per_res_in_full_desc) + 256) * + lun->pr_key_count; + break; default: panic("Invalid PR type %x", cdb->action); } @@ -7777,7 +7837,62 @@ retry: scsi_ulto2b(type_mask, res_cap->type_mask); break; } - case SPRI_RS: //read full status + case SPRI_RS: { // read full status + struct scsi_per_res_in_full *res_status; + struct scsi_per_res_in_full_desc *res_desc; + struct ctl_port *port; + int i, len; + + res_status = (struct scsi_per_res_in_full*)ctsio->kern_data_ptr; + + /* + * We had to drop the lock to allocate our buffer, which + * leaves time for someone to come in with another + * persistent reservation. (That is unlikely, though, + * since this should be the only persistent reservation + * command active right now.) + */ + if (total_len < (sizeof(struct scsi_per_res_in_header) + + (sizeof(struct scsi_per_res_in_full_desc) + 256) * + lun->pr_key_count)){ + mtx_unlock(&lun->lun_lock); + free(ctsio->kern_data_ptr, M_CTL); + printf("%s: reservation length changed, retrying\n", + __func__); + goto retry; + } + + scsi_ulto4b(lun->PRGeneration, res_status->header.generation); + + res_desc = &res_status->desc[0]; + for (i = 0; i < 2*CTL_MAX_INITIATORS; i++) { + if (!lun->per_res[i].registered) + continue; + + memcpy(&res_desc->res_key, &lun->per_res[i].res_key.key, + sizeof(res_desc->res_key)); + if ((lun->flags & CTL_LUN_PR_RESERVED) && + (lun->pr_res_idx == i || + lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS)) { + res_desc->flags = SPRI_FULL_R_HOLDER; + res_desc->scopetype = lun->res_type; + } + scsi_ulto2b(i / CTL_MAX_INIT_PER_PORT, + res_desc->rel_trgt_port_id); + len = 0; + port = softc->ctl_ports[i / CTL_MAX_INIT_PER_PORT]; + if (port != NULL) + len = ctl_create_iid(port, + i % CTL_MAX_INIT_PER_PORT, + res_desc->transport_id); + scsi_ulto4b(len, res_desc->additional_length); + res_desc = (struct scsi_per_res_in_full_desc *) + &res_desc->transport_id[len]; + } + scsi_ulto4b((uint8_t *)res_desc - (uint8_t *)&res_status->desc[0], + res_status->header.length); + break; + } default: /* * This is a bug, because we just checked for this above, Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Tue Jul 15 17:16:06 2014 (r268693) +++ stable/10/sys/cam/ctl/ctl.h Tue Jul 15 17:16:06 2014 (r268694) @@ -53,6 +53,7 @@ typedef enum { CTL_PORT_IOCTL = 0x04, CTL_PORT_INTERNAL = 0x08, CTL_PORT_ISCSI = 0x10, + CTL_PORT_SAS = 0x20, CTL_PORT_ALL = 0xff, CTL_PORT_ISC = 0x100 // FC port for inter-shelf communication } ctl_port_type; Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Tue Jul 15 17:16:06 2014 (r268693) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Tue Jul 15 17:16:06 2014 (r268694) @@ -99,7 +99,15 @@ const struct ctl_cmd_entry ctl_cmd_table 10, { 0x02, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}}, /* 03 READ FULL STATUS */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_persistent_reserve_in, CTL_SERIDX_INQ, CTL_CMD_FLAG_ALLOW_ON_RESV | + CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_SECONDARY | + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_LUN_PAT_NONE, + 10, { 0x03, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}}, /* 04-1f */ }; Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Tue Jul 15 17:16:06 2014 (r268693) +++ stable/10/sys/cam/ctl/scsi_ctl.c Tue Jul 15 17:16:06 2014 (r268694) @@ -372,6 +372,8 @@ ctlfeasync(void *callback_arg, uint32_t */ if (cpi->transport == XPORT_FC) port->port_type = CTL_PORT_FC; + else if (cpi->transport == XPORT_SAS) + port->port_type = CTL_PORT_SAS; else port->port_type = CTL_PORT_SCSI; Modified: stable/10/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.c Tue Jul 15 17:16:06 2014 (r268693) +++ stable/10/usr.sbin/ctladm/ctladm.c Tue Jul 15 17:16:06 2014 (r268694) @@ -500,6 +500,9 @@ retry: case CTL_PORT_ISCSI: type = "ISCSI"; break; + case CTL_PORT_SAS: + type = "SAS"; + break; default: type = "UNKNOWN"; break; @@ -590,6 +593,7 @@ static struct ctladm_opts cctl_fe_table[ {"scsi", CTL_PORT_SCSI, CTLADM_ARG_NONE, NULL}, {"internal", CTL_PORT_INTERNAL, CTLADM_ARG_NONE, NULL}, {"iscsi", CTL_PORT_ISCSI, CTLADM_ARG_NONE, NULL}, + {"sas", CTL_PORT_SAS, CTLADM_ARG_NONE, NULL}, {"all", CTL_PORT_ALL, CTLADM_ARG_NONE, NULL}, {NULL, 0, 0, NULL} }; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:16:58 2014 Return-Path: Delivered-To: svn-src-stable-10@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 98E0D14A; Tue, 15 Jul 2014 17:16:58 +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 84FC22DE6; Tue, 15 Jul 2014 17:16:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6FHGwmQ090574; Tue, 15 Jul 2014 17:16:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHGwLK090573; Tue, 15 Jul 2014 17:16:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151716.s6FHGwLK090573@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268695 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:16:58 -0000 Author: mav Date: Tue Jul 15 17:16:58 2014 New Revision: 268695 URL: http://svnweb.freebsd.org/changeset/base/268695 Log: MFC r268364: Fix "use after free" on port creation error in r268291. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:16:06 2014 (r268694) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:16:58 2014 (r268695) @@ -1949,26 +1949,26 @@ cfiscsi_ioctl_port_create(struct ctl_req alias = ctl_get_opt(&opts, "cfiscsi_target_alias"); tag = ctl_get_opt(&opts, "cfiscsi_portal_group_tag"); if (target == NULL || tag == NULL) { - ctl_free_opts(&opts); req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), "Missing required argument"); + ctl_free_opts(&opts); return; } ct = cfiscsi_target_find_or_create(&cfiscsi_softc, target, alias); if (ct == NULL) { - ctl_free_opts(&opts); req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), "failed to create target \"%s\"", target); + ctl_free_opts(&opts); return; } if (ct->ct_state == CFISCSI_TARGET_STATE_ACTIVE) { - cfiscsi_target_release(ct); - ctl_free_opts(&opts); req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), "target \"%s\" already exist", target); + cfiscsi_target_release(ct); + ctl_free_opts(&opts); return; } port = &ct->ct_port; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:17:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 84702291; Tue, 15 Jul 2014 17:17: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 58B5A2DF6; Tue, 15 Jul 2014 17:17: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 s6FHHrxH090819; Tue, 15 Jul 2014 17:17:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHHrqn090818; Tue, 15 Jul 2014 17:17:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151717.s6FHHrqn090818@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268696 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:17:53 -0000 Author: mav Date: Tue Jul 15 17:17:52 2014 New Revision: 268696 URL: http://svnweb.freebsd.org/changeset/base/268696 Log: MFC r268387: Fix task management functions status: task not found is not an error, while not implemented function is. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:16:58 2014 (r268695) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:17:52 2014 (r268696) @@ -11946,7 +11946,7 @@ ctl_abort_task(union ctl_io *io) lun = ctl_softc->ctl_luns[targ_lun]; else { mtx_unlock(&ctl_softc->ctl_lock); - goto bailout; + return (1); } #if 0 @@ -12049,8 +12049,6 @@ ctl_abort_task(union ctl_io *io) } mtx_unlock(&lun->lun_lock); -bailout: - if (found == 0) { /* * This isn't really an error. It's entirely possible for @@ -12066,23 +12064,19 @@ bailout: io->io_hdr.nexus.targ_lun, io->taskio.tag_num, io->taskio.tag_type); #endif - return (1); - } else - return (0); + } + return (0); } static void ctl_run_task(union ctl_io *io) { - struct ctl_softc *ctl_softc; - int retval; + struct ctl_softc *ctl_softc = control_softc; + int retval = 1; const char *task_desc; CTL_DEBUG_PRINT(("ctl_run_task\n")); - ctl_softc = control_softc; - retval = 0; - KASSERT(io->io_hdr.io_type == CTL_IO_TASK, ("ctl_run_task: Unextected io_type %d\n", io->io_hdr.io_type)); @@ -12131,7 +12125,6 @@ ctl_run_task(union ctl_io *io) case CTL_TASK_LUN_RESET: { struct ctl_lun *lun; uint32_t targ_lun; - int retval; targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&ctl_softc->ctl_lock); @@ -12188,12 +12181,6 @@ ctl_run_task(union ctl_io *io) io->io_hdr.status = CTL_SUCCESS; else io->io_hdr.status = CTL_ERROR; - - /* - * This will queue this I/O to the done queue, but the - * work thread won't be able to process it until we - * return and the lock is released. - */ ctl_done(io); } From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:18:52 2014 Return-Path: Delivered-To: svn-src-stable-10@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 5B2E64CA; Tue, 15 Jul 2014 17: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 46E602E0D; Tue, 15 Jul 2014 17: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 s6FHIqbX091200; Tue, 15 Jul 2014 17:18:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHIoAG091193; Tue, 15 Jul 2014 17:18:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151718.s6FHIoAG091193@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268697 - in stable/10/sys/cam: ctl scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:18:52 -0000 Author: mav Date: Tue Jul 15 17:18:50 2014 New Revision: 268697 URL: http://svnweb.freebsd.org/changeset/base/268697 Log: MFC r268418: Enable TAS feature: notify initiator if its command was aborted by other. That should make operation more kind to multi-initiator environment. Without this, other initiators may find out that something bad happened to their commands only via command timeout. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_error.c stable/10/sys/cam/ctl/ctl_error.h stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/scsi_ctl.c stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:17:52 2014 (r268696) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:18:50 2014 (r268697) @@ -282,8 +282,10 @@ static struct scsi_control_page control_ /*rlec*/0, /*queue_flags*/0, /*eca_and_aen*/0, - /*reserved*/0, - /*aen_holdoff_period*/{0, 0} + /*flags4*/SCP_TAS, + /*aen_holdoff_period*/{0, 0}, + /*busy_timeout_period*/{0, 0}, + /*extended_selftest_completion_time*/{0, 0} }; static struct scsi_control_page control_page_changeable = { @@ -292,8 +294,10 @@ static struct scsi_control_page control_ /*rlec*/SCP_DSENSE, /*queue_flags*/0, /*eca_and_aen*/0, - /*reserved*/0, - /*aen_holdoff_period*/{0, 0} + /*flags4*/0, + /*aen_holdoff_period*/{0, 0}, + /*busy_timeout_period*/{0, 0}, + /*extended_selftest_completion_time*/{0, 0} }; @@ -7578,7 +7582,7 @@ ctl_report_supported_tmf(struct ctl_scsi ctsio->kern_rel_offset = 0; data = (struct scsi_report_supported_tmf_data *)ctsio->kern_data_ptr; - data->byte1 |= RST_ATS | RST_ATSS | RST_LURS | RST_TRS; + data->byte1 |= RST_ATS | RST_ATSS | RST_CTSS | RST_LURS | RST_TRS; data->byte2 |= RST_ITNRS; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -11795,7 +11799,7 @@ ctl_lun_reset(struct ctl_lun *lun, union #endif for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL; xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) { - xio->io_hdr.flags |= CTL_FLAG_ABORT; + xio->io_hdr.flags |= CTL_FLAG_ABORT | CTL_FLAG_ABORT_STATUS; } /* @@ -11848,8 +11852,13 @@ ctl_abort_tasks_lun(struct ctl_lun *lun, for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL; xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) { - if ((targ_port == xio->io_hdr.nexus.targ_port) && - (init_id == xio->io_hdr.nexus.initid.id)) { + if ((targ_port == UINT32_MAX || + targ_port == xio->io_hdr.nexus.targ_port) && + (init_id == UINT32_MAX || + init_id == xio->io_hdr.nexus.initid.id)) { + if (targ_port != xio->io_hdr.nexus.targ_port || + init_id != xio->io_hdr.nexus.initid.id) + xio->io_hdr.flags |= CTL_FLAG_ABORT_STATUS; xio->io_hdr.flags |= CTL_FLAG_ABORT; found = 1; if (!other_sc && !(lun->flags & CTL_LUN_PRIMARY_SC)) { @@ -11891,9 +11900,14 @@ ctl_abort_task_set(union ctl_io *io) mtx_lock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); - ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port, - io->io_hdr.nexus.initid.id, - (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0); + if (io->taskio.task_action == CTL_TASK_ABORT_TASK_SET) { + ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port, + io->io_hdr.nexus.initid.id, + (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0); + } else { /* CTL_TASK_CLEAR_TASK_SET */ + ctl_abort_tasks_lun(lun, UINT32_MAX, UINT32_MAX, + (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0); + } mtx_unlock(&lun->lun_lock); return (0); } @@ -12113,12 +12127,11 @@ ctl_run_task(union ctl_io *io) retval = ctl_abort_task(io); break; case CTL_TASK_ABORT_TASK_SET: + case CTL_TASK_CLEAR_TASK_SET: retval = ctl_abort_task_set(io); break; case CTL_TASK_CLEAR_ACA: break; - case CTL_TASK_CLEAR_TASK_SET: - break; case CTL_TASK_I_T_NEXUS_RESET: retval = ctl_i_t_nexus_reset(io); break; @@ -13476,7 +13489,7 @@ ctl_process_done(union ctl_io *io) * whatever it needs to do to clean up its state. */ if (io->io_hdr.flags & CTL_FLAG_ABORT) - io->io_hdr.status = CTL_CMD_ABORTED; + ctl_set_task_aborted(&io->scsiio); /* * We print out status for every task management command. For SCSI Modified: stable/10/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.c Tue Jul 15 17:17:52 2014 (r268696) +++ stable/10/sys/cam/ctl/ctl_error.c Tue Jul 15 17:18:50 2014 (r268697) @@ -795,6 +795,18 @@ ctl_set_busy(struct ctl_scsiio *ctsio) } void +ctl_set_task_aborted(struct ctl_scsiio *ctsio) +{ + struct scsi_sense_data *sense; + + sense = &ctsio->sense_data; + memset(sense, 0, sizeof(*sense)); + ctsio->scsi_status = SCSI_STATUS_TASK_ABORTED; + ctsio->sense_len = 0; + ctsio->io_hdr.status = CTL_CMD_ABORTED; +} + +void ctl_set_success(struct ctl_scsiio *ctsio) { struct scsi_sense_data *sense; Modified: stable/10/sys/cam/ctl/ctl_error.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.h Tue Jul 15 17:17:52 2014 (r268696) +++ stable/10/sys/cam/ctl/ctl_error.h Tue Jul 15 17:18:50 2014 (r268697) @@ -80,6 +80,7 @@ void ctl_set_data_phase_error(struct ctl void ctl_set_reservation_conflict(struct ctl_scsiio *ctsio); void ctl_set_queue_full(struct ctl_scsiio *ctsio); void ctl_set_busy(struct ctl_scsiio *ctsio); +void ctl_set_task_aborted(struct ctl_scsiio *ctsio); void ctl_set_success(struct ctl_scsiio *ctsio); #endif /* _CTL_ERROR_H_ */ Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:17:52 2014 (r268696) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:18:50 2014 (r268697) @@ -2706,7 +2706,8 @@ cfiscsi_scsi_command_done(union ctl_io * * Do not return status for aborted commands. * There are exceptions, but none supported by CTL yet. */ - if (io->io_hdr.status == CTL_CMD_ABORTED) { + if (io->io_hdr.status == CTL_CMD_ABORTED && + (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { ctl_free_io(io); icl_pdu_free(request); return; Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Tue Jul 15 17:17:52 2014 (r268696) +++ stable/10/sys/cam/ctl/ctl_io.h Tue Jul 15 17:18:50 2014 (r268697) @@ -96,6 +96,7 @@ typedef enum { CTL_FLAG_CONTROL_DEV = 0x00000080, /* processor device */ CTL_FLAG_ALLOCATED = 0x00000100, /* data space allocated */ CTL_FLAG_BLOCKED = 0x00000200, /* on the blocked queue */ + CTL_FLAG_ABORT_STATUS = 0x00000400, /* return TASK ABORTED status */ CTL_FLAG_ABORT = 0x00000800, /* this I/O should be aborted */ CTL_FLAG_DMA_INPROG = 0x00001000, /* DMA in progress */ CTL_FLAG_NO_DATASYNC = 0x00002000, /* don't cache flush data */ Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Tue Jul 15 17:17:52 2014 (r268696) +++ stable/10/sys/cam/ctl/scsi_ctl.c Tue Jul 15 17:18:50 2014 (r268697) @@ -805,7 +805,8 @@ ctlfestart(struct cam_periph *periph, un scsi_status = SCSI_STATUS_BUSY; csio->sense_len = 0; } else if ((io->io_hdr.status & CTL_STATUS_MASK) == - CTL_CMD_ABORTED) { + CTL_CMD_ABORTED && + (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED; /* Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Tue Jul 15 17:17:52 2014 (r268696) +++ stable/10/sys/cam/scsi/scsi_all.h Tue Jul 15 17:18:50 2014 (r268697) @@ -475,15 +475,24 @@ struct scsi_control_page { #define SCP_QUEUE_ALG_MASK 0xF0 #define SCP_QUEUE_ALG_RESTRICTED 0x00 #define SCP_QUEUE_ALG_UNRESTRICTED 0x10 +#define SCP_NUAR 0x08 /*No UA on release*/ #define SCP_QUEUE_ERR 0x02 /*Queued I/O aborted for CACs*/ #define SCP_QUEUE_DQUE 0x01 /*Queued I/O disabled*/ u_int8_t eca_and_aen; #define SCP_EECA 0x80 /*Enable Extended CA*/ +#define SCP_RAC 0x40 /*Report a check*/ +#define SCP_SWP 0x08 /*Software Write Protect*/ #define SCP_RAENP 0x04 /*Ready AEN Permission*/ #define SCP_UAAENP 0x02 /*UA AEN Permission*/ #define SCP_EAENP 0x01 /*Error AEN Permission*/ - u_int8_t reserved; + u_int8_t flags4; +#define SCP_ATO 0x80 /*Application tag owner*/ +#define SCP_TAS 0x40 /*Task aborted status*/ +#define SCP_ATMPE 0x20 /*Application tag mode page*/ +#define SCP_RWWP 0x10 /*Reject write without prot*/ u_int8_t aen_holdoff_period[2]; + u_int8_t busy_timeout_period[2]; + u_int8_t extended_selftest_completion_time[2]; }; struct scsi_cache_page { From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:19:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 84C7563A; Tue, 15 Jul 2014 17: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 70F762E1C; Tue, 15 Jul 2014 17: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 s6FHJiAr091373; Tue, 15 Jul 2014 17:19:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHJiDq091372; Tue, 15 Jul 2014 17:19:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151719.s6FHJiDq091372@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268698 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:19:44 -0000 Author: mav Date: Tue Jul 15 17:19:43 2014 New Revision: 268698 URL: http://svnweb.freebsd.org/changeset/base/268698 Log: MFC r268421: Remove status setting from datamove() path. Leave that to other places. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:18:50 2014 (r268697) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:19:43 2014 (r268698) @@ -12508,7 +12508,6 @@ ctl_datamove(union ctl_io *io) io->io_hdr.nexus.targ_port, (uintmax_t)io->io_hdr.nexus.targ_target.id, io->io_hdr.nexus.targ_lun); - io->io_hdr.status = CTL_CMD_ABORTED; io->io_hdr.port_status = 31337; /* * Note that the backend, in this case, will get the @@ -13264,24 +13263,18 @@ ctl_datamove_remote(union ctl_io *io) /* * Note that we look for an aborted I/O here, but don't do some of - * the other checks that ctl_datamove() normally does. We don't - * need to run the task queue, because this I/O is on the ISC - * queue, which is executed by the work thread after the task queue. + * the other checks that ctl_datamove() normally does. * We don't need to run the datamove delay code, since that should * have been done if need be on the other controller. */ if (io->io_hdr.flags & CTL_FLAG_ABORT) { - printf("%s: tag 0x%04x on (%d:%d:%d:%d) aborted\n", __func__, io->scsiio.tag_num, io->io_hdr.nexus.initid.id, io->io_hdr.nexus.targ_port, io->io_hdr.nexus.targ_target.id, io->io_hdr.nexus.targ_lun); - io->io_hdr.status = CTL_CMD_ABORTED; io->io_hdr.port_status = 31338; - ctl_send_datamove_done(io, /*have_lock*/ 0); - return; } From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:20:41 2014 Return-Path: Delivered-To: svn-src-stable-10@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 A93D1784; Tue, 15 Jul 2014 17:20: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 8A8482E2C; Tue, 15 Jul 2014 17:20: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 s6FHKfxg091648; Tue, 15 Jul 2014 17:20:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHKffo091646; Tue, 15 Jul 2014 17:20:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151720.s6FHKffo091646@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268699 - in stable/10: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:20:41 -0000 Author: mav Date: Tue Jul 15 17:20:40 2014 New Revision: 268699 URL: http://svnweb.freebsd.org/changeset/base/268699 Log: MFC r268447: Add LUN options to specify 64-bit EUI and NAA identifiers. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:19:43 2014 (r268698) +++ stable/10/sys/cam/ctl/ctl.c Tue Jul 15 17:20:40 2014 (r268699) @@ -4434,7 +4434,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft struct ctl_port *port; struct scsi_vpd_id_descriptor *desc; struct scsi_vpd_id_t10 *t10id; - const char *scsiname, *vendor; + const char *eui, *naa, *scsiname, *vendor; int lun_number, i, lun_malloced; int devidlen, idlen1, idlen2 = 0, len; @@ -4478,6 +4478,14 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft idlen2 = roundup2(strlen(scsiname) + 1, 4); len += sizeof(struct scsi_vpd_id_descriptor) + idlen2; } + eui = ctl_get_opt(&be_lun->options, "eui"); + if (eui != NULL) { + len += sizeof(struct scsi_vpd_id_descriptor) + 8; + } + naa = ctl_get_opt(&be_lun->options, "naa"); + if (naa != NULL) { + len += sizeof(struct scsi_vpd_id_descriptor) + 8; + } lun->lun_devid = malloc(sizeof(struct ctl_devid) + len, M_CTL, M_WAITOK | M_ZERO); lun->lun_devid->len = len; @@ -4504,6 +4512,24 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft desc->length = idlen2; strlcpy(desc->identifier, scsiname, idlen2); } + if (eui != NULL) { + desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + + desc->length); + desc->proto_codeset = SVPD_ID_CODESET_BINARY; + desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | + SVPD_ID_TYPE_EUI64; + desc->length = 8; + scsi_u64to8b(strtouq(eui, NULL, 0), desc->identifier); + } + if (naa != NULL) { + desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + + desc->length); + desc->proto_codeset = SVPD_ID_CODESET_BINARY; + desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | + SVPD_ID_TYPE_NAA; + desc->length = 8; + scsi_u64to8b(strtouq(naa, NULL, 0), desc->identifier); + } mtx_lock(&ctl_softc->ctl_lock); /* Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Tue Jul 15 17:19:43 2014 (r268698) +++ stable/10/usr.sbin/ctladm/ctladm.8 Tue Jul 15 17:20:40 2014 (r268699) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd June 15, 2014 +.Dd July 9, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -947,6 +947,10 @@ Specifies LUN product string up to 16 ch Specifies LUN revision string up to 4 chars. .It Va scsiname Specifies LUN SCSI name string. +.It Va eui +Specifies LUN EUI-64 identified. +.It Va naa +Specifies LUN NAA identifier. .It Va unmap Set to "on", enables UNMAP support for the LUN. .El From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 17:26:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 95404A75; Tue, 15 Jul 2014 17:26: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 7F3BF2F0F; Tue, 15 Jul 2014 17:26: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 s6FHQigV095857; Tue, 15 Jul 2014 17:26:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHQhv8095844; Tue, 15 Jul 2014 17:26:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151726.s6FHQhv8095844@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 17:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268700 - in stable/10: sbin/camcontrol sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:26:44 -0000 Author: mav Date: Tue Jul 15 17:26:43 2014 New Revision: 268700 URL: http://svnweb.freebsd.org/changeset/base/268700 Log: MFC r268240 (by ken): Add persistent reservation support to camcontrol(8). camcontrol(8) now supports a new 'persist' subcommand that allows users to issue SCSI PERSISTENT RESERVE IN / OUT commands. Added: stable/10/sbin/camcontrol/persist.c - copied unchanged from r268240, head/sbin/camcontrol/persist.c Modified: stable/10/sbin/camcontrol/Makefile stable/10/sbin/camcontrol/camcontrol.8 stable/10/sbin/camcontrol/camcontrol.c stable/10/sbin/camcontrol/camcontrol.h stable/10/sys/cam/scsi/scsi_all.c stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/Makefile ============================================================================== --- stable/10/sbin/camcontrol/Makefile Tue Jul 15 17:20:40 2014 (r268699) +++ stable/10/sbin/camcontrol/Makefile Tue Jul 15 17:26:43 2014 (r268700) @@ -3,7 +3,7 @@ PROG= camcontrol SRCS= camcontrol.c util.c .if !defined(RELEASE_CRUNCH) -SRCS+= fwdownload.c modeedit.c progress.c +SRCS+= fwdownload.c modeedit.c persist.c progress.c .else CFLAGS+= -DMINIMALISTIC .endif Modified: stable/10/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.8 Tue Jul 15 17:20:40 2014 (r268699) +++ stable/10/sbin/camcontrol/camcontrol.8 Tue Jul 15 17:26:43 2014 (r268700) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 6, 2013 +.Dd November 20, 2013 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -269,6 +269,21 @@ .Op Fl U Ar pwd .Op Fl y .Nm +.Ic persist +.Op device id +.Op generic args +.Aq Fl i Ar action | Fl o Ar action +.Op Fl a +.Op Fl I Ar trans_id +.Op Fl k Ar key +.Op Fl K Ar sa_key +.Op Fl p +.Op Fl R Ar rel_tgt_port +.Op Fl s Ar scope +.Op Fl S +.Op Fl T Ar res_type +.Op Fl U +.Nm .Ic help .Sh DESCRIPTION The @@ -1473,6 +1488,276 @@ to output a line for every firmware segm fwdownload command -- the same as the ones shown in simulation mode. .El +.It Ic persist +Persistent reservation support. +Persistent reservations are a way to reserve a particular +.Tn SCSI +LUN for use by one or more +.Tn SCSI +initiators. +If the +.Fl i +option is specified, +.Nm +will issue the +.Tn SCSI +PERSISTENT RESERVE IN +command using the requested service action. +If the +.Fl o +option is specified, +.Nm +will issue the +.Tn SCSI +PERSISTENT RESERVE OUT +command using the requested service action. +One of those two options is required. +.Pp +Persistent reservations are complex, and fully explaining them is outside +the scope of this manual. +Please visit +http://www.t10.org +and download the latest SPC spec for a full explanation of persistent +reservations. +.Bl -tag -width 8n +.It Fl i Ar mode +Specify the service action for the PERSISTENT RESERVE IN command. +Supported service actions: +.Bl -tag -width 19n +.It read_keys +Report the current persistent reservation generation (PRgeneration) and any +registered keys. +.It read_reservation +Report the persistent reservation, if any. +.It report_capabilities +Report the persistent reservation capabilities of the LUN. +.It read_full_status +Report the full status of persistent reservations on the LUN. +.El +.It Fl o Ar mode +Specify the service action for the PERSISTENT RESERVE OUT command. +For service actions like register that are components of other service +action names, the entire name must be specified. +Otherwise, enough of the service action name must be specified to +distinguish it from other possible service actions. +Supported service actions: +.Bl -tag -width 15n +.It register +Register a reservation key with the LUN or unregister a reservation key. +To register a key, specify the requested key as the Service Action +Reservation Key. +To unregister a key, specify the previously registered key as the +Reservation Key. +To change a key, specify the old key as the Reservation Key and the new +key as the Service Action Reservation Key. +.It register_ignore +This is similar to the register subcommand, except that the Reservation Key +is ignored. +The Service Action Reservation Key will overwrite any previous key +registered for the initiator. +.It reserve +Create a reservation. +A key must be registered with the LUN before the LUN can be reserved, and +it must be specified as the Reservation Key. +The type of reservation must also be specified. +The scope defaults to LUN scope (LU_SCOPE), but may be changed. +.It release +Release a reservation. +The Reservation Key must be specified. +.It clear +Release a reservation and remove all keys from the device. +The Reservation Key must be specified. +.It preempt +Remove a reservation belonging to another initiator. +The Reservation Key must be specified. +The Service Action Reservation Key may be specified, depending on the +operation being performed. +.It preempt_abort +Remove a reservation belonging to another initiator and abort all +outstanding commands from that initiator. +The Reservation Key must be specified. +The Service Action Reservation Key may be specified, depending on the +operation being performed. +.It register_move +Register another initiator with the LUN, and establish a reservation on the +LUN for that initiator. +The Reservation Key and Service Action Reservation Key must be specified. +.It replace_lost +Replace Lost Reservation information. +.El +.It Fl a +Set the All Target Ports (ALL_TG_PT) bit. +This requests that the key registration be applied to all target ports and +not just the particular target port that receives the command. +This only applies to the register and register_ignore actions. +.It Fl I Ar tid +Specify a Transport ID. +This only applies to the Register and Register and Move service actions for +Persistent Reserve Out. +Multiple Transport IDs may be specified with multiple +.Fl I +arguments. +With the Register service action, specifying one or more Transport IDs +implicitly enables the +.Fl S +option which turns on the SPEC_I_PT bit. +Transport IDs generally have the format protocol,id. +.Bl -tag -width 5n +.It SAS +A SAS Transport ID consists of +.Dq sas, +followed by a 64-bit SAS address. +For example: +.Pp +.Dl sas,0x1234567812345678 +.It FC +A Fibre Channel Transport ID consists of +.Dq fcp, +followed by a 64-bit Fibre Channel World Wide Name. +For example: +.Pp +.Dl fcp,0x1234567812345678 +.It SPI +A Parallel SCSI address consists of +.Dq spi, +followed by a SCSI target ID and a relative target port identifier. +For example: +.Pp +.Dl spi,4,1 +.It 1394 +An IEEE 1394 (Firewire) Transport ID consists of +.Dq sbp, +followed by a 64-bit EUI-64 IEEE 1394 node unique identifier. +For example: +.Pp +.Dl sbp,0x1234567812345678 +.It RDMA +A SCSI over RDMA Transport ID consists of +.Dq srp, +followed by a 128-bit RDMA initiator port identifier. +The port identifier must be exactly 32 or 34 (if the leading 0x is +included) hexadecimal digits. +Only hexadecimal (base 16) numbers are supported. +For example: +.Pp +.Dl srp,0x12345678123456781234567812345678 +.It iSCSI +An iSCSI Transport ID consists an iSCSI name and optionally a separator and +iSCSI session ID. +For example, if only the iSCSI name is specified: +.Pp +.Dl iqn.2012-06.com.example:target0 +.Pp +If the iSCSI separator and initiator session ID are specified: +.Pp +.Dl iqn.2012-06.com.example:target0,i,0x123 +.It PCIe +A SCSI over PCIe Transport ID consists of +.Dq sop, +followed by a PCIe Routing ID. +The Routing ID consists of a bus, device and function or in the alternate +form, a bus and function. +The bus must be in the range of 0 to 255 inclusive and the device must be +in the range of 0 to 31 inclusive. +The function must be in the range of 0 to 7 inclusive if the standard form +is used, and in the range of 0 to 255 inclusive if the alternate form is +used. +For example, if a bus, device and function are specified for the standard +Routing ID form: +.Pp +.Dl sop,4,5,1 +.Pp +If the alternate Routing ID form is used: +.Pp +.Dl sop,4,1 +.El +.It Fl k Ar key +Specify the Reservation Key. +This may be in decimal, octal or hexadecimal format. +The value is zero by default if not otherwise specified. +The value must be between 0 and 2^64 - 1, inclusive. +.It Fl K Ar key +Specify the Service Action Reservation Key. +This may be in decimal, octal or hexadecimal format. +The value is zero by default if not otherwise specified. +The value must be between 0 and 2^64 - 1, inclusive. +.It Fl p +Enable the Activate Persist Through Power Loss bit. +This is only used for the register and register_ignore actions. +This requests that the reservation persist across power loss events. +.It Fl s Ar scope +Specify the scope of the reservation. +The scope may be specified by name or by number. +The scope is ignored for register, register_ignore and clear. +If the desired scope isn't available by name, you may specify the number. +.Bl -tag -width 7n +.It lun +LUN scope (0x00). +This encompasses the entire LUN. +.It extent +Extent scope (0x01). +.It element +Element scope (0x02). +.El +.It Fl R Ar rtp +Specify the Relative Target Port. +This only applies to the Register and Move service action of the Persistent +Reserve Out command. +.It Fl S +Enable the SPEC_I_PT bit. +This only applies to the Register service action of Persistent Reserve Out. +You must also specify at least one Transport ID with +.Fl I +if this option is set. +If you specify a Transport ID, this option is automatically set. +It is an error to specify this option for any service action other than +Register. +.It Fl T Ar type +Specify the reservation type. +The reservation type may be specified by name or by number. +If the desired reservation type isn't available by name, you may specify +the number. +Supported reservation type names: +.Bl -tag -width 11n +.It read_shared +Read Shared mode. +.It wr_ex +Write Exclusive mode. +May also be specified as +.Dq write_exclusive . +.It rd_ex +Read Exclusive mode. +May also be specified as +.Dq read_exclusive . +.It ex_ac +Exclusive access mode. +May also be specified as +.Dq exclusive_access . +.It wr_ex_ro +Write Exclusive Registrants Only mode. +May also be specified as +.Dq write_exclusive_reg_only . +.It ex_ac_ro +Exclusive Access Registrants Only mode. +May also be specified as +.Dq exclusive_access_reg_only . +.It wr_ex_ar +Write Exclusive All Registrants mode. +May also be specified as +.Dq write_exclusive_all_regs . +.It ex_ac_ar +Exclusive Access All Registrants mode. +May also be specified as +.Dq exclusive_access_all_regs . +.El +.It Fl U +Specify that the target should unregister the initiator that sent +the Register and Move request. +By default, the target will not unregister the initiator that sends the +Register and Move request. +This option only applies to the Register and Move service action of the +Persistent Reserve Out command. +.El .It Ic help Print out verbose usage information. .El @@ -1639,6 +1924,66 @@ power-on or hardware reset! .Pp .Em DO NOT use this on a device which has an active filesystem! +.Pp +.Bd -literal -offset indent +camcontrol persist da0 -v -i read_keys +.Ed +.Pp +This will read any persistent reservation keys registered with da0, and +display any errors encountered when sending the PERSISTENT RESERVE IN +.Tn SCSI +command. +.Bd -literal -offset indent +camcontrol persist da0 -v -o register -a -K 0x12345678 +.Ed +.Pp +This will register the persistent reservation key 0x12345678 with da0, +apply that registration to all ports on da0, and display any errors that +occur when sending the PERSISTENT RESERVE OUT command. +.Bd -literal -offset indent +camcontrol persist da0 -v -o reserve -s lun -k 0x12345678 -T ex_ac +.Ed +.Pp +This will reserve da0 for the exlusive use of the initiator issuing the +command. +The scope of the reservation is the entire LUN. +Any errors sending the PERSISTENT RESERVE OUT command will be displayed. +.Bd -literal -offset indent +camcontrol persist da0 -v -i read_full +.Ed +.Pp +This will display the full status of all reservations on da0 and print out +status if there are any errors. +.Bd -literal -offset indent +camcontrol persist da0 -v -o release -k 0x12345678 -T ex_ac +.Ed +.Pp +This will release a reservation on da0 of the type ex_ac +(Exclusive Access). +The Reservation Key for this registration is 0x12345678. +Any errors that occur will be displayed. +.Bd -literal -offset indent +camcontrol persist da0 -v -o register -K 0x12345678 -S \e + -I sas,0x1234567812345678 -I sas,0x8765432187654321 +.Ed +.Pp +This will register the key 0x12345678 with da0, specifying that it applies +to the SAS initiators with SAS addresses 0x1234567812345678 and +0x8765432187654321. +.Bd -literal -offset indent +camcontrol persist da0 -v -o register_move -k 0x87654321 \e + -K 0x12345678 -U -p -R 2 -I fcp,0x1234567812345678 +.Ed +.Pp +This will move the registration from the current initiator, whose +Registration Key is 0x87654321, to the Fibre Channel initiator with the +Fiber Channel World Wide Node Name 0x1234567812345678. +A new registration key, 0x12345678, will be registered for the initiator +with the Fibre Channel World Wide Node Name 0x1234567812345678, and the +current initiator will be unregistered from the target. +The reservation will be moved to relative target port 2 on the target +device. +The registration will persist across power losses. .Sh SEE ALSO .Xr cam 3 , .Xr cam_cdbparse 3 , Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Tue Jul 15 17:20:40 2014 (r268699) +++ stable/10/sbin/camcontrol/camcontrol.c Tue Jul 15 17:26:43 2014 (r268700) @@ -96,6 +96,7 @@ typedef enum { CAM_CMD_SECURITY = 0x0000001d, CAM_CMD_HPA = 0x0000001e, CAM_CMD_SANITIZE = 0x0000001f, + CAM_CMD_PERSIST = 0x00000020 } cam_cmdmask; typedef enum { @@ -218,6 +219,7 @@ static struct camcontrol_opts option_tab {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:ys"}, {"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"}, {"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"}, + {"persist", CAM_CMD_PERSIST, CAM_ARG_NONE, "ai:I:k:K:o:ps:ST:U"}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -225,12 +227,6 @@ static struct camcontrol_opts option_tab {NULL, 0, 0, NULL} }; -typedef enum { - CC_OR_NOT_FOUND, - CC_OR_AMBIGUOUS, - CC_OR_FOUND -} camcontrol_optret; - struct cam_devitem { struct device_match_result dev_match; int num_periphs; @@ -7826,6 +7822,9 @@ usage(int printlong) " [-U ] [-y]\n" " camcontrol hpa [dev_id][generic args] [-f] [-l] [-P] [-p pwd]\n" " [-q] [-s max_sectors] [-U pwd] [-y]\n" +" camcontrol persist [dev_id][generic args] <-i action|-o action>\n" +" [-a][-I tid][-k key][-K sa_key][-p][-R rtp]\n" +" [-s scope][-S][-T type][-U]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); if (!printlong) @@ -7862,8 +7861,9 @@ usage(int printlong) "idle send the ATA IDLE command to the named device\n" "standby send the ATA STANDBY command to the named device\n" "sleep send the ATA SLEEP command to the named device\n" -"fwdownload program firmware of the named device with the given image" +"fwdownload program firmware of the named device with the given image\n" "security report or send ATA security commands to the named device\n" +"persist send the SCSI PERSISTENT RESERVE IN or OUT commands\n" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -7998,6 +7998,22 @@ usage(int printlong) " device\n" "-U pwd unlock the HPA configuration of the device\n" "-y don't ask any questions\n" +"persist arguments:\n" +"-i action specify read_keys, read_reservation, report_cap, or\n" +" read_full_status\n" +"-o action specify register, register_ignore, reserve, release,\n" +" clear, preempt, preempt_abort, register_move, replace_lost\n" +"-a set the All Target Ports (ALL_TG_PT) bit\n" +"-I tid specify a Transport ID, e.g.: sas,0x1234567812345678\n" +"-k key specify the Reservation Key\n" +"-K sa_key specify the Service Action Reservation Key\n" +"-p set the Activate Persist Through Power Loss bit\n" +"-R rtp specify the Relative Target Port\n" +"-s scope specify the scope: lun, extent, element or a number\n" +"-S specify Transport ID for register, requires -I\n" +"-T res_type specify the reservation type: read_shared, wr_ex, rd_ex,\n" +" ex_ac, wr_ex_ro, ex_ac_ro, wr_ex_ar, ex_ac_ar\n" +"-U unregister the current initiator for register_move\n" ); #endif /* MINIMALISTIC */ } @@ -8332,6 +8348,11 @@ main(int argc, char **argv) error = scsisanitize(cam_dev, argc, argv, combinedopt, retry_count, timeout); break; + case CAM_CMD_PERSIST: + error = scsipersist(cam_dev, argc, argv, combinedopt, + retry_count, timeout, arglist & CAM_ARG_VERBOSE, + arglist & CAM_ARG_ERR_RECOVER); + break; #endif /* MINIMALISTIC */ case CAM_CMD_USAGE: usage(1); Modified: stable/10/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.h Tue Jul 15 17:20:40 2014 (r268699) +++ stable/10/sbin/camcontrol/camcontrol.h Tue Jul 15 17:26:43 2014 (r268700) @@ -30,6 +30,13 @@ #ifndef _CAMCONTROL_H #define _CAMCONTROL_H + +typedef enum { + CC_OR_NOT_FOUND, + CC_OR_AMBIGUOUS, + CC_OR_FOUND +} camcontrol_optret; + /* * get_hook: Structure for evaluating args in a callback. */ @@ -56,6 +63,9 @@ void mode_list(struct cam_device *device int retry_count, int timeout); int scsidoinquiry(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); +int scsipersist(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout, int verbose, + int err_recover); char *cget(void *hook, char *name); int iget(void *hook, char *name); void arg_put(void *hook, int letter, void *arg, int count, char *name); Copied: stable/10/sbin/camcontrol/persist.c (from r268240, head/sbin/camcontrol/persist.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sbin/camcontrol/persist.c Tue Jul 15 17:26:43 2014 (r268700, copy of r268240, head/sbin/camcontrol/persist.c) @@ -0,0 +1,966 @@ +/*- + * Copyright (c) 2013 Spectra Logic Corporation + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * Authors: Ken Merry (Spectra Logic Corporation) + */ +/* + * SCSI Persistent Reservation support for camcontrol(8). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include "camcontrol.h" + +struct persist_transport_id { + struct scsi_transportid_header *hdr; + unsigned int alloc_len; + STAILQ_ENTRY(persist_transport_id) links; +}; + +/* + * Service Actions for PERSISTENT RESERVE IN. + */ +static struct scsi_nv persist_in_actions[] = { + { "read_keys", SPRI_RK }, + { "read_reservation", SPRI_RR }, + { "report_capabilities", SPRI_RC }, + { "read_full_status", SPRI_RS } +}; + +/* + * Service Actions for PERSISTENT RESERVE OUT. + */ +static struct scsi_nv persist_out_actions[] = { + { "register", SPRO_REGISTER }, + { "reserve", SPRO_RESERVE }, + { "release" , SPRO_RELEASE }, + { "clear", SPRO_CLEAR }, + { "preempt", SPRO_PREEMPT }, + { "preempt_abort", SPRO_PRE_ABO }, + { "register_ignore", SPRO_REG_IGNO }, + { "register_move", SPRO_REG_MOVE }, + { "replace_lost", SPRO_REPL_LOST_RES } +}; + +/* + * Known reservation scopes. As of SPC-4, only LU_SCOPE is used in the + * spec. The others are obsolete. + */ +static struct scsi_nv persist_scope_table[] = { + { "lun", SPR_LU_SCOPE }, + { "extent", SPR_EXTENT_SCOPE }, + { "element", SPR_ELEMENT_SCOPE } +}; + +/* + * Reservation types. The longer name for a given reservation type is + * listed first, so that it makes more sense when we print out the + * reservation type. We step through the table linearly when looking for + * the text name for a particular numeric reservation type value. + */ +static struct scsi_nv persist_type_table[] = { + { "read_shared", SPR_TYPE_RD_SHARED }, + { "write_exclusive", SPR_TYPE_WR_EX }, + { "wr_ex", SPR_TYPE_WR_EX }, + { "read_exclusive", SPR_TYPE_RD_EX }, + { "rd_ex", SPR_TYPE_RD_EX }, + { "exclusive_access", SPR_TYPE_EX_AC }, + { "ex_ac", SPR_TYPE_EX_AC }, + { "write_exclusive_reg_only", SPR_TYPE_WR_EX_RO }, + { "wr_ex_ro", SPR_TYPE_WR_EX_RO }, + { "exclusive_access_reg_only", SPR_TYPE_EX_AC_RO }, + { "ex_ac_ro", SPR_TYPE_EX_AC_RO }, + { "write_exclusive_all_regs", SPR_TYPE_WR_EX_AR }, + { "wr_ex_ar", SPR_TYPE_WR_EX_AR }, + { "exclusive_access_all_regs", SPR_TYPE_EX_AC_AR }, + { "ex_ac_ar", SPR_TYPE_EX_AC_AR } +}; + +/* + * Print out the standard scope/type field. + */ +static void +persist_print_scopetype(uint8_t scopetype) +{ + const char *tmpstr; + int num_entries; + + num_entries = sizeof(persist_scope_table) / + sizeof(persist_scope_table[0]); + tmpstr = scsi_nv_to_str(persist_scope_table, num_entries, + scopetype & SPR_SCOPE_MASK); + fprintf(stdout, "Scope: %s (%#x)\n", (tmpstr != NULL) ? tmpstr : + "Unknown", (scopetype & SPR_SCOPE_MASK) >> SPR_SCOPE_SHIFT); + + num_entries = sizeof(persist_type_table) / + sizeof(persist_type_table[0]); + tmpstr = scsi_nv_to_str(persist_type_table, num_entries, + scopetype & SPR_TYPE_MASK); + fprintf(stdout, "Type: %s (%#x)\n", (tmpstr != NULL) ? tmpstr : + "Unknown", scopetype & SPR_TYPE_MASK); +} + +static void +persist_print_transportid(uint8_t *buf, uint32_t len) +{ + struct sbuf *sb; + + sb = sbuf_new_auto(); + if (sb == NULL) + fprintf(stderr, "Unable to allocate sbuf\n"); + + scsi_transportid_sbuf(sb, (struct scsi_transportid_header *)buf, len); + + sbuf_finish(sb); + + fprintf(stdout, "%s\n", sbuf_data(sb)); + + sbuf_delete(sb); +} + +/* + * Print out a persistent reservation. This is used with the READ + * RESERVATION (0x01) service action of the PERSISTENT RESERVE IN command. + */ +static void +persist_print_res(struct scsi_per_res_in_header *hdr, uint32_t valid_len) +{ + uint32_t length; + struct scsi_per_res_in_rsrv *res; + + length = scsi_4btoul(hdr->length); + length = MIN(length, valid_len); + + res = (struct scsi_per_res_in_rsrv *)hdr; + + if (length < sizeof(res->data) - sizeof(res->data.extent_length)) { + if (length == 0) + fprintf(stdout, "No reservations.\n"); + else + warnx("unable to print reservation, only got %u " + "valid bytes", length); + return; + } + fprintf(stdout, "PRgeneration: %#x\n", + scsi_4btoul(res->header.generation)); + fprintf(stdout, "Reservation Key: %#jx\n", + (uintmax_t)scsi_8btou64(res->data.reservation)); + fprintf(stdout, "Scope address: %#x\n", + scsi_4btoul(res->data.scope_addr)); + + persist_print_scopetype(res->data.scopetype); + + fprintf(stdout, "Extent length: %u\n", + scsi_2btoul(res->data.extent_length)); +} + +/* + * Print out persistent reservation keys. This is used with the READ KEYS + * service action of the PERSISTENT RESERVE IN command. + */ +static void +persist_print_keys(struct scsi_per_res_in_header *hdr, uint32_t valid_len) +{ + uint32_t length, num_keys, i; + struct scsi_per_res_key *key; + + length = scsi_4btoul(hdr->length); + length = MIN(length, valid_len); + + num_keys = length / sizeof(*key); + + fprintf(stdout, "PRgeneration: %#x\n", scsi_4btoul(hdr->generation)); + fprintf(stdout, "%u key%s%s\n", num_keys, (num_keys == 1) ? "" : "s", + (num_keys == 0) ? "." : ":"); + + for (i = 0, key = (struct scsi_per_res_key *)&hdr[1]; i < num_keys; + i++, key++) { + fprintf(stdout, "%u: %#jx\n", i, + (uintmax_t)scsi_8btou64(key->key)); + } +} + +/* + * Print out persistent reservation capabilities. This is used with the + * REPORT CAPABILITIES service action of the PERSISTENT RESERVE IN command. + */ +static void +persist_print_cap(struct scsi_per_res_cap *cap, uint32_t valid_len) +{ + uint32_t length; + int check_type_mask = 0; + + length = scsi_2btoul(cap->length); + length = MIN(length, valid_len); + + if (length < __offsetof(struct scsi_per_res_cap, type_mask)) { + fprintf(stdout, "Insufficient data (%u bytes) to report " + "full capabilities\n", length); + return; + } + if (length >= __offsetof(struct scsi_per_res_cap, reserved)) + check_type_mask = 1; + + fprintf(stdout, "Replace Lost Reservation Capable (RLR_C): %d\n", + (cap->flags1 & SPRI_RLR_C) ? 1 : 0); + fprintf(stdout, "Compatible Reservation Handling (CRH): %d\n", + (cap->flags1 & SPRI_CRH) ? 1 : 0); + fprintf(stdout, "Specify Initiator Ports Capable (SIP_C): %d\n", + (cap->flags1 & SPRI_SIP_C) ? 1 : 0); + fprintf(stdout, "All Target Ports Capable (ATP_C): %d\n", + (cap->flags1 & SPRI_ATP_C) ? 1 : 0); + fprintf(stdout, "Persist Through Power Loss Capable (PTPL_C): %d\n", + (cap->flags1 & SPRI_PTPL_C) ? 1 : 0); + fprintf(stdout, "ALLOW COMMANDS field: (%#x)\n", + (cap->flags2 & SPRI_ALLOW_CMD_MASK) >> SPRI_ALLOW_CMD_SHIFT); + /* + * These cases are cut-and-pasted from SPC4r36l. There is no + * succinct way to describe these otherwise, and even with the + * verbose description, the user will probably have to refer to + * the spec to fully understand what is going on. + */ + switch (cap->flags2 & SPRI_ALLOW_CMD_MASK) { + case SPRI_ALLOW_1: + fprintf(stdout, +" The device server allows the TEST UNIT READY command through Write\n" +" Exclusive type reservations and Exclusive Access type reservations\n" +" and does not provide information about whether the following commands\n" +" are allowed through Write Exclusive type reservations:\n" +" a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n" +" command, RECEIVE COPY RESULTS command, RECEIVE DIAGNOSTIC\n" +" RESULTS command, REPORT SUPPORTED OPERATION CODES command,\n" +" and REPORT SUPPORTED TASK MANAGEMENT FUNCTION command; and\n" +" b) the READ DEFECT DATA command (see SBC-3).\n"); + break; + case SPRI_ALLOW_2: + fprintf(stdout, +" The device server allows the TEST UNIT READY command through Write\n" +" Exclusive type reservations and Exclusive Access type reservations\n" +" and does not allow the following commands through Write Exclusive type\n" +" reservations:\n" +" a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n" +" command, RECEIVE DIAGNOSTIC RESULTS command, REPORT SUPPORTED\n" +" OPERATION CODES command, and REPORT SUPPORTED TASK MANAGEMENT\n" +" FUNCTION command; and\n" +" b) the READ DEFECT DATA command.\n" +" The device server does not allow the RECEIVE COPY RESULTS command\n" +" through Write Exclusive type reservations or Exclusive Access type\n" +" reservations.\n"); + break; + case SPRI_ALLOW_3: + fprintf(stdout, +" The device server allows the TEST UNIT READY command through Write\n" +" Exclusive type reservations and Exclusive Access type reservations\n" +" and allows the following commands through Write Exclusive type\n" +" reservations:\n" +" a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n" +" command, RECEIVE DIAGNOSTIC RESULTS command, REPORT SUPPORTED\n" +" OPERATION CODES command, and REPORT SUPPORTED TASK MANAGEMENT\n" +" FUNCTION command; and\n" +" b) the READ DEFECT DATA command.\n" +" The device server does not allow the RECEIVE COPY RESULTS command\n" +" through Write Exclusive type reservations or Exclusive Access type\n" +" reservations.\n"); + break; + case SPRI_ALLOW_4: + fprintf(stdout, +" The device server allows the TEST UNIT READY command and the RECEIVE\n" +" COPY RESULTS command through Write Exclusive type reservations and\n" +" Exclusive Access type reservations and allows the following commands\n" +" through Write Exclusive type reservations:\n" +" a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n" +" command, RECEIVE DIAGNOSTIC RESULTS command, REPORT SUPPORTED\n" +" OPERATION CODES command, and REPORT SUPPORTED TASK MANAGEMENT\n" +" FUNCTION command; and\n" +" b) the READ DEFECT DATA command.\n"); + break; + case SPRI_ALLOW_NA: + fprintf(stdout, +" No information is provided about whether certain commands are allowed\n" +" through certain types of persistent reservations.\n"); + break; + default: + fprintf(stdout, +" Unknown ALLOW COMMANDS value %#x\n", + (cap->flags2 & SPRI_ALLOW_CMD_MASK) >> + SPRI_ALLOW_CMD_SHIFT); + break; + } + fprintf(stdout, "Persist Through Power Loss Activated (PTPL_A): %d\n", + (cap->flags2 & SPRI_PTPL_A) ? 1 : 0); + if ((check_type_mask != 0) + && (cap->flags2 & SPRI_TMV)) { + fprintf(stdout, "Supported Persistent Reservation Types:\n"); + fprintf(stdout, " Write Exclusive - All Registrants " + "(WR_EX_AR): %d\n", + (cap->type_mask[0] & SPRI_TM_WR_EX_AR)? 1 : 0); + fprintf(stdout, " Exclusive Access - Registrants Only " + "(EX_AC_RO): %d\n", + (cap->type_mask[0] & SPRI_TM_EX_AC_RO) ? 1 : 0); + fprintf(stdout, " Write Exclusive - Registrants Only " + "(WR_EX_RO): %d\n", + (cap->type_mask[0] & SPRI_TM_WR_EX_RO)? 1 : 0); + fprintf(stdout, " Exclusive Access (EX_AC): %d\n", + (cap->type_mask[0] & SPRI_TM_EX_AC) ? 1 : 0); + fprintf(stdout, " Write Exclusive (WR_EX): %d\n", + (cap->type_mask[0] & SPRI_TM_WR_EX) ? 1 : 0); + fprintf(stdout, " Exclusive Access - All Registrants " + "(EX_AC_AR): %d\n", + (cap->type_mask[1] & SPRI_TM_EX_AC_AR) ? 1 : 0); + } else { + fprintf(stdout, "Persistent Reservation Type Mask is NOT " + "valid\n"); + } + + +} + +static void +persist_print_full(struct scsi_per_res_in_header *hdr, uint32_t valid_len) +{ + uint32_t length, len_to_go = 0; + struct scsi_per_res_in_full_desc *desc; + uint8_t *cur_pos; + int i; + + length = scsi_4btoul(hdr->length); + length = MIN(length, valid_len); + + if (length < sizeof(*desc)) { + if (length == 0) + fprintf(stdout, "No reservations.\n"); + else + warnx("unable to print reservation, only got %u " + "valid bytes", length); + return; + } + + fprintf(stdout, "PRgeneration: %#x\n", scsi_4btoul(hdr->generation)); + cur_pos = (uint8_t *)&hdr[1]; + for (len_to_go = length, i = 0, + desc = (struct scsi_per_res_in_full_desc *)cur_pos; + len_to_go >= sizeof(*desc); + desc = (struct scsi_per_res_in_full_desc *)cur_pos, i++) { + uint32_t additional_length, cur_length; + + + fprintf(stdout, "Reservation Key: %#jx\n", + (uintmax_t)scsi_8btou64(desc->res_key.key)); + fprintf(stdout, "All Target Ports (ALL_TG_PT): %d\n", + (desc->flags & SPRI_FULL_ALL_TG_PT) ? 1 : 0); + fprintf(stdout, "Reservation Holder (R_HOLDER): %d\n", + (desc->flags & SPRI_FULL_R_HOLDER) ? 1 : 0); + + if (desc->flags & SPRI_FULL_R_HOLDER) + persist_print_scopetype(desc->scopetype); + + if ((desc->flags & SPRI_FULL_ALL_TG_PT) == 0) + fprintf(stdout, "Relative Target Port ID: %#x\n", + scsi_2btoul(desc->rel_trgt_port_id)); + + additional_length = scsi_4btoul(desc->additional_length); + + persist_print_transportid(desc->transport_id, + additional_length); + + cur_length = sizeof(*desc) + additional_length; + len_to_go -= cur_length; + cur_pos += cur_length; + } +} + +int +scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt, + int retry_count, int timeout, int verbosemode, int err_recover) +{ + union ccb *ccb = NULL; + int c, in = 0, out = 0; + int action = -1, num_ids = 0; + int error = 0; + uint32_t res_len = 0; + unsigned long rel_tgt_port = 0; + uint8_t *res_buf = NULL; + int scope = SPR_LU_SCOPE, res_type = 0, key_set = 0, sa_key_set = 0; + struct persist_transport_id *id, *id2; + STAILQ_HEAD(, persist_transport_id) transport_id_list; + uint64_t key = 0, sa_key = 0; + struct scsi_nv *table = NULL; + size_t table_size = 0, id_len = 0; + uint32_t valid_len = 0; + int all_tg_pt = 0, aptpl = 0, spec_i_pt = 0, unreg = 0,rel_port_set = 0; + + STAILQ_INIT(&transport_id_list); + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + error = 1; + goto bailout; + } + + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'a': + all_tg_pt = 1; + break; + case 'I': { + int error_str_len = 128; + char error_str[error_str_len]; + char *id_str; + + id = malloc(sizeof(*id)); + if (id == NULL) { + warnx("%s: error allocating %zu bytes", + __func__, sizeof(*id)); + error = 1; + goto bailout; + } + bzero(id, sizeof(*id)); + + id_str = strdup(optarg); + if (id_str == NULL) { + warnx("%s: error duplicating string %s", + __func__, optarg); + free(id); + error = 1; + goto bailout; + } + error = scsi_parse_transportid(id_str, &id->hdr, + &id->alloc_len, error_str, error_str_len); + if (error != 0) { + warnx("%s", error_str); + error = 1; + free(id); + free(id_str); + goto bailout; + } + free(id_str); + + STAILQ_INSERT_TAIL(&transport_id_list, id, links); + num_ids++; + id_len += id->alloc_len; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 18:21:28 2014 Return-Path: Delivered-To: svn-src-stable-10@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 83847BC; Tue, 15 Jul 2014 18:21: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 642DB24AF; Tue, 15 Jul 2014 18:21: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 s6FILSbZ025504; Tue, 15 Jul 2014 18:21:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FILRNM025491; Tue, 15 Jul 2014 18:21:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151821.s6FILRNM025491@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 18:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268703 - in stable/10: sys/dev/iscsi usr.sbin/iscsid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 18:21:28 -0000 Author: mav Date: Tue Jul 15 18:21:26 2014 New Revision: 268703 URL: http://svnweb.freebsd.org/changeset/base/268703 Log: MFC r268326: Make iSCSI initiator keep Initiator Session ID (ISID) across reconnects. Previously ISID was changed every time, that made impossible correct persistent reservation, because reconnected session was identified as completely new one. Modified: stable/10/sys/dev/iscsi/iscsi.c stable/10/sys/dev/iscsi/iscsi.h stable/10/sys/dev/iscsi/iscsi_ioctl.h stable/10/usr.sbin/iscsid/iscsid.c stable/10/usr.sbin/iscsid/iscsid.h stable/10/usr.sbin/iscsid/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Tue Jul 15 17:39:53 2014 (r268702) +++ stable/10/sys/dev/iscsi/iscsi.c Tue Jul 15 18:21:26 2014 (r268703) @@ -1226,6 +1226,9 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof ISCSI_SESSION_UNLOCK(is); request->idr_session_id = is->is_id; + memcpy(&request->idr_isid, &is->is_isid, + sizeof(request->idr_isid)); + request->idr_tsih = 0; /* New or reinstated session. */ memcpy(&request->idr_conf, &is->is_conf, sizeof(request->idr_conf)); @@ -1275,7 +1278,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ strlcpy(is->is_target_alias, handoff->idh_target_alias, sizeof(is->is_target_alias)); - memcpy(is->is_isid, handoff->idh_isid, sizeof(is->is_isid)); + is->is_tsih = handoff->idh_tsih; is->is_statsn = handoff->idh_statsn; is->is_initial_r2t = handoff->idh_initial_r2t; is->is_immediate_data = handoff->idh_immediate_data; @@ -1651,6 +1654,9 @@ iscsi_ioctl_session_add(struct iscsi_sof is->is_softc = sc; sc->sc_last_session_id++; is->is_id = sc->sc_last_session_id; + is->is_isid[0] = 0x80; /* RFC 3720, 10.12.5: 10b, "Random" ISID. */ + arc4rand(&is->is_isid[1], 5, 0); + is->is_tsih = 0; callout_init(&is->is_callout, 1); callout_reset(&is->is_callout, 1 * hz, iscsi_callout, is); TAILQ_INSERT_TAIL(&sc->sc_sessions, is, is_next); Modified: stable/10/sys/dev/iscsi/iscsi.h ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.h Tue Jul 15 17:39:53 2014 (r268702) +++ stable/10/sys/dev/iscsi/iscsi.h Tue Jul 15 18:21:26 2014 (r268703) @@ -64,6 +64,7 @@ struct iscsi_session { size_t is_max_burst_length; size_t is_first_burst_length; uint8_t is_isid[6]; + uint16_t is_tsih; bool is_immediate_data; size_t is_max_data_segment_length; char is_target_alias[ISCSI_ALIAS_LEN]; Modified: stable/10/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- stable/10/sys/dev/iscsi/iscsi_ioctl.h Tue Jul 15 17:39:53 2014 (r268702) +++ stable/10/sys/dev/iscsi/iscsi_ioctl.h Tue Jul 15 18:21:26 2014 (r268703) @@ -91,8 +91,8 @@ struct iscsi_session_state { struct iscsi_daemon_request { unsigned int idr_session_id; struct iscsi_session_conf idr_conf; - uint8_t idr_spare_isid[6]; - uint16_t idr_spare_tsih; + uint8_t idr_isid[6]; + uint16_t idr_tsih; uint16_t idr_spare_cid; int idr_spare[4]; }; @@ -101,9 +101,9 @@ struct iscsi_daemon_handoff { unsigned int idh_session_id; int idh_socket; char idh_target_alias[ISCSI_ALIAS_LEN]; - uint8_t idh_isid[6]; - uint16_t idr_spare_tsih; - uint16_t idr_spare_cid; + uint8_t idh_spare_isid[6]; + uint16_t idh_tsih; + uint16_t idh_spare_cid; uint32_t idh_statsn; int idh_header_digest; int idh_data_digest; Modified: stable/10/usr.sbin/iscsid/iscsid.c ============================================================================== --- stable/10/usr.sbin/iscsid/iscsid.c Tue Jul 15 17:39:53 2014 (r268702) +++ stable/10/usr.sbin/iscsid/iscsid.c Tue Jul 15 18:21:26 2014 (r268703) @@ -149,8 +149,8 @@ resolve_addr(const struct connection *co } static struct connection * -connection_new(unsigned int session_id, const struct iscsi_session_conf *conf, - int iscsi_fd) +connection_new(unsigned int session_id, const uint8_t isid[8], uint16_t tsih, + const struct iscsi_session_conf *conf, int iscsi_fd) { struct connection *conn; struct addrinfo *from_ai, *to_ai; @@ -176,6 +176,8 @@ connection_new(unsigned int session_id, conn->conn_first_burst_length = 65536; conn->conn_session_id = session_id; + memcpy(&conn->conn_isid, isid, sizeof(conn->conn_isid)); + conn->conn_tsih = tsih; conn->conn_iscsi_fd = iscsi_fd; /* @@ -264,7 +266,7 @@ handoff(struct connection *conn) idh.idh_socket = conn->conn_socket; strlcpy(idh.idh_target_alias, conn->conn_target_alias, sizeof(idh.idh_target_alias)); - memcpy(idh.idh_isid, conn->conn_isid, sizeof(idh.idh_isid)); + idh.idh_tsih = conn->conn_tsih; idh.idh_statsn = conn->conn_statsn; idh.idh_header_digest = conn->conn_header_digest; idh.idh_data_digest = conn->conn_data_digest; @@ -430,7 +432,8 @@ handle_request(int iscsi_fd, const struc setproctitle("%s", request->idr_conf.isc_target_addr); } - conn = connection_new(request->idr_session_id, &request->idr_conf, iscsi_fd); + conn = connection_new(request->idr_session_id, request->idr_isid, + request->idr_tsih, &request->idr_conf, iscsi_fd); set_timeout(timeout); capsicate(conn); login(conn); Modified: stable/10/usr.sbin/iscsid/iscsid.h ============================================================================== --- stable/10/usr.sbin/iscsid/iscsid.h Tue Jul 15 17:39:53 2014 (r268702) +++ stable/10/usr.sbin/iscsid/iscsid.h Tue Jul 15 18:21:26 2014 (r268703) @@ -51,6 +51,7 @@ struct connection { struct iscsi_session_conf conn_conf; char conn_target_alias[ISCSI_ADDR_LEN]; uint8_t conn_isid[6]; + uint16_t conn_tsih; uint32_t conn_statsn; int conn_header_digest; int conn_data_digest; Modified: stable/10/usr.sbin/iscsid/login.c ============================================================================== --- stable/10/usr.sbin/iscsid/login.c Tue Jul 15 17:39:53 2014 (r268702) +++ stable/10/usr.sbin/iscsid/login.c Tue Jul 15 18:21:26 2014 (r268703) @@ -199,6 +199,7 @@ login_receive(struct connection *conn, b "is %d, should be %d", ntohl(bhslr->bhslr_statsn), conn->conn_statsn + 1); } + conn->conn_tsih = ntohs(bhslr->bhslr_tsih); conn->conn_statsn = ntohl(bhslr->bhslr_statsn); return (response); @@ -218,6 +219,7 @@ login_new_request(struct connection *con login_set_csg(request, BHSLR_STAGE_SECURITY_NEGOTIATION); login_set_nsg(request, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); memcpy(bhslr->bhslr_isid, &conn->conn_isid, sizeof(bhslr->bhslr_isid)); + bhslr->bhslr_tsih = htons(conn->conn_tsih); bhslr->bhslr_initiator_task_tag = 0; bhslr->bhslr_cmdsn = 0; bhslr->bhslr_expstatsn = htonl(conn->conn_statsn + 1); @@ -749,24 +751,6 @@ login_chap(struct connection *conn) log_debugx("CHAP authentication done"); } -static void -login_create_isid(struct connection *conn) -{ - int rv; - - /* - * RFC 3720, 10.12.5: 10b, "Random" ISID. - * - */ - conn->conn_isid[0] = 0x80; - - rv = RAND_bytes(&conn->conn_isid[1], 3); - if (rv != 1) { - log_errx(1, "RAND_bytes failed: %s", - ERR_error_string(ERR_get_error(), NULL)); - } -} - void login(struct connection *conn) { @@ -777,8 +761,6 @@ login(struct connection *conn) const char *auth_method; int i; - login_create_isid(conn); - log_debugx("beginning Login phase; sending Login PDU"); request = login_new_request(conn); From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 18:22:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 932782A5; Tue, 15 Jul 2014 18:22: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 7438B24D7; Tue, 15 Jul 2014 18:22: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 s6FIMInN025770; Tue, 15 Jul 2014 18:22:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FIMInu025769; Tue, 15 Jul 2014 18:22:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151822.s6FIMInu025769@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 18:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268704 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 18:22:18 -0000 Author: mav Date: Tue Jul 15 18:22:17 2014 New Revision: 268704 URL: http://svnweb.freebsd.org/changeset/base/268704 Log: MFC r268370: Make XPT_GET_TRAN_SETTINGS to report CAM that command queueing is enabled, but make couple changes to handle non-queued commands too, if happen. Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Tue Jul 15 18:21:26 2014 (r268703) +++ stable/10/sys/dev/iscsi/iscsi.c Tue Jul 15 18:22:17 2014 (r268704) @@ -1346,7 +1346,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ is->is_sim = cam_sim_alloc(iscsi_action, iscsi_poll, "iscsi", is, is->is_id /* unit */, &is->is_lock, - maxtags, maxtags, is->is_devq); + 1, maxtags, is->is_devq); if (is->is_sim == NULL) { ISCSI_SESSION_UNLOCK(is); ISCSI_SESSION_WARN(is, "failed to allocate SIM"); @@ -1948,23 +1948,24 @@ iscsi_action_scsiio(struct iscsi_session break; } - switch (csio->tag_action) { - case MSG_HEAD_OF_Q_TAG: - bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_HOQ; - break; - break; - case MSG_ORDERED_Q_TAG: - bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ORDERED; - break; - case MSG_ACA_TASK: - bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ACA; - break; - case CAM_TAG_ACTION_NONE: - case MSG_SIMPLE_Q_TAG: - default: - bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_SIMPLE; - break; - } + if ((ccb->ccb_h.flags & CAM_TAG_ACTION_VALID) != 0) { + switch (csio->tag_action) { + case MSG_HEAD_OF_Q_TAG: + bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_HOQ; + break; + case MSG_ORDERED_Q_TAG: + bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ORDERED; + break; + case MSG_ACA_TASK: + bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ACA; + break; + case MSG_SIMPLE_Q_TAG: + default: + bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_SIMPLE; + break; + } + } else + bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_UNTAGGED; bhssc->bhssc_lun = iscsi_encode_lun(csio->ccb_h.target_lun); bhssc->bhssc_initiator_task_tag = is->is_initiator_task_tag; @@ -2059,6 +2060,23 @@ iscsi_action(struct cam_sim *sim, union cpi->ccb_h.status = CAM_REQ_CMP; break; } + case XPT_GET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts; + struct ccb_trans_settings_scsi *scsi; + + cts = &ccb->cts; + scsi = &cts->proto_specific.scsi; + + cts->protocol = PROTO_SCSI; + cts->protocol_version = SCSI_REV_SPC3; + cts->transport = XPORT_ISCSI; + cts->transport_version = 0; + scsi->valid = CTS_SCSI_VALID_TQ; + scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; + cts->ccb_h.status = CAM_REQ_CMP; + break; + } case XPT_CALC_GEOMETRY: cam_calc_geometry(&ccb->ccg, /*extended*/1); ccb->ccb_h.status = CAM_REQ_CMP; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 18:23:15 2014 Return-Path: Delivered-To: svn-src-stable-10@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 1425F409; Tue, 15 Jul 2014 18:23: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 F30E524E0; Tue, 15 Jul 2014 18:23: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 s6FINEEx025999; Tue, 15 Jul 2014 18:23:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FINEff025998; Tue, 15 Jul 2014 18:23:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151823.s6FINEff025998@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 18:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268705 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 18:23:15 -0000 Author: mav Date: Tue Jul 15 18:23:14 2014 New Revision: 268705 URL: http://svnweb.freebsd.org/changeset/base/268705 Log: MFC r268388: Add XPT_ABORT support to iSCSI initiator. While CAM does not use it normally, it is useful for targets testing. Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Tue Jul 15 18:22:17 2014 (r268704) +++ stable/10/sys/dev/iscsi/iscsi.c Tue Jul 15 18:23:14 2014 (r268705) @@ -157,6 +157,7 @@ static void iscsi_pdu_queue(struct icl_p static void iscsi_pdu_update_statsn(const struct icl_pdu *response); static void iscsi_pdu_handle_nop_in(struct icl_pdu *response); static void iscsi_pdu_handle_scsi_response(struct icl_pdu *response); +static void iscsi_pdu_handle_task_response(struct icl_pdu *response); static void iscsi_pdu_handle_data_in(struct icl_pdu *response); static void iscsi_pdu_handle_logout_response(struct icl_pdu *response); static void iscsi_pdu_handle_r2t(struct icl_pdu *response); @@ -168,7 +169,7 @@ static void iscsi_action(struct cam_sim static void iscsi_poll(struct cam_sim *sim); static struct iscsi_outstanding *iscsi_outstanding_find(struct iscsi_session *is, uint32_t initiator_task_tag); -static int iscsi_outstanding_add(struct iscsi_session *is, +static struct iscsi_outstanding *iscsi_outstanding_add(struct iscsi_session *is, uint32_t initiator_task_tag, union ccb *ccb); static void iscsi_outstanding_remove(struct iscsi_session *is, struct iscsi_outstanding *io); @@ -279,27 +280,35 @@ iscsi_session_logout(struct iscsi_sessio } static void -iscsi_session_terminate_tasks(struct iscsi_session *is, bool requeue) +iscsi_session_terminate_task(struct iscsi_session *is, + struct iscsi_outstanding *io, bool requeue) { - struct iscsi_outstanding *io, *tmp; - ISCSI_SESSION_LOCK_ASSERT(is); - - TAILQ_FOREACH_SAFE(io, &is->is_outstanding, io_next, tmp) { - if (requeue) { - io->io_ccb->ccb_h.status &= ~CAM_SIM_QUEUED; + if (io->io_ccb != NULL) { + io->io_ccb->ccb_h.status &= ~(CAM_SIM_QUEUED | CAM_STATUS_MASK); + if (requeue) io->io_ccb->ccb_h.status |= CAM_REQUEUE_REQ; - } else { - io->io_ccb->ccb_h.status = CAM_REQ_ABORTED; - } - + else + io->io_ccb->ccb_h.status |= CAM_REQ_ABORTED; if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + io->io_ccb->ccb_h.status |= CAM_DEV_QFRZN; xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status |= CAM_DEV_QFRZN; xpt_done(io->io_ccb); - iscsi_outstanding_remove(is, io); + } + iscsi_outstanding_remove(is, io); +} + +static void +iscsi_session_terminate_tasks(struct iscsi_session *is, bool requeue) +{ + struct iscsi_outstanding *io, *tmp; + + ISCSI_SESSION_LOCK_ASSERT(is); + + TAILQ_FOREACH_SAFE(io, &is->is_outstanding, io_next, tmp) { + iscsi_session_terminate_task(is, io, requeue); } } @@ -698,6 +707,9 @@ iscsi_receive_callback(struct icl_pdu *r case ISCSI_BHS_OPCODE_SCSI_RESPONSE: iscsi_pdu_handle_scsi_response(response); break; + case ISCSI_BHS_OPCODE_TASK_RESPONSE: + iscsi_pdu_handle_task_response(response); + break; case ISCSI_BHS_OPCODE_SCSI_DATA_IN: iscsi_pdu_handle_data_in(response); break; @@ -818,7 +830,7 @@ iscsi_pdu_handle_scsi_response(struct ic bhssr = (struct iscsi_bhs_scsi_response *)response->ip_bhs; io = iscsi_outstanding_find(is, bhssr->bhssr_initiator_task_tag); - if (io == NULL) { + if (io == NULL || io->io_ccb == NULL) { ISCSI_SESSION_WARN(is, "bad itt 0x%x", bhssr->bhssr_initiator_task_tag); icl_pdu_free(response); iscsi_session_reconnect(is); @@ -918,6 +930,38 @@ out: } static void +iscsi_pdu_handle_task_response(struct icl_pdu *response) +{ + struct iscsi_bhs_task_management_response *bhstmr; + struct iscsi_outstanding *io, *aio; + struct iscsi_session *is; + + is = PDU_SESSION(response); + + bhstmr = (struct iscsi_bhs_task_management_response *)response->ip_bhs; + io = iscsi_outstanding_find(is, bhstmr->bhstmr_initiator_task_tag); + if (io == NULL || io->io_ccb != NULL) { + ISCSI_SESSION_WARN(is, "bad itt 0x%x", + bhstmr->bhstmr_initiator_task_tag); + icl_pdu_free(response); + iscsi_session_reconnect(is); + return; + } + + if (bhstmr->bhstmr_response != BHSTMR_RESPONSE_FUNCTION_COMPLETE) { + ISCSI_SESSION_WARN(is, "task response 0x%x", + bhstmr->bhstmr_response); + } else { + aio = iscsi_outstanding_find(is, io->io_datasn); + if (aio != NULL && aio->io_ccb != NULL) + iscsi_session_terminate_task(is, aio, false); + } + + iscsi_outstanding_remove(is, io); + icl_pdu_free(response); +} + +static void iscsi_pdu_handle_data_in(struct icl_pdu *response) { struct iscsi_bhs_data_in *bhsdi; @@ -929,7 +973,7 @@ iscsi_pdu_handle_data_in(struct icl_pdu is = PDU_SESSION(response); bhsdi = (struct iscsi_bhs_data_in *)response->ip_bhs; io = iscsi_outstanding_find(is, bhsdi->bhsdi_initiator_task_tag); - if (io == NULL) { + if (io == NULL || io->io_ccb == NULL) { ISCSI_SESSION_WARN(is, "bad itt 0x%x", bhsdi->bhsdi_initiator_task_tag); icl_pdu_free(response); iscsi_session_reconnect(is); @@ -1042,7 +1086,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *res bhsr2t = (struct iscsi_bhs_r2t *)response->ip_bhs; io = iscsi_outstanding_find(is, bhsr2t->bhsr2t_initiator_task_tag); - if (io == NULL) { + if (io == NULL || io->io_ccb == NULL) { ISCSI_SESSION_WARN(is, "bad itt 0x%x; reconnecting", bhsr2t->bhsr2t_initiator_task_tag); icl_pdu_free(response); @@ -1866,7 +1910,21 @@ iscsi_outstanding_find(struct iscsi_sess return (NULL); } -static int +static struct iscsi_outstanding * +iscsi_outstanding_find_ccb(struct iscsi_session *is, union ccb *ccb) +{ + struct iscsi_outstanding *io; + + ISCSI_SESSION_LOCK_ASSERT(is); + + TAILQ_FOREACH(io, &is->is_outstanding, io_next) { + if (io->io_ccb == ccb) + return (io); + } + return (NULL); +} + +static struct iscsi_outstanding * iscsi_outstanding_add(struct iscsi_session *is, uint32_t initiator_task_tag, union ccb *ccb) { @@ -1880,12 +1938,12 @@ iscsi_outstanding_add(struct iscsi_sessi io = uma_zalloc(iscsi_outstanding_zone, M_NOWAIT | M_ZERO); if (io == NULL) { ISCSI_SESSION_WARN(is, "failed to allocate %zd bytes", sizeof(*io)); - return (ENOMEM); + return (NULL); } io->io_initiator_task_tag = initiator_task_tag; io->io_ccb = ccb; TAILQ_INSERT_TAIL(&is->is_outstanding, io, io_next); - return (0); + return (io); } static void @@ -1899,11 +1957,66 @@ iscsi_outstanding_remove(struct iscsi_se } static void +iscsi_action_abort(struct iscsi_session *is, union ccb *ccb) +{ + struct icl_pdu *request; + struct iscsi_bhs_task_management_request *bhstmr; + struct ccb_abort *cab = &ccb->cab; + struct iscsi_outstanding *io, *aio; + + ISCSI_SESSION_LOCK_ASSERT(is); + +#if 0 + KASSERT(is->is_login_phase == false, ("%s called during Login Phase", __func__)); +#else + if (is->is_login_phase) { + ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(ccb); + return; + } +#endif + + aio = iscsi_outstanding_find_ccb(is, cab->abort_ccb); + if (aio == NULL) { + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + return; + } + + request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT); + if (request == NULL) { + ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + xpt_done(ccb); + return; + } + + bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; + bhstmr->bhstmr_opcode = ISCSI_BHS_OPCODE_TASK_REQUEST; + bhstmr->bhstmr_function = 0x80 | BHSTMR_FUNCTION_ABORT_TASK; + + bhstmr->bhstmr_lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); + bhstmr->bhstmr_initiator_task_tag = is->is_initiator_task_tag; + is->is_initiator_task_tag++; + bhstmr->bhstmr_referenced_task_tag = aio->io_initiator_task_tag; + + io = iscsi_outstanding_add(is, bhstmr->bhstmr_initiator_task_tag, NULL); + if (io == NULL) { + icl_pdu_free(request); + ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + xpt_done(ccb); + return; + } + io->io_datasn = aio->io_initiator_task_tag; + iscsi_pdu_queue_locked(request); +} + +static void iscsi_action_scsiio(struct iscsi_session *is, union ccb *ccb) { struct icl_pdu *request; struct iscsi_bhs_scsi_command *bhssc; struct ccb_scsiio *csio; + struct iscsi_outstanding *io; size_t len; int error; @@ -1979,8 +2092,8 @@ iscsi_action_scsiio(struct iscsi_session else memcpy(&bhssc->bhssc_cdb, csio->cdb_io.cdb_bytes, csio->cdb_len); - error = iscsi_outstanding_add(is, bhssc->bhssc_initiator_task_tag, ccb); - if (error != 0) { + io = iscsi_outstanding_add(is, bhssc->bhssc_initiator_task_tag, ccb); + if (io == NULL) { icl_pdu_free(request); if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { xpt_freeze_devq(ccb->ccb_h.path, 1); @@ -2086,12 +2199,14 @@ iscsi_action(struct cam_sim *sim, union * XXX: What's the point? */ case XPT_RESET_BUS: - case XPT_ABORT: case XPT_TERM_IO: ISCSI_SESSION_DEBUG(is, "faking success for reset, abort, or term_io"); ccb->ccb_h.status = CAM_REQ_CMP; break; #endif + case XPT_ABORT: + iscsi_action_abort(is, ccb); + return; case XPT_SCSI_IO: iscsi_action_scsiio(is, ccb); return; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 18:27:18 2014 Return-Path: Delivered-To: svn-src-stable-10@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 AE80F6C3; Tue, 15 Jul 2014 18:27: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 9B3452500; Tue, 15 Jul 2014 18:27: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 s6FIRINt026692; Tue, 15 Jul 2014 18:27:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FIRIW7026691; Tue, 15 Jul 2014 18:27:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151827.s6FIRIW7026691@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 18:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268707 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 18:27:18 -0000 Author: mav Date: Tue Jul 15 18:27:18 2014 New Revision: 268707 URL: http://svnweb.freebsd.org/changeset/base/268707 Log: Fix build on stable/10. Modified: stable/10/sys/dev/iscsi/iscsi.c Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Tue Jul 15 18:24:41 2014 (r268706) +++ stable/10/sys/dev/iscsi/iscsi.c Tue Jul 15 18:27:18 2014 (r268707) @@ -1994,7 +1994,7 @@ iscsi_action_abort(struct iscsi_session bhstmr->bhstmr_opcode = ISCSI_BHS_OPCODE_TASK_REQUEST; bhstmr->bhstmr_function = 0x80 | BHSTMR_FUNCTION_ABORT_TASK; - bhstmr->bhstmr_lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); + bhstmr->bhstmr_lun = iscsi_encode_lun(ccb->ccb_h.target_lun); bhstmr->bhstmr_initiator_task_tag = is->is_initiator_task_tag; is->is_initiator_task_tag++; bhstmr->bhstmr_referenced_task_tag = aio->io_initiator_task_tag; From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 18:41:31 2014 Return-Path: Delivered-To: svn-src-stable-10@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 35CECB2D; Tue, 15 Jul 2014 18:41: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 22BB626B8; Tue, 15 Jul 2014 18:41:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6FIfV8w034238; Tue, 15 Jul 2014 18:41:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FIfUqo034237; Tue, 15 Jul 2014 18:41:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407151841.s6FIfUqo034237@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jul 2014 18:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268708 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 18:41:31 -0000 Author: mav Date: Tue Jul 15 18:41:30 2014 New Revision: 268708 URL: http://svnweb.freebsd.org/changeset/base/268708 Log: Document CTL and iSCSI ABI breakages. Modified: stable/10/UPDATING Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Tue Jul 15 18:27:18 2014 (r268707) +++ stable/10/UPDATING Tue Jul 15 18:41:30 2014 (r268708) @@ -16,6 +16,11 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20140715: + Several ABI breaking changes were merged to CTL and new iSCSI code. + All CTL and iSCSI-related tools, such as ctladm, ctld, iscsid and + iscsictl need to be rebuilt to work with a new kernel. + 20140708: The WITHOUT_VT_SUPPORT kernel config knob has been renamed WITHOUT_VT. (The other _SUPPORT knobs have a consistent meaning From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 22:44:11 2014 Return-Path: Delivered-To: svn-src-stable-10@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 001E7FA; Tue, 15 Jul 2014 22:44: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 E15F52DA4; Tue, 15 Jul 2014 22:44: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 s6FMiAo6050968; Tue, 15 Jul 2014 22:44:10 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FMiAOT050967; Tue, 15 Jul 2014 22:44:10 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201407152244.s6FMiAOT050967@svn.freebsd.org> From: Warren Block Date: Tue, 15 Jul 2014 22:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268721 - stable/10/lib/libc/stdtime X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 22:44:11 -0000 Author: wblock (doc committer) Date: Tue Jul 15 22:44:10 2014 New Revision: 268721 URL: http://svnweb.freebsd.org/changeset/base/268721 Log: MFC r267618: Fix syntax error. Modified: stable/10/lib/libc/stdtime/strftime.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdtime/strftime.3 ============================================================================== --- stable/10/lib/libc/stdtime/strftime.3 Tue Jul 15 22:44:04 2014 (r268720) +++ stable/10/lib/libc/stdtime/strftime.3 Tue Jul 15 22:44:10 2014 (r268721) @@ -248,7 +248,7 @@ function conforms to .St -isoC with a lot of extensions including -.Ql %C , +.Ql \&%C , .Ql \&%D , .Ql %E* , .Ql %e , From owner-svn-src-stable-10@FreeBSD.ORG Tue Jul 15 23:20:26 2014 Return-Path: Delivered-To: svn-src-stable-10@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 8C45AB07; Tue, 15 Jul 2014 23:20: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 5EDD92084; Tue, 15 Jul 2014 23:20: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 s6FNKQeE071605; Tue, 15 Jul 2014 23:20:26 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FNKQBP071604; Tue, 15 Jul 2014 23:20:26 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201407152320.s6FNKQBP071604@svn.freebsd.org> From: Warren Block Date: Tue, 15 Jul 2014 23:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268724 - stable/10/sbin/geom/class/eli X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 23:20:26 -0000 Author: wblock (doc committer) Date: Tue Jul 15 23:20:25 2014 New Revision: 268724 URL: http://svnweb.freebsd.org/changeset/base/268724 Log: MFC r267617: Fix spelling, typos, missing articles, contractions. Expanded version of patch supplied with PR. Modified: stable/10/sbin/geom/class/eli/geli.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/eli/geli.8 ============================================================================== --- stable/10/sbin/geom/class/eli/geli.8 Tue Jul 15 23:16:33 2014 (r268723) +++ stable/10/sbin/geom/class/eli/geli.8 Tue Jul 15 23:20:25 2014 (r268724) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2013 +.Dd June 18, 2014 .Dt GELI 8 .Os .Sh NAME @@ -331,7 +331,7 @@ key length. .It Nm AES-XTS .Em 128 , 256 -.It Nm AES-CBC , Nm Camilla-CBC +.It Nm AES-CBC , Nm Camellia-CBC .Em 128 , 192, 256 @@ -353,13 +353,14 @@ because encryption/decryption which requ is done per sector; fewer sectors means less computational work. .It Fl V Ar version Metadata version to use. -This option is helpful when creating provider that may be used by older +This option is helpful when creating a provider that may be used by older .Nm FreeBSD/GELI versions. Consult the .Sx HISTORY section to find which metadata version is supported by which FreeBSD version. -Note that using older metadata version may limit numer of features available. +Note that using an older version of metadata may limit the number of +features available. .El .It Cm attach Attach the given provider. @@ -619,7 +620,7 @@ devices. .El .It Cm resume Resume previously suspended device. -The caller must ensure that executing this subcommand doesn't access the +The caller must ensure that executing this subcommand does not access the suspended device, leading to a deadlock. For example suspending a device which contains the file system where the .Nm @@ -823,7 +824,7 @@ Enter passphrase: .Pp Create an encrypted provider, but use two User Keys: one for your employee and one for you as the company's security officer -(so it's not a tragedy if the employee +(so it is not a tragedy if the employee .Qq accidentally forgets his passphrase): .Bd -literal -offset indent From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 00:36:56 2014 Return-Path: Delivered-To: svn-src-stable-10@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 DC24FF8B; Wed, 16 Jul 2014 00:36: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 C8234274B; Wed, 16 Jul 2014 00:36: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 s6G0atpZ009486; Wed, 16 Jul 2014 00:36:55 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6G0atka009485; Wed, 16 Jul 2014 00:36:55 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201407160036.s6G0atka009485@svn.freebsd.org> From: Warren Block Date: Wed, 16 Jul 2014 00:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268730 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 00:36:56 -0000 Author: wblock (doc committer) Date: Wed Jul 16 00:36:55 2014 New Revision: 268730 URL: http://svnweb.freebsd.org/changeset/base/268730 Log: MFC r268187: Improve markup, change references to nonexistent vt_vga(4), remove some language redundancy, and move the examples so sections are in the standard order. Modified: stable/10/share/man/man4/vt.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/vt.4 ============================================================================== --- stable/10/share/man/man4/vt.4 Wed Jul 16 00:34:20 2014 (r268729) +++ stable/10/share/man/man4/vt.4 Wed Jul 16 00:36:55 2014 (r268730) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2014 +.Dd July 2, 2014 .Dt "VIRTUAL TERMINALS" 4 .Os .Sh NAME @@ -109,10 +109,10 @@ These kernel options control the .Nm driver. .Bl -tag -width MAXCONS -.It Dv TERMINAL_NORM_ATTR=_attribute_ -.It Dv TERMINAL_KERN_ATTR=_attribute_ -These options allow to change the default colors used for normal and kernel -text respectively. +.It Dv TERMINAL_NORM_ATTR= Ns Pa attribute +.It Dv TERMINAL_KERN_ATTR= Ns Pa attribute +These options allow changing the default colors used for normal and kernel +text. Available colors are defined in .In sys/terminal.h . See @@ -165,13 +165,13 @@ is set, the system remains in text mode. Otherwise, .Nm switches to 640x480x16 VGA mode using -.Xr vt_vga 4 . +.Cm vt_vga . If a KMS .Pq Kernel Mode Switching video driver is available, the display is switched to high resolution and the KMS driver takes over. When a KMS driver is not available, -.Xr vt_vga 4 +.Cm vt_vga remains active. .Sh LOADER TUNABLES These settings can be entered at the @@ -184,27 +184,18 @@ Set to 1 to use virtual terminals in tex Features that require graphics mode, like loadable fonts, will be disabled. .It Va kern.vty -Set to vt to choose the +When both .Nm -driver for the system console, if the -.Xr syscons 4 -driver is also compiled in and is the default. +and +.Xr sc 4 have been compiled into the kernel, the one to use for the +system console can be selected by setting this value to +.Ql vt +or +.Ql sc . +If this value is not set, +.Xr sc 4 +is used. .El -.Sh EXAMPLES -The following line will change the default color of normal text. -Normal text will be green on black background. -Reversed normal text will be black on green background. -Note that you cannot put any white space inside the quoted string, -because of the current implementation of -.Xr config 8 . -.Pp -.Dl "options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)" -.Pp -The following line will change the default color of kernel messages. -Kernel messages will be printed bright red on black background. -Reversed kernel messages will be black on bright red background. -.Pp -.Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)" .Sh FILES .Bl -tag -width /usr/share/syscons/keymaps/* -compact .It Pa /dev/console @@ -214,6 +205,19 @@ virtual terminals .It Pa /etc/ttys terminal initialization information .El +.Sh EXAMPLES +This example changes the default color of normal text to green on a +black background, or black on a green background when reversed. +Note that white space cannot be used inside the attribute string +because of the current implementation of +.Xr config 8 . +.Pp +.Dl "options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)" +.Pp +This line changes the default color of kernel messages to be bright red +on a black background, or black on a bright red background when reversed. +.Pp +.Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)" .Sh SEE ALSO .Xr kbdcontrol 1 , .Xr login 1 , From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 00:41:47 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B52252DB; Wed, 16 Jul 2014 00:41: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 A195A27ED; Wed, 16 Jul 2014 00:41: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 s6G0flvM013418; Wed, 16 Jul 2014 00:41:47 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6G0fl0h013417; Wed, 16 Jul 2014 00:41:47 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201407160041.s6G0fl0h013417@svn.freebsd.org> From: Warren Block Date: Wed, 16 Jul 2014 00:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268732 - stable/10/usr.bin/showmount X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 00:41:47 -0000 Author: wblock (doc committer) Date: Wed Jul 16 00:41:47 2014 New Revision: 268732 URL: http://svnweb.freebsd.org/changeset/base/268732 Log: MFC r268381 Make synopsis version of -3 flag match other uses in the page. Modified: stable/10/usr.bin/showmount/showmount.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/showmount/showmount.8 ============================================================================== --- stable/10/usr.bin/showmount/showmount.8 Wed Jul 16 00:39:58 2014 (r268731) +++ stable/10/usr.bin/showmount/showmount.8 Wed Jul 16 00:41:47 2014 (r268732) @@ -40,7 +40,8 @@ .Sh SYNOPSIS .Nm .Op Fl a | d -.Op Fl e3 +.Op Fl e +.Op Fl 3 .Op Ar host .Sh DESCRIPTION The From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 02:02:48 2014 Return-Path: Delivered-To: svn-src-stable-10@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 3EE5D408; Wed, 16 Jul 2014 02:02: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 1F7E02DFF; Wed, 16 Jul 2014 02:02: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 s6G22lwO050553; Wed, 16 Jul 2014 02:02:47 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6G22kbJ050551; Wed, 16 Jul 2014 02:02:46 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407160202.s6G22kbJ050551@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 16 Jul 2014 02:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268734 - in stable/10/sys: cddl/contrib/opensolaris/uts/common/dtrace modules/dtrace/fasttrap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 02:02:48 -0000 Author: pfg Date: Wed Jul 16 02:02:46 2014 New Revision: 268734 URL: http://svnweb.freebsd.org/changeset/base/268734 Log: MFC r268097: MFV r260708 4427 pid provider rejects probes with valid UTF-8 names This make use of Solaris' u8_validate() which we happen to use since r185029 for ZFS. Use of u8_textprep.c required -Wno-cast-qual for powerpc. Illumos Revision: 1444d846b126463eb1059a572ff114d51f7562e5 Reference: https://www.illumos.org/issues/4427 Obtained from: Illumos Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/10/sys/modules/dtrace/fasttrap/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Jul 16 00:43:53 2014 (r268733) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Jul 16 02:02:46 2014 (r268734) @@ -28,9 +28,9 @@ * Use is subject to license terms. */ -#if defined(sun) -#pragma ident "%Z%%M% %I% %E% SMI" -#endif +/* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ #include #include @@ -63,6 +63,7 @@ #if !defined(sun) #include #include +#include #include #endif @@ -2068,8 +2069,7 @@ fasttrap_ioctl(struct cdev *dev, u_long fasttrap_probe_spec_t *probe; uint64_t noffs; size_t size; - int ret; - char *c; + int ret, err; if (copyin(&uprobe->ftps_noffs, &noffs, sizeof (uprobe->ftps_noffs))) @@ -2099,18 +2099,16 @@ fasttrap_ioctl(struct cdev *dev, u_long * Verify that the function and module strings contain no * funny characters. */ - for (c = &probe->ftps_func[0]; *c != '\0'; c++) { - if (*c < 0x20 || 0x7f <= *c) { - ret = EINVAL; - goto err; - } + if (u8_validate(probe->ftps_func, strlen(probe->ftps_func), + NULL, U8_VALIDATE_ENTIRE, &err) < 0) { + ret = EINVAL; + goto err; } - for (c = &probe->ftps_mod[0]; *c != '\0'; c++) { - if (*c < 0x20 || 0x7f <= *c) { - ret = EINVAL; - goto err; - } + if (u8_validate(probe->ftps_mod, strlen(probe->ftps_mod), + NULL, U8_VALIDATE_ENTIRE, &err) < 0) { + ret = EINVAL; + goto err; } #ifdef notyet Modified: stable/10/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- stable/10/sys/modules/dtrace/fasttrap/Makefile Wed Jul 16 00:43:53 2014 (r268733) +++ stable/10/sys/modules/dtrace/fasttrap/Makefile Wed Jul 16 02:02:46 2014 (r268734) @@ -18,9 +18,13 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/cont .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/powerpc/dtrace .endif +.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/common/unicode +SRCS+= u8_textprep.c + CFLAGS+= -DSMP .include CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= -Wno-cast-qual CWARNFLAGS+= -Wno-unused From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 06:20:19 2014 Return-Path: Delivered-To: svn-src-stable-10@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 760F02AD; Wed, 16 Jul 2014 06:20: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 4930721D6; Wed, 16 Jul 2014 06:20: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 s6G6KJP0077561; Wed, 16 Jul 2014 06:20:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6G6KJQ6077560; Wed, 16 Jul 2014 06:20:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407160620.s6G6KJQ6077560@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 16 Jul 2014 06:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268737 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 06:20:19 -0000 Author: hselasky Date: Wed Jul 16 06:20:18 2014 New Revision: 268737 URL: http://svnweb.freebsd.org/changeset/base/268737 Log: MFC r268582: Fix performance problems with AXGE network adapter in RX direction: - Remove 4 extra bytes from the ethernet payload. - The maximum RX buffer was incorrectly set. Increase it to 64K for now, until the exact limit is understood. - Enable hardware checksumming again. - Make hardware data structure packed. Modified: stable/10/sys/dev/usb/net/if_axge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_axge.c ============================================================================== --- stable/10/sys/dev/usb/net/if_axge.c Wed Jul 16 06:18:02 2014 (r268736) +++ stable/10/sys/dev/usb/net/if_axge.c Wed Jul 16 06:20:18 2014 (r268737) @@ -77,7 +77,7 @@ static const struct { uint8_t timer_h; uint8_t size; uint8_t ifg; -} axge_bulk_size[] = { +} __packed axge_bulk_size[] = { { 7, 0x4f, 0x00, 0x12, 0xff }, { 7, 0x20, 0x03, 0x16, 0xff }, { 7, 0xae, 0x07, 0x18, 0xff }, @@ -153,7 +153,7 @@ static const struct usb_config axge_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .bufsize = 20480, + .bufsize = 65536, .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = axge_bulk_read_callback, .timeout = 0, /* no timeout */ @@ -613,15 +613,14 @@ tr_setup: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); usbd_transfer_submit(xfer); uether_rxflush(ue); - return; + break; default: if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); goto tr_setup; } - return; - + break; } } @@ -965,8 +964,8 @@ axge_rx_frame(struct usb_ether *ue, stru DPRINTF("Dropped a packet\n"); ue->ue_ifp->if_ierrors++; } - if (pktlen >= 2 && (int)(pos + pktlen) <= actlen) { - axge_rxeof(ue, pc, pos + 2, pktlen - 2, pkt_hdr); + if (pktlen >= 6 && (int)(pos + pktlen) <= actlen) { + axge_rxeof(ue, pc, pos + 2, pktlen - 6, pkt_hdr); } else { DPRINTF("Invalid packet pos=%d len=%d\n", (int)pos, (int)pktlen); @@ -1001,7 +1000,7 @@ axge_rxeof(struct usb_ether *ue, struct usbd_copy_out(pc, offset, mtod(m, uint8_t *), len); ifp->if_ipackets++; -#if 0 + if ((pkt_hdr & (AXGE_RXHDR_L4CSUM_ERR | AXGE_RXHDR_L3CSUM_ERR)) == 0) { if ((pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == AXGE_RXHDR_L4_TYPE_TCP || @@ -1012,7 +1011,7 @@ axge_rxeof(struct usb_ether *ue, struct m->m_pkthdr.csum_data = 0xffff; } } -#endif + _IF_ENQUEUE(&ue->ue_rxq, m); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 06:22:36 2014 Return-Path: Delivered-To: svn-src-stable-10@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 25AA2416; Wed, 16 Jul 2014 06:22: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 124DE21FE; Wed, 16 Jul 2014 06:22: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 s6G6MZxq080975; Wed, 16 Jul 2014 06:22:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6G6MZrs080974; Wed, 16 Jul 2014 06:22:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407160622.s6G6MZrs080974@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 16 Jul 2014 06:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268738 - stable/10/sys/dev/usb/input X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 06:22:36 -0000 Author: hselasky Date: Wed Jul 16 06:22:35 2014 New Revision: 268738 URL: http://svnweb.freebsd.org/changeset/base/268738 Log: MFC r268583: Turn off blinking device leds at attach. PR: 183735 Modified: stable/10/sys/dev/usb/input/uhid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/input/uhid.c ============================================================================== --- stable/10/sys/dev/usb/input/uhid.c Wed Jul 16 06:20:18 2014 (r268737) +++ stable/10/sys/dev/usb/input/uhid.c Wed Jul 16 06:22:35 2014 (r268738) @@ -759,9 +759,20 @@ uhid_attach(device_t dev) sc->sc_flags |= UHID_FLAG_STATIC_DESC; } } else if ((uaa->info.bInterfaceClass == UICLASS_VENDOR) && - (uaa->info.bInterfaceSubClass == UISUBCLASS_XBOX360_CONTROLLER) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_XBOX360_CONTROLLER) && (uaa->info.bInterfaceProtocol == UIPROTO_XBOX360_GAMEPAD)) { - + static const uint8_t reportbuf[3] = {1, 3, 0}; + /* + * Turn off the four LEDs on the gamepad which + * are blinking by default: + */ + error = usbd_req_set_report(uaa->device, NULL, + __DECONST(void *, reportbuf), sizeof(reportbuf), + uaa->info.bIfaceIndex, UHID_OUTPUT_REPORT, 0); + if (error) { + DPRINTF("set output report failed, error=%s (ignored)\n", + usbd_errstr(error)); + } /* the Xbox 360 gamepad has no report descriptor */ sc->sc_repdesc_size = sizeof(uhid_xb360gp_report_descr); sc->sc_repdesc_ptr = (void *)&uhid_xb360gp_report_descr; From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 08:52:44 2014 Return-Path: Delivered-To: svn-src-stable-10@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 9DDC112D; Wed, 16 Jul 2014 08:52: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 8B0732F30; Wed, 16 Jul 2014 08:52: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 s6G8qipV054661; Wed, 16 Jul 2014 08:52:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6G8qiiE054660; Wed, 16 Jul 2014 08:52:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407160852.s6G8qiiE054660@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 16 Jul 2014 08:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268741 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 08:52:44 -0000 Author: kib Date: Wed Jul 16 08:52:44 2014 New Revision: 268741 URL: http://svnweb.freebsd.org/changeset/base/268741 Log: MFC r268467: Implement sysconf(_SC_GETGR_R_SIZE_MAX) and sysconf(_SC_GETPW_R_SIZE_MAX). Modified: stable/10/lib/libc/gen/sysconf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/sysconf.c ============================================================================== --- stable/10/lib/libc/gen/sysconf.c Wed Jul 16 06:25:44 2014 (r268740) +++ stable/10/lib/libc/gen/sysconf.c Wed Jul 16 08:52:44 2014 (r268741) @@ -367,11 +367,17 @@ yesno: * _POSIX_FILE_LOCKING, so we can't answer this one. */ #endif -#if _POSIX_THREAD_SAFE_FUNCTIONS > -1 + + /* + * SUSv4tc1 says the following about _SC_GETGR_R_SIZE_MAX and + * _SC_GETPW_R_SIZE_MAX: + * Note that sysconf(_SC_GETGR_R_SIZE_MAX) may return -1 if + * there is no hard limit on the size of the buffer needed to + * store all the groups returned. + */ case _SC_GETGR_R_SIZE_MAX: case _SC_GETPW_R_SIZE_MAX: -#error "somebody needs to implement this" -#endif + return (-1); case _SC_HOST_NAME_MAX: return (MAXHOSTNAMELEN - 1); /* does not include \0 */ case _SC_LOGIN_NAME_MAX: From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 08:55:54 2014 Return-Path: Delivered-To: svn-src-stable-10@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 15A582EE; Wed, 16 Jul 2014 08:55: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 02DF62F46; Wed, 16 Jul 2014 08:55: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 s6G8trVZ055341; Wed, 16 Jul 2014 08:55:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6G8trUR055340; Wed, 16 Jul 2014 08:55:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407160855.s6G8trUR055340@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 16 Jul 2014 08:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268742 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 08:55:54 -0000 Author: kib Date: Wed Jul 16 08:55:53 2014 New Revision: 268742 URL: http://svnweb.freebsd.org/changeset/base/268742 Log: MFC r268471: For safety, ensure that any consumer of the set_regs() and ptrace_set_pc() use the correct return to userspace using iret. Modified: stable/10/sys/amd64/amd64/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Wed Jul 16 08:52:44 2014 (r268741) +++ stable/10/sys/amd64/amd64/machdep.c Wed Jul 16 08:55:53 2014 (r268742) @@ -1979,7 +1979,9 @@ makectx(struct trapframe *tf, struct pcb int ptrace_set_pc(struct thread *td, unsigned long addr) { + td->td_frame->tf_rip = addr; + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); return (0); } @@ -2079,8 +2081,8 @@ set_regs(struct thread *td, struct reg * tp->tf_fs = regs->r_fs; tp->tf_gs = regs->r_gs; tp->tf_flags = TF_HASSEGS; - set_pcb_flags(td->td_pcb, PCB_FULL_IRET); } + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); return (0); } From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 12:37:37 2014 Return-Path: Delivered-To: svn-src-stable-10@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 02442AA4; Wed, 16 Jul 2014 12:37: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 E26C322F3; Wed, 16 Jul 2014 12:37: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 s6GCbaEa060446; Wed, 16 Jul 2014 12:37:36 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6GCbalh060445; Wed, 16 Jul 2014 12:37:36 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201407161237.s6GCbalh060445@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 16 Jul 2014 12:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268752 - stable/10/usr.bin/calendar/calendars X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 12:37:37 -0000 Author: gavin Date: Wed Jul 16 12:37:36 2014 New Revision: 268752 URL: http://svnweb.freebsd.org/changeset/base/268752 Log: Merge r268292 from head: Dominion Day became Canada Day in 1982, update the holiday calendar. PR: 191533 Submitted by: db Modified: stable/10/usr.bin/calendar/calendars/calendar.holiday Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/calendar/calendars/calendar.holiday ============================================================================== --- stable/10/usr.bin/calendar/calendars/calendar.holiday Wed Jul 16 12:09:12 2014 (r268751) +++ stable/10/usr.bin/calendar/calendars/calendar.holiday Wed Jul 16 12:37:36 2014 (r268752) @@ -248,7 +248,7 @@ 06/30 Day of the Army in Guatemala 06/MonFirst Jefferson Davis's Birthday in Alabama & Mississippi (1st Monday) 06/MonFirst Jefferson Davis's Birthday in Florida, Georgia, & S. Carolina -07/01 Dominion Day in Canada +07/01 Canada Day 07/01 Freedom Day in Suriname 07/01 Independence Day in Burundi 07/01 National Day in Rwanda From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 12:41:51 2014 Return-Path: Delivered-To: svn-src-stable-10@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 66B3AE2C; Wed, 16 Jul 2014 12:41: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 533E12391; Wed, 16 Jul 2014 12:41: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 s6GCfpEg064361; Wed, 16 Jul 2014 12:41:51 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6GCfpcI064360; Wed, 16 Jul 2014 12:41:51 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201407161241.s6GCfpcI064360@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 16 Jul 2014 12:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268755 - stable/10/games/fortune/datfiles X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 12:41:51 -0000 Author: gavin Date: Wed Jul 16 12:41:50 2014 New Revision: 268755 URL: http://svnweb.freebsd.org/changeset/base/268755 Log: Merge r268295 from head: Fix equation and limerick to be correct. NetBSD fixed this 14 years ago (src/games/fortune/datfiles/fortunes2 1.7). PR: 188714 Submitted by: ksmakoto dd.iij4u.or.jp Modified: stable/10/games/fortune/datfiles/fortunes Directory Properties: stable/10/ (props changed) Modified: stable/10/games/fortune/datfiles/fortunes ============================================================================== --- stable/10/games/fortune/datfiles/fortunes Wed Jul 16 12:41:49 2014 (r268754) +++ stable/10/games/fortune/datfiles/fortunes Wed Jul 16 12:41:50 2014 (r268755) @@ -570,7 +570,7 @@ writing. Always pick on the correct idi the verb. Last but not least, avoid cliches like the plague; seek viable alternatives. % - 1/2 + 1/3 /\(3) | 2 1/3 | z dz cos(3 * PI / 9) = ln (e ) @@ -578,7 +578,7 @@ viable alternatives. \/ 1 The integral of z squared, dz -From 1 to the square root of 3 +From 1 to the cube root of 3 Times the cosine Of 3 PI over nine Is the log of the cube root of e From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 12:45:14 2014 Return-Path: Delivered-To: svn-src-stable-10@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 14D712A2; Wed, 16 Jul 2014 12:45: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 0165A23E8; Wed, 16 Jul 2014 12:45: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 s6GCjDG1065048; Wed, 16 Jul 2014 12:45:13 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6GCjDxO065047; Wed, 16 Jul 2014 12:45:13 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201407161245.s6GCjDxO065047@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 16 Jul 2014 12:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268756 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 12:45:14 -0000 Author: gavin Date: Wed Jul 16 12:45:13 2014 New Revision: 268756 URL: http://svnweb.freebsd.org/changeset/base/268756 Log: Merge r268342 from head: Remove /usr/share/doc/psd/28.cvs/paper.ps.gz if it exists, as it is obsolete since r251794. PR: 191003 Submitted by: Vick Khera Modified: stable/10/ObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Wed Jul 16 12:41:50 2014 (r268755) +++ stable/10/ObsoleteFiles.inc Wed Jul 16 12:45:13 2014 (r268756) @@ -442,6 +442,7 @@ OLD_FILES+=usr/share/man/man9/vfs_mount. OLD_FILES+=usr/bin/cvs OLD_FILES+=usr/bin/cvsbug OLD_FILES+=usr/share/doc/psd/28.cvs/paper.ascii.gz +OLD_FILES+=usr/share/doc/psd/28.cvs/paper.ps.gz OLD_DIRS+=usr/share/doc/psd/28.cvs OLD_FILES+=usr/share/examples/cvs/contrib/README OLD_FILES+=usr/share/examples/cvs/contrib/clmerge From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 12:49:57 2014 Return-Path: Delivered-To: svn-src-stable-10@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 60E619AA; Wed, 16 Jul 2014 12:49: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 4CF90247B; Wed, 16 Jul 2014 12:49: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 s6GCnvrP065873; Wed, 16 Jul 2014 12:49:57 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6GCnvSd065872; Wed, 16 Jul 2014 12:49:57 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201407161249.s6GCnvSd065872@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 16 Jul 2014 12:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268758 - stable/10/share/examples/etc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 12:49:57 -0000 Author: gavin Date: Wed Jul 16 12:49:56 2014 New Revision: 268758 URL: http://svnweb.freebsd.org/changeset/base/268758 Log: Merge r267865 from head: Drop example variables for updating over csup. These have not functioned since r251084 Modified: stable/10/share/examples/etc/make.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/etc/make.conf ============================================================================== --- stable/10/share/examples/etc/make.conf Wed Jul 16 12:49:42 2014 (r268757) +++ stable/10/share/examples/etc/make.conf Wed Jul 16 12:49:56 2014 (r268758) @@ -178,18 +178,6 @@ #ENABLE_SUID_K5SU= # # -# CVSup update flags. Edit SUPFILE settings to reflect whichever distribution -# file(s) you use on your site (see /usr/share/examples/cvsup/README for more -# information on CVSup and these files). To use, do "make update" in /usr/src. -# -#SUP_UPDATE= -# -#SUP= /usr/bin/csup -#SUPFLAGS= -L 2 -#SUPHOST= cvsup.uk.FreeBSD.org -#SUPFILE= /usr/share/examples/cvsup/standard-supfile -#PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile -# # top(1) uses a hash table for the user names. The size of this hash # can be tuned to match the number of local users. The table size should # be a prime number approximately twice as large as the number of lines in From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 12:51:30 2014 Return-Path: Delivered-To: svn-src-stable-10@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 32D9BBD1; Wed, 16 Jul 2014 12:51: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 1EE8C24B3; Wed, 16 Jul 2014 12:51: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 s6GCpTDS069278; Wed, 16 Jul 2014 12:51:29 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6GCpT7u069277; Wed, 16 Jul 2014 12:51:29 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201407161251.s6GCpT7u069277@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 16 Jul 2014 12:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268759 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 12:51:30 -0000 Author: gavin Date: Wed Jul 16 12:51:29 2014 New Revision: 268759 URL: http://svnweb.freebsd.org/changeset/base/268759 Log: Merge r267866 from head: Drop references to updating over csup from build(7). Modified: stable/10/share/man/man7/build.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/build.7 ============================================================================== --- stable/10/share/man/man7/build.7 Wed Jul 16 12:49:56 2014 (r268758) +++ stable/10/share/man/man7/build.7 Wed Jul 16 12:51:29 2014 (r268759) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 17, 2014 +.Dd June 25, 2014 .Dt BUILD 7 .Os .Sh NAME @@ -40,8 +40,7 @@ normally and .Pa /usr/ports . These directories may be initially empty or non-existent until updated with -.Xr csup 1 , -.Xr svn 1 , +.Xr svn 1 or .Xr portsnap 8 . Directory @@ -616,7 +615,6 @@ make TARGET=sparc64 DESTDIR=/clients/spa .Ed .Sh SEE ALSO .Xr cc 1 , -.Xr csup 1 , .Xr install 1 , .Xr make 1 , .Xr svn 1 , From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 12:57:53 2014 Return-Path: Delivered-To: svn-src-stable-10@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 B0C5612D; Wed, 16 Jul 2014 12:57: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 9D8ED2598; Wed, 16 Jul 2014 12:57: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 s6GCvrOw070551; Wed, 16 Jul 2014 12:57:53 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6GCvr59070550; Wed, 16 Jul 2014 12:57:53 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201407161257.s6GCvr59070550@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 16 Jul 2014 12:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268762 - stable/10/usr.sbin/uhsoctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 12:57:53 -0000 Author: gavin Date: Wed Jul 16 12:57:53 2014 New Revision: 268762 URL: http://svnweb.freebsd.org/changeset/base/268762 Log: Merge r268298,r268299 from head: Correct format string to fix build of uhsoctl when DEBUG is defined PR: 185007 Submitted by: saper saper.info Modified: stable/10/usr.sbin/uhsoctl/uhsoctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/uhsoctl/uhsoctl.c ============================================================================== --- stable/10/usr.sbin/uhsoctl/uhsoctl.c Wed Jul 16 12:57:50 2014 (r268761) +++ stable/10/usr.sbin/uhsoctl/uhsoctl.c Wed Jul 16 12:57:53 2014 (r268762) @@ -601,7 +601,7 @@ at_cmd(struct ctx *ctx, const char *resp if (resp != NULL) { l = strlen(resp); #ifdef DEBUG - fprintf(stderr, "SYNC_EXP: %s (%d)\n", resp, l); + fprintf(stderr, "SYNC_EXP: %s (%zu)\n", resp, l); #endif } From owner-svn-src-stable-10@FreeBSD.ORG Wed Jul 16 21:04:32 2014 Return-Path: Delivered-To: svn-src-stable-10@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 0D342DA3; Wed, 16 Jul 2014 21:04: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 E264F2362; Wed, 16 Jul 2014 21:04:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6GL4V1U008653; Wed, 16 Jul 2014 21:04:31 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6GL4VXo008650; Wed, 16 Jul 2014 21:04:31 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201407162104.s6GL4VXo008650@svn.freebsd.org> From: Dimitry Andric Date: Wed, 16 Jul 2014 21:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268775 - stable/10/lib/libproc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 21:04:32 -0000 Author: dim Date: Wed Jul 16 21:04:31 2014 New Revision: 268775 URL: http://svnweb.freebsd.org/changeset/base/268775 Log: MFC r268463: In libproc, avoid calling __cxa_demangle(), and thus depending on either libcxxrt or libsupc++, if WITHOUT_CXX is defined. [1] Noticed by: sbruno [1] However, on stable/10 this is more accurately described by WITHOUT_GNUCXX, so I've changed the test to that instead. Modified: stable/10/lib/libproc/Makefile stable/10/lib/libproc/proc_sym.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libproc/Makefile ============================================================================== --- stable/10/lib/libproc/Makefile Wed Jul 16 20:37:03 2014 (r268774) +++ stable/10/lib/libproc/Makefile Wed Jul 16 21:04:31 2014 (r268775) @@ -18,9 +18,11 @@ CFLAGS+= -I${.CURDIR} .if ${MK_LIBCPLUSPLUS} != "no" LDADD+= -lcxxrt DPADD+= ${LIBCXXRT} -.else +.elif ${MK_GNUCXX} != "no" LDADD+= -lsupc++ DPADD+= ${LIBSTDCPLUSPLUS} +.else +CFLAGS+= -DNO_CXA_DEMANGLE .endif SHLIB_MAJOR= 2 Modified: stable/10/lib/libproc/proc_sym.c ============================================================================== --- stable/10/lib/libproc/proc_sym.c Wed Jul 16 20:37:03 2014 (r268774) +++ stable/10/lib/libproc/proc_sym.c Wed Jul 16 21:04:31 2014 (r268775) @@ -46,27 +46,34 @@ #include "_libproc.h" +#ifndef NO_CXA_DEMANGLE extern char *__cxa_demangle(const char *, char *, size_t *, int *); +#endif /* NO_CXA_DEMANGLE */ static void proc_rdl2prmap(rd_loadobj_t *, prmap_t *); static void demangle(const char *symbol, char *buf, size_t len) { +#ifndef NO_CXA_DEMANGLE char *dembuf; - size_t demlen = len; + size_t demlen; - dembuf = malloc(len); - if (!dembuf) - goto fail; - dembuf = __cxa_demangle(symbol, dembuf, &demlen, NULL); - if (!dembuf) - goto fail; - strlcpy(buf, dembuf, len); - free(dembuf); + if (symbol[0] == '_' && symbol[1] == 'Z' && symbol[2]) { + dembuf = malloc(len); + if (!dembuf) + goto fail; + demlen = len; + dembuf = __cxa_demangle(symbol, dembuf, &demlen, NULL); + if (!dembuf) + goto fail; + strlcpy(buf, dembuf, len); + free(dembuf); + } return; fail: +#endif /* NO_CXA_DEMANGLE */ strlcpy(buf, symbol, len); } @@ -291,10 +298,7 @@ proc_addr2sym(struct proc_handle *p, uin if (addr >= rsym && addr < rsym + sym.st_size) { s = elf_strptr(e, dynsymstridx, sym.st_name); if (s) { - if (s[0] == '_' && s[1] == 'Z' && s[2]) - demangle(s, name, namesz); - else - strlcpy(name, s, namesz); + demangle(s, name, namesz); memcpy(symcopy, &sym, sizeof(sym)); /* * DTrace expects the st_value to contain @@ -329,10 +333,7 @@ symtab: if (addr >= rsym && addr < rsym + sym.st_size) { s = elf_strptr(e, symtabstridx, sym.st_name); if (s) { - if (s[0] == '_' && s[1] == 'Z' && s[2]) - demangle(s, name, namesz); - else - strlcpy(name, s, namesz); + demangle(s, name, namesz); memcpy(symcopy, &sym, sizeof(sym)); /* * DTrace expects the st_value to contain